diff --git a/district/migrations/0126_districtpdfpage.py b/district/migrations/0126_districtpdfpage.py new file mode 100644 index 0000000000000000000000000000000000000000..edd03c75275a003e5e24103a0c832b0700e93134 --- /dev/null +++ b/district/migrations/0126_districtpdfpage.py @@ -0,0 +1,65 @@ +# Generated by Django 4.1.10 on 2024-01-31 12:56 + +import django.db.models.deletion +import wagtailmetadata.models +from django.db import migrations, models + +import shared.models.base + + +class Migration(migrations.Migration): + dependencies = [ + ("wagtailcore", "0083_workflowcontenttype"), + ("wagtaildocs", "0012_uploadeddocument"), + ("wagtailimages", "0025_alter_image_file_alter_rendition_file"), + ("district", "0125_rename_date_districtarticlepage_timestamp"), + ] + + operations = [ + migrations.CreateModel( + name="DistrictPdfPage", + fields=[ + ( + "page_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="wagtailcore.page", + ), + ), + ( + "pdf_file", + models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="+", + to="wagtaildocs.document", + verbose_name="PDF dokument", + ), + ), + ( + "search_image", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="+", + to="wagtailimages.image", + verbose_name="Search image", + ), + ), + ], + options={ + "verbose_name": "PDF stránka", + }, + bases=( + wagtailmetadata.models.WagtailImageMetadataMixin, + shared.models.base.SubpageMixin, + "wagtailcore.page", + models.Model, + ), + ), + ] diff --git a/district/models.py b/district/models.py index 3ad5df291f9860084409524e7a8aa3416e9031d8..8cff85223792f8a377b398bc246a5b924f88b548 100644 --- a/district/models.py +++ b/district/models.py @@ -55,6 +55,7 @@ from shared.models import ( ExtendedMetadataPageMixin, FooterMixin, MenuMixin, + PdfPageMixin, SharedTaggedDistrictArticle, SubpageMixin, ) @@ -343,6 +344,7 @@ class DistrictHomePage( "district.DistrictInteractiveProgramPage", "district.DistrictGeoFeatureCollectionPage", "district.DistrictCalendarPage", + "district.DistrictPdfPage", ] ### OTHERS @@ -473,7 +475,7 @@ class DistrictArticlePage( ### RELATIONS parent_page_types = ["district.DistrictArticlesPage"] - subpage_types = [] + subpage_types = ["district.DistrictPdfPage"] ### OTHERS @@ -1988,3 +1990,26 @@ class DistrictGeoFeatureDetailPage( ) except ValueError as exc: raise ValidationError({"geojson": str(exc)}) from exc + + +class DistrictPdfPage(PdfPageMixin, MetadataPageMixin, SubpageMixin, Page): + """ + Single pdf page display + """ + + ### RELATIONS + + parent_page_types = [ + "district.DistrictHomePage", + "district.DistrictArticlePage", + ] + subpage_types = [] + + ### PANELS + + content_panels = Page.content_panels + PdfPageMixin.content_panels + + ### OTHER + + class Meta: + verbose_name = "PDF stránka" diff --git a/district/templates/district/district_pdf_page.html b/district/templates/district/district_pdf_page.html new file mode 100644 index 0000000000000000000000000000000000000000..dd4bd8bceaa0f05392b415c7a655eed2958feaf8 --- /dev/null +++ b/district/templates/district/district_pdf_page.html @@ -0,0 +1,5 @@ +{% extends "district/base.html" %} + +{% block content %} + {% include "shared/pdf_snippet.html" with download_link=True %} +{% endblock %} diff --git a/donate/migrations/0042_remove_donatehomepage_custom_url_1_and_more.py b/donate/migrations/0042_remove_donatehomepage_custom_url_1_and_more.py index a39db0a759524c28ee11cc056d4c386b71b77c8e..556f56cf55f976705b5c551ac694c634eeebf937 100644 --- a/donate/migrations/0042_remove_donatehomepage_custom_url_1_and_more.py +++ b/donate/migrations/0042_remove_donatehomepage_custom_url_1_and_more.py @@ -1,36 +1,51 @@ # Generated by Django 4.1.10 on 2024-01-30 16:54 -from django.db import migrations import wagtail.blocks import wagtail.fields +from django.db import migrations class Migration(migrations.Migration): - dependencies = [ - ('donate', '0041_donateprojectpage_is_sticky_and_more'), + ("donate", "0041_donateprojectpage_is_sticky_and_more"), ] operations = [ migrations.RemoveField( - model_name='donatehomepage', - name='custom_url_1', + model_name="donatehomepage", + name="custom_url_1", ), migrations.RemoveField( - model_name='donatehomepage', - name='custom_url_1_text', + model_name="donatehomepage", + name="custom_url_1_text", ), migrations.RemoveField( - model_name='donatehomepage', - name='custom_url_2', + model_name="donatehomepage", + name="custom_url_2", ), migrations.RemoveField( - model_name='donatehomepage', - name='custom_url_2_text', + model_name="donatehomepage", + name="custom_url_2_text", ), migrations.AddField( - model_name='donatehomepage', - name='custom_links', - field=wagtail.fields.StreamField([('custom_link', wagtail.blocks.StructBlock([('text', wagtail.blocks.CharBlock(label='Nadpis')), ('url', wagtail.blocks.URLBlock(label='Odkaz'))], label='Vlastní odkaz'))], blank=True, use_json_field=True, verbose_name='Vlastní odkazy'), + model_name="donatehomepage", + name="custom_links", + field=wagtail.fields.StreamField( + [ + ( + "custom_link", + wagtail.blocks.StructBlock( + [ + ("text", wagtail.blocks.CharBlock(label="Nadpis")), + ("url", wagtail.blocks.URLBlock(label="Odkaz")), + ], + label="Vlastní odkaz", + ), + ) + ], + blank=True, + use_json_field=True, + verbose_name="Vlastní odkazy", + ), ), ] diff --git a/donate/static/donate/assets/css/style.css b/donate/static/donate/assets/css/style.css index 01a67ecc1d0454e1a729741f6ec7fc1102871079..a992383afdeedaaca7c965fa0fc0140795863449 100644 --- a/donate/static/donate/assets/css/style.css +++ b/donate/static/donate/assets/css/style.css @@ -650,8 +650,8 @@ footer h1, footer h2, footer h3, footer h4, footer h5, footer h6 { } .project-images > div{ - padding-right: 7.5px; - padding-left: 7.5px; + padding-right: 6.25px; + padding-left: 6.25px; margin-bottom: 15px; } diff --git a/shared/models/base.py b/shared/models/base.py index 59d814153cc0d190b40a1cf77fe2655ca2754430..c7f9a4837645656318ca66eae499b4fd7fb37fe3 100644 --- a/shared/models/base.py +++ b/shared/models/base.py @@ -14,6 +14,7 @@ from django.utils import timezone from modelcluster.fields import ParentalKey, ParentalManyToManyField from taggit.models import ItemBase, Tag, TagBase from wagtail.admin.panels import FieldPanel, MultiFieldPanel, PublishingPanel +from wagtail.documents.models import Document from wagtail.fields import StreamField from wagtail.models import Page from wagtail.search import index @@ -1002,3 +1003,29 @@ class ArticlesPageMixin(ArticlesMixin, models.Model): class Meta: abstract = True + + +class PdfPageMixin(models.Model): + """ + Use this mixin in a page model for parsing PDFs + """ + + pdf_file = models.ForeignKey( + Document, + null=True, + blank=False, + on_delete=models.SET_NULL, + related_name="+", + verbose_name="PDF dokument", + ) + + content_panels = [ + FieldPanel("pdf_file"), + ] + + class Meta: + abstract = True + + @property + def pdf_url(self): + return self.pdf_file.url diff --git a/shared/static/shared/js/pdf_page.js b/shared/static/shared/js/pdf_page.js new file mode 100644 index 0000000000000000000000000000000000000000..44979ca37472c55ec8494a213a2321d51a5bbc9c --- /dev/null +++ b/shared/static/shared/js/pdf_page.js @@ -0,0 +1,31 @@ +// Loaded via <script> tag, create shortcut to access PDF.js exports. +var pdfjsLib = window["pdfjs-dist/build/pdf"]; + +[...document.querySelectorAll("[data-name='inline-pdf']")].forEach( + async (script) => { + if (!script.dataset.init) { + const parentNode = script.parentNode; + const docUrl = script.dataset.url; + const pdf = await pdfjsLib.getDocument(docUrl).promise; + for (let pageNumber = 1; pageNumber <= pdf.numPages; pageNumber++) { + const page = await pdf.getPage(pageNumber); + const viewport = page.getViewport({ scale: 1.5 }); + + // Prepare canvas using PDF page dimensions + const canvas = document.createElement("canvas"); + canvas.setAttribute("aria-hidden", "true"); + const context = canvas.getContext("2d"); + canvas.height = viewport.height; + canvas.width = viewport.width; + + // Render PDF page into canvas context + await page.render({ + canvasContext: context, + viewport: viewport, + }); + parentNode.appendChild(canvas); + } + script.dataset.init = true; + } + } +); diff --git a/shared/static/shared/vendor/pdf.js-4.0.379/pdf.mjs b/shared/static/shared/vendor/pdf.js-4.0.379/pdf.mjs new file mode 100644 index 0000000000000000000000000000000000000000..a6d38cbbf97abf6dccdff93b17fb17d22dde5415 --- /dev/null +++ b/shared/static/shared/vendor/pdf.js-4.0.379/pdf.mjs @@ -0,0 +1,18151 @@ +/** + * @licstart The following is the entire license notice for the + * JavaScript code in this page + * + * Copyright 2023 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @licend The above is the entire license notice for the + * JavaScript code in this page + */ + +/******/ var __webpack_modules__ = ({ + +/***/ 640: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + AnnotationLayer: () => (/* binding */ AnnotationLayer), + FreeTextAnnotationElement: () => (/* binding */ FreeTextAnnotationElement), + InkAnnotationElement: () => (/* binding */ InkAnnotationElement), + StampAnnotationElement: () => (/* binding */ StampAnnotationElement) +}); + +// EXTERNAL MODULE: ./src/shared/util.js +var util = __webpack_require__(266); +// EXTERNAL MODULE: ./src/display/display_utils.js +var display_utils = __webpack_require__(473); +// EXTERNAL MODULE: ./src/display/annotation_storage.js +var annotation_storage = __webpack_require__(780); +;// CONCATENATED MODULE: ./src/shared/scripting_utils.js +function makeColorComp(n) { + return Math.floor(Math.max(0, Math.min(1, n)) * 255).toString(16).padStart(2, "0"); +} +function scaleAndClamp(x) { + return Math.max(0, Math.min(255, 255 * x)); +} +class ColorConverters { + static CMYK_G([c, y, m, k]) { + return ["G", 1 - Math.min(1, 0.3 * c + 0.59 * m + 0.11 * y + k)]; + } + static G_CMYK([g]) { + return ["CMYK", 0, 0, 0, 1 - g]; + } + static G_RGB([g]) { + return ["RGB", g, g, g]; + } + static G_rgb([g]) { + g = scaleAndClamp(g); + return [g, g, g]; + } + static G_HTML([g]) { + const G = makeColorComp(g); + return `#${G}${G}${G}`; + } + static RGB_G([r, g, b]) { + return ["G", 0.3 * r + 0.59 * g + 0.11 * b]; + } + static RGB_rgb(color) { + return color.map(scaleAndClamp); + } + static RGB_HTML(color) { + return `#${color.map(makeColorComp).join("")}`; + } + static T_HTML() { + return "#00000000"; + } + static T_rgb() { + return [null]; + } + static CMYK_RGB([c, y, m, k]) { + return ["RGB", 1 - Math.min(1, c + k), 1 - Math.min(1, m + k), 1 - Math.min(1, y + k)]; + } + static CMYK_rgb([c, y, m, k]) { + return [scaleAndClamp(1 - Math.min(1, c + k)), scaleAndClamp(1 - Math.min(1, m + k)), scaleAndClamp(1 - Math.min(1, y + k))]; + } + static CMYK_HTML(components) { + const rgb = this.CMYK_RGB(components).slice(1); + return this.RGB_HTML(rgb); + } + static RGB_CMYK([r, g, b]) { + const c = 1 - r; + const m = 1 - g; + const y = 1 - b; + const k = Math.min(c, m, y); + return ["CMYK", c, m, y, k]; + } +} + +// EXTERNAL MODULE: ./src/display/xfa_layer.js +var xfa_layer = __webpack_require__(160); +;// CONCATENATED MODULE: ./src/display/annotation_layer.js + + + + + +const DEFAULT_TAB_INDEX = 1000; +const DEFAULT_FONT_SIZE = 9; +const GetElementsByNameSet = new WeakSet(); +function getRectDims(rect) { + return { + width: rect[2] - rect[0], + height: rect[3] - rect[1] + }; +} +class AnnotationElementFactory { + static create(parameters) { + const subtype = parameters.data.annotationType; + switch (subtype) { + case util.AnnotationType.LINK: + return new LinkAnnotationElement(parameters); + case util.AnnotationType.TEXT: + return new TextAnnotationElement(parameters); + case util.AnnotationType.WIDGET: + const fieldType = parameters.data.fieldType; + switch (fieldType) { + case "Tx": + return new TextWidgetAnnotationElement(parameters); + case "Btn": + if (parameters.data.radioButton) { + return new RadioButtonWidgetAnnotationElement(parameters); + } else if (parameters.data.checkBox) { + return new CheckboxWidgetAnnotationElement(parameters); + } + return new PushButtonWidgetAnnotationElement(parameters); + case "Ch": + return new ChoiceWidgetAnnotationElement(parameters); + case "Sig": + return new SignatureWidgetAnnotationElement(parameters); + } + return new WidgetAnnotationElement(parameters); + case util.AnnotationType.POPUP: + return new PopupAnnotationElement(parameters); + case util.AnnotationType.FREETEXT: + return new FreeTextAnnotationElement(parameters); + case util.AnnotationType.LINE: + return new LineAnnotationElement(parameters); + case util.AnnotationType.SQUARE: + return new SquareAnnotationElement(parameters); + case util.AnnotationType.CIRCLE: + return new CircleAnnotationElement(parameters); + case util.AnnotationType.POLYLINE: + return new PolylineAnnotationElement(parameters); + case util.AnnotationType.CARET: + return new CaretAnnotationElement(parameters); + case util.AnnotationType.INK: + return new InkAnnotationElement(parameters); + case util.AnnotationType.POLYGON: + return new PolygonAnnotationElement(parameters); + case util.AnnotationType.HIGHLIGHT: + return new HighlightAnnotationElement(parameters); + case util.AnnotationType.UNDERLINE: + return new UnderlineAnnotationElement(parameters); + case util.AnnotationType.SQUIGGLY: + return new SquigglyAnnotationElement(parameters); + case util.AnnotationType.STRIKEOUT: + return new StrikeOutAnnotationElement(parameters); + case util.AnnotationType.STAMP: + return new StampAnnotationElement(parameters); + case util.AnnotationType.FILEATTACHMENT: + return new FileAttachmentAnnotationElement(parameters); + default: + return new AnnotationElement(parameters); + } + } +} +class AnnotationElement { + #hasBorder = false; + constructor(parameters, { + isRenderable = false, + ignoreBorder = false, + createQuadrilaterals = false + } = {}) { + this.isRenderable = isRenderable; + this.data = parameters.data; + this.layer = parameters.layer; + this.linkService = parameters.linkService; + this.downloadManager = parameters.downloadManager; + this.imageResourcesPath = parameters.imageResourcesPath; + this.renderForms = parameters.renderForms; + this.svgFactory = parameters.svgFactory; + this.annotationStorage = parameters.annotationStorage; + this.enableScripting = parameters.enableScripting; + this.hasJSActions = parameters.hasJSActions; + this._fieldObjects = parameters.fieldObjects; + this.parent = parameters.parent; + if (isRenderable) { + this.container = this._createContainer(ignoreBorder); + } + if (createQuadrilaterals) { + this._createQuadrilaterals(); + } + } + static _hasPopupData({ + titleObj, + contentsObj, + richText + }) { + return !!(titleObj?.str || contentsObj?.str || richText?.str); + } + get hasPopupData() { + return AnnotationElement._hasPopupData(this.data); + } + _createContainer(ignoreBorder) { + const { + data, + parent: { + page, + viewport + } + } = this; + const container = document.createElement("section"); + container.setAttribute("data-annotation-id", data.id); + if (!(this instanceof WidgetAnnotationElement)) { + container.tabIndex = DEFAULT_TAB_INDEX; + } + container.style.zIndex = this.parent.zIndex++; + if (this.data.popupRef) { + container.setAttribute("aria-haspopup", "dialog"); + } + if (data.noRotate) { + container.classList.add("norotate"); + } + const { + pageWidth, + pageHeight, + pageX, + pageY + } = viewport.rawDims; + if (!data.rect || this instanceof PopupAnnotationElement) { + const { + rotation + } = data; + if (!data.hasOwnCanvas && rotation !== 0) { + this.setRotation(rotation, container); + } + return container; + } + const { + width, + height + } = getRectDims(data.rect); + const rect = util.Util.normalizeRect([data.rect[0], page.view[3] - data.rect[1] + page.view[1], data.rect[2], page.view[3] - data.rect[3] + page.view[1]]); + if (!ignoreBorder && data.borderStyle.width > 0) { + container.style.borderWidth = `${data.borderStyle.width}px`; + const horizontalRadius = data.borderStyle.horizontalCornerRadius; + const verticalRadius = data.borderStyle.verticalCornerRadius; + if (horizontalRadius > 0 || verticalRadius > 0) { + const radius = `calc(${horizontalRadius}px * var(--scale-factor)) / calc(${verticalRadius}px * var(--scale-factor))`; + container.style.borderRadius = radius; + } else if (this instanceof RadioButtonWidgetAnnotationElement) { + const radius = `calc(${width}px * var(--scale-factor)) / calc(${height}px * var(--scale-factor))`; + container.style.borderRadius = radius; + } + switch (data.borderStyle.style) { + case util.AnnotationBorderStyleType.SOLID: + container.style.borderStyle = "solid"; + break; + case util.AnnotationBorderStyleType.DASHED: + container.style.borderStyle = "dashed"; + break; + case util.AnnotationBorderStyleType.BEVELED: + (0,util.warn)("Unimplemented border style: beveled"); + break; + case util.AnnotationBorderStyleType.INSET: + (0,util.warn)("Unimplemented border style: inset"); + break; + case util.AnnotationBorderStyleType.UNDERLINE: + container.style.borderBottomStyle = "solid"; + break; + default: + break; + } + const borderColor = data.borderColor || null; + if (borderColor) { + this.#hasBorder = true; + container.style.borderColor = util.Util.makeHexColor(borderColor[0] | 0, borderColor[1] | 0, borderColor[2] | 0); + } else { + container.style.borderWidth = 0; + } + } + container.style.left = `${100 * (rect[0] - pageX) / pageWidth}%`; + container.style.top = `${100 * (rect[1] - pageY) / pageHeight}%`; + const { + rotation + } = data; + if (data.hasOwnCanvas || rotation === 0) { + container.style.width = `${100 * width / pageWidth}%`; + container.style.height = `${100 * height / pageHeight}%`; + } else { + this.setRotation(rotation, container); + } + return container; + } + setRotation(angle, container = this.container) { + if (!this.data.rect) { + return; + } + const { + pageWidth, + pageHeight + } = this.parent.viewport.rawDims; + const { + width, + height + } = getRectDims(this.data.rect); + let elementWidth, elementHeight; + if (angle % 180 === 0) { + elementWidth = 100 * width / pageWidth; + elementHeight = 100 * height / pageHeight; + } else { + elementWidth = 100 * height / pageWidth; + elementHeight = 100 * width / pageHeight; + } + container.style.width = `${elementWidth}%`; + container.style.height = `${elementHeight}%`; + container.setAttribute("data-main-rotation", (360 - angle) % 360); + } + get _commonActions() { + const setColor = (jsName, styleName, event) => { + const color = event.detail[jsName]; + const colorType = color[0]; + const colorArray = color.slice(1); + event.target.style[styleName] = ColorConverters[`${colorType}_HTML`](colorArray); + this.annotationStorage.setValue(this.data.id, { + [styleName]: ColorConverters[`${colorType}_rgb`](colorArray) + }); + }; + return (0,util.shadow)(this, "_commonActions", { + display: event => { + const { + display + } = event.detail; + const hidden = display % 2 === 1; + this.container.style.visibility = hidden ? "hidden" : "visible"; + this.annotationStorage.setValue(this.data.id, { + noView: hidden, + noPrint: display === 1 || display === 2 + }); + }, + print: event => { + this.annotationStorage.setValue(this.data.id, { + noPrint: !event.detail.print + }); + }, + hidden: event => { + const { + hidden + } = event.detail; + this.container.style.visibility = hidden ? "hidden" : "visible"; + this.annotationStorage.setValue(this.data.id, { + noPrint: hidden, + noView: hidden + }); + }, + focus: event => { + setTimeout(() => event.target.focus({ + preventScroll: false + }), 0); + }, + userName: event => { + event.target.title = event.detail.userName; + }, + readonly: event => { + event.target.disabled = event.detail.readonly; + }, + required: event => { + this._setRequired(event.target, event.detail.required); + }, + bgColor: event => { + setColor("bgColor", "backgroundColor", event); + }, + fillColor: event => { + setColor("fillColor", "backgroundColor", event); + }, + fgColor: event => { + setColor("fgColor", "color", event); + }, + textColor: event => { + setColor("textColor", "color", event); + }, + borderColor: event => { + setColor("borderColor", "borderColor", event); + }, + strokeColor: event => { + setColor("strokeColor", "borderColor", event); + }, + rotation: event => { + const angle = event.detail.rotation; + this.setRotation(angle); + this.annotationStorage.setValue(this.data.id, { + rotation: angle + }); + } + }); + } + _dispatchEventFromSandbox(actions, jsEvent) { + const commonActions = this._commonActions; + for (const name of Object.keys(jsEvent.detail)) { + const action = actions[name] || commonActions[name]; + action?.(jsEvent); + } + } + _setDefaultPropertiesFromJS(element) { + if (!this.enableScripting) { + return; + } + const storedData = this.annotationStorage.getRawValue(this.data.id); + if (!storedData) { + return; + } + const commonActions = this._commonActions; + for (const [actionName, detail] of Object.entries(storedData)) { + const action = commonActions[actionName]; + if (action) { + const eventProxy = { + detail: { + [actionName]: detail + }, + target: element + }; + action(eventProxy); + delete storedData[actionName]; + } + } + } + _createQuadrilaterals() { + if (!this.container) { + return; + } + const { + quadPoints + } = this.data; + if (!quadPoints) { + return; + } + const [rectBlX, rectBlY, rectTrX, rectTrY] = this.data.rect; + if (quadPoints.length === 1) { + const [, { + x: trX, + y: trY + }, { + x: blX, + y: blY + }] = quadPoints[0]; + if (rectTrX === trX && rectTrY === trY && rectBlX === blX && rectBlY === blY) { + return; + } + } + const { + style + } = this.container; + let svgBuffer; + if (this.#hasBorder) { + const { + borderColor, + borderWidth + } = style; + style.borderWidth = 0; + svgBuffer = ["url('data:image/svg+xml;utf8,", `<svg xmlns="http://www.w3.org/2000/svg"`, ` preserveAspectRatio="none" viewBox="0 0 1 1">`, `<g fill="transparent" stroke="${borderColor}" stroke-width="${borderWidth}">`]; + this.container.classList.add("hasBorder"); + } + const width = rectTrX - rectBlX; + const height = rectTrY - rectBlY; + const { + svgFactory + } = this; + const svg = svgFactory.createElement("svg"); + svg.classList.add("quadrilateralsContainer"); + svg.setAttribute("width", 0); + svg.setAttribute("height", 0); + const defs = svgFactory.createElement("defs"); + svg.append(defs); + const clipPath = svgFactory.createElement("clipPath"); + const id = `clippath_${this.data.id}`; + clipPath.setAttribute("id", id); + clipPath.setAttribute("clipPathUnits", "objectBoundingBox"); + defs.append(clipPath); + for (const [, { + x: trX, + y: trY + }, { + x: blX, + y: blY + }] of quadPoints) { + const rect = svgFactory.createElement("rect"); + const x = (blX - rectBlX) / width; + const y = (rectTrY - trY) / height; + const rectWidth = (trX - blX) / width; + const rectHeight = (trY - blY) / height; + rect.setAttribute("x", x); + rect.setAttribute("y", y); + rect.setAttribute("width", rectWidth); + rect.setAttribute("height", rectHeight); + clipPath.append(rect); + svgBuffer?.push(`<rect vector-effect="non-scaling-stroke" x="${x}" y="${y}" width="${rectWidth}" height="${rectHeight}"/>`); + } + if (this.#hasBorder) { + svgBuffer.push(`</g></svg>')`); + style.backgroundImage = svgBuffer.join(""); + } + this.container.append(svg); + this.container.style.clipPath = `url(#${id})`; + } + _createPopup() { + const { + container, + data + } = this; + container.setAttribute("aria-haspopup", "dialog"); + const popup = new PopupAnnotationElement({ + data: { + color: data.color, + titleObj: data.titleObj, + modificationDate: data.modificationDate, + contentsObj: data.contentsObj, + richText: data.richText, + parentRect: data.rect, + borderStyle: 0, + id: `popup_${data.id}`, + rotation: data.rotation + }, + parent: this.parent, + elements: [this] + }); + this.parent.div.append(popup.render()); + } + render() { + (0,util.unreachable)("Abstract method `AnnotationElement.render` called"); + } + _getElementsByName(name, skipId = null) { + const fields = []; + if (this._fieldObjects) { + const fieldObj = this._fieldObjects[name]; + if (fieldObj) { + for (const { + page, + id, + exportValues + } of fieldObj) { + if (page === -1) { + continue; + } + if (id === skipId) { + continue; + } + const exportValue = typeof exportValues === "string" ? exportValues : null; + const domElement = document.querySelector(`[data-element-id="${id}"]`); + if (domElement && !GetElementsByNameSet.has(domElement)) { + (0,util.warn)(`_getElementsByName - element not allowed: ${id}`); + continue; + } + fields.push({ + id, + exportValue, + domElement + }); + } + } + return fields; + } + for (const domElement of document.getElementsByName(name)) { + const { + exportValue + } = domElement; + const id = domElement.getAttribute("data-element-id"); + if (id === skipId) { + continue; + } + if (!GetElementsByNameSet.has(domElement)) { + continue; + } + fields.push({ + id, + exportValue, + domElement + }); + } + return fields; + } + show() { + if (this.container) { + this.container.hidden = false; + } + this.popup?.maybeShow(); + } + hide() { + if (this.container) { + this.container.hidden = true; + } + this.popup?.forceHide(); + } + getElementsToTriggerPopup() { + return this.container; + } + addHighlightArea() { + const triggers = this.getElementsToTriggerPopup(); + if (Array.isArray(triggers)) { + for (const element of triggers) { + element.classList.add("highlightArea"); + } + } else { + triggers.classList.add("highlightArea"); + } + } + get _isEditable() { + return false; + } + _editOnDoubleClick() { + if (!this._isEditable) { + return; + } + const { + annotationEditorType: mode, + data: { + id: editId + } + } = this; + this.container.addEventListener("dblclick", () => { + this.linkService.eventBus?.dispatch("switchannotationeditormode", { + source: this, + mode, + editId + }); + }); + } +} +class LinkAnnotationElement extends AnnotationElement { + constructor(parameters, options = null) { + super(parameters, { + isRenderable: true, + ignoreBorder: !!options?.ignoreBorder, + createQuadrilaterals: true + }); + this.isTooltipOnly = parameters.data.isTooltipOnly; + } + render() { + const { + data, + linkService + } = this; + const link = document.createElement("a"); + link.setAttribute("data-element-id", data.id); + let isBound = false; + if (data.url) { + linkService.addLinkAttributes(link, data.url, data.newWindow); + isBound = true; + } else if (data.action) { + this._bindNamedAction(link, data.action); + isBound = true; + } else if (data.attachment) { + this.#bindAttachment(link, data.attachment, data.attachmentDest); + isBound = true; + } else if (data.setOCGState) { + this.#bindSetOCGState(link, data.setOCGState); + isBound = true; + } else if (data.dest) { + this._bindLink(link, data.dest); + isBound = true; + } else { + if (data.actions && (data.actions.Action || data.actions["Mouse Up"] || data.actions["Mouse Down"]) && this.enableScripting && this.hasJSActions) { + this._bindJSAction(link, data); + isBound = true; + } + if (data.resetForm) { + this._bindResetFormAction(link, data.resetForm); + isBound = true; + } else if (this.isTooltipOnly && !isBound) { + this._bindLink(link, ""); + isBound = true; + } + } + this.container.classList.add("linkAnnotation"); + if (isBound) { + this.container.append(link); + } + return this.container; + } + #setInternalLink() { + this.container.setAttribute("data-internal-link", ""); + } + _bindLink(link, destination) { + link.href = this.linkService.getDestinationHash(destination); + link.onclick = () => { + if (destination) { + this.linkService.goToDestination(destination); + } + return false; + }; + if (destination || destination === "") { + this.#setInternalLink(); + } + } + _bindNamedAction(link, action) { + link.href = this.linkService.getAnchorUrl(""); + link.onclick = () => { + this.linkService.executeNamedAction(action); + return false; + }; + this.#setInternalLink(); + } + #bindAttachment(link, attachment, dest = null) { + link.href = this.linkService.getAnchorUrl(""); + link.onclick = () => { + this.downloadManager?.openOrDownloadData(attachment.content, attachment.filename, dest); + return false; + }; + this.#setInternalLink(); + } + #bindSetOCGState(link, action) { + link.href = this.linkService.getAnchorUrl(""); + link.onclick = () => { + this.linkService.executeSetOCGState(action); + return false; + }; + this.#setInternalLink(); + } + _bindJSAction(link, data) { + link.href = this.linkService.getAnchorUrl(""); + const map = new Map([["Action", "onclick"], ["Mouse Up", "onmouseup"], ["Mouse Down", "onmousedown"]]); + for (const name of Object.keys(data.actions)) { + const jsName = map.get(name); + if (!jsName) { + continue; + } + link[jsName] = () => { + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id: data.id, + name + } + }); + return false; + }; + } + if (!link.onclick) { + link.onclick = () => false; + } + this.#setInternalLink(); + } + _bindResetFormAction(link, resetForm) { + const otherClickAction = link.onclick; + if (!otherClickAction) { + link.href = this.linkService.getAnchorUrl(""); + } + this.#setInternalLink(); + if (!this._fieldObjects) { + (0,util.warn)(`_bindResetFormAction - "resetForm" action not supported, ` + "ensure that the `fieldObjects` parameter is provided."); + if (!otherClickAction) { + link.onclick = () => false; + } + return; + } + link.onclick = () => { + otherClickAction?.(); + const { + fields: resetFormFields, + refs: resetFormRefs, + include + } = resetForm; + const allFields = []; + if (resetFormFields.length !== 0 || resetFormRefs.length !== 0) { + const fieldIds = new Set(resetFormRefs); + for (const fieldName of resetFormFields) { + const fields = this._fieldObjects[fieldName] || []; + for (const { + id + } of fields) { + fieldIds.add(id); + } + } + for (const fields of Object.values(this._fieldObjects)) { + for (const field of fields) { + if (fieldIds.has(field.id) === include) { + allFields.push(field); + } + } + } + } else { + for (const fields of Object.values(this._fieldObjects)) { + allFields.push(...fields); + } + } + const storage = this.annotationStorage; + const allIds = []; + for (const field of allFields) { + const { + id + } = field; + allIds.push(id); + switch (field.type) { + case "text": + { + const value = field.defaultValue || ""; + storage.setValue(id, { + value + }); + break; + } + case "checkbox": + case "radiobutton": + { + const value = field.defaultValue === field.exportValues; + storage.setValue(id, { + value + }); + break; + } + case "combobox": + case "listbox": + { + const value = field.defaultValue || ""; + storage.setValue(id, { + value + }); + break; + } + default: + continue; + } + const domElement = document.querySelector(`[data-element-id="${id}"]`); + if (!domElement) { + continue; + } else if (!GetElementsByNameSet.has(domElement)) { + (0,util.warn)(`_bindResetFormAction - element not allowed: ${id}`); + continue; + } + domElement.dispatchEvent(new Event("resetform")); + } + if (this.enableScripting) { + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id: "app", + ids: allIds, + name: "ResetForm" + } + }); + } + return false; + }; + } +} +class TextAnnotationElement extends AnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: true + }); + } + render() { + this.container.classList.add("textAnnotation"); + const image = document.createElement("img"); + image.src = this.imageResourcesPath + "annotation-" + this.data.name.toLowerCase() + ".svg"; + image.setAttribute("data-l10n-id", "pdfjs-text-annotation-type"); + image.setAttribute("data-l10n-args", JSON.stringify({ + type: this.data.name + })); + if (!this.data.popupRef && this.hasPopupData) { + this._createPopup(); + } + this.container.append(image); + return this.container; + } +} +class WidgetAnnotationElement extends AnnotationElement { + render() { + if (this.data.alternativeText) { + this.container.title = this.data.alternativeText; + } + return this.container; + } + showElementAndHideCanvas(element) { + if (this.data.hasOwnCanvas) { + if (element.previousSibling?.nodeName === "CANVAS") { + element.previousSibling.hidden = true; + } + element.hidden = false; + } + } + _getKeyModifier(event) { + return util.FeatureTest.platform.isMac ? event.metaKey : event.ctrlKey; + } + _setEventListener(element, elementData, baseName, eventName, valueGetter) { + if (baseName.includes("mouse")) { + element.addEventListener(baseName, event => { + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id: this.data.id, + name: eventName, + value: valueGetter(event), + shift: event.shiftKey, + modifier: this._getKeyModifier(event) + } + }); + }); + } else { + element.addEventListener(baseName, event => { + if (baseName === "blur") { + if (!elementData.focused || !event.relatedTarget) { + return; + } + elementData.focused = false; + } else if (baseName === "focus") { + if (elementData.focused) { + return; + } + elementData.focused = true; + } + if (!valueGetter) { + return; + } + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id: this.data.id, + name: eventName, + value: valueGetter(event) + } + }); + }); + } + } + _setEventListeners(element, elementData, names, getter) { + for (const [baseName, eventName] of names) { + if (eventName === "Action" || this.data.actions?.[eventName]) { + if (eventName === "Focus" || eventName === "Blur") { + elementData ||= { + focused: false + }; + } + this._setEventListener(element, elementData, baseName, eventName, getter); + if (eventName === "Focus" && !this.data.actions?.Blur) { + this._setEventListener(element, elementData, "blur", "Blur", null); + } else if (eventName === "Blur" && !this.data.actions?.Focus) { + this._setEventListener(element, elementData, "focus", "Focus", null); + } + } + } + } + _setBackgroundColor(element) { + const color = this.data.backgroundColor || null; + element.style.backgroundColor = color === null ? "transparent" : util.Util.makeHexColor(color[0], color[1], color[2]); + } + _setTextStyle(element) { + const TEXT_ALIGNMENT = ["left", "center", "right"]; + const { + fontColor + } = this.data.defaultAppearanceData; + const fontSize = this.data.defaultAppearanceData.fontSize || DEFAULT_FONT_SIZE; + const style = element.style; + let computedFontSize; + const BORDER_SIZE = 2; + const roundToOneDecimal = x => Math.round(10 * x) / 10; + if (this.data.multiLine) { + const height = Math.abs(this.data.rect[3] - this.data.rect[1] - BORDER_SIZE); + const numberOfLines = Math.round(height / (util.LINE_FACTOR * fontSize)) || 1; + const lineHeight = height / numberOfLines; + computedFontSize = Math.min(fontSize, roundToOneDecimal(lineHeight / util.LINE_FACTOR)); + } else { + const height = Math.abs(this.data.rect[3] - this.data.rect[1] - BORDER_SIZE); + computedFontSize = Math.min(fontSize, roundToOneDecimal(height / util.LINE_FACTOR)); + } + style.fontSize = `calc(${computedFontSize}px * var(--scale-factor))`; + style.color = util.Util.makeHexColor(fontColor[0], fontColor[1], fontColor[2]); + if (this.data.textAlignment !== null) { + style.textAlign = TEXT_ALIGNMENT[this.data.textAlignment]; + } + } + _setRequired(element, isRequired) { + if (isRequired) { + element.setAttribute("required", true); + } else { + element.removeAttribute("required"); + } + element.setAttribute("aria-required", isRequired); + } +} +class TextWidgetAnnotationElement extends WidgetAnnotationElement { + constructor(parameters) { + const isRenderable = parameters.renderForms || parameters.data.hasOwnCanvas || !parameters.data.hasAppearance && !!parameters.data.fieldValue; + super(parameters, { + isRenderable + }); + } + setPropertyOnSiblings(base, key, value, keyInStorage) { + const storage = this.annotationStorage; + for (const element of this._getElementsByName(base.name, base.id)) { + if (element.domElement) { + element.domElement[key] = value; + } + storage.setValue(element.id, { + [keyInStorage]: value + }); + } + } + render() { + const storage = this.annotationStorage; + const id = this.data.id; + this.container.classList.add("textWidgetAnnotation"); + let element = null; + if (this.renderForms) { + const storedData = storage.getValue(id, { + value: this.data.fieldValue + }); + let textContent = storedData.value || ""; + const maxLen = storage.getValue(id, { + charLimit: this.data.maxLen + }).charLimit; + if (maxLen && textContent.length > maxLen) { + textContent = textContent.slice(0, maxLen); + } + let fieldFormattedValues = storedData.formattedValue || this.data.textContent?.join("\n") || null; + if (fieldFormattedValues && this.data.comb) { + fieldFormattedValues = fieldFormattedValues.replaceAll(/\s+/g, ""); + } + const elementData = { + userValue: textContent, + formattedValue: fieldFormattedValues, + lastCommittedValue: null, + commitKey: 1, + focused: false + }; + if (this.data.multiLine) { + element = document.createElement("textarea"); + element.textContent = fieldFormattedValues ?? textContent; + if (this.data.doNotScroll) { + element.style.overflowY = "hidden"; + } + } else { + element = document.createElement("input"); + element.type = "text"; + element.setAttribute("value", fieldFormattedValues ?? textContent); + if (this.data.doNotScroll) { + element.style.overflowX = "hidden"; + } + } + if (this.data.hasOwnCanvas) { + element.hidden = true; + } + GetElementsByNameSet.add(element); + element.setAttribute("data-element-id", id); + element.disabled = this.data.readOnly; + element.name = this.data.fieldName; + element.tabIndex = DEFAULT_TAB_INDEX; + this._setRequired(element, this.data.required); + if (maxLen) { + element.maxLength = maxLen; + } + element.addEventListener("input", event => { + storage.setValue(id, { + value: event.target.value + }); + this.setPropertyOnSiblings(element, "value", event.target.value, "value"); + elementData.formattedValue = null; + }); + element.addEventListener("resetform", event => { + const defaultValue = this.data.defaultFieldValue ?? ""; + element.value = elementData.userValue = defaultValue; + elementData.formattedValue = null; + }); + let blurListener = event => { + const { + formattedValue + } = elementData; + if (formattedValue !== null && formattedValue !== undefined) { + event.target.value = formattedValue; + } + event.target.scrollLeft = 0; + }; + if (this.enableScripting && this.hasJSActions) { + element.addEventListener("focus", event => { + if (elementData.focused) { + return; + } + const { + target + } = event; + if (elementData.userValue) { + target.value = elementData.userValue; + } + elementData.lastCommittedValue = target.value; + elementData.commitKey = 1; + if (!this.data.actions?.Focus) { + elementData.focused = true; + } + }); + element.addEventListener("updatefromsandbox", jsEvent => { + this.showElementAndHideCanvas(jsEvent.target); + const actions = { + value(event) { + elementData.userValue = event.detail.value ?? ""; + storage.setValue(id, { + value: elementData.userValue.toString() + }); + event.target.value = elementData.userValue; + }, + formattedValue(event) { + const { + formattedValue + } = event.detail; + elementData.formattedValue = formattedValue; + if (formattedValue !== null && formattedValue !== undefined && event.target !== document.activeElement) { + event.target.value = formattedValue; + } + storage.setValue(id, { + formattedValue + }); + }, + selRange(event) { + event.target.setSelectionRange(...event.detail.selRange); + }, + charLimit: event => { + const { + charLimit + } = event.detail; + const { + target + } = event; + if (charLimit === 0) { + target.removeAttribute("maxLength"); + return; + } + target.setAttribute("maxLength", charLimit); + let value = elementData.userValue; + if (!value || value.length <= charLimit) { + return; + } + value = value.slice(0, charLimit); + target.value = elementData.userValue = value; + storage.setValue(id, { + value + }); + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id, + name: "Keystroke", + value, + willCommit: true, + commitKey: 1, + selStart: target.selectionStart, + selEnd: target.selectionEnd + } + }); + } + }; + this._dispatchEventFromSandbox(actions, jsEvent); + }); + element.addEventListener("keydown", event => { + elementData.commitKey = 1; + let commitKey = -1; + if (event.key === "Escape") { + commitKey = 0; + } else if (event.key === "Enter" && !this.data.multiLine) { + commitKey = 2; + } else if (event.key === "Tab") { + elementData.commitKey = 3; + } + if (commitKey === -1) { + return; + } + const { + value + } = event.target; + if (elementData.lastCommittedValue === value) { + return; + } + elementData.lastCommittedValue = value; + elementData.userValue = value; + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id, + name: "Keystroke", + value, + willCommit: true, + commitKey, + selStart: event.target.selectionStart, + selEnd: event.target.selectionEnd + } + }); + }); + const _blurListener = blurListener; + blurListener = null; + element.addEventListener("blur", event => { + if (!elementData.focused || !event.relatedTarget) { + return; + } + if (!this.data.actions?.Blur) { + elementData.focused = false; + } + const { + value + } = event.target; + elementData.userValue = value; + if (elementData.lastCommittedValue !== value) { + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id, + name: "Keystroke", + value, + willCommit: true, + commitKey: elementData.commitKey, + selStart: event.target.selectionStart, + selEnd: event.target.selectionEnd + } + }); + } + _blurListener(event); + }); + if (this.data.actions?.Keystroke) { + element.addEventListener("beforeinput", event => { + elementData.lastCommittedValue = null; + const { + data, + target + } = event; + const { + value, + selectionStart, + selectionEnd + } = target; + let selStart = selectionStart, + selEnd = selectionEnd; + switch (event.inputType) { + case "deleteWordBackward": + { + const match = value.substring(0, selectionStart).match(/\w*[^\w]*$/); + if (match) { + selStart -= match[0].length; + } + break; + } + case "deleteWordForward": + { + const match = value.substring(selectionStart).match(/^[^\w]*\w*/); + if (match) { + selEnd += match[0].length; + } + break; + } + case "deleteContentBackward": + if (selectionStart === selectionEnd) { + selStart -= 1; + } + break; + case "deleteContentForward": + if (selectionStart === selectionEnd) { + selEnd += 1; + } + break; + } + event.preventDefault(); + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id, + name: "Keystroke", + value, + change: data || "", + willCommit: false, + selStart, + selEnd + } + }); + }); + } + this._setEventListeners(element, elementData, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], event => event.target.value); + } + if (blurListener) { + element.addEventListener("blur", blurListener); + } + if (this.data.comb) { + const fieldWidth = this.data.rect[2] - this.data.rect[0]; + const combWidth = fieldWidth / maxLen; + element.classList.add("comb"); + element.style.letterSpacing = `calc(${combWidth}px * var(--scale-factor) - 1ch)`; + } + } else { + element = document.createElement("div"); + element.textContent = this.data.fieldValue; + element.style.verticalAlign = "middle"; + element.style.display = "table-cell"; + if (this.data.hasOwnCanvas) { + element.hidden = true; + } + } + this._setTextStyle(element); + this._setBackgroundColor(element); + this._setDefaultPropertiesFromJS(element); + this.container.append(element); + return this.container; + } +} +class SignatureWidgetAnnotationElement extends WidgetAnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: !!parameters.data.hasOwnCanvas + }); + } +} +class CheckboxWidgetAnnotationElement extends WidgetAnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: parameters.renderForms + }); + } + render() { + const storage = this.annotationStorage; + const data = this.data; + const id = data.id; + let value = storage.getValue(id, { + value: data.exportValue === data.fieldValue + }).value; + if (typeof value === "string") { + value = value !== "Off"; + storage.setValue(id, { + value + }); + } + this.container.classList.add("buttonWidgetAnnotation", "checkBox"); + const element = document.createElement("input"); + GetElementsByNameSet.add(element); + element.setAttribute("data-element-id", id); + element.disabled = data.readOnly; + this._setRequired(element, this.data.required); + element.type = "checkbox"; + element.name = data.fieldName; + if (value) { + element.setAttribute("checked", true); + } + element.setAttribute("exportValue", data.exportValue); + element.tabIndex = DEFAULT_TAB_INDEX; + element.addEventListener("change", event => { + const { + name, + checked + } = event.target; + for (const checkbox of this._getElementsByName(name, id)) { + const curChecked = checked && checkbox.exportValue === data.exportValue; + if (checkbox.domElement) { + checkbox.domElement.checked = curChecked; + } + storage.setValue(checkbox.id, { + value: curChecked + }); + } + storage.setValue(id, { + value: checked + }); + }); + element.addEventListener("resetform", event => { + const defaultValue = data.defaultFieldValue || "Off"; + event.target.checked = defaultValue === data.exportValue; + }); + if (this.enableScripting && this.hasJSActions) { + element.addEventListener("updatefromsandbox", jsEvent => { + const actions = { + value(event) { + event.target.checked = event.detail.value !== "Off"; + storage.setValue(id, { + value: event.target.checked + }); + } + }; + this._dispatchEventFromSandbox(actions, jsEvent); + }); + this._setEventListeners(element, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], event => event.target.checked); + } + this._setBackgroundColor(element); + this._setDefaultPropertiesFromJS(element); + this.container.append(element); + return this.container; + } +} +class RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: parameters.renderForms + }); + } + render() { + this.container.classList.add("buttonWidgetAnnotation", "radioButton"); + const storage = this.annotationStorage; + const data = this.data; + const id = data.id; + let value = storage.getValue(id, { + value: data.fieldValue === data.buttonValue + }).value; + if (typeof value === "string") { + value = value !== data.buttonValue; + storage.setValue(id, { + value + }); + } + if (value) { + for (const radio of this._getElementsByName(data.fieldName, id)) { + storage.setValue(radio.id, { + value: false + }); + } + } + const element = document.createElement("input"); + GetElementsByNameSet.add(element); + element.setAttribute("data-element-id", id); + element.disabled = data.readOnly; + this._setRequired(element, this.data.required); + element.type = "radio"; + element.name = data.fieldName; + if (value) { + element.setAttribute("checked", true); + } + element.tabIndex = DEFAULT_TAB_INDEX; + element.addEventListener("change", event => { + const { + name, + checked + } = event.target; + for (const radio of this._getElementsByName(name, id)) { + storage.setValue(radio.id, { + value: false + }); + } + storage.setValue(id, { + value: checked + }); + }); + element.addEventListener("resetform", event => { + const defaultValue = data.defaultFieldValue; + event.target.checked = defaultValue !== null && defaultValue !== undefined && defaultValue === data.buttonValue; + }); + if (this.enableScripting && this.hasJSActions) { + const pdfButtonValue = data.buttonValue; + element.addEventListener("updatefromsandbox", jsEvent => { + const actions = { + value: event => { + const checked = pdfButtonValue === event.detail.value; + for (const radio of this._getElementsByName(event.target.name)) { + const curChecked = checked && radio.id === id; + if (radio.domElement) { + radio.domElement.checked = curChecked; + } + storage.setValue(radio.id, { + value: curChecked + }); + } + } + }; + this._dispatchEventFromSandbox(actions, jsEvent); + }); + this._setEventListeners(element, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], event => event.target.checked); + } + this._setBackgroundColor(element); + this._setDefaultPropertiesFromJS(element); + this.container.append(element); + return this.container; + } +} +class PushButtonWidgetAnnotationElement extends LinkAnnotationElement { + constructor(parameters) { + super(parameters, { + ignoreBorder: parameters.data.hasAppearance + }); + } + render() { + const container = super.render(); + container.classList.add("buttonWidgetAnnotation", "pushButton"); + if (this.data.alternativeText) { + container.title = this.data.alternativeText; + } + const linkElement = container.lastChild; + if (this.enableScripting && this.hasJSActions && linkElement) { + this._setDefaultPropertiesFromJS(linkElement); + linkElement.addEventListener("updatefromsandbox", jsEvent => { + this._dispatchEventFromSandbox({}, jsEvent); + }); + } + return container; + } +} +class ChoiceWidgetAnnotationElement extends WidgetAnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: parameters.renderForms + }); + } + render() { + this.container.classList.add("choiceWidgetAnnotation"); + const storage = this.annotationStorage; + const id = this.data.id; + const storedData = storage.getValue(id, { + value: this.data.fieldValue + }); + const selectElement = document.createElement("select"); + GetElementsByNameSet.add(selectElement); + selectElement.setAttribute("data-element-id", id); + selectElement.disabled = this.data.readOnly; + this._setRequired(selectElement, this.data.required); + selectElement.name = this.data.fieldName; + selectElement.tabIndex = DEFAULT_TAB_INDEX; + let addAnEmptyEntry = this.data.combo && this.data.options.length > 0; + if (!this.data.combo) { + selectElement.size = this.data.options.length; + if (this.data.multiSelect) { + selectElement.multiple = true; + } + } + selectElement.addEventListener("resetform", event => { + const defaultValue = this.data.defaultFieldValue; + for (const option of selectElement.options) { + option.selected = option.value === defaultValue; + } + }); + for (const option of this.data.options) { + const optionElement = document.createElement("option"); + optionElement.textContent = option.displayValue; + optionElement.value = option.exportValue; + if (storedData.value.includes(option.exportValue)) { + optionElement.setAttribute("selected", true); + addAnEmptyEntry = false; + } + selectElement.append(optionElement); + } + let removeEmptyEntry = null; + if (addAnEmptyEntry) { + const noneOptionElement = document.createElement("option"); + noneOptionElement.value = " "; + noneOptionElement.setAttribute("hidden", true); + noneOptionElement.setAttribute("selected", true); + selectElement.prepend(noneOptionElement); + removeEmptyEntry = () => { + noneOptionElement.remove(); + selectElement.removeEventListener("input", removeEmptyEntry); + removeEmptyEntry = null; + }; + selectElement.addEventListener("input", removeEmptyEntry); + } + const getValue = isExport => { + const name = isExport ? "value" : "textContent"; + const { + options, + multiple + } = selectElement; + if (!multiple) { + return options.selectedIndex === -1 ? null : options[options.selectedIndex][name]; + } + return Array.prototype.filter.call(options, option => option.selected).map(option => option[name]); + }; + let selectedValues = getValue(false); + const getItems = event => { + const options = event.target.options; + return Array.prototype.map.call(options, option => { + return { + displayValue: option.textContent, + exportValue: option.value + }; + }); + }; + if (this.enableScripting && this.hasJSActions) { + selectElement.addEventListener("updatefromsandbox", jsEvent => { + const actions = { + value(event) { + removeEmptyEntry?.(); + const value = event.detail.value; + const values = new Set(Array.isArray(value) ? value : [value]); + for (const option of selectElement.options) { + option.selected = values.has(option.value); + } + storage.setValue(id, { + value: getValue(true) + }); + selectedValues = getValue(false); + }, + multipleSelection(event) { + selectElement.multiple = true; + }, + remove(event) { + const options = selectElement.options; + const index = event.detail.remove; + options[index].selected = false; + selectElement.remove(index); + if (options.length > 0) { + const i = Array.prototype.findIndex.call(options, option => option.selected); + if (i === -1) { + options[0].selected = true; + } + } + storage.setValue(id, { + value: getValue(true), + items: getItems(event) + }); + selectedValues = getValue(false); + }, + clear(event) { + while (selectElement.length !== 0) { + selectElement.remove(0); + } + storage.setValue(id, { + value: null, + items: [] + }); + selectedValues = getValue(false); + }, + insert(event) { + const { + index, + displayValue, + exportValue + } = event.detail.insert; + const selectChild = selectElement.children[index]; + const optionElement = document.createElement("option"); + optionElement.textContent = displayValue; + optionElement.value = exportValue; + if (selectChild) { + selectChild.before(optionElement); + } else { + selectElement.append(optionElement); + } + storage.setValue(id, { + value: getValue(true), + items: getItems(event) + }); + selectedValues = getValue(false); + }, + items(event) { + const { + items + } = event.detail; + while (selectElement.length !== 0) { + selectElement.remove(0); + } + for (const item of items) { + const { + displayValue, + exportValue + } = item; + const optionElement = document.createElement("option"); + optionElement.textContent = displayValue; + optionElement.value = exportValue; + selectElement.append(optionElement); + } + if (selectElement.options.length > 0) { + selectElement.options[0].selected = true; + } + storage.setValue(id, { + value: getValue(true), + items: getItems(event) + }); + selectedValues = getValue(false); + }, + indices(event) { + const indices = new Set(event.detail.indices); + for (const option of event.target.options) { + option.selected = indices.has(option.index); + } + storage.setValue(id, { + value: getValue(true) + }); + selectedValues = getValue(false); + }, + editable(event) { + event.target.disabled = !event.detail.editable; + } + }; + this._dispatchEventFromSandbox(actions, jsEvent); + }); + selectElement.addEventListener("input", event => { + const exportValue = getValue(true); + storage.setValue(id, { + value: exportValue + }); + event.preventDefault(); + this.linkService.eventBus?.dispatch("dispatcheventinsandbox", { + source: this, + detail: { + id, + name: "Keystroke", + value: selectedValues, + changeEx: exportValue, + willCommit: false, + commitKey: 1, + keyDown: false + } + }); + }); + this._setEventListeners(selectElement, null, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"], ["input", "Action"], ["input", "Validate"]], event => event.target.value); + } else { + selectElement.addEventListener("input", function (event) { + storage.setValue(id, { + value: getValue(true) + }); + }); + } + if (this.data.combo) { + this._setTextStyle(selectElement); + } else {} + this._setBackgroundColor(selectElement); + this._setDefaultPropertiesFromJS(selectElement); + this.container.append(selectElement); + return this.container; + } +} +class PopupAnnotationElement extends AnnotationElement { + constructor(parameters) { + const { + data, + elements + } = parameters; + super(parameters, { + isRenderable: AnnotationElement._hasPopupData(data) + }); + this.elements = elements; + } + render() { + this.container.classList.add("popupAnnotation"); + const popup = new PopupElement({ + container: this.container, + color: this.data.color, + titleObj: this.data.titleObj, + modificationDate: this.data.modificationDate, + contentsObj: this.data.contentsObj, + richText: this.data.richText, + rect: this.data.rect, + parentRect: this.data.parentRect || null, + parent: this.parent, + elements: this.elements, + open: this.data.open + }); + const elementIds = []; + for (const element of this.elements) { + element.popup = popup; + elementIds.push(element.data.id); + element.addHighlightArea(); + } + this.container.setAttribute("aria-controls", elementIds.map(id => `${util.AnnotationPrefix}${id}`).join(",")); + return this.container; + } +} +class PopupElement { + #boundKeyDown = this.#keyDown.bind(this); + #boundHide = this.#hide.bind(this); + #boundShow = this.#show.bind(this); + #boundToggle = this.#toggle.bind(this); + #color = null; + #container = null; + #contentsObj = null; + #dateObj = null; + #elements = null; + #parent = null; + #parentRect = null; + #pinned = false; + #popup = null; + #rect = null; + #richText = null; + #titleObj = null; + #wasVisible = false; + constructor({ + container, + color, + elements, + titleObj, + modificationDate, + contentsObj, + richText, + parent, + rect, + parentRect, + open + }) { + this.#container = container; + this.#titleObj = titleObj; + this.#contentsObj = contentsObj; + this.#richText = richText; + this.#parent = parent; + this.#color = color; + this.#rect = rect; + this.#parentRect = parentRect; + this.#elements = elements; + this.#dateObj = display_utils.PDFDateString.toDateObject(modificationDate); + this.trigger = elements.flatMap(e => e.getElementsToTriggerPopup()); + for (const element of this.trigger) { + element.addEventListener("click", this.#boundToggle); + element.addEventListener("mouseenter", this.#boundShow); + element.addEventListener("mouseleave", this.#boundHide); + element.classList.add("popupTriggerArea"); + } + for (const element of elements) { + element.container?.addEventListener("keydown", this.#boundKeyDown); + } + this.#container.hidden = true; + if (open) { + this.#toggle(); + } + } + render() { + if (this.#popup) { + return; + } + const { + page: { + view + }, + viewport: { + rawDims: { + pageWidth, + pageHeight, + pageX, + pageY + } + } + } = this.#parent; + const popup = this.#popup = document.createElement("div"); + popup.className = "popup"; + if (this.#color) { + const baseColor = popup.style.outlineColor = util.Util.makeHexColor(...this.#color); + if (CSS.supports("background-color", "color-mix(in srgb, red 30%, white)")) { + popup.style.backgroundColor = `color-mix(in srgb, ${baseColor} 30%, white)`; + } else { + const BACKGROUND_ENLIGHT = 0.7; + popup.style.backgroundColor = util.Util.makeHexColor(...this.#color.map(c => Math.floor(BACKGROUND_ENLIGHT * (255 - c) + c))); + } + } + const header = document.createElement("span"); + header.className = "header"; + const title = document.createElement("h1"); + header.append(title); + ({ + dir: title.dir, + str: title.textContent + } = this.#titleObj); + popup.append(header); + if (this.#dateObj) { + const modificationDate = document.createElement("span"); + modificationDate.classList.add("popupDate"); + modificationDate.setAttribute("data-l10n-id", "pdfjs-annotation-date-string"); + modificationDate.setAttribute("data-l10n-args", JSON.stringify({ + date: this.#dateObj.toLocaleDateString(), + time: this.#dateObj.toLocaleTimeString() + })); + header.append(modificationDate); + } + const contentsObj = this.#contentsObj; + const richText = this.#richText; + if (richText?.str && (!contentsObj?.str || contentsObj.str === richText.str)) { + xfa_layer.XfaLayer.render({ + xfaHtml: richText.html, + intent: "richText", + div: popup + }); + popup.lastChild.classList.add("richText", "popupContent"); + } else { + const contents = this._formatContents(contentsObj); + popup.append(contents); + } + let useParentRect = !!this.#parentRect; + let rect = useParentRect ? this.#parentRect : this.#rect; + for (const element of this.#elements) { + if (!rect || util.Util.intersect(element.data.rect, rect) !== null) { + rect = element.data.rect; + useParentRect = true; + break; + } + } + const normalizedRect = util.Util.normalizeRect([rect[0], view[3] - rect[1] + view[1], rect[2], view[3] - rect[3] + view[1]]); + const HORIZONTAL_SPACE_AFTER_ANNOTATION = 5; + const parentWidth = useParentRect ? rect[2] - rect[0] + HORIZONTAL_SPACE_AFTER_ANNOTATION : 0; + const popupLeft = normalizedRect[0] + parentWidth; + const popupTop = normalizedRect[1]; + const { + style + } = this.#container; + style.left = `${100 * (popupLeft - pageX) / pageWidth}%`; + style.top = `${100 * (popupTop - pageY) / pageHeight}%`; + this.#container.append(popup); + } + _formatContents({ + str, + dir + }) { + const p = document.createElement("p"); + p.classList.add("popupContent"); + p.dir = dir; + const lines = str.split(/(?:\r\n?|\n)/); + for (let i = 0, ii = lines.length; i < ii; ++i) { + const line = lines[i]; + p.append(document.createTextNode(line)); + if (i < ii - 1) { + p.append(document.createElement("br")); + } + } + return p; + } + #keyDown(event) { + if (event.altKey || event.shiftKey || event.ctrlKey || event.metaKey) { + return; + } + if (event.key === "Enter" || event.key === "Escape" && this.#pinned) { + this.#toggle(); + } + } + #toggle() { + this.#pinned = !this.#pinned; + if (this.#pinned) { + this.#show(); + this.#container.addEventListener("click", this.#boundToggle); + this.#container.addEventListener("keydown", this.#boundKeyDown); + } else { + this.#hide(); + this.#container.removeEventListener("click", this.#boundToggle); + this.#container.removeEventListener("keydown", this.#boundKeyDown); + } + } + #show() { + if (!this.#popup) { + this.render(); + } + if (!this.isVisible) { + this.#container.hidden = false; + this.#container.style.zIndex = parseInt(this.#container.style.zIndex) + 1000; + } else if (this.#pinned) { + this.#container.classList.add("focused"); + } + } + #hide() { + this.#container.classList.remove("focused"); + if (this.#pinned || !this.isVisible) { + return; + } + this.#container.hidden = true; + this.#container.style.zIndex = parseInt(this.#container.style.zIndex) - 1000; + } + forceHide() { + this.#wasVisible = this.isVisible; + if (!this.#wasVisible) { + return; + } + this.#container.hidden = true; + } + maybeShow() { + if (!this.#wasVisible) { + return; + } + this.#wasVisible = false; + this.#container.hidden = false; + } + get isVisible() { + return this.#container.hidden === false; + } +} +class FreeTextAnnotationElement extends AnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true + }); + this.textContent = parameters.data.textContent; + this.textPosition = parameters.data.textPosition; + this.annotationEditorType = util.AnnotationEditorType.FREETEXT; + } + render() { + this.container.classList.add("freeTextAnnotation"); + if (this.textContent) { + const content = document.createElement("div"); + content.classList.add("annotationTextContent"); + content.setAttribute("role", "comment"); + for (const line of this.textContent) { + const lineSpan = document.createElement("span"); + lineSpan.textContent = line; + content.append(lineSpan); + } + this.container.append(content); + } + if (!this.data.popupRef && this.hasPopupData) { + this._createPopup(); + } + this._editOnDoubleClick(); + return this.container; + } + get _isEditable() { + return this.data.hasOwnCanvas; + } +} +class LineAnnotationElement extends AnnotationElement { + #line = null; + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true + }); + } + render() { + this.container.classList.add("lineAnnotation"); + const data = this.data; + const { + width, + height + } = getRectDims(data.rect); + const svg = this.svgFactory.create(width, height, true); + const line = this.#line = this.svgFactory.createElement("svg:line"); + line.setAttribute("x1", data.rect[2] - data.lineCoordinates[0]); + line.setAttribute("y1", data.rect[3] - data.lineCoordinates[1]); + line.setAttribute("x2", data.rect[2] - data.lineCoordinates[2]); + line.setAttribute("y2", data.rect[3] - data.lineCoordinates[3]); + line.setAttribute("stroke-width", data.borderStyle.width || 1); + line.setAttribute("stroke", "transparent"); + line.setAttribute("fill", "transparent"); + svg.append(line); + this.container.append(svg); + if (!data.popupRef && this.hasPopupData) { + this._createPopup(); + } + return this.container; + } + getElementsToTriggerPopup() { + return this.#line; + } + addHighlightArea() { + this.container.classList.add("highlightArea"); + } +} +class SquareAnnotationElement extends AnnotationElement { + #square = null; + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true + }); + } + render() { + this.container.classList.add("squareAnnotation"); + const data = this.data; + const { + width, + height + } = getRectDims(data.rect); + const svg = this.svgFactory.create(width, height, true); + const borderWidth = data.borderStyle.width; + const square = this.#square = this.svgFactory.createElement("svg:rect"); + square.setAttribute("x", borderWidth / 2); + square.setAttribute("y", borderWidth / 2); + square.setAttribute("width", width - borderWidth); + square.setAttribute("height", height - borderWidth); + square.setAttribute("stroke-width", borderWidth || 1); + square.setAttribute("stroke", "transparent"); + square.setAttribute("fill", "transparent"); + svg.append(square); + this.container.append(svg); + if (!data.popupRef && this.hasPopupData) { + this._createPopup(); + } + return this.container; + } + getElementsToTriggerPopup() { + return this.#square; + } + addHighlightArea() { + this.container.classList.add("highlightArea"); + } +} +class CircleAnnotationElement extends AnnotationElement { + #circle = null; + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true + }); + } + render() { + this.container.classList.add("circleAnnotation"); + const data = this.data; + const { + width, + height + } = getRectDims(data.rect); + const svg = this.svgFactory.create(width, height, true); + const borderWidth = data.borderStyle.width; + const circle = this.#circle = this.svgFactory.createElement("svg:ellipse"); + circle.setAttribute("cx", width / 2); + circle.setAttribute("cy", height / 2); + circle.setAttribute("rx", width / 2 - borderWidth / 2); + circle.setAttribute("ry", height / 2 - borderWidth / 2); + circle.setAttribute("stroke-width", borderWidth || 1); + circle.setAttribute("stroke", "transparent"); + circle.setAttribute("fill", "transparent"); + svg.append(circle); + this.container.append(svg); + if (!data.popupRef && this.hasPopupData) { + this._createPopup(); + } + return this.container; + } + getElementsToTriggerPopup() { + return this.#circle; + } + addHighlightArea() { + this.container.classList.add("highlightArea"); + } +} +class PolylineAnnotationElement extends AnnotationElement { + #polyline = null; + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true + }); + this.containerClassName = "polylineAnnotation"; + this.svgElementName = "svg:polyline"; + } + render() { + this.container.classList.add(this.containerClassName); + const data = this.data; + const { + width, + height + } = getRectDims(data.rect); + const svg = this.svgFactory.create(width, height, true); + let points = []; + for (const coordinate of data.vertices) { + const x = coordinate.x - data.rect[0]; + const y = data.rect[3] - coordinate.y; + points.push(x + "," + y); + } + points = points.join(" "); + const polyline = this.#polyline = this.svgFactory.createElement(this.svgElementName); + polyline.setAttribute("points", points); + polyline.setAttribute("stroke-width", data.borderStyle.width || 1); + polyline.setAttribute("stroke", "transparent"); + polyline.setAttribute("fill", "transparent"); + svg.append(polyline); + this.container.append(svg); + if (!data.popupRef && this.hasPopupData) { + this._createPopup(); + } + return this.container; + } + getElementsToTriggerPopup() { + return this.#polyline; + } + addHighlightArea() { + this.container.classList.add("highlightArea"); + } +} +class PolygonAnnotationElement extends PolylineAnnotationElement { + constructor(parameters) { + super(parameters); + this.containerClassName = "polygonAnnotation"; + this.svgElementName = "svg:polygon"; + } +} +class CaretAnnotationElement extends AnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true + }); + } + render() { + this.container.classList.add("caretAnnotation"); + if (!this.data.popupRef && this.hasPopupData) { + this._createPopup(); + } + return this.container; + } +} +class InkAnnotationElement extends AnnotationElement { + #polylines = []; + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true + }); + this.containerClassName = "inkAnnotation"; + this.svgElementName = "svg:polyline"; + this.annotationEditorType = util.AnnotationEditorType.INK; + } + render() { + this.container.classList.add(this.containerClassName); + const data = this.data; + const { + width, + height + } = getRectDims(data.rect); + const svg = this.svgFactory.create(width, height, true); + for (const inkList of data.inkLists) { + let points = []; + for (const coordinate of inkList) { + const x = coordinate.x - data.rect[0]; + const y = data.rect[3] - coordinate.y; + points.push(`${x},${y}`); + } + points = points.join(" "); + const polyline = this.svgFactory.createElement(this.svgElementName); + this.#polylines.push(polyline); + polyline.setAttribute("points", points); + polyline.setAttribute("stroke-width", data.borderStyle.width || 1); + polyline.setAttribute("stroke", "transparent"); + polyline.setAttribute("fill", "transparent"); + if (!data.popupRef && this.hasPopupData) { + this._createPopup(); + } + svg.append(polyline); + } + this.container.append(svg); + return this.container; + } + getElementsToTriggerPopup() { + return this.#polylines; + } + addHighlightArea() { + this.container.classList.add("highlightArea"); + } +} +class HighlightAnnotationElement extends AnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true, + createQuadrilaterals: true + }); + } + render() { + if (!this.data.popupRef && this.hasPopupData) { + this._createPopup(); + } + this.container.classList.add("highlightAnnotation"); + return this.container; + } +} +class UnderlineAnnotationElement extends AnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true, + createQuadrilaterals: true + }); + } + render() { + if (!this.data.popupRef && this.hasPopupData) { + this._createPopup(); + } + this.container.classList.add("underlineAnnotation"); + return this.container; + } +} +class SquigglyAnnotationElement extends AnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true, + createQuadrilaterals: true + }); + } + render() { + if (!this.data.popupRef && this.hasPopupData) { + this._createPopup(); + } + this.container.classList.add("squigglyAnnotation"); + return this.container; + } +} +class StrikeOutAnnotationElement extends AnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true, + createQuadrilaterals: true + }); + } + render() { + if (!this.data.popupRef && this.hasPopupData) { + this._createPopup(); + } + this.container.classList.add("strikeoutAnnotation"); + return this.container; + } +} +class StampAnnotationElement extends AnnotationElement { + constructor(parameters) { + super(parameters, { + isRenderable: true, + ignoreBorder: true + }); + } + render() { + this.container.classList.add("stampAnnotation"); + if (!this.data.popupRef && this.hasPopupData) { + this._createPopup(); + } + return this.container; + } +} +class FileAttachmentAnnotationElement extends AnnotationElement { + #trigger = null; + constructor(parameters) { + super(parameters, { + isRenderable: true + }); + const { + filename, + content + } = this.data.file; + this.filename = (0,display_utils.getFilenameFromUrl)(filename, true); + this.content = content; + this.linkService.eventBus?.dispatch("fileattachmentannotation", { + source: this, + filename, + content + }); + } + render() { + this.container.classList.add("fileAttachmentAnnotation"); + const { + container, + data + } = this; + let trigger; + if (data.hasAppearance || data.fillAlpha === 0) { + trigger = document.createElement("div"); + } else { + trigger = document.createElement("img"); + trigger.src = `${this.imageResourcesPath}annotation-${/paperclip/i.test(data.name) ? "paperclip" : "pushpin"}.svg`; + if (data.fillAlpha && data.fillAlpha < 1) { + trigger.style = `filter: opacity(${Math.round(data.fillAlpha * 100)}%);`; + } + } + trigger.addEventListener("dblclick", this.#download.bind(this)); + this.#trigger = trigger; + const { + isMac + } = util.FeatureTest.platform; + container.addEventListener("keydown", evt => { + if (evt.key === "Enter" && (isMac ? evt.metaKey : evt.ctrlKey)) { + this.#download(); + } + }); + if (!data.popupRef && this.hasPopupData) { + this._createPopup(); + } else { + trigger.classList.add("popupTriggerArea"); + } + container.append(trigger); + return container; + } + getElementsToTriggerPopup() { + return this.#trigger; + } + addHighlightArea() { + this.container.classList.add("highlightArea"); + } + #download() { + this.downloadManager?.openOrDownloadData(this.content, this.filename); + } +} +class AnnotationLayer { + #accessibilityManager = null; + #annotationCanvasMap = null; + #editableAnnotations = new Map(); + constructor({ + div, + accessibilityManager, + annotationCanvasMap, + page, + viewport + }) { + this.div = div; + this.#accessibilityManager = accessibilityManager; + this.#annotationCanvasMap = annotationCanvasMap; + this.page = page; + this.viewport = viewport; + this.zIndex = 0; + } + #appendElement(element, id) { + const contentElement = element.firstChild || element; + contentElement.id = `${util.AnnotationPrefix}${id}`; + this.div.append(element); + this.#accessibilityManager?.moveElementInDOM(this.div, element, contentElement, false); + } + async render(params) { + const { + annotations + } = params; + const layer = this.div; + (0,display_utils.setLayerDimensions)(layer, this.viewport); + const popupToElements = new Map(); + const elementParams = { + data: null, + layer, + linkService: params.linkService, + downloadManager: params.downloadManager, + imageResourcesPath: params.imageResourcesPath || "", + renderForms: params.renderForms !== false, + svgFactory: new display_utils.DOMSVGFactory(), + annotationStorage: params.annotationStorage || new annotation_storage.AnnotationStorage(), + enableScripting: params.enableScripting === true, + hasJSActions: params.hasJSActions, + fieldObjects: params.fieldObjects, + parent: this, + elements: null + }; + for (const data of annotations) { + if (data.noHTML) { + continue; + } + const isPopupAnnotation = data.annotationType === util.AnnotationType.POPUP; + if (!isPopupAnnotation) { + const { + width, + height + } = getRectDims(data.rect); + if (width <= 0 || height <= 0) { + continue; + } + } else { + const elements = popupToElements.get(data.id); + if (!elements) { + continue; + } + elementParams.elements = elements; + } + elementParams.data = data; + const element = AnnotationElementFactory.create(elementParams); + if (!element.isRenderable) { + continue; + } + if (!isPopupAnnotation && data.popupRef) { + const elements = popupToElements.get(data.popupRef); + if (!elements) { + popupToElements.set(data.popupRef, [element]); + } else { + elements.push(element); + } + } + if (element.annotationEditorType > 0) { + this.#editableAnnotations.set(element.data.id, element); + } + const rendered = element.render(); + if (data.hidden) { + rendered.style.visibility = "hidden"; + } + this.#appendElement(rendered, data.id); + } + this.#setAnnotationCanvasMap(); + } + update({ + viewport + }) { + const layer = this.div; + this.viewport = viewport; + (0,display_utils.setLayerDimensions)(layer, { + rotation: viewport.rotation + }); + this.#setAnnotationCanvasMap(); + layer.hidden = false; + } + #setAnnotationCanvasMap() { + if (!this.#annotationCanvasMap) { + return; + } + const layer = this.div; + for (const [id, canvas] of this.#annotationCanvasMap) { + const element = layer.querySelector(`[data-annotation-id="${id}"]`); + if (!element) { + continue; + } + const { + firstChild + } = element; + if (!firstChild) { + element.append(canvas); + } else if (firstChild.nodeName === "CANVAS") { + firstChild.replaceWith(canvas); + } else { + firstChild.before(canvas); + } + } + this.#annotationCanvasMap.clear(); + } + getEditableAnnotations() { + return Array.from(this.#editableAnnotations.values()); + } + getEditableAnnotation(id) { + return this.#editableAnnotations.get(id); + } +} + + +/***/ }), + +/***/ 780: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ AnnotationStorage: () => (/* binding */ AnnotationStorage), +/* harmony export */ PrintAnnotationStorage: () => (/* binding */ PrintAnnotationStorage), +/* harmony export */ SerializableEmpty: () => (/* binding */ SerializableEmpty) +/* harmony export */ }); +/* harmony import */ var _shared_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(266); +/* harmony import */ var _editor_editor_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(115); +/* harmony import */ var _shared_murmurhash3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(825); + + + +const SerializableEmpty = Object.freeze({ + map: null, + hash: "", + transfer: undefined +}); +class AnnotationStorage { + #modified = false; + #storage = new Map(); + constructor() { + this.onSetModified = null; + this.onResetModified = null; + this.onAnnotationEditor = null; + } + getValue(key, defaultValue) { + const value = this.#storage.get(key); + if (value === undefined) { + return defaultValue; + } + return Object.assign(defaultValue, value); + } + getRawValue(key) { + return this.#storage.get(key); + } + remove(key) { + this.#storage.delete(key); + if (this.#storage.size === 0) { + this.resetModified(); + } + if (typeof this.onAnnotationEditor === "function") { + for (const value of this.#storage.values()) { + if (value instanceof _editor_editor_js__WEBPACK_IMPORTED_MODULE_1__.AnnotationEditor) { + return; + } + } + this.onAnnotationEditor(null); + } + } + setValue(key, value) { + const obj = this.#storage.get(key); + let modified = false; + if (obj !== undefined) { + for (const [entry, val] of Object.entries(value)) { + if (obj[entry] !== val) { + modified = true; + obj[entry] = val; + } + } + } else { + modified = true; + this.#storage.set(key, value); + } + if (modified) { + this.#setModified(); + } + if (value instanceof _editor_editor_js__WEBPACK_IMPORTED_MODULE_1__.AnnotationEditor && typeof this.onAnnotationEditor === "function") { + this.onAnnotationEditor(value.constructor._type); + } + } + has(key) { + return this.#storage.has(key); + } + getAll() { + return this.#storage.size > 0 ? (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.objectFromMap)(this.#storage) : null; + } + setAll(obj) { + for (const [key, val] of Object.entries(obj)) { + this.setValue(key, val); + } + } + get size() { + return this.#storage.size; + } + #setModified() { + if (!this.#modified) { + this.#modified = true; + if (typeof this.onSetModified === "function") { + this.onSetModified(); + } + } + } + resetModified() { + if (this.#modified) { + this.#modified = false; + if (typeof this.onResetModified === "function") { + this.onResetModified(); + } + } + } + get print() { + return new PrintAnnotationStorage(this); + } + get serializable() { + if (this.#storage.size === 0) { + return SerializableEmpty; + } + const map = new Map(), + hash = new _shared_murmurhash3_js__WEBPACK_IMPORTED_MODULE_2__.MurmurHash3_64(), + transfer = []; + const context = Object.create(null); + let hasBitmap = false; + for (const [key, val] of this.#storage) { + const serialized = val instanceof _editor_editor_js__WEBPACK_IMPORTED_MODULE_1__.AnnotationEditor ? val.serialize(false, context) : val; + if (serialized) { + map.set(key, serialized); + hash.update(`${key}:${JSON.stringify(serialized)}`); + hasBitmap ||= !!serialized.bitmap; + } + } + if (hasBitmap) { + for (const value of map.values()) { + if (value.bitmap) { + transfer.push(value.bitmap); + } + } + } + return map.size > 0 ? { + map, + hash: hash.hexdigest(), + transfer + } : SerializableEmpty; + } +} +class PrintAnnotationStorage extends AnnotationStorage { + #serializable; + constructor(parent) { + super(); + const { + map, + hash, + transfer + } = parent.serializable; + const clone = structuredClone(map, transfer ? { + transfer + } : null); + this.#serializable = { + map: clone, + hash, + transfer + }; + } + get print() { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.unreachable)("Should not call PrintAnnotationStorage.print"); + } + get serializable() { + return this.#serializable; + } +} + + +/***/ }), + +/***/ 406: +/***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ PDFDataRangeTransport: () => (/* binding */ PDFDataRangeTransport), +/* harmony export */ PDFWorker: () => (/* binding */ PDFWorker), +/* harmony export */ build: () => (/* binding */ build), +/* harmony export */ getDocument: () => (/* binding */ getDocument), +/* harmony export */ version: () => (/* binding */ version) +/* harmony export */ }); +/* unused harmony exports DefaultCanvasFactory, DefaultCMapReaderFactory, DefaultFilterFactory, DefaultStandardFontDataFactory, LoopbackPort, PDFDocumentLoadingTask, PDFDocumentProxy, PDFPageProxy, PDFWorkerUtil, RenderTask */ +/* harmony import */ var _shared_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(266); +/* harmony import */ var _annotation_storage_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(780); +/* harmony import */ var _display_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(473); +/* harmony import */ var _font_loader_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(742); +/* harmony import */ var display_node_utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(738); +/* harmony import */ var _canvas_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(250); +/* harmony import */ var _worker_options_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(368); +/* harmony import */ var _shared_message_handler_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(694); +/* harmony import */ var _metadata_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(472); +/* harmony import */ var _optional_content_config_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(890); +/* harmony import */ var _transport_stream_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(92); +/* harmony import */ var display_fetch_stream__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(171); +/* harmony import */ var display_network__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(474); +/* harmony import */ var display_node_stream__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(498); +/* harmony import */ var _xfa_text_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(521); +var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([display_node_utils__WEBPACK_IMPORTED_MODULE_4__, display_node_stream__WEBPACK_IMPORTED_MODULE_13__]); +([display_node_utils__WEBPACK_IMPORTED_MODULE_4__, display_node_stream__WEBPACK_IMPORTED_MODULE_13__] = __webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__); + + + + + + + + + + + + + + + +const DEFAULT_RANGE_CHUNK_SIZE = 65536; +const RENDERING_CANCELLED_TIMEOUT = 100; +const DELAYED_CLEANUP_TIMEOUT = 5000; +const DefaultCanvasFactory = _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.isNodeJS ? display_node_utils__WEBPACK_IMPORTED_MODULE_4__.NodeCanvasFactory : _display_utils_js__WEBPACK_IMPORTED_MODULE_2__.DOMCanvasFactory; +const DefaultCMapReaderFactory = _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.isNodeJS ? display_node_utils__WEBPACK_IMPORTED_MODULE_4__.NodeCMapReaderFactory : _display_utils_js__WEBPACK_IMPORTED_MODULE_2__.DOMCMapReaderFactory; +const DefaultFilterFactory = _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.isNodeJS ? display_node_utils__WEBPACK_IMPORTED_MODULE_4__.NodeFilterFactory : _display_utils_js__WEBPACK_IMPORTED_MODULE_2__.DOMFilterFactory; +const DefaultStandardFontDataFactory = _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.isNodeJS ? display_node_utils__WEBPACK_IMPORTED_MODULE_4__.NodeStandardFontDataFactory : _display_utils_js__WEBPACK_IMPORTED_MODULE_2__.DOMStandardFontDataFactory; +function getDocument(src) { + if (typeof src === "string" || src instanceof URL) { + src = { + url: src + }; + } else if ((0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.isArrayBuffer)(src)) { + src = { + data: src + }; + } + if (typeof src !== "object") { + throw new Error("Invalid parameter in getDocument, need parameter object."); + } + if (!src.url && !src.data && !src.range) { + throw new Error("Invalid parameter object: need either .data, .range or .url"); + } + const task = new PDFDocumentLoadingTask(); + const { + docId + } = task; + const url = src.url ? getUrlProp(src.url) : null; + const data = src.data ? getDataProp(src.data) : null; + const httpHeaders = src.httpHeaders || null; + const withCredentials = src.withCredentials === true; + const password = src.password ?? null; + const rangeTransport = src.range instanceof PDFDataRangeTransport ? src.range : null; + const rangeChunkSize = Number.isInteger(src.rangeChunkSize) && src.rangeChunkSize > 0 ? src.rangeChunkSize : DEFAULT_RANGE_CHUNK_SIZE; + let worker = src.worker instanceof PDFWorker ? src.worker : null; + const verbosity = src.verbosity; + const docBaseUrl = typeof src.docBaseUrl === "string" && !(0,_display_utils_js__WEBPACK_IMPORTED_MODULE_2__.isDataScheme)(src.docBaseUrl) ? src.docBaseUrl : null; + const cMapUrl = typeof src.cMapUrl === "string" ? src.cMapUrl : null; + const cMapPacked = src.cMapPacked !== false; + const CMapReaderFactory = src.CMapReaderFactory || DefaultCMapReaderFactory; + const standardFontDataUrl = typeof src.standardFontDataUrl === "string" ? src.standardFontDataUrl : null; + const StandardFontDataFactory = src.StandardFontDataFactory || DefaultStandardFontDataFactory; + const ignoreErrors = src.stopAtErrors !== true; + const maxImageSize = Number.isInteger(src.maxImageSize) && src.maxImageSize > -1 ? src.maxImageSize : -1; + const isEvalSupported = src.isEvalSupported !== false; + const isOffscreenCanvasSupported = typeof src.isOffscreenCanvasSupported === "boolean" ? src.isOffscreenCanvasSupported : !_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.isNodeJS; + const canvasMaxAreaInBytes = Number.isInteger(src.canvasMaxAreaInBytes) ? src.canvasMaxAreaInBytes : -1; + const disableFontFace = typeof src.disableFontFace === "boolean" ? src.disableFontFace : _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.isNodeJS; + const fontExtraProperties = src.fontExtraProperties === true; + const enableXfa = src.enableXfa === true; + const ownerDocument = src.ownerDocument || globalThis.document; + const disableRange = src.disableRange === true; + const disableStream = src.disableStream === true; + const disableAutoFetch = src.disableAutoFetch === true; + const pdfBug = src.pdfBug === true; + const length = rangeTransport ? rangeTransport.length : src.length ?? NaN; + const useSystemFonts = typeof src.useSystemFonts === "boolean" ? src.useSystemFonts : !_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.isNodeJS && !disableFontFace; + const useWorkerFetch = typeof src.useWorkerFetch === "boolean" ? src.useWorkerFetch : CMapReaderFactory === _display_utils_js__WEBPACK_IMPORTED_MODULE_2__.DOMCMapReaderFactory && StandardFontDataFactory === _display_utils_js__WEBPACK_IMPORTED_MODULE_2__.DOMStandardFontDataFactory && cMapUrl && standardFontDataUrl && (0,_display_utils_js__WEBPACK_IMPORTED_MODULE_2__.isValidFetchUrl)(cMapUrl, document.baseURI) && (0,_display_utils_js__WEBPACK_IMPORTED_MODULE_2__.isValidFetchUrl)(standardFontDataUrl, document.baseURI); + const canvasFactory = src.canvasFactory || new DefaultCanvasFactory({ + ownerDocument + }); + const filterFactory = src.filterFactory || new DefaultFilterFactory({ + docId, + ownerDocument + }); + const styleElement = null; + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.setVerbosityLevel)(verbosity); + const transportFactory = { + canvasFactory, + filterFactory + }; + if (!useWorkerFetch) { + transportFactory.cMapReaderFactory = new CMapReaderFactory({ + baseUrl: cMapUrl, + isCompressed: cMapPacked + }); + transportFactory.standardFontDataFactory = new StandardFontDataFactory({ + baseUrl: standardFontDataUrl + }); + } + if (!worker) { + const workerParams = { + verbosity, + port: _worker_options_js__WEBPACK_IMPORTED_MODULE_6__.GlobalWorkerOptions.workerPort + }; + worker = workerParams.port ? PDFWorker.fromPort(workerParams) : new PDFWorker(workerParams); + task._worker = worker; + } + const fetchDocParams = { + docId, + apiVersion: '4.0.379', + data, + password, + disableAutoFetch, + rangeChunkSize, + length, + docBaseUrl, + enableXfa, + evaluatorOptions: { + maxImageSize, + disableFontFace, + ignoreErrors, + isEvalSupported, + isOffscreenCanvasSupported, + canvasMaxAreaInBytes, + fontExtraProperties, + useSystemFonts, + cMapUrl: useWorkerFetch ? cMapUrl : null, + standardFontDataUrl: useWorkerFetch ? standardFontDataUrl : null + } + }; + const transportParams = { + ignoreErrors, + isEvalSupported, + disableFontFace, + fontExtraProperties, + enableXfa, + ownerDocument, + disableAutoFetch, + pdfBug, + styleElement + }; + worker.promise.then(function () { + if (task.destroyed) { + throw new Error("Loading aborted"); + } + const workerIdPromise = _fetchDocument(worker, fetchDocParams); + const networkStreamPromise = new Promise(function (resolve) { + let networkStream; + if (rangeTransport) { + networkStream = new _transport_stream_js__WEBPACK_IMPORTED_MODULE_10__.PDFDataTransportStream({ + length, + initialData: rangeTransport.initialData, + progressiveDone: rangeTransport.progressiveDone, + contentDispositionFilename: rangeTransport.contentDispositionFilename, + disableRange, + disableStream + }, rangeTransport); + } else if (!data) { + const createPDFNetworkStream = params => { + if (_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.isNodeJS) { + return new display_node_stream__WEBPACK_IMPORTED_MODULE_13__.PDFNodeStream(params); + } + return (0,_display_utils_js__WEBPACK_IMPORTED_MODULE_2__.isValidFetchUrl)(params.url) ? new display_fetch_stream__WEBPACK_IMPORTED_MODULE_11__.PDFFetchStream(params) : new display_network__WEBPACK_IMPORTED_MODULE_12__.PDFNetworkStream(params); + }; + networkStream = createPDFNetworkStream({ + url, + length, + httpHeaders, + withCredentials, + rangeChunkSize, + disableRange, + disableStream + }); + } + resolve(networkStream); + }); + return Promise.all([workerIdPromise, networkStreamPromise]).then(function ([workerId, networkStream]) { + if (task.destroyed) { + throw new Error("Loading aborted"); + } + const messageHandler = new _shared_message_handler_js__WEBPACK_IMPORTED_MODULE_7__.MessageHandler(docId, workerId, worker.port); + const transport = new WorkerTransport(messageHandler, task, networkStream, transportParams, transportFactory); + task._transport = transport; + messageHandler.send("Ready", null); + }); + }).catch(task._capability.reject); + return task; +} +async function _fetchDocument(worker, source) { + if (worker.destroyed) { + throw new Error("Worker was destroyed"); + } + const workerId = await worker.messageHandler.sendWithPromise("GetDocRequest", source, source.data ? [source.data.buffer] : null); + if (worker.destroyed) { + throw new Error("Worker was destroyed"); + } + return workerId; +} +function getUrlProp(val) { + if (val instanceof URL) { + return val.href; + } + try { + return new URL(val, window.location).href; + } catch { + if (_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.isNodeJS && typeof val === "string") { + return val; + } + } + throw new Error("Invalid PDF url data: " + "either string or URL-object is expected in the url property."); +} +function getDataProp(val) { + if (_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.isNodeJS && typeof Buffer !== "undefined" && val instanceof Buffer) { + throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`."); + } + if (val instanceof Uint8Array && val.byteLength === val.buffer.byteLength) { + return val; + } + if (typeof val === "string") { + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.stringToBytes)(val); + } + if (typeof val === "object" && !isNaN(val?.length) || (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.isArrayBuffer)(val)) { + return new Uint8Array(val); + } + throw new Error("Invalid PDF binary data: either TypedArray, " + "string, or array-like object is expected in the data property."); +} +class PDFDocumentLoadingTask { + static #docId = 0; + constructor() { + this._capability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + this._transport = null; + this._worker = null; + this.docId = `d${PDFDocumentLoadingTask.#docId++}`; + this.destroyed = false; + this.onPassword = null; + this.onProgress = null; + } + get promise() { + return this._capability.promise; + } + async destroy() { + this.destroyed = true; + try { + if (this._worker?.port) { + this._worker._pendingDestroy = true; + } + await this._transport?.destroy(); + } catch (ex) { + if (this._worker?.port) { + delete this._worker._pendingDestroy; + } + throw ex; + } + this._transport = null; + if (this._worker) { + this._worker.destroy(); + this._worker = null; + } + } +} +class PDFDataRangeTransport { + constructor(length, initialData, progressiveDone = false, contentDispositionFilename = null) { + this.length = length; + this.initialData = initialData; + this.progressiveDone = progressiveDone; + this.contentDispositionFilename = contentDispositionFilename; + this._rangeListeners = []; + this._progressListeners = []; + this._progressiveReadListeners = []; + this._progressiveDoneListeners = []; + this._readyCapability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + } + addRangeListener(listener) { + this._rangeListeners.push(listener); + } + addProgressListener(listener) { + this._progressListeners.push(listener); + } + addProgressiveReadListener(listener) { + this._progressiveReadListeners.push(listener); + } + addProgressiveDoneListener(listener) { + this._progressiveDoneListeners.push(listener); + } + onDataRange(begin, chunk) { + for (const listener of this._rangeListeners) { + listener(begin, chunk); + } + } + onDataProgress(loaded, total) { + this._readyCapability.promise.then(() => { + for (const listener of this._progressListeners) { + listener(loaded, total); + } + }); + } + onDataProgressiveRead(chunk) { + this._readyCapability.promise.then(() => { + for (const listener of this._progressiveReadListeners) { + listener(chunk); + } + }); + } + onDataProgressiveDone() { + this._readyCapability.promise.then(() => { + for (const listener of this._progressiveDoneListeners) { + listener(); + } + }); + } + transportReady() { + this._readyCapability.resolve(); + } + requestDataRange(begin, end) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange"); + } + abort() {} +} +class PDFDocumentProxy { + constructor(pdfInfo, transport) { + this._pdfInfo = pdfInfo; + this._transport = transport; + } + get annotationStorage() { + return this._transport.annotationStorage; + } + get filterFactory() { + return this._transport.filterFactory; + } + get numPages() { + return this._pdfInfo.numPages; + } + get fingerprints() { + return this._pdfInfo.fingerprints; + } + get isPureXfa() { + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.shadow)(this, "isPureXfa", !!this._transport._htmlForXfa); + } + get allXfaHtml() { + return this._transport._htmlForXfa; + } + getPage(pageNumber) { + return this._transport.getPage(pageNumber); + } + getPageIndex(ref) { + return this._transport.getPageIndex(ref); + } + getDestinations() { + return this._transport.getDestinations(); + } + getDestination(id) { + return this._transport.getDestination(id); + } + getPageLabels() { + return this._transport.getPageLabels(); + } + getPageLayout() { + return this._transport.getPageLayout(); + } + getPageMode() { + return this._transport.getPageMode(); + } + getViewerPreferences() { + return this._transport.getViewerPreferences(); + } + getOpenAction() { + return this._transport.getOpenAction(); + } + getAttachments() { + return this._transport.getAttachments(); + } + getJSActions() { + return this._transport.getDocJSActions(); + } + getOutline() { + return this._transport.getOutline(); + } + getOptionalContentConfig() { + return this._transport.getOptionalContentConfig(); + } + getPermissions() { + return this._transport.getPermissions(); + } + getMetadata() { + return this._transport.getMetadata(); + } + getMarkInfo() { + return this._transport.getMarkInfo(); + } + getData() { + return this._transport.getData(); + } + saveDocument() { + return this._transport.saveDocument(); + } + getDownloadInfo() { + return this._transport.downloadInfoCapability.promise; + } + cleanup(keepLoadedFonts = false) { + return this._transport.startCleanup(keepLoadedFonts || this.isPureXfa); + } + destroy() { + return this.loadingTask.destroy(); + } + get loadingParams() { + return this._transport.loadingParams; + } + get loadingTask() { + return this._transport.loadingTask; + } + getFieldObjects() { + return this._transport.getFieldObjects(); + } + hasJSActions() { + return this._transport.hasJSActions(); + } + getCalculationOrderIds() { + return this._transport.getCalculationOrderIds(); + } +} +class PDFPageProxy { + #delayedCleanupTimeout = null; + #pendingCleanup = false; + constructor(pageIndex, pageInfo, transport, pdfBug = false) { + this._pageIndex = pageIndex; + this._pageInfo = pageInfo; + this._transport = transport; + this._stats = pdfBug ? new _display_utils_js__WEBPACK_IMPORTED_MODULE_2__.StatTimer() : null; + this._pdfBug = pdfBug; + this.commonObjs = transport.commonObjs; + this.objs = new PDFObjects(); + this._maybeCleanupAfterRender = false; + this._intentStates = new Map(); + this.destroyed = false; + } + get pageNumber() { + return this._pageIndex + 1; + } + get rotate() { + return this._pageInfo.rotate; + } + get ref() { + return this._pageInfo.ref; + } + get userUnit() { + return this._pageInfo.userUnit; + } + get view() { + return this._pageInfo.view; + } + getViewport({ + scale, + rotation = this.rotate, + offsetX = 0, + offsetY = 0, + dontFlip = false + } = {}) { + return new _display_utils_js__WEBPACK_IMPORTED_MODULE_2__.PageViewport({ + viewBox: this.view, + scale, + rotation, + offsetX, + offsetY, + dontFlip + }); + } + getAnnotations({ + intent = "display" + } = {}) { + const intentArgs = this._transport.getRenderingIntent(intent); + return this._transport.getAnnotations(this._pageIndex, intentArgs.renderingIntent); + } + getJSActions() { + return this._transport.getPageJSActions(this._pageIndex); + } + get filterFactory() { + return this._transport.filterFactory; + } + get isPureXfa() { + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.shadow)(this, "isPureXfa", !!this._transport._htmlForXfa); + } + async getXfa() { + return this._transport._htmlForXfa?.children[this._pageIndex] || null; + } + render({ + canvasContext, + viewport, + intent = "display", + annotationMode = _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AnnotationMode.ENABLE, + transform = null, + background = null, + optionalContentConfigPromise = null, + annotationCanvasMap = null, + pageColors = null, + printAnnotationStorage = null + }) { + this._stats?.time("Overall"); + const intentArgs = this._transport.getRenderingIntent(intent, annotationMode, printAnnotationStorage); + this.#pendingCleanup = false; + this.#abortDelayedCleanup(); + if (!optionalContentConfigPromise) { + optionalContentConfigPromise = this._transport.getOptionalContentConfig(); + } + let intentState = this._intentStates.get(intentArgs.cacheKey); + if (!intentState) { + intentState = Object.create(null); + this._intentStates.set(intentArgs.cacheKey, intentState); + } + if (intentState.streamReaderCancelTimeout) { + clearTimeout(intentState.streamReaderCancelTimeout); + intentState.streamReaderCancelTimeout = null; + } + const intentPrint = !!(intentArgs.renderingIntent & _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.RenderingIntentFlag.PRINT); + if (!intentState.displayReadyCapability) { + intentState.displayReadyCapability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + intentState.operatorList = { + fnArray: [], + argsArray: [], + lastChunk: false, + separateAnnots: null + }; + this._stats?.time("Page Request"); + this._pumpOperatorList(intentArgs); + } + const complete = error => { + intentState.renderTasks.delete(internalRenderTask); + if (this._maybeCleanupAfterRender || intentPrint) { + this.#pendingCleanup = true; + } + this.#tryCleanup(!intentPrint); + if (error) { + internalRenderTask.capability.reject(error); + this._abortOperatorList({ + intentState, + reason: error instanceof Error ? error : new Error(error) + }); + } else { + internalRenderTask.capability.resolve(); + } + this._stats?.timeEnd("Rendering"); + this._stats?.timeEnd("Overall"); + }; + const internalRenderTask = new InternalRenderTask({ + callback: complete, + params: { + canvasContext, + viewport, + transform, + background + }, + objs: this.objs, + commonObjs: this.commonObjs, + annotationCanvasMap, + operatorList: intentState.operatorList, + pageIndex: this._pageIndex, + canvasFactory: this._transport.canvasFactory, + filterFactory: this._transport.filterFactory, + useRequestAnimationFrame: !intentPrint, + pdfBug: this._pdfBug, + pageColors + }); + (intentState.renderTasks ||= new Set()).add(internalRenderTask); + const renderTask = internalRenderTask.task; + Promise.all([intentState.displayReadyCapability.promise, optionalContentConfigPromise]).then(([transparency, optionalContentConfig]) => { + if (this.destroyed) { + complete(); + return; + } + this._stats?.time("Rendering"); + internalRenderTask.initializeGraphics({ + transparency, + optionalContentConfig + }); + internalRenderTask.operatorListChanged(); + }).catch(complete); + return renderTask; + } + getOperatorList({ + intent = "display", + annotationMode = _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AnnotationMode.ENABLE, + printAnnotationStorage = null + } = {}) { + function operatorListChanged() { + if (intentState.operatorList.lastChunk) { + intentState.opListReadCapability.resolve(intentState.operatorList); + intentState.renderTasks.delete(opListTask); + } + } + const intentArgs = this._transport.getRenderingIntent(intent, annotationMode, printAnnotationStorage, true); + let intentState = this._intentStates.get(intentArgs.cacheKey); + if (!intentState) { + intentState = Object.create(null); + this._intentStates.set(intentArgs.cacheKey, intentState); + } + let opListTask; + if (!intentState.opListReadCapability) { + opListTask = Object.create(null); + opListTask.operatorListChanged = operatorListChanged; + intentState.opListReadCapability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + (intentState.renderTasks ||= new Set()).add(opListTask); + intentState.operatorList = { + fnArray: [], + argsArray: [], + lastChunk: false, + separateAnnots: null + }; + this._stats?.time("Page Request"); + this._pumpOperatorList(intentArgs); + } + return intentState.opListReadCapability.promise; + } + streamTextContent({ + includeMarkedContent = false, + disableNormalization = false + } = {}) { + const TEXT_CONTENT_CHUNK_SIZE = 100; + return this._transport.messageHandler.sendWithStream("GetTextContent", { + pageIndex: this._pageIndex, + includeMarkedContent: includeMarkedContent === true, + disableNormalization: disableNormalization === true + }, { + highWaterMark: TEXT_CONTENT_CHUNK_SIZE, + size(textContent) { + return textContent.items.length; + } + }); + } + getTextContent(params = {}) { + if (this._transport._htmlForXfa) { + return this.getXfa().then(xfa => { + return _xfa_text_js__WEBPACK_IMPORTED_MODULE_14__.XfaText.textContent(xfa); + }); + } + const readableStream = this.streamTextContent(params); + return new Promise(function (resolve, reject) { + function pump() { + reader.read().then(function ({ + value, + done + }) { + if (done) { + resolve(textContent); + return; + } + Object.assign(textContent.styles, value.styles); + textContent.items.push(...value.items); + pump(); + }, reject); + } + const reader = readableStream.getReader(); + const textContent = { + items: [], + styles: Object.create(null) + }; + pump(); + }); + } + getStructTree() { + return this._transport.getStructTree(this._pageIndex); + } + _destroy() { + this.destroyed = true; + const waitOn = []; + for (const intentState of this._intentStates.values()) { + this._abortOperatorList({ + intentState, + reason: new Error("Page was destroyed."), + force: true + }); + if (intentState.opListReadCapability) { + continue; + } + for (const internalRenderTask of intentState.renderTasks) { + waitOn.push(internalRenderTask.completed); + internalRenderTask.cancel(); + } + } + this.objs.clear(); + this.#pendingCleanup = false; + this.#abortDelayedCleanup(); + return Promise.all(waitOn); + } + cleanup(resetStats = false) { + this.#pendingCleanup = true; + const success = this.#tryCleanup(false); + if (resetStats && success) { + this._stats &&= new _display_utils_js__WEBPACK_IMPORTED_MODULE_2__.StatTimer(); + } + return success; + } + #tryCleanup(delayed = false) { + this.#abortDelayedCleanup(); + if (!this.#pendingCleanup || this.destroyed) { + return false; + } + if (delayed) { + this.#delayedCleanupTimeout = setTimeout(() => { + this.#delayedCleanupTimeout = null; + this.#tryCleanup(false); + }, DELAYED_CLEANUP_TIMEOUT); + return false; + } + for (const { + renderTasks, + operatorList + } of this._intentStates.values()) { + if (renderTasks.size > 0 || !operatorList.lastChunk) { + return false; + } + } + this._intentStates.clear(); + this.objs.clear(); + this.#pendingCleanup = false; + return true; + } + #abortDelayedCleanup() { + if (this.#delayedCleanupTimeout) { + clearTimeout(this.#delayedCleanupTimeout); + this.#delayedCleanupTimeout = null; + } + } + _startRenderPage(transparency, cacheKey) { + const intentState = this._intentStates.get(cacheKey); + if (!intentState) { + return; + } + this._stats?.timeEnd("Page Request"); + intentState.displayReadyCapability?.resolve(transparency); + } + _renderPageChunk(operatorListChunk, intentState) { + for (let i = 0, ii = operatorListChunk.length; i < ii; i++) { + intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]); + intentState.operatorList.argsArray.push(operatorListChunk.argsArray[i]); + } + intentState.operatorList.lastChunk = operatorListChunk.lastChunk; + intentState.operatorList.separateAnnots = operatorListChunk.separateAnnots; + for (const internalRenderTask of intentState.renderTasks) { + internalRenderTask.operatorListChanged(); + } + if (operatorListChunk.lastChunk) { + this.#tryCleanup(true); + } + } + _pumpOperatorList({ + renderingIntent, + cacheKey, + annotationStorageSerializable + }) { + const { + map, + transfer + } = annotationStorageSerializable; + const readableStream = this._transport.messageHandler.sendWithStream("GetOperatorList", { + pageIndex: this._pageIndex, + intent: renderingIntent, + cacheKey, + annotationStorage: map + }, transfer); + const reader = readableStream.getReader(); + const intentState = this._intentStates.get(cacheKey); + intentState.streamReader = reader; + const pump = () => { + reader.read().then(({ + value, + done + }) => { + if (done) { + intentState.streamReader = null; + return; + } + if (this._transport.destroyed) { + return; + } + this._renderPageChunk(value, intentState); + pump(); + }, reason => { + intentState.streamReader = null; + if (this._transport.destroyed) { + return; + } + if (intentState.operatorList) { + intentState.operatorList.lastChunk = true; + for (const internalRenderTask of intentState.renderTasks) { + internalRenderTask.operatorListChanged(); + } + this.#tryCleanup(true); + } + if (intentState.displayReadyCapability) { + intentState.displayReadyCapability.reject(reason); + } else if (intentState.opListReadCapability) { + intentState.opListReadCapability.reject(reason); + } else { + throw reason; + } + }); + }; + pump(); + } + _abortOperatorList({ + intentState, + reason, + force = false + }) { + if (!intentState.streamReader) { + return; + } + if (intentState.streamReaderCancelTimeout) { + clearTimeout(intentState.streamReaderCancelTimeout); + intentState.streamReaderCancelTimeout = null; + } + if (!force) { + if (intentState.renderTasks.size > 0) { + return; + } + if (reason instanceof _display_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingCancelledException) { + let delay = RENDERING_CANCELLED_TIMEOUT; + if (reason.extraDelay > 0 && reason.extraDelay < 1000) { + delay += reason.extraDelay; + } + intentState.streamReaderCancelTimeout = setTimeout(() => { + intentState.streamReaderCancelTimeout = null; + this._abortOperatorList({ + intentState, + reason, + force: true + }); + }, delay); + return; + } + } + intentState.streamReader.cancel(new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AbortException(reason.message)).catch(() => {}); + intentState.streamReader = null; + if (this._transport.destroyed) { + return; + } + for (const [curCacheKey, curIntentState] of this._intentStates) { + if (curIntentState === intentState) { + this._intentStates.delete(curCacheKey); + break; + } + } + this.cleanup(); + } + get stats() { + return this._stats; + } +} +class LoopbackPort { + #listeners = new Set(); + #deferred = Promise.resolve(); + postMessage(obj, transfer) { + const event = { + data: structuredClone(obj, transfer ? { + transfer + } : null) + }; + this.#deferred.then(() => { + for (const listener of this.#listeners) { + listener.call(this, event); + } + }); + } + addEventListener(name, listener) { + this.#listeners.add(listener); + } + removeEventListener(name, listener) { + this.#listeners.delete(listener); + } + terminate() { + this.#listeners.clear(); + } +} +const PDFWorkerUtil = { + isWorkerDisabled: false, + fakeWorkerId: 0 +}; +{ + if (_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.isNodeJS) { + PDFWorkerUtil.isWorkerDisabled = true; + _worker_options_js__WEBPACK_IMPORTED_MODULE_6__.GlobalWorkerOptions.workerSrc ||= "./pdf.worker.mjs"; + } + PDFWorkerUtil.isSameOrigin = function (baseUrl, otherUrl) { + let base; + try { + base = new URL(baseUrl); + if (!base.origin || base.origin === "null") { + return false; + } + } catch { + return false; + } + const other = new URL(otherUrl, base); + return base.origin === other.origin; + }; + PDFWorkerUtil.createCDNWrapper = function (url) { + const wrapper = `await import("${url}");`; + return URL.createObjectURL(new Blob([wrapper], { + type: "text/javascript" + })); + }; +} +class PDFWorker { + static #workerPorts; + constructor({ + name = null, + port = null, + verbosity = (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.getVerbosityLevel)() + } = {}) { + this.name = name; + this.destroyed = false; + this.verbosity = verbosity; + this._readyCapability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + this._port = null; + this._webWorker = null; + this._messageHandler = null; + if (port) { + if (PDFWorker.#workerPorts?.has(port)) { + throw new Error("Cannot use more than one PDFWorker per port."); + } + (PDFWorker.#workerPorts ||= new WeakMap()).set(port, this); + this._initializeFromPort(port); + return; + } + this._initialize(); + } + get promise() { + return this._readyCapability.promise; + } + get port() { + return this._port; + } + get messageHandler() { + return this._messageHandler; + } + _initializeFromPort(port) { + this._port = port; + this._messageHandler = new _shared_message_handler_js__WEBPACK_IMPORTED_MODULE_7__.MessageHandler("main", "worker", port); + this._messageHandler.on("ready", function () {}); + this._readyCapability.resolve(); + this._messageHandler.send("configure", { + verbosity: this.verbosity + }); + } + _initialize() { + if (!PDFWorkerUtil.isWorkerDisabled && !PDFWorker.#mainThreadWorkerMessageHandler) { + let { + workerSrc + } = PDFWorker; + try { + if (!PDFWorkerUtil.isSameOrigin(window.location.href, workerSrc)) { + workerSrc = PDFWorkerUtil.createCDNWrapper(new URL(workerSrc, window.location).href); + } + const worker = new Worker(workerSrc, { + type: "module" + }); + const messageHandler = new _shared_message_handler_js__WEBPACK_IMPORTED_MODULE_7__.MessageHandler("main", "worker", worker); + const terminateEarly = () => { + worker.removeEventListener("error", onWorkerError); + messageHandler.destroy(); + worker.terminate(); + if (this.destroyed) { + this._readyCapability.reject(new Error("Worker was destroyed")); + } else { + this._setupFakeWorker(); + } + }; + const onWorkerError = () => { + if (!this._webWorker) { + terminateEarly(); + } + }; + worker.addEventListener("error", onWorkerError); + messageHandler.on("test", data => { + worker.removeEventListener("error", onWorkerError); + if (this.destroyed) { + terminateEarly(); + return; + } + if (data) { + this._messageHandler = messageHandler; + this._port = worker; + this._webWorker = worker; + this._readyCapability.resolve(); + messageHandler.send("configure", { + verbosity: this.verbosity + }); + } else { + this._setupFakeWorker(); + messageHandler.destroy(); + worker.terminate(); + } + }); + messageHandler.on("ready", data => { + worker.removeEventListener("error", onWorkerError); + if (this.destroyed) { + terminateEarly(); + return; + } + try { + sendTest(); + } catch { + this._setupFakeWorker(); + } + }); + const sendTest = () => { + const testObj = new Uint8Array(); + messageHandler.send("test", testObj, [testObj.buffer]); + }; + sendTest(); + return; + } catch { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.info)("The worker has been disabled."); + } + } + this._setupFakeWorker(); + } + _setupFakeWorker() { + if (!PDFWorkerUtil.isWorkerDisabled) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)("Setting up fake worker."); + PDFWorkerUtil.isWorkerDisabled = true; + } + PDFWorker._setupFakeWorkerGlobal.then(WorkerMessageHandler => { + if (this.destroyed) { + this._readyCapability.reject(new Error("Worker was destroyed")); + return; + } + const port = new LoopbackPort(); + this._port = port; + const id = `fake${PDFWorkerUtil.fakeWorkerId++}`; + const workerHandler = new _shared_message_handler_js__WEBPACK_IMPORTED_MODULE_7__.MessageHandler(id + "_worker", id, port); + WorkerMessageHandler.setup(workerHandler, port); + const messageHandler = new _shared_message_handler_js__WEBPACK_IMPORTED_MODULE_7__.MessageHandler(id, id + "_worker", port); + this._messageHandler = messageHandler; + this._readyCapability.resolve(); + messageHandler.send("configure", { + verbosity: this.verbosity + }); + }).catch(reason => { + this._readyCapability.reject(new Error(`Setting up fake worker failed: "${reason.message}".`)); + }); + } + destroy() { + this.destroyed = true; + if (this._webWorker) { + this._webWorker.terminate(); + this._webWorker = null; + } + PDFWorker.#workerPorts?.delete(this._port); + this._port = null; + if (this._messageHandler) { + this._messageHandler.destroy(); + this._messageHandler = null; + } + } + static fromPort(params) { + if (!params?.port) { + throw new Error("PDFWorker.fromPort - invalid method signature."); + } + const cachedPort = this.#workerPorts?.get(params.port); + if (cachedPort) { + if (cachedPort._pendingDestroy) { + throw new Error("PDFWorker.fromPort - the worker is being destroyed.\n" + "Please remember to await `PDFDocumentLoadingTask.destroy()`-calls."); + } + return cachedPort; + } + return new PDFWorker(params); + } + static get workerSrc() { + if (_worker_options_js__WEBPACK_IMPORTED_MODULE_6__.GlobalWorkerOptions.workerSrc) { + return _worker_options_js__WEBPACK_IMPORTED_MODULE_6__.GlobalWorkerOptions.workerSrc; + } + throw new Error('No "GlobalWorkerOptions.workerSrc" specified.'); + } + static get #mainThreadWorkerMessageHandler() { + try { + return globalThis.pdfjsWorker?.WorkerMessageHandler || null; + } catch { + return null; + } + } + static get _setupFakeWorkerGlobal() { + const loader = async () => { + if (this.#mainThreadWorkerMessageHandler) { + return this.#mainThreadWorkerMessageHandler; + } + const worker = await import(/* webpackIgnore: true */ this.workerSrc); + return worker.WorkerMessageHandler; + }; + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.shadow)(this, "_setupFakeWorkerGlobal", loader()); + } +} +class WorkerTransport { + #methodPromises = new Map(); + #pageCache = new Map(); + #pagePromises = new Map(); + #passwordCapability = null; + constructor(messageHandler, loadingTask, networkStream, params, factory) { + this.messageHandler = messageHandler; + this.loadingTask = loadingTask; + this.commonObjs = new PDFObjects(); + this.fontLoader = new _font_loader_js__WEBPACK_IMPORTED_MODULE_3__.FontLoader({ + ownerDocument: params.ownerDocument, + styleElement: params.styleElement + }); + this._params = params; + this.canvasFactory = factory.canvasFactory; + this.filterFactory = factory.filterFactory; + this.cMapReaderFactory = factory.cMapReaderFactory; + this.standardFontDataFactory = factory.standardFontDataFactory; + this.destroyed = false; + this.destroyCapability = null; + this._networkStream = networkStream; + this._fullReader = null; + this._lastProgress = null; + this.downloadInfoCapability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + this.setupMessageHandler(); + } + #cacheSimpleMethod(name, data = null) { + const cachedPromise = this.#methodPromises.get(name); + if (cachedPromise) { + return cachedPromise; + } + const promise = this.messageHandler.sendWithPromise(name, data); + this.#methodPromises.set(name, promise); + return promise; + } + get annotationStorage() { + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.shadow)(this, "annotationStorage", new _annotation_storage_js__WEBPACK_IMPORTED_MODULE_1__.AnnotationStorage()); + } + getRenderingIntent(intent, annotationMode = _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AnnotationMode.ENABLE, printAnnotationStorage = null, isOpList = false) { + let renderingIntent = _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.RenderingIntentFlag.DISPLAY; + let annotationStorageSerializable = _annotation_storage_js__WEBPACK_IMPORTED_MODULE_1__.SerializableEmpty; + switch (intent) { + case "any": + renderingIntent = _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.RenderingIntentFlag.ANY; + break; + case "display": + break; + case "print": + renderingIntent = _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.RenderingIntentFlag.PRINT; + break; + default: + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)(`getRenderingIntent - invalid intent: ${intent}`); + } + switch (annotationMode) { + case _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AnnotationMode.DISABLE: + renderingIntent += _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.RenderingIntentFlag.ANNOTATIONS_DISABLE; + break; + case _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AnnotationMode.ENABLE: + break; + case _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AnnotationMode.ENABLE_FORMS: + renderingIntent += _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.RenderingIntentFlag.ANNOTATIONS_FORMS; + break; + case _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AnnotationMode.ENABLE_STORAGE: + renderingIntent += _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.RenderingIntentFlag.ANNOTATIONS_STORAGE; + const annotationStorage = renderingIntent & _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.RenderingIntentFlag.PRINT && printAnnotationStorage instanceof _annotation_storage_js__WEBPACK_IMPORTED_MODULE_1__.PrintAnnotationStorage ? printAnnotationStorage : this.annotationStorage; + annotationStorageSerializable = annotationStorage.serializable; + break; + default: + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)(`getRenderingIntent - invalid annotationMode: ${annotationMode}`); + } + if (isOpList) { + renderingIntent += _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.RenderingIntentFlag.OPLIST; + } + return { + renderingIntent, + cacheKey: `${renderingIntent}_${annotationStorageSerializable.hash}`, + annotationStorageSerializable + }; + } + destroy() { + if (this.destroyCapability) { + return this.destroyCapability.promise; + } + this.destroyed = true; + this.destroyCapability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + this.#passwordCapability?.reject(new Error("Worker was destroyed during onPassword callback")); + const waitOn = []; + for (const page of this.#pageCache.values()) { + waitOn.push(page._destroy()); + } + this.#pageCache.clear(); + this.#pagePromises.clear(); + if (this.hasOwnProperty("annotationStorage")) { + this.annotationStorage.resetModified(); + } + const terminated = this.messageHandler.sendWithPromise("Terminate", null); + waitOn.push(terminated); + Promise.all(waitOn).then(() => { + this.commonObjs.clear(); + this.fontLoader.clear(); + this.#methodPromises.clear(); + this.filterFactory.destroy(); + this._networkStream?.cancelAllRequests(new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AbortException("Worker was terminated.")); + if (this.messageHandler) { + this.messageHandler.destroy(); + this.messageHandler = null; + } + this.destroyCapability.resolve(); + }, this.destroyCapability.reject); + return this.destroyCapability.promise; + } + setupMessageHandler() { + const { + messageHandler, + loadingTask + } = this; + messageHandler.on("GetReader", (data, sink) => { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.assert)(this._networkStream, "GetReader - no `IPDFStream` instance available."); + this._fullReader = this._networkStream.getFullReader(); + this._fullReader.onProgress = evt => { + this._lastProgress = { + loaded: evt.loaded, + total: evt.total + }; + }; + sink.onPull = () => { + this._fullReader.read().then(function ({ + value, + done + }) { + if (done) { + sink.close(); + return; + } + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.assert)(value instanceof ArrayBuffer, "GetReader - expected an ArrayBuffer."); + sink.enqueue(new Uint8Array(value), 1, [value]); + }).catch(reason => { + sink.error(reason); + }); + }; + sink.onCancel = reason => { + this._fullReader.cancel(reason); + sink.ready.catch(readyReason => { + if (this.destroyed) { + return; + } + throw readyReason; + }); + }; + }); + messageHandler.on("ReaderHeadersReady", data => { + const headersCapability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + const fullReader = this._fullReader; + fullReader.headersReady.then(() => { + if (!fullReader.isStreamingSupported || !fullReader.isRangeSupported) { + if (this._lastProgress) { + loadingTask.onProgress?.(this._lastProgress); + } + fullReader.onProgress = evt => { + loadingTask.onProgress?.({ + loaded: evt.loaded, + total: evt.total + }); + }; + } + headersCapability.resolve({ + isStreamingSupported: fullReader.isStreamingSupported, + isRangeSupported: fullReader.isRangeSupported, + contentLength: fullReader.contentLength + }); + }, headersCapability.reject); + return headersCapability.promise; + }); + messageHandler.on("GetRangeReader", (data, sink) => { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.assert)(this._networkStream, "GetRangeReader - no `IPDFStream` instance available."); + const rangeReader = this._networkStream.getRangeReader(data.begin, data.end); + if (!rangeReader) { + sink.close(); + return; + } + sink.onPull = () => { + rangeReader.read().then(function ({ + value, + done + }) { + if (done) { + sink.close(); + return; + } + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.assert)(value instanceof ArrayBuffer, "GetRangeReader - expected an ArrayBuffer."); + sink.enqueue(new Uint8Array(value), 1, [value]); + }).catch(reason => { + sink.error(reason); + }); + }; + sink.onCancel = reason => { + rangeReader.cancel(reason); + sink.ready.catch(readyReason => { + if (this.destroyed) { + return; + } + throw readyReason; + }); + }; + }); + messageHandler.on("GetDoc", ({ + pdfInfo + }) => { + this._numPages = pdfInfo.numPages; + this._htmlForXfa = pdfInfo.htmlForXfa; + delete pdfInfo.htmlForXfa; + loadingTask._capability.resolve(new PDFDocumentProxy(pdfInfo, this)); + }); + messageHandler.on("DocException", function (ex) { + let reason; + switch (ex.name) { + case "PasswordException": + reason = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PasswordException(ex.message, ex.code); + break; + case "InvalidPDFException": + reason = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.InvalidPDFException(ex.message); + break; + case "MissingPDFException": + reason = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.MissingPDFException(ex.message); + break; + case "UnexpectedResponseException": + reason = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.UnexpectedResponseException(ex.message, ex.status); + break; + case "UnknownErrorException": + reason = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.UnknownErrorException(ex.message, ex.details); + break; + default: + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.unreachable)("DocException - expected a valid Error."); + } + loadingTask._capability.reject(reason); + }); + messageHandler.on("PasswordRequest", exception => { + this.#passwordCapability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + if (loadingTask.onPassword) { + const updatePassword = password => { + if (password instanceof Error) { + this.#passwordCapability.reject(password); + } else { + this.#passwordCapability.resolve({ + password + }); + } + }; + try { + loadingTask.onPassword(updatePassword, exception.code); + } catch (ex) { + this.#passwordCapability.reject(ex); + } + } else { + this.#passwordCapability.reject(new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PasswordException(exception.message, exception.code)); + } + return this.#passwordCapability.promise; + }); + messageHandler.on("DataLoaded", data => { + loadingTask.onProgress?.({ + loaded: data.length, + total: data.length + }); + this.downloadInfoCapability.resolve(data); + }); + messageHandler.on("StartRenderPage", data => { + if (this.destroyed) { + return; + } + const page = this.#pageCache.get(data.pageIndex); + page._startRenderPage(data.transparency, data.cacheKey); + }); + messageHandler.on("commonobj", ([id, type, exportedData]) => { + if (this.destroyed) { + return null; + } + if (this.commonObjs.has(id)) { + return null; + } + switch (type) { + case "Font": + const params = this._params; + if ("error" in exportedData) { + const exportedError = exportedData.error; + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)(`Error during font loading: ${exportedError}`); + this.commonObjs.resolve(id, exportedError); + break; + } + const inspectFont = params.pdfBug && globalThis.FontInspector?.enabled ? (font, url) => globalThis.FontInspector.fontAdded(font, url) : null; + const font = new _font_loader_js__WEBPACK_IMPORTED_MODULE_3__.FontFaceObject(exportedData, { + isEvalSupported: params.isEvalSupported, + disableFontFace: params.disableFontFace, + ignoreErrors: params.ignoreErrors, + inspectFont + }); + this.fontLoader.bind(font).catch(reason => { + return messageHandler.sendWithPromise("FontFallback", { + id + }); + }).finally(() => { + if (!params.fontExtraProperties && font.data) { + font.data = null; + } + this.commonObjs.resolve(id, font); + }); + break; + case "CopyLocalImage": + const { + imageRef + } = exportedData; + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.assert)(imageRef, "The imageRef must be defined."); + for (const pageProxy of this.#pageCache.values()) { + for (const [, data] of pageProxy.objs) { + if (data.ref !== imageRef) { + continue; + } + if (!data.dataLen) { + return null; + } + this.commonObjs.resolve(id, structuredClone(data)); + return data.dataLen; + } + } + break; + case "FontPath": + case "Image": + case "Pattern": + this.commonObjs.resolve(id, exportedData); + break; + default: + throw new Error(`Got unknown common object type ${type}`); + } + return null; + }); + messageHandler.on("obj", ([id, pageIndex, type, imageData]) => { + if (this.destroyed) { + return; + } + const pageProxy = this.#pageCache.get(pageIndex); + if (pageProxy.objs.has(id)) { + return; + } + if (pageProxy._intentStates.size === 0) { + imageData?.bitmap?.close(); + return; + } + switch (type) { + case "Image": + pageProxy.objs.resolve(id, imageData); + if (imageData?.dataLen > _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.MAX_IMAGE_SIZE_TO_CACHE) { + pageProxy._maybeCleanupAfterRender = true; + } + break; + case "Pattern": + pageProxy.objs.resolve(id, imageData); + break; + default: + throw new Error(`Got unknown object type ${type}`); + } + }); + messageHandler.on("DocProgress", data => { + if (this.destroyed) { + return; + } + loadingTask.onProgress?.({ + loaded: data.loaded, + total: data.total + }); + }); + messageHandler.on("FetchBuiltInCMap", data => { + if (this.destroyed) { + return Promise.reject(new Error("Worker was destroyed.")); + } + if (!this.cMapReaderFactory) { + return Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.")); + } + return this.cMapReaderFactory.fetch(data); + }); + messageHandler.on("FetchStandardFontData", data => { + if (this.destroyed) { + return Promise.reject(new Error("Worker was destroyed.")); + } + if (!this.standardFontDataFactory) { + return Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")); + } + return this.standardFontDataFactory.fetch(data); + }); + } + getData() { + return this.messageHandler.sendWithPromise("GetData", null); + } + saveDocument() { + if (this.annotationStorage.size <= 0) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)("saveDocument called while `annotationStorage` is empty, " + "please use the getData-method instead."); + } + const { + map, + transfer + } = this.annotationStorage.serializable; + return this.messageHandler.sendWithPromise("SaveDocument", { + isPureXfa: !!this._htmlForXfa, + numPages: this._numPages, + annotationStorage: map, + filename: this._fullReader?.filename ?? null + }, transfer).finally(() => { + this.annotationStorage.resetModified(); + }); + } + getPage(pageNumber) { + if (!Number.isInteger(pageNumber) || pageNumber <= 0 || pageNumber > this._numPages) { + return Promise.reject(new Error("Invalid page request.")); + } + const pageIndex = pageNumber - 1, + cachedPromise = this.#pagePromises.get(pageIndex); + if (cachedPromise) { + return cachedPromise; + } + const promise = this.messageHandler.sendWithPromise("GetPage", { + pageIndex + }).then(pageInfo => { + if (this.destroyed) { + throw new Error("Transport destroyed"); + } + const page = new PDFPageProxy(pageIndex, pageInfo, this, this._params.pdfBug); + this.#pageCache.set(pageIndex, page); + return page; + }); + this.#pagePromises.set(pageIndex, promise); + return promise; + } + getPageIndex(ref) { + if (typeof ref !== "object" || ref === null || !Number.isInteger(ref.num) || ref.num < 0 || !Number.isInteger(ref.gen) || ref.gen < 0) { + return Promise.reject(new Error("Invalid pageIndex request.")); + } + return this.messageHandler.sendWithPromise("GetPageIndex", { + num: ref.num, + gen: ref.gen + }); + } + getAnnotations(pageIndex, intent) { + return this.messageHandler.sendWithPromise("GetAnnotations", { + pageIndex, + intent + }); + } + getFieldObjects() { + return this.#cacheSimpleMethod("GetFieldObjects"); + } + hasJSActions() { + return this.#cacheSimpleMethod("HasJSActions"); + } + getCalculationOrderIds() { + return this.messageHandler.sendWithPromise("GetCalculationOrderIds", null); + } + getDestinations() { + return this.messageHandler.sendWithPromise("GetDestinations", null); + } + getDestination(id) { + if (typeof id !== "string") { + return Promise.reject(new Error("Invalid destination request.")); + } + return this.messageHandler.sendWithPromise("GetDestination", { + id + }); + } + getPageLabels() { + return this.messageHandler.sendWithPromise("GetPageLabels", null); + } + getPageLayout() { + return this.messageHandler.sendWithPromise("GetPageLayout", null); + } + getPageMode() { + return this.messageHandler.sendWithPromise("GetPageMode", null); + } + getViewerPreferences() { + return this.messageHandler.sendWithPromise("GetViewerPreferences", null); + } + getOpenAction() { + return this.messageHandler.sendWithPromise("GetOpenAction", null); + } + getAttachments() { + return this.messageHandler.sendWithPromise("GetAttachments", null); + } + getDocJSActions() { + return this.#cacheSimpleMethod("GetDocJSActions"); + } + getPageJSActions(pageIndex) { + return this.messageHandler.sendWithPromise("GetPageJSActions", { + pageIndex + }); + } + getStructTree(pageIndex) { + return this.messageHandler.sendWithPromise("GetStructTree", { + pageIndex + }); + } + getOutline() { + return this.messageHandler.sendWithPromise("GetOutline", null); + } + getOptionalContentConfig() { + return this.messageHandler.sendWithPromise("GetOptionalContentConfig", null).then(results => { + return new _optional_content_config_js__WEBPACK_IMPORTED_MODULE_9__.OptionalContentConfig(results); + }); + } + getPermissions() { + return this.messageHandler.sendWithPromise("GetPermissions", null); + } + getMetadata() { + const name = "GetMetadata", + cachedPromise = this.#methodPromises.get(name); + if (cachedPromise) { + return cachedPromise; + } + const promise = this.messageHandler.sendWithPromise(name, null).then(results => { + return { + info: results[0], + metadata: results[1] ? new _metadata_js__WEBPACK_IMPORTED_MODULE_8__.Metadata(results[1]) : null, + contentDispositionFilename: this._fullReader?.filename ?? null, + contentLength: this._fullReader?.contentLength ?? null + }; + }); + this.#methodPromises.set(name, promise); + return promise; + } + getMarkInfo() { + return this.messageHandler.sendWithPromise("GetMarkInfo", null); + } + async startCleanup(keepLoadedFonts = false) { + if (this.destroyed) { + return; + } + await this.messageHandler.sendWithPromise("Cleanup", null); + for (const page of this.#pageCache.values()) { + const cleanupSuccessful = page.cleanup(); + if (!cleanupSuccessful) { + throw new Error(`startCleanup: Page ${page.pageNumber} is currently rendering.`); + } + } + this.commonObjs.clear(); + if (!keepLoadedFonts) { + this.fontLoader.clear(); + } + this.#methodPromises.clear(); + this.filterFactory.destroy(true); + } + get loadingParams() { + const { + disableAutoFetch, + enableXfa + } = this._params; + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.shadow)(this, "loadingParams", { + disableAutoFetch, + enableXfa + }); + } +} +class PDFObjects { + #objs = Object.create(null); + #ensureObj(objId) { + return this.#objs[objId] ||= { + capability: new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(), + data: null + }; + } + get(objId, callback = null) { + if (callback) { + const obj = this.#ensureObj(objId); + obj.capability.promise.then(() => callback(obj.data)); + return null; + } + const obj = this.#objs[objId]; + if (!obj?.capability.settled) { + throw new Error(`Requesting object that isn't resolved yet ${objId}.`); + } + return obj.data; + } + has(objId) { + const obj = this.#objs[objId]; + return obj?.capability.settled ?? false; + } + resolve(objId, data = null) { + const obj = this.#ensureObj(objId); + obj.data = data; + obj.capability.resolve(); + } + clear() { + for (const objId in this.#objs) { + const { + data + } = this.#objs[objId]; + data?.bitmap?.close(); + } + this.#objs = Object.create(null); + } + *[Symbol.iterator]() { + for (const objId in this.#objs) { + const { + capability, + data + } = this.#objs[objId]; + if (!capability.settled) { + continue; + } + yield [objId, data]; + } + } +} +class RenderTask { + #internalRenderTask = null; + constructor(internalRenderTask) { + this.#internalRenderTask = internalRenderTask; + this.onContinue = null; + } + get promise() { + return this.#internalRenderTask.capability.promise; + } + cancel(extraDelay = 0) { + this.#internalRenderTask.cancel(null, extraDelay); + } + get separateAnnots() { + const { + separateAnnots + } = this.#internalRenderTask.operatorList; + if (!separateAnnots) { + return false; + } + const { + annotationCanvasMap + } = this.#internalRenderTask; + return separateAnnots.form || separateAnnots.canvas && annotationCanvasMap?.size > 0; + } +} +class InternalRenderTask { + static #canvasInUse = new WeakSet(); + constructor({ + callback, + params, + objs, + commonObjs, + annotationCanvasMap, + operatorList, + pageIndex, + canvasFactory, + filterFactory, + useRequestAnimationFrame = false, + pdfBug = false, + pageColors = null + }) { + this.callback = callback; + this.params = params; + this.objs = objs; + this.commonObjs = commonObjs; + this.annotationCanvasMap = annotationCanvasMap; + this.operatorListIdx = null; + this.operatorList = operatorList; + this._pageIndex = pageIndex; + this.canvasFactory = canvasFactory; + this.filterFactory = filterFactory; + this._pdfBug = pdfBug; + this.pageColors = pageColors; + this.running = false; + this.graphicsReadyCallback = null; + this.graphicsReady = false; + this._useRequestAnimationFrame = useRequestAnimationFrame === true && typeof window !== "undefined"; + this.cancelled = false; + this.capability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + this.task = new RenderTask(this); + this._cancelBound = this.cancel.bind(this); + this._continueBound = this._continue.bind(this); + this._scheduleNextBound = this._scheduleNext.bind(this); + this._nextBound = this._next.bind(this); + this._canvas = params.canvasContext.canvas; + } + get completed() { + return this.capability.promise.catch(function () {}); + } + initializeGraphics({ + transparency = false, + optionalContentConfig + }) { + if (this.cancelled) { + return; + } + if (this._canvas) { + if (InternalRenderTask.#canvasInUse.has(this._canvas)) { + throw new Error("Cannot use the same canvas during multiple render() operations. " + "Use different canvas or ensure previous operations were " + "cancelled or completed."); + } + InternalRenderTask.#canvasInUse.add(this._canvas); + } + if (this._pdfBug && globalThis.StepperManager?.enabled) { + this.stepper = globalThis.StepperManager.create(this._pageIndex); + this.stepper.init(this.operatorList); + this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint(); + } + const { + canvasContext, + viewport, + transform, + background + } = this.params; + this.gfx = new _canvas_js__WEBPACK_IMPORTED_MODULE_5__.CanvasGraphics(canvasContext, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, { + optionalContentConfig + }, this.annotationCanvasMap, this.pageColors); + this.gfx.beginDrawing({ + transform, + viewport, + transparency, + background + }); + this.operatorListIdx = 0; + this.graphicsReady = true; + this.graphicsReadyCallback?.(); + } + cancel(error = null, extraDelay = 0) { + this.running = false; + this.cancelled = true; + this.gfx?.endDrawing(); + InternalRenderTask.#canvasInUse.delete(this._canvas); + this.callback(error || new _display_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex + 1}`, extraDelay)); + } + operatorListChanged() { + if (!this.graphicsReady) { + this.graphicsReadyCallback ||= this._continueBound; + return; + } + this.stepper?.updateOperatorList(this.operatorList); + if (this.running) { + return; + } + this._continue(); + } + _continue() { + this.running = true; + if (this.cancelled) { + return; + } + if (this.task.onContinue) { + this.task.onContinue(this._scheduleNextBound); + } else { + this._scheduleNext(); + } + } + _scheduleNext() { + if (this._useRequestAnimationFrame) { + window.requestAnimationFrame(() => { + this._nextBound().catch(this._cancelBound); + }); + } else { + Promise.resolve().then(this._nextBound).catch(this._cancelBound); + } + } + async _next() { + if (this.cancelled) { + return; + } + this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper); + if (this.operatorListIdx === this.operatorList.argsArray.length) { + this.running = false; + if (this.operatorList.lastChunk) { + this.gfx.endDrawing(); + InternalRenderTask.#canvasInUse.delete(this._canvas); + this.callback(); + } + } + } +} +const version = '4.0.379'; +const build = '9e14d04fd'; + +__webpack_async_result__(); +} catch(e) { __webpack_async_result__(e); } }); + +/***/ }), + +/***/ 822: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ BaseCMapReaderFactory: () => (/* binding */ BaseCMapReaderFactory), +/* harmony export */ BaseCanvasFactory: () => (/* binding */ BaseCanvasFactory), +/* harmony export */ BaseFilterFactory: () => (/* binding */ BaseFilterFactory), +/* harmony export */ BaseSVGFactory: () => (/* binding */ BaseSVGFactory), +/* harmony export */ BaseStandardFontDataFactory: () => (/* binding */ BaseStandardFontDataFactory) +/* harmony export */ }); +/* harmony import */ var _shared_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(266); + +class BaseFilterFactory { + constructor() { + if (this.constructor === BaseFilterFactory) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.unreachable)("Cannot initialize BaseFilterFactory."); + } + } + addFilter(maps) { + return "none"; + } + addHCMFilter(fgColor, bgColor) { + return "none"; + } + addHighlightHCMFilter(fgColor, bgColor, newFgColor, newBgColor) { + return "none"; + } + destroy(keepHCM = false) {} +} +class BaseCanvasFactory { + constructor() { + if (this.constructor === BaseCanvasFactory) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.unreachable)("Cannot initialize BaseCanvasFactory."); + } + } + create(width, height) { + if (width <= 0 || height <= 0) { + throw new Error("Invalid canvas size"); + } + const canvas = this._createCanvas(width, height); + return { + canvas, + context: canvas.getContext("2d") + }; + } + reset(canvasAndContext, width, height) { + if (!canvasAndContext.canvas) { + throw new Error("Canvas is not specified"); + } + if (width <= 0 || height <= 0) { + throw new Error("Invalid canvas size"); + } + canvasAndContext.canvas.width = width; + canvasAndContext.canvas.height = height; + } + destroy(canvasAndContext) { + if (!canvasAndContext.canvas) { + throw new Error("Canvas is not specified"); + } + canvasAndContext.canvas.width = 0; + canvasAndContext.canvas.height = 0; + canvasAndContext.canvas = null; + canvasAndContext.context = null; + } + _createCanvas(width, height) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.unreachable)("Abstract method `_createCanvas` called."); + } +} +class BaseCMapReaderFactory { + constructor({ + baseUrl = null, + isCompressed = true + }) { + if (this.constructor === BaseCMapReaderFactory) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.unreachable)("Cannot initialize BaseCMapReaderFactory."); + } + this.baseUrl = baseUrl; + this.isCompressed = isCompressed; + } + async fetch({ + name + }) { + if (!this.baseUrl) { + throw new Error('The CMap "baseUrl" parameter must be specified, ensure that ' + 'the "cMapUrl" and "cMapPacked" API parameters are provided.'); + } + if (!name) { + throw new Error("CMap name must be specified."); + } + const url = this.baseUrl + name + (this.isCompressed ? ".bcmap" : ""); + const compressionType = this.isCompressed ? _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.CMapCompressionType.BINARY : _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.CMapCompressionType.NONE; + return this._fetchData(url, compressionType).catch(reason => { + throw new Error(`Unable to load ${this.isCompressed ? "binary " : ""}CMap at: ${url}`); + }); + } + _fetchData(url, compressionType) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.unreachable)("Abstract method `_fetchData` called."); + } +} +class BaseStandardFontDataFactory { + constructor({ + baseUrl = null + }) { + if (this.constructor === BaseStandardFontDataFactory) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.unreachable)("Cannot initialize BaseStandardFontDataFactory."); + } + this.baseUrl = baseUrl; + } + async fetch({ + filename + }) { + if (!this.baseUrl) { + throw new Error('The standard font "baseUrl" parameter must be specified, ensure that ' + 'the "standardFontDataUrl" API parameter is provided.'); + } + if (!filename) { + throw new Error("Font filename must be specified."); + } + const url = `${this.baseUrl}${filename}`; + return this._fetchData(url).catch(reason => { + throw new Error(`Unable to load font data at: ${url}`); + }); + } + _fetchData(url) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.unreachable)("Abstract method `_fetchData` called."); + } +} +class BaseSVGFactory { + constructor() { + if (this.constructor === BaseSVGFactory) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.unreachable)("Cannot initialize BaseSVGFactory."); + } + } + create(width, height, skipDimensions = false) { + if (width <= 0 || height <= 0) { + throw new Error("Invalid SVG dimensions"); + } + const svg = this._createSVG("svg:svg"); + svg.setAttribute("version", "1.1"); + if (!skipDimensions) { + svg.setAttribute("width", `${width}px`); + svg.setAttribute("height", `${height}px`); + } + svg.setAttribute("preserveAspectRatio", "none"); + svg.setAttribute("viewBox", `0 0 ${width} ${height}`); + return svg; + } + createElement(type) { + if (typeof type !== "string") { + throw new Error("Invalid SVG element type"); + } + return this._createSVG(type); + } + _createSVG(type) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.unreachable)("Abstract method `_createSVG` called."); + } +} + + +/***/ }), + +/***/ 250: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + CanvasGraphics: () => (/* binding */ CanvasGraphics) +}); + +// EXTERNAL MODULE: ./src/shared/util.js +var util = __webpack_require__(266); +// EXTERNAL MODULE: ./src/display/display_utils.js +var display_utils = __webpack_require__(473); +;// CONCATENATED MODULE: ./src/display/pattern_helper.js + + +const PathType = { + FILL: "Fill", + STROKE: "Stroke", + SHADING: "Shading" +}; +function applyBoundingBox(ctx, bbox) { + if (!bbox) { + return; + } + const width = bbox[2] - bbox[0]; + const height = bbox[3] - bbox[1]; + const region = new Path2D(); + region.rect(bbox[0], bbox[1], width, height); + ctx.clip(region); +} +class BaseShadingPattern { + constructor() { + if (this.constructor === BaseShadingPattern) { + (0,util.unreachable)("Cannot initialize BaseShadingPattern."); + } + } + getPattern() { + (0,util.unreachable)("Abstract method `getPattern` called."); + } +} +class RadialAxialShadingPattern extends BaseShadingPattern { + constructor(IR) { + super(); + this._type = IR[1]; + this._bbox = IR[2]; + this._colorStops = IR[3]; + this._p0 = IR[4]; + this._p1 = IR[5]; + this._r0 = IR[6]; + this._r1 = IR[7]; + this.matrix = null; + } + _createGradient(ctx) { + let grad; + if (this._type === "axial") { + grad = ctx.createLinearGradient(this._p0[0], this._p0[1], this._p1[0], this._p1[1]); + } else if (this._type === "radial") { + grad = ctx.createRadialGradient(this._p0[0], this._p0[1], this._r0, this._p1[0], this._p1[1], this._r1); + } + for (const colorStop of this._colorStops) { + grad.addColorStop(colorStop[0], colorStop[1]); + } + return grad; + } + getPattern(ctx, owner, inverse, pathType) { + let pattern; + if (pathType === PathType.STROKE || pathType === PathType.FILL) { + const ownerBBox = owner.current.getClippedPathBoundingBox(pathType, (0,display_utils.getCurrentTransform)(ctx)) || [0, 0, 0, 0]; + const width = Math.ceil(ownerBBox[2] - ownerBBox[0]) || 1; + const height = Math.ceil(ownerBBox[3] - ownerBBox[1]) || 1; + const tmpCanvas = owner.cachedCanvases.getCanvas("pattern", width, height, true); + const tmpCtx = tmpCanvas.context; + tmpCtx.clearRect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height); + tmpCtx.beginPath(); + tmpCtx.rect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height); + tmpCtx.translate(-ownerBBox[0], -ownerBBox[1]); + inverse = util.Util.transform(inverse, [1, 0, 0, 1, ownerBBox[0], ownerBBox[1]]); + tmpCtx.transform(...owner.baseTransform); + if (this.matrix) { + tmpCtx.transform(...this.matrix); + } + applyBoundingBox(tmpCtx, this._bbox); + tmpCtx.fillStyle = this._createGradient(tmpCtx); + tmpCtx.fill(); + pattern = ctx.createPattern(tmpCanvas.canvas, "no-repeat"); + const domMatrix = new DOMMatrix(inverse); + pattern.setTransform(domMatrix); + } else { + applyBoundingBox(ctx, this._bbox); + pattern = this._createGradient(ctx); + } + return pattern; + } +} +function drawTriangle(data, context, p1, p2, p3, c1, c2, c3) { + const coords = context.coords, + colors = context.colors; + const bytes = data.data, + rowSize = data.width * 4; + let tmp; + if (coords[p1 + 1] > coords[p2 + 1]) { + tmp = p1; + p1 = p2; + p2 = tmp; + tmp = c1; + c1 = c2; + c2 = tmp; + } + if (coords[p2 + 1] > coords[p3 + 1]) { + tmp = p2; + p2 = p3; + p3 = tmp; + tmp = c2; + c2 = c3; + c3 = tmp; + } + if (coords[p1 + 1] > coords[p2 + 1]) { + tmp = p1; + p1 = p2; + p2 = tmp; + tmp = c1; + c1 = c2; + c2 = tmp; + } + const x1 = (coords[p1] + context.offsetX) * context.scaleX; + const y1 = (coords[p1 + 1] + context.offsetY) * context.scaleY; + const x2 = (coords[p2] + context.offsetX) * context.scaleX; + const y2 = (coords[p2 + 1] + context.offsetY) * context.scaleY; + const x3 = (coords[p3] + context.offsetX) * context.scaleX; + const y3 = (coords[p3 + 1] + context.offsetY) * context.scaleY; + if (y1 >= y3) { + return; + } + const c1r = colors[c1], + c1g = colors[c1 + 1], + c1b = colors[c1 + 2]; + const c2r = colors[c2], + c2g = colors[c2 + 1], + c2b = colors[c2 + 2]; + const c3r = colors[c3], + c3g = colors[c3 + 1], + c3b = colors[c3 + 2]; + const minY = Math.round(y1), + maxY = Math.round(y3); + let xa, car, cag, cab; + let xb, cbr, cbg, cbb; + for (let y = minY; y <= maxY; y++) { + if (y < y2) { + const k = y < y1 ? 0 : (y1 - y) / (y1 - y2); + xa = x1 - (x1 - x2) * k; + car = c1r - (c1r - c2r) * k; + cag = c1g - (c1g - c2g) * k; + cab = c1b - (c1b - c2b) * k; + } else { + let k; + if (y > y3) { + k = 1; + } else if (y2 === y3) { + k = 0; + } else { + k = (y2 - y) / (y2 - y3); + } + xa = x2 - (x2 - x3) * k; + car = c2r - (c2r - c3r) * k; + cag = c2g - (c2g - c3g) * k; + cab = c2b - (c2b - c3b) * k; + } + let k; + if (y < y1) { + k = 0; + } else if (y > y3) { + k = 1; + } else { + k = (y1 - y) / (y1 - y3); + } + xb = x1 - (x1 - x3) * k; + cbr = c1r - (c1r - c3r) * k; + cbg = c1g - (c1g - c3g) * k; + cbb = c1b - (c1b - c3b) * k; + const x1_ = Math.round(Math.min(xa, xb)); + const x2_ = Math.round(Math.max(xa, xb)); + let j = rowSize * y + x1_ * 4; + for (let x = x1_; x <= x2_; x++) { + k = (xa - x) / (xa - xb); + if (k < 0) { + k = 0; + } else if (k > 1) { + k = 1; + } + bytes[j++] = car - (car - cbr) * k | 0; + bytes[j++] = cag - (cag - cbg) * k | 0; + bytes[j++] = cab - (cab - cbb) * k | 0; + bytes[j++] = 255; + } + } +} +function drawFigure(data, figure, context) { + const ps = figure.coords; + const cs = figure.colors; + let i, ii; + switch (figure.type) { + case "lattice": + const verticesPerRow = figure.verticesPerRow; + const rows = Math.floor(ps.length / verticesPerRow) - 1; + const cols = verticesPerRow - 1; + for (i = 0; i < rows; i++) { + let q = i * verticesPerRow; + for (let j = 0; j < cols; j++, q++) { + drawTriangle(data, context, ps[q], ps[q + 1], ps[q + verticesPerRow], cs[q], cs[q + 1], cs[q + verticesPerRow]); + drawTriangle(data, context, ps[q + verticesPerRow + 1], ps[q + 1], ps[q + verticesPerRow], cs[q + verticesPerRow + 1], cs[q + 1], cs[q + verticesPerRow]); + } + } + break; + case "triangles": + for (i = 0, ii = ps.length; i < ii; i += 3) { + drawTriangle(data, context, ps[i], ps[i + 1], ps[i + 2], cs[i], cs[i + 1], cs[i + 2]); + } + break; + default: + throw new Error("illegal figure"); + } +} +class MeshShadingPattern extends BaseShadingPattern { + constructor(IR) { + super(); + this._coords = IR[2]; + this._colors = IR[3]; + this._figures = IR[4]; + this._bounds = IR[5]; + this._bbox = IR[7]; + this._background = IR[8]; + this.matrix = null; + } + _createMeshCanvas(combinedScale, backgroundColor, cachedCanvases) { + const EXPECTED_SCALE = 1.1; + const MAX_PATTERN_SIZE = 3000; + const BORDER_SIZE = 2; + const offsetX = Math.floor(this._bounds[0]); + const offsetY = Math.floor(this._bounds[1]); + const boundsWidth = Math.ceil(this._bounds[2]) - offsetX; + const boundsHeight = Math.ceil(this._bounds[3]) - offsetY; + const width = Math.min(Math.ceil(Math.abs(boundsWidth * combinedScale[0] * EXPECTED_SCALE)), MAX_PATTERN_SIZE); + const height = Math.min(Math.ceil(Math.abs(boundsHeight * combinedScale[1] * EXPECTED_SCALE)), MAX_PATTERN_SIZE); + const scaleX = boundsWidth / width; + const scaleY = boundsHeight / height; + const context = { + coords: this._coords, + colors: this._colors, + offsetX: -offsetX, + offsetY: -offsetY, + scaleX: 1 / scaleX, + scaleY: 1 / scaleY + }; + const paddedWidth = width + BORDER_SIZE * 2; + const paddedHeight = height + BORDER_SIZE * 2; + const tmpCanvas = cachedCanvases.getCanvas("mesh", paddedWidth, paddedHeight, false); + const tmpCtx = tmpCanvas.context; + const data = tmpCtx.createImageData(width, height); + if (backgroundColor) { + const bytes = data.data; + for (let i = 0, ii = bytes.length; i < ii; i += 4) { + bytes[i] = backgroundColor[0]; + bytes[i + 1] = backgroundColor[1]; + bytes[i + 2] = backgroundColor[2]; + bytes[i + 3] = 255; + } + } + for (const figure of this._figures) { + drawFigure(data, figure, context); + } + tmpCtx.putImageData(data, BORDER_SIZE, BORDER_SIZE); + const canvas = tmpCanvas.canvas; + return { + canvas, + offsetX: offsetX - BORDER_SIZE * scaleX, + offsetY: offsetY - BORDER_SIZE * scaleY, + scaleX, + scaleY + }; + } + getPattern(ctx, owner, inverse, pathType) { + applyBoundingBox(ctx, this._bbox); + let scale; + if (pathType === PathType.SHADING) { + scale = util.Util.singularValueDecompose2dScale((0,display_utils.getCurrentTransform)(ctx)); + } else { + scale = util.Util.singularValueDecompose2dScale(owner.baseTransform); + if (this.matrix) { + const matrixScale = util.Util.singularValueDecompose2dScale(this.matrix); + scale = [scale[0] * matrixScale[0], scale[1] * matrixScale[1]]; + } + } + const temporaryPatternCanvas = this._createMeshCanvas(scale, pathType === PathType.SHADING ? null : this._background, owner.cachedCanvases); + if (pathType !== PathType.SHADING) { + ctx.setTransform(...owner.baseTransform); + if (this.matrix) { + ctx.transform(...this.matrix); + } + } + ctx.translate(temporaryPatternCanvas.offsetX, temporaryPatternCanvas.offsetY); + ctx.scale(temporaryPatternCanvas.scaleX, temporaryPatternCanvas.scaleY); + return ctx.createPattern(temporaryPatternCanvas.canvas, "no-repeat"); + } +} +class DummyShadingPattern extends BaseShadingPattern { + getPattern() { + return "hotpink"; + } +} +function getShadingPattern(IR) { + switch (IR[0]) { + case "RadialAxial": + return new RadialAxialShadingPattern(IR); + case "Mesh": + return new MeshShadingPattern(IR); + case "Dummy": + return new DummyShadingPattern(); + } + throw new Error(`Unknown IR type: ${IR[0]}`); +} +const PaintType = { + COLORED: 1, + UNCOLORED: 2 +}; +class TilingPattern { + static MAX_PATTERN_SIZE = 3000; + constructor(IR, color, ctx, canvasGraphicsFactory, baseTransform) { + this.operatorList = IR[2]; + this.matrix = IR[3] || [1, 0, 0, 1, 0, 0]; + this.bbox = IR[4]; + this.xstep = IR[5]; + this.ystep = IR[6]; + this.paintType = IR[7]; + this.tilingType = IR[8]; + this.color = color; + this.ctx = ctx; + this.canvasGraphicsFactory = canvasGraphicsFactory; + this.baseTransform = baseTransform; + } + createPatternCanvas(owner) { + const operatorList = this.operatorList; + const bbox = this.bbox; + const xstep = this.xstep; + const ystep = this.ystep; + const paintType = this.paintType; + const tilingType = this.tilingType; + const color = this.color; + const canvasGraphicsFactory = this.canvasGraphicsFactory; + (0,util.info)("TilingType: " + tilingType); + const x0 = bbox[0], + y0 = bbox[1], + x1 = bbox[2], + y1 = bbox[3]; + const matrixScale = util.Util.singularValueDecompose2dScale(this.matrix); + const curMatrixScale = util.Util.singularValueDecompose2dScale(this.baseTransform); + const combinedScale = [matrixScale[0] * curMatrixScale[0], matrixScale[1] * curMatrixScale[1]]; + const dimx = this.getSizeAndScale(xstep, this.ctx.canvas.width, combinedScale[0]); + const dimy = this.getSizeAndScale(ystep, this.ctx.canvas.height, combinedScale[1]); + const tmpCanvas = owner.cachedCanvases.getCanvas("pattern", dimx.size, dimy.size, true); + const tmpCtx = tmpCanvas.context; + const graphics = canvasGraphicsFactory.createCanvasGraphics(tmpCtx); + graphics.groupLevel = owner.groupLevel; + this.setFillAndStrokeStyleToContext(graphics, paintType, color); + let adjustedX0 = x0; + let adjustedY0 = y0; + let adjustedX1 = x1; + let adjustedY1 = y1; + if (x0 < 0) { + adjustedX0 = 0; + adjustedX1 += Math.abs(x0); + } + if (y0 < 0) { + adjustedY0 = 0; + adjustedY1 += Math.abs(y0); + } + tmpCtx.translate(-(dimx.scale * adjustedX0), -(dimy.scale * adjustedY0)); + graphics.transform(dimx.scale, 0, 0, dimy.scale, 0, 0); + tmpCtx.save(); + this.clipBbox(graphics, adjustedX0, adjustedY0, adjustedX1, adjustedY1); + graphics.baseTransform = (0,display_utils.getCurrentTransform)(graphics.ctx); + graphics.executeOperatorList(operatorList); + graphics.endDrawing(); + return { + canvas: tmpCanvas.canvas, + scaleX: dimx.scale, + scaleY: dimy.scale, + offsetX: adjustedX0, + offsetY: adjustedY0 + }; + } + getSizeAndScale(step, realOutputSize, scale) { + step = Math.abs(step); + const maxSize = Math.max(TilingPattern.MAX_PATTERN_SIZE, realOutputSize); + let size = Math.ceil(step * scale); + if (size >= maxSize) { + size = maxSize; + } else { + scale = size / step; + } + return { + scale, + size + }; + } + clipBbox(graphics, x0, y0, x1, y1) { + const bboxWidth = x1 - x0; + const bboxHeight = y1 - y0; + graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight); + graphics.current.updateRectMinMax((0,display_utils.getCurrentTransform)(graphics.ctx), [x0, y0, x1, y1]); + graphics.clip(); + graphics.endPath(); + } + setFillAndStrokeStyleToContext(graphics, paintType, color) { + const context = graphics.ctx, + current = graphics.current; + switch (paintType) { + case PaintType.COLORED: + const ctx = this.ctx; + context.fillStyle = ctx.fillStyle; + context.strokeStyle = ctx.strokeStyle; + current.fillColor = ctx.fillStyle; + current.strokeColor = ctx.strokeStyle; + break; + case PaintType.UNCOLORED: + const cssColor = util.Util.makeHexColor(color[0], color[1], color[2]); + context.fillStyle = cssColor; + context.strokeStyle = cssColor; + current.fillColor = cssColor; + current.strokeColor = cssColor; + break; + default: + throw new util.FormatError(`Unsupported paint type: ${paintType}`); + } + } + getPattern(ctx, owner, inverse, pathType) { + let matrix = inverse; + if (pathType !== PathType.SHADING) { + matrix = util.Util.transform(matrix, owner.baseTransform); + if (this.matrix) { + matrix = util.Util.transform(matrix, this.matrix); + } + } + const temporaryPatternCanvas = this.createPatternCanvas(owner); + let domMatrix = new DOMMatrix(matrix); + domMatrix = domMatrix.translate(temporaryPatternCanvas.offsetX, temporaryPatternCanvas.offsetY); + domMatrix = domMatrix.scale(1 / temporaryPatternCanvas.scaleX, 1 / temporaryPatternCanvas.scaleY); + const pattern = ctx.createPattern(temporaryPatternCanvas.canvas, "repeat"); + pattern.setTransform(domMatrix); + return pattern; + } +} + +;// CONCATENATED MODULE: ./src/shared/image_utils.js + +function convertToRGBA(params) { + switch (params.kind) { + case ImageKind.GRAYSCALE_1BPP: + return convertBlackAndWhiteToRGBA(params); + case ImageKind.RGB_24BPP: + return convertRGBToRGBA(params); + } + return null; +} +function convertBlackAndWhiteToRGBA({ + src, + srcPos = 0, + dest, + width, + height, + nonBlackColor = 0xffffffff, + inverseDecode = false +}) { + const black = util.FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff; + const [zeroMapping, oneMapping] = inverseDecode ? [nonBlackColor, black] : [black, nonBlackColor]; + const widthInSource = width >> 3; + const widthRemainder = width & 7; + const srcLength = src.length; + dest = new Uint32Array(dest.buffer); + let destPos = 0; + for (let i = 0; i < height; i++) { + for (const max = srcPos + widthInSource; srcPos < max; srcPos++) { + const elem = srcPos < srcLength ? src[srcPos] : 255; + dest[destPos++] = elem & 0b10000000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b1000000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b100000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b10000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b1000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b100 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b10 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b1 ? oneMapping : zeroMapping; + } + if (widthRemainder === 0) { + continue; + } + const elem = srcPos < srcLength ? src[srcPos++] : 255; + for (let j = 0; j < widthRemainder; j++) { + dest[destPos++] = elem & 1 << 7 - j ? oneMapping : zeroMapping; + } + } + return { + srcPos, + destPos + }; +} +function convertRGBToRGBA({ + src, + srcPos = 0, + dest, + destPos = 0, + width, + height +}) { + let i = 0; + const len32 = src.length >> 2; + const src32 = new Uint32Array(src.buffer, srcPos, len32); + if (FeatureTest.isLittleEndian) { + for (; i < len32 - 2; i += 3, destPos += 4) { + const s1 = src32[i]; + const s2 = src32[i + 1]; + const s3 = src32[i + 2]; + dest[destPos] = s1 | 0xff000000; + dest[destPos + 1] = s1 >>> 24 | s2 << 8 | 0xff000000; + dest[destPos + 2] = s2 >>> 16 | s3 << 16 | 0xff000000; + dest[destPos + 3] = s3 >>> 8 | 0xff000000; + } + for (let j = i * 4, jj = src.length; j < jj; j += 3) { + dest[destPos++] = src[j] | src[j + 1] << 8 | src[j + 2] << 16 | 0xff000000; + } + } else { + for (; i < len32 - 2; i += 3, destPos += 4) { + const s1 = src32[i]; + const s2 = src32[i + 1]; + const s3 = src32[i + 2]; + dest[destPos] = s1 | 0xff; + dest[destPos + 1] = s1 << 24 | s2 >>> 8 | 0xff; + dest[destPos + 2] = s2 << 16 | s3 >>> 16 | 0xff; + dest[destPos + 3] = s3 << 8 | 0xff; + } + for (let j = i * 4, jj = src.length; j < jj; j += 3) { + dest[destPos++] = src[j] << 24 | src[j + 1] << 16 | src[j + 2] << 8 | 0xff; + } + } + return { + srcPos, + destPos + }; +} +function grayToRGBA(src, dest) { + if (FeatureTest.isLittleEndian) { + for (let i = 0, ii = src.length; i < ii; i++) { + dest[i] = src[i] * 0x10101 | 0xff000000; + } + } else { + for (let i = 0, ii = src.length; i < ii; i++) { + dest[i] = src[i] * 0x1010100 | 0x000000ff; + } + } +} + +;// CONCATENATED MODULE: ./src/display/canvas.js + + + + +const MIN_FONT_SIZE = 16; +const MAX_FONT_SIZE = 100; +const MAX_GROUP_SIZE = 4096; +const EXECUTION_TIME = 15; +const EXECUTION_STEPS = 10; +const MAX_SIZE_TO_COMPILE = 1000; +const FULL_CHUNK_HEIGHT = 16; +function mirrorContextOperations(ctx, destCtx) { + if (ctx._removeMirroring) { + throw new Error("Context is already forwarding operations."); + } + ctx.__originalSave = ctx.save; + ctx.__originalRestore = ctx.restore; + ctx.__originalRotate = ctx.rotate; + ctx.__originalScale = ctx.scale; + ctx.__originalTranslate = ctx.translate; + ctx.__originalTransform = ctx.transform; + ctx.__originalSetTransform = ctx.setTransform; + ctx.__originalResetTransform = ctx.resetTransform; + ctx.__originalClip = ctx.clip; + ctx.__originalMoveTo = ctx.moveTo; + ctx.__originalLineTo = ctx.lineTo; + ctx.__originalBezierCurveTo = ctx.bezierCurveTo; + ctx.__originalRect = ctx.rect; + ctx.__originalClosePath = ctx.closePath; + ctx.__originalBeginPath = ctx.beginPath; + ctx._removeMirroring = () => { + ctx.save = ctx.__originalSave; + ctx.restore = ctx.__originalRestore; + ctx.rotate = ctx.__originalRotate; + ctx.scale = ctx.__originalScale; + ctx.translate = ctx.__originalTranslate; + ctx.transform = ctx.__originalTransform; + ctx.setTransform = ctx.__originalSetTransform; + ctx.resetTransform = ctx.__originalResetTransform; + ctx.clip = ctx.__originalClip; + ctx.moveTo = ctx.__originalMoveTo; + ctx.lineTo = ctx.__originalLineTo; + ctx.bezierCurveTo = ctx.__originalBezierCurveTo; + ctx.rect = ctx.__originalRect; + ctx.closePath = ctx.__originalClosePath; + ctx.beginPath = ctx.__originalBeginPath; + delete ctx._removeMirroring; + }; + ctx.save = function ctxSave() { + destCtx.save(); + this.__originalSave(); + }; + ctx.restore = function ctxRestore() { + destCtx.restore(); + this.__originalRestore(); + }; + ctx.translate = function ctxTranslate(x, y) { + destCtx.translate(x, y); + this.__originalTranslate(x, y); + }; + ctx.scale = function ctxScale(x, y) { + destCtx.scale(x, y); + this.__originalScale(x, y); + }; + ctx.transform = function ctxTransform(a, b, c, d, e, f) { + destCtx.transform(a, b, c, d, e, f); + this.__originalTransform(a, b, c, d, e, f); + }; + ctx.setTransform = function ctxSetTransform(a, b, c, d, e, f) { + destCtx.setTransform(a, b, c, d, e, f); + this.__originalSetTransform(a, b, c, d, e, f); + }; + ctx.resetTransform = function ctxResetTransform() { + destCtx.resetTransform(); + this.__originalResetTransform(); + }; + ctx.rotate = function ctxRotate(angle) { + destCtx.rotate(angle); + this.__originalRotate(angle); + }; + ctx.clip = function ctxRotate(rule) { + destCtx.clip(rule); + this.__originalClip(rule); + }; + ctx.moveTo = function (x, y) { + destCtx.moveTo(x, y); + this.__originalMoveTo(x, y); + }; + ctx.lineTo = function (x, y) { + destCtx.lineTo(x, y); + this.__originalLineTo(x, y); + }; + ctx.bezierCurveTo = function (cp1x, cp1y, cp2x, cp2y, x, y) { + destCtx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y); + this.__originalBezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y); + }; + ctx.rect = function (x, y, width, height) { + destCtx.rect(x, y, width, height); + this.__originalRect(x, y, width, height); + }; + ctx.closePath = function () { + destCtx.closePath(); + this.__originalClosePath(); + }; + ctx.beginPath = function () { + destCtx.beginPath(); + this.__originalBeginPath(); + }; +} +class CachedCanvases { + constructor(canvasFactory) { + this.canvasFactory = canvasFactory; + this.cache = Object.create(null); + } + getCanvas(id, width, height) { + let canvasEntry; + if (this.cache[id] !== undefined) { + canvasEntry = this.cache[id]; + this.canvasFactory.reset(canvasEntry, width, height); + } else { + canvasEntry = this.canvasFactory.create(width, height); + this.cache[id] = canvasEntry; + } + return canvasEntry; + } + delete(id) { + delete this.cache[id]; + } + clear() { + for (const id in this.cache) { + const canvasEntry = this.cache[id]; + this.canvasFactory.destroy(canvasEntry); + delete this.cache[id]; + } + } +} +function drawImageAtIntegerCoords(ctx, srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH) { + const [a, b, c, d, tx, ty] = (0,display_utils.getCurrentTransform)(ctx); + if (b === 0 && c === 0) { + const tlX = destX * a + tx; + const rTlX = Math.round(tlX); + const tlY = destY * d + ty; + const rTlY = Math.round(tlY); + const brX = (destX + destW) * a + tx; + const rWidth = Math.abs(Math.round(brX) - rTlX) || 1; + const brY = (destY + destH) * d + ty; + const rHeight = Math.abs(Math.round(brY) - rTlY) || 1; + ctx.setTransform(Math.sign(a), 0, 0, Math.sign(d), rTlX, rTlY); + ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rWidth, rHeight); + ctx.setTransform(a, b, c, d, tx, ty); + return [rWidth, rHeight]; + } + if (a === 0 && d === 0) { + const tlX = destY * c + tx; + const rTlX = Math.round(tlX); + const tlY = destX * b + ty; + const rTlY = Math.round(tlY); + const brX = (destY + destH) * c + tx; + const rWidth = Math.abs(Math.round(brX) - rTlX) || 1; + const brY = (destX + destW) * b + ty; + const rHeight = Math.abs(Math.round(brY) - rTlY) || 1; + ctx.setTransform(0, Math.sign(b), Math.sign(c), 0, rTlX, rTlY); + ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rHeight, rWidth); + ctx.setTransform(a, b, c, d, tx, ty); + return [rHeight, rWidth]; + } + ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH); + const scaleX = Math.hypot(a, b); + const scaleY = Math.hypot(c, d); + return [scaleX * destW, scaleY * destH]; +} +function compileType3Glyph(imgData) { + const { + width, + height + } = imgData; + if (width > MAX_SIZE_TO_COMPILE || height > MAX_SIZE_TO_COMPILE) { + return null; + } + const POINT_TO_PROCESS_LIMIT = 1000; + const POINT_TYPES = new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]); + const width1 = width + 1; + let points = new Uint8Array(width1 * (height + 1)); + let i, j, j0; + const lineSize = width + 7 & ~7; + let data = new Uint8Array(lineSize * height), + pos = 0; + for (const elem of imgData.data) { + let mask = 128; + while (mask > 0) { + data[pos++] = elem & mask ? 0 : 255; + mask >>= 1; + } + } + let count = 0; + pos = 0; + if (data[pos] !== 0) { + points[0] = 1; + ++count; + } + for (j = 1; j < width; j++) { + if (data[pos] !== data[pos + 1]) { + points[j] = data[pos] ? 2 : 1; + ++count; + } + pos++; + } + if (data[pos] !== 0) { + points[j] = 2; + ++count; + } + for (i = 1; i < height; i++) { + pos = i * lineSize; + j0 = i * width1; + if (data[pos - lineSize] !== data[pos]) { + points[j0] = data[pos] ? 1 : 8; + ++count; + } + let sum = (data[pos] ? 4 : 0) + (data[pos - lineSize] ? 8 : 0); + for (j = 1; j < width; j++) { + sum = (sum >> 2) + (data[pos + 1] ? 4 : 0) + (data[pos - lineSize + 1] ? 8 : 0); + if (POINT_TYPES[sum]) { + points[j0 + j] = POINT_TYPES[sum]; + ++count; + } + pos++; + } + if (data[pos - lineSize] !== data[pos]) { + points[j0 + j] = data[pos] ? 2 : 4; + ++count; + } + if (count > POINT_TO_PROCESS_LIMIT) { + return null; + } + } + pos = lineSize * (height - 1); + j0 = i * width1; + if (data[pos] !== 0) { + points[j0] = 8; + ++count; + } + for (j = 1; j < width; j++) { + if (data[pos] !== data[pos + 1]) { + points[j0 + j] = data[pos] ? 4 : 8; + ++count; + } + pos++; + } + if (data[pos] !== 0) { + points[j0 + j] = 4; + ++count; + } + if (count > POINT_TO_PROCESS_LIMIT) { + return null; + } + const steps = new Int32Array([0, width1, -1, 0, -width1, 0, 0, 0, 1]); + const path = new Path2D(); + for (i = 0; count && i <= height; i++) { + let p = i * width1; + const end = p + width; + while (p < end && !points[p]) { + p++; + } + if (p === end) { + continue; + } + path.moveTo(p % width1, i); + const p0 = p; + let type = points[p]; + do { + const step = steps[type]; + do { + p += step; + } while (!points[p]); + const pp = points[p]; + if (pp !== 5 && pp !== 10) { + type = pp; + points[p] = 0; + } else { + type = pp & 0x33 * type >> 4; + points[p] &= type >> 2 | type << 2; + } + path.lineTo(p % width1, p / width1 | 0); + if (!points[p]) { + --count; + } + } while (p0 !== p); + --i; + } + data = null; + points = null; + const drawOutline = function (c) { + c.save(); + c.scale(1 / width, -1 / height); + c.translate(0, -height); + c.fill(path); + c.beginPath(); + c.restore(); + }; + return drawOutline; +} +class CanvasExtraState { + constructor(width, height) { + this.alphaIsShape = false; + this.fontSize = 0; + this.fontSizeScale = 1; + this.textMatrix = util.IDENTITY_MATRIX; + this.textMatrixScale = 1; + this.fontMatrix = util.FONT_IDENTITY_MATRIX; + this.leading = 0; + this.x = 0; + this.y = 0; + this.lineX = 0; + this.lineY = 0; + this.charSpacing = 0; + this.wordSpacing = 0; + this.textHScale = 1; + this.textRenderingMode = util.TextRenderingMode.FILL; + this.textRise = 0; + this.fillColor = "#000000"; + this.strokeColor = "#000000"; + this.patternFill = false; + this.fillAlpha = 1; + this.strokeAlpha = 1; + this.lineWidth = 1; + this.activeSMask = null; + this.transferMaps = "none"; + this.startNewPathAndClipBox([0, 0, width, height]); + } + clone() { + const clone = Object.create(this); + clone.clipBox = this.clipBox.slice(); + return clone; + } + setCurrentPoint(x, y) { + this.x = x; + this.y = y; + } + updatePathMinMax(transform, x, y) { + [x, y] = util.Util.applyTransform([x, y], transform); + this.minX = Math.min(this.minX, x); + this.minY = Math.min(this.minY, y); + this.maxX = Math.max(this.maxX, x); + this.maxY = Math.max(this.maxY, y); + } + updateRectMinMax(transform, rect) { + const p1 = util.Util.applyTransform(rect, transform); + const p2 = util.Util.applyTransform(rect.slice(2), transform); + const p3 = util.Util.applyTransform([rect[0], rect[3]], transform); + const p4 = util.Util.applyTransform([rect[2], rect[1]], transform); + this.minX = Math.min(this.minX, p1[0], p2[0], p3[0], p4[0]); + this.minY = Math.min(this.minY, p1[1], p2[1], p3[1], p4[1]); + this.maxX = Math.max(this.maxX, p1[0], p2[0], p3[0], p4[0]); + this.maxY = Math.max(this.maxY, p1[1], p2[1], p3[1], p4[1]); + } + updateScalingPathMinMax(transform, minMax) { + util.Util.scaleMinMax(transform, minMax); + this.minX = Math.min(this.minX, minMax[0]); + this.maxX = Math.max(this.maxX, minMax[1]); + this.minY = Math.min(this.minY, minMax[2]); + this.maxY = Math.max(this.maxY, minMax[3]); + } + updateCurvePathMinMax(transform, x0, y0, x1, y1, x2, y2, x3, y3, minMax) { + const box = util.Util.bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3); + if (minMax) { + minMax[0] = Math.min(minMax[0], box[0], box[2]); + minMax[1] = Math.max(minMax[1], box[0], box[2]); + minMax[2] = Math.min(minMax[2], box[1], box[3]); + minMax[3] = Math.max(minMax[3], box[1], box[3]); + return; + } + this.updateRectMinMax(transform, box); + } + getPathBoundingBox(pathType = PathType.FILL, transform = null) { + const box = [this.minX, this.minY, this.maxX, this.maxY]; + if (pathType === PathType.STROKE) { + if (!transform) { + (0,util.unreachable)("Stroke bounding box must include transform."); + } + const scale = util.Util.singularValueDecompose2dScale(transform); + const xStrokePad = scale[0] * this.lineWidth / 2; + const yStrokePad = scale[1] * this.lineWidth / 2; + box[0] -= xStrokePad; + box[1] -= yStrokePad; + box[2] += xStrokePad; + box[3] += yStrokePad; + } + return box; + } + updateClipFromPath() { + const intersect = util.Util.intersect(this.clipBox, this.getPathBoundingBox()); + this.startNewPathAndClipBox(intersect || [0, 0, 0, 0]); + } + isEmptyClip() { + return this.minX === Infinity; + } + startNewPathAndClipBox(box) { + this.clipBox = box; + this.minX = Infinity; + this.minY = Infinity; + this.maxX = 0; + this.maxY = 0; + } + getClippedPathBoundingBox(pathType = PathType.FILL, transform = null) { + return util.Util.intersect(this.clipBox, this.getPathBoundingBox(pathType, transform)); + } +} +function putBinaryImageData(ctx, imgData) { + if (typeof ImageData !== "undefined" && imgData instanceof ImageData) { + ctx.putImageData(imgData, 0, 0); + return; + } + const height = imgData.height, + width = imgData.width; + const partialChunkHeight = height % FULL_CHUNK_HEIGHT; + const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT; + const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1; + const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT); + let srcPos = 0, + destPos; + const src = imgData.data; + const dest = chunkImgData.data; + let i, j, thisChunkHeight, elemsInThisChunk; + if (imgData.kind === util.ImageKind.GRAYSCALE_1BPP) { + const srcLength = src.byteLength; + const dest32 = new Uint32Array(dest.buffer, 0, dest.byteLength >> 2); + const dest32DataLength = dest32.length; + const fullSrcDiff = width + 7 >> 3; + const white = 0xffffffff; + const black = util.FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff; + for (i = 0; i < totalChunks; i++) { + thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight; + destPos = 0; + for (j = 0; j < thisChunkHeight; j++) { + const srcDiff = srcLength - srcPos; + let k = 0; + const kEnd = srcDiff > fullSrcDiff ? width : srcDiff * 8 - 7; + const kEndUnrolled = kEnd & ~7; + let mask = 0; + let srcByte = 0; + for (; k < kEndUnrolled; k += 8) { + srcByte = src[srcPos++]; + dest32[destPos++] = srcByte & 128 ? white : black; + dest32[destPos++] = srcByte & 64 ? white : black; + dest32[destPos++] = srcByte & 32 ? white : black; + dest32[destPos++] = srcByte & 16 ? white : black; + dest32[destPos++] = srcByte & 8 ? white : black; + dest32[destPos++] = srcByte & 4 ? white : black; + dest32[destPos++] = srcByte & 2 ? white : black; + dest32[destPos++] = srcByte & 1 ? white : black; + } + for (; k < kEnd; k++) { + if (mask === 0) { + srcByte = src[srcPos++]; + mask = 128; + } + dest32[destPos++] = srcByte & mask ? white : black; + mask >>= 1; + } + } + while (destPos < dest32DataLength) { + dest32[destPos++] = 0; + } + ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); + } + } else if (imgData.kind === util.ImageKind.RGBA_32BPP) { + j = 0; + elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4; + for (i = 0; i < fullChunks; i++) { + dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); + srcPos += elemsInThisChunk; + ctx.putImageData(chunkImgData, 0, j); + j += FULL_CHUNK_HEIGHT; + } + if (i < totalChunks) { + elemsInThisChunk = width * partialChunkHeight * 4; + dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk)); + ctx.putImageData(chunkImgData, 0, j); + } + } else if (imgData.kind === util.ImageKind.RGB_24BPP) { + thisChunkHeight = FULL_CHUNK_HEIGHT; + elemsInThisChunk = width * thisChunkHeight; + for (i = 0; i < totalChunks; i++) { + if (i >= fullChunks) { + thisChunkHeight = partialChunkHeight; + elemsInThisChunk = width * thisChunkHeight; + } + destPos = 0; + for (j = elemsInThisChunk; j--;) { + dest[destPos++] = src[srcPos++]; + dest[destPos++] = src[srcPos++]; + dest[destPos++] = src[srcPos++]; + dest[destPos++] = 255; + } + ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); + } + } else { + throw new Error(`bad image kind: ${imgData.kind}`); + } +} +function putBinaryImageMask(ctx, imgData) { + if (imgData.bitmap) { + ctx.drawImage(imgData.bitmap, 0, 0); + return; + } + const height = imgData.height, + width = imgData.width; + const partialChunkHeight = height % FULL_CHUNK_HEIGHT; + const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT; + const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1; + const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT); + let srcPos = 0; + const src = imgData.data; + const dest = chunkImgData.data; + for (let i = 0; i < totalChunks; i++) { + const thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight; + ({ + srcPos + } = convertBlackAndWhiteToRGBA({ + src, + srcPos, + dest, + width, + height: thisChunkHeight, + nonBlackColor: 0 + })); + ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT); + } +} +function copyCtxState(sourceCtx, destCtx) { + const properties = ["strokeStyle", "fillStyle", "fillRule", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "globalCompositeOperation", "font", "filter"]; + for (const property of properties) { + if (sourceCtx[property] !== undefined) { + destCtx[property] = sourceCtx[property]; + } + } + if (sourceCtx.setLineDash !== undefined) { + destCtx.setLineDash(sourceCtx.getLineDash()); + destCtx.lineDashOffset = sourceCtx.lineDashOffset; + } +} +function resetCtxToDefault(ctx) { + ctx.strokeStyle = ctx.fillStyle = "#000000"; + ctx.fillRule = "nonzero"; + ctx.globalAlpha = 1; + ctx.lineWidth = 1; + ctx.lineCap = "butt"; + ctx.lineJoin = "miter"; + ctx.miterLimit = 10; + ctx.globalCompositeOperation = "source-over"; + ctx.font = "10px sans-serif"; + if (ctx.setLineDash !== undefined) { + ctx.setLineDash([]); + ctx.lineDashOffset = 0; + } + if (!util.isNodeJS) { + const { + filter + } = ctx; + if (filter !== "none" && filter !== "") { + ctx.filter = "none"; + } + } +} +function composeSMaskBackdrop(bytes, r0, g0, b0) { + const length = bytes.length; + for (let i = 3; i < length; i += 4) { + const alpha = bytes[i]; + if (alpha === 0) { + bytes[i - 3] = r0; + bytes[i - 2] = g0; + bytes[i - 1] = b0; + } else if (alpha < 255) { + const alpha_ = 255 - alpha; + bytes[i - 3] = bytes[i - 3] * alpha + r0 * alpha_ >> 8; + bytes[i - 2] = bytes[i - 2] * alpha + g0 * alpha_ >> 8; + bytes[i - 1] = bytes[i - 1] * alpha + b0 * alpha_ >> 8; + } + } +} +function composeSMaskAlpha(maskData, layerData, transferMap) { + const length = maskData.length; + const scale = 1 / 255; + for (let i = 3; i < length; i += 4) { + const alpha = transferMap ? transferMap[maskData[i]] : maskData[i]; + layerData[i] = layerData[i] * alpha * scale | 0; + } +} +function composeSMaskLuminosity(maskData, layerData, transferMap) { + const length = maskData.length; + for (let i = 3; i < length; i += 4) { + const y = maskData[i - 3] * 77 + maskData[i - 2] * 152 + maskData[i - 1] * 28; + layerData[i] = transferMap ? layerData[i] * transferMap[y >> 8] >> 8 : layerData[i] * y >> 16; + } +} +function genericComposeSMask(maskCtx, layerCtx, width, height, subtype, backdrop, transferMap, layerOffsetX, layerOffsetY, maskOffsetX, maskOffsetY) { + const hasBackdrop = !!backdrop; + const r0 = hasBackdrop ? backdrop[0] : 0; + const g0 = hasBackdrop ? backdrop[1] : 0; + const b0 = hasBackdrop ? backdrop[2] : 0; + const composeFn = subtype === "Luminosity" ? composeSMaskLuminosity : composeSMaskAlpha; + const PIXELS_TO_PROCESS = 1048576; + const chunkSize = Math.min(height, Math.ceil(PIXELS_TO_PROCESS / width)); + for (let row = 0; row < height; row += chunkSize) { + const chunkHeight = Math.min(chunkSize, height - row); + const maskData = maskCtx.getImageData(layerOffsetX - maskOffsetX, row + (layerOffsetY - maskOffsetY), width, chunkHeight); + const layerData = layerCtx.getImageData(layerOffsetX, row + layerOffsetY, width, chunkHeight); + if (hasBackdrop) { + composeSMaskBackdrop(maskData.data, r0, g0, b0); + } + composeFn(maskData.data, layerData.data, transferMap); + layerCtx.putImageData(layerData, layerOffsetX, row + layerOffsetY); + } +} +function composeSMask(ctx, smask, layerCtx, layerBox) { + const layerOffsetX = layerBox[0]; + const layerOffsetY = layerBox[1]; + const layerWidth = layerBox[2] - layerOffsetX; + const layerHeight = layerBox[3] - layerOffsetY; + if (layerWidth === 0 || layerHeight === 0) { + return; + } + genericComposeSMask(smask.context, layerCtx, layerWidth, layerHeight, smask.subtype, smask.backdrop, smask.transferMap, layerOffsetX, layerOffsetY, smask.offsetX, smask.offsetY); + ctx.save(); + ctx.globalAlpha = 1; + ctx.globalCompositeOperation = "source-over"; + ctx.setTransform(1, 0, 0, 1, 0, 0); + ctx.drawImage(layerCtx.canvas, 0, 0); + ctx.restore(); +} +function getImageSmoothingEnabled(transform, interpolate) { + const scale = util.Util.singularValueDecompose2dScale(transform); + scale[0] = Math.fround(scale[0]); + scale[1] = Math.fround(scale[1]); + const actualScale = Math.fround((globalThis.devicePixelRatio || 1) * display_utils.PixelsPerInch.PDF_TO_CSS_UNITS); + if (interpolate !== undefined) { + return interpolate; + } else if (scale[0] <= actualScale || scale[1] <= actualScale) { + return true; + } + return false; +} +const LINE_CAP_STYLES = ["butt", "round", "square"]; +const LINE_JOIN_STYLES = ["miter", "round", "bevel"]; +const NORMAL_CLIP = {}; +const EO_CLIP = {}; +class CanvasGraphics { + constructor(canvasCtx, commonObjs, objs, canvasFactory, filterFactory, { + optionalContentConfig, + markedContentStack = null + }, annotationCanvasMap, pageColors) { + this.ctx = canvasCtx; + this.current = new CanvasExtraState(this.ctx.canvas.width, this.ctx.canvas.height); + this.stateStack = []; + this.pendingClip = null; + this.pendingEOFill = false; + this.res = null; + this.xobjs = null; + this.commonObjs = commonObjs; + this.objs = objs; + this.canvasFactory = canvasFactory; + this.filterFactory = filterFactory; + this.groupStack = []; + this.processingType3 = null; + this.baseTransform = null; + this.baseTransformStack = []; + this.groupLevel = 0; + this.smaskStack = []; + this.smaskCounter = 0; + this.tempSMask = null; + this.suspendedCtx = null; + this.contentVisible = true; + this.markedContentStack = markedContentStack || []; + this.optionalContentConfig = optionalContentConfig; + this.cachedCanvases = new CachedCanvases(this.canvasFactory); + this.cachedPatterns = new Map(); + this.annotationCanvasMap = annotationCanvasMap; + this.viewportScale = 1; + this.outputScaleX = 1; + this.outputScaleY = 1; + this.pageColors = pageColors; + this._cachedScaleForStroking = [-1, 0]; + this._cachedGetSinglePixelWidth = null; + this._cachedBitmapsMap = new Map(); + } + getObject(data, fallback = null) { + if (typeof data === "string") { + return data.startsWith("g_") ? this.commonObjs.get(data) : this.objs.get(data); + } + return fallback; + } + beginDrawing({ + transform, + viewport, + transparency = false, + background = null + }) { + const width = this.ctx.canvas.width; + const height = this.ctx.canvas.height; + const savedFillStyle = this.ctx.fillStyle; + this.ctx.fillStyle = background || "#ffffff"; + this.ctx.fillRect(0, 0, width, height); + this.ctx.fillStyle = savedFillStyle; + if (transparency) { + const transparentCanvas = this.cachedCanvases.getCanvas("transparent", width, height); + this.compositeCtx = this.ctx; + this.transparentCanvas = transparentCanvas.canvas; + this.ctx = transparentCanvas.context; + this.ctx.save(); + this.ctx.transform(...(0,display_utils.getCurrentTransform)(this.compositeCtx)); + } + this.ctx.save(); + resetCtxToDefault(this.ctx); + if (transform) { + this.ctx.transform(...transform); + this.outputScaleX = transform[0]; + this.outputScaleY = transform[0]; + } + this.ctx.transform(...viewport.transform); + this.viewportScale = viewport.scale; + this.baseTransform = (0,display_utils.getCurrentTransform)(this.ctx); + } + executeOperatorList(operatorList, executionStartIdx, continueCallback, stepper) { + const argsArray = operatorList.argsArray; + const fnArray = operatorList.fnArray; + let i = executionStartIdx || 0; + const argsArrayLen = argsArray.length; + if (argsArrayLen === i) { + return i; + } + const chunkOperations = argsArrayLen - i > EXECUTION_STEPS && typeof continueCallback === "function"; + const endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0; + let steps = 0; + const commonObjs = this.commonObjs; + const objs = this.objs; + let fnId; + while (true) { + if (stepper !== undefined && i === stepper.nextBreakPoint) { + stepper.breakIt(i, continueCallback); + return i; + } + fnId = fnArray[i]; + if (fnId !== util.OPS.dependency) { + this[fnId].apply(this, argsArray[i]); + } else { + for (const depObjId of argsArray[i]) { + const objsPool = depObjId.startsWith("g_") ? commonObjs : objs; + if (!objsPool.has(depObjId)) { + objsPool.get(depObjId, continueCallback); + return i; + } + } + } + i++; + if (i === argsArrayLen) { + return i; + } + if (chunkOperations && ++steps > EXECUTION_STEPS) { + if (Date.now() > endTime) { + continueCallback(); + return i; + } + steps = 0; + } + } + } + #restoreInitialState() { + while (this.stateStack.length || this.inSMaskMode) { + this.restore(); + } + this.ctx.restore(); + if (this.transparentCanvas) { + this.ctx = this.compositeCtx; + this.ctx.save(); + this.ctx.setTransform(1, 0, 0, 1, 0, 0); + this.ctx.drawImage(this.transparentCanvas, 0, 0); + this.ctx.restore(); + this.transparentCanvas = null; + } + } + endDrawing() { + this.#restoreInitialState(); + this.cachedCanvases.clear(); + this.cachedPatterns.clear(); + for (const cache of this._cachedBitmapsMap.values()) { + for (const canvas of cache.values()) { + if (typeof HTMLCanvasElement !== "undefined" && canvas instanceof HTMLCanvasElement) { + canvas.width = canvas.height = 0; + } + } + cache.clear(); + } + this._cachedBitmapsMap.clear(); + this.#drawFilter(); + } + #drawFilter() { + if (this.pageColors) { + const hcmFilterId = this.filterFactory.addHCMFilter(this.pageColors.foreground, this.pageColors.background); + if (hcmFilterId !== "none") { + const savedFilter = this.ctx.filter; + this.ctx.filter = hcmFilterId; + this.ctx.drawImage(this.ctx.canvas, 0, 0); + this.ctx.filter = savedFilter; + } + } + } + _scaleImage(img, inverseTransform) { + const width = img.width; + const height = img.height; + let widthScale = Math.max(Math.hypot(inverseTransform[0], inverseTransform[1]), 1); + let heightScale = Math.max(Math.hypot(inverseTransform[2], inverseTransform[3]), 1); + let paintWidth = width, + paintHeight = height; + let tmpCanvasId = "prescale1"; + let tmpCanvas, tmpCtx; + while (widthScale > 2 && paintWidth > 1 || heightScale > 2 && paintHeight > 1) { + let newWidth = paintWidth, + newHeight = paintHeight; + if (widthScale > 2 && paintWidth > 1) { + newWidth = paintWidth >= 16384 ? Math.floor(paintWidth / 2) - 1 || 1 : Math.ceil(paintWidth / 2); + widthScale /= paintWidth / newWidth; + } + if (heightScale > 2 && paintHeight > 1) { + newHeight = paintHeight >= 16384 ? Math.floor(paintHeight / 2) - 1 || 1 : Math.ceil(paintHeight) / 2; + heightScale /= paintHeight / newHeight; + } + tmpCanvas = this.cachedCanvases.getCanvas(tmpCanvasId, newWidth, newHeight); + tmpCtx = tmpCanvas.context; + tmpCtx.clearRect(0, 0, newWidth, newHeight); + tmpCtx.drawImage(img, 0, 0, paintWidth, paintHeight, 0, 0, newWidth, newHeight); + img = tmpCanvas.canvas; + paintWidth = newWidth; + paintHeight = newHeight; + tmpCanvasId = tmpCanvasId === "prescale1" ? "prescale2" : "prescale1"; + } + return { + img, + paintWidth, + paintHeight + }; + } + _createMaskCanvas(img) { + const ctx = this.ctx; + const { + width, + height + } = img; + const fillColor = this.current.fillColor; + const isPatternFill = this.current.patternFill; + const currentTransform = (0,display_utils.getCurrentTransform)(ctx); + let cache, cacheKey, scaled, maskCanvas; + if ((img.bitmap || img.data) && img.count > 1) { + const mainKey = img.bitmap || img.data.buffer; + cacheKey = JSON.stringify(isPatternFill ? currentTransform : [currentTransform.slice(0, 4), fillColor]); + cache = this._cachedBitmapsMap.get(mainKey); + if (!cache) { + cache = new Map(); + this._cachedBitmapsMap.set(mainKey, cache); + } + const cachedImage = cache.get(cacheKey); + if (cachedImage && !isPatternFill) { + const offsetX = Math.round(Math.min(currentTransform[0], currentTransform[2]) + currentTransform[4]); + const offsetY = Math.round(Math.min(currentTransform[1], currentTransform[3]) + currentTransform[5]); + return { + canvas: cachedImage, + offsetX, + offsetY + }; + } + scaled = cachedImage; + } + if (!scaled) { + maskCanvas = this.cachedCanvases.getCanvas("maskCanvas", width, height); + putBinaryImageMask(maskCanvas.context, img); + } + let maskToCanvas = util.Util.transform(currentTransform, [1 / width, 0, 0, -1 / height, 0, 0]); + maskToCanvas = util.Util.transform(maskToCanvas, [1, 0, 0, 1, 0, -height]); + const [minX, minY, maxX, maxY] = util.Util.getAxialAlignedBoundingBox([0, 0, width, height], maskToCanvas); + const drawnWidth = Math.round(maxX - minX) || 1; + const drawnHeight = Math.round(maxY - minY) || 1; + const fillCanvas = this.cachedCanvases.getCanvas("fillCanvas", drawnWidth, drawnHeight); + const fillCtx = fillCanvas.context; + const offsetX = minX; + const offsetY = minY; + fillCtx.translate(-offsetX, -offsetY); + fillCtx.transform(...maskToCanvas); + if (!scaled) { + scaled = this._scaleImage(maskCanvas.canvas, (0,display_utils.getCurrentTransformInverse)(fillCtx)); + scaled = scaled.img; + if (cache && isPatternFill) { + cache.set(cacheKey, scaled); + } + } + fillCtx.imageSmoothingEnabled = getImageSmoothingEnabled((0,display_utils.getCurrentTransform)(fillCtx), img.interpolate); + drawImageAtIntegerCoords(fillCtx, scaled, 0, 0, scaled.width, scaled.height, 0, 0, width, height); + fillCtx.globalCompositeOperation = "source-in"; + const inverse = util.Util.transform((0,display_utils.getCurrentTransformInverse)(fillCtx), [1, 0, 0, 1, -offsetX, -offsetY]); + fillCtx.fillStyle = isPatternFill ? fillColor.getPattern(ctx, this, inverse, PathType.FILL) : fillColor; + fillCtx.fillRect(0, 0, width, height); + if (cache && !isPatternFill) { + this.cachedCanvases.delete("fillCanvas"); + cache.set(cacheKey, fillCanvas.canvas); + } + return { + canvas: fillCanvas.canvas, + offsetX: Math.round(offsetX), + offsetY: Math.round(offsetY) + }; + } + setLineWidth(width) { + if (width !== this.current.lineWidth) { + this._cachedScaleForStroking[0] = -1; + } + this.current.lineWidth = width; + this.ctx.lineWidth = width; + } + setLineCap(style) { + this.ctx.lineCap = LINE_CAP_STYLES[style]; + } + setLineJoin(style) { + this.ctx.lineJoin = LINE_JOIN_STYLES[style]; + } + setMiterLimit(limit) { + this.ctx.miterLimit = limit; + } + setDash(dashArray, dashPhase) { + const ctx = this.ctx; + if (ctx.setLineDash !== undefined) { + ctx.setLineDash(dashArray); + ctx.lineDashOffset = dashPhase; + } + } + setRenderingIntent(intent) {} + setFlatness(flatness) {} + setGState(states) { + for (const [key, value] of states) { + switch (key) { + case "LW": + this.setLineWidth(value); + break; + case "LC": + this.setLineCap(value); + break; + case "LJ": + this.setLineJoin(value); + break; + case "ML": + this.setMiterLimit(value); + break; + case "D": + this.setDash(value[0], value[1]); + break; + case "RI": + this.setRenderingIntent(value); + break; + case "FL": + this.setFlatness(value); + break; + case "Font": + this.setFont(value[0], value[1]); + break; + case "CA": + this.current.strokeAlpha = value; + break; + case "ca": + this.current.fillAlpha = value; + this.ctx.globalAlpha = value; + break; + case "BM": + this.ctx.globalCompositeOperation = value; + break; + case "SMask": + this.current.activeSMask = value ? this.tempSMask : null; + this.tempSMask = null; + this.checkSMaskState(); + break; + case "TR": + this.ctx.filter = this.current.transferMaps = this.filterFactory.addFilter(value); + break; + } + } + } + get inSMaskMode() { + return !!this.suspendedCtx; + } + checkSMaskState() { + const inSMaskMode = this.inSMaskMode; + if (this.current.activeSMask && !inSMaskMode) { + this.beginSMaskMode(); + } else if (!this.current.activeSMask && inSMaskMode) { + this.endSMaskMode(); + } + } + beginSMaskMode() { + if (this.inSMaskMode) { + throw new Error("beginSMaskMode called while already in smask mode"); + } + const drawnWidth = this.ctx.canvas.width; + const drawnHeight = this.ctx.canvas.height; + const cacheId = "smaskGroupAt" + this.groupLevel; + const scratchCanvas = this.cachedCanvases.getCanvas(cacheId, drawnWidth, drawnHeight); + this.suspendedCtx = this.ctx; + this.ctx = scratchCanvas.context; + const ctx = this.ctx; + ctx.setTransform(...(0,display_utils.getCurrentTransform)(this.suspendedCtx)); + copyCtxState(this.suspendedCtx, ctx); + mirrorContextOperations(ctx, this.suspendedCtx); + this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]); + } + endSMaskMode() { + if (!this.inSMaskMode) { + throw new Error("endSMaskMode called while not in smask mode"); + } + this.ctx._removeMirroring(); + copyCtxState(this.ctx, this.suspendedCtx); + this.ctx = this.suspendedCtx; + this.suspendedCtx = null; + } + compose(dirtyBox) { + if (!this.current.activeSMask) { + return; + } + if (!dirtyBox) { + dirtyBox = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height]; + } else { + dirtyBox[0] = Math.floor(dirtyBox[0]); + dirtyBox[1] = Math.floor(dirtyBox[1]); + dirtyBox[2] = Math.ceil(dirtyBox[2]); + dirtyBox[3] = Math.ceil(dirtyBox[3]); + } + const smask = this.current.activeSMask; + const suspendedCtx = this.suspendedCtx; + composeSMask(suspendedCtx, smask, this.ctx, dirtyBox); + this.ctx.save(); + this.ctx.setTransform(1, 0, 0, 1, 0, 0); + this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height); + this.ctx.restore(); + } + save() { + if (this.inSMaskMode) { + copyCtxState(this.ctx, this.suspendedCtx); + this.suspendedCtx.save(); + } else { + this.ctx.save(); + } + const old = this.current; + this.stateStack.push(old); + this.current = old.clone(); + } + restore() { + if (this.stateStack.length === 0 && this.inSMaskMode) { + this.endSMaskMode(); + } + if (this.stateStack.length !== 0) { + this.current = this.stateStack.pop(); + if (this.inSMaskMode) { + this.suspendedCtx.restore(); + copyCtxState(this.suspendedCtx, this.ctx); + } else { + this.ctx.restore(); + } + this.checkSMaskState(); + this.pendingClip = null; + this._cachedScaleForStroking[0] = -1; + this._cachedGetSinglePixelWidth = null; + } + } + transform(a, b, c, d, e, f) { + this.ctx.transform(a, b, c, d, e, f); + this._cachedScaleForStroking[0] = -1; + this._cachedGetSinglePixelWidth = null; + } + constructPath(ops, args, minMax) { + const ctx = this.ctx; + const current = this.current; + let x = current.x, + y = current.y; + let startX, startY; + const currentTransform = (0,display_utils.getCurrentTransform)(ctx); + const isScalingMatrix = currentTransform[0] === 0 && currentTransform[3] === 0 || currentTransform[1] === 0 && currentTransform[2] === 0; + const minMaxForBezier = isScalingMatrix ? minMax.slice(0) : null; + for (let i = 0, j = 0, ii = ops.length; i < ii; i++) { + switch (ops[i] | 0) { + case util.OPS.rectangle: + x = args[j++]; + y = args[j++]; + const width = args[j++]; + const height = args[j++]; + const xw = x + width; + const yh = y + height; + ctx.moveTo(x, y); + if (width === 0 || height === 0) { + ctx.lineTo(xw, yh); + } else { + ctx.lineTo(xw, y); + ctx.lineTo(xw, yh); + ctx.lineTo(x, yh); + } + if (!isScalingMatrix) { + current.updateRectMinMax(currentTransform, [x, y, xw, yh]); + } + ctx.closePath(); + break; + case util.OPS.moveTo: + x = args[j++]; + y = args[j++]; + ctx.moveTo(x, y); + if (!isScalingMatrix) { + current.updatePathMinMax(currentTransform, x, y); + } + break; + case util.OPS.lineTo: + x = args[j++]; + y = args[j++]; + ctx.lineTo(x, y); + if (!isScalingMatrix) { + current.updatePathMinMax(currentTransform, x, y); + } + break; + case util.OPS.curveTo: + startX = x; + startY = y; + x = args[j + 4]; + y = args[j + 5]; + ctx.bezierCurveTo(args[j], args[j + 1], args[j + 2], args[j + 3], x, y); + current.updateCurvePathMinMax(currentTransform, startX, startY, args[j], args[j + 1], args[j + 2], args[j + 3], x, y, minMaxForBezier); + j += 6; + break; + case util.OPS.curveTo2: + startX = x; + startY = y; + ctx.bezierCurveTo(x, y, args[j], args[j + 1], args[j + 2], args[j + 3]); + current.updateCurvePathMinMax(currentTransform, startX, startY, x, y, args[j], args[j + 1], args[j + 2], args[j + 3], minMaxForBezier); + x = args[j + 2]; + y = args[j + 3]; + j += 4; + break; + case util.OPS.curveTo3: + startX = x; + startY = y; + x = args[j + 2]; + y = args[j + 3]; + ctx.bezierCurveTo(args[j], args[j + 1], x, y, x, y); + current.updateCurvePathMinMax(currentTransform, startX, startY, args[j], args[j + 1], x, y, x, y, minMaxForBezier); + j += 4; + break; + case util.OPS.closePath: + ctx.closePath(); + break; + } + } + if (isScalingMatrix) { + current.updateScalingPathMinMax(currentTransform, minMaxForBezier); + } + current.setCurrentPoint(x, y); + } + closePath() { + this.ctx.closePath(); + } + stroke(consumePath = true) { + const ctx = this.ctx; + const strokeColor = this.current.strokeColor; + ctx.globalAlpha = this.current.strokeAlpha; + if (this.contentVisible) { + if (typeof strokeColor === "object" && strokeColor?.getPattern) { + ctx.save(); + ctx.strokeStyle = strokeColor.getPattern(ctx, this, (0,display_utils.getCurrentTransformInverse)(ctx), PathType.STROKE); + this.rescaleAndStroke(false); + ctx.restore(); + } else { + this.rescaleAndStroke(true); + } + } + if (consumePath) { + this.consumePath(this.current.getClippedPathBoundingBox()); + } + ctx.globalAlpha = this.current.fillAlpha; + } + closeStroke() { + this.closePath(); + this.stroke(); + } + fill(consumePath = true) { + const ctx = this.ctx; + const fillColor = this.current.fillColor; + const isPatternFill = this.current.patternFill; + let needRestore = false; + if (isPatternFill) { + ctx.save(); + ctx.fillStyle = fillColor.getPattern(ctx, this, (0,display_utils.getCurrentTransformInverse)(ctx), PathType.FILL); + needRestore = true; + } + const intersect = this.current.getClippedPathBoundingBox(); + if (this.contentVisible && intersect !== null) { + if (this.pendingEOFill) { + ctx.fill("evenodd"); + this.pendingEOFill = false; + } else { + ctx.fill(); + } + } + if (needRestore) { + ctx.restore(); + } + if (consumePath) { + this.consumePath(intersect); + } + } + eoFill() { + this.pendingEOFill = true; + this.fill(); + } + fillStroke() { + this.fill(false); + this.stroke(false); + this.consumePath(); + } + eoFillStroke() { + this.pendingEOFill = true; + this.fillStroke(); + } + closeFillStroke() { + this.closePath(); + this.fillStroke(); + } + closeEOFillStroke() { + this.pendingEOFill = true; + this.closePath(); + this.fillStroke(); + } + endPath() { + this.consumePath(); + } + clip() { + this.pendingClip = NORMAL_CLIP; + } + eoClip() { + this.pendingClip = EO_CLIP; + } + beginText() { + this.current.textMatrix = util.IDENTITY_MATRIX; + this.current.textMatrixScale = 1; + this.current.x = this.current.lineX = 0; + this.current.y = this.current.lineY = 0; + } + endText() { + const paths = this.pendingTextPaths; + const ctx = this.ctx; + if (paths === undefined) { + ctx.beginPath(); + return; + } + ctx.save(); + ctx.beginPath(); + for (const path of paths) { + ctx.setTransform(...path.transform); + ctx.translate(path.x, path.y); + path.addToPath(ctx, path.fontSize); + } + ctx.restore(); + ctx.clip(); + ctx.beginPath(); + delete this.pendingTextPaths; + } + setCharSpacing(spacing) { + this.current.charSpacing = spacing; + } + setWordSpacing(spacing) { + this.current.wordSpacing = spacing; + } + setHScale(scale) { + this.current.textHScale = scale / 100; + } + setLeading(leading) { + this.current.leading = -leading; + } + setFont(fontRefName, size) { + const fontObj = this.commonObjs.get(fontRefName); + const current = this.current; + if (!fontObj) { + throw new Error(`Can't find font for ${fontRefName}`); + } + current.fontMatrix = fontObj.fontMatrix || util.FONT_IDENTITY_MATRIX; + if (current.fontMatrix[0] === 0 || current.fontMatrix[3] === 0) { + (0,util.warn)("Invalid font matrix for font " + fontRefName); + } + if (size < 0) { + size = -size; + current.fontDirection = -1; + } else { + current.fontDirection = 1; + } + this.current.font = fontObj; + this.current.fontSize = size; + if (fontObj.isType3Font) { + return; + } + const name = fontObj.loadedName || "sans-serif"; + const typeface = fontObj.systemFontInfo?.css || `"${name}", ${fontObj.fallbackName}`; + let bold = "normal"; + if (fontObj.black) { + bold = "900"; + } else if (fontObj.bold) { + bold = "bold"; + } + const italic = fontObj.italic ? "italic" : "normal"; + let browserFontSize = size; + if (size < MIN_FONT_SIZE) { + browserFontSize = MIN_FONT_SIZE; + } else if (size > MAX_FONT_SIZE) { + browserFontSize = MAX_FONT_SIZE; + } + this.current.fontSizeScale = size / browserFontSize; + this.ctx.font = `${italic} ${bold} ${browserFontSize}px ${typeface}`; + } + setTextRenderingMode(mode) { + this.current.textRenderingMode = mode; + } + setTextRise(rise) { + this.current.textRise = rise; + } + moveText(x, y) { + this.current.x = this.current.lineX += x; + this.current.y = this.current.lineY += y; + } + setLeadingMoveText(x, y) { + this.setLeading(-y); + this.moveText(x, y); + } + setTextMatrix(a, b, c, d, e, f) { + this.current.textMatrix = [a, b, c, d, e, f]; + this.current.textMatrixScale = Math.hypot(a, b); + this.current.x = this.current.lineX = 0; + this.current.y = this.current.lineY = 0; + } + nextLine() { + this.moveText(0, this.current.leading); + } + paintChar(character, x, y, patternTransform) { + const ctx = this.ctx; + const current = this.current; + const font = current.font; + const textRenderingMode = current.textRenderingMode; + const fontSize = current.fontSize / current.fontSizeScale; + const fillStrokeMode = textRenderingMode & util.TextRenderingMode.FILL_STROKE_MASK; + const isAddToPathSet = !!(textRenderingMode & util.TextRenderingMode.ADD_TO_PATH_FLAG); + const patternFill = current.patternFill && !font.missingFile; + let addToPath; + if (font.disableFontFace || isAddToPathSet || patternFill) { + addToPath = font.getPathGenerator(this.commonObjs, character); + } + if (font.disableFontFace || patternFill) { + ctx.save(); + ctx.translate(x, y); + ctx.beginPath(); + addToPath(ctx, fontSize); + if (patternTransform) { + ctx.setTransform(...patternTransform); + } + if (fillStrokeMode === util.TextRenderingMode.FILL || fillStrokeMode === util.TextRenderingMode.FILL_STROKE) { + ctx.fill(); + } + if (fillStrokeMode === util.TextRenderingMode.STROKE || fillStrokeMode === util.TextRenderingMode.FILL_STROKE) { + ctx.stroke(); + } + ctx.restore(); + } else { + if (fillStrokeMode === util.TextRenderingMode.FILL || fillStrokeMode === util.TextRenderingMode.FILL_STROKE) { + ctx.fillText(character, x, y); + } + if (fillStrokeMode === util.TextRenderingMode.STROKE || fillStrokeMode === util.TextRenderingMode.FILL_STROKE) { + ctx.strokeText(character, x, y); + } + } + if (isAddToPathSet) { + const paths = this.pendingTextPaths ||= []; + paths.push({ + transform: (0,display_utils.getCurrentTransform)(ctx), + x, + y, + fontSize, + addToPath + }); + } + } + get isFontSubpixelAAEnabled() { + const { + context: ctx + } = this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled", 10, 10); + ctx.scale(1.5, 1); + ctx.fillText("I", 0, 10); + const data = ctx.getImageData(0, 0, 10, 10).data; + let enabled = false; + for (let i = 3; i < data.length; i += 4) { + if (data[i] > 0 && data[i] < 255) { + enabled = true; + break; + } + } + return (0,util.shadow)(this, "isFontSubpixelAAEnabled", enabled); + } + showText(glyphs) { + const current = this.current; + const font = current.font; + if (font.isType3Font) { + return this.showType3Text(glyphs); + } + const fontSize = current.fontSize; + if (fontSize === 0) { + return undefined; + } + const ctx = this.ctx; + const fontSizeScale = current.fontSizeScale; + const charSpacing = current.charSpacing; + const wordSpacing = current.wordSpacing; + const fontDirection = current.fontDirection; + const textHScale = current.textHScale * fontDirection; + const glyphsLength = glyphs.length; + const vertical = font.vertical; + const spacingDir = vertical ? 1 : -1; + const defaultVMetrics = font.defaultVMetrics; + const widthAdvanceScale = fontSize * current.fontMatrix[0]; + const simpleFillText = current.textRenderingMode === util.TextRenderingMode.FILL && !font.disableFontFace && !current.patternFill; + ctx.save(); + ctx.transform(...current.textMatrix); + ctx.translate(current.x, current.y + current.textRise); + if (fontDirection > 0) { + ctx.scale(textHScale, -1); + } else { + ctx.scale(textHScale, 1); + } + let patternTransform; + if (current.patternFill) { + ctx.save(); + const pattern = current.fillColor.getPattern(ctx, this, (0,display_utils.getCurrentTransformInverse)(ctx), PathType.FILL); + patternTransform = (0,display_utils.getCurrentTransform)(ctx); + ctx.restore(); + ctx.fillStyle = pattern; + } + let lineWidth = current.lineWidth; + const scale = current.textMatrixScale; + if (scale === 0 || lineWidth === 0) { + const fillStrokeMode = current.textRenderingMode & util.TextRenderingMode.FILL_STROKE_MASK; + if (fillStrokeMode === util.TextRenderingMode.STROKE || fillStrokeMode === util.TextRenderingMode.FILL_STROKE) { + lineWidth = this.getSinglePixelWidth(); + } + } else { + lineWidth /= scale; + } + if (fontSizeScale !== 1.0) { + ctx.scale(fontSizeScale, fontSizeScale); + lineWidth /= fontSizeScale; + } + ctx.lineWidth = lineWidth; + if (font.isInvalidPDFjsFont) { + const chars = []; + let width = 0; + for (const glyph of glyphs) { + chars.push(glyph.unicode); + width += glyph.width; + } + ctx.fillText(chars.join(""), 0, 0); + current.x += width * widthAdvanceScale * textHScale; + ctx.restore(); + this.compose(); + return undefined; + } + let x = 0, + i; + for (i = 0; i < glyphsLength; ++i) { + const glyph = glyphs[i]; + if (typeof glyph === "number") { + x += spacingDir * glyph * fontSize / 1000; + continue; + } + let restoreNeeded = false; + const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; + const character = glyph.fontChar; + const accent = glyph.accent; + let scaledX, scaledY; + let width = glyph.width; + if (vertical) { + const vmetric = glyph.vmetric || defaultVMetrics; + const vx = -(glyph.vmetric ? vmetric[1] : width * 0.5) * widthAdvanceScale; + const vy = vmetric[2] * widthAdvanceScale; + width = vmetric ? -vmetric[0] : width; + scaledX = vx / fontSizeScale; + scaledY = (x + vy) / fontSizeScale; + } else { + scaledX = x / fontSizeScale; + scaledY = 0; + } + if (font.remeasure && width > 0) { + const measuredWidth = ctx.measureText(character).width * 1000 / fontSize * fontSizeScale; + if (width < measuredWidth && this.isFontSubpixelAAEnabled) { + const characterScaleX = width / measuredWidth; + restoreNeeded = true; + ctx.save(); + ctx.scale(characterScaleX, 1); + scaledX /= characterScaleX; + } else if (width !== measuredWidth) { + scaledX += (width - measuredWidth) / 2000 * fontSize / fontSizeScale; + } + } + if (this.contentVisible && (glyph.isInFont || font.missingFile)) { + if (simpleFillText && !accent) { + ctx.fillText(character, scaledX, scaledY); + } else { + this.paintChar(character, scaledX, scaledY, patternTransform); + if (accent) { + const scaledAccentX = scaledX + fontSize * accent.offset.x / fontSizeScale; + const scaledAccentY = scaledY - fontSize * accent.offset.y / fontSizeScale; + this.paintChar(accent.fontChar, scaledAccentX, scaledAccentY, patternTransform); + } + } + } + const charWidth = vertical ? width * widthAdvanceScale - spacing * fontDirection : width * widthAdvanceScale + spacing * fontDirection; + x += charWidth; + if (restoreNeeded) { + ctx.restore(); + } + } + if (vertical) { + current.y -= x; + } else { + current.x += x * textHScale; + } + ctx.restore(); + this.compose(); + return undefined; + } + showType3Text(glyphs) { + const ctx = this.ctx; + const current = this.current; + const font = current.font; + const fontSize = current.fontSize; + const fontDirection = current.fontDirection; + const spacingDir = font.vertical ? 1 : -1; + const charSpacing = current.charSpacing; + const wordSpacing = current.wordSpacing; + const textHScale = current.textHScale * fontDirection; + const fontMatrix = current.fontMatrix || util.FONT_IDENTITY_MATRIX; + const glyphsLength = glyphs.length; + const isTextInvisible = current.textRenderingMode === util.TextRenderingMode.INVISIBLE; + let i, glyph, width, spacingLength; + if (isTextInvisible || fontSize === 0) { + return; + } + this._cachedScaleForStroking[0] = -1; + this._cachedGetSinglePixelWidth = null; + ctx.save(); + ctx.transform(...current.textMatrix); + ctx.translate(current.x, current.y); + ctx.scale(textHScale, fontDirection); + for (i = 0; i < glyphsLength; ++i) { + glyph = glyphs[i]; + if (typeof glyph === "number") { + spacingLength = spacingDir * glyph * fontSize / 1000; + this.ctx.translate(spacingLength, 0); + current.x += spacingLength * textHScale; + continue; + } + const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing; + const operatorList = font.charProcOperatorList[glyph.operatorListId]; + if (!operatorList) { + (0,util.warn)(`Type3 character "${glyph.operatorListId}" is not available.`); + continue; + } + if (this.contentVisible) { + this.processingType3 = glyph; + this.save(); + ctx.scale(fontSize, fontSize); + ctx.transform(...fontMatrix); + this.executeOperatorList(operatorList); + this.restore(); + } + const transformed = util.Util.applyTransform([glyph.width, 0], fontMatrix); + width = transformed[0] * fontSize + spacing; + ctx.translate(width, 0); + current.x += width * textHScale; + } + ctx.restore(); + this.processingType3 = null; + } + setCharWidth(xWidth, yWidth) {} + setCharWidthAndBounds(xWidth, yWidth, llx, lly, urx, ury) { + this.ctx.rect(llx, lly, urx - llx, ury - lly); + this.ctx.clip(); + this.endPath(); + } + getColorN_Pattern(IR) { + let pattern; + if (IR[0] === "TilingPattern") { + const color = IR[1]; + const baseTransform = this.baseTransform || (0,display_utils.getCurrentTransform)(this.ctx); + const canvasGraphicsFactory = { + createCanvasGraphics: ctx => { + return new CanvasGraphics(ctx, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, { + optionalContentConfig: this.optionalContentConfig, + markedContentStack: this.markedContentStack + }); + } + }; + pattern = new TilingPattern(IR, color, this.ctx, canvasGraphicsFactory, baseTransform); + } else { + pattern = this._getPattern(IR[1], IR[2]); + } + return pattern; + } + setStrokeColorN() { + this.current.strokeColor = this.getColorN_Pattern(arguments); + } + setFillColorN() { + this.current.fillColor = this.getColorN_Pattern(arguments); + this.current.patternFill = true; + } + setStrokeRGBColor(r, g, b) { + const color = util.Util.makeHexColor(r, g, b); + this.ctx.strokeStyle = color; + this.current.strokeColor = color; + } + setFillRGBColor(r, g, b) { + const color = util.Util.makeHexColor(r, g, b); + this.ctx.fillStyle = color; + this.current.fillColor = color; + this.current.patternFill = false; + } + _getPattern(objId, matrix = null) { + let pattern; + if (this.cachedPatterns.has(objId)) { + pattern = this.cachedPatterns.get(objId); + } else { + pattern = getShadingPattern(this.getObject(objId)); + this.cachedPatterns.set(objId, pattern); + } + if (matrix) { + pattern.matrix = matrix; + } + return pattern; + } + shadingFill(objId) { + if (!this.contentVisible) { + return; + } + const ctx = this.ctx; + this.save(); + const pattern = this._getPattern(objId); + ctx.fillStyle = pattern.getPattern(ctx, this, (0,display_utils.getCurrentTransformInverse)(ctx), PathType.SHADING); + const inv = (0,display_utils.getCurrentTransformInverse)(ctx); + if (inv) { + const { + width, + height + } = ctx.canvas; + const [x0, y0, x1, y1] = util.Util.getAxialAlignedBoundingBox([0, 0, width, height], inv); + this.ctx.fillRect(x0, y0, x1 - x0, y1 - y0); + } else { + this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10); + } + this.compose(this.current.getClippedPathBoundingBox()); + this.restore(); + } + beginInlineImage() { + (0,util.unreachable)("Should not call beginInlineImage"); + } + beginImageData() { + (0,util.unreachable)("Should not call beginImageData"); + } + paintFormXObjectBegin(matrix, bbox) { + if (!this.contentVisible) { + return; + } + this.save(); + this.baseTransformStack.push(this.baseTransform); + if (Array.isArray(matrix) && matrix.length === 6) { + this.transform(...matrix); + } + this.baseTransform = (0,display_utils.getCurrentTransform)(this.ctx); + if (bbox) { + const width = bbox[2] - bbox[0]; + const height = bbox[3] - bbox[1]; + this.ctx.rect(bbox[0], bbox[1], width, height); + this.current.updateRectMinMax((0,display_utils.getCurrentTransform)(this.ctx), bbox); + this.clip(); + this.endPath(); + } + } + paintFormXObjectEnd() { + if (!this.contentVisible) { + return; + } + this.restore(); + this.baseTransform = this.baseTransformStack.pop(); + } + beginGroup(group) { + if (!this.contentVisible) { + return; + } + this.save(); + if (this.inSMaskMode) { + this.endSMaskMode(); + this.current.activeSMask = null; + } + const currentCtx = this.ctx; + if (!group.isolated) { + (0,util.info)("TODO: Support non-isolated groups."); + } + if (group.knockout) { + (0,util.warn)("Knockout groups not supported."); + } + const currentTransform = (0,display_utils.getCurrentTransform)(currentCtx); + if (group.matrix) { + currentCtx.transform(...group.matrix); + } + if (!group.bbox) { + throw new Error("Bounding box is required."); + } + let bounds = util.Util.getAxialAlignedBoundingBox(group.bbox, (0,display_utils.getCurrentTransform)(currentCtx)); + const canvasBounds = [0, 0, currentCtx.canvas.width, currentCtx.canvas.height]; + bounds = util.Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0]; + const offsetX = Math.floor(bounds[0]); + const offsetY = Math.floor(bounds[1]); + let drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1); + let drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1); + let scaleX = 1, + scaleY = 1; + if (drawnWidth > MAX_GROUP_SIZE) { + scaleX = drawnWidth / MAX_GROUP_SIZE; + drawnWidth = MAX_GROUP_SIZE; + } + if (drawnHeight > MAX_GROUP_SIZE) { + scaleY = drawnHeight / MAX_GROUP_SIZE; + drawnHeight = MAX_GROUP_SIZE; + } + this.current.startNewPathAndClipBox([0, 0, drawnWidth, drawnHeight]); + let cacheId = "groupAt" + this.groupLevel; + if (group.smask) { + cacheId += "_smask_" + this.smaskCounter++ % 2; + } + const scratchCanvas = this.cachedCanvases.getCanvas(cacheId, drawnWidth, drawnHeight); + const groupCtx = scratchCanvas.context; + groupCtx.scale(1 / scaleX, 1 / scaleY); + groupCtx.translate(-offsetX, -offsetY); + groupCtx.transform(...currentTransform); + if (group.smask) { + this.smaskStack.push({ + canvas: scratchCanvas.canvas, + context: groupCtx, + offsetX, + offsetY, + scaleX, + scaleY, + subtype: group.smask.subtype, + backdrop: group.smask.backdrop, + transferMap: group.smask.transferMap || null, + startTransformInverse: null + }); + } else { + currentCtx.setTransform(1, 0, 0, 1, 0, 0); + currentCtx.translate(offsetX, offsetY); + currentCtx.scale(scaleX, scaleY); + currentCtx.save(); + } + copyCtxState(currentCtx, groupCtx); + this.ctx = groupCtx; + this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]); + this.groupStack.push(currentCtx); + this.groupLevel++; + } + endGroup(group) { + if (!this.contentVisible) { + return; + } + this.groupLevel--; + const groupCtx = this.ctx; + const ctx = this.groupStack.pop(); + this.ctx = ctx; + this.ctx.imageSmoothingEnabled = false; + if (group.smask) { + this.tempSMask = this.smaskStack.pop(); + this.restore(); + } else { + this.ctx.restore(); + const currentMtx = (0,display_utils.getCurrentTransform)(this.ctx); + this.restore(); + this.ctx.save(); + this.ctx.setTransform(...currentMtx); + const dirtyBox = util.Util.getAxialAlignedBoundingBox([0, 0, groupCtx.canvas.width, groupCtx.canvas.height], currentMtx); + this.ctx.drawImage(groupCtx.canvas, 0, 0); + this.ctx.restore(); + this.compose(dirtyBox); + } + } + beginAnnotation(id, rect, transform, matrix, hasOwnCanvas) { + this.#restoreInitialState(); + resetCtxToDefault(this.ctx); + this.ctx.save(); + this.save(); + if (this.baseTransform) { + this.ctx.setTransform(...this.baseTransform); + } + if (Array.isArray(rect) && rect.length === 4) { + const width = rect[2] - rect[0]; + const height = rect[3] - rect[1]; + if (hasOwnCanvas && this.annotationCanvasMap) { + transform = transform.slice(); + transform[4] -= rect[0]; + transform[5] -= rect[1]; + rect = rect.slice(); + rect[0] = rect[1] = 0; + rect[2] = width; + rect[3] = height; + const [scaleX, scaleY] = util.Util.singularValueDecompose2dScale((0,display_utils.getCurrentTransform)(this.ctx)); + const { + viewportScale + } = this; + const canvasWidth = Math.ceil(width * this.outputScaleX * viewportScale); + const canvasHeight = Math.ceil(height * this.outputScaleY * viewportScale); + this.annotationCanvas = this.canvasFactory.create(canvasWidth, canvasHeight); + const { + canvas, + context + } = this.annotationCanvas; + this.annotationCanvasMap.set(id, canvas); + this.annotationCanvas.savedCtx = this.ctx; + this.ctx = context; + this.ctx.save(); + this.ctx.setTransform(scaleX, 0, 0, -scaleY, 0, height * scaleY); + resetCtxToDefault(this.ctx); + } else { + resetCtxToDefault(this.ctx); + this.ctx.rect(rect[0], rect[1], width, height); + this.ctx.clip(); + this.endPath(); + } + } + this.current = new CanvasExtraState(this.ctx.canvas.width, this.ctx.canvas.height); + this.transform(...transform); + this.transform(...matrix); + } + endAnnotation() { + if (this.annotationCanvas) { + this.ctx.restore(); + this.#drawFilter(); + this.ctx = this.annotationCanvas.savedCtx; + delete this.annotationCanvas.savedCtx; + delete this.annotationCanvas; + } + } + paintImageMaskXObject(img) { + if (!this.contentVisible) { + return; + } + const count = img.count; + img = this.getObject(img.data, img); + img.count = count; + const ctx = this.ctx; + const glyph = this.processingType3; + if (glyph) { + if (glyph.compiled === undefined) { + glyph.compiled = compileType3Glyph(img); + } + if (glyph.compiled) { + glyph.compiled(ctx); + return; + } + } + const mask = this._createMaskCanvas(img); + const maskCanvas = mask.canvas; + ctx.save(); + ctx.setTransform(1, 0, 0, 1, 0, 0); + ctx.drawImage(maskCanvas, mask.offsetX, mask.offsetY); + ctx.restore(); + this.compose(); + } + paintImageMaskXObjectRepeat(img, scaleX, skewX = 0, skewY = 0, scaleY, positions) { + if (!this.contentVisible) { + return; + } + img = this.getObject(img.data, img); + const ctx = this.ctx; + ctx.save(); + const currentTransform = (0,display_utils.getCurrentTransform)(ctx); + ctx.transform(scaleX, skewX, skewY, scaleY, 0, 0); + const mask = this._createMaskCanvas(img); + ctx.setTransform(1, 0, 0, 1, mask.offsetX - currentTransform[4], mask.offsetY - currentTransform[5]); + for (let i = 0, ii = positions.length; i < ii; i += 2) { + const trans = util.Util.transform(currentTransform, [scaleX, skewX, skewY, scaleY, positions[i], positions[i + 1]]); + const [x, y] = util.Util.applyTransform([0, 0], trans); + ctx.drawImage(mask.canvas, x, y); + } + ctx.restore(); + this.compose(); + } + paintImageMaskXObjectGroup(images) { + if (!this.contentVisible) { + return; + } + const ctx = this.ctx; + const fillColor = this.current.fillColor; + const isPatternFill = this.current.patternFill; + for (const image of images) { + const { + data, + width, + height, + transform + } = image; + const maskCanvas = this.cachedCanvases.getCanvas("maskCanvas", width, height); + const maskCtx = maskCanvas.context; + maskCtx.save(); + const img = this.getObject(data, image); + putBinaryImageMask(maskCtx, img); + maskCtx.globalCompositeOperation = "source-in"; + maskCtx.fillStyle = isPatternFill ? fillColor.getPattern(maskCtx, this, (0,display_utils.getCurrentTransformInverse)(ctx), PathType.FILL) : fillColor; + maskCtx.fillRect(0, 0, width, height); + maskCtx.restore(); + ctx.save(); + ctx.transform(...transform); + ctx.scale(1, -1); + drawImageAtIntegerCoords(ctx, maskCanvas.canvas, 0, 0, width, height, 0, -1, 1, 1); + ctx.restore(); + } + this.compose(); + } + paintImageXObject(objId) { + if (!this.contentVisible) { + return; + } + const imgData = this.getObject(objId); + if (!imgData) { + (0,util.warn)("Dependent image isn't ready yet"); + return; + } + this.paintInlineImageXObject(imgData); + } + paintImageXObjectRepeat(objId, scaleX, scaleY, positions) { + if (!this.contentVisible) { + return; + } + const imgData = this.getObject(objId); + if (!imgData) { + (0,util.warn)("Dependent image isn't ready yet"); + return; + } + const width = imgData.width; + const height = imgData.height; + const map = []; + for (let i = 0, ii = positions.length; i < ii; i += 2) { + map.push({ + transform: [scaleX, 0, 0, scaleY, positions[i], positions[i + 1]], + x: 0, + y: 0, + w: width, + h: height + }); + } + this.paintInlineImageXObjectGroup(imgData, map); + } + applyTransferMapsToCanvas(ctx) { + if (this.current.transferMaps !== "none") { + ctx.filter = this.current.transferMaps; + ctx.drawImage(ctx.canvas, 0, 0); + ctx.filter = "none"; + } + return ctx.canvas; + } + applyTransferMapsToBitmap(imgData) { + if (this.current.transferMaps === "none") { + return imgData.bitmap; + } + const { + bitmap, + width, + height + } = imgData; + const tmpCanvas = this.cachedCanvases.getCanvas("inlineImage", width, height); + const tmpCtx = tmpCanvas.context; + tmpCtx.filter = this.current.transferMaps; + tmpCtx.drawImage(bitmap, 0, 0); + tmpCtx.filter = "none"; + return tmpCanvas.canvas; + } + paintInlineImageXObject(imgData) { + if (!this.contentVisible) { + return; + } + const width = imgData.width; + const height = imgData.height; + const ctx = this.ctx; + this.save(); + if (!util.isNodeJS) { + const { + filter + } = ctx; + if (filter !== "none" && filter !== "") { + ctx.filter = "none"; + } + } + ctx.scale(1 / width, -1 / height); + let imgToPaint; + if (imgData.bitmap) { + imgToPaint = this.applyTransferMapsToBitmap(imgData); + } else if (typeof HTMLElement === "function" && imgData instanceof HTMLElement || !imgData.data) { + imgToPaint = imgData; + } else { + const tmpCanvas = this.cachedCanvases.getCanvas("inlineImage", width, height); + const tmpCtx = tmpCanvas.context; + putBinaryImageData(tmpCtx, imgData); + imgToPaint = this.applyTransferMapsToCanvas(tmpCtx); + } + const scaled = this._scaleImage(imgToPaint, (0,display_utils.getCurrentTransformInverse)(ctx)); + ctx.imageSmoothingEnabled = getImageSmoothingEnabled((0,display_utils.getCurrentTransform)(ctx), imgData.interpolate); + drawImageAtIntegerCoords(ctx, scaled.img, 0, 0, scaled.paintWidth, scaled.paintHeight, 0, -height, width, height); + this.compose(); + this.restore(); + } + paintInlineImageXObjectGroup(imgData, map) { + if (!this.contentVisible) { + return; + } + const ctx = this.ctx; + let imgToPaint; + if (imgData.bitmap) { + imgToPaint = imgData.bitmap; + } else { + const w = imgData.width; + const h = imgData.height; + const tmpCanvas = this.cachedCanvases.getCanvas("inlineImage", w, h); + const tmpCtx = tmpCanvas.context; + putBinaryImageData(tmpCtx, imgData); + imgToPaint = this.applyTransferMapsToCanvas(tmpCtx); + } + for (const entry of map) { + ctx.save(); + ctx.transform(...entry.transform); + ctx.scale(1, -1); + drawImageAtIntegerCoords(ctx, imgToPaint, entry.x, entry.y, entry.w, entry.h, 0, -1, 1, 1); + ctx.restore(); + } + this.compose(); + } + paintSolidColorImageMask() { + if (!this.contentVisible) { + return; + } + this.ctx.fillRect(0, 0, 1, 1); + this.compose(); + } + markPoint(tag) {} + markPointProps(tag, properties) {} + beginMarkedContent(tag) { + this.markedContentStack.push({ + visible: true + }); + } + beginMarkedContentProps(tag, properties) { + if (tag === "OC") { + this.markedContentStack.push({ + visible: this.optionalContentConfig.isVisible(properties) + }); + } else { + this.markedContentStack.push({ + visible: true + }); + } + this.contentVisible = this.isContentVisible(); + } + endMarkedContent() { + this.markedContentStack.pop(); + this.contentVisible = this.isContentVisible(); + } + beginCompat() {} + endCompat() {} + consumePath(clipBox) { + const isEmpty = this.current.isEmptyClip(); + if (this.pendingClip) { + this.current.updateClipFromPath(); + } + if (!this.pendingClip) { + this.compose(clipBox); + } + const ctx = this.ctx; + if (this.pendingClip) { + if (!isEmpty) { + if (this.pendingClip === EO_CLIP) { + ctx.clip("evenodd"); + } else { + ctx.clip(); + } + } + this.pendingClip = null; + } + this.current.startNewPathAndClipBox(this.current.clipBox); + ctx.beginPath(); + } + getSinglePixelWidth() { + if (!this._cachedGetSinglePixelWidth) { + const m = (0,display_utils.getCurrentTransform)(this.ctx); + if (m[1] === 0 && m[2] === 0) { + this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(m[0]), Math.abs(m[3])); + } else { + const absDet = Math.abs(m[0] * m[3] - m[2] * m[1]); + const normX = Math.hypot(m[0], m[2]); + const normY = Math.hypot(m[1], m[3]); + this._cachedGetSinglePixelWidth = Math.max(normX, normY) / absDet; + } + } + return this._cachedGetSinglePixelWidth; + } + getScaleForStroking() { + if (this._cachedScaleForStroking[0] === -1) { + const { + lineWidth + } = this.current; + const { + a, + b, + c, + d + } = this.ctx.getTransform(); + let scaleX, scaleY; + if (b === 0 && c === 0) { + const normX = Math.abs(a); + const normY = Math.abs(d); + if (normX === normY) { + if (lineWidth === 0) { + scaleX = scaleY = 1 / normX; + } else { + const scaledLineWidth = normX * lineWidth; + scaleX = scaleY = scaledLineWidth < 1 ? 1 / scaledLineWidth : 1; + } + } else if (lineWidth === 0) { + scaleX = 1 / normX; + scaleY = 1 / normY; + } else { + const scaledXLineWidth = normX * lineWidth; + const scaledYLineWidth = normY * lineWidth; + scaleX = scaledXLineWidth < 1 ? 1 / scaledXLineWidth : 1; + scaleY = scaledYLineWidth < 1 ? 1 / scaledYLineWidth : 1; + } + } else { + const absDet = Math.abs(a * d - b * c); + const normX = Math.hypot(a, b); + const normY = Math.hypot(c, d); + if (lineWidth === 0) { + scaleX = normY / absDet; + scaleY = normX / absDet; + } else { + const baseArea = lineWidth * absDet; + scaleX = normY > baseArea ? normY / baseArea : 1; + scaleY = normX > baseArea ? normX / baseArea : 1; + } + } + this._cachedScaleForStroking[0] = scaleX; + this._cachedScaleForStroking[1] = scaleY; + } + return this._cachedScaleForStroking; + } + rescaleAndStroke(saveRestore) { + const { + ctx + } = this; + const { + lineWidth + } = this.current; + const [scaleX, scaleY] = this.getScaleForStroking(); + ctx.lineWidth = lineWidth || 1; + if (scaleX === 1 && scaleY === 1) { + ctx.stroke(); + return; + } + const dashes = ctx.getLineDash(); + if (saveRestore) { + ctx.save(); + } + ctx.scale(scaleX, scaleY); + if (dashes.length > 0) { + const scale = Math.max(scaleX, scaleY); + ctx.setLineDash(dashes.map(x => x / scale)); + ctx.lineDashOffset /= scale; + } + ctx.stroke(); + if (saveRestore) { + ctx.restore(); + } + } + isContentVisible() { + for (let i = this.markedContentStack.length - 1; i >= 0; i--) { + if (!this.markedContentStack[i].visible) { + return false; + } + } + return true; + } +} +for (const op in util.OPS) { + if (CanvasGraphics.prototype[op] !== undefined) { + CanvasGraphics.prototype[util.OPS[op]] = CanvasGraphics.prototype[op]; + } +} + + +/***/ }), + +/***/ 473: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ DOMCMapReaderFactory: () => (/* binding */ DOMCMapReaderFactory), +/* harmony export */ DOMCanvasFactory: () => (/* binding */ DOMCanvasFactory), +/* harmony export */ DOMFilterFactory: () => (/* binding */ DOMFilterFactory), +/* harmony export */ DOMSVGFactory: () => (/* binding */ DOMSVGFactory), +/* harmony export */ DOMStandardFontDataFactory: () => (/* binding */ DOMStandardFontDataFactory), +/* harmony export */ PDFDateString: () => (/* binding */ PDFDateString), +/* harmony export */ PageViewport: () => (/* binding */ PageViewport), +/* harmony export */ PixelsPerInch: () => (/* binding */ PixelsPerInch), +/* harmony export */ RenderingCancelledException: () => (/* binding */ RenderingCancelledException), +/* harmony export */ StatTimer: () => (/* binding */ StatTimer), +/* harmony export */ fetchData: () => (/* binding */ fetchData), +/* harmony export */ getColorValues: () => (/* binding */ getColorValues), +/* harmony export */ getCurrentTransform: () => (/* binding */ getCurrentTransform), +/* harmony export */ getCurrentTransformInverse: () => (/* binding */ getCurrentTransformInverse), +/* harmony export */ getFilenameFromUrl: () => (/* binding */ getFilenameFromUrl), +/* harmony export */ getPdfFilenameFromUrl: () => (/* binding */ getPdfFilenameFromUrl), +/* harmony export */ getRGB: () => (/* binding */ getRGB), +/* harmony export */ getXfaPageViewport: () => (/* binding */ getXfaPageViewport), +/* harmony export */ isDataScheme: () => (/* binding */ isDataScheme), +/* harmony export */ isPdfFile: () => (/* binding */ isPdfFile), +/* harmony export */ isValidFetchUrl: () => (/* binding */ isValidFetchUrl), +/* harmony export */ noContextMenu: () => (/* binding */ noContextMenu), +/* harmony export */ setLayerDimensions: () => (/* binding */ setLayerDimensions) +/* harmony export */ }); +/* unused harmony export deprecated */ +/* harmony import */ var _base_factory_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(822); +/* harmony import */ var _shared_util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(266); + + +const SVG_NS = "http://www.w3.org/2000/svg"; +class PixelsPerInch { + static CSS = 96.0; + static PDF = 72.0; + static PDF_TO_CSS_UNITS = this.CSS / this.PDF; +} +class DOMFilterFactory extends _base_factory_js__WEBPACK_IMPORTED_MODULE_0__.BaseFilterFactory { + #_cache; + #_defs; + #docId; + #document; + #hcmFilter; + #hcmKey; + #hcmUrl; + #hcmHighlightFilter; + #hcmHighlightKey; + #hcmHighlightUrl; + #id = 0; + constructor({ + docId, + ownerDocument = globalThis.document + } = {}) { + super(); + this.#docId = docId; + this.#document = ownerDocument; + } + get #cache() { + return this.#_cache ||= new Map(); + } + get #defs() { + if (!this.#_defs) { + const div = this.#document.createElement("div"); + const { + style + } = div; + style.visibility = "hidden"; + style.contain = "strict"; + style.width = style.height = 0; + style.position = "absolute"; + style.top = style.left = 0; + style.zIndex = -1; + const svg = this.#document.createElementNS(SVG_NS, "svg"); + svg.setAttribute("width", 0); + svg.setAttribute("height", 0); + this.#_defs = this.#document.createElementNS(SVG_NS, "defs"); + div.append(svg); + svg.append(this.#_defs); + this.#document.body.append(div); + } + return this.#_defs; + } + addFilter(maps) { + if (!maps) { + return "none"; + } + let value = this.#cache.get(maps); + if (value) { + return value; + } + let tableR, tableG, tableB, key; + if (maps.length === 1) { + const mapR = maps[0]; + const buffer = new Array(256); + for (let i = 0; i < 256; i++) { + buffer[i] = mapR[i] / 255; + } + key = tableR = tableG = tableB = buffer.join(","); + } else { + const [mapR, mapG, mapB] = maps; + const bufferR = new Array(256); + const bufferG = new Array(256); + const bufferB = new Array(256); + for (let i = 0; i < 256; i++) { + bufferR[i] = mapR[i] / 255; + bufferG[i] = mapG[i] / 255; + bufferB[i] = mapB[i] / 255; + } + tableR = bufferR.join(","); + tableG = bufferG.join(","); + tableB = bufferB.join(","); + key = `${tableR}${tableG}${tableB}`; + } + value = this.#cache.get(key); + if (value) { + this.#cache.set(maps, value); + return value; + } + const id = `g_${this.#docId}_transfer_map_${this.#id++}`; + const url = `url(#${id})`; + this.#cache.set(maps, url); + this.#cache.set(key, url); + const filter = this.#createFilter(id); + this.#addTransferMapConversion(tableR, tableG, tableB, filter); + return url; + } + addHCMFilter(fgColor, bgColor) { + const key = `${fgColor}-${bgColor}`; + if (this.#hcmKey === key) { + return this.#hcmUrl; + } + this.#hcmKey = key; + this.#hcmUrl = "none"; + this.#hcmFilter?.remove(); + if (!fgColor || !bgColor) { + return this.#hcmUrl; + } + const fgRGB = this.#getRGB(fgColor); + fgColor = _shared_util_js__WEBPACK_IMPORTED_MODULE_1__.Util.makeHexColor(...fgRGB); + const bgRGB = this.#getRGB(bgColor); + bgColor = _shared_util_js__WEBPACK_IMPORTED_MODULE_1__.Util.makeHexColor(...bgRGB); + this.#defs.style.color = ""; + if (fgColor === "#000000" && bgColor === "#ffffff" || fgColor === bgColor) { + return this.#hcmUrl; + } + const map = new Array(256); + for (let i = 0; i <= 255; i++) { + const x = i / 255; + map[i] = x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4; + } + const table = map.join(","); + const id = `g_${this.#docId}_hcm_filter`; + const filter = this.#hcmHighlightFilter = this.#createFilter(id); + this.#addTransferMapConversion(table, table, table, filter); + this.#addGrayConversion(filter); + const getSteps = (c, n) => { + const start = fgRGB[c] / 255; + const end = bgRGB[c] / 255; + const arr = new Array(n + 1); + for (let i = 0; i <= n; i++) { + arr[i] = start + i / n * (end - start); + } + return arr.join(","); + }; + this.#addTransferMapConversion(getSteps(0, 5), getSteps(1, 5), getSteps(2, 5), filter); + this.#hcmUrl = `url(#${id})`; + return this.#hcmUrl; + } + addHighlightHCMFilter(fgColor, bgColor, newFgColor, newBgColor) { + const key = `${fgColor}-${bgColor}-${newFgColor}-${newBgColor}`; + if (this.#hcmHighlightKey === key) { + return this.#hcmHighlightUrl; + } + this.#hcmHighlightKey = key; + this.#hcmHighlightUrl = "none"; + this.#hcmHighlightFilter?.remove(); + if (!fgColor || !bgColor) { + return this.#hcmHighlightUrl; + } + const [fgRGB, bgRGB] = [fgColor, bgColor].map(this.#getRGB.bind(this)); + let fgGray = Math.round(0.2126 * fgRGB[0] + 0.7152 * fgRGB[1] + 0.0722 * fgRGB[2]); + let bgGray = Math.round(0.2126 * bgRGB[0] + 0.7152 * bgRGB[1] + 0.0722 * bgRGB[2]); + let [newFgRGB, newBgRGB] = [newFgColor, newBgColor].map(this.#getRGB.bind(this)); + if (bgGray < fgGray) { + [fgGray, bgGray, newFgRGB, newBgRGB] = [bgGray, fgGray, newBgRGB, newFgRGB]; + } + this.#defs.style.color = ""; + const getSteps = (fg, bg, n) => { + const arr = new Array(256); + const step = (bgGray - fgGray) / n; + const newStart = fg / 255; + const newStep = (bg - fg) / (255 * n); + let prev = 0; + for (let i = 0; i <= n; i++) { + const k = Math.round(fgGray + i * step); + const value = newStart + i * newStep; + for (let j = prev; j <= k; j++) { + arr[j] = value; + } + prev = k + 1; + } + for (let i = prev; i < 256; i++) { + arr[i] = arr[prev - 1]; + } + return arr.join(","); + }; + const id = `g_${this.#docId}_hcm_highlight_filter`; + const filter = this.#hcmHighlightFilter = this.#createFilter(id); + this.#addGrayConversion(filter); + this.#addTransferMapConversion(getSteps(newFgRGB[0], newBgRGB[0], 5), getSteps(newFgRGB[1], newBgRGB[1], 5), getSteps(newFgRGB[2], newBgRGB[2], 5), filter); + this.#hcmHighlightUrl = `url(#${id})`; + return this.#hcmHighlightUrl; + } + destroy(keepHCM = false) { + if (keepHCM && (this.#hcmUrl || this.#hcmHighlightUrl)) { + return; + } + if (this.#_defs) { + this.#_defs.parentNode.parentNode.remove(); + this.#_defs = null; + } + if (this.#_cache) { + this.#_cache.clear(); + this.#_cache = null; + } + this.#id = 0; + } + #addGrayConversion(filter) { + const feColorMatrix = this.#document.createElementNS(SVG_NS, "feColorMatrix"); + feColorMatrix.setAttribute("type", "matrix"); + feColorMatrix.setAttribute("values", "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"); + filter.append(feColorMatrix); + } + #createFilter(id) { + const filter = this.#document.createElementNS(SVG_NS, "filter"); + filter.setAttribute("color-interpolation-filters", "sRGB"); + filter.setAttribute("id", id); + this.#defs.append(filter); + return filter; + } + #appendFeFunc(feComponentTransfer, func, table) { + const feFunc = this.#document.createElementNS(SVG_NS, func); + feFunc.setAttribute("type", "discrete"); + feFunc.setAttribute("tableValues", table); + feComponentTransfer.append(feFunc); + } + #addTransferMapConversion(rTable, gTable, bTable, filter) { + const feComponentTransfer = this.#document.createElementNS(SVG_NS, "feComponentTransfer"); + filter.append(feComponentTransfer); + this.#appendFeFunc(feComponentTransfer, "feFuncR", rTable); + this.#appendFeFunc(feComponentTransfer, "feFuncG", gTable); + this.#appendFeFunc(feComponentTransfer, "feFuncB", bTable); + } + #getRGB(color) { + this.#defs.style.color = color; + return getRGB(getComputedStyle(this.#defs).getPropertyValue("color")); + } +} +class DOMCanvasFactory extends _base_factory_js__WEBPACK_IMPORTED_MODULE_0__.BaseCanvasFactory { + constructor({ + ownerDocument = globalThis.document + } = {}) { + super(); + this._document = ownerDocument; + } + _createCanvas(width, height) { + const canvas = this._document.createElement("canvas"); + canvas.width = width; + canvas.height = height; + return canvas; + } +} +async function fetchData(url, type = "text") { + if (isValidFetchUrl(url, document.baseURI)) { + const response = await fetch(url); + if (!response.ok) { + throw new Error(response.statusText); + } + switch (type) { + case "arraybuffer": + return response.arrayBuffer(); + case "blob": + return response.blob(); + case "json": + return response.json(); + } + return response.text(); + } + return new Promise((resolve, reject) => { + const request = new XMLHttpRequest(); + request.open("GET", url, true); + request.responseType = type; + request.onreadystatechange = () => { + if (request.readyState !== XMLHttpRequest.DONE) { + return; + } + if (request.status === 200 || request.status === 0) { + let data; + switch (type) { + case "arraybuffer": + case "blob": + case "json": + data = request.response; + break; + default: + data = request.responseText; + break; + } + if (data) { + resolve(data); + return; + } + } + reject(new Error(request.statusText)); + }; + request.send(null); + }); +} +class DOMCMapReaderFactory extends _base_factory_js__WEBPACK_IMPORTED_MODULE_0__.BaseCMapReaderFactory { + _fetchData(url, compressionType) { + return fetchData(url, this.isCompressed ? "arraybuffer" : "text").then(data => { + return { + cMapData: data instanceof ArrayBuffer ? new Uint8Array(data) : (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_1__.stringToBytes)(data), + compressionType + }; + }); + } +} +class DOMStandardFontDataFactory extends _base_factory_js__WEBPACK_IMPORTED_MODULE_0__.BaseStandardFontDataFactory { + _fetchData(url) { + return fetchData(url, "arraybuffer").then(data => { + return new Uint8Array(data); + }); + } +} +class DOMSVGFactory extends _base_factory_js__WEBPACK_IMPORTED_MODULE_0__.BaseSVGFactory { + _createSVG(type) { + return document.createElementNS(SVG_NS, type); + } +} +class PageViewport { + constructor({ + viewBox, + scale, + rotation, + offsetX = 0, + offsetY = 0, + dontFlip = false + }) { + this.viewBox = viewBox; + this.scale = scale; + this.rotation = rotation; + this.offsetX = offsetX; + this.offsetY = offsetY; + const centerX = (viewBox[2] + viewBox[0]) / 2; + const centerY = (viewBox[3] + viewBox[1]) / 2; + let rotateA, rotateB, rotateC, rotateD; + rotation %= 360; + if (rotation < 0) { + rotation += 360; + } + switch (rotation) { + case 180: + rotateA = -1; + rotateB = 0; + rotateC = 0; + rotateD = 1; + break; + case 90: + rotateA = 0; + rotateB = 1; + rotateC = 1; + rotateD = 0; + break; + case 270: + rotateA = 0; + rotateB = -1; + rotateC = -1; + rotateD = 0; + break; + case 0: + rotateA = 1; + rotateB = 0; + rotateC = 0; + rotateD = -1; + break; + default: + throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees."); + } + if (dontFlip) { + rotateC = -rotateC; + rotateD = -rotateD; + } + let offsetCanvasX, offsetCanvasY; + let width, height; + if (rotateA === 0) { + offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX; + offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY; + width = (viewBox[3] - viewBox[1]) * scale; + height = (viewBox[2] - viewBox[0]) * scale; + } else { + offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX; + offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY; + width = (viewBox[2] - viewBox[0]) * scale; + height = (viewBox[3] - viewBox[1]) * scale; + } + this.transform = [rotateA * scale, rotateB * scale, rotateC * scale, rotateD * scale, offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY, offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY]; + this.width = width; + this.height = height; + } + get rawDims() { + const { + viewBox + } = this; + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_1__.shadow)(this, "rawDims", { + pageWidth: viewBox[2] - viewBox[0], + pageHeight: viewBox[3] - viewBox[1], + pageX: viewBox[0], + pageY: viewBox[1] + }); + } + clone({ + scale = this.scale, + rotation = this.rotation, + offsetX = this.offsetX, + offsetY = this.offsetY, + dontFlip = false + } = {}) { + return new PageViewport({ + viewBox: this.viewBox.slice(), + scale, + rotation, + offsetX, + offsetY, + dontFlip + }); + } + convertToViewportPoint(x, y) { + return _shared_util_js__WEBPACK_IMPORTED_MODULE_1__.Util.applyTransform([x, y], this.transform); + } + convertToViewportRectangle(rect) { + const topLeft = _shared_util_js__WEBPACK_IMPORTED_MODULE_1__.Util.applyTransform([rect[0], rect[1]], this.transform); + const bottomRight = _shared_util_js__WEBPACK_IMPORTED_MODULE_1__.Util.applyTransform([rect[2], rect[3]], this.transform); + return [topLeft[0], topLeft[1], bottomRight[0], bottomRight[1]]; + } + convertToPdfPoint(x, y) { + return _shared_util_js__WEBPACK_IMPORTED_MODULE_1__.Util.applyInverseTransform([x, y], this.transform); + } +} +class RenderingCancelledException extends _shared_util_js__WEBPACK_IMPORTED_MODULE_1__.BaseException { + constructor(msg, extraDelay = 0) { + super(msg, "RenderingCancelledException"); + this.extraDelay = extraDelay; + } +} +function isDataScheme(url) { + const ii = url.length; + let i = 0; + while (i < ii && url[i].trim() === "") { + i++; + } + return url.substring(i, i + 5).toLowerCase() === "data:"; +} +function isPdfFile(filename) { + return typeof filename === "string" && /\.pdf$/i.test(filename); +} +function getFilenameFromUrl(url, onlyStripPath = false) { + if (!onlyStripPath) { + [url] = url.split(/[#?]/, 1); + } + return url.substring(url.lastIndexOf("/") + 1); +} +function getPdfFilenameFromUrl(url, defaultFilename = "document.pdf") { + if (typeof url !== "string") { + return defaultFilename; + } + if (isDataScheme(url)) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_1__.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'); + return defaultFilename; + } + const reURI = /^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/; + const reFilename = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i; + const splitURI = reURI.exec(url); + let suggestedFilename = reFilename.exec(splitURI[1]) || reFilename.exec(splitURI[2]) || reFilename.exec(splitURI[3]); + if (suggestedFilename) { + suggestedFilename = suggestedFilename[0]; + if (suggestedFilename.includes("%")) { + try { + suggestedFilename = reFilename.exec(decodeURIComponent(suggestedFilename))[0]; + } catch {} + } + } + return suggestedFilename || defaultFilename; +} +class StatTimer { + started = Object.create(null); + times = []; + time(name) { + if (name in this.started) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_1__.warn)(`Timer is already running for ${name}`); + } + this.started[name] = Date.now(); + } + timeEnd(name) { + if (!(name in this.started)) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_1__.warn)(`Timer has not been started for ${name}`); + } + this.times.push({ + name, + start: this.started[name], + end: Date.now() + }); + delete this.started[name]; + } + toString() { + const outBuf = []; + let longest = 0; + for (const { + name + } of this.times) { + longest = Math.max(name.length, longest); + } + for (const { + name, + start, + end + } of this.times) { + outBuf.push(`${name.padEnd(longest)} ${end - start}ms\n`); + } + return outBuf.join(""); + } +} +function isValidFetchUrl(url, baseUrl) { + try { + const { + protocol + } = baseUrl ? new URL(url, baseUrl) : new URL(url); + return protocol === "http:" || protocol === "https:"; + } catch { + return false; + } +} +function noContextMenu(e) { + e.preventDefault(); +} +function deprecated(details) { + console.log("Deprecated API usage: " + details); +} +let pdfDateStringRegex; +class PDFDateString { + static toDateObject(input) { + if (!input || typeof input !== "string") { + return null; + } + pdfDateStringRegex ||= new RegExp("^D:" + "(\\d{4})" + "(\\d{2})?" + "(\\d{2})?" + "(\\d{2})?" + "(\\d{2})?" + "(\\d{2})?" + "([Z|+|-])?" + "(\\d{2})?" + "'?" + "(\\d{2})?" + "'?"); + const matches = pdfDateStringRegex.exec(input); + if (!matches) { + return null; + } + const year = parseInt(matches[1], 10); + let month = parseInt(matches[2], 10); + month = month >= 1 && month <= 12 ? month - 1 : 0; + let day = parseInt(matches[3], 10); + day = day >= 1 && day <= 31 ? day : 1; + let hour = parseInt(matches[4], 10); + hour = hour >= 0 && hour <= 23 ? hour : 0; + let minute = parseInt(matches[5], 10); + minute = minute >= 0 && minute <= 59 ? minute : 0; + let second = parseInt(matches[6], 10); + second = second >= 0 && second <= 59 ? second : 0; + const universalTimeRelation = matches[7] || "Z"; + let offsetHour = parseInt(matches[8], 10); + offsetHour = offsetHour >= 0 && offsetHour <= 23 ? offsetHour : 0; + let offsetMinute = parseInt(matches[9], 10) || 0; + offsetMinute = offsetMinute >= 0 && offsetMinute <= 59 ? offsetMinute : 0; + if (universalTimeRelation === "-") { + hour += offsetHour; + minute += offsetMinute; + } else if (universalTimeRelation === "+") { + hour -= offsetHour; + minute -= offsetMinute; + } + return new Date(Date.UTC(year, month, day, hour, minute, second)); + } +} +function getXfaPageViewport(xfaPage, { + scale = 1, + rotation = 0 +}) { + const { + width, + height + } = xfaPage.attributes.style; + const viewBox = [0, 0, parseInt(width), parseInt(height)]; + return new PageViewport({ + viewBox, + scale, + rotation + }); +} +function getRGB(color) { + if (color.startsWith("#")) { + const colorRGB = parseInt(color.slice(1), 16); + return [(colorRGB & 0xff0000) >> 16, (colorRGB & 0x00ff00) >> 8, colorRGB & 0x0000ff]; + } + if (color.startsWith("rgb(")) { + return color.slice(4, -1).split(",").map(x => parseInt(x)); + } + if (color.startsWith("rgba(")) { + return color.slice(5, -1).split(",").map(x => parseInt(x)).slice(0, 3); + } + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_1__.warn)(`Not a valid color format: "${color}"`); + return [0, 0, 0]; +} +function getColorValues(colors) { + const span = document.createElement("span"); + span.style.visibility = "hidden"; + document.body.append(span); + for (const name of colors.keys()) { + span.style.color = name; + const computedColor = window.getComputedStyle(span).color; + colors.set(name, getRGB(computedColor)); + } + span.remove(); +} +function getCurrentTransform(ctx) { + const { + a, + b, + c, + d, + e, + f + } = ctx.getTransform(); + return [a, b, c, d, e, f]; +} +function getCurrentTransformInverse(ctx) { + const { + a, + b, + c, + d, + e, + f + } = ctx.getTransform().invertSelf(); + return [a, b, c, d, e, f]; +} +function setLayerDimensions(div, viewport, mustFlip = false, mustRotate = true) { + if (viewport instanceof PageViewport) { + const { + pageWidth, + pageHeight + } = viewport.rawDims; + const { + style + } = div; + const useRound = _shared_util_js__WEBPACK_IMPORTED_MODULE_1__.FeatureTest.isCSSRoundSupported; + const w = `var(--scale-factor) * ${pageWidth}px`, + h = `var(--scale-factor) * ${pageHeight}px`; + const widthStr = useRound ? `round(${w}, 1px)` : `calc(${w})`, + heightStr = useRound ? `round(${h}, 1px)` : `calc(${h})`; + if (!mustFlip || viewport.rotation % 180 === 0) { + style.width = widthStr; + style.height = heightStr; + } else { + style.width = heightStr; + style.height = widthStr; + } + } + if (mustRotate) { + div.setAttribute("data-main-rotation", viewport.rotation); + } +} + + +/***/ }), + +/***/ 423: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ DrawLayer: () => (/* binding */ DrawLayer) +/* harmony export */ }); +/* harmony import */ var _display_utils_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(473); +/* harmony import */ var _shared_util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(266); + + +class DrawLayer { + #parent = null; + #id = 0; + #mapping = new Map(); + constructor({ + pageIndex + }) { + this.pageIndex = pageIndex; + } + setParent(parent) { + if (!this.#parent) { + this.#parent = parent; + return; + } + if (this.#parent !== parent) { + if (this.#mapping.size > 0) { + for (const root of this.#mapping.values()) { + root.remove(); + parent.append(root); + } + } + this.#parent = parent; + } + } + static get _svgFactory() { + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_1__.shadow)(this, "_svgFactory", new _display_utils_js__WEBPACK_IMPORTED_MODULE_0__.DOMSVGFactory()); + } + static #setBox(element, { + x, + y, + width, + height + }) { + const { + style + } = element; + style.top = `${100 * y}%`; + style.left = `${100 * x}%`; + style.width = `${100 * width}%`; + style.height = `${100 * height}%`; + } + #createSVG(box) { + const svg = DrawLayer._svgFactory.create(1, 1, true); + this.#parent.append(svg); + DrawLayer.#setBox(svg, box); + return svg; + } + highlight({ + outlines, + box + }, color, opacity) { + const id = this.#id++; + const root = this.#createSVG(box); + root.classList.add("highlight"); + const defs = DrawLayer._svgFactory.createElement("defs"); + root.append(defs); + const path = DrawLayer._svgFactory.createElement("path"); + defs.append(path); + const pathId = `path_p${this.pageIndex}_${id}`; + path.setAttribute("id", pathId); + path.setAttribute("d", DrawLayer.#extractPathFromHighlightOutlines(outlines)); + const clipPath = DrawLayer._svgFactory.createElement("clipPath"); + defs.append(clipPath); + const clipPathId = `clip_${pathId}`; + clipPath.setAttribute("id", clipPathId); + clipPath.setAttribute("clipPathUnits", "objectBoundingBox"); + const clipPathUse = DrawLayer._svgFactory.createElement("use"); + clipPath.append(clipPathUse); + clipPathUse.setAttribute("href", `#${pathId}`); + clipPathUse.classList.add("clip"); + const use = DrawLayer._svgFactory.createElement("use"); + root.append(use); + root.setAttribute("fill", color); + root.setAttribute("fill-opacity", opacity); + use.setAttribute("href", `#${pathId}`); + this.#mapping.set(id, root); + return { + id, + clipPathId: `url(#${clipPathId})` + }; + } + highlightOutline({ + outlines, + box + }) { + const id = this.#id++; + const root = this.#createSVG(box); + root.classList.add("highlightOutline"); + const defs = DrawLayer._svgFactory.createElement("defs"); + root.append(defs); + const path = DrawLayer._svgFactory.createElement("path"); + defs.append(path); + const pathId = `path_p${this.pageIndex}_${id}`; + path.setAttribute("id", pathId); + path.setAttribute("d", DrawLayer.#extractPathFromHighlightOutlines(outlines)); + path.setAttribute("vector-effect", "non-scaling-stroke"); + const use1 = DrawLayer._svgFactory.createElement("use"); + root.append(use1); + use1.setAttribute("href", `#${pathId}`); + const use2 = use1.cloneNode(); + root.append(use2); + use1.classList.add("mainOutline"); + use2.classList.add("secondaryOutline"); + this.#mapping.set(id, root); + return id; + } + static #extractPathFromHighlightOutlines(polygons) { + const buffer = []; + for (const polygon of polygons) { + let [prevX, prevY] = polygon; + buffer.push(`M${prevX} ${prevY}`); + for (let i = 2; i < polygon.length; i += 2) { + const x = polygon[i]; + const y = polygon[i + 1]; + if (x === prevX) { + buffer.push(`V${y}`); + prevY = y; + } else if (y === prevY) { + buffer.push(`H${x}`); + prevX = x; + } + } + buffer.push("Z"); + } + return buffer.join(" "); + } + updateBox(id, box) { + DrawLayer.#setBox(this.#mapping.get(id), box); + } + rotate(id, angle) { + this.#mapping.get(id).setAttribute("data-main-rotation", angle); + } + changeColor(id, color) { + this.#mapping.get(id).setAttribute("fill", color); + } + changeOpacity(id, opacity) { + this.#mapping.get(id).setAttribute("fill-opacity", opacity); + } + addClass(id, className) { + this.#mapping.get(id).classList.add(className); + } + removeClass(id, className) { + this.#mapping.get(id).classList.remove(className); + } + remove(id) { + if (this.#parent === null) { + return; + } + this.#mapping.get(id).remove(); + this.#mapping.delete(id); + } + destroy() { + this.#parent = null; + for (const root of this.#mapping.values()) { + root.remove(); + } + this.#mapping.clear(); + } +} + + +/***/ }), + +/***/ 629: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + AnnotationEditorLayer: () => (/* binding */ AnnotationEditorLayer) +}); + +// EXTERNAL MODULE: ./src/shared/util.js +var util = __webpack_require__(266); +// EXTERNAL MODULE: ./src/display/editor/editor.js + 2 modules +var editor_editor = __webpack_require__(115); +// EXTERNAL MODULE: ./src/display/editor/tools.js +var tools = __webpack_require__(812); +// EXTERNAL MODULE: ./src/display/annotation_layer.js + 1 modules +var annotation_layer = __webpack_require__(640); +;// CONCATENATED MODULE: ./src/display/editor/freetext.js + + + + +class FreeTextEditor extends editor_editor.AnnotationEditor { + #boundEditorDivBlur = this.editorDivBlur.bind(this); + #boundEditorDivFocus = this.editorDivFocus.bind(this); + #boundEditorDivInput = this.editorDivInput.bind(this); + #boundEditorDivKeydown = this.editorDivKeydown.bind(this); + #color; + #content = ""; + #editorDivId = `${this.id}-editor`; + #fontSize; + #initialData = null; + static _freeTextDefaultContent = ""; + static _internalPadding = 0; + static _defaultColor = null; + static _defaultFontSize = 10; + static get _keyboardManager() { + const proto = FreeTextEditor.prototype; + const arrowChecker = self => self.isEmpty(); + const small = tools.AnnotationEditorUIManager.TRANSLATE_SMALL; + const big = tools.AnnotationEditorUIManager.TRANSLATE_BIG; + return (0,util.shadow)(this, "_keyboardManager", new tools.KeyboardManager([[["ctrl+s", "mac+meta+s", "ctrl+p", "mac+meta+p"], proto.commitOrRemove, { + bubbles: true + }], [["ctrl+Enter", "mac+meta+Enter", "Escape", "mac+Escape"], proto.commitOrRemove], [["ArrowLeft", "mac+ArrowLeft"], proto._translateEmpty, { + args: [-small, 0], + checker: arrowChecker + }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], proto._translateEmpty, { + args: [-big, 0], + checker: arrowChecker + }], [["ArrowRight", "mac+ArrowRight"], proto._translateEmpty, { + args: [small, 0], + checker: arrowChecker + }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], proto._translateEmpty, { + args: [big, 0], + checker: arrowChecker + }], [["ArrowUp", "mac+ArrowUp"], proto._translateEmpty, { + args: [0, -small], + checker: arrowChecker + }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], proto._translateEmpty, { + args: [0, -big], + checker: arrowChecker + }], [["ArrowDown", "mac+ArrowDown"], proto._translateEmpty, { + args: [0, small], + checker: arrowChecker + }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], proto._translateEmpty, { + args: [0, big], + checker: arrowChecker + }]])); + } + static _type = "freetext"; + static _editorType = util.AnnotationEditorType.FREETEXT; + constructor(params) { + super({ + ...params, + name: "freeTextEditor" + }); + this.#color = params.color || FreeTextEditor._defaultColor || editor_editor.AnnotationEditor._defaultLineColor; + this.#fontSize = params.fontSize || FreeTextEditor._defaultFontSize; + } + static initialize(l10n) { + editor_editor.AnnotationEditor.initialize(l10n, { + strings: ["pdfjs-free-text-default-content"] + }); + const style = getComputedStyle(document.documentElement); + this._internalPadding = parseFloat(style.getPropertyValue("--freetext-padding")); + } + static updateDefaultParams(type, value) { + switch (type) { + case util.AnnotationEditorParamsType.FREETEXT_SIZE: + FreeTextEditor._defaultFontSize = value; + break; + case util.AnnotationEditorParamsType.FREETEXT_COLOR: + FreeTextEditor._defaultColor = value; + break; + } + } + updateParams(type, value) { + switch (type) { + case util.AnnotationEditorParamsType.FREETEXT_SIZE: + this.#updateFontSize(value); + break; + case util.AnnotationEditorParamsType.FREETEXT_COLOR: + this.#updateColor(value); + break; + } + } + static get defaultPropertiesToUpdate() { + return [[util.AnnotationEditorParamsType.FREETEXT_SIZE, FreeTextEditor._defaultFontSize], [util.AnnotationEditorParamsType.FREETEXT_COLOR, FreeTextEditor._defaultColor || editor_editor.AnnotationEditor._defaultLineColor]]; + } + get propertiesToUpdate() { + return [[util.AnnotationEditorParamsType.FREETEXT_SIZE, this.#fontSize], [util.AnnotationEditorParamsType.FREETEXT_COLOR, this.#color]]; + } + #updateFontSize(fontSize) { + const setFontsize = size => { + this.editorDiv.style.fontSize = `calc(${size}px * var(--scale-factor))`; + this.translate(0, -(size - this.#fontSize) * this.parentScale); + this.#fontSize = size; + this.#setEditorDimensions(); + }; + const savedFontsize = this.#fontSize; + this.addCommands({ + cmd: () => { + setFontsize(fontSize); + }, + undo: () => { + setFontsize(savedFontsize); + }, + mustExec: true, + type: util.AnnotationEditorParamsType.FREETEXT_SIZE, + overwriteIfSameType: true, + keepUndo: true + }); + } + #updateColor(color) { + const savedColor = this.#color; + this.addCommands({ + cmd: () => { + this.#color = this.editorDiv.style.color = color; + }, + undo: () => { + this.#color = this.editorDiv.style.color = savedColor; + }, + mustExec: true, + type: util.AnnotationEditorParamsType.FREETEXT_COLOR, + overwriteIfSameType: true, + keepUndo: true + }); + } + _translateEmpty(x, y) { + this._uiManager.translateSelectedEditors(x, y, true); + } + getInitialTranslation() { + const scale = this.parentScale; + return [-FreeTextEditor._internalPadding * scale, -(FreeTextEditor._internalPadding + this.#fontSize) * scale]; + } + rebuild() { + if (!this.parent) { + return; + } + super.rebuild(); + if (this.div === null) { + return; + } + if (!this.isAttachedToDOM) { + this.parent.add(this); + } + } + enableEditMode() { + if (this.isInEditMode()) { + return; + } + this.parent.setEditingState(false); + this.parent.updateToolbar(util.AnnotationEditorType.FREETEXT); + super.enableEditMode(); + this.overlayDiv.classList.remove("enabled"); + this.editorDiv.contentEditable = true; + this._isDraggable = false; + this.div.removeAttribute("aria-activedescendant"); + this.editorDiv.addEventListener("keydown", this.#boundEditorDivKeydown); + this.editorDiv.addEventListener("focus", this.#boundEditorDivFocus); + this.editorDiv.addEventListener("blur", this.#boundEditorDivBlur); + this.editorDiv.addEventListener("input", this.#boundEditorDivInput); + } + disableEditMode() { + if (!this.isInEditMode()) { + return; + } + this.parent.setEditingState(true); + super.disableEditMode(); + this.overlayDiv.classList.add("enabled"); + this.editorDiv.contentEditable = false; + this.div.setAttribute("aria-activedescendant", this.#editorDivId); + this._isDraggable = true; + this.editorDiv.removeEventListener("keydown", this.#boundEditorDivKeydown); + this.editorDiv.removeEventListener("focus", this.#boundEditorDivFocus); + this.editorDiv.removeEventListener("blur", this.#boundEditorDivBlur); + this.editorDiv.removeEventListener("input", this.#boundEditorDivInput); + this.div.focus({ + preventScroll: true + }); + this.isEditing = false; + this.parent.div.classList.add("freetextEditing"); + } + focusin(event) { + if (!this._focusEventsAllowed) { + return; + } + super.focusin(event); + if (event.target !== this.editorDiv) { + this.editorDiv.focus(); + } + } + onceAdded() { + if (this.width) { + this.#cheatInitialRect(); + return; + } + this.enableEditMode(); + this.editorDiv.focus(); + if (this._initialOptions?.isCentered) { + this.center(); + } + this._initialOptions = null; + } + isEmpty() { + return !this.editorDiv || this.editorDiv.innerText.trim() === ""; + } + remove() { + this.isEditing = false; + if (this.parent) { + this.parent.setEditingState(true); + this.parent.div.classList.add("freetextEditing"); + } + super.remove(); + } + #extractText() { + const divs = this.editorDiv.getElementsByTagName("div"); + if (divs.length === 0) { + return this.editorDiv.innerText; + } + const buffer = []; + for (const div of divs) { + buffer.push(div.innerText.replace(/\r\n?|\n/, "")); + } + return buffer.join("\n"); + } + #setEditorDimensions() { + const [parentWidth, parentHeight] = this.parentDimensions; + let rect; + if (this.isAttachedToDOM) { + rect = this.div.getBoundingClientRect(); + } else { + const { + currentLayer, + div + } = this; + const savedDisplay = div.style.display; + div.style.display = "hidden"; + currentLayer.div.append(this.div); + rect = div.getBoundingClientRect(); + div.remove(); + div.style.display = savedDisplay; + } + if (this.rotation % 180 === this.parentRotation % 180) { + this.width = rect.width / parentWidth; + this.height = rect.height / parentHeight; + } else { + this.width = rect.height / parentWidth; + this.height = rect.width / parentHeight; + } + this.fixAndSetPosition(); + } + commit() { + if (!this.isInEditMode()) { + return; + } + super.commit(); + this.disableEditMode(); + const savedText = this.#content; + const newText = this.#content = this.#extractText().trimEnd(); + if (savedText === newText) { + return; + } + const setText = text => { + this.#content = text; + if (!text) { + this.remove(); + return; + } + this.#setContent(); + this._uiManager.rebuild(this); + this.#setEditorDimensions(); + }; + this.addCommands({ + cmd: () => { + setText(newText); + }, + undo: () => { + setText(savedText); + }, + mustExec: false + }); + this.#setEditorDimensions(); + } + shouldGetKeyboardEvents() { + return this.isInEditMode(); + } + enterInEditMode() { + this.enableEditMode(); + this.editorDiv.focus(); + } + dblclick(event) { + this.enterInEditMode(); + } + keydown(event) { + if (event.target === this.div && event.key === "Enter") { + this.enterInEditMode(); + event.preventDefault(); + } + } + editorDivKeydown(event) { + FreeTextEditor._keyboardManager.exec(this, event); + } + editorDivFocus(event) { + this.isEditing = true; + } + editorDivBlur(event) { + this.isEditing = false; + } + editorDivInput(event) { + this.parent.div.classList.toggle("freetextEditing", this.isEmpty()); + } + disableEditing() { + this.editorDiv.setAttribute("role", "comment"); + this.editorDiv.removeAttribute("aria-multiline"); + } + enableEditing() { + this.editorDiv.setAttribute("role", "textbox"); + this.editorDiv.setAttribute("aria-multiline", true); + } + render() { + if (this.div) { + return this.div; + } + let baseX, baseY; + if (this.width) { + baseX = this.x; + baseY = this.y; + } + super.render(); + this.editorDiv = document.createElement("div"); + this.editorDiv.className = "internal"; + this.editorDiv.setAttribute("id", this.#editorDivId); + this.editorDiv.setAttribute("data-l10n-id", "pdfjs-free-text"); + this.enableEditing(); + editor_editor.AnnotationEditor._l10nPromise.get("pdfjs-free-text-default-content").then(msg => this.editorDiv?.setAttribute("default-content", msg)); + this.editorDiv.contentEditable = true; + const { + style + } = this.editorDiv; + style.fontSize = `calc(${this.#fontSize}px * var(--scale-factor))`; + style.color = this.#color; + this.div.append(this.editorDiv); + this.overlayDiv = document.createElement("div"); + this.overlayDiv.classList.add("overlay", "enabled"); + this.div.append(this.overlayDiv); + (0,tools.bindEvents)(this, this.div, ["dblclick", "keydown"]); + if (this.width) { + const [parentWidth, parentHeight] = this.parentDimensions; + if (this.annotationElementId) { + const { + position + } = this.#initialData; + let [tx, ty] = this.getInitialTranslation(); + [tx, ty] = this.pageTranslationToScreen(tx, ty); + const [pageWidth, pageHeight] = this.pageDimensions; + const [pageX, pageY] = this.pageTranslation; + let posX, posY; + switch (this.rotation) { + case 0: + posX = baseX + (position[0] - pageX) / pageWidth; + posY = baseY + this.height - (position[1] - pageY) / pageHeight; + break; + case 90: + posX = baseX + (position[0] - pageX) / pageWidth; + posY = baseY - (position[1] - pageY) / pageHeight; + [tx, ty] = [ty, -tx]; + break; + case 180: + posX = baseX - this.width + (position[0] - pageX) / pageWidth; + posY = baseY - (position[1] - pageY) / pageHeight; + [tx, ty] = [-tx, -ty]; + break; + case 270: + posX = baseX + (position[0] - pageX - this.height * pageHeight) / pageWidth; + posY = baseY + (position[1] - pageY - this.width * pageWidth) / pageHeight; + [tx, ty] = [-ty, tx]; + break; + } + this.setAt(posX * parentWidth, posY * parentHeight, tx, ty); + } else { + this.setAt(baseX * parentWidth, baseY * parentHeight, this.width * parentWidth, this.height * parentHeight); + } + this.#setContent(); + this._isDraggable = true; + this.editorDiv.contentEditable = false; + } else { + this._isDraggable = false; + this.editorDiv.contentEditable = true; + } + return this.div; + } + #setContent() { + this.editorDiv.replaceChildren(); + if (!this.#content) { + return; + } + for (const line of this.#content.split("\n")) { + const div = document.createElement("div"); + div.append(line ? document.createTextNode(line) : document.createElement("br")); + this.editorDiv.append(div); + } + } + get contentDiv() { + return this.editorDiv; + } + static deserialize(data, parent, uiManager) { + let initialData = null; + if (data instanceof annotation_layer.FreeTextAnnotationElement) { + const { + data: { + defaultAppearanceData: { + fontSize, + fontColor + }, + rect, + rotation, + id + }, + textContent, + textPosition, + parent: { + page: { + pageNumber + } + } + } = data; + if (!textContent || textContent.length === 0) { + return null; + } + initialData = data = { + annotationType: util.AnnotationEditorType.FREETEXT, + color: Array.from(fontColor), + fontSize, + value: textContent.join("\n"), + position: textPosition, + pageIndex: pageNumber - 1, + rect, + rotation, + id, + deleted: false + }; + } + const editor = super.deserialize(data, parent, uiManager); + editor.#fontSize = data.fontSize; + editor.#color = util.Util.makeHexColor(...data.color); + editor.#content = data.value; + editor.annotationElementId = data.id || null; + editor.#initialData = initialData; + return editor; + } + serialize(isForCopying = false) { + if (this.isEmpty()) { + return null; + } + if (this.deleted) { + return { + pageIndex: this.pageIndex, + id: this.annotationElementId, + deleted: true + }; + } + const padding = FreeTextEditor._internalPadding * this.parentScale; + const rect = this.getRect(padding, padding); + const color = editor_editor.AnnotationEditor._colorManager.convert(this.isAttachedToDOM ? getComputedStyle(this.editorDiv).color : this.#color); + const serialized = { + annotationType: util.AnnotationEditorType.FREETEXT, + color, + fontSize: this.#fontSize, + value: this.#content, + pageIndex: this.pageIndex, + rect, + rotation: this.rotation, + structTreeParentId: this._structTreeParentId + }; + if (isForCopying) { + return serialized; + } + if (this.annotationElementId && !this.#hasElementChanged(serialized)) { + return null; + } + serialized.id = this.annotationElementId; + return serialized; + } + #hasElementChanged(serialized) { + const { + value, + fontSize, + color, + rect, + pageIndex + } = this.#initialData; + return serialized.value !== value || serialized.fontSize !== fontSize || serialized.rect.some((x, i) => Math.abs(x - rect[i]) >= 1) || serialized.color.some((c, i) => c !== color[i]) || serialized.pageIndex !== pageIndex; + } + #cheatInitialRect(delayed = false) { + if (!this.annotationElementId) { + return; + } + this.#setEditorDimensions(); + if (!delayed && (this.width === 0 || this.height === 0)) { + setTimeout(() => this.#cheatInitialRect(true), 0); + return; + } + const padding = FreeTextEditor._internalPadding * this.parentScale; + this.#initialData.rect = this.getRect(padding, padding); + } +} + +// EXTERNAL MODULE: ./src/display/editor/color_picker.js +var color_picker = __webpack_require__(97); +// EXTERNAL MODULE: ./src/display/editor/outliner.js +var editor_outliner = __webpack_require__(405); +;// CONCATENATED MODULE: ./src/display/editor/highlight.js + + + + + +class HighlightEditor extends editor_editor.AnnotationEditor { + #boxes; + #clipPathId = null; + #colorPicker = null; + #focusOutlines = null; + #highlightDiv = null; + #highlightOutlines = null; + #id = null; + #lastPoint = null; + #opacity; + #outlineId = null; + static _defaultColor = null; + static _defaultOpacity = 1; + static _l10nPromise; + static _type = "highlight"; + static _editorType = util.AnnotationEditorType.HIGHLIGHT; + constructor(params) { + super({ + ...params, + name: "highlightEditor" + }); + HighlightEditor._defaultColor ||= this._uiManager.highlightColors?.values().next().value || "#fff066"; + this.color = params.color || HighlightEditor._defaultColor; + this.#opacity = params.opacity || HighlightEditor._defaultOpacity; + this.#boxes = params.boxes || null; + this._isDraggable = false; + this.#createOutlines(); + this.#addToDrawLayer(); + this.rotate(this.rotation); + } + #createOutlines() { + const outliner = new editor_outliner.Outliner(this.#boxes, 0.001); + this.#highlightOutlines = outliner.getOutlines(); + ({ + x: this.x, + y: this.y, + width: this.width, + height: this.height + } = this.#highlightOutlines.box); + const outlinerForOutline = new editor_outliner.Outliner(this.#boxes, 0.0025, 0.001, this._uiManager.direction === "ltr"); + this.#focusOutlines = outlinerForOutline.getOutlines(); + const { + lastPoint + } = this.#focusOutlines.box; + this.#lastPoint = [(lastPoint[0] - this.x) / this.width, (lastPoint[1] - this.y) / this.height]; + } + static initialize(l10n) { + editor_editor.AnnotationEditor.initialize(l10n); + } + static updateDefaultParams(type, value) { + switch (type) { + case util.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR: + HighlightEditor._defaultColor = value; + break; + } + } + get toolbarPosition() { + return this.#lastPoint; + } + updateParams(type, value) { + switch (type) { + case util.AnnotationEditorParamsType.HIGHLIGHT_COLOR: + this.#updateColor(value); + break; + } + } + static get defaultPropertiesToUpdate() { + return [[util.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR, HighlightEditor._defaultColor]]; + } + get propertiesToUpdate() { + return [[util.AnnotationEditorParamsType.HIGHLIGHT_COLOR, this.color || HighlightEditor._defaultColor]]; + } + #updateColor(color) { + const savedColor = this.color; + this.addCommands({ + cmd: () => { + this.color = color; + this.parent.drawLayer.changeColor(this.#id, color); + this.#colorPicker?.updateColor(color); + }, + undo: () => { + this.color = savedColor; + this.parent.drawLayer.changeColor(this.#id, savedColor); + this.#colorPicker?.updateColor(savedColor); + }, + mustExec: true, + type: util.AnnotationEditorParamsType.HIGHLIGHT_COLOR, + overwriteIfSameType: true, + keepUndo: true + }); + } + async addEditToolbar() { + const toolbar = await super.addEditToolbar(); + if (!toolbar) { + return null; + } + if (this._uiManager.highlightColors) { + this.#colorPicker = new color_picker.ColorPicker({ + editor: this + }); + toolbar.addColorPicker(this.#colorPicker); + } + return toolbar; + } + disableEditing() { + super.disableEditing(); + this.div.classList.toggle("disabled", true); + } + enableEditing() { + super.enableEditing(); + this.div.classList.toggle("disabled", false); + } + fixAndSetPosition() { + return super.fixAndSetPosition(0); + } + getRect(tx, ty) { + return super.getRect(tx, ty, 0); + } + onceAdded() { + this.parent.addUndoableEditor(this); + this.div.focus(); + } + remove() { + super.remove(); + this.#cleanDrawLayer(); + } + rebuild() { + if (!this.parent) { + return; + } + super.rebuild(); + if (this.div === null) { + return; + } + this.#addToDrawLayer(); + if (!this.isAttachedToDOM) { + this.parent.add(this); + } + } + setParent(parent) { + let mustBeSelected = false; + if (this.parent && !parent) { + this.#cleanDrawLayer(); + } else if (parent) { + this.#addToDrawLayer(parent); + mustBeSelected = !this.parent && this.div?.classList.contains("selectedEditor"); + } + super.setParent(parent); + if (mustBeSelected) { + this.select(); + } + } + #cleanDrawLayer() { + if (this.#id === null || !this.parent) { + return; + } + this.parent.drawLayer.remove(this.#id); + this.#id = null; + this.parent.drawLayer.remove(this.#outlineId); + this.#outlineId = null; + } + #addToDrawLayer(parent = this.parent) { + if (this.#id !== null) { + return; + } + ({ + id: this.#id, + clipPathId: this.#clipPathId + } = parent.drawLayer.highlight(this.#highlightOutlines, this.color, this.#opacity)); + if (this.#highlightDiv) { + this.#highlightDiv.style.clipPath = this.#clipPathId; + } + this.#outlineId = parent.drawLayer.highlightOutline(this.#focusOutlines); + } + static #rotateBbox({ + x, + y, + width, + height + }, angle) { + switch (angle) { + case 90: + return { + x: 1 - y - height, + y: x, + width: height, + height: width + }; + case 180: + return { + x: 1 - x - width, + y: 1 - y - height, + width, + height + }; + case 270: + return { + x: y, + y: 1 - x - width, + width: height, + height: width + }; + } + return { + x, + y, + width, + height + }; + } + rotate(angle) { + const { + drawLayer + } = this.parent; + drawLayer.rotate(this.#id, angle); + drawLayer.rotate(this.#outlineId, angle); + drawLayer.updateBox(this.#id, HighlightEditor.#rotateBbox(this, angle)); + drawLayer.updateBox(this.#outlineId, HighlightEditor.#rotateBbox(this.#focusOutlines.box, angle)); + } + render() { + if (this.div) { + return this.div; + } + const div = super.render(); + const highlightDiv = this.#highlightDiv = document.createElement("div"); + div.append(highlightDiv); + highlightDiv.className = "internal"; + highlightDiv.style.clipPath = this.#clipPathId; + const [parentWidth, parentHeight] = this.parentDimensions; + this.setDims(this.width * parentWidth, this.height * parentHeight); + (0,tools.bindEvents)(this, this.#highlightDiv, ["pointerover", "pointerleave"]); + this.enableEditing(); + return div; + } + pointerover() { + this.parent.drawLayer.addClass(this.#outlineId, "hovered"); + } + pointerleave() { + this.parent.drawLayer.removeClass(this.#outlineId, "hovered"); + } + select() { + super.select(); + this.parent?.drawLayer.removeClass(this.#outlineId, "hovered"); + this.parent?.drawLayer.addClass(this.#outlineId, "selected"); + } + unselect() { + super.unselect(); + this.parent?.drawLayer.removeClass(this.#outlineId, "selected"); + } + #serializeBoxes() { + const [pageWidth, pageHeight] = this.pageDimensions; + const boxes = this.#boxes; + const quadPoints = new Array(boxes.length * 8); + let i = 0; + for (const { + x, + y, + width, + height + } of boxes) { + const sx = x * pageWidth; + const sy = (1 - y - height) * pageHeight; + quadPoints[i] = quadPoints[i + 4] = sx; + quadPoints[i + 1] = quadPoints[i + 3] = sy; + quadPoints[i + 2] = quadPoints[i + 6] = sx + width * pageWidth; + quadPoints[i + 5] = quadPoints[i + 7] = sy + height * pageHeight; + i += 8; + } + return quadPoints; + } + #serializeOutlines() { + const [pageWidth, pageHeight] = this.pageDimensions; + const width = this.width * pageWidth; + const height = this.height * pageHeight; + const tx = this.x * pageWidth; + const ty = (1 - this.y - this.height) * pageHeight; + const outlines = []; + for (const outline of this.#highlightOutlines.outlines) { + const points = new Array(outline.length); + for (let i = 0; i < outline.length; i += 2) { + points[i] = tx + outline[i] * width; + points[i + 1] = ty + (1 - outline[i + 1]) * height; + } + outlines.push(points); + } + return outlines; + } + static deserialize(data, parent, uiManager) { + const editor = super.deserialize(data, parent, uiManager); + const { + rect, + color, + quadPoints + } = data; + editor.color = util.Util.makeHexColor(...color); + editor.#opacity = data.opacity; + const [pageWidth, pageHeight] = editor.pageDimensions; + editor.width = (rect[2] - rect[0]) / pageWidth; + editor.height = (rect[3] - rect[1]) / pageHeight; + const boxes = editor.#boxes = []; + for (let i = 0; i < quadPoints.length; i += 8) { + boxes.push({ + x: quadPoints[4] / pageWidth, + y: 1 - quadPoints[i + 5] / pageHeight, + width: (quadPoints[i + 2] - quadPoints[i]) / pageWidth, + height: (quadPoints[i + 5] - quadPoints[i + 1]) / pageHeight + }); + } + editor.#createOutlines(); + return editor; + } + serialize(isForCopying = false) { + if (this.isEmpty() || isForCopying) { + return null; + } + const rect = this.getRect(0, 0); + const color = editor_editor.AnnotationEditor._colorManager.convert(this.color); + return { + annotationType: util.AnnotationEditorType.HIGHLIGHT, + color, + opacity: this.#opacity, + quadPoints: this.#serializeBoxes(), + outlines: this.#serializeOutlines(), + pageIndex: this.pageIndex, + rect, + rotation: 0, + structTreeParentId: this._structTreeParentId + }; + } + static canCreateNewEmptyEditor() { + return false; + } +} + +// EXTERNAL MODULE: ./src/display/display_utils.js +var display_utils = __webpack_require__(473); +;// CONCATENATED MODULE: ./src/display/editor/ink.js + + + + + +class InkEditor extends editor_editor.AnnotationEditor { + #baseHeight = 0; + #baseWidth = 0; + #boundCanvasPointermove = this.canvasPointermove.bind(this); + #boundCanvasPointerleave = this.canvasPointerleave.bind(this); + #boundCanvasPointerup = this.canvasPointerup.bind(this); + #boundCanvasPointerdown = this.canvasPointerdown.bind(this); + #canvasContextMenuTimeoutId = null; + #currentPath2D = new Path2D(); + #disableEditing = false; + #hasSomethingToDraw = false; + #isCanvasInitialized = false; + #observer = null; + #realWidth = 0; + #realHeight = 0; + #requestFrameCallback = null; + static _defaultColor = null; + static _defaultOpacity = 1; + static _defaultThickness = 1; + static _type = "ink"; + static _editorType = util.AnnotationEditorType.INK; + constructor(params) { + super({ + ...params, + name: "inkEditor" + }); + this.color = params.color || null; + this.thickness = params.thickness || null; + this.opacity = params.opacity || null; + this.paths = []; + this.bezierPath2D = []; + this.allRawPaths = []; + this.currentPath = []; + this.scaleFactor = 1; + this.translationX = this.translationY = 0; + this.x = 0; + this.y = 0; + this._willKeepAspectRatio = true; + } + static initialize(l10n) { + editor_editor.AnnotationEditor.initialize(l10n); + } + static updateDefaultParams(type, value) { + switch (type) { + case util.AnnotationEditorParamsType.INK_THICKNESS: + InkEditor._defaultThickness = value; + break; + case util.AnnotationEditorParamsType.INK_COLOR: + InkEditor._defaultColor = value; + break; + case util.AnnotationEditorParamsType.INK_OPACITY: + InkEditor._defaultOpacity = value / 100; + break; + } + } + updateParams(type, value) { + switch (type) { + case util.AnnotationEditorParamsType.INK_THICKNESS: + this.#updateThickness(value); + break; + case util.AnnotationEditorParamsType.INK_COLOR: + this.#updateColor(value); + break; + case util.AnnotationEditorParamsType.INK_OPACITY: + this.#updateOpacity(value); + break; + } + } + static get defaultPropertiesToUpdate() { + return [[util.AnnotationEditorParamsType.INK_THICKNESS, InkEditor._defaultThickness], [util.AnnotationEditorParamsType.INK_COLOR, InkEditor._defaultColor || editor_editor.AnnotationEditor._defaultLineColor], [util.AnnotationEditorParamsType.INK_OPACITY, Math.round(InkEditor._defaultOpacity * 100)]]; + } + get propertiesToUpdate() { + return [[util.AnnotationEditorParamsType.INK_THICKNESS, this.thickness || InkEditor._defaultThickness], [util.AnnotationEditorParamsType.INK_COLOR, this.color || InkEditor._defaultColor || editor_editor.AnnotationEditor._defaultLineColor], [util.AnnotationEditorParamsType.INK_OPACITY, Math.round(100 * (this.opacity ?? InkEditor._defaultOpacity))]]; + } + #updateThickness(thickness) { + const savedThickness = this.thickness; + this.addCommands({ + cmd: () => { + this.thickness = thickness; + this.#fitToContent(); + }, + undo: () => { + this.thickness = savedThickness; + this.#fitToContent(); + }, + mustExec: true, + type: util.AnnotationEditorParamsType.INK_THICKNESS, + overwriteIfSameType: true, + keepUndo: true + }); + } + #updateColor(color) { + const savedColor = this.color; + this.addCommands({ + cmd: () => { + this.color = color; + this.#redraw(); + }, + undo: () => { + this.color = savedColor; + this.#redraw(); + }, + mustExec: true, + type: util.AnnotationEditorParamsType.INK_COLOR, + overwriteIfSameType: true, + keepUndo: true + }); + } + #updateOpacity(opacity) { + opacity /= 100; + const savedOpacity = this.opacity; + this.addCommands({ + cmd: () => { + this.opacity = opacity; + this.#redraw(); + }, + undo: () => { + this.opacity = savedOpacity; + this.#redraw(); + }, + mustExec: true, + type: util.AnnotationEditorParamsType.INK_OPACITY, + overwriteIfSameType: true, + keepUndo: true + }); + } + rebuild() { + if (!this.parent) { + return; + } + super.rebuild(); + if (this.div === null) { + return; + } + if (!this.canvas) { + this.#createCanvas(); + this.#createObserver(); + } + if (!this.isAttachedToDOM) { + this.parent.add(this); + this.#setCanvasDims(); + } + this.#fitToContent(); + } + remove() { + if (this.canvas === null) { + return; + } + if (!this.isEmpty()) { + this.commit(); + } + this.canvas.width = this.canvas.height = 0; + this.canvas.remove(); + this.canvas = null; + if (this.#canvasContextMenuTimeoutId) { + clearTimeout(this.#canvasContextMenuTimeoutId); + this.#canvasContextMenuTimeoutId = null; + } + this.#observer.disconnect(); + this.#observer = null; + super.remove(); + } + setParent(parent) { + if (!this.parent && parent) { + this._uiManager.removeShouldRescale(this); + } else if (this.parent && parent === null) { + this._uiManager.addShouldRescale(this); + } + super.setParent(parent); + } + onScaleChanging() { + const [parentWidth, parentHeight] = this.parentDimensions; + const width = this.width * parentWidth; + const height = this.height * parentHeight; + this.setDimensions(width, height); + } + enableEditMode() { + if (this.#disableEditing || this.canvas === null) { + return; + } + super.enableEditMode(); + this._isDraggable = false; + this.canvas.addEventListener("pointerdown", this.#boundCanvasPointerdown); + } + disableEditMode() { + if (!this.isInEditMode() || this.canvas === null) { + return; + } + super.disableEditMode(); + this._isDraggable = !this.isEmpty(); + this.div.classList.remove("editing"); + this.canvas.removeEventListener("pointerdown", this.#boundCanvasPointerdown); + } + onceAdded() { + this._isDraggable = !this.isEmpty(); + } + isEmpty() { + return this.paths.length === 0 || this.paths.length === 1 && this.paths[0].length === 0; + } + #getInitialBBox() { + const { + parentRotation, + parentDimensions: [width, height] + } = this; + switch (parentRotation) { + case 90: + return [0, height, height, width]; + case 180: + return [width, height, width, height]; + case 270: + return [width, 0, height, width]; + default: + return [0, 0, width, height]; + } + } + #setStroke() { + const { + ctx, + color, + opacity, + thickness, + parentScale, + scaleFactor + } = this; + ctx.lineWidth = thickness * parentScale / scaleFactor; + ctx.lineCap = "round"; + ctx.lineJoin = "round"; + ctx.miterLimit = 10; + ctx.strokeStyle = `${color}${(0,tools.opacityToHex)(opacity)}`; + } + #startDrawing(x, y) { + this.canvas.addEventListener("contextmenu", display_utils.noContextMenu); + this.canvas.addEventListener("pointerleave", this.#boundCanvasPointerleave); + this.canvas.addEventListener("pointermove", this.#boundCanvasPointermove); + this.canvas.addEventListener("pointerup", this.#boundCanvasPointerup); + this.canvas.removeEventListener("pointerdown", this.#boundCanvasPointerdown); + this.isEditing = true; + if (!this.#isCanvasInitialized) { + this.#isCanvasInitialized = true; + this.#setCanvasDims(); + this.thickness ||= InkEditor._defaultThickness; + this.color ||= InkEditor._defaultColor || editor_editor.AnnotationEditor._defaultLineColor; + this.opacity ??= InkEditor._defaultOpacity; + } + this.currentPath.push([x, y]); + this.#hasSomethingToDraw = false; + this.#setStroke(); + this.#requestFrameCallback = () => { + this.#drawPoints(); + if (this.#requestFrameCallback) { + window.requestAnimationFrame(this.#requestFrameCallback); + } + }; + window.requestAnimationFrame(this.#requestFrameCallback); + } + #draw(x, y) { + const [lastX, lastY] = this.currentPath.at(-1); + if (this.currentPath.length > 1 && x === lastX && y === lastY) { + return; + } + const currentPath = this.currentPath; + let path2D = this.#currentPath2D; + currentPath.push([x, y]); + this.#hasSomethingToDraw = true; + if (currentPath.length <= 2) { + path2D.moveTo(...currentPath[0]); + path2D.lineTo(x, y); + return; + } + if (currentPath.length === 3) { + this.#currentPath2D = path2D = new Path2D(); + path2D.moveTo(...currentPath[0]); + } + this.#makeBezierCurve(path2D, ...currentPath.at(-3), ...currentPath.at(-2), x, y); + } + #endPath() { + if (this.currentPath.length === 0) { + return; + } + const lastPoint = this.currentPath.at(-1); + this.#currentPath2D.lineTo(...lastPoint); + } + #stopDrawing(x, y) { + this.#requestFrameCallback = null; + x = Math.min(Math.max(x, 0), this.canvas.width); + y = Math.min(Math.max(y, 0), this.canvas.height); + this.#draw(x, y); + this.#endPath(); + let bezier; + if (this.currentPath.length !== 1) { + bezier = this.#generateBezierPoints(); + } else { + const xy = [x, y]; + bezier = [[xy, xy.slice(), xy.slice(), xy]]; + } + const path2D = this.#currentPath2D; + const currentPath = this.currentPath; + this.currentPath = []; + this.#currentPath2D = new Path2D(); + const cmd = () => { + this.allRawPaths.push(currentPath); + this.paths.push(bezier); + this.bezierPath2D.push(path2D); + this.rebuild(); + }; + const undo = () => { + this.allRawPaths.pop(); + this.paths.pop(); + this.bezierPath2D.pop(); + if (this.paths.length === 0) { + this.remove(); + } else { + if (!this.canvas) { + this.#createCanvas(); + this.#createObserver(); + } + this.#fitToContent(); + } + }; + this.addCommands({ + cmd, + undo, + mustExec: true + }); + } + #drawPoints() { + if (!this.#hasSomethingToDraw) { + return; + } + this.#hasSomethingToDraw = false; + const thickness = Math.ceil(this.thickness * this.parentScale); + const lastPoints = this.currentPath.slice(-3); + const x = lastPoints.map(xy => xy[0]); + const y = lastPoints.map(xy => xy[1]); + const xMin = Math.min(...x) - thickness; + const xMax = Math.max(...x) + thickness; + const yMin = Math.min(...y) - thickness; + const yMax = Math.max(...y) + thickness; + const { + ctx + } = this; + ctx.save(); + ctx.clearRect(0, 0, this.canvas.width, this.canvas.height); + for (const path of this.bezierPath2D) { + ctx.stroke(path); + } + ctx.stroke(this.#currentPath2D); + ctx.restore(); + } + #makeBezierCurve(path2D, x0, y0, x1, y1, x2, y2) { + const prevX = (x0 + x1) / 2; + const prevY = (y0 + y1) / 2; + const x3 = (x1 + x2) / 2; + const y3 = (y1 + y2) / 2; + path2D.bezierCurveTo(prevX + 2 * (x1 - prevX) / 3, prevY + 2 * (y1 - prevY) / 3, x3 + 2 * (x1 - x3) / 3, y3 + 2 * (y1 - y3) / 3, x3, y3); + } + #generateBezierPoints() { + const path = this.currentPath; + if (path.length <= 2) { + return [[path[0], path[0], path.at(-1), path.at(-1)]]; + } + const bezierPoints = []; + let i; + let [x0, y0] = path[0]; + for (i = 1; i < path.length - 2; i++) { + const [x1, y1] = path[i]; + const [x2, y2] = path[i + 1]; + const x3 = (x1 + x2) / 2; + const y3 = (y1 + y2) / 2; + const control1 = [x0 + 2 * (x1 - x0) / 3, y0 + 2 * (y1 - y0) / 3]; + const control2 = [x3 + 2 * (x1 - x3) / 3, y3 + 2 * (y1 - y3) / 3]; + bezierPoints.push([[x0, y0], control1, control2, [x3, y3]]); + [x0, y0] = [x3, y3]; + } + const [x1, y1] = path[i]; + const [x2, y2] = path[i + 1]; + const control1 = [x0 + 2 * (x1 - x0) / 3, y0 + 2 * (y1 - y0) / 3]; + const control2 = [x2 + 2 * (x1 - x2) / 3, y2 + 2 * (y1 - y2) / 3]; + bezierPoints.push([[x0, y0], control1, control2, [x2, y2]]); + return bezierPoints; + } + #redraw() { + if (this.isEmpty()) { + this.#updateTransform(); + return; + } + this.#setStroke(); + const { + canvas, + ctx + } = this; + ctx.setTransform(1, 0, 0, 1, 0, 0); + ctx.clearRect(0, 0, canvas.width, canvas.height); + this.#updateTransform(); + for (const path of this.bezierPath2D) { + ctx.stroke(path); + } + } + commit() { + if (this.#disableEditing) { + return; + } + super.commit(); + this.isEditing = false; + this.disableEditMode(); + this.setInForeground(); + this.#disableEditing = true; + this.div.classList.add("disabled"); + this.#fitToContent(true); + this.select(); + this.parent.addInkEditorIfNeeded(true); + this.moveInDOM(); + this.div.focus({ + preventScroll: true + }); + } + focusin(event) { + if (!this._focusEventsAllowed) { + return; + } + super.focusin(event); + this.enableEditMode(); + } + canvasPointerdown(event) { + if (event.button !== 0 || !this.isInEditMode() || this.#disableEditing) { + return; + } + this.setInForeground(); + event.preventDefault(); + if (!this.div.contains(document.activeElement)) { + this.div.focus({ + preventScroll: true + }); + } + this.#startDrawing(event.offsetX, event.offsetY); + } + canvasPointermove(event) { + event.preventDefault(); + this.#draw(event.offsetX, event.offsetY); + } + canvasPointerup(event) { + event.preventDefault(); + this.#endDrawing(event); + } + canvasPointerleave(event) { + this.#endDrawing(event); + } + #endDrawing(event) { + this.canvas.removeEventListener("pointerleave", this.#boundCanvasPointerleave); + this.canvas.removeEventListener("pointermove", this.#boundCanvasPointermove); + this.canvas.removeEventListener("pointerup", this.#boundCanvasPointerup); + this.canvas.addEventListener("pointerdown", this.#boundCanvasPointerdown); + if (this.#canvasContextMenuTimeoutId) { + clearTimeout(this.#canvasContextMenuTimeoutId); + } + this.#canvasContextMenuTimeoutId = setTimeout(() => { + this.#canvasContextMenuTimeoutId = null; + this.canvas.removeEventListener("contextmenu", display_utils.noContextMenu); + }, 10); + this.#stopDrawing(event.offsetX, event.offsetY); + this.addToAnnotationStorage(); + this.setInBackground(); + } + #createCanvas() { + this.canvas = document.createElement("canvas"); + this.canvas.width = this.canvas.height = 0; + this.canvas.className = "inkEditorCanvas"; + this.canvas.setAttribute("data-l10n-id", "pdfjs-ink-canvas"); + this.div.append(this.canvas); + this.ctx = this.canvas.getContext("2d"); + } + #createObserver() { + this.#observer = new ResizeObserver(entries => { + const rect = entries[0].contentRect; + if (rect.width && rect.height) { + this.setDimensions(rect.width, rect.height); + } + }); + this.#observer.observe(this.div); + } + get isResizable() { + return !this.isEmpty() && this.#disableEditing; + } + render() { + if (this.div) { + return this.div; + } + let baseX, baseY; + if (this.width) { + baseX = this.x; + baseY = this.y; + } + super.render(); + this.div.setAttribute("data-l10n-id", "pdfjs-ink"); + const [x, y, w, h] = this.#getInitialBBox(); + this.setAt(x, y, 0, 0); + this.setDims(w, h); + this.#createCanvas(); + if (this.width) { + const [parentWidth, parentHeight] = this.parentDimensions; + this.setAspectRatio(this.width * parentWidth, this.height * parentHeight); + this.setAt(baseX * parentWidth, baseY * parentHeight, this.width * parentWidth, this.height * parentHeight); + this.#isCanvasInitialized = true; + this.#setCanvasDims(); + this.setDims(this.width * parentWidth, this.height * parentHeight); + this.#redraw(); + this.div.classList.add("disabled"); + } else { + this.div.classList.add("editing"); + this.enableEditMode(); + } + this.#createObserver(); + return this.div; + } + #setCanvasDims() { + if (!this.#isCanvasInitialized) { + return; + } + const [parentWidth, parentHeight] = this.parentDimensions; + this.canvas.width = Math.ceil(this.width * parentWidth); + this.canvas.height = Math.ceil(this.height * parentHeight); + this.#updateTransform(); + } + setDimensions(width, height) { + const roundedWidth = Math.round(width); + const roundedHeight = Math.round(height); + if (this.#realWidth === roundedWidth && this.#realHeight === roundedHeight) { + return; + } + this.#realWidth = roundedWidth; + this.#realHeight = roundedHeight; + this.canvas.style.visibility = "hidden"; + const [parentWidth, parentHeight] = this.parentDimensions; + this.width = width / parentWidth; + this.height = height / parentHeight; + this.fixAndSetPosition(); + if (this.#disableEditing) { + this.#setScaleFactor(width, height); + } + this.#setCanvasDims(); + this.#redraw(); + this.canvas.style.visibility = "visible"; + this.fixDims(); + } + #setScaleFactor(width, height) { + const padding = this.#getPadding(); + const scaleFactorW = (width - padding) / this.#baseWidth; + const scaleFactorH = (height - padding) / this.#baseHeight; + this.scaleFactor = Math.min(scaleFactorW, scaleFactorH); + } + #updateTransform() { + const padding = this.#getPadding() / 2; + this.ctx.setTransform(this.scaleFactor, 0, 0, this.scaleFactor, this.translationX * this.scaleFactor + padding, this.translationY * this.scaleFactor + padding); + } + static #buildPath2D(bezier) { + const path2D = new Path2D(); + for (let i = 0, ii = bezier.length; i < ii; i++) { + const [first, control1, control2, second] = bezier[i]; + if (i === 0) { + path2D.moveTo(...first); + } + path2D.bezierCurveTo(control1[0], control1[1], control2[0], control2[1], second[0], second[1]); + } + return path2D; + } + static #toPDFCoordinates(points, rect, rotation) { + const [blX, blY, trX, trY] = rect; + switch (rotation) { + case 0: + for (let i = 0, ii = points.length; i < ii; i += 2) { + points[i] += blX; + points[i + 1] = trY - points[i + 1]; + } + break; + case 90: + for (let i = 0, ii = points.length; i < ii; i += 2) { + const x = points[i]; + points[i] = points[i + 1] + blX; + points[i + 1] = x + blY; + } + break; + case 180: + for (let i = 0, ii = points.length; i < ii; i += 2) { + points[i] = trX - points[i]; + points[i + 1] += blY; + } + break; + case 270: + for (let i = 0, ii = points.length; i < ii; i += 2) { + const x = points[i]; + points[i] = trX - points[i + 1]; + points[i + 1] = trY - x; + } + break; + default: + throw new Error("Invalid rotation"); + } + return points; + } + static #fromPDFCoordinates(points, rect, rotation) { + const [blX, blY, trX, trY] = rect; + switch (rotation) { + case 0: + for (let i = 0, ii = points.length; i < ii; i += 2) { + points[i] -= blX; + points[i + 1] = trY - points[i + 1]; + } + break; + case 90: + for (let i = 0, ii = points.length; i < ii; i += 2) { + const x = points[i]; + points[i] = points[i + 1] - blY; + points[i + 1] = x - blX; + } + break; + case 180: + for (let i = 0, ii = points.length; i < ii; i += 2) { + points[i] = trX - points[i]; + points[i + 1] -= blY; + } + break; + case 270: + for (let i = 0, ii = points.length; i < ii; i += 2) { + const x = points[i]; + points[i] = trY - points[i + 1]; + points[i + 1] = trX - x; + } + break; + default: + throw new Error("Invalid rotation"); + } + return points; + } + #serializePaths(s, tx, ty, rect) { + const paths = []; + const padding = this.thickness / 2; + const shiftX = s * tx + padding; + const shiftY = s * ty + padding; + for (const bezier of this.paths) { + const buffer = []; + const points = []; + for (let j = 0, jj = bezier.length; j < jj; j++) { + const [first, control1, control2, second] = bezier[j]; + const p10 = s * first[0] + shiftX; + const p11 = s * first[1] + shiftY; + const p20 = s * control1[0] + shiftX; + const p21 = s * control1[1] + shiftY; + const p30 = s * control2[0] + shiftX; + const p31 = s * control2[1] + shiftY; + const p40 = s * second[0] + shiftX; + const p41 = s * second[1] + shiftY; + if (j === 0) { + buffer.push(p10, p11); + points.push(p10, p11); + } + buffer.push(p20, p21, p30, p31, p40, p41); + points.push(p20, p21); + if (j === jj - 1) { + points.push(p40, p41); + } + } + paths.push({ + bezier: InkEditor.#toPDFCoordinates(buffer, rect, this.rotation), + points: InkEditor.#toPDFCoordinates(points, rect, this.rotation) + }); + } + return paths; + } + #getBbox() { + let xMin = Infinity; + let xMax = -Infinity; + let yMin = Infinity; + let yMax = -Infinity; + for (const path of this.paths) { + for (const [first, control1, control2, second] of path) { + const bbox = util.Util.bezierBoundingBox(...first, ...control1, ...control2, ...second); + xMin = Math.min(xMin, bbox[0]); + yMin = Math.min(yMin, bbox[1]); + xMax = Math.max(xMax, bbox[2]); + yMax = Math.max(yMax, bbox[3]); + } + } + return [xMin, yMin, xMax, yMax]; + } + #getPadding() { + return this.#disableEditing ? Math.ceil(this.thickness * this.parentScale) : 0; + } + #fitToContent(firstTime = false) { + if (this.isEmpty()) { + return; + } + if (!this.#disableEditing) { + this.#redraw(); + return; + } + const bbox = this.#getBbox(); + const padding = this.#getPadding(); + this.#baseWidth = Math.max(editor_editor.AnnotationEditor.MIN_SIZE, bbox[2] - bbox[0]); + this.#baseHeight = Math.max(editor_editor.AnnotationEditor.MIN_SIZE, bbox[3] - bbox[1]); + const width = Math.ceil(padding + this.#baseWidth * this.scaleFactor); + const height = Math.ceil(padding + this.#baseHeight * this.scaleFactor); + const [parentWidth, parentHeight] = this.parentDimensions; + this.width = width / parentWidth; + this.height = height / parentHeight; + this.setAspectRatio(width, height); + const prevTranslationX = this.translationX; + const prevTranslationY = this.translationY; + this.translationX = -bbox[0]; + this.translationY = -bbox[1]; + this.#setCanvasDims(); + this.#redraw(); + this.#realWidth = width; + this.#realHeight = height; + this.setDims(width, height); + const unscaledPadding = firstTime ? padding / this.scaleFactor / 2 : 0; + this.translate(prevTranslationX - this.translationX - unscaledPadding, prevTranslationY - this.translationY - unscaledPadding); + } + static deserialize(data, parent, uiManager) { + if (data instanceof annotation_layer.InkAnnotationElement) { + return null; + } + const editor = super.deserialize(data, parent, uiManager); + editor.thickness = data.thickness; + editor.color = util.Util.makeHexColor(...data.color); + editor.opacity = data.opacity; + const [pageWidth, pageHeight] = editor.pageDimensions; + const width = editor.width * pageWidth; + const height = editor.height * pageHeight; + const scaleFactor = editor.parentScale; + const padding = data.thickness / 2; + editor.#disableEditing = true; + editor.#realWidth = Math.round(width); + editor.#realHeight = Math.round(height); + const { + paths, + rect, + rotation + } = data; + for (let { + bezier + } of paths) { + bezier = InkEditor.#fromPDFCoordinates(bezier, rect, rotation); + const path = []; + editor.paths.push(path); + let p0 = scaleFactor * (bezier[0] - padding); + let p1 = scaleFactor * (bezier[1] - padding); + for (let i = 2, ii = bezier.length; i < ii; i += 6) { + const p10 = scaleFactor * (bezier[i] - padding); + const p11 = scaleFactor * (bezier[i + 1] - padding); + const p20 = scaleFactor * (bezier[i + 2] - padding); + const p21 = scaleFactor * (bezier[i + 3] - padding); + const p30 = scaleFactor * (bezier[i + 4] - padding); + const p31 = scaleFactor * (bezier[i + 5] - padding); + path.push([[p0, p1], [p10, p11], [p20, p21], [p30, p31]]); + p0 = p30; + p1 = p31; + } + const path2D = this.#buildPath2D(path); + editor.bezierPath2D.push(path2D); + } + const bbox = editor.#getBbox(); + editor.#baseWidth = Math.max(editor_editor.AnnotationEditor.MIN_SIZE, bbox[2] - bbox[0]); + editor.#baseHeight = Math.max(editor_editor.AnnotationEditor.MIN_SIZE, bbox[3] - bbox[1]); + editor.#setScaleFactor(width, height); + return editor; + } + serialize() { + if (this.isEmpty()) { + return null; + } + const rect = this.getRect(0, 0); + const color = editor_editor.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle); + return { + annotationType: util.AnnotationEditorType.INK, + color, + thickness: this.thickness, + opacity: this.opacity, + paths: this.#serializePaths(this.scaleFactor / this.parentScale, this.translationX, this.translationY, rect), + pageIndex: this.pageIndex, + rect, + rotation: this.rotation, + structTreeParentId: this._structTreeParentId + }; + } +} + +;// CONCATENATED MODULE: ./src/display/editor/stamp.js + + + + +class StampEditor extends editor_editor.AnnotationEditor { + #bitmap = null; + #bitmapId = null; + #bitmapPromise = null; + #bitmapUrl = null; + #bitmapFile = null; + #bitmapFileName = ""; + #canvas = null; + #observer = null; + #resizeTimeoutId = null; + #isSvg = false; + #hasBeenAddedInUndoStack = false; + static _type = "stamp"; + static _editorType = util.AnnotationEditorType.STAMP; + constructor(params) { + super({ + ...params, + name: "stampEditor" + }); + this.#bitmapUrl = params.bitmapUrl; + this.#bitmapFile = params.bitmapFile; + } + static initialize(l10n) { + editor_editor.AnnotationEditor.initialize(l10n); + } + static get supportedTypes() { + const types = ["apng", "avif", "bmp", "gif", "jpeg", "png", "svg+xml", "webp", "x-icon"]; + return (0,util.shadow)(this, "supportedTypes", types.map(type => `image/${type}`)); + } + static get supportedTypesStr() { + return (0,util.shadow)(this, "supportedTypesStr", this.supportedTypes.join(",")); + } + static isHandlingMimeForPasting(mime) { + return this.supportedTypes.includes(mime); + } + static paste(item, parent) { + parent.pasteEditor(util.AnnotationEditorType.STAMP, { + bitmapFile: item.getAsFile() + }); + } + #getBitmapFetched(data, fromId = false) { + if (!data) { + this.remove(); + return; + } + this.#bitmap = data.bitmap; + if (!fromId) { + this.#bitmapId = data.id; + this.#isSvg = data.isSvg; + } + if (data.file) { + this.#bitmapFileName = data.file.name; + } + this.#createCanvas(); + } + #getBitmapDone() { + this.#bitmapPromise = null; + this._uiManager.enableWaiting(false); + if (this.#canvas) { + this.div.focus(); + } + } + #getBitmap() { + if (this.#bitmapId) { + this._uiManager.enableWaiting(true); + this._uiManager.imageManager.getFromId(this.#bitmapId).then(data => this.#getBitmapFetched(data, true)).finally(() => this.#getBitmapDone()); + return; + } + if (this.#bitmapUrl) { + const url = this.#bitmapUrl; + this.#bitmapUrl = null; + this._uiManager.enableWaiting(true); + this.#bitmapPromise = this._uiManager.imageManager.getFromUrl(url).then(data => this.#getBitmapFetched(data)).finally(() => this.#getBitmapDone()); + return; + } + if (this.#bitmapFile) { + const file = this.#bitmapFile; + this.#bitmapFile = null; + this._uiManager.enableWaiting(true); + this.#bitmapPromise = this._uiManager.imageManager.getFromFile(file).then(data => this.#getBitmapFetched(data)).finally(() => this.#getBitmapDone()); + return; + } + const input = document.createElement("input"); + input.type = "file"; + input.accept = StampEditor.supportedTypesStr; + this.#bitmapPromise = new Promise(resolve => { + input.addEventListener("change", async () => { + if (!input.files || input.files.length === 0) { + this.remove(); + } else { + this._uiManager.enableWaiting(true); + const data = await this._uiManager.imageManager.getFromFile(input.files[0]); + this.#getBitmapFetched(data); + } + resolve(); + }); + input.addEventListener("cancel", () => { + this.remove(); + resolve(); + }); + }).finally(() => this.#getBitmapDone()); + input.click(); + } + remove() { + if (this.#bitmapId) { + this.#bitmap = null; + this._uiManager.imageManager.deleteId(this.#bitmapId); + this.#canvas?.remove(); + this.#canvas = null; + this.#observer?.disconnect(); + this.#observer = null; + if (this.#resizeTimeoutId) { + clearTimeout(this.#resizeTimeoutId); + this.#resizeTimeoutId = null; + } + } + super.remove(); + } + rebuild() { + if (!this.parent) { + if (this.#bitmapId) { + this.#getBitmap(); + } + return; + } + super.rebuild(); + if (this.div === null) { + return; + } + if (this.#bitmapId) { + this.#getBitmap(); + } + if (!this.isAttachedToDOM) { + this.parent.add(this); + } + } + onceAdded() { + this._isDraggable = true; + this.div.focus(); + } + isEmpty() { + return !(this.#bitmapPromise || this.#bitmap || this.#bitmapUrl || this.#bitmapFile); + } + get isResizable() { + return true; + } + render() { + if (this.div) { + return this.div; + } + let baseX, baseY; + if (this.width) { + baseX = this.x; + baseY = this.y; + } + super.render(); + this.div.hidden = true; + if (this.#bitmap) { + this.#createCanvas(); + } else { + this.#getBitmap(); + } + if (this.width) { + const [parentWidth, parentHeight] = this.parentDimensions; + this.setAt(baseX * parentWidth, baseY * parentHeight, this.width * parentWidth, this.height * parentHeight); + } + return this.div; + } + #createCanvas() { + const { + div + } = this; + let { + width, + height + } = this.#bitmap; + const [pageWidth, pageHeight] = this.pageDimensions; + const MAX_RATIO = 0.75; + if (this.width) { + width = this.width * pageWidth; + height = this.height * pageHeight; + } else if (width > MAX_RATIO * pageWidth || height > MAX_RATIO * pageHeight) { + const factor = Math.min(MAX_RATIO * pageWidth / width, MAX_RATIO * pageHeight / height); + width *= factor; + height *= factor; + } + const [parentWidth, parentHeight] = this.parentDimensions; + this.setDims(width * parentWidth / pageWidth, height * parentHeight / pageHeight); + this._uiManager.enableWaiting(false); + const canvas = this.#canvas = document.createElement("canvas"); + div.append(canvas); + div.hidden = false; + this.#drawBitmap(width, height); + this.#createObserver(); + if (!this.#hasBeenAddedInUndoStack) { + this.parent.addUndoableEditor(this); + this.#hasBeenAddedInUndoStack = true; + } + this._uiManager._eventBus.dispatch("reporttelemetry", { + source: this, + details: { + type: "editing", + subtype: this.editorType, + data: { + action: "inserted_image" + } + } + }); + this.addAltTextButton(); + if (this.#bitmapFileName) { + canvas.setAttribute("aria-label", this.#bitmapFileName); + } + } + #setDimensions(width, height) { + const [parentWidth, parentHeight] = this.parentDimensions; + this.width = width / parentWidth; + this.height = height / parentHeight; + this.setDims(width, height); + if (this._initialOptions?.isCentered) { + this.center(); + } else { + this.fixAndSetPosition(); + } + this._initialOptions = null; + if (this.#resizeTimeoutId !== null) { + clearTimeout(this.#resizeTimeoutId); + } + const TIME_TO_WAIT = 200; + this.#resizeTimeoutId = setTimeout(() => { + this.#resizeTimeoutId = null; + this.#drawBitmap(width, height); + }, TIME_TO_WAIT); + } + #scaleBitmap(width, height) { + const { + width: bitmapWidth, + height: bitmapHeight + } = this.#bitmap; + let newWidth = bitmapWidth; + let newHeight = bitmapHeight; + let bitmap = this.#bitmap; + while (newWidth > 2 * width || newHeight > 2 * height) { + const prevWidth = newWidth; + const prevHeight = newHeight; + if (newWidth > 2 * width) { + newWidth = newWidth >= 16384 ? Math.floor(newWidth / 2) - 1 : Math.ceil(newWidth / 2); + } + if (newHeight > 2 * height) { + newHeight = newHeight >= 16384 ? Math.floor(newHeight / 2) - 1 : Math.ceil(newHeight / 2); + } + const offscreen = new OffscreenCanvas(newWidth, newHeight); + const ctx = offscreen.getContext("2d"); + ctx.drawImage(bitmap, 0, 0, prevWidth, prevHeight, 0, 0, newWidth, newHeight); + bitmap = offscreen.transferToImageBitmap(); + } + return bitmap; + } + #drawBitmap(width, height) { + width = Math.ceil(width); + height = Math.ceil(height); + const canvas = this.#canvas; + if (!canvas || canvas.width === width && canvas.height === height) { + return; + } + canvas.width = width; + canvas.height = height; + const bitmap = this.#isSvg ? this.#bitmap : this.#scaleBitmap(width, height); + const ctx = canvas.getContext("2d"); + ctx.filter = this._uiManager.hcmFilter; + ctx.drawImage(bitmap, 0, 0, bitmap.width, bitmap.height, 0, 0, width, height); + } + getImageForAltText() { + return this.#canvas; + } + #serializeBitmap(toUrl) { + if (toUrl) { + if (this.#isSvg) { + const url = this._uiManager.imageManager.getSvgUrl(this.#bitmapId); + if (url) { + return url; + } + } + const canvas = document.createElement("canvas"); + ({ + width: canvas.width, + height: canvas.height + } = this.#bitmap); + const ctx = canvas.getContext("2d"); + ctx.drawImage(this.#bitmap, 0, 0); + return canvas.toDataURL(); + } + if (this.#isSvg) { + const [pageWidth, pageHeight] = this.pageDimensions; + const width = Math.round(this.width * pageWidth * display_utils.PixelsPerInch.PDF_TO_CSS_UNITS); + const height = Math.round(this.height * pageHeight * display_utils.PixelsPerInch.PDF_TO_CSS_UNITS); + const offscreen = new OffscreenCanvas(width, height); + const ctx = offscreen.getContext("2d"); + ctx.drawImage(this.#bitmap, 0, 0, this.#bitmap.width, this.#bitmap.height, 0, 0, width, height); + return offscreen.transferToImageBitmap(); + } + return structuredClone(this.#bitmap); + } + #createObserver() { + this.#observer = new ResizeObserver(entries => { + const rect = entries[0].contentRect; + if (rect.width && rect.height) { + this.#setDimensions(rect.width, rect.height); + } + }); + this.#observer.observe(this.div); + } + static deserialize(data, parent, uiManager) { + if (data instanceof annotation_layer.StampAnnotationElement) { + return null; + } + const editor = super.deserialize(data, parent, uiManager); + const { + rect, + bitmapUrl, + bitmapId, + isSvg, + accessibilityData + } = data; + if (bitmapId && uiManager.imageManager.isValidId(bitmapId)) { + editor.#bitmapId = bitmapId; + } else { + editor.#bitmapUrl = bitmapUrl; + } + editor.#isSvg = isSvg; + const [parentWidth, parentHeight] = editor.pageDimensions; + editor.width = (rect[2] - rect[0]) / parentWidth; + editor.height = (rect[3] - rect[1]) / parentHeight; + if (accessibilityData) { + editor.altTextData = accessibilityData; + } + return editor; + } + serialize(isForCopying = false, context = null) { + if (this.isEmpty()) { + return null; + } + const serialized = { + annotationType: util.AnnotationEditorType.STAMP, + bitmapId: this.#bitmapId, + pageIndex: this.pageIndex, + rect: this.getRect(0, 0), + rotation: this.rotation, + isSvg: this.#isSvg, + structTreeParentId: this._structTreeParentId + }; + if (isForCopying) { + serialized.bitmapUrl = this.#serializeBitmap(true); + serialized.accessibilityData = this.altTextData; + return serialized; + } + const { + decorative, + altText + } = this.altTextData; + if (!decorative && altText) { + serialized.accessibilityData = { + type: "Figure", + alt: altText + }; + } + if (context === null) { + return serialized; + } + context.stamps ||= new Map(); + const area = this.#isSvg ? (serialized.rect[2] - serialized.rect[0]) * (serialized.rect[3] - serialized.rect[1]) : null; + if (!context.stamps.has(this.#bitmapId)) { + context.stamps.set(this.#bitmapId, { + area, + serialized + }); + serialized.bitmap = this.#serializeBitmap(false); + } else if (this.#isSvg) { + const prevData = context.stamps.get(this.#bitmapId); + if (area > prevData.area) { + prevData.area = area; + prevData.serialized.bitmap.close(); + prevData.serialized.bitmap = this.#serializeBitmap(false); + } + } + return serialized; + } +} + +;// CONCATENATED MODULE: ./src/display/editor/annotation_editor_layer.js + + + + + + + +class AnnotationEditorLayer { + #accessibilityManager; + #allowClick = false; + #annotationLayer = null; + #boundPointerup = this.pointerup.bind(this); + #boundPointerUpAfterSelection = this.pointerUpAfterSelection.bind(this); + #boundPointerdown = this.pointerdown.bind(this); + #editorFocusTimeoutId = null; + #boundSelectionStart = this.selectionStart.bind(this); + #editors = new Map(); + #hadPointerDown = false; + #isCleaningUp = false; + #isDisabling = false; + #textLayer = null; + #uiManager; + static _initialized = false; + static #editorTypes = new Map([FreeTextEditor, InkEditor, StampEditor, HighlightEditor].map(type => [type._editorType, type])); + constructor({ + uiManager, + pageIndex, + div, + accessibilityManager, + annotationLayer, + drawLayer, + textLayer, + viewport, + l10n + }) { + const editorTypes = [...AnnotationEditorLayer.#editorTypes.values()]; + if (!AnnotationEditorLayer._initialized) { + AnnotationEditorLayer._initialized = true; + for (const editorType of editorTypes) { + editorType.initialize(l10n); + } + } + uiManager.registerEditorTypes(editorTypes); + this.#uiManager = uiManager; + this.pageIndex = pageIndex; + this.div = div; + this.#accessibilityManager = accessibilityManager; + this.#annotationLayer = annotationLayer; + this.viewport = viewport; + this.#textLayer = textLayer; + this.drawLayer = drawLayer; + this.#uiManager.addLayer(this); + } + get isEmpty() { + return this.#editors.size === 0; + } + updateToolbar(mode) { + this.#uiManager.updateToolbar(mode); + } + updateMode(mode = this.#uiManager.getMode()) { + this.#cleanup(); + switch (mode) { + case util.AnnotationEditorType.NONE: + this.disableTextSelection(); + this.togglePointerEvents(false); + this.disableClick(); + break; + case util.AnnotationEditorType.INK: + this.addInkEditorIfNeeded(false); + this.disableTextSelection(); + this.togglePointerEvents(true); + this.disableClick(); + break; + case util.AnnotationEditorType.HIGHLIGHT: + this.enableTextSelection(); + this.togglePointerEvents(false); + this.disableClick(); + break; + default: + this.disableTextSelection(); + this.togglePointerEvents(true); + this.enableClick(); + } + if (mode !== util.AnnotationEditorType.NONE) { + const { + classList + } = this.div; + for (const editorType of AnnotationEditorLayer.#editorTypes.values()) { + classList.toggle(`${editorType._type}Editing`, mode === editorType._editorType); + } + this.div.hidden = false; + } + } + addInkEditorIfNeeded(isCommitting) { + if (this.#uiManager.getMode() !== util.AnnotationEditorType.INK) { + return; + } + if (!isCommitting) { + for (const editor of this.#editors.values()) { + if (editor.isEmpty()) { + editor.setInBackground(); + return; + } + } + } + const editor = this.#createAndAddNewEditor({ + offsetX: 0, + offsetY: 0 + }, false); + editor.setInBackground(); + } + setEditingState(isEditing) { + this.#uiManager.setEditingState(isEditing); + } + addCommands(params) { + this.#uiManager.addCommands(params); + } + togglePointerEvents(enabled = false) { + this.div.classList.toggle("disabled", !enabled); + } + enable() { + this.togglePointerEvents(true); + const annotationElementIds = new Set(); + for (const editor of this.#editors.values()) { + editor.enableEditing(); + if (editor.annotationElementId) { + annotationElementIds.add(editor.annotationElementId); + } + } + if (!this.#annotationLayer) { + return; + } + const editables = this.#annotationLayer.getEditableAnnotations(); + for (const editable of editables) { + editable.hide(); + if (this.#uiManager.isDeletedAnnotationElement(editable.data.id)) { + continue; + } + if (annotationElementIds.has(editable.data.id)) { + continue; + } + const editor = this.deserialize(editable); + if (!editor) { + continue; + } + this.addOrRebuild(editor); + editor.enableEditing(); + } + } + disable() { + this.#isDisabling = true; + this.togglePointerEvents(false); + const hiddenAnnotationIds = new Set(); + for (const editor of this.#editors.values()) { + editor.disableEditing(); + if (!editor.annotationElementId || editor.serialize() !== null) { + hiddenAnnotationIds.add(editor.annotationElementId); + continue; + } + this.getEditableAnnotation(editor.annotationElementId)?.show(); + editor.remove(); + } + if (this.#annotationLayer) { + const editables = this.#annotationLayer.getEditableAnnotations(); + for (const editable of editables) { + const { + id + } = editable.data; + if (hiddenAnnotationIds.has(id) || this.#uiManager.isDeletedAnnotationElement(id)) { + continue; + } + editable.show(); + } + } + this.#cleanup(); + if (this.isEmpty) { + this.div.hidden = true; + } + const { + classList + } = this.div; + for (const editorType of AnnotationEditorLayer.#editorTypes.values()) { + classList.remove(`${editorType._type}Editing`); + } + this.disableTextSelection(); + this.#isDisabling = false; + } + getEditableAnnotation(id) { + return this.#annotationLayer?.getEditableAnnotation(id) || null; + } + setActiveEditor(editor) { + const currentActive = this.#uiManager.getActive(); + if (currentActive === editor) { + return; + } + this.#uiManager.setActiveEditor(editor); + } + enableTextSelection() { + if (this.#textLayer?.div) { + document.addEventListener("selectstart", this.#boundSelectionStart); + } + } + disableTextSelection() { + if (this.#textLayer?.div) { + document.removeEventListener("selectstart", this.#boundSelectionStart); + } + } + enableClick() { + this.div.addEventListener("pointerdown", this.#boundPointerdown); + this.div.addEventListener("pointerup", this.#boundPointerup); + } + disableClick() { + this.div.removeEventListener("pointerdown", this.#boundPointerdown); + this.div.removeEventListener("pointerup", this.#boundPointerup); + } + attach(editor) { + this.#editors.set(editor.id, editor); + const { + annotationElementId + } = editor; + if (annotationElementId && this.#uiManager.isDeletedAnnotationElement(annotationElementId)) { + this.#uiManager.removeDeletedAnnotationElement(editor); + } + } + detach(editor) { + this.#editors.delete(editor.id); + this.#accessibilityManager?.removePointerInTextLayer(editor.contentDiv); + if (!this.#isDisabling && editor.annotationElementId) { + this.#uiManager.addDeletedAnnotationElement(editor); + } + } + remove(editor) { + this.detach(editor); + this.#uiManager.removeEditor(editor); + editor.div.remove(); + editor.isAttachedToDOM = false; + if (!this.#isCleaningUp) { + this.addInkEditorIfNeeded(false); + } + } + changeParent(editor) { + if (editor.parent === this) { + return; + } + if (editor.annotationElementId) { + this.#uiManager.addDeletedAnnotationElement(editor.annotationElementId); + editor_editor.AnnotationEditor.deleteAnnotationElement(editor); + editor.annotationElementId = null; + } + this.attach(editor); + editor.parent?.detach(editor); + editor.setParent(this); + if (editor.div && editor.isAttachedToDOM) { + editor.div.remove(); + this.div.append(editor.div); + } + } + add(editor) { + this.changeParent(editor); + this.#uiManager.addEditor(editor); + this.attach(editor); + if (!editor.isAttachedToDOM) { + const div = editor.render(); + this.div.append(div); + editor.isAttachedToDOM = true; + } + editor.fixAndSetPosition(); + editor.onceAdded(); + this.#uiManager.addToAnnotationStorage(editor); + } + moveEditorInDOM(editor) { + if (!editor.isAttachedToDOM) { + return; + } + const { + activeElement + } = document; + if (editor.div.contains(activeElement) && !this.#editorFocusTimeoutId) { + editor._focusEventsAllowed = false; + this.#editorFocusTimeoutId = setTimeout(() => { + this.#editorFocusTimeoutId = null; + if (!editor.div.contains(document.activeElement)) { + editor.div.addEventListener("focusin", () => { + editor._focusEventsAllowed = true; + }, { + once: true + }); + activeElement.focus(); + } else { + editor._focusEventsAllowed = true; + } + }, 0); + } + editor._structTreeParentId = this.#accessibilityManager?.moveElementInDOM(this.div, editor.div, editor.contentDiv, true); + } + addOrRebuild(editor) { + if (editor.needsToBeRebuilt()) { + editor.parent ||= this; + editor.rebuild(); + } else { + this.add(editor); + } + } + addUndoableEditor(editor) { + const cmd = () => editor._uiManager.rebuild(editor); + const undo = () => { + editor.remove(); + }; + this.addCommands({ + cmd, + undo, + mustExec: false + }); + } + getNextId() { + return this.#uiManager.getId(); + } + get #currentEditorType() { + return AnnotationEditorLayer.#editorTypes.get(this.#uiManager.getMode()); + } + #createNewEditor(params) { + const editorType = this.#currentEditorType; + return editorType ? new editorType.prototype.constructor(params) : null; + } + canCreateNewEmptyEditor() { + return this.#currentEditorType?.canCreateNewEmptyEditor(); + } + pasteEditor(mode, params) { + this.#uiManager.updateToolbar(mode); + this.#uiManager.updateMode(mode); + const { + offsetX, + offsetY + } = this.#getCenterPoint(); + const id = this.getNextId(); + const editor = this.#createNewEditor({ + parent: this, + id, + x: offsetX, + y: offsetY, + uiManager: this.#uiManager, + isCentered: true, + ...params + }); + if (editor) { + this.add(editor); + } + } + deserialize(data) { + return AnnotationEditorLayer.#editorTypes.get(data.annotationType ?? data.annotationEditorType)?.deserialize(data, this, this.#uiManager) || null; + } + #createAndAddNewEditor(event, isCentered, data = {}) { + const id = this.getNextId(); + const editor = this.#createNewEditor({ + parent: this, + id, + x: event.offsetX, + y: event.offsetY, + uiManager: this.#uiManager, + isCentered, + ...data + }); + if (editor) { + this.add(editor); + } + return editor; + } + #getCenterPoint() { + const { + x, + y, + width, + height + } = this.div.getBoundingClientRect(); + const tlX = Math.max(0, x); + const tlY = Math.max(0, y); + const brX = Math.min(window.innerWidth, x + width); + const brY = Math.min(window.innerHeight, y + height); + const centerX = (tlX + brX) / 2 - x; + const centerY = (tlY + brY) / 2 - y; + const [offsetX, offsetY] = this.viewport.rotation % 180 === 0 ? [centerX, centerY] : [centerY, centerX]; + return { + offsetX, + offsetY + }; + } + addNewEditor() { + this.#createAndAddNewEditor(this.#getCenterPoint(), true); + } + setSelected(editor) { + this.#uiManager.setSelected(editor); + } + toggleSelected(editor) { + this.#uiManager.toggleSelected(editor); + } + isSelected(editor) { + return this.#uiManager.isSelected(editor); + } + unselect(editor) { + this.#uiManager.unselect(editor); + } + selectionStart(_event) { + this.#textLayer?.div.addEventListener("pointerup", this.#boundPointerUpAfterSelection, { + once: true + }); + } + pointerUpAfterSelection(event) { + const selection = document.getSelection(); + if (selection.rangeCount === 0) { + return; + } + const range = selection.getRangeAt(0); + if (range.collapsed) { + return; + } + if (!this.#textLayer?.div.contains(range.commonAncestorContainer)) { + return; + } + const { + x: layerX, + y: layerY, + width: parentWidth, + height: parentHeight + } = this.#textLayer.div.getBoundingClientRect(); + const bboxes = range.getClientRects(); + let rotator; + switch (this.viewport.rotation) { + case 90: + rotator = (x, y, w, h) => ({ + x: (y - layerY) / parentHeight, + y: 1 - (x + w - layerX) / parentWidth, + width: h / parentHeight, + height: w / parentWidth + }); + break; + case 180: + rotator = (x, y, w, h) => ({ + x: 1 - (x + w - layerX) / parentWidth, + y: 1 - (y + h - layerY) / parentHeight, + width: w / parentWidth, + height: h / parentHeight + }); + break; + case 270: + rotator = (x, y, w, h) => ({ + x: 1 - (y + h - layerY) / parentHeight, + y: (x - layerX) / parentWidth, + width: h / parentHeight, + height: w / parentWidth + }); + break; + default: + rotator = (x, y, w, h) => ({ + x: (x - layerX) / parentWidth, + y: (y - layerY) / parentHeight, + width: w / parentWidth, + height: h / parentHeight + }); + break; + } + const boxes = []; + for (const { + x, + y, + width, + height + } of bboxes) { + if (width === 0 || height === 0) { + continue; + } + boxes.push(rotator(x, y, width, height)); + } + if (boxes.length !== 0) { + this.#createAndAddNewEditor(event, false, { + boxes + }); + } + selection.empty(); + } + pointerup(event) { + const { + isMac + } = util.FeatureTest.platform; + if (event.button !== 0 || event.ctrlKey && isMac) { + return; + } + if (event.target !== this.div) { + return; + } + if (!this.#hadPointerDown) { + return; + } + this.#hadPointerDown = false; + if (!this.#allowClick) { + this.#allowClick = true; + return; + } + if (this.#uiManager.getMode() === util.AnnotationEditorType.STAMP) { + this.#uiManager.unselectAll(); + return; + } + this.#createAndAddNewEditor(event, false); + } + pointerdown(event) { + if (this.#uiManager.getMode() === util.AnnotationEditorType.HIGHLIGHT) { + this.enableTextSelection(); + } + if (this.#hadPointerDown) { + this.#hadPointerDown = false; + return; + } + const { + isMac + } = util.FeatureTest.platform; + if (event.button !== 0 || event.ctrlKey && isMac) { + return; + } + if (event.target !== this.div) { + return; + } + this.#hadPointerDown = true; + const editor = this.#uiManager.getActive(); + this.#allowClick = !editor || editor.isEmpty(); + } + findNewParent(editor, x, y) { + const layer = this.#uiManager.findParent(x, y); + if (layer === null || layer === this) { + return false; + } + layer.changeParent(editor); + return true; + } + destroy() { + if (this.#uiManager.getActive()?.parent === this) { + this.#uiManager.commitOrRemove(); + this.#uiManager.setActiveEditor(null); + } + if (this.#editorFocusTimeoutId) { + clearTimeout(this.#editorFocusTimeoutId); + this.#editorFocusTimeoutId = null; + } + for (const editor of this.#editors.values()) { + this.#accessibilityManager?.removePointerInTextLayer(editor.contentDiv); + editor.setParent(null); + editor.isAttachedToDOM = false; + editor.div.remove(); + } + this.div = null; + this.#editors.clear(); + this.#uiManager.removeLayer(this); + } + #cleanup() { + this.#isCleaningUp = true; + for (const editor of this.#editors.values()) { + if (editor.isEmpty()) { + editor.remove(); + } + } + this.#isCleaningUp = false; + } + render({ + viewport + }) { + this.viewport = viewport; + (0,display_utils.setLayerDimensions)(this.div, viewport); + for (const editor of this.#uiManager.getEditors(this.pageIndex)) { + this.add(editor); + } + this.updateMode(); + } + update({ + viewport + }) { + this.#uiManager.commitOrRemove(); + const oldRotation = this.viewport.rotation; + const rotation = viewport.rotation; + this.viewport = viewport; + (0,display_utils.setLayerDimensions)(this.div, { + rotation + }); + if (oldRotation !== rotation) { + for (const editor of this.#editors.values()) { + editor.rotate(rotation); + } + } + this.updateMode(); + } + get pageDimensions() { + const { + pageWidth, + pageHeight + } = this.viewport.rawDims; + return [pageWidth, pageHeight]; + } +} + + +/***/ }), + +/***/ 97: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ ColorPicker: () => (/* binding */ ColorPicker) +/* harmony export */ }); +/* harmony import */ var _shared_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(266); +/* harmony import */ var _tools_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(812); +/* harmony import */ var _display_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(473); + + + +class ColorPicker { + #boundKeyDown = this.#keyDown.bind(this); + #button = null; + #buttonSwatch = null; + #defaultColor; + #dropdown = null; + #dropdownWasFromKeyboard = false; + #isMainColorPicker = false; + #eventBus; + #uiManager = null; + static get _keyboardManager() { + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.shadow)(this, "_keyboardManager", new _tools_js__WEBPACK_IMPORTED_MODULE_1__.KeyboardManager([[["Escape", "mac+Escape"], ColorPicker.prototype._hideDropdownFromKeyboard], [[" ", "mac+ "], ColorPicker.prototype._colorSelectFromKeyboard], [["ArrowDown", "ArrowRight", "mac+ArrowDown", "mac+ArrowRight"], ColorPicker.prototype._moveToNext], [["ArrowUp", "ArrowLeft", "mac+ArrowUp", "mac+ArrowLeft"], ColorPicker.prototype._moveToPrevious], [["Home", "mac+Home"], ColorPicker.prototype._moveToBeginning], [["End", "mac+End"], ColorPicker.prototype._moveToEnd]])); + } + constructor({ + editor = null, + uiManager = null + }) { + this.#isMainColorPicker = !editor; + this.#uiManager = editor?._uiManager || uiManager; + this.#eventBus = this.#uiManager._eventBus; + this.#defaultColor = editor?.color || this.#uiManager?.highlightColors.values().next().value || "#FFFF98"; + } + renderButton() { + const button = this.#button = document.createElement("button"); + button.className = "colorPicker"; + button.tabIndex = "0"; + button.setAttribute("data-l10n-id", "pdfjs-editor-colorpicker-button"); + button.setAttribute("aria-haspopup", true); + button.addEventListener("click", this.#openDropdown.bind(this)); + const swatch = this.#buttonSwatch = document.createElement("span"); + swatch.className = "swatch"; + swatch.style.backgroundColor = this.#defaultColor; + button.append(swatch); + return button; + } + renderMainDropdown() { + const dropdown = this.#dropdown = this.#getDropdownRoot(_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR); + dropdown.setAttribute("aria-orientation", "horizontal"); + dropdown.setAttribute("aria-labelledby", "highlightColorPickerLabel"); + return dropdown; + } + #getDropdownRoot(paramType) { + const div = document.createElement("div"); + div.addEventListener("contextmenu", _display_utils_js__WEBPACK_IMPORTED_MODULE_2__.noContextMenu); + div.className = "dropdown"; + div.role = "listbox"; + div.setAttribute("aria-multiselectable", false); + div.setAttribute("aria-orientation", "vertical"); + div.setAttribute("data-l10n-id", "pdfjs-editor-colorpicker-dropdown"); + for (const [name, color] of this.#uiManager.highlightColors) { + const button = document.createElement("button"); + button.tabIndex = "0"; + button.role = "option"; + button.setAttribute("data-color", color); + button.title = name; + button.setAttribute("data-l10n-id", `pdfjs-editor-colorpicker-${name}`); + const swatch = document.createElement("span"); + button.append(swatch); + swatch.className = "swatch"; + swatch.style.backgroundColor = color; + button.setAttribute("aria-selected", color === this.#defaultColor); + button.addEventListener("click", this.#colorSelect.bind(this, paramType, color)); + div.append(button); + } + div.addEventListener("keydown", this.#boundKeyDown); + return div; + } + #colorSelect(type, color, event) { + event.stopPropagation(); + this.#eventBus.dispatch("switchannotationeditorparams", { + source: this, + type, + value: color + }); + } + _colorSelectFromKeyboard(event) { + const color = event.target.getAttribute("data-color"); + if (!color) { + return; + } + this.#colorSelect(color, event); + } + _moveToNext(event) { + if (event.target === this.#button) { + this.#dropdown.firstChild?.focus(); + return; + } + event.target.nextSibling?.focus(); + } + _moveToPrevious(event) { + event.target.previousSibling?.focus(); + } + _moveToBeginning() { + this.#dropdown.firstChild?.focus(); + } + _moveToEnd() { + this.#dropdown.lastChild?.focus(); + } + #keyDown(event) { + ColorPicker._keyboardManager.exec(this, event); + } + #openDropdown(event) { + if (this.#dropdown && !this.#dropdown.classList.contains("hidden")) { + this.hideDropdown(); + return; + } + this.#button.addEventListener("keydown", this.#boundKeyDown); + this.#dropdownWasFromKeyboard = event.detail === 0; + if (this.#dropdown) { + this.#dropdown.classList.remove("hidden"); + return; + } + const root = this.#dropdown = this.#getDropdownRoot(_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorParamsType.HIGHLIGHT_COLOR); + this.#button.append(root); + } + hideDropdown() { + this.#dropdown?.classList.add("hidden"); + } + _hideDropdownFromKeyboard() { + if (this.#isMainColorPicker || !this.#dropdown || this.#dropdown.classList.contains("hidden")) { + return; + } + this.hideDropdown(); + this.#button.removeEventListener("keydown", this.#boundKeyDown); + this.#button.focus({ + preventScroll: true, + focusVisible: this.#dropdownWasFromKeyboard + }); + } + updateColor(color) { + if (this.#buttonSwatch) { + this.#buttonSwatch.style.backgroundColor = color; + } + if (!this.#dropdown) { + return; + } + const i = this.#uiManager.highlightColors.values(); + for (const child of this.#dropdown.children) { + child.setAttribute("aria-selected", i.next().value === color); + } + } + destroy() { + this.#button?.remove(); + this.#button = null; + this.#buttonSwatch = null; + this.#dropdown?.remove(); + this.#dropdown = null; + } +} + + +/***/ }), + +/***/ 115: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + AnnotationEditor: () => (/* binding */ AnnotationEditor) +}); + +// EXTERNAL MODULE: ./src/display/editor/tools.js +var tools = __webpack_require__(812); +// EXTERNAL MODULE: ./src/shared/util.js +var util = __webpack_require__(266); +// EXTERNAL MODULE: ./src/display/display_utils.js +var display_utils = __webpack_require__(473); +;// CONCATENATED MODULE: ./src/display/editor/alt_text.js + +class AltText { + #altText = ""; + #altTextDecorative = false; + #altTextButton = null; + #altTextTooltip = null; + #altTextTooltipTimeout = null; + #altTextWasFromKeyBoard = false; + #editor = null; + static _l10nPromise = null; + constructor(editor) { + this.#editor = editor; + } + static initialize(l10nPromise) { + AltText._l10nPromise ||= l10nPromise; + } + async render() { + const altText = this.#altTextButton = document.createElement("button"); + altText.className = "altText"; + const msg = await AltText._l10nPromise.get("pdfjs-editor-alt-text-button-label"); + altText.textContent = msg; + altText.setAttribute("aria-label", msg); + altText.tabIndex = "0"; + altText.addEventListener("contextmenu", display_utils.noContextMenu); + altText.addEventListener("pointerdown", event => event.stopPropagation()); + const onClick = event => { + event.preventDefault(); + this.#editor._uiManager.editAltText(this.#editor); + }; + altText.addEventListener("click", onClick, { + capture: true + }); + altText.addEventListener("keydown", event => { + if (event.target === altText && event.key === "Enter") { + this.#altTextWasFromKeyBoard = true; + onClick(event); + } + }); + await this.#setState(); + return altText; + } + finish() { + if (!this.#altTextButton) { + return; + } + this.#altTextButton.focus({ + focusVisible: this.#altTextWasFromKeyBoard + }); + this.#altTextWasFromKeyBoard = false; + } + get data() { + return { + altText: this.#altText, + decorative: this.#altTextDecorative + }; + } + set data({ + altText, + decorative + }) { + if (this.#altText === altText && this.#altTextDecorative === decorative) { + return; + } + this.#altText = altText; + this.#altTextDecorative = decorative; + this.#setState(); + } + toggle(enabled = false) { + if (!this.#altTextButton) { + return; + } + if (!enabled && this.#altTextTooltipTimeout) { + clearTimeout(this.#altTextTooltipTimeout); + this.#altTextTooltipTimeout = null; + } + this.#altTextButton.disabled = !enabled; + } + destroy() { + this.#altTextButton?.remove(); + this.#altTextButton = null; + this.#altTextTooltip = null; + } + async #setState() { + const button = this.#altTextButton; + if (!button) { + return; + } + if (!this.#altText && !this.#altTextDecorative) { + button.classList.remove("done"); + this.#altTextTooltip?.remove(); + return; + } + button.classList.add("done"); + AltText._l10nPromise.get("pdfjs-editor-alt-text-edit-button-label").then(msg => { + button.setAttribute("aria-label", msg); + }); + let tooltip = this.#altTextTooltip; + if (!tooltip) { + this.#altTextTooltip = tooltip = document.createElement("span"); + tooltip.className = "tooltip"; + tooltip.setAttribute("role", "tooltip"); + const id = tooltip.id = `alt-text-tooltip-${this.#editor.id}`; + button.setAttribute("aria-describedby", id); + const DELAY_TO_SHOW_TOOLTIP = 100; + button.addEventListener("mouseenter", () => { + this.#altTextTooltipTimeout = setTimeout(() => { + this.#altTextTooltipTimeout = null; + this.#altTextTooltip.classList.add("show"); + this.#editor._uiManager._eventBus.dispatch("reporttelemetry", { + source: this, + details: { + type: "editing", + subtype: this.#editor.editorType, + data: { + action: "alt_text_tooltip" + } + } + }); + }, DELAY_TO_SHOW_TOOLTIP); + }); + button.addEventListener("mouseleave", () => { + if (this.#altTextTooltipTimeout) { + clearTimeout(this.#altTextTooltipTimeout); + this.#altTextTooltipTimeout = null; + } + this.#altTextTooltip?.classList.remove("show"); + }); + } + tooltip.innerText = this.#altTextDecorative ? await AltText._l10nPromise.get("pdfjs-editor-alt-text-decorative-tooltip") : this.#altText; + if (!tooltip.parentNode) { + button.append(tooltip); + } + const element = this.#editor.getImageForAltText(); + element?.setAttribute("aria-describedby", tooltip.id); + } +} + +;// CONCATENATED MODULE: ./src/display/editor/toolbar.js + +class EditorToolbar { + #toolbar = null; + #colorPicker = null; + #editor; + #buttons = null; + constructor(editor) { + this.#editor = editor; + } + render() { + const editToolbar = this.#toolbar = document.createElement("div"); + editToolbar.className = "editToolbar"; + editToolbar.addEventListener("contextmenu", display_utils.noContextMenu); + editToolbar.addEventListener("pointerdown", EditorToolbar.#pointerDown); + const buttons = this.#buttons = document.createElement("div"); + buttons.className = "buttons"; + editToolbar.append(buttons); + const position = this.#editor.toolbarPosition; + if (position) { + const { + style + } = editToolbar; + const x = this.#editor._uiManager.direction === "ltr" ? 1 - position[0] : position[0]; + style.insetInlineEnd = `${100 * x}%`; + style.top = `calc(${100 * position[1]}% + var(--editor-toolbar-vert-offset))`; + } + this.#addDeleteButton(); + return editToolbar; + } + static #pointerDown(e) { + e.stopPropagation(); + } + #focusIn(e) { + this.#editor._focusEventsAllowed = false; + e.preventDefault(); + e.stopPropagation(); + } + #focusOut(e) { + this.#editor._focusEventsAllowed = true; + e.preventDefault(); + e.stopPropagation(); + } + #addListenersToElement(element) { + element.addEventListener("focusin", this.#focusIn.bind(this), { + capture: true + }); + element.addEventListener("focusout", this.#focusOut.bind(this), { + capture: true + }); + element.addEventListener("contextmenu", display_utils.noContextMenu); + } + hide() { + this.#toolbar.classList.add("hidden"); + this.#colorPicker?.hideDropdown(); + } + show() { + this.#toolbar.classList.remove("hidden"); + } + #addDeleteButton() { + const button = document.createElement("button"); + button.className = "delete"; + button.tabIndex = 0; + button.setAttribute("data-l10n-id", `pdfjs-editor-remove-${this.#editor.editorType}-button`); + this.#addListenersToElement(button); + button.addEventListener("click", e => { + this.#editor._uiManager.delete(); + }); + this.#buttons.append(button); + } + get #divider() { + const divider = document.createElement("div"); + divider.className = "divider"; + return divider; + } + addAltTextButton(button) { + this.#addListenersToElement(button); + this.#buttons.prepend(button, this.#divider); + } + addColorPicker(colorPicker) { + this.#colorPicker = colorPicker; + const button = colorPicker.renderButton(); + this.#addListenersToElement(button); + this.#buttons.prepend(button, this.#divider); + } + remove() { + this.#toolbar.remove(); + this.#colorPicker?.destroy(); + this.#colorPicker = null; + } +} + +;// CONCATENATED MODULE: ./src/display/editor/editor.js + + + + + +class AnnotationEditor { + #allResizerDivs = null; + #altText = null; + #keepAspectRatio = false; + #resizersDiv = null; + #savedDimensions = null; + #boundFocusin = this.focusin.bind(this); + #boundFocusout = this.focusout.bind(this); + #editToolbar = null; + #focusedResizerName = ""; + #hasBeenClicked = false; + #isEditing = false; + #isInEditMode = false; + #isResizerEnabledForKeyboard = false; + #moveInDOMTimeout = null; + _initialOptions = Object.create(null); + _uiManager = null; + _focusEventsAllowed = true; + _l10nPromise = null; + #isDraggable = false; + #zIndex = AnnotationEditor._zIndex++; + static _borderLineWidth = -1; + static _colorManager = new tools.ColorManager(); + static _zIndex = 1; + static get _resizerKeyboardManager() { + const resize = AnnotationEditor.prototype._resizeWithKeyboard; + const small = tools.AnnotationEditorUIManager.TRANSLATE_SMALL; + const big = tools.AnnotationEditorUIManager.TRANSLATE_BIG; + return (0,util.shadow)(this, "_resizerKeyboardManager", new tools.KeyboardManager([[["ArrowLeft", "mac+ArrowLeft"], resize, { + args: [-small, 0] + }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], resize, { + args: [-big, 0] + }], [["ArrowRight", "mac+ArrowRight"], resize, { + args: [small, 0] + }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], resize, { + args: [big, 0] + }], [["ArrowUp", "mac+ArrowUp"], resize, { + args: [0, -small] + }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], resize, { + args: [0, -big] + }], [["ArrowDown", "mac+ArrowDown"], resize, { + args: [0, small] + }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], resize, { + args: [0, big] + }], [["Escape", "mac+Escape"], AnnotationEditor.prototype._stopResizingWithKeyboard]])); + } + constructor(parameters) { + if (this.constructor === AnnotationEditor) { + (0,util.unreachable)("Cannot initialize AnnotationEditor."); + } + this.parent = parameters.parent; + this.id = parameters.id; + this.width = this.height = null; + this.pageIndex = parameters.parent.pageIndex; + this.name = parameters.name; + this.div = null; + this._uiManager = parameters.uiManager; + this.annotationElementId = null; + this._willKeepAspectRatio = false; + this._initialOptions.isCentered = parameters.isCentered; + this._structTreeParentId = null; + const { + rotation, + rawDims: { + pageWidth, + pageHeight, + pageX, + pageY + } + } = this.parent.viewport; + this.rotation = rotation; + this.pageRotation = (360 + rotation - this._uiManager.viewParameters.rotation) % 360; + this.pageDimensions = [pageWidth, pageHeight]; + this.pageTranslation = [pageX, pageY]; + const [width, height] = this.parentDimensions; + this.x = parameters.x / width; + this.y = parameters.y / height; + this.isAttachedToDOM = false; + this.deleted = false; + } + get editorType() { + return Object.getPrototypeOf(this).constructor._type; + } + static get _defaultLineColor() { + return (0,util.shadow)(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText")); + } + static deleteAnnotationElement(editor) { + const fakeEditor = new FakeEditor({ + id: editor.parent.getNextId(), + parent: editor.parent, + uiManager: editor._uiManager + }); + fakeEditor.annotationElementId = editor.annotationElementId; + fakeEditor.deleted = true; + fakeEditor._uiManager.addToAnnotationStorage(fakeEditor); + } + static initialize(l10n, options = null) { + AnnotationEditor._l10nPromise ||= new Map(["pdfjs-editor-alt-text-button-label", "pdfjs-editor-alt-text-edit-button-label", "pdfjs-editor-alt-text-decorative-tooltip", "pdfjs-editor-resizer-label-topLeft", "pdfjs-editor-resizer-label-topMiddle", "pdfjs-editor-resizer-label-topRight", "pdfjs-editor-resizer-label-middleRight", "pdfjs-editor-resizer-label-bottomRight", "pdfjs-editor-resizer-label-bottomMiddle", "pdfjs-editor-resizer-label-bottomLeft", "pdfjs-editor-resizer-label-middleLeft"].map(str => [str, l10n.get(str.replaceAll(/([A-Z])/g, c => `-${c.toLowerCase()}`))])); + if (options?.strings) { + for (const str of options.strings) { + AnnotationEditor._l10nPromise.set(str, l10n.get(str)); + } + } + if (AnnotationEditor._borderLineWidth !== -1) { + return; + } + const style = getComputedStyle(document.documentElement); + AnnotationEditor._borderLineWidth = parseFloat(style.getPropertyValue("--outline-width")) || 0; + } + static updateDefaultParams(_type, _value) {} + static get defaultPropertiesToUpdate() { + return []; + } + static isHandlingMimeForPasting(mime) { + return false; + } + static paste(item, parent) { + (0,util.unreachable)("Not implemented"); + } + get propertiesToUpdate() { + return []; + } + get _isDraggable() { + return this.#isDraggable; + } + set _isDraggable(value) { + this.#isDraggable = value; + this.div?.classList.toggle("draggable", value); + } + get isEnterHandled() { + return true; + } + center() { + const [pageWidth, pageHeight] = this.pageDimensions; + switch (this.parentRotation) { + case 90: + this.x -= this.height * pageHeight / (pageWidth * 2); + this.y += this.width * pageWidth / (pageHeight * 2); + break; + case 180: + this.x += this.width / 2; + this.y += this.height / 2; + break; + case 270: + this.x += this.height * pageHeight / (pageWidth * 2); + this.y -= this.width * pageWidth / (pageHeight * 2); + break; + default: + this.x -= this.width / 2; + this.y -= this.height / 2; + break; + } + this.fixAndSetPosition(); + } + addCommands(params) { + this._uiManager.addCommands(params); + } + get currentLayer() { + return this._uiManager.currentLayer; + } + setInBackground() { + this.div.style.zIndex = 0; + } + setInForeground() { + this.div.style.zIndex = this.#zIndex; + } + setParent(parent) { + if (parent !== null) { + this.pageIndex = parent.pageIndex; + this.pageDimensions = parent.pageDimensions; + } else { + this.#stopResizing(); + } + this.parent = parent; + } + focusin(event) { + if (!this._focusEventsAllowed) { + return; + } + if (!this.#hasBeenClicked) { + this.parent.setSelected(this); + } else { + this.#hasBeenClicked = false; + } + } + focusout(event) { + if (!this._focusEventsAllowed) { + return; + } + if (!this.isAttachedToDOM) { + return; + } + const target = event.relatedTarget; + if (target?.closest(`#${this.id}`)) { + return; + } + event.preventDefault(); + if (!this.parent?.isMultipleSelection) { + this.commitOrRemove(); + } + } + commitOrRemove() { + if (this.isEmpty()) { + this.remove(); + } else { + this.commit(); + } + } + commit() { + this.addToAnnotationStorage(); + } + addToAnnotationStorage() { + this._uiManager.addToAnnotationStorage(this); + } + setAt(x, y, tx, ty) { + const [width, height] = this.parentDimensions; + [tx, ty] = this.screenToPageTranslation(tx, ty); + this.x = (x + tx) / width; + this.y = (y + ty) / height; + this.fixAndSetPosition(); + } + #translate([width, height], x, y) { + [x, y] = this.screenToPageTranslation(x, y); + this.x += x / width; + this.y += y / height; + this.fixAndSetPosition(); + } + translate(x, y) { + this.#translate(this.parentDimensions, x, y); + } + translateInPage(x, y) { + this.#translate(this.pageDimensions, x, y); + this.div.scrollIntoView({ + block: "nearest" + }); + } + drag(tx, ty) { + const [parentWidth, parentHeight] = this.parentDimensions; + this.x += tx / parentWidth; + this.y += ty / parentHeight; + if (this.parent && (this.x < 0 || this.x > 1 || this.y < 0 || this.y > 1)) { + const { + x, + y + } = this.div.getBoundingClientRect(); + if (this.parent.findNewParent(this, x, y)) { + this.x -= Math.floor(this.x); + this.y -= Math.floor(this.y); + } + } + let { + x, + y + } = this; + const [bx, by] = this.#getBaseTranslation(); + x += bx; + y += by; + this.div.style.left = `${(100 * x).toFixed(2)}%`; + this.div.style.top = `${(100 * y).toFixed(2)}%`; + this.div.scrollIntoView({ + block: "nearest" + }); + } + #getBaseTranslation() { + const [parentWidth, parentHeight] = this.parentDimensions; + const { + _borderLineWidth + } = AnnotationEditor; + const x = _borderLineWidth / parentWidth; + const y = _borderLineWidth / parentHeight; + switch (this.rotation) { + case 90: + return [-x, y]; + case 180: + return [x, y]; + case 270: + return [x, -y]; + default: + return [-x, -y]; + } + } + fixAndSetPosition(rotation = this.rotation) { + const [pageWidth, pageHeight] = this.pageDimensions; + let { + x, + y, + width, + height + } = this; + width *= pageWidth; + height *= pageHeight; + x *= pageWidth; + y *= pageHeight; + switch (rotation) { + case 0: + x = Math.max(0, Math.min(pageWidth - width, x)); + y = Math.max(0, Math.min(pageHeight - height, y)); + break; + case 90: + x = Math.max(0, Math.min(pageWidth - height, x)); + y = Math.min(pageHeight, Math.max(width, y)); + break; + case 180: + x = Math.min(pageWidth, Math.max(width, x)); + y = Math.min(pageHeight, Math.max(height, y)); + break; + case 270: + x = Math.min(pageWidth, Math.max(height, x)); + y = Math.max(0, Math.min(pageHeight - width, y)); + break; + } + this.x = x /= pageWidth; + this.y = y /= pageHeight; + const [bx, by] = this.#getBaseTranslation(); + x += bx; + y += by; + const { + style + } = this.div; + style.left = `${(100 * x).toFixed(2)}%`; + style.top = `${(100 * y).toFixed(2)}%`; + this.moveInDOM(); + } + static #rotatePoint(x, y, angle) { + switch (angle) { + case 90: + return [y, -x]; + case 180: + return [-x, -y]; + case 270: + return [-y, x]; + default: + return [x, y]; + } + } + screenToPageTranslation(x, y) { + return AnnotationEditor.#rotatePoint(x, y, this.parentRotation); + } + pageTranslationToScreen(x, y) { + return AnnotationEditor.#rotatePoint(x, y, 360 - this.parentRotation); + } + #getRotationMatrix(rotation) { + switch (rotation) { + case 90: + { + const [pageWidth, pageHeight] = this.pageDimensions; + return [0, -pageWidth / pageHeight, pageHeight / pageWidth, 0]; + } + case 180: + return [-1, 0, 0, -1]; + case 270: + { + const [pageWidth, pageHeight] = this.pageDimensions; + return [0, pageWidth / pageHeight, -pageHeight / pageWidth, 0]; + } + default: + return [1, 0, 0, 1]; + } + } + get parentScale() { + return this._uiManager.viewParameters.realScale; + } + get parentRotation() { + return (this._uiManager.viewParameters.rotation + this.pageRotation) % 360; + } + get parentDimensions() { + const { + parentScale, + pageDimensions: [pageWidth, pageHeight] + } = this; + const scaledWidth = pageWidth * parentScale; + const scaledHeight = pageHeight * parentScale; + return util.FeatureTest.isCSSRoundSupported ? [Math.round(scaledWidth), Math.round(scaledHeight)] : [scaledWidth, scaledHeight]; + } + setDims(width, height) { + const [parentWidth, parentHeight] = this.parentDimensions; + this.div.style.width = `${(100 * width / parentWidth).toFixed(2)}%`; + if (!this.#keepAspectRatio) { + this.div.style.height = `${(100 * height / parentHeight).toFixed(2)}%`; + } + } + fixDims() { + const { + style + } = this.div; + const { + height, + width + } = style; + const widthPercent = width.endsWith("%"); + const heightPercent = !this.#keepAspectRatio && height.endsWith("%"); + if (widthPercent && heightPercent) { + return; + } + const [parentWidth, parentHeight] = this.parentDimensions; + if (!widthPercent) { + style.width = `${(100 * parseFloat(width) / parentWidth).toFixed(2)}%`; + } + if (!this.#keepAspectRatio && !heightPercent) { + style.height = `${(100 * parseFloat(height) / parentHeight).toFixed(2)}%`; + } + } + getInitialTranslation() { + return [0, 0]; + } + #createResizers() { + if (this.#resizersDiv) { + return; + } + this.#resizersDiv = document.createElement("div"); + this.#resizersDiv.classList.add("resizers"); + const classes = this._willKeepAspectRatio ? ["topLeft", "topRight", "bottomRight", "bottomLeft"] : ["topLeft", "topMiddle", "topRight", "middleRight", "bottomRight", "bottomMiddle", "bottomLeft", "middleLeft"]; + for (const name of classes) { + const div = document.createElement("div"); + this.#resizersDiv.append(div); + div.classList.add("resizer", name); + div.setAttribute("data-resizer-name", name); + div.addEventListener("pointerdown", this.#resizerPointerdown.bind(this, name)); + div.addEventListener("contextmenu", display_utils.noContextMenu); + div.tabIndex = -1; + } + this.div.prepend(this.#resizersDiv); + } + #resizerPointerdown(name, event) { + event.preventDefault(); + const { + isMac + } = util.FeatureTest.platform; + if (event.button !== 0 || event.ctrlKey && isMac) { + return; + } + this.#altText?.toggle(false); + const boundResizerPointermove = this.#resizerPointermove.bind(this, name); + const savedDraggable = this._isDraggable; + this._isDraggable = false; + const pointerMoveOptions = { + passive: true, + capture: true + }; + this.parent.togglePointerEvents(false); + window.addEventListener("pointermove", boundResizerPointermove, pointerMoveOptions); + const savedX = this.x; + const savedY = this.y; + const savedWidth = this.width; + const savedHeight = this.height; + const savedParentCursor = this.parent.div.style.cursor; + const savedCursor = this.div.style.cursor; + this.div.style.cursor = this.parent.div.style.cursor = window.getComputedStyle(event.target).cursor; + const pointerUpCallback = () => { + this.parent.togglePointerEvents(true); + this.#altText?.toggle(true); + this._isDraggable = savedDraggable; + window.removeEventListener("pointerup", pointerUpCallback); + window.removeEventListener("blur", pointerUpCallback); + window.removeEventListener("pointermove", boundResizerPointermove, pointerMoveOptions); + this.parent.div.style.cursor = savedParentCursor; + this.div.style.cursor = savedCursor; + this.#addResizeToUndoStack(savedX, savedY, savedWidth, savedHeight); + }; + window.addEventListener("pointerup", pointerUpCallback); + window.addEventListener("blur", pointerUpCallback); + } + #addResizeToUndoStack(savedX, savedY, savedWidth, savedHeight) { + const newX = this.x; + const newY = this.y; + const newWidth = this.width; + const newHeight = this.height; + if (newX === savedX && newY === savedY && newWidth === savedWidth && newHeight === savedHeight) { + return; + } + this.addCommands({ + cmd: () => { + this.width = newWidth; + this.height = newHeight; + this.x = newX; + this.y = newY; + const [parentWidth, parentHeight] = this.parentDimensions; + this.setDims(parentWidth * newWidth, parentHeight * newHeight); + this.fixAndSetPosition(); + }, + undo: () => { + this.width = savedWidth; + this.height = savedHeight; + this.x = savedX; + this.y = savedY; + const [parentWidth, parentHeight] = this.parentDimensions; + this.setDims(parentWidth * savedWidth, parentHeight * savedHeight); + this.fixAndSetPosition(); + }, + mustExec: true + }); + } + #resizerPointermove(name, event) { + const [parentWidth, parentHeight] = this.parentDimensions; + const savedX = this.x; + const savedY = this.y; + const savedWidth = this.width; + const savedHeight = this.height; + const minWidth = AnnotationEditor.MIN_SIZE / parentWidth; + const minHeight = AnnotationEditor.MIN_SIZE / parentHeight; + const round = x => Math.round(x * 10000) / 10000; + const rotationMatrix = this.#getRotationMatrix(this.rotation); + const transf = (x, y) => [rotationMatrix[0] * x + rotationMatrix[2] * y, rotationMatrix[1] * x + rotationMatrix[3] * y]; + const invRotationMatrix = this.#getRotationMatrix(360 - this.rotation); + const invTransf = (x, y) => [invRotationMatrix[0] * x + invRotationMatrix[2] * y, invRotationMatrix[1] * x + invRotationMatrix[3] * y]; + let getPoint; + let getOpposite; + let isDiagonal = false; + let isHorizontal = false; + switch (name) { + case "topLeft": + isDiagonal = true; + getPoint = (w, h) => [0, 0]; + getOpposite = (w, h) => [w, h]; + break; + case "topMiddle": + getPoint = (w, h) => [w / 2, 0]; + getOpposite = (w, h) => [w / 2, h]; + break; + case "topRight": + isDiagonal = true; + getPoint = (w, h) => [w, 0]; + getOpposite = (w, h) => [0, h]; + break; + case "middleRight": + isHorizontal = true; + getPoint = (w, h) => [w, h / 2]; + getOpposite = (w, h) => [0, h / 2]; + break; + case "bottomRight": + isDiagonal = true; + getPoint = (w, h) => [w, h]; + getOpposite = (w, h) => [0, 0]; + break; + case "bottomMiddle": + getPoint = (w, h) => [w / 2, h]; + getOpposite = (w, h) => [w / 2, 0]; + break; + case "bottomLeft": + isDiagonal = true; + getPoint = (w, h) => [0, h]; + getOpposite = (w, h) => [w, 0]; + break; + case "middleLeft": + isHorizontal = true; + getPoint = (w, h) => [0, h / 2]; + getOpposite = (w, h) => [w, h / 2]; + break; + } + const point = getPoint(savedWidth, savedHeight); + const oppositePoint = getOpposite(savedWidth, savedHeight); + let transfOppositePoint = transf(...oppositePoint); + const oppositeX = round(savedX + transfOppositePoint[0]); + const oppositeY = round(savedY + transfOppositePoint[1]); + let ratioX = 1; + let ratioY = 1; + let [deltaX, deltaY] = this.screenToPageTranslation(event.movementX, event.movementY); + [deltaX, deltaY] = invTransf(deltaX / parentWidth, deltaY / parentHeight); + if (isDiagonal) { + const oldDiag = Math.hypot(savedWidth, savedHeight); + ratioX = ratioY = Math.max(Math.min(Math.hypot(oppositePoint[0] - point[0] - deltaX, oppositePoint[1] - point[1] - deltaY) / oldDiag, 1 / savedWidth, 1 / savedHeight), minWidth / savedWidth, minHeight / savedHeight); + } else if (isHorizontal) { + ratioX = Math.max(minWidth, Math.min(1, Math.abs(oppositePoint[0] - point[0] - deltaX))) / savedWidth; + } else { + ratioY = Math.max(minHeight, Math.min(1, Math.abs(oppositePoint[1] - point[1] - deltaY))) / savedHeight; + } + const newWidth = round(savedWidth * ratioX); + const newHeight = round(savedHeight * ratioY); + transfOppositePoint = transf(...getOpposite(newWidth, newHeight)); + const newX = oppositeX - transfOppositePoint[0]; + const newY = oppositeY - transfOppositePoint[1]; + this.width = newWidth; + this.height = newHeight; + this.x = newX; + this.y = newY; + this.setDims(parentWidth * newWidth, parentHeight * newHeight); + this.fixAndSetPosition(); + } + altTextFinish() { + this.#altText?.finish(); + } + async addEditToolbar() { + if (this.#editToolbar || this.#isInEditMode) { + return this.#editToolbar; + } + this.#editToolbar = new EditorToolbar(this); + this.div.append(this.#editToolbar.render()); + if (this.#altText) { + this.#editToolbar.addAltTextButton(await this.#altText.render()); + } + return this.#editToolbar; + } + removeEditToolbar() { + if (!this.#editToolbar) { + return; + } + this.#editToolbar.remove(); + this.#editToolbar = null; + this.#altText?.destroy(); + } + getClientDimensions() { + return this.div.getBoundingClientRect(); + } + async addAltTextButton() { + if (this.#altText) { + return; + } + AltText.initialize(AnnotationEditor._l10nPromise); + this.#altText = new AltText(this); + await this.addEditToolbar(); + } + get altTextData() { + return this.#altText?.data; + } + set altTextData(data) { + if (!this.#altText) { + return; + } + this.#altText.data = data; + } + render() { + this.div = document.createElement("div"); + this.div.setAttribute("data-editor-rotation", (360 - this.rotation) % 360); + this.div.className = this.name; + this.div.setAttribute("id", this.id); + this.div.setAttribute("tabIndex", 0); + this.setInForeground(); + this.div.addEventListener("focusin", this.#boundFocusin); + this.div.addEventListener("focusout", this.#boundFocusout); + const [parentWidth, parentHeight] = this.parentDimensions; + if (this.parentRotation % 180 !== 0) { + this.div.style.maxWidth = `${(100 * parentHeight / parentWidth).toFixed(2)}%`; + this.div.style.maxHeight = `${(100 * parentWidth / parentHeight).toFixed(2)}%`; + } + const [tx, ty] = this.getInitialTranslation(); + this.translate(tx, ty); + (0,tools.bindEvents)(this, this.div, ["pointerdown"]); + return this.div; + } + pointerdown(event) { + const { + isMac + } = util.FeatureTest.platform; + if (event.button !== 0 || event.ctrlKey && isMac) { + event.preventDefault(); + return; + } + this.#hasBeenClicked = true; + if (this._isDraggable) { + this.#setUpDragSession(event); + return; + } + this.#selectOnPointerEvent(event); + } + #selectOnPointerEvent(event) { + const { + isMac + } = util.FeatureTest.platform; + if (event.ctrlKey && !isMac || event.shiftKey || event.metaKey && isMac) { + this.parent.toggleSelected(this); + } else { + this.parent.setSelected(this); + } + } + #setUpDragSession(event) { + const isSelected = this._uiManager.isSelected(this); + this._uiManager.setUpDragSession(); + let pointerMoveOptions, pointerMoveCallback; + if (isSelected) { + pointerMoveOptions = { + passive: true, + capture: true + }; + pointerMoveCallback = e => { + const [tx, ty] = this.screenToPageTranslation(e.movementX, e.movementY); + this._uiManager.dragSelectedEditors(tx, ty); + }; + window.addEventListener("pointermove", pointerMoveCallback, pointerMoveOptions); + } + const pointerUpCallback = () => { + window.removeEventListener("pointerup", pointerUpCallback); + window.removeEventListener("blur", pointerUpCallback); + if (isSelected) { + window.removeEventListener("pointermove", pointerMoveCallback, pointerMoveOptions); + } + this.#hasBeenClicked = false; + if (!this._uiManager.endDragSession()) { + this.#selectOnPointerEvent(event); + } + }; + window.addEventListener("pointerup", pointerUpCallback); + window.addEventListener("blur", pointerUpCallback); + } + moveInDOM() { + if (this.#moveInDOMTimeout) { + clearTimeout(this.#moveInDOMTimeout); + } + this.#moveInDOMTimeout = setTimeout(() => { + this.#moveInDOMTimeout = null; + this.parent?.moveEditorInDOM(this); + }, 0); + } + _setParentAndPosition(parent, x, y) { + parent.changeParent(this); + this.x = x; + this.y = y; + this.fixAndSetPosition(); + } + getRect(tx, ty, rotation = this.rotation) { + const scale = this.parentScale; + const [pageWidth, pageHeight] = this.pageDimensions; + const [pageX, pageY] = this.pageTranslation; + const shiftX = tx / scale; + const shiftY = ty / scale; + const x = this.x * pageWidth; + const y = this.y * pageHeight; + const width = this.width * pageWidth; + const height = this.height * pageHeight; + switch (rotation) { + case 0: + return [x + shiftX + pageX, pageHeight - y - shiftY - height + pageY, x + shiftX + width + pageX, pageHeight - y - shiftY + pageY]; + case 90: + return [x + shiftY + pageX, pageHeight - y + shiftX + pageY, x + shiftY + height + pageX, pageHeight - y + shiftX + width + pageY]; + case 180: + return [x - shiftX - width + pageX, pageHeight - y + shiftY + pageY, x - shiftX + pageX, pageHeight - y + shiftY + height + pageY]; + case 270: + return [x - shiftY - height + pageX, pageHeight - y - shiftX - width + pageY, x - shiftY + pageX, pageHeight - y - shiftX + pageY]; + default: + throw new Error("Invalid rotation"); + } + } + getRectInCurrentCoords(rect, pageHeight) { + const [x1, y1, x2, y2] = rect; + const width = x2 - x1; + const height = y2 - y1; + switch (this.rotation) { + case 0: + return [x1, pageHeight - y2, width, height]; + case 90: + return [x1, pageHeight - y1, height, width]; + case 180: + return [x2, pageHeight - y1, width, height]; + case 270: + return [x2, pageHeight - y2, height, width]; + default: + throw new Error("Invalid rotation"); + } + } + onceAdded() {} + isEmpty() { + return false; + } + enableEditMode() { + this.#isInEditMode = true; + } + disableEditMode() { + this.#isInEditMode = false; + } + isInEditMode() { + return this.#isInEditMode; + } + shouldGetKeyboardEvents() { + return this.#isResizerEnabledForKeyboard; + } + needsToBeRebuilt() { + return this.div && !this.isAttachedToDOM; + } + rebuild() { + this.div?.addEventListener("focusin", this.#boundFocusin); + this.div?.addEventListener("focusout", this.#boundFocusout); + } + rotate(_angle) {} + serialize(isForCopying = false, context = null) { + (0,util.unreachable)("An editor must be serializable"); + } + static deserialize(data, parent, uiManager) { + const editor = new this.prototype.constructor({ + parent, + id: parent.getNextId(), + uiManager + }); + editor.rotation = data.rotation; + const [pageWidth, pageHeight] = editor.pageDimensions; + const [x, y, width, height] = editor.getRectInCurrentCoords(data.rect, pageHeight); + editor.x = x / pageWidth; + editor.y = y / pageHeight; + editor.width = width / pageWidth; + editor.height = height / pageHeight; + return editor; + } + remove() { + this.div.removeEventListener("focusin", this.#boundFocusin); + this.div.removeEventListener("focusout", this.#boundFocusout); + if (!this.isEmpty()) { + this.commit(); + } + if (this.parent) { + this.parent.remove(this); + } else { + this._uiManager.removeEditor(this); + } + if (this.#moveInDOMTimeout) { + clearTimeout(this.#moveInDOMTimeout); + this.#moveInDOMTimeout = null; + } + this.#stopResizing(); + this.removeEditToolbar(); + } + get isResizable() { + return false; + } + makeResizable() { + if (this.isResizable) { + this.#createResizers(); + this.#resizersDiv.classList.remove("hidden"); + (0,tools.bindEvents)(this, this.div, ["keydown"]); + } + } + get toolbarPosition() { + return null; + } + keydown(event) { + if (!this.isResizable || event.target !== this.div || event.key !== "Enter") { + return; + } + this._uiManager.setSelected(this); + this.#savedDimensions = { + savedX: this.x, + savedY: this.y, + savedWidth: this.width, + savedHeight: this.height + }; + const children = this.#resizersDiv.children; + if (!this.#allResizerDivs) { + this.#allResizerDivs = Array.from(children); + const boundResizerKeydown = this.#resizerKeydown.bind(this); + const boundResizerBlur = this.#resizerBlur.bind(this); + for (const div of this.#allResizerDivs) { + const name = div.getAttribute("data-resizer-name"); + div.setAttribute("role", "spinbutton"); + div.addEventListener("keydown", boundResizerKeydown); + div.addEventListener("blur", boundResizerBlur); + div.addEventListener("focus", this.#resizerFocus.bind(this, name)); + AnnotationEditor._l10nPromise.get(`pdfjs-editor-resizer-label-${name}`).then(msg => div.setAttribute("aria-label", msg)); + } + } + const first = this.#allResizerDivs[0]; + let firstPosition = 0; + for (const div of children) { + if (div === first) { + break; + } + firstPosition++; + } + const nextFirstPosition = (360 - this.rotation + this.parentRotation) % 360 / 90 * (this.#allResizerDivs.length / 4); + if (nextFirstPosition !== firstPosition) { + if (nextFirstPosition < firstPosition) { + for (let i = 0; i < firstPosition - nextFirstPosition; i++) { + this.#resizersDiv.append(this.#resizersDiv.firstChild); + } + } else if (nextFirstPosition > firstPosition) { + for (let i = 0; i < nextFirstPosition - firstPosition; i++) { + this.#resizersDiv.firstChild.before(this.#resizersDiv.lastChild); + } + } + let i = 0; + for (const child of children) { + const div = this.#allResizerDivs[i++]; + const name = div.getAttribute("data-resizer-name"); + AnnotationEditor._l10nPromise.get(`pdfjs-editor-resizer-label-${name}`).then(msg => child.setAttribute("aria-label", msg)); + } + } + this.#setResizerTabIndex(0); + this.#isResizerEnabledForKeyboard = true; + this.#resizersDiv.firstChild.focus({ + focusVisible: true + }); + event.preventDefault(); + event.stopImmediatePropagation(); + } + #resizerKeydown(event) { + AnnotationEditor._resizerKeyboardManager.exec(this, event); + } + #resizerBlur(event) { + if (this.#isResizerEnabledForKeyboard && event.relatedTarget?.parentNode !== this.#resizersDiv) { + this.#stopResizing(); + } + } + #resizerFocus(name) { + this.#focusedResizerName = this.#isResizerEnabledForKeyboard ? name : ""; + } + #setResizerTabIndex(value) { + if (!this.#allResizerDivs) { + return; + } + for (const div of this.#allResizerDivs) { + div.tabIndex = value; + } + } + _resizeWithKeyboard(x, y) { + if (!this.#isResizerEnabledForKeyboard) { + return; + } + this.#resizerPointermove(this.#focusedResizerName, { + movementX: x, + movementY: y + }); + } + #stopResizing() { + this.#isResizerEnabledForKeyboard = false; + this.#setResizerTabIndex(-1); + if (this.#savedDimensions) { + const { + savedX, + savedY, + savedWidth, + savedHeight + } = this.#savedDimensions; + this.#addResizeToUndoStack(savedX, savedY, savedWidth, savedHeight); + this.#savedDimensions = null; + } + } + _stopResizingWithKeyboard() { + this.#stopResizing(); + this.div.focus(); + } + select() { + this.makeResizable(); + this.div?.classList.add("selectedEditor"); + if (!this.#editToolbar) { + this.addEditToolbar().then(() => { + if (this.div?.classList.contains("selectedEditor")) { + this.#editToolbar?.show(); + } + }); + return; + } + this.#editToolbar?.show(); + } + unselect() { + this.#resizersDiv?.classList.add("hidden"); + this.div?.classList.remove("selectedEditor"); + if (this.div?.contains(document.activeElement)) { + this._uiManager.currentLayer.div.focus(); + } + this.#editToolbar?.hide(); + } + updateParams(type, value) {} + disableEditing() {} + enableEditing() {} + enterInEditMode() {} + getImageForAltText() { + return null; + } + get contentDiv() { + return this.div; + } + get isEditing() { + return this.#isEditing; + } + set isEditing(value) { + this.#isEditing = value; + if (!this.parent) { + return; + } + if (value) { + this.parent.setSelected(this); + this.parent.setActiveEditor(this); + } else { + this.parent.setActiveEditor(null); + } + } + setAspectRatio(width, height) { + this.#keepAspectRatio = true; + const aspectRatio = width / height; + const { + style + } = this.div; + style.aspectRatio = aspectRatio; + style.height = "auto"; + } + static get MIN_SIZE() { + return 16; + } + static canCreateNewEmptyEditor() { + return true; + } +} +class FakeEditor extends AnnotationEditor { + constructor(params) { + super(params); + this.annotationElementId = params.annotationElementId; + this.deleted = true; + } + serialize() { + return { + id: this.annotationElementId, + deleted: true, + pageIndex: this.pageIndex + }; + } +} + + +/***/ }), + +/***/ 405: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Outliner: () => (/* binding */ Outliner) +/* harmony export */ }); +class Outliner { + #box; + #verticalEdges = []; + #intervals = []; + constructor(boxes, borderWidth = 0, innerMargin = 0, isLTR = true) { + let minX = Infinity; + let maxX = -Infinity; + let minY = Infinity; + let maxY = -Infinity; + const NUMBER_OF_DIGITS = 4; + const EPSILON = 10 ** -NUMBER_OF_DIGITS; + for (const { + x, + y, + width, + height + } of boxes) { + const x1 = Math.floor((x - borderWidth) / EPSILON) * EPSILON; + const x2 = Math.ceil((x + width + borderWidth) / EPSILON) * EPSILON; + const y1 = Math.floor((y - borderWidth) / EPSILON) * EPSILON; + const y2 = Math.ceil((y + height + borderWidth) / EPSILON) * EPSILON; + const left = [x1, y1, y2, true]; + const right = [x2, y1, y2, false]; + this.#verticalEdges.push(left, right); + minX = Math.min(minX, x1); + maxX = Math.max(maxX, x2); + minY = Math.min(minY, y1); + maxY = Math.max(maxY, y2); + } + const bboxWidth = maxX - minX + 2 * innerMargin; + const bboxHeight = maxY - minY + 2 * innerMargin; + const shiftedMinX = minX - innerMargin; + const shiftedMinY = minY - innerMargin; + const lastEdge = this.#verticalEdges.at(isLTR ? -1 : -2); + const lastPoint = [lastEdge[0], lastEdge[2]]; + for (const edge of this.#verticalEdges) { + const [x, y1, y2] = edge; + edge[0] = (x - shiftedMinX) / bboxWidth; + edge[1] = (y1 - shiftedMinY) / bboxHeight; + edge[2] = (y2 - shiftedMinY) / bboxHeight; + } + this.#box = { + x: shiftedMinX, + y: shiftedMinY, + width: bboxWidth, + height: bboxHeight, + lastPoint + }; + } + getOutlines() { + this.#verticalEdges.sort((a, b) => a[0] - b[0] || a[1] - b[1] || a[2] - b[2]); + const outlineVerticalEdges = []; + for (const edge of this.#verticalEdges) { + if (edge[3]) { + outlineVerticalEdges.push(...this.#breakEdge(edge)); + this.#insert(edge); + } else { + this.#remove(edge); + outlineVerticalEdges.push(...this.#breakEdge(edge)); + } + } + return this.#getOutlines(outlineVerticalEdges); + } + #getOutlines(outlineVerticalEdges) { + const edges = []; + const allEdges = new Set(); + for (const edge of outlineVerticalEdges) { + const [x, y1, y2] = edge; + edges.push([x, y1, edge], [x, y2, edge]); + } + edges.sort((a, b) => a[1] - b[1] || a[0] - b[0]); + for (let i = 0, ii = edges.length; i < ii; i += 2) { + const edge1 = edges[i][2]; + const edge2 = edges[i + 1][2]; + edge1.push(edge2); + edge2.push(edge1); + allEdges.add(edge1); + allEdges.add(edge2); + } + const outlines = []; + let outline; + while (allEdges.size > 0) { + const edge = allEdges.values().next().value; + let [x, y1, y2, edge1, edge2] = edge; + allEdges.delete(edge); + let lastPointX = x; + let lastPointY = y1; + outline = [x, y2]; + outlines.push(outline); + while (true) { + let e; + if (allEdges.has(edge1)) { + e = edge1; + } else if (allEdges.has(edge2)) { + e = edge2; + } else { + break; + } + allEdges.delete(e); + [x, y1, y2, edge1, edge2] = e; + if (lastPointX !== x) { + outline.push(lastPointX, lastPointY, x, lastPointY === y1 ? y1 : y2); + lastPointX = x; + } + lastPointY = lastPointY === y1 ? y2 : y1; + } + outline.push(lastPointX, lastPointY); + } + return { + outlines, + box: this.#box + }; + } + #binarySearch(y) { + const array = this.#intervals; + let start = 0; + let end = array.length - 1; + while (start <= end) { + const middle = start + end >> 1; + const y1 = array[middle][0]; + if (y1 === y) { + return middle; + } + if (y1 < y) { + start = middle + 1; + } else { + end = middle - 1; + } + } + return end + 1; + } + #insert([, y1, y2]) { + const index = this.#binarySearch(y1); + this.#intervals.splice(index, 0, [y1, y2]); + } + #remove([, y1, y2]) { + const index = this.#binarySearch(y1); + for (let i = index; i < this.#intervals.length; i++) { + const [start, end] = this.#intervals[i]; + if (start !== y1) { + break; + } + if (start === y1 && end === y2) { + this.#intervals.splice(i, 1); + return; + } + } + for (let i = index - 1; i >= 0; i--) { + const [start, end] = this.#intervals[i]; + if (start !== y1) { + break; + } + if (start === y1 && end === y2) { + this.#intervals.splice(i, 1); + return; + } + } + } + #breakEdge(edge) { + const [x, y1, y2] = edge; + const results = [[x, y1, y2]]; + const index = this.#binarySearch(y2); + for (let i = 0; i < index; i++) { + const [start, end] = this.#intervals[i]; + for (let j = 0, jj = results.length; j < jj; j++) { + const [, y3, y4] = results[j]; + if (end <= y3 || y4 <= start) { + continue; + } + if (y3 >= start) { + if (y4 > end) { + results[j][1] = end; + } else { + if (jj === 1) { + return []; + } + results.splice(j, 1); + j--; + jj--; + } + continue; + } + results[j][2] = start; + if (y4 > end) { + results.push([x, end, y4]); + } + } + } + return results; + } +} + + +/***/ }), + +/***/ 812: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ AnnotationEditorUIManager: () => (/* binding */ AnnotationEditorUIManager), +/* harmony export */ ColorManager: () => (/* binding */ ColorManager), +/* harmony export */ KeyboardManager: () => (/* binding */ KeyboardManager), +/* harmony export */ bindEvents: () => (/* binding */ bindEvents), +/* harmony export */ opacityToHex: () => (/* binding */ opacityToHex) +/* harmony export */ }); +/* unused harmony export CommandManager */ +/* harmony import */ var _shared_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(266); +/* harmony import */ var _display_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(473); + + +function bindEvents(obj, element, names) { + for (const name of names) { + element.addEventListener(name, obj[name].bind(obj)); + } +} +function opacityToHex(opacity) { + return Math.round(Math.min(255, Math.max(1, 255 * opacity))).toString(16).padStart(2, "0"); +} +class IdManager { + #id = 0; + getId() { + return `${_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorPrefix}${this.#id++}`; + } +} +class ImageManager { + #baseId = (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.getUuid)(); + #id = 0; + #cache = null; + static get _isSVGFittingCanvas() { + 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>`; + const canvas = new OffscreenCanvas(1, 3); + const ctx = canvas.getContext("2d"); + const image = new Image(); + image.src = svg; + const promise = image.decode().then(() => { + ctx.drawImage(image, 0, 0, 1, 1, 0, 0, 1, 3); + return new Uint32Array(ctx.getImageData(0, 0, 1, 1).data.buffer)[0] === 0; + }); + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.shadow)(this, "_isSVGFittingCanvas", promise); + } + async #get(key, rawData) { + this.#cache ||= new Map(); + let data = this.#cache.get(key); + if (data === null) { + return null; + } + if (data?.bitmap) { + data.refCounter += 1; + return data; + } + try { + data ||= { + bitmap: null, + id: `image_${this.#baseId}_${this.#id++}`, + refCounter: 0, + isSvg: false + }; + let image; + if (typeof rawData === "string") { + data.url = rawData; + image = await (0,_display_utils_js__WEBPACK_IMPORTED_MODULE_1__.fetchData)(rawData, "blob"); + } else { + image = data.file = rawData; + } + if (image.type === "image/svg+xml") { + const mustRemoveAspectRatioPromise = ImageManager._isSVGFittingCanvas; + const fileReader = new FileReader(); + const imageElement = new Image(); + const imagePromise = new Promise((resolve, reject) => { + imageElement.onload = () => { + data.bitmap = imageElement; + data.isSvg = true; + resolve(); + }; + fileReader.onload = async () => { + const url = data.svgUrl = fileReader.result; + imageElement.src = (await mustRemoveAspectRatioPromise) ? `${url}#svgView(preserveAspectRatio(none))` : url; + }; + imageElement.onerror = fileReader.onerror = reject; + }); + fileReader.readAsDataURL(image); + await imagePromise; + } else { + data.bitmap = await createImageBitmap(image); + } + data.refCounter = 1; + } catch (e) { + console.error(e); + data = null; + } + this.#cache.set(key, data); + if (data) { + this.#cache.set(data.id, data); + } + return data; + } + async getFromFile(file) { + const { + lastModified, + name, + size, + type + } = file; + return this.#get(`${lastModified}_${name}_${size}_${type}`, file); + } + async getFromUrl(url) { + return this.#get(url, url); + } + async getFromId(id) { + this.#cache ||= new Map(); + const data = this.#cache.get(id); + if (!data) { + return null; + } + if (data.bitmap) { + data.refCounter += 1; + return data; + } + if (data.file) { + return this.getFromFile(data.file); + } + return this.getFromUrl(data.url); + } + getSvgUrl(id) { + const data = this.#cache.get(id); + if (!data?.isSvg) { + return null; + } + return data.svgUrl; + } + deleteId(id) { + this.#cache ||= new Map(); + const data = this.#cache.get(id); + if (!data) { + return; + } + data.refCounter -= 1; + if (data.refCounter !== 0) { + return; + } + data.bitmap = null; + } + isValidId(id) { + return id.startsWith(`image_${this.#baseId}_`); + } +} +class CommandManager { + #commands = []; + #locked = false; + #maxSize; + #position = -1; + constructor(maxSize = 128) { + this.#maxSize = maxSize; + } + add({ + cmd, + undo, + mustExec, + type = NaN, + overwriteIfSameType = false, + keepUndo = false + }) { + if (mustExec) { + cmd(); + } + if (this.#locked) { + return; + } + const save = { + cmd, + undo, + type + }; + if (this.#position === -1) { + if (this.#commands.length > 0) { + this.#commands.length = 0; + } + this.#position = 0; + this.#commands.push(save); + return; + } + if (overwriteIfSameType && this.#commands[this.#position].type === type) { + if (keepUndo) { + save.undo = this.#commands[this.#position].undo; + } + this.#commands[this.#position] = save; + return; + } + const next = this.#position + 1; + if (next === this.#maxSize) { + this.#commands.splice(0, 1); + } else { + this.#position = next; + if (next < this.#commands.length) { + this.#commands.splice(next); + } + } + this.#commands.push(save); + } + undo() { + if (this.#position === -1) { + return; + } + this.#locked = true; + this.#commands[this.#position].undo(); + this.#locked = false; + this.#position -= 1; + } + redo() { + if (this.#position < this.#commands.length - 1) { + this.#position += 1; + this.#locked = true; + this.#commands[this.#position].cmd(); + this.#locked = false; + } + } + hasSomethingToUndo() { + return this.#position !== -1; + } + hasSomethingToRedo() { + return this.#position < this.#commands.length - 1; + } + destroy() { + this.#commands = null; + } +} +class KeyboardManager { + constructor(callbacks) { + this.buffer = []; + this.callbacks = new Map(); + this.allKeys = new Set(); + const { + isMac + } = _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.FeatureTest.platform; + for (const [keys, callback, options = {}] of callbacks) { + for (const key of keys) { + const isMacKey = key.startsWith("mac+"); + if (isMac && isMacKey) { + this.callbacks.set(key.slice(4), { + callback, + options + }); + this.allKeys.add(key.split("+").at(-1)); + } else if (!isMac && !isMacKey) { + this.callbacks.set(key, { + callback, + options + }); + this.allKeys.add(key.split("+").at(-1)); + } + } + } + } + #serialize(event) { + if (event.altKey) { + this.buffer.push("alt"); + } + if (event.ctrlKey) { + this.buffer.push("ctrl"); + } + if (event.metaKey) { + this.buffer.push("meta"); + } + if (event.shiftKey) { + this.buffer.push("shift"); + } + this.buffer.push(event.key); + const str = this.buffer.join("+"); + this.buffer.length = 0; + return str; + } + exec(self, event) { + if (!this.allKeys.has(event.key)) { + return; + } + const info = this.callbacks.get(this.#serialize(event)); + if (!info) { + return; + } + const { + callback, + options: { + bubbles = false, + args = [], + checker = null + } + } = info; + if (checker && !checker(self, event)) { + return; + } + callback.bind(self, ...args, event)(); + if (!bubbles) { + event.stopPropagation(); + event.preventDefault(); + } + } +} +class ColorManager { + static _colorsMapping = new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]); + get _colors() { + const colors = new Map([["CanvasText", null], ["Canvas", null]]); + (0,_display_utils_js__WEBPACK_IMPORTED_MODULE_1__.getColorValues)(colors); + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.shadow)(this, "_colors", colors); + } + convert(color) { + const rgb = (0,_display_utils_js__WEBPACK_IMPORTED_MODULE_1__.getRGB)(color); + if (!window.matchMedia("(forced-colors: active)").matches) { + return rgb; + } + for (const [name, RGB] of this._colors) { + if (RGB.every((x, i) => x === rgb[i])) { + return ColorManager._colorsMapping.get(name); + } + } + return rgb; + } + getHexCode(name) { + const rgb = this._colors.get(name); + if (!rgb) { + return name; + } + return _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.Util.makeHexColor(...rgb); + } +} +class AnnotationEditorUIManager { + #activeEditor = null; + #allEditors = new Map(); + #allLayers = new Map(); + #altTextManager = null; + #annotationStorage = null; + #commandManager = new CommandManager(); + #currentPageIndex = 0; + #deletedAnnotationsElementIds = new Set(); + #draggingEditors = null; + #editorTypes = null; + #editorsToRescale = new Set(); + #filterFactory = null; + #focusMainContainerTimeoutId = null; + #highlightColors = null; + #idManager = new IdManager(); + #isEnabled = false; + #isWaiting = false; + #lastActiveElement = null; + #mainHighlightColorPicker = null; + #mode = _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.NONE; + #selectedEditors = new Set(); + #pageColors = null; + #boundBlur = this.blur.bind(this); + #boundFocus = this.focus.bind(this); + #boundCopy = this.copy.bind(this); + #boundCut = this.cut.bind(this); + #boundPaste = this.paste.bind(this); + #boundKeydown = this.keydown.bind(this); + #boundOnEditingAction = this.onEditingAction.bind(this); + #boundOnPageChanging = this.onPageChanging.bind(this); + #boundOnScaleChanging = this.onScaleChanging.bind(this); + #boundOnRotationChanging = this.onRotationChanging.bind(this); + #previousStates = { + isEditing: false, + isEmpty: true, + hasSomethingToUndo: false, + hasSomethingToRedo: false, + hasSelectedEditor: false + }; + #translation = [0, 0]; + #translationTimeoutId = null; + #container = null; + #viewer = null; + static TRANSLATE_SMALL = 1; + static TRANSLATE_BIG = 10; + static get _keyboardManager() { + const proto = AnnotationEditorUIManager.prototype; + const arrowChecker = self => { + return self.#container.contains(document.activeElement) && document.activeElement.tagName !== "BUTTON" && self.hasSomethingToControl(); + }; + const textInputChecker = (_self, { + target: el + }) => { + if (el instanceof HTMLInputElement) { + const { + type + } = el; + return type !== "text" && type !== "number"; + } + return true; + }; + const small = this.TRANSLATE_SMALL; + const big = this.TRANSLATE_BIG; + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.shadow)(this, "_keyboardManager", new KeyboardManager([[["ctrl+a", "mac+meta+a"], proto.selectAll, { + checker: textInputChecker + }], [["ctrl+z", "mac+meta+z"], proto.undo, { + checker: textInputChecker + }], [["ctrl+y", "ctrl+shift+z", "mac+meta+shift+z", "ctrl+shift+Z", "mac+meta+shift+Z"], proto.redo, { + checker: textInputChecker + }], [["Backspace", "alt+Backspace", "ctrl+Backspace", "shift+Backspace", "mac+Backspace", "mac+alt+Backspace", "mac+ctrl+Backspace", "Delete", "ctrl+Delete", "shift+Delete", "mac+Delete"], proto.delete, { + checker: textInputChecker + }], [["Enter", "mac+Enter"], proto.addNewEditorFromKeyboard, { + checker: (self, { + target: el + }) => !(el instanceof HTMLButtonElement) && self.#container.contains(el) && !self.isEnterHandled + }], [[" ", "mac+ "], proto.addNewEditorFromKeyboard, { + checker: self => self.#container.contains(document.activeElement) + }], [["Escape", "mac+Escape"], proto.unselectAll], [["ArrowLeft", "mac+ArrowLeft"], proto.translateSelectedEditors, { + args: [-small, 0], + checker: arrowChecker + }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], proto.translateSelectedEditors, { + args: [-big, 0], + checker: arrowChecker + }], [["ArrowRight", "mac+ArrowRight"], proto.translateSelectedEditors, { + args: [small, 0], + checker: arrowChecker + }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], proto.translateSelectedEditors, { + args: [big, 0], + checker: arrowChecker + }], [["ArrowUp", "mac+ArrowUp"], proto.translateSelectedEditors, { + args: [0, -small], + checker: arrowChecker + }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], proto.translateSelectedEditors, { + args: [0, -big], + checker: arrowChecker + }], [["ArrowDown", "mac+ArrowDown"], proto.translateSelectedEditors, { + args: [0, small], + checker: arrowChecker + }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], proto.translateSelectedEditors, { + args: [0, big], + checker: arrowChecker + }]])); + } + constructor(container, viewer, altTextManager, eventBus, pdfDocument, pageColors, highlightColors) { + this.#container = container; + this.#viewer = viewer; + this.#altTextManager = altTextManager; + this._eventBus = eventBus; + this._eventBus._on("editingaction", this.#boundOnEditingAction); + this._eventBus._on("pagechanging", this.#boundOnPageChanging); + this._eventBus._on("scalechanging", this.#boundOnScaleChanging); + this._eventBus._on("rotationchanging", this.#boundOnRotationChanging); + this.#annotationStorage = pdfDocument.annotationStorage; + this.#filterFactory = pdfDocument.filterFactory; + this.#pageColors = pageColors; + this.#highlightColors = highlightColors || null; + this.viewParameters = { + realScale: _display_utils_js__WEBPACK_IMPORTED_MODULE_1__.PixelsPerInch.PDF_TO_CSS_UNITS, + rotation: 0 + }; + } + destroy() { + this.#removeKeyboardManager(); + this.#removeFocusManager(); + this._eventBus._off("editingaction", this.#boundOnEditingAction); + this._eventBus._off("pagechanging", this.#boundOnPageChanging); + this._eventBus._off("scalechanging", this.#boundOnScaleChanging); + this._eventBus._off("rotationchanging", this.#boundOnRotationChanging); + for (const layer of this.#allLayers.values()) { + layer.destroy(); + } + this.#allLayers.clear(); + this.#allEditors.clear(); + this.#editorsToRescale.clear(); + this.#activeEditor = null; + this.#selectedEditors.clear(); + this.#commandManager.destroy(); + this.#altTextManager?.destroy(); + if (this.#focusMainContainerTimeoutId) { + clearTimeout(this.#focusMainContainerTimeoutId); + this.#focusMainContainerTimeoutId = null; + } + if (this.#translationTimeoutId) { + clearTimeout(this.#translationTimeoutId); + this.#translationTimeoutId = null; + } + } + get hcmFilter() { + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.shadow)(this, "hcmFilter", this.#pageColors ? this.#filterFactory.addHCMFilter(this.#pageColors.foreground, this.#pageColors.background) : "none"); + } + get direction() { + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.shadow)(this, "direction", getComputedStyle(this.#container).direction); + } + get highlightColors() { + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.shadow)(this, "highlightColors", this.#highlightColors ? new Map(this.#highlightColors.split(",").map(pair => pair.split("=").map(x => x.trim()))) : null); + } + setMainHighlightColorPicker(colorPicker) { + this.#mainHighlightColorPicker = colorPicker; + } + editAltText(editor) { + this.#altTextManager?.editAltText(this, editor); + } + onPageChanging({ + pageNumber + }) { + this.#currentPageIndex = pageNumber - 1; + } + focusMainContainer() { + this.#container.focus(); + } + findParent(x, y) { + for (const layer of this.#allLayers.values()) { + const { + x: layerX, + y: layerY, + width, + height + } = layer.div.getBoundingClientRect(); + if (x >= layerX && x <= layerX + width && y >= layerY && y <= layerY + height) { + return layer; + } + } + return null; + } + disableUserSelect(value = false) { + this.#viewer.classList.toggle("noUserSelect", value); + } + addShouldRescale(editor) { + this.#editorsToRescale.add(editor); + } + removeShouldRescale(editor) { + this.#editorsToRescale.delete(editor); + } + onScaleChanging({ + scale + }) { + this.commitOrRemove(); + this.viewParameters.realScale = scale * _display_utils_js__WEBPACK_IMPORTED_MODULE_1__.PixelsPerInch.PDF_TO_CSS_UNITS; + for (const editor of this.#editorsToRescale) { + editor.onScaleChanging(); + } + } + onRotationChanging({ + pagesRotation + }) { + this.commitOrRemove(); + this.viewParameters.rotation = pagesRotation; + } + addToAnnotationStorage(editor) { + if (!editor.isEmpty() && this.#annotationStorage && !this.#annotationStorage.has(editor.id)) { + this.#annotationStorage.setValue(editor.id, editor); + } + } + #addFocusManager() { + window.addEventListener("focus", this.#boundFocus); + window.addEventListener("blur", this.#boundBlur); + } + #removeFocusManager() { + window.removeEventListener("focus", this.#boundFocus); + window.removeEventListener("blur", this.#boundBlur); + } + blur() { + if (!this.hasSelection) { + return; + } + const { + activeElement + } = document; + for (const editor of this.#selectedEditors) { + if (editor.div.contains(activeElement)) { + this.#lastActiveElement = [editor, activeElement]; + editor._focusEventsAllowed = false; + break; + } + } + } + focus() { + if (!this.#lastActiveElement) { + return; + } + const [lastEditor, lastActiveElement] = this.#lastActiveElement; + this.#lastActiveElement = null; + lastActiveElement.addEventListener("focusin", () => { + lastEditor._focusEventsAllowed = true; + }, { + once: true + }); + lastActiveElement.focus(); + } + #addKeyboardManager() { + window.addEventListener("keydown", this.#boundKeydown); + } + #removeKeyboardManager() { + window.removeEventListener("keydown", this.#boundKeydown); + } + #addCopyPasteListeners() { + document.addEventListener("copy", this.#boundCopy); + document.addEventListener("cut", this.#boundCut); + document.addEventListener("paste", this.#boundPaste); + } + #removeCopyPasteListeners() { + document.removeEventListener("copy", this.#boundCopy); + document.removeEventListener("cut", this.#boundCut); + document.removeEventListener("paste", this.#boundPaste); + } + addEditListeners() { + this.#addKeyboardManager(); + this.#addCopyPasteListeners(); + } + removeEditListeners() { + this.#removeKeyboardManager(); + this.#removeCopyPasteListeners(); + } + copy(event) { + event.preventDefault(); + this.#activeEditor?.commitOrRemove(); + if (!this.hasSelection) { + return; + } + const editors = []; + for (const editor of this.#selectedEditors) { + const serialized = editor.serialize(true); + if (serialized) { + editors.push(serialized); + } + } + if (editors.length === 0) { + return; + } + event.clipboardData.setData("application/pdfjs", JSON.stringify(editors)); + } + cut(event) { + this.copy(event); + this.delete(); + } + paste(event) { + event.preventDefault(); + const { + clipboardData + } = event; + for (const item of clipboardData.items) { + for (const editorType of this.#editorTypes) { + if (editorType.isHandlingMimeForPasting(item.type)) { + editorType.paste(item, this.currentLayer); + return; + } + } + } + let data = clipboardData.getData("application/pdfjs"); + if (!data) { + return; + } + try { + data = JSON.parse(data); + } catch (ex) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)(`paste: "${ex.message}".`); + return; + } + if (!Array.isArray(data)) { + return; + } + this.unselectAll(); + const layer = this.currentLayer; + try { + const newEditors = []; + for (const editor of data) { + const deserializedEditor = layer.deserialize(editor); + if (!deserializedEditor) { + return; + } + newEditors.push(deserializedEditor); + } + const cmd = () => { + for (const editor of newEditors) { + this.#addEditorToLayer(editor); + } + this.#selectEditors(newEditors); + }; + const undo = () => { + for (const editor of newEditors) { + editor.remove(); + } + }; + this.addCommands({ + cmd, + undo, + mustExec: true + }); + } catch (ex) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)(`paste: "${ex.message}".`); + } + } + keydown(event) { + if (!this.isEditorHandlingKeyboard) { + AnnotationEditorUIManager._keyboardManager.exec(this, event); + } + } + onEditingAction(details) { + if (["undo", "redo", "delete", "selectAll"].includes(details.name)) { + this[details.name](); + } + } + #dispatchUpdateStates(details) { + const hasChanged = Object.entries(details).some(([key, value]) => this.#previousStates[key] !== value); + if (hasChanged) { + this._eventBus.dispatch("annotationeditorstateschanged", { + source: this, + details: Object.assign(this.#previousStates, details) + }); + } + } + #dispatchUpdateUI(details) { + this._eventBus.dispatch("annotationeditorparamschanged", { + source: this, + details + }); + } + setEditingState(isEditing) { + if (isEditing) { + this.#addFocusManager(); + this.#addKeyboardManager(); + this.#addCopyPasteListeners(); + this.#dispatchUpdateStates({ + isEditing: this.#mode !== _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.NONE, + isEmpty: this.#isEmpty(), + hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(), + hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(), + hasSelectedEditor: false + }); + } else { + this.#removeFocusManager(); + this.#removeKeyboardManager(); + this.#removeCopyPasteListeners(); + this.#dispatchUpdateStates({ + isEditing: false + }); + this.disableUserSelect(false); + } + } + registerEditorTypes(types) { + if (this.#editorTypes) { + return; + } + this.#editorTypes = types; + for (const editorType of this.#editorTypes) { + this.#dispatchUpdateUI(editorType.defaultPropertiesToUpdate); + } + } + getId() { + return this.#idManager.getId(); + } + get currentLayer() { + return this.#allLayers.get(this.#currentPageIndex); + } + getLayer(pageIndex) { + return this.#allLayers.get(pageIndex); + } + get currentPageIndex() { + return this.#currentPageIndex; + } + addLayer(layer) { + this.#allLayers.set(layer.pageIndex, layer); + if (this.#isEnabled) { + layer.enable(); + } else { + layer.disable(); + } + } + removeLayer(layer) { + this.#allLayers.delete(layer.pageIndex); + } + updateMode(mode, editId = null, isFromKeyboard = false) { + if (this.#mode === mode) { + return; + } + this.#mode = mode; + if (mode === _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.NONE) { + this.setEditingState(false); + this.#disableAll(); + return; + } + this.setEditingState(true); + this.#enableAll(); + this.unselectAll(); + for (const layer of this.#allLayers.values()) { + layer.updateMode(mode); + } + if (!editId && isFromKeyboard) { + this.addNewEditorFromKeyboard(); + return; + } + if (!editId) { + return; + } + for (const editor of this.#allEditors.values()) { + if (editor.annotationElementId === editId) { + this.setSelected(editor); + editor.enterInEditMode(); + break; + } + } + } + addNewEditorFromKeyboard() { + if (this.currentLayer.canCreateNewEmptyEditor()) { + this.currentLayer.addNewEditor(); + } + } + updateToolbar(mode) { + if (mode === this.#mode) { + return; + } + this._eventBus.dispatch("switchannotationeditormode", { + source: this, + mode + }); + } + updateParams(type, value) { + if (!this.#editorTypes) { + return; + } + switch (type) { + case _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorParamsType.CREATE: + this.currentLayer.addNewEditor(); + return; + case _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR: + this.#mainHighlightColorPicker?.updateColor(value); + break; + } + for (const editor of this.#selectedEditors) { + editor.updateParams(type, value); + } + for (const editorType of this.#editorTypes) { + editorType.updateDefaultParams(type, value); + } + } + enableWaiting(mustWait = false) { + if (this.#isWaiting === mustWait) { + return; + } + this.#isWaiting = mustWait; + for (const layer of this.#allLayers.values()) { + if (mustWait) { + layer.disableClick(); + } else { + layer.enableClick(); + } + layer.div.classList.toggle("waiting", mustWait); + } + } + #enableAll() { + if (!this.#isEnabled) { + this.#isEnabled = true; + for (const layer of this.#allLayers.values()) { + layer.enable(); + } + } + } + #disableAll() { + this.unselectAll(); + if (this.#isEnabled) { + this.#isEnabled = false; + for (const layer of this.#allLayers.values()) { + layer.disable(); + } + } + } + getEditors(pageIndex) { + const editors = []; + for (const editor of this.#allEditors.values()) { + if (editor.pageIndex === pageIndex) { + editors.push(editor); + } + } + return editors; + } + getEditor(id) { + return this.#allEditors.get(id); + } + addEditor(editor) { + this.#allEditors.set(editor.id, editor); + } + removeEditor(editor) { + if (editor.div.contains(document.activeElement)) { + if (this.#focusMainContainerTimeoutId) { + clearTimeout(this.#focusMainContainerTimeoutId); + } + this.#focusMainContainerTimeoutId = setTimeout(() => { + this.focusMainContainer(); + this.#focusMainContainerTimeoutId = null; + }, 0); + } + this.#allEditors.delete(editor.id); + this.unselect(editor); + if (!editor.annotationElementId || !this.#deletedAnnotationsElementIds.has(editor.annotationElementId)) { + this.#annotationStorage?.remove(editor.id); + } + } + addDeletedAnnotationElement(editor) { + this.#deletedAnnotationsElementIds.add(editor.annotationElementId); + editor.deleted = true; + } + isDeletedAnnotationElement(annotationElementId) { + return this.#deletedAnnotationsElementIds.has(annotationElementId); + } + removeDeletedAnnotationElement(editor) { + this.#deletedAnnotationsElementIds.delete(editor.annotationElementId); + editor.deleted = false; + } + #addEditorToLayer(editor) { + const layer = this.#allLayers.get(editor.pageIndex); + if (layer) { + layer.addOrRebuild(editor); + } else { + this.addEditor(editor); + } + } + setActiveEditor(editor) { + if (this.#activeEditor === editor) { + return; + } + this.#activeEditor = editor; + if (editor) { + this.#dispatchUpdateUI(editor.propertiesToUpdate); + } + } + toggleSelected(editor) { + if (this.#selectedEditors.has(editor)) { + this.#selectedEditors.delete(editor); + editor.unselect(); + this.#dispatchUpdateStates({ + hasSelectedEditor: this.hasSelection + }); + return; + } + this.#selectedEditors.add(editor); + editor.select(); + this.#dispatchUpdateUI(editor.propertiesToUpdate); + this.#dispatchUpdateStates({ + hasSelectedEditor: true + }); + } + setSelected(editor) { + for (const ed of this.#selectedEditors) { + if (ed !== editor) { + ed.unselect(); + } + } + this.#selectedEditors.clear(); + this.#selectedEditors.add(editor); + editor.select(); + this.#dispatchUpdateUI(editor.propertiesToUpdate); + this.#dispatchUpdateStates({ + hasSelectedEditor: true + }); + } + isSelected(editor) { + return this.#selectedEditors.has(editor); + } + get firstSelectedEditor() { + return this.#selectedEditors.values().next().value; + } + unselect(editor) { + editor.unselect(); + this.#selectedEditors.delete(editor); + this.#dispatchUpdateStates({ + hasSelectedEditor: this.hasSelection + }); + } + get hasSelection() { + return this.#selectedEditors.size !== 0; + } + get isEnterHandled() { + return this.#selectedEditors.size === 1 && this.firstSelectedEditor.isEnterHandled; + } + undo() { + this.#commandManager.undo(); + this.#dispatchUpdateStates({ + hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(), + hasSomethingToRedo: true, + isEmpty: this.#isEmpty() + }); + } + redo() { + this.#commandManager.redo(); + this.#dispatchUpdateStates({ + hasSomethingToUndo: true, + hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(), + isEmpty: this.#isEmpty() + }); + } + addCommands(params) { + this.#commandManager.add(params); + this.#dispatchUpdateStates({ + hasSomethingToUndo: true, + hasSomethingToRedo: false, + isEmpty: this.#isEmpty() + }); + } + #isEmpty() { + if (this.#allEditors.size === 0) { + return true; + } + if (this.#allEditors.size === 1) { + for (const editor of this.#allEditors.values()) { + return editor.isEmpty(); + } + } + return false; + } + delete() { + this.commitOrRemove(); + if (!this.hasSelection) { + return; + } + const editors = [...this.#selectedEditors]; + const cmd = () => { + for (const editor of editors) { + editor.remove(); + } + }; + const undo = () => { + for (const editor of editors) { + this.#addEditorToLayer(editor); + } + }; + this.addCommands({ + cmd, + undo, + mustExec: true + }); + } + commitOrRemove() { + this.#activeEditor?.commitOrRemove(); + } + hasSomethingToControl() { + return this.#activeEditor || this.hasSelection; + } + #selectEditors(editors) { + this.#selectedEditors.clear(); + for (const editor of editors) { + if (editor.isEmpty()) { + continue; + } + this.#selectedEditors.add(editor); + editor.select(); + } + this.#dispatchUpdateStates({ + hasSelectedEditor: true + }); + } + selectAll() { + for (const editor of this.#selectedEditors) { + editor.commit(); + } + this.#selectEditors(this.#allEditors.values()); + } + unselectAll() { + if (this.#activeEditor) { + this.#activeEditor.commitOrRemove(); + if (this.#mode !== _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType.NONE) { + return; + } + } + if (!this.hasSelection) { + return; + } + for (const editor of this.#selectedEditors) { + editor.unselect(); + } + this.#selectedEditors.clear(); + this.#dispatchUpdateStates({ + hasSelectedEditor: false + }); + } + translateSelectedEditors(x, y, noCommit = false) { + if (!noCommit) { + this.commitOrRemove(); + } + if (!this.hasSelection) { + return; + } + this.#translation[0] += x; + this.#translation[1] += y; + const [totalX, totalY] = this.#translation; + const editors = [...this.#selectedEditors]; + const TIME_TO_WAIT = 1000; + if (this.#translationTimeoutId) { + clearTimeout(this.#translationTimeoutId); + } + this.#translationTimeoutId = setTimeout(() => { + this.#translationTimeoutId = null; + this.#translation[0] = this.#translation[1] = 0; + this.addCommands({ + cmd: () => { + for (const editor of editors) { + if (this.#allEditors.has(editor.id)) { + editor.translateInPage(totalX, totalY); + } + } + }, + undo: () => { + for (const editor of editors) { + if (this.#allEditors.has(editor.id)) { + editor.translateInPage(-totalX, -totalY); + } + } + }, + mustExec: false + }); + }, TIME_TO_WAIT); + for (const editor of editors) { + editor.translateInPage(x, y); + } + } + setUpDragSession() { + if (!this.hasSelection) { + return; + } + this.disableUserSelect(true); + this.#draggingEditors = new Map(); + for (const editor of this.#selectedEditors) { + this.#draggingEditors.set(editor, { + savedX: editor.x, + savedY: editor.y, + savedPageIndex: editor.pageIndex, + newX: 0, + newY: 0, + newPageIndex: -1 + }); + } + } + endDragSession() { + if (!this.#draggingEditors) { + return false; + } + this.disableUserSelect(false); + const map = this.#draggingEditors; + this.#draggingEditors = null; + let mustBeAddedInUndoStack = false; + for (const [{ + x, + y, + pageIndex + }, value] of map) { + value.newX = x; + value.newY = y; + value.newPageIndex = pageIndex; + mustBeAddedInUndoStack ||= x !== value.savedX || y !== value.savedY || pageIndex !== value.savedPageIndex; + } + if (!mustBeAddedInUndoStack) { + return false; + } + const move = (editor, x, y, pageIndex) => { + if (this.#allEditors.has(editor.id)) { + const parent = this.#allLayers.get(pageIndex); + if (parent) { + editor._setParentAndPosition(parent, x, y); + } else { + editor.pageIndex = pageIndex; + editor.x = x; + editor.y = y; + } + } + }; + this.addCommands({ + cmd: () => { + for (const [editor, { + newX, + newY, + newPageIndex + }] of map) { + move(editor, newX, newY, newPageIndex); + } + }, + undo: () => { + for (const [editor, { + savedX, + savedY, + savedPageIndex + }] of map) { + move(editor, savedX, savedY, savedPageIndex); + } + }, + mustExec: true + }); + return true; + } + dragSelectedEditors(tx, ty) { + if (!this.#draggingEditors) { + return; + } + for (const editor of this.#draggingEditors.keys()) { + editor.drag(tx, ty); + } + } + rebuild(editor) { + if (editor.parent === null) { + const parent = this.getLayer(editor.pageIndex); + if (parent) { + parent.changeParent(editor); + parent.addOrRebuild(editor); + } else { + this.addEditor(editor); + this.addToAnnotationStorage(editor); + editor.rebuild(); + } + } else { + editor.parent.addOrRebuild(editor); + } + } + get isEditorHandlingKeyboard() { + return this.getActive()?.shouldGetKeyboardEvents() || this.#selectedEditors.size === 1 && this.firstSelectedEditor.shouldGetKeyboardEvents(); + } + isActive(editor) { + return this.#activeEditor === editor; + } + getActive() { + return this.#activeEditor; + } + getMode() { + return this.#mode; + } + get imageManager() { + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.shadow)(this, "imageManager", new ImageManager()); + } +} + + +/***/ }), + +/***/ 171: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ PDFFetchStream: () => (/* binding */ PDFFetchStream) +/* harmony export */ }); +/* harmony import */ var _shared_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(266); +/* harmony import */ var _network_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(253); + + +; +function createFetchOptions(headers, withCredentials, abortController) { + return { + method: "GET", + headers, + signal: abortController.signal, + mode: "cors", + credentials: withCredentials ? "include" : "same-origin", + redirect: "follow" + }; +} +function createHeaders(httpHeaders) { + const headers = new Headers(); + for (const property in httpHeaders) { + const value = httpHeaders[property]; + if (value === undefined) { + continue; + } + headers.append(property, value); + } + return headers; +} +function getArrayBuffer(val) { + if (val instanceof Uint8Array) { + return val.buffer; + } + if (val instanceof ArrayBuffer) { + return val; + } + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)(`getArrayBuffer - unexpected data format: ${val}`); + return new Uint8Array(val).buffer; +} +class PDFFetchStream { + constructor(source) { + this.source = source; + this.isHttp = /^https?:/i.test(source.url); + this.httpHeaders = this.isHttp && source.httpHeaders || {}; + this._fullRequestReader = null; + this._rangeRequestReaders = []; + } + get _progressiveDataLength() { + return this._fullRequestReader?._loaded ?? 0; + } + getFullReader() { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.assert)(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."); + this._fullRequestReader = new PDFFetchStreamReader(this); + return this._fullRequestReader; + } + getRangeReader(begin, end) { + if (end <= this._progressiveDataLength) { + return null; + } + const reader = new PDFFetchStreamRangeReader(this, begin, end); + this._rangeRequestReaders.push(reader); + return reader; + } + cancelAllRequests(reason) { + this._fullRequestReader?.cancel(reason); + for (const reader of this._rangeRequestReaders.slice(0)) { + reader.cancel(reason); + } + } +} +class PDFFetchStreamReader { + constructor(stream) { + this._stream = stream; + this._reader = null; + this._loaded = 0; + this._filename = null; + const source = stream.source; + this._withCredentials = source.withCredentials || false; + this._contentLength = source.length; + this._headersCapability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + this._disableRange = source.disableRange || false; + this._rangeChunkSize = source.rangeChunkSize; + if (!this._rangeChunkSize && !this._disableRange) { + this._disableRange = true; + } + this._abortController = new AbortController(); + this._isStreamingSupported = !source.disableStream; + this._isRangeSupported = !source.disableRange; + this._headers = createHeaders(this._stream.httpHeaders); + const url = source.url; + fetch(url, createFetchOptions(this._headers, this._withCredentials, this._abortController)).then(response => { + if (!(0,_network_utils_js__WEBPACK_IMPORTED_MODULE_1__.validateResponseStatus)(response.status)) { + throw (0,_network_utils_js__WEBPACK_IMPORTED_MODULE_1__.createResponseStatusError)(response.status, url); + } + this._reader = response.body.getReader(); + this._headersCapability.resolve(); + const getResponseHeader = name => { + return response.headers.get(name); + }; + const { + allowRangeRequests, + suggestedLength + } = (0,_network_utils_js__WEBPACK_IMPORTED_MODULE_1__.validateRangeRequestCapabilities)({ + getResponseHeader, + isHttp: this._stream.isHttp, + rangeChunkSize: this._rangeChunkSize, + disableRange: this._disableRange + }); + this._isRangeSupported = allowRangeRequests; + this._contentLength = suggestedLength || this._contentLength; + this._filename = (0,_network_utils_js__WEBPACK_IMPORTED_MODULE_1__.extractFilenameFromHeader)(getResponseHeader); + if (!this._isStreamingSupported && this._isRangeSupported) { + this.cancel(new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AbortException("Streaming is disabled.")); + } + }).catch(this._headersCapability.reject); + this.onProgress = null; + } + get headersReady() { + return this._headersCapability.promise; + } + get filename() { + return this._filename; + } + get contentLength() { + return this._contentLength; + } + get isRangeSupported() { + return this._isRangeSupported; + } + get isStreamingSupported() { + return this._isStreamingSupported; + } + async read() { + await this._headersCapability.promise; + const { + value, + done + } = await this._reader.read(); + if (done) { + return { + value, + done + }; + } + this._loaded += value.byteLength; + this.onProgress?.({ + loaded: this._loaded, + total: this._contentLength + }); + return { + value: getArrayBuffer(value), + done: false + }; + } + cancel(reason) { + this._reader?.cancel(reason); + this._abortController.abort(); + } +} +class PDFFetchStreamRangeReader { + constructor(stream, begin, end) { + this._stream = stream; + this._reader = null; + this._loaded = 0; + const source = stream.source; + this._withCredentials = source.withCredentials || false; + this._readCapability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + this._isStreamingSupported = !source.disableStream; + this._abortController = new AbortController(); + this._headers = createHeaders(this._stream.httpHeaders); + this._headers.append("Range", `bytes=${begin}-${end - 1}`); + const url = source.url; + fetch(url, createFetchOptions(this._headers, this._withCredentials, this._abortController)).then(response => { + if (!(0,_network_utils_js__WEBPACK_IMPORTED_MODULE_1__.validateResponseStatus)(response.status)) { + throw (0,_network_utils_js__WEBPACK_IMPORTED_MODULE_1__.createResponseStatusError)(response.status, url); + } + this._readCapability.resolve(); + this._reader = response.body.getReader(); + }).catch(this._readCapability.reject); + this.onProgress = null; + } + get isStreamingSupported() { + return this._isStreamingSupported; + } + async read() { + await this._readCapability.promise; + const { + value, + done + } = await this._reader.read(); + if (done) { + return { + value, + done + }; + } + this._loaded += value.byteLength; + this.onProgress?.({ + loaded: this._loaded + }); + return { + value: getArrayBuffer(value), + done: false + }; + } + cancel(reason) { + this._reader?.cancel(reason); + this._abortController.abort(); + } +} + + +/***/ }), + +/***/ 742: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ FontFaceObject: () => (/* binding */ FontFaceObject), +/* harmony export */ FontLoader: () => (/* binding */ FontLoader) +/* harmony export */ }); +/* harmony import */ var _shared_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(266); + +class FontLoader { + #systemFonts = new Set(); + constructor({ + ownerDocument = globalThis.document, + styleElement = null + }) { + this._document = ownerDocument; + this.nativeFontFaces = new Set(); + this.styleElement = null; + this.loadingRequests = []; + this.loadTestFontId = 0; + } + addNativeFontFace(nativeFontFace) { + this.nativeFontFaces.add(nativeFontFace); + this._document.fonts.add(nativeFontFace); + } + removeNativeFontFace(nativeFontFace) { + this.nativeFontFaces.delete(nativeFontFace); + this._document.fonts.delete(nativeFontFace); + } + insertRule(rule) { + if (!this.styleElement) { + this.styleElement = this._document.createElement("style"); + this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement); + } + const styleSheet = this.styleElement.sheet; + styleSheet.insertRule(rule, styleSheet.cssRules.length); + } + clear() { + for (const nativeFontFace of this.nativeFontFaces) { + this._document.fonts.delete(nativeFontFace); + } + this.nativeFontFaces.clear(); + this.#systemFonts.clear(); + if (this.styleElement) { + this.styleElement.remove(); + this.styleElement = null; + } + } + async loadSystemFont({ + systemFontInfo: info, + _inspectFont + }) { + if (!info || this.#systemFonts.has(info.loadedName)) { + return; + } + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.assert)(!this.disableFontFace, "loadSystemFont shouldn't be called when `disableFontFace` is set."); + if (this.isFontLoadingAPISupported) { + const { + loadedName, + src, + style + } = info; + const fontFace = new FontFace(loadedName, src, style); + this.addNativeFontFace(fontFace); + try { + await fontFace.load(); + this.#systemFonts.add(loadedName); + _inspectFont?.(info); + } catch { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)(`Cannot load system font: ${info.baseFontName}, installing it could help to improve PDF rendering.`); + this.removeNativeFontFace(fontFace); + } + return; + } + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.unreachable)("Not implemented: loadSystemFont without the Font Loading API."); + } + async bind(font) { + if (font.attached || font.missingFile && !font.systemFontInfo) { + return; + } + font.attached = true; + if (font.systemFontInfo) { + await this.loadSystemFont(font); + return; + } + if (this.isFontLoadingAPISupported) { + const nativeFontFace = font.createNativeFontFace(); + if (nativeFontFace) { + this.addNativeFontFace(nativeFontFace); + try { + await nativeFontFace.loaded; + } catch (ex) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)(`Failed to load font '${nativeFontFace.family}': '${ex}'.`); + font.disableFontFace = true; + throw ex; + } + } + return; + } + const rule = font.createFontFaceRule(); + if (rule) { + this.insertRule(rule); + if (this.isSyncFontLoadingSupported) { + return; + } + await new Promise(resolve => { + const request = this._queueLoadingCallback(resolve); + this._prepareFontLoadEvent(font, request); + }); + } + } + get isFontLoadingAPISupported() { + const hasFonts = !!this._document?.fonts; + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.shadow)(this, "isFontLoadingAPISupported", hasFonts); + } + get isSyncFontLoadingSupported() { + let supported = false; + if (_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.isNodeJS) { + supported = true; + } else if (typeof navigator !== "undefined" && typeof navigator?.userAgent === "string" && /Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent)) { + supported = true; + } + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.shadow)(this, "isSyncFontLoadingSupported", supported); + } + _queueLoadingCallback(callback) { + function completeRequest() { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.assert)(!request.done, "completeRequest() cannot be called twice."); + request.done = true; + while (loadingRequests.length > 0 && loadingRequests[0].done) { + const otherRequest = loadingRequests.shift(); + setTimeout(otherRequest.callback, 0); + } + } + const { + loadingRequests + } = this; + const request = { + done: false, + complete: completeRequest, + callback + }; + loadingRequests.push(request); + return request; + } + get _loadTestFont() { + const testFont = atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQA" + "FQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAA" + "ALwAAAA2aGhlYQdkA+oAAAD0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AAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAA" + "AAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQAC" + "AQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3" + "Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTj" + "FQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA=="); + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.shadow)(this, "_loadTestFont", testFont); + } + _prepareFontLoadEvent(font, request) { + function int32(data, offset) { + return data.charCodeAt(offset) << 24 | data.charCodeAt(offset + 1) << 16 | data.charCodeAt(offset + 2) << 8 | data.charCodeAt(offset + 3) & 0xff; + } + function spliceString(s, offset, remove, insert) { + const chunk1 = s.substring(0, offset); + const chunk2 = s.substring(offset + remove); + return chunk1 + insert + chunk2; + } + let i, ii; + const canvas = this._document.createElement("canvas"); + canvas.width = 1; + canvas.height = 1; + const ctx = canvas.getContext("2d"); + let called = 0; + function isFontReady(name, callback) { + if (++called > 30) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)("Load test font never loaded."); + callback(); + return; + } + ctx.font = "30px " + name; + ctx.fillText(".", 0, 20); + const imageData = ctx.getImageData(0, 0, 1, 1); + if (imageData.data[3] > 0) { + callback(); + return; + } + setTimeout(isFontReady.bind(null, name, callback)); + } + const loadTestFontId = `lt${Date.now()}${this.loadTestFontId++}`; + let data = this._loadTestFont; + const COMMENT_OFFSET = 976; + data = spliceString(data, COMMENT_OFFSET, loadTestFontId.length, loadTestFontId); + const CFF_CHECKSUM_OFFSET = 16; + const XXXX_VALUE = 0x58585858; + let checksum = int32(data, CFF_CHECKSUM_OFFSET); + for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) { + checksum = checksum - XXXX_VALUE + int32(loadTestFontId, i) | 0; + } + if (i < loadTestFontId.length) { + checksum = checksum - XXXX_VALUE + int32(loadTestFontId + "XXX", i) | 0; + } + data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.string32)(checksum)); + const url = `url(data:font/opentype;base64,${btoa(data)});`; + const rule = `@font-face {font-family:"${loadTestFontId}";src:${url}}`; + this.insertRule(rule); + const div = this._document.createElement("div"); + div.style.visibility = "hidden"; + div.style.width = div.style.height = "10px"; + div.style.position = "absolute"; + div.style.top = div.style.left = "0px"; + for (const name of [font.loadedName, loadTestFontId]) { + const span = this._document.createElement("span"); + span.textContent = "Hi"; + span.style.fontFamily = name; + div.append(span); + } + this._document.body.append(div); + isFontReady(loadTestFontId, () => { + div.remove(); + request.complete(); + }); + } +} +class FontFaceObject { + constructor(translatedData, { + isEvalSupported = true, + disableFontFace = false, + ignoreErrors = false, + inspectFont = null + }) { + this.compiledGlyphs = Object.create(null); + for (const i in translatedData) { + this[i] = translatedData[i]; + } + this.isEvalSupported = isEvalSupported !== false; + this.disableFontFace = disableFontFace === true; + this.ignoreErrors = ignoreErrors === true; + this._inspectFont = inspectFont; + } + createNativeFontFace() { + if (!this.data || this.disableFontFace) { + return null; + } + let nativeFontFace; + if (!this.cssFontInfo) { + nativeFontFace = new FontFace(this.loadedName, this.data, {}); + } else { + const css = { + weight: this.cssFontInfo.fontWeight + }; + if (this.cssFontInfo.italicAngle) { + css.style = `oblique ${this.cssFontInfo.italicAngle}deg`; + } + nativeFontFace = new FontFace(this.cssFontInfo.fontFamily, this.data, css); + } + this._inspectFont?.(this); + return nativeFontFace; + } + createFontFaceRule() { + if (!this.data || this.disableFontFace) { + return null; + } + const data = (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.bytesToString)(this.data); + const url = `url(data:${this.mimetype};base64,${btoa(data)});`; + let rule; + if (!this.cssFontInfo) { + rule = `@font-face {font-family:"${this.loadedName}";src:${url}}`; + } else { + let css = `font-weight: ${this.cssFontInfo.fontWeight};`; + if (this.cssFontInfo.italicAngle) { + css += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`; + } + rule = `@font-face {font-family:"${this.cssFontInfo.fontFamily}";${css}src:${url}}`; + } + this._inspectFont?.(this, url); + return rule; + } + getPathGenerator(objs, character) { + if (this.compiledGlyphs[character] !== undefined) { + return this.compiledGlyphs[character]; + } + let cmds; + try { + cmds = objs.get(this.loadedName + "_path_" + character); + } catch (ex) { + if (!this.ignoreErrors) { + throw ex; + } + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)(`getPathGenerator - ignoring character: "${ex}".`); + return this.compiledGlyphs[character] = function (c, size) {}; + } + if (this.isEvalSupported && _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.FeatureTest.isEvalSupported) { + const jsBuf = []; + for (const current of cmds) { + const args = current.args !== undefined ? current.args.join(",") : ""; + jsBuf.push("c.", current.cmd, "(", args, ");\n"); + } + return this.compiledGlyphs[character] = new Function("c", "size", jsBuf.join("")); + } + return this.compiledGlyphs[character] = function (c, size) { + for (const current of cmds) { + if (current.cmd === "scale") { + current.args = [size, -size]; + } + c[current.cmd].apply(c, current.args); + } + }; + } +} + + +/***/ }), + +/***/ 472: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ Metadata: () => (/* binding */ Metadata) +/* harmony export */ }); +/* harmony import */ var _shared_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(266); + +class Metadata { + #metadataMap; + #data; + constructor({ + parsedData, + rawData + }) { + this.#metadataMap = parsedData; + this.#data = rawData; + } + getRaw() { + return this.#data; + } + get(name) { + return this.#metadataMap.get(name) ?? null; + } + getAll() { + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.objectFromMap)(this.#metadataMap); + } + has(name) { + return this.#metadataMap.has(name); + } +} + + +/***/ }), + +/***/ 474: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ PDFNetworkStream: () => (/* binding */ PDFNetworkStream) +/* harmony export */ }); +/* harmony import */ var _shared_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(266); +/* harmony import */ var _network_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(253); + + +; +const OK_RESPONSE = 200; +const PARTIAL_CONTENT_RESPONSE = 206; +function getArrayBuffer(xhr) { + const data = xhr.response; + if (typeof data !== "string") { + return data; + } + return (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.stringToBytes)(data).buffer; +} +class NetworkManager { + constructor(url, args = {}) { + this.url = url; + this.isHttp = /^https?:/i.test(url); + this.httpHeaders = this.isHttp && args.httpHeaders || Object.create(null); + this.withCredentials = args.withCredentials || false; + this.currXhrId = 0; + this.pendingRequests = Object.create(null); + } + requestRange(begin, end, listeners) { + const args = { + begin, + end + }; + for (const prop in listeners) { + args[prop] = listeners[prop]; + } + return this.request(args); + } + requestFull(listeners) { + return this.request(listeners); + } + request(args) { + const xhr = new XMLHttpRequest(); + const xhrId = this.currXhrId++; + const pendingRequest = this.pendingRequests[xhrId] = { + xhr + }; + xhr.open("GET", this.url); + xhr.withCredentials = this.withCredentials; + for (const property in this.httpHeaders) { + const value = this.httpHeaders[property]; + if (value === undefined) { + continue; + } + xhr.setRequestHeader(property, value); + } + if (this.isHttp && "begin" in args && "end" in args) { + xhr.setRequestHeader("Range", `bytes=${args.begin}-${args.end - 1}`); + pendingRequest.expectedStatus = PARTIAL_CONTENT_RESPONSE; + } else { + pendingRequest.expectedStatus = OK_RESPONSE; + } + xhr.responseType = "arraybuffer"; + if (args.onError) { + xhr.onerror = function (evt) { + args.onError(xhr.status); + }; + } + xhr.onreadystatechange = this.onStateChange.bind(this, xhrId); + xhr.onprogress = this.onProgress.bind(this, xhrId); + pendingRequest.onHeadersReceived = args.onHeadersReceived; + pendingRequest.onDone = args.onDone; + pendingRequest.onError = args.onError; + pendingRequest.onProgress = args.onProgress; + xhr.send(null); + return xhrId; + } + onProgress(xhrId, evt) { + const pendingRequest = this.pendingRequests[xhrId]; + if (!pendingRequest) { + return; + } + pendingRequest.onProgress?.(evt); + } + onStateChange(xhrId, evt) { + const pendingRequest = this.pendingRequests[xhrId]; + if (!pendingRequest) { + return; + } + const xhr = pendingRequest.xhr; + if (xhr.readyState >= 2 && pendingRequest.onHeadersReceived) { + pendingRequest.onHeadersReceived(); + delete pendingRequest.onHeadersReceived; + } + if (xhr.readyState !== 4) { + return; + } + if (!(xhrId in this.pendingRequests)) { + return; + } + delete this.pendingRequests[xhrId]; + if (xhr.status === 0 && this.isHttp) { + pendingRequest.onError?.(xhr.status); + return; + } + const xhrStatus = xhr.status || OK_RESPONSE; + const ok_response_on_range_request = xhrStatus === OK_RESPONSE && pendingRequest.expectedStatus === PARTIAL_CONTENT_RESPONSE; + if (!ok_response_on_range_request && xhrStatus !== pendingRequest.expectedStatus) { + pendingRequest.onError?.(xhr.status); + return; + } + const chunk = getArrayBuffer(xhr); + if (xhrStatus === PARTIAL_CONTENT_RESPONSE) { + const rangeHeader = xhr.getResponseHeader("Content-Range"); + const matches = /bytes (\d+)-(\d+)\/(\d+)/.exec(rangeHeader); + pendingRequest.onDone({ + begin: parseInt(matches[1], 10), + chunk + }); + } else if (chunk) { + pendingRequest.onDone({ + begin: 0, + chunk + }); + } else { + pendingRequest.onError?.(xhr.status); + } + } + getRequestXhr(xhrId) { + return this.pendingRequests[xhrId].xhr; + } + isPendingRequest(xhrId) { + return xhrId in this.pendingRequests; + } + abortRequest(xhrId) { + const xhr = this.pendingRequests[xhrId].xhr; + delete this.pendingRequests[xhrId]; + xhr.abort(); + } +} +class PDFNetworkStream { + constructor(source) { + this._source = source; + this._manager = new NetworkManager(source.url, { + httpHeaders: source.httpHeaders, + withCredentials: source.withCredentials + }); + this._rangeChunkSize = source.rangeChunkSize; + this._fullRequestReader = null; + this._rangeRequestReaders = []; + } + _onRangeRequestReaderClosed(reader) { + const i = this._rangeRequestReaders.indexOf(reader); + if (i >= 0) { + this._rangeRequestReaders.splice(i, 1); + } + } + getFullReader() { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.assert)(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."); + this._fullRequestReader = new PDFNetworkStreamFullRequestReader(this._manager, this._source); + return this._fullRequestReader; + } + getRangeReader(begin, end) { + const reader = new PDFNetworkStreamRangeRequestReader(this._manager, begin, end); + reader.onClosed = this._onRangeRequestReaderClosed.bind(this); + this._rangeRequestReaders.push(reader); + return reader; + } + cancelAllRequests(reason) { + this._fullRequestReader?.cancel(reason); + for (const reader of this._rangeRequestReaders.slice(0)) { + reader.cancel(reason); + } + } +} +class PDFNetworkStreamFullRequestReader { + constructor(manager, source) { + this._manager = manager; + const args = { + onHeadersReceived: this._onHeadersReceived.bind(this), + onDone: this._onDone.bind(this), + onError: this._onError.bind(this), + onProgress: this._onProgress.bind(this) + }; + this._url = source.url; + this._fullRequestId = manager.requestFull(args); + this._headersReceivedCapability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + this._disableRange = source.disableRange || false; + this._contentLength = source.length; + this._rangeChunkSize = source.rangeChunkSize; + if (!this._rangeChunkSize && !this._disableRange) { + this._disableRange = true; + } + this._isStreamingSupported = false; + this._isRangeSupported = false; + this._cachedChunks = []; + this._requests = []; + this._done = false; + this._storedError = undefined; + this._filename = null; + this.onProgress = null; + } + _onHeadersReceived() { + const fullRequestXhrId = this._fullRequestId; + const fullRequestXhr = this._manager.getRequestXhr(fullRequestXhrId); + const getResponseHeader = name => { + return fullRequestXhr.getResponseHeader(name); + }; + const { + allowRangeRequests, + suggestedLength + } = (0,_network_utils_js__WEBPACK_IMPORTED_MODULE_1__.validateRangeRequestCapabilities)({ + getResponseHeader, + isHttp: this._manager.isHttp, + rangeChunkSize: this._rangeChunkSize, + disableRange: this._disableRange + }); + if (allowRangeRequests) { + this._isRangeSupported = true; + } + this._contentLength = suggestedLength || this._contentLength; + this._filename = (0,_network_utils_js__WEBPACK_IMPORTED_MODULE_1__.extractFilenameFromHeader)(getResponseHeader); + if (this._isRangeSupported) { + this._manager.abortRequest(fullRequestXhrId); + } + this._headersReceivedCapability.resolve(); + } + _onDone(data) { + if (data) { + if (this._requests.length > 0) { + const requestCapability = this._requests.shift(); + requestCapability.resolve({ + value: data.chunk, + done: false + }); + } else { + this._cachedChunks.push(data.chunk); + } + } + this._done = true; + if (this._cachedChunks.length > 0) { + return; + } + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + this._requests.length = 0; + } + _onError(status) { + this._storedError = (0,_network_utils_js__WEBPACK_IMPORTED_MODULE_1__.createResponseStatusError)(status, this._url); + this._headersReceivedCapability.reject(this._storedError); + for (const requestCapability of this._requests) { + requestCapability.reject(this._storedError); + } + this._requests.length = 0; + this._cachedChunks.length = 0; + } + _onProgress(evt) { + this.onProgress?.({ + loaded: evt.loaded, + total: evt.lengthComputable ? evt.total : this._contentLength + }); + } + get filename() { + return this._filename; + } + get isRangeSupported() { + return this._isRangeSupported; + } + get isStreamingSupported() { + return this._isStreamingSupported; + } + get contentLength() { + return this._contentLength; + } + get headersReady() { + return this._headersReceivedCapability.promise; + } + async read() { + if (this._storedError) { + throw this._storedError; + } + if (this._cachedChunks.length > 0) { + const chunk = this._cachedChunks.shift(); + return { + value: chunk, + done: false + }; + } + if (this._done) { + return { + value: undefined, + done: true + }; + } + const requestCapability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + this._requests.push(requestCapability); + return requestCapability.promise; + } + cancel(reason) { + this._done = true; + this._headersReceivedCapability.reject(reason); + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + this._requests.length = 0; + if (this._manager.isPendingRequest(this._fullRequestId)) { + this._manager.abortRequest(this._fullRequestId); + } + this._fullRequestReader = null; + } +} +class PDFNetworkStreamRangeRequestReader { + constructor(manager, begin, end) { + this._manager = manager; + const args = { + onDone: this._onDone.bind(this), + onError: this._onError.bind(this), + onProgress: this._onProgress.bind(this) + }; + this._url = manager.url; + this._requestId = manager.requestRange(begin, end, args); + this._requests = []; + this._queuedChunk = null; + this._done = false; + this._storedError = undefined; + this.onProgress = null; + this.onClosed = null; + } + _close() { + this.onClosed?.(this); + } + _onDone(data) { + const chunk = data.chunk; + if (this._requests.length > 0) { + const requestCapability = this._requests.shift(); + requestCapability.resolve({ + value: chunk, + done: false + }); + } else { + this._queuedChunk = chunk; + } + this._done = true; + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + this._requests.length = 0; + this._close(); + } + _onError(status) { + this._storedError = (0,_network_utils_js__WEBPACK_IMPORTED_MODULE_1__.createResponseStatusError)(status, this._url); + for (const requestCapability of this._requests) { + requestCapability.reject(this._storedError); + } + this._requests.length = 0; + this._queuedChunk = null; + } + _onProgress(evt) { + if (!this.isStreamingSupported) { + this.onProgress?.({ + loaded: evt.loaded + }); + } + } + get isStreamingSupported() { + return false; + } + async read() { + if (this._storedError) { + throw this._storedError; + } + if (this._queuedChunk !== null) { + const chunk = this._queuedChunk; + this._queuedChunk = null; + return { + value: chunk, + done: false + }; + } + if (this._done) { + return { + value: undefined, + done: true + }; + } + const requestCapability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + this._requests.push(requestCapability); + return requestCapability.promise; + } + cancel(reason) { + this._done = true; + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + this._requests.length = 0; + if (this._manager.isPendingRequest(this._requestId)) { + this._manager.abortRequest(this._requestId); + } + this._close(); + } +} + + +/***/ }), + +/***/ 253: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + createResponseStatusError: () => (/* binding */ createResponseStatusError), + extractFilenameFromHeader: () => (/* binding */ extractFilenameFromHeader), + validateRangeRequestCapabilities: () => (/* binding */ validateRangeRequestCapabilities), + validateResponseStatus: () => (/* binding */ validateResponseStatus) +}); + +// EXTERNAL MODULE: ./src/shared/util.js +var util = __webpack_require__(266); +;// CONCATENATED MODULE: ./src/display/content_disposition.js + +function getFilenameFromContentDispositionHeader(contentDisposition) { + let needsEncodingFixup = true; + let tmp = toParamRegExp("filename\\*", "i").exec(contentDisposition); + if (tmp) { + tmp = tmp[1]; + let filename = rfc2616unquote(tmp); + filename = unescape(filename); + filename = rfc5987decode(filename); + filename = rfc2047decode(filename); + return fixupEncoding(filename); + } + tmp = rfc2231getparam(contentDisposition); + if (tmp) { + const filename = rfc2047decode(tmp); + return fixupEncoding(filename); + } + tmp = toParamRegExp("filename", "i").exec(contentDisposition); + if (tmp) { + tmp = tmp[1]; + let filename = rfc2616unquote(tmp); + filename = rfc2047decode(filename); + return fixupEncoding(filename); + } + function toParamRegExp(attributePattern, flags) { + return new RegExp("(?:^|;)\\s*" + attributePattern + "\\s*=\\s*" + "(" + '[^";\\s][^;\\s]*' + "|" + '"(?:[^"\\\\]|\\\\"?)+"?' + ")", flags); + } + function textdecode(encoding, value) { + if (encoding) { + if (!/^[\x00-\xFF]+$/.test(value)) { + return value; + } + try { + const decoder = new TextDecoder(encoding, { + fatal: true + }); + const buffer = (0,util.stringToBytes)(value); + value = decoder.decode(buffer); + needsEncodingFixup = false; + } catch {} + } + return value; + } + function fixupEncoding(value) { + if (needsEncodingFixup && /[\x80-\xff]/.test(value)) { + value = textdecode("utf-8", value); + if (needsEncodingFixup) { + value = textdecode("iso-8859-1", value); + } + } + return value; + } + function rfc2231getparam(contentDispositionStr) { + const matches = []; + let match; + const iter = toParamRegExp("filename\\*((?!0\\d)\\d+)(\\*?)", "ig"); + while ((match = iter.exec(contentDispositionStr)) !== null) { + let [, n, quot, part] = match; + n = parseInt(n, 10); + if (n in matches) { + if (n === 0) { + break; + } + continue; + } + matches[n] = [quot, part]; + } + const parts = []; + for (let n = 0; n < matches.length; ++n) { + if (!(n in matches)) { + break; + } + let [quot, part] = matches[n]; + part = rfc2616unquote(part); + if (quot) { + part = unescape(part); + if (n === 0) { + part = rfc5987decode(part); + } + } + parts.push(part); + } + return parts.join(""); + } + function rfc2616unquote(value) { + if (value.startsWith('"')) { + const parts = value.slice(1).split('\\"'); + for (let i = 0; i < parts.length; ++i) { + const quotindex = parts[i].indexOf('"'); + if (quotindex !== -1) { + parts[i] = parts[i].slice(0, quotindex); + parts.length = i + 1; + } + parts[i] = parts[i].replaceAll(/\\(.)/g, "$1"); + } + value = parts.join('"'); + } + return value; + } + function rfc5987decode(extvalue) { + const encodingend = extvalue.indexOf("'"); + if (encodingend === -1) { + return extvalue; + } + const encoding = extvalue.slice(0, encodingend); + const langvalue = extvalue.slice(encodingend + 1); + const value = langvalue.replace(/^[^']*'/, ""); + return textdecode(encoding, value); + } + function rfc2047decode(value) { + if (!value.startsWith("=?") || /[\x00-\x19\x80-\xff]/.test(value)) { + return value; + } + return value.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g, function (matches, charset, encoding, text) { + if (encoding === "q" || encoding === "Q") { + text = text.replaceAll("_", " "); + text = text.replaceAll(/=([0-9a-fA-F]{2})/g, function (match, hex) { + return String.fromCharCode(parseInt(hex, 16)); + }); + return textdecode(charset, text); + } + try { + text = atob(text); + } catch {} + return textdecode(charset, text); + }); + } + return ""; +} + +// EXTERNAL MODULE: ./src/display/display_utils.js +var display_utils = __webpack_require__(473); +;// CONCATENATED MODULE: ./src/display/network_utils.js + + + +function validateRangeRequestCapabilities({ + getResponseHeader, + isHttp, + rangeChunkSize, + disableRange +}) { + const returnValues = { + allowRangeRequests: false, + suggestedLength: undefined + }; + const length = parseInt(getResponseHeader("Content-Length"), 10); + if (!Number.isInteger(length)) { + return returnValues; + } + returnValues.suggestedLength = length; + if (length <= 2 * rangeChunkSize) { + return returnValues; + } + if (disableRange || !isHttp) { + return returnValues; + } + if (getResponseHeader("Accept-Ranges") !== "bytes") { + return returnValues; + } + const contentEncoding = getResponseHeader("Content-Encoding") || "identity"; + if (contentEncoding !== "identity") { + return returnValues; + } + returnValues.allowRangeRequests = true; + return returnValues; +} +function extractFilenameFromHeader(getResponseHeader) { + const contentDisposition = getResponseHeader("Content-Disposition"); + if (contentDisposition) { + let filename = getFilenameFromContentDispositionHeader(contentDisposition); + if (filename.includes("%")) { + try { + filename = decodeURIComponent(filename); + } catch {} + } + if ((0,display_utils.isPdfFile)(filename)) { + return filename; + } + } + return null; +} +function createResponseStatusError(status, url) { + if (status === 404 || status === 0 && url.startsWith("file:")) { + return new util.MissingPDFException('Missing PDF "' + url + '".'); + } + return new util.UnexpectedResponseException(`Unexpected server response (${status}) while retrieving PDF "${url}".`, status); +} +function validateResponseStatus(status) { + return status === 200 || status === 206; +} + + +/***/ }), + +/***/ 498: +/***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ PDFNodeStream: () => (/* binding */ PDFNodeStream) +/* harmony export */ }); +/* harmony import */ var _shared_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(266); +/* harmony import */ var _network_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(253); + + +; +let fs, http, https, url; +if (_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.isNodeJS) { + fs = await import(/* webpackIgnore: true */ "fs"); + http = await import(/* webpackIgnore: true */ "http"); + https = await import(/* webpackIgnore: true */ "https"); + url = await import(/* webpackIgnore: true */ "url"); +} +const fileUriRegex = /^file:\/\/\/[a-zA-Z]:\//; +function parseUrl(sourceUrl) { + const parsedUrl = url.parse(sourceUrl); + if (parsedUrl.protocol === "file:" || parsedUrl.host) { + return parsedUrl; + } + if (/^[a-z]:[/\\]/i.test(sourceUrl)) { + return url.parse(`file:///${sourceUrl}`); + } + if (!parsedUrl.host) { + parsedUrl.protocol = "file:"; + } + return parsedUrl; +} +class PDFNodeStream { + constructor(source) { + this.source = source; + this.url = parseUrl(source.url); + this.isHttp = this.url.protocol === "http:" || this.url.protocol === "https:"; + this.isFsUrl = this.url.protocol === "file:"; + this.httpHeaders = this.isHttp && source.httpHeaders || {}; + this._fullRequestReader = null; + this._rangeRequestReaders = []; + } + get _progressiveDataLength() { + return this._fullRequestReader?._loaded ?? 0; + } + getFullReader() { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.assert)(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."); + this._fullRequestReader = this.isFsUrl ? new PDFNodeStreamFsFullReader(this) : new PDFNodeStreamFullReader(this); + return this._fullRequestReader; + } + getRangeReader(start, end) { + if (end <= this._progressiveDataLength) { + return null; + } + const rangeReader = this.isFsUrl ? new PDFNodeStreamFsRangeReader(this, start, end) : new PDFNodeStreamRangeReader(this, start, end); + this._rangeRequestReaders.push(rangeReader); + return rangeReader; + } + cancelAllRequests(reason) { + this._fullRequestReader?.cancel(reason); + for (const reader of this._rangeRequestReaders.slice(0)) { + reader.cancel(reason); + } + } +} +class BaseFullReader { + constructor(stream) { + this._url = stream.url; + this._done = false; + this._storedError = null; + this.onProgress = null; + const source = stream.source; + this._contentLength = source.length; + this._loaded = 0; + this._filename = null; + this._disableRange = source.disableRange || false; + this._rangeChunkSize = source.rangeChunkSize; + if (!this._rangeChunkSize && !this._disableRange) { + this._disableRange = true; + } + this._isStreamingSupported = !source.disableStream; + this._isRangeSupported = !source.disableRange; + this._readableStream = null; + this._readCapability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + this._headersCapability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + } + get headersReady() { + return this._headersCapability.promise; + } + get filename() { + return this._filename; + } + get contentLength() { + return this._contentLength; + } + get isRangeSupported() { + return this._isRangeSupported; + } + get isStreamingSupported() { + return this._isStreamingSupported; + } + async read() { + await this._readCapability.promise; + if (this._done) { + return { + value: undefined, + done: true + }; + } + if (this._storedError) { + throw this._storedError; + } + const chunk = this._readableStream.read(); + if (chunk === null) { + this._readCapability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + return this.read(); + } + this._loaded += chunk.length; + this.onProgress?.({ + loaded: this._loaded, + total: this._contentLength + }); + const buffer = new Uint8Array(chunk).buffer; + return { + value: buffer, + done: false + }; + } + cancel(reason) { + if (!this._readableStream) { + this._error(reason); + return; + } + this._readableStream.destroy(reason); + } + _error(reason) { + this._storedError = reason; + this._readCapability.resolve(); + } + _setReadableStream(readableStream) { + this._readableStream = readableStream; + readableStream.on("readable", () => { + this._readCapability.resolve(); + }); + readableStream.on("end", () => { + readableStream.destroy(); + this._done = true; + this._readCapability.resolve(); + }); + readableStream.on("error", reason => { + this._error(reason); + }); + if (!this._isStreamingSupported && this._isRangeSupported) { + this._error(new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AbortException("streaming is disabled")); + } + if (this._storedError) { + this._readableStream.destroy(this._storedError); + } + } +} +class BaseRangeReader { + constructor(stream) { + this._url = stream.url; + this._done = false; + this._storedError = null; + this.onProgress = null; + this._loaded = 0; + this._readableStream = null; + this._readCapability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + const source = stream.source; + this._isStreamingSupported = !source.disableStream; + } + get isStreamingSupported() { + return this._isStreamingSupported; + } + async read() { + await this._readCapability.promise; + if (this._done) { + return { + value: undefined, + done: true + }; + } + if (this._storedError) { + throw this._storedError; + } + const chunk = this._readableStream.read(); + if (chunk === null) { + this._readCapability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + return this.read(); + } + this._loaded += chunk.length; + this.onProgress?.({ + loaded: this._loaded + }); + const buffer = new Uint8Array(chunk).buffer; + return { + value: buffer, + done: false + }; + } + cancel(reason) { + if (!this._readableStream) { + this._error(reason); + return; + } + this._readableStream.destroy(reason); + } + _error(reason) { + this._storedError = reason; + this._readCapability.resolve(); + } + _setReadableStream(readableStream) { + this._readableStream = readableStream; + readableStream.on("readable", () => { + this._readCapability.resolve(); + }); + readableStream.on("end", () => { + readableStream.destroy(); + this._done = true; + this._readCapability.resolve(); + }); + readableStream.on("error", reason => { + this._error(reason); + }); + if (this._storedError) { + this._readableStream.destroy(this._storedError); + } + } +} +function createRequestOptions(parsedUrl, headers) { + return { + protocol: parsedUrl.protocol, + auth: parsedUrl.auth, + host: parsedUrl.hostname, + port: parsedUrl.port, + path: parsedUrl.path, + method: "GET", + headers + }; +} +class PDFNodeStreamFullReader extends BaseFullReader { + constructor(stream) { + super(stream); + const handleResponse = response => { + if (response.statusCode === 404) { + const error = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.MissingPDFException(`Missing PDF "${this._url}".`); + this._storedError = error; + this._headersCapability.reject(error); + return; + } + this._headersCapability.resolve(); + this._setReadableStream(response); + const getResponseHeader = name => { + return this._readableStream.headers[name.toLowerCase()]; + }; + const { + allowRangeRequests, + suggestedLength + } = (0,_network_utils_js__WEBPACK_IMPORTED_MODULE_1__.validateRangeRequestCapabilities)({ + getResponseHeader, + isHttp: stream.isHttp, + rangeChunkSize: this._rangeChunkSize, + disableRange: this._disableRange + }); + this._isRangeSupported = allowRangeRequests; + this._contentLength = suggestedLength || this._contentLength; + this._filename = (0,_network_utils_js__WEBPACK_IMPORTED_MODULE_1__.extractFilenameFromHeader)(getResponseHeader); + }; + this._request = null; + if (this._url.protocol === "http:") { + this._request = http.request(createRequestOptions(this._url, stream.httpHeaders), handleResponse); + } else { + this._request = https.request(createRequestOptions(this._url, stream.httpHeaders), handleResponse); + } + this._request.on("error", reason => { + this._storedError = reason; + this._headersCapability.reject(reason); + }); + this._request.end(); + } +} +class PDFNodeStreamRangeReader extends BaseRangeReader { + constructor(stream, start, end) { + super(stream); + this._httpHeaders = {}; + for (const property in stream.httpHeaders) { + const value = stream.httpHeaders[property]; + if (value === undefined) { + continue; + } + this._httpHeaders[property] = value; + } + this._httpHeaders.Range = `bytes=${start}-${end - 1}`; + const handleResponse = response => { + if (response.statusCode === 404) { + const error = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.MissingPDFException(`Missing PDF "${this._url}".`); + this._storedError = error; + return; + } + this._setReadableStream(response); + }; + this._request = null; + if (this._url.protocol === "http:") { + this._request = http.request(createRequestOptions(this._url, this._httpHeaders), handleResponse); + } else { + this._request = https.request(createRequestOptions(this._url, this._httpHeaders), handleResponse); + } + this._request.on("error", reason => { + this._storedError = reason; + }); + this._request.end(); + } +} +class PDFNodeStreamFsFullReader extends BaseFullReader { + constructor(stream) { + super(stream); + let path = decodeURIComponent(this._url.path); + if (fileUriRegex.test(this._url.href)) { + path = path.replace(/^\//, ""); + } + fs.lstat(path, (error, stat) => { + if (error) { + if (error.code === "ENOENT") { + error = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.MissingPDFException(`Missing PDF "${path}".`); + } + this._storedError = error; + this._headersCapability.reject(error); + return; + } + this._contentLength = stat.size; + this._setReadableStream(fs.createReadStream(path)); + this._headersCapability.resolve(); + }); + } +} +class PDFNodeStreamFsRangeReader extends BaseRangeReader { + constructor(stream, start, end) { + super(stream); + let path = decodeURIComponent(this._url.path); + if (fileUriRegex.test(this._url.href)) { + path = path.replace(/^\//, ""); + } + this._setReadableStream(fs.createReadStream(path, { + start, + end: end - 1 + })); + } +} + +__webpack_async_result__(); +} catch(e) { __webpack_async_result__(e); } }, 1); + +/***/ }), + +/***/ 738: +/***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ NodeCMapReaderFactory: () => (/* binding */ NodeCMapReaderFactory), +/* harmony export */ NodeCanvasFactory: () => (/* binding */ NodeCanvasFactory), +/* harmony export */ NodeFilterFactory: () => (/* binding */ NodeFilterFactory), +/* harmony export */ NodeStandardFontDataFactory: () => (/* binding */ NodeStandardFontDataFactory) +/* harmony export */ }); +/* harmony import */ var _base_factory_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(822); +/* harmony import */ var _shared_util_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(266); + + +; +let fs, canvas, path2d_polyfill; +if (_shared_util_js__WEBPACK_IMPORTED_MODULE_1__.isNodeJS) { + fs = await import(/* webpackIgnore: true */ "fs"); + try { + canvas = await import(/* webpackIgnore: true */ "canvas"); + } catch {} + try { + path2d_polyfill = await import(/* webpackIgnore: true */ "path2d-polyfill"); + } catch {} +} +; +const fetchData = function (url) { + return new Promise((resolve, reject) => { + fs.readFile(url, (error, data) => { + if (error || !data) { + reject(new Error(error)); + return; + } + resolve(new Uint8Array(data)); + }); + }); +}; +class NodeFilterFactory extends _base_factory_js__WEBPACK_IMPORTED_MODULE_0__.BaseFilterFactory {} +class NodeCanvasFactory extends _base_factory_js__WEBPACK_IMPORTED_MODULE_0__.BaseCanvasFactory { + _createCanvas(width, height) { + return canvas.createCanvas(width, height); + } +} +class NodeCMapReaderFactory extends _base_factory_js__WEBPACK_IMPORTED_MODULE_0__.BaseCMapReaderFactory { + _fetchData(url, compressionType) { + return fetchData(url).then(data => { + return { + cMapData: data, + compressionType + }; + }); + } +} +class NodeStandardFontDataFactory extends _base_factory_js__WEBPACK_IMPORTED_MODULE_0__.BaseStandardFontDataFactory { + _fetchData(url) { + return fetchData(url); + } +} + +__webpack_async_result__(); +} catch(e) { __webpack_async_result__(e); } }, 1); + +/***/ }), + +/***/ 890: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ OptionalContentConfig: () => (/* binding */ OptionalContentConfig) +/* harmony export */ }); +/* harmony import */ var _shared_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(266); +/* harmony import */ var _shared_murmurhash3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(825); + + +const INTERNAL = Symbol("INTERNAL"); +class OptionalContentGroup { + #visible = true; + constructor(name, intent) { + this.name = name; + this.intent = intent; + } + get visible() { + return this.#visible; + } + _setVisible(internal, visible) { + if (internal !== INTERNAL) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.unreachable)("Internal method `_setVisible` called."); + } + this.#visible = visible; + } +} +class OptionalContentConfig { + #cachedGetHash = null; + #groups = new Map(); + #initialHash = null; + #order = null; + constructor(data) { + this.name = null; + this.creator = null; + if (data === null) { + return; + } + this.name = data.name; + this.creator = data.creator; + this.#order = data.order; + for (const group of data.groups) { + this.#groups.set(group.id, new OptionalContentGroup(group.name, group.intent)); + } + if (data.baseState === "OFF") { + for (const group of this.#groups.values()) { + group._setVisible(INTERNAL, false); + } + } + for (const on of data.on) { + this.#groups.get(on)._setVisible(INTERNAL, true); + } + for (const off of data.off) { + this.#groups.get(off)._setVisible(INTERNAL, false); + } + this.#initialHash = this.getHash(); + } + #evaluateVisibilityExpression(array) { + const length = array.length; + if (length < 2) { + return true; + } + const operator = array[0]; + for (let i = 1; i < length; i++) { + const element = array[i]; + let state; + if (Array.isArray(element)) { + state = this.#evaluateVisibilityExpression(element); + } else if (this.#groups.has(element)) { + state = this.#groups.get(element).visible; + } else { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)(`Optional content group not found: ${element}`); + return true; + } + switch (operator) { + case "And": + if (!state) { + return false; + } + break; + case "Or": + if (state) { + return true; + } + break; + case "Not": + return !state; + default: + return true; + } + } + return operator === "And"; + } + isVisible(group) { + if (this.#groups.size === 0) { + return true; + } + if (!group) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)("Optional content group not defined."); + return true; + } + if (group.type === "OCG") { + if (!this.#groups.has(group.id)) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)(`Optional content group not found: ${group.id}`); + return true; + } + return this.#groups.get(group.id).visible; + } else if (group.type === "OCMD") { + if (group.expression) { + return this.#evaluateVisibilityExpression(group.expression); + } + if (!group.policy || group.policy === "AnyOn") { + for (const id of group.ids) { + if (!this.#groups.has(id)) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)(`Optional content group not found: ${id}`); + return true; + } + if (this.#groups.get(id).visible) { + return true; + } + } + return false; + } else if (group.policy === "AllOn") { + for (const id of group.ids) { + if (!this.#groups.has(id)) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)(`Optional content group not found: ${id}`); + return true; + } + if (!this.#groups.get(id).visible) { + return false; + } + } + return true; + } else if (group.policy === "AnyOff") { + for (const id of group.ids) { + if (!this.#groups.has(id)) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)(`Optional content group not found: ${id}`); + return true; + } + if (!this.#groups.get(id).visible) { + return true; + } + } + return false; + } else if (group.policy === "AllOff") { + for (const id of group.ids) { + if (!this.#groups.has(id)) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)(`Optional content group not found: ${id}`); + return true; + } + if (this.#groups.get(id).visible) { + return false; + } + } + return true; + } + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)(`Unknown optional content policy ${group.policy}.`); + return true; + } + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)(`Unknown group type ${group.type}.`); + return true; + } + setVisibility(id, visible = true) { + if (!this.#groups.has(id)) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.warn)(`Optional content group not found: ${id}`); + return; + } + this.#groups.get(id)._setVisible(INTERNAL, !!visible); + this.#cachedGetHash = null; + } + get hasInitialVisibility() { + return this.#initialHash === null || this.getHash() === this.#initialHash; + } + getOrder() { + if (!this.#groups.size) { + return null; + } + if (this.#order) { + return this.#order.slice(); + } + return [...this.#groups.keys()]; + } + getGroups() { + return this.#groups.size > 0 ? (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.objectFromMap)(this.#groups) : null; + } + getGroup(id) { + return this.#groups.get(id) || null; + } + getHash() { + if (this.#cachedGetHash !== null) { + return this.#cachedGetHash; + } + const hash = new _shared_murmurhash3_js__WEBPACK_IMPORTED_MODULE_1__.MurmurHash3_64(); + for (const [id, group] of this.#groups) { + hash.update(`${id}:${group.visible}`); + } + return this.#cachedGetHash = hash.hexdigest(); + } +} + + +/***/ }), + +/***/ 739: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ renderTextLayer: () => (/* binding */ renderTextLayer), +/* harmony export */ updateTextLayer: () => (/* binding */ updateTextLayer) +/* harmony export */ }); +/* unused harmony export TextLayerRenderTask */ +/* harmony import */ var _shared_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(266); +/* harmony import */ var _display_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(473); + + +const MAX_TEXT_DIVS_TO_RENDER = 100000; +const DEFAULT_FONT_SIZE = 30; +const DEFAULT_FONT_ASCENT = 0.8; +const ascentCache = new Map(); +function getCtx(size, isOffscreenCanvasSupported) { + let ctx; + if (isOffscreenCanvasSupported && _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.FeatureTest.isOffscreenCanvasSupported) { + ctx = new OffscreenCanvas(size, size).getContext("2d", { + alpha: false + }); + } else { + const canvas = document.createElement("canvas"); + canvas.width = canvas.height = size; + ctx = canvas.getContext("2d", { + alpha: false + }); + } + return ctx; +} +function getAscent(fontFamily, isOffscreenCanvasSupported) { + const cachedAscent = ascentCache.get(fontFamily); + if (cachedAscent) { + return cachedAscent; + } + const ctx = getCtx(DEFAULT_FONT_SIZE, isOffscreenCanvasSupported); + ctx.font = `${DEFAULT_FONT_SIZE}px ${fontFamily}`; + const metrics = ctx.measureText(""); + let ascent = metrics.fontBoundingBoxAscent; + let descent = Math.abs(metrics.fontBoundingBoxDescent); + if (ascent) { + const ratio = ascent / (ascent + descent); + ascentCache.set(fontFamily, ratio); + ctx.canvas.width = ctx.canvas.height = 0; + return ratio; + } + ctx.strokeStyle = "red"; + ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE); + ctx.strokeText("g", 0, 0); + let pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data; + descent = 0; + for (let i = pixels.length - 1 - 3; i >= 0; i -= 4) { + if (pixels[i] > 0) { + descent = Math.ceil(i / 4 / DEFAULT_FONT_SIZE); + break; + } + } + ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE); + ctx.strokeText("A", 0, DEFAULT_FONT_SIZE); + pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data; + ascent = 0; + for (let i = 0, ii = pixels.length; i < ii; i += 4) { + if (pixels[i] > 0) { + ascent = DEFAULT_FONT_SIZE - Math.floor(i / 4 / DEFAULT_FONT_SIZE); + break; + } + } + ctx.canvas.width = ctx.canvas.height = 0; + if (ascent) { + const ratio = ascent / (ascent + descent); + ascentCache.set(fontFamily, ratio); + return ratio; + } + ascentCache.set(fontFamily, DEFAULT_FONT_ASCENT); + return DEFAULT_FONT_ASCENT; +} +function appendText(task, geom, styles) { + const textDiv = document.createElement("span"); + const textDivProperties = { + angle: 0, + canvasWidth: 0, + hasText: geom.str !== "", + hasEOL: geom.hasEOL, + fontSize: 0 + }; + task._textDivs.push(textDiv); + const tx = _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.Util.transform(task._transform, geom.transform); + let angle = Math.atan2(tx[1], tx[0]); + const style = styles[geom.fontName]; + if (style.vertical) { + angle += Math.PI / 2; + } + const fontFamily = task._fontInspectorEnabled && style.fontSubstitution || style.fontFamily; + const fontHeight = Math.hypot(tx[2], tx[3]); + const fontAscent = fontHeight * getAscent(fontFamily, task._isOffscreenCanvasSupported); + let left, top; + if (angle === 0) { + left = tx[4]; + top = tx[5] - fontAscent; + } else { + left = tx[4] + fontAscent * Math.sin(angle); + top = tx[5] - fontAscent * Math.cos(angle); + } + const scaleFactorStr = "calc(var(--scale-factor)*"; + const divStyle = textDiv.style; + if (task._container === task._rootContainer) { + divStyle.left = `${(100 * left / task._pageWidth).toFixed(2)}%`; + divStyle.top = `${(100 * top / task._pageHeight).toFixed(2)}%`; + } else { + divStyle.left = `${scaleFactorStr}${left.toFixed(2)}px)`; + divStyle.top = `${scaleFactorStr}${top.toFixed(2)}px)`; + } + divStyle.fontSize = `${scaleFactorStr}${fontHeight.toFixed(2)}px)`; + divStyle.fontFamily = fontFamily; + textDivProperties.fontSize = fontHeight; + textDiv.setAttribute("role", "presentation"); + textDiv.textContent = geom.str; + textDiv.dir = geom.dir; + if (task._fontInspectorEnabled) { + textDiv.dataset.fontName = style.fontSubstitutionLoadedName || geom.fontName; + } + if (angle !== 0) { + textDivProperties.angle = angle * (180 / Math.PI); + } + let shouldScaleText = false; + if (geom.str.length > 1) { + shouldScaleText = true; + } else if (geom.str !== " " && geom.transform[0] !== geom.transform[3]) { + const absScaleX = Math.abs(geom.transform[0]), + absScaleY = Math.abs(geom.transform[3]); + if (absScaleX !== absScaleY && Math.max(absScaleX, absScaleY) / Math.min(absScaleX, absScaleY) > 1.5) { + shouldScaleText = true; + } + } + if (shouldScaleText) { + textDivProperties.canvasWidth = style.vertical ? geom.height : geom.width; + } + task._textDivProperties.set(textDiv, textDivProperties); + if (task._isReadableStream) { + task._layoutText(textDiv); + } +} +function layout(params) { + const { + div, + scale, + properties, + ctx, + prevFontSize, + prevFontFamily + } = params; + const { + style + } = div; + let transform = ""; + if (properties.canvasWidth !== 0 && properties.hasText) { + const { + fontFamily + } = style; + const { + canvasWidth, + fontSize + } = properties; + if (prevFontSize !== fontSize || prevFontFamily !== fontFamily) { + ctx.font = `${fontSize * scale}px ${fontFamily}`; + params.prevFontSize = fontSize; + params.prevFontFamily = fontFamily; + } + const { + width + } = ctx.measureText(div.textContent); + if (width > 0) { + transform = `scaleX(${canvasWidth * scale / width})`; + } + } + if (properties.angle !== 0) { + transform = `rotate(${properties.angle}deg) ${transform}`; + } + if (transform.length > 0) { + style.transform = transform; + } +} +function render(task) { + if (task._canceled) { + return; + } + const textDivs = task._textDivs; + const capability = task._capability; + const textDivsLength = textDivs.length; + if (textDivsLength > MAX_TEXT_DIVS_TO_RENDER) { + capability.resolve(); + return; + } + if (!task._isReadableStream) { + for (const textDiv of textDivs) { + task._layoutText(textDiv); + } + } + capability.resolve(); +} +class TextLayerRenderTask { + constructor({ + textContentSource, + container, + viewport, + textDivs, + textDivProperties, + textContentItemsStr, + isOffscreenCanvasSupported + }) { + this._textContentSource = textContentSource; + this._isReadableStream = textContentSource instanceof ReadableStream; + this._container = this._rootContainer = container; + this._textDivs = textDivs || []; + this._textContentItemsStr = textContentItemsStr || []; + this._isOffscreenCanvasSupported = isOffscreenCanvasSupported; + this._fontInspectorEnabled = !!globalThis.FontInspector?.enabled; + this._reader = null; + this._textDivProperties = textDivProperties || new WeakMap(); + this._canceled = false; + this._capability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + this._layoutTextParams = { + prevFontSize: null, + prevFontFamily: null, + div: null, + scale: viewport.scale * (globalThis.devicePixelRatio || 1), + properties: null, + ctx: getCtx(0, isOffscreenCanvasSupported) + }; + const { + pageWidth, + pageHeight, + pageX, + pageY + } = viewport.rawDims; + this._transform = [1, 0, 0, -1, -pageX, pageY + pageHeight]; + this._pageWidth = pageWidth; + this._pageHeight = pageHeight; + (0,_display_utils_js__WEBPACK_IMPORTED_MODULE_1__.setLayerDimensions)(container, viewport); + this._capability.promise.finally(() => { + this._layoutTextParams = null; + }).catch(() => {}); + } + get promise() { + return this._capability.promise; + } + cancel() { + this._canceled = true; + if (this._reader) { + this._reader.cancel(new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AbortException("TextLayer task cancelled.")).catch(() => {}); + this._reader = null; + } + this._capability.reject(new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AbortException("TextLayer task cancelled.")); + } + _processItems(items, styleCache) { + for (const item of items) { + if (item.str === undefined) { + if (item.type === "beginMarkedContentProps" || item.type === "beginMarkedContent") { + const parent = this._container; + this._container = document.createElement("span"); + this._container.classList.add("markedContent"); + if (item.id !== null) { + this._container.setAttribute("id", `${item.id}`); + } + parent.append(this._container); + } else if (item.type === "endMarkedContent") { + this._container = this._container.parentNode; + } + continue; + } + this._textContentItemsStr.push(item.str); + appendText(this, item, styleCache); + } + } + _layoutText(textDiv) { + const textDivProperties = this._layoutTextParams.properties = this._textDivProperties.get(textDiv); + this._layoutTextParams.div = textDiv; + layout(this._layoutTextParams); + if (textDivProperties.hasText) { + this._container.append(textDiv); + } + if (textDivProperties.hasEOL) { + const br = document.createElement("br"); + br.setAttribute("role", "presentation"); + this._container.append(br); + } + } + _render() { + const capability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + let styleCache = Object.create(null); + if (this._isReadableStream) { + const pump = () => { + this._reader.read().then(({ + value, + done + }) => { + if (done) { + capability.resolve(); + return; + } + Object.assign(styleCache, value.styles); + this._processItems(value.items, styleCache); + pump(); + }, capability.reject); + }; + this._reader = this._textContentSource.getReader(); + pump(); + } else if (this._textContentSource) { + const { + items, + styles + } = this._textContentSource; + this._processItems(items, styles); + capability.resolve(); + } else { + throw new Error('No "textContentSource" parameter specified.'); + } + capability.promise.then(() => { + styleCache = null; + render(this); + }, this._capability.reject); + } +} +function renderTextLayer(params) { + const task = new TextLayerRenderTask(params); + task._render(); + return task; +} +function updateTextLayer({ + container, + viewport, + textDivs, + textDivProperties, + isOffscreenCanvasSupported, + mustRotate = true, + mustRescale = true +}) { + if (mustRotate) { + (0,_display_utils_js__WEBPACK_IMPORTED_MODULE_1__.setLayerDimensions)(container, { + rotation: viewport.rotation + }); + } + if (mustRescale) { + const ctx = getCtx(0, isOffscreenCanvasSupported); + const scale = viewport.scale * (globalThis.devicePixelRatio || 1); + const params = { + prevFontSize: null, + prevFontFamily: null, + div: null, + scale, + properties: null, + ctx + }; + for (const div of textDivs) { + params.properties = textDivProperties.get(div); + params.div = div; + layout(params); + } + } +} + + +/***/ }), + +/***/ 92: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ PDFDataTransportStream: () => (/* binding */ PDFDataTransportStream) +/* harmony export */ }); +/* harmony import */ var _shared_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(266); +/* harmony import */ var _display_utils_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(473); + + +class PDFDataTransportStream { + constructor({ + length, + initialData, + progressiveDone = false, + contentDispositionFilename = null, + disableRange = false, + disableStream = false + }, pdfDataRangeTransport) { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.assert)(pdfDataRangeTransport, 'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'); + this._queuedChunks = []; + this._progressiveDone = progressiveDone; + this._contentDispositionFilename = contentDispositionFilename; + if (initialData?.length > 0) { + const buffer = initialData instanceof Uint8Array && initialData.byteLength === initialData.buffer.byteLength ? initialData.buffer : new Uint8Array(initialData).buffer; + this._queuedChunks.push(buffer); + } + this._pdfDataRangeTransport = pdfDataRangeTransport; + this._isStreamingSupported = !disableStream; + this._isRangeSupported = !disableRange; + this._contentLength = length; + this._fullRequestReader = null; + this._rangeReaders = []; + this._pdfDataRangeTransport.addRangeListener((begin, chunk) => { + this._onReceiveData({ + begin, + chunk + }); + }); + this._pdfDataRangeTransport.addProgressListener((loaded, total) => { + this._onProgress({ + loaded, + total + }); + }); + this._pdfDataRangeTransport.addProgressiveReadListener(chunk => { + this._onReceiveData({ + chunk + }); + }); + this._pdfDataRangeTransport.addProgressiveDoneListener(() => { + this._onProgressiveDone(); + }); + this._pdfDataRangeTransport.transportReady(); + } + _onReceiveData({ + begin, + chunk + }) { + const buffer = chunk instanceof Uint8Array && chunk.byteLength === chunk.buffer.byteLength ? chunk.buffer : new Uint8Array(chunk).buffer; + if (begin === undefined) { + if (this._fullRequestReader) { + this._fullRequestReader._enqueue(buffer); + } else { + this._queuedChunks.push(buffer); + } + } else { + const found = this._rangeReaders.some(function (rangeReader) { + if (rangeReader._begin !== begin) { + return false; + } + rangeReader._enqueue(buffer); + return true; + }); + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.assert)(found, "_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found."); + } + } + get _progressiveDataLength() { + return this._fullRequestReader?._loaded ?? 0; + } + _onProgress(evt) { + if (evt.total === undefined) { + this._rangeReaders[0]?.onProgress?.({ + loaded: evt.loaded + }); + } else { + this._fullRequestReader?.onProgress?.({ + loaded: evt.loaded, + total: evt.total + }); + } + } + _onProgressiveDone() { + this._fullRequestReader?.progressiveDone(); + this._progressiveDone = true; + } + _removeRangeReader(reader) { + const i = this._rangeReaders.indexOf(reader); + if (i >= 0) { + this._rangeReaders.splice(i, 1); + } + } + getFullReader() { + (0,_shared_util_js__WEBPACK_IMPORTED_MODULE_0__.assert)(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once."); + const queuedChunks = this._queuedChunks; + this._queuedChunks = null; + return new PDFDataTransportStreamReader(this, queuedChunks, this._progressiveDone, this._contentDispositionFilename); + } + getRangeReader(begin, end) { + if (end <= this._progressiveDataLength) { + return null; + } + const reader = new PDFDataTransportStreamRangeReader(this, begin, end); + this._pdfDataRangeTransport.requestDataRange(begin, end); + this._rangeReaders.push(reader); + return reader; + } + cancelAllRequests(reason) { + this._fullRequestReader?.cancel(reason); + for (const reader of this._rangeReaders.slice(0)) { + reader.cancel(reason); + } + this._pdfDataRangeTransport.abort(); + } +} +class PDFDataTransportStreamReader { + constructor(stream, queuedChunks, progressiveDone = false, contentDispositionFilename = null) { + this._stream = stream; + this._done = progressiveDone || false; + this._filename = (0,_display_utils_js__WEBPACK_IMPORTED_MODULE_1__.isPdfFile)(contentDispositionFilename) ? contentDispositionFilename : null; + this._queuedChunks = queuedChunks || []; + this._loaded = 0; + for (const chunk of this._queuedChunks) { + this._loaded += chunk.byteLength; + } + this._requests = []; + this._headersReady = Promise.resolve(); + stream._fullRequestReader = this; + this.onProgress = null; + } + _enqueue(chunk) { + if (this._done) { + return; + } + if (this._requests.length > 0) { + const requestCapability = this._requests.shift(); + requestCapability.resolve({ + value: chunk, + done: false + }); + } else { + this._queuedChunks.push(chunk); + } + this._loaded += chunk.byteLength; + } + get headersReady() { + return this._headersReady; + } + get filename() { + return this._filename; + } + get isRangeSupported() { + return this._stream._isRangeSupported; + } + get isStreamingSupported() { + return this._stream._isStreamingSupported; + } + get contentLength() { + return this._stream._contentLength; + } + async read() { + if (this._queuedChunks.length > 0) { + const chunk = this._queuedChunks.shift(); + return { + value: chunk, + done: false + }; + } + if (this._done) { + return { + value: undefined, + done: true + }; + } + const requestCapability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + this._requests.push(requestCapability); + return requestCapability.promise; + } + cancel(reason) { + this._done = true; + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + this._requests.length = 0; + } + progressiveDone() { + if (this._done) { + return; + } + this._done = true; + } +} +class PDFDataTransportStreamRangeReader { + constructor(stream, begin, end) { + this._stream = stream; + this._begin = begin; + this._end = end; + this._queuedChunk = null; + this._requests = []; + this._done = false; + this.onProgress = null; + } + _enqueue(chunk) { + if (this._done) { + return; + } + if (this._requests.length === 0) { + this._queuedChunk = chunk; + } else { + const requestsCapability = this._requests.shift(); + requestsCapability.resolve({ + value: chunk, + done: false + }); + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + this._requests.length = 0; + } + this._done = true; + this._stream._removeRangeReader(this); + } + get isStreamingSupported() { + return false; + } + async read() { + if (this._queuedChunk) { + const chunk = this._queuedChunk; + this._queuedChunk = null; + return { + value: chunk, + done: false + }; + } + if (this._done) { + return { + value: undefined, + done: true + }; + } + const requestCapability = new _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + this._requests.push(requestCapability); + return requestCapability.promise; + } + cancel(reason) { + this._done = true; + for (const requestCapability of this._requests) { + requestCapability.resolve({ + value: undefined, + done: true + }); + } + this._requests.length = 0; + this._stream._removeRangeReader(this); + } +} + + +/***/ }), + +/***/ 368: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ GlobalWorkerOptions: () => (/* binding */ GlobalWorkerOptions) +/* harmony export */ }); +const GlobalWorkerOptions = Object.create(null); +GlobalWorkerOptions.workerPort = null; +GlobalWorkerOptions.workerSrc = ""; + + +/***/ }), + +/***/ 160: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ XfaLayer: () => (/* binding */ XfaLayer) +/* harmony export */ }); +/* harmony import */ var _xfa_text_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(521); + +class XfaLayer { + static setupStorage(html, id, element, storage, intent) { + const storedData = storage.getValue(id, { + value: null + }); + switch (element.name) { + case "textarea": + if (storedData.value !== null) { + html.textContent = storedData.value; + } + if (intent === "print") { + break; + } + html.addEventListener("input", event => { + storage.setValue(id, { + value: event.target.value + }); + }); + break; + case "input": + if (element.attributes.type === "radio" || element.attributes.type === "checkbox") { + if (storedData.value === element.attributes.xfaOn) { + html.setAttribute("checked", true); + } else if (storedData.value === element.attributes.xfaOff) { + html.removeAttribute("checked"); + } + if (intent === "print") { + break; + } + html.addEventListener("change", event => { + storage.setValue(id, { + value: event.target.checked ? event.target.getAttribute("xfaOn") : event.target.getAttribute("xfaOff") + }); + }); + } else { + if (storedData.value !== null) { + html.setAttribute("value", storedData.value); + } + if (intent === "print") { + break; + } + html.addEventListener("input", event => { + storage.setValue(id, { + value: event.target.value + }); + }); + } + break; + case "select": + if (storedData.value !== null) { + html.setAttribute("value", storedData.value); + for (const option of element.children) { + if (option.attributes.value === storedData.value) { + option.attributes.selected = true; + } else if (option.attributes.hasOwnProperty("selected")) { + delete option.attributes.selected; + } + } + } + html.addEventListener("input", event => { + const options = event.target.options; + const value = options.selectedIndex === -1 ? "" : options[options.selectedIndex].value; + storage.setValue(id, { + value + }); + }); + break; + } + } + static setAttributes({ + html, + element, + storage = null, + intent, + linkService + }) { + const { + attributes + } = element; + const isHTMLAnchorElement = html instanceof HTMLAnchorElement; + if (attributes.type === "radio") { + attributes.name = `${attributes.name}-${intent}`; + } + for (const [key, value] of Object.entries(attributes)) { + if (value === null || value === undefined) { + continue; + } + switch (key) { + case "class": + if (value.length) { + html.setAttribute(key, value.join(" ")); + } + break; + case "dataId": + break; + case "id": + html.setAttribute("data-element-id", value); + break; + case "style": + Object.assign(html.style, value); + break; + case "textContent": + html.textContent = value; + break; + default: + if (!isHTMLAnchorElement || key !== "href" && key !== "newWindow") { + html.setAttribute(key, value); + } + } + } + if (isHTMLAnchorElement) { + linkService.addLinkAttributes(html, attributes.href, attributes.newWindow); + } + if (storage && attributes.dataId) { + this.setupStorage(html, attributes.dataId, element, storage); + } + } + static render(parameters) { + const storage = parameters.annotationStorage; + const linkService = parameters.linkService; + const root = parameters.xfaHtml; + const intent = parameters.intent || "display"; + const rootHtml = document.createElement(root.name); + if (root.attributes) { + this.setAttributes({ + html: rootHtml, + element: root, + intent, + linkService + }); + } + const isNotForRichText = intent !== "richText"; + const rootDiv = parameters.div; + rootDiv.append(rootHtml); + if (parameters.viewport) { + const transform = `matrix(${parameters.viewport.transform.join(",")})`; + rootDiv.style.transform = transform; + } + if (isNotForRichText) { + rootDiv.setAttribute("class", "xfaLayer xfaFont"); + } + const textDivs = []; + if (root.children.length === 0) { + if (root.value) { + const node = document.createTextNode(root.value); + rootHtml.append(node); + if (isNotForRichText && _xfa_text_js__WEBPACK_IMPORTED_MODULE_0__.XfaText.shouldBuildText(root.name)) { + textDivs.push(node); + } + } + return { + textDivs + }; + } + const stack = [[root, -1, rootHtml]]; + while (stack.length > 0) { + const [parent, i, html] = stack.at(-1); + if (i + 1 === parent.children.length) { + stack.pop(); + continue; + } + const child = parent.children[++stack.at(-1)[1]]; + if (child === null) { + continue; + } + const { + name + } = child; + if (name === "#text") { + const node = document.createTextNode(child.value); + textDivs.push(node); + html.append(node); + continue; + } + const childHtml = child?.attributes?.xmlns ? document.createElementNS(child.attributes.xmlns, name) : document.createElement(name); + html.append(childHtml); + if (child.attributes) { + this.setAttributes({ + html: childHtml, + element: child, + storage, + intent, + linkService + }); + } + if (child.children?.length > 0) { + stack.push([child, -1, childHtml]); + } else if (child.value) { + const node = document.createTextNode(child.value); + if (isNotForRichText && _xfa_text_js__WEBPACK_IMPORTED_MODULE_0__.XfaText.shouldBuildText(name)) { + textDivs.push(node); + } + childHtml.append(node); + } + } + for (const el of rootDiv.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea")) { + el.setAttribute("readOnly", true); + } + return { + textDivs + }; + } + static update(parameters) { + const transform = `matrix(${parameters.viewport.transform.join(",")})`; + parameters.div.style.transform = transform; + parameters.div.hidden = false; + } +} + + +/***/ }), + +/***/ 521: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ XfaText: () => (/* binding */ XfaText) +/* harmony export */ }); +class XfaText { + static textContent(xfa) { + const items = []; + const output = { + items, + styles: Object.create(null) + }; + function walk(node) { + if (!node) { + return; + } + let str = null; + const name = node.name; + if (name === "#text") { + str = node.value; + } else if (!XfaText.shouldBuildText(name)) { + return; + } else if (node?.attributes?.textContent) { + str = node.attributes.textContent; + } else if (node.value) { + str = node.value; + } + if (str !== null) { + items.push({ + str + }); + } + if (!node.children) { + return; + } + for (const child of node.children) { + walk(child); + } + } + walk(xfa); + return output; + } + static shouldBuildText(name) { + return !(name === "textarea" || name === "input" || name === "option" || name === "select"); + } +} + + +/***/ }), + +/***/ 907: +/***/ ((__webpack_module__, __webpack_exports__, __webpack_require__) => { + +__webpack_require__.a(__webpack_module__, async (__webpack_handle_async_dependencies__, __webpack_async_result__) => { try { +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ AbortException: () => (/* reexport safe */ _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AbortException), +/* harmony export */ AnnotationEditorLayer: () => (/* reexport safe */ _display_editor_annotation_editor_layer_js__WEBPACK_IMPORTED_MODULE_4__.AnnotationEditorLayer), +/* harmony export */ AnnotationEditorParamsType: () => (/* reexport safe */ _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorParamsType), +/* harmony export */ AnnotationEditorType: () => (/* reexport safe */ _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AnnotationEditorType), +/* harmony export */ AnnotationEditorUIManager: () => (/* reexport safe */ _display_editor_tools_js__WEBPACK_IMPORTED_MODULE_5__.AnnotationEditorUIManager), +/* harmony export */ AnnotationLayer: () => (/* reexport safe */ _display_annotation_layer_js__WEBPACK_IMPORTED_MODULE_6__.AnnotationLayer), +/* harmony export */ AnnotationMode: () => (/* reexport safe */ _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.AnnotationMode), +/* harmony export */ CMapCompressionType: () => (/* reexport safe */ _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.CMapCompressionType), +/* harmony export */ ColorPicker: () => (/* reexport safe */ _display_editor_color_picker_js__WEBPACK_IMPORTED_MODULE_7__.ColorPicker), +/* harmony export */ DOMSVGFactory: () => (/* reexport safe */ _display_display_utils_js__WEBPACK_IMPORTED_MODULE_2__.DOMSVGFactory), +/* harmony export */ DrawLayer: () => (/* reexport safe */ _display_draw_layer_js__WEBPACK_IMPORTED_MODULE_8__.DrawLayer), +/* harmony export */ FeatureTest: () => (/* reexport safe */ _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.FeatureTest), +/* harmony export */ GlobalWorkerOptions: () => (/* reexport safe */ _display_worker_options_js__WEBPACK_IMPORTED_MODULE_9__.GlobalWorkerOptions), +/* harmony export */ ImageKind: () => (/* reexport safe */ _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.ImageKind), +/* harmony export */ InvalidPDFException: () => (/* reexport safe */ _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.InvalidPDFException), +/* harmony export */ MissingPDFException: () => (/* reexport safe */ _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.MissingPDFException), +/* harmony export */ OPS: () => (/* reexport safe */ _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.OPS), +/* harmony export */ Outliner: () => (/* reexport safe */ _display_editor_outliner_js__WEBPACK_IMPORTED_MODULE_10__.Outliner), +/* harmony export */ PDFDataRangeTransport: () => (/* reexport safe */ _display_api_js__WEBPACK_IMPORTED_MODULE_1__.PDFDataRangeTransport), +/* harmony export */ PDFDateString: () => (/* reexport safe */ _display_display_utils_js__WEBPACK_IMPORTED_MODULE_2__.PDFDateString), +/* harmony export */ PDFWorker: () => (/* reexport safe */ _display_api_js__WEBPACK_IMPORTED_MODULE_1__.PDFWorker), +/* harmony export */ PasswordResponses: () => (/* reexport safe */ _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PasswordResponses), +/* harmony export */ PermissionFlag: () => (/* reexport safe */ _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PermissionFlag), +/* harmony export */ PixelsPerInch: () => (/* reexport safe */ _display_display_utils_js__WEBPACK_IMPORTED_MODULE_2__.PixelsPerInch), +/* harmony export */ PromiseCapability: () => (/* reexport safe */ _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability), +/* harmony export */ RenderingCancelledException: () => (/* reexport safe */ _display_display_utils_js__WEBPACK_IMPORTED_MODULE_2__.RenderingCancelledException), +/* harmony export */ UnexpectedResponseException: () => (/* reexport safe */ _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.UnexpectedResponseException), +/* harmony export */ Util: () => (/* reexport safe */ _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.Util), +/* harmony export */ VerbosityLevel: () => (/* reexport safe */ _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.VerbosityLevel), +/* harmony export */ XfaLayer: () => (/* reexport safe */ _display_xfa_layer_js__WEBPACK_IMPORTED_MODULE_11__.XfaLayer), +/* harmony export */ build: () => (/* reexport safe */ _display_api_js__WEBPACK_IMPORTED_MODULE_1__.build), +/* harmony export */ createValidAbsoluteUrl: () => (/* reexport safe */ _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.createValidAbsoluteUrl), +/* harmony export */ fetchData: () => (/* reexport safe */ _display_display_utils_js__WEBPACK_IMPORTED_MODULE_2__.fetchData), +/* harmony export */ getDocument: () => (/* reexport safe */ _display_api_js__WEBPACK_IMPORTED_MODULE_1__.getDocument), +/* harmony export */ getFilenameFromUrl: () => (/* reexport safe */ _display_display_utils_js__WEBPACK_IMPORTED_MODULE_2__.getFilenameFromUrl), +/* harmony export */ getPdfFilenameFromUrl: () => (/* reexport safe */ _display_display_utils_js__WEBPACK_IMPORTED_MODULE_2__.getPdfFilenameFromUrl), +/* harmony export */ getXfaPageViewport: () => (/* reexport safe */ _display_display_utils_js__WEBPACK_IMPORTED_MODULE_2__.getXfaPageViewport), +/* harmony export */ isDataScheme: () => (/* reexport safe */ _display_display_utils_js__WEBPACK_IMPORTED_MODULE_2__.isDataScheme), +/* harmony export */ isPdfFile: () => (/* reexport safe */ _display_display_utils_js__WEBPACK_IMPORTED_MODULE_2__.isPdfFile), +/* harmony export */ noContextMenu: () => (/* reexport safe */ _display_display_utils_js__WEBPACK_IMPORTED_MODULE_2__.noContextMenu), +/* harmony export */ normalizeUnicode: () => (/* reexport safe */ _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.normalizeUnicode), +/* harmony export */ renderTextLayer: () => (/* reexport safe */ _display_text_layer_js__WEBPACK_IMPORTED_MODULE_3__.renderTextLayer), +/* harmony export */ setLayerDimensions: () => (/* reexport safe */ _display_display_utils_js__WEBPACK_IMPORTED_MODULE_2__.setLayerDimensions), +/* harmony export */ shadow: () => (/* reexport safe */ _shared_util_js__WEBPACK_IMPORTED_MODULE_0__.shadow), +/* harmony export */ updateTextLayer: () => (/* reexport safe */ _display_text_layer_js__WEBPACK_IMPORTED_MODULE_3__.updateTextLayer), +/* harmony export */ version: () => (/* reexport safe */ _display_api_js__WEBPACK_IMPORTED_MODULE_1__.version) +/* harmony export */ }); +/* harmony import */ var _shared_util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(266); +/* harmony import */ var _display_api_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(406); +/* harmony import */ var _display_display_utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(473); +/* harmony import */ var _display_text_layer_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(739); +/* harmony import */ var _display_editor_annotation_editor_layer_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(629); +/* harmony import */ var _display_editor_tools_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(812); +/* harmony import */ var _display_annotation_layer_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(640); +/* harmony import */ var _display_editor_color_picker_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(97); +/* harmony import */ var _display_draw_layer_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(423); +/* harmony import */ var _display_worker_options_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(368); +/* harmony import */ var _display_editor_outliner_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(405); +/* harmony import */ var _display_xfa_layer_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(160); +var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_display_api_js__WEBPACK_IMPORTED_MODULE_1__]); +_display_api_js__WEBPACK_IMPORTED_MODULE_1__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0]; + + + + + + + + + + + + +const pdfjsVersion = '4.0.379'; +const pdfjsBuild = '9e14d04fd'; + +__webpack_async_result__(); +} catch(e) { __webpack_async_result__(e); } }); + +/***/ }), + +/***/ 694: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ MessageHandler: () => (/* binding */ MessageHandler) +/* harmony export */ }); +/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(266); + +const CallbackKind = { + UNKNOWN: 0, + DATA: 1, + ERROR: 2 +}; +const StreamKind = { + UNKNOWN: 0, + CANCEL: 1, + CANCEL_COMPLETE: 2, + CLOSE: 3, + ENQUEUE: 4, + ERROR: 5, + PULL: 6, + PULL_COMPLETE: 7, + START_COMPLETE: 8 +}; +function wrapReason(reason) { + if (!(reason instanceof Error || typeof reason === "object" && reason !== null)) { + (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'); + } + switch (reason.name) { + case "AbortException": + return new _util_js__WEBPACK_IMPORTED_MODULE_0__.AbortException(reason.message); + case "MissingPDFException": + return new _util_js__WEBPACK_IMPORTED_MODULE_0__.MissingPDFException(reason.message); + case "PasswordException": + return new _util_js__WEBPACK_IMPORTED_MODULE_0__.PasswordException(reason.message, reason.code); + case "UnexpectedResponseException": + return new _util_js__WEBPACK_IMPORTED_MODULE_0__.UnexpectedResponseException(reason.message, reason.status); + case "UnknownErrorException": + return new _util_js__WEBPACK_IMPORTED_MODULE_0__.UnknownErrorException(reason.message, reason.details); + default: + return new _util_js__WEBPACK_IMPORTED_MODULE_0__.UnknownErrorException(reason.message, reason.toString()); + } +} +class MessageHandler { + constructor(sourceName, targetName, comObj) { + this.sourceName = sourceName; + this.targetName = targetName; + this.comObj = comObj; + this.callbackId = 1; + this.streamId = 1; + this.streamSinks = Object.create(null); + this.streamControllers = Object.create(null); + this.callbackCapabilities = Object.create(null); + this.actionHandler = Object.create(null); + this._onComObjOnMessage = event => { + const data = event.data; + if (data.targetName !== this.sourceName) { + return; + } + if (data.stream) { + this.#processStreamMessage(data); + return; + } + if (data.callback) { + const callbackId = data.callbackId; + const capability = this.callbackCapabilities[callbackId]; + if (!capability) { + throw new Error(`Cannot resolve callback ${callbackId}`); + } + delete this.callbackCapabilities[callbackId]; + if (data.callback === CallbackKind.DATA) { + capability.resolve(data.data); + } else if (data.callback === CallbackKind.ERROR) { + capability.reject(wrapReason(data.reason)); + } else { + throw new Error("Unexpected callback case"); + } + return; + } + const action = this.actionHandler[data.action]; + if (!action) { + throw new Error(`Unknown action from worker: ${data.action}`); + } + if (data.callbackId) { + const cbSourceName = this.sourceName; + const cbTargetName = data.sourceName; + new Promise(function (resolve) { + resolve(action(data.data)); + }).then(function (result) { + comObj.postMessage({ + sourceName: cbSourceName, + targetName: cbTargetName, + callback: CallbackKind.DATA, + callbackId: data.callbackId, + data: result + }); + }, function (reason) { + comObj.postMessage({ + sourceName: cbSourceName, + targetName: cbTargetName, + callback: CallbackKind.ERROR, + callbackId: data.callbackId, + reason: wrapReason(reason) + }); + }); + return; + } + if (data.streamId) { + this.#createStreamSink(data); + return; + } + action(data.data); + }; + comObj.addEventListener("message", this._onComObjOnMessage); + } + on(actionName, handler) { + const ah = this.actionHandler; + if (ah[actionName]) { + throw new Error(`There is already an actionName called "${actionName}"`); + } + ah[actionName] = handler; + } + send(actionName, data, transfers) { + this.comObj.postMessage({ + sourceName: this.sourceName, + targetName: this.targetName, + action: actionName, + data + }, transfers); + } + sendWithPromise(actionName, data, transfers) { + const callbackId = this.callbackId++; + const capability = new _util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + this.callbackCapabilities[callbackId] = capability; + try { + this.comObj.postMessage({ + sourceName: this.sourceName, + targetName: this.targetName, + action: actionName, + callbackId, + data + }, transfers); + } catch (ex) { + capability.reject(ex); + } + return capability.promise; + } + sendWithStream(actionName, data, queueingStrategy, transfers) { + const streamId = this.streamId++, + sourceName = this.sourceName, + targetName = this.targetName, + comObj = this.comObj; + return new ReadableStream({ + start: controller => { + const startCapability = new _util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + this.streamControllers[streamId] = { + controller, + startCall: startCapability, + pullCall: null, + cancelCall: null, + isClosed: false + }; + comObj.postMessage({ + sourceName, + targetName, + action: actionName, + streamId, + data, + desiredSize: controller.desiredSize + }, transfers); + return startCapability.promise; + }, + pull: controller => { + const pullCapability = new _util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + this.streamControllers[streamId].pullCall = pullCapability; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL, + streamId, + desiredSize: controller.desiredSize + }); + return pullCapability.promise; + }, + cancel: reason => { + (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.assert)(reason instanceof Error, "cancel must have a valid reason"); + const cancelCapability = new _util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + this.streamControllers[streamId].cancelCall = cancelCapability; + this.streamControllers[streamId].isClosed = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL, + streamId, + reason: wrapReason(reason) + }); + return cancelCapability.promise; + } + }, queueingStrategy); + } + #createStreamSink(data) { + const streamId = data.streamId, + sourceName = this.sourceName, + targetName = data.sourceName, + comObj = this.comObj; + const self = this, + action = this.actionHandler[data.action]; + const streamSink = { + enqueue(chunk, size = 1, transfers) { + if (this.isCancelled) { + return; + } + const lastDesiredSize = this.desiredSize; + this.desiredSize -= size; + if (lastDesiredSize > 0 && this.desiredSize <= 0) { + this.sinkCapability = new _util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(); + this.ready = this.sinkCapability.promise; + } + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.ENQUEUE, + streamId, + chunk + }, transfers); + }, + close() { + if (this.isCancelled) { + return; + } + this.isCancelled = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CLOSE, + streamId + }); + delete self.streamSinks[streamId]; + }, + error(reason) { + (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.assert)(reason instanceof Error, "error must have a valid reason"); + if (this.isCancelled) { + return; + } + this.isCancelled = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.ERROR, + streamId, + reason: wrapReason(reason) + }); + }, + sinkCapability: new _util_js__WEBPACK_IMPORTED_MODULE_0__.PromiseCapability(), + onPull: null, + onCancel: null, + isCancelled: false, + desiredSize: data.desiredSize, + ready: null + }; + streamSink.sinkCapability.resolve(); + streamSink.ready = streamSink.sinkCapability.promise; + this.streamSinks[streamId] = streamSink; + new Promise(function (resolve) { + resolve(action(data.data, streamSink)); + }).then(function () { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.START_COMPLETE, + streamId, + success: true + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.START_COMPLETE, + streamId, + reason: wrapReason(reason) + }); + }); + } + #processStreamMessage(data) { + const streamId = data.streamId, + sourceName = this.sourceName, + targetName = data.sourceName, + comObj = this.comObj; + const streamController = this.streamControllers[streamId], + streamSink = this.streamSinks[streamId]; + switch (data.stream) { + case StreamKind.START_COMPLETE: + if (data.success) { + streamController.startCall.resolve(); + } else { + streamController.startCall.reject(wrapReason(data.reason)); + } + break; + case StreamKind.PULL_COMPLETE: + if (data.success) { + streamController.pullCall.resolve(); + } else { + streamController.pullCall.reject(wrapReason(data.reason)); + } + break; + case StreamKind.PULL: + if (!streamSink) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + success: true + }); + break; + } + if (streamSink.desiredSize <= 0 && data.desiredSize > 0) { + streamSink.sinkCapability.resolve(); + } + streamSink.desiredSize = data.desiredSize; + new Promise(function (resolve) { + resolve(streamSink.onPull?.()); + }).then(function () { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + success: true + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + reason: wrapReason(reason) + }); + }); + break; + case StreamKind.ENQUEUE: + (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.assert)(streamController, "enqueue should have stream controller"); + if (streamController.isClosed) { + break; + } + streamController.controller.enqueue(data.chunk); + break; + case StreamKind.CLOSE: + (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.assert)(streamController, "close should have stream controller"); + if (streamController.isClosed) { + break; + } + streamController.isClosed = true; + streamController.controller.close(); + this.#deleteStreamController(streamController, streamId); + break; + case StreamKind.ERROR: + (0,_util_js__WEBPACK_IMPORTED_MODULE_0__.assert)(streamController, "error should have stream controller"); + streamController.controller.error(wrapReason(data.reason)); + this.#deleteStreamController(streamController, streamId); + break; + case StreamKind.CANCEL_COMPLETE: + if (data.success) { + streamController.cancelCall.resolve(); + } else { + streamController.cancelCall.reject(wrapReason(data.reason)); + } + this.#deleteStreamController(streamController, streamId); + break; + case StreamKind.CANCEL: + if (!streamSink) { + break; + } + new Promise(function (resolve) { + resolve(streamSink.onCancel?.(wrapReason(data.reason))); + }).then(function () { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL_COMPLETE, + streamId, + success: true + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL_COMPLETE, + streamId, + reason: wrapReason(reason) + }); + }); + streamSink.sinkCapability.reject(wrapReason(data.reason)); + streamSink.isCancelled = true; + delete this.streamSinks[streamId]; + break; + default: + throw new Error("Unexpected stream case"); + } + } + async #deleteStreamController(streamController, streamId) { + await Promise.allSettled([streamController.startCall?.promise, streamController.pullCall?.promise, streamController.cancelCall?.promise]); + delete this.streamControllers[streamId]; + } + destroy() { + this.comObj.removeEventListener("message", this._onComObjOnMessage); + } +} + + +/***/ }), + +/***/ 825: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ MurmurHash3_64: () => (/* binding */ MurmurHash3_64) +/* harmony export */ }); +/* harmony import */ var _util_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(266); + +const SEED = 0xc3d2e1f0; +const MASK_HIGH = 0xffff0000; +const MASK_LOW = 0xffff; +class MurmurHash3_64 { + constructor(seed) { + this.h1 = seed ? seed & 0xffffffff : SEED; + this.h2 = seed ? seed & 0xffffffff : SEED; + } + update(input) { + let data, length; + if (typeof input === "string") { + data = new Uint8Array(input.length * 2); + length = 0; + for (let i = 0, ii = input.length; i < ii; i++) { + const code = input.charCodeAt(i); + if (code <= 0xff) { + data[length++] = code; + } else { + data[length++] = code >>> 8; + data[length++] = code & 0xff; + } + } + } else if ((0,_util_js__WEBPACK_IMPORTED_MODULE_0__.isArrayBuffer)(input)) { + data = input.slice(); + length = data.byteLength; + } else { + throw new Error("Wrong data format in MurmurHash3_64_update. " + "Input must be a string or array."); + } + const blockCounts = length >> 2; + const tailLength = length - blockCounts * 4; + const dataUint32 = new Uint32Array(data.buffer, 0, blockCounts); + let k1 = 0, + k2 = 0; + let h1 = this.h1, + h2 = this.h2; + const C1 = 0xcc9e2d51, + C2 = 0x1b873593; + const C1_LOW = C1 & MASK_LOW, + C2_LOW = C2 & MASK_LOW; + for (let i = 0; i < blockCounts; i++) { + if (i & 1) { + k1 = dataUint32[i]; + k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; + k1 = k1 << 15 | k1 >>> 17; + k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; + h1 ^= k1; + h1 = h1 << 13 | h1 >>> 19; + h1 = h1 * 5 + 0xe6546b64; + } else { + k2 = dataUint32[i]; + k2 = k2 * C1 & MASK_HIGH | k2 * C1_LOW & MASK_LOW; + k2 = k2 << 15 | k2 >>> 17; + k2 = k2 * C2 & MASK_HIGH | k2 * C2_LOW & MASK_LOW; + h2 ^= k2; + h2 = h2 << 13 | h2 >>> 19; + h2 = h2 * 5 + 0xe6546b64; + } + } + k1 = 0; + switch (tailLength) { + case 3: + k1 ^= data[blockCounts * 4 + 2] << 16; + case 2: + k1 ^= data[blockCounts * 4 + 1] << 8; + case 1: + k1 ^= data[blockCounts * 4]; + k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; + k1 = k1 << 15 | k1 >>> 17; + k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; + if (blockCounts & 1) { + h1 ^= k1; + } else { + h2 ^= k1; + } + } + this.h1 = h1; + this.h2 = h2; + } + hexdigest() { + let h1 = this.h1, + h2 = this.h2; + h1 ^= h2 >>> 1; + h1 = h1 * 0xed558ccd & MASK_HIGH | h1 * 0x8ccd & MASK_LOW; + h2 = h2 * 0xff51afd7 & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xafd7ed55 & MASK_HIGH) >>> 16; + h1 ^= h2 >>> 1; + h1 = h1 * 0x1a85ec53 & MASK_HIGH | h1 * 0xec53 & MASK_LOW; + h2 = h2 * 0xc4ceb9fe & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xb9fe1a85 & MASK_HIGH) >>> 16; + h1 ^= h2 >>> 1; + return (h1 >>> 0).toString(16).padStart(8, "0") + (h2 >>> 0).toString(16).padStart(8, "0"); + } +} + + +/***/ }), + +/***/ 266: +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +/* harmony export */ __webpack_require__.d(__webpack_exports__, { +/* harmony export */ AbortException: () => (/* binding */ AbortException), +/* harmony export */ AnnotationBorderStyleType: () => (/* binding */ AnnotationBorderStyleType), +/* harmony export */ AnnotationEditorParamsType: () => (/* binding */ AnnotationEditorParamsType), +/* harmony export */ AnnotationEditorPrefix: () => (/* binding */ AnnotationEditorPrefix), +/* harmony export */ AnnotationEditorType: () => (/* binding */ AnnotationEditorType), +/* harmony export */ AnnotationMode: () => (/* binding */ AnnotationMode), +/* harmony export */ AnnotationPrefix: () => (/* binding */ AnnotationPrefix), +/* harmony export */ AnnotationType: () => (/* binding */ AnnotationType), +/* harmony export */ BaseException: () => (/* binding */ BaseException), +/* harmony export */ CMapCompressionType: () => (/* binding */ CMapCompressionType), +/* harmony export */ FONT_IDENTITY_MATRIX: () => (/* binding */ FONT_IDENTITY_MATRIX), +/* harmony export */ FeatureTest: () => (/* binding */ FeatureTest), +/* harmony export */ FormatError: () => (/* binding */ FormatError), +/* harmony export */ IDENTITY_MATRIX: () => (/* binding */ IDENTITY_MATRIX), +/* harmony export */ ImageKind: () => (/* binding */ ImageKind), +/* harmony export */ InvalidPDFException: () => (/* binding */ InvalidPDFException), +/* harmony export */ LINE_FACTOR: () => (/* binding */ LINE_FACTOR), +/* harmony export */ MAX_IMAGE_SIZE_TO_CACHE: () => (/* binding */ MAX_IMAGE_SIZE_TO_CACHE), +/* harmony export */ MissingPDFException: () => (/* binding */ MissingPDFException), +/* harmony export */ OPS: () => (/* binding */ OPS), +/* harmony export */ PasswordException: () => (/* binding */ PasswordException), +/* harmony export */ PasswordResponses: () => (/* binding */ PasswordResponses), +/* harmony export */ PermissionFlag: () => (/* binding */ PermissionFlag), +/* harmony export */ PromiseCapability: () => (/* binding */ PromiseCapability), +/* harmony export */ RenderingIntentFlag: () => (/* binding */ RenderingIntentFlag), +/* harmony export */ TextRenderingMode: () => (/* binding */ TextRenderingMode), +/* harmony export */ UnexpectedResponseException: () => (/* binding */ UnexpectedResponseException), +/* harmony export */ UnknownErrorException: () => (/* binding */ UnknownErrorException), +/* harmony export */ Util: () => (/* binding */ Util), +/* harmony export */ VerbosityLevel: () => (/* binding */ VerbosityLevel), +/* harmony export */ assert: () => (/* binding */ assert), +/* harmony export */ bytesToString: () => (/* binding */ bytesToString), +/* harmony export */ createValidAbsoluteUrl: () => (/* binding */ createValidAbsoluteUrl), +/* harmony export */ getUuid: () => (/* binding */ getUuid), +/* harmony export */ getVerbosityLevel: () => (/* binding */ getVerbosityLevel), +/* harmony export */ info: () => (/* binding */ info), +/* harmony export */ isArrayBuffer: () => (/* binding */ isArrayBuffer), +/* harmony export */ isNodeJS: () => (/* binding */ isNodeJS), +/* harmony export */ normalizeUnicode: () => (/* binding */ normalizeUnicode), +/* harmony export */ objectFromMap: () => (/* binding */ objectFromMap), +/* harmony export */ setVerbosityLevel: () => (/* binding */ setVerbosityLevel), +/* harmony export */ shadow: () => (/* binding */ shadow), +/* harmony export */ string32: () => (/* binding */ string32), +/* harmony export */ stringToBytes: () => (/* binding */ stringToBytes), +/* harmony export */ unreachable: () => (/* binding */ unreachable), +/* harmony export */ warn: () => (/* binding */ warn) +/* harmony export */ }); +/* unused harmony exports AnnotationActionEventType, AnnotationFieldFlag, AnnotationFlag, AnnotationReplyType, BASELINE_FACTOR, DocumentActionEventType, getModificationDate, isArrayEqual, LINE_DESCENT_FACTOR, objectSize, PageActionEventType, stringToPDFString, stringToUTF8String, utf8StringToString */ +const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"); +const IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; +const FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; +const MAX_IMAGE_SIZE_TO_CACHE = 10e6; +const LINE_FACTOR = 1.35; +const LINE_DESCENT_FACTOR = 0.35; +const BASELINE_FACTOR = LINE_DESCENT_FACTOR / LINE_FACTOR; +const RenderingIntentFlag = { + ANY: 0x01, + DISPLAY: 0x02, + PRINT: 0x04, + SAVE: 0x08, + ANNOTATIONS_FORMS: 0x10, + ANNOTATIONS_STORAGE: 0x20, + ANNOTATIONS_DISABLE: 0x40, + OPLIST: 0x100 +}; +const AnnotationMode = { + DISABLE: 0, + ENABLE: 1, + ENABLE_FORMS: 2, + ENABLE_STORAGE: 3 +}; +const AnnotationEditorPrefix = "pdfjs_internal_editor_"; +const AnnotationEditorType = { + DISABLE: -1, + NONE: 0, + FREETEXT: 3, + HIGHLIGHT: 9, + STAMP: 13, + INK: 15 +}; +const AnnotationEditorParamsType = { + RESIZE: 1, + CREATE: 2, + FREETEXT_SIZE: 11, + FREETEXT_COLOR: 12, + FREETEXT_OPACITY: 13, + INK_COLOR: 21, + INK_THICKNESS: 22, + INK_OPACITY: 23, + HIGHLIGHT_COLOR: 31, + HIGHLIGHT_DEFAULT_COLOR: 32 +}; +const PermissionFlag = { + PRINT: 0x04, + MODIFY_CONTENTS: 0x08, + COPY: 0x10, + MODIFY_ANNOTATIONS: 0x20, + FILL_INTERACTIVE_FORMS: 0x100, + COPY_FOR_ACCESSIBILITY: 0x200, + ASSEMBLE: 0x400, + PRINT_HIGH_QUALITY: 0x800 +}; +const TextRenderingMode = { + FILL: 0, + STROKE: 1, + FILL_STROKE: 2, + INVISIBLE: 3, + FILL_ADD_TO_PATH: 4, + STROKE_ADD_TO_PATH: 5, + FILL_STROKE_ADD_TO_PATH: 6, + ADD_TO_PATH: 7, + FILL_STROKE_MASK: 3, + ADD_TO_PATH_FLAG: 4 +}; +const ImageKind = { + GRAYSCALE_1BPP: 1, + RGB_24BPP: 2, + RGBA_32BPP: 3 +}; +const AnnotationType = { + TEXT: 1, + LINK: 2, + FREETEXT: 3, + LINE: 4, + SQUARE: 5, + CIRCLE: 6, + POLYGON: 7, + POLYLINE: 8, + HIGHLIGHT: 9, + UNDERLINE: 10, + SQUIGGLY: 11, + STRIKEOUT: 12, + STAMP: 13, + CARET: 14, + INK: 15, + POPUP: 16, + FILEATTACHMENT: 17, + SOUND: 18, + MOVIE: 19, + WIDGET: 20, + SCREEN: 21, + PRINTERMARK: 22, + TRAPNET: 23, + WATERMARK: 24, + THREED: 25, + REDACT: 26 +}; +const AnnotationReplyType = { + GROUP: "Group", + REPLY: "R" +}; +const AnnotationFlag = { + INVISIBLE: 0x01, + HIDDEN: 0x02, + PRINT: 0x04, + NOZOOM: 0x08, + NOROTATE: 0x10, + NOVIEW: 0x20, + READONLY: 0x40, + LOCKED: 0x80, + TOGGLENOVIEW: 0x100, + LOCKEDCONTENTS: 0x200 +}; +const AnnotationFieldFlag = { + READONLY: 0x0000001, + REQUIRED: 0x0000002, + NOEXPORT: 0x0000004, + MULTILINE: 0x0001000, + PASSWORD: 0x0002000, + NOTOGGLETOOFF: 0x0004000, + RADIO: 0x0008000, + PUSHBUTTON: 0x0010000, + COMBO: 0x0020000, + EDIT: 0x0040000, + SORT: 0x0080000, + FILESELECT: 0x0100000, + MULTISELECT: 0x0200000, + DONOTSPELLCHECK: 0x0400000, + DONOTSCROLL: 0x0800000, + COMB: 0x1000000, + RICHTEXT: 0x2000000, + RADIOSINUNISON: 0x2000000, + COMMITONSELCHANGE: 0x4000000 +}; +const AnnotationBorderStyleType = { + SOLID: 1, + DASHED: 2, + BEVELED: 3, + INSET: 4, + UNDERLINE: 5 +}; +const AnnotationActionEventType = { + E: "Mouse Enter", + X: "Mouse Exit", + D: "Mouse Down", + U: "Mouse Up", + Fo: "Focus", + Bl: "Blur", + PO: "PageOpen", + PC: "PageClose", + PV: "PageVisible", + PI: "PageInvisible", + K: "Keystroke", + F: "Format", + V: "Validate", + C: "Calculate" +}; +const DocumentActionEventType = { + WC: "WillClose", + WS: "WillSave", + DS: "DidSave", + WP: "WillPrint", + DP: "DidPrint" +}; +const PageActionEventType = { + O: "PageOpen", + C: "PageClose" +}; +const VerbosityLevel = { + ERRORS: 0, + WARNINGS: 1, + INFOS: 5 +}; +const CMapCompressionType = { + NONE: 0, + BINARY: 1 +}; +const OPS = { + dependency: 1, + setLineWidth: 2, + setLineCap: 3, + setLineJoin: 4, + setMiterLimit: 5, + setDash: 6, + setRenderingIntent: 7, + setFlatness: 8, + setGState: 9, + save: 10, + restore: 11, + transform: 12, + moveTo: 13, + lineTo: 14, + curveTo: 15, + curveTo2: 16, + curveTo3: 17, + closePath: 18, + rectangle: 19, + stroke: 20, + closeStroke: 21, + fill: 22, + eoFill: 23, + fillStroke: 24, + eoFillStroke: 25, + closeFillStroke: 26, + closeEOFillStroke: 27, + endPath: 28, + clip: 29, + eoClip: 30, + beginText: 31, + endText: 32, + setCharSpacing: 33, + setWordSpacing: 34, + setHScale: 35, + setLeading: 36, + setFont: 37, + setTextRenderingMode: 38, + setTextRise: 39, + moveText: 40, + setLeadingMoveText: 41, + setTextMatrix: 42, + nextLine: 43, + showText: 44, + showSpacedText: 45, + nextLineShowText: 46, + nextLineSetSpacingShowText: 47, + setCharWidth: 48, + setCharWidthAndBounds: 49, + setStrokeColorSpace: 50, + setFillColorSpace: 51, + setStrokeColor: 52, + setStrokeColorN: 53, + setFillColor: 54, + setFillColorN: 55, + setStrokeGray: 56, + setFillGray: 57, + setStrokeRGBColor: 58, + setFillRGBColor: 59, + setStrokeCMYKColor: 60, + setFillCMYKColor: 61, + shadingFill: 62, + beginInlineImage: 63, + beginImageData: 64, + endInlineImage: 65, + paintXObject: 66, + markPoint: 67, + markPointProps: 68, + beginMarkedContent: 69, + beginMarkedContentProps: 70, + endMarkedContent: 71, + beginCompat: 72, + endCompat: 73, + paintFormXObjectBegin: 74, + paintFormXObjectEnd: 75, + beginGroup: 76, + endGroup: 77, + beginAnnotation: 80, + endAnnotation: 81, + paintImageMaskXObject: 83, + paintImageMaskXObjectGroup: 84, + paintImageXObject: 85, + paintInlineImageXObject: 86, + paintInlineImageXObjectGroup: 87, + paintImageXObjectRepeat: 88, + paintImageMaskXObjectRepeat: 89, + paintSolidColorImageMask: 90, + constructPath: 91 +}; +const PasswordResponses = { + NEED_PASSWORD: 1, + INCORRECT_PASSWORD: 2 +}; +let verbosity = VerbosityLevel.WARNINGS; +function setVerbosityLevel(level) { + if (Number.isInteger(level)) { + verbosity = level; + } +} +function getVerbosityLevel() { + return verbosity; +} +function info(msg) { + if (verbosity >= VerbosityLevel.INFOS) { + console.log(`Info: ${msg}`); + } +} +function warn(msg) { + if (verbosity >= VerbosityLevel.WARNINGS) { + console.log(`Warning: ${msg}`); + } +} +function unreachable(msg) { + throw new Error(msg); +} +function assert(cond, msg) { + if (!cond) { + unreachable(msg); + } +} +function _isValidProtocol(url) { + switch (url?.protocol) { + case "http:": + case "https:": + case "ftp:": + case "mailto:": + case "tel:": + return true; + default: + return false; + } +} +function createValidAbsoluteUrl(url, baseUrl = null, options = null) { + if (!url) { + return null; + } + try { + if (options && typeof url === "string") { + if (options.addDefaultProtocol && url.startsWith("www.")) { + const dots = url.match(/\./g); + if (dots?.length >= 2) { + url = `http://${url}`; + } + } + if (options.tryConvertEncoding) { + try { + url = stringToUTF8String(url); + } catch {} + } + } + const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url); + if (_isValidProtocol(absoluteUrl)) { + return absoluteUrl; + } + } catch {} + return null; +} +function shadow(obj, prop, value, nonSerializable = false) { + Object.defineProperty(obj, prop, { + value, + enumerable: !nonSerializable, + configurable: true, + writable: false + }); + return value; +} +const BaseException = function BaseExceptionClosure() { + function BaseException(message, name) { + if (this.constructor === BaseException) { + unreachable("Cannot initialize BaseException."); + } + this.message = message; + this.name = name; + } + BaseException.prototype = new Error(); + BaseException.constructor = BaseException; + return BaseException; +}(); +class PasswordException extends BaseException { + constructor(msg, code) { + super(msg, "PasswordException"); + this.code = code; + } +} +class UnknownErrorException extends BaseException { + constructor(msg, details) { + super(msg, "UnknownErrorException"); + this.details = details; + } +} +class InvalidPDFException extends BaseException { + constructor(msg) { + super(msg, "InvalidPDFException"); + } +} +class MissingPDFException extends BaseException { + constructor(msg) { + super(msg, "MissingPDFException"); + } +} +class UnexpectedResponseException extends BaseException { + constructor(msg, status) { + super(msg, "UnexpectedResponseException"); + this.status = status; + } +} +class FormatError extends BaseException { + constructor(msg) { + super(msg, "FormatError"); + } +} +class AbortException extends BaseException { + constructor(msg) { + super(msg, "AbortException"); + } +} +function bytesToString(bytes) { + if (typeof bytes !== "object" || bytes?.length === undefined) { + unreachable("Invalid argument for bytesToString"); + } + const length = bytes.length; + const MAX_ARGUMENT_COUNT = 8192; + if (length < MAX_ARGUMENT_COUNT) { + return String.fromCharCode.apply(null, bytes); + } + const strBuf = []; + for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) { + const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); + const chunk = bytes.subarray(i, chunkEnd); + strBuf.push(String.fromCharCode.apply(null, chunk)); + } + return strBuf.join(""); +} +function stringToBytes(str) { + if (typeof str !== "string") { + unreachable("Invalid argument for stringToBytes"); + } + const length = str.length; + const bytes = new Uint8Array(length); + for (let i = 0; i < length; ++i) { + bytes[i] = str.charCodeAt(i) & 0xff; + } + return bytes; +} +function string32(value) { + return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff); +} +function objectSize(obj) { + return Object.keys(obj).length; +} +function objectFromMap(map) { + const obj = Object.create(null); + for (const [key, value] of map) { + obj[key] = value; + } + return obj; +} +function isLittleEndian() { + const buffer8 = new Uint8Array(4); + buffer8[0] = 1; + const view32 = new Uint32Array(buffer8.buffer, 0, 1); + return view32[0] === 1; +} +function isEvalSupported() { + try { + new Function(""); + return true; + } catch { + return false; + } +} +class FeatureTest { + static get isLittleEndian() { + return shadow(this, "isLittleEndian", isLittleEndian()); + } + static get isEvalSupported() { + return shadow(this, "isEvalSupported", isEvalSupported()); + } + static get isOffscreenCanvasSupported() { + return shadow(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas !== "undefined"); + } + static get platform() { + if (typeof navigator !== "undefined" && typeof navigator?.platform === "string") { + return shadow(this, "platform", { + isMac: navigator.platform.includes("Mac") + }); + } + return shadow(this, "platform", { + isMac: false + }); + } + static get isCSSRoundSupported() { + return shadow(this, "isCSSRoundSupported", globalThis.CSS?.supports?.("width: round(1.5px, 1px)")); + } +} +const hexNumbers = [...Array(256).keys()].map(n => n.toString(16).padStart(2, "0")); +class Util { + static makeHexColor(r, g, b) { + return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`; + } + static scaleMinMax(transform, minMax) { + let temp; + if (transform[0]) { + if (transform[0] < 0) { + temp = minMax[0]; + minMax[0] = minMax[1]; + minMax[1] = temp; + } + minMax[0] *= transform[0]; + minMax[1] *= transform[0]; + if (transform[3] < 0) { + temp = minMax[2]; + minMax[2] = minMax[3]; + minMax[3] = temp; + } + minMax[2] *= transform[3]; + minMax[3] *= transform[3]; + } else { + temp = minMax[0]; + minMax[0] = minMax[2]; + minMax[2] = temp; + temp = minMax[1]; + minMax[1] = minMax[3]; + minMax[3] = temp; + if (transform[1] < 0) { + temp = minMax[2]; + minMax[2] = minMax[3]; + minMax[3] = temp; + } + minMax[2] *= transform[1]; + minMax[3] *= transform[1]; + if (transform[2] < 0) { + temp = minMax[0]; + minMax[0] = minMax[1]; + minMax[1] = temp; + } + minMax[0] *= transform[2]; + minMax[1] *= transform[2]; + } + minMax[0] += transform[4]; + minMax[1] += transform[4]; + minMax[2] += transform[5]; + minMax[3] += transform[5]; + } + static transform(m1, m2) { + return [m1[0] * m2[0] + m1[2] * m2[1], m1[1] * m2[0] + m1[3] * m2[1], m1[0] * m2[2] + m1[2] * m2[3], m1[1] * m2[2] + m1[3] * m2[3], m1[0] * m2[4] + m1[2] * m2[5] + m1[4], m1[1] * m2[4] + m1[3] * m2[5] + m1[5]]; + } + static applyTransform(p, m) { + const xt = p[0] * m[0] + p[1] * m[2] + m[4]; + const yt = p[0] * m[1] + p[1] * m[3] + m[5]; + return [xt, yt]; + } + static applyInverseTransform(p, m) { + const d = m[0] * m[3] - m[1] * m[2]; + const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; + const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; + return [xt, yt]; + } + static getAxialAlignedBoundingBox(r, m) { + const p1 = this.applyTransform(r, m); + const p2 = this.applyTransform(r.slice(2, 4), m); + const p3 = this.applyTransform([r[0], r[3]], m); + const p4 = this.applyTransform([r[2], r[1]], m); + return [Math.min(p1[0], p2[0], p3[0], p4[0]), Math.min(p1[1], p2[1], p3[1], p4[1]), Math.max(p1[0], p2[0], p3[0], p4[0]), Math.max(p1[1], p2[1], p3[1], p4[1])]; + } + static inverseTransform(m) { + const d = m[0] * m[3] - m[1] * m[2]; + return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d]; + } + static singularValueDecompose2dScale(m) { + const transpose = [m[0], m[2], m[1], m[3]]; + const a = m[0] * transpose[0] + m[1] * transpose[2]; + const b = m[0] * transpose[1] + m[1] * transpose[3]; + const c = m[2] * transpose[0] + m[3] * transpose[2]; + const d = m[2] * transpose[1] + m[3] * transpose[3]; + const first = (a + d) / 2; + const second = Math.sqrt((a + d) ** 2 - 4 * (a * d - c * b)) / 2; + const sx = first + second || 1; + const sy = first - second || 1; + return [Math.sqrt(sx), Math.sqrt(sy)]; + } + static normalizeRect(rect) { + const r = rect.slice(0); + if (rect[0] > rect[2]) { + r[0] = rect[2]; + r[2] = rect[0]; + } + if (rect[1] > rect[3]) { + r[1] = rect[3]; + r[3] = rect[1]; + } + return r; + } + static intersect(rect1, rect2) { + const xLow = Math.max(Math.min(rect1[0], rect1[2]), Math.min(rect2[0], rect2[2])); + const xHigh = Math.min(Math.max(rect1[0], rect1[2]), Math.max(rect2[0], rect2[2])); + if (xLow > xHigh) { + return null; + } + const yLow = Math.max(Math.min(rect1[1], rect1[3]), Math.min(rect2[1], rect2[3])); + const yHigh = Math.min(Math.max(rect1[1], rect1[3]), Math.max(rect2[1], rect2[3])); + if (yLow > yHigh) { + return null; + } + return [xLow, yLow, xHigh, yHigh]; + } + static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3) { + const tvalues = [], + bounds = [[], []]; + let a, b, c, t, t1, t2, b2ac, sqrtb2ac; + for (let i = 0; i < 2; ++i) { + if (i === 0) { + b = 6 * x0 - 12 * x1 + 6 * x2; + a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3; + c = 3 * x1 - 3 * x0; + } else { + b = 6 * y0 - 12 * y1 + 6 * y2; + a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3; + c = 3 * y1 - 3 * y0; + } + if (Math.abs(a) < 1e-12) { + if (Math.abs(b) < 1e-12) { + continue; + } + t = -c / b; + if (0 < t && t < 1) { + tvalues.push(t); + } + continue; + } + b2ac = b * b - 4 * c * a; + sqrtb2ac = Math.sqrt(b2ac); + if (b2ac < 0) { + continue; + } + t1 = (-b + sqrtb2ac) / (2 * a); + if (0 < t1 && t1 < 1) { + tvalues.push(t1); + } + t2 = (-b - sqrtb2ac) / (2 * a); + if (0 < t2 && t2 < 1) { + tvalues.push(t2); + } + } + let j = tvalues.length, + mt; + const jlen = j; + while (j--) { + t = tvalues[j]; + mt = 1 - t; + bounds[0][j] = mt * mt * mt * x0 + 3 * mt * mt * t * x1 + 3 * mt * t * t * x2 + t * t * t * x3; + bounds[1][j] = mt * mt * mt * y0 + 3 * mt * mt * t * y1 + 3 * mt * t * t * y2 + t * t * t * y3; + } + bounds[0][jlen] = x0; + bounds[1][jlen] = y0; + bounds[0][jlen + 1] = x3; + bounds[1][jlen + 1] = y3; + bounds[0].length = bounds[1].length = jlen + 2; + return [Math.min(...bounds[0]), Math.min(...bounds[1]), Math.max(...bounds[0]), Math.max(...bounds[1])]; + } +} +const PDFStringTranslateTable = (/* unused pure expression or super */ null && ([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, 0x2c7, 0x2c6, 0x2d9, 0x2dd, 0x2db, 0x2da, 0x2dc, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192, 0x2044, 0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018, 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x141, 0x152, 0x160, 0x178, 0x17d, 0x131, 0x142, 0x153, 0x161, 0x17e, 0, 0x20ac])); +function stringToPDFString(str) { + if (str[0] >= "\xEF") { + let encoding; + if (str[0] === "\xFE" && str[1] === "\xFF") { + encoding = "utf-16be"; + if (str.length % 2 === 1) { + str = str.slice(0, -1); + } + } else if (str[0] === "\xFF" && str[1] === "\xFE") { + encoding = "utf-16le"; + if (str.length % 2 === 1) { + str = str.slice(0, -1); + } + } else if (str[0] === "\xEF" && str[1] === "\xBB" && str[2] === "\xBF") { + encoding = "utf-8"; + } + if (encoding) { + try { + const decoder = new TextDecoder(encoding, { + fatal: true + }); + const buffer = stringToBytes(str); + const decoded = decoder.decode(buffer); + if (!decoded.includes("\x1b")) { + return decoded; + } + return decoded.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g, ""); + } catch (ex) { + warn(`stringToPDFString: "${ex}".`); + } + } + } + const strBuf = []; + for (let i = 0, ii = str.length; i < ii; i++) { + const charCode = str.charCodeAt(i); + if (charCode === 0x1b) { + while (++i < ii && str.charCodeAt(i) !== 0x1b) {} + continue; + } + const code = PDFStringTranslateTable[charCode]; + strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); + } + return strBuf.join(""); +} +function stringToUTF8String(str) { + return decodeURIComponent(escape(str)); +} +function utf8StringToString(str) { + return unescape(encodeURIComponent(str)); +} +function isArrayBuffer(v) { + return typeof v === "object" && v?.byteLength !== undefined; +} +function isArrayEqual(arr1, arr2) { + if (arr1.length !== arr2.length) { + return false; + } + for (let i = 0, ii = arr1.length; i < ii; i++) { + if (arr1[i] !== arr2[i]) { + return false; + } + } + return true; +} +function getModificationDate(date = new Date()) { + const buffer = [date.getUTCFullYear().toString(), (date.getUTCMonth() + 1).toString().padStart(2, "0"), date.getUTCDate().toString().padStart(2, "0"), date.getUTCHours().toString().padStart(2, "0"), date.getUTCMinutes().toString().padStart(2, "0"), date.getUTCSeconds().toString().padStart(2, "0")]; + return buffer.join(""); +} +class PromiseCapability { + #settled = false; + constructor() { + this.promise = new Promise((resolve, reject) => { + this.resolve = data => { + this.#settled = true; + resolve(data); + }; + this.reject = reason => { + this.#settled = true; + reject(reason); + }; + }); + } + get settled() { + return this.#settled; + } +} +let NormalizeRegex = null; +let NormalizationMap = null; +function normalizeUnicode(str) { + if (!NormalizeRegex) { + NormalizeRegex = /([\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; + NormalizationMap = new Map([["ſt", "ſt"]]); + } + return str.replaceAll(NormalizeRegex, (_, p1, p2) => { + return p1 ? p1.normalize("NFKC") : NormalizationMap.get(p2); + }); +} +function getUuid() { + if (typeof crypto !== "undefined" && typeof crypto?.randomUUID === "function") { + return crypto.randomUUID(); + } + const buf = new Uint8Array(32); + if (typeof crypto !== "undefined" && typeof crypto?.getRandomValues === "function") { + crypto.getRandomValues(buf); + } else { + for (let i = 0; i < 32; i++) { + buf[i] = Math.floor(Math.random() * 255); + } + } + return bytesToString(buf); +} +const AnnotationPrefix = "pdfjs_internal_id_"; + + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The module cache +/******/ var __webpack_module_cache__ = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ // Check if module is in cache +/******/ var cachedModule = __webpack_module_cache__[moduleId]; +/******/ if (cachedModule !== undefined) { +/******/ return cachedModule.exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = __webpack_module_cache__[moduleId] = { +/******/ // no module.id needed +/******/ // no module.loaded needed +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/async module */ +/******/ (() => { +/******/ var webpackQueues = typeof Symbol === "function" ? Symbol("webpack queues") : "__webpack_queues__"; +/******/ var webpackExports = typeof Symbol === "function" ? Symbol("webpack exports") : "__webpack_exports__"; +/******/ var webpackError = typeof Symbol === "function" ? Symbol("webpack error") : "__webpack_error__"; +/******/ var resolveQueue = (queue) => { +/******/ if(queue && queue.d < 1) { +/******/ queue.d = 1; +/******/ queue.forEach((fn) => (fn.r--)); +/******/ queue.forEach((fn) => (fn.r-- ? fn.r++ : fn())); +/******/ } +/******/ } +/******/ var wrapDeps = (deps) => (deps.map((dep) => { +/******/ if(dep !== null && typeof dep === "object") { +/******/ if(dep[webpackQueues]) return dep; +/******/ if(dep.then) { +/******/ var queue = []; +/******/ queue.d = 0; +/******/ dep.then((r) => { +/******/ obj[webpackExports] = r; +/******/ resolveQueue(queue); +/******/ }, (e) => { +/******/ obj[webpackError] = e; +/******/ resolveQueue(queue); +/******/ }); +/******/ var obj = {}; +/******/ obj[webpackQueues] = (fn) => (fn(queue)); +/******/ return obj; +/******/ } +/******/ } +/******/ var ret = {}; +/******/ ret[webpackQueues] = x => {}; +/******/ ret[webpackExports] = dep; +/******/ return ret; +/******/ })); +/******/ __webpack_require__.a = (module, body, hasAwait) => { +/******/ var queue; +/******/ hasAwait && ((queue = []).d = -1); +/******/ var depQueues = new Set(); +/******/ var exports = module.exports; +/******/ var currentDeps; +/******/ var outerResolve; +/******/ var reject; +/******/ var promise = new Promise((resolve, rej) => { +/******/ reject = rej; +/******/ outerResolve = resolve; +/******/ }); +/******/ promise[webpackExports] = exports; +/******/ promise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise["catch"](x => {})); +/******/ module.exports = promise; +/******/ body((deps) => { +/******/ currentDeps = wrapDeps(deps); +/******/ var fn; +/******/ var getResult = () => (currentDeps.map((d) => { +/******/ if(d[webpackError]) throw d[webpackError]; +/******/ return d[webpackExports]; +/******/ })) +/******/ var promise = new Promise((resolve) => { +/******/ fn = () => (resolve(getResult)); +/******/ fn.r = 0; +/******/ var fnQueue = (q) => (q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn)))); +/******/ currentDeps.map((dep) => (dep[webpackQueues](fnQueue))); +/******/ }); +/******/ return fn.r ? promise : getResult(); +/******/ }, (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue))); +/******/ queue && queue.d < 0 && (queue.d = 0); +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/************************************************************************/ +/******/ +/******/ // startup +/******/ // Load entry module and return exports +/******/ // This entry module used 'module' so it can't be inlined +/******/ var __webpack_exports__ = __webpack_require__(907); +/******/ __webpack_exports__ = globalThis.pdfjsLib = await (globalThis.pdfjsLibPromise = __webpack_exports__); +/******/ var __webpack_exports__AbortException = __webpack_exports__.AbortException; +/******/ var __webpack_exports__AnnotationEditorLayer = __webpack_exports__.AnnotationEditorLayer; +/******/ var __webpack_exports__AnnotationEditorParamsType = __webpack_exports__.AnnotationEditorParamsType; +/******/ var __webpack_exports__AnnotationEditorType = __webpack_exports__.AnnotationEditorType; +/******/ var __webpack_exports__AnnotationEditorUIManager = __webpack_exports__.AnnotationEditorUIManager; +/******/ var __webpack_exports__AnnotationLayer = __webpack_exports__.AnnotationLayer; +/******/ var __webpack_exports__AnnotationMode = __webpack_exports__.AnnotationMode; +/******/ var __webpack_exports__CMapCompressionType = __webpack_exports__.CMapCompressionType; +/******/ var __webpack_exports__ColorPicker = __webpack_exports__.ColorPicker; +/******/ var __webpack_exports__DOMSVGFactory = __webpack_exports__.DOMSVGFactory; +/******/ var __webpack_exports__DrawLayer = __webpack_exports__.DrawLayer; +/******/ var __webpack_exports__FeatureTest = __webpack_exports__.FeatureTest; +/******/ var __webpack_exports__GlobalWorkerOptions = __webpack_exports__.GlobalWorkerOptions; +/******/ var __webpack_exports__ImageKind = __webpack_exports__.ImageKind; +/******/ var __webpack_exports__InvalidPDFException = __webpack_exports__.InvalidPDFException; +/******/ var __webpack_exports__MissingPDFException = __webpack_exports__.MissingPDFException; +/******/ var __webpack_exports__OPS = __webpack_exports__.OPS; +/******/ var __webpack_exports__Outliner = __webpack_exports__.Outliner; +/******/ var __webpack_exports__PDFDataRangeTransport = __webpack_exports__.PDFDataRangeTransport; +/******/ var __webpack_exports__PDFDateString = __webpack_exports__.PDFDateString; +/******/ var __webpack_exports__PDFWorker = __webpack_exports__.PDFWorker; +/******/ var __webpack_exports__PasswordResponses = __webpack_exports__.PasswordResponses; +/******/ var __webpack_exports__PermissionFlag = __webpack_exports__.PermissionFlag; +/******/ var __webpack_exports__PixelsPerInch = __webpack_exports__.PixelsPerInch; +/******/ var __webpack_exports__PromiseCapability = __webpack_exports__.PromiseCapability; +/******/ var __webpack_exports__RenderingCancelledException = __webpack_exports__.RenderingCancelledException; +/******/ var __webpack_exports__UnexpectedResponseException = __webpack_exports__.UnexpectedResponseException; +/******/ var __webpack_exports__Util = __webpack_exports__.Util; +/******/ var __webpack_exports__VerbosityLevel = __webpack_exports__.VerbosityLevel; +/******/ var __webpack_exports__XfaLayer = __webpack_exports__.XfaLayer; +/******/ var __webpack_exports__build = __webpack_exports__.build; +/******/ var __webpack_exports__createValidAbsoluteUrl = __webpack_exports__.createValidAbsoluteUrl; +/******/ var __webpack_exports__fetchData = __webpack_exports__.fetchData; +/******/ var __webpack_exports__getDocument = __webpack_exports__.getDocument; +/******/ var __webpack_exports__getFilenameFromUrl = __webpack_exports__.getFilenameFromUrl; +/******/ var __webpack_exports__getPdfFilenameFromUrl = __webpack_exports__.getPdfFilenameFromUrl; +/******/ var __webpack_exports__getXfaPageViewport = __webpack_exports__.getXfaPageViewport; +/******/ var __webpack_exports__isDataScheme = __webpack_exports__.isDataScheme; +/******/ var __webpack_exports__isPdfFile = __webpack_exports__.isPdfFile; +/******/ var __webpack_exports__noContextMenu = __webpack_exports__.noContextMenu; +/******/ var __webpack_exports__normalizeUnicode = __webpack_exports__.normalizeUnicode; +/******/ var __webpack_exports__renderTextLayer = __webpack_exports__.renderTextLayer; +/******/ var __webpack_exports__setLayerDimensions = __webpack_exports__.setLayerDimensions; +/******/ var __webpack_exports__shadow = __webpack_exports__.shadow; +/******/ var __webpack_exports__updateTextLayer = __webpack_exports__.updateTextLayer; +/******/ var __webpack_exports__version = __webpack_exports__.version; +/******/ export { __webpack_exports__AbortException as AbortException, __webpack_exports__AnnotationEditorLayer as AnnotationEditorLayer, __webpack_exports__AnnotationEditorParamsType as AnnotationEditorParamsType, __webpack_exports__AnnotationEditorType as AnnotationEditorType, __webpack_exports__AnnotationEditorUIManager as AnnotationEditorUIManager, __webpack_exports__AnnotationLayer as AnnotationLayer, __webpack_exports__AnnotationMode as AnnotationMode, __webpack_exports__CMapCompressionType as CMapCompressionType, __webpack_exports__ColorPicker as ColorPicker, __webpack_exports__DOMSVGFactory as DOMSVGFactory, __webpack_exports__DrawLayer as DrawLayer, __webpack_exports__FeatureTest as FeatureTest, __webpack_exports__GlobalWorkerOptions as GlobalWorkerOptions, __webpack_exports__ImageKind as ImageKind, __webpack_exports__InvalidPDFException as InvalidPDFException, __webpack_exports__MissingPDFException as MissingPDFException, __webpack_exports__OPS as OPS, __webpack_exports__Outliner as Outliner, __webpack_exports__PDFDataRangeTransport as PDFDataRangeTransport, __webpack_exports__PDFDateString as PDFDateString, __webpack_exports__PDFWorker as PDFWorker, __webpack_exports__PasswordResponses as PasswordResponses, __webpack_exports__PermissionFlag as PermissionFlag, __webpack_exports__PixelsPerInch as PixelsPerInch, __webpack_exports__PromiseCapability as PromiseCapability, __webpack_exports__RenderingCancelledException as RenderingCancelledException, __webpack_exports__UnexpectedResponseException as UnexpectedResponseException, __webpack_exports__Util as Util, __webpack_exports__VerbosityLevel as VerbosityLevel, __webpack_exports__XfaLayer as XfaLayer, __webpack_exports__build as build, __webpack_exports__createValidAbsoluteUrl as createValidAbsoluteUrl, __webpack_exports__fetchData as fetchData, __webpack_exports__getDocument as getDocument, __webpack_exports__getFilenameFromUrl as getFilenameFromUrl, __webpack_exports__getPdfFilenameFromUrl as getPdfFilenameFromUrl, __webpack_exports__getXfaPageViewport as getXfaPageViewport, __webpack_exports__isDataScheme as isDataScheme, __webpack_exports__isPdfFile as isPdfFile, __webpack_exports__noContextMenu as noContextMenu, __webpack_exports__normalizeUnicode as normalizeUnicode, __webpack_exports__renderTextLayer as renderTextLayer, __webpack_exports__setLayerDimensions as setLayerDimensions, __webpack_exports__shadow as shadow, __webpack_exports__updateTextLayer as updateTextLayer, __webpack_exports__version as version }; +/******/ + +//# sourceMappingURL=pdf.mjs.map diff --git a/shared/static/shared/vendor/pdf.js-4.0.379/pdf.mjs.map b/shared/static/shared/vendor/pdf.js-4.0.379/pdf.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..cc7d5ac1dd5b31cbaaa8ab6aadbaf65db7cf48fe --- /dev/null +++ b/shared/static/shared/vendor/pdf.js-4.0.379/pdf.mjs.map @@ -0,0 +1 @@ +{"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A;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA;UACA,IAAI;UACJ;UACA;UACA,IAAI;UACJ;UACA;UACA;UACA;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/highlight.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/color_picker.js","webpack://pdf.js/src/display/editor/alt_text.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 null; // Ignore any pending requests if the worker was terminated.\n }\n\n if (this.commonObjs.has(id)) {\n return null;\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 \"CopyLocalImage\":\n const { imageRef } = exportedData;\n assert(imageRef, \"The imageRef must be defined.\");\n\n for (const pageProxy of this.#pageCache.values()) {\n for (const [, data] of pageProxy.objs) {\n if (data.ref !== imageRef) {\n continue;\n }\n if (!data.dataLen) {\n return null;\n }\n this.commonObjs.resolve(id, structuredClone(data));\n return data.dataLen;\n }\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 return null;\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?.dataLen > MAX_IMAGE_SIZE_TO_CACHE) {\n pageProxy._maybeCleanupAfterRender = true;\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 *[Symbol.iterator]() {\n for (const objId in this.#objs) {\n const { capability, data } = this.#objs[objId];\n\n if (!capability.settled) {\n continue;\n }\n yield [objId, data];\n }\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 if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"getOperatorList\", {\n value: () => {\n return this.#internalRenderTask.operatorList;\n },\n });\n }\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 if (this.#parent === null) {\n return;\n }\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 { bindEvents } from \"./tools.js\";\nimport { ColorPicker } from \"./color_picker.js\";\nimport { Outliner } from \"./outliner.js\";\n\n/**\n * Basic draw editor in order to generate an Highlight annotation.\n */\nclass HighlightEditor extends AnnotationEditor {\n #boxes;\n\n #clipPathId = null;\n\n #colorPicker = null;\n\n #focusOutlines = null;\n\n #highlightDiv = null;\n\n #highlightOutlines = null;\n\n #id = null;\n\n #lastPoint = null;\n\n #opacity;\n\n #outlineId = null;\n\n static _defaultColor = null;\n\n static _defaultOpacity = 1;\n\n static _l10nPromise;\n\n static _type = \"highlight\";\n\n static _editorType = AnnotationEditorType.HIGHLIGHT;\n\n constructor(params) {\n super({ ...params, name: \"highlightEditor\" });\n HighlightEditor._defaultColor ||=\n this._uiManager.highlightColors?.values().next().value || \"#fff066\";\n this.color = params.color || HighlightEditor._defaultColor;\n this.#opacity = params.opacity || HighlightEditor._defaultOpacity;\n this.#boxes = params.boxes || null;\n this._isDraggable = false;\n\n this.#createOutlines();\n this.#addToDrawLayer();\n this.rotate(this.rotation);\n }\n\n #createOutlines() {\n const outliner = new Outliner(this.#boxes, /* borderWidth = */ 0.001);\n this.#highlightOutlines = outliner.getOutlines();\n ({\n x: this.x,\n y: this.y,\n width: this.width,\n height: this.height,\n } = this.#highlightOutlines.box);\n\n const outlinerForOutline = new Outliner(\n this.#boxes,\n /* borderWidth = */ 0.0025,\n /* innerMargin = */ 0.001,\n this._uiManager.direction === \"ltr\"\n );\n this.#focusOutlines = outlinerForOutline.getOutlines();\n\n // The last point is in the pages coordinate system.\n const { lastPoint } = this.#focusOutlines.box;\n this.#lastPoint = [\n (lastPoint[0] - this.x) / this.width,\n (lastPoint[1] - this.y) / this.height,\n ];\n }\n\n static initialize(l10n) {\n AnnotationEditor.initialize(l10n);\n }\n\n static updateDefaultParams(type, value) {\n switch (type) {\n case AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR:\n HighlightEditor._defaultColor = value;\n break;\n }\n }\n\n /** @inheritdoc */\n get toolbarPosition() {\n return this.#lastPoint;\n }\n\n /** @inheritdoc */\n updateParams(type, value) {\n switch (type) {\n case AnnotationEditorParamsType.HIGHLIGHT_COLOR:\n this.#updateColor(value);\n break;\n }\n }\n\n static get defaultPropertiesToUpdate() {\n return [\n [\n AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR,\n HighlightEditor._defaultColor,\n ],\n ];\n }\n\n /** @inheritdoc */\n get propertiesToUpdate() {\n return [\n [\n AnnotationEditorParamsType.HIGHLIGHT_COLOR,\n this.color || HighlightEditor._defaultColor,\n ],\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.parent.drawLayer.changeColor(this.#id, color);\n this.#colorPicker?.updateColor(color);\n },\n undo: () => {\n this.color = savedColor;\n this.parent.drawLayer.changeColor(this.#id, savedColor);\n this.#colorPicker?.updateColor(savedColor);\n },\n mustExec: true,\n type: AnnotationEditorParamsType.HIGHLIGHT_COLOR,\n overwriteIfSameType: true,\n keepUndo: true,\n });\n }\n\n /** @inheritdoc */\n async addEditToolbar() {\n const toolbar = await super.addEditToolbar();\n if (!toolbar) {\n return null;\n }\n if (this._uiManager.highlightColors) {\n this.#colorPicker = new ColorPicker({ editor: this });\n toolbar.addColorPicker(this.#colorPicker);\n }\n return toolbar;\n }\n\n /** @inheritdoc */\n disableEditing() {\n super.disableEditing();\n this.div.classList.toggle(\"disabled\", true);\n }\n\n /** @inheritdoc */\n enableEditing() {\n super.enableEditing();\n this.div.classList.toggle(\"disabled\", false);\n }\n\n /** @inheritdoc */\n fixAndSetPosition() {\n return super.fixAndSetPosition(0);\n }\n\n /** @inheritdoc */\n getRect(tx, ty) {\n return super.getRect(tx, ty, 0);\n }\n\n /** @inheritdoc */\n onceAdded() {\n this.parent.addUndoableEditor(this);\n this.div.focus();\n }\n\n /** @inheritdoc */\n remove() {\n super.remove();\n this.#cleanDrawLayer();\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 this.#addToDrawLayer();\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 setParent(parent) {\n let mustBeSelected = false;\n if (this.parent && !parent) {\n this.#cleanDrawLayer();\n } else if (parent) {\n this.#addToDrawLayer(parent);\n // If mustBeSelected is true it means that this editor was selected\n // when its parent has been destroyed, hence we must select it again.\n mustBeSelected =\n !this.parent && this.div?.classList.contains(\"selectedEditor\");\n }\n super.setParent(parent);\n if (mustBeSelected) {\n // We select it after the parent has been set.\n this.select();\n }\n }\n\n #cleanDrawLayer() {\n if (this.#id === null || !this.parent) {\n return;\n }\n this.parent.drawLayer.remove(this.#id);\n this.#id = null;\n this.parent.drawLayer.remove(this.#outlineId);\n this.#outlineId = null;\n }\n\n #addToDrawLayer(parent = this.parent) {\n if (this.#id !== null) {\n return;\n }\n ({ id: this.#id, clipPathId: this.#clipPathId } =\n parent.drawLayer.highlight(\n this.#highlightOutlines,\n this.color,\n this.#opacity\n ));\n if (this.#highlightDiv) {\n this.#highlightDiv.style.clipPath = this.#clipPathId;\n }\n this.#outlineId = parent.drawLayer.highlightOutline(this.#focusOutlines);\n }\n\n static #rotateBbox({ x, y, width, height }, angle) {\n switch (angle) {\n case 90:\n return {\n x: 1 - y - height,\n y: x,\n width: height,\n height: width,\n };\n case 180:\n return {\n x: 1 - x - width,\n y: 1 - y - height,\n width,\n height,\n };\n case 270:\n return {\n x: y,\n y: 1 - x - width,\n width: height,\n height: width,\n };\n }\n return {\n x,\n y,\n width,\n height,\n };\n }\n\n /** @inheritdoc */\n rotate(angle) {\n const { drawLayer } = this.parent;\n drawLayer.rotate(this.#id, angle);\n drawLayer.rotate(this.#outlineId, angle);\n drawLayer.updateBox(this.#id, HighlightEditor.#rotateBbox(this, angle));\n drawLayer.updateBox(\n this.#outlineId,\n HighlightEditor.#rotateBbox(this.#focusOutlines.box, angle)\n );\n }\n\n /** @inheritdoc */\n render() {\n if (this.div) {\n return this.div;\n }\n\n const div = super.render();\n const highlightDiv = (this.#highlightDiv = document.createElement(\"div\"));\n div.append(highlightDiv);\n highlightDiv.className = \"internal\";\n highlightDiv.style.clipPath = this.#clipPathId;\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setDims(this.width * parentWidth, this.height * parentHeight);\n\n bindEvents(this, this.#highlightDiv, [\"pointerover\", \"pointerleave\"]);\n this.enableEditing();\n\n return div;\n }\n\n pointerover() {\n this.parent.drawLayer.addClass(this.#outlineId, \"hovered\");\n }\n\n pointerleave() {\n this.parent.drawLayer.removeClass(this.#outlineId, \"hovered\");\n }\n\n /** @inheritdoc */\n select() {\n super.select();\n this.parent?.drawLayer.removeClass(this.#outlineId, \"hovered\");\n this.parent?.drawLayer.addClass(this.#outlineId, \"selected\");\n }\n\n /** @inheritdoc */\n unselect() {\n super.unselect();\n this.parent?.drawLayer.removeClass(this.#outlineId, \"selected\");\n }\n\n #serializeBoxes() {\n const [pageWidth, pageHeight] = this.pageDimensions;\n const boxes = this.#boxes;\n const quadPoints = new Array(boxes.length * 8);\n let i = 0;\n for (const { x, y, width, height } of boxes) {\n const sx = x * pageWidth;\n const sy = (1 - y - height) * pageHeight;\n // The specifications say that the rectangle should start from the bottom\n // left corner and go counter-clockwise.\n // But when opening the file in Adobe Acrobat it appears that this isn't\n // correct hence the 4th and 6th numbers are just swapped.\n quadPoints[i] = quadPoints[i + 4] = sx;\n quadPoints[i + 1] = quadPoints[i + 3] = sy;\n quadPoints[i + 2] = quadPoints[i + 6] = sx + width * pageWidth;\n quadPoints[i + 5] = quadPoints[i + 7] = sy + height * pageHeight;\n i += 8;\n }\n return quadPoints;\n }\n\n #serializeOutlines() {\n const [pageWidth, pageHeight] = this.pageDimensions;\n const width = this.width * pageWidth;\n const height = this.height * pageHeight;\n const tx = this.x * pageWidth;\n const ty = (1 - this.y - this.height) * pageHeight;\n const outlines = [];\n for (const outline of this.#highlightOutlines.outlines) {\n const points = new Array(outline.length);\n for (let i = 0; i < outline.length; i += 2) {\n points[i] = tx + outline[i] * width;\n points[i + 1] = ty + (1 - outline[i + 1]) * height;\n }\n outlines.push(points);\n }\n return outlines;\n }\n\n /** @inheritdoc */\n static deserialize(data, parent, uiManager) {\n const editor = super.deserialize(data, parent, uiManager);\n\n const { rect, color, quadPoints } = data;\n editor.color = Util.makeHexColor(...color);\n editor.#opacity = data.opacity;\n\n const [pageWidth, pageHeight] = editor.pageDimensions;\n editor.width = (rect[2] - rect[0]) / pageWidth;\n editor.height = (rect[3] - rect[1]) / pageHeight;\n const boxes = (editor.#boxes = []);\n for (let i = 0; i < quadPoints.length; i += 8) {\n boxes.push({\n x: quadPoints[4] / pageWidth,\n y: 1 - quadPoints[i + 5] / pageHeight,\n width: (quadPoints[i + 2] - quadPoints[i]) / pageWidth,\n height: (quadPoints[i + 5] - quadPoints[i + 1]) / pageHeight,\n });\n }\n editor.#createOutlines();\n\n return editor;\n }\n\n /** @inheritdoc */\n serialize(isForCopying = false) {\n // It doesn't make sense to copy/paste a highlight annotation.\n if (this.isEmpty() || isForCopying) {\n return null;\n }\n\n const rect = this.getRect(0, 0);\n const color = AnnotationEditor._colorManager.convert(this.color);\n\n return {\n annotationType: AnnotationEditorType.HIGHLIGHT,\n color,\n opacity: this.#opacity,\n quadPoints: this.#serializeBoxes(),\n outlines: this.#serializeOutlines(),\n pageIndex: this.pageIndex,\n rect,\n rotation: 0,\n structTreeParentId: this._structTreeParentId,\n };\n }\n\n static canCreateNewEmptyEditor() {\n return false;\n }\n}\n\nexport { HighlightEditor };\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 (!this.div.contains(document.activeElement)) {\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/** @typedef {import(\"../draw_layer.js\").DrawLayer} DrawLayer */\n\nimport { AnnotationEditorType, FeatureTest } from \"../../shared/util.js\";\nimport { AnnotationEditor } from \"./editor.js\";\nimport { FreeTextEditor } from \"./freetext.js\";\nimport { HighlightEditor } from \"./highlight.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 {HTMLDivElement} [textLayer]\n * @property {DrawLayer} drawLayer\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 #boundPointerUpAfterSelection = this.pointerUpAfterSelection.bind(this);\n\n #boundPointerdown = this.pointerdown.bind(this);\n\n #editorFocusTimeoutId = null;\n\n #boundSelectionStart = this.selectionStart.bind(this);\n\n #editors = new Map();\n\n #hadPointerDown = false;\n\n #isCleaningUp = false;\n\n #isDisabling = false;\n\n #textLayer = null;\n\n #uiManager;\n\n static _initialized = false;\n\n static #editorTypes = new Map(\n [FreeTextEditor, InkEditor, StampEditor, HighlightEditor].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 drawLayer,\n textLayer,\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 this.#textLayer = textLayer;\n this.drawLayer = drawLayer;\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 switch (mode) {\n case AnnotationEditorType.NONE:\n this.disableTextSelection();\n this.togglePointerEvents(false);\n this.disableClick();\n break;\n case AnnotationEditorType.INK:\n // We always want to have an ink editor ready to draw in.\n this.addInkEditorIfNeeded(false);\n\n this.disableTextSelection();\n this.togglePointerEvents(true);\n this.disableClick();\n break;\n case AnnotationEditorType.HIGHLIGHT:\n this.enableTextSelection();\n this.togglePointerEvents(false);\n this.disableClick();\n break;\n default:\n this.disableTextSelection();\n this.togglePointerEvents(true);\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 (this.#uiManager.getMode() !== AnnotationEditorType.INK) {\n // We don't want to add an ink editor if we're not in ink mode!\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 this.disableTextSelection();\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 enableTextSelection() {\n if (this.#textLayer?.div) {\n document.addEventListener(\"selectstart\", this.#boundSelectionStart);\n }\n }\n\n disableTextSelection() {\n if (this.#textLayer?.div) {\n document.removeEventListener(\"selectstart\", this.#boundSelectionStart);\n }\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 get #currentEditorType() {\n return AnnotationEditorLayer.#editorTypes.get(this.#uiManager.getMode());\n }\n\n /**\n * Create a new editor\n * @param {Object} params\n * @returns {AnnotationEditor}\n */\n #createNewEditor(params) {\n const editorType = this.#currentEditorType;\n return editorType ? new editorType.prototype.constructor(params) : null;\n }\n\n canCreateNewEmptyEditor() {\n return this.#currentEditorType?.canCreateNewEmptyEditor();\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 * @param [Object] data\n * @returns {AnnotationEditor}\n */\n #createAndAddNewEditor(event, isCentered, data = {}) {\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 ...data,\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 * SelectionChange callback.\n * @param {Event} _event\n */\n selectionStart(_event) {\n this.#textLayer?.div.addEventListener(\n \"pointerup\",\n this.#boundPointerUpAfterSelection,\n { once: true }\n );\n }\n\n /**\n * Called when the user releases the mouse button after having selected\n * some text.\n * @param {PointerEvent} event\n */\n pointerUpAfterSelection(event) {\n const selection = document.getSelection();\n if (selection.rangeCount === 0) {\n return;\n }\n const range = selection.getRangeAt(0);\n if (range.collapsed) {\n return;\n }\n\n if (!this.#textLayer?.div.contains(range.commonAncestorContainer)) {\n return;\n }\n\n const {\n x: layerX,\n y: layerY,\n width: parentWidth,\n height: parentHeight,\n } = this.#textLayer.div.getBoundingClientRect();\n const bboxes = range.getClientRects();\n\n // We must rotate the boxes because we want to have them in the non-rotated\n // page coordinates.\n let rotator;\n switch (this.viewport.rotation) {\n case 90:\n rotator = (x, y, w, h) => ({\n x: (y - layerY) / parentHeight,\n y: 1 - (x + w - layerX) / parentWidth,\n width: h / parentHeight,\n height: w / parentWidth,\n });\n break;\n case 180:\n rotator = (x, y, w, h) => ({\n x: 1 - (x + w - layerX) / parentWidth,\n y: 1 - (y + h - layerY) / parentHeight,\n width: w / parentWidth,\n height: h / parentHeight,\n });\n break;\n case 270:\n rotator = (x, y, w, h) => ({\n x: 1 - (y + h - layerY) / parentHeight,\n y: (x - layerX) / parentWidth,\n width: h / parentHeight,\n height: w / parentWidth,\n });\n break;\n default:\n rotator = (x, y, w, h) => ({\n x: (x - layerX) / parentWidth,\n y: (y - layerY) / parentHeight,\n width: w / parentWidth,\n height: h / parentHeight,\n });\n break;\n }\n\n const boxes = [];\n for (const { x, y, width, height } of bboxes) {\n if (width === 0 || height === 0) {\n continue;\n }\n boxes.push(rotator(x, y, width, height));\n }\n if (boxes.length !== 0) {\n this.#createAndAddNewEditor(event, false, {\n boxes,\n });\n }\n selection.empty();\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.#uiManager.getMode() === AnnotationEditorType.HIGHLIGHT) {\n this.enableTextSelection();\n }\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 const oldRotation = this.viewport.rotation;\n const rotation = viewport.rotation;\n this.viewport = viewport;\n setLayerDimensions(this.div, { rotation });\n if (oldRotation !== rotation) {\n for (const editor of this.#editors.values()) {\n editor.rotate(rotation);\n }\n }\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 { AnnotationEditorParamsType, shadow } from \"../../shared/util.js\";\nimport { KeyboardManager } from \"./tools.js\";\nimport { noContextMenu } from \"../display_utils.js\";\n\nclass ColorPicker {\n #boundKeyDown = this.#keyDown.bind(this);\n\n #button = null;\n\n #buttonSwatch = null;\n\n #defaultColor;\n\n #dropdown = null;\n\n #dropdownWasFromKeyboard = false;\n\n #isMainColorPicker = false;\n\n #eventBus;\n\n #uiManager = null;\n\n static get _keyboardManager() {\n return shadow(\n this,\n \"_keyboardManager\",\n new KeyboardManager([\n [\n [\"Escape\", \"mac+Escape\"],\n ColorPicker.prototype._hideDropdownFromKeyboard,\n ],\n [[\" \", \"mac+ \"], ColorPicker.prototype._colorSelectFromKeyboard],\n [\n [\"ArrowDown\", \"ArrowRight\", \"mac+ArrowDown\", \"mac+ArrowRight\"],\n ColorPicker.prototype._moveToNext,\n ],\n [\n [\"ArrowUp\", \"ArrowLeft\", \"mac+ArrowUp\", \"mac+ArrowLeft\"],\n ColorPicker.prototype._moveToPrevious,\n ],\n [[\"Home\", \"mac+Home\"], ColorPicker.prototype._moveToBeginning],\n [[\"End\", \"mac+End\"], ColorPicker.prototype._moveToEnd],\n ])\n );\n }\n\n constructor({ editor = null, uiManager = null }) {\n this.#isMainColorPicker = !editor;\n this.#uiManager = editor?._uiManager || uiManager;\n this.#eventBus = this.#uiManager._eventBus;\n this.#defaultColor =\n editor?.color ||\n this.#uiManager?.highlightColors.values().next().value ||\n \"#FFFF98\";\n }\n\n renderButton() {\n const button = (this.#button = document.createElement(\"button\"));\n button.className = \"colorPicker\";\n button.tabIndex = \"0\";\n button.setAttribute(\"data-l10n-id\", \"pdfjs-editor-colorpicker-button\");\n button.setAttribute(\"aria-haspopup\", true);\n button.addEventListener(\"click\", this.#openDropdown.bind(this));\n const swatch = (this.#buttonSwatch = document.createElement(\"span\"));\n swatch.className = \"swatch\";\n swatch.style.backgroundColor = this.#defaultColor;\n button.append(swatch);\n return button;\n }\n\n renderMainDropdown() {\n const dropdown = (this.#dropdown = this.#getDropdownRoot(\n AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR\n ));\n dropdown.setAttribute(\"aria-orientation\", \"horizontal\");\n dropdown.setAttribute(\"aria-labelledby\", \"highlightColorPickerLabel\");\n\n return dropdown;\n }\n\n #getDropdownRoot(paramType) {\n const div = document.createElement(\"div\");\n div.addEventListener(\"contextmenu\", noContextMenu);\n div.className = \"dropdown\";\n div.role = \"listbox\";\n div.setAttribute(\"aria-multiselectable\", false);\n div.setAttribute(\"aria-orientation\", \"vertical\");\n div.setAttribute(\"data-l10n-id\", \"pdfjs-editor-colorpicker-dropdown\");\n for (const [name, color] of this.#uiManager.highlightColors) {\n const button = document.createElement(\"button\");\n button.tabIndex = \"0\";\n button.role = \"option\";\n button.setAttribute(\"data-color\", color);\n button.title = name;\n button.setAttribute(\"data-l10n-id\", `pdfjs-editor-colorpicker-${name}`);\n const swatch = document.createElement(\"span\");\n button.append(swatch);\n swatch.className = \"swatch\";\n swatch.style.backgroundColor = color;\n button.setAttribute(\"aria-selected\", color === this.#defaultColor);\n button.addEventListener(\n \"click\",\n this.#colorSelect.bind(this, paramType, color)\n );\n div.append(button);\n }\n\n div.addEventListener(\"keydown\", this.#boundKeyDown);\n\n return div;\n }\n\n #colorSelect(type, color, event) {\n event.stopPropagation();\n this.#eventBus.dispatch(\"switchannotationeditorparams\", {\n source: this,\n type,\n value: color,\n });\n }\n\n _colorSelectFromKeyboard(event) {\n const color = event.target.getAttribute(\"data-color\");\n if (!color) {\n return;\n }\n this.#colorSelect(color, event);\n }\n\n _moveToNext(event) {\n if (event.target === this.#button) {\n this.#dropdown.firstChild?.focus();\n return;\n }\n event.target.nextSibling?.focus();\n }\n\n _moveToPrevious(event) {\n event.target.previousSibling?.focus();\n }\n\n _moveToBeginning() {\n this.#dropdown.firstChild?.focus();\n }\n\n _moveToEnd() {\n this.#dropdown.lastChild?.focus();\n }\n\n #keyDown(event) {\n ColorPicker._keyboardManager.exec(this, event);\n }\n\n #openDropdown(event) {\n if (this.#dropdown && !this.#dropdown.classList.contains(\"hidden\")) {\n this.hideDropdown();\n return;\n }\n this.#button.addEventListener(\"keydown\", this.#boundKeyDown);\n this.#dropdownWasFromKeyboard = event.detail === 0;\n if (this.#dropdown) {\n this.#dropdown.classList.remove(\"hidden\");\n return;\n }\n const root = (this.#dropdown = this.#getDropdownRoot(\n AnnotationEditorParamsType.HIGHLIGHT_COLOR\n ));\n this.#button.append(root);\n }\n\n hideDropdown() {\n this.#dropdown?.classList.add(\"hidden\");\n }\n\n _hideDropdownFromKeyboard() {\n if (\n this.#isMainColorPicker ||\n !this.#dropdown ||\n this.#dropdown.classList.contains(\"hidden\")\n ) {\n return;\n }\n this.hideDropdown();\n this.#button.removeEventListener(\"keydown\", this.#boundKeyDown);\n this.#button.focus({\n preventScroll: true,\n focusVisible: this.#dropdownWasFromKeyboard,\n });\n }\n\n updateColor(color) {\n if (this.#buttonSwatch) {\n this.#buttonSwatch.style.backgroundColor = color;\n }\n if (!this.#dropdown) {\n return;\n }\n\n const i = this.#uiManager.highlightColors.values();\n for (const child of this.#dropdown.children) {\n child.setAttribute(\"aria-selected\", i.next().value === color);\n }\n }\n\n destroy() {\n this.#button?.remove();\n this.#button = null;\n this.#buttonSwatch = null;\n this.#dropdown?.remove();\n this.#dropdown = null;\n }\n}\n\nexport { ColorPicker };\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 AltText {\n #altText = \"\";\n\n #altTextDecorative = false;\n\n #altTextButton = null;\n\n #altTextTooltip = null;\n\n #altTextTooltipTimeout = null;\n\n #altTextWasFromKeyBoard = false;\n\n #editor = null;\n\n static _l10nPromise = null;\n\n constructor(editor) {\n this.#editor = editor;\n }\n\n static initialize(l10nPromise) {\n AltText._l10nPromise ||= l10nPromise;\n }\n\n async render() {\n const altText = (this.#altTextButton = document.createElement(\"button\"));\n altText.className = \"altText\";\n const msg = await AltText._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 event.preventDefault();\n this.#editor._uiManager.editAltText(this.#editor);\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 await this.#setState();\n\n return altText;\n }\n\n finish() {\n if (!this.#altTextButton) {\n return;\n }\n this.#altTextButton.focus({ focusVisible: this.#altTextWasFromKeyBoard });\n this.#altTextWasFromKeyBoard = false;\n }\n\n get data() {\n return {\n altText: this.#altText,\n decorative: this.#altTextDecorative,\n };\n }\n\n /**\n * Set the alt text data.\n */\n set data({ altText, decorative }) {\n if (this.#altText === altText && this.#altTextDecorative === decorative) {\n return;\n }\n this.#altText = altText;\n this.#altTextDecorative = decorative;\n this.#setState();\n }\n\n toggle(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 destroy() {\n this.#altTextButton?.remove();\n this.#altTextButton = null;\n this.#altTextTooltip = null;\n }\n\n async #setState() {\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 AltText._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.#editor.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.#editor._uiManager._eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"editing\",\n subtype: this.#editor.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 AltText._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.#editor.getImageForAltText();\n element?.setAttribute(\"aria-describedby\", tooltip.id);\n }\n}\n\nexport { AltText };\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 #colorPicker = 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 const position = this.#editor.toolbarPosition;\n if (position) {\n const { style } = editToolbar;\n const x =\n this.#editor._uiManager.direction === \"ltr\"\n ? 1 - position[0]\n : position[0];\n style.insetInlineEnd = `${100 * x}%`;\n style.top = `calc(${\n 100 * position[1]\n }% + var(--editor-toolbar-vert-offset))`;\n }\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 this.#colorPicker?.hideDropdown();\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(\n \"data-l10n-id\",\n `pdfjs-editor-remove-${this.#editor.editorType}-button`\n );\n this.#addListenersToElement(button);\n button.addEventListener(\"click\", e => {\n this.#editor._uiManager.delete();\n });\n this.#buttons.append(button);\n }\n\n get #divider() {\n const divider = document.createElement(\"div\");\n divider.className = \"divider\";\n return divider;\n }\n\n addAltTextButton(button) {\n this.#addListenersToElement(button);\n this.#buttons.prepend(button, this.#divider);\n }\n\n addColorPicker(colorPicker) {\n this.#colorPicker = colorPicker;\n const button = colorPicker.renderButton();\n this.#addListenersToElement(button);\n this.#buttons.prepend(button, this.#divider);\n }\n\n remove() {\n this.#toolbar.remove();\n this.#colorPicker?.destroy();\n this.#colorPicker = null;\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 { AltText } from \"./alt_text.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 = null;\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 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 /**\n * Fix the position of the editor in order to keep it inside its parent page.\n * @param {number} [rotation] - the rotation of the page.\n */\n fixAndSetPosition(rotation = this.rotation) {\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 (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 }\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.#altText?.toggle(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.#altText?.toggle(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 altTextFinish() {\n this.#altText?.finish();\n }\n\n /**\n * Add a toolbar for this editor.\n * @returns {Promise<EditorToolbar|null>}\n */\n async addEditToolbar() {\n if (this.#editToolbar || this.#isInEditMode) {\n return this.#editToolbar;\n }\n this.#editToolbar = new EditorToolbar(this);\n this.div.append(this.#editToolbar.render());\n if (this.#altText) {\n this.#editToolbar.addAltTextButton(await this.#altText.render());\n }\n\n return this.#editToolbar;\n }\n\n removeEditToolbar() {\n if (!this.#editToolbar) {\n return;\n }\n this.#editToolbar.remove();\n this.#editToolbar = null;\n\n // We destroy the alt text but we don't null it because we want to be able\n // to restore it in case the user undoes the deletion.\n this.#altText?.destroy();\n }\n\n getClientDimensions() {\n return this.div.getBoundingClientRect();\n }\n\n async addAltTextButton() {\n if (this.#altText) {\n return;\n }\n AltText.initialize(AnnotationEditor._l10nPromise);\n this.#altText = new AltText(this);\n await this.addEditToolbar();\n }\n\n get altTextData() {\n return this.#altText?.data;\n }\n\n /**\n * Set the alt text data.\n */\n set altTextData(data) {\n if (!this.#altText) {\n return;\n }\n this.#altText.data = data;\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 if (this._isDraggable) {\n this.#setUpDragSession(event);\n return;\n }\n\n this.#selectOnPointerEvent(event);\n }\n\n #selectOnPointerEvent(event) {\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 #setUpDragSession(event) {\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 this.#selectOnPointerEvent(event);\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 * @param {number} tx - x-translation in screen coordinates.\n * @param {number} ty - y-translation in screen coordinates.\n * @param {number} [rotation] - the rotation of the page.\n */\n getRect(tx, ty, rotation = this.rotation) {\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 (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 * Rotate the editor.\n * @param {number} angle\n */\n rotate(_angle) {}\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 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 get toolbarPosition() {\n return null;\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 if (!this.#editToolbar) {\n this.addEditToolbar().then(() => {\n if (this.div?.classList.contains(\"selectedEditor\")) {\n // The editor can have been unselected while we were waiting for the\n // edit toolbar to be created, hence we want to be sure that this\n // editor is still selected.\n this.#editToolbar?.show();\n }\n });\n return;\n }\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\n /**\n * When the user enables the editing mode some editors can change some of\n * their properties.\n */\n enableEditing() {}\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 static canCreateNewEmptyEditor() {\n return true;\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, event)();\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 #highlightColors = null;\n\n #idManager = new IdManager();\n\n #isEnabled = false;\n\n #isWaiting = false;\n\n #lastActiveElement = null;\n\n #mainHighlightColorPicker = 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 document.activeElement.tagName !== \"BUTTON\" &&\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 highlightColors\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.#highlightColors = highlightColors || null;\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 get highlightColors() {\n return shadow(\n this,\n \"highlightColors\",\n this.#highlightColors\n ? new Map(\n this.#highlightColors\n .split(\",\")\n .map(pair => pair.split(\"=\").map(x => x.trim()))\n )\n : null\n );\n }\n\n setMainHighlightColorPicker(colorPicker) {\n this.#mainHighlightColorPicker = colorPicker;\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 if (this.currentLayer.canCreateNewEmptyEditor()) {\n this.currentLayer.addNewEditor();\n }\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\n switch (type) {\n case AnnotationEditorParamsType.CREATE:\n this.currentLayer.addNewEditor();\n return;\n case AnnotationEditorParamsType.HIGHLIGHT_DEFAULT_COLOR:\n this.#mainHighlightColorPicker?.updateColor(value);\n break;\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 if (this.#mode !== AnnotationEditorType.NONE) {\n // If the mode is NONE, we want to really unselect the editor, hence we\n // mustn't return here.\n return;\n }\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 \"IP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAA\" +\n \"AAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUA\" +\n \"AQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgAB\" +\n \"AAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABY\" +\n \"AAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAA\" +\n \"AC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n \"AAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAA\" +\n \"AAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQAC\" +\n \"AQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3\" +\n \"Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTj\" +\n \"FQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==\"\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 { ColorPicker } from \"./display/editor/color_picker.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 ColorPicker,\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 HIGHLIGHT_COLOR: 31,\n HIGHLIGHT_DEFAULT_COLOR: 32,\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","imageRef","pageProxy","dataLen","imageData","fetch","num","gen","results","metadata","cleanupSuccessful","ensureObj","objId","settled","Symbol","iterator","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","ColorPicker","Outliner","HighlightEditor","boxes","colorPicker","focusOutlines","highlightDiv","highlightOutlines","lastPoint","outlineId","_defaultOpacity","highlightColors","next","createOutlines","addToDrawLayer","outliner","getOutlines","outlinerForOutline","direction","HIGHLIGHT_DEFAULT_COLOR","toolbarPosition","HIGHLIGHT_COLOR","drawLayer","addEditToolbar","toolbar","addColorPicker","addUndoableEditor","cleanDrawLayer","mustBeSelected","contains","select","rotateBbox","setDims","pointerover","pointerleave","unselect","serializeBoxes","sx","sy","serializeOutlines","outline","canCreateNewEmptyEditor","opacityToHex","InkEditor","baseHeight","baseWidth","boundCanvasPointermove","canvasPointermove","boundCanvasPointerleave","canvasPointerleave","boundCanvasPointerup","canvasPointerup","boundCanvasPointerdown","canvasPointerdown","canvasContextMenuTimeoutId","currentPath2D","hasSomethingToDraw","isCanvasInitialized","observer","realWidth","realHeight","requestFrameCallback","_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","stopDrawing","bezier","generateBezierPoints","xy","lastPoints","xMin","xMax","yMin","yMax","bezierPoints","control1","control2","updateTransform","setInForeground","addInkEditorIfNeeded","moveInDOM","button","addToAnnotationStorage","setInBackground","ResizeObserver","contentRect","observe","isResizable","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","_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","boundPointerUpAfterSelection","pointerUpAfterSelection","boundPointerdown","pointerdown","editorFocusTimeoutId","boundSelectionStart","editors","hadPointerDown","isCleaningUp","isDisabling","textLayer","_initialized","editorTypes","registerEditorTypes","addLayer","updateMode","getMode","disableTextSelection","togglePointerEvents","disableClick","enableTextSelection","enableClick","isCommitting","createAndAddNewEditor","enable","annotationElementIds","editables","isDeletedAnnotationElement","addOrRebuild","disable","hiddenAnnotationIds","setActiveEditor","currentActive","getActive","attach","removeDeletedAnnotationElement","detach","removePointerInTextLayer","addDeletedAnnotationElement","removeEditor","changeParent","deleteAnnotationElement","addEditor","moveEditorInDOM","once","needsToBeRebuilt","getNextId","getId","currentEditorType","createNewEditor","getCenterPoint","innerWidth","innerHeight","addNewEditor","setSelected","toggleSelected","isSelected","_event","selection","getSelection","rangeCount","getRangeAt","collapsed","commonAncestorContainer","layerX","layerY","bboxes","getClientRects","rotator","empty","unselectAll","findNewParent","findParent","removeLayer","getEditors","oldRotation","buttonSwatch","defaultColor","dropdown","dropdownWasFromKeyboard","isMainColorPicker","_hideDropdownFromKeyboard","_colorSelectFromKeyboard","_moveToNext","_moveToPrevious","_moveToBeginning","_moveToEnd","renderButton","openDropdown","swatch","renderMainDropdown","getDropdownRoot","paramType","role","colorSelect","stopPropagation","nextSibling","hideDropdown","focusVisible","child","AltText","altTextDecorative","altTextButton","altTextTooltip","altTextTooltipTimeout","altTextWasFromKeyBoard","l10nPromise","onClick","editAltText","capture","setState","finish","tooltip","DELAY_TO_SHOW_TOOLTIP","EditorToolbar","buttons","editToolbar","pointerDown","insetInlineEnd","addDeleteButton","focusIn","focusOut","addListenersToElement","divider","ColorManager","allResizerDivs","keepAspectRatio","resizersDiv","savedDimensions","boundFocusin","boundFocusout","focusout","focusedResizerName","hasBeenClicked","isResizerEnabledForKeyboard","moveInDOMTimeout","isDraggable","_zIndex","_borderLineWidth","_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","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","altTextFinish","removeEditToolbar","getClientDimensions","maxWidth","maxHeight","setUpDragSession","selectOnPointerEvent","pointerMoveCallback","dragSelectedEditors","endDragSession","_setParentAndPosition","getRectInCurrentCoords","_angle","makeResizable","boundResizerKeydown","resizerKeydown","boundResizerBlur","resizerBlur","resizerFocus","firstPosition","nextFirstPosition","setResizerTabIndex","stopImmediatePropagation","aspectRatio","verticalEdges","intervals","innerMargin","isLTR","NUMBER_OF_DIGITS","EPSILON","right","shiftedMinX","shiftedMinY","lastEdge","edge","sort","outlineVerticalEdges","breakEdge","edges","allEdges","edge1","edge2","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","mainHighlightColorPicker","selectedEditors","boundBlur","blur","boundFocus","boundCopy","copy","boundCut","cut","boundPaste","boundKeydown","boundOnEditingAction","onEditingAction","boundOnPageChanging","onPageChanging","boundOnScaleChanging","boundOnRotationChanging","onRotationChanging","previousStates","hasSelectedEditor","translation","translationTimeoutId","viewer","tagName","hasSomethingToControl","textInputChecker","_self","el","HTMLInputElement","selectAll","addNewEditorFromKeyboard","HTMLButtonElement","pdfDocument","_on","removeKeyboardManager","removeFocusManager","_off","pair","setMainHighlightColorPicker","focusMainContainer","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","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","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":""} diff --git a/shared/static/shared/vendor/pdf.js-4.0.379/pdf.worker.mjs b/shared/static/shared/vendor/pdf.js-4.0.379/pdf.worker.mjs new file mode 100644 index 0000000000000000000000000000000000000000..947695673eac4266ab05bf001d2fd6617e023340 --- /dev/null +++ b/shared/static/shared/vendor/pdf.js-4.0.379/pdf.worker.mjs @@ -0,0 +1,57171 @@ +/** + * @licstart The following is the entire license notice for the + * JavaScript code in this page + * + * Copyright 2023 Mozilla Foundation + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * @licend The above is the entire license notice for the + * JavaScript code in this page + */ + +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* webpack/runtime/define property getters */ +/******/ (() => { +/******/ // define getter functions for harmony exports +/******/ __webpack_require__.d = (exports, definition) => { +/******/ for(var key in definition) { +/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { +/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); +/******/ } +/******/ } +/******/ }; +/******/ })(); +/******/ +/******/ /* webpack/runtime/hasOwnProperty shorthand */ +/******/ (() => { +/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop)) +/******/ })(); +/******/ +/************************************************************************/ +var __webpack_exports__ = globalThis.pdfjsWorker = {}; + +// EXPORTS +__webpack_require__.d(__webpack_exports__, { + WorkerMessageHandler: () => (/* reexport */ WorkerMessageHandler) +}); + +;// CONCATENATED MODULE: ./src/shared/util.js +const isNodeJS = typeof process === "object" && process + "" === "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"); +const IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0]; +const FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0]; +const MAX_IMAGE_SIZE_TO_CACHE = 10e6; +const LINE_FACTOR = 1.35; +const LINE_DESCENT_FACTOR = 0.35; +const BASELINE_FACTOR = LINE_DESCENT_FACTOR / LINE_FACTOR; +const RenderingIntentFlag = { + ANY: 0x01, + DISPLAY: 0x02, + PRINT: 0x04, + SAVE: 0x08, + ANNOTATIONS_FORMS: 0x10, + ANNOTATIONS_STORAGE: 0x20, + ANNOTATIONS_DISABLE: 0x40, + OPLIST: 0x100 +}; +const AnnotationMode = { + DISABLE: 0, + ENABLE: 1, + ENABLE_FORMS: 2, + ENABLE_STORAGE: 3 +}; +const AnnotationEditorPrefix = "pdfjs_internal_editor_"; +const AnnotationEditorType = { + DISABLE: -1, + NONE: 0, + FREETEXT: 3, + HIGHLIGHT: 9, + STAMP: 13, + INK: 15 +}; +const AnnotationEditorParamsType = { + RESIZE: 1, + CREATE: 2, + FREETEXT_SIZE: 11, + FREETEXT_COLOR: 12, + FREETEXT_OPACITY: 13, + INK_COLOR: 21, + INK_THICKNESS: 22, + INK_OPACITY: 23, + HIGHLIGHT_COLOR: 31, + HIGHLIGHT_DEFAULT_COLOR: 32 +}; +const PermissionFlag = { + PRINT: 0x04, + MODIFY_CONTENTS: 0x08, + COPY: 0x10, + MODIFY_ANNOTATIONS: 0x20, + FILL_INTERACTIVE_FORMS: 0x100, + COPY_FOR_ACCESSIBILITY: 0x200, + ASSEMBLE: 0x400, + PRINT_HIGH_QUALITY: 0x800 +}; +const TextRenderingMode = { + FILL: 0, + STROKE: 1, + FILL_STROKE: 2, + INVISIBLE: 3, + FILL_ADD_TO_PATH: 4, + STROKE_ADD_TO_PATH: 5, + FILL_STROKE_ADD_TO_PATH: 6, + ADD_TO_PATH: 7, + FILL_STROKE_MASK: 3, + ADD_TO_PATH_FLAG: 4 +}; +const ImageKind = { + GRAYSCALE_1BPP: 1, + RGB_24BPP: 2, + RGBA_32BPP: 3 +}; +const AnnotationType = { + TEXT: 1, + LINK: 2, + FREETEXT: 3, + LINE: 4, + SQUARE: 5, + CIRCLE: 6, + POLYGON: 7, + POLYLINE: 8, + HIGHLIGHT: 9, + UNDERLINE: 10, + SQUIGGLY: 11, + STRIKEOUT: 12, + STAMP: 13, + CARET: 14, + INK: 15, + POPUP: 16, + FILEATTACHMENT: 17, + SOUND: 18, + MOVIE: 19, + WIDGET: 20, + SCREEN: 21, + PRINTERMARK: 22, + TRAPNET: 23, + WATERMARK: 24, + THREED: 25, + REDACT: 26 +}; +const AnnotationReplyType = { + GROUP: "Group", + REPLY: "R" +}; +const AnnotationFlag = { + INVISIBLE: 0x01, + HIDDEN: 0x02, + PRINT: 0x04, + NOZOOM: 0x08, + NOROTATE: 0x10, + NOVIEW: 0x20, + READONLY: 0x40, + LOCKED: 0x80, + TOGGLENOVIEW: 0x100, + LOCKEDCONTENTS: 0x200 +}; +const AnnotationFieldFlag = { + READONLY: 0x0000001, + REQUIRED: 0x0000002, + NOEXPORT: 0x0000004, + MULTILINE: 0x0001000, + PASSWORD: 0x0002000, + NOTOGGLETOOFF: 0x0004000, + RADIO: 0x0008000, + PUSHBUTTON: 0x0010000, + COMBO: 0x0020000, + EDIT: 0x0040000, + SORT: 0x0080000, + FILESELECT: 0x0100000, + MULTISELECT: 0x0200000, + DONOTSPELLCHECK: 0x0400000, + DONOTSCROLL: 0x0800000, + COMB: 0x1000000, + RICHTEXT: 0x2000000, + RADIOSINUNISON: 0x2000000, + COMMITONSELCHANGE: 0x4000000 +}; +const AnnotationBorderStyleType = { + SOLID: 1, + DASHED: 2, + BEVELED: 3, + INSET: 4, + UNDERLINE: 5 +}; +const AnnotationActionEventType = { + E: "Mouse Enter", + X: "Mouse Exit", + D: "Mouse Down", + U: "Mouse Up", + Fo: "Focus", + Bl: "Blur", + PO: "PageOpen", + PC: "PageClose", + PV: "PageVisible", + PI: "PageInvisible", + K: "Keystroke", + F: "Format", + V: "Validate", + C: "Calculate" +}; +const DocumentActionEventType = { + WC: "WillClose", + WS: "WillSave", + DS: "DidSave", + WP: "WillPrint", + DP: "DidPrint" +}; +const PageActionEventType = { + O: "PageOpen", + C: "PageClose" +}; +const VerbosityLevel = { + ERRORS: 0, + WARNINGS: 1, + INFOS: 5 +}; +const CMapCompressionType = { + NONE: 0, + BINARY: 1 +}; +const OPS = { + dependency: 1, + setLineWidth: 2, + setLineCap: 3, + setLineJoin: 4, + setMiterLimit: 5, + setDash: 6, + setRenderingIntent: 7, + setFlatness: 8, + setGState: 9, + save: 10, + restore: 11, + transform: 12, + moveTo: 13, + lineTo: 14, + curveTo: 15, + curveTo2: 16, + curveTo3: 17, + closePath: 18, + rectangle: 19, + stroke: 20, + closeStroke: 21, + fill: 22, + eoFill: 23, + fillStroke: 24, + eoFillStroke: 25, + closeFillStroke: 26, + closeEOFillStroke: 27, + endPath: 28, + clip: 29, + eoClip: 30, + beginText: 31, + endText: 32, + setCharSpacing: 33, + setWordSpacing: 34, + setHScale: 35, + setLeading: 36, + setFont: 37, + setTextRenderingMode: 38, + setTextRise: 39, + moveText: 40, + setLeadingMoveText: 41, + setTextMatrix: 42, + nextLine: 43, + showText: 44, + showSpacedText: 45, + nextLineShowText: 46, + nextLineSetSpacingShowText: 47, + setCharWidth: 48, + setCharWidthAndBounds: 49, + setStrokeColorSpace: 50, + setFillColorSpace: 51, + setStrokeColor: 52, + setStrokeColorN: 53, + setFillColor: 54, + setFillColorN: 55, + setStrokeGray: 56, + setFillGray: 57, + setStrokeRGBColor: 58, + setFillRGBColor: 59, + setStrokeCMYKColor: 60, + setFillCMYKColor: 61, + shadingFill: 62, + beginInlineImage: 63, + beginImageData: 64, + endInlineImage: 65, + paintXObject: 66, + markPoint: 67, + markPointProps: 68, + beginMarkedContent: 69, + beginMarkedContentProps: 70, + endMarkedContent: 71, + beginCompat: 72, + endCompat: 73, + paintFormXObjectBegin: 74, + paintFormXObjectEnd: 75, + beginGroup: 76, + endGroup: 77, + beginAnnotation: 80, + endAnnotation: 81, + paintImageMaskXObject: 83, + paintImageMaskXObjectGroup: 84, + paintImageXObject: 85, + paintInlineImageXObject: 86, + paintInlineImageXObjectGroup: 87, + paintImageXObjectRepeat: 88, + paintImageMaskXObjectRepeat: 89, + paintSolidColorImageMask: 90, + constructPath: 91 +}; +const PasswordResponses = { + NEED_PASSWORD: 1, + INCORRECT_PASSWORD: 2 +}; +let verbosity = VerbosityLevel.WARNINGS; +function setVerbosityLevel(level) { + if (Number.isInteger(level)) { + verbosity = level; + } +} +function getVerbosityLevel() { + return verbosity; +} +function info(msg) { + if (verbosity >= VerbosityLevel.INFOS) { + console.log(`Info: ${msg}`); + } +} +function warn(msg) { + if (verbosity >= VerbosityLevel.WARNINGS) { + console.log(`Warning: ${msg}`); + } +} +function unreachable(msg) { + throw new Error(msg); +} +function assert(cond, msg) { + if (!cond) { + unreachable(msg); + } +} +function _isValidProtocol(url) { + switch (url?.protocol) { + case "http:": + case "https:": + case "ftp:": + case "mailto:": + case "tel:": + return true; + default: + return false; + } +} +function createValidAbsoluteUrl(url, baseUrl = null, options = null) { + if (!url) { + return null; + } + try { + if (options && typeof url === "string") { + if (options.addDefaultProtocol && url.startsWith("www.")) { + const dots = url.match(/\./g); + if (dots?.length >= 2) { + url = `http://${url}`; + } + } + if (options.tryConvertEncoding) { + try { + url = stringToUTF8String(url); + } catch {} + } + } + const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url); + if (_isValidProtocol(absoluteUrl)) { + return absoluteUrl; + } + } catch {} + return null; +} +function shadow(obj, prop, value, nonSerializable = false) { + Object.defineProperty(obj, prop, { + value, + enumerable: !nonSerializable, + configurable: true, + writable: false + }); + return value; +} +const BaseException = function BaseExceptionClosure() { + function BaseException(message, name) { + if (this.constructor === BaseException) { + unreachable("Cannot initialize BaseException."); + } + this.message = message; + this.name = name; + } + BaseException.prototype = new Error(); + BaseException.constructor = BaseException; + return BaseException; +}(); +class PasswordException extends BaseException { + constructor(msg, code) { + super(msg, "PasswordException"); + this.code = code; + } +} +class UnknownErrorException extends BaseException { + constructor(msg, details) { + super(msg, "UnknownErrorException"); + this.details = details; + } +} +class InvalidPDFException extends BaseException { + constructor(msg) { + super(msg, "InvalidPDFException"); + } +} +class MissingPDFException extends BaseException { + constructor(msg) { + super(msg, "MissingPDFException"); + } +} +class UnexpectedResponseException extends BaseException { + constructor(msg, status) { + super(msg, "UnexpectedResponseException"); + this.status = status; + } +} +class FormatError extends BaseException { + constructor(msg) { + super(msg, "FormatError"); + } +} +class AbortException extends BaseException { + constructor(msg) { + super(msg, "AbortException"); + } +} +function bytesToString(bytes) { + if (typeof bytes !== "object" || bytes?.length === undefined) { + unreachable("Invalid argument for bytesToString"); + } + const length = bytes.length; + const MAX_ARGUMENT_COUNT = 8192; + if (length < MAX_ARGUMENT_COUNT) { + return String.fromCharCode.apply(null, bytes); + } + const strBuf = []; + for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) { + const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length); + const chunk = bytes.subarray(i, chunkEnd); + strBuf.push(String.fromCharCode.apply(null, chunk)); + } + return strBuf.join(""); +} +function stringToBytes(str) { + if (typeof str !== "string") { + unreachable("Invalid argument for stringToBytes"); + } + const length = str.length; + const bytes = new Uint8Array(length); + for (let i = 0; i < length; ++i) { + bytes[i] = str.charCodeAt(i) & 0xff; + } + return bytes; +} +function string32(value) { + return String.fromCharCode(value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff); +} +function objectSize(obj) { + return Object.keys(obj).length; +} +function objectFromMap(map) { + const obj = Object.create(null); + for (const [key, value] of map) { + obj[key] = value; + } + return obj; +} +function isLittleEndian() { + const buffer8 = new Uint8Array(4); + buffer8[0] = 1; + const view32 = new Uint32Array(buffer8.buffer, 0, 1); + return view32[0] === 1; +} +function isEvalSupported() { + try { + new Function(""); + return true; + } catch { + return false; + } +} +class FeatureTest { + static get isLittleEndian() { + return shadow(this, "isLittleEndian", isLittleEndian()); + } + static get isEvalSupported() { + return shadow(this, "isEvalSupported", isEvalSupported()); + } + static get isOffscreenCanvasSupported() { + return shadow(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas !== "undefined"); + } + static get platform() { + if (typeof navigator !== "undefined" && typeof navigator?.platform === "string") { + return shadow(this, "platform", { + isMac: navigator.platform.includes("Mac") + }); + } + return shadow(this, "platform", { + isMac: false + }); + } + static get isCSSRoundSupported() { + return shadow(this, "isCSSRoundSupported", globalThis.CSS?.supports?.("width: round(1.5px, 1px)")); + } +} +const hexNumbers = [...Array(256).keys()].map(n => n.toString(16).padStart(2, "0")); +class Util { + static makeHexColor(r, g, b) { + return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`; + } + static scaleMinMax(transform, minMax) { + let temp; + if (transform[0]) { + if (transform[0] < 0) { + temp = minMax[0]; + minMax[0] = minMax[1]; + minMax[1] = temp; + } + minMax[0] *= transform[0]; + minMax[1] *= transform[0]; + if (transform[3] < 0) { + temp = minMax[2]; + minMax[2] = minMax[3]; + minMax[3] = temp; + } + minMax[2] *= transform[3]; + minMax[3] *= transform[3]; + } else { + temp = minMax[0]; + minMax[0] = minMax[2]; + minMax[2] = temp; + temp = minMax[1]; + minMax[1] = minMax[3]; + minMax[3] = temp; + if (transform[1] < 0) { + temp = minMax[2]; + minMax[2] = minMax[3]; + minMax[3] = temp; + } + minMax[2] *= transform[1]; + minMax[3] *= transform[1]; + if (transform[2] < 0) { + temp = minMax[0]; + minMax[0] = minMax[1]; + minMax[1] = temp; + } + minMax[0] *= transform[2]; + minMax[1] *= transform[2]; + } + minMax[0] += transform[4]; + minMax[1] += transform[4]; + minMax[2] += transform[5]; + minMax[3] += transform[5]; + } + static transform(m1, m2) { + return [m1[0] * m2[0] + m1[2] * m2[1], m1[1] * m2[0] + m1[3] * m2[1], m1[0] * m2[2] + m1[2] * m2[3], m1[1] * m2[2] + m1[3] * m2[3], m1[0] * m2[4] + m1[2] * m2[5] + m1[4], m1[1] * m2[4] + m1[3] * m2[5] + m1[5]]; + } + static applyTransform(p, m) { + const xt = p[0] * m[0] + p[1] * m[2] + m[4]; + const yt = p[0] * m[1] + p[1] * m[3] + m[5]; + return [xt, yt]; + } + static applyInverseTransform(p, m) { + const d = m[0] * m[3] - m[1] * m[2]; + const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d; + const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d; + return [xt, yt]; + } + static getAxialAlignedBoundingBox(r, m) { + const p1 = this.applyTransform(r, m); + const p2 = this.applyTransform(r.slice(2, 4), m); + const p3 = this.applyTransform([r[0], r[3]], m); + const p4 = this.applyTransform([r[2], r[1]], m); + return [Math.min(p1[0], p2[0], p3[0], p4[0]), Math.min(p1[1], p2[1], p3[1], p4[1]), Math.max(p1[0], p2[0], p3[0], p4[0]), Math.max(p1[1], p2[1], p3[1], p4[1])]; + } + static inverseTransform(m) { + const d = m[0] * m[3] - m[1] * m[2]; + return [m[3] / d, -m[1] / d, -m[2] / d, m[0] / d, (m[2] * m[5] - m[4] * m[3]) / d, (m[4] * m[1] - m[5] * m[0]) / d]; + } + static singularValueDecompose2dScale(m) { + const transpose = [m[0], m[2], m[1], m[3]]; + const a = m[0] * transpose[0] + m[1] * transpose[2]; + const b = m[0] * transpose[1] + m[1] * transpose[3]; + const c = m[2] * transpose[0] + m[3] * transpose[2]; + const d = m[2] * transpose[1] + m[3] * transpose[3]; + const first = (a + d) / 2; + const second = Math.sqrt((a + d) ** 2 - 4 * (a * d - c * b)) / 2; + const sx = first + second || 1; + const sy = first - second || 1; + return [Math.sqrt(sx), Math.sqrt(sy)]; + } + static normalizeRect(rect) { + const r = rect.slice(0); + if (rect[0] > rect[2]) { + r[0] = rect[2]; + r[2] = rect[0]; + } + if (rect[1] > rect[3]) { + r[1] = rect[3]; + r[3] = rect[1]; + } + return r; + } + static intersect(rect1, rect2) { + const xLow = Math.max(Math.min(rect1[0], rect1[2]), Math.min(rect2[0], rect2[2])); + const xHigh = Math.min(Math.max(rect1[0], rect1[2]), Math.max(rect2[0], rect2[2])); + if (xLow > xHigh) { + return null; + } + const yLow = Math.max(Math.min(rect1[1], rect1[3]), Math.min(rect2[1], rect2[3])); + const yHigh = Math.min(Math.max(rect1[1], rect1[3]), Math.max(rect2[1], rect2[3])); + if (yLow > yHigh) { + return null; + } + return [xLow, yLow, xHigh, yHigh]; + } + static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3) { + const tvalues = [], + bounds = [[], []]; + let a, b, c, t, t1, t2, b2ac, sqrtb2ac; + for (let i = 0; i < 2; ++i) { + if (i === 0) { + b = 6 * x0 - 12 * x1 + 6 * x2; + a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3; + c = 3 * x1 - 3 * x0; + } else { + b = 6 * y0 - 12 * y1 + 6 * y2; + a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3; + c = 3 * y1 - 3 * y0; + } + if (Math.abs(a) < 1e-12) { + if (Math.abs(b) < 1e-12) { + continue; + } + t = -c / b; + if (0 < t && t < 1) { + tvalues.push(t); + } + continue; + } + b2ac = b * b - 4 * c * a; + sqrtb2ac = Math.sqrt(b2ac); + if (b2ac < 0) { + continue; + } + t1 = (-b + sqrtb2ac) / (2 * a); + if (0 < t1 && t1 < 1) { + tvalues.push(t1); + } + t2 = (-b - sqrtb2ac) / (2 * a); + if (0 < t2 && t2 < 1) { + tvalues.push(t2); + } + } + let j = tvalues.length, + mt; + const jlen = j; + while (j--) { + t = tvalues[j]; + mt = 1 - t; + bounds[0][j] = mt * mt * mt * x0 + 3 * mt * mt * t * x1 + 3 * mt * t * t * x2 + t * t * t * x3; + bounds[1][j] = mt * mt * mt * y0 + 3 * mt * mt * t * y1 + 3 * mt * t * t * y2 + t * t * t * y3; + } + bounds[0][jlen] = x0; + bounds[1][jlen] = y0; + bounds[0][jlen + 1] = x3; + bounds[1][jlen + 1] = y3; + bounds[0].length = bounds[1].length = jlen + 2; + return [Math.min(...bounds[0]), Math.min(...bounds[1]), Math.max(...bounds[0]), Math.max(...bounds[1])]; + } +} +const PDFStringTranslateTable = [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, 0x2c7, 0x2c6, 0x2d9, 0x2dd, 0x2db, 0x2da, 0x2dc, 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, 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, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192, 0x2044, 0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018, 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x141, 0x152, 0x160, 0x178, 0x17d, 0x131, 0x142, 0x153, 0x161, 0x17e, 0, 0x20ac]; +function stringToPDFString(str) { + if (str[0] >= "\xEF") { + let encoding; + if (str[0] === "\xFE" && str[1] === "\xFF") { + encoding = "utf-16be"; + if (str.length % 2 === 1) { + str = str.slice(0, -1); + } + } else if (str[0] === "\xFF" && str[1] === "\xFE") { + encoding = "utf-16le"; + if (str.length % 2 === 1) { + str = str.slice(0, -1); + } + } else if (str[0] === "\xEF" && str[1] === "\xBB" && str[2] === "\xBF") { + encoding = "utf-8"; + } + if (encoding) { + try { + const decoder = new TextDecoder(encoding, { + fatal: true + }); + const buffer = stringToBytes(str); + const decoded = decoder.decode(buffer); + if (!decoded.includes("\x1b")) { + return decoded; + } + return decoded.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g, ""); + } catch (ex) { + warn(`stringToPDFString: "${ex}".`); + } + } + } + const strBuf = []; + for (let i = 0, ii = str.length; i < ii; i++) { + const charCode = str.charCodeAt(i); + if (charCode === 0x1b) { + while (++i < ii && str.charCodeAt(i) !== 0x1b) {} + continue; + } + const code = PDFStringTranslateTable[charCode]; + strBuf.push(code ? String.fromCharCode(code) : str.charAt(i)); + } + return strBuf.join(""); +} +function stringToUTF8String(str) { + return decodeURIComponent(escape(str)); +} +function utf8StringToString(str) { + return unescape(encodeURIComponent(str)); +} +function isArrayBuffer(v) { + return typeof v === "object" && v?.byteLength !== undefined; +} +function isArrayEqual(arr1, arr2) { + if (arr1.length !== arr2.length) { + return false; + } + for (let i = 0, ii = arr1.length; i < ii; i++) { + if (arr1[i] !== arr2[i]) { + return false; + } + } + return true; +} +function getModificationDate(date = new Date()) { + const buffer = [date.getUTCFullYear().toString(), (date.getUTCMonth() + 1).toString().padStart(2, "0"), date.getUTCDate().toString().padStart(2, "0"), date.getUTCHours().toString().padStart(2, "0"), date.getUTCMinutes().toString().padStart(2, "0"), date.getUTCSeconds().toString().padStart(2, "0")]; + return buffer.join(""); +} +class PromiseCapability { + #settled = false; + constructor() { + this.promise = new Promise((resolve, reject) => { + this.resolve = data => { + this.#settled = true; + resolve(data); + }; + this.reject = reason => { + this.#settled = true; + reject(reason); + }; + }); + } + get settled() { + return this.#settled; + } +} +let NormalizeRegex = null; +let NormalizationMap = null; +function normalizeUnicode(str) { + if (!NormalizeRegex) { + NormalizeRegex = /([\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; + NormalizationMap = new Map([["ſt", "ſt"]]); + } + return str.replaceAll(NormalizeRegex, (_, p1, p2) => { + return p1 ? p1.normalize("NFKC") : NormalizationMap.get(p2); + }); +} +function getUuid() { + if (typeof crypto !== "undefined" && typeof crypto?.randomUUID === "function") { + return crypto.randomUUID(); + } + const buf = new Uint8Array(32); + if (typeof crypto !== "undefined" && typeof crypto?.getRandomValues === "function") { + crypto.getRandomValues(buf); + } else { + for (let i = 0; i < 32; i++) { + buf[i] = Math.floor(Math.random() * 255); + } + } + return bytesToString(buf); +} +const AnnotationPrefix = "pdfjs_internal_id_"; + +;// CONCATENATED MODULE: ./src/core/primitives.js + +const CIRCULAR_REF = Symbol("CIRCULAR_REF"); +const EOF = Symbol("EOF"); +let CmdCache = Object.create(null); +let NameCache = Object.create(null); +let RefCache = Object.create(null); +function clearPrimitiveCaches() { + CmdCache = Object.create(null); + NameCache = Object.create(null); + RefCache = Object.create(null); +} +class Name { + constructor(name) { + this.name = name; + } + static get(name) { + return NameCache[name] ||= new Name(name); + } +} +class Cmd { + constructor(cmd) { + this.cmd = cmd; + } + static get(cmd) { + return CmdCache[cmd] ||= new Cmd(cmd); + } +} +const nonSerializable = function nonSerializableClosure() { + return nonSerializable; +}; +class Dict { + constructor(xref = null) { + this._map = Object.create(null); + this.xref = xref; + this.objId = null; + this.suppressEncryption = false; + this.__nonSerializable__ = nonSerializable; + } + assignXref(newXref) { + this.xref = newXref; + } + get size() { + return Object.keys(this._map).length; + } + get(key1, key2, key3) { + let value = this._map[key1]; + if (value === undefined && key2 !== undefined) { + value = this._map[key2]; + if (value === undefined && key3 !== undefined) { + value = this._map[key3]; + } + } + if (value instanceof Ref && this.xref) { + return this.xref.fetch(value, this.suppressEncryption); + } + return value; + } + async getAsync(key1, key2, key3) { + let value = this._map[key1]; + if (value === undefined && key2 !== undefined) { + value = this._map[key2]; + if (value === undefined && key3 !== undefined) { + value = this._map[key3]; + } + } + if (value instanceof Ref && this.xref) { + return this.xref.fetchAsync(value, this.suppressEncryption); + } + return value; + } + getArray(key1, key2, key3) { + let value = this._map[key1]; + if (value === undefined && key2 !== undefined) { + value = this._map[key2]; + if (value === undefined && key3 !== undefined) { + value = this._map[key3]; + } + } + if (value instanceof Ref && this.xref) { + value = this.xref.fetch(value, this.suppressEncryption); + } + if (Array.isArray(value)) { + value = value.slice(); + for (let i = 0, ii = value.length; i < ii; i++) { + if (value[i] instanceof Ref && this.xref) { + value[i] = this.xref.fetch(value[i], this.suppressEncryption); + } + } + } + return value; + } + getRaw(key) { + return this._map[key]; + } + getKeys() { + return Object.keys(this._map); + } + getRawValues() { + return Object.values(this._map); + } + set(key, value) { + this._map[key] = value; + } + has(key) { + return this._map[key] !== undefined; + } + forEach(callback) { + for (const key in this._map) { + callback(key, this.get(key)); + } + } + static get empty() { + const emptyDict = new Dict(null); + emptyDict.set = (key, value) => { + unreachable("Should not call `set` on the empty dictionary."); + }; + return shadow(this, "empty", emptyDict); + } + static merge({ + xref, + dictArray, + mergeSubDicts = false + }) { + const mergedDict = new Dict(xref), + properties = new Map(); + for (const dict of dictArray) { + if (!(dict instanceof Dict)) { + continue; + } + for (const [key, value] of Object.entries(dict._map)) { + let property = properties.get(key); + if (property === undefined) { + property = []; + properties.set(key, property); + } else if (!mergeSubDicts || !(value instanceof Dict)) { + continue; + } + property.push(value); + } + } + for (const [name, values] of properties) { + if (values.length === 1 || !(values[0] instanceof Dict)) { + mergedDict._map[name] = values[0]; + continue; + } + const subDict = new Dict(xref); + for (const dict of values) { + for (const [key, value] of Object.entries(dict._map)) { + if (subDict._map[key] === undefined) { + subDict._map[key] = value; + } + } + } + if (subDict.size > 0) { + mergedDict._map[name] = subDict; + } + } + properties.clear(); + return mergedDict.size > 0 ? mergedDict : Dict.empty; + } + clone() { + const dict = new Dict(this.xref); + for (const key of this.getKeys()) { + dict.set(key, this.getRaw(key)); + } + return dict; + } +} +class Ref { + constructor(num, gen) { + this.num = num; + this.gen = gen; + } + toString() { + if (this.gen === 0) { + return `${this.num}R`; + } + return `${this.num}R${this.gen}`; + } + static fromString(str) { + const ref = RefCache[str]; + if (ref) { + return ref; + } + const m = /^(\d+)R(\d*)$/.exec(str); + if (!m || m[1] === "0") { + return null; + } + return RefCache[str] = new Ref(parseInt(m[1]), !m[2] ? 0 : parseInt(m[2])); + } + static get(num, gen) { + const key = gen === 0 ? `${num}R` : `${num}R${gen}`; + return RefCache[key] ||= new Ref(num, gen); + } +} +class RefSet { + constructor(parent = null) { + this._set = new Set(parent?._set); + } + has(ref) { + return this._set.has(ref.toString()); + } + put(ref) { + this._set.add(ref.toString()); + } + remove(ref) { + this._set.delete(ref.toString()); + } + [Symbol.iterator]() { + return this._set.values(); + } + clear() { + this._set.clear(); + } +} +class RefSetCache { + constructor() { + this._map = new Map(); + } + get size() { + return this._map.size; + } + get(ref) { + return this._map.get(ref.toString()); + } + has(ref) { + return this._map.has(ref.toString()); + } + put(ref, obj) { + this._map.set(ref.toString(), obj); + } + putAlias(ref, aliasRef) { + this._map.set(ref.toString(), this.get(aliasRef)); + } + [Symbol.iterator]() { + return this._map.values(); + } + clear() { + this._map.clear(); + } +} +function isName(v, name) { + return v instanceof Name && (name === undefined || v.name === name); +} +function isCmd(v, cmd) { + return v instanceof Cmd && (cmd === undefined || v.cmd === cmd); +} +function isDict(v, type) { + return v instanceof Dict && (type === undefined || isName(v.get("Type"), type)); +} +function isRefsEqual(v1, v2) { + return v1.num === v2.num && v1.gen === v2.gen; +} + +;// CONCATENATED MODULE: ./src/core/base_stream.js + +class BaseStream { + constructor() { + if (this.constructor === BaseStream) { + unreachable("Cannot initialize BaseStream."); + } + } + get length() { + unreachable("Abstract getter `length` accessed"); + } + get isEmpty() { + unreachable("Abstract getter `isEmpty` accessed"); + } + get isDataLoaded() { + return shadow(this, "isDataLoaded", true); + } + getByte() { + unreachable("Abstract method `getByte` called"); + } + getBytes(length) { + unreachable("Abstract method `getBytes` called"); + } + peekByte() { + const peekedByte = this.getByte(); + if (peekedByte !== -1) { + this.pos--; + } + return peekedByte; + } + peekBytes(length) { + const bytes = this.getBytes(length); + this.pos -= bytes.length; + return bytes; + } + getUint16() { + const b0 = this.getByte(); + const b1 = this.getByte(); + if (b0 === -1 || b1 === -1) { + return -1; + } + return (b0 << 8) + b1; + } + getInt32() { + const b0 = this.getByte(); + const b1 = this.getByte(); + const b2 = this.getByte(); + const b3 = this.getByte(); + return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; + } + getByteRange(begin, end) { + unreachable("Abstract method `getByteRange` called"); + } + getString(length) { + return bytesToString(this.getBytes(length)); + } + skip(n) { + this.pos += n || 1; + } + reset() { + unreachable("Abstract method `reset` called"); + } + moveStart() { + unreachable("Abstract method `moveStart` called"); + } + makeSubStream(start, length, dict = null) { + unreachable("Abstract method `makeSubStream` called"); + } + getBaseStreams() { + return null; + } +} + +;// CONCATENATED MODULE: ./src/core/core_utils.js + + + +const PDF_VERSION_REGEXP = /^[1-9]\.\d$/; +function getLookupTableFactory(initializer) { + let lookup; + return function () { + if (initializer) { + lookup = Object.create(null); + initializer(lookup); + initializer = null; + } + return lookup; + }; +} +class MissingDataException extends BaseException { + constructor(begin, end) { + super(`Missing data [${begin}, ${end})`, "MissingDataException"); + this.begin = begin; + this.end = end; + } +} +class ParserEOFException extends BaseException { + constructor(msg) { + super(msg, "ParserEOFException"); + } +} +class XRefEntryException extends BaseException { + constructor(msg) { + super(msg, "XRefEntryException"); + } +} +class XRefParseException extends BaseException { + constructor(msg) { + super(msg, "XRefParseException"); + } +} +function arrayBuffersToBytes(arr) { + const length = arr.length; + if (length === 0) { + return new Uint8Array(0); + } + if (length === 1) { + return new Uint8Array(arr[0]); + } + let dataLength = 0; + for (let i = 0; i < length; i++) { + dataLength += arr[i].byteLength; + } + const data = new Uint8Array(dataLength); + let pos = 0; + for (let i = 0; i < length; i++) { + const item = new Uint8Array(arr[i]); + data.set(item, pos); + pos += item.byteLength; + } + return data; +} +function getInheritableProperty({ + dict, + key, + getArray = false, + stopWhenFound = true +}) { + let values; + const visited = new RefSet(); + while (dict instanceof Dict && !(dict.objId && visited.has(dict.objId))) { + if (dict.objId) { + visited.put(dict.objId); + } + const value = getArray ? dict.getArray(key) : dict.get(key); + if (value !== undefined) { + if (stopWhenFound) { + return value; + } + (values ||= []).push(value); + } + dict = dict.get("Parent"); + } + return values; +} +const ROMAN_NUMBER_MAP = ["", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM", "", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC", "", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"]; +function toRomanNumerals(number, lowerCase = false) { + assert(Number.isInteger(number) && number > 0, "The number should be a positive integer."); + const romanBuf = []; + let pos; + while (number >= 1000) { + number -= 1000; + romanBuf.push("M"); + } + pos = number / 100 | 0; + number %= 100; + romanBuf.push(ROMAN_NUMBER_MAP[pos]); + pos = number / 10 | 0; + number %= 10; + romanBuf.push(ROMAN_NUMBER_MAP[10 + pos]); + romanBuf.push(ROMAN_NUMBER_MAP[20 + number]); + const romanStr = romanBuf.join(""); + return lowerCase ? romanStr.toLowerCase() : romanStr; +} +function log2(x) { + if (x <= 0) { + return 0; + } + return Math.ceil(Math.log2(x)); +} +function readInt8(data, offset) { + return data[offset] << 24 >> 24; +} +function readUint16(data, offset) { + return data[offset] << 8 | data[offset + 1]; +} +function readUint32(data, offset) { + return (data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]) >>> 0; +} +function isWhiteSpace(ch) { + return ch === 0x20 || ch === 0x09 || ch === 0x0d || ch === 0x0a; +} +function parseXFAPath(path) { + const positionPattern = /(.+)\[(\d+)\]$/; + return path.split(".").map(component => { + const m = component.match(positionPattern); + if (m) { + return { + name: m[1], + pos: parseInt(m[2], 10) + }; + } + return { + name: component, + pos: 0 + }; + }); +} +function escapePDFName(str) { + const buffer = []; + let start = 0; + for (let i = 0, ii = str.length; i < ii; i++) { + const char = str.charCodeAt(i); + if (char < 0x21 || char > 0x7e || char === 0x23 || char === 0x28 || char === 0x29 || char === 0x3c || char === 0x3e || char === 0x5b || char === 0x5d || char === 0x7b || char === 0x7d || char === 0x2f || char === 0x25) { + if (start < i) { + buffer.push(str.substring(start, i)); + } + buffer.push(`#${char.toString(16)}`); + start = i + 1; + } + } + if (buffer.length === 0) { + return str; + } + if (start < str.length) { + buffer.push(str.substring(start, str.length)); + } + return buffer.join(""); +} +function escapeString(str) { + return str.replaceAll(/([()\\\n\r])/g, match => { + if (match === "\n") { + return "\\n"; + } else if (match === "\r") { + return "\\r"; + } + return `\\${match}`; + }); +} +function _collectJS(entry, xref, list, parents) { + if (!entry) { + return; + } + let parent = null; + if (entry instanceof Ref) { + if (parents.has(entry)) { + return; + } + parent = entry; + parents.put(parent); + entry = xref.fetch(entry); + } + if (Array.isArray(entry)) { + for (const element of entry) { + _collectJS(element, xref, list, parents); + } + } else if (entry instanceof Dict) { + if (isName(entry.get("S"), "JavaScript")) { + const js = entry.get("JS"); + let code; + if (js instanceof BaseStream) { + code = js.getString(); + } else if (typeof js === "string") { + code = js; + } + code &&= stringToPDFString(code).replaceAll("\x00", ""); + if (code) { + list.push(code); + } + } + _collectJS(entry.getRaw("Next"), xref, list, parents); + } + if (parent) { + parents.remove(parent); + } +} +function collectActions(xref, dict, eventType) { + const actions = Object.create(null); + const additionalActionsDicts = getInheritableProperty({ + dict, + key: "AA", + stopWhenFound: false + }); + if (additionalActionsDicts) { + for (let i = additionalActionsDicts.length - 1; i >= 0; i--) { + const additionalActions = additionalActionsDicts[i]; + if (!(additionalActions instanceof Dict)) { + continue; + } + for (const key of additionalActions.getKeys()) { + const action = eventType[key]; + if (!action) { + continue; + } + const actionDict = additionalActions.getRaw(key); + const parents = new RefSet(); + const list = []; + _collectJS(actionDict, xref, list, parents); + if (list.length > 0) { + actions[action] = list; + } + } + } + } + if (dict.has("A")) { + const actionDict = dict.get("A"); + const parents = new RefSet(); + const list = []; + _collectJS(actionDict, xref, list, parents); + if (list.length > 0) { + actions.Action = list; + } + } + return objectSize(actions) > 0 ? actions : null; +} +const XMLEntities = { + 0x3c: "<", + 0x3e: ">", + 0x26: "&", + 0x22: """, + 0x27: "'" +}; +function encodeToXmlString(str) { + const buffer = []; + let start = 0; + for (let i = 0, ii = str.length; i < ii; i++) { + const char = str.codePointAt(i); + if (0x20 <= char && char <= 0x7e) { + const entity = XMLEntities[char]; + if (entity) { + if (start < i) { + buffer.push(str.substring(start, i)); + } + buffer.push(entity); + start = i + 1; + } + } else { + if (start < i) { + buffer.push(str.substring(start, i)); + } + buffer.push(`&#x${char.toString(16).toUpperCase()};`); + if (char > 0xd7ff && (char < 0xe000 || char > 0xfffd)) { + i++; + } + start = i + 1; + } + } + if (buffer.length === 0) { + return str; + } + if (start < str.length) { + buffer.push(str.substring(start, str.length)); + } + return buffer.join(""); +} +function validateFontName(fontFamily, mustWarn = false) { + const m = /^("|').*("|')$/.exec(fontFamily); + if (m && m[1] === m[2]) { + const re = new RegExp(`[^\\\\]${m[1]}`); + if (re.test(fontFamily.slice(1, -1))) { + if (mustWarn) { + warn(`FontFamily contains unescaped ${m[1]}: ${fontFamily}.`); + } + return false; + } + } else { + for (const ident of fontFamily.split(/[ \t]+/)) { + if (/^(\d|(-(\d|-)))/.test(ident) || !/^[\w-\\]+$/.test(ident)) { + if (mustWarn) { + warn(`FontFamily contains invalid <custom-ident>: ${fontFamily}.`); + } + return false; + } + } + } + return true; +} +function validateCSSFont(cssFontInfo) { + const DEFAULT_CSS_FONT_OBLIQUE = "14"; + const DEFAULT_CSS_FONT_WEIGHT = "400"; + const CSS_FONT_WEIGHT_VALUES = new Set(["100", "200", "300", "400", "500", "600", "700", "800", "900", "1000", "normal", "bold", "bolder", "lighter"]); + const { + fontFamily, + fontWeight, + italicAngle + } = cssFontInfo; + if (!validateFontName(fontFamily, true)) { + return false; + } + const weight = fontWeight ? fontWeight.toString() : ""; + cssFontInfo.fontWeight = CSS_FONT_WEIGHT_VALUES.has(weight) ? weight : DEFAULT_CSS_FONT_WEIGHT; + const angle = parseFloat(italicAngle); + cssFontInfo.italicAngle = isNaN(angle) || angle < -90 || angle > 90 ? DEFAULT_CSS_FONT_OBLIQUE : italicAngle.toString(); + return true; +} +function recoverJsURL(str) { + const URL_OPEN_METHODS = ["app.launchURL", "window.open", "xfa.host.gotoURL"]; + const regex = new RegExp("^\\s*(" + URL_OPEN_METHODS.join("|").replaceAll(".", "\\.") + ")\\((?:'|\")([^'\"]*)(?:'|\")(?:,\\s*(\\w+)\\)|\\))", "i"); + const jsUrl = regex.exec(str); + if (jsUrl?.[2]) { + const url = jsUrl[2]; + let newWindow = false; + if (jsUrl[3] === "true" && jsUrl[1] === "app.launchURL") { + newWindow = true; + } + return { + url, + newWindow + }; + } + return null; +} +function numberToString(value) { + if (Number.isInteger(value)) { + return value.toString(); + } + const roundedValue = Math.round(value * 100); + if (roundedValue % 100 === 0) { + return (roundedValue / 100).toString(); + } + if (roundedValue % 10 === 0) { + return value.toFixed(1); + } + return value.toFixed(2); +} +function getNewAnnotationsMap(annotationStorage) { + if (!annotationStorage) { + return null; + } + const newAnnotationsByPage = new Map(); + for (const [key, value] of annotationStorage) { + if (!key.startsWith(AnnotationEditorPrefix)) { + continue; + } + let annotations = newAnnotationsByPage.get(value.pageIndex); + if (!annotations) { + annotations = []; + newAnnotationsByPage.set(value.pageIndex, annotations); + } + annotations.push(value); + } + return newAnnotationsByPage.size > 0 ? newAnnotationsByPage : null; +} +function isAscii(str) { + return /^[\x00-\x7F]*$/.test(str); +} +function stringToUTF16HexString(str) { + const buf = []; + for (let i = 0, ii = str.length; i < ii; i++) { + const char = str.charCodeAt(i); + buf.push((char >> 8 & 0xff).toString(16).padStart(2, "0"), (char & 0xff).toString(16).padStart(2, "0")); + } + return buf.join(""); +} +function stringToUTF16String(str, bigEndian = false) { + const buf = []; + if (bigEndian) { + buf.push("\xFE\xFF"); + } + for (let i = 0, ii = str.length; i < ii; i++) { + const char = str.charCodeAt(i); + buf.push(String.fromCharCode(char >> 8 & 0xff), String.fromCharCode(char & 0xff)); + } + return buf.join(""); +} +function getRotationMatrix(rotation, width, height) { + switch (rotation) { + case 90: + return [0, 1, -1, 0, width, 0]; + case 180: + return [-1, 0, 0, -1, width, height]; + case 270: + return [0, -1, 1, 0, 0, height]; + default: + throw new Error("Invalid rotation"); + } +} + +;// CONCATENATED MODULE: ./src/core/stream.js + + +class Stream extends BaseStream { + constructor(arrayBuffer, start, length, dict) { + super(); + this.bytes = arrayBuffer instanceof Uint8Array ? arrayBuffer : new Uint8Array(arrayBuffer); + this.start = start || 0; + this.pos = this.start; + this.end = start + length || this.bytes.length; + this.dict = dict; + } + get length() { + return this.end - this.start; + } + get isEmpty() { + return this.length === 0; + } + getByte() { + if (this.pos >= this.end) { + return -1; + } + return this.bytes[this.pos++]; + } + getBytes(length) { + const bytes = this.bytes; + const pos = this.pos; + const strEnd = this.end; + if (!length) { + return bytes.subarray(pos, strEnd); + } + let end = pos + length; + if (end > strEnd) { + end = strEnd; + } + this.pos = end; + return bytes.subarray(pos, end); + } + getByteRange(begin, end) { + if (begin < 0) { + begin = 0; + } + if (end > this.end) { + end = this.end; + } + return this.bytes.subarray(begin, end); + } + reset() { + this.pos = this.start; + } + moveStart() { + this.start = this.pos; + } + makeSubStream(start, length, dict = null) { + return new Stream(this.bytes.buffer, start, length, dict); + } +} +class StringStream extends Stream { + constructor(str) { + super(stringToBytes(str)); + } +} +class NullStream extends Stream { + constructor() { + super(new Uint8Array(0)); + } +} + +;// CONCATENATED MODULE: ./src/core/chunked_stream.js + + + +class ChunkedStream extends Stream { + constructor(length, chunkSize, manager) { + super(new Uint8Array(length), 0, length, null); + this.chunkSize = chunkSize; + this._loadedChunks = new Set(); + this.numChunks = Math.ceil(length / chunkSize); + this.manager = manager; + this.progressiveDataLength = 0; + this.lastSuccessfulEnsureByteChunk = -1; + } + getMissingChunks() { + const chunks = []; + for (let chunk = 0, n = this.numChunks; chunk < n; ++chunk) { + if (!this._loadedChunks.has(chunk)) { + chunks.push(chunk); + } + } + return chunks; + } + get numChunksLoaded() { + return this._loadedChunks.size; + } + get isDataLoaded() { + return this.numChunksLoaded === this.numChunks; + } + onReceiveData(begin, chunk) { + const chunkSize = this.chunkSize; + if (begin % chunkSize !== 0) { + throw new Error(`Bad begin offset: ${begin}`); + } + const end = begin + chunk.byteLength; + if (end % chunkSize !== 0 && end !== this.bytes.length) { + throw new Error(`Bad end offset: ${end}`); + } + this.bytes.set(new Uint8Array(chunk), begin); + const beginChunk = Math.floor(begin / chunkSize); + const endChunk = Math.floor((end - 1) / chunkSize) + 1; + for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) { + this._loadedChunks.add(curChunk); + } + } + onReceiveProgressiveData(data) { + let position = this.progressiveDataLength; + const beginChunk = Math.floor(position / this.chunkSize); + this.bytes.set(new Uint8Array(data), position); + position += data.byteLength; + this.progressiveDataLength = position; + const endChunk = position >= this.end ? this.numChunks : Math.floor(position / this.chunkSize); + for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) { + this._loadedChunks.add(curChunk); + } + } + ensureByte(pos) { + if (pos < this.progressiveDataLength) { + return; + } + const chunk = Math.floor(pos / this.chunkSize); + if (chunk > this.numChunks) { + return; + } + if (chunk === this.lastSuccessfulEnsureByteChunk) { + return; + } + if (!this._loadedChunks.has(chunk)) { + throw new MissingDataException(pos, pos + 1); + } + this.lastSuccessfulEnsureByteChunk = chunk; + } + ensureRange(begin, end) { + if (begin >= end) { + return; + } + if (end <= this.progressiveDataLength) { + return; + } + const beginChunk = Math.floor(begin / this.chunkSize); + if (beginChunk > this.numChunks) { + return; + } + const endChunk = Math.min(Math.floor((end - 1) / this.chunkSize) + 1, this.numChunks); + for (let chunk = beginChunk; chunk < endChunk; ++chunk) { + if (!this._loadedChunks.has(chunk)) { + throw new MissingDataException(begin, end); + } + } + } + nextEmptyChunk(beginChunk) { + const numChunks = this.numChunks; + for (let i = 0; i < numChunks; ++i) { + const chunk = (beginChunk + i) % numChunks; + if (!this._loadedChunks.has(chunk)) { + return chunk; + } + } + return null; + } + hasChunk(chunk) { + return this._loadedChunks.has(chunk); + } + getByte() { + const pos = this.pos; + if (pos >= this.end) { + return -1; + } + if (pos >= this.progressiveDataLength) { + this.ensureByte(pos); + } + return this.bytes[this.pos++]; + } + getBytes(length) { + const bytes = this.bytes; + const pos = this.pos; + const strEnd = this.end; + if (!length) { + if (strEnd > this.progressiveDataLength) { + this.ensureRange(pos, strEnd); + } + return bytes.subarray(pos, strEnd); + } + let end = pos + length; + if (end > strEnd) { + end = strEnd; + } + if (end > this.progressiveDataLength) { + this.ensureRange(pos, end); + } + this.pos = end; + return bytes.subarray(pos, end); + } + getByteRange(begin, end) { + if (begin < 0) { + begin = 0; + } + if (end > this.end) { + end = this.end; + } + if (end > this.progressiveDataLength) { + this.ensureRange(begin, end); + } + return this.bytes.subarray(begin, end); + } + makeSubStream(start, length, dict = null) { + if (length) { + if (start + length > this.progressiveDataLength) { + this.ensureRange(start, start + length); + } + } else if (start >= this.progressiveDataLength) { + this.ensureByte(start); + } + function ChunkedStreamSubstream() {} + ChunkedStreamSubstream.prototype = Object.create(this); + ChunkedStreamSubstream.prototype.getMissingChunks = function () { + const chunkSize = this.chunkSize; + const beginChunk = Math.floor(this.start / chunkSize); + const endChunk = Math.floor((this.end - 1) / chunkSize) + 1; + const missingChunks = []; + for (let chunk = beginChunk; chunk < endChunk; ++chunk) { + if (!this._loadedChunks.has(chunk)) { + missingChunks.push(chunk); + } + } + return missingChunks; + }; + Object.defineProperty(ChunkedStreamSubstream.prototype, "isDataLoaded", { + get() { + if (this.numChunksLoaded === this.numChunks) { + return true; + } + return this.getMissingChunks().length === 0; + }, + configurable: true + }); + const subStream = new ChunkedStreamSubstream(); + subStream.pos = subStream.start = start; + subStream.end = start + length || this.end; + subStream.dict = dict; + return subStream; + } + getBaseStreams() { + return [this]; + } +} +class ChunkedStreamManager { + constructor(pdfNetworkStream, args) { + this.length = args.length; + this.chunkSize = args.rangeChunkSize; + this.stream = new ChunkedStream(this.length, this.chunkSize, this); + this.pdfNetworkStream = pdfNetworkStream; + this.disableAutoFetch = args.disableAutoFetch; + this.msgHandler = args.msgHandler; + this.currRequestId = 0; + this._chunksNeededByRequest = new Map(); + this._requestsByChunk = new Map(); + this._promisesByRequest = new Map(); + this.progressiveDataLength = 0; + this.aborted = false; + this._loadedStreamCapability = new PromiseCapability(); + } + sendRequest(begin, end) { + const rangeReader = this.pdfNetworkStream.getRangeReader(begin, end); + if (!rangeReader.isStreamingSupported) { + rangeReader.onProgress = this.onProgress.bind(this); + } + let chunks = [], + loaded = 0; + return new Promise((resolve, reject) => { + const readChunk = ({ + value, + done + }) => { + try { + if (done) { + const chunkData = arrayBuffersToBytes(chunks); + chunks = null; + resolve(chunkData); + return; + } + loaded += value.byteLength; + if (rangeReader.isStreamingSupported) { + this.onProgress({ + loaded + }); + } + chunks.push(value); + rangeReader.read().then(readChunk, reject); + } catch (e) { + reject(e); + } + }; + rangeReader.read().then(readChunk, reject); + }).then(data => { + if (this.aborted) { + return; + } + this.onReceiveData({ + chunk: data, + begin + }); + }); + } + requestAllChunks(noFetch = false) { + if (!noFetch) { + const missingChunks = this.stream.getMissingChunks(); + this._requestChunks(missingChunks); + } + return this._loadedStreamCapability.promise; + } + _requestChunks(chunks) { + const requestId = this.currRequestId++; + const chunksNeeded = new Set(); + this._chunksNeededByRequest.set(requestId, chunksNeeded); + for (const chunk of chunks) { + if (!this.stream.hasChunk(chunk)) { + chunksNeeded.add(chunk); + } + } + if (chunksNeeded.size === 0) { + return Promise.resolve(); + } + const capability = new PromiseCapability(); + this._promisesByRequest.set(requestId, capability); + const chunksToRequest = []; + for (const chunk of chunksNeeded) { + let requestIds = this._requestsByChunk.get(chunk); + if (!requestIds) { + requestIds = []; + this._requestsByChunk.set(chunk, requestIds); + chunksToRequest.push(chunk); + } + requestIds.push(requestId); + } + if (chunksToRequest.length > 0) { + const groupedChunksToRequest = this.groupChunks(chunksToRequest); + for (const groupedChunk of groupedChunksToRequest) { + const begin = groupedChunk.beginChunk * this.chunkSize; + const end = Math.min(groupedChunk.endChunk * this.chunkSize, this.length); + this.sendRequest(begin, end).catch(capability.reject); + } + } + return capability.promise.catch(reason => { + if (this.aborted) { + return; + } + throw reason; + }); + } + getStream() { + return this.stream; + } + requestRange(begin, end) { + end = Math.min(end, this.length); + const beginChunk = this.getBeginChunk(begin); + const endChunk = this.getEndChunk(end); + const chunks = []; + for (let chunk = beginChunk; chunk < endChunk; ++chunk) { + chunks.push(chunk); + } + return this._requestChunks(chunks); + } + requestRanges(ranges = []) { + const chunksToRequest = []; + for (const range of ranges) { + const beginChunk = this.getBeginChunk(range.begin); + const endChunk = this.getEndChunk(range.end); + for (let chunk = beginChunk; chunk < endChunk; ++chunk) { + if (!chunksToRequest.includes(chunk)) { + chunksToRequest.push(chunk); + } + } + } + chunksToRequest.sort(function (a, b) { + return a - b; + }); + return this._requestChunks(chunksToRequest); + } + groupChunks(chunks) { + const groupedChunks = []; + let beginChunk = -1; + let prevChunk = -1; + for (let i = 0, ii = chunks.length; i < ii; ++i) { + const chunk = chunks[i]; + if (beginChunk < 0) { + beginChunk = chunk; + } + if (prevChunk >= 0 && prevChunk + 1 !== chunk) { + groupedChunks.push({ + beginChunk, + endChunk: prevChunk + 1 + }); + beginChunk = chunk; + } + if (i + 1 === chunks.length) { + groupedChunks.push({ + beginChunk, + endChunk: chunk + 1 + }); + } + prevChunk = chunk; + } + return groupedChunks; + } + onProgress(args) { + this.msgHandler.send("DocProgress", { + loaded: this.stream.numChunksLoaded * this.chunkSize + args.loaded, + total: this.length + }); + } + onReceiveData(args) { + const chunk = args.chunk; + const isProgressive = args.begin === undefined; + const begin = isProgressive ? this.progressiveDataLength : args.begin; + const end = begin + chunk.byteLength; + const beginChunk = Math.floor(begin / this.chunkSize); + const endChunk = end < this.length ? Math.floor(end / this.chunkSize) : Math.ceil(end / this.chunkSize); + if (isProgressive) { + this.stream.onReceiveProgressiveData(chunk); + this.progressiveDataLength = end; + } else { + this.stream.onReceiveData(begin, chunk); + } + if (this.stream.isDataLoaded) { + this._loadedStreamCapability.resolve(this.stream); + } + const loadedRequests = []; + for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) { + const requestIds = this._requestsByChunk.get(curChunk); + if (!requestIds) { + continue; + } + this._requestsByChunk.delete(curChunk); + for (const requestId of requestIds) { + const chunksNeeded = this._chunksNeededByRequest.get(requestId); + if (chunksNeeded.has(curChunk)) { + chunksNeeded.delete(curChunk); + } + if (chunksNeeded.size > 0) { + continue; + } + loadedRequests.push(requestId); + } + } + if (!this.disableAutoFetch && this._requestsByChunk.size === 0) { + let nextEmptyChunk; + if (this.stream.numChunksLoaded === 1) { + const lastChunk = this.stream.numChunks - 1; + if (!this.stream.hasChunk(lastChunk)) { + nextEmptyChunk = lastChunk; + } + } else { + nextEmptyChunk = this.stream.nextEmptyChunk(endChunk); + } + if (Number.isInteger(nextEmptyChunk)) { + this._requestChunks([nextEmptyChunk]); + } + } + for (const requestId of loadedRequests) { + const capability = this._promisesByRequest.get(requestId); + this._promisesByRequest.delete(requestId); + capability.resolve(); + } + this.msgHandler.send("DocProgress", { + loaded: this.stream.numChunksLoaded * this.chunkSize, + total: this.length + }); + } + onError(err) { + this._loadedStreamCapability.reject(err); + } + getBeginChunk(begin) { + return Math.floor(begin / this.chunkSize); + } + getEndChunk(end) { + return Math.floor((end - 1) / this.chunkSize) + 1; + } + abort(reason) { + this.aborted = true; + this.pdfNetworkStream?.cancelAllRequests(reason); + for (const capability of this._promisesByRequest.values()) { + capability.reject(reason); + } + } +} + +;// CONCATENATED MODULE: ./src/core/colorspace.js + + + + +function resizeRgbImage(src, dest, w1, h1, w2, h2, alpha01) { + const COMPONENTS = 3; + alpha01 = alpha01 !== 1 ? 0 : alpha01; + const xRatio = w1 / w2; + const yRatio = h1 / h2; + let newIndex = 0, + oldIndex; + const xScaled = new Uint16Array(w2); + const w1Scanline = w1 * COMPONENTS; + for (let i = 0; i < w2; i++) { + xScaled[i] = Math.floor(i * xRatio) * COMPONENTS; + } + for (let i = 0; i < h2; i++) { + const py = Math.floor(i * yRatio) * w1Scanline; + for (let j = 0; j < w2; j++) { + oldIndex = py + xScaled[j]; + dest[newIndex++] = src[oldIndex++]; + dest[newIndex++] = src[oldIndex++]; + dest[newIndex++] = src[oldIndex++]; + newIndex += alpha01; + } + } +} +class ColorSpace { + constructor(name, numComps) { + if (this.constructor === ColorSpace) { + unreachable("Cannot initialize ColorSpace."); + } + this.name = name; + this.numComps = numComps; + } + getRgb(src, srcOffset) { + const rgb = new Uint8ClampedArray(3); + this.getRgbItem(src, srcOffset, rgb, 0); + return rgb; + } + getRgbItem(src, srcOffset, dest, destOffset) { + unreachable("Should not call ColorSpace.getRgbItem"); + } + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + unreachable("Should not call ColorSpace.getRgbBuffer"); + } + getOutputLength(inputLength, alpha01) { + unreachable("Should not call ColorSpace.getOutputLength"); + } + isPassthrough(bits) { + return false; + } + isDefaultDecode(decodeMap, bpc) { + return ColorSpace.isDefaultDecode(decodeMap, this.numComps); + } + fillRgb(dest, originalWidth, originalHeight, width, height, actualHeight, bpc, comps, alpha01) { + const count = originalWidth * originalHeight; + let rgbBuf = null; + const numComponentColors = 1 << bpc; + const needsResizing = originalHeight !== height || originalWidth !== width; + if (this.isPassthrough(bpc)) { + rgbBuf = comps; + } else if (this.numComps === 1 && count > numComponentColors && this.name !== "DeviceGray" && this.name !== "DeviceRGB") { + const allColors = bpc <= 8 ? new Uint8Array(numComponentColors) : new Uint16Array(numComponentColors); + for (let i = 0; i < numComponentColors; i++) { + allColors[i] = i; + } + const colorMap = new Uint8ClampedArray(numComponentColors * 3); + this.getRgbBuffer(allColors, 0, numComponentColors, colorMap, 0, bpc, 0); + if (!needsResizing) { + let destPos = 0; + for (let i = 0; i < count; ++i) { + const key = comps[i] * 3; + dest[destPos++] = colorMap[key]; + dest[destPos++] = colorMap[key + 1]; + dest[destPos++] = colorMap[key + 2]; + destPos += alpha01; + } + } else { + rgbBuf = new Uint8Array(count * 3); + let rgbPos = 0; + for (let i = 0; i < count; ++i) { + const key = comps[i] * 3; + rgbBuf[rgbPos++] = colorMap[key]; + rgbBuf[rgbPos++] = colorMap[key + 1]; + rgbBuf[rgbPos++] = colorMap[key + 2]; + } + } + } else if (!needsResizing) { + this.getRgbBuffer(comps, 0, width * actualHeight, dest, 0, bpc, alpha01); + } else { + rgbBuf = new Uint8ClampedArray(count * 3); + this.getRgbBuffer(comps, 0, count, rgbBuf, 0, bpc, 0); + } + if (rgbBuf) { + if (needsResizing) { + resizeRgbImage(rgbBuf, dest, originalWidth, originalHeight, width, height, alpha01); + } else { + let destPos = 0, + rgbPos = 0; + for (let i = 0, ii = width * actualHeight; i < ii; i++) { + dest[destPos++] = rgbBuf[rgbPos++]; + dest[destPos++] = rgbBuf[rgbPos++]; + dest[destPos++] = rgbBuf[rgbPos++]; + destPos += alpha01; + } + } + } + } + get usesZeroToOneRange() { + return shadow(this, "usesZeroToOneRange", true); + } + static _cache(cacheKey, xref, localColorSpaceCache, parsedColorSpace) { + if (!localColorSpaceCache) { + throw new Error('ColorSpace._cache - expected "localColorSpaceCache" argument.'); + } + if (!parsedColorSpace) { + throw new Error('ColorSpace._cache - expected "parsedColorSpace" argument.'); + } + let csName, csRef; + if (cacheKey instanceof Ref) { + csRef = cacheKey; + cacheKey = xref.fetch(cacheKey); + } + if (cacheKey instanceof Name) { + csName = cacheKey.name; + } + if (csName || csRef) { + localColorSpaceCache.set(csName, csRef, parsedColorSpace); + } + } + static getCached(cacheKey, xref, localColorSpaceCache) { + if (!localColorSpaceCache) { + throw new Error('ColorSpace.getCached - expected "localColorSpaceCache" argument.'); + } + if (cacheKey instanceof Ref) { + const localColorSpace = localColorSpaceCache.getByRef(cacheKey); + if (localColorSpace) { + return localColorSpace; + } + try { + cacheKey = xref.fetch(cacheKey); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + } + } + if (cacheKey instanceof Name) { + const localColorSpace = localColorSpaceCache.getByName(cacheKey.name); + if (localColorSpace) { + return localColorSpace; + } + } + return null; + } + static async parseAsync({ + cs, + xref, + resources = null, + pdfFunctionFactory, + localColorSpaceCache + }) { + const parsedColorSpace = this._parse(cs, xref, resources, pdfFunctionFactory); + this._cache(cs, xref, localColorSpaceCache, parsedColorSpace); + return parsedColorSpace; + } + static parse({ + cs, + xref, + resources = null, + pdfFunctionFactory, + localColorSpaceCache + }) { + const cachedColorSpace = this.getCached(cs, xref, localColorSpaceCache); + if (cachedColorSpace) { + return cachedColorSpace; + } + const parsedColorSpace = this._parse(cs, xref, resources, pdfFunctionFactory); + this._cache(cs, xref, localColorSpaceCache, parsedColorSpace); + return parsedColorSpace; + } + static _parse(cs, xref, resources = null, pdfFunctionFactory) { + cs = xref.fetchIfRef(cs); + if (cs instanceof Name) { + switch (cs.name) { + case "G": + case "DeviceGray": + return this.singletons.gray; + case "RGB": + case "DeviceRGB": + return this.singletons.rgb; + case "CMYK": + case "DeviceCMYK": + return this.singletons.cmyk; + case "Pattern": + return new PatternCS(null); + default: + if (resources instanceof Dict) { + const colorSpaces = resources.get("ColorSpace"); + if (colorSpaces instanceof Dict) { + const resourcesCS = colorSpaces.get(cs.name); + if (resourcesCS) { + if (resourcesCS instanceof Name) { + return this._parse(resourcesCS, xref, resources, pdfFunctionFactory); + } + cs = resourcesCS; + break; + } + } + } + throw new FormatError(`Unrecognized ColorSpace: ${cs.name}`); + } + } + if (Array.isArray(cs)) { + const mode = xref.fetchIfRef(cs[0]).name; + let params, numComps, baseCS, whitePoint, blackPoint, gamma; + switch (mode) { + case "G": + case "DeviceGray": + return this.singletons.gray; + case "RGB": + case "DeviceRGB": + return this.singletons.rgb; + case "CMYK": + case "DeviceCMYK": + return this.singletons.cmyk; + case "CalGray": + params = xref.fetchIfRef(cs[1]); + whitePoint = params.getArray("WhitePoint"); + blackPoint = params.getArray("BlackPoint"); + gamma = params.get("Gamma"); + return new CalGrayCS(whitePoint, blackPoint, gamma); + case "CalRGB": + params = xref.fetchIfRef(cs[1]); + whitePoint = params.getArray("WhitePoint"); + blackPoint = params.getArray("BlackPoint"); + gamma = params.getArray("Gamma"); + const matrix = params.getArray("Matrix"); + return new CalRGBCS(whitePoint, blackPoint, gamma, matrix); + case "ICCBased": + const stream = xref.fetchIfRef(cs[1]); + const dict = stream.dict; + numComps = dict.get("N"); + const alt = dict.get("Alternate"); + if (alt) { + const altCS = this._parse(alt, xref, resources, pdfFunctionFactory); + if (altCS.numComps === numComps) { + return altCS; + } + warn("ICCBased color space: Ignoring incorrect /Alternate entry."); + } + if (numComps === 1) { + return this.singletons.gray; + } else if (numComps === 3) { + return this.singletons.rgb; + } else if (numComps === 4) { + return this.singletons.cmyk; + } + break; + case "Pattern": + baseCS = cs[1] || null; + if (baseCS) { + baseCS = this._parse(baseCS, xref, resources, pdfFunctionFactory); + } + return new PatternCS(baseCS); + case "I": + case "Indexed": + baseCS = this._parse(cs[1], xref, resources, pdfFunctionFactory); + const hiVal = xref.fetchIfRef(cs[2]) + 1; + const lookup = xref.fetchIfRef(cs[3]); + return new IndexedCS(baseCS, hiVal, lookup); + case "Separation": + case "DeviceN": + const name = xref.fetchIfRef(cs[1]); + numComps = Array.isArray(name) ? name.length : 1; + baseCS = this._parse(cs[2], xref, resources, pdfFunctionFactory); + const tintFn = pdfFunctionFactory.create(cs[3]); + return new AlternateCS(numComps, baseCS, tintFn); + case "Lab": + params = xref.fetchIfRef(cs[1]); + whitePoint = params.getArray("WhitePoint"); + blackPoint = params.getArray("BlackPoint"); + const range = params.getArray("Range"); + return new LabCS(whitePoint, blackPoint, range); + default: + throw new FormatError(`Unimplemented ColorSpace object: ${mode}`); + } + } + throw new FormatError(`Unrecognized ColorSpace object: ${cs}`); + } + static isDefaultDecode(decode, numComps) { + if (!Array.isArray(decode)) { + return true; + } + if (numComps * 2 !== decode.length) { + warn("The decode map is not the correct length"); + return true; + } + for (let i = 0, ii = decode.length; i < ii; i += 2) { + if (decode[i] !== 0 || decode[i + 1] !== 1) { + return false; + } + } + return true; + } + static get singletons() { + return shadow(this, "singletons", { + get gray() { + return shadow(this, "gray", new DeviceGrayCS()); + }, + get rgb() { + return shadow(this, "rgb", new DeviceRgbCS()); + }, + get cmyk() { + return shadow(this, "cmyk", new DeviceCmykCS()); + } + }); + } +} +class AlternateCS extends ColorSpace { + constructor(numComps, base, tintFn) { + super("Alternate", numComps); + this.base = base; + this.tintFn = tintFn; + this.tmpBuf = new Float32Array(base.numComps); + } + getRgbItem(src, srcOffset, dest, destOffset) { + const tmpBuf = this.tmpBuf; + this.tintFn(src, srcOffset, tmpBuf, 0); + this.base.getRgbItem(tmpBuf, 0, dest, destOffset); + } + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const tintFn = this.tintFn; + const base = this.base; + const scale = 1 / ((1 << bits) - 1); + const baseNumComps = base.numComps; + const usesZeroToOneRange = base.usesZeroToOneRange; + const isPassthrough = (base.isPassthrough(8) || !usesZeroToOneRange) && alpha01 === 0; + let pos = isPassthrough ? destOffset : 0; + const baseBuf = isPassthrough ? dest : new Uint8ClampedArray(baseNumComps * count); + const numComps = this.numComps; + const scaled = new Float32Array(numComps); + const tinted = new Float32Array(baseNumComps); + let i, j; + for (i = 0; i < count; i++) { + for (j = 0; j < numComps; j++) { + scaled[j] = src[srcOffset++] * scale; + } + tintFn(scaled, 0, tinted, 0); + if (usesZeroToOneRange) { + for (j = 0; j < baseNumComps; j++) { + baseBuf[pos++] = tinted[j] * 255; + } + } else { + base.getRgbItem(tinted, 0, baseBuf, pos); + pos += baseNumComps; + } + } + if (!isPassthrough) { + base.getRgbBuffer(baseBuf, 0, count, dest, destOffset, 8, alpha01); + } + } + getOutputLength(inputLength, alpha01) { + return this.base.getOutputLength(inputLength * this.base.numComps / this.numComps, alpha01); + } +} +class PatternCS extends ColorSpace { + constructor(baseCS) { + super("Pattern", null); + this.base = baseCS; + } + isDefaultDecode(decodeMap, bpc) { + unreachable("Should not call PatternCS.isDefaultDecode"); + } +} +class IndexedCS extends ColorSpace { + constructor(base, highVal, lookup) { + super("Indexed", 1); + this.base = base; + this.highVal = highVal; + const length = base.numComps * highVal; + this.lookup = new Uint8Array(length); + if (lookup instanceof BaseStream) { + const bytes = lookup.getBytes(length); + this.lookup.set(bytes); + } else if (typeof lookup === "string") { + for (let i = 0; i < length; ++i) { + this.lookup[i] = lookup.charCodeAt(i) & 0xff; + } + } else { + throw new FormatError(`IndexedCS - unrecognized lookup table: ${lookup}`); + } + } + getRgbItem(src, srcOffset, dest, destOffset) { + const numComps = this.base.numComps; + const start = src[srcOffset] * numComps; + this.base.getRgbBuffer(this.lookup, start, 1, dest, destOffset, 8, 0); + } + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const base = this.base; + const numComps = base.numComps; + const outputDelta = base.getOutputLength(numComps, alpha01); + const lookup = this.lookup; + for (let i = 0; i < count; ++i) { + const lookupPos = src[srcOffset++] * numComps; + base.getRgbBuffer(lookup, lookupPos, 1, dest, destOffset, 8, alpha01); + destOffset += outputDelta; + } + } + getOutputLength(inputLength, alpha01) { + return this.base.getOutputLength(inputLength * this.base.numComps, alpha01); + } + isDefaultDecode(decodeMap, bpc) { + if (!Array.isArray(decodeMap)) { + return true; + } + if (decodeMap.length !== 2) { + warn("Decode map length is not correct"); + return true; + } + if (!Number.isInteger(bpc) || bpc < 1) { + warn("Bits per component is not correct"); + return true; + } + return decodeMap[0] === 0 && decodeMap[1] === (1 << bpc) - 1; + } +} +class DeviceGrayCS extends ColorSpace { + constructor() { + super("DeviceGray", 1); + } + getRgbItem(src, srcOffset, dest, destOffset) { + const c = src[srcOffset] * 255; + dest[destOffset] = dest[destOffset + 1] = dest[destOffset + 2] = c; + } + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const scale = 255 / ((1 << bits) - 1); + let j = srcOffset, + q = destOffset; + for (let i = 0; i < count; ++i) { + const c = scale * src[j++]; + dest[q++] = c; + dest[q++] = c; + dest[q++] = c; + q += alpha01; + } + } + getOutputLength(inputLength, alpha01) { + return inputLength * (3 + alpha01); + } +} +class DeviceRgbCS extends ColorSpace { + constructor() { + super("DeviceRGB", 3); + } + getRgbItem(src, srcOffset, dest, destOffset) { + dest[destOffset] = src[srcOffset] * 255; + dest[destOffset + 1] = src[srcOffset + 1] * 255; + dest[destOffset + 2] = src[srcOffset + 2] * 255; + } + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + if (bits === 8 && alpha01 === 0) { + dest.set(src.subarray(srcOffset, srcOffset + count * 3), destOffset); + return; + } + const scale = 255 / ((1 << bits) - 1); + let j = srcOffset, + q = destOffset; + for (let i = 0; i < count; ++i) { + dest[q++] = scale * src[j++]; + dest[q++] = scale * src[j++]; + dest[q++] = scale * src[j++]; + q += alpha01; + } + } + getOutputLength(inputLength, alpha01) { + return inputLength * (3 + alpha01) / 3 | 0; + } + isPassthrough(bits) { + return bits === 8; + } +} +class DeviceCmykCS extends ColorSpace { + constructor() { + super("DeviceCMYK", 4); + } + #toRgb(src, srcOffset, srcScale, dest, destOffset) { + const c = src[srcOffset] * srcScale; + const m = src[srcOffset + 1] * srcScale; + const y = src[srcOffset + 2] * srcScale; + const k = src[srcOffset + 3] * srcScale; + dest[destOffset] = 255 + c * (-4.387332384609988 * c + 54.48615194189176 * m + 18.82290502165302 * y + 212.25662451639585 * k + -285.2331026137004) + m * (1.7149763477362134 * m - 5.6096736904047315 * y + -17.873870861415444 * k - 5.497006427196366) + y * (-2.5217340131683033 * y - 21.248923337353073 * k + 17.5119270841813) + k * (-21.86122147463605 * k - 189.48180835922747); + dest[destOffset + 1] = 255 + c * (8.841041422036149 * c + 60.118027045597366 * m + 6.871425592049007 * y + 31.159100130055922 * k + -79.2970844816548) + m * (-15.310361306967817 * m + 17.575251261109482 * y + 131.35250912493976 * k - 190.9453302588951) + y * (4.444339102852739 * y + 9.8632861493405 * k - 24.86741582555878) + k * (-20.737325471181034 * k - 187.80453709719578); + dest[destOffset + 2] = 255 + c * (0.8842522430003296 * c + 8.078677503112928 * m + 30.89978309703729 * y - 0.23883238689178934 * k + -14.183576799673286) + m * (10.49593273432072 * m + 63.02378494754052 * y + 50.606957656360734 * k - 112.23884253719248) + y * (0.03296041114873217 * y + 115.60384449646641 * k + -193.58209356861505) + k * (-22.33816807309886 * k - 180.12613974708367); + } + getRgbItem(src, srcOffset, dest, destOffset) { + this.#toRgb(src, srcOffset, 1, dest, destOffset); + } + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const scale = 1 / ((1 << bits) - 1); + for (let i = 0; i < count; i++) { + this.#toRgb(src, srcOffset, scale, dest, destOffset); + srcOffset += 4; + destOffset += 3 + alpha01; + } + } + getOutputLength(inputLength, alpha01) { + return inputLength / 4 * (3 + alpha01) | 0; + } +} +class CalGrayCS extends ColorSpace { + constructor(whitePoint, blackPoint, gamma) { + super("CalGray", 1); + if (!whitePoint) { + throw new FormatError("WhitePoint missing - required for color space CalGray"); + } + [this.XW, this.YW, this.ZW] = whitePoint; + [this.XB, this.YB, this.ZB] = blackPoint || [0, 0, 0]; + this.G = gamma || 1; + if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { + throw new FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`); + } + if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { + info(`Invalid BlackPoint for ${this.name}, falling back to default.`); + this.XB = this.YB = this.ZB = 0; + } + if (this.XB !== 0 || this.YB !== 0 || this.ZB !== 0) { + warn(`${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ` + `ZB: ${this.ZB}, only default values are supported.`); + } + if (this.G < 1) { + info(`Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`); + this.G = 1; + } + } + #toRgb(src, srcOffset, dest, destOffset, scale) { + const A = src[srcOffset] * scale; + const AG = A ** this.G; + const L = this.YW * AG; + const val = Math.max(295.8 * L ** 0.3333333333333333 - 40.8, 0); + dest[destOffset] = val; + dest[destOffset + 1] = val; + dest[destOffset + 2] = val; + } + getRgbItem(src, srcOffset, dest, destOffset) { + this.#toRgb(src, srcOffset, dest, destOffset, 1); + } + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const scale = 1 / ((1 << bits) - 1); + for (let i = 0; i < count; ++i) { + this.#toRgb(src, srcOffset, dest, destOffset, scale); + srcOffset += 1; + destOffset += 3 + alpha01; + } + } + getOutputLength(inputLength, alpha01) { + return inputLength * (3 + alpha01); + } +} +class CalRGBCS extends ColorSpace { + static #BRADFORD_SCALE_MATRIX = new Float32Array([0.8951, 0.2664, -0.1614, -0.7502, 1.7135, 0.0367, 0.0389, -0.0685, 1.0296]); + static #BRADFORD_SCALE_INVERSE_MATRIX = new Float32Array([0.9869929, -0.1470543, 0.1599627, 0.4323053, 0.5183603, 0.0492912, -0.0085287, 0.0400428, 0.9684867]); + static #SRGB_D65_XYZ_TO_RGB_MATRIX = new Float32Array([3.2404542, -1.5371385, -0.4985314, -0.9692660, 1.8760108, 0.0415560, 0.0556434, -0.2040259, 1.0572252]); + static #FLAT_WHITEPOINT_MATRIX = new Float32Array([1, 1, 1]); + static #tempNormalizeMatrix = new Float32Array(3); + static #tempConvertMatrix1 = new Float32Array(3); + static #tempConvertMatrix2 = new Float32Array(3); + static #DECODE_L_CONSTANT = ((8 + 16) / 116) ** 3 / 8.0; + constructor(whitePoint, blackPoint, gamma, matrix) { + super("CalRGB", 3); + if (!whitePoint) { + throw new FormatError("WhitePoint missing - required for color space CalRGB"); + } + const [XW, YW, ZW] = this.whitePoint = whitePoint; + const [XB, YB, ZB] = this.blackPoint = blackPoint || new Float32Array(3); + [this.GR, this.GG, this.GB] = gamma || new Float32Array([1, 1, 1]); + [this.MXA, this.MYA, this.MZA, this.MXB, this.MYB, this.MZB, this.MXC, this.MYC, this.MZC] = matrix || new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]); + if (XW < 0 || ZW < 0 || YW !== 1) { + throw new FormatError(`Invalid WhitePoint components for ${this.name}, no fallback available`); + } + if (XB < 0 || YB < 0 || ZB < 0) { + info(`Invalid BlackPoint for ${this.name} [${XB}, ${YB}, ${ZB}], ` + "falling back to default."); + this.blackPoint = new Float32Array(3); + } + if (this.GR < 0 || this.GG < 0 || this.GB < 0) { + info(`Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ` + `${this.name}, falling back to default.`); + this.GR = this.GG = this.GB = 1; + } + } + #matrixProduct(a, b, result) { + result[0] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + result[1] = a[3] * b[0] + a[4] * b[1] + a[5] * b[2]; + result[2] = a[6] * b[0] + a[7] * b[1] + a[8] * b[2]; + } + #toFlat(sourceWhitePoint, LMS, result) { + result[0] = LMS[0] * 1 / sourceWhitePoint[0]; + result[1] = LMS[1] * 1 / sourceWhitePoint[1]; + result[2] = LMS[2] * 1 / sourceWhitePoint[2]; + } + #toD65(sourceWhitePoint, LMS, result) { + const D65X = 0.95047; + const D65Y = 1; + const D65Z = 1.08883; + result[0] = LMS[0] * D65X / sourceWhitePoint[0]; + result[1] = LMS[1] * D65Y / sourceWhitePoint[1]; + result[2] = LMS[2] * D65Z / sourceWhitePoint[2]; + } + #sRGBTransferFunction(color) { + if (color <= 0.0031308) { + return this.#adjustToRange(0, 1, 12.92 * color); + } + if (color >= 0.99554525) { + return 1; + } + return this.#adjustToRange(0, 1, (1 + 0.055) * color ** (1 / 2.4) - 0.055); + } + #adjustToRange(min, max, value) { + return Math.max(min, Math.min(max, value)); + } + #decodeL(L) { + if (L < 0) { + return -this.#decodeL(-L); + } + if (L > 8.0) { + return ((L + 16) / 116) ** 3; + } + return L * CalRGBCS.#DECODE_L_CONSTANT; + } + #compensateBlackPoint(sourceBlackPoint, XYZ_Flat, result) { + if (sourceBlackPoint[0] === 0 && sourceBlackPoint[1] === 0 && sourceBlackPoint[2] === 0) { + result[0] = XYZ_Flat[0]; + result[1] = XYZ_Flat[1]; + result[2] = XYZ_Flat[2]; + return; + } + const zeroDecodeL = this.#decodeL(0); + const X_DST = zeroDecodeL; + const X_SRC = this.#decodeL(sourceBlackPoint[0]); + const Y_DST = zeroDecodeL; + const Y_SRC = this.#decodeL(sourceBlackPoint[1]); + const Z_DST = zeroDecodeL; + const Z_SRC = this.#decodeL(sourceBlackPoint[2]); + const X_Scale = (1 - X_DST) / (1 - X_SRC); + const X_Offset = 1 - X_Scale; + const Y_Scale = (1 - Y_DST) / (1 - Y_SRC); + const Y_Offset = 1 - Y_Scale; + const Z_Scale = (1 - Z_DST) / (1 - Z_SRC); + const Z_Offset = 1 - Z_Scale; + result[0] = XYZ_Flat[0] * X_Scale + X_Offset; + result[1] = XYZ_Flat[1] * Y_Scale + Y_Offset; + result[2] = XYZ_Flat[2] * Z_Scale + Z_Offset; + } + #normalizeWhitePointToFlat(sourceWhitePoint, XYZ_In, result) { + if (sourceWhitePoint[0] === 1 && sourceWhitePoint[2] === 1) { + result[0] = XYZ_In[0]; + result[1] = XYZ_In[1]; + result[2] = XYZ_In[2]; + return; + } + const LMS = result; + this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_MATRIX, XYZ_In, LMS); + const LMS_Flat = CalRGBCS.#tempNormalizeMatrix; + this.#toFlat(sourceWhitePoint, LMS, LMS_Flat); + this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_INVERSE_MATRIX, LMS_Flat, result); + } + #normalizeWhitePointToD65(sourceWhitePoint, XYZ_In, result) { + const LMS = result; + this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_MATRIX, XYZ_In, LMS); + const LMS_D65 = CalRGBCS.#tempNormalizeMatrix; + this.#toD65(sourceWhitePoint, LMS, LMS_D65); + this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_INVERSE_MATRIX, LMS_D65, result); + } + #toRgb(src, srcOffset, dest, destOffset, scale) { + const A = this.#adjustToRange(0, 1, src[srcOffset] * scale); + const B = this.#adjustToRange(0, 1, src[srcOffset + 1] * scale); + const C = this.#adjustToRange(0, 1, src[srcOffset + 2] * scale); + const AGR = A === 1 ? 1 : A ** this.GR; + const BGG = B === 1 ? 1 : B ** this.GG; + const CGB = C === 1 ? 1 : C ** this.GB; + const X = this.MXA * AGR + this.MXB * BGG + this.MXC * CGB; + const Y = this.MYA * AGR + this.MYB * BGG + this.MYC * CGB; + const Z = this.MZA * AGR + this.MZB * BGG + this.MZC * CGB; + const XYZ = CalRGBCS.#tempConvertMatrix1; + XYZ[0] = X; + XYZ[1] = Y; + XYZ[2] = Z; + const XYZ_Flat = CalRGBCS.#tempConvertMatrix2; + this.#normalizeWhitePointToFlat(this.whitePoint, XYZ, XYZ_Flat); + const XYZ_Black = CalRGBCS.#tempConvertMatrix1; + this.#compensateBlackPoint(this.blackPoint, XYZ_Flat, XYZ_Black); + const XYZ_D65 = CalRGBCS.#tempConvertMatrix2; + this.#normalizeWhitePointToD65(CalRGBCS.#FLAT_WHITEPOINT_MATRIX, XYZ_Black, XYZ_D65); + const SRGB = CalRGBCS.#tempConvertMatrix1; + this.#matrixProduct(CalRGBCS.#SRGB_D65_XYZ_TO_RGB_MATRIX, XYZ_D65, SRGB); + dest[destOffset] = this.#sRGBTransferFunction(SRGB[0]) * 255; + dest[destOffset + 1] = this.#sRGBTransferFunction(SRGB[1]) * 255; + dest[destOffset + 2] = this.#sRGBTransferFunction(SRGB[2]) * 255; + } + getRgbItem(src, srcOffset, dest, destOffset) { + this.#toRgb(src, srcOffset, dest, destOffset, 1); + } + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const scale = 1 / ((1 << bits) - 1); + for (let i = 0; i < count; ++i) { + this.#toRgb(src, srcOffset, dest, destOffset, scale); + srcOffset += 3; + destOffset += 3 + alpha01; + } + } + getOutputLength(inputLength, alpha01) { + return inputLength * (3 + alpha01) / 3 | 0; + } +} +class LabCS extends ColorSpace { + constructor(whitePoint, blackPoint, range) { + super("Lab", 3); + if (!whitePoint) { + throw new FormatError("WhitePoint missing - required for color space Lab"); + } + [this.XW, this.YW, this.ZW] = whitePoint; + [this.amin, this.amax, this.bmin, this.bmax] = range || [-100, 100, -100, 100]; + [this.XB, this.YB, this.ZB] = blackPoint || [0, 0, 0]; + if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) { + throw new FormatError("Invalid WhitePoint components, no fallback available"); + } + if (this.XB < 0 || this.YB < 0 || this.ZB < 0) { + info("Invalid BlackPoint, falling back to default"); + this.XB = this.YB = this.ZB = 0; + } + if (this.amin > this.amax || this.bmin > this.bmax) { + info("Invalid Range, falling back to defaults"); + this.amin = -100; + this.amax = 100; + this.bmin = -100; + this.bmax = 100; + } + } + #fn_g(x) { + return x >= 6 / 29 ? x ** 3 : 108 / 841 * (x - 4 / 29); + } + #decode(value, high1, low2, high2) { + return low2 + value * (high2 - low2) / high1; + } + #toRgb(src, srcOffset, maxVal, dest, destOffset) { + let Ls = src[srcOffset]; + let as = src[srcOffset + 1]; + let bs = src[srcOffset + 2]; + if (maxVal !== false) { + Ls = this.#decode(Ls, maxVal, 0, 100); + as = this.#decode(as, maxVal, this.amin, this.amax); + bs = this.#decode(bs, maxVal, this.bmin, this.bmax); + } + if (as > this.amax) { + as = this.amax; + } else if (as < this.amin) { + as = this.amin; + } + if (bs > this.bmax) { + bs = this.bmax; + } else if (bs < this.bmin) { + bs = this.bmin; + } + const M = (Ls + 16) / 116; + const L = M + as / 500; + const N = M - bs / 200; + const X = this.XW * this.#fn_g(L); + const Y = this.YW * this.#fn_g(M); + const Z = this.ZW * this.#fn_g(N); + let r, g, b; + if (this.ZW < 1) { + r = X * 3.1339 + Y * -1.617 + Z * -0.4906; + g = X * -0.9785 + Y * 1.916 + Z * 0.0333; + b = X * 0.072 + Y * -0.229 + Z * 1.4057; + } else { + r = X * 3.2406 + Y * -1.5372 + Z * -0.4986; + g = X * -0.9689 + Y * 1.8758 + Z * 0.0415; + b = X * 0.0557 + Y * -0.204 + Z * 1.057; + } + dest[destOffset] = Math.sqrt(r) * 255; + dest[destOffset + 1] = Math.sqrt(g) * 255; + dest[destOffset + 2] = Math.sqrt(b) * 255; + } + getRgbItem(src, srcOffset, dest, destOffset) { + this.#toRgb(src, srcOffset, false, dest, destOffset); + } + getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) { + const maxVal = (1 << bits) - 1; + for (let i = 0; i < count; i++) { + this.#toRgb(src, srcOffset, maxVal, dest, destOffset); + srcOffset += 3; + destOffset += 3 + alpha01; + } + } + getOutputLength(inputLength, alpha01) { + return inputLength * (3 + alpha01) / 3 | 0; + } + isDefaultDecode(decodeMap, bpc) { + return true; + } + get usesZeroToOneRange() { + return shadow(this, "usesZeroToOneRange", false); + } +} + +;// CONCATENATED MODULE: ./src/core/binary_cmap.js + +function hexToInt(a, size) { + let n = 0; + for (let i = 0; i <= size; i++) { + n = n << 8 | a[i]; + } + return n >>> 0; +} +function hexToStr(a, size) { + if (size === 1) { + return String.fromCharCode(a[0], a[1]); + } + if (size === 3) { + return String.fromCharCode(a[0], a[1], a[2], a[3]); + } + return String.fromCharCode(...a.subarray(0, size + 1)); +} +function addHex(a, b, size) { + let c = 0; + for (let i = size; i >= 0; i--) { + c += a[i] + b[i]; + a[i] = c & 255; + c >>= 8; + } +} +function incHex(a, size) { + let c = 1; + for (let i = size; i >= 0 && c > 0; i--) { + c += a[i]; + a[i] = c & 255; + c >>= 8; + } +} +const MAX_NUM_SIZE = 16; +const MAX_ENCODED_NUM_SIZE = 19; +class BinaryCMapStream { + constructor(data) { + this.buffer = data; + this.pos = 0; + this.end = data.length; + this.tmpBuf = new Uint8Array(MAX_ENCODED_NUM_SIZE); + } + readByte() { + if (this.pos >= this.end) { + return -1; + } + return this.buffer[this.pos++]; + } + readNumber() { + let n = 0; + let last; + do { + const b = this.readByte(); + if (b < 0) { + throw new FormatError("unexpected EOF in bcmap"); + } + last = !(b & 0x80); + n = n << 7 | b & 0x7f; + } while (!last); + return n; + } + readSigned() { + const n = this.readNumber(); + return n & 1 ? ~(n >>> 1) : n >>> 1; + } + readHex(num, size) { + num.set(this.buffer.subarray(this.pos, this.pos + size + 1)); + this.pos += size + 1; + } + readHexNumber(num, size) { + let last; + const stack = this.tmpBuf; + let sp = 0; + do { + const b = this.readByte(); + if (b < 0) { + throw new FormatError("unexpected EOF in bcmap"); + } + last = !(b & 0x80); + stack[sp++] = b & 0x7f; + } while (!last); + let i = size, + buffer = 0, + bufferSize = 0; + while (i >= 0) { + while (bufferSize < 8 && stack.length > 0) { + buffer |= stack[--sp] << bufferSize; + bufferSize += 7; + } + num[i] = buffer & 255; + i--; + buffer >>= 8; + bufferSize -= 8; + } + } + readHexSigned(num, size) { + this.readHexNumber(num, size); + const sign = num[size] & 1 ? 255 : 0; + let c = 0; + for (let i = 0; i <= size; i++) { + c = (c & 1) << 8 | num[i]; + num[i] = c >> 1 ^ sign; + } + } + readString() { + const len = this.readNumber(), + buf = new Array(len); + for (let i = 0; i < len; i++) { + buf[i] = this.readNumber(); + } + return String.fromCharCode(...buf); + } +} +class BinaryCMapReader { + async process(data, cMap, extend) { + const stream = new BinaryCMapStream(data); + const header = stream.readByte(); + cMap.vertical = !!(header & 1); + let useCMap = null; + const start = new Uint8Array(MAX_NUM_SIZE); + const end = new Uint8Array(MAX_NUM_SIZE); + const char = new Uint8Array(MAX_NUM_SIZE); + const charCode = new Uint8Array(MAX_NUM_SIZE); + const tmp = new Uint8Array(MAX_NUM_SIZE); + let code; + let b; + while ((b = stream.readByte()) >= 0) { + const type = b >> 5; + if (type === 7) { + switch (b & 0x1f) { + case 0: + stream.readString(); + break; + case 1: + useCMap = stream.readString(); + break; + } + continue; + } + const sequence = !!(b & 0x10); + const dataSize = b & 15; + if (dataSize + 1 > MAX_NUM_SIZE) { + throw new Error("BinaryCMapReader.process: Invalid dataSize."); + } + const ucs2DataSize = 1; + const subitemsCount = stream.readNumber(); + switch (type) { + case 0: + stream.readHex(start, dataSize); + stream.readHexNumber(end, dataSize); + addHex(end, start, dataSize); + cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), hexToInt(end, dataSize)); + for (let i = 1; i < subitemsCount; i++) { + incHex(end, dataSize); + stream.readHexNumber(start, dataSize); + addHex(start, end, dataSize); + stream.readHexNumber(end, dataSize); + addHex(end, start, dataSize); + cMap.addCodespaceRange(dataSize + 1, hexToInt(start, dataSize), hexToInt(end, dataSize)); + } + break; + case 1: + stream.readHex(start, dataSize); + stream.readHexNumber(end, dataSize); + addHex(end, start, dataSize); + stream.readNumber(); + for (let i = 1; i < subitemsCount; i++) { + incHex(end, dataSize); + stream.readHexNumber(start, dataSize); + addHex(start, end, dataSize); + stream.readHexNumber(end, dataSize); + addHex(end, start, dataSize); + stream.readNumber(); + } + break; + case 2: + stream.readHex(char, dataSize); + code = stream.readNumber(); + cMap.mapOne(hexToInt(char, dataSize), code); + for (let i = 1; i < subitemsCount; i++) { + incHex(char, dataSize); + if (!sequence) { + stream.readHexNumber(tmp, dataSize); + addHex(char, tmp, dataSize); + } + code = stream.readSigned() + (code + 1); + cMap.mapOne(hexToInt(char, dataSize), code); + } + break; + case 3: + stream.readHex(start, dataSize); + stream.readHexNumber(end, dataSize); + addHex(end, start, dataSize); + code = stream.readNumber(); + cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), code); + for (let i = 1; i < subitemsCount; i++) { + incHex(end, dataSize); + if (!sequence) { + stream.readHexNumber(start, dataSize); + addHex(start, end, dataSize); + } else { + start.set(end); + } + stream.readHexNumber(end, dataSize); + addHex(end, start, dataSize); + code = stream.readNumber(); + cMap.mapCidRange(hexToInt(start, dataSize), hexToInt(end, dataSize), code); + } + break; + case 4: + stream.readHex(char, ucs2DataSize); + stream.readHex(charCode, dataSize); + cMap.mapOne(hexToInt(char, ucs2DataSize), hexToStr(charCode, dataSize)); + for (let i = 1; i < subitemsCount; i++) { + incHex(char, ucs2DataSize); + if (!sequence) { + stream.readHexNumber(tmp, ucs2DataSize); + addHex(char, tmp, ucs2DataSize); + } + incHex(charCode, dataSize); + stream.readHexSigned(tmp, dataSize); + addHex(charCode, tmp, dataSize); + cMap.mapOne(hexToInt(char, ucs2DataSize), hexToStr(charCode, dataSize)); + } + break; + case 5: + stream.readHex(start, ucs2DataSize); + stream.readHexNumber(end, ucs2DataSize); + addHex(end, start, ucs2DataSize); + stream.readHex(charCode, dataSize); + cMap.mapBfRange(hexToInt(start, ucs2DataSize), hexToInt(end, ucs2DataSize), hexToStr(charCode, dataSize)); + for (let i = 1; i < subitemsCount; i++) { + incHex(end, ucs2DataSize); + if (!sequence) { + stream.readHexNumber(start, ucs2DataSize); + addHex(start, end, ucs2DataSize); + } else { + start.set(end); + } + stream.readHexNumber(end, ucs2DataSize); + addHex(end, start, ucs2DataSize); + stream.readHex(charCode, dataSize); + cMap.mapBfRange(hexToInt(start, ucs2DataSize), hexToInt(end, ucs2DataSize), hexToStr(charCode, dataSize)); + } + break; + default: + throw new Error(`BinaryCMapReader.process - unknown type: ${type}`); + } + } + if (useCMap) { + return extend(useCMap); + } + return cMap; + } +} + +;// CONCATENATED MODULE: ./src/core/decode_stream.js + + +const emptyBuffer = new Uint8Array(0); +class DecodeStream extends BaseStream { + constructor(maybeMinBufferLength) { + super(); + this._rawMinBufferLength = maybeMinBufferLength || 0; + this.pos = 0; + this.bufferLength = 0; + this.eof = false; + this.buffer = emptyBuffer; + this.minBufferLength = 512; + if (maybeMinBufferLength) { + while (this.minBufferLength < maybeMinBufferLength) { + this.minBufferLength *= 2; + } + } + } + get isEmpty() { + while (!this.eof && this.bufferLength === 0) { + this.readBlock(); + } + return this.bufferLength === 0; + } + ensureBuffer(requested) { + const buffer = this.buffer; + if (requested <= buffer.byteLength) { + return buffer; + } + let size = this.minBufferLength; + while (size < requested) { + size *= 2; + } + const buffer2 = new Uint8Array(size); + buffer2.set(buffer); + return this.buffer = buffer2; + } + getByte() { + const pos = this.pos; + while (this.bufferLength <= pos) { + if (this.eof) { + return -1; + } + this.readBlock(); + } + return this.buffer[this.pos++]; + } + getBytes(length) { + const pos = this.pos; + let end; + if (length) { + this.ensureBuffer(pos + length); + end = pos + length; + while (!this.eof && this.bufferLength < end) { + this.readBlock(); + } + const bufEnd = this.bufferLength; + if (end > bufEnd) { + end = bufEnd; + } + } else { + while (!this.eof) { + this.readBlock(); + } + end = this.bufferLength; + } + this.pos = end; + return this.buffer.subarray(pos, end); + } + reset() { + this.pos = 0; + } + makeSubStream(start, length, dict = null) { + if (length === undefined) { + while (!this.eof) { + this.readBlock(); + } + } else { + const end = start + length; + while (this.bufferLength <= end && !this.eof) { + this.readBlock(); + } + } + return new Stream(this.buffer, start, length, dict); + } + getBaseStreams() { + return this.str ? this.str.getBaseStreams() : null; + } +} +class StreamsSequenceStream extends DecodeStream { + constructor(streams, onError = null) { + let maybeLength = 0; + for (const stream of streams) { + maybeLength += stream instanceof DecodeStream ? stream._rawMinBufferLength : stream.length; + } + super(maybeLength); + this.streams = streams; + this._onError = onError; + } + readBlock() { + const streams = this.streams; + if (streams.length === 0) { + this.eof = true; + return; + } + const stream = streams.shift(); + let chunk; + try { + chunk = stream.getBytes(); + } catch (reason) { + if (this._onError) { + this._onError(reason, stream.dict?.objId); + return; + } + throw reason; + } + const bufferLength = this.bufferLength; + const newLength = bufferLength + chunk.length; + const buffer = this.ensureBuffer(newLength); + buffer.set(chunk, bufferLength); + this.bufferLength = newLength; + } + getBaseStreams() { + const baseStreamsBuf = []; + for (const stream of this.streams) { + const baseStreams = stream.getBaseStreams(); + if (baseStreams) { + baseStreamsBuf.push(...baseStreams); + } + } + return baseStreamsBuf.length > 0 ? baseStreamsBuf : null; + } +} + +;// CONCATENATED MODULE: ./src/core/ascii_85_stream.js + + +class Ascii85Stream extends DecodeStream { + constructor(str, maybeLength) { + if (maybeLength) { + maybeLength *= 0.8; + } + super(maybeLength); + this.str = str; + this.dict = str.dict; + this.input = new Uint8Array(5); + } + readBlock() { + const TILDA_CHAR = 0x7e; + const Z_LOWER_CHAR = 0x7a; + const EOF = -1; + const str = this.str; + let c = str.getByte(); + while (isWhiteSpace(c)) { + c = str.getByte(); + } + if (c === EOF || c === TILDA_CHAR) { + this.eof = true; + return; + } + const bufferLength = this.bufferLength; + let buffer, i; + if (c === Z_LOWER_CHAR) { + buffer = this.ensureBuffer(bufferLength + 4); + for (i = 0; i < 4; ++i) { + buffer[bufferLength + i] = 0; + } + this.bufferLength += 4; + } else { + const input = this.input; + input[0] = c; + for (i = 1; i < 5; ++i) { + c = str.getByte(); + while (isWhiteSpace(c)) { + c = str.getByte(); + } + input[i] = c; + if (c === EOF || c === TILDA_CHAR) { + break; + } + } + buffer = this.ensureBuffer(bufferLength + i - 1); + this.bufferLength += i - 1; + if (i < 5) { + for (; i < 5; ++i) { + input[i] = 0x21 + 84; + } + this.eof = true; + } + let t = 0; + for (i = 0; i < 5; ++i) { + t = t * 85 + (input[i] - 0x21); + } + for (i = 3; i >= 0; --i) { + buffer[bufferLength + i] = t & 0xff; + t >>= 8; + } + } + } +} + +;// CONCATENATED MODULE: ./src/core/ascii_hex_stream.js + +class AsciiHexStream extends DecodeStream { + constructor(str, maybeLength) { + if (maybeLength) { + maybeLength *= 0.5; + } + super(maybeLength); + this.str = str; + this.dict = str.dict; + this.firstDigit = -1; + } + readBlock() { + const UPSTREAM_BLOCK_SIZE = 8000; + const bytes = this.str.getBytes(UPSTREAM_BLOCK_SIZE); + if (!bytes.length) { + this.eof = true; + return; + } + const maxDecodeLength = bytes.length + 1 >> 1; + const buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength); + let bufferLength = this.bufferLength; + let firstDigit = this.firstDigit; + for (const ch of bytes) { + let digit; + if (ch >= 0x30 && ch <= 0x39) { + digit = ch & 0x0f; + } else if (ch >= 0x41 && ch <= 0x46 || ch >= 0x61 && ch <= 0x66) { + digit = (ch & 0x0f) + 9; + } else if (ch === 0x3e) { + this.eof = true; + break; + } else { + continue; + } + if (firstDigit < 0) { + firstDigit = digit; + } else { + buffer[bufferLength++] = firstDigit << 4 | digit; + firstDigit = -1; + } + } + if (firstDigit >= 0 && this.eof) { + buffer[bufferLength++] = firstDigit << 4; + firstDigit = -1; + } + this.firstDigit = firstDigit; + this.bufferLength = bufferLength; + } +} + +;// CONCATENATED MODULE: ./src/core/ccitt.js + +const ccittEOL = -2; +const ccittEOF = -1; +const twoDimPass = 0; +const twoDimHoriz = 1; +const twoDimVert0 = 2; +const twoDimVertR1 = 3; +const twoDimVertL1 = 4; +const twoDimVertR2 = 5; +const twoDimVertL2 = 6; +const twoDimVertR3 = 7; +const twoDimVertL3 = 8; +const twoDimTable = [[-1, -1], [-1, -1], [7, twoDimVertL3], [7, twoDimVertR3], [6, twoDimVertL2], [6, twoDimVertL2], [6, twoDimVertR2], [6, twoDimVertR2], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [4, twoDimPass], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimHoriz], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertL1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [3, twoDimVertR1], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0], [1, twoDimVert0]]; +const whiteTable1 = [[-1, -1], [12, ccittEOL], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [11, 1792], [11, 1792], [12, 1984], [12, 2048], [12, 2112], [12, 2176], [12, 2240], [12, 2304], [11, 1856], [11, 1856], [11, 1920], [11, 1920], [12, 2368], [12, 2432], [12, 2496], [12, 2560]]; +const whiteTable2 = [[-1, -1], [-1, -1], [-1, -1], [-1, -1], [8, 29], [8, 29], [8, 30], [8, 30], [8, 45], [8, 45], [8, 46], [8, 46], [7, 22], [7, 22], [7, 22], [7, 22], [7, 23], [7, 23], [7, 23], [7, 23], [8, 47], [8, 47], [8, 48], [8, 48], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [7, 20], [7, 20], [7, 20], [7, 20], [8, 33], [8, 33], [8, 34], [8, 34], [8, 35], [8, 35], [8, 36], [8, 36], [8, 37], [8, 37], [8, 38], [8, 38], [7, 19], [7, 19], [7, 19], [7, 19], [8, 31], [8, 31], [8, 32], [8, 32], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [8, 53], [8, 53], [8, 54], [8, 54], [7, 26], [7, 26], [7, 26], [7, 26], [8, 39], [8, 39], [8, 40], [8, 40], [8, 41], [8, 41], [8, 42], [8, 42], [8, 43], [8, 43], [8, 44], [8, 44], [7, 21], [7, 21], [7, 21], [7, 21], [7, 28], [7, 28], [7, 28], [7, 28], [8, 61], [8, 61], [8, 62], [8, 62], [8, 63], [8, 63], [8, 0], [8, 0], [8, 320], [8, 320], [8, 384], [8, 384], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [7, 27], [7, 27], [7, 27], [7, 27], [8, 59], [8, 59], [8, 60], [8, 60], [9, 1472], [9, 1536], [9, 1600], [9, 1728], [7, 18], [7, 18], [7, 18], [7, 18], [7, 24], [7, 24], [7, 24], [7, 24], [8, 49], [8, 49], [8, 50], [8, 50], [8, 51], [8, 51], [8, 52], [8, 52], [7, 25], [7, 25], [7, 25], [7, 25], [8, 55], [8, 55], [8, 56], [8, 56], [8, 57], [8, 57], [8, 58], [8, 58], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [8, 448], [8, 448], [8, 512], [8, 512], [9, 704], [9, 768], [8, 640], [8, 640], [8, 576], [8, 576], [9, 832], [9, 896], [9, 960], [9, 1024], [9, 1088], [9, 1152], [9, 1216], [9, 1280], [9, 1344], [9, 1408], [7, 256], [7, 256], [7, 256], [7, 256], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7]]; +const blackTable1 = [[-1, -1], [-1, -1], [12, ccittEOL], [12, ccittEOL], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [11, 1792], [11, 1792], [11, 1792], [11, 1792], [12, 1984], [12, 1984], [12, 2048], [12, 2048], [12, 2112], [12, 2112], [12, 2176], [12, 2176], [12, 2240], [12, 2240], [12, 2304], [12, 2304], [11, 1856], [11, 1856], [11, 1856], [11, 1856], [11, 1920], [11, 1920], [11, 1920], [11, 1920], [12, 2368], [12, 2368], [12, 2432], [12, 2432], [12, 2496], [12, 2496], [12, 2560], [12, 2560], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [12, 52], [12, 52], [13, 640], [13, 704], [13, 768], [13, 832], [12, 55], [12, 55], [12, 56], [12, 56], [13, 1280], [13, 1344], [13, 1408], [13, 1472], [12, 59], [12, 59], [12, 60], [12, 60], [13, 1536], [13, 1600], [11, 24], [11, 24], [11, 24], [11, 24], [11, 25], [11, 25], [11, 25], [11, 25], [13, 1664], [13, 1728], [12, 320], [12, 320], [12, 384], [12, 384], [12, 448], [12, 448], [13, 512], [13, 576], [12, 53], [12, 53], [12, 54], [12, 54], [13, 896], [13, 960], [13, 1024], [13, 1088], [13, 1152], [13, 1216], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64]]; +const blackTable2 = [[8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [11, 23], [11, 23], [12, 50], [12, 51], [12, 44], [12, 45], [12, 46], [12, 47], [12, 57], [12, 58], [12, 61], [12, 256], [10, 16], [10, 16], [10, 16], [10, 16], [10, 17], [10, 17], [10, 17], [10, 17], [12, 48], [12, 49], [12, 62], [12, 63], [12, 30], [12, 31], [12, 32], [12, 33], [12, 40], [12, 41], [11, 22], [11, 22], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [12, 128], [12, 192], [12, 26], [12, 27], [12, 28], [12, 29], [11, 19], [11, 19], [11, 20], [11, 20], [12, 34], [12, 35], [12, 36], [12, 37], [12, 38], [12, 39], [11, 21], [11, 21], [12, 42], [12, 43], [10, 0], [10, 0], [10, 0], [10, 0], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12]]; +const blackTable3 = [[-1, -1], [-1, -1], [-1, -1], [-1, -1], [6, 9], [6, 8], [5, 7], [5, 7], [4, 6], [4, 6], [4, 6], [4, 6], [4, 5], [4, 5], [4, 5], [4, 5], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2]]; +class CCITTFaxDecoder { + constructor(source, options = {}) { + if (!source || typeof source.next !== "function") { + throw new Error('CCITTFaxDecoder - invalid "source" parameter.'); + } + this.source = source; + this.eof = false; + this.encoding = options.K || 0; + this.eoline = options.EndOfLine || false; + this.byteAlign = options.EncodedByteAlign || false; + this.columns = options.Columns || 1728; + this.rows = options.Rows || 0; + this.eoblock = options.EndOfBlock ?? true; + this.black = options.BlackIs1 || false; + this.codingLine = new Uint32Array(this.columns + 1); + this.refLine = new Uint32Array(this.columns + 2); + this.codingLine[0] = this.columns; + this.codingPos = 0; + this.row = 0; + this.nextLine2D = this.encoding < 0; + this.inputBits = 0; + this.inputBuf = 0; + this.outputBits = 0; + this.rowsDone = false; + let code1; + while ((code1 = this._lookBits(12)) === 0) { + this._eatBits(1); + } + if (code1 === 1) { + this._eatBits(12); + } + if (this.encoding > 0) { + this.nextLine2D = !this._lookBits(1); + this._eatBits(1); + } + } + readNextChar() { + if (this.eof) { + return -1; + } + const refLine = this.refLine; + const codingLine = this.codingLine; + const columns = this.columns; + let refPos, blackPixels, bits, i; + if (this.outputBits === 0) { + if (this.rowsDone) { + this.eof = true; + } + if (this.eof) { + return -1; + } + this.err = false; + let code1, code2, code3; + if (this.nextLine2D) { + for (i = 0; codingLine[i] < columns; ++i) { + refLine[i] = codingLine[i]; + } + refLine[i++] = columns; + refLine[i] = columns; + codingLine[0] = 0; + this.codingPos = 0; + refPos = 0; + blackPixels = 0; + while (codingLine[this.codingPos] < columns) { + code1 = this._getTwoDimCode(); + switch (code1) { + case twoDimPass: + this._addPixels(refLine[refPos + 1], blackPixels); + if (refLine[refPos + 1] < columns) { + refPos += 2; + } + break; + case twoDimHoriz: + code1 = code2 = 0; + if (blackPixels) { + do { + code1 += code3 = this._getBlackCode(); + } while (code3 >= 64); + do { + code2 += code3 = this._getWhiteCode(); + } while (code3 >= 64); + } else { + do { + code1 += code3 = this._getWhiteCode(); + } while (code3 >= 64); + do { + code2 += code3 = this._getBlackCode(); + } while (code3 >= 64); + } + this._addPixels(codingLine[this.codingPos] + code1, blackPixels); + if (codingLine[this.codingPos] < columns) { + this._addPixels(codingLine[this.codingPos] + code2, blackPixels ^ 1); + } + while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { + refPos += 2; + } + break; + case twoDimVertR3: + this._addPixels(refLine[refPos] + 3, blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + ++refPos; + while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { + refPos += 2; + } + } + break; + case twoDimVertR2: + this._addPixels(refLine[refPos] + 2, blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + ++refPos; + while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { + refPos += 2; + } + } + break; + case twoDimVertR1: + this._addPixels(refLine[refPos] + 1, blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + ++refPos; + while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { + refPos += 2; + } + } + break; + case twoDimVert0: + this._addPixels(refLine[refPos], blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + ++refPos; + while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { + refPos += 2; + } + } + break; + case twoDimVertL3: + this._addPixelsNeg(refLine[refPos] - 3, blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + if (refPos > 0) { + --refPos; + } else { + ++refPos; + } + while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { + refPos += 2; + } + } + break; + case twoDimVertL2: + this._addPixelsNeg(refLine[refPos] - 2, blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + if (refPos > 0) { + --refPos; + } else { + ++refPos; + } + while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { + refPos += 2; + } + } + break; + case twoDimVertL1: + this._addPixelsNeg(refLine[refPos] - 1, blackPixels); + blackPixels ^= 1; + if (codingLine[this.codingPos] < columns) { + if (refPos > 0) { + --refPos; + } else { + ++refPos; + } + while (refLine[refPos] <= codingLine[this.codingPos] && refLine[refPos] < columns) { + refPos += 2; + } + } + break; + case ccittEOF: + this._addPixels(columns, 0); + this.eof = true; + break; + default: + info("bad 2d code"); + this._addPixels(columns, 0); + this.err = true; + } + } + } else { + codingLine[0] = 0; + this.codingPos = 0; + blackPixels = 0; + while (codingLine[this.codingPos] < columns) { + code1 = 0; + if (blackPixels) { + do { + code1 += code3 = this._getBlackCode(); + } while (code3 >= 64); + } else { + do { + code1 += code3 = this._getWhiteCode(); + } while (code3 >= 64); + } + this._addPixels(codingLine[this.codingPos] + code1, blackPixels); + blackPixels ^= 1; + } + } + let gotEOL = false; + if (this.byteAlign) { + this.inputBits &= ~7; + } + if (!this.eoblock && this.row === this.rows - 1) { + this.rowsDone = true; + } else { + code1 = this._lookBits(12); + if (this.eoline) { + while (code1 !== ccittEOF && code1 !== 1) { + this._eatBits(1); + code1 = this._lookBits(12); + } + } else { + while (code1 === 0) { + this._eatBits(1); + code1 = this._lookBits(12); + } + } + if (code1 === 1) { + this._eatBits(12); + gotEOL = true; + } else if (code1 === ccittEOF) { + this.eof = true; + } + } + if (!this.eof && this.encoding > 0 && !this.rowsDone) { + this.nextLine2D = !this._lookBits(1); + this._eatBits(1); + } + if (this.eoblock && gotEOL && this.byteAlign) { + code1 = this._lookBits(12); + if (code1 === 1) { + this._eatBits(12); + if (this.encoding > 0) { + this._lookBits(1); + this._eatBits(1); + } + if (this.encoding >= 0) { + for (i = 0; i < 4; ++i) { + code1 = this._lookBits(12); + if (code1 !== 1) { + info("bad rtc code: " + code1); + } + this._eatBits(12); + if (this.encoding > 0) { + this._lookBits(1); + this._eatBits(1); + } + } + } + this.eof = true; + } + } else if (this.err && this.eoline) { + while (true) { + code1 = this._lookBits(13); + if (code1 === ccittEOF) { + this.eof = true; + return -1; + } + if (code1 >> 1 === 1) { + break; + } + this._eatBits(1); + } + this._eatBits(12); + if (this.encoding > 0) { + this._eatBits(1); + this.nextLine2D = !(code1 & 1); + } + } + this.outputBits = codingLine[0] > 0 ? codingLine[this.codingPos = 0] : codingLine[this.codingPos = 1]; + this.row++; + } + let c; + if (this.outputBits >= 8) { + c = this.codingPos & 1 ? 0 : 0xff; + this.outputBits -= 8; + if (this.outputBits === 0 && codingLine[this.codingPos] < columns) { + this.codingPos++; + this.outputBits = codingLine[this.codingPos] - codingLine[this.codingPos - 1]; + } + } else { + bits = 8; + c = 0; + do { + if (typeof this.outputBits !== "number") { + throw new FormatError('Invalid /CCITTFaxDecode data, "outputBits" must be a number.'); + } + if (this.outputBits > bits) { + c <<= bits; + if (!(this.codingPos & 1)) { + c |= 0xff >> 8 - bits; + } + this.outputBits -= bits; + bits = 0; + } else { + c <<= this.outputBits; + if (!(this.codingPos & 1)) { + c |= 0xff >> 8 - this.outputBits; + } + bits -= this.outputBits; + this.outputBits = 0; + if (codingLine[this.codingPos] < columns) { + this.codingPos++; + this.outputBits = codingLine[this.codingPos] - codingLine[this.codingPos - 1]; + } else if (bits > 0) { + c <<= bits; + bits = 0; + } + } + } while (bits); + } + if (this.black) { + c ^= 0xff; + } + return c; + } + _addPixels(a1, blackPixels) { + const codingLine = this.codingLine; + let codingPos = this.codingPos; + if (a1 > codingLine[codingPos]) { + if (a1 > this.columns) { + info("row is wrong length"); + this.err = true; + a1 = this.columns; + } + if (codingPos & 1 ^ blackPixels) { + ++codingPos; + } + codingLine[codingPos] = a1; + } + this.codingPos = codingPos; + } + _addPixelsNeg(a1, blackPixels) { + const codingLine = this.codingLine; + let codingPos = this.codingPos; + if (a1 > codingLine[codingPos]) { + if (a1 > this.columns) { + info("row is wrong length"); + this.err = true; + a1 = this.columns; + } + if (codingPos & 1 ^ blackPixels) { + ++codingPos; + } + codingLine[codingPos] = a1; + } else if (a1 < codingLine[codingPos]) { + if (a1 < 0) { + info("invalid code"); + this.err = true; + a1 = 0; + } + while (codingPos > 0 && a1 < codingLine[codingPos - 1]) { + --codingPos; + } + codingLine[codingPos] = a1; + } + this.codingPos = codingPos; + } + _findTableCode(start, end, table, limit) { + const limitValue = limit || 0; + for (let i = start; i <= end; ++i) { + let code = this._lookBits(i); + if (code === ccittEOF) { + return [true, 1, false]; + } + if (i < end) { + code <<= end - i; + } + if (!limitValue || code >= limitValue) { + const p = table[code - limitValue]; + if (p[0] === i) { + this._eatBits(i); + return [true, p[1], true]; + } + } + } + return [false, 0, false]; + } + _getTwoDimCode() { + let code = 0; + let p; + if (this.eoblock) { + code = this._lookBits(7); + p = twoDimTable[code]; + if (p?.[0] > 0) { + this._eatBits(p[0]); + return p[1]; + } + } else { + const result = this._findTableCode(1, 7, twoDimTable); + if (result[0] && result[2]) { + return result[1]; + } + } + info("Bad two dim code"); + return ccittEOF; + } + _getWhiteCode() { + let code = 0; + let p; + if (this.eoblock) { + code = this._lookBits(12); + if (code === ccittEOF) { + return 1; + } + p = code >> 5 === 0 ? whiteTable1[code] : whiteTable2[code >> 3]; + if (p[0] > 0) { + this._eatBits(p[0]); + return p[1]; + } + } else { + let result = this._findTableCode(1, 9, whiteTable2); + if (result[0]) { + return result[1]; + } + result = this._findTableCode(11, 12, whiteTable1); + if (result[0]) { + return result[1]; + } + } + info("bad white code"); + this._eatBits(1); + return 1; + } + _getBlackCode() { + let code, p; + if (this.eoblock) { + code = this._lookBits(13); + if (code === ccittEOF) { + return 1; + } + if (code >> 7 === 0) { + p = blackTable1[code]; + } else if (code >> 9 === 0 && code >> 7 !== 0) { + p = blackTable2[(code >> 1) - 64]; + } else { + p = blackTable3[code >> 7]; + } + if (p[0] > 0) { + this._eatBits(p[0]); + return p[1]; + } + } else { + let result = this._findTableCode(2, 6, blackTable3); + if (result[0]) { + return result[1]; + } + result = this._findTableCode(7, 12, blackTable2, 64); + if (result[0]) { + return result[1]; + } + result = this._findTableCode(10, 13, blackTable1); + if (result[0]) { + return result[1]; + } + } + info("bad black code"); + this._eatBits(1); + return 1; + } + _lookBits(n) { + let c; + while (this.inputBits < n) { + if ((c = this.source.next()) === -1) { + if (this.inputBits === 0) { + return ccittEOF; + } + return this.inputBuf << n - this.inputBits & 0xffff >> 16 - n; + } + this.inputBuf = this.inputBuf << 8 | c; + this.inputBits += 8; + } + return this.inputBuf >> this.inputBits - n & 0xffff >> 16 - n; + } + _eatBits(n) { + if ((this.inputBits -= n) < 0) { + this.inputBits = 0; + } + } +} + +;// CONCATENATED MODULE: ./src/core/ccitt_stream.js + + + +class CCITTFaxStream extends DecodeStream { + constructor(str, maybeLength, params) { + super(maybeLength); + this.str = str; + this.dict = str.dict; + if (!(params instanceof Dict)) { + params = Dict.empty; + } + const source = { + next() { + return str.getByte(); + } + }; + this.ccittFaxDecoder = new CCITTFaxDecoder(source, { + K: params.get("K"), + EndOfLine: params.get("EndOfLine"), + EncodedByteAlign: params.get("EncodedByteAlign"), + Columns: params.get("Columns"), + Rows: params.get("Rows"), + EndOfBlock: params.get("EndOfBlock"), + BlackIs1: params.get("BlackIs1") + }); + } + readBlock() { + while (!this.eof) { + const c = this.ccittFaxDecoder.readNextChar(); + if (c === -1) { + this.eof = true; + return; + } + this.ensureBuffer(this.bufferLength + 1); + this.buffer[this.bufferLength++] = c; + } + } +} + +;// CONCATENATED MODULE: ./src/core/flate_stream.js + + +const codeLenCodeMap = new Int32Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]); +const lengthDecode = new Int32Array([0x00003, 0x00004, 0x00005, 0x00006, 0x00007, 0x00008, 0x00009, 0x0000a, 0x1000b, 0x1000d, 0x1000f, 0x10011, 0x20013, 0x20017, 0x2001b, 0x2001f, 0x30023, 0x3002b, 0x30033, 0x3003b, 0x40043, 0x40053, 0x40063, 0x40073, 0x50083, 0x500a3, 0x500c3, 0x500e3, 0x00102, 0x00102, 0x00102]); +const distDecode = new Int32Array([0x00001, 0x00002, 0x00003, 0x00004, 0x10005, 0x10007, 0x20009, 0x2000d, 0x30011, 0x30019, 0x40021, 0x40031, 0x50041, 0x50061, 0x60081, 0x600c1, 0x70101, 0x70181, 0x80201, 0x80301, 0x90401, 0x90601, 0xa0801, 0xa0c01, 0xb1001, 0xb1801, 0xc2001, 0xc3001, 0xd4001, 0xd6001]); +const fixedLitCodeTab = [new Int32Array([0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c0, 0x70108, 0x80060, 0x80020, 0x900a0, 0x80000, 0x80080, 0x80040, 0x900e0, 0x70104, 0x80058, 0x80018, 0x90090, 0x70114, 0x80078, 0x80038, 0x900d0, 0x7010c, 0x80068, 0x80028, 0x900b0, 0x80008, 0x80088, 0x80048, 0x900f0, 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c8, 0x7010a, 0x80064, 0x80024, 0x900a8, 0x80004, 0x80084, 0x80044, 0x900e8, 0x70106, 0x8005c, 0x8001c, 0x90098, 0x70116, 0x8007c, 0x8003c, 0x900d8, 0x7010e, 0x8006c, 0x8002c, 0x900b8, 0x8000c, 0x8008c, 0x8004c, 0x900f8, 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c4, 0x70109, 0x80062, 0x80022, 0x900a4, 0x80002, 0x80082, 0x80042, 0x900e4, 0x70105, 0x8005a, 0x8001a, 0x90094, 0x70115, 0x8007a, 0x8003a, 0x900d4, 0x7010d, 0x8006a, 0x8002a, 0x900b4, 0x8000a, 0x8008a, 0x8004a, 0x900f4, 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cc, 0x7010b, 0x80066, 0x80026, 0x900ac, 0x80006, 0x80086, 0x80046, 0x900ec, 0x70107, 0x8005e, 0x8001e, 0x9009c, 0x70117, 0x8007e, 0x8003e, 0x900dc, 0x7010f, 0x8006e, 0x8002e, 0x900bc, 0x8000e, 0x8008e, 0x8004e, 0x900fc, 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c2, 0x70108, 0x80061, 0x80021, 0x900a2, 0x80001, 0x80081, 0x80041, 0x900e2, 0x70104, 0x80059, 0x80019, 0x90092, 0x70114, 0x80079, 0x80039, 0x900d2, 0x7010c, 0x80069, 0x80029, 0x900b2, 0x80009, 0x80089, 0x80049, 0x900f2, 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900ca, 0x7010a, 0x80065, 0x80025, 0x900aa, 0x80005, 0x80085, 0x80045, 0x900ea, 0x70106, 0x8005d, 0x8001d, 0x9009a, 0x70116, 0x8007d, 0x8003d, 0x900da, 0x7010e, 0x8006d, 0x8002d, 0x900ba, 0x8000d, 0x8008d, 0x8004d, 0x900fa, 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c6, 0x70109, 0x80063, 0x80023, 0x900a6, 0x80003, 0x80083, 0x80043, 0x900e6, 0x70105, 0x8005b, 0x8001b, 0x90096, 0x70115, 0x8007b, 0x8003b, 0x900d6, 0x7010d, 0x8006b, 0x8002b, 0x900b6, 0x8000b, 0x8008b, 0x8004b, 0x900f6, 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900ce, 0x7010b, 0x80067, 0x80027, 0x900ae, 0x80007, 0x80087, 0x80047, 0x900ee, 0x70107, 0x8005f, 0x8001f, 0x9009e, 0x70117, 0x8007f, 0x8003f, 0x900de, 0x7010f, 0x8006f, 0x8002f, 0x900be, 0x8000f, 0x8008f, 0x8004f, 0x900fe, 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c1, 0x70108, 0x80060, 0x80020, 0x900a1, 0x80000, 0x80080, 0x80040, 0x900e1, 0x70104, 0x80058, 0x80018, 0x90091, 0x70114, 0x80078, 0x80038, 0x900d1, 0x7010c, 0x80068, 0x80028, 0x900b1, 0x80008, 0x80088, 0x80048, 0x900f1, 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c9, 0x7010a, 0x80064, 0x80024, 0x900a9, 0x80004, 0x80084, 0x80044, 0x900e9, 0x70106, 0x8005c, 0x8001c, 0x90099, 0x70116, 0x8007c, 0x8003c, 0x900d9, 0x7010e, 0x8006c, 0x8002c, 0x900b9, 0x8000c, 0x8008c, 0x8004c, 0x900f9, 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c5, 0x70109, 0x80062, 0x80022, 0x900a5, 0x80002, 0x80082, 0x80042, 0x900e5, 0x70105, 0x8005a, 0x8001a, 0x90095, 0x70115, 0x8007a, 0x8003a, 0x900d5, 0x7010d, 0x8006a, 0x8002a, 0x900b5, 0x8000a, 0x8008a, 0x8004a, 0x900f5, 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cd, 0x7010b, 0x80066, 0x80026, 0x900ad, 0x80006, 0x80086, 0x80046, 0x900ed, 0x70107, 0x8005e, 0x8001e, 0x9009d, 0x70117, 0x8007e, 0x8003e, 0x900dd, 0x7010f, 0x8006e, 0x8002e, 0x900bd, 0x8000e, 0x8008e, 0x8004e, 0x900fd, 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c3, 0x70108, 0x80061, 0x80021, 0x900a3, 0x80001, 0x80081, 0x80041, 0x900e3, 0x70104, 0x80059, 0x80019, 0x90093, 0x70114, 0x80079, 0x80039, 0x900d3, 0x7010c, 0x80069, 0x80029, 0x900b3, 0x80009, 0x80089, 0x80049, 0x900f3, 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900cb, 0x7010a, 0x80065, 0x80025, 0x900ab, 0x80005, 0x80085, 0x80045, 0x900eb, 0x70106, 0x8005d, 0x8001d, 0x9009b, 0x70116, 0x8007d, 0x8003d, 0x900db, 0x7010e, 0x8006d, 0x8002d, 0x900bb, 0x8000d, 0x8008d, 0x8004d, 0x900fb, 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c7, 0x70109, 0x80063, 0x80023, 0x900a7, 0x80003, 0x80083, 0x80043, 0x900e7, 0x70105, 0x8005b, 0x8001b, 0x90097, 0x70115, 0x8007b, 0x8003b, 0x900d7, 0x7010d, 0x8006b, 0x8002b, 0x900b7, 0x8000b, 0x8008b, 0x8004b, 0x900f7, 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900cf, 0x7010b, 0x80067, 0x80027, 0x900af, 0x80007, 0x80087, 0x80047, 0x900ef, 0x70107, 0x8005f, 0x8001f, 0x9009f, 0x70117, 0x8007f, 0x8003f, 0x900df, 0x7010f, 0x8006f, 0x8002f, 0x900bf, 0x8000f, 0x8008f, 0x8004f, 0x900ff]), 9]; +const fixedDistCodeTab = [new Int32Array([0x50000, 0x50010, 0x50008, 0x50018, 0x50004, 0x50014, 0x5000c, 0x5001c, 0x50002, 0x50012, 0x5000a, 0x5001a, 0x50006, 0x50016, 0x5000e, 0x00000, 0x50001, 0x50011, 0x50009, 0x50019, 0x50005, 0x50015, 0x5000d, 0x5001d, 0x50003, 0x50013, 0x5000b, 0x5001b, 0x50007, 0x50017, 0x5000f, 0x00000]), 5]; +class FlateStream extends DecodeStream { + constructor(str, maybeLength) { + super(maybeLength); + this.str = str; + this.dict = str.dict; + const cmf = str.getByte(); + const flg = str.getByte(); + if (cmf === -1 || flg === -1) { + throw new FormatError(`Invalid header in flate stream: ${cmf}, ${flg}`); + } + if ((cmf & 0x0f) !== 0x08) { + throw new FormatError(`Unknown compression method in flate stream: ${cmf}, ${flg}`); + } + if (((cmf << 8) + flg) % 31 !== 0) { + throw new FormatError(`Bad FCHECK in flate stream: ${cmf}, ${flg}`); + } + if (flg & 0x20) { + throw new FormatError(`FDICT bit set in flate stream: ${cmf}, ${flg}`); + } + this.codeSize = 0; + this.codeBuf = 0; + } + getBits(bits) { + const str = this.str; + let codeSize = this.codeSize; + let codeBuf = this.codeBuf; + let b; + while (codeSize < bits) { + if ((b = str.getByte()) === -1) { + throw new FormatError("Bad encoding in flate stream"); + } + codeBuf |= b << codeSize; + codeSize += 8; + } + b = codeBuf & (1 << bits) - 1; + this.codeBuf = codeBuf >> bits; + this.codeSize = codeSize -= bits; + return b; + } + getCode(table) { + const str = this.str; + const codes = table[0]; + const maxLen = table[1]; + let codeSize = this.codeSize; + let codeBuf = this.codeBuf; + let b; + while (codeSize < maxLen) { + if ((b = str.getByte()) === -1) { + break; + } + codeBuf |= b << codeSize; + codeSize += 8; + } + const code = codes[codeBuf & (1 << maxLen) - 1]; + const codeLen = code >> 16; + const codeVal = code & 0xffff; + if (codeLen < 1 || codeSize < codeLen) { + throw new FormatError("Bad encoding in flate stream"); + } + this.codeBuf = codeBuf >> codeLen; + this.codeSize = codeSize - codeLen; + return codeVal; + } + generateHuffmanTable(lengths) { + const n = lengths.length; + let maxLen = 0; + let i; + for (i = 0; i < n; ++i) { + if (lengths[i] > maxLen) { + maxLen = lengths[i]; + } + } + const size = 1 << maxLen; + const codes = new Int32Array(size); + for (let len = 1, code = 0, skip = 2; len <= maxLen; ++len, code <<= 1, skip <<= 1) { + for (let val = 0; val < n; ++val) { + if (lengths[val] === len) { + let code2 = 0; + let t = code; + for (i = 0; i < len; ++i) { + code2 = code2 << 1 | t & 1; + t >>= 1; + } + for (i = code2; i < size; i += skip) { + codes[i] = len << 16 | val; + } + ++code; + } + } + } + return [codes, maxLen]; + } + #endsStreamOnError(err) { + info(err); + this.eof = true; + } + readBlock() { + let buffer, len; + const str = this.str; + let hdr = this.getBits(3); + if (hdr & 1) { + this.eof = true; + } + hdr >>= 1; + if (hdr === 0) { + let b; + if ((b = str.getByte()) === -1) { + this.#endsStreamOnError("Bad block header in flate stream"); + return; + } + let blockLen = b; + if ((b = str.getByte()) === -1) { + this.#endsStreamOnError("Bad block header in flate stream"); + return; + } + blockLen |= b << 8; + if ((b = str.getByte()) === -1) { + this.#endsStreamOnError("Bad block header in flate stream"); + return; + } + let check = b; + if ((b = str.getByte()) === -1) { + this.#endsStreamOnError("Bad block header in flate stream"); + return; + } + check |= b << 8; + if (check !== (~blockLen & 0xffff) && (blockLen !== 0 || check !== 0)) { + throw new FormatError("Bad uncompressed block length in flate stream"); + } + this.codeBuf = 0; + this.codeSize = 0; + const bufferLength = this.bufferLength, + end = bufferLength + blockLen; + buffer = this.ensureBuffer(end); + this.bufferLength = end; + if (blockLen === 0) { + if (str.peekByte() === -1) { + this.eof = true; + } + } else { + const block = str.getBytes(blockLen); + buffer.set(block, bufferLength); + if (block.length < blockLen) { + this.eof = true; + } + } + return; + } + let litCodeTable; + let distCodeTable; + if (hdr === 1) { + litCodeTable = fixedLitCodeTab; + distCodeTable = fixedDistCodeTab; + } else if (hdr === 2) { + const numLitCodes = this.getBits(5) + 257; + const numDistCodes = this.getBits(5) + 1; + const numCodeLenCodes = this.getBits(4) + 4; + const codeLenCodeLengths = new Uint8Array(codeLenCodeMap.length); + let i; + for (i = 0; i < numCodeLenCodes; ++i) { + codeLenCodeLengths[codeLenCodeMap[i]] = this.getBits(3); + } + const codeLenCodeTab = this.generateHuffmanTable(codeLenCodeLengths); + len = 0; + i = 0; + const codes = numLitCodes + numDistCodes; + const codeLengths = new Uint8Array(codes); + let bitsLength, bitsOffset, what; + while (i < codes) { + const code = this.getCode(codeLenCodeTab); + if (code === 16) { + bitsLength = 2; + bitsOffset = 3; + what = len; + } else if (code === 17) { + bitsLength = 3; + bitsOffset = 3; + what = len = 0; + } else if (code === 18) { + bitsLength = 7; + bitsOffset = 11; + what = len = 0; + } else { + codeLengths[i++] = len = code; + continue; + } + let repeatLength = this.getBits(bitsLength) + bitsOffset; + while (repeatLength-- > 0) { + codeLengths[i++] = what; + } + } + litCodeTable = this.generateHuffmanTable(codeLengths.subarray(0, numLitCodes)); + distCodeTable = this.generateHuffmanTable(codeLengths.subarray(numLitCodes, codes)); + } else { + throw new FormatError("Unknown block type in flate stream"); + } + buffer = this.buffer; + let limit = buffer ? buffer.length : 0; + let pos = this.bufferLength; + while (true) { + let code1 = this.getCode(litCodeTable); + if (code1 < 256) { + if (pos + 1 >= limit) { + buffer = this.ensureBuffer(pos + 1); + limit = buffer.length; + } + buffer[pos++] = code1; + continue; + } + if (code1 === 256) { + this.bufferLength = pos; + return; + } + code1 -= 257; + code1 = lengthDecode[code1]; + let code2 = code1 >> 16; + if (code2 > 0) { + code2 = this.getBits(code2); + } + len = (code1 & 0xffff) + code2; + code1 = this.getCode(distCodeTable); + code1 = distDecode[code1]; + code2 = code1 >> 16; + if (code2 > 0) { + code2 = this.getBits(code2); + } + const dist = (code1 & 0xffff) + code2; + if (pos + len >= limit) { + buffer = this.ensureBuffer(pos + len); + limit = buffer.length; + } + for (let k = 0; k < len; ++k, ++pos) { + buffer[pos] = buffer[pos - dist]; + } + } + } +} + +;// CONCATENATED MODULE: ./src/core/arithmetic_decoder.js +const QeTable = [{ + qe: 0x5601, + nmps: 1, + nlps: 1, + switchFlag: 1 +}, { + qe: 0x3401, + nmps: 2, + nlps: 6, + switchFlag: 0 +}, { + qe: 0x1801, + nmps: 3, + nlps: 9, + switchFlag: 0 +}, { + qe: 0x0ac1, + nmps: 4, + nlps: 12, + switchFlag: 0 +}, { + qe: 0x0521, + nmps: 5, + nlps: 29, + switchFlag: 0 +}, { + qe: 0x0221, + nmps: 38, + nlps: 33, + switchFlag: 0 +}, { + qe: 0x5601, + nmps: 7, + nlps: 6, + switchFlag: 1 +}, { + qe: 0x5401, + nmps: 8, + nlps: 14, + switchFlag: 0 +}, { + qe: 0x4801, + nmps: 9, + nlps: 14, + switchFlag: 0 +}, { + qe: 0x3801, + nmps: 10, + nlps: 14, + switchFlag: 0 +}, { + qe: 0x3001, + nmps: 11, + nlps: 17, + switchFlag: 0 +}, { + qe: 0x2401, + nmps: 12, + nlps: 18, + switchFlag: 0 +}, { + qe: 0x1c01, + nmps: 13, + nlps: 20, + switchFlag: 0 +}, { + qe: 0x1601, + nmps: 29, + nlps: 21, + switchFlag: 0 +}, { + qe: 0x5601, + nmps: 15, + nlps: 14, + switchFlag: 1 +}, { + qe: 0x5401, + nmps: 16, + nlps: 14, + switchFlag: 0 +}, { + qe: 0x5101, + nmps: 17, + nlps: 15, + switchFlag: 0 +}, { + qe: 0x4801, + nmps: 18, + nlps: 16, + switchFlag: 0 +}, { + qe: 0x3801, + nmps: 19, + nlps: 17, + switchFlag: 0 +}, { + qe: 0x3401, + nmps: 20, + nlps: 18, + switchFlag: 0 +}, { + qe: 0x3001, + nmps: 21, + nlps: 19, + switchFlag: 0 +}, { + qe: 0x2801, + nmps: 22, + nlps: 19, + switchFlag: 0 +}, { + qe: 0x2401, + nmps: 23, + nlps: 20, + switchFlag: 0 +}, { + qe: 0x2201, + nmps: 24, + nlps: 21, + switchFlag: 0 +}, { + qe: 0x1c01, + nmps: 25, + nlps: 22, + switchFlag: 0 +}, { + qe: 0x1801, + nmps: 26, + nlps: 23, + switchFlag: 0 +}, { + qe: 0x1601, + nmps: 27, + nlps: 24, + switchFlag: 0 +}, { + qe: 0x1401, + nmps: 28, + nlps: 25, + switchFlag: 0 +}, { + qe: 0x1201, + nmps: 29, + nlps: 26, + switchFlag: 0 +}, { + qe: 0x1101, + nmps: 30, + nlps: 27, + switchFlag: 0 +}, { + qe: 0x0ac1, + nmps: 31, + nlps: 28, + switchFlag: 0 +}, { + qe: 0x09c1, + nmps: 32, + nlps: 29, + switchFlag: 0 +}, { + qe: 0x08a1, + nmps: 33, + nlps: 30, + switchFlag: 0 +}, { + qe: 0x0521, + nmps: 34, + nlps: 31, + switchFlag: 0 +}, { + qe: 0x0441, + nmps: 35, + nlps: 32, + switchFlag: 0 +}, { + qe: 0x02a1, + nmps: 36, + nlps: 33, + switchFlag: 0 +}, { + qe: 0x0221, + nmps: 37, + nlps: 34, + switchFlag: 0 +}, { + qe: 0x0141, + nmps: 38, + nlps: 35, + switchFlag: 0 +}, { + qe: 0x0111, + nmps: 39, + nlps: 36, + switchFlag: 0 +}, { + qe: 0x0085, + nmps: 40, + nlps: 37, + switchFlag: 0 +}, { + qe: 0x0049, + nmps: 41, + nlps: 38, + switchFlag: 0 +}, { + qe: 0x0025, + nmps: 42, + nlps: 39, + switchFlag: 0 +}, { + qe: 0x0015, + nmps: 43, + nlps: 40, + switchFlag: 0 +}, { + qe: 0x0009, + nmps: 44, + nlps: 41, + switchFlag: 0 +}, { + qe: 0x0005, + nmps: 45, + nlps: 42, + switchFlag: 0 +}, { + qe: 0x0001, + nmps: 45, + nlps: 43, + switchFlag: 0 +}, { + qe: 0x5601, + nmps: 46, + nlps: 46, + switchFlag: 0 +}]; +class ArithmeticDecoder { + constructor(data, start, end) { + this.data = data; + this.bp = start; + this.dataEnd = end; + this.chigh = data[start]; + this.clow = 0; + this.byteIn(); + this.chigh = this.chigh << 7 & 0xffff | this.clow >> 9 & 0x7f; + this.clow = this.clow << 7 & 0xffff; + this.ct -= 7; + this.a = 0x8000; + } + byteIn() { + const data = this.data; + let bp = this.bp; + if (data[bp] === 0xff) { + if (data[bp + 1] > 0x8f) { + this.clow += 0xff00; + this.ct = 8; + } else { + bp++; + this.clow += data[bp] << 9; + this.ct = 7; + this.bp = bp; + } + } else { + bp++; + this.clow += bp < this.dataEnd ? data[bp] << 8 : 0xff00; + this.ct = 8; + this.bp = bp; + } + if (this.clow > 0xffff) { + this.chigh += this.clow >> 16; + this.clow &= 0xffff; + } + } + readBit(contexts, pos) { + let cx_index = contexts[pos] >> 1, + cx_mps = contexts[pos] & 1; + const qeTableIcx = QeTable[cx_index]; + const qeIcx = qeTableIcx.qe; + let d; + let a = this.a - qeIcx; + if (this.chigh < qeIcx) { + if (a < qeIcx) { + a = qeIcx; + d = cx_mps; + cx_index = qeTableIcx.nmps; + } else { + a = qeIcx; + d = 1 ^ cx_mps; + if (qeTableIcx.switchFlag === 1) { + cx_mps = d; + } + cx_index = qeTableIcx.nlps; + } + } else { + this.chigh -= qeIcx; + if ((a & 0x8000) !== 0) { + this.a = a; + return cx_mps; + } + if (a < qeIcx) { + d = 1 ^ cx_mps; + if (qeTableIcx.switchFlag === 1) { + cx_mps = d; + } + cx_index = qeTableIcx.nlps; + } else { + d = cx_mps; + cx_index = qeTableIcx.nmps; + } + } + do { + if (this.ct === 0) { + this.byteIn(); + } + a <<= 1; + this.chigh = this.chigh << 1 & 0xffff | this.clow >> 15 & 1; + this.clow = this.clow << 1 & 0xffff; + this.ct--; + } while ((a & 0x8000) === 0); + this.a = a; + contexts[pos] = cx_index << 1 | cx_mps; + return d; + } +} + +;// CONCATENATED MODULE: ./src/core/jbig2.js + + + + +class Jbig2Error extends BaseException { + constructor(msg) { + super(`JBIG2 error: ${msg}`, "Jbig2Error"); + } +} +class ContextCache { + getContexts(id) { + if (id in this) { + return this[id]; + } + return this[id] = new Int8Array(1 << 16); + } +} +class DecodingContext { + constructor(data, start, end) { + this.data = data; + this.start = start; + this.end = end; + } + get decoder() { + const decoder = new ArithmeticDecoder(this.data, this.start, this.end); + return shadow(this, "decoder", decoder); + } + get contextCache() { + const cache = new ContextCache(); + return shadow(this, "contextCache", cache); + } +} +const MAX_INT_32 = 2 ** 31 - 1; +const MIN_INT_32 = -(2 ** 31); +function decodeInteger(contextCache, procedure, decoder) { + const contexts = contextCache.getContexts(procedure); + let prev = 1; + function readBits(length) { + let v = 0; + for (let i = 0; i < length; i++) { + const bit = decoder.readBit(contexts, prev); + prev = prev < 256 ? prev << 1 | bit : (prev << 1 | bit) & 511 | 256; + v = v << 1 | bit; + } + return v >>> 0; + } + const sign = readBits(1); + const value = readBits(1) ? readBits(1) ? readBits(1) ? readBits(1) ? readBits(1) ? readBits(32) + 4436 : readBits(12) + 340 : readBits(8) + 84 : readBits(6) + 20 : readBits(4) + 4 : readBits(2); + let signedValue; + if (sign === 0) { + signedValue = value; + } else if (value > 0) { + signedValue = -value; + } + if (signedValue >= MIN_INT_32 && signedValue <= MAX_INT_32) { + return signedValue; + } + return null; +} +function decodeIAID(contextCache, decoder, codeLength) { + const contexts = contextCache.getContexts("IAID"); + let prev = 1; + for (let i = 0; i < codeLength; i++) { + const bit = decoder.readBit(contexts, prev); + prev = prev << 1 | bit; + } + if (codeLength < 31) { + return prev & (1 << codeLength) - 1; + } + return prev & 0x7fffffff; +} +const SegmentTypes = ["SymbolDictionary", null, null, null, "IntermediateTextRegion", null, "ImmediateTextRegion", "ImmediateLosslessTextRegion", null, null, null, null, null, null, null, null, "PatternDictionary", null, null, null, "IntermediateHalftoneRegion", null, "ImmediateHalftoneRegion", "ImmediateLosslessHalftoneRegion", null, null, null, null, null, null, null, null, null, null, null, null, "IntermediateGenericRegion", null, "ImmediateGenericRegion", "ImmediateLosslessGenericRegion", "IntermediateGenericRefinementRegion", null, "ImmediateGenericRefinementRegion", "ImmediateLosslessGenericRefinementRegion", null, null, null, null, "PageInformation", "EndOfPage", "EndOfStripe", "EndOfFile", "Profiles", "Tables", null, null, null, null, null, null, null, null, "Extension"]; +const CodingTemplates = [[{ + x: -1, + y: -2 +}, { + x: 0, + y: -2 +}, { + x: 1, + y: -2 +}, { + x: -2, + y: -1 +}, { + x: -1, + y: -1 +}, { + x: 0, + y: -1 +}, { + x: 1, + y: -1 +}, { + x: 2, + y: -1 +}, { + x: -4, + y: 0 +}, { + x: -3, + y: 0 +}, { + x: -2, + y: 0 +}, { + x: -1, + y: 0 +}], [{ + x: -1, + y: -2 +}, { + x: 0, + y: -2 +}, { + x: 1, + y: -2 +}, { + x: 2, + y: -2 +}, { + x: -2, + y: -1 +}, { + x: -1, + y: -1 +}, { + x: 0, + y: -1 +}, { + x: 1, + y: -1 +}, { + x: 2, + y: -1 +}, { + x: -3, + y: 0 +}, { + x: -2, + y: 0 +}, { + x: -1, + y: 0 +}], [{ + x: -1, + y: -2 +}, { + x: 0, + y: -2 +}, { + x: 1, + y: -2 +}, { + x: -2, + y: -1 +}, { + x: -1, + y: -1 +}, { + x: 0, + y: -1 +}, { + x: 1, + y: -1 +}, { + x: -2, + y: 0 +}, { + x: -1, + y: 0 +}], [{ + x: -3, + y: -1 +}, { + x: -2, + y: -1 +}, { + x: -1, + y: -1 +}, { + x: 0, + y: -1 +}, { + x: 1, + y: -1 +}, { + x: -4, + y: 0 +}, { + x: -3, + y: 0 +}, { + x: -2, + y: 0 +}, { + x: -1, + y: 0 +}]]; +const RefinementTemplates = [{ + coding: [{ + x: 0, + y: -1 + }, { + x: 1, + y: -1 + }, { + x: -1, + y: 0 + }], + reference: [{ + x: 0, + y: -1 + }, { + x: 1, + y: -1 + }, { + x: -1, + y: 0 + }, { + x: 0, + y: 0 + }, { + x: 1, + y: 0 + }, { + x: -1, + y: 1 + }, { + x: 0, + y: 1 + }, { + x: 1, + y: 1 + }] +}, { + coding: [{ + x: -1, + y: -1 + }, { + x: 0, + y: -1 + }, { + x: 1, + y: -1 + }, { + x: -1, + y: 0 + }], + reference: [{ + x: 0, + y: -1 + }, { + x: -1, + y: 0 + }, { + x: 0, + y: 0 + }, { + x: 1, + y: 0 + }, { + x: 0, + y: 1 + }, { + x: 1, + y: 1 + }] +}]; +const ReusedContexts = [0x9b25, 0x0795, 0x00e5, 0x0195]; +const RefinementReusedContexts = [0x0020, 0x0008]; +function decodeBitmapTemplate0(width, height, decodingContext) { + const decoder = decodingContext.decoder; + const contexts = decodingContext.contextCache.getContexts("GB"); + const bitmap = []; + let contextLabel, i, j, pixel, row, row1, row2; + const OLD_PIXEL_MASK = 0x7bf7; + for (i = 0; i < height; i++) { + row = bitmap[i] = new Uint8Array(width); + row1 = i < 1 ? row : bitmap[i - 1]; + row2 = i < 2 ? row : bitmap[i - 2]; + contextLabel = row2[0] << 13 | row2[1] << 12 | row2[2] << 11 | row1[0] << 7 | row1[1] << 6 | row1[2] << 5 | row1[3] << 4; + for (j = 0; j < width; j++) { + row[j] = pixel = decoder.readBit(contexts, contextLabel); + contextLabel = (contextLabel & OLD_PIXEL_MASK) << 1 | (j + 3 < width ? row2[j + 3] << 11 : 0) | (j + 4 < width ? row1[j + 4] << 4 : 0) | pixel; + } + } + return bitmap; +} +function decodeBitmap(mmr, width, height, templateIndex, prediction, skip, at, decodingContext) { + if (mmr) { + const input = new Reader(decodingContext.data, decodingContext.start, decodingContext.end); + return decodeMMRBitmap(input, width, height, false); + } + if (templateIndex === 0 && !skip && !prediction && at.length === 4 && at[0].x === 3 && at[0].y === -1 && at[1].x === -3 && at[1].y === -1 && at[2].x === 2 && at[2].y === -2 && at[3].x === -2 && at[3].y === -2) { + return decodeBitmapTemplate0(width, height, decodingContext); + } + const useskip = !!skip; + const template = CodingTemplates[templateIndex].concat(at); + template.sort(function (a, b) { + return a.y - b.y || a.x - b.x; + }); + const templateLength = template.length; + const templateX = new Int8Array(templateLength); + const templateY = new Int8Array(templateLength); + const changingTemplateEntries = []; + let reuseMask = 0, + minX = 0, + maxX = 0, + minY = 0; + let c, k; + for (k = 0; k < templateLength; k++) { + templateX[k] = template[k].x; + templateY[k] = template[k].y; + minX = Math.min(minX, template[k].x); + maxX = Math.max(maxX, template[k].x); + minY = Math.min(minY, template[k].y); + if (k < templateLength - 1 && template[k].y === template[k + 1].y && template[k].x === template[k + 1].x - 1) { + reuseMask |= 1 << templateLength - 1 - k; + } else { + changingTemplateEntries.push(k); + } + } + const changingEntriesLength = changingTemplateEntries.length; + const changingTemplateX = new Int8Array(changingEntriesLength); + const changingTemplateY = new Int8Array(changingEntriesLength); + const changingTemplateBit = new Uint16Array(changingEntriesLength); + for (c = 0; c < changingEntriesLength; c++) { + k = changingTemplateEntries[c]; + changingTemplateX[c] = template[k].x; + changingTemplateY[c] = template[k].y; + changingTemplateBit[c] = 1 << templateLength - 1 - k; + } + const sbb_left = -minX; + const sbb_top = -minY; + const sbb_right = width - maxX; + const pseudoPixelContext = ReusedContexts[templateIndex]; + let row = new Uint8Array(width); + const bitmap = []; + const decoder = decodingContext.decoder; + const contexts = decodingContext.contextCache.getContexts("GB"); + let ltp = 0, + j, + i0, + j0, + contextLabel = 0, + bit, + shift; + for (let i = 0; i < height; i++) { + if (prediction) { + const sltp = decoder.readBit(contexts, pseudoPixelContext); + ltp ^= sltp; + if (ltp) { + bitmap.push(row); + continue; + } + } + row = new Uint8Array(row); + bitmap.push(row); + for (j = 0; j < width; j++) { + if (useskip && skip[i][j]) { + row[j] = 0; + continue; + } + if (j >= sbb_left && j < sbb_right && i >= sbb_top) { + contextLabel = contextLabel << 1 & reuseMask; + for (k = 0; k < changingEntriesLength; k++) { + i0 = i + changingTemplateY[k]; + j0 = j + changingTemplateX[k]; + bit = bitmap[i0][j0]; + if (bit) { + bit = changingTemplateBit[k]; + contextLabel |= bit; + } + } + } else { + contextLabel = 0; + shift = templateLength - 1; + for (k = 0; k < templateLength; k++, shift--) { + j0 = j + templateX[k]; + if (j0 >= 0 && j0 < width) { + i0 = i + templateY[k]; + if (i0 >= 0) { + bit = bitmap[i0][j0]; + if (bit) { + contextLabel |= bit << shift; + } + } + } + } + } + const pixel = decoder.readBit(contexts, contextLabel); + row[j] = pixel; + } + } + return bitmap; +} +function decodeRefinement(width, height, templateIndex, referenceBitmap, offsetX, offsetY, prediction, at, decodingContext) { + let codingTemplate = RefinementTemplates[templateIndex].coding; + if (templateIndex === 0) { + codingTemplate = codingTemplate.concat([at[0]]); + } + const codingTemplateLength = codingTemplate.length; + const codingTemplateX = new Int32Array(codingTemplateLength); + const codingTemplateY = new Int32Array(codingTemplateLength); + let k; + for (k = 0; k < codingTemplateLength; k++) { + codingTemplateX[k] = codingTemplate[k].x; + codingTemplateY[k] = codingTemplate[k].y; + } + let referenceTemplate = RefinementTemplates[templateIndex].reference; + if (templateIndex === 0) { + referenceTemplate = referenceTemplate.concat([at[1]]); + } + const referenceTemplateLength = referenceTemplate.length; + const referenceTemplateX = new Int32Array(referenceTemplateLength); + const referenceTemplateY = new Int32Array(referenceTemplateLength); + for (k = 0; k < referenceTemplateLength; k++) { + referenceTemplateX[k] = referenceTemplate[k].x; + referenceTemplateY[k] = referenceTemplate[k].y; + } + const referenceWidth = referenceBitmap[0].length; + const referenceHeight = referenceBitmap.length; + const pseudoPixelContext = RefinementReusedContexts[templateIndex]; + const bitmap = []; + const decoder = decodingContext.decoder; + const contexts = decodingContext.contextCache.getContexts("GR"); + let ltp = 0; + for (let i = 0; i < height; i++) { + if (prediction) { + const sltp = decoder.readBit(contexts, pseudoPixelContext); + ltp ^= sltp; + if (ltp) { + throw new Jbig2Error("prediction is not supported"); + } + } + const row = new Uint8Array(width); + bitmap.push(row); + for (let j = 0; j < width; j++) { + let i0, j0; + let contextLabel = 0; + for (k = 0; k < codingTemplateLength; k++) { + i0 = i + codingTemplateY[k]; + j0 = j + codingTemplateX[k]; + if (i0 < 0 || j0 < 0 || j0 >= width) { + contextLabel <<= 1; + } else { + contextLabel = contextLabel << 1 | bitmap[i0][j0]; + } + } + for (k = 0; k < referenceTemplateLength; k++) { + i0 = i + referenceTemplateY[k] - offsetY; + j0 = j + referenceTemplateX[k] - offsetX; + if (i0 < 0 || i0 >= referenceHeight || j0 < 0 || j0 >= referenceWidth) { + contextLabel <<= 1; + } else { + contextLabel = contextLabel << 1 | referenceBitmap[i0][j0]; + } + } + const pixel = decoder.readBit(contexts, contextLabel); + row[j] = pixel; + } + } + return bitmap; +} +function decodeSymbolDictionary(huffman, refinement, symbols, numberOfNewSymbols, numberOfExportedSymbols, huffmanTables, templateIndex, at, refinementTemplateIndex, refinementAt, decodingContext, huffmanInput) { + if (huffman && refinement) { + throw new Jbig2Error("symbol refinement with Huffman is not supported"); + } + const newSymbols = []; + let currentHeight = 0; + let symbolCodeLength = log2(symbols.length + numberOfNewSymbols); + const decoder = decodingContext.decoder; + const contextCache = decodingContext.contextCache; + let tableB1, symbolWidths; + if (huffman) { + tableB1 = getStandardTable(1); + symbolWidths = []; + symbolCodeLength = Math.max(symbolCodeLength, 1); + } + while (newSymbols.length < numberOfNewSymbols) { + const deltaHeight = huffman ? huffmanTables.tableDeltaHeight.decode(huffmanInput) : decodeInteger(contextCache, "IADH", decoder); + currentHeight += deltaHeight; + let currentWidth = 0, + totalWidth = 0; + const firstSymbol = huffman ? symbolWidths.length : 0; + while (true) { + const deltaWidth = huffman ? huffmanTables.tableDeltaWidth.decode(huffmanInput) : decodeInteger(contextCache, "IADW", decoder); + if (deltaWidth === null) { + break; + } + currentWidth += deltaWidth; + totalWidth += currentWidth; + let bitmap; + if (refinement) { + const numberOfInstances = decodeInteger(contextCache, "IAAI", decoder); + if (numberOfInstances > 1) { + bitmap = decodeTextRegion(huffman, refinement, currentWidth, currentHeight, 0, numberOfInstances, 1, symbols.concat(newSymbols), symbolCodeLength, 0, 0, 1, 0, huffmanTables, refinementTemplateIndex, refinementAt, decodingContext, 0, huffmanInput); + } else { + const symbolId = decodeIAID(contextCache, decoder, symbolCodeLength); + const rdx = decodeInteger(contextCache, "IARDX", decoder); + const rdy = decodeInteger(contextCache, "IARDY", decoder); + const symbol = symbolId < symbols.length ? symbols[symbolId] : newSymbols[symbolId - symbols.length]; + bitmap = decodeRefinement(currentWidth, currentHeight, refinementTemplateIndex, symbol, rdx, rdy, false, refinementAt, decodingContext); + } + newSymbols.push(bitmap); + } else if (huffman) { + symbolWidths.push(currentWidth); + } else { + bitmap = decodeBitmap(false, currentWidth, currentHeight, templateIndex, false, null, at, decodingContext); + newSymbols.push(bitmap); + } + } + if (huffman && !refinement) { + const bitmapSize = huffmanTables.tableBitmapSize.decode(huffmanInput); + huffmanInput.byteAlign(); + let collectiveBitmap; + if (bitmapSize === 0) { + collectiveBitmap = readUncompressedBitmap(huffmanInput, totalWidth, currentHeight); + } else { + const originalEnd = huffmanInput.end; + const bitmapEnd = huffmanInput.position + bitmapSize; + huffmanInput.end = bitmapEnd; + collectiveBitmap = decodeMMRBitmap(huffmanInput, totalWidth, currentHeight, false); + huffmanInput.end = originalEnd; + huffmanInput.position = bitmapEnd; + } + const numberOfSymbolsDecoded = symbolWidths.length; + if (firstSymbol === numberOfSymbolsDecoded - 1) { + newSymbols.push(collectiveBitmap); + } else { + let i, + y, + xMin = 0, + xMax, + bitmapWidth, + symbolBitmap; + for (i = firstSymbol; i < numberOfSymbolsDecoded; i++) { + bitmapWidth = symbolWidths[i]; + xMax = xMin + bitmapWidth; + symbolBitmap = []; + for (y = 0; y < currentHeight; y++) { + symbolBitmap.push(collectiveBitmap[y].subarray(xMin, xMax)); + } + newSymbols.push(symbolBitmap); + xMin = xMax; + } + } + } + } + const exportedSymbols = [], + flags = []; + let currentFlag = false, + i, + ii; + const totalSymbolsLength = symbols.length + numberOfNewSymbols; + while (flags.length < totalSymbolsLength) { + let runLength = huffman ? tableB1.decode(huffmanInput) : decodeInteger(contextCache, "IAEX", decoder); + while (runLength--) { + flags.push(currentFlag); + } + currentFlag = !currentFlag; + } + for (i = 0, ii = symbols.length; i < ii; i++) { + if (flags[i]) { + exportedSymbols.push(symbols[i]); + } + } + for (let j = 0; j < numberOfNewSymbols; i++, j++) { + if (flags[i]) { + exportedSymbols.push(newSymbols[j]); + } + } + return exportedSymbols; +} +function decodeTextRegion(huffman, refinement, width, height, defaultPixelValue, numberOfSymbolInstances, stripSize, inputSymbols, symbolCodeLength, transposed, dsOffset, referenceCorner, combinationOperator, huffmanTables, refinementTemplateIndex, refinementAt, decodingContext, logStripSize, huffmanInput) { + if (huffman && refinement) { + throw new Jbig2Error("refinement with Huffman is not supported"); + } + const bitmap = []; + let i, row; + for (i = 0; i < height; i++) { + row = new Uint8Array(width); + if (defaultPixelValue) { + for (let j = 0; j < width; j++) { + row[j] = defaultPixelValue; + } + } + bitmap.push(row); + } + const decoder = decodingContext.decoder; + const contextCache = decodingContext.contextCache; + let stripT = huffman ? -huffmanTables.tableDeltaT.decode(huffmanInput) : -decodeInteger(contextCache, "IADT", decoder); + let firstS = 0; + i = 0; + while (i < numberOfSymbolInstances) { + const deltaT = huffman ? huffmanTables.tableDeltaT.decode(huffmanInput) : decodeInteger(contextCache, "IADT", decoder); + stripT += deltaT; + const deltaFirstS = huffman ? huffmanTables.tableFirstS.decode(huffmanInput) : decodeInteger(contextCache, "IAFS", decoder); + firstS += deltaFirstS; + let currentS = firstS; + do { + let currentT = 0; + if (stripSize > 1) { + currentT = huffman ? huffmanInput.readBits(logStripSize) : decodeInteger(contextCache, "IAIT", decoder); + } + const t = stripSize * stripT + currentT; + const symbolId = huffman ? huffmanTables.symbolIDTable.decode(huffmanInput) : decodeIAID(contextCache, decoder, symbolCodeLength); + const applyRefinement = refinement && (huffman ? huffmanInput.readBit() : decodeInteger(contextCache, "IARI", decoder)); + let symbolBitmap = inputSymbols[symbolId]; + let symbolWidth = symbolBitmap[0].length; + let symbolHeight = symbolBitmap.length; + if (applyRefinement) { + const rdw = decodeInteger(contextCache, "IARDW", decoder); + const rdh = decodeInteger(contextCache, "IARDH", decoder); + const rdx = decodeInteger(contextCache, "IARDX", decoder); + const rdy = decodeInteger(contextCache, "IARDY", decoder); + symbolWidth += rdw; + symbolHeight += rdh; + symbolBitmap = decodeRefinement(symbolWidth, symbolHeight, refinementTemplateIndex, symbolBitmap, (rdw >> 1) + rdx, (rdh >> 1) + rdy, false, refinementAt, decodingContext); + } + const offsetT = t - (referenceCorner & 1 ? 0 : symbolHeight - 1); + const offsetS = currentS - (referenceCorner & 2 ? symbolWidth - 1 : 0); + let s2, t2, symbolRow; + if (transposed) { + for (s2 = 0; s2 < symbolHeight; s2++) { + row = bitmap[offsetS + s2]; + if (!row) { + continue; + } + symbolRow = symbolBitmap[s2]; + const maxWidth = Math.min(width - offsetT, symbolWidth); + switch (combinationOperator) { + case 0: + for (t2 = 0; t2 < maxWidth; t2++) { + row[offsetT + t2] |= symbolRow[t2]; + } + break; + case 2: + for (t2 = 0; t2 < maxWidth; t2++) { + row[offsetT + t2] ^= symbolRow[t2]; + } + break; + default: + throw new Jbig2Error(`operator ${combinationOperator} is not supported`); + } + } + currentS += symbolHeight - 1; + } else { + for (t2 = 0; t2 < symbolHeight; t2++) { + row = bitmap[offsetT + t2]; + if (!row) { + continue; + } + symbolRow = symbolBitmap[t2]; + switch (combinationOperator) { + case 0: + for (s2 = 0; s2 < symbolWidth; s2++) { + row[offsetS + s2] |= symbolRow[s2]; + } + break; + case 2: + for (s2 = 0; s2 < symbolWidth; s2++) { + row[offsetS + s2] ^= symbolRow[s2]; + } + break; + default: + throw new Jbig2Error(`operator ${combinationOperator} is not supported`); + } + } + currentS += symbolWidth - 1; + } + i++; + const deltaS = huffman ? huffmanTables.tableDeltaS.decode(huffmanInput) : decodeInteger(contextCache, "IADS", decoder); + if (deltaS === null) { + break; + } + currentS += deltaS + dsOffset; + } while (true); + } + return bitmap; +} +function decodePatternDictionary(mmr, patternWidth, patternHeight, maxPatternIndex, template, decodingContext) { + const at = []; + if (!mmr) { + at.push({ + x: -patternWidth, + y: 0 + }); + if (template === 0) { + at.push({ + x: -3, + y: -1 + }, { + x: 2, + y: -2 + }, { + x: -2, + y: -2 + }); + } + } + const collectiveWidth = (maxPatternIndex + 1) * patternWidth; + const collectiveBitmap = decodeBitmap(mmr, collectiveWidth, patternHeight, template, false, null, at, decodingContext); + const patterns = []; + for (let i = 0; i <= maxPatternIndex; i++) { + const patternBitmap = []; + const xMin = patternWidth * i; + const xMax = xMin + patternWidth; + for (let y = 0; y < patternHeight; y++) { + patternBitmap.push(collectiveBitmap[y].subarray(xMin, xMax)); + } + patterns.push(patternBitmap); + } + return patterns; +} +function decodeHalftoneRegion(mmr, patterns, template, regionWidth, regionHeight, defaultPixelValue, enableSkip, combinationOperator, gridWidth, gridHeight, gridOffsetX, gridOffsetY, gridVectorX, gridVectorY, decodingContext) { + const skip = null; + if (enableSkip) { + throw new Jbig2Error("skip is not supported"); + } + if (combinationOperator !== 0) { + throw new Jbig2Error(`operator "${combinationOperator}" is not supported in halftone region`); + } + const regionBitmap = []; + let i, j, row; + for (i = 0; i < regionHeight; i++) { + row = new Uint8Array(regionWidth); + if (defaultPixelValue) { + for (j = 0; j < regionWidth; j++) { + row[j] = defaultPixelValue; + } + } + regionBitmap.push(row); + } + const numberOfPatterns = patterns.length; + const pattern0 = patterns[0]; + const patternWidth = pattern0[0].length, + patternHeight = pattern0.length; + const bitsPerValue = log2(numberOfPatterns); + const at = []; + if (!mmr) { + at.push({ + x: template <= 1 ? 3 : 2, + y: -1 + }); + if (template === 0) { + at.push({ + x: -3, + y: -1 + }, { + x: 2, + y: -2 + }, { + x: -2, + y: -2 + }); + } + } + const grayScaleBitPlanes = []; + let mmrInput, bitmap; + if (mmr) { + mmrInput = new Reader(decodingContext.data, decodingContext.start, decodingContext.end); + } + for (i = bitsPerValue - 1; i >= 0; i--) { + if (mmr) { + bitmap = decodeMMRBitmap(mmrInput, gridWidth, gridHeight, true); + } else { + bitmap = decodeBitmap(false, gridWidth, gridHeight, template, false, skip, at, decodingContext); + } + grayScaleBitPlanes[i] = bitmap; + } + let mg, ng, bit, patternIndex, patternBitmap, x, y, patternRow, regionRow; + for (mg = 0; mg < gridHeight; mg++) { + for (ng = 0; ng < gridWidth; ng++) { + bit = 0; + patternIndex = 0; + for (j = bitsPerValue - 1; j >= 0; j--) { + bit ^= grayScaleBitPlanes[j][mg][ng]; + patternIndex |= bit << j; + } + patternBitmap = patterns[patternIndex]; + x = gridOffsetX + mg * gridVectorY + ng * gridVectorX >> 8; + y = gridOffsetY + mg * gridVectorX - ng * gridVectorY >> 8; + if (x >= 0 && x + patternWidth <= regionWidth && y >= 0 && y + patternHeight <= regionHeight) { + for (i = 0; i < patternHeight; i++) { + regionRow = regionBitmap[y + i]; + patternRow = patternBitmap[i]; + for (j = 0; j < patternWidth; j++) { + regionRow[x + j] |= patternRow[j]; + } + } + } else { + let regionX, regionY; + for (i = 0; i < patternHeight; i++) { + regionY = y + i; + if (regionY < 0 || regionY >= regionHeight) { + continue; + } + regionRow = regionBitmap[regionY]; + patternRow = patternBitmap[i]; + for (j = 0; j < patternWidth; j++) { + regionX = x + j; + if (regionX >= 0 && regionX < regionWidth) { + regionRow[regionX] |= patternRow[j]; + } + } + } + } + } + } + return regionBitmap; +} +function readSegmentHeader(data, start) { + const segmentHeader = {}; + segmentHeader.number = readUint32(data, start); + const flags = data[start + 4]; + const segmentType = flags & 0x3f; + if (!SegmentTypes[segmentType]) { + throw new Jbig2Error("invalid segment type: " + segmentType); + } + segmentHeader.type = segmentType; + segmentHeader.typeName = SegmentTypes[segmentType]; + segmentHeader.deferredNonRetain = !!(flags & 0x80); + const pageAssociationFieldSize = !!(flags & 0x40); + const referredFlags = data[start + 5]; + let referredToCount = referredFlags >> 5 & 7; + const retainBits = [referredFlags & 31]; + let position = start + 6; + if (referredFlags === 7) { + referredToCount = readUint32(data, position - 1) & 0x1fffffff; + position += 3; + let bytes = referredToCount + 7 >> 3; + retainBits[0] = data[position++]; + while (--bytes > 0) { + retainBits.push(data[position++]); + } + } else if (referredFlags === 5 || referredFlags === 6) { + throw new Jbig2Error("invalid referred-to flags"); + } + segmentHeader.retainBits = retainBits; + let referredToSegmentNumberSize = 4; + if (segmentHeader.number <= 256) { + referredToSegmentNumberSize = 1; + } else if (segmentHeader.number <= 65536) { + referredToSegmentNumberSize = 2; + } + const referredTo = []; + let i, ii; + for (i = 0; i < referredToCount; i++) { + let number; + if (referredToSegmentNumberSize === 1) { + number = data[position]; + } else if (referredToSegmentNumberSize === 2) { + number = readUint16(data, position); + } else { + number = readUint32(data, position); + } + referredTo.push(number); + position += referredToSegmentNumberSize; + } + segmentHeader.referredTo = referredTo; + if (!pageAssociationFieldSize) { + segmentHeader.pageAssociation = data[position++]; + } else { + segmentHeader.pageAssociation = readUint32(data, position); + position += 4; + } + segmentHeader.length = readUint32(data, position); + position += 4; + if (segmentHeader.length === 0xffffffff) { + if (segmentType === 38) { + const genericRegionInfo = readRegionSegmentInformation(data, position); + const genericRegionSegmentFlags = data[position + RegionSegmentInformationFieldLength]; + const genericRegionMmr = !!(genericRegionSegmentFlags & 1); + const searchPatternLength = 6; + const searchPattern = new Uint8Array(searchPatternLength); + if (!genericRegionMmr) { + searchPattern[0] = 0xff; + searchPattern[1] = 0xac; + } + searchPattern[2] = genericRegionInfo.height >>> 24 & 0xff; + searchPattern[3] = genericRegionInfo.height >> 16 & 0xff; + searchPattern[4] = genericRegionInfo.height >> 8 & 0xff; + searchPattern[5] = genericRegionInfo.height & 0xff; + for (i = position, ii = data.length; i < ii; i++) { + let j = 0; + while (j < searchPatternLength && searchPattern[j] === data[i + j]) { + j++; + } + if (j === searchPatternLength) { + segmentHeader.length = i + searchPatternLength; + break; + } + } + if (segmentHeader.length === 0xffffffff) { + throw new Jbig2Error("segment end was not found"); + } + } else { + throw new Jbig2Error("invalid unknown segment length"); + } + } + segmentHeader.headerEnd = position; + return segmentHeader; +} +function readSegments(header, data, start, end) { + const segments = []; + let position = start; + while (position < end) { + const segmentHeader = readSegmentHeader(data, position); + position = segmentHeader.headerEnd; + const segment = { + header: segmentHeader, + data + }; + if (!header.randomAccess) { + segment.start = position; + position += segmentHeader.length; + segment.end = position; + } + segments.push(segment); + if (segmentHeader.type === 51) { + break; + } + } + if (header.randomAccess) { + for (let i = 0, ii = segments.length; i < ii; i++) { + segments[i].start = position; + position += segments[i].header.length; + segments[i].end = position; + } + } + return segments; +} +function readRegionSegmentInformation(data, start) { + return { + width: readUint32(data, start), + height: readUint32(data, start + 4), + x: readUint32(data, start + 8), + y: readUint32(data, start + 12), + combinationOperator: data[start + 16] & 7 + }; +} +const RegionSegmentInformationFieldLength = 17; +function processSegment(segment, visitor) { + const header = segment.header; + const data = segment.data, + end = segment.end; + let position = segment.start; + let args, at, i, atLength; + switch (header.type) { + case 0: + const dictionary = {}; + const dictionaryFlags = readUint16(data, position); + dictionary.huffman = !!(dictionaryFlags & 1); + dictionary.refinement = !!(dictionaryFlags & 2); + dictionary.huffmanDHSelector = dictionaryFlags >> 2 & 3; + dictionary.huffmanDWSelector = dictionaryFlags >> 4 & 3; + dictionary.bitmapSizeSelector = dictionaryFlags >> 6 & 1; + dictionary.aggregationInstancesSelector = dictionaryFlags >> 7 & 1; + dictionary.bitmapCodingContextUsed = !!(dictionaryFlags & 256); + dictionary.bitmapCodingContextRetained = !!(dictionaryFlags & 512); + dictionary.template = dictionaryFlags >> 10 & 3; + dictionary.refinementTemplate = dictionaryFlags >> 12 & 1; + position += 2; + if (!dictionary.huffman) { + atLength = dictionary.template === 0 ? 4 : 1; + at = []; + for (i = 0; i < atLength; i++) { + at.push({ + x: readInt8(data, position), + y: readInt8(data, position + 1) + }); + position += 2; + } + dictionary.at = at; + } + if (dictionary.refinement && !dictionary.refinementTemplate) { + at = []; + for (i = 0; i < 2; i++) { + at.push({ + x: readInt8(data, position), + y: readInt8(data, position + 1) + }); + position += 2; + } + dictionary.refinementAt = at; + } + dictionary.numberOfExportedSymbols = readUint32(data, position); + position += 4; + dictionary.numberOfNewSymbols = readUint32(data, position); + position += 4; + args = [dictionary, header.number, header.referredTo, data, position, end]; + break; + case 6: + case 7: + const textRegion = {}; + textRegion.info = readRegionSegmentInformation(data, position); + position += RegionSegmentInformationFieldLength; + const textRegionSegmentFlags = readUint16(data, position); + position += 2; + textRegion.huffman = !!(textRegionSegmentFlags & 1); + textRegion.refinement = !!(textRegionSegmentFlags & 2); + textRegion.logStripSize = textRegionSegmentFlags >> 2 & 3; + textRegion.stripSize = 1 << textRegion.logStripSize; + textRegion.referenceCorner = textRegionSegmentFlags >> 4 & 3; + textRegion.transposed = !!(textRegionSegmentFlags & 64); + textRegion.combinationOperator = textRegionSegmentFlags >> 7 & 3; + textRegion.defaultPixelValue = textRegionSegmentFlags >> 9 & 1; + textRegion.dsOffset = textRegionSegmentFlags << 17 >> 27; + textRegion.refinementTemplate = textRegionSegmentFlags >> 15 & 1; + if (textRegion.huffman) { + const textRegionHuffmanFlags = readUint16(data, position); + position += 2; + textRegion.huffmanFS = textRegionHuffmanFlags & 3; + textRegion.huffmanDS = textRegionHuffmanFlags >> 2 & 3; + textRegion.huffmanDT = textRegionHuffmanFlags >> 4 & 3; + textRegion.huffmanRefinementDW = textRegionHuffmanFlags >> 6 & 3; + textRegion.huffmanRefinementDH = textRegionHuffmanFlags >> 8 & 3; + textRegion.huffmanRefinementDX = textRegionHuffmanFlags >> 10 & 3; + textRegion.huffmanRefinementDY = textRegionHuffmanFlags >> 12 & 3; + textRegion.huffmanRefinementSizeSelector = !!(textRegionHuffmanFlags & 0x4000); + } + if (textRegion.refinement && !textRegion.refinementTemplate) { + at = []; + for (i = 0; i < 2; i++) { + at.push({ + x: readInt8(data, position), + y: readInt8(data, position + 1) + }); + position += 2; + } + textRegion.refinementAt = at; + } + textRegion.numberOfSymbolInstances = readUint32(data, position); + position += 4; + args = [textRegion, header.referredTo, data, position, end]; + break; + case 16: + const patternDictionary = {}; + const patternDictionaryFlags = data[position++]; + patternDictionary.mmr = !!(patternDictionaryFlags & 1); + patternDictionary.template = patternDictionaryFlags >> 1 & 3; + patternDictionary.patternWidth = data[position++]; + patternDictionary.patternHeight = data[position++]; + patternDictionary.maxPatternIndex = readUint32(data, position); + position += 4; + args = [patternDictionary, header.number, data, position, end]; + break; + case 22: + case 23: + const halftoneRegion = {}; + halftoneRegion.info = readRegionSegmentInformation(data, position); + position += RegionSegmentInformationFieldLength; + const halftoneRegionFlags = data[position++]; + halftoneRegion.mmr = !!(halftoneRegionFlags & 1); + halftoneRegion.template = halftoneRegionFlags >> 1 & 3; + halftoneRegion.enableSkip = !!(halftoneRegionFlags & 8); + halftoneRegion.combinationOperator = halftoneRegionFlags >> 4 & 7; + halftoneRegion.defaultPixelValue = halftoneRegionFlags >> 7 & 1; + halftoneRegion.gridWidth = readUint32(data, position); + position += 4; + halftoneRegion.gridHeight = readUint32(data, position); + position += 4; + halftoneRegion.gridOffsetX = readUint32(data, position) & 0xffffffff; + position += 4; + halftoneRegion.gridOffsetY = readUint32(data, position) & 0xffffffff; + position += 4; + halftoneRegion.gridVectorX = readUint16(data, position); + position += 2; + halftoneRegion.gridVectorY = readUint16(data, position); + position += 2; + args = [halftoneRegion, header.referredTo, data, position, end]; + break; + case 38: + case 39: + const genericRegion = {}; + genericRegion.info = readRegionSegmentInformation(data, position); + position += RegionSegmentInformationFieldLength; + const genericRegionSegmentFlags = data[position++]; + genericRegion.mmr = !!(genericRegionSegmentFlags & 1); + genericRegion.template = genericRegionSegmentFlags >> 1 & 3; + genericRegion.prediction = !!(genericRegionSegmentFlags & 8); + if (!genericRegion.mmr) { + atLength = genericRegion.template === 0 ? 4 : 1; + at = []; + for (i = 0; i < atLength; i++) { + at.push({ + x: readInt8(data, position), + y: readInt8(data, position + 1) + }); + position += 2; + } + genericRegion.at = at; + } + args = [genericRegion, data, position, end]; + break; + case 48: + const pageInfo = { + width: readUint32(data, position), + height: readUint32(data, position + 4), + resolutionX: readUint32(data, position + 8), + resolutionY: readUint32(data, position + 12) + }; + if (pageInfo.height === 0xffffffff) { + delete pageInfo.height; + } + const pageSegmentFlags = data[position + 16]; + readUint16(data, position + 17); + pageInfo.lossless = !!(pageSegmentFlags & 1); + pageInfo.refinement = !!(pageSegmentFlags & 2); + pageInfo.defaultPixelValue = pageSegmentFlags >> 2 & 1; + pageInfo.combinationOperator = pageSegmentFlags >> 3 & 3; + pageInfo.requiresBuffer = !!(pageSegmentFlags & 32); + pageInfo.combinationOperatorOverride = !!(pageSegmentFlags & 64); + args = [pageInfo]; + break; + case 49: + break; + case 50: + break; + case 51: + break; + case 53: + args = [header.number, data, position, end]; + break; + case 62: + break; + default: + throw new Jbig2Error(`segment type ${header.typeName}(${header.type}) is not implemented`); + } + const callbackName = "on" + header.typeName; + if (callbackName in visitor) { + visitor[callbackName].apply(visitor, args); + } +} +function processSegments(segments, visitor) { + for (let i = 0, ii = segments.length; i < ii; i++) { + processSegment(segments[i], visitor); + } +} +function parseJbig2Chunks(chunks) { + const visitor = new SimpleSegmentVisitor(); + for (let i = 0, ii = chunks.length; i < ii; i++) { + const chunk = chunks[i]; + const segments = readSegments({}, chunk.data, chunk.start, chunk.end); + processSegments(segments, visitor); + } + return visitor.buffer; +} +function parseJbig2(data) { + throw new Error("Not implemented: parseJbig2"); +} +class SimpleSegmentVisitor { + onPageInformation(info) { + this.currentPageInfo = info; + const rowSize = info.width + 7 >> 3; + const buffer = new Uint8ClampedArray(rowSize * info.height); + if (info.defaultPixelValue) { + buffer.fill(0xff); + } + this.buffer = buffer; + } + drawBitmap(regionInfo, bitmap) { + const pageInfo = this.currentPageInfo; + const width = regionInfo.width, + height = regionInfo.height; + const rowSize = pageInfo.width + 7 >> 3; + const combinationOperator = pageInfo.combinationOperatorOverride ? regionInfo.combinationOperator : pageInfo.combinationOperator; + const buffer = this.buffer; + const mask0 = 128 >> (regionInfo.x & 7); + let offset0 = regionInfo.y * rowSize + (regionInfo.x >> 3); + let i, j, mask, offset; + switch (combinationOperator) { + case 0: + for (i = 0; i < height; i++) { + mask = mask0; + offset = offset0; + for (j = 0; j < width; j++) { + if (bitmap[i][j]) { + buffer[offset] |= mask; + } + mask >>= 1; + if (!mask) { + mask = 128; + offset++; + } + } + offset0 += rowSize; + } + break; + case 2: + for (i = 0; i < height; i++) { + mask = mask0; + offset = offset0; + for (j = 0; j < width; j++) { + if (bitmap[i][j]) { + buffer[offset] ^= mask; + } + mask >>= 1; + if (!mask) { + mask = 128; + offset++; + } + } + offset0 += rowSize; + } + break; + default: + throw new Jbig2Error(`operator ${combinationOperator} is not supported`); + } + } + onImmediateGenericRegion(region, data, start, end) { + const regionInfo = region.info; + const decodingContext = new DecodingContext(data, start, end); + const bitmap = decodeBitmap(region.mmr, regionInfo.width, regionInfo.height, region.template, region.prediction, null, region.at, decodingContext); + this.drawBitmap(regionInfo, bitmap); + } + onImmediateLosslessGenericRegion() { + this.onImmediateGenericRegion(...arguments); + } + onSymbolDictionary(dictionary, currentSegment, referredSegments, data, start, end) { + let huffmanTables, huffmanInput; + if (dictionary.huffman) { + huffmanTables = getSymbolDictionaryHuffmanTables(dictionary, referredSegments, this.customTables); + huffmanInput = new Reader(data, start, end); + } + let symbols = this.symbols; + if (!symbols) { + this.symbols = symbols = {}; + } + const inputSymbols = []; + for (const referredSegment of referredSegments) { + const referredSymbols = symbols[referredSegment]; + if (referredSymbols) { + inputSymbols.push(...referredSymbols); + } + } + const decodingContext = new DecodingContext(data, start, end); + symbols[currentSegment] = decodeSymbolDictionary(dictionary.huffman, dictionary.refinement, inputSymbols, dictionary.numberOfNewSymbols, dictionary.numberOfExportedSymbols, huffmanTables, dictionary.template, dictionary.at, dictionary.refinementTemplate, dictionary.refinementAt, decodingContext, huffmanInput); + } + onImmediateTextRegion(region, referredSegments, data, start, end) { + const regionInfo = region.info; + let huffmanTables, huffmanInput; + const symbols = this.symbols; + const inputSymbols = []; + for (const referredSegment of referredSegments) { + const referredSymbols = symbols[referredSegment]; + if (referredSymbols) { + inputSymbols.push(...referredSymbols); + } + } + const symbolCodeLength = log2(inputSymbols.length); + if (region.huffman) { + huffmanInput = new Reader(data, start, end); + huffmanTables = getTextRegionHuffmanTables(region, referredSegments, this.customTables, inputSymbols.length, huffmanInput); + } + const decodingContext = new DecodingContext(data, start, end); + const bitmap = decodeTextRegion(region.huffman, region.refinement, regionInfo.width, regionInfo.height, region.defaultPixelValue, region.numberOfSymbolInstances, region.stripSize, inputSymbols, symbolCodeLength, region.transposed, region.dsOffset, region.referenceCorner, region.combinationOperator, huffmanTables, region.refinementTemplate, region.refinementAt, decodingContext, region.logStripSize, huffmanInput); + this.drawBitmap(regionInfo, bitmap); + } + onImmediateLosslessTextRegion() { + this.onImmediateTextRegion(...arguments); + } + onPatternDictionary(dictionary, currentSegment, data, start, end) { + let patterns = this.patterns; + if (!patterns) { + this.patterns = patterns = {}; + } + const decodingContext = new DecodingContext(data, start, end); + patterns[currentSegment] = decodePatternDictionary(dictionary.mmr, dictionary.patternWidth, dictionary.patternHeight, dictionary.maxPatternIndex, dictionary.template, decodingContext); + } + onImmediateHalftoneRegion(region, referredSegments, data, start, end) { + const patterns = this.patterns[referredSegments[0]]; + const regionInfo = region.info; + const decodingContext = new DecodingContext(data, start, end); + const bitmap = decodeHalftoneRegion(region.mmr, patterns, region.template, regionInfo.width, regionInfo.height, region.defaultPixelValue, region.enableSkip, region.combinationOperator, region.gridWidth, region.gridHeight, region.gridOffsetX, region.gridOffsetY, region.gridVectorX, region.gridVectorY, decodingContext); + this.drawBitmap(regionInfo, bitmap); + } + onImmediateLosslessHalftoneRegion() { + this.onImmediateHalftoneRegion(...arguments); + } + onTables(currentSegment, data, start, end) { + let customTables = this.customTables; + if (!customTables) { + this.customTables = customTables = {}; + } + customTables[currentSegment] = decodeTablesSegment(data, start, end); + } +} +class HuffmanLine { + constructor(lineData) { + if (lineData.length === 2) { + this.isOOB = true; + this.rangeLow = 0; + this.prefixLength = lineData[0]; + this.rangeLength = 0; + this.prefixCode = lineData[1]; + this.isLowerRange = false; + } else { + this.isOOB = false; + this.rangeLow = lineData[0]; + this.prefixLength = lineData[1]; + this.rangeLength = lineData[2]; + this.prefixCode = lineData[3]; + this.isLowerRange = lineData[4] === "lower"; + } + } +} +class HuffmanTreeNode { + constructor(line) { + this.children = []; + if (line) { + this.isLeaf = true; + this.rangeLength = line.rangeLength; + this.rangeLow = line.rangeLow; + this.isLowerRange = line.isLowerRange; + this.isOOB = line.isOOB; + } else { + this.isLeaf = false; + } + } + buildTree(line, shift) { + const bit = line.prefixCode >> shift & 1; + if (shift <= 0) { + this.children[bit] = new HuffmanTreeNode(line); + } else { + let node = this.children[bit]; + if (!node) { + this.children[bit] = node = new HuffmanTreeNode(null); + } + node.buildTree(line, shift - 1); + } + } + decodeNode(reader) { + if (this.isLeaf) { + if (this.isOOB) { + return null; + } + const htOffset = reader.readBits(this.rangeLength); + return this.rangeLow + (this.isLowerRange ? -htOffset : htOffset); + } + const node = this.children[reader.readBit()]; + if (!node) { + throw new Jbig2Error("invalid Huffman data"); + } + return node.decodeNode(reader); + } +} +class HuffmanTable { + constructor(lines, prefixCodesDone) { + if (!prefixCodesDone) { + this.assignPrefixCodes(lines); + } + this.rootNode = new HuffmanTreeNode(null); + for (let i = 0, ii = lines.length; i < ii; i++) { + const line = lines[i]; + if (line.prefixLength > 0) { + this.rootNode.buildTree(line, line.prefixLength - 1); + } + } + } + decode(reader) { + return this.rootNode.decodeNode(reader); + } + assignPrefixCodes(lines) { + const linesLength = lines.length; + let prefixLengthMax = 0; + for (let i = 0; i < linesLength; i++) { + prefixLengthMax = Math.max(prefixLengthMax, lines[i].prefixLength); + } + const histogram = new Uint32Array(prefixLengthMax + 1); + for (let i = 0; i < linesLength; i++) { + histogram[lines[i].prefixLength]++; + } + let currentLength = 1, + firstCode = 0, + currentCode, + currentTemp, + line; + histogram[0] = 0; + while (currentLength <= prefixLengthMax) { + firstCode = firstCode + histogram[currentLength - 1] << 1; + currentCode = firstCode; + currentTemp = 0; + while (currentTemp < linesLength) { + line = lines[currentTemp]; + if (line.prefixLength === currentLength) { + line.prefixCode = currentCode; + currentCode++; + } + currentTemp++; + } + currentLength++; + } + } +} +function decodeTablesSegment(data, start, end) { + const flags = data[start]; + const lowestValue = readUint32(data, start + 1) & 0xffffffff; + const highestValue = readUint32(data, start + 5) & 0xffffffff; + const reader = new Reader(data, start + 9, end); + const prefixSizeBits = (flags >> 1 & 7) + 1; + const rangeSizeBits = (flags >> 4 & 7) + 1; + const lines = []; + let prefixLength, + rangeLength, + currentRangeLow = lowestValue; + do { + prefixLength = reader.readBits(prefixSizeBits); + rangeLength = reader.readBits(rangeSizeBits); + lines.push(new HuffmanLine([currentRangeLow, prefixLength, rangeLength, 0])); + currentRangeLow += 1 << rangeLength; + } while (currentRangeLow < highestValue); + prefixLength = reader.readBits(prefixSizeBits); + lines.push(new HuffmanLine([lowestValue - 1, prefixLength, 32, 0, "lower"])); + prefixLength = reader.readBits(prefixSizeBits); + lines.push(new HuffmanLine([highestValue, prefixLength, 32, 0])); + if (flags & 1) { + prefixLength = reader.readBits(prefixSizeBits); + lines.push(new HuffmanLine([prefixLength, 0])); + } + return new HuffmanTable(lines, false); +} +const standardTablesCache = {}; +function getStandardTable(number) { + let table = standardTablesCache[number]; + if (table) { + return table; + } + let lines; + switch (number) { + case 1: + lines = [[0, 1, 4, 0x0], [16, 2, 8, 0x2], [272, 3, 16, 0x6], [65808, 3, 32, 0x7]]; + break; + case 2: + lines = [[0, 1, 0, 0x0], [1, 2, 0, 0x2], [2, 3, 0, 0x6], [3, 4, 3, 0xe], [11, 5, 6, 0x1e], [75, 6, 32, 0x3e], [6, 0x3f]]; + break; + case 3: + lines = [[-256, 8, 8, 0xfe], [0, 1, 0, 0x0], [1, 2, 0, 0x2], [2, 3, 0, 0x6], [3, 4, 3, 0xe], [11, 5, 6, 0x1e], [-257, 8, 32, 0xff, "lower"], [75, 7, 32, 0x7e], [6, 0x3e]]; + break; + case 4: + lines = [[1, 1, 0, 0x0], [2, 2, 0, 0x2], [3, 3, 0, 0x6], [4, 4, 3, 0xe], [12, 5, 6, 0x1e], [76, 5, 32, 0x1f]]; + break; + case 5: + lines = [[-255, 7, 8, 0x7e], [1, 1, 0, 0x0], [2, 2, 0, 0x2], [3, 3, 0, 0x6], [4, 4, 3, 0xe], [12, 5, 6, 0x1e], [-256, 7, 32, 0x7f, "lower"], [76, 6, 32, 0x3e]]; + break; + case 6: + lines = [[-2048, 5, 10, 0x1c], [-1024, 4, 9, 0x8], [-512, 4, 8, 0x9], [-256, 4, 7, 0xa], [-128, 5, 6, 0x1d], [-64, 5, 5, 0x1e], [-32, 4, 5, 0xb], [0, 2, 7, 0x0], [128, 3, 7, 0x2], [256, 3, 8, 0x3], [512, 4, 9, 0xc], [1024, 4, 10, 0xd], [-2049, 6, 32, 0x3e, "lower"], [2048, 6, 32, 0x3f]]; + break; + case 7: + lines = [[-1024, 4, 9, 0x8], [-512, 3, 8, 0x0], [-256, 4, 7, 0x9], [-128, 5, 6, 0x1a], [-64, 5, 5, 0x1b], [-32, 4, 5, 0xa], [0, 4, 5, 0xb], [32, 5, 5, 0x1c], [64, 5, 6, 0x1d], [128, 4, 7, 0xc], [256, 3, 8, 0x1], [512, 3, 9, 0x2], [1024, 3, 10, 0x3], [-1025, 5, 32, 0x1e, "lower"], [2048, 5, 32, 0x1f]]; + break; + case 8: + lines = [[-15, 8, 3, 0xfc], [-7, 9, 1, 0x1fc], [-5, 8, 1, 0xfd], [-3, 9, 0, 0x1fd], [-2, 7, 0, 0x7c], [-1, 4, 0, 0xa], [0, 2, 1, 0x0], [2, 5, 0, 0x1a], [3, 6, 0, 0x3a], [4, 3, 4, 0x4], [20, 6, 1, 0x3b], [22, 4, 4, 0xb], [38, 4, 5, 0xc], [70, 5, 6, 0x1b], [134, 5, 7, 0x1c], [262, 6, 7, 0x3c], [390, 7, 8, 0x7d], [646, 6, 10, 0x3d], [-16, 9, 32, 0x1fe, "lower"], [1670, 9, 32, 0x1ff], [2, 0x1]]; + break; + case 9: + lines = [[-31, 8, 4, 0xfc], [-15, 9, 2, 0x1fc], [-11, 8, 2, 0xfd], [-7, 9, 1, 0x1fd], [-5, 7, 1, 0x7c], [-3, 4, 1, 0xa], [-1, 3, 1, 0x2], [1, 3, 1, 0x3], [3, 5, 1, 0x1a], [5, 6, 1, 0x3a], [7, 3, 5, 0x4], [39, 6, 2, 0x3b], [43, 4, 5, 0xb], [75, 4, 6, 0xc], [139, 5, 7, 0x1b], [267, 5, 8, 0x1c], [523, 6, 8, 0x3c], [779, 7, 9, 0x7d], [1291, 6, 11, 0x3d], [-32, 9, 32, 0x1fe, "lower"], [3339, 9, 32, 0x1ff], [2, 0x0]]; + break; + case 10: + lines = [[-21, 7, 4, 0x7a], [-5, 8, 0, 0xfc], [-4, 7, 0, 0x7b], [-3, 5, 0, 0x18], [-2, 2, 2, 0x0], [2, 5, 0, 0x19], [3, 6, 0, 0x36], [4, 7, 0, 0x7c], [5, 8, 0, 0xfd], [6, 2, 6, 0x1], [70, 5, 5, 0x1a], [102, 6, 5, 0x37], [134, 6, 6, 0x38], [198, 6, 7, 0x39], [326, 6, 8, 0x3a], [582, 6, 9, 0x3b], [1094, 6, 10, 0x3c], [2118, 7, 11, 0x7d], [-22, 8, 32, 0xfe, "lower"], [4166, 8, 32, 0xff], [2, 0x2]]; + break; + case 11: + lines = [[1, 1, 0, 0x0], [2, 2, 1, 0x2], [4, 4, 0, 0xc], [5, 4, 1, 0xd], [7, 5, 1, 0x1c], [9, 5, 2, 0x1d], [13, 6, 2, 0x3c], [17, 7, 2, 0x7a], [21, 7, 3, 0x7b], [29, 7, 4, 0x7c], [45, 7, 5, 0x7d], [77, 7, 6, 0x7e], [141, 7, 32, 0x7f]]; + break; + case 12: + lines = [[1, 1, 0, 0x0], [2, 2, 0, 0x2], [3, 3, 1, 0x6], [5, 5, 0, 0x1c], [6, 5, 1, 0x1d], [8, 6, 1, 0x3c], [10, 7, 0, 0x7a], [11, 7, 1, 0x7b], [13, 7, 2, 0x7c], [17, 7, 3, 0x7d], [25, 7, 4, 0x7e], [41, 8, 5, 0xfe], [73, 8, 32, 0xff]]; + break; + case 13: + lines = [[1, 1, 0, 0x0], [2, 3, 0, 0x4], [3, 4, 0, 0xc], [4, 5, 0, 0x1c], [5, 4, 1, 0xd], [7, 3, 3, 0x5], [15, 6, 1, 0x3a], [17, 6, 2, 0x3b], [21, 6, 3, 0x3c], [29, 6, 4, 0x3d], [45, 6, 5, 0x3e], [77, 7, 6, 0x7e], [141, 7, 32, 0x7f]]; + break; + case 14: + lines = [[-2, 3, 0, 0x4], [-1, 3, 0, 0x5], [0, 1, 0, 0x0], [1, 3, 0, 0x6], [2, 3, 0, 0x7]]; + break; + case 15: + lines = [[-24, 7, 4, 0x7c], [-8, 6, 2, 0x3c], [-4, 5, 1, 0x1c], [-2, 4, 0, 0xc], [-1, 3, 0, 0x4], [0, 1, 0, 0x0], [1, 3, 0, 0x5], [2, 4, 0, 0xd], [3, 5, 1, 0x1d], [5, 6, 2, 0x3d], [9, 7, 4, 0x7d], [-25, 7, 32, 0x7e, "lower"], [25, 7, 32, 0x7f]]; + break; + default: + throw new Jbig2Error(`standard table B.${number} does not exist`); + } + for (let i = 0, ii = lines.length; i < ii; i++) { + lines[i] = new HuffmanLine(lines[i]); + } + table = new HuffmanTable(lines, true); + standardTablesCache[number] = table; + return table; +} +class Reader { + constructor(data, start, end) { + this.data = data; + this.start = start; + this.end = end; + this.position = start; + this.shift = -1; + this.currentByte = 0; + } + readBit() { + if (this.shift < 0) { + if (this.position >= this.end) { + throw new Jbig2Error("end of data while reading bit"); + } + this.currentByte = this.data[this.position++]; + this.shift = 7; + } + const bit = this.currentByte >> this.shift & 1; + this.shift--; + return bit; + } + readBits(numBits) { + let result = 0, + i; + for (i = numBits - 1; i >= 0; i--) { + result |= this.readBit() << i; + } + return result; + } + byteAlign() { + this.shift = -1; + } + next() { + if (this.position >= this.end) { + return -1; + } + return this.data[this.position++]; + } +} +function getCustomHuffmanTable(index, referredTo, customTables) { + let currentIndex = 0; + for (let i = 0, ii = referredTo.length; i < ii; i++) { + const table = customTables[referredTo[i]]; + if (table) { + if (index === currentIndex) { + return table; + } + currentIndex++; + } + } + throw new Jbig2Error("can't find custom Huffman table"); +} +function getTextRegionHuffmanTables(textRegion, referredTo, customTables, numberOfSymbols, reader) { + const codes = []; + for (let i = 0; i <= 34; i++) { + const codeLength = reader.readBits(4); + codes.push(new HuffmanLine([i, codeLength, 0, 0])); + } + const runCodesTable = new HuffmanTable(codes, false); + codes.length = 0; + for (let i = 0; i < numberOfSymbols;) { + const codeLength = runCodesTable.decode(reader); + if (codeLength >= 32) { + let repeatedLength, numberOfRepeats, j; + switch (codeLength) { + case 32: + if (i === 0) { + throw new Jbig2Error("no previous value in symbol ID table"); + } + numberOfRepeats = reader.readBits(2) + 3; + repeatedLength = codes[i - 1].prefixLength; + break; + case 33: + numberOfRepeats = reader.readBits(3) + 3; + repeatedLength = 0; + break; + case 34: + numberOfRepeats = reader.readBits(7) + 11; + repeatedLength = 0; + break; + default: + throw new Jbig2Error("invalid code length in symbol ID table"); + } + for (j = 0; j < numberOfRepeats; j++) { + codes.push(new HuffmanLine([i, repeatedLength, 0, 0])); + i++; + } + } else { + codes.push(new HuffmanLine([i, codeLength, 0, 0])); + i++; + } + } + reader.byteAlign(); + const symbolIDTable = new HuffmanTable(codes, false); + let customIndex = 0, + tableFirstS, + tableDeltaS, + tableDeltaT; + switch (textRegion.huffmanFS) { + case 0: + case 1: + tableFirstS = getStandardTable(textRegion.huffmanFS + 6); + break; + case 3: + tableFirstS = getCustomHuffmanTable(customIndex, referredTo, customTables); + customIndex++; + break; + default: + throw new Jbig2Error("invalid Huffman FS selector"); + } + switch (textRegion.huffmanDS) { + case 0: + case 1: + case 2: + tableDeltaS = getStandardTable(textRegion.huffmanDS + 8); + break; + case 3: + tableDeltaS = getCustomHuffmanTable(customIndex, referredTo, customTables); + customIndex++; + break; + default: + throw new Jbig2Error("invalid Huffman DS selector"); + } + switch (textRegion.huffmanDT) { + case 0: + case 1: + case 2: + tableDeltaT = getStandardTable(textRegion.huffmanDT + 11); + break; + case 3: + tableDeltaT = getCustomHuffmanTable(customIndex, referredTo, customTables); + customIndex++; + break; + default: + throw new Jbig2Error("invalid Huffman DT selector"); + } + if (textRegion.refinement) { + throw new Jbig2Error("refinement with Huffman is not supported"); + } + return { + symbolIDTable, + tableFirstS, + tableDeltaS, + tableDeltaT + }; +} +function getSymbolDictionaryHuffmanTables(dictionary, referredTo, customTables) { + let customIndex = 0, + tableDeltaHeight, + tableDeltaWidth; + switch (dictionary.huffmanDHSelector) { + case 0: + case 1: + tableDeltaHeight = getStandardTable(dictionary.huffmanDHSelector + 4); + break; + case 3: + tableDeltaHeight = getCustomHuffmanTable(customIndex, referredTo, customTables); + customIndex++; + break; + default: + throw new Jbig2Error("invalid Huffman DH selector"); + } + switch (dictionary.huffmanDWSelector) { + case 0: + case 1: + tableDeltaWidth = getStandardTable(dictionary.huffmanDWSelector + 2); + break; + case 3: + tableDeltaWidth = getCustomHuffmanTable(customIndex, referredTo, customTables); + customIndex++; + break; + default: + throw new Jbig2Error("invalid Huffman DW selector"); + } + let tableBitmapSize, tableAggregateInstances; + if (dictionary.bitmapSizeSelector) { + tableBitmapSize = getCustomHuffmanTable(customIndex, referredTo, customTables); + customIndex++; + } else { + tableBitmapSize = getStandardTable(1); + } + if (dictionary.aggregationInstancesSelector) { + tableAggregateInstances = getCustomHuffmanTable(customIndex, referredTo, customTables); + } else { + tableAggregateInstances = getStandardTable(1); + } + return { + tableDeltaHeight, + tableDeltaWidth, + tableBitmapSize, + tableAggregateInstances + }; +} +function readUncompressedBitmap(reader, width, height) { + const bitmap = []; + for (let y = 0; y < height; y++) { + const row = new Uint8Array(width); + bitmap.push(row); + for (let x = 0; x < width; x++) { + row[x] = reader.readBit(); + } + reader.byteAlign(); + } + return bitmap; +} +function decodeMMRBitmap(input, width, height, endOfBlock) { + const params = { + K: -1, + Columns: width, + Rows: height, + BlackIs1: true, + EndOfBlock: endOfBlock + }; + const decoder = new CCITTFaxDecoder(input, params); + const bitmap = []; + let currentByte, + eof = false; + for (let y = 0; y < height; y++) { + const row = new Uint8Array(width); + bitmap.push(row); + let shift = -1; + for (let x = 0; x < width; x++) { + if (shift < 0) { + currentByte = decoder.readNextChar(); + if (currentByte === -1) { + currentByte = 0; + eof = true; + } + shift = 7; + } + row[x] = currentByte >> shift & 1; + shift--; + } + } + if (endOfBlock && !eof) { + const lookForEOFLimit = 5; + for (let i = 0; i < lookForEOFLimit; i++) { + if (decoder.readNextChar() === -1) { + break; + } + } + } + return bitmap; +} +class Jbig2Image { + parseChunks(chunks) { + return parseJbig2Chunks(chunks); + } + parse(data) { + throw new Error("Not implemented: Jbig2Image.parse"); + } +} + +;// CONCATENATED MODULE: ./src/core/jbig2_stream.js + + + + + +class Jbig2Stream extends DecodeStream { + constructor(stream, maybeLength, params) { + super(maybeLength); + this.stream = stream; + this.dict = stream.dict; + this.maybeLength = maybeLength; + this.params = params; + } + get bytes() { + return shadow(this, "bytes", this.stream.getBytes(this.maybeLength)); + } + ensureBuffer(requested) {} + readBlock() { + if (this.eof) { + return; + } + const jbig2Image = new Jbig2Image(); + const chunks = []; + if (this.params instanceof Dict) { + const globalsStream = this.params.get("JBIG2Globals"); + if (globalsStream instanceof BaseStream) { + const globals = globalsStream.getBytes(); + chunks.push({ + data: globals, + start: 0, + end: globals.length + }); + } + } + chunks.push({ + data: this.bytes, + start: 0, + end: this.bytes.length + }); + const data = jbig2Image.parseChunks(chunks); + const dataLength = data.length; + for (let i = 0; i < dataLength; i++) { + data[i] ^= 0xff; + } + this.buffer = data; + this.bufferLength = dataLength; + this.eof = true; + } +} + +;// CONCATENATED MODULE: ./src/shared/image_utils.js + +function convertToRGBA(params) { + switch (params.kind) { + case ImageKind.GRAYSCALE_1BPP: + return convertBlackAndWhiteToRGBA(params); + case ImageKind.RGB_24BPP: + return convertRGBToRGBA(params); + } + return null; +} +function convertBlackAndWhiteToRGBA({ + src, + srcPos = 0, + dest, + width, + height, + nonBlackColor = 0xffffffff, + inverseDecode = false +}) { + const black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff; + const [zeroMapping, oneMapping] = inverseDecode ? [nonBlackColor, black] : [black, nonBlackColor]; + const widthInSource = width >> 3; + const widthRemainder = width & 7; + const srcLength = src.length; + dest = new Uint32Array(dest.buffer); + let destPos = 0; + for (let i = 0; i < height; i++) { + for (const max = srcPos + widthInSource; srcPos < max; srcPos++) { + const elem = srcPos < srcLength ? src[srcPos] : 255; + dest[destPos++] = elem & 0b10000000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b1000000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b100000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b10000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b1000 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b100 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b10 ? oneMapping : zeroMapping; + dest[destPos++] = elem & 0b1 ? oneMapping : zeroMapping; + } + if (widthRemainder === 0) { + continue; + } + const elem = srcPos < srcLength ? src[srcPos++] : 255; + for (let j = 0; j < widthRemainder; j++) { + dest[destPos++] = elem & 1 << 7 - j ? oneMapping : zeroMapping; + } + } + return { + srcPos, + destPos + }; +} +function convertRGBToRGBA({ + src, + srcPos = 0, + dest, + destPos = 0, + width, + height +}) { + let i = 0; + const len32 = src.length >> 2; + const src32 = new Uint32Array(src.buffer, srcPos, len32); + if (FeatureTest.isLittleEndian) { + for (; i < len32 - 2; i += 3, destPos += 4) { + const s1 = src32[i]; + const s2 = src32[i + 1]; + const s3 = src32[i + 2]; + dest[destPos] = s1 | 0xff000000; + dest[destPos + 1] = s1 >>> 24 | s2 << 8 | 0xff000000; + dest[destPos + 2] = s2 >>> 16 | s3 << 16 | 0xff000000; + dest[destPos + 3] = s3 >>> 8 | 0xff000000; + } + for (let j = i * 4, jj = src.length; j < jj; j += 3) { + dest[destPos++] = src[j] | src[j + 1] << 8 | src[j + 2] << 16 | 0xff000000; + } + } else { + for (; i < len32 - 2; i += 3, destPos += 4) { + const s1 = src32[i]; + const s2 = src32[i + 1]; + const s3 = src32[i + 2]; + dest[destPos] = s1 | 0xff; + dest[destPos + 1] = s1 << 24 | s2 >>> 8 | 0xff; + dest[destPos + 2] = s2 << 16 | s3 >>> 16 | 0xff; + dest[destPos + 3] = s3 << 8 | 0xff; + } + for (let j = i * 4, jj = src.length; j < jj; j += 3) { + dest[destPos++] = src[j] << 24 | src[j + 1] << 16 | src[j + 2] << 8 | 0xff; + } + } + return { + srcPos, + destPos + }; +} +function grayToRGBA(src, dest) { + if (FeatureTest.isLittleEndian) { + for (let i = 0, ii = src.length; i < ii; i++) { + dest[i] = src[i] * 0x10101 | 0xff000000; + } + } else { + for (let i = 0, ii = src.length; i < ii; i++) { + dest[i] = src[i] * 0x1010100 | 0x000000ff; + } + } +} + +;// CONCATENATED MODULE: ./src/core/jpg.js + + + +class JpegError extends BaseException { + constructor(msg) { + super(`JPEG error: ${msg}`, "JpegError"); + } +} +class DNLMarkerError extends BaseException { + constructor(message, scanLines) { + super(message, "DNLMarkerError"); + this.scanLines = scanLines; + } +} +class EOIMarkerError extends BaseException { + constructor(msg) { + super(msg, "EOIMarkerError"); + } +} +const dctZigZag = new Uint8Array([0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63]); +const dctCos1 = 4017; +const dctSin1 = 799; +const dctCos3 = 3406; +const dctSin3 = 2276; +const dctCos6 = 1567; +const dctSin6 = 3784; +const dctSqrt2 = 5793; +const dctSqrt1d2 = 2896; +function buildHuffmanTable(codeLengths, values) { + let k = 0, + i, + j, + length = 16; + while (length > 0 && !codeLengths[length - 1]) { + length--; + } + const code = [{ + children: [], + index: 0 + }]; + let p = code[0], + q; + for (i = 0; i < length; i++) { + for (j = 0; j < codeLengths[i]; j++) { + p = code.pop(); + p.children[p.index] = values[k]; + while (p.index > 0) { + p = code.pop(); + } + p.index++; + code.push(p); + while (code.length <= i) { + code.push(q = { + children: [], + index: 0 + }); + p.children[p.index] = q.children; + p = q; + } + k++; + } + if (i + 1 < length) { + code.push(q = { + children: [], + index: 0 + }); + p.children[p.index] = q.children; + p = q; + } + } + return code[0].children; +} +function getBlockBufferOffset(component, row, col) { + return 64 * ((component.blocksPerLine + 1) * row + col); +} +function decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successivePrev, successive, parseDNLMarker = false) { + const mcusPerLine = frame.mcusPerLine; + const progressive = frame.progressive; + const startOffset = offset; + let bitsData = 0, + bitsCount = 0; + function readBit() { + if (bitsCount > 0) { + bitsCount--; + return bitsData >> bitsCount & 1; + } + bitsData = data[offset++]; + if (bitsData === 0xff) { + const nextByte = data[offset++]; + if (nextByte) { + if (nextByte === 0xdc && parseDNLMarker) { + offset += 2; + const scanLines = readUint16(data, offset); + offset += 2; + if (scanLines > 0 && scanLines !== frame.scanLines) { + throw new DNLMarkerError("Found DNL marker (0xFFDC) while parsing scan data", scanLines); + } + } else if (nextByte === 0xd9) { + if (parseDNLMarker) { + const maybeScanLines = blockRow * (frame.precision === 8 ? 8 : 0); + if (maybeScanLines > 0 && Math.round(frame.scanLines / maybeScanLines) >= 5) { + throw new DNLMarkerError("Found EOI marker (0xFFD9) while parsing scan data, " + "possibly caused by incorrect `scanLines` parameter", maybeScanLines); + } + } + throw new EOIMarkerError("Found EOI marker (0xFFD9) while parsing scan data"); + } + throw new JpegError(`unexpected marker ${(bitsData << 8 | nextByte).toString(16)}`); + } + } + bitsCount = 7; + return bitsData >>> 7; + } + function decodeHuffman(tree) { + let node = tree; + while (true) { + node = node[readBit()]; + switch (typeof node) { + case "number": + return node; + case "object": + continue; + } + throw new JpegError("invalid huffman sequence"); + } + } + function receive(length) { + let n = 0; + while (length > 0) { + n = n << 1 | readBit(); + length--; + } + return n; + } + function receiveAndExtend(length) { + if (length === 1) { + return readBit() === 1 ? 1 : -1; + } + const n = receive(length); + if (n >= 1 << length - 1) { + return n; + } + return n + (-1 << length) + 1; + } + function decodeBaseline(component, blockOffset) { + const t = decodeHuffman(component.huffmanTableDC); + const diff = t === 0 ? 0 : receiveAndExtend(t); + component.blockData[blockOffset] = component.pred += diff; + let k = 1; + while (k < 64) { + const rs = decodeHuffman(component.huffmanTableAC); + const s = rs & 15, + r = rs >> 4; + if (s === 0) { + if (r < 15) { + break; + } + k += 16; + continue; + } + k += r; + const z = dctZigZag[k]; + component.blockData[blockOffset + z] = receiveAndExtend(s); + k++; + } + } + function decodeDCFirst(component, blockOffset) { + const t = decodeHuffman(component.huffmanTableDC); + const diff = t === 0 ? 0 : receiveAndExtend(t) << successive; + component.blockData[blockOffset] = component.pred += diff; + } + function decodeDCSuccessive(component, blockOffset) { + component.blockData[blockOffset] |= readBit() << successive; + } + let eobrun = 0; + function decodeACFirst(component, blockOffset) { + if (eobrun > 0) { + eobrun--; + return; + } + let k = spectralStart; + const e = spectralEnd; + while (k <= e) { + const rs = decodeHuffman(component.huffmanTableAC); + const s = rs & 15, + r = rs >> 4; + if (s === 0) { + if (r < 15) { + eobrun = receive(r) + (1 << r) - 1; + break; + } + k += 16; + continue; + } + k += r; + const z = dctZigZag[k]; + component.blockData[blockOffset + z] = receiveAndExtend(s) * (1 << successive); + k++; + } + } + let successiveACState = 0, + successiveACNextValue; + function decodeACSuccessive(component, blockOffset) { + let k = spectralStart; + const e = spectralEnd; + let r = 0; + let s; + let rs; + while (k <= e) { + const offsetZ = blockOffset + dctZigZag[k]; + const sign = component.blockData[offsetZ] < 0 ? -1 : 1; + switch (successiveACState) { + case 0: + rs = decodeHuffman(component.huffmanTableAC); + s = rs & 15; + r = rs >> 4; + if (s === 0) { + if (r < 15) { + eobrun = receive(r) + (1 << r); + successiveACState = 4; + } else { + r = 16; + successiveACState = 1; + } + } else { + if (s !== 1) { + throw new JpegError("invalid ACn encoding"); + } + successiveACNextValue = receiveAndExtend(s); + successiveACState = r ? 2 : 3; + } + continue; + case 1: + case 2: + if (component.blockData[offsetZ]) { + component.blockData[offsetZ] += sign * (readBit() << successive); + } else { + r--; + if (r === 0) { + successiveACState = successiveACState === 2 ? 3 : 0; + } + } + break; + case 3: + if (component.blockData[offsetZ]) { + component.blockData[offsetZ] += sign * (readBit() << successive); + } else { + component.blockData[offsetZ] = successiveACNextValue << successive; + successiveACState = 0; + } + break; + case 4: + if (component.blockData[offsetZ]) { + component.blockData[offsetZ] += sign * (readBit() << successive); + } + break; + } + k++; + } + if (successiveACState === 4) { + eobrun--; + if (eobrun === 0) { + successiveACState = 0; + } + } + } + let blockRow = 0; + function decodeMcu(component, decode, mcu, row, col) { + const mcuRow = mcu / mcusPerLine | 0; + const mcuCol = mcu % mcusPerLine; + blockRow = mcuRow * component.v + row; + const blockCol = mcuCol * component.h + col; + const blockOffset = getBlockBufferOffset(component, blockRow, blockCol); + decode(component, blockOffset); + } + function decodeBlock(component, decode, mcu) { + blockRow = mcu / component.blocksPerLine | 0; + const blockCol = mcu % component.blocksPerLine; + const blockOffset = getBlockBufferOffset(component, blockRow, blockCol); + decode(component, blockOffset); + } + const componentsLength = components.length; + let component, i, j, k, n; + let decodeFn; + if (progressive) { + if (spectralStart === 0) { + decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive; + } else { + decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive; + } + } else { + decodeFn = decodeBaseline; + } + let mcu = 0, + fileMarker; + const mcuExpected = componentsLength === 1 ? components[0].blocksPerLine * components[0].blocksPerColumn : mcusPerLine * frame.mcusPerColumn; + let h, v; + while (mcu <= mcuExpected) { + const mcuToRead = resetInterval ? Math.min(mcuExpected - mcu, resetInterval) : mcuExpected; + if (mcuToRead > 0) { + for (i = 0; i < componentsLength; i++) { + components[i].pred = 0; + } + eobrun = 0; + if (componentsLength === 1) { + component = components[0]; + for (n = 0; n < mcuToRead; n++) { + decodeBlock(component, decodeFn, mcu); + mcu++; + } + } else { + for (n = 0; n < mcuToRead; n++) { + for (i = 0; i < componentsLength; i++) { + component = components[i]; + h = component.h; + v = component.v; + for (j = 0; j < v; j++) { + for (k = 0; k < h; k++) { + decodeMcu(component, decodeFn, mcu, j, k); + } + } + } + mcu++; + } + } + } + bitsCount = 0; + fileMarker = findNextFileMarker(data, offset); + if (!fileMarker) { + break; + } + if (fileMarker.invalid) { + const partialMsg = mcuToRead > 0 ? "unexpected" : "excessive"; + warn(`decodeScan - ${partialMsg} MCU data, current marker is: ${fileMarker.invalid}`); + offset = fileMarker.offset; + } + if (fileMarker.marker >= 0xffd0 && fileMarker.marker <= 0xffd7) { + offset += 2; + } else { + break; + } + } + return offset - startOffset; +} +function quantizeAndInverse(component, blockBufferOffset, p) { + const qt = component.quantizationTable, + blockData = component.blockData; + let v0, v1, v2, v3, v4, v5, v6, v7; + let p0, p1, p2, p3, p4, p5, p6, p7; + let t; + if (!qt) { + throw new JpegError("missing required Quantization Table."); + } + for (let row = 0; row < 64; row += 8) { + p0 = blockData[blockBufferOffset + row]; + p1 = blockData[blockBufferOffset + row + 1]; + p2 = blockData[blockBufferOffset + row + 2]; + p3 = blockData[blockBufferOffset + row + 3]; + p4 = blockData[blockBufferOffset + row + 4]; + p5 = blockData[blockBufferOffset + row + 5]; + p6 = blockData[blockBufferOffset + row + 6]; + p7 = blockData[blockBufferOffset + row + 7]; + p0 *= qt[row]; + if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { + t = dctSqrt2 * p0 + 512 >> 10; + p[row] = t; + p[row + 1] = t; + p[row + 2] = t; + p[row + 3] = t; + p[row + 4] = t; + p[row + 5] = t; + p[row + 6] = t; + p[row + 7] = t; + continue; + } + p1 *= qt[row + 1]; + p2 *= qt[row + 2]; + p3 *= qt[row + 3]; + p4 *= qt[row + 4]; + p5 *= qt[row + 5]; + p6 *= qt[row + 6]; + p7 *= qt[row + 7]; + v0 = dctSqrt2 * p0 + 128 >> 8; + v1 = dctSqrt2 * p4 + 128 >> 8; + v2 = p2; + v3 = p6; + v4 = dctSqrt1d2 * (p1 - p7) + 128 >> 8; + v7 = dctSqrt1d2 * (p1 + p7) + 128 >> 8; + v5 = p3 << 4; + v6 = p5 << 4; + v0 = v0 + v1 + 1 >> 1; + v1 = v0 - v1; + t = v2 * dctSin6 + v3 * dctCos6 + 128 >> 8; + v2 = v2 * dctCos6 - v3 * dctSin6 + 128 >> 8; + v3 = t; + v4 = v4 + v6 + 1 >> 1; + v6 = v4 - v6; + v7 = v7 + v5 + 1 >> 1; + v5 = v7 - v5; + v0 = v0 + v3 + 1 >> 1; + v3 = v0 - v3; + v1 = v1 + v2 + 1 >> 1; + v2 = v1 - v2; + t = v4 * dctSin3 + v7 * dctCos3 + 2048 >> 12; + v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12; + v7 = t; + t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12; + v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12; + v6 = t; + p[row] = v0 + v7; + p[row + 7] = v0 - v7; + p[row + 1] = v1 + v6; + p[row + 6] = v1 - v6; + p[row + 2] = v2 + v5; + p[row + 5] = v2 - v5; + p[row + 3] = v3 + v4; + p[row + 4] = v3 - v4; + } + for (let col = 0; col < 8; ++col) { + p0 = p[col]; + p1 = p[col + 8]; + p2 = p[col + 16]; + p3 = p[col + 24]; + p4 = p[col + 32]; + p5 = p[col + 40]; + p6 = p[col + 48]; + p7 = p[col + 56]; + if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) { + t = dctSqrt2 * p0 + 8192 >> 14; + if (t < -2040) { + t = 0; + } else if (t >= 2024) { + t = 255; + } else { + t = t + 2056 >> 4; + } + blockData[blockBufferOffset + col] = t; + blockData[blockBufferOffset + col + 8] = t; + blockData[blockBufferOffset + col + 16] = t; + blockData[blockBufferOffset + col + 24] = t; + blockData[blockBufferOffset + col + 32] = t; + blockData[blockBufferOffset + col + 40] = t; + blockData[blockBufferOffset + col + 48] = t; + blockData[blockBufferOffset + col + 56] = t; + continue; + } + v0 = dctSqrt2 * p0 + 2048 >> 12; + v1 = dctSqrt2 * p4 + 2048 >> 12; + v2 = p2; + v3 = p6; + v4 = dctSqrt1d2 * (p1 - p7) + 2048 >> 12; + v7 = dctSqrt1d2 * (p1 + p7) + 2048 >> 12; + v5 = p3; + v6 = p5; + v0 = (v0 + v1 + 1 >> 1) + 4112; + v1 = v0 - v1; + t = v2 * dctSin6 + v3 * dctCos6 + 2048 >> 12; + v2 = v2 * dctCos6 - v3 * dctSin6 + 2048 >> 12; + v3 = t; + v4 = v4 + v6 + 1 >> 1; + v6 = v4 - v6; + v7 = v7 + v5 + 1 >> 1; + v5 = v7 - v5; + v0 = v0 + v3 + 1 >> 1; + v3 = v0 - v3; + v1 = v1 + v2 + 1 >> 1; + v2 = v1 - v2; + t = v4 * dctSin3 + v7 * dctCos3 + 2048 >> 12; + v4 = v4 * dctCos3 - v7 * dctSin3 + 2048 >> 12; + v7 = t; + t = v5 * dctSin1 + v6 * dctCos1 + 2048 >> 12; + v5 = v5 * dctCos1 - v6 * dctSin1 + 2048 >> 12; + v6 = t; + p0 = v0 + v7; + p7 = v0 - v7; + p1 = v1 + v6; + p6 = v1 - v6; + p2 = v2 + v5; + p5 = v2 - v5; + p3 = v3 + v4; + p4 = v3 - v4; + if (p0 < 16) { + p0 = 0; + } else if (p0 >= 4080) { + p0 = 255; + } else { + p0 >>= 4; + } + if (p1 < 16) { + p1 = 0; + } else if (p1 >= 4080) { + p1 = 255; + } else { + p1 >>= 4; + } + if (p2 < 16) { + p2 = 0; + } else if (p2 >= 4080) { + p2 = 255; + } else { + p2 >>= 4; + } + if (p3 < 16) { + p3 = 0; + } else if (p3 >= 4080) { + p3 = 255; + } else { + p3 >>= 4; + } + if (p4 < 16) { + p4 = 0; + } else if (p4 >= 4080) { + p4 = 255; + } else { + p4 >>= 4; + } + if (p5 < 16) { + p5 = 0; + } else if (p5 >= 4080) { + p5 = 255; + } else { + p5 >>= 4; + } + if (p6 < 16) { + p6 = 0; + } else if (p6 >= 4080) { + p6 = 255; + } else { + p6 >>= 4; + } + if (p7 < 16) { + p7 = 0; + } else if (p7 >= 4080) { + p7 = 255; + } else { + p7 >>= 4; + } + blockData[blockBufferOffset + col] = p0; + blockData[blockBufferOffset + col + 8] = p1; + blockData[blockBufferOffset + col + 16] = p2; + blockData[blockBufferOffset + col + 24] = p3; + blockData[blockBufferOffset + col + 32] = p4; + blockData[blockBufferOffset + col + 40] = p5; + blockData[blockBufferOffset + col + 48] = p6; + blockData[blockBufferOffset + col + 56] = p7; + } +} +function buildComponentData(frame, component) { + const blocksPerLine = component.blocksPerLine; + const blocksPerColumn = component.blocksPerColumn; + const computationBuffer = new Int16Array(64); + for (let blockRow = 0; blockRow < blocksPerColumn; blockRow++) { + for (let blockCol = 0; blockCol < blocksPerLine; blockCol++) { + const offset = getBlockBufferOffset(component, blockRow, blockCol); + quantizeAndInverse(component, offset, computationBuffer); + } + } + return component.blockData; +} +function findNextFileMarker(data, currentPos, startPos = currentPos) { + const maxPos = data.length - 1; + let newPos = startPos < currentPos ? startPos : currentPos; + if (currentPos >= maxPos) { + return null; + } + const currentMarker = readUint16(data, currentPos); + if (currentMarker >= 0xffc0 && currentMarker <= 0xfffe) { + return { + invalid: null, + marker: currentMarker, + offset: currentPos + }; + } + let newMarker = readUint16(data, newPos); + while (!(newMarker >= 0xffc0 && newMarker <= 0xfffe)) { + if (++newPos >= maxPos) { + return null; + } + newMarker = readUint16(data, newPos); + } + return { + invalid: currentMarker.toString(16), + marker: newMarker, + offset: newPos + }; +} +class JpegImage { + constructor({ + decodeTransform = null, + colorTransform = -1 + } = {}) { + this._decodeTransform = decodeTransform; + this._colorTransform = colorTransform; + } + parse(data, { + dnlScanLines = null + } = {}) { + function readDataBlock() { + const length = readUint16(data, offset); + offset += 2; + let endOffset = offset + length - 2; + const fileMarker = findNextFileMarker(data, endOffset, offset); + if (fileMarker?.invalid) { + warn("readDataBlock - incorrect length, current marker is: " + fileMarker.invalid); + endOffset = fileMarker.offset; + } + const array = data.subarray(offset, endOffset); + offset += array.length; + return array; + } + function prepareComponents(frame) { + const mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / frame.maxH); + const mcusPerColumn = Math.ceil(frame.scanLines / 8 / frame.maxV); + for (const component of frame.components) { + const blocksPerLine = Math.ceil(Math.ceil(frame.samplesPerLine / 8) * component.h / frame.maxH); + const blocksPerColumn = Math.ceil(Math.ceil(frame.scanLines / 8) * component.v / frame.maxV); + const blocksPerLineForMcu = mcusPerLine * component.h; + const blocksPerColumnForMcu = mcusPerColumn * component.v; + const blocksBufferSize = 64 * blocksPerColumnForMcu * (blocksPerLineForMcu + 1); + component.blockData = new Int16Array(blocksBufferSize); + component.blocksPerLine = blocksPerLine; + component.blocksPerColumn = blocksPerColumn; + } + frame.mcusPerLine = mcusPerLine; + frame.mcusPerColumn = mcusPerColumn; + } + let offset = 0; + let jfif = null; + let adobe = null; + let frame, resetInterval; + let numSOSMarkers = 0; + const quantizationTables = []; + const huffmanTablesAC = [], + huffmanTablesDC = []; + let fileMarker = readUint16(data, offset); + offset += 2; + if (fileMarker !== 0xffd8) { + throw new JpegError("SOI not found"); + } + fileMarker = readUint16(data, offset); + offset += 2; + markerLoop: while (fileMarker !== 0xffd9) { + let i, j, l; + switch (fileMarker) { + case 0xffe0: + case 0xffe1: + case 0xffe2: + case 0xffe3: + case 0xffe4: + case 0xffe5: + case 0xffe6: + case 0xffe7: + case 0xffe8: + case 0xffe9: + case 0xffea: + case 0xffeb: + case 0xffec: + case 0xffed: + case 0xffee: + case 0xffef: + case 0xfffe: + const appData = readDataBlock(); + if (fileMarker === 0xffe0) { + if (appData[0] === 0x4a && appData[1] === 0x46 && appData[2] === 0x49 && appData[3] === 0x46 && appData[4] === 0) { + jfif = { + version: { + major: appData[5], + minor: appData[6] + }, + densityUnits: appData[7], + xDensity: appData[8] << 8 | appData[9], + yDensity: appData[10] << 8 | appData[11], + thumbWidth: appData[12], + thumbHeight: appData[13], + thumbData: appData.subarray(14, 14 + 3 * appData[12] * appData[13]) + }; + } + } + if (fileMarker === 0xffee) { + if (appData[0] === 0x41 && appData[1] === 0x64 && appData[2] === 0x6f && appData[3] === 0x62 && appData[4] === 0x65) { + adobe = { + version: appData[5] << 8 | appData[6], + flags0: appData[7] << 8 | appData[8], + flags1: appData[9] << 8 | appData[10], + transformCode: appData[11] + }; + } + } + break; + case 0xffdb: + const quantizationTablesLength = readUint16(data, offset); + offset += 2; + const quantizationTablesEnd = quantizationTablesLength + offset - 2; + let z; + while (offset < quantizationTablesEnd) { + const quantizationTableSpec = data[offset++]; + const tableData = new Uint16Array(64); + if (quantizationTableSpec >> 4 === 0) { + for (j = 0; j < 64; j++) { + z = dctZigZag[j]; + tableData[z] = data[offset++]; + } + } else if (quantizationTableSpec >> 4 === 1) { + for (j = 0; j < 64; j++) { + z = dctZigZag[j]; + tableData[z] = readUint16(data, offset); + offset += 2; + } + } else { + throw new JpegError("DQT - invalid table spec"); + } + quantizationTables[quantizationTableSpec & 15] = tableData; + } + break; + case 0xffc0: + case 0xffc1: + case 0xffc2: + if (frame) { + throw new JpegError("Only single frame JPEGs supported"); + } + offset += 2; + frame = {}; + frame.extended = fileMarker === 0xffc1; + frame.progressive = fileMarker === 0xffc2; + frame.precision = data[offset++]; + const sofScanLines = readUint16(data, offset); + offset += 2; + frame.scanLines = dnlScanLines || sofScanLines; + frame.samplesPerLine = readUint16(data, offset); + offset += 2; + frame.components = []; + frame.componentIds = {}; + const componentsCount = data[offset++]; + let maxH = 0, + maxV = 0; + for (i = 0; i < componentsCount; i++) { + const componentId = data[offset]; + const h = data[offset + 1] >> 4; + const v = data[offset + 1] & 15; + if (maxH < h) { + maxH = h; + } + if (maxV < v) { + maxV = v; + } + const qId = data[offset + 2]; + l = frame.components.push({ + h, + v, + quantizationId: qId, + quantizationTable: null + }); + frame.componentIds[componentId] = l - 1; + offset += 3; + } + frame.maxH = maxH; + frame.maxV = maxV; + prepareComponents(frame); + break; + case 0xffc4: + const huffmanLength = readUint16(data, offset); + offset += 2; + for (i = 2; i < huffmanLength;) { + const huffmanTableSpec = data[offset++]; + const codeLengths = new Uint8Array(16); + let codeLengthSum = 0; + for (j = 0; j < 16; j++, offset++) { + codeLengthSum += codeLengths[j] = data[offset]; + } + const huffmanValues = new Uint8Array(codeLengthSum); + for (j = 0; j < codeLengthSum; j++, offset++) { + huffmanValues[j] = data[offset]; + } + i += 17 + codeLengthSum; + (huffmanTableSpec >> 4 === 0 ? huffmanTablesDC : huffmanTablesAC)[huffmanTableSpec & 15] = buildHuffmanTable(codeLengths, huffmanValues); + } + break; + case 0xffdd: + offset += 2; + resetInterval = readUint16(data, offset); + offset += 2; + break; + case 0xffda: + const parseDNLMarker = ++numSOSMarkers === 1 && !dnlScanLines; + offset += 2; + const selectorsCount = data[offset++], + components = []; + for (i = 0; i < selectorsCount; i++) { + const index = data[offset++]; + const componentIndex = frame.componentIds[index]; + const component = frame.components[componentIndex]; + component.index = index; + const tableSpec = data[offset++]; + component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4]; + component.huffmanTableAC = huffmanTablesAC[tableSpec & 15]; + components.push(component); + } + const spectralStart = data[offset++], + spectralEnd = data[offset++], + successiveApproximation = data[offset++]; + try { + const processed = decodeScan(data, offset, frame, components, resetInterval, spectralStart, spectralEnd, successiveApproximation >> 4, successiveApproximation & 15, parseDNLMarker); + offset += processed; + } catch (ex) { + if (ex instanceof DNLMarkerError) { + warn(`${ex.message} -- attempting to re-parse the JPEG image.`); + return this.parse(data, { + dnlScanLines: ex.scanLines + }); + } else if (ex instanceof EOIMarkerError) { + warn(`${ex.message} -- ignoring the rest of the image data.`); + break markerLoop; + } + throw ex; + } + break; + case 0xffdc: + offset += 4; + break; + case 0xffff: + if (data[offset] !== 0xff) { + offset--; + } + break; + default: + const nextFileMarker = findNextFileMarker(data, offset - 2, offset - 3); + if (nextFileMarker?.invalid) { + warn("JpegImage.parse - unexpected data, current marker is: " + nextFileMarker.invalid); + offset = nextFileMarker.offset; + break; + } + if (!nextFileMarker || offset >= data.length - 1) { + warn("JpegImage.parse - reached the end of the image data " + "without finding an EOI marker (0xFFD9)."); + break markerLoop; + } + throw new JpegError("JpegImage.parse - unknown marker: " + fileMarker.toString(16)); + } + fileMarker = readUint16(data, offset); + offset += 2; + } + if (!frame) { + throw new JpegError("JpegImage.parse - no frame data found."); + } + this.width = frame.samplesPerLine; + this.height = frame.scanLines; + this.jfif = jfif; + this.adobe = adobe; + this.components = []; + for (const component of frame.components) { + const quantizationTable = quantizationTables[component.quantizationId]; + if (quantizationTable) { + component.quantizationTable = quantizationTable; + } + this.components.push({ + index: component.index, + output: buildComponentData(frame, component), + scaleX: component.h / frame.maxH, + scaleY: component.v / frame.maxV, + blocksPerLine: component.blocksPerLine, + blocksPerColumn: component.blocksPerColumn + }); + } + this.numComponents = this.components.length; + return undefined; + } + _getLinearizedBlockData(width, height, isSourcePDF = false) { + const scaleX = this.width / width, + scaleY = this.height / height; + let component, componentScaleX, componentScaleY, blocksPerScanline; + let x, y, i, j, k; + let index; + let offset = 0; + let output; + const numComponents = this.components.length; + const dataLength = width * height * numComponents; + const data = new Uint8ClampedArray(dataLength); + const xScaleBlockOffset = new Uint32Array(width); + const mask3LSB = 0xfffffff8; + let lastComponentScaleX; + for (i = 0; i < numComponents; i++) { + component = this.components[i]; + componentScaleX = component.scaleX * scaleX; + componentScaleY = component.scaleY * scaleY; + offset = i; + output = component.output; + blocksPerScanline = component.blocksPerLine + 1 << 3; + if (componentScaleX !== lastComponentScaleX) { + for (x = 0; x < width; x++) { + j = 0 | x * componentScaleX; + xScaleBlockOffset[x] = (j & mask3LSB) << 3 | j & 7; + } + lastComponentScaleX = componentScaleX; + } + for (y = 0; y < height; y++) { + j = 0 | y * componentScaleY; + index = blocksPerScanline * (j & mask3LSB) | (j & 7) << 3; + for (x = 0; x < width; x++) { + data[offset] = output[index + xScaleBlockOffset[x]]; + offset += numComponents; + } + } + } + let transform = this._decodeTransform; + if (!isSourcePDF && numComponents === 4 && !transform) { + transform = new Int32Array([-256, 255, -256, 255, -256, 255, -256, 255]); + } + if (transform) { + for (i = 0; i < dataLength;) { + for (j = 0, k = 0; j < numComponents; j++, i++, k += 2) { + data[i] = (data[i] * transform[k] >> 8) + transform[k + 1]; + } + } + } + return data; + } + get _isColorConversionNeeded() { + if (this.adobe) { + return !!this.adobe.transformCode; + } + if (this.numComponents === 3) { + if (this._colorTransform === 0) { + return false; + } else if (this.components[0].index === 0x52 && this.components[1].index === 0x47 && this.components[2].index === 0x42) { + return false; + } + return true; + } + if (this._colorTransform === 1) { + return true; + } + return false; + } + _convertYccToRgb(data) { + let Y, Cb, Cr; + for (let i = 0, length = data.length; i < length; i += 3) { + Y = data[i]; + Cb = data[i + 1]; + Cr = data[i + 2]; + data[i] = Y - 179.456 + 1.402 * Cr; + data[i + 1] = Y + 135.459 - 0.344 * Cb - 0.714 * Cr; + data[i + 2] = Y - 226.816 + 1.772 * Cb; + } + return data; + } + _convertYccToRgba(data, out) { + for (let i = 0, j = 0, length = data.length; i < length; i += 3, j += 4) { + const Y = data[i]; + const Cb = data[i + 1]; + const Cr = data[i + 2]; + out[j] = Y - 179.456 + 1.402 * Cr; + out[j + 1] = Y + 135.459 - 0.344 * Cb - 0.714 * Cr; + out[j + 2] = Y - 226.816 + 1.772 * Cb; + out[j + 3] = 255; + } + return out; + } + _convertYcckToRgb(data) { + let Y, Cb, Cr, k; + let offset = 0; + for (let i = 0, length = data.length; i < length; i += 4) { + Y = data[i]; + Cb = data[i + 1]; + Cr = data[i + 2]; + k = data[i + 3]; + data[offset++] = -122.67195406894 + Cb * (-6.60635669420364e-5 * Cb + 0.000437130475926232 * Cr - 5.4080610064599e-5 * Y + 0.00048449797120281 * k - 0.154362151871126) + Cr * (-0.000957964378445773 * Cr + 0.000817076911346625 * Y - 0.00477271405408747 * k + 1.53380253221734) + Y * (0.000961250184130688 * Y - 0.00266257332283933 * k + 0.48357088451265) + k * (-0.000336197177618394 * k + 0.484791561490776); + data[offset++] = 107.268039397724 + Cb * (2.19927104525741e-5 * Cb - 0.000640992018297945 * Cr + 0.000659397001245577 * Y + 0.000426105652938837 * k - 0.176491792462875) + Cr * (-0.000778269941513683 * Cr + 0.00130872261408275 * Y + 0.000770482631801132 * k - 0.151051492775562) + Y * (0.00126935368114843 * Y - 0.00265090189010898 * k + 0.25802910206845) + k * (-0.000318913117588328 * k - 0.213742400323665); + data[offset++] = -20.810012546947 + Cb * (-0.000570115196973677 * Cb - 2.63409051004589e-5 * Cr + 0.0020741088115012 * Y - 0.00288260236853442 * k + 0.814272968359295) + Cr * (-1.53496057440975e-5 * Cr - 0.000132689043961446 * Y + 0.000560833691242812 * k - 0.195152027534049) + Y * (0.00174418132927582 * Y - 0.00255243321439347 * k + 0.116935020465145) + k * (-0.000343531996510555 * k + 0.24165260232407); + } + return data.subarray(0, offset); + } + _convertYcckToRgba(data) { + for (let i = 0, length = data.length; i < length; i += 4) { + const Y = data[i]; + const Cb = data[i + 1]; + const Cr = data[i + 2]; + const k = data[i + 3]; + data[i] = -122.67195406894 + Cb * (-6.60635669420364e-5 * Cb + 0.000437130475926232 * Cr - 5.4080610064599e-5 * Y + 0.00048449797120281 * k - 0.154362151871126) + Cr * (-0.000957964378445773 * Cr + 0.000817076911346625 * Y - 0.00477271405408747 * k + 1.53380253221734) + Y * (0.000961250184130688 * Y - 0.00266257332283933 * k + 0.48357088451265) + k * (-0.000336197177618394 * k + 0.484791561490776); + data[i + 1] = 107.268039397724 + Cb * (2.19927104525741e-5 * Cb - 0.000640992018297945 * Cr + 0.000659397001245577 * Y + 0.000426105652938837 * k - 0.176491792462875) + Cr * (-0.000778269941513683 * Cr + 0.00130872261408275 * Y + 0.000770482631801132 * k - 0.151051492775562) + Y * (0.00126935368114843 * Y - 0.00265090189010898 * k + 0.25802910206845) + k * (-0.000318913117588328 * k - 0.213742400323665); + data[i + 2] = -20.810012546947 + Cb * (-0.000570115196973677 * Cb - 2.63409051004589e-5 * Cr + 0.0020741088115012 * Y - 0.00288260236853442 * k + 0.814272968359295) + Cr * (-1.53496057440975e-5 * Cr - 0.000132689043961446 * Y + 0.000560833691242812 * k - 0.195152027534049) + Y * (0.00174418132927582 * Y - 0.00255243321439347 * k + 0.116935020465145) + k * (-0.000343531996510555 * k + 0.24165260232407); + data[i + 3] = 255; + } + return data; + } + _convertYcckToCmyk(data) { + let Y, Cb, Cr; + for (let i = 0, length = data.length; i < length; i += 4) { + Y = data[i]; + Cb = data[i + 1]; + Cr = data[i + 2]; + data[i] = 434.456 - Y - 1.402 * Cr; + data[i + 1] = 119.541 - Y + 0.344 * Cb + 0.714 * Cr; + data[i + 2] = 481.816 - Y - 1.772 * Cb; + } + return data; + } + _convertCmykToRgb(data) { + let c, m, y, k; + let offset = 0; + for (let i = 0, length = data.length; i < length; i += 4) { + c = data[i]; + m = data[i + 1]; + y = data[i + 2]; + k = data[i + 3]; + data[offset++] = 255 + c * (-0.00006747147073602441 * c + 0.0008379262121013727 * m + 0.0002894718188643294 * y + 0.003264231057537806 * k - 1.1185611867203937) + m * (0.000026374107616089405 * m - 0.00008626949158638572 * y - 0.0002748769067499491 * k - 0.02155688794978967) + y * (-0.00003878099212869363 * y - 0.0003267808279485286 * k + 0.0686742238595345) - k * (0.0003361971776183937 * k + 0.7430659151342254); + data[offset++] = 255 + c * (0.00013596372813588848 * c + 0.000924537132573585 * m + 0.00010567359618683593 * y + 0.0004791864687436512 * k - 0.3109689587515875) + m * (-0.00023545346108370344 * m + 0.0002702845253534714 * y + 0.0020200308977307156 * k - 0.7488052167015494) + y * (0.00006834815998235662 * y + 0.00015168452363460973 * k - 0.09751927774728933) - k * (0.0003189131175883281 * k + 0.7364883807733168); + data[offset++] = 255 + c * (0.000013598650411385307 * c + 0.00012423956175490851 * m + 0.0004751985097583589 * y - 0.0000036729317476630422 * k - 0.05562186980264034) + m * (0.00016141380598724676 * m + 0.0009692239130725186 * y + 0.0007782692450036253 * k - 0.44015232367526463) + y * (5.068882914068769e-7 * y + 0.0017778369011375071 * k - 0.7591454649749609) - k * (0.0003435319965105553 * k + 0.7063770186160144); + } + return data.subarray(0, offset); + } + _convertCmykToRgba(data) { + for (let i = 0, length = data.length; i < length; i += 4) { + const c = data[i]; + const m = data[i + 1]; + const y = data[i + 2]; + const k = data[i + 3]; + data[i] = 255 + c * (-0.00006747147073602441 * c + 0.0008379262121013727 * m + 0.0002894718188643294 * y + 0.003264231057537806 * k - 1.1185611867203937) + m * (0.000026374107616089405 * m - 0.00008626949158638572 * y - 0.0002748769067499491 * k - 0.02155688794978967) + y * (-0.00003878099212869363 * y - 0.0003267808279485286 * k + 0.0686742238595345) - k * (0.0003361971776183937 * k + 0.7430659151342254); + data[i + 1] = 255 + c * (0.00013596372813588848 * c + 0.000924537132573585 * m + 0.00010567359618683593 * y + 0.0004791864687436512 * k - 0.3109689587515875) + m * (-0.00023545346108370344 * m + 0.0002702845253534714 * y + 0.0020200308977307156 * k - 0.7488052167015494) + y * (0.00006834815998235662 * y + 0.00015168452363460973 * k - 0.09751927774728933) - k * (0.0003189131175883281 * k + 0.7364883807733168); + data[i + 2] = 255 + c * (0.000013598650411385307 * c + 0.00012423956175490851 * m + 0.0004751985097583589 * y - 0.0000036729317476630422 * k - 0.05562186980264034) + m * (0.00016141380598724676 * m + 0.0009692239130725186 * y + 0.0007782692450036253 * k - 0.44015232367526463) + y * (5.068882914068769e-7 * y + 0.0017778369011375071 * k - 0.7591454649749609) - k * (0.0003435319965105553 * k + 0.7063770186160144); + data[i + 3] = 255; + } + return data; + } + getData({ + width, + height, + forceRGBA = false, + forceRGB = false, + isSourcePDF = false + }) { + if (this.numComponents > 4) { + throw new JpegError("Unsupported color mode"); + } + const data = this._getLinearizedBlockData(width, height, isSourcePDF); + if (this.numComponents === 1 && (forceRGBA || forceRGB)) { + const len = data.length * (forceRGBA ? 4 : 3); + const rgbaData = new Uint8ClampedArray(len); + let offset = 0; + if (forceRGBA) { + grayToRGBA(data, new Uint32Array(rgbaData.buffer)); + } else { + for (const grayColor of data) { + rgbaData[offset++] = grayColor; + rgbaData[offset++] = grayColor; + rgbaData[offset++] = grayColor; + } + } + return rgbaData; + } else if (this.numComponents === 3 && this._isColorConversionNeeded) { + if (forceRGBA) { + const rgbaData = new Uint8ClampedArray(data.length / 3 * 4); + return this._convertYccToRgba(data, rgbaData); + } + return this._convertYccToRgb(data); + } else if (this.numComponents === 4) { + if (this._isColorConversionNeeded) { + if (forceRGBA) { + return this._convertYcckToRgba(data); + } + if (forceRGB) { + return this._convertYcckToRgb(data); + } + return this._convertYcckToCmyk(data); + } else if (forceRGBA) { + return this._convertCmykToRgba(data); + } else if (forceRGB) { + return this._convertCmykToRgb(data); + } + } + return data; + } +} + +;// CONCATENATED MODULE: ./src/core/jpeg_stream.js + + + + +class JpegStream extends DecodeStream { + constructor(stream, maybeLength, params) { + let ch; + while ((ch = stream.getByte()) !== -1) { + if (ch === 0xff) { + stream.skip(-1); + break; + } + } + super(maybeLength); + this.stream = stream; + this.dict = stream.dict; + this.maybeLength = maybeLength; + this.params = params; + } + get bytes() { + return shadow(this, "bytes", this.stream.getBytes(this.maybeLength)); + } + ensureBuffer(requested) {} + readBlock() { + if (this.eof) { + return; + } + const jpegOptions = { + decodeTransform: undefined, + colorTransform: undefined + }; + const decodeArr = this.dict.getArray("D", "Decode"); + if ((this.forceRGBA || this.forceRGB) && Array.isArray(decodeArr)) { + const bitsPerComponent = this.dict.get("BPC", "BitsPerComponent") || 8; + const decodeArrLength = decodeArr.length; + const transform = new Int32Array(decodeArrLength); + let transformNeeded = false; + const maxValue = (1 << bitsPerComponent) - 1; + for (let i = 0; i < decodeArrLength; i += 2) { + transform[i] = (decodeArr[i + 1] - decodeArr[i]) * 256 | 0; + transform[i + 1] = decodeArr[i] * maxValue | 0; + if (transform[i] !== 256 || transform[i + 1] !== 0) { + transformNeeded = true; + } + } + if (transformNeeded) { + jpegOptions.decodeTransform = transform; + } + } + if (this.params instanceof Dict) { + const colorTransform = this.params.get("ColorTransform"); + if (Number.isInteger(colorTransform)) { + jpegOptions.colorTransform = colorTransform; + } + } + const jpegImage = new JpegImage(jpegOptions); + jpegImage.parse(this.bytes); + const data = jpegImage.getData({ + width: this.drawWidth, + height: this.drawHeight, + forceRGBA: this.forceRGBA, + forceRGB: this.forceRGB, + isSourcePDF: true + }); + this.buffer = data; + this.bufferLength = data.length; + this.eof = true; + } +} + +;// CONCATENATED MODULE: ./src/core/jpx.js + + + +class JpxError extends BaseException { + constructor(msg) { + super(`JPX error: ${msg}`, "JpxError"); + } +} +const SubbandsGainLog2 = { + LL: 0, + LH: 1, + HL: 1, + HH: 2 +}; +class JpxImage { + constructor() { + this.failOnCorruptedImage = false; + } + parse(data) { + const head = readUint16(data, 0); + if (head === 0xff4f) { + this.parseCodestream(data, 0, data.length); + return; + } + const length = data.length; + let position = 0; + while (position < length) { + let headerSize = 8; + let lbox = readUint32(data, position); + const tbox = readUint32(data, position + 4); + position += headerSize; + if (lbox === 1) { + lbox = readUint32(data, position) * 4294967296 + readUint32(data, position + 4); + position += 8; + headerSize += 8; + } + if (lbox === 0) { + lbox = length - position + headerSize; + } + if (lbox < headerSize) { + throw new JpxError("Invalid box field size"); + } + const dataLength = lbox - headerSize; + let jumpDataLength = true; + switch (tbox) { + case 0x6a703268: + jumpDataLength = false; + break; + case 0x636f6c72: + const method = data[position]; + if (method === 1) { + const colorspace = readUint32(data, position + 3); + switch (colorspace) { + case 16: + case 17: + case 18: + break; + default: + warn("Unknown colorspace " + colorspace); + break; + } + } else if (method === 2) { + info("ICC profile not supported"); + } + break; + case 0x6a703263: + this.parseCodestream(data, position, position + dataLength); + break; + case 0x6a502020: + if (readUint32(data, position) !== 0x0d0a870a) { + warn("Invalid JP2 signature"); + } + break; + case 0x6a501a1a: + case 0x66747970: + case 0x72726571: + case 0x72657320: + case 0x69686472: + break; + default: + const headerType = String.fromCharCode(tbox >> 24 & 0xff, tbox >> 16 & 0xff, tbox >> 8 & 0xff, tbox & 0xff); + warn(`Unsupported header type ${tbox} (${headerType}).`); + break; + } + if (jumpDataLength) { + position += dataLength; + } + } + } + parseImageProperties(stream) { + let newByte = stream.getByte(); + while (newByte >= 0) { + const oldByte = newByte; + newByte = stream.getByte(); + const code = oldByte << 8 | newByte; + if (code === 0xff51) { + stream.skip(4); + const Xsiz = stream.getInt32() >>> 0; + const Ysiz = stream.getInt32() >>> 0; + const XOsiz = stream.getInt32() >>> 0; + const YOsiz = stream.getInt32() >>> 0; + stream.skip(16); + const Csiz = stream.getUint16(); + this.width = Xsiz - XOsiz; + this.height = Ysiz - YOsiz; + this.componentsCount = Csiz; + this.bitsPerComponent = 8; + return; + } + } + throw new JpxError("No size marker found in JPX stream"); + } + parseCodestream(data, start, end) { + const context = {}; + let doNotRecover = false; + try { + let position = start; + while (position + 1 < end) { + const code = readUint16(data, position); + position += 2; + let length = 0, + j, + sqcd, + spqcds, + spqcdSize, + scalarExpounded, + tile; + switch (code) { + case 0xff4f: + context.mainHeader = true; + break; + case 0xffd9: + break; + case 0xff51: + length = readUint16(data, position); + const siz = {}; + siz.Xsiz = readUint32(data, position + 4); + siz.Ysiz = readUint32(data, position + 8); + siz.XOsiz = readUint32(data, position + 12); + siz.YOsiz = readUint32(data, position + 16); + siz.XTsiz = readUint32(data, position + 20); + siz.YTsiz = readUint32(data, position + 24); + siz.XTOsiz = readUint32(data, position + 28); + siz.YTOsiz = readUint32(data, position + 32); + const componentsCount = readUint16(data, position + 36); + siz.Csiz = componentsCount; + const components = []; + j = position + 38; + for (let i = 0; i < componentsCount; i++) { + const component = { + precision: (data[j] & 0x7f) + 1, + isSigned: !!(data[j] & 0x80), + XRsiz: data[j + 1], + YRsiz: data[j + 2] + }; + j += 3; + calculateComponentDimensions(component, siz); + components.push(component); + } + context.SIZ = siz; + context.components = components; + calculateTileGrids(context, components); + context.QCC = []; + context.COC = []; + break; + case 0xff5c: + length = readUint16(data, position); + const qcd = {}; + j = position + 2; + sqcd = data[j++]; + switch (sqcd & 0x1f) { + case 0: + spqcdSize = 8; + scalarExpounded = true; + break; + case 1: + spqcdSize = 16; + scalarExpounded = false; + break; + case 2: + spqcdSize = 16; + scalarExpounded = true; + break; + default: + throw new Error("Invalid SQcd value " + sqcd); + } + qcd.noQuantization = spqcdSize === 8; + qcd.scalarExpounded = scalarExpounded; + qcd.guardBits = sqcd >> 5; + spqcds = []; + while (j < length + position) { + const spqcd = {}; + if (spqcdSize === 8) { + spqcd.epsilon = data[j++] >> 3; + spqcd.mu = 0; + } else { + spqcd.epsilon = data[j] >> 3; + spqcd.mu = (data[j] & 0x7) << 8 | data[j + 1]; + j += 2; + } + spqcds.push(spqcd); + } + qcd.SPqcds = spqcds; + if (context.mainHeader) { + context.QCD = qcd; + } else { + context.currentTile.QCD = qcd; + context.currentTile.QCC = []; + } + break; + case 0xff5d: + length = readUint16(data, position); + const qcc = {}; + j = position + 2; + let cqcc; + if (context.SIZ.Csiz < 257) { + cqcc = data[j++]; + } else { + cqcc = readUint16(data, j); + j += 2; + } + sqcd = data[j++]; + switch (sqcd & 0x1f) { + case 0: + spqcdSize = 8; + scalarExpounded = true; + break; + case 1: + spqcdSize = 16; + scalarExpounded = false; + break; + case 2: + spqcdSize = 16; + scalarExpounded = true; + break; + default: + throw new Error("Invalid SQcd value " + sqcd); + } + qcc.noQuantization = spqcdSize === 8; + qcc.scalarExpounded = scalarExpounded; + qcc.guardBits = sqcd >> 5; + spqcds = []; + while (j < length + position) { + const spqcd = {}; + if (spqcdSize === 8) { + spqcd.epsilon = data[j++] >> 3; + spqcd.mu = 0; + } else { + spqcd.epsilon = data[j] >> 3; + spqcd.mu = (data[j] & 0x7) << 8 | data[j + 1]; + j += 2; + } + spqcds.push(spqcd); + } + qcc.SPqcds = spqcds; + if (context.mainHeader) { + context.QCC[cqcc] = qcc; + } else { + context.currentTile.QCC[cqcc] = qcc; + } + break; + case 0xff52: + length = readUint16(data, position); + const cod = {}; + j = position + 2; + const scod = data[j++]; + cod.entropyCoderWithCustomPrecincts = !!(scod & 1); + cod.sopMarkerUsed = !!(scod & 2); + cod.ephMarkerUsed = !!(scod & 4); + cod.progressionOrder = data[j++]; + cod.layersCount = readUint16(data, j); + j += 2; + cod.multipleComponentTransform = data[j++]; + cod.decompositionLevelsCount = data[j++]; + cod.xcb = (data[j++] & 0xf) + 2; + cod.ycb = (data[j++] & 0xf) + 2; + const blockStyle = data[j++]; + cod.selectiveArithmeticCodingBypass = !!(blockStyle & 1); + cod.resetContextProbabilities = !!(blockStyle & 2); + cod.terminationOnEachCodingPass = !!(blockStyle & 4); + cod.verticallyStripe = !!(blockStyle & 8); + cod.predictableTermination = !!(blockStyle & 16); + cod.segmentationSymbolUsed = !!(blockStyle & 32); + cod.reversibleTransformation = data[j++]; + if (cod.entropyCoderWithCustomPrecincts) { + const precinctsSizes = []; + while (j < length + position) { + const precinctsSize = data[j++]; + precinctsSizes.push({ + PPx: precinctsSize & 0xf, + PPy: precinctsSize >> 4 + }); + } + cod.precinctsSizes = precinctsSizes; + } + const unsupported = []; + if (cod.selectiveArithmeticCodingBypass) { + unsupported.push("selectiveArithmeticCodingBypass"); + } + if (cod.terminationOnEachCodingPass) { + unsupported.push("terminationOnEachCodingPass"); + } + if (cod.verticallyStripe) { + unsupported.push("verticallyStripe"); + } + if (cod.predictableTermination) { + unsupported.push("predictableTermination"); + } + if (unsupported.length > 0) { + doNotRecover = true; + warn(`JPX: Unsupported COD options (${unsupported.join(", ")}).`); + } + if (context.mainHeader) { + context.COD = cod; + } else { + context.currentTile.COD = cod; + context.currentTile.COC = []; + } + break; + case 0xff90: + length = readUint16(data, position); + tile = {}; + tile.index = readUint16(data, position + 2); + tile.length = readUint32(data, position + 4); + tile.dataEnd = tile.length + position - 2; + tile.partIndex = data[position + 8]; + tile.partsCount = data[position + 9]; + context.mainHeader = false; + if (tile.partIndex === 0) { + tile.COD = context.COD; + tile.COC = context.COC.slice(0); + tile.QCD = context.QCD; + tile.QCC = context.QCC.slice(0); + } + context.currentTile = tile; + break; + case 0xff93: + tile = context.currentTile; + if (tile.partIndex === 0) { + initializeTile(context, tile.index); + buildPackets(context); + } + length = tile.dataEnd - position; + parseTilePackets(context, data, position, length); + break; + case 0xff53: + warn("JPX: Codestream code 0xFF53 (COC) is not implemented."); + case 0xff55: + case 0xff57: + case 0xff58: + case 0xff64: + length = readUint16(data, position); + break; + default: + throw new Error("Unknown codestream code: " + code.toString(16)); + } + position += length; + } + } catch (e) { + if (doNotRecover || this.failOnCorruptedImage) { + throw new JpxError(e.message); + } else { + warn(`JPX: Trying to recover from: "${e.message}".`); + } + } + this.tiles = transformComponents(context); + this.width = context.SIZ.Xsiz - context.SIZ.XOsiz; + this.height = context.SIZ.Ysiz - context.SIZ.YOsiz; + this.componentsCount = context.SIZ.Csiz; + } +} +function calculateComponentDimensions(component, siz) { + component.x0 = Math.ceil(siz.XOsiz / component.XRsiz); + component.x1 = Math.ceil(siz.Xsiz / component.XRsiz); + component.y0 = Math.ceil(siz.YOsiz / component.YRsiz); + component.y1 = Math.ceil(siz.Ysiz / component.YRsiz); + component.width = component.x1 - component.x0; + component.height = component.y1 - component.y0; +} +function calculateTileGrids(context, components) { + const siz = context.SIZ; + const tiles = []; + let tile; + const numXtiles = Math.ceil((siz.Xsiz - siz.XTOsiz) / siz.XTsiz); + const numYtiles = Math.ceil((siz.Ysiz - siz.YTOsiz) / siz.YTsiz); + for (let q = 0; q < numYtiles; q++) { + for (let p = 0; p < numXtiles; p++) { + tile = {}; + tile.tx0 = Math.max(siz.XTOsiz + p * siz.XTsiz, siz.XOsiz); + tile.ty0 = Math.max(siz.YTOsiz + q * siz.YTsiz, siz.YOsiz); + tile.tx1 = Math.min(siz.XTOsiz + (p + 1) * siz.XTsiz, siz.Xsiz); + tile.ty1 = Math.min(siz.YTOsiz + (q + 1) * siz.YTsiz, siz.Ysiz); + tile.width = tile.tx1 - tile.tx0; + tile.height = tile.ty1 - tile.ty0; + tile.components = []; + tiles.push(tile); + } + } + context.tiles = tiles; + const componentsCount = siz.Csiz; + for (let i = 0, ii = componentsCount; i < ii; i++) { + const component = components[i]; + for (let j = 0, jj = tiles.length; j < jj; j++) { + const tileComponent = {}; + tile = tiles[j]; + tileComponent.tcx0 = Math.ceil(tile.tx0 / component.XRsiz); + tileComponent.tcy0 = Math.ceil(tile.ty0 / component.YRsiz); + tileComponent.tcx1 = Math.ceil(tile.tx1 / component.XRsiz); + tileComponent.tcy1 = Math.ceil(tile.ty1 / component.YRsiz); + tileComponent.width = tileComponent.tcx1 - tileComponent.tcx0; + tileComponent.height = tileComponent.tcy1 - tileComponent.tcy0; + tile.components[i] = tileComponent; + } + } +} +function getBlocksDimensions(context, component, r) { + const codOrCoc = component.codingStyleParameters; + const result = {}; + if (!codOrCoc.entropyCoderWithCustomPrecincts) { + result.PPx = 15; + result.PPy = 15; + } else { + result.PPx = codOrCoc.precinctsSizes[r].PPx; + result.PPy = codOrCoc.precinctsSizes[r].PPy; + } + result.xcb_ = r > 0 ? Math.min(codOrCoc.xcb, result.PPx - 1) : Math.min(codOrCoc.xcb, result.PPx); + result.ycb_ = r > 0 ? Math.min(codOrCoc.ycb, result.PPy - 1) : Math.min(codOrCoc.ycb, result.PPy); + return result; +} +function buildPrecincts(context, resolution, dimensions) { + const precinctWidth = 1 << dimensions.PPx; + const precinctHeight = 1 << dimensions.PPy; + const isZeroRes = resolution.resLevel === 0; + const precinctWidthInSubband = 1 << dimensions.PPx + (isZeroRes ? 0 : -1); + const precinctHeightInSubband = 1 << dimensions.PPy + (isZeroRes ? 0 : -1); + const numprecinctswide = resolution.trx1 > resolution.trx0 ? Math.ceil(resolution.trx1 / precinctWidth) - Math.floor(resolution.trx0 / precinctWidth) : 0; + const numprecinctshigh = resolution.try1 > resolution.try0 ? Math.ceil(resolution.try1 / precinctHeight) - Math.floor(resolution.try0 / precinctHeight) : 0; + const numprecincts = numprecinctswide * numprecinctshigh; + resolution.precinctParameters = { + precinctWidth, + precinctHeight, + numprecinctswide, + numprecinctshigh, + numprecincts, + precinctWidthInSubband, + precinctHeightInSubband + }; +} +function buildCodeblocks(context, subband, dimensions) { + const xcb_ = dimensions.xcb_; + const ycb_ = dimensions.ycb_; + const codeblockWidth = 1 << xcb_; + const codeblockHeight = 1 << ycb_; + const cbx0 = subband.tbx0 >> xcb_; + const cby0 = subband.tby0 >> ycb_; + const cbx1 = subband.tbx1 + codeblockWidth - 1 >> xcb_; + const cby1 = subband.tby1 + codeblockHeight - 1 >> ycb_; + const precinctParameters = subband.resolution.precinctParameters; + const codeblocks = []; + const precincts = []; + let i, j, codeblock, precinctNumber; + for (j = cby0; j < cby1; j++) { + for (i = cbx0; i < cbx1; i++) { + codeblock = { + cbx: i, + cby: j, + tbx0: codeblockWidth * i, + tby0: codeblockHeight * j, + tbx1: codeblockWidth * (i + 1), + tby1: codeblockHeight * (j + 1) + }; + codeblock.tbx0_ = Math.max(subband.tbx0, codeblock.tbx0); + codeblock.tby0_ = Math.max(subband.tby0, codeblock.tby0); + codeblock.tbx1_ = Math.min(subband.tbx1, codeblock.tbx1); + codeblock.tby1_ = Math.min(subband.tby1, codeblock.tby1); + const pi = Math.floor((codeblock.tbx0_ - subband.tbx0) / precinctParameters.precinctWidthInSubband); + const pj = Math.floor((codeblock.tby0_ - subband.tby0) / precinctParameters.precinctHeightInSubband); + precinctNumber = pi + pj * precinctParameters.numprecinctswide; + codeblock.precinctNumber = precinctNumber; + codeblock.subbandType = subband.type; + codeblock.Lblock = 3; + if (codeblock.tbx1_ <= codeblock.tbx0_ || codeblock.tby1_ <= codeblock.tby0_) { + continue; + } + codeblocks.push(codeblock); + let precinct = precincts[precinctNumber]; + if (precinct !== undefined) { + if (i < precinct.cbxMin) { + precinct.cbxMin = i; + } else if (i > precinct.cbxMax) { + precinct.cbxMax = i; + } + if (j < precinct.cbyMin) { + precinct.cbxMin = j; + } else if (j > precinct.cbyMax) { + precinct.cbyMax = j; + } + } else { + precincts[precinctNumber] = precinct = { + cbxMin: i, + cbyMin: j, + cbxMax: i, + cbyMax: j + }; + } + codeblock.precinct = precinct; + } + } + subband.codeblockParameters = { + codeblockWidth: xcb_, + codeblockHeight: ycb_, + numcodeblockwide: cbx1 - cbx0 + 1, + numcodeblockhigh: cby1 - cby0 + 1 + }; + subband.codeblocks = codeblocks; + subband.precincts = precincts; +} +function createPacket(resolution, precinctNumber, layerNumber) { + const precinctCodeblocks = []; + const subbands = resolution.subbands; + for (let i = 0, ii = subbands.length; i < ii; i++) { + const subband = subbands[i]; + const codeblocks = subband.codeblocks; + for (let j = 0, jj = codeblocks.length; j < jj; j++) { + const codeblock = codeblocks[j]; + if (codeblock.precinctNumber !== precinctNumber) { + continue; + } + precinctCodeblocks.push(codeblock); + } + } + return { + layerNumber, + codeblocks: precinctCodeblocks + }; +} +function LayerResolutionComponentPositionIterator(context) { + const siz = context.SIZ; + const tileIndex = context.currentTile.index; + const tile = context.tiles[tileIndex]; + const layersCount = tile.codingStyleDefaultParameters.layersCount; + const componentsCount = siz.Csiz; + let maxDecompositionLevelsCount = 0; + for (let q = 0; q < componentsCount; q++) { + maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, tile.components[q].codingStyleParameters.decompositionLevelsCount); + } + let l = 0, + r = 0, + i = 0, + k = 0; + this.nextPacket = function JpxImage_nextPacket() { + for (; l < layersCount; l++) { + for (; r <= maxDecompositionLevelsCount; r++) { + for (; i < componentsCount; i++) { + const component = tile.components[i]; + if (r > component.codingStyleParameters.decompositionLevelsCount) { + continue; + } + const resolution = component.resolutions[r]; + const numprecincts = resolution.precinctParameters.numprecincts; + for (; k < numprecincts;) { + const packet = createPacket(resolution, k, l); + k++; + return packet; + } + k = 0; + } + i = 0; + } + r = 0; + } + throw new JpxError("Out of packets"); + }; +} +function ResolutionLayerComponentPositionIterator(context) { + const siz = context.SIZ; + const tileIndex = context.currentTile.index; + const tile = context.tiles[tileIndex]; + const layersCount = tile.codingStyleDefaultParameters.layersCount; + const componentsCount = siz.Csiz; + let maxDecompositionLevelsCount = 0; + for (let q = 0; q < componentsCount; q++) { + maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, tile.components[q].codingStyleParameters.decompositionLevelsCount); + } + let r = 0, + l = 0, + i = 0, + k = 0; + this.nextPacket = function JpxImage_nextPacket() { + for (; r <= maxDecompositionLevelsCount; r++) { + for (; l < layersCount; l++) { + for (; i < componentsCount; i++) { + const component = tile.components[i]; + if (r > component.codingStyleParameters.decompositionLevelsCount) { + continue; + } + const resolution = component.resolutions[r]; + const numprecincts = resolution.precinctParameters.numprecincts; + for (; k < numprecincts;) { + const packet = createPacket(resolution, k, l); + k++; + return packet; + } + k = 0; + } + i = 0; + } + l = 0; + } + throw new JpxError("Out of packets"); + }; +} +function ResolutionPositionComponentLayerIterator(context) { + const siz = context.SIZ; + const tileIndex = context.currentTile.index; + const tile = context.tiles[tileIndex]; + const layersCount = tile.codingStyleDefaultParameters.layersCount; + const componentsCount = siz.Csiz; + let l, r, c, p; + let maxDecompositionLevelsCount = 0; + for (c = 0; c < componentsCount; c++) { + const component = tile.components[c]; + maxDecompositionLevelsCount = Math.max(maxDecompositionLevelsCount, component.codingStyleParameters.decompositionLevelsCount); + } + const maxNumPrecinctsInLevel = new Int32Array(maxDecompositionLevelsCount + 1); + for (r = 0; r <= maxDecompositionLevelsCount; ++r) { + let maxNumPrecincts = 0; + for (c = 0; c < componentsCount; ++c) { + const resolutions = tile.components[c].resolutions; + if (r < resolutions.length) { + maxNumPrecincts = Math.max(maxNumPrecincts, resolutions[r].precinctParameters.numprecincts); + } + } + maxNumPrecinctsInLevel[r] = maxNumPrecincts; + } + l = 0; + r = 0; + c = 0; + p = 0; + this.nextPacket = function JpxImage_nextPacket() { + for (; r <= maxDecompositionLevelsCount; r++) { + for (; p < maxNumPrecinctsInLevel[r]; p++) { + for (; c < componentsCount; c++) { + const component = tile.components[c]; + if (r > component.codingStyleParameters.decompositionLevelsCount) { + continue; + } + const resolution = component.resolutions[r]; + const numprecincts = resolution.precinctParameters.numprecincts; + if (p >= numprecincts) { + continue; + } + for (; l < layersCount;) { + const packet = createPacket(resolution, p, l); + l++; + return packet; + } + l = 0; + } + c = 0; + } + p = 0; + } + throw new JpxError("Out of packets"); + }; +} +function PositionComponentResolutionLayerIterator(context) { + const siz = context.SIZ; + const tileIndex = context.currentTile.index; + const tile = context.tiles[tileIndex]; + const layersCount = tile.codingStyleDefaultParameters.layersCount; + const componentsCount = siz.Csiz; + const precinctsSizes = getPrecinctSizesInImageScale(tile); + const precinctsIterationSizes = precinctsSizes; + let l = 0, + r = 0, + c = 0, + px = 0, + py = 0; + this.nextPacket = function JpxImage_nextPacket() { + for (; py < precinctsIterationSizes.maxNumHigh; py++) { + for (; px < precinctsIterationSizes.maxNumWide; px++) { + for (; c < componentsCount; c++) { + const component = tile.components[c]; + const decompositionLevelsCount = component.codingStyleParameters.decompositionLevelsCount; + for (; r <= decompositionLevelsCount; r++) { + const resolution = component.resolutions[r]; + const sizeInImageScale = precinctsSizes.components[c].resolutions[r]; + const k = getPrecinctIndexIfExist(px, py, sizeInImageScale, precinctsIterationSizes, resolution); + if (k === null) { + continue; + } + for (; l < layersCount;) { + const packet = createPacket(resolution, k, l); + l++; + return packet; + } + l = 0; + } + r = 0; + } + c = 0; + } + px = 0; + } + throw new JpxError("Out of packets"); + }; +} +function ComponentPositionResolutionLayerIterator(context) { + const siz = context.SIZ; + const tileIndex = context.currentTile.index; + const tile = context.tiles[tileIndex]; + const layersCount = tile.codingStyleDefaultParameters.layersCount; + const componentsCount = siz.Csiz; + const precinctsSizes = getPrecinctSizesInImageScale(tile); + let l = 0, + r = 0, + c = 0, + px = 0, + py = 0; + this.nextPacket = function JpxImage_nextPacket() { + for (; c < componentsCount; ++c) { + const component = tile.components[c]; + const precinctsIterationSizes = precinctsSizes.components[c]; + const decompositionLevelsCount = component.codingStyleParameters.decompositionLevelsCount; + for (; py < precinctsIterationSizes.maxNumHigh; py++) { + for (; px < precinctsIterationSizes.maxNumWide; px++) { + for (; r <= decompositionLevelsCount; r++) { + const resolution = component.resolutions[r]; + const sizeInImageScale = precinctsIterationSizes.resolutions[r]; + const k = getPrecinctIndexIfExist(px, py, sizeInImageScale, precinctsIterationSizes, resolution); + if (k === null) { + continue; + } + for (; l < layersCount;) { + const packet = createPacket(resolution, k, l); + l++; + return packet; + } + l = 0; + } + r = 0; + } + px = 0; + } + py = 0; + } + throw new JpxError("Out of packets"); + }; +} +function getPrecinctIndexIfExist(pxIndex, pyIndex, sizeInImageScale, precinctIterationSizes, resolution) { + const posX = pxIndex * precinctIterationSizes.minWidth; + const posY = pyIndex * precinctIterationSizes.minHeight; + if (posX % sizeInImageScale.width !== 0 || posY % sizeInImageScale.height !== 0) { + return null; + } + const startPrecinctRowIndex = posY / sizeInImageScale.width * resolution.precinctParameters.numprecinctswide; + return posX / sizeInImageScale.height + startPrecinctRowIndex; +} +function getPrecinctSizesInImageScale(tile) { + const componentsCount = tile.components.length; + let minWidth = Number.MAX_VALUE; + let minHeight = Number.MAX_VALUE; + let maxNumWide = 0; + let maxNumHigh = 0; + const sizePerComponent = new Array(componentsCount); + for (let c = 0; c < componentsCount; c++) { + const component = tile.components[c]; + const decompositionLevelsCount = component.codingStyleParameters.decompositionLevelsCount; + const sizePerResolution = new Array(decompositionLevelsCount + 1); + let minWidthCurrentComponent = Number.MAX_VALUE; + let minHeightCurrentComponent = Number.MAX_VALUE; + let maxNumWideCurrentComponent = 0; + let maxNumHighCurrentComponent = 0; + let scale = 1; + for (let r = decompositionLevelsCount; r >= 0; --r) { + const resolution = component.resolutions[r]; + const widthCurrentResolution = scale * resolution.precinctParameters.precinctWidth; + const heightCurrentResolution = scale * resolution.precinctParameters.precinctHeight; + minWidthCurrentComponent = Math.min(minWidthCurrentComponent, widthCurrentResolution); + minHeightCurrentComponent = Math.min(minHeightCurrentComponent, heightCurrentResolution); + maxNumWideCurrentComponent = Math.max(maxNumWideCurrentComponent, resolution.precinctParameters.numprecinctswide); + maxNumHighCurrentComponent = Math.max(maxNumHighCurrentComponent, resolution.precinctParameters.numprecinctshigh); + sizePerResolution[r] = { + width: widthCurrentResolution, + height: heightCurrentResolution + }; + scale <<= 1; + } + minWidth = Math.min(minWidth, minWidthCurrentComponent); + minHeight = Math.min(minHeight, minHeightCurrentComponent); + maxNumWide = Math.max(maxNumWide, maxNumWideCurrentComponent); + maxNumHigh = Math.max(maxNumHigh, maxNumHighCurrentComponent); + sizePerComponent[c] = { + resolutions: sizePerResolution, + minWidth: minWidthCurrentComponent, + minHeight: minHeightCurrentComponent, + maxNumWide: maxNumWideCurrentComponent, + maxNumHigh: maxNumHighCurrentComponent + }; + } + return { + components: sizePerComponent, + minWidth, + minHeight, + maxNumWide, + maxNumHigh + }; +} +function buildPackets(context) { + const siz = context.SIZ; + const tileIndex = context.currentTile.index; + const tile = context.tiles[tileIndex]; + const componentsCount = siz.Csiz; + for (let c = 0; c < componentsCount; c++) { + const component = tile.components[c]; + const decompositionLevelsCount = component.codingStyleParameters.decompositionLevelsCount; + const resolutions = []; + const subbands = []; + for (let r = 0; r <= decompositionLevelsCount; r++) { + const blocksDimensions = getBlocksDimensions(context, component, r); + const resolution = {}; + const scale = 1 << decompositionLevelsCount - r; + resolution.trx0 = Math.ceil(component.tcx0 / scale); + resolution.try0 = Math.ceil(component.tcy0 / scale); + resolution.trx1 = Math.ceil(component.tcx1 / scale); + resolution.try1 = Math.ceil(component.tcy1 / scale); + resolution.resLevel = r; + buildPrecincts(context, resolution, blocksDimensions); + resolutions.push(resolution); + let subband; + if (r === 0) { + subband = {}; + subband.type = "LL"; + subband.tbx0 = Math.ceil(component.tcx0 / scale); + subband.tby0 = Math.ceil(component.tcy0 / scale); + subband.tbx1 = Math.ceil(component.tcx1 / scale); + subband.tby1 = Math.ceil(component.tcy1 / scale); + subband.resolution = resolution; + buildCodeblocks(context, subband, blocksDimensions); + subbands.push(subband); + resolution.subbands = [subband]; + } else { + const bscale = 1 << decompositionLevelsCount - r + 1; + const resolutionSubbands = []; + subband = {}; + subband.type = "HL"; + subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5); + subband.tby0 = Math.ceil(component.tcy0 / bscale); + subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5); + subband.tby1 = Math.ceil(component.tcy1 / bscale); + subband.resolution = resolution; + buildCodeblocks(context, subband, blocksDimensions); + subbands.push(subband); + resolutionSubbands.push(subband); + subband = {}; + subband.type = "LH"; + subband.tbx0 = Math.ceil(component.tcx0 / bscale); + subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5); + subband.tbx1 = Math.ceil(component.tcx1 / bscale); + subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5); + subband.resolution = resolution; + buildCodeblocks(context, subband, blocksDimensions); + subbands.push(subband); + resolutionSubbands.push(subband); + subband = {}; + subband.type = "HH"; + subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5); + subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5); + subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5); + subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5); + subband.resolution = resolution; + buildCodeblocks(context, subband, blocksDimensions); + subbands.push(subband); + resolutionSubbands.push(subband); + resolution.subbands = resolutionSubbands; + } + } + component.resolutions = resolutions; + component.subbands = subbands; + } + const progressionOrder = tile.codingStyleDefaultParameters.progressionOrder; + switch (progressionOrder) { + case 0: + tile.packetsIterator = new LayerResolutionComponentPositionIterator(context); + break; + case 1: + tile.packetsIterator = new ResolutionLayerComponentPositionIterator(context); + break; + case 2: + tile.packetsIterator = new ResolutionPositionComponentLayerIterator(context); + break; + case 3: + tile.packetsIterator = new PositionComponentResolutionLayerIterator(context); + break; + case 4: + tile.packetsIterator = new ComponentPositionResolutionLayerIterator(context); + break; + default: + throw new JpxError(`Unsupported progression order ${progressionOrder}`); + } +} +function parseTilePackets(context, data, offset, dataLength) { + let position = 0; + let buffer, + bufferSize = 0, + skipNextBit = false; + function readBits(count) { + while (bufferSize < count) { + const b = data[offset + position]; + position++; + if (skipNextBit) { + buffer = buffer << 7 | b; + bufferSize += 7; + skipNextBit = false; + } else { + buffer = buffer << 8 | b; + bufferSize += 8; + } + if (b === 0xff) { + skipNextBit = true; + } + } + bufferSize -= count; + return buffer >>> bufferSize & (1 << count) - 1; + } + function skipMarkerIfEqual(value) { + if (data[offset + position - 1] === 0xff && data[offset + position] === value) { + skipBytes(1); + return true; + } else if (data[offset + position] === 0xff && data[offset + position + 1] === value) { + skipBytes(2); + return true; + } + return false; + } + function skipBytes(count) { + position += count; + } + function alignToByte() { + bufferSize = 0; + if (skipNextBit) { + position++; + skipNextBit = false; + } + } + function readCodingpasses() { + if (readBits(1) === 0) { + return 1; + } + if (readBits(1) === 0) { + return 2; + } + let value = readBits(2); + if (value < 3) { + return value + 3; + } + value = readBits(5); + if (value < 31) { + return value + 6; + } + value = readBits(7); + return value + 37; + } + const tileIndex = context.currentTile.index; + const tile = context.tiles[tileIndex]; + const sopMarkerUsed = context.COD.sopMarkerUsed; + const ephMarkerUsed = context.COD.ephMarkerUsed; + const packetsIterator = tile.packetsIterator; + while (position < dataLength) { + alignToByte(); + if (sopMarkerUsed && skipMarkerIfEqual(0x91)) { + skipBytes(4); + } + const packet = packetsIterator.nextPacket(); + if (!readBits(1)) { + continue; + } + const layerNumber = packet.layerNumber, + queue = []; + let codeblock; + for (let i = 0, ii = packet.codeblocks.length; i < ii; i++) { + codeblock = packet.codeblocks[i]; + let precinct = codeblock.precinct; + const codeblockColumn = codeblock.cbx - precinct.cbxMin; + const codeblockRow = codeblock.cby - precinct.cbyMin; + let codeblockIncluded = false; + let firstTimeInclusion = false; + let valueReady, zeroBitPlanesTree; + if (codeblock.included !== undefined) { + codeblockIncluded = !!readBits(1); + } else { + precinct = codeblock.precinct; + let inclusionTree; + if (precinct.inclusionTree !== undefined) { + inclusionTree = precinct.inclusionTree; + } else { + const width = precinct.cbxMax - precinct.cbxMin + 1; + const height = precinct.cbyMax - precinct.cbyMin + 1; + inclusionTree = new InclusionTree(width, height, layerNumber); + zeroBitPlanesTree = new TagTree(width, height); + precinct.inclusionTree = inclusionTree; + precinct.zeroBitPlanesTree = zeroBitPlanesTree; + for (let l = 0; l < layerNumber; l++) { + if (readBits(1) !== 0) { + throw new JpxError("Invalid tag tree"); + } + } + } + if (inclusionTree.reset(codeblockColumn, codeblockRow, layerNumber)) { + while (true) { + if (readBits(1)) { + valueReady = !inclusionTree.nextLevel(); + if (valueReady) { + codeblock.included = true; + codeblockIncluded = firstTimeInclusion = true; + break; + } + } else { + inclusionTree.incrementValue(layerNumber); + break; + } + } + } + } + if (!codeblockIncluded) { + continue; + } + if (firstTimeInclusion) { + zeroBitPlanesTree = precinct.zeroBitPlanesTree; + zeroBitPlanesTree.reset(codeblockColumn, codeblockRow); + while (true) { + if (readBits(1)) { + valueReady = !zeroBitPlanesTree.nextLevel(); + if (valueReady) { + break; + } + } else { + zeroBitPlanesTree.incrementValue(); + } + } + codeblock.zeroBitPlanes = zeroBitPlanesTree.value; + } + const codingpasses = readCodingpasses(); + while (readBits(1)) { + codeblock.Lblock++; + } + const codingpassesLog2 = log2(codingpasses); + const bits = (codingpasses < 1 << codingpassesLog2 ? codingpassesLog2 - 1 : codingpassesLog2) + codeblock.Lblock; + const codedDataLength = readBits(bits); + queue.push({ + codeblock, + codingpasses, + dataLength: codedDataLength + }); + } + alignToByte(); + if (ephMarkerUsed) { + skipMarkerIfEqual(0x92); + } + while (queue.length > 0) { + const packetItem = queue.shift(); + codeblock = packetItem.codeblock; + if (codeblock.data === undefined) { + codeblock.data = []; + } + codeblock.data.push({ + data, + start: offset + position, + end: offset + position + packetItem.dataLength, + codingpasses: packetItem.codingpasses + }); + position += packetItem.dataLength; + } + } + return position; +} +function copyCoefficients(coefficients, levelWidth, levelHeight, subband, delta, mb, reversible, segmentationSymbolUsed, resetContextProbabilities) { + const x0 = subband.tbx0; + const y0 = subband.tby0; + const width = subband.tbx1 - subband.tbx0; + const codeblocks = subband.codeblocks; + const right = subband.type.charAt(0) === "H" ? 1 : 0; + const bottom = subband.type.charAt(1) === "H" ? levelWidth : 0; + for (let i = 0, ii = codeblocks.length; i < ii; ++i) { + const codeblock = codeblocks[i]; + const blockWidth = codeblock.tbx1_ - codeblock.tbx0_; + const blockHeight = codeblock.tby1_ - codeblock.tby0_; + if (blockWidth === 0 || blockHeight === 0) { + continue; + } + if (codeblock.data === undefined) { + continue; + } + const bitModel = new BitModel(blockWidth, blockHeight, codeblock.subbandType, codeblock.zeroBitPlanes, mb); + let currentCodingpassType = 2; + const data = codeblock.data; + let totalLength = 0, + codingpasses = 0; + let j, jj, dataItem; + for (j = 0, jj = data.length; j < jj; j++) { + dataItem = data[j]; + totalLength += dataItem.end - dataItem.start; + codingpasses += dataItem.codingpasses; + } + const encodedData = new Uint8Array(totalLength); + let position = 0; + for (j = 0, jj = data.length; j < jj; j++) { + dataItem = data[j]; + const chunk = dataItem.data.subarray(dataItem.start, dataItem.end); + encodedData.set(chunk, position); + position += chunk.length; + } + const decoder = new ArithmeticDecoder(encodedData, 0, totalLength); + bitModel.setDecoder(decoder); + for (j = 0; j < codingpasses; j++) { + switch (currentCodingpassType) { + case 0: + bitModel.runSignificancePropagationPass(); + break; + case 1: + bitModel.runMagnitudeRefinementPass(); + break; + case 2: + bitModel.runCleanupPass(); + if (segmentationSymbolUsed) { + bitModel.checkSegmentationSymbol(); + } + break; + } + if (resetContextProbabilities) { + bitModel.reset(); + } + currentCodingpassType = (currentCodingpassType + 1) % 3; + } + let offset = codeblock.tbx0_ - x0 + (codeblock.tby0_ - y0) * width; + const sign = bitModel.coefficentsSign; + const magnitude = bitModel.coefficentsMagnitude; + const bitsDecoded = bitModel.bitsDecoded; + const magnitudeCorrection = reversible ? 0 : 0.5; + let k, n, nb; + position = 0; + const interleave = subband.type !== "LL"; + for (j = 0; j < blockHeight; j++) { + const row = offset / width | 0; + const levelOffset = 2 * row * (levelWidth - width) + right + bottom; + for (k = 0; k < blockWidth; k++) { + n = magnitude[position]; + if (n !== 0) { + n = (n + magnitudeCorrection) * delta; + if (sign[position] !== 0) { + n = -n; + } + nb = bitsDecoded[position]; + const pos = interleave ? levelOffset + (offset << 1) : offset; + coefficients[pos] = reversible && nb >= mb ? n : n * (1 << mb - nb); + } + offset++; + position++; + } + offset += width - blockWidth; + } + } +} +function transformTile(context, tile, c) { + const component = tile.components[c]; + const codingStyleParameters = component.codingStyleParameters; + const quantizationParameters = component.quantizationParameters; + const decompositionLevelsCount = codingStyleParameters.decompositionLevelsCount; + const spqcds = quantizationParameters.SPqcds; + const scalarExpounded = quantizationParameters.scalarExpounded; + const guardBits = quantizationParameters.guardBits; + const segmentationSymbolUsed = codingStyleParameters.segmentationSymbolUsed; + const resetContextProbabilities = codingStyleParameters.resetContextProbabilities; + const precision = context.components[c].precision; + const reversible = codingStyleParameters.reversibleTransformation; + const transform = reversible ? new ReversibleTransform() : new IrreversibleTransform(); + const subbandCoefficients = []; + let b = 0; + for (let i = 0; i <= decompositionLevelsCount; i++) { + const resolution = component.resolutions[i]; + const width = resolution.trx1 - resolution.trx0; + const height = resolution.try1 - resolution.try0; + const coefficients = new Float32Array(width * height); + for (let j = 0, jj = resolution.subbands.length; j < jj; j++) { + let mu, epsilon; + if (!scalarExpounded) { + mu = spqcds[0].mu; + epsilon = spqcds[0].epsilon + (i > 0 ? 1 - i : 0); + } else { + mu = spqcds[b].mu; + epsilon = spqcds[b].epsilon; + b++; + } + const subband = resolution.subbands[j]; + const gainLog2 = SubbandsGainLog2[subband.type]; + const delta = reversible ? 1 : 2 ** (precision + gainLog2 - epsilon) * (1 + mu / 2048); + const mb = guardBits + epsilon - 1; + copyCoefficients(coefficients, width, height, subband, delta, mb, reversible, segmentationSymbolUsed, resetContextProbabilities); + } + subbandCoefficients.push({ + width, + height, + items: coefficients + }); + } + const result = transform.calculate(subbandCoefficients, component.tcx0, component.tcy0); + return { + left: component.tcx0, + top: component.tcy0, + width: result.width, + height: result.height, + items: result.items + }; +} +function transformComponents(context) { + const siz = context.SIZ; + const components = context.components; + const componentsCount = siz.Csiz; + const resultImages = []; + for (let i = 0, ii = context.tiles.length; i < ii; i++) { + const tile = context.tiles[i]; + const transformedTiles = []; + for (let c = 0; c < componentsCount; c++) { + transformedTiles[c] = transformTile(context, tile, c); + } + const tile0 = transformedTiles[0]; + const out = new Uint8ClampedArray(tile0.items.length * componentsCount); + const result = { + left: tile0.left, + top: tile0.top, + width: tile0.width, + height: tile0.height, + items: out + }; + let shift, offset; + let pos = 0, + j, + jj, + y0, + y1, + y2; + if (tile.codingStyleDefaultParameters.multipleComponentTransform) { + const fourComponents = componentsCount === 4; + const y0items = transformedTiles[0].items; + const y1items = transformedTiles[1].items; + const y2items = transformedTiles[2].items; + const y3items = fourComponents ? transformedTiles[3].items : null; + shift = components[0].precision - 8; + offset = (128 << shift) + 0.5; + const component0 = tile.components[0]; + const alpha01 = componentsCount - 3; + jj = y0items.length; + if (!component0.codingStyleParameters.reversibleTransformation) { + for (j = 0; j < jj; j++, pos += alpha01) { + y0 = y0items[j] + offset; + y1 = y1items[j]; + y2 = y2items[j]; + out[pos++] = y0 + 1.402 * y2 >> shift; + out[pos++] = y0 - 0.34413 * y1 - 0.71414 * y2 >> shift; + out[pos++] = y0 + 1.772 * y1 >> shift; + } + } else { + for (j = 0; j < jj; j++, pos += alpha01) { + y0 = y0items[j] + offset; + y1 = y1items[j]; + y2 = y2items[j]; + const g = y0 - (y2 + y1 >> 2); + out[pos++] = g + y2 >> shift; + out[pos++] = g >> shift; + out[pos++] = g + y1 >> shift; + } + } + if (fourComponents) { + for (j = 0, pos = 3; j < jj; j++, pos += 4) { + out[pos] = y3items[j] + offset >> shift; + } + } + } else { + for (let c = 0; c < componentsCount; c++) { + const items = transformedTiles[c].items; + shift = components[c].precision - 8; + offset = (128 << shift) + 0.5; + for (pos = c, j = 0, jj = items.length; j < jj; j++) { + out[pos] = items[j] + offset >> shift; + pos += componentsCount; + } + } + } + resultImages.push(result); + } + return resultImages; +} +function initializeTile(context, tileIndex) { + const siz = context.SIZ; + const componentsCount = siz.Csiz; + const tile = context.tiles[tileIndex]; + for (let c = 0; c < componentsCount; c++) { + const component = tile.components[c]; + const qcdOrQcc = context.currentTile.QCC[c] !== undefined ? context.currentTile.QCC[c] : context.currentTile.QCD; + component.quantizationParameters = qcdOrQcc; + const codOrCoc = context.currentTile.COC[c] !== undefined ? context.currentTile.COC[c] : context.currentTile.COD; + component.codingStyleParameters = codOrCoc; + } + tile.codingStyleDefaultParameters = context.currentTile.COD; +} +class TagTree { + constructor(width, height) { + const levelsLength = log2(Math.max(width, height)) + 1; + this.levels = []; + for (let i = 0; i < levelsLength; i++) { + const level = { + width, + height, + items: [] + }; + this.levels.push(level); + width = Math.ceil(width / 2); + height = Math.ceil(height / 2); + } + } + reset(i, j) { + let currentLevel = 0, + value = 0, + level; + while (currentLevel < this.levels.length) { + level = this.levels[currentLevel]; + const index = i + j * level.width; + if (level.items[index] !== undefined) { + value = level.items[index]; + break; + } + level.index = index; + i >>= 1; + j >>= 1; + currentLevel++; + } + currentLevel--; + level = this.levels[currentLevel]; + level.items[level.index] = value; + this.currentLevel = currentLevel; + delete this.value; + } + incrementValue() { + const level = this.levels[this.currentLevel]; + level.items[level.index]++; + } + nextLevel() { + let currentLevel = this.currentLevel; + let level = this.levels[currentLevel]; + const value = level.items[level.index]; + currentLevel--; + if (currentLevel < 0) { + this.value = value; + return false; + } + this.currentLevel = currentLevel; + level = this.levels[currentLevel]; + level.items[level.index] = value; + return true; + } +} +class InclusionTree { + constructor(width, height, defaultValue) { + const levelsLength = log2(Math.max(width, height)) + 1; + this.levels = []; + for (let i = 0; i < levelsLength; i++) { + const items = new Uint8Array(width * height); + for (let j = 0, jj = items.length; j < jj; j++) { + items[j] = defaultValue; + } + const level = { + width, + height, + items + }; + this.levels.push(level); + width = Math.ceil(width / 2); + height = Math.ceil(height / 2); + } + } + reset(i, j, stopValue) { + let currentLevel = 0; + while (currentLevel < this.levels.length) { + const level = this.levels[currentLevel]; + const index = i + j * level.width; + level.index = index; + const value = level.items[index]; + if (value === 0xff) { + break; + } + if (value > stopValue) { + this.currentLevel = currentLevel; + this.propagateValues(); + return false; + } + i >>= 1; + j >>= 1; + currentLevel++; + } + this.currentLevel = currentLevel - 1; + return true; + } + incrementValue(stopValue) { + const level = this.levels[this.currentLevel]; + level.items[level.index] = stopValue + 1; + this.propagateValues(); + } + propagateValues() { + let levelIndex = this.currentLevel; + let level = this.levels[levelIndex]; + const currentValue = level.items[level.index]; + while (--levelIndex >= 0) { + level = this.levels[levelIndex]; + level.items[level.index] = currentValue; + } + } + nextLevel() { + let currentLevel = this.currentLevel; + let level = this.levels[currentLevel]; + const value = level.items[level.index]; + level.items[level.index] = 0xff; + currentLevel--; + if (currentLevel < 0) { + return false; + } + this.currentLevel = currentLevel; + level = this.levels[currentLevel]; + level.items[level.index] = value; + return true; + } +} +class BitModel { + static UNIFORM_CONTEXT = 17; + static RUNLENGTH_CONTEXT = 18; + static LLAndLHContextsLabel = new Uint8Array([0, 5, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 1, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8]); + static HLContextLabel = new Uint8Array([0, 3, 4, 0, 5, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 1, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8]); + static HHContextLabel = new Uint8Array([0, 1, 2, 0, 1, 2, 2, 0, 2, 2, 2, 0, 0, 0, 0, 0, 3, 4, 5, 0, 4, 5, 5, 0, 5, 5, 5, 0, 0, 0, 0, 0, 6, 7, 7, 0, 7, 7, 7, 0, 7, 7, 7, 0, 0, 0, 0, 0, 8, 8, 8, 0, 8, 8, 8, 0, 8, 8, 8, 0, 0, 0, 0, 0, 8, 8, 8, 0, 8, 8, 8, 0, 8, 8, 8]); + constructor(width, height, subband, zeroBitPlanes, mb) { + this.width = width; + this.height = height; + let contextLabelTable; + if (subband === "HH") { + contextLabelTable = BitModel.HHContextLabel; + } else if (subband === "HL") { + contextLabelTable = BitModel.HLContextLabel; + } else { + contextLabelTable = BitModel.LLAndLHContextsLabel; + } + this.contextLabelTable = contextLabelTable; + const coefficientCount = width * height; + this.neighborsSignificance = new Uint8Array(coefficientCount); + this.coefficentsSign = new Uint8Array(coefficientCount); + let coefficentsMagnitude; + if (mb > 14) { + coefficentsMagnitude = new Uint32Array(coefficientCount); + } else if (mb > 6) { + coefficentsMagnitude = new Uint16Array(coefficientCount); + } else { + coefficentsMagnitude = new Uint8Array(coefficientCount); + } + this.coefficentsMagnitude = coefficentsMagnitude; + this.processingFlags = new Uint8Array(coefficientCount); + const bitsDecoded = new Uint8Array(coefficientCount); + if (zeroBitPlanes !== 0) { + for (let i = 0; i < coefficientCount; i++) { + bitsDecoded[i] = zeroBitPlanes; + } + } + this.bitsDecoded = bitsDecoded; + this.reset(); + } + setDecoder(decoder) { + this.decoder = decoder; + } + reset() { + this.contexts = new Int8Array(19); + this.contexts[0] = 4 << 1 | 0; + this.contexts[BitModel.UNIFORM_CONTEXT] = 46 << 1 | 0; + this.contexts[BitModel.RUNLENGTH_CONTEXT] = 3 << 1 | 0; + } + setNeighborsSignificance(row, column, index) { + const neighborsSignificance = this.neighborsSignificance; + const width = this.width, + height = this.height; + const left = column > 0; + const right = column + 1 < width; + let i; + if (row > 0) { + i = index - width; + if (left) { + neighborsSignificance[i - 1] += 0x10; + } + if (right) { + neighborsSignificance[i + 1] += 0x10; + } + neighborsSignificance[i] += 0x04; + } + if (row + 1 < height) { + i = index + width; + if (left) { + neighborsSignificance[i - 1] += 0x10; + } + if (right) { + neighborsSignificance[i + 1] += 0x10; + } + neighborsSignificance[i] += 0x04; + } + if (left) { + neighborsSignificance[index - 1] += 0x01; + } + if (right) { + neighborsSignificance[index + 1] += 0x01; + } + neighborsSignificance[index] |= 0x80; + } + runSignificancePropagationPass() { + const decoder = this.decoder; + const width = this.width, + height = this.height; + const coefficentsMagnitude = this.coefficentsMagnitude; + const coefficentsSign = this.coefficentsSign; + const neighborsSignificance = this.neighborsSignificance; + const processingFlags = this.processingFlags; + const contexts = this.contexts; + const labels = this.contextLabelTable; + const bitsDecoded = this.bitsDecoded; + const processedInverseMask = ~1; + const processedMask = 1; + const firstMagnitudeBitMask = 2; + for (let i0 = 0; i0 < height; i0 += 4) { + for (let j = 0; j < width; j++) { + let index = i0 * width + j; + for (let i1 = 0; i1 < 4; i1++, index += width) { + const i = i0 + i1; + if (i >= height) { + break; + } + processingFlags[index] &= processedInverseMask; + if (coefficentsMagnitude[index] || !neighborsSignificance[index]) { + continue; + } + const contextLabel = labels[neighborsSignificance[index]]; + const decision = decoder.readBit(contexts, contextLabel); + if (decision) { + const sign = this.decodeSignBit(i, j, index); + coefficentsSign[index] = sign; + coefficentsMagnitude[index] = 1; + this.setNeighborsSignificance(i, j, index); + processingFlags[index] |= firstMagnitudeBitMask; + } + bitsDecoded[index]++; + processingFlags[index] |= processedMask; + } + } + } + } + decodeSignBit(row, column, index) { + const width = this.width, + height = this.height; + const coefficentsMagnitude = this.coefficentsMagnitude; + const coefficentsSign = this.coefficentsSign; + let contribution, sign0, sign1, significance1; + let contextLabel, decoded; + significance1 = column > 0 && coefficentsMagnitude[index - 1] !== 0; + if (column + 1 < width && coefficentsMagnitude[index + 1] !== 0) { + sign1 = coefficentsSign[index + 1]; + if (significance1) { + sign0 = coefficentsSign[index - 1]; + contribution = 1 - sign1 - sign0; + } else { + contribution = 1 - sign1 - sign1; + } + } else if (significance1) { + sign0 = coefficentsSign[index - 1]; + contribution = 1 - sign0 - sign0; + } else { + contribution = 0; + } + const horizontalContribution = 3 * contribution; + significance1 = row > 0 && coefficentsMagnitude[index - width] !== 0; + if (row + 1 < height && coefficentsMagnitude[index + width] !== 0) { + sign1 = coefficentsSign[index + width]; + if (significance1) { + sign0 = coefficentsSign[index - width]; + contribution = 1 - sign1 - sign0 + horizontalContribution; + } else { + contribution = 1 - sign1 - sign1 + horizontalContribution; + } + } else if (significance1) { + sign0 = coefficentsSign[index - width]; + contribution = 1 - sign0 - sign0 + horizontalContribution; + } else { + contribution = horizontalContribution; + } + if (contribution >= 0) { + contextLabel = 9 + contribution; + decoded = this.decoder.readBit(this.contexts, contextLabel); + } else { + contextLabel = 9 - contribution; + decoded = this.decoder.readBit(this.contexts, contextLabel) ^ 1; + } + return decoded; + } + runMagnitudeRefinementPass() { + const decoder = this.decoder; + const width = this.width, + height = this.height; + const coefficentsMagnitude = this.coefficentsMagnitude; + const neighborsSignificance = this.neighborsSignificance; + const contexts = this.contexts; + const bitsDecoded = this.bitsDecoded; + const processingFlags = this.processingFlags; + const processedMask = 1; + const firstMagnitudeBitMask = 2; + const length = width * height; + const width4 = width * 4; + for (let index0 = 0, indexNext; index0 < length; index0 = indexNext) { + indexNext = Math.min(length, index0 + width4); + for (let j = 0; j < width; j++) { + for (let index = index0 + j; index < indexNext; index += width) { + if (!coefficentsMagnitude[index] || (processingFlags[index] & processedMask) !== 0) { + continue; + } + let contextLabel = 16; + if ((processingFlags[index] & firstMagnitudeBitMask) !== 0) { + processingFlags[index] ^= firstMagnitudeBitMask; + const significance = neighborsSignificance[index] & 127; + contextLabel = significance === 0 ? 15 : 14; + } + const bit = decoder.readBit(contexts, contextLabel); + coefficentsMagnitude[index] = coefficentsMagnitude[index] << 1 | bit; + bitsDecoded[index]++; + processingFlags[index] |= processedMask; + } + } + } + } + runCleanupPass() { + const decoder = this.decoder; + const width = this.width, + height = this.height; + const neighborsSignificance = this.neighborsSignificance; + const coefficentsMagnitude = this.coefficentsMagnitude; + const coefficentsSign = this.coefficentsSign; + const contexts = this.contexts; + const labels = this.contextLabelTable; + const bitsDecoded = this.bitsDecoded; + const processingFlags = this.processingFlags; + const processedMask = 1; + const firstMagnitudeBitMask = 2; + const oneRowDown = width; + const twoRowsDown = width * 2; + const threeRowsDown = width * 3; + let iNext; + for (let i0 = 0; i0 < height; i0 = iNext) { + iNext = Math.min(i0 + 4, height); + const indexBase = i0 * width; + const checkAllEmpty = i0 + 3 < height; + for (let j = 0; j < width; j++) { + const index0 = indexBase + j; + const allEmpty = checkAllEmpty && processingFlags[index0] === 0 && processingFlags[index0 + oneRowDown] === 0 && processingFlags[index0 + twoRowsDown] === 0 && processingFlags[index0 + threeRowsDown] === 0 && neighborsSignificance[index0] === 0 && neighborsSignificance[index0 + oneRowDown] === 0 && neighborsSignificance[index0 + twoRowsDown] === 0 && neighborsSignificance[index0 + threeRowsDown] === 0; + let i1 = 0, + index = index0; + let i = i0, + sign; + if (allEmpty) { + const hasSignificantCoefficent = decoder.readBit(contexts, BitModel.RUNLENGTH_CONTEXT); + if (!hasSignificantCoefficent) { + bitsDecoded[index0]++; + bitsDecoded[index0 + oneRowDown]++; + bitsDecoded[index0 + twoRowsDown]++; + bitsDecoded[index0 + threeRowsDown]++; + continue; + } + i1 = decoder.readBit(contexts, BitModel.UNIFORM_CONTEXT) << 1 | decoder.readBit(contexts, BitModel.UNIFORM_CONTEXT); + if (i1 !== 0) { + i = i0 + i1; + index += i1 * width; + } + sign = this.decodeSignBit(i, j, index); + coefficentsSign[index] = sign; + coefficentsMagnitude[index] = 1; + this.setNeighborsSignificance(i, j, index); + processingFlags[index] |= firstMagnitudeBitMask; + index = index0; + for (let i2 = i0; i2 <= i; i2++, index += width) { + bitsDecoded[index]++; + } + i1++; + } + for (i = i0 + i1; i < iNext; i++, index += width) { + if (coefficentsMagnitude[index] || (processingFlags[index] & processedMask) !== 0) { + continue; + } + const contextLabel = labels[neighborsSignificance[index]]; + const decision = decoder.readBit(contexts, contextLabel); + if (decision === 1) { + sign = this.decodeSignBit(i, j, index); + coefficentsSign[index] = sign; + coefficentsMagnitude[index] = 1; + this.setNeighborsSignificance(i, j, index); + processingFlags[index] |= firstMagnitudeBitMask; + } + bitsDecoded[index]++; + } + } + } + } + checkSegmentationSymbol() { + const decoder = this.decoder; + const contexts = this.contexts; + const symbol = decoder.readBit(contexts, BitModel.UNIFORM_CONTEXT) << 3 | decoder.readBit(contexts, BitModel.UNIFORM_CONTEXT) << 2 | decoder.readBit(contexts, BitModel.UNIFORM_CONTEXT) << 1 | decoder.readBit(contexts, BitModel.UNIFORM_CONTEXT); + if (symbol !== 0xa) { + throw new JpxError("Invalid segmentation symbol"); + } + } +} +class Transform { + constructor() { + if (this.constructor === Transform) { + unreachable("Cannot initialize Transform."); + } + } + calculate(subbands, u0, v0) { + let ll = subbands[0]; + for (let i = 1, ii = subbands.length; i < ii; i++) { + ll = this.iterate(ll, subbands[i], u0, v0); + } + return ll; + } + extend(buffer, offset, size) { + let i1 = offset - 1, + j1 = offset + 1; + let i2 = offset + size - 2, + j2 = offset + size; + buffer[i1--] = buffer[j1++]; + buffer[j2++] = buffer[i2--]; + buffer[i1--] = buffer[j1++]; + buffer[j2++] = buffer[i2--]; + buffer[i1--] = buffer[j1++]; + buffer[j2++] = buffer[i2--]; + buffer[i1] = buffer[j1]; + buffer[j2] = buffer[i2]; + } + filter(x, offset, length) { + unreachable("Abstract method `filter` called"); + } + iterate(ll, hl_lh_hh, u0, v0) { + const llWidth = ll.width, + llHeight = ll.height; + let llItems = ll.items; + const width = hl_lh_hh.width; + const height = hl_lh_hh.height; + const items = hl_lh_hh.items; + let i, j, k, l, u, v; + for (k = 0, i = 0; i < llHeight; i++) { + l = i * 2 * width; + for (j = 0; j < llWidth; j++, k++, l += 2) { + items[l] = llItems[k]; + } + } + llItems = ll.items = null; + const bufferPadding = 4; + const rowBuffer = new Float32Array(width + 2 * bufferPadding); + if (width === 1) { + if ((u0 & 1) !== 0) { + for (v = 0, k = 0; v < height; v++, k += width) { + items[k] *= 0.5; + } + } + } else { + for (v = 0, k = 0; v < height; v++, k += width) { + rowBuffer.set(items.subarray(k, k + width), bufferPadding); + this.extend(rowBuffer, bufferPadding, width); + this.filter(rowBuffer, bufferPadding, width); + items.set(rowBuffer.subarray(bufferPadding, bufferPadding + width), k); + } + } + let numBuffers = 16; + const colBuffers = []; + for (i = 0; i < numBuffers; i++) { + colBuffers.push(new Float32Array(height + 2 * bufferPadding)); + } + let b, + currentBuffer = 0; + ll = bufferPadding + height; + if (height === 1) { + if ((v0 & 1) !== 0) { + for (u = 0; u < width; u++) { + items[u] *= 0.5; + } + } + } else { + for (u = 0; u < width; u++) { + if (currentBuffer === 0) { + numBuffers = Math.min(width - u, numBuffers); + for (k = u, l = bufferPadding; l < ll; k += width, l++) { + for (b = 0; b < numBuffers; b++) { + colBuffers[b][l] = items[k + b]; + } + } + currentBuffer = numBuffers; + } + currentBuffer--; + const buffer = colBuffers[currentBuffer]; + this.extend(buffer, bufferPadding, height); + this.filter(buffer, bufferPadding, height); + if (currentBuffer === 0) { + k = u - numBuffers + 1; + for (l = bufferPadding; l < ll; k += width, l++) { + for (b = 0; b < numBuffers; b++) { + items[k + b] = colBuffers[b][l]; + } + } + } + } + } + return { + width, + height, + items + }; + } +} +class IrreversibleTransform extends Transform { + filter(x, offset, length) { + const len = length >> 1; + offset |= 0; + let j, n, current, next; + const alpha = -1.586134342059924; + const beta = -0.052980118572961; + const gamma = 0.882911075530934; + const delta = 0.443506852043971; + const K = 1.230174104914001; + const K_ = 1 / K; + j = offset - 3; + for (n = len + 4; n--; j += 2) { + x[j] *= K_; + } + j = offset - 2; + current = delta * x[j - 1]; + for (n = len + 3; n--; j += 2) { + next = delta * x[j + 1]; + x[j] = K * x[j] - current - next; + if (n--) { + j += 2; + current = delta * x[j + 1]; + x[j] = K * x[j] - current - next; + } else { + break; + } + } + j = offset - 1; + current = gamma * x[j - 1]; + for (n = len + 2; n--; j += 2) { + next = gamma * x[j + 1]; + x[j] -= current + next; + if (n--) { + j += 2; + current = gamma * x[j + 1]; + x[j] -= current + next; + } else { + break; + } + } + j = offset; + current = beta * x[j - 1]; + for (n = len + 1; n--; j += 2) { + next = beta * x[j + 1]; + x[j] -= current + next; + if (n--) { + j += 2; + current = beta * x[j + 1]; + x[j] -= current + next; + } else { + break; + } + } + if (len !== 0) { + j = offset + 1; + current = alpha * x[j - 1]; + for (n = len; n--; j += 2) { + next = alpha * x[j + 1]; + x[j] -= current + next; + if (n--) { + j += 2; + current = alpha * x[j + 1]; + x[j] -= current + next; + } else { + break; + } + } + } + } +} +class ReversibleTransform extends Transform { + filter(x, offset, length) { + const len = length >> 1; + offset |= 0; + let j, n; + for (j = offset, n = len + 1; n--; j += 2) { + x[j] -= x[j - 1] + x[j + 1] + 2 >> 2; + } + for (j = offset + 1, n = len; n--; j += 2) { + x[j] += x[j - 1] + x[j + 1] >> 1; + } + } +} + +;// CONCATENATED MODULE: ./src/core/jpx_stream.js + + + +class JpxStream extends DecodeStream { + constructor(stream, maybeLength, params) { + super(maybeLength); + this.stream = stream; + this.dict = stream.dict; + this.maybeLength = maybeLength; + this.params = params; + } + get bytes() { + return shadow(this, "bytes", this.stream.getBytes(this.maybeLength)); + } + ensureBuffer(requested) {} + readBlock() { + if (this.eof) { + return; + } + const jpxImage = new JpxImage(); + jpxImage.parse(this.bytes); + const width = jpxImage.width; + const height = jpxImage.height; + const componentsCount = jpxImage.componentsCount; + const tileCount = jpxImage.tiles.length; + if (tileCount === 1) { + this.buffer = jpxImage.tiles[0].items; + } else { + const data = new Uint8ClampedArray(width * height * componentsCount); + for (let k = 0; k < tileCount; k++) { + const tileComponents = jpxImage.tiles[k]; + const tileWidth = tileComponents.width; + const tileHeight = tileComponents.height; + const tileLeft = tileComponents.left; + const tileTop = tileComponents.top; + const src = tileComponents.items; + let srcPosition = 0; + let dataPosition = (width * tileTop + tileLeft) * componentsCount; + const imgRowSize = width * componentsCount; + const tileRowSize = tileWidth * componentsCount; + for (let j = 0; j < tileHeight; j++) { + const rowBytes = src.subarray(srcPosition, srcPosition + tileRowSize); + data.set(rowBytes, dataPosition); + srcPosition += tileRowSize; + dataPosition += imgRowSize; + } + } + this.buffer = data; + } + this.bufferLength = this.buffer.length; + this.eof = true; + } +} + +;// CONCATENATED MODULE: ./src/core/lzw_stream.js + +class LZWStream extends DecodeStream { + constructor(str, maybeLength, earlyChange) { + super(maybeLength); + this.str = str; + this.dict = str.dict; + this.cachedData = 0; + this.bitsCached = 0; + const maxLzwDictionarySize = 4096; + const lzwState = { + earlyChange, + codeLength: 9, + nextCode: 258, + dictionaryValues: new Uint8Array(maxLzwDictionarySize), + dictionaryLengths: new Uint16Array(maxLzwDictionarySize), + dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize), + currentSequence: new Uint8Array(maxLzwDictionarySize), + currentSequenceLength: 0 + }; + for (let i = 0; i < 256; ++i) { + lzwState.dictionaryValues[i] = i; + lzwState.dictionaryLengths[i] = 1; + } + this.lzwState = lzwState; + } + readBits(n) { + let bitsCached = this.bitsCached; + let cachedData = this.cachedData; + while (bitsCached < n) { + const c = this.str.getByte(); + if (c === -1) { + this.eof = true; + return null; + } + cachedData = cachedData << 8 | c; + bitsCached += 8; + } + this.bitsCached = bitsCached -= n; + this.cachedData = cachedData; + this.lastCode = null; + return cachedData >>> bitsCached & (1 << n) - 1; + } + readBlock() { + const blockSize = 512, + decodedSizeDelta = blockSize; + let estimatedDecodedSize = blockSize * 2; + let i, j, q; + const lzwState = this.lzwState; + if (!lzwState) { + return; + } + const earlyChange = lzwState.earlyChange; + let nextCode = lzwState.nextCode; + const dictionaryValues = lzwState.dictionaryValues; + const dictionaryLengths = lzwState.dictionaryLengths; + const dictionaryPrevCodes = lzwState.dictionaryPrevCodes; + let codeLength = lzwState.codeLength; + let prevCode = lzwState.prevCode; + const currentSequence = lzwState.currentSequence; + let currentSequenceLength = lzwState.currentSequenceLength; + let decodedLength = 0; + let currentBufferLength = this.bufferLength; + let buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); + for (i = 0; i < blockSize; i++) { + const code = this.readBits(codeLength); + const hasPrev = currentSequenceLength > 0; + if (code < 256) { + currentSequence[0] = code; + currentSequenceLength = 1; + } else if (code >= 258) { + if (code < nextCode) { + currentSequenceLength = dictionaryLengths[code]; + for (j = currentSequenceLength - 1, q = code; j >= 0; j--) { + currentSequence[j] = dictionaryValues[q]; + q = dictionaryPrevCodes[q]; + } + } else { + currentSequence[currentSequenceLength++] = currentSequence[0]; + } + } else if (code === 256) { + codeLength = 9; + nextCode = 258; + currentSequenceLength = 0; + continue; + } else { + this.eof = true; + delete this.lzwState; + break; + } + if (hasPrev) { + dictionaryPrevCodes[nextCode] = prevCode; + dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1; + dictionaryValues[nextCode] = currentSequence[0]; + nextCode++; + codeLength = nextCode + earlyChange & nextCode + earlyChange - 1 ? codeLength : Math.min(Math.log(nextCode + earlyChange) / 0.6931471805599453 + 1, 12) | 0; + } + prevCode = code; + decodedLength += currentSequenceLength; + if (estimatedDecodedSize < decodedLength) { + do { + estimatedDecodedSize += decodedSizeDelta; + } while (estimatedDecodedSize < decodedLength); + buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize); + } + for (j = 0; j < currentSequenceLength; j++) { + buffer[currentBufferLength++] = currentSequence[j]; + } + } + lzwState.nextCode = nextCode; + lzwState.codeLength = codeLength; + lzwState.prevCode = prevCode; + lzwState.currentSequenceLength = currentSequenceLength; + this.bufferLength = currentBufferLength; + } +} + +;// CONCATENATED MODULE: ./src/core/predictor_stream.js + + + +class PredictorStream extends DecodeStream { + constructor(str, maybeLength, params) { + super(maybeLength); + if (!(params instanceof Dict)) { + return str; + } + const predictor = this.predictor = params.get("Predictor") || 1; + if (predictor <= 1) { + return str; + } + if (predictor !== 2 && (predictor < 10 || predictor > 15)) { + throw new FormatError(`Unsupported predictor: ${predictor}`); + } + this.readBlock = predictor === 2 ? this.readBlockTiff : this.readBlockPng; + this.str = str; + this.dict = str.dict; + const colors = this.colors = params.get("Colors") || 1; + const bits = this.bits = params.get("BPC", "BitsPerComponent") || 8; + const columns = this.columns = params.get("Columns") || 1; + this.pixBytes = colors * bits + 7 >> 3; + this.rowBytes = columns * colors * bits + 7 >> 3; + return this; + } + readBlockTiff() { + const rowBytes = this.rowBytes; + const bufferLength = this.bufferLength; + const buffer = this.ensureBuffer(bufferLength + rowBytes); + const bits = this.bits; + const colors = this.colors; + const rawBytes = this.str.getBytes(rowBytes); + this.eof = !rawBytes.length; + if (this.eof) { + return; + } + let inbuf = 0, + outbuf = 0; + let inbits = 0, + outbits = 0; + let pos = bufferLength; + let i; + if (bits === 1 && colors === 1) { + for (i = 0; i < rowBytes; ++i) { + let c = rawBytes[i] ^ inbuf; + c ^= c >> 1; + c ^= c >> 2; + c ^= c >> 4; + inbuf = (c & 1) << 7; + buffer[pos++] = c; + } + } else if (bits === 8) { + for (i = 0; i < colors; ++i) { + buffer[pos++] = rawBytes[i]; + } + for (; i < rowBytes; ++i) { + buffer[pos] = buffer[pos - colors] + rawBytes[i]; + pos++; + } + } else if (bits === 16) { + const bytesPerPixel = colors * 2; + for (i = 0; i < bytesPerPixel; ++i) { + buffer[pos++] = rawBytes[i]; + } + for (; i < rowBytes; i += 2) { + const sum = ((rawBytes[i] & 0xff) << 8) + (rawBytes[i + 1] & 0xff) + ((buffer[pos - bytesPerPixel] & 0xff) << 8) + (buffer[pos - bytesPerPixel + 1] & 0xff); + buffer[pos++] = sum >> 8 & 0xff; + buffer[pos++] = sum & 0xff; + } + } else { + const compArray = new Uint8Array(colors + 1); + const bitMask = (1 << bits) - 1; + let j = 0, + k = bufferLength; + const columns = this.columns; + for (i = 0; i < columns; ++i) { + for (let kk = 0; kk < colors; ++kk) { + if (inbits < bits) { + inbuf = inbuf << 8 | rawBytes[j++] & 0xff; + inbits += 8; + } + compArray[kk] = compArray[kk] + (inbuf >> inbits - bits) & bitMask; + inbits -= bits; + outbuf = outbuf << bits | compArray[kk]; + outbits += bits; + if (outbits >= 8) { + buffer[k++] = outbuf >> outbits - 8 & 0xff; + outbits -= 8; + } + } + } + if (outbits > 0) { + buffer[k++] = (outbuf << 8 - outbits) + (inbuf & (1 << 8 - outbits) - 1); + } + } + this.bufferLength += rowBytes; + } + readBlockPng() { + const rowBytes = this.rowBytes; + const pixBytes = this.pixBytes; + const predictor = this.str.getByte(); + const rawBytes = this.str.getBytes(rowBytes); + this.eof = !rawBytes.length; + if (this.eof) { + return; + } + const bufferLength = this.bufferLength; + const buffer = this.ensureBuffer(bufferLength + rowBytes); + let prevRow = buffer.subarray(bufferLength - rowBytes, bufferLength); + if (prevRow.length === 0) { + prevRow = new Uint8Array(rowBytes); + } + let i, + j = bufferLength, + up, + c; + switch (predictor) { + case 0: + for (i = 0; i < rowBytes; ++i) { + buffer[j++] = rawBytes[i]; + } + break; + case 1: + for (i = 0; i < pixBytes; ++i) { + buffer[j++] = rawBytes[i]; + } + for (; i < rowBytes; ++i) { + buffer[j] = buffer[j - pixBytes] + rawBytes[i] & 0xff; + j++; + } + break; + case 2: + for (i = 0; i < rowBytes; ++i) { + buffer[j++] = prevRow[i] + rawBytes[i] & 0xff; + } + break; + case 3: + for (i = 0; i < pixBytes; ++i) { + buffer[j++] = (prevRow[i] >> 1) + rawBytes[i]; + } + for (; i < rowBytes; ++i) { + buffer[j] = (prevRow[i] + buffer[j - pixBytes] >> 1) + rawBytes[i] & 0xff; + j++; + } + break; + case 4: + for (i = 0; i < pixBytes; ++i) { + up = prevRow[i]; + c = rawBytes[i]; + buffer[j++] = up + c; + } + for (; i < rowBytes; ++i) { + up = prevRow[i]; + const upLeft = prevRow[i - pixBytes]; + const left = buffer[j - pixBytes]; + const p = left + up - upLeft; + let pa = p - left; + if (pa < 0) { + pa = -pa; + } + let pb = p - up; + if (pb < 0) { + pb = -pb; + } + let pc = p - upLeft; + if (pc < 0) { + pc = -pc; + } + c = rawBytes[i]; + if (pa <= pb && pa <= pc) { + buffer[j++] = left + c; + } else if (pb <= pc) { + buffer[j++] = up + c; + } else { + buffer[j++] = upLeft + c; + } + } + break; + default: + throw new FormatError(`Unsupported predictor: ${predictor}`); + } + this.bufferLength += rowBytes; + } +} + +;// CONCATENATED MODULE: ./src/core/run_length_stream.js + +class RunLengthStream extends DecodeStream { + constructor(str, maybeLength) { + super(maybeLength); + this.str = str; + this.dict = str.dict; + } + readBlock() { + const repeatHeader = this.str.getBytes(2); + if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) { + this.eof = true; + return; + } + let buffer; + let bufferLength = this.bufferLength; + let n = repeatHeader[0]; + if (n < 128) { + buffer = this.ensureBuffer(bufferLength + n + 1); + buffer[bufferLength++] = repeatHeader[1]; + if (n > 0) { + const source = this.str.getBytes(n); + buffer.set(source, bufferLength); + bufferLength += n; + } + } else { + n = 257 - n; + const b = repeatHeader[1]; + buffer = this.ensureBuffer(bufferLength + n + 1); + for (let i = 0; i < n; i++) { + buffer[bufferLength++] = b; + } + } + this.bufferLength = bufferLength; + } +} + +;// CONCATENATED MODULE: ./src/core/parser.js + + + + + + + + + + + + + + +const MAX_LENGTH_TO_CACHE = 1000; +function getInlineImageCacheKey(bytes) { + const strBuf = [], + ii = bytes.length; + let i = 0; + while (i < ii - 1) { + strBuf.push(bytes[i++] << 8 | bytes[i++]); + } + if (i < ii) { + strBuf.push(bytes[i]); + } + return ii + "_" + String.fromCharCode.apply(null, strBuf); +} +class Parser { + constructor({ + lexer, + xref, + allowStreams = false, + recoveryMode = false + }) { + this.lexer = lexer; + this.xref = xref; + this.allowStreams = allowStreams; + this.recoveryMode = recoveryMode; + this.imageCache = Object.create(null); + this._imageId = 0; + this.refill(); + } + refill() { + this.buf1 = this.lexer.getObj(); + this.buf2 = this.lexer.getObj(); + } + shift() { + if (this.buf2 instanceof Cmd && this.buf2.cmd === "ID") { + this.buf1 = this.buf2; + this.buf2 = null; + } else { + this.buf1 = this.buf2; + this.buf2 = this.lexer.getObj(); + } + } + tryShift() { + try { + this.shift(); + return true; + } catch (e) { + if (e instanceof MissingDataException) { + throw e; + } + return false; + } + } + getObj(cipherTransform = null) { + const buf1 = this.buf1; + this.shift(); + if (buf1 instanceof Cmd) { + switch (buf1.cmd) { + case "BI": + return this.makeInlineImage(cipherTransform); + case "[": + const array = []; + while (!isCmd(this.buf1, "]") && this.buf1 !== EOF) { + array.push(this.getObj(cipherTransform)); + } + if (this.buf1 === EOF) { + if (this.recoveryMode) { + return array; + } + throw new ParserEOFException("End of file inside array."); + } + this.shift(); + return array; + case "<<": + const dict = new Dict(this.xref); + while (!isCmd(this.buf1, ">>") && this.buf1 !== EOF) { + if (!(this.buf1 instanceof Name)) { + info("Malformed dictionary: key must be a name object"); + this.shift(); + continue; + } + const key = this.buf1.name; + this.shift(); + if (this.buf1 === EOF) { + break; + } + dict.set(key, this.getObj(cipherTransform)); + } + if (this.buf1 === EOF) { + if (this.recoveryMode) { + return dict; + } + throw new ParserEOFException("End of file inside dictionary."); + } + if (isCmd(this.buf2, "stream")) { + return this.allowStreams ? this.makeStream(dict, cipherTransform) : dict; + } + this.shift(); + return dict; + default: + return buf1; + } + } + if (Number.isInteger(buf1)) { + if (Number.isInteger(this.buf1) && isCmd(this.buf2, "R")) { + const ref = Ref.get(buf1, this.buf1); + this.shift(); + this.shift(); + return ref; + } + return buf1; + } + if (typeof buf1 === "string") { + if (cipherTransform) { + return cipherTransform.decryptString(buf1); + } + return buf1; + } + return buf1; + } + findDefaultInlineStreamEnd(stream) { + const E = 0x45, + I = 0x49, + SPACE = 0x20, + LF = 0xa, + CR = 0xd, + NUL = 0x0; + const { + knownCommands + } = this.lexer, + startPos = stream.pos, + n = 15; + let state = 0, + ch, + maybeEIPos; + while ((ch = stream.getByte()) !== -1) { + if (state === 0) { + state = ch === E ? 1 : 0; + } else if (state === 1) { + state = ch === I ? 2 : 0; + } else { + if (ch === SPACE || ch === LF || ch === CR) { + maybeEIPos = stream.pos; + const followingBytes = stream.peekBytes(n); + const ii = followingBytes.length; + if (ii === 0) { + break; + } + for (let i = 0; i < ii; i++) { + ch = followingBytes[i]; + if (ch === NUL && followingBytes[i + 1] !== NUL) { + continue; + } + if (ch !== LF && ch !== CR && (ch < SPACE || ch > 0x7f)) { + state = 0; + break; + } + } + if (state !== 2) { + continue; + } + if (!knownCommands) { + warn("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined."); + continue; + } + const tmpLexer = new Lexer(new Stream(followingBytes.slice()), knownCommands); + tmpLexer._hexStringWarn = () => {}; + let numArgs = 0; + while (true) { + const nextObj = tmpLexer.getObj(); + if (nextObj === EOF) { + state = 0; + break; + } + if (nextObj instanceof Cmd) { + const knownCommand = knownCommands[nextObj.cmd]; + if (!knownCommand) { + state = 0; + break; + } else if (knownCommand.variableArgs ? numArgs <= knownCommand.numArgs : numArgs === knownCommand.numArgs) { + break; + } + numArgs = 0; + continue; + } + numArgs++; + } + if (state === 2) { + break; + } + } else { + state = 0; + } + } + } + if (ch === -1) { + warn("findDefaultInlineStreamEnd: " + "Reached the end of the stream without finding a valid EI marker"); + if (maybeEIPos) { + warn('... trying to recover by using the last "EI" occurrence.'); + stream.skip(-(stream.pos - maybeEIPos)); + } + } + let endOffset = 4; + stream.skip(-endOffset); + ch = stream.peekByte(); + stream.skip(endOffset); + if (!isWhiteSpace(ch)) { + endOffset--; + } + return stream.pos - endOffset - startPos; + } + findDCTDecodeInlineStreamEnd(stream) { + const startPos = stream.pos; + let foundEOI = false, + b, + markerLength; + while ((b = stream.getByte()) !== -1) { + if (b !== 0xff) { + continue; + } + switch (stream.getByte()) { + case 0x00: + break; + case 0xff: + stream.skip(-1); + break; + case 0xd9: + foundEOI = true; + break; + case 0xc0: + case 0xc1: + case 0xc2: + case 0xc3: + case 0xc5: + case 0xc6: + case 0xc7: + case 0xc9: + case 0xca: + case 0xcb: + case 0xcd: + case 0xce: + case 0xcf: + case 0xc4: + case 0xcc: + case 0xda: + case 0xdb: + case 0xdc: + case 0xdd: + case 0xde: + case 0xdf: + case 0xe0: + case 0xe1: + case 0xe2: + case 0xe3: + case 0xe4: + case 0xe5: + case 0xe6: + case 0xe7: + case 0xe8: + case 0xe9: + case 0xea: + case 0xeb: + case 0xec: + case 0xed: + case 0xee: + case 0xef: + case 0xfe: + markerLength = stream.getUint16(); + if (markerLength > 2) { + stream.skip(markerLength - 2); + } else { + stream.skip(-2); + } + break; + } + if (foundEOI) { + break; + } + } + const length = stream.pos - startPos; + if (b === -1) { + warn("Inline DCTDecode image stream: " + "EOI marker not found, searching for /EI/ instead."); + stream.skip(-length); + return this.findDefaultInlineStreamEnd(stream); + } + this.inlineStreamSkipEI(stream); + return length; + } + findASCII85DecodeInlineStreamEnd(stream) { + const TILDE = 0x7e, + GT = 0x3e; + const startPos = stream.pos; + let ch; + while ((ch = stream.getByte()) !== -1) { + if (ch === TILDE) { + const tildePos = stream.pos; + ch = stream.peekByte(); + while (isWhiteSpace(ch)) { + stream.skip(); + ch = stream.peekByte(); + } + if (ch === GT) { + stream.skip(); + break; + } + if (stream.pos > tildePos) { + const maybeEI = stream.peekBytes(2); + if (maybeEI[0] === 0x45 && maybeEI[1] === 0x49) { + break; + } + } + } + } + const length = stream.pos - startPos; + if (ch === -1) { + warn("Inline ASCII85Decode image stream: " + "EOD marker not found, searching for /EI/ instead."); + stream.skip(-length); + return this.findDefaultInlineStreamEnd(stream); + } + this.inlineStreamSkipEI(stream); + return length; + } + findASCIIHexDecodeInlineStreamEnd(stream) { + const GT = 0x3e; + const startPos = stream.pos; + let ch; + while ((ch = stream.getByte()) !== -1) { + if (ch === GT) { + break; + } + } + const length = stream.pos - startPos; + if (ch === -1) { + warn("Inline ASCIIHexDecode image stream: " + "EOD marker not found, searching for /EI/ instead."); + stream.skip(-length); + return this.findDefaultInlineStreamEnd(stream); + } + this.inlineStreamSkipEI(stream); + return length; + } + inlineStreamSkipEI(stream) { + const E = 0x45, + I = 0x49; + let state = 0, + ch; + while ((ch = stream.getByte()) !== -1) { + if (state === 0) { + state = ch === E ? 1 : 0; + } else if (state === 1) { + state = ch === I ? 2 : 0; + } else if (state === 2) { + break; + } + } + } + makeInlineImage(cipherTransform) { + const lexer = this.lexer; + const stream = lexer.stream; + const dictMap = Object.create(null); + let dictLength; + while (!isCmd(this.buf1, "ID") && this.buf1 !== EOF) { + if (!(this.buf1 instanceof Name)) { + throw new FormatError("Dictionary key must be a name object"); + } + const key = this.buf1.name; + this.shift(); + if (this.buf1 === EOF) { + break; + } + dictMap[key] = this.getObj(cipherTransform); + } + if (lexer.beginInlineImagePos !== -1) { + dictLength = stream.pos - lexer.beginInlineImagePos; + } + const filter = this.xref.fetchIfRef(dictMap.F || dictMap.Filter); + let filterName; + if (filter instanceof Name) { + filterName = filter.name; + } else if (Array.isArray(filter)) { + const filterZero = this.xref.fetchIfRef(filter[0]); + if (filterZero instanceof Name) { + filterName = filterZero.name; + } + } + const startPos = stream.pos; + let length; + switch (filterName) { + case "DCT": + case "DCTDecode": + length = this.findDCTDecodeInlineStreamEnd(stream); + break; + case "A85": + case "ASCII85Decode": + length = this.findASCII85DecodeInlineStreamEnd(stream); + break; + case "AHx": + case "ASCIIHexDecode": + length = this.findASCIIHexDecodeInlineStreamEnd(stream); + break; + default: + length = this.findDefaultInlineStreamEnd(stream); + } + let cacheKey; + if (length < MAX_LENGTH_TO_CACHE && dictLength > 0) { + const initialStreamPos = stream.pos; + stream.pos = lexer.beginInlineImagePos; + cacheKey = getInlineImageCacheKey(stream.getBytes(dictLength + length)); + stream.pos = initialStreamPos; + const cacheEntry = this.imageCache[cacheKey]; + if (cacheEntry !== undefined) { + this.buf2 = Cmd.get("EI"); + this.shift(); + cacheEntry.reset(); + return cacheEntry; + } + } + const dict = new Dict(this.xref); + for (const key in dictMap) { + dict.set(key, dictMap[key]); + } + let imageStream = stream.makeSubStream(startPos, length, dict); + if (cipherTransform) { + imageStream = cipherTransform.createStream(imageStream, length); + } + imageStream = this.filter(imageStream, dict, length); + imageStream.dict = dict; + if (cacheKey !== undefined) { + imageStream.cacheKey = `inline_img_${++this._imageId}`; + this.imageCache[cacheKey] = imageStream; + } + this.buf2 = Cmd.get("EI"); + this.shift(); + return imageStream; + } + _findStreamLength(startPos, signature) { + const { + stream + } = this.lexer; + stream.pos = startPos; + const SCAN_BLOCK_LENGTH = 2048; + const signatureLength = signature.length; + while (stream.pos < stream.end) { + const scanBytes = stream.peekBytes(SCAN_BLOCK_LENGTH); + const scanLength = scanBytes.length - signatureLength; + if (scanLength <= 0) { + break; + } + let pos = 0; + while (pos < scanLength) { + let j = 0; + while (j < signatureLength && scanBytes[pos + j] === signature[j]) { + j++; + } + if (j >= signatureLength) { + stream.pos += pos; + return stream.pos - startPos; + } + pos++; + } + stream.pos += scanLength; + } + return -1; + } + makeStream(dict, cipherTransform) { + const lexer = this.lexer; + let stream = lexer.stream; + lexer.skipToNextLine(); + const startPos = stream.pos - 1; + let length = dict.get("Length"); + if (!Number.isInteger(length)) { + info(`Bad length "${length && length.toString()}" in stream.`); + length = 0; + } + stream.pos = startPos + length; + lexer.nextChar(); + if (this.tryShift() && isCmd(this.buf2, "endstream")) { + this.shift(); + } else { + const ENDSTREAM_SIGNATURE = new Uint8Array([0x65, 0x6e, 0x64, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d]); + let actualLength = this._findStreamLength(startPos, ENDSTREAM_SIGNATURE); + if (actualLength < 0) { + const MAX_TRUNCATION = 1; + for (let i = 1; i <= MAX_TRUNCATION; i++) { + const end = ENDSTREAM_SIGNATURE.length - i; + const TRUNCATED_SIGNATURE = ENDSTREAM_SIGNATURE.slice(0, end); + const maybeLength = this._findStreamLength(startPos, TRUNCATED_SIGNATURE); + if (maybeLength >= 0) { + const lastByte = stream.peekBytes(end + 1)[end]; + if (!isWhiteSpace(lastByte)) { + break; + } + info(`Found "${bytesToString(TRUNCATED_SIGNATURE)}" when ` + "searching for endstream command."); + actualLength = maybeLength; + break; + } + } + if (actualLength < 0) { + throw new FormatError("Missing endstream command."); + } + } + length = actualLength; + lexer.nextChar(); + this.shift(); + this.shift(); + } + this.shift(); + stream = stream.makeSubStream(startPos, length, dict); + if (cipherTransform) { + stream = cipherTransform.createStream(stream, length); + } + stream = this.filter(stream, dict, length); + stream.dict = dict; + return stream; + } + filter(stream, dict, length) { + let filter = dict.get("F", "Filter"); + let params = dict.get("DP", "DecodeParms"); + if (filter instanceof Name) { + if (Array.isArray(params)) { + warn("/DecodeParms should not be an Array, when /Filter is a Name."); + } + return this.makeFilter(stream, filter.name, length, params); + } + let maybeLength = length; + if (Array.isArray(filter)) { + const filterArray = filter; + const paramsArray = params; + for (let i = 0, ii = filterArray.length; i < ii; ++i) { + filter = this.xref.fetchIfRef(filterArray[i]); + if (!(filter instanceof Name)) { + throw new FormatError(`Bad filter name "${filter}"`); + } + params = null; + if (Array.isArray(paramsArray) && i in paramsArray) { + params = this.xref.fetchIfRef(paramsArray[i]); + } + stream = this.makeFilter(stream, filter.name, maybeLength, params); + maybeLength = null; + } + } + return stream; + } + makeFilter(stream, name, maybeLength, params) { + if (maybeLength === 0) { + warn(`Empty "${name}" stream.`); + return new NullStream(); + } + try { + switch (name) { + case "Fl": + case "FlateDecode": + if (params) { + return new PredictorStream(new FlateStream(stream, maybeLength), maybeLength, params); + } + return new FlateStream(stream, maybeLength); + case "LZW": + case "LZWDecode": + let earlyChange = 1; + if (params) { + if (params.has("EarlyChange")) { + earlyChange = params.get("EarlyChange"); + } + return new PredictorStream(new LZWStream(stream, maybeLength, earlyChange), maybeLength, params); + } + return new LZWStream(stream, maybeLength, earlyChange); + case "DCT": + case "DCTDecode": + return new JpegStream(stream, maybeLength, params); + case "JPX": + case "JPXDecode": + return new JpxStream(stream, maybeLength, params); + case "A85": + case "ASCII85Decode": + return new Ascii85Stream(stream, maybeLength); + case "AHx": + case "ASCIIHexDecode": + return new AsciiHexStream(stream, maybeLength); + case "CCF": + case "CCITTFaxDecode": + return new CCITTFaxStream(stream, maybeLength, params); + case "RL": + case "RunLengthDecode": + return new RunLengthStream(stream, maybeLength); + case "JBIG2Decode": + return new Jbig2Stream(stream, maybeLength, params); + } + warn(`Filter "${name}" is not supported.`); + return stream; + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`Invalid stream: "${ex}"`); + return new NullStream(); + } + } +} +const specialChars = [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 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, 0, 0, 2, 0, 2, 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, 0, 0, 0, 2, 0, 2, 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, 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, 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, 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, 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]; +function toHexDigit(ch) { + if (ch >= 0x30 && ch <= 0x39) { + return ch & 0x0f; + } + if (ch >= 0x41 && ch <= 0x46 || ch >= 0x61 && ch <= 0x66) { + return (ch & 0x0f) + 9; + } + return -1; +} +class Lexer { + constructor(stream, knownCommands = null) { + this.stream = stream; + this.nextChar(); + this.strBuf = []; + this.knownCommands = knownCommands; + this._hexStringNumWarn = 0; + this.beginInlineImagePos = -1; + } + nextChar() { + return this.currentChar = this.stream.getByte(); + } + peekChar() { + return this.stream.peekByte(); + } + getNumber() { + let ch = this.currentChar; + let eNotation = false; + let divideBy = 0; + let sign = 1; + if (ch === 0x2d) { + sign = -1; + ch = this.nextChar(); + if (ch === 0x2d) { + ch = this.nextChar(); + } + } else if (ch === 0x2b) { + ch = this.nextChar(); + } + if (ch === 0x0a || ch === 0x0d) { + do { + ch = this.nextChar(); + } while (ch === 0x0a || ch === 0x0d); + } + if (ch === 0x2e) { + divideBy = 10; + ch = this.nextChar(); + } + if (ch < 0x30 || ch > 0x39) { + const msg = `Invalid number: ${String.fromCharCode(ch)} (charCode ${ch})`; + if (isWhiteSpace(ch) || ch === -1) { + info(`Lexer.getNumber - "${msg}".`); + return 0; + } + throw new FormatError(msg); + } + let baseValue = ch - 0x30; + let powerValue = 0; + let powerValueSign = 1; + while ((ch = this.nextChar()) >= 0) { + if (ch >= 0x30 && ch <= 0x39) { + const currentDigit = ch - 0x30; + if (eNotation) { + powerValue = powerValue * 10 + currentDigit; + } else { + if (divideBy !== 0) { + divideBy *= 10; + } + baseValue = baseValue * 10 + currentDigit; + } + } else if (ch === 0x2e) { + if (divideBy === 0) { + divideBy = 1; + } else { + break; + } + } else if (ch === 0x2d) { + warn("Badly formatted number: minus sign in the middle"); + } else if (ch === 0x45 || ch === 0x65) { + ch = this.peekChar(); + if (ch === 0x2b || ch === 0x2d) { + powerValueSign = ch === 0x2d ? -1 : 1; + this.nextChar(); + } else if (ch < 0x30 || ch > 0x39) { + break; + } + eNotation = true; + } else { + break; + } + } + if (divideBy !== 0) { + baseValue /= divideBy; + } + if (eNotation) { + baseValue *= 10 ** (powerValueSign * powerValue); + } + return sign * baseValue; + } + getString() { + let numParen = 1; + let done = false; + const strBuf = this.strBuf; + strBuf.length = 0; + let ch = this.nextChar(); + while (true) { + let charBuffered = false; + switch (ch | 0) { + case -1: + warn("Unterminated string"); + done = true; + break; + case 0x28: + ++numParen; + strBuf.push("("); + break; + case 0x29: + if (--numParen === 0) { + this.nextChar(); + done = true; + } else { + strBuf.push(")"); + } + break; + case 0x5c: + ch = this.nextChar(); + switch (ch) { + case -1: + warn("Unterminated string"); + done = true; + break; + case 0x6e: + strBuf.push("\n"); + break; + case 0x72: + strBuf.push("\r"); + break; + case 0x74: + strBuf.push("\t"); + break; + case 0x62: + strBuf.push("\b"); + break; + case 0x66: + strBuf.push("\f"); + break; + case 0x5c: + case 0x28: + case 0x29: + strBuf.push(String.fromCharCode(ch)); + break; + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + let x = ch & 0x0f; + ch = this.nextChar(); + charBuffered = true; + if (ch >= 0x30 && ch <= 0x37) { + x = (x << 3) + (ch & 0x0f); + ch = this.nextChar(); + if (ch >= 0x30 && ch <= 0x37) { + charBuffered = false; + x = (x << 3) + (ch & 0x0f); + } + } + strBuf.push(String.fromCharCode(x)); + break; + case 0x0d: + if (this.peekChar() === 0x0a) { + this.nextChar(); + } + break; + case 0x0a: + break; + default: + strBuf.push(String.fromCharCode(ch)); + break; + } + break; + default: + strBuf.push(String.fromCharCode(ch)); + break; + } + if (done) { + break; + } + if (!charBuffered) { + ch = this.nextChar(); + } + } + return strBuf.join(""); + } + getName() { + let ch, previousCh; + const strBuf = this.strBuf; + strBuf.length = 0; + while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { + if (ch === 0x23) { + ch = this.nextChar(); + if (specialChars[ch]) { + warn("Lexer_getName: " + "NUMBER SIGN (#) should be followed by a hexadecimal number."); + strBuf.push("#"); + break; + } + const x = toHexDigit(ch); + if (x !== -1) { + previousCh = ch; + ch = this.nextChar(); + const x2 = toHexDigit(ch); + if (x2 === -1) { + warn(`Lexer_getName: Illegal digit (${String.fromCharCode(ch)}) ` + "in hexadecimal number."); + strBuf.push("#", String.fromCharCode(previousCh)); + if (specialChars[ch]) { + break; + } + strBuf.push(String.fromCharCode(ch)); + continue; + } + strBuf.push(String.fromCharCode(x << 4 | x2)); + } else { + strBuf.push("#", String.fromCharCode(ch)); + } + } else { + strBuf.push(String.fromCharCode(ch)); + } + } + if (strBuf.length > 127) { + warn(`Name token is longer than allowed by the spec: ${strBuf.length}`); + } + return Name.get(strBuf.join("")); + } + _hexStringWarn(ch) { + const MAX_HEX_STRING_NUM_WARN = 5; + if (this._hexStringNumWarn++ === MAX_HEX_STRING_NUM_WARN) { + warn("getHexString - ignoring additional invalid characters."); + return; + } + if (this._hexStringNumWarn > MAX_HEX_STRING_NUM_WARN) { + return; + } + warn(`getHexString - ignoring invalid character: ${ch}`); + } + getHexString() { + const strBuf = this.strBuf; + strBuf.length = 0; + let ch = this.currentChar; + let isFirstHex = true; + let firstDigit, secondDigit; + this._hexStringNumWarn = 0; + while (true) { + if (ch < 0) { + warn("Unterminated hex string"); + break; + } else if (ch === 0x3e) { + this.nextChar(); + break; + } else if (specialChars[ch] === 1) { + ch = this.nextChar(); + continue; + } else { + if (isFirstHex) { + firstDigit = toHexDigit(ch); + if (firstDigit === -1) { + this._hexStringWarn(ch); + ch = this.nextChar(); + continue; + } + } else { + secondDigit = toHexDigit(ch); + if (secondDigit === -1) { + this._hexStringWarn(ch); + ch = this.nextChar(); + continue; + } + strBuf.push(String.fromCharCode(firstDigit << 4 | secondDigit)); + } + isFirstHex = !isFirstHex; + ch = this.nextChar(); + } + } + return strBuf.join(""); + } + getObj() { + let comment = false; + let ch = this.currentChar; + while (true) { + if (ch < 0) { + return EOF; + } + if (comment) { + if (ch === 0x0a || ch === 0x0d) { + comment = false; + } + } else if (ch === 0x25) { + comment = true; + } else if (specialChars[ch] !== 1) { + break; + } + ch = this.nextChar(); + } + switch (ch | 0) { + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + case 0x38: + case 0x39: + case 0x2b: + case 0x2d: + case 0x2e: + return this.getNumber(); + case 0x28: + return this.getString(); + case 0x2f: + return this.getName(); + case 0x5b: + this.nextChar(); + return Cmd.get("["); + case 0x5d: + this.nextChar(); + return Cmd.get("]"); + case 0x3c: + ch = this.nextChar(); + if (ch === 0x3c) { + this.nextChar(); + return Cmd.get("<<"); + } + return this.getHexString(); + case 0x3e: + ch = this.nextChar(); + if (ch === 0x3e) { + this.nextChar(); + return Cmd.get(">>"); + } + return Cmd.get(">"); + case 0x7b: + this.nextChar(); + return Cmd.get("{"); + case 0x7d: + this.nextChar(); + return Cmd.get("}"); + case 0x29: + this.nextChar(); + throw new FormatError(`Illegal character: ${ch}`); + } + let str = String.fromCharCode(ch); + if (ch < 0x20 || ch > 0x7f) { + const nextCh = this.peekChar(); + if (nextCh >= 0x20 && nextCh <= 0x7f) { + this.nextChar(); + return Cmd.get(str); + } + } + const knownCommands = this.knownCommands; + let knownCommandFound = knownCommands?.[str] !== undefined; + while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) { + const possibleCommand = str + String.fromCharCode(ch); + if (knownCommandFound && knownCommands[possibleCommand] === undefined) { + break; + } + if (str.length === 128) { + throw new FormatError(`Command token too long: ${str.length}`); + } + str = possibleCommand; + knownCommandFound = knownCommands?.[str] !== undefined; + } + if (str === "true") { + return true; + } + if (str === "false") { + return false; + } + if (str === "null") { + return null; + } + if (str === "BI") { + this.beginInlineImagePos = this.stream.pos; + } + return Cmd.get(str); + } + skipToNextLine() { + let ch = this.currentChar; + while (ch >= 0) { + if (ch === 0x0d) { + ch = this.nextChar(); + if (ch === 0x0a) { + this.nextChar(); + } + break; + } else if (ch === 0x0a) { + this.nextChar(); + break; + } + ch = this.nextChar(); + } + } +} +class Linearization { + static create(stream) { + function getInt(linDict, name, allowZeroValue = false) { + const obj = linDict.get(name); + if (Number.isInteger(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) { + return obj; + } + throw new Error(`The "${name}" parameter in the linearization ` + "dictionary is invalid."); + } + function getHints(linDict) { + const hints = linDict.get("H"); + let hintsLength; + if (Array.isArray(hints) && ((hintsLength = hints.length) === 2 || hintsLength === 4)) { + for (let index = 0; index < hintsLength; index++) { + const hint = hints[index]; + if (!(Number.isInteger(hint) && hint > 0)) { + throw new Error(`Hint (${index}) in the linearization dictionary is invalid.`); + } + } + return hints; + } + throw new Error("Hint array in the linearization dictionary is invalid."); + } + const parser = new Parser({ + lexer: new Lexer(stream), + xref: null + }); + const obj1 = parser.getObj(); + const obj2 = parser.getObj(); + const obj3 = parser.getObj(); + const linDict = parser.getObj(); + let obj, length; + if (!(Number.isInteger(obj1) && Number.isInteger(obj2) && isCmd(obj3, "obj") && linDict instanceof Dict && typeof (obj = linDict.get("Linearized")) === "number" && obj > 0)) { + return null; + } else if ((length = getInt(linDict, "L")) !== stream.length) { + throw new Error('The "L" parameter in the linearization dictionary ' + "does not equal the stream length."); + } + return { + length, + hints: getHints(linDict), + objectNumberFirst: getInt(linDict, "O"), + endFirst: getInt(linDict, "E"), + numPages: getInt(linDict, "N"), + mainXRefEntriesOffset: getInt(linDict, "T"), + pageFirst: linDict.has("P") ? getInt(linDict, "P", true) : 0 + }; + } +} + +;// CONCATENATED MODULE: ./src/core/cmap.js + + + + + + + +const BUILT_IN_CMAPS = ["Adobe-GB1-UCS2", "Adobe-CNS1-UCS2", "Adobe-Japan1-UCS2", "Adobe-Korea1-UCS2", "78-EUC-H", "78-EUC-V", "78-H", "78-RKSJ-H", "78-RKSJ-V", "78-V", "78ms-RKSJ-H", "78ms-RKSJ-V", "83pv-RKSJ-H", "90ms-RKSJ-H", "90ms-RKSJ-V", "90msp-RKSJ-H", "90msp-RKSJ-V", "90pv-RKSJ-H", "90pv-RKSJ-V", "Add-H", "Add-RKSJ-H", "Add-RKSJ-V", "Add-V", "Adobe-CNS1-0", "Adobe-CNS1-1", "Adobe-CNS1-2", "Adobe-CNS1-3", "Adobe-CNS1-4", "Adobe-CNS1-5", "Adobe-CNS1-6", "Adobe-GB1-0", "Adobe-GB1-1", "Adobe-GB1-2", "Adobe-GB1-3", "Adobe-GB1-4", "Adobe-GB1-5", "Adobe-Japan1-0", "Adobe-Japan1-1", "Adobe-Japan1-2", "Adobe-Japan1-3", "Adobe-Japan1-4", "Adobe-Japan1-5", "Adobe-Japan1-6", "Adobe-Korea1-0", "Adobe-Korea1-1", "Adobe-Korea1-2", "B5-H", "B5-V", "B5pc-H", "B5pc-V", "CNS-EUC-H", "CNS-EUC-V", "CNS1-H", "CNS1-V", "CNS2-H", "CNS2-V", "ETHK-B5-H", "ETHK-B5-V", "ETen-B5-H", "ETen-B5-V", "ETenms-B5-H", "ETenms-B5-V", "EUC-H", "EUC-V", "Ext-H", "Ext-RKSJ-H", "Ext-RKSJ-V", "Ext-V", "GB-EUC-H", "GB-EUC-V", "GB-H", "GB-V", "GBK-EUC-H", "GBK-EUC-V", "GBK2K-H", "GBK2K-V", "GBKp-EUC-H", "GBKp-EUC-V", "GBT-EUC-H", "GBT-EUC-V", "GBT-H", "GBT-V", "GBTpc-EUC-H", "GBTpc-EUC-V", "GBpc-EUC-H", "GBpc-EUC-V", "H", "HKdla-B5-H", "HKdla-B5-V", "HKdlb-B5-H", "HKdlb-B5-V", "HKgccs-B5-H", "HKgccs-B5-V", "HKm314-B5-H", "HKm314-B5-V", "HKm471-B5-H", "HKm471-B5-V", "HKscs-B5-H", "HKscs-B5-V", "Hankaku", "Hiragana", "KSC-EUC-H", "KSC-EUC-V", "KSC-H", "KSC-Johab-H", "KSC-Johab-V", "KSC-V", "KSCms-UHC-H", "KSCms-UHC-HW-H", "KSCms-UHC-HW-V", "KSCms-UHC-V", "KSCpc-EUC-H", "KSCpc-EUC-V", "Katakana", "NWP-H", "NWP-V", "RKSJ-H", "RKSJ-V", "Roman", "UniCNS-UCS2-H", "UniCNS-UCS2-V", "UniCNS-UTF16-H", "UniCNS-UTF16-V", "UniCNS-UTF32-H", "UniCNS-UTF32-V", "UniCNS-UTF8-H", "UniCNS-UTF8-V", "UniGB-UCS2-H", "UniGB-UCS2-V", "UniGB-UTF16-H", "UniGB-UTF16-V", "UniGB-UTF32-H", "UniGB-UTF32-V", "UniGB-UTF8-H", "UniGB-UTF8-V", "UniJIS-UCS2-H", "UniJIS-UCS2-HW-H", "UniJIS-UCS2-HW-V", "UniJIS-UCS2-V", "UniJIS-UTF16-H", "UniJIS-UTF16-V", "UniJIS-UTF32-H", "UniJIS-UTF32-V", "UniJIS-UTF8-H", "UniJIS-UTF8-V", "UniJIS2004-UTF16-H", "UniJIS2004-UTF16-V", "UniJIS2004-UTF32-H", "UniJIS2004-UTF32-V", "UniJIS2004-UTF8-H", "UniJIS2004-UTF8-V", "UniJISPro-UCS2-HW-V", "UniJISPro-UCS2-V", "UniJISPro-UTF8-V", "UniJISX0213-UTF32-H", "UniJISX0213-UTF32-V", "UniJISX02132004-UTF32-H", "UniJISX02132004-UTF32-V", "UniKS-UCS2-H", "UniKS-UCS2-V", "UniKS-UTF16-H", "UniKS-UTF16-V", "UniKS-UTF32-H", "UniKS-UTF32-V", "UniKS-UTF8-H", "UniKS-UTF8-V", "V", "WP-Symbol"]; +const MAX_MAP_RANGE = 2 ** 24 - 1; +class CMap { + constructor(builtInCMap = false) { + this.codespaceRanges = [[], [], [], []]; + this.numCodespaceRanges = 0; + this._map = []; + this.name = ""; + this.vertical = false; + this.useCMap = null; + this.builtInCMap = builtInCMap; + } + addCodespaceRange(n, low, high) { + this.codespaceRanges[n - 1].push(low, high); + this.numCodespaceRanges++; + } + mapCidRange(low, high, dstLow) { + if (high - low > MAX_MAP_RANGE) { + throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE."); + } + while (low <= high) { + this._map[low++] = dstLow++; + } + } + mapBfRange(low, high, dstLow) { + if (high - low > MAX_MAP_RANGE) { + throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE."); + } + const lastByte = dstLow.length - 1; + while (low <= high) { + this._map[low++] = dstLow; + const nextCharCode = dstLow.charCodeAt(lastByte) + 1; + if (nextCharCode > 0xff) { + dstLow = dstLow.substring(0, lastByte - 1) + String.fromCharCode(dstLow.charCodeAt(lastByte - 1) + 1) + "\x00"; + continue; + } + dstLow = dstLow.substring(0, lastByte) + String.fromCharCode(nextCharCode); + } + } + mapBfRangeToArray(low, high, array) { + if (high - low > MAX_MAP_RANGE) { + throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE."); + } + const ii = array.length; + let i = 0; + while (low <= high && i < ii) { + this._map[low] = array[i++]; + ++low; + } + } + mapOne(src, dst) { + this._map[src] = dst; + } + lookup(code) { + return this._map[code]; + } + contains(code) { + return this._map[code] !== undefined; + } + forEach(callback) { + const map = this._map; + const length = map.length; + if (length <= 0x10000) { + for (let i = 0; i < length; i++) { + if (map[i] !== undefined) { + callback(i, map[i]); + } + } + } else { + for (const i in map) { + callback(i, map[i]); + } + } + } + charCodeOf(value) { + const map = this._map; + if (map.length <= 0x10000) { + return map.indexOf(value); + } + for (const charCode in map) { + if (map[charCode] === value) { + return charCode | 0; + } + } + return -1; + } + getMap() { + return this._map; + } + readCharCode(str, offset, out) { + let c = 0; + const codespaceRanges = this.codespaceRanges; + for (let n = 0, nn = codespaceRanges.length; n < nn; n++) { + c = (c << 8 | str.charCodeAt(offset + n)) >>> 0; + const codespaceRange = codespaceRanges[n]; + for (let k = 0, kk = codespaceRange.length; k < kk;) { + const low = codespaceRange[k++]; + const high = codespaceRange[k++]; + if (c >= low && c <= high) { + out.charcode = c; + out.length = n + 1; + return; + } + } + } + out.charcode = 0; + out.length = 1; + } + getCharCodeLength(charCode) { + const codespaceRanges = this.codespaceRanges; + for (let n = 0, nn = codespaceRanges.length; n < nn; n++) { + const codespaceRange = codespaceRanges[n]; + for (let k = 0, kk = codespaceRange.length; k < kk;) { + const low = codespaceRange[k++]; + const high = codespaceRange[k++]; + if (charCode >= low && charCode <= high) { + return n + 1; + } + } + } + return 1; + } + get length() { + return this._map.length; + } + get isIdentityCMap() { + if (!(this.name === "Identity-H" || this.name === "Identity-V")) { + return false; + } + if (this._map.length !== 0x10000) { + return false; + } + for (let i = 0; i < 0x10000; i++) { + if (this._map[i] !== i) { + return false; + } + } + return true; + } +} +class IdentityCMap extends CMap { + constructor(vertical, n) { + super(); + this.vertical = vertical; + this.addCodespaceRange(n, 0, 0xffff); + } + mapCidRange(low, high, dstLow) { + unreachable("should not call mapCidRange"); + } + mapBfRange(low, high, dstLow) { + unreachable("should not call mapBfRange"); + } + mapBfRangeToArray(low, high, array) { + unreachable("should not call mapBfRangeToArray"); + } + mapOne(src, dst) { + unreachable("should not call mapCidOne"); + } + lookup(code) { + return Number.isInteger(code) && code <= 0xffff ? code : undefined; + } + contains(code) { + return Number.isInteger(code) && code <= 0xffff; + } + forEach(callback) { + for (let i = 0; i <= 0xffff; i++) { + callback(i, i); + } + } + charCodeOf(value) { + return Number.isInteger(value) && value <= 0xffff ? value : -1; + } + getMap() { + const map = new Array(0x10000); + for (let i = 0; i <= 0xffff; i++) { + map[i] = i; + } + return map; + } + get length() { + return 0x10000; + } + get isIdentityCMap() { + unreachable("should not access .isIdentityCMap"); + } +} +function strToInt(str) { + let a = 0; + for (let i = 0; i < str.length; i++) { + a = a << 8 | str.charCodeAt(i); + } + return a >>> 0; +} +function expectString(obj) { + if (typeof obj !== "string") { + throw new FormatError("Malformed CMap: expected string."); + } +} +function expectInt(obj) { + if (!Number.isInteger(obj)) { + throw new FormatError("Malformed CMap: expected int."); + } +} +function parseBfChar(cMap, lexer) { + while (true) { + let obj = lexer.getObj(); + if (obj === EOF) { + break; + } + if (isCmd(obj, "endbfchar")) { + return; + } + expectString(obj); + const src = strToInt(obj); + obj = lexer.getObj(); + expectString(obj); + const dst = obj; + cMap.mapOne(src, dst); + } +} +function parseBfRange(cMap, lexer) { + while (true) { + let obj = lexer.getObj(); + if (obj === EOF) { + break; + } + if (isCmd(obj, "endbfrange")) { + return; + } + expectString(obj); + const low = strToInt(obj); + obj = lexer.getObj(); + expectString(obj); + const high = strToInt(obj); + obj = lexer.getObj(); + if (Number.isInteger(obj) || typeof obj === "string") { + const dstLow = Number.isInteger(obj) ? String.fromCharCode(obj) : obj; + cMap.mapBfRange(low, high, dstLow); + } else if (isCmd(obj, "[")) { + obj = lexer.getObj(); + const array = []; + while (!isCmd(obj, "]") && obj !== EOF) { + array.push(obj); + obj = lexer.getObj(); + } + cMap.mapBfRangeToArray(low, high, array); + } else { + break; + } + } + throw new FormatError("Invalid bf range."); +} +function parseCidChar(cMap, lexer) { + while (true) { + let obj = lexer.getObj(); + if (obj === EOF) { + break; + } + if (isCmd(obj, "endcidchar")) { + return; + } + expectString(obj); + const src = strToInt(obj); + obj = lexer.getObj(); + expectInt(obj); + const dst = obj; + cMap.mapOne(src, dst); + } +} +function parseCidRange(cMap, lexer) { + while (true) { + let obj = lexer.getObj(); + if (obj === EOF) { + break; + } + if (isCmd(obj, "endcidrange")) { + return; + } + expectString(obj); + const low = strToInt(obj); + obj = lexer.getObj(); + expectString(obj); + const high = strToInt(obj); + obj = lexer.getObj(); + expectInt(obj); + const dstLow = obj; + cMap.mapCidRange(low, high, dstLow); + } +} +function parseCodespaceRange(cMap, lexer) { + while (true) { + let obj = lexer.getObj(); + if (obj === EOF) { + break; + } + if (isCmd(obj, "endcodespacerange")) { + return; + } + if (typeof obj !== "string") { + break; + } + const low = strToInt(obj); + obj = lexer.getObj(); + if (typeof obj !== "string") { + break; + } + const high = strToInt(obj); + cMap.addCodespaceRange(obj.length, low, high); + } + throw new FormatError("Invalid codespace range."); +} +function parseWMode(cMap, lexer) { + const obj = lexer.getObj(); + if (Number.isInteger(obj)) { + cMap.vertical = !!obj; + } +} +function parseCMapName(cMap, lexer) { + const obj = lexer.getObj(); + if (obj instanceof Name) { + cMap.name = obj.name; + } +} +async function parseCMap(cMap, lexer, fetchBuiltInCMap, useCMap) { + let previous, embeddedUseCMap; + objLoop: while (true) { + try { + const obj = lexer.getObj(); + if (obj === EOF) { + break; + } else if (obj instanceof Name) { + if (obj.name === "WMode") { + parseWMode(cMap, lexer); + } else if (obj.name === "CMapName") { + parseCMapName(cMap, lexer); + } + previous = obj; + } else if (obj instanceof Cmd) { + switch (obj.cmd) { + case "endcmap": + break objLoop; + case "usecmap": + if (previous instanceof Name) { + embeddedUseCMap = previous.name; + } + break; + case "begincodespacerange": + parseCodespaceRange(cMap, lexer); + break; + case "beginbfchar": + parseBfChar(cMap, lexer); + break; + case "begincidchar": + parseCidChar(cMap, lexer); + break; + case "beginbfrange": + parseBfRange(cMap, lexer); + break; + case "begincidrange": + parseCidRange(cMap, lexer); + break; + } + } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn("Invalid cMap data: " + ex); + continue; + } + } + if (!useCMap && embeddedUseCMap) { + useCMap = embeddedUseCMap; + } + if (useCMap) { + return extendCMap(cMap, fetchBuiltInCMap, useCMap); + } + return cMap; +} +async function extendCMap(cMap, fetchBuiltInCMap, useCMap) { + cMap.useCMap = await createBuiltInCMap(useCMap, fetchBuiltInCMap); + if (cMap.numCodespaceRanges === 0) { + const useCodespaceRanges = cMap.useCMap.codespaceRanges; + for (let i = 0; i < useCodespaceRanges.length; i++) { + cMap.codespaceRanges[i] = useCodespaceRanges[i].slice(); + } + cMap.numCodespaceRanges = cMap.useCMap.numCodespaceRanges; + } + cMap.useCMap.forEach(function (key, value) { + if (!cMap.contains(key)) { + cMap.mapOne(key, cMap.useCMap.lookup(key)); + } + }); + return cMap; +} +async function createBuiltInCMap(name, fetchBuiltInCMap) { + if (name === "Identity-H") { + return new IdentityCMap(false, 2); + } else if (name === "Identity-V") { + return new IdentityCMap(true, 2); + } + if (!BUILT_IN_CMAPS.includes(name)) { + throw new Error("Unknown CMap name: " + name); + } + if (!fetchBuiltInCMap) { + throw new Error("Built-in CMap parameters are not provided."); + } + const { + cMapData, + compressionType + } = await fetchBuiltInCMap(name); + const cMap = new CMap(true); + if (compressionType === CMapCompressionType.BINARY) { + return new BinaryCMapReader().process(cMapData, cMap, useCMap => { + return extendCMap(cMap, fetchBuiltInCMap, useCMap); + }); + } + if (compressionType === CMapCompressionType.NONE) { + const lexer = new Lexer(new Stream(cMapData)); + return parseCMap(cMap, lexer, fetchBuiltInCMap, null); + } + throw new Error(`Invalid CMap "compressionType" value: ${compressionType}`); +} +class CMapFactory { + static async create({ + encoding, + fetchBuiltInCMap, + useCMap + }) { + if (encoding instanceof Name) { + return createBuiltInCMap(encoding.name, fetchBuiltInCMap); + } else if (encoding instanceof BaseStream) { + const parsedCMap = await parseCMap(new CMap(), new Lexer(encoding), fetchBuiltInCMap, useCMap); + if (parsedCMap.isIdentityCMap) { + return createBuiltInCMap(parsedCMap.name, fetchBuiltInCMap); + } + return parsedCMap; + } + throw new Error("Encoding required."); + } +} + +;// CONCATENATED MODULE: ./src/core/charsets.js +const ISOAdobeCharset = [".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "endash", "dagger", "daggerdbl", "periodcentered", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "emdash", "AE", "ordfeminine", "Lslash", "Oslash", "OE", "ordmasculine", "ae", "dotlessi", "lslash", "oslash", "oe", "germandbls", "onesuperior", "logicalnot", "mu", "trademark", "Eth", "onehalf", "plusminus", "Thorn", "onequarter", "divide", "brokenbar", "degree", "thorn", "threequarters", "twosuperior", "registered", "minus", "eth", "multiply", "threesuperior", "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", "aacute", "acircumflex", "adieresis", "agrave", "aring", "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", "egrave", "iacute", "icircumflex", "idieresis", "igrave", "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", "otilde", "scaron", "uacute", "ucircumflex", "udieresis", "ugrave", "yacute", "ydieresis", "zcaron"]; +const ExpertCharset = [".notdef", "space", "exclamsmall", "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", "onequarter", "onehalf", "threequarters", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall"]; +const ExpertSubsetCharset = [".notdef", "space", "dollaroldstyle", "dollarsuperior", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "commasuperior", "threequartersemdash", "periodsuperior", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "hyphensuperior", "colonmonetary", "onefitted", "rupiah", "centoldstyle", "figuredash", "hypheninferior", "onequarter", "onehalf", "threequarters", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior"]; + +;// CONCATENATED MODULE: ./src/core/encodings.js +const ExpertEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclamsmall", "Hungarumlautsmall", "", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "", "", "", "isuperior", "", "", "lsuperior", "msuperior", "nsuperior", "osuperior", "", "", "rsuperior", "ssuperior", "tsuperior", "", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "exclamdownsmall", "centoldstyle", "Lslashsmall", "", "", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "", "Dotaccentsmall", "", "", "Macronsmall", "", "", "figuredash", "hypheninferior", "", "", "Ogoneksmall", "Ringsmall", "Cedillasmall", "", "", "", "onequarter", "onehalf", "threequarters", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "", "", "zerosuperior", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall"]; +const MacExpertEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclamsmall", "Hungarumlautsmall", "centoldstyle", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "", "threequartersemdash", "", "questionsmall", "", "", "", "", "Ethsmall", "", "", "onequarter", "onehalf", "threequarters", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "", "", "", "", "", "", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "", "parenrightinferior", "Circumflexsmall", "hypheninferior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "", "", "asuperior", "centsuperior", "", "", "", "", "Aacutesmall", "Agravesmall", "Acircumflexsmall", "Adieresissmall", "Atildesmall", "Aringsmall", "Ccedillasmall", "Eacutesmall", "Egravesmall", "Ecircumflexsmall", "Edieresissmall", "Iacutesmall", "Igravesmall", "Icircumflexsmall", "Idieresissmall", "Ntildesmall", "Oacutesmall", "Ogravesmall", "Ocircumflexsmall", "Odieresissmall", "Otildesmall", "Uacutesmall", "Ugravesmall", "Ucircumflexsmall", "Udieresissmall", "", "eightsuperior", "fourinferior", "threeinferior", "sixinferior", "eightinferior", "seveninferior", "Scaronsmall", "", "centinferior", "twoinferior", "", "Dieresissmall", "", "Caronsmall", "osuperior", "fiveinferior", "", "commainferior", "periodinferior", "Yacutesmall", "", "dollarinferior", "", "", "Thornsmall", "", "nineinferior", "zeroinferior", "Zcaronsmall", "AEsmall", "Oslashsmall", "questiondownsmall", "oneinferior", "Lslashsmall", "", "", "", "", "", "", "Cedillasmall", "", "", "", "", "", "OEsmall", "figuredash", "hyphensuperior", "", "", "", "", "exclamdownsmall", "", "Ydieresissmall", "", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "ninesuperior", "zerosuperior", "", "esuperior", "rsuperior", "tsuperior", "", "", "isuperior", "ssuperior", "dsuperior", "", "", "", "", "", "lsuperior", "Ogoneksmall", "Brevesmall", "Macronsmall", "bsuperior", "nsuperior", "msuperior", "commasuperior", "periodsuperior", "Dotaccentsmall", "Ringsmall", "", "", "", ""]; +const MacRomanEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "", "Adieresis", "Aring", "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", "aacute", "agrave", "acircumflex", "adieresis", "atilde", "aring", "ccedilla", "eacute", "egrave", "ecircumflex", "edieresis", "iacute", "igrave", "icircumflex", "idieresis", "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", "otilde", "uacute", "ugrave", "ucircumflex", "udieresis", "dagger", "degree", "cent", "sterling", "section", "bullet", "paragraph", "germandbls", "registered", "copyright", "trademark", "acute", "dieresis", "notequal", "AE", "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", "yen", "mu", "partialdiff", "summation", "product", "pi", "integral", "ordfeminine", "ordmasculine", "Omega", "ae", "oslash", "questiondown", "exclamdown", "logicalnot", "radical", "florin", "approxequal", "Delta", "guillemotleft", "guillemotright", "ellipsis", "space", "Agrave", "Atilde", "Otilde", "OE", "oe", "endash", "emdash", "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", "lozenge", "ydieresis", "Ydieresis", "fraction", "currency", "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex", "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", "dotlessi", "circumflex", "tilde", "macron", "breve", "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", "caron"]; +const StandardEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "", "endash", "dagger", "daggerdbl", "periodcentered", "", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "", "questiondown", "", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "", "ring", "cedilla", "", "hungarumlaut", "ogonek", "caron", "emdash", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "AE", "", "ordfeminine", "", "", "", "", "Lslash", "Oslash", "OE", "ordmasculine", "", "", "", "", "", "ae", "", "", "", "dotlessi", "", "", "lslash", "oslash", "oe", "germandbls", "", "", "", ""]; +const WinAnsiEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "bullet", "Euro", "bullet", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", "bullet", "Zcaron", "bullet", "bullet", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", "bullet", "zcaron", "Ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis"]; +const SymbolSetEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "universal", "numbersign", "existential", "percent", "ampersand", "suchthat", "parenleft", "parenright", "asteriskmath", "plus", "comma", "minus", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "congruent", "Alpha", "Beta", "Chi", "Delta", "Epsilon", "Phi", "Gamma", "Eta", "Iota", "theta1", "Kappa", "Lambda", "Mu", "Nu", "Omicron", "Pi", "Theta", "Rho", "Sigma", "Tau", "Upsilon", "sigma1", "Omega", "Xi", "Psi", "Zeta", "bracketleft", "therefore", "bracketright", "perpendicular", "underscore", "radicalex", "alpha", "beta", "chi", "delta", "epsilon", "phi", "gamma", "eta", "iota", "phi1", "kappa", "lambda", "mu", "nu", "omicron", "pi", "theta", "rho", "sigma", "tau", "upsilon", "omega1", "omega", "xi", "psi", "zeta", "braceleft", "bar", "braceright", "similar", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Euro", "Upsilon1", "minute", "lessequal", "fraction", "infinity", "florin", "club", "diamond", "heart", "spade", "arrowboth", "arrowleft", "arrowup", "arrowright", "arrowdown", "degree", "plusminus", "second", "greaterequal", "multiply", "proportional", "partialdiff", "bullet", "divide", "notequal", "equivalence", "approxequal", "ellipsis", "arrowvertex", "arrowhorizex", "carriagereturn", "aleph", "Ifraktur", "Rfraktur", "weierstrass", "circlemultiply", "circleplus", "emptyset", "intersection", "union", "propersuperset", "reflexsuperset", "notsubset", "propersubset", "reflexsubset", "element", "notelement", "angle", "gradient", "registerserif", "copyrightserif", "trademarkserif", "product", "radical", "dotmath", "logicalnot", "logicaland", "logicalor", "arrowdblboth", "arrowdblleft", "arrowdblup", "arrowdblright", "arrowdbldown", "lozenge", "angleleft", "registersans", "copyrightsans", "trademarksans", "summation", "parenlefttp", "parenleftex", "parenleftbt", "bracketlefttp", "bracketleftex", "bracketleftbt", "bracelefttp", "braceleftmid", "braceleftbt", "braceex", "", "angleright", "integral", "integraltp", "integralex", "integralbt", "parenrighttp", "parenrightex", "parenrightbt", "bracketrighttp", "bracketrightex", "bracketrightbt", "bracerighttp", "bracerightmid", "bracerightbt", ""]; +const ZapfDingbatsEncoding = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "a1", "a2", "a202", "a3", "a4", "a5", "a119", "a118", "a117", "a11", "a12", "a13", "a14", "a15", "a16", "a105", "a17", "a18", "a19", "a20", "a21", "a22", "a23", "a24", "a25", "a26", "a27", "a28", "a6", "a7", "a8", "a9", "a10", "a29", "a30", "a31", "a32", "a33", "a34", "a35", "a36", "a37", "a38", "a39", "a40", "a41", "a42", "a43", "a44", "a45", "a46", "a47", "a48", "a49", "a50", "a51", "a52", "a53", "a54", "a55", "a56", "a57", "a58", "a59", "a60", "a61", "a62", "a63", "a64", "a65", "a66", "a67", "a68", "a69", "a70", "a71", "a72", "a73", "a74", "a203", "a75", "a204", "a76", "a77", "a78", "a79", "a81", "a82", "a83", "a84", "a97", "a98", "a99", "a100", "", "a89", "a90", "a93", "a94", "a91", "a92", "a205", "a85", "a206", "a86", "a87", "a88", "a95", "a96", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "a101", "a102", "a103", "a104", "a106", "a107", "a108", "a112", "a111", "a110", "a109", "a120", "a121", "a122", "a123", "a124", "a125", "a126", "a127", "a128", "a129", "a130", "a131", "a132", "a133", "a134", "a135", "a136", "a137", "a138", "a139", "a140", "a141", "a142", "a143", "a144", "a145", "a146", "a147", "a148", "a149", "a150", "a151", "a152", "a153", "a154", "a155", "a156", "a157", "a158", "a159", "a160", "a161", "a163", "a164", "a196", "a165", "a192", "a166", "a167", "a168", "a169", "a170", "a171", "a172", "a173", "a162", "a174", "a175", "a176", "a177", "a178", "a179", "a193", "a180", "a199", "a181", "a200", "a182", "", "a201", "a183", "a184", "a197", "a185", "a194", "a198", "a186", "a195", "a187", "a188", "a189", "a190", "a191", ""]; +function getEncoding(encodingName) { + switch (encodingName) { + case "WinAnsiEncoding": + return WinAnsiEncoding; + case "StandardEncoding": + return StandardEncoding; + case "MacRomanEncoding": + return MacRomanEncoding; + case "SymbolSetEncoding": + return SymbolSetEncoding; + case "ZapfDingbatsEncoding": + return ZapfDingbatsEncoding; + case "ExpertEncoding": + return ExpertEncoding; + case "MacExpertEncoding": + return MacExpertEncoding; + default: + return null; + } +} + +;// CONCATENATED MODULE: ./src/core/cff_parser.js + + + +const MAX_SUBR_NESTING = 10; +const CFFStandardStrings = [".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "endash", "dagger", "daggerdbl", "periodcentered", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "emdash", "AE", "ordfeminine", "Lslash", "Oslash", "OE", "ordmasculine", "ae", "dotlessi", "lslash", "oslash", "oe", "germandbls", "onesuperior", "logicalnot", "mu", "trademark", "Eth", "onehalf", "plusminus", "Thorn", "onequarter", "divide", "brokenbar", "degree", "thorn", "threequarters", "twosuperior", "registered", "minus", "eth", "multiply", "threesuperior", "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", "aacute", "acircumflex", "adieresis", "agrave", "aring", "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", "egrave", "iacute", "icircumflex", "idieresis", "igrave", "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", "otilde", "scaron", "uacute", "ucircumflex", "udieresis", "ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall", "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall", "001.000", "001.001", "001.002", "001.003", "Black", "Bold", "Book", "Light", "Medium", "Regular", "Roman", "Semibold"]; +const NUM_STANDARD_CFF_STRINGS = 391; +const CharstringValidationData = [null, { + id: "hstem", + min: 2, + stackClearing: true, + stem: true +}, null, { + id: "vstem", + min: 2, + stackClearing: true, + stem: true +}, { + id: "vmoveto", + min: 1, + stackClearing: true +}, { + id: "rlineto", + min: 2, + resetStack: true +}, { + id: "hlineto", + min: 1, + resetStack: true +}, { + id: "vlineto", + min: 1, + resetStack: true +}, { + id: "rrcurveto", + min: 6, + resetStack: true +}, null, { + id: "callsubr", + min: 1, + undefStack: true +}, { + id: "return", + min: 0, + undefStack: true +}, null, null, { + id: "endchar", + min: 0, + stackClearing: true +}, null, null, null, { + id: "hstemhm", + min: 2, + stackClearing: true, + stem: true +}, { + id: "hintmask", + min: 0, + stackClearing: true +}, { + id: "cntrmask", + min: 0, + stackClearing: true +}, { + id: "rmoveto", + min: 2, + stackClearing: true +}, { + id: "hmoveto", + min: 1, + stackClearing: true +}, { + id: "vstemhm", + min: 2, + stackClearing: true, + stem: true +}, { + id: "rcurveline", + min: 8, + resetStack: true +}, { + id: "rlinecurve", + min: 8, + resetStack: true +}, { + id: "vvcurveto", + min: 4, + resetStack: true +}, { + id: "hhcurveto", + min: 4, + resetStack: true +}, null, { + id: "callgsubr", + min: 1, + undefStack: true +}, { + id: "vhcurveto", + min: 4, + resetStack: true +}, { + id: "hvcurveto", + min: 4, + resetStack: true +}]; +const CharstringValidationData12 = [null, null, null, { + id: "and", + min: 2, + stackDelta: -1 +}, { + id: "or", + min: 2, + stackDelta: -1 +}, { + id: "not", + min: 1, + stackDelta: 0 +}, null, null, null, { + id: "abs", + min: 1, + stackDelta: 0 +}, { + id: "add", + min: 2, + stackDelta: -1, + stackFn(stack, index) { + stack[index - 2] = stack[index - 2] + stack[index - 1]; + } +}, { + id: "sub", + min: 2, + stackDelta: -1, + stackFn(stack, index) { + stack[index - 2] = stack[index - 2] - stack[index - 1]; + } +}, { + id: "div", + min: 2, + stackDelta: -1, + stackFn(stack, index) { + stack[index - 2] = stack[index - 2] / stack[index - 1]; + } +}, null, { + id: "neg", + min: 1, + stackDelta: 0, + stackFn(stack, index) { + stack[index - 1] = -stack[index - 1]; + } +}, { + id: "eq", + min: 2, + stackDelta: -1 +}, null, null, { + id: "drop", + min: 1, + stackDelta: -1 +}, null, { + id: "put", + min: 2, + stackDelta: -2 +}, { + id: "get", + min: 1, + stackDelta: 0 +}, { + id: "ifelse", + min: 4, + stackDelta: -3 +}, { + id: "random", + min: 0, + stackDelta: 1 +}, { + id: "mul", + min: 2, + stackDelta: -1, + stackFn(stack, index) { + stack[index - 2] = stack[index - 2] * stack[index - 1]; + } +}, null, { + id: "sqrt", + min: 1, + stackDelta: 0 +}, { + id: "dup", + min: 1, + stackDelta: 1 +}, { + id: "exch", + min: 2, + stackDelta: 0 +}, { + id: "index", + min: 2, + stackDelta: 0 +}, { + id: "roll", + min: 3, + stackDelta: -2 +}, null, null, null, { + id: "hflex", + min: 7, + resetStack: true +}, { + id: "flex", + min: 13, + resetStack: true +}, { + id: "hflex1", + min: 9, + resetStack: true +}, { + id: "flex1", + min: 11, + resetStack: true +}]; +class CFFParser { + constructor(file, properties, seacAnalysisEnabled) { + this.bytes = file.getBytes(); + this.properties = properties; + this.seacAnalysisEnabled = !!seacAnalysisEnabled; + } + parse() { + const properties = this.properties; + const cff = new CFF(); + this.cff = cff; + const header = this.parseHeader(); + const nameIndex = this.parseIndex(header.endPos); + const topDictIndex = this.parseIndex(nameIndex.endPos); + const stringIndex = this.parseIndex(topDictIndex.endPos); + const globalSubrIndex = this.parseIndex(stringIndex.endPos); + const topDictParsed = this.parseDict(topDictIndex.obj.get(0)); + const topDict = this.createDict(CFFTopDict, topDictParsed, cff.strings); + cff.header = header.obj; + cff.names = this.parseNameIndex(nameIndex.obj); + cff.strings = this.parseStringIndex(stringIndex.obj); + cff.topDict = topDict; + cff.globalSubrIndex = globalSubrIndex.obj; + this.parsePrivateDict(cff.topDict); + cff.isCIDFont = topDict.hasName("ROS"); + const charStringOffset = topDict.getByName("CharStrings"); + const charStringIndex = this.parseIndex(charStringOffset).obj; + const fontMatrix = topDict.getByName("FontMatrix"); + if (fontMatrix) { + properties.fontMatrix = fontMatrix; + } + const fontBBox = topDict.getByName("FontBBox"); + if (fontBBox) { + properties.ascent = Math.max(fontBBox[3], fontBBox[1]); + properties.descent = Math.min(fontBBox[1], fontBBox[3]); + properties.ascentScaled = true; + } + let charset, encoding; + if (cff.isCIDFont) { + const fdArrayIndex = this.parseIndex(topDict.getByName("FDArray")).obj; + for (let i = 0, ii = fdArrayIndex.count; i < ii; ++i) { + const dictRaw = fdArrayIndex.get(i); + const fontDict = this.createDict(CFFTopDict, this.parseDict(dictRaw), cff.strings); + this.parsePrivateDict(fontDict); + cff.fdArray.push(fontDict); + } + encoding = null; + charset = this.parseCharsets(topDict.getByName("charset"), charStringIndex.count, cff.strings, true); + cff.fdSelect = this.parseFDSelect(topDict.getByName("FDSelect"), charStringIndex.count); + } else { + charset = this.parseCharsets(topDict.getByName("charset"), charStringIndex.count, cff.strings, false); + encoding = this.parseEncoding(topDict.getByName("Encoding"), properties, cff.strings, charset.charset); + } + cff.charset = charset; + cff.encoding = encoding; + const charStringsAndSeacs = this.parseCharStrings({ + charStrings: charStringIndex, + localSubrIndex: topDict.privateDict.subrsIndex, + globalSubrIndex: globalSubrIndex.obj, + fdSelect: cff.fdSelect, + fdArray: cff.fdArray, + privateDict: topDict.privateDict + }); + cff.charStrings = charStringsAndSeacs.charStrings; + cff.seacs = charStringsAndSeacs.seacs; + cff.widths = charStringsAndSeacs.widths; + return cff; + } + parseHeader() { + let bytes = this.bytes; + const bytesLength = bytes.length; + let offset = 0; + while (offset < bytesLength && bytes[offset] !== 1) { + ++offset; + } + if (offset >= bytesLength) { + throw new FormatError("Invalid CFF header"); + } + if (offset !== 0) { + info("cff data is shifted"); + bytes = bytes.subarray(offset); + this.bytes = bytes; + } + const major = bytes[0]; + const minor = bytes[1]; + const hdrSize = bytes[2]; + const offSize = bytes[3]; + const header = new CFFHeader(major, minor, hdrSize, offSize); + return { + obj: header, + endPos: hdrSize + }; + } + parseDict(dict) { + let pos = 0; + function parseOperand() { + let value = dict[pos++]; + if (value === 30) { + return parseFloatOperand(); + } else if (value === 28) { + value = dict[pos++]; + value = (value << 24 | dict[pos++] << 16) >> 16; + return value; + } else if (value === 29) { + value = dict[pos++]; + value = value << 8 | dict[pos++]; + value = value << 8 | dict[pos++]; + value = value << 8 | dict[pos++]; + return value; + } else if (value >= 32 && value <= 246) { + return value - 139; + } else if (value >= 247 && value <= 250) { + return (value - 247) * 256 + dict[pos++] + 108; + } else if (value >= 251 && value <= 254) { + return -((value - 251) * 256) - dict[pos++] - 108; + } + warn('CFFParser_parseDict: "' + value + '" is a reserved command.'); + return NaN; + } + function parseFloatOperand() { + let str = ""; + const eof = 15; + const lookup = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".", "E", "E-", null, "-"]; + const length = dict.length; + while (pos < length) { + const b = dict[pos++]; + const b1 = b >> 4; + const b2 = b & 15; + if (b1 === eof) { + break; + } + str += lookup[b1]; + if (b2 === eof) { + break; + } + str += lookup[b2]; + } + return parseFloat(str); + } + let operands = []; + const entries = []; + pos = 0; + const end = dict.length; + while (pos < end) { + let b = dict[pos]; + if (b <= 21) { + if (b === 12) { + b = b << 8 | dict[++pos]; + } + entries.push([b, operands]); + operands = []; + ++pos; + } else { + operands.push(parseOperand()); + } + } + return entries; + } + parseIndex(pos) { + const cffIndex = new CFFIndex(); + const bytes = this.bytes; + const count = bytes[pos++] << 8 | bytes[pos++]; + const offsets = []; + let end = pos; + let i, ii; + if (count !== 0) { + const offsetSize = bytes[pos++]; + const startPos = pos + (count + 1) * offsetSize - 1; + for (i = 0, ii = count + 1; i < ii; ++i) { + let offset = 0; + for (let j = 0; j < offsetSize; ++j) { + offset <<= 8; + offset += bytes[pos++]; + } + offsets.push(startPos + offset); + } + end = offsets[count]; + } + for (i = 0, ii = offsets.length - 1; i < ii; ++i) { + const offsetStart = offsets[i]; + const offsetEnd = offsets[i + 1]; + cffIndex.add(bytes.subarray(offsetStart, offsetEnd)); + } + return { + obj: cffIndex, + endPos: end + }; + } + parseNameIndex(index) { + const names = []; + for (let i = 0, ii = index.count; i < ii; ++i) { + const name = index.get(i); + names.push(bytesToString(name)); + } + return names; + } + parseStringIndex(index) { + const strings = new CFFStrings(); + for (let i = 0, ii = index.count; i < ii; ++i) { + const data = index.get(i); + strings.add(bytesToString(data)); + } + return strings; + } + createDict(Type, dict, strings) { + const cffDict = new Type(strings); + for (const [key, value] of dict) { + cffDict.setByKey(key, value); + } + return cffDict; + } + parseCharString(state, data, localSubrIndex, globalSubrIndex) { + if (!data || state.callDepth > MAX_SUBR_NESTING) { + return false; + } + let stackSize = state.stackSize; + const stack = state.stack; + let length = data.length; + for (let j = 0; j < length;) { + const value = data[j++]; + let validationCommand = null; + if (value === 12) { + const q = data[j++]; + if (q === 0) { + data[j - 2] = 139; + data[j - 1] = 22; + stackSize = 0; + } else { + validationCommand = CharstringValidationData12[q]; + } + } else if (value === 28) { + stack[stackSize] = (data[j] << 24 | data[j + 1] << 16) >> 16; + j += 2; + stackSize++; + } else if (value === 14) { + if (stackSize >= 4) { + stackSize -= 4; + if (this.seacAnalysisEnabled) { + state.seac = stack.slice(stackSize, stackSize + 4); + return false; + } + } + validationCommand = CharstringValidationData[value]; + } else if (value >= 32 && value <= 246) { + stack[stackSize] = value - 139; + stackSize++; + } else if (value >= 247 && value <= 254) { + stack[stackSize] = value < 251 ? (value - 247 << 8) + data[j] + 108 : -(value - 251 << 8) - data[j] - 108; + j++; + stackSize++; + } else if (value === 255) { + stack[stackSize] = (data[j] << 24 | data[j + 1] << 16 | data[j + 2] << 8 | data[j + 3]) / 65536; + j += 4; + stackSize++; + } else if (value === 19 || value === 20) { + state.hints += stackSize >> 1; + if (state.hints === 0) { + data.copyWithin(j - 1, j, -1); + j -= 1; + length -= 1; + continue; + } + j += state.hints + 7 >> 3; + stackSize %= 2; + validationCommand = CharstringValidationData[value]; + } else if (value === 10 || value === 29) { + const subrsIndex = value === 10 ? localSubrIndex : globalSubrIndex; + if (!subrsIndex) { + validationCommand = CharstringValidationData[value]; + warn("Missing subrsIndex for " + validationCommand.id); + return false; + } + let bias = 32768; + if (subrsIndex.count < 1240) { + bias = 107; + } else if (subrsIndex.count < 33900) { + bias = 1131; + } + const subrNumber = stack[--stackSize] + bias; + if (subrNumber < 0 || subrNumber >= subrsIndex.count || isNaN(subrNumber)) { + validationCommand = CharstringValidationData[value]; + warn("Out of bounds subrIndex for " + validationCommand.id); + return false; + } + state.stackSize = stackSize; + state.callDepth++; + const valid = this.parseCharString(state, subrsIndex.get(subrNumber), localSubrIndex, globalSubrIndex); + if (!valid) { + return false; + } + state.callDepth--; + stackSize = state.stackSize; + continue; + } else if (value === 11) { + state.stackSize = stackSize; + return true; + } else if (value === 0 && j === data.length) { + data[j - 1] = 14; + validationCommand = CharstringValidationData[14]; + } else if (value === 9) { + data.copyWithin(j - 1, j, -1); + j -= 1; + length -= 1; + continue; + } else { + validationCommand = CharstringValidationData[value]; + } + if (validationCommand) { + if (validationCommand.stem) { + state.hints += stackSize >> 1; + if (value === 3 || value === 23) { + state.hasVStems = true; + } else if (state.hasVStems && (value === 1 || value === 18)) { + warn("CFF stem hints are in wrong order"); + data[j - 1] = value === 1 ? 3 : 23; + } + } + if ("min" in validationCommand) { + if (!state.undefStack && stackSize < validationCommand.min) { + warn("Not enough parameters for " + validationCommand.id + "; actual: " + stackSize + ", expected: " + validationCommand.min); + if (stackSize === 0) { + data[j - 1] = 14; + return true; + } + return false; + } + } + if (state.firstStackClearing && validationCommand.stackClearing) { + state.firstStackClearing = false; + stackSize -= validationCommand.min; + if (stackSize >= 2 && validationCommand.stem) { + stackSize %= 2; + } else if (stackSize > 1) { + warn("Found too many parameters for stack-clearing command"); + } + if (stackSize > 0) { + state.width = stack[stackSize - 1]; + } + } + if ("stackDelta" in validationCommand) { + if ("stackFn" in validationCommand) { + validationCommand.stackFn(stack, stackSize); + } + stackSize += validationCommand.stackDelta; + } else if (validationCommand.stackClearing) { + stackSize = 0; + } else if (validationCommand.resetStack) { + stackSize = 0; + state.undefStack = false; + } else if (validationCommand.undefStack) { + stackSize = 0; + state.undefStack = true; + state.firstStackClearing = false; + } + } + } + if (length < data.length) { + data.fill(14, length); + } + state.stackSize = stackSize; + return true; + } + parseCharStrings({ + charStrings, + localSubrIndex, + globalSubrIndex, + fdSelect, + fdArray, + privateDict + }) { + const seacs = []; + const widths = []; + const count = charStrings.count; + for (let i = 0; i < count; i++) { + const charstring = charStrings.get(i); + const state = { + callDepth: 0, + stackSize: 0, + stack: [], + undefStack: true, + hints: 0, + firstStackClearing: true, + seac: null, + width: null, + hasVStems: false + }; + let valid = true; + let localSubrToUse = null; + let privateDictToUse = privateDict; + if (fdSelect && fdArray.length) { + const fdIndex = fdSelect.getFDIndex(i); + if (fdIndex === -1) { + warn("Glyph index is not in fd select."); + valid = false; + } + if (fdIndex >= fdArray.length) { + warn("Invalid fd index for glyph index."); + valid = false; + } + if (valid) { + privateDictToUse = fdArray[fdIndex].privateDict; + localSubrToUse = privateDictToUse.subrsIndex; + } + } else if (localSubrIndex) { + localSubrToUse = localSubrIndex; + } + if (valid) { + valid = this.parseCharString(state, charstring, localSubrToUse, globalSubrIndex); + } + if (state.width !== null) { + const nominalWidth = privateDictToUse.getByName("nominalWidthX"); + widths[i] = nominalWidth + state.width; + } else { + const defaultWidth = privateDictToUse.getByName("defaultWidthX"); + widths[i] = defaultWidth; + } + if (state.seac !== null) { + seacs[i] = state.seac; + } + if (!valid) { + charStrings.set(i, new Uint8Array([14])); + } + } + return { + charStrings, + seacs, + widths + }; + } + emptyPrivateDictionary(parentDict) { + const privateDict = this.createDict(CFFPrivateDict, [], parentDict.strings); + parentDict.setByKey(18, [0, 0]); + parentDict.privateDict = privateDict; + } + parsePrivateDict(parentDict) { + if (!parentDict.hasName("Private")) { + this.emptyPrivateDictionary(parentDict); + return; + } + const privateOffset = parentDict.getByName("Private"); + if (!Array.isArray(privateOffset) || privateOffset.length !== 2) { + parentDict.removeByName("Private"); + return; + } + const size = privateOffset[0]; + const offset = privateOffset[1]; + if (size === 0 || offset >= this.bytes.length) { + this.emptyPrivateDictionary(parentDict); + return; + } + const privateDictEnd = offset + size; + const dictData = this.bytes.subarray(offset, privateDictEnd); + const dict = this.parseDict(dictData); + const privateDict = this.createDict(CFFPrivateDict, dict, parentDict.strings); + parentDict.privateDict = privateDict; + if (privateDict.getByName("ExpansionFactor") === 0) { + privateDict.setByName("ExpansionFactor", 0.06); + } + if (!privateDict.getByName("Subrs")) { + return; + } + const subrsOffset = privateDict.getByName("Subrs"); + const relativeOffset = offset + subrsOffset; + if (subrsOffset === 0 || relativeOffset >= this.bytes.length) { + this.emptyPrivateDictionary(parentDict); + return; + } + const subrsIndex = this.parseIndex(relativeOffset); + privateDict.subrsIndex = subrsIndex.obj; + } + parseCharsets(pos, length, strings, cid) { + if (pos === 0) { + return new CFFCharset(true, CFFCharsetPredefinedTypes.ISO_ADOBE, ISOAdobeCharset); + } else if (pos === 1) { + return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT, ExpertCharset); + } else if (pos === 2) { + return new CFFCharset(true, CFFCharsetPredefinedTypes.EXPERT_SUBSET, ExpertSubsetCharset); + } + const bytes = this.bytes; + const start = pos; + const format = bytes[pos++]; + const charset = [cid ? 0 : ".notdef"]; + let id, count, i; + length -= 1; + switch (format) { + case 0: + for (i = 0; i < length; i++) { + id = bytes[pos++] << 8 | bytes[pos++]; + charset.push(cid ? id : strings.get(id)); + } + break; + case 1: + while (charset.length <= length) { + id = bytes[pos++] << 8 | bytes[pos++]; + count = bytes[pos++]; + for (i = 0; i <= count; i++) { + charset.push(cid ? id++ : strings.get(id++)); + } + } + break; + case 2: + while (charset.length <= length) { + id = bytes[pos++] << 8 | bytes[pos++]; + count = bytes[pos++] << 8 | bytes[pos++]; + for (i = 0; i <= count; i++) { + charset.push(cid ? id++ : strings.get(id++)); + } + } + break; + default: + throw new FormatError("Unknown charset format"); + } + const end = pos; + const raw = bytes.subarray(start, end); + return new CFFCharset(false, format, charset, raw); + } + parseEncoding(pos, properties, strings, charset) { + const encoding = Object.create(null); + const bytes = this.bytes; + let predefined = false; + let format, i, ii; + let raw = null; + function readSupplement() { + const supplementsCount = bytes[pos++]; + for (i = 0; i < supplementsCount; i++) { + const code = bytes[pos++]; + const sid = (bytes[pos++] << 8) + (bytes[pos++] & 0xff); + encoding[code] = charset.indexOf(strings.get(sid)); + } + } + if (pos === 0 || pos === 1) { + predefined = true; + format = pos; + const baseEncoding = pos ? ExpertEncoding : StandardEncoding; + for (i = 0, ii = charset.length; i < ii; i++) { + const index = baseEncoding.indexOf(charset[i]); + if (index !== -1) { + encoding[index] = i; + } + } + } else { + const dataStart = pos; + format = bytes[pos++]; + switch (format & 0x7f) { + case 0: + const glyphsCount = bytes[pos++]; + for (i = 1; i <= glyphsCount; i++) { + encoding[bytes[pos++]] = i; + } + break; + case 1: + const rangesCount = bytes[pos++]; + let gid = 1; + for (i = 0; i < rangesCount; i++) { + const start = bytes[pos++]; + const left = bytes[pos++]; + for (let j = start; j <= start + left; j++) { + encoding[j] = gid++; + } + } + break; + default: + throw new FormatError(`Unknown encoding format: ${format} in CFF`); + } + const dataEnd = pos; + if (format & 0x80) { + bytes[dataStart] &= 0x7f; + readSupplement(); + } + raw = bytes.subarray(dataStart, dataEnd); + } + format &= 0x7f; + return new CFFEncoding(predefined, format, encoding, raw); + } + parseFDSelect(pos, length) { + const bytes = this.bytes; + const format = bytes[pos++]; + const fdSelect = []; + let i; + switch (format) { + case 0: + for (i = 0; i < length; ++i) { + const id = bytes[pos++]; + fdSelect.push(id); + } + break; + case 3: + const rangesCount = bytes[pos++] << 8 | bytes[pos++]; + for (i = 0; i < rangesCount; ++i) { + let first = bytes[pos++] << 8 | bytes[pos++]; + if (i === 0 && first !== 0) { + warn("parseFDSelect: The first range must have a first GID of 0" + " -- trying to recover."); + first = 0; + } + const fdIndex = bytes[pos++]; + const next = bytes[pos] << 8 | bytes[pos + 1]; + for (let j = first; j < next; ++j) { + fdSelect.push(fdIndex); + } + } + pos += 2; + break; + default: + throw new FormatError(`parseFDSelect: Unknown format "${format}".`); + } + if (fdSelect.length !== length) { + throw new FormatError("parseFDSelect: Invalid font data."); + } + return new CFFFDSelect(format, fdSelect); + } +} +class CFF { + constructor() { + this.header = null; + this.names = []; + this.topDict = null; + this.strings = new CFFStrings(); + this.globalSubrIndex = null; + this.encoding = null; + this.charset = null; + this.charStrings = null; + this.fdArray = []; + this.fdSelect = null; + this.isCIDFont = false; + } + duplicateFirstGlyph() { + if (this.charStrings.count >= 65535) { + warn("Not enough space in charstrings to duplicate first glyph."); + return; + } + const glyphZero = this.charStrings.get(0); + this.charStrings.add(glyphZero); + if (this.isCIDFont) { + this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0]); + } + } + hasGlyphId(id) { + if (id < 0 || id >= this.charStrings.count) { + return false; + } + const glyph = this.charStrings.get(id); + return glyph.length > 0; + } +} +class CFFHeader { + constructor(major, minor, hdrSize, offSize) { + this.major = major; + this.minor = minor; + this.hdrSize = hdrSize; + this.offSize = offSize; + } +} +class CFFStrings { + constructor() { + this.strings = []; + } + get(index) { + if (index >= 0 && index <= NUM_STANDARD_CFF_STRINGS - 1) { + return CFFStandardStrings[index]; + } + if (index - NUM_STANDARD_CFF_STRINGS <= this.strings.length) { + return this.strings[index - NUM_STANDARD_CFF_STRINGS]; + } + return CFFStandardStrings[0]; + } + getSID(str) { + let index = CFFStandardStrings.indexOf(str); + if (index !== -1) { + return index; + } + index = this.strings.indexOf(str); + if (index !== -1) { + return index + NUM_STANDARD_CFF_STRINGS; + } + return -1; + } + add(value) { + this.strings.push(value); + } + get count() { + return this.strings.length; + } +} +class CFFIndex { + constructor() { + this.objects = []; + this.length = 0; + } + add(data) { + this.length += data.length; + this.objects.push(data); + } + set(index, data) { + this.length += data.length - this.objects[index].length; + this.objects[index] = data; + } + get(index) { + return this.objects[index]; + } + get count() { + return this.objects.length; + } +} +class CFFDict { + constructor(tables, strings) { + this.keyToNameMap = tables.keyToNameMap; + this.nameToKeyMap = tables.nameToKeyMap; + this.defaults = tables.defaults; + this.types = tables.types; + this.opcodes = tables.opcodes; + this.order = tables.order; + this.strings = strings; + this.values = Object.create(null); + } + setByKey(key, value) { + if (!(key in this.keyToNameMap)) { + return false; + } + if (value.length === 0) { + return true; + } + for (const val of value) { + if (isNaN(val)) { + warn(`Invalid CFFDict value: "${value}" for key "${key}".`); + return true; + } + } + const type = this.types[key]; + if (type === "num" || type === "sid" || type === "offset") { + value = value[0]; + } + this.values[key] = value; + return true; + } + setByName(name, value) { + if (!(name in this.nameToKeyMap)) { + throw new FormatError(`Invalid dictionary name "${name}"`); + } + this.values[this.nameToKeyMap[name]] = value; + } + hasName(name) { + return this.nameToKeyMap[name] in this.values; + } + getByName(name) { + if (!(name in this.nameToKeyMap)) { + throw new FormatError(`Invalid dictionary name ${name}"`); + } + const key = this.nameToKeyMap[name]; + if (!(key in this.values)) { + return this.defaults[key]; + } + return this.values[key]; + } + removeByName(name) { + delete this.values[this.nameToKeyMap[name]]; + } + static createTables(layout) { + const tables = { + keyToNameMap: {}, + nameToKeyMap: {}, + defaults: {}, + types: {}, + opcodes: {}, + order: [] + }; + for (const entry of layout) { + const key = Array.isArray(entry[0]) ? (entry[0][0] << 8) + entry[0][1] : entry[0]; + tables.keyToNameMap[key] = entry[1]; + tables.nameToKeyMap[entry[1]] = key; + tables.types[key] = entry[2]; + tables.defaults[key] = entry[3]; + tables.opcodes[key] = Array.isArray(entry[0]) ? entry[0] : [entry[0]]; + tables.order.push(key); + } + return tables; + } +} +const CFFTopDictLayout = [[[12, 30], "ROS", ["sid", "sid", "num"], null], [[12, 20], "SyntheticBase", "num", null], [0, "version", "sid", null], [1, "Notice", "sid", null], [[12, 0], "Copyright", "sid", null], [2, "FullName", "sid", null], [3, "FamilyName", "sid", null], [4, "Weight", "sid", null], [[12, 1], "isFixedPitch", "num", 0], [[12, 2], "ItalicAngle", "num", 0], [[12, 3], "UnderlinePosition", "num", -100], [[12, 4], "UnderlineThickness", "num", 50], [[12, 5], "PaintType", "num", 0], [[12, 6], "CharstringType", "num", 2], [[12, 7], "FontMatrix", ["num", "num", "num", "num", "num", "num"], [0.001, 0, 0, 0.001, 0, 0]], [13, "UniqueID", "num", null], [5, "FontBBox", ["num", "num", "num", "num"], [0, 0, 0, 0]], [[12, 8], "StrokeWidth", "num", 0], [14, "XUID", "array", null], [15, "charset", "offset", 0], [16, "Encoding", "offset", 0], [17, "CharStrings", "offset", 0], [18, "Private", ["offset", "offset"], null], [[12, 21], "PostScript", "sid", null], [[12, 22], "BaseFontName", "sid", null], [[12, 23], "BaseFontBlend", "delta", null], [[12, 31], "CIDFontVersion", "num", 0], [[12, 32], "CIDFontRevision", "num", 0], [[12, 33], "CIDFontType", "num", 0], [[12, 34], "CIDCount", "num", 8720], [[12, 35], "UIDBase", "num", null], [[12, 37], "FDSelect", "offset", null], [[12, 36], "FDArray", "offset", null], [[12, 38], "FontName", "sid", null]]; +class CFFTopDict extends CFFDict { + static get tables() { + return shadow(this, "tables", this.createTables(CFFTopDictLayout)); + } + constructor(strings) { + super(CFFTopDict.tables, strings); + this.privateDict = null; + } +} +const CFFPrivateDictLayout = [[6, "BlueValues", "delta", null], [7, "OtherBlues", "delta", null], [8, "FamilyBlues", "delta", null], [9, "FamilyOtherBlues", "delta", null], [[12, 9], "BlueScale", "num", 0.039625], [[12, 10], "BlueShift", "num", 7], [[12, 11], "BlueFuzz", "num", 1], [10, "StdHW", "num", null], [11, "StdVW", "num", null], [[12, 12], "StemSnapH", "delta", null], [[12, 13], "StemSnapV", "delta", null], [[12, 14], "ForceBold", "num", 0], [[12, 17], "LanguageGroup", "num", 0], [[12, 18], "ExpansionFactor", "num", 0.06], [[12, 19], "initialRandomSeed", "num", 0], [20, "defaultWidthX", "num", 0], [21, "nominalWidthX", "num", 0], [19, "Subrs", "offset", null]]; +class CFFPrivateDict extends CFFDict { + static get tables() { + return shadow(this, "tables", this.createTables(CFFPrivateDictLayout)); + } + constructor(strings) { + super(CFFPrivateDict.tables, strings); + this.subrsIndex = null; + } +} +const CFFCharsetPredefinedTypes = { + ISO_ADOBE: 0, + EXPERT: 1, + EXPERT_SUBSET: 2 +}; +class CFFCharset { + constructor(predefined, format, charset, raw) { + this.predefined = predefined; + this.format = format; + this.charset = charset; + this.raw = raw; + } +} +class CFFEncoding { + constructor(predefined, format, encoding, raw) { + this.predefined = predefined; + this.format = format; + this.encoding = encoding; + this.raw = raw; + } +} +class CFFFDSelect { + constructor(format, fdSelect) { + this.format = format; + this.fdSelect = fdSelect; + } + getFDIndex(glyphIndex) { + if (glyphIndex < 0 || glyphIndex >= this.fdSelect.length) { + return -1; + } + return this.fdSelect[glyphIndex]; + } +} +class CFFOffsetTracker { + constructor() { + this.offsets = Object.create(null); + } + isTracking(key) { + return key in this.offsets; + } + track(key, location) { + if (key in this.offsets) { + throw new FormatError(`Already tracking location of ${key}`); + } + this.offsets[key] = location; + } + offset(value) { + for (const key in this.offsets) { + this.offsets[key] += value; + } + } + setEntryLocation(key, values, output) { + if (!(key in this.offsets)) { + throw new FormatError(`Not tracking location of ${key}`); + } + const data = output.data; + const dataOffset = this.offsets[key]; + const size = 5; + for (let i = 0, ii = values.length; i < ii; ++i) { + const offset0 = i * size + dataOffset; + const offset1 = offset0 + 1; + const offset2 = offset0 + 2; + const offset3 = offset0 + 3; + const offset4 = offset0 + 4; + if (data[offset0] !== 0x1d || data[offset1] !== 0 || data[offset2] !== 0 || data[offset3] !== 0 || data[offset4] !== 0) { + throw new FormatError("writing to an offset that is not empty"); + } + const value = values[i]; + data[offset0] = 0x1d; + data[offset1] = value >> 24 & 0xff; + data[offset2] = value >> 16 & 0xff; + data[offset3] = value >> 8 & 0xff; + data[offset4] = value & 0xff; + } + } +} +class CFFCompiler { + constructor(cff) { + this.cff = cff; + } + compile() { + const cff = this.cff; + const output = { + data: [], + length: 0, + add(data) { + try { + this.data.push(...data); + } catch { + this.data = this.data.concat(data); + } + this.length = this.data.length; + } + }; + const header = this.compileHeader(cff.header); + output.add(header); + const nameIndex = this.compileNameIndex(cff.names); + output.add(nameIndex); + if (cff.isCIDFont) { + if (cff.topDict.hasName("FontMatrix")) { + const base = cff.topDict.getByName("FontMatrix"); + cff.topDict.removeByName("FontMatrix"); + for (const subDict of cff.fdArray) { + let matrix = base.slice(0); + if (subDict.hasName("FontMatrix")) { + matrix = Util.transform(matrix, subDict.getByName("FontMatrix")); + } + subDict.setByName("FontMatrix", matrix); + } + } + } + const xuid = cff.topDict.getByName("XUID"); + if (xuid?.length > 16) { + cff.topDict.removeByName("XUID"); + } + cff.topDict.setByName("charset", 0); + let compiled = this.compileTopDicts([cff.topDict], output.length, cff.isCIDFont); + output.add(compiled.output); + const topDictTracker = compiled.trackers[0]; + const stringIndex = this.compileStringIndex(cff.strings.strings); + output.add(stringIndex); + const globalSubrIndex = this.compileIndex(cff.globalSubrIndex); + output.add(globalSubrIndex); + if (cff.encoding && cff.topDict.hasName("Encoding")) { + if (cff.encoding.predefined) { + topDictTracker.setEntryLocation("Encoding", [cff.encoding.format], output); + } else { + const encoding = this.compileEncoding(cff.encoding); + topDictTracker.setEntryLocation("Encoding", [output.length], output); + output.add(encoding); + } + } + const charset = this.compileCharset(cff.charset, cff.charStrings.count, cff.strings, cff.isCIDFont); + topDictTracker.setEntryLocation("charset", [output.length], output); + output.add(charset); + const charStrings = this.compileCharStrings(cff.charStrings); + topDictTracker.setEntryLocation("CharStrings", [output.length], output); + output.add(charStrings); + if (cff.isCIDFont) { + topDictTracker.setEntryLocation("FDSelect", [output.length], output); + const fdSelect = this.compileFDSelect(cff.fdSelect); + output.add(fdSelect); + compiled = this.compileTopDicts(cff.fdArray, output.length, true); + topDictTracker.setEntryLocation("FDArray", [output.length], output); + output.add(compiled.output); + const fontDictTrackers = compiled.trackers; + this.compilePrivateDicts(cff.fdArray, fontDictTrackers, output); + } + this.compilePrivateDicts([cff.topDict], [topDictTracker], output); + output.add([0]); + return output.data; + } + encodeNumber(value) { + if (Number.isInteger(value)) { + return this.encodeInteger(value); + } + return this.encodeFloat(value); + } + static get EncodeFloatRegExp() { + return shadow(this, "EncodeFloatRegExp", /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/); + } + encodeFloat(num) { + let value = num.toString(); + const m = CFFCompiler.EncodeFloatRegExp.exec(value); + if (m) { + const epsilon = parseFloat("1e" + ((m[2] ? +m[2] : 0) + m[1].length)); + value = (Math.round(num * epsilon) / epsilon).toString(); + } + let nibbles = ""; + let i, ii; + for (i = 0, ii = value.length; i < ii; ++i) { + const a = value[i]; + if (a === "e") { + nibbles += value[++i] === "-" ? "c" : "b"; + } else if (a === ".") { + nibbles += "a"; + } else if (a === "-") { + nibbles += "e"; + } else { + nibbles += a; + } + } + nibbles += nibbles.length & 1 ? "f" : "ff"; + const out = [30]; + for (i = 0, ii = nibbles.length; i < ii; i += 2) { + out.push(parseInt(nibbles.substring(i, i + 2), 16)); + } + return out; + } + encodeInteger(value) { + let code; + if (value >= -107 && value <= 107) { + code = [value + 139]; + } else if (value >= 108 && value <= 1131) { + value -= 108; + code = [(value >> 8) + 247, value & 0xff]; + } else if (value >= -1131 && value <= -108) { + value = -value - 108; + code = [(value >> 8) + 251, value & 0xff]; + } else if (value >= -32768 && value <= 32767) { + code = [0x1c, value >> 8 & 0xff, value & 0xff]; + } else { + code = [0x1d, value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff]; + } + return code; + } + compileHeader(header) { + return [header.major, header.minor, 4, header.offSize]; + } + compileNameIndex(names) { + const nameIndex = new CFFIndex(); + for (const name of names) { + const length = Math.min(name.length, 127); + let sanitizedName = new Array(length); + for (let j = 0; j < length; j++) { + let char = name[j]; + if (char < "!" || char > "~" || char === "[" || char === "]" || char === "(" || char === ")" || char === "{" || char === "}" || char === "<" || char === ">" || char === "/" || char === "%") { + char = "_"; + } + sanitizedName[j] = char; + } + sanitizedName = sanitizedName.join(""); + if (sanitizedName === "") { + sanitizedName = "Bad_Font_Name"; + } + nameIndex.add(stringToBytes(sanitizedName)); + } + return this.compileIndex(nameIndex); + } + compileTopDicts(dicts, length, removeCidKeys) { + const fontDictTrackers = []; + let fdArrayIndex = new CFFIndex(); + for (const fontDict of dicts) { + if (removeCidKeys) { + fontDict.removeByName("CIDFontVersion"); + fontDict.removeByName("CIDFontRevision"); + fontDict.removeByName("CIDFontType"); + fontDict.removeByName("CIDCount"); + fontDict.removeByName("UIDBase"); + } + const fontDictTracker = new CFFOffsetTracker(); + const fontDictData = this.compileDict(fontDict, fontDictTracker); + fontDictTrackers.push(fontDictTracker); + fdArrayIndex.add(fontDictData); + fontDictTracker.offset(length); + } + fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers); + return { + trackers: fontDictTrackers, + output: fdArrayIndex + }; + } + compilePrivateDicts(dicts, trackers, output) { + for (let i = 0, ii = dicts.length; i < ii; ++i) { + const fontDict = dicts[i]; + const privateDict = fontDict.privateDict; + if (!privateDict || !fontDict.hasName("Private")) { + throw new FormatError("There must be a private dictionary."); + } + const privateDictTracker = new CFFOffsetTracker(); + const privateDictData = this.compileDict(privateDict, privateDictTracker); + let outputLength = output.length; + privateDictTracker.offset(outputLength); + if (!privateDictData.length) { + outputLength = 0; + } + trackers[i].setEntryLocation("Private", [privateDictData.length, outputLength], output); + output.add(privateDictData); + if (privateDict.subrsIndex && privateDict.hasName("Subrs")) { + const subrs = this.compileIndex(privateDict.subrsIndex); + privateDictTracker.setEntryLocation("Subrs", [privateDictData.length], output); + output.add(subrs); + } + } + } + compileDict(dict, offsetTracker) { + const out = []; + for (const key of dict.order) { + if (!(key in dict.values)) { + continue; + } + let values = dict.values[key]; + let types = dict.types[key]; + if (!Array.isArray(types)) { + types = [types]; + } + if (!Array.isArray(values)) { + values = [values]; + } + if (values.length === 0) { + continue; + } + for (let j = 0, jj = types.length; j < jj; ++j) { + const type = types[j]; + const value = values[j]; + switch (type) { + case "num": + case "sid": + out.push(...this.encodeNumber(value)); + break; + case "offset": + const name = dict.keyToNameMap[key]; + if (!offsetTracker.isTracking(name)) { + offsetTracker.track(name, out.length); + } + out.push(0x1d, 0, 0, 0, 0); + break; + case "array": + case "delta": + out.push(...this.encodeNumber(value)); + for (let k = 1, kk = values.length; k < kk; ++k) { + out.push(...this.encodeNumber(values[k])); + } + break; + default: + throw new FormatError(`Unknown data type of ${type}`); + } + } + out.push(...dict.opcodes[key]); + } + return out; + } + compileStringIndex(strings) { + const stringIndex = new CFFIndex(); + for (const string of strings) { + stringIndex.add(stringToBytes(string)); + } + return this.compileIndex(stringIndex); + } + compileCharStrings(charStrings) { + const charStringsIndex = new CFFIndex(); + for (let i = 0; i < charStrings.count; i++) { + const glyph = charStrings.get(i); + if (glyph.length === 0) { + charStringsIndex.add(new Uint8Array([0x8b, 0x0e])); + continue; + } + charStringsIndex.add(glyph); + } + return this.compileIndex(charStringsIndex); + } + compileCharset(charset, numGlyphs, strings, isCIDFont) { + let out; + const numGlyphsLessNotDef = numGlyphs - 1; + if (isCIDFont) { + out = new Uint8Array([2, 0, 0, numGlyphsLessNotDef >> 8 & 0xff, numGlyphsLessNotDef & 0xff]); + } else { + const length = 1 + numGlyphsLessNotDef * 2; + out = new Uint8Array(length); + out[0] = 0; + let charsetIndex = 0; + const numCharsets = charset.charset.length; + let warned = false; + for (let i = 1; i < out.length; i += 2) { + let sid = 0; + if (charsetIndex < numCharsets) { + const name = charset.charset[charsetIndex++]; + sid = strings.getSID(name); + if (sid === -1) { + sid = 0; + if (!warned) { + warned = true; + warn(`Couldn't find ${name} in CFF strings`); + } + } + } + out[i] = sid >> 8 & 0xff; + out[i + 1] = sid & 0xff; + } + } + return this.compileTypedArray(out); + } + compileEncoding(encoding) { + return this.compileTypedArray(encoding.raw); + } + compileFDSelect(fdSelect) { + const format = fdSelect.format; + let out, i; + switch (format) { + case 0: + out = new Uint8Array(1 + fdSelect.fdSelect.length); + out[0] = format; + for (i = 0; i < fdSelect.fdSelect.length; i++) { + out[i + 1] = fdSelect.fdSelect[i]; + } + break; + case 3: + const start = 0; + let lastFD = fdSelect.fdSelect[0]; + const ranges = [format, 0, 0, start >> 8 & 0xff, start & 0xff, lastFD]; + for (i = 1; i < fdSelect.fdSelect.length; i++) { + const currentFD = fdSelect.fdSelect[i]; + if (currentFD !== lastFD) { + ranges.push(i >> 8 & 0xff, i & 0xff, currentFD); + lastFD = currentFD; + } + } + const numRanges = (ranges.length - 3) / 3; + ranges[1] = numRanges >> 8 & 0xff; + ranges[2] = numRanges & 0xff; + ranges.push(i >> 8 & 0xff, i & 0xff); + out = new Uint8Array(ranges); + break; + } + return this.compileTypedArray(out); + } + compileTypedArray(data) { + return Array.from(data); + } + compileIndex(index, trackers = []) { + const objects = index.objects; + const count = objects.length; + if (count === 0) { + return [0, 0]; + } + const data = [count >> 8 & 0xff, count & 0xff]; + let lastOffset = 1, + i; + for (i = 0; i < count; ++i) { + lastOffset += objects[i].length; + } + let offsetSize; + if (lastOffset < 0x100) { + offsetSize = 1; + } else if (lastOffset < 0x10000) { + offsetSize = 2; + } else if (lastOffset < 0x1000000) { + offsetSize = 3; + } else { + offsetSize = 4; + } + data.push(offsetSize); + let relativeOffset = 1; + for (i = 0; i < count + 1; i++) { + if (offsetSize === 1) { + data.push(relativeOffset & 0xff); + } else if (offsetSize === 2) { + data.push(relativeOffset >> 8 & 0xff, relativeOffset & 0xff); + } else if (offsetSize === 3) { + data.push(relativeOffset >> 16 & 0xff, relativeOffset >> 8 & 0xff, relativeOffset & 0xff); + } else { + data.push(relativeOffset >>> 24 & 0xff, relativeOffset >> 16 & 0xff, relativeOffset >> 8 & 0xff, relativeOffset & 0xff); + } + if (objects[i]) { + relativeOffset += objects[i].length; + } + } + for (i = 0; i < count; i++) { + if (trackers[i]) { + trackers[i].offset(data.length); + } + data.push(...objects[i]); + } + return data; + } +} + +;// CONCATENATED MODULE: ./src/core/glyphlist.js + +const getGlyphsUnicode = getLookupTableFactory(function (t) { + t.A = 0x0041; + t.AE = 0x00c6; + t.AEacute = 0x01fc; + t.AEmacron = 0x01e2; + t.AEsmall = 0xf7e6; + t.Aacute = 0x00c1; + t.Aacutesmall = 0xf7e1; + t.Abreve = 0x0102; + t.Abreveacute = 0x1eae; + t.Abrevecyrillic = 0x04d0; + t.Abrevedotbelow = 0x1eb6; + t.Abrevegrave = 0x1eb0; + t.Abrevehookabove = 0x1eb2; + t.Abrevetilde = 0x1eb4; + t.Acaron = 0x01cd; + t.Acircle = 0x24b6; + t.Acircumflex = 0x00c2; + t.Acircumflexacute = 0x1ea4; + t.Acircumflexdotbelow = 0x1eac; + t.Acircumflexgrave = 0x1ea6; + t.Acircumflexhookabove = 0x1ea8; + t.Acircumflexsmall = 0xf7e2; + t.Acircumflextilde = 0x1eaa; + t.Acute = 0xf6c9; + t.Acutesmall = 0xf7b4; + t.Acyrillic = 0x0410; + t.Adblgrave = 0x0200; + t.Adieresis = 0x00c4; + t.Adieresiscyrillic = 0x04d2; + t.Adieresismacron = 0x01de; + t.Adieresissmall = 0xf7e4; + t.Adotbelow = 0x1ea0; + t.Adotmacron = 0x01e0; + t.Agrave = 0x00c0; + t.Agravesmall = 0xf7e0; + t.Ahookabove = 0x1ea2; + t.Aiecyrillic = 0x04d4; + t.Ainvertedbreve = 0x0202; + t.Alpha = 0x0391; + t.Alphatonos = 0x0386; + t.Amacron = 0x0100; + t.Amonospace = 0xff21; + t.Aogonek = 0x0104; + t.Aring = 0x00c5; + t.Aringacute = 0x01fa; + t.Aringbelow = 0x1e00; + t.Aringsmall = 0xf7e5; + t.Asmall = 0xf761; + t.Atilde = 0x00c3; + t.Atildesmall = 0xf7e3; + t.Aybarmenian = 0x0531; + t.B = 0x0042; + t.Bcircle = 0x24b7; + t.Bdotaccent = 0x1e02; + t.Bdotbelow = 0x1e04; + t.Becyrillic = 0x0411; + t.Benarmenian = 0x0532; + t.Beta = 0x0392; + t.Bhook = 0x0181; + t.Blinebelow = 0x1e06; + t.Bmonospace = 0xff22; + t.Brevesmall = 0xf6f4; + t.Bsmall = 0xf762; + t.Btopbar = 0x0182; + t.C = 0x0043; + t.Caarmenian = 0x053e; + t.Cacute = 0x0106; + t.Caron = 0xf6ca; + t.Caronsmall = 0xf6f5; + t.Ccaron = 0x010c; + t.Ccedilla = 0x00c7; + t.Ccedillaacute = 0x1e08; + t.Ccedillasmall = 0xf7e7; + t.Ccircle = 0x24b8; + t.Ccircumflex = 0x0108; + t.Cdot = 0x010a; + t.Cdotaccent = 0x010a; + t.Cedillasmall = 0xf7b8; + t.Chaarmenian = 0x0549; + t.Cheabkhasiancyrillic = 0x04bc; + t.Checyrillic = 0x0427; + t.Chedescenderabkhasiancyrillic = 0x04be; + t.Chedescendercyrillic = 0x04b6; + t.Chedieresiscyrillic = 0x04f4; + t.Cheharmenian = 0x0543; + t.Chekhakassiancyrillic = 0x04cb; + t.Cheverticalstrokecyrillic = 0x04b8; + t.Chi = 0x03a7; + t.Chook = 0x0187; + t.Circumflexsmall = 0xf6f6; + t.Cmonospace = 0xff23; + t.Coarmenian = 0x0551; + t.Csmall = 0xf763; + t.D = 0x0044; + t.DZ = 0x01f1; + t.DZcaron = 0x01c4; + t.Daarmenian = 0x0534; + t.Dafrican = 0x0189; + t.Dcaron = 0x010e; + t.Dcedilla = 0x1e10; + t.Dcircle = 0x24b9; + t.Dcircumflexbelow = 0x1e12; + t.Dcroat = 0x0110; + t.Ddotaccent = 0x1e0a; + t.Ddotbelow = 0x1e0c; + t.Decyrillic = 0x0414; + t.Deicoptic = 0x03ee; + t.Delta = 0x2206; + t.Deltagreek = 0x0394; + t.Dhook = 0x018a; + t.Dieresis = 0xf6cb; + t.DieresisAcute = 0xf6cc; + t.DieresisGrave = 0xf6cd; + t.Dieresissmall = 0xf7a8; + t.Digammagreek = 0x03dc; + t.Djecyrillic = 0x0402; + t.Dlinebelow = 0x1e0e; + t.Dmonospace = 0xff24; + t.Dotaccentsmall = 0xf6f7; + t.Dslash = 0x0110; + t.Dsmall = 0xf764; + t.Dtopbar = 0x018b; + t.Dz = 0x01f2; + t.Dzcaron = 0x01c5; + t.Dzeabkhasiancyrillic = 0x04e0; + t.Dzecyrillic = 0x0405; + t.Dzhecyrillic = 0x040f; + t.E = 0x0045; + t.Eacute = 0x00c9; + t.Eacutesmall = 0xf7e9; + t.Ebreve = 0x0114; + t.Ecaron = 0x011a; + t.Ecedillabreve = 0x1e1c; + t.Echarmenian = 0x0535; + t.Ecircle = 0x24ba; + t.Ecircumflex = 0x00ca; + t.Ecircumflexacute = 0x1ebe; + t.Ecircumflexbelow = 0x1e18; + t.Ecircumflexdotbelow = 0x1ec6; + t.Ecircumflexgrave = 0x1ec0; + t.Ecircumflexhookabove = 0x1ec2; + t.Ecircumflexsmall = 0xf7ea; + t.Ecircumflextilde = 0x1ec4; + t.Ecyrillic = 0x0404; + t.Edblgrave = 0x0204; + t.Edieresis = 0x00cb; + t.Edieresissmall = 0xf7eb; + t.Edot = 0x0116; + t.Edotaccent = 0x0116; + t.Edotbelow = 0x1eb8; + t.Efcyrillic = 0x0424; + t.Egrave = 0x00c8; + t.Egravesmall = 0xf7e8; + t.Eharmenian = 0x0537; + t.Ehookabove = 0x1eba; + t.Eightroman = 0x2167; + t.Einvertedbreve = 0x0206; + t.Eiotifiedcyrillic = 0x0464; + t.Elcyrillic = 0x041b; + t.Elevenroman = 0x216a; + t.Emacron = 0x0112; + t.Emacronacute = 0x1e16; + t.Emacrongrave = 0x1e14; + t.Emcyrillic = 0x041c; + t.Emonospace = 0xff25; + t.Encyrillic = 0x041d; + t.Endescendercyrillic = 0x04a2; + t.Eng = 0x014a; + t.Enghecyrillic = 0x04a4; + t.Enhookcyrillic = 0x04c7; + t.Eogonek = 0x0118; + t.Eopen = 0x0190; + t.Epsilon = 0x0395; + t.Epsilontonos = 0x0388; + t.Ercyrillic = 0x0420; + t.Ereversed = 0x018e; + t.Ereversedcyrillic = 0x042d; + t.Escyrillic = 0x0421; + t.Esdescendercyrillic = 0x04aa; + t.Esh = 0x01a9; + t.Esmall = 0xf765; + t.Eta = 0x0397; + t.Etarmenian = 0x0538; + t.Etatonos = 0x0389; + t.Eth = 0x00d0; + t.Ethsmall = 0xf7f0; + t.Etilde = 0x1ebc; + t.Etildebelow = 0x1e1a; + t.Euro = 0x20ac; + t.Ezh = 0x01b7; + t.Ezhcaron = 0x01ee; + t.Ezhreversed = 0x01b8; + t.F = 0x0046; + t.Fcircle = 0x24bb; + t.Fdotaccent = 0x1e1e; + t.Feharmenian = 0x0556; + t.Feicoptic = 0x03e4; + t.Fhook = 0x0191; + t.Fitacyrillic = 0x0472; + t.Fiveroman = 0x2164; + t.Fmonospace = 0xff26; + t.Fourroman = 0x2163; + t.Fsmall = 0xf766; + t.G = 0x0047; + t.GBsquare = 0x3387; + t.Gacute = 0x01f4; + t.Gamma = 0x0393; + t.Gammaafrican = 0x0194; + t.Gangiacoptic = 0x03ea; + t.Gbreve = 0x011e; + t.Gcaron = 0x01e6; + t.Gcedilla = 0x0122; + t.Gcircle = 0x24bc; + t.Gcircumflex = 0x011c; + t.Gcommaaccent = 0x0122; + t.Gdot = 0x0120; + t.Gdotaccent = 0x0120; + t.Gecyrillic = 0x0413; + t.Ghadarmenian = 0x0542; + t.Ghemiddlehookcyrillic = 0x0494; + t.Ghestrokecyrillic = 0x0492; + t.Gheupturncyrillic = 0x0490; + t.Ghook = 0x0193; + t.Gimarmenian = 0x0533; + t.Gjecyrillic = 0x0403; + t.Gmacron = 0x1e20; + t.Gmonospace = 0xff27; + t.Grave = 0xf6ce; + t.Gravesmall = 0xf760; + t.Gsmall = 0xf767; + t.Gsmallhook = 0x029b; + t.Gstroke = 0x01e4; + t.H = 0x0048; + t.H18533 = 0x25cf; + t.H18543 = 0x25aa; + t.H18551 = 0x25ab; + t.H22073 = 0x25a1; + t.HPsquare = 0x33cb; + t.Haabkhasiancyrillic = 0x04a8; + t.Hadescendercyrillic = 0x04b2; + t.Hardsigncyrillic = 0x042a; + t.Hbar = 0x0126; + t.Hbrevebelow = 0x1e2a; + t.Hcedilla = 0x1e28; + t.Hcircle = 0x24bd; + t.Hcircumflex = 0x0124; + t.Hdieresis = 0x1e26; + t.Hdotaccent = 0x1e22; + t.Hdotbelow = 0x1e24; + t.Hmonospace = 0xff28; + t.Hoarmenian = 0x0540; + t.Horicoptic = 0x03e8; + t.Hsmall = 0xf768; + t.Hungarumlaut = 0xf6cf; + t.Hungarumlautsmall = 0xf6f8; + t.Hzsquare = 0x3390; + t.I = 0x0049; + t.IAcyrillic = 0x042f; + t.IJ = 0x0132; + t.IUcyrillic = 0x042e; + t.Iacute = 0x00cd; + t.Iacutesmall = 0xf7ed; + t.Ibreve = 0x012c; + t.Icaron = 0x01cf; + t.Icircle = 0x24be; + t.Icircumflex = 0x00ce; + t.Icircumflexsmall = 0xf7ee; + t.Icyrillic = 0x0406; + t.Idblgrave = 0x0208; + t.Idieresis = 0x00cf; + t.Idieresisacute = 0x1e2e; + t.Idieresiscyrillic = 0x04e4; + t.Idieresissmall = 0xf7ef; + t.Idot = 0x0130; + t.Idotaccent = 0x0130; + t.Idotbelow = 0x1eca; + t.Iebrevecyrillic = 0x04d6; + t.Iecyrillic = 0x0415; + t.Ifraktur = 0x2111; + t.Igrave = 0x00cc; + t.Igravesmall = 0xf7ec; + t.Ihookabove = 0x1ec8; + t.Iicyrillic = 0x0418; + t.Iinvertedbreve = 0x020a; + t.Iishortcyrillic = 0x0419; + t.Imacron = 0x012a; + t.Imacroncyrillic = 0x04e2; + t.Imonospace = 0xff29; + t.Iniarmenian = 0x053b; + t.Iocyrillic = 0x0401; + t.Iogonek = 0x012e; + t.Iota = 0x0399; + t.Iotaafrican = 0x0196; + t.Iotadieresis = 0x03aa; + t.Iotatonos = 0x038a; + t.Ismall = 0xf769; + t.Istroke = 0x0197; + t.Itilde = 0x0128; + t.Itildebelow = 0x1e2c; + t.Izhitsacyrillic = 0x0474; + t.Izhitsadblgravecyrillic = 0x0476; + t.J = 0x004a; + t.Jaarmenian = 0x0541; + t.Jcircle = 0x24bf; + t.Jcircumflex = 0x0134; + t.Jecyrillic = 0x0408; + t.Jheharmenian = 0x054b; + t.Jmonospace = 0xff2a; + t.Jsmall = 0xf76a; + t.K = 0x004b; + t.KBsquare = 0x3385; + t.KKsquare = 0x33cd; + t.Kabashkircyrillic = 0x04a0; + t.Kacute = 0x1e30; + t.Kacyrillic = 0x041a; + t.Kadescendercyrillic = 0x049a; + t.Kahookcyrillic = 0x04c3; + t.Kappa = 0x039a; + t.Kastrokecyrillic = 0x049e; + t.Kaverticalstrokecyrillic = 0x049c; + t.Kcaron = 0x01e8; + t.Kcedilla = 0x0136; + t.Kcircle = 0x24c0; + t.Kcommaaccent = 0x0136; + t.Kdotbelow = 0x1e32; + t.Keharmenian = 0x0554; + t.Kenarmenian = 0x053f; + t.Khacyrillic = 0x0425; + t.Kheicoptic = 0x03e6; + t.Khook = 0x0198; + t.Kjecyrillic = 0x040c; + t.Klinebelow = 0x1e34; + t.Kmonospace = 0xff2b; + t.Koppacyrillic = 0x0480; + t.Koppagreek = 0x03de; + t.Ksicyrillic = 0x046e; + t.Ksmall = 0xf76b; + t.L = 0x004c; + t.LJ = 0x01c7; + t.LL = 0xf6bf; + t.Lacute = 0x0139; + t.Lambda = 0x039b; + t.Lcaron = 0x013d; + t.Lcedilla = 0x013b; + t.Lcircle = 0x24c1; + t.Lcircumflexbelow = 0x1e3c; + t.Lcommaaccent = 0x013b; + t.Ldot = 0x013f; + t.Ldotaccent = 0x013f; + t.Ldotbelow = 0x1e36; + t.Ldotbelowmacron = 0x1e38; + t.Liwnarmenian = 0x053c; + t.Lj = 0x01c8; + t.Ljecyrillic = 0x0409; + t.Llinebelow = 0x1e3a; + t.Lmonospace = 0xff2c; + t.Lslash = 0x0141; + t.Lslashsmall = 0xf6f9; + t.Lsmall = 0xf76c; + t.M = 0x004d; + t.MBsquare = 0x3386; + t.Macron = 0xf6d0; + t.Macronsmall = 0xf7af; + t.Macute = 0x1e3e; + t.Mcircle = 0x24c2; + t.Mdotaccent = 0x1e40; + t.Mdotbelow = 0x1e42; + t.Menarmenian = 0x0544; + t.Mmonospace = 0xff2d; + t.Msmall = 0xf76d; + t.Mturned = 0x019c; + t.Mu = 0x039c; + t.N = 0x004e; + t.NJ = 0x01ca; + t.Nacute = 0x0143; + t.Ncaron = 0x0147; + t.Ncedilla = 0x0145; + t.Ncircle = 0x24c3; + t.Ncircumflexbelow = 0x1e4a; + t.Ncommaaccent = 0x0145; + t.Ndotaccent = 0x1e44; + t.Ndotbelow = 0x1e46; + t.Nhookleft = 0x019d; + t.Nineroman = 0x2168; + t.Nj = 0x01cb; + t.Njecyrillic = 0x040a; + t.Nlinebelow = 0x1e48; + t.Nmonospace = 0xff2e; + t.Nowarmenian = 0x0546; + t.Nsmall = 0xf76e; + t.Ntilde = 0x00d1; + t.Ntildesmall = 0xf7f1; + t.Nu = 0x039d; + t.O = 0x004f; + t.OE = 0x0152; + t.OEsmall = 0xf6fa; + t.Oacute = 0x00d3; + t.Oacutesmall = 0xf7f3; + t.Obarredcyrillic = 0x04e8; + t.Obarreddieresiscyrillic = 0x04ea; + t.Obreve = 0x014e; + t.Ocaron = 0x01d1; + t.Ocenteredtilde = 0x019f; + t.Ocircle = 0x24c4; + t.Ocircumflex = 0x00d4; + t.Ocircumflexacute = 0x1ed0; + t.Ocircumflexdotbelow = 0x1ed8; + t.Ocircumflexgrave = 0x1ed2; + t.Ocircumflexhookabove = 0x1ed4; + t.Ocircumflexsmall = 0xf7f4; + t.Ocircumflextilde = 0x1ed6; + t.Ocyrillic = 0x041e; + t.Odblacute = 0x0150; + t.Odblgrave = 0x020c; + t.Odieresis = 0x00d6; + t.Odieresiscyrillic = 0x04e6; + t.Odieresissmall = 0xf7f6; + t.Odotbelow = 0x1ecc; + t.Ogoneksmall = 0xf6fb; + t.Ograve = 0x00d2; + t.Ogravesmall = 0xf7f2; + t.Oharmenian = 0x0555; + t.Ohm = 0x2126; + t.Ohookabove = 0x1ece; + t.Ohorn = 0x01a0; + t.Ohornacute = 0x1eda; + t.Ohorndotbelow = 0x1ee2; + t.Ohorngrave = 0x1edc; + t.Ohornhookabove = 0x1ede; + t.Ohorntilde = 0x1ee0; + t.Ohungarumlaut = 0x0150; + t.Oi = 0x01a2; + t.Oinvertedbreve = 0x020e; + t.Omacron = 0x014c; + t.Omacronacute = 0x1e52; + t.Omacrongrave = 0x1e50; + t.Omega = 0x2126; + t.Omegacyrillic = 0x0460; + t.Omegagreek = 0x03a9; + t.Omegaroundcyrillic = 0x047a; + t.Omegatitlocyrillic = 0x047c; + t.Omegatonos = 0x038f; + t.Omicron = 0x039f; + t.Omicrontonos = 0x038c; + t.Omonospace = 0xff2f; + t.Oneroman = 0x2160; + t.Oogonek = 0x01ea; + t.Oogonekmacron = 0x01ec; + t.Oopen = 0x0186; + t.Oslash = 0x00d8; + t.Oslashacute = 0x01fe; + t.Oslashsmall = 0xf7f8; + t.Osmall = 0xf76f; + t.Ostrokeacute = 0x01fe; + t.Otcyrillic = 0x047e; + t.Otilde = 0x00d5; + t.Otildeacute = 0x1e4c; + t.Otildedieresis = 0x1e4e; + t.Otildesmall = 0xf7f5; + t.P = 0x0050; + t.Pacute = 0x1e54; + t.Pcircle = 0x24c5; + t.Pdotaccent = 0x1e56; + t.Pecyrillic = 0x041f; + t.Peharmenian = 0x054a; + t.Pemiddlehookcyrillic = 0x04a6; + t.Phi = 0x03a6; + t.Phook = 0x01a4; + t.Pi = 0x03a0; + t.Piwrarmenian = 0x0553; + t.Pmonospace = 0xff30; + t.Psi = 0x03a8; + t.Psicyrillic = 0x0470; + t.Psmall = 0xf770; + t.Q = 0x0051; + t.Qcircle = 0x24c6; + t.Qmonospace = 0xff31; + t.Qsmall = 0xf771; + t.R = 0x0052; + t.Raarmenian = 0x054c; + t.Racute = 0x0154; + t.Rcaron = 0x0158; + t.Rcedilla = 0x0156; + t.Rcircle = 0x24c7; + t.Rcommaaccent = 0x0156; + t.Rdblgrave = 0x0210; + t.Rdotaccent = 0x1e58; + t.Rdotbelow = 0x1e5a; + t.Rdotbelowmacron = 0x1e5c; + t.Reharmenian = 0x0550; + t.Rfraktur = 0x211c; + t.Rho = 0x03a1; + t.Ringsmall = 0xf6fc; + t.Rinvertedbreve = 0x0212; + t.Rlinebelow = 0x1e5e; + t.Rmonospace = 0xff32; + t.Rsmall = 0xf772; + t.Rsmallinverted = 0x0281; + t.Rsmallinvertedsuperior = 0x02b6; + t.S = 0x0053; + t.SF010000 = 0x250c; + t.SF020000 = 0x2514; + t.SF030000 = 0x2510; + t.SF040000 = 0x2518; + t.SF050000 = 0x253c; + t.SF060000 = 0x252c; + t.SF070000 = 0x2534; + t.SF080000 = 0x251c; + t.SF090000 = 0x2524; + t.SF100000 = 0x2500; + t.SF110000 = 0x2502; + t.SF190000 = 0x2561; + t.SF200000 = 0x2562; + t.SF210000 = 0x2556; + t.SF220000 = 0x2555; + t.SF230000 = 0x2563; + t.SF240000 = 0x2551; + t.SF250000 = 0x2557; + t.SF260000 = 0x255d; + t.SF270000 = 0x255c; + t.SF280000 = 0x255b; + t.SF360000 = 0x255e; + t.SF370000 = 0x255f; + t.SF380000 = 0x255a; + t.SF390000 = 0x2554; + t.SF400000 = 0x2569; + t.SF410000 = 0x2566; + t.SF420000 = 0x2560; + t.SF430000 = 0x2550; + t.SF440000 = 0x256c; + t.SF450000 = 0x2567; + t.SF460000 = 0x2568; + t.SF470000 = 0x2564; + t.SF480000 = 0x2565; + t.SF490000 = 0x2559; + t.SF500000 = 0x2558; + t.SF510000 = 0x2552; + t.SF520000 = 0x2553; + t.SF530000 = 0x256b; + t.SF540000 = 0x256a; + t.Sacute = 0x015a; + t.Sacutedotaccent = 0x1e64; + t.Sampigreek = 0x03e0; + t.Scaron = 0x0160; + t.Scarondotaccent = 0x1e66; + t.Scaronsmall = 0xf6fd; + t.Scedilla = 0x015e; + t.Schwa = 0x018f; + t.Schwacyrillic = 0x04d8; + t.Schwadieresiscyrillic = 0x04da; + t.Scircle = 0x24c8; + t.Scircumflex = 0x015c; + t.Scommaaccent = 0x0218; + t.Sdotaccent = 0x1e60; + t.Sdotbelow = 0x1e62; + t.Sdotbelowdotaccent = 0x1e68; + t.Seharmenian = 0x054d; + t.Sevenroman = 0x2166; + t.Shaarmenian = 0x0547; + t.Shacyrillic = 0x0428; + t.Shchacyrillic = 0x0429; + t.Sheicoptic = 0x03e2; + t.Shhacyrillic = 0x04ba; + t.Shimacoptic = 0x03ec; + t.Sigma = 0x03a3; + t.Sixroman = 0x2165; + t.Smonospace = 0xff33; + t.Softsigncyrillic = 0x042c; + t.Ssmall = 0xf773; + t.Stigmagreek = 0x03da; + t.T = 0x0054; + t.Tau = 0x03a4; + t.Tbar = 0x0166; + t.Tcaron = 0x0164; + t.Tcedilla = 0x0162; + t.Tcircle = 0x24c9; + t.Tcircumflexbelow = 0x1e70; + t.Tcommaaccent = 0x0162; + t.Tdotaccent = 0x1e6a; + t.Tdotbelow = 0x1e6c; + t.Tecyrillic = 0x0422; + t.Tedescendercyrillic = 0x04ac; + t.Tenroman = 0x2169; + t.Tetsecyrillic = 0x04b4; + t.Theta = 0x0398; + t.Thook = 0x01ac; + t.Thorn = 0x00de; + t.Thornsmall = 0xf7fe; + t.Threeroman = 0x2162; + t.Tildesmall = 0xf6fe; + t.Tiwnarmenian = 0x054f; + t.Tlinebelow = 0x1e6e; + t.Tmonospace = 0xff34; + t.Toarmenian = 0x0539; + t.Tonefive = 0x01bc; + t.Tonesix = 0x0184; + t.Tonetwo = 0x01a7; + t.Tretroflexhook = 0x01ae; + t.Tsecyrillic = 0x0426; + t.Tshecyrillic = 0x040b; + t.Tsmall = 0xf774; + t.Twelveroman = 0x216b; + t.Tworoman = 0x2161; + t.U = 0x0055; + t.Uacute = 0x00da; + t.Uacutesmall = 0xf7fa; + t.Ubreve = 0x016c; + t.Ucaron = 0x01d3; + t.Ucircle = 0x24ca; + t.Ucircumflex = 0x00db; + t.Ucircumflexbelow = 0x1e76; + t.Ucircumflexsmall = 0xf7fb; + t.Ucyrillic = 0x0423; + t.Udblacute = 0x0170; + t.Udblgrave = 0x0214; + t.Udieresis = 0x00dc; + t.Udieresisacute = 0x01d7; + t.Udieresisbelow = 0x1e72; + t.Udieresiscaron = 0x01d9; + t.Udieresiscyrillic = 0x04f0; + t.Udieresisgrave = 0x01db; + t.Udieresismacron = 0x01d5; + t.Udieresissmall = 0xf7fc; + t.Udotbelow = 0x1ee4; + t.Ugrave = 0x00d9; + t.Ugravesmall = 0xf7f9; + t.Uhookabove = 0x1ee6; + t.Uhorn = 0x01af; + t.Uhornacute = 0x1ee8; + t.Uhorndotbelow = 0x1ef0; + t.Uhorngrave = 0x1eea; + t.Uhornhookabove = 0x1eec; + t.Uhorntilde = 0x1eee; + t.Uhungarumlaut = 0x0170; + t.Uhungarumlautcyrillic = 0x04f2; + t.Uinvertedbreve = 0x0216; + t.Ukcyrillic = 0x0478; + t.Umacron = 0x016a; + t.Umacroncyrillic = 0x04ee; + t.Umacrondieresis = 0x1e7a; + t.Umonospace = 0xff35; + t.Uogonek = 0x0172; + t.Upsilon = 0x03a5; + t.Upsilon1 = 0x03d2; + t.Upsilonacutehooksymbolgreek = 0x03d3; + t.Upsilonafrican = 0x01b1; + t.Upsilondieresis = 0x03ab; + t.Upsilondieresishooksymbolgreek = 0x03d4; + t.Upsilonhooksymbol = 0x03d2; + t.Upsilontonos = 0x038e; + t.Uring = 0x016e; + t.Ushortcyrillic = 0x040e; + t.Usmall = 0xf775; + t.Ustraightcyrillic = 0x04ae; + t.Ustraightstrokecyrillic = 0x04b0; + t.Utilde = 0x0168; + t.Utildeacute = 0x1e78; + t.Utildebelow = 0x1e74; + t.V = 0x0056; + t.Vcircle = 0x24cb; + t.Vdotbelow = 0x1e7e; + t.Vecyrillic = 0x0412; + t.Vewarmenian = 0x054e; + t.Vhook = 0x01b2; + t.Vmonospace = 0xff36; + t.Voarmenian = 0x0548; + t.Vsmall = 0xf776; + t.Vtilde = 0x1e7c; + t.W = 0x0057; + t.Wacute = 0x1e82; + t.Wcircle = 0x24cc; + t.Wcircumflex = 0x0174; + t.Wdieresis = 0x1e84; + t.Wdotaccent = 0x1e86; + t.Wdotbelow = 0x1e88; + t.Wgrave = 0x1e80; + t.Wmonospace = 0xff37; + t.Wsmall = 0xf777; + t.X = 0x0058; + t.Xcircle = 0x24cd; + t.Xdieresis = 0x1e8c; + t.Xdotaccent = 0x1e8a; + t.Xeharmenian = 0x053d; + t.Xi = 0x039e; + t.Xmonospace = 0xff38; + t.Xsmall = 0xf778; + t.Y = 0x0059; + t.Yacute = 0x00dd; + t.Yacutesmall = 0xf7fd; + t.Yatcyrillic = 0x0462; + t.Ycircle = 0x24ce; + t.Ycircumflex = 0x0176; + t.Ydieresis = 0x0178; + t.Ydieresissmall = 0xf7ff; + t.Ydotaccent = 0x1e8e; + t.Ydotbelow = 0x1ef4; + t.Yericyrillic = 0x042b; + t.Yerudieresiscyrillic = 0x04f8; + t.Ygrave = 0x1ef2; + t.Yhook = 0x01b3; + t.Yhookabove = 0x1ef6; + t.Yiarmenian = 0x0545; + t.Yicyrillic = 0x0407; + t.Yiwnarmenian = 0x0552; + t.Ymonospace = 0xff39; + t.Ysmall = 0xf779; + t.Ytilde = 0x1ef8; + t.Yusbigcyrillic = 0x046a; + t.Yusbigiotifiedcyrillic = 0x046c; + t.Yuslittlecyrillic = 0x0466; + t.Yuslittleiotifiedcyrillic = 0x0468; + t.Z = 0x005a; + t.Zaarmenian = 0x0536; + t.Zacute = 0x0179; + t.Zcaron = 0x017d; + t.Zcaronsmall = 0xf6ff; + t.Zcircle = 0x24cf; + t.Zcircumflex = 0x1e90; + t.Zdot = 0x017b; + t.Zdotaccent = 0x017b; + t.Zdotbelow = 0x1e92; + t.Zecyrillic = 0x0417; + t.Zedescendercyrillic = 0x0498; + t.Zedieresiscyrillic = 0x04de; + t.Zeta = 0x0396; + t.Zhearmenian = 0x053a; + t.Zhebrevecyrillic = 0x04c1; + t.Zhecyrillic = 0x0416; + t.Zhedescendercyrillic = 0x0496; + t.Zhedieresiscyrillic = 0x04dc; + t.Zlinebelow = 0x1e94; + t.Zmonospace = 0xff3a; + t.Zsmall = 0xf77a; + t.Zstroke = 0x01b5; + t.a = 0x0061; + t.aabengali = 0x0986; + t.aacute = 0x00e1; + t.aadeva = 0x0906; + t.aagujarati = 0x0a86; + t.aagurmukhi = 0x0a06; + t.aamatragurmukhi = 0x0a3e; + t.aarusquare = 0x3303; + t.aavowelsignbengali = 0x09be; + t.aavowelsigndeva = 0x093e; + t.aavowelsigngujarati = 0x0abe; + t.abbreviationmarkarmenian = 0x055f; + t.abbreviationsigndeva = 0x0970; + t.abengali = 0x0985; + t.abopomofo = 0x311a; + t.abreve = 0x0103; + t.abreveacute = 0x1eaf; + t.abrevecyrillic = 0x04d1; + t.abrevedotbelow = 0x1eb7; + t.abrevegrave = 0x1eb1; + t.abrevehookabove = 0x1eb3; + t.abrevetilde = 0x1eb5; + t.acaron = 0x01ce; + t.acircle = 0x24d0; + t.acircumflex = 0x00e2; + t.acircumflexacute = 0x1ea5; + t.acircumflexdotbelow = 0x1ead; + t.acircumflexgrave = 0x1ea7; + t.acircumflexhookabove = 0x1ea9; + t.acircumflextilde = 0x1eab; + t.acute = 0x00b4; + t.acutebelowcmb = 0x0317; + t.acutecmb = 0x0301; + t.acutecomb = 0x0301; + t.acutedeva = 0x0954; + t.acutelowmod = 0x02cf; + t.acutetonecmb = 0x0341; + t.acyrillic = 0x0430; + t.adblgrave = 0x0201; + t.addakgurmukhi = 0x0a71; + t.adeva = 0x0905; + t.adieresis = 0x00e4; + t.adieresiscyrillic = 0x04d3; + t.adieresismacron = 0x01df; + t.adotbelow = 0x1ea1; + t.adotmacron = 0x01e1; + t.ae = 0x00e6; + t.aeacute = 0x01fd; + t.aekorean = 0x3150; + t.aemacron = 0x01e3; + t.afii00208 = 0x2015; + t.afii08941 = 0x20a4; + t.afii10017 = 0x0410; + t.afii10018 = 0x0411; + t.afii10019 = 0x0412; + t.afii10020 = 0x0413; + t.afii10021 = 0x0414; + t.afii10022 = 0x0415; + t.afii10023 = 0x0401; + t.afii10024 = 0x0416; + t.afii10025 = 0x0417; + t.afii10026 = 0x0418; + t.afii10027 = 0x0419; + t.afii10028 = 0x041a; + t.afii10029 = 0x041b; + t.afii10030 = 0x041c; + t.afii10031 = 0x041d; + t.afii10032 = 0x041e; + t.afii10033 = 0x041f; + t.afii10034 = 0x0420; + t.afii10035 = 0x0421; + t.afii10036 = 0x0422; + t.afii10037 = 0x0423; + t.afii10038 = 0x0424; + t.afii10039 = 0x0425; + t.afii10040 = 0x0426; + t.afii10041 = 0x0427; + t.afii10042 = 0x0428; + t.afii10043 = 0x0429; + t.afii10044 = 0x042a; + t.afii10045 = 0x042b; + t.afii10046 = 0x042c; + t.afii10047 = 0x042d; + t.afii10048 = 0x042e; + t.afii10049 = 0x042f; + t.afii10050 = 0x0490; + t.afii10051 = 0x0402; + t.afii10052 = 0x0403; + t.afii10053 = 0x0404; + t.afii10054 = 0x0405; + t.afii10055 = 0x0406; + t.afii10056 = 0x0407; + t.afii10057 = 0x0408; + t.afii10058 = 0x0409; + t.afii10059 = 0x040a; + t.afii10060 = 0x040b; + t.afii10061 = 0x040c; + t.afii10062 = 0x040e; + t.afii10063 = 0xf6c4; + t.afii10064 = 0xf6c5; + t.afii10065 = 0x0430; + t.afii10066 = 0x0431; + t.afii10067 = 0x0432; + t.afii10068 = 0x0433; + t.afii10069 = 0x0434; + t.afii10070 = 0x0435; + t.afii10071 = 0x0451; + t.afii10072 = 0x0436; + t.afii10073 = 0x0437; + t.afii10074 = 0x0438; + t.afii10075 = 0x0439; + t.afii10076 = 0x043a; + t.afii10077 = 0x043b; + t.afii10078 = 0x043c; + t.afii10079 = 0x043d; + t.afii10080 = 0x043e; + t.afii10081 = 0x043f; + t.afii10082 = 0x0440; + t.afii10083 = 0x0441; + t.afii10084 = 0x0442; + t.afii10085 = 0x0443; + t.afii10086 = 0x0444; + t.afii10087 = 0x0445; + t.afii10088 = 0x0446; + t.afii10089 = 0x0447; + t.afii10090 = 0x0448; + t.afii10091 = 0x0449; + t.afii10092 = 0x044a; + t.afii10093 = 0x044b; + t.afii10094 = 0x044c; + t.afii10095 = 0x044d; + t.afii10096 = 0x044e; + t.afii10097 = 0x044f; + t.afii10098 = 0x0491; + t.afii10099 = 0x0452; + t.afii10100 = 0x0453; + t.afii10101 = 0x0454; + t.afii10102 = 0x0455; + t.afii10103 = 0x0456; + t.afii10104 = 0x0457; + t.afii10105 = 0x0458; + t.afii10106 = 0x0459; + t.afii10107 = 0x045a; + t.afii10108 = 0x045b; + t.afii10109 = 0x045c; + t.afii10110 = 0x045e; + t.afii10145 = 0x040f; + t.afii10146 = 0x0462; + t.afii10147 = 0x0472; + t.afii10148 = 0x0474; + t.afii10192 = 0xf6c6; + t.afii10193 = 0x045f; + t.afii10194 = 0x0463; + t.afii10195 = 0x0473; + t.afii10196 = 0x0475; + t.afii10831 = 0xf6c7; + t.afii10832 = 0xf6c8; + t.afii10846 = 0x04d9; + t.afii299 = 0x200e; + t.afii300 = 0x200f; + t.afii301 = 0x200d; + t.afii57381 = 0x066a; + t.afii57388 = 0x060c; + t.afii57392 = 0x0660; + t.afii57393 = 0x0661; + t.afii57394 = 0x0662; + t.afii57395 = 0x0663; + t.afii57396 = 0x0664; + t.afii57397 = 0x0665; + t.afii57398 = 0x0666; + t.afii57399 = 0x0667; + t.afii57400 = 0x0668; + t.afii57401 = 0x0669; + t.afii57403 = 0x061b; + t.afii57407 = 0x061f; + t.afii57409 = 0x0621; + t.afii57410 = 0x0622; + t.afii57411 = 0x0623; + t.afii57412 = 0x0624; + t.afii57413 = 0x0625; + t.afii57414 = 0x0626; + t.afii57415 = 0x0627; + t.afii57416 = 0x0628; + t.afii57417 = 0x0629; + t.afii57418 = 0x062a; + t.afii57419 = 0x062b; + t.afii57420 = 0x062c; + t.afii57421 = 0x062d; + t.afii57422 = 0x062e; + t.afii57423 = 0x062f; + t.afii57424 = 0x0630; + t.afii57425 = 0x0631; + t.afii57426 = 0x0632; + t.afii57427 = 0x0633; + t.afii57428 = 0x0634; + t.afii57429 = 0x0635; + t.afii57430 = 0x0636; + t.afii57431 = 0x0637; + t.afii57432 = 0x0638; + t.afii57433 = 0x0639; + t.afii57434 = 0x063a; + t.afii57440 = 0x0640; + t.afii57441 = 0x0641; + t.afii57442 = 0x0642; + t.afii57443 = 0x0643; + t.afii57444 = 0x0644; + t.afii57445 = 0x0645; + t.afii57446 = 0x0646; + t.afii57448 = 0x0648; + t.afii57449 = 0x0649; + t.afii57450 = 0x064a; + t.afii57451 = 0x064b; + t.afii57452 = 0x064c; + t.afii57453 = 0x064d; + t.afii57454 = 0x064e; + t.afii57455 = 0x064f; + t.afii57456 = 0x0650; + t.afii57457 = 0x0651; + t.afii57458 = 0x0652; + t.afii57470 = 0x0647; + t.afii57505 = 0x06a4; + t.afii57506 = 0x067e; + t.afii57507 = 0x0686; + t.afii57508 = 0x0698; + t.afii57509 = 0x06af; + t.afii57511 = 0x0679; + t.afii57512 = 0x0688; + t.afii57513 = 0x0691; + t.afii57514 = 0x06ba; + t.afii57519 = 0x06d2; + t.afii57534 = 0x06d5; + t.afii57636 = 0x20aa; + t.afii57645 = 0x05be; + t.afii57658 = 0x05c3; + t.afii57664 = 0x05d0; + t.afii57665 = 0x05d1; + t.afii57666 = 0x05d2; + t.afii57667 = 0x05d3; + t.afii57668 = 0x05d4; + t.afii57669 = 0x05d5; + t.afii57670 = 0x05d6; + t.afii57671 = 0x05d7; + t.afii57672 = 0x05d8; + t.afii57673 = 0x05d9; + t.afii57674 = 0x05da; + t.afii57675 = 0x05db; + t.afii57676 = 0x05dc; + t.afii57677 = 0x05dd; + t.afii57678 = 0x05de; + t.afii57679 = 0x05df; + t.afii57680 = 0x05e0; + t.afii57681 = 0x05e1; + t.afii57682 = 0x05e2; + t.afii57683 = 0x05e3; + t.afii57684 = 0x05e4; + t.afii57685 = 0x05e5; + t.afii57686 = 0x05e6; + t.afii57687 = 0x05e7; + t.afii57688 = 0x05e8; + t.afii57689 = 0x05e9; + t.afii57690 = 0x05ea; + t.afii57694 = 0xfb2a; + t.afii57695 = 0xfb2b; + t.afii57700 = 0xfb4b; + t.afii57705 = 0xfb1f; + t.afii57716 = 0x05f0; + t.afii57717 = 0x05f1; + t.afii57718 = 0x05f2; + t.afii57723 = 0xfb35; + t.afii57793 = 0x05b4; + t.afii57794 = 0x05b5; + t.afii57795 = 0x05b6; + t.afii57796 = 0x05bb; + t.afii57797 = 0x05b8; + t.afii57798 = 0x05b7; + t.afii57799 = 0x05b0; + t.afii57800 = 0x05b2; + t.afii57801 = 0x05b1; + t.afii57802 = 0x05b3; + t.afii57803 = 0x05c2; + t.afii57804 = 0x05c1; + t.afii57806 = 0x05b9; + t.afii57807 = 0x05bc; + t.afii57839 = 0x05bd; + t.afii57841 = 0x05bf; + t.afii57842 = 0x05c0; + t.afii57929 = 0x02bc; + t.afii61248 = 0x2105; + t.afii61289 = 0x2113; + t.afii61352 = 0x2116; + t.afii61573 = 0x202c; + t.afii61574 = 0x202d; + t.afii61575 = 0x202e; + t.afii61664 = 0x200c; + t.afii63167 = 0x066d; + t.afii64937 = 0x02bd; + t.agrave = 0x00e0; + t.agujarati = 0x0a85; + t.agurmukhi = 0x0a05; + t.ahiragana = 0x3042; + t.ahookabove = 0x1ea3; + t.aibengali = 0x0990; + t.aibopomofo = 0x311e; + t.aideva = 0x0910; + t.aiecyrillic = 0x04d5; + t.aigujarati = 0x0a90; + t.aigurmukhi = 0x0a10; + t.aimatragurmukhi = 0x0a48; + t.ainarabic = 0x0639; + t.ainfinalarabic = 0xfeca; + t.aininitialarabic = 0xfecb; + t.ainmedialarabic = 0xfecc; + t.ainvertedbreve = 0x0203; + t.aivowelsignbengali = 0x09c8; + t.aivowelsigndeva = 0x0948; + t.aivowelsigngujarati = 0x0ac8; + t.akatakana = 0x30a2; + t.akatakanahalfwidth = 0xff71; + t.akorean = 0x314f; + t.alef = 0x05d0; + t.alefarabic = 0x0627; + t.alefdageshhebrew = 0xfb30; + t.aleffinalarabic = 0xfe8e; + t.alefhamzaabovearabic = 0x0623; + t.alefhamzaabovefinalarabic = 0xfe84; + t.alefhamzabelowarabic = 0x0625; + t.alefhamzabelowfinalarabic = 0xfe88; + t.alefhebrew = 0x05d0; + t.aleflamedhebrew = 0xfb4f; + t.alefmaddaabovearabic = 0x0622; + t.alefmaddaabovefinalarabic = 0xfe82; + t.alefmaksuraarabic = 0x0649; + t.alefmaksurafinalarabic = 0xfef0; + t.alefmaksurainitialarabic = 0xfef3; + t.alefmaksuramedialarabic = 0xfef4; + t.alefpatahhebrew = 0xfb2e; + t.alefqamatshebrew = 0xfb2f; + t.aleph = 0x2135; + t.allequal = 0x224c; + t.alpha = 0x03b1; + t.alphatonos = 0x03ac; + t.amacron = 0x0101; + t.amonospace = 0xff41; + t.ampersand = 0x0026; + t.ampersandmonospace = 0xff06; + t.ampersandsmall = 0xf726; + t.amsquare = 0x33c2; + t.anbopomofo = 0x3122; + t.angbopomofo = 0x3124; + t.angbracketleft = 0x3008; + t.angbracketright = 0x3009; + t.angkhankhuthai = 0x0e5a; + t.angle = 0x2220; + t.anglebracketleft = 0x3008; + t.anglebracketleftvertical = 0xfe3f; + t.anglebracketright = 0x3009; + t.anglebracketrightvertical = 0xfe40; + t.angleleft = 0x2329; + t.angleright = 0x232a; + t.angstrom = 0x212b; + t.anoteleia = 0x0387; + t.anudattadeva = 0x0952; + t.anusvarabengali = 0x0982; + t.anusvaradeva = 0x0902; + t.anusvaragujarati = 0x0a82; + t.aogonek = 0x0105; + t.apaatosquare = 0x3300; + t.aparen = 0x249c; + t.apostrophearmenian = 0x055a; + t.apostrophemod = 0x02bc; + t.apple = 0xf8ff; + t.approaches = 0x2250; + t.approxequal = 0x2248; + t.approxequalorimage = 0x2252; + t.approximatelyequal = 0x2245; + t.araeaekorean = 0x318e; + t.araeakorean = 0x318d; + t.arc = 0x2312; + t.arighthalfring = 0x1e9a; + t.aring = 0x00e5; + t.aringacute = 0x01fb; + t.aringbelow = 0x1e01; + t.arrowboth = 0x2194; + t.arrowdashdown = 0x21e3; + t.arrowdashleft = 0x21e0; + t.arrowdashright = 0x21e2; + t.arrowdashup = 0x21e1; + t.arrowdblboth = 0x21d4; + t.arrowdbldown = 0x21d3; + t.arrowdblleft = 0x21d0; + t.arrowdblright = 0x21d2; + t.arrowdblup = 0x21d1; + t.arrowdown = 0x2193; + t.arrowdownleft = 0x2199; + t.arrowdownright = 0x2198; + t.arrowdownwhite = 0x21e9; + t.arrowheaddownmod = 0x02c5; + t.arrowheadleftmod = 0x02c2; + t.arrowheadrightmod = 0x02c3; + t.arrowheadupmod = 0x02c4; + t.arrowhorizex = 0xf8e7; + t.arrowleft = 0x2190; + t.arrowleftdbl = 0x21d0; + t.arrowleftdblstroke = 0x21cd; + t.arrowleftoverright = 0x21c6; + t.arrowleftwhite = 0x21e6; + t.arrowright = 0x2192; + t.arrowrightdblstroke = 0x21cf; + t.arrowrightheavy = 0x279e; + t.arrowrightoverleft = 0x21c4; + t.arrowrightwhite = 0x21e8; + t.arrowtableft = 0x21e4; + t.arrowtabright = 0x21e5; + t.arrowup = 0x2191; + t.arrowupdn = 0x2195; + t.arrowupdnbse = 0x21a8; + t.arrowupdownbase = 0x21a8; + t.arrowupleft = 0x2196; + t.arrowupleftofdown = 0x21c5; + t.arrowupright = 0x2197; + t.arrowupwhite = 0x21e7; + t.arrowvertex = 0xf8e6; + t.asciicircum = 0x005e; + t.asciicircummonospace = 0xff3e; + t.asciitilde = 0x007e; + t.asciitildemonospace = 0xff5e; + t.ascript = 0x0251; + t.ascriptturned = 0x0252; + t.asmallhiragana = 0x3041; + t.asmallkatakana = 0x30a1; + t.asmallkatakanahalfwidth = 0xff67; + t.asterisk = 0x002a; + t.asteriskaltonearabic = 0x066d; + t.asteriskarabic = 0x066d; + t.asteriskmath = 0x2217; + t.asteriskmonospace = 0xff0a; + t.asterisksmall = 0xfe61; + t.asterism = 0x2042; + t.asuperior = 0xf6e9; + t.asymptoticallyequal = 0x2243; + t.at = 0x0040; + t.atilde = 0x00e3; + t.atmonospace = 0xff20; + t.atsmall = 0xfe6b; + t.aturned = 0x0250; + t.aubengali = 0x0994; + t.aubopomofo = 0x3120; + t.audeva = 0x0914; + t.augujarati = 0x0a94; + t.augurmukhi = 0x0a14; + t.aulengthmarkbengali = 0x09d7; + t.aumatragurmukhi = 0x0a4c; + t.auvowelsignbengali = 0x09cc; + t.auvowelsigndeva = 0x094c; + t.auvowelsigngujarati = 0x0acc; + t.avagrahadeva = 0x093d; + t.aybarmenian = 0x0561; + t.ayin = 0x05e2; + t.ayinaltonehebrew = 0xfb20; + t.ayinhebrew = 0x05e2; + t.b = 0x0062; + t.babengali = 0x09ac; + t.backslash = 0x005c; + t.backslashmonospace = 0xff3c; + t.badeva = 0x092c; + t.bagujarati = 0x0aac; + t.bagurmukhi = 0x0a2c; + t.bahiragana = 0x3070; + t.bahtthai = 0x0e3f; + t.bakatakana = 0x30d0; + t.bar = 0x007c; + t.barmonospace = 0xff5c; + t.bbopomofo = 0x3105; + t.bcircle = 0x24d1; + t.bdotaccent = 0x1e03; + t.bdotbelow = 0x1e05; + t.beamedsixteenthnotes = 0x266c; + t.because = 0x2235; + t.becyrillic = 0x0431; + t.beharabic = 0x0628; + t.behfinalarabic = 0xfe90; + t.behinitialarabic = 0xfe91; + t.behiragana = 0x3079; + t.behmedialarabic = 0xfe92; + t.behmeeminitialarabic = 0xfc9f; + t.behmeemisolatedarabic = 0xfc08; + t.behnoonfinalarabic = 0xfc6d; + t.bekatakana = 0x30d9; + t.benarmenian = 0x0562; + t.bet = 0x05d1; + t.beta = 0x03b2; + t.betasymbolgreek = 0x03d0; + t.betdagesh = 0xfb31; + t.betdageshhebrew = 0xfb31; + t.bethebrew = 0x05d1; + t.betrafehebrew = 0xfb4c; + t.bhabengali = 0x09ad; + t.bhadeva = 0x092d; + t.bhagujarati = 0x0aad; + t.bhagurmukhi = 0x0a2d; + t.bhook = 0x0253; + t.bihiragana = 0x3073; + t.bikatakana = 0x30d3; + t.bilabialclick = 0x0298; + t.bindigurmukhi = 0x0a02; + t.birusquare = 0x3331; + t.blackcircle = 0x25cf; + t.blackdiamond = 0x25c6; + t.blackdownpointingtriangle = 0x25bc; + t.blackleftpointingpointer = 0x25c4; + t.blackleftpointingtriangle = 0x25c0; + t.blacklenticularbracketleft = 0x3010; + t.blacklenticularbracketleftvertical = 0xfe3b; + t.blacklenticularbracketright = 0x3011; + t.blacklenticularbracketrightvertical = 0xfe3c; + t.blacklowerlefttriangle = 0x25e3; + t.blacklowerrighttriangle = 0x25e2; + t.blackrectangle = 0x25ac; + t.blackrightpointingpointer = 0x25ba; + t.blackrightpointingtriangle = 0x25b6; + t.blacksmallsquare = 0x25aa; + t.blacksmilingface = 0x263b; + t.blacksquare = 0x25a0; + t.blackstar = 0x2605; + t.blackupperlefttriangle = 0x25e4; + t.blackupperrighttriangle = 0x25e5; + t.blackuppointingsmalltriangle = 0x25b4; + t.blackuppointingtriangle = 0x25b2; + t.blank = 0x2423; + t.blinebelow = 0x1e07; + t.block = 0x2588; + t.bmonospace = 0xff42; + t.bobaimaithai = 0x0e1a; + t.bohiragana = 0x307c; + t.bokatakana = 0x30dc; + t.bparen = 0x249d; + t.bqsquare = 0x33c3; + t.braceex = 0xf8f4; + t.braceleft = 0x007b; + t.braceleftbt = 0xf8f3; + t.braceleftmid = 0xf8f2; + t.braceleftmonospace = 0xff5b; + t.braceleftsmall = 0xfe5b; + t.bracelefttp = 0xf8f1; + t.braceleftvertical = 0xfe37; + t.braceright = 0x007d; + t.bracerightbt = 0xf8fe; + t.bracerightmid = 0xf8fd; + t.bracerightmonospace = 0xff5d; + t.bracerightsmall = 0xfe5c; + t.bracerighttp = 0xf8fc; + t.bracerightvertical = 0xfe38; + t.bracketleft = 0x005b; + t.bracketleftbt = 0xf8f0; + t.bracketleftex = 0xf8ef; + t.bracketleftmonospace = 0xff3b; + t.bracketlefttp = 0xf8ee; + t.bracketright = 0x005d; + t.bracketrightbt = 0xf8fb; + t.bracketrightex = 0xf8fa; + t.bracketrightmonospace = 0xff3d; + t.bracketrighttp = 0xf8f9; + t.breve = 0x02d8; + t.brevebelowcmb = 0x032e; + t.brevecmb = 0x0306; + t.breveinvertedbelowcmb = 0x032f; + t.breveinvertedcmb = 0x0311; + t.breveinverteddoublecmb = 0x0361; + t.bridgebelowcmb = 0x032a; + t.bridgeinvertedbelowcmb = 0x033a; + t.brokenbar = 0x00a6; + t.bstroke = 0x0180; + t.bsuperior = 0xf6ea; + t.btopbar = 0x0183; + t.buhiragana = 0x3076; + t.bukatakana = 0x30d6; + t.bullet = 0x2022; + t.bulletinverse = 0x25d8; + t.bulletoperator = 0x2219; + t.bullseye = 0x25ce; + t.c = 0x0063; + t.caarmenian = 0x056e; + t.cabengali = 0x099a; + t.cacute = 0x0107; + t.cadeva = 0x091a; + t.cagujarati = 0x0a9a; + t.cagurmukhi = 0x0a1a; + t.calsquare = 0x3388; + t.candrabindubengali = 0x0981; + t.candrabinducmb = 0x0310; + t.candrabindudeva = 0x0901; + t.candrabindugujarati = 0x0a81; + t.capslock = 0x21ea; + t.careof = 0x2105; + t.caron = 0x02c7; + t.caronbelowcmb = 0x032c; + t.caroncmb = 0x030c; + t.carriagereturn = 0x21b5; + t.cbopomofo = 0x3118; + t.ccaron = 0x010d; + t.ccedilla = 0x00e7; + t.ccedillaacute = 0x1e09; + t.ccircle = 0x24d2; + t.ccircumflex = 0x0109; + t.ccurl = 0x0255; + t.cdot = 0x010b; + t.cdotaccent = 0x010b; + t.cdsquare = 0x33c5; + t.cedilla = 0x00b8; + t.cedillacmb = 0x0327; + t.cent = 0x00a2; + t.centigrade = 0x2103; + t.centinferior = 0xf6df; + t.centmonospace = 0xffe0; + t.centoldstyle = 0xf7a2; + t.centsuperior = 0xf6e0; + t.chaarmenian = 0x0579; + t.chabengali = 0x099b; + t.chadeva = 0x091b; + t.chagujarati = 0x0a9b; + t.chagurmukhi = 0x0a1b; + t.chbopomofo = 0x3114; + t.cheabkhasiancyrillic = 0x04bd; + t.checkmark = 0x2713; + t.checyrillic = 0x0447; + t.chedescenderabkhasiancyrillic = 0x04bf; + t.chedescendercyrillic = 0x04b7; + t.chedieresiscyrillic = 0x04f5; + t.cheharmenian = 0x0573; + t.chekhakassiancyrillic = 0x04cc; + t.cheverticalstrokecyrillic = 0x04b9; + t.chi = 0x03c7; + t.chieuchacirclekorean = 0x3277; + t.chieuchaparenkorean = 0x3217; + t.chieuchcirclekorean = 0x3269; + t.chieuchkorean = 0x314a; + t.chieuchparenkorean = 0x3209; + t.chochangthai = 0x0e0a; + t.chochanthai = 0x0e08; + t.chochingthai = 0x0e09; + t.chochoethai = 0x0e0c; + t.chook = 0x0188; + t.cieucacirclekorean = 0x3276; + t.cieucaparenkorean = 0x3216; + t.cieuccirclekorean = 0x3268; + t.cieuckorean = 0x3148; + t.cieucparenkorean = 0x3208; + t.cieucuparenkorean = 0x321c; + t.circle = 0x25cb; + t.circlecopyrt = 0x00a9; + t.circlemultiply = 0x2297; + t.circleot = 0x2299; + t.circleplus = 0x2295; + t.circlepostalmark = 0x3036; + t.circlewithlefthalfblack = 0x25d0; + t.circlewithrighthalfblack = 0x25d1; + t.circumflex = 0x02c6; + t.circumflexbelowcmb = 0x032d; + t.circumflexcmb = 0x0302; + t.clear = 0x2327; + t.clickalveolar = 0x01c2; + t.clickdental = 0x01c0; + t.clicklateral = 0x01c1; + t.clickretroflex = 0x01c3; + t.club = 0x2663; + t.clubsuitblack = 0x2663; + t.clubsuitwhite = 0x2667; + t.cmcubedsquare = 0x33a4; + t.cmonospace = 0xff43; + t.cmsquaredsquare = 0x33a0; + t.coarmenian = 0x0581; + t.colon = 0x003a; + t.colonmonetary = 0x20a1; + t.colonmonospace = 0xff1a; + t.colonsign = 0x20a1; + t.colonsmall = 0xfe55; + t.colontriangularhalfmod = 0x02d1; + t.colontriangularmod = 0x02d0; + t.comma = 0x002c; + t.commaabovecmb = 0x0313; + t.commaaboverightcmb = 0x0315; + t.commaaccent = 0xf6c3; + t.commaarabic = 0x060c; + t.commaarmenian = 0x055d; + t.commainferior = 0xf6e1; + t.commamonospace = 0xff0c; + t.commareversedabovecmb = 0x0314; + t.commareversedmod = 0x02bd; + t.commasmall = 0xfe50; + t.commasuperior = 0xf6e2; + t.commaturnedabovecmb = 0x0312; + t.commaturnedmod = 0x02bb; + t.compass = 0x263c; + t.congruent = 0x2245; + t.contourintegral = 0x222e; + t.control = 0x2303; + t.controlACK = 0x0006; + t.controlBEL = 0x0007; + t.controlBS = 0x0008; + t.controlCAN = 0x0018; + t.controlCR = 0x000d; + t.controlDC1 = 0x0011; + t.controlDC2 = 0x0012; + t.controlDC3 = 0x0013; + t.controlDC4 = 0x0014; + t.controlDEL = 0x007f; + t.controlDLE = 0x0010; + t.controlEM = 0x0019; + t.controlENQ = 0x0005; + t.controlEOT = 0x0004; + t.controlESC = 0x001b; + t.controlETB = 0x0017; + t.controlETX = 0x0003; + t.controlFF = 0x000c; + t.controlFS = 0x001c; + t.controlGS = 0x001d; + t.controlHT = 0x0009; + t.controlLF = 0x000a; + t.controlNAK = 0x0015; + t.controlNULL = 0x0000; + t.controlRS = 0x001e; + t.controlSI = 0x000f; + t.controlSO = 0x000e; + t.controlSOT = 0x0002; + t.controlSTX = 0x0001; + t.controlSUB = 0x001a; + t.controlSYN = 0x0016; + t.controlUS = 0x001f; + t.controlVT = 0x000b; + t.copyright = 0x00a9; + t.copyrightsans = 0xf8e9; + t.copyrightserif = 0xf6d9; + t.cornerbracketleft = 0x300c; + t.cornerbracketlefthalfwidth = 0xff62; + t.cornerbracketleftvertical = 0xfe41; + t.cornerbracketright = 0x300d; + t.cornerbracketrighthalfwidth = 0xff63; + t.cornerbracketrightvertical = 0xfe42; + t.corporationsquare = 0x337f; + t.cosquare = 0x33c7; + t.coverkgsquare = 0x33c6; + t.cparen = 0x249e; + t.cruzeiro = 0x20a2; + t.cstretched = 0x0297; + t.curlyand = 0x22cf; + t.curlyor = 0x22ce; + t.currency = 0x00a4; + t.cyrBreve = 0xf6d1; + t.cyrFlex = 0xf6d2; + t.cyrbreve = 0xf6d4; + t.cyrflex = 0xf6d5; + t.d = 0x0064; + t.daarmenian = 0x0564; + t.dabengali = 0x09a6; + t.dadarabic = 0x0636; + t.dadeva = 0x0926; + t.dadfinalarabic = 0xfebe; + t.dadinitialarabic = 0xfebf; + t.dadmedialarabic = 0xfec0; + t.dagesh = 0x05bc; + t.dageshhebrew = 0x05bc; + t.dagger = 0x2020; + t.daggerdbl = 0x2021; + t.dagujarati = 0x0aa6; + t.dagurmukhi = 0x0a26; + t.dahiragana = 0x3060; + t.dakatakana = 0x30c0; + t.dalarabic = 0x062f; + t.dalet = 0x05d3; + t.daletdagesh = 0xfb33; + t.daletdageshhebrew = 0xfb33; + t.dalethebrew = 0x05d3; + t.dalfinalarabic = 0xfeaa; + t.dammaarabic = 0x064f; + t.dammalowarabic = 0x064f; + t.dammatanaltonearabic = 0x064c; + t.dammatanarabic = 0x064c; + t.danda = 0x0964; + t.dargahebrew = 0x05a7; + t.dargalefthebrew = 0x05a7; + t.dasiapneumatacyrilliccmb = 0x0485; + t.dblGrave = 0xf6d3; + t.dblanglebracketleft = 0x300a; + t.dblanglebracketleftvertical = 0xfe3d; + t.dblanglebracketright = 0x300b; + t.dblanglebracketrightvertical = 0xfe3e; + t.dblarchinvertedbelowcmb = 0x032b; + t.dblarrowleft = 0x21d4; + t.dblarrowright = 0x21d2; + t.dbldanda = 0x0965; + t.dblgrave = 0xf6d6; + t.dblgravecmb = 0x030f; + t.dblintegral = 0x222c; + t.dbllowline = 0x2017; + t.dbllowlinecmb = 0x0333; + t.dbloverlinecmb = 0x033f; + t.dblprimemod = 0x02ba; + t.dblverticalbar = 0x2016; + t.dblverticallineabovecmb = 0x030e; + t.dbopomofo = 0x3109; + t.dbsquare = 0x33c8; + t.dcaron = 0x010f; + t.dcedilla = 0x1e11; + t.dcircle = 0x24d3; + t.dcircumflexbelow = 0x1e13; + t.dcroat = 0x0111; + t.ddabengali = 0x09a1; + t.ddadeva = 0x0921; + t.ddagujarati = 0x0aa1; + t.ddagurmukhi = 0x0a21; + t.ddalarabic = 0x0688; + t.ddalfinalarabic = 0xfb89; + t.dddhadeva = 0x095c; + t.ddhabengali = 0x09a2; + t.ddhadeva = 0x0922; + t.ddhagujarati = 0x0aa2; + t.ddhagurmukhi = 0x0a22; + t.ddotaccent = 0x1e0b; + t.ddotbelow = 0x1e0d; + t.decimalseparatorarabic = 0x066b; + t.decimalseparatorpersian = 0x066b; + t.decyrillic = 0x0434; + t.degree = 0x00b0; + t.dehihebrew = 0x05ad; + t.dehiragana = 0x3067; + t.deicoptic = 0x03ef; + t.dekatakana = 0x30c7; + t.deleteleft = 0x232b; + t.deleteright = 0x2326; + t.delta = 0x03b4; + t.deltaturned = 0x018d; + t.denominatorminusonenumeratorbengali = 0x09f8; + t.dezh = 0x02a4; + t.dhabengali = 0x09a7; + t.dhadeva = 0x0927; + t.dhagujarati = 0x0aa7; + t.dhagurmukhi = 0x0a27; + t.dhook = 0x0257; + t.dialytikatonos = 0x0385; + t.dialytikatonoscmb = 0x0344; + t.diamond = 0x2666; + t.diamondsuitwhite = 0x2662; + t.dieresis = 0x00a8; + t.dieresisacute = 0xf6d7; + t.dieresisbelowcmb = 0x0324; + t.dieresiscmb = 0x0308; + t.dieresisgrave = 0xf6d8; + t.dieresistonos = 0x0385; + t.dihiragana = 0x3062; + t.dikatakana = 0x30c2; + t.dittomark = 0x3003; + t.divide = 0x00f7; + t.divides = 0x2223; + t.divisionslash = 0x2215; + t.djecyrillic = 0x0452; + t.dkshade = 0x2593; + t.dlinebelow = 0x1e0f; + t.dlsquare = 0x3397; + t.dmacron = 0x0111; + t.dmonospace = 0xff44; + t.dnblock = 0x2584; + t.dochadathai = 0x0e0e; + t.dodekthai = 0x0e14; + t.dohiragana = 0x3069; + t.dokatakana = 0x30c9; + t.dollar = 0x0024; + t.dollarinferior = 0xf6e3; + t.dollarmonospace = 0xff04; + t.dollaroldstyle = 0xf724; + t.dollarsmall = 0xfe69; + t.dollarsuperior = 0xf6e4; + t.dong = 0x20ab; + t.dorusquare = 0x3326; + t.dotaccent = 0x02d9; + t.dotaccentcmb = 0x0307; + t.dotbelowcmb = 0x0323; + t.dotbelowcomb = 0x0323; + t.dotkatakana = 0x30fb; + t.dotlessi = 0x0131; + t.dotlessj = 0xf6be; + t.dotlessjstrokehook = 0x0284; + t.dotmath = 0x22c5; + t.dottedcircle = 0x25cc; + t.doubleyodpatah = 0xfb1f; + t.doubleyodpatahhebrew = 0xfb1f; + t.downtackbelowcmb = 0x031e; + t.downtackmod = 0x02d5; + t.dparen = 0x249f; + t.dsuperior = 0xf6eb; + t.dtail = 0x0256; + t.dtopbar = 0x018c; + t.duhiragana = 0x3065; + t.dukatakana = 0x30c5; + t.dz = 0x01f3; + t.dzaltone = 0x02a3; + t.dzcaron = 0x01c6; + t.dzcurl = 0x02a5; + t.dzeabkhasiancyrillic = 0x04e1; + t.dzecyrillic = 0x0455; + t.dzhecyrillic = 0x045f; + t.e = 0x0065; + t.eacute = 0x00e9; + t.earth = 0x2641; + t.ebengali = 0x098f; + t.ebopomofo = 0x311c; + t.ebreve = 0x0115; + t.ecandradeva = 0x090d; + t.ecandragujarati = 0x0a8d; + t.ecandravowelsigndeva = 0x0945; + t.ecandravowelsigngujarati = 0x0ac5; + t.ecaron = 0x011b; + t.ecedillabreve = 0x1e1d; + t.echarmenian = 0x0565; + t.echyiwnarmenian = 0x0587; + t.ecircle = 0x24d4; + t.ecircumflex = 0x00ea; + t.ecircumflexacute = 0x1ebf; + t.ecircumflexbelow = 0x1e19; + t.ecircumflexdotbelow = 0x1ec7; + t.ecircumflexgrave = 0x1ec1; + t.ecircumflexhookabove = 0x1ec3; + t.ecircumflextilde = 0x1ec5; + t.ecyrillic = 0x0454; + t.edblgrave = 0x0205; + t.edeva = 0x090f; + t.edieresis = 0x00eb; + t.edot = 0x0117; + t.edotaccent = 0x0117; + t.edotbelow = 0x1eb9; + t.eegurmukhi = 0x0a0f; + t.eematragurmukhi = 0x0a47; + t.efcyrillic = 0x0444; + t.egrave = 0x00e8; + t.egujarati = 0x0a8f; + t.eharmenian = 0x0567; + t.ehbopomofo = 0x311d; + t.ehiragana = 0x3048; + t.ehookabove = 0x1ebb; + t.eibopomofo = 0x311f; + t.eight = 0x0038; + t.eightarabic = 0x0668; + t.eightbengali = 0x09ee; + t.eightcircle = 0x2467; + t.eightcircleinversesansserif = 0x2791; + t.eightdeva = 0x096e; + t.eighteencircle = 0x2471; + t.eighteenparen = 0x2485; + t.eighteenperiod = 0x2499; + t.eightgujarati = 0x0aee; + t.eightgurmukhi = 0x0a6e; + t.eighthackarabic = 0x0668; + t.eighthangzhou = 0x3028; + t.eighthnotebeamed = 0x266b; + t.eightideographicparen = 0x3227; + t.eightinferior = 0x2088; + t.eightmonospace = 0xff18; + t.eightoldstyle = 0xf738; + t.eightparen = 0x247b; + t.eightperiod = 0x248f; + t.eightpersian = 0x06f8; + t.eightroman = 0x2177; + t.eightsuperior = 0x2078; + t.eightthai = 0x0e58; + t.einvertedbreve = 0x0207; + t.eiotifiedcyrillic = 0x0465; + t.ekatakana = 0x30a8; + t.ekatakanahalfwidth = 0xff74; + t.ekonkargurmukhi = 0x0a74; + t.ekorean = 0x3154; + t.elcyrillic = 0x043b; + t.element = 0x2208; + t.elevencircle = 0x246a; + t.elevenparen = 0x247e; + t.elevenperiod = 0x2492; + t.elevenroman = 0x217a; + t.ellipsis = 0x2026; + t.ellipsisvertical = 0x22ee; + t.emacron = 0x0113; + t.emacronacute = 0x1e17; + t.emacrongrave = 0x1e15; + t.emcyrillic = 0x043c; + t.emdash = 0x2014; + t.emdashvertical = 0xfe31; + t.emonospace = 0xff45; + t.emphasismarkarmenian = 0x055b; + t.emptyset = 0x2205; + t.enbopomofo = 0x3123; + t.encyrillic = 0x043d; + t.endash = 0x2013; + t.endashvertical = 0xfe32; + t.endescendercyrillic = 0x04a3; + t.eng = 0x014b; + t.engbopomofo = 0x3125; + t.enghecyrillic = 0x04a5; + t.enhookcyrillic = 0x04c8; + t.enspace = 0x2002; + t.eogonek = 0x0119; + t.eokorean = 0x3153; + t.eopen = 0x025b; + t.eopenclosed = 0x029a; + t.eopenreversed = 0x025c; + t.eopenreversedclosed = 0x025e; + t.eopenreversedhook = 0x025d; + t.eparen = 0x24a0; + t.epsilon = 0x03b5; + t.epsilontonos = 0x03ad; + t.equal = 0x003d; + t.equalmonospace = 0xff1d; + t.equalsmall = 0xfe66; + t.equalsuperior = 0x207c; + t.equivalence = 0x2261; + t.erbopomofo = 0x3126; + t.ercyrillic = 0x0440; + t.ereversed = 0x0258; + t.ereversedcyrillic = 0x044d; + t.escyrillic = 0x0441; + t.esdescendercyrillic = 0x04ab; + t.esh = 0x0283; + t.eshcurl = 0x0286; + t.eshortdeva = 0x090e; + t.eshortvowelsigndeva = 0x0946; + t.eshreversedloop = 0x01aa; + t.eshsquatreversed = 0x0285; + t.esmallhiragana = 0x3047; + t.esmallkatakana = 0x30a7; + t.esmallkatakanahalfwidth = 0xff6a; + t.estimated = 0x212e; + t.esuperior = 0xf6ec; + t.eta = 0x03b7; + t.etarmenian = 0x0568; + t.etatonos = 0x03ae; + t.eth = 0x00f0; + t.etilde = 0x1ebd; + t.etildebelow = 0x1e1b; + t.etnahtafoukhhebrew = 0x0591; + t.etnahtafoukhlefthebrew = 0x0591; + t.etnahtahebrew = 0x0591; + t.etnahtalefthebrew = 0x0591; + t.eturned = 0x01dd; + t.eukorean = 0x3161; + t.euro = 0x20ac; + t.evowelsignbengali = 0x09c7; + t.evowelsigndeva = 0x0947; + t.evowelsigngujarati = 0x0ac7; + t.exclam = 0x0021; + t.exclamarmenian = 0x055c; + t.exclamdbl = 0x203c; + t.exclamdown = 0x00a1; + t.exclamdownsmall = 0xf7a1; + t.exclammonospace = 0xff01; + t.exclamsmall = 0xf721; + t.existential = 0x2203; + t.ezh = 0x0292; + t.ezhcaron = 0x01ef; + t.ezhcurl = 0x0293; + t.ezhreversed = 0x01b9; + t.ezhtail = 0x01ba; + t.f = 0x0066; + t.fadeva = 0x095e; + t.fagurmukhi = 0x0a5e; + t.fahrenheit = 0x2109; + t.fathaarabic = 0x064e; + t.fathalowarabic = 0x064e; + t.fathatanarabic = 0x064b; + t.fbopomofo = 0x3108; + t.fcircle = 0x24d5; + t.fdotaccent = 0x1e1f; + t.feharabic = 0x0641; + t.feharmenian = 0x0586; + t.fehfinalarabic = 0xfed2; + t.fehinitialarabic = 0xfed3; + t.fehmedialarabic = 0xfed4; + t.feicoptic = 0x03e5; + t.female = 0x2640; + t.ff = 0xfb00; + t.f_f = 0xfb00; + t.ffi = 0xfb03; + t.f_f_i = 0xfb03; + t.ffl = 0xfb04; + t.f_f_l = 0xfb04; + t.fi = 0xfb01; + t.f_i = 0xfb01; + t.fifteencircle = 0x246e; + t.fifteenparen = 0x2482; + t.fifteenperiod = 0x2496; + t.figuredash = 0x2012; + t.filledbox = 0x25a0; + t.filledrect = 0x25ac; + t.finalkaf = 0x05da; + t.finalkafdagesh = 0xfb3a; + t.finalkafdageshhebrew = 0xfb3a; + t.finalkafhebrew = 0x05da; + t.finalmem = 0x05dd; + t.finalmemhebrew = 0x05dd; + t.finalnun = 0x05df; + t.finalnunhebrew = 0x05df; + t.finalpe = 0x05e3; + t.finalpehebrew = 0x05e3; + t.finaltsadi = 0x05e5; + t.finaltsadihebrew = 0x05e5; + t.firsttonechinese = 0x02c9; + t.fisheye = 0x25c9; + t.fitacyrillic = 0x0473; + t.five = 0x0035; + t.fivearabic = 0x0665; + t.fivebengali = 0x09eb; + t.fivecircle = 0x2464; + t.fivecircleinversesansserif = 0x278e; + t.fivedeva = 0x096b; + t.fiveeighths = 0x215d; + t.fivegujarati = 0x0aeb; + t.fivegurmukhi = 0x0a6b; + t.fivehackarabic = 0x0665; + t.fivehangzhou = 0x3025; + t.fiveideographicparen = 0x3224; + t.fiveinferior = 0x2085; + t.fivemonospace = 0xff15; + t.fiveoldstyle = 0xf735; + t.fiveparen = 0x2478; + t.fiveperiod = 0x248c; + t.fivepersian = 0x06f5; + t.fiveroman = 0x2174; + t.fivesuperior = 0x2075; + t.fivethai = 0x0e55; + t.fl = 0xfb02; + t.f_l = 0xfb02; + t.florin = 0x0192; + t.fmonospace = 0xff46; + t.fmsquare = 0x3399; + t.fofanthai = 0x0e1f; + t.fofathai = 0x0e1d; + t.fongmanthai = 0x0e4f; + t.forall = 0x2200; + t.four = 0x0034; + t.fourarabic = 0x0664; + t.fourbengali = 0x09ea; + t.fourcircle = 0x2463; + t.fourcircleinversesansserif = 0x278d; + t.fourdeva = 0x096a; + t.fourgujarati = 0x0aea; + t.fourgurmukhi = 0x0a6a; + t.fourhackarabic = 0x0664; + t.fourhangzhou = 0x3024; + t.fourideographicparen = 0x3223; + t.fourinferior = 0x2084; + t.fourmonospace = 0xff14; + t.fournumeratorbengali = 0x09f7; + t.fouroldstyle = 0xf734; + t.fourparen = 0x2477; + t.fourperiod = 0x248b; + t.fourpersian = 0x06f4; + t.fourroman = 0x2173; + t.foursuperior = 0x2074; + t.fourteencircle = 0x246d; + t.fourteenparen = 0x2481; + t.fourteenperiod = 0x2495; + t.fourthai = 0x0e54; + t.fourthtonechinese = 0x02cb; + t.fparen = 0x24a1; + t.fraction = 0x2044; + t.franc = 0x20a3; + t.g = 0x0067; + t.gabengali = 0x0997; + t.gacute = 0x01f5; + t.gadeva = 0x0917; + t.gafarabic = 0x06af; + t.gaffinalarabic = 0xfb93; + t.gafinitialarabic = 0xfb94; + t.gafmedialarabic = 0xfb95; + t.gagujarati = 0x0a97; + t.gagurmukhi = 0x0a17; + t.gahiragana = 0x304c; + t.gakatakana = 0x30ac; + t.gamma = 0x03b3; + t.gammalatinsmall = 0x0263; + t.gammasuperior = 0x02e0; + t.gangiacoptic = 0x03eb; + t.gbopomofo = 0x310d; + t.gbreve = 0x011f; + t.gcaron = 0x01e7; + t.gcedilla = 0x0123; + t.gcircle = 0x24d6; + t.gcircumflex = 0x011d; + t.gcommaaccent = 0x0123; + t.gdot = 0x0121; + t.gdotaccent = 0x0121; + t.gecyrillic = 0x0433; + t.gehiragana = 0x3052; + t.gekatakana = 0x30b2; + t.geometricallyequal = 0x2251; + t.gereshaccenthebrew = 0x059c; + t.gereshhebrew = 0x05f3; + t.gereshmuqdamhebrew = 0x059d; + t.germandbls = 0x00df; + t.gershayimaccenthebrew = 0x059e; + t.gershayimhebrew = 0x05f4; + t.getamark = 0x3013; + t.ghabengali = 0x0998; + t.ghadarmenian = 0x0572; + t.ghadeva = 0x0918; + t.ghagujarati = 0x0a98; + t.ghagurmukhi = 0x0a18; + t.ghainarabic = 0x063a; + t.ghainfinalarabic = 0xfece; + t.ghaininitialarabic = 0xfecf; + t.ghainmedialarabic = 0xfed0; + t.ghemiddlehookcyrillic = 0x0495; + t.ghestrokecyrillic = 0x0493; + t.gheupturncyrillic = 0x0491; + t.ghhadeva = 0x095a; + t.ghhagurmukhi = 0x0a5a; + t.ghook = 0x0260; + t.ghzsquare = 0x3393; + t.gihiragana = 0x304e; + t.gikatakana = 0x30ae; + t.gimarmenian = 0x0563; + t.gimel = 0x05d2; + t.gimeldagesh = 0xfb32; + t.gimeldageshhebrew = 0xfb32; + t.gimelhebrew = 0x05d2; + t.gjecyrillic = 0x0453; + t.glottalinvertedstroke = 0x01be; + t.glottalstop = 0x0294; + t.glottalstopinverted = 0x0296; + t.glottalstopmod = 0x02c0; + t.glottalstopreversed = 0x0295; + t.glottalstopreversedmod = 0x02c1; + t.glottalstopreversedsuperior = 0x02e4; + t.glottalstopstroke = 0x02a1; + t.glottalstopstrokereversed = 0x02a2; + t.gmacron = 0x1e21; + t.gmonospace = 0xff47; + t.gohiragana = 0x3054; + t.gokatakana = 0x30b4; + t.gparen = 0x24a2; + t.gpasquare = 0x33ac; + t.gradient = 0x2207; + t.grave = 0x0060; + t.gravebelowcmb = 0x0316; + t.gravecmb = 0x0300; + t.gravecomb = 0x0300; + t.gravedeva = 0x0953; + t.gravelowmod = 0x02ce; + t.gravemonospace = 0xff40; + t.gravetonecmb = 0x0340; + t.greater = 0x003e; + t.greaterequal = 0x2265; + t.greaterequalorless = 0x22db; + t.greatermonospace = 0xff1e; + t.greaterorequivalent = 0x2273; + t.greaterorless = 0x2277; + t.greateroverequal = 0x2267; + t.greatersmall = 0xfe65; + t.gscript = 0x0261; + t.gstroke = 0x01e5; + t.guhiragana = 0x3050; + t.guillemotleft = 0x00ab; + t.guillemotright = 0x00bb; + t.guilsinglleft = 0x2039; + t.guilsinglright = 0x203a; + t.gukatakana = 0x30b0; + t.guramusquare = 0x3318; + t.gysquare = 0x33c9; + t.h = 0x0068; + t.haabkhasiancyrillic = 0x04a9; + t.haaltonearabic = 0x06c1; + t.habengali = 0x09b9; + t.hadescendercyrillic = 0x04b3; + t.hadeva = 0x0939; + t.hagujarati = 0x0ab9; + t.hagurmukhi = 0x0a39; + t.haharabic = 0x062d; + t.hahfinalarabic = 0xfea2; + t.hahinitialarabic = 0xfea3; + t.hahiragana = 0x306f; + t.hahmedialarabic = 0xfea4; + t.haitusquare = 0x332a; + t.hakatakana = 0x30cf; + t.hakatakanahalfwidth = 0xff8a; + t.halantgurmukhi = 0x0a4d; + t.hamzaarabic = 0x0621; + t.hamzalowarabic = 0x0621; + t.hangulfiller = 0x3164; + t.hardsigncyrillic = 0x044a; + t.harpoonleftbarbup = 0x21bc; + t.harpoonrightbarbup = 0x21c0; + t.hasquare = 0x33ca; + t.hatafpatah = 0x05b2; + t.hatafpatah16 = 0x05b2; + t.hatafpatah23 = 0x05b2; + t.hatafpatah2f = 0x05b2; + t.hatafpatahhebrew = 0x05b2; + t.hatafpatahnarrowhebrew = 0x05b2; + t.hatafpatahquarterhebrew = 0x05b2; + t.hatafpatahwidehebrew = 0x05b2; + t.hatafqamats = 0x05b3; + t.hatafqamats1b = 0x05b3; + t.hatafqamats28 = 0x05b3; + t.hatafqamats34 = 0x05b3; + t.hatafqamatshebrew = 0x05b3; + t.hatafqamatsnarrowhebrew = 0x05b3; + t.hatafqamatsquarterhebrew = 0x05b3; + t.hatafqamatswidehebrew = 0x05b3; + t.hatafsegol = 0x05b1; + t.hatafsegol17 = 0x05b1; + t.hatafsegol24 = 0x05b1; + t.hatafsegol30 = 0x05b1; + t.hatafsegolhebrew = 0x05b1; + t.hatafsegolnarrowhebrew = 0x05b1; + t.hatafsegolquarterhebrew = 0x05b1; + t.hatafsegolwidehebrew = 0x05b1; + t.hbar = 0x0127; + t.hbopomofo = 0x310f; + t.hbrevebelow = 0x1e2b; + t.hcedilla = 0x1e29; + t.hcircle = 0x24d7; + t.hcircumflex = 0x0125; + t.hdieresis = 0x1e27; + t.hdotaccent = 0x1e23; + t.hdotbelow = 0x1e25; + t.he = 0x05d4; + t.heart = 0x2665; + t.heartsuitblack = 0x2665; + t.heartsuitwhite = 0x2661; + t.hedagesh = 0xfb34; + t.hedageshhebrew = 0xfb34; + t.hehaltonearabic = 0x06c1; + t.heharabic = 0x0647; + t.hehebrew = 0x05d4; + t.hehfinalaltonearabic = 0xfba7; + t.hehfinalalttwoarabic = 0xfeea; + t.hehfinalarabic = 0xfeea; + t.hehhamzaabovefinalarabic = 0xfba5; + t.hehhamzaaboveisolatedarabic = 0xfba4; + t.hehinitialaltonearabic = 0xfba8; + t.hehinitialarabic = 0xfeeb; + t.hehiragana = 0x3078; + t.hehmedialaltonearabic = 0xfba9; + t.hehmedialarabic = 0xfeec; + t.heiseierasquare = 0x337b; + t.hekatakana = 0x30d8; + t.hekatakanahalfwidth = 0xff8d; + t.hekutaarusquare = 0x3336; + t.henghook = 0x0267; + t.herutusquare = 0x3339; + t.het = 0x05d7; + t.hethebrew = 0x05d7; + t.hhook = 0x0266; + t.hhooksuperior = 0x02b1; + t.hieuhacirclekorean = 0x327b; + t.hieuhaparenkorean = 0x321b; + t.hieuhcirclekorean = 0x326d; + t.hieuhkorean = 0x314e; + t.hieuhparenkorean = 0x320d; + t.hihiragana = 0x3072; + t.hikatakana = 0x30d2; + t.hikatakanahalfwidth = 0xff8b; + t.hiriq = 0x05b4; + t.hiriq14 = 0x05b4; + t.hiriq21 = 0x05b4; + t.hiriq2d = 0x05b4; + t.hiriqhebrew = 0x05b4; + t.hiriqnarrowhebrew = 0x05b4; + t.hiriqquarterhebrew = 0x05b4; + t.hiriqwidehebrew = 0x05b4; + t.hlinebelow = 0x1e96; + t.hmonospace = 0xff48; + t.hoarmenian = 0x0570; + t.hohipthai = 0x0e2b; + t.hohiragana = 0x307b; + t.hokatakana = 0x30db; + t.hokatakanahalfwidth = 0xff8e; + t.holam = 0x05b9; + t.holam19 = 0x05b9; + t.holam26 = 0x05b9; + t.holam32 = 0x05b9; + t.holamhebrew = 0x05b9; + t.holamnarrowhebrew = 0x05b9; + t.holamquarterhebrew = 0x05b9; + t.holamwidehebrew = 0x05b9; + t.honokhukthai = 0x0e2e; + t.hookabovecomb = 0x0309; + t.hookcmb = 0x0309; + t.hookpalatalizedbelowcmb = 0x0321; + t.hookretroflexbelowcmb = 0x0322; + t.hoonsquare = 0x3342; + t.horicoptic = 0x03e9; + t.horizontalbar = 0x2015; + t.horncmb = 0x031b; + t.hotsprings = 0x2668; + t.house = 0x2302; + t.hparen = 0x24a3; + t.hsuperior = 0x02b0; + t.hturned = 0x0265; + t.huhiragana = 0x3075; + t.huiitosquare = 0x3333; + t.hukatakana = 0x30d5; + t.hukatakanahalfwidth = 0xff8c; + t.hungarumlaut = 0x02dd; + t.hungarumlautcmb = 0x030b; + t.hv = 0x0195; + t.hyphen = 0x002d; + t.hypheninferior = 0xf6e5; + t.hyphenmonospace = 0xff0d; + t.hyphensmall = 0xfe63; + t.hyphensuperior = 0xf6e6; + t.hyphentwo = 0x2010; + t.i = 0x0069; + t.iacute = 0x00ed; + t.iacyrillic = 0x044f; + t.ibengali = 0x0987; + t.ibopomofo = 0x3127; + t.ibreve = 0x012d; + t.icaron = 0x01d0; + t.icircle = 0x24d8; + t.icircumflex = 0x00ee; + t.icyrillic = 0x0456; + t.idblgrave = 0x0209; + t.ideographearthcircle = 0x328f; + t.ideographfirecircle = 0x328b; + t.ideographicallianceparen = 0x323f; + t.ideographiccallparen = 0x323a; + t.ideographiccentrecircle = 0x32a5; + t.ideographicclose = 0x3006; + t.ideographiccomma = 0x3001; + t.ideographiccommaleft = 0xff64; + t.ideographiccongratulationparen = 0x3237; + t.ideographiccorrectcircle = 0x32a3; + t.ideographicearthparen = 0x322f; + t.ideographicenterpriseparen = 0x323d; + t.ideographicexcellentcircle = 0x329d; + t.ideographicfestivalparen = 0x3240; + t.ideographicfinancialcircle = 0x3296; + t.ideographicfinancialparen = 0x3236; + t.ideographicfireparen = 0x322b; + t.ideographichaveparen = 0x3232; + t.ideographichighcircle = 0x32a4; + t.ideographiciterationmark = 0x3005; + t.ideographiclaborcircle = 0x3298; + t.ideographiclaborparen = 0x3238; + t.ideographicleftcircle = 0x32a7; + t.ideographiclowcircle = 0x32a6; + t.ideographicmedicinecircle = 0x32a9; + t.ideographicmetalparen = 0x322e; + t.ideographicmoonparen = 0x322a; + t.ideographicnameparen = 0x3234; + t.ideographicperiod = 0x3002; + t.ideographicprintcircle = 0x329e; + t.ideographicreachparen = 0x3243; + t.ideographicrepresentparen = 0x3239; + t.ideographicresourceparen = 0x323e; + t.ideographicrightcircle = 0x32a8; + t.ideographicsecretcircle = 0x3299; + t.ideographicselfparen = 0x3242; + t.ideographicsocietyparen = 0x3233; + t.ideographicspace = 0x3000; + t.ideographicspecialparen = 0x3235; + t.ideographicstockparen = 0x3231; + t.ideographicstudyparen = 0x323b; + t.ideographicsunparen = 0x3230; + t.ideographicsuperviseparen = 0x323c; + t.ideographicwaterparen = 0x322c; + t.ideographicwoodparen = 0x322d; + t.ideographiczero = 0x3007; + t.ideographmetalcircle = 0x328e; + t.ideographmooncircle = 0x328a; + t.ideographnamecircle = 0x3294; + t.ideographsuncircle = 0x3290; + t.ideographwatercircle = 0x328c; + t.ideographwoodcircle = 0x328d; + t.ideva = 0x0907; + t.idieresis = 0x00ef; + t.idieresisacute = 0x1e2f; + t.idieresiscyrillic = 0x04e5; + t.idotbelow = 0x1ecb; + t.iebrevecyrillic = 0x04d7; + t.iecyrillic = 0x0435; + t.ieungacirclekorean = 0x3275; + t.ieungaparenkorean = 0x3215; + t.ieungcirclekorean = 0x3267; + t.ieungkorean = 0x3147; + t.ieungparenkorean = 0x3207; + t.igrave = 0x00ec; + t.igujarati = 0x0a87; + t.igurmukhi = 0x0a07; + t.ihiragana = 0x3044; + t.ihookabove = 0x1ec9; + t.iibengali = 0x0988; + t.iicyrillic = 0x0438; + t.iideva = 0x0908; + t.iigujarati = 0x0a88; + t.iigurmukhi = 0x0a08; + t.iimatragurmukhi = 0x0a40; + t.iinvertedbreve = 0x020b; + t.iishortcyrillic = 0x0439; + t.iivowelsignbengali = 0x09c0; + t.iivowelsigndeva = 0x0940; + t.iivowelsigngujarati = 0x0ac0; + t.ij = 0x0133; + t.ikatakana = 0x30a4; + t.ikatakanahalfwidth = 0xff72; + t.ikorean = 0x3163; + t.ilde = 0x02dc; + t.iluyhebrew = 0x05ac; + t.imacron = 0x012b; + t.imacroncyrillic = 0x04e3; + t.imageorapproximatelyequal = 0x2253; + t.imatragurmukhi = 0x0a3f; + t.imonospace = 0xff49; + t.increment = 0x2206; + t.infinity = 0x221e; + t.iniarmenian = 0x056b; + t.integral = 0x222b; + t.integralbottom = 0x2321; + t.integralbt = 0x2321; + t.integralex = 0xf8f5; + t.integraltop = 0x2320; + t.integraltp = 0x2320; + t.intersection = 0x2229; + t.intisquare = 0x3305; + t.invbullet = 0x25d8; + t.invcircle = 0x25d9; + t.invsmileface = 0x263b; + t.iocyrillic = 0x0451; + t.iogonek = 0x012f; + t.iota = 0x03b9; + t.iotadieresis = 0x03ca; + t.iotadieresistonos = 0x0390; + t.iotalatin = 0x0269; + t.iotatonos = 0x03af; + t.iparen = 0x24a4; + t.irigurmukhi = 0x0a72; + t.ismallhiragana = 0x3043; + t.ismallkatakana = 0x30a3; + t.ismallkatakanahalfwidth = 0xff68; + t.issharbengali = 0x09fa; + t.istroke = 0x0268; + t.isuperior = 0xf6ed; + t.iterationhiragana = 0x309d; + t.iterationkatakana = 0x30fd; + t.itilde = 0x0129; + t.itildebelow = 0x1e2d; + t.iubopomofo = 0x3129; + t.iucyrillic = 0x044e; + t.ivowelsignbengali = 0x09bf; + t.ivowelsigndeva = 0x093f; + t.ivowelsigngujarati = 0x0abf; + t.izhitsacyrillic = 0x0475; + t.izhitsadblgravecyrillic = 0x0477; + t.j = 0x006a; + t.jaarmenian = 0x0571; + t.jabengali = 0x099c; + t.jadeva = 0x091c; + t.jagujarati = 0x0a9c; + t.jagurmukhi = 0x0a1c; + t.jbopomofo = 0x3110; + t.jcaron = 0x01f0; + t.jcircle = 0x24d9; + t.jcircumflex = 0x0135; + t.jcrossedtail = 0x029d; + t.jdotlessstroke = 0x025f; + t.jecyrillic = 0x0458; + t.jeemarabic = 0x062c; + t.jeemfinalarabic = 0xfe9e; + t.jeeminitialarabic = 0xfe9f; + t.jeemmedialarabic = 0xfea0; + t.jeharabic = 0x0698; + t.jehfinalarabic = 0xfb8b; + t.jhabengali = 0x099d; + t.jhadeva = 0x091d; + t.jhagujarati = 0x0a9d; + t.jhagurmukhi = 0x0a1d; + t.jheharmenian = 0x057b; + t.jis = 0x3004; + t.jmonospace = 0xff4a; + t.jparen = 0x24a5; + t.jsuperior = 0x02b2; + t.k = 0x006b; + t.kabashkircyrillic = 0x04a1; + t.kabengali = 0x0995; + t.kacute = 0x1e31; + t.kacyrillic = 0x043a; + t.kadescendercyrillic = 0x049b; + t.kadeva = 0x0915; + t.kaf = 0x05db; + t.kafarabic = 0x0643; + t.kafdagesh = 0xfb3b; + t.kafdageshhebrew = 0xfb3b; + t.kaffinalarabic = 0xfeda; + t.kafhebrew = 0x05db; + t.kafinitialarabic = 0xfedb; + t.kafmedialarabic = 0xfedc; + t.kafrafehebrew = 0xfb4d; + t.kagujarati = 0x0a95; + t.kagurmukhi = 0x0a15; + t.kahiragana = 0x304b; + t.kahookcyrillic = 0x04c4; + t.kakatakana = 0x30ab; + t.kakatakanahalfwidth = 0xff76; + t.kappa = 0x03ba; + t.kappasymbolgreek = 0x03f0; + t.kapyeounmieumkorean = 0x3171; + t.kapyeounphieuphkorean = 0x3184; + t.kapyeounpieupkorean = 0x3178; + t.kapyeounssangpieupkorean = 0x3179; + t.karoriisquare = 0x330d; + t.kashidaautoarabic = 0x0640; + t.kashidaautonosidebearingarabic = 0x0640; + t.kasmallkatakana = 0x30f5; + t.kasquare = 0x3384; + t.kasraarabic = 0x0650; + t.kasratanarabic = 0x064d; + t.kastrokecyrillic = 0x049f; + t.katahiraprolongmarkhalfwidth = 0xff70; + t.kaverticalstrokecyrillic = 0x049d; + t.kbopomofo = 0x310e; + t.kcalsquare = 0x3389; + t.kcaron = 0x01e9; + t.kcedilla = 0x0137; + t.kcircle = 0x24da; + t.kcommaaccent = 0x0137; + t.kdotbelow = 0x1e33; + t.keharmenian = 0x0584; + t.kehiragana = 0x3051; + t.kekatakana = 0x30b1; + t.kekatakanahalfwidth = 0xff79; + t.kenarmenian = 0x056f; + t.kesmallkatakana = 0x30f6; + t.kgreenlandic = 0x0138; + t.khabengali = 0x0996; + t.khacyrillic = 0x0445; + t.khadeva = 0x0916; + t.khagujarati = 0x0a96; + t.khagurmukhi = 0x0a16; + t.khaharabic = 0x062e; + t.khahfinalarabic = 0xfea6; + t.khahinitialarabic = 0xfea7; + t.khahmedialarabic = 0xfea8; + t.kheicoptic = 0x03e7; + t.khhadeva = 0x0959; + t.khhagurmukhi = 0x0a59; + t.khieukhacirclekorean = 0x3278; + t.khieukhaparenkorean = 0x3218; + t.khieukhcirclekorean = 0x326a; + t.khieukhkorean = 0x314b; + t.khieukhparenkorean = 0x320a; + t.khokhaithai = 0x0e02; + t.khokhonthai = 0x0e05; + t.khokhuatthai = 0x0e03; + t.khokhwaithai = 0x0e04; + t.khomutthai = 0x0e5b; + t.khook = 0x0199; + t.khorakhangthai = 0x0e06; + t.khzsquare = 0x3391; + t.kihiragana = 0x304d; + t.kikatakana = 0x30ad; + t.kikatakanahalfwidth = 0xff77; + t.kiroguramusquare = 0x3315; + t.kiromeetorusquare = 0x3316; + t.kirosquare = 0x3314; + t.kiyeokacirclekorean = 0x326e; + t.kiyeokaparenkorean = 0x320e; + t.kiyeokcirclekorean = 0x3260; + t.kiyeokkorean = 0x3131; + t.kiyeokparenkorean = 0x3200; + t.kiyeoksioskorean = 0x3133; + t.kjecyrillic = 0x045c; + t.klinebelow = 0x1e35; + t.klsquare = 0x3398; + t.kmcubedsquare = 0x33a6; + t.kmonospace = 0xff4b; + t.kmsquaredsquare = 0x33a2; + t.kohiragana = 0x3053; + t.kohmsquare = 0x33c0; + t.kokaithai = 0x0e01; + t.kokatakana = 0x30b3; + t.kokatakanahalfwidth = 0xff7a; + t.kooposquare = 0x331e; + t.koppacyrillic = 0x0481; + t.koreanstandardsymbol = 0x327f; + t.koroniscmb = 0x0343; + t.kparen = 0x24a6; + t.kpasquare = 0x33aa; + t.ksicyrillic = 0x046f; + t.ktsquare = 0x33cf; + t.kturned = 0x029e; + t.kuhiragana = 0x304f; + t.kukatakana = 0x30af; + t.kukatakanahalfwidth = 0xff78; + t.kvsquare = 0x33b8; + t.kwsquare = 0x33be; + t.l = 0x006c; + t.labengali = 0x09b2; + t.lacute = 0x013a; + t.ladeva = 0x0932; + t.lagujarati = 0x0ab2; + t.lagurmukhi = 0x0a32; + t.lakkhangyaothai = 0x0e45; + t.lamaleffinalarabic = 0xfefc; + t.lamalefhamzaabovefinalarabic = 0xfef8; + t.lamalefhamzaaboveisolatedarabic = 0xfef7; + t.lamalefhamzabelowfinalarabic = 0xfefa; + t.lamalefhamzabelowisolatedarabic = 0xfef9; + t.lamalefisolatedarabic = 0xfefb; + t.lamalefmaddaabovefinalarabic = 0xfef6; + t.lamalefmaddaaboveisolatedarabic = 0xfef5; + t.lamarabic = 0x0644; + t.lambda = 0x03bb; + t.lambdastroke = 0x019b; + t.lamed = 0x05dc; + t.lameddagesh = 0xfb3c; + t.lameddageshhebrew = 0xfb3c; + t.lamedhebrew = 0x05dc; + t.lamfinalarabic = 0xfede; + t.lamhahinitialarabic = 0xfcca; + t.laminitialarabic = 0xfedf; + t.lamjeeminitialarabic = 0xfcc9; + t.lamkhahinitialarabic = 0xfccb; + t.lamlamhehisolatedarabic = 0xfdf2; + t.lammedialarabic = 0xfee0; + t.lammeemhahinitialarabic = 0xfd88; + t.lammeeminitialarabic = 0xfccc; + t.largecircle = 0x25ef; + t.lbar = 0x019a; + t.lbelt = 0x026c; + t.lbopomofo = 0x310c; + t.lcaron = 0x013e; + t.lcedilla = 0x013c; + t.lcircle = 0x24db; + t.lcircumflexbelow = 0x1e3d; + t.lcommaaccent = 0x013c; + t.ldot = 0x0140; + t.ldotaccent = 0x0140; + t.ldotbelow = 0x1e37; + t.ldotbelowmacron = 0x1e39; + t.leftangleabovecmb = 0x031a; + t.lefttackbelowcmb = 0x0318; + t.less = 0x003c; + t.lessequal = 0x2264; + t.lessequalorgreater = 0x22da; + t.lessmonospace = 0xff1c; + t.lessorequivalent = 0x2272; + t.lessorgreater = 0x2276; + t.lessoverequal = 0x2266; + t.lesssmall = 0xfe64; + t.lezh = 0x026e; + t.lfblock = 0x258c; + t.lhookretroflex = 0x026d; + t.lira = 0x20a4; + t.liwnarmenian = 0x056c; + t.lj = 0x01c9; + t.ljecyrillic = 0x0459; + t.ll = 0xf6c0; + t.lladeva = 0x0933; + t.llagujarati = 0x0ab3; + t.llinebelow = 0x1e3b; + t.llladeva = 0x0934; + t.llvocalicbengali = 0x09e1; + t.llvocalicdeva = 0x0961; + t.llvocalicvowelsignbengali = 0x09e3; + t.llvocalicvowelsigndeva = 0x0963; + t.lmiddletilde = 0x026b; + t.lmonospace = 0xff4c; + t.lmsquare = 0x33d0; + t.lochulathai = 0x0e2c; + t.logicaland = 0x2227; + t.logicalnot = 0x00ac; + t.logicalnotreversed = 0x2310; + t.logicalor = 0x2228; + t.lolingthai = 0x0e25; + t.longs = 0x017f; + t.lowlinecenterline = 0xfe4e; + t.lowlinecmb = 0x0332; + t.lowlinedashed = 0xfe4d; + t.lozenge = 0x25ca; + t.lparen = 0x24a7; + t.lslash = 0x0142; + t.lsquare = 0x2113; + t.lsuperior = 0xf6ee; + t.ltshade = 0x2591; + t.luthai = 0x0e26; + t.lvocalicbengali = 0x098c; + t.lvocalicdeva = 0x090c; + t.lvocalicvowelsignbengali = 0x09e2; + t.lvocalicvowelsigndeva = 0x0962; + t.lxsquare = 0x33d3; + t.m = 0x006d; + t.mabengali = 0x09ae; + t.macron = 0x00af; + t.macronbelowcmb = 0x0331; + t.macroncmb = 0x0304; + t.macronlowmod = 0x02cd; + t.macronmonospace = 0xffe3; + t.macute = 0x1e3f; + t.madeva = 0x092e; + t.magujarati = 0x0aae; + t.magurmukhi = 0x0a2e; + t.mahapakhhebrew = 0x05a4; + t.mahapakhlefthebrew = 0x05a4; + t.mahiragana = 0x307e; + t.maichattawalowleftthai = 0xf895; + t.maichattawalowrightthai = 0xf894; + t.maichattawathai = 0x0e4b; + t.maichattawaupperleftthai = 0xf893; + t.maieklowleftthai = 0xf88c; + t.maieklowrightthai = 0xf88b; + t.maiekthai = 0x0e48; + t.maiekupperleftthai = 0xf88a; + t.maihanakatleftthai = 0xf884; + t.maihanakatthai = 0x0e31; + t.maitaikhuleftthai = 0xf889; + t.maitaikhuthai = 0x0e47; + t.maitholowleftthai = 0xf88f; + t.maitholowrightthai = 0xf88e; + t.maithothai = 0x0e49; + t.maithoupperleftthai = 0xf88d; + t.maitrilowleftthai = 0xf892; + t.maitrilowrightthai = 0xf891; + t.maitrithai = 0x0e4a; + t.maitriupperleftthai = 0xf890; + t.maiyamokthai = 0x0e46; + t.makatakana = 0x30de; + t.makatakanahalfwidth = 0xff8f; + t.male = 0x2642; + t.mansyonsquare = 0x3347; + t.maqafhebrew = 0x05be; + t.mars = 0x2642; + t.masoracirclehebrew = 0x05af; + t.masquare = 0x3383; + t.mbopomofo = 0x3107; + t.mbsquare = 0x33d4; + t.mcircle = 0x24dc; + t.mcubedsquare = 0x33a5; + t.mdotaccent = 0x1e41; + t.mdotbelow = 0x1e43; + t.meemarabic = 0x0645; + t.meemfinalarabic = 0xfee2; + t.meeminitialarabic = 0xfee3; + t.meemmedialarabic = 0xfee4; + t.meemmeeminitialarabic = 0xfcd1; + t.meemmeemisolatedarabic = 0xfc48; + t.meetorusquare = 0x334d; + t.mehiragana = 0x3081; + t.meizierasquare = 0x337e; + t.mekatakana = 0x30e1; + t.mekatakanahalfwidth = 0xff92; + t.mem = 0x05de; + t.memdagesh = 0xfb3e; + t.memdageshhebrew = 0xfb3e; + t.memhebrew = 0x05de; + t.menarmenian = 0x0574; + t.merkhahebrew = 0x05a5; + t.merkhakefulahebrew = 0x05a6; + t.merkhakefulalefthebrew = 0x05a6; + t.merkhalefthebrew = 0x05a5; + t.mhook = 0x0271; + t.mhzsquare = 0x3392; + t.middledotkatakanahalfwidth = 0xff65; + t.middot = 0x00b7; + t.mieumacirclekorean = 0x3272; + t.mieumaparenkorean = 0x3212; + t.mieumcirclekorean = 0x3264; + t.mieumkorean = 0x3141; + t.mieumpansioskorean = 0x3170; + t.mieumparenkorean = 0x3204; + t.mieumpieupkorean = 0x316e; + t.mieumsioskorean = 0x316f; + t.mihiragana = 0x307f; + t.mikatakana = 0x30df; + t.mikatakanahalfwidth = 0xff90; + t.minus = 0x2212; + t.minusbelowcmb = 0x0320; + t.minuscircle = 0x2296; + t.minusmod = 0x02d7; + t.minusplus = 0x2213; + t.minute = 0x2032; + t.miribaarusquare = 0x334a; + t.mirisquare = 0x3349; + t.mlonglegturned = 0x0270; + t.mlsquare = 0x3396; + t.mmcubedsquare = 0x33a3; + t.mmonospace = 0xff4d; + t.mmsquaredsquare = 0x339f; + t.mohiragana = 0x3082; + t.mohmsquare = 0x33c1; + t.mokatakana = 0x30e2; + t.mokatakanahalfwidth = 0xff93; + t.molsquare = 0x33d6; + t.momathai = 0x0e21; + t.moverssquare = 0x33a7; + t.moverssquaredsquare = 0x33a8; + t.mparen = 0x24a8; + t.mpasquare = 0x33ab; + t.mssquare = 0x33b3; + t.msuperior = 0xf6ef; + t.mturned = 0x026f; + t.mu = 0x00b5; + t.mu1 = 0x00b5; + t.muasquare = 0x3382; + t.muchgreater = 0x226b; + t.muchless = 0x226a; + t.mufsquare = 0x338c; + t.mugreek = 0x03bc; + t.mugsquare = 0x338d; + t.muhiragana = 0x3080; + t.mukatakana = 0x30e0; + t.mukatakanahalfwidth = 0xff91; + t.mulsquare = 0x3395; + t.multiply = 0x00d7; + t.mumsquare = 0x339b; + t.munahhebrew = 0x05a3; + t.munahlefthebrew = 0x05a3; + t.musicalnote = 0x266a; + t.musicalnotedbl = 0x266b; + t.musicflatsign = 0x266d; + t.musicsharpsign = 0x266f; + t.mussquare = 0x33b2; + t.muvsquare = 0x33b6; + t.muwsquare = 0x33bc; + t.mvmegasquare = 0x33b9; + t.mvsquare = 0x33b7; + t.mwmegasquare = 0x33bf; + t.mwsquare = 0x33bd; + t.n = 0x006e; + t.nabengali = 0x09a8; + t.nabla = 0x2207; + t.nacute = 0x0144; + t.nadeva = 0x0928; + t.nagujarati = 0x0aa8; + t.nagurmukhi = 0x0a28; + t.nahiragana = 0x306a; + t.nakatakana = 0x30ca; + t.nakatakanahalfwidth = 0xff85; + t.napostrophe = 0x0149; + t.nasquare = 0x3381; + t.nbopomofo = 0x310b; + t.nbspace = 0x00a0; + t.ncaron = 0x0148; + t.ncedilla = 0x0146; + t.ncircle = 0x24dd; + t.ncircumflexbelow = 0x1e4b; + t.ncommaaccent = 0x0146; + t.ndotaccent = 0x1e45; + t.ndotbelow = 0x1e47; + t.nehiragana = 0x306d; + t.nekatakana = 0x30cd; + t.nekatakanahalfwidth = 0xff88; + t.newsheqelsign = 0x20aa; + t.nfsquare = 0x338b; + t.ngabengali = 0x0999; + t.ngadeva = 0x0919; + t.ngagujarati = 0x0a99; + t.ngagurmukhi = 0x0a19; + t.ngonguthai = 0x0e07; + t.nhiragana = 0x3093; + t.nhookleft = 0x0272; + t.nhookretroflex = 0x0273; + t.nieunacirclekorean = 0x326f; + t.nieunaparenkorean = 0x320f; + t.nieuncieuckorean = 0x3135; + t.nieuncirclekorean = 0x3261; + t.nieunhieuhkorean = 0x3136; + t.nieunkorean = 0x3134; + t.nieunpansioskorean = 0x3168; + t.nieunparenkorean = 0x3201; + t.nieunsioskorean = 0x3167; + t.nieuntikeutkorean = 0x3166; + t.nihiragana = 0x306b; + t.nikatakana = 0x30cb; + t.nikatakanahalfwidth = 0xff86; + t.nikhahitleftthai = 0xf899; + t.nikhahitthai = 0x0e4d; + t.nine = 0x0039; + t.ninearabic = 0x0669; + t.ninebengali = 0x09ef; + t.ninecircle = 0x2468; + t.ninecircleinversesansserif = 0x2792; + t.ninedeva = 0x096f; + t.ninegujarati = 0x0aef; + t.ninegurmukhi = 0x0a6f; + t.ninehackarabic = 0x0669; + t.ninehangzhou = 0x3029; + t.nineideographicparen = 0x3228; + t.nineinferior = 0x2089; + t.ninemonospace = 0xff19; + t.nineoldstyle = 0xf739; + t.nineparen = 0x247c; + t.nineperiod = 0x2490; + t.ninepersian = 0x06f9; + t.nineroman = 0x2178; + t.ninesuperior = 0x2079; + t.nineteencircle = 0x2472; + t.nineteenparen = 0x2486; + t.nineteenperiod = 0x249a; + t.ninethai = 0x0e59; + t.nj = 0x01cc; + t.njecyrillic = 0x045a; + t.nkatakana = 0x30f3; + t.nkatakanahalfwidth = 0xff9d; + t.nlegrightlong = 0x019e; + t.nlinebelow = 0x1e49; + t.nmonospace = 0xff4e; + t.nmsquare = 0x339a; + t.nnabengali = 0x09a3; + t.nnadeva = 0x0923; + t.nnagujarati = 0x0aa3; + t.nnagurmukhi = 0x0a23; + t.nnnadeva = 0x0929; + t.nohiragana = 0x306e; + t.nokatakana = 0x30ce; + t.nokatakanahalfwidth = 0xff89; + t.nonbreakingspace = 0x00a0; + t.nonenthai = 0x0e13; + t.nonuthai = 0x0e19; + t.noonarabic = 0x0646; + t.noonfinalarabic = 0xfee6; + t.noonghunnaarabic = 0x06ba; + t.noonghunnafinalarabic = 0xfb9f; + t.nooninitialarabic = 0xfee7; + t.noonjeeminitialarabic = 0xfcd2; + t.noonjeemisolatedarabic = 0xfc4b; + t.noonmedialarabic = 0xfee8; + t.noonmeeminitialarabic = 0xfcd5; + t.noonmeemisolatedarabic = 0xfc4e; + t.noonnoonfinalarabic = 0xfc8d; + t.notcontains = 0x220c; + t.notelement = 0x2209; + t.notelementof = 0x2209; + t.notequal = 0x2260; + t.notgreater = 0x226f; + t.notgreaternorequal = 0x2271; + t.notgreaternorless = 0x2279; + t.notidentical = 0x2262; + t.notless = 0x226e; + t.notlessnorequal = 0x2270; + t.notparallel = 0x2226; + t.notprecedes = 0x2280; + t.notsubset = 0x2284; + t.notsucceeds = 0x2281; + t.notsuperset = 0x2285; + t.nowarmenian = 0x0576; + t.nparen = 0x24a9; + t.nssquare = 0x33b1; + t.nsuperior = 0x207f; + t.ntilde = 0x00f1; + t.nu = 0x03bd; + t.nuhiragana = 0x306c; + t.nukatakana = 0x30cc; + t.nukatakanahalfwidth = 0xff87; + t.nuktabengali = 0x09bc; + t.nuktadeva = 0x093c; + t.nuktagujarati = 0x0abc; + t.nuktagurmukhi = 0x0a3c; + t.numbersign = 0x0023; + t.numbersignmonospace = 0xff03; + t.numbersignsmall = 0xfe5f; + t.numeralsigngreek = 0x0374; + t.numeralsignlowergreek = 0x0375; + t.numero = 0x2116; + t.nun = 0x05e0; + t.nundagesh = 0xfb40; + t.nundageshhebrew = 0xfb40; + t.nunhebrew = 0x05e0; + t.nvsquare = 0x33b5; + t.nwsquare = 0x33bb; + t.nyabengali = 0x099e; + t.nyadeva = 0x091e; + t.nyagujarati = 0x0a9e; + t.nyagurmukhi = 0x0a1e; + t.o = 0x006f; + t.oacute = 0x00f3; + t.oangthai = 0x0e2d; + t.obarred = 0x0275; + t.obarredcyrillic = 0x04e9; + t.obarreddieresiscyrillic = 0x04eb; + t.obengali = 0x0993; + t.obopomofo = 0x311b; + t.obreve = 0x014f; + t.ocandradeva = 0x0911; + t.ocandragujarati = 0x0a91; + t.ocandravowelsigndeva = 0x0949; + t.ocandravowelsigngujarati = 0x0ac9; + t.ocaron = 0x01d2; + t.ocircle = 0x24de; + t.ocircumflex = 0x00f4; + t.ocircumflexacute = 0x1ed1; + t.ocircumflexdotbelow = 0x1ed9; + t.ocircumflexgrave = 0x1ed3; + t.ocircumflexhookabove = 0x1ed5; + t.ocircumflextilde = 0x1ed7; + t.ocyrillic = 0x043e; + t.odblacute = 0x0151; + t.odblgrave = 0x020d; + t.odeva = 0x0913; + t.odieresis = 0x00f6; + t.odieresiscyrillic = 0x04e7; + t.odotbelow = 0x1ecd; + t.oe = 0x0153; + t.oekorean = 0x315a; + t.ogonek = 0x02db; + t.ogonekcmb = 0x0328; + t.ograve = 0x00f2; + t.ogujarati = 0x0a93; + t.oharmenian = 0x0585; + t.ohiragana = 0x304a; + t.ohookabove = 0x1ecf; + t.ohorn = 0x01a1; + t.ohornacute = 0x1edb; + t.ohorndotbelow = 0x1ee3; + t.ohorngrave = 0x1edd; + t.ohornhookabove = 0x1edf; + t.ohorntilde = 0x1ee1; + t.ohungarumlaut = 0x0151; + t.oi = 0x01a3; + t.oinvertedbreve = 0x020f; + t.okatakana = 0x30aa; + t.okatakanahalfwidth = 0xff75; + t.okorean = 0x3157; + t.olehebrew = 0x05ab; + t.omacron = 0x014d; + t.omacronacute = 0x1e53; + t.omacrongrave = 0x1e51; + t.omdeva = 0x0950; + t.omega = 0x03c9; + t.omega1 = 0x03d6; + t.omegacyrillic = 0x0461; + t.omegalatinclosed = 0x0277; + t.omegaroundcyrillic = 0x047b; + t.omegatitlocyrillic = 0x047d; + t.omegatonos = 0x03ce; + t.omgujarati = 0x0ad0; + t.omicron = 0x03bf; + t.omicrontonos = 0x03cc; + t.omonospace = 0xff4f; + t.one = 0x0031; + t.onearabic = 0x0661; + t.onebengali = 0x09e7; + t.onecircle = 0x2460; + t.onecircleinversesansserif = 0x278a; + t.onedeva = 0x0967; + t.onedotenleader = 0x2024; + t.oneeighth = 0x215b; + t.onefitted = 0xf6dc; + t.onegujarati = 0x0ae7; + t.onegurmukhi = 0x0a67; + t.onehackarabic = 0x0661; + t.onehalf = 0x00bd; + t.onehangzhou = 0x3021; + t.oneideographicparen = 0x3220; + t.oneinferior = 0x2081; + t.onemonospace = 0xff11; + t.onenumeratorbengali = 0x09f4; + t.oneoldstyle = 0xf731; + t.oneparen = 0x2474; + t.oneperiod = 0x2488; + t.onepersian = 0x06f1; + t.onequarter = 0x00bc; + t.oneroman = 0x2170; + t.onesuperior = 0x00b9; + t.onethai = 0x0e51; + t.onethird = 0x2153; + t.oogonek = 0x01eb; + t.oogonekmacron = 0x01ed; + t.oogurmukhi = 0x0a13; + t.oomatragurmukhi = 0x0a4b; + t.oopen = 0x0254; + t.oparen = 0x24aa; + t.openbullet = 0x25e6; + t.option = 0x2325; + t.ordfeminine = 0x00aa; + t.ordmasculine = 0x00ba; + t.orthogonal = 0x221f; + t.oshortdeva = 0x0912; + t.oshortvowelsigndeva = 0x094a; + t.oslash = 0x00f8; + t.oslashacute = 0x01ff; + t.osmallhiragana = 0x3049; + t.osmallkatakana = 0x30a9; + t.osmallkatakanahalfwidth = 0xff6b; + t.ostrokeacute = 0x01ff; + t.osuperior = 0xf6f0; + t.otcyrillic = 0x047f; + t.otilde = 0x00f5; + t.otildeacute = 0x1e4d; + t.otildedieresis = 0x1e4f; + t.oubopomofo = 0x3121; + t.overline = 0x203e; + t.overlinecenterline = 0xfe4a; + t.overlinecmb = 0x0305; + t.overlinedashed = 0xfe49; + t.overlinedblwavy = 0xfe4c; + t.overlinewavy = 0xfe4b; + t.overscore = 0x00af; + t.ovowelsignbengali = 0x09cb; + t.ovowelsigndeva = 0x094b; + t.ovowelsigngujarati = 0x0acb; + t.p = 0x0070; + t.paampssquare = 0x3380; + t.paasentosquare = 0x332b; + t.pabengali = 0x09aa; + t.pacute = 0x1e55; + t.padeva = 0x092a; + t.pagedown = 0x21df; + t.pageup = 0x21de; + t.pagujarati = 0x0aaa; + t.pagurmukhi = 0x0a2a; + t.pahiragana = 0x3071; + t.paiyannoithai = 0x0e2f; + t.pakatakana = 0x30d1; + t.palatalizationcyrilliccmb = 0x0484; + t.palochkacyrillic = 0x04c0; + t.pansioskorean = 0x317f; + t.paragraph = 0x00b6; + t.parallel = 0x2225; + t.parenleft = 0x0028; + t.parenleftaltonearabic = 0xfd3e; + t.parenleftbt = 0xf8ed; + t.parenleftex = 0xf8ec; + t.parenleftinferior = 0x208d; + t.parenleftmonospace = 0xff08; + t.parenleftsmall = 0xfe59; + t.parenleftsuperior = 0x207d; + t.parenlefttp = 0xf8eb; + t.parenleftvertical = 0xfe35; + t.parenright = 0x0029; + t.parenrightaltonearabic = 0xfd3f; + t.parenrightbt = 0xf8f8; + t.parenrightex = 0xf8f7; + t.parenrightinferior = 0x208e; + t.parenrightmonospace = 0xff09; + t.parenrightsmall = 0xfe5a; + t.parenrightsuperior = 0x207e; + t.parenrighttp = 0xf8f6; + t.parenrightvertical = 0xfe36; + t.partialdiff = 0x2202; + t.paseqhebrew = 0x05c0; + t.pashtahebrew = 0x0599; + t.pasquare = 0x33a9; + t.patah = 0x05b7; + t.patah11 = 0x05b7; + t.patah1d = 0x05b7; + t.patah2a = 0x05b7; + t.patahhebrew = 0x05b7; + t.patahnarrowhebrew = 0x05b7; + t.patahquarterhebrew = 0x05b7; + t.patahwidehebrew = 0x05b7; + t.pazerhebrew = 0x05a1; + t.pbopomofo = 0x3106; + t.pcircle = 0x24df; + t.pdotaccent = 0x1e57; + t.pe = 0x05e4; + t.pecyrillic = 0x043f; + t.pedagesh = 0xfb44; + t.pedageshhebrew = 0xfb44; + t.peezisquare = 0x333b; + t.pefinaldageshhebrew = 0xfb43; + t.peharabic = 0x067e; + t.peharmenian = 0x057a; + t.pehebrew = 0x05e4; + t.pehfinalarabic = 0xfb57; + t.pehinitialarabic = 0xfb58; + t.pehiragana = 0x307a; + t.pehmedialarabic = 0xfb59; + t.pekatakana = 0x30da; + t.pemiddlehookcyrillic = 0x04a7; + t.perafehebrew = 0xfb4e; + t.percent = 0x0025; + t.percentarabic = 0x066a; + t.percentmonospace = 0xff05; + t.percentsmall = 0xfe6a; + t.period = 0x002e; + t.periodarmenian = 0x0589; + t.periodcentered = 0x00b7; + t.periodhalfwidth = 0xff61; + t.periodinferior = 0xf6e7; + t.periodmonospace = 0xff0e; + t.periodsmall = 0xfe52; + t.periodsuperior = 0xf6e8; + t.perispomenigreekcmb = 0x0342; + t.perpendicular = 0x22a5; + t.perthousand = 0x2030; + t.peseta = 0x20a7; + t.pfsquare = 0x338a; + t.phabengali = 0x09ab; + t.phadeva = 0x092b; + t.phagujarati = 0x0aab; + t.phagurmukhi = 0x0a2b; + t.phi = 0x03c6; + t.phi1 = 0x03d5; + t.phieuphacirclekorean = 0x327a; + t.phieuphaparenkorean = 0x321a; + t.phieuphcirclekorean = 0x326c; + t.phieuphkorean = 0x314d; + t.phieuphparenkorean = 0x320c; + t.philatin = 0x0278; + t.phinthuthai = 0x0e3a; + t.phisymbolgreek = 0x03d5; + t.phook = 0x01a5; + t.phophanthai = 0x0e1e; + t.phophungthai = 0x0e1c; + t.phosamphaothai = 0x0e20; + t.pi = 0x03c0; + t.pieupacirclekorean = 0x3273; + t.pieupaparenkorean = 0x3213; + t.pieupcieuckorean = 0x3176; + t.pieupcirclekorean = 0x3265; + t.pieupkiyeokkorean = 0x3172; + t.pieupkorean = 0x3142; + t.pieupparenkorean = 0x3205; + t.pieupsioskiyeokkorean = 0x3174; + t.pieupsioskorean = 0x3144; + t.pieupsiostikeutkorean = 0x3175; + t.pieupthieuthkorean = 0x3177; + t.pieuptikeutkorean = 0x3173; + t.pihiragana = 0x3074; + t.pikatakana = 0x30d4; + t.pisymbolgreek = 0x03d6; + t.piwrarmenian = 0x0583; + t.planckover2pi = 0x210f; + t.planckover2pi1 = 0x210f; + t.plus = 0x002b; + t.plusbelowcmb = 0x031f; + t.pluscircle = 0x2295; + t.plusminus = 0x00b1; + t.plusmod = 0x02d6; + t.plusmonospace = 0xff0b; + t.plussmall = 0xfe62; + t.plussuperior = 0x207a; + t.pmonospace = 0xff50; + t.pmsquare = 0x33d8; + t.pohiragana = 0x307d; + t.pointingindexdownwhite = 0x261f; + t.pointingindexleftwhite = 0x261c; + t.pointingindexrightwhite = 0x261e; + t.pointingindexupwhite = 0x261d; + t.pokatakana = 0x30dd; + t.poplathai = 0x0e1b; + t.postalmark = 0x3012; + t.postalmarkface = 0x3020; + t.pparen = 0x24ab; + t.precedes = 0x227a; + t.prescription = 0x211e; + t.primemod = 0x02b9; + t.primereversed = 0x2035; + t.product = 0x220f; + t.projective = 0x2305; + t.prolongedkana = 0x30fc; + t.propellor = 0x2318; + t.propersubset = 0x2282; + t.propersuperset = 0x2283; + t.proportion = 0x2237; + t.proportional = 0x221d; + t.psi = 0x03c8; + t.psicyrillic = 0x0471; + t.psilipneumatacyrilliccmb = 0x0486; + t.pssquare = 0x33b0; + t.puhiragana = 0x3077; + t.pukatakana = 0x30d7; + t.pvsquare = 0x33b4; + t.pwsquare = 0x33ba; + t.q = 0x0071; + t.qadeva = 0x0958; + t.qadmahebrew = 0x05a8; + t.qafarabic = 0x0642; + t.qaffinalarabic = 0xfed6; + t.qafinitialarabic = 0xfed7; + t.qafmedialarabic = 0xfed8; + t.qamats = 0x05b8; + t.qamats10 = 0x05b8; + t.qamats1a = 0x05b8; + t.qamats1c = 0x05b8; + t.qamats27 = 0x05b8; + t.qamats29 = 0x05b8; + t.qamats33 = 0x05b8; + t.qamatsde = 0x05b8; + t.qamatshebrew = 0x05b8; + t.qamatsnarrowhebrew = 0x05b8; + t.qamatsqatanhebrew = 0x05b8; + t.qamatsqatannarrowhebrew = 0x05b8; + t.qamatsqatanquarterhebrew = 0x05b8; + t.qamatsqatanwidehebrew = 0x05b8; + t.qamatsquarterhebrew = 0x05b8; + t.qamatswidehebrew = 0x05b8; + t.qarneyparahebrew = 0x059f; + t.qbopomofo = 0x3111; + t.qcircle = 0x24e0; + t.qhook = 0x02a0; + t.qmonospace = 0xff51; + t.qof = 0x05e7; + t.qofdagesh = 0xfb47; + t.qofdageshhebrew = 0xfb47; + t.qofhebrew = 0x05e7; + t.qparen = 0x24ac; + t.quarternote = 0x2669; + t.qubuts = 0x05bb; + t.qubuts18 = 0x05bb; + t.qubuts25 = 0x05bb; + t.qubuts31 = 0x05bb; + t.qubutshebrew = 0x05bb; + t.qubutsnarrowhebrew = 0x05bb; + t.qubutsquarterhebrew = 0x05bb; + t.qubutswidehebrew = 0x05bb; + t.question = 0x003f; + t.questionarabic = 0x061f; + t.questionarmenian = 0x055e; + t.questiondown = 0x00bf; + t.questiondownsmall = 0xf7bf; + t.questiongreek = 0x037e; + t.questionmonospace = 0xff1f; + t.questionsmall = 0xf73f; + t.quotedbl = 0x0022; + t.quotedblbase = 0x201e; + t.quotedblleft = 0x201c; + t.quotedblmonospace = 0xff02; + t.quotedblprime = 0x301e; + t.quotedblprimereversed = 0x301d; + t.quotedblright = 0x201d; + t.quoteleft = 0x2018; + t.quoteleftreversed = 0x201b; + t.quotereversed = 0x201b; + t.quoteright = 0x2019; + t.quoterightn = 0x0149; + t.quotesinglbase = 0x201a; + t.quotesingle = 0x0027; + t.quotesinglemonospace = 0xff07; + t.r = 0x0072; + t.raarmenian = 0x057c; + t.rabengali = 0x09b0; + t.racute = 0x0155; + t.radeva = 0x0930; + t.radical = 0x221a; + t.radicalex = 0xf8e5; + t.radoverssquare = 0x33ae; + t.radoverssquaredsquare = 0x33af; + t.radsquare = 0x33ad; + t.rafe = 0x05bf; + t.rafehebrew = 0x05bf; + t.ragujarati = 0x0ab0; + t.ragurmukhi = 0x0a30; + t.rahiragana = 0x3089; + t.rakatakana = 0x30e9; + t.rakatakanahalfwidth = 0xff97; + t.ralowerdiagonalbengali = 0x09f1; + t.ramiddlediagonalbengali = 0x09f0; + t.ramshorn = 0x0264; + t.ratio = 0x2236; + t.rbopomofo = 0x3116; + t.rcaron = 0x0159; + t.rcedilla = 0x0157; + t.rcircle = 0x24e1; + t.rcommaaccent = 0x0157; + t.rdblgrave = 0x0211; + t.rdotaccent = 0x1e59; + t.rdotbelow = 0x1e5b; + t.rdotbelowmacron = 0x1e5d; + t.referencemark = 0x203b; + t.reflexsubset = 0x2286; + t.reflexsuperset = 0x2287; + t.registered = 0x00ae; + t.registersans = 0xf8e8; + t.registerserif = 0xf6da; + t.reharabic = 0x0631; + t.reharmenian = 0x0580; + t.rehfinalarabic = 0xfeae; + t.rehiragana = 0x308c; + t.rekatakana = 0x30ec; + t.rekatakanahalfwidth = 0xff9a; + t.resh = 0x05e8; + t.reshdageshhebrew = 0xfb48; + t.reshhebrew = 0x05e8; + t.reversedtilde = 0x223d; + t.reviahebrew = 0x0597; + t.reviamugrashhebrew = 0x0597; + t.revlogicalnot = 0x2310; + t.rfishhook = 0x027e; + t.rfishhookreversed = 0x027f; + t.rhabengali = 0x09dd; + t.rhadeva = 0x095d; + t.rho = 0x03c1; + t.rhook = 0x027d; + t.rhookturned = 0x027b; + t.rhookturnedsuperior = 0x02b5; + t.rhosymbolgreek = 0x03f1; + t.rhotichookmod = 0x02de; + t.rieulacirclekorean = 0x3271; + t.rieulaparenkorean = 0x3211; + t.rieulcirclekorean = 0x3263; + t.rieulhieuhkorean = 0x3140; + t.rieulkiyeokkorean = 0x313a; + t.rieulkiyeoksioskorean = 0x3169; + t.rieulkorean = 0x3139; + t.rieulmieumkorean = 0x313b; + t.rieulpansioskorean = 0x316c; + t.rieulparenkorean = 0x3203; + t.rieulphieuphkorean = 0x313f; + t.rieulpieupkorean = 0x313c; + t.rieulpieupsioskorean = 0x316b; + t.rieulsioskorean = 0x313d; + t.rieulthieuthkorean = 0x313e; + t.rieultikeutkorean = 0x316a; + t.rieulyeorinhieuhkorean = 0x316d; + t.rightangle = 0x221f; + t.righttackbelowcmb = 0x0319; + t.righttriangle = 0x22bf; + t.rihiragana = 0x308a; + t.rikatakana = 0x30ea; + t.rikatakanahalfwidth = 0xff98; + t.ring = 0x02da; + t.ringbelowcmb = 0x0325; + t.ringcmb = 0x030a; + t.ringhalfleft = 0x02bf; + t.ringhalfleftarmenian = 0x0559; + t.ringhalfleftbelowcmb = 0x031c; + t.ringhalfleftcentered = 0x02d3; + t.ringhalfright = 0x02be; + t.ringhalfrightbelowcmb = 0x0339; + t.ringhalfrightcentered = 0x02d2; + t.rinvertedbreve = 0x0213; + t.rittorusquare = 0x3351; + t.rlinebelow = 0x1e5f; + t.rlongleg = 0x027c; + t.rlonglegturned = 0x027a; + t.rmonospace = 0xff52; + t.rohiragana = 0x308d; + t.rokatakana = 0x30ed; + t.rokatakanahalfwidth = 0xff9b; + t.roruathai = 0x0e23; + t.rparen = 0x24ad; + t.rrabengali = 0x09dc; + t.rradeva = 0x0931; + t.rragurmukhi = 0x0a5c; + t.rreharabic = 0x0691; + t.rrehfinalarabic = 0xfb8d; + t.rrvocalicbengali = 0x09e0; + t.rrvocalicdeva = 0x0960; + t.rrvocalicgujarati = 0x0ae0; + t.rrvocalicvowelsignbengali = 0x09c4; + t.rrvocalicvowelsigndeva = 0x0944; + t.rrvocalicvowelsigngujarati = 0x0ac4; + t.rsuperior = 0xf6f1; + t.rtblock = 0x2590; + t.rturned = 0x0279; + t.rturnedsuperior = 0x02b4; + t.ruhiragana = 0x308b; + t.rukatakana = 0x30eb; + t.rukatakanahalfwidth = 0xff99; + t.rupeemarkbengali = 0x09f2; + t.rupeesignbengali = 0x09f3; + t.rupiah = 0xf6dd; + t.ruthai = 0x0e24; + t.rvocalicbengali = 0x098b; + t.rvocalicdeva = 0x090b; + t.rvocalicgujarati = 0x0a8b; + t.rvocalicvowelsignbengali = 0x09c3; + t.rvocalicvowelsigndeva = 0x0943; + t.rvocalicvowelsigngujarati = 0x0ac3; + t.s = 0x0073; + t.sabengali = 0x09b8; + t.sacute = 0x015b; + t.sacutedotaccent = 0x1e65; + t.sadarabic = 0x0635; + t.sadeva = 0x0938; + t.sadfinalarabic = 0xfeba; + t.sadinitialarabic = 0xfebb; + t.sadmedialarabic = 0xfebc; + t.sagujarati = 0x0ab8; + t.sagurmukhi = 0x0a38; + t.sahiragana = 0x3055; + t.sakatakana = 0x30b5; + t.sakatakanahalfwidth = 0xff7b; + t.sallallahoualayhewasallamarabic = 0xfdfa; + t.samekh = 0x05e1; + t.samekhdagesh = 0xfb41; + t.samekhdageshhebrew = 0xfb41; + t.samekhhebrew = 0x05e1; + t.saraaathai = 0x0e32; + t.saraaethai = 0x0e41; + t.saraaimaimalaithai = 0x0e44; + t.saraaimaimuanthai = 0x0e43; + t.saraamthai = 0x0e33; + t.saraathai = 0x0e30; + t.saraethai = 0x0e40; + t.saraiileftthai = 0xf886; + t.saraiithai = 0x0e35; + t.saraileftthai = 0xf885; + t.saraithai = 0x0e34; + t.saraothai = 0x0e42; + t.saraueeleftthai = 0xf888; + t.saraueethai = 0x0e37; + t.saraueleftthai = 0xf887; + t.sarauethai = 0x0e36; + t.sarauthai = 0x0e38; + t.sarauuthai = 0x0e39; + t.sbopomofo = 0x3119; + t.scaron = 0x0161; + t.scarondotaccent = 0x1e67; + t.scedilla = 0x015f; + t.schwa = 0x0259; + t.schwacyrillic = 0x04d9; + t.schwadieresiscyrillic = 0x04db; + t.schwahook = 0x025a; + t.scircle = 0x24e2; + t.scircumflex = 0x015d; + t.scommaaccent = 0x0219; + t.sdotaccent = 0x1e61; + t.sdotbelow = 0x1e63; + t.sdotbelowdotaccent = 0x1e69; + t.seagullbelowcmb = 0x033c; + t.second = 0x2033; + t.secondtonechinese = 0x02ca; + t.section = 0x00a7; + t.seenarabic = 0x0633; + t.seenfinalarabic = 0xfeb2; + t.seeninitialarabic = 0xfeb3; + t.seenmedialarabic = 0xfeb4; + t.segol = 0x05b6; + t.segol13 = 0x05b6; + t.segol1f = 0x05b6; + t.segol2c = 0x05b6; + t.segolhebrew = 0x05b6; + t.segolnarrowhebrew = 0x05b6; + t.segolquarterhebrew = 0x05b6; + t.segoltahebrew = 0x0592; + t.segolwidehebrew = 0x05b6; + t.seharmenian = 0x057d; + t.sehiragana = 0x305b; + t.sekatakana = 0x30bb; + t.sekatakanahalfwidth = 0xff7e; + t.semicolon = 0x003b; + t.semicolonarabic = 0x061b; + t.semicolonmonospace = 0xff1b; + t.semicolonsmall = 0xfe54; + t.semivoicedmarkkana = 0x309c; + t.semivoicedmarkkanahalfwidth = 0xff9f; + t.sentisquare = 0x3322; + t.sentosquare = 0x3323; + t.seven = 0x0037; + t.sevenarabic = 0x0667; + t.sevenbengali = 0x09ed; + t.sevencircle = 0x2466; + t.sevencircleinversesansserif = 0x2790; + t.sevendeva = 0x096d; + t.seveneighths = 0x215e; + t.sevengujarati = 0x0aed; + t.sevengurmukhi = 0x0a6d; + t.sevenhackarabic = 0x0667; + t.sevenhangzhou = 0x3027; + t.sevenideographicparen = 0x3226; + t.seveninferior = 0x2087; + t.sevenmonospace = 0xff17; + t.sevenoldstyle = 0xf737; + t.sevenparen = 0x247a; + t.sevenperiod = 0x248e; + t.sevenpersian = 0x06f7; + t.sevenroman = 0x2176; + t.sevensuperior = 0x2077; + t.seventeencircle = 0x2470; + t.seventeenparen = 0x2484; + t.seventeenperiod = 0x2498; + t.seventhai = 0x0e57; + t.sfthyphen = 0x00ad; + t.shaarmenian = 0x0577; + t.shabengali = 0x09b6; + t.shacyrillic = 0x0448; + t.shaddaarabic = 0x0651; + t.shaddadammaarabic = 0xfc61; + t.shaddadammatanarabic = 0xfc5e; + t.shaddafathaarabic = 0xfc60; + t.shaddakasraarabic = 0xfc62; + t.shaddakasratanarabic = 0xfc5f; + t.shade = 0x2592; + t.shadedark = 0x2593; + t.shadelight = 0x2591; + t.shademedium = 0x2592; + t.shadeva = 0x0936; + t.shagujarati = 0x0ab6; + t.shagurmukhi = 0x0a36; + t.shalshelethebrew = 0x0593; + t.shbopomofo = 0x3115; + t.shchacyrillic = 0x0449; + t.sheenarabic = 0x0634; + t.sheenfinalarabic = 0xfeb6; + t.sheeninitialarabic = 0xfeb7; + t.sheenmedialarabic = 0xfeb8; + t.sheicoptic = 0x03e3; + t.sheqel = 0x20aa; + t.sheqelhebrew = 0x20aa; + t.sheva = 0x05b0; + t.sheva115 = 0x05b0; + t.sheva15 = 0x05b0; + t.sheva22 = 0x05b0; + t.sheva2e = 0x05b0; + t.shevahebrew = 0x05b0; + t.shevanarrowhebrew = 0x05b0; + t.shevaquarterhebrew = 0x05b0; + t.shevawidehebrew = 0x05b0; + t.shhacyrillic = 0x04bb; + t.shimacoptic = 0x03ed; + t.shin = 0x05e9; + t.shindagesh = 0xfb49; + t.shindageshhebrew = 0xfb49; + t.shindageshshindot = 0xfb2c; + t.shindageshshindothebrew = 0xfb2c; + t.shindageshsindot = 0xfb2d; + t.shindageshsindothebrew = 0xfb2d; + t.shindothebrew = 0x05c1; + t.shinhebrew = 0x05e9; + t.shinshindot = 0xfb2a; + t.shinshindothebrew = 0xfb2a; + t.shinsindot = 0xfb2b; + t.shinsindothebrew = 0xfb2b; + t.shook = 0x0282; + t.sigma = 0x03c3; + t.sigma1 = 0x03c2; + t.sigmafinal = 0x03c2; + t.sigmalunatesymbolgreek = 0x03f2; + t.sihiragana = 0x3057; + t.sikatakana = 0x30b7; + t.sikatakanahalfwidth = 0xff7c; + t.siluqhebrew = 0x05bd; + t.siluqlefthebrew = 0x05bd; + t.similar = 0x223c; + t.sindothebrew = 0x05c2; + t.siosacirclekorean = 0x3274; + t.siosaparenkorean = 0x3214; + t.sioscieuckorean = 0x317e; + t.sioscirclekorean = 0x3266; + t.sioskiyeokkorean = 0x317a; + t.sioskorean = 0x3145; + t.siosnieunkorean = 0x317b; + t.siosparenkorean = 0x3206; + t.siospieupkorean = 0x317d; + t.siostikeutkorean = 0x317c; + t.six = 0x0036; + t.sixarabic = 0x0666; + t.sixbengali = 0x09ec; + t.sixcircle = 0x2465; + t.sixcircleinversesansserif = 0x278f; + t.sixdeva = 0x096c; + t.sixgujarati = 0x0aec; + t.sixgurmukhi = 0x0a6c; + t.sixhackarabic = 0x0666; + t.sixhangzhou = 0x3026; + t.sixideographicparen = 0x3225; + t.sixinferior = 0x2086; + t.sixmonospace = 0xff16; + t.sixoldstyle = 0xf736; + t.sixparen = 0x2479; + t.sixperiod = 0x248d; + t.sixpersian = 0x06f6; + t.sixroman = 0x2175; + t.sixsuperior = 0x2076; + t.sixteencircle = 0x246f; + t.sixteencurrencydenominatorbengali = 0x09f9; + t.sixteenparen = 0x2483; + t.sixteenperiod = 0x2497; + t.sixthai = 0x0e56; + t.slash = 0x002f; + t.slashmonospace = 0xff0f; + t.slong = 0x017f; + t.slongdotaccent = 0x1e9b; + t.smileface = 0x263a; + t.smonospace = 0xff53; + t.sofpasuqhebrew = 0x05c3; + t.softhyphen = 0x00ad; + t.softsigncyrillic = 0x044c; + t.sohiragana = 0x305d; + t.sokatakana = 0x30bd; + t.sokatakanahalfwidth = 0xff7f; + t.soliduslongoverlaycmb = 0x0338; + t.solidusshortoverlaycmb = 0x0337; + t.sorusithai = 0x0e29; + t.sosalathai = 0x0e28; + t.sosothai = 0x0e0b; + t.sosuathai = 0x0e2a; + t.space = 0x0020; + t.spacehackarabic = 0x0020; + t.spade = 0x2660; + t.spadesuitblack = 0x2660; + t.spadesuitwhite = 0x2664; + t.sparen = 0x24ae; + t.squarebelowcmb = 0x033b; + t.squarecc = 0x33c4; + t.squarecm = 0x339d; + t.squarediagonalcrosshatchfill = 0x25a9; + t.squarehorizontalfill = 0x25a4; + t.squarekg = 0x338f; + t.squarekm = 0x339e; + t.squarekmcapital = 0x33ce; + t.squareln = 0x33d1; + t.squarelog = 0x33d2; + t.squaremg = 0x338e; + t.squaremil = 0x33d5; + t.squaremm = 0x339c; + t.squaremsquared = 0x33a1; + t.squareorthogonalcrosshatchfill = 0x25a6; + t.squareupperlefttolowerrightfill = 0x25a7; + t.squareupperrighttolowerleftfill = 0x25a8; + t.squareverticalfill = 0x25a5; + t.squarewhitewithsmallblack = 0x25a3; + t.srsquare = 0x33db; + t.ssabengali = 0x09b7; + t.ssadeva = 0x0937; + t.ssagujarati = 0x0ab7; + t.ssangcieuckorean = 0x3149; + t.ssanghieuhkorean = 0x3185; + t.ssangieungkorean = 0x3180; + t.ssangkiyeokkorean = 0x3132; + t.ssangnieunkorean = 0x3165; + t.ssangpieupkorean = 0x3143; + t.ssangsioskorean = 0x3146; + t.ssangtikeutkorean = 0x3138; + t.ssuperior = 0xf6f2; + t.sterling = 0x00a3; + t.sterlingmonospace = 0xffe1; + t.strokelongoverlaycmb = 0x0336; + t.strokeshortoverlaycmb = 0x0335; + t.subset = 0x2282; + t.subsetnotequal = 0x228a; + t.subsetorequal = 0x2286; + t.succeeds = 0x227b; + t.suchthat = 0x220b; + t.suhiragana = 0x3059; + t.sukatakana = 0x30b9; + t.sukatakanahalfwidth = 0xff7d; + t.sukunarabic = 0x0652; + t.summation = 0x2211; + t.sun = 0x263c; + t.superset = 0x2283; + t.supersetnotequal = 0x228b; + t.supersetorequal = 0x2287; + t.svsquare = 0x33dc; + t.syouwaerasquare = 0x337c; + t.t = 0x0074; + t.tabengali = 0x09a4; + t.tackdown = 0x22a4; + t.tackleft = 0x22a3; + t.tadeva = 0x0924; + t.tagujarati = 0x0aa4; + t.tagurmukhi = 0x0a24; + t.taharabic = 0x0637; + t.tahfinalarabic = 0xfec2; + t.tahinitialarabic = 0xfec3; + t.tahiragana = 0x305f; + t.tahmedialarabic = 0xfec4; + t.taisyouerasquare = 0x337d; + t.takatakana = 0x30bf; + t.takatakanahalfwidth = 0xff80; + t.tatweelarabic = 0x0640; + t.tau = 0x03c4; + t.tav = 0x05ea; + t.tavdages = 0xfb4a; + t.tavdagesh = 0xfb4a; + t.tavdageshhebrew = 0xfb4a; + t.tavhebrew = 0x05ea; + t.tbar = 0x0167; + t.tbopomofo = 0x310a; + t.tcaron = 0x0165; + t.tccurl = 0x02a8; + t.tcedilla = 0x0163; + t.tcheharabic = 0x0686; + t.tchehfinalarabic = 0xfb7b; + t.tchehinitialarabic = 0xfb7c; + t.tchehmedialarabic = 0xfb7d; + t.tcircle = 0x24e3; + t.tcircumflexbelow = 0x1e71; + t.tcommaaccent = 0x0163; + t.tdieresis = 0x1e97; + t.tdotaccent = 0x1e6b; + t.tdotbelow = 0x1e6d; + t.tecyrillic = 0x0442; + t.tedescendercyrillic = 0x04ad; + t.teharabic = 0x062a; + t.tehfinalarabic = 0xfe96; + t.tehhahinitialarabic = 0xfca2; + t.tehhahisolatedarabic = 0xfc0c; + t.tehinitialarabic = 0xfe97; + t.tehiragana = 0x3066; + t.tehjeeminitialarabic = 0xfca1; + t.tehjeemisolatedarabic = 0xfc0b; + t.tehmarbutaarabic = 0x0629; + t.tehmarbutafinalarabic = 0xfe94; + t.tehmedialarabic = 0xfe98; + t.tehmeeminitialarabic = 0xfca4; + t.tehmeemisolatedarabic = 0xfc0e; + t.tehnoonfinalarabic = 0xfc73; + t.tekatakana = 0x30c6; + t.tekatakanahalfwidth = 0xff83; + t.telephone = 0x2121; + t.telephoneblack = 0x260e; + t.telishagedolahebrew = 0x05a0; + t.telishaqetanahebrew = 0x05a9; + t.tencircle = 0x2469; + t.tenideographicparen = 0x3229; + t.tenparen = 0x247d; + t.tenperiod = 0x2491; + t.tenroman = 0x2179; + t.tesh = 0x02a7; + t.tet = 0x05d8; + t.tetdagesh = 0xfb38; + t.tetdageshhebrew = 0xfb38; + t.tethebrew = 0x05d8; + t.tetsecyrillic = 0x04b5; + t.tevirhebrew = 0x059b; + t.tevirlefthebrew = 0x059b; + t.thabengali = 0x09a5; + t.thadeva = 0x0925; + t.thagujarati = 0x0aa5; + t.thagurmukhi = 0x0a25; + t.thalarabic = 0x0630; + t.thalfinalarabic = 0xfeac; + t.thanthakhatlowleftthai = 0xf898; + t.thanthakhatlowrightthai = 0xf897; + t.thanthakhatthai = 0x0e4c; + t.thanthakhatupperleftthai = 0xf896; + t.theharabic = 0x062b; + t.thehfinalarabic = 0xfe9a; + t.thehinitialarabic = 0xfe9b; + t.thehmedialarabic = 0xfe9c; + t.thereexists = 0x2203; + t.therefore = 0x2234; + t.theta = 0x03b8; + t.theta1 = 0x03d1; + t.thetasymbolgreek = 0x03d1; + t.thieuthacirclekorean = 0x3279; + t.thieuthaparenkorean = 0x3219; + t.thieuthcirclekorean = 0x326b; + t.thieuthkorean = 0x314c; + t.thieuthparenkorean = 0x320b; + t.thirteencircle = 0x246c; + t.thirteenparen = 0x2480; + t.thirteenperiod = 0x2494; + t.thonangmonthothai = 0x0e11; + t.thook = 0x01ad; + t.thophuthaothai = 0x0e12; + t.thorn = 0x00fe; + t.thothahanthai = 0x0e17; + t.thothanthai = 0x0e10; + t.thothongthai = 0x0e18; + t.thothungthai = 0x0e16; + t.thousandcyrillic = 0x0482; + t.thousandsseparatorarabic = 0x066c; + t.thousandsseparatorpersian = 0x066c; + t.three = 0x0033; + t.threearabic = 0x0663; + t.threebengali = 0x09e9; + t.threecircle = 0x2462; + t.threecircleinversesansserif = 0x278c; + t.threedeva = 0x0969; + t.threeeighths = 0x215c; + t.threegujarati = 0x0ae9; + t.threegurmukhi = 0x0a69; + t.threehackarabic = 0x0663; + t.threehangzhou = 0x3023; + t.threeideographicparen = 0x3222; + t.threeinferior = 0x2083; + t.threemonospace = 0xff13; + t.threenumeratorbengali = 0x09f6; + t.threeoldstyle = 0xf733; + t.threeparen = 0x2476; + t.threeperiod = 0x248a; + t.threepersian = 0x06f3; + t.threequarters = 0x00be; + t.threequartersemdash = 0xf6de; + t.threeroman = 0x2172; + t.threesuperior = 0x00b3; + t.threethai = 0x0e53; + t.thzsquare = 0x3394; + t.tihiragana = 0x3061; + t.tikatakana = 0x30c1; + t.tikatakanahalfwidth = 0xff81; + t.tikeutacirclekorean = 0x3270; + t.tikeutaparenkorean = 0x3210; + t.tikeutcirclekorean = 0x3262; + t.tikeutkorean = 0x3137; + t.tikeutparenkorean = 0x3202; + t.tilde = 0x02dc; + t.tildebelowcmb = 0x0330; + t.tildecmb = 0x0303; + t.tildecomb = 0x0303; + t.tildedoublecmb = 0x0360; + t.tildeoperator = 0x223c; + t.tildeoverlaycmb = 0x0334; + t.tildeverticalcmb = 0x033e; + t.timescircle = 0x2297; + t.tipehahebrew = 0x0596; + t.tipehalefthebrew = 0x0596; + t.tippigurmukhi = 0x0a70; + t.titlocyrilliccmb = 0x0483; + t.tiwnarmenian = 0x057f; + t.tlinebelow = 0x1e6f; + t.tmonospace = 0xff54; + t.toarmenian = 0x0569; + t.tohiragana = 0x3068; + t.tokatakana = 0x30c8; + t.tokatakanahalfwidth = 0xff84; + t.tonebarextrahighmod = 0x02e5; + t.tonebarextralowmod = 0x02e9; + t.tonebarhighmod = 0x02e6; + t.tonebarlowmod = 0x02e8; + t.tonebarmidmod = 0x02e7; + t.tonefive = 0x01bd; + t.tonesix = 0x0185; + t.tonetwo = 0x01a8; + t.tonos = 0x0384; + t.tonsquare = 0x3327; + t.topatakthai = 0x0e0f; + t.tortoiseshellbracketleft = 0x3014; + t.tortoiseshellbracketleftsmall = 0xfe5d; + t.tortoiseshellbracketleftvertical = 0xfe39; + t.tortoiseshellbracketright = 0x3015; + t.tortoiseshellbracketrightsmall = 0xfe5e; + t.tortoiseshellbracketrightvertical = 0xfe3a; + t.totaothai = 0x0e15; + t.tpalatalhook = 0x01ab; + t.tparen = 0x24af; + t.trademark = 0x2122; + t.trademarksans = 0xf8ea; + t.trademarkserif = 0xf6db; + t.tretroflexhook = 0x0288; + t.triagdn = 0x25bc; + t.triaglf = 0x25c4; + t.triagrt = 0x25ba; + t.triagup = 0x25b2; + t.ts = 0x02a6; + t.tsadi = 0x05e6; + t.tsadidagesh = 0xfb46; + t.tsadidageshhebrew = 0xfb46; + t.tsadihebrew = 0x05e6; + t.tsecyrillic = 0x0446; + t.tsere = 0x05b5; + t.tsere12 = 0x05b5; + t.tsere1e = 0x05b5; + t.tsere2b = 0x05b5; + t.tserehebrew = 0x05b5; + t.tserenarrowhebrew = 0x05b5; + t.tserequarterhebrew = 0x05b5; + t.tserewidehebrew = 0x05b5; + t.tshecyrillic = 0x045b; + t.tsuperior = 0xf6f3; + t.ttabengali = 0x099f; + t.ttadeva = 0x091f; + t.ttagujarati = 0x0a9f; + t.ttagurmukhi = 0x0a1f; + t.tteharabic = 0x0679; + t.ttehfinalarabic = 0xfb67; + t.ttehinitialarabic = 0xfb68; + t.ttehmedialarabic = 0xfb69; + t.tthabengali = 0x09a0; + t.tthadeva = 0x0920; + t.tthagujarati = 0x0aa0; + t.tthagurmukhi = 0x0a20; + t.tturned = 0x0287; + t.tuhiragana = 0x3064; + t.tukatakana = 0x30c4; + t.tukatakanahalfwidth = 0xff82; + t.tusmallhiragana = 0x3063; + t.tusmallkatakana = 0x30c3; + t.tusmallkatakanahalfwidth = 0xff6f; + t.twelvecircle = 0x246b; + t.twelveparen = 0x247f; + t.twelveperiod = 0x2493; + t.twelveroman = 0x217b; + t.twentycircle = 0x2473; + t.twentyhangzhou = 0x5344; + t.twentyparen = 0x2487; + t.twentyperiod = 0x249b; + t.two = 0x0032; + t.twoarabic = 0x0662; + t.twobengali = 0x09e8; + t.twocircle = 0x2461; + t.twocircleinversesansserif = 0x278b; + t.twodeva = 0x0968; + t.twodotenleader = 0x2025; + t.twodotleader = 0x2025; + t.twodotleadervertical = 0xfe30; + t.twogujarati = 0x0ae8; + t.twogurmukhi = 0x0a68; + t.twohackarabic = 0x0662; + t.twohangzhou = 0x3022; + t.twoideographicparen = 0x3221; + t.twoinferior = 0x2082; + t.twomonospace = 0xff12; + t.twonumeratorbengali = 0x09f5; + t.twooldstyle = 0xf732; + t.twoparen = 0x2475; + t.twoperiod = 0x2489; + t.twopersian = 0x06f2; + t.tworoman = 0x2171; + t.twostroke = 0x01bb; + t.twosuperior = 0x00b2; + t.twothai = 0x0e52; + t.twothirds = 0x2154; + t.u = 0x0075; + t.uacute = 0x00fa; + t.ubar = 0x0289; + t.ubengali = 0x0989; + t.ubopomofo = 0x3128; + t.ubreve = 0x016d; + t.ucaron = 0x01d4; + t.ucircle = 0x24e4; + t.ucircumflex = 0x00fb; + t.ucircumflexbelow = 0x1e77; + t.ucyrillic = 0x0443; + t.udattadeva = 0x0951; + t.udblacute = 0x0171; + t.udblgrave = 0x0215; + t.udeva = 0x0909; + t.udieresis = 0x00fc; + t.udieresisacute = 0x01d8; + t.udieresisbelow = 0x1e73; + t.udieresiscaron = 0x01da; + t.udieresiscyrillic = 0x04f1; + t.udieresisgrave = 0x01dc; + t.udieresismacron = 0x01d6; + t.udotbelow = 0x1ee5; + t.ugrave = 0x00f9; + t.ugujarati = 0x0a89; + t.ugurmukhi = 0x0a09; + t.uhiragana = 0x3046; + t.uhookabove = 0x1ee7; + t.uhorn = 0x01b0; + t.uhornacute = 0x1ee9; + t.uhorndotbelow = 0x1ef1; + t.uhorngrave = 0x1eeb; + t.uhornhookabove = 0x1eed; + t.uhorntilde = 0x1eef; + t.uhungarumlaut = 0x0171; + t.uhungarumlautcyrillic = 0x04f3; + t.uinvertedbreve = 0x0217; + t.ukatakana = 0x30a6; + t.ukatakanahalfwidth = 0xff73; + t.ukcyrillic = 0x0479; + t.ukorean = 0x315c; + t.umacron = 0x016b; + t.umacroncyrillic = 0x04ef; + t.umacrondieresis = 0x1e7b; + t.umatragurmukhi = 0x0a41; + t.umonospace = 0xff55; + t.underscore = 0x005f; + t.underscoredbl = 0x2017; + t.underscoremonospace = 0xff3f; + t.underscorevertical = 0xfe33; + t.underscorewavy = 0xfe4f; + t.union = 0x222a; + t.universal = 0x2200; + t.uogonek = 0x0173; + t.uparen = 0x24b0; + t.upblock = 0x2580; + t.upperdothebrew = 0x05c4; + t.upsilon = 0x03c5; + t.upsilondieresis = 0x03cb; + t.upsilondieresistonos = 0x03b0; + t.upsilonlatin = 0x028a; + t.upsilontonos = 0x03cd; + t.uptackbelowcmb = 0x031d; + t.uptackmod = 0x02d4; + t.uragurmukhi = 0x0a73; + t.uring = 0x016f; + t.ushortcyrillic = 0x045e; + t.usmallhiragana = 0x3045; + t.usmallkatakana = 0x30a5; + t.usmallkatakanahalfwidth = 0xff69; + t.ustraightcyrillic = 0x04af; + t.ustraightstrokecyrillic = 0x04b1; + t.utilde = 0x0169; + t.utildeacute = 0x1e79; + t.utildebelow = 0x1e75; + t.uubengali = 0x098a; + t.uudeva = 0x090a; + t.uugujarati = 0x0a8a; + t.uugurmukhi = 0x0a0a; + t.uumatragurmukhi = 0x0a42; + t.uuvowelsignbengali = 0x09c2; + t.uuvowelsigndeva = 0x0942; + t.uuvowelsigngujarati = 0x0ac2; + t.uvowelsignbengali = 0x09c1; + t.uvowelsigndeva = 0x0941; + t.uvowelsigngujarati = 0x0ac1; + t.v = 0x0076; + t.vadeva = 0x0935; + t.vagujarati = 0x0ab5; + t.vagurmukhi = 0x0a35; + t.vakatakana = 0x30f7; + t.vav = 0x05d5; + t.vavdagesh = 0xfb35; + t.vavdagesh65 = 0xfb35; + t.vavdageshhebrew = 0xfb35; + t.vavhebrew = 0x05d5; + t.vavholam = 0xfb4b; + t.vavholamhebrew = 0xfb4b; + t.vavvavhebrew = 0x05f0; + t.vavyodhebrew = 0x05f1; + t.vcircle = 0x24e5; + t.vdotbelow = 0x1e7f; + t.vecyrillic = 0x0432; + t.veharabic = 0x06a4; + t.vehfinalarabic = 0xfb6b; + t.vehinitialarabic = 0xfb6c; + t.vehmedialarabic = 0xfb6d; + t.vekatakana = 0x30f9; + t.venus = 0x2640; + t.verticalbar = 0x007c; + t.verticallineabovecmb = 0x030d; + t.verticallinebelowcmb = 0x0329; + t.verticallinelowmod = 0x02cc; + t.verticallinemod = 0x02c8; + t.vewarmenian = 0x057e; + t.vhook = 0x028b; + t.vikatakana = 0x30f8; + t.viramabengali = 0x09cd; + t.viramadeva = 0x094d; + t.viramagujarati = 0x0acd; + t.visargabengali = 0x0983; + t.visargadeva = 0x0903; + t.visargagujarati = 0x0a83; + t.vmonospace = 0xff56; + t.voarmenian = 0x0578; + t.voicediterationhiragana = 0x309e; + t.voicediterationkatakana = 0x30fe; + t.voicedmarkkana = 0x309b; + t.voicedmarkkanahalfwidth = 0xff9e; + t.vokatakana = 0x30fa; + t.vparen = 0x24b1; + t.vtilde = 0x1e7d; + t.vturned = 0x028c; + t.vuhiragana = 0x3094; + t.vukatakana = 0x30f4; + t.w = 0x0077; + t.wacute = 0x1e83; + t.waekorean = 0x3159; + t.wahiragana = 0x308f; + t.wakatakana = 0x30ef; + t.wakatakanahalfwidth = 0xff9c; + t.wakorean = 0x3158; + t.wasmallhiragana = 0x308e; + t.wasmallkatakana = 0x30ee; + t.wattosquare = 0x3357; + t.wavedash = 0x301c; + t.wavyunderscorevertical = 0xfe34; + t.wawarabic = 0x0648; + t.wawfinalarabic = 0xfeee; + t.wawhamzaabovearabic = 0x0624; + t.wawhamzaabovefinalarabic = 0xfe86; + t.wbsquare = 0x33dd; + t.wcircle = 0x24e6; + t.wcircumflex = 0x0175; + t.wdieresis = 0x1e85; + t.wdotaccent = 0x1e87; + t.wdotbelow = 0x1e89; + t.wehiragana = 0x3091; + t.weierstrass = 0x2118; + t.wekatakana = 0x30f1; + t.wekorean = 0x315e; + t.weokorean = 0x315d; + t.wgrave = 0x1e81; + t.whitebullet = 0x25e6; + t.whitecircle = 0x25cb; + t.whitecircleinverse = 0x25d9; + t.whitecornerbracketleft = 0x300e; + t.whitecornerbracketleftvertical = 0xfe43; + t.whitecornerbracketright = 0x300f; + t.whitecornerbracketrightvertical = 0xfe44; + t.whitediamond = 0x25c7; + t.whitediamondcontainingblacksmalldiamond = 0x25c8; + t.whitedownpointingsmalltriangle = 0x25bf; + t.whitedownpointingtriangle = 0x25bd; + t.whiteleftpointingsmalltriangle = 0x25c3; + t.whiteleftpointingtriangle = 0x25c1; + t.whitelenticularbracketleft = 0x3016; + t.whitelenticularbracketright = 0x3017; + t.whiterightpointingsmalltriangle = 0x25b9; + t.whiterightpointingtriangle = 0x25b7; + t.whitesmallsquare = 0x25ab; + t.whitesmilingface = 0x263a; + t.whitesquare = 0x25a1; + t.whitestar = 0x2606; + t.whitetelephone = 0x260f; + t.whitetortoiseshellbracketleft = 0x3018; + t.whitetortoiseshellbracketright = 0x3019; + t.whiteuppointingsmalltriangle = 0x25b5; + t.whiteuppointingtriangle = 0x25b3; + t.wihiragana = 0x3090; + t.wikatakana = 0x30f0; + t.wikorean = 0x315f; + t.wmonospace = 0xff57; + t.wohiragana = 0x3092; + t.wokatakana = 0x30f2; + t.wokatakanahalfwidth = 0xff66; + t.won = 0x20a9; + t.wonmonospace = 0xffe6; + t.wowaenthai = 0x0e27; + t.wparen = 0x24b2; + t.wring = 0x1e98; + t.wsuperior = 0x02b7; + t.wturned = 0x028d; + t.wynn = 0x01bf; + t.x = 0x0078; + t.xabovecmb = 0x033d; + t.xbopomofo = 0x3112; + t.xcircle = 0x24e7; + t.xdieresis = 0x1e8d; + t.xdotaccent = 0x1e8b; + t.xeharmenian = 0x056d; + t.xi = 0x03be; + t.xmonospace = 0xff58; + t.xparen = 0x24b3; + t.xsuperior = 0x02e3; + t.y = 0x0079; + t.yaadosquare = 0x334e; + t.yabengali = 0x09af; + t.yacute = 0x00fd; + t.yadeva = 0x092f; + t.yaekorean = 0x3152; + t.yagujarati = 0x0aaf; + t.yagurmukhi = 0x0a2f; + t.yahiragana = 0x3084; + t.yakatakana = 0x30e4; + t.yakatakanahalfwidth = 0xff94; + t.yakorean = 0x3151; + t.yamakkanthai = 0x0e4e; + t.yasmallhiragana = 0x3083; + t.yasmallkatakana = 0x30e3; + t.yasmallkatakanahalfwidth = 0xff6c; + t.yatcyrillic = 0x0463; + t.ycircle = 0x24e8; + t.ycircumflex = 0x0177; + t.ydieresis = 0x00ff; + t.ydotaccent = 0x1e8f; + t.ydotbelow = 0x1ef5; + t.yeharabic = 0x064a; + t.yehbarreearabic = 0x06d2; + t.yehbarreefinalarabic = 0xfbaf; + t.yehfinalarabic = 0xfef2; + t.yehhamzaabovearabic = 0x0626; + t.yehhamzaabovefinalarabic = 0xfe8a; + t.yehhamzaaboveinitialarabic = 0xfe8b; + t.yehhamzaabovemedialarabic = 0xfe8c; + t.yehinitialarabic = 0xfef3; + t.yehmedialarabic = 0xfef4; + t.yehmeeminitialarabic = 0xfcdd; + t.yehmeemisolatedarabic = 0xfc58; + t.yehnoonfinalarabic = 0xfc94; + t.yehthreedotsbelowarabic = 0x06d1; + t.yekorean = 0x3156; + t.yen = 0x00a5; + t.yenmonospace = 0xffe5; + t.yeokorean = 0x3155; + t.yeorinhieuhkorean = 0x3186; + t.yerahbenyomohebrew = 0x05aa; + t.yerahbenyomolefthebrew = 0x05aa; + t.yericyrillic = 0x044b; + t.yerudieresiscyrillic = 0x04f9; + t.yesieungkorean = 0x3181; + t.yesieungpansioskorean = 0x3183; + t.yesieungsioskorean = 0x3182; + t.yetivhebrew = 0x059a; + t.ygrave = 0x1ef3; + t.yhook = 0x01b4; + t.yhookabove = 0x1ef7; + t.yiarmenian = 0x0575; + t.yicyrillic = 0x0457; + t.yikorean = 0x3162; + t.yinyang = 0x262f; + t.yiwnarmenian = 0x0582; + t.ymonospace = 0xff59; + t.yod = 0x05d9; + t.yoddagesh = 0xfb39; + t.yoddageshhebrew = 0xfb39; + t.yodhebrew = 0x05d9; + t.yodyodhebrew = 0x05f2; + t.yodyodpatahhebrew = 0xfb1f; + t.yohiragana = 0x3088; + t.yoikorean = 0x3189; + t.yokatakana = 0x30e8; + t.yokatakanahalfwidth = 0xff96; + t.yokorean = 0x315b; + t.yosmallhiragana = 0x3087; + t.yosmallkatakana = 0x30e7; + t.yosmallkatakanahalfwidth = 0xff6e; + t.yotgreek = 0x03f3; + t.yoyaekorean = 0x3188; + t.yoyakorean = 0x3187; + t.yoyakthai = 0x0e22; + t.yoyingthai = 0x0e0d; + t.yparen = 0x24b4; + t.ypogegrammeni = 0x037a; + t.ypogegrammenigreekcmb = 0x0345; + t.yr = 0x01a6; + t.yring = 0x1e99; + t.ysuperior = 0x02b8; + t.ytilde = 0x1ef9; + t.yturned = 0x028e; + t.yuhiragana = 0x3086; + t.yuikorean = 0x318c; + t.yukatakana = 0x30e6; + t.yukatakanahalfwidth = 0xff95; + t.yukorean = 0x3160; + t.yusbigcyrillic = 0x046b; + t.yusbigiotifiedcyrillic = 0x046d; + t.yuslittlecyrillic = 0x0467; + t.yuslittleiotifiedcyrillic = 0x0469; + t.yusmallhiragana = 0x3085; + t.yusmallkatakana = 0x30e5; + t.yusmallkatakanahalfwidth = 0xff6d; + t.yuyekorean = 0x318b; + t.yuyeokorean = 0x318a; + t.yyabengali = 0x09df; + t.yyadeva = 0x095f; + t.z = 0x007a; + t.zaarmenian = 0x0566; + t.zacute = 0x017a; + t.zadeva = 0x095b; + t.zagurmukhi = 0x0a5b; + t.zaharabic = 0x0638; + t.zahfinalarabic = 0xfec6; + t.zahinitialarabic = 0xfec7; + t.zahiragana = 0x3056; + t.zahmedialarabic = 0xfec8; + t.zainarabic = 0x0632; + t.zainfinalarabic = 0xfeb0; + t.zakatakana = 0x30b6; + t.zaqefgadolhebrew = 0x0595; + t.zaqefqatanhebrew = 0x0594; + t.zarqahebrew = 0x0598; + t.zayin = 0x05d6; + t.zayindagesh = 0xfb36; + t.zayindageshhebrew = 0xfb36; + t.zayinhebrew = 0x05d6; + t.zbopomofo = 0x3117; + t.zcaron = 0x017e; + t.zcircle = 0x24e9; + t.zcircumflex = 0x1e91; + t.zcurl = 0x0291; + t.zdot = 0x017c; + t.zdotaccent = 0x017c; + t.zdotbelow = 0x1e93; + t.zecyrillic = 0x0437; + t.zedescendercyrillic = 0x0499; + t.zedieresiscyrillic = 0x04df; + t.zehiragana = 0x305c; + t.zekatakana = 0x30bc; + t.zero = 0x0030; + t.zeroarabic = 0x0660; + t.zerobengali = 0x09e6; + t.zerodeva = 0x0966; + t.zerogujarati = 0x0ae6; + t.zerogurmukhi = 0x0a66; + t.zerohackarabic = 0x0660; + t.zeroinferior = 0x2080; + t.zeromonospace = 0xff10; + t.zerooldstyle = 0xf730; + t.zeropersian = 0x06f0; + t.zerosuperior = 0x2070; + t.zerothai = 0x0e50; + t.zerowidthjoiner = 0xfeff; + t.zerowidthnonjoiner = 0x200c; + t.zerowidthspace = 0x200b; + t.zeta = 0x03b6; + t.zhbopomofo = 0x3113; + t.zhearmenian = 0x056a; + t.zhebrevecyrillic = 0x04c2; + t.zhecyrillic = 0x0436; + t.zhedescendercyrillic = 0x0497; + t.zhedieresiscyrillic = 0x04dd; + t.zihiragana = 0x3058; + t.zikatakana = 0x30b8; + t.zinorhebrew = 0x05ae; + t.zlinebelow = 0x1e95; + t.zmonospace = 0xff5a; + t.zohiragana = 0x305e; + t.zokatakana = 0x30be; + t.zparen = 0x24b5; + t.zretroflexhook = 0x0290; + t.zstroke = 0x01b6; + t.zuhiragana = 0x305a; + t.zukatakana = 0x30ba; + t[".notdef"] = 0x0000; + t.angbracketleftbig = 0x2329; + t.angbracketleftBig = 0x2329; + t.angbracketleftbigg = 0x2329; + t.angbracketleftBigg = 0x2329; + t.angbracketrightBig = 0x232a; + t.angbracketrightbig = 0x232a; + t.angbracketrightBigg = 0x232a; + t.angbracketrightbigg = 0x232a; + t.arrowhookleft = 0x21aa; + t.arrowhookright = 0x21a9; + t.arrowlefttophalf = 0x21bc; + t.arrowleftbothalf = 0x21bd; + t.arrownortheast = 0x2197; + t.arrownorthwest = 0x2196; + t.arrowrighttophalf = 0x21c0; + t.arrowrightbothalf = 0x21c1; + t.arrowsoutheast = 0x2198; + t.arrowsouthwest = 0x2199; + t.backslashbig = 0x2216; + t.backslashBig = 0x2216; + t.backslashBigg = 0x2216; + t.backslashbigg = 0x2216; + t.bardbl = 0x2016; + t.bracehtipdownleft = 0xfe37; + t.bracehtipdownright = 0xfe37; + t.bracehtipupleft = 0xfe38; + t.bracehtipupright = 0xfe38; + t.braceleftBig = 0x007b; + t.braceleftbig = 0x007b; + t.braceleftbigg = 0x007b; + t.braceleftBigg = 0x007b; + t.bracerightBig = 0x007d; + t.bracerightbig = 0x007d; + t.bracerightbigg = 0x007d; + t.bracerightBigg = 0x007d; + t.bracketleftbig = 0x005b; + t.bracketleftBig = 0x005b; + t.bracketleftbigg = 0x005b; + t.bracketleftBigg = 0x005b; + t.bracketrightBig = 0x005d; + t.bracketrightbig = 0x005d; + t.bracketrightbigg = 0x005d; + t.bracketrightBigg = 0x005d; + t.ceilingleftbig = 0x2308; + t.ceilingleftBig = 0x2308; + t.ceilingleftBigg = 0x2308; + t.ceilingleftbigg = 0x2308; + t.ceilingrightbig = 0x2309; + t.ceilingrightBig = 0x2309; + t.ceilingrightbigg = 0x2309; + t.ceilingrightBigg = 0x2309; + t.circledotdisplay = 0x2299; + t.circledottext = 0x2299; + t.circlemultiplydisplay = 0x2297; + t.circlemultiplytext = 0x2297; + t.circleplusdisplay = 0x2295; + t.circleplustext = 0x2295; + t.contintegraldisplay = 0x222e; + t.contintegraltext = 0x222e; + t.coproductdisplay = 0x2210; + t.coproducttext = 0x2210; + t.floorleftBig = 0x230a; + t.floorleftbig = 0x230a; + t.floorleftbigg = 0x230a; + t.floorleftBigg = 0x230a; + t.floorrightbig = 0x230b; + t.floorrightBig = 0x230b; + t.floorrightBigg = 0x230b; + t.floorrightbigg = 0x230b; + t.hatwide = 0x0302; + t.hatwider = 0x0302; + t.hatwidest = 0x0302; + t.intercal = 0x1d40; + t.integraldisplay = 0x222b; + t.integraltext = 0x222b; + t.intersectiondisplay = 0x22c2; + t.intersectiontext = 0x22c2; + t.logicalanddisplay = 0x2227; + t.logicalandtext = 0x2227; + t.logicalordisplay = 0x2228; + t.logicalortext = 0x2228; + t.parenleftBig = 0x0028; + t.parenleftbig = 0x0028; + t.parenleftBigg = 0x0028; + t.parenleftbigg = 0x0028; + t.parenrightBig = 0x0029; + t.parenrightbig = 0x0029; + t.parenrightBigg = 0x0029; + t.parenrightbigg = 0x0029; + t.prime = 0x2032; + t.productdisplay = 0x220f; + t.producttext = 0x220f; + t.radicalbig = 0x221a; + t.radicalBig = 0x221a; + t.radicalBigg = 0x221a; + t.radicalbigg = 0x221a; + t.radicalbt = 0x221a; + t.radicaltp = 0x221a; + t.radicalvertex = 0x221a; + t.slashbig = 0x002f; + t.slashBig = 0x002f; + t.slashBigg = 0x002f; + t.slashbigg = 0x002f; + t.summationdisplay = 0x2211; + t.summationtext = 0x2211; + t.tildewide = 0x02dc; + t.tildewider = 0x02dc; + t.tildewidest = 0x02dc; + t.uniondisplay = 0x22c3; + t.unionmultidisplay = 0x228e; + t.unionmultitext = 0x228e; + t.unionsqdisplay = 0x2294; + t.unionsqtext = 0x2294; + t.uniontext = 0x22c3; + t.vextenddouble = 0x2225; + t.vextendsingle = 0x2223; +}); +const getDingbatsGlyphsUnicode = getLookupTableFactory(function (t) { + t.space = 0x0020; + t.a1 = 0x2701; + t.a2 = 0x2702; + t.a202 = 0x2703; + t.a3 = 0x2704; + t.a4 = 0x260e; + t.a5 = 0x2706; + t.a119 = 0x2707; + t.a118 = 0x2708; + t.a117 = 0x2709; + t.a11 = 0x261b; + t.a12 = 0x261e; + t.a13 = 0x270c; + t.a14 = 0x270d; + t.a15 = 0x270e; + t.a16 = 0x270f; + t.a105 = 0x2710; + t.a17 = 0x2711; + t.a18 = 0x2712; + t.a19 = 0x2713; + t.a20 = 0x2714; + t.a21 = 0x2715; + t.a22 = 0x2716; + t.a23 = 0x2717; + t.a24 = 0x2718; + t.a25 = 0x2719; + t.a26 = 0x271a; + t.a27 = 0x271b; + t.a28 = 0x271c; + t.a6 = 0x271d; + t.a7 = 0x271e; + t.a8 = 0x271f; + t.a9 = 0x2720; + t.a10 = 0x2721; + t.a29 = 0x2722; + t.a30 = 0x2723; + t.a31 = 0x2724; + t.a32 = 0x2725; + t.a33 = 0x2726; + t.a34 = 0x2727; + t.a35 = 0x2605; + t.a36 = 0x2729; + t.a37 = 0x272a; + t.a38 = 0x272b; + t.a39 = 0x272c; + t.a40 = 0x272d; + t.a41 = 0x272e; + t.a42 = 0x272f; + t.a43 = 0x2730; + t.a44 = 0x2731; + t.a45 = 0x2732; + t.a46 = 0x2733; + t.a47 = 0x2734; + t.a48 = 0x2735; + t.a49 = 0x2736; + t.a50 = 0x2737; + t.a51 = 0x2738; + t.a52 = 0x2739; + t.a53 = 0x273a; + t.a54 = 0x273b; + t.a55 = 0x273c; + t.a56 = 0x273d; + t.a57 = 0x273e; + t.a58 = 0x273f; + t.a59 = 0x2740; + t.a60 = 0x2741; + t.a61 = 0x2742; + t.a62 = 0x2743; + t.a63 = 0x2744; + t.a64 = 0x2745; + t.a65 = 0x2746; + t.a66 = 0x2747; + t.a67 = 0x2748; + t.a68 = 0x2749; + t.a69 = 0x274a; + t.a70 = 0x274b; + t.a71 = 0x25cf; + t.a72 = 0x274d; + t.a73 = 0x25a0; + t.a74 = 0x274f; + t.a203 = 0x2750; + t.a75 = 0x2751; + t.a204 = 0x2752; + t.a76 = 0x25b2; + t.a77 = 0x25bc; + t.a78 = 0x25c6; + t.a79 = 0x2756; + t.a81 = 0x25d7; + t.a82 = 0x2758; + t.a83 = 0x2759; + t.a84 = 0x275a; + t.a97 = 0x275b; + t.a98 = 0x275c; + t.a99 = 0x275d; + t.a100 = 0x275e; + t.a101 = 0x2761; + t.a102 = 0x2762; + t.a103 = 0x2763; + t.a104 = 0x2764; + t.a106 = 0x2765; + t.a107 = 0x2766; + t.a108 = 0x2767; + t.a112 = 0x2663; + t.a111 = 0x2666; + t.a110 = 0x2665; + t.a109 = 0x2660; + t.a120 = 0x2460; + t.a121 = 0x2461; + t.a122 = 0x2462; + t.a123 = 0x2463; + t.a124 = 0x2464; + t.a125 = 0x2465; + t.a126 = 0x2466; + t.a127 = 0x2467; + t.a128 = 0x2468; + t.a129 = 0x2469; + t.a130 = 0x2776; + t.a131 = 0x2777; + t.a132 = 0x2778; + t.a133 = 0x2779; + t.a134 = 0x277a; + t.a135 = 0x277b; + t.a136 = 0x277c; + t.a137 = 0x277d; + t.a138 = 0x277e; + t.a139 = 0x277f; + t.a140 = 0x2780; + t.a141 = 0x2781; + t.a142 = 0x2782; + t.a143 = 0x2783; + t.a144 = 0x2784; + t.a145 = 0x2785; + t.a146 = 0x2786; + t.a147 = 0x2787; + t.a148 = 0x2788; + t.a149 = 0x2789; + t.a150 = 0x278a; + t.a151 = 0x278b; + t.a152 = 0x278c; + t.a153 = 0x278d; + t.a154 = 0x278e; + t.a155 = 0x278f; + t.a156 = 0x2790; + t.a157 = 0x2791; + t.a158 = 0x2792; + t.a159 = 0x2793; + t.a160 = 0x2794; + t.a161 = 0x2192; + t.a163 = 0x2194; + t.a164 = 0x2195; + t.a196 = 0x2798; + t.a165 = 0x2799; + t.a192 = 0x279a; + t.a166 = 0x279b; + t.a167 = 0x279c; + t.a168 = 0x279d; + t.a169 = 0x279e; + t.a170 = 0x279f; + t.a171 = 0x27a0; + t.a172 = 0x27a1; + t.a173 = 0x27a2; + t.a162 = 0x27a3; + t.a174 = 0x27a4; + t.a175 = 0x27a5; + t.a176 = 0x27a6; + t.a177 = 0x27a7; + t.a178 = 0x27a8; + t.a179 = 0x27a9; + t.a193 = 0x27aa; + t.a180 = 0x27ab; + t.a199 = 0x27ac; + t.a181 = 0x27ad; + t.a200 = 0x27ae; + t.a182 = 0x27af; + t.a201 = 0x27b1; + t.a183 = 0x27b2; + t.a184 = 0x27b3; + t.a197 = 0x27b4; + t.a185 = 0x27b5; + t.a194 = 0x27b6; + t.a198 = 0x27b7; + t.a186 = 0x27b8; + t.a195 = 0x27b9; + t.a187 = 0x27ba; + t.a188 = 0x27bb; + t.a189 = 0x27bc; + t.a190 = 0x27bd; + t.a191 = 0x27be; + t.a89 = 0x2768; + t.a90 = 0x2769; + t.a93 = 0x276a; + t.a94 = 0x276b; + t.a91 = 0x276c; + t.a92 = 0x276d; + t.a205 = 0x276e; + t.a85 = 0x276f; + t.a206 = 0x2770; + t.a86 = 0x2771; + t.a87 = 0x2772; + t.a88 = 0x2773; + t.a95 = 0x2774; + t.a96 = 0x2775; + t[".notdef"] = 0x0000; +}); + +;// CONCATENATED MODULE: ./src/core/unicode.js + +const getSpecialPUASymbols = getLookupTableFactory(function (t) { + t[63721] = 0x00a9; + t[63193] = 0x00a9; + t[63720] = 0x00ae; + t[63194] = 0x00ae; + t[63722] = 0x2122; + t[63195] = 0x2122; + t[63729] = 0x23a7; + t[63730] = 0x23a8; + t[63731] = 0x23a9; + t[63740] = 0x23ab; + t[63741] = 0x23ac; + t[63742] = 0x23ad; + t[63726] = 0x23a1; + t[63727] = 0x23a2; + t[63728] = 0x23a3; + t[63737] = 0x23a4; + t[63738] = 0x23a5; + t[63739] = 0x23a6; + t[63723] = 0x239b; + t[63724] = 0x239c; + t[63725] = 0x239d; + t[63734] = 0x239e; + t[63735] = 0x239f; + t[63736] = 0x23a0; +}); +function mapSpecialUnicodeValues(code) { + if (code >= 0xfff0 && code <= 0xffff) { + return 0; + } else if (code >= 0xf600 && code <= 0xf8ff) { + return getSpecialPUASymbols()[code] || code; + } else if (code === 0x00ad) { + return 0x002d; + } + return code; +} +function getUnicodeForGlyph(name, glyphsUnicodeMap) { + let unicode = glyphsUnicodeMap[name]; + if (unicode !== undefined) { + return unicode; + } + if (!name) { + return -1; + } + if (name[0] === "u") { + const nameLen = name.length; + let hexStr; + if (nameLen === 7 && name[1] === "n" && name[2] === "i") { + hexStr = name.substring(3); + } else if (nameLen >= 5 && nameLen <= 7) { + hexStr = name.substring(1); + } else { + return -1; + } + if (hexStr === hexStr.toUpperCase()) { + unicode = parseInt(hexStr, 16); + if (unicode >= 0) { + return unicode; + } + } + } + return -1; +} +const UnicodeRanges = [[0x0000, 0x007f], [0x0080, 0x00ff], [0x0100, 0x017f], [0x0180, 0x024f], [0x0250, 0x02af, 0x1d00, 0x1d7f, 0x1d80, 0x1dbf], [0x02b0, 0x02ff, 0xa700, 0xa71f], [0x0300, 0x036f, 0x1dc0, 0x1dff], [0x0370, 0x03ff], [0x2c80, 0x2cff], [0x0400, 0x04ff, 0x0500, 0x052f, 0x2de0, 0x2dff, 0xa640, 0xa69f], [0x0530, 0x058f], [0x0590, 0x05ff], [0xa500, 0xa63f], [0x0600, 0x06ff, 0x0750, 0x077f], [0x07c0, 0x07ff], [0x0900, 0x097f], [0x0980, 0x09ff], [0x0a00, 0x0a7f], [0x0a80, 0x0aff], [0x0b00, 0x0b7f], [0x0b80, 0x0bff], [0x0c00, 0x0c7f], [0x0c80, 0x0cff], [0x0d00, 0x0d7f], [0x0e00, 0x0e7f], [0x0e80, 0x0eff], [0x10a0, 0x10ff, 0x2d00, 0x2d2f], [0x1b00, 0x1b7f], [0x1100, 0x11ff], [0x1e00, 0x1eff, 0x2c60, 0x2c7f, 0xa720, 0xa7ff], [0x1f00, 0x1fff], [0x2000, 0x206f, 0x2e00, 0x2e7f], [0x2070, 0x209f], [0x20a0, 0x20cf], [0x20d0, 0x20ff], [0x2100, 0x214f], [0x2150, 0x218f], [0x2190, 0x21ff, 0x27f0, 0x27ff, 0x2900, 0x297f, 0x2b00, 0x2bff], [0x2200, 0x22ff, 0x2a00, 0x2aff, 0x27c0, 0x27ef, 0x2980, 0x29ff], [0x2300, 0x23ff], [0x2400, 0x243f], [0x2440, 0x245f], [0x2460, 0x24ff], [0x2500, 0x257f], [0x2580, 0x259f], [0x25a0, 0x25ff], [0x2600, 0x26ff], [0x2700, 0x27bf], [0x3000, 0x303f], [0x3040, 0x309f], [0x30a0, 0x30ff, 0x31f0, 0x31ff], [0x3100, 0x312f, 0x31a0, 0x31bf], [0x3130, 0x318f], [0xa840, 0xa87f], [0x3200, 0x32ff], [0x3300, 0x33ff], [0xac00, 0xd7af], [0xd800, 0xdfff], [0x10900, 0x1091f], [0x4e00, 0x9fff, 0x2e80, 0x2eff, 0x2f00, 0x2fdf, 0x2ff0, 0x2fff, 0x3400, 0x4dbf, 0x20000, 0x2a6df, 0x3190, 0x319f], [0xe000, 0xf8ff], [0x31c0, 0x31ef, 0xf900, 0xfaff, 0x2f800, 0x2fa1f], [0xfb00, 0xfb4f], [0xfb50, 0xfdff], [0xfe20, 0xfe2f], [0xfe10, 0xfe1f], [0xfe50, 0xfe6f], [0xfe70, 0xfeff], [0xff00, 0xffef], [0xfff0, 0xffff], [0x0f00, 0x0fff], [0x0700, 0x074f], [0x0780, 0x07bf], [0x0d80, 0x0dff], [0x1000, 0x109f], [0x1200, 0x137f, 0x1380, 0x139f, 0x2d80, 0x2ddf], [0x13a0, 0x13ff], [0x1400, 0x167f], [0x1680, 0x169f], [0x16a0, 0x16ff], [0x1780, 0x17ff], [0x1800, 0x18af], [0x2800, 0x28ff], [0xa000, 0xa48f], [0x1700, 0x171f, 0x1720, 0x173f, 0x1740, 0x175f, 0x1760, 0x177f], [0x10300, 0x1032f], [0x10330, 0x1034f], [0x10400, 0x1044f], [0x1d000, 0x1d0ff, 0x1d100, 0x1d1ff, 0x1d200, 0x1d24f], [0x1d400, 0x1d7ff], [0xff000, 0xffffd], [0xfe00, 0xfe0f, 0xe0100, 0xe01ef], [0xe0000, 0xe007f], [0x1900, 0x194f], [0x1950, 0x197f], [0x1980, 0x19df], [0x1a00, 0x1a1f], [0x2c00, 0x2c5f], [0x2d30, 0x2d7f], [0x4dc0, 0x4dff], [0xa800, 0xa82f], [0x10000, 0x1007f, 0x10080, 0x100ff, 0x10100, 0x1013f], [0x10140, 0x1018f], [0x10380, 0x1039f], [0x103a0, 0x103df], [0x10450, 0x1047f], [0x10480, 0x104af], [0x10800, 0x1083f], [0x10a00, 0x10a5f], [0x1d300, 0x1d35f], [0x12000, 0x123ff, 0x12400, 0x1247f], [0x1d360, 0x1d37f], [0x1b80, 0x1bbf], [0x1c00, 0x1c4f], [0x1c50, 0x1c7f], [0xa880, 0xa8df], [0xa900, 0xa92f], [0xa930, 0xa95f], [0xaa00, 0xaa5f], [0x10190, 0x101cf], [0x101d0, 0x101ff], [0x102a0, 0x102df, 0x10280, 0x1029f, 0x10920, 0x1093f], [0x1f030, 0x1f09f, 0x1f000, 0x1f02f]]; +function getUnicodeRangeFor(value, lastPosition = -1) { + if (lastPosition !== -1) { + const range = UnicodeRanges[lastPosition]; + for (let i = 0, ii = range.length; i < ii; i += 2) { + if (value >= range[i] && value <= range[i + 1]) { + return lastPosition; + } + } + } + for (let i = 0, ii = UnicodeRanges.length; i < ii; i++) { + const range = UnicodeRanges[i]; + for (let j = 0, jj = range.length; j < jj; j += 2) { + if (value >= range[j] && value <= range[j + 1]) { + return i; + } + } + } + return -1; +} +const SpecialCharRegExp = new RegExp("^(\\s)|(\\p{Mn})|(\\p{Cf})$", "u"); +const CategoryCache = new Map(); +function getCharUnicodeCategory(char) { + const cachedCategory = CategoryCache.get(char); + if (cachedCategory) { + return cachedCategory; + } + const groups = char.match(SpecialCharRegExp); + const category = { + isWhitespace: !!groups?.[1], + isZeroWidthDiacritic: !!groups?.[2], + isInvisibleFormatMark: !!groups?.[3] + }; + CategoryCache.set(char, category); + return category; +} +function clearUnicodeCaches() { + CategoryCache.clear(); +} + +;// CONCATENATED MODULE: ./src/core/fonts_utils.js + + + + +const SEAC_ANALYSIS_ENABLED = true; +const FontFlags = { + FixedPitch: 1, + Serif: 2, + Symbolic: 4, + Script: 8, + Nonsymbolic: 32, + Italic: 64, + AllCap: 65536, + SmallCap: 131072, + ForceBold: 262144 +}; +const MacStandardGlyphOrdering = [".notdef", ".null", "nonmarkingreturn", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "Adieresis", "Aring", "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", "aacute", "agrave", "acircumflex", "adieresis", "atilde", "aring", "ccedilla", "eacute", "egrave", "ecircumflex", "edieresis", "iacute", "igrave", "icircumflex", "idieresis", "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", "otilde", "uacute", "ugrave", "ucircumflex", "udieresis", "dagger", "degree", "cent", "sterling", "section", "bullet", "paragraph", "germandbls", "registered", "copyright", "trademark", "acute", "dieresis", "notequal", "AE", "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", "yen", "mu", "partialdiff", "summation", "product", "pi", "integral", "ordfeminine", "ordmasculine", "Omega", "ae", "oslash", "questiondown", "exclamdown", "logicalnot", "radical", "florin", "approxequal", "Delta", "guillemotleft", "guillemotright", "ellipsis", "nonbreakingspace", "Agrave", "Atilde", "Otilde", "OE", "oe", "endash", "emdash", "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", "lozenge", "ydieresis", "Ydieresis", "fraction", "currency", "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex", "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", "dotlessi", "circumflex", "tilde", "macron", "breve", "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "Lslash", "lslash", "Scaron", "scaron", "Zcaron", "zcaron", "brokenbar", "Eth", "eth", "Yacute", "yacute", "Thorn", "thorn", "minus", "multiply", "onesuperior", "twosuperior", "threesuperior", "onehalf", "onequarter", "threequarters", "franc", "Gbreve", "gbreve", "Idotaccent", "Scedilla", "scedilla", "Cacute", "cacute", "Ccaron", "ccaron", "dcroat"]; +function recoverGlyphName(name, glyphsUnicodeMap) { + if (glyphsUnicodeMap[name] !== undefined) { + return name; + } + const unicode = getUnicodeForGlyph(name, glyphsUnicodeMap); + if (unicode !== -1) { + for (const key in glyphsUnicodeMap) { + if (glyphsUnicodeMap[key] === unicode) { + return key; + } + } + } + info("Unable to recover a standard glyph name for: " + name); + return name; +} +function type1FontGlyphMapping(properties, builtInEncoding, glyphNames) { + const charCodeToGlyphId = Object.create(null); + let glyphId, charCode, baseEncoding; + const isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); + if (properties.isInternalFont) { + baseEncoding = builtInEncoding; + for (charCode = 0; charCode < baseEncoding.length; charCode++) { + glyphId = glyphNames.indexOf(baseEncoding[charCode]); + charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0; + } + } else if (properties.baseEncodingName) { + baseEncoding = getEncoding(properties.baseEncodingName); + for (charCode = 0; charCode < baseEncoding.length; charCode++) { + glyphId = glyphNames.indexOf(baseEncoding[charCode]); + charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0; + } + } else if (isSymbolicFont) { + for (charCode in builtInEncoding) { + charCodeToGlyphId[charCode] = builtInEncoding[charCode]; + } + } else { + baseEncoding = StandardEncoding; + for (charCode = 0; charCode < baseEncoding.length; charCode++) { + glyphId = glyphNames.indexOf(baseEncoding[charCode]); + charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0; + } + } + const differences = properties.differences; + let glyphsUnicodeMap; + if (differences) { + for (charCode in differences) { + const glyphName = differences[charCode]; + glyphId = glyphNames.indexOf(glyphName); + if (glyphId === -1) { + if (!glyphsUnicodeMap) { + glyphsUnicodeMap = getGlyphsUnicode(); + } + const standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap); + if (standardGlyphName !== glyphName) { + glyphId = glyphNames.indexOf(standardGlyphName); + } + } + charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : 0; + } + } + return charCodeToGlyphId; +} +function normalizeFontName(name) { + return name.replaceAll(/[,_]/g, "-").replaceAll(/\s/g, ""); +} + +;// CONCATENATED MODULE: ./src/core/standard_fonts.js + + +const getStdFontMap = getLookupTableFactory(function (t) { + t["Times-Roman"] = "Times-Roman"; + t.Helvetica = "Helvetica"; + t.Courier = "Courier"; + t.Symbol = "Symbol"; + t["Times-Bold"] = "Times-Bold"; + t["Helvetica-Bold"] = "Helvetica-Bold"; + t["Courier-Bold"] = "Courier-Bold"; + t.ZapfDingbats = "ZapfDingbats"; + t["Times-Italic"] = "Times-Italic"; + t["Helvetica-Oblique"] = "Helvetica-Oblique"; + t["Courier-Oblique"] = "Courier-Oblique"; + t["Times-BoldItalic"] = "Times-BoldItalic"; + t["Helvetica-BoldOblique"] = "Helvetica-BoldOblique"; + t["Courier-BoldOblique"] = "Courier-BoldOblique"; + t.ArialNarrow = "Helvetica"; + t["ArialNarrow-Bold"] = "Helvetica-Bold"; + t["ArialNarrow-BoldItalic"] = "Helvetica-BoldOblique"; + t["ArialNarrow-Italic"] = "Helvetica-Oblique"; + t.ArialBlack = "Helvetica"; + t["ArialBlack-Bold"] = "Helvetica-Bold"; + t["ArialBlack-BoldItalic"] = "Helvetica-BoldOblique"; + t["ArialBlack-Italic"] = "Helvetica-Oblique"; + t["Arial-Black"] = "Helvetica"; + t["Arial-Black-Bold"] = "Helvetica-Bold"; + t["Arial-Black-BoldItalic"] = "Helvetica-BoldOblique"; + t["Arial-Black-Italic"] = "Helvetica-Oblique"; + t.Arial = "Helvetica"; + t["Arial-Bold"] = "Helvetica-Bold"; + t["Arial-BoldItalic"] = "Helvetica-BoldOblique"; + t["Arial-Italic"] = "Helvetica-Oblique"; + t.ArialMT = "Helvetica"; + t["Arial-BoldItalicMT"] = "Helvetica-BoldOblique"; + t["Arial-BoldMT"] = "Helvetica-Bold"; + t["Arial-ItalicMT"] = "Helvetica-Oblique"; + t["Arial-BoldItalicMT-BoldItalic"] = "Helvetica-BoldOblique"; + t["Arial-BoldMT-Bold"] = "Helvetica-Bold"; + t["Arial-ItalicMT-Italic"] = "Helvetica-Oblique"; + t.ArialUnicodeMS = "Helvetica"; + t["ArialUnicodeMS-Bold"] = "Helvetica-Bold"; + t["ArialUnicodeMS-BoldItalic"] = "Helvetica-BoldOblique"; + t["ArialUnicodeMS-Italic"] = "Helvetica-Oblique"; + t["Courier-BoldItalic"] = "Courier-BoldOblique"; + t["Courier-Italic"] = "Courier-Oblique"; + t.CourierNew = "Courier"; + t["CourierNew-Bold"] = "Courier-Bold"; + t["CourierNew-BoldItalic"] = "Courier-BoldOblique"; + t["CourierNew-Italic"] = "Courier-Oblique"; + t["CourierNewPS-BoldItalicMT"] = "Courier-BoldOblique"; + t["CourierNewPS-BoldMT"] = "Courier-Bold"; + t["CourierNewPS-ItalicMT"] = "Courier-Oblique"; + t.CourierNewPSMT = "Courier"; + t["Helvetica-BoldItalic"] = "Helvetica-BoldOblique"; + t["Helvetica-Italic"] = "Helvetica-Oblique"; + t["Symbol-Bold"] = "Symbol"; + t["Symbol-BoldItalic"] = "Symbol"; + t["Symbol-Italic"] = "Symbol"; + t.TimesNewRoman = "Times-Roman"; + t["TimesNewRoman-Bold"] = "Times-Bold"; + t["TimesNewRoman-BoldItalic"] = "Times-BoldItalic"; + t["TimesNewRoman-Italic"] = "Times-Italic"; + t.TimesNewRomanPS = "Times-Roman"; + t["TimesNewRomanPS-Bold"] = "Times-Bold"; + t["TimesNewRomanPS-BoldItalic"] = "Times-BoldItalic"; + t["TimesNewRomanPS-BoldItalicMT"] = "Times-BoldItalic"; + t["TimesNewRomanPS-BoldMT"] = "Times-Bold"; + t["TimesNewRomanPS-Italic"] = "Times-Italic"; + t["TimesNewRomanPS-ItalicMT"] = "Times-Italic"; + t.TimesNewRomanPSMT = "Times-Roman"; + t["TimesNewRomanPSMT-Bold"] = "Times-Bold"; + t["TimesNewRomanPSMT-BoldItalic"] = "Times-BoldItalic"; + t["TimesNewRomanPSMT-Italic"] = "Times-Italic"; +}); +const getFontNameToFileMap = getLookupTableFactory(function (t) { + t.Courier = "FoxitFixed.pfb"; + t["Courier-Bold"] = "FoxitFixedBold.pfb"; + t["Courier-BoldOblique"] = "FoxitFixedBoldItalic.pfb"; + t["Courier-Oblique"] = "FoxitFixedItalic.pfb"; + t.Helvetica = "LiberationSans-Regular.ttf"; + t["Helvetica-Bold"] = "LiberationSans-Bold.ttf"; + t["Helvetica-BoldOblique"] = "LiberationSans-BoldItalic.ttf"; + t["Helvetica-Oblique"] = "LiberationSans-Italic.ttf"; + t["Times-Roman"] = "FoxitSerif.pfb"; + t["Times-Bold"] = "FoxitSerifBold.pfb"; + t["Times-BoldItalic"] = "FoxitSerifBoldItalic.pfb"; + t["Times-Italic"] = "FoxitSerifItalic.pfb"; + t.Symbol = "FoxitSymbol.pfb"; + t.ZapfDingbats = "FoxitDingbats.pfb"; + t["LiberationSans-Regular"] = "LiberationSans-Regular.ttf"; + t["LiberationSans-Bold"] = "LiberationSans-Bold.ttf"; + t["LiberationSans-Italic"] = "LiberationSans-Italic.ttf"; + t["LiberationSans-BoldItalic"] = "LiberationSans-BoldItalic.ttf"; +}); +const getNonStdFontMap = getLookupTableFactory(function (t) { + t.Calibri = "Helvetica"; + t["Calibri-Bold"] = "Helvetica-Bold"; + t["Calibri-BoldItalic"] = "Helvetica-BoldOblique"; + t["Calibri-Italic"] = "Helvetica-Oblique"; + t.CenturyGothic = "Helvetica"; + t["CenturyGothic-Bold"] = "Helvetica-Bold"; + t["CenturyGothic-BoldItalic"] = "Helvetica-BoldOblique"; + t["CenturyGothic-Italic"] = "Helvetica-Oblique"; + t.ComicSansMS = "Comic Sans MS"; + t["ComicSansMS-Bold"] = "Comic Sans MS-Bold"; + t["ComicSansMS-BoldItalic"] = "Comic Sans MS-BoldItalic"; + t["ComicSansMS-Italic"] = "Comic Sans MS-Italic"; + t.Impact = "Helvetica"; + t["ItcSymbol-Bold"] = "Helvetica-Bold"; + t["ItcSymbol-BoldItalic"] = "Helvetica-BoldOblique"; + t["ItcSymbol-Book"] = "Helvetica"; + t["ItcSymbol-BookItalic"] = "Helvetica-Oblique"; + t["ItcSymbol-Medium"] = "Helvetica"; + t["ItcSymbol-MediumItalic"] = "Helvetica-Oblique"; + t.LucidaConsole = "Courier"; + t["LucidaConsole-Bold"] = "Courier-Bold"; + t["LucidaConsole-BoldItalic"] = "Courier-BoldOblique"; + t["LucidaConsole-Italic"] = "Courier-Oblique"; + t["LucidaSans-Demi"] = "Helvetica-Bold"; + t["MS-Gothic"] = "MS Gothic"; + t["MS-Gothic-Bold"] = "MS Gothic-Bold"; + t["MS-Gothic-BoldItalic"] = "MS Gothic-BoldItalic"; + t["MS-Gothic-Italic"] = "MS Gothic-Italic"; + t["MS-Mincho"] = "MS Mincho"; + t["MS-Mincho-Bold"] = "MS Mincho-Bold"; + t["MS-Mincho-BoldItalic"] = "MS Mincho-BoldItalic"; + t["MS-Mincho-Italic"] = "MS Mincho-Italic"; + t["MS-PGothic"] = "MS PGothic"; + t["MS-PGothic-Bold"] = "MS PGothic-Bold"; + t["MS-PGothic-BoldItalic"] = "MS PGothic-BoldItalic"; + t["MS-PGothic-Italic"] = "MS PGothic-Italic"; + t["MS-PMincho"] = "MS PMincho"; + t["MS-PMincho-Bold"] = "MS PMincho-Bold"; + t["MS-PMincho-BoldItalic"] = "MS PMincho-BoldItalic"; + t["MS-PMincho-Italic"] = "MS PMincho-Italic"; + t.NuptialScript = "Times-Italic"; + t.SegoeUISymbol = "Helvetica"; +}); +const getSerifFonts = getLookupTableFactory(function (t) { + t["Adobe Jenson"] = true; + t["Adobe Text"] = true; + t.Albertus = true; + t.Aldus = true; + t.Alexandria = true; + t.Algerian = true; + t["American Typewriter"] = true; + t.Antiqua = true; + t.Apex = true; + t.Arno = true; + t.Aster = true; + t.Aurora = true; + t.Baskerville = true; + t.Bell = true; + t.Bembo = true; + t["Bembo Schoolbook"] = true; + t.Benguiat = true; + t["Berkeley Old Style"] = true; + t["Bernhard Modern"] = true; + t["Berthold City"] = true; + t.Bodoni = true; + t["Bauer Bodoni"] = true; + t["Book Antiqua"] = true; + t.Bookman = true; + t["Bordeaux Roman"] = true; + t["Californian FB"] = true; + t.Calisto = true; + t.Calvert = true; + t.Capitals = true; + t.Cambria = true; + t.Cartier = true; + t.Caslon = true; + t.Catull = true; + t.Centaur = true; + t["Century Old Style"] = true; + t["Century Schoolbook"] = true; + t.Chaparral = true; + t["Charis SIL"] = true; + t.Cheltenham = true; + t["Cholla Slab"] = true; + t.Clarendon = true; + t.Clearface = true; + t.Cochin = true; + t.Colonna = true; + t["Computer Modern"] = true; + t["Concrete Roman"] = true; + t.Constantia = true; + t["Cooper Black"] = true; + t.Corona = true; + t.Ecotype = true; + t.Egyptienne = true; + t.Elephant = true; + t.Excelsior = true; + t.Fairfield = true; + t["FF Scala"] = true; + t.Folkard = true; + t.Footlight = true; + t.FreeSerif = true; + t["Friz Quadrata"] = true; + t.Garamond = true; + t.Gentium = true; + t.Georgia = true; + t.Gloucester = true; + t["Goudy Old Style"] = true; + t["Goudy Schoolbook"] = true; + t["Goudy Pro Font"] = true; + t.Granjon = true; + t["Guardian Egyptian"] = true; + t.Heather = true; + t.Hercules = true; + t["High Tower Text"] = true; + t.Hiroshige = true; + t["Hoefler Text"] = true; + t["Humana Serif"] = true; + t.Imprint = true; + t["Ionic No. 5"] = true; + t.Janson = true; + t.Joanna = true; + t.Korinna = true; + t.Lexicon = true; + t.LiberationSerif = true; + t["Liberation Serif"] = true; + t["Linux Libertine"] = true; + t.Literaturnaya = true; + t.Lucida = true; + t["Lucida Bright"] = true; + t.Melior = true; + t.Memphis = true; + t.Miller = true; + t.Minion = true; + t.Modern = true; + t["Mona Lisa"] = true; + t["Mrs Eaves"] = true; + t["MS Serif"] = true; + t["Museo Slab"] = true; + t["New York"] = true; + t["Nimbus Roman"] = true; + t["NPS Rawlinson Roadway"] = true; + t.NuptialScript = true; + t.Palatino = true; + t.Perpetua = true; + t.Plantin = true; + t["Plantin Schoolbook"] = true; + t.Playbill = true; + t["Poor Richard"] = true; + t["Rawlinson Roadway"] = true; + t.Renault = true; + t.Requiem = true; + t.Rockwell = true; + t.Roman = true; + t["Rotis Serif"] = true; + t.Sabon = true; + t.Scala = true; + t.Seagull = true; + t.Sistina = true; + t.Souvenir = true; + t.STIX = true; + t["Stone Informal"] = true; + t["Stone Serif"] = true; + t.Sylfaen = true; + t.Times = true; + t.Trajan = true; + t["Trinité"] = true; + t["Trump Mediaeval"] = true; + t.Utopia = true; + t["Vale Type"] = true; + t["Bitstream Vera"] = true; + t["Vera Serif"] = true; + t.Versailles = true; + t.Wanted = true; + t.Weiss = true; + t["Wide Latin"] = true; + t.Windsor = true; + t.XITS = true; +}); +const getSymbolsFonts = getLookupTableFactory(function (t) { + t.Dingbats = true; + t.Symbol = true; + t.ZapfDingbats = true; + t.Wingdings = true; + t["Wingdings-Bold"] = true; + t["Wingdings-Regular"] = true; +}); +const getGlyphMapForStandardFonts = getLookupTableFactory(function (t) { + t[2] = 10; + t[3] = 32; + t[4] = 33; + t[5] = 34; + t[6] = 35; + t[7] = 36; + t[8] = 37; + t[9] = 38; + t[10] = 39; + t[11] = 40; + t[12] = 41; + t[13] = 42; + t[14] = 43; + t[15] = 44; + t[16] = 45; + t[17] = 46; + t[18] = 47; + t[19] = 48; + t[20] = 49; + t[21] = 50; + t[22] = 51; + t[23] = 52; + t[24] = 53; + t[25] = 54; + t[26] = 55; + t[27] = 56; + t[28] = 57; + t[29] = 58; + t[30] = 894; + t[31] = 60; + t[32] = 61; + t[33] = 62; + t[34] = 63; + t[35] = 64; + t[36] = 65; + t[37] = 66; + t[38] = 67; + t[39] = 68; + t[40] = 69; + t[41] = 70; + t[42] = 71; + t[43] = 72; + t[44] = 73; + t[45] = 74; + t[46] = 75; + t[47] = 76; + t[48] = 77; + t[49] = 78; + t[50] = 79; + t[51] = 80; + t[52] = 81; + t[53] = 82; + t[54] = 83; + t[55] = 84; + t[56] = 85; + t[57] = 86; + t[58] = 87; + t[59] = 88; + t[60] = 89; + t[61] = 90; + t[62] = 91; + t[63] = 92; + t[64] = 93; + t[65] = 94; + t[66] = 95; + t[67] = 96; + t[68] = 97; + t[69] = 98; + t[70] = 99; + t[71] = 100; + t[72] = 101; + t[73] = 102; + t[74] = 103; + t[75] = 104; + t[76] = 105; + t[77] = 106; + t[78] = 107; + t[79] = 108; + t[80] = 109; + t[81] = 110; + t[82] = 111; + t[83] = 112; + t[84] = 113; + t[85] = 114; + t[86] = 115; + t[87] = 116; + t[88] = 117; + t[89] = 118; + t[90] = 119; + t[91] = 120; + t[92] = 121; + t[93] = 122; + t[94] = 123; + t[95] = 124; + t[96] = 125; + t[97] = 126; + t[98] = 196; + t[99] = 197; + t[100] = 199; + t[101] = 201; + t[102] = 209; + t[103] = 214; + t[104] = 220; + t[105] = 225; + t[106] = 224; + t[107] = 226; + t[108] = 228; + t[109] = 227; + t[110] = 229; + t[111] = 231; + t[112] = 233; + t[113] = 232; + t[114] = 234; + t[115] = 235; + t[116] = 237; + t[117] = 236; + t[118] = 238; + t[119] = 239; + t[120] = 241; + t[121] = 243; + t[122] = 242; + t[123] = 244; + t[124] = 246; + t[125] = 245; + t[126] = 250; + t[127] = 249; + t[128] = 251; + t[129] = 252; + t[130] = 8224; + t[131] = 176; + t[132] = 162; + t[133] = 163; + t[134] = 167; + t[135] = 8226; + t[136] = 182; + t[137] = 223; + t[138] = 174; + t[139] = 169; + t[140] = 8482; + t[141] = 180; + t[142] = 168; + t[143] = 8800; + t[144] = 198; + t[145] = 216; + t[146] = 8734; + t[147] = 177; + t[148] = 8804; + t[149] = 8805; + t[150] = 165; + t[151] = 181; + t[152] = 8706; + t[153] = 8721; + t[154] = 8719; + t[156] = 8747; + t[157] = 170; + t[158] = 186; + t[159] = 8486; + t[160] = 230; + t[161] = 248; + t[162] = 191; + t[163] = 161; + t[164] = 172; + t[165] = 8730; + t[166] = 402; + t[167] = 8776; + t[168] = 8710; + t[169] = 171; + t[170] = 187; + t[171] = 8230; + t[179] = 8220; + t[180] = 8221; + t[181] = 8216; + t[182] = 8217; + t[200] = 193; + t[203] = 205; + t[207] = 211; + t[210] = 218; + t[223] = 711; + t[224] = 321; + t[225] = 322; + t[226] = 352; + t[227] = 353; + t[228] = 381; + t[229] = 382; + t[233] = 221; + t[234] = 253; + t[252] = 263; + t[253] = 268; + t[254] = 269; + t[258] = 258; + t[260] = 260; + t[261] = 261; + t[265] = 280; + t[266] = 281; + t[267] = 282; + t[268] = 283; + t[269] = 313; + t[275] = 323; + t[276] = 324; + t[278] = 328; + t[283] = 344; + t[284] = 345; + t[285] = 346; + t[286] = 347; + t[292] = 367; + t[295] = 377; + t[296] = 378; + t[298] = 380; + t[305] = 963; + t[306] = 964; + t[307] = 966; + t[308] = 8215; + t[309] = 8252; + t[310] = 8319; + t[311] = 8359; + t[312] = 8592; + t[313] = 8593; + t[337] = 9552; + t[493] = 1039; + t[494] = 1040; + t[672] = 1488; + t[673] = 1489; + t[674] = 1490; + t[675] = 1491; + t[676] = 1492; + t[677] = 1493; + t[678] = 1494; + t[679] = 1495; + t[680] = 1496; + t[681] = 1497; + t[682] = 1498; + t[683] = 1499; + t[684] = 1500; + t[685] = 1501; + t[686] = 1502; + t[687] = 1503; + t[688] = 1504; + t[689] = 1505; + t[690] = 1506; + t[691] = 1507; + t[692] = 1508; + t[693] = 1509; + t[694] = 1510; + t[695] = 1511; + t[696] = 1512; + t[697] = 1513; + t[698] = 1514; + t[705] = 1524; + t[706] = 8362; + t[710] = 64288; + t[711] = 64298; + t[759] = 1617; + t[761] = 1776; + t[763] = 1778; + t[775] = 1652; + t[777] = 1764; + t[778] = 1780; + t[779] = 1781; + t[780] = 1782; + t[782] = 771; + t[783] = 64726; + t[786] = 8363; + t[788] = 8532; + t[790] = 768; + t[791] = 769; + t[792] = 768; + t[795] = 803; + t[797] = 64336; + t[798] = 64337; + t[799] = 64342; + t[800] = 64343; + t[801] = 64344; + t[802] = 64345; + t[803] = 64362; + t[804] = 64363; + t[805] = 64364; + t[2424] = 7821; + t[2425] = 7822; + t[2426] = 7823; + t[2427] = 7824; + t[2428] = 7825; + t[2429] = 7826; + t[2430] = 7827; + t[2433] = 7682; + t[2678] = 8045; + t[2679] = 8046; + t[2830] = 1552; + t[2838] = 686; + t[2840] = 751; + t[2842] = 753; + t[2843] = 754; + t[2844] = 755; + t[2846] = 757; + t[2856] = 767; + t[2857] = 848; + t[2858] = 849; + t[2862] = 853; + t[2863] = 854; + t[2864] = 855; + t[2865] = 861; + t[2866] = 862; + t[2906] = 7460; + t[2908] = 7462; + t[2909] = 7463; + t[2910] = 7464; + t[2912] = 7466; + t[2913] = 7467; + t[2914] = 7468; + t[2916] = 7470; + t[2917] = 7471; + t[2918] = 7472; + t[2920] = 7474; + t[2921] = 7475; + t[2922] = 7476; + t[2924] = 7478; + t[2925] = 7479; + t[2926] = 7480; + t[2928] = 7482; + t[2929] = 7483; + t[2930] = 7484; + t[2932] = 7486; + t[2933] = 7487; + t[2934] = 7488; + t[2936] = 7490; + t[2937] = 7491; + t[2938] = 7492; + t[2940] = 7494; + t[2941] = 7495; + t[2942] = 7496; + t[2944] = 7498; + t[2946] = 7500; + t[2948] = 7502; + t[2950] = 7504; + t[2951] = 7505; + t[2952] = 7506; + t[2954] = 7508; + t[2955] = 7509; + t[2956] = 7510; + t[2958] = 7512; + t[2959] = 7513; + t[2960] = 7514; + t[2962] = 7516; + t[2963] = 7517; + t[2964] = 7518; + t[2966] = 7520; + t[2967] = 7521; + t[2968] = 7522; + t[2970] = 7524; + t[2971] = 7525; + t[2972] = 7526; + t[2974] = 7528; + t[2975] = 7529; + t[2976] = 7530; + t[2978] = 1537; + t[2979] = 1538; + t[2980] = 1539; + t[2982] = 1549; + t[2983] = 1551; + t[2984] = 1552; + t[2986] = 1554; + t[2987] = 1555; + t[2988] = 1556; + t[2990] = 1623; + t[2991] = 1624; + t[2995] = 1775; + t[2999] = 1791; + t[3002] = 64290; + t[3003] = 64291; + t[3004] = 64292; + t[3006] = 64294; + t[3007] = 64295; + t[3008] = 64296; + t[3011] = 1900; + t[3014] = 8223; + t[3015] = 8244; + t[3017] = 7532; + t[3018] = 7533; + t[3019] = 7534; + t[3075] = 7590; + t[3076] = 7591; + t[3079] = 7594; + t[3080] = 7595; + t[3083] = 7598; + t[3084] = 7599; + t[3087] = 7602; + t[3088] = 7603; + t[3091] = 7606; + t[3092] = 7607; + t[3095] = 7610; + t[3096] = 7611; + t[3099] = 7614; + t[3100] = 7615; + t[3103] = 7618; + t[3104] = 7619; + t[3107] = 8337; + t[3108] = 8338; + t[3116] = 1884; + t[3119] = 1885; + t[3120] = 1885; + t[3123] = 1886; + t[3124] = 1886; + t[3127] = 1887; + t[3128] = 1887; + t[3131] = 1888; + t[3132] = 1888; + t[3135] = 1889; + t[3136] = 1889; + t[3139] = 1890; + t[3140] = 1890; + t[3143] = 1891; + t[3144] = 1891; + t[3147] = 1892; + t[3148] = 1892; + t[3153] = 580; + t[3154] = 581; + t[3157] = 584; + t[3158] = 585; + t[3161] = 588; + t[3162] = 589; + t[3165] = 891; + t[3166] = 892; + t[3169] = 1274; + t[3170] = 1275; + t[3173] = 1278; + t[3174] = 1279; + t[3181] = 7622; + t[3182] = 7623; + t[3282] = 11799; + t[3316] = 578; + t[3379] = 42785; + t[3393] = 1159; + t[3416] = 8377; +}); +const getSupplementalGlyphMapForArialBlack = getLookupTableFactory(function (t) { + t[227] = 322; + t[264] = 261; + t[291] = 346; +}); +const getSupplementalGlyphMapForCalibri = getLookupTableFactory(function (t) { + t[1] = 32; + t[4] = 65; + t[5] = 192; + t[6] = 193; + t[9] = 196; + t[17] = 66; + t[18] = 67; + t[21] = 268; + t[24] = 68; + t[28] = 69; + t[29] = 200; + t[30] = 201; + t[32] = 282; + t[38] = 70; + t[39] = 71; + t[44] = 72; + t[47] = 73; + t[48] = 204; + t[49] = 205; + t[58] = 74; + t[60] = 75; + t[62] = 76; + t[68] = 77; + t[69] = 78; + t[75] = 79; + t[76] = 210; + t[80] = 214; + t[87] = 80; + t[89] = 81; + t[90] = 82; + t[92] = 344; + t[94] = 83; + t[97] = 352; + t[100] = 84; + t[104] = 85; + t[109] = 220; + t[115] = 86; + t[116] = 87; + t[121] = 88; + t[122] = 89; + t[124] = 221; + t[127] = 90; + t[129] = 381; + t[258] = 97; + t[259] = 224; + t[260] = 225; + t[263] = 228; + t[268] = 261; + t[271] = 98; + t[272] = 99; + t[273] = 263; + t[275] = 269; + t[282] = 100; + t[286] = 101; + t[287] = 232; + t[288] = 233; + t[290] = 283; + t[295] = 281; + t[296] = 102; + t[336] = 103; + t[346] = 104; + t[349] = 105; + t[350] = 236; + t[351] = 237; + t[361] = 106; + t[364] = 107; + t[367] = 108; + t[371] = 322; + t[373] = 109; + t[374] = 110; + t[381] = 111; + t[382] = 242; + t[383] = 243; + t[386] = 246; + t[393] = 112; + t[395] = 113; + t[396] = 114; + t[398] = 345; + t[400] = 115; + t[401] = 347; + t[403] = 353; + t[410] = 116; + t[437] = 117; + t[442] = 252; + t[448] = 118; + t[449] = 119; + t[454] = 120; + t[455] = 121; + t[457] = 253; + t[460] = 122; + t[462] = 382; + t[463] = 380; + t[853] = 44; + t[855] = 58; + t[856] = 46; + t[876] = 47; + t[878] = 45; + t[882] = 45; + t[894] = 40; + t[895] = 41; + t[896] = 91; + t[897] = 93; + t[923] = 64; + t[1004] = 48; + t[1005] = 49; + t[1006] = 50; + t[1007] = 51; + t[1008] = 52; + t[1009] = 53; + t[1010] = 54; + t[1011] = 55; + t[1012] = 56; + t[1013] = 57; + t[1081] = 37; + t[1085] = 43; + t[1086] = 45; +}); +function getStandardFontName(name) { + const fontName = normalizeFontName(name); + const stdFontMap = getStdFontMap(); + return stdFontMap[fontName]; +} +function isKnownFontName(name) { + const fontName = normalizeFontName(name); + return !!(getStdFontMap()[fontName] || getNonStdFontMap()[fontName] || getSerifFonts()[fontName] || getSymbolsFonts()[fontName]); +} + +;// CONCATENATED MODULE: ./src/core/to_unicode_map.js + +class ToUnicodeMap { + constructor(cmap = []) { + this._map = cmap; + } + get length() { + return this._map.length; + } + forEach(callback) { + for (const charCode in this._map) { + callback(charCode, this._map[charCode].charCodeAt(0)); + } + } + has(i) { + return this._map[i] !== undefined; + } + get(i) { + return this._map[i]; + } + charCodeOf(value) { + const map = this._map; + if (map.length <= 0x10000) { + return map.indexOf(value); + } + for (const charCode in map) { + if (map[charCode] === value) { + return charCode | 0; + } + } + return -1; + } + amend(map) { + for (const charCode in map) { + this._map[charCode] = map[charCode]; + } + } +} +class IdentityToUnicodeMap { + constructor(firstChar, lastChar) { + this.firstChar = firstChar; + this.lastChar = lastChar; + } + get length() { + return this.lastChar + 1 - this.firstChar; + } + forEach(callback) { + for (let i = this.firstChar, ii = this.lastChar; i <= ii; i++) { + callback(i, i); + } + } + has(i) { + return this.firstChar <= i && i <= this.lastChar; + } + get(i) { + if (this.firstChar <= i && i <= this.lastChar) { + return String.fromCharCode(i); + } + return undefined; + } + charCodeOf(v) { + return Number.isInteger(v) && v >= this.firstChar && v <= this.lastChar ? v : -1; + } + amend(map) { + unreachable("Should not call amend()"); + } +} + +;// CONCATENATED MODULE: ./src/core/cff_font.js + + + +class CFFFont { + constructor(file, properties) { + this.properties = properties; + const parser = new CFFParser(file, properties, SEAC_ANALYSIS_ENABLED); + this.cff = parser.parse(); + this.cff.duplicateFirstGlyph(); + const compiler = new CFFCompiler(this.cff); + this.seacs = this.cff.seacs; + try { + this.data = compiler.compile(); + } catch { + warn("Failed to compile font " + properties.loadedName); + this.data = file; + } + this._createBuiltInEncoding(); + } + get numGlyphs() { + return this.cff.charStrings.count; + } + getCharset() { + return this.cff.charset.charset; + } + getGlyphMapping() { + const cff = this.cff; + const properties = this.properties; + const { + cidToGidMap, + cMap + } = properties; + const charsets = cff.charset.charset; + let charCodeToGlyphId; + let glyphId; + if (properties.composite) { + let invCidToGidMap; + if (cidToGidMap?.length > 0) { + invCidToGidMap = Object.create(null); + for (let i = 0, ii = cidToGidMap.length; i < ii; i++) { + const gid = cidToGidMap[i]; + if (gid !== undefined) { + invCidToGidMap[gid] = i; + } + } + } + charCodeToGlyphId = Object.create(null); + let charCode; + if (cff.isCIDFont) { + for (glyphId = 0; glyphId < charsets.length; glyphId++) { + const cid = charsets[glyphId]; + charCode = cMap.charCodeOf(cid); + if (invCidToGidMap?.[charCode] !== undefined) { + charCode = invCidToGidMap[charCode]; + } + charCodeToGlyphId[charCode] = glyphId; + } + } else { + for (glyphId = 0; glyphId < cff.charStrings.count; glyphId++) { + charCode = cMap.charCodeOf(glyphId); + charCodeToGlyphId[charCode] = glyphId; + } + } + return charCodeToGlyphId; + } + let encoding = cff.encoding ? cff.encoding.encoding : null; + if (properties.isInternalFont) { + encoding = properties.defaultEncoding; + } + charCodeToGlyphId = type1FontGlyphMapping(properties, encoding, charsets); + return charCodeToGlyphId; + } + hasGlyphId(id) { + return this.cff.hasGlyphId(id); + } + _createBuiltInEncoding() { + const { + charset, + encoding + } = this.cff; + if (!charset || !encoding) { + return; + } + const charsets = charset.charset, + encodings = encoding.encoding; + const map = []; + for (const charCode in encodings) { + const glyphId = encodings[charCode]; + if (glyphId >= 0) { + const glyphName = charsets[glyphId]; + if (glyphName) { + map[charCode] = glyphName; + } + } + } + if (map.length > 0) { + this.properties.builtInEncoding = map; + } + } +} + +;// CONCATENATED MODULE: ./src/core/font_renderer.js + + + + + +function getUint32(data, offset) { + return (data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]) >>> 0; +} +function getUint16(data, offset) { + return data[offset] << 8 | data[offset + 1]; +} +function getInt16(data, offset) { + return (data[offset] << 24 | data[offset + 1] << 16) >> 16; +} +function getInt8(data, offset) { + return data[offset] << 24 >> 24; +} +function getFloat214(data, offset) { + return getInt16(data, offset) / 16384; +} +function getSubroutineBias(subrs) { + const numSubrs = subrs.length; + let bias = 32768; + if (numSubrs < 1240) { + bias = 107; + } else if (numSubrs < 33900) { + bias = 1131; + } + return bias; +} +function parseCmap(data, start, end) { + const offset = getUint16(data, start + 2) === 1 ? getUint32(data, start + 8) : getUint32(data, start + 16); + const format = getUint16(data, start + offset); + let ranges, p, i; + if (format === 4) { + getUint16(data, start + offset + 2); + const segCount = getUint16(data, start + offset + 6) >> 1; + p = start + offset + 14; + ranges = []; + for (i = 0; i < segCount; i++, p += 2) { + ranges[i] = { + end: getUint16(data, p) + }; + } + p += 2; + for (i = 0; i < segCount; i++, p += 2) { + ranges[i].start = getUint16(data, p); + } + for (i = 0; i < segCount; i++, p += 2) { + ranges[i].idDelta = getUint16(data, p); + } + for (i = 0; i < segCount; i++, p += 2) { + let idOffset = getUint16(data, p); + if (idOffset === 0) { + continue; + } + ranges[i].ids = []; + for (let j = 0, jj = ranges[i].end - ranges[i].start + 1; j < jj; j++) { + ranges[i].ids[j] = getUint16(data, p + idOffset); + idOffset += 2; + } + } + return ranges; + } else if (format === 12) { + const groups = getUint32(data, start + offset + 12); + p = start + offset + 16; + ranges = []; + for (i = 0; i < groups; i++) { + start = getUint32(data, p); + ranges.push({ + start, + end: getUint32(data, p + 4), + idDelta: getUint32(data, p + 8) - start + }); + p += 12; + } + return ranges; + } + throw new FormatError(`unsupported cmap: ${format}`); +} +function parseCff(data, start, end, seacAnalysisEnabled) { + const properties = {}; + const parser = new CFFParser(new Stream(data, start, end - start), properties, seacAnalysisEnabled); + const cff = parser.parse(); + return { + glyphs: cff.charStrings.objects, + subrs: cff.topDict.privateDict?.subrsIndex?.objects, + gsubrs: cff.globalSubrIndex?.objects, + isCFFCIDFont: cff.isCIDFont, + fdSelect: cff.fdSelect, + fdArray: cff.fdArray + }; +} +function parseGlyfTable(glyf, loca, isGlyphLocationsLong) { + let itemSize, itemDecode; + if (isGlyphLocationsLong) { + itemSize = 4; + itemDecode = getUint32; + } else { + itemSize = 2; + itemDecode = (data, offset) => 2 * getUint16(data, offset); + } + const glyphs = []; + let startOffset = itemDecode(loca, 0); + for (let j = itemSize; j < loca.length; j += itemSize) { + const endOffset = itemDecode(loca, j); + glyphs.push(glyf.subarray(startOffset, endOffset)); + startOffset = endOffset; + } + return glyphs; +} +function lookupCmap(ranges, unicode) { + const code = unicode.codePointAt(0); + let gid = 0, + l = 0, + r = ranges.length - 1; + while (l < r) { + const c = l + r + 1 >> 1; + if (code < ranges[c].start) { + r = c - 1; + } else { + l = c; + } + } + if (ranges[l].start <= code && code <= ranges[l].end) { + gid = ranges[l].idDelta + (ranges[l].ids ? ranges[l].ids[code - ranges[l].start] : code) & 0xffff; + } + return { + charCode: code, + glyphId: gid + }; +} +function compileGlyf(code, cmds, font) { + function moveTo(x, y) { + cmds.push({ + cmd: "moveTo", + args: [x, y] + }); + } + function lineTo(x, y) { + cmds.push({ + cmd: "lineTo", + args: [x, y] + }); + } + function quadraticCurveTo(xa, ya, x, y) { + cmds.push({ + cmd: "quadraticCurveTo", + args: [xa, ya, x, y] + }); + } + let i = 0; + const numberOfContours = getInt16(code, i); + let flags; + let x = 0, + y = 0; + i += 10; + if (numberOfContours < 0) { + do { + flags = getUint16(code, i); + const glyphIndex = getUint16(code, i + 2); + i += 4; + let arg1, arg2; + if (flags & 0x01) { + if (flags & 0x02) { + arg1 = getInt16(code, i); + arg2 = getInt16(code, i + 2); + } else { + arg1 = getUint16(code, i); + arg2 = getUint16(code, i + 2); + } + i += 4; + } else if (flags & 0x02) { + arg1 = getInt8(code, i++); + arg2 = getInt8(code, i++); + } else { + arg1 = code[i++]; + arg2 = code[i++]; + } + if (flags & 0x02) { + x = arg1; + y = arg2; + } else { + x = 0; + y = 0; + } + let scaleX = 1, + scaleY = 1, + scale01 = 0, + scale10 = 0; + if (flags & 0x08) { + scaleX = scaleY = getFloat214(code, i); + i += 2; + } else if (flags & 0x40) { + scaleX = getFloat214(code, i); + scaleY = getFloat214(code, i + 2); + i += 4; + } else if (flags & 0x80) { + scaleX = getFloat214(code, i); + scale01 = getFloat214(code, i + 2); + scale10 = getFloat214(code, i + 4); + scaleY = getFloat214(code, i + 6); + i += 8; + } + const subglyph = font.glyphs[glyphIndex]; + if (subglyph) { + cmds.push({ + cmd: "save" + }, { + cmd: "transform", + args: [scaleX, scale01, scale10, scaleY, x, y] + }); + if (!(flags & 0x02)) {} + compileGlyf(subglyph, cmds, font); + cmds.push({ + cmd: "restore" + }); + } + } while (flags & 0x20); + } else { + const endPtsOfContours = []; + let j, jj; + for (j = 0; j < numberOfContours; j++) { + endPtsOfContours.push(getUint16(code, i)); + i += 2; + } + const instructionLength = getUint16(code, i); + i += 2 + instructionLength; + const numberOfPoints = endPtsOfContours.at(-1) + 1; + const points = []; + while (points.length < numberOfPoints) { + flags = code[i++]; + let repeat = 1; + if (flags & 0x08) { + repeat += code[i++]; + } + while (repeat-- > 0) { + points.push({ + flags + }); + } + } + for (j = 0; j < numberOfPoints; j++) { + switch (points[j].flags & 0x12) { + case 0x00: + x += getInt16(code, i); + i += 2; + break; + case 0x02: + x -= code[i++]; + break; + case 0x12: + x += code[i++]; + break; + } + points[j].x = x; + } + for (j = 0; j < numberOfPoints; j++) { + switch (points[j].flags & 0x24) { + case 0x00: + y += getInt16(code, i); + i += 2; + break; + case 0x04: + y -= code[i++]; + break; + case 0x24: + y += code[i++]; + break; + } + points[j].y = y; + } + let startPoint = 0; + for (i = 0; i < numberOfContours; i++) { + const endPoint = endPtsOfContours[i]; + const contour = points.slice(startPoint, endPoint + 1); + if (contour[0].flags & 1) { + contour.push(contour[0]); + } else if (contour.at(-1).flags & 1) { + contour.unshift(contour.at(-1)); + } else { + const p = { + flags: 1, + x: (contour[0].x + contour.at(-1).x) / 2, + y: (contour[0].y + contour.at(-1).y) / 2 + }; + contour.unshift(p); + contour.push(p); + } + moveTo(contour[0].x, contour[0].y); + for (j = 1, jj = contour.length; j < jj; j++) { + if (contour[j].flags & 1) { + lineTo(contour[j].x, contour[j].y); + } else if (contour[j + 1].flags & 1) { + quadraticCurveTo(contour[j].x, contour[j].y, contour[j + 1].x, contour[j + 1].y); + j++; + } else { + quadraticCurveTo(contour[j].x, contour[j].y, (contour[j].x + contour[j + 1].x) / 2, (contour[j].y + contour[j + 1].y) / 2); + } + } + startPoint = endPoint + 1; + } + } +} +function compileCharString(charStringCode, cmds, font, glyphId) { + function moveTo(x, y) { + cmds.push({ + cmd: "moveTo", + args: [x, y] + }); + } + function lineTo(x, y) { + cmds.push({ + cmd: "lineTo", + args: [x, y] + }); + } + function bezierCurveTo(x1, y1, x2, y2, x, y) { + cmds.push({ + cmd: "bezierCurveTo", + args: [x1, y1, x2, y2, x, y] + }); + } + const stack = []; + let x = 0, + y = 0; + let stems = 0; + function parse(code) { + let i = 0; + while (i < code.length) { + let stackClean = false; + let v = code[i++]; + let xa, xb, ya, yb, y1, y2, y3, n, subrCode; + switch (v) { + case 1: + stems += stack.length >> 1; + stackClean = true; + break; + case 3: + stems += stack.length >> 1; + stackClean = true; + break; + case 4: + y += stack.pop(); + moveTo(x, y); + stackClean = true; + break; + case 5: + while (stack.length > 0) { + x += stack.shift(); + y += stack.shift(); + lineTo(x, y); + } + break; + case 6: + while (stack.length > 0) { + x += stack.shift(); + lineTo(x, y); + if (stack.length === 0) { + break; + } + y += stack.shift(); + lineTo(x, y); + } + break; + case 7: + while (stack.length > 0) { + y += stack.shift(); + lineTo(x, y); + if (stack.length === 0) { + break; + } + x += stack.shift(); + lineTo(x, y); + } + break; + case 8: + while (stack.length > 0) { + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); + } + break; + case 10: + n = stack.pop(); + subrCode = null; + if (font.isCFFCIDFont) { + const fdIndex = font.fdSelect.getFDIndex(glyphId); + if (fdIndex >= 0 && fdIndex < font.fdArray.length) { + const fontDict = font.fdArray[fdIndex]; + let subrs; + if (fontDict.privateDict?.subrsIndex) { + subrs = fontDict.privateDict.subrsIndex.objects; + } + if (subrs) { + n += getSubroutineBias(subrs); + subrCode = subrs[n]; + } + } else { + warn("Invalid fd index for glyph index."); + } + } else { + subrCode = font.subrs[n + font.subrsBias]; + } + if (subrCode) { + parse(subrCode); + } + break; + case 11: + return; + case 12: + v = code[i++]; + switch (v) { + case 34: + xa = x + stack.shift(); + xb = xa + stack.shift(); + y1 = y + stack.shift(); + x = xb + stack.shift(); + bezierCurveTo(xa, y, xb, y1, x, y1); + xa = x + stack.shift(); + xb = xa + stack.shift(); + x = xb + stack.shift(); + bezierCurveTo(xa, y1, xb, y, x, y); + break; + case 35: + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); + stack.pop(); + break; + case 36: + xa = x + stack.shift(); + y1 = y + stack.shift(); + xb = xa + stack.shift(); + y2 = y1 + stack.shift(); + x = xb + stack.shift(); + bezierCurveTo(xa, y1, xb, y2, x, y2); + xa = x + stack.shift(); + xb = xa + stack.shift(); + y3 = y2 + stack.shift(); + x = xb + stack.shift(); + bezierCurveTo(xa, y2, xb, y3, x, y); + break; + case 37: + const x0 = x, + y0 = y; + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb; + y = yb; + if (Math.abs(x - x0) > Math.abs(y - y0)) { + x += stack.shift(); + } else { + y += stack.shift(); + } + bezierCurveTo(xa, ya, xb, yb, x, y); + break; + default: + throw new FormatError(`unknown operator: 12 ${v}`); + } + break; + case 14: + if (stack.length >= 4) { + const achar = stack.pop(); + const bchar = stack.pop(); + y = stack.pop(); + x = stack.pop(); + cmds.push({ + cmd: "save" + }, { + cmd: "translate", + args: [x, y] + }); + let cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[StandardEncoding[achar]])); + compileCharString(font.glyphs[cmap.glyphId], cmds, font, cmap.glyphId); + cmds.push({ + cmd: "restore" + }); + cmap = lookupCmap(font.cmap, String.fromCharCode(font.glyphNameMap[StandardEncoding[bchar]])); + compileCharString(font.glyphs[cmap.glyphId], cmds, font, cmap.glyphId); + } + return; + case 18: + stems += stack.length >> 1; + stackClean = true; + break; + case 19: + stems += stack.length >> 1; + i += stems + 7 >> 3; + stackClean = true; + break; + case 20: + stems += stack.length >> 1; + i += stems + 7 >> 3; + stackClean = true; + break; + case 21: + y += stack.pop(); + x += stack.pop(); + moveTo(x, y); + stackClean = true; + break; + case 22: + x += stack.pop(); + moveTo(x, y); + stackClean = true; + break; + case 23: + stems += stack.length >> 1; + stackClean = true; + break; + case 24: + while (stack.length > 2) { + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); + } + x += stack.shift(); + y += stack.shift(); + lineTo(x, y); + break; + case 25: + while (stack.length > 6) { + x += stack.shift(); + y += stack.shift(); + lineTo(x, y); + } + xa = x + stack.shift(); + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); + break; + case 26: + if (stack.length % 2) { + x += stack.shift(); + } + while (stack.length > 0) { + xa = x; + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb; + y = yb + stack.shift(); + bezierCurveTo(xa, ya, xb, yb, x, y); + } + break; + case 27: + if (stack.length % 2) { + y += stack.shift(); + } + while (stack.length > 0) { + xa = x + stack.shift(); + ya = y; + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb; + bezierCurveTo(xa, ya, xb, yb, x, y); + } + break; + case 28: + stack.push((code[i] << 24 | code[i + 1] << 16) >> 16); + i += 2; + break; + case 29: + n = stack.pop() + font.gsubrsBias; + subrCode = font.gsubrs[n]; + if (subrCode) { + parse(subrCode); + } + break; + case 30: + while (stack.length > 0) { + xa = x; + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + (stack.length === 1 ? stack.shift() : 0); + bezierCurveTo(xa, ya, xb, yb, x, y); + if (stack.length === 0) { + break; + } + xa = x + stack.shift(); + ya = y; + xb = xa + stack.shift(); + yb = ya + stack.shift(); + y = yb + stack.shift(); + x = xb + (stack.length === 1 ? stack.shift() : 0); + bezierCurveTo(xa, ya, xb, yb, x, y); + } + break; + case 31: + while (stack.length > 0) { + xa = x + stack.shift(); + ya = y; + xb = xa + stack.shift(); + yb = ya + stack.shift(); + y = yb + stack.shift(); + x = xb + (stack.length === 1 ? stack.shift() : 0); + bezierCurveTo(xa, ya, xb, yb, x, y); + if (stack.length === 0) { + break; + } + xa = x; + ya = y + stack.shift(); + xb = xa + stack.shift(); + yb = ya + stack.shift(); + x = xb + stack.shift(); + y = yb + (stack.length === 1 ? stack.shift() : 0); + bezierCurveTo(xa, ya, xb, yb, x, y); + } + break; + default: + if (v < 32) { + throw new FormatError(`unknown operator: ${v}`); + } + if (v < 247) { + stack.push(v - 139); + } else if (v < 251) { + stack.push((v - 247) * 256 + code[i++] + 108); + } else if (v < 255) { + stack.push(-(v - 251) * 256 - code[i++] - 108); + } else { + stack.push((code[i] << 24 | code[i + 1] << 16 | code[i + 2] << 8 | code[i + 3]) / 65536); + i += 4; + } + break; + } + if (stackClean) { + stack.length = 0; + } + } + } + parse(charStringCode); +} +const NOOP = []; +class CompiledFont { + constructor(fontMatrix) { + if (this.constructor === CompiledFont) { + unreachable("Cannot initialize CompiledFont."); + } + this.fontMatrix = fontMatrix; + this.compiledGlyphs = Object.create(null); + this.compiledCharCodeToGlyphId = Object.create(null); + } + getPathJs(unicode) { + const { + charCode, + glyphId + } = lookupCmap(this.cmap, unicode); + let fn = this.compiledGlyphs[glyphId]; + if (!fn) { + try { + fn = this.compileGlyph(this.glyphs[glyphId], glyphId); + this.compiledGlyphs[glyphId] = fn; + } catch (ex) { + this.compiledGlyphs[glyphId] = NOOP; + if (this.compiledCharCodeToGlyphId[charCode] === undefined) { + this.compiledCharCodeToGlyphId[charCode] = glyphId; + } + throw ex; + } + } + if (this.compiledCharCodeToGlyphId[charCode] === undefined) { + this.compiledCharCodeToGlyphId[charCode] = glyphId; + } + return fn; + } + compileGlyph(code, glyphId) { + if (!code || code.length === 0 || code[0] === 14) { + return NOOP; + } + let fontMatrix = this.fontMatrix; + if (this.isCFFCIDFont) { + const fdIndex = this.fdSelect.getFDIndex(glyphId); + if (fdIndex >= 0 && fdIndex < this.fdArray.length) { + const fontDict = this.fdArray[fdIndex]; + fontMatrix = fontDict.getByName("FontMatrix") || FONT_IDENTITY_MATRIX; + } else { + warn("Invalid fd index for glyph index."); + } + } + const cmds = [{ + cmd: "save" + }, { + cmd: "transform", + args: fontMatrix.slice() + }, { + cmd: "scale", + args: ["size", "-size"] + }]; + this.compileGlyphImpl(code, cmds, glyphId); + cmds.push({ + cmd: "restore" + }); + return cmds; + } + compileGlyphImpl() { + unreachable("Children classes should implement this."); + } + hasBuiltPath(unicode) { + const { + charCode, + glyphId + } = lookupCmap(this.cmap, unicode); + return this.compiledGlyphs[glyphId] !== undefined && this.compiledCharCodeToGlyphId[charCode] !== undefined; + } +} +class TrueTypeCompiled extends CompiledFont { + constructor(glyphs, cmap, fontMatrix) { + super(fontMatrix || [0.000488, 0, 0, 0.000488, 0, 0]); + this.glyphs = glyphs; + this.cmap = cmap; + } + compileGlyphImpl(code, cmds) { + compileGlyf(code, cmds, this); + } +} +class Type2Compiled extends CompiledFont { + constructor(cffInfo, cmap, fontMatrix, glyphNameMap) { + super(fontMatrix || [0.001, 0, 0, 0.001, 0, 0]); + this.glyphs = cffInfo.glyphs; + this.gsubrs = cffInfo.gsubrs || []; + this.subrs = cffInfo.subrs || []; + this.cmap = cmap; + this.glyphNameMap = glyphNameMap || getGlyphsUnicode(); + this.gsubrsBias = getSubroutineBias(this.gsubrs); + this.subrsBias = getSubroutineBias(this.subrs); + this.isCFFCIDFont = cffInfo.isCFFCIDFont; + this.fdSelect = cffInfo.fdSelect; + this.fdArray = cffInfo.fdArray; + } + compileGlyphImpl(code, cmds, glyphId) { + compileCharString(code, cmds, this, glyphId); + } +} +class FontRendererFactory { + static create(font, seacAnalysisEnabled) { + const data = new Uint8Array(font.data); + let cmap, glyf, loca, cff, indexToLocFormat, unitsPerEm; + const numTables = getUint16(data, 4); + for (let i = 0, p = 12; i < numTables; i++, p += 16) { + const tag = bytesToString(data.subarray(p, p + 4)); + const offset = getUint32(data, p + 8); + const length = getUint32(data, p + 12); + switch (tag) { + case "cmap": + cmap = parseCmap(data, offset, offset + length); + break; + case "glyf": + glyf = data.subarray(offset, offset + length); + break; + case "loca": + loca = data.subarray(offset, offset + length); + break; + case "head": + unitsPerEm = getUint16(data, offset + 18); + indexToLocFormat = getUint16(data, offset + 50); + break; + case "CFF ": + cff = parseCff(data, offset, offset + length, seacAnalysisEnabled); + break; + } + } + if (glyf) { + const fontMatrix = !unitsPerEm ? font.fontMatrix : [1 / unitsPerEm, 0, 0, 1 / unitsPerEm, 0, 0]; + return new TrueTypeCompiled(parseGlyfTable(glyf, loca, indexToLocFormat), cmap, fontMatrix); + } + return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap); + } +} + +;// CONCATENATED MODULE: ./src/core/metrics.js + +const getMetrics = getLookupTableFactory(function (t) { + t.Courier = 600; + t["Courier-Bold"] = 600; + t["Courier-BoldOblique"] = 600; + t["Courier-Oblique"] = 600; + t.Helvetica = getLookupTableFactory(function (t) { + t.space = 278; + t.exclam = 278; + t.quotedbl = 355; + t.numbersign = 556; + t.dollar = 556; + t.percent = 889; + t.ampersand = 667; + t.quoteright = 222; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 389; + t.plus = 584; + t.comma = 278; + t.hyphen = 333; + t.period = 278; + t.slash = 278; + t.zero = 556; + t.one = 556; + t.two = 556; + t.three = 556; + t.four = 556; + t.five = 556; + t.six = 556; + t.seven = 556; + t.eight = 556; + t.nine = 556; + t.colon = 278; + t.semicolon = 278; + t.less = 584; + t.equal = 584; + t.greater = 584; + t.question = 556; + t.at = 1015; + t.A = 667; + t.B = 667; + t.C = 722; + t.D = 722; + t.E = 667; + t.F = 611; + t.G = 778; + t.H = 722; + t.I = 278; + t.J = 500; + t.K = 667; + t.L = 556; + t.M = 833; + t.N = 722; + t.O = 778; + t.P = 667; + t.Q = 778; + t.R = 722; + t.S = 667; + t.T = 611; + t.U = 722; + t.V = 667; + t.W = 944; + t.X = 667; + t.Y = 667; + t.Z = 611; + t.bracketleft = 278; + t.backslash = 278; + t.bracketright = 278; + t.asciicircum = 469; + t.underscore = 556; + t.quoteleft = 222; + t.a = 556; + t.b = 556; + t.c = 500; + t.d = 556; + t.e = 556; + t.f = 278; + t.g = 556; + t.h = 556; + t.i = 222; + t.j = 222; + t.k = 500; + t.l = 222; + t.m = 833; + t.n = 556; + t.o = 556; + t.p = 556; + t.q = 556; + t.r = 333; + t.s = 500; + t.t = 278; + t.u = 556; + t.v = 500; + t.w = 722; + t.x = 500; + t.y = 500; + t.z = 500; + t.braceleft = 334; + t.bar = 260; + t.braceright = 334; + t.asciitilde = 584; + t.exclamdown = 333; + t.cent = 556; + t.sterling = 556; + t.fraction = 167; + t.yen = 556; + t.florin = 556; + t.section = 556; + t.currency = 556; + t.quotesingle = 191; + t.quotedblleft = 333; + t.guillemotleft = 556; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 500; + t.fl = 500; + t.endash = 556; + t.dagger = 556; + t.daggerdbl = 556; + t.periodcentered = 278; + t.paragraph = 537; + t.bullet = 350; + t.quotesinglbase = 222; + t.quotedblbase = 333; + t.quotedblright = 333; + t.guillemotright = 556; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 611; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 1000; + t.ordfeminine = 370; + t.Lslash = 556; + t.Oslash = 778; + t.OE = 1000; + t.ordmasculine = 365; + t.ae = 889; + t.dotlessi = 278; + t.lslash = 222; + t.oslash = 611; + t.oe = 944; + t.germandbls = 611; + t.Idieresis = 278; + t.eacute = 556; + t.abreve = 556; + t.uhungarumlaut = 556; + t.ecaron = 556; + t.Ydieresis = 667; + t.divide = 584; + t.Yacute = 667; + t.Acircumflex = 667; + t.aacute = 556; + t.Ucircumflex = 722; + t.yacute = 500; + t.scommaaccent = 500; + t.ecircumflex = 556; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 556; + t.Uacute = 722; + t.uogonek = 556; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 737; + t.Emacron = 667; + t.ccaron = 500; + t.aring = 556; + t.Ncommaaccent = 722; + t.lacute = 222; + t.agrave = 556; + t.Tcommaaccent = 611; + t.Cacute = 722; + t.atilde = 556; + t.Edotaccent = 667; + t.scaron = 500; + t.scedilla = 500; + t.iacute = 278; + t.lozenge = 471; + t.Rcaron = 722; + t.Gcommaaccent = 778; + t.ucircumflex = 556; + t.acircumflex = 556; + t.Amacron = 667; + t.rcaron = 333; + t.ccedilla = 500; + t.Zdotaccent = 611; + t.Thorn = 667; + t.Omacron = 778; + t.Racute = 722; + t.Sacute = 667; + t.dcaron = 643; + t.Umacron = 722; + t.uring = 556; + t.threesuperior = 333; + t.Ograve = 778; + t.Agrave = 667; + t.Abreve = 667; + t.multiply = 584; + t.uacute = 556; + t.Tcaron = 611; + t.partialdiff = 476; + t.ydieresis = 500; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 556; + t.edieresis = 556; + t.cacute = 500; + t.nacute = 556; + t.umacron = 556; + t.Ncaron = 722; + t.Iacute = 278; + t.plusminus = 584; + t.brokenbar = 260; + t.registered = 737; + t.Gbreve = 778; + t.Idotaccent = 278; + t.summation = 600; + t.Egrave = 667; + t.racute = 333; + t.omacron = 556; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 722; + t.lcommaaccent = 222; + t.tcaron = 317; + t.eogonek = 556; + t.Uogonek = 722; + t.Aacute = 667; + t.Adieresis = 667; + t.egrave = 556; + t.zacute = 500; + t.iogonek = 222; + t.Oacute = 778; + t.oacute = 556; + t.amacron = 556; + t.sacute = 500; + t.idieresis = 278; + t.Ocircumflex = 778; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 556; + t.twosuperior = 333; + t.Odieresis = 778; + t.mu = 556; + t.igrave = 278; + t.ohungarumlaut = 556; + t.Eogonek = 667; + t.dcroat = 556; + t.threequarters = 834; + t.Scedilla = 667; + t.lcaron = 299; + t.Kcommaaccent = 667; + t.Lacute = 556; + t.trademark = 1000; + t.edotaccent = 556; + t.Igrave = 278; + t.Imacron = 278; + t.Lcaron = 556; + t.onehalf = 834; + t.lessequal = 549; + t.ocircumflex = 556; + t.ntilde = 556; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 556; + t.gbreve = 556; + t.onequarter = 834; + t.Scaron = 667; + t.Scommaaccent = 667; + t.Ohungarumlaut = 778; + t.degree = 400; + t.ograve = 556; + t.Ccaron = 722; + t.ugrave = 556; + t.radical = 453; + t.Dcaron = 722; + t.rcommaaccent = 333; + t.Ntilde = 722; + t.otilde = 556; + t.Rcommaaccent = 722; + t.Lcommaaccent = 556; + t.Atilde = 667; + t.Aogonek = 667; + t.Aring = 667; + t.Otilde = 778; + t.zdotaccent = 500; + t.Ecaron = 667; + t.Iogonek = 278; + t.kcommaaccent = 500; + t.minus = 584; + t.Icircumflex = 278; + t.ncaron = 556; + t.tcommaaccent = 278; + t.logicalnot = 584; + t.odieresis = 556; + t.udieresis = 556; + t.notequal = 549; + t.gcommaaccent = 556; + t.eth = 556; + t.zcaron = 500; + t.ncommaaccent = 556; + t.onesuperior = 333; + t.imacron = 278; + t.Euro = 556; + }); + t["Helvetica-Bold"] = getLookupTableFactory(function (t) { + t.space = 278; + t.exclam = 333; + t.quotedbl = 474; + t.numbersign = 556; + t.dollar = 556; + t.percent = 889; + t.ampersand = 722; + t.quoteright = 278; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 389; + t.plus = 584; + t.comma = 278; + t.hyphen = 333; + t.period = 278; + t.slash = 278; + t.zero = 556; + t.one = 556; + t.two = 556; + t.three = 556; + t.four = 556; + t.five = 556; + t.six = 556; + t.seven = 556; + t.eight = 556; + t.nine = 556; + t.colon = 333; + t.semicolon = 333; + t.less = 584; + t.equal = 584; + t.greater = 584; + t.question = 611; + t.at = 975; + t.A = 722; + t.B = 722; + t.C = 722; + t.D = 722; + t.E = 667; + t.F = 611; + t.G = 778; + t.H = 722; + t.I = 278; + t.J = 556; + t.K = 722; + t.L = 611; + t.M = 833; + t.N = 722; + t.O = 778; + t.P = 667; + t.Q = 778; + t.R = 722; + t.S = 667; + t.T = 611; + t.U = 722; + t.V = 667; + t.W = 944; + t.X = 667; + t.Y = 667; + t.Z = 611; + t.bracketleft = 333; + t.backslash = 278; + t.bracketright = 333; + t.asciicircum = 584; + t.underscore = 556; + t.quoteleft = 278; + t.a = 556; + t.b = 611; + t.c = 556; + t.d = 611; + t.e = 556; + t.f = 333; + t.g = 611; + t.h = 611; + t.i = 278; + t.j = 278; + t.k = 556; + t.l = 278; + t.m = 889; + t.n = 611; + t.o = 611; + t.p = 611; + t.q = 611; + t.r = 389; + t.s = 556; + t.t = 333; + t.u = 611; + t.v = 556; + t.w = 778; + t.x = 556; + t.y = 556; + t.z = 500; + t.braceleft = 389; + t.bar = 280; + t.braceright = 389; + t.asciitilde = 584; + t.exclamdown = 333; + t.cent = 556; + t.sterling = 556; + t.fraction = 167; + t.yen = 556; + t.florin = 556; + t.section = 556; + t.currency = 556; + t.quotesingle = 238; + t.quotedblleft = 500; + t.guillemotleft = 556; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 611; + t.fl = 611; + t.endash = 556; + t.dagger = 556; + t.daggerdbl = 556; + t.periodcentered = 278; + t.paragraph = 556; + t.bullet = 350; + t.quotesinglbase = 278; + t.quotedblbase = 500; + t.quotedblright = 500; + t.guillemotright = 556; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 611; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 1000; + t.ordfeminine = 370; + t.Lslash = 611; + t.Oslash = 778; + t.OE = 1000; + t.ordmasculine = 365; + t.ae = 889; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 611; + t.oe = 944; + t.germandbls = 611; + t.Idieresis = 278; + t.eacute = 556; + t.abreve = 556; + t.uhungarumlaut = 611; + t.ecaron = 556; + t.Ydieresis = 667; + t.divide = 584; + t.Yacute = 667; + t.Acircumflex = 722; + t.aacute = 556; + t.Ucircumflex = 722; + t.yacute = 556; + t.scommaaccent = 556; + t.ecircumflex = 556; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 556; + t.Uacute = 722; + t.uogonek = 611; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 737; + t.Emacron = 667; + t.ccaron = 556; + t.aring = 556; + t.Ncommaaccent = 722; + t.lacute = 278; + t.agrave = 556; + t.Tcommaaccent = 611; + t.Cacute = 722; + t.atilde = 556; + t.Edotaccent = 667; + t.scaron = 556; + t.scedilla = 556; + t.iacute = 278; + t.lozenge = 494; + t.Rcaron = 722; + t.Gcommaaccent = 778; + t.ucircumflex = 611; + t.acircumflex = 556; + t.Amacron = 722; + t.rcaron = 389; + t.ccedilla = 556; + t.Zdotaccent = 611; + t.Thorn = 667; + t.Omacron = 778; + t.Racute = 722; + t.Sacute = 667; + t.dcaron = 743; + t.Umacron = 722; + t.uring = 611; + t.threesuperior = 333; + t.Ograve = 778; + t.Agrave = 722; + t.Abreve = 722; + t.multiply = 584; + t.uacute = 611; + t.Tcaron = 611; + t.partialdiff = 494; + t.ydieresis = 556; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 556; + t.edieresis = 556; + t.cacute = 556; + t.nacute = 611; + t.umacron = 611; + t.Ncaron = 722; + t.Iacute = 278; + t.plusminus = 584; + t.brokenbar = 280; + t.registered = 737; + t.Gbreve = 778; + t.Idotaccent = 278; + t.summation = 600; + t.Egrave = 667; + t.racute = 389; + t.omacron = 611; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 722; + t.lcommaaccent = 278; + t.tcaron = 389; + t.eogonek = 556; + t.Uogonek = 722; + t.Aacute = 722; + t.Adieresis = 722; + t.egrave = 556; + t.zacute = 500; + t.iogonek = 278; + t.Oacute = 778; + t.oacute = 611; + t.amacron = 556; + t.sacute = 556; + t.idieresis = 278; + t.Ocircumflex = 778; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 611; + t.twosuperior = 333; + t.Odieresis = 778; + t.mu = 611; + t.igrave = 278; + t.ohungarumlaut = 611; + t.Eogonek = 667; + t.dcroat = 611; + t.threequarters = 834; + t.Scedilla = 667; + t.lcaron = 400; + t.Kcommaaccent = 722; + t.Lacute = 611; + t.trademark = 1000; + t.edotaccent = 556; + t.Igrave = 278; + t.Imacron = 278; + t.Lcaron = 611; + t.onehalf = 834; + t.lessequal = 549; + t.ocircumflex = 611; + t.ntilde = 611; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 556; + t.gbreve = 611; + t.onequarter = 834; + t.Scaron = 667; + t.Scommaaccent = 667; + t.Ohungarumlaut = 778; + t.degree = 400; + t.ograve = 611; + t.Ccaron = 722; + t.ugrave = 611; + t.radical = 549; + t.Dcaron = 722; + t.rcommaaccent = 389; + t.Ntilde = 722; + t.otilde = 611; + t.Rcommaaccent = 722; + t.Lcommaaccent = 611; + t.Atilde = 722; + t.Aogonek = 722; + t.Aring = 722; + t.Otilde = 778; + t.zdotaccent = 500; + t.Ecaron = 667; + t.Iogonek = 278; + t.kcommaaccent = 556; + t.minus = 584; + t.Icircumflex = 278; + t.ncaron = 611; + t.tcommaaccent = 333; + t.logicalnot = 584; + t.odieresis = 611; + t.udieresis = 611; + t.notequal = 549; + t.gcommaaccent = 611; + t.eth = 611; + t.zcaron = 500; + t.ncommaaccent = 611; + t.onesuperior = 333; + t.imacron = 278; + t.Euro = 556; + }); + t["Helvetica-BoldOblique"] = getLookupTableFactory(function (t) { + t.space = 278; + t.exclam = 333; + t.quotedbl = 474; + t.numbersign = 556; + t.dollar = 556; + t.percent = 889; + t.ampersand = 722; + t.quoteright = 278; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 389; + t.plus = 584; + t.comma = 278; + t.hyphen = 333; + t.period = 278; + t.slash = 278; + t.zero = 556; + t.one = 556; + t.two = 556; + t.three = 556; + t.four = 556; + t.five = 556; + t.six = 556; + t.seven = 556; + t.eight = 556; + t.nine = 556; + t.colon = 333; + t.semicolon = 333; + t.less = 584; + t.equal = 584; + t.greater = 584; + t.question = 611; + t.at = 975; + t.A = 722; + t.B = 722; + t.C = 722; + t.D = 722; + t.E = 667; + t.F = 611; + t.G = 778; + t.H = 722; + t.I = 278; + t.J = 556; + t.K = 722; + t.L = 611; + t.M = 833; + t.N = 722; + t.O = 778; + t.P = 667; + t.Q = 778; + t.R = 722; + t.S = 667; + t.T = 611; + t.U = 722; + t.V = 667; + t.W = 944; + t.X = 667; + t.Y = 667; + t.Z = 611; + t.bracketleft = 333; + t.backslash = 278; + t.bracketright = 333; + t.asciicircum = 584; + t.underscore = 556; + t.quoteleft = 278; + t.a = 556; + t.b = 611; + t.c = 556; + t.d = 611; + t.e = 556; + t.f = 333; + t.g = 611; + t.h = 611; + t.i = 278; + t.j = 278; + t.k = 556; + t.l = 278; + t.m = 889; + t.n = 611; + t.o = 611; + t.p = 611; + t.q = 611; + t.r = 389; + t.s = 556; + t.t = 333; + t.u = 611; + t.v = 556; + t.w = 778; + t.x = 556; + t.y = 556; + t.z = 500; + t.braceleft = 389; + t.bar = 280; + t.braceright = 389; + t.asciitilde = 584; + t.exclamdown = 333; + t.cent = 556; + t.sterling = 556; + t.fraction = 167; + t.yen = 556; + t.florin = 556; + t.section = 556; + t.currency = 556; + t.quotesingle = 238; + t.quotedblleft = 500; + t.guillemotleft = 556; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 611; + t.fl = 611; + t.endash = 556; + t.dagger = 556; + t.daggerdbl = 556; + t.periodcentered = 278; + t.paragraph = 556; + t.bullet = 350; + t.quotesinglbase = 278; + t.quotedblbase = 500; + t.quotedblright = 500; + t.guillemotright = 556; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 611; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 1000; + t.ordfeminine = 370; + t.Lslash = 611; + t.Oslash = 778; + t.OE = 1000; + t.ordmasculine = 365; + t.ae = 889; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 611; + t.oe = 944; + t.germandbls = 611; + t.Idieresis = 278; + t.eacute = 556; + t.abreve = 556; + t.uhungarumlaut = 611; + t.ecaron = 556; + t.Ydieresis = 667; + t.divide = 584; + t.Yacute = 667; + t.Acircumflex = 722; + t.aacute = 556; + t.Ucircumflex = 722; + t.yacute = 556; + t.scommaaccent = 556; + t.ecircumflex = 556; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 556; + t.Uacute = 722; + t.uogonek = 611; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 737; + t.Emacron = 667; + t.ccaron = 556; + t.aring = 556; + t.Ncommaaccent = 722; + t.lacute = 278; + t.agrave = 556; + t.Tcommaaccent = 611; + t.Cacute = 722; + t.atilde = 556; + t.Edotaccent = 667; + t.scaron = 556; + t.scedilla = 556; + t.iacute = 278; + t.lozenge = 494; + t.Rcaron = 722; + t.Gcommaaccent = 778; + t.ucircumflex = 611; + t.acircumflex = 556; + t.Amacron = 722; + t.rcaron = 389; + t.ccedilla = 556; + t.Zdotaccent = 611; + t.Thorn = 667; + t.Omacron = 778; + t.Racute = 722; + t.Sacute = 667; + t.dcaron = 743; + t.Umacron = 722; + t.uring = 611; + t.threesuperior = 333; + t.Ograve = 778; + t.Agrave = 722; + t.Abreve = 722; + t.multiply = 584; + t.uacute = 611; + t.Tcaron = 611; + t.partialdiff = 494; + t.ydieresis = 556; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 556; + t.edieresis = 556; + t.cacute = 556; + t.nacute = 611; + t.umacron = 611; + t.Ncaron = 722; + t.Iacute = 278; + t.plusminus = 584; + t.brokenbar = 280; + t.registered = 737; + t.Gbreve = 778; + t.Idotaccent = 278; + t.summation = 600; + t.Egrave = 667; + t.racute = 389; + t.omacron = 611; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 722; + t.lcommaaccent = 278; + t.tcaron = 389; + t.eogonek = 556; + t.Uogonek = 722; + t.Aacute = 722; + t.Adieresis = 722; + t.egrave = 556; + t.zacute = 500; + t.iogonek = 278; + t.Oacute = 778; + t.oacute = 611; + t.amacron = 556; + t.sacute = 556; + t.idieresis = 278; + t.Ocircumflex = 778; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 611; + t.twosuperior = 333; + t.Odieresis = 778; + t.mu = 611; + t.igrave = 278; + t.ohungarumlaut = 611; + t.Eogonek = 667; + t.dcroat = 611; + t.threequarters = 834; + t.Scedilla = 667; + t.lcaron = 400; + t.Kcommaaccent = 722; + t.Lacute = 611; + t.trademark = 1000; + t.edotaccent = 556; + t.Igrave = 278; + t.Imacron = 278; + t.Lcaron = 611; + t.onehalf = 834; + t.lessequal = 549; + t.ocircumflex = 611; + t.ntilde = 611; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 556; + t.gbreve = 611; + t.onequarter = 834; + t.Scaron = 667; + t.Scommaaccent = 667; + t.Ohungarumlaut = 778; + t.degree = 400; + t.ograve = 611; + t.Ccaron = 722; + t.ugrave = 611; + t.radical = 549; + t.Dcaron = 722; + t.rcommaaccent = 389; + t.Ntilde = 722; + t.otilde = 611; + t.Rcommaaccent = 722; + t.Lcommaaccent = 611; + t.Atilde = 722; + t.Aogonek = 722; + t.Aring = 722; + t.Otilde = 778; + t.zdotaccent = 500; + t.Ecaron = 667; + t.Iogonek = 278; + t.kcommaaccent = 556; + t.minus = 584; + t.Icircumflex = 278; + t.ncaron = 611; + t.tcommaaccent = 333; + t.logicalnot = 584; + t.odieresis = 611; + t.udieresis = 611; + t.notequal = 549; + t.gcommaaccent = 611; + t.eth = 611; + t.zcaron = 500; + t.ncommaaccent = 611; + t.onesuperior = 333; + t.imacron = 278; + t.Euro = 556; + }); + t["Helvetica-Oblique"] = getLookupTableFactory(function (t) { + t.space = 278; + t.exclam = 278; + t.quotedbl = 355; + t.numbersign = 556; + t.dollar = 556; + t.percent = 889; + t.ampersand = 667; + t.quoteright = 222; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 389; + t.plus = 584; + t.comma = 278; + t.hyphen = 333; + t.period = 278; + t.slash = 278; + t.zero = 556; + t.one = 556; + t.two = 556; + t.three = 556; + t.four = 556; + t.five = 556; + t.six = 556; + t.seven = 556; + t.eight = 556; + t.nine = 556; + t.colon = 278; + t.semicolon = 278; + t.less = 584; + t.equal = 584; + t.greater = 584; + t.question = 556; + t.at = 1015; + t.A = 667; + t.B = 667; + t.C = 722; + t.D = 722; + t.E = 667; + t.F = 611; + t.G = 778; + t.H = 722; + t.I = 278; + t.J = 500; + t.K = 667; + t.L = 556; + t.M = 833; + t.N = 722; + t.O = 778; + t.P = 667; + t.Q = 778; + t.R = 722; + t.S = 667; + t.T = 611; + t.U = 722; + t.V = 667; + t.W = 944; + t.X = 667; + t.Y = 667; + t.Z = 611; + t.bracketleft = 278; + t.backslash = 278; + t.bracketright = 278; + t.asciicircum = 469; + t.underscore = 556; + t.quoteleft = 222; + t.a = 556; + t.b = 556; + t.c = 500; + t.d = 556; + t.e = 556; + t.f = 278; + t.g = 556; + t.h = 556; + t.i = 222; + t.j = 222; + t.k = 500; + t.l = 222; + t.m = 833; + t.n = 556; + t.o = 556; + t.p = 556; + t.q = 556; + t.r = 333; + t.s = 500; + t.t = 278; + t.u = 556; + t.v = 500; + t.w = 722; + t.x = 500; + t.y = 500; + t.z = 500; + t.braceleft = 334; + t.bar = 260; + t.braceright = 334; + t.asciitilde = 584; + t.exclamdown = 333; + t.cent = 556; + t.sterling = 556; + t.fraction = 167; + t.yen = 556; + t.florin = 556; + t.section = 556; + t.currency = 556; + t.quotesingle = 191; + t.quotedblleft = 333; + t.guillemotleft = 556; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 500; + t.fl = 500; + t.endash = 556; + t.dagger = 556; + t.daggerdbl = 556; + t.periodcentered = 278; + t.paragraph = 537; + t.bullet = 350; + t.quotesinglbase = 222; + t.quotedblbase = 333; + t.quotedblright = 333; + t.guillemotright = 556; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 611; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 1000; + t.ordfeminine = 370; + t.Lslash = 556; + t.Oslash = 778; + t.OE = 1000; + t.ordmasculine = 365; + t.ae = 889; + t.dotlessi = 278; + t.lslash = 222; + t.oslash = 611; + t.oe = 944; + t.germandbls = 611; + t.Idieresis = 278; + t.eacute = 556; + t.abreve = 556; + t.uhungarumlaut = 556; + t.ecaron = 556; + t.Ydieresis = 667; + t.divide = 584; + t.Yacute = 667; + t.Acircumflex = 667; + t.aacute = 556; + t.Ucircumflex = 722; + t.yacute = 500; + t.scommaaccent = 500; + t.ecircumflex = 556; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 556; + t.Uacute = 722; + t.uogonek = 556; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 737; + t.Emacron = 667; + t.ccaron = 500; + t.aring = 556; + t.Ncommaaccent = 722; + t.lacute = 222; + t.agrave = 556; + t.Tcommaaccent = 611; + t.Cacute = 722; + t.atilde = 556; + t.Edotaccent = 667; + t.scaron = 500; + t.scedilla = 500; + t.iacute = 278; + t.lozenge = 471; + t.Rcaron = 722; + t.Gcommaaccent = 778; + t.ucircumflex = 556; + t.acircumflex = 556; + t.Amacron = 667; + t.rcaron = 333; + t.ccedilla = 500; + t.Zdotaccent = 611; + t.Thorn = 667; + t.Omacron = 778; + t.Racute = 722; + t.Sacute = 667; + t.dcaron = 643; + t.Umacron = 722; + t.uring = 556; + t.threesuperior = 333; + t.Ograve = 778; + t.Agrave = 667; + t.Abreve = 667; + t.multiply = 584; + t.uacute = 556; + t.Tcaron = 611; + t.partialdiff = 476; + t.ydieresis = 500; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 556; + t.edieresis = 556; + t.cacute = 500; + t.nacute = 556; + t.umacron = 556; + t.Ncaron = 722; + t.Iacute = 278; + t.plusminus = 584; + t.brokenbar = 260; + t.registered = 737; + t.Gbreve = 778; + t.Idotaccent = 278; + t.summation = 600; + t.Egrave = 667; + t.racute = 333; + t.omacron = 556; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 722; + t.lcommaaccent = 222; + t.tcaron = 317; + t.eogonek = 556; + t.Uogonek = 722; + t.Aacute = 667; + t.Adieresis = 667; + t.egrave = 556; + t.zacute = 500; + t.iogonek = 222; + t.Oacute = 778; + t.oacute = 556; + t.amacron = 556; + t.sacute = 500; + t.idieresis = 278; + t.Ocircumflex = 778; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 556; + t.twosuperior = 333; + t.Odieresis = 778; + t.mu = 556; + t.igrave = 278; + t.ohungarumlaut = 556; + t.Eogonek = 667; + t.dcroat = 556; + t.threequarters = 834; + t.Scedilla = 667; + t.lcaron = 299; + t.Kcommaaccent = 667; + t.Lacute = 556; + t.trademark = 1000; + t.edotaccent = 556; + t.Igrave = 278; + t.Imacron = 278; + t.Lcaron = 556; + t.onehalf = 834; + t.lessequal = 549; + t.ocircumflex = 556; + t.ntilde = 556; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 556; + t.gbreve = 556; + t.onequarter = 834; + t.Scaron = 667; + t.Scommaaccent = 667; + t.Ohungarumlaut = 778; + t.degree = 400; + t.ograve = 556; + t.Ccaron = 722; + t.ugrave = 556; + t.radical = 453; + t.Dcaron = 722; + t.rcommaaccent = 333; + t.Ntilde = 722; + t.otilde = 556; + t.Rcommaaccent = 722; + t.Lcommaaccent = 556; + t.Atilde = 667; + t.Aogonek = 667; + t.Aring = 667; + t.Otilde = 778; + t.zdotaccent = 500; + t.Ecaron = 667; + t.Iogonek = 278; + t.kcommaaccent = 500; + t.minus = 584; + t.Icircumflex = 278; + t.ncaron = 556; + t.tcommaaccent = 278; + t.logicalnot = 584; + t.odieresis = 556; + t.udieresis = 556; + t.notequal = 549; + t.gcommaaccent = 556; + t.eth = 556; + t.zcaron = 500; + t.ncommaaccent = 556; + t.onesuperior = 333; + t.imacron = 278; + t.Euro = 556; + }); + t.Symbol = getLookupTableFactory(function (t) { + t.space = 250; + t.exclam = 333; + t.universal = 713; + t.numbersign = 500; + t.existential = 549; + t.percent = 833; + t.ampersand = 778; + t.suchthat = 439; + t.parenleft = 333; + t.parenright = 333; + t.asteriskmath = 500; + t.plus = 549; + t.comma = 250; + t.minus = 549; + t.period = 250; + t.slash = 278; + t.zero = 500; + t.one = 500; + t.two = 500; + t.three = 500; + t.four = 500; + t.five = 500; + t.six = 500; + t.seven = 500; + t.eight = 500; + t.nine = 500; + t.colon = 278; + t.semicolon = 278; + t.less = 549; + t.equal = 549; + t.greater = 549; + t.question = 444; + t.congruent = 549; + t.Alpha = 722; + t.Beta = 667; + t.Chi = 722; + t.Delta = 612; + t.Epsilon = 611; + t.Phi = 763; + t.Gamma = 603; + t.Eta = 722; + t.Iota = 333; + t.theta1 = 631; + t.Kappa = 722; + t.Lambda = 686; + t.Mu = 889; + t.Nu = 722; + t.Omicron = 722; + t.Pi = 768; + t.Theta = 741; + t.Rho = 556; + t.Sigma = 592; + t.Tau = 611; + t.Upsilon = 690; + t.sigma1 = 439; + t.Omega = 768; + t.Xi = 645; + t.Psi = 795; + t.Zeta = 611; + t.bracketleft = 333; + t.therefore = 863; + t.bracketright = 333; + t.perpendicular = 658; + t.underscore = 500; + t.radicalex = 500; + t.alpha = 631; + t.beta = 549; + t.chi = 549; + t.delta = 494; + t.epsilon = 439; + t.phi = 521; + t.gamma = 411; + t.eta = 603; + t.iota = 329; + t.phi1 = 603; + t.kappa = 549; + t.lambda = 549; + t.mu = 576; + t.nu = 521; + t.omicron = 549; + t.pi = 549; + t.theta = 521; + t.rho = 549; + t.sigma = 603; + t.tau = 439; + t.upsilon = 576; + t.omega1 = 713; + t.omega = 686; + t.xi = 493; + t.psi = 686; + t.zeta = 494; + t.braceleft = 480; + t.bar = 200; + t.braceright = 480; + t.similar = 549; + t.Euro = 750; + t.Upsilon1 = 620; + t.minute = 247; + t.lessequal = 549; + t.fraction = 167; + t.infinity = 713; + t.florin = 500; + t.club = 753; + t.diamond = 753; + t.heart = 753; + t.spade = 753; + t.arrowboth = 1042; + t.arrowleft = 987; + t.arrowup = 603; + t.arrowright = 987; + t.arrowdown = 603; + t.degree = 400; + t.plusminus = 549; + t.second = 411; + t.greaterequal = 549; + t.multiply = 549; + t.proportional = 713; + t.partialdiff = 494; + t.bullet = 460; + t.divide = 549; + t.notequal = 549; + t.equivalence = 549; + t.approxequal = 549; + t.ellipsis = 1000; + t.arrowvertex = 603; + t.arrowhorizex = 1000; + t.carriagereturn = 658; + t.aleph = 823; + t.Ifraktur = 686; + t.Rfraktur = 795; + t.weierstrass = 987; + t.circlemultiply = 768; + t.circleplus = 768; + t.emptyset = 823; + t.intersection = 768; + t.union = 768; + t.propersuperset = 713; + t.reflexsuperset = 713; + t.notsubset = 713; + t.propersubset = 713; + t.reflexsubset = 713; + t.element = 713; + t.notelement = 713; + t.angle = 768; + t.gradient = 713; + t.registerserif = 790; + t.copyrightserif = 790; + t.trademarkserif = 890; + t.product = 823; + t.radical = 549; + t.dotmath = 250; + t.logicalnot = 713; + t.logicaland = 603; + t.logicalor = 603; + t.arrowdblboth = 1042; + t.arrowdblleft = 987; + t.arrowdblup = 603; + t.arrowdblright = 987; + t.arrowdbldown = 603; + t.lozenge = 494; + t.angleleft = 329; + t.registersans = 790; + t.copyrightsans = 790; + t.trademarksans = 786; + t.summation = 713; + t.parenlefttp = 384; + t.parenleftex = 384; + t.parenleftbt = 384; + t.bracketlefttp = 384; + t.bracketleftex = 384; + t.bracketleftbt = 384; + t.bracelefttp = 494; + t.braceleftmid = 494; + t.braceleftbt = 494; + t.braceex = 494; + t.angleright = 329; + t.integral = 274; + t.integraltp = 686; + t.integralex = 686; + t.integralbt = 686; + t.parenrighttp = 384; + t.parenrightex = 384; + t.parenrightbt = 384; + t.bracketrighttp = 384; + t.bracketrightex = 384; + t.bracketrightbt = 384; + t.bracerighttp = 494; + t.bracerightmid = 494; + t.bracerightbt = 494; + t.apple = 790; + }); + t["Times-Roman"] = getLookupTableFactory(function (t) { + t.space = 250; + t.exclam = 333; + t.quotedbl = 408; + t.numbersign = 500; + t.dollar = 500; + t.percent = 833; + t.ampersand = 778; + t.quoteright = 333; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 500; + t.plus = 564; + t.comma = 250; + t.hyphen = 333; + t.period = 250; + t.slash = 278; + t.zero = 500; + t.one = 500; + t.two = 500; + t.three = 500; + t.four = 500; + t.five = 500; + t.six = 500; + t.seven = 500; + t.eight = 500; + t.nine = 500; + t.colon = 278; + t.semicolon = 278; + t.less = 564; + t.equal = 564; + t.greater = 564; + t.question = 444; + t.at = 921; + t.A = 722; + t.B = 667; + t.C = 667; + t.D = 722; + t.E = 611; + t.F = 556; + t.G = 722; + t.H = 722; + t.I = 333; + t.J = 389; + t.K = 722; + t.L = 611; + t.M = 889; + t.N = 722; + t.O = 722; + t.P = 556; + t.Q = 722; + t.R = 667; + t.S = 556; + t.T = 611; + t.U = 722; + t.V = 722; + t.W = 944; + t.X = 722; + t.Y = 722; + t.Z = 611; + t.bracketleft = 333; + t.backslash = 278; + t.bracketright = 333; + t.asciicircum = 469; + t.underscore = 500; + t.quoteleft = 333; + t.a = 444; + t.b = 500; + t.c = 444; + t.d = 500; + t.e = 444; + t.f = 333; + t.g = 500; + t.h = 500; + t.i = 278; + t.j = 278; + t.k = 500; + t.l = 278; + t.m = 778; + t.n = 500; + t.o = 500; + t.p = 500; + t.q = 500; + t.r = 333; + t.s = 389; + t.t = 278; + t.u = 500; + t.v = 500; + t.w = 722; + t.x = 500; + t.y = 500; + t.z = 444; + t.braceleft = 480; + t.bar = 200; + t.braceright = 480; + t.asciitilde = 541; + t.exclamdown = 333; + t.cent = 500; + t.sterling = 500; + t.fraction = 167; + t.yen = 500; + t.florin = 500; + t.section = 500; + t.currency = 500; + t.quotesingle = 180; + t.quotedblleft = 444; + t.guillemotleft = 500; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 556; + t.fl = 556; + t.endash = 500; + t.dagger = 500; + t.daggerdbl = 500; + t.periodcentered = 250; + t.paragraph = 453; + t.bullet = 350; + t.quotesinglbase = 333; + t.quotedblbase = 444; + t.quotedblright = 444; + t.guillemotright = 500; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 444; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 889; + t.ordfeminine = 276; + t.Lslash = 611; + t.Oslash = 722; + t.OE = 889; + t.ordmasculine = 310; + t.ae = 667; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 500; + t.oe = 722; + t.germandbls = 500; + t.Idieresis = 333; + t.eacute = 444; + t.abreve = 444; + t.uhungarumlaut = 500; + t.ecaron = 444; + t.Ydieresis = 722; + t.divide = 564; + t.Yacute = 722; + t.Acircumflex = 722; + t.aacute = 444; + t.Ucircumflex = 722; + t.yacute = 500; + t.scommaaccent = 389; + t.ecircumflex = 444; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 444; + t.Uacute = 722; + t.uogonek = 500; + t.Edieresis = 611; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 760; + t.Emacron = 611; + t.ccaron = 444; + t.aring = 444; + t.Ncommaaccent = 722; + t.lacute = 278; + t.agrave = 444; + t.Tcommaaccent = 611; + t.Cacute = 667; + t.atilde = 444; + t.Edotaccent = 611; + t.scaron = 389; + t.scedilla = 389; + t.iacute = 278; + t.lozenge = 471; + t.Rcaron = 667; + t.Gcommaaccent = 722; + t.ucircumflex = 500; + t.acircumflex = 444; + t.Amacron = 722; + t.rcaron = 333; + t.ccedilla = 444; + t.Zdotaccent = 611; + t.Thorn = 556; + t.Omacron = 722; + t.Racute = 667; + t.Sacute = 556; + t.dcaron = 588; + t.Umacron = 722; + t.uring = 500; + t.threesuperior = 300; + t.Ograve = 722; + t.Agrave = 722; + t.Abreve = 722; + t.multiply = 564; + t.uacute = 500; + t.Tcaron = 611; + t.partialdiff = 476; + t.ydieresis = 500; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 611; + t.adieresis = 444; + t.edieresis = 444; + t.cacute = 444; + t.nacute = 500; + t.umacron = 500; + t.Ncaron = 722; + t.Iacute = 333; + t.plusminus = 564; + t.brokenbar = 200; + t.registered = 760; + t.Gbreve = 722; + t.Idotaccent = 333; + t.summation = 600; + t.Egrave = 611; + t.racute = 333; + t.omacron = 500; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 667; + t.lcommaaccent = 278; + t.tcaron = 326; + t.eogonek = 444; + t.Uogonek = 722; + t.Aacute = 722; + t.Adieresis = 722; + t.egrave = 444; + t.zacute = 444; + t.iogonek = 278; + t.Oacute = 722; + t.oacute = 500; + t.amacron = 444; + t.sacute = 389; + t.idieresis = 278; + t.Ocircumflex = 722; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 500; + t.twosuperior = 300; + t.Odieresis = 722; + t.mu = 500; + t.igrave = 278; + t.ohungarumlaut = 500; + t.Eogonek = 611; + t.dcroat = 500; + t.threequarters = 750; + t.Scedilla = 556; + t.lcaron = 344; + t.Kcommaaccent = 722; + t.Lacute = 611; + t.trademark = 980; + t.edotaccent = 444; + t.Igrave = 333; + t.Imacron = 333; + t.Lcaron = 611; + t.onehalf = 750; + t.lessequal = 549; + t.ocircumflex = 500; + t.ntilde = 500; + t.Uhungarumlaut = 722; + t.Eacute = 611; + t.emacron = 444; + t.gbreve = 500; + t.onequarter = 750; + t.Scaron = 556; + t.Scommaaccent = 556; + t.Ohungarumlaut = 722; + t.degree = 400; + t.ograve = 500; + t.Ccaron = 667; + t.ugrave = 500; + t.radical = 453; + t.Dcaron = 722; + t.rcommaaccent = 333; + t.Ntilde = 722; + t.otilde = 500; + t.Rcommaaccent = 667; + t.Lcommaaccent = 611; + t.Atilde = 722; + t.Aogonek = 722; + t.Aring = 722; + t.Otilde = 722; + t.zdotaccent = 444; + t.Ecaron = 611; + t.Iogonek = 333; + t.kcommaaccent = 500; + t.minus = 564; + t.Icircumflex = 333; + t.ncaron = 500; + t.tcommaaccent = 278; + t.logicalnot = 564; + t.odieresis = 500; + t.udieresis = 500; + t.notequal = 549; + t.gcommaaccent = 500; + t.eth = 500; + t.zcaron = 444; + t.ncommaaccent = 500; + t.onesuperior = 300; + t.imacron = 278; + t.Euro = 500; + }); + t["Times-Bold"] = getLookupTableFactory(function (t) { + t.space = 250; + t.exclam = 333; + t.quotedbl = 555; + t.numbersign = 500; + t.dollar = 500; + t.percent = 1000; + t.ampersand = 833; + t.quoteright = 333; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 500; + t.plus = 570; + t.comma = 250; + t.hyphen = 333; + t.period = 250; + t.slash = 278; + t.zero = 500; + t.one = 500; + t.two = 500; + t.three = 500; + t.four = 500; + t.five = 500; + t.six = 500; + t.seven = 500; + t.eight = 500; + t.nine = 500; + t.colon = 333; + t.semicolon = 333; + t.less = 570; + t.equal = 570; + t.greater = 570; + t.question = 500; + t.at = 930; + t.A = 722; + t.B = 667; + t.C = 722; + t.D = 722; + t.E = 667; + t.F = 611; + t.G = 778; + t.H = 778; + t.I = 389; + t.J = 500; + t.K = 778; + t.L = 667; + t.M = 944; + t.N = 722; + t.O = 778; + t.P = 611; + t.Q = 778; + t.R = 722; + t.S = 556; + t.T = 667; + t.U = 722; + t.V = 722; + t.W = 1000; + t.X = 722; + t.Y = 722; + t.Z = 667; + t.bracketleft = 333; + t.backslash = 278; + t.bracketright = 333; + t.asciicircum = 581; + t.underscore = 500; + t.quoteleft = 333; + t.a = 500; + t.b = 556; + t.c = 444; + t.d = 556; + t.e = 444; + t.f = 333; + t.g = 500; + t.h = 556; + t.i = 278; + t.j = 333; + t.k = 556; + t.l = 278; + t.m = 833; + t.n = 556; + t.o = 500; + t.p = 556; + t.q = 556; + t.r = 444; + t.s = 389; + t.t = 333; + t.u = 556; + t.v = 500; + t.w = 722; + t.x = 500; + t.y = 500; + t.z = 444; + t.braceleft = 394; + t.bar = 220; + t.braceright = 394; + t.asciitilde = 520; + t.exclamdown = 333; + t.cent = 500; + t.sterling = 500; + t.fraction = 167; + t.yen = 500; + t.florin = 500; + t.section = 500; + t.currency = 500; + t.quotesingle = 278; + t.quotedblleft = 500; + t.guillemotleft = 500; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 556; + t.fl = 556; + t.endash = 500; + t.dagger = 500; + t.daggerdbl = 500; + t.periodcentered = 250; + t.paragraph = 540; + t.bullet = 350; + t.quotesinglbase = 333; + t.quotedblbase = 500; + t.quotedblright = 500; + t.guillemotright = 500; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 500; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 1000; + t.ordfeminine = 300; + t.Lslash = 667; + t.Oslash = 778; + t.OE = 1000; + t.ordmasculine = 330; + t.ae = 722; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 500; + t.oe = 722; + t.germandbls = 556; + t.Idieresis = 389; + t.eacute = 444; + t.abreve = 500; + t.uhungarumlaut = 556; + t.ecaron = 444; + t.Ydieresis = 722; + t.divide = 570; + t.Yacute = 722; + t.Acircumflex = 722; + t.aacute = 500; + t.Ucircumflex = 722; + t.yacute = 500; + t.scommaaccent = 389; + t.ecircumflex = 444; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 500; + t.Uacute = 722; + t.uogonek = 556; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 747; + t.Emacron = 667; + t.ccaron = 444; + t.aring = 500; + t.Ncommaaccent = 722; + t.lacute = 278; + t.agrave = 500; + t.Tcommaaccent = 667; + t.Cacute = 722; + t.atilde = 500; + t.Edotaccent = 667; + t.scaron = 389; + t.scedilla = 389; + t.iacute = 278; + t.lozenge = 494; + t.Rcaron = 722; + t.Gcommaaccent = 778; + t.ucircumflex = 556; + t.acircumflex = 500; + t.Amacron = 722; + t.rcaron = 444; + t.ccedilla = 444; + t.Zdotaccent = 667; + t.Thorn = 611; + t.Omacron = 778; + t.Racute = 722; + t.Sacute = 556; + t.dcaron = 672; + t.Umacron = 722; + t.uring = 556; + t.threesuperior = 300; + t.Ograve = 778; + t.Agrave = 722; + t.Abreve = 722; + t.multiply = 570; + t.uacute = 556; + t.Tcaron = 667; + t.partialdiff = 494; + t.ydieresis = 500; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 500; + t.edieresis = 444; + t.cacute = 444; + t.nacute = 556; + t.umacron = 556; + t.Ncaron = 722; + t.Iacute = 389; + t.plusminus = 570; + t.brokenbar = 220; + t.registered = 747; + t.Gbreve = 778; + t.Idotaccent = 389; + t.summation = 600; + t.Egrave = 667; + t.racute = 444; + t.omacron = 500; + t.Zacute = 667; + t.Zcaron = 667; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 722; + t.lcommaaccent = 278; + t.tcaron = 416; + t.eogonek = 444; + t.Uogonek = 722; + t.Aacute = 722; + t.Adieresis = 722; + t.egrave = 444; + t.zacute = 444; + t.iogonek = 278; + t.Oacute = 778; + t.oacute = 500; + t.amacron = 500; + t.sacute = 389; + t.idieresis = 278; + t.Ocircumflex = 778; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 556; + t.twosuperior = 300; + t.Odieresis = 778; + t.mu = 556; + t.igrave = 278; + t.ohungarumlaut = 500; + t.Eogonek = 667; + t.dcroat = 556; + t.threequarters = 750; + t.Scedilla = 556; + t.lcaron = 394; + t.Kcommaaccent = 778; + t.Lacute = 667; + t.trademark = 1000; + t.edotaccent = 444; + t.Igrave = 389; + t.Imacron = 389; + t.Lcaron = 667; + t.onehalf = 750; + t.lessequal = 549; + t.ocircumflex = 500; + t.ntilde = 556; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 444; + t.gbreve = 500; + t.onequarter = 750; + t.Scaron = 556; + t.Scommaaccent = 556; + t.Ohungarumlaut = 778; + t.degree = 400; + t.ograve = 500; + t.Ccaron = 722; + t.ugrave = 556; + t.radical = 549; + t.Dcaron = 722; + t.rcommaaccent = 444; + t.Ntilde = 722; + t.otilde = 500; + t.Rcommaaccent = 722; + t.Lcommaaccent = 667; + t.Atilde = 722; + t.Aogonek = 722; + t.Aring = 722; + t.Otilde = 778; + t.zdotaccent = 444; + t.Ecaron = 667; + t.Iogonek = 389; + t.kcommaaccent = 556; + t.minus = 570; + t.Icircumflex = 389; + t.ncaron = 556; + t.tcommaaccent = 333; + t.logicalnot = 570; + t.odieresis = 500; + t.udieresis = 556; + t.notequal = 549; + t.gcommaaccent = 500; + t.eth = 500; + t.zcaron = 444; + t.ncommaaccent = 556; + t.onesuperior = 300; + t.imacron = 278; + t.Euro = 500; + }); + t["Times-BoldItalic"] = getLookupTableFactory(function (t) { + t.space = 250; + t.exclam = 389; + t.quotedbl = 555; + t.numbersign = 500; + t.dollar = 500; + t.percent = 833; + t.ampersand = 778; + t.quoteright = 333; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 500; + t.plus = 570; + t.comma = 250; + t.hyphen = 333; + t.period = 250; + t.slash = 278; + t.zero = 500; + t.one = 500; + t.two = 500; + t.three = 500; + t.four = 500; + t.five = 500; + t.six = 500; + t.seven = 500; + t.eight = 500; + t.nine = 500; + t.colon = 333; + t.semicolon = 333; + t.less = 570; + t.equal = 570; + t.greater = 570; + t.question = 500; + t.at = 832; + t.A = 667; + t.B = 667; + t.C = 667; + t.D = 722; + t.E = 667; + t.F = 667; + t.G = 722; + t.H = 778; + t.I = 389; + t.J = 500; + t.K = 667; + t.L = 611; + t.M = 889; + t.N = 722; + t.O = 722; + t.P = 611; + t.Q = 722; + t.R = 667; + t.S = 556; + t.T = 611; + t.U = 722; + t.V = 667; + t.W = 889; + t.X = 667; + t.Y = 611; + t.Z = 611; + t.bracketleft = 333; + t.backslash = 278; + t.bracketright = 333; + t.asciicircum = 570; + t.underscore = 500; + t.quoteleft = 333; + t.a = 500; + t.b = 500; + t.c = 444; + t.d = 500; + t.e = 444; + t.f = 333; + t.g = 500; + t.h = 556; + t.i = 278; + t.j = 278; + t.k = 500; + t.l = 278; + t.m = 778; + t.n = 556; + t.o = 500; + t.p = 500; + t.q = 500; + t.r = 389; + t.s = 389; + t.t = 278; + t.u = 556; + t.v = 444; + t.w = 667; + t.x = 500; + t.y = 444; + t.z = 389; + t.braceleft = 348; + t.bar = 220; + t.braceright = 348; + t.asciitilde = 570; + t.exclamdown = 389; + t.cent = 500; + t.sterling = 500; + t.fraction = 167; + t.yen = 500; + t.florin = 500; + t.section = 500; + t.currency = 500; + t.quotesingle = 278; + t.quotedblleft = 500; + t.guillemotleft = 500; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 556; + t.fl = 556; + t.endash = 500; + t.dagger = 500; + t.daggerdbl = 500; + t.periodcentered = 250; + t.paragraph = 500; + t.bullet = 350; + t.quotesinglbase = 333; + t.quotedblbase = 500; + t.quotedblright = 500; + t.guillemotright = 500; + t.ellipsis = 1000; + t.perthousand = 1000; + t.questiondown = 500; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 1000; + t.AE = 944; + t.ordfeminine = 266; + t.Lslash = 611; + t.Oslash = 722; + t.OE = 944; + t.ordmasculine = 300; + t.ae = 722; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 500; + t.oe = 722; + t.germandbls = 500; + t.Idieresis = 389; + t.eacute = 444; + t.abreve = 500; + t.uhungarumlaut = 556; + t.ecaron = 444; + t.Ydieresis = 611; + t.divide = 570; + t.Yacute = 611; + t.Acircumflex = 667; + t.aacute = 500; + t.Ucircumflex = 722; + t.yacute = 444; + t.scommaaccent = 389; + t.ecircumflex = 444; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 500; + t.Uacute = 722; + t.uogonek = 556; + t.Edieresis = 667; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 747; + t.Emacron = 667; + t.ccaron = 444; + t.aring = 500; + t.Ncommaaccent = 722; + t.lacute = 278; + t.agrave = 500; + t.Tcommaaccent = 611; + t.Cacute = 667; + t.atilde = 500; + t.Edotaccent = 667; + t.scaron = 389; + t.scedilla = 389; + t.iacute = 278; + t.lozenge = 494; + t.Rcaron = 667; + t.Gcommaaccent = 722; + t.ucircumflex = 556; + t.acircumflex = 500; + t.Amacron = 667; + t.rcaron = 389; + t.ccedilla = 444; + t.Zdotaccent = 611; + t.Thorn = 611; + t.Omacron = 722; + t.Racute = 667; + t.Sacute = 556; + t.dcaron = 608; + t.Umacron = 722; + t.uring = 556; + t.threesuperior = 300; + t.Ograve = 722; + t.Agrave = 667; + t.Abreve = 667; + t.multiply = 570; + t.uacute = 556; + t.Tcaron = 611; + t.partialdiff = 494; + t.ydieresis = 444; + t.Nacute = 722; + t.icircumflex = 278; + t.Ecircumflex = 667; + t.adieresis = 500; + t.edieresis = 444; + t.cacute = 444; + t.nacute = 556; + t.umacron = 556; + t.Ncaron = 722; + t.Iacute = 389; + t.plusminus = 570; + t.brokenbar = 220; + t.registered = 747; + t.Gbreve = 722; + t.Idotaccent = 389; + t.summation = 600; + t.Egrave = 667; + t.racute = 389; + t.omacron = 500; + t.Zacute = 611; + t.Zcaron = 611; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 667; + t.lcommaaccent = 278; + t.tcaron = 366; + t.eogonek = 444; + t.Uogonek = 722; + t.Aacute = 667; + t.Adieresis = 667; + t.egrave = 444; + t.zacute = 389; + t.iogonek = 278; + t.Oacute = 722; + t.oacute = 500; + t.amacron = 500; + t.sacute = 389; + t.idieresis = 278; + t.Ocircumflex = 722; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 500; + t.twosuperior = 300; + t.Odieresis = 722; + t.mu = 576; + t.igrave = 278; + t.ohungarumlaut = 500; + t.Eogonek = 667; + t.dcroat = 500; + t.threequarters = 750; + t.Scedilla = 556; + t.lcaron = 382; + t.Kcommaaccent = 667; + t.Lacute = 611; + t.trademark = 1000; + t.edotaccent = 444; + t.Igrave = 389; + t.Imacron = 389; + t.Lcaron = 611; + t.onehalf = 750; + t.lessequal = 549; + t.ocircumflex = 500; + t.ntilde = 556; + t.Uhungarumlaut = 722; + t.Eacute = 667; + t.emacron = 444; + t.gbreve = 500; + t.onequarter = 750; + t.Scaron = 556; + t.Scommaaccent = 556; + t.Ohungarumlaut = 722; + t.degree = 400; + t.ograve = 500; + t.Ccaron = 667; + t.ugrave = 556; + t.radical = 549; + t.Dcaron = 722; + t.rcommaaccent = 389; + t.Ntilde = 722; + t.otilde = 500; + t.Rcommaaccent = 667; + t.Lcommaaccent = 611; + t.Atilde = 667; + t.Aogonek = 667; + t.Aring = 667; + t.Otilde = 722; + t.zdotaccent = 389; + t.Ecaron = 667; + t.Iogonek = 389; + t.kcommaaccent = 500; + t.minus = 606; + t.Icircumflex = 389; + t.ncaron = 556; + t.tcommaaccent = 278; + t.logicalnot = 606; + t.odieresis = 500; + t.udieresis = 556; + t.notequal = 549; + t.gcommaaccent = 500; + t.eth = 500; + t.zcaron = 389; + t.ncommaaccent = 556; + t.onesuperior = 300; + t.imacron = 278; + t.Euro = 500; + }); + t["Times-Italic"] = getLookupTableFactory(function (t) { + t.space = 250; + t.exclam = 333; + t.quotedbl = 420; + t.numbersign = 500; + t.dollar = 500; + t.percent = 833; + t.ampersand = 778; + t.quoteright = 333; + t.parenleft = 333; + t.parenright = 333; + t.asterisk = 500; + t.plus = 675; + t.comma = 250; + t.hyphen = 333; + t.period = 250; + t.slash = 278; + t.zero = 500; + t.one = 500; + t.two = 500; + t.three = 500; + t.four = 500; + t.five = 500; + t.six = 500; + t.seven = 500; + t.eight = 500; + t.nine = 500; + t.colon = 333; + t.semicolon = 333; + t.less = 675; + t.equal = 675; + t.greater = 675; + t.question = 500; + t.at = 920; + t.A = 611; + t.B = 611; + t.C = 667; + t.D = 722; + t.E = 611; + t.F = 611; + t.G = 722; + t.H = 722; + t.I = 333; + t.J = 444; + t.K = 667; + t.L = 556; + t.M = 833; + t.N = 667; + t.O = 722; + t.P = 611; + t.Q = 722; + t.R = 611; + t.S = 500; + t.T = 556; + t.U = 722; + t.V = 611; + t.W = 833; + t.X = 611; + t.Y = 556; + t.Z = 556; + t.bracketleft = 389; + t.backslash = 278; + t.bracketright = 389; + t.asciicircum = 422; + t.underscore = 500; + t.quoteleft = 333; + t.a = 500; + t.b = 500; + t.c = 444; + t.d = 500; + t.e = 444; + t.f = 278; + t.g = 500; + t.h = 500; + t.i = 278; + t.j = 278; + t.k = 444; + t.l = 278; + t.m = 722; + t.n = 500; + t.o = 500; + t.p = 500; + t.q = 500; + t.r = 389; + t.s = 389; + t.t = 278; + t.u = 500; + t.v = 444; + t.w = 667; + t.x = 444; + t.y = 444; + t.z = 389; + t.braceleft = 400; + t.bar = 275; + t.braceright = 400; + t.asciitilde = 541; + t.exclamdown = 389; + t.cent = 500; + t.sterling = 500; + t.fraction = 167; + t.yen = 500; + t.florin = 500; + t.section = 500; + t.currency = 500; + t.quotesingle = 214; + t.quotedblleft = 556; + t.guillemotleft = 500; + t.guilsinglleft = 333; + t.guilsinglright = 333; + t.fi = 500; + t.fl = 500; + t.endash = 500; + t.dagger = 500; + t.daggerdbl = 500; + t.periodcentered = 250; + t.paragraph = 523; + t.bullet = 350; + t.quotesinglbase = 333; + t.quotedblbase = 556; + t.quotedblright = 556; + t.guillemotright = 500; + t.ellipsis = 889; + t.perthousand = 1000; + t.questiondown = 500; + t.grave = 333; + t.acute = 333; + t.circumflex = 333; + t.tilde = 333; + t.macron = 333; + t.breve = 333; + t.dotaccent = 333; + t.dieresis = 333; + t.ring = 333; + t.cedilla = 333; + t.hungarumlaut = 333; + t.ogonek = 333; + t.caron = 333; + t.emdash = 889; + t.AE = 889; + t.ordfeminine = 276; + t.Lslash = 556; + t.Oslash = 722; + t.OE = 944; + t.ordmasculine = 310; + t.ae = 667; + t.dotlessi = 278; + t.lslash = 278; + t.oslash = 500; + t.oe = 667; + t.germandbls = 500; + t.Idieresis = 333; + t.eacute = 444; + t.abreve = 500; + t.uhungarumlaut = 500; + t.ecaron = 444; + t.Ydieresis = 556; + t.divide = 675; + t.Yacute = 556; + t.Acircumflex = 611; + t.aacute = 500; + t.Ucircumflex = 722; + t.yacute = 444; + t.scommaaccent = 389; + t.ecircumflex = 444; + t.Uring = 722; + t.Udieresis = 722; + t.aogonek = 500; + t.Uacute = 722; + t.uogonek = 500; + t.Edieresis = 611; + t.Dcroat = 722; + t.commaaccent = 250; + t.copyright = 760; + t.Emacron = 611; + t.ccaron = 444; + t.aring = 500; + t.Ncommaaccent = 667; + t.lacute = 278; + t.agrave = 500; + t.Tcommaaccent = 556; + t.Cacute = 667; + t.atilde = 500; + t.Edotaccent = 611; + t.scaron = 389; + t.scedilla = 389; + t.iacute = 278; + t.lozenge = 471; + t.Rcaron = 611; + t.Gcommaaccent = 722; + t.ucircumflex = 500; + t.acircumflex = 500; + t.Amacron = 611; + t.rcaron = 389; + t.ccedilla = 444; + t.Zdotaccent = 556; + t.Thorn = 611; + t.Omacron = 722; + t.Racute = 611; + t.Sacute = 500; + t.dcaron = 544; + t.Umacron = 722; + t.uring = 500; + t.threesuperior = 300; + t.Ograve = 722; + t.Agrave = 611; + t.Abreve = 611; + t.multiply = 675; + t.uacute = 500; + t.Tcaron = 556; + t.partialdiff = 476; + t.ydieresis = 444; + t.Nacute = 667; + t.icircumflex = 278; + t.Ecircumflex = 611; + t.adieresis = 500; + t.edieresis = 444; + t.cacute = 444; + t.nacute = 500; + t.umacron = 500; + t.Ncaron = 667; + t.Iacute = 333; + t.plusminus = 675; + t.brokenbar = 275; + t.registered = 760; + t.Gbreve = 722; + t.Idotaccent = 333; + t.summation = 600; + t.Egrave = 611; + t.racute = 389; + t.omacron = 500; + t.Zacute = 556; + t.Zcaron = 556; + t.greaterequal = 549; + t.Eth = 722; + t.Ccedilla = 667; + t.lcommaaccent = 278; + t.tcaron = 300; + t.eogonek = 444; + t.Uogonek = 722; + t.Aacute = 611; + t.Adieresis = 611; + t.egrave = 444; + t.zacute = 389; + t.iogonek = 278; + t.Oacute = 722; + t.oacute = 500; + t.amacron = 500; + t.sacute = 389; + t.idieresis = 278; + t.Ocircumflex = 722; + t.Ugrave = 722; + t.Delta = 612; + t.thorn = 500; + t.twosuperior = 300; + t.Odieresis = 722; + t.mu = 500; + t.igrave = 278; + t.ohungarumlaut = 500; + t.Eogonek = 611; + t.dcroat = 500; + t.threequarters = 750; + t.Scedilla = 500; + t.lcaron = 300; + t.Kcommaaccent = 667; + t.Lacute = 556; + t.trademark = 980; + t.edotaccent = 444; + t.Igrave = 333; + t.Imacron = 333; + t.Lcaron = 611; + t.onehalf = 750; + t.lessequal = 549; + t.ocircumflex = 500; + t.ntilde = 500; + t.Uhungarumlaut = 722; + t.Eacute = 611; + t.emacron = 444; + t.gbreve = 500; + t.onequarter = 750; + t.Scaron = 500; + t.Scommaaccent = 500; + t.Ohungarumlaut = 722; + t.degree = 400; + t.ograve = 500; + t.Ccaron = 667; + t.ugrave = 500; + t.radical = 453; + t.Dcaron = 722; + t.rcommaaccent = 389; + t.Ntilde = 667; + t.otilde = 500; + t.Rcommaaccent = 611; + t.Lcommaaccent = 556; + t.Atilde = 611; + t.Aogonek = 611; + t.Aring = 611; + t.Otilde = 722; + t.zdotaccent = 389; + t.Ecaron = 611; + t.Iogonek = 333; + t.kcommaaccent = 444; + t.minus = 675; + t.Icircumflex = 333; + t.ncaron = 500; + t.tcommaaccent = 278; + t.logicalnot = 675; + t.odieresis = 500; + t.udieresis = 500; + t.notequal = 549; + t.gcommaaccent = 500; + t.eth = 500; + t.zcaron = 389; + t.ncommaaccent = 500; + t.onesuperior = 300; + t.imacron = 278; + t.Euro = 500; + }); + t.ZapfDingbats = getLookupTableFactory(function (t) { + t.space = 278; + t.a1 = 974; + t.a2 = 961; + t.a202 = 974; + t.a3 = 980; + t.a4 = 719; + t.a5 = 789; + t.a119 = 790; + t.a118 = 791; + t.a117 = 690; + t.a11 = 960; + t.a12 = 939; + t.a13 = 549; + t.a14 = 855; + t.a15 = 911; + t.a16 = 933; + t.a105 = 911; + t.a17 = 945; + t.a18 = 974; + t.a19 = 755; + t.a20 = 846; + t.a21 = 762; + t.a22 = 761; + t.a23 = 571; + t.a24 = 677; + t.a25 = 763; + t.a26 = 760; + t.a27 = 759; + t.a28 = 754; + t.a6 = 494; + t.a7 = 552; + t.a8 = 537; + t.a9 = 577; + t.a10 = 692; + t.a29 = 786; + t.a30 = 788; + t.a31 = 788; + t.a32 = 790; + t.a33 = 793; + t.a34 = 794; + t.a35 = 816; + t.a36 = 823; + t.a37 = 789; + t.a38 = 841; + t.a39 = 823; + t.a40 = 833; + t.a41 = 816; + t.a42 = 831; + t.a43 = 923; + t.a44 = 744; + t.a45 = 723; + t.a46 = 749; + t.a47 = 790; + t.a48 = 792; + t.a49 = 695; + t.a50 = 776; + t.a51 = 768; + t.a52 = 792; + t.a53 = 759; + t.a54 = 707; + t.a55 = 708; + t.a56 = 682; + t.a57 = 701; + t.a58 = 826; + t.a59 = 815; + t.a60 = 789; + t.a61 = 789; + t.a62 = 707; + t.a63 = 687; + t.a64 = 696; + t.a65 = 689; + t.a66 = 786; + t.a67 = 787; + t.a68 = 713; + t.a69 = 791; + t.a70 = 785; + t.a71 = 791; + t.a72 = 873; + t.a73 = 761; + t.a74 = 762; + t.a203 = 762; + t.a75 = 759; + t.a204 = 759; + t.a76 = 892; + t.a77 = 892; + t.a78 = 788; + t.a79 = 784; + t.a81 = 438; + t.a82 = 138; + t.a83 = 277; + t.a84 = 415; + t.a97 = 392; + t.a98 = 392; + t.a99 = 668; + t.a100 = 668; + t.a89 = 390; + t.a90 = 390; + t.a93 = 317; + t.a94 = 317; + t.a91 = 276; + t.a92 = 276; + t.a205 = 509; + t.a85 = 509; + t.a206 = 410; + t.a86 = 410; + t.a87 = 234; + t.a88 = 234; + t.a95 = 334; + t.a96 = 334; + t.a101 = 732; + t.a102 = 544; + t.a103 = 544; + t.a104 = 910; + t.a106 = 667; + t.a107 = 760; + t.a108 = 760; + t.a112 = 776; + t.a111 = 595; + t.a110 = 694; + t.a109 = 626; + t.a120 = 788; + t.a121 = 788; + t.a122 = 788; + t.a123 = 788; + t.a124 = 788; + t.a125 = 788; + t.a126 = 788; + t.a127 = 788; + t.a128 = 788; + t.a129 = 788; + t.a130 = 788; + t.a131 = 788; + t.a132 = 788; + t.a133 = 788; + t.a134 = 788; + t.a135 = 788; + t.a136 = 788; + t.a137 = 788; + t.a138 = 788; + t.a139 = 788; + t.a140 = 788; + t.a141 = 788; + t.a142 = 788; + t.a143 = 788; + t.a144 = 788; + t.a145 = 788; + t.a146 = 788; + t.a147 = 788; + t.a148 = 788; + t.a149 = 788; + t.a150 = 788; + t.a151 = 788; + t.a152 = 788; + t.a153 = 788; + t.a154 = 788; + t.a155 = 788; + t.a156 = 788; + t.a157 = 788; + t.a158 = 788; + t.a159 = 788; + t.a160 = 894; + t.a161 = 838; + t.a163 = 1016; + t.a164 = 458; + t.a196 = 748; + t.a165 = 924; + t.a192 = 748; + t.a166 = 918; + t.a167 = 927; + t.a168 = 928; + t.a169 = 928; + t.a170 = 834; + t.a171 = 873; + t.a172 = 828; + t.a173 = 924; + t.a162 = 924; + t.a174 = 917; + t.a175 = 930; + t.a176 = 931; + t.a177 = 463; + t.a178 = 883; + t.a179 = 836; + t.a193 = 836; + t.a180 = 867; + t.a199 = 867; + t.a181 = 696; + t.a200 = 696; + t.a182 = 874; + t.a201 = 874; + t.a183 = 760; + t.a184 = 946; + t.a197 = 771; + t.a185 = 865; + t.a194 = 771; + t.a198 = 888; + t.a186 = 967; + t.a195 = 888; + t.a187 = 831; + t.a188 = 873; + t.a189 = 927; + t.a190 = 970; + t.a191 = 918; + }); +}); +const getFontBasicMetrics = getLookupTableFactory(function (t) { + t.Courier = { + ascent: 629, + descent: -157, + capHeight: 562, + xHeight: -426 + }; + t["Courier-Bold"] = { + ascent: 629, + descent: -157, + capHeight: 562, + xHeight: 439 + }; + t["Courier-Oblique"] = { + ascent: 629, + descent: -157, + capHeight: 562, + xHeight: 426 + }; + t["Courier-BoldOblique"] = { + ascent: 629, + descent: -157, + capHeight: 562, + xHeight: 426 + }; + t.Helvetica = { + ascent: 718, + descent: -207, + capHeight: 718, + xHeight: 523 + }; + t["Helvetica-Bold"] = { + ascent: 718, + descent: -207, + capHeight: 718, + xHeight: 532 + }; + t["Helvetica-Oblique"] = { + ascent: 718, + descent: -207, + capHeight: 718, + xHeight: 523 + }; + t["Helvetica-BoldOblique"] = { + ascent: 718, + descent: -207, + capHeight: 718, + xHeight: 532 + }; + t["Times-Roman"] = { + ascent: 683, + descent: -217, + capHeight: 662, + xHeight: 450 + }; + t["Times-Bold"] = { + ascent: 683, + descent: -217, + capHeight: 676, + xHeight: 461 + }; + t["Times-Italic"] = { + ascent: 683, + descent: -217, + capHeight: 653, + xHeight: 441 + }; + t["Times-BoldItalic"] = { + ascent: 683, + descent: -217, + capHeight: 669, + xHeight: 462 + }; + t.Symbol = { + ascent: Math.NaN, + descent: Math.NaN, + capHeight: Math.NaN, + xHeight: Math.NaN + }; + t.ZapfDingbats = { + ascent: Math.NaN, + descent: Math.NaN, + capHeight: Math.NaN, + xHeight: Math.NaN + }; +}); + +;// CONCATENATED MODULE: ./src/core/glyf.js +const ON_CURVE_POINT = 1 << 0; +const X_SHORT_VECTOR = 1 << 1; +const Y_SHORT_VECTOR = 1 << 2; +const REPEAT_FLAG = 1 << 3; +const X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR = 1 << 4; +const Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR = 1 << 5; +const OVERLAP_SIMPLE = 1 << 6; +const ARG_1_AND_2_ARE_WORDS = 1 << 0; +const ARGS_ARE_XY_VALUES = 1 << 1; +const WE_HAVE_A_SCALE = 1 << 3; +const MORE_COMPONENTS = 1 << 5; +const WE_HAVE_AN_X_AND_Y_SCALE = 1 << 6; +const WE_HAVE_A_TWO_BY_TWO = 1 << 7; +const WE_HAVE_INSTRUCTIONS = 1 << 8; +class GlyfTable { + constructor({ + glyfTable, + isGlyphLocationsLong, + locaTable, + numGlyphs + }) { + this.glyphs = []; + const loca = new DataView(locaTable.buffer, locaTable.byteOffset, locaTable.byteLength); + const glyf = new DataView(glyfTable.buffer, glyfTable.byteOffset, glyfTable.byteLength); + const offsetSize = isGlyphLocationsLong ? 4 : 2; + let prev = isGlyphLocationsLong ? loca.getUint32(0) : 2 * loca.getUint16(0); + let pos = 0; + for (let i = 0; i < numGlyphs; i++) { + pos += offsetSize; + const next = isGlyphLocationsLong ? loca.getUint32(pos) : 2 * loca.getUint16(pos); + if (next === prev) { + this.glyphs.push(new Glyph({})); + continue; + } + const glyph = Glyph.parse(prev, glyf); + this.glyphs.push(glyph); + prev = next; + } + } + getSize() { + return this.glyphs.reduce((a, g) => { + const size = g.getSize(); + return a + (size + 3 & ~3); + }, 0); + } + write() { + const totalSize = this.getSize(); + const glyfTable = new DataView(new ArrayBuffer(totalSize)); + const isLocationLong = totalSize > 0x1fffe; + const offsetSize = isLocationLong ? 4 : 2; + const locaTable = new DataView(new ArrayBuffer((this.glyphs.length + 1) * offsetSize)); + if (isLocationLong) { + locaTable.setUint32(0, 0); + } else { + locaTable.setUint16(0, 0); + } + let pos = 0; + let locaIndex = 0; + for (const glyph of this.glyphs) { + pos += glyph.write(pos, glyfTable); + pos = pos + 3 & ~3; + locaIndex += offsetSize; + if (isLocationLong) { + locaTable.setUint32(locaIndex, pos); + } else { + locaTable.setUint16(locaIndex, pos >> 1); + } + } + return { + isLocationLong, + loca: new Uint8Array(locaTable.buffer), + glyf: new Uint8Array(glyfTable.buffer) + }; + } + scale(factors) { + for (let i = 0, ii = this.glyphs.length; i < ii; i++) { + this.glyphs[i].scale(factors[i]); + } + } +} +class Glyph { + constructor({ + header = null, + simple = null, + composites = null + }) { + this.header = header; + this.simple = simple; + this.composites = composites; + } + static parse(pos, glyf) { + const [read, header] = GlyphHeader.parse(pos, glyf); + pos += read; + if (header.numberOfContours < 0) { + const composites = []; + while (true) { + const [n, composite] = CompositeGlyph.parse(pos, glyf); + pos += n; + composites.push(composite); + if (!(composite.flags & MORE_COMPONENTS)) { + break; + } + } + return new Glyph({ + header, + composites + }); + } + const simple = SimpleGlyph.parse(pos, glyf, header.numberOfContours); + return new Glyph({ + header, + simple + }); + } + getSize() { + if (!this.header) { + return 0; + } + const size = this.simple ? this.simple.getSize() : this.composites.reduce((a, c) => a + c.getSize(), 0); + return this.header.getSize() + size; + } + write(pos, buf) { + if (!this.header) { + return 0; + } + const spos = pos; + pos += this.header.write(pos, buf); + if (this.simple) { + pos += this.simple.write(pos, buf); + } else { + for (const composite of this.composites) { + pos += composite.write(pos, buf); + } + } + return pos - spos; + } + scale(factor) { + if (!this.header) { + return; + } + const xMiddle = (this.header.xMin + this.header.xMax) / 2; + this.header.scale(xMiddle, factor); + if (this.simple) { + this.simple.scale(xMiddle, factor); + } else { + for (const composite of this.composites) { + composite.scale(xMiddle, factor); + } + } + } +} +class GlyphHeader { + constructor({ + numberOfContours, + xMin, + yMin, + xMax, + yMax + }) { + this.numberOfContours = numberOfContours; + this.xMin = xMin; + this.yMin = yMin; + this.xMax = xMax; + this.yMax = yMax; + } + static parse(pos, glyf) { + return [10, new GlyphHeader({ + numberOfContours: glyf.getInt16(pos), + xMin: glyf.getInt16(pos + 2), + yMin: glyf.getInt16(pos + 4), + xMax: glyf.getInt16(pos + 6), + yMax: glyf.getInt16(pos + 8) + })]; + } + getSize() { + return 10; + } + write(pos, buf) { + buf.setInt16(pos, this.numberOfContours); + buf.setInt16(pos + 2, this.xMin); + buf.setInt16(pos + 4, this.yMin); + buf.setInt16(pos + 6, this.xMax); + buf.setInt16(pos + 8, this.yMax); + return 10; + } + scale(x, factor) { + this.xMin = Math.round(x + (this.xMin - x) * factor); + this.xMax = Math.round(x + (this.xMax - x) * factor); + } +} +class Contour { + constructor({ + flags, + xCoordinates, + yCoordinates + }) { + this.xCoordinates = xCoordinates; + this.yCoordinates = yCoordinates; + this.flags = flags; + } +} +class SimpleGlyph { + constructor({ + contours, + instructions + }) { + this.contours = contours; + this.instructions = instructions; + } + static parse(pos, glyf, numberOfContours) { + const endPtsOfContours = []; + for (let i = 0; i < numberOfContours; i++) { + const endPt = glyf.getUint16(pos); + pos += 2; + endPtsOfContours.push(endPt); + } + const numberOfPt = endPtsOfContours[numberOfContours - 1] + 1; + const instructionLength = glyf.getUint16(pos); + pos += 2; + const instructions = new Uint8Array(glyf).slice(pos, pos + instructionLength); + pos += instructionLength; + const flags = []; + for (let i = 0; i < numberOfPt; pos++, i++) { + let flag = glyf.getUint8(pos); + flags.push(flag); + if (flag & REPEAT_FLAG) { + const count = glyf.getUint8(++pos); + flag ^= REPEAT_FLAG; + for (let m = 0; m < count; m++) { + flags.push(flag); + } + i += count; + } + } + const allXCoordinates = []; + let xCoordinates = []; + let yCoordinates = []; + let pointFlags = []; + const contours = []; + let endPtsOfContoursIndex = 0; + let lastCoordinate = 0; + for (let i = 0; i < numberOfPt; i++) { + const flag = flags[i]; + if (flag & X_SHORT_VECTOR) { + const x = glyf.getUint8(pos++); + lastCoordinate += flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR ? x : -x; + xCoordinates.push(lastCoordinate); + } else if (flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR) { + xCoordinates.push(lastCoordinate); + } else { + lastCoordinate += glyf.getInt16(pos); + pos += 2; + xCoordinates.push(lastCoordinate); + } + if (endPtsOfContours[endPtsOfContoursIndex] === i) { + endPtsOfContoursIndex++; + allXCoordinates.push(xCoordinates); + xCoordinates = []; + } + } + lastCoordinate = 0; + endPtsOfContoursIndex = 0; + for (let i = 0; i < numberOfPt; i++) { + const flag = flags[i]; + if (flag & Y_SHORT_VECTOR) { + const y = glyf.getUint8(pos++); + lastCoordinate += flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR ? y : -y; + yCoordinates.push(lastCoordinate); + } else if (flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR) { + yCoordinates.push(lastCoordinate); + } else { + lastCoordinate += glyf.getInt16(pos); + pos += 2; + yCoordinates.push(lastCoordinate); + } + pointFlags.push(flag & ON_CURVE_POINT | flag & OVERLAP_SIMPLE); + if (endPtsOfContours[endPtsOfContoursIndex] === i) { + xCoordinates = allXCoordinates[endPtsOfContoursIndex]; + endPtsOfContoursIndex++; + contours.push(new Contour({ + flags: pointFlags, + xCoordinates, + yCoordinates + })); + yCoordinates = []; + pointFlags = []; + } + } + return new SimpleGlyph({ + contours, + instructions + }); + } + getSize() { + let size = this.contours.length * 2 + 2 + this.instructions.length; + let lastX = 0; + let lastY = 0; + for (const contour of this.contours) { + size += contour.flags.length; + for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) { + const x = contour.xCoordinates[i]; + const y = contour.yCoordinates[i]; + let abs = Math.abs(x - lastX); + if (abs > 255) { + size += 2; + } else if (abs > 0) { + size += 1; + } + lastX = x; + abs = Math.abs(y - lastY); + if (abs > 255) { + size += 2; + } else if (abs > 0) { + size += 1; + } + lastY = y; + } + } + return size; + } + write(pos, buf) { + const spos = pos; + const xCoordinates = []; + const yCoordinates = []; + const flags = []; + let lastX = 0; + let lastY = 0; + for (const contour of this.contours) { + for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) { + let flag = contour.flags[i]; + const x = contour.xCoordinates[i]; + let delta = x - lastX; + if (delta === 0) { + flag |= X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR; + xCoordinates.push(0); + } else { + const abs = Math.abs(delta); + if (abs <= 255) { + flag |= delta >= 0 ? X_SHORT_VECTOR | X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR : X_SHORT_VECTOR; + xCoordinates.push(abs); + } else { + xCoordinates.push(delta); + } + } + lastX = x; + const y = contour.yCoordinates[i]; + delta = y - lastY; + if (delta === 0) { + flag |= Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR; + yCoordinates.push(0); + } else { + const abs = Math.abs(delta); + if (abs <= 255) { + flag |= delta >= 0 ? Y_SHORT_VECTOR | Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR : Y_SHORT_VECTOR; + yCoordinates.push(abs); + } else { + yCoordinates.push(delta); + } + } + lastY = y; + flags.push(flag); + } + buf.setUint16(pos, xCoordinates.length - 1); + pos += 2; + } + buf.setUint16(pos, this.instructions.length); + pos += 2; + if (this.instructions.length) { + new Uint8Array(buf.buffer, 0, buf.buffer.byteLength).set(this.instructions, pos); + pos += this.instructions.length; + } + for (const flag of flags) { + buf.setUint8(pos++, flag); + } + for (let i = 0, ii = xCoordinates.length; i < ii; i++) { + const x = xCoordinates[i]; + const flag = flags[i]; + if (flag & X_SHORT_VECTOR) { + buf.setUint8(pos++, x); + } else if (!(flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR)) { + buf.setInt16(pos, x); + pos += 2; + } + } + for (let i = 0, ii = yCoordinates.length; i < ii; i++) { + const y = yCoordinates[i]; + const flag = flags[i]; + if (flag & Y_SHORT_VECTOR) { + buf.setUint8(pos++, y); + } else if (!(flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR)) { + buf.setInt16(pos, y); + pos += 2; + } + } + return pos - spos; + } + scale(x, factor) { + for (const contour of this.contours) { + if (contour.xCoordinates.length === 0) { + continue; + } + for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) { + contour.xCoordinates[i] = Math.round(x + (contour.xCoordinates[i] - x) * factor); + } + } + } +} +class CompositeGlyph { + constructor({ + flags, + glyphIndex, + argument1, + argument2, + transf, + instructions + }) { + this.flags = flags; + this.glyphIndex = glyphIndex; + this.argument1 = argument1; + this.argument2 = argument2; + this.transf = transf; + this.instructions = instructions; + } + static parse(pos, glyf) { + const spos = pos; + const transf = []; + let flags = glyf.getUint16(pos); + const glyphIndex = glyf.getUint16(pos + 2); + pos += 4; + let argument1, argument2; + if (flags & ARG_1_AND_2_ARE_WORDS) { + if (flags & ARGS_ARE_XY_VALUES) { + argument1 = glyf.getInt16(pos); + argument2 = glyf.getInt16(pos + 2); + } else { + argument1 = glyf.getUint16(pos); + argument2 = glyf.getUint16(pos + 2); + } + pos += 4; + flags ^= ARG_1_AND_2_ARE_WORDS; + } else { + if (flags & ARGS_ARE_XY_VALUES) { + argument1 = glyf.getInt8(pos); + argument2 = glyf.getInt8(pos + 1); + } else { + argument1 = glyf.getUint8(pos); + argument2 = glyf.getUint8(pos + 1); + } + pos += 2; + } + if (flags & WE_HAVE_A_SCALE) { + transf.push(glyf.getUint16(pos)); + pos += 2; + } else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) { + transf.push(glyf.getUint16(pos), glyf.getUint16(pos + 2)); + pos += 4; + } else if (flags & WE_HAVE_A_TWO_BY_TWO) { + transf.push(glyf.getUint16(pos), glyf.getUint16(pos + 2), glyf.getUint16(pos + 4), glyf.getUint16(pos + 6)); + pos += 8; + } + let instructions = null; + if (flags & WE_HAVE_INSTRUCTIONS) { + const instructionLength = glyf.getUint16(pos); + pos += 2; + instructions = new Uint8Array(glyf).slice(pos, pos + instructionLength); + pos += instructionLength; + } + return [pos - spos, new CompositeGlyph({ + flags, + glyphIndex, + argument1, + argument2, + transf, + instructions + })]; + } + getSize() { + let size = 2 + 2 + this.transf.length * 2; + if (this.flags & WE_HAVE_INSTRUCTIONS) { + size += 2 + this.instructions.length; + } + size += 2; + if (this.flags & 2) { + if (!(this.argument1 >= -128 && this.argument1 <= 127 && this.argument2 >= -128 && this.argument2 <= 127)) { + size += 2; + } + } else if (!(this.argument1 >= 0 && this.argument1 <= 255 && this.argument2 >= 0 && this.argument2 <= 255)) { + size += 2; + } + return size; + } + write(pos, buf) { + const spos = pos; + if (this.flags & ARGS_ARE_XY_VALUES) { + if (!(this.argument1 >= -128 && this.argument1 <= 127 && this.argument2 >= -128 && this.argument2 <= 127)) { + this.flags |= ARG_1_AND_2_ARE_WORDS; + } + } else if (!(this.argument1 >= 0 && this.argument1 <= 255 && this.argument2 >= 0 && this.argument2 <= 255)) { + this.flags |= ARG_1_AND_2_ARE_WORDS; + } + buf.setUint16(pos, this.flags); + buf.setUint16(pos + 2, this.glyphIndex); + pos += 4; + if (this.flags & ARG_1_AND_2_ARE_WORDS) { + if (this.flags & ARGS_ARE_XY_VALUES) { + buf.setInt16(pos, this.argument1); + buf.setInt16(pos + 2, this.argument2); + } else { + buf.setUint16(pos, this.argument1); + buf.setUint16(pos + 2, this.argument2); + } + pos += 4; + } else { + buf.setUint8(pos, this.argument1); + buf.setUint8(pos + 1, this.argument2); + pos += 2; + } + if (this.flags & WE_HAVE_INSTRUCTIONS) { + buf.setUint16(pos, this.instructions.length); + pos += 2; + if (this.instructions.length) { + new Uint8Array(buf.buffer, 0, buf.buffer.byteLength).set(this.instructions, pos); + pos += this.instructions.length; + } + } + return pos - spos; + } + scale(x, factor) {} +} + +;// CONCATENATED MODULE: ./src/core/opentype_file_builder.js + + +function writeInt16(dest, offset, num) { + dest[offset] = num >> 8 & 0xff; + dest[offset + 1] = num & 0xff; +} +function writeInt32(dest, offset, num) { + dest[offset] = num >> 24 & 0xff; + dest[offset + 1] = num >> 16 & 0xff; + dest[offset + 2] = num >> 8 & 0xff; + dest[offset + 3] = num & 0xff; +} +function writeData(dest, offset, data) { + if (data instanceof Uint8Array) { + dest.set(data, offset); + } else if (typeof data === "string") { + for (let i = 0, ii = data.length; i < ii; i++) { + dest[offset++] = data.charCodeAt(i) & 0xff; + } + } else { + for (const num of data) { + dest[offset++] = num & 0xff; + } + } +} +const OTF_HEADER_SIZE = 12; +const OTF_TABLE_ENTRY_SIZE = 16; +class OpenTypeFileBuilder { + constructor(sfnt) { + this.sfnt = sfnt; + this.tables = Object.create(null); + } + static getSearchParams(entriesCount, entrySize) { + let maxPower2 = 1, + log2 = 0; + while ((maxPower2 ^ entriesCount) > maxPower2) { + maxPower2 <<= 1; + log2++; + } + const searchRange = maxPower2 * entrySize; + return { + range: searchRange, + entry: log2, + rangeShift: entrySize * entriesCount - searchRange + }; + } + toArray() { + let sfnt = this.sfnt; + const tables = this.tables; + const tablesNames = Object.keys(tables); + tablesNames.sort(); + const numTables = tablesNames.length; + let i, j, jj, table, tableName; + let offset = OTF_HEADER_SIZE + numTables * OTF_TABLE_ENTRY_SIZE; + const tableOffsets = [offset]; + for (i = 0; i < numTables; i++) { + table = tables[tablesNames[i]]; + const paddedLength = (table.length + 3 & ~3) >>> 0; + offset += paddedLength; + tableOffsets.push(offset); + } + const file = new Uint8Array(offset); + for (i = 0; i < numTables; i++) { + table = tables[tablesNames[i]]; + writeData(file, tableOffsets[i], table); + } + if (sfnt === "true") { + sfnt = string32(0x00010000); + } + file[0] = sfnt.charCodeAt(0) & 0xff; + file[1] = sfnt.charCodeAt(1) & 0xff; + file[2] = sfnt.charCodeAt(2) & 0xff; + file[3] = sfnt.charCodeAt(3) & 0xff; + writeInt16(file, 4, numTables); + const searchParams = OpenTypeFileBuilder.getSearchParams(numTables, 16); + writeInt16(file, 6, searchParams.range); + writeInt16(file, 8, searchParams.entry); + writeInt16(file, 10, searchParams.rangeShift); + offset = OTF_HEADER_SIZE; + for (i = 0; i < numTables; i++) { + tableName = tablesNames[i]; + file[offset] = tableName.charCodeAt(0) & 0xff; + file[offset + 1] = tableName.charCodeAt(1) & 0xff; + file[offset + 2] = tableName.charCodeAt(2) & 0xff; + file[offset + 3] = tableName.charCodeAt(3) & 0xff; + let checksum = 0; + for (j = tableOffsets[i], jj = tableOffsets[i + 1]; j < jj; j += 4) { + const quad = readUint32(file, j); + checksum = checksum + quad >>> 0; + } + writeInt32(file, offset + 4, checksum); + writeInt32(file, offset + 8, tableOffsets[i]); + writeInt32(file, offset + 12, tables[tableName].length); + offset += OTF_TABLE_ENTRY_SIZE; + } + return file; + } + addTable(tag, data) { + if (tag in this.tables) { + throw new Error("Table " + tag + " already exists"); + } + this.tables[tag] = data; + } +} + +;// CONCATENATED MODULE: ./src/core/type1_parser.js + + + + +const HINTING_ENABLED = false; +const COMMAND_MAP = { + hstem: [1], + vstem: [3], + vmoveto: [4], + rlineto: [5], + hlineto: [6], + vlineto: [7], + rrcurveto: [8], + callsubr: [10], + flex: [12, 35], + drop: [12, 18], + endchar: [14], + rmoveto: [21], + hmoveto: [22], + vhcurveto: [30], + hvcurveto: [31] +}; +class Type1CharString { + constructor() { + this.width = 0; + this.lsb = 0; + this.flexing = false; + this.output = []; + this.stack = []; + } + convert(encoded, subrs, seacAnalysisEnabled) { + const count = encoded.length; + let error = false; + let wx, sbx, subrNumber; + for (let i = 0; i < count; i++) { + let value = encoded[i]; + if (value < 32) { + if (value === 12) { + value = (value << 8) + encoded[++i]; + } + switch (value) { + case 1: + if (!HINTING_ENABLED) { + this.stack = []; + break; + } + error = this.executeCommand(2, COMMAND_MAP.hstem); + break; + case 3: + if (!HINTING_ENABLED) { + this.stack = []; + break; + } + error = this.executeCommand(2, COMMAND_MAP.vstem); + break; + case 4: + if (this.flexing) { + if (this.stack.length < 1) { + error = true; + break; + } + const dy = this.stack.pop(); + this.stack.push(0, dy); + break; + } + error = this.executeCommand(1, COMMAND_MAP.vmoveto); + break; + case 5: + error = this.executeCommand(2, COMMAND_MAP.rlineto); + break; + case 6: + error = this.executeCommand(1, COMMAND_MAP.hlineto); + break; + case 7: + error = this.executeCommand(1, COMMAND_MAP.vlineto); + break; + case 8: + error = this.executeCommand(6, COMMAND_MAP.rrcurveto); + break; + case 9: + this.stack = []; + break; + case 10: + if (this.stack.length < 1) { + error = true; + break; + } + subrNumber = this.stack.pop(); + if (!subrs[subrNumber]) { + error = true; + break; + } + error = this.convert(subrs[subrNumber], subrs, seacAnalysisEnabled); + break; + case 11: + return error; + case 13: + if (this.stack.length < 2) { + error = true; + break; + } + wx = this.stack.pop(); + sbx = this.stack.pop(); + this.lsb = sbx; + this.width = wx; + this.stack.push(wx, sbx); + error = this.executeCommand(2, COMMAND_MAP.hmoveto); + break; + case 14: + this.output.push(COMMAND_MAP.endchar[0]); + break; + case 21: + if (this.flexing) { + break; + } + error = this.executeCommand(2, COMMAND_MAP.rmoveto); + break; + case 22: + if (this.flexing) { + this.stack.push(0); + break; + } + error = this.executeCommand(1, COMMAND_MAP.hmoveto); + break; + case 30: + error = this.executeCommand(4, COMMAND_MAP.vhcurveto); + break; + case 31: + error = this.executeCommand(4, COMMAND_MAP.hvcurveto); + break; + case (12 << 8) + 0: + this.stack = []; + break; + case (12 << 8) + 1: + if (!HINTING_ENABLED) { + this.stack = []; + break; + } + error = this.executeCommand(2, COMMAND_MAP.vstem); + break; + case (12 << 8) + 2: + if (!HINTING_ENABLED) { + this.stack = []; + break; + } + error = this.executeCommand(2, COMMAND_MAP.hstem); + break; + case (12 << 8) + 6: + if (seacAnalysisEnabled) { + const asb = this.stack.at(-5); + this.seac = this.stack.splice(-4, 4); + this.seac[0] += this.lsb - asb; + error = this.executeCommand(0, COMMAND_MAP.endchar); + } else { + error = this.executeCommand(4, COMMAND_MAP.endchar); + } + break; + case (12 << 8) + 7: + if (this.stack.length < 4) { + error = true; + break; + } + this.stack.pop(); + wx = this.stack.pop(); + const sby = this.stack.pop(); + sbx = this.stack.pop(); + this.lsb = sbx; + this.width = wx; + this.stack.push(wx, sbx, sby); + error = this.executeCommand(3, COMMAND_MAP.rmoveto); + break; + case (12 << 8) + 12: + if (this.stack.length < 2) { + error = true; + break; + } + const num2 = this.stack.pop(); + const num1 = this.stack.pop(); + this.stack.push(num1 / num2); + break; + case (12 << 8) + 16: + if (this.stack.length < 2) { + error = true; + break; + } + subrNumber = this.stack.pop(); + const numArgs = this.stack.pop(); + if (subrNumber === 0 && numArgs === 3) { + const flexArgs = this.stack.splice(-17, 17); + this.stack.push(flexArgs[2] + flexArgs[0], flexArgs[3] + flexArgs[1], flexArgs[4], flexArgs[5], flexArgs[6], flexArgs[7], flexArgs[8], flexArgs[9], flexArgs[10], flexArgs[11], flexArgs[12], flexArgs[13], flexArgs[14]); + error = this.executeCommand(13, COMMAND_MAP.flex, true); + this.flexing = false; + this.stack.push(flexArgs[15], flexArgs[16]); + } else if (subrNumber === 1 && numArgs === 0) { + this.flexing = true; + } + break; + case (12 << 8) + 17: + break; + case (12 << 8) + 33: + this.stack = []; + break; + default: + warn('Unknown type 1 charstring command of "' + value + '"'); + break; + } + if (error) { + break; + } + continue; + } else if (value <= 246) { + value -= 139; + } else if (value <= 250) { + value = (value - 247) * 256 + encoded[++i] + 108; + } else if (value <= 254) { + value = -((value - 251) * 256) - encoded[++i] - 108; + } else { + value = (encoded[++i] & 0xff) << 24 | (encoded[++i] & 0xff) << 16 | (encoded[++i] & 0xff) << 8 | (encoded[++i] & 0xff) << 0; + } + this.stack.push(value); + } + return error; + } + executeCommand(howManyArgs, command, keepStack) { + const stackLength = this.stack.length; + if (howManyArgs > stackLength) { + return true; + } + const start = stackLength - howManyArgs; + for (let i = start; i < stackLength; i++) { + let value = this.stack[i]; + if (Number.isInteger(value)) { + this.output.push(28, value >> 8 & 0xff, value & 0xff); + } else { + value = 65536 * value | 0; + this.output.push(255, value >> 24 & 0xff, value >> 16 & 0xff, value >> 8 & 0xff, value & 0xff); + } + } + this.output.push(...command); + if (keepStack) { + this.stack.splice(start, howManyArgs); + } else { + this.stack.length = 0; + } + return false; + } +} +const EEXEC_ENCRYPT_KEY = 55665; +const CHAR_STRS_ENCRYPT_KEY = 4330; +function isHexDigit(code) { + return code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102; +} +function decrypt(data, key, discardNumber) { + if (discardNumber >= data.length) { + return new Uint8Array(0); + } + const c1 = 52845, + c2 = 22719; + let r = key | 0, + i, + j; + for (i = 0; i < discardNumber; i++) { + r = (data[i] + r) * c1 + c2 & (1 << 16) - 1; + } + const count = data.length - discardNumber; + const decrypted = new Uint8Array(count); + for (i = discardNumber, j = 0; j < count; i++, j++) { + const value = data[i]; + decrypted[j] = value ^ r >> 8; + r = (value + r) * c1 + c2 & (1 << 16) - 1; + } + return decrypted; +} +function decryptAscii(data, key, discardNumber) { + const c1 = 52845, + c2 = 22719; + let r = key | 0; + const count = data.length, + maybeLength = count >>> 1; + const decrypted = new Uint8Array(maybeLength); + let i, j; + for (i = 0, j = 0; i < count; i++) { + const digit1 = data[i]; + if (!isHexDigit(digit1)) { + continue; + } + i++; + let digit2; + while (i < count && !isHexDigit(digit2 = data[i])) { + i++; + } + if (i < count) { + const value = parseInt(String.fromCharCode(digit1, digit2), 16); + decrypted[j++] = value ^ r >> 8; + r = (value + r) * c1 + c2 & (1 << 16) - 1; + } + } + return decrypted.slice(discardNumber, j); +} +function isSpecial(c) { + return c === 0x2f || c === 0x5b || c === 0x5d || c === 0x7b || c === 0x7d || c === 0x28 || c === 0x29; +} +class Type1Parser { + constructor(stream, encrypted, seacAnalysisEnabled) { + if (encrypted) { + const data = stream.getBytes(); + const isBinary = !((isHexDigit(data[0]) || isWhiteSpace(data[0])) && isHexDigit(data[1]) && isHexDigit(data[2]) && isHexDigit(data[3]) && isHexDigit(data[4]) && isHexDigit(data[5]) && isHexDigit(data[6]) && isHexDigit(data[7])); + stream = new Stream(isBinary ? decrypt(data, EEXEC_ENCRYPT_KEY, 4) : decryptAscii(data, EEXEC_ENCRYPT_KEY, 4)); + } + this.seacAnalysisEnabled = !!seacAnalysisEnabled; + this.stream = stream; + this.nextChar(); + } + readNumberArray() { + this.getToken(); + const array = []; + while (true) { + const token = this.getToken(); + if (token === null || token === "]" || token === "}") { + break; + } + array.push(parseFloat(token || 0)); + } + return array; + } + readNumber() { + const token = this.getToken(); + return parseFloat(token || 0); + } + readInt() { + const token = this.getToken(); + return parseInt(token || 0, 10) | 0; + } + readBoolean() { + const token = this.getToken(); + return token === "true" ? 1 : 0; + } + nextChar() { + return this.currentChar = this.stream.getByte(); + } + prevChar() { + this.stream.skip(-2); + return this.currentChar = this.stream.getByte(); + } + getToken() { + let comment = false; + let ch = this.currentChar; + while (true) { + if (ch === -1) { + return null; + } + if (comment) { + if (ch === 0x0a || ch === 0x0d) { + comment = false; + } + } else if (ch === 0x25) { + comment = true; + } else if (!isWhiteSpace(ch)) { + break; + } + ch = this.nextChar(); + } + if (isSpecial(ch)) { + this.nextChar(); + return String.fromCharCode(ch); + } + let token = ""; + do { + token += String.fromCharCode(ch); + ch = this.nextChar(); + } while (ch >= 0 && !isWhiteSpace(ch) && !isSpecial(ch)); + return token; + } + readCharStrings(bytes, lenIV) { + if (lenIV === -1) { + return bytes; + } + return decrypt(bytes, CHAR_STRS_ENCRYPT_KEY, lenIV); + } + extractFontProgram(properties) { + const stream = this.stream; + const subrs = [], + charstrings = []; + const privateData = Object.create(null); + privateData.lenIV = 4; + const program = { + subrs: [], + charstrings: [], + properties: { + privateData + } + }; + let token, length, data, lenIV; + while ((token = this.getToken()) !== null) { + if (token !== "/") { + continue; + } + token = this.getToken(); + switch (token) { + case "CharStrings": + this.getToken(); + this.getToken(); + this.getToken(); + this.getToken(); + while (true) { + token = this.getToken(); + if (token === null || token === "end") { + break; + } + if (token !== "/") { + continue; + } + const glyph = this.getToken(); + length = this.readInt(); + this.getToken(); + data = length > 0 ? stream.getBytes(length) : new Uint8Array(0); + lenIV = program.properties.privateData.lenIV; + const encoded = this.readCharStrings(data, lenIV); + this.nextChar(); + token = this.getToken(); + if (token === "noaccess") { + this.getToken(); + } else if (token === "/") { + this.prevChar(); + } + charstrings.push({ + glyph, + encoded + }); + } + break; + case "Subrs": + this.readInt(); + this.getToken(); + while (this.getToken() === "dup") { + const index = this.readInt(); + length = this.readInt(); + this.getToken(); + data = length > 0 ? stream.getBytes(length) : new Uint8Array(0); + lenIV = program.properties.privateData.lenIV; + const encoded = this.readCharStrings(data, lenIV); + this.nextChar(); + token = this.getToken(); + if (token === "noaccess") { + this.getToken(); + } + subrs[index] = encoded; + } + break; + case "BlueValues": + case "OtherBlues": + case "FamilyBlues": + case "FamilyOtherBlues": + const blueArray = this.readNumberArray(); + if (blueArray.length > 0 && blueArray.length % 2 === 0 && HINTING_ENABLED) { + program.properties.privateData[token] = blueArray; + } + break; + case "StemSnapH": + case "StemSnapV": + program.properties.privateData[token] = this.readNumberArray(); + break; + case "StdHW": + case "StdVW": + program.properties.privateData[token] = this.readNumberArray()[0]; + break; + case "BlueShift": + case "lenIV": + case "BlueFuzz": + case "BlueScale": + case "LanguageGroup": + program.properties.privateData[token] = this.readNumber(); + break; + case "ExpansionFactor": + program.properties.privateData[token] = this.readNumber() || 0.06; + break; + case "ForceBold": + program.properties.privateData[token] = this.readBoolean(); + break; + } + } + for (const { + encoded, + glyph + } of charstrings) { + const charString = new Type1CharString(); + const error = charString.convert(encoded, subrs, this.seacAnalysisEnabled); + let output = charString.output; + if (error) { + output = [14]; + } + const charStringObject = { + glyphName: glyph, + charstring: output, + width: charString.width, + lsb: charString.lsb, + seac: charString.seac + }; + if (glyph === ".notdef") { + program.charstrings.unshift(charStringObject); + } else { + program.charstrings.push(charStringObject); + } + if (properties.builtInEncoding) { + const index = properties.builtInEncoding.indexOf(glyph); + if (index > -1 && properties.widths[index] === undefined && index >= properties.firstChar && index <= properties.lastChar) { + properties.widths[index] = charString.width; + } + } + } + return program; + } + extractFontHeader(properties) { + let token; + while ((token = this.getToken()) !== null) { + if (token !== "/") { + continue; + } + token = this.getToken(); + switch (token) { + case "FontMatrix": + const matrix = this.readNumberArray(); + properties.fontMatrix = matrix; + break; + case "Encoding": + const encodingArg = this.getToken(); + let encoding; + if (!/^\d+$/.test(encodingArg)) { + encoding = getEncoding(encodingArg); + } else { + encoding = []; + const size = parseInt(encodingArg, 10) | 0; + this.getToken(); + for (let j = 0; j < size; j++) { + token = this.getToken(); + while (token !== "dup" && token !== "def") { + token = this.getToken(); + if (token === null) { + return; + } + } + if (token === "def") { + break; + } + const index = this.readInt(); + this.getToken(); + const glyph = this.getToken(); + encoding[index] = glyph; + this.getToken(); + } + } + properties.builtInEncoding = encoding; + break; + case "FontBBox": + const fontBBox = this.readNumberArray(); + properties.ascent = Math.max(fontBBox[3], fontBBox[1]); + properties.descent = Math.min(fontBBox[1], fontBBox[3]); + properties.ascentScaled = true; + break; + } + } + } +} + +;// CONCATENATED MODULE: ./src/core/type1_font.js + + + + + + +function findBlock(streamBytes, signature, startIndex) { + const streamBytesLength = streamBytes.length; + const signatureLength = signature.length; + const scanLength = streamBytesLength - signatureLength; + let i = startIndex, + found = false; + while (i < scanLength) { + let j = 0; + while (j < signatureLength && streamBytes[i + j] === signature[j]) { + j++; + } + if (j >= signatureLength) { + i += j; + while (i < streamBytesLength && isWhiteSpace(streamBytes[i])) { + i++; + } + found = true; + break; + } + i++; + } + return { + found, + length: i + }; +} +function getHeaderBlock(stream, suggestedLength) { + const EEXEC_SIGNATURE = [0x65, 0x65, 0x78, 0x65, 0x63]; + const streamStartPos = stream.pos; + let headerBytes, headerBytesLength, block; + try { + headerBytes = stream.getBytes(suggestedLength); + headerBytesLength = headerBytes.length; + } catch {} + if (headerBytesLength === suggestedLength) { + block = findBlock(headerBytes, EEXEC_SIGNATURE, suggestedLength - 2 * EEXEC_SIGNATURE.length); + if (block.found && block.length === suggestedLength) { + return { + stream: new Stream(headerBytes), + length: suggestedLength + }; + } + } + warn('Invalid "Length1" property in Type1 font -- trying to recover.'); + stream.pos = streamStartPos; + const SCAN_BLOCK_LENGTH = 2048; + let actualLength; + while (true) { + const scanBytes = stream.peekBytes(SCAN_BLOCK_LENGTH); + block = findBlock(scanBytes, EEXEC_SIGNATURE, 0); + if (block.length === 0) { + break; + } + stream.pos += block.length; + if (block.found) { + actualLength = stream.pos - streamStartPos; + break; + } + } + stream.pos = streamStartPos; + if (actualLength) { + return { + stream: new Stream(stream.getBytes(actualLength)), + length: actualLength + }; + } + warn('Unable to recover "Length1" property in Type1 font -- using as is.'); + return { + stream: new Stream(stream.getBytes(suggestedLength)), + length: suggestedLength + }; +} +function getEexecBlock(stream, suggestedLength) { + const eexecBytes = stream.getBytes(); + if (eexecBytes.length === 0) { + throw new FormatError("getEexecBlock - no font program found."); + } + return { + stream: new Stream(eexecBytes), + length: eexecBytes.length + }; +} +class Type1Font { + constructor(name, file, properties) { + const PFB_HEADER_SIZE = 6; + let headerBlockLength = properties.length1; + let eexecBlockLength = properties.length2; + let pfbHeader = file.peekBytes(PFB_HEADER_SIZE); + const pfbHeaderPresent = pfbHeader[0] === 0x80 && pfbHeader[1] === 0x01; + if (pfbHeaderPresent) { + file.skip(PFB_HEADER_SIZE); + headerBlockLength = pfbHeader[5] << 24 | pfbHeader[4] << 16 | pfbHeader[3] << 8 | pfbHeader[2]; + } + const headerBlock = getHeaderBlock(file, headerBlockLength); + const headerBlockParser = new Type1Parser(headerBlock.stream, false, SEAC_ANALYSIS_ENABLED); + headerBlockParser.extractFontHeader(properties); + if (pfbHeaderPresent) { + pfbHeader = file.getBytes(PFB_HEADER_SIZE); + eexecBlockLength = pfbHeader[5] << 24 | pfbHeader[4] << 16 | pfbHeader[3] << 8 | pfbHeader[2]; + } + const eexecBlock = getEexecBlock(file, eexecBlockLength); + const eexecBlockParser = new Type1Parser(eexecBlock.stream, true, SEAC_ANALYSIS_ENABLED); + const data = eexecBlockParser.extractFontProgram(properties); + for (const key in data.properties) { + properties[key] = data.properties[key]; + } + const charstrings = data.charstrings; + const type2Charstrings = this.getType2Charstrings(charstrings); + const subrs = this.getType2Subrs(data.subrs); + this.charstrings = charstrings; + this.data = this.wrap(name, type2Charstrings, this.charstrings, subrs, properties); + this.seacs = this.getSeacs(data.charstrings); + } + get numGlyphs() { + return this.charstrings.length + 1; + } + getCharset() { + const charset = [".notdef"]; + for (const { + glyphName + } of this.charstrings) { + charset.push(glyphName); + } + return charset; + } + getGlyphMapping(properties) { + const charstrings = this.charstrings; + if (properties.composite) { + const charCodeToGlyphId = Object.create(null); + for (let glyphId = 0, charstringsLen = charstrings.length; glyphId < charstringsLen; glyphId++) { + const charCode = properties.cMap.charCodeOf(glyphId); + charCodeToGlyphId[charCode] = glyphId + 1; + } + return charCodeToGlyphId; + } + const glyphNames = [".notdef"]; + let builtInEncoding, glyphId; + for (glyphId = 0; glyphId < charstrings.length; glyphId++) { + glyphNames.push(charstrings[glyphId].glyphName); + } + const encoding = properties.builtInEncoding; + if (encoding) { + builtInEncoding = Object.create(null); + for (const charCode in encoding) { + glyphId = glyphNames.indexOf(encoding[charCode]); + if (glyphId >= 0) { + builtInEncoding[charCode] = glyphId; + } + } + } + return type1FontGlyphMapping(properties, builtInEncoding, glyphNames); + } + hasGlyphId(id) { + if (id < 0 || id >= this.numGlyphs) { + return false; + } + if (id === 0) { + return true; + } + const glyph = this.charstrings[id - 1]; + return glyph.charstring.length > 0; + } + getSeacs(charstrings) { + const seacMap = []; + for (let i = 0, ii = charstrings.length; i < ii; i++) { + const charstring = charstrings[i]; + if (charstring.seac) { + seacMap[i + 1] = charstring.seac; + } + } + return seacMap; + } + getType2Charstrings(type1Charstrings) { + const type2Charstrings = []; + for (const type1Charstring of type1Charstrings) { + type2Charstrings.push(type1Charstring.charstring); + } + return type2Charstrings; + } + getType2Subrs(type1Subrs) { + let bias = 0; + const count = type1Subrs.length; + if (count < 1133) { + bias = 107; + } else if (count < 33769) { + bias = 1131; + } else { + bias = 32768; + } + const type2Subrs = []; + let i; + for (i = 0; i < bias; i++) { + type2Subrs.push([0x0b]); + } + for (i = 0; i < count; i++) { + type2Subrs.push(type1Subrs[i]); + } + return type2Subrs; + } + wrap(name, glyphs, charstrings, subrs, properties) { + const cff = new CFF(); + cff.header = new CFFHeader(1, 0, 4, 4); + cff.names = [name]; + const topDict = new CFFTopDict(); + topDict.setByName("version", 391); + topDict.setByName("Notice", 392); + topDict.setByName("FullName", 393); + topDict.setByName("FamilyName", 394); + topDict.setByName("Weight", 395); + topDict.setByName("Encoding", null); + topDict.setByName("FontMatrix", properties.fontMatrix); + topDict.setByName("FontBBox", properties.bbox); + topDict.setByName("charset", null); + topDict.setByName("CharStrings", null); + topDict.setByName("Private", null); + cff.topDict = topDict; + const strings = new CFFStrings(); + strings.add("Version 0.11"); + strings.add("See original notice"); + strings.add(name); + strings.add(name); + strings.add("Medium"); + cff.strings = strings; + cff.globalSubrIndex = new CFFIndex(); + const count = glyphs.length; + const charsetArray = [".notdef"]; + let i, ii; + for (i = 0; i < count; i++) { + const glyphName = charstrings[i].glyphName; + const index = CFFStandardStrings.indexOf(glyphName); + if (index === -1) { + strings.add(glyphName); + } + charsetArray.push(glyphName); + } + cff.charset = new CFFCharset(false, 0, charsetArray); + const charStringsIndex = new CFFIndex(); + charStringsIndex.add([0x8b, 0x0e]); + for (i = 0; i < count; i++) { + charStringsIndex.add(glyphs[i]); + } + cff.charStrings = charStringsIndex; + const privateDict = new CFFPrivateDict(); + privateDict.setByName("Subrs", null); + const fields = ["BlueValues", "OtherBlues", "FamilyBlues", "FamilyOtherBlues", "StemSnapH", "StemSnapV", "BlueShift", "BlueFuzz", "BlueScale", "LanguageGroup", "ExpansionFactor", "ForceBold", "StdHW", "StdVW"]; + for (i = 0, ii = fields.length; i < ii; i++) { + const field = fields[i]; + if (!(field in properties.privateData)) { + continue; + } + const value = properties.privateData[field]; + if (Array.isArray(value)) { + for (let j = value.length - 1; j > 0; j--) { + value[j] -= value[j - 1]; + } + } + privateDict.setByName(field, value); + } + cff.topDict.privateDict = privateDict; + const subrIndex = new CFFIndex(); + for (i = 0, ii = subrs.length; i < ii; i++) { + subrIndex.add(subrs[i]); + } + privateDict.subrsIndex = subrIndex; + const compiler = new CFFCompiler(cff); + return compiler.compile(); + } +} + +;// CONCATENATED MODULE: ./src/core/fonts.js + + + + + + + + + + + + + + + + + +const PRIVATE_USE_AREAS = [[0xe000, 0xf8ff], [0x100000, 0x10fffd]]; +const PDF_GLYPH_SPACE_UNITS = 1000; +const EXPORT_DATA_PROPERTIES = ["ascent", "bbox", "black", "bold", "charProcOperatorList", "composite", "cssFontInfo", "data", "defaultVMetrics", "defaultWidth", "descent", "fallbackName", "fontMatrix", "isInvalidPDFjsFont", "isType3Font", "italic", "loadedName", "mimetype", "missingFile", "name", "remeasure", "subtype", "systemFontInfo", "type", "vertical"]; +const EXPORT_DATA_EXTRA_PROPERTIES = ["cMap", "defaultEncoding", "differences", "isMonospace", "isSerifFont", "isSymbolicFont", "seacMap", "toFontChar", "toUnicode", "vmetrics", "widths"]; +function adjustWidths(properties) { + if (!properties.fontMatrix) { + return; + } + if (properties.fontMatrix[0] === FONT_IDENTITY_MATRIX[0]) { + return; + } + const scale = 0.001 / properties.fontMatrix[0]; + const glyphsWidths = properties.widths; + for (const glyph in glyphsWidths) { + glyphsWidths[glyph] *= scale; + } + properties.defaultWidth *= scale; +} +function adjustTrueTypeToUnicode(properties, isSymbolicFont, nameRecords) { + if (properties.isInternalFont) { + return; + } + if (properties.hasIncludedToUnicodeMap) { + return; + } + if (properties.hasEncoding) { + return; + } + if (properties.toUnicode instanceof IdentityToUnicodeMap) { + return; + } + if (!isSymbolicFont) { + return; + } + if (nameRecords.length === 0) { + return; + } + if (properties.defaultEncoding === WinAnsiEncoding) { + return; + } + for (const r of nameRecords) { + if (!isWinNameRecord(r)) { + return; + } + } + const encoding = WinAnsiEncoding; + const toUnicode = [], + glyphsUnicodeMap = getGlyphsUnicode(); + for (const charCode in encoding) { + const glyphName = encoding[charCode]; + if (glyphName === "") { + continue; + } + const unicode = glyphsUnicodeMap[glyphName]; + if (unicode === undefined) { + continue; + } + toUnicode[charCode] = String.fromCharCode(unicode); + } + if (toUnicode.length > 0) { + properties.toUnicode.amend(toUnicode); + } +} +function adjustType1ToUnicode(properties, builtInEncoding) { + if (properties.isInternalFont) { + return; + } + if (properties.hasIncludedToUnicodeMap) { + return; + } + if (builtInEncoding === properties.defaultEncoding) { + return; + } + if (properties.toUnicode instanceof IdentityToUnicodeMap) { + return; + } + const toUnicode = [], + glyphsUnicodeMap = getGlyphsUnicode(); + for (const charCode in builtInEncoding) { + if (properties.hasEncoding) { + if (properties.baseEncodingName || properties.differences[charCode] !== undefined) { + continue; + } + } + const glyphName = builtInEncoding[charCode]; + const unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); + if (unicode !== -1) { + toUnicode[charCode] = String.fromCharCode(unicode); + } + } + if (toUnicode.length > 0) { + properties.toUnicode.amend(toUnicode); + } +} +function amendFallbackToUnicode(properties) { + if (!properties.fallbackToUnicode) { + return; + } + if (properties.toUnicode instanceof IdentityToUnicodeMap) { + return; + } + const toUnicode = []; + for (const charCode in properties.fallbackToUnicode) { + if (properties.toUnicode.has(charCode)) { + continue; + } + toUnicode[charCode] = properties.fallbackToUnicode[charCode]; + } + if (toUnicode.length > 0) { + properties.toUnicode.amend(toUnicode); + } +} +class fonts_Glyph { + constructor(originalCharCode, fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont) { + this.originalCharCode = originalCharCode; + this.fontChar = fontChar; + this.unicode = unicode; + this.accent = accent; + this.width = width; + this.vmetric = vmetric; + this.operatorListId = operatorListId; + this.isSpace = isSpace; + this.isInFont = isInFont; + } + get category() { + return shadow(this, "category", getCharUnicodeCategory(this.unicode), true); + } +} +function int16(b0, b1) { + return (b0 << 8) + b1; +} +function writeSignedInt16(bytes, index, value) { + bytes[index + 1] = value; + bytes[index] = value >>> 8; +} +function signedInt16(b0, b1) { + const value = (b0 << 8) + b1; + return value & 1 << 15 ? value - 0x10000 : value; +} +function writeUint32(bytes, index, value) { + bytes[index + 3] = value & 0xff; + bytes[index + 2] = value >>> 8; + bytes[index + 1] = value >>> 16; + bytes[index] = value >>> 24; +} +function int32(b0, b1, b2, b3) { + return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3; +} +function string16(value) { + return String.fromCharCode(value >> 8 & 0xff, value & 0xff); +} +function safeString16(value) { + if (value > 0x7fff) { + value = 0x7fff; + } else if (value < -0x8000) { + value = -0x8000; + } + return String.fromCharCode(value >> 8 & 0xff, value & 0xff); +} +function isTrueTypeFile(file) { + const header = file.peekBytes(4); + return readUint32(header, 0) === 0x00010000 || bytesToString(header) === "true"; +} +function isTrueTypeCollectionFile(file) { + const header = file.peekBytes(4); + return bytesToString(header) === "ttcf"; +} +function isOpenTypeFile(file) { + const header = file.peekBytes(4); + return bytesToString(header) === "OTTO"; +} +function isType1File(file) { + const header = file.peekBytes(2); + if (header[0] === 0x25 && header[1] === 0x21) { + return true; + } + if (header[0] === 0x80 && header[1] === 0x01) { + return true; + } + return false; +} +function isCFFFile(file) { + const header = file.peekBytes(4); + if (header[0] >= 1 && header[3] >= 1 && header[3] <= 4) { + return true; + } + return false; +} +function getFontFileType(file, { + type, + subtype, + composite +}) { + let fileType, fileSubtype; + if (isTrueTypeFile(file) || isTrueTypeCollectionFile(file)) { + fileType = composite ? "CIDFontType2" : "TrueType"; + } else if (isOpenTypeFile(file)) { + fileType = composite ? "CIDFontType2" : "OpenType"; + } else if (isType1File(file)) { + if (composite) { + fileType = "CIDFontType0"; + } else { + fileType = type === "MMType1" ? "MMType1" : "Type1"; + } + } else if (isCFFFile(file)) { + if (composite) { + fileType = "CIDFontType0"; + fileSubtype = "CIDFontType0C"; + } else { + fileType = type === "MMType1" ? "MMType1" : "Type1"; + fileSubtype = "Type1C"; + } + } else { + warn("getFontFileType: Unable to detect correct font file Type/Subtype."); + fileType = type; + fileSubtype = subtype; + } + return [fileType, fileSubtype]; +} +function applyStandardFontGlyphMap(map, glyphMap) { + for (const charCode in glyphMap) { + map[+charCode] = glyphMap[charCode]; + } +} +function buildToFontChar(encoding, glyphsUnicodeMap, differences) { + const toFontChar = []; + let unicode; + for (let i = 0, ii = encoding.length; i < ii; i++) { + unicode = getUnicodeForGlyph(encoding[i], glyphsUnicodeMap); + if (unicode !== -1) { + toFontChar[i] = unicode; + } + } + for (const charCode in differences) { + unicode = getUnicodeForGlyph(differences[charCode], glyphsUnicodeMap); + if (unicode !== -1) { + toFontChar[+charCode] = unicode; + } + } + return toFontChar; +} +function isMacNameRecord(r) { + return r.platform === 1 && r.encoding === 0 && r.language === 0; +} +function isWinNameRecord(r) { + return r.platform === 3 && r.encoding === 1 && r.language === 0x409; +} +function convertCidString(charCode, cid, shouldThrow = false) { + switch (cid.length) { + case 1: + return cid.charCodeAt(0); + case 2: + return cid.charCodeAt(0) << 8 | cid.charCodeAt(1); + } + const msg = `Unsupported CID string (charCode ${charCode}): "${cid}".`; + if (shouldThrow) { + throw new FormatError(msg); + } + warn(msg); + return cid; +} +function adjustMapping(charCodeToGlyphId, hasGlyph, newGlyphZeroId, toUnicode) { + const newMap = Object.create(null); + const toUnicodeExtraMap = new Map(); + const toFontChar = []; + const usedGlyphIds = new Set(); + let privateUseAreaIndex = 0; + const privateUseOffetStart = PRIVATE_USE_AREAS[privateUseAreaIndex][0]; + let nextAvailableFontCharCode = privateUseOffetStart; + let privateUseOffetEnd = PRIVATE_USE_AREAS[privateUseAreaIndex][1]; + const isInPrivateArea = code => PRIVATE_USE_AREAS[0][0] <= code && code <= PRIVATE_USE_AREAS[0][1] || PRIVATE_USE_AREAS[1][0] <= code && code <= PRIVATE_USE_AREAS[1][1]; + for (let originalCharCode in charCodeToGlyphId) { + originalCharCode |= 0; + let glyphId = charCodeToGlyphId[originalCharCode]; + if (!hasGlyph(glyphId)) { + continue; + } + if (nextAvailableFontCharCode > privateUseOffetEnd) { + privateUseAreaIndex++; + if (privateUseAreaIndex >= PRIVATE_USE_AREAS.length) { + warn("Ran out of space in font private use area."); + break; + } + nextAvailableFontCharCode = PRIVATE_USE_AREAS[privateUseAreaIndex][0]; + privateUseOffetEnd = PRIVATE_USE_AREAS[privateUseAreaIndex][1]; + } + const fontCharCode = nextAvailableFontCharCode++; + if (glyphId === 0) { + glyphId = newGlyphZeroId; + } + let unicode = toUnicode.get(originalCharCode); + if (typeof unicode === "string") { + unicode = unicode.codePointAt(0); + } + if (unicode && !isInPrivateArea(unicode) && !usedGlyphIds.has(glyphId)) { + toUnicodeExtraMap.set(unicode, glyphId); + usedGlyphIds.add(glyphId); + } + newMap[fontCharCode] = glyphId; + toFontChar[originalCharCode] = fontCharCode; + } + return { + toFontChar, + charCodeToGlyphId: newMap, + toUnicodeExtraMap, + nextAvailableFontCharCode + }; +} +function getRanges(glyphs, toUnicodeExtraMap, numGlyphs) { + const codes = []; + for (const charCode in glyphs) { + if (glyphs[charCode] >= numGlyphs) { + continue; + } + codes.push({ + fontCharCode: charCode | 0, + glyphId: glyphs[charCode] + }); + } + if (toUnicodeExtraMap) { + for (const [unicode, glyphId] of toUnicodeExtraMap) { + if (glyphId >= numGlyphs) { + continue; + } + codes.push({ + fontCharCode: unicode, + glyphId + }); + } + } + if (codes.length === 0) { + codes.push({ + fontCharCode: 0, + glyphId: 0 + }); + } + codes.sort(function fontGetRangesSort(a, b) { + return a.fontCharCode - b.fontCharCode; + }); + const ranges = []; + const length = codes.length; + for (let n = 0; n < length;) { + const start = codes[n].fontCharCode; + const codeIndices = [codes[n].glyphId]; + ++n; + let end = start; + while (n < length && end + 1 === codes[n].fontCharCode) { + codeIndices.push(codes[n].glyphId); + ++end; + ++n; + if (end === 0xffff) { + break; + } + } + ranges.push([start, end, codeIndices]); + } + return ranges; +} +function createCmapTable(glyphs, toUnicodeExtraMap, numGlyphs) { + const ranges = getRanges(glyphs, toUnicodeExtraMap, numGlyphs); + const numTables = ranges.at(-1)[1] > 0xffff ? 2 : 1; + let cmap = "\x00\x00" + string16(numTables) + "\x00\x03" + "\x00\x01" + string32(4 + numTables * 8); + let i, ii, j, jj; + for (i = ranges.length - 1; i >= 0; --i) { + if (ranges[i][0] <= 0xffff) { + break; + } + } + const bmpLength = i + 1; + if (ranges[i][0] < 0xffff && ranges[i][1] === 0xffff) { + ranges[i][1] = 0xfffe; + } + const trailingRangesCount = ranges[i][1] < 0xffff ? 1 : 0; + const segCount = bmpLength + trailingRangesCount; + const searchParams = OpenTypeFileBuilder.getSearchParams(segCount, 2); + let startCount = ""; + let endCount = ""; + let idDeltas = ""; + let idRangeOffsets = ""; + let glyphsIds = ""; + let bias = 0; + let range, start, end, codes; + for (i = 0, ii = bmpLength; i < ii; i++) { + range = ranges[i]; + start = range[0]; + end = range[1]; + startCount += string16(start); + endCount += string16(end); + codes = range[2]; + let contiguous = true; + for (j = 1, jj = codes.length; j < jj; ++j) { + if (codes[j] !== codes[j - 1] + 1) { + contiguous = false; + break; + } + } + if (!contiguous) { + const offset = (segCount - i) * 2 + bias * 2; + bias += end - start + 1; + idDeltas += string16(0); + idRangeOffsets += string16(offset); + for (j = 0, jj = codes.length; j < jj; ++j) { + glyphsIds += string16(codes[j]); + } + } else { + const startCode = codes[0]; + idDeltas += string16(startCode - start & 0xffff); + idRangeOffsets += string16(0); + } + } + if (trailingRangesCount > 0) { + endCount += "\xFF\xFF"; + startCount += "\xFF\xFF"; + idDeltas += "\x00\x01"; + idRangeOffsets += "\x00\x00"; + } + const format314 = "\x00\x00" + string16(2 * segCount) + string16(searchParams.range) + string16(searchParams.entry) + string16(searchParams.rangeShift) + endCount + "\x00\x00" + startCount + idDeltas + idRangeOffsets + glyphsIds; + let format31012 = ""; + let header31012 = ""; + if (numTables > 1) { + cmap += "\x00\x03" + "\x00\x0A" + string32(4 + numTables * 8 + 4 + format314.length); + format31012 = ""; + for (i = 0, ii = ranges.length; i < ii; i++) { + range = ranges[i]; + start = range[0]; + codes = range[2]; + let code = codes[0]; + for (j = 1, jj = codes.length; j < jj; ++j) { + if (codes[j] !== codes[j - 1] + 1) { + end = range[0] + j - 1; + format31012 += string32(start) + string32(end) + string32(code); + start = end + 1; + code = codes[j]; + } + } + format31012 += string32(start) + string32(range[1]) + string32(code); + } + header31012 = "\x00\x0C" + "\x00\x00" + string32(format31012.length + 16) + "\x00\x00\x00\x00" + string32(format31012.length / 12); + } + return cmap + "\x00\x04" + string16(format314.length + 4) + format314 + header31012 + format31012; +} +function validateOS2Table(os2, file) { + file.pos = (file.start || 0) + os2.offset; + const version = file.getUint16(); + file.skip(60); + const selection = file.getUint16(); + if (version < 4 && selection & 0x0300) { + return false; + } + const firstChar = file.getUint16(); + const lastChar = file.getUint16(); + if (firstChar > lastChar) { + return false; + } + file.skip(6); + const usWinAscent = file.getUint16(); + if (usWinAscent === 0) { + return false; + } + os2.data[8] = os2.data[9] = 0; + return true; +} +function createOS2Table(properties, charstrings, override) { + override ||= { + unitsPerEm: 0, + yMax: 0, + yMin: 0, + ascent: 0, + descent: 0 + }; + let ulUnicodeRange1 = 0; + let ulUnicodeRange2 = 0; + let ulUnicodeRange3 = 0; + let ulUnicodeRange4 = 0; + let firstCharIndex = null; + let lastCharIndex = 0; + let position = -1; + if (charstrings) { + for (let code in charstrings) { + code |= 0; + if (firstCharIndex > code || !firstCharIndex) { + firstCharIndex = code; + } + if (lastCharIndex < code) { + lastCharIndex = code; + } + position = getUnicodeRangeFor(code, position); + if (position < 32) { + ulUnicodeRange1 |= 1 << position; + } else if (position < 64) { + ulUnicodeRange2 |= 1 << position - 32; + } else if (position < 96) { + ulUnicodeRange3 |= 1 << position - 64; + } else if (position < 123) { + ulUnicodeRange4 |= 1 << position - 96; + } else { + throw new FormatError("Unicode ranges Bits > 123 are reserved for internal usage"); + } + } + if (lastCharIndex > 0xffff) { + lastCharIndex = 0xffff; + } + } else { + firstCharIndex = 0; + lastCharIndex = 255; + } + const bbox = properties.bbox || [0, 0, 0, 0]; + const unitsPerEm = override.unitsPerEm || 1 / (properties.fontMatrix || FONT_IDENTITY_MATRIX)[0]; + const scale = properties.ascentScaled ? 1.0 : unitsPerEm / PDF_GLYPH_SPACE_UNITS; + const typoAscent = override.ascent || Math.round(scale * (properties.ascent || bbox[3])); + let typoDescent = override.descent || Math.round(scale * (properties.descent || bbox[1])); + if (typoDescent > 0 && properties.descent > 0 && bbox[1] < 0) { + typoDescent = -typoDescent; + } + const winAscent = override.yMax || typoAscent; + const winDescent = -override.yMin || -typoDescent; + return "\x00\x03" + "\x02\x24" + "\x01\xF4" + "\x00\x05" + "\x00\x00" + "\x02\x8A" + "\x02\xBB" + "\x00\x00" + "\x00\x8C" + "\x02\x8A" + "\x02\xBB" + "\x00\x00" + "\x01\xDF" + "\x00\x31" + "\x01\x02" + "\x00\x00" + "\x00\x00\x06" + String.fromCharCode(properties.fixedPitch ? 0x09 : 0x00) + "\x00\x00\x00\x00\x00\x00" + string32(ulUnicodeRange1) + string32(ulUnicodeRange2) + string32(ulUnicodeRange3) + string32(ulUnicodeRange4) + "\x2A\x32\x31\x2A" + string16(properties.italicAngle ? 1 : 0) + string16(firstCharIndex || properties.firstChar) + string16(lastCharIndex || properties.lastChar) + string16(typoAscent) + string16(typoDescent) + "\x00\x64" + string16(winAscent) + string16(winDescent) + "\x00\x00\x00\x00" + "\x00\x00\x00\x00" + string16(properties.xHeight) + string16(properties.capHeight) + string16(0) + string16(firstCharIndex || properties.firstChar) + "\x00\x03"; +} +function createPostTable(properties) { + const angle = Math.floor(properties.italicAngle * 2 ** 16); + return "\x00\x03\x00\x00" + string32(angle) + "\x00\x00" + "\x00\x00" + string32(properties.fixedPitch ? 1 : 0) + "\x00\x00\x00\x00" + "\x00\x00\x00\x00" + "\x00\x00\x00\x00" + "\x00\x00\x00\x00"; +} +function createPostscriptName(name) { + return name.replaceAll(/[^\x21-\x7E]|[[\](){}<>/%]/g, "").slice(0, 63); +} +function createNameTable(name, proto) { + if (!proto) { + proto = [[], []]; + } + const strings = [proto[0][0] || "Original licence", proto[0][1] || name, proto[0][2] || "Unknown", proto[0][3] || "uniqueID", proto[0][4] || name, proto[0][5] || "Version 0.11", proto[0][6] || createPostscriptName(name), proto[0][7] || "Unknown", proto[0][8] || "Unknown", proto[0][9] || "Unknown"]; + const stringsUnicode = []; + let i, ii, j, jj, str; + for (i = 0, ii = strings.length; i < ii; i++) { + str = proto[1][i] || strings[i]; + const strBufUnicode = []; + for (j = 0, jj = str.length; j < jj; j++) { + strBufUnicode.push(string16(str.charCodeAt(j))); + } + stringsUnicode.push(strBufUnicode.join("")); + } + const names = [strings, stringsUnicode]; + const platforms = ["\x00\x01", "\x00\x03"]; + const encodings = ["\x00\x00", "\x00\x01"]; + const languages = ["\x00\x00", "\x04\x09"]; + const namesRecordCount = strings.length * platforms.length; + let nameTable = "\x00\x00" + string16(namesRecordCount) + string16(namesRecordCount * 12 + 6); + let strOffset = 0; + for (i = 0, ii = platforms.length; i < ii; i++) { + const strs = names[i]; + for (j = 0, jj = strs.length; j < jj; j++) { + str = strs[j]; + const nameRecord = platforms[i] + encodings[i] + languages[i] + string16(j) + string16(str.length) + string16(strOffset); + nameTable += nameRecord; + strOffset += str.length; + } + } + nameTable += strings.join("") + stringsUnicode.join(""); + return nameTable; +} +class Font { + constructor(name, file, properties) { + this.name = name; + this.psName = null; + this.mimetype = null; + this.disableFontFace = false; + this.loadedName = properties.loadedName; + this.isType3Font = properties.isType3Font; + this.missingFile = false; + this.cssFontInfo = properties.cssFontInfo; + this._charsCache = Object.create(null); + this._glyphCache = Object.create(null); + let isSerifFont = !!(properties.flags & FontFlags.Serif); + if (!isSerifFont && !properties.isSimulatedFlags) { + const baseName = name.replaceAll(/[,_]/g, "-").split("-")[0], + serifFonts = getSerifFonts(); + for (const namePart of baseName.split("+")) { + if (serifFonts[namePart]) { + isSerifFont = true; + break; + } + } + } + this.isSerifFont = isSerifFont; + this.isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); + this.isMonospace = !!(properties.flags & FontFlags.FixedPitch); + let { + type, + subtype + } = properties; + this.type = type; + this.subtype = subtype; + this.systemFontInfo = properties.systemFontInfo; + const matches = name.match(/^InvalidPDFjsFont_(.*)_\d+$/); + this.isInvalidPDFjsFont = !!matches; + if (this.isInvalidPDFjsFont) { + this.fallbackName = matches[1]; + } else if (this.isMonospace) { + this.fallbackName = "monospace"; + } else if (this.isSerifFont) { + this.fallbackName = "serif"; + } else { + this.fallbackName = "sans-serif"; + } + if (this.systemFontInfo?.guessFallback) { + this.systemFontInfo.guessFallback = false; + this.systemFontInfo.css += `,${this.fallbackName}`; + } + this.differences = properties.differences; + this.widths = properties.widths; + this.defaultWidth = properties.defaultWidth; + this.composite = properties.composite; + this.cMap = properties.cMap; + this.capHeight = properties.capHeight / PDF_GLYPH_SPACE_UNITS; + this.ascent = properties.ascent / PDF_GLYPH_SPACE_UNITS; + this.descent = properties.descent / PDF_GLYPH_SPACE_UNITS; + this.lineHeight = this.ascent - this.descent; + this.fontMatrix = properties.fontMatrix; + this.bbox = properties.bbox; + this.defaultEncoding = properties.defaultEncoding; + this.toUnicode = properties.toUnicode; + this.toFontChar = []; + if (properties.type === "Type3") { + for (let charCode = 0; charCode < 256; charCode++) { + this.toFontChar[charCode] = this.differences[charCode] || properties.defaultEncoding[charCode]; + } + return; + } + this.cidEncoding = properties.cidEncoding || ""; + this.vertical = !!properties.vertical; + if (this.vertical) { + this.vmetrics = properties.vmetrics; + this.defaultVMetrics = properties.defaultVMetrics; + } + if (!file || file.isEmpty) { + if (file) { + warn('Font file is empty in "' + name + '" (' + this.loadedName + ")"); + } + this.fallbackToSystemFont(properties); + return; + } + [type, subtype] = getFontFileType(file, properties); + if (type !== this.type || subtype !== this.subtype) { + info("Inconsistent font file Type/SubType, expected: " + `${this.type}/${this.subtype} but found: ${type}/${subtype}.`); + } + let data; + try { + switch (type) { + case "MMType1": + info("MMType1 font (" + name + "), falling back to Type1."); + case "Type1": + case "CIDFontType0": + this.mimetype = "font/opentype"; + const cff = subtype === "Type1C" || subtype === "CIDFontType0C" ? new CFFFont(file, properties) : new Type1Font(name, file, properties); + adjustWidths(properties); + data = this.convert(name, cff, properties); + break; + case "OpenType": + case "TrueType": + case "CIDFontType2": + this.mimetype = "font/opentype"; + data = this.checkAndRepair(name, file, properties); + if (this.isOpenType) { + adjustWidths(properties); + type = "OpenType"; + } + break; + default: + throw new FormatError(`Font ${type} is not supported`); + } + } catch (e) { + warn(e); + this.fallbackToSystemFont(properties); + return; + } + amendFallbackToUnicode(properties); + this.data = data; + this.type = type; + this.subtype = subtype; + this.fontMatrix = properties.fontMatrix; + this.widths = properties.widths; + this.defaultWidth = properties.defaultWidth; + this.toUnicode = properties.toUnicode; + this.seacMap = properties.seacMap; + } + get renderer() { + const renderer = FontRendererFactory.create(this, SEAC_ANALYSIS_ENABLED); + return shadow(this, "renderer", renderer); + } + exportData(extraProperties = false) { + const exportDataProperties = extraProperties ? [...EXPORT_DATA_PROPERTIES, ...EXPORT_DATA_EXTRA_PROPERTIES] : EXPORT_DATA_PROPERTIES; + const data = Object.create(null); + let property, value; + for (property of exportDataProperties) { + value = this[property]; + if (value !== undefined) { + data[property] = value; + } + } + return data; + } + fallbackToSystemFont(properties) { + this.missingFile = true; + const { + name, + type + } = this; + let fontName = normalizeFontName(name); + const stdFontMap = getStdFontMap(), + nonStdFontMap = getNonStdFontMap(); + const isStandardFont = !!stdFontMap[fontName]; + const isMappedToStandardFont = !!(nonStdFontMap[fontName] && stdFontMap[nonStdFontMap[fontName]]); + fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName; + const fontBasicMetricsMap = getFontBasicMetrics(); + const metrics = fontBasicMetricsMap[fontName]; + if (metrics) { + if (isNaN(this.ascent)) { + this.ascent = metrics.ascent / PDF_GLYPH_SPACE_UNITS; + } + if (isNaN(this.descent)) { + this.descent = metrics.descent / PDF_GLYPH_SPACE_UNITS; + } + if (isNaN(this.capHeight)) { + this.capHeight = metrics.capHeight / PDF_GLYPH_SPACE_UNITS; + } + } + this.bold = /bold/gi.test(fontName); + this.italic = /oblique|italic/gi.test(fontName); + this.black = /Black/g.test(name); + const isNarrow = /Narrow/g.test(name); + this.remeasure = (!isStandardFont || isNarrow) && Object.keys(this.widths).length > 0; + if ((isStandardFont || isMappedToStandardFont) && type === "CIDFontType2" && this.cidEncoding.startsWith("Identity-")) { + const cidToGidMap = properties.cidToGidMap; + const map = []; + applyStandardFontGlyphMap(map, getGlyphMapForStandardFonts()); + if (/Arial-?Black/i.test(name)) { + applyStandardFontGlyphMap(map, getSupplementalGlyphMapForArialBlack()); + } else if (/Calibri/i.test(name)) { + applyStandardFontGlyphMap(map, getSupplementalGlyphMapForCalibri()); + } + if (cidToGidMap) { + for (const charCode in map) { + const cid = map[charCode]; + if (cidToGidMap[cid] !== undefined) { + map[+charCode] = cidToGidMap[cid]; + } + } + if (cidToGidMap.length !== this.toUnicode.length && properties.hasIncludedToUnicodeMap && this.toUnicode instanceof IdentityToUnicodeMap) { + this.toUnicode.forEach(function (charCode, unicodeCharCode) { + const cid = map[charCode]; + if (cidToGidMap[cid] === undefined) { + map[+charCode] = unicodeCharCode; + } + }); + } + } + if (!(this.toUnicode instanceof IdentityToUnicodeMap)) { + this.toUnicode.forEach(function (charCode, unicodeCharCode) { + map[+charCode] = unicodeCharCode; + }); + } + this.toFontChar = map; + this.toUnicode = new ToUnicodeMap(map); + } else if (/Symbol/i.test(fontName)) { + this.toFontChar = buildToFontChar(SymbolSetEncoding, getGlyphsUnicode(), this.differences); + } else if (/Dingbats/i.test(fontName)) { + this.toFontChar = buildToFontChar(ZapfDingbatsEncoding, getDingbatsGlyphsUnicode(), this.differences); + } else if (isStandardFont) { + const map = buildToFontChar(this.defaultEncoding, getGlyphsUnicode(), this.differences); + if (type === "CIDFontType2" && !this.cidEncoding.startsWith("Identity-") && !(this.toUnicode instanceof IdentityToUnicodeMap)) { + this.toUnicode.forEach(function (charCode, unicodeCharCode) { + map[+charCode] = unicodeCharCode; + }); + } + this.toFontChar = map; + } else { + const glyphsUnicodeMap = getGlyphsUnicode(); + const map = []; + this.toUnicode.forEach((charCode, unicodeCharCode) => { + if (!this.composite) { + const glyphName = this.differences[charCode] || this.defaultEncoding[charCode]; + const unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); + if (unicode !== -1) { + unicodeCharCode = unicode; + } + } + map[+charCode] = unicodeCharCode; + }); + if (this.composite && this.toUnicode instanceof IdentityToUnicodeMap) { + if (/Tahoma|Verdana/i.test(name)) { + applyStandardFontGlyphMap(map, getGlyphMapForStandardFonts()); + } + } + this.toFontChar = map; + } + amendFallbackToUnicode(properties); + this.loadedName = fontName.split("-")[0]; + } + checkAndRepair(name, font, properties) { + const VALID_TABLES = ["OS/2", "cmap", "head", "hhea", "hmtx", "maxp", "name", "post", "loca", "glyf", "fpgm", "prep", "cvt ", "CFF "]; + function readTables(file, numTables) { + const tables = Object.create(null); + tables["OS/2"] = null; + tables.cmap = null; + tables.head = null; + tables.hhea = null; + tables.hmtx = null; + tables.maxp = null; + tables.name = null; + tables.post = null; + for (let i = 0; i < numTables; i++) { + const table = readTableEntry(file); + if (!VALID_TABLES.includes(table.tag)) { + continue; + } + if (table.length === 0) { + continue; + } + tables[table.tag] = table; + } + return tables; + } + function readTableEntry(file) { + const tag = file.getString(4); + const checksum = file.getInt32() >>> 0; + const offset = file.getInt32() >>> 0; + const length = file.getInt32() >>> 0; + const previousPosition = file.pos; + file.pos = file.start || 0; + file.skip(offset); + const data = file.getBytes(length); + file.pos = previousPosition; + if (tag === "head") { + data[8] = data[9] = data[10] = data[11] = 0; + data[17] |= 0x20; + } + return { + tag, + checksum, + length, + offset, + data + }; + } + function readOpenTypeHeader(ttf) { + return { + version: ttf.getString(4), + numTables: ttf.getUint16(), + searchRange: ttf.getUint16(), + entrySelector: ttf.getUint16(), + rangeShift: ttf.getUint16() + }; + } + function readTrueTypeCollectionHeader(ttc) { + const ttcTag = ttc.getString(4); + assert(ttcTag === "ttcf", "Must be a TrueType Collection font."); + const majorVersion = ttc.getUint16(); + const minorVersion = ttc.getUint16(); + const numFonts = ttc.getInt32() >>> 0; + const offsetTable = []; + for (let i = 0; i < numFonts; i++) { + offsetTable.push(ttc.getInt32() >>> 0); + } + const header = { + ttcTag, + majorVersion, + minorVersion, + numFonts, + offsetTable + }; + switch (majorVersion) { + case 1: + return header; + case 2: + header.dsigTag = ttc.getInt32() >>> 0; + header.dsigLength = ttc.getInt32() >>> 0; + header.dsigOffset = ttc.getInt32() >>> 0; + return header; + } + throw new FormatError(`Invalid TrueType Collection majorVersion: ${majorVersion}.`); + } + function readTrueTypeCollectionData(ttc, fontName) { + const { + numFonts, + offsetTable + } = readTrueTypeCollectionHeader(ttc); + const fontNameParts = fontName.split("+"); + let fallbackData; + for (let i = 0; i < numFonts; i++) { + ttc.pos = (ttc.start || 0) + offsetTable[i]; + const potentialHeader = readOpenTypeHeader(ttc); + const potentialTables = readTables(ttc, potentialHeader.numTables); + if (!potentialTables.name) { + throw new FormatError('TrueType Collection font must contain a "name" table.'); + } + const [nameTable] = readNameTable(potentialTables.name); + for (let j = 0, jj = nameTable.length; j < jj; j++) { + for (let k = 0, kk = nameTable[j].length; k < kk; k++) { + const nameEntry = nameTable[j][k]?.replaceAll(/\s/g, ""); + if (!nameEntry) { + continue; + } + if (nameEntry === fontName) { + return { + header: potentialHeader, + tables: potentialTables + }; + } + if (fontNameParts.length < 2) { + continue; + } + for (const part of fontNameParts) { + if (nameEntry === part) { + fallbackData = { + name: part, + header: potentialHeader, + tables: potentialTables + }; + } + } + } + } + } + if (fallbackData) { + warn(`TrueType Collection does not contain "${fontName}" font, ` + `falling back to "${fallbackData.name}" font instead.`); + return { + header: fallbackData.header, + tables: fallbackData.tables + }; + } + throw new FormatError(`TrueType Collection does not contain "${fontName}" font.`); + } + function readCmapTable(cmap, file, isSymbolicFont, hasEncoding) { + if (!cmap) { + warn("No cmap table available."); + return { + platformId: -1, + encodingId: -1, + mappings: [], + hasShortCmap: false + }; + } + let segment; + let start = (file.start || 0) + cmap.offset; + file.pos = start; + file.skip(2); + const numTables = file.getUint16(); + let potentialTable; + let canBreak = false; + for (let i = 0; i < numTables; i++) { + const platformId = file.getUint16(); + const encodingId = file.getUint16(); + const offset = file.getInt32() >>> 0; + let useTable = false; + if (potentialTable?.platformId === platformId && potentialTable?.encodingId === encodingId) { + continue; + } + if (platformId === 0 && (encodingId === 0 || encodingId === 1 || encodingId === 3)) { + useTable = true; + } else if (platformId === 1 && encodingId === 0) { + useTable = true; + } else if (platformId === 3 && encodingId === 1 && (hasEncoding || !potentialTable)) { + useTable = true; + if (!isSymbolicFont) { + canBreak = true; + } + } else if (isSymbolicFont && platformId === 3 && encodingId === 0) { + useTable = true; + let correctlySorted = true; + if (i < numTables - 1) { + const nextBytes = file.peekBytes(2), + nextPlatformId = int16(nextBytes[0], nextBytes[1]); + if (nextPlatformId < platformId) { + correctlySorted = false; + } + } + if (correctlySorted) { + canBreak = true; + } + } + if (useTable) { + potentialTable = { + platformId, + encodingId, + offset + }; + } + if (canBreak) { + break; + } + } + if (potentialTable) { + file.pos = start + potentialTable.offset; + } + if (!potentialTable || file.peekByte() === -1) { + warn("Could not find a preferred cmap table."); + return { + platformId: -1, + encodingId: -1, + mappings: [], + hasShortCmap: false + }; + } + const format = file.getUint16(); + let hasShortCmap = false; + const mappings = []; + let j, glyphId; + if (format === 0) { + file.skip(2 + 2); + for (j = 0; j < 256; j++) { + const index = file.getByte(); + if (!index) { + continue; + } + mappings.push({ + charCode: j, + glyphId: index + }); + } + hasShortCmap = true; + } else if (format === 2) { + file.skip(2 + 2); + const subHeaderKeys = []; + let maxSubHeaderKey = 0; + for (let i = 0; i < 256; i++) { + const subHeaderKey = file.getUint16() >> 3; + subHeaderKeys.push(subHeaderKey); + maxSubHeaderKey = Math.max(subHeaderKey, maxSubHeaderKey); + } + const subHeaders = []; + for (let i = 0; i <= maxSubHeaderKey; i++) { + subHeaders.push({ + firstCode: file.getUint16(), + entryCount: file.getUint16(), + idDelta: signedInt16(file.getByte(), file.getByte()), + idRangePos: file.pos + file.getUint16() + }); + } + for (let i = 0; i < 256; i++) { + if (subHeaderKeys[i] === 0) { + file.pos = subHeaders[0].idRangePos + 2 * i; + glyphId = file.getUint16(); + mappings.push({ + charCode: i, + glyphId + }); + } else { + const s = subHeaders[subHeaderKeys[i]]; + for (j = 0; j < s.entryCount; j++) { + const charCode = (i << 8) + j + s.firstCode; + file.pos = s.idRangePos + 2 * j; + glyphId = file.getUint16(); + if (glyphId !== 0) { + glyphId = (glyphId + s.idDelta) % 65536; + } + mappings.push({ + charCode, + glyphId + }); + } + } + } + } else if (format === 4) { + file.skip(2 + 2); + const segCount = file.getUint16() >> 1; + file.skip(6); + const segments = []; + let segIndex; + for (segIndex = 0; segIndex < segCount; segIndex++) { + segments.push({ + end: file.getUint16() + }); + } + file.skip(2); + for (segIndex = 0; segIndex < segCount; segIndex++) { + segments[segIndex].start = file.getUint16(); + } + for (segIndex = 0; segIndex < segCount; segIndex++) { + segments[segIndex].delta = file.getUint16(); + } + let offsetsCount = 0, + offsetIndex; + for (segIndex = 0; segIndex < segCount; segIndex++) { + segment = segments[segIndex]; + const rangeOffset = file.getUint16(); + if (!rangeOffset) { + segment.offsetIndex = -1; + continue; + } + offsetIndex = (rangeOffset >> 1) - (segCount - segIndex); + segment.offsetIndex = offsetIndex; + offsetsCount = Math.max(offsetsCount, offsetIndex + segment.end - segment.start + 1); + } + const offsets = []; + for (j = 0; j < offsetsCount; j++) { + offsets.push(file.getUint16()); + } + for (segIndex = 0; segIndex < segCount; segIndex++) { + segment = segments[segIndex]; + start = segment.start; + const end = segment.end; + const delta = segment.delta; + offsetIndex = segment.offsetIndex; + for (j = start; j <= end; j++) { + if (j === 0xffff) { + continue; + } + glyphId = offsetIndex < 0 ? j : offsets[offsetIndex + j - start]; + glyphId = glyphId + delta & 0xffff; + mappings.push({ + charCode: j, + glyphId + }); + } + } + } else if (format === 6) { + file.skip(2 + 2); + const firstCode = file.getUint16(); + const entryCount = file.getUint16(); + for (j = 0; j < entryCount; j++) { + glyphId = file.getUint16(); + const charCode = firstCode + j; + mappings.push({ + charCode, + glyphId + }); + } + } else if (format === 12) { + file.skip(2 + 4 + 4); + const nGroups = file.getInt32() >>> 0; + for (j = 0; j < nGroups; j++) { + const startCharCode = file.getInt32() >>> 0; + const endCharCode = file.getInt32() >>> 0; + let glyphCode = file.getInt32() >>> 0; + for (let charCode = startCharCode; charCode <= endCharCode; charCode++) { + mappings.push({ + charCode, + glyphId: glyphCode++ + }); + } + } + } else { + warn("cmap table has unsupported format: " + format); + return { + platformId: -1, + encodingId: -1, + mappings: [], + hasShortCmap: false + }; + } + mappings.sort(function (a, b) { + return a.charCode - b.charCode; + }); + for (let i = 1; i < mappings.length; i++) { + if (mappings[i - 1].charCode === mappings[i].charCode) { + mappings.splice(i, 1); + i--; + } + } + return { + platformId: potentialTable.platformId, + encodingId: potentialTable.encodingId, + mappings, + hasShortCmap + }; + } + function sanitizeMetrics(file, header, metrics, headTable, numGlyphs, dupFirstEntry) { + if (!header) { + if (metrics) { + metrics.data = null; + } + return; + } + file.pos = (file.start || 0) + header.offset; + file.pos += 4; + file.pos += 2; + file.pos += 2; + file.pos += 2; + file.pos += 2; + file.pos += 2; + file.pos += 2; + file.pos += 2; + file.pos += 2; + file.pos += 2; + const caretOffset = file.getUint16(); + file.pos += 8; + file.pos += 2; + let numOfMetrics = file.getUint16(); + if (caretOffset !== 0) { + const macStyle = int16(headTable.data[44], headTable.data[45]); + if (!(macStyle & 2)) { + header.data[22] = 0; + header.data[23] = 0; + } + } + if (numOfMetrics > numGlyphs) { + info(`The numOfMetrics (${numOfMetrics}) should not be ` + `greater than the numGlyphs (${numGlyphs}).`); + numOfMetrics = numGlyphs; + header.data[34] = (numOfMetrics & 0xff00) >> 8; + header.data[35] = numOfMetrics & 0x00ff; + } + const numOfSidebearings = numGlyphs - numOfMetrics; + const numMissing = numOfSidebearings - (metrics.length - numOfMetrics * 4 >> 1); + if (numMissing > 0) { + const entries = new Uint8Array(metrics.length + numMissing * 2); + entries.set(metrics.data); + if (dupFirstEntry) { + entries[metrics.length] = metrics.data[2]; + entries[metrics.length + 1] = metrics.data[3]; + } + metrics.data = entries; + } + } + function sanitizeGlyph(source, sourceStart, sourceEnd, dest, destStart, hintsValid) { + const glyphProfile = { + length: 0, + sizeOfInstructions: 0 + }; + if (sourceStart < 0 || sourceStart >= source.length || sourceEnd > source.length || sourceEnd - sourceStart <= 12) { + return glyphProfile; + } + const glyf = source.subarray(sourceStart, sourceEnd); + const xMin = signedInt16(glyf[2], glyf[3]); + const yMin = signedInt16(glyf[4], glyf[5]); + const xMax = signedInt16(glyf[6], glyf[7]); + const yMax = signedInt16(glyf[8], glyf[9]); + if (xMin > xMax) { + writeSignedInt16(glyf, 2, xMax); + writeSignedInt16(glyf, 6, xMin); + } + if (yMin > yMax) { + writeSignedInt16(glyf, 4, yMax); + writeSignedInt16(glyf, 8, yMin); + } + const contoursCount = signedInt16(glyf[0], glyf[1]); + if (contoursCount < 0) { + if (contoursCount < -1) { + return glyphProfile; + } + dest.set(glyf, destStart); + glyphProfile.length = glyf.length; + return glyphProfile; + } + let i, + j = 10, + flagsCount = 0; + for (i = 0; i < contoursCount; i++) { + const endPoint = glyf[j] << 8 | glyf[j + 1]; + flagsCount = endPoint + 1; + j += 2; + } + const instructionsStart = j; + const instructionsLength = glyf[j] << 8 | glyf[j + 1]; + glyphProfile.sizeOfInstructions = instructionsLength; + j += 2 + instructionsLength; + const instructionsEnd = j; + let coordinatesLength = 0; + for (i = 0; i < flagsCount; i++) { + const flag = glyf[j++]; + if (flag & 0xc0) { + glyf[j - 1] = flag & 0x3f; + } + let xLength = 2; + if (flag & 2) { + xLength = 1; + } else if (flag & 16) { + xLength = 0; + } + let yLength = 2; + if (flag & 4) { + yLength = 1; + } else if (flag & 32) { + yLength = 0; + } + const xyLength = xLength + yLength; + coordinatesLength += xyLength; + if (flag & 8) { + const repeat = glyf[j++]; + if (repeat === 0) { + glyf[j - 1] ^= 8; + } + i += repeat; + coordinatesLength += repeat * xyLength; + } + } + if (coordinatesLength === 0) { + return glyphProfile; + } + let glyphDataLength = j + coordinatesLength; + if (glyphDataLength > glyf.length) { + return glyphProfile; + } + if (!hintsValid && instructionsLength > 0) { + dest.set(glyf.subarray(0, instructionsStart), destStart); + dest.set([0, 0], destStart + instructionsStart); + dest.set(glyf.subarray(instructionsEnd, glyphDataLength), destStart + instructionsStart + 2); + glyphDataLength -= instructionsLength; + if (glyf.length - glyphDataLength > 3) { + glyphDataLength = glyphDataLength + 3 & ~3; + } + glyphProfile.length = glyphDataLength; + return glyphProfile; + } + if (glyf.length - glyphDataLength > 3) { + glyphDataLength = glyphDataLength + 3 & ~3; + dest.set(glyf.subarray(0, glyphDataLength), destStart); + glyphProfile.length = glyphDataLength; + return glyphProfile; + } + dest.set(glyf, destStart); + glyphProfile.length = glyf.length; + return glyphProfile; + } + function sanitizeHead(head, numGlyphs, locaLength) { + const data = head.data; + const version = int32(data[0], data[1], data[2], data[3]); + if (version >> 16 !== 1) { + info("Attempting to fix invalid version in head table: " + version); + data[0] = 0; + data[1] = 1; + data[2] = 0; + data[3] = 0; + } + const indexToLocFormat = int16(data[50], data[51]); + if (indexToLocFormat < 0 || indexToLocFormat > 1) { + info("Attempting to fix invalid indexToLocFormat in head table: " + indexToLocFormat); + const numGlyphsPlusOne = numGlyphs + 1; + if (locaLength === numGlyphsPlusOne << 1) { + data[50] = 0; + data[51] = 0; + } else if (locaLength === numGlyphsPlusOne << 2) { + data[50] = 0; + data[51] = 1; + } else { + throw new FormatError("Could not fix indexToLocFormat: " + indexToLocFormat); + } + } + } + function sanitizeGlyphLocations(loca, glyf, numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry, maxSizeOfInstructions) { + let itemSize, itemDecode, itemEncode; + if (isGlyphLocationsLong) { + itemSize = 4; + itemDecode = function fontItemDecodeLong(data, offset) { + return data[offset] << 24 | data[offset + 1] << 16 | data[offset + 2] << 8 | data[offset + 3]; + }; + itemEncode = function fontItemEncodeLong(data, offset, value) { + data[offset] = value >>> 24 & 0xff; + data[offset + 1] = value >> 16 & 0xff; + data[offset + 2] = value >> 8 & 0xff; + data[offset + 3] = value & 0xff; + }; + } else { + itemSize = 2; + itemDecode = function fontItemDecode(data, offset) { + return data[offset] << 9 | data[offset + 1] << 1; + }; + itemEncode = function fontItemEncode(data, offset, value) { + data[offset] = value >> 9 & 0xff; + data[offset + 1] = value >> 1 & 0xff; + }; + } + const numGlyphsOut = dupFirstEntry ? numGlyphs + 1 : numGlyphs; + const locaDataSize = itemSize * (1 + numGlyphsOut); + const locaData = new Uint8Array(locaDataSize); + locaData.set(loca.data.subarray(0, locaDataSize)); + loca.data = locaData; + const oldGlyfData = glyf.data; + const oldGlyfDataLength = oldGlyfData.length; + const newGlyfData = new Uint8Array(oldGlyfDataLength); + let i, j; + const locaEntries = []; + for (i = 0, j = 0; i < numGlyphs + 1; i++, j += itemSize) { + let offset = itemDecode(locaData, j); + if (offset > oldGlyfDataLength) { + offset = oldGlyfDataLength; + } + locaEntries.push({ + index: i, + offset, + endOffset: 0 + }); + } + locaEntries.sort((a, b) => { + return a.offset - b.offset; + }); + for (i = 0; i < numGlyphs; i++) { + locaEntries[i].endOffset = locaEntries[i + 1].offset; + } + locaEntries.sort((a, b) => { + return a.index - b.index; + }); + for (i = 0; i < numGlyphs; i++) { + const { + offset, + endOffset + } = locaEntries[i]; + if (offset !== 0 || endOffset !== 0) { + break; + } + const nextOffset = locaEntries[i + 1].offset; + if (nextOffset === 0) { + continue; + } + locaEntries[i].endOffset = nextOffset; + break; + } + const missingGlyphs = Object.create(null); + let writeOffset = 0; + itemEncode(locaData, 0, writeOffset); + for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) { + const glyphProfile = sanitizeGlyph(oldGlyfData, locaEntries[i].offset, locaEntries[i].endOffset, newGlyfData, writeOffset, hintsValid); + const newLength = glyphProfile.length; + if (newLength === 0) { + missingGlyphs[i] = true; + } + if (glyphProfile.sizeOfInstructions > maxSizeOfInstructions) { + maxSizeOfInstructions = glyphProfile.sizeOfInstructions; + } + writeOffset += newLength; + itemEncode(locaData, j, writeOffset); + } + if (writeOffset === 0) { + const simpleGlyph = new Uint8Array([0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0]); + for (i = 0, j = itemSize; i < numGlyphsOut; i++, j += itemSize) { + itemEncode(locaData, j, simpleGlyph.length); + } + glyf.data = simpleGlyph; + } else if (dupFirstEntry) { + const firstEntryLength = itemDecode(locaData, itemSize); + if (newGlyfData.length > firstEntryLength + writeOffset) { + glyf.data = newGlyfData.subarray(0, firstEntryLength + writeOffset); + } else { + glyf.data = new Uint8Array(firstEntryLength + writeOffset); + glyf.data.set(newGlyfData.subarray(0, writeOffset)); + } + glyf.data.set(newGlyfData.subarray(0, firstEntryLength), writeOffset); + itemEncode(loca.data, locaData.length - itemSize, writeOffset + firstEntryLength); + } else { + glyf.data = newGlyfData.subarray(0, writeOffset); + } + return { + missingGlyphs, + maxSizeOfInstructions + }; + } + function readPostScriptTable(post, propertiesObj, maxpNumGlyphs) { + const start = (font.start || 0) + post.offset; + font.pos = start; + const length = post.length, + end = start + length; + const version = font.getInt32(); + font.skip(28); + let glyphNames; + let valid = true; + let i; + switch (version) { + case 0x00010000: + glyphNames = MacStandardGlyphOrdering; + break; + case 0x00020000: + const numGlyphs = font.getUint16(); + if (numGlyphs !== maxpNumGlyphs) { + valid = false; + break; + } + const glyphNameIndexes = []; + for (i = 0; i < numGlyphs; ++i) { + const index = font.getUint16(); + if (index >= 32768) { + valid = false; + break; + } + glyphNameIndexes.push(index); + } + if (!valid) { + break; + } + const customNames = [], + strBuf = []; + while (font.pos < end) { + const stringLength = font.getByte(); + strBuf.length = stringLength; + for (i = 0; i < stringLength; ++i) { + strBuf[i] = String.fromCharCode(font.getByte()); + } + customNames.push(strBuf.join("")); + } + glyphNames = []; + for (i = 0; i < numGlyphs; ++i) { + const j = glyphNameIndexes[i]; + if (j < 258) { + glyphNames.push(MacStandardGlyphOrdering[j]); + continue; + } + glyphNames.push(customNames[j - 258]); + } + break; + case 0x00030000: + break; + default: + warn("Unknown/unsupported post table version " + version); + valid = false; + if (propertiesObj.defaultEncoding) { + glyphNames = propertiesObj.defaultEncoding; + } + break; + } + propertiesObj.glyphNames = glyphNames; + return valid; + } + function readNameTable(nameTable) { + const start = (font.start || 0) + nameTable.offset; + font.pos = start; + const names = [[], []], + records = []; + const length = nameTable.length, + end = start + length; + const format = font.getUint16(); + const FORMAT_0_HEADER_LENGTH = 6; + if (format !== 0 || length < FORMAT_0_HEADER_LENGTH) { + return [names, records]; + } + const numRecords = font.getUint16(); + const stringsStart = font.getUint16(); + const NAME_RECORD_LENGTH = 12; + let i, ii; + for (i = 0; i < numRecords && font.pos + NAME_RECORD_LENGTH <= end; i++) { + const r = { + platform: font.getUint16(), + encoding: font.getUint16(), + language: font.getUint16(), + name: font.getUint16(), + length: font.getUint16(), + offset: font.getUint16() + }; + if (isMacNameRecord(r) || isWinNameRecord(r)) { + records.push(r); + } + } + for (i = 0, ii = records.length; i < ii; i++) { + const record = records[i]; + if (record.length <= 0) { + continue; + } + const pos = start + stringsStart + record.offset; + if (pos + record.length > end) { + continue; + } + font.pos = pos; + const nameIndex = record.name; + if (record.encoding) { + let str = ""; + for (let j = 0, jj = record.length; j < jj; j += 2) { + str += String.fromCharCode(font.getUint16()); + } + names[1][nameIndex] = str; + } else { + names[0][nameIndex] = font.getString(record.length); + } + } + return [names, records]; + } + const TTOpsStackDeltas = [0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, 0, 0, -2, -5, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, -1, 1, -1, -999, 0, 1, 0, -1, -2, 0, -1, -2, -1, -1, 0, -1, -1, 0, 0, -999, -999, -1, -1, -1, -1, -2, -999, -2, -2, -999, 0, -2, -2, 0, 0, -2, 0, -2, 0, 0, 0, -2, -1, -1, 1, 1, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, 0, -999, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -999, -999, -999, -999, -999, -1, -1, -2, -2, 0, 0, 0, 0, -1, -1, -999, -2, -2, 0, 0, -1, -2, -2, 0, 0, 0, -1, -1, -1, -2]; + function sanitizeTTProgram(table, ttContext) { + let data = table.data; + let i = 0, + j, + n, + b, + funcId, + pc, + lastEndf = 0, + lastDeff = 0; + const stack = []; + const callstack = []; + const functionsCalled = []; + let tooComplexToFollowFunctions = ttContext.tooComplexToFollowFunctions; + let inFDEF = false, + ifLevel = 0, + inELSE = 0; + for (let ii = data.length; i < ii;) { + const op = data[i++]; + if (op === 0x40) { + n = data[i++]; + if (inFDEF || inELSE) { + i += n; + } else { + for (j = 0; j < n; j++) { + stack.push(data[i++]); + } + } + } else if (op === 0x41) { + n = data[i++]; + if (inFDEF || inELSE) { + i += n * 2; + } else { + for (j = 0; j < n; j++) { + b = data[i++]; + stack.push(b << 8 | data[i++]); + } + } + } else if ((op & 0xf8) === 0xb0) { + n = op - 0xb0 + 1; + if (inFDEF || inELSE) { + i += n; + } else { + for (j = 0; j < n; j++) { + stack.push(data[i++]); + } + } + } else if ((op & 0xf8) === 0xb8) { + n = op - 0xb8 + 1; + if (inFDEF || inELSE) { + i += n * 2; + } else { + for (j = 0; j < n; j++) { + b = data[i++]; + stack.push(b << 8 | data[i++]); + } + } + } else if (op === 0x2b && !tooComplexToFollowFunctions) { + if (!inFDEF && !inELSE) { + funcId = stack.at(-1); + if (isNaN(funcId)) { + info("TT: CALL empty stack (or invalid entry)."); + } else { + ttContext.functionsUsed[funcId] = true; + if (funcId in ttContext.functionsStackDeltas) { + const newStackLength = stack.length + ttContext.functionsStackDeltas[funcId]; + if (newStackLength < 0) { + warn("TT: CALL invalid functions stack delta."); + ttContext.hintsValid = false; + return; + } + stack.length = newStackLength; + } else if (funcId in ttContext.functionsDefined && !functionsCalled.includes(funcId)) { + callstack.push({ + data, + i, + stackTop: stack.length - 1 + }); + functionsCalled.push(funcId); + pc = ttContext.functionsDefined[funcId]; + if (!pc) { + warn("TT: CALL non-existent function"); + ttContext.hintsValid = false; + return; + } + data = pc.data; + i = pc.i; + } + } + } + } else if (op === 0x2c && !tooComplexToFollowFunctions) { + if (inFDEF || inELSE) { + warn("TT: nested FDEFs not allowed"); + tooComplexToFollowFunctions = true; + } + inFDEF = true; + lastDeff = i; + funcId = stack.pop(); + ttContext.functionsDefined[funcId] = { + data, + i + }; + } else if (op === 0x2d) { + if (inFDEF) { + inFDEF = false; + lastEndf = i; + } else { + pc = callstack.pop(); + if (!pc) { + warn("TT: ENDF bad stack"); + ttContext.hintsValid = false; + return; + } + funcId = functionsCalled.pop(); + data = pc.data; + i = pc.i; + ttContext.functionsStackDeltas[funcId] = stack.length - pc.stackTop; + } + } else if (op === 0x89) { + if (inFDEF || inELSE) { + warn("TT: nested IDEFs not allowed"); + tooComplexToFollowFunctions = true; + } + inFDEF = true; + lastDeff = i; + } else if (op === 0x58) { + ++ifLevel; + } else if (op === 0x1b) { + inELSE = ifLevel; + } else if (op === 0x59) { + if (inELSE === ifLevel) { + inELSE = 0; + } + --ifLevel; + } else if (op === 0x1c) { + if (!inFDEF && !inELSE) { + const offset = stack.at(-1); + if (offset > 0) { + i += offset - 1; + } + } + } + if (!inFDEF && !inELSE) { + let stackDelta = 0; + if (op <= 0x8e) { + stackDelta = TTOpsStackDeltas[op]; + } else if (op >= 0xc0 && op <= 0xdf) { + stackDelta = -1; + } else if (op >= 0xe0) { + stackDelta = -2; + } + if (op >= 0x71 && op <= 0x75) { + n = stack.pop(); + if (!isNaN(n)) { + stackDelta = -n * 2; + } + } + while (stackDelta < 0 && stack.length > 0) { + stack.pop(); + stackDelta++; + } + while (stackDelta > 0) { + stack.push(NaN); + stackDelta--; + } + } + } + ttContext.tooComplexToFollowFunctions = tooComplexToFollowFunctions; + const content = [data]; + if (i > data.length) { + content.push(new Uint8Array(i - data.length)); + } + if (lastDeff > lastEndf) { + warn("TT: complementing a missing function tail"); + content.push(new Uint8Array([0x22, 0x2d])); + } + foldTTTable(table, content); + } + function checkInvalidFunctions(ttContext, maxFunctionDefs) { + if (ttContext.tooComplexToFollowFunctions) { + return; + } + if (ttContext.functionsDefined.length > maxFunctionDefs) { + warn("TT: more functions defined than expected"); + ttContext.hintsValid = false; + return; + } + for (let j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) { + if (j > maxFunctionDefs) { + warn("TT: invalid function id: " + j); + ttContext.hintsValid = false; + return; + } + if (ttContext.functionsUsed[j] && !ttContext.functionsDefined[j]) { + warn("TT: undefined function: " + j); + ttContext.hintsValid = false; + return; + } + } + } + function foldTTTable(table, content) { + if (content.length > 1) { + let newLength = 0; + let j, jj; + for (j = 0, jj = content.length; j < jj; j++) { + newLength += content[j].length; + } + newLength = newLength + 3 & ~3; + const result = new Uint8Array(newLength); + let pos = 0; + for (j = 0, jj = content.length; j < jj; j++) { + result.set(content[j], pos); + pos += content[j].length; + } + table.data = result; + table.length = newLength; + } + } + function sanitizeTTPrograms(fpgm, prep, cvt, maxFunctionDefs) { + const ttContext = { + functionsDefined: [], + functionsUsed: [], + functionsStackDeltas: [], + tooComplexToFollowFunctions: false, + hintsValid: true + }; + if (fpgm) { + sanitizeTTProgram(fpgm, ttContext); + } + if (prep) { + sanitizeTTProgram(prep, ttContext); + } + if (fpgm) { + checkInvalidFunctions(ttContext, maxFunctionDefs); + } + if (cvt && cvt.length & 1) { + const cvtData = new Uint8Array(cvt.length + 1); + cvtData.set(cvt.data); + cvt.data = cvtData; + } + return ttContext.hintsValid; + } + font = new Stream(new Uint8Array(font.getBytes())); + let header, tables; + if (isTrueTypeCollectionFile(font)) { + const ttcData = readTrueTypeCollectionData(font, this.name); + header = ttcData.header; + tables = ttcData.tables; + } else { + header = readOpenTypeHeader(font); + tables = readTables(font, header.numTables); + } + let cff, cffFile; + const isTrueType = !tables["CFF "]; + if (!isTrueType) { + const isComposite = properties.composite && (properties.cidToGidMap?.length > 0 || !(properties.cMap instanceof IdentityCMap)); + if (header.version === "OTTO" && !isComposite || !tables.head || !tables.hhea || !tables.maxp || !tables.post) { + cffFile = new Stream(tables["CFF "].data); + cff = new CFFFont(cffFile, properties); + adjustWidths(properties); + return this.convert(name, cff, properties); + } + delete tables.glyf; + delete tables.loca; + delete tables.fpgm; + delete tables.prep; + delete tables["cvt "]; + this.isOpenType = true; + } else { + if (!tables.loca) { + throw new FormatError('Required "loca" table is not found'); + } + if (!tables.glyf) { + warn('Required "glyf" table is not found -- trying to recover.'); + tables.glyf = { + tag: "glyf", + data: new Uint8Array(0) + }; + } + this.isOpenType = false; + } + if (!tables.maxp) { + throw new FormatError('Required "maxp" table is not found'); + } + font.pos = (font.start || 0) + tables.maxp.offset; + let version = font.getInt32(); + const numGlyphs = font.getUint16(); + if (version !== 0x00010000 && version !== 0x00005000) { + if (tables.maxp.length === 6) { + version = 0x0005000; + } else if (tables.maxp.length >= 32) { + version = 0x00010000; + } else { + throw new FormatError(`"maxp" table has a wrong version number`); + } + writeUint32(tables.maxp.data, 0, version); + } + if (properties.scaleFactors?.length === numGlyphs && isTrueType) { + const { + scaleFactors + } = properties; + const isGlyphLocationsLong = int16(tables.head.data[50], tables.head.data[51]); + const glyphs = new GlyfTable({ + glyfTable: tables.glyf.data, + isGlyphLocationsLong, + locaTable: tables.loca.data, + numGlyphs + }); + glyphs.scale(scaleFactors); + const { + glyf, + loca, + isLocationLong + } = glyphs.write(); + tables.glyf.data = glyf; + tables.loca.data = loca; + if (isLocationLong !== !!isGlyphLocationsLong) { + tables.head.data[50] = 0; + tables.head.data[51] = isLocationLong ? 1 : 0; + } + const metrics = tables.hmtx.data; + for (let i = 0; i < numGlyphs; i++) { + const j = 4 * i; + const advanceWidth = Math.round(scaleFactors[i] * int16(metrics[j], metrics[j + 1])); + metrics[j] = advanceWidth >> 8 & 0xff; + metrics[j + 1] = advanceWidth & 0xff; + const lsb = Math.round(scaleFactors[i] * signedInt16(metrics[j + 2], metrics[j + 3])); + writeSignedInt16(metrics, j + 2, lsb); + } + } + let numGlyphsOut = numGlyphs + 1; + let dupFirstEntry = true; + if (numGlyphsOut > 0xffff) { + dupFirstEntry = false; + numGlyphsOut = numGlyphs; + warn("Not enough space in glyfs to duplicate first glyph."); + } + let maxFunctionDefs = 0; + let maxSizeOfInstructions = 0; + if (version >= 0x00010000 && tables.maxp.length >= 32) { + font.pos += 8; + const maxZones = font.getUint16(); + if (maxZones > 2) { + tables.maxp.data[14] = 0; + tables.maxp.data[15] = 2; + } + font.pos += 4; + maxFunctionDefs = font.getUint16(); + font.pos += 4; + maxSizeOfInstructions = font.getUint16(); + } + tables.maxp.data[4] = numGlyphsOut >> 8; + tables.maxp.data[5] = numGlyphsOut & 255; + const hintsValid = sanitizeTTPrograms(tables.fpgm, tables.prep, tables["cvt "], maxFunctionDefs); + if (!hintsValid) { + delete tables.fpgm; + delete tables.prep; + delete tables["cvt "]; + } + sanitizeMetrics(font, tables.hhea, tables.hmtx, tables.head, numGlyphsOut, dupFirstEntry); + if (!tables.head) { + throw new FormatError('Required "head" table is not found'); + } + sanitizeHead(tables.head, numGlyphs, isTrueType ? tables.loca.length : 0); + let missingGlyphs = Object.create(null); + if (isTrueType) { + const isGlyphLocationsLong = int16(tables.head.data[50], tables.head.data[51]); + const glyphsInfo = sanitizeGlyphLocations(tables.loca, tables.glyf, numGlyphs, isGlyphLocationsLong, hintsValid, dupFirstEntry, maxSizeOfInstructions); + missingGlyphs = glyphsInfo.missingGlyphs; + if (version >= 0x00010000 && tables.maxp.length >= 32) { + tables.maxp.data[26] = glyphsInfo.maxSizeOfInstructions >> 8; + tables.maxp.data[27] = glyphsInfo.maxSizeOfInstructions & 255; + } + } + if (!tables.hhea) { + throw new FormatError('Required "hhea" table is not found'); + } + if (tables.hhea.data[10] === 0 && tables.hhea.data[11] === 0) { + tables.hhea.data[10] = 0xff; + tables.hhea.data[11] = 0xff; + } + const metricsOverride = { + unitsPerEm: int16(tables.head.data[18], tables.head.data[19]), + yMax: signedInt16(tables.head.data[42], tables.head.data[43]), + yMin: signedInt16(tables.head.data[38], tables.head.data[39]), + ascent: signedInt16(tables.hhea.data[4], tables.hhea.data[5]), + descent: signedInt16(tables.hhea.data[6], tables.hhea.data[7]), + lineGap: signedInt16(tables.hhea.data[8], tables.hhea.data[9]) + }; + this.ascent = metricsOverride.ascent / metricsOverride.unitsPerEm; + this.descent = metricsOverride.descent / metricsOverride.unitsPerEm; + this.lineGap = metricsOverride.lineGap / metricsOverride.unitsPerEm; + if (this.cssFontInfo?.lineHeight) { + this.lineHeight = this.cssFontInfo.metrics.lineHeight; + this.lineGap = this.cssFontInfo.metrics.lineGap; + } else { + this.lineHeight = this.ascent - this.descent + this.lineGap; + } + if (tables.post) { + readPostScriptTable(tables.post, properties, numGlyphs); + } + tables.post = { + tag: "post", + data: createPostTable(properties) + }; + const charCodeToGlyphId = []; + function hasGlyph(glyphId) { + return !missingGlyphs[glyphId]; + } + if (properties.composite) { + const cidToGidMap = properties.cidToGidMap || []; + const isCidToGidMapEmpty = cidToGidMap.length === 0; + properties.cMap.forEach(function (charCode, cid) { + if (typeof cid === "string") { + cid = convertCidString(charCode, cid, true); + } + if (cid > 0xffff) { + throw new FormatError("Max size of CID is 65,535"); + } + let glyphId = -1; + if (isCidToGidMapEmpty) { + glyphId = cid; + } else if (cidToGidMap[cid] !== undefined) { + glyphId = cidToGidMap[cid]; + } + if (glyphId >= 0 && glyphId < numGlyphs && hasGlyph(glyphId)) { + charCodeToGlyphId[charCode] = glyphId; + } + }); + } else { + const cmapTable = readCmapTable(tables.cmap, font, this.isSymbolicFont, properties.hasEncoding); + const cmapPlatformId = cmapTable.platformId; + const cmapEncodingId = cmapTable.encodingId; + const cmapMappings = cmapTable.mappings; + let baseEncoding = [], + forcePostTable = false; + if (properties.hasEncoding && (properties.baseEncodingName === "MacRomanEncoding" || properties.baseEncodingName === "WinAnsiEncoding")) { + baseEncoding = getEncoding(properties.baseEncodingName); + } + if (properties.hasEncoding && !this.isSymbolicFont && (cmapPlatformId === 3 && cmapEncodingId === 1 || cmapPlatformId === 1 && cmapEncodingId === 0)) { + const glyphsUnicodeMap = getGlyphsUnicode(); + for (let charCode = 0; charCode < 256; charCode++) { + let glyphName; + if (this.differences[charCode] !== undefined) { + glyphName = this.differences[charCode]; + } else if (baseEncoding.length && baseEncoding[charCode] !== "") { + glyphName = baseEncoding[charCode]; + } else { + glyphName = StandardEncoding[charCode]; + } + if (!glyphName) { + continue; + } + const standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap); + let unicodeOrCharCode; + if (cmapPlatformId === 3 && cmapEncodingId === 1) { + unicodeOrCharCode = glyphsUnicodeMap[standardGlyphName]; + } else if (cmapPlatformId === 1 && cmapEncodingId === 0) { + unicodeOrCharCode = MacRomanEncoding.indexOf(standardGlyphName); + } + if (unicodeOrCharCode === undefined) { + if (!properties.glyphNames && properties.hasIncludedToUnicodeMap && !(this.toUnicode instanceof IdentityToUnicodeMap)) { + const unicode = this.toUnicode.get(charCode); + if (unicode) { + unicodeOrCharCode = unicode.codePointAt(0); + } + } + if (unicodeOrCharCode === undefined) { + continue; + } + } + for (const mapping of cmapMappings) { + if (mapping.charCode !== unicodeOrCharCode) { + continue; + } + charCodeToGlyphId[charCode] = mapping.glyphId; + break; + } + } + } else if (cmapPlatformId === 0) { + for (const mapping of cmapMappings) { + charCodeToGlyphId[mapping.charCode] = mapping.glyphId; + } + forcePostTable = true; + } else { + for (const mapping of cmapMappings) { + let charCode = mapping.charCode; + if (cmapPlatformId === 3 && charCode >= 0xf000 && charCode <= 0xf0ff) { + charCode &= 0xff; + } + charCodeToGlyphId[charCode] = mapping.glyphId; + } + } + if (properties.glyphNames && (baseEncoding.length || this.differences.length)) { + for (let i = 0; i < 256; ++i) { + if (!forcePostTable && charCodeToGlyphId[i] !== undefined) { + continue; + } + const glyphName = this.differences[i] || baseEncoding[i]; + if (!glyphName) { + continue; + } + const glyphId = properties.glyphNames.indexOf(glyphName); + if (glyphId > 0 && hasGlyph(glyphId)) { + charCodeToGlyphId[i] = glyphId; + } + } + } + } + if (charCodeToGlyphId.length === 0) { + charCodeToGlyphId[0] = 0; + } + let glyphZeroId = numGlyphsOut - 1; + if (!dupFirstEntry) { + glyphZeroId = 0; + } + if (!properties.cssFontInfo) { + const newMapping = adjustMapping(charCodeToGlyphId, hasGlyph, glyphZeroId, this.toUnicode); + this.toFontChar = newMapping.toFontChar; + tables.cmap = { + tag: "cmap", + data: createCmapTable(newMapping.charCodeToGlyphId, newMapping.toUnicodeExtraMap, numGlyphsOut) + }; + if (!tables["OS/2"] || !validateOS2Table(tables["OS/2"], font)) { + tables["OS/2"] = { + tag: "OS/2", + data: createOS2Table(properties, newMapping.charCodeToGlyphId, metricsOverride) + }; + } + } + if (!isTrueType) { + try { + cffFile = new Stream(tables["CFF "].data); + const parser = new CFFParser(cffFile, properties, SEAC_ANALYSIS_ENABLED); + cff = parser.parse(); + cff.duplicateFirstGlyph(); + const compiler = new CFFCompiler(cff); + tables["CFF "].data = compiler.compile(); + } catch { + warn("Failed to compile font " + properties.loadedName); + } + } + if (!tables.name) { + tables.name = { + tag: "name", + data: createNameTable(this.name) + }; + } else { + const [namePrototype, nameRecords] = readNameTable(tables.name); + tables.name.data = createNameTable(name, namePrototype); + this.psName = namePrototype[0][6] || null; + if (!properties.composite) { + adjustTrueTypeToUnicode(properties, this.isSymbolicFont, nameRecords); + } + } + const builder = new OpenTypeFileBuilder(header.version); + for (const tableTag in tables) { + builder.addTable(tableTag, tables[tableTag].data); + } + return builder.toArray(); + } + convert(fontName, font, properties) { + properties.fixedPitch = false; + if (properties.builtInEncoding) { + adjustType1ToUnicode(properties, properties.builtInEncoding); + } + let glyphZeroId = 1; + if (font instanceof CFFFont) { + glyphZeroId = font.numGlyphs - 1; + } + const mapping = font.getGlyphMapping(properties); + let newMapping = null; + let newCharCodeToGlyphId = mapping; + let toUnicodeExtraMap = null; + if (!properties.cssFontInfo) { + newMapping = adjustMapping(mapping, font.hasGlyphId.bind(font), glyphZeroId, this.toUnicode); + this.toFontChar = newMapping.toFontChar; + newCharCodeToGlyphId = newMapping.charCodeToGlyphId; + toUnicodeExtraMap = newMapping.toUnicodeExtraMap; + } + const numGlyphs = font.numGlyphs; + function getCharCodes(charCodeToGlyphId, glyphId) { + let charCodes = null; + for (const charCode in charCodeToGlyphId) { + if (glyphId === charCodeToGlyphId[charCode]) { + (charCodes ||= []).push(charCode | 0); + } + } + return charCodes; + } + function createCharCode(charCodeToGlyphId, glyphId) { + for (const charCode in charCodeToGlyphId) { + if (glyphId === charCodeToGlyphId[charCode]) { + return charCode | 0; + } + } + newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode] = glyphId; + return newMapping.nextAvailableFontCharCode++; + } + const seacs = font.seacs; + if (newMapping && SEAC_ANALYSIS_ENABLED && seacs?.length) { + const matrix = properties.fontMatrix || FONT_IDENTITY_MATRIX; + const charset = font.getCharset(); + const seacMap = Object.create(null); + for (let glyphId in seacs) { + glyphId |= 0; + const seac = seacs[glyphId]; + const baseGlyphName = StandardEncoding[seac[2]]; + const accentGlyphName = StandardEncoding[seac[3]]; + const baseGlyphId = charset.indexOf(baseGlyphName); + const accentGlyphId = charset.indexOf(accentGlyphName); + if (baseGlyphId < 0 || accentGlyphId < 0) { + continue; + } + const accentOffset = { + x: seac[0] * matrix[0] + seac[1] * matrix[2] + matrix[4], + y: seac[0] * matrix[1] + seac[1] * matrix[3] + matrix[5] + }; + const charCodes = getCharCodes(mapping, glyphId); + if (!charCodes) { + continue; + } + for (const charCode of charCodes) { + const charCodeToGlyphId = newMapping.charCodeToGlyphId; + const baseFontCharCode = createCharCode(charCodeToGlyphId, baseGlyphId); + const accentFontCharCode = createCharCode(charCodeToGlyphId, accentGlyphId); + seacMap[charCode] = { + baseFontCharCode, + accentFontCharCode, + accentOffset + }; + } + } + properties.seacMap = seacMap; + } + const unitsPerEm = 1 / (properties.fontMatrix || FONT_IDENTITY_MATRIX)[0]; + const builder = new OpenTypeFileBuilder("\x4F\x54\x54\x4F"); + builder.addTable("CFF ", font.data); + builder.addTable("OS/2", createOS2Table(properties, newCharCodeToGlyphId)); + builder.addTable("cmap", createCmapTable(newCharCodeToGlyphId, toUnicodeExtraMap, numGlyphs)); + builder.addTable("head", "\x00\x01\x00\x00" + "\x00\x00\x10\x00" + "\x00\x00\x00\x00" + "\x5F\x0F\x3C\xF5" + "\x00\x00" + safeString16(unitsPerEm) + "\x00\x00\x00\x00\x9e\x0b\x7e\x27" + "\x00\x00\x00\x00\x9e\x0b\x7e\x27" + "\x00\x00" + safeString16(properties.descent) + "\x0F\xFF" + safeString16(properties.ascent) + string16(properties.italicAngle ? 2 : 0) + "\x00\x11" + "\x00\x00" + "\x00\x00" + "\x00\x00"); + builder.addTable("hhea", "\x00\x01\x00\x00" + safeString16(properties.ascent) + safeString16(properties.descent) + "\x00\x00" + "\xFF\xFF" + "\x00\x00" + "\x00\x00" + "\x00\x00" + safeString16(properties.capHeight) + safeString16(Math.tan(properties.italicAngle) * properties.xHeight) + "\x00\x00" + "\x00\x00" + "\x00\x00" + "\x00\x00" + "\x00\x00" + "\x00\x00" + string16(numGlyphs)); + builder.addTable("hmtx", function fontFieldsHmtx() { + const charstrings = font.charstrings; + const cffWidths = font.cff ? font.cff.widths : null; + let hmtx = "\x00\x00\x00\x00"; + for (let i = 1, ii = numGlyphs; i < ii; i++) { + let width = 0; + if (charstrings) { + const charstring = charstrings[i - 1]; + width = "width" in charstring ? charstring.width : 0; + } else if (cffWidths) { + width = Math.ceil(cffWidths[i] || 0); + } + hmtx += string16(width) + string16(0); + } + return hmtx; + }()); + builder.addTable("maxp", "\x00\x00\x50\x00" + string16(numGlyphs)); + builder.addTable("name", createNameTable(fontName)); + builder.addTable("post", createPostTable(properties)); + return builder.toArray(); + } + get spaceWidth() { + const possibleSpaceReplacements = ["space", "minus", "one", "i", "I"]; + let width; + for (const glyphName of possibleSpaceReplacements) { + if (glyphName in this.widths) { + width = this.widths[glyphName]; + break; + } + const glyphsUnicodeMap = getGlyphsUnicode(); + const glyphUnicode = glyphsUnicodeMap[glyphName]; + let charcode = 0; + if (this.composite && this.cMap.contains(glyphUnicode)) { + charcode = this.cMap.lookup(glyphUnicode); + if (typeof charcode === "string") { + charcode = convertCidString(glyphUnicode, charcode); + } + } + if (!charcode && this.toUnicode) { + charcode = this.toUnicode.charCodeOf(glyphUnicode); + } + if (charcode <= 0) { + charcode = glyphUnicode; + } + width = this.widths[charcode]; + if (width) { + break; + } + } + return shadow(this, "spaceWidth", width || this.defaultWidth); + } + _charToGlyph(charcode, isSpace = false) { + let glyph = this._glyphCache[charcode]; + if (glyph?.isSpace === isSpace) { + return glyph; + } + let fontCharCode, width, operatorListId; + let widthCode = charcode; + if (this.cMap?.contains(charcode)) { + widthCode = this.cMap.lookup(charcode); + if (typeof widthCode === "string") { + widthCode = convertCidString(charcode, widthCode); + } + } + width = this.widths[widthCode]; + if (typeof width !== "number") { + width = this.defaultWidth; + } + const vmetric = this.vmetrics?.[widthCode]; + let unicode = this.toUnicode.get(charcode) || charcode; + if (typeof unicode === "number") { + unicode = String.fromCharCode(unicode); + } + let isInFont = this.toFontChar[charcode] !== undefined; + fontCharCode = this.toFontChar[charcode] || charcode; + if (this.missingFile) { + const glyphName = this.differences[charcode] || this.defaultEncoding[charcode]; + if ((glyphName === ".notdef" || glyphName === "") && this.type === "Type1") { + fontCharCode = 0x20; + } + fontCharCode = mapSpecialUnicodeValues(fontCharCode); + } + if (this.isType3Font) { + operatorListId = fontCharCode; + } + let accent = null; + if (this.seacMap?.[charcode]) { + isInFont = true; + const seac = this.seacMap[charcode]; + fontCharCode = seac.baseFontCharCode; + accent = { + fontChar: String.fromCodePoint(seac.accentFontCharCode), + offset: seac.accentOffset + }; + } + let fontChar = ""; + if (typeof fontCharCode === "number") { + if (fontCharCode <= 0x10ffff) { + fontChar = String.fromCodePoint(fontCharCode); + } else { + warn(`charToGlyph - invalid fontCharCode: ${fontCharCode}`); + } + } + glyph = new fonts_Glyph(charcode, fontChar, unicode, accent, width, vmetric, operatorListId, isSpace, isInFont); + return this._glyphCache[charcode] = glyph; + } + charsToGlyphs(chars) { + let glyphs = this._charsCache[chars]; + if (glyphs) { + return glyphs; + } + glyphs = []; + if (this.cMap) { + const c = Object.create(null), + ii = chars.length; + let i = 0; + while (i < ii) { + this.cMap.readCharCode(chars, i, c); + const { + charcode, + length + } = c; + i += length; + const glyph = this._charToGlyph(charcode, length === 1 && chars.charCodeAt(i - 1) === 0x20); + glyphs.push(glyph); + } + } else { + for (let i = 0, ii = chars.length; i < ii; ++i) { + const charcode = chars.charCodeAt(i); + const glyph = this._charToGlyph(charcode, charcode === 0x20); + glyphs.push(glyph); + } + } + return this._charsCache[chars] = glyphs; + } + getCharPositions(chars) { + const positions = []; + if (this.cMap) { + const c = Object.create(null); + let i = 0; + while (i < chars.length) { + this.cMap.readCharCode(chars, i, c); + const length = c.length; + positions.push([i, i + length]); + i += length; + } + } else { + for (let i = 0, ii = chars.length; i < ii; ++i) { + positions.push([i, i + 1]); + } + } + return positions; + } + get glyphCacheValues() { + return Object.values(this._glyphCache); + } + encodeString(str) { + const buffers = []; + const currentBuf = []; + const hasCurrentBufErrors = () => buffers.length % 2 === 1; + const getCharCode = this.toUnicode instanceof IdentityToUnicodeMap ? unicode => this.toUnicode.charCodeOf(unicode) : unicode => this.toUnicode.charCodeOf(String.fromCodePoint(unicode)); + for (let i = 0, ii = str.length; i < ii; i++) { + const unicode = str.codePointAt(i); + if (unicode > 0xd7ff && (unicode < 0xe000 || unicode > 0xfffd)) { + i++; + } + if (this.toUnicode) { + const charCode = getCharCode(unicode); + if (charCode !== -1) { + if (hasCurrentBufErrors()) { + buffers.push(currentBuf.join("")); + currentBuf.length = 0; + } + const charCodeLength = this.cMap ? this.cMap.getCharCodeLength(charCode) : 1; + for (let j = charCodeLength - 1; j >= 0; j--) { + currentBuf.push(String.fromCharCode(charCode >> 8 * j & 0xff)); + } + continue; + } + } + if (!hasCurrentBufErrors()) { + buffers.push(currentBuf.join("")); + currentBuf.length = 0; + } + currentBuf.push(String.fromCodePoint(unicode)); + } + buffers.push(currentBuf.join("")); + return buffers; + } +} +class ErrorFont { + constructor(error) { + this.error = error; + this.loadedName = "g_font_error"; + this.missingFile = true; + } + charsToGlyphs() { + return []; + } + encodeString(chars) { + return [chars]; + } + exportData(extraProperties = false) { + return { + error: this.error + }; + } +} + +;// CONCATENATED MODULE: ./src/core/pattern.js + + + + +const ShadingType = { + FUNCTION_BASED: 1, + AXIAL: 2, + RADIAL: 3, + FREE_FORM_MESH: 4, + LATTICE_FORM_MESH: 5, + COONS_PATCH_MESH: 6, + TENSOR_PATCH_MESH: 7 +}; +class Pattern { + constructor() { + unreachable("Cannot initialize Pattern."); + } + static parseShading(shading, xref, res, pdfFunctionFactory, localColorSpaceCache) { + const dict = shading instanceof BaseStream ? shading.dict : shading; + const type = dict.get("ShadingType"); + try { + switch (type) { + case ShadingType.AXIAL: + case ShadingType.RADIAL: + return new RadialAxialShading(dict, xref, res, pdfFunctionFactory, localColorSpaceCache); + case ShadingType.FREE_FORM_MESH: + case ShadingType.LATTICE_FORM_MESH: + case ShadingType.COONS_PATCH_MESH: + case ShadingType.TENSOR_PATCH_MESH: + return new MeshShading(shading, xref, res, pdfFunctionFactory, localColorSpaceCache); + default: + throw new FormatError("Unsupported ShadingType: " + type); + } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(ex); + return new DummyShading(); + } + } +} +class BaseShading { + static SMALL_NUMBER = 1e-6; + constructor() { + if (this.constructor === BaseShading) { + unreachable("Cannot initialize BaseShading."); + } + } + getIR() { + unreachable("Abstract method `getIR` called."); + } +} +class RadialAxialShading extends BaseShading { + constructor(dict, xref, resources, pdfFunctionFactory, localColorSpaceCache) { + super(); + this.coordsArr = dict.getArray("Coords"); + this.shadingType = dict.get("ShadingType"); + const cs = ColorSpace.parse({ + cs: dict.getRaw("CS") || dict.getRaw("ColorSpace"), + xref, + resources, + pdfFunctionFactory, + localColorSpaceCache + }); + const bbox = dict.getArray("BBox"); + this.bbox = Array.isArray(bbox) && bbox.length === 4 ? Util.normalizeRect(bbox) : null; + let t0 = 0.0, + t1 = 1.0; + if (dict.has("Domain")) { + const domainArr = dict.getArray("Domain"); + t0 = domainArr[0]; + t1 = domainArr[1]; + } + let extendStart = false, + extendEnd = false; + if (dict.has("Extend")) { + const extendArr = dict.getArray("Extend"); + extendStart = extendArr[0]; + extendEnd = extendArr[1]; + } + if (this.shadingType === ShadingType.RADIAL && (!extendStart || !extendEnd)) { + const [x1, y1, r1, x2, y2, r2] = this.coordsArr; + const distance = Math.hypot(x1 - x2, y1 - y2); + if (r1 <= r2 + distance && r2 <= r1 + distance) { + warn("Unsupported radial gradient."); + } + } + this.extendStart = extendStart; + this.extendEnd = extendEnd; + const fnObj = dict.getRaw("Function"); + const fn = pdfFunctionFactory.createFromArray(fnObj); + const NUMBER_OF_SAMPLES = 840; + const step = (t1 - t0) / NUMBER_OF_SAMPLES; + const colorStops = this.colorStops = []; + if (t0 >= t1 || step <= 0) { + info("Bad shading domain."); + return; + } + const color = new Float32Array(cs.numComps), + ratio = new Float32Array(1); + let rgbColor; + let iBase = 0; + ratio[0] = t0; + fn(ratio, 0, color, 0); + let rgbBase = cs.getRgb(color, 0); + const cssColorBase = Util.makeHexColor(rgbBase[0], rgbBase[1], rgbBase[2]); + colorStops.push([0, cssColorBase]); + let iPrev = 1; + ratio[0] = t0 + step; + fn(ratio, 0, color, 0); + let rgbPrev = cs.getRgb(color, 0); + let maxSlopeR = rgbPrev[0] - rgbBase[0] + 1; + let maxSlopeG = rgbPrev[1] - rgbBase[1] + 1; + let maxSlopeB = rgbPrev[2] - rgbBase[2] + 1; + let minSlopeR = rgbPrev[0] - rgbBase[0] - 1; + let minSlopeG = rgbPrev[1] - rgbBase[1] - 1; + let minSlopeB = rgbPrev[2] - rgbBase[2] - 1; + for (let i = 2; i < NUMBER_OF_SAMPLES; i++) { + ratio[0] = t0 + i * step; + fn(ratio, 0, color, 0); + rgbColor = cs.getRgb(color, 0); + const run = i - iBase; + maxSlopeR = Math.min(maxSlopeR, (rgbColor[0] - rgbBase[0] + 1) / run); + maxSlopeG = Math.min(maxSlopeG, (rgbColor[1] - rgbBase[1] + 1) / run); + maxSlopeB = Math.min(maxSlopeB, (rgbColor[2] - rgbBase[2] + 1) / run); + minSlopeR = Math.max(minSlopeR, (rgbColor[0] - rgbBase[0] - 1) / run); + minSlopeG = Math.max(minSlopeG, (rgbColor[1] - rgbBase[1] - 1) / run); + minSlopeB = Math.max(minSlopeB, (rgbColor[2] - rgbBase[2] - 1) / run); + const slopesExist = minSlopeR <= maxSlopeR && minSlopeG <= maxSlopeG && minSlopeB <= maxSlopeB; + if (!slopesExist) { + const cssColor = Util.makeHexColor(rgbPrev[0], rgbPrev[1], rgbPrev[2]); + colorStops.push([iPrev / NUMBER_OF_SAMPLES, cssColor]); + maxSlopeR = rgbColor[0] - rgbPrev[0] + 1; + maxSlopeG = rgbColor[1] - rgbPrev[1] + 1; + maxSlopeB = rgbColor[2] - rgbPrev[2] + 1; + minSlopeR = rgbColor[0] - rgbPrev[0] - 1; + minSlopeG = rgbColor[1] - rgbPrev[1] - 1; + minSlopeB = rgbColor[2] - rgbPrev[2] - 1; + iBase = iPrev; + rgbBase = rgbPrev; + } + iPrev = i; + rgbPrev = rgbColor; + } + const cssColor = Util.makeHexColor(rgbPrev[0], rgbPrev[1], rgbPrev[2]); + colorStops.push([1, cssColor]); + let background = "transparent"; + if (dict.has("Background")) { + rgbColor = cs.getRgb(dict.get("Background"), 0); + background = Util.makeHexColor(rgbColor[0], rgbColor[1], rgbColor[2]); + } + if (!extendStart) { + colorStops.unshift([0, background]); + colorStops[1][0] += BaseShading.SMALL_NUMBER; + } + if (!extendEnd) { + colorStops.at(-1)[0] -= BaseShading.SMALL_NUMBER; + colorStops.push([1, background]); + } + this.colorStops = colorStops; + } + getIR() { + const coordsArr = this.coordsArr; + const shadingType = this.shadingType; + let type, p0, p1, r0, r1; + if (shadingType === ShadingType.AXIAL) { + p0 = [coordsArr[0], coordsArr[1]]; + p1 = [coordsArr[2], coordsArr[3]]; + r0 = null; + r1 = null; + type = "axial"; + } else if (shadingType === ShadingType.RADIAL) { + p0 = [coordsArr[0], coordsArr[1]]; + p1 = [coordsArr[3], coordsArr[4]]; + r0 = coordsArr[2]; + r1 = coordsArr[5]; + type = "radial"; + } else { + unreachable(`getPattern type unknown: ${shadingType}`); + } + return ["RadialAxial", type, this.bbox, this.colorStops, p0, p1, r0, r1]; + } +} +class MeshStreamReader { + constructor(stream, context) { + this.stream = stream; + this.context = context; + this.buffer = 0; + this.bufferLength = 0; + const numComps = context.numComps; + this.tmpCompsBuf = new Float32Array(numComps); + const csNumComps = context.colorSpace.numComps; + this.tmpCsCompsBuf = context.colorFn ? new Float32Array(csNumComps) : this.tmpCompsBuf; + } + get hasData() { + if (this.stream.end) { + return this.stream.pos < this.stream.end; + } + if (this.bufferLength > 0) { + return true; + } + const nextByte = this.stream.getByte(); + if (nextByte < 0) { + return false; + } + this.buffer = nextByte; + this.bufferLength = 8; + return true; + } + readBits(n) { + let buffer = this.buffer; + let bufferLength = this.bufferLength; + if (n === 32) { + if (bufferLength === 0) { + return (this.stream.getByte() << 24 | this.stream.getByte() << 16 | this.stream.getByte() << 8 | this.stream.getByte()) >>> 0; + } + buffer = buffer << 24 | this.stream.getByte() << 16 | this.stream.getByte() << 8 | this.stream.getByte(); + const nextByte = this.stream.getByte(); + this.buffer = nextByte & (1 << bufferLength) - 1; + return (buffer << 8 - bufferLength | (nextByte & 0xff) >> bufferLength) >>> 0; + } + if (n === 8 && bufferLength === 0) { + return this.stream.getByte(); + } + while (bufferLength < n) { + buffer = buffer << 8 | this.stream.getByte(); + bufferLength += 8; + } + bufferLength -= n; + this.bufferLength = bufferLength; + this.buffer = buffer & (1 << bufferLength) - 1; + return buffer >> bufferLength; + } + align() { + this.buffer = 0; + this.bufferLength = 0; + } + readFlag() { + return this.readBits(this.context.bitsPerFlag); + } + readCoordinate() { + const bitsPerCoordinate = this.context.bitsPerCoordinate; + const xi = this.readBits(bitsPerCoordinate); + const yi = this.readBits(bitsPerCoordinate); + const decode = this.context.decode; + const scale = bitsPerCoordinate < 32 ? 1 / ((1 << bitsPerCoordinate) - 1) : 2.3283064365386963e-10; + return [xi * scale * (decode[1] - decode[0]) + decode[0], yi * scale * (decode[3] - decode[2]) + decode[2]]; + } + readComponents() { + const numComps = this.context.numComps; + const bitsPerComponent = this.context.bitsPerComponent; + const scale = bitsPerComponent < 32 ? 1 / ((1 << bitsPerComponent) - 1) : 2.3283064365386963e-10; + const decode = this.context.decode; + const components = this.tmpCompsBuf; + for (let i = 0, j = 4; i < numComps; i++, j += 2) { + const ci = this.readBits(bitsPerComponent); + components[i] = ci * scale * (decode[j + 1] - decode[j]) + decode[j]; + } + const color = this.tmpCsCompsBuf; + if (this.context.colorFn) { + this.context.colorFn(components, 0, color, 0); + } + return this.context.colorSpace.getRgb(color, 0); + } +} +let bCache = Object.create(null); +function buildB(count) { + const lut = []; + for (let i = 0; i <= count; i++) { + const t = i / count, + t_ = 1 - t; + lut.push(new Float32Array([t_ ** 3, 3 * t * t_ ** 2, 3 * t ** 2 * t_, t ** 3])); + } + return lut; +} +function getB(count) { + return bCache[count] ||= buildB(count); +} +function clearPatternCaches() { + bCache = Object.create(null); +} +class MeshShading extends BaseShading { + static MIN_SPLIT_PATCH_CHUNKS_AMOUNT = 3; + static MAX_SPLIT_PATCH_CHUNKS_AMOUNT = 20; + static TRIANGLE_DENSITY = 20; + constructor(stream, xref, resources, pdfFunctionFactory, localColorSpaceCache) { + super(); + if (!(stream instanceof BaseStream)) { + throw new FormatError("Mesh data is not a stream"); + } + const dict = stream.dict; + this.shadingType = dict.get("ShadingType"); + const bbox = dict.getArray("BBox"); + this.bbox = Array.isArray(bbox) && bbox.length === 4 ? Util.normalizeRect(bbox) : null; + const cs = ColorSpace.parse({ + cs: dict.getRaw("CS") || dict.getRaw("ColorSpace"), + xref, + resources, + pdfFunctionFactory, + localColorSpaceCache + }); + this.background = dict.has("Background") ? cs.getRgb(dict.get("Background"), 0) : null; + const fnObj = dict.getRaw("Function"); + const fn = fnObj ? pdfFunctionFactory.createFromArray(fnObj) : null; + this.coords = []; + this.colors = []; + this.figures = []; + const decodeContext = { + bitsPerCoordinate: dict.get("BitsPerCoordinate"), + bitsPerComponent: dict.get("BitsPerComponent"), + bitsPerFlag: dict.get("BitsPerFlag"), + decode: dict.getArray("Decode"), + colorFn: fn, + colorSpace: cs, + numComps: fn ? 1 : cs.numComps + }; + const reader = new MeshStreamReader(stream, decodeContext); + let patchMesh = false; + switch (this.shadingType) { + case ShadingType.FREE_FORM_MESH: + this._decodeType4Shading(reader); + break; + case ShadingType.LATTICE_FORM_MESH: + const verticesPerRow = dict.get("VerticesPerRow") | 0; + if (verticesPerRow < 2) { + throw new FormatError("Invalid VerticesPerRow"); + } + this._decodeType5Shading(reader, verticesPerRow); + break; + case ShadingType.COONS_PATCH_MESH: + this._decodeType6Shading(reader); + patchMesh = true; + break; + case ShadingType.TENSOR_PATCH_MESH: + this._decodeType7Shading(reader); + patchMesh = true; + break; + default: + unreachable("Unsupported mesh type."); + break; + } + if (patchMesh) { + this._updateBounds(); + for (let i = 0, ii = this.figures.length; i < ii; i++) { + this._buildFigureFromPatch(i); + } + } + this._updateBounds(); + this._packData(); + } + _decodeType4Shading(reader) { + const coords = this.coords; + const colors = this.colors; + const operators = []; + const ps = []; + let verticesLeft = 0; + while (reader.hasData) { + const f = reader.readFlag(); + const coord = reader.readCoordinate(); + const color = reader.readComponents(); + if (verticesLeft === 0) { + if (!(0 <= f && f <= 2)) { + throw new FormatError("Unknown type4 flag"); + } + switch (f) { + case 0: + verticesLeft = 3; + break; + case 1: + ps.push(ps.at(-2), ps.at(-1)); + verticesLeft = 1; + break; + case 2: + ps.push(ps.at(-3), ps.at(-1)); + verticesLeft = 1; + break; + } + operators.push(f); + } + ps.push(coords.length); + coords.push(coord); + colors.push(color); + verticesLeft--; + reader.align(); + } + this.figures.push({ + type: "triangles", + coords: new Int32Array(ps), + colors: new Int32Array(ps) + }); + } + _decodeType5Shading(reader, verticesPerRow) { + const coords = this.coords; + const colors = this.colors; + const ps = []; + while (reader.hasData) { + const coord = reader.readCoordinate(); + const color = reader.readComponents(); + ps.push(coords.length); + coords.push(coord); + colors.push(color); + } + this.figures.push({ + type: "lattice", + coords: new Int32Array(ps), + colors: new Int32Array(ps), + verticesPerRow + }); + } + _decodeType6Shading(reader) { + const coords = this.coords; + const colors = this.colors; + const ps = new Int32Array(16); + const cs = new Int32Array(4); + while (reader.hasData) { + const f = reader.readFlag(); + if (!(0 <= f && f <= 3)) { + throw new FormatError("Unknown type6 flag"); + } + const pi = coords.length; + for (let i = 0, ii = f !== 0 ? 8 : 12; i < ii; i++) { + coords.push(reader.readCoordinate()); + } + const ci = colors.length; + for (let i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) { + colors.push(reader.readComponents()); + } + let tmp1, tmp2, tmp3, tmp4; + switch (f) { + case 0: + ps[12] = pi + 3; + ps[13] = pi + 4; + ps[14] = pi + 5; + ps[15] = pi + 6; + ps[8] = pi + 2; + ps[11] = pi + 7; + ps[4] = pi + 1; + ps[7] = pi + 8; + ps[0] = pi; + ps[1] = pi + 11; + ps[2] = pi + 10; + ps[3] = pi + 9; + cs[2] = ci + 1; + cs[3] = ci + 2; + cs[0] = ci; + cs[1] = ci + 3; + break; + case 1: + tmp1 = ps[12]; + tmp2 = ps[13]; + tmp3 = ps[14]; + tmp4 = ps[15]; + ps[12] = tmp4; + ps[13] = pi + 0; + ps[14] = pi + 1; + ps[15] = pi + 2; + ps[8] = tmp3; + ps[11] = pi + 3; + ps[4] = tmp2; + ps[7] = pi + 4; + ps[0] = tmp1; + ps[1] = pi + 7; + ps[2] = pi + 6; + ps[3] = pi + 5; + tmp1 = cs[2]; + tmp2 = cs[3]; + cs[2] = tmp2; + cs[3] = ci; + cs[0] = tmp1; + cs[1] = ci + 1; + break; + case 2: + tmp1 = ps[15]; + tmp2 = ps[11]; + ps[12] = ps[3]; + ps[13] = pi + 0; + ps[14] = pi + 1; + ps[15] = pi + 2; + ps[8] = ps[7]; + ps[11] = pi + 3; + ps[4] = tmp2; + ps[7] = pi + 4; + ps[0] = tmp1; + ps[1] = pi + 7; + ps[2] = pi + 6; + ps[3] = pi + 5; + tmp1 = cs[3]; + cs[2] = cs[1]; + cs[3] = ci; + cs[0] = tmp1; + cs[1] = ci + 1; + break; + case 3: + ps[12] = ps[0]; + ps[13] = pi + 0; + ps[14] = pi + 1; + ps[15] = pi + 2; + ps[8] = ps[1]; + ps[11] = pi + 3; + ps[4] = ps[2]; + ps[7] = pi + 4; + ps[0] = ps[3]; + ps[1] = pi + 7; + ps[2] = pi + 6; + ps[3] = pi + 5; + cs[2] = cs[0]; + cs[3] = ci; + cs[0] = cs[1]; + cs[1] = ci + 1; + break; + } + ps[5] = coords.length; + coords.push([(-4 * coords[ps[0]][0] - coords[ps[15]][0] + 6 * (coords[ps[4]][0] + coords[ps[1]][0]) - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + 3 * (coords[ps[13]][0] + coords[ps[7]][0])) / 9, (-4 * coords[ps[0]][1] - coords[ps[15]][1] + 6 * (coords[ps[4]][1] + coords[ps[1]][1]) - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + 3 * (coords[ps[13]][1] + coords[ps[7]][1])) / 9]); + ps[6] = coords.length; + coords.push([(-4 * coords[ps[3]][0] - coords[ps[12]][0] + 6 * (coords[ps[2]][0] + coords[ps[7]][0]) - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + 3 * (coords[ps[4]][0] + coords[ps[14]][0])) / 9, (-4 * coords[ps[3]][1] - coords[ps[12]][1] + 6 * (coords[ps[2]][1] + coords[ps[7]][1]) - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + 3 * (coords[ps[4]][1] + coords[ps[14]][1])) / 9]); + ps[9] = coords.length; + coords.push([(-4 * coords[ps[12]][0] - coords[ps[3]][0] + 6 * (coords[ps[8]][0] + coords[ps[13]][0]) - 2 * (coords[ps[0]][0] + coords[ps[15]][0]) + 3 * (coords[ps[11]][0] + coords[ps[1]][0])) / 9, (-4 * coords[ps[12]][1] - coords[ps[3]][1] + 6 * (coords[ps[8]][1] + coords[ps[13]][1]) - 2 * (coords[ps[0]][1] + coords[ps[15]][1]) + 3 * (coords[ps[11]][1] + coords[ps[1]][1])) / 9]); + ps[10] = coords.length; + coords.push([(-4 * coords[ps[15]][0] - coords[ps[0]][0] + 6 * (coords[ps[11]][0] + coords[ps[14]][0]) - 2 * (coords[ps[12]][0] + coords[ps[3]][0]) + 3 * (coords[ps[2]][0] + coords[ps[8]][0])) / 9, (-4 * coords[ps[15]][1] - coords[ps[0]][1] + 6 * (coords[ps[11]][1] + coords[ps[14]][1]) - 2 * (coords[ps[12]][1] + coords[ps[3]][1]) + 3 * (coords[ps[2]][1] + coords[ps[8]][1])) / 9]); + this.figures.push({ + type: "patch", + coords: new Int32Array(ps), + colors: new Int32Array(cs) + }); + } + } + _decodeType7Shading(reader) { + const coords = this.coords; + const colors = this.colors; + const ps = new Int32Array(16); + const cs = new Int32Array(4); + while (reader.hasData) { + const f = reader.readFlag(); + if (!(0 <= f && f <= 3)) { + throw new FormatError("Unknown type7 flag"); + } + const pi = coords.length; + for (let i = 0, ii = f !== 0 ? 12 : 16; i < ii; i++) { + coords.push(reader.readCoordinate()); + } + const ci = colors.length; + for (let i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) { + colors.push(reader.readComponents()); + } + let tmp1, tmp2, tmp3, tmp4; + switch (f) { + case 0: + ps[12] = pi + 3; + ps[13] = pi + 4; + ps[14] = pi + 5; + ps[15] = pi + 6; + ps[8] = pi + 2; + ps[9] = pi + 13; + ps[10] = pi + 14; + ps[11] = pi + 7; + ps[4] = pi + 1; + ps[5] = pi + 12; + ps[6] = pi + 15; + ps[7] = pi + 8; + ps[0] = pi; + ps[1] = pi + 11; + ps[2] = pi + 10; + ps[3] = pi + 9; + cs[2] = ci + 1; + cs[3] = ci + 2; + cs[0] = ci; + cs[1] = ci + 3; + break; + case 1: + tmp1 = ps[12]; + tmp2 = ps[13]; + tmp3 = ps[14]; + tmp4 = ps[15]; + ps[12] = tmp4; + ps[13] = pi + 0; + ps[14] = pi + 1; + ps[15] = pi + 2; + ps[8] = tmp3; + ps[9] = pi + 9; + ps[10] = pi + 10; + ps[11] = pi + 3; + ps[4] = tmp2; + ps[5] = pi + 8; + ps[6] = pi + 11; + ps[7] = pi + 4; + ps[0] = tmp1; + ps[1] = pi + 7; + ps[2] = pi + 6; + ps[3] = pi + 5; + tmp1 = cs[2]; + tmp2 = cs[3]; + cs[2] = tmp2; + cs[3] = ci; + cs[0] = tmp1; + cs[1] = ci + 1; + break; + case 2: + tmp1 = ps[15]; + tmp2 = ps[11]; + ps[12] = ps[3]; + ps[13] = pi + 0; + ps[14] = pi + 1; + ps[15] = pi + 2; + ps[8] = ps[7]; + ps[9] = pi + 9; + ps[10] = pi + 10; + ps[11] = pi + 3; + ps[4] = tmp2; + ps[5] = pi + 8; + ps[6] = pi + 11; + ps[7] = pi + 4; + ps[0] = tmp1; + ps[1] = pi + 7; + ps[2] = pi + 6; + ps[3] = pi + 5; + tmp1 = cs[3]; + cs[2] = cs[1]; + cs[3] = ci; + cs[0] = tmp1; + cs[1] = ci + 1; + break; + case 3: + ps[12] = ps[0]; + ps[13] = pi + 0; + ps[14] = pi + 1; + ps[15] = pi + 2; + ps[8] = ps[1]; + ps[9] = pi + 9; + ps[10] = pi + 10; + ps[11] = pi + 3; + ps[4] = ps[2]; + ps[5] = pi + 8; + ps[6] = pi + 11; + ps[7] = pi + 4; + ps[0] = ps[3]; + ps[1] = pi + 7; + ps[2] = pi + 6; + ps[3] = pi + 5; + cs[2] = cs[0]; + cs[3] = ci; + cs[0] = cs[1]; + cs[1] = ci + 1; + break; + } + this.figures.push({ + type: "patch", + coords: new Int32Array(ps), + colors: new Int32Array(cs) + }); + } + } + _buildFigureFromPatch(index) { + const figure = this.figures[index]; + assert(figure.type === "patch", "Unexpected patch mesh figure"); + const coords = this.coords, + colors = this.colors; + const pi = figure.coords; + const ci = figure.colors; + const figureMinX = Math.min(coords[pi[0]][0], coords[pi[3]][0], coords[pi[12]][0], coords[pi[15]][0]); + const figureMinY = Math.min(coords[pi[0]][1], coords[pi[3]][1], coords[pi[12]][1], coords[pi[15]][1]); + const figureMaxX = Math.max(coords[pi[0]][0], coords[pi[3]][0], coords[pi[12]][0], coords[pi[15]][0]); + const figureMaxY = Math.max(coords[pi[0]][1], coords[pi[3]][1], coords[pi[12]][1], coords[pi[15]][1]); + let splitXBy = Math.ceil((figureMaxX - figureMinX) * MeshShading.TRIANGLE_DENSITY / (this.bounds[2] - this.bounds[0])); + splitXBy = Math.max(MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT, Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitXBy)); + let splitYBy = Math.ceil((figureMaxY - figureMinY) * MeshShading.TRIANGLE_DENSITY / (this.bounds[3] - this.bounds[1])); + splitYBy = Math.max(MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT, Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitYBy)); + const verticesPerRow = splitXBy + 1; + const figureCoords = new Int32Array((splitYBy + 1) * verticesPerRow); + const figureColors = new Int32Array((splitYBy + 1) * verticesPerRow); + let k = 0; + const cl = new Uint8Array(3), + cr = new Uint8Array(3); + const c0 = colors[ci[0]], + c1 = colors[ci[1]], + c2 = colors[ci[2]], + c3 = colors[ci[3]]; + const bRow = getB(splitYBy), + bCol = getB(splitXBy); + for (let row = 0; row <= splitYBy; row++) { + cl[0] = (c0[0] * (splitYBy - row) + c2[0] * row) / splitYBy | 0; + cl[1] = (c0[1] * (splitYBy - row) + c2[1] * row) / splitYBy | 0; + cl[2] = (c0[2] * (splitYBy - row) + c2[2] * row) / splitYBy | 0; + cr[0] = (c1[0] * (splitYBy - row) + c3[0] * row) / splitYBy | 0; + cr[1] = (c1[1] * (splitYBy - row) + c3[1] * row) / splitYBy | 0; + cr[2] = (c1[2] * (splitYBy - row) + c3[2] * row) / splitYBy | 0; + for (let col = 0; col <= splitXBy; col++, k++) { + if ((row === 0 || row === splitYBy) && (col === 0 || col === splitXBy)) { + continue; + } + let x = 0, + y = 0; + let q = 0; + for (let i = 0; i <= 3; i++) { + for (let j = 0; j <= 3; j++, q++) { + const m = bRow[row][i] * bCol[col][j]; + x += coords[pi[q]][0] * m; + y += coords[pi[q]][1] * m; + } + } + figureCoords[k] = coords.length; + coords.push([x, y]); + figureColors[k] = colors.length; + const newColor = new Uint8Array(3); + newColor[0] = (cl[0] * (splitXBy - col) + cr[0] * col) / splitXBy | 0; + newColor[1] = (cl[1] * (splitXBy - col) + cr[1] * col) / splitXBy | 0; + newColor[2] = (cl[2] * (splitXBy - col) + cr[2] * col) / splitXBy | 0; + colors.push(newColor); + } + } + figureCoords[0] = pi[0]; + figureColors[0] = ci[0]; + figureCoords[splitXBy] = pi[3]; + figureColors[splitXBy] = ci[1]; + figureCoords[verticesPerRow * splitYBy] = pi[12]; + figureColors[verticesPerRow * splitYBy] = ci[2]; + figureCoords[verticesPerRow * splitYBy + splitXBy] = pi[15]; + figureColors[verticesPerRow * splitYBy + splitXBy] = ci[3]; + this.figures[index] = { + type: "lattice", + coords: figureCoords, + colors: figureColors, + verticesPerRow + }; + } + _updateBounds() { + let minX = this.coords[0][0], + minY = this.coords[0][1], + maxX = minX, + maxY = minY; + for (let i = 1, ii = this.coords.length; i < ii; i++) { + const x = this.coords[i][0], + y = this.coords[i][1]; + minX = minX > x ? x : minX; + minY = minY > y ? y : minY; + maxX = maxX < x ? x : maxX; + maxY = maxY < y ? y : maxY; + } + this.bounds = [minX, minY, maxX, maxY]; + } + _packData() { + let i, ii, j, jj; + const coords = this.coords; + const coordsPacked = new Float32Array(coords.length * 2); + for (i = 0, j = 0, ii = coords.length; i < ii; i++) { + const xy = coords[i]; + coordsPacked[j++] = xy[0]; + coordsPacked[j++] = xy[1]; + } + this.coords = coordsPacked; + const colors = this.colors; + const colorsPacked = new Uint8Array(colors.length * 3); + for (i = 0, j = 0, ii = colors.length; i < ii; i++) { + const c = colors[i]; + colorsPacked[j++] = c[0]; + colorsPacked[j++] = c[1]; + colorsPacked[j++] = c[2]; + } + this.colors = colorsPacked; + const figures = this.figures; + for (i = 0, ii = figures.length; i < ii; i++) { + const figure = figures[i], + ps = figure.coords, + cs = figure.colors; + for (j = 0, jj = ps.length; j < jj; j++) { + ps[j] *= 2; + cs[j] *= 3; + } + } + } + getIR() { + return ["Mesh", this.shadingType, this.coords, this.colors, this.figures, this.bounds, this.bbox, this.background]; + } +} +class DummyShading extends BaseShading { + getIR() { + return ["Dummy"]; + } +} +function getTilingPatternIR(operatorList, dict, color) { + const matrix = dict.getArray("Matrix"); + const bbox = Util.normalizeRect(dict.getArray("BBox")); + const xstep = dict.get("XStep"); + const ystep = dict.get("YStep"); + const paintType = dict.get("PaintType"); + const tilingType = dict.get("TilingType"); + if (bbox[2] - bbox[0] === 0 || bbox[3] - bbox[1] === 0) { + throw new FormatError(`Invalid getTilingPatternIR /BBox array: [${bbox}].`); + } + return ["TilingPattern", color, operatorList, matrix, bbox, xstep, ystep, paintType, tilingType]; +} + +;// CONCATENATED MODULE: ./src/core/calibri_factors.js +const CalibriBoldFactors = [1.3877, 1, 1, 1, 0.97801, 0.92482, 0.89552, 0.91133, 0.81988, 0.97566, 0.98152, 0.93548, 0.93548, 1.2798, 0.85284, 0.92794, 1, 0.96134, 1.54657, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.82845, 0.82845, 0.85284, 0.85284, 0.85284, 0.75859, 0.92138, 0.83908, 0.7762, 0.73293, 0.87289, 0.73133, 0.7514, 0.81921, 0.87356, 0.95958, 0.59526, 0.75727, 0.69225, 1.04924, 0.9121, 0.86943, 0.79795, 0.88198, 0.77958, 0.70864, 0.81055, 0.90399, 0.88653, 0.96017, 0.82577, 0.77892, 0.78257, 0.97507, 1.54657, 0.97507, 0.85284, 0.89552, 0.90176, 0.88762, 0.8785, 0.75241, 0.8785, 0.90518, 0.95015, 0.77618, 0.8785, 0.88401, 0.91916, 0.86304, 0.88401, 0.91488, 0.8785, 0.8801, 0.8785, 0.8785, 0.91343, 0.7173, 1.04106, 0.8785, 0.85075, 0.95794, 0.82616, 0.85162, 0.79492, 0.88331, 1.69808, 0.88331, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.7801, 0.89552, 1.24487, 1.13254, 1.12401, 0.96839, 0.85284, 0.68787, 0.70645, 0.85592, 0.90747, 1.01466, 1.0088, 0.90323, 1, 1.07463, 1, 0.91056, 0.75806, 1.19118, 0.96839, 0.78864, 0.82845, 0.84133, 0.75859, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.77539, 0.73293, 0.73133, 0.73133, 0.73133, 0.73133, 0.95958, 0.95958, 0.95958, 0.95958, 0.88506, 0.9121, 0.86943, 0.86943, 0.86943, 0.86943, 0.86943, 0.85284, 0.87508, 0.90399, 0.90399, 0.90399, 0.90399, 0.77892, 0.79795, 0.90807, 0.88762, 0.88762, 0.88762, 0.88762, 0.88762, 0.88762, 0.8715, 0.75241, 0.90518, 0.90518, 0.90518, 0.90518, 0.88401, 0.88401, 0.88401, 0.88401, 0.8785, 0.8785, 0.8801, 0.8801, 0.8801, 0.8801, 0.8801, 0.90747, 0.89049, 0.8785, 0.8785, 0.8785, 0.8785, 0.85162, 0.8785, 0.85162, 0.83908, 0.88762, 0.83908, 0.88762, 0.83908, 0.88762, 0.73293, 0.75241, 0.73293, 0.75241, 0.73293, 0.75241, 0.73293, 0.75241, 0.87289, 0.83016, 0.88506, 0.93125, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.81921, 0.77618, 0.81921, 0.77618, 0.81921, 0.77618, 1, 1, 0.87356, 0.8785, 0.91075, 0.89608, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.76229, 0.90167, 0.59526, 0.91916, 1, 1, 0.86304, 0.69225, 0.88401, 1, 1, 0.70424, 0.79468, 0.91926, 0.88175, 0.70823, 0.94903, 0.9121, 0.8785, 1, 1, 0.9121, 0.8785, 0.87802, 0.88656, 0.8785, 0.86943, 0.8801, 0.86943, 0.8801, 0.86943, 0.8801, 0.87402, 0.89291, 0.77958, 0.91343, 1, 1, 0.77958, 0.91343, 0.70864, 0.7173, 0.70864, 0.7173, 0.70864, 0.7173, 0.70864, 0.7173, 1, 1, 0.81055, 0.75841, 0.81055, 1.06452, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.96017, 0.95794, 0.77892, 0.85162, 0.77892, 0.78257, 0.79492, 0.78257, 0.79492, 0.78257, 0.79492, 0.9297, 0.56892, 0.83908, 0.88762, 0.77539, 0.8715, 0.87508, 0.89049, 1, 1, 0.81055, 1.04106, 1.20528, 1.20528, 1, 1.15543, 0.70674, 0.98387, 0.94721, 1.33431, 1.45894, 0.95161, 1.06303, 0.83908, 0.80352, 0.57184, 0.6965, 0.56289, 0.82001, 0.56029, 0.81235, 1.02988, 0.83908, 0.7762, 0.68156, 0.80367, 0.73133, 0.78257, 0.87356, 0.86943, 0.95958, 0.75727, 0.89019, 1.04924, 0.9121, 0.7648, 0.86943, 0.87356, 0.79795, 0.78275, 0.81055, 0.77892, 0.9762, 0.82577, 0.99819, 0.84896, 0.95958, 0.77892, 0.96108, 1.01407, 0.89049, 1.02988, 0.94211, 0.96108, 0.8936, 0.84021, 0.87842, 0.96399, 0.79109, 0.89049, 1.00813, 1.02988, 0.86077, 0.87445, 0.92099, 0.84723, 0.86513, 0.8801, 0.75638, 0.85714, 0.78216, 0.79586, 0.87965, 0.94211, 0.97747, 0.78287, 0.97926, 0.84971, 1.02988, 0.94211, 0.8801, 0.94211, 0.84971, 0.73133, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90264, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90518, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90548, 1, 1, 1, 1, 1, 1, 0.96017, 0.95794, 0.96017, 0.95794, 0.96017, 0.95794, 0.77892, 0.85162, 1, 1, 0.89552, 0.90527, 1, 0.90363, 0.92794, 0.92794, 0.92794, 0.92794, 0.87012, 0.87012, 0.87012, 0.89552, 0.89552, 1.42259, 0.71143, 1.06152, 1, 1, 1.03372, 1.03372, 0.97171, 1.4956, 2.2807, 0.93835, 0.83406, 0.91133, 0.84107, 0.91133, 1, 1, 1, 0.72021, 1, 1.23108, 0.83489, 0.88525, 0.88525, 0.81499, 0.90527, 1.81055, 0.90527, 1.81055, 1.31006, 1.53711, 0.94434, 1.08696, 1, 0.95018, 0.77192, 0.85284, 0.90747, 1.17534, 0.69825, 0.9716, 1.37077, 0.90747, 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.08004, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90727, 0.90727, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const CalibriBoldMetrics = { + lineHeight: 1.2207, + lineGap: 0.2207 +}; +const CalibriBoldItalicFactors = [1.3877, 1, 1, 1, 0.97801, 0.92482, 0.89552, 0.91133, 0.81988, 0.97566, 0.98152, 0.93548, 0.93548, 1.2798, 0.85284, 0.92794, 1, 0.96134, 1.56239, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.82845, 0.82845, 0.85284, 0.85284, 0.85284, 0.75859, 0.92138, 0.83908, 0.7762, 0.71805, 0.87289, 0.73133, 0.7514, 0.81921, 0.87356, 0.95958, 0.59526, 0.75727, 0.69225, 1.04924, 0.90872, 0.85938, 0.79795, 0.87068, 0.77958, 0.69766, 0.81055, 0.90399, 0.88653, 0.96068, 0.82577, 0.77892, 0.78257, 0.97507, 1.529, 0.97507, 0.85284, 0.89552, 0.90176, 0.94908, 0.86411, 0.74012, 0.86411, 0.88323, 0.95015, 0.86411, 0.86331, 0.88401, 0.91916, 0.86304, 0.88401, 0.9039, 0.86331, 0.86331, 0.86411, 0.86411, 0.90464, 0.70852, 1.04106, 0.86331, 0.84372, 0.95794, 0.82616, 0.84548, 0.79492, 0.88331, 1.69808, 0.88331, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.7801, 0.89552, 1.24487, 1.13254, 1.19129, 0.96839, 0.85284, 0.68787, 0.70645, 0.85592, 0.90747, 1.01466, 1.0088, 0.90323, 1, 1.07463, 1, 0.91056, 0.75806, 1.19118, 0.96839, 0.78864, 0.82845, 0.84133, 0.75859, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.77539, 0.71805, 0.73133, 0.73133, 0.73133, 0.73133, 0.95958, 0.95958, 0.95958, 0.95958, 0.88506, 0.90872, 0.85938, 0.85938, 0.85938, 0.85938, 0.85938, 0.85284, 0.87068, 0.90399, 0.90399, 0.90399, 0.90399, 0.77892, 0.79795, 0.90807, 0.94908, 0.94908, 0.94908, 0.94908, 0.94908, 0.94908, 0.85887, 0.74012, 0.88323, 0.88323, 0.88323, 0.88323, 0.88401, 0.88401, 0.88401, 0.88401, 0.8785, 0.86331, 0.86331, 0.86331, 0.86331, 0.86331, 0.86331, 0.90747, 0.89049, 0.86331, 0.86331, 0.86331, 0.86331, 0.84548, 0.86411, 0.84548, 0.83908, 0.94908, 0.83908, 0.94908, 0.83908, 0.94908, 0.71805, 0.74012, 0.71805, 0.74012, 0.71805, 0.74012, 0.71805, 0.74012, 0.87289, 0.79538, 0.88506, 0.92726, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.81921, 0.86411, 0.81921, 0.86411, 0.81921, 0.86411, 1, 1, 0.87356, 0.86331, 0.91075, 0.8777, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.76467, 0.90167, 0.59526, 0.91916, 1, 1, 0.86304, 0.69225, 0.88401, 1, 1, 0.70424, 0.77312, 0.91926, 0.88175, 0.70823, 0.94903, 0.90872, 0.86331, 1, 1, 0.90872, 0.86331, 0.86906, 0.88116, 0.86331, 0.85938, 0.86331, 0.85938, 0.86331, 0.85938, 0.86331, 0.87402, 0.86549, 0.77958, 0.90464, 1, 1, 0.77958, 0.90464, 0.69766, 0.70852, 0.69766, 0.70852, 0.69766, 0.70852, 0.69766, 0.70852, 1, 1, 0.81055, 0.75841, 0.81055, 1.06452, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.96068, 0.95794, 0.77892, 0.84548, 0.77892, 0.78257, 0.79492, 0.78257, 0.79492, 0.78257, 0.79492, 0.9297, 0.56892, 0.83908, 0.94908, 0.77539, 0.85887, 0.87068, 0.89049, 1, 1, 0.81055, 1.04106, 1.20528, 1.20528, 1, 1.15543, 0.70088, 0.98387, 0.94721, 1.33431, 1.45894, 0.95161, 1.48387, 0.83908, 0.80352, 0.57118, 0.6965, 0.56347, 0.79179, 0.55853, 0.80346, 1.02988, 0.83908, 0.7762, 0.67174, 0.86036, 0.73133, 0.78257, 0.87356, 0.86441, 0.95958, 0.75727, 0.89019, 1.04924, 0.90872, 0.74889, 0.85938, 0.87891, 0.79795, 0.7957, 0.81055, 0.77892, 0.97447, 0.82577, 0.97466, 0.87179, 0.95958, 0.77892, 0.94252, 0.95612, 0.8753, 1.02988, 0.92733, 0.94252, 0.87411, 0.84021, 0.8728, 0.95612, 0.74081, 0.8753, 1.02189, 1.02988, 0.84814, 0.87445, 0.91822, 0.84723, 0.85668, 0.86331, 0.81344, 0.87581, 0.76422, 0.82046, 0.96057, 0.92733, 0.99375, 0.78022, 0.95452, 0.86015, 1.02988, 0.92733, 0.86331, 0.92733, 0.86015, 0.73133, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90631, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.88323, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.85174, 1, 1, 1, 1, 1, 1, 0.96068, 0.95794, 0.96068, 0.95794, 0.96068, 0.95794, 0.77892, 0.84548, 1, 1, 0.89552, 0.90527, 1, 0.90363, 0.92794, 0.92794, 0.92794, 0.89807, 0.87012, 0.87012, 0.87012, 0.89552, 0.89552, 1.42259, 0.71094, 1.06152, 1, 1, 1.03372, 1.03372, 0.97171, 1.4956, 2.2807, 0.92972, 0.83406, 0.91133, 0.83326, 0.91133, 1, 1, 1, 0.72021, 1, 1.23108, 0.83489, 0.88525, 0.88525, 0.81499, 0.90616, 1.81055, 0.90527, 1.81055, 1.3107, 1.53711, 0.94434, 1.08696, 1, 0.95018, 0.77192, 0.85284, 0.90747, 1.17534, 0.69825, 0.9716, 1.37077, 0.90747, 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.08004, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90727, 0.90727, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const CalibriBoldItalicMetrics = { + lineHeight: 1.2207, + lineGap: 0.2207 +}; +const CalibriItalicFactors = [1.3877, 1, 1, 1, 1.17223, 1.1293, 0.89552, 0.91133, 0.80395, 1.02269, 1.15601, 0.91056, 0.91056, 1.2798, 0.85284, 0.89807, 1, 0.90861, 1.39543, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.96309, 0.96309, 0.85284, 0.85284, 0.85284, 0.83319, 0.88071, 0.8675, 0.81552, 0.72346, 0.85193, 0.73206, 0.7522, 0.81105, 0.86275, 0.90685, 0.6377, 0.77892, 0.75593, 1.02638, 0.89249, 0.84118, 0.77452, 0.85374, 0.75186, 0.67789, 0.79776, 0.88844, 0.85066, 0.94309, 0.77818, 0.7306, 0.76659, 1.10369, 1.38313, 1.10369, 1.06139, 0.89552, 0.8739, 0.9245, 0.9245, 0.83203, 0.9245, 0.85865, 1.09842, 0.9245, 0.9245, 1.03297, 1.07692, 0.90918, 1.03297, 0.94959, 0.9245, 0.92274, 0.9245, 0.9245, 1.02933, 0.77832, 1.20562, 0.9245, 0.8916, 0.98986, 0.86621, 0.89453, 0.79004, 0.94152, 1.77256, 0.94152, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.91729, 0.89552, 1.17889, 1.13254, 1.16359, 0.92098, 0.85284, 0.68787, 0.71353, 0.84737, 0.90747, 1.0088, 1.0044, 0.87683, 1, 1.09091, 1, 0.92229, 0.739, 1.15642, 0.92098, 0.76288, 0.80504, 0.80972, 0.75859, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.76318, 0.72346, 0.73206, 0.73206, 0.73206, 0.73206, 0.90685, 0.90685, 0.90685, 0.90685, 0.86477, 0.89249, 0.84118, 0.84118, 0.84118, 0.84118, 0.84118, 0.85284, 0.84557, 0.88844, 0.88844, 0.88844, 0.88844, 0.7306, 0.77452, 0.86331, 0.9245, 0.9245, 0.9245, 0.9245, 0.9245, 0.9245, 0.84843, 0.83203, 0.85865, 0.85865, 0.85865, 0.85865, 0.82601, 0.82601, 0.82601, 0.82601, 0.94469, 0.9245, 0.92274, 0.92274, 0.92274, 0.92274, 0.92274, 0.90747, 0.86651, 0.9245, 0.9245, 0.9245, 0.9245, 0.89453, 0.9245, 0.89453, 0.8675, 0.9245, 0.8675, 0.9245, 0.8675, 0.9245, 0.72346, 0.83203, 0.72346, 0.83203, 0.72346, 0.83203, 0.72346, 0.83203, 0.85193, 0.8875, 0.86477, 0.99034, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, 0.81105, 0.9245, 0.81105, 0.9245, 0.81105, 0.9245, 1, 1, 0.86275, 0.9245, 0.90872, 0.93591, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 1.03297, 0.90685, 0.82601, 0.77896, 1.05611, 0.6377, 1.07692, 1, 1, 0.90918, 0.75593, 1.03297, 1, 1, 0.76032, 0.9375, 0.98156, 0.93407, 0.77261, 1.11429, 0.89249, 0.9245, 1, 1, 0.89249, 0.9245, 0.92534, 0.86698, 0.9245, 0.84118, 0.92274, 0.84118, 0.92274, 0.84118, 0.92274, 0.8667, 0.86291, 0.75186, 1.02933, 1, 1, 0.75186, 1.02933, 0.67789, 0.77832, 0.67789, 0.77832, 0.67789, 0.77832, 0.67789, 0.77832, 1, 1, 0.79776, 0.97655, 0.79776, 1.23023, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.94309, 0.98986, 0.7306, 0.89453, 0.7306, 0.76659, 0.79004, 0.76659, 0.79004, 0.76659, 0.79004, 1.09231, 0.54873, 0.8675, 0.9245, 0.76318, 0.84843, 0.84557, 0.86651, 1, 1, 0.79776, 1.20562, 1.18622, 1.18622, 1, 1.1437, 0.67009, 0.96334, 0.93695, 1.35191, 1.40909, 0.95161, 1.48387, 0.8675, 0.90861, 0.6192, 0.7363, 0.64824, 0.82411, 0.56321, 0.85696, 1.23516, 0.8675, 0.81552, 0.7286, 0.84134, 0.73206, 0.76659, 0.86275, 0.84369, 0.90685, 0.77892, 0.85871, 1.02638, 0.89249, 0.75828, 0.84118, 0.85984, 0.77452, 0.76466, 0.79776, 0.7306, 0.90782, 0.77818, 0.903, 0.87291, 0.90685, 0.7306, 0.99058, 1.03667, 0.94635, 1.23516, 0.9849, 0.99058, 0.92393, 0.8916, 0.942, 1.03667, 0.75026, 0.94635, 1.0297, 1.23516, 0.90918, 0.94048, 0.98217, 0.89746, 0.84153, 0.92274, 0.82507, 0.88832, 0.84438, 0.88178, 1.03525, 0.9849, 1.00225, 0.78086, 0.97248, 0.89404, 1.23516, 0.9849, 0.92274, 0.9849, 0.89404, 0.73206, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89693, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.85865, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90933, 1, 1, 1, 1, 1, 1, 0.94309, 0.98986, 0.94309, 0.98986, 0.94309, 0.98986, 0.7306, 0.89453, 1, 1, 0.89552, 0.90527, 1, 0.90186, 1.12308, 1.12308, 1.12308, 1.12308, 1.2566, 1.2566, 1.2566, 0.89552, 0.89552, 1.42259, 0.68994, 1.03809, 1, 1, 1.0176, 1.0176, 1.11523, 1.4956, 2.01462, 0.97858, 0.82616, 0.91133, 0.83437, 0.91133, 1, 1, 1, 0.70508, 1, 1.23108, 0.79801, 0.84426, 0.84426, 0.774, 0.90572, 1.81055, 0.90749, 1.81055, 1.28809, 1.55469, 0.94434, 1.07806, 1, 0.97094, 0.7589, 0.85284, 0.90747, 1.19658, 0.69825, 0.97622, 1.33512, 0.90747, 0.90747, 0.85284, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.0336, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05859, 1.05859, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const CalibriItalicMetrics = { + lineHeight: 1.2207, + lineGap: 0.2207 +}; +const CalibriRegularFactors = [1.3877, 1, 1, 1, 1.17223, 1.1293, 0.89552, 0.91133, 0.80395, 1.02269, 1.15601, 0.91056, 0.91056, 1.2798, 0.85284, 0.89807, 1, 0.90861, 1.39016, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.96309, 0.96309, 0.85284, 0.85284, 0.85284, 0.83319, 0.88071, 0.8675, 0.81552, 0.73834, 0.85193, 0.73206, 0.7522, 0.81105, 0.86275, 0.90685, 0.6377, 0.77892, 0.75593, 1.02638, 0.89385, 0.85122, 0.77452, 0.86503, 0.75186, 0.68887, 0.79776, 0.88844, 0.85066, 0.94258, 0.77818, 0.7306, 0.76659, 1.10369, 1.39016, 1.10369, 1.06139, 0.89552, 0.8739, 0.86128, 0.94469, 0.8457, 0.94469, 0.89464, 1.09842, 0.84636, 0.94469, 1.03297, 1.07692, 0.90918, 1.03297, 0.95897, 0.94469, 0.9482, 0.94469, 0.94469, 1.04692, 0.78223, 1.20562, 0.94469, 0.90332, 0.98986, 0.86621, 0.90527, 0.79004, 0.94152, 1.77256, 0.94152, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.91729, 0.89552, 1.17889, 1.13254, 1.08707, 0.92098, 0.85284, 0.68787, 0.71353, 0.84737, 0.90747, 1.0088, 1.0044, 0.87683, 1, 1.09091, 1, 0.92229, 0.739, 1.15642, 0.92098, 0.76288, 0.80504, 0.80972, 0.75859, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.76318, 0.73834, 0.73206, 0.73206, 0.73206, 0.73206, 0.90685, 0.90685, 0.90685, 0.90685, 0.86477, 0.89385, 0.85122, 0.85122, 0.85122, 0.85122, 0.85122, 0.85284, 0.85311, 0.88844, 0.88844, 0.88844, 0.88844, 0.7306, 0.77452, 0.86331, 0.86128, 0.86128, 0.86128, 0.86128, 0.86128, 0.86128, 0.8693, 0.8457, 0.89464, 0.89464, 0.89464, 0.89464, 0.82601, 0.82601, 0.82601, 0.82601, 0.94469, 0.94469, 0.9482, 0.9482, 0.9482, 0.9482, 0.9482, 0.90747, 0.86651, 0.94469, 0.94469, 0.94469, 0.94469, 0.90527, 0.94469, 0.90527, 0.8675, 0.86128, 0.8675, 0.86128, 0.8675, 0.86128, 0.73834, 0.8457, 0.73834, 0.8457, 0.73834, 0.8457, 0.73834, 0.8457, 0.85193, 0.92454, 0.86477, 0.9921, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.81105, 0.84636, 0.81105, 0.84636, 0.81105, 0.84636, 1, 1, 0.86275, 0.94469, 0.90872, 0.95786, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 1.03297, 0.90685, 0.82601, 0.77741, 1.05611, 0.6377, 1.07692, 1, 1, 0.90918, 0.75593, 1.03297, 1, 1, 0.76032, 0.90452, 0.98156, 1.11842, 0.77261, 1.11429, 0.89385, 0.94469, 1, 1, 0.89385, 0.94469, 0.95877, 0.86901, 0.94469, 0.85122, 0.9482, 0.85122, 0.9482, 0.85122, 0.9482, 0.8667, 0.90016, 0.75186, 1.04692, 1, 1, 0.75186, 1.04692, 0.68887, 0.78223, 0.68887, 0.78223, 0.68887, 0.78223, 0.68887, 0.78223, 1, 1, 0.79776, 0.92188, 0.79776, 1.23023, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.94258, 0.98986, 0.7306, 0.90527, 0.7306, 0.76659, 0.79004, 0.76659, 0.79004, 0.76659, 0.79004, 1.09231, 0.54873, 0.8675, 0.86128, 0.76318, 0.8693, 0.85311, 0.86651, 1, 1, 0.79776, 1.20562, 1.18622, 1.18622, 1, 1.1437, 0.67742, 0.96334, 0.93695, 1.35191, 1.40909, 0.95161, 1.48387, 0.86686, 0.90861, 0.62267, 0.74359, 0.65649, 0.85498, 0.56963, 0.88254, 1.23516, 0.8675, 0.81552, 0.75443, 0.84503, 0.73206, 0.76659, 0.86275, 0.85122, 0.90685, 0.77892, 0.85746, 1.02638, 0.89385, 0.75657, 0.85122, 0.86275, 0.77452, 0.74171, 0.79776, 0.7306, 0.95165, 0.77818, 0.89772, 0.88831, 0.90685, 0.7306, 0.98142, 1.02191, 0.96576, 1.23516, 0.99018, 0.98142, 0.9236, 0.89258, 0.94035, 1.02191, 0.78848, 0.96576, 0.9561, 1.23516, 0.90918, 0.92578, 0.95424, 0.89746, 0.83969, 0.9482, 0.80113, 0.89442, 0.85208, 0.86155, 0.98022, 0.99018, 1.00452, 0.81209, 0.99247, 0.89181, 1.23516, 0.99018, 0.9482, 0.99018, 0.89181, 0.73206, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.88844, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89464, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.96766, 1, 1, 1, 1, 1, 1, 0.94258, 0.98986, 0.94258, 0.98986, 0.94258, 0.98986, 0.7306, 0.90527, 1, 1, 0.89552, 0.90527, 1, 0.90186, 1.12308, 1.12308, 1.12308, 1.12308, 1.2566, 1.2566, 1.2566, 0.89552, 0.89552, 1.42259, 0.69043, 1.03809, 1, 1, 1.0176, 1.0176, 1.11523, 1.4956, 2.01462, 0.99331, 0.82616, 0.91133, 0.84286, 0.91133, 1, 1, 1, 0.70508, 1, 1.23108, 0.79801, 0.84426, 0.84426, 0.774, 0.90527, 1.81055, 0.90527, 1.81055, 1.28809, 1.55469, 0.94434, 1.07806, 1, 0.97094, 0.7589, 0.85284, 0.90747, 1.19658, 0.69825, 0.97622, 1.33512, 0.90747, 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.0336, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05859, 1.05859, 1, 1, 1, 1.07185, 0.99413, 0.96334, 1.08065, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const CalibriRegularMetrics = { + lineHeight: 1.2207, + lineGap: 0.2207 +}; + +;// CONCATENATED MODULE: ./src/core/helvetica_factors.js +const HelveticaBoldFactors = [0.76116, 1, 1, 1.0006, 0.99998, 0.99974, 0.99973, 0.99973, 0.99982, 0.99977, 1.00087, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.00003, 1.00003, 1.00003, 1.00026, 0.9999, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 0.99973, 0.99977, 1.00026, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 0.99998, 1.0006, 0.99998, 1.00003, 0.99973, 0.99998, 0.99973, 1.00026, 0.99973, 1.00026, 0.99973, 0.99998, 1.00026, 1.00026, 1.0006, 1.0006, 0.99973, 1.0006, 0.99982, 1.00026, 1.00026, 1.00026, 1.00026, 0.99959, 0.99973, 0.99998, 1.00026, 0.99973, 1.00022, 0.99973, 0.99973, 1, 0.99959, 1.00077, 0.99959, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.00077, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.99973, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.06409, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 0.99973, 1.00026, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 1.03374, 0.99977, 1.00026, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.00042, 0.99973, 0.99973, 1.0006, 0.99977, 0.99973, 0.99973, 1.00026, 1.0006, 1.00026, 1.0006, 1.00026, 1.03828, 1.00026, 0.99999, 1.00026, 1.0006, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.9993, 0.9998, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1, 1.00016, 0.99977, 0.99959, 0.99977, 0.99959, 0.99977, 0.99959, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00026, 0.99998, 1.00026, 0.8121, 1.00026, 0.99998, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.00016, 1.00022, 1.00001, 0.99973, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 1.0006, 0.99973, 0.99977, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 0.99973, 1.00026, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 1.00034, 0.99977, 1, 0.99997, 1.00026, 1.00078, 1.00036, 0.99973, 1.00013, 1.0006, 0.99977, 0.99977, 0.99988, 0.85148, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 0.99977, 1.00001, 0.99999, 0.99977, 1.00069, 1.00022, 0.99977, 1.00001, 0.99984, 1.00026, 1.00001, 1.00024, 1.00001, 0.9999, 1, 1.0006, 1.00001, 1.00041, 0.99962, 1.00026, 1.0006, 0.99995, 1.00041, 0.99942, 0.99973, 0.99927, 1.00082, 0.99902, 1.00026, 1.00087, 1.0006, 1.00069, 0.99973, 0.99867, 0.99973, 0.9993, 1.00026, 1.00049, 1.00056, 1, 0.99988, 0.99935, 0.99995, 0.99954, 1.00055, 0.99945, 1.00032, 1.0006, 0.99995, 1.00026, 0.99995, 1.00032, 1.00001, 1.00008, 0.99971, 1.00019, 0.9994, 1.00001, 1.0006, 1.00044, 0.99973, 1.00023, 1.00047, 1, 0.99942, 0.99561, 0.99989, 1.00035, 0.99977, 1.00035, 0.99977, 1.00019, 0.99944, 1.00001, 1.00021, 0.99926, 1.00035, 1.00035, 0.99942, 1.00048, 0.99999, 0.99977, 1.00022, 1.00035, 1.00001, 0.99977, 1.00026, 0.99989, 1.00057, 1.00001, 0.99936, 1.00052, 1.00012, 0.99996, 1.00043, 1, 1.00035, 0.9994, 0.99976, 1.00035, 0.99973, 1.00052, 1.00041, 1.00119, 1.00037, 0.99973, 1.00002, 0.99986, 1.00041, 1.00041, 0.99902, 0.9996, 1.00034, 0.99999, 1.00026, 0.99999, 1.00026, 0.99973, 1.00052, 0.99973, 1, 0.99973, 1.00041, 1.00075, 0.9994, 1.0003, 0.99999, 1, 1.00041, 0.99955, 1, 0.99915, 0.99973, 0.99973, 1.00026, 1.00119, 0.99955, 0.99973, 1.0006, 0.99911, 1.0006, 1.00026, 0.99972, 1.00026, 0.99902, 1.00041, 0.99973, 0.99999, 1, 1, 1.00038, 1.0005, 1.00016, 1.00022, 1.00016, 1.00022, 1.00016, 1.00022, 1.00001, 0.99973, 1, 1, 0.99973, 1, 1, 0.99955, 1.0006, 1.0006, 1.0006, 1.0006, 1, 1, 1, 0.99973, 0.99973, 0.99972, 1, 1, 1.00106, 0.99999, 0.99998, 0.99998, 0.99999, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 0.99971, 1.00047, 1.00023, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1, 1, 1, 1, 1, 1, 1, 0.99972, 1, 1.20985, 1.39713, 1.00003, 1.00031, 1.00015, 1, 0.99561, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.99972, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const HelveticaBoldMetrics = { + lineHeight: 1.2, + lineGap: 0.2 +}; +const HelveticaBoldItalicFactors = [0.76116, 1, 1, 1.0006, 0.99998, 0.99974, 0.99973, 0.99973, 0.99982, 0.99977, 1.00087, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.00003, 1.00003, 1.00003, 1.00026, 0.9999, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 0.99973, 0.99977, 1.00026, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 0.99998, 1.0006, 0.99998, 1.00003, 0.99973, 0.99998, 0.99973, 1.00026, 0.99973, 1.00026, 0.99973, 0.99998, 1.00026, 1.00026, 1.0006, 1.0006, 0.99973, 1.0006, 0.99982, 1.00026, 1.00026, 1.00026, 1.00026, 0.99959, 0.99973, 0.99998, 1.00026, 0.99973, 1.00022, 0.99973, 0.99973, 1, 0.99959, 1.00077, 0.99959, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.00077, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.99973, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.06409, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 0.99973, 1.00026, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 1.0044, 0.99977, 1.00026, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99971, 0.99973, 0.99973, 1.0006, 0.99977, 0.99973, 0.99973, 1.00026, 1.0006, 1.00026, 1.0006, 1.00026, 1.01011, 1.00026, 0.99999, 1.00026, 1.0006, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.9993, 0.9998, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1, 1.00016, 0.99977, 0.99959, 0.99977, 0.99959, 0.99977, 0.99959, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00026, 0.99998, 1.00026, 0.8121, 1.00026, 0.99998, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.00016, 1.00022, 1.00001, 0.99973, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 1.0006, 0.99973, 0.99977, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 0.99973, 1.00026, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99977, 1, 1, 1.00026, 0.99969, 0.99972, 0.99981, 0.9998, 1.0006, 0.99977, 0.99977, 1.00022, 0.91155, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 0.99977, 1.00001, 0.99999, 0.99977, 0.99966, 1.00022, 1.00032, 1.00001, 0.99944, 1.00026, 1.00001, 0.99968, 1.00001, 1.00047, 1, 1.0006, 1.00001, 0.99981, 1.00101, 1.00026, 1.0006, 0.99948, 0.99981, 1.00064, 0.99973, 0.99942, 1.00101, 1.00061, 1.00026, 1.00069, 1.0006, 1.00014, 0.99973, 1.01322, 0.99973, 1.00065, 1.00026, 1.00012, 0.99923, 1, 1.00064, 1.00076, 0.99948, 1.00055, 1.00063, 1.00007, 0.99943, 1.0006, 0.99948, 1.00026, 0.99948, 0.99943, 1.00001, 1.00001, 1.00029, 1.00038, 1.00035, 1.00001, 1.0006, 1.0006, 0.99973, 0.99978, 1.00001, 1.00057, 0.99989, 0.99967, 0.99964, 0.99967, 0.99977, 0.99999, 0.99977, 1.00038, 0.99977, 1.00001, 0.99973, 1.00066, 0.99967, 0.99967, 1.00041, 0.99998, 0.99999, 0.99977, 1.00022, 0.99967, 1.00001, 0.99977, 1.00026, 0.99964, 1.00031, 1.00001, 0.99999, 0.99999, 1, 1.00023, 1, 1, 0.99999, 1.00035, 1.00001, 0.99999, 0.99973, 0.99977, 0.99999, 1.00058, 0.99973, 0.99973, 0.99955, 0.9995, 1.00026, 1.00026, 1.00032, 0.99989, 1.00034, 0.99999, 1.00026, 1.00026, 1.00026, 0.99973, 0.45998, 0.99973, 1.00026, 0.99973, 1.00001, 0.99999, 0.99982, 0.99994, 0.99996, 1, 1.00042, 1.00044, 1.00029, 1.00023, 0.99973, 0.99973, 1.00026, 0.99949, 1.00002, 0.99973, 1.0006, 1.0006, 1.0006, 0.99975, 1.00026, 1.00026, 1.00032, 0.98685, 0.99973, 1.00026, 1, 1, 0.99966, 1.00044, 1.00016, 1.00022, 1.00016, 1.00022, 1.00016, 1.00022, 1.00001, 0.99973, 1, 1, 0.99973, 1, 1, 0.99955, 1.0006, 1.0006, 1.0006, 1.0006, 1, 1, 1, 0.99973, 0.99973, 0.99972, 1, 1, 1.00106, 0.99999, 0.99998, 0.99998, 0.99999, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1, 0.99973, 0.99971, 0.99978, 1, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1.00098, 1, 1, 1, 1.00049, 1, 1, 0.99972, 1, 1.20985, 1.39713, 1.00003, 1.00031, 1.00015, 1, 0.99561, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.99972, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const HelveticaBoldItalicMetrics = { + lineHeight: 1.35, + lineGap: 0.2 +}; +const HelveticaItalicFactors = [0.76116, 1, 1, 1.0006, 1.0006, 1.00006, 0.99973, 0.99973, 0.99982, 1.00001, 1.00043, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1, 1.00003, 1.00003, 1.00003, 0.99973, 0.99987, 1.00001, 1.00001, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 1, 1.00001, 0.99973, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 1.0006, 1.0006, 1.0006, 0.99949, 0.99973, 0.99998, 0.99973, 0.99973, 1, 0.99973, 0.99973, 1.0006, 0.99973, 0.99973, 0.99924, 0.99924, 1, 0.99924, 0.99999, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.0006, 0.99973, 1, 0.99977, 1, 1, 1, 1.00005, 1.0009, 1.00005, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.0009, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.9998, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 1, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.06409, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 1, 0.99973, 1, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1.0288, 0.99977, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99924, 1.0006, 1.0006, 0.99946, 1.00034, 1, 0.99924, 1.00001, 1, 1, 0.99973, 0.99924, 0.99973, 0.99924, 0.99973, 1.06311, 0.99973, 1.00024, 0.99973, 0.99924, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.00041, 0.9998, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1, 1.00016, 0.99977, 0.99998, 0.99977, 0.99998, 0.99977, 0.99998, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00026, 1.0006, 1.00026, 0.89547, 1.00026, 1.0006, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.00016, 0.99977, 1.00001, 1, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 0.99924, 0.99973, 1.00001, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 1, 1.00026, 1.0006, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 1.00001, 1, 1.00054, 0.99977, 1.00084, 1.00007, 0.99973, 1.00013, 0.99924, 1.00001, 1.00001, 0.99945, 0.91221, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 1.00001, 1.00001, 0.99999, 0.99977, 0.99933, 1.00022, 1.00054, 1.00001, 1.00065, 1.00026, 1.00001, 1.0001, 1.00001, 1.00052, 1, 1.0006, 1.00001, 0.99945, 0.99897, 0.99968, 0.99924, 1.00036, 0.99945, 0.99949, 1, 1.0006, 0.99897, 0.99918, 0.99968, 0.99911, 0.99924, 1, 0.99962, 1.01487, 1, 1.0005, 0.99973, 1.00012, 1.00043, 1, 0.99995, 0.99994, 1.00036, 0.99947, 1.00019, 1.00063, 1.00025, 0.99924, 1.00036, 0.99973, 1.00036, 1.00025, 1.00001, 1.00001, 1.00027, 1.0001, 1.00068, 1.00001, 1.0006, 1.0006, 1, 1.00008, 0.99957, 0.99972, 0.9994, 0.99954, 0.99975, 1.00051, 1.00001, 1.00019, 1.00001, 1.0001, 0.99986, 1.00001, 1.00001, 1.00038, 0.99954, 0.99954, 0.9994, 1.00066, 0.99999, 0.99977, 1.00022, 1.00054, 1.00001, 0.99977, 1.00026, 0.99975, 1.0001, 1.00001, 0.99993, 0.9995, 0.99955, 1.00016, 0.99978, 0.99974, 1.00019, 1.00022, 0.99955, 1.00053, 0.99973, 1.00089, 1.00005, 0.99967, 1.00048, 0.99973, 1.00002, 1.00034, 0.99973, 0.99973, 0.99964, 1.00006, 1.00066, 0.99947, 0.99973, 0.98894, 0.99973, 1, 0.44898, 1, 0.99946, 1, 1.00039, 1.00082, 0.99991, 0.99991, 0.99985, 1.00022, 1.00023, 1.00061, 1.00006, 0.99966, 0.99973, 0.99973, 0.99973, 1.00019, 1.0008, 1, 0.99924, 0.99924, 0.99924, 0.99983, 1.00044, 0.99973, 0.99964, 0.98332, 1, 0.99973, 1, 1, 0.99962, 0.99895, 1.00016, 0.99977, 1.00016, 0.99977, 1.00016, 0.99977, 1.00001, 1, 1, 1, 0.99973, 1, 1, 0.99955, 0.99924, 0.99924, 0.99924, 0.99924, 0.99998, 0.99998, 0.99998, 0.99973, 0.99973, 0.99972, 1, 1, 1.00267, 0.99999, 0.99998, 0.99998, 1, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 1.00423, 0.99925, 0.99999, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1.00049, 1, 1.00245, 1, 1, 1, 1, 0.96329, 1, 1.20985, 1.39713, 1.00003, 0.8254, 1.00015, 1, 1.00035, 1.00027, 1.00031, 1.00031, 1.00003, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.95317, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const HelveticaItalicMetrics = { + lineHeight: 1.35, + lineGap: 0.2 +}; +const HelveticaRegularFactors = [0.76116, 1, 1, 1.0006, 1.0006, 1.00006, 0.99973, 0.99973, 0.99982, 1.00001, 1.00043, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1, 1.00003, 1.00003, 1.00003, 0.99973, 0.99987, 1.00001, 1.00001, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 1, 1.00001, 0.99973, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 1.0006, 1.0006, 1.0006, 0.99949, 0.99973, 0.99998, 0.99973, 0.99973, 1, 0.99973, 0.99973, 1.0006, 0.99973, 0.99973, 0.99924, 0.99924, 1, 0.99924, 0.99999, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.0006, 0.99973, 1, 0.99977, 1, 1, 1, 1.00005, 1.0009, 1.00005, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.0009, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.9998, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 1, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.06409, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 1, 0.99973, 1, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1.04596, 0.99977, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99924, 1.0006, 1.0006, 1.00019, 1.00034, 1, 0.99924, 1.00001, 1, 1, 0.99973, 0.99924, 0.99973, 0.99924, 0.99973, 1.02572, 0.99973, 1.00005, 0.99973, 0.99924, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99999, 0.9998, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1, 1.00016, 0.99977, 0.99998, 0.99977, 0.99998, 0.99977, 0.99998, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00026, 1.0006, 1.00026, 0.84533, 1.00026, 1.0006, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.00016, 0.99977, 1.00001, 1, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 0.99924, 0.99973, 1.00001, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 1, 1.00026, 1.0006, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99928, 1, 0.99977, 1.00013, 1.00055, 0.99947, 0.99945, 0.99941, 0.99924, 1.00001, 1.00001, 1.0004, 0.91621, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 1.00001, 1.00005, 0.99999, 0.99977, 1.00015, 1.00022, 0.99977, 1.00001, 0.99973, 1.00026, 1.00001, 1.00019, 1.00001, 0.99946, 1, 1.0006, 1.00001, 0.99978, 1.00045, 0.99973, 0.99924, 1.00023, 0.99978, 0.99966, 1, 1.00065, 1.00045, 1.00019, 0.99973, 0.99973, 0.99924, 1, 1, 0.96499, 1, 1.00055, 0.99973, 1.00008, 1.00027, 1, 0.9997, 0.99995, 1.00023, 0.99933, 1.00019, 1.00015, 1.00031, 0.99924, 1.00023, 0.99973, 1.00023, 1.00031, 1.00001, 0.99928, 1.00029, 1.00092, 1.00035, 1.00001, 1.0006, 1.0006, 1, 0.99988, 0.99975, 1, 1.00082, 0.99561, 0.9996, 1.00035, 1.00001, 0.99962, 1.00001, 1.00092, 0.99964, 1.00001, 0.99963, 0.99999, 1.00035, 1.00035, 1.00082, 0.99962, 0.99999, 0.99977, 1.00022, 1.00035, 1.00001, 0.99977, 1.00026, 0.9996, 0.99967, 1.00001, 1.00034, 1.00074, 1.00054, 1.00053, 1.00063, 0.99971, 0.99962, 1.00035, 0.99975, 0.99977, 0.99973, 1.00043, 0.99953, 1.0007, 0.99915, 0.99973, 1.00008, 0.99892, 1.00073, 1.00073, 1.00114, 0.99915, 1.00073, 0.99955, 0.99973, 1.00092, 0.99973, 1, 0.99998, 1, 1.0003, 1, 1.00043, 1.00001, 0.99969, 1.0003, 1, 1.00035, 1.00001, 0.9995, 1, 1.00092, 0.99973, 0.99973, 0.99973, 1.0007, 0.9995, 1, 0.99924, 1.0006, 0.99924, 0.99972, 1.00062, 0.99973, 1.00114, 1.00073, 1, 0.99955, 1, 1, 1.00047, 0.99968, 1.00016, 0.99977, 1.00016, 0.99977, 1.00016, 0.99977, 1.00001, 1, 1, 1, 0.99973, 1, 1, 0.99955, 0.99924, 0.99924, 0.99924, 0.99924, 0.99998, 0.99998, 0.99998, 0.99973, 0.99973, 0.99972, 1, 1, 1.00267, 0.99999, 0.99998, 0.99998, 1, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 0.99971, 0.99925, 1.00023, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1, 1, 1, 1, 1, 1, 1, 0.96329, 1, 1.20985, 1.39713, 1.00003, 0.8254, 1.00015, 1, 1.00035, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.95317, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const HelveticaRegularMetrics = { + lineHeight: 1.2, + lineGap: 0.2 +}; + +;// CONCATENATED MODULE: ./src/core/liberationsans_widths.js +const LiberationSansBoldWidths = [365, 0, 333, 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 333, 278, 333, 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, 611, 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389, 584, 333, 556, 556, 556, 556, 280, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 556, 278, 333, 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611, 611, 611, 549, 611, 611, 611, 611, 611, 556, 611, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 719, 722, 611, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 611, 778, 611, 778, 611, 778, 611, 722, 611, 722, 611, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 785, 556, 556, 278, 722, 556, 556, 611, 278, 611, 278, 611, 385, 611, 479, 611, 278, 722, 611, 722, 611, 722, 611, 708, 723, 611, 778, 611, 778, 611, 778, 611, 1000, 944, 722, 389, 722, 389, 722, 389, 667, 556, 667, 556, 667, 556, 667, 556, 611, 333, 611, 479, 611, 333, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 944, 778, 667, 556, 667, 611, 500, 611, 500, 611, 500, 278, 556, 722, 556, 1000, 889, 778, 611, 667, 556, 611, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 465, 722, 333, 853, 906, 474, 825, 927, 838, 278, 722, 722, 601, 719, 667, 611, 722, 778, 278, 722, 667, 833, 722, 644, 778, 722, 667, 600, 611, 667, 821, 667, 809, 802, 278, 667, 615, 451, 611, 278, 582, 615, 610, 556, 606, 475, 460, 611, 541, 278, 558, 556, 612, 556, 445, 611, 766, 619, 520, 684, 446, 582, 715, 576, 753, 845, 278, 582, 611, 582, 845, 667, 669, 885, 567, 711, 667, 278, 276, 556, 1094, 1062, 875, 610, 722, 622, 719, 722, 719, 722, 567, 712, 667, 904, 626, 719, 719, 610, 702, 833, 722, 778, 719, 667, 722, 611, 622, 854, 667, 730, 703, 1005, 1019, 870, 979, 719, 711, 1031, 719, 556, 618, 615, 417, 635, 556, 709, 497, 615, 615, 500, 635, 740, 604, 611, 604, 611, 556, 490, 556, 875, 556, 615, 581, 833, 844, 729, 854, 615, 552, 854, 583, 556, 556, 611, 417, 552, 556, 278, 281, 278, 969, 906, 611, 500, 615, 556, 604, 778, 611, 487, 447, 944, 778, 944, 778, 944, 778, 667, 556, 333, 333, 556, 1000, 1000, 552, 278, 278, 278, 278, 500, 500, 500, 556, 556, 350, 1000, 1000, 240, 479, 333, 333, 604, 333, 167, 396, 556, 556, 1094, 556, 885, 489, 1115, 1000, 768, 600, 834, 834, 834, 834, 1000, 500, 1000, 500, 1000, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 722, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 611, 611, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 333, 333, 333, 333, 333, 333, 333, 333]; +const LiberationSansBoldMapping = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]; +const LiberationSansBoldItalicWidths = [365, 0, 333, 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 333, 278, 333, 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, 611, 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389, 584, 333, 556, 556, 556, 556, 280, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 556, 278, 333, 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611, 611, 611, 549, 611, 611, 611, 611, 611, 556, 611, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 740, 722, 611, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 611, 778, 611, 778, 611, 778, 611, 722, 611, 722, 611, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 782, 556, 556, 278, 722, 556, 556, 611, 278, 611, 278, 611, 396, 611, 479, 611, 278, 722, 611, 722, 611, 722, 611, 708, 723, 611, 778, 611, 778, 611, 778, 611, 1000, 944, 722, 389, 722, 389, 722, 389, 667, 556, 667, 556, 667, 556, 667, 556, 611, 333, 611, 479, 611, 333, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 944, 778, 667, 556, 667, 611, 500, 611, 500, 611, 500, 278, 556, 722, 556, 1000, 889, 778, 611, 667, 556, 611, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 722, 333, 854, 906, 473, 844, 930, 847, 278, 722, 722, 610, 671, 667, 611, 722, 778, 278, 722, 667, 833, 722, 657, 778, 718, 667, 590, 611, 667, 822, 667, 829, 781, 278, 667, 620, 479, 611, 278, 591, 620, 621, 556, 610, 479, 492, 611, 558, 278, 566, 556, 603, 556, 450, 611, 712, 605, 532, 664, 409, 591, 704, 578, 773, 834, 278, 591, 611, 591, 834, 667, 667, 886, 614, 719, 667, 278, 278, 556, 1094, 1042, 854, 622, 719, 677, 719, 722, 708, 722, 614, 722, 667, 927, 643, 719, 719, 615, 687, 833, 722, 778, 719, 667, 722, 611, 677, 781, 667, 729, 708, 979, 989, 854, 1000, 708, 719, 1042, 729, 556, 619, 604, 534, 618, 556, 736, 510, 611, 611, 507, 622, 740, 604, 611, 611, 611, 556, 889, 556, 885, 556, 646, 583, 889, 935, 707, 854, 594, 552, 865, 589, 556, 556, 611, 469, 563, 556, 278, 278, 278, 969, 906, 611, 507, 619, 556, 611, 778, 611, 575, 467, 944, 778, 944, 778, 944, 778, 667, 556, 333, 333, 556, 1000, 1000, 552, 278, 278, 278, 278, 500, 500, 500, 556, 556, 350, 1000, 1000, 240, 479, 333, 333, 604, 333, 167, 396, 556, 556, 1104, 556, 885, 516, 1146, 1000, 768, 600, 834, 834, 834, 834, 999, 500, 1000, 500, 1000, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 722, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 611, 611, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 333, 333, 333, 333, 333, 333, 333, 333]; +const LiberationSansBoldItalicMapping = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]; +const LiberationSansItalicWidths = [365, 0, 333, 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 278, 278, 278, 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334, 584, 333, 556, 556, 556, 556, 260, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 537, 278, 333, 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556, 556, 556, 549, 611, 556, 556, 556, 556, 500, 556, 500, 667, 556, 667, 556, 667, 556, 722, 500, 722, 500, 722, 500, 722, 500, 722, 625, 722, 556, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 556, 778, 556, 778, 556, 778, 556, 722, 556, 722, 556, 278, 278, 278, 278, 278, 278, 278, 222, 278, 278, 733, 444, 500, 222, 667, 500, 500, 556, 222, 556, 222, 556, 281, 556, 400, 556, 222, 722, 556, 722, 556, 722, 556, 615, 723, 556, 778, 556, 778, 556, 778, 556, 1000, 944, 722, 333, 722, 333, 722, 333, 667, 500, 667, 500, 667, 500, 667, 500, 611, 278, 611, 354, 611, 278, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 944, 722, 667, 500, 667, 611, 500, 611, 500, 611, 500, 222, 556, 667, 556, 1000, 889, 778, 611, 667, 500, 611, 278, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 667, 278, 789, 846, 389, 794, 865, 775, 222, 667, 667, 570, 671, 667, 611, 722, 778, 278, 667, 667, 833, 722, 648, 778, 725, 667, 600, 611, 667, 837, 667, 831, 761, 278, 667, 570, 439, 555, 222, 550, 570, 571, 500, 556, 439, 463, 555, 542, 222, 500, 492, 548, 500, 447, 556, 670, 573, 486, 603, 374, 550, 652, 546, 728, 779, 222, 550, 556, 550, 779, 667, 667, 843, 544, 708, 667, 278, 278, 500, 1066, 982, 844, 589, 715, 639, 724, 667, 651, 667, 544, 704, 667, 917, 614, 715, 715, 589, 686, 833, 722, 778, 725, 667, 722, 611, 639, 795, 667, 727, 673, 920, 923, 805, 886, 651, 694, 1022, 682, 556, 562, 522, 493, 553, 556, 688, 465, 556, 556, 472, 564, 686, 550, 556, 556, 556, 500, 833, 500, 835, 500, 572, 518, 830, 851, 621, 736, 526, 492, 752, 534, 556, 556, 556, 378, 496, 500, 222, 222, 222, 910, 828, 556, 472, 565, 500, 556, 778, 556, 492, 339, 944, 722, 944, 722, 944, 722, 667, 500, 333, 333, 556, 1000, 1000, 552, 222, 222, 222, 222, 333, 333, 333, 556, 556, 350, 1000, 1000, 188, 354, 333, 333, 500, 333, 167, 365, 556, 556, 1094, 556, 885, 323, 1083, 1000, 768, 600, 834, 834, 834, 834, 1000, 500, 998, 500, 1000, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 719, 274, 549, 549, 584, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 500, 500, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 294, 294, 324, 324, 316, 328, 398, 285]; +const LiberationSansItalicMapping = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]; +const LiberationSansRegularWidths = [365, 0, 333, 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 278, 278, 278, 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334, 584, 333, 556, 556, 556, 556, 260, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 537, 278, 333, 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1000, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556, 556, 556, 549, 611, 556, 556, 556, 556, 500, 556, 500, 667, 556, 667, 556, 667, 556, 722, 500, 722, 500, 722, 500, 722, 500, 722, 615, 722, 556, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 556, 778, 556, 778, 556, 778, 556, 722, 556, 722, 556, 278, 278, 278, 278, 278, 278, 278, 222, 278, 278, 735, 444, 500, 222, 667, 500, 500, 556, 222, 556, 222, 556, 292, 556, 334, 556, 222, 722, 556, 722, 556, 722, 556, 604, 723, 556, 778, 556, 778, 556, 778, 556, 1000, 944, 722, 333, 722, 333, 722, 333, 667, 500, 667, 500, 667, 500, 667, 500, 611, 278, 611, 375, 611, 278, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 944, 722, 667, 500, 667, 611, 500, 611, 500, 611, 500, 222, 556, 667, 556, 1000, 889, 778, 611, 667, 500, 611, 278, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 667, 278, 784, 838, 384, 774, 855, 752, 222, 667, 667, 551, 668, 667, 611, 722, 778, 278, 667, 668, 833, 722, 650, 778, 722, 667, 618, 611, 667, 798, 667, 835, 748, 278, 667, 578, 446, 556, 222, 547, 578, 575, 500, 557, 446, 441, 556, 556, 222, 500, 500, 576, 500, 448, 556, 690, 569, 482, 617, 395, 547, 648, 525, 713, 781, 222, 547, 556, 547, 781, 667, 667, 865, 542, 719, 667, 278, 278, 500, 1057, 1010, 854, 583, 722, 635, 719, 667, 656, 667, 542, 677, 667, 923, 604, 719, 719, 583, 656, 833, 722, 778, 719, 667, 722, 611, 635, 760, 667, 740, 667, 917, 938, 792, 885, 656, 719, 1010, 722, 556, 573, 531, 365, 583, 556, 669, 458, 559, 559, 438, 583, 688, 552, 556, 542, 556, 500, 458, 500, 823, 500, 573, 521, 802, 823, 625, 719, 521, 510, 750, 542, 556, 556, 556, 365, 510, 500, 222, 278, 222, 906, 812, 556, 438, 559, 500, 552, 778, 556, 489, 411, 944, 722, 944, 722, 944, 722, 667, 500, 333, 333, 556, 1000, 1000, 552, 222, 222, 222, 222, 333, 333, 333, 556, 556, 350, 1000, 1000, 188, 354, 333, 333, 500, 333, 167, 365, 556, 556, 1094, 556, 885, 323, 1073, 1000, 768, 600, 834, 834, 834, 834, 1000, 500, 1000, 500, 1000, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 719, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 500, 500, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 294, 294, 324, 324, 316, 328, 398, 285]; +const LiberationSansRegularMapping = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1]; + +;// CONCATENATED MODULE: ./src/core/myriadpro_factors.js +const MyriadProBoldFactors = [1.36898, 1, 1, 0.72706, 0.80479, 0.83734, 0.98894, 0.99793, 0.9897, 0.93884, 0.86209, 0.94292, 0.94292, 1.16661, 1.02058, 0.93582, 0.96694, 0.93582, 1.19137, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.78076, 0.78076, 1.02058, 1.02058, 1.02058, 0.72851, 0.78966, 0.90838, 0.83637, 0.82391, 0.96376, 0.80061, 0.86275, 0.8768, 0.95407, 1.0258, 0.73901, 0.85022, 0.83655, 1.0156, 0.95546, 0.92179, 0.87107, 0.92179, 0.82114, 0.8096, 0.89713, 0.94438, 0.95353, 0.94083, 0.91905, 0.90406, 0.9446, 0.94292, 1.18777, 0.94292, 1.02058, 0.89903, 0.90088, 0.94938, 0.97898, 0.81093, 0.97571, 0.94938, 1.024, 0.9577, 0.95933, 0.98621, 1.0474, 0.97455, 0.98981, 0.9672, 0.95933, 0.9446, 0.97898, 0.97407, 0.97646, 0.78036, 1.10208, 0.95442, 0.95298, 0.97579, 0.9332, 0.94039, 0.938, 0.80687, 1.01149, 0.80687, 1.02058, 0.80479, 0.99793, 0.99793, 0.99793, 0.99793, 1.01149, 1.00872, 0.90088, 0.91882, 1.0213, 0.8361, 1.02058, 0.62295, 0.54324, 0.89022, 1.08595, 1, 1, 0.90088, 1, 0.97455, 0.93582, 0.90088, 1, 1.05686, 0.8361, 0.99642, 0.99642, 0.99642, 0.72851, 0.90838, 0.90838, 0.90838, 0.90838, 0.90838, 0.90838, 0.868, 0.82391, 0.80061, 0.80061, 0.80061, 0.80061, 1.0258, 1.0258, 1.0258, 1.0258, 0.97484, 0.95546, 0.92179, 0.92179, 0.92179, 0.92179, 0.92179, 1.02058, 0.92179, 0.94438, 0.94438, 0.94438, 0.94438, 0.90406, 0.86958, 0.98225, 0.94938, 0.94938, 0.94938, 0.94938, 0.94938, 0.94938, 0.9031, 0.81093, 0.94938, 0.94938, 0.94938, 0.94938, 0.98621, 0.98621, 0.98621, 0.98621, 0.93969, 0.95933, 0.9446, 0.9446, 0.9446, 0.9446, 0.9446, 1.08595, 0.9446, 0.95442, 0.95442, 0.95442, 0.95442, 0.94039, 0.97898, 0.94039, 0.90838, 0.94938, 0.90838, 0.94938, 0.90838, 0.94938, 0.82391, 0.81093, 0.82391, 0.81093, 0.82391, 0.81093, 0.82391, 0.81093, 0.96376, 0.84313, 0.97484, 0.97571, 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.8768, 0.9577, 0.8768, 0.9577, 0.8768, 0.9577, 1, 1, 0.95407, 0.95933, 0.97069, 0.95933, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 0.887, 1.01591, 0.73901, 1.0474, 1, 1, 0.97455, 0.83655, 0.98981, 1, 1, 0.83655, 0.73977, 0.83655, 0.73903, 0.84638, 1.033, 0.95546, 0.95933, 1, 1, 0.95546, 0.95933, 0.8271, 0.95417, 0.95933, 0.92179, 0.9446, 0.92179, 0.9446, 0.92179, 0.9446, 0.936, 0.91964, 0.82114, 0.97646, 1, 1, 0.82114, 0.97646, 0.8096, 0.78036, 0.8096, 0.78036, 1, 1, 0.8096, 0.78036, 1, 1, 0.89713, 0.77452, 0.89713, 1.10208, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94083, 0.97579, 0.90406, 0.94039, 0.90406, 0.9446, 0.938, 0.9446, 0.938, 0.9446, 0.938, 1, 0.99793, 0.90838, 0.94938, 0.868, 0.9031, 0.92179, 0.9446, 1, 1, 0.89713, 1.10208, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90989, 0.9358, 0.91945, 0.83181, 0.75261, 0.87992, 0.82976, 0.96034, 0.83689, 0.97268, 1.0078, 0.90838, 0.83637, 0.8019, 0.90157, 0.80061, 0.9446, 0.95407, 0.92436, 1.0258, 0.85022, 0.97153, 1.0156, 0.95546, 0.89192, 0.92179, 0.92361, 0.87107, 0.96318, 0.89713, 0.93704, 0.95638, 0.91905, 0.91709, 0.92796, 1.0258, 0.93704, 0.94836, 1.0373, 0.95933, 1.0078, 0.95871, 0.94836, 0.96174, 0.92601, 0.9498, 0.98607, 0.95776, 0.95933, 1.05453, 1.0078, 0.98275, 0.9314, 0.95617, 0.91701, 1.05993, 0.9446, 0.78367, 0.9553, 1, 0.86832, 1.0128, 0.95871, 0.99394, 0.87548, 0.96361, 0.86774, 1.0078, 0.95871, 0.9446, 0.95871, 0.86774, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.94083, 0.97579, 0.94083, 0.97579, 0.94083, 0.97579, 0.90406, 0.94039, 0.96694, 1, 0.89903, 1, 1, 1, 0.93582, 0.93582, 0.93582, 1, 0.908, 0.908, 0.918, 0.94219, 0.94219, 0.96544, 1, 1.285, 1, 1, 0.81079, 0.81079, 1, 1, 0.74854, 1, 1, 1, 1, 0.99793, 1, 1, 1, 0.65, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.17173, 1, 0.80535, 0.76169, 1.02058, 1.0732, 1.05486, 1, 1, 1.30692, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.16161, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const MyriadProBoldMetrics = { + lineHeight: 1.2, + lineGap: 0.2 +}; +const MyriadProBoldItalicFactors = [1.36898, 1, 1, 0.66227, 0.80779, 0.81625, 0.97276, 0.97276, 0.97733, 0.92222, 0.83266, 0.94292, 0.94292, 1.16148, 1.02058, 0.93582, 0.96694, 0.93582, 1.17337, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.78076, 0.78076, 1.02058, 1.02058, 1.02058, 0.71541, 0.76813, 0.85576, 0.80591, 0.80729, 0.94299, 0.77512, 0.83655, 0.86523, 0.92222, 0.98621, 0.71743, 0.81698, 0.79726, 0.98558, 0.92222, 0.90637, 0.83809, 0.90637, 0.80729, 0.76463, 0.86275, 0.90699, 0.91605, 0.9154, 0.85308, 0.85458, 0.90531, 0.94292, 1.21296, 0.94292, 1.02058, 0.89903, 1.18616, 0.99613, 0.91677, 0.78216, 0.91677, 0.90083, 0.98796, 0.9135, 0.92168, 0.95381, 0.98981, 0.95298, 0.95381, 0.93459, 0.92168, 0.91513, 0.92004, 0.91677, 0.95077, 0.748, 1.04502, 0.91677, 0.92061, 0.94236, 0.89544, 0.89364, 0.9, 0.80687, 0.8578, 0.80687, 1.02058, 0.80779, 0.97276, 0.97276, 0.97276, 0.97276, 0.8578, 0.99973, 1.18616, 0.91339, 1.08074, 0.82891, 1.02058, 0.55509, 0.71526, 0.89022, 1.08595, 1, 1, 1.18616, 1, 0.96736, 0.93582, 1.18616, 1, 1.04864, 0.82711, 0.99043, 0.99043, 0.99043, 0.71541, 0.85576, 0.85576, 0.85576, 0.85576, 0.85576, 0.85576, 0.845, 0.80729, 0.77512, 0.77512, 0.77512, 0.77512, 0.98621, 0.98621, 0.98621, 0.98621, 0.95961, 0.92222, 0.90637, 0.90637, 0.90637, 0.90637, 0.90637, 1.02058, 0.90251, 0.90699, 0.90699, 0.90699, 0.90699, 0.85458, 0.83659, 0.94951, 0.99613, 0.99613, 0.99613, 0.99613, 0.99613, 0.99613, 0.85811, 0.78216, 0.90083, 0.90083, 0.90083, 0.90083, 0.95381, 0.95381, 0.95381, 0.95381, 0.9135, 0.92168, 0.91513, 0.91513, 0.91513, 0.91513, 0.91513, 1.08595, 0.91677, 0.91677, 0.91677, 0.91677, 0.91677, 0.89364, 0.92332, 0.89364, 0.85576, 0.99613, 0.85576, 0.99613, 0.85576, 0.99613, 0.80729, 0.78216, 0.80729, 0.78216, 0.80729, 0.78216, 0.80729, 0.78216, 0.94299, 0.76783, 0.95961, 0.91677, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, 0.86523, 0.9135, 0.86523, 0.9135, 0.86523, 0.9135, 1, 1, 0.92222, 0.92168, 0.92222, 0.92168, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.86036, 0.97096, 0.71743, 0.98981, 1, 1, 0.95298, 0.79726, 0.95381, 1, 1, 0.79726, 0.6894, 0.79726, 0.74321, 0.81691, 1.0006, 0.92222, 0.92168, 1, 1, 0.92222, 0.92168, 0.79464, 0.92098, 0.92168, 0.90637, 0.91513, 0.90637, 0.91513, 0.90637, 0.91513, 0.909, 0.87514, 0.80729, 0.95077, 1, 1, 0.80729, 0.95077, 0.76463, 0.748, 0.76463, 0.748, 1, 1, 0.76463, 0.748, 1, 1, 0.86275, 0.72651, 0.86275, 1.04502, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.9154, 0.94236, 0.85458, 0.89364, 0.85458, 0.90531, 0.9, 0.90531, 0.9, 0.90531, 0.9, 1, 0.97276, 0.85576, 0.99613, 0.845, 0.85811, 0.90251, 0.91677, 1, 1, 0.86275, 1.04502, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.00899, 1.30628, 0.85576, 0.80178, 0.66862, 0.7927, 0.69323, 0.88127, 0.72459, 0.89711, 0.95381, 0.85576, 0.80591, 0.7805, 0.94729, 0.77512, 0.90531, 0.92222, 0.90637, 0.98621, 0.81698, 0.92655, 0.98558, 0.92222, 0.85359, 0.90637, 0.90976, 0.83809, 0.94523, 0.86275, 0.83509, 0.93157, 0.85308, 0.83392, 0.92346, 0.98621, 0.83509, 0.92886, 0.91324, 0.92168, 0.95381, 0.90646, 0.92886, 0.90557, 0.86847, 0.90276, 0.91324, 0.86842, 0.92168, 0.99531, 0.95381, 0.9224, 0.85408, 0.92699, 0.86847, 1.0051, 0.91513, 0.80487, 0.93481, 1, 0.88159, 1.05214, 0.90646, 0.97355, 0.81539, 0.89398, 0.85923, 0.95381, 0.90646, 0.91513, 0.90646, 0.85923, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9154, 0.94236, 0.9154, 0.94236, 0.9154, 0.94236, 0.85458, 0.89364, 0.96694, 1, 0.89903, 1, 1, 1, 0.91782, 0.91782, 0.91782, 1, 0.896, 0.896, 0.896, 0.9332, 0.9332, 0.95973, 1, 1.26, 1, 1, 0.80479, 0.80178, 1, 1, 0.85633, 1, 1, 1, 1, 0.97276, 1, 1, 1, 0.698, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.14542, 1, 0.79199, 0.78694, 1.02058, 1.03493, 1.05486, 1, 1, 1.23026, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.20006, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const MyriadProBoldItalicMetrics = { + lineHeight: 1.2, + lineGap: 0.2 +}; +const MyriadProItalicFactors = [1.36898, 1, 1, 0.65507, 0.84943, 0.85639, 0.88465, 0.88465, 0.86936, 0.88307, 0.86948, 0.85283, 0.85283, 1.06383, 1.02058, 0.75945, 0.9219, 0.75945, 1.17337, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.75945, 0.75945, 1.02058, 1.02058, 1.02058, 0.69046, 0.70926, 0.85158, 0.77812, 0.76852, 0.89591, 0.70466, 0.76125, 0.80094, 0.86822, 0.83864, 0.728, 0.77212, 0.79475, 0.93637, 0.87514, 0.8588, 0.76013, 0.8588, 0.72421, 0.69866, 0.77598, 0.85991, 0.80811, 0.87832, 0.78112, 0.77512, 0.8562, 1.0222, 1.18417, 1.0222, 1.27014, 0.89903, 1.15012, 0.93859, 0.94399, 0.846, 0.94399, 0.81453, 1.0186, 0.94219, 0.96017, 1.03075, 1.02175, 0.912, 1.03075, 0.96998, 0.96017, 0.93859, 0.94399, 0.94399, 0.95493, 0.746, 1.12658, 0.94578, 0.91, 0.979, 0.882, 0.882, 0.83, 0.85034, 0.83537, 0.85034, 1.02058, 0.70869, 0.88465, 0.88465, 0.88465, 0.88465, 0.83537, 0.90083, 1.15012, 0.9161, 0.94565, 0.73541, 1.02058, 0.53609, 0.69353, 0.79519, 1.08595, 1, 1, 1.15012, 1, 0.91974, 0.75945, 1.15012, 1, 0.9446, 0.73361, 0.9005, 0.9005, 0.9005, 0.62864, 0.85158, 0.85158, 0.85158, 0.85158, 0.85158, 0.85158, 0.773, 0.76852, 0.70466, 0.70466, 0.70466, 0.70466, 0.83864, 0.83864, 0.83864, 0.83864, 0.90561, 0.87514, 0.8588, 0.8588, 0.8588, 0.8588, 0.8588, 1.02058, 0.85751, 0.85991, 0.85991, 0.85991, 0.85991, 0.77512, 0.76013, 0.88075, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 0.8075, 0.846, 0.81453, 0.81453, 0.81453, 0.81453, 0.82424, 0.82424, 0.82424, 0.82424, 0.9278, 0.96017, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 1.08595, 0.8562, 0.94578, 0.94578, 0.94578, 0.94578, 0.882, 0.94578, 0.882, 0.85158, 0.93859, 0.85158, 0.93859, 0.85158, 0.93859, 0.76852, 0.846, 0.76852, 0.846, 0.76852, 0.846, 0.76852, 0.846, 0.89591, 0.8544, 0.90561, 0.94399, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.80094, 0.94219, 0.80094, 0.94219, 0.80094, 0.94219, 1, 1, 0.86822, 0.96017, 0.86822, 0.96017, 0.83864, 0.82424, 0.83864, 0.82424, 0.83864, 0.82424, 0.83864, 1.03075, 0.83864, 0.82424, 0.81402, 1.02738, 0.728, 1.02175, 1, 1, 0.912, 0.79475, 1.03075, 1, 1, 0.79475, 0.83911, 0.79475, 0.66266, 0.80553, 1.06676, 0.87514, 0.96017, 1, 1, 0.87514, 0.96017, 0.86865, 0.87396, 0.96017, 0.8588, 0.93859, 0.8588, 0.93859, 0.8588, 0.93859, 0.867, 0.84759, 0.72421, 0.95493, 1, 1, 0.72421, 0.95493, 0.69866, 0.746, 0.69866, 0.746, 1, 1, 0.69866, 0.746, 1, 1, 0.77598, 0.88417, 0.77598, 1.12658, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.87832, 0.979, 0.77512, 0.882, 0.77512, 0.8562, 0.83, 0.8562, 0.83, 0.8562, 0.83, 1, 0.88465, 0.85158, 0.93859, 0.773, 0.8075, 0.85751, 0.8562, 1, 1, 0.77598, 1.12658, 1.15012, 1.15012, 1.15012, 1.15012, 1.15012, 1.15313, 1.15012, 1.15012, 1.15012, 1.08106, 1.03901, 0.85158, 0.77025, 0.62264, 0.7646, 0.65351, 0.86026, 0.69461, 0.89947, 1.03075, 0.85158, 0.77812, 0.76449, 0.88836, 0.70466, 0.8562, 0.86822, 0.8588, 0.83864, 0.77212, 0.85308, 0.93637, 0.87514, 0.82352, 0.8588, 0.85701, 0.76013, 0.89058, 0.77598, 0.8156, 0.82565, 0.78112, 0.77899, 0.89386, 0.83864, 0.8156, 0.9486, 0.92388, 0.96186, 1.03075, 0.91123, 0.9486, 0.93298, 0.878, 0.93942, 0.92388, 0.84596, 0.96186, 0.95119, 1.03075, 0.922, 0.88787, 0.95829, 0.88, 0.93559, 0.93859, 0.78815, 0.93758, 1, 0.89217, 1.03737, 0.91123, 0.93969, 0.77487, 0.85769, 0.86799, 1.03075, 0.91123, 0.93859, 0.91123, 0.86799, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.87832, 0.979, 0.87832, 0.979, 0.87832, 0.979, 0.77512, 0.882, 0.9219, 1, 0.89903, 1, 1, 1, 0.87321, 0.87321, 0.87321, 1, 1.027, 1.027, 1.027, 0.86847, 0.86847, 0.79121, 1, 1.124, 1, 1, 0.73572, 0.73572, 1, 1, 0.85034, 1, 1, 1, 1, 0.88465, 1, 1, 1, 0.669, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.04828, 1, 0.74948, 0.75187, 1.02058, 0.98391, 1.02119, 1, 1, 1.06233, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05233, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const MyriadProItalicMetrics = { + lineHeight: 1.2, + lineGap: 0.2 +}; +const MyriadProRegularFactors = [1.36898, 1, 1, 0.76305, 0.82784, 0.94935, 0.89364, 0.92241, 0.89073, 0.90706, 0.98472, 0.85283, 0.85283, 1.0664, 1.02058, 0.74505, 0.9219, 0.74505, 1.23456, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.74505, 0.74505, 1.02058, 1.02058, 1.02058, 0.73002, 0.72601, 0.91755, 0.8126, 0.80314, 0.92222, 0.73764, 0.79726, 0.83051, 0.90284, 0.86023, 0.74, 0.8126, 0.84869, 0.96518, 0.91115, 0.8858, 0.79761, 0.8858, 0.74498, 0.73914, 0.81363, 0.89591, 0.83659, 0.89633, 0.85608, 0.8111, 0.90531, 1.0222, 1.22736, 1.0222, 1.27014, 0.89903, 0.90088, 0.86667, 1.0231, 0.896, 1.01411, 0.90083, 1.05099, 1.00512, 0.99793, 1.05326, 1.09377, 0.938, 1.06226, 1.00119, 0.99793, 0.98714, 1.0231, 1.01231, 0.98196, 0.792, 1.19137, 0.99074, 0.962, 1.01915, 0.926, 0.942, 0.856, 0.85034, 0.92006, 0.85034, 1.02058, 0.69067, 0.92241, 0.92241, 0.92241, 0.92241, 0.92006, 0.9332, 0.90088, 0.91882, 0.93484, 0.75339, 1.02058, 0.56866, 0.54324, 0.79519, 1.08595, 1, 1, 0.90088, 1, 0.95325, 0.74505, 0.90088, 1, 0.97198, 0.75339, 0.91009, 0.91009, 0.91009, 0.66466, 0.91755, 0.91755, 0.91755, 0.91755, 0.91755, 0.91755, 0.788, 0.80314, 0.73764, 0.73764, 0.73764, 0.73764, 0.86023, 0.86023, 0.86023, 0.86023, 0.92915, 0.91115, 0.8858, 0.8858, 0.8858, 0.8858, 0.8858, 1.02058, 0.8858, 0.89591, 0.89591, 0.89591, 0.89591, 0.8111, 0.79611, 0.89713, 0.86667, 0.86667, 0.86667, 0.86667, 0.86667, 0.86667, 0.86936, 0.896, 0.90083, 0.90083, 0.90083, 0.90083, 0.84224, 0.84224, 0.84224, 0.84224, 0.97276, 0.99793, 0.98714, 0.98714, 0.98714, 0.98714, 0.98714, 1.08595, 0.89876, 0.99074, 0.99074, 0.99074, 0.99074, 0.942, 1.0231, 0.942, 0.91755, 0.86667, 0.91755, 0.86667, 0.91755, 0.86667, 0.80314, 0.896, 0.80314, 0.896, 0.80314, 0.896, 0.80314, 0.896, 0.92222, 0.93372, 0.92915, 1.01411, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.83051, 1.00512, 0.83051, 1.00512, 0.83051, 1.00512, 1, 1, 0.90284, 0.99793, 0.90976, 0.99793, 0.86023, 0.84224, 0.86023, 0.84224, 0.86023, 0.84224, 0.86023, 1.05326, 0.86023, 0.84224, 0.82873, 1.07469, 0.74, 1.09377, 1, 1, 0.938, 0.84869, 1.06226, 1, 1, 0.84869, 0.83704, 0.84869, 0.81441, 0.85588, 1.08927, 0.91115, 0.99793, 1, 1, 0.91115, 0.99793, 0.91887, 0.90991, 0.99793, 0.8858, 0.98714, 0.8858, 0.98714, 0.8858, 0.98714, 0.894, 0.91434, 0.74498, 0.98196, 1, 1, 0.74498, 0.98196, 0.73914, 0.792, 0.73914, 0.792, 1, 1, 0.73914, 0.792, 1, 1, 0.81363, 0.904, 0.81363, 1.19137, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89633, 1.01915, 0.8111, 0.942, 0.8111, 0.90531, 0.856, 0.90531, 0.856, 0.90531, 0.856, 1, 0.92241, 0.91755, 0.86667, 0.788, 0.86936, 0.8858, 0.89876, 1, 1, 0.81363, 1.19137, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90388, 1.03901, 0.92138, 0.78105, 0.7154, 0.86169, 0.80513, 0.94007, 0.82528, 0.98612, 1.06226, 0.91755, 0.8126, 0.81884, 0.92819, 0.73764, 0.90531, 0.90284, 0.8858, 0.86023, 0.8126, 0.91172, 0.96518, 0.91115, 0.83089, 0.8858, 0.87791, 0.79761, 0.89297, 0.81363, 0.88157, 0.89992, 0.85608, 0.81992, 0.94307, 0.86023, 0.88157, 0.95308, 0.98699, 0.99793, 1.06226, 0.95817, 0.95308, 0.97358, 0.928, 0.98088, 0.98699, 0.92761, 0.99793, 0.96017, 1.06226, 0.986, 0.944, 0.95978, 0.938, 0.96705, 0.98714, 0.80442, 0.98972, 1, 0.89762, 1.04552, 0.95817, 0.99007, 0.87064, 0.91879, 0.88888, 1.06226, 0.95817, 0.98714, 0.95817, 0.88888, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89633, 1.01915, 0.89633, 1.01915, 0.89633, 1.01915, 0.8111, 0.942, 0.9219, 1, 0.89903, 1, 1, 1, 0.93173, 0.93173, 0.93173, 1, 1.06304, 1.06304, 1.06904, 0.89903, 0.89903, 0.80549, 1, 1.156, 1, 1, 0.76575, 0.76575, 1, 1, 0.72458, 1, 1, 1, 1, 0.92241, 1, 1, 1, 0.619, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.07257, 1, 0.74705, 0.71119, 1.02058, 1.024, 1.02119, 1, 1, 1.1536, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05638, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const MyriadProRegularMetrics = { + lineHeight: 1.2, + lineGap: 0.2 +}; + +;// CONCATENATED MODULE: ./src/core/segoeui_factors.js +const SegoeuiBoldFactors = [1.76738, 1, 1, 0.99297, 0.9824, 1.04016, 1.06497, 1.03424, 0.97529, 1.17647, 1.23203, 1.1085, 1.1085, 1.16939, 1.2107, 0.9754, 1.21408, 0.9754, 1.59578, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 0.81378, 0.81378, 1.2107, 1.2107, 1.2107, 0.71703, 0.97847, 0.97363, 0.88776, 0.8641, 1.02096, 0.79795, 0.85132, 0.914, 1.06085, 1.1406, 0.8007, 0.89858, 0.83693, 1.14889, 1.09398, 0.97489, 0.92094, 0.97489, 0.90399, 0.84041, 0.95923, 1.00135, 1, 1.06467, 0.98243, 0.90996, 0.99361, 1.1085, 1.56942, 1.1085, 1.2107, 0.74627, 0.94282, 0.96752, 1.01519, 0.86304, 1.01359, 0.97278, 1.15103, 1.01359, 0.98561, 1.02285, 1.02285, 1.00527, 1.02285, 1.0302, 0.99041, 1.0008, 1.01519, 1.01359, 1.02258, 0.79104, 1.16862, 0.99041, 0.97454, 1.02511, 0.99298, 0.96752, 0.95801, 0.94856, 1.16579, 0.94856, 1.2107, 0.9824, 1.03424, 1.03424, 1, 1.03424, 1.16579, 0.8727, 1.3871, 1.18622, 1.10818, 1.04478, 1.2107, 1.18622, 0.75155, 0.94994, 1.28826, 1.21408, 1.21408, 0.91056, 1, 0.91572, 0.9754, 0.64663, 1.18328, 1.24866, 1.04478, 1.14169, 1.15749, 1.17389, 0.71703, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.93506, 0.8641, 0.79795, 0.79795, 0.79795, 0.79795, 1.1406, 1.1406, 1.1406, 1.1406, 1.02096, 1.09398, 0.97426, 0.97426, 0.97426, 0.97426, 0.97426, 1.2107, 0.97489, 1.00135, 1.00135, 1.00135, 1.00135, 0.90996, 0.92094, 1.02798, 0.96752, 0.96752, 0.96752, 0.96752, 0.96752, 0.96752, 0.93136, 0.86304, 0.97278, 0.97278, 0.97278, 0.97278, 1.02285, 1.02285, 1.02285, 1.02285, 0.97122, 0.99041, 1, 1, 1, 1, 1, 1.28826, 1.0008, 0.99041, 0.99041, 0.99041, 0.99041, 0.96752, 1.01519, 0.96752, 0.97363, 0.96752, 0.97363, 0.96752, 0.97363, 0.96752, 0.8641, 0.86304, 0.8641, 0.86304, 0.8641, 0.86304, 0.8641, 0.86304, 1.02096, 1.03057, 1.02096, 1.03517, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.914, 1.01359, 0.914, 1.01359, 0.914, 1.01359, 1, 1, 1.06085, 0.98561, 1.06085, 1.00879, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 0.97138, 1.08692, 0.8007, 1.02285, 1, 1, 1.00527, 0.83693, 1.02285, 1, 1, 0.83693, 0.9455, 0.83693, 0.90418, 0.83693, 1.13005, 1.09398, 0.99041, 1, 1, 1.09398, 0.99041, 0.96692, 1.09251, 0.99041, 0.97489, 1.0008, 0.97489, 1.0008, 0.97489, 1.0008, 0.93994, 0.97931, 0.90399, 1.02258, 1, 1, 0.90399, 1.02258, 0.84041, 0.79104, 0.84041, 0.79104, 0.84041, 0.79104, 0.84041, 0.79104, 1, 1, 0.95923, 1.07034, 0.95923, 1.16862, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.06467, 1.02511, 0.90996, 0.96752, 0.90996, 0.99361, 0.95801, 0.99361, 0.95801, 0.99361, 0.95801, 1.07733, 1.03424, 0.97363, 0.96752, 0.93506, 0.93136, 0.97489, 1.0008, 1, 1, 0.95923, 1.16862, 1.15103, 1.15103, 1.01173, 1.03959, 0.75953, 0.81378, 0.79912, 1.15103, 1.21994, 0.95161, 0.87815, 1.01149, 0.81525, 0.7676, 0.98167, 1.01134, 1.02546, 0.84097, 1.03089, 1.18102, 0.97363, 0.88776, 0.85134, 0.97826, 0.79795, 0.99361, 1.06085, 0.97489, 1.1406, 0.89858, 1.0388, 1.14889, 1.09398, 0.86039, 0.97489, 1.0595, 0.92094, 0.94793, 0.95923, 0.90996, 0.99346, 0.98243, 1.02112, 0.95493, 1.1406, 0.90996, 1.03574, 1.02597, 1.0008, 1.18102, 1.06628, 1.03574, 1.0192, 1.01932, 1.00886, 0.97531, 1.0106, 1.0008, 1.13189, 1.18102, 1.02277, 0.98683, 1.0016, 0.99561, 1.07237, 1.0008, 0.90434, 0.99921, 0.93803, 0.8965, 1.23085, 1.06628, 1.04983, 0.96268, 1.0499, 0.98439, 1.18102, 1.06628, 1.0008, 1.06628, 0.98439, 0.79795, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.09466, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.97278, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.02065, 1, 1, 1, 1, 1, 1, 1.06467, 1.02511, 1.06467, 1.02511, 1.06467, 1.02511, 0.90996, 0.96752, 1, 1.21408, 0.89903, 1, 1, 0.75155, 1.04394, 1.04394, 1.04394, 1.04394, 0.98633, 0.98633, 0.98633, 0.73047, 0.73047, 1.20642, 0.91211, 1.25635, 1.222, 1.02956, 1.03372, 1.03372, 0.96039, 1.24633, 1, 1.12454, 0.93503, 1.03424, 1.19687, 1.03424, 1, 1, 1, 0.771, 1, 1, 1.15749, 1.15749, 1.15749, 1.10948, 0.86279, 0.94434, 0.86279, 0.94434, 0.86182, 1, 1, 1.16897, 1, 0.96085, 0.90137, 1.2107, 1.18416, 1.13973, 0.69825, 0.9716, 2.10339, 1.29004, 1.29004, 1.21172, 1.29004, 1.29004, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18874, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.09193, 1.09193, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const SegoeuiBoldMetrics = { + lineHeight: 1.33008, + lineGap: 0 +}; +const SegoeuiBoldItalicFactors = [1.76738, 1, 1, 0.98946, 1.03959, 1.04016, 1.02809, 1.036, 0.97639, 1.10953, 1.23203, 1.11144, 1.11144, 1.16939, 1.21237, 0.9754, 1.21261, 0.9754, 1.59754, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 0.81378, 0.81378, 1.21237, 1.21237, 1.21237, 0.73541, 0.97847, 0.97363, 0.89723, 0.87897, 1.0426, 0.79429, 0.85292, 0.91149, 1.05815, 1.1406, 0.79631, 0.90128, 0.83853, 1.04396, 1.10615, 0.97552, 0.94436, 0.97552, 0.88641, 0.80527, 0.96083, 1.00135, 1, 1.06777, 0.9817, 0.91142, 0.99361, 1.11144, 1.57293, 1.11144, 1.21237, 0.74627, 1.31818, 1.06585, 0.97042, 0.83055, 0.97042, 0.93503, 1.1261, 0.97042, 0.97922, 1.14236, 0.94552, 1.01054, 1.14236, 1.02471, 0.97922, 0.94165, 0.97042, 0.97042, 1.0276, 0.78929, 1.1261, 0.97922, 0.95874, 1.02197, 0.98507, 0.96752, 0.97168, 0.95107, 1.16579, 0.95107, 1.21237, 1.03959, 1.036, 1.036, 1, 1.036, 1.16579, 0.87357, 1.31818, 1.18754, 1.26781, 1.05356, 1.21237, 1.18622, 0.79487, 0.94994, 1.29004, 1.24047, 1.24047, 1.31818, 1, 0.91484, 0.9754, 1.31818, 1.1349, 1.24866, 1.05356, 1.13934, 1.15574, 1.17389, 0.73541, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.94385, 0.87897, 0.79429, 0.79429, 0.79429, 0.79429, 1.1406, 1.1406, 1.1406, 1.1406, 1.0426, 1.10615, 0.97552, 0.97552, 0.97552, 0.97552, 0.97552, 1.21237, 0.97552, 1.00135, 1.00135, 1.00135, 1.00135, 0.91142, 0.94436, 0.98721, 1.06585, 1.06585, 1.06585, 1.06585, 1.06585, 1.06585, 0.96705, 0.83055, 0.93503, 0.93503, 0.93503, 0.93503, 1.14236, 1.14236, 1.14236, 1.14236, 0.93125, 0.97922, 0.94165, 0.94165, 0.94165, 0.94165, 0.94165, 1.29004, 0.94165, 0.97922, 0.97922, 0.97922, 0.97922, 0.96752, 0.97042, 0.96752, 0.97363, 1.06585, 0.97363, 1.06585, 0.97363, 1.06585, 0.87897, 0.83055, 0.87897, 0.83055, 0.87897, 0.83055, 0.87897, 0.83055, 1.0426, 1.0033, 1.0426, 0.97042, 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, 0.91149, 0.97042, 0.91149, 0.97042, 0.91149, 0.97042, 1, 1, 1.05815, 0.97922, 1.05815, 0.97922, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 0.97441, 1.04302, 0.79631, 1.01582, 1, 1, 1.01054, 0.83853, 1.14236, 1, 1, 0.83853, 1.09125, 0.83853, 0.90418, 0.83853, 1.19508, 1.10615, 0.97922, 1, 1, 1.10615, 0.97922, 1.01034, 1.10466, 0.97922, 0.97552, 0.94165, 0.97552, 0.94165, 0.97552, 0.94165, 0.91602, 0.91981, 0.88641, 1.0276, 1, 1, 0.88641, 1.0276, 0.80527, 0.78929, 0.80527, 0.78929, 0.80527, 0.78929, 0.80527, 0.78929, 1, 1, 0.96083, 1.05403, 0.95923, 1.16862, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.06777, 1.02197, 0.91142, 0.96752, 0.91142, 0.99361, 0.97168, 0.99361, 0.97168, 0.99361, 0.97168, 1.23199, 1.036, 0.97363, 1.06585, 0.94385, 0.96705, 0.97552, 0.94165, 1, 1, 0.96083, 1.1261, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 0.95161, 1.27126, 1.00811, 0.83284, 0.77702, 0.99137, 0.95253, 1.0347, 0.86142, 1.07205, 1.14236, 0.97363, 0.89723, 0.86869, 1.09818, 0.79429, 0.99361, 1.05815, 0.97552, 1.1406, 0.90128, 1.06662, 1.04396, 1.10615, 0.84918, 0.97552, 1.04694, 0.94436, 0.98015, 0.96083, 0.91142, 1.00356, 0.9817, 1.01945, 0.98999, 1.1406, 0.91142, 1.04961, 0.9898, 1.00639, 1.14236, 1.07514, 1.04961, 0.99607, 1.02897, 1.008, 0.9898, 0.95134, 1.00639, 1.11121, 1.14236, 1.00518, 0.97981, 1.02186, 1, 1.08578, 0.94165, 0.99314, 0.98387, 0.93028, 0.93377, 1.35125, 1.07514, 1.10687, 0.93491, 1.04232, 1.00351, 1.14236, 1.07514, 0.94165, 1.07514, 1.00351, 0.79429, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.09097, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.93503, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.96609, 1, 1, 1, 1, 1, 1, 1.06777, 1.02197, 1.06777, 1.02197, 1.06777, 1.02197, 0.91142, 0.96752, 1, 1.21261, 0.89903, 1, 1, 0.75155, 1.04745, 1.04745, 1.04745, 1.04394, 0.98633, 0.98633, 0.98633, 0.72959, 0.72959, 1.20502, 0.91406, 1.26514, 1.222, 1.02956, 1.03372, 1.03372, 0.96039, 1.24633, 1, 1.09125, 0.93327, 1.03336, 1.16541, 1.036, 1, 1, 1, 0.771, 1, 1, 1.15574, 1.15574, 1.15574, 1.15574, 0.86364, 0.94434, 0.86279, 0.94434, 0.86224, 1, 1, 1.16798, 1, 0.96085, 0.90068, 1.21237, 1.18416, 1.13904, 0.69825, 0.9716, 2.10339, 1.29004, 1.29004, 1.21339, 1.29004, 1.29004, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18775, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.13269, 1.13269, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const SegoeuiBoldItalicMetrics = { + lineHeight: 1.33008, + lineGap: 0 +}; +const SegoeuiItalicFactors = [1.76738, 1, 1, 0.98946, 1.14763, 1.05365, 1.06234, 0.96927, 0.92586, 1.15373, 1.18414, 0.91349, 0.91349, 1.07403, 1.17308, 0.78383, 1.20088, 0.78383, 1.42531, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.78383, 0.78383, 1.17308, 1.17308, 1.17308, 0.77349, 0.94565, 0.94729, 0.85944, 0.88506, 0.9858, 0.74817, 0.80016, 0.88449, 0.98039, 0.95782, 0.69238, 0.89898, 0.83231, 0.98183, 1.03989, 0.96924, 0.86237, 0.96924, 0.80595, 0.74524, 0.86091, 0.95402, 0.94143, 0.98448, 0.8858, 0.83089, 0.93285, 1.0949, 1.39016, 1.0949, 1.45994, 0.74627, 1.04839, 0.97454, 0.97454, 0.87207, 0.97454, 0.87533, 1.06151, 0.97454, 1.00176, 1.16484, 1.08132, 0.98047, 1.16484, 1.02989, 1.01054, 0.96225, 0.97454, 0.97454, 1.06598, 0.79004, 1.16344, 1.00351, 0.94629, 0.9973, 0.91016, 0.96777, 0.9043, 0.91082, 0.92481, 0.91082, 1.17308, 0.95748, 0.96927, 0.96927, 1, 0.96927, 0.92481, 0.80597, 1.04839, 1.23393, 1.1781, 0.9245, 1.17308, 1.20808, 0.63218, 0.94261, 1.24822, 1.09971, 1.09971, 1.04839, 1, 0.85273, 0.78032, 1.04839, 1.09971, 1.22326, 0.9245, 1.09836, 1.13525, 1.15222, 0.70424, 0.94729, 0.94729, 0.94729, 0.94729, 0.94729, 0.94729, 0.85498, 0.88506, 0.74817, 0.74817, 0.74817, 0.74817, 0.95782, 0.95782, 0.95782, 0.95782, 0.9858, 1.03989, 0.96924, 0.96924, 0.96924, 0.96924, 0.96924, 1.17308, 0.96924, 0.95402, 0.95402, 0.95402, 0.95402, 0.83089, 0.86237, 0.88409, 0.97454, 0.97454, 0.97454, 0.97454, 0.97454, 0.97454, 0.92916, 0.87207, 0.87533, 0.87533, 0.87533, 0.87533, 0.93146, 0.93146, 0.93146, 0.93146, 0.93854, 1.01054, 0.96225, 0.96225, 0.96225, 0.96225, 0.96225, 1.24822, 0.8761, 1.00351, 1.00351, 1.00351, 1.00351, 0.96777, 0.97454, 0.96777, 0.94729, 0.97454, 0.94729, 0.97454, 0.94729, 0.97454, 0.88506, 0.87207, 0.88506, 0.87207, 0.88506, 0.87207, 0.88506, 0.87207, 0.9858, 0.95391, 0.9858, 0.97454, 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.88449, 0.97454, 0.88449, 0.97454, 0.88449, 0.97454, 1, 1, 0.98039, 1.00176, 0.98039, 1.00176, 0.95782, 0.93146, 0.95782, 0.93146, 0.95782, 0.93146, 0.95782, 1.16484, 0.95782, 0.93146, 0.84421, 1.12761, 0.69238, 1.08132, 1, 1, 0.98047, 0.83231, 1.16484, 1, 1, 0.84723, 1.04861, 0.84723, 0.78755, 0.83231, 1.23736, 1.03989, 1.01054, 1, 1, 1.03989, 1.01054, 0.9857, 1.03849, 1.01054, 0.96924, 0.96225, 0.96924, 0.96225, 0.96924, 0.96225, 0.92383, 0.90171, 0.80595, 1.06598, 1, 1, 0.80595, 1.06598, 0.74524, 0.79004, 0.74524, 0.79004, 0.74524, 0.79004, 0.74524, 0.79004, 1, 1, 0.86091, 1.02759, 0.85771, 1.16344, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.98448, 0.9973, 0.83089, 0.96777, 0.83089, 0.93285, 0.9043, 0.93285, 0.9043, 0.93285, 0.9043, 1.31868, 0.96927, 0.94729, 0.97454, 0.85498, 0.92916, 0.96924, 0.8761, 1, 1, 0.86091, 1.16344, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 0.81965, 0.81965, 0.94729, 0.78032, 0.71022, 0.90883, 0.84171, 0.99877, 0.77596, 1.05734, 1.2, 0.94729, 0.85944, 0.82791, 0.9607, 0.74817, 0.93285, 0.98039, 0.96924, 0.95782, 0.89898, 0.98316, 0.98183, 1.03989, 0.78614, 0.96924, 0.97642, 0.86237, 0.86075, 0.86091, 0.83089, 0.90082, 0.8858, 0.97296, 1.01284, 0.95782, 0.83089, 1.0976, 1.04, 1.03342, 1.2, 1.0675, 1.0976, 0.98205, 1.03809, 1.05097, 1.04, 0.95364, 1.03342, 1.05401, 1.2, 1.02148, 1.0119, 1.04724, 1.0127, 1.02732, 0.96225, 0.8965, 0.97783, 0.93574, 0.94818, 1.30679, 1.0675, 1.11826, 0.99821, 1.0557, 1.0326, 1.2, 1.0675, 0.96225, 1.0675, 1.0326, 0.74817, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.03754, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.87533, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.98705, 1, 1, 1, 1, 1, 1, 0.98448, 0.9973, 0.98448, 0.9973, 0.98448, 0.9973, 0.83089, 0.96777, 1, 1.20088, 0.89903, 1, 1, 0.75155, 0.94945, 0.94945, 0.94945, 0.94945, 1.12317, 1.12317, 1.12317, 0.67603, 0.67603, 1.15621, 0.73584, 1.21191, 1.22135, 1.06483, 0.94868, 0.94868, 0.95996, 1.24633, 1, 1.07497, 0.87709, 0.96927, 1.01473, 0.96927, 1, 1, 1, 0.77295, 1, 1, 1.09836, 1.09836, 1.09836, 1.01522, 0.86321, 0.94434, 0.8649, 0.94434, 0.86182, 1, 1, 1.083, 1, 0.91578, 0.86438, 1.17308, 1.18416, 1.14589, 0.69825, 0.97622, 1.96791, 1.24822, 1.24822, 1.17308, 1.24822, 1.24822, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.17984, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.10742, 1.10742, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const SegoeuiItalicMetrics = { + lineHeight: 1.33008, + lineGap: 0 +}; +const SegoeuiRegularFactors = [1.76738, 1, 1, 0.98594, 1.02285, 1.10454, 1.06234, 0.96927, 0.92037, 1.19985, 1.2046, 0.90616, 0.90616, 1.07152, 1.1714, 0.78032, 1.20088, 0.78032, 1.40246, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.78032, 0.78032, 1.1714, 1.1714, 1.1714, 0.80597, 0.94084, 0.96706, 0.85944, 0.85734, 0.97093, 0.75842, 0.79936, 0.88198, 0.9831, 0.95782, 0.71387, 0.86969, 0.84636, 1.07796, 1.03584, 0.96924, 0.83968, 0.96924, 0.82826, 0.79649, 0.85771, 0.95132, 0.93119, 0.98965, 0.88433, 0.8287, 0.93365, 1.08612, 1.3638, 1.08612, 1.45786, 0.74627, 0.80499, 0.91484, 1.05707, 0.92383, 1.05882, 0.9403, 1.12654, 1.05882, 1.01756, 1.09011, 1.09011, 0.99414, 1.09011, 1.034, 1.01756, 1.05356, 1.05707, 1.05882, 1.04399, 0.84863, 1.21968, 1.01756, 0.95801, 1.00068, 0.91797, 0.96777, 0.9043, 0.90351, 0.92105, 0.90351, 1.1714, 0.85337, 0.96927, 0.96927, 0.99912, 0.96927, 0.92105, 0.80597, 1.2434, 1.20808, 1.05937, 0.90957, 1.1714, 1.20808, 0.75155, 0.94261, 1.24644, 1.09971, 1.09971, 0.84751, 1, 0.85273, 0.78032, 0.61584, 1.05425, 1.17914, 0.90957, 1.08665, 1.11593, 1.14169, 0.73381, 0.96706, 0.96706, 0.96706, 0.96706, 0.96706, 0.96706, 0.86035, 0.85734, 0.75842, 0.75842, 0.75842, 0.75842, 0.95782, 0.95782, 0.95782, 0.95782, 0.97093, 1.03584, 0.96924, 0.96924, 0.96924, 0.96924, 0.96924, 1.1714, 0.96924, 0.95132, 0.95132, 0.95132, 0.95132, 0.8287, 0.83968, 0.89049, 0.91484, 0.91484, 0.91484, 0.91484, 0.91484, 0.91484, 0.93575, 0.92383, 0.9403, 0.9403, 0.9403, 0.9403, 0.8717, 0.8717, 0.8717, 0.8717, 1.00527, 1.01756, 1.05356, 1.05356, 1.05356, 1.05356, 1.05356, 1.24644, 0.95923, 1.01756, 1.01756, 1.01756, 1.01756, 0.96777, 1.05707, 0.96777, 0.96706, 0.91484, 0.96706, 0.91484, 0.96706, 0.91484, 0.85734, 0.92383, 0.85734, 0.92383, 0.85734, 0.92383, 0.85734, 0.92383, 0.97093, 1.0969, 0.97093, 1.05882, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.88198, 1.05882, 0.88198, 1.05882, 0.88198, 1.05882, 1, 1, 0.9831, 1.01756, 0.9831, 1.01756, 0.95782, 0.8717, 0.95782, 0.8717, 0.95782, 0.8717, 0.95782, 1.09011, 0.95782, 0.8717, 0.84784, 1.11551, 0.71387, 1.09011, 1, 1, 0.99414, 0.84636, 1.09011, 1, 1, 0.84636, 1.0536, 0.84636, 0.94298, 0.84636, 1.23297, 1.03584, 1.01756, 1, 1, 1.03584, 1.01756, 1.00323, 1.03444, 1.01756, 0.96924, 1.05356, 0.96924, 1.05356, 0.96924, 1.05356, 0.93066, 0.98293, 0.82826, 1.04399, 1, 1, 0.82826, 1.04399, 0.79649, 0.84863, 0.79649, 0.84863, 0.79649, 0.84863, 0.79649, 0.84863, 1, 1, 0.85771, 1.17318, 0.85771, 1.21968, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.98965, 1.00068, 0.8287, 0.96777, 0.8287, 0.93365, 0.9043, 0.93365, 0.9043, 0.93365, 0.9043, 1.08571, 0.96927, 0.96706, 0.91484, 0.86035, 0.93575, 0.96924, 0.95923, 1, 1, 0.85771, 1.21968, 1.11437, 1.11437, 0.93109, 0.91202, 0.60411, 0.84164, 0.55572, 1.01173, 0.97361, 0.81818, 0.81818, 0.96635, 0.78032, 0.72727, 0.92366, 0.98601, 1.03405, 0.77968, 1.09799, 1.2, 0.96706, 0.85944, 0.85638, 0.96491, 0.75842, 0.93365, 0.9831, 0.96924, 0.95782, 0.86969, 0.94152, 1.07796, 1.03584, 0.78437, 0.96924, 0.98715, 0.83968, 0.83491, 0.85771, 0.8287, 0.94492, 0.88433, 0.9287, 1.0098, 0.95782, 0.8287, 1.0625, 0.98248, 1.03424, 1.2, 1.01071, 1.0625, 0.95246, 1.03809, 1.04912, 0.98248, 1.00221, 1.03424, 1.05443, 1.2, 1.04785, 0.99609, 1.00169, 1.05176, 0.99346, 1.05356, 0.9087, 1.03004, 0.95542, 0.93117, 1.23362, 1.01071, 1.07831, 1.02512, 1.05205, 1.03502, 1.2, 1.01071, 1.05356, 1.01071, 1.03502, 0.75842, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.03719, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9403, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.04021, 1, 1, 1, 1, 1, 1, 0.98965, 1.00068, 0.98965, 1.00068, 0.98965, 1.00068, 0.8287, 0.96777, 1, 1.20088, 0.89903, 1, 1, 0.75155, 1.03077, 1.03077, 1.03077, 1.03077, 1.13196, 1.13196, 1.13196, 0.67428, 0.67428, 1.16039, 0.73291, 1.20996, 1.22135, 1.06483, 0.94868, 0.94868, 0.95996, 1.24633, 1, 1.07497, 0.87796, 0.96927, 1.01518, 0.96927, 1, 1, 1, 0.77295, 1, 1, 1.10539, 1.10539, 1.11358, 1.06967, 0.86279, 0.94434, 0.86279, 0.94434, 0.86182, 1, 1, 1.083, 1, 0.91578, 0.86507, 1.1714, 1.18416, 1.14589, 0.69825, 0.97622, 1.9697, 1.24822, 1.24822, 1.17238, 1.24822, 1.24822, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18083, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.10938, 1.10938, 1, 1, 1, 1.05425, 1.09971, 1.09971, 1.09971, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]; +const SegoeuiRegularMetrics = { + lineHeight: 1.33008, + lineGap: 0 +}; + +;// CONCATENATED MODULE: ./src/core/xfa_fonts.js + + + + + + + + +const getXFAFontMap = getLookupTableFactory(function (t) { + t["MyriadPro-Regular"] = t["PdfJS-Fallback-Regular"] = { + name: "LiberationSans-Regular", + factors: MyriadProRegularFactors, + baseWidths: LiberationSansRegularWidths, + baseMapping: LiberationSansRegularMapping, + metrics: MyriadProRegularMetrics + }; + t["MyriadPro-Bold"] = t["PdfJS-Fallback-Bold"] = { + name: "LiberationSans-Bold", + factors: MyriadProBoldFactors, + baseWidths: LiberationSansBoldWidths, + baseMapping: LiberationSansBoldMapping, + metrics: MyriadProBoldMetrics + }; + t["MyriadPro-It"] = t["MyriadPro-Italic"] = t["PdfJS-Fallback-Italic"] = { + name: "LiberationSans-Italic", + factors: MyriadProItalicFactors, + baseWidths: LiberationSansItalicWidths, + baseMapping: LiberationSansItalicMapping, + metrics: MyriadProItalicMetrics + }; + t["MyriadPro-BoldIt"] = t["MyriadPro-BoldItalic"] = t["PdfJS-Fallback-BoldItalic"] = { + name: "LiberationSans-BoldItalic", + factors: MyriadProBoldItalicFactors, + baseWidths: LiberationSansBoldItalicWidths, + baseMapping: LiberationSansBoldItalicMapping, + metrics: MyriadProBoldItalicMetrics + }; + t.ArialMT = t.Arial = t["Arial-Regular"] = { + name: "LiberationSans-Regular", + baseWidths: LiberationSansRegularWidths, + baseMapping: LiberationSansRegularMapping + }; + t["Arial-BoldMT"] = t["Arial-Bold"] = { + name: "LiberationSans-Bold", + baseWidths: LiberationSansBoldWidths, + baseMapping: LiberationSansBoldMapping + }; + t["Arial-ItalicMT"] = t["Arial-Italic"] = { + name: "LiberationSans-Italic", + baseWidths: LiberationSansItalicWidths, + baseMapping: LiberationSansItalicMapping + }; + t["Arial-BoldItalicMT"] = t["Arial-BoldItalic"] = { + name: "LiberationSans-BoldItalic", + baseWidths: LiberationSansBoldItalicWidths, + baseMapping: LiberationSansBoldItalicMapping + }; + t["Calibri-Regular"] = { + name: "LiberationSans-Regular", + factors: CalibriRegularFactors, + baseWidths: LiberationSansRegularWidths, + baseMapping: LiberationSansRegularMapping, + metrics: CalibriRegularMetrics + }; + t["Calibri-Bold"] = { + name: "LiberationSans-Bold", + factors: CalibriBoldFactors, + baseWidths: LiberationSansBoldWidths, + baseMapping: LiberationSansBoldMapping, + metrics: CalibriBoldMetrics + }; + t["Calibri-Italic"] = { + name: "LiberationSans-Italic", + factors: CalibriItalicFactors, + baseWidths: LiberationSansItalicWidths, + baseMapping: LiberationSansItalicMapping, + metrics: CalibriItalicMetrics + }; + t["Calibri-BoldItalic"] = { + name: "LiberationSans-BoldItalic", + factors: CalibriBoldItalicFactors, + baseWidths: LiberationSansBoldItalicWidths, + baseMapping: LiberationSansBoldItalicMapping, + metrics: CalibriBoldItalicMetrics + }; + t["Segoeui-Regular"] = { + name: "LiberationSans-Regular", + factors: SegoeuiRegularFactors, + baseWidths: LiberationSansRegularWidths, + baseMapping: LiberationSansRegularMapping, + metrics: SegoeuiRegularMetrics + }; + t["Segoeui-Bold"] = { + name: "LiberationSans-Bold", + factors: SegoeuiBoldFactors, + baseWidths: LiberationSansBoldWidths, + baseMapping: LiberationSansBoldMapping, + metrics: SegoeuiBoldMetrics + }; + t["Segoeui-Italic"] = { + name: "LiberationSans-Italic", + factors: SegoeuiItalicFactors, + baseWidths: LiberationSansItalicWidths, + baseMapping: LiberationSansItalicMapping, + metrics: SegoeuiItalicMetrics + }; + t["Segoeui-BoldItalic"] = { + name: "LiberationSans-BoldItalic", + factors: SegoeuiBoldItalicFactors, + baseWidths: LiberationSansBoldItalicWidths, + baseMapping: LiberationSansBoldItalicMapping, + metrics: SegoeuiBoldItalicMetrics + }; + t["Helvetica-Regular"] = t.Helvetica = { + name: "LiberationSans-Regular", + factors: HelveticaRegularFactors, + baseWidths: LiberationSansRegularWidths, + baseMapping: LiberationSansRegularMapping, + metrics: HelveticaRegularMetrics + }; + t["Helvetica-Bold"] = { + name: "LiberationSans-Bold", + factors: HelveticaBoldFactors, + baseWidths: LiberationSansBoldWidths, + baseMapping: LiberationSansBoldMapping, + metrics: HelveticaBoldMetrics + }; + t["Helvetica-Italic"] = { + name: "LiberationSans-Italic", + factors: HelveticaItalicFactors, + baseWidths: LiberationSansItalicWidths, + baseMapping: LiberationSansItalicMapping, + metrics: HelveticaItalicMetrics + }; + t["Helvetica-BoldItalic"] = { + name: "LiberationSans-BoldItalic", + factors: HelveticaBoldItalicFactors, + baseWidths: LiberationSansBoldItalicWidths, + baseMapping: LiberationSansBoldItalicMapping, + metrics: HelveticaBoldItalicMetrics + }; +}); +function getXfaFontName(name) { + const fontName = normalizeFontName(name); + const fontMap = getXFAFontMap(); + return fontMap[fontName]; +} +function getXfaFontWidths(name) { + const info = getXfaFontName(name); + if (!info) { + return null; + } + const { + baseWidths, + baseMapping, + factors + } = info; + const rescaledBaseWidths = !factors ? baseWidths : baseWidths.map((w, i) => w * factors[i]); + let currentCode = -2; + let currentArray; + const newWidths = []; + for (const [unicode, glyphIndex] of baseMapping.map((charUnicode, index) => [charUnicode, index]).sort(([unicode1], [unicode2]) => unicode1 - unicode2)) { + if (unicode === -1) { + continue; + } + if (unicode === currentCode + 1) { + currentArray.push(rescaledBaseWidths[glyphIndex]); + currentCode += 1; + } else { + currentCode = unicode; + currentArray = [rescaledBaseWidths[glyphIndex]]; + newWidths.push(unicode, currentArray); + } + } + return newWidths; +} +function getXfaFontDict(name) { + const widths = getXfaFontWidths(name); + const dict = new Dict(null); + dict.set("BaseFont", Name.get(name)); + dict.set("Type", Name.get("Font")); + dict.set("Subtype", Name.get("CIDFontType2")); + dict.set("Encoding", Name.get("Identity-H")); + dict.set("CIDToGIDMap", Name.get("Identity")); + dict.set("W", widths); + dict.set("FirstChar", widths[0]); + dict.set("LastChar", widths.at(-2) + widths.at(-1).length - 1); + const descriptor = new Dict(null); + dict.set("FontDescriptor", descriptor); + const systemInfo = new Dict(null); + systemInfo.set("Ordering", "Identity"); + systemInfo.set("Registry", "Adobe"); + systemInfo.set("Supplement", 0); + dict.set("CIDSystemInfo", systemInfo); + return dict; +} + +;// CONCATENATED MODULE: ./src/core/ps_parser.js + + + +class PostScriptParser { + constructor(lexer) { + this.lexer = lexer; + this.operators = []; + this.token = null; + this.prev = null; + } + nextToken() { + this.prev = this.token; + this.token = this.lexer.getToken(); + } + accept(type) { + if (this.token.type === type) { + this.nextToken(); + return true; + } + return false; + } + expect(type) { + if (this.accept(type)) { + return true; + } + throw new FormatError(`Unexpected symbol: found ${this.token.type} expected ${type}.`); + } + parse() { + this.nextToken(); + this.expect(PostScriptTokenTypes.LBRACE); + this.parseBlock(); + this.expect(PostScriptTokenTypes.RBRACE); + return this.operators; + } + parseBlock() { + while (true) { + if (this.accept(PostScriptTokenTypes.NUMBER)) { + this.operators.push(this.prev.value); + } else if (this.accept(PostScriptTokenTypes.OPERATOR)) { + this.operators.push(this.prev.value); + } else if (this.accept(PostScriptTokenTypes.LBRACE)) { + this.parseCondition(); + } else { + return; + } + } + } + parseCondition() { + const conditionLocation = this.operators.length; + this.operators.push(null, null); + this.parseBlock(); + this.expect(PostScriptTokenTypes.RBRACE); + if (this.accept(PostScriptTokenTypes.IF)) { + this.operators[conditionLocation] = this.operators.length; + this.operators[conditionLocation + 1] = "jz"; + } else if (this.accept(PostScriptTokenTypes.LBRACE)) { + const jumpLocation = this.operators.length; + this.operators.push(null, null); + const endOfTrue = this.operators.length; + this.parseBlock(); + this.expect(PostScriptTokenTypes.RBRACE); + this.expect(PostScriptTokenTypes.IFELSE); + this.operators[jumpLocation] = this.operators.length; + this.operators[jumpLocation + 1] = "j"; + this.operators[conditionLocation] = endOfTrue; + this.operators[conditionLocation + 1] = "jz"; + } else { + throw new FormatError("PS Function: error parsing conditional."); + } + } +} +const PostScriptTokenTypes = { + LBRACE: 0, + RBRACE: 1, + NUMBER: 2, + OPERATOR: 3, + IF: 4, + IFELSE: 5 +}; +class PostScriptToken { + static get opCache() { + return shadow(this, "opCache", Object.create(null)); + } + constructor(type, value) { + this.type = type; + this.value = value; + } + static getOperator(op) { + return PostScriptToken.opCache[op] ||= new PostScriptToken(PostScriptTokenTypes.OPERATOR, op); + } + static get LBRACE() { + return shadow(this, "LBRACE", new PostScriptToken(PostScriptTokenTypes.LBRACE, "{")); + } + static get RBRACE() { + return shadow(this, "RBRACE", new PostScriptToken(PostScriptTokenTypes.RBRACE, "}")); + } + static get IF() { + return shadow(this, "IF", new PostScriptToken(PostScriptTokenTypes.IF, "IF")); + } + static get IFELSE() { + return shadow(this, "IFELSE", new PostScriptToken(PostScriptTokenTypes.IFELSE, "IFELSE")); + } +} +class PostScriptLexer { + constructor(stream) { + this.stream = stream; + this.nextChar(); + this.strBuf = []; + } + nextChar() { + return this.currentChar = this.stream.getByte(); + } + getToken() { + let comment = false; + let ch = this.currentChar; + while (true) { + if (ch < 0) { + return EOF; + } + if (comment) { + if (ch === 0x0a || ch === 0x0d) { + comment = false; + } + } else if (ch === 0x25) { + comment = true; + } else if (!isWhiteSpace(ch)) { + break; + } + ch = this.nextChar(); + } + switch (ch | 0) { + case 0x30: + case 0x31: + case 0x32: + case 0x33: + case 0x34: + case 0x35: + case 0x36: + case 0x37: + case 0x38: + case 0x39: + case 0x2b: + case 0x2d: + case 0x2e: + return new PostScriptToken(PostScriptTokenTypes.NUMBER, this.getNumber()); + case 0x7b: + this.nextChar(); + return PostScriptToken.LBRACE; + case 0x7d: + this.nextChar(); + return PostScriptToken.RBRACE; + } + const strBuf = this.strBuf; + strBuf.length = 0; + strBuf[0] = String.fromCharCode(ch); + while ((ch = this.nextChar()) >= 0 && (ch >= 0x41 && ch <= 0x5a || ch >= 0x61 && ch <= 0x7a)) { + strBuf.push(String.fromCharCode(ch)); + } + const str = strBuf.join(""); + switch (str.toLowerCase()) { + case "if": + return PostScriptToken.IF; + case "ifelse": + return PostScriptToken.IFELSE; + default: + return PostScriptToken.getOperator(str); + } + } + getNumber() { + let ch = this.currentChar; + const strBuf = this.strBuf; + strBuf.length = 0; + strBuf[0] = String.fromCharCode(ch); + while ((ch = this.nextChar()) >= 0) { + if (ch >= 0x30 && ch <= 0x39 || ch === 0x2d || ch === 0x2e) { + strBuf.push(String.fromCharCode(ch)); + } else { + break; + } + } + const value = parseFloat(strBuf.join("")); + if (isNaN(value)) { + throw new FormatError(`Invalid floating point number: ${value}`); + } + return value; + } +} + +;// CONCATENATED MODULE: ./src/core/image_utils.js + + +class BaseLocalCache { + constructor(options) { + if (this.constructor === BaseLocalCache) { + unreachable("Cannot initialize BaseLocalCache."); + } + this._onlyRefs = options?.onlyRefs === true; + if (!this._onlyRefs) { + this._nameRefMap = new Map(); + this._imageMap = new Map(); + } + this._imageCache = new RefSetCache(); + } + getByName(name) { + if (this._onlyRefs) { + unreachable("Should not call `getByName` method."); + } + const ref = this._nameRefMap.get(name); + if (ref) { + return this.getByRef(ref); + } + return this._imageMap.get(name) || null; + } + getByRef(ref) { + return this._imageCache.get(ref) || null; + } + set(name, ref, data) { + unreachable("Abstract method `set` called."); + } +} +class LocalImageCache extends BaseLocalCache { + set(name, ref = null, data) { + if (typeof name !== "string") { + throw new Error('LocalImageCache.set - expected "name" argument.'); + } + if (ref) { + if (this._imageCache.has(ref)) { + return; + } + this._nameRefMap.set(name, ref); + this._imageCache.put(ref, data); + return; + } + if (this._imageMap.has(name)) { + return; + } + this._imageMap.set(name, data); + } +} +class LocalColorSpaceCache extends BaseLocalCache { + set(name = null, ref = null, data) { + if (typeof name !== "string" && !ref) { + throw new Error('LocalColorSpaceCache.set - expected "name" and/or "ref" argument.'); + } + if (ref) { + if (this._imageCache.has(ref)) { + return; + } + if (name !== null) { + this._nameRefMap.set(name, ref); + } + this._imageCache.put(ref, data); + return; + } + if (this._imageMap.has(name)) { + return; + } + this._imageMap.set(name, data); + } +} +class LocalFunctionCache extends BaseLocalCache { + constructor(options) { + super({ + onlyRefs: true + }); + } + set(name = null, ref, data) { + if (!ref) { + throw new Error('LocalFunctionCache.set - expected "ref" argument.'); + } + if (this._imageCache.has(ref)) { + return; + } + this._imageCache.put(ref, data); + } +} +class LocalGStateCache extends BaseLocalCache { + set(name, ref = null, data) { + if (typeof name !== "string") { + throw new Error('LocalGStateCache.set - expected "name" argument.'); + } + if (ref) { + if (this._imageCache.has(ref)) { + return; + } + this._nameRefMap.set(name, ref); + this._imageCache.put(ref, data); + return; + } + if (this._imageMap.has(name)) { + return; + } + this._imageMap.set(name, data); + } +} +class LocalTilingPatternCache extends BaseLocalCache { + constructor(options) { + super({ + onlyRefs: true + }); + } + set(name = null, ref, data) { + if (!ref) { + throw new Error('LocalTilingPatternCache.set - expected "ref" argument.'); + } + if (this._imageCache.has(ref)) { + return; + } + this._imageCache.put(ref, data); + } +} +class RegionalImageCache extends BaseLocalCache { + constructor(options) { + super({ + onlyRefs: true + }); + } + set(name = null, ref, data) { + if (!ref) { + throw new Error('RegionalImageCache.set - expected "ref" argument.'); + } + if (this._imageCache.has(ref)) { + return; + } + this._imageCache.put(ref, data); + } +} +class GlobalImageCache { + static NUM_PAGES_THRESHOLD = 2; + static MIN_IMAGES_TO_CACHE = 10; + static MAX_BYTE_SIZE = 5 * MAX_IMAGE_SIZE_TO_CACHE; + constructor() { + this._refCache = new RefSetCache(); + this._imageCache = new RefSetCache(); + } + get _byteSize() { + let byteSize = 0; + for (const imageData of this._imageCache) { + byteSize += imageData.byteSize; + } + return byteSize; + } + get _cacheLimitReached() { + if (this._imageCache.size < GlobalImageCache.MIN_IMAGES_TO_CACHE) { + return false; + } + if (this._byteSize < GlobalImageCache.MAX_BYTE_SIZE) { + return false; + } + return true; + } + shouldCache(ref, pageIndex) { + let pageIndexSet = this._refCache.get(ref); + if (!pageIndexSet) { + pageIndexSet = new Set(); + this._refCache.put(ref, pageIndexSet); + } + pageIndexSet.add(pageIndex); + if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) { + return false; + } + if (!this._imageCache.has(ref) && this._cacheLimitReached) { + return false; + } + return true; + } + addByteSize(ref, byteSize) { + const imageData = this._imageCache.get(ref); + if (!imageData) { + return; + } + if (imageData.byteSize) { + return; + } + imageData.byteSize = byteSize; + } + getData(ref, pageIndex) { + const pageIndexSet = this._refCache.get(ref); + if (!pageIndexSet) { + return null; + } + if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) { + return null; + } + const imageData = this._imageCache.get(ref); + if (!imageData) { + return null; + } + pageIndexSet.add(pageIndex); + return imageData; + } + setData(ref, data) { + if (!this._refCache.has(ref)) { + throw new Error('GlobalImageCache.setData - expected "shouldCache" to have been called.'); + } + if (this._imageCache.has(ref)) { + return; + } + if (this._cacheLimitReached) { + warn("GlobalImageCache.setData - cache limit reached."); + return; + } + this._imageCache.put(ref, data); + } + clear(onlyData = false) { + if (!onlyData) { + this._refCache.clear(); + } + this._imageCache.clear(); + } +} + +;// CONCATENATED MODULE: ./src/core/function.js + + + + + +class PDFFunctionFactory { + constructor({ + xref, + isEvalSupported = true + }) { + this.xref = xref; + this.isEvalSupported = isEvalSupported !== false; + } + create(fn) { + const cachedFunction = this.getCached(fn); + if (cachedFunction) { + return cachedFunction; + } + const parsedFunction = PDFFunction.parse({ + xref: this.xref, + isEvalSupported: this.isEvalSupported, + fn: fn instanceof Ref ? this.xref.fetch(fn) : fn + }); + this._cache(fn, parsedFunction); + return parsedFunction; + } + createFromArray(fnObj) { + const cachedFunction = this.getCached(fnObj); + if (cachedFunction) { + return cachedFunction; + } + const parsedFunction = PDFFunction.parseArray({ + xref: this.xref, + isEvalSupported: this.isEvalSupported, + fnObj: fnObj instanceof Ref ? this.xref.fetch(fnObj) : fnObj + }); + this._cache(fnObj, parsedFunction); + return parsedFunction; + } + getCached(cacheKey) { + let fnRef; + if (cacheKey instanceof Ref) { + fnRef = cacheKey; + } else if (cacheKey instanceof Dict) { + fnRef = cacheKey.objId; + } else if (cacheKey instanceof BaseStream) { + fnRef = cacheKey.dict?.objId; + } + if (fnRef) { + const localFunction = this._localFunctionCache.getByRef(fnRef); + if (localFunction) { + return localFunction; + } + } + return null; + } + _cache(cacheKey, parsedFunction) { + if (!parsedFunction) { + throw new Error('PDFFunctionFactory._cache - expected "parsedFunction" argument.'); + } + let fnRef; + if (cacheKey instanceof Ref) { + fnRef = cacheKey; + } else if (cacheKey instanceof Dict) { + fnRef = cacheKey.objId; + } else if (cacheKey instanceof BaseStream) { + fnRef = cacheKey.dict?.objId; + } + if (fnRef) { + this._localFunctionCache.set(null, fnRef, parsedFunction); + } + } + get _localFunctionCache() { + return shadow(this, "_localFunctionCache", new LocalFunctionCache()); + } +} +function toNumberArray(arr) { + if (!Array.isArray(arr)) { + return null; + } + const length = arr.length; + for (let i = 0; i < length; i++) { + if (typeof arr[i] !== "number") { + const result = new Array(length); + for (let j = 0; j < length; j++) { + result[j] = +arr[j]; + } + return result; + } + } + return arr; +} +class PDFFunction { + static getSampleArray(size, outputSize, bps, stream) { + let i, ii; + let length = 1; + for (i = 0, ii = size.length; i < ii; i++) { + length *= size[i]; + } + length *= outputSize; + const array = new Array(length); + let codeSize = 0; + let codeBuf = 0; + const sampleMul = 1.0 / (2.0 ** bps - 1); + const strBytes = stream.getBytes((length * bps + 7) / 8); + let strIdx = 0; + for (i = 0; i < length; i++) { + while (codeSize < bps) { + codeBuf <<= 8; + codeBuf |= strBytes[strIdx++]; + codeSize += 8; + } + codeSize -= bps; + array[i] = (codeBuf >> codeSize) * sampleMul; + codeBuf &= (1 << codeSize) - 1; + } + return array; + } + static parse({ + xref, + isEvalSupported, + fn + }) { + const dict = fn.dict || fn; + const typeNum = dict.get("FunctionType"); + switch (typeNum) { + case 0: + return this.constructSampled({ + xref, + isEvalSupported, + fn, + dict + }); + case 1: + break; + case 2: + return this.constructInterpolated({ + xref, + isEvalSupported, + dict + }); + case 3: + return this.constructStiched({ + xref, + isEvalSupported, + dict + }); + case 4: + return this.constructPostScript({ + xref, + isEvalSupported, + fn, + dict + }); + } + throw new FormatError("Unknown type of function"); + } + static parseArray({ + xref, + isEvalSupported, + fnObj + }) { + if (!Array.isArray(fnObj)) { + return this.parse({ + xref, + isEvalSupported, + fn: fnObj + }); + } + const fnArray = []; + for (const fn of fnObj) { + fnArray.push(this.parse({ + xref, + isEvalSupported, + fn: xref.fetchIfRef(fn) + })); + } + return function (src, srcOffset, dest, destOffset) { + for (let i = 0, ii = fnArray.length; i < ii; i++) { + fnArray[i](src, srcOffset, dest, destOffset + i); + } + }; + } + static constructSampled({ + xref, + isEvalSupported, + fn, + dict + }) { + function toMultiArray(arr) { + const inputLength = arr.length; + const out = []; + let index = 0; + for (let i = 0; i < inputLength; i += 2) { + out[index++] = [arr[i], arr[i + 1]]; + } + return out; + } + function interpolate(x, xmin, xmax, ymin, ymax) { + return ymin + (x - xmin) * ((ymax - ymin) / (xmax - xmin)); + } + let domain = toNumberArray(dict.getArray("Domain")); + let range = toNumberArray(dict.getArray("Range")); + if (!domain || !range) { + throw new FormatError("No domain or range"); + } + const inputSize = domain.length / 2; + const outputSize = range.length / 2; + domain = toMultiArray(domain); + range = toMultiArray(range); + const size = toNumberArray(dict.getArray("Size")); + const bps = dict.get("BitsPerSample"); + const order = dict.get("Order") || 1; + if (order !== 1) { + info("No support for cubic spline interpolation: " + order); + } + let encode = toNumberArray(dict.getArray("Encode")); + if (!encode) { + encode = []; + for (let i = 0; i < inputSize; ++i) { + encode.push([0, size[i] - 1]); + } + } else { + encode = toMultiArray(encode); + } + let decode = toNumberArray(dict.getArray("Decode")); + decode = !decode ? range : toMultiArray(decode); + const samples = this.getSampleArray(size, outputSize, bps, fn); + return function constructSampledFn(src, srcOffset, dest, destOffset) { + const cubeVertices = 1 << inputSize; + const cubeN = new Float64Array(cubeVertices); + const cubeVertex = new Uint32Array(cubeVertices); + let i, j; + for (j = 0; j < cubeVertices; j++) { + cubeN[j] = 1; + } + let k = outputSize, + pos = 1; + for (i = 0; i < inputSize; ++i) { + const domain_2i = domain[i][0]; + const domain_2i_1 = domain[i][1]; + const xi = Math.min(Math.max(src[srcOffset + i], domain_2i), domain_2i_1); + let e = interpolate(xi, domain_2i, domain_2i_1, encode[i][0], encode[i][1]); + const size_i = size[i]; + e = Math.min(Math.max(e, 0), size_i - 1); + const e0 = e < size_i - 1 ? Math.floor(e) : e - 1; + const n0 = e0 + 1 - e; + const n1 = e - e0; + const offset0 = e0 * k; + const offset1 = offset0 + k; + for (j = 0; j < cubeVertices; j++) { + if (j & pos) { + cubeN[j] *= n1; + cubeVertex[j] += offset1; + } else { + cubeN[j] *= n0; + cubeVertex[j] += offset0; + } + } + k *= size_i; + pos <<= 1; + } + for (j = 0; j < outputSize; ++j) { + let rj = 0; + for (i = 0; i < cubeVertices; i++) { + rj += samples[cubeVertex[i] + j] * cubeN[i]; + } + rj = interpolate(rj, 0, 1, decode[j][0], decode[j][1]); + dest[destOffset + j] = Math.min(Math.max(rj, range[j][0]), range[j][1]); + } + }; + } + static constructInterpolated({ + xref, + isEvalSupported, + dict + }) { + const c0 = toNumberArray(dict.getArray("C0")) || [0]; + const c1 = toNumberArray(dict.getArray("C1")) || [1]; + const n = dict.get("N"); + const diff = []; + for (let i = 0, ii = c0.length; i < ii; ++i) { + diff.push(c1[i] - c0[i]); + } + const length = diff.length; + return function constructInterpolatedFn(src, srcOffset, dest, destOffset) { + const x = n === 1 ? src[srcOffset] : src[srcOffset] ** n; + for (let j = 0; j < length; ++j) { + dest[destOffset + j] = c0[j] + x * diff[j]; + } + }; + } + static constructStiched({ + xref, + isEvalSupported, + dict + }) { + const domain = toNumberArray(dict.getArray("Domain")); + if (!domain) { + throw new FormatError("No domain"); + } + const inputSize = domain.length / 2; + if (inputSize !== 1) { + throw new FormatError("Bad domain for stiched function"); + } + const fns = []; + for (const fn of dict.get("Functions")) { + fns.push(this.parse({ + xref, + isEvalSupported, + fn: xref.fetchIfRef(fn) + })); + } + const bounds = toNumberArray(dict.getArray("Bounds")); + const encode = toNumberArray(dict.getArray("Encode")); + const tmpBuf = new Float32Array(1); + return function constructStichedFn(src, srcOffset, dest, destOffset) { + const clip = function constructStichedFromIRClip(v, min, max) { + if (v > max) { + v = max; + } else if (v < min) { + v = min; + } + return v; + }; + const v = clip(src[srcOffset], domain[0], domain[1]); + const length = bounds.length; + let i; + for (i = 0; i < length; ++i) { + if (v < bounds[i]) { + break; + } + } + let dmin = domain[0]; + if (i > 0) { + dmin = bounds[i - 1]; + } + let dmax = domain[1]; + if (i < bounds.length) { + dmax = bounds[i]; + } + const rmin = encode[2 * i]; + const rmax = encode[2 * i + 1]; + tmpBuf[0] = dmin === dmax ? rmin : rmin + (v - dmin) * (rmax - rmin) / (dmax - dmin); + fns[i](tmpBuf, 0, dest, destOffset); + }; + } + static constructPostScript({ + xref, + isEvalSupported, + fn, + dict + }) { + const domain = toNumberArray(dict.getArray("Domain")); + const range = toNumberArray(dict.getArray("Range")); + if (!domain) { + throw new FormatError("No domain."); + } + if (!range) { + throw new FormatError("No range."); + } + const lexer = new PostScriptLexer(fn); + const parser = new PostScriptParser(lexer); + const code = parser.parse(); + if (isEvalSupported && FeatureTest.isEvalSupported) { + const compiled = new PostScriptCompiler().compile(code, domain, range); + if (compiled) { + return new Function("src", "srcOffset", "dest", "destOffset", compiled); + } + } + info("Unable to compile PS function"); + const numOutputs = range.length >> 1; + const numInputs = domain.length >> 1; + const evaluator = new PostScriptEvaluator(code); + const cache = Object.create(null); + const MAX_CACHE_SIZE = 2048 * 4; + let cache_available = MAX_CACHE_SIZE; + const tmpBuf = new Float32Array(numInputs); + return function constructPostScriptFn(src, srcOffset, dest, destOffset) { + let i, value; + let key = ""; + const input = tmpBuf; + for (i = 0; i < numInputs; i++) { + value = src[srcOffset + i]; + input[i] = value; + key += value + "_"; + } + const cachedValue = cache[key]; + if (cachedValue !== undefined) { + dest.set(cachedValue, destOffset); + return; + } + const output = new Float32Array(numOutputs); + const stack = evaluator.execute(input); + const stackIndex = stack.length - numOutputs; + for (i = 0; i < numOutputs; i++) { + value = stack[stackIndex + i]; + let bound = range[i * 2]; + if (value < bound) { + value = bound; + } else { + bound = range[i * 2 + 1]; + if (value > bound) { + value = bound; + } + } + output[i] = value; + } + if (cache_available > 0) { + cache_available--; + cache[key] = output; + } + dest.set(output, destOffset); + }; + } +} +function isPDFFunction(v) { + let fnDict; + if (v instanceof Dict) { + fnDict = v; + } else if (v instanceof BaseStream) { + fnDict = v.dict; + } else { + return false; + } + return fnDict.has("FunctionType"); +} +class PostScriptStack { + static MAX_STACK_SIZE = 100; + constructor(initialStack) { + this.stack = initialStack ? Array.from(initialStack) : []; + } + push(value) { + if (this.stack.length >= PostScriptStack.MAX_STACK_SIZE) { + throw new Error("PostScript function stack overflow."); + } + this.stack.push(value); + } + pop() { + if (this.stack.length <= 0) { + throw new Error("PostScript function stack underflow."); + } + return this.stack.pop(); + } + copy(n) { + if (this.stack.length + n >= PostScriptStack.MAX_STACK_SIZE) { + throw new Error("PostScript function stack overflow."); + } + const stack = this.stack; + for (let i = stack.length - n, j = n - 1; j >= 0; j--, i++) { + stack.push(stack[i]); + } + } + index(n) { + this.push(this.stack[this.stack.length - n - 1]); + } + roll(n, p) { + const stack = this.stack; + const l = stack.length - n; + const r = stack.length - 1; + const c = l + (p - Math.floor(p / n) * n); + for (let i = l, j = r; i < j; i++, j--) { + const t = stack[i]; + stack[i] = stack[j]; + stack[j] = t; + } + for (let i = l, j = c - 1; i < j; i++, j--) { + const t = stack[i]; + stack[i] = stack[j]; + stack[j] = t; + } + for (let i = c, j = r; i < j; i++, j--) { + const t = stack[i]; + stack[i] = stack[j]; + stack[j] = t; + } + } +} +class PostScriptEvaluator { + constructor(operators) { + this.operators = operators; + } + execute(initialStack) { + const stack = new PostScriptStack(initialStack); + let counter = 0; + const operators = this.operators; + const length = operators.length; + let operator, a, b; + while (counter < length) { + operator = operators[counter++]; + if (typeof operator === "number") { + stack.push(operator); + continue; + } + switch (operator) { + case "jz": + b = stack.pop(); + a = stack.pop(); + if (!a) { + counter = b; + } + break; + case "j": + a = stack.pop(); + counter = a; + break; + case "abs": + a = stack.pop(); + stack.push(Math.abs(a)); + break; + case "add": + b = stack.pop(); + a = stack.pop(); + stack.push(a + b); + break; + case "and": + b = stack.pop(); + a = stack.pop(); + if (typeof a === "boolean" && typeof b === "boolean") { + stack.push(a && b); + } else { + stack.push(a & b); + } + break; + case "atan": + b = stack.pop(); + a = stack.pop(); + a = Math.atan2(a, b) / Math.PI * 180; + if (a < 0) { + a += 360; + } + stack.push(a); + break; + case "bitshift": + b = stack.pop(); + a = stack.pop(); + if (a > 0) { + stack.push(a << b); + } else { + stack.push(a >> b); + } + break; + case "ceiling": + a = stack.pop(); + stack.push(Math.ceil(a)); + break; + case "copy": + a = stack.pop(); + stack.copy(a); + break; + case "cos": + a = stack.pop(); + stack.push(Math.cos(a % 360 / 180 * Math.PI)); + break; + case "cvi": + a = stack.pop() | 0; + stack.push(a); + break; + case "cvr": + break; + case "div": + b = stack.pop(); + a = stack.pop(); + stack.push(a / b); + break; + case "dup": + stack.copy(1); + break; + case "eq": + b = stack.pop(); + a = stack.pop(); + stack.push(a === b); + break; + case "exch": + stack.roll(2, 1); + break; + case "exp": + b = stack.pop(); + a = stack.pop(); + stack.push(a ** b); + break; + case "false": + stack.push(false); + break; + case "floor": + a = stack.pop(); + stack.push(Math.floor(a)); + break; + case "ge": + b = stack.pop(); + a = stack.pop(); + stack.push(a >= b); + break; + case "gt": + b = stack.pop(); + a = stack.pop(); + stack.push(a > b); + break; + case "idiv": + b = stack.pop(); + a = stack.pop(); + stack.push(a / b | 0); + break; + case "index": + a = stack.pop(); + stack.index(a); + break; + case "le": + b = stack.pop(); + a = stack.pop(); + stack.push(a <= b); + break; + case "ln": + a = stack.pop(); + stack.push(Math.log(a)); + break; + case "log": + a = stack.pop(); + stack.push(Math.log10(a)); + break; + case "lt": + b = stack.pop(); + a = stack.pop(); + stack.push(a < b); + break; + case "mod": + b = stack.pop(); + a = stack.pop(); + stack.push(a % b); + break; + case "mul": + b = stack.pop(); + a = stack.pop(); + stack.push(a * b); + break; + case "ne": + b = stack.pop(); + a = stack.pop(); + stack.push(a !== b); + break; + case "neg": + a = stack.pop(); + stack.push(-a); + break; + case "not": + a = stack.pop(); + if (typeof a === "boolean") { + stack.push(!a); + } else { + stack.push(~a); + } + break; + case "or": + b = stack.pop(); + a = stack.pop(); + if (typeof a === "boolean" && typeof b === "boolean") { + stack.push(a || b); + } else { + stack.push(a | b); + } + break; + case "pop": + stack.pop(); + break; + case "roll": + b = stack.pop(); + a = stack.pop(); + stack.roll(a, b); + break; + case "round": + a = stack.pop(); + stack.push(Math.round(a)); + break; + case "sin": + a = stack.pop(); + stack.push(Math.sin(a % 360 / 180 * Math.PI)); + break; + case "sqrt": + a = stack.pop(); + stack.push(Math.sqrt(a)); + break; + case "sub": + b = stack.pop(); + a = stack.pop(); + stack.push(a - b); + break; + case "true": + stack.push(true); + break; + case "truncate": + a = stack.pop(); + a = a < 0 ? Math.ceil(a) : Math.floor(a); + stack.push(a); + break; + case "xor": + b = stack.pop(); + a = stack.pop(); + if (typeof a === "boolean" && typeof b === "boolean") { + stack.push(a !== b); + } else { + stack.push(a ^ b); + } + break; + default: + throw new FormatError(`Unknown operator ${operator}`); + } + } + return stack.stack; + } +} +class AstNode { + constructor(type) { + this.type = type; + } + visit(visitor) { + unreachable("abstract method"); + } +} +class AstArgument extends AstNode { + constructor(index, min, max) { + super("args"); + this.index = index; + this.min = min; + this.max = max; + } + visit(visitor) { + visitor.visitArgument(this); + } +} +class AstLiteral extends AstNode { + constructor(number) { + super("literal"); + this.number = number; + this.min = number; + this.max = number; + } + visit(visitor) { + visitor.visitLiteral(this); + } +} +class AstBinaryOperation extends AstNode { + constructor(op, arg1, arg2, min, max) { + super("binary"); + this.op = op; + this.arg1 = arg1; + this.arg2 = arg2; + this.min = min; + this.max = max; + } + visit(visitor) { + visitor.visitBinaryOperation(this); + } +} +class AstMin extends AstNode { + constructor(arg, max) { + super("max"); + this.arg = arg; + this.min = arg.min; + this.max = max; + } + visit(visitor) { + visitor.visitMin(this); + } +} +class AstVariable extends AstNode { + constructor(index, min, max) { + super("var"); + this.index = index; + this.min = min; + this.max = max; + } + visit(visitor) { + visitor.visitVariable(this); + } +} +class AstVariableDefinition extends AstNode { + constructor(variable, arg) { + super("definition"); + this.variable = variable; + this.arg = arg; + } + visit(visitor) { + visitor.visitVariableDefinition(this); + } +} +class ExpressionBuilderVisitor { + constructor() { + this.parts = []; + } + visitArgument(arg) { + this.parts.push("Math.max(", arg.min, ", Math.min(", arg.max, ", src[srcOffset + ", arg.index, "]))"); + } + visitVariable(variable) { + this.parts.push("v", variable.index); + } + visitLiteral(literal) { + this.parts.push(literal.number); + } + visitBinaryOperation(operation) { + this.parts.push("("); + operation.arg1.visit(this); + this.parts.push(" ", operation.op, " "); + operation.arg2.visit(this); + this.parts.push(")"); + } + visitVariableDefinition(definition) { + this.parts.push("var "); + definition.variable.visit(this); + this.parts.push(" = "); + definition.arg.visit(this); + this.parts.push(";"); + } + visitMin(max) { + this.parts.push("Math.min("); + max.arg.visit(this); + this.parts.push(", ", max.max, ")"); + } + toString() { + return this.parts.join(""); + } +} +function buildAddOperation(num1, num2) { + if (num2.type === "literal" && num2.number === 0) { + return num1; + } + if (num1.type === "literal" && num1.number === 0) { + return num2; + } + if (num2.type === "literal" && num1.type === "literal") { + return new AstLiteral(num1.number + num2.number); + } + return new AstBinaryOperation("+", num1, num2, num1.min + num2.min, num1.max + num2.max); +} +function buildMulOperation(num1, num2) { + if (num2.type === "literal") { + if (num2.number === 0) { + return new AstLiteral(0); + } else if (num2.number === 1) { + return num1; + } else if (num1.type === "literal") { + return new AstLiteral(num1.number * num2.number); + } + } + if (num1.type === "literal") { + if (num1.number === 0) { + return new AstLiteral(0); + } else if (num1.number === 1) { + return num2; + } + } + const min = Math.min(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); + const max = Math.max(num1.min * num2.min, num1.min * num2.max, num1.max * num2.min, num1.max * num2.max); + return new AstBinaryOperation("*", num1, num2, min, max); +} +function buildSubOperation(num1, num2) { + if (num2.type === "literal") { + if (num2.number === 0) { + return num1; + } else if (num1.type === "literal") { + return new AstLiteral(num1.number - num2.number); + } + } + if (num2.type === "binary" && num2.op === "-" && num1.type === "literal" && num1.number === 1 && num2.arg1.type === "literal" && num2.arg1.number === 1) { + return num2.arg2; + } + return new AstBinaryOperation("-", num1, num2, num1.min - num2.max, num1.max - num2.min); +} +function buildMinOperation(num1, max) { + if (num1.min >= max) { + return new AstLiteral(max); + } else if (num1.max <= max) { + return num1; + } + return new AstMin(num1, max); +} +class PostScriptCompiler { + compile(code, domain, range) { + const stack = []; + const instructions = []; + const inputSize = domain.length >> 1, + outputSize = range.length >> 1; + let lastRegister = 0; + let n, j; + let num1, num2, ast1, ast2, tmpVar, item; + for (let i = 0; i < inputSize; i++) { + stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1])); + } + for (let i = 0, ii = code.length; i < ii; i++) { + item = code[i]; + if (typeof item === "number") { + stack.push(new AstLiteral(item)); + continue; + } + switch (item) { + case "add": + if (stack.length < 2) { + return null; + } + num2 = stack.pop(); + num1 = stack.pop(); + stack.push(buildAddOperation(num1, num2)); + break; + case "cvr": + if (stack.length < 1) { + return null; + } + break; + case "mul": + if (stack.length < 2) { + return null; + } + num2 = stack.pop(); + num1 = stack.pop(); + stack.push(buildMulOperation(num1, num2)); + break; + case "sub": + if (stack.length < 2) { + return null; + } + num2 = stack.pop(); + num1 = stack.pop(); + stack.push(buildSubOperation(num1, num2)); + break; + case "exch": + if (stack.length < 2) { + return null; + } + ast1 = stack.pop(); + ast2 = stack.pop(); + stack.push(ast1, ast2); + break; + case "pop": + if (stack.length < 1) { + return null; + } + stack.pop(); + break; + case "index": + if (stack.length < 1) { + return null; + } + num1 = stack.pop(); + if (num1.type !== "literal") { + return null; + } + n = num1.number; + if (n < 0 || !Number.isInteger(n) || stack.length < n) { + return null; + } + ast1 = stack[stack.length - n - 1]; + if (ast1.type === "literal" || ast1.type === "var") { + stack.push(ast1); + break; + } + tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); + stack[stack.length - n - 1] = tmpVar; + stack.push(tmpVar); + instructions.push(new AstVariableDefinition(tmpVar, ast1)); + break; + case "dup": + if (stack.length < 1) { + return null; + } + if (typeof code[i + 1] === "number" && code[i + 2] === "gt" && code[i + 3] === i + 7 && code[i + 4] === "jz" && code[i + 5] === "pop" && code[i + 6] === code[i + 1]) { + num1 = stack.pop(); + stack.push(buildMinOperation(num1, code[i + 1])); + i += 6; + break; + } + ast1 = stack.at(-1); + if (ast1.type === "literal" || ast1.type === "var") { + stack.push(ast1); + break; + } + tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max); + stack[stack.length - 1] = tmpVar; + stack.push(tmpVar); + instructions.push(new AstVariableDefinition(tmpVar, ast1)); + break; + case "roll": + if (stack.length < 2) { + return null; + } + num2 = stack.pop(); + num1 = stack.pop(); + if (num2.type !== "literal" || num1.type !== "literal") { + return null; + } + j = num2.number; + n = num1.number; + if (n <= 0 || !Number.isInteger(n) || !Number.isInteger(j) || stack.length < n) { + return null; + } + j = (j % n + n) % n; + if (j === 0) { + break; + } + stack.push(...stack.splice(stack.length - n, n - j)); + break; + default: + return null; + } + } + if (stack.length !== outputSize) { + return null; + } + const result = []; + for (const instruction of instructions) { + const statementBuilder = new ExpressionBuilderVisitor(); + instruction.visit(statementBuilder); + result.push(statementBuilder.toString()); + } + for (let i = 0, ii = stack.length; i < ii; i++) { + const expr = stack[i], + statementBuilder = new ExpressionBuilderVisitor(); + expr.visit(statementBuilder); + const min = range[i * 2], + max = range[i * 2 + 1]; + const out = [statementBuilder.toString()]; + if (min > expr.min) { + out.unshift("Math.max(", min, ", "); + out.push(")"); + } + if (max < expr.max) { + out.unshift("Math.min(", max, ", "); + out.push(")"); + } + out.unshift("dest[destOffset + ", i, "] = "); + out.push(";"); + result.push(out.join("")); + } + return result.join("\n"); + } +} + +;// CONCATENATED MODULE: ./src/core/bidi.js + +const baseTypes = ["BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "S", "B", "S", "WS", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "B", "B", "B", "S", "WS", "ON", "ON", "ET", "ET", "ET", "ON", "ON", "ON", "ON", "ON", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "ON", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "ON", "ON", "ON", "BN", "BN", "BN", "BN", "BN", "BN", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "CS", "ON", "ET", "ET", "ET", "ET", "ON", "ON", "ON", "ON", "L", "ON", "ON", "BN", "ON", "ON", "ET", "ET", "EN", "EN", "ON", "L", "ON", "ON", "ON", "EN", "L", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "L", "L", "L", "L", "L", "L", "L", "L"]; +const arabicTypes = ["AN", "AN", "AN", "AN", "AN", "AN", "ON", "ON", "AL", "ET", "ET", "AL", "CS", "AL", "ON", "ON", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "ET", "AN", "AN", "AL", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "ON", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "NSM", "NSM", "ON", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "AL", "AL", "AL", "AL", "AL", "AL"]; +function isOdd(i) { + return (i & 1) !== 0; +} +function isEven(i) { + return (i & 1) === 0; +} +function findUnequal(arr, start, value) { + let j, jj; + for (j = start, jj = arr.length; j < jj; ++j) { + if (arr[j] !== value) { + return j; + } + } + return j; +} +function setValues(arr, start, end, value) { + for (let j = start; j < end; ++j) { + arr[j] = value; + } +} +function reverseValues(arr, start, end) { + for (let i = start, j = end - 1; i < j; ++i, --j) { + const temp = arr[i]; + arr[i] = arr[j]; + arr[j] = temp; + } +} +function createBidiText(str, isLTR, vertical = false) { + let dir = "ltr"; + if (vertical) { + dir = "ttb"; + } else if (!isLTR) { + dir = "rtl"; + } + return { + str, + dir + }; +} +const chars = []; +const types = []; +function bidi(str, startLevel = -1, vertical = false) { + let isLTR = true; + const strLength = str.length; + if (strLength === 0 || vertical) { + return createBidiText(str, isLTR, vertical); + } + chars.length = strLength; + types.length = strLength; + let numBidi = 0; + let i, ii; + for (i = 0; i < strLength; ++i) { + chars[i] = str.charAt(i); + const charCode = str.charCodeAt(i); + let charType = "L"; + if (charCode <= 0x00ff) { + charType = baseTypes[charCode]; + } else if (0x0590 <= charCode && charCode <= 0x05f4) { + charType = "R"; + } else if (0x0600 <= charCode && charCode <= 0x06ff) { + charType = arabicTypes[charCode & 0xff]; + if (!charType) { + warn("Bidi: invalid Unicode character " + charCode.toString(16)); + } + } else if (0x0700 <= charCode && charCode <= 0x08ac || 0xfb50 <= charCode && charCode <= 0xfdff || 0xfe70 <= charCode && charCode <= 0xfeff) { + charType = "AL"; + } + if (charType === "R" || charType === "AL" || charType === "AN") { + numBidi++; + } + types[i] = charType; + } + if (numBidi === 0) { + isLTR = true; + return createBidiText(str, isLTR); + } + if (startLevel === -1) { + if (numBidi / strLength < 0.3 && strLength > 4) { + isLTR = true; + startLevel = 0; + } else { + isLTR = false; + startLevel = 1; + } + } + const levels = []; + for (i = 0; i < strLength; ++i) { + levels[i] = startLevel; + } + const e = isOdd(startLevel) ? "R" : "L"; + const sor = e; + const eor = sor; + let lastType = sor; + for (i = 0; i < strLength; ++i) { + if (types[i] === "NSM") { + types[i] = lastType; + } else { + lastType = types[i]; + } + } + lastType = sor; + let t; + for (i = 0; i < strLength; ++i) { + t = types[i]; + if (t === "EN") { + types[i] = lastType === "AL" ? "AN" : "EN"; + } else if (t === "R" || t === "L" || t === "AL") { + lastType = t; + } + } + for (i = 0; i < strLength; ++i) { + t = types[i]; + if (t === "AL") { + types[i] = "R"; + } + } + for (i = 1; i < strLength - 1; ++i) { + if (types[i] === "ES" && types[i - 1] === "EN" && types[i + 1] === "EN") { + types[i] = "EN"; + } + if (types[i] === "CS" && (types[i - 1] === "EN" || types[i - 1] === "AN") && types[i + 1] === types[i - 1]) { + types[i] = types[i - 1]; + } + } + for (i = 0; i < strLength; ++i) { + if (types[i] === "EN") { + for (let j = i - 1; j >= 0; --j) { + if (types[j] !== "ET") { + break; + } + types[j] = "EN"; + } + for (let j = i + 1; j < strLength; ++j) { + if (types[j] !== "ET") { + break; + } + types[j] = "EN"; + } + } + } + for (i = 0; i < strLength; ++i) { + t = types[i]; + if (t === "WS" || t === "ES" || t === "ET" || t === "CS") { + types[i] = "ON"; + } + } + lastType = sor; + for (i = 0; i < strLength; ++i) { + t = types[i]; + if (t === "EN") { + types[i] = lastType === "L" ? "L" : "EN"; + } else if (t === "R" || t === "L") { + lastType = t; + } + } + for (i = 0; i < strLength; ++i) { + if (types[i] === "ON") { + const end = findUnequal(types, i + 1, "ON"); + let before = sor; + if (i > 0) { + before = types[i - 1]; + } + let after = eor; + if (end + 1 < strLength) { + after = types[end + 1]; + } + if (before !== "L") { + before = "R"; + } + if (after !== "L") { + after = "R"; + } + if (before === after) { + setValues(types, i, end, before); + } + i = end - 1; + } + } + for (i = 0; i < strLength; ++i) { + if (types[i] === "ON") { + types[i] = e; + } + } + for (i = 0; i < strLength; ++i) { + t = types[i]; + if (isEven(levels[i])) { + if (t === "R") { + levels[i] += 1; + } else if (t === "AN" || t === "EN") { + levels[i] += 2; + } + } else if (t === "L" || t === "AN" || t === "EN") { + levels[i] += 1; + } + } + let highestLevel = -1; + let lowestOddLevel = 99; + let level; + for (i = 0, ii = levels.length; i < ii; ++i) { + level = levels[i]; + if (highestLevel < level) { + highestLevel = level; + } + if (lowestOddLevel > level && isOdd(level)) { + lowestOddLevel = level; + } + } + for (level = highestLevel; level >= lowestOddLevel; --level) { + let start = -1; + for (i = 0, ii = levels.length; i < ii; ++i) { + if (levels[i] < level) { + if (start >= 0) { + reverseValues(chars, start, i); + start = -1; + } + } else if (start < 0) { + start = i; + } + } + if (start >= 0) { + reverseValues(chars, start, levels.length); + } + } + for (i = 0, ii = chars.length; i < ii; ++i) { + const ch = chars[i]; + if (ch === "<" || ch === ">") { + chars[i] = ""; + } + } + return createBidiText(chars.join(""), isLTR); +} + +;// CONCATENATED MODULE: ./src/core/font_substitutions.js + + +const NORMAL = { + style: "normal", + weight: "normal" +}; +const BOLD = { + style: "normal", + weight: "bold" +}; +const ITALIC = { + style: "italic", + weight: "normal" +}; +const BOLDITALIC = { + style: "italic", + weight: "bold" +}; +const substitutionMap = new Map([["Times-Roman", { + local: ["Times New Roman", "Times-Roman", "Times", "Liberation Serif", "Nimbus Roman", "Nimbus Roman L", "Tinos", "Thorndale", "TeX Gyre Termes", "FreeSerif", "DejaVu Serif", "Bitstream Vera Serif", "Ubuntu"], + style: NORMAL, + ultimate: "serif" +}], ["Times-Bold", { + alias: "Times-Roman", + style: BOLD, + ultimate: "serif" +}], ["Times-Italic", { + alias: "Times-Roman", + style: ITALIC, + ultimate: "serif" +}], ["Times-BoldItalic", { + alias: "Times-Roman", + style: BOLDITALIC, + ultimate: "serif" +}], ["Helvetica", { + local: ["Helvetica", "Helvetica Neue", "Arial", "Arial Nova", "Liberation Sans", "Arimo", "Nimbus Sans", "Nimbus Sans L", "A030", "TeX Gyre Heros", "FreeSans", "DejaVu Sans", "Albany", "Bitstream Vera Sans", "Arial Unicode MS", "Microsoft Sans Serif", "Apple Symbols", "Cantarell"], + path: "LiberationSans-Regular.ttf", + style: NORMAL, + ultimate: "sans-serif" +}], ["Helvetica-Bold", { + alias: "Helvetica", + path: "LiberationSans-Bold.ttf", + style: BOLD, + ultimate: "sans-serif" +}], ["Helvetica-Oblique", { + alias: "Helvetica", + path: "LiberationSans-Italic.ttf", + style: ITALIC, + ultimate: "sans-serif" +}], ["Helvetica-BoldOblique", { + alias: "Helvetica", + path: "LiberationSans-BoldItalic.ttf", + style: BOLDITALIC, + ultimate: "sans-serif" +}], ["Courier", { + local: ["Courier", "Courier New", "Liberation Mono", "Nimbus Mono", "Nimbus Mono L", "Cousine", "Cumberland", "TeX Gyre Cursor", "FreeMono"], + style: NORMAL, + ultimate: "monospace" +}], ["Courier-Bold", { + alias: "Courier", + style: BOLD, + ultimate: "monospace" +}], ["Courier-Oblique", { + alias: "Courier", + style: ITALIC, + ultimate: "monospace" +}], ["Courier-BoldOblique", { + alias: "Courier", + style: BOLDITALIC, + ultimate: "monospace" +}], ["ArialBlack", { + local: ["Arial Black"], + style: { + style: "normal", + weight: "900" + }, + fallback: "Helvetica-Bold" +}], ["ArialBlack-Bold", { + alias: "ArialBlack" +}], ["ArialBlack-Italic", { + alias: "ArialBlack", + style: { + style: "italic", + weight: "900" + }, + fallback: "Helvetica-BoldOblique" +}], ["ArialBlack-BoldItalic", { + alias: "ArialBlack-Italic" +}], ["ArialNarrow", { + local: ["Arial Narrow", "Liberation Sans Narrow", "Helvetica Condensed", "Nimbus Sans Narrow", "TeX Gyre Heros Cn"], + style: NORMAL, + fallback: "Helvetica" +}], ["ArialNarrow-Bold", { + alias: "ArialNarrow", + style: BOLD, + fallback: "Helvetica-Bold" +}], ["ArialNarrow-Italic", { + alias: "ArialNarrow", + style: ITALIC, + fallback: "Helvetica-Oblique" +}], ["ArialNarrow-BoldItalic", { + alias: "ArialNarrow", + style: BOLDITALIC, + fallback: "Helvetica-BoldOblique" +}], ["Calibri", { + local: ["Calibri", "Carlito"], + style: NORMAL, + fallback: "Helvetica" +}], ["Calibri-Bold", { + alias: "Calibri", + style: BOLD, + fallback: "Helvetica-Bold" +}], ["Calibri-Italic", { + alias: "Calibri", + style: ITALIC, + fallback: "Helvetica-Oblique" +}], ["Calibri-BoldItalic", { + alias: "Calibri", + style: BOLDITALIC, + fallback: "Helvetica-BoldOblique" +}], ["Wingdings", { + local: ["Wingdings", "URW Dingbats"], + style: NORMAL +}], ["Wingdings-Regular", { + alias: "Wingdings" +}], ["Wingdings-Bold", { + alias: "Wingdings" +}]]); +const fontAliases = new Map([["Arial-Black", "ArialBlack"]]); +function getStyleToAppend(style) { + switch (style) { + case BOLD: + return "Bold"; + case ITALIC: + return "Italic"; + case BOLDITALIC: + return "Bold Italic"; + default: + if (style?.weight === "bold") { + return "Bold"; + } + if (style?.style === "italic") { + return "Italic"; + } + } + return ""; +} +function generateFont({ + alias, + local, + path, + fallback, + style, + ultimate +}, src, localFontPath, useFallback = true, usePath = true, append = "") { + const result = { + style: null, + ultimate: null + }; + if (local) { + const extra = append ? ` ${append}` : ""; + for (const name of local) { + src.push(`local(${name}${extra})`); + } + } + if (alias) { + const substitution = substitutionMap.get(alias); + const aliasAppend = append || getStyleToAppend(style); + Object.assign(result, generateFont(substitution, src, localFontPath, useFallback && !fallback, usePath && !path, aliasAppend)); + } + if (style) { + result.style = style; + } + if (ultimate) { + result.ultimate = ultimate; + } + if (useFallback && fallback) { + const fallbackInfo = substitutionMap.get(fallback); + const { + ultimate: fallbackUltimate + } = generateFont(fallbackInfo, src, localFontPath, useFallback, usePath && !path, append); + result.ultimate ||= fallbackUltimate; + } + if (usePath && path && localFontPath) { + src.push(`url(${localFontPath}${path})`); + } + return result; +} +function getFontSubstitution(systemFontCache, idFactory, localFontPath, baseFontName, standardFontName) { + if (baseFontName.startsWith("InvalidPDFjsFont_")) { + return null; + } + baseFontName = normalizeFontName(baseFontName); + const key = baseFontName; + let substitutionInfo = systemFontCache.get(key); + if (substitutionInfo) { + return substitutionInfo; + } + let substitution = substitutionMap.get(baseFontName); + if (!substitution) { + for (const [alias, subst] of fontAliases) { + if (baseFontName.startsWith(alias)) { + baseFontName = `${subst}${baseFontName.substring(alias.length)}`; + substitution = substitutionMap.get(baseFontName); + break; + } + } + } + let mustAddBaseFont = false; + if (!substitution) { + substitution = substitutionMap.get(standardFontName); + mustAddBaseFont = true; + } + const loadedName = `${idFactory.getDocId()}_s${idFactory.createFontId()}`; + if (!substitution) { + if (!validateFontName(baseFontName)) { + systemFontCache.set(key, null); + return null; + } + const bold = /bold/gi.test(baseFontName); + const italic = /oblique|italic/gi.test(baseFontName); + const style = bold && italic && BOLDITALIC || bold && BOLD || italic && ITALIC || NORMAL; + substitutionInfo = { + css: loadedName, + guessFallback: true, + loadedName, + baseFontName, + src: `local(${baseFontName})`, + style + }; + systemFontCache.set(key, substitutionInfo); + return substitutionInfo; + } + const src = []; + if (mustAddBaseFont && validateFontName(baseFontName)) { + src.push(`local(${baseFontName})`); + } + const { + style, + ultimate + } = generateFont(substitution, src, localFontPath); + const guessFallback = ultimate === null; + const fallback = guessFallback ? "" : `,${ultimate}`; + substitutionInfo = { + css: `${loadedName}${fallback}`, + guessFallback, + loadedName, + baseFontName, + src: src.join(","), + style + }; + systemFontCache.set(key, substitutionInfo); + return substitutionInfo; +} + +;// CONCATENATED MODULE: ./src/core/image_resizer.js + +const MIN_IMAGE_DIM = 2048; +const MAX_IMAGE_DIM = 65537; +const MAX_ERROR = 128; +class ImageResizer { + constructor(imgData, isMask) { + this._imgData = imgData; + this._isMask = isMask; + } + static needsToBeResized(width, height) { + if (width <= this._goodSquareLength && height <= this._goodSquareLength) { + return false; + } + const { + MAX_DIM + } = this; + if (width > MAX_DIM || height > MAX_DIM) { + return true; + } + const area = width * height; + if (this._hasMaxArea) { + return area > this.MAX_AREA; + } + if (area < this._goodSquareLength ** 2) { + return false; + } + if (this._areGoodDims(width, height)) { + this._goodSquareLength = Math.max(this._goodSquareLength, Math.floor(Math.sqrt(width * height))); + return false; + } + this._goodSquareLength = this._guessMax(this._goodSquareLength, MAX_DIM, MAX_ERROR, 0); + const maxArea = this.MAX_AREA = this._goodSquareLength ** 2; + return area > maxArea; + } + static get MAX_DIM() { + return shadow(this, "MAX_DIM", this._guessMax(MIN_IMAGE_DIM, MAX_IMAGE_DIM, 0, 1)); + } + static get MAX_AREA() { + this._hasMaxArea = true; + return shadow(this, "MAX_AREA", this._guessMax(ImageResizer._goodSquareLength, this.MAX_DIM, MAX_ERROR, 0) ** 2); + } + static set MAX_AREA(area) { + if (area >= 0) { + this._hasMaxArea = true; + shadow(this, "MAX_AREA", area); + } + } + static setMaxArea(area) { + if (!this._hasMaxArea) { + this.MAX_AREA = area >> 2; + } + } + static _areGoodDims(width, height) { + try { + const canvas = new OffscreenCanvas(width, height); + const ctx = canvas.getContext("2d"); + ctx.fillRect(0, 0, 1, 1); + const opacity = ctx.getImageData(0, 0, 1, 1).data[3]; + canvas.width = canvas.height = 1; + return opacity !== 0; + } catch { + return false; + } + } + static _guessMax(start, end, tolerance, defaultHeight) { + while (start + tolerance + 1 < end) { + const middle = Math.floor((start + end) / 2); + const height = defaultHeight || middle; + if (this._areGoodDims(middle, height)) { + start = middle; + } else { + end = middle; + } + } + return start; + } + static async createImage(imgData, isMask = false) { + return new ImageResizer(imgData, isMask)._createImage(); + } + async _createImage() { + const data = this._encodeBMP(); + const blob = new Blob([data.buffer], { + type: "image/bmp" + }); + const bitmapPromise = createImageBitmap(blob); + const { + MAX_AREA, + MAX_DIM + } = ImageResizer; + const { + _imgData: imgData + } = this; + const { + width, + height + } = imgData; + const minFactor = Math.max(width / MAX_DIM, height / MAX_DIM, Math.sqrt(width * height / MAX_AREA)); + const firstFactor = Math.max(minFactor, 2); + const factor = Math.round(10 * (minFactor + 1.25)) / 10 / firstFactor; + const N = Math.floor(Math.log2(factor)); + const steps = new Array(N + 2).fill(2); + steps[0] = firstFactor; + steps.splice(-1, 1, factor / (1 << N)); + let newWidth = width; + let newHeight = height; + let bitmap = await bitmapPromise; + for (const step of steps) { + const prevWidth = newWidth; + const prevHeight = newHeight; + newWidth = Math.floor(newWidth / step) - 1; + newHeight = Math.floor(newHeight / step) - 1; + const canvas = new OffscreenCanvas(newWidth, newHeight); + const ctx = canvas.getContext("2d"); + ctx.drawImage(bitmap, 0, 0, prevWidth, prevHeight, 0, 0, newWidth, newHeight); + bitmap = canvas.transferToImageBitmap(); + } + imgData.data = null; + imgData.bitmap = bitmap; + imgData.width = newWidth; + imgData.height = newHeight; + return imgData; + } + _encodeBMP() { + const { + width, + height, + kind + } = this._imgData; + let data = this._imgData.data; + let bitPerPixel; + let colorTable = new Uint8Array(0); + let maskTable = colorTable; + let compression = 0; + switch (kind) { + case ImageKind.GRAYSCALE_1BPP: + { + bitPerPixel = 1; + colorTable = new Uint8Array(this._isMask ? [255, 255, 255, 255, 0, 0, 0, 0] : [0, 0, 0, 0, 255, 255, 255, 255]); + const rowLen = width + 7 >> 3; + const rowSize = rowLen + 3 & -4; + if (rowLen !== rowSize) { + const newData = new Uint8Array(rowSize * height); + let k = 0; + for (let i = 0, ii = height * rowLen; i < ii; i += rowLen, k += rowSize) { + newData.set(data.subarray(i, i + rowLen), k); + } + data = newData; + } + break; + } + case ImageKind.RGB_24BPP: + { + bitPerPixel = 24; + if (width & 3) { + const rowLen = 3 * width; + const rowSize = rowLen + 3 & -4; + const extraLen = rowSize - rowLen; + const newData = new Uint8Array(rowSize * height); + let k = 0; + for (let i = 0, ii = height * rowLen; i < ii; i += rowLen) { + const row = data.subarray(i, i + rowLen); + for (let j = 0; j < rowLen; j += 3) { + newData[k++] = row[j + 2]; + newData[k++] = row[j + 1]; + newData[k++] = row[j]; + } + k += extraLen; + } + data = newData; + } else { + for (let i = 0, ii = data.length; i < ii; i += 3) { + const tmp = data[i]; + data[i] = data[i + 2]; + data[i + 2] = tmp; + } + } + break; + } + case ImageKind.RGBA_32BPP: + bitPerPixel = 32; + compression = 3; + maskTable = new Uint8Array(4 + 4 + 4 + 4 + 52); + const view = new DataView(maskTable.buffer); + if (FeatureTest.isLittleEndian) { + view.setUint32(0, 0x000000ff, true); + view.setUint32(4, 0x0000ff00, true); + view.setUint32(8, 0x00ff0000, true); + view.setUint32(12, 0xff000000, true); + } else { + view.setUint32(0, 0xff000000, true); + view.setUint32(4, 0x00ff0000, true); + view.setUint32(8, 0x0000ff00, true); + view.setUint32(12, 0x000000ff, true); + } + break; + default: + throw new Error("invalid format"); + } + let i = 0; + const headerLength = 40 + maskTable.length; + const fileLength = 14 + headerLength + colorTable.length + data.length; + const bmpData = new Uint8Array(fileLength); + const view = new DataView(bmpData.buffer); + view.setUint16(i, 0x4d42, true); + i += 2; + view.setUint32(i, fileLength, true); + i += 4; + view.setUint32(i, 0, true); + i += 4; + view.setUint32(i, 14 + headerLength + colorTable.length, true); + i += 4; + view.setUint32(i, headerLength, true); + i += 4; + view.setInt32(i, width, true); + i += 4; + view.setInt32(i, -height, true); + i += 4; + view.setUint16(i, 1, true); + i += 2; + view.setUint16(i, bitPerPixel, true); + i += 2; + view.setUint32(i, compression, true); + i += 4; + view.setUint32(i, 0, true); + i += 4; + view.setInt32(i, 0, true); + i += 4; + view.setInt32(i, 0, true); + i += 4; + view.setUint32(i, colorTable.length / 4, true); + i += 4; + view.setUint32(i, 0, true); + i += 4; + bmpData.set(maskTable, i); + i += maskTable.length; + bmpData.set(colorTable, i); + i += colorTable.length; + bmpData.set(data, i); + return bmpData; + } +} +ImageResizer._goodSquareLength = MIN_IMAGE_DIM; + +;// CONCATENATED MODULE: ./src/shared/murmurhash3.js + +const SEED = 0xc3d2e1f0; +const MASK_HIGH = 0xffff0000; +const MASK_LOW = 0xffff; +class MurmurHash3_64 { + constructor(seed) { + this.h1 = seed ? seed & 0xffffffff : SEED; + this.h2 = seed ? seed & 0xffffffff : SEED; + } + update(input) { + let data, length; + if (typeof input === "string") { + data = new Uint8Array(input.length * 2); + length = 0; + for (let i = 0, ii = input.length; i < ii; i++) { + const code = input.charCodeAt(i); + if (code <= 0xff) { + data[length++] = code; + } else { + data[length++] = code >>> 8; + data[length++] = code & 0xff; + } + } + } else if (isArrayBuffer(input)) { + data = input.slice(); + length = data.byteLength; + } else { + throw new Error("Wrong data format in MurmurHash3_64_update. " + "Input must be a string or array."); + } + const blockCounts = length >> 2; + const tailLength = length - blockCounts * 4; + const dataUint32 = new Uint32Array(data.buffer, 0, blockCounts); + let k1 = 0, + k2 = 0; + let h1 = this.h1, + h2 = this.h2; + const C1 = 0xcc9e2d51, + C2 = 0x1b873593; + const C1_LOW = C1 & MASK_LOW, + C2_LOW = C2 & MASK_LOW; + for (let i = 0; i < blockCounts; i++) { + if (i & 1) { + k1 = dataUint32[i]; + k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; + k1 = k1 << 15 | k1 >>> 17; + k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; + h1 ^= k1; + h1 = h1 << 13 | h1 >>> 19; + h1 = h1 * 5 + 0xe6546b64; + } else { + k2 = dataUint32[i]; + k2 = k2 * C1 & MASK_HIGH | k2 * C1_LOW & MASK_LOW; + k2 = k2 << 15 | k2 >>> 17; + k2 = k2 * C2 & MASK_HIGH | k2 * C2_LOW & MASK_LOW; + h2 ^= k2; + h2 = h2 << 13 | h2 >>> 19; + h2 = h2 * 5 + 0xe6546b64; + } + } + k1 = 0; + switch (tailLength) { + case 3: + k1 ^= data[blockCounts * 4 + 2] << 16; + case 2: + k1 ^= data[blockCounts * 4 + 1] << 8; + case 1: + k1 ^= data[blockCounts * 4]; + k1 = k1 * C1 & MASK_HIGH | k1 * C1_LOW & MASK_LOW; + k1 = k1 << 15 | k1 >>> 17; + k1 = k1 * C2 & MASK_HIGH | k1 * C2_LOW & MASK_LOW; + if (blockCounts & 1) { + h1 ^= k1; + } else { + h2 ^= k1; + } + } + this.h1 = h1; + this.h2 = h2; + } + hexdigest() { + let h1 = this.h1, + h2 = this.h2; + h1 ^= h2 >>> 1; + h1 = h1 * 0xed558ccd & MASK_HIGH | h1 * 0x8ccd & MASK_LOW; + h2 = h2 * 0xff51afd7 & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xafd7ed55 & MASK_HIGH) >>> 16; + h1 ^= h2 >>> 1; + h1 = h1 * 0x1a85ec53 & MASK_HIGH | h1 * 0xec53 & MASK_LOW; + h2 = h2 * 0xc4ceb9fe & MASK_HIGH | ((h2 << 16 | h1 >>> 16) * 0xb9fe1a85 & MASK_HIGH) >>> 16; + h1 ^= h2 >>> 1; + return (h1 >>> 0).toString(16).padStart(8, "0") + (h2 >>> 0).toString(16).padStart(8, "0"); + } +} + +;// CONCATENATED MODULE: ./src/core/operator_list.js + +function addState(parentState, pattern, checkFn, iterateFn, processFn) { + let state = parentState; + for (let i = 0, ii = pattern.length - 1; i < ii; i++) { + const item = pattern[i]; + state = state[item] ||= []; + } + state[pattern.at(-1)] = { + checkFn, + iterateFn, + processFn + }; +} +const InitialState = []; +addState(InitialState, [OPS.save, OPS.transform, OPS.paintInlineImageXObject, OPS.restore], null, function iterateInlineImageGroup(context, i) { + const fnArray = context.fnArray; + const iFirstSave = context.iCurr - 3; + const pos = (i - iFirstSave) % 4; + switch (pos) { + case 0: + return fnArray[i] === OPS.save; + case 1: + return fnArray[i] === OPS.transform; + case 2: + return fnArray[i] === OPS.paintInlineImageXObject; + case 3: + return fnArray[i] === OPS.restore; + } + throw new Error(`iterateInlineImageGroup - invalid pos: ${pos}`); +}, function foundInlineImageGroup(context, i) { + const MIN_IMAGES_IN_INLINE_IMAGES_BLOCK = 10; + const MAX_IMAGES_IN_INLINE_IMAGES_BLOCK = 200; + const MAX_WIDTH = 1000; + const IMAGE_PADDING = 1; + const fnArray = context.fnArray, + argsArray = context.argsArray; + const curr = context.iCurr; + const iFirstSave = curr - 3; + const iFirstTransform = curr - 2; + const iFirstPIIXO = curr - 1; + const count = Math.min(Math.floor((i - iFirstSave) / 4), MAX_IMAGES_IN_INLINE_IMAGES_BLOCK); + if (count < MIN_IMAGES_IN_INLINE_IMAGES_BLOCK) { + return i - (i - iFirstSave) % 4; + } + let maxX = 0; + const map = []; + let maxLineHeight = 0; + let currentX = IMAGE_PADDING, + currentY = IMAGE_PADDING; + for (let q = 0; q < count; q++) { + const transform = argsArray[iFirstTransform + (q << 2)]; + const img = argsArray[iFirstPIIXO + (q << 2)][0]; + if (currentX + img.width > MAX_WIDTH) { + maxX = Math.max(maxX, currentX); + currentY += maxLineHeight + 2 * IMAGE_PADDING; + currentX = 0; + maxLineHeight = 0; + } + map.push({ + transform, + x: currentX, + y: currentY, + w: img.width, + h: img.height + }); + currentX += img.width + 2 * IMAGE_PADDING; + maxLineHeight = Math.max(maxLineHeight, img.height); + } + const imgWidth = Math.max(maxX, currentX) + IMAGE_PADDING; + const imgHeight = currentY + maxLineHeight + IMAGE_PADDING; + const imgData = new Uint8Array(imgWidth * imgHeight * 4); + const imgRowSize = imgWidth << 2; + for (let q = 0; q < count; q++) { + const data = argsArray[iFirstPIIXO + (q << 2)][0].data; + const rowSize = map[q].w << 2; + let dataOffset = 0; + let offset = map[q].x + map[q].y * imgWidth << 2; + imgData.set(data.subarray(0, rowSize), offset - imgRowSize); + for (let k = 0, kk = map[q].h; k < kk; k++) { + imgData.set(data.subarray(dataOffset, dataOffset + rowSize), offset); + dataOffset += rowSize; + offset += imgRowSize; + } + imgData.set(data.subarray(dataOffset - rowSize, dataOffset), offset); + while (offset >= 0) { + data[offset - 4] = data[offset]; + data[offset - 3] = data[offset + 1]; + data[offset - 2] = data[offset + 2]; + data[offset - 1] = data[offset + 3]; + data[offset + rowSize] = data[offset + rowSize - 4]; + data[offset + rowSize + 1] = data[offset + rowSize - 3]; + data[offset + rowSize + 2] = data[offset + rowSize - 2]; + data[offset + rowSize + 3] = data[offset + rowSize - 1]; + offset -= imgRowSize; + } + } + const img = { + width: imgWidth, + height: imgHeight + }; + if (context.isOffscreenCanvasSupported) { + const canvas = new OffscreenCanvas(imgWidth, imgHeight); + const ctx = canvas.getContext("2d"); + ctx.putImageData(new ImageData(new Uint8ClampedArray(imgData.buffer), imgWidth, imgHeight), 0, 0); + img.bitmap = canvas.transferToImageBitmap(); + img.data = null; + } else { + img.kind = ImageKind.RGBA_32BPP; + img.data = imgData; + } + fnArray.splice(iFirstSave, count * 4, OPS.paintInlineImageXObjectGroup); + argsArray.splice(iFirstSave, count * 4, [img, map]); + return iFirstSave + 1; +}); +addState(InitialState, [OPS.save, OPS.transform, OPS.paintImageMaskXObject, OPS.restore], null, function iterateImageMaskGroup(context, i) { + const fnArray = context.fnArray; + const iFirstSave = context.iCurr - 3; + const pos = (i - iFirstSave) % 4; + switch (pos) { + case 0: + return fnArray[i] === OPS.save; + case 1: + return fnArray[i] === OPS.transform; + case 2: + return fnArray[i] === OPS.paintImageMaskXObject; + case 3: + return fnArray[i] === OPS.restore; + } + throw new Error(`iterateImageMaskGroup - invalid pos: ${pos}`); +}, function foundImageMaskGroup(context, i) { + const MIN_IMAGES_IN_MASKS_BLOCK = 10; + const MAX_IMAGES_IN_MASKS_BLOCK = 100; + const MAX_SAME_IMAGES_IN_MASKS_BLOCK = 1000; + const fnArray = context.fnArray, + argsArray = context.argsArray; + const curr = context.iCurr; + const iFirstSave = curr - 3; + const iFirstTransform = curr - 2; + const iFirstPIMXO = curr - 1; + let count = Math.floor((i - iFirstSave) / 4); + if (count < MIN_IMAGES_IN_MASKS_BLOCK) { + return i - (i - iFirstSave) % 4; + } + let isSameImage = false; + let iTransform, transformArgs; + const firstPIMXOArg0 = argsArray[iFirstPIMXO][0]; + const firstTransformArg0 = argsArray[iFirstTransform][0], + firstTransformArg1 = argsArray[iFirstTransform][1], + firstTransformArg2 = argsArray[iFirstTransform][2], + firstTransformArg3 = argsArray[iFirstTransform][3]; + if (firstTransformArg1 === firstTransformArg2) { + isSameImage = true; + iTransform = iFirstTransform + 4; + let iPIMXO = iFirstPIMXO + 4; + for (let q = 1; q < count; q++, iTransform += 4, iPIMXO += 4) { + transformArgs = argsArray[iTransform]; + if (argsArray[iPIMXO][0] !== firstPIMXOArg0 || transformArgs[0] !== firstTransformArg0 || transformArgs[1] !== firstTransformArg1 || transformArgs[2] !== firstTransformArg2 || transformArgs[3] !== firstTransformArg3) { + if (q < MIN_IMAGES_IN_MASKS_BLOCK) { + isSameImage = false; + } else { + count = q; + } + break; + } + } + } + if (isSameImage) { + count = Math.min(count, MAX_SAME_IMAGES_IN_MASKS_BLOCK); + const positions = new Float32Array(count * 2); + iTransform = iFirstTransform; + for (let q = 0; q < count; q++, iTransform += 4) { + transformArgs = argsArray[iTransform]; + positions[q << 1] = transformArgs[4]; + positions[(q << 1) + 1] = transformArgs[5]; + } + fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectRepeat); + argsArray.splice(iFirstSave, count * 4, [firstPIMXOArg0, firstTransformArg0, firstTransformArg1, firstTransformArg2, firstTransformArg3, positions]); + } else { + count = Math.min(count, MAX_IMAGES_IN_MASKS_BLOCK); + const images = []; + for (let q = 0; q < count; q++) { + transformArgs = argsArray[iFirstTransform + (q << 2)]; + const maskParams = argsArray[iFirstPIMXO + (q << 2)][0]; + images.push({ + data: maskParams.data, + width: maskParams.width, + height: maskParams.height, + interpolate: maskParams.interpolate, + count: maskParams.count, + transform: transformArgs + }); + } + fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectGroup); + argsArray.splice(iFirstSave, count * 4, [images]); + } + return iFirstSave + 1; +}); +addState(InitialState, [OPS.save, OPS.transform, OPS.paintImageXObject, OPS.restore], function (context) { + const argsArray = context.argsArray; + const iFirstTransform = context.iCurr - 2; + return argsArray[iFirstTransform][1] === 0 && argsArray[iFirstTransform][2] === 0; +}, function iterateImageGroup(context, i) { + const fnArray = context.fnArray, + argsArray = context.argsArray; + const iFirstSave = context.iCurr - 3; + const pos = (i - iFirstSave) % 4; + switch (pos) { + case 0: + return fnArray[i] === OPS.save; + case 1: + if (fnArray[i] !== OPS.transform) { + return false; + } + const iFirstTransform = context.iCurr - 2; + const firstTransformArg0 = argsArray[iFirstTransform][0]; + const firstTransformArg3 = argsArray[iFirstTransform][3]; + if (argsArray[i][0] !== firstTransformArg0 || argsArray[i][1] !== 0 || argsArray[i][2] !== 0 || argsArray[i][3] !== firstTransformArg3) { + return false; + } + return true; + case 2: + if (fnArray[i] !== OPS.paintImageXObject) { + return false; + } + const iFirstPIXO = context.iCurr - 1; + const firstPIXOArg0 = argsArray[iFirstPIXO][0]; + if (argsArray[i][0] !== firstPIXOArg0) { + return false; + } + return true; + case 3: + return fnArray[i] === OPS.restore; + } + throw new Error(`iterateImageGroup - invalid pos: ${pos}`); +}, function (context, i) { + const MIN_IMAGES_IN_BLOCK = 3; + const MAX_IMAGES_IN_BLOCK = 1000; + const fnArray = context.fnArray, + argsArray = context.argsArray; + const curr = context.iCurr; + const iFirstSave = curr - 3; + const iFirstTransform = curr - 2; + const iFirstPIXO = curr - 1; + const firstPIXOArg0 = argsArray[iFirstPIXO][0]; + const firstTransformArg0 = argsArray[iFirstTransform][0]; + const firstTransformArg3 = argsArray[iFirstTransform][3]; + const count = Math.min(Math.floor((i - iFirstSave) / 4), MAX_IMAGES_IN_BLOCK); + if (count < MIN_IMAGES_IN_BLOCK) { + return i - (i - iFirstSave) % 4; + } + const positions = new Float32Array(count * 2); + let iTransform = iFirstTransform; + for (let q = 0; q < count; q++, iTransform += 4) { + const transformArgs = argsArray[iTransform]; + positions[q << 1] = transformArgs[4]; + positions[(q << 1) + 1] = transformArgs[5]; + } + const args = [firstPIXOArg0, firstTransformArg0, firstTransformArg3, positions]; + fnArray.splice(iFirstSave, count * 4, OPS.paintImageXObjectRepeat); + argsArray.splice(iFirstSave, count * 4, args); + return iFirstSave + 1; +}); +addState(InitialState, [OPS.beginText, OPS.setFont, OPS.setTextMatrix, OPS.showText, OPS.endText], null, function iterateShowTextGroup(context, i) { + const fnArray = context.fnArray, + argsArray = context.argsArray; + const iFirstSave = context.iCurr - 4; + const pos = (i - iFirstSave) % 5; + switch (pos) { + case 0: + return fnArray[i] === OPS.beginText; + case 1: + return fnArray[i] === OPS.setFont; + case 2: + return fnArray[i] === OPS.setTextMatrix; + case 3: + if (fnArray[i] !== OPS.showText) { + return false; + } + const iFirstSetFont = context.iCurr - 3; + const firstSetFontArg0 = argsArray[iFirstSetFont][0]; + const firstSetFontArg1 = argsArray[iFirstSetFont][1]; + if (argsArray[i][0] !== firstSetFontArg0 || argsArray[i][1] !== firstSetFontArg1) { + return false; + } + return true; + case 4: + return fnArray[i] === OPS.endText; + } + throw new Error(`iterateShowTextGroup - invalid pos: ${pos}`); +}, function (context, i) { + const MIN_CHARS_IN_BLOCK = 3; + const MAX_CHARS_IN_BLOCK = 1000; + const fnArray = context.fnArray, + argsArray = context.argsArray; + const curr = context.iCurr; + const iFirstBeginText = curr - 4; + const iFirstSetFont = curr - 3; + const iFirstSetTextMatrix = curr - 2; + const iFirstShowText = curr - 1; + const iFirstEndText = curr; + const firstSetFontArg0 = argsArray[iFirstSetFont][0]; + const firstSetFontArg1 = argsArray[iFirstSetFont][1]; + let count = Math.min(Math.floor((i - iFirstBeginText) / 5), MAX_CHARS_IN_BLOCK); + if (count < MIN_CHARS_IN_BLOCK) { + return i - (i - iFirstBeginText) % 5; + } + let iFirst = iFirstBeginText; + if (iFirstBeginText >= 4 && fnArray[iFirstBeginText - 4] === fnArray[iFirstSetFont] && fnArray[iFirstBeginText - 3] === fnArray[iFirstSetTextMatrix] && fnArray[iFirstBeginText - 2] === fnArray[iFirstShowText] && fnArray[iFirstBeginText - 1] === fnArray[iFirstEndText] && argsArray[iFirstBeginText - 4][0] === firstSetFontArg0 && argsArray[iFirstBeginText - 4][1] === firstSetFontArg1) { + count++; + iFirst -= 5; + } + let iEndText = iFirst + 4; + for (let q = 1; q < count; q++) { + fnArray.splice(iEndText, 3); + argsArray.splice(iEndText, 3); + iEndText += 2; + } + return iEndText + 1; +}); +class NullOptimizer { + constructor(queue) { + this.queue = queue; + } + _optimize() {} + push(fn, args) { + this.queue.fnArray.push(fn); + this.queue.argsArray.push(args); + this._optimize(); + } + flush() {} + reset() {} +} +class QueueOptimizer extends NullOptimizer { + constructor(queue) { + super(queue); + this.state = null; + this.context = { + iCurr: 0, + fnArray: queue.fnArray, + argsArray: queue.argsArray, + isOffscreenCanvasSupported: false + }; + this.match = null; + this.lastProcessed = 0; + } + set isOffscreenCanvasSupported(value) { + this.context.isOffscreenCanvasSupported = value; + } + _optimize() { + const fnArray = this.queue.fnArray; + let i = this.lastProcessed, + ii = fnArray.length; + let state = this.state; + let match = this.match; + if (!state && !match && i + 1 === ii && !InitialState[fnArray[i]]) { + this.lastProcessed = ii; + return; + } + const context = this.context; + while (i < ii) { + if (match) { + const iterate = (0, match.iterateFn)(context, i); + if (iterate) { + i++; + continue; + } + i = (0, match.processFn)(context, i + 1); + ii = fnArray.length; + match = null; + state = null; + if (i >= ii) { + break; + } + } + state = (state || InitialState)[fnArray[i]]; + if (!state || Array.isArray(state)) { + i++; + continue; + } + context.iCurr = i; + i++; + if (state.checkFn && !(0, state.checkFn)(context)) { + state = null; + continue; + } + match = state; + state = null; + } + this.state = state; + this.match = match; + this.lastProcessed = i; + } + flush() { + while (this.match) { + const length = this.queue.fnArray.length; + this.lastProcessed = (0, this.match.processFn)(this.context, length); + this.match = null; + this.state = null; + this._optimize(); + } + } + reset() { + this.state = null; + this.match = null; + this.lastProcessed = 0; + } +} +class OperatorList { + static CHUNK_SIZE = 1000; + static CHUNK_SIZE_ABOUT = this.CHUNK_SIZE - 5; + constructor(intent = 0, streamSink) { + this._streamSink = streamSink; + this.fnArray = []; + this.argsArray = []; + this.optimizer = streamSink && !(intent & RenderingIntentFlag.OPLIST) ? new QueueOptimizer(this) : new NullOptimizer(this); + this.dependencies = new Set(); + this._totalLength = 0; + this.weight = 0; + this._resolved = streamSink ? null : Promise.resolve(); + } + set isOffscreenCanvasSupported(value) { + this.optimizer.isOffscreenCanvasSupported = value; + } + get length() { + return this.argsArray.length; + } + get ready() { + return this._resolved || this._streamSink.ready; + } + get totalLength() { + return this._totalLength + this.length; + } + addOp(fn, args) { + this.optimizer.push(fn, args); + this.weight++; + if (this._streamSink) { + if (this.weight >= OperatorList.CHUNK_SIZE) { + this.flush(); + } else if (this.weight >= OperatorList.CHUNK_SIZE_ABOUT && (fn === OPS.restore || fn === OPS.endText)) { + this.flush(); + } + } + } + addImageOps(fn, args, optionalContent) { + if (optionalContent !== undefined) { + this.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]); + } + this.addOp(fn, args); + if (optionalContent !== undefined) { + this.addOp(OPS.endMarkedContent, []); + } + } + addDependency(dependency) { + if (this.dependencies.has(dependency)) { + return; + } + this.dependencies.add(dependency); + this.addOp(OPS.dependency, [dependency]); + } + addDependencies(dependencies) { + for (const dependency of dependencies) { + this.addDependency(dependency); + } + } + addOpList(opList) { + if (!(opList instanceof OperatorList)) { + warn('addOpList - ignoring invalid "opList" parameter.'); + return; + } + for (const dependency of opList.dependencies) { + this.dependencies.add(dependency); + } + for (let i = 0, ii = opList.length; i < ii; i++) { + this.addOp(opList.fnArray[i], opList.argsArray[i]); + } + } + getIR() { + return { + fnArray: this.fnArray, + argsArray: this.argsArray, + length: this.length + }; + } + get _transfers() { + const transfers = []; + const { + fnArray, + argsArray, + length + } = this; + for (let i = 0; i < length; i++) { + switch (fnArray[i]) { + case OPS.paintInlineImageXObject: + case OPS.paintInlineImageXObjectGroup: + case OPS.paintImageMaskXObject: + const arg = argsArray[i][0]; + if (!arg.cached && arg.data?.buffer instanceof ArrayBuffer) { + transfers.push(arg.data.buffer); + } + break; + } + } + return transfers; + } + flush(lastChunk = false, separateAnnots = null) { + this.optimizer.flush(); + const length = this.length; + this._totalLength += length; + this._streamSink.enqueue({ + fnArray: this.fnArray, + argsArray: this.argsArray, + lastChunk, + separateAnnots, + length + }, 1, this._transfers); + this.dependencies.clear(); + this.fnArray.length = 0; + this.argsArray.length = 0; + this.weight = 0; + this.optimizer.reset(); + } +} + +;// CONCATENATED MODULE: ./src/core/image.js + + + + + + + + + +function decodeAndClamp(value, addend, coefficient, max) { + value = addend + value * coefficient; + if (value < 0) { + value = 0; + } else if (value > max) { + value = max; + } + return value; +} +function resizeImageMask(src, bpc, w1, h1, w2, h2) { + const length = w2 * h2; + let dest; + if (bpc <= 8) { + dest = new Uint8Array(length); + } else if (bpc <= 16) { + dest = new Uint16Array(length); + } else { + dest = new Uint32Array(length); + } + const xRatio = w1 / w2; + const yRatio = h1 / h2; + let i, + j, + py, + newIndex = 0, + oldIndex; + const xScaled = new Uint16Array(w2); + const w1Scanline = w1; + for (i = 0; i < w2; i++) { + xScaled[i] = Math.floor(i * xRatio); + } + for (i = 0; i < h2; i++) { + py = Math.floor(i * yRatio) * w1Scanline; + for (j = 0; j < w2; j++) { + oldIndex = py + xScaled[j]; + dest[newIndex++] = src[oldIndex]; + } + } + return dest; +} +class PDFImage { + constructor({ + xref, + res, + image, + isInline = false, + smask = null, + mask = null, + isMask = false, + pdfFunctionFactory, + localColorSpaceCache + }) { + this.image = image; + const dict = image.dict; + const filter = dict.get("F", "Filter"); + let filterName; + if (filter instanceof Name) { + filterName = filter.name; + } else if (Array.isArray(filter)) { + const filterZero = xref.fetchIfRef(filter[0]); + if (filterZero instanceof Name) { + filterName = filterZero.name; + } + } + switch (filterName) { + case "JPXDecode": + const jpxImage = new JpxImage(); + jpxImage.parseImageProperties(image.stream); + image.stream.reset(); + image.width = jpxImage.width; + image.height = jpxImage.height; + image.bitsPerComponent = jpxImage.bitsPerComponent; + image.numComps = jpxImage.componentsCount; + break; + case "JBIG2Decode": + image.bitsPerComponent = 1; + image.numComps = 1; + break; + } + let width = dict.get("W", "Width"); + let height = dict.get("H", "Height"); + if (Number.isInteger(image.width) && image.width > 0 && Number.isInteger(image.height) && image.height > 0 && (image.width !== width || image.height !== height)) { + warn("PDFImage - using the Width/Height of the image data, " + "rather than the image dictionary."); + width = image.width; + height = image.height; + } + if (width < 1 || height < 1) { + throw new FormatError(`Invalid image width: ${width} or height: ${height}`); + } + this.width = width; + this.height = height; + this.interpolate = dict.get("I", "Interpolate"); + this.imageMask = dict.get("IM", "ImageMask") || false; + this.matte = dict.get("Matte") || false; + let bitsPerComponent = image.bitsPerComponent; + if (!bitsPerComponent) { + bitsPerComponent = dict.get("BPC", "BitsPerComponent"); + if (!bitsPerComponent) { + if (this.imageMask) { + bitsPerComponent = 1; + } else { + throw new FormatError(`Bits per component missing in image: ${this.imageMask}`); + } + } + } + this.bpc = bitsPerComponent; + if (!this.imageMask) { + let colorSpace = dict.getRaw("CS") || dict.getRaw("ColorSpace"); + if (!colorSpace) { + info("JPX images (which do not require color spaces)"); + switch (image.numComps) { + case 1: + colorSpace = Name.get("DeviceGray"); + break; + case 3: + colorSpace = Name.get("DeviceRGB"); + break; + case 4: + colorSpace = Name.get("DeviceCMYK"); + break; + default: + throw new Error(`JPX images with ${image.numComps} color components not supported.`); + } + } + this.colorSpace = ColorSpace.parse({ + cs: colorSpace, + xref, + resources: isInline ? res : null, + pdfFunctionFactory, + localColorSpaceCache + }); + this.numComps = this.colorSpace.numComps; + } + this.decode = dict.getArray("D", "Decode"); + this.needsDecode = false; + if (this.decode && (this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode, bitsPerComponent) || isMask && !ColorSpace.isDefaultDecode(this.decode, 1))) { + this.needsDecode = true; + const max = (1 << bitsPerComponent) - 1; + this.decodeCoefficients = []; + this.decodeAddends = []; + const isIndexed = this.colorSpace?.name === "Indexed"; + for (let i = 0, j = 0; i < this.decode.length; i += 2, ++j) { + const dmin = this.decode[i]; + const dmax = this.decode[i + 1]; + this.decodeCoefficients[j] = isIndexed ? (dmax - dmin) / max : dmax - dmin; + this.decodeAddends[j] = isIndexed ? dmin : max * dmin; + } + } + if (smask) { + this.smask = new PDFImage({ + xref, + res, + image: smask, + isInline, + pdfFunctionFactory, + localColorSpaceCache + }); + } else if (mask) { + if (mask instanceof BaseStream) { + const maskDict = mask.dict, + imageMask = maskDict.get("IM", "ImageMask"); + if (!imageMask) { + warn("Ignoring /Mask in image without /ImageMask."); + } else { + this.mask = new PDFImage({ + xref, + res, + image: mask, + isInline, + isMask: true, + pdfFunctionFactory, + localColorSpaceCache + }); + } + } else { + this.mask = mask; + } + } + } + static async buildImage({ + xref, + res, + image, + isInline = false, + pdfFunctionFactory, + localColorSpaceCache + }) { + const imageData = image; + let smaskData = null; + let maskData = null; + const smask = image.dict.get("SMask"); + const mask = image.dict.get("Mask"); + if (smask) { + if (smask instanceof BaseStream) { + smaskData = smask; + } else { + warn("Unsupported /SMask format."); + } + } else if (mask) { + if (mask instanceof BaseStream || Array.isArray(mask)) { + maskData = mask; + } else { + warn("Unsupported /Mask format."); + } + } + return new PDFImage({ + xref, + res, + image: imageData, + isInline, + smask: smaskData, + mask: maskData, + pdfFunctionFactory, + localColorSpaceCache + }); + } + static createRawMask({ + imgArray, + width, + height, + imageIsFromDecodeStream, + inverseDecode, + interpolate + }) { + const computedLength = (width + 7 >> 3) * height; + const actualLength = imgArray.byteLength; + const haveFullData = computedLength === actualLength; + let data, i; + if (imageIsFromDecodeStream && (!inverseDecode || haveFullData)) { + data = imgArray; + } else if (!inverseDecode) { + data = new Uint8Array(imgArray); + } else { + data = new Uint8Array(computedLength); + data.set(imgArray); + data.fill(0xff, actualLength); + } + if (inverseDecode) { + for (i = 0; i < actualLength; i++) { + data[i] ^= 0xff; + } + } + return { + data, + width, + height, + interpolate + }; + } + static async createMask({ + imgArray, + width, + height, + imageIsFromDecodeStream, + inverseDecode, + interpolate, + isOffscreenCanvasSupported = false + }) { + const isSingleOpaquePixel = width === 1 && height === 1 && inverseDecode === (imgArray.length === 0 || !!(imgArray[0] & 128)); + if (isSingleOpaquePixel) { + return { + isSingleOpaquePixel + }; + } + if (isOffscreenCanvasSupported) { + if (ImageResizer.needsToBeResized(width, height)) { + const data = new Uint8ClampedArray(width * height * 4); + convertBlackAndWhiteToRGBA({ + src: imgArray, + dest: data, + width, + height, + nonBlackColor: 0, + inverseDecode + }); + return ImageResizer.createImage({ + kind: ImageKind.RGBA_32BPP, + data, + width, + height, + interpolate + }); + } + const canvas = new OffscreenCanvas(width, height); + const ctx = canvas.getContext("2d"); + const imgData = ctx.createImageData(width, height); + convertBlackAndWhiteToRGBA({ + src: imgArray, + dest: imgData.data, + width, + height, + nonBlackColor: 0, + inverseDecode + }); + ctx.putImageData(imgData, 0, 0); + const bitmap = canvas.transferToImageBitmap(); + return { + data: null, + width, + height, + interpolate, + bitmap + }; + } + return this.createRawMask({ + imgArray, + width, + height, + inverseDecode, + imageIsFromDecodeStream, + interpolate + }); + } + get drawWidth() { + return Math.max(this.width, this.smask?.width || 0, this.mask?.width || 0); + } + get drawHeight() { + return Math.max(this.height, this.smask?.height || 0, this.mask?.height || 0); + } + decodeBuffer(buffer) { + const bpc = this.bpc; + const numComps = this.numComps; + const decodeAddends = this.decodeAddends; + const decodeCoefficients = this.decodeCoefficients; + const max = (1 << bpc) - 1; + let i, ii; + if (bpc === 1) { + for (i = 0, ii = buffer.length; i < ii; i++) { + buffer[i] = +!buffer[i]; + } + return; + } + let index = 0; + for (i = 0, ii = this.width * this.height; i < ii; i++) { + for (let j = 0; j < numComps; j++) { + buffer[index] = decodeAndClamp(buffer[index], decodeAddends[j], decodeCoefficients[j], max); + index++; + } + } + } + getComponents(buffer) { + const bpc = this.bpc; + if (bpc === 8) { + return buffer; + } + const width = this.width; + const height = this.height; + const numComps = this.numComps; + const length = width * height * numComps; + let bufferPos = 0; + let output; + if (bpc <= 8) { + output = new Uint8Array(length); + } else if (bpc <= 16) { + output = new Uint16Array(length); + } else { + output = new Uint32Array(length); + } + const rowComps = width * numComps; + const max = (1 << bpc) - 1; + let i = 0, + ii, + buf; + if (bpc === 1) { + let mask, loop1End, loop2End; + for (let j = 0; j < height; j++) { + loop1End = i + (rowComps & ~7); + loop2End = i + rowComps; + while (i < loop1End) { + buf = buffer[bufferPos++]; + output[i] = buf >> 7 & 1; + output[i + 1] = buf >> 6 & 1; + output[i + 2] = buf >> 5 & 1; + output[i + 3] = buf >> 4 & 1; + output[i + 4] = buf >> 3 & 1; + output[i + 5] = buf >> 2 & 1; + output[i + 6] = buf >> 1 & 1; + output[i + 7] = buf & 1; + i += 8; + } + if (i < loop2End) { + buf = buffer[bufferPos++]; + mask = 128; + while (i < loop2End) { + output[i++] = +!!(buf & mask); + mask >>= 1; + } + } + } + } else { + let bits = 0; + buf = 0; + for (i = 0, ii = length; i < ii; ++i) { + if (i % rowComps === 0) { + buf = 0; + bits = 0; + } + while (bits < bpc) { + buf = buf << 8 | buffer[bufferPos++]; + bits += 8; + } + const remainingBits = bits - bpc; + let value = buf >> remainingBits; + if (value < 0) { + value = 0; + } else if (value > max) { + value = max; + } + output[i] = value; + buf &= (1 << remainingBits) - 1; + bits = remainingBits; + } + } + return output; + } + fillOpacity(rgbaBuf, width, height, actualHeight, image) { + const smask = this.smask; + const mask = this.mask; + let alphaBuf, sw, sh, i, ii, j; + if (smask) { + sw = smask.width; + sh = smask.height; + alphaBuf = new Uint8ClampedArray(sw * sh); + smask.fillGrayBuffer(alphaBuf); + if (sw !== width || sh !== height) { + alphaBuf = resizeImageMask(alphaBuf, smask.bpc, sw, sh, width, height); + } + } else if (mask) { + if (mask instanceof PDFImage) { + sw = mask.width; + sh = mask.height; + alphaBuf = new Uint8ClampedArray(sw * sh); + mask.numComps = 1; + mask.fillGrayBuffer(alphaBuf); + for (i = 0, ii = sw * sh; i < ii; ++i) { + alphaBuf[i] = 255 - alphaBuf[i]; + } + if (sw !== width || sh !== height) { + alphaBuf = resizeImageMask(alphaBuf, mask.bpc, sw, sh, width, height); + } + } else if (Array.isArray(mask)) { + alphaBuf = new Uint8ClampedArray(width * height); + const numComps = this.numComps; + for (i = 0, ii = width * height; i < ii; ++i) { + let opacity = 0; + const imageOffset = i * numComps; + for (j = 0; j < numComps; ++j) { + const color = image[imageOffset + j]; + const maskOffset = j * 2; + if (color < mask[maskOffset] || color > mask[maskOffset + 1]) { + opacity = 255; + break; + } + } + alphaBuf[i] = opacity; + } + } else { + throw new FormatError("Unknown mask format."); + } + } + if (alphaBuf) { + for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { + rgbaBuf[j] = alphaBuf[i]; + } + } else { + for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) { + rgbaBuf[j] = 255; + } + } + } + undoPreblend(buffer, width, height) { + const matte = this.smask?.matte; + if (!matte) { + return; + } + const matteRgb = this.colorSpace.getRgb(matte, 0); + const matteR = matteRgb[0]; + const matteG = matteRgb[1]; + const matteB = matteRgb[2]; + const length = width * height * 4; + for (let i = 0; i < length; i += 4) { + const alpha = buffer[i + 3]; + if (alpha === 0) { + buffer[i] = 255; + buffer[i + 1] = 255; + buffer[i + 2] = 255; + continue; + } + const k = 255 / alpha; + buffer[i] = (buffer[i] - matteR) * k + matteR; + buffer[i + 1] = (buffer[i + 1] - matteG) * k + matteG; + buffer[i + 2] = (buffer[i + 2] - matteB) * k + matteB; + } + } + async createImageData(forceRGBA = false, isOffscreenCanvasSupported = false) { + const drawWidth = this.drawWidth; + const drawHeight = this.drawHeight; + const imgData = { + width: drawWidth, + height: drawHeight, + interpolate: this.interpolate, + kind: 0, + data: null + }; + const numComps = this.numComps; + const originalWidth = this.width; + const originalHeight = this.height; + const bpc = this.bpc; + const rowBytes = originalWidth * numComps * bpc + 7 >> 3; + const mustBeResized = isOffscreenCanvasSupported && ImageResizer.needsToBeResized(drawWidth, drawHeight); + if (!forceRGBA) { + let kind; + if (this.colorSpace.name === "DeviceGray" && bpc === 1) { + kind = ImageKind.GRAYSCALE_1BPP; + } else if (this.colorSpace.name === "DeviceRGB" && bpc === 8 && !this.needsDecode) { + kind = ImageKind.RGB_24BPP; + } + if (kind && !this.smask && !this.mask && drawWidth === originalWidth && drawHeight === originalHeight) { + const data = this.getImageBytes(originalHeight * rowBytes, {}); + if (isOffscreenCanvasSupported) { + if (mustBeResized) { + return ImageResizer.createImage({ + data, + kind, + width: drawWidth, + height: drawHeight, + interpolate: this.interpolate + }, this.needsDecode); + } + return this.createBitmap(kind, originalWidth, originalHeight, data); + } + imgData.kind = kind; + imgData.data = data; + if (this.needsDecode) { + assert(kind === ImageKind.GRAYSCALE_1BPP, "PDFImage.createImageData: The image must be grayscale."); + const buffer = imgData.data; + for (let i = 0, ii = buffer.length; i < ii; i++) { + buffer[i] ^= 0xff; + } + } + return imgData; + } + if (this.image instanceof JpegStream && !this.smask && !this.mask && !this.needsDecode) { + let imageLength = originalHeight * rowBytes; + if (isOffscreenCanvasSupported && !mustBeResized) { + let isHandled = false; + switch (this.colorSpace.name) { + case "DeviceGray": + imageLength *= 4; + isHandled = true; + break; + case "DeviceRGB": + imageLength = imageLength / 3 * 4; + isHandled = true; + break; + case "DeviceCMYK": + isHandled = true; + break; + } + if (isHandled) { + const rgba = this.getImageBytes(imageLength, { + drawWidth, + drawHeight, + forceRGBA: true + }); + return this.createBitmap(ImageKind.RGBA_32BPP, drawWidth, drawHeight, rgba); + } + } else { + switch (this.colorSpace.name) { + case "DeviceGray": + imageLength *= 3; + case "DeviceRGB": + case "DeviceCMYK": + imgData.kind = ImageKind.RGB_24BPP; + imgData.data = this.getImageBytes(imageLength, { + drawWidth, + drawHeight, + forceRGB: true + }); + if (mustBeResized) { + return ImageResizer.createImage(imgData); + } + return imgData; + } + } + } + } + const imgArray = this.getImageBytes(originalHeight * rowBytes, { + internal: true + }); + const actualHeight = 0 | imgArray.length / rowBytes * drawHeight / originalHeight; + const comps = this.getComponents(imgArray); + let alpha01, maybeUndoPreblend; + let canvas, ctx, canvasImgData, data; + if (isOffscreenCanvasSupported && !mustBeResized) { + canvas = new OffscreenCanvas(drawWidth, drawHeight); + ctx = canvas.getContext("2d"); + canvasImgData = ctx.createImageData(drawWidth, drawHeight); + data = canvasImgData.data; + } + imgData.kind = ImageKind.RGBA_32BPP; + if (!forceRGBA && !this.smask && !this.mask) { + if (!isOffscreenCanvasSupported || mustBeResized) { + imgData.kind = ImageKind.RGB_24BPP; + data = new Uint8ClampedArray(drawWidth * drawHeight * 3); + alpha01 = 0; + } else { + const arr = new Uint32Array(data.buffer); + arr.fill(FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff); + alpha01 = 1; + } + maybeUndoPreblend = false; + } else { + if (!isOffscreenCanvasSupported || mustBeResized) { + data = new Uint8ClampedArray(drawWidth * drawHeight * 4); + } + alpha01 = 1; + maybeUndoPreblend = true; + this.fillOpacity(data, drawWidth, drawHeight, actualHeight, comps); + } + if (this.needsDecode) { + this.decodeBuffer(comps); + } + this.colorSpace.fillRgb(data, originalWidth, originalHeight, drawWidth, drawHeight, actualHeight, bpc, comps, alpha01); + if (maybeUndoPreblend) { + this.undoPreblend(data, drawWidth, actualHeight); + } + if (isOffscreenCanvasSupported && !mustBeResized) { + ctx.putImageData(canvasImgData, 0, 0); + const bitmap = canvas.transferToImageBitmap(); + return { + data: null, + width: drawWidth, + height: drawHeight, + bitmap, + interpolate: this.interpolate + }; + } + imgData.data = data; + if (mustBeResized) { + return ImageResizer.createImage(imgData); + } + return imgData; + } + fillGrayBuffer(buffer) { + const numComps = this.numComps; + if (numComps !== 1) { + throw new FormatError(`Reading gray scale from a color image: ${numComps}`); + } + const width = this.width; + const height = this.height; + const bpc = this.bpc; + const rowBytes = width * numComps * bpc + 7 >> 3; + const imgArray = this.getImageBytes(height * rowBytes, { + internal: true + }); + const comps = this.getComponents(imgArray); + let i, length; + if (bpc === 1) { + length = width * height; + if (this.needsDecode) { + for (i = 0; i < length; ++i) { + buffer[i] = comps[i] - 1 & 255; + } + } else { + for (i = 0; i < length; ++i) { + buffer[i] = -comps[i] & 255; + } + } + return; + } + if (this.needsDecode) { + this.decodeBuffer(comps); + } + length = width * height; + const scale = 255 / ((1 << bpc) - 1); + for (i = 0; i < length; ++i) { + buffer[i] = scale * comps[i]; + } + } + createBitmap(kind, width, height, src) { + const canvas = new OffscreenCanvas(width, height); + const ctx = canvas.getContext("2d"); + let imgData; + if (kind === ImageKind.RGBA_32BPP) { + imgData = new ImageData(src, width, height); + } else { + imgData = ctx.createImageData(width, height); + convertToRGBA({ + kind, + src, + dest: new Uint32Array(imgData.data.buffer), + width, + height, + inverseDecode: this.needsDecode + }); + } + ctx.putImageData(imgData, 0, 0); + const bitmap = canvas.transferToImageBitmap(); + return { + data: null, + width, + height, + bitmap, + interpolate: this.interpolate + }; + } + getImageBytes(length, { + drawWidth, + drawHeight, + forceRGBA = false, + forceRGB = false, + internal = false + }) { + this.image.reset(); + this.image.drawWidth = drawWidth || this.width; + this.image.drawHeight = drawHeight || this.height; + this.image.forceRGBA = !!forceRGBA; + this.image.forceRGB = !!forceRGB; + const imageBytes = this.image.getBytes(length); + if (internal || this.image instanceof DecodeStream) { + return imageBytes; + } + assert(imageBytes instanceof Uint8Array, 'PDFImage.getImageBytes: Unsupported "imageBytes" type.'); + return new Uint8Array(imageBytes); + } +} + +;// CONCATENATED MODULE: ./src/core/evaluator.js + + + + + + + + + + + + + + + + + + + + + + + + + + +const DefaultPartialEvaluatorOptions = Object.freeze({ + maxImageSize: -1, + disableFontFace: false, + ignoreErrors: false, + isEvalSupported: true, + isOffscreenCanvasSupported: false, + canvasMaxAreaInBytes: -1, + fontExtraProperties: false, + useSystemFonts: true, + cMapUrl: null, + standardFontDataUrl: null +}); +const PatternType = { + TILING: 1, + SHADING: 2 +}; +const TEXT_CHUNK_BATCH_SIZE = 10; +const deferred = Promise.resolve(); +function normalizeBlendMode(value, parsingArray = false) { + if (Array.isArray(value)) { + for (const val of value) { + const maybeBM = normalizeBlendMode(val, true); + if (maybeBM) { + return maybeBM; + } + } + warn(`Unsupported blend mode Array: ${value}`); + return "source-over"; + } + if (!(value instanceof Name)) { + if (parsingArray) { + return null; + } + return "source-over"; + } + switch (value.name) { + case "Normal": + case "Compatible": + return "source-over"; + case "Multiply": + return "multiply"; + case "Screen": + return "screen"; + case "Overlay": + return "overlay"; + case "Darken": + return "darken"; + case "Lighten": + return "lighten"; + case "ColorDodge": + return "color-dodge"; + case "ColorBurn": + return "color-burn"; + case "HardLight": + return "hard-light"; + case "SoftLight": + return "soft-light"; + case "Difference": + return "difference"; + case "Exclusion": + return "exclusion"; + case "Hue": + return "hue"; + case "Saturation": + return "saturation"; + case "Color": + return "color"; + case "Luminosity": + return "luminosity"; + } + if (parsingArray) { + return null; + } + warn(`Unsupported blend mode: ${value.name}`); + return "source-over"; +} +function incrementCachedImageMaskCount(data) { + if (data.fn === OPS.paintImageMaskXObject && data.args[0]?.count > 0) { + data.args[0].count++; + } +} +class TimeSlotManager { + static TIME_SLOT_DURATION_MS = 20; + static CHECK_TIME_EVERY = 100; + constructor() { + this.reset(); + } + check() { + if (++this.checked < TimeSlotManager.CHECK_TIME_EVERY) { + return false; + } + this.checked = 0; + return this.endTime <= Date.now(); + } + reset() { + this.endTime = Date.now() + TimeSlotManager.TIME_SLOT_DURATION_MS; + this.checked = 0; + } +} +class PartialEvaluator { + constructor({ + xref, + handler, + pageIndex, + idFactory, + fontCache, + builtInCMapCache, + standardFontDataCache, + globalImageCache, + systemFontCache, + options = null + }) { + this.xref = xref; + this.handler = handler; + this.pageIndex = pageIndex; + this.idFactory = idFactory; + this.fontCache = fontCache; + this.builtInCMapCache = builtInCMapCache; + this.standardFontDataCache = standardFontDataCache; + this.globalImageCache = globalImageCache; + this.systemFontCache = systemFontCache; + this.options = options || DefaultPartialEvaluatorOptions; + this.parsingType3Font = false; + this._regionalImageCache = new RegionalImageCache(); + this._fetchBuiltInCMapBound = this.fetchBuiltInCMap.bind(this); + ImageResizer.setMaxArea(this.options.canvasMaxAreaInBytes); + } + get _pdfFunctionFactory() { + const pdfFunctionFactory = new PDFFunctionFactory({ + xref: this.xref, + isEvalSupported: this.options.isEvalSupported + }); + return shadow(this, "_pdfFunctionFactory", pdfFunctionFactory); + } + clone(newOptions = null) { + const newEvaluator = Object.create(this); + newEvaluator.options = Object.assign(Object.create(null), this.options, newOptions); + return newEvaluator; + } + hasBlendModes(resources, nonBlendModesSet) { + if (!(resources instanceof Dict)) { + return false; + } + if (resources.objId && nonBlendModesSet.has(resources.objId)) { + return false; + } + const processed = new RefSet(nonBlendModesSet); + if (resources.objId) { + processed.put(resources.objId); + } + const nodes = [resources], + xref = this.xref; + while (nodes.length) { + const node = nodes.shift(); + const graphicStates = node.get("ExtGState"); + if (graphicStates instanceof Dict) { + for (let graphicState of graphicStates.getRawValues()) { + if (graphicState instanceof Ref) { + if (processed.has(graphicState)) { + continue; + } + try { + graphicState = xref.fetch(graphicState); + } catch (ex) { + processed.put(graphicState); + info(`hasBlendModes - ignoring ExtGState: "${ex}".`); + continue; + } + } + if (!(graphicState instanceof Dict)) { + continue; + } + if (graphicState.objId) { + processed.put(graphicState.objId); + } + const bm = graphicState.get("BM"); + if (bm instanceof Name) { + if (bm.name !== "Normal") { + return true; + } + continue; + } + if (bm !== undefined && Array.isArray(bm)) { + for (const element of bm) { + if (element instanceof Name && element.name !== "Normal") { + return true; + } + } + } + } + } + const xObjects = node.get("XObject"); + if (!(xObjects instanceof Dict)) { + continue; + } + for (let xObject of xObjects.getRawValues()) { + if (xObject instanceof Ref) { + if (processed.has(xObject)) { + continue; + } + try { + xObject = xref.fetch(xObject); + } catch (ex) { + processed.put(xObject); + info(`hasBlendModes - ignoring XObject: "${ex}".`); + continue; + } + } + if (!(xObject instanceof BaseStream)) { + continue; + } + if (xObject.dict.objId) { + processed.put(xObject.dict.objId); + } + const xResources = xObject.dict.get("Resources"); + if (!(xResources instanceof Dict)) { + continue; + } + if (xResources.objId && processed.has(xResources.objId)) { + continue; + } + nodes.push(xResources); + if (xResources.objId) { + processed.put(xResources.objId); + } + } + } + for (const ref of processed) { + nonBlendModesSet.put(ref); + } + return false; + } + async fetchBuiltInCMap(name) { + const cachedData = this.builtInCMapCache.get(name); + if (cachedData) { + return cachedData; + } + let data; + if (this.options.cMapUrl !== null) { + const url = `${this.options.cMapUrl}${name}.bcmap`; + const response = await fetch(url); + if (!response.ok) { + throw new Error(`fetchBuiltInCMap: failed to fetch file "${url}" with "${response.statusText}".`); + } + data = { + cMapData: new Uint8Array(await response.arrayBuffer()), + compressionType: CMapCompressionType.BINARY + }; + } else { + data = await this.handler.sendWithPromise("FetchBuiltInCMap", { + name + }); + } + if (data.compressionType !== CMapCompressionType.NONE) { + this.builtInCMapCache.set(name, data); + } + return data; + } + async fetchStandardFontData(name) { + const cachedData = this.standardFontDataCache.get(name); + if (cachedData) { + return new Stream(cachedData); + } + if (this.options.useSystemFonts && name !== "Symbol" && name !== "ZapfDingbats") { + return null; + } + const standardFontNameToFileName = getFontNameToFileMap(), + filename = standardFontNameToFileName[name]; + let data; + if (this.options.standardFontDataUrl !== null) { + const url = `${this.options.standardFontDataUrl}${filename}`; + const response = await fetch(url); + if (!response.ok) { + warn(`fetchStandardFontData: failed to fetch file "${url}" with "${response.statusText}".`); + } else { + data = new Uint8Array(await response.arrayBuffer()); + } + } else { + try { + data = await this.handler.sendWithPromise("FetchStandardFontData", { + filename + }); + } catch (e) { + warn(`fetchStandardFontData: failed to fetch file "${filename}" with "${e}".`); + } + } + if (!data) { + return null; + } + this.standardFontDataCache.set(name, data); + return new Stream(data); + } + async buildFormXObject(resources, xobj, smask, operatorList, task, initialState, localColorSpaceCache) { + const dict = xobj.dict; + const matrix = dict.getArray("Matrix"); + let bbox = dict.getArray("BBox"); + bbox = Array.isArray(bbox) && bbox.length === 4 ? Util.normalizeRect(bbox) : null; + let optionalContent, groupOptions; + if (dict.has("OC")) { + optionalContent = await this.parseMarkedContentProps(dict.get("OC"), resources); + } + if (optionalContent !== undefined) { + operatorList.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]); + } + const group = dict.get("Group"); + if (group) { + groupOptions = { + matrix, + bbox, + smask, + isolated: false, + knockout: false + }; + const groupSubtype = group.get("S"); + let colorSpace = null; + if (isName(groupSubtype, "Transparency")) { + groupOptions.isolated = group.get("I") || false; + groupOptions.knockout = group.get("K") || false; + if (group.has("CS")) { + const cs = group.getRaw("CS"); + const cachedColorSpace = ColorSpace.getCached(cs, this.xref, localColorSpaceCache); + if (cachedColorSpace) { + colorSpace = cachedColorSpace; + } else { + colorSpace = await this.parseColorSpace({ + cs, + resources, + localColorSpaceCache + }); + } + } + } + if (smask?.backdrop) { + colorSpace ||= ColorSpace.singletons.rgb; + smask.backdrop = colorSpace.getRgb(smask.backdrop, 0); + } + operatorList.addOp(OPS.beginGroup, [groupOptions]); + } + const args = group ? [matrix, null] : [matrix, bbox]; + operatorList.addOp(OPS.paintFormXObjectBegin, args); + return this.getOperatorList({ + stream: xobj, + task, + resources: dict.get("Resources") || resources, + operatorList, + initialState + }).then(function () { + operatorList.addOp(OPS.paintFormXObjectEnd, []); + if (group) { + operatorList.addOp(OPS.endGroup, [groupOptions]); + } + if (optionalContent !== undefined) { + operatorList.addOp(OPS.endMarkedContent, []); + } + }); + } + _sendImgData(objId, imgData, cacheGlobally = false) { + const transfers = imgData ? [imgData.bitmap || imgData.data.buffer] : null; + if (this.parsingType3Font || cacheGlobally) { + return this.handler.send("commonobj", [objId, "Image", imgData], transfers); + } + return this.handler.send("obj", [objId, this.pageIndex, "Image", imgData], transfers); + } + async buildPaintImageXObject({ + resources, + image, + isInline = false, + operatorList, + cacheKey, + localImageCache, + localColorSpaceCache + }) { + const dict = image.dict; + const imageRef = dict.objId; + const w = dict.get("W", "Width"); + const h = dict.get("H", "Height"); + if (!(w && typeof w === "number") || !(h && typeof h === "number")) { + warn("Image dimensions are missing, or not numbers."); + return; + } + const maxImageSize = this.options.maxImageSize; + if (maxImageSize !== -1 && w * h > maxImageSize) { + const msg = "Image exceeded maximum allowed size and was removed."; + if (this.options.ignoreErrors) { + warn(msg); + return; + } + throw new Error(msg); + } + let optionalContent; + if (dict.has("OC")) { + optionalContent = await this.parseMarkedContentProps(dict.get("OC"), resources); + } + const imageMask = dict.get("IM", "ImageMask") || false; + let imgData, args; + if (imageMask) { + const interpolate = dict.get("I", "Interpolate"); + const bitStrideLength = w + 7 >> 3; + const imgArray = image.getBytes(bitStrideLength * h); + const decode = dict.getArray("D", "Decode"); + if (this.parsingType3Font) { + imgData = PDFImage.createRawMask({ + imgArray, + width: w, + height: h, + imageIsFromDecodeStream: image instanceof DecodeStream, + inverseDecode: decode?.[0] > 0, + interpolate + }); + imgData.cached = !!cacheKey; + args = [imgData]; + operatorList.addImageOps(OPS.paintImageMaskXObject, args, optionalContent); + if (cacheKey) { + const cacheData = { + fn: OPS.paintImageMaskXObject, + args, + optionalContent + }; + localImageCache.set(cacheKey, imageRef, cacheData); + if (imageRef) { + this._regionalImageCache.set(null, imageRef, cacheData); + } + } + return; + } + imgData = await PDFImage.createMask({ + imgArray, + width: w, + height: h, + imageIsFromDecodeStream: image instanceof DecodeStream, + inverseDecode: decode?.[0] > 0, + interpolate, + isOffscreenCanvasSupported: this.options.isOffscreenCanvasSupported + }); + if (imgData.isSingleOpaquePixel) { + operatorList.addImageOps(OPS.paintSolidColorImageMask, [], optionalContent); + if (cacheKey) { + const cacheData = { + fn: OPS.paintSolidColorImageMask, + args: [], + optionalContent + }; + localImageCache.set(cacheKey, imageRef, cacheData); + if (imageRef) { + this._regionalImageCache.set(null, imageRef, cacheData); + } + } + return; + } + const objId = `mask_${this.idFactory.createObjId()}`; + operatorList.addDependency(objId); + imgData.dataLen = imgData.bitmap ? imgData.width * imgData.height * 4 : imgData.data.length; + this._sendImgData(objId, imgData); + args = [{ + data: objId, + width: imgData.width, + height: imgData.height, + interpolate: imgData.interpolate, + count: 1 + }]; + operatorList.addImageOps(OPS.paintImageMaskXObject, args, optionalContent); + if (cacheKey) { + const cacheData = { + fn: OPS.paintImageMaskXObject, + args, + optionalContent + }; + localImageCache.set(cacheKey, imageRef, cacheData); + if (imageRef) { + this._regionalImageCache.set(null, imageRef, cacheData); + } + } + return; + } + const SMALL_IMAGE_DIMENSIONS = 200; + if (isInline && !dict.has("SMask") && !dict.has("Mask") && w + h < SMALL_IMAGE_DIMENSIONS) { + const imageObj = new PDFImage({ + xref: this.xref, + res: resources, + image, + isInline, + pdfFunctionFactory: this._pdfFunctionFactory, + localColorSpaceCache + }); + imgData = await imageObj.createImageData(true, false); + operatorList.isOffscreenCanvasSupported = this.options.isOffscreenCanvasSupported; + operatorList.addImageOps(OPS.paintInlineImageXObject, [imgData], optionalContent); + return; + } + let objId = `img_${this.idFactory.createObjId()}`, + cacheGlobally = false; + if (this.parsingType3Font) { + objId = `${this.idFactory.getDocId()}_type3_${objId}`; + } else if (cacheKey && imageRef) { + cacheGlobally = this.globalImageCache.shouldCache(imageRef, this.pageIndex); + if (cacheGlobally) { + assert(!isInline, "Cannot cache an inline image globally."); + objId = `${this.idFactory.getDocId()}_${objId}`; + } + } + operatorList.addDependency(objId); + args = [objId, w, h]; + operatorList.addImageOps(OPS.paintImageXObject, args, optionalContent); + if (cacheGlobally && w * h > 250000) { + const localLength = await this.handler.sendWithPromise("commonobj", [objId, "CopyLocalImage", { + imageRef + }]); + if (localLength) { + this.globalImageCache.setData(imageRef, { + objId, + fn: OPS.paintImageXObject, + args, + optionalContent, + byteSize: 0 + }); + this.globalImageCache.addByteSize(imageRef, localLength); + return; + } + } + PDFImage.buildImage({ + xref: this.xref, + res: resources, + image, + isInline, + pdfFunctionFactory: this._pdfFunctionFactory, + localColorSpaceCache + }).then(async imageObj => { + imgData = await imageObj.createImageData(false, this.options.isOffscreenCanvasSupported); + imgData.dataLen = imgData.bitmap ? imgData.width * imgData.height * 4 : imgData.data.length; + imgData.ref = imageRef; + if (cacheGlobally) { + this.globalImageCache.addByteSize(imageRef, imgData.dataLen); + } + return this._sendImgData(objId, imgData, cacheGlobally); + }).catch(reason => { + warn(`Unable to decode image "${objId}": "${reason}".`); + return this._sendImgData(objId, null, cacheGlobally); + }); + if (cacheKey) { + const cacheData = { + fn: OPS.paintImageXObject, + args, + optionalContent + }; + localImageCache.set(cacheKey, imageRef, cacheData); + if (imageRef) { + this._regionalImageCache.set(null, imageRef, cacheData); + if (cacheGlobally) { + this.globalImageCache.setData(imageRef, { + objId, + fn: OPS.paintImageXObject, + args, + optionalContent, + byteSize: 0 + }); + } + } + } + } + handleSMask(smask, resources, operatorList, task, stateManager, localColorSpaceCache) { + const smaskContent = smask.get("G"); + const smaskOptions = { + subtype: smask.get("S").name, + backdrop: smask.get("BC") + }; + const transferObj = smask.get("TR"); + if (isPDFFunction(transferObj)) { + const transferFn = this._pdfFunctionFactory.create(transferObj); + const transferMap = new Uint8Array(256); + const tmp = new Float32Array(1); + for (let i = 0; i < 256; i++) { + tmp[0] = i / 255; + transferFn(tmp, 0, tmp, 0); + transferMap[i] = tmp[0] * 255 | 0; + } + smaskOptions.transferMap = transferMap; + } + return this.buildFormXObject(resources, smaskContent, smaskOptions, operatorList, task, stateManager.state.clone(), localColorSpaceCache); + } + handleTransferFunction(tr) { + let transferArray; + if (Array.isArray(tr)) { + transferArray = tr; + } else if (isPDFFunction(tr)) { + transferArray = [tr]; + } else { + return null; + } + const transferMaps = []; + let numFns = 0, + numEffectfulFns = 0; + for (const entry of transferArray) { + const transferObj = this.xref.fetchIfRef(entry); + numFns++; + if (isName(transferObj, "Identity")) { + transferMaps.push(null); + continue; + } else if (!isPDFFunction(transferObj)) { + return null; + } + const transferFn = this._pdfFunctionFactory.create(transferObj); + const transferMap = new Uint8Array(256), + tmp = new Float32Array(1); + for (let j = 0; j < 256; j++) { + tmp[0] = j / 255; + transferFn(tmp, 0, tmp, 0); + transferMap[j] = tmp[0] * 255 | 0; + } + transferMaps.push(transferMap); + numEffectfulFns++; + } + if (!(numFns === 1 || numFns === 4)) { + return null; + } + if (numEffectfulFns === 0) { + return null; + } + return transferMaps; + } + handleTilingType(fn, color, resources, pattern, patternDict, operatorList, task, localTilingPatternCache) { + const tilingOpList = new OperatorList(); + const patternResources = Dict.merge({ + xref: this.xref, + dictArray: [patternDict.get("Resources"), resources] + }); + return this.getOperatorList({ + stream: pattern, + task, + resources: patternResources, + operatorList: tilingOpList + }).then(function () { + const operatorListIR = tilingOpList.getIR(); + const tilingPatternIR = getTilingPatternIR(operatorListIR, patternDict, color); + operatorList.addDependencies(tilingOpList.dependencies); + operatorList.addOp(fn, tilingPatternIR); + if (patternDict.objId) { + localTilingPatternCache.set(null, patternDict.objId, { + operatorListIR, + dict: patternDict + }); + } + }).catch(reason => { + if (reason instanceof AbortException) { + return; + } + if (this.options.ignoreErrors) { + warn(`handleTilingType - ignoring pattern: "${reason}".`); + return; + } + throw reason; + }); + } + handleSetFont(resources, fontArgs, fontRef, operatorList, task, state, fallbackFontDict = null, cssFontInfo = null) { + const fontName = fontArgs?.[0] instanceof Name ? fontArgs[0].name : null; + return this.loadFont(fontName, fontRef, resources, fallbackFontDict, cssFontInfo).then(translated => { + if (!translated.font.isType3Font) { + return translated; + } + return translated.loadType3Data(this, resources, task).then(function () { + operatorList.addDependencies(translated.type3Dependencies); + return translated; + }).catch(reason => { + return new TranslatedFont({ + loadedName: "g_font_error", + font: new ErrorFont(`Type3 font load error: ${reason}`), + dict: translated.font, + evaluatorOptions: this.options + }); + }); + }).then(translated => { + state.font = translated.font; + translated.send(this.handler); + return translated.loadedName; + }); + } + handleText(chars, state) { + const font = state.font; + const glyphs = font.charsToGlyphs(chars); + if (font.data) { + const isAddToPathSet = !!(state.textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG); + if (isAddToPathSet || state.fillColorSpace.name === "Pattern" || font.disableFontFace || this.options.disableFontFace) { + PartialEvaluator.buildFontPaths(font, glyphs, this.handler, this.options); + } + } + return glyphs; + } + ensureStateFont(state) { + if (state.font) { + return; + } + const reason = new FormatError("Missing setFont (Tf) operator before text rendering operator."); + if (this.options.ignoreErrors) { + warn(`ensureStateFont: "${reason}".`); + return; + } + throw reason; + } + async setGState({ + resources, + gState, + operatorList, + cacheKey, + task, + stateManager, + localGStateCache, + localColorSpaceCache + }) { + const gStateRef = gState.objId; + let isSimpleGState = true; + const gStateObj = []; + let promise = Promise.resolve(); + for (const key of gState.getKeys()) { + const value = gState.get(key); + switch (key) { + case "Type": + break; + case "LW": + case "LC": + case "LJ": + case "ML": + case "D": + case "RI": + case "FL": + case "CA": + case "ca": + gStateObj.push([key, value]); + break; + case "Font": + isSimpleGState = false; + promise = promise.then(() => { + return this.handleSetFont(resources, null, value[0], operatorList, task, stateManager.state).then(function (loadedName) { + operatorList.addDependency(loadedName); + gStateObj.push([key, [loadedName, value[1]]]); + }); + }); + break; + case "BM": + gStateObj.push([key, normalizeBlendMode(value)]); + break; + case "SMask": + if (isName(value, "None")) { + gStateObj.push([key, false]); + break; + } + if (value instanceof Dict) { + isSimpleGState = false; + promise = promise.then(() => { + return this.handleSMask(value, resources, operatorList, task, stateManager, localColorSpaceCache); + }); + gStateObj.push([key, true]); + } else { + warn("Unsupported SMask type"); + } + break; + case "TR": + const transferMaps = this.handleTransferFunction(value); + gStateObj.push([key, transferMaps]); + break; + case "OP": + case "op": + case "OPM": + case "BG": + case "BG2": + case "UCR": + case "UCR2": + case "TR2": + case "HT": + case "SM": + case "SA": + case "AIS": + case "TK": + info("graphic state operator " + key); + break; + default: + info("Unknown graphic state operator " + key); + break; + } + } + return promise.then(function () { + if (gStateObj.length > 0) { + operatorList.addOp(OPS.setGState, [gStateObj]); + } + if (isSimpleGState) { + localGStateCache.set(cacheKey, gStateRef, gStateObj); + } + }); + } + loadFont(fontName, font, resources, fallbackFontDict = null, cssFontInfo = null) { + const errorFont = async () => { + return new TranslatedFont({ + loadedName: "g_font_error", + font: new ErrorFont(`Font "${fontName}" is not available.`), + dict: font, + evaluatorOptions: this.options + }); + }; + let fontRef; + if (font) { + if (font instanceof Ref) { + fontRef = font; + } + } else { + const fontRes = resources.get("Font"); + if (fontRes) { + fontRef = fontRes.getRaw(fontName); + } + } + if (fontRef) { + if (this.parsingType3Font && this.type3FontRefs.has(fontRef)) { + return errorFont(); + } + if (this.fontCache.has(fontRef)) { + return this.fontCache.get(fontRef); + } + font = this.xref.fetchIfRef(fontRef); + } + if (!(font instanceof Dict)) { + if (!this.options.ignoreErrors && !this.parsingType3Font) { + warn(`Font "${fontName}" is not available.`); + return errorFont(); + } + warn(`Font "${fontName}" is not available -- attempting to fallback to a default font.`); + font = fallbackFontDict || PartialEvaluator.fallbackFontDict; + } + if (font.cacheKey && this.fontCache.has(font.cacheKey)) { + return this.fontCache.get(font.cacheKey); + } + const fontCapability = new PromiseCapability(); + let preEvaluatedFont; + try { + preEvaluatedFont = this.preEvaluateFont(font); + preEvaluatedFont.cssFontInfo = cssFontInfo; + } catch (reason) { + warn(`loadFont - preEvaluateFont failed: "${reason}".`); + return errorFont(); + } + const { + descriptor, + hash + } = preEvaluatedFont; + const fontRefIsRef = fontRef instanceof Ref; + let fontID; + if (hash && descriptor instanceof Dict) { + const fontAliases = descriptor.fontAliases ||= Object.create(null); + if (fontAliases[hash]) { + const aliasFontRef = fontAliases[hash].aliasRef; + if (fontRefIsRef && aliasFontRef && this.fontCache.has(aliasFontRef)) { + this.fontCache.putAlias(fontRef, aliasFontRef); + return this.fontCache.get(fontRef); + } + } else { + fontAliases[hash] = { + fontID: this.idFactory.createFontId() + }; + } + if (fontRefIsRef) { + fontAliases[hash].aliasRef = fontRef; + } + fontID = fontAliases[hash].fontID; + } else { + fontID = this.idFactory.createFontId(); + } + assert(fontID?.startsWith("f"), 'The "fontID" must be (correctly) defined.'); + if (fontRefIsRef) { + this.fontCache.put(fontRef, fontCapability.promise); + } else { + font.cacheKey = `cacheKey_${fontID}`; + this.fontCache.put(font.cacheKey, fontCapability.promise); + } + font.loadedName = `${this.idFactory.getDocId()}_${fontID}`; + this.translateFont(preEvaluatedFont).then(translatedFont => { + fontCapability.resolve(new TranslatedFont({ + loadedName: font.loadedName, + font: translatedFont, + dict: font, + evaluatorOptions: this.options + })); + }).catch(reason => { + warn(`loadFont - translateFont failed: "${reason}".`); + fontCapability.resolve(new TranslatedFont({ + loadedName: font.loadedName, + font: new ErrorFont(reason instanceof Error ? reason.message : reason), + dict: font, + evaluatorOptions: this.options + })); + }); + return fontCapability.promise; + } + buildPath(operatorList, fn, args, parsingText = false) { + const lastIndex = operatorList.length - 1; + if (!args) { + args = []; + } + if (lastIndex < 0 || operatorList.fnArray[lastIndex] !== OPS.constructPath) { + if (parsingText) { + warn(`Encountered path operator "${fn}" inside of a text object.`); + operatorList.addOp(OPS.save, null); + } + let minMax; + switch (fn) { + case OPS.rectangle: + const x = args[0] + args[2]; + const y = args[1] + args[3]; + minMax = [Math.min(args[0], x), Math.max(args[0], x), Math.min(args[1], y), Math.max(args[1], y)]; + break; + case OPS.moveTo: + case OPS.lineTo: + minMax = [args[0], args[0], args[1], args[1]]; + break; + default: + minMax = [Infinity, -Infinity, Infinity, -Infinity]; + break; + } + operatorList.addOp(OPS.constructPath, [[fn], args, minMax]); + if (parsingText) { + operatorList.addOp(OPS.restore, null); + } + } else { + const opArgs = operatorList.argsArray[lastIndex]; + opArgs[0].push(fn); + opArgs[1].push(...args); + const minMax = opArgs[2]; + switch (fn) { + case OPS.rectangle: + const x = args[0] + args[2]; + const y = args[1] + args[3]; + minMax[0] = Math.min(minMax[0], args[0], x); + minMax[1] = Math.max(minMax[1], args[0], x); + minMax[2] = Math.min(minMax[2], args[1], y); + minMax[3] = Math.max(minMax[3], args[1], y); + break; + case OPS.moveTo: + case OPS.lineTo: + minMax[0] = Math.min(minMax[0], args[0]); + minMax[1] = Math.max(minMax[1], args[0]); + minMax[2] = Math.min(minMax[2], args[1]); + minMax[3] = Math.max(minMax[3], args[1]); + break; + } + } + } + parseColorSpace({ + cs, + resources, + localColorSpaceCache + }) { + return ColorSpace.parseAsync({ + cs, + xref: this.xref, + resources, + pdfFunctionFactory: this._pdfFunctionFactory, + localColorSpaceCache + }).catch(reason => { + if (reason instanceof AbortException) { + return null; + } + if (this.options.ignoreErrors) { + warn(`parseColorSpace - ignoring ColorSpace: "${reason}".`); + return null; + } + throw reason; + }); + } + parseShading({ + shading, + resources, + localColorSpaceCache, + localShadingPatternCache + }) { + let id = localShadingPatternCache.get(shading); + if (!id) { + var shadingFill = Pattern.parseShading(shading, this.xref, resources, this._pdfFunctionFactory, localColorSpaceCache); + const patternIR = shadingFill.getIR(); + id = `pattern_${this.idFactory.createObjId()}`; + if (this.parsingType3Font) { + id = `${this.idFactory.getDocId()}_type3_${id}`; + } + localShadingPatternCache.set(shading, id); + if (this.parsingType3Font) { + this.handler.send("commonobj", [id, "Pattern", patternIR]); + } else { + this.handler.send("obj", [id, this.pageIndex, "Pattern", patternIR]); + } + } + return id; + } + handleColorN(operatorList, fn, args, cs, patterns, resources, task, localColorSpaceCache, localTilingPatternCache, localShadingPatternCache) { + const patternName = args.pop(); + if (patternName instanceof Name) { + const rawPattern = patterns.getRaw(patternName.name); + const localTilingPattern = rawPattern instanceof Ref && localTilingPatternCache.getByRef(rawPattern); + if (localTilingPattern) { + try { + const color = cs.base ? cs.base.getRgb(args, 0) : null; + const tilingPatternIR = getTilingPatternIR(localTilingPattern.operatorListIR, localTilingPattern.dict, color); + operatorList.addOp(fn, tilingPatternIR); + return undefined; + } catch {} + } + const pattern = this.xref.fetchIfRef(rawPattern); + if (pattern) { + const dict = pattern instanceof BaseStream ? pattern.dict : pattern; + const typeNum = dict.get("PatternType"); + if (typeNum === PatternType.TILING) { + const color = cs.base ? cs.base.getRgb(args, 0) : null; + return this.handleTilingType(fn, color, resources, pattern, dict, operatorList, task, localTilingPatternCache); + } else if (typeNum === PatternType.SHADING) { + const shading = dict.get("Shading"); + const matrix = dict.getArray("Matrix"); + const objId = this.parseShading({ + shading, + resources, + localColorSpaceCache, + localShadingPatternCache + }); + operatorList.addOp(fn, ["Shading", objId, matrix]); + return undefined; + } + throw new FormatError(`Unknown PatternType: ${typeNum}`); + } + } + throw new FormatError(`Unknown PatternName: ${patternName}`); + } + _parseVisibilityExpression(array, nestingCounter, currentResult) { + const MAX_NESTING = 10; + if (++nestingCounter > MAX_NESTING) { + warn("Visibility expression is too deeply nested"); + return; + } + const length = array.length; + const operator = this.xref.fetchIfRef(array[0]); + if (length < 2 || !(operator instanceof Name)) { + warn("Invalid visibility expression"); + return; + } + switch (operator.name) { + case "And": + case "Or": + case "Not": + currentResult.push(operator.name); + break; + default: + warn(`Invalid operator ${operator.name} in visibility expression`); + return; + } + for (let i = 1; i < length; i++) { + const raw = array[i]; + const object = this.xref.fetchIfRef(raw); + if (Array.isArray(object)) { + const nestedResult = []; + currentResult.push(nestedResult); + this._parseVisibilityExpression(object, nestingCounter, nestedResult); + } else if (raw instanceof Ref) { + currentResult.push(raw.toString()); + } + } + } + async parseMarkedContentProps(contentProperties, resources) { + let optionalContent; + if (contentProperties instanceof Name) { + const properties = resources.get("Properties"); + optionalContent = properties.get(contentProperties.name); + } else if (contentProperties instanceof Dict) { + optionalContent = contentProperties; + } else { + throw new FormatError("Optional content properties malformed."); + } + const optionalContentType = optionalContent.get("Type")?.name; + if (optionalContentType === "OCG") { + return { + type: optionalContentType, + id: optionalContent.objId + }; + } else if (optionalContentType === "OCMD") { + const expression = optionalContent.get("VE"); + if (Array.isArray(expression)) { + const result = []; + this._parseVisibilityExpression(expression, 0, result); + if (result.length > 0) { + return { + type: "OCMD", + expression: result + }; + } + } + const optionalContentGroups = optionalContent.get("OCGs"); + if (Array.isArray(optionalContentGroups) || optionalContentGroups instanceof Dict) { + const groupIds = []; + if (Array.isArray(optionalContentGroups)) { + for (const ocg of optionalContentGroups) { + groupIds.push(ocg.toString()); + } + } else { + groupIds.push(optionalContentGroups.objId); + } + return { + type: optionalContentType, + ids: groupIds, + policy: optionalContent.get("P") instanceof Name ? optionalContent.get("P").name : null, + expression: null + }; + } else if (optionalContentGroups instanceof Ref) { + return { + type: optionalContentType, + id: optionalContentGroups.toString() + }; + } + } + return null; + } + getOperatorList({ + stream, + task, + resources, + operatorList, + initialState = null, + fallbackFontDict = null + }) { + resources ||= Dict.empty; + initialState ||= new EvalState(); + if (!operatorList) { + throw new Error('getOperatorList: missing "operatorList" parameter'); + } + const self = this; + const xref = this.xref; + let parsingText = false; + const localImageCache = new LocalImageCache(); + const localColorSpaceCache = new LocalColorSpaceCache(); + const localGStateCache = new LocalGStateCache(); + const localTilingPatternCache = new LocalTilingPatternCache(); + const localShadingPatternCache = new Map(); + const xobjs = resources.get("XObject") || Dict.empty; + const patterns = resources.get("Pattern") || Dict.empty; + const stateManager = new StateManager(initialState); + const preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); + const timeSlotManager = new TimeSlotManager(); + function closePendingRestoreOPS(argument) { + for (let i = 0, ii = preprocessor.savedStatesDepth; i < ii; i++) { + operatorList.addOp(OPS.restore, []); + } + } + return new Promise(function promiseBody(resolve, reject) { + const next = function (promise) { + Promise.all([promise, operatorList.ready]).then(function () { + try { + promiseBody(resolve, reject); + } catch (ex) { + reject(ex); + } + }, reject); + }; + task.ensureNotTerminated(); + timeSlotManager.reset(); + const operation = {}; + let stop, i, ii, cs, name, isValidName; + while (!(stop = timeSlotManager.check())) { + operation.args = null; + if (!preprocessor.read(operation)) { + break; + } + let args = operation.args; + let fn = operation.fn; + switch (fn | 0) { + case OPS.paintXObject: + isValidName = args[0] instanceof Name; + name = args[0].name; + if (isValidName) { + const localImage = localImageCache.getByName(name); + if (localImage) { + operatorList.addImageOps(localImage.fn, localImage.args, localImage.optionalContent); + incrementCachedImageMaskCount(localImage); + args = null; + continue; + } + } + next(new Promise(function (resolveXObject, rejectXObject) { + if (!isValidName) { + throw new FormatError("XObject must be referred to by name."); + } + let xobj = xobjs.getRaw(name); + if (xobj instanceof Ref) { + const localImage = localImageCache.getByRef(xobj) || self._regionalImageCache.getByRef(xobj); + if (localImage) { + operatorList.addImageOps(localImage.fn, localImage.args, localImage.optionalContent); + incrementCachedImageMaskCount(localImage); + resolveXObject(); + return; + } + const globalImage = self.globalImageCache.getData(xobj, self.pageIndex); + if (globalImage) { + operatorList.addDependency(globalImage.objId); + operatorList.addImageOps(globalImage.fn, globalImage.args, globalImage.optionalContent); + resolveXObject(); + return; + } + xobj = xref.fetch(xobj); + } + if (!(xobj instanceof BaseStream)) { + throw new FormatError("XObject should be a stream"); + } + const type = xobj.dict.get("Subtype"); + if (!(type instanceof Name)) { + throw new FormatError("XObject should have a Name subtype"); + } + if (type.name === "Form") { + stateManager.save(); + self.buildFormXObject(resources, xobj, null, operatorList, task, stateManager.state.clone(), localColorSpaceCache).then(function () { + stateManager.restore(); + resolveXObject(); + }, rejectXObject); + return; + } else if (type.name === "Image") { + self.buildPaintImageXObject({ + resources, + image: xobj, + operatorList, + cacheKey: name, + localImageCache, + localColorSpaceCache + }).then(resolveXObject, rejectXObject); + return; + } else if (type.name === "PS") { + info("Ignored XObject subtype PS"); + } else { + throw new FormatError(`Unhandled XObject subtype ${type.name}`); + } + resolveXObject(); + }).catch(function (reason) { + if (reason instanceof AbortException) { + return; + } + if (self.options.ignoreErrors) { + warn(`getOperatorList - ignoring XObject: "${reason}".`); + return; + } + throw reason; + })); + return; + case OPS.setFont: + var fontSize = args[1]; + next(self.handleSetFont(resources, args, null, operatorList, task, stateManager.state, fallbackFontDict).then(function (loadedName) { + operatorList.addDependency(loadedName); + operatorList.addOp(OPS.setFont, [loadedName, fontSize]); + })); + return; + case OPS.beginText: + parsingText = true; + break; + case OPS.endText: + parsingText = false; + break; + case OPS.endInlineImage: + var cacheKey = args[0].cacheKey; + if (cacheKey) { + const localImage = localImageCache.getByName(cacheKey); + if (localImage) { + operatorList.addImageOps(localImage.fn, localImage.args, localImage.optionalContent); + incrementCachedImageMaskCount(localImage); + args = null; + continue; + } + } + next(self.buildPaintImageXObject({ + resources, + image: args[0], + isInline: true, + operatorList, + cacheKey, + localImageCache, + localColorSpaceCache + })); + return; + case OPS.showText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + args[0] = self.handleText(args[0], stateManager.state); + break; + case OPS.showSpacedText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + var combinedGlyphs = []; + var state = stateManager.state; + for (const arrItem of args[0]) { + if (typeof arrItem === "string") { + combinedGlyphs.push(...self.handleText(arrItem, state)); + } else if (typeof arrItem === "number") { + combinedGlyphs.push(arrItem); + } + } + args[0] = combinedGlyphs; + fn = OPS.showText; + break; + case OPS.nextLineShowText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + operatorList.addOp(OPS.nextLine); + args[0] = self.handleText(args[0], stateManager.state); + fn = OPS.showText; + break; + case OPS.nextLineSetSpacingShowText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + operatorList.addOp(OPS.nextLine); + operatorList.addOp(OPS.setWordSpacing, [args.shift()]); + operatorList.addOp(OPS.setCharSpacing, [args.shift()]); + args[0] = self.handleText(args[0], stateManager.state); + fn = OPS.showText; + break; + case OPS.setTextRenderingMode: + stateManager.state.textRenderingMode = args[0]; + break; + case OPS.setFillColorSpace: + { + const cachedColorSpace = ColorSpace.getCached(args[0], xref, localColorSpaceCache); + if (cachedColorSpace) { + stateManager.state.fillColorSpace = cachedColorSpace; + continue; + } + next(self.parseColorSpace({ + cs: args[0], + resources, + localColorSpaceCache + }).then(function (colorSpace) { + if (colorSpace) { + stateManager.state.fillColorSpace = colorSpace; + } + })); + return; + } + case OPS.setStrokeColorSpace: + { + const cachedColorSpace = ColorSpace.getCached(args[0], xref, localColorSpaceCache); + if (cachedColorSpace) { + stateManager.state.strokeColorSpace = cachedColorSpace; + continue; + } + next(self.parseColorSpace({ + cs: args[0], + resources, + localColorSpaceCache + }).then(function (colorSpace) { + if (colorSpace) { + stateManager.state.strokeColorSpace = colorSpace; + } + })); + return; + } + case OPS.setFillColor: + cs = stateManager.state.fillColorSpace; + args = cs.getRgb(args, 0); + fn = OPS.setFillRGBColor; + break; + case OPS.setStrokeColor: + cs = stateManager.state.strokeColorSpace; + args = cs.getRgb(args, 0); + fn = OPS.setStrokeRGBColor; + break; + case OPS.setFillGray: + stateManager.state.fillColorSpace = ColorSpace.singletons.gray; + args = ColorSpace.singletons.gray.getRgb(args, 0); + fn = OPS.setFillRGBColor; + break; + case OPS.setStrokeGray: + stateManager.state.strokeColorSpace = ColorSpace.singletons.gray; + args = ColorSpace.singletons.gray.getRgb(args, 0); + fn = OPS.setStrokeRGBColor; + break; + case OPS.setFillCMYKColor: + stateManager.state.fillColorSpace = ColorSpace.singletons.cmyk; + args = ColorSpace.singletons.cmyk.getRgb(args, 0); + fn = OPS.setFillRGBColor; + break; + case OPS.setStrokeCMYKColor: + stateManager.state.strokeColorSpace = ColorSpace.singletons.cmyk; + args = ColorSpace.singletons.cmyk.getRgb(args, 0); + fn = OPS.setStrokeRGBColor; + break; + case OPS.setFillRGBColor: + stateManager.state.fillColorSpace = ColorSpace.singletons.rgb; + args = ColorSpace.singletons.rgb.getRgb(args, 0); + break; + case OPS.setStrokeRGBColor: + stateManager.state.strokeColorSpace = ColorSpace.singletons.rgb; + args = ColorSpace.singletons.rgb.getRgb(args, 0); + break; + case OPS.setFillColorN: + cs = stateManager.state.fillColorSpace; + if (cs.name === "Pattern") { + next(self.handleColorN(operatorList, OPS.setFillColorN, args, cs, patterns, resources, task, localColorSpaceCache, localTilingPatternCache, localShadingPatternCache)); + return; + } + args = cs.getRgb(args, 0); + fn = OPS.setFillRGBColor; + break; + case OPS.setStrokeColorN: + cs = stateManager.state.strokeColorSpace; + if (cs.name === "Pattern") { + next(self.handleColorN(operatorList, OPS.setStrokeColorN, args, cs, patterns, resources, task, localColorSpaceCache, localTilingPatternCache, localShadingPatternCache)); + return; + } + args = cs.getRgb(args, 0); + fn = OPS.setStrokeRGBColor; + break; + case OPS.shadingFill: + var shadingRes = resources.get("Shading"); + if (!shadingRes) { + throw new FormatError("No shading resource found"); + } + var shading = shadingRes.get(args[0].name); + if (!shading) { + throw new FormatError("No shading object found"); + } + const patternId = self.parseShading({ + shading, + resources, + localColorSpaceCache, + localShadingPatternCache + }); + args = [patternId]; + fn = OPS.shadingFill; + break; + case OPS.setGState: + isValidName = args[0] instanceof Name; + name = args[0].name; + if (isValidName) { + const localGStateObj = localGStateCache.getByName(name); + if (localGStateObj) { + if (localGStateObj.length > 0) { + operatorList.addOp(OPS.setGState, [localGStateObj]); + } + args = null; + continue; + } + } + next(new Promise(function (resolveGState, rejectGState) { + if (!isValidName) { + throw new FormatError("GState must be referred to by name."); + } + const extGState = resources.get("ExtGState"); + if (!(extGState instanceof Dict)) { + throw new FormatError("ExtGState should be a dictionary."); + } + const gState = extGState.get(name); + if (!(gState instanceof Dict)) { + throw new FormatError("GState should be a dictionary."); + } + self.setGState({ + resources, + gState, + operatorList, + cacheKey: name, + task, + stateManager, + localGStateCache, + localColorSpaceCache + }).then(resolveGState, rejectGState); + }).catch(function (reason) { + if (reason instanceof AbortException) { + return; + } + if (self.options.ignoreErrors) { + warn(`getOperatorList - ignoring ExtGState: "${reason}".`); + return; + } + throw reason; + })); + return; + case OPS.moveTo: + case OPS.lineTo: + case OPS.curveTo: + case OPS.curveTo2: + case OPS.curveTo3: + case OPS.closePath: + case OPS.rectangle: + self.buildPath(operatorList, fn, args, parsingText); + continue; + case OPS.markPoint: + case OPS.markPointProps: + case OPS.beginCompat: + case OPS.endCompat: + continue; + case OPS.beginMarkedContentProps: + if (!(args[0] instanceof Name)) { + warn(`Expected name for beginMarkedContentProps arg0=${args[0]}`); + continue; + } + if (args[0].name === "OC") { + next(self.parseMarkedContentProps(args[1], resources).then(data => { + operatorList.addOp(OPS.beginMarkedContentProps, ["OC", data]); + }).catch(reason => { + if (reason instanceof AbortException) { + return; + } + if (self.options.ignoreErrors) { + warn(`getOperatorList - ignoring beginMarkedContentProps: "${reason}".`); + return; + } + throw reason; + })); + return; + } + args = [args[0].name, args[1] instanceof Dict ? args[1].get("MCID") : null]; + break; + case OPS.beginMarkedContent: + case OPS.endMarkedContent: + default: + if (args !== null) { + for (i = 0, ii = args.length; i < ii; i++) { + if (args[i] instanceof Dict) { + break; + } + } + if (i < ii) { + warn("getOperatorList - ignoring operator: " + fn); + continue; + } + } + } + operatorList.addOp(fn, args); + } + if (stop) { + next(deferred); + return; + } + closePendingRestoreOPS(); + resolve(); + }).catch(reason => { + if (reason instanceof AbortException) { + return; + } + if (this.options.ignoreErrors) { + warn(`getOperatorList - ignoring errors during "${task.name}" ` + `task: "${reason}".`); + closePendingRestoreOPS(); + return; + } + throw reason; + }); + } + getTextContent({ + stream, + task, + resources, + stateManager = null, + includeMarkedContent = false, + sink, + seenStyles = new Set(), + viewBox, + markedContentData = null, + disableNormalization = false + }) { + resources ||= Dict.empty; + stateManager ||= new StateManager(new TextState()); + if (includeMarkedContent) { + markedContentData ||= { + level: 0 + }; + } + const textContent = { + items: [], + styles: Object.create(null) + }; + const textContentItem = { + initialized: false, + str: [], + totalWidth: 0, + totalHeight: 0, + width: 0, + height: 0, + vertical: false, + prevTransform: null, + textAdvanceScale: 0, + spaceInFlowMin: 0, + spaceInFlowMax: 0, + trackingSpaceMin: Infinity, + negativeSpaceMax: -Infinity, + notASpace: -Infinity, + transform: null, + fontName: null, + hasEOL: false + }; + const twoLastChars = [" ", " "]; + let twoLastCharsPos = 0; + function saveLastChar(char) { + const nextPos = (twoLastCharsPos + 1) % 2; + const ret = twoLastChars[twoLastCharsPos] !== " " && twoLastChars[nextPos] === " "; + twoLastChars[twoLastCharsPos] = char; + twoLastCharsPos = nextPos; + return ret; + } + function shouldAddWhitepsace() { + return twoLastChars[twoLastCharsPos] !== " " && twoLastChars[(twoLastCharsPos + 1) % 2] === " "; + } + function resetLastChars() { + twoLastChars[0] = twoLastChars[1] = " "; + twoLastCharsPos = 0; + } + const TRACKING_SPACE_FACTOR = 0.102; + const NOT_A_SPACE_FACTOR = 0.03; + const NEGATIVE_SPACE_FACTOR = -0.2; + const SPACE_IN_FLOW_MIN_FACTOR = 0.102; + const SPACE_IN_FLOW_MAX_FACTOR = 0.6; + const VERTICAL_SHIFT_RATIO = 0.25; + const self = this; + const xref = this.xref; + const showSpacedTextBuffer = []; + let xobjs = null; + const emptyXObjectCache = new LocalImageCache(); + const emptyGStateCache = new LocalGStateCache(); + const preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager); + let textState; + function pushWhitespace({ + width = 0, + height = 0, + transform = textContentItem.prevTransform, + fontName = textContentItem.fontName + }) { + textContent.items.push({ + str: " ", + dir: "ltr", + width, + height, + transform, + fontName, + hasEOL: false + }); + } + function getCurrentTextTransform() { + const font = textState.font; + const tsm = [textState.fontSize * textState.textHScale, 0, 0, textState.fontSize, 0, textState.textRise]; + if (font.isType3Font && (textState.fontSize <= 1 || font.isCharBBox) && !isArrayEqual(textState.fontMatrix, FONT_IDENTITY_MATRIX)) { + const glyphHeight = font.bbox[3] - font.bbox[1]; + if (glyphHeight > 0) { + tsm[3] *= glyphHeight * textState.fontMatrix[3]; + } + } + return Util.transform(textState.ctm, Util.transform(textState.textMatrix, tsm)); + } + function ensureTextContentItem() { + if (textContentItem.initialized) { + return textContentItem; + } + const { + font, + loadedName + } = textState; + if (!seenStyles.has(loadedName)) { + seenStyles.add(loadedName); + textContent.styles[loadedName] = { + fontFamily: font.fallbackName, + ascent: font.ascent, + descent: font.descent, + vertical: font.vertical + }; + if (self.options.fontExtraProperties && font.systemFontInfo) { + const style = textContent.styles[loadedName]; + style.fontSubstitution = font.systemFontInfo.css; + style.fontSubstitutionLoadedName = font.systemFontInfo.loadedName; + } + } + textContentItem.fontName = loadedName; + const trm = textContentItem.transform = getCurrentTextTransform(); + if (!font.vertical) { + textContentItem.width = textContentItem.totalWidth = 0; + textContentItem.height = textContentItem.totalHeight = Math.hypot(trm[2], trm[3]); + textContentItem.vertical = false; + } else { + textContentItem.width = textContentItem.totalWidth = Math.hypot(trm[0], trm[1]); + textContentItem.height = textContentItem.totalHeight = 0; + textContentItem.vertical = true; + } + const scaleLineX = Math.hypot(textState.textLineMatrix[0], textState.textLineMatrix[1]); + const scaleCtmX = Math.hypot(textState.ctm[0], textState.ctm[1]); + textContentItem.textAdvanceScale = scaleCtmX * scaleLineX; + const { + fontSize + } = textState; + textContentItem.trackingSpaceMin = fontSize * TRACKING_SPACE_FACTOR; + textContentItem.notASpace = fontSize * NOT_A_SPACE_FACTOR; + textContentItem.negativeSpaceMax = fontSize * NEGATIVE_SPACE_FACTOR; + textContentItem.spaceInFlowMin = fontSize * SPACE_IN_FLOW_MIN_FACTOR; + textContentItem.spaceInFlowMax = fontSize * SPACE_IN_FLOW_MAX_FACTOR; + textContentItem.hasEOL = false; + textContentItem.initialized = true; + return textContentItem; + } + function updateAdvanceScale() { + if (!textContentItem.initialized) { + return; + } + const scaleLineX = Math.hypot(textState.textLineMatrix[0], textState.textLineMatrix[1]); + const scaleCtmX = Math.hypot(textState.ctm[0], textState.ctm[1]); + const scaleFactor = scaleCtmX * scaleLineX; + if (scaleFactor === textContentItem.textAdvanceScale) { + return; + } + if (!textContentItem.vertical) { + textContentItem.totalWidth += textContentItem.width * textContentItem.textAdvanceScale; + textContentItem.width = 0; + } else { + textContentItem.totalHeight += textContentItem.height * textContentItem.textAdvanceScale; + textContentItem.height = 0; + } + textContentItem.textAdvanceScale = scaleFactor; + } + function runBidiTransform(textChunk) { + let text = textChunk.str.join(""); + if (!disableNormalization) { + text = normalizeUnicode(text); + } + const bidiResult = bidi(text, -1, textChunk.vertical); + return { + str: bidiResult.str, + dir: bidiResult.dir, + width: Math.abs(textChunk.totalWidth), + height: Math.abs(textChunk.totalHeight), + transform: textChunk.transform, + fontName: textChunk.fontName, + hasEOL: textChunk.hasEOL + }; + } + function handleSetFont(fontName, fontRef) { + return self.loadFont(fontName, fontRef, resources).then(function (translated) { + if (!translated.font.isType3Font) { + return translated; + } + return translated.loadType3Data(self, resources, task).catch(function () {}).then(function () { + return translated; + }); + }).then(function (translated) { + textState.loadedName = translated.loadedName; + textState.font = translated.font; + textState.fontMatrix = translated.font.fontMatrix || FONT_IDENTITY_MATRIX; + }); + } + function applyInverseRotation(x, y, matrix) { + const scale = Math.hypot(matrix[0], matrix[1]); + return [(matrix[0] * x + matrix[1] * y) / scale, (matrix[2] * x + matrix[3] * y) / scale]; + } + function compareWithLastPosition(glyphWidth) { + const currentTransform = getCurrentTextTransform(); + let posX = currentTransform[4]; + let posY = currentTransform[5]; + if (textState.font?.vertical) { + if (posX < viewBox[0] || posX > viewBox[2] || posY + glyphWidth < viewBox[1] || posY > viewBox[3]) { + return false; + } + } else if (posX + glyphWidth < viewBox[0] || posX > viewBox[2] || posY < viewBox[1] || posY > viewBox[3]) { + return false; + } + if (!textState.font || !textContentItem.prevTransform) { + return true; + } + let lastPosX = textContentItem.prevTransform[4]; + let lastPosY = textContentItem.prevTransform[5]; + if (lastPosX === posX && lastPosY === posY) { + return true; + } + let rotate = -1; + if (currentTransform[0] && currentTransform[1] === 0 && currentTransform[2] === 0) { + rotate = currentTransform[0] > 0 ? 0 : 180; + } else if (currentTransform[1] && currentTransform[0] === 0 && currentTransform[3] === 0) { + rotate = currentTransform[1] > 0 ? 90 : 270; + } + switch (rotate) { + case 0: + break; + case 90: + [posX, posY] = [posY, posX]; + [lastPosX, lastPosY] = [lastPosY, lastPosX]; + break; + case 180: + [posX, posY, lastPosX, lastPosY] = [-posX, -posY, -lastPosX, -lastPosY]; + break; + case 270: + [posX, posY] = [-posY, -posX]; + [lastPosX, lastPosY] = [-lastPosY, -lastPosX]; + break; + default: + [posX, posY] = applyInverseRotation(posX, posY, currentTransform); + [lastPosX, lastPosY] = applyInverseRotation(lastPosX, lastPosY, textContentItem.prevTransform); + } + if (textState.font.vertical) { + const advanceY = (lastPosY - posY) / textContentItem.textAdvanceScale; + const advanceX = posX - lastPosX; + const textOrientation = Math.sign(textContentItem.height); + if (advanceY < textOrientation * textContentItem.negativeSpaceMax) { + if (Math.abs(advanceX) > 0.5 * textContentItem.width) { + appendEOL(); + return true; + } + resetLastChars(); + flushTextContentItem(); + return true; + } + if (Math.abs(advanceX) > textContentItem.width) { + appendEOL(); + return true; + } + if (advanceY <= textOrientation * textContentItem.notASpace) { + resetLastChars(); + } + if (advanceY <= textOrientation * textContentItem.trackingSpaceMin) { + if (shouldAddWhitepsace()) { + resetLastChars(); + flushTextContentItem(); + pushWhitespace({ + height: Math.abs(advanceY) + }); + } else { + textContentItem.height += advanceY; + } + } else if (!addFakeSpaces(advanceY, textContentItem.prevTransform, textOrientation)) { + if (textContentItem.str.length === 0) { + resetLastChars(); + pushWhitespace({ + height: Math.abs(advanceY) + }); + } else { + textContentItem.height += advanceY; + } + } + if (Math.abs(advanceX) > textContentItem.width * VERTICAL_SHIFT_RATIO) { + flushTextContentItem(); + } + return true; + } + const advanceX = (posX - lastPosX) / textContentItem.textAdvanceScale; + const advanceY = posY - lastPosY; + const textOrientation = Math.sign(textContentItem.width); + if (advanceX < textOrientation * textContentItem.negativeSpaceMax) { + if (Math.abs(advanceY) > 0.5 * textContentItem.height) { + appendEOL(); + return true; + } + resetLastChars(); + flushTextContentItem(); + return true; + } + if (Math.abs(advanceY) > textContentItem.height) { + appendEOL(); + return true; + } + if (advanceX <= textOrientation * textContentItem.notASpace) { + resetLastChars(); + } + if (advanceX <= textOrientation * textContentItem.trackingSpaceMin) { + if (shouldAddWhitepsace()) { + resetLastChars(); + flushTextContentItem(); + pushWhitespace({ + width: Math.abs(advanceX) + }); + } else { + textContentItem.width += advanceX; + } + } else if (!addFakeSpaces(advanceX, textContentItem.prevTransform, textOrientation)) { + if (textContentItem.str.length === 0) { + resetLastChars(); + pushWhitespace({ + width: Math.abs(advanceX) + }); + } else { + textContentItem.width += advanceX; + } + } + if (Math.abs(advanceY) > textContentItem.height * VERTICAL_SHIFT_RATIO) { + flushTextContentItem(); + } + return true; + } + function buildTextContentItem({ + chars, + extraSpacing + }) { + const font = textState.font; + if (!chars) { + const charSpacing = textState.charSpacing + extraSpacing; + if (charSpacing) { + if (!font.vertical) { + textState.translateTextMatrix(charSpacing * textState.textHScale, 0); + } else { + textState.translateTextMatrix(0, -charSpacing); + } + } + return; + } + const glyphs = font.charsToGlyphs(chars); + const scale = textState.fontMatrix[0] * textState.fontSize; + for (let i = 0, ii = glyphs.length; i < ii; i++) { + const glyph = glyphs[i]; + const { + category + } = glyph; + if (category.isInvisibleFormatMark) { + continue; + } + let charSpacing = textState.charSpacing + (i + 1 === ii ? extraSpacing : 0); + let glyphWidth = glyph.width; + if (font.vertical) { + glyphWidth = glyph.vmetric ? glyph.vmetric[0] : -glyphWidth; + } + let scaledDim = glyphWidth * scale; + if (category.isWhitespace) { + if (!font.vertical) { + charSpacing += scaledDim + textState.wordSpacing; + textState.translateTextMatrix(charSpacing * textState.textHScale, 0); + } else { + charSpacing += -scaledDim + textState.wordSpacing; + textState.translateTextMatrix(0, -charSpacing); + } + saveLastChar(" "); + continue; + } + if (!category.isZeroWidthDiacritic && !compareWithLastPosition(scaledDim)) { + if (!font.vertical) { + textState.translateTextMatrix(scaledDim * textState.textHScale, 0); + } else { + textState.translateTextMatrix(0, scaledDim); + } + continue; + } + const textChunk = ensureTextContentItem(); + if (category.isZeroWidthDiacritic) { + scaledDim = 0; + } + if (!font.vertical) { + scaledDim *= textState.textHScale; + textState.translateTextMatrix(scaledDim, 0); + textChunk.width += scaledDim; + } else { + textState.translateTextMatrix(0, scaledDim); + scaledDim = Math.abs(scaledDim); + textChunk.height += scaledDim; + } + if (scaledDim) { + textChunk.prevTransform = getCurrentTextTransform(); + } + const glyphUnicode = glyph.unicode; + if (saveLastChar(glyphUnicode)) { + textChunk.str.push(" "); + } + textChunk.str.push(glyphUnicode); + if (charSpacing) { + if (!font.vertical) { + textState.translateTextMatrix(charSpacing * textState.textHScale, 0); + } else { + textState.translateTextMatrix(0, -charSpacing); + } + } + } + } + function appendEOL() { + resetLastChars(); + if (textContentItem.initialized) { + textContentItem.hasEOL = true; + flushTextContentItem(); + } else { + textContent.items.push({ + str: "", + dir: "ltr", + width: 0, + height: 0, + transform: getCurrentTextTransform(), + fontName: textState.loadedName, + hasEOL: true + }); + } + } + function addFakeSpaces(width, transf, textOrientation) { + if (textOrientation * textContentItem.spaceInFlowMin <= width && width <= textOrientation * textContentItem.spaceInFlowMax) { + if (textContentItem.initialized) { + resetLastChars(); + textContentItem.str.push(" "); + } + return false; + } + const fontName = textContentItem.fontName; + let height = 0; + if (textContentItem.vertical) { + height = width; + width = 0; + } + flushTextContentItem(); + resetLastChars(); + pushWhitespace({ + width: Math.abs(width), + height: Math.abs(height), + transform: transf || getCurrentTextTransform(), + fontName + }); + return true; + } + function flushTextContentItem() { + if (!textContentItem.initialized || !textContentItem.str) { + return; + } + if (!textContentItem.vertical) { + textContentItem.totalWidth += textContentItem.width * textContentItem.textAdvanceScale; + } else { + textContentItem.totalHeight += textContentItem.height * textContentItem.textAdvanceScale; + } + textContent.items.push(runBidiTransform(textContentItem)); + textContentItem.initialized = false; + textContentItem.str.length = 0; + } + function enqueueChunk(batch = false) { + const length = textContent.items.length; + if (length === 0) { + return; + } + if (batch && length < TEXT_CHUNK_BATCH_SIZE) { + return; + } + sink.enqueue(textContent, length); + textContent.items = []; + textContent.styles = Object.create(null); + } + const timeSlotManager = new TimeSlotManager(); + return new Promise(function promiseBody(resolve, reject) { + const next = function (promise) { + enqueueChunk(true); + Promise.all([promise, sink.ready]).then(function () { + try { + promiseBody(resolve, reject); + } catch (ex) { + reject(ex); + } + }, reject); + }; + task.ensureNotTerminated(); + timeSlotManager.reset(); + const operation = {}; + let stop, + args = []; + while (!(stop = timeSlotManager.check())) { + args.length = 0; + operation.args = args; + if (!preprocessor.read(operation)) { + break; + } + const previousState = textState; + textState = stateManager.state; + const fn = operation.fn; + args = operation.args; + switch (fn | 0) { + case OPS.setFont: + var fontNameArg = args[0].name, + fontSizeArg = args[1]; + if (textState.font && fontNameArg === textState.fontName && fontSizeArg === textState.fontSize) { + break; + } + flushTextContentItem(); + textState.fontName = fontNameArg; + textState.fontSize = fontSizeArg; + next(handleSetFont(fontNameArg, null)); + return; + case OPS.setTextRise: + textState.textRise = args[0]; + break; + case OPS.setHScale: + textState.textHScale = args[0] / 100; + break; + case OPS.setLeading: + textState.leading = args[0]; + break; + case OPS.moveText: + textState.translateTextLineMatrix(args[0], args[1]); + textState.textMatrix = textState.textLineMatrix.slice(); + break; + case OPS.setLeadingMoveText: + textState.leading = -args[1]; + textState.translateTextLineMatrix(args[0], args[1]); + textState.textMatrix = textState.textLineMatrix.slice(); + break; + case OPS.nextLine: + textState.carriageReturn(); + break; + case OPS.setTextMatrix: + textState.setTextMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); + textState.setTextLineMatrix(args[0], args[1], args[2], args[3], args[4], args[5]); + updateAdvanceScale(); + break; + case OPS.setCharSpacing: + textState.charSpacing = args[0]; + break; + case OPS.setWordSpacing: + textState.wordSpacing = args[0]; + break; + case OPS.beginText: + textState.textMatrix = IDENTITY_MATRIX.slice(); + textState.textLineMatrix = IDENTITY_MATRIX.slice(); + break; + case OPS.showSpacedText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + const spaceFactor = (textState.font.vertical ? 1 : -1) * textState.fontSize / 1000; + const elements = args[0]; + for (let i = 0, ii = elements.length; i < ii; i++) { + const item = elements[i]; + if (typeof item === "string") { + showSpacedTextBuffer.push(item); + } else if (typeof item === "number" && item !== 0) { + const str = showSpacedTextBuffer.join(""); + showSpacedTextBuffer.length = 0; + buildTextContentItem({ + chars: str, + extraSpacing: item * spaceFactor + }); + } + } + if (showSpacedTextBuffer.length > 0) { + const str = showSpacedTextBuffer.join(""); + showSpacedTextBuffer.length = 0; + buildTextContentItem({ + chars: str, + extraSpacing: 0 + }); + } + break; + case OPS.showText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + buildTextContentItem({ + chars: args[0], + extraSpacing: 0 + }); + break; + case OPS.nextLineShowText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + textState.carriageReturn(); + buildTextContentItem({ + chars: args[0], + extraSpacing: 0 + }); + break; + case OPS.nextLineSetSpacingShowText: + if (!stateManager.state.font) { + self.ensureStateFont(stateManager.state); + continue; + } + textState.wordSpacing = args[0]; + textState.charSpacing = args[1]; + textState.carriageReturn(); + buildTextContentItem({ + chars: args[2], + extraSpacing: 0 + }); + break; + case OPS.paintXObject: + flushTextContentItem(); + if (!xobjs) { + xobjs = resources.get("XObject") || Dict.empty; + } + var isValidName = args[0] instanceof Name; + var name = args[0].name; + if (isValidName && emptyXObjectCache.getByName(name)) { + break; + } + next(new Promise(function (resolveXObject, rejectXObject) { + if (!isValidName) { + throw new FormatError("XObject must be referred to by name."); + } + let xobj = xobjs.getRaw(name); + if (xobj instanceof Ref) { + if (emptyXObjectCache.getByRef(xobj)) { + resolveXObject(); + return; + } + const globalImage = self.globalImageCache.getData(xobj, self.pageIndex); + if (globalImage) { + resolveXObject(); + return; + } + xobj = xref.fetch(xobj); + } + if (!(xobj instanceof BaseStream)) { + throw new FormatError("XObject should be a stream"); + } + const type = xobj.dict.get("Subtype"); + if (!(type instanceof Name)) { + throw new FormatError("XObject should have a Name subtype"); + } + if (type.name !== "Form") { + emptyXObjectCache.set(name, xobj.dict.objId, true); + resolveXObject(); + return; + } + const currentState = stateManager.state.clone(); + const xObjStateManager = new StateManager(currentState); + const matrix = xobj.dict.getArray("Matrix"); + if (Array.isArray(matrix) && matrix.length === 6) { + xObjStateManager.transform(matrix); + } + enqueueChunk(); + const sinkWrapper = { + enqueueInvoked: false, + enqueue(chunk, size) { + this.enqueueInvoked = true; + sink.enqueue(chunk, size); + }, + get desiredSize() { + return sink.desiredSize; + }, + get ready() { + return sink.ready; + } + }; + self.getTextContent({ + stream: xobj, + task, + resources: xobj.dict.get("Resources") || resources, + stateManager: xObjStateManager, + includeMarkedContent, + sink: sinkWrapper, + seenStyles, + viewBox, + markedContentData, + disableNormalization + }).then(function () { + if (!sinkWrapper.enqueueInvoked) { + emptyXObjectCache.set(name, xobj.dict.objId, true); + } + resolveXObject(); + }, rejectXObject); + }).catch(function (reason) { + if (reason instanceof AbortException) { + return; + } + if (self.options.ignoreErrors) { + warn(`getTextContent - ignoring XObject: "${reason}".`); + return; + } + throw reason; + })); + return; + case OPS.setGState: + isValidName = args[0] instanceof Name; + name = args[0].name; + if (isValidName && emptyGStateCache.getByName(name)) { + break; + } + next(new Promise(function (resolveGState, rejectGState) { + if (!isValidName) { + throw new FormatError("GState must be referred to by name."); + } + const extGState = resources.get("ExtGState"); + if (!(extGState instanceof Dict)) { + throw new FormatError("ExtGState should be a dictionary."); + } + const gState = extGState.get(name); + if (!(gState instanceof Dict)) { + throw new FormatError("GState should be a dictionary."); + } + const gStateFont = gState.get("Font"); + if (!gStateFont) { + emptyGStateCache.set(name, gState.objId, true); + resolveGState(); + return; + } + flushTextContentItem(); + textState.fontName = null; + textState.fontSize = gStateFont[1]; + handleSetFont(null, gStateFont[0]).then(resolveGState, rejectGState); + }).catch(function (reason) { + if (reason instanceof AbortException) { + return; + } + if (self.options.ignoreErrors) { + warn(`getTextContent - ignoring ExtGState: "${reason}".`); + return; + } + throw reason; + })); + return; + case OPS.beginMarkedContent: + flushTextContentItem(); + if (includeMarkedContent) { + markedContentData.level++; + textContent.items.push({ + type: "beginMarkedContent", + tag: args[0] instanceof Name ? args[0].name : null + }); + } + break; + case OPS.beginMarkedContentProps: + flushTextContentItem(); + if (includeMarkedContent) { + markedContentData.level++; + let mcid = null; + if (args[1] instanceof Dict) { + mcid = args[1].get("MCID"); + } + textContent.items.push({ + type: "beginMarkedContentProps", + id: Number.isInteger(mcid) ? `${self.idFactory.getPageObjId()}_mc${mcid}` : null, + tag: args[0] instanceof Name ? args[0].name : null + }); + } + break; + case OPS.endMarkedContent: + flushTextContentItem(); + if (includeMarkedContent) { + if (markedContentData.level === 0) { + break; + } + markedContentData.level--; + textContent.items.push({ + type: "endMarkedContent" + }); + } + break; + case OPS.restore: + if (previousState && (previousState.font !== textState.font || previousState.fontSize !== textState.fontSize || previousState.fontName !== textState.fontName)) { + flushTextContentItem(); + } + break; + } + if (textContent.items.length >= sink.desiredSize) { + stop = true; + break; + } + } + if (stop) { + next(deferred); + return; + } + flushTextContentItem(); + enqueueChunk(); + resolve(); + }).catch(reason => { + if (reason instanceof AbortException) { + return; + } + if (this.options.ignoreErrors) { + warn(`getTextContent - ignoring errors during "${task.name}" ` + `task: "${reason}".`); + flushTextContentItem(); + enqueueChunk(); + return; + } + throw reason; + }); + } + extractDataStructures(dict, baseDict, properties) { + const xref = this.xref; + let cidToGidBytes; + const toUnicodePromise = this.readToUnicode(properties.toUnicode || dict.get("ToUnicode") || baseDict.get("ToUnicode")); + if (properties.composite) { + const cidSystemInfo = dict.get("CIDSystemInfo"); + if (cidSystemInfo instanceof Dict) { + properties.cidSystemInfo = { + registry: stringToPDFString(cidSystemInfo.get("Registry")), + ordering: stringToPDFString(cidSystemInfo.get("Ordering")), + supplement: cidSystemInfo.get("Supplement") + }; + } + try { + const cidToGidMap = dict.get("CIDToGIDMap"); + if (cidToGidMap instanceof BaseStream) { + cidToGidBytes = cidToGidMap.getBytes(); + } + } catch (ex) { + if (!this.options.ignoreErrors) { + throw ex; + } + warn(`extractDataStructures - ignoring CIDToGIDMap data: "${ex}".`); + } + } + const differences = []; + let baseEncodingName = null; + let encoding; + if (dict.has("Encoding")) { + encoding = dict.get("Encoding"); + if (encoding instanceof Dict) { + baseEncodingName = encoding.get("BaseEncoding"); + baseEncodingName = baseEncodingName instanceof Name ? baseEncodingName.name : null; + if (encoding.has("Differences")) { + const diffEncoding = encoding.get("Differences"); + let index = 0; + for (const entry of diffEncoding) { + const data = xref.fetchIfRef(entry); + if (typeof data === "number") { + index = data; + } else if (data instanceof Name) { + differences[index++] = data.name; + } else { + throw new FormatError(`Invalid entry in 'Differences' array: ${data}`); + } + } + } + } else if (encoding instanceof Name) { + baseEncodingName = encoding.name; + } else { + const msg = "Encoding is not a Name nor a Dict"; + if (!this.options.ignoreErrors) { + throw new FormatError(msg); + } + warn(msg); + } + if (baseEncodingName !== "MacRomanEncoding" && baseEncodingName !== "MacExpertEncoding" && baseEncodingName !== "WinAnsiEncoding") { + baseEncodingName = null; + } + } + const nonEmbeddedFont = !properties.file || properties.isInternalFont, + isSymbolsFontName = getSymbolsFonts()[properties.name]; + if (baseEncodingName && nonEmbeddedFont && isSymbolsFontName) { + baseEncodingName = null; + } + if (baseEncodingName) { + properties.defaultEncoding = getEncoding(baseEncodingName); + } else { + const isSymbolicFont = !!(properties.flags & FontFlags.Symbolic); + const isNonsymbolicFont = !!(properties.flags & FontFlags.Nonsymbolic); + encoding = StandardEncoding; + if (properties.type === "TrueType" && !isNonsymbolicFont) { + encoding = WinAnsiEncoding; + } + if (isSymbolicFont || isSymbolsFontName) { + encoding = MacRomanEncoding; + if (nonEmbeddedFont) { + if (/Symbol/i.test(properties.name)) { + encoding = SymbolSetEncoding; + } else if (/Dingbats/i.test(properties.name)) { + encoding = ZapfDingbatsEncoding; + } else if (/Wingdings/i.test(properties.name)) { + encoding = WinAnsiEncoding; + } + } + } + properties.defaultEncoding = encoding; + } + properties.differences = differences; + properties.baseEncodingName = baseEncodingName; + properties.hasEncoding = !!baseEncodingName || differences.length > 0; + properties.dict = dict; + return toUnicodePromise.then(readToUnicode => { + properties.toUnicode = readToUnicode; + return this.buildToUnicode(properties); + }).then(builtToUnicode => { + properties.toUnicode = builtToUnicode; + if (cidToGidBytes) { + properties.cidToGidMap = this.readCidToGidMap(cidToGidBytes, builtToUnicode); + } + return properties; + }); + } + _simpleFontToUnicode(properties, forceGlyphs = false) { + assert(!properties.composite, "Must be a simple font."); + const toUnicode = []; + const encoding = properties.defaultEncoding.slice(); + const baseEncodingName = properties.baseEncodingName; + const differences = properties.differences; + for (const charcode in differences) { + const glyphName = differences[charcode]; + if (glyphName === ".notdef") { + continue; + } + encoding[charcode] = glyphName; + } + const glyphsUnicodeMap = getGlyphsUnicode(); + for (const charcode in encoding) { + let glyphName = encoding[charcode]; + if (glyphName === "") { + continue; + } + let unicode = glyphsUnicodeMap[glyphName]; + if (unicode !== undefined) { + toUnicode[charcode] = String.fromCharCode(unicode); + continue; + } + let code = 0; + switch (glyphName[0]) { + case "G": + if (glyphName.length === 3) { + code = parseInt(glyphName.substring(1), 16); + } + break; + case "g": + if (glyphName.length === 5) { + code = parseInt(glyphName.substring(1), 16); + } + break; + case "C": + case "c": + if (glyphName.length >= 3 && glyphName.length <= 4) { + const codeStr = glyphName.substring(1); + if (forceGlyphs) { + code = parseInt(codeStr, 16); + break; + } + code = +codeStr; + if (Number.isNaN(code) && Number.isInteger(parseInt(codeStr, 16))) { + return this._simpleFontToUnicode(properties, true); + } + } + break; + case "u": + unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap); + if (unicode !== -1) { + code = unicode; + } + break; + default: + switch (glyphName) { + case "f_h": + case "f_t": + case "T_h": + toUnicode[charcode] = glyphName.replaceAll("_", ""); + continue; + } + break; + } + if (code > 0 && code <= 0x10ffff && Number.isInteger(code)) { + if (baseEncodingName && code === +charcode) { + const baseEncoding = getEncoding(baseEncodingName); + if (baseEncoding && (glyphName = baseEncoding[charcode])) { + toUnicode[charcode] = String.fromCharCode(glyphsUnicodeMap[glyphName]); + continue; + } + } + toUnicode[charcode] = String.fromCodePoint(code); + } + } + return toUnicode; + } + async buildToUnicode(properties) { + properties.hasIncludedToUnicodeMap = properties.toUnicode?.length > 0; + if (properties.hasIncludedToUnicodeMap) { + if (!properties.composite && properties.hasEncoding) { + properties.fallbackToUnicode = this._simpleFontToUnicode(properties); + } + return properties.toUnicode; + } + if (!properties.composite) { + return new ToUnicodeMap(this._simpleFontToUnicode(properties)); + } + if (properties.composite && (properties.cMap.builtInCMap && !(properties.cMap instanceof IdentityCMap) || properties.cidSystemInfo.registry === "Adobe" && (properties.cidSystemInfo.ordering === "GB1" || properties.cidSystemInfo.ordering === "CNS1" || properties.cidSystemInfo.ordering === "Japan1" || properties.cidSystemInfo.ordering === "Korea1"))) { + const { + registry, + ordering + } = properties.cidSystemInfo; + const ucs2CMapName = Name.get(`${registry}-${ordering}-UCS2`); + const ucs2CMap = await CMapFactory.create({ + encoding: ucs2CMapName, + fetchBuiltInCMap: this._fetchBuiltInCMapBound, + useCMap: null + }); + const toUnicode = [], + buf = []; + properties.cMap.forEach(function (charcode, cid) { + if (cid > 0xffff) { + throw new FormatError("Max size of CID is 65,535"); + } + const ucs2 = ucs2CMap.lookup(cid); + if (ucs2) { + buf.length = 0; + for (let i = 0, ii = ucs2.length; i < ii; i += 2) { + buf.push((ucs2.charCodeAt(i) << 8) + ucs2.charCodeAt(i + 1)); + } + toUnicode[charcode] = String.fromCharCode(...buf); + } + }); + return new ToUnicodeMap(toUnicode); + } + return new IdentityToUnicodeMap(properties.firstChar, properties.lastChar); + } + readToUnicode(cmapObj) { + if (!cmapObj) { + return Promise.resolve(null); + } + if (cmapObj instanceof Name) { + return CMapFactory.create({ + encoding: cmapObj, + fetchBuiltInCMap: this._fetchBuiltInCMapBound, + useCMap: null + }).then(function (cmap) { + if (cmap instanceof IdentityCMap) { + return new IdentityToUnicodeMap(0, 0xffff); + } + return new ToUnicodeMap(cmap.getMap()); + }); + } else if (cmapObj instanceof BaseStream) { + return CMapFactory.create({ + encoding: cmapObj, + fetchBuiltInCMap: this._fetchBuiltInCMapBound, + useCMap: null + }).then(function (cmap) { + if (cmap instanceof IdentityCMap) { + return new IdentityToUnicodeMap(0, 0xffff); + } + const map = new Array(cmap.length); + cmap.forEach(function (charCode, token) { + if (typeof token === "number") { + map[charCode] = String.fromCodePoint(token); + return; + } + const str = []; + for (let k = 0; k < token.length; k += 2) { + const w1 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); + if ((w1 & 0xf800) !== 0xd800) { + str.push(w1); + continue; + } + k += 2; + const w2 = token.charCodeAt(k) << 8 | token.charCodeAt(k + 1); + str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000); + } + map[charCode] = String.fromCodePoint(...str); + }); + return new ToUnicodeMap(map); + }, reason => { + if (reason instanceof AbortException) { + return null; + } + if (this.options.ignoreErrors) { + warn(`readToUnicode - ignoring ToUnicode data: "${reason}".`); + return null; + } + throw reason; + }); + } + return Promise.resolve(null); + } + readCidToGidMap(glyphsData, toUnicode) { + const result = []; + for (let j = 0, jj = glyphsData.length; j < jj; j++) { + const glyphID = glyphsData[j++] << 8 | glyphsData[j]; + const code = j >> 1; + if (glyphID === 0 && !toUnicode.has(code)) { + continue; + } + result[code] = glyphID; + } + return result; + } + extractWidths(dict, descriptor, properties) { + const xref = this.xref; + let glyphsWidths = []; + let defaultWidth = 0; + const glyphsVMetrics = []; + let defaultVMetrics; + let i, ii, j, jj, start, code, widths; + if (properties.composite) { + defaultWidth = dict.has("DW") ? dict.get("DW") : 1000; + widths = dict.get("W"); + if (widths) { + for (i = 0, ii = widths.length; i < ii; i++) { + start = xref.fetchIfRef(widths[i++]); + code = xref.fetchIfRef(widths[i]); + if (Array.isArray(code)) { + for (j = 0, jj = code.length; j < jj; j++) { + glyphsWidths[start++] = xref.fetchIfRef(code[j]); + } + } else { + const width = xref.fetchIfRef(widths[++i]); + for (j = start; j <= code; j++) { + glyphsWidths[j] = width; + } + } + } + } + if (properties.vertical) { + let vmetrics = dict.getArray("DW2") || [880, -1000]; + defaultVMetrics = [vmetrics[1], defaultWidth * 0.5, vmetrics[0]]; + vmetrics = dict.get("W2"); + if (vmetrics) { + for (i = 0, ii = vmetrics.length; i < ii; i++) { + start = xref.fetchIfRef(vmetrics[i++]); + code = xref.fetchIfRef(vmetrics[i]); + if (Array.isArray(code)) { + for (j = 0, jj = code.length; j < jj; j++) { + glyphsVMetrics[start++] = [xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j++]), xref.fetchIfRef(code[j])]; + } + } else { + const vmetric = [xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i]), xref.fetchIfRef(vmetrics[++i])]; + for (j = start; j <= code; j++) { + glyphsVMetrics[j] = vmetric; + } + } + } + } + } + } else { + const firstChar = properties.firstChar; + widths = dict.get("Widths"); + if (widths) { + j = firstChar; + for (i = 0, ii = widths.length; i < ii; i++) { + glyphsWidths[j++] = xref.fetchIfRef(widths[i]); + } + defaultWidth = parseFloat(descriptor.get("MissingWidth")) || 0; + } else { + const baseFontName = dict.get("BaseFont"); + if (baseFontName instanceof Name) { + const metrics = this.getBaseFontMetrics(baseFontName.name); + glyphsWidths = this.buildCharCodeToWidth(metrics.widths, properties); + defaultWidth = metrics.defaultWidth; + } + } + } + let isMonospace = true; + let firstWidth = defaultWidth; + for (const glyph in glyphsWidths) { + const glyphWidth = glyphsWidths[glyph]; + if (!glyphWidth) { + continue; + } + if (!firstWidth) { + firstWidth = glyphWidth; + continue; + } + if (firstWidth !== glyphWidth) { + isMonospace = false; + break; + } + } + if (isMonospace) { + properties.flags |= FontFlags.FixedPitch; + } else { + properties.flags &= ~FontFlags.FixedPitch; + } + properties.defaultWidth = defaultWidth; + properties.widths = glyphsWidths; + properties.defaultVMetrics = defaultVMetrics; + properties.vmetrics = glyphsVMetrics; + } + isSerifFont(baseFontName) { + const fontNameWoStyle = baseFontName.split("-")[0]; + return fontNameWoStyle in getSerifFonts() || /serif/gi.test(fontNameWoStyle); + } + getBaseFontMetrics(name) { + let defaultWidth = 0; + let widths = Object.create(null); + let monospace = false; + const stdFontMap = getStdFontMap(); + let lookupName = stdFontMap[name] || name; + const Metrics = getMetrics(); + if (!(lookupName in Metrics)) { + lookupName = this.isSerifFont(name) ? "Times-Roman" : "Helvetica"; + } + const glyphWidths = Metrics[lookupName]; + if (typeof glyphWidths === "number") { + defaultWidth = glyphWidths; + monospace = true; + } else { + widths = glyphWidths(); + } + return { + defaultWidth, + monospace, + widths + }; + } + buildCharCodeToWidth(widthsByGlyphName, properties) { + const widths = Object.create(null); + const differences = properties.differences; + const encoding = properties.defaultEncoding; + for (let charCode = 0; charCode < 256; charCode++) { + if (charCode in differences && widthsByGlyphName[differences[charCode]]) { + widths[charCode] = widthsByGlyphName[differences[charCode]]; + continue; + } + if (charCode in encoding && widthsByGlyphName[encoding[charCode]]) { + widths[charCode] = widthsByGlyphName[encoding[charCode]]; + continue; + } + } + return widths; + } + preEvaluateFont(dict) { + const baseDict = dict; + let type = dict.get("Subtype"); + if (!(type instanceof Name)) { + throw new FormatError("invalid font Subtype"); + } + let composite = false; + let hash, toUnicode; + if (type.name === "Type0") { + const df = dict.get("DescendantFonts"); + if (!df) { + throw new FormatError("Descendant fonts are not specified"); + } + dict = Array.isArray(df) ? this.xref.fetchIfRef(df[0]) : df; + if (!(dict instanceof Dict)) { + throw new FormatError("Descendant font is not a dictionary."); + } + type = dict.get("Subtype"); + if (!(type instanceof Name)) { + throw new FormatError("invalid font Subtype"); + } + composite = true; + } + const firstChar = dict.get("FirstChar") || 0, + lastChar = dict.get("LastChar") || (composite ? 0xffff : 0xff); + const descriptor = dict.get("FontDescriptor"); + if (descriptor) { + hash = new MurmurHash3_64(); + const encoding = baseDict.getRaw("Encoding"); + if (encoding instanceof Name) { + hash.update(encoding.name); + } else if (encoding instanceof Ref) { + hash.update(encoding.toString()); + } else if (encoding instanceof Dict) { + for (const entry of encoding.getRawValues()) { + if (entry instanceof Name) { + hash.update(entry.name); + } else if (entry instanceof Ref) { + hash.update(entry.toString()); + } else if (Array.isArray(entry)) { + const diffLength = entry.length, + diffBuf = new Array(diffLength); + for (let j = 0; j < diffLength; j++) { + const diffEntry = entry[j]; + if (diffEntry instanceof Name) { + diffBuf[j] = diffEntry.name; + } else if (typeof diffEntry === "number" || diffEntry instanceof Ref) { + diffBuf[j] = diffEntry.toString(); + } + } + hash.update(diffBuf.join()); + } + } + } + hash.update(`${firstChar}-${lastChar}`); + toUnicode = dict.get("ToUnicode") || baseDict.get("ToUnicode"); + if (toUnicode instanceof BaseStream) { + const stream = toUnicode.str || toUnicode; + const uint8array = stream.buffer ? new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength) : new Uint8Array(stream.bytes.buffer, stream.start, stream.end - stream.start); + hash.update(uint8array); + } else if (toUnicode instanceof Name) { + hash.update(toUnicode.name); + } + const widths = dict.get("Widths") || baseDict.get("Widths"); + if (Array.isArray(widths)) { + const widthsBuf = []; + for (const entry of widths) { + if (typeof entry === "number" || entry instanceof Ref) { + widthsBuf.push(entry.toString()); + } + } + hash.update(widthsBuf.join()); + } + if (composite) { + hash.update("compositeFont"); + const compositeWidths = dict.get("W") || baseDict.get("W"); + if (Array.isArray(compositeWidths)) { + const widthsBuf = []; + for (const entry of compositeWidths) { + if (typeof entry === "number" || entry instanceof Ref) { + widthsBuf.push(entry.toString()); + } else if (Array.isArray(entry)) { + const subWidthsBuf = []; + for (const element of entry) { + if (typeof element === "number" || element instanceof Ref) { + subWidthsBuf.push(element.toString()); + } + } + widthsBuf.push(`[${subWidthsBuf.join()}]`); + } + } + hash.update(widthsBuf.join()); + } + const cidToGidMap = dict.getRaw("CIDToGIDMap") || baseDict.getRaw("CIDToGIDMap"); + if (cidToGidMap instanceof Name) { + hash.update(cidToGidMap.name); + } else if (cidToGidMap instanceof Ref) { + hash.update(cidToGidMap.toString()); + } else if (cidToGidMap instanceof BaseStream) { + hash.update(cidToGidMap.peekBytes()); + } + } + } + return { + descriptor, + dict, + baseDict, + composite, + type: type.name, + firstChar, + lastChar, + toUnicode, + hash: hash ? hash.hexdigest() : "" + }; + } + async translateFont({ + descriptor, + dict, + baseDict, + composite, + type, + firstChar, + lastChar, + toUnicode, + cssFontInfo + }) { + const isType3Font = type === "Type3"; + let properties; + if (!descriptor) { + if (isType3Font) { + descriptor = new Dict(null); + descriptor.set("FontName", Name.get(type)); + descriptor.set("FontBBox", dict.getArray("FontBBox") || [0, 0, 0, 0]); + } else { + let baseFontName = dict.get("BaseFont"); + if (!(baseFontName instanceof Name)) { + throw new FormatError("Base font is not specified"); + } + baseFontName = baseFontName.name.replaceAll(/[,_]/g, "-"); + const metrics = this.getBaseFontMetrics(baseFontName); + const fontNameWoStyle = baseFontName.split("-")[0]; + const flags = (this.isSerifFont(fontNameWoStyle) ? FontFlags.Serif : 0) | (metrics.monospace ? FontFlags.FixedPitch : 0) | (getSymbolsFonts()[fontNameWoStyle] ? FontFlags.Symbolic : FontFlags.Nonsymbolic); + properties = { + type, + name: baseFontName, + loadedName: baseDict.loadedName, + systemFontInfo: null, + widths: metrics.widths, + defaultWidth: metrics.defaultWidth, + isSimulatedFlags: true, + flags, + firstChar, + lastChar, + toUnicode, + xHeight: 0, + capHeight: 0, + italicAngle: 0, + isType3Font + }; + const widths = dict.get("Widths"); + const standardFontName = getStandardFontName(baseFontName); + let file = null; + if (standardFontName) { + file = await this.fetchStandardFontData(standardFontName); + properties.isInternalFont = !!file; + } + if (!properties.isInternalFont && this.options.useSystemFonts) { + properties.systemFontInfo = getFontSubstitution(this.systemFontCache, this.idFactory, this.options.standardFontDataUrl, baseFontName, standardFontName); + } + return this.extractDataStructures(dict, dict, properties).then(newProperties => { + if (widths) { + const glyphWidths = []; + let j = firstChar; + for (const width of widths) { + glyphWidths[j++] = this.xref.fetchIfRef(width); + } + newProperties.widths = glyphWidths; + } else { + newProperties.widths = this.buildCharCodeToWidth(metrics.widths, newProperties); + } + return new Font(baseFontName, file, newProperties); + }); + } + } + let fontName = descriptor.get("FontName"); + let baseFont = dict.get("BaseFont"); + if (typeof fontName === "string") { + fontName = Name.get(fontName); + } + if (typeof baseFont === "string") { + baseFont = Name.get(baseFont); + } + const fontNameStr = fontName?.name; + const baseFontStr = baseFont?.name; + if (!isType3Font && fontNameStr !== baseFontStr) { + info(`The FontDescriptor's FontName is "${fontNameStr}" but ` + `should be the same as the Font's BaseFont "${baseFontStr}".`); + if (fontNameStr && baseFontStr && (baseFontStr.startsWith(fontNameStr) || !isKnownFontName(fontNameStr) && isKnownFontName(baseFontStr))) { + fontName = null; + } + } + fontName ||= baseFont; + if (!(fontName instanceof Name)) { + throw new FormatError("invalid font name"); + } + let fontFile, subtype, length1, length2, length3; + try { + fontFile = descriptor.get("FontFile", "FontFile2", "FontFile3"); + } catch (ex) { + if (!this.options.ignoreErrors) { + throw ex; + } + warn(`translateFont - fetching "${fontName.name}" font file: "${ex}".`); + fontFile = new NullStream(); + } + let isInternalFont = false; + let glyphScaleFactors = null; + let systemFontInfo = null; + if (fontFile) { + if (fontFile.dict) { + const subtypeEntry = fontFile.dict.get("Subtype"); + if (subtypeEntry instanceof Name) { + subtype = subtypeEntry.name; + } + length1 = fontFile.dict.get("Length1"); + length2 = fontFile.dict.get("Length2"); + length3 = fontFile.dict.get("Length3"); + } + } else if (cssFontInfo) { + const standardFontName = getXfaFontName(fontName.name); + if (standardFontName) { + cssFontInfo.fontFamily = `${cssFontInfo.fontFamily}-PdfJS-XFA`; + cssFontInfo.metrics = standardFontName.metrics || null; + glyphScaleFactors = standardFontName.factors || null; + fontFile = await this.fetchStandardFontData(standardFontName.name); + isInternalFont = !!fontFile; + baseDict = dict = getXfaFontDict(fontName.name); + composite = true; + } + } else if (!isType3Font) { + const standardFontName = getStandardFontName(fontName.name); + if (standardFontName) { + fontFile = await this.fetchStandardFontData(standardFontName); + isInternalFont = !!fontFile; + } + if (!isInternalFont && this.options.useSystemFonts) { + systemFontInfo = getFontSubstitution(this.systemFontCache, this.idFactory, this.options.standardFontDataUrl, fontName.name, standardFontName); + } + } + properties = { + type, + name: fontName.name, + subtype, + file: fontFile, + length1, + length2, + length3, + isInternalFont, + loadedName: baseDict.loadedName, + composite, + fixedPitch: false, + fontMatrix: dict.getArray("FontMatrix") || FONT_IDENTITY_MATRIX, + firstChar, + lastChar, + toUnicode, + bbox: descriptor.getArray("FontBBox") || dict.getArray("FontBBox"), + ascent: descriptor.get("Ascent"), + descent: descriptor.get("Descent"), + xHeight: descriptor.get("XHeight") || 0, + capHeight: descriptor.get("CapHeight") || 0, + flags: descriptor.get("Flags"), + italicAngle: descriptor.get("ItalicAngle") || 0, + isType3Font, + cssFontInfo, + scaleFactors: glyphScaleFactors, + systemFontInfo + }; + if (composite) { + const cidEncoding = baseDict.get("Encoding"); + if (cidEncoding instanceof Name) { + properties.cidEncoding = cidEncoding.name; + } + const cMap = await CMapFactory.create({ + encoding: cidEncoding, + fetchBuiltInCMap: this._fetchBuiltInCMapBound, + useCMap: null + }); + properties.cMap = cMap; + properties.vertical = properties.cMap.vertical; + } + return this.extractDataStructures(dict, baseDict, properties).then(newProperties => { + this.extractWidths(dict, descriptor, newProperties); + return new Font(fontName.name, fontFile, newProperties); + }); + } + static buildFontPaths(font, glyphs, handler, evaluatorOptions) { + function buildPath(fontChar) { + const glyphName = `${font.loadedName}_path_${fontChar}`; + try { + if (font.renderer.hasBuiltPath(fontChar)) { + return; + } + handler.send("commonobj", [glyphName, "FontPath", font.renderer.getPathJs(fontChar)]); + } catch (reason) { + if (evaluatorOptions.ignoreErrors) { + warn(`buildFontPaths - ignoring ${glyphName} glyph: "${reason}".`); + return; + } + throw reason; + } + } + for (const glyph of glyphs) { + buildPath(glyph.fontChar); + const accent = glyph.accent; + if (accent?.fontChar) { + buildPath(accent.fontChar); + } + } + } + static get fallbackFontDict() { + const dict = new Dict(); + dict.set("BaseFont", Name.get("Helvetica")); + dict.set("Type", Name.get("FallbackType")); + dict.set("Subtype", Name.get("FallbackType")); + dict.set("Encoding", Name.get("WinAnsiEncoding")); + return shadow(this, "fallbackFontDict", dict); + } +} +class TranslatedFont { + constructor({ + loadedName, + font, + dict, + evaluatorOptions + }) { + this.loadedName = loadedName; + this.font = font; + this.dict = dict; + this._evaluatorOptions = evaluatorOptions || DefaultPartialEvaluatorOptions; + this.type3Loaded = null; + this.type3Dependencies = font.isType3Font ? new Set() : null; + this.sent = false; + } + send(handler) { + if (this.sent) { + return; + } + this.sent = true; + handler.send("commonobj", [this.loadedName, "Font", this.font.exportData(this._evaluatorOptions.fontExtraProperties)]); + } + fallback(handler) { + if (!this.font.data) { + return; + } + this.font.disableFontFace = true; + PartialEvaluator.buildFontPaths(this.font, this.font.glyphCacheValues, handler, this._evaluatorOptions); + } + loadType3Data(evaluator, resources, task) { + if (this.type3Loaded) { + return this.type3Loaded; + } + if (!this.font.isType3Font) { + throw new Error("Must be a Type3 font."); + } + const type3Evaluator = evaluator.clone({ + ignoreErrors: false + }); + type3Evaluator.parsingType3Font = true; + const type3FontRefs = new RefSet(evaluator.type3FontRefs); + if (this.dict.objId && !type3FontRefs.has(this.dict.objId)) { + type3FontRefs.put(this.dict.objId); + } + type3Evaluator.type3FontRefs = type3FontRefs; + const translatedFont = this.font, + type3Dependencies = this.type3Dependencies; + let loadCharProcsPromise = Promise.resolve(); + const charProcs = this.dict.get("CharProcs"); + const fontResources = this.dict.get("Resources") || resources; + const charProcOperatorList = Object.create(null); + const fontBBox = Util.normalizeRect(translatedFont.bbox || [0, 0, 0, 0]), + width = fontBBox[2] - fontBBox[0], + height = fontBBox[3] - fontBBox[1]; + const fontBBoxSize = Math.hypot(width, height); + for (const key of charProcs.getKeys()) { + loadCharProcsPromise = loadCharProcsPromise.then(() => { + const glyphStream = charProcs.get(key); + const operatorList = new OperatorList(); + return type3Evaluator.getOperatorList({ + stream: glyphStream, + task, + resources: fontResources, + operatorList + }).then(() => { + if (operatorList.fnArray[0] === OPS.setCharWidthAndBounds) { + this._removeType3ColorOperators(operatorList, fontBBoxSize); + } + charProcOperatorList[key] = operatorList.getIR(); + for (const dependency of operatorList.dependencies) { + type3Dependencies.add(dependency); + } + }).catch(function (reason) { + warn(`Type3 font resource "${key}" is not available.`); + const dummyOperatorList = new OperatorList(); + charProcOperatorList[key] = dummyOperatorList.getIR(); + }); + }); + } + this.type3Loaded = loadCharProcsPromise.then(() => { + translatedFont.charProcOperatorList = charProcOperatorList; + if (this._bbox) { + translatedFont.isCharBBox = true; + translatedFont.bbox = this._bbox; + } + }); + return this.type3Loaded; + } + _removeType3ColorOperators(operatorList, fontBBoxSize = NaN) { + const charBBox = Util.normalizeRect(operatorList.argsArray[0].slice(2)), + width = charBBox[2] - charBBox[0], + height = charBBox[3] - charBBox[1]; + const charBBoxSize = Math.hypot(width, height); + if (width === 0 || height === 0) { + operatorList.fnArray.splice(0, 1); + operatorList.argsArray.splice(0, 1); + } else if (fontBBoxSize === 0 || Math.round(charBBoxSize / fontBBoxSize) >= 10) { + if (!this._bbox) { + this._bbox = [Infinity, Infinity, -Infinity, -Infinity]; + } + this._bbox[0] = Math.min(this._bbox[0], charBBox[0]); + this._bbox[1] = Math.min(this._bbox[1], charBBox[1]); + this._bbox[2] = Math.max(this._bbox[2], charBBox[2]); + this._bbox[3] = Math.max(this._bbox[3], charBBox[3]); + } + let i = 0, + ii = operatorList.length; + while (i < ii) { + switch (operatorList.fnArray[i]) { + case OPS.setCharWidthAndBounds: + break; + case OPS.setStrokeColorSpace: + case OPS.setFillColorSpace: + case OPS.setStrokeColor: + case OPS.setStrokeColorN: + case OPS.setFillColor: + case OPS.setFillColorN: + case OPS.setStrokeGray: + case OPS.setFillGray: + case OPS.setStrokeRGBColor: + case OPS.setFillRGBColor: + case OPS.setStrokeCMYKColor: + case OPS.setFillCMYKColor: + case OPS.shadingFill: + case OPS.setRenderingIntent: + operatorList.fnArray.splice(i, 1); + operatorList.argsArray.splice(i, 1); + ii--; + continue; + case OPS.setGState: + const [gStateObj] = operatorList.argsArray[i]; + let j = 0, + jj = gStateObj.length; + while (j < jj) { + const [gStateKey] = gStateObj[j]; + switch (gStateKey) { + case "TR": + case "TR2": + case "HT": + case "BG": + case "BG2": + case "UCR": + case "UCR2": + gStateObj.splice(j, 1); + jj--; + continue; + } + j++; + } + break; + } + i++; + } + } +} +class StateManager { + constructor(initialState = new EvalState()) { + this.state = initialState; + this.stateStack = []; + } + save() { + const old = this.state; + this.stateStack.push(this.state); + this.state = old.clone(); + } + restore() { + const prev = this.stateStack.pop(); + if (prev) { + this.state = prev; + } + } + transform(args) { + this.state.ctm = Util.transform(this.state.ctm, args); + } +} +class TextState { + constructor() { + this.ctm = new Float32Array(IDENTITY_MATRIX); + this.fontName = null; + this.fontSize = 0; + this.loadedName = null; + this.font = null; + this.fontMatrix = FONT_IDENTITY_MATRIX; + this.textMatrix = IDENTITY_MATRIX.slice(); + this.textLineMatrix = IDENTITY_MATRIX.slice(); + this.charSpacing = 0; + this.wordSpacing = 0; + this.leading = 0; + this.textHScale = 1; + this.textRise = 0; + } + setTextMatrix(a, b, c, d, e, f) { + const m = this.textMatrix; + m[0] = a; + m[1] = b; + m[2] = c; + m[3] = d; + m[4] = e; + m[5] = f; + } + setTextLineMatrix(a, b, c, d, e, f) { + const m = this.textLineMatrix; + m[0] = a; + m[1] = b; + m[2] = c; + m[3] = d; + m[4] = e; + m[5] = f; + } + translateTextMatrix(x, y) { + const m = this.textMatrix; + m[4] = m[0] * x + m[2] * y + m[4]; + m[5] = m[1] * x + m[3] * y + m[5]; + } + translateTextLineMatrix(x, y) { + const m = this.textLineMatrix; + m[4] = m[0] * x + m[2] * y + m[4]; + m[5] = m[1] * x + m[3] * y + m[5]; + } + carriageReturn() { + this.translateTextLineMatrix(0, -this.leading); + this.textMatrix = this.textLineMatrix.slice(); + } + clone() { + const clone = Object.create(this); + clone.textMatrix = this.textMatrix.slice(); + clone.textLineMatrix = this.textLineMatrix.slice(); + clone.fontMatrix = this.fontMatrix.slice(); + return clone; + } +} +class EvalState { + constructor() { + this.ctm = new Float32Array(IDENTITY_MATRIX); + this.font = null; + this.textRenderingMode = TextRenderingMode.FILL; + this.fillColorSpace = ColorSpace.singletons.gray; + this.strokeColorSpace = ColorSpace.singletons.gray; + } + clone() { + return Object.create(this); + } +} +class EvaluatorPreprocessor { + static get opMap() { + return shadow(this, "opMap", { + w: { + id: OPS.setLineWidth, + numArgs: 1, + variableArgs: false + }, + J: { + id: OPS.setLineCap, + numArgs: 1, + variableArgs: false + }, + j: { + id: OPS.setLineJoin, + numArgs: 1, + variableArgs: false + }, + M: { + id: OPS.setMiterLimit, + numArgs: 1, + variableArgs: false + }, + d: { + id: OPS.setDash, + numArgs: 2, + variableArgs: false + }, + ri: { + id: OPS.setRenderingIntent, + numArgs: 1, + variableArgs: false + }, + i: { + id: OPS.setFlatness, + numArgs: 1, + variableArgs: false + }, + gs: { + id: OPS.setGState, + numArgs: 1, + variableArgs: false + }, + q: { + id: OPS.save, + numArgs: 0, + variableArgs: false + }, + Q: { + id: OPS.restore, + numArgs: 0, + variableArgs: false + }, + cm: { + id: OPS.transform, + numArgs: 6, + variableArgs: false + }, + m: { + id: OPS.moveTo, + numArgs: 2, + variableArgs: false + }, + l: { + id: OPS.lineTo, + numArgs: 2, + variableArgs: false + }, + c: { + id: OPS.curveTo, + numArgs: 6, + variableArgs: false + }, + v: { + id: OPS.curveTo2, + numArgs: 4, + variableArgs: false + }, + y: { + id: OPS.curveTo3, + numArgs: 4, + variableArgs: false + }, + h: { + id: OPS.closePath, + numArgs: 0, + variableArgs: false + }, + re: { + id: OPS.rectangle, + numArgs: 4, + variableArgs: false + }, + S: { + id: OPS.stroke, + numArgs: 0, + variableArgs: false + }, + s: { + id: OPS.closeStroke, + numArgs: 0, + variableArgs: false + }, + f: { + id: OPS.fill, + numArgs: 0, + variableArgs: false + }, + F: { + id: OPS.fill, + numArgs: 0, + variableArgs: false + }, + "f*": { + id: OPS.eoFill, + numArgs: 0, + variableArgs: false + }, + B: { + id: OPS.fillStroke, + numArgs: 0, + variableArgs: false + }, + "B*": { + id: OPS.eoFillStroke, + numArgs: 0, + variableArgs: false + }, + b: { + id: OPS.closeFillStroke, + numArgs: 0, + variableArgs: false + }, + "b*": { + id: OPS.closeEOFillStroke, + numArgs: 0, + variableArgs: false + }, + n: { + id: OPS.endPath, + numArgs: 0, + variableArgs: false + }, + W: { + id: OPS.clip, + numArgs: 0, + variableArgs: false + }, + "W*": { + id: OPS.eoClip, + numArgs: 0, + variableArgs: false + }, + BT: { + id: OPS.beginText, + numArgs: 0, + variableArgs: false + }, + ET: { + id: OPS.endText, + numArgs: 0, + variableArgs: false + }, + Tc: { + id: OPS.setCharSpacing, + numArgs: 1, + variableArgs: false + }, + Tw: { + id: OPS.setWordSpacing, + numArgs: 1, + variableArgs: false + }, + Tz: { + id: OPS.setHScale, + numArgs: 1, + variableArgs: false + }, + TL: { + id: OPS.setLeading, + numArgs: 1, + variableArgs: false + }, + Tf: { + id: OPS.setFont, + numArgs: 2, + variableArgs: false + }, + Tr: { + id: OPS.setTextRenderingMode, + numArgs: 1, + variableArgs: false + }, + Ts: { + id: OPS.setTextRise, + numArgs: 1, + variableArgs: false + }, + Td: { + id: OPS.moveText, + numArgs: 2, + variableArgs: false + }, + TD: { + id: OPS.setLeadingMoveText, + numArgs: 2, + variableArgs: false + }, + Tm: { + id: OPS.setTextMatrix, + numArgs: 6, + variableArgs: false + }, + "T*": { + id: OPS.nextLine, + numArgs: 0, + variableArgs: false + }, + Tj: { + id: OPS.showText, + numArgs: 1, + variableArgs: false + }, + TJ: { + id: OPS.showSpacedText, + numArgs: 1, + variableArgs: false + }, + "'": { + id: OPS.nextLineShowText, + numArgs: 1, + variableArgs: false + }, + '"': { + id: OPS.nextLineSetSpacingShowText, + numArgs: 3, + variableArgs: false + }, + d0: { + id: OPS.setCharWidth, + numArgs: 2, + variableArgs: false + }, + d1: { + id: OPS.setCharWidthAndBounds, + numArgs: 6, + variableArgs: false + }, + CS: { + id: OPS.setStrokeColorSpace, + numArgs: 1, + variableArgs: false + }, + cs: { + id: OPS.setFillColorSpace, + numArgs: 1, + variableArgs: false + }, + SC: { + id: OPS.setStrokeColor, + numArgs: 4, + variableArgs: true + }, + SCN: { + id: OPS.setStrokeColorN, + numArgs: 33, + variableArgs: true + }, + sc: { + id: OPS.setFillColor, + numArgs: 4, + variableArgs: true + }, + scn: { + id: OPS.setFillColorN, + numArgs: 33, + variableArgs: true + }, + G: { + id: OPS.setStrokeGray, + numArgs: 1, + variableArgs: false + }, + g: { + id: OPS.setFillGray, + numArgs: 1, + variableArgs: false + }, + RG: { + id: OPS.setStrokeRGBColor, + numArgs: 3, + variableArgs: false + }, + rg: { + id: OPS.setFillRGBColor, + numArgs: 3, + variableArgs: false + }, + K: { + id: OPS.setStrokeCMYKColor, + numArgs: 4, + variableArgs: false + }, + k: { + id: OPS.setFillCMYKColor, + numArgs: 4, + variableArgs: false + }, + sh: { + id: OPS.shadingFill, + numArgs: 1, + variableArgs: false + }, + BI: { + id: OPS.beginInlineImage, + numArgs: 0, + variableArgs: false + }, + ID: { + id: OPS.beginImageData, + numArgs: 0, + variableArgs: false + }, + EI: { + id: OPS.endInlineImage, + numArgs: 1, + variableArgs: false + }, + Do: { + id: OPS.paintXObject, + numArgs: 1, + variableArgs: false + }, + MP: { + id: OPS.markPoint, + numArgs: 1, + variableArgs: false + }, + DP: { + id: OPS.markPointProps, + numArgs: 2, + variableArgs: false + }, + BMC: { + id: OPS.beginMarkedContent, + numArgs: 1, + variableArgs: false + }, + BDC: { + id: OPS.beginMarkedContentProps, + numArgs: 2, + variableArgs: false + }, + EMC: { + id: OPS.endMarkedContent, + numArgs: 0, + variableArgs: false + }, + BX: { + id: OPS.beginCompat, + numArgs: 0, + variableArgs: false + }, + EX: { + id: OPS.endCompat, + numArgs: 0, + variableArgs: false + }, + BM: null, + BD: null, + true: null, + fa: null, + fal: null, + fals: null, + false: null, + nu: null, + nul: null, + null: null + }); + } + static MAX_INVALID_PATH_OPS = 10; + constructor(stream, xref, stateManager = new StateManager()) { + this.parser = new Parser({ + lexer: new Lexer(stream, EvaluatorPreprocessor.opMap), + xref + }); + this.stateManager = stateManager; + this.nonProcessedArgs = []; + this._isPathOp = false; + this._numInvalidPathOPS = 0; + } + get savedStatesDepth() { + return this.stateManager.stateStack.length; + } + read(operation) { + let args = operation.args; + while (true) { + const obj = this.parser.getObj(); + if (obj instanceof Cmd) { + const cmd = obj.cmd; + const opSpec = EvaluatorPreprocessor.opMap[cmd]; + if (!opSpec) { + warn(`Unknown command "${cmd}".`); + continue; + } + const fn = opSpec.id; + const numArgs = opSpec.numArgs; + let argsLength = args !== null ? args.length : 0; + if (!this._isPathOp) { + this._numInvalidPathOPS = 0; + } + this._isPathOp = fn >= OPS.moveTo && fn <= OPS.endPath; + if (!opSpec.variableArgs) { + if (argsLength !== numArgs) { + const nonProcessedArgs = this.nonProcessedArgs; + while (argsLength > numArgs) { + nonProcessedArgs.push(args.shift()); + argsLength--; + } + while (argsLength < numArgs && nonProcessedArgs.length !== 0) { + if (args === null) { + args = []; + } + args.unshift(nonProcessedArgs.pop()); + argsLength++; + } + } + if (argsLength < numArgs) { + const partialMsg = `command ${cmd}: expected ${numArgs} args, ` + `but received ${argsLength} args.`; + if (this._isPathOp && ++this._numInvalidPathOPS > EvaluatorPreprocessor.MAX_INVALID_PATH_OPS) { + throw new FormatError(`Invalid ${partialMsg}`); + } + warn(`Skipping ${partialMsg}`); + if (args !== null) { + args.length = 0; + } + continue; + } + } else if (argsLength > numArgs) { + info(`Command ${cmd}: expected [0, ${numArgs}] args, ` + `but received ${argsLength} args.`); + } + this.preprocessCommand(fn, args); + operation.fn = fn; + operation.args = args; + return true; + } + if (obj === EOF) { + return false; + } + if (obj !== null) { + if (args === null) { + args = []; + } + args.push(obj); + if (args.length > 33) { + throw new FormatError("Too many arguments"); + } + } + } + } + preprocessCommand(fn, args) { + switch (fn | 0) { + case OPS.save: + this.stateManager.save(); + break; + case OPS.restore: + this.stateManager.restore(); + break; + case OPS.transform: + this.stateManager.transform(args); + break; + } + } +} + +;// CONCATENATED MODULE: ./src/core/default_appearance.js + + + + + + + + +class DefaultAppearanceEvaluator extends EvaluatorPreprocessor { + constructor(str) { + super(new StringStream(str)); + } + parse() { + const operation = { + fn: 0, + args: [] + }; + const result = { + fontSize: 0, + fontName: "", + fontColor: new Uint8ClampedArray(3) + }; + try { + while (true) { + operation.args.length = 0; + if (!this.read(operation)) { + break; + } + if (this.savedStatesDepth !== 0) { + continue; + } + const { + fn, + args + } = operation; + switch (fn | 0) { + case OPS.setFont: + const [fontName, fontSize] = args; + if (fontName instanceof Name) { + result.fontName = fontName.name; + } + if (typeof fontSize === "number" && fontSize > 0) { + result.fontSize = fontSize; + } + break; + case OPS.setFillRGBColor: + ColorSpace.singletons.rgb.getRgbItem(args, 0, result.fontColor, 0); + break; + case OPS.setFillGray: + ColorSpace.singletons.gray.getRgbItem(args, 0, result.fontColor, 0); + break; + case OPS.setFillCMYKColor: + ColorSpace.singletons.cmyk.getRgbItem(args, 0, result.fontColor, 0); + break; + } + } + } catch (reason) { + warn(`parseDefaultAppearance - ignoring errors: "${reason}".`); + } + return result; + } +} +function parseDefaultAppearance(str) { + return new DefaultAppearanceEvaluator(str).parse(); +} +class AppearanceStreamEvaluator extends EvaluatorPreprocessor { + constructor(stream, evaluatorOptions, xref) { + super(stream); + this.stream = stream; + this.evaluatorOptions = evaluatorOptions; + this.xref = xref; + this.resources = stream.dict?.get("Resources"); + } + parse() { + const operation = { + fn: 0, + args: [] + }; + let result = { + scaleFactor: 1, + fontSize: 0, + fontName: "", + fontColor: new Uint8ClampedArray(3), + fillColorSpace: ColorSpace.singletons.gray + }; + let breakLoop = false; + const stack = []; + try { + while (true) { + operation.args.length = 0; + if (breakLoop || !this.read(operation)) { + break; + } + const { + fn, + args + } = operation; + switch (fn | 0) { + case OPS.save: + stack.push({ + scaleFactor: result.scaleFactor, + fontSize: result.fontSize, + fontName: result.fontName, + fontColor: result.fontColor.slice(), + fillColorSpace: result.fillColorSpace + }); + break; + case OPS.restore: + result = stack.pop() || result; + break; + case OPS.setTextMatrix: + result.scaleFactor *= Math.hypot(args[0], args[1]); + break; + case OPS.setFont: + const [fontName, fontSize] = args; + if (fontName instanceof Name) { + result.fontName = fontName.name; + } + if (typeof fontSize === "number" && fontSize > 0) { + result.fontSize = fontSize * result.scaleFactor; + } + break; + case OPS.setFillColorSpace: + result.fillColorSpace = ColorSpace.parse({ + cs: args[0], + xref: this.xref, + resources: this.resources, + pdfFunctionFactory: this._pdfFunctionFactory, + localColorSpaceCache: this._localColorSpaceCache + }); + break; + case OPS.setFillColor: + const cs = result.fillColorSpace; + cs.getRgbItem(args, 0, result.fontColor, 0); + break; + case OPS.setFillRGBColor: + ColorSpace.singletons.rgb.getRgbItem(args, 0, result.fontColor, 0); + break; + case OPS.setFillGray: + ColorSpace.singletons.gray.getRgbItem(args, 0, result.fontColor, 0); + break; + case OPS.setFillCMYKColor: + ColorSpace.singletons.cmyk.getRgbItem(args, 0, result.fontColor, 0); + break; + case OPS.showText: + case OPS.showSpacedText: + case OPS.nextLineShowText: + case OPS.nextLineSetSpacingShowText: + breakLoop = true; + break; + } + } + } catch (reason) { + warn(`parseAppearanceStream - ignoring errors: "${reason}".`); + } + this.stream.reset(); + delete result.scaleFactor; + delete result.fillColorSpace; + return result; + } + get _localColorSpaceCache() { + return shadow(this, "_localColorSpaceCache", new LocalColorSpaceCache()); + } + get _pdfFunctionFactory() { + const pdfFunctionFactory = new PDFFunctionFactory({ + xref: this.xref, + isEvalSupported: this.evaluatorOptions.isEvalSupported + }); + return shadow(this, "_pdfFunctionFactory", pdfFunctionFactory); + } +} +function parseAppearanceStream(stream, evaluatorOptions, xref) { + return new AppearanceStreamEvaluator(stream, evaluatorOptions, xref).parse(); +} +function getPdfColor(color, isFill) { + if (color[0] === color[1] && color[1] === color[2]) { + const gray = color[0] / 255; + return `${numberToString(gray)} ${isFill ? "g" : "G"}`; + } + return Array.from(color, c => numberToString(c / 255)).join(" ") + ` ${isFill ? "rg" : "RG"}`; +} +function createDefaultAppearance({ + fontSize, + fontName, + fontColor +}) { + return `/${escapePDFName(fontName)} ${fontSize} Tf ${getPdfColor(fontColor, true)}`; +} +class FakeUnicodeFont { + constructor(xref, fontFamily) { + this.xref = xref; + this.widths = null; + this.firstChar = Infinity; + this.lastChar = -Infinity; + this.fontFamily = fontFamily; + const canvas = new OffscreenCanvas(1, 1); + this.ctxMeasure = canvas.getContext("2d"); + if (!FakeUnicodeFont._fontNameId) { + FakeUnicodeFont._fontNameId = 1; + } + this.fontName = Name.get(`InvalidPDFjsFont_${fontFamily}_${FakeUnicodeFont._fontNameId++}`); + } + get toUnicodeRef() { + if (!FakeUnicodeFont._toUnicodeRef) { + const toUnicode = `/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (Adobe) +/Ordering (UCS) /Supplement 0 >> def +/CMapName /Adobe-Identity-UCS def +/CMapType 2 def +1 begincodespacerange +<0000> <FFFF> +endcodespacerange +1 beginbfrange +<0000> <FFFF> <0000> +endbfrange +endcmap CMapName currentdict /CMap defineresource pop end end`; + const toUnicodeStream = FakeUnicodeFont.toUnicodeStream = new StringStream(toUnicode); + const toUnicodeDict = new Dict(this.xref); + toUnicodeStream.dict = toUnicodeDict; + toUnicodeDict.set("Length", toUnicode.length); + FakeUnicodeFont._toUnicodeRef = this.xref.getNewPersistentRef(toUnicodeStream); + } + return FakeUnicodeFont._toUnicodeRef; + } + get fontDescriptorRef() { + if (!FakeUnicodeFont._fontDescriptorRef) { + const fontDescriptor = new Dict(this.xref); + fontDescriptor.set("Type", Name.get("FontDescriptor")); + fontDescriptor.set("FontName", this.fontName); + fontDescriptor.set("FontFamily", "MyriadPro Regular"); + fontDescriptor.set("FontBBox", [0, 0, 0, 0]); + fontDescriptor.set("FontStretch", Name.get("Normal")); + fontDescriptor.set("FontWeight", 400); + fontDescriptor.set("ItalicAngle", 0); + FakeUnicodeFont._fontDescriptorRef = this.xref.getNewPersistentRef(fontDescriptor); + } + return FakeUnicodeFont._fontDescriptorRef; + } + get descendantFontRef() { + const descendantFont = new Dict(this.xref); + descendantFont.set("BaseFont", this.fontName); + descendantFont.set("Type", Name.get("Font")); + descendantFont.set("Subtype", Name.get("CIDFontType0")); + descendantFont.set("CIDToGIDMap", Name.get("Identity")); + descendantFont.set("FirstChar", this.firstChar); + descendantFont.set("LastChar", this.lastChar); + descendantFont.set("FontDescriptor", this.fontDescriptorRef); + descendantFont.set("DW", 1000); + const widths = []; + const chars = [...this.widths.entries()].sort(); + let currentChar = null; + let currentWidths = null; + for (const [char, width] of chars) { + if (!currentChar) { + currentChar = char; + currentWidths = [width]; + continue; + } + if (char === currentChar + currentWidths.length) { + currentWidths.push(width); + } else { + widths.push(currentChar, currentWidths); + currentChar = char; + currentWidths = [width]; + } + } + if (currentChar) { + widths.push(currentChar, currentWidths); + } + descendantFont.set("W", widths); + const cidSystemInfo = new Dict(this.xref); + cidSystemInfo.set("Ordering", "Identity"); + cidSystemInfo.set("Registry", "Adobe"); + cidSystemInfo.set("Supplement", 0); + descendantFont.set("CIDSystemInfo", cidSystemInfo); + return this.xref.getNewPersistentRef(descendantFont); + } + get baseFontRef() { + const baseFont = new Dict(this.xref); + baseFont.set("BaseFont", this.fontName); + baseFont.set("Type", Name.get("Font")); + baseFont.set("Subtype", Name.get("Type0")); + baseFont.set("Encoding", Name.get("Identity-H")); + baseFont.set("DescendantFonts", [this.descendantFontRef]); + baseFont.set("ToUnicode", this.toUnicodeRef); + return this.xref.getNewPersistentRef(baseFont); + } + get resources() { + const resources = new Dict(this.xref); + const font = new Dict(this.xref); + font.set(this.fontName.name, this.baseFontRef); + resources.set("Font", font); + return resources; + } + _createContext() { + this.widths = new Map(); + this.ctxMeasure.font = `1000px ${this.fontFamily}`; + return this.ctxMeasure; + } + createFontResources(text) { + const ctx = this._createContext(); + for (const line of text.split(/\r\n?|\n/)) { + for (const char of line.split("")) { + const code = char.charCodeAt(0); + if (this.widths.has(code)) { + continue; + } + const metrics = ctx.measureText(char); + const width = Math.ceil(metrics.width); + this.widths.set(code, width); + this.firstChar = Math.min(code, this.firstChar); + this.lastChar = Math.max(code, this.lastChar); + } + } + return this.resources; + } + createAppearance(text, rect, rotation, fontSize, bgColor, strokeAlpha) { + const ctx = this._createContext(); + const lines = []; + let maxWidth = -Infinity; + for (const line of text.split(/\r\n?|\n/)) { + lines.push(line); + const lineWidth = ctx.measureText(line).width; + maxWidth = Math.max(maxWidth, lineWidth); + for (const char of line.split("")) { + const code = char.charCodeAt(0); + let width = this.widths.get(code); + if (width === undefined) { + const metrics = ctx.measureText(char); + width = Math.ceil(metrics.width); + this.widths.set(code, width); + this.firstChar = Math.min(code, this.firstChar); + this.lastChar = Math.max(code, this.lastChar); + } + } + } + maxWidth *= fontSize / 1000; + const [x1, y1, x2, y2] = rect; + let w = x2 - x1; + let h = y2 - y1; + if (rotation % 180 !== 0) { + [w, h] = [h, w]; + } + let hscale = 1; + if (maxWidth > w) { + hscale = w / maxWidth; + } + let vscale = 1; + const lineHeight = LINE_FACTOR * fontSize; + const lineDescent = LINE_DESCENT_FACTOR * fontSize; + const maxHeight = lineHeight * lines.length; + if (maxHeight > h) { + vscale = h / maxHeight; + } + const fscale = Math.min(hscale, vscale); + const newFontSize = fontSize * fscale; + const buffer = ["q", `0 0 ${numberToString(w)} ${numberToString(h)} re W n`, `BT`, `1 0 0 1 0 ${numberToString(h + lineDescent)} Tm 0 Tc ${getPdfColor(bgColor, true)}`, `/${this.fontName.name} ${numberToString(newFontSize)} Tf`]; + const { + resources + } = this; + strokeAlpha = typeof strokeAlpha === "number" && strokeAlpha >= 0 && strokeAlpha <= 1 ? strokeAlpha : 1; + if (strokeAlpha !== 1) { + buffer.push("/R0 gs"); + const extGState = new Dict(this.xref); + const r0 = new Dict(this.xref); + r0.set("ca", strokeAlpha); + r0.set("CA", strokeAlpha); + r0.set("Type", Name.get("ExtGState")); + extGState.set("R0", r0); + resources.set("ExtGState", extGState); + } + const vShift = numberToString(lineHeight); + for (const line of lines) { + buffer.push(`0 -${vShift} Td <${stringToUTF16HexString(line)}> Tj`); + } + buffer.push("ET", "Q"); + const appearance = buffer.join("\n"); + const appearanceStreamDict = new Dict(this.xref); + appearanceStreamDict.set("Subtype", Name.get("Form")); + appearanceStreamDict.set("Type", Name.get("XObject")); + appearanceStreamDict.set("BBox", [0, 0, w, h]); + appearanceStreamDict.set("Length", appearance.length); + appearanceStreamDict.set("Resources", resources); + if (rotation) { + const matrix = getRotationMatrix(rotation, w, h); + appearanceStreamDict.set("Matrix", matrix); + } + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; + } +} + +;// CONCATENATED MODULE: ./src/core/name_number_tree.js + + +class NameOrNumberTree { + constructor(root, xref, type) { + if (this.constructor === NameOrNumberTree) { + unreachable("Cannot initialize NameOrNumberTree."); + } + this.root = root; + this.xref = xref; + this._type = type; + } + getAll() { + const map = new Map(); + if (!this.root) { + return map; + } + const xref = this.xref; + const processed = new RefSet(); + processed.put(this.root); + const queue = [this.root]; + while (queue.length > 0) { + const obj = xref.fetchIfRef(queue.shift()); + if (!(obj instanceof Dict)) { + continue; + } + if (obj.has("Kids")) { + const kids = obj.get("Kids"); + if (!Array.isArray(kids)) { + continue; + } + for (const kid of kids) { + if (processed.has(kid)) { + throw new FormatError(`Duplicate entry in "${this._type}" tree.`); + } + queue.push(kid); + processed.put(kid); + } + continue; + } + const entries = obj.get(this._type); + if (!Array.isArray(entries)) { + continue; + } + for (let i = 0, ii = entries.length; i < ii; i += 2) { + map.set(xref.fetchIfRef(entries[i]), xref.fetchIfRef(entries[i + 1])); + } + } + return map; + } + get(key) { + if (!this.root) { + return null; + } + const xref = this.xref; + let kidsOrEntries = xref.fetchIfRef(this.root); + let loopCount = 0; + const MAX_LEVELS = 10; + while (kidsOrEntries.has("Kids")) { + if (++loopCount > MAX_LEVELS) { + warn(`Search depth limit reached for "${this._type}" tree.`); + return null; + } + const kids = kidsOrEntries.get("Kids"); + if (!Array.isArray(kids)) { + return null; + } + let l = 0, + r = kids.length - 1; + while (l <= r) { + const m = l + r >> 1; + const kid = xref.fetchIfRef(kids[m]); + const limits = kid.get("Limits"); + if (key < xref.fetchIfRef(limits[0])) { + r = m - 1; + } else if (key > xref.fetchIfRef(limits[1])) { + l = m + 1; + } else { + kidsOrEntries = kid; + break; + } + } + if (l > r) { + return null; + } + } + const entries = kidsOrEntries.get(this._type); + if (Array.isArray(entries)) { + let l = 0, + r = entries.length - 2; + while (l <= r) { + const tmp = l + r >> 1, + m = tmp + (tmp & 1); + const currentKey = xref.fetchIfRef(entries[m]); + if (key < currentKey) { + r = m - 2; + } else if (key > currentKey) { + l = m + 2; + } else { + return xref.fetchIfRef(entries[m + 1]); + } + } + } + return null; + } +} +class NameTree extends NameOrNumberTree { + constructor(root, xref) { + super(root, xref, "Names"); + } +} +class NumberTree extends NameOrNumberTree { + constructor(root, xref) { + super(root, xref, "Nums"); + } +} + +;// CONCATENATED MODULE: ./src/core/cleanup_helper.js + + + +function clearGlobalCaches() { + clearPatternCaches(); + clearPrimitiveCaches(); + clearUnicodeCaches(); +} + +;// CONCATENATED MODULE: ./src/core/file_spec.js + + + +function pickPlatformItem(dict) { + if (dict.has("UF")) { + return dict.get("UF"); + } else if (dict.has("F")) { + return dict.get("F"); + } else if (dict.has("Unix")) { + return dict.get("Unix"); + } else if (dict.has("Mac")) { + return dict.get("Mac"); + } else if (dict.has("DOS")) { + return dict.get("DOS"); + } + return null; +} +class FileSpec { + constructor(root, xref) { + if (!(root instanceof Dict)) { + return; + } + this.xref = xref; + this.root = root; + if (root.has("FS")) { + this.fs = root.get("FS"); + } + this.description = root.has("Desc") ? stringToPDFString(root.get("Desc")) : ""; + if (root.has("RF")) { + warn("Related file specifications are not supported"); + } + this.contentAvailable = true; + if (!root.has("EF")) { + this.contentAvailable = false; + warn("Non-embedded file specifications are not supported"); + } + } + get filename() { + if (!this._filename && this.root) { + const filename = pickPlatformItem(this.root) || "unnamed"; + this._filename = stringToPDFString(filename).replaceAll("\\\\", "\\").replaceAll("\\/", "/").replaceAll("\\", "/"); + } + return this._filename; + } + get content() { + if (!this.contentAvailable) { + return null; + } + if (!this.contentRef && this.root) { + this.contentRef = pickPlatformItem(this.root.get("EF")); + } + let content = null; + if (this.contentRef) { + const fileObj = this.xref.fetchIfRef(this.contentRef); + if (fileObj instanceof BaseStream) { + content = fileObj.getBytes(); + } else { + warn("Embedded file specification points to non-existing/invalid content"); + } + } else { + warn("Embedded file specification does not have a content"); + } + return content; + } + get serializable() { + return { + filename: this.filename, + content: this.content + }; + } +} + +;// CONCATENATED MODULE: ./src/core/xml_parser.js + +const XMLParserErrorCode = { + NoError: 0, + EndOfDocument: -1, + UnterminatedCdat: -2, + UnterminatedXmlDeclaration: -3, + UnterminatedDoctypeDeclaration: -4, + UnterminatedComment: -5, + MalformedElement: -6, + OutOfMemory: -7, + UnterminatedAttributeValue: -8, + UnterminatedElement: -9, + ElementNeverBegun: -10 +}; +function isWhitespace(s, index) { + const ch = s[index]; + return ch === " " || ch === "\n" || ch === "\r" || ch === "\t"; +} +function isWhitespaceString(s) { + for (let i = 0, ii = s.length; i < ii; i++) { + if (!isWhitespace(s, i)) { + return false; + } + } + return true; +} +class XMLParserBase { + _resolveEntities(s) { + return s.replaceAll(/&([^;]+);/g, (all, entity) => { + if (entity.substring(0, 2) === "#x") { + return String.fromCodePoint(parseInt(entity.substring(2), 16)); + } else if (entity.substring(0, 1) === "#") { + return String.fromCodePoint(parseInt(entity.substring(1), 10)); + } + switch (entity) { + case "lt": + return "<"; + case "gt": + return ">"; + case "amp": + return "&"; + case "quot": + return '"'; + case "apos": + return "'"; + } + return this.onResolveEntity(entity); + }); + } + _parseContent(s, start) { + const attributes = []; + let pos = start; + function skipWs() { + while (pos < s.length && isWhitespace(s, pos)) { + ++pos; + } + } + while (pos < s.length && !isWhitespace(s, pos) && s[pos] !== ">" && s[pos] !== "/") { + ++pos; + } + const name = s.substring(start, pos); + skipWs(); + while (pos < s.length && s[pos] !== ">" && s[pos] !== "/" && s[pos] !== "?") { + skipWs(); + let attrName = "", + attrValue = ""; + while (pos < s.length && !isWhitespace(s, pos) && s[pos] !== "=") { + attrName += s[pos]; + ++pos; + } + skipWs(); + if (s[pos] !== "=") { + return null; + } + ++pos; + skipWs(); + const attrEndChar = s[pos]; + if (attrEndChar !== '"' && attrEndChar !== "'") { + return null; + } + const attrEndIndex = s.indexOf(attrEndChar, ++pos); + if (attrEndIndex < 0) { + return null; + } + attrValue = s.substring(pos, attrEndIndex); + attributes.push({ + name: attrName, + value: this._resolveEntities(attrValue) + }); + pos = attrEndIndex + 1; + skipWs(); + } + return { + name, + attributes, + parsed: pos - start + }; + } + _parseProcessingInstruction(s, start) { + let pos = start; + function skipWs() { + while (pos < s.length && isWhitespace(s, pos)) { + ++pos; + } + } + while (pos < s.length && !isWhitespace(s, pos) && s[pos] !== ">" && s[pos] !== "?" && s[pos] !== "/") { + ++pos; + } + const name = s.substring(start, pos); + skipWs(); + const attrStart = pos; + while (pos < s.length && (s[pos] !== "?" || s[pos + 1] !== ">")) { + ++pos; + } + const value = s.substring(attrStart, pos); + return { + name, + value, + parsed: pos - start + }; + } + parseXml(s) { + let i = 0; + while (i < s.length) { + const ch = s[i]; + let j = i; + if (ch === "<") { + ++j; + const ch2 = s[j]; + let q; + switch (ch2) { + case "/": + ++j; + q = s.indexOf(">", j); + if (q < 0) { + this.onError(XMLParserErrorCode.UnterminatedElement); + return; + } + this.onEndElement(s.substring(j, q)); + j = q + 1; + break; + case "?": + ++j; + const pi = this._parseProcessingInstruction(s, j); + if (s.substring(j + pi.parsed, j + pi.parsed + 2) !== "?>") { + this.onError(XMLParserErrorCode.UnterminatedXmlDeclaration); + return; + } + this.onPi(pi.name, pi.value); + j += pi.parsed + 2; + break; + case "!": + if (s.substring(j + 1, j + 3) === "--") { + q = s.indexOf("-->", j + 3); + if (q < 0) { + this.onError(XMLParserErrorCode.UnterminatedComment); + return; + } + this.onComment(s.substring(j + 3, q)); + j = q + 3; + } else if (s.substring(j + 1, j + 8) === "[CDATA[") { + q = s.indexOf("]]>", j + 8); + if (q < 0) { + this.onError(XMLParserErrorCode.UnterminatedCdat); + return; + } + this.onCdata(s.substring(j + 8, q)); + j = q + 3; + } else if (s.substring(j + 1, j + 8) === "DOCTYPE") { + const q2 = s.indexOf("[", j + 8); + let complexDoctype = false; + q = s.indexOf(">", j + 8); + if (q < 0) { + this.onError(XMLParserErrorCode.UnterminatedDoctypeDeclaration); + return; + } + if (q2 > 0 && q > q2) { + q = s.indexOf("]>", j + 8); + if (q < 0) { + this.onError(XMLParserErrorCode.UnterminatedDoctypeDeclaration); + return; + } + complexDoctype = true; + } + const doctypeContent = s.substring(j + 8, q + (complexDoctype ? 1 : 0)); + this.onDoctype(doctypeContent); + j = q + (complexDoctype ? 2 : 1); + } else { + this.onError(XMLParserErrorCode.MalformedElement); + return; + } + break; + default: + const content = this._parseContent(s, j); + if (content === null) { + this.onError(XMLParserErrorCode.MalformedElement); + return; + } + let isClosed = false; + if (s.substring(j + content.parsed, j + content.parsed + 2) === "/>") { + isClosed = true; + } else if (s.substring(j + content.parsed, j + content.parsed + 1) !== ">") { + this.onError(XMLParserErrorCode.UnterminatedElement); + return; + } + this.onBeginElement(content.name, content.attributes, isClosed); + j += content.parsed + (isClosed ? 2 : 1); + break; + } + } else { + while (j < s.length && s[j] !== "<") { + j++; + } + const text = s.substring(i, j); + this.onText(this._resolveEntities(text)); + } + i = j; + } + } + onResolveEntity(name) { + return `&${name};`; + } + onPi(name, value) {} + onComment(text) {} + onCdata(text) {} + onDoctype(doctypeContent) {} + onText(text) {} + onBeginElement(name, attributes, isEmpty) {} + onEndElement(name) {} + onError(code) {} +} +class SimpleDOMNode { + constructor(nodeName, nodeValue) { + this.nodeName = nodeName; + this.nodeValue = nodeValue; + Object.defineProperty(this, "parentNode", { + value: null, + writable: true + }); + } + get firstChild() { + return this.childNodes?.[0]; + } + get nextSibling() { + const childNodes = this.parentNode.childNodes; + if (!childNodes) { + return undefined; + } + const index = childNodes.indexOf(this); + if (index === -1) { + return undefined; + } + return childNodes[index + 1]; + } + get textContent() { + if (!this.childNodes) { + return this.nodeValue || ""; + } + return this.childNodes.map(function (child) { + return child.textContent; + }).join(""); + } + get children() { + return this.childNodes || []; + } + hasChildNodes() { + return this.childNodes?.length > 0; + } + searchNode(paths, pos) { + if (pos >= paths.length) { + return this; + } + const component = paths[pos]; + if (component.name.startsWith("#") && pos < paths.length - 1) { + return this.searchNode(paths, pos + 1); + } + const stack = []; + let node = this; + while (true) { + if (component.name === node.nodeName) { + if (component.pos === 0) { + const res = node.searchNode(paths, pos + 1); + if (res !== null) { + return res; + } + } else if (stack.length === 0) { + return null; + } else { + const [parent] = stack.pop(); + let siblingPos = 0; + for (const child of parent.childNodes) { + if (component.name === child.nodeName) { + if (siblingPos === component.pos) { + return child.searchNode(paths, pos + 1); + } + siblingPos++; + } + } + return node.searchNode(paths, pos + 1); + } + } + if (node.childNodes?.length > 0) { + stack.push([node, 0]); + node = node.childNodes[0]; + } else if (stack.length === 0) { + return null; + } else { + while (stack.length !== 0) { + const [parent, currentPos] = stack.pop(); + const newPos = currentPos + 1; + if (newPos < parent.childNodes.length) { + stack.push([parent, newPos]); + node = parent.childNodes[newPos]; + break; + } + } + if (stack.length === 0) { + return null; + } + } + } + } + dump(buffer) { + if (this.nodeName === "#text") { + buffer.push(encodeToXmlString(this.nodeValue)); + return; + } + buffer.push(`<${this.nodeName}`); + if (this.attributes) { + for (const attribute of this.attributes) { + buffer.push(` ${attribute.name}="${encodeToXmlString(attribute.value)}"`); + } + } + if (this.hasChildNodes()) { + buffer.push(">"); + for (const child of this.childNodes) { + child.dump(buffer); + } + buffer.push(`</${this.nodeName}>`); + } else if (this.nodeValue) { + buffer.push(`>${encodeToXmlString(this.nodeValue)}</${this.nodeName}>`); + } else { + buffer.push("/>"); + } + } +} +class SimpleXMLParser extends XMLParserBase { + constructor({ + hasAttributes = false, + lowerCaseName = false + }) { + super(); + this._currentFragment = null; + this._stack = null; + this._errorCode = XMLParserErrorCode.NoError; + this._hasAttributes = hasAttributes; + this._lowerCaseName = lowerCaseName; + } + parseFromString(data) { + this._currentFragment = []; + this._stack = []; + this._errorCode = XMLParserErrorCode.NoError; + this.parseXml(data); + if (this._errorCode !== XMLParserErrorCode.NoError) { + return undefined; + } + const [documentElement] = this._currentFragment; + if (!documentElement) { + return undefined; + } + return { + documentElement + }; + } + onText(text) { + if (isWhitespaceString(text)) { + return; + } + const node = new SimpleDOMNode("#text", text); + this._currentFragment.push(node); + } + onCdata(text) { + const node = new SimpleDOMNode("#text", text); + this._currentFragment.push(node); + } + onBeginElement(name, attributes, isEmpty) { + if (this._lowerCaseName) { + name = name.toLowerCase(); + } + const node = new SimpleDOMNode(name); + node.childNodes = []; + if (this._hasAttributes) { + node.attributes = attributes; + } + this._currentFragment.push(node); + if (isEmpty) { + return; + } + this._stack.push(this._currentFragment); + this._currentFragment = node.childNodes; + } + onEndElement(name) { + this._currentFragment = this._stack.pop() || []; + const lastElement = this._currentFragment.at(-1); + if (!lastElement) { + return null; + } + for (const childNode of lastElement.childNodes) { + childNode.parentNode = lastElement; + } + return lastElement; + } + onError(code) { + this._errorCode = code; + } +} + +;// CONCATENATED MODULE: ./src/core/metadata_parser.js + +class MetadataParser { + constructor(data) { + data = this._repair(data); + const parser = new SimpleXMLParser({ + lowerCaseName: true + }); + const xmlDocument = parser.parseFromString(data); + this._metadataMap = new Map(); + this._data = data; + if (xmlDocument) { + this._parse(xmlDocument); + } + } + _repair(data) { + return data.replace(/^[^<]+/, "").replaceAll(/>\\376\\377([^<]+)/g, function (all, codes) { + const bytes = codes.replaceAll(/\\([0-3])([0-7])([0-7])/g, function (code, d1, d2, d3) { + return String.fromCharCode(d1 * 64 + d2 * 8 + d3 * 1); + }).replaceAll(/&(amp|apos|gt|lt|quot);/g, function (str, name) { + switch (name) { + case "amp": + return "&"; + case "apos": + return "'"; + case "gt": + return ">"; + case "lt": + return "<"; + case "quot": + return '"'; + } + throw new Error(`_repair: ${name} isn't defined.`); + }); + const charBuf = [">"]; + for (let i = 0, ii = bytes.length; i < ii; i += 2) { + const code = bytes.charCodeAt(i) * 256 + bytes.charCodeAt(i + 1); + if (code >= 32 && code < 127 && code !== 60 && code !== 62 && code !== 38) { + charBuf.push(String.fromCharCode(code)); + } else { + charBuf.push("&#x" + (0x10000 + code).toString(16).substring(1) + ";"); + } + } + return charBuf.join(""); + }); + } + _getSequence(entry) { + const name = entry.nodeName; + if (name !== "rdf:bag" && name !== "rdf:seq" && name !== "rdf:alt") { + return null; + } + return entry.childNodes.filter(node => node.nodeName === "rdf:li"); + } + _parseArray(entry) { + if (!entry.hasChildNodes()) { + return; + } + const [seqNode] = entry.childNodes; + const sequence = this._getSequence(seqNode) || []; + this._metadataMap.set(entry.nodeName, sequence.map(node => node.textContent.trim())); + } + _parse(xmlDocument) { + let rdf = xmlDocument.documentElement; + if (rdf.nodeName !== "rdf:rdf") { + rdf = rdf.firstChild; + while (rdf && rdf.nodeName !== "rdf:rdf") { + rdf = rdf.nextSibling; + } + } + if (!rdf || rdf.nodeName !== "rdf:rdf" || !rdf.hasChildNodes()) { + return; + } + for (const desc of rdf.childNodes) { + if (desc.nodeName !== "rdf:description") { + continue; + } + for (const entry of desc.childNodes) { + const name = entry.nodeName; + switch (name) { + case "#text": + continue; + case "dc:creator": + case "dc:subject": + this._parseArray(entry); + continue; + } + this._metadataMap.set(name, entry.textContent.trim()); + } + } + } + get serializable() { + return { + parsedData: this._metadataMap, + rawData: this._data + }; + } +} + +;// CONCATENATED MODULE: ./src/core/decrypt_stream.js + +const chunkSize = 512; +class DecryptStream extends DecodeStream { + constructor(str, maybeLength, decrypt) { + super(maybeLength); + this.str = str; + this.dict = str.dict; + this.decrypt = decrypt; + this.nextChunk = null; + this.initialized = false; + } + readBlock() { + let chunk; + if (this.initialized) { + chunk = this.nextChunk; + } else { + chunk = this.str.getBytes(chunkSize); + this.initialized = true; + } + if (!chunk || chunk.length === 0) { + this.eof = true; + return; + } + this.nextChunk = this.str.getBytes(chunkSize); + const hasMoreData = this.nextChunk?.length > 0; + const decrypt = this.decrypt; + chunk = decrypt(chunk, !hasMoreData); + const bufferLength = this.bufferLength, + newLength = bufferLength + chunk.length, + buffer = this.ensureBuffer(newLength); + buffer.set(chunk, bufferLength); + this.bufferLength = newLength; + } +} + +;// CONCATENATED MODULE: ./src/core/crypto.js + + + +class ARCFourCipher { + constructor(key) { + this.a = 0; + this.b = 0; + const s = new Uint8Array(256); + const keyLength = key.length; + for (let i = 0; i < 256; ++i) { + s[i] = i; + } + for (let i = 0, j = 0; i < 256; ++i) { + const tmp = s[i]; + j = j + tmp + key[i % keyLength] & 0xff; + s[i] = s[j]; + s[j] = tmp; + } + this.s = s; + } + encryptBlock(data) { + let a = this.a, + b = this.b; + const s = this.s; + const n = data.length; + const output = new Uint8Array(n); + for (let i = 0; i < n; ++i) { + a = a + 1 & 0xff; + const tmp = s[a]; + b = b + tmp & 0xff; + const tmp2 = s[b]; + s[a] = tmp2; + s[b] = tmp; + output[i] = data[i] ^ s[tmp + tmp2 & 0xff]; + } + this.a = a; + this.b = b; + return output; + } + decryptBlock(data) { + return this.encryptBlock(data); + } + encrypt(data) { + return this.encryptBlock(data); + } +} +const calculateMD5 = function calculateMD5Closure() { + const r = new Uint8Array([7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21]); + const k = new Int32Array([-680876936, -389564586, 606105819, -1044525330, -176418897, 1200080426, -1473231341, -45705983, 1770035416, -1958414417, -42063, -1990404162, 1804603682, -40341101, -1502002290, 1236535329, -165796510, -1069501632, 643717713, -373897302, -701558691, 38016083, -660478335, -405537848, 568446438, -1019803690, -187363961, 1163531501, -1444681467, -51403784, 1735328473, -1926607734, -378558, -2022574463, 1839030562, -35309556, -1530992060, 1272893353, -155497632, -1094730640, 681279174, -358537222, -722521979, 76029189, -640364487, -421815835, 530742520, -995338651, -198630844, 1126891415, -1416354905, -57434055, 1700485571, -1894986606, -1051523, -2054922799, 1873313359, -30611744, -1560198380, 1309151649, -145523070, -1120210379, 718787259, -343485551]); + function hash(data, offset, length) { + let h0 = 1732584193, + h1 = -271733879, + h2 = -1732584194, + h3 = 271733878; + const paddedLength = length + 72 & ~63; + const padded = new Uint8Array(paddedLength); + let i, j; + for (i = 0; i < length; ++i) { + padded[i] = data[offset++]; + } + padded[i++] = 0x80; + const n = paddedLength - 8; + while (i < n) { + padded[i++] = 0; + } + padded[i++] = length << 3 & 0xff; + padded[i++] = length >> 5 & 0xff; + padded[i++] = length >> 13 & 0xff; + padded[i++] = length >> 21 & 0xff; + padded[i++] = length >>> 29 & 0xff; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + const w = new Int32Array(16); + for (i = 0; i < paddedLength;) { + for (j = 0; j < 16; ++j, i += 4) { + w[j] = padded[i] | padded[i + 1] << 8 | padded[i + 2] << 16 | padded[i + 3] << 24; + } + let a = h0, + b = h1, + c = h2, + d = h3, + f, + g; + for (j = 0; j < 64; ++j) { + if (j < 16) { + f = b & c | ~b & d; + g = j; + } else if (j < 32) { + f = d & b | ~d & c; + g = 5 * j + 1 & 15; + } else if (j < 48) { + f = b ^ c ^ d; + g = 3 * j + 5 & 15; + } else { + f = c ^ (b | ~d); + g = 7 * j & 15; + } + const tmp = d, + rotateArg = a + f + k[j] + w[g] | 0, + rotate = r[j]; + d = c; + c = b; + b = b + (rotateArg << rotate | rotateArg >>> 32 - rotate) | 0; + a = tmp; + } + h0 = h0 + a | 0; + h1 = h1 + b | 0; + h2 = h2 + c | 0; + h3 = h3 + d | 0; + } + return new Uint8Array([h0 & 0xFF, h0 >> 8 & 0xFF, h0 >> 16 & 0xFF, h0 >>> 24 & 0xFF, h1 & 0xFF, h1 >> 8 & 0xFF, h1 >> 16 & 0xFF, h1 >>> 24 & 0xFF, h2 & 0xFF, h2 >> 8 & 0xFF, h2 >> 16 & 0xFF, h2 >>> 24 & 0xFF, h3 & 0xFF, h3 >> 8 & 0xFF, h3 >> 16 & 0xFF, h3 >>> 24 & 0xFF]); + } + return hash; +}(); +class Word64 { + constructor(highInteger, lowInteger) { + this.high = highInteger | 0; + this.low = lowInteger | 0; + } + and(word) { + this.high &= word.high; + this.low &= word.low; + } + xor(word) { + this.high ^= word.high; + this.low ^= word.low; + } + or(word) { + this.high |= word.high; + this.low |= word.low; + } + shiftRight(places) { + if (places >= 32) { + this.low = this.high >>> places - 32 | 0; + this.high = 0; + } else { + this.low = this.low >>> places | this.high << 32 - places; + this.high = this.high >>> places | 0; + } + } + shiftLeft(places) { + if (places >= 32) { + this.high = this.low << places - 32; + this.low = 0; + } else { + this.high = this.high << places | this.low >>> 32 - places; + this.low <<= places; + } + } + rotateRight(places) { + let low, high; + if (places & 32) { + high = this.low; + low = this.high; + } else { + low = this.low; + high = this.high; + } + places &= 31; + this.low = low >>> places | high << 32 - places; + this.high = high >>> places | low << 32 - places; + } + not() { + this.high = ~this.high; + this.low = ~this.low; + } + add(word) { + const lowAdd = (this.low >>> 0) + (word.low >>> 0); + let highAdd = (this.high >>> 0) + (word.high >>> 0); + if (lowAdd > 0xffffffff) { + highAdd += 1; + } + this.low = lowAdd | 0; + this.high = highAdd | 0; + } + copyTo(bytes, offset) { + bytes[offset] = this.high >>> 24 & 0xff; + bytes[offset + 1] = this.high >> 16 & 0xff; + bytes[offset + 2] = this.high >> 8 & 0xff; + bytes[offset + 3] = this.high & 0xff; + bytes[offset + 4] = this.low >>> 24 & 0xff; + bytes[offset + 5] = this.low >> 16 & 0xff; + bytes[offset + 6] = this.low >> 8 & 0xff; + bytes[offset + 7] = this.low & 0xff; + } + assign(word) { + this.high = word.high; + this.low = word.low; + } +} +const calculateSHA256 = function calculateSHA256Closure() { + function rotr(x, n) { + return x >>> n | x << 32 - n; + } + function ch(x, y, z) { + return x & y ^ ~x & z; + } + function maj(x, y, z) { + return x & y ^ x & z ^ y & z; + } + function sigma(x) { + return rotr(x, 2) ^ rotr(x, 13) ^ rotr(x, 22); + } + function sigmaPrime(x) { + return rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25); + } + function littleSigma(x) { + return rotr(x, 7) ^ rotr(x, 18) ^ x >>> 3; + } + function littleSigmaPrime(x) { + return rotr(x, 17) ^ rotr(x, 19) ^ x >>> 10; + } + const k = [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2]; + function hash(data, offset, length) { + let h0 = 0x6a09e667, + h1 = 0xbb67ae85, + h2 = 0x3c6ef372, + h3 = 0xa54ff53a, + h4 = 0x510e527f, + h5 = 0x9b05688c, + h6 = 0x1f83d9ab, + h7 = 0x5be0cd19; + const paddedLength = Math.ceil((length + 9) / 64) * 64; + const padded = new Uint8Array(paddedLength); + let i, j; + for (i = 0; i < length; ++i) { + padded[i] = data[offset++]; + } + padded[i++] = 0x80; + const n = paddedLength - 8; + while (i < n) { + padded[i++] = 0; + } + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = length >>> 29 & 0xff; + padded[i++] = length >> 21 & 0xff; + padded[i++] = length >> 13 & 0xff; + padded[i++] = length >> 5 & 0xff; + padded[i++] = length << 3 & 0xff; + const w = new Uint32Array(64); + for (i = 0; i < paddedLength;) { + for (j = 0; j < 16; ++j) { + w[j] = padded[i] << 24 | padded[i + 1] << 16 | padded[i + 2] << 8 | padded[i + 3]; + i += 4; + } + for (j = 16; j < 64; ++j) { + w[j] = littleSigmaPrime(w[j - 2]) + w[j - 7] + littleSigma(w[j - 15]) + w[j - 16] | 0; + } + let a = h0, + b = h1, + c = h2, + d = h3, + e = h4, + f = h5, + g = h6, + h = h7, + t1, + t2; + for (j = 0; j < 64; ++j) { + t1 = h + sigmaPrime(e) + ch(e, f, g) + k[j] + w[j]; + t2 = sigma(a) + maj(a, b, c); + h = g; + g = f; + f = e; + e = d + t1 | 0; + d = c; + c = b; + b = a; + a = t1 + t2 | 0; + } + h0 = h0 + a | 0; + h1 = h1 + b | 0; + h2 = h2 + c | 0; + h3 = h3 + d | 0; + h4 = h4 + e | 0; + h5 = h5 + f | 0; + h6 = h6 + g | 0; + h7 = h7 + h | 0; + } + return new Uint8Array([h0 >> 24 & 0xFF, h0 >> 16 & 0xFF, h0 >> 8 & 0xFF, h0 & 0xFF, h1 >> 24 & 0xFF, h1 >> 16 & 0xFF, h1 >> 8 & 0xFF, h1 & 0xFF, h2 >> 24 & 0xFF, h2 >> 16 & 0xFF, h2 >> 8 & 0xFF, h2 & 0xFF, h3 >> 24 & 0xFF, h3 >> 16 & 0xFF, h3 >> 8 & 0xFF, h3 & 0xFF, h4 >> 24 & 0xFF, h4 >> 16 & 0xFF, h4 >> 8 & 0xFF, h4 & 0xFF, h5 >> 24 & 0xFF, h5 >> 16 & 0xFF, h5 >> 8 & 0xFF, h5 & 0xFF, h6 >> 24 & 0xFF, h6 >> 16 & 0xFF, h6 >> 8 & 0xFF, h6 & 0xFF, h7 >> 24 & 0xFF, h7 >> 16 & 0xFF, h7 >> 8 & 0xFF, h7 & 0xFF]); + } + return hash; +}(); +const calculateSHA512 = function calculateSHA512Closure() { + function ch(result, x, y, z, tmp) { + result.assign(x); + result.and(y); + tmp.assign(x); + tmp.not(); + tmp.and(z); + result.xor(tmp); + } + function maj(result, x, y, z, tmp) { + result.assign(x); + result.and(y); + tmp.assign(x); + tmp.and(z); + result.xor(tmp); + tmp.assign(y); + tmp.and(z); + result.xor(tmp); + } + function sigma(result, x, tmp) { + result.assign(x); + result.rotateRight(28); + tmp.assign(x); + tmp.rotateRight(34); + result.xor(tmp); + tmp.assign(x); + tmp.rotateRight(39); + result.xor(tmp); + } + function sigmaPrime(result, x, tmp) { + result.assign(x); + result.rotateRight(14); + tmp.assign(x); + tmp.rotateRight(18); + result.xor(tmp); + tmp.assign(x); + tmp.rotateRight(41); + result.xor(tmp); + } + function littleSigma(result, x, tmp) { + result.assign(x); + result.rotateRight(1); + tmp.assign(x); + tmp.rotateRight(8); + result.xor(tmp); + tmp.assign(x); + tmp.shiftRight(7); + result.xor(tmp); + } + function littleSigmaPrime(result, x, tmp) { + result.assign(x); + result.rotateRight(19); + tmp.assign(x); + tmp.rotateRight(61); + result.xor(tmp); + tmp.assign(x); + tmp.shiftRight(6); + result.xor(tmp); + } + const k = [new Word64(0x428a2f98, 0xd728ae22), new Word64(0x71374491, 0x23ef65cd), new Word64(0xb5c0fbcf, 0xec4d3b2f), new Word64(0xe9b5dba5, 0x8189dbbc), new Word64(0x3956c25b, 0xf348b538), new Word64(0x59f111f1, 0xb605d019), new Word64(0x923f82a4, 0xaf194f9b), new Word64(0xab1c5ed5, 0xda6d8118), new Word64(0xd807aa98, 0xa3030242), new Word64(0x12835b01, 0x45706fbe), new Word64(0x243185be, 0x4ee4b28c), new Word64(0x550c7dc3, 0xd5ffb4e2), new Word64(0x72be5d74, 0xf27b896f), new Word64(0x80deb1fe, 0x3b1696b1), new Word64(0x9bdc06a7, 0x25c71235), new Word64(0xc19bf174, 0xcf692694), new Word64(0xe49b69c1, 0x9ef14ad2), new Word64(0xefbe4786, 0x384f25e3), new Word64(0x0fc19dc6, 0x8b8cd5b5), new Word64(0x240ca1cc, 0x77ac9c65), new Word64(0x2de92c6f, 0x592b0275), new Word64(0x4a7484aa, 0x6ea6e483), new Word64(0x5cb0a9dc, 0xbd41fbd4), new Word64(0x76f988da, 0x831153b5), new Word64(0x983e5152, 0xee66dfab), new Word64(0xa831c66d, 0x2db43210), new Word64(0xb00327c8, 0x98fb213f), new Word64(0xbf597fc7, 0xbeef0ee4), new Word64(0xc6e00bf3, 0x3da88fc2), new Word64(0xd5a79147, 0x930aa725), new Word64(0x06ca6351, 0xe003826f), new Word64(0x14292967, 0x0a0e6e70), new Word64(0x27b70a85, 0x46d22ffc), new Word64(0x2e1b2138, 0x5c26c926), new Word64(0x4d2c6dfc, 0x5ac42aed), new Word64(0x53380d13, 0x9d95b3df), new Word64(0x650a7354, 0x8baf63de), new Word64(0x766a0abb, 0x3c77b2a8), new Word64(0x81c2c92e, 0x47edaee6), new Word64(0x92722c85, 0x1482353b), new Word64(0xa2bfe8a1, 0x4cf10364), new Word64(0xa81a664b, 0xbc423001), new Word64(0xc24b8b70, 0xd0f89791), new Word64(0xc76c51a3, 0x0654be30), new Word64(0xd192e819, 0xd6ef5218), new Word64(0xd6990624, 0x5565a910), new Word64(0xf40e3585, 0x5771202a), new Word64(0x106aa070, 0x32bbd1b8), new Word64(0x19a4c116, 0xb8d2d0c8), new Word64(0x1e376c08, 0x5141ab53), new Word64(0x2748774c, 0xdf8eeb99), new Word64(0x34b0bcb5, 0xe19b48a8), new Word64(0x391c0cb3, 0xc5c95a63), new Word64(0x4ed8aa4a, 0xe3418acb), new Word64(0x5b9cca4f, 0x7763e373), new Word64(0x682e6ff3, 0xd6b2b8a3), new Word64(0x748f82ee, 0x5defb2fc), new Word64(0x78a5636f, 0x43172f60), new Word64(0x84c87814, 0xa1f0ab72), new Word64(0x8cc70208, 0x1a6439ec), new Word64(0x90befffa, 0x23631e28), new Word64(0xa4506ceb, 0xde82bde9), new Word64(0xbef9a3f7, 0xb2c67915), new Word64(0xc67178f2, 0xe372532b), new Word64(0xca273ece, 0xea26619c), new Word64(0xd186b8c7, 0x21c0c207), new Word64(0xeada7dd6, 0xcde0eb1e), new Word64(0xf57d4f7f, 0xee6ed178), new Word64(0x06f067aa, 0x72176fba), new Word64(0x0a637dc5, 0xa2c898a6), new Word64(0x113f9804, 0xbef90dae), new Word64(0x1b710b35, 0x131c471b), new Word64(0x28db77f5, 0x23047d84), new Word64(0x32caab7b, 0x40c72493), new Word64(0x3c9ebe0a, 0x15c9bebc), new Word64(0x431d67c4, 0x9c100d4c), new Word64(0x4cc5d4be, 0xcb3e42b6), new Word64(0x597f299c, 0xfc657e2a), new Word64(0x5fcb6fab, 0x3ad6faec), new Word64(0x6c44198c, 0x4a475817)]; + function hash(data, offset, length, mode384 = false) { + let h0, h1, h2, h3, h4, h5, h6, h7; + if (!mode384) { + h0 = new Word64(0x6a09e667, 0xf3bcc908); + h1 = new Word64(0xbb67ae85, 0x84caa73b); + h2 = new Word64(0x3c6ef372, 0xfe94f82b); + h3 = new Word64(0xa54ff53a, 0x5f1d36f1); + h4 = new Word64(0x510e527f, 0xade682d1); + h5 = new Word64(0x9b05688c, 0x2b3e6c1f); + h6 = new Word64(0x1f83d9ab, 0xfb41bd6b); + h7 = new Word64(0x5be0cd19, 0x137e2179); + } else { + h0 = new Word64(0xcbbb9d5d, 0xc1059ed8); + h1 = new Word64(0x629a292a, 0x367cd507); + h2 = new Word64(0x9159015a, 0x3070dd17); + h3 = new Word64(0x152fecd8, 0xf70e5939); + h4 = new Word64(0x67332667, 0xffc00b31); + h5 = new Word64(0x8eb44a87, 0x68581511); + h6 = new Word64(0xdb0c2e0d, 0x64f98fa7); + h7 = new Word64(0x47b5481d, 0xbefa4fa4); + } + const paddedLength = Math.ceil((length + 17) / 128) * 128; + const padded = new Uint8Array(paddedLength); + let i, j; + for (i = 0; i < length; ++i) { + padded[i] = data[offset++]; + } + padded[i++] = 0x80; + const n = paddedLength - 16; + while (i < n) { + padded[i++] = 0; + } + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = 0; + padded[i++] = length >>> 29 & 0xff; + padded[i++] = length >> 21 & 0xff; + padded[i++] = length >> 13 & 0xff; + padded[i++] = length >> 5 & 0xff; + padded[i++] = length << 3 & 0xff; + const w = new Array(80); + for (i = 0; i < 80; i++) { + w[i] = new Word64(0, 0); + } + let a = new Word64(0, 0), + b = new Word64(0, 0), + c = new Word64(0, 0); + let d = new Word64(0, 0), + e = new Word64(0, 0), + f = new Word64(0, 0); + let g = new Word64(0, 0), + h = new Word64(0, 0); + const t1 = new Word64(0, 0), + t2 = new Word64(0, 0); + const tmp1 = new Word64(0, 0), + tmp2 = new Word64(0, 0); + let tmp3; + for (i = 0; i < paddedLength;) { + for (j = 0; j < 16; ++j) { + w[j].high = padded[i] << 24 | padded[i + 1] << 16 | padded[i + 2] << 8 | padded[i + 3]; + w[j].low = padded[i + 4] << 24 | padded[i + 5] << 16 | padded[i + 6] << 8 | padded[i + 7]; + i += 8; + } + for (j = 16; j < 80; ++j) { + tmp3 = w[j]; + littleSigmaPrime(tmp3, w[j - 2], tmp2); + tmp3.add(w[j - 7]); + littleSigma(tmp1, w[j - 15], tmp2); + tmp3.add(tmp1); + tmp3.add(w[j - 16]); + } + a.assign(h0); + b.assign(h1); + c.assign(h2); + d.assign(h3); + e.assign(h4); + f.assign(h5); + g.assign(h6); + h.assign(h7); + for (j = 0; j < 80; ++j) { + t1.assign(h); + sigmaPrime(tmp1, e, tmp2); + t1.add(tmp1); + ch(tmp1, e, f, g, tmp2); + t1.add(tmp1); + t1.add(k[j]); + t1.add(w[j]); + sigma(t2, a, tmp2); + maj(tmp1, a, b, c, tmp2); + t2.add(tmp1); + tmp3 = h; + h = g; + g = f; + f = e; + d.add(t1); + e = d; + d = c; + c = b; + b = a; + tmp3.assign(t1); + tmp3.add(t2); + a = tmp3; + } + h0.add(a); + h1.add(b); + h2.add(c); + h3.add(d); + h4.add(e); + h5.add(f); + h6.add(g); + h7.add(h); + } + let result; + if (!mode384) { + result = new Uint8Array(64); + h0.copyTo(result, 0); + h1.copyTo(result, 8); + h2.copyTo(result, 16); + h3.copyTo(result, 24); + h4.copyTo(result, 32); + h5.copyTo(result, 40); + h6.copyTo(result, 48); + h7.copyTo(result, 56); + } else { + result = new Uint8Array(48); + h0.copyTo(result, 0); + h1.copyTo(result, 8); + h2.copyTo(result, 16); + h3.copyTo(result, 24); + h4.copyTo(result, 32); + h5.copyTo(result, 40); + } + return result; + } + return hash; +}(); +function calculateSHA384(data, offset, length) { + return calculateSHA512(data, offset, length, true); +} +class NullCipher { + decryptBlock(data) { + return data; + } + encrypt(data) { + return data; + } +} +class AESBaseCipher { + constructor() { + if (this.constructor === AESBaseCipher) { + unreachable("Cannot initialize AESBaseCipher."); + } + this._s = new Uint8Array([0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37,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f7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d]); + this._mix = new Uint32Array([0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]); + this._mixCol = new Uint8Array(256); + for (let i = 0; i < 256; i++) { + this._mixCol[i] = i < 128 ? i << 1 : i << 1 ^ 0x1b; + } + this.buffer = new Uint8Array(16); + this.bufferPosition = 0; + } + _expandKey(cipherKey) { + unreachable("Cannot call `_expandKey` on the base class"); + } + _decrypt(input, key) { + let t, u, v; + const state = new Uint8Array(16); + state.set(input); + for (let j = 0, k = this._keySize; j < 16; ++j, ++k) { + state[j] ^= key[k]; + } + for (let i = this._cyclesOfRepetition - 1; i >= 1; --i) { + t = state[13]; + state[13] = state[9]; + state[9] = state[5]; + state[5] = state[1]; + state[1] = t; + t = state[14]; + u = state[10]; + state[14] = state[6]; + state[10] = state[2]; + state[6] = t; + state[2] = u; + t = state[15]; + u = state[11]; + v = state[7]; + state[15] = state[3]; + state[11] = t; + state[7] = u; + state[3] = v; + for (let j = 0; j < 16; ++j) { + state[j] = this._inv_s[state[j]]; + } + for (let j = 0, k = i * 16; j < 16; ++j, ++k) { + state[j] ^= key[k]; + } + for (let j = 0; j < 16; j += 4) { + const s0 = this._mix[state[j]]; + const s1 = this._mix[state[j + 1]]; + const s2 = this._mix[state[j + 2]]; + const s3 = this._mix[state[j + 3]]; + t = s0 ^ s1 >>> 8 ^ s1 << 24 ^ s2 >>> 16 ^ s2 << 16 ^ s3 >>> 24 ^ s3 << 8; + state[j] = t >>> 24 & 0xff; + state[j + 1] = t >> 16 & 0xff; + state[j + 2] = t >> 8 & 0xff; + state[j + 3] = t & 0xff; + } + } + t = state[13]; + state[13] = state[9]; + state[9] = state[5]; + state[5] = state[1]; + state[1] = t; + t = state[14]; + u = state[10]; + state[14] = state[6]; + state[10] = state[2]; + state[6] = t; + state[2] = u; + t = state[15]; + u = state[11]; + v = state[7]; + state[15] = state[3]; + state[11] = t; + state[7] = u; + state[3] = v; + for (let j = 0; j < 16; ++j) { + state[j] = this._inv_s[state[j]]; + state[j] ^= key[j]; + } + return state; + } + _encrypt(input, key) { + const s = this._s; + let t, u, v; + const state = new Uint8Array(16); + state.set(input); + for (let j = 0; j < 16; ++j) { + state[j] ^= key[j]; + } + for (let i = 1; i < this._cyclesOfRepetition; i++) { + for (let j = 0; j < 16; ++j) { + state[j] = s[state[j]]; + } + v = state[1]; + state[1] = state[5]; + state[5] = state[9]; + state[9] = state[13]; + state[13] = v; + v = state[2]; + u = state[6]; + state[2] = state[10]; + state[6] = state[14]; + state[10] = v; + state[14] = u; + v = state[3]; + u = state[7]; + t = state[11]; + state[3] = state[15]; + state[7] = v; + state[11] = u; + state[15] = t; + for (let j = 0; j < 16; j += 4) { + const s0 = state[j + 0]; + const s1 = state[j + 1]; + const s2 = state[j + 2]; + const s3 = state[j + 3]; + t = s0 ^ s1 ^ s2 ^ s3; + state[j + 0] ^= t ^ this._mixCol[s0 ^ s1]; + state[j + 1] ^= t ^ this._mixCol[s1 ^ s2]; + state[j + 2] ^= t ^ this._mixCol[s2 ^ s3]; + state[j + 3] ^= t ^ this._mixCol[s3 ^ s0]; + } + for (let j = 0, k = i * 16; j < 16; ++j, ++k) { + state[j] ^= key[k]; + } + } + for (let j = 0; j < 16; ++j) { + state[j] = s[state[j]]; + } + v = state[1]; + state[1] = state[5]; + state[5] = state[9]; + state[9] = state[13]; + state[13] = v; + v = state[2]; + u = state[6]; + state[2] = state[10]; + state[6] = state[14]; + state[10] = v; + state[14] = u; + v = state[3]; + u = state[7]; + t = state[11]; + state[3] = state[15]; + state[7] = v; + state[11] = u; + state[15] = t; + for (let j = 0, k = this._keySize; j < 16; ++j, ++k) { + state[j] ^= key[k]; + } + return state; + } + _decryptBlock2(data, finalize) { + const sourceLength = data.length; + let buffer = this.buffer, + bufferLength = this.bufferPosition; + const result = []; + let iv = this.iv; + for (let i = 0; i < sourceLength; ++i) { + buffer[bufferLength] = data[i]; + ++bufferLength; + if (bufferLength < 16) { + continue; + } + const plain = this._decrypt(buffer, this._key); + for (let j = 0; j < 16; ++j) { + plain[j] ^= iv[j]; + } + iv = buffer; + result.push(plain); + buffer = new Uint8Array(16); + bufferLength = 0; + } + this.buffer = buffer; + this.bufferLength = bufferLength; + this.iv = iv; + if (result.length === 0) { + return new Uint8Array(0); + } + let outputLength = 16 * result.length; + if (finalize) { + const lastBlock = result.at(-1); + let psLen = lastBlock[15]; + if (psLen <= 16) { + for (let i = 15, ii = 16 - psLen; i >= ii; --i) { + if (lastBlock[i] !== psLen) { + psLen = 0; + break; + } + } + outputLength -= psLen; + result[result.length - 1] = lastBlock.subarray(0, 16 - psLen); + } + } + const output = new Uint8Array(outputLength); + for (let i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { + output.set(result[i], j); + } + return output; + } + decryptBlock(data, finalize, iv = null) { + const sourceLength = data.length; + const buffer = this.buffer; + let bufferLength = this.bufferPosition; + if (iv) { + this.iv = iv; + } else { + for (let i = 0; bufferLength < 16 && i < sourceLength; ++i, ++bufferLength) { + buffer[bufferLength] = data[i]; + } + if (bufferLength < 16) { + this.bufferLength = bufferLength; + return new Uint8Array(0); + } + this.iv = buffer; + data = data.subarray(16); + } + this.buffer = new Uint8Array(16); + this.bufferLength = 0; + this.decryptBlock = this._decryptBlock2; + return this.decryptBlock(data, finalize); + } + encrypt(data, iv) { + const sourceLength = data.length; + let buffer = this.buffer, + bufferLength = this.bufferPosition; + const result = []; + if (!iv) { + iv = new Uint8Array(16); + } + for (let i = 0; i < sourceLength; ++i) { + buffer[bufferLength] = data[i]; + ++bufferLength; + if (bufferLength < 16) { + continue; + } + for (let j = 0; j < 16; ++j) { + buffer[j] ^= iv[j]; + } + const cipher = this._encrypt(buffer, this._key); + iv = cipher; + result.push(cipher); + buffer = new Uint8Array(16); + bufferLength = 0; + } + this.buffer = buffer; + this.bufferLength = bufferLength; + this.iv = iv; + if (result.length === 0) { + return new Uint8Array(0); + } + const outputLength = 16 * result.length; + const output = new Uint8Array(outputLength); + for (let i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) { + output.set(result[i], j); + } + return output; + } +} +class AES128Cipher extends AESBaseCipher { + constructor(key) { + super(); + this._cyclesOfRepetition = 10; + this._keySize = 160; + this._rcon = new Uint8Array([0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d]); + this._key = this._expandKey(key); + } + _expandKey(cipherKey) { + const b = 176; + const s = this._s; + const rcon = this._rcon; + const result = new Uint8Array(b); + result.set(cipherKey); + for (let j = 16, i = 1; j < b; ++i) { + let t1 = result[j - 3]; + let t2 = result[j - 2]; + let t3 = result[j - 1]; + let t4 = result[j - 4]; + t1 = s[t1]; + t2 = s[t2]; + t3 = s[t3]; + t4 = s[t4]; + t1 ^= rcon[i]; + for (let n = 0; n < 4; ++n) { + result[j] = t1 ^= result[j - 16]; + j++; + result[j] = t2 ^= result[j - 16]; + j++; + result[j] = t3 ^= result[j - 16]; + j++; + result[j] = t4 ^= result[j - 16]; + j++; + } + } + return result; + } +} +class AES256Cipher extends AESBaseCipher { + constructor(key) { + super(); + this._cyclesOfRepetition = 14; + this._keySize = 224; + this._key = this._expandKey(key); + } + _expandKey(cipherKey) { + const b = 240; + const s = this._s; + const result = new Uint8Array(b); + result.set(cipherKey); + let r = 1; + let t1, t2, t3, t4; + for (let j = 32, i = 1; j < b; ++i) { + if (j % 32 === 16) { + t1 = s[t1]; + t2 = s[t2]; + t3 = s[t3]; + t4 = s[t4]; + } else if (j % 32 === 0) { + t1 = result[j - 3]; + t2 = result[j - 2]; + t3 = result[j - 1]; + t4 = result[j - 4]; + t1 = s[t1]; + t2 = s[t2]; + t3 = s[t3]; + t4 = s[t4]; + t1 ^= r; + if ((r <<= 1) >= 256) { + r = (r ^ 0x1b) & 0xff; + } + } + for (let n = 0; n < 4; ++n) { + result[j] = t1 ^= result[j - 32]; + j++; + result[j] = t2 ^= result[j - 32]; + j++; + result[j] = t3 ^= result[j - 32]; + j++; + result[j] = t4 ^= result[j - 32]; + j++; + } + } + return result; + } +} +class PDF17 { + checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) { + const hashData = new Uint8Array(password.length + 56); + hashData.set(password, 0); + hashData.set(ownerValidationSalt, password.length); + hashData.set(userBytes, password.length + ownerValidationSalt.length); + const result = calculateSHA256(hashData, 0, hashData.length); + return isArrayEqual(result, ownerPassword); + } + checkUserPassword(password, userValidationSalt, userPassword) { + const hashData = new Uint8Array(password.length + 8); + hashData.set(password, 0); + hashData.set(userValidationSalt, password.length); + const result = calculateSHA256(hashData, 0, hashData.length); + return isArrayEqual(result, userPassword); + } + getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) { + const hashData = new Uint8Array(password.length + 56); + hashData.set(password, 0); + hashData.set(ownerKeySalt, password.length); + hashData.set(userBytes, password.length + ownerKeySalt.length); + const key = calculateSHA256(hashData, 0, hashData.length); + const cipher = new AES256Cipher(key); + return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16)); + } + getUserKey(password, userKeySalt, userEncryption) { + const hashData = new Uint8Array(password.length + 8); + hashData.set(password, 0); + hashData.set(userKeySalt, password.length); + const key = calculateSHA256(hashData, 0, hashData.length); + const cipher = new AES256Cipher(key); + return cipher.decryptBlock(userEncryption, false, new Uint8Array(16)); + } +} +class PDF20 { + _hash(password, input, userBytes) { + let k = calculateSHA256(input, 0, input.length).subarray(0, 32); + let e = [0]; + let i = 0; + while (i < 64 || e.at(-1) > i - 32) { + const combinedLength = password.length + k.length + userBytes.length, + combinedArray = new Uint8Array(combinedLength); + let writeOffset = 0; + combinedArray.set(password, writeOffset); + writeOffset += password.length; + combinedArray.set(k, writeOffset); + writeOffset += k.length; + combinedArray.set(userBytes, writeOffset); + const k1 = new Uint8Array(combinedLength * 64); + for (let j = 0, pos = 0; j < 64; j++, pos += combinedLength) { + k1.set(combinedArray, pos); + } + const cipher = new AES128Cipher(k.subarray(0, 16)); + e = cipher.encrypt(k1, k.subarray(16, 32)); + const remainder = e.slice(0, 16).reduce((a, b) => a + b, 0) % 3; + if (remainder === 0) { + k = calculateSHA256(e, 0, e.length); + } else if (remainder === 1) { + k = calculateSHA384(e, 0, e.length); + } else if (remainder === 2) { + k = calculateSHA512(e, 0, e.length); + } + i++; + } + return k.subarray(0, 32); + } + checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) { + const hashData = new Uint8Array(password.length + 56); + hashData.set(password, 0); + hashData.set(ownerValidationSalt, password.length); + hashData.set(userBytes, password.length + ownerValidationSalt.length); + const result = this._hash(password, hashData, userBytes); + return isArrayEqual(result, ownerPassword); + } + checkUserPassword(password, userValidationSalt, userPassword) { + const hashData = new Uint8Array(password.length + 8); + hashData.set(password, 0); + hashData.set(userValidationSalt, password.length); + const result = this._hash(password, hashData, []); + return isArrayEqual(result, userPassword); + } + getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) { + const hashData = new Uint8Array(password.length + 56); + hashData.set(password, 0); + hashData.set(ownerKeySalt, password.length); + hashData.set(userBytes, password.length + ownerKeySalt.length); + const key = this._hash(password, hashData, userBytes); + const cipher = new AES256Cipher(key); + return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16)); + } + getUserKey(password, userKeySalt, userEncryption) { + const hashData = new Uint8Array(password.length + 8); + hashData.set(password, 0); + hashData.set(userKeySalt, password.length); + const key = this._hash(password, hashData, []); + const cipher = new AES256Cipher(key); + return cipher.decryptBlock(userEncryption, false, new Uint8Array(16)); + } +} +class CipherTransform { + constructor(stringCipherConstructor, streamCipherConstructor) { + this.StringCipherConstructor = stringCipherConstructor; + this.StreamCipherConstructor = streamCipherConstructor; + } + createStream(stream, length) { + const cipher = new this.StreamCipherConstructor(); + return new DecryptStream(stream, length, function cipherTransformDecryptStream(data, finalize) { + return cipher.decryptBlock(data, finalize); + }); + } + decryptString(s) { + const cipher = new this.StringCipherConstructor(); + let data = stringToBytes(s); + data = cipher.decryptBlock(data, true); + return bytesToString(data); + } + encryptString(s) { + const cipher = new this.StringCipherConstructor(); + if (cipher instanceof AESBaseCipher) { + const strLen = s.length; + const pad = 16 - strLen % 16; + s += String.fromCharCode(pad).repeat(pad); + const iv = new Uint8Array(16); + if (typeof crypto !== "undefined") { + crypto.getRandomValues(iv); + } else { + for (let i = 0; i < 16; i++) { + iv[i] = Math.floor(256 * Math.random()); + } + } + let data = stringToBytes(s); + data = cipher.encrypt(data, iv); + const buf = new Uint8Array(16 + data.length); + buf.set(iv); + buf.set(data, 16); + return bytesToString(buf); + } + let data = stringToBytes(s); + data = cipher.encrypt(data); + return bytesToString(data); + } +} +class CipherTransformFactory { + static #defaultPasswordBytes = new Uint8Array([0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41, 0x64, 0x00, 0x4e, 0x56, 0xff, 0xfa, 0x01, 0x08, 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80, 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a]); + #createEncryptionKey20(revision, password, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms) { + if (password) { + const passwordLength = Math.min(127, password.length); + password = password.subarray(0, passwordLength); + } else { + password = []; + } + const pdfAlgorithm = revision === 6 ? new PDF20() : new PDF17(); + if (pdfAlgorithm.checkUserPassword(password, userValidationSalt, userPassword)) { + return pdfAlgorithm.getUserKey(password, userKeySalt, userEncryption); + } else if (password.length && pdfAlgorithm.checkOwnerPassword(password, ownerValidationSalt, uBytes, ownerPassword)) { + return pdfAlgorithm.getOwnerKey(password, ownerKeySalt, uBytes, ownerEncryption); + } + return null; + } + #prepareKeyData(fileId, password, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata) { + const hashDataSize = 40 + ownerPassword.length + fileId.length; + const hashData = new Uint8Array(hashDataSize); + let i = 0, + j, + n; + if (password) { + n = Math.min(32, password.length); + for (; i < n; ++i) { + hashData[i] = password[i]; + } + } + j = 0; + while (i < 32) { + hashData[i++] = CipherTransformFactory.#defaultPasswordBytes[j++]; + } + for (j = 0, n = ownerPassword.length; j < n; ++j) { + hashData[i++] = ownerPassword[j]; + } + hashData[i++] = flags & 0xff; + hashData[i++] = flags >> 8 & 0xff; + hashData[i++] = flags >> 16 & 0xff; + hashData[i++] = flags >>> 24 & 0xff; + for (j = 0, n = fileId.length; j < n; ++j) { + hashData[i++] = fileId[j]; + } + if (revision >= 4 && !encryptMetadata) { + hashData[i++] = 0xff; + hashData[i++] = 0xff; + hashData[i++] = 0xff; + hashData[i++] = 0xff; + } + let hash = calculateMD5(hashData, 0, i); + const keyLengthInBytes = keyLength >> 3; + if (revision >= 3) { + for (j = 0; j < 50; ++j) { + hash = calculateMD5(hash, 0, keyLengthInBytes); + } + } + const encryptionKey = hash.subarray(0, keyLengthInBytes); + let cipher, checkData; + if (revision >= 3) { + for (i = 0; i < 32; ++i) { + hashData[i] = CipherTransformFactory.#defaultPasswordBytes[i]; + } + for (j = 0, n = fileId.length; j < n; ++j) { + hashData[i++] = fileId[j]; + } + cipher = new ARCFourCipher(encryptionKey); + checkData = cipher.encryptBlock(calculateMD5(hashData, 0, i)); + n = encryptionKey.length; + const derivedKey = new Uint8Array(n); + for (j = 1; j <= 19; ++j) { + for (let k = 0; k < n; ++k) { + derivedKey[k] = encryptionKey[k] ^ j; + } + cipher = new ARCFourCipher(derivedKey); + checkData = cipher.encryptBlock(checkData); + } + for (j = 0, n = checkData.length; j < n; ++j) { + if (userPassword[j] !== checkData[j]) { + return null; + } + } + } else { + cipher = new ARCFourCipher(encryptionKey); + checkData = cipher.encryptBlock(CipherTransformFactory.#defaultPasswordBytes); + for (j = 0, n = checkData.length; j < n; ++j) { + if (userPassword[j] !== checkData[j]) { + return null; + } + } + } + return encryptionKey; + } + #decodeUserPassword(password, ownerPassword, revision, keyLength) { + const hashData = new Uint8Array(32); + let i = 0; + const n = Math.min(32, password.length); + for (; i < n; ++i) { + hashData[i] = password[i]; + } + let j = 0; + while (i < 32) { + hashData[i++] = CipherTransformFactory.#defaultPasswordBytes[j++]; + } + let hash = calculateMD5(hashData, 0, i); + const keyLengthInBytes = keyLength >> 3; + if (revision >= 3) { + for (j = 0; j < 50; ++j) { + hash = calculateMD5(hash, 0, hash.length); + } + } + let cipher, userPassword; + if (revision >= 3) { + userPassword = ownerPassword; + const derivedKey = new Uint8Array(keyLengthInBytes); + for (j = 19; j >= 0; j--) { + for (let k = 0; k < keyLengthInBytes; ++k) { + derivedKey[k] = hash[k] ^ j; + } + cipher = new ARCFourCipher(derivedKey); + userPassword = cipher.encryptBlock(userPassword); + } + } else { + cipher = new ARCFourCipher(hash.subarray(0, keyLengthInBytes)); + userPassword = cipher.encryptBlock(ownerPassword); + } + return userPassword; + } + #buildObjectKey(num, gen, encryptionKey, isAes = false) { + const key = new Uint8Array(encryptionKey.length + 9); + const n = encryptionKey.length; + let i; + for (i = 0; i < n; ++i) { + key[i] = encryptionKey[i]; + } + key[i++] = num & 0xff; + key[i++] = num >> 8 & 0xff; + key[i++] = num >> 16 & 0xff; + key[i++] = gen & 0xff; + key[i++] = gen >> 8 & 0xff; + if (isAes) { + key[i++] = 0x73; + key[i++] = 0x41; + key[i++] = 0x6c; + key[i++] = 0x54; + } + const hash = calculateMD5(key, 0, i); + return hash.subarray(0, Math.min(encryptionKey.length + 5, 16)); + } + #buildCipherConstructor(cf, name, num, gen, key) { + if (!(name instanceof Name)) { + throw new FormatError("Invalid crypt filter name."); + } + const self = this; + const cryptFilter = cf.get(name.name); + const cfm = cryptFilter?.get("CFM"); + if (!cfm || cfm.name === "None") { + return function () { + return new NullCipher(); + }; + } + if (cfm.name === "V2") { + return function () { + return new ARCFourCipher(self.#buildObjectKey(num, gen, key, false)); + }; + } + if (cfm.name === "AESV2") { + return function () { + return new AES128Cipher(self.#buildObjectKey(num, gen, key, true)); + }; + } + if (cfm.name === "AESV3") { + return function () { + return new AES256Cipher(key); + }; + } + throw new FormatError("Unknown crypto method"); + } + constructor(dict, fileId, password) { + const filter = dict.get("Filter"); + if (!isName(filter, "Standard")) { + throw new FormatError("unknown encryption method"); + } + this.filterName = filter.name; + this.dict = dict; + const algorithm = dict.get("V"); + if (!Number.isInteger(algorithm) || algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && algorithm !== 5) { + throw new FormatError("unsupported encryption algorithm"); + } + this.algorithm = algorithm; + let keyLength = dict.get("Length"); + if (!keyLength) { + if (algorithm <= 3) { + keyLength = 40; + } else { + const cfDict = dict.get("CF"); + const streamCryptoName = dict.get("StmF"); + if (cfDict instanceof Dict && streamCryptoName instanceof Name) { + cfDict.suppressEncryption = true; + const handlerDict = cfDict.get(streamCryptoName.name); + keyLength = handlerDict?.get("Length") || 128; + if (keyLength < 40) { + keyLength <<= 3; + } + } + } + } + if (!Number.isInteger(keyLength) || keyLength < 40 || keyLength % 8 !== 0) { + throw new FormatError("invalid key length"); + } + const ownerBytes = stringToBytes(dict.get("O")), + userBytes = stringToBytes(dict.get("U")); + const ownerPassword = ownerBytes.subarray(0, 32); + const userPassword = userBytes.subarray(0, 32); + const flags = dict.get("P"); + const revision = dict.get("R"); + const encryptMetadata = (algorithm === 4 || algorithm === 5) && dict.get("EncryptMetadata") !== false; + this.encryptMetadata = encryptMetadata; + const fileIdBytes = stringToBytes(fileId); + let passwordBytes; + if (password) { + if (revision === 6) { + try { + password = utf8StringToString(password); + } catch { + warn("CipherTransformFactory: Unable to convert UTF8 encoded password."); + } + } + passwordBytes = stringToBytes(password); + } + let encryptionKey; + if (algorithm !== 5) { + encryptionKey = this.#prepareKeyData(fileIdBytes, passwordBytes, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata); + } else { + const ownerValidationSalt = ownerBytes.subarray(32, 40); + const ownerKeySalt = ownerBytes.subarray(40, 48); + const uBytes = userBytes.subarray(0, 48); + const userValidationSalt = userBytes.subarray(32, 40); + const userKeySalt = userBytes.subarray(40, 48); + const ownerEncryption = stringToBytes(dict.get("OE")); + const userEncryption = stringToBytes(dict.get("UE")); + const perms = stringToBytes(dict.get("Perms")); + encryptionKey = this.#createEncryptionKey20(revision, passwordBytes, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms); + } + if (!encryptionKey && !password) { + throw new PasswordException("No password given", PasswordResponses.NEED_PASSWORD); + } else if (!encryptionKey && password) { + const decodedPassword = this.#decodeUserPassword(passwordBytes, ownerPassword, revision, keyLength); + encryptionKey = this.#prepareKeyData(fileIdBytes, decodedPassword, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata); + } + if (!encryptionKey) { + throw new PasswordException("Incorrect Password", PasswordResponses.INCORRECT_PASSWORD); + } + this.encryptionKey = encryptionKey; + if (algorithm >= 4) { + const cf = dict.get("CF"); + if (cf instanceof Dict) { + cf.suppressEncryption = true; + } + this.cf = cf; + this.stmf = dict.get("StmF") || Name.get("Identity"); + this.strf = dict.get("StrF") || Name.get("Identity"); + this.eff = dict.get("EFF") || this.stmf; + } + } + createCipherTransform(num, gen) { + if (this.algorithm === 4 || this.algorithm === 5) { + return new CipherTransform(this.#buildCipherConstructor(this.cf, this.strf, num, gen, this.encryptionKey), this.#buildCipherConstructor(this.cf, this.stmf, num, gen, this.encryptionKey)); + } + const key = this.#buildObjectKey(num, gen, this.encryptionKey, false); + const cipherConstructor = function () { + return new ARCFourCipher(key); + }; + return new CipherTransform(cipherConstructor, cipherConstructor); + } +} + +;// CONCATENATED MODULE: ./src/core/writer.js + + + + + + +async function writeObject(ref, obj, buffer, { + encrypt = null +}) { + const transform = encrypt?.createCipherTransform(ref.num, ref.gen); + buffer.push(`${ref.num} ${ref.gen} obj\n`); + if (obj instanceof Dict) { + await writeDict(obj, buffer, transform); + } else if (obj instanceof BaseStream) { + await writeStream(obj, buffer, transform); + } else if (Array.isArray(obj)) { + await writeArray(obj, buffer, transform); + } + buffer.push("\nendobj\n"); +} +async function writeDict(dict, buffer, transform) { + buffer.push("<<"); + for (const key of dict.getKeys()) { + buffer.push(` /${escapePDFName(key)} `); + await writeValue(dict.getRaw(key), buffer, transform); + } + buffer.push(">>"); +} +async function writeStream(stream, buffer, transform) { + let bytes = stream.getBytes(); + const { + dict + } = stream; + const [filter, params] = await Promise.all([dict.getAsync("Filter"), dict.getAsync("DecodeParms")]); + const filterZero = Array.isArray(filter) ? await dict.xref.fetchIfRefAsync(filter[0]) : filter; + const isFilterZeroFlateDecode = isName(filterZero, "FlateDecode"); + const MIN_LENGTH_FOR_COMPRESSING = 256; + if (typeof CompressionStream !== "undefined" && (bytes.length >= MIN_LENGTH_FOR_COMPRESSING || isFilterZeroFlateDecode)) { + try { + const cs = new CompressionStream("deflate"); + const writer = cs.writable.getWriter(); + writer.write(bytes); + writer.close(); + const buf = await new Response(cs.readable).arrayBuffer(); + bytes = new Uint8Array(buf); + let newFilter, newParams; + if (!filter) { + newFilter = Name.get("FlateDecode"); + } else if (!isFilterZeroFlateDecode) { + newFilter = Array.isArray(filter) ? [Name.get("FlateDecode"), ...filter] : [Name.get("FlateDecode"), filter]; + if (params) { + newParams = Array.isArray(params) ? [null, ...params] : [null, params]; + } + } + if (newFilter) { + dict.set("Filter", newFilter); + } + if (newParams) { + dict.set("DecodeParms", newParams); + } + } catch (ex) { + info(`writeStream - cannot compress data: "${ex}".`); + } + } + let string = bytesToString(bytes); + if (transform) { + string = transform.encryptString(string); + } + dict.set("Length", string.length); + await writeDict(dict, buffer, transform); + buffer.push(" stream\n", string, "\nendstream"); +} +async function writeArray(array, buffer, transform) { + buffer.push("["); + let first = true; + for (const val of array) { + if (!first) { + buffer.push(" "); + } else { + first = false; + } + await writeValue(val, buffer, transform); + } + buffer.push("]"); +} +async function writeValue(value, buffer, transform) { + if (value instanceof Name) { + buffer.push(`/${escapePDFName(value.name)}`); + } else if (value instanceof Ref) { + buffer.push(`${value.num} ${value.gen} R`); + } else if (Array.isArray(value)) { + await writeArray(value, buffer, transform); + } else if (typeof value === "string") { + if (transform) { + value = transform.encryptString(value); + } + buffer.push(`(${escapeString(value)})`); + } else if (typeof value === "number") { + buffer.push(numberToString(value)); + } else if (typeof value === "boolean") { + buffer.push(value.toString()); + } else if (value instanceof Dict) { + await writeDict(value, buffer, transform); + } else if (value instanceof BaseStream) { + await writeStream(value, buffer, transform); + } else if (value === null) { + buffer.push("null"); + } else { + warn(`Unhandled value in writer: ${typeof value}, please file a bug.`); + } +} +function writeInt(number, size, offset, buffer) { + for (let i = size + offset - 1; i > offset - 1; i--) { + buffer[i] = number & 0xff; + number >>= 8; + } + return offset + size; +} +function writeString(string, offset, buffer) { + for (let i = 0, len = string.length; i < len; i++) { + buffer[offset + i] = string.charCodeAt(i) & 0xff; + } +} +function computeMD5(filesize, xrefInfo) { + const time = Math.floor(Date.now() / 1000); + const filename = xrefInfo.filename || ""; + const md5Buffer = [time.toString(), filename, filesize.toString()]; + let md5BufferLen = md5Buffer.reduce((a, str) => a + str.length, 0); + for (const value of Object.values(xrefInfo.info)) { + md5Buffer.push(value); + md5BufferLen += value.length; + } + const array = new Uint8Array(md5BufferLen); + let offset = 0; + for (const str of md5Buffer) { + writeString(str, offset, array); + offset += str.length; + } + return bytesToString(calculateMD5(array)); +} +function writeXFADataForAcroform(str, newRefs) { + const xml = new SimpleXMLParser({ + hasAttributes: true + }).parseFromString(str); + for (const { + xfa + } of newRefs) { + if (!xfa) { + continue; + } + const { + path, + value + } = xfa; + if (!path) { + continue; + } + const nodePath = parseXFAPath(path); + let node = xml.documentElement.searchNode(nodePath, 0); + if (!node && nodePath.length > 1) { + node = xml.documentElement.searchNode([nodePath.at(-1)], 0); + } + if (node) { + node.childNodes = Array.isArray(value) ? value.map(val => new SimpleDOMNode("value", val)) : [new SimpleDOMNode("#text", value)]; + } else { + warn(`Node not found for path: ${path}`); + } + } + const buffer = []; + xml.documentElement.dump(buffer); + return buffer.join(""); +} +async function updateAcroform({ + xref, + acroForm, + acroFormRef, + hasXfa, + hasXfaDatasetsEntry, + xfaDatasetsRef, + needAppearances, + newRefs +}) { + if (hasXfa && !hasXfaDatasetsEntry && !xfaDatasetsRef) { + warn("XFA - Cannot save it"); + } + if (!needAppearances && (!hasXfa || !xfaDatasetsRef || hasXfaDatasetsEntry)) { + return; + } + const dict = acroForm.clone(); + if (hasXfa && !hasXfaDatasetsEntry) { + const newXfa = acroForm.get("XFA").slice(); + newXfa.splice(2, 0, "datasets"); + newXfa.splice(3, 0, xfaDatasetsRef); + dict.set("XFA", newXfa); + } + if (needAppearances) { + dict.set("NeedAppearances", true); + } + const buffer = []; + await writeObject(acroFormRef, dict, buffer, xref); + newRefs.push({ + ref: acroFormRef, + data: buffer.join("") + }); +} +function updateXFA({ + xfaData, + xfaDatasetsRef, + newRefs, + xref +}) { + if (xfaData === null) { + const datasets = xref.fetchIfRef(xfaDatasetsRef); + xfaData = writeXFADataForAcroform(datasets.getString(), newRefs); + } + const encrypt = xref.encrypt; + if (encrypt) { + const transform = encrypt.createCipherTransform(xfaDatasetsRef.num, xfaDatasetsRef.gen); + xfaData = transform.encryptString(xfaData); + } + const data = `${xfaDatasetsRef.num} ${xfaDatasetsRef.gen} obj\n` + `<< /Type /EmbeddedFile /Length ${xfaData.length}>>\nstream\n` + xfaData + "\nendstream\nendobj\n"; + newRefs.push({ + ref: xfaDatasetsRef, + data + }); +} +async function incrementalUpdate({ + originalData, + xrefInfo, + newRefs, + xref = null, + hasXfa = false, + xfaDatasetsRef = null, + hasXfaDatasetsEntry = false, + needAppearances, + acroFormRef = null, + acroForm = null, + xfaData = null +}) { + await updateAcroform({ + xref, + acroForm, + acroFormRef, + hasXfa, + hasXfaDatasetsEntry, + xfaDatasetsRef, + needAppearances, + newRefs + }); + if (hasXfa) { + updateXFA({ + xfaData, + xfaDatasetsRef, + newRefs, + xref + }); + } + const newXref = new Dict(null); + const refForXrefTable = xrefInfo.newRef; + let buffer, baseOffset; + const lastByte = originalData.at(-1); + if (lastByte === 0x0a || lastByte === 0x0d) { + buffer = []; + baseOffset = originalData.length; + } else { + buffer = ["\n"]; + baseOffset = originalData.length + 1; + } + newXref.set("Size", refForXrefTable.num + 1); + newXref.set("Prev", xrefInfo.startXRef); + newXref.set("Type", Name.get("XRef")); + if (xrefInfo.rootRef !== null) { + newXref.set("Root", xrefInfo.rootRef); + } + if (xrefInfo.infoRef !== null) { + newXref.set("Info", xrefInfo.infoRef); + } + if (xrefInfo.encryptRef !== null) { + newXref.set("Encrypt", xrefInfo.encryptRef); + } + newRefs.push({ + ref: refForXrefTable, + data: "" + }); + newRefs = newRefs.sort((a, b) => { + return a.ref.num - b.ref.num; + }); + const xrefTableData = [[0, 1, 0xffff]]; + const indexes = [0, 1]; + let maxOffset = 0; + for (const { + ref, + data + } of newRefs) { + maxOffset = Math.max(maxOffset, baseOffset); + xrefTableData.push([1, baseOffset, Math.min(ref.gen, 0xffff)]); + baseOffset += data.length; + indexes.push(ref.num, 1); + buffer.push(data); + } + newXref.set("Index", indexes); + if (Array.isArray(xrefInfo.fileIds) && xrefInfo.fileIds.length > 0) { + const md5 = computeMD5(baseOffset, xrefInfo); + newXref.set("ID", [xrefInfo.fileIds[0], md5]); + } + const offsetSize = Math.ceil(Math.log2(maxOffset) / 8); + const sizes = [1, offsetSize, 2]; + const structSize = sizes[0] + sizes[1] + sizes[2]; + const tableLength = structSize * xrefTableData.length; + newXref.set("W", sizes); + newXref.set("Length", tableLength); + buffer.push(`${refForXrefTable.num} ${refForXrefTable.gen} obj\n`); + await writeDict(newXref, buffer, null); + buffer.push(" stream\n"); + const bufferLen = buffer.reduce((a, str) => a + str.length, 0); + const footer = `\nendstream\nendobj\nstartxref\n${baseOffset}\n%%EOF\n`; + const array = new Uint8Array(originalData.length + bufferLen + tableLength + footer.length); + array.set(originalData); + let offset = originalData.length; + for (const str of buffer) { + writeString(str, offset, array); + offset += str.length; + } + for (const [type, objOffset, gen] of xrefTableData) { + offset = writeInt(type, sizes[0], offset, array); + offset = writeInt(objOffset, sizes[1], offset, array); + offset = writeInt(gen, sizes[2], offset, array); + } + writeString(footer, offset, array); + return array; +} + +;// CONCATENATED MODULE: ./src/core/struct_tree.js + + + + +const MAX_DEPTH = 40; +const StructElementType = { + PAGE_CONTENT: 1, + STREAM_CONTENT: 2, + OBJECT: 3, + ANNOTATION: 4, + ELEMENT: 5 +}; +class StructTreeRoot { + constructor(rootDict, rootRef) { + this.dict = rootDict; + this.ref = rootRef instanceof Ref ? rootRef : null; + this.roleMap = new Map(); + this.structParentIds = null; + } + init() { + this.readRoleMap(); + } + #addIdToPage(pageRef, id, type) { + if (!(pageRef instanceof Ref) || id < 0) { + return; + } + this.structParentIds ||= new RefSetCache(); + let ids = this.structParentIds.get(pageRef); + if (!ids) { + ids = []; + this.structParentIds.put(pageRef, ids); + } + ids.push([id, type]); + } + addAnnotationIdToPage(pageRef, id) { + this.#addIdToPage(pageRef, id, StructElementType.ANNOTATION); + } + readRoleMap() { + const roleMapDict = this.dict.get("RoleMap"); + if (!(roleMapDict instanceof Dict)) { + return; + } + roleMapDict.forEach((key, value) => { + if (!(value instanceof Name)) { + return; + } + this.roleMap.set(key, value.name); + }); + } + static async canCreateStructureTree({ + catalogRef, + pdfManager, + newAnnotationsByPage + }) { + if (!(catalogRef instanceof Ref)) { + warn("Cannot save the struct tree: no catalog reference."); + return false; + } + let nextKey = 0; + let hasNothingToUpdate = true; + for (const [pageIndex, elements] of newAnnotationsByPage) { + const { + ref: pageRef + } = await pdfManager.getPage(pageIndex); + if (!(pageRef instanceof Ref)) { + warn(`Cannot save the struct tree: page ${pageIndex} has no ref.`); + hasNothingToUpdate = true; + break; + } + for (const element of elements) { + if (element.accessibilityData?.type) { + element.parentTreeId = nextKey++; + hasNothingToUpdate = false; + } + } + } + if (hasNothingToUpdate) { + for (const elements of newAnnotationsByPage.values()) { + for (const element of elements) { + delete element.parentTreeId; + } + } + return false; + } + return true; + } + static async createStructureTree({ + newAnnotationsByPage, + xref, + catalogRef, + pdfManager, + newRefs + }) { + const root = pdfManager.catalog.cloneDict(); + const structTreeRootRef = xref.getNewTemporaryRef(); + root.set("StructTreeRoot", structTreeRootRef); + const buffer = []; + await writeObject(catalogRef, root, buffer, xref); + newRefs.push({ + ref: catalogRef, + data: buffer.join("") + }); + const structTreeRoot = new Dict(xref); + structTreeRoot.set("Type", Name.get("StructTreeRoot")); + const parentTreeRef = xref.getNewTemporaryRef(); + structTreeRoot.set("ParentTree", parentTreeRef); + const kids = []; + structTreeRoot.set("K", kids); + const parentTree = new Dict(xref); + const nums = []; + parentTree.set("Nums", nums); + const nextKey = await this.#writeKids({ + newAnnotationsByPage, + structTreeRootRef, + kids, + nums, + xref, + pdfManager, + newRefs, + buffer + }); + structTreeRoot.set("ParentTreeNextKey", nextKey); + buffer.length = 0; + await writeObject(parentTreeRef, parentTree, buffer, xref); + newRefs.push({ + ref: parentTreeRef, + data: buffer.join("") + }); + buffer.length = 0; + await writeObject(structTreeRootRef, structTreeRoot, buffer, xref); + newRefs.push({ + ref: structTreeRootRef, + data: buffer.join("") + }); + } + async canUpdateStructTree({ + pdfManager, + xref, + newAnnotationsByPage + }) { + if (!this.ref) { + warn("Cannot update the struct tree: no root reference."); + return false; + } + let nextKey = this.dict.get("ParentTreeNextKey"); + if (!Number.isInteger(nextKey) || nextKey < 0) { + warn("Cannot update the struct tree: invalid next key."); + return false; + } + const parentTree = this.dict.get("ParentTree"); + if (!(parentTree instanceof Dict)) { + warn("Cannot update the struct tree: ParentTree isn't a dict."); + return false; + } + const nums = parentTree.get("Nums"); + if (!Array.isArray(nums)) { + warn("Cannot update the struct tree: nums isn't an array."); + return false; + } + const numberTree = new NumberTree(parentTree, xref); + for (const pageIndex of newAnnotationsByPage.keys()) { + const { + pageDict + } = await pdfManager.getPage(pageIndex); + if (!pageDict.has("StructParents")) { + continue; + } + const id = pageDict.get("StructParents"); + if (!Number.isInteger(id) || !Array.isArray(numberTree.get(id))) { + warn(`Cannot save the struct tree: page ${pageIndex} has a wrong id.`); + return false; + } + } + let hasNothingToUpdate = true; + for (const [pageIndex, elements] of newAnnotationsByPage) { + const { + pageDict + } = await pdfManager.getPage(pageIndex); + StructTreeRoot.#collectParents({ + elements, + xref: this.dict.xref, + pageDict, + numberTree + }); + for (const element of elements) { + if (element.accessibilityData?.type) { + element.parentTreeId = nextKey++; + hasNothingToUpdate = false; + } + } + } + if (hasNothingToUpdate) { + for (const elements of newAnnotationsByPage.values()) { + for (const element of elements) { + delete element.parentTreeId; + delete element.structTreeParent; + } + } + return false; + } + return true; + } + async updateStructureTree({ + newAnnotationsByPage, + pdfManager, + newRefs + }) { + const xref = this.dict.xref; + const structTreeRoot = this.dict.clone(); + const structTreeRootRef = this.ref; + let parentTreeRef = structTreeRoot.getRaw("ParentTree"); + let parentTree; + if (parentTreeRef instanceof Ref) { + parentTree = xref.fetch(parentTreeRef); + } else { + parentTree = parentTreeRef; + parentTreeRef = xref.getNewTemporaryRef(); + structTreeRoot.set("ParentTree", parentTreeRef); + } + parentTree = parentTree.clone(); + let nums = parentTree.getRaw("Nums"); + let numsRef = null; + if (nums instanceof Ref) { + numsRef = nums; + nums = xref.fetch(numsRef); + } + nums = nums.slice(); + if (!numsRef) { + parentTree.set("Nums", nums); + } + let kids = structTreeRoot.getRaw("K"); + let kidsRef = null; + if (kids instanceof Ref) { + kidsRef = kids; + kids = xref.fetch(kidsRef); + } else { + kidsRef = xref.getNewTemporaryRef(); + structTreeRoot.set("K", kidsRef); + } + kids = Array.isArray(kids) ? kids.slice() : [kids]; + const buffer = []; + const newNextkey = await StructTreeRoot.#writeKids({ + newAnnotationsByPage, + structTreeRootRef, + kids, + nums, + xref, + pdfManager, + newRefs, + buffer + }); + structTreeRoot.set("ParentTreeNextKey", newNextkey); + buffer.length = 0; + await writeObject(kidsRef, kids, buffer, xref); + newRefs.push({ + ref: kidsRef, + data: buffer.join("") + }); + if (numsRef) { + buffer.length = 0; + await writeObject(numsRef, nums, buffer, xref); + newRefs.push({ + ref: numsRef, + data: buffer.join("") + }); + } + buffer.length = 0; + await writeObject(parentTreeRef, parentTree, buffer, xref); + newRefs.push({ + ref: parentTreeRef, + data: buffer.join("") + }); + buffer.length = 0; + await writeObject(structTreeRootRef, structTreeRoot, buffer, xref); + newRefs.push({ + ref: structTreeRootRef, + data: buffer.join("") + }); + } + static async #writeKids({ + newAnnotationsByPage, + structTreeRootRef, + kids, + nums, + xref, + pdfManager, + newRefs, + buffer + }) { + const objr = Name.get("OBJR"); + let nextKey = -Infinity; + for (const [pageIndex, elements] of newAnnotationsByPage) { + const { + ref: pageRef + } = await pdfManager.getPage(pageIndex); + const isPageRef = pageRef instanceof Ref; + for (const { + accessibilityData, + ref, + parentTreeId, + structTreeParent + } of elements) { + if (!accessibilityData?.type) { + continue; + } + const { + type, + title, + lang, + alt, + expanded, + actualText + } = accessibilityData; + nextKey = Math.max(nextKey, parentTreeId); + const tagRef = xref.getNewTemporaryRef(); + const tagDict = new Dict(xref); + tagDict.set("S", Name.get(type)); + if (title) { + tagDict.set("T", title); + } + if (lang) { + tagDict.set("Lang", lang); + } + if (alt) { + tagDict.set("Alt", alt); + } + if (expanded) { + tagDict.set("E", expanded); + } + if (actualText) { + tagDict.set("ActualText", actualText); + } + if (structTreeParent) { + await this.#updateParentTag({ + structTreeParent, + tagDict, + newTagRef: tagRef, + fallbackRef: structTreeRootRef, + xref, + newRefs, + buffer + }); + } else { + tagDict.set("P", structTreeRootRef); + } + const objDict = new Dict(xref); + tagDict.set("K", objDict); + objDict.set("Type", objr); + if (isPageRef) { + objDict.set("Pg", pageRef); + } + objDict.set("Obj", ref); + buffer.length = 0; + await writeObject(tagRef, tagDict, buffer, xref); + newRefs.push({ + ref: tagRef, + data: buffer.join("") + }); + nums.push(parentTreeId, tagRef); + kids.push(tagRef); + } + } + return nextKey + 1; + } + static #collectParents({ + elements, + xref, + pageDict, + numberTree + }) { + const idToElement = new Map(); + for (const element of elements) { + if (element.structTreeParentId) { + const id = parseInt(element.structTreeParentId.split("_mc")[1], 10); + idToElement.set(id, element); + } + } + const id = pageDict.get("StructParents"); + if (!Number.isInteger(id)) { + return; + } + const parentArray = numberTree.get(id); + const updateElement = (kid, pageKid, kidRef) => { + const element = idToElement.get(kid); + if (element) { + const parentRef = pageKid.getRaw("P"); + const parentDict = xref.fetchIfRef(parentRef); + if (parentRef instanceof Ref && parentDict instanceof Dict) { + element.structTreeParent = { + ref: kidRef, + dict: pageKid + }; + } + return true; + } + return false; + }; + for (const kidRef of parentArray) { + if (!(kidRef instanceof Ref)) { + continue; + } + const pageKid = xref.fetch(kidRef); + const k = pageKid.get("K"); + if (Number.isInteger(k)) { + updateElement(k, pageKid, kidRef); + continue; + } + if (!Array.isArray(k)) { + continue; + } + for (let kid of k) { + kid = xref.fetchIfRef(kid); + if (Number.isInteger(kid) && updateElement(kid, pageKid, kidRef)) { + break; + } + } + } + } + static async #updateParentTag({ + structTreeParent: { + ref, + dict + }, + tagDict, + newTagRef, + fallbackRef, + xref, + newRefs, + buffer + }) { + const parentRef = dict.getRaw("P"); + let parentDict = xref.fetchIfRef(parentRef); + tagDict.set("P", parentRef); + let saveParentDict = false; + let parentKids; + let parentKidsRef = parentDict.getRaw("K"); + if (!(parentKidsRef instanceof Ref)) { + parentKids = parentKidsRef; + parentKidsRef = xref.getNewTemporaryRef(); + parentDict = parentDict.clone(); + parentDict.set("K", parentKidsRef); + saveParentDict = true; + } else { + parentKids = xref.fetch(parentKidsRef); + } + if (Array.isArray(parentKids)) { + const index = parentKids.indexOf(ref); + if (index >= 0) { + parentKids = parentKids.slice(); + parentKids.splice(index + 1, 0, newTagRef); + } else { + warn("Cannot update the struct tree: parent kid not found."); + tagDict.set("P", fallbackRef); + return; + } + } else if (parentKids instanceof Dict) { + parentKids = [parentKidsRef, newTagRef]; + parentKidsRef = xref.getNewTemporaryRef(); + parentDict.set("K", parentKidsRef); + saveParentDict = true; + } + buffer.length = 0; + await writeObject(parentKidsRef, parentKids, buffer, xref); + newRefs.push({ + ref: parentKidsRef, + data: buffer.join("") + }); + if (!saveParentDict) { + return; + } + buffer.length = 0; + await writeObject(parentRef, parentDict, buffer, xref); + newRefs.push({ + ref: parentRef, + data: buffer.join("") + }); + } +} +class StructElementNode { + constructor(tree, dict) { + this.tree = tree; + this.dict = dict; + this.kids = []; + this.parseKids(); + } + get role() { + const nameObj = this.dict.get("S"); + const name = nameObj instanceof Name ? nameObj.name : ""; + const { + root + } = this.tree; + if (root.roleMap.has(name)) { + return root.roleMap.get(name); + } + return name; + } + parseKids() { + let pageObjId = null; + const objRef = this.dict.getRaw("Pg"); + if (objRef instanceof Ref) { + pageObjId = objRef.toString(); + } + const kids = this.dict.get("K"); + if (Array.isArray(kids)) { + for (const kid of kids) { + const element = this.parseKid(pageObjId, kid); + if (element) { + this.kids.push(element); + } + } + } else { + const element = this.parseKid(pageObjId, kids); + if (element) { + this.kids.push(element); + } + } + } + parseKid(pageObjId, kid) { + if (Number.isInteger(kid)) { + if (this.tree.pageDict.objId !== pageObjId) { + return null; + } + return new StructElement({ + type: StructElementType.PAGE_CONTENT, + mcid: kid, + pageObjId + }); + } + let kidDict = null; + if (kid instanceof Ref) { + kidDict = this.dict.xref.fetch(kid); + } else if (kid instanceof Dict) { + kidDict = kid; + } + if (!kidDict) { + return null; + } + const pageRef = kidDict.getRaw("Pg"); + if (pageRef instanceof Ref) { + pageObjId = pageRef.toString(); + } + const type = kidDict.get("Type") instanceof Name ? kidDict.get("Type").name : null; + if (type === "MCR") { + if (this.tree.pageDict.objId !== pageObjId) { + return null; + } + const kidRef = kidDict.getRaw("Stm"); + return new StructElement({ + type: StructElementType.STREAM_CONTENT, + refObjId: kidRef instanceof Ref ? kidRef.toString() : null, + pageObjId, + mcid: kidDict.get("MCID") + }); + } + if (type === "OBJR") { + if (this.tree.pageDict.objId !== pageObjId) { + return null; + } + const kidRef = kidDict.getRaw("Obj"); + return new StructElement({ + type: StructElementType.OBJECT, + refObjId: kidRef instanceof Ref ? kidRef.toString() : null, + pageObjId + }); + } + return new StructElement({ + type: StructElementType.ELEMENT, + dict: kidDict + }); + } +} +class StructElement { + constructor({ + type, + dict = null, + mcid = null, + pageObjId = null, + refObjId = null + }) { + this.type = type; + this.dict = dict; + this.mcid = mcid; + this.pageObjId = pageObjId; + this.refObjId = refObjId; + this.parentNode = null; + } +} +class StructTreePage { + constructor(structTreeRoot, pageDict) { + this.root = structTreeRoot; + this.rootDict = structTreeRoot ? structTreeRoot.dict : null; + this.pageDict = pageDict; + this.nodes = []; + } + parse(pageRef) { + if (!this.root || !this.rootDict) { + return; + } + const parentTree = this.rootDict.get("ParentTree"); + if (!parentTree) { + return; + } + const id = this.pageDict.get("StructParents"); + const ids = pageRef instanceof Ref && this.root.structParentIds?.get(pageRef); + if (!Number.isInteger(id) && !ids) { + return; + } + const map = new Map(); + const numberTree = new NumberTree(parentTree, this.rootDict.xref); + if (Number.isInteger(id)) { + const parentArray = numberTree.get(id); + if (Array.isArray(parentArray)) { + for (const ref of parentArray) { + if (ref instanceof Ref) { + this.addNode(this.rootDict.xref.fetch(ref), map); + } + } + } + } + if (!ids) { + return; + } + for (const [elemId, type] of ids) { + const obj = numberTree.get(elemId); + if (obj) { + const elem = this.addNode(this.rootDict.xref.fetchIfRef(obj), map); + if (elem?.kids?.length === 1 && elem.kids[0].type === StructElementType.OBJECT) { + elem.kids[0].type = type; + } + } + } + } + addNode(dict, map, level = 0) { + if (level > MAX_DEPTH) { + warn("StructTree MAX_DEPTH reached."); + return null; + } + if (map.has(dict)) { + return map.get(dict); + } + const element = new StructElementNode(this, dict); + map.set(dict, element); + const parent = dict.get("P"); + if (!parent || isName(parent.get("Type"), "StructTreeRoot")) { + if (!this.addTopLevelNode(dict, element)) { + map.delete(dict); + } + return element; + } + const parentNode = this.addNode(parent, map, level + 1); + if (!parentNode) { + return element; + } + let save = false; + for (const kid of parentNode.kids) { + if (kid.type === StructElementType.ELEMENT && kid.dict === dict) { + kid.parentNode = element; + save = true; + } + } + if (!save) { + map.delete(dict); + } + return element; + } + addTopLevelNode(dict, element) { + const obj = this.rootDict.get("K"); + if (!obj) { + return false; + } + if (obj instanceof Dict) { + if (obj.objId !== dict.objId) { + return false; + } + this.nodes[0] = element; + return true; + } + if (!Array.isArray(obj)) { + return true; + } + let save = false; + for (let i = 0; i < obj.length; i++) { + const kidRef = obj[i]; + if (kidRef?.toString() === dict.objId) { + this.nodes[i] = element; + save = true; + } + } + return save; + } + get serializable() { + function nodeToSerializable(node, parent, level = 0) { + if (level > MAX_DEPTH) { + warn("StructTree too deep to be fully serialized."); + return; + } + const obj = Object.create(null); + obj.role = node.role; + obj.children = []; + parent.children.push(obj); + const alt = node.dict.get("Alt"); + if (typeof alt === "string") { + obj.alt = stringToPDFString(alt); + } + const lang = node.dict.get("Lang"); + if (typeof lang === "string") { + obj.lang = stringToPDFString(lang); + } + for (const kid of node.kids) { + const kidElement = kid.type === StructElementType.ELEMENT ? kid.parentNode : null; + if (kidElement) { + nodeToSerializable(kidElement, obj, level + 1); + continue; + } else if (kid.type === StructElementType.PAGE_CONTENT || kid.type === StructElementType.STREAM_CONTENT) { + obj.children.push({ + type: "content", + id: `p${kid.pageObjId}_mc${kid.mcid}` + }); + } else if (kid.type === StructElementType.OBJECT) { + obj.children.push({ + type: "object", + id: kid.refObjId + }); + } else if (kid.type === StructElementType.ANNOTATION) { + obj.children.push({ + type: "annotation", + id: `${AnnotationPrefix}${kid.refObjId}` + }); + } + } + } + const root = Object.create(null); + root.children = []; + root.role = "Root"; + for (const child of this.nodes) { + if (!child) { + continue; + } + nodeToSerializable(child, root); + } + return root; + } +} + +;// CONCATENATED MODULE: ./src/core/catalog.js + + + + + + + + + + + +function fetchDestination(dest) { + if (dest instanceof Dict) { + dest = dest.get("D"); + } + return Array.isArray(dest) ? dest : null; +} +function fetchRemoteDest(action) { + let dest = action.get("D"); + if (dest) { + if (dest instanceof Name) { + dest = dest.name; + } + if (typeof dest === "string") { + return stringToPDFString(dest); + } else if (Array.isArray(dest)) { + return JSON.stringify(dest); + } + } + return null; +} +class Catalog { + constructor(pdfManager, xref) { + this.pdfManager = pdfManager; + this.xref = xref; + this._catDict = xref.getCatalogObj(); + if (!(this._catDict instanceof Dict)) { + throw new FormatError("Catalog object is not a dictionary."); + } + this.toplevelPagesDict; + this._actualNumPages = null; + this.fontCache = new RefSetCache(); + this.builtInCMapCache = new Map(); + this.standardFontDataCache = new Map(); + this.globalImageCache = new GlobalImageCache(); + this.pageKidsCountCache = new RefSetCache(); + this.pageIndexCache = new RefSetCache(); + this.nonBlendModesSet = new RefSet(); + this.systemFontCache = new Map(); + } + cloneDict() { + return this._catDict.clone(); + } + get version() { + const version = this._catDict.get("Version"); + if (version instanceof Name) { + if (PDF_VERSION_REGEXP.test(version.name)) { + return shadow(this, "version", version.name); + } + warn(`Invalid PDF catalog version: ${version.name}`); + } + return shadow(this, "version", null); + } + get lang() { + const lang = this._catDict.get("Lang"); + return shadow(this, "lang", typeof lang === "string" ? stringToPDFString(lang) : null); + } + get needsRendering() { + const needsRendering = this._catDict.get("NeedsRendering"); + return shadow(this, "needsRendering", typeof needsRendering === "boolean" ? needsRendering : false); + } + get collection() { + let collection = null; + try { + const obj = this._catDict.get("Collection"); + if (obj instanceof Dict && obj.size > 0) { + collection = obj; + } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + info("Cannot fetch Collection entry; assuming no collection is present."); + } + return shadow(this, "collection", collection); + } + get acroForm() { + let acroForm = null; + try { + const obj = this._catDict.get("AcroForm"); + if (obj instanceof Dict && obj.size > 0) { + acroForm = obj; + } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + info("Cannot fetch AcroForm entry; assuming no forms are present."); + } + return shadow(this, "acroForm", acroForm); + } + get acroFormRef() { + const value = this._catDict.getRaw("AcroForm"); + return shadow(this, "acroFormRef", value instanceof Ref ? value : null); + } + get metadata() { + const streamRef = this._catDict.getRaw("Metadata"); + if (!(streamRef instanceof Ref)) { + return shadow(this, "metadata", null); + } + let metadata = null; + try { + const stream = this.xref.fetch(streamRef, !this.xref.encrypt?.encryptMetadata); + if (stream instanceof BaseStream && stream.dict instanceof Dict) { + const type = stream.dict.get("Type"); + const subtype = stream.dict.get("Subtype"); + if (isName(type, "Metadata") && isName(subtype, "XML")) { + const data = stringToUTF8String(stream.getString()); + if (data) { + metadata = new MetadataParser(data).serializable; + } + } + } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + info(`Skipping invalid Metadata: "${ex}".`); + } + return shadow(this, "metadata", metadata); + } + get markInfo() { + let markInfo = null; + try { + markInfo = this._readMarkInfo(); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn("Unable to read mark info."); + } + return shadow(this, "markInfo", markInfo); + } + _readMarkInfo() { + const obj = this._catDict.get("MarkInfo"); + if (!(obj instanceof Dict)) { + return null; + } + const markInfo = { + Marked: false, + UserProperties: false, + Suspects: false + }; + for (const key in markInfo) { + const value = obj.get(key); + if (typeof value === "boolean") { + markInfo[key] = value; + } + } + return markInfo; + } + get structTreeRoot() { + let structTree = null; + try { + structTree = this._readStructTreeRoot(); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn("Unable read to structTreeRoot info."); + } + return shadow(this, "structTreeRoot", structTree); + } + _readStructTreeRoot() { + const rawObj = this._catDict.getRaw("StructTreeRoot"); + const obj = this.xref.fetchIfRef(rawObj); + if (!(obj instanceof Dict)) { + return null; + } + const root = new StructTreeRoot(obj, rawObj); + root.init(); + return root; + } + get toplevelPagesDict() { + const pagesObj = this._catDict.get("Pages"); + if (!(pagesObj instanceof Dict)) { + throw new FormatError("Invalid top-level pages dictionary."); + } + return shadow(this, "toplevelPagesDict", pagesObj); + } + get documentOutline() { + let obj = null; + try { + obj = this._readDocumentOutline(); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn("Unable to read document outline."); + } + return shadow(this, "documentOutline", obj); + } + _readDocumentOutline() { + let obj = this._catDict.get("Outlines"); + if (!(obj instanceof Dict)) { + return null; + } + obj = obj.getRaw("First"); + if (!(obj instanceof Ref)) { + return null; + } + const root = { + items: [] + }; + const queue = [{ + obj, + parent: root + }]; + const processed = new RefSet(); + processed.put(obj); + const xref = this.xref, + blackColor = new Uint8ClampedArray(3); + while (queue.length > 0) { + const i = queue.shift(); + const outlineDict = xref.fetchIfRef(i.obj); + if (outlineDict === null) { + continue; + } + if (!outlineDict.has("Title")) { + throw new FormatError("Invalid outline item encountered."); + } + const data = { + url: null, + dest: null, + action: null + }; + Catalog.parseDestDictionary({ + destDict: outlineDict, + resultObj: data, + docBaseUrl: this.baseUrl, + docAttachments: this.attachments + }); + const title = outlineDict.get("Title"); + const flags = outlineDict.get("F") || 0; + const color = outlineDict.getArray("C"); + const count = outlineDict.get("Count"); + let rgbColor = blackColor; + if (Array.isArray(color) && color.length === 3 && (color[0] !== 0 || color[1] !== 0 || color[2] !== 0)) { + rgbColor = ColorSpace.singletons.rgb.getRgb(color, 0); + } + const outlineItem = { + action: data.action, + attachment: data.attachment, + dest: data.dest, + url: data.url, + unsafeUrl: data.unsafeUrl, + newWindow: data.newWindow, + setOCGState: data.setOCGState, + title: stringToPDFString(title), + color: rgbColor, + count: Number.isInteger(count) ? count : undefined, + bold: !!(flags & 2), + italic: !!(flags & 1), + items: [] + }; + i.parent.items.push(outlineItem); + obj = outlineDict.getRaw("First"); + if (obj instanceof Ref && !processed.has(obj)) { + queue.push({ + obj, + parent: outlineItem + }); + processed.put(obj); + } + obj = outlineDict.getRaw("Next"); + if (obj instanceof Ref && !processed.has(obj)) { + queue.push({ + obj, + parent: i.parent + }); + processed.put(obj); + } + } + return root.items.length > 0 ? root.items : null; + } + get permissions() { + let permissions = null; + try { + permissions = this._readPermissions(); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn("Unable to read permissions."); + } + return shadow(this, "permissions", permissions); + } + _readPermissions() { + const encrypt = this.xref.trailer.get("Encrypt"); + if (!(encrypt instanceof Dict)) { + return null; + } + let flags = encrypt.get("P"); + if (typeof flags !== "number") { + return null; + } + flags += 2 ** 32; + const permissions = []; + for (const key in PermissionFlag) { + const value = PermissionFlag[key]; + if (flags & value) { + permissions.push(value); + } + } + return permissions; + } + get optionalContentConfig() { + let config = null; + try { + const properties = this._catDict.get("OCProperties"); + if (!properties) { + return shadow(this, "optionalContentConfig", null); + } + const defaultConfig = properties.get("D"); + if (!defaultConfig) { + return shadow(this, "optionalContentConfig", null); + } + const groupsData = properties.get("OCGs"); + if (!Array.isArray(groupsData)) { + return shadow(this, "optionalContentConfig", null); + } + const groups = []; + const groupRefs = new RefSet(); + for (const groupRef of groupsData) { + if (!(groupRef instanceof Ref) || groupRefs.has(groupRef)) { + continue; + } + groupRefs.put(groupRef); + const group = this.xref.fetch(groupRef); + groups.push({ + id: groupRef.toString(), + name: typeof group.get("Name") === "string" ? stringToPDFString(group.get("Name")) : null, + intent: typeof group.get("Intent") === "string" ? stringToPDFString(group.get("Intent")) : null + }); + } + config = this._readOptionalContentConfig(defaultConfig, groupRefs); + config.groups = groups; + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`Unable to read optional content config: ${ex}`); + } + return shadow(this, "optionalContentConfig", config); + } + _readOptionalContentConfig(config, contentGroupRefs) { + function parseOnOff(refs) { + const onParsed = []; + if (Array.isArray(refs)) { + for (const value of refs) { + if (!(value instanceof Ref)) { + continue; + } + if (contentGroupRefs.has(value)) { + onParsed.push(value.toString()); + } + } + } + return onParsed; + } + function parseOrder(refs, nestedLevels = 0) { + if (!Array.isArray(refs)) { + return null; + } + const order = []; + for (const value of refs) { + if (value instanceof Ref && contentGroupRefs.has(value)) { + parsedOrderRefs.put(value); + order.push(value.toString()); + continue; + } + const nestedOrder = parseNestedOrder(value, nestedLevels); + if (nestedOrder) { + order.push(nestedOrder); + } + } + if (nestedLevels > 0) { + return order; + } + const hiddenGroups = []; + for (const groupRef of contentGroupRefs) { + if (parsedOrderRefs.has(groupRef)) { + continue; + } + hiddenGroups.push(groupRef.toString()); + } + if (hiddenGroups.length) { + order.push({ + name: null, + order: hiddenGroups + }); + } + return order; + } + function parseNestedOrder(ref, nestedLevels) { + if (++nestedLevels > MAX_NESTED_LEVELS) { + warn("parseNestedOrder - reached MAX_NESTED_LEVELS."); + return null; + } + const value = xref.fetchIfRef(ref); + if (!Array.isArray(value)) { + return null; + } + const nestedName = xref.fetchIfRef(value[0]); + if (typeof nestedName !== "string") { + return null; + } + const nestedOrder = parseOrder(value.slice(1), nestedLevels); + if (!nestedOrder || !nestedOrder.length) { + return null; + } + return { + name: stringToPDFString(nestedName), + order: nestedOrder + }; + } + const xref = this.xref, + parsedOrderRefs = new RefSet(), + MAX_NESTED_LEVELS = 10; + return { + name: typeof config.get("Name") === "string" ? stringToPDFString(config.get("Name")) : null, + creator: typeof config.get("Creator") === "string" ? stringToPDFString(config.get("Creator")) : null, + baseState: config.get("BaseState") instanceof Name ? config.get("BaseState").name : null, + on: parseOnOff(config.get("ON")), + off: parseOnOff(config.get("OFF")), + order: parseOrder(config.get("Order")), + groups: null + }; + } + setActualNumPages(num = null) { + this._actualNumPages = num; + } + get hasActualNumPages() { + return this._actualNumPages !== null; + } + get _pagesCount() { + const obj = this.toplevelPagesDict.get("Count"); + if (!Number.isInteger(obj)) { + throw new FormatError("Page count in top-level pages dictionary is not an integer."); + } + return shadow(this, "_pagesCount", obj); + } + get numPages() { + return this.hasActualNumPages ? this._actualNumPages : this._pagesCount; + } + get destinations() { + const obj = this._readDests(), + dests = Object.create(null); + if (obj instanceof NameTree) { + for (const [key, value] of obj.getAll()) { + const dest = fetchDestination(value); + if (dest) { + dests[stringToPDFString(key)] = dest; + } + } + } else if (obj instanceof Dict) { + obj.forEach(function (key, value) { + const dest = fetchDestination(value); + if (dest) { + dests[key] = dest; + } + }); + } + return shadow(this, "destinations", dests); + } + getDestination(id) { + const obj = this._readDests(); + if (obj instanceof NameTree) { + const dest = fetchDestination(obj.get(id)); + if (dest) { + return dest; + } + const allDest = this.destinations[id]; + if (allDest) { + warn(`Found "${id}" at an incorrect position in the NameTree.`); + return allDest; + } + } else if (obj instanceof Dict) { + const dest = fetchDestination(obj.get(id)); + if (dest) { + return dest; + } + } + return null; + } + _readDests() { + const obj = this._catDict.get("Names"); + if (obj?.has("Dests")) { + return new NameTree(obj.getRaw("Dests"), this.xref); + } else if (this._catDict.has("Dests")) { + return this._catDict.get("Dests"); + } + return undefined; + } + get pageLabels() { + let obj = null; + try { + obj = this._readPageLabels(); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn("Unable to read page labels."); + } + return shadow(this, "pageLabels", obj); + } + _readPageLabels() { + const obj = this._catDict.getRaw("PageLabels"); + if (!obj) { + return null; + } + const pageLabels = new Array(this.numPages); + let style = null, + prefix = ""; + const numberTree = new NumberTree(obj, this.xref); + const nums = numberTree.getAll(); + let currentLabel = "", + currentIndex = 1; + for (let i = 0, ii = this.numPages; i < ii; i++) { + const labelDict = nums.get(i); + if (labelDict !== undefined) { + if (!(labelDict instanceof Dict)) { + throw new FormatError("PageLabel is not a dictionary."); + } + if (labelDict.has("Type") && !isName(labelDict.get("Type"), "PageLabel")) { + throw new FormatError("Invalid type in PageLabel dictionary."); + } + if (labelDict.has("S")) { + const s = labelDict.get("S"); + if (!(s instanceof Name)) { + throw new FormatError("Invalid style in PageLabel dictionary."); + } + style = s.name; + } else { + style = null; + } + if (labelDict.has("P")) { + const p = labelDict.get("P"); + if (typeof p !== "string") { + throw new FormatError("Invalid prefix in PageLabel dictionary."); + } + prefix = stringToPDFString(p); + } else { + prefix = ""; + } + if (labelDict.has("St")) { + const st = labelDict.get("St"); + if (!(Number.isInteger(st) && st >= 1)) { + throw new FormatError("Invalid start in PageLabel dictionary."); + } + currentIndex = st; + } else { + currentIndex = 1; + } + } + switch (style) { + case "D": + currentLabel = currentIndex; + break; + case "R": + case "r": + currentLabel = toRomanNumerals(currentIndex, style === "r"); + break; + case "A": + case "a": + const LIMIT = 26; + const A_UPPER_CASE = 0x41, + A_LOWER_CASE = 0x61; + const baseCharCode = style === "a" ? A_LOWER_CASE : A_UPPER_CASE; + const letterIndex = currentIndex - 1; + const character = String.fromCharCode(baseCharCode + letterIndex % LIMIT); + currentLabel = character.repeat(Math.floor(letterIndex / LIMIT) + 1); + break; + default: + if (style) { + throw new FormatError(`Invalid style "${style}" in PageLabel dictionary.`); + } + currentLabel = ""; + } + pageLabels[i] = prefix + currentLabel; + currentIndex++; + } + return pageLabels; + } + get pageLayout() { + const obj = this._catDict.get("PageLayout"); + let pageLayout = ""; + if (obj instanceof Name) { + switch (obj.name) { + case "SinglePage": + case "OneColumn": + case "TwoColumnLeft": + case "TwoColumnRight": + case "TwoPageLeft": + case "TwoPageRight": + pageLayout = obj.name; + } + } + return shadow(this, "pageLayout", pageLayout); + } + get pageMode() { + const obj = this._catDict.get("PageMode"); + let pageMode = "UseNone"; + if (obj instanceof Name) { + switch (obj.name) { + case "UseNone": + case "UseOutlines": + case "UseThumbs": + case "FullScreen": + case "UseOC": + case "UseAttachments": + pageMode = obj.name; + } + } + return shadow(this, "pageMode", pageMode); + } + get viewerPreferences() { + const obj = this._catDict.get("ViewerPreferences"); + if (!(obj instanceof Dict)) { + return shadow(this, "viewerPreferences", null); + } + let prefs = null; + for (const key of obj.getKeys()) { + const value = obj.get(key); + let prefValue; + switch (key) { + case "HideToolbar": + case "HideMenubar": + case "HideWindowUI": + case "FitWindow": + case "CenterWindow": + case "DisplayDocTitle": + case "PickTrayByPDFSize": + if (typeof value === "boolean") { + prefValue = value; + } + break; + case "NonFullScreenPageMode": + if (value instanceof Name) { + switch (value.name) { + case "UseNone": + case "UseOutlines": + case "UseThumbs": + case "UseOC": + prefValue = value.name; + break; + default: + prefValue = "UseNone"; + } + } + break; + case "Direction": + if (value instanceof Name) { + switch (value.name) { + case "L2R": + case "R2L": + prefValue = value.name; + break; + default: + prefValue = "L2R"; + } + } + break; + case "ViewArea": + case "ViewClip": + case "PrintArea": + case "PrintClip": + if (value instanceof Name) { + switch (value.name) { + case "MediaBox": + case "CropBox": + case "BleedBox": + case "TrimBox": + case "ArtBox": + prefValue = value.name; + break; + default: + prefValue = "CropBox"; + } + } + break; + case "PrintScaling": + if (value instanceof Name) { + switch (value.name) { + case "None": + case "AppDefault": + prefValue = value.name; + break; + default: + prefValue = "AppDefault"; + } + } + break; + case "Duplex": + if (value instanceof Name) { + switch (value.name) { + case "Simplex": + case "DuplexFlipShortEdge": + case "DuplexFlipLongEdge": + prefValue = value.name; + break; + default: + prefValue = "None"; + } + } + break; + case "PrintPageRange": + if (Array.isArray(value) && value.length % 2 === 0) { + const isValid = value.every((page, i, arr) => { + return Number.isInteger(page) && page > 0 && (i === 0 || page >= arr[i - 1]) && page <= this.numPages; + }); + if (isValid) { + prefValue = value; + } + } + break; + case "NumCopies": + if (Number.isInteger(value) && value > 0) { + prefValue = value; + } + break; + default: + warn(`Ignoring non-standard key in ViewerPreferences: ${key}.`); + continue; + } + if (prefValue === undefined) { + warn(`Bad value, for key "${key}", in ViewerPreferences: ${value}.`); + continue; + } + if (!prefs) { + prefs = Object.create(null); + } + prefs[key] = prefValue; + } + return shadow(this, "viewerPreferences", prefs); + } + get openAction() { + const obj = this._catDict.get("OpenAction"); + const openAction = Object.create(null); + if (obj instanceof Dict) { + const destDict = new Dict(this.xref); + destDict.set("A", obj); + const resultObj = { + url: null, + dest: null, + action: null + }; + Catalog.parseDestDictionary({ + destDict, + resultObj + }); + if (Array.isArray(resultObj.dest)) { + openAction.dest = resultObj.dest; + } else if (resultObj.action) { + openAction.action = resultObj.action; + } + } else if (Array.isArray(obj)) { + openAction.dest = obj; + } + return shadow(this, "openAction", objectSize(openAction) > 0 ? openAction : null); + } + get attachments() { + const obj = this._catDict.get("Names"); + let attachments = null; + if (obj instanceof Dict && obj.has("EmbeddedFiles")) { + const nameTree = new NameTree(obj.getRaw("EmbeddedFiles"), this.xref); + for (const [key, value] of nameTree.getAll()) { + const fs = new FileSpec(value, this.xref); + if (!attachments) { + attachments = Object.create(null); + } + attachments[stringToPDFString(key)] = fs.serializable; + } + } + return shadow(this, "attachments", attachments); + } + get xfaImages() { + const obj = this._catDict.get("Names"); + let xfaImages = null; + if (obj instanceof Dict && obj.has("XFAImages")) { + const nameTree = new NameTree(obj.getRaw("XFAImages"), this.xref); + for (const [key, value] of nameTree.getAll()) { + if (!xfaImages) { + xfaImages = new Dict(this.xref); + } + xfaImages.set(stringToPDFString(key), value); + } + } + return shadow(this, "xfaImages", xfaImages); + } + _collectJavaScript() { + const obj = this._catDict.get("Names"); + let javaScript = null; + function appendIfJavaScriptDict(name, jsDict) { + if (!(jsDict instanceof Dict)) { + return; + } + if (!isName(jsDict.get("S"), "JavaScript")) { + return; + } + let js = jsDict.get("JS"); + if (js instanceof BaseStream) { + js = js.getString(); + } else if (typeof js !== "string") { + return; + } + js = stringToPDFString(js).replaceAll("\x00", ""); + if (js) { + (javaScript ||= new Map()).set(name, js); + } + } + if (obj instanceof Dict && obj.has("JavaScript")) { + const nameTree = new NameTree(obj.getRaw("JavaScript"), this.xref); + for (const [key, value] of nameTree.getAll()) { + appendIfJavaScriptDict(stringToPDFString(key), value); + } + } + const openAction = this._catDict.get("OpenAction"); + if (openAction) { + appendIfJavaScriptDict("OpenAction", openAction); + } + return javaScript; + } + get jsActions() { + const javaScript = this._collectJavaScript(); + let actions = collectActions(this.xref, this._catDict, DocumentActionEventType); + if (javaScript) { + actions ||= Object.create(null); + for (const [key, val] of javaScript) { + if (key in actions) { + actions[key].push(val); + } else { + actions[key] = [val]; + } + } + } + return shadow(this, "jsActions", actions); + } + async fontFallback(id, handler) { + const translatedFonts = await Promise.all(this.fontCache); + for (const translatedFont of translatedFonts) { + if (translatedFont.loadedName === id) { + translatedFont.fallback(handler); + return; + } + } + } + async cleanup(manuallyTriggered = false) { + clearGlobalCaches(); + this.globalImageCache.clear(manuallyTriggered); + this.pageKidsCountCache.clear(); + this.pageIndexCache.clear(); + this.nonBlendModesSet.clear(); + const translatedFonts = await Promise.all(this.fontCache); + for (const { + dict + } of translatedFonts) { + delete dict.cacheKey; + } + this.fontCache.clear(); + this.builtInCMapCache.clear(); + this.standardFontDataCache.clear(); + this.systemFontCache.clear(); + } + async getPageDict(pageIndex) { + const nodesToVisit = [this.toplevelPagesDict]; + const visitedNodes = new RefSet(); + const pagesRef = this._catDict.getRaw("Pages"); + if (pagesRef instanceof Ref) { + visitedNodes.put(pagesRef); + } + const xref = this.xref, + pageKidsCountCache = this.pageKidsCountCache, + pageIndexCache = this.pageIndexCache; + let currentPageIndex = 0; + while (nodesToVisit.length) { + const currentNode = nodesToVisit.pop(); + if (currentNode instanceof Ref) { + const count = pageKidsCountCache.get(currentNode); + if (count >= 0 && currentPageIndex + count <= pageIndex) { + currentPageIndex += count; + continue; + } + if (visitedNodes.has(currentNode)) { + throw new FormatError("Pages tree contains circular reference."); + } + visitedNodes.put(currentNode); + const obj = await xref.fetchAsync(currentNode); + if (obj instanceof Dict) { + let type = obj.getRaw("Type"); + if (type instanceof Ref) { + type = await xref.fetchAsync(type); + } + if (isName(type, "Page") || !obj.has("Kids")) { + if (!pageKidsCountCache.has(currentNode)) { + pageKidsCountCache.put(currentNode, 1); + } + if (!pageIndexCache.has(currentNode)) { + pageIndexCache.put(currentNode, currentPageIndex); + } + if (currentPageIndex === pageIndex) { + return [obj, currentNode]; + } + currentPageIndex++; + continue; + } + } + nodesToVisit.push(obj); + continue; + } + if (!(currentNode instanceof Dict)) { + throw new FormatError("Page dictionary kid reference points to wrong type of object."); + } + const { + objId + } = currentNode; + let count = currentNode.getRaw("Count"); + if (count instanceof Ref) { + count = await xref.fetchAsync(count); + } + if (Number.isInteger(count) && count >= 0) { + if (objId && !pageKidsCountCache.has(objId)) { + pageKidsCountCache.put(objId, count); + } + if (currentPageIndex + count <= pageIndex) { + currentPageIndex += count; + continue; + } + } + let kids = currentNode.getRaw("Kids"); + if (kids instanceof Ref) { + kids = await xref.fetchAsync(kids); + } + if (!Array.isArray(kids)) { + let type = currentNode.getRaw("Type"); + if (type instanceof Ref) { + type = await xref.fetchAsync(type); + } + if (isName(type, "Page") || !currentNode.has("Kids")) { + if (currentPageIndex === pageIndex) { + return [currentNode, null]; + } + currentPageIndex++; + continue; + } + throw new FormatError("Page dictionary kids object is not an array."); + } + for (let last = kids.length - 1; last >= 0; last--) { + nodesToVisit.push(kids[last]); + } + } + throw new Error(`Page index ${pageIndex} not found.`); + } + async getAllPageDicts(recoveryMode = false) { + const { + ignoreErrors + } = this.pdfManager.evaluatorOptions; + const queue = [{ + currentNode: this.toplevelPagesDict, + posInKids: 0 + }]; + const visitedNodes = new RefSet(); + const pagesRef = this._catDict.getRaw("Pages"); + if (pagesRef instanceof Ref) { + visitedNodes.put(pagesRef); + } + const map = new Map(), + xref = this.xref, + pageIndexCache = this.pageIndexCache; + let pageIndex = 0; + function addPageDict(pageDict, pageRef) { + if (pageRef && !pageIndexCache.has(pageRef)) { + pageIndexCache.put(pageRef, pageIndex); + } + map.set(pageIndex++, [pageDict, pageRef]); + } + function addPageError(error) { + if (error instanceof XRefEntryException && !recoveryMode) { + throw error; + } + if (recoveryMode && ignoreErrors && pageIndex === 0) { + warn(`getAllPageDicts - Skipping invalid first page: "${error}".`); + error = Dict.empty; + } + map.set(pageIndex++, [error, null]); + } + while (queue.length > 0) { + const queueItem = queue.at(-1); + const { + currentNode, + posInKids + } = queueItem; + let kids = currentNode.getRaw("Kids"); + if (kids instanceof Ref) { + try { + kids = await xref.fetchAsync(kids); + } catch (ex) { + addPageError(ex); + break; + } + } + if (!Array.isArray(kids)) { + addPageError(new FormatError("Page dictionary kids object is not an array.")); + break; + } + if (posInKids >= kids.length) { + queue.pop(); + continue; + } + const kidObj = kids[posInKids]; + let obj; + if (kidObj instanceof Ref) { + if (visitedNodes.has(kidObj)) { + addPageError(new FormatError("Pages tree contains circular reference.")); + break; + } + visitedNodes.put(kidObj); + try { + obj = await xref.fetchAsync(kidObj); + } catch (ex) { + addPageError(ex); + break; + } + } else { + obj = kidObj; + } + if (!(obj instanceof Dict)) { + addPageError(new FormatError("Page dictionary kid reference points to wrong type of object.")); + break; + } + let type = obj.getRaw("Type"); + if (type instanceof Ref) { + try { + type = await xref.fetchAsync(type); + } catch (ex) { + addPageError(ex); + break; + } + } + if (isName(type, "Page") || !obj.has("Kids")) { + addPageDict(obj, kidObj instanceof Ref ? kidObj : null); + } else { + queue.push({ + currentNode: obj, + posInKids: 0 + }); + } + queueItem.posInKids++; + } + return map; + } + getPageIndex(pageRef) { + const cachedPageIndex = this.pageIndexCache.get(pageRef); + if (cachedPageIndex !== undefined) { + return Promise.resolve(cachedPageIndex); + } + const xref = this.xref; + function pagesBeforeRef(kidRef) { + let total = 0, + parentRef; + return xref.fetchAsync(kidRef).then(function (node) { + if (isRefsEqual(kidRef, pageRef) && !isDict(node, "Page") && !(node instanceof Dict && !node.has("Type") && node.has("Contents"))) { + throw new FormatError("The reference does not point to a /Page dictionary."); + } + if (!node) { + return null; + } + if (!(node instanceof Dict)) { + throw new FormatError("Node must be a dictionary."); + } + parentRef = node.getRaw("Parent"); + return node.getAsync("Parent"); + }).then(function (parent) { + if (!parent) { + return null; + } + if (!(parent instanceof Dict)) { + throw new FormatError("Parent must be a dictionary."); + } + return parent.getAsync("Kids"); + }).then(function (kids) { + if (!kids) { + return null; + } + const kidPromises = []; + let found = false; + for (const kid of kids) { + if (!(kid instanceof Ref)) { + throw new FormatError("Kid must be a reference."); + } + if (isRefsEqual(kid, kidRef)) { + found = true; + break; + } + kidPromises.push(xref.fetchAsync(kid).then(function (obj) { + if (!(obj instanceof Dict)) { + throw new FormatError("Kid node must be a dictionary."); + } + if (obj.has("Count")) { + total += obj.get("Count"); + } else { + total++; + } + })); + } + if (!found) { + throw new FormatError("Kid reference not found in parent's kids."); + } + return Promise.all(kidPromises).then(function () { + return [total, parentRef]; + }); + }); + } + let total = 0; + const next = ref => pagesBeforeRef(ref).then(args => { + if (!args) { + this.pageIndexCache.put(pageRef, total); + return total; + } + const [count, parentRef] = args; + total += count; + return next(parentRef); + }); + return next(pageRef); + } + get baseUrl() { + const uri = this._catDict.get("URI"); + if (uri instanceof Dict) { + const base = uri.get("Base"); + if (typeof base === "string") { + const absoluteUrl = createValidAbsoluteUrl(base, null, { + tryConvertEncoding: true + }); + if (absoluteUrl) { + return shadow(this, "baseUrl", absoluteUrl.href); + } + } + } + return shadow(this, "baseUrl", this.pdfManager.docBaseUrl); + } + static parseDestDictionary({ + destDict, + resultObj, + docBaseUrl = null, + docAttachments = null + }) { + if (!(destDict instanceof Dict)) { + warn("parseDestDictionary: `destDict` must be a dictionary."); + return; + } + let action = destDict.get("A"), + url, + dest; + if (!(action instanceof Dict)) { + if (destDict.has("Dest")) { + action = destDict.get("Dest"); + } else { + action = destDict.get("AA"); + if (action instanceof Dict) { + if (action.has("D")) { + action = action.get("D"); + } else if (action.has("U")) { + action = action.get("U"); + } + } + } + } + if (action instanceof Dict) { + const actionType = action.get("S"); + if (!(actionType instanceof Name)) { + warn("parseDestDictionary: Invalid type in Action dictionary."); + return; + } + const actionName = actionType.name; + switch (actionName) { + case "ResetForm": + const flags = action.get("Flags"); + const include = ((typeof flags === "number" ? flags : 0) & 1) === 0; + const fields = []; + const refs = []; + for (const obj of action.get("Fields") || []) { + if (obj instanceof Ref) { + refs.push(obj.toString()); + } else if (typeof obj === "string") { + fields.push(stringToPDFString(obj)); + } + } + resultObj.resetForm = { + fields, + refs, + include + }; + break; + case "URI": + url = action.get("URI"); + if (url instanceof Name) { + url = "/" + url.name; + } + break; + case "GoTo": + dest = action.get("D"); + break; + case "Launch": + case "GoToR": + const urlDict = action.get("F"); + if (urlDict instanceof Dict) { + url = urlDict.get("F") || null; + } else if (typeof urlDict === "string") { + url = urlDict; + } + const remoteDest = fetchRemoteDest(action); + if (remoteDest && typeof url === "string") { + url = url.split("#", 1)[0] + "#" + remoteDest; + } + const newWindow = action.get("NewWindow"); + if (typeof newWindow === "boolean") { + resultObj.newWindow = newWindow; + } + break; + case "GoToE": + const target = action.get("T"); + let attachment; + if (docAttachments && target instanceof Dict) { + const relationship = target.get("R"); + const name = target.get("N"); + if (isName(relationship, "C") && typeof name === "string") { + attachment = docAttachments[stringToPDFString(name)]; + } + } + if (attachment) { + resultObj.attachment = attachment; + const attachmentDest = fetchRemoteDest(action); + if (attachmentDest) { + resultObj.attachmentDest = attachmentDest; + } + } else { + warn(`parseDestDictionary - unimplemented "GoToE" action.`); + } + break; + case "Named": + const namedAction = action.get("N"); + if (namedAction instanceof Name) { + resultObj.action = namedAction.name; + } + break; + case "SetOCGState": + const state = action.get("State"); + const preserveRB = action.get("PreserveRB"); + if (!Array.isArray(state) || state.length === 0) { + break; + } + const stateArr = []; + for (const elem of state) { + if (elem instanceof Name) { + switch (elem.name) { + case "ON": + case "OFF": + case "Toggle": + stateArr.push(elem.name); + break; + } + } else if (elem instanceof Ref) { + stateArr.push(elem.toString()); + } + } + if (stateArr.length !== state.length) { + break; + } + resultObj.setOCGState = { + state: stateArr, + preserveRB: typeof preserveRB === "boolean" ? preserveRB : true + }; + break; + case "JavaScript": + const jsAction = action.get("JS"); + let js; + if (jsAction instanceof BaseStream) { + js = jsAction.getString(); + } else if (typeof jsAction === "string") { + js = jsAction; + } + const jsURL = js && recoverJsURL(stringToPDFString(js)); + if (jsURL) { + url = jsURL.url; + resultObj.newWindow = jsURL.newWindow; + break; + } + default: + if (actionName === "JavaScript" || actionName === "SubmitForm") { + break; + } + warn(`parseDestDictionary - unsupported action: "${actionName}".`); + break; + } + } else if (destDict.has("Dest")) { + dest = destDict.get("Dest"); + } + if (typeof url === "string") { + const absoluteUrl = createValidAbsoluteUrl(url, docBaseUrl, { + addDefaultProtocol: true, + tryConvertEncoding: true + }); + if (absoluteUrl) { + resultObj.url = absoluteUrl.href; + } + resultObj.unsafeUrl = url; + } + if (dest) { + if (dest instanceof Name) { + dest = dest.name; + } + if (typeof dest === "string") { + resultObj.dest = stringToPDFString(dest); + } else if (Array.isArray(dest)) { + resultObj.dest = dest; + } + } + } +} + +;// CONCATENATED MODULE: ./src/core/object_loader.js + + + + +function mayHaveChildren(value) { + return value instanceof Ref || value instanceof Dict || value instanceof BaseStream || Array.isArray(value); +} +function addChildren(node, nodesToVisit) { + if (node instanceof Dict) { + node = node.getRawValues(); + } else if (node instanceof BaseStream) { + node = node.dict.getRawValues(); + } else if (!Array.isArray(node)) { + return; + } + for (const rawValue of node) { + if (mayHaveChildren(rawValue)) { + nodesToVisit.push(rawValue); + } + } +} +class ObjectLoader { + constructor(dict, keys, xref) { + this.dict = dict; + this.keys = keys; + this.xref = xref; + this.refSet = null; + } + async load() { + if (this.xref.stream.isDataLoaded) { + return undefined; + } + const { + keys, + dict + } = this; + this.refSet = new RefSet(); + const nodesToVisit = []; + for (const key of keys) { + const rawValue = dict.getRaw(key); + if (rawValue !== undefined) { + nodesToVisit.push(rawValue); + } + } + return this._walk(nodesToVisit); + } + async _walk(nodesToVisit) { + const nodesToRevisit = []; + const pendingRequests = []; + while (nodesToVisit.length) { + let currentNode = nodesToVisit.pop(); + if (currentNode instanceof Ref) { + if (this.refSet.has(currentNode)) { + continue; + } + try { + this.refSet.put(currentNode); + currentNode = this.xref.fetch(currentNode); + } catch (ex) { + if (!(ex instanceof MissingDataException)) { + warn(`ObjectLoader._walk - requesting all data: "${ex}".`); + this.refSet = null; + const { + manager + } = this.xref.stream; + return manager.requestAllChunks(); + } + nodesToRevisit.push(currentNode); + pendingRequests.push({ + begin: ex.begin, + end: ex.end + }); + } + } + if (currentNode instanceof BaseStream) { + const baseStreams = currentNode.getBaseStreams(); + if (baseStreams) { + let foundMissingData = false; + for (const stream of baseStreams) { + if (stream.isDataLoaded) { + continue; + } + foundMissingData = true; + pendingRequests.push({ + begin: stream.start, + end: stream.end + }); + } + if (foundMissingData) { + nodesToRevisit.push(currentNode); + } + } + } + addChildren(currentNode, nodesToVisit); + } + if (pendingRequests.length) { + await this.xref.stream.manager.requestRanges(pendingRequests); + for (const node of nodesToRevisit) { + if (node instanceof Ref) { + this.refSet.remove(node); + } + } + return this._walk(nodesToRevisit); + } + this.refSet = null; + return undefined; + } +} + +;// CONCATENATED MODULE: ./src/core/xfa/symbol_utils.js +const $acceptWhitespace = Symbol(); +const $addHTML = Symbol(); +const $appendChild = Symbol(); +const $childrenToHTML = Symbol(); +const $clean = Symbol(); +const $cleanPage = Symbol(); +const $cleanup = Symbol(); +const $clone = Symbol(); +const $consumed = Symbol(); +const $content = Symbol("content"); +const $data = Symbol("data"); +const $dump = Symbol(); +const $extra = Symbol("extra"); +const $finalize = Symbol(); +const $flushHTML = Symbol(); +const $getAttributeIt = Symbol(); +const $getAttributes = Symbol(); +const $getAvailableSpace = Symbol(); +const $getChildrenByClass = Symbol(); +const $getChildrenByName = Symbol(); +const $getChildrenByNameIt = Symbol(); +const $getDataValue = Symbol(); +const $getExtra = Symbol(); +const $getRealChildrenByNameIt = Symbol(); +const $getChildren = Symbol(); +const $getContainedChildren = Symbol(); +const $getNextPage = Symbol(); +const $getSubformParent = Symbol(); +const $getParent = Symbol(); +const $getTemplateRoot = Symbol(); +const $globalData = Symbol(); +const $hasSettableValue = Symbol(); +const $ids = Symbol(); +const $indexOf = Symbol(); +const $insertAt = Symbol(); +const $isCDATAXml = Symbol(); +const $isBindable = Symbol(); +const $isDataValue = Symbol(); +const $isDescendent = Symbol(); +const $isNsAgnostic = Symbol(); +const $isSplittable = Symbol(); +const $isThereMoreWidth = Symbol(); +const $isTransparent = Symbol(); +const $isUsable = Symbol(); +const $lastAttribute = Symbol(); +const $namespaceId = Symbol("namespaceId"); +const $nodeName = Symbol("nodeName"); +const $nsAttributes = Symbol(); +const $onChild = Symbol(); +const $onChildCheck = Symbol(); +const $onText = Symbol(); +const $pushGlyphs = Symbol(); +const $popPara = Symbol(); +const $pushPara = Symbol(); +const $removeChild = Symbol(); +const $root = Symbol("root"); +const $resolvePrototypes = Symbol(); +const $searchNode = Symbol(); +const $setId = Symbol(); +const $setSetAttributes = Symbol(); +const $setValue = Symbol(); +const $tabIndex = Symbol(); +const $text = Symbol(); +const $toPages = Symbol(); +const $toHTML = Symbol(); +const $toString = Symbol(); +const $toStyle = Symbol(); +const $uid = Symbol("uid"); + +;// CONCATENATED MODULE: ./src/core/xfa/namespaces.js +const $buildXFAObject = Symbol(); +const NamespaceIds = { + config: { + id: 0, + check: ns => ns.startsWith("http://www.xfa.org/schema/xci/") + }, + connectionSet: { + id: 1, + check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-connection-set/") + }, + datasets: { + id: 2, + check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-data/") + }, + form: { + id: 3, + check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-form/") + }, + localeSet: { + id: 4, + check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-locale-set/") + }, + pdf: { + id: 5, + check: ns => ns === "http://ns.adobe.com/xdp/pdf/" + }, + signature: { + id: 6, + check: ns => ns === "http://www.w3.org/2000/09/xmldsig#" + }, + sourceSet: { + id: 7, + check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-source-set/") + }, + stylesheet: { + id: 8, + check: ns => ns === "http://www.w3.org/1999/XSL/Transform" + }, + template: { + id: 9, + check: ns => ns.startsWith("http://www.xfa.org/schema/xfa-template/") + }, + xdc: { + id: 10, + check: ns => ns.startsWith("http://www.xfa.org/schema/xdc/") + }, + xdp: { + id: 11, + check: ns => ns === "http://ns.adobe.com/xdp/" + }, + xfdf: { + id: 12, + check: ns => ns === "http://ns.adobe.com/xfdf/" + }, + xhtml: { + id: 13, + check: ns => ns === "http://www.w3.org/1999/xhtml" + }, + xmpmeta: { + id: 14, + check: ns => ns === "http://ns.adobe.com/xmpmeta/" + } +}; + +;// CONCATENATED MODULE: ./src/core/xfa/utils.js + +const dimConverters = { + pt: x => x, + cm: x => x / 2.54 * 72, + mm: x => x / (10 * 2.54) * 72, + in: x => x * 72, + px: x => x +}; +const measurementPattern = /([+-]?\d+\.?\d*)(.*)/; +function stripQuotes(str) { + if (str.startsWith("'") || str.startsWith('"')) { + return str.slice(1, -1); + } + return str; +} +function getInteger({ + data, + defaultValue, + validate +}) { + if (!data) { + return defaultValue; + } + data = data.trim(); + const n = parseInt(data, 10); + if (!isNaN(n) && validate(n)) { + return n; + } + return defaultValue; +} +function getFloat({ + data, + defaultValue, + validate +}) { + if (!data) { + return defaultValue; + } + data = data.trim(); + const n = parseFloat(data); + if (!isNaN(n) && validate(n)) { + return n; + } + return defaultValue; +} +function getKeyword({ + data, + defaultValue, + validate +}) { + if (!data) { + return defaultValue; + } + data = data.trim(); + if (validate(data)) { + return data; + } + return defaultValue; +} +function getStringOption(data, options) { + return getKeyword({ + data, + defaultValue: options[0], + validate: k => options.includes(k) + }); +} +function getMeasurement(str, def = "0") { + def ||= "0"; + if (!str) { + return getMeasurement(def); + } + const match = str.trim().match(measurementPattern); + if (!match) { + return getMeasurement(def); + } + const [, valueStr, unit] = match; + const value = parseFloat(valueStr); + if (isNaN(value)) { + return getMeasurement(def); + } + if (value === 0) { + return 0; + } + const conv = dimConverters[unit]; + if (conv) { + return conv(value); + } + return value; +} +function getRatio(data) { + if (!data) { + return { + num: 1, + den: 1 + }; + } + const ratio = data.trim().split(/\s*:\s*/).map(x => parseFloat(x)).filter(x => !isNaN(x)); + if (ratio.length === 1) { + ratio.push(1); + } + if (ratio.length === 0) { + return { + num: 1, + den: 1 + }; + } + const [num, den] = ratio; + return { + num, + den + }; +} +function getRelevant(data) { + if (!data) { + return []; + } + return data.trim().split(/\s+/).map(e => { + return { + excluded: e[0] === "-", + viewname: e.substring(1) + }; + }); +} +function getColor(data, def = [0, 0, 0]) { + let [r, g, b] = def; + if (!data) { + return { + r, + g, + b + }; + } + const color = data.trim().split(/\s*,\s*/).map(c => Math.min(Math.max(0, parseInt(c.trim(), 10)), 255)).map(c => isNaN(c) ? 0 : c); + if (color.length < 3) { + return { + r, + g, + b + }; + } + [r, g, b] = color; + return { + r, + g, + b + }; +} +function getBBox(data) { + const def = -1; + if (!data) { + return { + x: def, + y: def, + width: def, + height: def + }; + } + const bbox = data.trim().split(/\s*,\s*/).map(m => getMeasurement(m, "-1")); + if (bbox.length < 4 || bbox[2] < 0 || bbox[3] < 0) { + return { + x: def, + y: def, + width: def, + height: def + }; + } + const [x, y, width, height] = bbox; + return { + x, + y, + width, + height + }; +} +class HTMLResult { + static get FAILURE() { + return shadow(this, "FAILURE", new HTMLResult(false, null, null, null)); + } + static get EMPTY() { + return shadow(this, "EMPTY", new HTMLResult(true, null, null, null)); + } + constructor(success, html, bbox, breakNode) { + this.success = success; + this.html = html; + this.bbox = bbox; + this.breakNode = breakNode; + } + isBreak() { + return !!this.breakNode; + } + static breakNode(node) { + return new HTMLResult(false, null, null, node); + } + static success(html, bbox = null) { + return new HTMLResult(true, html, bbox, null); + } +} + +;// CONCATENATED MODULE: ./src/core/xfa/fonts.js + + + +class FontFinder { + constructor(pdfFonts) { + this.fonts = new Map(); + this.cache = new Map(); + this.warned = new Set(); + this.defaultFont = null; + this.add(pdfFonts); + } + add(pdfFonts, reallyMissingFonts = null) { + for (const pdfFont of pdfFonts) { + this.addPdfFont(pdfFont); + } + for (const pdfFont of this.fonts.values()) { + if (!pdfFont.regular) { + pdfFont.regular = pdfFont.italic || pdfFont.bold || pdfFont.bolditalic; + } + } + if (!reallyMissingFonts || reallyMissingFonts.size === 0) { + return; + } + const myriad = this.fonts.get("PdfJS-Fallback-PdfJS-XFA"); + for (const missing of reallyMissingFonts) { + this.fonts.set(missing, myriad); + } + } + addPdfFont(pdfFont) { + const cssFontInfo = pdfFont.cssFontInfo; + const name = cssFontInfo.fontFamily; + let font = this.fonts.get(name); + if (!font) { + font = Object.create(null); + this.fonts.set(name, font); + if (!this.defaultFont) { + this.defaultFont = font; + } + } + let property = ""; + const fontWeight = parseFloat(cssFontInfo.fontWeight); + if (parseFloat(cssFontInfo.italicAngle) !== 0) { + property = fontWeight >= 700 ? "bolditalic" : "italic"; + } else if (fontWeight >= 700) { + property = "bold"; + } + if (!property) { + if (pdfFont.name.includes("Bold") || pdfFont.psName?.includes("Bold")) { + property = "bold"; + } + if (pdfFont.name.includes("Italic") || pdfFont.name.endsWith("It") || pdfFont.psName?.includes("Italic") || pdfFont.psName?.endsWith("It")) { + property += "italic"; + } + } + if (!property) { + property = "regular"; + } + font[property] = pdfFont; + } + getDefault() { + return this.defaultFont; + } + find(fontName, mustWarn = true) { + let font = this.fonts.get(fontName) || this.cache.get(fontName); + if (font) { + return font; + } + const pattern = /,|-|_| |bolditalic|bold|italic|regular|it/gi; + let name = fontName.replaceAll(pattern, ""); + font = this.fonts.get(name); + if (font) { + this.cache.set(fontName, font); + return font; + } + name = name.toLowerCase(); + const maybe = []; + for (const [family, pdfFont] of this.fonts.entries()) { + if (family.replaceAll(pattern, "").toLowerCase().startsWith(name)) { + maybe.push(pdfFont); + } + } + if (maybe.length === 0) { + for (const [, pdfFont] of this.fonts.entries()) { + if (pdfFont.regular.name?.replaceAll(pattern, "").toLowerCase().startsWith(name)) { + maybe.push(pdfFont); + } + } + } + if (maybe.length === 0) { + name = name.replaceAll(/psmt|mt/gi, ""); + for (const [family, pdfFont] of this.fonts.entries()) { + if (family.replaceAll(pattern, "").toLowerCase().startsWith(name)) { + maybe.push(pdfFont); + } + } + } + if (maybe.length === 0) { + for (const pdfFont of this.fonts.values()) { + if (pdfFont.regular.name?.replaceAll(pattern, "").toLowerCase().startsWith(name)) { + maybe.push(pdfFont); + } + } + } + if (maybe.length >= 1) { + if (maybe.length !== 1 && mustWarn) { + warn(`XFA - Too many choices to guess the correct font: ${fontName}`); + } + this.cache.set(fontName, maybe[0]); + return maybe[0]; + } + if (mustWarn && !this.warned.has(fontName)) { + this.warned.add(fontName); + warn(`XFA - Cannot find the font: ${fontName}`); + } + return null; + } +} +function selectFont(xfaFont, typeface) { + if (xfaFont.posture === "italic") { + if (xfaFont.weight === "bold") { + return typeface.bolditalic; + } + return typeface.italic; + } else if (xfaFont.weight === "bold") { + return typeface.bold; + } + return typeface.regular; +} +function fonts_getMetrics(xfaFont, real = false) { + let pdfFont = null; + if (xfaFont) { + const name = stripQuotes(xfaFont.typeface); + const typeface = xfaFont[$globalData].fontFinder.find(name); + pdfFont = selectFont(xfaFont, typeface); + } + if (!pdfFont) { + return { + lineHeight: 12, + lineGap: 2, + lineNoGap: 10 + }; + } + const size = xfaFont.size || 10; + const lineHeight = pdfFont.lineHeight ? Math.max(real ? 0 : 1.2, pdfFont.lineHeight) : 1.2; + const lineGap = pdfFont.lineGap === undefined ? 0.2 : pdfFont.lineGap; + return { + lineHeight: lineHeight * size, + lineGap: lineGap * size, + lineNoGap: Math.max(1, lineHeight - lineGap) * size + }; +} + +;// CONCATENATED MODULE: ./src/core/xfa/text.js + +const WIDTH_FACTOR = 1.02; +class FontInfo { + constructor(xfaFont, margin, lineHeight, fontFinder) { + this.lineHeight = lineHeight; + this.paraMargin = margin || { + top: 0, + bottom: 0, + left: 0, + right: 0 + }; + if (!xfaFont) { + [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder); + return; + } + this.xfaFont = { + typeface: xfaFont.typeface, + posture: xfaFont.posture, + weight: xfaFont.weight, + size: xfaFont.size, + letterSpacing: xfaFont.letterSpacing + }; + const typeface = fontFinder.find(xfaFont.typeface); + if (!typeface) { + [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder); + return; + } + this.pdfFont = selectFont(xfaFont, typeface); + if (!this.pdfFont) { + [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder); + } + } + defaultFont(fontFinder) { + const font = fontFinder.find("Helvetica", false) || fontFinder.find("Myriad Pro", false) || fontFinder.find("Arial", false) || fontFinder.getDefault(); + if (font?.regular) { + const pdfFont = font.regular; + const info = pdfFont.cssFontInfo; + const xfaFont = { + typeface: info.fontFamily, + posture: "normal", + weight: "normal", + size: 10, + letterSpacing: 0 + }; + return [pdfFont, xfaFont]; + } + const xfaFont = { + typeface: "Courier", + posture: "normal", + weight: "normal", + size: 10, + letterSpacing: 0 + }; + return [null, xfaFont]; + } +} +class FontSelector { + constructor(defaultXfaFont, defaultParaMargin, defaultLineHeight, fontFinder) { + this.fontFinder = fontFinder; + this.stack = [new FontInfo(defaultXfaFont, defaultParaMargin, defaultLineHeight, fontFinder)]; + } + pushData(xfaFont, margin, lineHeight) { + const lastFont = this.stack.at(-1); + for (const name of ["typeface", "posture", "weight", "size", "letterSpacing"]) { + if (!xfaFont[name]) { + xfaFont[name] = lastFont.xfaFont[name]; + } + } + for (const name of ["top", "bottom", "left", "right"]) { + if (isNaN(margin[name])) { + margin[name] = lastFont.paraMargin[name]; + } + } + const fontInfo = new FontInfo(xfaFont, margin, lineHeight || lastFont.lineHeight, this.fontFinder); + if (!fontInfo.pdfFont) { + fontInfo.pdfFont = lastFont.pdfFont; + } + this.stack.push(fontInfo); + } + popFont() { + this.stack.pop(); + } + topFont() { + return this.stack.at(-1); + } +} +class TextMeasure { + constructor(defaultXfaFont, defaultParaMargin, defaultLineHeight, fonts) { + this.glyphs = []; + this.fontSelector = new FontSelector(defaultXfaFont, defaultParaMargin, defaultLineHeight, fonts); + this.extraHeight = 0; + } + pushData(xfaFont, margin, lineHeight) { + this.fontSelector.pushData(xfaFont, margin, lineHeight); + } + popFont(xfaFont) { + return this.fontSelector.popFont(); + } + addPara() { + const lastFont = this.fontSelector.topFont(); + this.extraHeight += lastFont.paraMargin.top + lastFont.paraMargin.bottom; + } + addString(str) { + if (!str) { + return; + } + const lastFont = this.fontSelector.topFont(); + const fontSize = lastFont.xfaFont.size; + if (lastFont.pdfFont) { + const letterSpacing = lastFont.xfaFont.letterSpacing; + const pdfFont = lastFont.pdfFont; + const fontLineHeight = pdfFont.lineHeight || 1.2; + const lineHeight = lastFont.lineHeight || Math.max(1.2, fontLineHeight) * fontSize; + const lineGap = pdfFont.lineGap === undefined ? 0.2 : pdfFont.lineGap; + const noGap = fontLineHeight - lineGap; + const firstLineHeight = Math.max(1, noGap) * fontSize; + const scale = fontSize / 1000; + const fallbackWidth = pdfFont.defaultWidth || pdfFont.charsToGlyphs(" ")[0].width; + for (const line of str.split(/[\u2029\n]/)) { + const encodedLine = pdfFont.encodeString(line).join(""); + const glyphs = pdfFont.charsToGlyphs(encodedLine); + for (const glyph of glyphs) { + const width = glyph.width || fallbackWidth; + this.glyphs.push([width * scale + letterSpacing, lineHeight, firstLineHeight, glyph.unicode, false]); + } + this.glyphs.push([0, 0, 0, "\n", true]); + } + this.glyphs.pop(); + return; + } + for (const line of str.split(/[\u2029\n]/)) { + for (const char of line.split("")) { + this.glyphs.push([fontSize, 1.2 * fontSize, fontSize, char, false]); + } + this.glyphs.push([0, 0, 0, "\n", true]); + } + this.glyphs.pop(); + } + compute(maxWidth) { + let lastSpacePos = -1, + lastSpaceWidth = 0, + width = 0, + height = 0, + currentLineWidth = 0, + currentLineHeight = 0; + let isBroken = false; + let isFirstLine = true; + for (let i = 0, ii = this.glyphs.length; i < ii; i++) { + const [glyphWidth, lineHeight, firstLineHeight, char, isEOL] = this.glyphs[i]; + const isSpace = char === " "; + const glyphHeight = isFirstLine ? firstLineHeight : lineHeight; + if (isEOL) { + width = Math.max(width, currentLineWidth); + currentLineWidth = 0; + height += currentLineHeight; + currentLineHeight = glyphHeight; + lastSpacePos = -1; + lastSpaceWidth = 0; + isFirstLine = false; + continue; + } + if (isSpace) { + if (currentLineWidth + glyphWidth > maxWidth) { + width = Math.max(width, currentLineWidth); + currentLineWidth = 0; + height += currentLineHeight; + currentLineHeight = glyphHeight; + lastSpacePos = -1; + lastSpaceWidth = 0; + isBroken = true; + isFirstLine = false; + } else { + currentLineHeight = Math.max(glyphHeight, currentLineHeight); + lastSpaceWidth = currentLineWidth; + currentLineWidth += glyphWidth; + lastSpacePos = i; + } + continue; + } + if (currentLineWidth + glyphWidth > maxWidth) { + height += currentLineHeight; + currentLineHeight = glyphHeight; + if (lastSpacePos !== -1) { + i = lastSpacePos; + width = Math.max(width, lastSpaceWidth); + currentLineWidth = 0; + lastSpacePos = -1; + lastSpaceWidth = 0; + } else { + width = Math.max(width, currentLineWidth); + currentLineWidth = glyphWidth; + } + isBroken = true; + isFirstLine = false; + continue; + } + currentLineWidth += glyphWidth; + currentLineHeight = Math.max(glyphHeight, currentLineHeight); + } + width = Math.max(width, currentLineWidth); + height += currentLineHeight + this.extraHeight; + return { + width: WIDTH_FACTOR * width, + height, + isBroken + }; + } +} + +;// CONCATENATED MODULE: ./src/core/xfa/som.js + + +const namePattern = /^[^.[]+/; +const indexPattern = /^[^\]]+/; +const operators = { + dot: 0, + dotDot: 1, + dotHash: 2, + dotBracket: 3, + dotParen: 4 +}; +const shortcuts = new Map([["$data", (root, current) => root.datasets ? root.datasets.data : root], ["$record", (root, current) => (root.datasets ? root.datasets.data : root)[$getChildren]()[0]], ["$template", (root, current) => root.template], ["$connectionSet", (root, current) => root.connectionSet], ["$form", (root, current) => root.form], ["$layout", (root, current) => root.layout], ["$host", (root, current) => root.host], ["$dataWindow", (root, current) => root.dataWindow], ["$event", (root, current) => root.event], ["!", (root, current) => root.datasets], ["$xfa", (root, current) => root], ["xfa", (root, current) => root], ["$", (root, current) => current]]); +const somCache = new WeakMap(); +function parseIndex(index) { + index = index.trim(); + if (index === "*") { + return Infinity; + } + return parseInt(index, 10) || 0; +} +function parseExpression(expr, dotDotAllowed, noExpr = true) { + let match = expr.match(namePattern); + if (!match) { + return null; + } + let [name] = match; + const parsed = [{ + name, + cacheName: "." + name, + index: 0, + js: null, + formCalc: null, + operator: operators.dot + }]; + let pos = name.length; + while (pos < expr.length) { + const spos = pos; + const char = expr.charAt(pos++); + if (char === "[") { + match = expr.slice(pos).match(indexPattern); + if (!match) { + warn("XFA - Invalid index in SOM expression"); + return null; + } + parsed.at(-1).index = parseIndex(match[0]); + pos += match[0].length + 1; + continue; + } + let operator; + switch (expr.charAt(pos)) { + case ".": + if (!dotDotAllowed) { + return null; + } + pos++; + operator = operators.dotDot; + break; + case "#": + pos++; + operator = operators.dotHash; + break; + case "[": + if (noExpr) { + warn("XFA - SOM expression contains a FormCalc subexpression which is not supported for now."); + return null; + } + operator = operators.dotBracket; + break; + case "(": + if (noExpr) { + warn("XFA - SOM expression contains a JavaScript subexpression which is not supported for now."); + return null; + } + operator = operators.dotParen; + break; + default: + operator = operators.dot; + break; + } + match = expr.slice(pos).match(namePattern); + if (!match) { + break; + } + [name] = match; + pos += name.length; + parsed.push({ + name, + cacheName: expr.slice(spos, pos), + operator, + index: 0, + js: null, + formCalc: null + }); + } + return parsed; +} +function searchNode(root, container, expr, dotDotAllowed = true, useCache = true) { + const parsed = parseExpression(expr, dotDotAllowed); + if (!parsed) { + return null; + } + const fn = shortcuts.get(parsed[0].name); + let i = 0; + let isQualified; + if (fn) { + isQualified = true; + root = [fn(root, container)]; + i = 1; + } else { + isQualified = container === null; + root = [container || root]; + } + for (let ii = parsed.length; i < ii; i++) { + const { + name, + cacheName, + operator, + index + } = parsed[i]; + const nodes = []; + for (const node of root) { + if (!node.isXFAObject) { + continue; + } + let children, cached; + if (useCache) { + cached = somCache.get(node); + if (!cached) { + cached = new Map(); + somCache.set(node, cached); + } + children = cached.get(cacheName); + } + if (!children) { + switch (operator) { + case operators.dot: + children = node[$getChildrenByName](name, false); + break; + case operators.dotDot: + children = node[$getChildrenByName](name, true); + break; + case operators.dotHash: + children = node[$getChildrenByClass](name); + children = children.isXFAObjectArray ? children.children : [children]; + break; + default: + break; + } + if (useCache) { + cached.set(cacheName, children); + } + } + if (children.length > 0) { + nodes.push(children); + } + } + if (nodes.length === 0 && !isQualified && i === 0) { + const parent = container[$getParent](); + container = parent; + if (!container) { + return null; + } + i = -1; + root = [container]; + continue; + } + root = isFinite(index) ? nodes.filter(node => index < node.length).map(node => node[index]) : nodes.flat(); + } + if (root.length === 0) { + return null; + } + return root; +} +function createDataNode(root, container, expr) { + const parsed = parseExpression(expr); + if (!parsed) { + return null; + } + if (parsed.some(x => x.operator === operators.dotDot)) { + return null; + } + const fn = shortcuts.get(parsed[0].name); + let i = 0; + if (fn) { + root = fn(root, container); + i = 1; + } else { + root = container || root; + } + for (let ii = parsed.length; i < ii; i++) { + const { + name, + operator, + index + } = parsed[i]; + if (!isFinite(index)) { + parsed[i].index = 0; + return root.createNodes(parsed.slice(i)); + } + let children; + switch (operator) { + case operators.dot: + children = root[$getChildrenByName](name, false); + break; + case operators.dotDot: + children = root[$getChildrenByName](name, true); + break; + case operators.dotHash: + children = root[$getChildrenByClass](name); + children = children.isXFAObjectArray ? children.children : [children]; + break; + default: + break; + } + if (children.length === 0) { + return root.createNodes(parsed.slice(i)); + } + if (index < children.length) { + const child = children[index]; + if (!child.isXFAObject) { + warn(`XFA - Cannot create a node.`); + return null; + } + root = child; + } else { + parsed[i].index = index - children.length; + return root.createNodes(parsed.slice(i)); + } + } + return null; +} + +;// CONCATENATED MODULE: ./src/core/xfa/xfa_object.js + + + + + + +const _applyPrototype = Symbol(); +const _attributes = Symbol(); +const _attributeNames = Symbol(); +const _children = Symbol("_children"); +const _cloneAttribute = Symbol(); +const _dataValue = Symbol(); +const _defaultValue = Symbol(); +const _filteredChildrenGenerator = Symbol(); +const _getPrototype = Symbol(); +const _getUnsetAttributes = Symbol(); +const _hasChildren = Symbol(); +const _max = Symbol(); +const _options = Symbol(); +const _parent = Symbol("parent"); +const _resolvePrototypesHelper = Symbol(); +const _setAttributes = Symbol(); +const _validator = Symbol(); +let uid = 0; +const NS_DATASETS = NamespaceIds.datasets.id; +class XFAObject { + constructor(nsId, name, hasChildren = false) { + this[$namespaceId] = nsId; + this[$nodeName] = name; + this[_hasChildren] = hasChildren; + this[_parent] = null; + this[_children] = []; + this[$uid] = `${name}${uid++}`; + this[$globalData] = null; + } + get isXFAObject() { + return true; + } + get isXFAObjectArray() { + return false; + } + createNodes(path) { + let root = this, + node = null; + for (const { + name, + index + } of path) { + for (let i = 0, ii = isFinite(index) ? index : 0; i <= ii; i++) { + const nsId = root[$namespaceId] === NS_DATASETS ? -1 : root[$namespaceId]; + node = new XmlObject(nsId, name); + root[$appendChild](node); + } + root = node; + } + return node; + } + [$onChild](child) { + if (!this[_hasChildren] || !this[$onChildCheck](child)) { + return false; + } + const name = child[$nodeName]; + const node = this[name]; + if (node instanceof XFAObjectArray) { + if (node.push(child)) { + this[$appendChild](child); + return true; + } + } else { + if (node !== null) { + this[$removeChild](node); + } + this[name] = child; + this[$appendChild](child); + return true; + } + let id = ""; + if (this.id) { + id = ` (id: ${this.id})`; + } else if (this.name) { + id = ` (name: ${this.name} ${this.h.value})`; + } + warn(`XFA - node "${this[$nodeName]}"${id} has already enough "${name}"!`); + return false; + } + [$onChildCheck](child) { + return this.hasOwnProperty(child[$nodeName]) && child[$namespaceId] === this[$namespaceId]; + } + [$isNsAgnostic]() { + return false; + } + [$acceptWhitespace]() { + return false; + } + [$isCDATAXml]() { + return false; + } + [$isBindable]() { + return false; + } + [$popPara]() { + if (this.para) { + this[$getTemplateRoot]()[$extra].paraStack.pop(); + } + } + [$pushPara]() { + this[$getTemplateRoot]()[$extra].paraStack.push(this.para); + } + [$setId](ids) { + if (this.id && this[$namespaceId] === NamespaceIds.template.id) { + ids.set(this.id, this); + } + } + [$getTemplateRoot]() { + return this[$globalData].template; + } + [$isSplittable]() { + return false; + } + [$isThereMoreWidth]() { + return false; + } + [$appendChild](child) { + child[_parent] = this; + this[_children].push(child); + if (!child[$globalData] && this[$globalData]) { + child[$globalData] = this[$globalData]; + } + } + [$removeChild](child) { + const i = this[_children].indexOf(child); + this[_children].splice(i, 1); + } + [$hasSettableValue]() { + return this.hasOwnProperty("value"); + } + [$setValue](_) {} + [$onText](_) {} + [$finalize]() {} + [$clean](builder) { + delete this[_hasChildren]; + if (this[$cleanup]) { + builder.clean(this[$cleanup]); + delete this[$cleanup]; + } + } + [$indexOf](child) { + return this[_children].indexOf(child); + } + [$insertAt](i, child) { + child[_parent] = this; + this[_children].splice(i, 0, child); + if (!child[$globalData] && this[$globalData]) { + child[$globalData] = this[$globalData]; + } + } + [$isTransparent]() { + return !this.name; + } + [$lastAttribute]() { + return ""; + } + [$text]() { + if (this[_children].length === 0) { + return this[$content]; + } + return this[_children].map(c => c[$text]()).join(""); + } + get [_attributeNames]() { + const proto = Object.getPrototypeOf(this); + if (!proto._attributes) { + const attributes = proto._attributes = new Set(); + for (const name of Object.getOwnPropertyNames(this)) { + if (this[name] === null || this[name] instanceof XFAObject || this[name] instanceof XFAObjectArray) { + break; + } + attributes.add(name); + } + } + return shadow(this, _attributeNames, proto._attributes); + } + [$isDescendent](parent) { + let node = this; + while (node) { + if (node === parent) { + return true; + } + node = node[$getParent](); + } + return false; + } + [$getParent]() { + return this[_parent]; + } + [$getSubformParent]() { + return this[$getParent](); + } + [$getChildren](name = null) { + if (!name) { + return this[_children]; + } + return this[name]; + } + [$dump]() { + const dumped = Object.create(null); + if (this[$content]) { + dumped.$content = this[$content]; + } + for (const name of Object.getOwnPropertyNames(this)) { + const value = this[name]; + if (value === null) { + continue; + } + if (value instanceof XFAObject) { + dumped[name] = value[$dump](); + } else if (value instanceof XFAObjectArray) { + if (!value.isEmpty()) { + dumped[name] = value.dump(); + } + } else { + dumped[name] = value; + } + } + return dumped; + } + [$toStyle]() { + return null; + } + [$toHTML]() { + return HTMLResult.EMPTY; + } + *[$getContainedChildren]() { + for (const node of this[$getChildren]()) { + yield node; + } + } + *[_filteredChildrenGenerator](filter, include) { + for (const node of this[$getContainedChildren]()) { + if (!filter || include === filter.has(node[$nodeName])) { + const availableSpace = this[$getAvailableSpace](); + const res = node[$toHTML](availableSpace); + if (!res.success) { + this[$extra].failingNode = node; + } + yield res; + } + } + } + [$flushHTML]() { + return null; + } + [$addHTML](html, bbox) { + this[$extra].children.push(html); + } + [$getAvailableSpace]() {} + [$childrenToHTML]({ + filter = null, + include = true + }) { + if (!this[$extra].generator) { + this[$extra].generator = this[_filteredChildrenGenerator](filter, include); + } else { + const availableSpace = this[$getAvailableSpace](); + const res = this[$extra].failingNode[$toHTML](availableSpace); + if (!res.success) { + return res; + } + if (res.html) { + this[$addHTML](res.html, res.bbox); + } + delete this[$extra].failingNode; + } + while (true) { + const gen = this[$extra].generator.next(); + if (gen.done) { + break; + } + const res = gen.value; + if (!res.success) { + return res; + } + if (res.html) { + this[$addHTML](res.html, res.bbox); + } + } + this[$extra].generator = null; + return HTMLResult.EMPTY; + } + [$setSetAttributes](attributes) { + this[_setAttributes] = new Set(Object.keys(attributes)); + } + [_getUnsetAttributes](protoAttributes) { + const allAttr = this[_attributeNames]; + const setAttr = this[_setAttributes]; + return [...protoAttributes].filter(x => allAttr.has(x) && !setAttr.has(x)); + } + [$resolvePrototypes](ids, ancestors = new Set()) { + for (const child of this[_children]) { + child[_resolvePrototypesHelper](ids, ancestors); + } + } + [_resolvePrototypesHelper](ids, ancestors) { + const proto = this[_getPrototype](ids, ancestors); + if (proto) { + this[_applyPrototype](proto, ids, ancestors); + } else { + this[$resolvePrototypes](ids, ancestors); + } + } + [_getPrototype](ids, ancestors) { + const { + use, + usehref + } = this; + if (!use && !usehref) { + return null; + } + let proto = null; + let somExpression = null; + let id = null; + let ref = use; + if (usehref) { + ref = usehref; + if (usehref.startsWith("#som(") && usehref.endsWith(")")) { + somExpression = usehref.slice("#som(".length, -1); + } else if (usehref.startsWith(".#som(") && usehref.endsWith(")")) { + somExpression = usehref.slice(".#som(".length, -1); + } else if (usehref.startsWith("#")) { + id = usehref.slice(1); + } else if (usehref.startsWith(".#")) { + id = usehref.slice(2); + } + } else if (use.startsWith("#")) { + id = use.slice(1); + } else { + somExpression = use; + } + this.use = this.usehref = ""; + if (id) { + proto = ids.get(id); + } else { + proto = searchNode(ids.get($root), this, somExpression, true, false); + if (proto) { + proto = proto[0]; + } + } + if (!proto) { + warn(`XFA - Invalid prototype reference: ${ref}.`); + return null; + } + if (proto[$nodeName] !== this[$nodeName]) { + warn(`XFA - Incompatible prototype: ${proto[$nodeName]} !== ${this[$nodeName]}.`); + return null; + } + if (ancestors.has(proto)) { + warn(`XFA - Cycle detected in prototypes use.`); + return null; + } + ancestors.add(proto); + const protoProto = proto[_getPrototype](ids, ancestors); + if (protoProto) { + proto[_applyPrototype](protoProto, ids, ancestors); + } + proto[$resolvePrototypes](ids, ancestors); + ancestors.delete(proto); + return proto; + } + [_applyPrototype](proto, ids, ancestors) { + if (ancestors.has(proto)) { + warn(`XFA - Cycle detected in prototypes use.`); + return; + } + if (!this[$content] && proto[$content]) { + this[$content] = proto[$content]; + } + const newAncestors = new Set(ancestors); + newAncestors.add(proto); + for (const unsetAttrName of this[_getUnsetAttributes](proto[_setAttributes])) { + this[unsetAttrName] = proto[unsetAttrName]; + if (this[_setAttributes]) { + this[_setAttributes].add(unsetAttrName); + } + } + for (const name of Object.getOwnPropertyNames(this)) { + if (this[_attributeNames].has(name)) { + continue; + } + const value = this[name]; + const protoValue = proto[name]; + if (value instanceof XFAObjectArray) { + for (const child of value[_children]) { + child[_resolvePrototypesHelper](ids, ancestors); + } + for (let i = value[_children].length, ii = protoValue[_children].length; i < ii; i++) { + const child = proto[_children][i][$clone](); + if (value.push(child)) { + child[_parent] = this; + this[_children].push(child); + child[_resolvePrototypesHelper](ids, ancestors); + } else { + break; + } + } + continue; + } + if (value !== null) { + value[$resolvePrototypes](ids, ancestors); + if (protoValue) { + value[_applyPrototype](protoValue, ids, ancestors); + } + continue; + } + if (protoValue !== null) { + const child = protoValue[$clone](); + child[_parent] = this; + this[name] = child; + this[_children].push(child); + child[_resolvePrototypesHelper](ids, ancestors); + } + } + } + static [_cloneAttribute](obj) { + if (Array.isArray(obj)) { + return obj.map(x => XFAObject[_cloneAttribute](x)); + } + if (typeof obj === "object" && obj !== null) { + return Object.assign({}, obj); + } + return obj; + } + [$clone]() { + const clone = Object.create(Object.getPrototypeOf(this)); + for (const $symbol of Object.getOwnPropertySymbols(this)) { + try { + clone[$symbol] = this[$symbol]; + } catch { + shadow(clone, $symbol, this[$symbol]); + } + } + clone[$uid] = `${clone[$nodeName]}${uid++}`; + clone[_children] = []; + for (const name of Object.getOwnPropertyNames(this)) { + if (this[_attributeNames].has(name)) { + clone[name] = XFAObject[_cloneAttribute](this[name]); + continue; + } + const value = this[name]; + clone[name] = value instanceof XFAObjectArray ? new XFAObjectArray(value[_max]) : null; + } + for (const child of this[_children]) { + const name = child[$nodeName]; + const clonedChild = child[$clone](); + clone[_children].push(clonedChild); + clonedChild[_parent] = clone; + if (clone[name] === null) { + clone[name] = clonedChild; + } else { + clone[name][_children].push(clonedChild); + } + } + return clone; + } + [$getChildren](name = null) { + if (!name) { + return this[_children]; + } + return this[_children].filter(c => c[$nodeName] === name); + } + [$getChildrenByClass](name) { + return this[name]; + } + [$getChildrenByName](name, allTransparent, first = true) { + return Array.from(this[$getChildrenByNameIt](name, allTransparent, first)); + } + *[$getChildrenByNameIt](name, allTransparent, first = true) { + if (name === "parent") { + yield this[_parent]; + return; + } + for (const child of this[_children]) { + if (child[$nodeName] === name) { + yield child; + } + if (child.name === name) { + yield child; + } + if (allTransparent || child[$isTransparent]()) { + yield* child[$getChildrenByNameIt](name, allTransparent, false); + } + } + if (first && this[_attributeNames].has(name)) { + yield new XFAAttribute(this, name, this[name]); + } + } +} +class XFAObjectArray { + constructor(max = Infinity) { + this[_max] = max; + this[_children] = []; + } + get isXFAObject() { + return false; + } + get isXFAObjectArray() { + return true; + } + push(child) { + const len = this[_children].length; + if (len <= this[_max]) { + this[_children].push(child); + return true; + } + warn(`XFA - node "${child[$nodeName]}" accepts no more than ${this[_max]} children`); + return false; + } + isEmpty() { + return this[_children].length === 0; + } + dump() { + return this[_children].length === 1 ? this[_children][0][$dump]() : this[_children].map(x => x[$dump]()); + } + [$clone]() { + const clone = new XFAObjectArray(this[_max]); + clone[_children] = this[_children].map(c => c[$clone]()); + return clone; + } + get children() { + return this[_children]; + } + clear() { + this[_children].length = 0; + } +} +class XFAAttribute { + constructor(node, name, value) { + this[_parent] = node; + this[$nodeName] = name; + this[$content] = value; + this[$consumed] = false; + this[$uid] = `attribute${uid++}`; + } + [$getParent]() { + return this[_parent]; + } + [$isDataValue]() { + return true; + } + [$getDataValue]() { + return this[$content].trim(); + } + [$setValue](value) { + value = value.value || ""; + this[$content] = value.toString(); + } + [$text]() { + return this[$content]; + } + [$isDescendent](parent) { + return this[_parent] === parent || this[_parent][$isDescendent](parent); + } +} +class XmlObject extends XFAObject { + constructor(nsId, name, attributes = {}) { + super(nsId, name); + this[$content] = ""; + this[_dataValue] = null; + if (name !== "#text") { + const map = new Map(); + this[_attributes] = map; + for (const [attrName, value] of Object.entries(attributes)) { + map.set(attrName, new XFAAttribute(this, attrName, value)); + } + if (attributes.hasOwnProperty($nsAttributes)) { + const dataNode = attributes[$nsAttributes].xfa.dataNode; + if (dataNode !== undefined) { + if (dataNode === "dataGroup") { + this[_dataValue] = false; + } else if (dataNode === "dataValue") { + this[_dataValue] = true; + } + } + } + } + this[$consumed] = false; + } + [$toString](buf) { + const tagName = this[$nodeName]; + if (tagName === "#text") { + buf.push(encodeToXmlString(this[$content])); + return; + } + const utf8TagName = utf8StringToString(tagName); + const prefix = this[$namespaceId] === NS_DATASETS ? "xfa:" : ""; + buf.push(`<${prefix}${utf8TagName}`); + for (const [name, value] of this[_attributes].entries()) { + const utf8Name = utf8StringToString(name); + buf.push(` ${utf8Name}="${encodeToXmlString(value[$content])}"`); + } + if (this[_dataValue] !== null) { + if (this[_dataValue]) { + buf.push(` xfa:dataNode="dataValue"`); + } else { + buf.push(` xfa:dataNode="dataGroup"`); + } + } + if (!this[$content] && this[_children].length === 0) { + buf.push("/>"); + return; + } + buf.push(">"); + if (this[$content]) { + if (typeof this[$content] === "string") { + buf.push(encodeToXmlString(this[$content])); + } else { + this[$content][$toString](buf); + } + } else { + for (const child of this[_children]) { + child[$toString](buf); + } + } + buf.push(`</${prefix}${utf8TagName}>`); + } + [$onChild](child) { + if (this[$content]) { + const node = new XmlObject(this[$namespaceId], "#text"); + this[$appendChild](node); + node[$content] = this[$content]; + this[$content] = ""; + } + this[$appendChild](child); + return true; + } + [$onText](str) { + this[$content] += str; + } + [$finalize]() { + if (this[$content] && this[_children].length > 0) { + const node = new XmlObject(this[$namespaceId], "#text"); + this[$appendChild](node); + node[$content] = this[$content]; + delete this[$content]; + } + } + [$toHTML]() { + if (this[$nodeName] === "#text") { + return HTMLResult.success({ + name: "#text", + value: this[$content] + }); + } + return HTMLResult.EMPTY; + } + [$getChildren](name = null) { + if (!name) { + return this[_children]; + } + return this[_children].filter(c => c[$nodeName] === name); + } + [$getAttributes]() { + return this[_attributes]; + } + [$getChildrenByClass](name) { + const value = this[_attributes].get(name); + if (value !== undefined) { + return value; + } + return this[$getChildren](name); + } + *[$getChildrenByNameIt](name, allTransparent) { + const value = this[_attributes].get(name); + if (value) { + yield value; + } + for (const child of this[_children]) { + if (child[$nodeName] === name) { + yield child; + } + if (allTransparent) { + yield* child[$getChildrenByNameIt](name, allTransparent); + } + } + } + *[$getAttributeIt](name, skipConsumed) { + const value = this[_attributes].get(name); + if (value && (!skipConsumed || !value[$consumed])) { + yield value; + } + for (const child of this[_children]) { + yield* child[$getAttributeIt](name, skipConsumed); + } + } + *[$getRealChildrenByNameIt](name, allTransparent, skipConsumed) { + for (const child of this[_children]) { + if (child[$nodeName] === name && (!skipConsumed || !child[$consumed])) { + yield child; + } + if (allTransparent) { + yield* child[$getRealChildrenByNameIt](name, allTransparent, skipConsumed); + } + } + } + [$isDataValue]() { + if (this[_dataValue] === null) { + return this[_children].length === 0 || this[_children][0][$namespaceId] === NamespaceIds.xhtml.id; + } + return this[_dataValue]; + } + [$getDataValue]() { + if (this[_dataValue] === null) { + if (this[_children].length === 0) { + return this[$content].trim(); + } + if (this[_children][0][$namespaceId] === NamespaceIds.xhtml.id) { + return this[_children][0][$text]().trim(); + } + return null; + } + return this[$content].trim(); + } + [$setValue](value) { + value = value.value || ""; + this[$content] = value.toString(); + } + [$dump](hasNS = false) { + const dumped = Object.create(null); + if (hasNS) { + dumped.$ns = this[$namespaceId]; + } + if (this[$content]) { + dumped.$content = this[$content]; + } + dumped.$name = this[$nodeName]; + dumped.children = []; + for (const child of this[_children]) { + dumped.children.push(child[$dump](hasNS)); + } + dumped.attributes = Object.create(null); + for (const [name, value] of this[_attributes]) { + dumped.attributes[name] = value[$content]; + } + return dumped; + } +} +class ContentObject extends XFAObject { + constructor(nsId, name) { + super(nsId, name); + this[$content] = ""; + } + [$onText](text) { + this[$content] += text; + } + [$finalize]() {} +} +class OptionObject extends ContentObject { + constructor(nsId, name, options) { + super(nsId, name); + this[_options] = options; + } + [$finalize]() { + this[$content] = getKeyword({ + data: this[$content], + defaultValue: this[_options][0], + validate: k => this[_options].includes(k) + }); + } + [$clean](builder) { + super[$clean](builder); + delete this[_options]; + } +} +class StringObject extends ContentObject { + [$finalize]() { + this[$content] = this[$content].trim(); + } +} +class IntegerObject extends ContentObject { + constructor(nsId, name, defaultValue, validator) { + super(nsId, name); + this[_defaultValue] = defaultValue; + this[_validator] = validator; + } + [$finalize]() { + this[$content] = getInteger({ + data: this[$content], + defaultValue: this[_defaultValue], + validate: this[_validator] + }); + } + [$clean](builder) { + super[$clean](builder); + delete this[_defaultValue]; + delete this[_validator]; + } +} +class Option01 extends IntegerObject { + constructor(nsId, name) { + super(nsId, name, 0, n => n === 1); + } +} +class Option10 extends IntegerObject { + constructor(nsId, name) { + super(nsId, name, 1, n => n === 0); + } +} + +;// CONCATENATED MODULE: ./src/core/xfa/html_utils.js + + + + + + +function measureToString(m) { + if (typeof m === "string") { + return "0px"; + } + return Number.isInteger(m) ? `${m}px` : `${m.toFixed(2)}px`; +} +const converters = { + anchorType(node, style) { + const parent = node[$getSubformParent](); + if (!parent || parent.layout && parent.layout !== "position") { + return; + } + if (!("transform" in style)) { + style.transform = ""; + } + switch (node.anchorType) { + case "bottomCenter": + style.transform += "translate(-50%, -100%)"; + break; + case "bottomLeft": + style.transform += "translate(0,-100%)"; + break; + case "bottomRight": + style.transform += "translate(-100%,-100%)"; + break; + case "middleCenter": + style.transform += "translate(-50%,-50%)"; + break; + case "middleLeft": + style.transform += "translate(0,-50%)"; + break; + case "middleRight": + style.transform += "translate(-100%,-50%)"; + break; + case "topCenter": + style.transform += "translate(-50%,0)"; + break; + case "topRight": + style.transform += "translate(-100%,0)"; + break; + } + }, + dimensions(node, style) { + const parent = node[$getSubformParent](); + let width = node.w; + const height = node.h; + if (parent.layout?.includes("row")) { + const extra = parent[$extra]; + const colSpan = node.colSpan; + let w; + if (colSpan === -1) { + w = extra.columnWidths.slice(extra.currentColumn).reduce((a, x) => a + x, 0); + extra.currentColumn = 0; + } else { + w = extra.columnWidths.slice(extra.currentColumn, extra.currentColumn + colSpan).reduce((a, x) => a + x, 0); + extra.currentColumn = (extra.currentColumn + node.colSpan) % extra.columnWidths.length; + } + if (!isNaN(w)) { + width = node.w = w; + } + } + style.width = width !== "" ? measureToString(width) : "auto"; + style.height = height !== "" ? measureToString(height) : "auto"; + }, + position(node, style) { + const parent = node[$getSubformParent](); + if (parent?.layout && parent.layout !== "position") { + return; + } + style.position = "absolute"; + style.left = measureToString(node.x); + style.top = measureToString(node.y); + }, + rotate(node, style) { + if (node.rotate) { + if (!("transform" in style)) { + style.transform = ""; + } + style.transform += `rotate(-${node.rotate}deg)`; + style.transformOrigin = "top left"; + } + }, + presence(node, style) { + switch (node.presence) { + case "invisible": + style.visibility = "hidden"; + break; + case "hidden": + case "inactive": + style.display = "none"; + break; + } + }, + hAlign(node, style) { + if (node[$nodeName] === "para") { + switch (node.hAlign) { + case "justifyAll": + style.textAlign = "justify-all"; + break; + case "radix": + style.textAlign = "left"; + break; + default: + style.textAlign = node.hAlign; + } + } else { + switch (node.hAlign) { + case "left": + style.alignSelf = "start"; + break; + case "center": + style.alignSelf = "center"; + break; + case "right": + style.alignSelf = "end"; + break; + } + } + }, + margin(node, style) { + if (node.margin) { + style.margin = node.margin[$toStyle]().margin; + } + } +}; +function setMinMaxDimensions(node, style) { + const parent = node[$getSubformParent](); + if (parent.layout === "position") { + if (node.minW > 0) { + style.minWidth = measureToString(node.minW); + } + if (node.maxW > 0) { + style.maxWidth = measureToString(node.maxW); + } + if (node.minH > 0) { + style.minHeight = measureToString(node.minH); + } + if (node.maxH > 0) { + style.maxHeight = measureToString(node.maxH); + } + } +} +function layoutText(text, xfaFont, margin, lineHeight, fontFinder, width) { + const measure = new TextMeasure(xfaFont, margin, lineHeight, fontFinder); + if (typeof text === "string") { + measure.addString(text); + } else { + text[$pushGlyphs](measure); + } + return measure.compute(width); +} +function layoutNode(node, availableSpace) { + let height = null; + let width = null; + let isBroken = false; + if ((!node.w || !node.h) && node.value) { + let marginH = 0; + let marginV = 0; + if (node.margin) { + marginH = node.margin.leftInset + node.margin.rightInset; + marginV = node.margin.topInset + node.margin.bottomInset; + } + let lineHeight = null; + let margin = null; + if (node.para) { + margin = Object.create(null); + lineHeight = node.para.lineHeight === "" ? null : node.para.lineHeight; + margin.top = node.para.spaceAbove === "" ? 0 : node.para.spaceAbove; + margin.bottom = node.para.spaceBelow === "" ? 0 : node.para.spaceBelow; + margin.left = node.para.marginLeft === "" ? 0 : node.para.marginLeft; + margin.right = node.para.marginRight === "" ? 0 : node.para.marginRight; + } + let font = node.font; + if (!font) { + const root = node[$getTemplateRoot](); + let parent = node[$getParent](); + while (parent && parent !== root) { + if (parent.font) { + font = parent.font; + break; + } + parent = parent[$getParent](); + } + } + const maxWidth = (node.w || availableSpace.width) - marginH; + const fontFinder = node[$globalData].fontFinder; + if (node.value.exData && node.value.exData[$content] && node.value.exData.contentType === "text/html") { + const res = layoutText(node.value.exData[$content], font, margin, lineHeight, fontFinder, maxWidth); + width = res.width; + height = res.height; + isBroken = res.isBroken; + } else { + const text = node.value[$text](); + if (text) { + const res = layoutText(text, font, margin, lineHeight, fontFinder, maxWidth); + width = res.width; + height = res.height; + isBroken = res.isBroken; + } + } + if (width !== null && !node.w) { + width += marginH; + } + if (height !== null && !node.h) { + height += marginV; + } + } + return { + w: width, + h: height, + isBroken + }; +} +function computeBbox(node, html, availableSpace) { + let bbox; + if (node.w !== "" && node.h !== "") { + bbox = [node.x, node.y, node.w, node.h]; + } else { + if (!availableSpace) { + return null; + } + let width = node.w; + if (width === "") { + if (node.maxW === 0) { + const parent = node[$getSubformParent](); + width = parent.layout === "position" && parent.w !== "" ? 0 : node.minW; + } else { + width = Math.min(node.maxW, availableSpace.width); + } + html.attributes.style.width = measureToString(width); + } + let height = node.h; + if (height === "") { + if (node.maxH === 0) { + const parent = node[$getSubformParent](); + height = parent.layout === "position" && parent.h !== "" ? 0 : node.minH; + } else { + height = Math.min(node.maxH, availableSpace.height); + } + html.attributes.style.height = measureToString(height); + } + bbox = [node.x, node.y, width, height]; + } + return bbox; +} +function fixDimensions(node) { + const parent = node[$getSubformParent](); + if (parent.layout?.includes("row")) { + const extra = parent[$extra]; + const colSpan = node.colSpan; + let width; + if (colSpan === -1) { + width = extra.columnWidths.slice(extra.currentColumn).reduce((a, w) => a + w, 0); + } else { + width = extra.columnWidths.slice(extra.currentColumn, extra.currentColumn + colSpan).reduce((a, w) => a + w, 0); + } + if (!isNaN(width)) { + node.w = width; + } + } + if (parent.layout && parent.layout !== "position") { + node.x = node.y = 0; + } + if (node.layout === "table") { + if (node.w === "" && Array.isArray(node.columnWidths)) { + node.w = node.columnWidths.reduce((a, x) => a + x, 0); + } + } +} +function layoutClass(node) { + switch (node.layout) { + case "position": + return "xfaPosition"; + case "lr-tb": + return "xfaLrTb"; + case "rl-row": + return "xfaRlRow"; + case "rl-tb": + return "xfaRlTb"; + case "row": + return "xfaRow"; + case "table": + return "xfaTable"; + case "tb": + return "xfaTb"; + default: + return "xfaPosition"; + } +} +function toStyle(node, ...names) { + const style = Object.create(null); + for (const name of names) { + const value = node[name]; + if (value === null) { + continue; + } + if (converters.hasOwnProperty(name)) { + converters[name](node, style); + continue; + } + if (value instanceof XFAObject) { + const newStyle = value[$toStyle](); + if (newStyle) { + Object.assign(style, newStyle); + } else { + warn(`(DEBUG) - XFA - style for ${name} not implemented yet`); + } + } + } + return style; +} +function createWrapper(node, html) { + const { + attributes + } = html; + const { + style + } = attributes; + const wrapper = { + name: "div", + attributes: { + class: ["xfaWrapper"], + style: Object.create(null) + }, + children: [] + }; + attributes.class.push("xfaWrapped"); + if (node.border) { + const { + widths, + insets + } = node.border[$extra]; + let width, height; + let top = insets[0]; + let left = insets[3]; + const insetsH = insets[0] + insets[2]; + const insetsW = insets[1] + insets[3]; + switch (node.border.hand) { + case "even": + top -= widths[0] / 2; + left -= widths[3] / 2; + width = `calc(100% + ${(widths[1] + widths[3]) / 2 - insetsW}px)`; + height = `calc(100% + ${(widths[0] + widths[2]) / 2 - insetsH}px)`; + break; + case "left": + top -= widths[0]; + left -= widths[3]; + width = `calc(100% + ${widths[1] + widths[3] - insetsW}px)`; + height = `calc(100% + ${widths[0] + widths[2] - insetsH}px)`; + break; + case "right": + width = insetsW ? `calc(100% - ${insetsW}px)` : "100%"; + height = insetsH ? `calc(100% - ${insetsH}px)` : "100%"; + break; + } + const classNames = ["xfaBorder"]; + if (isPrintOnly(node.border)) { + classNames.push("xfaPrintOnly"); + } + const border = { + name: "div", + attributes: { + class: classNames, + style: { + top: `${top}px`, + left: `${left}px`, + width, + height + } + }, + children: [] + }; + for (const key of ["border", "borderWidth", "borderColor", "borderRadius", "borderStyle"]) { + if (style[key] !== undefined) { + border.attributes.style[key] = style[key]; + delete style[key]; + } + } + wrapper.children.push(border, html); + } else { + wrapper.children.push(html); + } + for (const key of ["background", "backgroundClip", "top", "left", "width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "transform", "transformOrigin", "visibility"]) { + if (style[key] !== undefined) { + wrapper.attributes.style[key] = style[key]; + delete style[key]; + } + } + wrapper.attributes.style.position = style.position === "absolute" ? "absolute" : "relative"; + delete style.position; + if (style.alignSelf) { + wrapper.attributes.style.alignSelf = style.alignSelf; + delete style.alignSelf; + } + return wrapper; +} +function fixTextIndent(styles) { + const indent = getMeasurement(styles.textIndent, "0px"); + if (indent >= 0) { + return; + } + const align = styles.textAlign === "right" ? "right" : "left"; + const name = "padding" + (align === "left" ? "Left" : "Right"); + const padding = getMeasurement(styles[name], "0px"); + styles[name] = `${padding - indent}px`; +} +function setAccess(node, classNames) { + switch (node.access) { + case "nonInteractive": + classNames.push("xfaNonInteractive"); + break; + case "readOnly": + classNames.push("xfaReadOnly"); + break; + case "protected": + classNames.push("xfaDisabled"); + break; + } +} +function isPrintOnly(node) { + return node.relevant.length > 0 && !node.relevant[0].excluded && node.relevant[0].viewname === "print"; +} +function getCurrentPara(node) { + const stack = node[$getTemplateRoot]()[$extra].paraStack; + return stack.length ? stack.at(-1) : null; +} +function setPara(node, nodeStyle, value) { + if (value.attributes.class?.includes("xfaRich")) { + if (nodeStyle) { + if (node.h === "") { + nodeStyle.height = "auto"; + } + if (node.w === "") { + nodeStyle.width = "auto"; + } + } + const para = getCurrentPara(node); + if (para) { + const valueStyle = value.attributes.style; + valueStyle.display = "flex"; + valueStyle.flexDirection = "column"; + switch (para.vAlign) { + case "top": + valueStyle.justifyContent = "start"; + break; + case "bottom": + valueStyle.justifyContent = "end"; + break; + case "middle": + valueStyle.justifyContent = "center"; + break; + } + const paraStyle = para[$toStyle](); + for (const [key, val] of Object.entries(paraStyle)) { + if (!(key in valueStyle)) { + valueStyle[key] = val; + } + } + } + } +} +function setFontFamily(xfaFont, node, fontFinder, style) { + if (!fontFinder) { + delete style.fontFamily; + return; + } + const name = stripQuotes(xfaFont.typeface); + style.fontFamily = `"${name}"`; + const typeface = fontFinder.find(name); + if (typeface) { + const { + fontFamily + } = typeface.regular.cssFontInfo; + if (fontFamily !== name) { + style.fontFamily = `"${fontFamily}"`; + } + const para = getCurrentPara(node); + if (para && para.lineHeight !== "") { + return; + } + if (style.lineHeight) { + return; + } + const pdfFont = selectFont(xfaFont, typeface); + if (pdfFont) { + style.lineHeight = Math.max(1.2, pdfFont.lineHeight); + } + } +} +function fixURL(str) { + const absoluteUrl = createValidAbsoluteUrl(str, null, { + addDefaultProtocol: true, + tryConvertEncoding: true + }); + return absoluteUrl ? absoluteUrl.href : null; +} + +;// CONCATENATED MODULE: ./src/core/xfa/layout.js + + +function createLine(node, children) { + return { + name: "div", + attributes: { + class: [node.layout === "lr-tb" ? "xfaLr" : "xfaRl"] + }, + children + }; +} +function flushHTML(node) { + if (!node[$extra]) { + return null; + } + const attributes = node[$extra].attributes; + const html = { + name: "div", + attributes, + children: node[$extra].children + }; + if (node[$extra].failingNode) { + const htmlFromFailing = node[$extra].failingNode[$flushHTML](); + if (htmlFromFailing) { + if (node.layout.endsWith("-tb")) { + html.children.push(createLine(node, [htmlFromFailing])); + } else { + html.children.push(htmlFromFailing); + } + } + } + if (html.children.length === 0) { + return null; + } + return html; +} +function addHTML(node, html, bbox) { + const extra = node[$extra]; + const availableSpace = extra.availableSpace; + const [x, y, w, h] = bbox; + switch (node.layout) { + case "position": + { + extra.width = Math.max(extra.width, x + w); + extra.height = Math.max(extra.height, y + h); + extra.children.push(html); + break; + } + case "lr-tb": + case "rl-tb": + if (!extra.line || extra.attempt === 1) { + extra.line = createLine(node, []); + extra.children.push(extra.line); + extra.numberInLine = 0; + } + extra.numberInLine += 1; + extra.line.children.push(html); + if (extra.attempt === 0) { + extra.currentWidth += w; + extra.height = Math.max(extra.height, extra.prevHeight + h); + } else { + extra.currentWidth = w; + extra.prevHeight = extra.height; + extra.height += h; + extra.attempt = 0; + } + extra.width = Math.max(extra.width, extra.currentWidth); + break; + case "rl-row": + case "row": + { + extra.children.push(html); + extra.width += w; + extra.height = Math.max(extra.height, h); + const height = measureToString(extra.height); + for (const child of extra.children) { + child.attributes.style.height = height; + } + break; + } + case "table": + { + extra.width = Math.min(availableSpace.width, Math.max(extra.width, w)); + extra.height += h; + extra.children.push(html); + break; + } + case "tb": + { + extra.width = Math.min(availableSpace.width, Math.max(extra.width, w)); + extra.height += h; + extra.children.push(html); + break; + } + } +} +function getAvailableSpace(node) { + const availableSpace = node[$extra].availableSpace; + const marginV = node.margin ? node.margin.topInset + node.margin.bottomInset : 0; + const marginH = node.margin ? node.margin.leftInset + node.margin.rightInset : 0; + switch (node.layout) { + case "lr-tb": + case "rl-tb": + if (node[$extra].attempt === 0) { + return { + width: availableSpace.width - marginH - node[$extra].currentWidth, + height: availableSpace.height - marginV - node[$extra].prevHeight + }; + } + return { + width: availableSpace.width - marginH, + height: availableSpace.height - marginV - node[$extra].height + }; + case "rl-row": + case "row": + const width = node[$extra].columnWidths.slice(node[$extra].currentColumn).reduce((a, x) => a + x); + return { + width, + height: availableSpace.height - marginH + }; + case "table": + case "tb": + return { + width: availableSpace.width - marginH, + height: availableSpace.height - marginV - node[$extra].height + }; + case "position": + default: + return availableSpace; + } +} +function getTransformedBBox(node) { + let w = node.w === "" ? NaN : node.w; + let h = node.h === "" ? NaN : node.h; + let [centerX, centerY] = [0, 0]; + switch (node.anchorType || "") { + case "bottomCenter": + [centerX, centerY] = [w / 2, h]; + break; + case "bottomLeft": + [centerX, centerY] = [0, h]; + break; + case "bottomRight": + [centerX, centerY] = [w, h]; + break; + case "middleCenter": + [centerX, centerY] = [w / 2, h / 2]; + break; + case "middleLeft": + [centerX, centerY] = [0, h / 2]; + break; + case "middleRight": + [centerX, centerY] = [w, h / 2]; + break; + case "topCenter": + [centerX, centerY] = [w / 2, 0]; + break; + case "topRight": + [centerX, centerY] = [w, 0]; + break; + } + let x, y; + switch (node.rotate || 0) { + case 0: + [x, y] = [-centerX, -centerY]; + break; + case 90: + [x, y] = [-centerY, centerX]; + [w, h] = [h, -w]; + break; + case 180: + [x, y] = [centerX, centerY]; + [w, h] = [-w, -h]; + break; + case 270: + [x, y] = [centerY, -centerX]; + [w, h] = [-h, w]; + break; + } + return [node.x + x + Math.min(0, w), node.y + y + Math.min(0, h), Math.abs(w), Math.abs(h)]; +} +function checkDimensions(node, space) { + if (node[$getTemplateRoot]()[$extra].firstUnsplittable === null) { + return true; + } + if (node.w === 0 || node.h === 0) { + return true; + } + const ERROR = 2; + const parent = node[$getSubformParent](); + const attempt = parent[$extra]?.attempt || 0; + const [, y, w, h] = getTransformedBBox(node); + switch (parent.layout) { + case "lr-tb": + case "rl-tb": + if (attempt === 0) { + if (!node[$getTemplateRoot]()[$extra].noLayoutFailure) { + if (node.h !== "" && Math.round(h - space.height) > ERROR) { + return false; + } + if (node.w !== "") { + if (Math.round(w - space.width) <= ERROR) { + return true; + } + if (parent[$extra].numberInLine === 0) { + return space.height > ERROR; + } + return false; + } + return space.width > ERROR; + } + if (node.w !== "") { + return Math.round(w - space.width) <= ERROR; + } + return space.width > ERROR; + } + if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { + return true; + } + if (node.h !== "" && Math.round(h - space.height) > ERROR) { + return false; + } + if (node.w === "" || Math.round(w - space.width) <= ERROR) { + return space.height > ERROR; + } + if (parent[$isThereMoreWidth]()) { + return false; + } + return space.height > ERROR; + case "table": + case "tb": + if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { + return true; + } + if (node.h !== "" && !node[$isSplittable]()) { + return Math.round(h - space.height) <= ERROR; + } + if (node.w === "" || Math.round(w - space.width) <= ERROR) { + return space.height > ERROR; + } + if (parent[$isThereMoreWidth]()) { + return false; + } + return space.height > ERROR; + case "position": + if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { + return true; + } + if (node.h === "" || Math.round(h + y - space.height) <= ERROR) { + return true; + } + const area = node[$getTemplateRoot]()[$extra].currentContentArea; + return h + y > area.h; + case "rl-row": + case "row": + if (node[$getTemplateRoot]()[$extra].noLayoutFailure) { + return true; + } + if (node.h !== "") { + return Math.round(h - space.height) <= ERROR; + } + return true; + default: + return true; + } +} + +;// CONCATENATED MODULE: ./src/core/xfa/template.js + + + + + + + + + + +const TEMPLATE_NS_ID = NamespaceIds.template.id; +const SVG_NS = "http://www.w3.org/2000/svg"; +const MAX_ATTEMPTS_FOR_LRTB_LAYOUT = 2; +const MAX_EMPTY_PAGES = 3; +const DEFAULT_TAB_INDEX = 5000; +const HEADING_PATTERN = /^H(\d+)$/; +const MIMES = new Set(["image/gif", "image/jpeg", "image/jpg", "image/pjpeg", "image/png", "image/apng", "image/x-png", "image/bmp", "image/x-ms-bmp", "image/tiff", "image/tif", "application/octet-stream"]); +const IMAGES_HEADERS = [[[0x42, 0x4d], "image/bmp"], [[0xff, 0xd8, 0xff], "image/jpeg"], [[0x49, 0x49, 0x2a, 0x00], "image/tiff"], [[0x4d, 0x4d, 0x00, 0x2a], "image/tiff"], [[0x47, 0x49, 0x46, 0x38, 0x39, 0x61], "image/gif"], [[0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a], "image/png"]]; +function getBorderDims(node) { + if (!node || !node.border) { + return { + w: 0, + h: 0 + }; + } + const borderExtra = node.border[$getExtra](); + if (!borderExtra) { + return { + w: 0, + h: 0 + }; + } + return { + w: borderExtra.widths[0] + borderExtra.widths[2] + borderExtra.insets[0] + borderExtra.insets[2], + h: borderExtra.widths[1] + borderExtra.widths[3] + borderExtra.insets[1] + borderExtra.insets[3] + }; +} +function hasMargin(node) { + return node.margin && (node.margin.topInset || node.margin.rightInset || node.margin.bottomInset || node.margin.leftInset); +} +function _setValue(templateNode, value) { + if (!templateNode.value) { + const nodeValue = new Value({}); + templateNode[$appendChild](nodeValue); + templateNode.value = nodeValue; + } + templateNode.value[$setValue](value); +} +function* getContainedChildren(node) { + for (const child of node[$getChildren]()) { + if (child instanceof SubformSet) { + yield* child[$getContainedChildren](); + continue; + } + yield child; + } +} +function isRequired(node) { + return node.validate?.nullTest === "error"; +} +function setTabIndex(node) { + while (node) { + if (!node.traversal) { + node[$tabIndex] = node[$getParent]()[$tabIndex]; + return; + } + if (node[$tabIndex]) { + return; + } + let next = null; + for (const child of node.traversal[$getChildren]()) { + if (child.operation === "next") { + next = child; + break; + } + } + if (!next || !next.ref) { + node[$tabIndex] = node[$getParent]()[$tabIndex]; + return; + } + const root = node[$getTemplateRoot](); + node[$tabIndex] = ++root[$tabIndex]; + const ref = root[$searchNode](next.ref, node); + if (!ref) { + return; + } + node = ref[0]; + } +} +function applyAssist(obj, attributes) { + const assist = obj.assist; + if (assist) { + const assistTitle = assist[$toHTML](); + if (assistTitle) { + attributes.title = assistTitle; + } + const role = assist.role; + const match = role.match(HEADING_PATTERN); + if (match) { + const ariaRole = "heading"; + const ariaLevel = match[1]; + attributes.role = ariaRole; + attributes["aria-level"] = ariaLevel; + } + } + if (obj.layout === "table") { + attributes.role = "table"; + } else if (obj.layout === "row") { + attributes.role = "row"; + } else { + const parent = obj[$getParent](); + if (parent.layout === "row") { + attributes.role = parent.assist?.role === "TH" ? "columnheader" : "cell"; + } + } +} +function ariaLabel(obj) { + if (!obj.assist) { + return null; + } + const assist = obj.assist; + if (assist.speak && assist.speak[$content] !== "") { + return assist.speak[$content]; + } + if (assist.toolTip) { + return assist.toolTip[$content]; + } + return null; +} +function valueToHtml(value) { + return HTMLResult.success({ + name: "div", + attributes: { + class: ["xfaRich"], + style: Object.create(null) + }, + children: [{ + name: "span", + attributes: { + style: Object.create(null) + }, + value + }] + }); +} +function setFirstUnsplittable(node) { + const root = node[$getTemplateRoot](); + if (root[$extra].firstUnsplittable === null) { + root[$extra].firstUnsplittable = node; + root[$extra].noLayoutFailure = true; + } +} +function unsetFirstUnsplittable(node) { + const root = node[$getTemplateRoot](); + if (root[$extra].firstUnsplittable === node) { + root[$extra].noLayoutFailure = false; + } +} +function handleBreak(node) { + if (node[$extra]) { + return false; + } + node[$extra] = Object.create(null); + if (node.targetType === "auto") { + return false; + } + const root = node[$getTemplateRoot](); + let target = null; + if (node.target) { + target = root[$searchNode](node.target, node[$getParent]()); + if (!target) { + return false; + } + target = target[0]; + } + const { + currentPageArea, + currentContentArea + } = root[$extra]; + if (node.targetType === "pageArea") { + if (!(target instanceof PageArea)) { + target = null; + } + if (node.startNew) { + node[$extra].target = target || currentPageArea; + return true; + } else if (target && target !== currentPageArea) { + node[$extra].target = target; + return true; + } + return false; + } + if (!(target instanceof ContentArea)) { + target = null; + } + const pageArea = target && target[$getParent](); + let index; + let nextPageArea = pageArea; + if (node.startNew) { + if (target) { + const contentAreas = pageArea.contentArea.children; + const indexForCurrent = contentAreas.indexOf(currentContentArea); + const indexForTarget = contentAreas.indexOf(target); + if (indexForCurrent !== -1 && indexForCurrent < indexForTarget) { + nextPageArea = null; + } + index = indexForTarget - 1; + } else { + index = currentPageArea.contentArea.children.indexOf(currentContentArea); + } + } else if (target && target !== currentContentArea) { + const contentAreas = pageArea.contentArea.children; + index = contentAreas.indexOf(target) - 1; + nextPageArea = pageArea === currentPageArea ? null : pageArea; + } else { + return false; + } + node[$extra].target = nextPageArea; + node[$extra].index = index; + return true; +} +function handleOverflow(node, extraNode, space) { + const root = node[$getTemplateRoot](); + const saved = root[$extra].noLayoutFailure; + const savedMethod = extraNode[$getSubformParent]; + extraNode[$getSubformParent] = () => node; + root[$extra].noLayoutFailure = true; + const res = extraNode[$toHTML](space); + node[$addHTML](res.html, res.bbox); + root[$extra].noLayoutFailure = saved; + extraNode[$getSubformParent] = savedMethod; +} +class AppearanceFilter extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "appearanceFilter"); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Arc extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "arc", true); + this.circular = getInteger({ + data: attributes.circular, + defaultValue: 0, + validate: x => x === 1 + }); + this.hand = getStringOption(attributes.hand, ["even", "left", "right"]); + this.id = attributes.id || ""; + this.startAngle = getFloat({ + data: attributes.startAngle, + defaultValue: 0, + validate: x => true + }); + this.sweepAngle = getFloat({ + data: attributes.sweepAngle, + defaultValue: 360, + validate: x => true + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.edge = null; + this.fill = null; + } + [$toHTML]() { + const edge = this.edge || new Edge({}); + const edgeStyle = edge[$toStyle](); + const style = Object.create(null); + if (this.fill?.presence === "visible") { + Object.assign(style, this.fill[$toStyle]()); + } else { + style.fill = "transparent"; + } + style.strokeWidth = measureToString(edge.presence === "visible" ? edge.thickness : 0); + style.stroke = edgeStyle.color; + let arc; + const attributes = { + xmlns: SVG_NS, + style: { + width: "100%", + height: "100%", + overflow: "visible" + } + }; + if (this.sweepAngle === 360) { + arc = { + name: "ellipse", + attributes: { + xmlns: SVG_NS, + cx: "50%", + cy: "50%", + rx: "50%", + ry: "50%", + style + } + }; + } else { + const startAngle = this.startAngle * Math.PI / 180; + const sweepAngle = this.sweepAngle * Math.PI / 180; + const largeArc = this.sweepAngle > 180 ? 1 : 0; + const [x1, y1, x2, y2] = [50 * (1 + Math.cos(startAngle)), 50 * (1 - Math.sin(startAngle)), 50 * (1 + Math.cos(startAngle + sweepAngle)), 50 * (1 - Math.sin(startAngle + sweepAngle))]; + arc = { + name: "path", + attributes: { + xmlns: SVG_NS, + d: `M ${x1} ${y1} A 50 50 0 ${largeArc} 0 ${x2} ${y2}`, + vectorEffect: "non-scaling-stroke", + style + } + }; + Object.assign(attributes, { + viewBox: "0 0 100 100", + preserveAspectRatio: "none" + }); + } + const svg = { + name: "svg", + children: [arc], + attributes + }; + const parent = this[$getParent]()[$getParent](); + if (hasMargin(parent)) { + return HTMLResult.success({ + name: "div", + attributes: { + style: { + display: "inline", + width: "100%", + height: "100%" + } + }, + children: [svg] + }); + } + svg.attributes.style.position = "absolute"; + return HTMLResult.success(svg); + } +} +class Area extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "area", true); + this.colSpan = getInteger({ + data: attributes.colSpan, + defaultValue: 1, + validate: n => n >= 1 || n === -1 + }); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); + this.desc = null; + this.extras = null; + this.area = new XFAObjectArray(); + this.draw = new XFAObjectArray(); + this.exObject = new XFAObjectArray(); + this.exclGroup = new XFAObjectArray(); + this.field = new XFAObjectArray(); + this.subform = new XFAObjectArray(); + this.subformSet = new XFAObjectArray(); + } + *[$getContainedChildren]() { + yield* getContainedChildren(this); + } + [$isTransparent]() { + return true; + } + [$isBindable]() { + return true; + } + [$addHTML](html, bbox) { + const [x, y, w, h] = bbox; + this[$extra].width = Math.max(this[$extra].width, x + w); + this[$extra].height = Math.max(this[$extra].height, y + h); + this[$extra].children.push(html); + } + [$getAvailableSpace]() { + return this[$extra].availableSpace; + } + [$toHTML](availableSpace) { + const style = toStyle(this, "position"); + const attributes = { + style, + id: this[$uid], + class: ["xfaArea"] + }; + if (isPrintOnly(this)) { + attributes.class.push("xfaPrintOnly"); + } + if (this.name) { + attributes.xfaName = this.name; + } + const children = []; + this[$extra] = { + children, + width: 0, + height: 0, + availableSpace + }; + const result = this[$childrenToHTML]({ + filter: new Set(["area", "draw", "field", "exclGroup", "subform", "subformSet"]), + include: true + }); + if (!result.success) { + if (result.isBreak()) { + return result; + } + delete this[$extra]; + return HTMLResult.FAILURE; + } + style.width = measureToString(this[$extra].width); + style.height = measureToString(this[$extra].height); + const html = { + name: "div", + attributes, + children + }; + const bbox = [this.x, this.y, this[$extra].width, this[$extra].height]; + delete this[$extra]; + return HTMLResult.success(html, bbox); + } +} +class Assist extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "assist", true); + this.id = attributes.id || ""; + this.role = attributes.role || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.speak = null; + this.toolTip = null; + } + [$toHTML]() { + return this.toolTip?.[$content] || null; + } +} +class Barcode extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "barcode", true); + this.charEncoding = getKeyword({ + data: attributes.charEncoding ? attributes.charEncoding.toLowerCase() : "", + defaultValue: "", + validate: k => ["utf-8", "big-five", "fontspecific", "gbk", "gb-18030", "gb-2312", "ksc-5601", "none", "shift-jis", "ucs-2", "utf-16"].includes(k) || k.match(/iso-8859-\d{2}/) + }); + this.checksum = getStringOption(attributes.checksum, ["none", "1mod10", "1mod10_1mod11", "2mod10", "auto"]); + this.dataColumnCount = getInteger({ + data: attributes.dataColumnCount, + defaultValue: -1, + validate: x => x >= 0 + }); + this.dataLength = getInteger({ + data: attributes.dataLength, + defaultValue: -1, + validate: x => x >= 0 + }); + this.dataPrep = getStringOption(attributes.dataPrep, ["none", "flateCompress"]); + this.dataRowCount = getInteger({ + data: attributes.dataRowCount, + defaultValue: -1, + validate: x => x >= 0 + }); + this.endChar = attributes.endChar || ""; + this.errorCorrectionLevel = getInteger({ + data: attributes.errorCorrectionLevel, + defaultValue: -1, + validate: x => x >= 0 && x <= 8 + }); + this.id = attributes.id || ""; + this.moduleHeight = getMeasurement(attributes.moduleHeight, "5mm"); + this.moduleWidth = getMeasurement(attributes.moduleWidth, "0.25mm"); + this.printCheckDigit = getInteger({ + data: attributes.printCheckDigit, + defaultValue: 0, + validate: x => x === 1 + }); + this.rowColumnRatio = getRatio(attributes.rowColumnRatio); + this.startChar = attributes.startChar || ""; + this.textLocation = getStringOption(attributes.textLocation, ["below", "above", "aboveEmbedded", "belowEmbedded", "none"]); + this.truncate = getInteger({ + data: attributes.truncate, + defaultValue: 0, + validate: x => x === 1 + }); + this.type = getStringOption(attributes.type ? attributes.type.toLowerCase() : "", ["aztec", "codabar", "code2of5industrial", "code2of5interleaved", "code2of5matrix", "code2of5standard", "code3of9", "code3of9extended", "code11", "code49", "code93", "code128", "code128a", "code128b", "code128c", "code128sscc", "datamatrix", "ean8", "ean8add2", "ean8add5", "ean13", "ean13add2", "ean13add5", "ean13pwcd", "fim", "logmars", "maxicode", "msi", "pdf417", "pdf417macro", "plessey", "postauscust2", "postauscust3", "postausreplypaid", "postausstandard", "postukrm4scc", "postusdpbc", "postusimb", "postusstandard", "postus5zip", "qrcode", "rfid", "rss14", "rss14expanded", "rss14limited", "rss14stacked", "rss14stackedomni", "rss14truncated", "telepen", "ucc128", "ucc128random", "ucc128sscc", "upca", "upcaadd2", "upcaadd5", "upcapwcd", "upce", "upceadd2", "upceadd5", "upcean2", "upcean5", "upsmaxicode"]); + this.upsMode = getStringOption(attributes.upsMode, ["usCarrier", "internationalCarrier", "secureSymbol", "standardSymbol"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.wideNarrowRatio = getRatio(attributes.wideNarrowRatio); + this.encrypt = null; + this.extras = null; + } +} +class Bind extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "bind", true); + this.match = getStringOption(attributes.match, ["once", "dataRef", "global", "none"]); + this.ref = attributes.ref || ""; + this.picture = null; + } +} +class BindItems extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "bindItems"); + this.connection = attributes.connection || ""; + this.labelRef = attributes.labelRef || ""; + this.ref = attributes.ref || ""; + this.valueRef = attributes.valueRef || ""; + } +} +class Bookend extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "bookend"); + this.id = attributes.id || ""; + this.leader = attributes.leader || ""; + this.trailer = attributes.trailer || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class BooleanElement extends Option01 { + constructor(attributes) { + super(TEMPLATE_NS_ID, "boolean"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] === 1 ? "1" : "0"); + } +} +class Border extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "border", true); + this.break = getStringOption(attributes.break, ["close", "open"]); + this.hand = getStringOption(attributes.hand, ["even", "left", "right"]); + this.id = attributes.id || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.corner = new XFAObjectArray(4); + this.edge = new XFAObjectArray(4); + this.extras = null; + this.fill = null; + this.margin = null; + } + [$getExtra]() { + if (!this[$extra]) { + const edges = this.edge.children.slice(); + if (edges.length < 4) { + const defaultEdge = edges.at(-1) || new Edge({}); + for (let i = edges.length; i < 4; i++) { + edges.push(defaultEdge); + } + } + const widths = edges.map(edge => edge.thickness); + const insets = [0, 0, 0, 0]; + if (this.margin) { + insets[0] = this.margin.topInset; + insets[1] = this.margin.rightInset; + insets[2] = this.margin.bottomInset; + insets[3] = this.margin.leftInset; + } + this[$extra] = { + widths, + insets, + edges + }; + } + return this[$extra]; + } + [$toStyle]() { + const { + edges + } = this[$getExtra](); + const edgeStyles = edges.map(node => { + const style = node[$toStyle](); + style.color ||= "#000000"; + return style; + }); + const style = Object.create(null); + if (this.margin) { + Object.assign(style, this.margin[$toStyle]()); + } + if (this.fill?.presence === "visible") { + Object.assign(style, this.fill[$toStyle]()); + } + if (this.corner.children.some(node => node.radius !== 0)) { + const cornerStyles = this.corner.children.map(node => node[$toStyle]()); + if (cornerStyles.length === 2 || cornerStyles.length === 3) { + const last = cornerStyles.at(-1); + for (let i = cornerStyles.length; i < 4; i++) { + cornerStyles.push(last); + } + } + style.borderRadius = cornerStyles.map(s => s.radius).join(" "); + } + switch (this.presence) { + case "invisible": + case "hidden": + style.borderStyle = ""; + break; + case "inactive": + style.borderStyle = "none"; + break; + default: + style.borderStyle = edgeStyles.map(s => s.style).join(" "); + break; + } + style.borderWidth = edgeStyles.map(s => s.width).join(" "); + style.borderColor = edgeStyles.map(s => s.color).join(" "); + return style; + } +} +class Break extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "break", true); + this.after = getStringOption(attributes.after, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]); + this.afterTarget = attributes.afterTarget || ""; + this.before = getStringOption(attributes.before, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]); + this.beforeTarget = attributes.beforeTarget || ""; + this.bookendLeader = attributes.bookendLeader || ""; + this.bookendTrailer = attributes.bookendTrailer || ""; + this.id = attributes.id || ""; + this.overflowLeader = attributes.overflowLeader || ""; + this.overflowTarget = attributes.overflowTarget || ""; + this.overflowTrailer = attributes.overflowTrailer || ""; + this.startNew = getInteger({ + data: attributes.startNew, + defaultValue: 0, + validate: x => x === 1 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } +} +class BreakAfter extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "breakAfter", true); + this.id = attributes.id || ""; + this.leader = attributes.leader || ""; + this.startNew = getInteger({ + data: attributes.startNew, + defaultValue: 0, + validate: x => x === 1 + }); + this.target = attributes.target || ""; + this.targetType = getStringOption(attributes.targetType, ["auto", "contentArea", "pageArea"]); + this.trailer = attributes.trailer || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.script = null; + } +} +class BreakBefore extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "breakBefore", true); + this.id = attributes.id || ""; + this.leader = attributes.leader || ""; + this.startNew = getInteger({ + data: attributes.startNew, + defaultValue: 0, + validate: x => x === 1 + }); + this.target = attributes.target || ""; + this.targetType = getStringOption(attributes.targetType, ["auto", "contentArea", "pageArea"]); + this.trailer = attributes.trailer || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.script = null; + } + [$toHTML](availableSpace) { + this[$extra] = {}; + return HTMLResult.FAILURE; + } +} +class Button extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "button", true); + this.highlight = getStringOption(attributes.highlight, ["inverted", "none", "outline", "push"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } + [$toHTML](availableSpace) { + const parent = this[$getParent](); + const grandpa = parent[$getParent](); + const htmlButton = { + name: "button", + attributes: { + id: this[$uid], + class: ["xfaButton"], + style: {} + }, + children: [] + }; + for (const event of grandpa.event.children) { + if (event.activity !== "click" || !event.script) { + continue; + } + const jsURL = recoverJsURL(event.script[$content]); + if (!jsURL) { + continue; + } + const href = fixURL(jsURL.url); + if (!href) { + continue; + } + htmlButton.children.push({ + name: "a", + attributes: { + id: "link" + this[$uid], + href, + newWindow: jsURL.newWindow, + class: ["xfaLink"], + style: {} + }, + children: [] + }); + } + return HTMLResult.success(htmlButton); + } +} +class Calculate extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "calculate", true); + this.id = attributes.id || ""; + this.override = getStringOption(attributes.override, ["disabled", "error", "ignore", "warning"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.message = null; + this.script = null; + } +} +class Caption extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "caption", true); + this.id = attributes.id || ""; + this.placement = getStringOption(attributes.placement, ["left", "bottom", "inline", "right", "top"]); + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.reserve = Math.ceil(getMeasurement(attributes.reserve)); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.font = null; + this.margin = null; + this.para = null; + this.value = null; + } + [$setValue](value) { + _setValue(this, value); + } + [$getExtra](availableSpace) { + if (!this[$extra]) { + let { + width, + height + } = availableSpace; + switch (this.placement) { + case "left": + case "right": + case "inline": + width = this.reserve <= 0 ? width : this.reserve; + break; + case "top": + case "bottom": + height = this.reserve <= 0 ? height : this.reserve; + break; + } + this[$extra] = layoutNode(this, { + width, + height + }); + } + return this[$extra]; + } + [$toHTML](availableSpace) { + if (!this.value) { + return HTMLResult.EMPTY; + } + this[$pushPara](); + const value = this.value[$toHTML](availableSpace).html; + if (!value) { + this[$popPara](); + return HTMLResult.EMPTY; + } + const savedReserve = this.reserve; + if (this.reserve <= 0) { + const { + w, + h + } = this[$getExtra](availableSpace); + switch (this.placement) { + case "left": + case "right": + case "inline": + this.reserve = w; + break; + case "top": + case "bottom": + this.reserve = h; + break; + } + } + const children = []; + if (typeof value === "string") { + children.push({ + name: "#text", + value + }); + } else { + children.push(value); + } + const style = toStyle(this, "font", "margin", "visibility"); + switch (this.placement) { + case "left": + case "right": + if (this.reserve > 0) { + style.width = measureToString(this.reserve); + } + break; + case "top": + case "bottom": + if (this.reserve > 0) { + style.height = measureToString(this.reserve); + } + break; + } + setPara(this, null, value); + this[$popPara](); + this.reserve = savedReserve; + return HTMLResult.success({ + name: "div", + attributes: { + style, + class: ["xfaCaption"] + }, + children + }); + } +} +class Certificate extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "certificate"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Certificates extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "certificates", true); + this.credentialServerPolicy = getStringOption(attributes.credentialServerPolicy, ["optional", "required"]); + this.id = attributes.id || ""; + this.url = attributes.url || ""; + this.urlPolicy = attributes.urlPolicy || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.encryption = null; + this.issuers = null; + this.keyUsage = null; + this.oids = null; + this.signing = null; + this.subjectDNs = null; + } +} +class CheckButton extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "checkButton", true); + this.id = attributes.id || ""; + this.mark = getStringOption(attributes.mark, ["default", "check", "circle", "cross", "diamond", "square", "star"]); + this.shape = getStringOption(attributes.shape, ["square", "round"]); + this.size = getMeasurement(attributes.size, "10pt"); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.extras = null; + this.margin = null; + } + [$toHTML](availableSpace) { + const style = toStyle("margin"); + const size = measureToString(this.size); + style.width = style.height = size; + let type; + let className; + let groupId; + const field = this[$getParent]()[$getParent](); + const items = field.items.children.length && field.items.children[0][$toHTML]().html || []; + const exportedValue = { + on: (items[0] !== undefined ? items[0] : "on").toString(), + off: (items[1] !== undefined ? items[1] : "off").toString() + }; + const value = field.value?.[$text]() || "off"; + const checked = value === exportedValue.on || undefined; + const container = field[$getSubformParent](); + const fieldId = field[$uid]; + let dataId; + if (container instanceof ExclGroup) { + groupId = container[$uid]; + type = "radio"; + className = "xfaRadio"; + dataId = container[$data]?.[$uid] || container[$uid]; + } else { + type = "checkbox"; + className = "xfaCheckbox"; + dataId = field[$data]?.[$uid] || field[$uid]; + } + const input = { + name: "input", + attributes: { + class: [className], + style, + fieldId, + dataId, + type, + checked, + xfaOn: exportedValue.on, + xfaOff: exportedValue.off, + "aria-label": ariaLabel(field), + "aria-required": false + } + }; + if (groupId) { + input.attributes.name = groupId; + } + if (isRequired(field)) { + input.attributes["aria-required"] = true; + input.attributes.required = true; + } + return HTMLResult.success({ + name: "label", + attributes: { + class: ["xfaLabel"] + }, + children: [input] + }); + } +} +class ChoiceList extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "choiceList", true); + this.commitOn = getStringOption(attributes.commitOn, ["select", "exit"]); + this.id = attributes.id || ""; + this.open = getStringOption(attributes.open, ["userControl", "always", "multiSelect", "onEntry"]); + this.textEntry = getInteger({ + data: attributes.textEntry, + defaultValue: 0, + validate: x => x === 1 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.extras = null; + this.margin = null; + } + [$toHTML](availableSpace) { + const style = toStyle(this, "border", "margin"); + const ui = this[$getParent](); + const field = ui[$getParent](); + const fontSize = field.font?.size || 10; + const optionStyle = { + fontSize: `calc(${fontSize}px * var(--scale-factor))` + }; + const children = []; + if (field.items.children.length > 0) { + const items = field.items; + let displayedIndex = 0; + let saveIndex = 0; + if (items.children.length === 2) { + displayedIndex = items.children[0].save; + saveIndex = 1 - displayedIndex; + } + const displayed = items.children[displayedIndex][$toHTML]().html; + const values = items.children[saveIndex][$toHTML]().html; + let selected = false; + const value = field.value?.[$text]() || ""; + for (let i = 0, ii = displayed.length; i < ii; i++) { + const option = { + name: "option", + attributes: { + value: values[i] || displayed[i], + style: optionStyle + }, + value: displayed[i] + }; + if (values[i] === value) { + option.attributes.selected = selected = true; + } + children.push(option); + } + if (!selected) { + children.splice(0, 0, { + name: "option", + attributes: { + hidden: true, + selected: true + }, + value: " " + }); + } + } + const selectAttributes = { + class: ["xfaSelect"], + fieldId: field[$uid], + dataId: field[$data]?.[$uid] || field[$uid], + style, + "aria-label": ariaLabel(field), + "aria-required": false + }; + if (isRequired(field)) { + selectAttributes["aria-required"] = true; + selectAttributes.required = true; + } + if (this.open === "multiSelect") { + selectAttributes.multiple = true; + } + return HTMLResult.success({ + name: "label", + attributes: { + class: ["xfaLabel"] + }, + children: [{ + name: "select", + children, + attributes: selectAttributes + }] + }); + } +} +class Color extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "color", true); + this.cSpace = getStringOption(attributes.cSpace, ["SRGB"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.value = attributes.value ? getColor(attributes.value) : ""; + this.extras = null; + } + [$hasSettableValue]() { + return false; + } + [$toStyle]() { + return this.value ? Util.makeHexColor(this.value.r, this.value.g, this.value.b) : null; + } +} +class Comb extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "comb"); + this.id = attributes.id || ""; + this.numberOfCells = getInteger({ + data: attributes.numberOfCells, + defaultValue: 0, + validate: x => x >= 0 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Connect extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "connect", true); + this.connection = attributes.connection || ""; + this.id = attributes.id || ""; + this.ref = attributes.ref || ""; + this.usage = getStringOption(attributes.usage, ["exportAndImport", "exportOnly", "importOnly"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.picture = null; + } +} +class ContentArea extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "contentArea", true); + this.h = getMeasurement(attributes.h); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.w = getMeasurement(attributes.w); + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); + this.desc = null; + this.extras = null; + } + [$toHTML](availableSpace) { + const left = measureToString(this.x); + const top = measureToString(this.y); + const style = { + left, + top, + width: measureToString(this.w), + height: measureToString(this.h) + }; + const classNames = ["xfaContentarea"]; + if (isPrintOnly(this)) { + classNames.push("xfaPrintOnly"); + } + return HTMLResult.success({ + name: "div", + children: [], + attributes: { + style, + class: classNames, + id: this[$uid] + } + }); + } +} +class Corner extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "corner", true); + this.id = attributes.id || ""; + this.inverted = getInteger({ + data: attributes.inverted, + defaultValue: 0, + validate: x => x === 1 + }); + this.join = getStringOption(attributes.join, ["square", "round"]); + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.radius = getMeasurement(attributes.radius); + this.stroke = getStringOption(attributes.stroke, ["solid", "dashDot", "dashDotDot", "dashed", "dotted", "embossed", "etched", "lowered", "raised"]); + this.thickness = getMeasurement(attributes.thickness, "0.5pt"); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + } + [$toStyle]() { + const style = toStyle(this, "visibility"); + style.radius = measureToString(this.join === "square" ? 0 : this.radius); + return style; + } +} +class DateElement extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "date"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + const date = this[$content].trim(); + this[$content] = date ? new Date(date) : null; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] ? this[$content].toString() : ""); + } +} +class DateTime extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "dateTime"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + const date = this[$content].trim(); + this[$content] = date ? new Date(date) : null; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] ? this[$content].toString() : ""); + } +} +class DateTimeEdit extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "dateTimeEdit", true); + this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]); + this.id = attributes.id || ""; + this.picker = getStringOption(attributes.picker, ["host", "none"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.comb = null; + this.extras = null; + this.margin = null; + } + [$toHTML](availableSpace) { + const style = toStyle(this, "border", "font", "margin"); + const field = this[$getParent]()[$getParent](); + const html = { + name: "input", + attributes: { + type: "text", + fieldId: field[$uid], + dataId: field[$data]?.[$uid] || field[$uid], + class: ["xfaTextfield"], + style, + "aria-label": ariaLabel(field), + "aria-required": false + } + }; + if (isRequired(field)) { + html.attributes["aria-required"] = true; + html.attributes.required = true; + } + return HTMLResult.success({ + name: "label", + attributes: { + class: ["xfaLabel"] + }, + children: [html] + }); + } +} +class Decimal extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "decimal"); + this.fracDigits = getInteger({ + data: attributes.fracDigits, + defaultValue: 2, + validate: x => true + }); + this.id = attributes.id || ""; + this.leadDigits = getInteger({ + data: attributes.leadDigits, + defaultValue: -1, + validate: x => true + }); + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + const number = parseFloat(this[$content].trim()); + this[$content] = isNaN(number) ? null : number; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] !== null ? this[$content].toString() : ""); + } +} +class DefaultUi extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "defaultUi", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } +} +class Desc extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "desc", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.boolean = new XFAObjectArray(); + this.date = new XFAObjectArray(); + this.dateTime = new XFAObjectArray(); + this.decimal = new XFAObjectArray(); + this.exData = new XFAObjectArray(); + this.float = new XFAObjectArray(); + this.image = new XFAObjectArray(); + this.integer = new XFAObjectArray(); + this.text = new XFAObjectArray(); + this.time = new XFAObjectArray(); + } +} +class DigestMethod extends OptionObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "digestMethod", ["", "SHA1", "SHA256", "SHA512", "RIPEMD160"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class DigestMethods extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "digestMethods", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.digestMethod = new XFAObjectArray(); + } +} +class Draw extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "draw", true); + this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]); + this.colSpan = getInteger({ + data: attributes.colSpan, + defaultValue: 1, + validate: n => n >= 1 || n === -1 + }); + this.h = attributes.h ? getMeasurement(attributes.h) : ""; + this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]); + this.id = attributes.id || ""; + this.locale = attributes.locale || ""; + this.maxH = getMeasurement(attributes.maxH, "0pt"); + this.maxW = getMeasurement(attributes.maxW, "0pt"); + this.minH = getMeasurement(attributes.minH, "0pt"); + this.minW = getMeasurement(attributes.minW, "0pt"); + this.name = attributes.name || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.relevant = getRelevant(attributes.relevant); + this.rotate = getInteger({ + data: attributes.rotate, + defaultValue: 0, + validate: x => x % 90 === 0 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.w = attributes.w ? getMeasurement(attributes.w) : ""; + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); + this.assist = null; + this.border = null; + this.caption = null; + this.desc = null; + this.extras = null; + this.font = null; + this.keep = null; + this.margin = null; + this.para = null; + this.traversal = null; + this.ui = null; + this.value = null; + this.setProperty = new XFAObjectArray(); + } + [$setValue](value) { + _setValue(this, value); + } + [$toHTML](availableSpace) { + setTabIndex(this); + if (this.presence === "hidden" || this.presence === "inactive") { + return HTMLResult.EMPTY; + } + fixDimensions(this); + this[$pushPara](); + const savedW = this.w; + const savedH = this.h; + const { + w, + h, + isBroken + } = layoutNode(this, availableSpace); + if (w && this.w === "") { + if (isBroken && this[$getSubformParent]()[$isThereMoreWidth]()) { + this[$popPara](); + return HTMLResult.FAILURE; + } + this.w = w; + } + if (h && this.h === "") { + this.h = h; + } + setFirstUnsplittable(this); + if (!checkDimensions(this, availableSpace)) { + this.w = savedW; + this.h = savedH; + this[$popPara](); + return HTMLResult.FAILURE; + } + unsetFirstUnsplittable(this); + const style = toStyle(this, "font", "hAlign", "dimensions", "position", "presence", "rotate", "anchorType", "border", "margin"); + setMinMaxDimensions(this, style); + if (style.margin) { + style.padding = style.margin; + delete style.margin; + } + const classNames = ["xfaDraw"]; + if (this.font) { + classNames.push("xfaFont"); + } + if (isPrintOnly(this)) { + classNames.push("xfaPrintOnly"); + } + const attributes = { + style, + id: this[$uid], + class: classNames + }; + if (this.name) { + attributes.xfaName = this.name; + } + const html = { + name: "div", + attributes, + children: [] + }; + applyAssist(this, attributes); + const bbox = computeBbox(this, html, availableSpace); + const value = this.value ? this.value[$toHTML](availableSpace).html : null; + if (value === null) { + this.w = savedW; + this.h = savedH; + this[$popPara](); + return HTMLResult.success(createWrapper(this, html), bbox); + } + html.children.push(value); + setPara(this, style, value); + this.w = savedW; + this.h = savedH; + this[$popPara](); + return HTMLResult.success(createWrapper(this, html), bbox); + } +} +class Edge extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "edge", true); + this.cap = getStringOption(attributes.cap, ["square", "butt", "round"]); + this.id = attributes.id || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.stroke = getStringOption(attributes.stroke, ["solid", "dashDot", "dashDotDot", "dashed", "dotted", "embossed", "etched", "lowered", "raised"]); + this.thickness = getMeasurement(attributes.thickness, "0.5pt"); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + } + [$toStyle]() { + const style = toStyle(this, "visibility"); + Object.assign(style, { + linecap: this.cap, + width: measureToString(this.thickness), + color: this.color ? this.color[$toStyle]() : "#000000", + style: "" + }); + if (this.presence !== "visible") { + style.style = "none"; + } else { + switch (this.stroke) { + case "solid": + style.style = "solid"; + break; + case "dashDot": + style.style = "dashed"; + break; + case "dashDotDot": + style.style = "dashed"; + break; + case "dashed": + style.style = "dashed"; + break; + case "dotted": + style.style = "dotted"; + break; + case "embossed": + style.style = "ridge"; + break; + case "etched": + style.style = "groove"; + break; + case "lowered": + style.style = "inset"; + break; + case "raised": + style.style = "outset"; + break; + } + } + return style; + } +} +class Encoding extends OptionObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encoding", ["adbe.x509.rsa_sha1", "adbe.pkcs7.detached", "adbe.pkcs7.sha1"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Encodings extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encodings", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.encoding = new XFAObjectArray(); + } +} +class Encrypt extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encrypt", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.certificate = null; + } +} +class EncryptData extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encryptData", true); + this.id = attributes.id || ""; + this.operation = getStringOption(attributes.operation, ["encrypt", "decrypt"]); + this.target = attributes.target || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.filter = null; + this.manifest = null; + } +} +class Encryption extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encryption", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.certificate = new XFAObjectArray(); + } +} +class EncryptionMethod extends OptionObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encryptionMethod", ["", "AES256-CBC", "TRIPLEDES-CBC", "AES128-CBC", "AES192-CBC"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class EncryptionMethods extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "encryptionMethods", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.encryptionMethod = new XFAObjectArray(); + } +} +class Event extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "event", true); + this.activity = getStringOption(attributes.activity, ["click", "change", "docClose", "docReady", "enter", "exit", "full", "indexChange", "initialize", "mouseDown", "mouseEnter", "mouseExit", "mouseUp", "postExecute", "postOpen", "postPrint", "postSave", "postSign", "postSubmit", "preExecute", "preOpen", "prePrint", "preSave", "preSign", "preSubmit", "ready", "validationState"]); + this.id = attributes.id || ""; + this.listen = getStringOption(attributes.listen, ["refOnly", "refAndDescendents"]); + this.name = attributes.name || ""; + this.ref = attributes.ref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.encryptData = null; + this.execute = null; + this.script = null; + this.signData = null; + this.submit = null; + } +} +class ExData extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "exData"); + this.contentType = attributes.contentType || ""; + this.href = attributes.href || ""; + this.id = attributes.id || ""; + this.maxLength = getInteger({ + data: attributes.maxLength, + defaultValue: -1, + validate: x => x >= -1 + }); + this.name = attributes.name || ""; + this.rid = attributes.rid || ""; + this.transferEncoding = getStringOption(attributes.transferEncoding, ["none", "base64", "package"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$isCDATAXml]() { + return this.contentType === "text/html"; + } + [$onChild](child) { + if (this.contentType === "text/html" && child[$namespaceId] === NamespaceIds.xhtml.id) { + this[$content] = child; + return true; + } + if (this.contentType === "text/xml") { + this[$content] = child; + return true; + } + return false; + } + [$toHTML](availableSpace) { + if (this.contentType !== "text/html" || !this[$content]) { + return HTMLResult.EMPTY; + } + return this[$content][$toHTML](availableSpace); + } +} +class ExObject extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "exObject", true); + this.archive = attributes.archive || ""; + this.classId = attributes.classId || ""; + this.codeBase = attributes.codeBase || ""; + this.codeType = attributes.codeType || ""; + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.boolean = new XFAObjectArray(); + this.date = new XFAObjectArray(); + this.dateTime = new XFAObjectArray(); + this.decimal = new XFAObjectArray(); + this.exData = new XFAObjectArray(); + this.exObject = new XFAObjectArray(); + this.float = new XFAObjectArray(); + this.image = new XFAObjectArray(); + this.integer = new XFAObjectArray(); + this.text = new XFAObjectArray(); + this.time = new XFAObjectArray(); + } +} +class ExclGroup extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "exclGroup", true); + this.access = getStringOption(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]); + this.accessKey = attributes.accessKey || ""; + this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]); + this.colSpan = getInteger({ + data: attributes.colSpan, + defaultValue: 1, + validate: n => n >= 1 || n === -1 + }); + this.h = attributes.h ? getMeasurement(attributes.h) : ""; + this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]); + this.id = attributes.id || ""; + this.layout = getStringOption(attributes.layout, ["position", "lr-tb", "rl-row", "rl-tb", "row", "table", "tb"]); + this.maxH = getMeasurement(attributes.maxH, "0pt"); + this.maxW = getMeasurement(attributes.maxW, "0pt"); + this.minH = getMeasurement(attributes.minH, "0pt"); + this.minW = getMeasurement(attributes.minW, "0pt"); + this.name = attributes.name || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.w = attributes.w ? getMeasurement(attributes.w) : ""; + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); + this.assist = null; + this.bind = null; + this.border = null; + this.calculate = null; + this.caption = null; + this.desc = null; + this.extras = null; + this.margin = null; + this.para = null; + this.traversal = null; + this.validate = null; + this.connect = new XFAObjectArray(); + this.event = new XFAObjectArray(); + this.field = new XFAObjectArray(); + this.setProperty = new XFAObjectArray(); + } + [$isBindable]() { + return true; + } + [$hasSettableValue]() { + return true; + } + [$setValue](value) { + for (const field of this.field.children) { + if (!field.value) { + const nodeValue = new Value({}); + field[$appendChild](nodeValue); + field.value = nodeValue; + } + field.value[$setValue](value); + } + } + [$isThereMoreWidth]() { + return this.layout.endsWith("-tb") && this[$extra].attempt === 0 && this[$extra].numberInLine > 0 || this[$getParent]()[$isThereMoreWidth](); + } + [$isSplittable]() { + const parent = this[$getSubformParent](); + if (!parent[$isSplittable]()) { + return false; + } + if (this[$extra]._isSplittable !== undefined) { + return this[$extra]._isSplittable; + } + if (this.layout === "position" || this.layout.includes("row")) { + this[$extra]._isSplittable = false; + return false; + } + if (parent.layout?.endsWith("-tb") && parent[$extra].numberInLine !== 0) { + return false; + } + this[$extra]._isSplittable = true; + return true; + } + [$flushHTML]() { + return flushHTML(this); + } + [$addHTML](html, bbox) { + addHTML(this, html, bbox); + } + [$getAvailableSpace]() { + return getAvailableSpace(this); + } + [$toHTML](availableSpace) { + setTabIndex(this); + if (this.presence === "hidden" || this.presence === "inactive" || this.h === 0 || this.w === 0) { + return HTMLResult.EMPTY; + } + fixDimensions(this); + const children = []; + const attributes = { + id: this[$uid], + class: [] + }; + setAccess(this, attributes.class); + if (!this[$extra]) { + this[$extra] = Object.create(null); + } + Object.assign(this[$extra], { + children, + attributes, + attempt: 0, + line: null, + numberInLine: 0, + availableSpace: { + width: Math.min(this.w || Infinity, availableSpace.width), + height: Math.min(this.h || Infinity, availableSpace.height) + }, + width: 0, + height: 0, + prevHeight: 0, + currentWidth: 0 + }); + const isSplittable = this[$isSplittable](); + if (!isSplittable) { + setFirstUnsplittable(this); + } + if (!checkDimensions(this, availableSpace)) { + return HTMLResult.FAILURE; + } + const filter = new Set(["field"]); + if (this.layout.includes("row")) { + const columnWidths = this[$getSubformParent]().columnWidths; + if (Array.isArray(columnWidths) && columnWidths.length > 0) { + this[$extra].columnWidths = columnWidths; + this[$extra].currentColumn = 0; + } + } + const style = toStyle(this, "anchorType", "dimensions", "position", "presence", "border", "margin", "hAlign"); + const classNames = ["xfaExclgroup"]; + const cl = layoutClass(this); + if (cl) { + classNames.push(cl); + } + if (isPrintOnly(this)) { + classNames.push("xfaPrintOnly"); + } + attributes.style = style; + attributes.class = classNames; + if (this.name) { + attributes.xfaName = this.name; + } + this[$pushPara](); + const isLrTb = this.layout === "lr-tb" || this.layout === "rl-tb"; + const maxRun = isLrTb ? MAX_ATTEMPTS_FOR_LRTB_LAYOUT : 1; + for (; this[$extra].attempt < maxRun; this[$extra].attempt++) { + if (isLrTb && this[$extra].attempt === MAX_ATTEMPTS_FOR_LRTB_LAYOUT - 1) { + this[$extra].numberInLine = 0; + } + const result = this[$childrenToHTML]({ + filter, + include: true + }); + if (result.success) { + break; + } + if (result.isBreak()) { + this[$popPara](); + return result; + } + if (isLrTb && this[$extra].attempt === 0 && this[$extra].numberInLine === 0 && !this[$getTemplateRoot]()[$extra].noLayoutFailure) { + this[$extra].attempt = maxRun; + break; + } + } + this[$popPara](); + if (!isSplittable) { + unsetFirstUnsplittable(this); + } + if (this[$extra].attempt === maxRun) { + if (!isSplittable) { + delete this[$extra]; + } + return HTMLResult.FAILURE; + } + let marginH = 0; + let marginV = 0; + if (this.margin) { + marginH = this.margin.leftInset + this.margin.rightInset; + marginV = this.margin.topInset + this.margin.bottomInset; + } + const width = Math.max(this[$extra].width + marginH, this.w || 0); + const height = Math.max(this[$extra].height + marginV, this.h || 0); + const bbox = [this.x, this.y, width, height]; + if (this.w === "") { + style.width = measureToString(width); + } + if (this.h === "") { + style.height = measureToString(height); + } + const html = { + name: "div", + attributes, + children + }; + applyAssist(this, attributes); + delete this[$extra]; + return HTMLResult.success(createWrapper(this, html), bbox); + } +} +class Execute extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "execute"); + this.connection = attributes.connection || ""; + this.executeType = getStringOption(attributes.executeType, ["import", "remerge"]); + this.id = attributes.id || ""; + this.runAt = getStringOption(attributes.runAt, ["client", "both", "server"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Extras extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "extras", true); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.boolean = new XFAObjectArray(); + this.date = new XFAObjectArray(); + this.dateTime = new XFAObjectArray(); + this.decimal = new XFAObjectArray(); + this.exData = new XFAObjectArray(); + this.extras = new XFAObjectArray(); + this.float = new XFAObjectArray(); + this.image = new XFAObjectArray(); + this.integer = new XFAObjectArray(); + this.text = new XFAObjectArray(); + this.time = new XFAObjectArray(); + } +} +class Field extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "field", true); + this.access = getStringOption(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]); + this.accessKey = attributes.accessKey || ""; + this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]); + this.colSpan = getInteger({ + data: attributes.colSpan, + defaultValue: 1, + validate: n => n >= 1 || n === -1 + }); + this.h = attributes.h ? getMeasurement(attributes.h) : ""; + this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]); + this.id = attributes.id || ""; + this.locale = attributes.locale || ""; + this.maxH = getMeasurement(attributes.maxH, "0pt"); + this.maxW = getMeasurement(attributes.maxW, "0pt"); + this.minH = getMeasurement(attributes.minH, "0pt"); + this.minW = getMeasurement(attributes.minW, "0pt"); + this.name = attributes.name || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.relevant = getRelevant(attributes.relevant); + this.rotate = getInteger({ + data: attributes.rotate, + defaultValue: 0, + validate: x => x % 90 === 0 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.w = attributes.w ? getMeasurement(attributes.w) : ""; + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); + this.assist = null; + this.bind = null; + this.border = null; + this.calculate = null; + this.caption = null; + this.desc = null; + this.extras = null; + this.font = null; + this.format = null; + this.items = new XFAObjectArray(2); + this.keep = null; + this.margin = null; + this.para = null; + this.traversal = null; + this.ui = null; + this.validate = null; + this.value = null; + this.bindItems = new XFAObjectArray(); + this.connect = new XFAObjectArray(); + this.event = new XFAObjectArray(); + this.setProperty = new XFAObjectArray(); + } + [$isBindable]() { + return true; + } + [$setValue](value) { + _setValue(this, value); + } + [$toHTML](availableSpace) { + setTabIndex(this); + if (!this.ui) { + this.ui = new Ui({}); + this.ui[$globalData] = this[$globalData]; + this[$appendChild](this.ui); + let node; + switch (this.items.children.length) { + case 0: + node = new TextEdit({}); + this.ui.textEdit = node; + break; + case 1: + node = new CheckButton({}); + this.ui.checkButton = node; + break; + case 2: + node = new ChoiceList({}); + this.ui.choiceList = node; + break; + } + this.ui[$appendChild](node); + } + if (!this.ui || this.presence === "hidden" || this.presence === "inactive" || this.h === 0 || this.w === 0) { + return HTMLResult.EMPTY; + } + if (this.caption) { + delete this.caption[$extra]; + } + this[$pushPara](); + const caption = this.caption ? this.caption[$toHTML](availableSpace).html : null; + const savedW = this.w; + const savedH = this.h; + let marginH = 0; + let marginV = 0; + if (this.margin) { + marginH = this.margin.leftInset + this.margin.rightInset; + marginV = this.margin.topInset + this.margin.bottomInset; + } + let borderDims = null; + if (this.w === "" || this.h === "") { + let width = null; + let height = null; + let uiW = 0; + let uiH = 0; + if (this.ui.checkButton) { + uiW = uiH = this.ui.checkButton.size; + } else { + const { + w, + h + } = layoutNode(this, availableSpace); + if (w !== null) { + uiW = w; + uiH = h; + } else { + uiH = fonts_getMetrics(this.font, true).lineNoGap; + } + } + borderDims = getBorderDims(this.ui[$getExtra]()); + uiW += borderDims.w; + uiH += borderDims.h; + if (this.caption) { + const { + w, + h, + isBroken + } = this.caption[$getExtra](availableSpace); + if (isBroken && this[$getSubformParent]()[$isThereMoreWidth]()) { + this[$popPara](); + return HTMLResult.FAILURE; + } + width = w; + height = h; + switch (this.caption.placement) { + case "left": + case "right": + case "inline": + width += uiW; + break; + case "top": + case "bottom": + height += uiH; + break; + } + } else { + width = uiW; + height = uiH; + } + if (width && this.w === "") { + width += marginH; + this.w = Math.min(this.maxW <= 0 ? Infinity : this.maxW, this.minW + 1 < width ? width : this.minW); + } + if (height && this.h === "") { + height += marginV; + this.h = Math.min(this.maxH <= 0 ? Infinity : this.maxH, this.minH + 1 < height ? height : this.minH); + } + } + this[$popPara](); + fixDimensions(this); + setFirstUnsplittable(this); + if (!checkDimensions(this, availableSpace)) { + this.w = savedW; + this.h = savedH; + this[$popPara](); + return HTMLResult.FAILURE; + } + unsetFirstUnsplittable(this); + const style = toStyle(this, "font", "dimensions", "position", "rotate", "anchorType", "presence", "margin", "hAlign"); + setMinMaxDimensions(this, style); + const classNames = ["xfaField"]; + if (this.font) { + classNames.push("xfaFont"); + } + if (isPrintOnly(this)) { + classNames.push("xfaPrintOnly"); + } + const attributes = { + style, + id: this[$uid], + class: classNames + }; + if (style.margin) { + style.padding = style.margin; + delete style.margin; + } + setAccess(this, classNames); + if (this.name) { + attributes.xfaName = this.name; + } + const children = []; + const html = { + name: "div", + attributes, + children + }; + applyAssist(this, attributes); + const borderStyle = this.border ? this.border[$toStyle]() : null; + const bbox = computeBbox(this, html, availableSpace); + const ui = this.ui[$toHTML]().html; + if (!ui) { + Object.assign(style, borderStyle); + return HTMLResult.success(createWrapper(this, html), bbox); + } + if (this[$tabIndex]) { + if (ui.children?.[0]) { + ui.children[0].attributes.tabindex = this[$tabIndex]; + } else { + ui.attributes.tabindex = this[$tabIndex]; + } + } + if (!ui.attributes.style) { + ui.attributes.style = Object.create(null); + } + let aElement = null; + if (this.ui.button) { + if (ui.children.length === 1) { + [aElement] = ui.children.splice(0, 1); + } + Object.assign(ui.attributes.style, borderStyle); + } else { + Object.assign(style, borderStyle); + } + children.push(ui); + if (this.value) { + if (this.ui.imageEdit) { + ui.children.push(this.value[$toHTML]().html); + } else if (!this.ui.button) { + let value = ""; + if (this.value.exData) { + value = this.value.exData[$text](); + } else if (this.value.text) { + value = this.value.text[$getExtra](); + } else { + const htmlValue = this.value[$toHTML]().html; + if (htmlValue !== null) { + value = htmlValue.children[0].value; + } + } + if (this.ui.textEdit && this.value.text?.maxChars) { + ui.children[0].attributes.maxLength = this.value.text.maxChars; + } + if (value) { + if (this.ui.numericEdit) { + value = parseFloat(value); + value = isNaN(value) ? "" : value.toString(); + } + if (ui.children[0].name === "textarea") { + ui.children[0].attributes.textContent = value; + } else { + ui.children[0].attributes.value = value; + } + } + } + } + if (!this.ui.imageEdit && ui.children?.[0] && this.h) { + borderDims = borderDims || getBorderDims(this.ui[$getExtra]()); + let captionHeight = 0; + if (this.caption && ["top", "bottom"].includes(this.caption.placement)) { + captionHeight = this.caption.reserve; + if (captionHeight <= 0) { + captionHeight = this.caption[$getExtra](availableSpace).h; + } + const inputHeight = this.h - captionHeight - marginV - borderDims.h; + ui.children[0].attributes.style.height = measureToString(inputHeight); + } else { + ui.children[0].attributes.style.height = "100%"; + } + } + if (aElement) { + ui.children.push(aElement); + } + if (!caption) { + if (ui.attributes.class) { + ui.attributes.class.push("xfaLeft"); + } + this.w = savedW; + this.h = savedH; + return HTMLResult.success(createWrapper(this, html), bbox); + } + if (this.ui.button) { + if (style.padding) { + delete style.padding; + } + if (caption.name === "div") { + caption.name = "span"; + } + ui.children.push(caption); + return HTMLResult.success(html, bbox); + } else if (this.ui.checkButton) { + caption.attributes.class[0] = "xfaCaptionForCheckButton"; + } + if (!ui.attributes.class) { + ui.attributes.class = []; + } + ui.children.splice(0, 0, caption); + switch (this.caption.placement) { + case "left": + ui.attributes.class.push("xfaLeft"); + break; + case "right": + ui.attributes.class.push("xfaRight"); + break; + case "top": + ui.attributes.class.push("xfaTop"); + break; + case "bottom": + ui.attributes.class.push("xfaBottom"); + break; + case "inline": + ui.attributes.class.push("xfaLeft"); + break; + } + this.w = savedW; + this.h = savedH; + return HTMLResult.success(createWrapper(this, html), bbox); + } +} +class Fill extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "fill", true); + this.id = attributes.id || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + this.linear = null; + this.pattern = null; + this.radial = null; + this.solid = null; + this.stipple = null; + } + [$toStyle]() { + const parent = this[$getParent](); + const grandpa = parent[$getParent](); + const ggrandpa = grandpa[$getParent](); + const style = Object.create(null); + let propName = "color"; + let altPropName = propName; + if (parent instanceof Border) { + propName = "background-color"; + altPropName = "background"; + if (ggrandpa instanceof Ui) { + style.backgroundColor = "white"; + } + } + if (parent instanceof Rectangle || parent instanceof Arc) { + propName = altPropName = "fill"; + style.fill = "white"; + } + for (const name of Object.getOwnPropertyNames(this)) { + if (name === "extras" || name === "color") { + continue; + } + const obj = this[name]; + if (!(obj instanceof XFAObject)) { + continue; + } + const color = obj[$toStyle](this.color); + if (color) { + style[color.startsWith("#") ? propName : altPropName] = color; + } + return style; + } + if (this.color?.value) { + const color = this.color[$toStyle](); + style[color.startsWith("#") ? propName : altPropName] = color; + } + return style; + } +} +class Filter extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "filter", true); + this.addRevocationInfo = getStringOption(attributes.addRevocationInfo, ["", "required", "optional", "none"]); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.version = getInteger({ + data: this.version, + defaultValue: 5, + validate: x => x >= 1 && x <= 5 + }); + this.appearanceFilter = null; + this.certificates = null; + this.digestMethods = null; + this.encodings = null; + this.encryptionMethods = null; + this.handler = null; + this.lockDocument = null; + this.mdp = null; + this.reasons = null; + this.timeStamp = null; + } +} +class Float extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "float"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + const number = parseFloat(this[$content].trim()); + this[$content] = isNaN(number) ? null : number; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] !== null ? this[$content].toString() : ""); + } +} +class template_Font extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "font", true); + this.baselineShift = getMeasurement(attributes.baselineShift); + this.fontHorizontalScale = getFloat({ + data: attributes.fontHorizontalScale, + defaultValue: 100, + validate: x => x >= 0 + }); + this.fontVerticalScale = getFloat({ + data: attributes.fontVerticalScale, + defaultValue: 100, + validate: x => x >= 0 + }); + this.id = attributes.id || ""; + this.kerningMode = getStringOption(attributes.kerningMode, ["none", "pair"]); + this.letterSpacing = getMeasurement(attributes.letterSpacing, "0"); + this.lineThrough = getInteger({ + data: attributes.lineThrough, + defaultValue: 0, + validate: x => x === 1 || x === 2 + }); + this.lineThroughPeriod = getStringOption(attributes.lineThroughPeriod, ["all", "word"]); + this.overline = getInteger({ + data: attributes.overline, + defaultValue: 0, + validate: x => x === 1 || x === 2 + }); + this.overlinePeriod = getStringOption(attributes.overlinePeriod, ["all", "word"]); + this.posture = getStringOption(attributes.posture, ["normal", "italic"]); + this.size = getMeasurement(attributes.size, "10pt"); + this.typeface = attributes.typeface || "Courier"; + this.underline = getInteger({ + data: attributes.underline, + defaultValue: 0, + validate: x => x === 1 || x === 2 + }); + this.underlinePeriod = getStringOption(attributes.underlinePeriod, ["all", "word"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.weight = getStringOption(attributes.weight, ["normal", "bold"]); + this.extras = null; + this.fill = null; + } + [$clean](builder) { + super[$clean](builder); + this[$globalData].usedTypefaces.add(this.typeface); + } + [$toStyle]() { + const style = toStyle(this, "fill"); + const color = style.color; + if (color) { + if (color === "#000000") { + delete style.color; + } else if (!color.startsWith("#")) { + style.background = color; + style.backgroundClip = "text"; + style.color = "transparent"; + } + } + if (this.baselineShift) { + style.verticalAlign = measureToString(this.baselineShift); + } + style.fontKerning = this.kerningMode === "none" ? "none" : "normal"; + style.letterSpacing = measureToString(this.letterSpacing); + if (this.lineThrough !== 0) { + style.textDecoration = "line-through"; + if (this.lineThrough === 2) { + style.textDecorationStyle = "double"; + } + } + if (this.overline !== 0) { + style.textDecoration = "overline"; + if (this.overline === 2) { + style.textDecorationStyle = "double"; + } + } + style.fontStyle = this.posture; + style.fontSize = measureToString(0.99 * this.size); + setFontFamily(this, this, this[$globalData].fontFinder, style); + if (this.underline !== 0) { + style.textDecoration = "underline"; + if (this.underline === 2) { + style.textDecorationStyle = "double"; + } + } + style.fontWeight = this.weight; + return style; + } +} +class Format extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "format", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.picture = null; + } +} +class Handler extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "handler"); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Hyphenation extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "hyphenation"); + this.excludeAllCaps = getInteger({ + data: attributes.excludeAllCaps, + defaultValue: 0, + validate: x => x === 1 + }); + this.excludeInitialCap = getInteger({ + data: attributes.excludeInitialCap, + defaultValue: 0, + validate: x => x === 1 + }); + this.hyphenate = getInteger({ + data: attributes.hyphenate, + defaultValue: 0, + validate: x => x === 1 + }); + this.id = attributes.id || ""; + this.pushCharacterCount = getInteger({ + data: attributes.pushCharacterCount, + defaultValue: 3, + validate: x => x >= 0 + }); + this.remainCharacterCount = getInteger({ + data: attributes.remainCharacterCount, + defaultValue: 3, + validate: x => x >= 0 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.wordCharacterCount = getInteger({ + data: attributes.wordCharacterCount, + defaultValue: 7, + validate: x => x >= 0 + }); + } +} +class Image extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "image"); + this.aspect = getStringOption(attributes.aspect, ["fit", "actual", "height", "none", "width"]); + this.contentType = attributes.contentType || ""; + this.href = attributes.href || ""; + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.transferEncoding = getStringOption(attributes.transferEncoding, ["base64", "none", "package"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$toHTML]() { + if (this.contentType && !MIMES.has(this.contentType.toLowerCase())) { + return HTMLResult.EMPTY; + } + let buffer = this[$globalData].images && this[$globalData].images.get(this.href); + if (!buffer && (this.href || !this[$content])) { + return HTMLResult.EMPTY; + } + if (!buffer && this.transferEncoding === "base64") { + buffer = stringToBytes(atob(this[$content])); + } + if (!buffer) { + return HTMLResult.EMPTY; + } + if (!this.contentType) { + for (const [header, type] of IMAGES_HEADERS) { + if (buffer.length > header.length && header.every((x, i) => x === buffer[i])) { + this.contentType = type; + break; + } + } + if (!this.contentType) { + return HTMLResult.EMPTY; + } + } + const blob = new Blob([buffer], { + type: this.contentType + }); + let style; + switch (this.aspect) { + case "fit": + case "actual": + break; + case "height": + style = { + height: "100%", + objectFit: "fill" + }; + break; + case "none": + style = { + width: "100%", + height: "100%", + objectFit: "fill" + }; + break; + case "width": + style = { + width: "100%", + objectFit: "fill" + }; + break; + } + const parent = this[$getParent](); + return HTMLResult.success({ + name: "img", + attributes: { + class: ["xfaImage"], + style, + src: URL.createObjectURL(blob), + alt: parent ? ariaLabel(parent[$getParent]()) : null + } + }); + } +} +class ImageEdit extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "imageEdit", true); + this.data = getStringOption(attributes.data, ["link", "embed"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.extras = null; + this.margin = null; + } + [$toHTML](availableSpace) { + if (this.data === "embed") { + return HTMLResult.success({ + name: "div", + children: [], + attributes: {} + }); + } + return HTMLResult.EMPTY; + } +} +class Integer extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "integer"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + const number = parseInt(this[$content].trim(), 10); + this[$content] = isNaN(number) ? null : number; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] !== null ? this[$content].toString() : ""); + } +} +class Issuers extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "issuers", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.certificate = new XFAObjectArray(); + } +} +class Items extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "items", true); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.ref = attributes.ref || ""; + this.save = getInteger({ + data: attributes.save, + defaultValue: 0, + validate: x => x === 1 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.boolean = new XFAObjectArray(); + this.date = new XFAObjectArray(); + this.dateTime = new XFAObjectArray(); + this.decimal = new XFAObjectArray(); + this.exData = new XFAObjectArray(); + this.float = new XFAObjectArray(); + this.image = new XFAObjectArray(); + this.integer = new XFAObjectArray(); + this.text = new XFAObjectArray(); + this.time = new XFAObjectArray(); + } + [$toHTML]() { + const output = []; + for (const child of this[$getChildren]()) { + output.push(child[$text]()); + } + return HTMLResult.success(output); + } +} +class Keep extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "keep", true); + this.id = attributes.id || ""; + const options = ["none", "contentArea", "pageArea"]; + this.intact = getStringOption(attributes.intact, options); + this.next = getStringOption(attributes.next, options); + this.previous = getStringOption(attributes.previous, options); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } +} +class KeyUsage extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "keyUsage"); + const options = ["", "yes", "no"]; + this.crlSign = getStringOption(attributes.crlSign, options); + this.dataEncipherment = getStringOption(attributes.dataEncipherment, options); + this.decipherOnly = getStringOption(attributes.decipherOnly, options); + this.digitalSignature = getStringOption(attributes.digitalSignature, options); + this.encipherOnly = getStringOption(attributes.encipherOnly, options); + this.id = attributes.id || ""; + this.keyAgreement = getStringOption(attributes.keyAgreement, options); + this.keyCertSign = getStringOption(attributes.keyCertSign, options); + this.keyEncipherment = getStringOption(attributes.keyEncipherment, options); + this.nonRepudiation = getStringOption(attributes.nonRepudiation, options); + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Line extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "line", true); + this.hand = getStringOption(attributes.hand, ["even", "left", "right"]); + this.id = attributes.id || ""; + this.slope = getStringOption(attributes.slope, ["\\", "/"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.edge = null; + } + [$toHTML]() { + const parent = this[$getParent]()[$getParent](); + const edge = this.edge || new Edge({}); + const edgeStyle = edge[$toStyle](); + const style = Object.create(null); + const thickness = edge.presence === "visible" ? edge.thickness : 0; + style.strokeWidth = measureToString(thickness); + style.stroke = edgeStyle.color; + let x1, y1, x2, y2; + let width = "100%"; + let height = "100%"; + if (parent.w <= thickness) { + [x1, y1, x2, y2] = ["50%", 0, "50%", "100%"]; + width = style.strokeWidth; + } else if (parent.h <= thickness) { + [x1, y1, x2, y2] = [0, "50%", "100%", "50%"]; + height = style.strokeWidth; + } else if (this.slope === "\\") { + [x1, y1, x2, y2] = [0, 0, "100%", "100%"]; + } else { + [x1, y1, x2, y2] = [0, "100%", "100%", 0]; + } + const line = { + name: "line", + attributes: { + xmlns: SVG_NS, + x1, + y1, + x2, + y2, + style + } + }; + const svg = { + name: "svg", + children: [line], + attributes: { + xmlns: SVG_NS, + width, + height, + style: { + overflow: "visible" + } + } + }; + if (hasMargin(parent)) { + return HTMLResult.success({ + name: "div", + attributes: { + style: { + display: "inline", + width: "100%", + height: "100%" + } + }, + children: [svg] + }); + } + svg.attributes.style.position = "absolute"; + return HTMLResult.success(svg); + } +} +class Linear extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "linear", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["toRight", "toBottom", "toLeft", "toTop"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + } + [$toStyle](startColor) { + startColor = startColor ? startColor[$toStyle]() : "#FFFFFF"; + const transf = this.type.replace(/([RBLT])/, " $1").toLowerCase(); + const endColor = this.color ? this.color[$toStyle]() : "#000000"; + return `linear-gradient(${transf}, ${startColor}, ${endColor})`; + } +} +class LockDocument extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "lockDocument"); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + this[$content] = getStringOption(this[$content], ["auto", "0", "1"]); + } +} +class Manifest extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "manifest", true); + this.action = getStringOption(attributes.action, ["include", "all", "exclude"]); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.ref = new XFAObjectArray(); + } +} +class Margin extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "margin", true); + this.bottomInset = getMeasurement(attributes.bottomInset, "0"); + this.id = attributes.id || ""; + this.leftInset = getMeasurement(attributes.leftInset, "0"); + this.rightInset = getMeasurement(attributes.rightInset, "0"); + this.topInset = getMeasurement(attributes.topInset, "0"); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } + [$toStyle]() { + return { + margin: measureToString(this.topInset) + " " + measureToString(this.rightInset) + " " + measureToString(this.bottomInset) + " " + measureToString(this.leftInset) + }; + } +} +class Mdp extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "mdp"); + this.id = attributes.id || ""; + this.permissions = getInteger({ + data: attributes.permissions, + defaultValue: 2, + validate: x => x === 1 || x === 3 + }); + this.signatureType = getStringOption(attributes.signatureType, ["filler", "author"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Medium extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "medium"); + this.id = attributes.id || ""; + this.imagingBBox = getBBox(attributes.imagingBBox); + this.long = getMeasurement(attributes.long); + this.orientation = getStringOption(attributes.orientation, ["portrait", "landscape"]); + this.short = getMeasurement(attributes.short); + this.stock = attributes.stock || ""; + this.trayIn = getStringOption(attributes.trayIn, ["auto", "delegate", "pageFront"]); + this.trayOut = getStringOption(attributes.trayOut, ["auto", "delegate"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Message extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "message", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.text = new XFAObjectArray(); + } +} +class NumericEdit extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "numericEdit", true); + this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.comb = null; + this.extras = null; + this.margin = null; + } + [$toHTML](availableSpace) { + const style = toStyle(this, "border", "font", "margin"); + const field = this[$getParent]()[$getParent](); + const html = { + name: "input", + attributes: { + type: "text", + fieldId: field[$uid], + dataId: field[$data]?.[$uid] || field[$uid], + class: ["xfaTextfield"], + style, + "aria-label": ariaLabel(field), + "aria-required": false + } + }; + if (isRequired(field)) { + html.attributes["aria-required"] = true; + html.attributes.required = true; + } + return HTMLResult.success({ + name: "label", + attributes: { + class: ["xfaLabel"] + }, + children: [html] + }); + } +} +class Occur extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "occur", true); + this.id = attributes.id || ""; + this.initial = attributes.initial !== "" ? getInteger({ + data: attributes.initial, + defaultValue: "", + validate: x => true + }) : ""; + this.max = attributes.max !== "" ? getInteger({ + data: attributes.max, + defaultValue: 1, + validate: x => true + }) : ""; + this.min = attributes.min !== "" ? getInteger({ + data: attributes.min, + defaultValue: 1, + validate: x => true + }) : ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } + [$clean]() { + const parent = this[$getParent](); + const originalMin = this.min; + if (this.min === "") { + this.min = parent instanceof PageArea || parent instanceof PageSet ? 0 : 1; + } + if (this.max === "") { + if (originalMin === "") { + this.max = parent instanceof PageArea || parent instanceof PageSet ? -1 : 1; + } else { + this.max = this.min; + } + } + if (this.max !== -1 && this.max < this.min) { + this.max = this.min; + } + if (this.initial === "") { + this.initial = parent instanceof Template ? 1 : this.min; + } + } +} +class Oid extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "oid"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Oids extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "oids", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.oid = new XFAObjectArray(); + } +} +class Overflow extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "overflow"); + this.id = attributes.id || ""; + this.leader = attributes.leader || ""; + this.target = attributes.target || ""; + this.trailer = attributes.trailer || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$getExtra]() { + if (!this[$extra]) { + const parent = this[$getParent](); + const root = this[$getTemplateRoot](); + const target = root[$searchNode](this.target, parent); + const leader = root[$searchNode](this.leader, parent); + const trailer = root[$searchNode](this.trailer, parent); + this[$extra] = { + target: target?.[0] || null, + leader: leader?.[0] || null, + trailer: trailer?.[0] || null, + addLeader: false, + addTrailer: false + }; + } + return this[$extra]; + } +} +class PageArea extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "pageArea", true); + this.blankOrNotBlank = getStringOption(attributes.blankOrNotBlank, ["any", "blank", "notBlank"]); + this.id = attributes.id || ""; + this.initialNumber = getInteger({ + data: attributes.initialNumber, + defaultValue: 1, + validate: x => true + }); + this.name = attributes.name || ""; + this.numbered = getInteger({ + data: attributes.numbered, + defaultValue: 1, + validate: x => true + }); + this.oddOrEven = getStringOption(attributes.oddOrEven, ["any", "even", "odd"]); + this.pagePosition = getStringOption(attributes.pagePosition, ["any", "first", "last", "only", "rest"]); + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.desc = null; + this.extras = null; + this.medium = null; + this.occur = null; + this.area = new XFAObjectArray(); + this.contentArea = new XFAObjectArray(); + this.draw = new XFAObjectArray(); + this.exclGroup = new XFAObjectArray(); + this.field = new XFAObjectArray(); + this.subform = new XFAObjectArray(); + } + [$isUsable]() { + if (!this[$extra]) { + this[$extra] = { + numberOfUse: 0 + }; + return true; + } + return !this.occur || this.occur.max === -1 || this[$extra].numberOfUse < this.occur.max; + } + [$cleanPage]() { + delete this[$extra]; + } + [$getNextPage]() { + if (!this[$extra]) { + this[$extra] = { + numberOfUse: 0 + }; + } + const parent = this[$getParent](); + if (parent.relation === "orderedOccurrence") { + if (this[$isUsable]()) { + this[$extra].numberOfUse += 1; + return this; + } + } + return parent[$getNextPage](); + } + [$getAvailableSpace]() { + return this[$extra].space || { + width: 0, + height: 0 + }; + } + [$toHTML]() { + if (!this[$extra]) { + this[$extra] = { + numberOfUse: 1 + }; + } + const children = []; + this[$extra].children = children; + const style = Object.create(null); + if (this.medium && this.medium.short && this.medium.long) { + style.width = measureToString(this.medium.short); + style.height = measureToString(this.medium.long); + this[$extra].space = { + width: this.medium.short, + height: this.medium.long + }; + if (this.medium.orientation === "landscape") { + const x = style.width; + style.width = style.height; + style.height = x; + this[$extra].space = { + width: this.medium.long, + height: this.medium.short + }; + } + } else { + warn("XFA - No medium specified in pageArea: please file a bug."); + } + this[$childrenToHTML]({ + filter: new Set(["area", "draw", "field", "subform"]), + include: true + }); + this[$childrenToHTML]({ + filter: new Set(["contentArea"]), + include: true + }); + return HTMLResult.success({ + name: "div", + children, + attributes: { + class: ["xfaPage"], + id: this[$uid], + style, + xfaName: this.name + } + }); + } +} +class PageSet extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "pageSet", true); + this.duplexImposition = getStringOption(attributes.duplexImposition, ["longEdge", "shortEdge"]); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.relation = getStringOption(attributes.relation, ["orderedOccurrence", "duplexPaginated", "simplexPaginated"]); + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.occur = null; + this.pageArea = new XFAObjectArray(); + this.pageSet = new XFAObjectArray(); + } + [$cleanPage]() { + for (const page of this.pageArea.children) { + page[$cleanPage](); + } + for (const page of this.pageSet.children) { + page[$cleanPage](); + } + } + [$isUsable]() { + return !this.occur || this.occur.max === -1 || this[$extra].numberOfUse < this.occur.max; + } + [$getNextPage]() { + if (!this[$extra]) { + this[$extra] = { + numberOfUse: 1, + pageIndex: -1, + pageSetIndex: -1 + }; + } + if (this.relation === "orderedOccurrence") { + if (this[$extra].pageIndex + 1 < this.pageArea.children.length) { + this[$extra].pageIndex += 1; + const pageArea = this.pageArea.children[this[$extra].pageIndex]; + return pageArea[$getNextPage](); + } + if (this[$extra].pageSetIndex + 1 < this.pageSet.children.length) { + this[$extra].pageSetIndex += 1; + return this.pageSet.children[this[$extra].pageSetIndex][$getNextPage](); + } + if (this[$isUsable]()) { + this[$extra].numberOfUse += 1; + this[$extra].pageIndex = -1; + this[$extra].pageSetIndex = -1; + return this[$getNextPage](); + } + const parent = this[$getParent](); + if (parent instanceof PageSet) { + return parent[$getNextPage](); + } + this[$cleanPage](); + return this[$getNextPage](); + } + const pageNumber = this[$getTemplateRoot]()[$extra].pageNumber; + const parity = pageNumber % 2 === 0 ? "even" : "odd"; + const position = pageNumber === 0 ? "first" : "rest"; + let page = this.pageArea.children.find(p => p.oddOrEven === parity && p.pagePosition === position); + if (page) { + return page; + } + page = this.pageArea.children.find(p => p.oddOrEven === "any" && p.pagePosition === position); + if (page) { + return page; + } + page = this.pageArea.children.find(p => p.oddOrEven === "any" && p.pagePosition === "any"); + if (page) { + return page; + } + return this.pageArea.children[0]; + } +} +class Para extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "para", true); + this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]); + this.id = attributes.id || ""; + this.lineHeight = attributes.lineHeight ? getMeasurement(attributes.lineHeight, "0pt") : ""; + this.marginLeft = attributes.marginLeft ? getMeasurement(attributes.marginLeft, "0pt") : ""; + this.marginRight = attributes.marginRight ? getMeasurement(attributes.marginRight, "0pt") : ""; + this.orphans = getInteger({ + data: attributes.orphans, + defaultValue: 0, + validate: x => x >= 0 + }); + this.preserve = attributes.preserve || ""; + this.radixOffset = attributes.radixOffset ? getMeasurement(attributes.radixOffset, "0pt") : ""; + this.spaceAbove = attributes.spaceAbove ? getMeasurement(attributes.spaceAbove, "0pt") : ""; + this.spaceBelow = attributes.spaceBelow ? getMeasurement(attributes.spaceBelow, "0pt") : ""; + this.tabDefault = attributes.tabDefault ? getMeasurement(this.tabDefault) : ""; + this.tabStops = (attributes.tabStops || "").trim().split(/\s+/).map((x, i) => i % 2 === 1 ? getMeasurement(x) : x); + this.textIndent = attributes.textIndent ? getMeasurement(attributes.textIndent, "0pt") : ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.vAlign = getStringOption(attributes.vAlign, ["top", "bottom", "middle"]); + this.widows = getInteger({ + data: attributes.widows, + defaultValue: 0, + validate: x => x >= 0 + }); + this.hyphenation = null; + } + [$toStyle]() { + const style = toStyle(this, "hAlign"); + if (this.marginLeft !== "") { + style.paddingLeft = measureToString(this.marginLeft); + } + if (this.marginRight !== "") { + style.paddingight = measureToString(this.marginRight); + } + if (this.spaceAbove !== "") { + style.paddingTop = measureToString(this.spaceAbove); + } + if (this.spaceBelow !== "") { + style.paddingBottom = measureToString(this.spaceBelow); + } + if (this.textIndent !== "") { + style.textIndent = measureToString(this.textIndent); + fixTextIndent(style); + } + if (this.lineHeight > 0) { + style.lineHeight = measureToString(this.lineHeight); + } + if (this.tabDefault !== "") { + style.tabSize = measureToString(this.tabDefault); + } + if (this.tabStops.length > 0) {} + if (this.hyphenatation) { + Object.assign(style, this.hyphenatation[$toStyle]()); + } + return style; + } +} +class PasswordEdit extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "passwordEdit", true); + this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]); + this.id = attributes.id || ""; + this.passwordChar = attributes.passwordChar || "*"; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.extras = null; + this.margin = null; + } +} +class template_Pattern extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "pattern", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["crossHatch", "crossDiagonal", "diagonalLeft", "diagonalRight", "horizontal", "vertical"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + } + [$toStyle](startColor) { + startColor = startColor ? startColor[$toStyle]() : "#FFFFFF"; + const endColor = this.color ? this.color[$toStyle]() : "#000000"; + const width = 5; + const cmd = "repeating-linear-gradient"; + const colors = `${startColor},${startColor} ${width}px,${endColor} ${width}px,${endColor} ${2 * width}px`; + switch (this.type) { + case "crossHatch": + return `${cmd}(to top,${colors}) ${cmd}(to right,${colors})`; + case "crossDiagonal": + return `${cmd}(45deg,${colors}) ${cmd}(-45deg,${colors})`; + case "diagonalLeft": + return `${cmd}(45deg,${colors})`; + case "diagonalRight": + return `${cmd}(-45deg,${colors})`; + case "horizontal": + return `${cmd}(to top,${colors})`; + case "vertical": + return `${cmd}(to right,${colors})`; + } + return ""; + } +} +class Picture extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "picture"); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Proto extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "proto", true); + this.appearanceFilter = new XFAObjectArray(); + this.arc = new XFAObjectArray(); + this.area = new XFAObjectArray(); + this.assist = new XFAObjectArray(); + this.barcode = new XFAObjectArray(); + this.bindItems = new XFAObjectArray(); + this.bookend = new XFAObjectArray(); + this.boolean = new XFAObjectArray(); + this.border = new XFAObjectArray(); + this.break = new XFAObjectArray(); + this.breakAfter = new XFAObjectArray(); + this.breakBefore = new XFAObjectArray(); + this.button = new XFAObjectArray(); + this.calculate = new XFAObjectArray(); + this.caption = new XFAObjectArray(); + this.certificate = new XFAObjectArray(); + this.certificates = new XFAObjectArray(); + this.checkButton = new XFAObjectArray(); + this.choiceList = new XFAObjectArray(); + this.color = new XFAObjectArray(); + this.comb = new XFAObjectArray(); + this.connect = new XFAObjectArray(); + this.contentArea = new XFAObjectArray(); + this.corner = new XFAObjectArray(); + this.date = new XFAObjectArray(); + this.dateTime = new XFAObjectArray(); + this.dateTimeEdit = new XFAObjectArray(); + this.decimal = new XFAObjectArray(); + this.defaultUi = new XFAObjectArray(); + this.desc = new XFAObjectArray(); + this.digestMethod = new XFAObjectArray(); + this.digestMethods = new XFAObjectArray(); + this.draw = new XFAObjectArray(); + this.edge = new XFAObjectArray(); + this.encoding = new XFAObjectArray(); + this.encodings = new XFAObjectArray(); + this.encrypt = new XFAObjectArray(); + this.encryptData = new XFAObjectArray(); + this.encryption = new XFAObjectArray(); + this.encryptionMethod = new XFAObjectArray(); + this.encryptionMethods = new XFAObjectArray(); + this.event = new XFAObjectArray(); + this.exData = new XFAObjectArray(); + this.exObject = new XFAObjectArray(); + this.exclGroup = new XFAObjectArray(); + this.execute = new XFAObjectArray(); + this.extras = new XFAObjectArray(); + this.field = new XFAObjectArray(); + this.fill = new XFAObjectArray(); + this.filter = new XFAObjectArray(); + this.float = new XFAObjectArray(); + this.font = new XFAObjectArray(); + this.format = new XFAObjectArray(); + this.handler = new XFAObjectArray(); + this.hyphenation = new XFAObjectArray(); + this.image = new XFAObjectArray(); + this.imageEdit = new XFAObjectArray(); + this.integer = new XFAObjectArray(); + this.issuers = new XFAObjectArray(); + this.items = new XFAObjectArray(); + this.keep = new XFAObjectArray(); + this.keyUsage = new XFAObjectArray(); + this.line = new XFAObjectArray(); + this.linear = new XFAObjectArray(); + this.lockDocument = new XFAObjectArray(); + this.manifest = new XFAObjectArray(); + this.margin = new XFAObjectArray(); + this.mdp = new XFAObjectArray(); + this.medium = new XFAObjectArray(); + this.message = new XFAObjectArray(); + this.numericEdit = new XFAObjectArray(); + this.occur = new XFAObjectArray(); + this.oid = new XFAObjectArray(); + this.oids = new XFAObjectArray(); + this.overflow = new XFAObjectArray(); + this.pageArea = new XFAObjectArray(); + this.pageSet = new XFAObjectArray(); + this.para = new XFAObjectArray(); + this.passwordEdit = new XFAObjectArray(); + this.pattern = new XFAObjectArray(); + this.picture = new XFAObjectArray(); + this.radial = new XFAObjectArray(); + this.reason = new XFAObjectArray(); + this.reasons = new XFAObjectArray(); + this.rectangle = new XFAObjectArray(); + this.ref = new XFAObjectArray(); + this.script = new XFAObjectArray(); + this.setProperty = new XFAObjectArray(); + this.signData = new XFAObjectArray(); + this.signature = new XFAObjectArray(); + this.signing = new XFAObjectArray(); + this.solid = new XFAObjectArray(); + this.speak = new XFAObjectArray(); + this.stipple = new XFAObjectArray(); + this.subform = new XFAObjectArray(); + this.subformSet = new XFAObjectArray(); + this.subjectDN = new XFAObjectArray(); + this.subjectDNs = new XFAObjectArray(); + this.submit = new XFAObjectArray(); + this.text = new XFAObjectArray(); + this.textEdit = new XFAObjectArray(); + this.time = new XFAObjectArray(); + this.timeStamp = new XFAObjectArray(); + this.toolTip = new XFAObjectArray(); + this.traversal = new XFAObjectArray(); + this.traverse = new XFAObjectArray(); + this.ui = new XFAObjectArray(); + this.validate = new XFAObjectArray(); + this.value = new XFAObjectArray(); + this.variables = new XFAObjectArray(); + } +} +class Radial extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "radial", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["toEdge", "toCenter"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + } + [$toStyle](startColor) { + startColor = startColor ? startColor[$toStyle]() : "#FFFFFF"; + const endColor = this.color ? this.color[$toStyle]() : "#000000"; + const colors = this.type === "toEdge" ? `${startColor},${endColor}` : `${endColor},${startColor}`; + return `radial-gradient(circle at center, ${colors})`; + } +} +class Reason extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "reason"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Reasons extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "reasons", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.reason = new XFAObjectArray(); + } +} +class Rectangle extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "rectangle", true); + this.hand = getStringOption(attributes.hand, ["even", "left", "right"]); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.corner = new XFAObjectArray(4); + this.edge = new XFAObjectArray(4); + this.fill = null; + } + [$toHTML]() { + const edge = this.edge.children.length ? this.edge.children[0] : new Edge({}); + const edgeStyle = edge[$toStyle](); + const style = Object.create(null); + if (this.fill?.presence === "visible") { + Object.assign(style, this.fill[$toStyle]()); + } else { + style.fill = "transparent"; + } + style.strokeWidth = measureToString(edge.presence === "visible" ? edge.thickness : 0); + style.stroke = edgeStyle.color; + const corner = this.corner.children.length ? this.corner.children[0] : new Corner({}); + const cornerStyle = corner[$toStyle](); + const rect = { + name: "rect", + attributes: { + xmlns: SVG_NS, + width: "100%", + height: "100%", + x: 0, + y: 0, + rx: cornerStyle.radius, + ry: cornerStyle.radius, + style + } + }; + const svg = { + name: "svg", + children: [rect], + attributes: { + xmlns: SVG_NS, + style: { + overflow: "visible" + }, + width: "100%", + height: "100%" + } + }; + const parent = this[$getParent]()[$getParent](); + if (hasMargin(parent)) { + return HTMLResult.success({ + name: "div", + attributes: { + style: { + display: "inline", + width: "100%", + height: "100%" + } + }, + children: [svg] + }); + } + svg.attributes.style.position = "absolute"; + return HTMLResult.success(svg); + } +} +class RefElement extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "ref"); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Script extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "script"); + this.binding = attributes.binding || ""; + this.contentType = attributes.contentType || ""; + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.runAt = getStringOption(attributes.runAt, ["client", "both", "server"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class SetProperty extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "setProperty"); + this.connection = attributes.connection || ""; + this.ref = attributes.ref || ""; + this.target = attributes.target || ""; + } +} +class SignData extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "signData", true); + this.id = attributes.id || ""; + this.operation = getStringOption(attributes.operation, ["sign", "clear", "verify"]); + this.ref = attributes.ref || ""; + this.target = attributes.target || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.filter = null; + this.manifest = null; + } +} +class Signature extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "signature", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["PDF1.3", "PDF1.6"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.border = null; + this.extras = null; + this.filter = null; + this.manifest = null; + this.margin = null; + } +} +class Signing extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "signing", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.certificate = new XFAObjectArray(); + } +} +class Solid extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "solid", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + } + [$toStyle](startColor) { + return startColor ? startColor[$toStyle]() : "#FFFFFF"; + } +} +class Speak extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "speak"); + this.disable = getInteger({ + data: attributes.disable, + defaultValue: 0, + validate: x => x === 1 + }); + this.id = attributes.id || ""; + this.priority = getStringOption(attributes.priority, ["custom", "caption", "name", "toolTip"]); + this.rid = attributes.rid || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Stipple extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "stipple", true); + this.id = attributes.id || ""; + this.rate = getInteger({ + data: attributes.rate, + defaultValue: 50, + validate: x => x >= 0 && x <= 100 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.color = null; + this.extras = null; + } + [$toStyle](bgColor) { + const alpha = this.rate / 100; + return Util.makeHexColor(Math.round(bgColor.value.r * (1 - alpha) + this.value.r * alpha), Math.round(bgColor.value.g * (1 - alpha) + this.value.g * alpha), Math.round(bgColor.value.b * (1 - alpha) + this.value.b * alpha)); + } +} +class Subform extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "subform", true); + this.access = getStringOption(attributes.access, ["open", "nonInteractive", "protected", "readOnly"]); + this.allowMacro = getInteger({ + data: attributes.allowMacro, + defaultValue: 0, + validate: x => x === 1 + }); + this.anchorType = getStringOption(attributes.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]); + this.colSpan = getInteger({ + data: attributes.colSpan, + defaultValue: 1, + validate: n => n >= 1 || n === -1 + }); + this.columnWidths = (attributes.columnWidths || "").trim().split(/\s+/).map(x => x === "-1" ? -1 : getMeasurement(x)); + this.h = attributes.h ? getMeasurement(attributes.h) : ""; + this.hAlign = getStringOption(attributes.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]); + this.id = attributes.id || ""; + this.layout = getStringOption(attributes.layout, ["position", "lr-tb", "rl-row", "rl-tb", "row", "table", "tb"]); + this.locale = attributes.locale || ""; + this.maxH = getMeasurement(attributes.maxH, "0pt"); + this.maxW = getMeasurement(attributes.maxW, "0pt"); + this.mergeMode = getStringOption(attributes.mergeMode, ["consumeData", "matchTemplate"]); + this.minH = getMeasurement(attributes.minH, "0pt"); + this.minW = getMeasurement(attributes.minW, "0pt"); + this.name = attributes.name || ""; + this.presence = getStringOption(attributes.presence, ["visible", "hidden", "inactive", "invisible"]); + this.relevant = getRelevant(attributes.relevant); + this.restoreState = getStringOption(attributes.restoreState, ["manual", "auto"]); + this.scope = getStringOption(attributes.scope, ["name", "none"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.w = attributes.w ? getMeasurement(attributes.w) : ""; + this.x = getMeasurement(attributes.x, "0pt"); + this.y = getMeasurement(attributes.y, "0pt"); + this.assist = null; + this.bind = null; + this.bookend = null; + this.border = null; + this.break = null; + this.calculate = null; + this.desc = null; + this.extras = null; + this.keep = null; + this.margin = null; + this.occur = null; + this.overflow = null; + this.pageSet = null; + this.para = null; + this.traversal = null; + this.validate = null; + this.variables = null; + this.area = new XFAObjectArray(); + this.breakAfter = new XFAObjectArray(); + this.breakBefore = new XFAObjectArray(); + this.connect = new XFAObjectArray(); + this.draw = new XFAObjectArray(); + this.event = new XFAObjectArray(); + this.exObject = new XFAObjectArray(); + this.exclGroup = new XFAObjectArray(); + this.field = new XFAObjectArray(); + this.proto = new XFAObjectArray(); + this.setProperty = new XFAObjectArray(); + this.subform = new XFAObjectArray(); + this.subformSet = new XFAObjectArray(); + } + [$getSubformParent]() { + const parent = this[$getParent](); + if (parent instanceof SubformSet) { + return parent[$getSubformParent](); + } + return parent; + } + [$isBindable]() { + return true; + } + [$isThereMoreWidth]() { + return this.layout.endsWith("-tb") && this[$extra].attempt === 0 && this[$extra].numberInLine > 0 || this[$getParent]()[$isThereMoreWidth](); + } + *[$getContainedChildren]() { + yield* getContainedChildren(this); + } + [$flushHTML]() { + return flushHTML(this); + } + [$addHTML](html, bbox) { + addHTML(this, html, bbox); + } + [$getAvailableSpace]() { + return getAvailableSpace(this); + } + [$isSplittable]() { + const parent = this[$getSubformParent](); + if (!parent[$isSplittable]()) { + return false; + } + if (this[$extra]._isSplittable !== undefined) { + return this[$extra]._isSplittable; + } + if (this.layout === "position" || this.layout.includes("row")) { + this[$extra]._isSplittable = false; + return false; + } + if (this.keep && this.keep.intact !== "none") { + this[$extra]._isSplittable = false; + return false; + } + if (parent.layout?.endsWith("-tb") && parent[$extra].numberInLine !== 0) { + return false; + } + this[$extra]._isSplittable = true; + return true; + } + [$toHTML](availableSpace) { + setTabIndex(this); + if (this.break) { + if (this.break.after !== "auto" || this.break.afterTarget !== "") { + const node = new BreakAfter({ + targetType: this.break.after, + target: this.break.afterTarget, + startNew: this.break.startNew.toString() + }); + node[$globalData] = this[$globalData]; + this[$appendChild](node); + this.breakAfter.push(node); + } + if (this.break.before !== "auto" || this.break.beforeTarget !== "") { + const node = new BreakBefore({ + targetType: this.break.before, + target: this.break.beforeTarget, + startNew: this.break.startNew.toString() + }); + node[$globalData] = this[$globalData]; + this[$appendChild](node); + this.breakBefore.push(node); + } + if (this.break.overflowTarget !== "") { + const node = new Overflow({ + target: this.break.overflowTarget, + leader: this.break.overflowLeader, + trailer: this.break.overflowTrailer + }); + node[$globalData] = this[$globalData]; + this[$appendChild](node); + this.overflow.push(node); + } + this[$removeChild](this.break); + this.break = null; + } + if (this.presence === "hidden" || this.presence === "inactive") { + return HTMLResult.EMPTY; + } + if (this.breakBefore.children.length > 1 || this.breakAfter.children.length > 1) { + warn("XFA - Several breakBefore or breakAfter in subforms: please file a bug."); + } + if (this.breakBefore.children.length >= 1) { + const breakBefore = this.breakBefore.children[0]; + if (handleBreak(breakBefore)) { + return HTMLResult.breakNode(breakBefore); + } + } + if (this[$extra]?.afterBreakAfter) { + return HTMLResult.EMPTY; + } + fixDimensions(this); + const children = []; + const attributes = { + id: this[$uid], + class: [] + }; + setAccess(this, attributes.class); + if (!this[$extra]) { + this[$extra] = Object.create(null); + } + Object.assign(this[$extra], { + children, + line: null, + attributes, + attempt: 0, + numberInLine: 0, + availableSpace: { + width: Math.min(this.w || Infinity, availableSpace.width), + height: Math.min(this.h || Infinity, availableSpace.height) + }, + width: 0, + height: 0, + prevHeight: 0, + currentWidth: 0 + }); + const root = this[$getTemplateRoot](); + const savedNoLayoutFailure = root[$extra].noLayoutFailure; + const isSplittable = this[$isSplittable](); + if (!isSplittable) { + setFirstUnsplittable(this); + } + if (!checkDimensions(this, availableSpace)) { + return HTMLResult.FAILURE; + } + const filter = new Set(["area", "draw", "exclGroup", "field", "subform", "subformSet"]); + if (this.layout.includes("row")) { + const columnWidths = this[$getSubformParent]().columnWidths; + if (Array.isArray(columnWidths) && columnWidths.length > 0) { + this[$extra].columnWidths = columnWidths; + this[$extra].currentColumn = 0; + } + } + const style = toStyle(this, "anchorType", "dimensions", "position", "presence", "border", "margin", "hAlign"); + const classNames = ["xfaSubform"]; + const cl = layoutClass(this); + if (cl) { + classNames.push(cl); + } + attributes.style = style; + attributes.class = classNames; + if (this.name) { + attributes.xfaName = this.name; + } + if (this.overflow) { + const overflowExtra = this.overflow[$getExtra](); + if (overflowExtra.addLeader) { + overflowExtra.addLeader = false; + handleOverflow(this, overflowExtra.leader, availableSpace); + } + } + this[$pushPara](); + const isLrTb = this.layout === "lr-tb" || this.layout === "rl-tb"; + const maxRun = isLrTb ? MAX_ATTEMPTS_FOR_LRTB_LAYOUT : 1; + for (; this[$extra].attempt < maxRun; this[$extra].attempt++) { + if (isLrTb && this[$extra].attempt === MAX_ATTEMPTS_FOR_LRTB_LAYOUT - 1) { + this[$extra].numberInLine = 0; + } + const result = this[$childrenToHTML]({ + filter, + include: true + }); + if (result.success) { + break; + } + if (result.isBreak()) { + this[$popPara](); + return result; + } + if (isLrTb && this[$extra].attempt === 0 && this[$extra].numberInLine === 0 && !root[$extra].noLayoutFailure) { + this[$extra].attempt = maxRun; + break; + } + } + this[$popPara](); + if (!isSplittable) { + unsetFirstUnsplittable(this); + } + root[$extra].noLayoutFailure = savedNoLayoutFailure; + if (this[$extra].attempt === maxRun) { + if (this.overflow) { + this[$getTemplateRoot]()[$extra].overflowNode = this.overflow; + } + if (!isSplittable) { + delete this[$extra]; + } + return HTMLResult.FAILURE; + } + if (this.overflow) { + const overflowExtra = this.overflow[$getExtra](); + if (overflowExtra.addTrailer) { + overflowExtra.addTrailer = false; + handleOverflow(this, overflowExtra.trailer, availableSpace); + } + } + let marginH = 0; + let marginV = 0; + if (this.margin) { + marginH = this.margin.leftInset + this.margin.rightInset; + marginV = this.margin.topInset + this.margin.bottomInset; + } + const width = Math.max(this[$extra].width + marginH, this.w || 0); + const height = Math.max(this[$extra].height + marginV, this.h || 0); + const bbox = [this.x, this.y, width, height]; + if (this.w === "") { + style.width = measureToString(width); + } + if (this.h === "") { + style.height = measureToString(height); + } + if ((style.width === "0px" || style.height === "0px") && children.length === 0) { + return HTMLResult.EMPTY; + } + const html = { + name: "div", + attributes, + children + }; + applyAssist(this, attributes); + const result = HTMLResult.success(createWrapper(this, html), bbox); + if (this.breakAfter.children.length >= 1) { + const breakAfter = this.breakAfter.children[0]; + if (handleBreak(breakAfter)) { + this[$extra].afterBreakAfter = result; + return HTMLResult.breakNode(breakAfter); + } + } + delete this[$extra]; + return result; + } +} +class SubformSet extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "subformSet", true); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.relation = getStringOption(attributes.relation, ["ordered", "choice", "unordered"]); + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.bookend = null; + this.break = null; + this.desc = null; + this.extras = null; + this.occur = null; + this.overflow = null; + this.breakAfter = new XFAObjectArray(); + this.breakBefore = new XFAObjectArray(); + this.subform = new XFAObjectArray(); + this.subformSet = new XFAObjectArray(); + } + *[$getContainedChildren]() { + yield* getContainedChildren(this); + } + [$getSubformParent]() { + let parent = this[$getParent](); + while (!(parent instanceof Subform)) { + parent = parent[$getParent](); + } + return parent; + } + [$isBindable]() { + return true; + } +} +class SubjectDN extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "subjectDN"); + this.delimiter = attributes.delimiter || ","; + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + this[$content] = new Map(this[$content].split(this.delimiter).map(kv => { + kv = kv.split("=", 2); + kv[0] = kv[0].trim(); + return kv; + })); + } +} +class SubjectDNs extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "subjectDNs", true); + this.id = attributes.id || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.subjectDN = new XFAObjectArray(); + } +} +class Submit extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "submit", true); + this.embedPDF = getInteger({ + data: attributes.embedPDF, + defaultValue: 0, + validate: x => x === 1 + }); + this.format = getStringOption(attributes.format, ["xdp", "formdata", "pdf", "urlencoded", "xfd", "xml"]); + this.id = attributes.id || ""; + this.target = attributes.target || ""; + this.textEncoding = getKeyword({ + data: attributes.textEncoding ? attributes.textEncoding.toLowerCase() : "", + defaultValue: "", + validate: k => ["utf-8", "big-five", "fontspecific", "gbk", "gb-18030", "gb-2312", "ksc-5601", "none", "shift-jis", "ucs-2", "utf-16"].includes(k) || k.match(/iso-8859-\d{2}/) + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.xdpContent = attributes.xdpContent || ""; + this.encrypt = null; + this.encryptData = new XFAObjectArray(); + this.signData = new XFAObjectArray(); + } +} +class Template extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "template", true); + this.baseProfile = getStringOption(attributes.baseProfile, ["full", "interactiveForms"]); + this.extras = null; + this.subform = new XFAObjectArray(); + } + [$finalize]() { + if (this.subform.children.length === 0) { + warn("XFA - No subforms in template node."); + } + if (this.subform.children.length >= 2) { + warn("XFA - Several subforms in template node: please file a bug."); + } + this[$tabIndex] = DEFAULT_TAB_INDEX; + } + [$isSplittable]() { + return true; + } + [$searchNode](expr, container) { + if (expr.startsWith("#")) { + return [this[$ids].get(expr.slice(1))]; + } + return searchNode(this, container, expr, true, true); + } + *[$toPages]() { + if (!this.subform.children.length) { + return HTMLResult.success({ + name: "div", + children: [] + }); + } + this[$extra] = { + overflowNode: null, + firstUnsplittable: null, + currentContentArea: null, + currentPageArea: null, + noLayoutFailure: false, + pageNumber: 1, + pagePosition: "first", + oddOrEven: "odd", + blankOrNotBlank: "nonBlank", + paraStack: [] + }; + const root = this.subform.children[0]; + root.pageSet[$cleanPage](); + const pageAreas = root.pageSet.pageArea.children; + const mainHtml = { + name: "div", + children: [] + }; + let pageArea = null; + let breakBefore = null; + let breakBeforeTarget = null; + if (root.breakBefore.children.length >= 1) { + breakBefore = root.breakBefore.children[0]; + breakBeforeTarget = breakBefore.target; + } else if (root.subform.children.length >= 1 && root.subform.children[0].breakBefore.children.length >= 1) { + breakBefore = root.subform.children[0].breakBefore.children[0]; + breakBeforeTarget = breakBefore.target; + } else if (root.break?.beforeTarget) { + breakBefore = root.break; + breakBeforeTarget = breakBefore.beforeTarget; + } else if (root.subform.children.length >= 1 && root.subform.children[0].break?.beforeTarget) { + breakBefore = root.subform.children[0].break; + breakBeforeTarget = breakBefore.beforeTarget; + } + if (breakBefore) { + const target = this[$searchNode](breakBeforeTarget, breakBefore[$getParent]()); + if (target instanceof PageArea) { + pageArea = target; + breakBefore[$extra] = {}; + } + } + if (!pageArea) { + pageArea = pageAreas[0]; + } + pageArea[$extra] = { + numberOfUse: 1 + }; + const pageAreaParent = pageArea[$getParent](); + pageAreaParent[$extra] = { + numberOfUse: 1, + pageIndex: pageAreaParent.pageArea.children.indexOf(pageArea), + pageSetIndex: 0 + }; + let targetPageArea; + let leader = null; + let trailer = null; + let hasSomething = true; + let hasSomethingCounter = 0; + let startIndex = 0; + while (true) { + if (!hasSomething) { + mainHtml.children.pop(); + if (++hasSomethingCounter === MAX_EMPTY_PAGES) { + warn("XFA - Something goes wrong: please file a bug."); + return mainHtml; + } + } else { + hasSomethingCounter = 0; + } + targetPageArea = null; + this[$extra].currentPageArea = pageArea; + const page = pageArea[$toHTML]().html; + mainHtml.children.push(page); + if (leader) { + this[$extra].noLayoutFailure = true; + page.children.push(leader[$toHTML](pageArea[$extra].space).html); + leader = null; + } + if (trailer) { + this[$extra].noLayoutFailure = true; + page.children.push(trailer[$toHTML](pageArea[$extra].space).html); + trailer = null; + } + const contentAreas = pageArea.contentArea.children; + const htmlContentAreas = page.children.filter(node => node.attributes.class.includes("xfaContentarea")); + hasSomething = false; + this[$extra].firstUnsplittable = null; + this[$extra].noLayoutFailure = false; + const flush = index => { + const html = root[$flushHTML](); + if (html) { + hasSomething ||= html.children?.length > 0; + htmlContentAreas[index].children.push(html); + } + }; + for (let i = startIndex, ii = contentAreas.length; i < ii; i++) { + const contentArea = this[$extra].currentContentArea = contentAreas[i]; + const space = { + width: contentArea.w, + height: contentArea.h + }; + startIndex = 0; + if (leader) { + htmlContentAreas[i].children.push(leader[$toHTML](space).html); + leader = null; + } + if (trailer) { + htmlContentAreas[i].children.push(trailer[$toHTML](space).html); + trailer = null; + } + const html = root[$toHTML](space); + if (html.success) { + if (html.html) { + hasSomething ||= html.html.children?.length > 0; + htmlContentAreas[i].children.push(html.html); + } else if (!hasSomething && mainHtml.children.length > 1) { + mainHtml.children.pop(); + } + return mainHtml; + } + if (html.isBreak()) { + const node = html.breakNode; + flush(i); + if (node.targetType === "auto") { + continue; + } + if (node.leader) { + leader = this[$searchNode](node.leader, node[$getParent]()); + leader = leader ? leader[0] : null; + } + if (node.trailer) { + trailer = this[$searchNode](node.trailer, node[$getParent]()); + trailer = trailer ? trailer[0] : null; + } + if (node.targetType === "pageArea") { + targetPageArea = node[$extra].target; + i = Infinity; + } else if (!node[$extra].target) { + i = node[$extra].index; + } else { + targetPageArea = node[$extra].target; + startIndex = node[$extra].index + 1; + i = Infinity; + } + continue; + } + if (this[$extra].overflowNode) { + const node = this[$extra].overflowNode; + this[$extra].overflowNode = null; + const overflowExtra = node[$getExtra](); + const target = overflowExtra.target; + overflowExtra.addLeader = overflowExtra.leader !== null; + overflowExtra.addTrailer = overflowExtra.trailer !== null; + flush(i); + const currentIndex = i; + i = Infinity; + if (target instanceof PageArea) { + targetPageArea = target; + } else if (target instanceof ContentArea) { + const index = contentAreas.indexOf(target); + if (index !== -1) { + if (index > currentIndex) { + i = index - 1; + } else { + startIndex = index; + } + } else { + targetPageArea = target[$getParent](); + startIndex = targetPageArea.contentArea.children.indexOf(target); + } + } + continue; + } + flush(i); + } + this[$extra].pageNumber += 1; + if (targetPageArea) { + if (targetPageArea[$isUsable]()) { + targetPageArea[$extra].numberOfUse += 1; + } else { + targetPageArea = null; + } + } + pageArea = targetPageArea || pageArea[$getNextPage](); + yield null; + } + } +} +class Text extends ContentObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "text"); + this.id = attributes.id || ""; + this.maxChars = getInteger({ + data: attributes.maxChars, + defaultValue: 0, + validate: x => x >= 0 + }); + this.name = attributes.name || ""; + this.rid = attributes.rid || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$acceptWhitespace]() { + return true; + } + [$onChild](child) { + if (child[$namespaceId] === NamespaceIds.xhtml.id) { + this[$content] = child; + return true; + } + warn(`XFA - Invalid content in Text: ${child[$nodeName]}.`); + return false; + } + [$onText](str) { + if (this[$content] instanceof XFAObject) { + return; + } + super[$onText](str); + } + [$finalize]() { + if (typeof this[$content] === "string") { + this[$content] = this[$content].replaceAll("\r\n", "\n"); + } + } + [$getExtra]() { + if (typeof this[$content] === "string") { + return this[$content].split(/[\u2029\u2028\n]/).reduce((acc, line) => { + if (line) { + acc.push(line); + } + return acc; + }, []).join("\n"); + } + return this[$content][$text](); + } + [$toHTML](availableSpace) { + if (typeof this[$content] === "string") { + const html = valueToHtml(this[$content]).html; + if (this[$content].includes("\u2029")) { + html.name = "div"; + html.children = []; + this[$content].split("\u2029").map(para => para.split(/[\u2028\n]/).reduce((acc, line) => { + acc.push({ + name: "span", + value: line + }, { + name: "br" + }); + return acc; + }, [])).forEach(lines => { + html.children.push({ + name: "p", + children: lines + }); + }); + } else if (/[\u2028\n]/.test(this[$content])) { + html.name = "div"; + html.children = []; + this[$content].split(/[\u2028\n]/).forEach(line => { + html.children.push({ + name: "span", + value: line + }, { + name: "br" + }); + }); + } + return HTMLResult.success(html); + } + return this[$content][$toHTML](availableSpace); + } +} +class TextEdit extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "textEdit", true); + this.allowRichText = getInteger({ + data: attributes.allowRichText, + defaultValue: 0, + validate: x => x === 1 + }); + this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, ["auto", "off", "on"]); + this.id = attributes.id || ""; + this.multiLine = getInteger({ + data: attributes.multiLine, + defaultValue: "", + validate: x => x === 0 || x === 1 + }); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.vScrollPolicy = getStringOption(attributes.vScrollPolicy, ["auto", "off", "on"]); + this.border = null; + this.comb = null; + this.extras = null; + this.margin = null; + } + [$toHTML](availableSpace) { + const style = toStyle(this, "border", "font", "margin"); + let html; + const field = this[$getParent]()[$getParent](); + if (this.multiLine === "") { + this.multiLine = field instanceof Draw ? 1 : 0; + } + if (this.multiLine === 1) { + html = { + name: "textarea", + attributes: { + dataId: field[$data]?.[$uid] || field[$uid], + fieldId: field[$uid], + class: ["xfaTextfield"], + style, + "aria-label": ariaLabel(field), + "aria-required": false + } + }; + } else { + html = { + name: "input", + attributes: { + type: "text", + dataId: field[$data]?.[$uid] || field[$uid], + fieldId: field[$uid], + class: ["xfaTextfield"], + style, + "aria-label": ariaLabel(field), + "aria-required": false + } + }; + } + if (isRequired(field)) { + html.attributes["aria-required"] = true; + html.attributes.required = true; + } + return HTMLResult.success({ + name: "label", + attributes: { + class: ["xfaLabel"] + }, + children: [html] + }); + } +} +class Time extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "time"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } + [$finalize]() { + const date = this[$content].trim(); + this[$content] = date ? new Date(date) : null; + } + [$toHTML](availableSpace) { + return valueToHtml(this[$content] ? this[$content].toString() : ""); + } +} +class TimeStamp extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "timeStamp"); + this.id = attributes.id || ""; + this.server = attributes.server || ""; + this.type = getStringOption(attributes.type, ["optional", "required"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class ToolTip extends StringObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "toolTip"); + this.id = attributes.id || ""; + this.rid = attributes.rid || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Traversal extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "traversal", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.traverse = new XFAObjectArray(); + } +} +class Traverse extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "traverse", true); + this.id = attributes.id || ""; + this.operation = getStringOption(attributes.operation, ["next", "back", "down", "first", "left", "right", "up"]); + this.ref = attributes.ref || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.script = null; + } + get name() { + return this.operation; + } + [$isTransparent]() { + return false; + } +} +class Ui extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "ui", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.picture = null; + this.barcode = null; + this.button = null; + this.checkButton = null; + this.choiceList = null; + this.dateTimeEdit = null; + this.defaultUi = null; + this.imageEdit = null; + this.numericEdit = null; + this.passwordEdit = null; + this.signature = null; + this.textEdit = null; + } + [$getExtra]() { + if (this[$extra] === undefined) { + for (const name of Object.getOwnPropertyNames(this)) { + if (name === "extras" || name === "picture") { + continue; + } + const obj = this[name]; + if (!(obj instanceof XFAObject)) { + continue; + } + this[$extra] = obj; + return obj; + } + this[$extra] = null; + } + return this[$extra]; + } + [$toHTML](availableSpace) { + const obj = this[$getExtra](); + if (obj) { + return obj[$toHTML](availableSpace); + } + return HTMLResult.EMPTY; + } +} +class Validate extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "validate", true); + this.formatTest = getStringOption(attributes.formatTest, ["warning", "disabled", "error"]); + this.id = attributes.id || ""; + this.nullTest = getStringOption(attributes.nullTest, ["disabled", "error", "warning"]); + this.scriptTest = getStringOption(attributes.scriptTest, ["error", "disabled", "warning"]); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.extras = null; + this.message = null; + this.picture = null; + this.script = null; + } +} +class Value extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "value", true); + this.id = attributes.id || ""; + this.override = getInteger({ + data: attributes.override, + defaultValue: 0, + validate: x => x === 1 + }); + this.relevant = getRelevant(attributes.relevant); + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.arc = null; + this.boolean = null; + this.date = null; + this.dateTime = null; + this.decimal = null; + this.exData = null; + this.float = null; + this.image = null; + this.integer = null; + this.line = null; + this.rectangle = null; + this.text = null; + this.time = null; + } + [$setValue](value) { + const parent = this[$getParent](); + if (parent instanceof Field) { + if (parent.ui?.imageEdit) { + if (!this.image) { + this.image = new Image({}); + this[$appendChild](this.image); + } + this.image[$content] = value[$content]; + return; + } + } + const valueName = value[$nodeName]; + if (this[valueName] !== null) { + this[valueName][$content] = value[$content]; + return; + } + for (const name of Object.getOwnPropertyNames(this)) { + const obj = this[name]; + if (obj instanceof XFAObject) { + this[name] = null; + this[$removeChild](obj); + } + } + this[value[$nodeName]] = value; + this[$appendChild](value); + } + [$text]() { + if (this.exData) { + if (typeof this.exData[$content] === "string") { + return this.exData[$content].trim(); + } + return this.exData[$content][$text]().trim(); + } + for (const name of Object.getOwnPropertyNames(this)) { + if (name === "image") { + continue; + } + const obj = this[name]; + if (obj instanceof XFAObject) { + return (obj[$content] || "").toString().trim(); + } + } + return null; + } + [$toHTML](availableSpace) { + for (const name of Object.getOwnPropertyNames(this)) { + const obj = this[name]; + if (!(obj instanceof XFAObject)) { + continue; + } + return obj[$toHTML](availableSpace); + } + return HTMLResult.EMPTY; + } +} +class Variables extends XFAObject { + constructor(attributes) { + super(TEMPLATE_NS_ID, "variables", true); + this.id = attributes.id || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + this.boolean = new XFAObjectArray(); + this.date = new XFAObjectArray(); + this.dateTime = new XFAObjectArray(); + this.decimal = new XFAObjectArray(); + this.exData = new XFAObjectArray(); + this.float = new XFAObjectArray(); + this.image = new XFAObjectArray(); + this.integer = new XFAObjectArray(); + this.manifest = new XFAObjectArray(); + this.script = new XFAObjectArray(); + this.text = new XFAObjectArray(); + this.time = new XFAObjectArray(); + } + [$isTransparent]() { + return true; + } +} +class TemplateNamespace { + static [$buildXFAObject](name, attributes) { + if (TemplateNamespace.hasOwnProperty(name)) { + const node = TemplateNamespace[name](attributes); + node[$setSetAttributes](attributes); + return node; + } + return undefined; + } + static appearanceFilter(attrs) { + return new AppearanceFilter(attrs); + } + static arc(attrs) { + return new Arc(attrs); + } + static area(attrs) { + return new Area(attrs); + } + static assist(attrs) { + return new Assist(attrs); + } + static barcode(attrs) { + return new Barcode(attrs); + } + static bind(attrs) { + return new Bind(attrs); + } + static bindItems(attrs) { + return new BindItems(attrs); + } + static bookend(attrs) { + return new Bookend(attrs); + } + static boolean(attrs) { + return new BooleanElement(attrs); + } + static border(attrs) { + return new Border(attrs); + } + static break(attrs) { + return new Break(attrs); + } + static breakAfter(attrs) { + return new BreakAfter(attrs); + } + static breakBefore(attrs) { + return new BreakBefore(attrs); + } + static button(attrs) { + return new Button(attrs); + } + static calculate(attrs) { + return new Calculate(attrs); + } + static caption(attrs) { + return new Caption(attrs); + } + static certificate(attrs) { + return new Certificate(attrs); + } + static certificates(attrs) { + return new Certificates(attrs); + } + static checkButton(attrs) { + return new CheckButton(attrs); + } + static choiceList(attrs) { + return new ChoiceList(attrs); + } + static color(attrs) { + return new Color(attrs); + } + static comb(attrs) { + return new Comb(attrs); + } + static connect(attrs) { + return new Connect(attrs); + } + static contentArea(attrs) { + return new ContentArea(attrs); + } + static corner(attrs) { + return new Corner(attrs); + } + static date(attrs) { + return new DateElement(attrs); + } + static dateTime(attrs) { + return new DateTime(attrs); + } + static dateTimeEdit(attrs) { + return new DateTimeEdit(attrs); + } + static decimal(attrs) { + return new Decimal(attrs); + } + static defaultUi(attrs) { + return new DefaultUi(attrs); + } + static desc(attrs) { + return new Desc(attrs); + } + static digestMethod(attrs) { + return new DigestMethod(attrs); + } + static digestMethods(attrs) { + return new DigestMethods(attrs); + } + static draw(attrs) { + return new Draw(attrs); + } + static edge(attrs) { + return new Edge(attrs); + } + static encoding(attrs) { + return new Encoding(attrs); + } + static encodings(attrs) { + return new Encodings(attrs); + } + static encrypt(attrs) { + return new Encrypt(attrs); + } + static encryptData(attrs) { + return new EncryptData(attrs); + } + static encryption(attrs) { + return new Encryption(attrs); + } + static encryptionMethod(attrs) { + return new EncryptionMethod(attrs); + } + static encryptionMethods(attrs) { + return new EncryptionMethods(attrs); + } + static event(attrs) { + return new Event(attrs); + } + static exData(attrs) { + return new ExData(attrs); + } + static exObject(attrs) { + return new ExObject(attrs); + } + static exclGroup(attrs) { + return new ExclGroup(attrs); + } + static execute(attrs) { + return new Execute(attrs); + } + static extras(attrs) { + return new Extras(attrs); + } + static field(attrs) { + return new Field(attrs); + } + static fill(attrs) { + return new Fill(attrs); + } + static filter(attrs) { + return new Filter(attrs); + } + static float(attrs) { + return new Float(attrs); + } + static font(attrs) { + return new template_Font(attrs); + } + static format(attrs) { + return new Format(attrs); + } + static handler(attrs) { + return new Handler(attrs); + } + static hyphenation(attrs) { + return new Hyphenation(attrs); + } + static image(attrs) { + return new Image(attrs); + } + static imageEdit(attrs) { + return new ImageEdit(attrs); + } + static integer(attrs) { + return new Integer(attrs); + } + static issuers(attrs) { + return new Issuers(attrs); + } + static items(attrs) { + return new Items(attrs); + } + static keep(attrs) { + return new Keep(attrs); + } + static keyUsage(attrs) { + return new KeyUsage(attrs); + } + static line(attrs) { + return new Line(attrs); + } + static linear(attrs) { + return new Linear(attrs); + } + static lockDocument(attrs) { + return new LockDocument(attrs); + } + static manifest(attrs) { + return new Manifest(attrs); + } + static margin(attrs) { + return new Margin(attrs); + } + static mdp(attrs) { + return new Mdp(attrs); + } + static medium(attrs) { + return new Medium(attrs); + } + static message(attrs) { + return new Message(attrs); + } + static numericEdit(attrs) { + return new NumericEdit(attrs); + } + static occur(attrs) { + return new Occur(attrs); + } + static oid(attrs) { + return new Oid(attrs); + } + static oids(attrs) { + return new Oids(attrs); + } + static overflow(attrs) { + return new Overflow(attrs); + } + static pageArea(attrs) { + return new PageArea(attrs); + } + static pageSet(attrs) { + return new PageSet(attrs); + } + static para(attrs) { + return new Para(attrs); + } + static passwordEdit(attrs) { + return new PasswordEdit(attrs); + } + static pattern(attrs) { + return new template_Pattern(attrs); + } + static picture(attrs) { + return new Picture(attrs); + } + static proto(attrs) { + return new Proto(attrs); + } + static radial(attrs) { + return new Radial(attrs); + } + static reason(attrs) { + return new Reason(attrs); + } + static reasons(attrs) { + return new Reasons(attrs); + } + static rectangle(attrs) { + return new Rectangle(attrs); + } + static ref(attrs) { + return new RefElement(attrs); + } + static script(attrs) { + return new Script(attrs); + } + static setProperty(attrs) { + return new SetProperty(attrs); + } + static signData(attrs) { + return new SignData(attrs); + } + static signature(attrs) { + return new Signature(attrs); + } + static signing(attrs) { + return new Signing(attrs); + } + static solid(attrs) { + return new Solid(attrs); + } + static speak(attrs) { + return new Speak(attrs); + } + static stipple(attrs) { + return new Stipple(attrs); + } + static subform(attrs) { + return new Subform(attrs); + } + static subformSet(attrs) { + return new SubformSet(attrs); + } + static subjectDN(attrs) { + return new SubjectDN(attrs); + } + static subjectDNs(attrs) { + return new SubjectDNs(attrs); + } + static submit(attrs) { + return new Submit(attrs); + } + static template(attrs) { + return new Template(attrs); + } + static text(attrs) { + return new Text(attrs); + } + static textEdit(attrs) { + return new TextEdit(attrs); + } + static time(attrs) { + return new Time(attrs); + } + static timeStamp(attrs) { + return new TimeStamp(attrs); + } + static toolTip(attrs) { + return new ToolTip(attrs); + } + static traversal(attrs) { + return new Traversal(attrs); + } + static traverse(attrs) { + return new Traverse(attrs); + } + static ui(attrs) { + return new Ui(attrs); + } + static validate(attrs) { + return new Validate(attrs); + } + static value(attrs) { + return new Value(attrs); + } + static variables(attrs) { + return new Variables(attrs); + } +} + +;// CONCATENATED MODULE: ./src/core/xfa/bind.js + + + + + + +const bind_NS_DATASETS = NamespaceIds.datasets.id; +function createText(content) { + const node = new Text({}); + node[$content] = content; + return node; +} +class Binder { + constructor(root) { + this.root = root; + this.datasets = root.datasets; + this.data = root.datasets?.data || new XmlObject(NamespaceIds.datasets.id, "data"); + this.emptyMerge = this.data[$getChildren]().length === 0; + this.root.form = this.form = root.template[$clone](); + } + _isConsumeData() { + return !this.emptyMerge && this._mergeMode; + } + _isMatchTemplate() { + return !this._isConsumeData(); + } + bind() { + this._bindElement(this.form, this.data); + return this.form; + } + getData() { + return this.data; + } + _bindValue(formNode, data, picture) { + formNode[$data] = data; + if (formNode[$hasSettableValue]()) { + if (data[$isDataValue]()) { + const value = data[$getDataValue](); + formNode[$setValue](createText(value)); + } else if (formNode instanceof Field && formNode.ui?.choiceList?.open === "multiSelect") { + const value = data[$getChildren]().map(child => child[$content].trim()).join("\n"); + formNode[$setValue](createText(value)); + } else if (this._isConsumeData()) { + warn(`XFA - Nodes haven't the same type.`); + } + } else if (!data[$isDataValue]() || this._isMatchTemplate()) { + this._bindElement(formNode, data); + } else { + warn(`XFA - Nodes haven't the same type.`); + } + } + _findDataByNameToConsume(name, isValue, dataNode, global) { + if (!name) { + return null; + } + let generator, match; + for (let i = 0; i < 3; i++) { + generator = dataNode[$getRealChildrenByNameIt](name, false, true); + while (true) { + match = generator.next().value; + if (!match) { + break; + } + if (isValue === match[$isDataValue]()) { + return match; + } + } + if (dataNode[$namespaceId] === NamespaceIds.datasets.id && dataNode[$nodeName] === "data") { + break; + } + dataNode = dataNode[$getParent](); + } + if (!global) { + return null; + } + generator = this.data[$getRealChildrenByNameIt](name, true, false); + match = generator.next().value; + if (match) { + return match; + } + generator = this.data[$getAttributeIt](name, true); + match = generator.next().value; + if (match?.[$isDataValue]()) { + return match; + } + return null; + } + _setProperties(formNode, dataNode) { + if (!formNode.hasOwnProperty("setProperty")) { + return; + } + for (const { + ref, + target, + connection + } of formNode.setProperty.children) { + if (connection) { + continue; + } + if (!ref) { + continue; + } + const nodes = searchNode(this.root, dataNode, ref, false, false); + if (!nodes) { + warn(`XFA - Invalid reference: ${ref}.`); + continue; + } + const [node] = nodes; + if (!node[$isDescendent](this.data)) { + warn(`XFA - Invalid node: must be a data node.`); + continue; + } + const targetNodes = searchNode(this.root, formNode, target, false, false); + if (!targetNodes) { + warn(`XFA - Invalid target: ${target}.`); + continue; + } + const [targetNode] = targetNodes; + if (!targetNode[$isDescendent](formNode)) { + warn(`XFA - Invalid target: must be a property or subproperty.`); + continue; + } + const targetParent = targetNode[$getParent](); + if (targetNode instanceof SetProperty || targetParent instanceof SetProperty) { + warn(`XFA - Invalid target: cannot be a setProperty or one of its properties.`); + continue; + } + if (targetNode instanceof BindItems || targetParent instanceof BindItems) { + warn(`XFA - Invalid target: cannot be a bindItems or one of its properties.`); + continue; + } + const content = node[$text](); + const name = targetNode[$nodeName]; + if (targetNode instanceof XFAAttribute) { + const attrs = Object.create(null); + attrs[name] = content; + const obj = Reflect.construct(Object.getPrototypeOf(targetParent).constructor, [attrs]); + targetParent[name] = obj[name]; + continue; + } + if (!targetNode.hasOwnProperty($content)) { + warn(`XFA - Invalid node to use in setProperty`); + continue; + } + targetNode[$data] = node; + targetNode[$content] = content; + targetNode[$finalize](); + } + } + _bindItems(formNode, dataNode) { + if (!formNode.hasOwnProperty("items") || !formNode.hasOwnProperty("bindItems") || formNode.bindItems.isEmpty()) { + return; + } + for (const item of formNode.items.children) { + formNode[$removeChild](item); + } + formNode.items.clear(); + const labels = new Items({}); + const values = new Items({}); + formNode[$appendChild](labels); + formNode.items.push(labels); + formNode[$appendChild](values); + formNode.items.push(values); + for (const { + ref, + labelRef, + valueRef, + connection + } of formNode.bindItems.children) { + if (connection) { + continue; + } + if (!ref) { + continue; + } + const nodes = searchNode(this.root, dataNode, ref, false, false); + if (!nodes) { + warn(`XFA - Invalid reference: ${ref}.`); + continue; + } + for (const node of nodes) { + if (!node[$isDescendent](this.datasets)) { + warn(`XFA - Invalid ref (${ref}): must be a datasets child.`); + continue; + } + const labelNodes = searchNode(this.root, node, labelRef, true, false); + if (!labelNodes) { + warn(`XFA - Invalid label: ${labelRef}.`); + continue; + } + const [labelNode] = labelNodes; + if (!labelNode[$isDescendent](this.datasets)) { + warn(`XFA - Invalid label: must be a datasets child.`); + continue; + } + const valueNodes = searchNode(this.root, node, valueRef, true, false); + if (!valueNodes) { + warn(`XFA - Invalid value: ${valueRef}.`); + continue; + } + const [valueNode] = valueNodes; + if (!valueNode[$isDescendent](this.datasets)) { + warn(`XFA - Invalid value: must be a datasets child.`); + continue; + } + const label = createText(labelNode[$text]()); + const value = createText(valueNode[$text]()); + labels[$appendChild](label); + labels.text.push(label); + values[$appendChild](value); + values.text.push(value); + } + } + } + _bindOccurrences(formNode, matches, picture) { + let baseClone; + if (matches.length > 1) { + baseClone = formNode[$clone](); + baseClone[$removeChild](baseClone.occur); + baseClone.occur = null; + } + this._bindValue(formNode, matches[0], picture); + this._setProperties(formNode, matches[0]); + this._bindItems(formNode, matches[0]); + if (matches.length === 1) { + return; + } + const parent = formNode[$getParent](); + const name = formNode[$nodeName]; + const pos = parent[$indexOf](formNode); + for (let i = 1, ii = matches.length; i < ii; i++) { + const match = matches[i]; + const clone = baseClone[$clone](); + parent[name].push(clone); + parent[$insertAt](pos + i, clone); + this._bindValue(clone, match, picture); + this._setProperties(clone, match); + this._bindItems(clone, match); + } + } + _createOccurrences(formNode) { + if (!this.emptyMerge) { + return; + } + const { + occur + } = formNode; + if (!occur || occur.initial <= 1) { + return; + } + const parent = formNode[$getParent](); + const name = formNode[$nodeName]; + if (!(parent[name] instanceof XFAObjectArray)) { + return; + } + let currentNumber; + if (formNode.name) { + currentNumber = parent[name].children.filter(e => e.name === formNode.name).length; + } else { + currentNumber = parent[name].children.length; + } + const pos = parent[$indexOf](formNode) + 1; + const ii = occur.initial - currentNumber; + if (ii) { + const nodeClone = formNode[$clone](); + nodeClone[$removeChild](nodeClone.occur); + nodeClone.occur = null; + parent[name].push(nodeClone); + parent[$insertAt](pos, nodeClone); + for (let i = 1; i < ii; i++) { + const clone = nodeClone[$clone](); + parent[name].push(clone); + parent[$insertAt](pos + i, clone); + } + } + } + _getOccurInfo(formNode) { + const { + name, + occur + } = formNode; + if (!occur || !name) { + return [1, 1]; + } + const max = occur.max === -1 ? Infinity : occur.max; + return [occur.min, max]; + } + _setAndBind(formNode, dataNode) { + this._setProperties(formNode, dataNode); + this._bindItems(formNode, dataNode); + this._bindElement(formNode, dataNode); + } + _bindElement(formNode, dataNode) { + const uselessNodes = []; + this._createOccurrences(formNode); + for (const child of formNode[$getChildren]()) { + if (child[$data]) { + continue; + } + if (this._mergeMode === undefined && child[$nodeName] === "subform") { + this._mergeMode = child.mergeMode === "consumeData"; + const dataChildren = dataNode[$getChildren](); + if (dataChildren.length > 0) { + this._bindOccurrences(child, [dataChildren[0]], null); + } else if (this.emptyMerge) { + const nsId = dataNode[$namespaceId] === bind_NS_DATASETS ? -1 : dataNode[$namespaceId]; + const dataChild = child[$data] = new XmlObject(nsId, child.name || "root"); + dataNode[$appendChild](dataChild); + this._bindElement(child, dataChild); + } + continue; + } + if (!child[$isBindable]()) { + continue; + } + let global = false; + let picture = null; + let ref = null; + let match = null; + if (child.bind) { + switch (child.bind.match) { + case "none": + this._setAndBind(child, dataNode); + continue; + case "global": + global = true; + break; + case "dataRef": + if (!child.bind.ref) { + warn(`XFA - ref is empty in node ${child[$nodeName]}.`); + this._setAndBind(child, dataNode); + continue; + } + ref = child.bind.ref; + break; + default: + break; + } + if (child.bind.picture) { + picture = child.bind.picture[$content]; + } + } + const [min, max] = this._getOccurInfo(child); + if (ref) { + match = searchNode(this.root, dataNode, ref, true, false); + if (match === null) { + match = createDataNode(this.data, dataNode, ref); + if (!match) { + continue; + } + if (this._isConsumeData()) { + match[$consumed] = true; + } + this._setAndBind(child, match); + continue; + } else { + if (this._isConsumeData()) { + match = match.filter(node => !node[$consumed]); + } + if (match.length > max) { + match = match.slice(0, max); + } else if (match.length === 0) { + match = null; + } + if (match && this._isConsumeData()) { + match.forEach(node => { + node[$consumed] = true; + }); + } + } + } else { + if (!child.name) { + this._setAndBind(child, dataNode); + continue; + } + if (this._isConsumeData()) { + const matches = []; + while (matches.length < max) { + const found = this._findDataByNameToConsume(child.name, child[$hasSettableValue](), dataNode, global); + if (!found) { + break; + } + found[$consumed] = true; + matches.push(found); + } + match = matches.length > 0 ? matches : null; + } else { + match = dataNode[$getRealChildrenByNameIt](child.name, false, this.emptyMerge).next().value; + if (!match) { + if (min === 0) { + uselessNodes.push(child); + continue; + } + const nsId = dataNode[$namespaceId] === bind_NS_DATASETS ? -1 : dataNode[$namespaceId]; + match = child[$data] = new XmlObject(nsId, child.name); + if (this.emptyMerge) { + match[$consumed] = true; + } + dataNode[$appendChild](match); + this._setAndBind(child, match); + continue; + } + if (this.emptyMerge) { + match[$consumed] = true; + } + match = [match]; + } + } + if (match) { + this._bindOccurrences(child, match, picture); + } else if (min > 0) { + this._setAndBind(child, dataNode); + } else { + uselessNodes.push(child); + } + } + uselessNodes.forEach(node => node[$getParent]()[$removeChild](node)); + } +} + +;// CONCATENATED MODULE: ./src/core/xfa/data.js + +class DataHandler { + constructor(root, data) { + this.data = data; + this.dataset = root.datasets || null; + } + serialize(storage) { + const stack = [[-1, this.data[$getChildren]()]]; + while (stack.length > 0) { + const last = stack.at(-1); + const [i, children] = last; + if (i + 1 === children.length) { + stack.pop(); + continue; + } + const child = children[++last[0]]; + const storageEntry = storage.get(child[$uid]); + if (storageEntry) { + child[$setValue](storageEntry); + } else { + const attributes = child[$getAttributes](); + for (const value of attributes.values()) { + const entry = storage.get(value[$uid]); + if (entry) { + value[$setValue](entry); + break; + } + } + } + const nodes = child[$getChildren](); + if (nodes.length > 0) { + stack.push([-1, nodes]); + } + } + const buf = [`<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">`]; + if (this.dataset) { + for (const child of this.dataset[$getChildren]()) { + if (child[$nodeName] !== "data") { + child[$toString](buf); + } + } + } + this.data[$toString](buf); + buf.push("</xfa:datasets>"); + return buf.join(""); + } +} + +;// CONCATENATED MODULE: ./src/core/xfa/config.js + + + + + +const CONFIG_NS_ID = NamespaceIds.config.id; +class Acrobat extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "acrobat", true); + this.acrobat7 = null; + this.autoSave = null; + this.common = null; + this.validate = null; + this.validateApprovalSignatures = null; + this.submitUrl = new XFAObjectArray(); + } +} +class Acrobat7 extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "acrobat7", true); + this.dynamicRender = null; + } +} +class ADBE_JSConsole extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "ADBE_JSConsole", ["delegate", "Enable", "Disable"]); + } +} +class ADBE_JSDebugger extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "ADBE_JSDebugger", ["delegate", "Enable", "Disable"]); + } +} +class AddSilentPrint extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "addSilentPrint"); + } +} +class AddViewerPreferences extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "addViewerPreferences"); + } +} +class AdjustData extends Option10 { + constructor(attributes) { + super(CONFIG_NS_ID, "adjustData"); + } +} +class AdobeExtensionLevel extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "adobeExtensionLevel", 0, n => n >= 1 && n <= 8); + } +} +class Agent extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "agent", true); + this.name = attributes.name ? attributes.name.trim() : ""; + this.common = new XFAObjectArray(); + } +} +class AlwaysEmbed extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "alwaysEmbed"); + } +} +class Amd extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "amd"); + } +} +class config_Area extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "area"); + this.level = getInteger({ + data: attributes.level, + defaultValue: 0, + validate: n => n >= 1 && n <= 3 + }); + this.name = getStringOption(attributes.name, ["", "barcode", "coreinit", "deviceDriver", "font", "general", "layout", "merge", "script", "signature", "sourceSet", "templateCache"]); + } +} +class Attributes extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "attributes", ["preserve", "delegate", "ignore"]); + } +} +class AutoSave extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "autoSave", ["disabled", "enabled"]); + } +} +class Base extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "base"); + } +} +class BatchOutput extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "batchOutput"); + this.format = getStringOption(attributes.format, ["none", "concat", "zip", "zipCompress"]); + } +} +class BehaviorOverride extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "behaviorOverride"); + } + [$finalize]() { + this[$content] = new Map(this[$content].trim().split(/\s+/).filter(x => x.includes(":")).map(x => x.split(":", 2))); + } +} +class Cache extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "cache", true); + this.templateCache = null; + } +} +class Change extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "change"); + } +} +class Common extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "common", true); + this.data = null; + this.locale = null; + this.localeSet = null; + this.messaging = null; + this.suppressBanner = null; + this.template = null; + this.validationMessaging = null; + this.versionControl = null; + this.log = new XFAObjectArray(); + } +} +class Compress extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "compress"); + this.scope = getStringOption(attributes.scope, ["imageOnly", "document"]); + } +} +class CompressLogicalStructure extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "compressLogicalStructure"); + } +} +class CompressObjectStream extends Option10 { + constructor(attributes) { + super(CONFIG_NS_ID, "compressObjectStream"); + } +} +class Compression extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "compression", true); + this.compressLogicalStructure = null; + this.compressObjectStream = null; + this.level = null; + this.type = null; + } +} +class Config extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "config", true); + this.acrobat = null; + this.present = null; + this.trace = null; + this.agent = new XFAObjectArray(); + } +} +class Conformance extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "conformance", ["A", "B"]); + } +} +class ContentCopy extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "contentCopy"); + } +} +class Copies extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "copies", 1, n => n >= 1); + } +} +class Creator extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "creator"); + } +} +class CurrentPage extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "currentPage", 0, n => n >= 0); + } +} +class Data extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "data", true); + this.adjustData = null; + this.attributes = null; + this.incrementalLoad = null; + this.outputXSL = null; + this.range = null; + this.record = null; + this.startNode = null; + this.uri = null; + this.window = null; + this.xsl = null; + this.excludeNS = new XFAObjectArray(); + this.transform = new XFAObjectArray(); + } +} +class Debug extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "debug", true); + this.uri = null; + } +} +class DefaultTypeface extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "defaultTypeface"); + this.writingScript = getStringOption(attributes.writingScript, ["*", "Arabic", "Cyrillic", "EastEuropeanRoman", "Greek", "Hebrew", "Japanese", "Korean", "Roman", "SimplifiedChinese", "Thai", "TraditionalChinese", "Vietnamese"]); + } +} +class Destination extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "destination", ["pdf", "pcl", "ps", "webClient", "zpl"]); + } +} +class DocumentAssembly extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "documentAssembly"); + } +} +class Driver extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "driver", true); + this.name = attributes.name ? attributes.name.trim() : ""; + this.fontInfo = null; + this.xdc = null; + } +} +class DuplexOption extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "duplexOption", ["simplex", "duplexFlipLongEdge", "duplexFlipShortEdge"]); + } +} +class DynamicRender extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "dynamicRender", ["forbidden", "required"]); + } +} +class Embed extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "embed"); + } +} +class config_Encrypt extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "encrypt"); + } +} +class config_Encryption extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "encryption", true); + this.encrypt = null; + this.encryptionLevel = null; + this.permissions = null; + } +} +class EncryptionLevel extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "encryptionLevel", ["40bit", "128bit"]); + } +} +class Enforce extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "enforce"); + } +} +class Equate extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "equate"); + this.force = getInteger({ + data: attributes.force, + defaultValue: 1, + validate: n => n === 0 + }); + this.from = attributes.from || ""; + this.to = attributes.to || ""; + } +} +class EquateRange extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "equateRange"); + this.from = attributes.from || ""; + this.to = attributes.to || ""; + this._unicodeRange = attributes.unicodeRange || ""; + } + get unicodeRange() { + const ranges = []; + const unicodeRegex = /U\+([0-9a-fA-F]+)/; + const unicodeRange = this._unicodeRange; + for (let range of unicodeRange.split(",").map(x => x.trim()).filter(x => !!x)) { + range = range.split("-", 2).map(x => { + const found = x.match(unicodeRegex); + if (!found) { + return 0; + } + return parseInt(found[1], 16); + }); + if (range.length === 1) { + range.push(range[0]); + } + ranges.push(range); + } + return shadow(this, "unicodeRange", ranges); + } +} +class Exclude extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "exclude"); + } + [$finalize]() { + this[$content] = this[$content].trim().split(/\s+/).filter(x => x && ["calculate", "close", "enter", "exit", "initialize", "ready", "validate"].includes(x)); + } +} +class ExcludeNS extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "excludeNS"); + } +} +class FlipLabel extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "flipLabel", ["usePrinterSetting", "on", "off"]); + } +} +class config_FontInfo extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "fontInfo", true); + this.embed = null; + this.map = null; + this.subsetBelow = null; + this.alwaysEmbed = new XFAObjectArray(); + this.defaultTypeface = new XFAObjectArray(); + this.neverEmbed = new XFAObjectArray(); + } +} +class FormFieldFilling extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "formFieldFilling"); + } +} +class GroupParent extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "groupParent"); + } +} +class IfEmpty extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "ifEmpty", ["dataValue", "dataGroup", "ignore", "remove"]); + } +} +class IncludeXDPContent extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "includeXDPContent"); + } +} +class IncrementalLoad extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "incrementalLoad", ["none", "forwardOnly"]); + } +} +class IncrementalMerge extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "incrementalMerge"); + } +} +class Interactive extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "interactive"); + } +} +class Jog extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "jog", ["usePrinterSetting", "none", "pageSet"]); + } +} +class LabelPrinter extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "labelPrinter", true); + this.name = getStringOption(attributes.name, ["zpl", "dpl", "ipl", "tcpl"]); + this.batchOutput = null; + this.flipLabel = null; + this.fontInfo = null; + this.xdc = null; + } +} +class Layout extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "layout", ["paginate", "panel"]); + } +} +class Level extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "level", 0, n => n > 0); + } +} +class Linearized extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "linearized"); + } +} +class Locale extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "locale"); + } +} +class LocaleSet extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "localeSet"); + } +} +class Log extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "log", true); + this.mode = null; + this.threshold = null; + this.to = null; + this.uri = null; + } +} +class MapElement extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "map", true); + this.equate = new XFAObjectArray(); + this.equateRange = new XFAObjectArray(); + } +} +class MediumInfo extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "mediumInfo", true); + this.map = null; + } +} +class config_Message extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "message", true); + this.msgId = null; + this.severity = null; + } +} +class Messaging extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "messaging", true); + this.message = new XFAObjectArray(); + } +} +class Mode extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "mode", ["append", "overwrite"]); + } +} +class ModifyAnnots extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "modifyAnnots"); + } +} +class MsgId extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "msgId", 1, n => n >= 1); + } +} +class NameAttr extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "nameAttr"); + } +} +class NeverEmbed extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "neverEmbed"); + } +} +class NumberOfCopies extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "numberOfCopies", null, n => n >= 2 && n <= 5); + } +} +class OpenAction extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "openAction", true); + this.destination = null; + } +} +class Output extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "output", true); + this.to = null; + this.type = null; + this.uri = null; + } +} +class OutputBin extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "outputBin"); + } +} +class OutputXSL extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "outputXSL", true); + this.uri = null; + } +} +class Overprint extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "overprint", ["none", "both", "draw", "field"]); + } +} +class Packets extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "packets"); + } + [$finalize]() { + if (this[$content] === "*") { + return; + } + this[$content] = this[$content].trim().split(/\s+/).filter(x => ["config", "datasets", "template", "xfdf", "xslt"].includes(x)); + } +} +class PageOffset extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "pageOffset"); + this.x = getInteger({ + data: attributes.x, + defaultValue: "useXDCSetting", + validate: n => true + }); + this.y = getInteger({ + data: attributes.y, + defaultValue: "useXDCSetting", + validate: n => true + }); + } +} +class PageRange extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "pageRange"); + } + [$finalize]() { + const numbers = this[$content].trim().split(/\s+/).map(x => parseInt(x, 10)); + const ranges = []; + for (let i = 0, ii = numbers.length; i < ii; i += 2) { + ranges.push(numbers.slice(i, i + 2)); + } + this[$content] = ranges; + } +} +class Pagination extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "pagination", ["simplex", "duplexShortEdge", "duplexLongEdge"]); + } +} +class PaginationOverride extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "paginationOverride", ["none", "forceDuplex", "forceDuplexLongEdge", "forceDuplexShortEdge", "forceSimplex"]); + } +} +class Part extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "part", 1, n => false); + } +} +class Pcl extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "pcl", true); + this.name = attributes.name || ""; + this.batchOutput = null; + this.fontInfo = null; + this.jog = null; + this.mediumInfo = null; + this.outputBin = null; + this.pageOffset = null; + this.staple = null; + this.xdc = null; + } +} +class Pdf extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "pdf", true); + this.name = attributes.name || ""; + this.adobeExtensionLevel = null; + this.batchOutput = null; + this.compression = null; + this.creator = null; + this.encryption = null; + this.fontInfo = null; + this.interactive = null; + this.linearized = null; + this.openAction = null; + this.pdfa = null; + this.producer = null; + this.renderPolicy = null; + this.scriptModel = null; + this.silentPrint = null; + this.submitFormat = null; + this.tagged = null; + this.version = null; + this.viewerPreferences = null; + this.xdc = null; + } +} +class Pdfa extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "pdfa", true); + this.amd = null; + this.conformance = null; + this.includeXDPContent = null; + this.part = null; + } +} +class Permissions extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "permissions", true); + this.accessibleContent = null; + this.change = null; + this.contentCopy = null; + this.documentAssembly = null; + this.formFieldFilling = null; + this.modifyAnnots = null; + this.plaintextMetadata = null; + this.print = null; + this.printHighQuality = null; + } +} +class PickTrayByPDFSize extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "pickTrayByPDFSize"); + } +} +class config_Picture extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "picture"); + } +} +class PlaintextMetadata extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "plaintextMetadata"); + } +} +class Presence extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "presence", ["preserve", "dissolve", "dissolveStructure", "ignore", "remove"]); + } +} +class Present extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "present", true); + this.behaviorOverride = null; + this.cache = null; + this.common = null; + this.copies = null; + this.destination = null; + this.incrementalMerge = null; + this.layout = null; + this.output = null; + this.overprint = null; + this.pagination = null; + this.paginationOverride = null; + this.script = null; + this.validate = null; + this.xdp = null; + this.driver = new XFAObjectArray(); + this.labelPrinter = new XFAObjectArray(); + this.pcl = new XFAObjectArray(); + this.pdf = new XFAObjectArray(); + this.ps = new XFAObjectArray(); + this.submitUrl = new XFAObjectArray(); + this.webClient = new XFAObjectArray(); + this.zpl = new XFAObjectArray(); + } +} +class Print extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "print"); + } +} +class PrintHighQuality extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "printHighQuality"); + } +} +class PrintScaling extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "printScaling", ["appdefault", "noScaling"]); + } +} +class PrinterName extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "printerName"); + } +} +class Producer extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "producer"); + } +} +class Ps extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "ps", true); + this.name = attributes.name || ""; + this.batchOutput = null; + this.fontInfo = null; + this.jog = null; + this.mediumInfo = null; + this.outputBin = null; + this.staple = null; + this.xdc = null; + } +} +class Range extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "range"); + } + [$finalize]() { + this[$content] = this[$content].trim().split(/\s*,\s*/, 2).map(range => range.split("-").map(x => parseInt(x.trim(), 10))).filter(range => range.every(x => !isNaN(x))).map(range => { + if (range.length === 1) { + range.push(range[0]); + } + return range; + }); + } +} +class Record extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "record"); + } + [$finalize]() { + this[$content] = this[$content].trim(); + const n = parseInt(this[$content], 10); + if (!isNaN(n) && n >= 0) { + this[$content] = n; + } + } +} +class Relevant extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "relevant"); + } + [$finalize]() { + this[$content] = this[$content].trim().split(/\s+/); + } +} +class Rename extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "rename"); + } + [$finalize]() { + this[$content] = this[$content].trim(); + if (this[$content].toLowerCase().startsWith("xml") || new RegExp("[\\p{L}_][\\p{L}\\d._\\p{M}-]*", "u").test(this[$content])) { + warn("XFA - Rename: invalid XFA name"); + } + } +} +class RenderPolicy extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "renderPolicy", ["server", "client"]); + } +} +class RunScripts extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "runScripts", ["both", "client", "none", "server"]); + } +} +class config_Script extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "script", true); + this.currentPage = null; + this.exclude = null; + this.runScripts = null; + } +} +class ScriptModel extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "scriptModel", ["XFA", "none"]); + } +} +class Severity extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "severity", ["ignore", "error", "information", "trace", "warning"]); + } +} +class SilentPrint extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "silentPrint", true); + this.addSilentPrint = null; + this.printerName = null; + } +} +class Staple extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "staple"); + this.mode = getStringOption(attributes.mode, ["usePrinterSetting", "on", "off"]); + } +} +class StartNode extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "startNode"); + } +} +class StartPage extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "startPage", 0, n => true); + } +} +class SubmitFormat extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "submitFormat", ["html", "delegate", "fdf", "xml", "pdf"]); + } +} +class SubmitUrl extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "submitUrl"); + } +} +class SubsetBelow extends IntegerObject { + constructor(attributes) { + super(CONFIG_NS_ID, "subsetBelow", 100, n => n >= 0 && n <= 100); + } +} +class SuppressBanner extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "suppressBanner"); + } +} +class Tagged extends Option01 { + constructor(attributes) { + super(CONFIG_NS_ID, "tagged"); + } +} +class config_Template extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "template", true); + this.base = null; + this.relevant = null; + this.startPage = null; + this.uri = null; + this.xsl = null; + } +} +class Threshold extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "threshold", ["trace", "error", "information", "warning"]); + } +} +class To extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "to", ["null", "memory", "stderr", "stdout", "system", "uri"]); + } +} +class TemplateCache extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "templateCache"); + this.maxEntries = getInteger({ + data: attributes.maxEntries, + defaultValue: 5, + validate: n => n >= 0 + }); + } +} +class Trace extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "trace", true); + this.area = new XFAObjectArray(); + } +} +class config_Transform extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "transform", true); + this.groupParent = null; + this.ifEmpty = null; + this.nameAttr = null; + this.picture = null; + this.presence = null; + this.rename = null; + this.whitespace = null; + } +} +class Type extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "type", ["none", "ascii85", "asciiHex", "ccittfax", "flate", "lzw", "runLength", "native", "xdp", "mergedXDP"]); + } +} +class Uri extends StringObject { + constructor(attributes) { + super(CONFIG_NS_ID, "uri"); + } +} +class config_Validate extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "validate", ["preSubmit", "prePrint", "preExecute", "preSave"]); + } +} +class ValidateApprovalSignatures extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "validateApprovalSignatures"); + } + [$finalize]() { + this[$content] = this[$content].trim().split(/\s+/).filter(x => ["docReady", "postSign"].includes(x)); + } +} +class ValidationMessaging extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "validationMessaging", ["allMessagesIndividually", "allMessagesTogether", "firstMessageOnly", "noMessages"]); + } +} +class Version extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "version", ["1.7", "1.6", "1.5", "1.4", "1.3", "1.2"]); + } +} +class VersionControl extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "VersionControl"); + this.outputBelow = getStringOption(attributes.outputBelow, ["warn", "error", "update"]); + this.sourceAbove = getStringOption(attributes.sourceAbove, ["warn", "error"]); + this.sourceBelow = getStringOption(attributes.sourceBelow, ["update", "maintain"]); + } +} +class ViewerPreferences extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "viewerPreferences", true); + this.ADBE_JSConsole = null; + this.ADBE_JSDebugger = null; + this.addViewerPreferences = null; + this.duplexOption = null; + this.enforce = null; + this.numberOfCopies = null; + this.pageRange = null; + this.pickTrayByPDFSize = null; + this.printScaling = null; + } +} +class WebClient extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "webClient", true); + this.name = attributes.name ? attributes.name.trim() : ""; + this.fontInfo = null; + this.xdc = null; + } +} +class Whitespace extends OptionObject { + constructor(attributes) { + super(CONFIG_NS_ID, "whitespace", ["preserve", "ltrim", "normalize", "rtrim", "trim"]); + } +} +class Window extends ContentObject { + constructor(attributes) { + super(CONFIG_NS_ID, "window"); + } + [$finalize]() { + const pair = this[$content].trim().split(/\s*,\s*/, 2).map(x => parseInt(x, 10)); + if (pair.some(x => isNaN(x))) { + this[$content] = [0, 0]; + return; + } + if (pair.length === 1) { + pair.push(pair[0]); + } + this[$content] = pair; + } +} +class Xdc extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "xdc", true); + this.uri = new XFAObjectArray(); + this.xsl = new XFAObjectArray(); + } +} +class Xdp extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "xdp", true); + this.packets = null; + } +} +class Xsl extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "xsl", true); + this.debug = null; + this.uri = null; + } +} +class Zpl extends XFAObject { + constructor(attributes) { + super(CONFIG_NS_ID, "zpl", true); + this.name = attributes.name ? attributes.name.trim() : ""; + this.batchOutput = null; + this.flipLabel = null; + this.fontInfo = null; + this.xdc = null; + } +} +class ConfigNamespace { + static [$buildXFAObject](name, attributes) { + if (ConfigNamespace.hasOwnProperty(name)) { + return ConfigNamespace[name](attributes); + } + return undefined; + } + static acrobat(attrs) { + return new Acrobat(attrs); + } + static acrobat7(attrs) { + return new Acrobat7(attrs); + } + static ADBE_JSConsole(attrs) { + return new ADBE_JSConsole(attrs); + } + static ADBE_JSDebugger(attrs) { + return new ADBE_JSDebugger(attrs); + } + static addSilentPrint(attrs) { + return new AddSilentPrint(attrs); + } + static addViewerPreferences(attrs) { + return new AddViewerPreferences(attrs); + } + static adjustData(attrs) { + return new AdjustData(attrs); + } + static adobeExtensionLevel(attrs) { + return new AdobeExtensionLevel(attrs); + } + static agent(attrs) { + return new Agent(attrs); + } + static alwaysEmbed(attrs) { + return new AlwaysEmbed(attrs); + } + static amd(attrs) { + return new Amd(attrs); + } + static area(attrs) { + return new config_Area(attrs); + } + static attributes(attrs) { + return new Attributes(attrs); + } + static autoSave(attrs) { + return new AutoSave(attrs); + } + static base(attrs) { + return new Base(attrs); + } + static batchOutput(attrs) { + return new BatchOutput(attrs); + } + static behaviorOverride(attrs) { + return new BehaviorOverride(attrs); + } + static cache(attrs) { + return new Cache(attrs); + } + static change(attrs) { + return new Change(attrs); + } + static common(attrs) { + return new Common(attrs); + } + static compress(attrs) { + return new Compress(attrs); + } + static compressLogicalStructure(attrs) { + return new CompressLogicalStructure(attrs); + } + static compressObjectStream(attrs) { + return new CompressObjectStream(attrs); + } + static compression(attrs) { + return new Compression(attrs); + } + static config(attrs) { + return new Config(attrs); + } + static conformance(attrs) { + return new Conformance(attrs); + } + static contentCopy(attrs) { + return new ContentCopy(attrs); + } + static copies(attrs) { + return new Copies(attrs); + } + static creator(attrs) { + return new Creator(attrs); + } + static currentPage(attrs) { + return new CurrentPage(attrs); + } + static data(attrs) { + return new Data(attrs); + } + static debug(attrs) { + return new Debug(attrs); + } + static defaultTypeface(attrs) { + return new DefaultTypeface(attrs); + } + static destination(attrs) { + return new Destination(attrs); + } + static documentAssembly(attrs) { + return new DocumentAssembly(attrs); + } + static driver(attrs) { + return new Driver(attrs); + } + static duplexOption(attrs) { + return new DuplexOption(attrs); + } + static dynamicRender(attrs) { + return new DynamicRender(attrs); + } + static embed(attrs) { + return new Embed(attrs); + } + static encrypt(attrs) { + return new config_Encrypt(attrs); + } + static encryption(attrs) { + return new config_Encryption(attrs); + } + static encryptionLevel(attrs) { + return new EncryptionLevel(attrs); + } + static enforce(attrs) { + return new Enforce(attrs); + } + static equate(attrs) { + return new Equate(attrs); + } + static equateRange(attrs) { + return new EquateRange(attrs); + } + static exclude(attrs) { + return new Exclude(attrs); + } + static excludeNS(attrs) { + return new ExcludeNS(attrs); + } + static flipLabel(attrs) { + return new FlipLabel(attrs); + } + static fontInfo(attrs) { + return new config_FontInfo(attrs); + } + static formFieldFilling(attrs) { + return new FormFieldFilling(attrs); + } + static groupParent(attrs) { + return new GroupParent(attrs); + } + static ifEmpty(attrs) { + return new IfEmpty(attrs); + } + static includeXDPContent(attrs) { + return new IncludeXDPContent(attrs); + } + static incrementalLoad(attrs) { + return new IncrementalLoad(attrs); + } + static incrementalMerge(attrs) { + return new IncrementalMerge(attrs); + } + static interactive(attrs) { + return new Interactive(attrs); + } + static jog(attrs) { + return new Jog(attrs); + } + static labelPrinter(attrs) { + return new LabelPrinter(attrs); + } + static layout(attrs) { + return new Layout(attrs); + } + static level(attrs) { + return new Level(attrs); + } + static linearized(attrs) { + return new Linearized(attrs); + } + static locale(attrs) { + return new Locale(attrs); + } + static localeSet(attrs) { + return new LocaleSet(attrs); + } + static log(attrs) { + return new Log(attrs); + } + static map(attrs) { + return new MapElement(attrs); + } + static mediumInfo(attrs) { + return new MediumInfo(attrs); + } + static message(attrs) { + return new config_Message(attrs); + } + static messaging(attrs) { + return new Messaging(attrs); + } + static mode(attrs) { + return new Mode(attrs); + } + static modifyAnnots(attrs) { + return new ModifyAnnots(attrs); + } + static msgId(attrs) { + return new MsgId(attrs); + } + static nameAttr(attrs) { + return new NameAttr(attrs); + } + static neverEmbed(attrs) { + return new NeverEmbed(attrs); + } + static numberOfCopies(attrs) { + return new NumberOfCopies(attrs); + } + static openAction(attrs) { + return new OpenAction(attrs); + } + static output(attrs) { + return new Output(attrs); + } + static outputBin(attrs) { + return new OutputBin(attrs); + } + static outputXSL(attrs) { + return new OutputXSL(attrs); + } + static overprint(attrs) { + return new Overprint(attrs); + } + static packets(attrs) { + return new Packets(attrs); + } + static pageOffset(attrs) { + return new PageOffset(attrs); + } + static pageRange(attrs) { + return new PageRange(attrs); + } + static pagination(attrs) { + return new Pagination(attrs); + } + static paginationOverride(attrs) { + return new PaginationOverride(attrs); + } + static part(attrs) { + return new Part(attrs); + } + static pcl(attrs) { + return new Pcl(attrs); + } + static pdf(attrs) { + return new Pdf(attrs); + } + static pdfa(attrs) { + return new Pdfa(attrs); + } + static permissions(attrs) { + return new Permissions(attrs); + } + static pickTrayByPDFSize(attrs) { + return new PickTrayByPDFSize(attrs); + } + static picture(attrs) { + return new config_Picture(attrs); + } + static plaintextMetadata(attrs) { + return new PlaintextMetadata(attrs); + } + static presence(attrs) { + return new Presence(attrs); + } + static present(attrs) { + return new Present(attrs); + } + static print(attrs) { + return new Print(attrs); + } + static printHighQuality(attrs) { + return new PrintHighQuality(attrs); + } + static printScaling(attrs) { + return new PrintScaling(attrs); + } + static printerName(attrs) { + return new PrinterName(attrs); + } + static producer(attrs) { + return new Producer(attrs); + } + static ps(attrs) { + return new Ps(attrs); + } + static range(attrs) { + return new Range(attrs); + } + static record(attrs) { + return new Record(attrs); + } + static relevant(attrs) { + return new Relevant(attrs); + } + static rename(attrs) { + return new Rename(attrs); + } + static renderPolicy(attrs) { + return new RenderPolicy(attrs); + } + static runScripts(attrs) { + return new RunScripts(attrs); + } + static script(attrs) { + return new config_Script(attrs); + } + static scriptModel(attrs) { + return new ScriptModel(attrs); + } + static severity(attrs) { + return new Severity(attrs); + } + static silentPrint(attrs) { + return new SilentPrint(attrs); + } + static staple(attrs) { + return new Staple(attrs); + } + static startNode(attrs) { + return new StartNode(attrs); + } + static startPage(attrs) { + return new StartPage(attrs); + } + static submitFormat(attrs) { + return new SubmitFormat(attrs); + } + static submitUrl(attrs) { + return new SubmitUrl(attrs); + } + static subsetBelow(attrs) { + return new SubsetBelow(attrs); + } + static suppressBanner(attrs) { + return new SuppressBanner(attrs); + } + static tagged(attrs) { + return new Tagged(attrs); + } + static template(attrs) { + return new config_Template(attrs); + } + static templateCache(attrs) { + return new TemplateCache(attrs); + } + static threshold(attrs) { + return new Threshold(attrs); + } + static to(attrs) { + return new To(attrs); + } + static trace(attrs) { + return new Trace(attrs); + } + static transform(attrs) { + return new config_Transform(attrs); + } + static type(attrs) { + return new Type(attrs); + } + static uri(attrs) { + return new Uri(attrs); + } + static validate(attrs) { + return new config_Validate(attrs); + } + static validateApprovalSignatures(attrs) { + return new ValidateApprovalSignatures(attrs); + } + static validationMessaging(attrs) { + return new ValidationMessaging(attrs); + } + static version(attrs) { + return new Version(attrs); + } + static versionControl(attrs) { + return new VersionControl(attrs); + } + static viewerPreferences(attrs) { + return new ViewerPreferences(attrs); + } + static webClient(attrs) { + return new WebClient(attrs); + } + static whitespace(attrs) { + return new Whitespace(attrs); + } + static window(attrs) { + return new Window(attrs); + } + static xdc(attrs) { + return new Xdc(attrs); + } + static xdp(attrs) { + return new Xdp(attrs); + } + static xsl(attrs) { + return new Xsl(attrs); + } + static zpl(attrs) { + return new Zpl(attrs); + } +} + +;// CONCATENATED MODULE: ./src/core/xfa/connection_set.js + + +const CONNECTION_SET_NS_ID = NamespaceIds.connectionSet.id; +class ConnectionSet extends XFAObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "connectionSet", true); + this.wsdlConnection = new XFAObjectArray(); + this.xmlConnection = new XFAObjectArray(); + this.xsdConnection = new XFAObjectArray(); + } +} +class EffectiveInputPolicy extends XFAObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "effectiveInputPolicy"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class EffectiveOutputPolicy extends XFAObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "effectiveOutputPolicy"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class Operation extends StringObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "operation"); + this.id = attributes.id || ""; + this.input = attributes.input || ""; + this.name = attributes.name || ""; + this.output = attributes.output || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class RootElement extends StringObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "rootElement"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class SoapAction extends StringObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "soapAction"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class SoapAddress extends StringObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "soapAddress"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class connection_set_Uri extends StringObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "uri"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class WsdlAddress extends StringObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "wsdlAddress"); + this.id = attributes.id || ""; + this.name = attributes.name || ""; + this.use = attributes.use || ""; + this.usehref = attributes.usehref || ""; + } +} +class WsdlConnection extends XFAObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "wsdlConnection", true); + this.dataDescription = attributes.dataDescription || ""; + this.name = attributes.name || ""; + this.effectiveInputPolicy = null; + this.effectiveOutputPolicy = null; + this.operation = null; + this.soapAction = null; + this.soapAddress = null; + this.wsdlAddress = null; + } +} +class XmlConnection extends XFAObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "xmlConnection", true); + this.dataDescription = attributes.dataDescription || ""; + this.name = attributes.name || ""; + this.uri = null; + } +} +class XsdConnection extends XFAObject { + constructor(attributes) { + super(CONNECTION_SET_NS_ID, "xsdConnection", true); + this.dataDescription = attributes.dataDescription || ""; + this.name = attributes.name || ""; + this.rootElement = null; + this.uri = null; + } +} +class ConnectionSetNamespace { + static [$buildXFAObject](name, attributes) { + if (ConnectionSetNamespace.hasOwnProperty(name)) { + return ConnectionSetNamespace[name](attributes); + } + return undefined; + } + static connectionSet(attrs) { + return new ConnectionSet(attrs); + } + static effectiveInputPolicy(attrs) { + return new EffectiveInputPolicy(attrs); + } + static effectiveOutputPolicy(attrs) { + return new EffectiveOutputPolicy(attrs); + } + static operation(attrs) { + return new Operation(attrs); + } + static rootElement(attrs) { + return new RootElement(attrs); + } + static soapAction(attrs) { + return new SoapAction(attrs); + } + static soapAddress(attrs) { + return new SoapAddress(attrs); + } + static uri(attrs) { + return new connection_set_Uri(attrs); + } + static wsdlAddress(attrs) { + return new WsdlAddress(attrs); + } + static wsdlConnection(attrs) { + return new WsdlConnection(attrs); + } + static xmlConnection(attrs) { + return new XmlConnection(attrs); + } + static xsdConnection(attrs) { + return new XsdConnection(attrs); + } +} + +;// CONCATENATED MODULE: ./src/core/xfa/datasets.js + + + +const DATASETS_NS_ID = NamespaceIds.datasets.id; +class datasets_Data extends XmlObject { + constructor(attributes) { + super(DATASETS_NS_ID, "data", attributes); + } + [$isNsAgnostic]() { + return true; + } +} +class Datasets extends XFAObject { + constructor(attributes) { + super(DATASETS_NS_ID, "datasets", true); + this.data = null; + this.Signature = null; + } + [$onChild](child) { + const name = child[$nodeName]; + if (name === "data" && child[$namespaceId] === DATASETS_NS_ID || name === "Signature" && child[$namespaceId] === NamespaceIds.signature.id) { + this[name] = child; + } + this[$appendChild](child); + } +} +class DatasetsNamespace { + static [$buildXFAObject](name, attributes) { + if (DatasetsNamespace.hasOwnProperty(name)) { + return DatasetsNamespace[name](attributes); + } + return undefined; + } + static datasets(attributes) { + return new Datasets(attributes); + } + static data(attributes) { + return new datasets_Data(attributes); + } +} + +;// CONCATENATED MODULE: ./src/core/xfa/locale_set.js + + + +const LOCALE_SET_NS_ID = NamespaceIds.localeSet.id; +class CalendarSymbols extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "calendarSymbols", true); + this.name = "gregorian"; + this.dayNames = new XFAObjectArray(2); + this.eraNames = null; + this.meridiemNames = null; + this.monthNames = new XFAObjectArray(2); + } +} +class CurrencySymbol extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "currencySymbol"); + this.name = getStringOption(attributes.name, ["symbol", "isoname", "decimal"]); + } +} +class CurrencySymbols extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "currencySymbols", true); + this.currencySymbol = new XFAObjectArray(3); + } +} +class DatePattern extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "datePattern"); + this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]); + } +} +class DatePatterns extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "datePatterns", true); + this.datePattern = new XFAObjectArray(4); + } +} +class DateTimeSymbols extends ContentObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "dateTimeSymbols"); + } +} +class Day extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "day"); + } +} +class DayNames extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "dayNames", true); + this.abbr = getInteger({ + data: attributes.abbr, + defaultValue: 0, + validate: x => x === 1 + }); + this.day = new XFAObjectArray(7); + } +} +class Era extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "era"); + } +} +class EraNames extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "eraNames", true); + this.era = new XFAObjectArray(2); + } +} +class locale_set_Locale extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "locale", true); + this.desc = attributes.desc || ""; + this.name = "isoname"; + this.calendarSymbols = null; + this.currencySymbols = null; + this.datePatterns = null; + this.dateTimeSymbols = null; + this.numberPatterns = null; + this.numberSymbols = null; + this.timePatterns = null; + this.typeFaces = null; + } +} +class locale_set_LocaleSet extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "localeSet", true); + this.locale = new XFAObjectArray(); + } +} +class Meridiem extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "meridiem"); + } +} +class MeridiemNames extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "meridiemNames", true); + this.meridiem = new XFAObjectArray(2); + } +} +class Month extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "month"); + } +} +class MonthNames extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "monthNames", true); + this.abbr = getInteger({ + data: attributes.abbr, + defaultValue: 0, + validate: x => x === 1 + }); + this.month = new XFAObjectArray(12); + } +} +class NumberPattern extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "numberPattern"); + this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]); + } +} +class NumberPatterns extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "numberPatterns", true); + this.numberPattern = new XFAObjectArray(4); + } +} +class NumberSymbol extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "numberSymbol"); + this.name = getStringOption(attributes.name, ["decimal", "grouping", "percent", "minus", "zero"]); + } +} +class NumberSymbols extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "numberSymbols", true); + this.numberSymbol = new XFAObjectArray(5); + } +} +class TimePattern extends StringObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "timePattern"); + this.name = getStringOption(attributes.name, ["full", "long", "med", "short"]); + } +} +class TimePatterns extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "timePatterns", true); + this.timePattern = new XFAObjectArray(4); + } +} +class TypeFace extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "typeFace", true); + this.name = attributes.name | ""; + } +} +class TypeFaces extends XFAObject { + constructor(attributes) { + super(LOCALE_SET_NS_ID, "typeFaces", true); + this.typeFace = new XFAObjectArray(); + } +} +class LocaleSetNamespace { + static [$buildXFAObject](name, attributes) { + if (LocaleSetNamespace.hasOwnProperty(name)) { + return LocaleSetNamespace[name](attributes); + } + return undefined; + } + static calendarSymbols(attrs) { + return new CalendarSymbols(attrs); + } + static currencySymbol(attrs) { + return new CurrencySymbol(attrs); + } + static currencySymbols(attrs) { + return new CurrencySymbols(attrs); + } + static datePattern(attrs) { + return new DatePattern(attrs); + } + static datePatterns(attrs) { + return new DatePatterns(attrs); + } + static dateTimeSymbols(attrs) { + return new DateTimeSymbols(attrs); + } + static day(attrs) { + return new Day(attrs); + } + static dayNames(attrs) { + return new DayNames(attrs); + } + static era(attrs) { + return new Era(attrs); + } + static eraNames(attrs) { + return new EraNames(attrs); + } + static locale(attrs) { + return new locale_set_Locale(attrs); + } + static localeSet(attrs) { + return new locale_set_LocaleSet(attrs); + } + static meridiem(attrs) { + return new Meridiem(attrs); + } + static meridiemNames(attrs) { + return new MeridiemNames(attrs); + } + static month(attrs) { + return new Month(attrs); + } + static monthNames(attrs) { + return new MonthNames(attrs); + } + static numberPattern(attrs) { + return new NumberPattern(attrs); + } + static numberPatterns(attrs) { + return new NumberPatterns(attrs); + } + static numberSymbol(attrs) { + return new NumberSymbol(attrs); + } + static numberSymbols(attrs) { + return new NumberSymbols(attrs); + } + static timePattern(attrs) { + return new TimePattern(attrs); + } + static timePatterns(attrs) { + return new TimePatterns(attrs); + } + static typeFace(attrs) { + return new TypeFace(attrs); + } + static typeFaces(attrs) { + return new TypeFaces(attrs); + } +} + +;// CONCATENATED MODULE: ./src/core/xfa/signature.js + + +const SIGNATURE_NS_ID = NamespaceIds.signature.id; +class signature_Signature extends XFAObject { + constructor(attributes) { + super(SIGNATURE_NS_ID, "signature", true); + } +} +class SignatureNamespace { + static [$buildXFAObject](name, attributes) { + if (SignatureNamespace.hasOwnProperty(name)) { + return SignatureNamespace[name](attributes); + } + return undefined; + } + static signature(attributes) { + return new signature_Signature(attributes); + } +} + +;// CONCATENATED MODULE: ./src/core/xfa/stylesheet.js + + +const STYLESHEET_NS_ID = NamespaceIds.stylesheet.id; +class Stylesheet extends XFAObject { + constructor(attributes) { + super(STYLESHEET_NS_ID, "stylesheet", true); + } +} +class StylesheetNamespace { + static [$buildXFAObject](name, attributes) { + if (StylesheetNamespace.hasOwnProperty(name)) { + return StylesheetNamespace[name](attributes); + } + return undefined; + } + static stylesheet(attributes) { + return new Stylesheet(attributes); + } +} + +;// CONCATENATED MODULE: ./src/core/xfa/xdp.js + + + +const XDP_NS_ID = NamespaceIds.xdp.id; +class xdp_Xdp extends XFAObject { + constructor(attributes) { + super(XDP_NS_ID, "xdp", true); + this.uuid = attributes.uuid || ""; + this.timeStamp = attributes.timeStamp || ""; + this.config = null; + this.connectionSet = null; + this.datasets = null; + this.localeSet = null; + this.stylesheet = new XFAObjectArray(); + this.template = null; + } + [$onChildCheck](child) { + const ns = NamespaceIds[child[$nodeName]]; + return ns && child[$namespaceId] === ns.id; + } +} +class XdpNamespace { + static [$buildXFAObject](name, attributes) { + if (XdpNamespace.hasOwnProperty(name)) { + return XdpNamespace[name](attributes); + } + return undefined; + } + static xdp(attributes) { + return new xdp_Xdp(attributes); + } +} + +;// CONCATENATED MODULE: ./src/core/xfa/xhtml.js + + + + + +const XHTML_NS_ID = NamespaceIds.xhtml.id; +const $richText = Symbol(); +const VALID_STYLES = new Set(["color", "font", "font-family", "font-size", "font-stretch", "font-style", "font-weight", "margin", "margin-bottom", "margin-left", "margin-right", "margin-top", "letter-spacing", "line-height", "orphans", "page-break-after", "page-break-before", "page-break-inside", "tab-interval", "tab-stop", "text-align", "text-decoration", "text-indent", "vertical-align", "widows", "kerning-mode", "xfa-font-horizontal-scale", "xfa-font-vertical-scale", "xfa-spacerun", "xfa-tab-stops"]); +const StyleMapping = new Map([["page-break-after", "breakAfter"], ["page-break-before", "breakBefore"], ["page-break-inside", "breakInside"], ["kerning-mode", value => value === "none" ? "none" : "normal"], ["xfa-font-horizontal-scale", value => `scaleX(${Math.max(0, Math.min(parseInt(value) / 100)).toFixed(2)})`], ["xfa-font-vertical-scale", value => `scaleY(${Math.max(0, Math.min(parseInt(value) / 100)).toFixed(2)})`], ["xfa-spacerun", ""], ["xfa-tab-stops", ""], ["font-size", (value, original) => { + value = original.fontSize = getMeasurement(value); + return measureToString(0.99 * value); +}], ["letter-spacing", value => measureToString(getMeasurement(value))], ["line-height", value => measureToString(getMeasurement(value))], ["margin", value => measureToString(getMeasurement(value))], ["margin-bottom", value => measureToString(getMeasurement(value))], ["margin-left", value => measureToString(getMeasurement(value))], ["margin-right", value => measureToString(getMeasurement(value))], ["margin-top", value => measureToString(getMeasurement(value))], ["text-indent", value => measureToString(getMeasurement(value))], ["font-family", value => value], ["vertical-align", value => measureToString(getMeasurement(value))]]); +const spacesRegExp = /\s+/g; +const crlfRegExp = /[\r\n]+/g; +const crlfForRichTextRegExp = /\r\n?/g; +function mapStyle(styleStr, node, richText) { + const style = Object.create(null); + if (!styleStr) { + return style; + } + const original = Object.create(null); + for (const [key, value] of styleStr.split(";").map(s => s.split(":", 2))) { + const mapping = StyleMapping.get(key); + if (mapping === "") { + continue; + } + let newValue = value; + if (mapping) { + newValue = typeof mapping === "string" ? mapping : mapping(value, original); + } + if (key.endsWith("scale")) { + style.transform = style.transform ? `${style[key]} ${newValue}` : newValue; + } else { + style[key.replaceAll(/-([a-zA-Z])/g, (_, x) => x.toUpperCase())] = newValue; + } + } + if (style.fontFamily) { + setFontFamily({ + typeface: style.fontFamily, + weight: style.fontWeight || "normal", + posture: style.fontStyle || "normal", + size: original.fontSize || 0 + }, node, node[$globalData].fontFinder, style); + } + if (richText && style.verticalAlign && style.verticalAlign !== "0px" && style.fontSize) { + const SUB_SUPER_SCRIPT_FACTOR = 0.583; + const VERTICAL_FACTOR = 0.333; + const fontSize = getMeasurement(style.fontSize); + style.fontSize = measureToString(fontSize * SUB_SUPER_SCRIPT_FACTOR); + style.verticalAlign = measureToString(Math.sign(getMeasurement(style.verticalAlign)) * fontSize * VERTICAL_FACTOR); + } + if (richText && style.fontSize) { + style.fontSize = `calc(${style.fontSize} * var(--scale-factor))`; + } + fixTextIndent(style); + return style; +} +function checkStyle(node) { + if (!node.style) { + return ""; + } + return node.style.trim().split(/\s*;\s*/).filter(s => !!s).map(s => s.split(/\s*:\s*/, 2)).filter(([key, value]) => { + if (key === "font-family") { + node[$globalData].usedTypefaces.add(value); + } + return VALID_STYLES.has(key); + }).map(kv => kv.join(":")).join(";"); +} +const NoWhites = new Set(["body", "html"]); +class XhtmlObject extends XmlObject { + constructor(attributes, name) { + super(XHTML_NS_ID, name); + this[$richText] = false; + this.style = attributes.style || ""; + } + [$clean](builder) { + super[$clean](builder); + this.style = checkStyle(this); + } + [$acceptWhitespace]() { + return !NoWhites.has(this[$nodeName]); + } + [$onText](str, richText = false) { + if (!richText) { + str = str.replaceAll(crlfRegExp, ""); + if (!this.style.includes("xfa-spacerun:yes")) { + str = str.replaceAll(spacesRegExp, " "); + } + } else { + this[$richText] = true; + } + if (str) { + this[$content] += str; + } + } + [$pushGlyphs](measure, mustPop = true) { + const xfaFont = Object.create(null); + const margin = { + top: NaN, + bottom: NaN, + left: NaN, + right: NaN + }; + let lineHeight = null; + for (const [key, value] of this.style.split(";").map(s => s.split(":", 2))) { + switch (key) { + case "font-family": + xfaFont.typeface = stripQuotes(value); + break; + case "font-size": + xfaFont.size = getMeasurement(value); + break; + case "font-weight": + xfaFont.weight = value; + break; + case "font-style": + xfaFont.posture = value; + break; + case "letter-spacing": + xfaFont.letterSpacing = getMeasurement(value); + break; + case "margin": + const values = value.split(/ \t/).map(x => getMeasurement(x)); + switch (values.length) { + case 1: + margin.top = margin.bottom = margin.left = margin.right = values[0]; + break; + case 2: + margin.top = margin.bottom = values[0]; + margin.left = margin.right = values[1]; + break; + case 3: + margin.top = values[0]; + margin.bottom = values[2]; + margin.left = margin.right = values[1]; + break; + case 4: + margin.top = values[0]; + margin.left = values[1]; + margin.bottom = values[2]; + margin.right = values[3]; + break; + } + break; + case "margin-top": + margin.top = getMeasurement(value); + break; + case "margin-bottom": + margin.bottom = getMeasurement(value); + break; + case "margin-left": + margin.left = getMeasurement(value); + break; + case "margin-right": + margin.right = getMeasurement(value); + break; + case "line-height": + lineHeight = getMeasurement(value); + break; + } + } + measure.pushData(xfaFont, margin, lineHeight); + if (this[$content]) { + measure.addString(this[$content]); + } else { + for (const child of this[$getChildren]()) { + if (child[$nodeName] === "#text") { + measure.addString(child[$content]); + continue; + } + child[$pushGlyphs](measure); + } + } + if (mustPop) { + measure.popFont(); + } + } + [$toHTML](availableSpace) { + const children = []; + this[$extra] = { + children + }; + this[$childrenToHTML]({}); + if (children.length === 0 && !this[$content]) { + return HTMLResult.EMPTY; + } + let value; + if (this[$richText]) { + value = this[$content] ? this[$content].replaceAll(crlfForRichTextRegExp, "\n") : undefined; + } else { + value = this[$content] || undefined; + } + return HTMLResult.success({ + name: this[$nodeName], + attributes: { + href: this.href, + style: mapStyle(this.style, this, this[$richText]) + }, + children, + value + }); + } +} +class A extends XhtmlObject { + constructor(attributes) { + super(attributes, "a"); + this.href = fixURL(attributes.href) || ""; + } +} +class B extends XhtmlObject { + constructor(attributes) { + super(attributes, "b"); + } + [$pushGlyphs](measure) { + measure.pushFont({ + weight: "bold" + }); + super[$pushGlyphs](measure); + measure.popFont(); + } +} +class Body extends XhtmlObject { + constructor(attributes) { + super(attributes, "body"); + } + [$toHTML](availableSpace) { + const res = super[$toHTML](availableSpace); + const { + html + } = res; + if (!html) { + return HTMLResult.EMPTY; + } + html.name = "div"; + html.attributes.class = ["xfaRich"]; + return res; + } +} +class Br extends XhtmlObject { + constructor(attributes) { + super(attributes, "br"); + } + [$text]() { + return "\n"; + } + [$pushGlyphs](measure) { + measure.addString("\n"); + } + [$toHTML](availableSpace) { + return HTMLResult.success({ + name: "br" + }); + } +} +class Html extends XhtmlObject { + constructor(attributes) { + super(attributes, "html"); + } + [$toHTML](availableSpace) { + const children = []; + this[$extra] = { + children + }; + this[$childrenToHTML]({}); + if (children.length === 0) { + return HTMLResult.success({ + name: "div", + attributes: { + class: ["xfaRich"], + style: {} + }, + value: this[$content] || "" + }); + } + if (children.length === 1) { + const child = children[0]; + if (child.attributes?.class.includes("xfaRich")) { + return HTMLResult.success(child); + } + } + return HTMLResult.success({ + name: "div", + attributes: { + class: ["xfaRich"], + style: {} + }, + children + }); + } +} +class I extends XhtmlObject { + constructor(attributes) { + super(attributes, "i"); + } + [$pushGlyphs](measure) { + measure.pushFont({ + posture: "italic" + }); + super[$pushGlyphs](measure); + measure.popFont(); + } +} +class Li extends XhtmlObject { + constructor(attributes) { + super(attributes, "li"); + } +} +class Ol extends XhtmlObject { + constructor(attributes) { + super(attributes, "ol"); + } +} +class P extends XhtmlObject { + constructor(attributes) { + super(attributes, "p"); + } + [$pushGlyphs](measure) { + super[$pushGlyphs](measure, false); + measure.addString("\n"); + measure.addPara(); + measure.popFont(); + } + [$text]() { + const siblings = this[$getParent]()[$getChildren](); + if (siblings.at(-1) === this) { + return super[$text](); + } + return super[$text]() + "\n"; + } +} +class Span extends XhtmlObject { + constructor(attributes) { + super(attributes, "span"); + } +} +class Sub extends XhtmlObject { + constructor(attributes) { + super(attributes, "sub"); + } +} +class Sup extends XhtmlObject { + constructor(attributes) { + super(attributes, "sup"); + } +} +class Ul extends XhtmlObject { + constructor(attributes) { + super(attributes, "ul"); + } +} +class XhtmlNamespace { + static [$buildXFAObject](name, attributes) { + if (XhtmlNamespace.hasOwnProperty(name)) { + return XhtmlNamespace[name](attributes); + } + return undefined; + } + static a(attributes) { + return new A(attributes); + } + static b(attributes) { + return new B(attributes); + } + static body(attributes) { + return new Body(attributes); + } + static br(attributes) { + return new Br(attributes); + } + static html(attributes) { + return new Html(attributes); + } + static i(attributes) { + return new I(attributes); + } + static li(attributes) { + return new Li(attributes); + } + static ol(attributes) { + return new Ol(attributes); + } + static p(attributes) { + return new P(attributes); + } + static span(attributes) { + return new Span(attributes); + } + static sub(attributes) { + return new Sub(attributes); + } + static sup(attributes) { + return new Sup(attributes); + } + static ul(attributes) { + return new Ul(attributes); + } +} + +;// CONCATENATED MODULE: ./src/core/xfa/setup.js + + + + + + + + + +const NamespaceSetUp = { + config: ConfigNamespace, + connection: ConnectionSetNamespace, + datasets: DatasetsNamespace, + localeSet: LocaleSetNamespace, + signature: SignatureNamespace, + stylesheet: StylesheetNamespace, + template: TemplateNamespace, + xdp: XdpNamespace, + xhtml: XhtmlNamespace +}; + +;// CONCATENATED MODULE: ./src/core/xfa/unknown.js + + +class UnknownNamespace { + constructor(nsId) { + this.namespaceId = nsId; + } + [$buildXFAObject](name, attributes) { + return new XmlObject(this.namespaceId, name, attributes); + } +} + +;// CONCATENATED MODULE: ./src/core/xfa/builder.js + + + + + + + +class Root extends XFAObject { + constructor(ids) { + super(-1, "root", Object.create(null)); + this.element = null; + this[$ids] = ids; + } + [$onChild](child) { + this.element = child; + return true; + } + [$finalize]() { + super[$finalize](); + if (this.element.template instanceof Template) { + this[$ids].set($root, this.element); + this.element.template[$resolvePrototypes](this[$ids]); + this.element.template[$ids] = this[$ids]; + } + } +} +class Empty extends XFAObject { + constructor() { + super(-1, "", Object.create(null)); + } + [$onChild](_) { + return false; + } +} +class Builder { + constructor(rootNameSpace = null) { + this._namespaceStack = []; + this._nsAgnosticLevel = 0; + this._namespacePrefixes = new Map(); + this._namespaces = new Map(); + this._nextNsId = Math.max(...Object.values(NamespaceIds).map(({ + id + }) => id)); + this._currentNamespace = rootNameSpace || new UnknownNamespace(++this._nextNsId); + } + buildRoot(ids) { + return new Root(ids); + } + build({ + nsPrefix, + name, + attributes, + namespace, + prefixes + }) { + const hasNamespaceDef = namespace !== null; + if (hasNamespaceDef) { + this._namespaceStack.push(this._currentNamespace); + this._currentNamespace = this._searchNamespace(namespace); + } + if (prefixes) { + this._addNamespacePrefix(prefixes); + } + if (attributes.hasOwnProperty($nsAttributes)) { + const dataTemplate = NamespaceSetUp.datasets; + const nsAttrs = attributes[$nsAttributes]; + let xfaAttrs = null; + for (const [ns, attrs] of Object.entries(nsAttrs)) { + const nsToUse = this._getNamespaceToUse(ns); + if (nsToUse === dataTemplate) { + xfaAttrs = { + xfa: attrs + }; + break; + } + } + if (xfaAttrs) { + attributes[$nsAttributes] = xfaAttrs; + } else { + delete attributes[$nsAttributes]; + } + } + const namespaceToUse = this._getNamespaceToUse(nsPrefix); + const node = namespaceToUse?.[$buildXFAObject](name, attributes) || new Empty(); + if (node[$isNsAgnostic]()) { + this._nsAgnosticLevel++; + } + if (hasNamespaceDef || prefixes || node[$isNsAgnostic]()) { + node[$cleanup] = { + hasNamespace: hasNamespaceDef, + prefixes, + nsAgnostic: node[$isNsAgnostic]() + }; + } + return node; + } + isNsAgnostic() { + return this._nsAgnosticLevel > 0; + } + _searchNamespace(nsName) { + let ns = this._namespaces.get(nsName); + if (ns) { + return ns; + } + for (const [name, { + check + }] of Object.entries(NamespaceIds)) { + if (check(nsName)) { + ns = NamespaceSetUp[name]; + if (ns) { + this._namespaces.set(nsName, ns); + return ns; + } + break; + } + } + ns = new UnknownNamespace(++this._nextNsId); + this._namespaces.set(nsName, ns); + return ns; + } + _addNamespacePrefix(prefixes) { + for (const { + prefix, + value + } of prefixes) { + const namespace = this._searchNamespace(value); + let prefixStack = this._namespacePrefixes.get(prefix); + if (!prefixStack) { + prefixStack = []; + this._namespacePrefixes.set(prefix, prefixStack); + } + prefixStack.push(namespace); + } + } + _getNamespaceToUse(prefix) { + if (!prefix) { + return this._currentNamespace; + } + const prefixStack = this._namespacePrefixes.get(prefix); + if (prefixStack?.length > 0) { + return prefixStack.at(-1); + } + warn(`Unknown namespace prefix: ${prefix}.`); + return null; + } + clean(data) { + const { + hasNamespace, + prefixes, + nsAgnostic + } = data; + if (hasNamespace) { + this._currentNamespace = this._namespaceStack.pop(); + } + if (prefixes) { + prefixes.forEach(({ + prefix + }) => { + this._namespacePrefixes.get(prefix).pop(); + }); + } + if (nsAgnostic) { + this._nsAgnosticLevel--; + } + } +} + +;// CONCATENATED MODULE: ./src/core/xfa/parser.js + + + + +class XFAParser extends XMLParserBase { + constructor(rootNameSpace = null, richText = false) { + super(); + this._builder = new Builder(rootNameSpace); + this._stack = []; + this._globalData = { + usedTypefaces: new Set() + }; + this._ids = new Map(); + this._current = this._builder.buildRoot(this._ids); + this._errorCode = XMLParserErrorCode.NoError; + this._whiteRegex = /^\s+$/; + this._nbsps = /\xa0+/g; + this._richText = richText; + } + parse(data) { + this.parseXml(data); + if (this._errorCode !== XMLParserErrorCode.NoError) { + return undefined; + } + this._current[$finalize](); + return this._current.element; + } + onText(text) { + text = text.replace(this._nbsps, match => match.slice(1) + " "); + if (this._richText || this._current[$acceptWhitespace]()) { + this._current[$onText](text, this._richText); + return; + } + if (this._whiteRegex.test(text)) { + return; + } + this._current[$onText](text.trim()); + } + onCdata(text) { + this._current[$onText](text); + } + _mkAttributes(attributes, tagName) { + let namespace = null; + let prefixes = null; + const attributeObj = Object.create({}); + for (const { + name, + value + } of attributes) { + if (name === "xmlns") { + if (!namespace) { + namespace = value; + } else { + warn(`XFA - multiple namespace definition in <${tagName}>`); + } + } else if (name.startsWith("xmlns:")) { + const prefix = name.substring("xmlns:".length); + if (!prefixes) { + prefixes = []; + } + prefixes.push({ + prefix, + value + }); + } else { + const i = name.indexOf(":"); + if (i === -1) { + attributeObj[name] = value; + } else { + let nsAttrs = attributeObj[$nsAttributes]; + if (!nsAttrs) { + nsAttrs = attributeObj[$nsAttributes] = Object.create(null); + } + const [ns, attrName] = [name.slice(0, i), name.slice(i + 1)]; + const attrs = nsAttrs[ns] ||= Object.create(null); + attrs[attrName] = value; + } + } + } + return [namespace, prefixes, attributeObj]; + } + _getNameAndPrefix(name, nsAgnostic) { + const i = name.indexOf(":"); + if (i === -1) { + return [name, null]; + } + return [name.substring(i + 1), nsAgnostic ? "" : name.substring(0, i)]; + } + onBeginElement(tagName, attributes, isEmpty) { + const [namespace, prefixes, attributesObj] = this._mkAttributes(attributes, tagName); + const [name, nsPrefix] = this._getNameAndPrefix(tagName, this._builder.isNsAgnostic()); + const node = this._builder.build({ + nsPrefix, + name, + attributes: attributesObj, + namespace, + prefixes + }); + node[$globalData] = this._globalData; + if (isEmpty) { + node[$finalize](); + if (this._current[$onChild](node)) { + node[$setId](this._ids); + } + node[$clean](this._builder); + return; + } + this._stack.push(this._current); + this._current = node; + } + onEndElement(name) { + const node = this._current; + if (node[$isCDATAXml]() && typeof node[$content] === "string") { + const parser = new XFAParser(); + parser._globalData = this._globalData; + const root = parser.parse(node[$content]); + node[$content] = null; + node[$onChild](root); + } + node[$finalize](); + this._current = this._stack.pop(); + if (this._current[$onChild](node)) { + node[$setId](this._ids); + } + node[$clean](this._builder); + } + onError(code) { + this._errorCode = code; + } +} + +;// CONCATENATED MODULE: ./src/core/xfa/factory.js + + + + + + + + +class XFAFactory { + constructor(data) { + try { + this.root = new XFAParser().parse(XFAFactory._createDocument(data)); + const binder = new Binder(this.root); + this.form = binder.bind(); + this.dataHandler = new DataHandler(this.root, binder.getData()); + this.form[$globalData].template = this.form; + } catch (e) { + warn(`XFA - an error occurred during parsing and binding: ${e}`); + } + } + isValid() { + return this.root && this.form; + } + _createPagesHelper() { + const iterator = this.form[$toPages](); + return new Promise((resolve, reject) => { + const nextIteration = () => { + try { + const value = iterator.next(); + if (value.done) { + resolve(value.value); + } else { + setTimeout(nextIteration, 0); + } + } catch (e) { + reject(e); + } + }; + setTimeout(nextIteration, 0); + }); + } + async _createPages() { + try { + this.pages = await this._createPagesHelper(); + this.dims = this.pages.children.map(c => { + const { + width, + height + } = c.attributes.style; + return [0, 0, parseInt(width), parseInt(height)]; + }); + } catch (e) { + warn(`XFA - an error occurred during layout: ${e}`); + } + } + getBoundingBox(pageIndex) { + return this.dims[pageIndex]; + } + async getNumPages() { + if (!this.pages) { + await this._createPages(); + } + return this.dims.length; + } + setImages(images) { + this.form[$globalData].images = images; + } + setFonts(fonts) { + this.form[$globalData].fontFinder = new FontFinder(fonts); + const missingFonts = []; + for (let typeface of this.form[$globalData].usedTypefaces) { + typeface = stripQuotes(typeface); + const font = this.form[$globalData].fontFinder.find(typeface); + if (!font) { + missingFonts.push(typeface); + } + } + if (missingFonts.length > 0) { + return missingFonts; + } + return null; + } + appendFonts(fonts, reallyMissingFonts) { + this.form[$globalData].fontFinder.add(fonts, reallyMissingFonts); + } + async getPages() { + if (!this.pages) { + await this._createPages(); + } + const pages = this.pages; + this.pages = null; + return pages; + } + serializeData(storage) { + return this.dataHandler.serialize(storage); + } + static _createDocument(data) { + if (!data["/xdp:xdp"]) { + return data["xdp:xdp"]; + } + return Object.values(data).join(""); + } + static getRichTextAsHtml(rc) { + if (!rc || typeof rc !== "string") { + return null; + } + try { + let root = new XFAParser(XhtmlNamespace, true).parse(rc); + if (!["body", "xhtml"].includes(root[$nodeName])) { + const newRoot = XhtmlNamespace.body({}); + newRoot[$appendChild](root); + root = newRoot; + } + const result = root[$toHTML](); + if (!result.success) { + return null; + } + const { + html + } = result; + const { + attributes + } = html; + if (attributes) { + if (attributes.class) { + attributes.class = attributes.class.filter(attr => !attr.startsWith("xfa")); + } + attributes.dir = "auto"; + } + return { + html, + str: root[$text]() + }; + } catch (e) { + warn(`XFA - an error occurred during parsing of rich text: ${e}`); + } + return null; + } +} + +;// CONCATENATED MODULE: ./src/core/annotation.js + + + + + + + + + + + + + + + +class AnnotationFactory { + static createGlobals(pdfManager) { + return Promise.all([pdfManager.ensureCatalog("acroForm"), pdfManager.ensureDoc("xfaDatasets"), pdfManager.ensureCatalog("structTreeRoot"), pdfManager.ensureCatalog("baseUrl"), pdfManager.ensureCatalog("attachments")]).then(([acroForm, xfaDatasets, structTreeRoot, baseUrl, attachments]) => { + return { + pdfManager, + acroForm: acroForm instanceof Dict ? acroForm : Dict.empty, + xfaDatasets, + structTreeRoot, + baseUrl, + attachments + }; + }, reason => { + warn(`createGlobals: "${reason}".`); + return null; + }); + } + static async create(xref, ref, annotationGlobals, idFactory, collectFields, pageRef) { + const pageIndex = collectFields ? await this._getPageIndex(xref, ref, annotationGlobals.pdfManager) : null; + return annotationGlobals.pdfManager.ensure(this, "_create", [xref, ref, annotationGlobals, idFactory, collectFields, pageIndex, pageRef]); + } + static _create(xref, ref, annotationGlobals, idFactory, collectFields = false, pageIndex = null, pageRef = null) { + const dict = xref.fetchIfRef(ref); + if (!(dict instanceof Dict)) { + return undefined; + } + const { + acroForm, + pdfManager + } = annotationGlobals; + const id = ref instanceof Ref ? ref.toString() : `annot_${idFactory.createObjId()}`; + let subtype = dict.get("Subtype"); + subtype = subtype instanceof Name ? subtype.name : null; + const parameters = { + xref, + ref, + dict, + subtype, + id, + annotationGlobals, + collectFields, + needAppearances: !collectFields && acroForm.get("NeedAppearances") === true, + pageIndex, + evaluatorOptions: pdfManager.evaluatorOptions, + pageRef + }; + switch (subtype) { + case "Link": + return new LinkAnnotation(parameters); + case "Text": + return new TextAnnotation(parameters); + case "Widget": + let fieldType = getInheritableProperty({ + dict, + key: "FT" + }); + fieldType = fieldType instanceof Name ? fieldType.name : null; + switch (fieldType) { + case "Tx": + return new TextWidgetAnnotation(parameters); + case "Btn": + return new ButtonWidgetAnnotation(parameters); + case "Ch": + return new ChoiceWidgetAnnotation(parameters); + case "Sig": + return new SignatureWidgetAnnotation(parameters); + } + warn(`Unimplemented widget field type "${fieldType}", ` + "falling back to base field type."); + return new WidgetAnnotation(parameters); + case "Popup": + return new PopupAnnotation(parameters); + case "FreeText": + return new FreeTextAnnotation(parameters); + case "Line": + return new LineAnnotation(parameters); + case "Square": + return new SquareAnnotation(parameters); + case "Circle": + return new CircleAnnotation(parameters); + case "PolyLine": + return new PolylineAnnotation(parameters); + case "Polygon": + return new PolygonAnnotation(parameters); + case "Caret": + return new CaretAnnotation(parameters); + case "Ink": + return new InkAnnotation(parameters); + case "Highlight": + return new HighlightAnnotation(parameters); + case "Underline": + return new UnderlineAnnotation(parameters); + case "Squiggly": + return new SquigglyAnnotation(parameters); + case "StrikeOut": + return new StrikeOutAnnotation(parameters); + case "Stamp": + return new StampAnnotation(parameters); + case "FileAttachment": + return new FileAttachmentAnnotation(parameters); + default: + if (!collectFields) { + if (!subtype) { + warn("Annotation is missing the required /Subtype."); + } else { + warn(`Unimplemented annotation type "${subtype}", ` + "falling back to base annotation."); + } + } + return new Annotation(parameters); + } + } + static async _getPageIndex(xref, ref, pdfManager) { + try { + const annotDict = await xref.fetchIfRefAsync(ref); + if (!(annotDict instanceof Dict)) { + return -1; + } + const pageRef = annotDict.getRaw("P"); + if (pageRef instanceof Ref) { + try { + const pageIndex = await pdfManager.ensureCatalog("getPageIndex", [pageRef]); + return pageIndex; + } catch (ex) { + info(`_getPageIndex -- not a valid page reference: "${ex}".`); + } + } + if (annotDict.has("Kids")) { + return -1; + } + const numPages = await pdfManager.ensureDoc("numPages"); + for (let pageIndex = 0; pageIndex < numPages; pageIndex++) { + const page = await pdfManager.getPage(pageIndex); + const annotations = await pdfManager.ensure(page, "annotations"); + for (const annotRef of annotations) { + if (annotRef instanceof Ref && isRefsEqual(annotRef, ref)) { + return pageIndex; + } + } + } + } catch (ex) { + warn(`_getPageIndex: "${ex}".`); + } + return -1; + } + static generateImages(annotations, xref, isOffscreenCanvasSupported) { + if (!isOffscreenCanvasSupported) { + warn("generateImages: OffscreenCanvas is not supported, cannot save or print some annotations with images."); + return null; + } + let imagePromises; + for (const { + bitmapId, + bitmap + } of annotations) { + if (!bitmap) { + continue; + } + imagePromises ||= new Map(); + imagePromises.set(bitmapId, StampAnnotation.createImage(bitmap, xref)); + } + return imagePromises; + } + static async saveNewAnnotations(evaluator, task, annotations, imagePromises) { + const xref = evaluator.xref; + let baseFontRef; + const dependencies = []; + const promises = []; + const { + isOffscreenCanvasSupported + } = evaluator.options; + for (const annotation of annotations) { + if (annotation.deleted) { + continue; + } + switch (annotation.annotationType) { + case AnnotationEditorType.FREETEXT: + if (!baseFontRef) { + const baseFont = new Dict(xref); + baseFont.set("BaseFont", Name.get("Helvetica")); + baseFont.set("Type", Name.get("Font")); + baseFont.set("Subtype", Name.get("Type1")); + baseFont.set("Encoding", Name.get("WinAnsiEncoding")); + const buffer = []; + baseFontRef = xref.getNewTemporaryRef(); + await writeObject(baseFontRef, baseFont, buffer, xref); + dependencies.push({ + ref: baseFontRef, + data: buffer.join("") + }); + } + promises.push(FreeTextAnnotation.createNewAnnotation(xref, annotation, dependencies, { + evaluator, + task, + baseFontRef + })); + break; + case AnnotationEditorType.HIGHLIGHT: + promises.push(HighlightAnnotation.createNewAnnotation(xref, annotation, dependencies)); + break; + case AnnotationEditorType.INK: + promises.push(InkAnnotation.createNewAnnotation(xref, annotation, dependencies)); + break; + case AnnotationEditorType.STAMP: + if (!isOffscreenCanvasSupported) { + break; + } + const image = await imagePromises.get(annotation.bitmapId); + if (image.imageStream) { + const { + imageStream, + smaskStream + } = image; + const buffer = []; + if (smaskStream) { + const smaskRef = xref.getNewTemporaryRef(); + await writeObject(smaskRef, smaskStream, buffer, xref); + dependencies.push({ + ref: smaskRef, + data: buffer.join("") + }); + imageStream.dict.set("SMask", smaskRef); + buffer.length = 0; + } + const imageRef = image.imageRef = xref.getNewTemporaryRef(); + await writeObject(imageRef, imageStream, buffer, xref); + dependencies.push({ + ref: imageRef, + data: buffer.join("") + }); + image.imageStream = image.smaskStream = null; + } + promises.push(StampAnnotation.createNewAnnotation(xref, annotation, dependencies, { + image + })); + break; + } + } + return { + annotations: await Promise.all(promises), + dependencies + }; + } + static async printNewAnnotations(annotationGlobals, evaluator, task, annotations, imagePromises) { + if (!annotations) { + return null; + } + const { + options, + xref + } = evaluator; + const promises = []; + for (const annotation of annotations) { + if (annotation.deleted) { + continue; + } + switch (annotation.annotationType) { + case AnnotationEditorType.FREETEXT: + promises.push(FreeTextAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, { + evaluator, + task, + evaluatorOptions: options + })); + break; + case AnnotationEditorType.HIGHLIGHT: + promises.push(HighlightAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, { + evaluatorOptions: options + })); + break; + case AnnotationEditorType.INK: + promises.push(InkAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, { + evaluatorOptions: options + })); + break; + case AnnotationEditorType.STAMP: + if (!options.isOffscreenCanvasSupported) { + break; + } + const image = await imagePromises.get(annotation.bitmapId); + if (image.imageStream) { + const { + imageStream, + smaskStream + } = image; + if (smaskStream) { + imageStream.dict.set("SMask", smaskStream); + } + image.imageRef = new JpegStream(imageStream, imageStream.length); + image.imageStream = image.smaskStream = null; + } + promises.push(StampAnnotation.createNewPrintAnnotation(annotationGlobals, xref, annotation, { + image, + evaluatorOptions: options + })); + break; + } + } + return Promise.all(promises); + } +} +function getRgbColor(color, defaultColor = new Uint8ClampedArray(3)) { + if (!Array.isArray(color)) { + return defaultColor; + } + const rgbColor = defaultColor || new Uint8ClampedArray(3); + switch (color.length) { + case 0: + return null; + case 1: + ColorSpace.singletons.gray.getRgbItem(color, 0, rgbColor, 0); + return rgbColor; + case 3: + ColorSpace.singletons.rgb.getRgbItem(color, 0, rgbColor, 0); + return rgbColor; + case 4: + ColorSpace.singletons.cmyk.getRgbItem(color, 0, rgbColor, 0); + return rgbColor; + default: + return defaultColor; + } +} +function getPdfColorArray(color) { + return Array.from(color, c => c / 255); +} +function getQuadPoints(dict, rect) { + const quadPoints = dict.getArray("QuadPoints"); + if (!Array.isArray(quadPoints) || quadPoints.length === 0 || quadPoints.length % 8 > 0) { + return null; + } + const quadPointsLists = []; + for (let i = 0, ii = quadPoints.length / 8; i < ii; i++) { + let minX = Infinity, + maxX = -Infinity, + minY = Infinity, + maxY = -Infinity; + for (let j = i * 8, jj = i * 8 + 8; j < jj; j += 2) { + const x = quadPoints[j]; + const y = quadPoints[j + 1]; + minX = Math.min(x, minX); + maxX = Math.max(x, maxX); + minY = Math.min(y, minY); + maxY = Math.max(y, maxY); + } + if (rect !== null && (minX < rect[0] || maxX > rect[2] || minY < rect[1] || maxY > rect[3])) { + return null; + } + quadPointsLists.push([{ + x: minX, + y: maxY + }, { + x: maxX, + y: maxY + }, { + x: minX, + y: minY + }, { + x: maxX, + y: minY + }]); + } + return quadPointsLists; +} +function getTransformMatrix(rect, bbox, matrix) { + const [minX, minY, maxX, maxY] = Util.getAxialAlignedBoundingBox(bbox, matrix); + if (minX === maxX || minY === maxY) { + return [1, 0, 0, 1, rect[0], rect[1]]; + } + const xRatio = (rect[2] - rect[0]) / (maxX - minX); + const yRatio = (rect[3] - rect[1]) / (maxY - minY); + return [xRatio, 0, 0, yRatio, rect[0] - minX * xRatio, rect[1] - minY * yRatio]; +} +class Annotation { + constructor(params) { + const { + dict, + xref, + annotationGlobals + } = params; + this.setTitle(dict.get("T")); + this.setContents(dict.get("Contents")); + this.setModificationDate(dict.get("M")); + this.setFlags(dict.get("F")); + this.setRectangle(dict.getArray("Rect")); + this.setColor(dict.getArray("C")); + this.setBorderStyle(dict); + this.setAppearance(dict); + this.setOptionalContent(dict); + const MK = dict.get("MK"); + this.setBorderAndBackgroundColors(MK); + this.setRotation(MK, dict); + this.ref = params.ref instanceof Ref ? params.ref : null; + this._streams = []; + if (this.appearance) { + this._streams.push(this.appearance); + } + const isLocked = !!(this.flags & AnnotationFlag.LOCKED); + const isContentLocked = !!(this.flags & AnnotationFlag.LOCKEDCONTENTS); + if (annotationGlobals.structTreeRoot) { + let structParent = dict.get("StructParent"); + structParent = Number.isInteger(structParent) && structParent >= 0 ? structParent : -1; + annotationGlobals.structTreeRoot.addAnnotationIdToPage(params.pageRef, structParent); + } + this.data = { + annotationFlags: this.flags, + borderStyle: this.borderStyle, + color: this.color, + backgroundColor: this.backgroundColor, + borderColor: this.borderColor, + rotation: this.rotation, + contentsObj: this._contents, + hasAppearance: !!this.appearance, + id: params.id, + modificationDate: this.modificationDate, + rect: this.rectangle, + subtype: params.subtype, + hasOwnCanvas: false, + noRotate: !!(this.flags & AnnotationFlag.NOROTATE), + noHTML: isLocked && isContentLocked + }; + if (params.collectFields) { + const kids = dict.get("Kids"); + if (Array.isArray(kids)) { + const kidIds = []; + for (const kid of kids) { + if (kid instanceof Ref) { + kidIds.push(kid.toString()); + } + } + if (kidIds.length !== 0) { + this.data.kidIds = kidIds; + } + } + this.data.actions = collectActions(xref, dict, AnnotationActionEventType); + this.data.fieldName = this._constructFieldName(dict); + this.data.pageIndex = params.pageIndex; + } + this._isOffscreenCanvasSupported = params.evaluatorOptions.isOffscreenCanvasSupported; + this._fallbackFontDict = null; + this._needAppearances = false; + } + _hasFlag(flags, flag) { + return !!(flags & flag); + } + _isViewable(flags) { + return !this._hasFlag(flags, AnnotationFlag.INVISIBLE) && !this._hasFlag(flags, AnnotationFlag.NOVIEW); + } + _isPrintable(flags) { + return this._hasFlag(flags, AnnotationFlag.PRINT) && !this._hasFlag(flags, AnnotationFlag.HIDDEN) && !this._hasFlag(flags, AnnotationFlag.INVISIBLE); + } + mustBeViewed(annotationStorage, _renderForms) { + const noView = annotationStorage?.get(this.data.id)?.noView; + if (noView !== undefined) { + return !noView; + } + return this.viewable && !this._hasFlag(this.flags, AnnotationFlag.HIDDEN); + } + mustBePrinted(annotationStorage) { + const noPrint = annotationStorage?.get(this.data.id)?.noPrint; + if (noPrint !== undefined) { + return !noPrint; + } + return this.printable; + } + get viewable() { + if (this.data.quadPoints === null) { + return false; + } + if (this.flags === 0) { + return true; + } + return this._isViewable(this.flags); + } + get printable() { + if (this.data.quadPoints === null) { + return false; + } + if (this.flags === 0) { + return false; + } + return this._isPrintable(this.flags); + } + _parseStringHelper(data) { + const str = typeof data === "string" ? stringToPDFString(data) : ""; + const dir = str && bidi(str).dir === "rtl" ? "rtl" : "ltr"; + return { + str, + dir + }; + } + setDefaultAppearance(params) { + const { + dict, + annotationGlobals + } = params; + const defaultAppearance = getInheritableProperty({ + dict, + key: "DA" + }) || annotationGlobals.acroForm.get("DA"); + this._defaultAppearance = typeof defaultAppearance === "string" ? defaultAppearance : ""; + this.data.defaultAppearanceData = parseDefaultAppearance(this._defaultAppearance); + } + setTitle(title) { + this._title = this._parseStringHelper(title); + } + setContents(contents) { + this._contents = this._parseStringHelper(contents); + } + setModificationDate(modificationDate) { + this.modificationDate = typeof modificationDate === "string" ? modificationDate : null; + } + setFlags(flags) { + this.flags = Number.isInteger(flags) && flags > 0 ? flags : 0; + if (this.flags & AnnotationFlag.INVISIBLE && this.constructor.name !== "Annotation") { + this.flags ^= AnnotationFlag.INVISIBLE; + } + } + hasFlag(flag) { + return this._hasFlag(this.flags, flag); + } + setRectangle(rectangle) { + this.rectangle = Array.isArray(rectangle) && rectangle.length === 4 ? Util.normalizeRect(rectangle) : [0, 0, 0, 0]; + } + setColor(color) { + this.color = getRgbColor(color); + } + setLineEndings(lineEndings) { + this.lineEndings = ["None", "None"]; + if (Array.isArray(lineEndings) && lineEndings.length === 2) { + for (let i = 0; i < 2; i++) { + const obj = lineEndings[i]; + if (obj instanceof Name) { + switch (obj.name) { + case "None": + continue; + case "Square": + case "Circle": + case "Diamond": + case "OpenArrow": + case "ClosedArrow": + case "Butt": + case "ROpenArrow": + case "RClosedArrow": + case "Slash": + this.lineEndings[i] = obj.name; + continue; + } + } + warn(`Ignoring invalid lineEnding: ${obj}`); + } + } + } + setRotation(mk, dict) { + this.rotation = 0; + let angle = mk instanceof Dict ? mk.get("R") || 0 : dict.get("Rotate") || 0; + if (Number.isInteger(angle) && angle !== 0) { + angle %= 360; + if (angle < 0) { + angle += 360; + } + if (angle % 90 === 0) { + this.rotation = angle; + } + } + } + setBorderAndBackgroundColors(mk) { + if (mk instanceof Dict) { + this.borderColor = getRgbColor(mk.getArray("BC"), null); + this.backgroundColor = getRgbColor(mk.getArray("BG"), null); + } else { + this.borderColor = this.backgroundColor = null; + } + } + setBorderStyle(borderStyle) { + this.borderStyle = new AnnotationBorderStyle(); + if (!(borderStyle instanceof Dict)) { + return; + } + if (borderStyle.has("BS")) { + const dict = borderStyle.get("BS"); + if (dict instanceof Dict) { + const dictType = dict.get("Type"); + if (!dictType || isName(dictType, "Border")) { + this.borderStyle.setWidth(dict.get("W"), this.rectangle); + this.borderStyle.setStyle(dict.get("S")); + this.borderStyle.setDashArray(dict.getArray("D")); + } + } + } else if (borderStyle.has("Border")) { + const array = borderStyle.getArray("Border"); + if (Array.isArray(array) && array.length >= 3) { + this.borderStyle.setHorizontalCornerRadius(array[0]); + this.borderStyle.setVerticalCornerRadius(array[1]); + this.borderStyle.setWidth(array[2], this.rectangle); + if (array.length === 4) { + this.borderStyle.setDashArray(array[3], true); + } + } + } else { + this.borderStyle.setWidth(0); + } + } + setAppearance(dict) { + this.appearance = null; + const appearanceStates = dict.get("AP"); + if (!(appearanceStates instanceof Dict)) { + return; + } + const normalAppearanceState = appearanceStates.get("N"); + if (normalAppearanceState instanceof BaseStream) { + this.appearance = normalAppearanceState; + return; + } + if (!(normalAppearanceState instanceof Dict)) { + return; + } + const as = dict.get("AS"); + if (!(as instanceof Name) || !normalAppearanceState.has(as.name)) { + return; + } + const appearance = normalAppearanceState.get(as.name); + if (appearance instanceof BaseStream) { + this.appearance = appearance; + } + } + setOptionalContent(dict) { + this.oc = null; + const oc = dict.get("OC"); + if (oc instanceof Name) { + warn("setOptionalContent: Support for /Name-entry is not implemented."); + } else if (oc instanceof Dict) { + this.oc = oc; + } + } + loadResources(keys, appearance) { + return appearance.dict.getAsync("Resources").then(resources => { + if (!resources) { + return undefined; + } + const objectLoader = new ObjectLoader(resources, keys, resources.xref); + return objectLoader.load().then(function () { + return resources; + }); + }); + } + async getOperatorList(evaluator, task, intent, renderForms, annotationStorage) { + const data = this.data; + let appearance = this.appearance; + const isUsingOwnCanvas = !!(this.data.hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY); + if (!appearance) { + if (!isUsingOwnCanvas) { + return { + opList: new OperatorList(), + separateForm: false, + separateCanvas: false + }; + } + appearance = new StringStream(""); + appearance.dict = new Dict(); + } + const appearanceDict = appearance.dict; + const resources = await this.loadResources(["ExtGState", "ColorSpace", "Pattern", "Shading", "XObject", "Font"], appearance); + const bbox = appearanceDict.getArray("BBox") || [0, 0, 1, 1]; + const matrix = appearanceDict.getArray("Matrix") || [1, 0, 0, 1, 0, 0]; + const transform = getTransformMatrix(data.rect, bbox, matrix); + const opList = new OperatorList(); + let optionalContent; + if (this.oc) { + optionalContent = await evaluator.parseMarkedContentProps(this.oc, null); + } + if (optionalContent !== undefined) { + opList.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]); + } + opList.addOp(OPS.beginAnnotation, [data.id, data.rect, transform, matrix, isUsingOwnCanvas]); + await evaluator.getOperatorList({ + stream: appearance, + task, + resources, + operatorList: opList, + fallbackFontDict: this._fallbackFontDict + }); + opList.addOp(OPS.endAnnotation, []); + if (optionalContent !== undefined) { + opList.addOp(OPS.endMarkedContent, []); + } + this.reset(); + return { + opList, + separateForm: false, + separateCanvas: isUsingOwnCanvas + }; + } + async save(evaluator, task, annotationStorage) { + return null; + } + get hasTextContent() { + return false; + } + async extractTextContent(evaluator, task, viewBox) { + if (!this.appearance) { + return; + } + const resources = await this.loadResources(["ExtGState", "Font", "Properties", "XObject"], this.appearance); + const text = []; + const buffer = []; + let firstPosition = null; + const sink = { + desiredSize: Math.Infinity, + ready: true, + enqueue(chunk, size) { + for (const item of chunk.items) { + if (item.str === undefined) { + continue; + } + firstPosition ||= item.transform.slice(-2); + buffer.push(item.str); + if (item.hasEOL) { + text.push(buffer.join("")); + buffer.length = 0; + } + } + } + }; + await evaluator.getTextContent({ + stream: this.appearance, + task, + resources, + includeMarkedContent: true, + sink, + viewBox + }); + this.reset(); + if (buffer.length) { + text.push(buffer.join("")); + } + if (text.length > 1 || text[0]) { + const appearanceDict = this.appearance.dict; + const bbox = appearanceDict.getArray("BBox") || [0, 0, 1, 1]; + const matrix = appearanceDict.getArray("Matrix") || [1, 0, 0, 1, 0, 0]; + const rect = this.data.rect; + const transform = getTransformMatrix(rect, bbox, matrix); + transform[4] -= rect[0]; + transform[5] -= rect[1]; + firstPosition = Util.applyTransform(firstPosition, transform); + firstPosition = Util.applyTransform(firstPosition, matrix); + this.data.textPosition = firstPosition; + this.data.textContent = text; + } + } + getFieldObject() { + if (this.data.kidIds) { + return { + id: this.data.id, + actions: this.data.actions, + name: this.data.fieldName, + strokeColor: this.data.borderColor, + fillColor: this.data.backgroundColor, + type: "", + kidIds: this.data.kidIds, + page: this.data.pageIndex, + rotation: this.rotation + }; + } + return null; + } + reset() { + for (const stream of this._streams) { + stream.reset(); + } + } + _constructFieldName(dict) { + if (!dict.has("T") && !dict.has("Parent")) { + warn("Unknown field name, falling back to empty field name."); + return ""; + } + if (!dict.has("Parent")) { + return stringToPDFString(dict.get("T")); + } + const fieldName = []; + if (dict.has("T")) { + fieldName.unshift(stringToPDFString(dict.get("T"))); + } + let loopDict = dict; + const visited = new RefSet(); + if (dict.objId) { + visited.put(dict.objId); + } + while (loopDict.has("Parent")) { + loopDict = loopDict.get("Parent"); + if (!(loopDict instanceof Dict) || loopDict.objId && visited.has(loopDict.objId)) { + break; + } + if (loopDict.objId) { + visited.put(loopDict.objId); + } + if (loopDict.has("T")) { + fieldName.unshift(stringToPDFString(loopDict.get("T"))); + } + } + return fieldName.join("."); + } +} +class AnnotationBorderStyle { + constructor() { + this.width = 1; + this.style = AnnotationBorderStyleType.SOLID; + this.dashArray = [3]; + this.horizontalCornerRadius = 0; + this.verticalCornerRadius = 0; + } + setWidth(width, rect = [0, 0, 0, 0]) { + if (width instanceof Name) { + this.width = 0; + return; + } + if (typeof width === "number") { + if (width > 0) { + const maxWidth = (rect[2] - rect[0]) / 2; + const maxHeight = (rect[3] - rect[1]) / 2; + if (maxWidth > 0 && maxHeight > 0 && (width > maxWidth || width > maxHeight)) { + warn(`AnnotationBorderStyle.setWidth - ignoring width: ${width}`); + width = 1; + } + } + this.width = width; + } + } + setStyle(style) { + if (!(style instanceof Name)) { + return; + } + switch (style.name) { + case "S": + this.style = AnnotationBorderStyleType.SOLID; + break; + case "D": + this.style = AnnotationBorderStyleType.DASHED; + break; + case "B": + this.style = AnnotationBorderStyleType.BEVELED; + break; + case "I": + this.style = AnnotationBorderStyleType.INSET; + break; + case "U": + this.style = AnnotationBorderStyleType.UNDERLINE; + break; + default: + break; + } + } + setDashArray(dashArray, forceStyle = false) { + if (Array.isArray(dashArray) && dashArray.length > 0) { + let isValid = true; + let allZeros = true; + for (const element of dashArray) { + const validNumber = +element >= 0; + if (!validNumber) { + isValid = false; + break; + } else if (element > 0) { + allZeros = false; + } + } + if (isValid && !allZeros) { + this.dashArray = dashArray; + if (forceStyle) { + this.setStyle(Name.get("D")); + } + } else { + this.width = 0; + } + } else if (dashArray) { + this.width = 0; + } + } + setHorizontalCornerRadius(radius) { + if (Number.isInteger(radius)) { + this.horizontalCornerRadius = radius; + } + } + setVerticalCornerRadius(radius) { + if (Number.isInteger(radius)) { + this.verticalCornerRadius = radius; + } + } +} +class MarkupAnnotation extends Annotation { + constructor(params) { + super(params); + const { + dict + } = params; + if (dict.has("IRT")) { + const rawIRT = dict.getRaw("IRT"); + this.data.inReplyTo = rawIRT instanceof Ref ? rawIRT.toString() : null; + const rt = dict.get("RT"); + this.data.replyType = rt instanceof Name ? rt.name : AnnotationReplyType.REPLY; + } + let popupRef = null; + if (this.data.replyType === AnnotationReplyType.GROUP) { + const parent = dict.get("IRT"); + this.setTitle(parent.get("T")); + this.data.titleObj = this._title; + this.setContents(parent.get("Contents")); + this.data.contentsObj = this._contents; + if (!parent.has("CreationDate")) { + this.data.creationDate = null; + } else { + this.setCreationDate(parent.get("CreationDate")); + this.data.creationDate = this.creationDate; + } + if (!parent.has("M")) { + this.data.modificationDate = null; + } else { + this.setModificationDate(parent.get("M")); + this.data.modificationDate = this.modificationDate; + } + popupRef = parent.getRaw("Popup"); + if (!parent.has("C")) { + this.data.color = null; + } else { + this.setColor(parent.getArray("C")); + this.data.color = this.color; + } + } else { + this.data.titleObj = this._title; + this.setCreationDate(dict.get("CreationDate")); + this.data.creationDate = this.creationDate; + popupRef = dict.getRaw("Popup"); + if (!dict.has("C")) { + this.data.color = null; + } + } + this.data.popupRef = popupRef instanceof Ref ? popupRef.toString() : null; + if (dict.has("RC")) { + this.data.richText = XFAFactory.getRichTextAsHtml(dict.get("RC")); + } + } + setCreationDate(creationDate) { + this.creationDate = typeof creationDate === "string" ? creationDate : null; + } + _setDefaultAppearance({ + xref, + extra, + strokeColor, + fillColor, + blendMode, + strokeAlpha, + fillAlpha, + pointsCallback + }) { + let minX = Number.MAX_VALUE; + let minY = Number.MAX_VALUE; + let maxX = Number.MIN_VALUE; + let maxY = Number.MIN_VALUE; + const buffer = ["q"]; + if (extra) { + buffer.push(extra); + } + if (strokeColor) { + buffer.push(`${strokeColor[0]} ${strokeColor[1]} ${strokeColor[2]} RG`); + } + if (fillColor) { + buffer.push(`${fillColor[0]} ${fillColor[1]} ${fillColor[2]} rg`); + } + let pointsArray = this.data.quadPoints; + if (!pointsArray) { + pointsArray = [[{ + x: this.rectangle[0], + y: this.rectangle[3] + }, { + x: this.rectangle[2], + y: this.rectangle[3] + }, { + x: this.rectangle[0], + y: this.rectangle[1] + }, { + x: this.rectangle[2], + y: this.rectangle[1] + }]]; + } + for (const points of pointsArray) { + const [mX, MX, mY, MY] = pointsCallback(buffer, points); + minX = Math.min(minX, mX); + maxX = Math.max(maxX, MX); + minY = Math.min(minY, mY); + maxY = Math.max(maxY, MY); + } + buffer.push("Q"); + const formDict = new Dict(xref); + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("Subtype", Name.get("Form")); + const appearanceStream = new StringStream(buffer.join(" ")); + appearanceStream.dict = appearanceStreamDict; + formDict.set("Fm0", appearanceStream); + const gsDict = new Dict(xref); + if (blendMode) { + gsDict.set("BM", Name.get(blendMode)); + } + if (typeof strokeAlpha === "number") { + gsDict.set("CA", strokeAlpha); + } + if (typeof fillAlpha === "number") { + gsDict.set("ca", fillAlpha); + } + const stateDict = new Dict(xref); + stateDict.set("GS0", gsDict); + const resources = new Dict(xref); + resources.set("ExtGState", stateDict); + resources.set("XObject", formDict); + const appearanceDict = new Dict(xref); + appearanceDict.set("Resources", resources); + const bbox = this.data.rect = [minX, minY, maxX, maxY]; + appearanceDict.set("BBox", bbox); + this.appearance = new StringStream("/GS0 gs /Fm0 Do"); + this.appearance.dict = appearanceDict; + this._streams.push(this.appearance, appearanceStream); + } + static async createNewAnnotation(xref, annotation, dependencies, params) { + const annotationRef = annotation.ref ||= xref.getNewTemporaryRef(); + const ap = await this.createNewAppearanceStream(annotation, xref, params); + const buffer = []; + let annotationDict; + if (ap) { + const apRef = xref.getNewTemporaryRef(); + annotationDict = this.createNewDict(annotation, xref, { + apRef + }); + await writeObject(apRef, ap, buffer, xref); + dependencies.push({ + ref: apRef, + data: buffer.join("") + }); + } else { + annotationDict = this.createNewDict(annotation, xref, {}); + } + if (Number.isInteger(annotation.parentTreeId)) { + annotationDict.set("StructParent", annotation.parentTreeId); + } + buffer.length = 0; + await writeObject(annotationRef, annotationDict, buffer, xref); + return { + ref: annotationRef, + data: buffer.join("") + }; + } + static async createNewPrintAnnotation(annotationGlobals, xref, annotation, params) { + const ap = await this.createNewAppearanceStream(annotation, xref, params); + const annotationDict = this.createNewDict(annotation, xref, { + ap + }); + const newAnnotation = new this.prototype.constructor({ + dict: annotationDict, + xref, + annotationGlobals, + evaluatorOptions: params.evaluatorOptions + }); + if (annotation.ref) { + newAnnotation.ref = newAnnotation.refToReplace = annotation.ref; + } + return newAnnotation; + } +} +class WidgetAnnotation extends Annotation { + constructor(params) { + super(params); + const { + dict, + xref, + annotationGlobals + } = params; + const data = this.data; + this._needAppearances = params.needAppearances; + data.annotationType = AnnotationType.WIDGET; + if (data.fieldName === undefined) { + data.fieldName = this._constructFieldName(dict); + } + if (data.actions === undefined) { + data.actions = collectActions(xref, dict, AnnotationActionEventType); + } + let fieldValue = getInheritableProperty({ + dict, + key: "V", + getArray: true + }); + data.fieldValue = this._decodeFormValue(fieldValue); + const defaultFieldValue = getInheritableProperty({ + dict, + key: "DV", + getArray: true + }); + data.defaultFieldValue = this._decodeFormValue(defaultFieldValue); + if (fieldValue === undefined && annotationGlobals.xfaDatasets) { + const path = this._title.str; + if (path) { + this._hasValueFromXFA = true; + data.fieldValue = fieldValue = annotationGlobals.xfaDatasets.getValue(path); + } + } + if (fieldValue === undefined && data.defaultFieldValue !== null) { + data.fieldValue = data.defaultFieldValue; + } + data.alternativeText = stringToPDFString(dict.get("TU") || ""); + this.setDefaultAppearance(params); + data.hasAppearance ||= this._needAppearances && data.fieldValue !== undefined && data.fieldValue !== null; + const fieldType = getInheritableProperty({ + dict, + key: "FT" + }); + data.fieldType = fieldType instanceof Name ? fieldType.name : null; + const localResources = getInheritableProperty({ + dict, + key: "DR" + }); + const acroFormResources = annotationGlobals.acroForm.get("DR"); + const appearanceResources = this.appearance?.dict.get("Resources"); + this._fieldResources = { + localResources, + acroFormResources, + appearanceResources, + mergedResources: Dict.merge({ + xref, + dictArray: [localResources, appearanceResources, acroFormResources], + mergeSubDicts: true + }) + }; + data.fieldFlags = getInheritableProperty({ + dict, + key: "Ff" + }); + if (!Number.isInteger(data.fieldFlags) || data.fieldFlags < 0) { + data.fieldFlags = 0; + } + data.readOnly = this.hasFieldFlag(AnnotationFieldFlag.READONLY); + data.required = this.hasFieldFlag(AnnotationFieldFlag.REQUIRED); + data.hidden = this._hasFlag(data.annotationFlags, AnnotationFlag.HIDDEN) || this._hasFlag(data.annotationFlags, AnnotationFlag.NOVIEW); + } + _decodeFormValue(formValue) { + if (Array.isArray(formValue)) { + return formValue.filter(item => typeof item === "string").map(item => stringToPDFString(item)); + } else if (formValue instanceof Name) { + return stringToPDFString(formValue.name); + } else if (typeof formValue === "string") { + return stringToPDFString(formValue); + } + return null; + } + hasFieldFlag(flag) { + return !!(this.data.fieldFlags & flag); + } + _isViewable(flags) { + return true; + } + mustBeViewed(annotationStorage, renderForms) { + if (renderForms) { + return this.viewable; + } + return super.mustBeViewed(annotationStorage, renderForms) && !this._hasFlag(this.flags, AnnotationFlag.NOVIEW); + } + getRotationMatrix(annotationStorage) { + let rotation = annotationStorage?.get(this.data.id)?.rotation; + if (rotation === undefined) { + rotation = this.rotation; + } + if (rotation === 0) { + return IDENTITY_MATRIX; + } + const width = this.data.rect[2] - this.data.rect[0]; + const height = this.data.rect[3] - this.data.rect[1]; + return getRotationMatrix(rotation, width, height); + } + getBorderAndBackgroundAppearances(annotationStorage) { + let rotation = annotationStorage?.get(this.data.id)?.rotation; + if (rotation === undefined) { + rotation = this.rotation; + } + if (!this.backgroundColor && !this.borderColor) { + return ""; + } + const width = this.data.rect[2] - this.data.rect[0]; + const height = this.data.rect[3] - this.data.rect[1]; + const rect = rotation === 0 || rotation === 180 ? `0 0 ${width} ${height} re` : `0 0 ${height} ${width} re`; + let str = ""; + if (this.backgroundColor) { + str = `${getPdfColor(this.backgroundColor, true)} ${rect} f `; + } + if (this.borderColor) { + const borderWidth = this.borderStyle.width || 1; + str += `${borderWidth} w ${getPdfColor(this.borderColor, false)} ${rect} S `; + } + return str; + } + async getOperatorList(evaluator, task, intent, renderForms, annotationStorage) { + if (renderForms && !(this instanceof SignatureWidgetAnnotation) && !this.data.noHTML && !this.data.hasOwnCanvas) { + return { + opList: new OperatorList(), + separateForm: true, + separateCanvas: false + }; + } + if (!this._hasText) { + return super.getOperatorList(evaluator, task, intent, renderForms, annotationStorage); + } + const content = await this._getAppearance(evaluator, task, intent, annotationStorage); + if (this.appearance && content === null) { + return super.getOperatorList(evaluator, task, intent, renderForms, annotationStorage); + } + const opList = new OperatorList(); + if (!this._defaultAppearance || content === null) { + return { + opList, + separateForm: false, + separateCanvas: false + }; + } + const isUsingOwnCanvas = !!(this.data.hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY); + const matrix = [1, 0, 0, 1, 0, 0]; + const bbox = [0, 0, this.data.rect[2] - this.data.rect[0], this.data.rect[3] - this.data.rect[1]]; + const transform = getTransformMatrix(this.data.rect, bbox, matrix); + let optionalContent; + if (this.oc) { + optionalContent = await evaluator.parseMarkedContentProps(this.oc, null); + } + if (optionalContent !== undefined) { + opList.addOp(OPS.beginMarkedContentProps, ["OC", optionalContent]); + } + opList.addOp(OPS.beginAnnotation, [this.data.id, this.data.rect, transform, this.getRotationMatrix(annotationStorage), isUsingOwnCanvas]); + const stream = new StringStream(content); + await evaluator.getOperatorList({ + stream, + task, + resources: this._fieldResources.mergedResources, + operatorList: opList + }); + opList.addOp(OPS.endAnnotation, []); + if (optionalContent !== undefined) { + opList.addOp(OPS.endMarkedContent, []); + } + return { + opList, + separateForm: false, + separateCanvas: isUsingOwnCanvas + }; + } + _getMKDict(rotation) { + const mk = new Dict(null); + if (rotation) { + mk.set("R", rotation); + } + if (this.borderColor) { + mk.set("BC", getPdfColorArray(this.borderColor)); + } + if (this.backgroundColor) { + mk.set("BG", getPdfColorArray(this.backgroundColor)); + } + return mk.size > 0 ? mk : null; + } + amendSavedDict(annotationStorage, dict) {} + async save(evaluator, task, annotationStorage) { + const storageEntry = annotationStorage?.get(this.data.id); + let value = storageEntry?.value, + rotation = storageEntry?.rotation; + if (value === this.data.fieldValue || value === undefined) { + if (!this._hasValueFromXFA && rotation === undefined) { + return null; + } + value ||= this.data.fieldValue; + } + if (rotation === undefined && !this._hasValueFromXFA && Array.isArray(value) && Array.isArray(this.data.fieldValue) && value.length === this.data.fieldValue.length && value.every((x, i) => x === this.data.fieldValue[i])) { + return null; + } + if (rotation === undefined) { + rotation = this.rotation; + } + let appearance = null; + if (!this._needAppearances) { + appearance = await this._getAppearance(evaluator, task, RenderingIntentFlag.SAVE, annotationStorage); + if (appearance === null) { + return null; + } + } else {} + let needAppearances = false; + if (appearance?.needAppearances) { + needAppearances = true; + appearance = null; + } + const { + xref + } = evaluator; + const originalDict = xref.fetchIfRef(this.ref); + if (!(originalDict instanceof Dict)) { + return null; + } + const dict = new Dict(xref); + for (const key of originalDict.getKeys()) { + if (key !== "AP") { + dict.set(key, originalDict.getRaw(key)); + } + } + const xfa = { + path: this.data.fieldName, + value + }; + const encoder = val => { + return isAscii(val) ? val : stringToUTF16String(val, true); + }; + dict.set("V", Array.isArray(value) ? value.map(encoder) : encoder(value)); + this.amendSavedDict(annotationStorage, dict); + const maybeMK = this._getMKDict(rotation); + if (maybeMK) { + dict.set("MK", maybeMK); + } + const buffer = []; + const changes = [{ + ref: this.ref, + data: "", + xfa, + needAppearances + }]; + if (appearance !== null) { + const newRef = xref.getNewTemporaryRef(); + const AP = new Dict(xref); + dict.set("AP", AP); + AP.set("N", newRef); + const resources = this._getSaveFieldResources(xref); + const appearanceStream = new StringStream(appearance); + const appearanceDict = appearanceStream.dict = new Dict(xref); + appearanceDict.set("Subtype", Name.get("Form")); + appearanceDict.set("Resources", resources); + appearanceDict.set("BBox", [0, 0, this.data.rect[2] - this.data.rect[0], this.data.rect[3] - this.data.rect[1]]); + const rotationMatrix = this.getRotationMatrix(annotationStorage); + if (rotationMatrix !== IDENTITY_MATRIX) { + appearanceDict.set("Matrix", rotationMatrix); + } + await writeObject(newRef, appearanceStream, buffer, xref); + changes.push({ + ref: newRef, + data: buffer.join(""), + xfa: null, + needAppearances: false + }); + buffer.length = 0; + } + dict.set("M", `D:${getModificationDate()}`); + await writeObject(this.ref, dict, buffer, xref); + changes[0].data = buffer.join(""); + return changes; + } + async _getAppearance(evaluator, task, intent, annotationStorage) { + const isPassword = this.hasFieldFlag(AnnotationFieldFlag.PASSWORD); + if (isPassword) { + return null; + } + const storageEntry = annotationStorage?.get(this.data.id); + let value, rotation; + if (storageEntry) { + value = storageEntry.formattedValue || storageEntry.value; + rotation = storageEntry.rotation; + } + if (rotation === undefined && value === undefined && !this._needAppearances) { + if (!this._hasValueFromXFA || this.appearance) { + return null; + } + } + const colors = this.getBorderAndBackgroundAppearances(annotationStorage); + if (value === undefined) { + value = this.data.fieldValue; + if (!value) { + return `/Tx BMC q ${colors}Q EMC`; + } + } + if (Array.isArray(value) && value.length === 1) { + value = value[0]; + } + assert(typeof value === "string", "Expected `value` to be a string."); + value = value.trim(); + if (this.data.combo) { + const option = this.data.options.find(({ + exportValue + }) => value === exportValue); + value = option?.displayValue || value; + } + if (value === "") { + return `/Tx BMC q ${colors}Q EMC`; + } + if (rotation === undefined) { + rotation = this.rotation; + } + let lineCount = -1; + let lines; + if (this.data.multiLine) { + lines = value.split(/\r\n?|\n/).map(line => line.normalize("NFC")); + lineCount = lines.length; + } else { + lines = [value.replace(/\r\n?|\n/, "").normalize("NFC")]; + } + const defaultPadding = 1; + const defaultHPadding = 2; + let totalHeight = this.data.rect[3] - this.data.rect[1]; + let totalWidth = this.data.rect[2] - this.data.rect[0]; + if (rotation === 90 || rotation === 270) { + [totalWidth, totalHeight] = [totalHeight, totalWidth]; + } + if (!this._defaultAppearance) { + this.data.defaultAppearanceData = parseDefaultAppearance(this._defaultAppearance = "/Helvetica 0 Tf 0 g"); + } + let font = await WidgetAnnotation._getFontData(evaluator, task, this.data.defaultAppearanceData, this._fieldResources.mergedResources); + let defaultAppearance, fontSize, lineHeight; + const encodedLines = []; + let encodingError = false; + for (const line of lines) { + const encodedString = font.encodeString(line); + if (encodedString.length > 1) { + encodingError = true; + } + encodedLines.push(encodedString.join("")); + } + if (encodingError && intent & RenderingIntentFlag.SAVE) { + return { + needAppearances: true + }; + } + if (encodingError && this._isOffscreenCanvasSupported) { + const fontFamily = this.data.comb ? "monospace" : "sans-serif"; + const fakeUnicodeFont = new FakeUnicodeFont(evaluator.xref, fontFamily); + const resources = fakeUnicodeFont.createFontResources(lines.join("")); + const newFont = resources.getRaw("Font"); + if (this._fieldResources.mergedResources.has("Font")) { + const oldFont = this._fieldResources.mergedResources.get("Font"); + for (const key of newFont.getKeys()) { + oldFont.set(key, newFont.getRaw(key)); + } + } else { + this._fieldResources.mergedResources.set("Font", newFont); + } + const fontName = fakeUnicodeFont.fontName.name; + font = await WidgetAnnotation._getFontData(evaluator, task, { + fontName, + fontSize: 0 + }, resources); + for (let i = 0, ii = encodedLines.length; i < ii; i++) { + encodedLines[i] = stringToUTF16String(lines[i]); + } + const savedDefaultAppearance = Object.assign(Object.create(null), this.data.defaultAppearanceData); + this.data.defaultAppearanceData.fontSize = 0; + this.data.defaultAppearanceData.fontName = fontName; + [defaultAppearance, fontSize, lineHeight] = this._computeFontSize(totalHeight - 2 * defaultPadding, totalWidth - 2 * defaultHPadding, value, font, lineCount); + this.data.defaultAppearanceData = savedDefaultAppearance; + } else { + if (!this._isOffscreenCanvasSupported) { + warn("_getAppearance: OffscreenCanvas is not supported, annotation may not render correctly."); + } + [defaultAppearance, fontSize, lineHeight] = this._computeFontSize(totalHeight - 2 * defaultPadding, totalWidth - 2 * defaultHPadding, value, font, lineCount); + } + let descent = font.descent; + if (isNaN(descent)) { + descent = BASELINE_FACTOR * lineHeight; + } else { + descent = Math.max(BASELINE_FACTOR * lineHeight, Math.abs(descent) * fontSize); + } + const defaultVPadding = Math.min(Math.floor((totalHeight - fontSize) / 2), defaultPadding); + const alignment = this.data.textAlignment; + if (this.data.multiLine) { + return this._getMultilineAppearance(defaultAppearance, encodedLines, font, fontSize, totalWidth, totalHeight, alignment, defaultHPadding, defaultVPadding, descent, lineHeight, annotationStorage); + } + if (this.data.comb) { + return this._getCombAppearance(defaultAppearance, font, encodedLines[0], fontSize, totalWidth, totalHeight, defaultHPadding, defaultVPadding, descent, lineHeight, annotationStorage); + } + const bottomPadding = defaultVPadding + descent; + if (alignment === 0 || alignment > 2) { + return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 ${numberToString(defaultHPadding)} ${numberToString(bottomPadding)} Tm (${escapeString(encodedLines[0])}) Tj` + " ET Q EMC"; + } + const prevInfo = { + shift: 0 + }; + const renderedText = this._renderText(encodedLines[0], font, fontSize, totalWidth, alignment, prevInfo, defaultHPadding, bottomPadding); + return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 0 0 Tm ${renderedText}` + " ET Q EMC"; + } + static async _getFontData(evaluator, task, appearanceData, resources) { + const operatorList = new OperatorList(); + const initialState = { + font: null, + clone() { + return this; + } + }; + const { + fontName, + fontSize + } = appearanceData; + await evaluator.handleSetFont(resources, [fontName && Name.get(fontName), fontSize], null, operatorList, task, initialState, null); + return initialState.font; + } + _getTextWidth(text, font) { + return font.charsToGlyphs(text).reduce((width, glyph) => width + glyph.width, 0) / 1000; + } + _computeFontSize(height, width, text, font, lineCount) { + let { + fontSize + } = this.data.defaultAppearanceData; + let lineHeight = (fontSize || 12) * LINE_FACTOR, + numberOfLines = Math.round(height / lineHeight); + if (!fontSize) { + const roundWithTwoDigits = x => Math.floor(x * 100) / 100; + if (lineCount === -1) { + const textWidth = this._getTextWidth(text, font); + fontSize = roundWithTwoDigits(Math.min(height / LINE_FACTOR, textWidth > width ? width / textWidth : Infinity)); + numberOfLines = 1; + } else { + const lines = text.split(/\r\n?|\n/); + const cachedLines = []; + for (const line of lines) { + const encoded = font.encodeString(line).join(""); + const glyphs = font.charsToGlyphs(encoded); + const positions = font.getCharPositions(encoded); + cachedLines.push({ + line: encoded, + glyphs, + positions + }); + } + const isTooBig = fsize => { + let totalHeight = 0; + for (const cache of cachedLines) { + const chunks = this._splitLine(null, font, fsize, width, cache); + totalHeight += chunks.length * fsize; + if (totalHeight > height) { + return true; + } + } + return false; + }; + numberOfLines = Math.max(numberOfLines, lineCount); + while (true) { + lineHeight = height / numberOfLines; + fontSize = roundWithTwoDigits(lineHeight / LINE_FACTOR); + if (isTooBig(fontSize)) { + numberOfLines++; + continue; + } + break; + } + } + const { + fontName, + fontColor + } = this.data.defaultAppearanceData; + this._defaultAppearance = createDefaultAppearance({ + fontSize, + fontName, + fontColor + }); + } + return [this._defaultAppearance, fontSize, height / numberOfLines]; + } + _renderText(text, font, fontSize, totalWidth, alignment, prevInfo, hPadding, vPadding) { + let shift; + if (alignment === 1) { + const width = this._getTextWidth(text, font) * fontSize; + shift = (totalWidth - width) / 2; + } else if (alignment === 2) { + const width = this._getTextWidth(text, font) * fontSize; + shift = totalWidth - width - hPadding; + } else { + shift = hPadding; + } + const shiftStr = numberToString(shift - prevInfo.shift); + prevInfo.shift = shift; + vPadding = numberToString(vPadding); + return `${shiftStr} ${vPadding} Td (${escapeString(text)}) Tj`; + } + _getSaveFieldResources(xref) { + const { + localResources, + appearanceResources, + acroFormResources + } = this._fieldResources; + const fontName = this.data.defaultAppearanceData?.fontName; + if (!fontName) { + return localResources || Dict.empty; + } + for (const resources of [localResources, appearanceResources]) { + if (resources instanceof Dict) { + const localFont = resources.get("Font"); + if (localFont instanceof Dict && localFont.has(fontName)) { + return resources; + } + } + } + if (acroFormResources instanceof Dict) { + const acroFormFont = acroFormResources.get("Font"); + if (acroFormFont instanceof Dict && acroFormFont.has(fontName)) { + const subFontDict = new Dict(xref); + subFontDict.set(fontName, acroFormFont.getRaw(fontName)); + const subResourcesDict = new Dict(xref); + subResourcesDict.set("Font", subFontDict); + return Dict.merge({ + xref, + dictArray: [subResourcesDict, localResources], + mergeSubDicts: true + }); + } + } + return localResources || Dict.empty; + } + getFieldObject() { + return null; + } +} +class TextWidgetAnnotation extends WidgetAnnotation { + constructor(params) { + super(params); + this.data.hasOwnCanvas = this.data.readOnly && !this.data.noHTML; + this._hasText = true; + const dict = params.dict; + if (typeof this.data.fieldValue !== "string") { + this.data.fieldValue = ""; + } + let alignment = getInheritableProperty({ + dict, + key: "Q" + }); + if (!Number.isInteger(alignment) || alignment < 0 || alignment > 2) { + alignment = null; + } + this.data.textAlignment = alignment; + let maximumLength = getInheritableProperty({ + dict, + key: "MaxLen" + }); + if (!Number.isInteger(maximumLength) || maximumLength < 0) { + maximumLength = 0; + } + this.data.maxLen = maximumLength; + this.data.multiLine = this.hasFieldFlag(AnnotationFieldFlag.MULTILINE); + this.data.comb = this.hasFieldFlag(AnnotationFieldFlag.COMB) && !this.hasFieldFlag(AnnotationFieldFlag.MULTILINE) && !this.hasFieldFlag(AnnotationFieldFlag.PASSWORD) && !this.hasFieldFlag(AnnotationFieldFlag.FILESELECT) && this.data.maxLen !== 0; + this.data.doNotScroll = this.hasFieldFlag(AnnotationFieldFlag.DONOTSCROLL); + } + get hasTextContent() { + return !!this.appearance && !this._needAppearances; + } + _getCombAppearance(defaultAppearance, font, text, fontSize, width, height, hPadding, vPadding, descent, lineHeight, annotationStorage) { + const combWidth = width / this.data.maxLen; + const colors = this.getBorderAndBackgroundAppearances(annotationStorage); + const buf = []; + const positions = font.getCharPositions(text); + for (const [start, end] of positions) { + buf.push(`(${escapeString(text.substring(start, end))}) Tj`); + } + const renderedComb = buf.join(` ${numberToString(combWidth)} 0 Td `); + return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 ${numberToString(hPadding)} ${numberToString(vPadding + descent)} Tm ${renderedComb}` + " ET Q EMC"; + } + _getMultilineAppearance(defaultAppearance, lines, font, fontSize, width, height, alignment, hPadding, vPadding, descent, lineHeight, annotationStorage) { + const buf = []; + const totalWidth = width - 2 * hPadding; + const prevInfo = { + shift: 0 + }; + for (let i = 0, ii = lines.length; i < ii; i++) { + const line = lines[i]; + const chunks = this._splitLine(line, font, fontSize, totalWidth); + for (let j = 0, jj = chunks.length; j < jj; j++) { + const chunk = chunks[j]; + const vShift = i === 0 && j === 0 ? -vPadding - (lineHeight - descent) : -lineHeight; + buf.push(this._renderText(chunk, font, fontSize, width, alignment, prevInfo, hPadding, vShift)); + } + } + const colors = this.getBorderAndBackgroundAppearances(annotationStorage); + const renderedText = buf.join("\n"); + return `/Tx BMC q ${colors}BT ` + defaultAppearance + ` 1 0 0 1 0 ${numberToString(height)} Tm ${renderedText}` + " ET Q EMC"; + } + _splitLine(line, font, fontSize, width, cache = {}) { + line = cache.line || line; + const glyphs = cache.glyphs || font.charsToGlyphs(line); + if (glyphs.length <= 1) { + return [line]; + } + const positions = cache.positions || font.getCharPositions(line); + const scale = fontSize / 1000; + const chunks = []; + let lastSpacePosInStringStart = -1, + lastSpacePosInStringEnd = -1, + lastSpacePos = -1, + startChunk = 0, + currentWidth = 0; + for (let i = 0, ii = glyphs.length; i < ii; i++) { + const [start, end] = positions[i]; + const glyph = glyphs[i]; + const glyphWidth = glyph.width * scale; + if (glyph.unicode === " ") { + if (currentWidth + glyphWidth > width) { + chunks.push(line.substring(startChunk, start)); + startChunk = start; + currentWidth = glyphWidth; + lastSpacePosInStringStart = -1; + lastSpacePos = -1; + } else { + currentWidth += glyphWidth; + lastSpacePosInStringStart = start; + lastSpacePosInStringEnd = end; + lastSpacePos = i; + } + } else if (currentWidth + glyphWidth > width) { + if (lastSpacePosInStringStart !== -1) { + chunks.push(line.substring(startChunk, lastSpacePosInStringEnd)); + startChunk = lastSpacePosInStringEnd; + i = lastSpacePos + 1; + lastSpacePosInStringStart = -1; + currentWidth = 0; + } else { + chunks.push(line.substring(startChunk, start)); + startChunk = start; + currentWidth = glyphWidth; + } + } else { + currentWidth += glyphWidth; + } + } + if (startChunk < line.length) { + chunks.push(line.substring(startChunk, line.length)); + } + return chunks; + } + getFieldObject() { + return { + id: this.data.id, + value: this.data.fieldValue, + defaultValue: this.data.defaultFieldValue || "", + multiline: this.data.multiLine, + password: this.hasFieldFlag(AnnotationFieldFlag.PASSWORD), + charLimit: this.data.maxLen, + comb: this.data.comb, + editable: !this.data.readOnly, + hidden: this.data.hidden, + name: this.data.fieldName, + rect: this.data.rect, + actions: this.data.actions, + page: this.data.pageIndex, + strokeColor: this.data.borderColor, + fillColor: this.data.backgroundColor, + rotation: this.rotation, + type: "text" + }; + } +} +class ButtonWidgetAnnotation extends WidgetAnnotation { + constructor(params) { + super(params); + this.checkedAppearance = null; + this.uncheckedAppearance = null; + this.data.checkBox = !this.hasFieldFlag(AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON); + this.data.radioButton = this.hasFieldFlag(AnnotationFieldFlag.RADIO) && !this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON); + this.data.pushButton = this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON); + this.data.isTooltipOnly = false; + if (this.data.checkBox) { + this._processCheckBox(params); + } else if (this.data.radioButton) { + this._processRadioButton(params); + } else if (this.data.pushButton) { + this.data.hasOwnCanvas = true; + this.data.noHTML = false; + this._processPushButton(params); + } else { + warn("Invalid field flags for button widget annotation"); + } + } + async getOperatorList(evaluator, task, intent, renderForms, annotationStorage) { + if (this.data.pushButton) { + return super.getOperatorList(evaluator, task, intent, false, annotationStorage); + } + let value = null; + let rotation = null; + if (annotationStorage) { + const storageEntry = annotationStorage.get(this.data.id); + value = storageEntry ? storageEntry.value : null; + rotation = storageEntry ? storageEntry.rotation : null; + } + if (value === null && this.appearance) { + return super.getOperatorList(evaluator, task, intent, renderForms, annotationStorage); + } + if (value === null || value === undefined) { + value = this.data.checkBox ? this.data.fieldValue === this.data.exportValue : this.data.fieldValue === this.data.buttonValue; + } + const appearance = value ? this.checkedAppearance : this.uncheckedAppearance; + if (appearance) { + const savedAppearance = this.appearance; + const savedMatrix = appearance.dict.getArray("Matrix") || IDENTITY_MATRIX; + if (rotation) { + appearance.dict.set("Matrix", this.getRotationMatrix(annotationStorage)); + } + this.appearance = appearance; + const operatorList = super.getOperatorList(evaluator, task, intent, renderForms, annotationStorage); + this.appearance = savedAppearance; + appearance.dict.set("Matrix", savedMatrix); + return operatorList; + } + return { + opList: new OperatorList(), + separateForm: false, + separateCanvas: false + }; + } + async save(evaluator, task, annotationStorage) { + if (this.data.checkBox) { + return this._saveCheckbox(evaluator, task, annotationStorage); + } + if (this.data.radioButton) { + return this._saveRadioButton(evaluator, task, annotationStorage); + } + return null; + } + async _saveCheckbox(evaluator, task, annotationStorage) { + if (!annotationStorage) { + return null; + } + const storageEntry = annotationStorage.get(this.data.id); + let rotation = storageEntry?.rotation, + value = storageEntry?.value; + if (rotation === undefined) { + if (value === undefined) { + return null; + } + const defaultValue = this.data.fieldValue === this.data.exportValue; + if (defaultValue === value) { + return null; + } + } + const dict = evaluator.xref.fetchIfRef(this.ref); + if (!(dict instanceof Dict)) { + return null; + } + if (rotation === undefined) { + rotation = this.rotation; + } + if (value === undefined) { + value = this.data.fieldValue === this.data.exportValue; + } + const xfa = { + path: this.data.fieldName, + value: value ? this.data.exportValue : "" + }; + const name = Name.get(value ? this.data.exportValue : "Off"); + dict.set("V", name); + dict.set("AS", name); + dict.set("M", `D:${getModificationDate()}`); + const maybeMK = this._getMKDict(rotation); + if (maybeMK) { + dict.set("MK", maybeMK); + } + const buffer = []; + await writeObject(this.ref, dict, buffer, evaluator.xref); + return [{ + ref: this.ref, + data: buffer.join(""), + xfa + }]; + } + async _saveRadioButton(evaluator, task, annotationStorage) { + if (!annotationStorage) { + return null; + } + const storageEntry = annotationStorage.get(this.data.id); + let rotation = storageEntry?.rotation, + value = storageEntry?.value; + if (rotation === undefined) { + if (value === undefined) { + return null; + } + const defaultValue = this.data.fieldValue === this.data.buttonValue; + if (defaultValue === value) { + return null; + } + } + const dict = evaluator.xref.fetchIfRef(this.ref); + if (!(dict instanceof Dict)) { + return null; + } + if (value === undefined) { + value = this.data.fieldValue === this.data.buttonValue; + } + if (rotation === undefined) { + rotation = this.rotation; + } + const xfa = { + path: this.data.fieldName, + value: value ? this.data.buttonValue : "" + }; + const name = Name.get(value ? this.data.buttonValue : "Off"); + const buffer = []; + let parentData = null; + if (value) { + if (this.parent instanceof Ref) { + const parent = evaluator.xref.fetch(this.parent); + parent.set("V", name); + await writeObject(this.parent, parent, buffer, evaluator.xref); + parentData = buffer.join(""); + buffer.length = 0; + } else if (this.parent instanceof Dict) { + this.parent.set("V", name); + } + } + dict.set("AS", name); + dict.set("M", `D:${getModificationDate()}`); + const maybeMK = this._getMKDict(rotation); + if (maybeMK) { + dict.set("MK", maybeMK); + } + await writeObject(this.ref, dict, buffer, evaluator.xref); + const newRefs = [{ + ref: this.ref, + data: buffer.join(""), + xfa + }]; + if (parentData) { + newRefs.push({ + ref: this.parent, + data: parentData, + xfa: null + }); + } + return newRefs; + } + _getDefaultCheckedAppearance(params, type) { + const width = this.data.rect[2] - this.data.rect[0]; + const height = this.data.rect[3] - this.data.rect[1]; + const bbox = [0, 0, width, height]; + const FONT_RATIO = 0.8; + const fontSize = Math.min(width, height) * FONT_RATIO; + let metrics, char; + if (type === "check") { + metrics = { + width: 0.755 * fontSize, + height: 0.705 * fontSize + }; + char = "\x33"; + } else if (type === "disc") { + metrics = { + width: 0.791 * fontSize, + height: 0.705 * fontSize + }; + char = "\x6C"; + } else { + unreachable(`_getDefaultCheckedAppearance - unsupported type: ${type}`); + } + const xShift = numberToString((width - metrics.width) / 2); + const yShift = numberToString((height - metrics.height) / 2); + const appearance = `q BT /PdfJsZaDb ${fontSize} Tf 0 g ${xShift} ${yShift} Td (${char}) Tj ET Q`; + const appearanceStreamDict = new Dict(params.xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.set("Subtype", Name.get("Form")); + appearanceStreamDict.set("Type", Name.get("XObject")); + appearanceStreamDict.set("BBox", bbox); + appearanceStreamDict.set("Matrix", [1, 0, 0, 1, 0, 0]); + appearanceStreamDict.set("Length", appearance.length); + const resources = new Dict(params.xref); + const font = new Dict(params.xref); + font.set("PdfJsZaDb", this.fallbackFontDict); + resources.set("Font", font); + appearanceStreamDict.set("Resources", resources); + this.checkedAppearance = new StringStream(appearance); + this.checkedAppearance.dict = appearanceStreamDict; + this._streams.push(this.checkedAppearance); + } + _processCheckBox(params) { + const customAppearance = params.dict.get("AP"); + if (!(customAppearance instanceof Dict)) { + return; + } + const normalAppearance = customAppearance.get("N"); + if (!(normalAppearance instanceof Dict)) { + return; + } + const asValue = this._decodeFormValue(params.dict.get("AS")); + if (typeof asValue === "string") { + this.data.fieldValue = asValue; + } + const yes = this.data.fieldValue !== null && this.data.fieldValue !== "Off" ? this.data.fieldValue : "Yes"; + const exportValues = normalAppearance.getKeys(); + if (exportValues.length === 0) { + exportValues.push("Off", yes); + } else if (exportValues.length === 1) { + if (exportValues[0] === "Off") { + exportValues.push(yes); + } else { + exportValues.unshift("Off"); + } + } else if (exportValues.includes(yes)) { + exportValues.length = 0; + exportValues.push("Off", yes); + } else { + const otherYes = exportValues.find(v => v !== "Off"); + exportValues.length = 0; + exportValues.push("Off", otherYes); + } + if (!exportValues.includes(this.data.fieldValue)) { + this.data.fieldValue = "Off"; + } + this.data.exportValue = exportValues[1]; + const checkedAppearance = normalAppearance.get(this.data.exportValue); + this.checkedAppearance = checkedAppearance instanceof BaseStream ? checkedAppearance : null; + const uncheckedAppearance = normalAppearance.get("Off"); + this.uncheckedAppearance = uncheckedAppearance instanceof BaseStream ? uncheckedAppearance : null; + if (this.checkedAppearance) { + this._streams.push(this.checkedAppearance); + } else { + this._getDefaultCheckedAppearance(params, "check"); + } + if (this.uncheckedAppearance) { + this._streams.push(this.uncheckedAppearance); + } + this._fallbackFontDict = this.fallbackFontDict; + if (this.data.defaultFieldValue === null) { + this.data.defaultFieldValue = "Off"; + } + } + _processRadioButton(params) { + this.data.buttonValue = null; + const fieldParent = params.dict.get("Parent"); + if (fieldParent instanceof Dict) { + this.parent = params.dict.getRaw("Parent"); + const fieldParentValue = fieldParent.get("V"); + if (fieldParentValue instanceof Name) { + this.data.fieldValue = this._decodeFormValue(fieldParentValue); + } + } + const appearanceStates = params.dict.get("AP"); + if (!(appearanceStates instanceof Dict)) { + return; + } + const normalAppearance = appearanceStates.get("N"); + if (!(normalAppearance instanceof Dict)) { + return; + } + for (const key of normalAppearance.getKeys()) { + if (key !== "Off") { + this.data.buttonValue = this._decodeFormValue(key); + break; + } + } + const checkedAppearance = normalAppearance.get(this.data.buttonValue); + this.checkedAppearance = checkedAppearance instanceof BaseStream ? checkedAppearance : null; + const uncheckedAppearance = normalAppearance.get("Off"); + this.uncheckedAppearance = uncheckedAppearance instanceof BaseStream ? uncheckedAppearance : null; + if (this.checkedAppearance) { + this._streams.push(this.checkedAppearance); + } else { + this._getDefaultCheckedAppearance(params, "disc"); + } + if (this.uncheckedAppearance) { + this._streams.push(this.uncheckedAppearance); + } + this._fallbackFontDict = this.fallbackFontDict; + if (this.data.defaultFieldValue === null) { + this.data.defaultFieldValue = "Off"; + } + } + _processPushButton(params) { + const { + dict, + annotationGlobals + } = params; + if (!dict.has("A") && !dict.has("AA") && !this.data.alternativeText) { + warn("Push buttons without action dictionaries are not supported"); + return; + } + this.data.isTooltipOnly = !dict.has("A") && !dict.has("AA"); + Catalog.parseDestDictionary({ + destDict: dict, + resultObj: this.data, + docBaseUrl: annotationGlobals.baseUrl, + docAttachments: annotationGlobals.attachments + }); + } + getFieldObject() { + let type = "button"; + let exportValues; + if (this.data.checkBox) { + type = "checkbox"; + exportValues = this.data.exportValue; + } else if (this.data.radioButton) { + type = "radiobutton"; + exportValues = this.data.buttonValue; + } + return { + id: this.data.id, + value: this.data.fieldValue || "Off", + defaultValue: this.data.defaultFieldValue, + exportValues, + editable: !this.data.readOnly, + name: this.data.fieldName, + rect: this.data.rect, + hidden: this.data.hidden, + actions: this.data.actions, + page: this.data.pageIndex, + strokeColor: this.data.borderColor, + fillColor: this.data.backgroundColor, + rotation: this.rotation, + type + }; + } + get fallbackFontDict() { + const dict = new Dict(); + dict.set("BaseFont", Name.get("ZapfDingbats")); + dict.set("Type", Name.get("FallbackType")); + dict.set("Subtype", Name.get("FallbackType")); + dict.set("Encoding", Name.get("ZapfDingbatsEncoding")); + return shadow(this, "fallbackFontDict", dict); + } +} +class ChoiceWidgetAnnotation extends WidgetAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.indices = dict.getArray("I"); + this.hasIndices = Array.isArray(this.indices) && this.indices.length > 0; + this.data.options = []; + const options = getInheritableProperty({ + dict, + key: "Opt" + }); + if (Array.isArray(options)) { + for (let i = 0, ii = options.length; i < ii; i++) { + const option = xref.fetchIfRef(options[i]); + const isOptionArray = Array.isArray(option); + this.data.options[i] = { + exportValue: this._decodeFormValue(isOptionArray ? xref.fetchIfRef(option[0]) : option), + displayValue: this._decodeFormValue(isOptionArray ? xref.fetchIfRef(option[1]) : option) + }; + } + } + if (!this.hasIndices) { + if (typeof this.data.fieldValue === "string") { + this.data.fieldValue = [this.data.fieldValue]; + } else if (!this.data.fieldValue) { + this.data.fieldValue = []; + } + } else { + this.data.fieldValue = []; + const ii = this.data.options.length; + for (const i of this.indices) { + if (Number.isInteger(i) && i >= 0 && i < ii) { + this.data.fieldValue.push(this.data.options[i].exportValue); + } + } + } + this.data.combo = this.hasFieldFlag(AnnotationFieldFlag.COMBO); + this.data.multiSelect = this.hasFieldFlag(AnnotationFieldFlag.MULTISELECT); + this._hasText = true; + } + getFieldObject() { + const type = this.data.combo ? "combobox" : "listbox"; + const value = this.data.fieldValue.length > 0 ? this.data.fieldValue[0] : null; + return { + id: this.data.id, + value, + defaultValue: this.data.defaultFieldValue, + editable: !this.data.readOnly, + name: this.data.fieldName, + rect: this.data.rect, + numItems: this.data.fieldValue.length, + multipleSelection: this.data.multiSelect, + hidden: this.data.hidden, + actions: this.data.actions, + items: this.data.options, + page: this.data.pageIndex, + strokeColor: this.data.borderColor, + fillColor: this.data.backgroundColor, + rotation: this.rotation, + type + }; + } + amendSavedDict(annotationStorage, dict) { + if (!this.hasIndices) { + return; + } + let values = annotationStorage?.get(this.data.id)?.value; + if (!Array.isArray(values)) { + values = [values]; + } + const indices = []; + const { + options + } = this.data; + for (let i = 0, j = 0, ii = options.length; i < ii; i++) { + if (options[i].exportValue === values[j]) { + indices.push(i); + j += 1; + } + } + dict.set("I", indices); + } + async _getAppearance(evaluator, task, intent, annotationStorage) { + if (this.data.combo) { + return super._getAppearance(evaluator, task, intent, annotationStorage); + } + let exportedValue, rotation; + const storageEntry = annotationStorage?.get(this.data.id); + if (storageEntry) { + rotation = storageEntry.rotation; + exportedValue = storageEntry.value; + } + if (rotation === undefined && exportedValue === undefined && !this._needAppearances) { + return null; + } + if (exportedValue === undefined) { + exportedValue = this.data.fieldValue; + } else if (!Array.isArray(exportedValue)) { + exportedValue = [exportedValue]; + } + const defaultPadding = 1; + const defaultHPadding = 2; + let totalHeight = this.data.rect[3] - this.data.rect[1]; + let totalWidth = this.data.rect[2] - this.data.rect[0]; + if (rotation === 90 || rotation === 270) { + [totalWidth, totalHeight] = [totalHeight, totalWidth]; + } + const lineCount = this.data.options.length; + const valueIndices = []; + for (let i = 0; i < lineCount; i++) { + const { + exportValue + } = this.data.options[i]; + if (exportedValue.includes(exportValue)) { + valueIndices.push(i); + } + } + if (!this._defaultAppearance) { + this.data.defaultAppearanceData = parseDefaultAppearance(this._defaultAppearance = "/Helvetica 0 Tf 0 g"); + } + const font = await WidgetAnnotation._getFontData(evaluator, task, this.data.defaultAppearanceData, this._fieldResources.mergedResources); + let defaultAppearance; + let { + fontSize + } = this.data.defaultAppearanceData; + if (!fontSize) { + const lineHeight = (totalHeight - defaultPadding) / lineCount; + let lineWidth = -1; + let value; + for (const { + displayValue + } of this.data.options) { + const width = this._getTextWidth(displayValue, font); + if (width > lineWidth) { + lineWidth = width; + value = displayValue; + } + } + [defaultAppearance, fontSize] = this._computeFontSize(lineHeight, totalWidth - 2 * defaultHPadding, value, font, -1); + } else { + defaultAppearance = this._defaultAppearance; + } + const lineHeight = fontSize * LINE_FACTOR; + const vPadding = (lineHeight - fontSize) / 2; + const numberOfVisibleLines = Math.floor(totalHeight / lineHeight); + let firstIndex = 0; + if (valueIndices.length > 0) { + const minIndex = Math.min(...valueIndices); + const maxIndex = Math.max(...valueIndices); + firstIndex = Math.max(0, maxIndex - numberOfVisibleLines + 1); + if (firstIndex > minIndex) { + firstIndex = minIndex; + } + } + const end = Math.min(firstIndex + numberOfVisibleLines + 1, lineCount); + const buf = ["/Tx BMC q", `1 1 ${totalWidth} ${totalHeight} re W n`]; + if (valueIndices.length) { + buf.push("0.600006 0.756866 0.854904 rg"); + for (const index of valueIndices) { + if (firstIndex <= index && index < end) { + buf.push(`1 ${totalHeight - (index - firstIndex + 1) * lineHeight} ${totalWidth} ${lineHeight} re f`); + } + } + } + buf.push("BT", defaultAppearance, `1 0 0 1 0 ${totalHeight} Tm`); + const prevInfo = { + shift: 0 + }; + for (let i = firstIndex; i < end; i++) { + const { + displayValue + } = this.data.options[i]; + const vpadding = i === firstIndex ? vPadding : 0; + buf.push(this._renderText(displayValue, font, fontSize, totalWidth, 0, prevInfo, defaultHPadding, -lineHeight + vpadding)); + } + buf.push("ET Q EMC"); + return buf.join("\n"); + } +} +class SignatureWidgetAnnotation extends WidgetAnnotation { + constructor(params) { + super(params); + this.data.fieldValue = null; + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = !this.data.hasOwnCanvas; + } + getFieldObject() { + return { + id: this.data.id, + value: null, + page: this.data.pageIndex, + type: "signature" + }; + } +} +class TextAnnotation extends MarkupAnnotation { + constructor(params) { + const DEFAULT_ICON_SIZE = 22; + super(params); + this.data.noRotate = true; + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = false; + const { + dict + } = params; + this.data.annotationType = AnnotationType.TEXT; + if (this.data.hasAppearance) { + this.data.name = "NoIcon"; + } else { + this.data.rect[1] = this.data.rect[3] - DEFAULT_ICON_SIZE; + this.data.rect[2] = this.data.rect[0] + DEFAULT_ICON_SIZE; + this.data.name = dict.has("Name") ? dict.get("Name").name : "Note"; + } + if (dict.has("State")) { + this.data.state = dict.get("State") || null; + this.data.stateModel = dict.get("StateModel") || null; + } else { + this.data.state = null; + this.data.stateModel = null; + } + } +} +class LinkAnnotation extends Annotation { + constructor(params) { + super(params); + const { + dict, + annotationGlobals + } = params; + this.data.annotationType = AnnotationType.LINK; + const quadPoints = getQuadPoints(dict, this.rectangle); + if (quadPoints) { + this.data.quadPoints = quadPoints; + } + this.data.borderColor ||= this.data.color; + Catalog.parseDestDictionary({ + destDict: dict, + resultObj: this.data, + docBaseUrl: annotationGlobals.baseUrl, + docAttachments: annotationGlobals.attachments + }); + } +} +class PopupAnnotation extends Annotation { + constructor(params) { + super(params); + const { + dict + } = params; + this.data.annotationType = AnnotationType.POPUP; + this.data.noHTML = false; + if (this.data.rect[0] === this.data.rect[2] || this.data.rect[1] === this.data.rect[3]) { + this.data.rect = null; + } + let parentItem = dict.get("Parent"); + if (!parentItem) { + warn("Popup annotation has a missing or invalid parent annotation."); + return; + } + const parentRect = parentItem.getArray("Rect"); + this.data.parentRect = Array.isArray(parentRect) && parentRect.length === 4 ? Util.normalizeRect(parentRect) : null; + const rt = parentItem.get("RT"); + if (isName(rt, AnnotationReplyType.GROUP)) { + parentItem = parentItem.get("IRT"); + } + if (!parentItem.has("M")) { + this.data.modificationDate = null; + } else { + this.setModificationDate(parentItem.get("M")); + this.data.modificationDate = this.modificationDate; + } + if (!parentItem.has("C")) { + this.data.color = null; + } else { + this.setColor(parentItem.getArray("C")); + this.data.color = this.color; + } + if (!this.viewable) { + const parentFlags = parentItem.get("F"); + if (this._isViewable(parentFlags)) { + this.setFlags(parentFlags); + } + } + this.setTitle(parentItem.get("T")); + this.data.titleObj = this._title; + this.setContents(parentItem.get("Contents")); + this.data.contentsObj = this._contents; + if (parentItem.has("RC")) { + this.data.richText = XFAFactory.getRichTextAsHtml(parentItem.get("RC")); + } + this.data.open = !!dict.get("Open"); + } +} +class FreeTextAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + this.data.hasOwnCanvas = !this.data.noHTML; + this.data.noHTML = false; + const { + evaluatorOptions, + xref + } = params; + this.data.annotationType = AnnotationType.FREETEXT; + this.setDefaultAppearance(params); + if (this.appearance) { + const { + fontColor, + fontSize + } = parseAppearanceStream(this.appearance, evaluatorOptions, xref); + this.data.defaultAppearanceData.fontColor = fontColor; + this.data.defaultAppearanceData.fontSize = fontSize || 10; + } else if (this._isOffscreenCanvasSupported) { + const strokeAlpha = params.dict.get("CA"); + const fakeUnicodeFont = new FakeUnicodeFont(xref, "sans-serif"); + this.data.defaultAppearanceData.fontSize ||= 10; + const { + fontColor, + fontSize + } = this.data.defaultAppearanceData; + this.appearance = fakeUnicodeFont.createAppearance(this._contents.str, this.rectangle, this.rotation, fontSize, fontColor, strokeAlpha); + this._streams.push(this.appearance, FakeUnicodeFont.toUnicodeStream); + } else { + warn("FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly."); + } + } + get hasTextContent() { + return !!this.appearance; + } + static createNewDict(annotation, xref, { + apRef, + ap + }) { + const { + color, + fontSize, + rect, + rotation, + user, + value + } = annotation; + const freetext = new Dict(xref); + freetext.set("Type", Name.get("Annot")); + freetext.set("Subtype", Name.get("FreeText")); + freetext.set("CreationDate", `D:${getModificationDate()}`); + freetext.set("Rect", rect); + const da = `/Helv ${fontSize} Tf ${getPdfColor(color, true)}`; + freetext.set("DA", da); + freetext.set("Contents", isAscii(value) ? value : stringToUTF16String(value, true)); + freetext.set("F", 4); + freetext.set("Border", [0, 0, 0]); + freetext.set("Rotate", rotation); + if (user) { + freetext.set("T", isAscii(user) ? user : stringToUTF16String(user, true)); + } + if (apRef || ap) { + const n = new Dict(xref); + freetext.set("AP", n); + if (apRef) { + n.set("N", apRef); + } else { + n.set("N", ap); + } + } + return freetext; + } + static async createNewAppearanceStream(annotation, xref, params) { + const { + baseFontRef, + evaluator, + task + } = params; + const { + color, + fontSize, + rect, + rotation, + value + } = annotation; + const resources = new Dict(xref); + const font = new Dict(xref); + if (baseFontRef) { + font.set("Helv", baseFontRef); + } else { + const baseFont = new Dict(xref); + baseFont.set("BaseFont", Name.get("Helvetica")); + baseFont.set("Type", Name.get("Font")); + baseFont.set("Subtype", Name.get("Type1")); + baseFont.set("Encoding", Name.get("WinAnsiEncoding")); + font.set("Helv", baseFont); + } + resources.set("Font", font); + const helv = await WidgetAnnotation._getFontData(evaluator, task, { + fontName: "Helv", + fontSize + }, resources); + const [x1, y1, x2, y2] = rect; + let w = x2 - x1; + let h = y2 - y1; + if (rotation % 180 !== 0) { + [w, h] = [h, w]; + } + const lines = value.split("\n"); + const scale = fontSize / 1000; + let totalWidth = -Infinity; + const encodedLines = []; + for (let line of lines) { + const encoded = helv.encodeString(line); + if (encoded.length > 1) { + return null; + } + line = encoded.join(""); + encodedLines.push(line); + let lineWidth = 0; + const glyphs = helv.charsToGlyphs(line); + for (const glyph of glyphs) { + lineWidth += glyph.width * scale; + } + totalWidth = Math.max(totalWidth, lineWidth); + } + let hscale = 1; + if (totalWidth > w) { + hscale = w / totalWidth; + } + let vscale = 1; + const lineHeight = LINE_FACTOR * fontSize; + const lineAscent = (LINE_FACTOR - LINE_DESCENT_FACTOR) * fontSize; + const totalHeight = lineHeight * lines.length; + if (totalHeight > h) { + vscale = h / totalHeight; + } + const fscale = Math.min(hscale, vscale); + const newFontSize = fontSize * fscale; + let firstPoint, clipBox, matrix; + switch (rotation) { + case 0: + matrix = [1, 0, 0, 1]; + clipBox = [rect[0], rect[1], w, h]; + firstPoint = [rect[0], rect[3] - lineAscent]; + break; + case 90: + matrix = [0, 1, -1, 0]; + clipBox = [rect[1], -rect[2], w, h]; + firstPoint = [rect[1], -rect[0] - lineAscent]; + break; + case 180: + matrix = [-1, 0, 0, -1]; + clipBox = [-rect[2], -rect[3], w, h]; + firstPoint = [-rect[2], -rect[1] - lineAscent]; + break; + case 270: + matrix = [0, -1, 1, 0]; + clipBox = [-rect[3], rect[0], w, h]; + firstPoint = [-rect[3], rect[2] - lineAscent]; + break; + } + const buffer = ["q", `${matrix.join(" ")} 0 0 cm`, `${clipBox.join(" ")} re W n`, `BT`, `${getPdfColor(color, true)}`, `0 Tc /Helv ${numberToString(newFontSize)} Tf`]; + buffer.push(`${firstPoint.join(" ")} Td (${escapeString(encodedLines[0])}) Tj`); + const vShift = numberToString(lineHeight); + for (let i = 1, ii = encodedLines.length; i < ii; i++) { + const line = encodedLines[i]; + buffer.push(`0 -${vShift} Td (${escapeString(line)}) Tj`); + } + buffer.push("ET", "Q"); + const appearance = buffer.join("\n"); + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.set("Subtype", Name.get("Form")); + appearanceStreamDict.set("Type", Name.get("XObject")); + appearanceStreamDict.set("BBox", rect); + appearanceStreamDict.set("Resources", resources); + appearanceStreamDict.set("Matrix", [1, 0, 0, 1, -rect[0], -rect[1]]); + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; + } +} +class LineAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.LINE; + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = false; + const lineCoordinates = dict.getArray("L"); + this.data.lineCoordinates = Util.normalizeRect(lineCoordinates); + this.setLineEndings(dict.getArray("LE")); + this.data.lineEndings = this.lineEndings; + if (!this.appearance) { + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + const interiorColor = getRgbColor(dict.getArray("IC"), null); + const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null; + const fillAlpha = fillColor ? strokeAlpha : null; + const borderWidth = this.borderStyle.width || 1, + borderAdjust = 2 * borderWidth; + const bbox = [this.data.lineCoordinates[0] - borderAdjust, this.data.lineCoordinates[1] - borderAdjust, this.data.lineCoordinates[2] + borderAdjust, this.data.lineCoordinates[3] + borderAdjust]; + if (!Util.intersect(this.rectangle, bbox)) { + this.rectangle = bbox; + } + this._setDefaultAppearance({ + xref, + extra: `${borderWidth} w`, + strokeColor, + fillColor, + strokeAlpha, + fillAlpha, + pointsCallback: (buffer, points) => { + buffer.push(`${lineCoordinates[0]} ${lineCoordinates[1]} m`, `${lineCoordinates[2]} ${lineCoordinates[3]} l`, "S"); + return [points[0].x - borderWidth, points[1].x + borderWidth, points[3].y - borderWidth, points[1].y + borderWidth]; + } + }); + } + } +} +class SquareAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.SQUARE; + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = false; + if (!this.appearance) { + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + const interiorColor = getRgbColor(dict.getArray("IC"), null); + const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null; + const fillAlpha = fillColor ? strokeAlpha : null; + if (this.borderStyle.width === 0 && !fillColor) { + return; + } + this._setDefaultAppearance({ + xref, + extra: `${this.borderStyle.width} w`, + strokeColor, + fillColor, + strokeAlpha, + fillAlpha, + pointsCallback: (buffer, points) => { + const x = points[2].x + this.borderStyle.width / 2; + const y = points[2].y + this.borderStyle.width / 2; + const width = points[3].x - points[2].x - this.borderStyle.width; + const height = points[1].y - points[3].y - this.borderStyle.width; + buffer.push(`${x} ${y} ${width} ${height} re`); + if (fillColor) { + buffer.push("B"); + } else { + buffer.push("S"); + } + return [points[0].x, points[1].x, points[3].y, points[1].y]; + } + }); + } + } +} +class CircleAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.CIRCLE; + if (!this.appearance) { + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + const interiorColor = getRgbColor(dict.getArray("IC"), null); + const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null; + const fillAlpha = fillColor ? strokeAlpha : null; + if (this.borderStyle.width === 0 && !fillColor) { + return; + } + const controlPointsDistance = 4 / 3 * Math.tan(Math.PI / (2 * 4)); + this._setDefaultAppearance({ + xref, + extra: `${this.borderStyle.width} w`, + strokeColor, + fillColor, + strokeAlpha, + fillAlpha, + pointsCallback: (buffer, points) => { + const x0 = points[0].x + this.borderStyle.width / 2; + const y0 = points[0].y - this.borderStyle.width / 2; + const x1 = points[3].x - this.borderStyle.width / 2; + const y1 = points[3].y + this.borderStyle.width / 2; + const xMid = x0 + (x1 - x0) / 2; + const yMid = y0 + (y1 - y0) / 2; + const xOffset = (x1 - x0) / 2 * controlPointsDistance; + const yOffset = (y1 - y0) / 2 * controlPointsDistance; + buffer.push(`${xMid} ${y1} m`, `${xMid + xOffset} ${y1} ${x1} ${yMid + yOffset} ${x1} ${yMid} c`, `${x1} ${yMid - yOffset} ${xMid + xOffset} ${y0} ${xMid} ${y0} c`, `${xMid - xOffset} ${y0} ${x0} ${yMid - yOffset} ${x0} ${yMid} c`, `${x0} ${yMid + yOffset} ${xMid - xOffset} ${y1} ${xMid} ${y1} c`, "h"); + if (fillColor) { + buffer.push("B"); + } else { + buffer.push("S"); + } + return [points[0].x, points[1].x, points[3].y, points[1].y]; + } + }); + } + } +} +class PolylineAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.POLYLINE; + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = false; + this.data.vertices = []; + if (!(this instanceof PolygonAnnotation)) { + this.setLineEndings(dict.getArray("LE")); + this.data.lineEndings = this.lineEndings; + } + const rawVertices = dict.getArray("Vertices"); + if (!Array.isArray(rawVertices)) { + return; + } + for (let i = 0, ii = rawVertices.length; i < ii; i += 2) { + this.data.vertices.push({ + x: rawVertices[i], + y: rawVertices[i + 1] + }); + } + if (!this.appearance) { + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + const borderWidth = this.borderStyle.width || 1, + borderAdjust = 2 * borderWidth; + const bbox = [Infinity, Infinity, -Infinity, -Infinity]; + for (const vertex of this.data.vertices) { + bbox[0] = Math.min(bbox[0], vertex.x - borderAdjust); + bbox[1] = Math.min(bbox[1], vertex.y - borderAdjust); + bbox[2] = Math.max(bbox[2], vertex.x + borderAdjust); + bbox[3] = Math.max(bbox[3], vertex.y + borderAdjust); + } + if (!Util.intersect(this.rectangle, bbox)) { + this.rectangle = bbox; + } + this._setDefaultAppearance({ + xref, + extra: `${borderWidth} w`, + strokeColor, + strokeAlpha, + pointsCallback: (buffer, points) => { + const vertices = this.data.vertices; + for (let i = 0, ii = vertices.length; i < ii; i++) { + buffer.push(`${vertices[i].x} ${vertices[i].y} ${i === 0 ? "m" : "l"}`); + } + buffer.push("S"); + return [points[0].x, points[1].x, points[3].y, points[1].y]; + } + }); + } + } +} +class PolygonAnnotation extends PolylineAnnotation { + constructor(params) { + super(params); + this.data.annotationType = AnnotationType.POLYGON; + } +} +class CaretAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + this.data.annotationType = AnnotationType.CARET; + } +} +class InkAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = false; + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.INK; + this.data.inkLists = []; + const rawInkLists = dict.getArray("InkList"); + if (!Array.isArray(rawInkLists)) { + return; + } + for (let i = 0, ii = rawInkLists.length; i < ii; ++i) { + this.data.inkLists.push([]); + for (let j = 0, jj = rawInkLists[i].length; j < jj; j += 2) { + this.data.inkLists[i].push({ + x: xref.fetchIfRef(rawInkLists[i][j]), + y: xref.fetchIfRef(rawInkLists[i][j + 1]) + }); + } + } + if (!this.appearance) { + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + const borderWidth = this.borderStyle.width || 1, + borderAdjust = 2 * borderWidth; + const bbox = [Infinity, Infinity, -Infinity, -Infinity]; + for (const inkLists of this.data.inkLists) { + for (const vertex of inkLists) { + bbox[0] = Math.min(bbox[0], vertex.x - borderAdjust); + bbox[1] = Math.min(bbox[1], vertex.y - borderAdjust); + bbox[2] = Math.max(bbox[2], vertex.x + borderAdjust); + bbox[3] = Math.max(bbox[3], vertex.y + borderAdjust); + } + } + if (!Util.intersect(this.rectangle, bbox)) { + this.rectangle = bbox; + } + this._setDefaultAppearance({ + xref, + extra: `${borderWidth} w`, + strokeColor, + strokeAlpha, + pointsCallback: (buffer, points) => { + for (const inkList of this.data.inkLists) { + for (let i = 0, ii = inkList.length; i < ii; i++) { + buffer.push(`${inkList[i].x} ${inkList[i].y} ${i === 0 ? "m" : "l"}`); + } + buffer.push("S"); + } + return [points[0].x, points[1].x, points[3].y, points[1].y]; + } + }); + } + } + static createNewDict(annotation, xref, { + apRef, + ap + }) { + const { + color, + opacity, + paths, + rect, + rotation, + thickness + } = annotation; + const ink = new Dict(xref); + ink.set("Type", Name.get("Annot")); + ink.set("Subtype", Name.get("Ink")); + ink.set("CreationDate", `D:${getModificationDate()}`); + ink.set("Rect", rect); + ink.set("InkList", paths.map(p => p.points)); + ink.set("F", 4); + ink.set("Rotate", rotation); + const bs = new Dict(xref); + ink.set("BS", bs); + bs.set("W", thickness); + ink.set("C", Array.from(color, c => c / 255)); + ink.set("CA", opacity); + const n = new Dict(xref); + ink.set("AP", n); + if (apRef) { + n.set("N", apRef); + } else { + n.set("N", ap); + } + return ink; + } + static async createNewAppearanceStream(annotation, xref, params) { + const { + color, + rect, + paths, + thickness, + opacity + } = annotation; + const appearanceBuffer = [`${thickness} w 1 J 1 j`, `${getPdfColor(color, false)}`]; + if (opacity !== 1) { + appearanceBuffer.push("/R0 gs"); + } + const buffer = []; + for (const { + bezier + } of paths) { + buffer.length = 0; + buffer.push(`${numberToString(bezier[0])} ${numberToString(bezier[1])} m`); + for (let i = 2, ii = bezier.length; i < ii; i += 6) { + const curve = bezier.slice(i, i + 6).map(numberToString).join(" "); + buffer.push(`${curve} c`); + } + buffer.push("S"); + appearanceBuffer.push(buffer.join("\n")); + } + const appearance = appearanceBuffer.join("\n"); + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.set("Subtype", Name.get("Form")); + appearanceStreamDict.set("Type", Name.get("XObject")); + appearanceStreamDict.set("BBox", rect); + appearanceStreamDict.set("Length", appearance.length); + if (opacity !== 1) { + const resources = new Dict(xref); + const extGState = new Dict(xref); + const r0 = new Dict(xref); + r0.set("CA", opacity); + r0.set("Type", Name.get("ExtGState")); + extGState.set("R0", r0); + resources.set("ExtGState", extGState); + appearanceStreamDict.set("Resources", resources); + } + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; + } +} +class HighlightAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.HIGHLIGHT; + const quadPoints = this.data.quadPoints = getQuadPoints(dict, null); + if (quadPoints) { + const resources = this.appearance?.dict.get("Resources"); + if (!this.appearance || !resources?.has("ExtGState")) { + if (this.appearance) { + warn("HighlightAnnotation - ignoring built-in appearance stream."); + } + const fillColor = this.color ? getPdfColorArray(this.color) : [1, 1, 0]; + const fillAlpha = dict.get("CA"); + this._setDefaultAppearance({ + xref, + fillColor, + blendMode: "Multiply", + fillAlpha, + pointsCallback: (buffer, points) => { + buffer.push(`${points[0].x} ${points[0].y} m`, `${points[1].x} ${points[1].y} l`, `${points[3].x} ${points[3].y} l`, `${points[2].x} ${points[2].y} l`, "f"); + return [points[0].x, points[1].x, points[3].y, points[1].y]; + } + }); + } + } else { + this.data.popupRef = null; + } + } + static createNewDict(annotation, xref, { + apRef, + ap + }) { + const { + color, + opacity, + rect, + rotation, + user, + quadPoints + } = annotation; + const highlight = new Dict(xref); + highlight.set("Type", Name.get("Annot")); + highlight.set("Subtype", Name.get("Highlight")); + highlight.set("CreationDate", `D:${getModificationDate()}`); + highlight.set("Rect", rect); + highlight.set("F", 4); + highlight.set("Border", [0, 0, 0]); + highlight.set("Rotate", rotation); + highlight.set("QuadPoints", quadPoints); + highlight.set("C", Array.from(color, c => c / 255)); + highlight.set("CA", opacity); + if (user) { + highlight.set("T", isAscii(user) ? user : stringToUTF16String(user, true)); + } + if (apRef || ap) { + const n = new Dict(xref); + highlight.set("AP", n); + n.set("N", apRef || ap); + } + return highlight; + } + static async createNewAppearanceStream(annotation, xref, params) { + const { + color, + rect, + outlines, + opacity + } = annotation; + const appearanceBuffer = [`${getPdfColor(color, true)}`, "/R0 gs"]; + const buffer = []; + for (const outline of outlines) { + buffer.length = 0; + buffer.push(`${numberToString(outline[0])} ${numberToString(outline[1])} m`); + for (let i = 2, ii = outline.length; i < ii; i += 2) { + buffer.push(`${numberToString(outline[i])} ${numberToString(outline[i + 1])} l`); + } + buffer.push("h"); + appearanceBuffer.push(buffer.join("\n")); + } + appearanceBuffer.push("f*"); + const appearance = appearanceBuffer.join("\n"); + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.set("Subtype", Name.get("Form")); + appearanceStreamDict.set("Type", Name.get("XObject")); + appearanceStreamDict.set("BBox", rect); + appearanceStreamDict.set("Length", appearance.length); + const resources = new Dict(xref); + const extGState = new Dict(xref); + resources.set("ExtGState", extGState); + appearanceStreamDict.set("Resources", resources); + const r0 = new Dict(xref); + extGState.set("R0", r0); + r0.set("BM", Name.get("Multiply")); + if (opacity !== 1) { + r0.set("ca", opacity); + r0.set("Type", Name.get("ExtGState")); + } + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; + } +} +class UnderlineAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.UNDERLINE; + const quadPoints = this.data.quadPoints = getQuadPoints(dict, null); + if (quadPoints) { + if (!this.appearance) { + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + this._setDefaultAppearance({ + xref, + extra: "[] 0 d 0.571 w", + strokeColor, + strokeAlpha, + pointsCallback: (buffer, points) => { + buffer.push(`${points[2].x} ${points[2].y + 1.3} m`, `${points[3].x} ${points[3].y + 1.3} l`, "S"); + return [points[0].x, points[1].x, points[3].y, points[1].y]; + } + }); + } + } else { + this.data.popupRef = null; + } + } +} +class SquigglyAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.SQUIGGLY; + const quadPoints = this.data.quadPoints = getQuadPoints(dict, null); + if (quadPoints) { + if (!this.appearance) { + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + this._setDefaultAppearance({ + xref, + extra: "[] 0 d 1 w", + strokeColor, + strokeAlpha, + pointsCallback: (buffer, points) => { + const dy = (points[0].y - points[2].y) / 6; + let shift = dy; + let x = points[2].x; + const y = points[2].y; + const xEnd = points[3].x; + buffer.push(`${x} ${y + shift} m`); + do { + x += 2; + shift = shift === 0 ? dy : 0; + buffer.push(`${x} ${y + shift} l`); + } while (x < xEnd); + buffer.push("S"); + return [points[2].x, xEnd, y - 2 * dy, y + 2 * dy]; + } + }); + } + } else { + this.data.popupRef = null; + } + } +} +class StrikeOutAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + this.data.annotationType = AnnotationType.STRIKEOUT; + const quadPoints = this.data.quadPoints = getQuadPoints(dict, null); + if (quadPoints) { + if (!this.appearance) { + const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0]; + const strokeAlpha = dict.get("CA"); + this._setDefaultAppearance({ + xref, + extra: "[] 0 d 1 w", + strokeColor, + strokeAlpha, + pointsCallback: (buffer, points) => { + buffer.push(`${(points[0].x + points[2].x) / 2} ` + `${(points[0].y + points[2].y) / 2} m`, `${(points[1].x + points[3].x) / 2} ` + `${(points[1].y + points[3].y) / 2} l`, "S"); + return [points[0].x, points[1].x, points[3].y, points[1].y]; + } + }); + } + } else { + this.data.popupRef = null; + } + } +} +class StampAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + this.data.annotationType = AnnotationType.STAMP; + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = false; + } + static async createImage(bitmap, xref) { + const { + width, + height + } = bitmap; + const canvas = new OffscreenCanvas(width, height); + const ctx = canvas.getContext("2d", { + alpha: true + }); + ctx.drawImage(bitmap, 0, 0); + const data = ctx.getImageData(0, 0, width, height).data; + const buf32 = new Uint32Array(data.buffer); + const hasAlpha = buf32.some(FeatureTest.isLittleEndian ? x => x >>> 24 !== 0xff : x => (x & 0xff) !== 0xff); + if (hasAlpha) { + ctx.fillStyle = "white"; + ctx.fillRect(0, 0, width, height); + ctx.drawImage(bitmap, 0, 0); + } + const jpegBufferPromise = canvas.convertToBlob({ + type: "image/jpeg", + quality: 1 + }).then(blob => { + return blob.arrayBuffer(); + }); + const xobjectName = Name.get("XObject"); + const imageName = Name.get("Image"); + const image = new Dict(xref); + image.set("Type", xobjectName); + image.set("Subtype", imageName); + image.set("BitsPerComponent", 8); + image.set("ColorSpace", Name.get("DeviceRGB")); + image.set("Filter", Name.get("DCTDecode")); + image.set("BBox", [0, 0, width, height]); + image.set("Width", width); + image.set("Height", height); + let smaskStream = null; + if (hasAlpha) { + const alphaBuffer = new Uint8Array(buf32.length); + if (FeatureTest.isLittleEndian) { + for (let i = 0, ii = buf32.length; i < ii; i++) { + alphaBuffer[i] = buf32[i] >>> 24; + } + } else { + for (let i = 0, ii = buf32.length; i < ii; i++) { + alphaBuffer[i] = buf32[i] & 0xff; + } + } + const smask = new Dict(xref); + smask.set("Type", xobjectName); + smask.set("Subtype", imageName); + smask.set("BitsPerComponent", 8); + smask.set("ColorSpace", Name.get("DeviceGray")); + smask.set("Width", width); + smask.set("Height", height); + smaskStream = new Stream(alphaBuffer, 0, 0, smask); + } + const imageStream = new Stream(await jpegBufferPromise, 0, 0, image); + return { + imageStream, + smaskStream, + width, + height + }; + } + static createNewDict(annotation, xref, { + apRef, + ap + }) { + const { + rect, + rotation, + user + } = annotation; + const stamp = new Dict(xref); + stamp.set("Type", Name.get("Annot")); + stamp.set("Subtype", Name.get("Stamp")); + stamp.set("CreationDate", `D:${getModificationDate()}`); + stamp.set("Rect", rect); + stamp.set("F", 4); + stamp.set("Border", [0, 0, 0]); + stamp.set("Rotate", rotation); + if (user) { + stamp.set("T", isAscii(user) ? user : stringToUTF16String(user, true)); + } + if (apRef || ap) { + const n = new Dict(xref); + stamp.set("AP", n); + if (apRef) { + n.set("N", apRef); + } else { + n.set("N", ap); + } + } + return stamp; + } + static async createNewAppearanceStream(annotation, xref, params) { + const { + rotation + } = annotation; + const { + imageRef, + width, + height + } = params.image; + const resources = new Dict(xref); + const xobject = new Dict(xref); + resources.set("XObject", xobject); + xobject.set("Im0", imageRef); + const appearance = `q ${width} 0 0 ${height} 0 0 cm /Im0 Do Q`; + const appearanceStreamDict = new Dict(xref); + appearanceStreamDict.set("FormType", 1); + appearanceStreamDict.set("Subtype", Name.get("Form")); + appearanceStreamDict.set("Type", Name.get("XObject")); + appearanceStreamDict.set("BBox", [0, 0, width, height]); + appearanceStreamDict.set("Resources", resources); + if (rotation) { + const matrix = getRotationMatrix(rotation, width, height); + appearanceStreamDict.set("Matrix", matrix); + } + const ap = new StringStream(appearance); + ap.dict = appearanceStreamDict; + return ap; + } +} +class FileAttachmentAnnotation extends MarkupAnnotation { + constructor(params) { + super(params); + const { + dict, + xref + } = params; + const file = new FileSpec(dict.get("FS"), xref); + this.data.annotationType = AnnotationType.FILEATTACHMENT; + this.data.hasOwnCanvas = this.data.noRotate; + this.data.noHTML = false; + this.data.file = file.serializable; + const name = dict.get("Name"); + this.data.name = name instanceof Name ? stringToPDFString(name.name) : "PushPin"; + const fillAlpha = dict.get("ca"); + this.data.fillAlpha = typeof fillAlpha === "number" && fillAlpha >= 0 && fillAlpha <= 1 ? fillAlpha : null; + } +} + +;// CONCATENATED MODULE: ./src/core/dataset_reader.js + + + +function decodeString(str) { + try { + return stringToUTF8String(str); + } catch (ex) { + warn(`UTF-8 decoding failed: "${ex}".`); + return str; + } +} +class DatasetXMLParser extends SimpleXMLParser { + constructor(options) { + super(options); + this.node = null; + } + onEndElement(name) { + const node = super.onEndElement(name); + if (node && name === "xfa:datasets") { + this.node = node; + throw new Error("Aborting DatasetXMLParser."); + } + } +} +class DatasetReader { + constructor(data) { + if (data.datasets) { + this.node = new SimpleXMLParser({ + hasAttributes: true + }).parseFromString(data.datasets).documentElement; + } else { + const parser = new DatasetXMLParser({ + hasAttributes: true + }); + try { + parser.parseFromString(data["xdp:xdp"]); + } catch {} + this.node = parser.node; + } + } + getValue(path) { + if (!this.node || !path) { + return ""; + } + const node = this.node.searchNode(parseXFAPath(path), 0); + if (!node) { + return ""; + } + const first = node.firstChild; + if (first?.nodeName === "value") { + return node.children.map(child => decodeString(child.textContent)); + } + return decodeString(node.textContent); + } +} + +;// CONCATENATED MODULE: ./src/core/xref.js + + + + + + +class XRef { + #firstXRefStmPos = null; + constructor(stream, pdfManager) { + this.stream = stream; + this.pdfManager = pdfManager; + this.entries = []; + this._xrefStms = new Set(); + this._cacheMap = new Map(); + this._pendingRefs = new RefSet(); + this._newPersistentRefNum = null; + this._newTemporaryRefNum = null; + this._persistentRefsCache = null; + } + getNewPersistentRef(obj) { + if (this._newPersistentRefNum === null) { + this._newPersistentRefNum = this.entries.length || 1; + } + const num = this._newPersistentRefNum++; + this._cacheMap.set(num, obj); + return Ref.get(num, 0); + } + getNewTemporaryRef() { + if (this._newTemporaryRefNum === null) { + this._newTemporaryRefNum = this.entries.length || 1; + if (this._newPersistentRefNum) { + this._persistentRefsCache = new Map(); + for (let i = this._newTemporaryRefNum; i < this._newPersistentRefNum; i++) { + this._persistentRefsCache.set(i, this._cacheMap.get(i)); + this._cacheMap.delete(i); + } + } + } + return Ref.get(this._newTemporaryRefNum++, 0); + } + resetNewTemporaryRef() { + this._newTemporaryRefNum = null; + if (this._persistentRefsCache) { + for (const [num, obj] of this._persistentRefsCache) { + this._cacheMap.set(num, obj); + } + } + this._persistentRefsCache = null; + } + setStartXRef(startXRef) { + this.startXRefQueue = [startXRef]; + } + parse(recoveryMode = false) { + let trailerDict; + if (!recoveryMode) { + trailerDict = this.readXRef(); + } else { + warn("Indexing all PDF objects"); + trailerDict = this.indexObjects(); + } + trailerDict.assignXref(this); + this.trailer = trailerDict; + let encrypt; + try { + encrypt = trailerDict.get("Encrypt"); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`XRef.parse - Invalid "Encrypt" reference: "${ex}".`); + } + if (encrypt instanceof Dict) { + const ids = trailerDict.get("ID"); + const fileId = ids?.length ? ids[0] : ""; + encrypt.suppressEncryption = true; + this.encrypt = new CipherTransformFactory(encrypt, fileId, this.pdfManager.password); + } + let root; + try { + root = trailerDict.get("Root"); + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`XRef.parse - Invalid "Root" reference: "${ex}".`); + } + if (root instanceof Dict) { + try { + const pages = root.get("Pages"); + if (pages instanceof Dict) { + this.root = root; + return; + } + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`XRef.parse - Invalid "Pages" reference: "${ex}".`); + } + } + if (!recoveryMode) { + throw new XRefParseException(); + } + throw new InvalidPDFException("Invalid Root reference."); + } + processXRefTable(parser) { + if (!("tableState" in this)) { + this.tableState = { + entryNum: 0, + streamPos: parser.lexer.stream.pos, + parserBuf1: parser.buf1, + parserBuf2: parser.buf2 + }; + } + const obj = this.readXRefTable(parser); + if (!isCmd(obj, "trailer")) { + throw new FormatError("Invalid XRef table: could not find trailer dictionary"); + } + let dict = parser.getObj(); + if (!(dict instanceof Dict) && dict.dict) { + dict = dict.dict; + } + if (!(dict instanceof Dict)) { + throw new FormatError("Invalid XRef table: could not parse trailer dictionary"); + } + delete this.tableState; + return dict; + } + readXRefTable(parser) { + const stream = parser.lexer.stream; + const tableState = this.tableState; + stream.pos = tableState.streamPos; + parser.buf1 = tableState.parserBuf1; + parser.buf2 = tableState.parserBuf2; + let obj; + while (true) { + if (!("firstEntryNum" in tableState) || !("entryCount" in tableState)) { + if (isCmd(obj = parser.getObj(), "trailer")) { + break; + } + tableState.firstEntryNum = obj; + tableState.entryCount = parser.getObj(); + } + let first = tableState.firstEntryNum; + const count = tableState.entryCount; + if (!Number.isInteger(first) || !Number.isInteger(count)) { + throw new FormatError("Invalid XRef table: wrong types in subsection header"); + } + for (let i = tableState.entryNum; i < count; i++) { + tableState.streamPos = stream.pos; + tableState.entryNum = i; + tableState.parserBuf1 = parser.buf1; + tableState.parserBuf2 = parser.buf2; + const entry = {}; + entry.offset = parser.getObj(); + entry.gen = parser.getObj(); + const type = parser.getObj(); + if (type instanceof Cmd) { + switch (type.cmd) { + case "f": + entry.free = true; + break; + case "n": + entry.uncompressed = true; + break; + } + } + if (!Number.isInteger(entry.offset) || !Number.isInteger(entry.gen) || !(entry.free || entry.uncompressed)) { + throw new FormatError(`Invalid entry in XRef subsection: ${first}, ${count}`); + } + if (i === 0 && entry.free && first === 1) { + first = 0; + } + if (!this.entries[i + first]) { + this.entries[i + first] = entry; + } + } + tableState.entryNum = 0; + tableState.streamPos = stream.pos; + tableState.parserBuf1 = parser.buf1; + tableState.parserBuf2 = parser.buf2; + delete tableState.firstEntryNum; + delete tableState.entryCount; + } + if (this.entries[0] && !this.entries[0].free) { + throw new FormatError("Invalid XRef table: unexpected first object"); + } + return obj; + } + processXRefStream(stream) { + if (!("streamState" in this)) { + const streamParameters = stream.dict; + const byteWidths = streamParameters.get("W"); + let range = streamParameters.get("Index"); + if (!range) { + range = [0, streamParameters.get("Size")]; + } + this.streamState = { + entryRanges: range, + byteWidths, + entryNum: 0, + streamPos: stream.pos + }; + } + this.readXRefStream(stream); + delete this.streamState; + return stream.dict; + } + readXRefStream(stream) { + const streamState = this.streamState; + stream.pos = streamState.streamPos; + const [typeFieldWidth, offsetFieldWidth, generationFieldWidth] = streamState.byteWidths; + const entryRanges = streamState.entryRanges; + while (entryRanges.length > 0) { + const [first, n] = entryRanges; + if (!Number.isInteger(first) || !Number.isInteger(n)) { + throw new FormatError(`Invalid XRef range fields: ${first}, ${n}`); + } + if (!Number.isInteger(typeFieldWidth) || !Number.isInteger(offsetFieldWidth) || !Number.isInteger(generationFieldWidth)) { + throw new FormatError(`Invalid XRef entry fields length: ${first}, ${n}`); + } + for (let i = streamState.entryNum; i < n; ++i) { + streamState.entryNum = i; + streamState.streamPos = stream.pos; + let type = 0, + offset = 0, + generation = 0; + for (let j = 0; j < typeFieldWidth; ++j) { + const typeByte = stream.getByte(); + if (typeByte === -1) { + throw new FormatError("Invalid XRef byteWidths 'type'."); + } + type = type << 8 | typeByte; + } + if (typeFieldWidth === 0) { + type = 1; + } + for (let j = 0; j < offsetFieldWidth; ++j) { + const offsetByte = stream.getByte(); + if (offsetByte === -1) { + throw new FormatError("Invalid XRef byteWidths 'offset'."); + } + offset = offset << 8 | offsetByte; + } + for (let j = 0; j < generationFieldWidth; ++j) { + const generationByte = stream.getByte(); + if (generationByte === -1) { + throw new FormatError("Invalid XRef byteWidths 'generation'."); + } + generation = generation << 8 | generationByte; + } + const entry = {}; + entry.offset = offset; + entry.gen = generation; + switch (type) { + case 0: + entry.free = true; + break; + case 1: + entry.uncompressed = true; + break; + case 2: + break; + default: + throw new FormatError(`Invalid XRef entry type: ${type}`); + } + if (!this.entries[first + i]) { + this.entries[first + i] = entry; + } + } + streamState.entryNum = 0; + streamState.streamPos = stream.pos; + entryRanges.splice(0, 2); + } + } + indexObjects() { + const TAB = 0x9, + LF = 0xa, + CR = 0xd, + SPACE = 0x20; + const PERCENT = 0x25, + LT = 0x3c; + function readToken(data, offset) { + let token = "", + ch = data[offset]; + while (ch !== LF && ch !== CR && ch !== LT) { + if (++offset >= data.length) { + break; + } + token += String.fromCharCode(ch); + ch = data[offset]; + } + return token; + } + function skipUntil(data, offset, what) { + const length = what.length, + dataLength = data.length; + let skipped = 0; + while (offset < dataLength) { + let i = 0; + while (i < length && data[offset + i] === what[i]) { + ++i; + } + if (i >= length) { + break; + } + offset++; + skipped++; + } + return skipped; + } + const gEndobjRegExp = /\b(endobj|\d+\s+\d+\s+obj|xref|trailer\s*<<)\b/g; + const gStartxrefRegExp = /\b(startxref|\d+\s+\d+\s+obj)\b/g; + const objRegExp = /^(\d+)\s+(\d+)\s+obj\b/; + const trailerBytes = new Uint8Array([116, 114, 97, 105, 108, 101, 114]); + const startxrefBytes = new Uint8Array([115, 116, 97, 114, 116, 120, 114, 101, 102]); + const xrefBytes = new Uint8Array([47, 88, 82, 101, 102]); + this.entries.length = 0; + this._cacheMap.clear(); + const stream = this.stream; + stream.pos = 0; + const buffer = stream.getBytes(), + bufferStr = bytesToString(buffer), + length = buffer.length; + let position = stream.start; + const trailers = [], + xrefStms = []; + while (position < length) { + let ch = buffer[position]; + if (ch === TAB || ch === LF || ch === CR || ch === SPACE) { + ++position; + continue; + } + if (ch === PERCENT) { + do { + ++position; + if (position >= length) { + break; + } + ch = buffer[position]; + } while (ch !== LF && ch !== CR); + continue; + } + const token = readToken(buffer, position); + let m; + if (token.startsWith("xref") && (token.length === 4 || /\s/.test(token[4]))) { + position += skipUntil(buffer, position, trailerBytes); + trailers.push(position); + position += skipUntil(buffer, position, startxrefBytes); + } else if (m = objRegExp.exec(token)) { + const num = m[1] | 0, + gen = m[2] | 0; + const startPos = position + token.length; + let contentLength, + updateEntries = false; + if (!this.entries[num]) { + updateEntries = true; + } else if (this.entries[num].gen === gen) { + try { + const parser = new Parser({ + lexer: new Lexer(stream.makeSubStream(startPos)) + }); + parser.getObj(); + updateEntries = true; + } catch (ex) { + if (ex instanceof ParserEOFException) { + warn(`indexObjects -- checking object (${token}): "${ex}".`); + } else { + updateEntries = true; + } + } + } + if (updateEntries) { + this.entries[num] = { + offset: position - stream.start, + gen, + uncompressed: true + }; + } + gEndobjRegExp.lastIndex = startPos; + const match = gEndobjRegExp.exec(bufferStr); + if (match) { + const endPos = gEndobjRegExp.lastIndex + 1; + contentLength = endPos - position; + if (match[1] !== "endobj") { + warn(`indexObjects: Found "${match[1]}" inside of another "obj", ` + 'caused by missing "endobj" -- trying to recover.'); + contentLength -= match[1].length + 1; + } + } else { + contentLength = length - position; + } + const content = buffer.subarray(position, position + contentLength); + const xrefTagOffset = skipUntil(content, 0, xrefBytes); + if (xrefTagOffset < contentLength && content[xrefTagOffset + 5] < 64) { + xrefStms.push(position - stream.start); + this._xrefStms.add(position - stream.start); + } + position += contentLength; + } else if (token.startsWith("trailer") && (token.length === 7 || /\s/.test(token[7]))) { + trailers.push(position); + const startPos = position + token.length; + let contentLength; + gStartxrefRegExp.lastIndex = startPos; + const match = gStartxrefRegExp.exec(bufferStr); + if (match) { + const endPos = gStartxrefRegExp.lastIndex + 1; + contentLength = endPos - position; + if (match[1] !== "startxref") { + warn(`indexObjects: Found "${match[1]}" after "trailer", ` + 'caused by missing "startxref" -- trying to recover.'); + contentLength -= match[1].length + 1; + } + } else { + contentLength = length - position; + } + position += contentLength; + } else { + position += token.length + 1; + } + } + for (const xrefStm of xrefStms) { + this.startXRefQueue.push(xrefStm); + this.readXRef(true); + } + const trailerDicts = []; + let isEncrypted = false; + for (const trailer of trailers) { + stream.pos = trailer; + const parser = new Parser({ + lexer: new Lexer(stream), + xref: this, + allowStreams: true, + recoveryMode: true + }); + const obj = parser.getObj(); + if (!isCmd(obj, "trailer")) { + continue; + } + const dict = parser.getObj(); + if (!(dict instanceof Dict)) { + continue; + } + trailerDicts.push(dict); + if (dict.has("Encrypt")) { + isEncrypted = true; + } + } + let trailerDict, trailerError; + for (const dict of [...trailerDicts, "genFallback", ...trailerDicts]) { + if (dict === "genFallback") { + if (!trailerError) { + break; + } + this._generationFallback = true; + continue; + } + let validPagesDict = false; + try { + const rootDict = dict.get("Root"); + if (!(rootDict instanceof Dict)) { + continue; + } + const pagesDict = rootDict.get("Pages"); + if (!(pagesDict instanceof Dict)) { + continue; + } + const pagesCount = pagesDict.get("Count"); + if (Number.isInteger(pagesCount)) { + validPagesDict = true; + } + } catch (ex) { + trailerError = ex; + continue; + } + if (validPagesDict && (!isEncrypted || dict.has("Encrypt")) && dict.has("ID")) { + return dict; + } + trailerDict = dict; + } + if (trailerDict) { + return trailerDict; + } + if (this.topDict) { + return this.topDict; + } + throw new InvalidPDFException("Invalid PDF structure."); + } + readXRef(recoveryMode = false) { + const stream = this.stream; + const startXRefParsedCache = new Set(); + while (this.startXRefQueue.length) { + try { + const startXRef = this.startXRefQueue[0]; + if (startXRefParsedCache.has(startXRef)) { + warn("readXRef - skipping XRef table since it was already parsed."); + this.startXRefQueue.shift(); + continue; + } + startXRefParsedCache.add(startXRef); + stream.pos = startXRef + stream.start; + const parser = new Parser({ + lexer: new Lexer(stream), + xref: this, + allowStreams: true + }); + let obj = parser.getObj(); + let dict; + if (isCmd(obj, "xref")) { + dict = this.processXRefTable(parser); + if (!this.topDict) { + this.topDict = dict; + } + obj = dict.get("XRefStm"); + if (Number.isInteger(obj) && !this._xrefStms.has(obj)) { + this._xrefStms.add(obj); + this.startXRefQueue.push(obj); + this.#firstXRefStmPos ??= obj; + } + } else if (Number.isInteger(obj)) { + if (!Number.isInteger(parser.getObj()) || !isCmd(parser.getObj(), "obj") || !((obj = parser.getObj()) instanceof BaseStream)) { + throw new FormatError("Invalid XRef stream"); + } + dict = this.processXRefStream(obj); + if (!this.topDict) { + this.topDict = dict; + } + if (!dict) { + throw new FormatError("Failed to read XRef stream"); + } + } else { + throw new FormatError("Invalid XRef stream header"); + } + obj = dict.get("Prev"); + if (Number.isInteger(obj)) { + this.startXRefQueue.push(obj); + } else if (obj instanceof Ref) { + this.startXRefQueue.push(obj.num); + } + } catch (e) { + if (e instanceof MissingDataException) { + throw e; + } + info("(while reading XRef): " + e); + } + this.startXRefQueue.shift(); + } + if (this.topDict) { + return this.topDict; + } + if (recoveryMode) { + return undefined; + } + throw new XRefParseException(); + } + get lastXRefStreamPos() { + return this.#firstXRefStmPos ?? (this._xrefStms.size > 0 ? Math.max(...this._xrefStms) : null); + } + getEntry(i) { + const xrefEntry = this.entries[i]; + if (xrefEntry && !xrefEntry.free && xrefEntry.offset) { + return xrefEntry; + } + return null; + } + fetchIfRef(obj, suppressEncryption = false) { + if (obj instanceof Ref) { + return this.fetch(obj, suppressEncryption); + } + return obj; + } + fetch(ref, suppressEncryption = false) { + if (!(ref instanceof Ref)) { + throw new Error("ref object is not a reference"); + } + const num = ref.num; + const cacheEntry = this._cacheMap.get(num); + if (cacheEntry !== undefined) { + if (cacheEntry instanceof Dict && !cacheEntry.objId) { + cacheEntry.objId = ref.toString(); + } + return cacheEntry; + } + let xrefEntry = this.getEntry(num); + if (xrefEntry === null) { + this._cacheMap.set(num, xrefEntry); + return xrefEntry; + } + if (this._pendingRefs.has(ref)) { + this._pendingRefs.remove(ref); + warn(`Ignoring circular reference: ${ref}.`); + return CIRCULAR_REF; + } + this._pendingRefs.put(ref); + try { + xrefEntry = xrefEntry.uncompressed ? this.fetchUncompressed(ref, xrefEntry, suppressEncryption) : this.fetchCompressed(ref, xrefEntry, suppressEncryption); + this._pendingRefs.remove(ref); + } catch (ex) { + this._pendingRefs.remove(ref); + throw ex; + } + if (xrefEntry instanceof Dict) { + xrefEntry.objId = ref.toString(); + } else if (xrefEntry instanceof BaseStream) { + xrefEntry.dict.objId = ref.toString(); + } + return xrefEntry; + } + fetchUncompressed(ref, xrefEntry, suppressEncryption = false) { + const gen = ref.gen; + let num = ref.num; + if (xrefEntry.gen !== gen) { + const msg = `Inconsistent generation in XRef: ${ref}`; + if (this._generationFallback && xrefEntry.gen < gen) { + warn(msg); + return this.fetchUncompressed(Ref.get(num, xrefEntry.gen), xrefEntry, suppressEncryption); + } + throw new XRefEntryException(msg); + } + const stream = this.stream.makeSubStream(xrefEntry.offset + this.stream.start); + const parser = new Parser({ + lexer: new Lexer(stream), + xref: this, + allowStreams: true + }); + const obj1 = parser.getObj(); + const obj2 = parser.getObj(); + const obj3 = parser.getObj(); + if (obj1 !== num || obj2 !== gen || !(obj3 instanceof Cmd)) { + throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${ref}`); + } + if (obj3.cmd !== "obj") { + if (obj3.cmd.startsWith("obj")) { + num = parseInt(obj3.cmd.substring(3), 10); + if (!Number.isNaN(num)) { + return num; + } + } + throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${ref}`); + } + xrefEntry = this.encrypt && !suppressEncryption ? parser.getObj(this.encrypt.createCipherTransform(num, gen)) : parser.getObj(); + if (!(xrefEntry instanceof BaseStream)) { + this._cacheMap.set(num, xrefEntry); + } + return xrefEntry; + } + fetchCompressed(ref, xrefEntry, suppressEncryption = false) { + const tableOffset = xrefEntry.offset; + const stream = this.fetch(Ref.get(tableOffset, 0)); + if (!(stream instanceof BaseStream)) { + throw new FormatError("bad ObjStm stream"); + } + const first = stream.dict.get("First"); + const n = stream.dict.get("N"); + if (!Number.isInteger(first) || !Number.isInteger(n)) { + throw new FormatError("invalid first and n parameters for ObjStm stream"); + } + let parser = new Parser({ + lexer: new Lexer(stream), + xref: this, + allowStreams: true + }); + const nums = new Array(n); + const offsets = new Array(n); + for (let i = 0; i < n; ++i) { + const num = parser.getObj(); + if (!Number.isInteger(num)) { + throw new FormatError(`invalid object number in the ObjStm stream: ${num}`); + } + const offset = parser.getObj(); + if (!Number.isInteger(offset)) { + throw new FormatError(`invalid object offset in the ObjStm stream: ${offset}`); + } + nums[i] = num; + offsets[i] = offset; + } + const start = (stream.start || 0) + first; + const entries = new Array(n); + for (let i = 0; i < n; ++i) { + const length = i < n - 1 ? offsets[i + 1] - offsets[i] : undefined; + if (length < 0) { + throw new FormatError("Invalid offset in the ObjStm stream."); + } + parser = new Parser({ + lexer: new Lexer(stream.makeSubStream(start + offsets[i], length, stream.dict)), + xref: this, + allowStreams: true + }); + const obj = parser.getObj(); + entries[i] = obj; + if (obj instanceof BaseStream) { + continue; + } + const num = nums[i], + entry = this.entries[num]; + if (entry && entry.offset === tableOffset && entry.gen === i) { + this._cacheMap.set(num, obj); + } + } + xrefEntry = entries[xrefEntry.gen]; + if (xrefEntry === undefined) { + throw new XRefEntryException(`Bad (compressed) XRef entry: ${ref}`); + } + return xrefEntry; + } + async fetchIfRefAsync(obj, suppressEncryption) { + if (obj instanceof Ref) { + return this.fetchAsync(obj, suppressEncryption); + } + return obj; + } + async fetchAsync(ref, suppressEncryption) { + try { + return this.fetch(ref, suppressEncryption); + } catch (ex) { + if (!(ex instanceof MissingDataException)) { + throw ex; + } + await this.pdfManager.requestRange(ex.begin, ex.end); + return this.fetchAsync(ref, suppressEncryption); + } + } + getCatalogObj() { + return this.root; + } +} + +;// CONCATENATED MODULE: ./src/core/document.js + + + + + + + + + + + + + + + + + + + + +const DEFAULT_USER_UNIT = 1.0; +const LETTER_SIZE_MEDIABOX = [0, 0, 612, 792]; +class Page { + constructor({ + pdfManager, + xref, + pageIndex, + pageDict, + ref, + globalIdFactory, + fontCache, + builtInCMapCache, + standardFontDataCache, + globalImageCache, + systemFontCache, + nonBlendModesSet, + xfaFactory + }) { + this.pdfManager = pdfManager; + this.pageIndex = pageIndex; + this.pageDict = pageDict; + this.xref = xref; + this.ref = ref; + this.fontCache = fontCache; + this.builtInCMapCache = builtInCMapCache; + this.standardFontDataCache = standardFontDataCache; + this.globalImageCache = globalImageCache; + this.systemFontCache = systemFontCache; + this.nonBlendModesSet = nonBlendModesSet; + this.evaluatorOptions = pdfManager.evaluatorOptions; + this.resourcesPromise = null; + this.xfaFactory = xfaFactory; + const idCounters = { + obj: 0 + }; + this._localIdFactory = class extends globalIdFactory { + static createObjId() { + return `p${pageIndex}_${++idCounters.obj}`; + } + static getPageObjId() { + return `p${ref.toString()}`; + } + }; + } + _getInheritableProperty(key, getArray = false) { + const value = getInheritableProperty({ + dict: this.pageDict, + key, + getArray, + stopWhenFound: false + }); + if (!Array.isArray(value)) { + return value; + } + if (value.length === 1 || !(value[0] instanceof Dict)) { + return value[0]; + } + return Dict.merge({ + xref: this.xref, + dictArray: value + }); + } + get content() { + return this.pageDict.getArray("Contents"); + } + get resources() { + const resources = this._getInheritableProperty("Resources"); + return shadow(this, "resources", resources instanceof Dict ? resources : Dict.empty); + } + _getBoundingBox(name) { + if (this.xfaData) { + return this.xfaData.bbox; + } + let box = this._getInheritableProperty(name, true); + if (Array.isArray(box) && box.length === 4) { + box = Util.normalizeRect(box); + if (box[2] - box[0] > 0 && box[3] - box[1] > 0) { + return box; + } + warn(`Empty, or invalid, /${name} entry.`); + } + return null; + } + get mediaBox() { + return shadow(this, "mediaBox", this._getBoundingBox("MediaBox") || LETTER_SIZE_MEDIABOX); + } + get cropBox() { + return shadow(this, "cropBox", this._getBoundingBox("CropBox") || this.mediaBox); + } + get userUnit() { + let obj = this.pageDict.get("UserUnit"); + if (typeof obj !== "number" || obj <= 0) { + obj = DEFAULT_USER_UNIT; + } + return shadow(this, "userUnit", obj); + } + get view() { + const { + cropBox, + mediaBox + } = this; + if (cropBox !== mediaBox && !isArrayEqual(cropBox, mediaBox)) { + const box = Util.intersect(cropBox, mediaBox); + if (box && box[2] - box[0] > 0 && box[3] - box[1] > 0) { + return shadow(this, "view", box); + } + warn("Empty /CropBox and /MediaBox intersection."); + } + return shadow(this, "view", mediaBox); + } + get rotate() { + let rotate = this._getInheritableProperty("Rotate") || 0; + if (rotate % 90 !== 0) { + rotate = 0; + } else if (rotate >= 360) { + rotate %= 360; + } else if (rotate < 0) { + rotate = (rotate % 360 + 360) % 360; + } + return shadow(this, "rotate", rotate); + } + _onSubStreamError(reason, objId) { + if (this.evaluatorOptions.ignoreErrors) { + warn(`getContentStream - ignoring sub-stream (${objId}): "${reason}".`); + return; + } + throw reason; + } + getContentStream() { + return this.pdfManager.ensure(this, "content").then(content => { + if (content instanceof BaseStream) { + return content; + } + if (Array.isArray(content)) { + return new StreamsSequenceStream(content, this._onSubStreamError.bind(this)); + } + return new NullStream(); + }); + } + get xfaData() { + return shadow(this, "xfaData", this.xfaFactory ? { + bbox: this.xfaFactory.getBoundingBox(this.pageIndex) + } : null); + } + #replaceIdByRef(annotations, deletedAnnotations, existingAnnotations) { + for (const annotation of annotations) { + if (annotation.id) { + const ref = Ref.fromString(annotation.id); + if (!ref) { + warn(`A non-linked annotation cannot be modified: ${annotation.id}`); + continue; + } + if (annotation.deleted) { + deletedAnnotations.put(ref); + continue; + } + existingAnnotations?.put(ref); + annotation.ref = ref; + delete annotation.id; + } + } + } + async saveNewAnnotations(handler, task, annotations, imagePromises) { + if (this.xfaFactory) { + throw new Error("XFA: Cannot save new annotations."); + } + const partialEvaluator = new PartialEvaluator({ + xref: this.xref, + handler, + pageIndex: this.pageIndex, + idFactory: this._localIdFactory, + fontCache: this.fontCache, + builtInCMapCache: this.builtInCMapCache, + standardFontDataCache: this.standardFontDataCache, + globalImageCache: this.globalImageCache, + systemFontCache: this.systemFontCache, + options: this.evaluatorOptions + }); + const deletedAnnotations = new RefSet(); + const existingAnnotations = new RefSet(); + this.#replaceIdByRef(annotations, deletedAnnotations, existingAnnotations); + const pageDict = this.pageDict; + const annotationsArray = this.annotations.filter(a => !(a instanceof Ref && deletedAnnotations.has(a))); + const newData = await AnnotationFactory.saveNewAnnotations(partialEvaluator, task, annotations, imagePromises); + for (const { + ref + } of newData.annotations) { + if (ref instanceof Ref && !existingAnnotations.has(ref)) { + annotationsArray.push(ref); + } + } + const savedDict = pageDict.get("Annots"); + pageDict.set("Annots", annotationsArray); + const buffer = []; + await writeObject(this.ref, pageDict, buffer, this.xref); + if (savedDict) { + pageDict.set("Annots", savedDict); + } + const objects = newData.dependencies; + objects.push({ + ref: this.ref, + data: buffer.join("") + }, ...newData.annotations); + return objects; + } + save(handler, task, annotationStorage) { + const partialEvaluator = new PartialEvaluator({ + xref: this.xref, + handler, + pageIndex: this.pageIndex, + idFactory: this._localIdFactory, + fontCache: this.fontCache, + builtInCMapCache: this.builtInCMapCache, + standardFontDataCache: this.standardFontDataCache, + globalImageCache: this.globalImageCache, + systemFontCache: this.systemFontCache, + options: this.evaluatorOptions + }); + return this._parsedAnnotations.then(function (annotations) { + const newRefsPromises = []; + for (const annotation of annotations) { + if (!annotation.mustBePrinted(annotationStorage)) { + continue; + } + newRefsPromises.push(annotation.save(partialEvaluator, task, annotationStorage).catch(function (reason) { + warn("save - ignoring annotation data during " + `"${task.name}" task: "${reason}".`); + return null; + })); + } + return Promise.all(newRefsPromises).then(function (newRefs) { + return newRefs.filter(newRef => !!newRef); + }); + }); + } + loadResources(keys) { + if (!this.resourcesPromise) { + this.resourcesPromise = this.pdfManager.ensure(this, "resources"); + } + return this.resourcesPromise.then(() => { + const objectLoader = new ObjectLoader(this.resources, keys, this.xref); + return objectLoader.load(); + }); + } + getOperatorList({ + handler, + sink, + task, + intent, + cacheKey, + annotationStorage = null + }) { + const contentStreamPromise = this.getContentStream(); + const resourcesPromise = this.loadResources(["ColorSpace", "ExtGState", "Font", "Pattern", "Properties", "Shading", "XObject"]); + const partialEvaluator = new PartialEvaluator({ + xref: this.xref, + handler, + pageIndex: this.pageIndex, + idFactory: this._localIdFactory, + fontCache: this.fontCache, + builtInCMapCache: this.builtInCMapCache, + standardFontDataCache: this.standardFontDataCache, + globalImageCache: this.globalImageCache, + systemFontCache: this.systemFontCache, + options: this.evaluatorOptions + }); + const newAnnotationsByPage = !this.xfaFactory ? getNewAnnotationsMap(annotationStorage) : null; + let deletedAnnotations = null; + let newAnnotationsPromise = Promise.resolve(null); + if (newAnnotationsByPage) { + const newAnnotations = newAnnotationsByPage.get(this.pageIndex); + if (newAnnotations) { + const annotationGlobalsPromise = this.pdfManager.ensureDoc("annotationGlobals"); + let imagePromises; + const missingBitmaps = new Set(); + for (const { + bitmapId, + bitmap + } of newAnnotations) { + if (bitmapId && !bitmap && !missingBitmaps.has(bitmapId)) { + missingBitmaps.add(bitmapId); + } + } + const { + isOffscreenCanvasSupported + } = this.evaluatorOptions; + if (missingBitmaps.size > 0) { + const annotationWithBitmaps = newAnnotations.slice(); + for (const [key, annotation] of annotationStorage) { + if (!key.startsWith(AnnotationEditorPrefix)) { + continue; + } + if (annotation.bitmap && missingBitmaps.has(annotation.bitmapId)) { + annotationWithBitmaps.push(annotation); + } + } + imagePromises = AnnotationFactory.generateImages(annotationWithBitmaps, this.xref, isOffscreenCanvasSupported); + } else { + imagePromises = AnnotationFactory.generateImages(newAnnotations, this.xref, isOffscreenCanvasSupported); + } + deletedAnnotations = new RefSet(); + this.#replaceIdByRef(newAnnotations, deletedAnnotations, null); + newAnnotationsPromise = annotationGlobalsPromise.then(annotationGlobals => { + if (!annotationGlobals) { + return null; + } + return AnnotationFactory.printNewAnnotations(annotationGlobals, partialEvaluator, task, newAnnotations, imagePromises); + }); + } + } + const dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); + const pageListPromise = dataPromises.then(([contentStream]) => { + const opList = new OperatorList(intent, sink); + handler.send("StartRenderPage", { + transparency: partialEvaluator.hasBlendModes(this.resources, this.nonBlendModesSet), + pageIndex: this.pageIndex, + cacheKey + }); + return partialEvaluator.getOperatorList({ + stream: contentStream, + task, + resources: this.resources, + operatorList: opList + }).then(function () { + return opList; + }); + }); + return Promise.all([pageListPromise, this._parsedAnnotations, newAnnotationsPromise]).then(function ([pageOpList, annotations, newAnnotations]) { + if (newAnnotations) { + annotations = annotations.filter(a => !(a.ref && deletedAnnotations.has(a.ref))); + for (let i = 0, ii = newAnnotations.length; i < ii; i++) { + const newAnnotation = newAnnotations[i]; + if (newAnnotation.refToReplace) { + const j = annotations.findIndex(a => a.ref && isRefsEqual(a.ref, newAnnotation.refToReplace)); + if (j >= 0) { + annotations.splice(j, 1, newAnnotation); + newAnnotations.splice(i--, 1); + ii--; + } + } + } + annotations = annotations.concat(newAnnotations); + } + if (annotations.length === 0 || intent & RenderingIntentFlag.ANNOTATIONS_DISABLE) { + pageOpList.flush(true); + return { + length: pageOpList.totalLength + }; + } + const renderForms = !!(intent & RenderingIntentFlag.ANNOTATIONS_FORMS), + intentAny = !!(intent & RenderingIntentFlag.ANY), + intentDisplay = !!(intent & RenderingIntentFlag.DISPLAY), + intentPrint = !!(intent & RenderingIntentFlag.PRINT); + const opListPromises = []; + for (const annotation of annotations) { + if (intentAny || intentDisplay && annotation.mustBeViewed(annotationStorage, renderForms) || intentPrint && annotation.mustBePrinted(annotationStorage)) { + opListPromises.push(annotation.getOperatorList(partialEvaluator, task, intent, renderForms, annotationStorage).catch(function (reason) { + warn("getOperatorList - ignoring annotation data during " + `"${task.name}" task: "${reason}".`); + return { + opList: null, + separateForm: false, + separateCanvas: false + }; + })); + } + } + return Promise.all(opListPromises).then(function (opLists) { + let form = false, + canvas = false; + for (const { + opList, + separateForm, + separateCanvas + } of opLists) { + pageOpList.addOpList(opList); + form ||= separateForm; + canvas ||= separateCanvas; + } + pageOpList.flush(true, { + form, + canvas + }); + return { + length: pageOpList.totalLength + }; + }); + }); + } + extractTextContent({ + handler, + task, + includeMarkedContent, + disableNormalization, + sink + }) { + const contentStreamPromise = this.getContentStream(); + const resourcesPromise = this.loadResources(["ExtGState", "Font", "Properties", "XObject"]); + const dataPromises = Promise.all([contentStreamPromise, resourcesPromise]); + return dataPromises.then(([contentStream]) => { + const partialEvaluator = new PartialEvaluator({ + xref: this.xref, + handler, + pageIndex: this.pageIndex, + idFactory: this._localIdFactory, + fontCache: this.fontCache, + builtInCMapCache: this.builtInCMapCache, + standardFontDataCache: this.standardFontDataCache, + globalImageCache: this.globalImageCache, + systemFontCache: this.systemFontCache, + options: this.evaluatorOptions + }); + return partialEvaluator.getTextContent({ + stream: contentStream, + task, + resources: this.resources, + includeMarkedContent, + disableNormalization, + sink, + viewBox: this.view + }); + }); + } + async getStructTree() { + const structTreeRoot = await this.pdfManager.ensureCatalog("structTreeRoot"); + if (!structTreeRoot) { + return null; + } + await this._parsedAnnotations; + const structTree = await this.pdfManager.ensure(this, "_parseStructTree", [structTreeRoot]); + return structTree.serializable; + } + _parseStructTree(structTreeRoot) { + const tree = new StructTreePage(structTreeRoot, this.pageDict); + tree.parse(this.ref); + return tree; + } + async getAnnotationsData(handler, task, intent) { + const annotations = await this._parsedAnnotations; + if (annotations.length === 0) { + return annotations; + } + const annotationsData = [], + textContentPromises = []; + let partialEvaluator; + const intentAny = !!(intent & RenderingIntentFlag.ANY), + intentDisplay = !!(intent & RenderingIntentFlag.DISPLAY), + intentPrint = !!(intent & RenderingIntentFlag.PRINT); + for (const annotation of annotations) { + const isVisible = intentAny || intentDisplay && annotation.viewable; + if (isVisible || intentPrint && annotation.printable) { + annotationsData.push(annotation.data); + } + if (annotation.hasTextContent && isVisible) { + partialEvaluator ||= new PartialEvaluator({ + xref: this.xref, + handler, + pageIndex: this.pageIndex, + idFactory: this._localIdFactory, + fontCache: this.fontCache, + builtInCMapCache: this.builtInCMapCache, + standardFontDataCache: this.standardFontDataCache, + globalImageCache: this.globalImageCache, + systemFontCache: this.systemFontCache, + options: this.evaluatorOptions + }); + textContentPromises.push(annotation.extractTextContent(partialEvaluator, task, [-Infinity, -Infinity, Infinity, Infinity]).catch(function (reason) { + warn(`getAnnotationsData - ignoring textContent during "${task.name}" task: "${reason}".`); + })); + } + } + await Promise.all(textContentPromises); + return annotationsData; + } + get annotations() { + const annots = this._getInheritableProperty("Annots"); + return shadow(this, "annotations", Array.isArray(annots) ? annots : []); + } + get _parsedAnnotations() { + const promise = this.pdfManager.ensure(this, "annotations").then(async annots => { + if (annots.length === 0) { + return annots; + } + const annotationGlobals = await this.pdfManager.ensureDoc("annotationGlobals"); + if (!annotationGlobals) { + return []; + } + const annotationPromises = []; + for (const annotationRef of annots) { + annotationPromises.push(AnnotationFactory.create(this.xref, annotationRef, annotationGlobals, this._localIdFactory, false, this.ref).catch(function (reason) { + warn(`_parsedAnnotations: "${reason}".`); + return null; + })); + } + const sortedAnnotations = []; + let popupAnnotations; + for (const annotation of await Promise.all(annotationPromises)) { + if (!annotation) { + continue; + } + if (annotation instanceof PopupAnnotation) { + (popupAnnotations ||= []).push(annotation); + continue; + } + sortedAnnotations.push(annotation); + } + if (popupAnnotations) { + sortedAnnotations.push(...popupAnnotations); + } + return sortedAnnotations; + }); + return shadow(this, "_parsedAnnotations", promise); + } + get jsActions() { + const actions = collectActions(this.xref, this.pageDict, PageActionEventType); + return shadow(this, "jsActions", actions); + } +} +const PDF_HEADER_SIGNATURE = new Uint8Array([0x25, 0x50, 0x44, 0x46, 0x2d]); +const STARTXREF_SIGNATURE = new Uint8Array([0x73, 0x74, 0x61, 0x72, 0x74, 0x78, 0x72, 0x65, 0x66]); +const ENDOBJ_SIGNATURE = new Uint8Array([0x65, 0x6e, 0x64, 0x6f, 0x62, 0x6a]); +const FINGERPRINT_FIRST_BYTES = 1024; +const EMPTY_FINGERPRINT = "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"; +function find(stream, signature, limit = 1024, backwards = false) { + const signatureLength = signature.length; + const scanBytes = stream.peekBytes(limit); + const scanLength = scanBytes.length - signatureLength; + if (scanLength <= 0) { + return false; + } + if (backwards) { + const signatureEnd = signatureLength - 1; + let pos = scanBytes.length - 1; + while (pos >= signatureEnd) { + let j = 0; + while (j < signatureLength && scanBytes[pos - j] === signature[signatureEnd - j]) { + j++; + } + if (j >= signatureLength) { + stream.pos += pos - signatureEnd; + return true; + } + pos--; + } + } else { + let pos = 0; + while (pos <= scanLength) { + let j = 0; + while (j < signatureLength && scanBytes[pos + j] === signature[j]) { + j++; + } + if (j >= signatureLength) { + stream.pos += pos; + return true; + } + pos++; + } + } + return false; +} +class PDFDocument { + constructor(pdfManager, stream) { + if (stream.length <= 0) { + throw new InvalidPDFException("The PDF file is empty, i.e. its size is zero bytes."); + } + this.pdfManager = pdfManager; + this.stream = stream; + this.xref = new XRef(stream, pdfManager); + this._pagePromises = new Map(); + this._version = null; + const idCounters = { + font: 0 + }; + this._globalIdFactory = class { + static getDocId() { + return `g_${pdfManager.docId}`; + } + static createFontId() { + return `f${++idCounters.font}`; + } + static createObjId() { + unreachable("Abstract method `createObjId` called."); + } + static getPageObjId() { + unreachable("Abstract method `getPageObjId` called."); + } + }; + } + parse(recoveryMode) { + this.xref.parse(recoveryMode); + this.catalog = new Catalog(this.pdfManager, this.xref); + } + get linearization() { + let linearization = null; + try { + linearization = Linearization.create(this.stream); + } catch (err) { + if (err instanceof MissingDataException) { + throw err; + } + info(err); + } + return shadow(this, "linearization", linearization); + } + get startXRef() { + const stream = this.stream; + let startXRef = 0; + if (this.linearization) { + stream.reset(); + if (find(stream, ENDOBJ_SIGNATURE)) { + startXRef = stream.pos + 6 - stream.start; + } + } else { + const step = 1024; + const startXRefLength = STARTXREF_SIGNATURE.length; + let found = false, + pos = stream.end; + while (!found && pos > 0) { + pos -= step - startXRefLength; + if (pos < 0) { + pos = 0; + } + stream.pos = pos; + found = find(stream, STARTXREF_SIGNATURE, step, true); + } + if (found) { + stream.skip(9); + let ch; + do { + ch = stream.getByte(); + } while (isWhiteSpace(ch)); + let str = ""; + while (ch >= 0x20 && ch <= 0x39) { + str += String.fromCharCode(ch); + ch = stream.getByte(); + } + startXRef = parseInt(str, 10); + if (isNaN(startXRef)) { + startXRef = 0; + } + } + } + return shadow(this, "startXRef", startXRef); + } + checkHeader() { + const stream = this.stream; + stream.reset(); + if (!find(stream, PDF_HEADER_SIGNATURE)) { + return; + } + stream.moveStart(); + stream.skip(PDF_HEADER_SIGNATURE.length); + let version = "", + ch; + while ((ch = stream.getByte()) > 0x20 && version.length < 7) { + version += String.fromCharCode(ch); + } + if (PDF_VERSION_REGEXP.test(version)) { + this._version = version; + } else { + warn(`Invalid PDF header version: ${version}`); + } + } + parseStartXRef() { + this.xref.setStartXRef(this.startXRef); + } + get numPages() { + let num = 0; + if (this.catalog.hasActualNumPages) { + num = this.catalog.numPages; + } else if (this.xfaFactory) { + num = this.xfaFactory.getNumPages(); + } else if (this.linearization) { + num = this.linearization.numPages; + } else { + num = this.catalog.numPages; + } + return shadow(this, "numPages", num); + } + _hasOnlyDocumentSignatures(fields, recursionDepth = 0) { + const RECURSION_LIMIT = 10; + if (!Array.isArray(fields)) { + return false; + } + return fields.every(field => { + field = this.xref.fetchIfRef(field); + if (!(field instanceof Dict)) { + return false; + } + if (field.has("Kids")) { + if (++recursionDepth > RECURSION_LIMIT) { + warn("_hasOnlyDocumentSignatures: maximum recursion depth reached"); + return false; + } + return this._hasOnlyDocumentSignatures(field.get("Kids"), recursionDepth); + } + const isSignature = isName(field.get("FT"), "Sig"); + const rectangle = field.get("Rect"); + const isInvisible = Array.isArray(rectangle) && rectangle.every(value => value === 0); + return isSignature && isInvisible; + }); + } + get _xfaStreams() { + const acroForm = this.catalog.acroForm; + if (!acroForm) { + return null; + } + const xfa = acroForm.get("XFA"); + const entries = { + "xdp:xdp": "", + template: "", + datasets: "", + config: "", + connectionSet: "", + localeSet: "", + stylesheet: "", + "/xdp:xdp": "" + }; + if (xfa instanceof BaseStream && !xfa.isEmpty) { + entries["xdp:xdp"] = xfa; + return entries; + } + if (!Array.isArray(xfa) || xfa.length === 0) { + return null; + } + for (let i = 0, ii = xfa.length; i < ii; i += 2) { + let name; + if (i === 0) { + name = "xdp:xdp"; + } else if (i === ii - 2) { + name = "/xdp:xdp"; + } else { + name = xfa[i]; + } + if (!entries.hasOwnProperty(name)) { + continue; + } + const data = this.xref.fetchIfRef(xfa[i + 1]); + if (!(data instanceof BaseStream) || data.isEmpty) { + continue; + } + entries[name] = data; + } + return entries; + } + get xfaDatasets() { + const streams = this._xfaStreams; + if (!streams) { + return shadow(this, "xfaDatasets", null); + } + for (const key of ["datasets", "xdp:xdp"]) { + const stream = streams[key]; + if (!stream) { + continue; + } + try { + const str = stringToUTF8String(stream.getString()); + const data = { + [key]: str + }; + return shadow(this, "xfaDatasets", new DatasetReader(data)); + } catch { + warn("XFA - Invalid utf-8 string."); + break; + } + } + return shadow(this, "xfaDatasets", null); + } + get xfaData() { + const streams = this._xfaStreams; + if (!streams) { + return null; + } + const data = Object.create(null); + for (const [key, stream] of Object.entries(streams)) { + if (!stream) { + continue; + } + try { + data[key] = stringToUTF8String(stream.getString()); + } catch { + warn("XFA - Invalid utf-8 string."); + return null; + } + } + return data; + } + get xfaFactory() { + let data; + if (this.pdfManager.enableXfa && this.catalog.needsRendering && this.formInfo.hasXfa && !this.formInfo.hasAcroForm) { + data = this.xfaData; + } + return shadow(this, "xfaFactory", data ? new XFAFactory(data) : null); + } + get isPureXfa() { + return this.xfaFactory ? this.xfaFactory.isValid() : false; + } + get htmlForXfa() { + return this.xfaFactory ? this.xfaFactory.getPages() : null; + } + async loadXfaImages() { + const xfaImagesDict = await this.pdfManager.ensureCatalog("xfaImages"); + if (!xfaImagesDict) { + return; + } + const keys = xfaImagesDict.getKeys(); + const objectLoader = new ObjectLoader(xfaImagesDict, keys, this.xref); + await objectLoader.load(); + const xfaImages = new Map(); + for (const key of keys) { + const stream = xfaImagesDict.get(key); + if (stream instanceof BaseStream) { + xfaImages.set(key, stream.getBytes()); + } + } + this.xfaFactory.setImages(xfaImages); + } + async loadXfaFonts(handler, task) { + const acroForm = await this.pdfManager.ensureCatalog("acroForm"); + if (!acroForm) { + return; + } + const resources = await acroForm.getAsync("DR"); + if (!(resources instanceof Dict)) { + return; + } + const objectLoader = new ObjectLoader(resources, ["Font"], this.xref); + await objectLoader.load(); + const fontRes = resources.get("Font"); + if (!(fontRes instanceof Dict)) { + return; + } + const options = Object.assign(Object.create(null), this.pdfManager.evaluatorOptions); + options.useSystemFonts = false; + const partialEvaluator = new PartialEvaluator({ + xref: this.xref, + handler, + pageIndex: -1, + idFactory: this._globalIdFactory, + fontCache: this.catalog.fontCache, + builtInCMapCache: this.catalog.builtInCMapCache, + standardFontDataCache: this.catalog.standardFontDataCache, + options + }); + const operatorList = new OperatorList(); + const pdfFonts = []; + const initialState = { + get font() { + return pdfFonts.at(-1); + }, + set font(font) { + pdfFonts.push(font); + }, + clone() { + return this; + } + }; + const fonts = new Map(); + fontRes.forEach((fontName, font) => { + fonts.set(fontName, font); + }); + const promises = []; + for (const [fontName, font] of fonts) { + const descriptor = font.get("FontDescriptor"); + if (!(descriptor instanceof Dict)) { + continue; + } + let fontFamily = descriptor.get("FontFamily"); + fontFamily = fontFamily.replaceAll(/[ ]+(\d)/g, "$1"); + const fontWeight = descriptor.get("FontWeight"); + const italicAngle = -descriptor.get("ItalicAngle"); + const cssFontInfo = { + fontFamily, + fontWeight, + italicAngle + }; + if (!validateCSSFont(cssFontInfo)) { + continue; + } + promises.push(partialEvaluator.handleSetFont(resources, [Name.get(fontName), 1], null, operatorList, task, initialState, null, cssFontInfo).catch(function (reason) { + warn(`loadXfaFonts: "${reason}".`); + return null; + })); + } + await Promise.all(promises); + const missingFonts = this.xfaFactory.setFonts(pdfFonts); + if (!missingFonts) { + return; + } + options.ignoreErrors = true; + promises.length = 0; + pdfFonts.length = 0; + const reallyMissingFonts = new Set(); + for (const missing of missingFonts) { + if (!getXfaFontName(`${missing}-Regular`)) { + reallyMissingFonts.add(missing); + } + } + if (reallyMissingFonts.size) { + missingFonts.push("PdfJS-Fallback"); + } + for (const missing of missingFonts) { + if (reallyMissingFonts.has(missing)) { + continue; + } + for (const fontInfo of [{ + name: "Regular", + fontWeight: 400, + italicAngle: 0 + }, { + name: "Bold", + fontWeight: 700, + italicAngle: 0 + }, { + name: "Italic", + fontWeight: 400, + italicAngle: 12 + }, { + name: "BoldItalic", + fontWeight: 700, + italicAngle: 12 + }]) { + const name = `${missing}-${fontInfo.name}`; + const dict = getXfaFontDict(name); + promises.push(partialEvaluator.handleSetFont(resources, [Name.get(name), 1], null, operatorList, task, initialState, dict, { + fontFamily: missing, + fontWeight: fontInfo.fontWeight, + italicAngle: fontInfo.italicAngle + }).catch(function (reason) { + warn(`loadXfaFonts: "${reason}".`); + return null; + })); + } + } + await Promise.all(promises); + this.xfaFactory.appendFonts(pdfFonts, reallyMissingFonts); + } + async serializeXfaData(annotationStorage) { + return this.xfaFactory ? this.xfaFactory.serializeData(annotationStorage) : null; + } + get version() { + return this.catalog.version || this._version; + } + get formInfo() { + const formInfo = { + hasFields: false, + hasAcroForm: false, + hasXfa: false, + hasSignatures: false + }; + const acroForm = this.catalog.acroForm; + if (!acroForm) { + return shadow(this, "formInfo", formInfo); + } + try { + const fields = acroForm.get("Fields"); + const hasFields = Array.isArray(fields) && fields.length > 0; + formInfo.hasFields = hasFields; + const xfa = acroForm.get("XFA"); + formInfo.hasXfa = Array.isArray(xfa) && xfa.length > 0 || xfa instanceof BaseStream && !xfa.isEmpty; + const sigFlags = acroForm.get("SigFlags"); + const hasSignatures = !!(sigFlags & 0x1); + const hasOnlyDocumentSignatures = hasSignatures && this._hasOnlyDocumentSignatures(fields); + formInfo.hasAcroForm = hasFields && !hasOnlyDocumentSignatures; + formInfo.hasSignatures = hasSignatures; + } catch (ex) { + if (ex instanceof MissingDataException) { + throw ex; + } + warn(`Cannot fetch form information: "${ex}".`); + } + return shadow(this, "formInfo", formInfo); + } + get documentInfo() { + const docInfo = { + PDFFormatVersion: this.version, + Language: this.catalog.lang, + EncryptFilterName: this.xref.encrypt ? this.xref.encrypt.filterName : null, + IsLinearized: !!this.linearization, + IsAcroFormPresent: this.formInfo.hasAcroForm, + IsXFAPresent: this.formInfo.hasXfa, + IsCollectionPresent: !!this.catalog.collection, + IsSignaturesPresent: this.formInfo.hasSignatures + }; + let infoDict; + try { + infoDict = this.xref.trailer.get("Info"); + } catch (err) { + if (err instanceof MissingDataException) { + throw err; + } + info("The document information dictionary is invalid."); + } + if (!(infoDict instanceof Dict)) { + return shadow(this, "documentInfo", docInfo); + } + for (const key of infoDict.getKeys()) { + const value = infoDict.get(key); + switch (key) { + case "Title": + case "Author": + case "Subject": + case "Keywords": + case "Creator": + case "Producer": + case "CreationDate": + case "ModDate": + if (typeof value === "string") { + docInfo[key] = stringToPDFString(value); + continue; + } + break; + case "Trapped": + if (value instanceof Name) { + docInfo[key] = value; + continue; + } + break; + default: + let customValue; + switch (typeof value) { + case "string": + customValue = stringToPDFString(value); + break; + case "number": + case "boolean": + customValue = value; + break; + default: + if (value instanceof Name) { + customValue = value; + } + break; + } + if (customValue === undefined) { + warn(`Bad value, for custom key "${key}", in Info: ${value}.`); + continue; + } + if (!docInfo.Custom) { + docInfo.Custom = Object.create(null); + } + docInfo.Custom[key] = customValue; + continue; + } + warn(`Bad value, for key "${key}", in Info: ${value}.`); + } + return shadow(this, "documentInfo", docInfo); + } + get fingerprints() { + function validate(data) { + return typeof data === "string" && data.length > 0 && data !== EMPTY_FINGERPRINT; + } + function hexString(hash) { + const buf = []; + for (const num of hash) { + const hex = num.toString(16); + buf.push(hex.padStart(2, "0")); + } + return buf.join(""); + } + const idArray = this.xref.trailer.get("ID"); + let hashOriginal, hashModified; + if (Array.isArray(idArray) && validate(idArray[0])) { + hashOriginal = stringToBytes(idArray[0]); + if (idArray[1] !== idArray[0] && validate(idArray[1])) { + hashModified = stringToBytes(idArray[1]); + } + } else { + hashOriginal = calculateMD5(this.stream.getByteRange(0, FINGERPRINT_FIRST_BYTES), 0, FINGERPRINT_FIRST_BYTES); + } + return shadow(this, "fingerprints", [hexString(hashOriginal), hashModified ? hexString(hashModified) : null]); + } + async _getLinearizationPage(pageIndex) { + const { + catalog, + linearization, + xref + } = this; + const ref = Ref.get(linearization.objectNumberFirst, 0); + try { + const obj = await xref.fetchAsync(ref); + if (obj instanceof Dict) { + let type = obj.getRaw("Type"); + if (type instanceof Ref) { + type = await xref.fetchAsync(type); + } + if (isName(type, "Page") || !obj.has("Type") && !obj.has("Kids")) { + if (!catalog.pageKidsCountCache.has(ref)) { + catalog.pageKidsCountCache.put(ref, 1); + } + if (!catalog.pageIndexCache.has(ref)) { + catalog.pageIndexCache.put(ref, 0); + } + return [obj, ref]; + } + } + throw new FormatError("The Linearization dictionary doesn't point to a valid Page dictionary."); + } catch (reason) { + warn(`_getLinearizationPage: "${reason.message}".`); + return catalog.getPageDict(pageIndex); + } + } + getPage(pageIndex) { + const cachedPromise = this._pagePromises.get(pageIndex); + if (cachedPromise) { + return cachedPromise; + } + const { + catalog, + linearization, + xfaFactory + } = this; + let promise; + if (xfaFactory) { + promise = Promise.resolve([Dict.empty, null]); + } else if (linearization?.pageFirst === pageIndex) { + promise = this._getLinearizationPage(pageIndex); + } else { + promise = catalog.getPageDict(pageIndex); + } + promise = promise.then(([pageDict, ref]) => { + return new Page({ + pdfManager: this.pdfManager, + xref: this.xref, + pageIndex, + pageDict, + ref, + globalIdFactory: this._globalIdFactory, + fontCache: catalog.fontCache, + builtInCMapCache: catalog.builtInCMapCache, + standardFontDataCache: catalog.standardFontDataCache, + globalImageCache: catalog.globalImageCache, + systemFontCache: catalog.systemFontCache, + nonBlendModesSet: catalog.nonBlendModesSet, + xfaFactory + }); + }); + this._pagePromises.set(pageIndex, promise); + return promise; + } + async checkFirstPage(recoveryMode = false) { + if (recoveryMode) { + return; + } + try { + await this.getPage(0); + } catch (reason) { + if (reason instanceof XRefEntryException) { + this._pagePromises.delete(0); + await this.cleanup(); + throw new XRefParseException(); + } + } + } + async checkLastPage(recoveryMode = false) { + const { + catalog, + pdfManager + } = this; + catalog.setActualNumPages(); + let numPages; + try { + await Promise.all([pdfManager.ensureDoc("xfaFactory"), pdfManager.ensureDoc("linearization"), pdfManager.ensureCatalog("numPages")]); + if (this.xfaFactory) { + return; + } else if (this.linearization) { + numPages = this.linearization.numPages; + } else { + numPages = catalog.numPages; + } + if (!Number.isInteger(numPages)) { + throw new FormatError("Page count is not an integer."); + } else if (numPages <= 1) { + return; + } + await this.getPage(numPages - 1); + } catch (reason) { + this._pagePromises.delete(numPages - 1); + await this.cleanup(); + if (reason instanceof XRefEntryException && !recoveryMode) { + throw new XRefParseException(); + } + warn(`checkLastPage - invalid /Pages tree /Count: ${numPages}.`); + let pagesTree; + try { + pagesTree = await catalog.getAllPageDicts(recoveryMode); + } catch (reasonAll) { + if (reasonAll instanceof XRefEntryException && !recoveryMode) { + throw new XRefParseException(); + } + catalog.setActualNumPages(1); + return; + } + for (const [pageIndex, [pageDict, ref]] of pagesTree) { + let promise; + if (pageDict instanceof Error) { + promise = Promise.reject(pageDict); + promise.catch(() => {}); + } else { + promise = Promise.resolve(new Page({ + pdfManager, + xref: this.xref, + pageIndex, + pageDict, + ref, + globalIdFactory: this._globalIdFactory, + fontCache: catalog.fontCache, + builtInCMapCache: catalog.builtInCMapCache, + standardFontDataCache: catalog.standardFontDataCache, + globalImageCache: catalog.globalImageCache, + systemFontCache: catalog.systemFontCache, + nonBlendModesSet: catalog.nonBlendModesSet, + xfaFactory: null + })); + } + this._pagePromises.set(pageIndex, promise); + } + catalog.setActualNumPages(pagesTree.size); + } + } + fontFallback(id, handler) { + return this.catalog.fontFallback(id, handler); + } + async cleanup(manuallyTriggered = false) { + return this.catalog ? this.catalog.cleanup(manuallyTriggered) : clearGlobalCaches(); + } + async #collectFieldObjects(name, fieldRef, promises, annotationGlobals, visitedRefs) { + const { + xref + } = this; + if (!(fieldRef instanceof Ref) || visitedRefs.has(fieldRef)) { + return; + } + visitedRefs.put(fieldRef); + const field = await xref.fetchAsync(fieldRef); + if (!(field instanceof Dict)) { + return; + } + if (field.has("T")) { + const partName = stringToPDFString(await field.getAsync("T")); + name = name === "" ? partName : `${name}.${partName}`; + } else { + let obj = field; + while (true) { + obj = obj.getRaw("Parent"); + if (obj instanceof Ref) { + if (visitedRefs.has(obj)) { + break; + } + obj = await xref.fetchAsync(obj); + } + if (!(obj instanceof Dict)) { + break; + } + if (obj.has("T")) { + const partName = stringToPDFString(await obj.getAsync("T")); + name = name === "" ? partName : `${name}.${partName}`; + break; + } + } + } + if (!promises.has(name)) { + promises.set(name, []); + } + promises.get(name).push(AnnotationFactory.create(xref, fieldRef, annotationGlobals, null, true, null).then(annotation => annotation?.getFieldObject()).catch(function (reason) { + warn(`#collectFieldObjects: "${reason}".`); + return null; + })); + if (!field.has("Kids")) { + return; + } + const kids = await field.getAsync("Kids"); + if (Array.isArray(kids)) { + for (const kid of kids) { + await this.#collectFieldObjects(name, kid, promises, annotationGlobals, visitedRefs); + } + } + } + get fieldObjects() { + if (!this.formInfo.hasFields) { + return shadow(this, "fieldObjects", Promise.resolve(null)); + } + const promise = Promise.all([this.pdfManager.ensureDoc("annotationGlobals"), this.pdfManager.ensureCatalog("acroForm")]).then(async ([annotationGlobals, acroForm]) => { + if (!annotationGlobals) { + return null; + } + const visitedRefs = new RefSet(); + const allFields = Object.create(null); + const fieldPromises = new Map(); + for (const fieldRef of await acroForm.getAsync("Fields")) { + await this.#collectFieldObjects("", fieldRef, fieldPromises, annotationGlobals, visitedRefs); + } + const allPromises = []; + for (const [name, promises] of fieldPromises) { + allPromises.push(Promise.all(promises).then(fields => { + fields = fields.filter(field => !!field); + if (fields.length > 0) { + allFields[name] = fields; + } + })); + } + await Promise.all(allPromises); + return allFields; + }); + return shadow(this, "fieldObjects", promise); + } + get hasJSActions() { + const promise = this.pdfManager.ensureDoc("_parseHasJSActions"); + return shadow(this, "hasJSActions", promise); + } + async _parseHasJSActions() { + const [catalogJsActions, fieldObjects] = await Promise.all([this.pdfManager.ensureCatalog("jsActions"), this.pdfManager.ensureDoc("fieldObjects")]); + if (catalogJsActions) { + return true; + } + if (fieldObjects) { + return Object.values(fieldObjects).some(fieldObject => fieldObject.some(object => object.actions !== null)); + } + return false; + } + get calculationOrderIds() { + const acroForm = this.catalog.acroForm; + if (!acroForm?.has("CO")) { + return shadow(this, "calculationOrderIds", null); + } + const calculationOrder = acroForm.get("CO"); + if (!Array.isArray(calculationOrder) || calculationOrder.length === 0) { + return shadow(this, "calculationOrderIds", null); + } + const ids = []; + for (const id of calculationOrder) { + if (id instanceof Ref) { + ids.push(id.toString()); + } + } + if (ids.length === 0) { + return shadow(this, "calculationOrderIds", null); + } + return shadow(this, "calculationOrderIds", ids); + } + get annotationGlobals() { + return shadow(this, "annotationGlobals", AnnotationFactory.createGlobals(this.pdfManager)); + } +} + +;// CONCATENATED MODULE: ./src/core/pdf_manager.js + + + + + +function parseDocBaseUrl(url) { + if (url) { + const absoluteUrl = createValidAbsoluteUrl(url); + if (absoluteUrl) { + return absoluteUrl.href; + } + warn(`Invalid absolute docBaseUrl: "${url}".`); + } + return null; +} +class BasePdfManager { + constructor(args) { + if (this.constructor === BasePdfManager) { + unreachable("Cannot initialize BasePdfManager."); + } + this._docBaseUrl = parseDocBaseUrl(args.docBaseUrl); + this._docId = args.docId; + this._password = args.password; + this.enableXfa = args.enableXfa; + args.evaluatorOptions.isOffscreenCanvasSupported &&= FeatureTest.isOffscreenCanvasSupported; + this.evaluatorOptions = args.evaluatorOptions; + } + get docId() { + return this._docId; + } + get password() { + return this._password; + } + get docBaseUrl() { + return this._docBaseUrl; + } + get catalog() { + return this.pdfDocument.catalog; + } + ensureDoc(prop, args) { + return this.ensure(this.pdfDocument, prop, args); + } + ensureXRef(prop, args) { + return this.ensure(this.pdfDocument.xref, prop, args); + } + ensureCatalog(prop, args) { + return this.ensure(this.pdfDocument.catalog, prop, args); + } + getPage(pageIndex) { + return this.pdfDocument.getPage(pageIndex); + } + fontFallback(id, handler) { + return this.pdfDocument.fontFallback(id, handler); + } + loadXfaFonts(handler, task) { + return this.pdfDocument.loadXfaFonts(handler, task); + } + loadXfaImages() { + return this.pdfDocument.loadXfaImages(); + } + serializeXfaData(annotationStorage) { + return this.pdfDocument.serializeXfaData(annotationStorage); + } + cleanup(manuallyTriggered = false) { + return this.pdfDocument.cleanup(manuallyTriggered); + } + async ensure(obj, prop, args) { + unreachable("Abstract method `ensure` called"); + } + requestRange(begin, end) { + unreachable("Abstract method `requestRange` called"); + } + requestLoadedStream(noFetch = false) { + unreachable("Abstract method `requestLoadedStream` called"); + } + sendProgressiveData(chunk) { + unreachable("Abstract method `sendProgressiveData` called"); + } + updatePassword(password) { + this._password = password; + } + terminate(reason) { + unreachable("Abstract method `terminate` called"); + } +} +class LocalPdfManager extends BasePdfManager { + constructor(args) { + super(args); + const stream = new Stream(args.source); + this.pdfDocument = new PDFDocument(this, stream); + this._loadedStreamPromise = Promise.resolve(stream); + } + async ensure(obj, prop, args) { + const value = obj[prop]; + if (typeof value === "function") { + return value.apply(obj, args); + } + return value; + } + requestRange(begin, end) { + return Promise.resolve(); + } + requestLoadedStream(noFetch = false) { + return this._loadedStreamPromise; + } + terminate(reason) {} +} +class NetworkPdfManager extends BasePdfManager { + constructor(args) { + super(args); + this.streamManager = new ChunkedStreamManager(args.source, { + msgHandler: args.handler, + length: args.length, + disableAutoFetch: args.disableAutoFetch, + rangeChunkSize: args.rangeChunkSize + }); + this.pdfDocument = new PDFDocument(this, this.streamManager.getStream()); + } + async ensure(obj, prop, args) { + try { + const value = obj[prop]; + if (typeof value === "function") { + return value.apply(obj, args); + } + return value; + } catch (ex) { + if (!(ex instanceof MissingDataException)) { + throw ex; + } + await this.requestRange(ex.begin, ex.end); + return this.ensure(obj, prop, args); + } + } + requestRange(begin, end) { + return this.streamManager.requestRange(begin, end); + } + requestLoadedStream(noFetch = false) { + return this.streamManager.requestAllChunks(noFetch); + } + sendProgressiveData(chunk) { + this.streamManager.onReceiveData({ + chunk + }); + } + terminate(reason) { + this.streamManager.abort(reason); + } +} + +;// CONCATENATED MODULE: ./src/shared/message_handler.js + +const CallbackKind = { + UNKNOWN: 0, + DATA: 1, + ERROR: 2 +}; +const StreamKind = { + UNKNOWN: 0, + CANCEL: 1, + CANCEL_COMPLETE: 2, + CLOSE: 3, + ENQUEUE: 4, + ERROR: 5, + PULL: 6, + PULL_COMPLETE: 7, + START_COMPLETE: 8 +}; +function wrapReason(reason) { + if (!(reason instanceof Error || typeof reason === "object" && reason !== null)) { + unreachable('wrapReason: Expected "reason" to be a (possibly cloned) Error.'); + } + switch (reason.name) { + case "AbortException": + return new AbortException(reason.message); + case "MissingPDFException": + return new MissingPDFException(reason.message); + case "PasswordException": + return new PasswordException(reason.message, reason.code); + case "UnexpectedResponseException": + return new UnexpectedResponseException(reason.message, reason.status); + case "UnknownErrorException": + return new UnknownErrorException(reason.message, reason.details); + default: + return new UnknownErrorException(reason.message, reason.toString()); + } +} +class MessageHandler { + constructor(sourceName, targetName, comObj) { + this.sourceName = sourceName; + this.targetName = targetName; + this.comObj = comObj; + this.callbackId = 1; + this.streamId = 1; + this.streamSinks = Object.create(null); + this.streamControllers = Object.create(null); + this.callbackCapabilities = Object.create(null); + this.actionHandler = Object.create(null); + this._onComObjOnMessage = event => { + const data = event.data; + if (data.targetName !== this.sourceName) { + return; + } + if (data.stream) { + this.#processStreamMessage(data); + return; + } + if (data.callback) { + const callbackId = data.callbackId; + const capability = this.callbackCapabilities[callbackId]; + if (!capability) { + throw new Error(`Cannot resolve callback ${callbackId}`); + } + delete this.callbackCapabilities[callbackId]; + if (data.callback === CallbackKind.DATA) { + capability.resolve(data.data); + } else if (data.callback === CallbackKind.ERROR) { + capability.reject(wrapReason(data.reason)); + } else { + throw new Error("Unexpected callback case"); + } + return; + } + const action = this.actionHandler[data.action]; + if (!action) { + throw new Error(`Unknown action from worker: ${data.action}`); + } + if (data.callbackId) { + const cbSourceName = this.sourceName; + const cbTargetName = data.sourceName; + new Promise(function (resolve) { + resolve(action(data.data)); + }).then(function (result) { + comObj.postMessage({ + sourceName: cbSourceName, + targetName: cbTargetName, + callback: CallbackKind.DATA, + callbackId: data.callbackId, + data: result + }); + }, function (reason) { + comObj.postMessage({ + sourceName: cbSourceName, + targetName: cbTargetName, + callback: CallbackKind.ERROR, + callbackId: data.callbackId, + reason: wrapReason(reason) + }); + }); + return; + } + if (data.streamId) { + this.#createStreamSink(data); + return; + } + action(data.data); + }; + comObj.addEventListener("message", this._onComObjOnMessage); + } + on(actionName, handler) { + const ah = this.actionHandler; + if (ah[actionName]) { + throw new Error(`There is already an actionName called "${actionName}"`); + } + ah[actionName] = handler; + } + send(actionName, data, transfers) { + this.comObj.postMessage({ + sourceName: this.sourceName, + targetName: this.targetName, + action: actionName, + data + }, transfers); + } + sendWithPromise(actionName, data, transfers) { + const callbackId = this.callbackId++; + const capability = new PromiseCapability(); + this.callbackCapabilities[callbackId] = capability; + try { + this.comObj.postMessage({ + sourceName: this.sourceName, + targetName: this.targetName, + action: actionName, + callbackId, + data + }, transfers); + } catch (ex) { + capability.reject(ex); + } + return capability.promise; + } + sendWithStream(actionName, data, queueingStrategy, transfers) { + const streamId = this.streamId++, + sourceName = this.sourceName, + targetName = this.targetName, + comObj = this.comObj; + return new ReadableStream({ + start: controller => { + const startCapability = new PromiseCapability(); + this.streamControllers[streamId] = { + controller, + startCall: startCapability, + pullCall: null, + cancelCall: null, + isClosed: false + }; + comObj.postMessage({ + sourceName, + targetName, + action: actionName, + streamId, + data, + desiredSize: controller.desiredSize + }, transfers); + return startCapability.promise; + }, + pull: controller => { + const pullCapability = new PromiseCapability(); + this.streamControllers[streamId].pullCall = pullCapability; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL, + streamId, + desiredSize: controller.desiredSize + }); + return pullCapability.promise; + }, + cancel: reason => { + assert(reason instanceof Error, "cancel must have a valid reason"); + const cancelCapability = new PromiseCapability(); + this.streamControllers[streamId].cancelCall = cancelCapability; + this.streamControllers[streamId].isClosed = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL, + streamId, + reason: wrapReason(reason) + }); + return cancelCapability.promise; + } + }, queueingStrategy); + } + #createStreamSink(data) { + const streamId = data.streamId, + sourceName = this.sourceName, + targetName = data.sourceName, + comObj = this.comObj; + const self = this, + action = this.actionHandler[data.action]; + const streamSink = { + enqueue(chunk, size = 1, transfers) { + if (this.isCancelled) { + return; + } + const lastDesiredSize = this.desiredSize; + this.desiredSize -= size; + if (lastDesiredSize > 0 && this.desiredSize <= 0) { + this.sinkCapability = new PromiseCapability(); + this.ready = this.sinkCapability.promise; + } + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.ENQUEUE, + streamId, + chunk + }, transfers); + }, + close() { + if (this.isCancelled) { + return; + } + this.isCancelled = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CLOSE, + streamId + }); + delete self.streamSinks[streamId]; + }, + error(reason) { + assert(reason instanceof Error, "error must have a valid reason"); + if (this.isCancelled) { + return; + } + this.isCancelled = true; + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.ERROR, + streamId, + reason: wrapReason(reason) + }); + }, + sinkCapability: new PromiseCapability(), + onPull: null, + onCancel: null, + isCancelled: false, + desiredSize: data.desiredSize, + ready: null + }; + streamSink.sinkCapability.resolve(); + streamSink.ready = streamSink.sinkCapability.promise; + this.streamSinks[streamId] = streamSink; + new Promise(function (resolve) { + resolve(action(data.data, streamSink)); + }).then(function () { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.START_COMPLETE, + streamId, + success: true + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.START_COMPLETE, + streamId, + reason: wrapReason(reason) + }); + }); + } + #processStreamMessage(data) { + const streamId = data.streamId, + sourceName = this.sourceName, + targetName = data.sourceName, + comObj = this.comObj; + const streamController = this.streamControllers[streamId], + streamSink = this.streamSinks[streamId]; + switch (data.stream) { + case StreamKind.START_COMPLETE: + if (data.success) { + streamController.startCall.resolve(); + } else { + streamController.startCall.reject(wrapReason(data.reason)); + } + break; + case StreamKind.PULL_COMPLETE: + if (data.success) { + streamController.pullCall.resolve(); + } else { + streamController.pullCall.reject(wrapReason(data.reason)); + } + break; + case StreamKind.PULL: + if (!streamSink) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + success: true + }); + break; + } + if (streamSink.desiredSize <= 0 && data.desiredSize > 0) { + streamSink.sinkCapability.resolve(); + } + streamSink.desiredSize = data.desiredSize; + new Promise(function (resolve) { + resolve(streamSink.onPull?.()); + }).then(function () { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + success: true + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.PULL_COMPLETE, + streamId, + reason: wrapReason(reason) + }); + }); + break; + case StreamKind.ENQUEUE: + assert(streamController, "enqueue should have stream controller"); + if (streamController.isClosed) { + break; + } + streamController.controller.enqueue(data.chunk); + break; + case StreamKind.CLOSE: + assert(streamController, "close should have stream controller"); + if (streamController.isClosed) { + break; + } + streamController.isClosed = true; + streamController.controller.close(); + this.#deleteStreamController(streamController, streamId); + break; + case StreamKind.ERROR: + assert(streamController, "error should have stream controller"); + streamController.controller.error(wrapReason(data.reason)); + this.#deleteStreamController(streamController, streamId); + break; + case StreamKind.CANCEL_COMPLETE: + if (data.success) { + streamController.cancelCall.resolve(); + } else { + streamController.cancelCall.reject(wrapReason(data.reason)); + } + this.#deleteStreamController(streamController, streamId); + break; + case StreamKind.CANCEL: + if (!streamSink) { + break; + } + new Promise(function (resolve) { + resolve(streamSink.onCancel?.(wrapReason(data.reason))); + }).then(function () { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL_COMPLETE, + streamId, + success: true + }); + }, function (reason) { + comObj.postMessage({ + sourceName, + targetName, + stream: StreamKind.CANCEL_COMPLETE, + streamId, + reason: wrapReason(reason) + }); + }); + streamSink.sinkCapability.reject(wrapReason(data.reason)); + streamSink.isCancelled = true; + delete this.streamSinks[streamId]; + break; + default: + throw new Error("Unexpected stream case"); + } + } + async #deleteStreamController(streamController, streamId) { + await Promise.allSettled([streamController.startCall?.promise, streamController.pullCall?.promise, streamController.cancelCall?.promise]); + delete this.streamControllers[streamId]; + } + destroy() { + this.comObj.removeEventListener("message", this._onComObjOnMessage); + } +} + +;// CONCATENATED MODULE: ./src/core/worker_stream.js + +class PDFWorkerStream { + constructor(msgHandler) { + this._msgHandler = msgHandler; + this._contentLength = null; + this._fullRequestReader = null; + this._rangeRequestReaders = []; + } + getFullReader() { + assert(!this._fullRequestReader, "PDFWorkerStream.getFullReader can only be called once."); + this._fullRequestReader = new PDFWorkerStreamReader(this._msgHandler); + return this._fullRequestReader; + } + getRangeReader(begin, end) { + const reader = new PDFWorkerStreamRangeReader(begin, end, this._msgHandler); + this._rangeRequestReaders.push(reader); + return reader; + } + cancelAllRequests(reason) { + this._fullRequestReader?.cancel(reason); + for (const reader of this._rangeRequestReaders.slice(0)) { + reader.cancel(reason); + } + } +} +class PDFWorkerStreamReader { + constructor(msgHandler) { + this._msgHandler = msgHandler; + this.onProgress = null; + this._contentLength = null; + this._isRangeSupported = false; + this._isStreamingSupported = false; + const readableStream = this._msgHandler.sendWithStream("GetReader"); + this._reader = readableStream.getReader(); + this._headersReady = this._msgHandler.sendWithPromise("ReaderHeadersReady").then(data => { + this._isStreamingSupported = data.isStreamingSupported; + this._isRangeSupported = data.isRangeSupported; + this._contentLength = data.contentLength; + }); + } + get headersReady() { + return this._headersReady; + } + get contentLength() { + return this._contentLength; + } + get isStreamingSupported() { + return this._isStreamingSupported; + } + get isRangeSupported() { + return this._isRangeSupported; + } + async read() { + const { + value, + done + } = await this._reader.read(); + if (done) { + return { + value: undefined, + done: true + }; + } + return { + value: value.buffer, + done: false + }; + } + cancel(reason) { + this._reader.cancel(reason); + } +} +class PDFWorkerStreamRangeReader { + constructor(begin, end, msgHandler) { + this._msgHandler = msgHandler; + this.onProgress = null; + const readableStream = this._msgHandler.sendWithStream("GetRangeReader", { + begin, + end + }); + this._reader = readableStream.getReader(); + } + get isStreamingSupported() { + return false; + } + async read() { + const { + value, + done + } = await this._reader.read(); + if (done) { + return { + value: undefined, + done: true + }; + } + return { + value: value.buffer, + done: false + }; + } + cancel(reason) { + this._reader.cancel(reason); + } +} + +;// CONCATENATED MODULE: ./src/core/worker.js + + + + + + + + + + +class WorkerTask { + constructor(name) { + this.name = name; + this.terminated = false; + this._capability = new PromiseCapability(); + } + get finished() { + return this._capability.promise; + } + finish() { + this._capability.resolve(); + } + terminate() { + this.terminated = true; + } + ensureNotTerminated() { + if (this.terminated) { + throw new Error("Worker task was terminated"); + } + } +} +class WorkerMessageHandler { + static setup(handler, port) { + let testMessageProcessed = false; + handler.on("test", function (data) { + if (testMessageProcessed) { + return; + } + testMessageProcessed = true; + handler.send("test", data instanceof Uint8Array); + }); + handler.on("configure", function (data) { + setVerbosityLevel(data.verbosity); + }); + handler.on("GetDocRequest", function (data) { + return WorkerMessageHandler.createDocumentHandler(data, port); + }); + } + static createDocumentHandler(docParams, port) { + let pdfManager; + let terminated = false; + let cancelXHRs = null; + const WorkerTasks = new Set(); + const verbosity = getVerbosityLevel(); + const { + docId, + apiVersion + } = docParams; + const workerVersion = '4.0.379'; + if (apiVersion !== workerVersion) { + throw new Error(`The API version "${apiVersion}" does not match ` + `the Worker version "${workerVersion}".`); + } + const enumerableProperties = []; + for (const property in []) { + enumerableProperties.push(property); + } + if (enumerableProperties.length) { + throw new Error("The `Array.prototype` contains unexpected enumerable properties: " + enumerableProperties.join(", ") + "; thus breaking e.g. `for...in` iteration of `Array`s."); + } + const workerHandlerName = docId + "_worker"; + let handler = new MessageHandler(workerHandlerName, docId, port); + function ensureNotTerminated() { + if (terminated) { + throw new Error("Worker was terminated"); + } + } + function startWorkerTask(task) { + WorkerTasks.add(task); + } + function finishWorkerTask(task) { + task.finish(); + WorkerTasks.delete(task); + } + async function loadDocument(recoveryMode) { + await pdfManager.ensureDoc("checkHeader"); + await pdfManager.ensureDoc("parseStartXRef"); + await pdfManager.ensureDoc("parse", [recoveryMode]); + await pdfManager.ensureDoc("checkFirstPage", [recoveryMode]); + await pdfManager.ensureDoc("checkLastPage", [recoveryMode]); + const isPureXfa = await pdfManager.ensureDoc("isPureXfa"); + if (isPureXfa) { + const task = new WorkerTask("loadXfaFonts"); + startWorkerTask(task); + await Promise.all([pdfManager.loadXfaFonts(handler, task).catch(reason => {}).then(() => finishWorkerTask(task)), pdfManager.loadXfaImages()]); + } + const [numPages, fingerprints] = await Promise.all([pdfManager.ensureDoc("numPages"), pdfManager.ensureDoc("fingerprints")]); + const htmlForXfa = isPureXfa ? await pdfManager.ensureDoc("htmlForXfa") : null; + return { + numPages, + fingerprints, + htmlForXfa + }; + } + function getPdfManager({ + data, + password, + disableAutoFetch, + rangeChunkSize, + length, + docBaseUrl, + enableXfa, + evaluatorOptions + }) { + const pdfManagerArgs = { + source: null, + disableAutoFetch, + docBaseUrl, + docId, + enableXfa, + evaluatorOptions, + handler, + length, + password, + rangeChunkSize + }; + const pdfManagerCapability = new PromiseCapability(); + let newPdfManager; + if (data) { + try { + pdfManagerArgs.source = data; + newPdfManager = new LocalPdfManager(pdfManagerArgs); + pdfManagerCapability.resolve(newPdfManager); + } catch (ex) { + pdfManagerCapability.reject(ex); + } + return pdfManagerCapability.promise; + } + let pdfStream, + cachedChunks = []; + try { + pdfStream = new PDFWorkerStream(handler); + } catch (ex) { + pdfManagerCapability.reject(ex); + return pdfManagerCapability.promise; + } + const fullRequest = pdfStream.getFullReader(); + fullRequest.headersReady.then(function () { + if (!fullRequest.isRangeSupported) { + return; + } + pdfManagerArgs.source = pdfStream; + pdfManagerArgs.length = fullRequest.contentLength; + pdfManagerArgs.disableAutoFetch ||= fullRequest.isStreamingSupported; + newPdfManager = new NetworkPdfManager(pdfManagerArgs); + for (const chunk of cachedChunks) { + newPdfManager.sendProgressiveData(chunk); + } + cachedChunks = []; + pdfManagerCapability.resolve(newPdfManager); + cancelXHRs = null; + }).catch(function (reason) { + pdfManagerCapability.reject(reason); + cancelXHRs = null; + }); + let loaded = 0; + const flushChunks = function () { + const pdfFile = arrayBuffersToBytes(cachedChunks); + if (length && pdfFile.length !== length) { + warn("reported HTTP length is different from actual"); + } + try { + pdfManagerArgs.source = pdfFile; + newPdfManager = new LocalPdfManager(pdfManagerArgs); + pdfManagerCapability.resolve(newPdfManager); + } catch (ex) { + pdfManagerCapability.reject(ex); + } + cachedChunks = []; + }; + new Promise(function (resolve, reject) { + const readChunk = function ({ + value, + done + }) { + try { + ensureNotTerminated(); + if (done) { + if (!newPdfManager) { + flushChunks(); + } + cancelXHRs = null; + return; + } + loaded += value.byteLength; + if (!fullRequest.isStreamingSupported) { + handler.send("DocProgress", { + loaded, + total: Math.max(loaded, fullRequest.contentLength || 0) + }); + } + if (newPdfManager) { + newPdfManager.sendProgressiveData(value); + } else { + cachedChunks.push(value); + } + fullRequest.read().then(readChunk, reject); + } catch (e) { + reject(e); + } + }; + fullRequest.read().then(readChunk, reject); + }).catch(function (e) { + pdfManagerCapability.reject(e); + cancelXHRs = null; + }); + cancelXHRs = function (reason) { + pdfStream.cancelAllRequests(reason); + }; + return pdfManagerCapability.promise; + } + function setupDoc(data) { + function onSuccess(doc) { + ensureNotTerminated(); + handler.send("GetDoc", { + pdfInfo: doc + }); + } + function onFailure(ex) { + ensureNotTerminated(); + if (ex instanceof PasswordException) { + const task = new WorkerTask(`PasswordException: response ${ex.code}`); + startWorkerTask(task); + handler.sendWithPromise("PasswordRequest", ex).then(function ({ + password + }) { + finishWorkerTask(task); + pdfManager.updatePassword(password); + pdfManagerReady(); + }).catch(function () { + finishWorkerTask(task); + handler.send("DocException", ex); + }); + } else if (ex instanceof InvalidPDFException || ex instanceof MissingPDFException || ex instanceof UnexpectedResponseException || ex instanceof UnknownErrorException) { + handler.send("DocException", ex); + } else { + handler.send("DocException", new UnknownErrorException(ex.message, ex.toString())); + } + } + function pdfManagerReady() { + ensureNotTerminated(); + loadDocument(false).then(onSuccess, function (reason) { + ensureNotTerminated(); + if (!(reason instanceof XRefParseException)) { + onFailure(reason); + return; + } + pdfManager.requestLoadedStream().then(function () { + ensureNotTerminated(); + loadDocument(true).then(onSuccess, onFailure); + }); + }); + } + ensureNotTerminated(); + getPdfManager(data).then(function (newPdfManager) { + if (terminated) { + newPdfManager.terminate(new AbortException("Worker was terminated.")); + throw new Error("Worker was terminated"); + } + pdfManager = newPdfManager; + pdfManager.requestLoadedStream(true).then(stream => { + handler.send("DataLoaded", { + length: stream.bytes.byteLength + }); + }); + }).then(pdfManagerReady, onFailure); + } + handler.on("GetPage", function (data) { + return pdfManager.getPage(data.pageIndex).then(function (page) { + return Promise.all([pdfManager.ensure(page, "rotate"), pdfManager.ensure(page, "ref"), pdfManager.ensure(page, "userUnit"), pdfManager.ensure(page, "view")]).then(function ([rotate, ref, userUnit, view]) { + return { + rotate, + ref, + userUnit, + view + }; + }); + }); + }); + handler.on("GetPageIndex", function (data) { + const pageRef = Ref.get(data.num, data.gen); + return pdfManager.ensureCatalog("getPageIndex", [pageRef]); + }); + handler.on("GetDestinations", function (data) { + return pdfManager.ensureCatalog("destinations"); + }); + handler.on("GetDestination", function (data) { + return pdfManager.ensureCatalog("getDestination", [data.id]); + }); + handler.on("GetPageLabels", function (data) { + return pdfManager.ensureCatalog("pageLabels"); + }); + handler.on("GetPageLayout", function (data) { + return pdfManager.ensureCatalog("pageLayout"); + }); + handler.on("GetPageMode", function (data) { + return pdfManager.ensureCatalog("pageMode"); + }); + handler.on("GetViewerPreferences", function (data) { + return pdfManager.ensureCatalog("viewerPreferences"); + }); + handler.on("GetOpenAction", function (data) { + return pdfManager.ensureCatalog("openAction"); + }); + handler.on("GetAttachments", function (data) { + return pdfManager.ensureCatalog("attachments"); + }); + handler.on("GetDocJSActions", function (data) { + return pdfManager.ensureCatalog("jsActions"); + }); + handler.on("GetPageJSActions", function ({ + pageIndex + }) { + return pdfManager.getPage(pageIndex).then(function (page) { + return pdfManager.ensure(page, "jsActions"); + }); + }); + handler.on("GetOutline", function (data) { + return pdfManager.ensureCatalog("documentOutline"); + }); + handler.on("GetOptionalContentConfig", function (data) { + return pdfManager.ensureCatalog("optionalContentConfig"); + }); + handler.on("GetPermissions", function (data) { + return pdfManager.ensureCatalog("permissions"); + }); + handler.on("GetMetadata", function (data) { + return Promise.all([pdfManager.ensureDoc("documentInfo"), pdfManager.ensureCatalog("metadata")]); + }); + handler.on("GetMarkInfo", function (data) { + return pdfManager.ensureCatalog("markInfo"); + }); + handler.on("GetData", function (data) { + return pdfManager.requestLoadedStream().then(function (stream) { + return stream.bytes; + }); + }); + handler.on("GetAnnotations", function ({ + pageIndex, + intent + }) { + return pdfManager.getPage(pageIndex).then(function (page) { + const task = new WorkerTask(`GetAnnotations: page ${pageIndex}`); + startWorkerTask(task); + return page.getAnnotationsData(handler, task, intent).then(data => { + finishWorkerTask(task); + return data; + }, reason => { + finishWorkerTask(task); + throw reason; + }); + }); + }); + handler.on("GetFieldObjects", function (data) { + return pdfManager.ensureDoc("fieldObjects"); + }); + handler.on("HasJSActions", function (data) { + return pdfManager.ensureDoc("hasJSActions"); + }); + handler.on("GetCalculationOrderIds", function (data) { + return pdfManager.ensureDoc("calculationOrderIds"); + }); + handler.on("SaveDocument", async function ({ + isPureXfa, + numPages, + annotationStorage, + filename + }) { + const globalPromises = [pdfManager.requestLoadedStream(), pdfManager.ensureCatalog("acroForm"), pdfManager.ensureCatalog("acroFormRef"), pdfManager.ensureDoc("startXRef"), pdfManager.ensureDoc("xref"), pdfManager.ensureDoc("linearization"), pdfManager.ensureCatalog("structTreeRoot")]; + const promises = []; + const newAnnotationsByPage = !isPureXfa ? getNewAnnotationsMap(annotationStorage) : null; + const [stream, acroForm, acroFormRef, startXRef, xref, linearization, _structTreeRoot] = await Promise.all(globalPromises); + const catalogRef = xref.trailer.getRaw("Root") || null; + let structTreeRoot; + if (newAnnotationsByPage) { + if (!_structTreeRoot) { + if (await StructTreeRoot.canCreateStructureTree({ + catalogRef, + pdfManager, + newAnnotationsByPage + })) { + structTreeRoot = null; + } + } else if (await _structTreeRoot.canUpdateStructTree({ + pdfManager, + xref, + newAnnotationsByPage + })) { + structTreeRoot = _structTreeRoot; + } + const imagePromises = AnnotationFactory.generateImages(annotationStorage.values(), xref, pdfManager.evaluatorOptions.isOffscreenCanvasSupported); + const newAnnotationPromises = structTreeRoot === undefined ? promises : []; + for (const [pageIndex, annotations] of newAnnotationsByPage) { + newAnnotationPromises.push(pdfManager.getPage(pageIndex).then(page => { + const task = new WorkerTask(`Save (editor): page ${pageIndex}`); + return page.saveNewAnnotations(handler, task, annotations, imagePromises).finally(function () { + finishWorkerTask(task); + }); + })); + } + if (structTreeRoot === null) { + promises.push(Promise.all(newAnnotationPromises).then(async newRefs => { + await StructTreeRoot.createStructureTree({ + newAnnotationsByPage, + xref, + catalogRef, + pdfManager, + newRefs + }); + return newRefs; + })); + } else if (structTreeRoot) { + promises.push(Promise.all(newAnnotationPromises).then(async newRefs => { + await structTreeRoot.updateStructureTree({ + newAnnotationsByPage, + pdfManager, + newRefs + }); + return newRefs; + })); + } + } + if (isPureXfa) { + promises.push(pdfManager.serializeXfaData(annotationStorage)); + } else { + for (let pageIndex = 0; pageIndex < numPages; pageIndex++) { + promises.push(pdfManager.getPage(pageIndex).then(function (page) { + const task = new WorkerTask(`Save: page ${pageIndex}`); + return page.save(handler, task, annotationStorage).finally(function () { + finishWorkerTask(task); + }); + })); + } + } + const refs = await Promise.all(promises); + let newRefs = []; + let xfaData = null; + if (isPureXfa) { + xfaData = refs[0]; + if (!xfaData) { + return stream.bytes; + } + } else { + newRefs = refs.flat(2); + if (newRefs.length === 0) { + return stream.bytes; + } + } + const needAppearances = acroFormRef && acroForm instanceof Dict && newRefs.some(ref => ref.needAppearances); + const xfa = acroForm instanceof Dict && acroForm.get("XFA") || null; + let xfaDatasetsRef = null; + let hasXfaDatasetsEntry = false; + if (Array.isArray(xfa)) { + for (let i = 0, ii = xfa.length; i < ii; i += 2) { + if (xfa[i] === "datasets") { + xfaDatasetsRef = xfa[i + 1]; + hasXfaDatasetsEntry = true; + } + } + if (xfaDatasetsRef === null) { + xfaDatasetsRef = xref.getNewTemporaryRef(); + } + } else if (xfa) { + warn("Unsupported XFA type."); + } + let newXrefInfo = Object.create(null); + if (xref.trailer) { + const infoObj = Object.create(null); + const xrefInfo = xref.trailer.get("Info") || null; + if (xrefInfo instanceof Dict) { + xrefInfo.forEach((key, value) => { + if (typeof value === "string") { + infoObj[key] = stringToPDFString(value); + } + }); + } + newXrefInfo = { + rootRef: catalogRef, + encryptRef: xref.trailer.getRaw("Encrypt") || null, + newRef: xref.getNewTemporaryRef(), + infoRef: xref.trailer.getRaw("Info") || null, + info: infoObj, + fileIds: xref.trailer.get("ID") || null, + startXRef: linearization ? startXRef : xref.lastXRefStreamPos ?? startXRef, + filename + }; + } + return incrementalUpdate({ + originalData: stream.bytes, + xrefInfo: newXrefInfo, + newRefs, + xref, + hasXfa: !!xfa, + xfaDatasetsRef, + hasXfaDatasetsEntry, + needAppearances, + acroFormRef, + acroForm, + xfaData + }).finally(() => { + xref.resetNewTemporaryRef(); + }); + }); + handler.on("GetOperatorList", function (data, sink) { + const pageIndex = data.pageIndex; + pdfManager.getPage(pageIndex).then(function (page) { + const task = new WorkerTask(`GetOperatorList: page ${pageIndex}`); + startWorkerTask(task); + const start = verbosity >= VerbosityLevel.INFOS ? Date.now() : 0; + page.getOperatorList({ + handler, + sink, + task, + intent: data.intent, + cacheKey: data.cacheKey, + annotationStorage: data.annotationStorage + }).then(function (operatorListInfo) { + finishWorkerTask(task); + if (start) { + info(`page=${pageIndex + 1} - getOperatorList: time=` + `${Date.now() - start}ms, len=${operatorListInfo.length}`); + } + sink.close(); + }, function (reason) { + finishWorkerTask(task); + if (task.terminated) { + return; + } + sink.error(reason); + }); + }); + }); + handler.on("GetTextContent", function (data, sink) { + const { + pageIndex, + includeMarkedContent, + disableNormalization + } = data; + pdfManager.getPage(pageIndex).then(function (page) { + const task = new WorkerTask("GetTextContent: page " + pageIndex); + startWorkerTask(task); + const start = verbosity >= VerbosityLevel.INFOS ? Date.now() : 0; + page.extractTextContent({ + handler, + task, + sink, + includeMarkedContent, + disableNormalization + }).then(function () { + finishWorkerTask(task); + if (start) { + info(`page=${pageIndex + 1} - getTextContent: time=` + `${Date.now() - start}ms`); + } + sink.close(); + }, function (reason) { + finishWorkerTask(task); + if (task.terminated) { + return; + } + sink.error(reason); + }); + }); + }); + handler.on("GetStructTree", function (data) { + return pdfManager.getPage(data.pageIndex).then(function (page) { + return pdfManager.ensure(page, "getStructTree"); + }); + }); + handler.on("FontFallback", function (data) { + return pdfManager.fontFallback(data.id, handler); + }); + handler.on("Cleanup", function (data) { + return pdfManager.cleanup(true); + }); + handler.on("Terminate", function (data) { + terminated = true; + const waitOn = []; + if (pdfManager) { + pdfManager.terminate(new AbortException("Worker was terminated.")); + const cleanupPromise = pdfManager.cleanup(); + waitOn.push(cleanupPromise); + pdfManager = null; + } else { + clearGlobalCaches(); + } + if (cancelXHRs) { + cancelXHRs(new AbortException("Worker was terminated.")); + } + for (const task of WorkerTasks) { + waitOn.push(task.finished); + task.terminate(); + } + return Promise.all(waitOn).then(function () { + handler.destroy(); + handler = null; + }); + }); + handler.on("Ready", function (data) { + setupDoc(docParams); + docParams = null; + }); + return workerHandlerName; + } + static initializeFromPort(port) { + const handler = new MessageHandler("worker", "main", port); + WorkerMessageHandler.setup(handler, port); + handler.send("ready", null); + } +} +function isMessagePort(maybePort) { + return typeof maybePort.postMessage === "function" && "onmessage" in maybePort; +} +if (typeof window === "undefined" && !isNodeJS && typeof self !== "undefined" && isMessagePort(self)) { + WorkerMessageHandler.initializeFromPort(self); +} + +;// CONCATENATED MODULE: ./src/pdf.worker.js + +const pdfjsVersion = '4.0.379'; +const pdfjsBuild = '9e14d04fd'; + +var __webpack_exports__WorkerMessageHandler = __webpack_exports__.WorkerMessageHandler; +export { __webpack_exports__WorkerMessageHandler as WorkerMessageHandler }; + +//# sourceMappingURL=pdf.worker.mjs.map diff --git a/shared/static/shared/vendor/pdf.js-4.0.379/pdf.worker.mjs.map b/shared/static/shared/vendor/pdf.js-4.0.379/pdf.worker.mjs.map new file mode 100644 index 0000000000000000000000000000000000000000..7e917fbda76273ee2041a8fcca1fb7d78c7ebbe3 --- /dev/null +++ b/shared/static/shared/vendor/pdf.js-4.0.379/pdf.worker.mjs.map @@ -0,0 +1 @@ +{"version":3,"file":"pdf.worker.mjs","mappings":";;;;;;;;;;;;;;;;;;;;;;SAAA;SACA;;;;;UCDA;UACA;UACA;UACA;UACA,yC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AAA,CAAQ40P,GAAR,CAAYsqF,MAAZ,EAAoBpuU,IAApB,CAAyB,YAAY;QAG1Ck7O,OAAA,CAAQsvF,OAAR;QACAtvF,OAAA,GAAU,IAAV;MAJ0C,CAArC,CAAP;IAvBsC,CAAxC;IA+BAA,OAAA,CAAQq2B,EAAR,CAAW,OAAX,EAAoB,UAAUliR,IAAV,EAAgB;MAClCk+U,QAAA,CAASnB,SAAT;MACAA,SAAA,GAAY,IAAZ;IAFkC,CAApC;IAqBA,OAAOM,iBAAP;EA3xB4C;EA8xB9C,OAAO4B,kBAAPA,CAA0BrC,IAA1B,EAAgC;IAC9B,MAAM/wF,OAAA,GAAU,IAAIgtF,cAAJ,CAAmB,QAAnB,EAA6B,MAA7B,EAAqC+D,IAArC,CAAhB;IACAF,oBAAA,CAAqBC,KAArB,CAA2B9wF,OAA3B,EAAoC+wF,IAApC;IACA/wF,OAAA,CAAQ15O,IAAR,CAAa,OAAb,EAAsB,IAAtB;EAH8B;AApzBP;AA2zB3B,SAAS+sU,aAATA,CAAuBC,SAAvB,EAAkC;EAChC,OACE,OAAOA,SAAA,CAAUxF,WAAjB,KAAiC,UAAjC,IAA+C,eAAewF,SADhE;AADgC;AAOlC,IACE,OAAOtgC,MAAP,KAAkB,WAAlB,IACA,CAACp7T,QADD,IAEA,OAAOswQ,IAAP,KAAgB,WAFhB,IAGAmrF,aAAA,CAAcnrF,IAAd,CAJF,EAKE;EACA2oF,oBAAA,CAAqBuC,kBAArB,CAAwClrF,IAAxC;AADA;;;ACh4BF;AAGA,MAAMqrF,YAAA,GAC8B,SADpC;AAGA,MAAMC,UAAA,GAC8B,WADpC","sources":["webpack://pdf.js/webpack/bootstrap","webpack://pdf.js/webpack/runtime/define property getters","webpack://pdf.js/webpack/runtime/hasOwnProperty shorthand","webpack://pdf.js/src/shared/util.js","webpack://pdf.js/src/core/primitives.js","webpack://pdf.js/src/core/base_stream.js","webpack://pdf.js/src/core/core_utils.js","webpack://pdf.js/src/core/stream.js","webpack://pdf.js/src/core/chunked_stream.js","webpack://pdf.js/src/core/colorspace.js","webpack://pdf.js/src/core/binary_cmap.js","webpack://pdf.js/src/core/decode_stream.js","webpack://pdf.js/src/core/ascii_85_stream.js","webpack://pdf.js/src/core/ascii_hex_stream.js","webpack://pdf.js/src/core/ccitt.js","webpack://pdf.js/src/core/ccitt_stream.js","webpack://pdf.js/src/core/flate_stream.js","webpack://pdf.js/src/core/arithmetic_decoder.js","webpack://pdf.js/src/core/jbig2.js","webpack://pdf.js/src/core/jbig2_stream.js","webpack://pdf.js/src/shared/image_utils.js","webpack://pdf.js/src/core/jpg.js","webpack://pdf.js/src/core/jpeg_stream.js","webpack://pdf.js/src/core/jpx.js","webpack://pdf.js/src/core/jpx_stream.js","webpack://pdf.js/src/core/lzw_stream.js","webpack://pdf.js/src/core/predictor_stream.js","webpack://pdf.js/src/core/run_length_stream.js","webpack://pdf.js/src/core/parser.js","webpack://pdf.js/src/core/cmap.js","webpack://pdf.js/src/core/charsets.js","webpack://pdf.js/src/core/encodings.js","webpack://pdf.js/src/core/cff_parser.js","webpack://pdf.js/src/core/glyphlist.js","webpack://pdf.js/src/core/unicode.js","webpack://pdf.js/src/core/fonts_utils.js","webpack://pdf.js/src/core/standard_fonts.js","webpack://pdf.js/src/core/to_unicode_map.js","webpack://pdf.js/src/core/cff_font.js","webpack://pdf.js/src/core/font_renderer.js","webpack://pdf.js/src/core/metrics.js","webpack://pdf.js/src/core/glyf.js","webpack://pdf.js/src/core/opentype_file_builder.js","webpack://pdf.js/src/core/type1_parser.js","webpack://pdf.js/src/core/type1_font.js","webpack://pdf.js/src/core/fonts.js","webpack://pdf.js/src/core/pattern.js","webpack://pdf.js/src/core/calibri_factors.js","webpack://pdf.js/src/core/helvetica_factors.js","webpack://pdf.js/src/core/liberationsans_widths.js","webpack://pdf.js/src/core/myriadpro_factors.js","webpack://pdf.js/src/core/segoeui_factors.js","webpack://pdf.js/src/core/xfa_fonts.js","webpack://pdf.js/src/core/ps_parser.js","webpack://pdf.js/src/core/image_utils.js","webpack://pdf.js/src/core/function.js","webpack://pdf.js/src/core/bidi.js","webpack://pdf.js/src/core/font_substitutions.js","webpack://pdf.js/src/core/image_resizer.js","webpack://pdf.js/src/shared/murmurhash3.js","webpack://pdf.js/src/core/operator_list.js","webpack://pdf.js/src/core/image.js","webpack://pdf.js/src/core/evaluator.js","webpack://pdf.js/src/core/default_appearance.js","webpack://pdf.js/src/core/name_number_tree.js","webpack://pdf.js/src/core/cleanup_helper.js","webpack://pdf.js/src/core/file_spec.js","webpack://pdf.js/src/core/xml_parser.js","webpack://pdf.js/src/core/metadata_parser.js","webpack://pdf.js/src/core/decrypt_stream.js","webpack://pdf.js/src/core/crypto.js","webpack://pdf.js/src/core/writer.js","webpack://pdf.js/src/core/struct_tree.js","webpack://pdf.js/src/core/catalog.js","webpack://pdf.js/src/core/object_loader.js","webpack://pdf.js/src/core/xfa/symbol_utils.js","webpack://pdf.js/src/core/xfa/namespaces.js","webpack://pdf.js/src/core/xfa/utils.js","webpack://pdf.js/src/core/xfa/fonts.js","webpack://pdf.js/src/core/xfa/text.js","webpack://pdf.js/src/core/xfa/som.js","webpack://pdf.js/src/core/xfa/xfa_object.js","webpack://pdf.js/src/core/xfa/html_utils.js","webpack://pdf.js/src/core/xfa/layout.js","webpack://pdf.js/src/core/xfa/template.js","webpack://pdf.js/src/core/xfa/bind.js","webpack://pdf.js/src/core/xfa/data.js","webpack://pdf.js/src/core/xfa/config.js","webpack://pdf.js/src/core/xfa/connection_set.js","webpack://pdf.js/src/core/xfa/datasets.js","webpack://pdf.js/src/core/xfa/locale_set.js","webpack://pdf.js/src/core/xfa/signature.js","webpack://pdf.js/src/core/xfa/stylesheet.js","webpack://pdf.js/src/core/xfa/xdp.js","webpack://pdf.js/src/core/xfa/xhtml.js","webpack://pdf.js/src/core/xfa/setup.js","webpack://pdf.js/src/core/xfa/unknown.js","webpack://pdf.js/src/core/xfa/builder.js","webpack://pdf.js/src/core/xfa/parser.js","webpack://pdf.js/src/core/xfa/factory.js","webpack://pdf.js/src/core/annotation.js","webpack://pdf.js/src/core/dataset_reader.js","webpack://pdf.js/src/core/xref.js","webpack://pdf.js/src/core/document.js","webpack://pdf.js/src/core/pdf_manager.js","webpack://pdf.js/src/shared/message_handler.js","webpack://pdf.js/src/core/worker_stream.js","webpack://pdf.js/src/core/worker.js","webpack://pdf.js/src/pdf.worker.js"],"sourcesContent":["// The require scope\nvar __webpack_require__ = {};\n\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))","/* 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 HIGHLIGHT_COLOR: 31,\n HIGHLIGHT_DEFAULT_COLOR: 32,\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","/* 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, shadow, unreachable } from \"../shared/util.js\";\n\nconst CIRCULAR_REF = Symbol(\"CIRCULAR_REF\");\nconst EOF = Symbol(\"EOF\");\n\nlet CmdCache = Object.create(null);\nlet NameCache = Object.create(null);\nlet RefCache = Object.create(null);\n\nfunction clearPrimitiveCaches() {\n CmdCache = Object.create(null);\n NameCache = Object.create(null);\n RefCache = Object.create(null);\n}\n\nclass Name {\n constructor(name) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n typeof name !== \"string\"\n ) {\n unreachable('Name: The \"name\" must be a string.');\n }\n this.name = name;\n }\n\n static get(name) {\n // eslint-disable-next-line no-restricted-syntax\n return (NameCache[name] ||= new Name(name));\n }\n}\n\nclass Cmd {\n constructor(cmd) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n typeof cmd !== \"string\"\n ) {\n unreachable('Cmd: The \"cmd\" must be a string.');\n }\n this.cmd = cmd;\n }\n\n static get(cmd) {\n // eslint-disable-next-line no-restricted-syntax\n return (CmdCache[cmd] ||= new Cmd(cmd));\n }\n}\n\nconst nonSerializable = function nonSerializableClosure() {\n return nonSerializable; // Creating closure on some variable.\n};\n\nclass Dict {\n constructor(xref = null) {\n // Map should only be used internally, use functions below to access.\n this._map = Object.create(null);\n this.xref = xref;\n this.objId = null;\n this.suppressEncryption = false;\n this.__nonSerializable__ = nonSerializable; // Disable cloning of the Dict.\n }\n\n assignXref(newXref) {\n this.xref = newXref;\n }\n\n get size() {\n return Object.keys(this._map).length;\n }\n\n // Automatically dereferences Ref objects.\n get(key1, key2, key3) {\n let value = this._map[key1];\n if (value === undefined && key2 !== undefined) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n key2.length < key1.length\n ) {\n unreachable(\"Dict.get: Expected keys to be ordered by length.\");\n }\n value = this._map[key2];\n if (value === undefined && key3 !== undefined) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n key3.length < key2.length\n ) {\n unreachable(\"Dict.get: Expected keys to be ordered by length.\");\n }\n value = this._map[key3];\n }\n }\n if (value instanceof Ref && this.xref) {\n return this.xref.fetch(value, this.suppressEncryption);\n }\n return value;\n }\n\n // Same as get(), but returns a promise and uses fetchIfRefAsync().\n async getAsync(key1, key2, key3) {\n let value = this._map[key1];\n if (value === undefined && key2 !== undefined) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n key2.length < key1.length\n ) {\n unreachable(\"Dict.getAsync: Expected keys to be ordered by length.\");\n }\n value = this._map[key2];\n if (value === undefined && key3 !== undefined) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n key3.length < key2.length\n ) {\n unreachable(\"Dict.getAsync: Expected keys to be ordered by length.\");\n }\n value = this._map[key3];\n }\n }\n if (value instanceof Ref && this.xref) {\n return this.xref.fetchAsync(value, this.suppressEncryption);\n }\n return value;\n }\n\n // Same as get(), but dereferences all elements if the result is an Array.\n getArray(key1, key2, key3) {\n let value = this._map[key1];\n if (value === undefined && key2 !== undefined) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n key2.length < key1.length\n ) {\n unreachable(\"Dict.getArray: Expected keys to be ordered by length.\");\n }\n value = this._map[key2];\n if (value === undefined && key3 !== undefined) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n key3.length < key2.length\n ) {\n unreachable(\"Dict.getArray: Expected keys to be ordered by length.\");\n }\n value = this._map[key3];\n }\n }\n if (value instanceof Ref && this.xref) {\n value = this.xref.fetch(value, this.suppressEncryption);\n }\n\n if (Array.isArray(value)) {\n value = value.slice(); // Ensure that we don't modify the Dict data.\n for (let i = 0, ii = value.length; i < ii; i++) {\n if (value[i] instanceof Ref && this.xref) {\n value[i] = this.xref.fetch(value[i], this.suppressEncryption);\n }\n }\n }\n return value;\n }\n\n // No dereferencing.\n getRaw(key) {\n return this._map[key];\n }\n\n getKeys() {\n return Object.keys(this._map);\n }\n\n // No dereferencing.\n getRawValues() {\n return Object.values(this._map);\n }\n\n set(key, value) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n if (typeof key !== \"string\") {\n unreachable('Dict.set: The \"key\" must be a string.');\n } else if (value === undefined) {\n unreachable('Dict.set: The \"value\" cannot be undefined.');\n }\n }\n this._map[key] = value;\n }\n\n has(key) {\n return this._map[key] !== undefined;\n }\n\n forEach(callback) {\n for (const key in this._map) {\n callback(key, this.get(key));\n }\n }\n\n static get empty() {\n const emptyDict = new Dict(null);\n\n emptyDict.set = (key, value) => {\n unreachable(\"Should not call `set` on the empty dictionary.\");\n };\n return shadow(this, \"empty\", emptyDict);\n }\n\n static merge({ xref, dictArray, mergeSubDicts = false }) {\n const mergedDict = new Dict(xref),\n properties = new Map();\n\n for (const dict of dictArray) {\n if (!(dict instanceof Dict)) {\n continue;\n }\n for (const [key, value] of Object.entries(dict._map)) {\n let property = properties.get(key);\n if (property === undefined) {\n property = [];\n properties.set(key, property);\n } else if (!mergeSubDicts || !(value instanceof Dict)) {\n // Ignore additional entries, if either:\n // - This is a \"shallow\" merge, where only the first element matters.\n // - The value is *not* a `Dict`, since other types cannot be merged.\n continue;\n }\n property.push(value);\n }\n }\n for (const [name, values] of properties) {\n if (values.length === 1 || !(values[0] instanceof Dict)) {\n mergedDict._map[name] = values[0];\n continue;\n }\n const subDict = new Dict(xref);\n\n for (const dict of values) {\n for (const [key, value] of Object.entries(dict._map)) {\n if (subDict._map[key] === undefined) {\n subDict._map[key] = value;\n }\n }\n }\n if (subDict.size > 0) {\n mergedDict._map[name] = subDict;\n }\n }\n properties.clear();\n\n return mergedDict.size > 0 ? mergedDict : Dict.empty;\n }\n\n clone() {\n const dict = new Dict(this.xref);\n for (const key of this.getKeys()) {\n dict.set(key, this.getRaw(key));\n }\n return dict;\n }\n}\n\nclass Ref {\n constructor(num, gen) {\n this.num = num;\n this.gen = gen;\n }\n\n toString() {\n // This function is hot, so we make the string as compact as possible.\n // |this.gen| is almost always zero, so we treat that case specially.\n if (this.gen === 0) {\n return `${this.num}R`;\n }\n return `${this.num}R${this.gen}`;\n }\n\n static fromString(str) {\n const ref = RefCache[str];\n if (ref) {\n return ref;\n }\n const m = /^(\\d+)R(\\d*)$/.exec(str);\n if (!m || m[1] === \"0\") {\n return null;\n }\n\n // eslint-disable-next-line no-restricted-syntax\n return (RefCache[str] = new Ref(\n parseInt(m[1]),\n !m[2] ? 0 : parseInt(m[2])\n ));\n }\n\n static get(num, gen) {\n const key = gen === 0 ? `${num}R` : `${num}R${gen}`;\n // eslint-disable-next-line no-restricted-syntax\n return (RefCache[key] ||= new Ref(num, gen));\n }\n}\n\n// The reference is identified by number and generation.\n// This structure stores only one instance of the reference.\nclass RefSet {\n constructor(parent = null) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n parent &&\n !(parent instanceof RefSet)\n ) {\n unreachable('RefSet: Invalid \"parent\" value.');\n }\n this._set = new Set(parent?._set);\n }\n\n has(ref) {\n return this._set.has(ref.toString());\n }\n\n put(ref) {\n this._set.add(ref.toString());\n }\n\n remove(ref) {\n this._set.delete(ref.toString());\n }\n\n [Symbol.iterator]() {\n return this._set.values();\n }\n\n clear() {\n this._set.clear();\n }\n}\n\nclass RefSetCache {\n constructor() {\n this._map = new Map();\n }\n\n get size() {\n return this._map.size;\n }\n\n get(ref) {\n return this._map.get(ref.toString());\n }\n\n has(ref) {\n return this._map.has(ref.toString());\n }\n\n put(ref, obj) {\n this._map.set(ref.toString(), obj);\n }\n\n putAlias(ref, aliasRef) {\n this._map.set(ref.toString(), this.get(aliasRef));\n }\n\n [Symbol.iterator]() {\n return this._map.values();\n }\n\n clear() {\n this._map.clear();\n }\n}\n\nfunction isName(v, name) {\n return v instanceof Name && (name === undefined || v.name === name);\n}\n\nfunction isCmd(v, cmd) {\n return v instanceof Cmd && (cmd === undefined || v.cmd === cmd);\n}\n\nfunction isDict(v, type) {\n return (\n v instanceof Dict && (type === undefined || isName(v.get(\"Type\"), type))\n );\n}\n\nfunction isRefsEqual(v1, v2) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n v1 instanceof Ref && v2 instanceof Ref,\n \"isRefsEqual: Both parameters should be `Ref`s.\"\n );\n }\n return v1.num === v2.num && v1.gen === v2.gen;\n}\n\nexport {\n CIRCULAR_REF,\n clearPrimitiveCaches,\n Cmd,\n Dict,\n EOF,\n isCmd,\n isDict,\n isName,\n isRefsEqual,\n Name,\n Ref,\n RefSet,\n RefSetCache,\n};\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { bytesToString, shadow, unreachable } from \"../shared/util.js\";\n\nclass BaseStream {\n constructor() {\n if (this.constructor === BaseStream) {\n unreachable(\"Cannot initialize BaseStream.\");\n }\n }\n\n // eslint-disable-next-line getter-return\n get length() {\n unreachable(\"Abstract getter `length` accessed\");\n }\n\n // eslint-disable-next-line getter-return\n get isEmpty() {\n unreachable(\"Abstract getter `isEmpty` accessed\");\n }\n\n get isDataLoaded() {\n return shadow(this, \"isDataLoaded\", true);\n }\n\n getByte() {\n unreachable(\"Abstract method `getByte` called\");\n }\n\n getBytes(length) {\n unreachable(\"Abstract method `getBytes` called\");\n }\n\n peekByte() {\n const peekedByte = this.getByte();\n if (peekedByte !== -1) {\n this.pos--;\n }\n return peekedByte;\n }\n\n peekBytes(length) {\n const bytes = this.getBytes(length);\n this.pos -= bytes.length;\n return bytes;\n }\n\n getUint16() {\n const b0 = this.getByte();\n const b1 = this.getByte();\n if (b0 === -1 || b1 === -1) {\n return -1;\n }\n return (b0 << 8) + b1;\n }\n\n getInt32() {\n const b0 = this.getByte();\n const b1 = this.getByte();\n const b2 = this.getByte();\n const b3 = this.getByte();\n return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3;\n }\n\n getByteRange(begin, end) {\n unreachable(\"Abstract method `getByteRange` called\");\n }\n\n getString(length) {\n return bytesToString(this.getBytes(length));\n }\n\n skip(n) {\n this.pos += n || 1;\n }\n\n reset() {\n unreachable(\"Abstract method `reset` called\");\n }\n\n moveStart() {\n unreachable(\"Abstract method `moveStart` called\");\n }\n\n makeSubStream(start, length, dict = null) {\n unreachable(\"Abstract method `makeSubStream` called\");\n }\n\n /**\n * @returns {Array | null}\n */\n getBaseStreams() {\n return null;\n }\n}\n\nexport { BaseStream };\n","/* Copyright 2019 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 AnnotationEditorPrefix,\n assert,\n BaseException,\n objectSize,\n stringToPDFString,\n warn,\n} from \"../shared/util.js\";\nimport { Dict, isName, Ref, RefSet } from \"./primitives.js\";\nimport { BaseStream } from \"./base_stream.js\";\n\nconst PDF_VERSION_REGEXP = /^[1-9]\\.\\d$/;\n\nfunction getLookupTableFactory(initializer) {\n let lookup;\n return function () {\n if (initializer) {\n lookup = Object.create(null);\n initializer(lookup);\n initializer = null;\n }\n return lookup;\n };\n}\n\nclass MissingDataException extends BaseException {\n constructor(begin, end) {\n super(`Missing data [${begin}, ${end})`, \"MissingDataException\");\n this.begin = begin;\n this.end = end;\n }\n}\n\nclass ParserEOFException extends BaseException {\n constructor(msg) {\n super(msg, \"ParserEOFException\");\n }\n}\n\nclass XRefEntryException extends BaseException {\n constructor(msg) {\n super(msg, \"XRefEntryException\");\n }\n}\n\nclass XRefParseException extends BaseException {\n constructor(msg) {\n super(msg, \"XRefParseException\");\n }\n}\n\n/**\n * Combines multiple ArrayBuffers into a single Uint8Array.\n * @param {Array<ArrayBuffer>} arr - An array of ArrayBuffers.\n * @returns {Uint8Array}\n */\nfunction arrayBuffersToBytes(arr) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n for (const item of arr) {\n assert(\n item instanceof ArrayBuffer,\n \"arrayBuffersToBytes - expected an ArrayBuffer.\"\n );\n }\n }\n const length = arr.length;\n if (length === 0) {\n return new Uint8Array(0);\n }\n if (length === 1) {\n return new Uint8Array(arr[0]);\n }\n let dataLength = 0;\n for (let i = 0; i < length; i++) {\n dataLength += arr[i].byteLength;\n }\n const data = new Uint8Array(dataLength);\n let pos = 0;\n for (let i = 0; i < length; i++) {\n const item = new Uint8Array(arr[i]);\n data.set(item, pos);\n pos += item.byteLength;\n }\n return data;\n}\n\n/**\n * Get the value of an inheritable property.\n *\n * If the PDF specification explicitly lists a property in a dictionary as\n * inheritable, then the value of the property may be present in the dictionary\n * itself or in one or more parents of the dictionary.\n *\n * If the key is not found in the tree, `undefined` is returned. Otherwise,\n * the value for the key is returned or, if `stopWhenFound` is `false`, a list\n * of values is returned.\n *\n * @param {Dict} dict - Dictionary from where to start the traversal.\n * @param {string} key - The key of the property to find the value for.\n * @param {boolean} getArray - Whether or not the value should be fetched as an\n * array. The default value is `false`.\n * @param {boolean} stopWhenFound - Whether or not to stop the traversal when\n * the key is found. If set to `false`, we always walk up the entire parent\n * chain, for example to be able to find `\\Resources` placed on multiple\n * levels of the tree. The default value is `true`.\n */\nfunction getInheritableProperty({\n dict,\n key,\n getArray = false,\n stopWhenFound = true,\n}) {\n let values;\n const visited = new RefSet();\n\n while (dict instanceof Dict && !(dict.objId && visited.has(dict.objId))) {\n if (dict.objId) {\n visited.put(dict.objId);\n }\n const value = getArray ? dict.getArray(key) : dict.get(key);\n if (value !== undefined) {\n if (stopWhenFound) {\n return value;\n }\n (values ||= []).push(value);\n }\n dict = dict.get(\"Parent\");\n }\n return values;\n}\n\n// prettier-ignore\nconst ROMAN_NUMBER_MAP = [\n \"\", \"C\", \"CC\", \"CCC\", \"CD\", \"D\", \"DC\", \"DCC\", \"DCCC\", \"CM\",\n \"\", \"X\", \"XX\", \"XXX\", \"XL\", \"L\", \"LX\", \"LXX\", \"LXXX\", \"XC\",\n \"\", \"I\", \"II\", \"III\", \"IV\", \"V\", \"VI\", \"VII\", \"VIII\", \"IX\"\n];\n\n/**\n * Converts positive integers to (upper case) Roman numerals.\n * @param {number} number - The number that should be converted.\n * @param {boolean} lowerCase - Indicates if the result should be converted\n * to lower case letters. The default value is `false`.\n * @returns {string} The resulting Roman number.\n */\nfunction toRomanNumerals(number, lowerCase = false) {\n assert(\n Number.isInteger(number) && number > 0,\n \"The number should be a positive integer.\"\n );\n const romanBuf = [];\n let pos;\n // Thousands\n while (number >= 1000) {\n number -= 1000;\n romanBuf.push(\"M\");\n }\n // Hundreds\n pos = (number / 100) | 0;\n number %= 100;\n romanBuf.push(ROMAN_NUMBER_MAP[pos]);\n // Tens\n pos = (number / 10) | 0;\n number %= 10;\n romanBuf.push(ROMAN_NUMBER_MAP[10 + pos]);\n // Ones\n romanBuf.push(ROMAN_NUMBER_MAP[20 + number]); // eslint-disable-line unicorn/no-array-push-push\n\n const romanStr = romanBuf.join(\"\");\n return lowerCase ? romanStr.toLowerCase() : romanStr;\n}\n\n// Calculate the base 2 logarithm of the number `x`. This differs from the\n// native function in the sense that it returns the ceiling value and that it\n// returns 0 instead of `Infinity`/`NaN` for `x` values smaller than/equal to 0.\nfunction log2(x) {\n if (x <= 0) {\n return 0;\n }\n return Math.ceil(Math.log2(x));\n}\n\nfunction readInt8(data, offset) {\n return (data[offset] << 24) >> 24;\n}\n\nfunction readUint16(data, offset) {\n return (data[offset] << 8) | data[offset + 1];\n}\n\nfunction readUint32(data, offset) {\n return (\n ((data[offset] << 24) |\n (data[offset + 1] << 16) |\n (data[offset + 2] << 8) |\n data[offset + 3]) >>>\n 0\n );\n}\n\n// Checks if ch is one of the following characters: SPACE, TAB, CR or LF.\nfunction isWhiteSpace(ch) {\n return ch === 0x20 || ch === 0x09 || ch === 0x0d || ch === 0x0a;\n}\n\n/**\n * AcroForm field names use an array like notation to refer to\n * repeated XFA elements e.g. foo.bar[nnn].\n * see: XFA Spec Chapter 3 - Repeated Elements\n *\n * @param {string} path - XFA path name.\n * @returns {Array} - Array of Objects with the name and pos of\n * each part of the path.\n */\nfunction parseXFAPath(path) {\n const positionPattern = /(.+)\\[(\\d+)\\]$/;\n return path.split(\".\").map(component => {\n const m = component.match(positionPattern);\n if (m) {\n return { name: m[1], pos: parseInt(m[2], 10) };\n }\n return { name: component, pos: 0 };\n });\n}\n\nfunction escapePDFName(str) {\n const buffer = [];\n let start = 0;\n for (let i = 0, ii = str.length; i < ii; i++) {\n const char = str.charCodeAt(i);\n // Whitespace or delimiters aren't regular chars, so escape them.\n if (\n char < 0x21 ||\n char > 0x7e ||\n char === 0x23 /* # */ ||\n char === 0x28 /* ( */ ||\n char === 0x29 /* ) */ ||\n char === 0x3c /* < */ ||\n char === 0x3e /* > */ ||\n char === 0x5b /* [ */ ||\n char === 0x5d /* ] */ ||\n char === 0x7b /* { */ ||\n char === 0x7d /* } */ ||\n char === 0x2f /* / */ ||\n char === 0x25 /* % */\n ) {\n if (start < i) {\n buffer.push(str.substring(start, i));\n }\n buffer.push(`#${char.toString(16)}`);\n start = i + 1;\n }\n }\n\n if (buffer.length === 0) {\n return str;\n }\n\n if (start < str.length) {\n buffer.push(str.substring(start, str.length));\n }\n\n return buffer.join(\"\");\n}\n\n// Replace \"(\", \")\", \"\\n\", \"\\r\" and \"\\\" by \"\\(\", \"\\)\", \"\\\\n\", \"\\\\r\" and \"\\\\\"\n// in order to write it in a PDF file.\nfunction escapeString(str) {\n return str.replaceAll(/([()\\\\\\n\\r])/g, match => {\n if (match === \"\\n\") {\n return \"\\\\n\";\n } else if (match === \"\\r\") {\n return \"\\\\r\";\n }\n return `\\\\${match}`;\n });\n}\n\nfunction _collectJS(entry, xref, list, parents) {\n if (!entry) {\n return;\n }\n\n let parent = null;\n if (entry instanceof Ref) {\n if (parents.has(entry)) {\n // If we've already found entry then we've a cycle.\n return;\n }\n parent = entry;\n parents.put(parent);\n entry = xref.fetch(entry);\n }\n if (Array.isArray(entry)) {\n for (const element of entry) {\n _collectJS(element, xref, list, parents);\n }\n } else if (entry instanceof Dict) {\n if (isName(entry.get(\"S\"), \"JavaScript\")) {\n const js = entry.get(\"JS\");\n let code;\n if (js instanceof BaseStream) {\n code = js.getString();\n } else if (typeof js === \"string\") {\n code = js;\n }\n code &&= stringToPDFString(code).replaceAll(\"\\x00\", \"\");\n if (code) {\n list.push(code);\n }\n }\n _collectJS(entry.getRaw(\"Next\"), xref, list, parents);\n }\n\n if (parent) {\n parents.remove(parent);\n }\n}\n\nfunction collectActions(xref, dict, eventType) {\n const actions = Object.create(null);\n const additionalActionsDicts = getInheritableProperty({\n dict,\n key: \"AA\",\n stopWhenFound: false,\n });\n if (additionalActionsDicts) {\n // additionalActionsDicts contains dicts from ancestors\n // as they're found in the tree from bottom to top.\n // So the dicts are visited in reverse order to guarantee\n // that actions from elder ancestors will be overwritten\n // by ones from younger ancestors.\n for (let i = additionalActionsDicts.length - 1; i >= 0; i--) {\n const additionalActions = additionalActionsDicts[i];\n if (!(additionalActions instanceof Dict)) {\n continue;\n }\n for (const key of additionalActions.getKeys()) {\n const action = eventType[key];\n if (!action) {\n continue;\n }\n const actionDict = additionalActions.getRaw(key);\n const parents = new RefSet();\n const list = [];\n _collectJS(actionDict, xref, list, parents);\n if (list.length > 0) {\n actions[action] = list;\n }\n }\n }\n }\n // Collect the Action if any (we may have one on pushbutton).\n if (dict.has(\"A\")) {\n const actionDict = dict.get(\"A\");\n const parents = new RefSet();\n const list = [];\n _collectJS(actionDict, xref, list, parents);\n if (list.length > 0) {\n actions.Action = list;\n }\n }\n return objectSize(actions) > 0 ? actions : null;\n}\n\nconst XMLEntities = {\n /* < */ 0x3c: \"<\",\n /* > */ 0x3e: \">\",\n /* & */ 0x26: \"&\",\n /* \" */ 0x22: \""\",\n /* ' */ 0x27: \"'\",\n};\n\nfunction encodeToXmlString(str) {\n const buffer = [];\n let start = 0;\n for (let i = 0, ii = str.length; i < ii; i++) {\n const char = str.codePointAt(i);\n if (0x20 <= char && char <= 0x7e) {\n // ascii\n const entity = XMLEntities[char];\n if (entity) {\n if (start < i) {\n buffer.push(str.substring(start, i));\n }\n buffer.push(entity);\n start = i + 1;\n }\n } else {\n if (start < i) {\n buffer.push(str.substring(start, i));\n }\n buffer.push(`&#x${char.toString(16).toUpperCase()};`);\n if (char > 0xd7ff && (char < 0xe000 || char > 0xfffd)) {\n // char is represented by two u16\n i++;\n }\n start = i + 1;\n }\n }\n\n if (buffer.length === 0) {\n return str;\n }\n if (start < str.length) {\n buffer.push(str.substring(start, str.length));\n }\n return buffer.join(\"\");\n}\n\nfunction validateFontName(fontFamily, mustWarn = false) {\n // See https://developer.mozilla.org/en-US/docs/Web/CSS/string.\n const m = /^(\"|').*(\"|')$/.exec(fontFamily);\n if (m && m[1] === m[2]) {\n const re = new RegExp(`[^\\\\\\\\]${m[1]}`);\n if (re.test(fontFamily.slice(1, -1))) {\n if (mustWarn) {\n warn(`FontFamily contains unescaped ${m[1]}: ${fontFamily}.`);\n }\n return false;\n }\n } else {\n // See https://developer.mozilla.org/en-US/docs/Web/CSS/custom-ident.\n for (const ident of fontFamily.split(/[ \\t]+/)) {\n if (/^(\\d|(-(\\d|-)))/.test(ident) || !/^[\\w-\\\\]+$/.test(ident)) {\n if (mustWarn) {\n warn(`FontFamily contains invalid <custom-ident>: ${fontFamily}.`);\n }\n return false;\n }\n }\n }\n return true;\n}\n\nfunction validateCSSFont(cssFontInfo) {\n // See https://developer.mozilla.org/en-US/docs/Web/CSS/font-style.\n const DEFAULT_CSS_FONT_OBLIQUE = \"14\";\n // See https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight.\n const DEFAULT_CSS_FONT_WEIGHT = \"400\";\n const CSS_FONT_WEIGHT_VALUES = new Set([\n \"100\",\n \"200\",\n \"300\",\n \"400\",\n \"500\",\n \"600\",\n \"700\",\n \"800\",\n \"900\",\n \"1000\",\n \"normal\",\n \"bold\",\n \"bolder\",\n \"lighter\",\n ]);\n\n const { fontFamily, fontWeight, italicAngle } = cssFontInfo;\n\n if (!validateFontName(fontFamily, true)) {\n return false;\n }\n\n const weight = fontWeight ? fontWeight.toString() : \"\";\n cssFontInfo.fontWeight = CSS_FONT_WEIGHT_VALUES.has(weight)\n ? weight\n : DEFAULT_CSS_FONT_WEIGHT;\n\n const angle = parseFloat(italicAngle);\n cssFontInfo.italicAngle =\n isNaN(angle) || angle < -90 || angle > 90\n ? DEFAULT_CSS_FONT_OBLIQUE\n : italicAngle.toString();\n\n return true;\n}\n\nfunction recoverJsURL(str) {\n // Attempt to recover valid URLs from `JS` entries with certain\n // white-listed formats:\n // - window.open('http://example.com')\n // - app.launchURL('http://example.com', true)\n // - xfa.host.gotoURL('http://example.com')\n const URL_OPEN_METHODS = [\"app.launchURL\", \"window.open\", \"xfa.host.gotoURL\"];\n const regex = new RegExp(\n \"^\\\\s*(\" +\n URL_OPEN_METHODS.join(\"|\").replaceAll(\".\", \"\\\\.\") +\n \")\\\\((?:'|\\\")([^'\\\"]*)(?:'|\\\")(?:,\\\\s*(\\\\w+)\\\\)|\\\\))\",\n \"i\"\n );\n\n const jsUrl = regex.exec(str);\n if (jsUrl?.[2]) {\n const url = jsUrl[2];\n let newWindow = false;\n\n if (jsUrl[3] === \"true\" && jsUrl[1] === \"app.launchURL\") {\n newWindow = true;\n }\n return { url, newWindow };\n }\n\n return null;\n}\n\nfunction numberToString(value) {\n if (Number.isInteger(value)) {\n return value.toString();\n }\n\n const roundedValue = Math.round(value * 100);\n if (roundedValue % 100 === 0) {\n return (roundedValue / 100).toString();\n }\n\n if (roundedValue % 10 === 0) {\n return value.toFixed(1);\n }\n\n return value.toFixed(2);\n}\n\nfunction getNewAnnotationsMap(annotationStorage) {\n if (!annotationStorage) {\n return null;\n }\n const newAnnotationsByPage = new Map();\n // The concept of page in a XFA is very different, so\n // editing is just not implemented.\n for (const [key, value] of annotationStorage) {\n if (!key.startsWith(AnnotationEditorPrefix)) {\n continue;\n }\n let annotations = newAnnotationsByPage.get(value.pageIndex);\n if (!annotations) {\n annotations = [];\n newAnnotationsByPage.set(value.pageIndex, annotations);\n }\n annotations.push(value);\n }\n return newAnnotationsByPage.size > 0 ? newAnnotationsByPage : null;\n}\n\nfunction isAscii(str) {\n return /^[\\x00-\\x7F]*$/.test(str);\n}\n\nfunction stringToUTF16HexString(str) {\n const buf = [];\n for (let i = 0, ii = str.length; i < ii; i++) {\n const char = str.charCodeAt(i);\n buf.push(\n ((char >> 8) & 0xff).toString(16).padStart(2, \"0\"),\n (char & 0xff).toString(16).padStart(2, \"0\")\n );\n }\n return buf.join(\"\");\n}\n\nfunction stringToUTF16String(str, bigEndian = false) {\n const buf = [];\n if (bigEndian) {\n buf.push(\"\\xFE\\xFF\");\n }\n for (let i = 0, ii = str.length; i < ii; i++) {\n const char = str.charCodeAt(i);\n buf.push(\n String.fromCharCode((char >> 8) & 0xff),\n String.fromCharCode(char & 0xff)\n );\n }\n return buf.join(\"\");\n}\n\nfunction getRotationMatrix(rotation, width, height) {\n switch (rotation) {\n case 90:\n return [0, 1, -1, 0, width, 0];\n case 180:\n return [-1, 0, 0, -1, width, height];\n case 270:\n return [0, -1, 1, 0, 0, height];\n default:\n throw new Error(\"Invalid rotation\");\n }\n}\n\nexport {\n arrayBuffersToBytes,\n collectActions,\n encodeToXmlString,\n escapePDFName,\n escapeString,\n getInheritableProperty,\n getLookupTableFactory,\n getNewAnnotationsMap,\n getRotationMatrix,\n isAscii,\n isWhiteSpace,\n log2,\n MissingDataException,\n numberToString,\n ParserEOFException,\n parseXFAPath,\n PDF_VERSION_REGEXP,\n readInt8,\n readUint16,\n readUint32,\n recoverJsURL,\n stringToUTF16HexString,\n stringToUTF16String,\n toRomanNumerals,\n validateCSSFont,\n validateFontName,\n XRefEntryException,\n XRefParseException,\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 { BaseStream } from \"./base_stream.js\";\nimport { stringToBytes } from \"../shared/util.js\";\n\nclass Stream extends BaseStream {\n constructor(arrayBuffer, start, length, dict) {\n super();\n\n this.bytes =\n arrayBuffer instanceof Uint8Array\n ? arrayBuffer\n : new Uint8Array(arrayBuffer);\n this.start = start || 0;\n this.pos = this.start;\n this.end = start + length || this.bytes.length;\n this.dict = dict;\n }\n\n get length() {\n return this.end - this.start;\n }\n\n get isEmpty() {\n return this.length === 0;\n }\n\n getByte() {\n if (this.pos >= this.end) {\n return -1;\n }\n return this.bytes[this.pos++];\n }\n\n getBytes(length) {\n const bytes = this.bytes;\n const pos = this.pos;\n const strEnd = this.end;\n\n if (!length) {\n return bytes.subarray(pos, strEnd);\n }\n let end = pos + length;\n if (end > strEnd) {\n end = strEnd;\n }\n this.pos = end;\n return bytes.subarray(pos, end);\n }\n\n getByteRange(begin, end) {\n if (begin < 0) {\n begin = 0;\n }\n if (end > this.end) {\n end = this.end;\n }\n return this.bytes.subarray(begin, end);\n }\n\n reset() {\n this.pos = this.start;\n }\n\n moveStart() {\n this.start = this.pos;\n }\n\n makeSubStream(start, length, dict = null) {\n return new Stream(this.bytes.buffer, start, length, dict);\n }\n}\n\nclass StringStream extends Stream {\n constructor(str) {\n super(stringToBytes(str));\n }\n}\n\nclass NullStream extends Stream {\n constructor() {\n super(new Uint8Array(0));\n }\n}\n\nexport { NullStream, Stream, StringStream };\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 { arrayBuffersToBytes, MissingDataException } from \"./core_utils.js\";\nimport { assert, PromiseCapability } from \"../shared/util.js\";\nimport { Stream } from \"./stream.js\";\n\nclass ChunkedStream extends Stream {\n constructor(length, chunkSize, manager) {\n super(\n /* arrayBuffer = */ new Uint8Array(length),\n /* start = */ 0,\n /* length = */ length,\n /* dict = */ null\n );\n\n this.chunkSize = chunkSize;\n this._loadedChunks = new Set();\n this.numChunks = Math.ceil(length / chunkSize);\n this.manager = manager;\n this.progressiveDataLength = 0;\n this.lastSuccessfulEnsureByteChunk = -1; // Single-entry cache\n }\n\n // If a particular stream does not implement one or more of these methods,\n // an error should be thrown.\n getMissingChunks() {\n const chunks = [];\n for (let chunk = 0, n = this.numChunks; chunk < n; ++chunk) {\n if (!this._loadedChunks.has(chunk)) {\n chunks.push(chunk);\n }\n }\n return chunks;\n }\n\n get numChunksLoaded() {\n return this._loadedChunks.size;\n }\n\n get isDataLoaded() {\n return this.numChunksLoaded === this.numChunks;\n }\n\n onReceiveData(begin, chunk) {\n const chunkSize = this.chunkSize;\n if (begin % chunkSize !== 0) {\n throw new Error(`Bad begin offset: ${begin}`);\n }\n\n // Using `this.length` is inaccurate here since `this.start` can be moved\n // (see the `moveStart` method).\n const end = begin + chunk.byteLength;\n if (end % chunkSize !== 0 && end !== this.bytes.length) {\n throw new Error(`Bad end offset: ${end}`);\n }\n\n this.bytes.set(new Uint8Array(chunk), begin);\n const beginChunk = Math.floor(begin / chunkSize);\n const endChunk = Math.floor((end - 1) / chunkSize) + 1;\n\n for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) {\n // Since a value can only occur *once* in a `Set`, there's no need to\n // manually check `Set.prototype.has()` before adding the value here.\n this._loadedChunks.add(curChunk);\n }\n }\n\n onReceiveProgressiveData(data) {\n let position = this.progressiveDataLength;\n const beginChunk = Math.floor(position / this.chunkSize);\n\n this.bytes.set(new Uint8Array(data), position);\n position += data.byteLength;\n this.progressiveDataLength = position;\n const endChunk =\n position >= this.end\n ? this.numChunks\n : Math.floor(position / this.chunkSize);\n\n for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) {\n // Since a value can only occur *once* in a `Set`, there's no need to\n // manually check `Set.prototype.has()` before adding the value here.\n this._loadedChunks.add(curChunk);\n }\n }\n\n ensureByte(pos) {\n if (pos < this.progressiveDataLength) {\n return;\n }\n\n const chunk = Math.floor(pos / this.chunkSize);\n if (chunk > this.numChunks) {\n return;\n }\n if (chunk === this.lastSuccessfulEnsureByteChunk) {\n return;\n }\n\n if (!this._loadedChunks.has(chunk)) {\n throw new MissingDataException(pos, pos + 1);\n }\n this.lastSuccessfulEnsureByteChunk = chunk;\n }\n\n ensureRange(begin, end) {\n if (begin >= end) {\n return;\n }\n if (end <= this.progressiveDataLength) {\n return;\n }\n\n const beginChunk = Math.floor(begin / this.chunkSize);\n if (beginChunk > this.numChunks) {\n return;\n }\n const endChunk = Math.min(\n Math.floor((end - 1) / this.chunkSize) + 1,\n this.numChunks\n );\n for (let chunk = beginChunk; chunk < endChunk; ++chunk) {\n if (!this._loadedChunks.has(chunk)) {\n throw new MissingDataException(begin, end);\n }\n }\n }\n\n nextEmptyChunk(beginChunk) {\n const numChunks = this.numChunks;\n for (let i = 0; i < numChunks; ++i) {\n const chunk = (beginChunk + i) % numChunks; // Wrap around to beginning.\n if (!this._loadedChunks.has(chunk)) {\n return chunk;\n }\n }\n return null;\n }\n\n hasChunk(chunk) {\n return this._loadedChunks.has(chunk);\n }\n\n getByte() {\n const pos = this.pos;\n if (pos >= this.end) {\n return -1;\n }\n if (pos >= this.progressiveDataLength) {\n this.ensureByte(pos);\n }\n return this.bytes[this.pos++];\n }\n\n getBytes(length) {\n const bytes = this.bytes;\n const pos = this.pos;\n const strEnd = this.end;\n\n if (!length) {\n if (strEnd > this.progressiveDataLength) {\n this.ensureRange(pos, strEnd);\n }\n return bytes.subarray(pos, strEnd);\n }\n\n let end = pos + length;\n if (end > strEnd) {\n end = strEnd;\n }\n if (end > this.progressiveDataLength) {\n this.ensureRange(pos, end);\n }\n\n this.pos = end;\n return bytes.subarray(pos, end);\n }\n\n getByteRange(begin, end) {\n if (begin < 0) {\n begin = 0;\n }\n if (end > this.end) {\n end = this.end;\n }\n if (end > this.progressiveDataLength) {\n this.ensureRange(begin, end);\n }\n return this.bytes.subarray(begin, end);\n }\n\n makeSubStream(start, length, dict = null) {\n if (length) {\n if (start + length > this.progressiveDataLength) {\n this.ensureRange(start, start + length);\n }\n } else if (start >= this.progressiveDataLength) {\n // When the `length` is undefined you do *not*, under any circumstances,\n // want to fallback on calling `this.ensureRange(start, this.end)` since\n // that would force the *entire* PDF file to be loaded, thus completely\n // breaking the whole purpose of using streaming and/or range requests.\n //\n // However, not doing any checking here could very easily lead to wasted\n // time/resources during e.g. parsing, since `MissingDataException`s will\n // require data to be re-parsed, which we attempt to minimize by at least\n // checking that the *beginning* of the data is available here.\n this.ensureByte(start);\n }\n\n function ChunkedStreamSubstream() {}\n ChunkedStreamSubstream.prototype = Object.create(this);\n ChunkedStreamSubstream.prototype.getMissingChunks = function () {\n const chunkSize = this.chunkSize;\n const beginChunk = Math.floor(this.start / chunkSize);\n const endChunk = Math.floor((this.end - 1) / chunkSize) + 1;\n const missingChunks = [];\n for (let chunk = beginChunk; chunk < endChunk; ++chunk) {\n if (!this._loadedChunks.has(chunk)) {\n missingChunks.push(chunk);\n }\n }\n return missingChunks;\n };\n Object.defineProperty(ChunkedStreamSubstream.prototype, \"isDataLoaded\", {\n get() {\n if (this.numChunksLoaded === this.numChunks) {\n return true;\n }\n return this.getMissingChunks().length === 0;\n },\n configurable: true,\n });\n\n const subStream = new ChunkedStreamSubstream();\n subStream.pos = subStream.start = start;\n subStream.end = start + length || this.end;\n subStream.dict = dict;\n return subStream;\n }\n\n getBaseStreams() {\n return [this];\n }\n}\n\nclass ChunkedStreamManager {\n constructor(pdfNetworkStream, args) {\n this.length = args.length;\n this.chunkSize = args.rangeChunkSize;\n this.stream = new ChunkedStream(this.length, this.chunkSize, this);\n this.pdfNetworkStream = pdfNetworkStream;\n this.disableAutoFetch = args.disableAutoFetch;\n this.msgHandler = args.msgHandler;\n\n this.currRequestId = 0;\n\n this._chunksNeededByRequest = new Map();\n this._requestsByChunk = new Map();\n this._promisesByRequest = new Map();\n this.progressiveDataLength = 0;\n this.aborted = false;\n\n this._loadedStreamCapability = new PromiseCapability();\n }\n\n sendRequest(begin, end) {\n const rangeReader = this.pdfNetworkStream.getRangeReader(begin, end);\n if (!rangeReader.isStreamingSupported) {\n rangeReader.onProgress = this.onProgress.bind(this);\n }\n\n let chunks = [],\n loaded = 0;\n return new Promise((resolve, reject) => {\n const readChunk = ({ value, done }) => {\n try {\n if (done) {\n const chunkData = arrayBuffersToBytes(chunks);\n chunks = null;\n resolve(chunkData);\n return;\n }\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n value instanceof ArrayBuffer,\n \"readChunk (sendRequest) - expected an ArrayBuffer.\"\n );\n }\n loaded += value.byteLength;\n\n if (rangeReader.isStreamingSupported) {\n this.onProgress({ loaded });\n }\n\n chunks.push(value);\n rangeReader.read().then(readChunk, reject);\n } catch (e) {\n reject(e);\n }\n };\n rangeReader.read().then(readChunk, reject);\n }).then(data => {\n if (this.aborted) {\n return; // Ignoring any data after abort.\n }\n this.onReceiveData({ chunk: data, begin });\n });\n }\n\n /**\n * Get all the chunks that are not yet loaded and group them into\n * contiguous ranges to load in as few requests as possible.\n */\n requestAllChunks(noFetch = false) {\n if (!noFetch) {\n const missingChunks = this.stream.getMissingChunks();\n this._requestChunks(missingChunks);\n }\n return this._loadedStreamCapability.promise;\n }\n\n _requestChunks(chunks) {\n const requestId = this.currRequestId++;\n\n const chunksNeeded = new Set();\n this._chunksNeededByRequest.set(requestId, chunksNeeded);\n for (const chunk of chunks) {\n if (!this.stream.hasChunk(chunk)) {\n chunksNeeded.add(chunk);\n }\n }\n\n if (chunksNeeded.size === 0) {\n return Promise.resolve();\n }\n\n const capability = new PromiseCapability();\n this._promisesByRequest.set(requestId, capability);\n\n const chunksToRequest = [];\n for (const chunk of chunksNeeded) {\n let requestIds = this._requestsByChunk.get(chunk);\n if (!requestIds) {\n requestIds = [];\n this._requestsByChunk.set(chunk, requestIds);\n\n chunksToRequest.push(chunk);\n }\n requestIds.push(requestId);\n }\n\n if (chunksToRequest.length > 0) {\n const groupedChunksToRequest = this.groupChunks(chunksToRequest);\n for (const groupedChunk of groupedChunksToRequest) {\n const begin = groupedChunk.beginChunk * this.chunkSize;\n const end = Math.min(\n groupedChunk.endChunk * this.chunkSize,\n this.length\n );\n this.sendRequest(begin, end).catch(capability.reject);\n }\n }\n\n return capability.promise.catch(reason => {\n if (this.aborted) {\n return; // Ignoring any pending requests after abort.\n }\n throw reason;\n });\n }\n\n getStream() {\n return this.stream;\n }\n\n /**\n * Loads any chunks in the requested range that are not yet loaded.\n */\n requestRange(begin, end) {\n end = Math.min(end, this.length);\n\n const beginChunk = this.getBeginChunk(begin);\n const endChunk = this.getEndChunk(end);\n\n const chunks = [];\n for (let chunk = beginChunk; chunk < endChunk; ++chunk) {\n chunks.push(chunk);\n }\n return this._requestChunks(chunks);\n }\n\n requestRanges(ranges = []) {\n const chunksToRequest = [];\n for (const range of ranges) {\n const beginChunk = this.getBeginChunk(range.begin);\n const endChunk = this.getEndChunk(range.end);\n for (let chunk = beginChunk; chunk < endChunk; ++chunk) {\n if (!chunksToRequest.includes(chunk)) {\n chunksToRequest.push(chunk);\n }\n }\n }\n\n chunksToRequest.sort(function (a, b) {\n return a - b;\n });\n return this._requestChunks(chunksToRequest);\n }\n\n /**\n * Groups a sorted array of chunks into as few contiguous larger\n * chunks as possible.\n */\n groupChunks(chunks) {\n const groupedChunks = [];\n let beginChunk = -1;\n let prevChunk = -1;\n\n for (let i = 0, ii = chunks.length; i < ii; ++i) {\n const chunk = chunks[i];\n if (beginChunk < 0) {\n beginChunk = chunk;\n }\n\n if (prevChunk >= 0 && prevChunk + 1 !== chunk) {\n groupedChunks.push({ beginChunk, endChunk: prevChunk + 1 });\n beginChunk = chunk;\n }\n if (i + 1 === chunks.length) {\n groupedChunks.push({ beginChunk, endChunk: chunk + 1 });\n }\n\n prevChunk = chunk;\n }\n return groupedChunks;\n }\n\n onProgress(args) {\n this.msgHandler.send(\"DocProgress\", {\n loaded: this.stream.numChunksLoaded * this.chunkSize + args.loaded,\n total: this.length,\n });\n }\n\n onReceiveData(args) {\n const chunk = args.chunk;\n const isProgressive = args.begin === undefined;\n const begin = isProgressive ? this.progressiveDataLength : args.begin;\n const end = begin + chunk.byteLength;\n\n const beginChunk = Math.floor(begin / this.chunkSize);\n const endChunk =\n end < this.length\n ? Math.floor(end / this.chunkSize)\n : Math.ceil(end / this.chunkSize);\n\n if (isProgressive) {\n this.stream.onReceiveProgressiveData(chunk);\n this.progressiveDataLength = end;\n } else {\n this.stream.onReceiveData(begin, chunk);\n }\n\n if (this.stream.isDataLoaded) {\n this._loadedStreamCapability.resolve(this.stream);\n }\n\n const loadedRequests = [];\n for (let curChunk = beginChunk; curChunk < endChunk; ++curChunk) {\n // The server might return more chunks than requested.\n const requestIds = this._requestsByChunk.get(curChunk);\n if (!requestIds) {\n continue;\n }\n this._requestsByChunk.delete(curChunk);\n\n for (const requestId of requestIds) {\n const chunksNeeded = this._chunksNeededByRequest.get(requestId);\n if (chunksNeeded.has(curChunk)) {\n chunksNeeded.delete(curChunk);\n }\n\n if (chunksNeeded.size > 0) {\n continue;\n }\n loadedRequests.push(requestId);\n }\n }\n\n // If there are no pending requests, automatically fetch the next\n // unfetched chunk of the PDF file.\n if (!this.disableAutoFetch && this._requestsByChunk.size === 0) {\n let nextEmptyChunk;\n if (this.stream.numChunksLoaded === 1) {\n // This is a special optimization so that after fetching the first\n // chunk, rather than fetching the second chunk, we fetch the last\n // chunk.\n const lastChunk = this.stream.numChunks - 1;\n if (!this.stream.hasChunk(lastChunk)) {\n nextEmptyChunk = lastChunk;\n }\n } else {\n nextEmptyChunk = this.stream.nextEmptyChunk(endChunk);\n }\n if (Number.isInteger(nextEmptyChunk)) {\n this._requestChunks([nextEmptyChunk]);\n }\n }\n\n for (const requestId of loadedRequests) {\n const capability = this._promisesByRequest.get(requestId);\n this._promisesByRequest.delete(requestId);\n capability.resolve();\n }\n\n this.msgHandler.send(\"DocProgress\", {\n loaded: this.stream.numChunksLoaded * this.chunkSize,\n total: this.length,\n });\n }\n\n onError(err) {\n this._loadedStreamCapability.reject(err);\n }\n\n getBeginChunk(begin) {\n return Math.floor(begin / this.chunkSize);\n }\n\n getEndChunk(end) {\n return Math.floor((end - 1) / this.chunkSize) + 1;\n }\n\n abort(reason) {\n this.aborted = true;\n this.pdfNetworkStream?.cancelAllRequests(reason);\n\n for (const capability of this._promisesByRequest.values()) {\n capability.reject(reason);\n }\n }\n}\n\nexport { ChunkedStream, ChunkedStreamManager };\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 FormatError,\n info,\n shadow,\n unreachable,\n warn,\n} from \"../shared/util.js\";\nimport { Dict, Name, Ref } from \"./primitives.js\";\nimport { BaseStream } from \"./base_stream.js\";\nimport { MissingDataException } from \"./core_utils.js\";\n\n/**\n * Resizes an RGB image with 3 components.\n * @param {TypedArray} src - The source buffer.\n * @param {TypedArray} dest - The destination buffer.\n * @param {number} w1 - Original width.\n * @param {number} h1 - Original height.\n * @param {number} w2 - New width.\n * @param {number} h2 - New height.\n * @param {number} alpha01 - Size reserved for the alpha channel.\n */\nfunction resizeRgbImage(src, dest, w1, h1, w2, h2, alpha01) {\n const COMPONENTS = 3;\n alpha01 = alpha01 !== 1 ? 0 : alpha01;\n const xRatio = w1 / w2;\n const yRatio = h1 / h2;\n let newIndex = 0,\n oldIndex;\n const xScaled = new Uint16Array(w2);\n const w1Scanline = w1 * COMPONENTS;\n\n for (let i = 0; i < w2; i++) {\n xScaled[i] = Math.floor(i * xRatio) * COMPONENTS;\n }\n for (let i = 0; i < h2; i++) {\n const py = Math.floor(i * yRatio) * w1Scanline;\n for (let j = 0; j < w2; j++) {\n oldIndex = py + xScaled[j];\n dest[newIndex++] = src[oldIndex++];\n dest[newIndex++] = src[oldIndex++];\n dest[newIndex++] = src[oldIndex++];\n newIndex += alpha01;\n }\n }\n}\n\nclass ColorSpace {\n constructor(name, numComps) {\n if (this.constructor === ColorSpace) {\n unreachable(\"Cannot initialize ColorSpace.\");\n }\n this.name = name;\n this.numComps = numComps;\n }\n\n /**\n * Converts the color value to the RGB color. The color components are\n * located in the src array starting from the srcOffset. Returns the array\n * of the rgb components, each value ranging from [0,255].\n */\n getRgb(src, srcOffset) {\n const rgb = new Uint8ClampedArray(3);\n this.getRgbItem(src, srcOffset, rgb, 0);\n return rgb;\n }\n\n /**\n * Converts the color value to the RGB color, similar to the getRgb method.\n * The result placed into the dest array starting from the destOffset.\n */\n getRgbItem(src, srcOffset, dest, destOffset) {\n unreachable(\"Should not call ColorSpace.getRgbItem\");\n }\n\n /**\n * Converts the specified number of the color values to the RGB colors.\n * The colors are located in the src array starting from the srcOffset.\n * The result is placed into the dest array starting from the destOffset.\n * The src array items shall be in [0,2^bits) range, the dest array items\n * will be in [0,255] range. alpha01 indicates how many alpha components\n * there are in the dest array; it will be either 0 (RGB array) or 1 (RGBA\n * array).\n */\n getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {\n unreachable(\"Should not call ColorSpace.getRgbBuffer\");\n }\n\n /**\n * Determines the number of bytes required to store the result of the\n * conversion done by the getRgbBuffer method. As in getRgbBuffer,\n * |alpha01| is either 0 (RGB output) or 1 (RGBA output).\n */\n getOutputLength(inputLength, alpha01) {\n unreachable(\"Should not call ColorSpace.getOutputLength\");\n }\n\n /**\n * Returns true if source data will be equal the result/output data.\n */\n isPassthrough(bits) {\n return false;\n }\n\n /**\n * Refer to the static `ColorSpace.isDefaultDecode` method below.\n */\n isDefaultDecode(decodeMap, bpc) {\n return ColorSpace.isDefaultDecode(decodeMap, this.numComps);\n }\n\n /**\n * Fills in the RGB colors in the destination buffer. alpha01 indicates\n * how many alpha components there are in the dest array; it will be either\n * 0 (RGB array) or 1 (RGBA array).\n */\n fillRgb(\n dest,\n originalWidth,\n originalHeight,\n width,\n height,\n actualHeight,\n bpc,\n comps,\n alpha01\n ) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n dest instanceof Uint8ClampedArray,\n 'ColorSpace.fillRgb: Unsupported \"dest\" type.'\n );\n }\n const count = originalWidth * originalHeight;\n let rgbBuf = null;\n const numComponentColors = 1 << bpc;\n const needsResizing = originalHeight !== height || originalWidth !== width;\n\n if (this.isPassthrough(bpc)) {\n rgbBuf = comps;\n } else if (\n this.numComps === 1 &&\n count > numComponentColors &&\n this.name !== \"DeviceGray\" &&\n this.name !== \"DeviceRGB\"\n ) {\n // Optimization: create a color map when there is just one component and\n // we are converting more colors than the size of the color map. We\n // don't build the map if the colorspace is gray or rgb since those\n // methods are faster than building a map. This mainly offers big speed\n // ups for indexed and alternate colorspaces.\n //\n // TODO it may be worth while to cache the color map. While running\n // testing I never hit a cache so I will leave that out for now (perhaps\n // we are reparsing colorspaces too much?).\n const allColors =\n bpc <= 8\n ? new Uint8Array(numComponentColors)\n : new Uint16Array(numComponentColors);\n for (let i = 0; i < numComponentColors; i++) {\n allColors[i] = i;\n }\n const colorMap = new Uint8ClampedArray(numComponentColors * 3);\n this.getRgbBuffer(\n allColors,\n 0,\n numComponentColors,\n colorMap,\n 0,\n bpc,\n /* alpha01 = */ 0\n );\n\n if (!needsResizing) {\n // Fill in the RGB values directly into |dest|.\n let destPos = 0;\n for (let i = 0; i < count; ++i) {\n const key = comps[i] * 3;\n dest[destPos++] = colorMap[key];\n dest[destPos++] = colorMap[key + 1];\n dest[destPos++] = colorMap[key + 2];\n destPos += alpha01;\n }\n } else {\n rgbBuf = new Uint8Array(count * 3);\n let rgbPos = 0;\n for (let i = 0; i < count; ++i) {\n const key = comps[i] * 3;\n rgbBuf[rgbPos++] = colorMap[key];\n rgbBuf[rgbPos++] = colorMap[key + 1];\n rgbBuf[rgbPos++] = colorMap[key + 2];\n }\n }\n } else if (!needsResizing) {\n // Fill in the RGB values directly into |dest|.\n this.getRgbBuffer(comps, 0, width * actualHeight, dest, 0, bpc, alpha01);\n } else {\n rgbBuf = new Uint8ClampedArray(count * 3);\n this.getRgbBuffer(comps, 0, count, rgbBuf, 0, bpc, /* alpha01 = */ 0);\n }\n\n if (rgbBuf) {\n if (needsResizing) {\n resizeRgbImage(\n rgbBuf,\n dest,\n originalWidth,\n originalHeight,\n width,\n height,\n alpha01\n );\n } else {\n let destPos = 0,\n rgbPos = 0;\n for (let i = 0, ii = width * actualHeight; i < ii; i++) {\n dest[destPos++] = rgbBuf[rgbPos++];\n dest[destPos++] = rgbBuf[rgbPos++];\n dest[destPos++] = rgbBuf[rgbPos++];\n destPos += alpha01;\n }\n }\n }\n }\n\n /**\n * True if the colorspace has components in the default range of [0, 1].\n * This should be true for all colorspaces except for lab color spaces\n * which are [0,100], [-128, 127], [-128, 127].\n */\n get usesZeroToOneRange() {\n return shadow(this, \"usesZeroToOneRange\", true);\n }\n\n /**\n * @private\n */\n static _cache(cacheKey, xref, localColorSpaceCache, parsedColorSpace) {\n if (!localColorSpaceCache) {\n throw new Error(\n 'ColorSpace._cache - expected \"localColorSpaceCache\" argument.'\n );\n }\n if (!parsedColorSpace) {\n throw new Error(\n 'ColorSpace._cache - expected \"parsedColorSpace\" argument.'\n );\n }\n let csName, csRef;\n if (cacheKey instanceof Ref) {\n csRef = cacheKey;\n\n // If parsing succeeded, we know that this call cannot throw.\n cacheKey = xref.fetch(cacheKey);\n }\n if (cacheKey instanceof Name) {\n csName = cacheKey.name;\n }\n if (csName || csRef) {\n localColorSpaceCache.set(csName, csRef, parsedColorSpace);\n }\n }\n\n static getCached(cacheKey, xref, localColorSpaceCache) {\n if (!localColorSpaceCache) {\n throw new Error(\n 'ColorSpace.getCached - expected \"localColorSpaceCache\" argument.'\n );\n }\n if (cacheKey instanceof Ref) {\n const localColorSpace = localColorSpaceCache.getByRef(cacheKey);\n if (localColorSpace) {\n return localColorSpace;\n }\n\n try {\n cacheKey = xref.fetch(cacheKey);\n } catch (ex) {\n if (ex instanceof MissingDataException) {\n throw ex;\n }\n // Any errors should be handled during parsing, rather than here.\n }\n }\n if (cacheKey instanceof Name) {\n const localColorSpace = localColorSpaceCache.getByName(cacheKey.name);\n if (localColorSpace) {\n return localColorSpace;\n }\n }\n return null;\n }\n\n static async parseAsync({\n cs,\n xref,\n resources = null,\n pdfFunctionFactory,\n localColorSpaceCache,\n }) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n !this.getCached(cs, xref, localColorSpaceCache),\n \"Expected `ColorSpace.getCached` to have been manually checked \" +\n \"before calling `ColorSpace.parseAsync`.\"\n );\n }\n const parsedColorSpace = this._parse(\n cs,\n xref,\n resources,\n pdfFunctionFactory\n );\n\n // Attempt to cache the parsed ColorSpace, by name and/or reference.\n this._cache(cs, xref, localColorSpaceCache, parsedColorSpace);\n\n return parsedColorSpace;\n }\n\n static parse({\n cs,\n xref,\n resources = null,\n pdfFunctionFactory,\n localColorSpaceCache,\n }) {\n const cachedColorSpace = this.getCached(cs, xref, localColorSpaceCache);\n if (cachedColorSpace) {\n return cachedColorSpace;\n }\n const parsedColorSpace = this._parse(\n cs,\n xref,\n resources,\n pdfFunctionFactory\n );\n\n // Attempt to cache the parsed ColorSpace, by name and/or reference.\n this._cache(cs, xref, localColorSpaceCache, parsedColorSpace);\n\n return parsedColorSpace;\n }\n\n /**\n * @private\n */\n static _parse(cs, xref, resources = null, pdfFunctionFactory) {\n cs = xref.fetchIfRef(cs);\n if (cs instanceof Name) {\n switch (cs.name) {\n case \"G\":\n case \"DeviceGray\":\n return this.singletons.gray;\n case \"RGB\":\n case \"DeviceRGB\":\n return this.singletons.rgb;\n case \"CMYK\":\n case \"DeviceCMYK\":\n return this.singletons.cmyk;\n case \"Pattern\":\n return new PatternCS(/* baseCS = */ null);\n default:\n if (resources instanceof Dict) {\n const colorSpaces = resources.get(\"ColorSpace\");\n if (colorSpaces instanceof Dict) {\n const resourcesCS = colorSpaces.get(cs.name);\n if (resourcesCS) {\n if (resourcesCS instanceof Name) {\n return this._parse(\n resourcesCS,\n xref,\n resources,\n pdfFunctionFactory\n );\n }\n cs = resourcesCS;\n break;\n }\n }\n }\n throw new FormatError(`Unrecognized ColorSpace: ${cs.name}`);\n }\n }\n if (Array.isArray(cs)) {\n const mode = xref.fetchIfRef(cs[0]).name;\n let params, numComps, baseCS, whitePoint, blackPoint, gamma;\n\n switch (mode) {\n case \"G\":\n case \"DeviceGray\":\n return this.singletons.gray;\n case \"RGB\":\n case \"DeviceRGB\":\n return this.singletons.rgb;\n case \"CMYK\":\n case \"DeviceCMYK\":\n return this.singletons.cmyk;\n case \"CalGray\":\n params = xref.fetchIfRef(cs[1]);\n whitePoint = params.getArray(\"WhitePoint\");\n blackPoint = params.getArray(\"BlackPoint\");\n gamma = params.get(\"Gamma\");\n return new CalGrayCS(whitePoint, blackPoint, gamma);\n case \"CalRGB\":\n params = xref.fetchIfRef(cs[1]);\n whitePoint = params.getArray(\"WhitePoint\");\n blackPoint = params.getArray(\"BlackPoint\");\n gamma = params.getArray(\"Gamma\");\n const matrix = params.getArray(\"Matrix\");\n return new CalRGBCS(whitePoint, blackPoint, gamma, matrix);\n case \"ICCBased\":\n const stream = xref.fetchIfRef(cs[1]);\n const dict = stream.dict;\n numComps = dict.get(\"N\");\n const alt = dict.get(\"Alternate\");\n if (alt) {\n const altCS = this._parse(alt, xref, resources, pdfFunctionFactory);\n // Ensure that the number of components are correct,\n // and also (indirectly) that it is not a PatternCS.\n if (altCS.numComps === numComps) {\n return altCS;\n }\n warn(\"ICCBased color space: Ignoring incorrect /Alternate entry.\");\n }\n if (numComps === 1) {\n return this.singletons.gray;\n } else if (numComps === 3) {\n return this.singletons.rgb;\n } else if (numComps === 4) {\n return this.singletons.cmyk;\n }\n break;\n case \"Pattern\":\n baseCS = cs[1] || null;\n if (baseCS) {\n baseCS = this._parse(baseCS, xref, resources, pdfFunctionFactory);\n }\n return new PatternCS(baseCS);\n case \"I\":\n case \"Indexed\":\n baseCS = this._parse(cs[1], xref, resources, pdfFunctionFactory);\n const hiVal = xref.fetchIfRef(cs[2]) + 1;\n const lookup = xref.fetchIfRef(cs[3]);\n return new IndexedCS(baseCS, hiVal, lookup);\n case \"Separation\":\n case \"DeviceN\":\n const name = xref.fetchIfRef(cs[1]);\n numComps = Array.isArray(name) ? name.length : 1;\n baseCS = this._parse(cs[2], xref, resources, pdfFunctionFactory);\n const tintFn = pdfFunctionFactory.create(cs[3]);\n return new AlternateCS(numComps, baseCS, tintFn);\n case \"Lab\":\n params = xref.fetchIfRef(cs[1]);\n whitePoint = params.getArray(\"WhitePoint\");\n blackPoint = params.getArray(\"BlackPoint\");\n const range = params.getArray(\"Range\");\n return new LabCS(whitePoint, blackPoint, range);\n default:\n throw new FormatError(`Unimplemented ColorSpace object: ${mode}`);\n }\n }\n throw new FormatError(`Unrecognized ColorSpace object: ${cs}`);\n }\n\n /**\n * Checks if a decode map matches the default decode map for a color space.\n * This handles the general decode maps where there are two values per\n * component, e.g. [0, 1, 0, 1, 0, 1] for a RGB color.\n * This does not handle Lab, Indexed, or Pattern decode maps since they are\n * slightly different.\n * @param {Array} decode - Decode map (usually from an image).\n * @param {number} numComps - Number of components the color space has.\n */\n static isDefaultDecode(decode, numComps) {\n if (!Array.isArray(decode)) {\n return true;\n }\n if (numComps * 2 !== decode.length) {\n warn(\"The decode map is not the correct length\");\n return true;\n }\n for (let i = 0, ii = decode.length; i < ii; i += 2) {\n if (decode[i] !== 0 || decode[i + 1] !== 1) {\n return false;\n }\n }\n return true;\n }\n\n static get singletons() {\n return shadow(this, \"singletons\", {\n get gray() {\n return shadow(this, \"gray\", new DeviceGrayCS());\n },\n get rgb() {\n return shadow(this, \"rgb\", new DeviceRgbCS());\n },\n get cmyk() {\n return shadow(this, \"cmyk\", new DeviceCmykCS());\n },\n });\n }\n}\n\n/**\n * Alternate color space handles both Separation and DeviceN color spaces. A\n * Separation color space is actually just a DeviceN with one color component.\n * Both color spaces use a tinting function to convert colors to a base color\n * space.\n *\n * The default color is `new Float32Array(new Array(numComps).fill(1))`.\n */\nclass AlternateCS extends ColorSpace {\n constructor(numComps, base, tintFn) {\n super(\"Alternate\", numComps);\n this.base = base;\n this.tintFn = tintFn;\n this.tmpBuf = new Float32Array(base.numComps);\n }\n\n getRgbItem(src, srcOffset, dest, destOffset) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n dest instanceof Uint8ClampedArray,\n 'AlternateCS.getRgbItem: Unsupported \"dest\" type.'\n );\n }\n const tmpBuf = this.tmpBuf;\n this.tintFn(src, srcOffset, tmpBuf, 0);\n this.base.getRgbItem(tmpBuf, 0, dest, destOffset);\n }\n\n getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n dest instanceof Uint8ClampedArray,\n 'AlternateCS.getRgbBuffer: Unsupported \"dest\" type.'\n );\n }\n const tintFn = this.tintFn;\n const base = this.base;\n const scale = 1 / ((1 << bits) - 1);\n const baseNumComps = base.numComps;\n const usesZeroToOneRange = base.usesZeroToOneRange;\n const isPassthrough =\n (base.isPassthrough(8) || !usesZeroToOneRange) && alpha01 === 0;\n let pos = isPassthrough ? destOffset : 0;\n const baseBuf = isPassthrough\n ? dest\n : new Uint8ClampedArray(baseNumComps * count);\n const numComps = this.numComps;\n\n const scaled = new Float32Array(numComps);\n const tinted = new Float32Array(baseNumComps);\n let i, j;\n\n for (i = 0; i < count; i++) {\n for (j = 0; j < numComps; j++) {\n scaled[j] = src[srcOffset++] * scale;\n }\n tintFn(scaled, 0, tinted, 0);\n if (usesZeroToOneRange) {\n for (j = 0; j < baseNumComps; j++) {\n baseBuf[pos++] = tinted[j] * 255;\n }\n } else {\n base.getRgbItem(tinted, 0, baseBuf, pos);\n pos += baseNumComps;\n }\n }\n\n if (!isPassthrough) {\n base.getRgbBuffer(baseBuf, 0, count, dest, destOffset, 8, alpha01);\n }\n }\n\n getOutputLength(inputLength, alpha01) {\n return this.base.getOutputLength(\n (inputLength * this.base.numComps) / this.numComps,\n alpha01\n );\n }\n}\n\nclass PatternCS extends ColorSpace {\n constructor(baseCS) {\n super(\"Pattern\", null);\n this.base = baseCS;\n }\n\n isDefaultDecode(decodeMap, bpc) {\n unreachable(\"Should not call PatternCS.isDefaultDecode\");\n }\n}\n\n/**\n * The default color is `new Uint8Array([0])`.\n */\nclass IndexedCS extends ColorSpace {\n constructor(base, highVal, lookup) {\n super(\"Indexed\", 1);\n this.base = base;\n this.highVal = highVal;\n\n const length = base.numComps * highVal;\n this.lookup = new Uint8Array(length);\n\n if (lookup instanceof BaseStream) {\n const bytes = lookup.getBytes(length);\n this.lookup.set(bytes);\n } else if (typeof lookup === \"string\") {\n for (let i = 0; i < length; ++i) {\n this.lookup[i] = lookup.charCodeAt(i) & 0xff;\n }\n } else {\n throw new FormatError(`IndexedCS - unrecognized lookup table: ${lookup}`);\n }\n }\n\n getRgbItem(src, srcOffset, dest, destOffset) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n dest instanceof Uint8ClampedArray,\n 'IndexedCS.getRgbItem: Unsupported \"dest\" type.'\n );\n }\n const numComps = this.base.numComps;\n const start = src[srcOffset] * numComps;\n this.base.getRgbBuffer(this.lookup, start, 1, dest, destOffset, 8, 0);\n }\n\n getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n dest instanceof Uint8ClampedArray,\n 'IndexedCS.getRgbBuffer: Unsupported \"dest\" type.'\n );\n }\n const base = this.base;\n const numComps = base.numComps;\n const outputDelta = base.getOutputLength(numComps, alpha01);\n const lookup = this.lookup;\n\n for (let i = 0; i < count; ++i) {\n const lookupPos = src[srcOffset++] * numComps;\n base.getRgbBuffer(lookup, lookupPos, 1, dest, destOffset, 8, alpha01);\n destOffset += outputDelta;\n }\n }\n\n getOutputLength(inputLength, alpha01) {\n return this.base.getOutputLength(inputLength * this.base.numComps, alpha01);\n }\n\n isDefaultDecode(decodeMap, bpc) {\n if (!Array.isArray(decodeMap)) {\n return true;\n }\n if (decodeMap.length !== 2) {\n warn(\"Decode map length is not correct\");\n return true;\n }\n if (!Number.isInteger(bpc) || bpc < 1) {\n warn(\"Bits per component is not correct\");\n return true;\n }\n return decodeMap[0] === 0 && decodeMap[1] === (1 << bpc) - 1;\n }\n}\n\n/**\n * The default color is `new Float32Array([0])`.\n */\nclass DeviceGrayCS extends ColorSpace {\n constructor() {\n super(\"DeviceGray\", 1);\n }\n\n getRgbItem(src, srcOffset, dest, destOffset) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n dest instanceof Uint8ClampedArray,\n 'DeviceGrayCS.getRgbItem: Unsupported \"dest\" type.'\n );\n }\n const c = src[srcOffset] * 255;\n dest[destOffset] = dest[destOffset + 1] = dest[destOffset + 2] = c;\n }\n\n getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n dest instanceof Uint8ClampedArray,\n 'DeviceGrayCS.getRgbBuffer: Unsupported \"dest\" type.'\n );\n }\n const scale = 255 / ((1 << bits) - 1);\n let j = srcOffset,\n q = destOffset;\n for (let i = 0; i < count; ++i) {\n const c = scale * src[j++];\n dest[q++] = c;\n dest[q++] = c;\n dest[q++] = c;\n q += alpha01;\n }\n }\n\n getOutputLength(inputLength, alpha01) {\n return inputLength * (3 + alpha01);\n }\n}\n\n/**\n * The default color is `new Float32Array([0, 0, 0])`.\n */\nclass DeviceRgbCS extends ColorSpace {\n constructor() {\n super(\"DeviceRGB\", 3);\n }\n\n getRgbItem(src, srcOffset, dest, destOffset) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n dest instanceof Uint8ClampedArray,\n 'DeviceRgbCS.getRgbItem: Unsupported \"dest\" type.'\n );\n }\n dest[destOffset] = src[srcOffset] * 255;\n dest[destOffset + 1] = src[srcOffset + 1] * 255;\n dest[destOffset + 2] = src[srcOffset + 2] * 255;\n }\n\n getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n dest instanceof Uint8ClampedArray,\n 'DeviceRgbCS.getRgbBuffer: Unsupported \"dest\" type.'\n );\n }\n if (bits === 8 && alpha01 === 0) {\n dest.set(src.subarray(srcOffset, srcOffset + count * 3), destOffset);\n return;\n }\n const scale = 255 / ((1 << bits) - 1);\n let j = srcOffset,\n q = destOffset;\n for (let i = 0; i < count; ++i) {\n dest[q++] = scale * src[j++];\n dest[q++] = scale * src[j++];\n dest[q++] = scale * src[j++];\n q += alpha01;\n }\n }\n\n getOutputLength(inputLength, alpha01) {\n return ((inputLength * (3 + alpha01)) / 3) | 0;\n }\n\n isPassthrough(bits) {\n return bits === 8;\n }\n}\n\n/**\n * The default color is `new Float32Array([0, 0, 0, 1])`.\n */\nclass DeviceCmykCS extends ColorSpace {\n constructor() {\n super(\"DeviceCMYK\", 4);\n }\n\n // The coefficients below was found using numerical analysis: the method of\n // steepest descent for the sum((f_i - color_value_i)^2) for r/g/b colors,\n // where color_value is the tabular value from the table of sampled RGB colors\n // from CMYK US Web Coated (SWOP) colorspace, and f_i is the corresponding\n // CMYK color conversion using the estimation below:\n // f(A, B,.. N) = Acc+Bcm+Ccy+Dck+c+Fmm+Gmy+Hmk+Im+Jyy+Kyk+Ly+Mkk+Nk+255\n #toRgb(src, srcOffset, srcScale, dest, destOffset) {\n const c = src[srcOffset] * srcScale;\n const m = src[srcOffset + 1] * srcScale;\n const y = src[srcOffset + 2] * srcScale;\n const k = src[srcOffset + 3] * srcScale;\n\n dest[destOffset] =\n 255 +\n c *\n (-4.387332384609988 * c +\n 54.48615194189176 * m +\n 18.82290502165302 * y +\n 212.25662451639585 * k +\n -285.2331026137004) +\n m *\n (1.7149763477362134 * m -\n 5.6096736904047315 * y +\n -17.873870861415444 * k -\n 5.497006427196366) +\n y *\n (-2.5217340131683033 * y - 21.248923337353073 * k + 17.5119270841813) +\n k * (-21.86122147463605 * k - 189.48180835922747);\n\n dest[destOffset + 1] =\n 255 +\n c *\n (8.841041422036149 * c +\n 60.118027045597366 * m +\n 6.871425592049007 * y +\n 31.159100130055922 * k +\n -79.2970844816548) +\n m *\n (-15.310361306967817 * m +\n 17.575251261109482 * y +\n 131.35250912493976 * k -\n 190.9453302588951) +\n y * (4.444339102852739 * y + 9.8632861493405 * k - 24.86741582555878) +\n k * (-20.737325471181034 * k - 187.80453709719578);\n\n dest[destOffset + 2] =\n 255 +\n c *\n (0.8842522430003296 * c +\n 8.078677503112928 * m +\n 30.89978309703729 * y -\n 0.23883238689178934 * k +\n -14.183576799673286) +\n m *\n (10.49593273432072 * m +\n 63.02378494754052 * y +\n 50.606957656360734 * k -\n 112.23884253719248) +\n y *\n (0.03296041114873217 * y +\n 115.60384449646641 * k +\n -193.58209356861505) +\n k * (-22.33816807309886 * k - 180.12613974708367);\n }\n\n getRgbItem(src, srcOffset, dest, destOffset) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n dest instanceof Uint8ClampedArray,\n 'DeviceCmykCS.getRgbItem: Unsupported \"dest\" type.'\n );\n }\n this.#toRgb(src, srcOffset, 1, dest, destOffset);\n }\n\n getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n dest instanceof Uint8ClampedArray,\n 'DeviceCmykCS.getRgbBuffer: Unsupported \"dest\" type.'\n );\n }\n const scale = 1 / ((1 << bits) - 1);\n for (let i = 0; i < count; i++) {\n this.#toRgb(src, srcOffset, scale, dest, destOffset);\n srcOffset += 4;\n destOffset += 3 + alpha01;\n }\n }\n\n getOutputLength(inputLength, alpha01) {\n return ((inputLength / 4) * (3 + alpha01)) | 0;\n }\n}\n\n/**\n * CalGrayCS: Based on \"PDF Reference, Sixth Ed\", p.245\n *\n * The default color is `new Float32Array([0])`.\n */\nclass CalGrayCS extends ColorSpace {\n constructor(whitePoint, blackPoint, gamma) {\n super(\"CalGray\", 1);\n\n if (!whitePoint) {\n throw new FormatError(\n \"WhitePoint missing - required for color space CalGray\"\n );\n }\n // Translate arguments to spec variables.\n [this.XW, this.YW, this.ZW] = whitePoint;\n [this.XB, this.YB, this.ZB] = blackPoint || [0, 0, 0];\n this.G = gamma || 1;\n\n // Validate variables as per spec.\n if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) {\n throw new FormatError(\n `Invalid WhitePoint components for ${this.name}, no fallback available`\n );\n }\n\n if (this.XB < 0 || this.YB < 0 || this.ZB < 0) {\n info(`Invalid BlackPoint for ${this.name}, falling back to default.`);\n this.XB = this.YB = this.ZB = 0;\n }\n\n if (this.XB !== 0 || this.YB !== 0 || this.ZB !== 0) {\n warn(\n `${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ` +\n `ZB: ${this.ZB}, only default values are supported.`\n );\n }\n\n if (this.G < 1) {\n info(\n `Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`\n );\n this.G = 1;\n }\n }\n\n #toRgb(src, srcOffset, dest, destOffset, scale) {\n // A represents a gray component of a calibrated gray space.\n // A <---> AG in the spec\n const A = src[srcOffset] * scale;\n const AG = A ** this.G;\n\n // Computes L as per spec. ( = this.YW * AG )\n // Except if other than default BlackPoint values are used.\n const L = this.YW * AG;\n // http://www.poynton.com/notes/colour_and_gamma/ColorFAQ.html, Ch 4.\n // Convert values to rgb range [0, 255].\n const val = Math.max(295.8 * L ** 0.3333333333333333 - 40.8, 0);\n dest[destOffset] = val;\n dest[destOffset + 1] = val;\n dest[destOffset + 2] = val;\n }\n\n getRgbItem(src, srcOffset, dest, destOffset) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n dest instanceof Uint8ClampedArray,\n 'CalGrayCS.getRgbItem: Unsupported \"dest\" type.'\n );\n }\n this.#toRgb(src, srcOffset, dest, destOffset, 1);\n }\n\n getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n dest instanceof Uint8ClampedArray,\n 'CalGrayCS.getRgbBuffer: Unsupported \"dest\" type.'\n );\n }\n const scale = 1 / ((1 << bits) - 1);\n\n for (let i = 0; i < count; ++i) {\n this.#toRgb(src, srcOffset, dest, destOffset, scale);\n srcOffset += 1;\n destOffset += 3 + alpha01;\n }\n }\n\n getOutputLength(inputLength, alpha01) {\n return inputLength * (3 + alpha01);\n }\n}\n\n/**\n * CalRGBCS: Based on \"PDF Reference, Sixth Ed\", p.247\n *\n * The default color is `new Float32Array([0, 0, 0])`.\n */\nclass CalRGBCS extends ColorSpace {\n // See http://www.brucelindbloom.com/index.html?Eqn_ChromAdapt.html for these\n // matrices.\n // prettier-ignore\n static #BRADFORD_SCALE_MATRIX = new Float32Array([\n 0.8951, 0.2664, -0.1614,\n -0.7502, 1.7135, 0.0367,\n 0.0389, -0.0685, 1.0296]);\n\n // prettier-ignore\n static #BRADFORD_SCALE_INVERSE_MATRIX = new Float32Array([\n 0.9869929, -0.1470543, 0.1599627,\n 0.4323053, 0.5183603, 0.0492912,\n -0.0085287, 0.0400428, 0.9684867]);\n\n // See http://www.brucelindbloom.com/index.html?Eqn_RGB_XYZ_Matrix.html.\n // prettier-ignore\n static #SRGB_D65_XYZ_TO_RGB_MATRIX = new Float32Array([\n 3.2404542, -1.5371385, -0.4985314,\n -0.9692660, 1.8760108, 0.0415560,\n 0.0556434, -0.2040259, 1.0572252]);\n\n static #FLAT_WHITEPOINT_MATRIX = new Float32Array([1, 1, 1]);\n\n static #tempNormalizeMatrix = new Float32Array(3);\n\n static #tempConvertMatrix1 = new Float32Array(3);\n\n static #tempConvertMatrix2 = new Float32Array(3);\n\n static #DECODE_L_CONSTANT = ((8 + 16) / 116) ** 3 / 8.0;\n\n constructor(whitePoint, blackPoint, gamma, matrix) {\n super(\"CalRGB\", 3);\n\n if (!whitePoint) {\n throw new FormatError(\n \"WhitePoint missing - required for color space CalRGB\"\n );\n }\n // Translate arguments to spec variables.\n const [XW, YW, ZW] = (this.whitePoint = whitePoint);\n const [XB, YB, ZB] = (this.blackPoint = blackPoint || new Float32Array(3));\n\n [this.GR, this.GG, this.GB] = gamma || new Float32Array([1, 1, 1]);\n [\n this.MXA,\n this.MYA,\n this.MZA,\n this.MXB,\n this.MYB,\n this.MZB,\n this.MXC,\n this.MYC,\n this.MZC,\n ] = matrix || new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]);\n\n // Validate variables as per spec.\n if (XW < 0 || ZW < 0 || YW !== 1) {\n throw new FormatError(\n `Invalid WhitePoint components for ${this.name}, no fallback available`\n );\n }\n\n if (XB < 0 || YB < 0 || ZB < 0) {\n info(\n `Invalid BlackPoint for ${this.name} [${XB}, ${YB}, ${ZB}], ` +\n \"falling back to default.\"\n );\n this.blackPoint = new Float32Array(3);\n }\n\n if (this.GR < 0 || this.GG < 0 || this.GB < 0) {\n info(\n `Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ` +\n `${this.name}, falling back to default.`\n );\n this.GR = this.GG = this.GB = 1;\n }\n }\n\n #matrixProduct(a, b, result) {\n result[0] = a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n result[1] = a[3] * b[0] + a[4] * b[1] + a[5] * b[2];\n result[2] = a[6] * b[0] + a[7] * b[1] + a[8] * b[2];\n }\n\n #toFlat(sourceWhitePoint, LMS, result) {\n result[0] = (LMS[0] * 1) / sourceWhitePoint[0];\n result[1] = (LMS[1] * 1) / sourceWhitePoint[1];\n result[2] = (LMS[2] * 1) / sourceWhitePoint[2];\n }\n\n #toD65(sourceWhitePoint, LMS, result) {\n const D65X = 0.95047;\n const D65Y = 1;\n const D65Z = 1.08883;\n\n result[0] = (LMS[0] * D65X) / sourceWhitePoint[0];\n result[1] = (LMS[1] * D65Y) / sourceWhitePoint[1];\n result[2] = (LMS[2] * D65Z) / sourceWhitePoint[2];\n }\n\n #sRGBTransferFunction(color) {\n // See http://en.wikipedia.org/wiki/SRGB.\n if (color <= 0.0031308) {\n return this.#adjustToRange(0, 1, 12.92 * color);\n }\n // Optimization:\n // If color is close enough to 1, skip calling the following transform\n // since calling Math.pow is expensive. If color is larger than\n // the threshold, the final result is larger than 254.5 since\n // ((1 + 0.055) * 0.99554525 ** (1 / 2.4) - 0.055) * 255 ===\n // 254.50000003134699\n if (color >= 0.99554525) {\n return 1;\n }\n return this.#adjustToRange(0, 1, (1 + 0.055) * color ** (1 / 2.4) - 0.055);\n }\n\n #adjustToRange(min, max, value) {\n return Math.max(min, Math.min(max, value));\n }\n\n #decodeL(L) {\n if (L < 0) {\n return -this.#decodeL(-L);\n }\n if (L > 8.0) {\n return ((L + 16) / 116) ** 3;\n }\n return L * CalRGBCS.#DECODE_L_CONSTANT;\n }\n\n #compensateBlackPoint(sourceBlackPoint, XYZ_Flat, result) {\n // In case the blackPoint is already the default blackPoint then there is\n // no need to do compensation.\n if (\n sourceBlackPoint[0] === 0 &&\n sourceBlackPoint[1] === 0 &&\n sourceBlackPoint[2] === 0\n ) {\n result[0] = XYZ_Flat[0];\n result[1] = XYZ_Flat[1];\n result[2] = XYZ_Flat[2];\n return;\n }\n\n // For the blackPoint calculation details, please see\n // http://www.adobe.com/content/dam/Adobe/en/devnet/photoshop/sdk/\n // AdobeBPC.pdf.\n // The destination blackPoint is the default blackPoint [0, 0, 0].\n const zeroDecodeL = this.#decodeL(0);\n\n const X_DST = zeroDecodeL;\n const X_SRC = this.#decodeL(sourceBlackPoint[0]);\n\n const Y_DST = zeroDecodeL;\n const Y_SRC = this.#decodeL(sourceBlackPoint[1]);\n\n const Z_DST = zeroDecodeL;\n const Z_SRC = this.#decodeL(sourceBlackPoint[2]);\n\n const X_Scale = (1 - X_DST) / (1 - X_SRC);\n const X_Offset = 1 - X_Scale;\n\n const Y_Scale = (1 - Y_DST) / (1 - Y_SRC);\n const Y_Offset = 1 - Y_Scale;\n\n const Z_Scale = (1 - Z_DST) / (1 - Z_SRC);\n const Z_Offset = 1 - Z_Scale;\n\n result[0] = XYZ_Flat[0] * X_Scale + X_Offset;\n result[1] = XYZ_Flat[1] * Y_Scale + Y_Offset;\n result[2] = XYZ_Flat[2] * Z_Scale + Z_Offset;\n }\n\n #normalizeWhitePointToFlat(sourceWhitePoint, XYZ_In, result) {\n // In case the whitePoint is already flat then there is no need to do\n // normalization.\n if (sourceWhitePoint[0] === 1 && sourceWhitePoint[2] === 1) {\n result[0] = XYZ_In[0];\n result[1] = XYZ_In[1];\n result[2] = XYZ_In[2];\n return;\n }\n\n const LMS = result;\n this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_MATRIX, XYZ_In, LMS);\n\n const LMS_Flat = CalRGBCS.#tempNormalizeMatrix;\n this.#toFlat(sourceWhitePoint, LMS, LMS_Flat);\n\n this.#matrixProduct(\n CalRGBCS.#BRADFORD_SCALE_INVERSE_MATRIX,\n LMS_Flat,\n result\n );\n }\n\n #normalizeWhitePointToD65(sourceWhitePoint, XYZ_In, result) {\n const LMS = result;\n this.#matrixProduct(CalRGBCS.#BRADFORD_SCALE_MATRIX, XYZ_In, LMS);\n\n const LMS_D65 = CalRGBCS.#tempNormalizeMatrix;\n this.#toD65(sourceWhitePoint, LMS, LMS_D65);\n\n this.#matrixProduct(\n CalRGBCS.#BRADFORD_SCALE_INVERSE_MATRIX,\n LMS_D65,\n result\n );\n }\n\n #toRgb(src, srcOffset, dest, destOffset, scale) {\n // A, B and C represent a red, green and blue components of a calibrated\n // rgb space.\n const A = this.#adjustToRange(0, 1, src[srcOffset] * scale);\n const B = this.#adjustToRange(0, 1, src[srcOffset + 1] * scale);\n const C = this.#adjustToRange(0, 1, src[srcOffset + 2] * scale);\n\n // A <---> AGR in the spec\n // B <---> BGG in the spec\n // C <---> CGB in the spec\n const AGR = A === 1 ? 1 : A ** this.GR;\n const BGG = B === 1 ? 1 : B ** this.GG;\n const CGB = C === 1 ? 1 : C ** this.GB;\n\n // Computes intermediate variables L, M, N as per spec.\n // To decode X, Y, Z values map L, M, N directly to them.\n const X = this.MXA * AGR + this.MXB * BGG + this.MXC * CGB;\n const Y = this.MYA * AGR + this.MYB * BGG + this.MYC * CGB;\n const Z = this.MZA * AGR + this.MZB * BGG + this.MZC * CGB;\n\n // The following calculations are based on this document:\n // http://www.adobe.com/content/dam/Adobe/en/devnet/photoshop/sdk/\n // AdobeBPC.pdf.\n const XYZ = CalRGBCS.#tempConvertMatrix1;\n XYZ[0] = X;\n XYZ[1] = Y;\n XYZ[2] = Z;\n const XYZ_Flat = CalRGBCS.#tempConvertMatrix2;\n\n this.#normalizeWhitePointToFlat(this.whitePoint, XYZ, XYZ_Flat);\n\n const XYZ_Black = CalRGBCS.#tempConvertMatrix1;\n this.#compensateBlackPoint(this.blackPoint, XYZ_Flat, XYZ_Black);\n\n const XYZ_D65 = CalRGBCS.#tempConvertMatrix2;\n this.#normalizeWhitePointToD65(\n CalRGBCS.#FLAT_WHITEPOINT_MATRIX,\n XYZ_Black,\n XYZ_D65\n );\n\n const SRGB = CalRGBCS.#tempConvertMatrix1;\n this.#matrixProduct(CalRGBCS.#SRGB_D65_XYZ_TO_RGB_MATRIX, XYZ_D65, SRGB);\n\n // Convert the values to rgb range [0, 255].\n dest[destOffset] = this.#sRGBTransferFunction(SRGB[0]) * 255;\n dest[destOffset + 1] = this.#sRGBTransferFunction(SRGB[1]) * 255;\n dest[destOffset + 2] = this.#sRGBTransferFunction(SRGB[2]) * 255;\n }\n\n getRgbItem(src, srcOffset, dest, destOffset) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n dest instanceof Uint8ClampedArray,\n 'CalRGBCS.getRgbItem: Unsupported \"dest\" type.'\n );\n }\n this.#toRgb(src, srcOffset, dest, destOffset, 1);\n }\n\n getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n dest instanceof Uint8ClampedArray,\n 'CalRGBCS.getRgbBuffer: Unsupported \"dest\" type.'\n );\n }\n const scale = 1 / ((1 << bits) - 1);\n\n for (let i = 0; i < count; ++i) {\n this.#toRgb(src, srcOffset, dest, destOffset, scale);\n srcOffset += 3;\n destOffset += 3 + alpha01;\n }\n }\n\n getOutputLength(inputLength, alpha01) {\n return ((inputLength * (3 + alpha01)) / 3) | 0;\n }\n}\n\n/**\n * LabCS: Based on \"PDF Reference, Sixth Ed\", p.250\n *\n * The default color is `new Float32Array([0, 0, 0])`.\n */\nclass LabCS extends ColorSpace {\n constructor(whitePoint, blackPoint, range) {\n super(\"Lab\", 3);\n\n if (!whitePoint) {\n throw new FormatError(\n \"WhitePoint missing - required for color space Lab\"\n );\n }\n // Translate args to spec variables\n [this.XW, this.YW, this.ZW] = whitePoint;\n [this.amin, this.amax, this.bmin, this.bmax] = range || [\n -100, 100, -100, 100,\n ];\n\n // These are here just for completeness - the spec doesn't offer any\n // formulas that use BlackPoint in Lab\n [this.XB, this.YB, this.ZB] = blackPoint || [0, 0, 0];\n\n // Validate vars as per spec\n if (this.XW < 0 || this.ZW < 0 || this.YW !== 1) {\n throw new FormatError(\n \"Invalid WhitePoint components, no fallback available\"\n );\n }\n\n if (this.XB < 0 || this.YB < 0 || this.ZB < 0) {\n info(\"Invalid BlackPoint, falling back to default\");\n this.XB = this.YB = this.ZB = 0;\n }\n\n if (this.amin > this.amax || this.bmin > this.bmax) {\n info(\"Invalid Range, falling back to defaults\");\n this.amin = -100;\n this.amax = 100;\n this.bmin = -100;\n this.bmax = 100;\n }\n }\n\n // Function g(x) from spec\n #fn_g(x) {\n return x >= 6 / 29 ? x ** 3 : (108 / 841) * (x - 4 / 29);\n }\n\n #decode(value, high1, low2, high2) {\n return low2 + (value * (high2 - low2)) / high1;\n }\n\n // If decoding is needed maxVal should be 2^bits per component - 1.\n #toRgb(src, srcOffset, maxVal, dest, destOffset) {\n // XXX: Lab input is in the range of [0, 100], [amin, amax], [bmin, bmax]\n // not the usual [0, 1]. If a command like setFillColor is used the src\n // values will already be within the correct range. However, if we are\n // converting an image we have to map the values to the correct range given\n // above.\n // Ls,as,bs <---> L*,a*,b* in the spec\n let Ls = src[srcOffset];\n let as = src[srcOffset + 1];\n let bs = src[srcOffset + 2];\n if (maxVal !== false) {\n Ls = this.#decode(Ls, maxVal, 0, 100);\n as = this.#decode(as, maxVal, this.amin, this.amax);\n bs = this.#decode(bs, maxVal, this.bmin, this.bmax);\n }\n\n // Adjust limits of 'as' and 'bs'\n if (as > this.amax) {\n as = this.amax;\n } else if (as < this.amin) {\n as = this.amin;\n }\n if (bs > this.bmax) {\n bs = this.bmax;\n } else if (bs < this.bmin) {\n bs = this.bmin;\n }\n\n // Computes intermediate variables X,Y,Z as per spec\n const M = (Ls + 16) / 116;\n const L = M + as / 500;\n const N = M - bs / 200;\n\n const X = this.XW * this.#fn_g(L);\n const Y = this.YW * this.#fn_g(M);\n const Z = this.ZW * this.#fn_g(N);\n\n let r, g, b;\n // Using different conversions for D50 and D65 white points,\n // per http://www.color.org/srgb.pdf\n if (this.ZW < 1) {\n // Assuming D50 (X=0.9642, Y=1.00, Z=0.8249)\n r = X * 3.1339 + Y * -1.617 + Z * -0.4906;\n g = X * -0.9785 + Y * 1.916 + Z * 0.0333;\n b = X * 0.072 + Y * -0.229 + Z * 1.4057;\n } else {\n // Assuming D65 (X=0.9505, Y=1.00, Z=1.0888)\n r = X * 3.2406 + Y * -1.5372 + Z * -0.4986;\n g = X * -0.9689 + Y * 1.8758 + Z * 0.0415;\n b = X * 0.0557 + Y * -0.204 + Z * 1.057;\n }\n // Convert the color values to the [0,255] range (clamping is automatic).\n dest[destOffset] = Math.sqrt(r) * 255;\n dest[destOffset + 1] = Math.sqrt(g) * 255;\n dest[destOffset + 2] = Math.sqrt(b) * 255;\n }\n\n getRgbItem(src, srcOffset, dest, destOffset) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n dest instanceof Uint8ClampedArray,\n 'LabCS.getRgbItem: Unsupported \"dest\" type.'\n );\n }\n this.#toRgb(src, srcOffset, false, dest, destOffset);\n }\n\n getRgbBuffer(src, srcOffset, count, dest, destOffset, bits, alpha01) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n dest instanceof Uint8ClampedArray,\n 'LabCS.getRgbBuffer: Unsupported \"dest\" type.'\n );\n }\n const maxVal = (1 << bits) - 1;\n for (let i = 0; i < count; i++) {\n this.#toRgb(src, srcOffset, maxVal, dest, destOffset);\n srcOffset += 3;\n destOffset += 3 + alpha01;\n }\n }\n\n getOutputLength(inputLength, alpha01) {\n return ((inputLength * (3 + alpha01)) / 3) | 0;\n }\n\n isDefaultDecode(decodeMap, bpc) {\n // XXX: Decoding is handled with the lab conversion because of the strange\n // ranges that are used.\n return true;\n }\n\n get usesZeroToOneRange() {\n return shadow(this, \"usesZeroToOneRange\", false);\n }\n}\n\nexport { ColorSpace };\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 { FormatError } from \"../shared/util.js\";\n\nfunction hexToInt(a, size) {\n let n = 0;\n for (let i = 0; i <= size; i++) {\n n = (n << 8) | a[i];\n }\n return n >>> 0;\n}\n\nfunction hexToStr(a, size) {\n // This code is hot. Special-case some common values to avoid creating an\n // object with subarray().\n if (size === 1) {\n return String.fromCharCode(a[0], a[1]);\n }\n if (size === 3) {\n return String.fromCharCode(a[0], a[1], a[2], a[3]);\n }\n return String.fromCharCode(...a.subarray(0, size + 1));\n}\n\nfunction addHex(a, b, size) {\n let c = 0;\n for (let i = size; i >= 0; i--) {\n c += a[i] + b[i];\n a[i] = c & 255;\n c >>= 8;\n }\n}\n\nfunction incHex(a, size) {\n let c = 1;\n for (let i = size; i >= 0 && c > 0; i--) {\n c += a[i];\n a[i] = c & 255;\n c >>= 8;\n }\n}\n\nconst MAX_NUM_SIZE = 16;\nconst MAX_ENCODED_NUM_SIZE = 19; // ceil(MAX_NUM_SIZE * 7 / 8)\n\nclass BinaryCMapStream {\n constructor(data) {\n this.buffer = data;\n this.pos = 0;\n this.end = data.length;\n this.tmpBuf = new Uint8Array(MAX_ENCODED_NUM_SIZE);\n }\n\n readByte() {\n if (this.pos >= this.end) {\n return -1;\n }\n return this.buffer[this.pos++];\n }\n\n readNumber() {\n let n = 0;\n let last;\n do {\n const b = this.readByte();\n if (b < 0) {\n throw new FormatError(\"unexpected EOF in bcmap\");\n }\n last = !(b & 0x80);\n n = (n << 7) | (b & 0x7f);\n } while (!last);\n return n;\n }\n\n readSigned() {\n const n = this.readNumber();\n return n & 1 ? ~(n >>> 1) : n >>> 1;\n }\n\n readHex(num, size) {\n num.set(this.buffer.subarray(this.pos, this.pos + size + 1));\n this.pos += size + 1;\n }\n\n readHexNumber(num, size) {\n let last;\n const stack = this.tmpBuf;\n let sp = 0;\n do {\n const b = this.readByte();\n if (b < 0) {\n throw new FormatError(\"unexpected EOF in bcmap\");\n }\n last = !(b & 0x80);\n stack[sp++] = b & 0x7f;\n } while (!last);\n let i = size,\n buffer = 0,\n bufferSize = 0;\n while (i >= 0) {\n while (bufferSize < 8 && stack.length > 0) {\n buffer |= stack[--sp] << bufferSize;\n bufferSize += 7;\n }\n num[i] = buffer & 255;\n i--;\n buffer >>= 8;\n bufferSize -= 8;\n }\n }\n\n readHexSigned(num, size) {\n this.readHexNumber(num, size);\n const sign = num[size] & 1 ? 255 : 0;\n let c = 0;\n for (let i = 0; i <= size; i++) {\n c = ((c & 1) << 8) | num[i];\n num[i] = (c >> 1) ^ sign;\n }\n }\n\n readString() {\n const len = this.readNumber(),\n buf = new Array(len);\n for (let i = 0; i < len; i++) {\n buf[i] = this.readNumber();\n }\n return String.fromCharCode(...buf);\n }\n}\n\nclass BinaryCMapReader {\n async process(data, cMap, extend) {\n const stream = new BinaryCMapStream(data);\n const header = stream.readByte();\n cMap.vertical = !!(header & 1);\n\n let useCMap = null;\n const start = new Uint8Array(MAX_NUM_SIZE);\n const end = new Uint8Array(MAX_NUM_SIZE);\n const char = new Uint8Array(MAX_NUM_SIZE);\n const charCode = new Uint8Array(MAX_NUM_SIZE);\n const tmp = new Uint8Array(MAX_NUM_SIZE);\n let code;\n\n let b;\n while ((b = stream.readByte()) >= 0) {\n const type = b >> 5;\n if (type === 7) {\n // metadata, e.g. comment or usecmap\n switch (b & 0x1f) {\n case 0:\n stream.readString(); // skipping comment\n break;\n case 1:\n useCMap = stream.readString();\n break;\n }\n continue;\n }\n const sequence = !!(b & 0x10);\n const dataSize = b & 15;\n\n if (dataSize + 1 > MAX_NUM_SIZE) {\n throw new Error(\"BinaryCMapReader.process: Invalid dataSize.\");\n }\n\n const ucs2DataSize = 1;\n const subitemsCount = stream.readNumber();\n switch (type) {\n case 0: // codespacerange\n stream.readHex(start, dataSize);\n stream.readHexNumber(end, dataSize);\n addHex(end, start, dataSize);\n cMap.addCodespaceRange(\n dataSize + 1,\n hexToInt(start, dataSize),\n hexToInt(end, dataSize)\n );\n for (let i = 1; i < subitemsCount; i++) {\n incHex(end, dataSize);\n stream.readHexNumber(start, dataSize);\n addHex(start, end, dataSize);\n stream.readHexNumber(end, dataSize);\n addHex(end, start, dataSize);\n cMap.addCodespaceRange(\n dataSize + 1,\n hexToInt(start, dataSize),\n hexToInt(end, dataSize)\n );\n }\n break;\n case 1: // notdefrange\n stream.readHex(start, dataSize);\n stream.readHexNumber(end, dataSize);\n addHex(end, start, dataSize);\n stream.readNumber(); // code\n // undefined range, skipping\n for (let i = 1; i < subitemsCount; i++) {\n incHex(end, dataSize);\n stream.readHexNumber(start, dataSize);\n addHex(start, end, dataSize);\n stream.readHexNumber(end, dataSize);\n addHex(end, start, dataSize);\n stream.readNumber(); // code\n // nop\n }\n break;\n case 2: // cidchar\n stream.readHex(char, dataSize);\n code = stream.readNumber();\n cMap.mapOne(hexToInt(char, dataSize), code);\n for (let i = 1; i < subitemsCount; i++) {\n incHex(char, dataSize);\n if (!sequence) {\n stream.readHexNumber(tmp, dataSize);\n addHex(char, tmp, dataSize);\n }\n code = stream.readSigned() + (code + 1);\n cMap.mapOne(hexToInt(char, dataSize), code);\n }\n break;\n case 3: // cidrange\n stream.readHex(start, dataSize);\n stream.readHexNumber(end, dataSize);\n addHex(end, start, dataSize);\n code = stream.readNumber();\n cMap.mapCidRange(\n hexToInt(start, dataSize),\n hexToInt(end, dataSize),\n code\n );\n for (let i = 1; i < subitemsCount; i++) {\n incHex(end, dataSize);\n if (!sequence) {\n stream.readHexNumber(start, dataSize);\n addHex(start, end, dataSize);\n } else {\n start.set(end);\n }\n stream.readHexNumber(end, dataSize);\n addHex(end, start, dataSize);\n code = stream.readNumber();\n cMap.mapCidRange(\n hexToInt(start, dataSize),\n hexToInt(end, dataSize),\n code\n );\n }\n break;\n case 4: // bfchar\n stream.readHex(char, ucs2DataSize);\n stream.readHex(charCode, dataSize);\n cMap.mapOne(\n hexToInt(char, ucs2DataSize),\n hexToStr(charCode, dataSize)\n );\n for (let i = 1; i < subitemsCount; i++) {\n incHex(char, ucs2DataSize);\n if (!sequence) {\n stream.readHexNumber(tmp, ucs2DataSize);\n addHex(char, tmp, ucs2DataSize);\n }\n incHex(charCode, dataSize);\n stream.readHexSigned(tmp, dataSize);\n addHex(charCode, tmp, dataSize);\n cMap.mapOne(\n hexToInt(char, ucs2DataSize),\n hexToStr(charCode, dataSize)\n );\n }\n break;\n case 5: // bfrange\n stream.readHex(start, ucs2DataSize);\n stream.readHexNumber(end, ucs2DataSize);\n addHex(end, start, ucs2DataSize);\n stream.readHex(charCode, dataSize);\n cMap.mapBfRange(\n hexToInt(start, ucs2DataSize),\n hexToInt(end, ucs2DataSize),\n hexToStr(charCode, dataSize)\n );\n for (let i = 1; i < subitemsCount; i++) {\n incHex(end, ucs2DataSize);\n if (!sequence) {\n stream.readHexNumber(start, ucs2DataSize);\n addHex(start, end, ucs2DataSize);\n } else {\n start.set(end);\n }\n stream.readHexNumber(end, ucs2DataSize);\n addHex(end, start, ucs2DataSize);\n stream.readHex(charCode, dataSize);\n cMap.mapBfRange(\n hexToInt(start, ucs2DataSize),\n hexToInt(end, ucs2DataSize),\n hexToStr(charCode, dataSize)\n );\n }\n break;\n default:\n throw new Error(`BinaryCMapReader.process - unknown type: ${type}`);\n }\n }\n\n if (useCMap) {\n return extend(useCMap);\n }\n return cMap;\n }\n}\n\nexport { BinaryCMapReader };\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 { BaseStream } from \"./base_stream.js\";\nimport { Stream } from \"./stream.js\";\n\n// Lots of DecodeStreams are created whose buffers are never used. For these\n// we share a single empty buffer. This is (a) space-efficient and (b) avoids\n// having special cases that would be required if we used |null| for an empty\n// buffer.\nconst emptyBuffer = new Uint8Array(0);\n\n// Super class for the decoding streams.\nclass DecodeStream extends BaseStream {\n constructor(maybeMinBufferLength) {\n super();\n this._rawMinBufferLength = maybeMinBufferLength || 0;\n\n this.pos = 0;\n this.bufferLength = 0;\n this.eof = false;\n this.buffer = emptyBuffer;\n this.minBufferLength = 512;\n if (maybeMinBufferLength) {\n // Compute the first power of two that is as big as maybeMinBufferLength.\n while (this.minBufferLength < maybeMinBufferLength) {\n this.minBufferLength *= 2;\n }\n }\n }\n\n get isEmpty() {\n while (!this.eof && this.bufferLength === 0) {\n this.readBlock();\n }\n return this.bufferLength === 0;\n }\n\n ensureBuffer(requested) {\n const buffer = this.buffer;\n if (requested <= buffer.byteLength) {\n return buffer;\n }\n let size = this.minBufferLength;\n while (size < requested) {\n size *= 2;\n }\n const buffer2 = new Uint8Array(size);\n buffer2.set(buffer);\n return (this.buffer = buffer2);\n }\n\n getByte() {\n const pos = this.pos;\n while (this.bufferLength <= pos) {\n if (this.eof) {\n return -1;\n }\n this.readBlock();\n }\n return this.buffer[this.pos++];\n }\n\n getBytes(length) {\n const pos = this.pos;\n let end;\n\n if (length) {\n this.ensureBuffer(pos + length);\n end = pos + length;\n\n while (!this.eof && this.bufferLength < end) {\n this.readBlock();\n }\n const bufEnd = this.bufferLength;\n if (end > bufEnd) {\n end = bufEnd;\n }\n } else {\n while (!this.eof) {\n this.readBlock();\n }\n end = this.bufferLength;\n }\n\n this.pos = end;\n return this.buffer.subarray(pos, end);\n }\n\n reset() {\n this.pos = 0;\n }\n\n makeSubStream(start, length, dict = null) {\n if (length === undefined) {\n while (!this.eof) {\n this.readBlock();\n }\n } else {\n const end = start + length;\n while (this.bufferLength <= end && !this.eof) {\n this.readBlock();\n }\n }\n return new Stream(this.buffer, start, length, dict);\n }\n\n getBaseStreams() {\n return this.str ? this.str.getBaseStreams() : null;\n }\n}\n\nclass StreamsSequenceStream extends DecodeStream {\n constructor(streams, onError = null) {\n let maybeLength = 0;\n for (const stream of streams) {\n maybeLength +=\n stream instanceof DecodeStream\n ? stream._rawMinBufferLength\n : stream.length;\n }\n super(maybeLength);\n\n this.streams = streams;\n this._onError = onError;\n }\n\n readBlock() {\n const streams = this.streams;\n if (streams.length === 0) {\n this.eof = true;\n return;\n }\n const stream = streams.shift();\n let chunk;\n try {\n chunk = stream.getBytes();\n } catch (reason) {\n if (this._onError) {\n this._onError(reason, stream.dict?.objId);\n return;\n }\n throw reason;\n }\n const bufferLength = this.bufferLength;\n const newLength = bufferLength + chunk.length;\n const buffer = this.ensureBuffer(newLength);\n buffer.set(chunk, bufferLength);\n this.bufferLength = newLength;\n }\n\n getBaseStreams() {\n const baseStreamsBuf = [];\n for (const stream of this.streams) {\n const baseStreams = stream.getBaseStreams();\n if (baseStreams) {\n baseStreamsBuf.push(...baseStreams);\n }\n }\n return baseStreamsBuf.length > 0 ? baseStreamsBuf : null;\n }\n}\n\nexport { DecodeStream, StreamsSequenceStream };\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 { DecodeStream } from \"./decode_stream.js\";\nimport { isWhiteSpace } from \"./core_utils.js\";\n\nclass Ascii85Stream extends DecodeStream {\n constructor(str, maybeLength) {\n // Most streams increase in size when decoded, but Ascii85 streams\n // typically shrink by ~20%.\n if (maybeLength) {\n maybeLength *= 0.8;\n }\n super(maybeLength);\n\n this.str = str;\n this.dict = str.dict;\n this.input = new Uint8Array(5);\n }\n\n readBlock() {\n const TILDA_CHAR = 0x7e; // '~'\n const Z_LOWER_CHAR = 0x7a; // 'z'\n const EOF = -1;\n\n const str = this.str;\n\n let c = str.getByte();\n while (isWhiteSpace(c)) {\n c = str.getByte();\n }\n\n if (c === EOF || c === TILDA_CHAR) {\n this.eof = true;\n return;\n }\n\n const bufferLength = this.bufferLength;\n let buffer, i;\n\n // special code for z\n if (c === Z_LOWER_CHAR) {\n buffer = this.ensureBuffer(bufferLength + 4);\n for (i = 0; i < 4; ++i) {\n buffer[bufferLength + i] = 0;\n }\n this.bufferLength += 4;\n } else {\n const input = this.input;\n input[0] = c;\n for (i = 1; i < 5; ++i) {\n c = str.getByte();\n while (isWhiteSpace(c)) {\n c = str.getByte();\n }\n\n input[i] = c;\n\n if (c === EOF || c === TILDA_CHAR) {\n break;\n }\n }\n buffer = this.ensureBuffer(bufferLength + i - 1);\n this.bufferLength += i - 1;\n\n // partial ending;\n if (i < 5) {\n for (; i < 5; ++i) {\n input[i] = 0x21 + 84;\n }\n this.eof = true;\n }\n let t = 0;\n for (i = 0; i < 5; ++i) {\n t = t * 85 + (input[i] - 0x21);\n }\n\n for (i = 3; i >= 0; --i) {\n buffer[bufferLength + i] = t & 0xff;\n t >>= 8;\n }\n }\n }\n}\n\nexport { Ascii85Stream };\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 { DecodeStream } from \"./decode_stream.js\";\n\nclass AsciiHexStream extends DecodeStream {\n constructor(str, maybeLength) {\n // Most streams increase in size when decoded, but AsciiHex streams shrink\n // by 50%.\n if (maybeLength) {\n maybeLength *= 0.5;\n }\n super(maybeLength);\n\n this.str = str;\n this.dict = str.dict;\n\n this.firstDigit = -1;\n }\n\n readBlock() {\n const UPSTREAM_BLOCK_SIZE = 8000;\n const bytes = this.str.getBytes(UPSTREAM_BLOCK_SIZE);\n if (!bytes.length) {\n this.eof = true;\n return;\n }\n\n const maxDecodeLength = (bytes.length + 1) >> 1;\n const buffer = this.ensureBuffer(this.bufferLength + maxDecodeLength);\n let bufferLength = this.bufferLength;\n\n let firstDigit = this.firstDigit;\n for (const ch of bytes) {\n let digit;\n if (ch >= /* '0' = */ 0x30 && ch <= /* '9' = */ 0x39) {\n digit = ch & 0x0f;\n } else if (\n (ch >= /* 'A' = */ 0x41 && ch <= /* 'Z' = */ 0x46) ||\n (ch >= /* 'a' = */ 0x61 && ch <= /* 'z' = */ 0x66)\n ) {\n digit = (ch & 0x0f) + 9;\n } else if (ch === /* '>' = */ 0x3e) {\n this.eof = true;\n break;\n } else {\n // Probably whitespace, ignoring.\n continue;\n }\n if (firstDigit < 0) {\n firstDigit = digit;\n } else {\n buffer[bufferLength++] = (firstDigit << 4) | digit;\n firstDigit = -1;\n }\n }\n if (firstDigit >= 0 && this.eof) {\n // incomplete byte\n buffer[bufferLength++] = firstDigit << 4;\n firstDigit = -1;\n }\n this.firstDigit = firstDigit;\n this.bufferLength = bufferLength;\n }\n}\n\nexport { AsciiHexStream };\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/* Copyright 1996-2003 Glyph & Cog, LLC\n *\n * The CCITT stream implementation contained in this file is a JavaScript port\n * of XPDF's implementation, made available under the Apache 2.0 open source\n * license.\n */\n\nimport { FormatError, info } from \"../shared/util.js\";\n\n/**\n * @typedef {Object} CCITTFaxDecoderSource\n * @property {function} next - Method that return one byte of data for decoding,\n * or -1 when EOF is reached.\n */\n\nconst ccittEOL = -2;\nconst ccittEOF = -1;\nconst twoDimPass = 0;\nconst twoDimHoriz = 1;\nconst twoDimVert0 = 2;\nconst twoDimVertR1 = 3;\nconst twoDimVertL1 = 4;\nconst twoDimVertR2 = 5;\nconst twoDimVertL2 = 6;\nconst twoDimVertR3 = 7;\nconst twoDimVertL3 = 8;\n\n// prettier-ignore\nconst twoDimTable = [\n [-1, -1], [-1, -1], // 000000x\n [7, twoDimVertL3], // 0000010\n [7, twoDimVertR3], // 0000011\n [6, twoDimVertL2], [6, twoDimVertL2], // 000010x\n [6, twoDimVertR2], [6, twoDimVertR2], // 000011x\n [4, twoDimPass], [4, twoDimPass], // 0001xxx\n [4, twoDimPass], [4, twoDimPass],\n [4, twoDimPass], [4, twoDimPass],\n [4, twoDimPass], [4, twoDimPass],\n [3, twoDimHoriz], [3, twoDimHoriz], // 001xxxx\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimHoriz], [3, twoDimHoriz],\n [3, twoDimVertL1], [3, twoDimVertL1], // 010xxxx\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertL1], [3, twoDimVertL1],\n [3, twoDimVertR1], [3, twoDimVertR1], // 011xxxx\n [3, twoDimVertR1], [3, twoDimVertR1],\n [3, twoDimVertR1], [3, twoDimVertR1],\n [3, twoDimVertR1], [3, twoDimVertR1],\n [3, twoDimVertR1], [3, twoDimVertR1],\n [3, twoDimVertR1], [3, twoDimVertR1],\n [3, twoDimVertR1], [3, twoDimVertR1],\n [3, twoDimVertR1], [3, twoDimVertR1],\n [1, twoDimVert0], [1, twoDimVert0], // 1xxxxxx\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0],\n [1, twoDimVert0], [1, twoDimVert0]\n];\n\n// prettier-ignore\nconst whiteTable1 = [\n [-1, -1], // 00000\n [12, ccittEOL], // 00001\n [-1, -1], [-1, -1], // 0001x\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 001xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 010xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 011xx\n [11, 1792], [11, 1792], // 1000x\n [12, 1984], // 10010\n [12, 2048], // 10011\n [12, 2112], // 10100\n [12, 2176], // 10101\n [12, 2240], // 10110\n [12, 2304], // 10111\n [11, 1856], [11, 1856], // 1100x\n [11, 1920], [11, 1920], // 1101x\n [12, 2368], // 11100\n [12, 2432], // 11101\n [12, 2496], // 11110\n [12, 2560] // 11111\n];\n\n// prettier-ignore\nconst whiteTable2 = [\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 0000000xx\n [8, 29], [8, 29], // 00000010x\n [8, 30], [8, 30], // 00000011x\n [8, 45], [8, 45], // 00000100x\n [8, 46], [8, 46], // 00000101x\n [7, 22], [7, 22], [7, 22], [7, 22], // 0000011xx\n [7, 23], [7, 23], [7, 23], [7, 23], // 0000100xx\n [8, 47], [8, 47], // 00001010x\n [8, 48], [8, 48], // 00001011x\n [6, 13], [6, 13], [6, 13], [6, 13], // 000011xxx\n [6, 13], [6, 13], [6, 13], [6, 13],\n [7, 20], [7, 20], [7, 20], [7, 20], // 0001000xx\n [8, 33], [8, 33], // 00010010x\n [8, 34], [8, 34], // 00010011x\n [8, 35], [8, 35], // 00010100x\n [8, 36], [8, 36], // 00010101x\n [8, 37], [8, 37], // 00010110x\n [8, 38], [8, 38], // 00010111x\n [7, 19], [7, 19], [7, 19], [7, 19], // 0001100xx\n [8, 31], [8, 31], // 00011010x\n [8, 32], [8, 32], // 00011011x\n [6, 1], [6, 1], [6, 1], [6, 1], // 000111xxx\n [6, 1], [6, 1], [6, 1], [6, 1],\n [6, 12], [6, 12], [6, 12], [6, 12], // 001000xxx\n [6, 12], [6, 12], [6, 12], [6, 12],\n [8, 53], [8, 53], // 00100100x\n [8, 54], [8, 54], // 00100101x\n [7, 26], [7, 26], [7, 26], [7, 26], // 0010011xx\n [8, 39], [8, 39], // 00101000x\n [8, 40], [8, 40], // 00101001x\n [8, 41], [8, 41], // 00101010x\n [8, 42], [8, 42], // 00101011x\n [8, 43], [8, 43], // 00101100x\n [8, 44], [8, 44], // 00101101x\n [7, 21], [7, 21], [7, 21], [7, 21], // 0010111xx\n [7, 28], [7, 28], [7, 28], [7, 28], // 0011000xx\n [8, 61], [8, 61], // 00110010x\n [8, 62], [8, 62], // 00110011x\n [8, 63], [8, 63], // 00110100x\n [8, 0], [8, 0], // 00110101x\n [8, 320], [8, 320], // 00110110x\n [8, 384], [8, 384], // 00110111x\n [5, 10], [5, 10], [5, 10], [5, 10], // 00111xxxx\n [5, 10], [5, 10], [5, 10], [5, 10],\n [5, 10], [5, 10], [5, 10], [5, 10],\n [5, 10], [5, 10], [5, 10], [5, 10],\n [5, 11], [5, 11], [5, 11], [5, 11], // 01000xxxx\n [5, 11], [5, 11], [5, 11], [5, 11],\n [5, 11], [5, 11], [5, 11], [5, 11],\n [5, 11], [5, 11], [5, 11], [5, 11],\n [7, 27], [7, 27], [7, 27], [7, 27], // 0100100xx\n [8, 59], [8, 59], // 01001010x\n [8, 60], [8, 60], // 01001011x\n [9, 1472], // 010011000\n [9, 1536], // 010011001\n [9, 1600], // 010011010\n [9, 1728], // 010011011\n [7, 18], [7, 18], [7, 18], [7, 18], // 0100111xx\n [7, 24], [7, 24], [7, 24], [7, 24], // 0101000xx\n [8, 49], [8, 49], // 01010010x\n [8, 50], [8, 50], // 01010011x\n [8, 51], [8, 51], // 01010100x\n [8, 52], [8, 52], // 01010101x\n [7, 25], [7, 25], [7, 25], [7, 25], // 0101011xx\n [8, 55], [8, 55], // 01011000x\n [8, 56], [8, 56], // 01011001x\n [8, 57], [8, 57], // 01011010x\n [8, 58], [8, 58], // 01011011x\n [6, 192], [6, 192], [6, 192], [6, 192], // 010111xxx\n [6, 192], [6, 192], [6, 192], [6, 192],\n [6, 1664], [6, 1664], [6, 1664], [6, 1664], // 011000xxx\n [6, 1664], [6, 1664], [6, 1664], [6, 1664],\n [8, 448], [8, 448], // 01100100x\n [8, 512], [8, 512], // 01100101x\n [9, 704], // 011001100\n [9, 768], // 011001101\n [8, 640], [8, 640], // 01100111x\n [8, 576], [8, 576], // 01101000x\n [9, 832], // 011010010\n [9, 896], // 011010011\n [9, 960], // 011010100\n [9, 1024], // 011010101\n [9, 1088], // 011010110\n [9, 1152], // 011010111\n [9, 1216], // 011011000\n [9, 1280], // 011011001\n [9, 1344], // 011011010\n [9, 1408], // 011011011\n [7, 256], [7, 256], [7, 256], [7, 256], // 0110111xx\n [4, 2], [4, 2], [4, 2], [4, 2], // 0111xxxxx\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 2], [4, 2], [4, 2], [4, 2],\n [4, 3], [4, 3], [4, 3], [4, 3], // 1000xxxxx\n [4, 3], [4, 3], [4, 3], [4, 3],\n [4, 3], [4, 3], [4, 3], [4, 3],\n [4, 3], [4, 3], [4, 3], [4, 3],\n [4, 3], [4, 3], [4, 3], [4, 3],\n [4, 3], [4, 3], [4, 3], [4, 3],\n [4, 3], [4, 3], [4, 3], [4, 3],\n [4, 3], [4, 3], [4, 3], [4, 3],\n [5, 128], [5, 128], [5, 128], [5, 128], // 10010xxxx\n [5, 128], [5, 128], [5, 128], [5, 128],\n [5, 128], [5, 128], [5, 128], [5, 128],\n [5, 128], [5, 128], [5, 128], [5, 128],\n [5, 8], [5, 8], [5, 8], [5, 8], // 10011xxxx\n [5, 8], [5, 8], [5, 8], [5, 8],\n [5, 8], [5, 8], [5, 8], [5, 8],\n [5, 8], [5, 8], [5, 8], [5, 8],\n [5, 9], [5, 9], [5, 9], [5, 9], // 10100xxxx\n [5, 9], [5, 9], [5, 9], [5, 9],\n [5, 9], [5, 9], [5, 9], [5, 9],\n [5, 9], [5, 9], [5, 9], [5, 9],\n [6, 16], [6, 16], [6, 16], [6, 16], // 101010xxx\n [6, 16], [6, 16], [6, 16], [6, 16],\n [6, 17], [6, 17], [6, 17], [6, 17], // 101011xxx\n [6, 17], [6, 17], [6, 17], [6, 17],\n [4, 4], [4, 4], [4, 4], [4, 4], // 1011xxxxx\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 4], [4, 4], [4, 4], [4, 4],\n [4, 5], [4, 5], [4, 5], [4, 5], // 1100xxxxx\n [4, 5], [4, 5], [4, 5], [4, 5],\n [4, 5], [4, 5], [4, 5], [4, 5],\n [4, 5], [4, 5], [4, 5], [4, 5],\n [4, 5], [4, 5], [4, 5], [4, 5],\n [4, 5], [4, 5], [4, 5], [4, 5],\n [4, 5], [4, 5], [4, 5], [4, 5],\n [4, 5], [4, 5], [4, 5], [4, 5],\n [6, 14], [6, 14], [6, 14], [6, 14], // 110100xxx\n [6, 14], [6, 14], [6, 14], [6, 14],\n [6, 15], [6, 15], [6, 15], [6, 15], // 110101xxx\n [6, 15], [6, 15], [6, 15], [6, 15],\n [5, 64], [5, 64], [5, 64], [5, 64], // 11011xxxx\n [5, 64], [5, 64], [5, 64], [5, 64],\n [5, 64], [5, 64], [5, 64], [5, 64],\n [5, 64], [5, 64], [5, 64], [5, 64],\n [4, 6], [4, 6], [4, 6], [4, 6], // 1110xxxxx\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 6], [4, 6], [4, 6], [4, 6],\n [4, 7], [4, 7], [4, 7], [4, 7], // 1111xxxxx\n [4, 7], [4, 7], [4, 7], [4, 7],\n [4, 7], [4, 7], [4, 7], [4, 7],\n [4, 7], [4, 7], [4, 7], [4, 7],\n [4, 7], [4, 7], [4, 7], [4, 7],\n [4, 7], [4, 7], [4, 7], [4, 7],\n [4, 7], [4, 7], [4, 7], [4, 7],\n [4, 7], [4, 7], [4, 7], [4, 7]\n];\n\n// prettier-ignore\nconst blackTable1 = [\n [-1, -1], [-1, -1], // 000000000000x\n [12, ccittEOL], [12, ccittEOL], // 000000000001x\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000001xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000010xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000011xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000100xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000101xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000110xx\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 00000000111xx\n [11, 1792], [11, 1792], [11, 1792], [11, 1792], // 00000001000xx\n [12, 1984], [12, 1984], // 000000010010x\n [12, 2048], [12, 2048], // 000000010011x\n [12, 2112], [12, 2112], // 000000010100x\n [12, 2176], [12, 2176], // 000000010101x\n [12, 2240], [12, 2240], // 000000010110x\n [12, 2304], [12, 2304], // 000000010111x\n [11, 1856], [11, 1856], [11, 1856], [11, 1856], // 00000001100xx\n [11, 1920], [11, 1920], [11, 1920], [11, 1920], // 00000001101xx\n [12, 2368], [12, 2368], // 000000011100x\n [12, 2432], [12, 2432], // 000000011101x\n [12, 2496], [12, 2496], // 000000011110x\n [12, 2560], [12, 2560], // 000000011111x\n [10, 18], [10, 18], [10, 18], [10, 18], // 0000001000xxx\n [10, 18], [10, 18], [10, 18], [10, 18],\n [12, 52], [12, 52], // 000000100100x\n [13, 640], // 0000001001010\n [13, 704], // 0000001001011\n [13, 768], // 0000001001100\n [13, 832], // 0000001001101\n [12, 55], [12, 55], // 000000100111x\n [12, 56], [12, 56], // 000000101000x\n [13, 1280], // 0000001010010\n [13, 1344], // 0000001010011\n [13, 1408], // 0000001010100\n [13, 1472], // 0000001010101\n [12, 59], [12, 59], // 000000101011x\n [12, 60], [12, 60], // 000000101100x\n [13, 1536], // 0000001011010\n [13, 1600], // 0000001011011\n [11, 24], [11, 24], [11, 24], [11, 24], // 00000010111xx\n [11, 25], [11, 25], [11, 25], [11, 25], // 00000011000xx\n [13, 1664], // 0000001100100\n [13, 1728], // 0000001100101\n [12, 320], [12, 320], // 000000110011x\n [12, 384], [12, 384], // 000000110100x\n [12, 448], [12, 448], // 000000110101x\n [13, 512], // 0000001101100\n [13, 576], // 0000001101101\n [12, 53], [12, 53], // 000000110111x\n [12, 54], [12, 54], // 000000111000x\n [13, 896], // 0000001110010\n [13, 960], // 0000001110011\n [13, 1024], // 0000001110100\n [13, 1088], // 0000001110101\n [13, 1152], // 0000001110110\n [13, 1216], // 0000001110111\n [10, 64], [10, 64], [10, 64], [10, 64], // 0000001111xxx\n [10, 64], [10, 64], [10, 64], [10, 64]\n];\n\n// prettier-ignore\nconst blackTable2 = [\n [8, 13], [8, 13], [8, 13], [8, 13], // 00000100xxxx\n [8, 13], [8, 13], [8, 13], [8, 13],\n [8, 13], [8, 13], [8, 13], [8, 13],\n [8, 13], [8, 13], [8, 13], [8, 13],\n [11, 23], [11, 23], // 00000101000x\n [12, 50], // 000001010010\n [12, 51], // 000001010011\n [12, 44], // 000001010100\n [12, 45], // 000001010101\n [12, 46], // 000001010110\n [12, 47], // 000001010111\n [12, 57], // 000001011000\n [12, 58], // 000001011001\n [12, 61], // 000001011010\n [12, 256], // 000001011011\n [10, 16], [10, 16], [10, 16], [10, 16], // 0000010111xx\n [10, 17], [10, 17], [10, 17], [10, 17], // 0000011000xx\n [12, 48], // 000001100100\n [12, 49], // 000001100101\n [12, 62], // 000001100110\n [12, 63], // 000001100111\n [12, 30], // 000001101000\n [12, 31], // 000001101001\n [12, 32], // 000001101010\n [12, 33], // 000001101011\n [12, 40], // 000001101100\n [12, 41], // 000001101101\n [11, 22], [11, 22], // 00000110111x\n [8, 14], [8, 14], [8, 14], [8, 14], // 00000111xxxx\n [8, 14], [8, 14], [8, 14], [8, 14],\n [8, 14], [8, 14], [8, 14], [8, 14],\n [8, 14], [8, 14], [8, 14], [8, 14],\n [7, 10], [7, 10], [7, 10], [7, 10], // 0000100xxxxx\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 10], [7, 10], [7, 10], [7, 10],\n [7, 11], [7, 11], [7, 11], [7, 11], // 0000101xxxxx\n [7, 11], [7, 11], [7, 11], [7, 11],\n [7, 11], [7, 11], [7, 11], [7, 11],\n [7, 11], [7, 11], [7, 11], [7, 11],\n [7, 11], [7, 11], [7, 11], [7, 11],\n [7, 11], [7, 11], [7, 11], [7, 11],\n [7, 11], [7, 11], [7, 11], [7, 11],\n [7, 11], [7, 11], [7, 11], [7, 11],\n [9, 15], [9, 15], [9, 15], [9, 15], // 000011000xxx\n [9, 15], [9, 15], [9, 15], [9, 15],\n [12, 128], // 000011001000\n [12, 192], // 000011001001\n [12, 26], // 000011001010\n [12, 27], // 000011001011\n [12, 28], // 000011001100\n [12, 29], // 000011001101\n [11, 19], [11, 19], // 00001100111x\n [11, 20], [11, 20], // 00001101000x\n [12, 34], // 000011010010\n [12, 35], // 000011010011\n [12, 36], // 000011010100\n [12, 37], // 000011010101\n [12, 38], // 000011010110\n [12, 39], // 000011010111\n [11, 21], [11, 21], // 00001101100x\n [12, 42], // 000011011010\n [12, 43], // 000011011011\n [10, 0], [10, 0], [10, 0], [10, 0], // 0000110111xx\n [7, 12], [7, 12], [7, 12], [7, 12], // 0000111xxxxx\n [7, 12], [7, 12], [7, 12], [7, 12],\n [7, 12], [7, 12], [7, 12], [7, 12],\n [7, 12], [7, 12], [7, 12], [7, 12],\n [7, 12], [7, 12], [7, 12], [7, 12],\n [7, 12], [7, 12], [7, 12], [7, 12],\n [7, 12], [7, 12], [7, 12], [7, 12],\n [7, 12], [7, 12], [7, 12], [7, 12]\n];\n\n// prettier-ignore\nconst blackTable3 = [\n [-1, -1], [-1, -1], [-1, -1], [-1, -1], // 0000xx\n [6, 9], // 000100\n [6, 8], // 000101\n [5, 7], [5, 7], // 00011x\n [4, 6], [4, 6], [4, 6], [4, 6], // 0010xx\n [4, 5], [4, 5], [4, 5], [4, 5], // 0011xx\n [3, 1], [3, 1], [3, 1], [3, 1], // 010xxx\n [3, 1], [3, 1], [3, 1], [3, 1],\n [3, 4], [3, 4], [3, 4], [3, 4], // 011xxx\n [3, 4], [3, 4], [3, 4], [3, 4],\n [2, 3], [2, 3], [2, 3], [2, 3], // 10xxxx\n [2, 3], [2, 3], [2, 3], [2, 3],\n [2, 3], [2, 3], [2, 3], [2, 3],\n [2, 3], [2, 3], [2, 3], [2, 3],\n [2, 2], [2, 2], [2, 2], [2, 2], // 11xxxx\n [2, 2], [2, 2], [2, 2], [2, 2],\n [2, 2], [2, 2], [2, 2], [2, 2],\n [2, 2], [2, 2], [2, 2], [2, 2]\n];\n\n/**\n * @param {CCITTFaxDecoderSource} source - The data which should be decoded.\n * @param {Object} [options] - Decoding options.\n */\nclass CCITTFaxDecoder {\n constructor(source, options = {}) {\n if (!source || typeof source.next !== \"function\") {\n throw new Error('CCITTFaxDecoder - invalid \"source\" parameter.');\n }\n this.source = source;\n this.eof = false;\n\n this.encoding = options.K || 0;\n this.eoline = options.EndOfLine || false;\n this.byteAlign = options.EncodedByteAlign || false;\n this.columns = options.Columns || 1728;\n this.rows = options.Rows || 0;\n this.eoblock = options.EndOfBlock ?? true;\n this.black = options.BlackIs1 || false;\n\n this.codingLine = new Uint32Array(this.columns + 1);\n this.refLine = new Uint32Array(this.columns + 2);\n\n this.codingLine[0] = this.columns;\n this.codingPos = 0;\n\n this.row = 0;\n this.nextLine2D = this.encoding < 0;\n this.inputBits = 0;\n this.inputBuf = 0;\n this.outputBits = 0;\n this.rowsDone = false;\n\n let code1;\n while ((code1 = this._lookBits(12)) === 0) {\n this._eatBits(1);\n }\n if (code1 === 1) {\n this._eatBits(12);\n }\n if (this.encoding > 0) {\n this.nextLine2D = !this._lookBits(1);\n this._eatBits(1);\n }\n }\n\n readNextChar() {\n if (this.eof) {\n return -1;\n }\n const refLine = this.refLine;\n const codingLine = this.codingLine;\n const columns = this.columns;\n\n let refPos, blackPixels, bits, i;\n\n if (this.outputBits === 0) {\n if (this.rowsDone) {\n this.eof = true;\n }\n if (this.eof) {\n return -1;\n }\n this.err = false;\n\n let code1, code2, code3;\n if (this.nextLine2D) {\n for (i = 0; codingLine[i] < columns; ++i) {\n refLine[i] = codingLine[i];\n }\n refLine[i++] = columns;\n refLine[i] = columns;\n codingLine[0] = 0;\n this.codingPos = 0;\n refPos = 0;\n blackPixels = 0;\n\n while (codingLine[this.codingPos] < columns) {\n code1 = this._getTwoDimCode();\n switch (code1) {\n case twoDimPass:\n this._addPixels(refLine[refPos + 1], blackPixels);\n if (refLine[refPos + 1] < columns) {\n refPos += 2;\n }\n break;\n case twoDimHoriz:\n code1 = code2 = 0;\n if (blackPixels) {\n do {\n code1 += code3 = this._getBlackCode();\n } while (code3 >= 64);\n do {\n code2 += code3 = this._getWhiteCode();\n } while (code3 >= 64);\n } else {\n do {\n code1 += code3 = this._getWhiteCode();\n } while (code3 >= 64);\n do {\n code2 += code3 = this._getBlackCode();\n } while (code3 >= 64);\n }\n this._addPixels(codingLine[this.codingPos] + code1, blackPixels);\n if (codingLine[this.codingPos] < columns) {\n this._addPixels(\n codingLine[this.codingPos] + code2,\n blackPixels ^ 1\n );\n }\n while (\n refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns\n ) {\n refPos += 2;\n }\n break;\n case twoDimVertR3:\n this._addPixels(refLine[refPos] + 3, blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n ++refPos;\n while (\n refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns\n ) {\n refPos += 2;\n }\n }\n break;\n case twoDimVertR2:\n this._addPixels(refLine[refPos] + 2, blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n ++refPos;\n while (\n refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns\n ) {\n refPos += 2;\n }\n }\n break;\n case twoDimVertR1:\n this._addPixels(refLine[refPos] + 1, blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n ++refPos;\n while (\n refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns\n ) {\n refPos += 2;\n }\n }\n break;\n case twoDimVert0:\n this._addPixels(refLine[refPos], blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n ++refPos;\n while (\n refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns\n ) {\n refPos += 2;\n }\n }\n break;\n case twoDimVertL3:\n this._addPixelsNeg(refLine[refPos] - 3, blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n if (refPos > 0) {\n --refPos;\n } else {\n ++refPos;\n }\n while (\n refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns\n ) {\n refPos += 2;\n }\n }\n break;\n case twoDimVertL2:\n this._addPixelsNeg(refLine[refPos] - 2, blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n if (refPos > 0) {\n --refPos;\n } else {\n ++refPos;\n }\n while (\n refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns\n ) {\n refPos += 2;\n }\n }\n break;\n case twoDimVertL1:\n this._addPixelsNeg(refLine[refPos] - 1, blackPixels);\n blackPixels ^= 1;\n if (codingLine[this.codingPos] < columns) {\n if (refPos > 0) {\n --refPos;\n } else {\n ++refPos;\n }\n while (\n refLine[refPos] <= codingLine[this.codingPos] &&\n refLine[refPos] < columns\n ) {\n refPos += 2;\n }\n }\n break;\n case ccittEOF:\n this._addPixels(columns, 0);\n this.eof = true;\n break;\n default:\n info(\"bad 2d code\");\n this._addPixels(columns, 0);\n this.err = true;\n }\n }\n } else {\n codingLine[0] = 0;\n this.codingPos = 0;\n blackPixels = 0;\n while (codingLine[this.codingPos] < columns) {\n code1 = 0;\n if (blackPixels) {\n do {\n code1 += code3 = this._getBlackCode();\n } while (code3 >= 64);\n } else {\n do {\n code1 += code3 = this._getWhiteCode();\n } while (code3 >= 64);\n }\n this._addPixels(codingLine[this.codingPos] + code1, blackPixels);\n blackPixels ^= 1;\n }\n }\n\n let gotEOL = false;\n\n if (this.byteAlign) {\n this.inputBits &= ~7;\n }\n\n if (!this.eoblock && this.row === this.rows - 1) {\n this.rowsDone = true;\n } else {\n code1 = this._lookBits(12);\n if (this.eoline) {\n while (code1 !== ccittEOF && code1 !== 1) {\n this._eatBits(1);\n code1 = this._lookBits(12);\n }\n } else {\n while (code1 === 0) {\n this._eatBits(1);\n code1 = this._lookBits(12);\n }\n }\n if (code1 === 1) {\n this._eatBits(12);\n gotEOL = true;\n } else if (code1 === ccittEOF) {\n this.eof = true;\n }\n }\n\n if (!this.eof && this.encoding > 0 && !this.rowsDone) {\n this.nextLine2D = !this._lookBits(1);\n this._eatBits(1);\n }\n\n if (this.eoblock && gotEOL && this.byteAlign) {\n code1 = this._lookBits(12);\n if (code1 === 1) {\n this._eatBits(12);\n if (this.encoding > 0) {\n this._lookBits(1);\n this._eatBits(1);\n }\n if (this.encoding >= 0) {\n for (i = 0; i < 4; ++i) {\n code1 = this._lookBits(12);\n if (code1 !== 1) {\n info(\"bad rtc code: \" + code1);\n }\n this._eatBits(12);\n if (this.encoding > 0) {\n this._lookBits(1);\n this._eatBits(1);\n }\n }\n }\n this.eof = true;\n }\n } else if (this.err && this.eoline) {\n while (true) {\n code1 = this._lookBits(13);\n if (code1 === ccittEOF) {\n this.eof = true;\n return -1;\n }\n if (code1 >> 1 === 1) {\n break;\n }\n this._eatBits(1);\n }\n this._eatBits(12);\n if (this.encoding > 0) {\n this._eatBits(1);\n this.nextLine2D = !(code1 & 1);\n }\n }\n\n this.outputBits =\n codingLine[0] > 0\n ? codingLine[(this.codingPos = 0)]\n : codingLine[(this.codingPos = 1)];\n this.row++;\n }\n\n let c;\n if (this.outputBits >= 8) {\n c = this.codingPos & 1 ? 0 : 0xff;\n this.outputBits -= 8;\n if (this.outputBits === 0 && codingLine[this.codingPos] < columns) {\n this.codingPos++;\n this.outputBits =\n codingLine[this.codingPos] - codingLine[this.codingPos - 1];\n }\n } else {\n bits = 8;\n c = 0;\n do {\n if (typeof this.outputBits !== \"number\") {\n throw new FormatError(\n 'Invalid /CCITTFaxDecode data, \"outputBits\" must be a number.'\n );\n }\n\n if (this.outputBits > bits) {\n c <<= bits;\n if (!(this.codingPos & 1)) {\n c |= 0xff >> (8 - bits);\n }\n this.outputBits -= bits;\n bits = 0;\n } else {\n c <<= this.outputBits;\n if (!(this.codingPos & 1)) {\n c |= 0xff >> (8 - this.outputBits);\n }\n bits -= this.outputBits;\n this.outputBits = 0;\n if (codingLine[this.codingPos] < columns) {\n this.codingPos++;\n this.outputBits =\n codingLine[this.codingPos] - codingLine[this.codingPos - 1];\n } else if (bits > 0) {\n c <<= bits;\n bits = 0;\n }\n }\n } while (bits);\n }\n if (this.black) {\n c ^= 0xff;\n }\n return c;\n }\n\n /**\n * @private\n */\n _addPixels(a1, blackPixels) {\n const codingLine = this.codingLine;\n let codingPos = this.codingPos;\n\n if (a1 > codingLine[codingPos]) {\n if (a1 > this.columns) {\n info(\"row is wrong length\");\n this.err = true;\n a1 = this.columns;\n }\n if ((codingPos & 1) ^ blackPixels) {\n ++codingPos;\n }\n\n codingLine[codingPos] = a1;\n }\n this.codingPos = codingPos;\n }\n\n /**\n * @private\n */\n _addPixelsNeg(a1, blackPixels) {\n const codingLine = this.codingLine;\n let codingPos = this.codingPos;\n\n if (a1 > codingLine[codingPos]) {\n if (a1 > this.columns) {\n info(\"row is wrong length\");\n this.err = true;\n a1 = this.columns;\n }\n if ((codingPos & 1) ^ blackPixels) {\n ++codingPos;\n }\n\n codingLine[codingPos] = a1;\n } else if (a1 < codingLine[codingPos]) {\n if (a1 < 0) {\n info(\"invalid code\");\n this.err = true;\n a1 = 0;\n }\n while (codingPos > 0 && a1 < codingLine[codingPos - 1]) {\n --codingPos;\n }\n codingLine[codingPos] = a1;\n }\n\n this.codingPos = codingPos;\n }\n\n /**\n * This function returns the code found from the table.\n * The start and end parameters set the boundaries for searching the table.\n * The limit parameter is optional. Function returns an array with three\n * values. The first array element indicates whether a valid code is being\n * returned. The second array element is the actual code. The third array\n * element indicates whether EOF was reached.\n * @private\n */\n _findTableCode(start, end, table, limit) {\n const limitValue = limit || 0;\n for (let i = start; i <= end; ++i) {\n let code = this._lookBits(i);\n if (code === ccittEOF) {\n return [true, 1, false];\n }\n if (i < end) {\n code <<= end - i;\n }\n if (!limitValue || code >= limitValue) {\n const p = table[code - limitValue];\n if (p[0] === i) {\n this._eatBits(i);\n return [true, p[1], true];\n }\n }\n }\n return [false, 0, false];\n }\n\n /**\n * @private\n */\n _getTwoDimCode() {\n let code = 0;\n let p;\n if (this.eoblock) {\n code = this._lookBits(7);\n p = twoDimTable[code];\n if (p?.[0] > 0) {\n this._eatBits(p[0]);\n return p[1];\n }\n } else {\n const result = this._findTableCode(1, 7, twoDimTable);\n if (result[0] && result[2]) {\n return result[1];\n }\n }\n info(\"Bad two dim code\");\n return ccittEOF;\n }\n\n /**\n * @private\n */\n _getWhiteCode() {\n let code = 0;\n let p;\n if (this.eoblock) {\n code = this._lookBits(12);\n if (code === ccittEOF) {\n return 1;\n }\n\n p = code >> 5 === 0 ? whiteTable1[code] : whiteTable2[code >> 3];\n\n if (p[0] > 0) {\n this._eatBits(p[0]);\n return p[1];\n }\n } else {\n let result = this._findTableCode(1, 9, whiteTable2);\n if (result[0]) {\n return result[1];\n }\n\n result = this._findTableCode(11, 12, whiteTable1);\n if (result[0]) {\n return result[1];\n }\n }\n info(\"bad white code\");\n this._eatBits(1);\n return 1;\n }\n\n /**\n * @private\n */\n _getBlackCode() {\n let code, p;\n if (this.eoblock) {\n code = this._lookBits(13);\n if (code === ccittEOF) {\n return 1;\n }\n if (code >> 7 === 0) {\n p = blackTable1[code];\n } else if (code >> 9 === 0 && code >> 7 !== 0) {\n p = blackTable2[(code >> 1) - 64];\n } else {\n p = blackTable3[code >> 7];\n }\n\n if (p[0] > 0) {\n this._eatBits(p[0]);\n return p[1];\n }\n } else {\n let result = this._findTableCode(2, 6, blackTable3);\n if (result[0]) {\n return result[1];\n }\n\n result = this._findTableCode(7, 12, blackTable2, 64);\n if (result[0]) {\n return result[1];\n }\n\n result = this._findTableCode(10, 13, blackTable1);\n if (result[0]) {\n return result[1];\n }\n }\n info(\"bad black code\");\n this._eatBits(1);\n return 1;\n }\n\n /**\n * @private\n */\n _lookBits(n) {\n let c;\n while (this.inputBits < n) {\n if ((c = this.source.next()) === -1) {\n if (this.inputBits === 0) {\n return ccittEOF;\n }\n return (this.inputBuf << (n - this.inputBits)) & (0xffff >> (16 - n));\n }\n this.inputBuf = (this.inputBuf << 8) | c;\n this.inputBits += 8;\n }\n return (this.inputBuf >> (this.inputBits - n)) & (0xffff >> (16 - n));\n }\n\n /**\n * @private\n */\n _eatBits(n) {\n if ((this.inputBits -= n) < 0) {\n this.inputBits = 0;\n }\n }\n}\n\nexport { CCITTFaxDecoder };\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 { CCITTFaxDecoder } from \"./ccitt.js\";\nimport { DecodeStream } from \"./decode_stream.js\";\nimport { Dict } from \"./primitives.js\";\n\nclass CCITTFaxStream extends DecodeStream {\n constructor(str, maybeLength, params) {\n super(maybeLength);\n\n this.str = str;\n this.dict = str.dict;\n\n if (!(params instanceof Dict)) {\n params = Dict.empty;\n }\n\n const source = {\n next() {\n return str.getByte();\n },\n };\n this.ccittFaxDecoder = new CCITTFaxDecoder(source, {\n K: params.get(\"K\"),\n EndOfLine: params.get(\"EndOfLine\"),\n EncodedByteAlign: params.get(\"EncodedByteAlign\"),\n Columns: params.get(\"Columns\"),\n Rows: params.get(\"Rows\"),\n EndOfBlock: params.get(\"EndOfBlock\"),\n BlackIs1: params.get(\"BlackIs1\"),\n });\n }\n\n readBlock() {\n while (!this.eof) {\n const c = this.ccittFaxDecoder.readNextChar();\n if (c === -1) {\n this.eof = true;\n return;\n }\n this.ensureBuffer(this.bufferLength + 1);\n this.buffer[this.bufferLength++] = c;\n }\n }\n}\n\nexport { CCITTFaxStream };\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/* Copyright 1996-2003 Glyph & Cog, LLC\n *\n * The flate stream implementation contained in this file is a JavaScript port\n * of XPDF's implementation, made available under the Apache 2.0 open source\n * license.\n */\n\nimport { FormatError, info } from \"../shared/util.js\";\nimport { DecodeStream } from \"./decode_stream.js\";\n\nconst codeLenCodeMap = new Int32Array([\n 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15,\n]);\n\nconst lengthDecode = new Int32Array([\n 0x00003, 0x00004, 0x00005, 0x00006, 0x00007, 0x00008, 0x00009, 0x0000a,\n 0x1000b, 0x1000d, 0x1000f, 0x10011, 0x20013, 0x20017, 0x2001b, 0x2001f,\n 0x30023, 0x3002b, 0x30033, 0x3003b, 0x40043, 0x40053, 0x40063, 0x40073,\n 0x50083, 0x500a3, 0x500c3, 0x500e3, 0x00102, 0x00102, 0x00102,\n]);\n\nconst distDecode = new Int32Array([\n 0x00001, 0x00002, 0x00003, 0x00004, 0x10005, 0x10007, 0x20009, 0x2000d,\n 0x30011, 0x30019, 0x40021, 0x40031, 0x50041, 0x50061, 0x60081, 0x600c1,\n 0x70101, 0x70181, 0x80201, 0x80301, 0x90401, 0x90601, 0xa0801, 0xa0c01,\n 0xb1001, 0xb1801, 0xc2001, 0xc3001, 0xd4001, 0xd6001,\n]);\n\nconst fixedLitCodeTab = [\n new Int32Array([\n 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c0,\n 0x70108, 0x80060, 0x80020, 0x900a0, 0x80000, 0x80080, 0x80040, 0x900e0,\n 0x70104, 0x80058, 0x80018, 0x90090, 0x70114, 0x80078, 0x80038, 0x900d0,\n 0x7010c, 0x80068, 0x80028, 0x900b0, 0x80008, 0x80088, 0x80048, 0x900f0,\n 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c8,\n 0x7010a, 0x80064, 0x80024, 0x900a8, 0x80004, 0x80084, 0x80044, 0x900e8,\n 0x70106, 0x8005c, 0x8001c, 0x90098, 0x70116, 0x8007c, 0x8003c, 0x900d8,\n 0x7010e, 0x8006c, 0x8002c, 0x900b8, 0x8000c, 0x8008c, 0x8004c, 0x900f8,\n 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c4,\n 0x70109, 0x80062, 0x80022, 0x900a4, 0x80002, 0x80082, 0x80042, 0x900e4,\n 0x70105, 0x8005a, 0x8001a, 0x90094, 0x70115, 0x8007a, 0x8003a, 0x900d4,\n 0x7010d, 0x8006a, 0x8002a, 0x900b4, 0x8000a, 0x8008a, 0x8004a, 0x900f4,\n 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cc,\n 0x7010b, 0x80066, 0x80026, 0x900ac, 0x80006, 0x80086, 0x80046, 0x900ec,\n 0x70107, 0x8005e, 0x8001e, 0x9009c, 0x70117, 0x8007e, 0x8003e, 0x900dc,\n 0x7010f, 0x8006e, 0x8002e, 0x900bc, 0x8000e, 0x8008e, 0x8004e, 0x900fc,\n 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c2,\n 0x70108, 0x80061, 0x80021, 0x900a2, 0x80001, 0x80081, 0x80041, 0x900e2,\n 0x70104, 0x80059, 0x80019, 0x90092, 0x70114, 0x80079, 0x80039, 0x900d2,\n 0x7010c, 0x80069, 0x80029, 0x900b2, 0x80009, 0x80089, 0x80049, 0x900f2,\n 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900ca,\n 0x7010a, 0x80065, 0x80025, 0x900aa, 0x80005, 0x80085, 0x80045, 0x900ea,\n 0x70106, 0x8005d, 0x8001d, 0x9009a, 0x70116, 0x8007d, 0x8003d, 0x900da,\n 0x7010e, 0x8006d, 0x8002d, 0x900ba, 0x8000d, 0x8008d, 0x8004d, 0x900fa,\n 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c6,\n 0x70109, 0x80063, 0x80023, 0x900a6, 0x80003, 0x80083, 0x80043, 0x900e6,\n 0x70105, 0x8005b, 0x8001b, 0x90096, 0x70115, 0x8007b, 0x8003b, 0x900d6,\n 0x7010d, 0x8006b, 0x8002b, 0x900b6, 0x8000b, 0x8008b, 0x8004b, 0x900f6,\n 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900ce,\n 0x7010b, 0x80067, 0x80027, 0x900ae, 0x80007, 0x80087, 0x80047, 0x900ee,\n 0x70107, 0x8005f, 0x8001f, 0x9009e, 0x70117, 0x8007f, 0x8003f, 0x900de,\n 0x7010f, 0x8006f, 0x8002f, 0x900be, 0x8000f, 0x8008f, 0x8004f, 0x900fe,\n 0x70100, 0x80050, 0x80010, 0x80118, 0x70110, 0x80070, 0x80030, 0x900c1,\n 0x70108, 0x80060, 0x80020, 0x900a1, 0x80000, 0x80080, 0x80040, 0x900e1,\n 0x70104, 0x80058, 0x80018, 0x90091, 0x70114, 0x80078, 0x80038, 0x900d1,\n 0x7010c, 0x80068, 0x80028, 0x900b1, 0x80008, 0x80088, 0x80048, 0x900f1,\n 0x70102, 0x80054, 0x80014, 0x8011c, 0x70112, 0x80074, 0x80034, 0x900c9,\n 0x7010a, 0x80064, 0x80024, 0x900a9, 0x80004, 0x80084, 0x80044, 0x900e9,\n 0x70106, 0x8005c, 0x8001c, 0x90099, 0x70116, 0x8007c, 0x8003c, 0x900d9,\n 0x7010e, 0x8006c, 0x8002c, 0x900b9, 0x8000c, 0x8008c, 0x8004c, 0x900f9,\n 0x70101, 0x80052, 0x80012, 0x8011a, 0x70111, 0x80072, 0x80032, 0x900c5,\n 0x70109, 0x80062, 0x80022, 0x900a5, 0x80002, 0x80082, 0x80042, 0x900e5,\n 0x70105, 0x8005a, 0x8001a, 0x90095, 0x70115, 0x8007a, 0x8003a, 0x900d5,\n 0x7010d, 0x8006a, 0x8002a, 0x900b5, 0x8000a, 0x8008a, 0x8004a, 0x900f5,\n 0x70103, 0x80056, 0x80016, 0x8011e, 0x70113, 0x80076, 0x80036, 0x900cd,\n 0x7010b, 0x80066, 0x80026, 0x900ad, 0x80006, 0x80086, 0x80046, 0x900ed,\n 0x70107, 0x8005e, 0x8001e, 0x9009d, 0x70117, 0x8007e, 0x8003e, 0x900dd,\n 0x7010f, 0x8006e, 0x8002e, 0x900bd, 0x8000e, 0x8008e, 0x8004e, 0x900fd,\n 0x70100, 0x80051, 0x80011, 0x80119, 0x70110, 0x80071, 0x80031, 0x900c3,\n 0x70108, 0x80061, 0x80021, 0x900a3, 0x80001, 0x80081, 0x80041, 0x900e3,\n 0x70104, 0x80059, 0x80019, 0x90093, 0x70114, 0x80079, 0x80039, 0x900d3,\n 0x7010c, 0x80069, 0x80029, 0x900b3, 0x80009, 0x80089, 0x80049, 0x900f3,\n 0x70102, 0x80055, 0x80015, 0x8011d, 0x70112, 0x80075, 0x80035, 0x900cb,\n 0x7010a, 0x80065, 0x80025, 0x900ab, 0x80005, 0x80085, 0x80045, 0x900eb,\n 0x70106, 0x8005d, 0x8001d, 0x9009b, 0x70116, 0x8007d, 0x8003d, 0x900db,\n 0x7010e, 0x8006d, 0x8002d, 0x900bb, 0x8000d, 0x8008d, 0x8004d, 0x900fb,\n 0x70101, 0x80053, 0x80013, 0x8011b, 0x70111, 0x80073, 0x80033, 0x900c7,\n 0x70109, 0x80063, 0x80023, 0x900a7, 0x80003, 0x80083, 0x80043, 0x900e7,\n 0x70105, 0x8005b, 0x8001b, 0x90097, 0x70115, 0x8007b, 0x8003b, 0x900d7,\n 0x7010d, 0x8006b, 0x8002b, 0x900b7, 0x8000b, 0x8008b, 0x8004b, 0x900f7,\n 0x70103, 0x80057, 0x80017, 0x8011f, 0x70113, 0x80077, 0x80037, 0x900cf,\n 0x7010b, 0x80067, 0x80027, 0x900af, 0x80007, 0x80087, 0x80047, 0x900ef,\n 0x70107, 0x8005f, 0x8001f, 0x9009f, 0x70117, 0x8007f, 0x8003f, 0x900df,\n 0x7010f, 0x8006f, 0x8002f, 0x900bf, 0x8000f, 0x8008f, 0x8004f, 0x900ff,\n ]),\n 9,\n];\n\nconst fixedDistCodeTab = [\n new Int32Array([\n 0x50000, 0x50010, 0x50008, 0x50018, 0x50004, 0x50014, 0x5000c, 0x5001c,\n 0x50002, 0x50012, 0x5000a, 0x5001a, 0x50006, 0x50016, 0x5000e, 0x00000,\n 0x50001, 0x50011, 0x50009, 0x50019, 0x50005, 0x50015, 0x5000d, 0x5001d,\n 0x50003, 0x50013, 0x5000b, 0x5001b, 0x50007, 0x50017, 0x5000f, 0x00000,\n ]),\n 5,\n];\n\nclass FlateStream extends DecodeStream {\n constructor(str, maybeLength) {\n super(maybeLength);\n\n this.str = str;\n this.dict = str.dict;\n\n const cmf = str.getByte();\n const flg = str.getByte();\n if (cmf === -1 || flg === -1) {\n throw new FormatError(`Invalid header in flate stream: ${cmf}, ${flg}`);\n }\n if ((cmf & 0x0f) !== 0x08) {\n throw new FormatError(\n `Unknown compression method in flate stream: ${cmf}, ${flg}`\n );\n }\n if (((cmf << 8) + flg) % 31 !== 0) {\n throw new FormatError(`Bad FCHECK in flate stream: ${cmf}, ${flg}`);\n }\n if (flg & 0x20) {\n throw new FormatError(`FDICT bit set in flate stream: ${cmf}, ${flg}`);\n }\n\n this.codeSize = 0;\n this.codeBuf = 0;\n }\n\n getBits(bits) {\n const str = this.str;\n let codeSize = this.codeSize;\n let codeBuf = this.codeBuf;\n\n let b;\n while (codeSize < bits) {\n if ((b = str.getByte()) === -1) {\n throw new FormatError(\"Bad encoding in flate stream\");\n }\n codeBuf |= b << codeSize;\n codeSize += 8;\n }\n b = codeBuf & ((1 << bits) - 1);\n this.codeBuf = codeBuf >> bits;\n this.codeSize = codeSize -= bits;\n\n return b;\n }\n\n getCode(table) {\n const str = this.str;\n const codes = table[0];\n const maxLen = table[1];\n let codeSize = this.codeSize;\n let codeBuf = this.codeBuf;\n\n let b;\n while (codeSize < maxLen) {\n if ((b = str.getByte()) === -1) {\n // premature end of stream. code might however still be valid.\n // codeSize < codeLen check below guards against incomplete codeVal.\n break;\n }\n codeBuf |= b << codeSize;\n codeSize += 8;\n }\n const code = codes[codeBuf & ((1 << maxLen) - 1)];\n const codeLen = code >> 16;\n const codeVal = code & 0xffff;\n if (codeLen < 1 || codeSize < codeLen) {\n throw new FormatError(\"Bad encoding in flate stream\");\n }\n this.codeBuf = codeBuf >> codeLen;\n this.codeSize = codeSize - codeLen;\n return codeVal;\n }\n\n generateHuffmanTable(lengths) {\n const n = lengths.length;\n\n // find max code length\n let maxLen = 0;\n let i;\n for (i = 0; i < n; ++i) {\n if (lengths[i] > maxLen) {\n maxLen = lengths[i];\n }\n }\n\n // build the table\n const size = 1 << maxLen;\n const codes = new Int32Array(size);\n for (\n let len = 1, code = 0, skip = 2;\n len <= maxLen;\n ++len, code <<= 1, skip <<= 1\n ) {\n for (let val = 0; val < n; ++val) {\n if (lengths[val] === len) {\n // bit-reverse the code\n let code2 = 0;\n let t = code;\n for (i = 0; i < len; ++i) {\n code2 = (code2 << 1) | (t & 1);\n t >>= 1;\n }\n\n // fill the table entries\n for (i = code2; i < size; i += skip) {\n codes[i] = (len << 16) | val;\n }\n ++code;\n }\n }\n }\n\n return [codes, maxLen];\n }\n\n #endsStreamOnError(err) {\n info(err);\n this.eof = true;\n }\n\n readBlock() {\n let buffer, len;\n const str = this.str;\n // read block header\n let hdr = this.getBits(3);\n if (hdr & 1) {\n this.eof = true;\n }\n hdr >>= 1;\n\n if (hdr === 0) {\n // uncompressed block\n let b;\n\n if ((b = str.getByte()) === -1) {\n this.#endsStreamOnError(\"Bad block header in flate stream\");\n return;\n }\n let blockLen = b;\n if ((b = str.getByte()) === -1) {\n this.#endsStreamOnError(\"Bad block header in flate stream\");\n return;\n }\n blockLen |= b << 8;\n if ((b = str.getByte()) === -1) {\n this.#endsStreamOnError(\"Bad block header in flate stream\");\n return;\n }\n let check = b;\n if ((b = str.getByte()) === -1) {\n this.#endsStreamOnError(\"Bad block header in flate stream\");\n return;\n }\n check |= b << 8;\n if (check !== (~blockLen & 0xffff) && (blockLen !== 0 || check !== 0)) {\n // Ignoring error for bad \"empty\" block (see issue 1277)\n throw new FormatError(\"Bad uncompressed block length in flate stream\");\n }\n\n this.codeBuf = 0;\n this.codeSize = 0;\n\n const bufferLength = this.bufferLength,\n end = bufferLength + blockLen;\n buffer = this.ensureBuffer(end);\n this.bufferLength = end;\n\n if (blockLen === 0) {\n if (str.peekByte() === -1) {\n this.eof = true;\n }\n } else {\n const block = str.getBytes(blockLen);\n buffer.set(block, bufferLength);\n if (block.length < blockLen) {\n this.eof = true;\n }\n }\n return;\n }\n\n let litCodeTable;\n let distCodeTable;\n if (hdr === 1) {\n // compressed block, fixed codes\n litCodeTable = fixedLitCodeTab;\n distCodeTable = fixedDistCodeTab;\n } else if (hdr === 2) {\n // compressed block, dynamic codes\n const numLitCodes = this.getBits(5) + 257;\n const numDistCodes = this.getBits(5) + 1;\n const numCodeLenCodes = this.getBits(4) + 4;\n\n // build the code lengths code table\n const codeLenCodeLengths = new Uint8Array(codeLenCodeMap.length);\n\n let i;\n for (i = 0; i < numCodeLenCodes; ++i) {\n codeLenCodeLengths[codeLenCodeMap[i]] = this.getBits(3);\n }\n const codeLenCodeTab = this.generateHuffmanTable(codeLenCodeLengths);\n\n // build the literal and distance code tables\n len = 0;\n i = 0;\n const codes = numLitCodes + numDistCodes;\n const codeLengths = new Uint8Array(codes);\n let bitsLength, bitsOffset, what;\n while (i < codes) {\n const code = this.getCode(codeLenCodeTab);\n if (code === 16) {\n bitsLength = 2;\n bitsOffset = 3;\n what = len;\n } else if (code === 17) {\n bitsLength = 3;\n bitsOffset = 3;\n what = len = 0;\n } else if (code === 18) {\n bitsLength = 7;\n bitsOffset = 11;\n what = len = 0;\n } else {\n codeLengths[i++] = len = code;\n continue;\n }\n\n let repeatLength = this.getBits(bitsLength) + bitsOffset;\n while (repeatLength-- > 0) {\n codeLengths[i++] = what;\n }\n }\n\n litCodeTable = this.generateHuffmanTable(\n codeLengths.subarray(0, numLitCodes)\n );\n distCodeTable = this.generateHuffmanTable(\n codeLengths.subarray(numLitCodes, codes)\n );\n } else {\n throw new FormatError(\"Unknown block type in flate stream\");\n }\n\n buffer = this.buffer;\n let limit = buffer ? buffer.length : 0;\n let pos = this.bufferLength;\n while (true) {\n let code1 = this.getCode(litCodeTable);\n if (code1 < 256) {\n if (pos + 1 >= limit) {\n buffer = this.ensureBuffer(pos + 1);\n limit = buffer.length;\n }\n buffer[pos++] = code1;\n continue;\n }\n if (code1 === 256) {\n this.bufferLength = pos;\n return;\n }\n code1 -= 257;\n code1 = lengthDecode[code1];\n let code2 = code1 >> 16;\n if (code2 > 0) {\n code2 = this.getBits(code2);\n }\n len = (code1 & 0xffff) + code2;\n code1 = this.getCode(distCodeTable);\n code1 = distDecode[code1];\n code2 = code1 >> 16;\n if (code2 > 0) {\n code2 = this.getBits(code2);\n }\n const dist = (code1 & 0xffff) + code2;\n if (pos + len >= limit) {\n buffer = this.ensureBuffer(pos + len);\n limit = buffer.length;\n }\n for (let k = 0; k < len; ++k, ++pos) {\n buffer[pos] = buffer[pos - dist];\n }\n }\n }\n}\n\nexport { FlateStream };\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// Table C-2\nconst QeTable = [\n { qe: 0x5601, nmps: 1, nlps: 1, switchFlag: 1 },\n { qe: 0x3401, nmps: 2, nlps: 6, switchFlag: 0 },\n { qe: 0x1801, nmps: 3, nlps: 9, switchFlag: 0 },\n { qe: 0x0ac1, nmps: 4, nlps: 12, switchFlag: 0 },\n { qe: 0x0521, nmps: 5, nlps: 29, switchFlag: 0 },\n { qe: 0x0221, nmps: 38, nlps: 33, switchFlag: 0 },\n { qe: 0x5601, nmps: 7, nlps: 6, switchFlag: 1 },\n { qe: 0x5401, nmps: 8, nlps: 14, switchFlag: 0 },\n { qe: 0x4801, nmps: 9, nlps: 14, switchFlag: 0 },\n { qe: 0x3801, nmps: 10, nlps: 14, switchFlag: 0 },\n { qe: 0x3001, nmps: 11, nlps: 17, switchFlag: 0 },\n { qe: 0x2401, nmps: 12, nlps: 18, switchFlag: 0 },\n { qe: 0x1c01, nmps: 13, nlps: 20, switchFlag: 0 },\n { qe: 0x1601, nmps: 29, nlps: 21, switchFlag: 0 },\n { qe: 0x5601, nmps: 15, nlps: 14, switchFlag: 1 },\n { qe: 0x5401, nmps: 16, nlps: 14, switchFlag: 0 },\n { qe: 0x5101, nmps: 17, nlps: 15, switchFlag: 0 },\n { qe: 0x4801, nmps: 18, nlps: 16, switchFlag: 0 },\n { qe: 0x3801, nmps: 19, nlps: 17, switchFlag: 0 },\n { qe: 0x3401, nmps: 20, nlps: 18, switchFlag: 0 },\n { qe: 0x3001, nmps: 21, nlps: 19, switchFlag: 0 },\n { qe: 0x2801, nmps: 22, nlps: 19, switchFlag: 0 },\n { qe: 0x2401, nmps: 23, nlps: 20, switchFlag: 0 },\n { qe: 0x2201, nmps: 24, nlps: 21, switchFlag: 0 },\n { qe: 0x1c01, nmps: 25, nlps: 22, switchFlag: 0 },\n { qe: 0x1801, nmps: 26, nlps: 23, switchFlag: 0 },\n { qe: 0x1601, nmps: 27, nlps: 24, switchFlag: 0 },\n { qe: 0x1401, nmps: 28, nlps: 25, switchFlag: 0 },\n { qe: 0x1201, nmps: 29, nlps: 26, switchFlag: 0 },\n { qe: 0x1101, nmps: 30, nlps: 27, switchFlag: 0 },\n { qe: 0x0ac1, nmps: 31, nlps: 28, switchFlag: 0 },\n { qe: 0x09c1, nmps: 32, nlps: 29, switchFlag: 0 },\n { qe: 0x08a1, nmps: 33, nlps: 30, switchFlag: 0 },\n { qe: 0x0521, nmps: 34, nlps: 31, switchFlag: 0 },\n { qe: 0x0441, nmps: 35, nlps: 32, switchFlag: 0 },\n { qe: 0x02a1, nmps: 36, nlps: 33, switchFlag: 0 },\n { qe: 0x0221, nmps: 37, nlps: 34, switchFlag: 0 },\n { qe: 0x0141, nmps: 38, nlps: 35, switchFlag: 0 },\n { qe: 0x0111, nmps: 39, nlps: 36, switchFlag: 0 },\n { qe: 0x0085, nmps: 40, nlps: 37, switchFlag: 0 },\n { qe: 0x0049, nmps: 41, nlps: 38, switchFlag: 0 },\n { qe: 0x0025, nmps: 42, nlps: 39, switchFlag: 0 },\n { qe: 0x0015, nmps: 43, nlps: 40, switchFlag: 0 },\n { qe: 0x0009, nmps: 44, nlps: 41, switchFlag: 0 },\n { qe: 0x0005, nmps: 45, nlps: 42, switchFlag: 0 },\n { qe: 0x0001, nmps: 45, nlps: 43, switchFlag: 0 },\n { qe: 0x5601, nmps: 46, nlps: 46, switchFlag: 0 },\n];\n\n/**\n * This class implements the QM Coder decoding as defined in\n * JPEG 2000 Part I Final Committee Draft Version 1.0\n * Annex C.3 Arithmetic decoding procedure\n * available at http://www.jpeg.org/public/fcd15444-1.pdf\n *\n * The arithmetic decoder is used in conjunction with context models to decode\n * JPEG2000 and JBIG2 streams.\n */\nclass ArithmeticDecoder {\n // C.3.5 Initialisation of the decoder (INITDEC)\n constructor(data, start, end) {\n this.data = data;\n this.bp = start;\n this.dataEnd = end;\n\n this.chigh = data[start];\n this.clow = 0;\n\n this.byteIn();\n\n this.chigh = ((this.chigh << 7) & 0xffff) | ((this.clow >> 9) & 0x7f);\n this.clow = (this.clow << 7) & 0xffff;\n this.ct -= 7;\n this.a = 0x8000;\n }\n\n // C.3.4 Compressed data input (BYTEIN)\n byteIn() {\n const data = this.data;\n let bp = this.bp;\n\n if (data[bp] === 0xff) {\n if (data[bp + 1] > 0x8f) {\n this.clow += 0xff00;\n this.ct = 8;\n } else {\n bp++;\n this.clow += data[bp] << 9;\n this.ct = 7;\n this.bp = bp;\n }\n } else {\n bp++;\n this.clow += bp < this.dataEnd ? data[bp] << 8 : 0xff00;\n this.ct = 8;\n this.bp = bp;\n }\n if (this.clow > 0xffff) {\n this.chigh += this.clow >> 16;\n this.clow &= 0xffff;\n }\n }\n\n // C.3.2 Decoding a decision (DECODE)\n readBit(contexts, pos) {\n // Contexts are packed into 1 byte:\n // highest 7 bits carry cx.index, lowest bit carries cx.mps\n let cx_index = contexts[pos] >> 1,\n cx_mps = contexts[pos] & 1;\n const qeTableIcx = QeTable[cx_index];\n const qeIcx = qeTableIcx.qe;\n let d;\n let a = this.a - qeIcx;\n\n if (this.chigh < qeIcx) {\n // exchangeLps\n if (a < qeIcx) {\n a = qeIcx;\n d = cx_mps;\n cx_index = qeTableIcx.nmps;\n } else {\n a = qeIcx;\n d = 1 ^ cx_mps;\n if (qeTableIcx.switchFlag === 1) {\n cx_mps = d;\n }\n cx_index = qeTableIcx.nlps;\n }\n } else {\n this.chigh -= qeIcx;\n if ((a & 0x8000) !== 0) {\n this.a = a;\n return cx_mps;\n }\n // exchangeMps\n if (a < qeIcx) {\n d = 1 ^ cx_mps;\n if (qeTableIcx.switchFlag === 1) {\n cx_mps = d;\n }\n cx_index = qeTableIcx.nlps;\n } else {\n d = cx_mps;\n cx_index = qeTableIcx.nmps;\n }\n }\n // C.3.3 renormD;\n do {\n if (this.ct === 0) {\n this.byteIn();\n }\n\n a <<= 1;\n this.chigh = ((this.chigh << 1) & 0xffff) | ((this.clow >> 15) & 1);\n this.clow = (this.clow << 1) & 0xffff;\n this.ct--;\n } while ((a & 0x8000) === 0);\n this.a = a;\n\n contexts[pos] = (cx_index << 1) | cx_mps;\n return d;\n }\n}\n\nexport { ArithmeticDecoder };\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 { BaseException, shadow } from \"../shared/util.js\";\nimport { log2, readInt8, readUint16, readUint32 } from \"./core_utils.js\";\nimport { ArithmeticDecoder } from \"./arithmetic_decoder.js\";\nimport { CCITTFaxDecoder } from \"./ccitt.js\";\n\nclass Jbig2Error extends BaseException {\n constructor(msg) {\n super(`JBIG2 error: ${msg}`, \"Jbig2Error\");\n }\n}\n\n// Utility data structures\nclass ContextCache {\n getContexts(id) {\n if (id in this) {\n return this[id];\n }\n return (this[id] = new Int8Array(1 << 16));\n }\n}\n\nclass DecodingContext {\n constructor(data, start, end) {\n this.data = data;\n this.start = start;\n this.end = end;\n }\n\n get decoder() {\n const decoder = new ArithmeticDecoder(this.data, this.start, this.end);\n return shadow(this, \"decoder\", decoder);\n }\n\n get contextCache() {\n const cache = new ContextCache();\n return shadow(this, \"contextCache\", cache);\n }\n}\n\nconst MAX_INT_32 = 2 ** 31 - 1;\nconst MIN_INT_32 = -(2 ** 31);\n\n// Annex A. Arithmetic Integer Decoding Procedure\n// A.2 Procedure for decoding values\nfunction decodeInteger(contextCache, procedure, decoder) {\n const contexts = contextCache.getContexts(procedure);\n let prev = 1;\n\n function readBits(length) {\n let v = 0;\n for (let i = 0; i < length; i++) {\n const bit = decoder.readBit(contexts, prev);\n prev = prev < 256 ? (prev << 1) | bit : (((prev << 1) | bit) & 511) | 256;\n v = (v << 1) | bit;\n }\n return v >>> 0;\n }\n\n const sign = readBits(1);\n // prettier-ignore\n /* eslint-disable no-nested-ternary */\n const value = readBits(1) ?\n (readBits(1) ?\n (readBits(1) ?\n (readBits(1) ?\n (readBits(1) ?\n (readBits(32) + 4436) :\n readBits(12) + 340) :\n readBits(8) + 84) :\n readBits(6) + 20) :\n readBits(4) + 4) :\n readBits(2);\n /* eslint-enable no-nested-ternary */\n let signedValue;\n if (sign === 0) {\n signedValue = value;\n } else if (value > 0) {\n signedValue = -value;\n }\n // Ensure that the integer value doesn't underflow or overflow.\n if (signedValue >= MIN_INT_32 && signedValue <= MAX_INT_32) {\n return signedValue;\n }\n return null;\n}\n\n// A.3 The IAID decoding procedure\nfunction decodeIAID(contextCache, decoder, codeLength) {\n const contexts = contextCache.getContexts(\"IAID\");\n\n let prev = 1;\n for (let i = 0; i < codeLength; i++) {\n const bit = decoder.readBit(contexts, prev);\n prev = (prev << 1) | bit;\n }\n if (codeLength < 31) {\n return prev & ((1 << codeLength) - 1);\n }\n return prev & 0x7fffffff;\n}\n\n// 7.3 Segment types\nconst SegmentTypes = [\n \"SymbolDictionary\",\n null,\n null,\n null,\n \"IntermediateTextRegion\",\n null,\n \"ImmediateTextRegion\",\n \"ImmediateLosslessTextRegion\",\n null,\n null,\n null,\n null,\n null,\n null,\n null,\n null,\n \"PatternDictionary\",\n null,\n null,\n null,\n \"IntermediateHalftoneRegion\",\n null,\n \"ImmediateHalftoneRegion\",\n \"ImmediateLosslessHalftoneRegion\",\n null,\n null,\n null,\n null,\n null,\n null,\n null,\n null,\n null,\n null,\n null,\n null,\n \"IntermediateGenericRegion\",\n null,\n \"ImmediateGenericRegion\",\n \"ImmediateLosslessGenericRegion\",\n \"IntermediateGenericRefinementRegion\",\n null,\n \"ImmediateGenericRefinementRegion\",\n \"ImmediateLosslessGenericRefinementRegion\",\n null,\n null,\n null,\n null,\n \"PageInformation\",\n \"EndOfPage\",\n \"EndOfStripe\",\n \"EndOfFile\",\n \"Profiles\",\n \"Tables\",\n null,\n null,\n null,\n null,\n null,\n null,\n null,\n null,\n \"Extension\",\n];\n\nconst CodingTemplates = [\n [\n { x: -1, y: -2 },\n { x: 0, y: -2 },\n { x: 1, y: -2 },\n { x: -2, y: -1 },\n { x: -1, y: -1 },\n { x: 0, y: -1 },\n { x: 1, y: -1 },\n { x: 2, y: -1 },\n { x: -4, y: 0 },\n { x: -3, y: 0 },\n { x: -2, y: 0 },\n { x: -1, y: 0 },\n ],\n [\n { x: -1, y: -2 },\n { x: 0, y: -2 },\n { x: 1, y: -2 },\n { x: 2, y: -2 },\n { x: -2, y: -1 },\n { x: -1, y: -1 },\n { x: 0, y: -1 },\n { x: 1, y: -1 },\n { x: 2, y: -1 },\n { x: -3, y: 0 },\n { x: -2, y: 0 },\n { x: -1, y: 0 },\n ],\n [\n { x: -1, y: -2 },\n { x: 0, y: -2 },\n { x: 1, y: -2 },\n { x: -2, y: -1 },\n { x: -1, y: -1 },\n { x: 0, y: -1 },\n { x: 1, y: -1 },\n { x: -2, y: 0 },\n { x: -1, y: 0 },\n ],\n [\n { x: -3, y: -1 },\n { x: -2, y: -1 },\n { x: -1, y: -1 },\n { x: 0, y: -1 },\n { x: 1, y: -1 },\n { x: -4, y: 0 },\n { x: -3, y: 0 },\n { x: -2, y: 0 },\n { x: -1, y: 0 },\n ],\n];\n\nconst RefinementTemplates = [\n {\n coding: [\n { x: 0, y: -1 },\n { x: 1, y: -1 },\n { x: -1, y: 0 },\n ],\n reference: [\n { x: 0, y: -1 },\n { x: 1, y: -1 },\n { x: -1, y: 0 },\n { x: 0, y: 0 },\n { x: 1, y: 0 },\n { x: -1, y: 1 },\n { x: 0, y: 1 },\n { x: 1, y: 1 },\n ],\n },\n {\n coding: [\n { x: -1, y: -1 },\n { x: 0, y: -1 },\n { x: 1, y: -1 },\n { x: -1, y: 0 },\n ],\n reference: [\n { x: 0, y: -1 },\n { x: -1, y: 0 },\n { x: 0, y: 0 },\n { x: 1, y: 0 },\n { x: 0, y: 1 },\n { x: 1, y: 1 },\n ],\n },\n];\n\n// See 6.2.5.7 Decoding the bitmap.\nconst ReusedContexts = [\n 0x9b25, // 10011 0110010 0101\n 0x0795, // 0011 110010 101\n 0x00e5, // 001 11001 01\n 0x0195, // 011001 0101\n];\n\nconst RefinementReusedContexts = [\n 0x0020, // '000' + '0' (coding) + '00010000' + '0' (reference)\n 0x0008, // '0000' + '001000'\n];\n\nfunction decodeBitmapTemplate0(width, height, decodingContext) {\n const decoder = decodingContext.decoder;\n const contexts = decodingContext.contextCache.getContexts(\"GB\");\n const bitmap = [];\n let contextLabel, i, j, pixel, row, row1, row2;\n\n // ...ooooo....\n // ..ooooooo... Context template for current pixel (X)\n // .ooooX...... (concatenate values of 'o'-pixels to get contextLabel)\n const OLD_PIXEL_MASK = 0x7bf7; // 01111 0111111 0111\n\n for (i = 0; i < height; i++) {\n row = bitmap[i] = new Uint8Array(width);\n row1 = i < 1 ? row : bitmap[i - 1];\n row2 = i < 2 ? row : bitmap[i - 2];\n\n // At the beginning of each row:\n // Fill contextLabel with pixels that are above/right of (X)\n contextLabel =\n (row2[0] << 13) |\n (row2[1] << 12) |\n (row2[2] << 11) |\n (row1[0] << 7) |\n (row1[1] << 6) |\n (row1[2] << 5) |\n (row1[3] << 4);\n\n for (j = 0; j < width; j++) {\n row[j] = pixel = decoder.readBit(contexts, contextLabel);\n\n // At each pixel: Clear contextLabel pixels that are shifted\n // out of the context, then add new ones.\n contextLabel =\n ((contextLabel & OLD_PIXEL_MASK) << 1) |\n (j + 3 < width ? row2[j + 3] << 11 : 0) |\n (j + 4 < width ? row1[j + 4] << 4 : 0) |\n pixel;\n }\n }\n\n return bitmap;\n}\n\n// 6.2 Generic Region Decoding Procedure\nfunction decodeBitmap(\n mmr,\n width,\n height,\n templateIndex,\n prediction,\n skip,\n at,\n decodingContext\n) {\n if (mmr) {\n const input = new Reader(\n decodingContext.data,\n decodingContext.start,\n decodingContext.end\n );\n return decodeMMRBitmap(input, width, height, false);\n }\n\n // Use optimized version for the most common case\n if (\n templateIndex === 0 &&\n !skip &&\n !prediction &&\n at.length === 4 &&\n at[0].x === 3 &&\n at[0].y === -1 &&\n at[1].x === -3 &&\n at[1].y === -1 &&\n at[2].x === 2 &&\n at[2].y === -2 &&\n at[3].x === -2 &&\n at[3].y === -2\n ) {\n return decodeBitmapTemplate0(width, height, decodingContext);\n }\n\n const useskip = !!skip;\n const template = CodingTemplates[templateIndex].concat(at);\n\n // Sorting is non-standard, and it is not required. But sorting increases\n // the number of template bits that can be reused from the previous\n // contextLabel in the main loop.\n template.sort(function (a, b) {\n return a.y - b.y || a.x - b.x;\n });\n\n const templateLength = template.length;\n const templateX = new Int8Array(templateLength);\n const templateY = new Int8Array(templateLength);\n const changingTemplateEntries = [];\n let reuseMask = 0,\n minX = 0,\n maxX = 0,\n minY = 0;\n let c, k;\n\n for (k = 0; k < templateLength; k++) {\n templateX[k] = template[k].x;\n templateY[k] = template[k].y;\n minX = Math.min(minX, template[k].x);\n maxX = Math.max(maxX, template[k].x);\n minY = Math.min(minY, template[k].y);\n // Check if the template pixel appears in two consecutive context labels,\n // so it can be reused. Otherwise, we add it to the list of changing\n // template entries.\n if (\n k < templateLength - 1 &&\n template[k].y === template[k + 1].y &&\n template[k].x === template[k + 1].x - 1\n ) {\n reuseMask |= 1 << (templateLength - 1 - k);\n } else {\n changingTemplateEntries.push(k);\n }\n }\n const changingEntriesLength = changingTemplateEntries.length;\n\n const changingTemplateX = new Int8Array(changingEntriesLength);\n const changingTemplateY = new Int8Array(changingEntriesLength);\n const changingTemplateBit = new Uint16Array(changingEntriesLength);\n for (c = 0; c < changingEntriesLength; c++) {\n k = changingTemplateEntries[c];\n changingTemplateX[c] = template[k].x;\n changingTemplateY[c] = template[k].y;\n changingTemplateBit[c] = 1 << (templateLength - 1 - k);\n }\n\n // Get the safe bounding box edges from the width, height, minX, maxX, minY\n const sbb_left = -minX;\n const sbb_top = -minY;\n const sbb_right = width - maxX;\n\n const pseudoPixelContext = ReusedContexts[templateIndex];\n let row = new Uint8Array(width);\n const bitmap = [];\n\n const decoder = decodingContext.decoder;\n const contexts = decodingContext.contextCache.getContexts(\"GB\");\n\n let ltp = 0,\n j,\n i0,\n j0,\n contextLabel = 0,\n bit,\n shift;\n for (let i = 0; i < height; i++) {\n if (prediction) {\n const sltp = decoder.readBit(contexts, pseudoPixelContext);\n ltp ^= sltp;\n if (ltp) {\n bitmap.push(row); // duplicate previous row\n continue;\n }\n }\n row = new Uint8Array(row);\n bitmap.push(row);\n for (j = 0; j < width; j++) {\n if (useskip && skip[i][j]) {\n row[j] = 0;\n continue;\n }\n // Are we in the middle of a scanline, so we can reuse contextLabel\n // bits?\n if (j >= sbb_left && j < sbb_right && i >= sbb_top) {\n // If yes, we can just shift the bits that are reusable and only\n // fetch the remaining ones.\n contextLabel = (contextLabel << 1) & reuseMask;\n for (k = 0; k < changingEntriesLength; k++) {\n i0 = i + changingTemplateY[k];\n j0 = j + changingTemplateX[k];\n bit = bitmap[i0][j0];\n if (bit) {\n bit = changingTemplateBit[k];\n contextLabel |= bit;\n }\n }\n } else {\n // compute the contextLabel from scratch\n contextLabel = 0;\n shift = templateLength - 1;\n for (k = 0; k < templateLength; k++, shift--) {\n j0 = j + templateX[k];\n if (j0 >= 0 && j0 < width) {\n i0 = i + templateY[k];\n if (i0 >= 0) {\n bit = bitmap[i0][j0];\n if (bit) {\n contextLabel |= bit << shift;\n }\n }\n }\n }\n }\n const pixel = decoder.readBit(contexts, contextLabel);\n row[j] = pixel;\n }\n }\n return bitmap;\n}\n\n// 6.3.2 Generic Refinement Region Decoding Procedure\nfunction decodeRefinement(\n width,\n height,\n templateIndex,\n referenceBitmap,\n offsetX,\n offsetY,\n prediction,\n at,\n decodingContext\n) {\n let codingTemplate = RefinementTemplates[templateIndex].coding;\n if (templateIndex === 0) {\n codingTemplate = codingTemplate.concat([at[0]]);\n }\n const codingTemplateLength = codingTemplate.length;\n const codingTemplateX = new Int32Array(codingTemplateLength);\n const codingTemplateY = new Int32Array(codingTemplateLength);\n let k;\n for (k = 0; k < codingTemplateLength; k++) {\n codingTemplateX[k] = codingTemplate[k].x;\n codingTemplateY[k] = codingTemplate[k].y;\n }\n\n let referenceTemplate = RefinementTemplates[templateIndex].reference;\n if (templateIndex === 0) {\n referenceTemplate = referenceTemplate.concat([at[1]]);\n }\n const referenceTemplateLength = referenceTemplate.length;\n const referenceTemplateX = new Int32Array(referenceTemplateLength);\n const referenceTemplateY = new Int32Array(referenceTemplateLength);\n for (k = 0; k < referenceTemplateLength; k++) {\n referenceTemplateX[k] = referenceTemplate[k].x;\n referenceTemplateY[k] = referenceTemplate[k].y;\n }\n const referenceWidth = referenceBitmap[0].length;\n const referenceHeight = referenceBitmap.length;\n\n const pseudoPixelContext = RefinementReusedContexts[templateIndex];\n const bitmap = [];\n\n const decoder = decodingContext.decoder;\n const contexts = decodingContext.contextCache.getContexts(\"GR\");\n\n let ltp = 0;\n for (let i = 0; i < height; i++) {\n if (prediction) {\n const sltp = decoder.readBit(contexts, pseudoPixelContext);\n ltp ^= sltp;\n if (ltp) {\n throw new Jbig2Error(\"prediction is not supported\");\n }\n }\n const row = new Uint8Array(width);\n bitmap.push(row);\n for (let j = 0; j < width; j++) {\n let i0, j0;\n let contextLabel = 0;\n for (k = 0; k < codingTemplateLength; k++) {\n i0 = i + codingTemplateY[k];\n j0 = j + codingTemplateX[k];\n if (i0 < 0 || j0 < 0 || j0 >= width) {\n contextLabel <<= 1; // out of bound pixel\n } else {\n contextLabel = (contextLabel << 1) | bitmap[i0][j0];\n }\n }\n for (k = 0; k < referenceTemplateLength; k++) {\n i0 = i + referenceTemplateY[k] - offsetY;\n j0 = j + referenceTemplateX[k] - offsetX;\n if (i0 < 0 || i0 >= referenceHeight || j0 < 0 || j0 >= referenceWidth) {\n contextLabel <<= 1; // out of bound pixel\n } else {\n contextLabel = (contextLabel << 1) | referenceBitmap[i0][j0];\n }\n }\n const pixel = decoder.readBit(contexts, contextLabel);\n row[j] = pixel;\n }\n }\n\n return bitmap;\n}\n\n// 6.5.5 Decoding the symbol dictionary\nfunction decodeSymbolDictionary(\n huffman,\n refinement,\n symbols,\n numberOfNewSymbols,\n numberOfExportedSymbols,\n huffmanTables,\n templateIndex,\n at,\n refinementTemplateIndex,\n refinementAt,\n decodingContext,\n huffmanInput\n) {\n if (huffman && refinement) {\n throw new Jbig2Error(\"symbol refinement with Huffman is not supported\");\n }\n\n const newSymbols = [];\n let currentHeight = 0;\n let symbolCodeLength = log2(symbols.length + numberOfNewSymbols);\n\n const decoder = decodingContext.decoder;\n const contextCache = decodingContext.contextCache;\n let tableB1, symbolWidths;\n if (huffman) {\n tableB1 = getStandardTable(1); // standard table B.1\n symbolWidths = [];\n symbolCodeLength = Math.max(symbolCodeLength, 1); // 6.5.8.2.3\n }\n\n while (newSymbols.length < numberOfNewSymbols) {\n const deltaHeight = huffman\n ? huffmanTables.tableDeltaHeight.decode(huffmanInput)\n : decodeInteger(contextCache, \"IADH\", decoder); // 6.5.6\n currentHeight += deltaHeight;\n let currentWidth = 0,\n totalWidth = 0;\n const firstSymbol = huffman ? symbolWidths.length : 0;\n while (true) {\n const deltaWidth = huffman\n ? huffmanTables.tableDeltaWidth.decode(huffmanInput)\n : decodeInteger(contextCache, \"IADW\", decoder); // 6.5.7\n if (deltaWidth === null) {\n break; // OOB\n }\n currentWidth += deltaWidth;\n totalWidth += currentWidth;\n let bitmap;\n if (refinement) {\n // 6.5.8.2 Refinement/aggregate-coded symbol bitmap\n const numberOfInstances = decodeInteger(contextCache, \"IAAI\", decoder);\n if (numberOfInstances > 1) {\n bitmap = decodeTextRegion(\n huffman,\n refinement,\n currentWidth,\n currentHeight,\n 0,\n numberOfInstances,\n 1, // strip size\n symbols.concat(newSymbols),\n symbolCodeLength,\n 0, // transposed\n 0, // ds offset\n 1, // top left 7.4.3.1.1\n 0, // OR operator\n huffmanTables,\n refinementTemplateIndex,\n refinementAt,\n decodingContext,\n 0,\n huffmanInput\n );\n } else {\n const symbolId = decodeIAID(contextCache, decoder, symbolCodeLength);\n const rdx = decodeInteger(contextCache, \"IARDX\", decoder); // 6.4.11.3\n const rdy = decodeInteger(contextCache, \"IARDY\", decoder); // 6.4.11.4\n const symbol =\n symbolId < symbols.length\n ? symbols[symbolId]\n : newSymbols[symbolId - symbols.length];\n bitmap = decodeRefinement(\n currentWidth,\n currentHeight,\n refinementTemplateIndex,\n symbol,\n rdx,\n rdy,\n false,\n refinementAt,\n decodingContext\n );\n }\n newSymbols.push(bitmap);\n } else if (huffman) {\n // Store only symbol width and decode a collective bitmap when the\n // height class is done.\n symbolWidths.push(currentWidth);\n } else {\n // 6.5.8.1 Direct-coded symbol bitmap\n bitmap = decodeBitmap(\n false,\n currentWidth,\n currentHeight,\n templateIndex,\n false,\n null,\n at,\n decodingContext\n );\n newSymbols.push(bitmap);\n }\n }\n if (huffman && !refinement) {\n // 6.5.9 Height class collective bitmap\n const bitmapSize = huffmanTables.tableBitmapSize.decode(huffmanInput);\n huffmanInput.byteAlign();\n let collectiveBitmap;\n if (bitmapSize === 0) {\n // Uncompressed collective bitmap\n collectiveBitmap = readUncompressedBitmap(\n huffmanInput,\n totalWidth,\n currentHeight\n );\n } else {\n // MMR collective bitmap\n const originalEnd = huffmanInput.end;\n const bitmapEnd = huffmanInput.position + bitmapSize;\n huffmanInput.end = bitmapEnd;\n collectiveBitmap = decodeMMRBitmap(\n huffmanInput,\n totalWidth,\n currentHeight,\n false\n );\n huffmanInput.end = originalEnd;\n huffmanInput.position = bitmapEnd;\n }\n const numberOfSymbolsDecoded = symbolWidths.length;\n if (firstSymbol === numberOfSymbolsDecoded - 1) {\n // collectiveBitmap is a single symbol.\n newSymbols.push(collectiveBitmap);\n } else {\n // Divide collectiveBitmap into symbols.\n let i,\n y,\n xMin = 0,\n xMax,\n bitmapWidth,\n symbolBitmap;\n for (i = firstSymbol; i < numberOfSymbolsDecoded; i++) {\n bitmapWidth = symbolWidths[i];\n xMax = xMin + bitmapWidth;\n symbolBitmap = [];\n for (y = 0; y < currentHeight; y++) {\n symbolBitmap.push(collectiveBitmap[y].subarray(xMin, xMax));\n }\n newSymbols.push(symbolBitmap);\n xMin = xMax;\n }\n }\n }\n }\n\n // 6.5.10 Exported symbols\n const exportedSymbols = [],\n flags = [];\n let currentFlag = false,\n i,\n ii;\n const totalSymbolsLength = symbols.length + numberOfNewSymbols;\n while (flags.length < totalSymbolsLength) {\n let runLength = huffman\n ? tableB1.decode(huffmanInput)\n : decodeInteger(contextCache, \"IAEX\", decoder);\n while (runLength--) {\n flags.push(currentFlag);\n }\n currentFlag = !currentFlag;\n }\n for (i = 0, ii = symbols.length; i < ii; i++) {\n if (flags[i]) {\n exportedSymbols.push(symbols[i]);\n }\n }\n for (let j = 0; j < numberOfNewSymbols; i++, j++) {\n if (flags[i]) {\n exportedSymbols.push(newSymbols[j]);\n }\n }\n return exportedSymbols;\n}\n\nfunction decodeTextRegion(\n huffman,\n refinement,\n width,\n height,\n defaultPixelValue,\n numberOfSymbolInstances,\n stripSize,\n inputSymbols,\n symbolCodeLength,\n transposed,\n dsOffset,\n referenceCorner,\n combinationOperator,\n huffmanTables,\n refinementTemplateIndex,\n refinementAt,\n decodingContext,\n logStripSize,\n huffmanInput\n) {\n if (huffman && refinement) {\n throw new Jbig2Error(\"refinement with Huffman is not supported\");\n }\n\n // Prepare bitmap\n const bitmap = [];\n let i, row;\n for (i = 0; i < height; i++) {\n row = new Uint8Array(width);\n if (defaultPixelValue) {\n for (let j = 0; j < width; j++) {\n row[j] = defaultPixelValue;\n }\n }\n bitmap.push(row);\n }\n\n const decoder = decodingContext.decoder;\n const contextCache = decodingContext.contextCache;\n\n let stripT = huffman\n ? -huffmanTables.tableDeltaT.decode(huffmanInput)\n : -decodeInteger(contextCache, \"IADT\", decoder); // 6.4.6\n let firstS = 0;\n i = 0;\n while (i < numberOfSymbolInstances) {\n const deltaT = huffman\n ? huffmanTables.tableDeltaT.decode(huffmanInput)\n : decodeInteger(contextCache, \"IADT\", decoder); // 6.4.6\n stripT += deltaT;\n\n const deltaFirstS = huffman\n ? huffmanTables.tableFirstS.decode(huffmanInput)\n : decodeInteger(contextCache, \"IAFS\", decoder); // 6.4.7\n firstS += deltaFirstS;\n let currentS = firstS;\n do {\n let currentT = 0; // 6.4.9\n if (stripSize > 1) {\n currentT = huffman\n ? huffmanInput.readBits(logStripSize)\n : decodeInteger(contextCache, \"IAIT\", decoder);\n }\n const t = stripSize * stripT + currentT;\n const symbolId = huffman\n ? huffmanTables.symbolIDTable.decode(huffmanInput)\n : decodeIAID(contextCache, decoder, symbolCodeLength);\n const applyRefinement =\n refinement &&\n (huffman\n ? huffmanInput.readBit()\n : decodeInteger(contextCache, \"IARI\", decoder));\n let symbolBitmap = inputSymbols[symbolId];\n let symbolWidth = symbolBitmap[0].length;\n let symbolHeight = symbolBitmap.length;\n if (applyRefinement) {\n const rdw = decodeInteger(contextCache, \"IARDW\", decoder); // 6.4.11.1\n const rdh = decodeInteger(contextCache, \"IARDH\", decoder); // 6.4.11.2\n const rdx = decodeInteger(contextCache, \"IARDX\", decoder); // 6.4.11.3\n const rdy = decodeInteger(contextCache, \"IARDY\", decoder); // 6.4.11.4\n symbolWidth += rdw;\n symbolHeight += rdh;\n symbolBitmap = decodeRefinement(\n symbolWidth,\n symbolHeight,\n refinementTemplateIndex,\n symbolBitmap,\n (rdw >> 1) + rdx,\n (rdh >> 1) + rdy,\n false,\n refinementAt,\n decodingContext\n );\n }\n const offsetT = t - (referenceCorner & 1 ? 0 : symbolHeight - 1);\n const offsetS = currentS - (referenceCorner & 2 ? symbolWidth - 1 : 0);\n let s2, t2, symbolRow;\n if (transposed) {\n // Place Symbol Bitmap from T1,S1\n for (s2 = 0; s2 < symbolHeight; s2++) {\n row = bitmap[offsetS + s2];\n if (!row) {\n continue;\n }\n symbolRow = symbolBitmap[s2];\n // To ignore Parts of Symbol bitmap which goes\n // outside bitmap region\n const maxWidth = Math.min(width - offsetT, symbolWidth);\n switch (combinationOperator) {\n case 0: // OR\n for (t2 = 0; t2 < maxWidth; t2++) {\n row[offsetT + t2] |= symbolRow[t2];\n }\n break;\n case 2: // XOR\n for (t2 = 0; t2 < maxWidth; t2++) {\n row[offsetT + t2] ^= symbolRow[t2];\n }\n break;\n default:\n throw new Jbig2Error(\n `operator ${combinationOperator} is not supported`\n );\n }\n }\n currentS += symbolHeight - 1;\n } else {\n for (t2 = 0; t2 < symbolHeight; t2++) {\n row = bitmap[offsetT + t2];\n if (!row) {\n continue;\n }\n symbolRow = symbolBitmap[t2];\n switch (combinationOperator) {\n case 0: // OR\n for (s2 = 0; s2 < symbolWidth; s2++) {\n row[offsetS + s2] |= symbolRow[s2];\n }\n break;\n case 2: // XOR\n for (s2 = 0; s2 < symbolWidth; s2++) {\n row[offsetS + s2] ^= symbolRow[s2];\n }\n break;\n default:\n throw new Jbig2Error(\n `operator ${combinationOperator} is not supported`\n );\n }\n }\n currentS += symbolWidth - 1;\n }\n i++;\n const deltaS = huffman\n ? huffmanTables.tableDeltaS.decode(huffmanInput)\n : decodeInteger(contextCache, \"IADS\", decoder); // 6.4.8\n if (deltaS === null) {\n break; // OOB\n }\n currentS += deltaS + dsOffset;\n } while (true);\n }\n return bitmap;\n}\n\nfunction decodePatternDictionary(\n mmr,\n patternWidth,\n patternHeight,\n maxPatternIndex,\n template,\n decodingContext\n) {\n const at = [];\n if (!mmr) {\n at.push({\n x: -patternWidth,\n y: 0,\n });\n if (template === 0) {\n at.push(\n {\n x: -3,\n y: -1,\n },\n {\n x: 2,\n y: -2,\n },\n {\n x: -2,\n y: -2,\n }\n );\n }\n }\n const collectiveWidth = (maxPatternIndex + 1) * patternWidth;\n const collectiveBitmap = decodeBitmap(\n mmr,\n collectiveWidth,\n patternHeight,\n template,\n false,\n null,\n at,\n decodingContext\n );\n // Divide collective bitmap into patterns.\n const patterns = [];\n for (let i = 0; i <= maxPatternIndex; i++) {\n const patternBitmap = [];\n const xMin = patternWidth * i;\n const xMax = xMin + patternWidth;\n for (let y = 0; y < patternHeight; y++) {\n patternBitmap.push(collectiveBitmap[y].subarray(xMin, xMax));\n }\n patterns.push(patternBitmap);\n }\n return patterns;\n}\n\nfunction decodeHalftoneRegion(\n mmr,\n patterns,\n template,\n regionWidth,\n regionHeight,\n defaultPixelValue,\n enableSkip,\n combinationOperator,\n gridWidth,\n gridHeight,\n gridOffsetX,\n gridOffsetY,\n gridVectorX,\n gridVectorY,\n decodingContext\n) {\n const skip = null;\n if (enableSkip) {\n throw new Jbig2Error(\"skip is not supported\");\n }\n if (combinationOperator !== 0) {\n throw new Jbig2Error(\n `operator \"${combinationOperator}\" is not supported in halftone region`\n );\n }\n\n // Prepare bitmap.\n const regionBitmap = [];\n let i, j, row;\n for (i = 0; i < regionHeight; i++) {\n row = new Uint8Array(regionWidth);\n if (defaultPixelValue) {\n for (j = 0; j < regionWidth; j++) {\n row[j] = defaultPixelValue;\n }\n }\n regionBitmap.push(row);\n }\n\n const numberOfPatterns = patterns.length;\n const pattern0 = patterns[0];\n const patternWidth = pattern0[0].length,\n patternHeight = pattern0.length;\n const bitsPerValue = log2(numberOfPatterns);\n const at = [];\n if (!mmr) {\n at.push({\n x: template <= 1 ? 3 : 2,\n y: -1,\n });\n if (template === 0) {\n at.push(\n {\n x: -3,\n y: -1,\n },\n {\n x: 2,\n y: -2,\n },\n {\n x: -2,\n y: -2,\n }\n );\n }\n }\n // Annex C. Gray-scale Image Decoding Procedure.\n const grayScaleBitPlanes = [];\n let mmrInput, bitmap;\n if (mmr) {\n // MMR bit planes are in one continuous stream. Only EOFB codes indicate\n // the end of each bitmap, so EOFBs must be decoded.\n mmrInput = new Reader(\n decodingContext.data,\n decodingContext.start,\n decodingContext.end\n );\n }\n for (i = bitsPerValue - 1; i >= 0; i--) {\n if (mmr) {\n bitmap = decodeMMRBitmap(mmrInput, gridWidth, gridHeight, true);\n } else {\n bitmap = decodeBitmap(\n false,\n gridWidth,\n gridHeight,\n template,\n false,\n skip,\n at,\n decodingContext\n );\n }\n grayScaleBitPlanes[i] = bitmap;\n }\n // 6.6.5.2 Rendering the patterns.\n let mg, ng, bit, patternIndex, patternBitmap, x, y, patternRow, regionRow;\n for (mg = 0; mg < gridHeight; mg++) {\n for (ng = 0; ng < gridWidth; ng++) {\n bit = 0;\n patternIndex = 0;\n for (j = bitsPerValue - 1; j >= 0; j--) {\n bit ^= grayScaleBitPlanes[j][mg][ng]; // Gray decoding\n patternIndex |= bit << j;\n }\n patternBitmap = patterns[patternIndex];\n x = (gridOffsetX + mg * gridVectorY + ng * gridVectorX) >> 8;\n y = (gridOffsetY + mg * gridVectorX - ng * gridVectorY) >> 8;\n // Draw patternBitmap at (x, y).\n if (\n x >= 0 &&\n x + patternWidth <= regionWidth &&\n y >= 0 &&\n y + patternHeight <= regionHeight\n ) {\n for (i = 0; i < patternHeight; i++) {\n regionRow = regionBitmap[y + i];\n patternRow = patternBitmap[i];\n for (j = 0; j < patternWidth; j++) {\n regionRow[x + j] |= patternRow[j];\n }\n }\n } else {\n let regionX, regionY;\n for (i = 0; i < patternHeight; i++) {\n regionY = y + i;\n if (regionY < 0 || regionY >= regionHeight) {\n continue;\n }\n regionRow = regionBitmap[regionY];\n patternRow = patternBitmap[i];\n for (j = 0; j < patternWidth; j++) {\n regionX = x + j;\n if (regionX >= 0 && regionX < regionWidth) {\n regionRow[regionX] |= patternRow[j];\n }\n }\n }\n }\n }\n }\n return regionBitmap;\n}\n\nfunction readSegmentHeader(data, start) {\n const segmentHeader = {};\n segmentHeader.number = readUint32(data, start);\n const flags = data[start + 4];\n const segmentType = flags & 0x3f;\n if (!SegmentTypes[segmentType]) {\n throw new Jbig2Error(\"invalid segment type: \" + segmentType);\n }\n segmentHeader.type = segmentType;\n segmentHeader.typeName = SegmentTypes[segmentType];\n segmentHeader.deferredNonRetain = !!(flags & 0x80);\n\n const pageAssociationFieldSize = !!(flags & 0x40);\n const referredFlags = data[start + 5];\n let referredToCount = (referredFlags >> 5) & 7;\n const retainBits = [referredFlags & 31];\n let position = start + 6;\n if (referredFlags === 7) {\n referredToCount = readUint32(data, position - 1) & 0x1fffffff;\n position += 3;\n let bytes = (referredToCount + 7) >> 3;\n retainBits[0] = data[position++];\n while (--bytes > 0) {\n retainBits.push(data[position++]);\n }\n } else if (referredFlags === 5 || referredFlags === 6) {\n throw new Jbig2Error(\"invalid referred-to flags\");\n }\n\n segmentHeader.retainBits = retainBits;\n\n let referredToSegmentNumberSize = 4;\n if (segmentHeader.number <= 256) {\n referredToSegmentNumberSize = 1;\n } else if (segmentHeader.number <= 65536) {\n referredToSegmentNumberSize = 2;\n }\n const referredTo = [];\n let i, ii;\n for (i = 0; i < referredToCount; i++) {\n let number;\n if (referredToSegmentNumberSize === 1) {\n number = data[position];\n } else if (referredToSegmentNumberSize === 2) {\n number = readUint16(data, position);\n } else {\n number = readUint32(data, position);\n }\n referredTo.push(number);\n position += referredToSegmentNumberSize;\n }\n segmentHeader.referredTo = referredTo;\n if (!pageAssociationFieldSize) {\n segmentHeader.pageAssociation = data[position++];\n } else {\n segmentHeader.pageAssociation = readUint32(data, position);\n position += 4;\n }\n segmentHeader.length = readUint32(data, position);\n position += 4;\n\n if (segmentHeader.length === 0xffffffff) {\n // 7.2.7 Segment data length, unknown segment length\n if (segmentType === 38) {\n // ImmediateGenericRegion\n const genericRegionInfo = readRegionSegmentInformation(data, position);\n const genericRegionSegmentFlags =\n data[position + RegionSegmentInformationFieldLength];\n const genericRegionMmr = !!(genericRegionSegmentFlags & 1);\n // searching for the segment end\n const searchPatternLength = 6;\n const searchPattern = new Uint8Array(searchPatternLength);\n if (!genericRegionMmr) {\n searchPattern[0] = 0xff;\n searchPattern[1] = 0xac;\n }\n searchPattern[2] = (genericRegionInfo.height >>> 24) & 0xff;\n searchPattern[3] = (genericRegionInfo.height >> 16) & 0xff;\n searchPattern[4] = (genericRegionInfo.height >> 8) & 0xff;\n searchPattern[5] = genericRegionInfo.height & 0xff;\n for (i = position, ii = data.length; i < ii; i++) {\n let j = 0;\n while (j < searchPatternLength && searchPattern[j] === data[i + j]) {\n j++;\n }\n if (j === searchPatternLength) {\n segmentHeader.length = i + searchPatternLength;\n break;\n }\n }\n if (segmentHeader.length === 0xffffffff) {\n throw new Jbig2Error(\"segment end was not found\");\n }\n } else {\n throw new Jbig2Error(\"invalid unknown segment length\");\n }\n }\n segmentHeader.headerEnd = position;\n return segmentHeader;\n}\n\nfunction readSegments(header, data, start, end) {\n const segments = [];\n let position = start;\n while (position < end) {\n const segmentHeader = readSegmentHeader(data, position);\n position = segmentHeader.headerEnd;\n const segment = {\n header: segmentHeader,\n data,\n };\n if (!header.randomAccess) {\n segment.start = position;\n position += segmentHeader.length;\n segment.end = position;\n }\n segments.push(segment);\n if (segmentHeader.type === 51) {\n break; // end of file is found\n }\n }\n if (header.randomAccess) {\n for (let i = 0, ii = segments.length; i < ii; i++) {\n segments[i].start = position;\n position += segments[i].header.length;\n segments[i].end = position;\n }\n }\n return segments;\n}\n\n// 7.4.1 Region segment information field\nfunction readRegionSegmentInformation(data, start) {\n return {\n width: readUint32(data, start),\n height: readUint32(data, start + 4),\n x: readUint32(data, start + 8),\n y: readUint32(data, start + 12),\n combinationOperator: data[start + 16] & 7,\n };\n}\nconst RegionSegmentInformationFieldLength = 17;\n\nfunction processSegment(segment, visitor) {\n const header = segment.header;\n\n const data = segment.data,\n end = segment.end;\n let position = segment.start;\n let args, at, i, atLength;\n switch (header.type) {\n case 0: // SymbolDictionary\n // 7.4.2 Symbol dictionary segment syntax\n const dictionary = {};\n const dictionaryFlags = readUint16(data, position); // 7.4.2.1.1\n dictionary.huffman = !!(dictionaryFlags & 1);\n dictionary.refinement = !!(dictionaryFlags & 2);\n dictionary.huffmanDHSelector = (dictionaryFlags >> 2) & 3;\n dictionary.huffmanDWSelector = (dictionaryFlags >> 4) & 3;\n dictionary.bitmapSizeSelector = (dictionaryFlags >> 6) & 1;\n dictionary.aggregationInstancesSelector = (dictionaryFlags >> 7) & 1;\n dictionary.bitmapCodingContextUsed = !!(dictionaryFlags & 256);\n dictionary.bitmapCodingContextRetained = !!(dictionaryFlags & 512);\n dictionary.template = (dictionaryFlags >> 10) & 3;\n dictionary.refinementTemplate = (dictionaryFlags >> 12) & 1;\n position += 2;\n if (!dictionary.huffman) {\n atLength = dictionary.template === 0 ? 4 : 1;\n at = [];\n for (i = 0; i < atLength; i++) {\n at.push({\n x: readInt8(data, position),\n y: readInt8(data, position + 1),\n });\n position += 2;\n }\n dictionary.at = at;\n }\n if (dictionary.refinement && !dictionary.refinementTemplate) {\n at = [];\n for (i = 0; i < 2; i++) {\n at.push({\n x: readInt8(data, position),\n y: readInt8(data, position + 1),\n });\n position += 2;\n }\n dictionary.refinementAt = at;\n }\n dictionary.numberOfExportedSymbols = readUint32(data, position);\n position += 4;\n dictionary.numberOfNewSymbols = readUint32(data, position);\n position += 4;\n args = [\n dictionary,\n header.number,\n header.referredTo,\n data,\n position,\n end,\n ];\n break;\n case 6: // ImmediateTextRegion\n case 7: // ImmediateLosslessTextRegion\n const textRegion = {};\n textRegion.info = readRegionSegmentInformation(data, position);\n position += RegionSegmentInformationFieldLength;\n const textRegionSegmentFlags = readUint16(data, position);\n position += 2;\n textRegion.huffman = !!(textRegionSegmentFlags & 1);\n textRegion.refinement = !!(textRegionSegmentFlags & 2);\n textRegion.logStripSize = (textRegionSegmentFlags >> 2) & 3;\n textRegion.stripSize = 1 << textRegion.logStripSize;\n textRegion.referenceCorner = (textRegionSegmentFlags >> 4) & 3;\n textRegion.transposed = !!(textRegionSegmentFlags & 64);\n textRegion.combinationOperator = (textRegionSegmentFlags >> 7) & 3;\n textRegion.defaultPixelValue = (textRegionSegmentFlags >> 9) & 1;\n textRegion.dsOffset = (textRegionSegmentFlags << 17) >> 27;\n textRegion.refinementTemplate = (textRegionSegmentFlags >> 15) & 1;\n if (textRegion.huffman) {\n const textRegionHuffmanFlags = readUint16(data, position);\n position += 2;\n textRegion.huffmanFS = textRegionHuffmanFlags & 3;\n textRegion.huffmanDS = (textRegionHuffmanFlags >> 2) & 3;\n textRegion.huffmanDT = (textRegionHuffmanFlags >> 4) & 3;\n textRegion.huffmanRefinementDW = (textRegionHuffmanFlags >> 6) & 3;\n textRegion.huffmanRefinementDH = (textRegionHuffmanFlags >> 8) & 3;\n textRegion.huffmanRefinementDX = (textRegionHuffmanFlags >> 10) & 3;\n textRegion.huffmanRefinementDY = (textRegionHuffmanFlags >> 12) & 3;\n textRegion.huffmanRefinementSizeSelector = !!(\n textRegionHuffmanFlags & 0x4000\n );\n }\n if (textRegion.refinement && !textRegion.refinementTemplate) {\n at = [];\n for (i = 0; i < 2; i++) {\n at.push({\n x: readInt8(data, position),\n y: readInt8(data, position + 1),\n });\n position += 2;\n }\n textRegion.refinementAt = at;\n }\n textRegion.numberOfSymbolInstances = readUint32(data, position);\n position += 4;\n args = [textRegion, header.referredTo, data, position, end];\n break;\n case 16: // PatternDictionary\n // 7.4.4. Pattern dictionary segment syntax\n const patternDictionary = {};\n const patternDictionaryFlags = data[position++];\n patternDictionary.mmr = !!(patternDictionaryFlags & 1);\n patternDictionary.template = (patternDictionaryFlags >> 1) & 3;\n patternDictionary.patternWidth = data[position++];\n patternDictionary.patternHeight = data[position++];\n patternDictionary.maxPatternIndex = readUint32(data, position);\n position += 4;\n args = [patternDictionary, header.number, data, position, end];\n break;\n case 22: // ImmediateHalftoneRegion\n case 23: // ImmediateLosslessHalftoneRegion\n // 7.4.5 Halftone region segment syntax\n const halftoneRegion = {};\n halftoneRegion.info = readRegionSegmentInformation(data, position);\n position += RegionSegmentInformationFieldLength;\n const halftoneRegionFlags = data[position++];\n halftoneRegion.mmr = !!(halftoneRegionFlags & 1);\n halftoneRegion.template = (halftoneRegionFlags >> 1) & 3;\n halftoneRegion.enableSkip = !!(halftoneRegionFlags & 8);\n halftoneRegion.combinationOperator = (halftoneRegionFlags >> 4) & 7;\n halftoneRegion.defaultPixelValue = (halftoneRegionFlags >> 7) & 1;\n halftoneRegion.gridWidth = readUint32(data, position);\n position += 4;\n halftoneRegion.gridHeight = readUint32(data, position);\n position += 4;\n halftoneRegion.gridOffsetX = readUint32(data, position) & 0xffffffff;\n position += 4;\n halftoneRegion.gridOffsetY = readUint32(data, position) & 0xffffffff;\n position += 4;\n halftoneRegion.gridVectorX = readUint16(data, position);\n position += 2;\n halftoneRegion.gridVectorY = readUint16(data, position);\n position += 2;\n args = [halftoneRegion, header.referredTo, data, position, end];\n break;\n case 38: // ImmediateGenericRegion\n case 39: // ImmediateLosslessGenericRegion\n const genericRegion = {};\n genericRegion.info = readRegionSegmentInformation(data, position);\n position += RegionSegmentInformationFieldLength;\n const genericRegionSegmentFlags = data[position++];\n genericRegion.mmr = !!(genericRegionSegmentFlags & 1);\n genericRegion.template = (genericRegionSegmentFlags >> 1) & 3;\n genericRegion.prediction = !!(genericRegionSegmentFlags & 8);\n if (!genericRegion.mmr) {\n atLength = genericRegion.template === 0 ? 4 : 1;\n at = [];\n for (i = 0; i < atLength; i++) {\n at.push({\n x: readInt8(data, position),\n y: readInt8(data, position + 1),\n });\n position += 2;\n }\n genericRegion.at = at;\n }\n args = [genericRegion, data, position, end];\n break;\n case 48: // PageInformation\n const pageInfo = {\n width: readUint32(data, position),\n height: readUint32(data, position + 4),\n resolutionX: readUint32(data, position + 8),\n resolutionY: readUint32(data, position + 12),\n };\n if (pageInfo.height === 0xffffffff) {\n delete pageInfo.height;\n }\n const pageSegmentFlags = data[position + 16];\n readUint16(data, position + 17); // pageStripingInformation\n pageInfo.lossless = !!(pageSegmentFlags & 1);\n pageInfo.refinement = !!(pageSegmentFlags & 2);\n pageInfo.defaultPixelValue = (pageSegmentFlags >> 2) & 1;\n pageInfo.combinationOperator = (pageSegmentFlags >> 3) & 3;\n pageInfo.requiresBuffer = !!(pageSegmentFlags & 32);\n pageInfo.combinationOperatorOverride = !!(pageSegmentFlags & 64);\n args = [pageInfo];\n break;\n case 49: // EndOfPage\n break;\n case 50: // EndOfStripe\n break;\n case 51: // EndOfFile\n break;\n case 53: // Tables\n args = [header.number, data, position, end];\n break;\n case 62: // 7.4.15 defines 2 extension types which\n // are comments and can be ignored.\n break;\n default:\n throw new Jbig2Error(\n `segment type ${header.typeName}(${header.type}) is not implemented`\n );\n }\n const callbackName = \"on\" + header.typeName;\n if (callbackName in visitor) {\n // eslint-disable-next-line prefer-spread\n visitor[callbackName].apply(visitor, args);\n }\n}\n\nfunction processSegments(segments, visitor) {\n for (let i = 0, ii = segments.length; i < ii; i++) {\n processSegment(segments[i], visitor);\n }\n}\n\nfunction parseJbig2Chunks(chunks) {\n const visitor = new SimpleSegmentVisitor();\n for (let i = 0, ii = chunks.length; i < ii; i++) {\n const chunk = chunks[i];\n const segments = readSegments({}, chunk.data, chunk.start, chunk.end);\n processSegments(segments, visitor);\n }\n return visitor.buffer;\n}\n\nfunction parseJbig2(data) {\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"IMAGE_DECODERS\")) {\n throw new Error(\"Not implemented: parseJbig2\");\n }\n const end = data.length;\n let position = 0;\n\n if (\n data[position] !== 0x97 ||\n data[position + 1] !== 0x4a ||\n data[position + 2] !== 0x42 ||\n data[position + 3] !== 0x32 ||\n data[position + 4] !== 0x0d ||\n data[position + 5] !== 0x0a ||\n data[position + 6] !== 0x1a ||\n data[position + 7] !== 0x0a\n ) {\n throw new Jbig2Error(\"parseJbig2 - invalid header.\");\n }\n\n const header = Object.create(null);\n position += 8;\n const flags = data[position++];\n header.randomAccess = !(flags & 1);\n if (!(flags & 2)) {\n header.numberOfPages = readUint32(data, position);\n position += 4;\n }\n\n const segments = readSegments(header, data, position, end);\n const visitor = new SimpleSegmentVisitor();\n processSegments(segments, visitor);\n\n const { width, height } = visitor.currentPageInfo;\n const bitPacked = visitor.buffer;\n const imgData = new Uint8ClampedArray(width * height);\n let q = 0,\n k = 0;\n for (let i = 0; i < height; i++) {\n let mask = 0,\n buffer;\n for (let j = 0; j < width; j++) {\n if (!mask) {\n mask = 128;\n buffer = bitPacked[k++];\n }\n imgData[q++] = buffer & mask ? 0 : 255;\n mask >>= 1;\n }\n }\n\n return { imgData, width, height };\n}\n\nclass SimpleSegmentVisitor {\n onPageInformation(info) {\n this.currentPageInfo = info;\n const rowSize = (info.width + 7) >> 3;\n const buffer = new Uint8ClampedArray(rowSize * info.height);\n // The contents of ArrayBuffers are initialized to 0.\n // Fill the buffer with 0xFF only if info.defaultPixelValue is set\n if (info.defaultPixelValue) {\n buffer.fill(0xff);\n }\n this.buffer = buffer;\n }\n\n drawBitmap(regionInfo, bitmap) {\n const pageInfo = this.currentPageInfo;\n const width = regionInfo.width,\n height = regionInfo.height;\n const rowSize = (pageInfo.width + 7) >> 3;\n const combinationOperator = pageInfo.combinationOperatorOverride\n ? regionInfo.combinationOperator\n : pageInfo.combinationOperator;\n const buffer = this.buffer;\n const mask0 = 128 >> (regionInfo.x & 7);\n let offset0 = regionInfo.y * rowSize + (regionInfo.x >> 3);\n let i, j, mask, offset;\n switch (combinationOperator) {\n case 0: // OR\n for (i = 0; i < height; i++) {\n mask = mask0;\n offset = offset0;\n for (j = 0; j < width; j++) {\n if (bitmap[i][j]) {\n buffer[offset] |= mask;\n }\n mask >>= 1;\n if (!mask) {\n mask = 128;\n offset++;\n }\n }\n offset0 += rowSize;\n }\n break;\n case 2: // XOR\n for (i = 0; i < height; i++) {\n mask = mask0;\n offset = offset0;\n for (j = 0; j < width; j++) {\n if (bitmap[i][j]) {\n buffer[offset] ^= mask;\n }\n mask >>= 1;\n if (!mask) {\n mask = 128;\n offset++;\n }\n }\n offset0 += rowSize;\n }\n break;\n default:\n throw new Jbig2Error(\n `operator ${combinationOperator} is not supported`\n );\n }\n }\n\n onImmediateGenericRegion(region, data, start, end) {\n const regionInfo = region.info;\n const decodingContext = new DecodingContext(data, start, end);\n const bitmap = decodeBitmap(\n region.mmr,\n regionInfo.width,\n regionInfo.height,\n region.template,\n region.prediction,\n null,\n region.at,\n decodingContext\n );\n this.drawBitmap(regionInfo, bitmap);\n }\n\n onImmediateLosslessGenericRegion() {\n this.onImmediateGenericRegion(...arguments);\n }\n\n onSymbolDictionary(\n dictionary,\n currentSegment,\n referredSegments,\n data,\n start,\n end\n ) {\n let huffmanTables, huffmanInput;\n if (dictionary.huffman) {\n huffmanTables = getSymbolDictionaryHuffmanTables(\n dictionary,\n referredSegments,\n this.customTables\n );\n huffmanInput = new Reader(data, start, end);\n }\n\n // Combines exported symbols from all referred segments\n let symbols = this.symbols;\n if (!symbols) {\n this.symbols = symbols = {};\n }\n\n const inputSymbols = [];\n for (const referredSegment of referredSegments) {\n const referredSymbols = symbols[referredSegment];\n // referredSymbols is undefined when we have a reference to a Tables\n // segment instead of a SymbolDictionary.\n if (referredSymbols) {\n inputSymbols.push(...referredSymbols);\n }\n }\n\n const decodingContext = new DecodingContext(data, start, end);\n symbols[currentSegment] = decodeSymbolDictionary(\n dictionary.huffman,\n dictionary.refinement,\n inputSymbols,\n dictionary.numberOfNewSymbols,\n dictionary.numberOfExportedSymbols,\n huffmanTables,\n dictionary.template,\n dictionary.at,\n dictionary.refinementTemplate,\n dictionary.refinementAt,\n decodingContext,\n huffmanInput\n );\n }\n\n onImmediateTextRegion(region, referredSegments, data, start, end) {\n const regionInfo = region.info;\n let huffmanTables, huffmanInput;\n\n // Combines exported symbols from all referred segments\n const symbols = this.symbols;\n const inputSymbols = [];\n for (const referredSegment of referredSegments) {\n const referredSymbols = symbols[referredSegment];\n // referredSymbols is undefined when we have a reference to a Tables\n // segment instead of a SymbolDictionary.\n if (referredSymbols) {\n inputSymbols.push(...referredSymbols);\n }\n }\n const symbolCodeLength = log2(inputSymbols.length);\n if (region.huffman) {\n huffmanInput = new Reader(data, start, end);\n huffmanTables = getTextRegionHuffmanTables(\n region,\n referredSegments,\n this.customTables,\n inputSymbols.length,\n huffmanInput\n );\n }\n\n const decodingContext = new DecodingContext(data, start, end);\n const bitmap = decodeTextRegion(\n region.huffman,\n region.refinement,\n regionInfo.width,\n regionInfo.height,\n region.defaultPixelValue,\n region.numberOfSymbolInstances,\n region.stripSize,\n inputSymbols,\n symbolCodeLength,\n region.transposed,\n region.dsOffset,\n region.referenceCorner,\n region.combinationOperator,\n huffmanTables,\n region.refinementTemplate,\n region.refinementAt,\n decodingContext,\n region.logStripSize,\n huffmanInput\n );\n this.drawBitmap(regionInfo, bitmap);\n }\n\n onImmediateLosslessTextRegion() {\n this.onImmediateTextRegion(...arguments);\n }\n\n onPatternDictionary(dictionary, currentSegment, data, start, end) {\n let patterns = this.patterns;\n if (!patterns) {\n this.patterns = patterns = {};\n }\n const decodingContext = new DecodingContext(data, start, end);\n patterns[currentSegment] = decodePatternDictionary(\n dictionary.mmr,\n dictionary.patternWidth,\n dictionary.patternHeight,\n dictionary.maxPatternIndex,\n dictionary.template,\n decodingContext\n );\n }\n\n onImmediateHalftoneRegion(region, referredSegments, data, start, end) {\n // HalftoneRegion refers to exactly one PatternDictionary.\n const patterns = this.patterns[referredSegments[0]];\n const regionInfo = region.info;\n const decodingContext = new DecodingContext(data, start, end);\n const bitmap = decodeHalftoneRegion(\n region.mmr,\n patterns,\n region.template,\n regionInfo.width,\n regionInfo.height,\n region.defaultPixelValue,\n region.enableSkip,\n region.combinationOperator,\n region.gridWidth,\n region.gridHeight,\n region.gridOffsetX,\n region.gridOffsetY,\n region.gridVectorX,\n region.gridVectorY,\n decodingContext\n );\n this.drawBitmap(regionInfo, bitmap);\n }\n\n onImmediateLosslessHalftoneRegion() {\n this.onImmediateHalftoneRegion(...arguments);\n }\n\n onTables(currentSegment, data, start, end) {\n let customTables = this.customTables;\n if (!customTables) {\n this.customTables = customTables = {};\n }\n customTables[currentSegment] = decodeTablesSegment(data, start, end);\n }\n}\n\nclass HuffmanLine {\n constructor(lineData) {\n if (lineData.length === 2) {\n // OOB line.\n this.isOOB = true;\n this.rangeLow = 0;\n this.prefixLength = lineData[0];\n this.rangeLength = 0;\n this.prefixCode = lineData[1];\n this.isLowerRange = false;\n } else {\n // Normal, upper range or lower range line.\n // Upper range lines are processed like normal lines.\n this.isOOB = false;\n this.rangeLow = lineData[0];\n this.prefixLength = lineData[1];\n this.rangeLength = lineData[2];\n this.prefixCode = lineData[3];\n this.isLowerRange = lineData[4] === \"lower\";\n }\n }\n}\n\nclass HuffmanTreeNode {\n constructor(line) {\n this.children = [];\n if (line) {\n // Leaf node\n this.isLeaf = true;\n this.rangeLength = line.rangeLength;\n this.rangeLow = line.rangeLow;\n this.isLowerRange = line.isLowerRange;\n this.isOOB = line.isOOB;\n } else {\n // Intermediate or root node\n this.isLeaf = false;\n }\n }\n\n buildTree(line, shift) {\n const bit = (line.prefixCode >> shift) & 1;\n if (shift <= 0) {\n // Create a leaf node.\n this.children[bit] = new HuffmanTreeNode(line);\n } else {\n // Create an intermediate node and continue recursively.\n let node = this.children[bit];\n if (!node) {\n this.children[bit] = node = new HuffmanTreeNode(null);\n }\n node.buildTree(line, shift - 1);\n }\n }\n\n decodeNode(reader) {\n if (this.isLeaf) {\n if (this.isOOB) {\n return null;\n }\n const htOffset = reader.readBits(this.rangeLength);\n return this.rangeLow + (this.isLowerRange ? -htOffset : htOffset);\n }\n const node = this.children[reader.readBit()];\n if (!node) {\n throw new Jbig2Error(\"invalid Huffman data\");\n }\n return node.decodeNode(reader);\n }\n}\n\nclass HuffmanTable {\n constructor(lines, prefixCodesDone) {\n if (!prefixCodesDone) {\n this.assignPrefixCodes(lines);\n }\n // Create Huffman tree.\n this.rootNode = new HuffmanTreeNode(null);\n for (let i = 0, ii = lines.length; i < ii; i++) {\n const line = lines[i];\n if (line.prefixLength > 0) {\n this.rootNode.buildTree(line, line.prefixLength - 1);\n }\n }\n }\n\n decode(reader) {\n return this.rootNode.decodeNode(reader);\n }\n\n assignPrefixCodes(lines) {\n // Annex B.3 Assigning the prefix codes.\n const linesLength = lines.length;\n let prefixLengthMax = 0;\n for (let i = 0; i < linesLength; i++) {\n prefixLengthMax = Math.max(prefixLengthMax, lines[i].prefixLength);\n }\n\n const histogram = new Uint32Array(prefixLengthMax + 1);\n for (let i = 0; i < linesLength; i++) {\n histogram[lines[i].prefixLength]++;\n }\n let currentLength = 1,\n firstCode = 0,\n currentCode,\n currentTemp,\n line;\n histogram[0] = 0;\n\n while (currentLength <= prefixLengthMax) {\n firstCode = (firstCode + histogram[currentLength - 1]) << 1;\n currentCode = firstCode;\n currentTemp = 0;\n while (currentTemp < linesLength) {\n line = lines[currentTemp];\n if (line.prefixLength === currentLength) {\n line.prefixCode = currentCode;\n currentCode++;\n }\n currentTemp++;\n }\n currentLength++;\n }\n }\n}\n\nfunction decodeTablesSegment(data, start, end) {\n // Decodes a Tables segment, i.e., a custom Huffman table.\n // Annex B.2 Code table structure.\n const flags = data[start];\n const lowestValue = readUint32(data, start + 1) & 0xffffffff;\n const highestValue = readUint32(data, start + 5) & 0xffffffff;\n const reader = new Reader(data, start + 9, end);\n\n const prefixSizeBits = ((flags >> 1) & 7) + 1;\n const rangeSizeBits = ((flags >> 4) & 7) + 1;\n const lines = [];\n let prefixLength,\n rangeLength,\n currentRangeLow = lowestValue;\n\n // Normal table lines\n do {\n prefixLength = reader.readBits(prefixSizeBits);\n rangeLength = reader.readBits(rangeSizeBits);\n lines.push(\n new HuffmanLine([currentRangeLow, prefixLength, rangeLength, 0])\n );\n currentRangeLow += 1 << rangeLength;\n } while (currentRangeLow < highestValue);\n\n // Lower range table line\n prefixLength = reader.readBits(prefixSizeBits);\n lines.push(new HuffmanLine([lowestValue - 1, prefixLength, 32, 0, \"lower\"]));\n\n // Upper range table line\n prefixLength = reader.readBits(prefixSizeBits);\n lines.push(new HuffmanLine([highestValue, prefixLength, 32, 0]));\n\n if (flags & 1) {\n // Out-of-band table line\n prefixLength = reader.readBits(prefixSizeBits);\n lines.push(new HuffmanLine([prefixLength, 0]));\n }\n\n return new HuffmanTable(lines, false);\n}\n\nconst standardTablesCache = {};\n\nfunction getStandardTable(number) {\n // Annex B.5 Standard Huffman tables.\n let table = standardTablesCache[number];\n if (table) {\n return table;\n }\n let lines;\n switch (number) {\n case 1:\n lines = [\n [0, 1, 4, 0x0],\n [16, 2, 8, 0x2],\n [272, 3, 16, 0x6],\n [65808, 3, 32, 0x7], // upper\n ];\n break;\n case 2:\n lines = [\n [0, 1, 0, 0x0],\n [1, 2, 0, 0x2],\n [2, 3, 0, 0x6],\n [3, 4, 3, 0xe],\n [11, 5, 6, 0x1e],\n [75, 6, 32, 0x3e], // upper\n [6, 0x3f], // OOB\n ];\n break;\n case 3:\n lines = [\n [-256, 8, 8, 0xfe],\n [0, 1, 0, 0x0],\n [1, 2, 0, 0x2],\n [2, 3, 0, 0x6],\n [3, 4, 3, 0xe],\n [11, 5, 6, 0x1e],\n [-257, 8, 32, 0xff, \"lower\"],\n [75, 7, 32, 0x7e], // upper\n [6, 0x3e], // OOB\n ];\n break;\n case 4:\n lines = [\n [1, 1, 0, 0x0],\n [2, 2, 0, 0x2],\n [3, 3, 0, 0x6],\n [4, 4, 3, 0xe],\n [12, 5, 6, 0x1e],\n [76, 5, 32, 0x1f], // upper\n ];\n break;\n case 5:\n lines = [\n [-255, 7, 8, 0x7e],\n [1, 1, 0, 0x0],\n [2, 2, 0, 0x2],\n [3, 3, 0, 0x6],\n [4, 4, 3, 0xe],\n [12, 5, 6, 0x1e],\n [-256, 7, 32, 0x7f, \"lower\"],\n [76, 6, 32, 0x3e], // upper\n ];\n break;\n case 6:\n lines = [\n [-2048, 5, 10, 0x1c],\n [-1024, 4, 9, 0x8],\n [-512, 4, 8, 0x9],\n [-256, 4, 7, 0xa],\n [-128, 5, 6, 0x1d],\n [-64, 5, 5, 0x1e],\n [-32, 4, 5, 0xb],\n [0, 2, 7, 0x0],\n [128, 3, 7, 0x2],\n [256, 3, 8, 0x3],\n [512, 4, 9, 0xc],\n [1024, 4, 10, 0xd],\n [-2049, 6, 32, 0x3e, \"lower\"],\n [2048, 6, 32, 0x3f], // upper\n ];\n break;\n case 7:\n lines = [\n [-1024, 4, 9, 0x8],\n [-512, 3, 8, 0x0],\n [-256, 4, 7, 0x9],\n [-128, 5, 6, 0x1a],\n [-64, 5, 5, 0x1b],\n [-32, 4, 5, 0xa],\n [0, 4, 5, 0xb],\n [32, 5, 5, 0x1c],\n [64, 5, 6, 0x1d],\n [128, 4, 7, 0xc],\n [256, 3, 8, 0x1],\n [512, 3, 9, 0x2],\n [1024, 3, 10, 0x3],\n [-1025, 5, 32, 0x1e, \"lower\"],\n [2048, 5, 32, 0x1f], // upper\n ];\n break;\n case 8:\n lines = [\n [-15, 8, 3, 0xfc],\n [-7, 9, 1, 0x1fc],\n [-5, 8, 1, 0xfd],\n [-3, 9, 0, 0x1fd],\n [-2, 7, 0, 0x7c],\n [-1, 4, 0, 0xa],\n [0, 2, 1, 0x0],\n [2, 5, 0, 0x1a],\n [3, 6, 0, 0x3a],\n [4, 3, 4, 0x4],\n [20, 6, 1, 0x3b],\n [22, 4, 4, 0xb],\n [38, 4, 5, 0xc],\n [70, 5, 6, 0x1b],\n [134, 5, 7, 0x1c],\n [262, 6, 7, 0x3c],\n [390, 7, 8, 0x7d],\n [646, 6, 10, 0x3d],\n [-16, 9, 32, 0x1fe, \"lower\"],\n [1670, 9, 32, 0x1ff], // upper\n [2, 0x1], // OOB\n ];\n break;\n case 9:\n lines = [\n [-31, 8, 4, 0xfc],\n [-15, 9, 2, 0x1fc],\n [-11, 8, 2, 0xfd],\n [-7, 9, 1, 0x1fd],\n [-5, 7, 1, 0x7c],\n [-3, 4, 1, 0xa],\n [-1, 3, 1, 0x2],\n [1, 3, 1, 0x3],\n [3, 5, 1, 0x1a],\n [5, 6, 1, 0x3a],\n [7, 3, 5, 0x4],\n [39, 6, 2, 0x3b],\n [43, 4, 5, 0xb],\n [75, 4, 6, 0xc],\n [139, 5, 7, 0x1b],\n [267, 5, 8, 0x1c],\n [523, 6, 8, 0x3c],\n [779, 7, 9, 0x7d],\n [1291, 6, 11, 0x3d],\n [-32, 9, 32, 0x1fe, \"lower\"],\n [3339, 9, 32, 0x1ff], // upper\n [2, 0x0], // OOB\n ];\n break;\n case 10:\n lines = [\n [-21, 7, 4, 0x7a],\n [-5, 8, 0, 0xfc],\n [-4, 7, 0, 0x7b],\n [-3, 5, 0, 0x18],\n [-2, 2, 2, 0x0],\n [2, 5, 0, 0x19],\n [3, 6, 0, 0x36],\n [4, 7, 0, 0x7c],\n [5, 8, 0, 0xfd],\n [6, 2, 6, 0x1],\n [70, 5, 5, 0x1a],\n [102, 6, 5, 0x37],\n [134, 6, 6, 0x38],\n [198, 6, 7, 0x39],\n [326, 6, 8, 0x3a],\n [582, 6, 9, 0x3b],\n [1094, 6, 10, 0x3c],\n [2118, 7, 11, 0x7d],\n [-22, 8, 32, 0xfe, \"lower\"],\n [4166, 8, 32, 0xff], // upper\n [2, 0x2], // OOB\n ];\n break;\n case 11:\n lines = [\n [1, 1, 0, 0x0],\n [2, 2, 1, 0x2],\n [4, 4, 0, 0xc],\n [5, 4, 1, 0xd],\n [7, 5, 1, 0x1c],\n [9, 5, 2, 0x1d],\n [13, 6, 2, 0x3c],\n [17, 7, 2, 0x7a],\n [21, 7, 3, 0x7b],\n [29, 7, 4, 0x7c],\n [45, 7, 5, 0x7d],\n [77, 7, 6, 0x7e],\n [141, 7, 32, 0x7f], // upper\n ];\n break;\n case 12:\n lines = [\n [1, 1, 0, 0x0],\n [2, 2, 0, 0x2],\n [3, 3, 1, 0x6],\n [5, 5, 0, 0x1c],\n [6, 5, 1, 0x1d],\n [8, 6, 1, 0x3c],\n [10, 7, 0, 0x7a],\n [11, 7, 1, 0x7b],\n [13, 7, 2, 0x7c],\n [17, 7, 3, 0x7d],\n [25, 7, 4, 0x7e],\n [41, 8, 5, 0xfe],\n [73, 8, 32, 0xff], // upper\n ];\n break;\n case 13:\n lines = [\n [1, 1, 0, 0x0],\n [2, 3, 0, 0x4],\n [3, 4, 0, 0xc],\n [4, 5, 0, 0x1c],\n [5, 4, 1, 0xd],\n [7, 3, 3, 0x5],\n [15, 6, 1, 0x3a],\n [17, 6, 2, 0x3b],\n [21, 6, 3, 0x3c],\n [29, 6, 4, 0x3d],\n [45, 6, 5, 0x3e],\n [77, 7, 6, 0x7e],\n [141, 7, 32, 0x7f], // upper\n ];\n break;\n case 14:\n lines = [\n [-2, 3, 0, 0x4],\n [-1, 3, 0, 0x5],\n [0, 1, 0, 0x0],\n [1, 3, 0, 0x6],\n [2, 3, 0, 0x7],\n ];\n break;\n case 15:\n lines = [\n [-24, 7, 4, 0x7c],\n [-8, 6, 2, 0x3c],\n [-4, 5, 1, 0x1c],\n [-2, 4, 0, 0xc],\n [-1, 3, 0, 0x4],\n [0, 1, 0, 0x0],\n [1, 3, 0, 0x5],\n [2, 4, 0, 0xd],\n [3, 5, 1, 0x1d],\n [5, 6, 2, 0x3d],\n [9, 7, 4, 0x7d],\n [-25, 7, 32, 0x7e, \"lower\"],\n [25, 7, 32, 0x7f], // upper\n ];\n break;\n default:\n throw new Jbig2Error(`standard table B.${number} does not exist`);\n }\n\n for (let i = 0, ii = lines.length; i < ii; i++) {\n lines[i] = new HuffmanLine(lines[i]);\n }\n table = new HuffmanTable(lines, true);\n standardTablesCache[number] = table;\n return table;\n}\n\nclass Reader {\n constructor(data, start, end) {\n this.data = data;\n this.start = start;\n this.end = end;\n this.position = start;\n this.shift = -1;\n this.currentByte = 0;\n }\n\n readBit() {\n if (this.shift < 0) {\n if (this.position >= this.end) {\n throw new Jbig2Error(\"end of data while reading bit\");\n }\n this.currentByte = this.data[this.position++];\n this.shift = 7;\n }\n const bit = (this.currentByte >> this.shift) & 1;\n this.shift--;\n return bit;\n }\n\n readBits(numBits) {\n let result = 0,\n i;\n for (i = numBits - 1; i >= 0; i--) {\n result |= this.readBit() << i;\n }\n return result;\n }\n\n byteAlign() {\n this.shift = -1;\n }\n\n next() {\n if (this.position >= this.end) {\n return -1;\n }\n return this.data[this.position++];\n }\n}\n\nfunction getCustomHuffmanTable(index, referredTo, customTables) {\n // Returns a Tables segment that has been earlier decoded.\n // See 7.4.2.1.6 (symbol dictionary) or 7.4.3.1.6 (text region).\n let currentIndex = 0;\n for (let i = 0, ii = referredTo.length; i < ii; i++) {\n const table = customTables[referredTo[i]];\n if (table) {\n if (index === currentIndex) {\n return table;\n }\n currentIndex++;\n }\n }\n throw new Jbig2Error(\"can't find custom Huffman table\");\n}\n\nfunction getTextRegionHuffmanTables(\n textRegion,\n referredTo,\n customTables,\n numberOfSymbols,\n reader\n) {\n // 7.4.3.1.7 Symbol ID Huffman table decoding\n\n // Read code lengths for RUNCODEs 0...34.\n const codes = [];\n for (let i = 0; i <= 34; i++) {\n const codeLength = reader.readBits(4);\n codes.push(new HuffmanLine([i, codeLength, 0, 0]));\n }\n // Assign Huffman codes for RUNCODEs.\n const runCodesTable = new HuffmanTable(codes, false);\n\n // Read a Huffman code using the assignment above.\n // Interpret the RUNCODE codes and the additional bits (if any).\n codes.length = 0;\n for (let i = 0; i < numberOfSymbols; ) {\n const codeLength = runCodesTable.decode(reader);\n if (codeLength >= 32) {\n let repeatedLength, numberOfRepeats, j;\n switch (codeLength) {\n case 32:\n if (i === 0) {\n throw new Jbig2Error(\"no previous value in symbol ID table\");\n }\n numberOfRepeats = reader.readBits(2) + 3;\n repeatedLength = codes[i - 1].prefixLength;\n break;\n case 33:\n numberOfRepeats = reader.readBits(3) + 3;\n repeatedLength = 0;\n break;\n case 34:\n numberOfRepeats = reader.readBits(7) + 11;\n repeatedLength = 0;\n break;\n default:\n throw new Jbig2Error(\"invalid code length in symbol ID table\");\n }\n for (j = 0; j < numberOfRepeats; j++) {\n codes.push(new HuffmanLine([i, repeatedLength, 0, 0]));\n i++;\n }\n } else {\n codes.push(new HuffmanLine([i, codeLength, 0, 0]));\n i++;\n }\n }\n reader.byteAlign();\n const symbolIDTable = new HuffmanTable(codes, false);\n\n // 7.4.3.1.6 Text region segment Huffman table selection\n\n let customIndex = 0,\n tableFirstS,\n tableDeltaS,\n tableDeltaT;\n\n switch (textRegion.huffmanFS) {\n case 0:\n case 1:\n tableFirstS = getStandardTable(textRegion.huffmanFS + 6);\n break;\n case 3:\n tableFirstS = getCustomHuffmanTable(\n customIndex,\n referredTo,\n customTables\n );\n customIndex++;\n break;\n default:\n throw new Jbig2Error(\"invalid Huffman FS selector\");\n }\n\n switch (textRegion.huffmanDS) {\n case 0:\n case 1:\n case 2:\n tableDeltaS = getStandardTable(textRegion.huffmanDS + 8);\n break;\n case 3:\n tableDeltaS = getCustomHuffmanTable(\n customIndex,\n referredTo,\n customTables\n );\n customIndex++;\n break;\n default:\n throw new Jbig2Error(\"invalid Huffman DS selector\");\n }\n\n switch (textRegion.huffmanDT) {\n case 0:\n case 1:\n case 2:\n tableDeltaT = getStandardTable(textRegion.huffmanDT + 11);\n break;\n case 3:\n tableDeltaT = getCustomHuffmanTable(\n customIndex,\n referredTo,\n customTables\n );\n customIndex++;\n break;\n default:\n throw new Jbig2Error(\"invalid Huffman DT selector\");\n }\n\n if (textRegion.refinement) {\n // Load tables RDW, RDH, RDX and RDY.\n throw new Jbig2Error(\"refinement with Huffman is not supported\");\n }\n\n return {\n symbolIDTable,\n tableFirstS,\n tableDeltaS,\n tableDeltaT,\n };\n}\n\nfunction getSymbolDictionaryHuffmanTables(\n dictionary,\n referredTo,\n customTables\n) {\n // 7.4.2.1.6 Symbol dictionary segment Huffman table selection\n\n let customIndex = 0,\n tableDeltaHeight,\n tableDeltaWidth;\n switch (dictionary.huffmanDHSelector) {\n case 0:\n case 1:\n tableDeltaHeight = getStandardTable(dictionary.huffmanDHSelector + 4);\n break;\n case 3:\n tableDeltaHeight = getCustomHuffmanTable(\n customIndex,\n referredTo,\n customTables\n );\n customIndex++;\n break;\n default:\n throw new Jbig2Error(\"invalid Huffman DH selector\");\n }\n\n switch (dictionary.huffmanDWSelector) {\n case 0:\n case 1:\n tableDeltaWidth = getStandardTable(dictionary.huffmanDWSelector + 2);\n break;\n case 3:\n tableDeltaWidth = getCustomHuffmanTable(\n customIndex,\n referredTo,\n customTables\n );\n customIndex++;\n break;\n default:\n throw new Jbig2Error(\"invalid Huffman DW selector\");\n }\n\n let tableBitmapSize, tableAggregateInstances;\n if (dictionary.bitmapSizeSelector) {\n tableBitmapSize = getCustomHuffmanTable(\n customIndex,\n referredTo,\n customTables\n );\n customIndex++;\n } else {\n tableBitmapSize = getStandardTable(1);\n }\n\n if (dictionary.aggregationInstancesSelector) {\n tableAggregateInstances = getCustomHuffmanTable(\n customIndex,\n referredTo,\n customTables\n );\n } else {\n tableAggregateInstances = getStandardTable(1);\n }\n\n return {\n tableDeltaHeight,\n tableDeltaWidth,\n tableBitmapSize,\n tableAggregateInstances,\n };\n}\n\nfunction readUncompressedBitmap(reader, width, height) {\n const bitmap = [];\n for (let y = 0; y < height; y++) {\n const row = new Uint8Array(width);\n bitmap.push(row);\n for (let x = 0; x < width; x++) {\n row[x] = reader.readBit();\n }\n reader.byteAlign();\n }\n return bitmap;\n}\n\nfunction decodeMMRBitmap(input, width, height, endOfBlock) {\n // MMR is the same compression algorithm as the PDF filter\n // CCITTFaxDecode with /K -1.\n const params = {\n K: -1,\n Columns: width,\n Rows: height,\n BlackIs1: true,\n EndOfBlock: endOfBlock,\n };\n const decoder = new CCITTFaxDecoder(input, params);\n const bitmap = [];\n let currentByte,\n eof = false;\n\n for (let y = 0; y < height; y++) {\n const row = new Uint8Array(width);\n bitmap.push(row);\n let shift = -1;\n for (let x = 0; x < width; x++) {\n if (shift < 0) {\n currentByte = decoder.readNextChar();\n if (currentByte === -1) {\n // Set the rest of the bits to zero.\n currentByte = 0;\n eof = true;\n }\n shift = 7;\n }\n row[x] = (currentByte >> shift) & 1;\n shift--;\n }\n }\n\n if (endOfBlock && !eof) {\n // Read until EOFB has been consumed.\n const lookForEOFLimit = 5;\n for (let i = 0; i < lookForEOFLimit; i++) {\n if (decoder.readNextChar() === -1) {\n break;\n }\n }\n }\n\n return bitmap;\n}\n\nclass Jbig2Image {\n parseChunks(chunks) {\n return parseJbig2Chunks(chunks);\n }\n\n parse(data) {\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"IMAGE_DECODERS\")) {\n throw new Error(\"Not implemented: Jbig2Image.parse\");\n }\n const { imgData, width, height } = parseJbig2(data);\n this.width = width;\n this.height = height;\n return imgData;\n }\n}\n\nexport { Jbig2Image };\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 { BaseStream } from \"./base_stream.js\";\nimport { DecodeStream } from \"./decode_stream.js\";\nimport { Dict } from \"./primitives.js\";\nimport { Jbig2Image } from \"./jbig2.js\";\nimport { shadow } from \"../shared/util.js\";\n\n/**\n * For JBIG2's we use a library to decode these images and\n * the stream behaves like all the other DecodeStreams.\n */\nclass Jbig2Stream extends DecodeStream {\n constructor(stream, maybeLength, params) {\n super(maybeLength);\n\n this.stream = stream;\n this.dict = stream.dict;\n this.maybeLength = maybeLength;\n this.params = params;\n }\n\n get bytes() {\n // If `this.maybeLength` is null, we'll get the entire stream.\n return shadow(this, \"bytes\", this.stream.getBytes(this.maybeLength));\n }\n\n ensureBuffer(requested) {\n // No-op, since `this.readBlock` will always parse the entire image and\n // directly insert all of its data into `this.buffer`.\n }\n\n readBlock() {\n if (this.eof) {\n return;\n }\n const jbig2Image = new Jbig2Image();\n\n const chunks = [];\n if (this.params instanceof Dict) {\n const globalsStream = this.params.get(\"JBIG2Globals\");\n if (globalsStream instanceof BaseStream) {\n const globals = globalsStream.getBytes();\n chunks.push({ data: globals, start: 0, end: globals.length });\n }\n }\n chunks.push({ data: this.bytes, start: 0, end: this.bytes.length });\n const data = jbig2Image.parseChunks(chunks);\n const dataLength = data.length;\n\n // JBIG2 had black as 1 and white as 0, inverting the colors\n for (let i = 0; i < dataLength; i++) {\n data[i] ^= 0xff;\n }\n this.buffer = data;\n this.bufferLength = dataLength;\n this.eof = true;\n }\n}\n\nexport { Jbig2Stream };\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 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 { assert, BaseException, warn } from \"../shared/util.js\";\nimport { grayToRGBA } from \"../shared/image_utils.js\";\nimport { readUint16 } from \"./core_utils.js\";\n\nclass JpegError extends BaseException {\n constructor(msg) {\n super(`JPEG error: ${msg}`, \"JpegError\");\n }\n}\n\nclass DNLMarkerError extends BaseException {\n constructor(message, scanLines) {\n super(message, \"DNLMarkerError\");\n this.scanLines = scanLines;\n }\n}\n\nclass EOIMarkerError extends BaseException {\n constructor(msg) {\n super(msg, \"EOIMarkerError\");\n }\n}\n\n/**\n * This code was forked from https://github.com/notmasteryet/jpgjs.\n * The original version was created by GitHub user notmasteryet.\n *\n * - The JPEG specification can be found in the ITU CCITT Recommendation T.81\n * (www.w3.org/Graphics/JPEG/itu-t81.pdf)\n * - The JFIF specification can be found in the JPEG File Interchange Format\n * (www.w3.org/Graphics/JPEG/jfif3.pdf)\n * - The Adobe Application-Specific JPEG markers in the\n * Supporting the DCT Filters in PostScript Level 2, Technical Note #5116\n * (partners.adobe.com/public/developer/en/ps/sdk/5116.DCT_Filter.pdf)\n */\n\n// prettier-ignore\nconst dctZigZag = new Uint8Array([\n 0,\n 1, 8,\n 16, 9, 2,\n 3, 10, 17, 24,\n 32, 25, 18, 11, 4,\n 5, 12, 19, 26, 33, 40,\n 48, 41, 34, 27, 20, 13, 6,\n 7, 14, 21, 28, 35, 42, 49, 56,\n 57, 50, 43, 36, 29, 22, 15,\n 23, 30, 37, 44, 51, 58,\n 59, 52, 45, 38, 31,\n 39, 46, 53, 60,\n 61, 54, 47,\n 55, 62,\n 63\n]);\n\nconst dctCos1 = 4017; // cos(pi/16)\nconst dctSin1 = 799; // sin(pi/16)\nconst dctCos3 = 3406; // cos(3*pi/16)\nconst dctSin3 = 2276; // sin(3*pi/16)\nconst dctCos6 = 1567; // cos(6*pi/16)\nconst dctSin6 = 3784; // sin(6*pi/16)\nconst dctSqrt2 = 5793; // sqrt(2)\nconst dctSqrt1d2 = 2896; // sqrt(2) / 2\n\nfunction buildHuffmanTable(codeLengths, values) {\n let k = 0,\n i,\n j,\n length = 16;\n while (length > 0 && !codeLengths[length - 1]) {\n length--;\n }\n const code = [{ children: [], index: 0 }];\n let p = code[0],\n q;\n for (i = 0; i < length; i++) {\n for (j = 0; j < codeLengths[i]; j++) {\n p = code.pop();\n p.children[p.index] = values[k];\n while (p.index > 0) {\n p = code.pop();\n }\n p.index++;\n code.push(p);\n while (code.length <= i) {\n code.push((q = { children: [], index: 0 }));\n p.children[p.index] = q.children;\n p = q;\n }\n k++;\n }\n if (i + 1 < length) {\n // p here points to last code\n code.push((q = { children: [], index: 0 }));\n p.children[p.index] = q.children;\n p = q;\n }\n }\n return code[0].children;\n}\n\nfunction getBlockBufferOffset(component, row, col) {\n return 64 * ((component.blocksPerLine + 1) * row + col);\n}\n\nfunction decodeScan(\n data,\n offset,\n frame,\n components,\n resetInterval,\n spectralStart,\n spectralEnd,\n successivePrev,\n successive,\n parseDNLMarker = false\n) {\n const mcusPerLine = frame.mcusPerLine;\n const progressive = frame.progressive;\n\n const startOffset = offset;\n let bitsData = 0,\n bitsCount = 0;\n\n function readBit() {\n if (bitsCount > 0) {\n bitsCount--;\n return (bitsData >> bitsCount) & 1;\n }\n bitsData = data[offset++];\n if (bitsData === 0xff) {\n const nextByte = data[offset++];\n if (nextByte) {\n if (nextByte === /* DNL = */ 0xdc && parseDNLMarker) {\n offset += 2; // Skip marker length.\n\n const scanLines = readUint16(data, offset);\n offset += 2;\n if (scanLines > 0 && scanLines !== frame.scanLines) {\n throw new DNLMarkerError(\n \"Found DNL marker (0xFFDC) while parsing scan data\",\n scanLines\n );\n }\n } else if (nextByte === /* EOI = */ 0xd9) {\n if (parseDNLMarker) {\n // NOTE: only 8-bit JPEG images are supported in this decoder.\n const maybeScanLines = blockRow * (frame.precision === 8 ? 8 : 0);\n // Heuristic to attempt to handle corrupt JPEG images with too\n // large `scanLines` parameter, by falling back to the currently\n // parsed number of scanLines when it's at least (approximately)\n // one \"half\" order of magnitude smaller than expected (fixes\n // issue10880.pdf, issue10989.pdf, issue15492.pdf).\n if (\n maybeScanLines > 0 &&\n Math.round(frame.scanLines / maybeScanLines) >= 5\n ) {\n throw new DNLMarkerError(\n \"Found EOI marker (0xFFD9) while parsing scan data, \" +\n \"possibly caused by incorrect `scanLines` parameter\",\n maybeScanLines\n );\n }\n }\n throw new EOIMarkerError(\n \"Found EOI marker (0xFFD9) while parsing scan data\"\n );\n }\n throw new JpegError(\n `unexpected marker ${((bitsData << 8) | nextByte).toString(16)}`\n );\n }\n // unstuff 0\n }\n bitsCount = 7;\n return bitsData >>> 7;\n }\n\n function decodeHuffman(tree) {\n let node = tree;\n while (true) {\n node = node[readBit()];\n switch (typeof node) {\n case \"number\":\n return node;\n case \"object\":\n continue;\n }\n throw new JpegError(\"invalid huffman sequence\");\n }\n }\n\n function receive(length) {\n let n = 0;\n while (length > 0) {\n n = (n << 1) | readBit();\n length--;\n }\n return n;\n }\n\n function receiveAndExtend(length) {\n if (length === 1) {\n return readBit() === 1 ? 1 : -1;\n }\n const n = receive(length);\n if (n >= 1 << (length - 1)) {\n return n;\n }\n return n + (-1 << length) + 1;\n }\n\n function decodeBaseline(component, blockOffset) {\n const t = decodeHuffman(component.huffmanTableDC);\n const diff = t === 0 ? 0 : receiveAndExtend(t);\n component.blockData[blockOffset] = component.pred += diff;\n let k = 1;\n while (k < 64) {\n const rs = decodeHuffman(component.huffmanTableAC);\n const s = rs & 15,\n r = rs >> 4;\n if (s === 0) {\n if (r < 15) {\n break;\n }\n k += 16;\n continue;\n }\n k += r;\n const z = dctZigZag[k];\n component.blockData[blockOffset + z] = receiveAndExtend(s);\n k++;\n }\n }\n\n function decodeDCFirst(component, blockOffset) {\n const t = decodeHuffman(component.huffmanTableDC);\n const diff = t === 0 ? 0 : receiveAndExtend(t) << successive;\n component.blockData[blockOffset] = component.pred += diff;\n }\n\n function decodeDCSuccessive(component, blockOffset) {\n component.blockData[blockOffset] |= readBit() << successive;\n }\n\n let eobrun = 0;\n function decodeACFirst(component, blockOffset) {\n if (eobrun > 0) {\n eobrun--;\n return;\n }\n let k = spectralStart;\n const e = spectralEnd;\n while (k <= e) {\n const rs = decodeHuffman(component.huffmanTableAC);\n const s = rs & 15,\n r = rs >> 4;\n if (s === 0) {\n if (r < 15) {\n eobrun = receive(r) + (1 << r) - 1;\n break;\n }\n k += 16;\n continue;\n }\n k += r;\n const z = dctZigZag[k];\n component.blockData[blockOffset + z] =\n receiveAndExtend(s) * (1 << successive);\n k++;\n }\n }\n\n let successiveACState = 0,\n successiveACNextValue;\n function decodeACSuccessive(component, blockOffset) {\n let k = spectralStart;\n const e = spectralEnd;\n let r = 0;\n let s;\n let rs;\n while (k <= e) {\n const offsetZ = blockOffset + dctZigZag[k];\n const sign = component.blockData[offsetZ] < 0 ? -1 : 1;\n switch (successiveACState) {\n case 0: // initial state\n rs = decodeHuffman(component.huffmanTableAC);\n s = rs & 15;\n r = rs >> 4;\n if (s === 0) {\n if (r < 15) {\n eobrun = receive(r) + (1 << r);\n successiveACState = 4;\n } else {\n r = 16;\n successiveACState = 1;\n }\n } else {\n if (s !== 1) {\n throw new JpegError(\"invalid ACn encoding\");\n }\n successiveACNextValue = receiveAndExtend(s);\n successiveACState = r ? 2 : 3;\n }\n continue;\n case 1: // skipping r zero items\n case 2:\n if (component.blockData[offsetZ]) {\n component.blockData[offsetZ] += sign * (readBit() << successive);\n } else {\n r--;\n if (r === 0) {\n successiveACState = successiveACState === 2 ? 3 : 0;\n }\n }\n break;\n case 3: // set value for a zero item\n if (component.blockData[offsetZ]) {\n component.blockData[offsetZ] += sign * (readBit() << successive);\n } else {\n component.blockData[offsetZ] = successiveACNextValue << successive;\n successiveACState = 0;\n }\n break;\n case 4: // eob\n if (component.blockData[offsetZ]) {\n component.blockData[offsetZ] += sign * (readBit() << successive);\n }\n break;\n }\n k++;\n }\n if (successiveACState === 4) {\n eobrun--;\n if (eobrun === 0) {\n successiveACState = 0;\n }\n }\n }\n\n let blockRow = 0;\n function decodeMcu(component, decode, mcu, row, col) {\n const mcuRow = (mcu / mcusPerLine) | 0;\n const mcuCol = mcu % mcusPerLine;\n blockRow = mcuRow * component.v + row;\n const blockCol = mcuCol * component.h + col;\n const blockOffset = getBlockBufferOffset(component, blockRow, blockCol);\n decode(component, blockOffset);\n }\n\n function decodeBlock(component, decode, mcu) {\n blockRow = (mcu / component.blocksPerLine) | 0;\n const blockCol = mcu % component.blocksPerLine;\n const blockOffset = getBlockBufferOffset(component, blockRow, blockCol);\n decode(component, blockOffset);\n }\n\n const componentsLength = components.length;\n let component, i, j, k, n;\n let decodeFn;\n if (progressive) {\n if (spectralStart === 0) {\n decodeFn = successivePrev === 0 ? decodeDCFirst : decodeDCSuccessive;\n } else {\n decodeFn = successivePrev === 0 ? decodeACFirst : decodeACSuccessive;\n }\n } else {\n decodeFn = decodeBaseline;\n }\n\n let mcu = 0,\n fileMarker;\n const mcuExpected =\n componentsLength === 1\n ? components[0].blocksPerLine * components[0].blocksPerColumn\n : mcusPerLine * frame.mcusPerColumn;\n\n let h, v;\n while (mcu <= mcuExpected) {\n // reset interval stuff\n const mcuToRead = resetInterval\n ? Math.min(mcuExpected - mcu, resetInterval)\n : mcuExpected;\n\n // The `mcuToRead === 0` case should only occur when all of the expected\n // MCU data has been already parsed, i.e. when `mcu === mcuExpected`, but\n // some corrupt JPEG images contain more data than intended and we thus\n // want to skip over any extra RSTx markers below (fixes issue11794.pdf).\n if (mcuToRead > 0) {\n for (i = 0; i < componentsLength; i++) {\n components[i].pred = 0;\n }\n eobrun = 0;\n\n if (componentsLength === 1) {\n component = components[0];\n for (n = 0; n < mcuToRead; n++) {\n decodeBlock(component, decodeFn, mcu);\n mcu++;\n }\n } else {\n for (n = 0; n < mcuToRead; n++) {\n for (i = 0; i < componentsLength; i++) {\n component = components[i];\n h = component.h;\n v = component.v;\n for (j = 0; j < v; j++) {\n for (k = 0; k < h; k++) {\n decodeMcu(component, decodeFn, mcu, j, k);\n }\n }\n }\n mcu++;\n }\n }\n }\n\n // find marker\n bitsCount = 0;\n fileMarker = findNextFileMarker(data, offset);\n if (!fileMarker) {\n break; // Reached the end of the image data without finding any marker.\n }\n if (fileMarker.invalid) {\n // Some bad images seem to pad Scan blocks with e.g. zero bytes, skip\n // past those to attempt to find a valid marker (fixes issue4090.pdf).\n const partialMsg = mcuToRead > 0 ? \"unexpected\" : \"excessive\";\n warn(\n `decodeScan - ${partialMsg} MCU data, current marker is: ${fileMarker.invalid}`\n );\n offset = fileMarker.offset;\n }\n if (fileMarker.marker >= 0xffd0 && fileMarker.marker <= 0xffd7) {\n // RSTx\n offset += 2;\n } else {\n break;\n }\n }\n\n return offset - startOffset;\n}\n\n// A port of poppler's IDCT method which in turn is taken from:\n// Christoph Loeffler, Adriaan Ligtenberg, George S. Moschytz,\n// 'Practical Fast 1-D DCT Algorithms with 11 Multiplications',\n// IEEE Intl. Conf. on Acoustics, Speech & Signal Processing, 1989,\n// 988-991.\nfunction quantizeAndInverse(component, blockBufferOffset, p) {\n const qt = component.quantizationTable,\n blockData = component.blockData;\n let v0, v1, v2, v3, v4, v5, v6, v7;\n let p0, p1, p2, p3, p4, p5, p6, p7;\n let t;\n\n if (!qt) {\n throw new JpegError(\"missing required Quantization Table.\");\n }\n\n // inverse DCT on rows\n for (let row = 0; row < 64; row += 8) {\n // gather block data\n p0 = blockData[blockBufferOffset + row];\n p1 = blockData[blockBufferOffset + row + 1];\n p2 = blockData[blockBufferOffset + row + 2];\n p3 = blockData[blockBufferOffset + row + 3];\n p4 = blockData[blockBufferOffset + row + 4];\n p5 = blockData[blockBufferOffset + row + 5];\n p6 = blockData[blockBufferOffset + row + 6];\n p7 = blockData[blockBufferOffset + row + 7];\n\n // dequant p0\n p0 *= qt[row];\n\n // check for all-zero AC coefficients\n if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) {\n t = (dctSqrt2 * p0 + 512) >> 10;\n p[row] = t;\n p[row + 1] = t;\n p[row + 2] = t;\n p[row + 3] = t;\n p[row + 4] = t;\n p[row + 5] = t;\n p[row + 6] = t;\n p[row + 7] = t;\n continue;\n }\n // dequant p1 ... p7\n p1 *= qt[row + 1];\n p2 *= qt[row + 2];\n p3 *= qt[row + 3];\n p4 *= qt[row + 4];\n p5 *= qt[row + 5];\n p6 *= qt[row + 6];\n p7 *= qt[row + 7];\n\n // stage 4\n v0 = (dctSqrt2 * p0 + 128) >> 8;\n v1 = (dctSqrt2 * p4 + 128) >> 8;\n v2 = p2;\n v3 = p6;\n v4 = (dctSqrt1d2 * (p1 - p7) + 128) >> 8;\n v7 = (dctSqrt1d2 * (p1 + p7) + 128) >> 8;\n v5 = p3 << 4;\n v6 = p5 << 4;\n\n // stage 3\n v0 = (v0 + v1 + 1) >> 1;\n v1 = v0 - v1;\n t = (v2 * dctSin6 + v3 * dctCos6 + 128) >> 8;\n v2 = (v2 * dctCos6 - v3 * dctSin6 + 128) >> 8;\n v3 = t;\n v4 = (v4 + v6 + 1) >> 1;\n v6 = v4 - v6;\n v7 = (v7 + v5 + 1) >> 1;\n v5 = v7 - v5;\n\n // stage 2\n v0 = (v0 + v3 + 1) >> 1;\n v3 = v0 - v3;\n v1 = (v1 + v2 + 1) >> 1;\n v2 = v1 - v2;\n t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12;\n v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12;\n v7 = t;\n t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12;\n v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12;\n v6 = t;\n\n // stage 1\n p[row] = v0 + v7;\n p[row + 7] = v0 - v7;\n p[row + 1] = v1 + v6;\n p[row + 6] = v1 - v6;\n p[row + 2] = v2 + v5;\n p[row + 5] = v2 - v5;\n p[row + 3] = v3 + v4;\n p[row + 4] = v3 - v4;\n }\n\n // inverse DCT on columns\n for (let col = 0; col < 8; ++col) {\n p0 = p[col];\n p1 = p[col + 8];\n p2 = p[col + 16];\n p3 = p[col + 24];\n p4 = p[col + 32];\n p5 = p[col + 40];\n p6 = p[col + 48];\n p7 = p[col + 56];\n\n // check for all-zero AC coefficients\n if ((p1 | p2 | p3 | p4 | p5 | p6 | p7) === 0) {\n t = (dctSqrt2 * p0 + 8192) >> 14;\n // Convert to 8-bit.\n if (t < -2040) {\n t = 0;\n } else if (t >= 2024) {\n t = 255;\n } else {\n t = (t + 2056) >> 4;\n }\n blockData[blockBufferOffset + col] = t;\n blockData[blockBufferOffset + col + 8] = t;\n blockData[blockBufferOffset + col + 16] = t;\n blockData[blockBufferOffset + col + 24] = t;\n blockData[blockBufferOffset + col + 32] = t;\n blockData[blockBufferOffset + col + 40] = t;\n blockData[blockBufferOffset + col + 48] = t;\n blockData[blockBufferOffset + col + 56] = t;\n continue;\n }\n\n // stage 4\n v0 = (dctSqrt2 * p0 + 2048) >> 12;\n v1 = (dctSqrt2 * p4 + 2048) >> 12;\n v2 = p2;\n v3 = p6;\n v4 = (dctSqrt1d2 * (p1 - p7) + 2048) >> 12;\n v7 = (dctSqrt1d2 * (p1 + p7) + 2048) >> 12;\n v5 = p3;\n v6 = p5;\n\n // stage 3\n // Shift v0 by 128.5 << 5 here, so we don't need to shift p0...p7 when\n // converting to UInt8 range later.\n v0 = ((v0 + v1 + 1) >> 1) + 4112;\n v1 = v0 - v1;\n t = (v2 * dctSin6 + v3 * dctCos6 + 2048) >> 12;\n v2 = (v2 * dctCos6 - v3 * dctSin6 + 2048) >> 12;\n v3 = t;\n v4 = (v4 + v6 + 1) >> 1;\n v6 = v4 - v6;\n v7 = (v7 + v5 + 1) >> 1;\n v5 = v7 - v5;\n\n // stage 2\n v0 = (v0 + v3 + 1) >> 1;\n v3 = v0 - v3;\n v1 = (v1 + v2 + 1) >> 1;\n v2 = v1 - v2;\n t = (v4 * dctSin3 + v7 * dctCos3 + 2048) >> 12;\n v4 = (v4 * dctCos3 - v7 * dctSin3 + 2048) >> 12;\n v7 = t;\n t = (v5 * dctSin1 + v6 * dctCos1 + 2048) >> 12;\n v5 = (v5 * dctCos1 - v6 * dctSin1 + 2048) >> 12;\n v6 = t;\n\n // stage 1\n p0 = v0 + v7;\n p7 = v0 - v7;\n p1 = v1 + v6;\n p6 = v1 - v6;\n p2 = v2 + v5;\n p5 = v2 - v5;\n p3 = v3 + v4;\n p4 = v3 - v4;\n\n // Convert to 8-bit integers.\n if (p0 < 16) {\n p0 = 0;\n } else if (p0 >= 4080) {\n p0 = 255;\n } else {\n p0 >>= 4;\n }\n if (p1 < 16) {\n p1 = 0;\n } else if (p1 >= 4080) {\n p1 = 255;\n } else {\n p1 >>= 4;\n }\n if (p2 < 16) {\n p2 = 0;\n } else if (p2 >= 4080) {\n p2 = 255;\n } else {\n p2 >>= 4;\n }\n if (p3 < 16) {\n p3 = 0;\n } else if (p3 >= 4080) {\n p3 = 255;\n } else {\n p3 >>= 4;\n }\n if (p4 < 16) {\n p4 = 0;\n } else if (p4 >= 4080) {\n p4 = 255;\n } else {\n p4 >>= 4;\n }\n if (p5 < 16) {\n p5 = 0;\n } else if (p5 >= 4080) {\n p5 = 255;\n } else {\n p5 >>= 4;\n }\n if (p6 < 16) {\n p6 = 0;\n } else if (p6 >= 4080) {\n p6 = 255;\n } else {\n p6 >>= 4;\n }\n if (p7 < 16) {\n p7 = 0;\n } else if (p7 >= 4080) {\n p7 = 255;\n } else {\n p7 >>= 4;\n }\n\n // store block data\n blockData[blockBufferOffset + col] = p0;\n blockData[blockBufferOffset + col + 8] = p1;\n blockData[blockBufferOffset + col + 16] = p2;\n blockData[blockBufferOffset + col + 24] = p3;\n blockData[blockBufferOffset + col + 32] = p4;\n blockData[blockBufferOffset + col + 40] = p5;\n blockData[blockBufferOffset + col + 48] = p6;\n blockData[blockBufferOffset + col + 56] = p7;\n }\n}\n\nfunction buildComponentData(frame, component) {\n const blocksPerLine = component.blocksPerLine;\n const blocksPerColumn = component.blocksPerColumn;\n const computationBuffer = new Int16Array(64);\n\n for (let blockRow = 0; blockRow < blocksPerColumn; blockRow++) {\n for (let blockCol = 0; blockCol < blocksPerLine; blockCol++) {\n const offset = getBlockBufferOffset(component, blockRow, blockCol);\n quantizeAndInverse(component, offset, computationBuffer);\n }\n }\n return component.blockData;\n}\n\nfunction findNextFileMarker(data, currentPos, startPos = currentPos) {\n const maxPos = data.length - 1;\n let newPos = startPos < currentPos ? startPos : currentPos;\n\n if (currentPos >= maxPos) {\n return null; // Don't attempt to read non-existent data and just return.\n }\n const currentMarker = readUint16(data, currentPos);\n if (currentMarker >= 0xffc0 && currentMarker <= 0xfffe) {\n return {\n invalid: null,\n marker: currentMarker,\n offset: currentPos,\n };\n }\n let newMarker = readUint16(data, newPos);\n while (!(newMarker >= 0xffc0 && newMarker <= 0xfffe)) {\n if (++newPos >= maxPos) {\n return null; // Don't attempt to read non-existent data and just return.\n }\n newMarker = readUint16(data, newPos);\n }\n return {\n invalid: currentMarker.toString(16),\n marker: newMarker,\n offset: newPos,\n };\n}\n\nclass JpegImage {\n constructor({ decodeTransform = null, colorTransform = -1 } = {}) {\n this._decodeTransform = decodeTransform;\n this._colorTransform = colorTransform;\n }\n\n parse(data, { dnlScanLines = null } = {}) {\n function readDataBlock() {\n const length = readUint16(data, offset);\n offset += 2;\n let endOffset = offset + length - 2;\n\n const fileMarker = findNextFileMarker(data, endOffset, offset);\n if (fileMarker?.invalid) {\n warn(\n \"readDataBlock - incorrect length, current marker is: \" +\n fileMarker.invalid\n );\n endOffset = fileMarker.offset;\n }\n\n const array = data.subarray(offset, endOffset);\n offset += array.length;\n return array;\n }\n\n function prepareComponents(frame) {\n const mcusPerLine = Math.ceil(frame.samplesPerLine / 8 / frame.maxH);\n const mcusPerColumn = Math.ceil(frame.scanLines / 8 / frame.maxV);\n for (const component of frame.components) {\n const blocksPerLine = Math.ceil(\n (Math.ceil(frame.samplesPerLine / 8) * component.h) / frame.maxH\n );\n const blocksPerColumn = Math.ceil(\n (Math.ceil(frame.scanLines / 8) * component.v) / frame.maxV\n );\n const blocksPerLineForMcu = mcusPerLine * component.h;\n const blocksPerColumnForMcu = mcusPerColumn * component.v;\n\n const blocksBufferSize =\n 64 * blocksPerColumnForMcu * (blocksPerLineForMcu + 1);\n component.blockData = new Int16Array(blocksBufferSize);\n component.blocksPerLine = blocksPerLine;\n component.blocksPerColumn = blocksPerColumn;\n }\n frame.mcusPerLine = mcusPerLine;\n frame.mcusPerColumn = mcusPerColumn;\n }\n\n let offset = 0;\n let jfif = null;\n let adobe = null;\n let frame, resetInterval;\n let numSOSMarkers = 0;\n const quantizationTables = [];\n const huffmanTablesAC = [],\n huffmanTablesDC = [];\n\n let fileMarker = readUint16(data, offset);\n offset += 2;\n if (fileMarker !== /* SOI (Start of Image) = */ 0xffd8) {\n throw new JpegError(\"SOI not found\");\n }\n fileMarker = readUint16(data, offset);\n offset += 2;\n\n markerLoop: while (fileMarker !== /* EOI (End of Image) = */ 0xffd9) {\n let i, j, l;\n switch (fileMarker) {\n case 0xffe0: // APP0 (Application Specific)\n case 0xffe1: // APP1\n case 0xffe2: // APP2\n case 0xffe3: // APP3\n case 0xffe4: // APP4\n case 0xffe5: // APP5\n case 0xffe6: // APP6\n case 0xffe7: // APP7\n case 0xffe8: // APP8\n case 0xffe9: // APP9\n case 0xffea: // APP10\n case 0xffeb: // APP11\n case 0xffec: // APP12\n case 0xffed: // APP13\n case 0xffee: // APP14\n case 0xffef: // APP15\n case 0xfffe: // COM (Comment)\n const appData = readDataBlock();\n\n if (fileMarker === 0xffe0) {\n // 'JFIF\\x00'\n if (\n appData[0] === 0x4a &&\n appData[1] === 0x46 &&\n appData[2] === 0x49 &&\n appData[3] === 0x46 &&\n appData[4] === 0\n ) {\n jfif = {\n version: { major: appData[5], minor: appData[6] },\n densityUnits: appData[7],\n xDensity: (appData[8] << 8) | appData[9],\n yDensity: (appData[10] << 8) | appData[11],\n thumbWidth: appData[12],\n thumbHeight: appData[13],\n thumbData: appData.subarray(\n 14,\n 14 + 3 * appData[12] * appData[13]\n ),\n };\n }\n }\n // TODO APP1 - Exif\n if (fileMarker === 0xffee) {\n // 'Adobe'\n if (\n appData[0] === 0x41 &&\n appData[1] === 0x64 &&\n appData[2] === 0x6f &&\n appData[3] === 0x62 &&\n appData[4] === 0x65\n ) {\n adobe = {\n version: (appData[5] << 8) | appData[6],\n flags0: (appData[7] << 8) | appData[8],\n flags1: (appData[9] << 8) | appData[10],\n transformCode: appData[11],\n };\n }\n }\n break;\n\n case 0xffdb: // DQT (Define Quantization Tables)\n const quantizationTablesLength = readUint16(data, offset);\n offset += 2;\n const quantizationTablesEnd = quantizationTablesLength + offset - 2;\n let z;\n while (offset < quantizationTablesEnd) {\n const quantizationTableSpec = data[offset++];\n const tableData = new Uint16Array(64);\n if (quantizationTableSpec >> 4 === 0) {\n // 8 bit values\n for (j = 0; j < 64; j++) {\n z = dctZigZag[j];\n tableData[z] = data[offset++];\n }\n } else if (quantizationTableSpec >> 4 === 1) {\n // 16 bit values\n for (j = 0; j < 64; j++) {\n z = dctZigZag[j];\n tableData[z] = readUint16(data, offset);\n offset += 2;\n }\n } else {\n throw new JpegError(\"DQT - invalid table spec\");\n }\n quantizationTables[quantizationTableSpec & 15] = tableData;\n }\n break;\n\n case 0xffc0: // SOF0 (Start of Frame, Baseline DCT)\n case 0xffc1: // SOF1 (Start of Frame, Extended DCT)\n case 0xffc2: // SOF2 (Start of Frame, Progressive DCT)\n if (frame) {\n throw new JpegError(\"Only single frame JPEGs supported\");\n }\n offset += 2; // Skip marker length.\n\n frame = {};\n frame.extended = fileMarker === 0xffc1;\n frame.progressive = fileMarker === 0xffc2;\n frame.precision = data[offset++];\n const sofScanLines = readUint16(data, offset);\n offset += 2;\n frame.scanLines = dnlScanLines || sofScanLines;\n frame.samplesPerLine = readUint16(data, offset);\n offset += 2;\n frame.components = [];\n frame.componentIds = {};\n const componentsCount = data[offset++];\n let maxH = 0,\n maxV = 0;\n for (i = 0; i < componentsCount; i++) {\n const componentId = data[offset];\n const h = data[offset + 1] >> 4;\n const v = data[offset + 1] & 15;\n if (maxH < h) {\n maxH = h;\n }\n if (maxV < v) {\n maxV = v;\n }\n const qId = data[offset + 2];\n l = frame.components.push({\n h,\n v,\n quantizationId: qId,\n quantizationTable: null, // See comment below.\n });\n frame.componentIds[componentId] = l - 1;\n offset += 3;\n }\n frame.maxH = maxH;\n frame.maxV = maxV;\n prepareComponents(frame);\n break;\n\n case 0xffc4: // DHT (Define Huffman Tables)\n const huffmanLength = readUint16(data, offset);\n offset += 2;\n for (i = 2; i < huffmanLength; ) {\n const huffmanTableSpec = data[offset++];\n const codeLengths = new Uint8Array(16);\n let codeLengthSum = 0;\n for (j = 0; j < 16; j++, offset++) {\n codeLengthSum += codeLengths[j] = data[offset];\n }\n const huffmanValues = new Uint8Array(codeLengthSum);\n for (j = 0; j < codeLengthSum; j++, offset++) {\n huffmanValues[j] = data[offset];\n }\n i += 17 + codeLengthSum;\n\n (huffmanTableSpec >> 4 === 0 ? huffmanTablesDC : huffmanTablesAC)[\n huffmanTableSpec & 15\n ] = buildHuffmanTable(codeLengths, huffmanValues);\n }\n break;\n\n case 0xffdd: // DRI (Define Restart Interval)\n offset += 2; // Skip marker length.\n\n resetInterval = readUint16(data, offset);\n offset += 2;\n break;\n\n case 0xffda: // SOS (Start of Scan)\n // A DNL marker (0xFFDC), if it exists, is only allowed at the end\n // of the first scan segment and may only occur once in an image.\n // Furthermore, to prevent an infinite loop, do *not* attempt to\n // parse DNL markers during re-parsing of the JPEG scan data.\n const parseDNLMarker = ++numSOSMarkers === 1 && !dnlScanLines;\n\n offset += 2; // Skip marker length.\n\n const selectorsCount = data[offset++],\n components = [];\n for (i = 0; i < selectorsCount; i++) {\n const index = data[offset++];\n const componentIndex = frame.componentIds[index];\n const component = frame.components[componentIndex];\n component.index = index;\n const tableSpec = data[offset++];\n component.huffmanTableDC = huffmanTablesDC[tableSpec >> 4];\n component.huffmanTableAC = huffmanTablesAC[tableSpec & 15];\n components.push(component);\n }\n const spectralStart = data[offset++],\n spectralEnd = data[offset++],\n successiveApproximation = data[offset++];\n try {\n const processed = decodeScan(\n data,\n offset,\n frame,\n components,\n resetInterval,\n spectralStart,\n spectralEnd,\n successiveApproximation >> 4,\n successiveApproximation & 15,\n parseDNLMarker\n );\n offset += processed;\n } catch (ex) {\n if (ex instanceof DNLMarkerError) {\n warn(`${ex.message} -- attempting to re-parse the JPEG image.`);\n return this.parse(data, { dnlScanLines: ex.scanLines });\n } else if (ex instanceof EOIMarkerError) {\n warn(`${ex.message} -- ignoring the rest of the image data.`);\n break markerLoop;\n }\n throw ex;\n }\n break;\n\n case 0xffdc: // DNL (Define Number of Lines)\n // Ignore the marker, since it's being handled in `decodeScan`.\n offset += 4;\n break;\n\n case 0xffff: // Fill bytes\n if (data[offset] !== 0xff) {\n // Avoid skipping a valid marker.\n offset--;\n }\n break;\n\n default:\n // Could be incorrect encoding -- the last 0xFF byte of the previous\n // block could have been eaten by the encoder, hence we fallback to\n // `startPos = offset - 3` when looking for the next valid marker.\n const nextFileMarker = findNextFileMarker(\n data,\n /* currentPos = */ offset - 2,\n /* startPos = */ offset - 3\n );\n if (nextFileMarker?.invalid) {\n warn(\n \"JpegImage.parse - unexpected data, current marker is: \" +\n nextFileMarker.invalid\n );\n offset = nextFileMarker.offset;\n break;\n }\n if (!nextFileMarker || offset >= data.length - 1) {\n warn(\n \"JpegImage.parse - reached the end of the image data \" +\n \"without finding an EOI marker (0xFFD9).\"\n );\n break markerLoop;\n }\n throw new JpegError(\n \"JpegImage.parse - unknown marker: \" + fileMarker.toString(16)\n );\n }\n fileMarker = readUint16(data, offset);\n offset += 2;\n }\n\n if (!frame) {\n throw new JpegError(\"JpegImage.parse - no frame data found.\");\n }\n this.width = frame.samplesPerLine;\n this.height = frame.scanLines;\n this.jfif = jfif;\n this.adobe = adobe;\n this.components = [];\n for (const component of frame.components) {\n // Prevent errors when DQT markers are placed after SOF{n} markers,\n // by assigning the `quantizationTable` entry after the entire image\n // has been parsed (fixes issue7406.pdf).\n const quantizationTable = quantizationTables[component.quantizationId];\n if (quantizationTable) {\n component.quantizationTable = quantizationTable;\n }\n\n this.components.push({\n index: component.index,\n output: buildComponentData(frame, component),\n scaleX: component.h / frame.maxH,\n scaleY: component.v / frame.maxV,\n blocksPerLine: component.blocksPerLine,\n blocksPerColumn: component.blocksPerColumn,\n });\n }\n this.numComponents = this.components.length;\n return undefined;\n }\n\n _getLinearizedBlockData(width, height, isSourcePDF = false) {\n const scaleX = this.width / width,\n scaleY = this.height / height;\n\n let component, componentScaleX, componentScaleY, blocksPerScanline;\n let x, y, i, j, k;\n let index;\n let offset = 0;\n let output;\n const numComponents = this.components.length;\n const dataLength = width * height * numComponents;\n const data = new Uint8ClampedArray(dataLength);\n const xScaleBlockOffset = new Uint32Array(width);\n const mask3LSB = 0xfffffff8; // used to clear the 3 LSBs\n let lastComponentScaleX;\n\n for (i = 0; i < numComponents; i++) {\n component = this.components[i];\n componentScaleX = component.scaleX * scaleX;\n componentScaleY = component.scaleY * scaleY;\n offset = i;\n output = component.output;\n blocksPerScanline = (component.blocksPerLine + 1) << 3;\n // Precalculate the `xScaleBlockOffset`. Since it doesn't depend on the\n // component data, that's only necessary when `componentScaleX` changes.\n if (componentScaleX !== lastComponentScaleX) {\n for (x = 0; x < width; x++) {\n j = 0 | (x * componentScaleX);\n xScaleBlockOffset[x] = ((j & mask3LSB) << 3) | (j & 7);\n }\n lastComponentScaleX = componentScaleX;\n }\n // linearize the blocks of the component\n for (y = 0; y < height; y++) {\n j = 0 | (y * componentScaleY);\n index = (blocksPerScanline * (j & mask3LSB)) | ((j & 7) << 3);\n for (x = 0; x < width; x++) {\n data[offset] = output[index + xScaleBlockOffset[x]];\n offset += numComponents;\n }\n }\n }\n\n // decodeTransform contains pairs of multiplier (-256..256) and additive\n let transform = this._decodeTransform;\n\n // In PDF files, JPEG images with CMYK colour spaces are usually inverted\n // (this can be observed by extracting the raw image data).\n // Since the conversion algorithms (see below) were written primarily for\n // the PDF use-cases, attempting to use `JpegImage` to parse standalone\n // JPEG (CMYK) images may thus result in inverted images (see issue 9513).\n //\n // Unfortunately it's not (always) possible to tell, from the image data\n // alone, if it needs to be inverted. Thus in an attempt to provide better\n // out-of-box behaviour when `JpegImage` is used standalone, default to\n // inverting JPEG (CMYK) images if and only if the image data does *not*\n // come from a PDF file and no `decodeTransform` was passed by the user.\n if (!isSourcePDF && numComponents === 4 && !transform) {\n transform = new Int32Array([-256, 255, -256, 255, -256, 255, -256, 255]);\n }\n\n if (transform) {\n for (i = 0; i < dataLength; ) {\n for (j = 0, k = 0; j < numComponents; j++, i++, k += 2) {\n data[i] = ((data[i] * transform[k]) >> 8) + transform[k + 1];\n }\n }\n }\n return data;\n }\n\n get _isColorConversionNeeded() {\n if (this.adobe) {\n // The adobe transform marker overrides any previous setting.\n return !!this.adobe.transformCode;\n }\n if (this.numComponents === 3) {\n if (this._colorTransform === 0) {\n // If the Adobe transform marker is not present and the image\n // dictionary has a 'ColorTransform' entry, explicitly set to `0`,\n // then the colours should *not* be transformed.\n return false;\n } else if (\n this.components[0].index === /* \"R\" = */ 0x52 &&\n this.components[1].index === /* \"G\" = */ 0x47 &&\n this.components[2].index === /* \"B\" = */ 0x42\n ) {\n // If the three components are indexed as RGB in ASCII\n // then the colours should *not* be transformed.\n return false;\n }\n return true;\n }\n // `this.numComponents !== 3`\n if (this._colorTransform === 1) {\n // If the Adobe transform marker is not present and the image\n // dictionary has a 'ColorTransform' entry, explicitly set to `1`,\n // then the colours should be transformed.\n return true;\n }\n return false;\n }\n\n _convertYccToRgb(data) {\n let Y, Cb, Cr;\n for (let i = 0, length = data.length; i < length; i += 3) {\n Y = data[i];\n Cb = data[i + 1];\n Cr = data[i + 2];\n data[i] = Y - 179.456 + 1.402 * Cr;\n data[i + 1] = Y + 135.459 - 0.344 * Cb - 0.714 * Cr;\n data[i + 2] = Y - 226.816 + 1.772 * Cb;\n }\n return data;\n }\n\n _convertYccToRgba(data, out) {\n for (let i = 0, j = 0, length = data.length; i < length; i += 3, j += 4) {\n const Y = data[i];\n const Cb = data[i + 1];\n const Cr = data[i + 2];\n out[j] = Y - 179.456 + 1.402 * Cr;\n out[j + 1] = Y + 135.459 - 0.344 * Cb - 0.714 * Cr;\n out[j + 2] = Y - 226.816 + 1.772 * Cb;\n out[j + 3] = 255;\n }\n return out;\n }\n\n _convertYcckToRgb(data) {\n let Y, Cb, Cr, k;\n let offset = 0;\n for (let i = 0, length = data.length; i < length; i += 4) {\n Y = data[i];\n Cb = data[i + 1];\n Cr = data[i + 2];\n k = data[i + 3];\n\n data[offset++] =\n -122.67195406894 +\n Cb *\n (-6.60635669420364e-5 * Cb +\n 0.000437130475926232 * Cr -\n 5.4080610064599e-5 * Y +\n 0.00048449797120281 * k -\n 0.154362151871126) +\n Cr *\n (-0.000957964378445773 * Cr +\n 0.000817076911346625 * Y -\n 0.00477271405408747 * k +\n 1.53380253221734) +\n Y *\n (0.000961250184130688 * Y -\n 0.00266257332283933 * k +\n 0.48357088451265) +\n k * (-0.000336197177618394 * k + 0.484791561490776);\n\n data[offset++] =\n 107.268039397724 +\n Cb *\n (2.19927104525741e-5 * Cb -\n 0.000640992018297945 * Cr +\n 0.000659397001245577 * Y +\n 0.000426105652938837 * k -\n 0.176491792462875) +\n Cr *\n (-0.000778269941513683 * Cr +\n 0.00130872261408275 * Y +\n 0.000770482631801132 * k -\n 0.151051492775562) +\n Y *\n (0.00126935368114843 * Y -\n 0.00265090189010898 * k +\n 0.25802910206845) +\n k * (-0.000318913117588328 * k - 0.213742400323665);\n\n data[offset++] =\n -20.810012546947 +\n Cb *\n (-0.000570115196973677 * Cb -\n 2.63409051004589e-5 * Cr +\n 0.0020741088115012 * Y -\n 0.00288260236853442 * k +\n 0.814272968359295) +\n Cr *\n (-1.53496057440975e-5 * Cr -\n 0.000132689043961446 * Y +\n 0.000560833691242812 * k -\n 0.195152027534049) +\n Y *\n (0.00174418132927582 * Y -\n 0.00255243321439347 * k +\n 0.116935020465145) +\n k * (-0.000343531996510555 * k + 0.24165260232407);\n }\n // Ensure that only the converted RGB data is returned.\n return data.subarray(0, offset);\n }\n\n _convertYcckToRgba(data) {\n for (let i = 0, length = data.length; i < length; i += 4) {\n const Y = data[i];\n const Cb = data[i + 1];\n const Cr = data[i + 2];\n const k = data[i + 3];\n\n data[i] =\n -122.67195406894 +\n Cb *\n (-6.60635669420364e-5 * Cb +\n 0.000437130475926232 * Cr -\n 5.4080610064599e-5 * Y +\n 0.00048449797120281 * k -\n 0.154362151871126) +\n Cr *\n (-0.000957964378445773 * Cr +\n 0.000817076911346625 * Y -\n 0.00477271405408747 * k +\n 1.53380253221734) +\n Y *\n (0.000961250184130688 * Y -\n 0.00266257332283933 * k +\n 0.48357088451265) +\n k * (-0.000336197177618394 * k + 0.484791561490776);\n\n data[i + 1] =\n 107.268039397724 +\n Cb *\n (2.19927104525741e-5 * Cb -\n 0.000640992018297945 * Cr +\n 0.000659397001245577 * Y +\n 0.000426105652938837 * k -\n 0.176491792462875) +\n Cr *\n (-0.000778269941513683 * Cr +\n 0.00130872261408275 * Y +\n 0.000770482631801132 * k -\n 0.151051492775562) +\n Y *\n (0.00126935368114843 * Y -\n 0.00265090189010898 * k +\n 0.25802910206845) +\n k * (-0.000318913117588328 * k - 0.213742400323665);\n\n data[i + 2] =\n -20.810012546947 +\n Cb *\n (-0.000570115196973677 * Cb -\n 2.63409051004589e-5 * Cr +\n 0.0020741088115012 * Y -\n 0.00288260236853442 * k +\n 0.814272968359295) +\n Cr *\n (-1.53496057440975e-5 * Cr -\n 0.000132689043961446 * Y +\n 0.000560833691242812 * k -\n 0.195152027534049) +\n Y *\n (0.00174418132927582 * Y -\n 0.00255243321439347 * k +\n 0.116935020465145) +\n k * (-0.000343531996510555 * k + 0.24165260232407);\n data[i + 3] = 255;\n }\n return data;\n }\n\n _convertYcckToCmyk(data) {\n let Y, Cb, Cr;\n for (let i = 0, length = data.length; i < length; i += 4) {\n Y = data[i];\n Cb = data[i + 1];\n Cr = data[i + 2];\n data[i] = 434.456 - Y - 1.402 * Cr;\n data[i + 1] = 119.541 - Y + 0.344 * Cb + 0.714 * Cr;\n data[i + 2] = 481.816 - Y - 1.772 * Cb;\n // K in data[i + 3] is unchanged\n }\n return data;\n }\n\n _convertCmykToRgb(data) {\n let c, m, y, k;\n let offset = 0;\n for (let i = 0, length = data.length; i < length; i += 4) {\n c = data[i];\n m = data[i + 1];\n y = data[i + 2];\n k = data[i + 3];\n\n data[offset++] =\n 255 +\n c *\n (-0.00006747147073602441 * c +\n 0.0008379262121013727 * m +\n 0.0002894718188643294 * y +\n 0.003264231057537806 * k -\n 1.1185611867203937) +\n m *\n (0.000026374107616089405 * m -\n 0.00008626949158638572 * y -\n 0.0002748769067499491 * k -\n 0.02155688794978967) +\n y *\n (-0.00003878099212869363 * y -\n 0.0003267808279485286 * k +\n 0.0686742238595345) -\n k * (0.0003361971776183937 * k + 0.7430659151342254);\n\n data[offset++] =\n 255 +\n c *\n (0.00013596372813588848 * c +\n 0.000924537132573585 * m +\n 0.00010567359618683593 * y +\n 0.0004791864687436512 * k -\n 0.3109689587515875) +\n m *\n (-0.00023545346108370344 * m +\n 0.0002702845253534714 * y +\n 0.0020200308977307156 * k -\n 0.7488052167015494) +\n y *\n (0.00006834815998235662 * y +\n 0.00015168452363460973 * k -\n 0.09751927774728933) -\n k * (0.0003189131175883281 * k + 0.7364883807733168);\n\n data[offset++] =\n 255 +\n c *\n (0.000013598650411385307 * c +\n 0.00012423956175490851 * m +\n 0.0004751985097583589 * y -\n 0.0000036729317476630422 * k -\n 0.05562186980264034) +\n m *\n (0.00016141380598724676 * m +\n 0.0009692239130725186 * y +\n 0.0007782692450036253 * k -\n 0.44015232367526463) +\n y *\n (5.068882914068769e-7 * y +\n 0.0017778369011375071 * k -\n 0.7591454649749609) -\n k * (0.0003435319965105553 * k + 0.7063770186160144);\n }\n // Ensure that only the converted RGB data is returned.\n return data.subarray(0, offset);\n }\n\n _convertCmykToRgba(data) {\n for (let i = 0, length = data.length; i < length; i += 4) {\n const c = data[i];\n const m = data[i + 1];\n const y = data[i + 2];\n const k = data[i + 3];\n\n data[i] =\n 255 +\n c *\n (-0.00006747147073602441 * c +\n 0.0008379262121013727 * m +\n 0.0002894718188643294 * y +\n 0.003264231057537806 * k -\n 1.1185611867203937) +\n m *\n (0.000026374107616089405 * m -\n 0.00008626949158638572 * y -\n 0.0002748769067499491 * k -\n 0.02155688794978967) +\n y *\n (-0.00003878099212869363 * y -\n 0.0003267808279485286 * k +\n 0.0686742238595345) -\n k * (0.0003361971776183937 * k + 0.7430659151342254);\n\n data[i + 1] =\n 255 +\n c *\n (0.00013596372813588848 * c +\n 0.000924537132573585 * m +\n 0.00010567359618683593 * y +\n 0.0004791864687436512 * k -\n 0.3109689587515875) +\n m *\n (-0.00023545346108370344 * m +\n 0.0002702845253534714 * y +\n 0.0020200308977307156 * k -\n 0.7488052167015494) +\n y *\n (0.00006834815998235662 * y +\n 0.00015168452363460973 * k -\n 0.09751927774728933) -\n k * (0.0003189131175883281 * k + 0.7364883807733168);\n\n data[i + 2] =\n 255 +\n c *\n (0.000013598650411385307 * c +\n 0.00012423956175490851 * m +\n 0.0004751985097583589 * y -\n 0.0000036729317476630422 * k -\n 0.05562186980264034) +\n m *\n (0.00016141380598724676 * m +\n 0.0009692239130725186 * y +\n 0.0007782692450036253 * k -\n 0.44015232367526463) +\n y *\n (5.068882914068769e-7 * y +\n 0.0017778369011375071 * k -\n 0.7591454649749609) -\n k * (0.0003435319965105553 * k + 0.7063770186160144);\n data[i + 3] = 255;\n }\n return data;\n }\n\n getData({\n width,\n height,\n forceRGBA = false,\n forceRGB = false,\n isSourcePDF = false,\n }) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n isSourcePDF === true,\n 'JpegImage.getData: Unexpected \"isSourcePDF\" value for PDF files.'\n );\n }\n if (this.numComponents > 4) {\n throw new JpegError(\"Unsupported color mode\");\n }\n // Type of data: Uint8ClampedArray(width * height * numComponents)\n const data = this._getLinearizedBlockData(width, height, isSourcePDF);\n\n if (this.numComponents === 1 && (forceRGBA || forceRGB)) {\n const len = data.length * (forceRGBA ? 4 : 3);\n const rgbaData = new Uint8ClampedArray(len);\n let offset = 0;\n if (forceRGBA) {\n grayToRGBA(data, new Uint32Array(rgbaData.buffer));\n } else {\n for (const grayColor of data) {\n rgbaData[offset++] = grayColor;\n rgbaData[offset++] = grayColor;\n rgbaData[offset++] = grayColor;\n }\n }\n return rgbaData;\n } else if (this.numComponents === 3 && this._isColorConversionNeeded) {\n if (forceRGBA) {\n const rgbaData = new Uint8ClampedArray((data.length / 3) * 4);\n return this._convertYccToRgba(data, rgbaData);\n }\n return this._convertYccToRgb(data);\n } else if (this.numComponents === 4) {\n if (this._isColorConversionNeeded) {\n if (forceRGBA) {\n return this._convertYcckToRgba(data);\n }\n if (forceRGB) {\n return this._convertYcckToRgb(data);\n }\n return this._convertYcckToCmyk(data);\n } else if (forceRGBA) {\n return this._convertCmykToRgba(data);\n } else if (forceRGB) {\n return this._convertCmykToRgb(data);\n }\n }\n return data;\n }\n}\n\nexport { JpegImage };\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 { DecodeStream } from \"./decode_stream.js\";\nimport { Dict } from \"./primitives.js\";\nimport { JpegImage } from \"./jpg.js\";\nimport { shadow } from \"../shared/util.js\";\n\n/**\n * For JPEG's we use a library to decode these images and the stream behaves\n * like all the other DecodeStreams.\n */\nclass JpegStream extends DecodeStream {\n constructor(stream, maybeLength, params) {\n // Some images may contain 'junk' before the SOI (start-of-image) marker.\n // Note: this seems to mainly affect inline images.\n let ch;\n while ((ch = stream.getByte()) !== -1) {\n // Find the first byte of the SOI marker (0xFFD8).\n if (ch === 0xff) {\n stream.skip(-1); // Reset the stream position to the SOI.\n break;\n }\n }\n super(maybeLength);\n\n this.stream = stream;\n this.dict = stream.dict;\n this.maybeLength = maybeLength;\n this.params = params;\n }\n\n get bytes() {\n // If `this.maybeLength` is null, we'll get the entire stream.\n return shadow(this, \"bytes\", this.stream.getBytes(this.maybeLength));\n }\n\n ensureBuffer(requested) {\n // No-op, since `this.readBlock` will always parse the entire image and\n // directly insert all of its data into `this.buffer`.\n }\n\n readBlock() {\n if (this.eof) {\n return;\n }\n const jpegOptions = {\n decodeTransform: undefined,\n colorTransform: undefined,\n };\n\n // Checking if values need to be transformed before conversion.\n const decodeArr = this.dict.getArray(\"D\", \"Decode\");\n if ((this.forceRGBA || this.forceRGB) && Array.isArray(decodeArr)) {\n const bitsPerComponent = this.dict.get(\"BPC\", \"BitsPerComponent\") || 8;\n const decodeArrLength = decodeArr.length;\n const transform = new Int32Array(decodeArrLength);\n let transformNeeded = false;\n const maxValue = (1 << bitsPerComponent) - 1;\n for (let i = 0; i < decodeArrLength; i += 2) {\n transform[i] = ((decodeArr[i + 1] - decodeArr[i]) * 256) | 0;\n transform[i + 1] = (decodeArr[i] * maxValue) | 0;\n if (transform[i] !== 256 || transform[i + 1] !== 0) {\n transformNeeded = true;\n }\n }\n if (transformNeeded) {\n jpegOptions.decodeTransform = transform;\n }\n }\n // Fetching the 'ColorTransform' entry, if it exists.\n if (this.params instanceof Dict) {\n const colorTransform = this.params.get(\"ColorTransform\");\n if (Number.isInteger(colorTransform)) {\n jpegOptions.colorTransform = colorTransform;\n }\n }\n const jpegImage = new JpegImage(jpegOptions);\n\n jpegImage.parse(this.bytes);\n const data = jpegImage.getData({\n width: this.drawWidth,\n height: this.drawHeight,\n forceRGBA: this.forceRGBA,\n forceRGB: this.forceRGB,\n isSourcePDF: true,\n });\n this.buffer = data;\n this.bufferLength = data.length;\n this.eof = true;\n }\n}\n\nexport { JpegStream };\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 { BaseException, info, unreachable, warn } from \"../shared/util.js\";\nimport { log2, readUint16, readUint32 } from \"./core_utils.js\";\nimport { ArithmeticDecoder } from \"./arithmetic_decoder.js\";\n\nclass JpxError extends BaseException {\n constructor(msg) {\n super(`JPX error: ${msg}`, \"JpxError\");\n }\n}\n\n// Table E.1\nconst SubbandsGainLog2 = {\n LL: 0,\n LH: 1,\n HL: 1,\n HH: 2,\n};\n\nclass JpxImage {\n constructor() {\n this.failOnCorruptedImage = false;\n }\n\n parse(data) {\n const head = readUint16(data, 0);\n // No box header, immediate start of codestream (SOC)\n if (head === 0xff4f) {\n this.parseCodestream(data, 0, data.length);\n return;\n }\n\n const length = data.length;\n let position = 0;\n while (position < length) {\n let headerSize = 8;\n let lbox = readUint32(data, position);\n const tbox = readUint32(data, position + 4);\n position += headerSize;\n if (lbox === 1) {\n // XLBox: read UInt64 according to spec.\n // JavaScript's int precision of 53 bit should be sufficient here.\n lbox =\n readUint32(data, position) * 4294967296 +\n readUint32(data, position + 4);\n position += 8;\n headerSize += 8;\n }\n if (lbox === 0) {\n lbox = length - position + headerSize;\n }\n if (lbox < headerSize) {\n throw new JpxError(\"Invalid box field size\");\n }\n const dataLength = lbox - headerSize;\n let jumpDataLength = true;\n switch (tbox) {\n case 0x6a703268: // 'jp2h'\n jumpDataLength = false; // parsing child boxes\n break;\n case 0x636f6c72: // 'colr'\n // Colorspaces are not used, the CS from the PDF is used.\n const method = data[position];\n if (method === 1) {\n // enumerated colorspace\n const colorspace = readUint32(data, position + 3);\n switch (colorspace) {\n case 16: // this indicates a sRGB colorspace\n case 17: // this indicates a grayscale colorspace\n case 18: // this indicates a YUV colorspace\n break;\n default:\n warn(\"Unknown colorspace \" + colorspace);\n break;\n }\n } else if (method === 2) {\n info(\"ICC profile not supported\");\n }\n break;\n case 0x6a703263: // 'jp2c'\n this.parseCodestream(data, position, position + dataLength);\n break;\n case 0x6a502020: // 'jP\\024\\024'\n if (readUint32(data, position) !== 0x0d0a870a) {\n warn(\"Invalid JP2 signature\");\n }\n break;\n // The following header types are valid but currently not used:\n case 0x6a501a1a: // 'jP\\032\\032'\n case 0x66747970: // 'ftyp'\n case 0x72726571: // 'rreq'\n case 0x72657320: // 'res '\n case 0x69686472: // 'ihdr'\n break;\n default:\n const headerType = String.fromCharCode(\n (tbox >> 24) & 0xff,\n (tbox >> 16) & 0xff,\n (tbox >> 8) & 0xff,\n tbox & 0xff\n );\n warn(`Unsupported header type ${tbox} (${headerType}).`);\n break;\n }\n if (jumpDataLength) {\n position += dataLength;\n }\n }\n }\n\n parseImageProperties(stream) {\n let newByte = stream.getByte();\n while (newByte >= 0) {\n const oldByte = newByte;\n newByte = stream.getByte();\n const code = (oldByte << 8) | newByte;\n // Image and tile size (SIZ)\n if (code === 0xff51) {\n stream.skip(4);\n const Xsiz = stream.getInt32() >>> 0; // Byte 4\n const Ysiz = stream.getInt32() >>> 0; // Byte 8\n const XOsiz = stream.getInt32() >>> 0; // Byte 12\n const YOsiz = stream.getInt32() >>> 0; // Byte 16\n stream.skip(16);\n const Csiz = stream.getUint16(); // Byte 36\n this.width = Xsiz - XOsiz;\n this.height = Ysiz - YOsiz;\n this.componentsCount = Csiz;\n // Results are always returned as `Uint8ClampedArray`s.\n this.bitsPerComponent = 8;\n return;\n }\n }\n throw new JpxError(\"No size marker found in JPX stream\");\n }\n\n parseCodestream(data, start, end) {\n const context = {};\n let doNotRecover = false;\n try {\n let position = start;\n while (position + 1 < end) {\n const code = readUint16(data, position);\n position += 2;\n\n let length = 0,\n j,\n sqcd,\n spqcds,\n spqcdSize,\n scalarExpounded,\n tile;\n switch (code) {\n case 0xff4f: // Start of codestream (SOC)\n context.mainHeader = true;\n break;\n case 0xffd9: // End of codestream (EOC)\n break;\n case 0xff51: // Image and tile size (SIZ)\n length = readUint16(data, position);\n const siz = {};\n siz.Xsiz = readUint32(data, position + 4);\n siz.Ysiz = readUint32(data, position + 8);\n siz.XOsiz = readUint32(data, position + 12);\n siz.YOsiz = readUint32(data, position + 16);\n siz.XTsiz = readUint32(data, position + 20);\n siz.YTsiz = readUint32(data, position + 24);\n siz.XTOsiz = readUint32(data, position + 28);\n siz.YTOsiz = readUint32(data, position + 32);\n const componentsCount = readUint16(data, position + 36);\n siz.Csiz = componentsCount;\n const components = [];\n j = position + 38;\n for (let i = 0; i < componentsCount; i++) {\n const component = {\n precision: (data[j] & 0x7f) + 1,\n isSigned: !!(data[j] & 0x80),\n XRsiz: data[j + 1],\n YRsiz: data[j + 2],\n };\n j += 3;\n calculateComponentDimensions(component, siz);\n components.push(component);\n }\n context.SIZ = siz;\n context.components = components;\n calculateTileGrids(context, components);\n context.QCC = [];\n context.COC = [];\n break;\n case 0xff5c: // Quantization default (QCD)\n length = readUint16(data, position);\n const qcd = {};\n j = position + 2;\n sqcd = data[j++];\n switch (sqcd & 0x1f) {\n case 0:\n spqcdSize = 8;\n scalarExpounded = true;\n break;\n case 1:\n spqcdSize = 16;\n scalarExpounded = false;\n break;\n case 2:\n spqcdSize = 16;\n scalarExpounded = true;\n break;\n default:\n throw new Error(\"Invalid SQcd value \" + sqcd);\n }\n qcd.noQuantization = spqcdSize === 8;\n qcd.scalarExpounded = scalarExpounded;\n qcd.guardBits = sqcd >> 5;\n spqcds = [];\n while (j < length + position) {\n const spqcd = {};\n if (spqcdSize === 8) {\n spqcd.epsilon = data[j++] >> 3;\n spqcd.mu = 0;\n } else {\n spqcd.epsilon = data[j] >> 3;\n spqcd.mu = ((data[j] & 0x7) << 8) | data[j + 1];\n j += 2;\n }\n spqcds.push(spqcd);\n }\n qcd.SPqcds = spqcds;\n if (context.mainHeader) {\n context.QCD = qcd;\n } else {\n context.currentTile.QCD = qcd;\n context.currentTile.QCC = [];\n }\n break;\n case 0xff5d: // Quantization component (QCC)\n length = readUint16(data, position);\n const qcc = {};\n j = position + 2;\n let cqcc;\n if (context.SIZ.Csiz < 257) {\n cqcc = data[j++];\n } else {\n cqcc = readUint16(data, j);\n j += 2;\n }\n sqcd = data[j++];\n switch (sqcd & 0x1f) {\n case 0:\n spqcdSize = 8;\n scalarExpounded = true;\n break;\n case 1:\n spqcdSize = 16;\n scalarExpounded = false;\n break;\n case 2:\n spqcdSize = 16;\n scalarExpounded = true;\n break;\n default:\n throw new Error(\"Invalid SQcd value \" + sqcd);\n }\n qcc.noQuantization = spqcdSize === 8;\n qcc.scalarExpounded = scalarExpounded;\n qcc.guardBits = sqcd >> 5;\n spqcds = [];\n while (j < length + position) {\n const spqcd = {};\n if (spqcdSize === 8) {\n spqcd.epsilon = data[j++] >> 3;\n spqcd.mu = 0;\n } else {\n spqcd.epsilon = data[j] >> 3;\n spqcd.mu = ((data[j] & 0x7) << 8) | data[j + 1];\n j += 2;\n }\n spqcds.push(spqcd);\n }\n qcc.SPqcds = spqcds;\n if (context.mainHeader) {\n context.QCC[cqcc] = qcc;\n } else {\n context.currentTile.QCC[cqcc] = qcc;\n }\n break;\n case 0xff52: // Coding style default (COD)\n length = readUint16(data, position);\n const cod = {};\n j = position + 2;\n const scod = data[j++];\n cod.entropyCoderWithCustomPrecincts = !!(scod & 1);\n cod.sopMarkerUsed = !!(scod & 2);\n cod.ephMarkerUsed = !!(scod & 4);\n cod.progressionOrder = data[j++];\n cod.layersCount = readUint16(data, j);\n j += 2;\n cod.multipleComponentTransform = data[j++];\n\n cod.decompositionLevelsCount = data[j++];\n cod.xcb = (data[j++] & 0xf) + 2;\n cod.ycb = (data[j++] & 0xf) + 2;\n const blockStyle = data[j++];\n cod.selectiveArithmeticCodingBypass = !!(blockStyle & 1);\n cod.resetContextProbabilities = !!(blockStyle & 2);\n cod.terminationOnEachCodingPass = !!(blockStyle & 4);\n cod.verticallyStripe = !!(blockStyle & 8);\n cod.predictableTermination = !!(blockStyle & 16);\n cod.segmentationSymbolUsed = !!(blockStyle & 32);\n cod.reversibleTransformation = data[j++];\n if (cod.entropyCoderWithCustomPrecincts) {\n const precinctsSizes = [];\n while (j < length + position) {\n const precinctsSize = data[j++];\n precinctsSizes.push({\n PPx: precinctsSize & 0xf,\n PPy: precinctsSize >> 4,\n });\n }\n cod.precinctsSizes = precinctsSizes;\n }\n const unsupported = [];\n if (cod.selectiveArithmeticCodingBypass) {\n unsupported.push(\"selectiveArithmeticCodingBypass\");\n }\n if (cod.terminationOnEachCodingPass) {\n unsupported.push(\"terminationOnEachCodingPass\");\n }\n if (cod.verticallyStripe) {\n unsupported.push(\"verticallyStripe\");\n }\n if (cod.predictableTermination) {\n unsupported.push(\"predictableTermination\");\n }\n if (unsupported.length > 0) {\n doNotRecover = true;\n warn(`JPX: Unsupported COD options (${unsupported.join(\", \")}).`);\n }\n if (context.mainHeader) {\n context.COD = cod;\n } else {\n context.currentTile.COD = cod;\n context.currentTile.COC = [];\n }\n break;\n case 0xff90: // Start of tile-part (SOT)\n length = readUint16(data, position);\n tile = {};\n tile.index = readUint16(data, position + 2);\n tile.length = readUint32(data, position + 4);\n tile.dataEnd = tile.length + position - 2;\n tile.partIndex = data[position + 8];\n tile.partsCount = data[position + 9];\n\n context.mainHeader = false;\n if (tile.partIndex === 0) {\n // reset component specific settings\n tile.COD = context.COD;\n tile.COC = context.COC.slice(0); // clone of the global COC\n tile.QCD = context.QCD;\n tile.QCC = context.QCC.slice(0); // clone of the global COC\n }\n context.currentTile = tile;\n break;\n case 0xff93: // Start of data (SOD)\n tile = context.currentTile;\n if (tile.partIndex === 0) {\n initializeTile(context, tile.index);\n buildPackets(context);\n }\n\n // moving to the end of the data\n length = tile.dataEnd - position;\n parseTilePackets(context, data, position, length);\n break;\n case 0xff53: // Coding style component (COC)\n warn(\"JPX: Codestream code 0xFF53 (COC) is not implemented.\");\n /* falls through */\n case 0xff55: // Tile-part lengths, main header (TLM)\n case 0xff57: // Packet length, main header (PLM)\n case 0xff58: // Packet length, tile-part header (PLT)\n case 0xff64: // Comment (COM)\n length = readUint16(data, position);\n // skipping content\n break;\n default:\n throw new Error(\"Unknown codestream code: \" + code.toString(16));\n }\n position += length;\n }\n } catch (e) {\n if (doNotRecover || this.failOnCorruptedImage) {\n throw new JpxError(e.message);\n } else {\n warn(`JPX: Trying to recover from: \"${e.message}\".`);\n }\n }\n this.tiles = transformComponents(context);\n this.width = context.SIZ.Xsiz - context.SIZ.XOsiz;\n this.height = context.SIZ.Ysiz - context.SIZ.YOsiz;\n this.componentsCount = context.SIZ.Csiz;\n }\n}\n\nfunction calculateComponentDimensions(component, siz) {\n // Section B.2 Component mapping\n component.x0 = Math.ceil(siz.XOsiz / component.XRsiz);\n component.x1 = Math.ceil(siz.Xsiz / component.XRsiz);\n component.y0 = Math.ceil(siz.YOsiz / component.YRsiz);\n component.y1 = Math.ceil(siz.Ysiz / component.YRsiz);\n component.width = component.x1 - component.x0;\n component.height = component.y1 - component.y0;\n}\nfunction calculateTileGrids(context, components) {\n const siz = context.SIZ;\n // Section B.3 Division into tile and tile-components\n const tiles = [];\n let tile;\n const numXtiles = Math.ceil((siz.Xsiz - siz.XTOsiz) / siz.XTsiz);\n const numYtiles = Math.ceil((siz.Ysiz - siz.YTOsiz) / siz.YTsiz);\n for (let q = 0; q < numYtiles; q++) {\n for (let p = 0; p < numXtiles; p++) {\n tile = {};\n tile.tx0 = Math.max(siz.XTOsiz + p * siz.XTsiz, siz.XOsiz);\n tile.ty0 = Math.max(siz.YTOsiz + q * siz.YTsiz, siz.YOsiz);\n tile.tx1 = Math.min(siz.XTOsiz + (p + 1) * siz.XTsiz, siz.Xsiz);\n tile.ty1 = Math.min(siz.YTOsiz + (q + 1) * siz.YTsiz, siz.Ysiz);\n tile.width = tile.tx1 - tile.tx0;\n tile.height = tile.ty1 - tile.ty0;\n tile.components = [];\n tiles.push(tile);\n }\n }\n context.tiles = tiles;\n\n const componentsCount = siz.Csiz;\n for (let i = 0, ii = componentsCount; i < ii; i++) {\n const component = components[i];\n for (let j = 0, jj = tiles.length; j < jj; j++) {\n const tileComponent = {};\n tile = tiles[j];\n tileComponent.tcx0 = Math.ceil(tile.tx0 / component.XRsiz);\n tileComponent.tcy0 = Math.ceil(tile.ty0 / component.YRsiz);\n tileComponent.tcx1 = Math.ceil(tile.tx1 / component.XRsiz);\n tileComponent.tcy1 = Math.ceil(tile.ty1 / component.YRsiz);\n tileComponent.width = tileComponent.tcx1 - tileComponent.tcx0;\n tileComponent.height = tileComponent.tcy1 - tileComponent.tcy0;\n tile.components[i] = tileComponent;\n }\n }\n}\nfunction getBlocksDimensions(context, component, r) {\n const codOrCoc = component.codingStyleParameters;\n const result = {};\n if (!codOrCoc.entropyCoderWithCustomPrecincts) {\n result.PPx = 15;\n result.PPy = 15;\n } else {\n result.PPx = codOrCoc.precinctsSizes[r].PPx;\n result.PPy = codOrCoc.precinctsSizes[r].PPy;\n }\n // calculate codeblock size as described in section B.7\n result.xcb_ =\n r > 0\n ? Math.min(codOrCoc.xcb, result.PPx - 1)\n : Math.min(codOrCoc.xcb, result.PPx);\n result.ycb_ =\n r > 0\n ? Math.min(codOrCoc.ycb, result.PPy - 1)\n : Math.min(codOrCoc.ycb, result.PPy);\n return result;\n}\nfunction buildPrecincts(context, resolution, dimensions) {\n // Section B.6 Division resolution to precincts\n const precinctWidth = 1 << dimensions.PPx;\n const precinctHeight = 1 << dimensions.PPy;\n // Jasper introduces codeblock groups for mapping each subband codeblocks\n // to precincts. Precinct partition divides a resolution according to width\n // and height parameters. The subband that belongs to the resolution level\n // has a different size than the level, unless it is the zero resolution.\n\n // From Jasper documentation: jpeg2000.pdf, section K: Tier-2 coding:\n // The precinct partitioning for a particular subband is derived from a\n // partitioning of its parent LL band (i.e., the LL band at the next higher\n // resolution level)... The LL band associated with each resolution level is\n // divided into precincts... Each of the resulting precinct regions is then\n // mapped into its child subbands (if any) at the next lower resolution\n // level. This is accomplished by using the coordinate transformation\n // (u, v) = (ceil(x/2), ceil(y/2)) where (x, y) and (u, v) are the\n // coordinates of a point in the LL band and child subband, respectively.\n const isZeroRes = resolution.resLevel === 0;\n const precinctWidthInSubband = 1 << (dimensions.PPx + (isZeroRes ? 0 : -1));\n const precinctHeightInSubband = 1 << (dimensions.PPy + (isZeroRes ? 0 : -1));\n const numprecinctswide =\n resolution.trx1 > resolution.trx0\n ? Math.ceil(resolution.trx1 / precinctWidth) -\n Math.floor(resolution.trx0 / precinctWidth)\n : 0;\n const numprecinctshigh =\n resolution.try1 > resolution.try0\n ? Math.ceil(resolution.try1 / precinctHeight) -\n Math.floor(resolution.try0 / precinctHeight)\n : 0;\n const numprecincts = numprecinctswide * numprecinctshigh;\n\n resolution.precinctParameters = {\n precinctWidth,\n precinctHeight,\n numprecinctswide,\n numprecinctshigh,\n numprecincts,\n precinctWidthInSubband,\n precinctHeightInSubband,\n };\n}\nfunction buildCodeblocks(context, subband, dimensions) {\n // Section B.7 Division sub-band into code-blocks\n const xcb_ = dimensions.xcb_;\n const ycb_ = dimensions.ycb_;\n const codeblockWidth = 1 << xcb_;\n const codeblockHeight = 1 << ycb_;\n const cbx0 = subband.tbx0 >> xcb_;\n const cby0 = subband.tby0 >> ycb_;\n const cbx1 = (subband.tbx1 + codeblockWidth - 1) >> xcb_;\n const cby1 = (subband.tby1 + codeblockHeight - 1) >> ycb_;\n const precinctParameters = subband.resolution.precinctParameters;\n const codeblocks = [];\n const precincts = [];\n let i, j, codeblock, precinctNumber;\n for (j = cby0; j < cby1; j++) {\n for (i = cbx0; i < cbx1; i++) {\n codeblock = {\n cbx: i,\n cby: j,\n tbx0: codeblockWidth * i,\n tby0: codeblockHeight * j,\n tbx1: codeblockWidth * (i + 1),\n tby1: codeblockHeight * (j + 1),\n };\n\n codeblock.tbx0_ = Math.max(subband.tbx0, codeblock.tbx0);\n codeblock.tby0_ = Math.max(subband.tby0, codeblock.tby0);\n codeblock.tbx1_ = Math.min(subband.tbx1, codeblock.tbx1);\n codeblock.tby1_ = Math.min(subband.tby1, codeblock.tby1);\n\n // Calculate precinct number for this codeblock, codeblock position\n // should be relative to its subband, use actual dimension and position\n // See comment about codeblock group width and height\n const pi = Math.floor(\n (codeblock.tbx0_ - subband.tbx0) /\n precinctParameters.precinctWidthInSubband\n );\n const pj = Math.floor(\n (codeblock.tby0_ - subband.tby0) /\n precinctParameters.precinctHeightInSubband\n );\n precinctNumber = pi + pj * precinctParameters.numprecinctswide;\n\n codeblock.precinctNumber = precinctNumber;\n codeblock.subbandType = subband.type;\n codeblock.Lblock = 3;\n\n if (\n codeblock.tbx1_ <= codeblock.tbx0_ ||\n codeblock.tby1_ <= codeblock.tby0_\n ) {\n continue;\n }\n codeblocks.push(codeblock);\n // building precinct for the sub-band\n let precinct = precincts[precinctNumber];\n if (precinct !== undefined) {\n if (i < precinct.cbxMin) {\n precinct.cbxMin = i;\n } else if (i > precinct.cbxMax) {\n precinct.cbxMax = i;\n }\n if (j < precinct.cbyMin) {\n precinct.cbxMin = j;\n } else if (j > precinct.cbyMax) {\n precinct.cbyMax = j;\n }\n } else {\n precincts[precinctNumber] = precinct = {\n cbxMin: i,\n cbyMin: j,\n cbxMax: i,\n cbyMax: j,\n };\n }\n codeblock.precinct = precinct;\n }\n }\n subband.codeblockParameters = {\n codeblockWidth: xcb_,\n codeblockHeight: ycb_,\n numcodeblockwide: cbx1 - cbx0 + 1,\n numcodeblockhigh: cby1 - cby0 + 1,\n };\n subband.codeblocks = codeblocks;\n subband.precincts = precincts;\n}\nfunction createPacket(resolution, precinctNumber, layerNumber) {\n const precinctCodeblocks = [];\n // Section B.10.8 Order of info in packet\n const subbands = resolution.subbands;\n // sub-bands already ordered in 'LL', 'HL', 'LH', and 'HH' sequence\n for (let i = 0, ii = subbands.length; i < ii; i++) {\n const subband = subbands[i];\n const codeblocks = subband.codeblocks;\n for (let j = 0, jj = codeblocks.length; j < jj; j++) {\n const codeblock = codeblocks[j];\n if (codeblock.precinctNumber !== precinctNumber) {\n continue;\n }\n precinctCodeblocks.push(codeblock);\n }\n }\n return {\n layerNumber,\n codeblocks: precinctCodeblocks,\n };\n}\nfunction LayerResolutionComponentPositionIterator(context) {\n const siz = context.SIZ;\n const tileIndex = context.currentTile.index;\n const tile = context.tiles[tileIndex];\n const layersCount = tile.codingStyleDefaultParameters.layersCount;\n const componentsCount = siz.Csiz;\n let maxDecompositionLevelsCount = 0;\n for (let q = 0; q < componentsCount; q++) {\n maxDecompositionLevelsCount = Math.max(\n maxDecompositionLevelsCount,\n tile.components[q].codingStyleParameters.decompositionLevelsCount\n );\n }\n\n let l = 0,\n r = 0,\n i = 0,\n k = 0;\n\n this.nextPacket = function JpxImage_nextPacket() {\n // Section B.12.1.1 Layer-resolution-component-position\n for (; l < layersCount; l++) {\n for (; r <= maxDecompositionLevelsCount; r++) {\n for (; i < componentsCount; i++) {\n const component = tile.components[i];\n if (r > component.codingStyleParameters.decompositionLevelsCount) {\n continue;\n }\n\n const resolution = component.resolutions[r];\n const numprecincts = resolution.precinctParameters.numprecincts;\n for (; k < numprecincts; ) {\n const packet = createPacket(resolution, k, l);\n k++;\n return packet;\n }\n k = 0;\n }\n i = 0;\n }\n r = 0;\n }\n throw new JpxError(\"Out of packets\");\n };\n}\nfunction ResolutionLayerComponentPositionIterator(context) {\n const siz = context.SIZ;\n const tileIndex = context.currentTile.index;\n const tile = context.tiles[tileIndex];\n const layersCount = tile.codingStyleDefaultParameters.layersCount;\n const componentsCount = siz.Csiz;\n let maxDecompositionLevelsCount = 0;\n for (let q = 0; q < componentsCount; q++) {\n maxDecompositionLevelsCount = Math.max(\n maxDecompositionLevelsCount,\n tile.components[q].codingStyleParameters.decompositionLevelsCount\n );\n }\n\n let r = 0,\n l = 0,\n i = 0,\n k = 0;\n\n this.nextPacket = function JpxImage_nextPacket() {\n // Section B.12.1.2 Resolution-layer-component-position\n for (; r <= maxDecompositionLevelsCount; r++) {\n for (; l < layersCount; l++) {\n for (; i < componentsCount; i++) {\n const component = tile.components[i];\n if (r > component.codingStyleParameters.decompositionLevelsCount) {\n continue;\n }\n\n const resolution = component.resolutions[r];\n const numprecincts = resolution.precinctParameters.numprecincts;\n for (; k < numprecincts; ) {\n const packet = createPacket(resolution, k, l);\n k++;\n return packet;\n }\n k = 0;\n }\n i = 0;\n }\n l = 0;\n }\n throw new JpxError(\"Out of packets\");\n };\n}\nfunction ResolutionPositionComponentLayerIterator(context) {\n const siz = context.SIZ;\n const tileIndex = context.currentTile.index;\n const tile = context.tiles[tileIndex];\n const layersCount = tile.codingStyleDefaultParameters.layersCount;\n const componentsCount = siz.Csiz;\n let l, r, c, p;\n let maxDecompositionLevelsCount = 0;\n for (c = 0; c < componentsCount; c++) {\n const component = tile.components[c];\n maxDecompositionLevelsCount = Math.max(\n maxDecompositionLevelsCount,\n component.codingStyleParameters.decompositionLevelsCount\n );\n }\n const maxNumPrecinctsInLevel = new Int32Array(\n maxDecompositionLevelsCount + 1\n );\n for (r = 0; r <= maxDecompositionLevelsCount; ++r) {\n let maxNumPrecincts = 0;\n for (c = 0; c < componentsCount; ++c) {\n const resolutions = tile.components[c].resolutions;\n if (r < resolutions.length) {\n maxNumPrecincts = Math.max(\n maxNumPrecincts,\n resolutions[r].precinctParameters.numprecincts\n );\n }\n }\n maxNumPrecinctsInLevel[r] = maxNumPrecincts;\n }\n l = 0;\n r = 0;\n c = 0;\n p = 0;\n\n this.nextPacket = function JpxImage_nextPacket() {\n // Section B.12.1.3 Resolution-position-component-layer\n for (; r <= maxDecompositionLevelsCount; r++) {\n for (; p < maxNumPrecinctsInLevel[r]; p++) {\n for (; c < componentsCount; c++) {\n const component = tile.components[c];\n if (r > component.codingStyleParameters.decompositionLevelsCount) {\n continue;\n }\n const resolution = component.resolutions[r];\n const numprecincts = resolution.precinctParameters.numprecincts;\n if (p >= numprecincts) {\n continue;\n }\n for (; l < layersCount; ) {\n const packet = createPacket(resolution, p, l);\n l++;\n return packet;\n }\n l = 0;\n }\n c = 0;\n }\n p = 0;\n }\n throw new JpxError(\"Out of packets\");\n };\n}\nfunction PositionComponentResolutionLayerIterator(context) {\n const siz = context.SIZ;\n const tileIndex = context.currentTile.index;\n const tile = context.tiles[tileIndex];\n const layersCount = tile.codingStyleDefaultParameters.layersCount;\n const componentsCount = siz.Csiz;\n const precinctsSizes = getPrecinctSizesInImageScale(tile);\n const precinctsIterationSizes = precinctsSizes;\n let l = 0,\n r = 0,\n c = 0,\n px = 0,\n py = 0;\n\n this.nextPacket = function JpxImage_nextPacket() {\n // Section B.12.1.4 Position-component-resolution-layer\n for (; py < precinctsIterationSizes.maxNumHigh; py++) {\n for (; px < precinctsIterationSizes.maxNumWide; px++) {\n for (; c < componentsCount; c++) {\n const component = tile.components[c];\n const decompositionLevelsCount =\n component.codingStyleParameters.decompositionLevelsCount;\n for (; r <= decompositionLevelsCount; r++) {\n const resolution = component.resolutions[r];\n const sizeInImageScale =\n precinctsSizes.components[c].resolutions[r];\n const k = getPrecinctIndexIfExist(\n px,\n py,\n sizeInImageScale,\n precinctsIterationSizes,\n resolution\n );\n if (k === null) {\n continue;\n }\n for (; l < layersCount; ) {\n const packet = createPacket(resolution, k, l);\n l++;\n return packet;\n }\n l = 0;\n }\n r = 0;\n }\n c = 0;\n }\n px = 0;\n }\n throw new JpxError(\"Out of packets\");\n };\n}\nfunction ComponentPositionResolutionLayerIterator(context) {\n const siz = context.SIZ;\n const tileIndex = context.currentTile.index;\n const tile = context.tiles[tileIndex];\n const layersCount = tile.codingStyleDefaultParameters.layersCount;\n const componentsCount = siz.Csiz;\n const precinctsSizes = getPrecinctSizesInImageScale(tile);\n let l = 0,\n r = 0,\n c = 0,\n px = 0,\n py = 0;\n\n this.nextPacket = function JpxImage_nextPacket() {\n // Section B.12.1.5 Component-position-resolution-layer\n for (; c < componentsCount; ++c) {\n const component = tile.components[c];\n const precinctsIterationSizes = precinctsSizes.components[c];\n const decompositionLevelsCount =\n component.codingStyleParameters.decompositionLevelsCount;\n for (; py < precinctsIterationSizes.maxNumHigh; py++) {\n for (; px < precinctsIterationSizes.maxNumWide; px++) {\n for (; r <= decompositionLevelsCount; r++) {\n const resolution = component.resolutions[r];\n const sizeInImageScale = precinctsIterationSizes.resolutions[r];\n const k = getPrecinctIndexIfExist(\n px,\n py,\n sizeInImageScale,\n precinctsIterationSizes,\n resolution\n );\n if (k === null) {\n continue;\n }\n for (; l < layersCount; ) {\n const packet = createPacket(resolution, k, l);\n l++;\n return packet;\n }\n l = 0;\n }\n r = 0;\n }\n px = 0;\n }\n py = 0;\n }\n throw new JpxError(\"Out of packets\");\n };\n}\nfunction getPrecinctIndexIfExist(\n pxIndex,\n pyIndex,\n sizeInImageScale,\n precinctIterationSizes,\n resolution\n) {\n const posX = pxIndex * precinctIterationSizes.minWidth;\n const posY = pyIndex * precinctIterationSizes.minHeight;\n if (\n posX % sizeInImageScale.width !== 0 ||\n posY % sizeInImageScale.height !== 0\n ) {\n return null;\n }\n const startPrecinctRowIndex =\n (posY / sizeInImageScale.width) *\n resolution.precinctParameters.numprecinctswide;\n return posX / sizeInImageScale.height + startPrecinctRowIndex;\n}\nfunction getPrecinctSizesInImageScale(tile) {\n const componentsCount = tile.components.length;\n let minWidth = Number.MAX_VALUE;\n let minHeight = Number.MAX_VALUE;\n let maxNumWide = 0;\n let maxNumHigh = 0;\n const sizePerComponent = new Array(componentsCount);\n for (let c = 0; c < componentsCount; c++) {\n const component = tile.components[c];\n const decompositionLevelsCount =\n component.codingStyleParameters.decompositionLevelsCount;\n const sizePerResolution = new Array(decompositionLevelsCount + 1);\n let minWidthCurrentComponent = Number.MAX_VALUE;\n let minHeightCurrentComponent = Number.MAX_VALUE;\n let maxNumWideCurrentComponent = 0;\n let maxNumHighCurrentComponent = 0;\n let scale = 1;\n for (let r = decompositionLevelsCount; r >= 0; --r) {\n const resolution = component.resolutions[r];\n const widthCurrentResolution =\n scale * resolution.precinctParameters.precinctWidth;\n const heightCurrentResolution =\n scale * resolution.precinctParameters.precinctHeight;\n minWidthCurrentComponent = Math.min(\n minWidthCurrentComponent,\n widthCurrentResolution\n );\n minHeightCurrentComponent = Math.min(\n minHeightCurrentComponent,\n heightCurrentResolution\n );\n maxNumWideCurrentComponent = Math.max(\n maxNumWideCurrentComponent,\n resolution.precinctParameters.numprecinctswide\n );\n maxNumHighCurrentComponent = Math.max(\n maxNumHighCurrentComponent,\n resolution.precinctParameters.numprecinctshigh\n );\n sizePerResolution[r] = {\n width: widthCurrentResolution,\n height: heightCurrentResolution,\n };\n scale <<= 1;\n }\n minWidth = Math.min(minWidth, minWidthCurrentComponent);\n minHeight = Math.min(minHeight, minHeightCurrentComponent);\n maxNumWide = Math.max(maxNumWide, maxNumWideCurrentComponent);\n maxNumHigh = Math.max(maxNumHigh, maxNumHighCurrentComponent);\n sizePerComponent[c] = {\n resolutions: sizePerResolution,\n minWidth: minWidthCurrentComponent,\n minHeight: minHeightCurrentComponent,\n maxNumWide: maxNumWideCurrentComponent,\n maxNumHigh: maxNumHighCurrentComponent,\n };\n }\n return {\n components: sizePerComponent,\n minWidth,\n minHeight,\n maxNumWide,\n maxNumHigh,\n };\n}\nfunction buildPackets(context) {\n const siz = context.SIZ;\n const tileIndex = context.currentTile.index;\n const tile = context.tiles[tileIndex];\n const componentsCount = siz.Csiz;\n // Creating resolutions and sub-bands for each component\n for (let c = 0; c < componentsCount; c++) {\n const component = tile.components[c];\n const decompositionLevelsCount =\n component.codingStyleParameters.decompositionLevelsCount;\n // Section B.5 Resolution levels and sub-bands\n const resolutions = [];\n const subbands = [];\n for (let r = 0; r <= decompositionLevelsCount; r++) {\n const blocksDimensions = getBlocksDimensions(context, component, r);\n const resolution = {};\n const scale = 1 << (decompositionLevelsCount - r);\n resolution.trx0 = Math.ceil(component.tcx0 / scale);\n resolution.try0 = Math.ceil(component.tcy0 / scale);\n resolution.trx1 = Math.ceil(component.tcx1 / scale);\n resolution.try1 = Math.ceil(component.tcy1 / scale);\n resolution.resLevel = r;\n buildPrecincts(context, resolution, blocksDimensions);\n resolutions.push(resolution);\n\n let subband;\n if (r === 0) {\n // one sub-band (LL) with last decomposition\n subband = {};\n subband.type = \"LL\";\n subband.tbx0 = Math.ceil(component.tcx0 / scale);\n subband.tby0 = Math.ceil(component.tcy0 / scale);\n subband.tbx1 = Math.ceil(component.tcx1 / scale);\n subband.tby1 = Math.ceil(component.tcy1 / scale);\n subband.resolution = resolution;\n buildCodeblocks(context, subband, blocksDimensions);\n subbands.push(subband);\n resolution.subbands = [subband];\n } else {\n const bscale = 1 << (decompositionLevelsCount - r + 1);\n const resolutionSubbands = [];\n // three sub-bands (HL, LH and HH) with rest of decompositions\n subband = {};\n subband.type = \"HL\";\n subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5);\n subband.tby0 = Math.ceil(component.tcy0 / bscale);\n subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5);\n subband.tby1 = Math.ceil(component.tcy1 / bscale);\n subband.resolution = resolution;\n buildCodeblocks(context, subband, blocksDimensions);\n subbands.push(subband);\n resolutionSubbands.push(subband);\n\n subband = {};\n subband.type = \"LH\";\n subband.tbx0 = Math.ceil(component.tcx0 / bscale);\n subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5);\n subband.tbx1 = Math.ceil(component.tcx1 / bscale);\n subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5);\n subband.resolution = resolution;\n buildCodeblocks(context, subband, blocksDimensions);\n subbands.push(subband);\n resolutionSubbands.push(subband);\n\n subband = {};\n subband.type = \"HH\";\n subband.tbx0 = Math.ceil(component.tcx0 / bscale - 0.5);\n subband.tby0 = Math.ceil(component.tcy0 / bscale - 0.5);\n subband.tbx1 = Math.ceil(component.tcx1 / bscale - 0.5);\n subband.tby1 = Math.ceil(component.tcy1 / bscale - 0.5);\n subband.resolution = resolution;\n buildCodeblocks(context, subband, blocksDimensions);\n subbands.push(subband);\n resolutionSubbands.push(subband);\n\n resolution.subbands = resolutionSubbands;\n }\n }\n component.resolutions = resolutions;\n component.subbands = subbands;\n }\n // Generate the packets sequence\n const progressionOrder = tile.codingStyleDefaultParameters.progressionOrder;\n switch (progressionOrder) {\n case 0:\n tile.packetsIterator = new LayerResolutionComponentPositionIterator(\n context\n );\n break;\n case 1:\n tile.packetsIterator = new ResolutionLayerComponentPositionIterator(\n context\n );\n break;\n case 2:\n tile.packetsIterator = new ResolutionPositionComponentLayerIterator(\n context\n );\n break;\n case 3:\n tile.packetsIterator = new PositionComponentResolutionLayerIterator(\n context\n );\n break;\n case 4:\n tile.packetsIterator = new ComponentPositionResolutionLayerIterator(\n context\n );\n break;\n default:\n throw new JpxError(`Unsupported progression order ${progressionOrder}`);\n }\n}\nfunction parseTilePackets(context, data, offset, dataLength) {\n let position = 0;\n let buffer,\n bufferSize = 0,\n skipNextBit = false;\n function readBits(count) {\n while (bufferSize < count) {\n const b = data[offset + position];\n position++;\n if (skipNextBit) {\n buffer = (buffer << 7) | b;\n bufferSize += 7;\n skipNextBit = false;\n } else {\n buffer = (buffer << 8) | b;\n bufferSize += 8;\n }\n if (b === 0xff) {\n skipNextBit = true;\n }\n }\n bufferSize -= count;\n return (buffer >>> bufferSize) & ((1 << count) - 1);\n }\n function skipMarkerIfEqual(value) {\n if (\n data[offset + position - 1] === 0xff &&\n data[offset + position] === value\n ) {\n skipBytes(1);\n return true;\n } else if (\n data[offset + position] === 0xff &&\n data[offset + position + 1] === value\n ) {\n skipBytes(2);\n return true;\n }\n return false;\n }\n function skipBytes(count) {\n position += count;\n }\n function alignToByte() {\n bufferSize = 0;\n if (skipNextBit) {\n position++;\n skipNextBit = false;\n }\n }\n function readCodingpasses() {\n if (readBits(1) === 0) {\n return 1;\n }\n if (readBits(1) === 0) {\n return 2;\n }\n let value = readBits(2);\n if (value < 3) {\n return value + 3;\n }\n value = readBits(5);\n if (value < 31) {\n return value + 6;\n }\n value = readBits(7);\n return value + 37;\n }\n const tileIndex = context.currentTile.index;\n const tile = context.tiles[tileIndex];\n const sopMarkerUsed = context.COD.sopMarkerUsed;\n const ephMarkerUsed = context.COD.ephMarkerUsed;\n const packetsIterator = tile.packetsIterator;\n while (position < dataLength) {\n alignToByte();\n if (sopMarkerUsed && skipMarkerIfEqual(0x91)) {\n // Skip also marker segment length and packet sequence ID\n skipBytes(4);\n }\n const packet = packetsIterator.nextPacket();\n if (!readBits(1)) {\n continue;\n }\n const layerNumber = packet.layerNumber,\n queue = [];\n let codeblock;\n for (let i = 0, ii = packet.codeblocks.length; i < ii; i++) {\n codeblock = packet.codeblocks[i];\n let precinct = codeblock.precinct;\n const codeblockColumn = codeblock.cbx - precinct.cbxMin;\n const codeblockRow = codeblock.cby - precinct.cbyMin;\n let codeblockIncluded = false;\n let firstTimeInclusion = false;\n let valueReady, zeroBitPlanesTree;\n if (codeblock.included !== undefined) {\n codeblockIncluded = !!readBits(1);\n } else {\n // reading inclusion tree\n precinct = codeblock.precinct;\n let inclusionTree;\n if (precinct.inclusionTree !== undefined) {\n inclusionTree = precinct.inclusionTree;\n } else {\n // building inclusion and zero bit-planes trees\n const width = precinct.cbxMax - precinct.cbxMin + 1;\n const height = precinct.cbyMax - precinct.cbyMin + 1;\n inclusionTree = new InclusionTree(width, height, layerNumber);\n zeroBitPlanesTree = new TagTree(width, height);\n precinct.inclusionTree = inclusionTree;\n precinct.zeroBitPlanesTree = zeroBitPlanesTree;\n for (let l = 0; l < layerNumber; l++) {\n if (readBits(1) !== 0) {\n throw new JpxError(\"Invalid tag tree\");\n }\n }\n }\n\n if (inclusionTree.reset(codeblockColumn, codeblockRow, layerNumber)) {\n while (true) {\n if (readBits(1)) {\n valueReady = !inclusionTree.nextLevel();\n if (valueReady) {\n codeblock.included = true;\n codeblockIncluded = firstTimeInclusion = true;\n break;\n }\n } else {\n inclusionTree.incrementValue(layerNumber);\n break;\n }\n }\n }\n }\n if (!codeblockIncluded) {\n continue;\n }\n if (firstTimeInclusion) {\n zeroBitPlanesTree = precinct.zeroBitPlanesTree;\n zeroBitPlanesTree.reset(codeblockColumn, codeblockRow);\n while (true) {\n if (readBits(1)) {\n valueReady = !zeroBitPlanesTree.nextLevel();\n if (valueReady) {\n break;\n }\n } else {\n zeroBitPlanesTree.incrementValue();\n }\n }\n codeblock.zeroBitPlanes = zeroBitPlanesTree.value;\n }\n const codingpasses = readCodingpasses();\n while (readBits(1)) {\n codeblock.Lblock++;\n }\n const codingpassesLog2 = log2(codingpasses);\n // rounding down log2\n const bits =\n (codingpasses < 1 << codingpassesLog2\n ? codingpassesLog2 - 1\n : codingpassesLog2) + codeblock.Lblock;\n const codedDataLength = readBits(bits);\n queue.push({\n codeblock,\n codingpasses,\n dataLength: codedDataLength,\n });\n }\n alignToByte();\n if (ephMarkerUsed) {\n skipMarkerIfEqual(0x92);\n }\n while (queue.length > 0) {\n const packetItem = queue.shift();\n codeblock = packetItem.codeblock;\n if (codeblock.data === undefined) {\n codeblock.data = [];\n }\n codeblock.data.push({\n data,\n start: offset + position,\n end: offset + position + packetItem.dataLength,\n codingpasses: packetItem.codingpasses,\n });\n position += packetItem.dataLength;\n }\n }\n return position;\n}\nfunction copyCoefficients(\n coefficients,\n levelWidth,\n levelHeight,\n subband,\n delta,\n mb,\n reversible,\n segmentationSymbolUsed,\n resetContextProbabilities\n) {\n const x0 = subband.tbx0;\n const y0 = subband.tby0;\n const width = subband.tbx1 - subband.tbx0;\n const codeblocks = subband.codeblocks;\n const right = subband.type.charAt(0) === \"H\" ? 1 : 0;\n const bottom = subband.type.charAt(1) === \"H\" ? levelWidth : 0;\n\n for (let i = 0, ii = codeblocks.length; i < ii; ++i) {\n const codeblock = codeblocks[i];\n const blockWidth = codeblock.tbx1_ - codeblock.tbx0_;\n const blockHeight = codeblock.tby1_ - codeblock.tby0_;\n if (blockWidth === 0 || blockHeight === 0) {\n continue;\n }\n if (codeblock.data === undefined) {\n continue;\n }\n\n const bitModel = new BitModel(\n blockWidth,\n blockHeight,\n codeblock.subbandType,\n codeblock.zeroBitPlanes,\n mb\n );\n let currentCodingpassType = 2; // first bit plane starts from cleanup\n\n // collect data\n const data = codeblock.data;\n let totalLength = 0,\n codingpasses = 0;\n let j, jj, dataItem;\n for (j = 0, jj = data.length; j < jj; j++) {\n dataItem = data[j];\n totalLength += dataItem.end - dataItem.start;\n codingpasses += dataItem.codingpasses;\n }\n const encodedData = new Uint8Array(totalLength);\n let position = 0;\n for (j = 0, jj = data.length; j < jj; j++) {\n dataItem = data[j];\n const chunk = dataItem.data.subarray(dataItem.start, dataItem.end);\n encodedData.set(chunk, position);\n position += chunk.length;\n }\n // decoding the item\n const decoder = new ArithmeticDecoder(encodedData, 0, totalLength);\n bitModel.setDecoder(decoder);\n\n for (j = 0; j < codingpasses; j++) {\n switch (currentCodingpassType) {\n case 0:\n bitModel.runSignificancePropagationPass();\n break;\n case 1:\n bitModel.runMagnitudeRefinementPass();\n break;\n case 2:\n bitModel.runCleanupPass();\n if (segmentationSymbolUsed) {\n bitModel.checkSegmentationSymbol();\n }\n break;\n }\n\n if (resetContextProbabilities) {\n bitModel.reset();\n }\n\n currentCodingpassType = (currentCodingpassType + 1) % 3;\n }\n\n let offset = codeblock.tbx0_ - x0 + (codeblock.tby0_ - y0) * width;\n const sign = bitModel.coefficentsSign;\n const magnitude = bitModel.coefficentsMagnitude;\n const bitsDecoded = bitModel.bitsDecoded;\n const magnitudeCorrection = reversible ? 0 : 0.5;\n let k, n, nb;\n position = 0;\n // Do the interleaving of Section F.3.3 here, so we do not need\n // to copy later. LL level is not interleaved, just copied.\n const interleave = subband.type !== \"LL\";\n for (j = 0; j < blockHeight; j++) {\n const row = (offset / width) | 0; // row in the non-interleaved subband\n const levelOffset = 2 * row * (levelWidth - width) + right + bottom;\n for (k = 0; k < blockWidth; k++) {\n n = magnitude[position];\n if (n !== 0) {\n n = (n + magnitudeCorrection) * delta;\n if (sign[position] !== 0) {\n n = -n;\n }\n nb = bitsDecoded[position];\n const pos = interleave ? levelOffset + (offset << 1) : offset;\n coefficients[pos] = reversible && nb >= mb ? n : n * (1 << (mb - nb));\n }\n offset++;\n position++;\n }\n offset += width - blockWidth;\n }\n }\n}\nfunction transformTile(context, tile, c) {\n const component = tile.components[c];\n const codingStyleParameters = component.codingStyleParameters;\n const quantizationParameters = component.quantizationParameters;\n const decompositionLevelsCount =\n codingStyleParameters.decompositionLevelsCount;\n const spqcds = quantizationParameters.SPqcds;\n const scalarExpounded = quantizationParameters.scalarExpounded;\n const guardBits = quantizationParameters.guardBits;\n const segmentationSymbolUsed = codingStyleParameters.segmentationSymbolUsed;\n const resetContextProbabilities =\n codingStyleParameters.resetContextProbabilities;\n const precision = context.components[c].precision;\n\n const reversible = codingStyleParameters.reversibleTransformation;\n const transform = reversible\n ? new ReversibleTransform()\n : new IrreversibleTransform();\n\n const subbandCoefficients = [];\n let b = 0;\n for (let i = 0; i <= decompositionLevelsCount; i++) {\n const resolution = component.resolutions[i];\n\n const width = resolution.trx1 - resolution.trx0;\n const height = resolution.try1 - resolution.try0;\n // Allocate space for the whole sublevel.\n const coefficients = new Float32Array(width * height);\n\n for (let j = 0, jj = resolution.subbands.length; j < jj; j++) {\n let mu, epsilon;\n if (!scalarExpounded) {\n // formula E-5\n mu = spqcds[0].mu;\n epsilon = spqcds[0].epsilon + (i > 0 ? 1 - i : 0);\n } else {\n mu = spqcds[b].mu;\n epsilon = spqcds[b].epsilon;\n b++;\n }\n\n const subband = resolution.subbands[j];\n const gainLog2 = SubbandsGainLog2[subband.type];\n\n // calculate quantization coefficient (Section E.1.1.1)\n const delta = reversible\n ? 1\n : 2 ** (precision + gainLog2 - epsilon) * (1 + mu / 2048);\n const mb = guardBits + epsilon - 1;\n\n // In the first resolution level, copyCoefficients will fill the\n // whole array with coefficients. In the succeeding passes,\n // copyCoefficients will consecutively fill in the values that belong\n // to the interleaved positions of the HL, LH, and HH coefficients.\n // The LL coefficients will then be interleaved in Transform.iterate().\n copyCoefficients(\n coefficients,\n width,\n height,\n subband,\n delta,\n mb,\n reversible,\n segmentationSymbolUsed,\n resetContextProbabilities\n );\n }\n subbandCoefficients.push({\n width,\n height,\n items: coefficients,\n });\n }\n\n const result = transform.calculate(\n subbandCoefficients,\n component.tcx0,\n component.tcy0\n );\n return {\n left: component.tcx0,\n top: component.tcy0,\n width: result.width,\n height: result.height,\n items: result.items,\n };\n}\nfunction transformComponents(context) {\n const siz = context.SIZ;\n const components = context.components;\n const componentsCount = siz.Csiz;\n const resultImages = [];\n for (let i = 0, ii = context.tiles.length; i < ii; i++) {\n const tile = context.tiles[i];\n const transformedTiles = [];\n for (let c = 0; c < componentsCount; c++) {\n transformedTiles[c] = transformTile(context, tile, c);\n }\n const tile0 = transformedTiles[0];\n const out = new Uint8ClampedArray(tile0.items.length * componentsCount);\n const result = {\n left: tile0.left,\n top: tile0.top,\n width: tile0.width,\n height: tile0.height,\n items: out,\n };\n\n // Section G.2.2 Inverse multi component transform\n let shift, offset;\n let pos = 0,\n j,\n jj,\n y0,\n y1,\n y2;\n if (tile.codingStyleDefaultParameters.multipleComponentTransform) {\n const fourComponents = componentsCount === 4;\n const y0items = transformedTiles[0].items;\n const y1items = transformedTiles[1].items;\n const y2items = transformedTiles[2].items;\n const y3items = fourComponents ? transformedTiles[3].items : null;\n\n // HACK: The multiple component transform formulas below assume that\n // all components have the same precision. With this in mind, we\n // compute shift and offset only once.\n shift = components[0].precision - 8;\n offset = (128 << shift) + 0.5;\n\n const component0 = tile.components[0];\n const alpha01 = componentsCount - 3;\n jj = y0items.length;\n if (!component0.codingStyleParameters.reversibleTransformation) {\n // inverse irreversible multiple component transform\n for (j = 0; j < jj; j++, pos += alpha01) {\n y0 = y0items[j] + offset;\n y1 = y1items[j];\n y2 = y2items[j];\n out[pos++] = (y0 + 1.402 * y2) >> shift;\n out[pos++] = (y0 - 0.34413 * y1 - 0.71414 * y2) >> shift;\n out[pos++] = (y0 + 1.772 * y1) >> shift;\n }\n } else {\n // inverse reversible multiple component transform\n for (j = 0; j < jj; j++, pos += alpha01) {\n y0 = y0items[j] + offset;\n y1 = y1items[j];\n y2 = y2items[j];\n const g = y0 - ((y2 + y1) >> 2);\n\n out[pos++] = (g + y2) >> shift;\n out[pos++] = g >> shift;\n out[pos++] = (g + y1) >> shift;\n }\n }\n if (fourComponents) {\n for (j = 0, pos = 3; j < jj; j++, pos += 4) {\n out[pos] = (y3items[j] + offset) >> shift;\n }\n }\n } else {\n // no multi-component transform\n for (let c = 0; c < componentsCount; c++) {\n const items = transformedTiles[c].items;\n shift = components[c].precision - 8;\n offset = (128 << shift) + 0.5;\n for (pos = c, j = 0, jj = items.length; j < jj; j++) {\n out[pos] = (items[j] + offset) >> shift;\n pos += componentsCount;\n }\n }\n }\n resultImages.push(result);\n }\n return resultImages;\n}\nfunction initializeTile(context, tileIndex) {\n const siz = context.SIZ;\n const componentsCount = siz.Csiz;\n const tile = context.tiles[tileIndex];\n for (let c = 0; c < componentsCount; c++) {\n const component = tile.components[c];\n const qcdOrQcc =\n context.currentTile.QCC[c] !== undefined\n ? context.currentTile.QCC[c]\n : context.currentTile.QCD;\n component.quantizationParameters = qcdOrQcc;\n const codOrCoc =\n context.currentTile.COC[c] !== undefined\n ? context.currentTile.COC[c]\n : context.currentTile.COD;\n component.codingStyleParameters = codOrCoc;\n }\n tile.codingStyleDefaultParameters = context.currentTile.COD;\n}\n\n// Section B.10.2 Tag trees\nclass TagTree {\n constructor(width, height) {\n const levelsLength = log2(Math.max(width, height)) + 1;\n this.levels = [];\n for (let i = 0; i < levelsLength; i++) {\n const level = {\n width,\n height,\n items: [],\n };\n this.levels.push(level);\n width = Math.ceil(width / 2);\n height = Math.ceil(height / 2);\n }\n }\n\n reset(i, j) {\n let currentLevel = 0,\n value = 0,\n level;\n while (currentLevel < this.levels.length) {\n level = this.levels[currentLevel];\n const index = i + j * level.width;\n if (level.items[index] !== undefined) {\n value = level.items[index];\n break;\n }\n level.index = index;\n i >>= 1;\n j >>= 1;\n currentLevel++;\n }\n currentLevel--;\n level = this.levels[currentLevel];\n level.items[level.index] = value;\n this.currentLevel = currentLevel;\n delete this.value;\n }\n\n incrementValue() {\n const level = this.levels[this.currentLevel];\n level.items[level.index]++;\n }\n\n nextLevel() {\n let currentLevel = this.currentLevel;\n let level = this.levels[currentLevel];\n const value = level.items[level.index];\n currentLevel--;\n if (currentLevel < 0) {\n this.value = value;\n return false;\n }\n\n this.currentLevel = currentLevel;\n level = this.levels[currentLevel];\n level.items[level.index] = value;\n return true;\n }\n}\n\nclass InclusionTree {\n constructor(width, height, defaultValue) {\n const levelsLength = log2(Math.max(width, height)) + 1;\n this.levels = [];\n for (let i = 0; i < levelsLength; i++) {\n const items = new Uint8Array(width * height);\n for (let j = 0, jj = items.length; j < jj; j++) {\n items[j] = defaultValue;\n }\n\n const level = {\n width,\n height,\n items,\n };\n this.levels.push(level);\n\n width = Math.ceil(width / 2);\n height = Math.ceil(height / 2);\n }\n }\n\n reset(i, j, stopValue) {\n let currentLevel = 0;\n while (currentLevel < this.levels.length) {\n const level = this.levels[currentLevel];\n const index = i + j * level.width;\n level.index = index;\n const value = level.items[index];\n\n if (value === 0xff) {\n break;\n }\n\n if (value > stopValue) {\n this.currentLevel = currentLevel;\n // already know about this one, propagating the value to top levels\n this.propagateValues();\n return false;\n }\n\n i >>= 1;\n j >>= 1;\n currentLevel++;\n }\n this.currentLevel = currentLevel - 1;\n return true;\n }\n\n incrementValue(stopValue) {\n const level = this.levels[this.currentLevel];\n level.items[level.index] = stopValue + 1;\n this.propagateValues();\n }\n\n propagateValues() {\n let levelIndex = this.currentLevel;\n let level = this.levels[levelIndex];\n const currentValue = level.items[level.index];\n while (--levelIndex >= 0) {\n level = this.levels[levelIndex];\n level.items[level.index] = currentValue;\n }\n }\n\n nextLevel() {\n let currentLevel = this.currentLevel;\n let level = this.levels[currentLevel];\n const value = level.items[level.index];\n level.items[level.index] = 0xff;\n currentLevel--;\n if (currentLevel < 0) {\n return false;\n }\n\n this.currentLevel = currentLevel;\n level = this.levels[currentLevel];\n level.items[level.index] = value;\n return true;\n }\n}\n\n// Section D. Coefficient bit modeling\nclass BitModel {\n static UNIFORM_CONTEXT = 17;\n\n static RUNLENGTH_CONTEXT = 18;\n\n // Table D-1\n // The index is binary presentation: 0dddvvhh, ddd - sum of Di (0..4),\n // vv - sum of Vi (0..2), and hh - sum of Hi (0..2)\n static LLAndLHContextsLabel = new Uint8Array([\n 0, 5, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 1, 6, 8, 0, 3, 7, 8, 0, 4,\n 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6,\n 8, 0, 3, 7, 8, 0, 4, 7, 8, 0, 0, 0, 0, 0, 2, 6, 8, 0, 3, 7, 8, 0, 4, 7, 8,\n ]);\n\n static HLContextLabel = new Uint8Array([\n 0, 3, 4, 0, 5, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 1, 3, 4, 0, 6, 7, 7, 0, 8,\n 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3,\n 4, 0, 6, 7, 7, 0, 8, 8, 8, 0, 0, 0, 0, 0, 2, 3, 4, 0, 6, 7, 7, 0, 8, 8, 8,\n ]);\n\n static HHContextLabel = new Uint8Array([\n 0, 1, 2, 0, 1, 2, 2, 0, 2, 2, 2, 0, 0, 0, 0, 0, 3, 4, 5, 0, 4, 5, 5, 0, 5,\n 5, 5, 0, 0, 0, 0, 0, 6, 7, 7, 0, 7, 7, 7, 0, 7, 7, 7, 0, 0, 0, 0, 0, 8, 8,\n 8, 0, 8, 8, 8, 0, 8, 8, 8, 0, 0, 0, 0, 0, 8, 8, 8, 0, 8, 8, 8, 0, 8, 8, 8,\n ]);\n\n constructor(width, height, subband, zeroBitPlanes, mb) {\n this.width = width;\n this.height = height;\n\n let contextLabelTable;\n if (subband === \"HH\") {\n contextLabelTable = BitModel.HHContextLabel;\n } else if (subband === \"HL\") {\n contextLabelTable = BitModel.HLContextLabel;\n } else {\n contextLabelTable = BitModel.LLAndLHContextsLabel;\n }\n this.contextLabelTable = contextLabelTable;\n\n const coefficientCount = width * height;\n\n // coefficients outside the encoding region treated as insignificant\n // add border state cells for significanceState\n this.neighborsSignificance = new Uint8Array(coefficientCount);\n this.coefficentsSign = new Uint8Array(coefficientCount);\n let coefficentsMagnitude;\n if (mb > 14) {\n coefficentsMagnitude = new Uint32Array(coefficientCount);\n } else if (mb > 6) {\n coefficentsMagnitude = new Uint16Array(coefficientCount);\n } else {\n coefficentsMagnitude = new Uint8Array(coefficientCount);\n }\n this.coefficentsMagnitude = coefficentsMagnitude;\n this.processingFlags = new Uint8Array(coefficientCount);\n\n const bitsDecoded = new Uint8Array(coefficientCount);\n if (zeroBitPlanes !== 0) {\n for (let i = 0; i < coefficientCount; i++) {\n bitsDecoded[i] = zeroBitPlanes;\n }\n }\n this.bitsDecoded = bitsDecoded;\n\n this.reset();\n }\n\n setDecoder(decoder) {\n this.decoder = decoder;\n }\n\n reset() {\n // We have 17 contexts that are accessed via context labels,\n // plus the uniform and runlength context.\n this.contexts = new Int8Array(19);\n\n // Contexts are packed into 1 byte:\n // highest 7 bits carry the index, lowest bit carries mps\n this.contexts[0] = (4 << 1) | 0;\n this.contexts[BitModel.UNIFORM_CONTEXT] = (46 << 1) | 0;\n this.contexts[BitModel.RUNLENGTH_CONTEXT] = (3 << 1) | 0;\n }\n\n setNeighborsSignificance(row, column, index) {\n const neighborsSignificance = this.neighborsSignificance;\n const width = this.width,\n height = this.height;\n const left = column > 0;\n const right = column + 1 < width;\n let i;\n\n if (row > 0) {\n i = index - width;\n if (left) {\n neighborsSignificance[i - 1] += 0x10;\n }\n if (right) {\n neighborsSignificance[i + 1] += 0x10;\n }\n neighborsSignificance[i] += 0x04;\n }\n\n if (row + 1 < height) {\n i = index + width;\n if (left) {\n neighborsSignificance[i - 1] += 0x10;\n }\n if (right) {\n neighborsSignificance[i + 1] += 0x10;\n }\n neighborsSignificance[i] += 0x04;\n }\n\n if (left) {\n neighborsSignificance[index - 1] += 0x01;\n }\n if (right) {\n neighborsSignificance[index + 1] += 0x01;\n }\n neighborsSignificance[index] |= 0x80;\n }\n\n runSignificancePropagationPass() {\n const decoder = this.decoder;\n const width = this.width,\n height = this.height;\n const coefficentsMagnitude = this.coefficentsMagnitude;\n const coefficentsSign = this.coefficentsSign;\n const neighborsSignificance = this.neighborsSignificance;\n const processingFlags = this.processingFlags;\n const contexts = this.contexts;\n const labels = this.contextLabelTable;\n const bitsDecoded = this.bitsDecoded;\n const processedInverseMask = ~1;\n const processedMask = 1;\n const firstMagnitudeBitMask = 2;\n\n for (let i0 = 0; i0 < height; i0 += 4) {\n for (let j = 0; j < width; j++) {\n let index = i0 * width + j;\n for (let i1 = 0; i1 < 4; i1++, index += width) {\n const i = i0 + i1;\n if (i >= height) {\n break;\n }\n // clear processed flag first\n processingFlags[index] &= processedInverseMask;\n\n if (coefficentsMagnitude[index] || !neighborsSignificance[index]) {\n continue;\n }\n\n const contextLabel = labels[neighborsSignificance[index]];\n const decision = decoder.readBit(contexts, contextLabel);\n if (decision) {\n const sign = this.decodeSignBit(i, j, index);\n coefficentsSign[index] = sign;\n coefficentsMagnitude[index] = 1;\n this.setNeighborsSignificance(i, j, index);\n processingFlags[index] |= firstMagnitudeBitMask;\n }\n bitsDecoded[index]++;\n processingFlags[index] |= processedMask;\n }\n }\n }\n }\n\n decodeSignBit(row, column, index) {\n const width = this.width,\n height = this.height;\n const coefficentsMagnitude = this.coefficentsMagnitude;\n const coefficentsSign = this.coefficentsSign;\n let contribution, sign0, sign1, significance1;\n let contextLabel, decoded;\n\n // calculate horizontal contribution\n significance1 = column > 0 && coefficentsMagnitude[index - 1] !== 0;\n if (column + 1 < width && coefficentsMagnitude[index + 1] !== 0) {\n sign1 = coefficentsSign[index + 1];\n if (significance1) {\n sign0 = coefficentsSign[index - 1];\n contribution = 1 - sign1 - sign0;\n } else {\n contribution = 1 - sign1 - sign1;\n }\n } else if (significance1) {\n sign0 = coefficentsSign[index - 1];\n contribution = 1 - sign0 - sign0;\n } else {\n contribution = 0;\n }\n const horizontalContribution = 3 * contribution;\n\n // calculate vertical contribution and combine with the horizontal\n significance1 = row > 0 && coefficentsMagnitude[index - width] !== 0;\n if (row + 1 < height && coefficentsMagnitude[index + width] !== 0) {\n sign1 = coefficentsSign[index + width];\n if (significance1) {\n sign0 = coefficentsSign[index - width];\n contribution = 1 - sign1 - sign0 + horizontalContribution;\n } else {\n contribution = 1 - sign1 - sign1 + horizontalContribution;\n }\n } else if (significance1) {\n sign0 = coefficentsSign[index - width];\n contribution = 1 - sign0 - sign0 + horizontalContribution;\n } else {\n contribution = horizontalContribution;\n }\n\n if (contribution >= 0) {\n contextLabel = 9 + contribution;\n decoded = this.decoder.readBit(this.contexts, contextLabel);\n } else {\n contextLabel = 9 - contribution;\n decoded = this.decoder.readBit(this.contexts, contextLabel) ^ 1;\n }\n return decoded;\n }\n\n runMagnitudeRefinementPass() {\n const decoder = this.decoder;\n const width = this.width,\n height = this.height;\n const coefficentsMagnitude = this.coefficentsMagnitude;\n const neighborsSignificance = this.neighborsSignificance;\n const contexts = this.contexts;\n const bitsDecoded = this.bitsDecoded;\n const processingFlags = this.processingFlags;\n const processedMask = 1;\n const firstMagnitudeBitMask = 2;\n const length = width * height;\n const width4 = width * 4;\n\n for (let index0 = 0, indexNext; index0 < length; index0 = indexNext) {\n indexNext = Math.min(length, index0 + width4);\n for (let j = 0; j < width; j++) {\n for (let index = index0 + j; index < indexNext; index += width) {\n // significant but not those that have just become\n if (\n !coefficentsMagnitude[index] ||\n (processingFlags[index] & processedMask) !== 0\n ) {\n continue;\n }\n\n let contextLabel = 16;\n if ((processingFlags[index] & firstMagnitudeBitMask) !== 0) {\n processingFlags[index] ^= firstMagnitudeBitMask;\n // first refinement\n const significance = neighborsSignificance[index] & 127;\n contextLabel = significance === 0 ? 15 : 14;\n }\n\n const bit = decoder.readBit(contexts, contextLabel);\n coefficentsMagnitude[index] =\n (coefficentsMagnitude[index] << 1) | bit;\n bitsDecoded[index]++;\n processingFlags[index] |= processedMask;\n }\n }\n }\n }\n\n runCleanupPass() {\n const decoder = this.decoder;\n const width = this.width,\n height = this.height;\n const neighborsSignificance = this.neighborsSignificance;\n const coefficentsMagnitude = this.coefficentsMagnitude;\n const coefficentsSign = this.coefficentsSign;\n const contexts = this.contexts;\n const labels = this.contextLabelTable;\n const bitsDecoded = this.bitsDecoded;\n const processingFlags = this.processingFlags;\n const processedMask = 1;\n const firstMagnitudeBitMask = 2;\n const oneRowDown = width;\n const twoRowsDown = width * 2;\n const threeRowsDown = width * 3;\n let iNext;\n for (let i0 = 0; i0 < height; i0 = iNext) {\n iNext = Math.min(i0 + 4, height);\n const indexBase = i0 * width;\n const checkAllEmpty = i0 + 3 < height;\n for (let j = 0; j < width; j++) {\n const index0 = indexBase + j;\n // using the property: labels[neighborsSignificance[index]] === 0\n // when neighborsSignificance[index] === 0\n const allEmpty =\n checkAllEmpty &&\n processingFlags[index0] === 0 &&\n processingFlags[index0 + oneRowDown] === 0 &&\n processingFlags[index0 + twoRowsDown] === 0 &&\n processingFlags[index0 + threeRowsDown] === 0 &&\n neighborsSignificance[index0] === 0 &&\n neighborsSignificance[index0 + oneRowDown] === 0 &&\n neighborsSignificance[index0 + twoRowsDown] === 0 &&\n neighborsSignificance[index0 + threeRowsDown] === 0;\n let i1 = 0,\n index = index0;\n let i = i0,\n sign;\n if (allEmpty) {\n const hasSignificantCoefficent = decoder.readBit(\n contexts,\n BitModel.RUNLENGTH_CONTEXT\n );\n if (!hasSignificantCoefficent) {\n bitsDecoded[index0]++;\n bitsDecoded[index0 + oneRowDown]++;\n bitsDecoded[index0 + twoRowsDown]++;\n bitsDecoded[index0 + threeRowsDown]++;\n continue; // next column\n }\n i1 =\n (decoder.readBit(contexts, BitModel.UNIFORM_CONTEXT) << 1) |\n decoder.readBit(contexts, BitModel.UNIFORM_CONTEXT);\n if (i1 !== 0) {\n i = i0 + i1;\n index += i1 * width;\n }\n\n sign = this.decodeSignBit(i, j, index);\n coefficentsSign[index] = sign;\n coefficentsMagnitude[index] = 1;\n this.setNeighborsSignificance(i, j, index);\n processingFlags[index] |= firstMagnitudeBitMask;\n\n index = index0;\n for (let i2 = i0; i2 <= i; i2++, index += width) {\n bitsDecoded[index]++;\n }\n\n i1++;\n }\n for (i = i0 + i1; i < iNext; i++, index += width) {\n if (\n coefficentsMagnitude[index] ||\n (processingFlags[index] & processedMask) !== 0\n ) {\n continue;\n }\n\n const contextLabel = labels[neighborsSignificance[index]];\n const decision = decoder.readBit(contexts, contextLabel);\n if (decision === 1) {\n sign = this.decodeSignBit(i, j, index);\n coefficentsSign[index] = sign;\n coefficentsMagnitude[index] = 1;\n this.setNeighborsSignificance(i, j, index);\n processingFlags[index] |= firstMagnitudeBitMask;\n }\n bitsDecoded[index]++;\n }\n }\n }\n }\n\n checkSegmentationSymbol() {\n const decoder = this.decoder;\n const contexts = this.contexts;\n const symbol =\n (decoder.readBit(contexts, BitModel.UNIFORM_CONTEXT) << 3) |\n (decoder.readBit(contexts, BitModel.UNIFORM_CONTEXT) << 2) |\n (decoder.readBit(contexts, BitModel.UNIFORM_CONTEXT) << 1) |\n decoder.readBit(contexts, BitModel.UNIFORM_CONTEXT);\n if (symbol !== 0xa) {\n throw new JpxError(\"Invalid segmentation symbol\");\n }\n }\n}\n\n// Section F, Discrete wavelet transformation\nclass Transform {\n constructor() {\n if (this.constructor === Transform) {\n unreachable(\"Cannot initialize Transform.\");\n }\n }\n\n calculate(subbands, u0, v0) {\n let ll = subbands[0];\n for (let i = 1, ii = subbands.length; i < ii; i++) {\n ll = this.iterate(ll, subbands[i], u0, v0);\n }\n return ll;\n }\n\n extend(buffer, offset, size) {\n // Section F.3.7 extending... using max extension of 4\n let i1 = offset - 1,\n j1 = offset + 1;\n let i2 = offset + size - 2,\n j2 = offset + size;\n buffer[i1--] = buffer[j1++];\n buffer[j2++] = buffer[i2--];\n buffer[i1--] = buffer[j1++];\n buffer[j2++] = buffer[i2--];\n buffer[i1--] = buffer[j1++];\n buffer[j2++] = buffer[i2--];\n buffer[i1] = buffer[j1];\n buffer[j2] = buffer[i2];\n }\n\n filter(x, offset, length) {\n unreachable(\"Abstract method `filter` called\");\n }\n\n iterate(ll, hl_lh_hh, u0, v0) {\n const llWidth = ll.width,\n llHeight = ll.height;\n let llItems = ll.items;\n const width = hl_lh_hh.width;\n const height = hl_lh_hh.height;\n const items = hl_lh_hh.items;\n let i, j, k, l, u, v;\n\n // Interleave LL according to Section F.3.3\n for (k = 0, i = 0; i < llHeight; i++) {\n l = i * 2 * width;\n for (j = 0; j < llWidth; j++, k++, l += 2) {\n items[l] = llItems[k];\n }\n }\n // The LL band is not needed anymore.\n llItems = ll.items = null;\n\n const bufferPadding = 4;\n const rowBuffer = new Float32Array(width + 2 * bufferPadding);\n\n // Section F.3.4 HOR_SR\n if (width === 1) {\n // if width = 1, when u0 even keep items as is, when odd divide by 2\n if ((u0 & 1) !== 0) {\n for (v = 0, k = 0; v < height; v++, k += width) {\n items[k] *= 0.5;\n }\n }\n } else {\n for (v = 0, k = 0; v < height; v++, k += width) {\n rowBuffer.set(items.subarray(k, k + width), bufferPadding);\n\n this.extend(rowBuffer, bufferPadding, width);\n this.filter(rowBuffer, bufferPadding, width);\n\n items.set(rowBuffer.subarray(bufferPadding, bufferPadding + width), k);\n }\n }\n\n // Accesses to the items array can take long, because it may not fit into\n // CPU cache and has to be fetched from main memory. Since subsequent\n // accesses to the items array are not local when reading columns, we\n // have a cache miss every time. To reduce cache misses, get up to\n // 'numBuffers' items at a time and store them into the individual\n // buffers. The colBuffers should be small enough to fit into CPU cache.\n let numBuffers = 16;\n const colBuffers = [];\n for (i = 0; i < numBuffers; i++) {\n colBuffers.push(new Float32Array(height + 2 * bufferPadding));\n }\n let b,\n currentBuffer = 0;\n ll = bufferPadding + height;\n\n // Section F.3.5 VER_SR\n if (height === 1) {\n // if height = 1, when v0 even keep items as is, when odd divide by 2\n if ((v0 & 1) !== 0) {\n for (u = 0; u < width; u++) {\n items[u] *= 0.5;\n }\n }\n } else {\n for (u = 0; u < width; u++) {\n // if we ran out of buffers, copy several image columns at once\n if (currentBuffer === 0) {\n numBuffers = Math.min(width - u, numBuffers);\n for (k = u, l = bufferPadding; l < ll; k += width, l++) {\n for (b = 0; b < numBuffers; b++) {\n colBuffers[b][l] = items[k + b];\n }\n }\n currentBuffer = numBuffers;\n }\n\n currentBuffer--;\n const buffer = colBuffers[currentBuffer];\n this.extend(buffer, bufferPadding, height);\n this.filter(buffer, bufferPadding, height);\n\n // If this is last buffer in this group of buffers, flush all buffers.\n if (currentBuffer === 0) {\n k = u - numBuffers + 1;\n for (l = bufferPadding; l < ll; k += width, l++) {\n for (b = 0; b < numBuffers; b++) {\n items[k + b] = colBuffers[b][l];\n }\n }\n }\n }\n }\n\n return { width, height, items };\n }\n}\n\n// Section 3.8.2 Irreversible 9-7 filter\nclass IrreversibleTransform extends Transform {\n filter(x, offset, length) {\n const len = length >> 1;\n offset |= 0;\n let j, n, current, next;\n\n const alpha = -1.586134342059924;\n const beta = -0.052980118572961;\n const gamma = 0.882911075530934;\n const delta = 0.443506852043971;\n const K = 1.230174104914001;\n const K_ = 1 / K;\n\n // step 1 is combined with step 3\n\n // step 2\n j = offset - 3;\n for (n = len + 4; n--; j += 2) {\n x[j] *= K_;\n }\n\n // step 1 & 3\n j = offset - 2;\n current = delta * x[j - 1];\n for (n = len + 3; n--; j += 2) {\n next = delta * x[j + 1];\n x[j] = K * x[j] - current - next;\n if (n--) {\n j += 2;\n current = delta * x[j + 1];\n x[j] = K * x[j] - current - next;\n } else {\n break;\n }\n }\n\n // step 4\n j = offset - 1;\n current = gamma * x[j - 1];\n for (n = len + 2; n--; j += 2) {\n next = gamma * x[j + 1];\n x[j] -= current + next;\n if (n--) {\n j += 2;\n current = gamma * x[j + 1];\n x[j] -= current + next;\n } else {\n break;\n }\n }\n\n // step 5\n j = offset;\n current = beta * x[j - 1];\n for (n = len + 1; n--; j += 2) {\n next = beta * x[j + 1];\n x[j] -= current + next;\n if (n--) {\n j += 2;\n current = beta * x[j + 1];\n x[j] -= current + next;\n } else {\n break;\n }\n }\n\n // step 6\n if (len !== 0) {\n j = offset + 1;\n current = alpha * x[j - 1];\n for (n = len; n--; j += 2) {\n next = alpha * x[j + 1];\n x[j] -= current + next;\n if (n--) {\n j += 2;\n current = alpha * x[j + 1];\n x[j] -= current + next;\n } else {\n break;\n }\n }\n }\n }\n}\n\n// Section 3.8.1 Reversible 5-3 filter\nclass ReversibleTransform extends Transform {\n filter(x, offset, length) {\n const len = length >> 1;\n offset |= 0;\n let j, n;\n\n for (j = offset, n = len + 1; n--; j += 2) {\n x[j] -= (x[j - 1] + x[j + 1] + 2) >> 2;\n }\n\n for (j = offset + 1, n = len; n--; j += 2) {\n x[j] += (x[j - 1] + x[j + 1]) >> 1;\n }\n }\n}\n\nexport { JpxImage };\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 { DecodeStream } from \"./decode_stream.js\";\nimport { JpxImage } from \"./jpx.js\";\nimport { shadow } from \"../shared/util.js\";\n\n/**\n * For JPEG 2000's we use a library to decode these images and\n * the stream behaves like all the other DecodeStreams.\n */\nclass JpxStream extends DecodeStream {\n constructor(stream, maybeLength, params) {\n super(maybeLength);\n\n this.stream = stream;\n this.dict = stream.dict;\n this.maybeLength = maybeLength;\n this.params = params;\n }\n\n get bytes() {\n // If `this.maybeLength` is null, we'll get the entire stream.\n return shadow(this, \"bytes\", this.stream.getBytes(this.maybeLength));\n }\n\n ensureBuffer(requested) {\n // No-op, since `this.readBlock` will always parse the entire image and\n // directly insert all of its data into `this.buffer`.\n }\n\n readBlock() {\n if (this.eof) {\n return;\n }\n const jpxImage = new JpxImage();\n jpxImage.parse(this.bytes);\n\n const width = jpxImage.width;\n const height = jpxImage.height;\n const componentsCount = jpxImage.componentsCount;\n const tileCount = jpxImage.tiles.length;\n if (tileCount === 1) {\n this.buffer = jpxImage.tiles[0].items;\n } else {\n const data = new Uint8ClampedArray(width * height * componentsCount);\n\n for (let k = 0; k < tileCount; k++) {\n const tileComponents = jpxImage.tiles[k];\n const tileWidth = tileComponents.width;\n const tileHeight = tileComponents.height;\n const tileLeft = tileComponents.left;\n const tileTop = tileComponents.top;\n\n const src = tileComponents.items;\n let srcPosition = 0;\n let dataPosition = (width * tileTop + tileLeft) * componentsCount;\n const imgRowSize = width * componentsCount;\n const tileRowSize = tileWidth * componentsCount;\n\n for (let j = 0; j < tileHeight; j++) {\n const rowBytes = src.subarray(srcPosition, srcPosition + tileRowSize);\n data.set(rowBytes, dataPosition);\n srcPosition += tileRowSize;\n dataPosition += imgRowSize;\n }\n }\n this.buffer = data;\n }\n this.bufferLength = this.buffer.length;\n this.eof = true;\n }\n}\n\nexport { JpxStream };\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 { DecodeStream } from \"./decode_stream.js\";\n\nclass LZWStream extends DecodeStream {\n constructor(str, maybeLength, earlyChange) {\n super(maybeLength);\n\n this.str = str;\n this.dict = str.dict;\n this.cachedData = 0;\n this.bitsCached = 0;\n\n const maxLzwDictionarySize = 4096;\n const lzwState = {\n earlyChange,\n codeLength: 9,\n nextCode: 258,\n dictionaryValues: new Uint8Array(maxLzwDictionarySize),\n dictionaryLengths: new Uint16Array(maxLzwDictionarySize),\n dictionaryPrevCodes: new Uint16Array(maxLzwDictionarySize),\n currentSequence: new Uint8Array(maxLzwDictionarySize),\n currentSequenceLength: 0,\n };\n for (let i = 0; i < 256; ++i) {\n lzwState.dictionaryValues[i] = i;\n lzwState.dictionaryLengths[i] = 1;\n }\n this.lzwState = lzwState;\n }\n\n readBits(n) {\n let bitsCached = this.bitsCached;\n let cachedData = this.cachedData;\n while (bitsCached < n) {\n const c = this.str.getByte();\n if (c === -1) {\n this.eof = true;\n return null;\n }\n cachedData = (cachedData << 8) | c;\n bitsCached += 8;\n }\n this.bitsCached = bitsCached -= n;\n this.cachedData = cachedData;\n this.lastCode = null;\n return (cachedData >>> bitsCached) & ((1 << n) - 1);\n }\n\n readBlock() {\n const blockSize = 512,\n decodedSizeDelta = blockSize;\n let estimatedDecodedSize = blockSize * 2;\n let i, j, q;\n\n const lzwState = this.lzwState;\n if (!lzwState) {\n return; // eof was found\n }\n\n const earlyChange = lzwState.earlyChange;\n let nextCode = lzwState.nextCode;\n const dictionaryValues = lzwState.dictionaryValues;\n const dictionaryLengths = lzwState.dictionaryLengths;\n const dictionaryPrevCodes = lzwState.dictionaryPrevCodes;\n let codeLength = lzwState.codeLength;\n let prevCode = lzwState.prevCode;\n const currentSequence = lzwState.currentSequence;\n let currentSequenceLength = lzwState.currentSequenceLength;\n\n let decodedLength = 0;\n let currentBufferLength = this.bufferLength;\n let buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize);\n\n for (i = 0; i < blockSize; i++) {\n const code = this.readBits(codeLength);\n const hasPrev = currentSequenceLength > 0;\n if (code < 256) {\n currentSequence[0] = code;\n currentSequenceLength = 1;\n } else if (code >= 258) {\n if (code < nextCode) {\n currentSequenceLength = dictionaryLengths[code];\n for (j = currentSequenceLength - 1, q = code; j >= 0; j--) {\n currentSequence[j] = dictionaryValues[q];\n q = dictionaryPrevCodes[q];\n }\n } else {\n currentSequence[currentSequenceLength++] = currentSequence[0];\n }\n } else if (code === 256) {\n codeLength = 9;\n nextCode = 258;\n currentSequenceLength = 0;\n continue;\n } else {\n this.eof = true;\n delete this.lzwState;\n break;\n }\n\n if (hasPrev) {\n dictionaryPrevCodes[nextCode] = prevCode;\n dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1;\n dictionaryValues[nextCode] = currentSequence[0];\n nextCode++;\n codeLength =\n (nextCode + earlyChange) & (nextCode + earlyChange - 1)\n ? codeLength\n : Math.min(\n Math.log(nextCode + earlyChange) / 0.6931471805599453 + 1,\n 12\n ) | 0;\n }\n prevCode = code;\n\n decodedLength += currentSequenceLength;\n if (estimatedDecodedSize < decodedLength) {\n do {\n estimatedDecodedSize += decodedSizeDelta;\n } while (estimatedDecodedSize < decodedLength);\n buffer = this.ensureBuffer(this.bufferLength + estimatedDecodedSize);\n }\n for (j = 0; j < currentSequenceLength; j++) {\n buffer[currentBufferLength++] = currentSequence[j];\n }\n }\n lzwState.nextCode = nextCode;\n lzwState.codeLength = codeLength;\n lzwState.prevCode = prevCode;\n lzwState.currentSequenceLength = currentSequenceLength;\n\n this.bufferLength = currentBufferLength;\n }\n}\n\nexport { LZWStream };\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 { DecodeStream } from \"./decode_stream.js\";\nimport { Dict } from \"./primitives.js\";\nimport { FormatError } from \"../shared/util.js\";\n\nclass PredictorStream extends DecodeStream {\n constructor(str, maybeLength, params) {\n super(maybeLength);\n\n if (!(params instanceof Dict)) {\n return str; // no prediction\n }\n const predictor = (this.predictor = params.get(\"Predictor\") || 1);\n\n if (predictor <= 1) {\n return str; // no prediction\n }\n if (predictor !== 2 && (predictor < 10 || predictor > 15)) {\n throw new FormatError(`Unsupported predictor: ${predictor}`);\n }\n\n this.readBlock = predictor === 2 ? this.readBlockTiff : this.readBlockPng;\n\n this.str = str;\n this.dict = str.dict;\n\n const colors = (this.colors = params.get(\"Colors\") || 1);\n const bits = (this.bits = params.get(\"BPC\", \"BitsPerComponent\") || 8);\n const columns = (this.columns = params.get(\"Columns\") || 1);\n\n this.pixBytes = (colors * bits + 7) >> 3;\n this.rowBytes = (columns * colors * bits + 7) >> 3;\n\n return this;\n }\n\n readBlockTiff() {\n const rowBytes = this.rowBytes;\n\n const bufferLength = this.bufferLength;\n const buffer = this.ensureBuffer(bufferLength + rowBytes);\n\n const bits = this.bits;\n const colors = this.colors;\n\n const rawBytes = this.str.getBytes(rowBytes);\n this.eof = !rawBytes.length;\n if (this.eof) {\n return;\n }\n\n let inbuf = 0,\n outbuf = 0;\n let inbits = 0,\n outbits = 0;\n let pos = bufferLength;\n let i;\n\n if (bits === 1 && colors === 1) {\n // Optimized version of the loop in the \"else\"-branch\n // for 1 bit-per-component and 1 color TIFF images.\n for (i = 0; i < rowBytes; ++i) {\n let c = rawBytes[i] ^ inbuf;\n c ^= c >> 1;\n c ^= c >> 2;\n c ^= c >> 4;\n inbuf = (c & 1) << 7;\n buffer[pos++] = c;\n }\n } else if (bits === 8) {\n for (i = 0; i < colors; ++i) {\n buffer[pos++] = rawBytes[i];\n }\n for (; i < rowBytes; ++i) {\n buffer[pos] = buffer[pos - colors] + rawBytes[i];\n pos++;\n }\n } else if (bits === 16) {\n const bytesPerPixel = colors * 2;\n for (i = 0; i < bytesPerPixel; ++i) {\n buffer[pos++] = rawBytes[i];\n }\n for (; i < rowBytes; i += 2) {\n const sum =\n ((rawBytes[i] & 0xff) << 8) +\n (rawBytes[i + 1] & 0xff) +\n ((buffer[pos - bytesPerPixel] & 0xff) << 8) +\n (buffer[pos - bytesPerPixel + 1] & 0xff);\n buffer[pos++] = (sum >> 8) & 0xff;\n buffer[pos++] = sum & 0xff;\n }\n } else {\n const compArray = new Uint8Array(colors + 1);\n const bitMask = (1 << bits) - 1;\n let j = 0,\n k = bufferLength;\n const columns = this.columns;\n for (i = 0; i < columns; ++i) {\n for (let kk = 0; kk < colors; ++kk) {\n if (inbits < bits) {\n inbuf = (inbuf << 8) | (rawBytes[j++] & 0xff);\n inbits += 8;\n }\n compArray[kk] =\n (compArray[kk] + (inbuf >> (inbits - bits))) & bitMask;\n inbits -= bits;\n outbuf = (outbuf << bits) | compArray[kk];\n outbits += bits;\n if (outbits >= 8) {\n buffer[k++] = (outbuf >> (outbits - 8)) & 0xff;\n outbits -= 8;\n }\n }\n }\n if (outbits > 0) {\n buffer[k++] =\n (outbuf << (8 - outbits)) + (inbuf & ((1 << (8 - outbits)) - 1));\n }\n }\n this.bufferLength += rowBytes;\n }\n\n readBlockPng() {\n const rowBytes = this.rowBytes;\n const pixBytes = this.pixBytes;\n\n const predictor = this.str.getByte();\n const rawBytes = this.str.getBytes(rowBytes);\n this.eof = !rawBytes.length;\n if (this.eof) {\n return;\n }\n\n const bufferLength = this.bufferLength;\n const buffer = this.ensureBuffer(bufferLength + rowBytes);\n\n let prevRow = buffer.subarray(bufferLength - rowBytes, bufferLength);\n if (prevRow.length === 0) {\n prevRow = new Uint8Array(rowBytes);\n }\n\n let i,\n j = bufferLength,\n up,\n c;\n switch (predictor) {\n case 0:\n for (i = 0; i < rowBytes; ++i) {\n buffer[j++] = rawBytes[i];\n }\n break;\n case 1:\n for (i = 0; i < pixBytes; ++i) {\n buffer[j++] = rawBytes[i];\n }\n for (; i < rowBytes; ++i) {\n buffer[j] = (buffer[j - pixBytes] + rawBytes[i]) & 0xff;\n j++;\n }\n break;\n case 2:\n for (i = 0; i < rowBytes; ++i) {\n buffer[j++] = (prevRow[i] + rawBytes[i]) & 0xff;\n }\n break;\n case 3:\n for (i = 0; i < pixBytes; ++i) {\n buffer[j++] = (prevRow[i] >> 1) + rawBytes[i];\n }\n for (; i < rowBytes; ++i) {\n buffer[j] =\n (((prevRow[i] + buffer[j - pixBytes]) >> 1) + rawBytes[i]) & 0xff;\n j++;\n }\n break;\n case 4:\n // we need to save the up left pixels values. the simplest way\n // is to create a new buffer\n for (i = 0; i < pixBytes; ++i) {\n up = prevRow[i];\n c = rawBytes[i];\n buffer[j++] = up + c;\n }\n for (; i < rowBytes; ++i) {\n up = prevRow[i];\n const upLeft = prevRow[i - pixBytes];\n const left = buffer[j - pixBytes];\n const p = left + up - upLeft;\n\n let pa = p - left;\n if (pa < 0) {\n pa = -pa;\n }\n let pb = p - up;\n if (pb < 0) {\n pb = -pb;\n }\n let pc = p - upLeft;\n if (pc < 0) {\n pc = -pc;\n }\n\n c = rawBytes[i];\n if (pa <= pb && pa <= pc) {\n buffer[j++] = left + c;\n } else if (pb <= pc) {\n buffer[j++] = up + c;\n } else {\n buffer[j++] = upLeft + c;\n }\n }\n break;\n default:\n throw new FormatError(`Unsupported predictor: ${predictor}`);\n }\n this.bufferLength += rowBytes;\n }\n}\n\nexport { PredictorStream };\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 { DecodeStream } from \"./decode_stream.js\";\n\nclass RunLengthStream extends DecodeStream {\n constructor(str, maybeLength) {\n super(maybeLength);\n\n this.str = str;\n this.dict = str.dict;\n }\n\n readBlock() {\n // The repeatHeader has following format. The first byte defines type of run\n // and amount of bytes to repeat/copy: n = 0 through 127 - copy next n bytes\n // (in addition to the second byte from the header), n = 129 through 255 -\n // duplicate the second byte from the header (257 - n) times, n = 128 - end.\n const repeatHeader = this.str.getBytes(2);\n if (!repeatHeader || repeatHeader.length < 2 || repeatHeader[0] === 128) {\n this.eof = true;\n return;\n }\n\n let buffer;\n let bufferLength = this.bufferLength;\n let n = repeatHeader[0];\n if (n < 128) {\n // copy n bytes\n buffer = this.ensureBuffer(bufferLength + n + 1);\n buffer[bufferLength++] = repeatHeader[1];\n if (n > 0) {\n const source = this.str.getBytes(n);\n buffer.set(source, bufferLength);\n bufferLength += n;\n }\n } else {\n n = 257 - n;\n const b = repeatHeader[1];\n buffer = this.ensureBuffer(bufferLength + n + 1);\n for (let i = 0; i < n; i++) {\n buffer[bufferLength++] = b;\n }\n }\n this.bufferLength = bufferLength;\n }\n}\n\nexport { RunLengthStream };\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 FormatError,\n info,\n warn,\n} from \"../shared/util.js\";\nimport { Cmd, Dict, EOF, isCmd, Name, Ref } from \"./primitives.js\";\nimport {\n isWhiteSpace,\n MissingDataException,\n ParserEOFException,\n} from \"./core_utils.js\";\nimport { NullStream, Stream } from \"./stream.js\";\nimport { Ascii85Stream } from \"./ascii_85_stream.js\";\nimport { AsciiHexStream } from \"./ascii_hex_stream.js\";\nimport { CCITTFaxStream } from \"./ccitt_stream.js\";\nimport { FlateStream } from \"./flate_stream.js\";\nimport { Jbig2Stream } from \"./jbig2_stream.js\";\nimport { JpegStream } from \"./jpeg_stream.js\";\nimport { JpxStream } from \"./jpx_stream.js\";\nimport { LZWStream } from \"./lzw_stream.js\";\nimport { PredictorStream } from \"./predictor_stream.js\";\nimport { RunLengthStream } from \"./run_length_stream.js\";\n\nconst MAX_LENGTH_TO_CACHE = 1000;\n\nfunction getInlineImageCacheKey(bytes) {\n const strBuf = [],\n ii = bytes.length;\n let i = 0;\n while (i < ii - 1) {\n strBuf.push((bytes[i++] << 8) | bytes[i++]);\n }\n // Handle an odd number of elements.\n if (i < ii) {\n strBuf.push(bytes[i]);\n }\n // We purposely include the \"raw\" length in the cacheKey, to prevent any\n // possible issues with hash collisions in the inline image cache.\n // Here we also assume that `strBuf` is never larger than 8192 elements,\n // please refer to the `bytesToString` implementation.\n return ii + \"_\" + String.fromCharCode.apply(null, strBuf);\n}\n\nclass Parser {\n constructor({ lexer, xref, allowStreams = false, recoveryMode = false }) {\n this.lexer = lexer;\n this.xref = xref;\n this.allowStreams = allowStreams;\n this.recoveryMode = recoveryMode;\n\n this.imageCache = Object.create(null);\n this._imageId = 0;\n this.refill();\n }\n\n refill() {\n this.buf1 = this.lexer.getObj();\n this.buf2 = this.lexer.getObj();\n }\n\n shift() {\n if (this.buf2 instanceof Cmd && this.buf2.cmd === \"ID\") {\n this.buf1 = this.buf2;\n this.buf2 = null;\n } else {\n this.buf1 = this.buf2;\n this.buf2 = this.lexer.getObj();\n }\n }\n\n tryShift() {\n try {\n this.shift();\n return true;\n } catch (e) {\n if (e instanceof MissingDataException) {\n throw e;\n }\n // Upon failure, the caller should reset this.lexer.pos to a known good\n // state and call this.shift() twice to reset the buffers.\n return false;\n }\n }\n\n getObj(cipherTransform = null) {\n const buf1 = this.buf1;\n this.shift();\n\n if (buf1 instanceof Cmd) {\n switch (buf1.cmd) {\n case \"BI\": // inline image\n return this.makeInlineImage(cipherTransform);\n case \"[\": // array\n const array = [];\n while (!isCmd(this.buf1, \"]\") && this.buf1 !== EOF) {\n array.push(this.getObj(cipherTransform));\n }\n if (this.buf1 === EOF) {\n if (this.recoveryMode) {\n return array;\n }\n throw new ParserEOFException(\"End of file inside array.\");\n }\n this.shift();\n return array;\n case \"<<\": // dictionary or stream\n const dict = new Dict(this.xref);\n while (!isCmd(this.buf1, \">>\") && this.buf1 !== EOF) {\n if (!(this.buf1 instanceof Name)) {\n info(\"Malformed dictionary: key must be a name object\");\n this.shift();\n continue;\n }\n\n const key = this.buf1.name;\n this.shift();\n if (this.buf1 === EOF) {\n break;\n }\n dict.set(key, this.getObj(cipherTransform));\n }\n if (this.buf1 === EOF) {\n if (this.recoveryMode) {\n return dict;\n }\n throw new ParserEOFException(\"End of file inside dictionary.\");\n }\n\n // Stream objects are not allowed inside content streams or\n // object streams.\n if (isCmd(this.buf2, \"stream\")) {\n return this.allowStreams\n ? this.makeStream(dict, cipherTransform)\n : dict;\n }\n this.shift();\n return dict;\n default: // simple object\n return buf1;\n }\n }\n\n if (Number.isInteger(buf1)) {\n // indirect reference or integer\n if (Number.isInteger(this.buf1) && isCmd(this.buf2, \"R\")) {\n const ref = Ref.get(buf1, this.buf1);\n this.shift();\n this.shift();\n return ref;\n }\n return buf1;\n }\n\n if (typeof buf1 === \"string\") {\n if (cipherTransform) {\n return cipherTransform.decryptString(buf1);\n }\n return buf1;\n }\n\n // simple object\n return buf1;\n }\n\n /**\n * Find the end of the stream by searching for the /EI\\s/.\n * @returns {number} The inline stream length.\n */\n findDefaultInlineStreamEnd(stream) {\n const E = 0x45,\n I = 0x49,\n SPACE = 0x20,\n LF = 0xa,\n CR = 0xd,\n NUL = 0x0;\n const { knownCommands } = this.lexer,\n startPos = stream.pos,\n n = 15;\n let state = 0,\n ch,\n maybeEIPos;\n while ((ch = stream.getByte()) !== -1) {\n if (state === 0) {\n state = ch === E ? 1 : 0;\n } else if (state === 1) {\n state = ch === I ? 2 : 0;\n } else {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(state === 2, \"findDefaultInlineStreamEnd - invalid state.\");\n }\n if (ch === SPACE || ch === LF || ch === CR) {\n maybeEIPos = stream.pos;\n // Let's check that the next `n` bytes are ASCII... just to be sure.\n const followingBytes = stream.peekBytes(n);\n\n const ii = followingBytes.length;\n if (ii === 0) {\n break; // The end of the stream was reached, nothing to check.\n }\n for (let i = 0; i < ii; i++) {\n ch = followingBytes[i];\n if (ch === NUL && followingBytes[i + 1] !== NUL) {\n // NUL bytes are not supposed to occur *outside* of inline\n // images, but some PDF generators violate that assumption,\n // thus breaking the EI detection heuristics used below.\n //\n // However, we can't unconditionally treat NUL bytes as \"ASCII\",\n // since that *could* result in inline images being truncated.\n //\n // To attempt to address this, we'll still treat any *sequence*\n // of NUL bytes as non-ASCII, but for a *single* NUL byte we'll\n // continue checking the `followingBytes` (fixes issue8823.pdf).\n continue;\n }\n if (ch !== LF && ch !== CR && (ch < SPACE || ch > 0x7f)) {\n // Not a LF, CR, SPACE or any visible ASCII character, i.e.\n // it's binary stuff. Resetting the state.\n state = 0;\n break;\n }\n }\n\n if (state !== 2) {\n continue;\n }\n if (!knownCommands) {\n warn(\n \"findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.\"\n );\n continue;\n }\n // Check that the \"EI\" sequence isn't part of the image data, since\n // that would cause the image to be truncated (fixes issue11124.pdf).\n const tmpLexer = new Lexer(\n new Stream(followingBytes.slice()),\n knownCommands\n );\n // Reduce the number of (potential) warning messages.\n tmpLexer._hexStringWarn = () => {};\n let numArgs = 0;\n\n while (true) {\n const nextObj = tmpLexer.getObj();\n\n if (nextObj === EOF) {\n state = 0; // No valid command found, resetting the state.\n break;\n }\n if (nextObj instanceof Cmd) {\n const knownCommand = knownCommands[nextObj.cmd];\n if (!knownCommand) {\n // Not a valid command, i.e. the inline image data *itself*\n // contains an \"EI\" sequence. Resetting the state.\n state = 0;\n break;\n } else if (\n knownCommand.variableArgs\n ? numArgs <= knownCommand.numArgs\n : numArgs === knownCommand.numArgs\n ) {\n break; // Valid command found.\n }\n numArgs = 0;\n continue;\n }\n numArgs++;\n }\n\n if (state === 2) {\n break; // Finished!\n }\n } else {\n state = 0;\n }\n }\n }\n\n if (ch === -1) {\n warn(\n \"findDefaultInlineStreamEnd: \" +\n \"Reached the end of the stream without finding a valid EI marker\"\n );\n if (maybeEIPos) {\n warn('... trying to recover by using the last \"EI\" occurrence.');\n stream.skip(-(stream.pos - maybeEIPos)); // Reset the stream position.\n }\n }\n\n let endOffset = 4;\n stream.skip(-endOffset); // Set the stream position to just before \"EI\".\n ch = stream.peekByte();\n stream.skip(endOffset); // ... and remember to reset the stream position.\n\n // Ensure that we don't accidentally truncate the inline image, when the\n // data is immediately followed by the \"EI\" marker (fixes issue10388.pdf).\n if (!isWhiteSpace(ch)) {\n endOffset--;\n }\n return stream.pos - endOffset - startPos;\n }\n\n /**\n * Find the EOI (end-of-image) marker 0xFFD9 of the stream.\n * @returns {number} The inline stream length.\n */\n findDCTDecodeInlineStreamEnd(stream) {\n const startPos = stream.pos;\n let foundEOI = false,\n b,\n markerLength;\n while ((b = stream.getByte()) !== -1) {\n if (b !== 0xff) {\n // Not a valid marker.\n continue;\n }\n switch (stream.getByte()) {\n case 0x00: // Byte stuffing.\n // 0xFF00 appears to be a very common byte sequence in JPEG images.\n break;\n\n case 0xff: // Fill byte.\n // Avoid skipping a valid marker, resetting the stream position.\n stream.skip(-1);\n break;\n\n case 0xd9: // EOI\n foundEOI = true;\n break;\n\n case 0xc0: // SOF0\n case 0xc1: // SOF1\n case 0xc2: // SOF2\n case 0xc3: // SOF3\n /* falls through */\n case 0xc5: // SOF5\n case 0xc6: // SOF6\n case 0xc7: // SOF7\n /* falls through */\n case 0xc9: // SOF9\n case 0xca: // SOF10\n case 0xcb: // SOF11\n /* falls through */\n case 0xcd: // SOF13\n case 0xce: // SOF14\n case 0xcf: // SOF15\n /* falls through */\n case 0xc4: // DHT\n case 0xcc: // DAC\n /* falls through */\n case 0xda: // SOS\n case 0xdb: // DQT\n case 0xdc: // DNL\n case 0xdd: // DRI\n case 0xde: // DHP\n case 0xdf: // EXP\n /* falls through */\n case 0xe0: // APP0\n case 0xe1: // APP1\n case 0xe2: // APP2\n case 0xe3: // APP3\n case 0xe4: // APP4\n case 0xe5: // APP5\n case 0xe6: // APP6\n case 0xe7: // APP7\n case 0xe8: // APP8\n case 0xe9: // APP9\n case 0xea: // APP10\n case 0xeb: // APP11\n case 0xec: // APP12\n case 0xed: // APP13\n case 0xee: // APP14\n case 0xef: // APP15\n /* falls through */\n case 0xfe: // COM\n // The marker should be followed by the length of the segment.\n markerLength = stream.getUint16();\n if (markerLength > 2) {\n // |markerLength| contains the byte length of the marker segment,\n // including its own length (2 bytes) and excluding the marker.\n stream.skip(markerLength - 2); // Jump to the next marker.\n } else {\n // The marker length is invalid, resetting the stream position.\n stream.skip(-2);\n }\n break;\n }\n if (foundEOI) {\n break;\n }\n }\n const length = stream.pos - startPos;\n if (b === -1) {\n warn(\n \"Inline DCTDecode image stream: \" +\n \"EOI marker not found, searching for /EI/ instead.\"\n );\n stream.skip(-length); // Reset the stream position.\n return this.findDefaultInlineStreamEnd(stream);\n }\n this.inlineStreamSkipEI(stream);\n return length;\n }\n\n /**\n * Find the EOD (end-of-data) marker '~>' (i.e. TILDE + GT) of the stream.\n * @returns {number} The inline stream length.\n */\n findASCII85DecodeInlineStreamEnd(stream) {\n const TILDE = 0x7e,\n GT = 0x3e;\n const startPos = stream.pos;\n let ch;\n while ((ch = stream.getByte()) !== -1) {\n if (ch === TILDE) {\n const tildePos = stream.pos;\n\n ch = stream.peekByte();\n // Handle corrupt PDF documents which contains whitespace \"inside\" of\n // the EOD marker (fixes issue10614.pdf).\n while (isWhiteSpace(ch)) {\n stream.skip();\n ch = stream.peekByte();\n }\n if (ch === GT) {\n stream.skip();\n break;\n }\n // Handle corrupt PDF documents which contains truncated EOD markers,\n // where the '>' character is missing (fixes issue11385.pdf).\n if (stream.pos > tildePos) {\n const maybeEI = stream.peekBytes(2);\n if (maybeEI[0] === /* E = */ 0x45 && maybeEI[1] === /* I = */ 0x49) {\n break;\n }\n }\n }\n }\n const length = stream.pos - startPos;\n if (ch === -1) {\n warn(\n \"Inline ASCII85Decode image stream: \" +\n \"EOD marker not found, searching for /EI/ instead.\"\n );\n stream.skip(-length); // Reset the stream position.\n return this.findDefaultInlineStreamEnd(stream);\n }\n this.inlineStreamSkipEI(stream);\n return length;\n }\n\n /**\n * Find the EOD (end-of-data) marker '>' (i.e. GT) of the stream.\n * @returns {number} The inline stream length.\n */\n findASCIIHexDecodeInlineStreamEnd(stream) {\n const GT = 0x3e;\n const startPos = stream.pos;\n let ch;\n while ((ch = stream.getByte()) !== -1) {\n if (ch === GT) {\n break;\n }\n }\n const length = stream.pos - startPos;\n if (ch === -1) {\n warn(\n \"Inline ASCIIHexDecode image stream: \" +\n \"EOD marker not found, searching for /EI/ instead.\"\n );\n stream.skip(-length); // Reset the stream position.\n return this.findDefaultInlineStreamEnd(stream);\n }\n this.inlineStreamSkipEI(stream);\n return length;\n }\n\n /**\n * Skip over the /EI/ for streams where we search for an EOD marker.\n */\n inlineStreamSkipEI(stream) {\n const E = 0x45,\n I = 0x49;\n let state = 0,\n ch;\n while ((ch = stream.getByte()) !== -1) {\n if (state === 0) {\n state = ch === E ? 1 : 0;\n } else if (state === 1) {\n state = ch === I ? 2 : 0;\n } else if (state === 2) {\n break;\n }\n }\n }\n\n makeInlineImage(cipherTransform) {\n const lexer = this.lexer;\n const stream = lexer.stream;\n\n // Parse dictionary, but initialize it lazily to improve performance with\n // cached inline images (see issue 2618).\n const dictMap = Object.create(null);\n let dictLength;\n while (!isCmd(this.buf1, \"ID\") && this.buf1 !== EOF) {\n if (!(this.buf1 instanceof Name)) {\n throw new FormatError(\"Dictionary key must be a name object\");\n }\n const key = this.buf1.name;\n this.shift();\n if (this.buf1 === EOF) {\n break;\n }\n dictMap[key] = this.getObj(cipherTransform);\n }\n if (lexer.beginInlineImagePos !== -1) {\n dictLength = stream.pos - lexer.beginInlineImagePos;\n }\n\n // Extract the name of the first (i.e. the current) image filter.\n const filter = this.xref.fetchIfRef(dictMap.F || dictMap.Filter);\n let filterName;\n if (filter instanceof Name) {\n filterName = filter.name;\n } else if (Array.isArray(filter)) {\n const filterZero = this.xref.fetchIfRef(filter[0]);\n if (filterZero instanceof Name) {\n filterName = filterZero.name;\n }\n }\n\n // Parse image stream.\n const startPos = stream.pos;\n let length;\n switch (filterName) {\n case \"DCT\":\n case \"DCTDecode\":\n length = this.findDCTDecodeInlineStreamEnd(stream);\n break;\n case \"A85\":\n case \"ASCII85Decode\":\n length = this.findASCII85DecodeInlineStreamEnd(stream);\n break;\n case \"AHx\":\n case \"ASCIIHexDecode\":\n length = this.findASCIIHexDecodeInlineStreamEnd(stream);\n break;\n default:\n length = this.findDefaultInlineStreamEnd(stream);\n }\n\n // Cache all images below the MAX_LENGTH_TO_CACHE threshold by their\n // stringified content, to prevent possible hash collisions.\n let cacheKey;\n if (length < MAX_LENGTH_TO_CACHE && dictLength > 0) {\n const initialStreamPos = stream.pos;\n // Set the stream position to the beginning of the dictionary data...\n stream.pos = lexer.beginInlineImagePos;\n // ... and fetch the bytes of the dictionary *and* the inline image.\n cacheKey = getInlineImageCacheKey(stream.getBytes(dictLength + length));\n // Finally, don't forget to reset the stream position.\n stream.pos = initialStreamPos;\n\n const cacheEntry = this.imageCache[cacheKey];\n if (cacheEntry !== undefined) {\n this.buf2 = Cmd.get(\"EI\");\n this.shift();\n\n cacheEntry.reset();\n return cacheEntry;\n }\n }\n\n const dict = new Dict(this.xref);\n for (const key in dictMap) {\n dict.set(key, dictMap[key]);\n }\n let imageStream = stream.makeSubStream(startPos, length, dict);\n if (cipherTransform) {\n imageStream = cipherTransform.createStream(imageStream, length);\n }\n\n imageStream = this.filter(imageStream, dict, length);\n imageStream.dict = dict;\n if (cacheKey !== undefined) {\n imageStream.cacheKey = `inline_img_${++this._imageId}`;\n this.imageCache[cacheKey] = imageStream;\n }\n\n this.buf2 = Cmd.get(\"EI\");\n this.shift();\n\n return imageStream;\n }\n\n _findStreamLength(startPos, signature) {\n const { stream } = this.lexer;\n stream.pos = startPos;\n\n const SCAN_BLOCK_LENGTH = 2048;\n const signatureLength = signature.length;\n\n while (stream.pos < stream.end) {\n const scanBytes = stream.peekBytes(SCAN_BLOCK_LENGTH);\n const scanLength = scanBytes.length - signatureLength;\n\n if (scanLength <= 0) {\n break;\n }\n let pos = 0;\n while (pos < scanLength) {\n let j = 0;\n while (j < signatureLength && scanBytes[pos + j] === signature[j]) {\n j++;\n }\n if (j >= signatureLength) {\n // `signature` found.\n stream.pos += pos;\n return stream.pos - startPos;\n }\n pos++;\n }\n stream.pos += scanLength;\n }\n return -1;\n }\n\n makeStream(dict, cipherTransform) {\n const lexer = this.lexer;\n let stream = lexer.stream;\n\n // Get the stream's start position.\n lexer.skipToNextLine();\n const startPos = stream.pos - 1;\n\n // Get the length.\n let length = dict.get(\"Length\");\n if (!Number.isInteger(length)) {\n info(`Bad length \"${length && length.toString()}\" in stream.`);\n length = 0;\n }\n\n // Skip over the stream data.\n stream.pos = startPos + length;\n lexer.nextChar();\n\n // Shift '>>' and check whether the new object marks the end of the stream.\n if (this.tryShift() && isCmd(this.buf2, \"endstream\")) {\n this.shift(); // 'stream'\n } else {\n // Bad stream length, scanning for endstream command.\n const ENDSTREAM_SIGNATURE = new Uint8Array([\n 0x65, 0x6e, 0x64, 0x73, 0x74, 0x72, 0x65, 0x61, 0x6d,\n ]);\n let actualLength = this._findStreamLength(startPos, ENDSTREAM_SIGNATURE);\n if (actualLength < 0) {\n // Only allow limited truncation of the endstream signature,\n // to prevent false positives.\n const MAX_TRUNCATION = 1;\n // Check if the PDF generator included truncated endstream commands,\n // such as e.g. \"endstrea\" (fixes issue10004.pdf).\n for (let i = 1; i <= MAX_TRUNCATION; i++) {\n const end = ENDSTREAM_SIGNATURE.length - i;\n const TRUNCATED_SIGNATURE = ENDSTREAM_SIGNATURE.slice(0, end);\n\n const maybeLength = this._findStreamLength(\n startPos,\n TRUNCATED_SIGNATURE\n );\n if (maybeLength >= 0) {\n // Ensure that the byte immediately following the truncated\n // endstream command is a space, to prevent false positives.\n const lastByte = stream.peekBytes(end + 1)[end];\n if (!isWhiteSpace(lastByte)) {\n break;\n }\n info(\n `Found \"${bytesToString(TRUNCATED_SIGNATURE)}\" when ` +\n \"searching for endstream command.\"\n );\n actualLength = maybeLength;\n break;\n }\n }\n\n if (actualLength < 0) {\n throw new FormatError(\"Missing endstream command.\");\n }\n }\n length = actualLength;\n\n lexer.nextChar();\n this.shift();\n this.shift();\n }\n this.shift(); // 'endstream'\n\n stream = stream.makeSubStream(startPos, length, dict);\n if (cipherTransform) {\n stream = cipherTransform.createStream(stream, length);\n }\n stream = this.filter(stream, dict, length);\n stream.dict = dict;\n return stream;\n }\n\n filter(stream, dict, length) {\n let filter = dict.get(\"F\", \"Filter\");\n let params = dict.get(\"DP\", \"DecodeParms\");\n\n if (filter instanceof Name) {\n if (Array.isArray(params)) {\n warn(\"/DecodeParms should not be an Array, when /Filter is a Name.\");\n }\n return this.makeFilter(stream, filter.name, length, params);\n }\n\n let maybeLength = length;\n if (Array.isArray(filter)) {\n const filterArray = filter;\n const paramsArray = params;\n for (let i = 0, ii = filterArray.length; i < ii; ++i) {\n filter = this.xref.fetchIfRef(filterArray[i]);\n if (!(filter instanceof Name)) {\n throw new FormatError(`Bad filter name \"${filter}\"`);\n }\n\n params = null;\n if (Array.isArray(paramsArray) && i in paramsArray) {\n params = this.xref.fetchIfRef(paramsArray[i]);\n }\n stream = this.makeFilter(stream, filter.name, maybeLength, params);\n // After the first stream the `length` variable is invalid.\n maybeLength = null;\n }\n }\n return stream;\n }\n\n makeFilter(stream, name, maybeLength, params) {\n // Since the 'Length' entry in the stream dictionary can be completely\n // wrong, e.g. zero for non-empty streams, only skip parsing the stream\n // when we can be absolutely certain that it actually is empty.\n if (maybeLength === 0) {\n warn(`Empty \"${name}\" stream.`);\n return new NullStream();\n }\n\n try {\n switch (name) {\n case \"Fl\":\n case \"FlateDecode\":\n if (params) {\n return new PredictorStream(\n new FlateStream(stream, maybeLength),\n maybeLength,\n params\n );\n }\n return new FlateStream(stream, maybeLength);\n case \"LZW\":\n case \"LZWDecode\":\n let earlyChange = 1;\n if (params) {\n if (params.has(\"EarlyChange\")) {\n earlyChange = params.get(\"EarlyChange\");\n }\n return new PredictorStream(\n new LZWStream(stream, maybeLength, earlyChange),\n maybeLength,\n params\n );\n }\n return new LZWStream(stream, maybeLength, earlyChange);\n case \"DCT\":\n case \"DCTDecode\":\n return new JpegStream(stream, maybeLength, params);\n case \"JPX\":\n case \"JPXDecode\":\n return new JpxStream(stream, maybeLength, params);\n case \"A85\":\n case \"ASCII85Decode\":\n return new Ascii85Stream(stream, maybeLength);\n case \"AHx\":\n case \"ASCIIHexDecode\":\n return new AsciiHexStream(stream, maybeLength);\n case \"CCF\":\n case \"CCITTFaxDecode\":\n return new CCITTFaxStream(stream, maybeLength, params);\n case \"RL\":\n case \"RunLengthDecode\":\n return new RunLengthStream(stream, maybeLength);\n case \"JBIG2Decode\":\n return new Jbig2Stream(stream, maybeLength, params);\n }\n warn(`Filter \"${name}\" is not supported.`);\n return stream;\n } catch (ex) {\n if (ex instanceof MissingDataException) {\n throw ex;\n }\n warn(`Invalid stream: \"${ex}\"`);\n return new NullStream();\n }\n }\n}\n\n// A '1' in this array means the character is white space. A '1' or\n// '2' means the character ends a name or command.\n// prettier-ignore\nconst specialChars = [\n 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, // 0x\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 1x\n 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, // 2x\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, // 3x\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 4x\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 5x\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 6x\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 0, 0, // 7x\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 8x\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 9x\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ax\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // bx\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // cx\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // dx\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // ex\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 // fx\n];\n\nfunction toHexDigit(ch) {\n if (ch >= /* '0' = */ 0x30 && ch /* '9' = */ <= 0x39) {\n return ch & 0x0f;\n }\n if (\n (ch >= /* 'A' = */ 0x41 && ch <= /* 'F' = */ 0x46) ||\n (ch >= /* 'a' = */ 0x61 && ch <= /* 'f' = */ 0x66)\n ) {\n return (ch & 0x0f) + 9;\n }\n return -1;\n}\n\nclass Lexer {\n constructor(stream, knownCommands = null) {\n this.stream = stream;\n this.nextChar();\n\n // While lexing, we build up many strings one char at a time. Using += for\n // this can result in lots of garbage strings. It's better to build an\n // array of single-char strings and then join() them together at the end.\n // And reusing a single array (i.e. |this.strBuf|) over and over for this\n // purpose uses less memory than using a new array for each string.\n this.strBuf = [];\n\n // The PDFs might have \"glued\" commands with other commands, operands or\n // literals, e.g. \"q1\". The knownCommands is a dictionary of the valid\n // commands and their prefixes. The prefixes are built the following way:\n // if there a command that is a prefix of the other valid command or\n // literal (e.g. 'f' and 'false') the following prefixes must be included,\n // 'fa', 'fal', 'fals'. The prefixes are not needed, if the command has no\n // other commands or literals as a prefix. The knowCommands is optional.\n this.knownCommands = knownCommands;\n\n this._hexStringNumWarn = 0;\n this.beginInlineImagePos = -1;\n }\n\n nextChar() {\n return (this.currentChar = this.stream.getByte());\n }\n\n peekChar() {\n return this.stream.peekByte();\n }\n\n getNumber() {\n let ch = this.currentChar;\n let eNotation = false;\n let divideBy = 0; // Different from 0 if it's a floating point value.\n let sign = 1;\n\n if (ch === /* '-' = */ 0x2d) {\n sign = -1;\n ch = this.nextChar();\n\n if (ch === /* '-' = */ 0x2d) {\n // Ignore double negative (this is consistent with Adobe Reader).\n ch = this.nextChar();\n }\n } else if (ch === /* '+' = */ 0x2b) {\n ch = this.nextChar();\n }\n if (ch === /* LF = */ 0x0a || ch === /* CR = */ 0x0d) {\n // Ignore line-breaks (this is consistent with Adobe Reader).\n do {\n ch = this.nextChar();\n } while (ch === 0x0a || ch === 0x0d);\n }\n if (ch === /* '.' = */ 0x2e) {\n divideBy = 10;\n ch = this.nextChar();\n }\n if (ch < /* '0' = */ 0x30 || ch > /* '9' = */ 0x39) {\n const msg = `Invalid number: ${String.fromCharCode(ch)} (charCode ${ch})`;\n\n if (isWhiteSpace(ch) || ch === /* EOF = */ -1) {\n // This is consistent with Adobe Reader (fixes issue9252.pdf,\n // issue15604.pdf, bug1753983.pdf).\n info(`Lexer.getNumber - \"${msg}\".`);\n return 0;\n }\n throw new FormatError(msg);\n }\n\n let baseValue = ch - 0x30; // '0'\n let powerValue = 0;\n let powerValueSign = 1;\n\n while ((ch = this.nextChar()) >= 0) {\n if (ch >= /* '0' = */ 0x30 && ch <= /* '9' = */ 0x39) {\n const currentDigit = ch - 0x30; // '0'\n if (eNotation) {\n // We are after an 'e' or 'E'.\n powerValue = powerValue * 10 + currentDigit;\n } else {\n if (divideBy !== 0) {\n // We are after a point.\n divideBy *= 10;\n }\n baseValue = baseValue * 10 + currentDigit;\n }\n } else if (ch === /* '.' = */ 0x2e) {\n if (divideBy === 0) {\n divideBy = 1;\n } else {\n // A number can have only one dot.\n break;\n }\n } else if (ch === /* '-' = */ 0x2d) {\n // Ignore minus signs in the middle of numbers to match\n // Adobe's behavior.\n warn(\"Badly formatted number: minus sign in the middle\");\n } else if (ch === /* 'E' = */ 0x45 || ch === /* 'e' = */ 0x65) {\n // 'E' can be either a scientific notation or the beginning of a new\n // operator.\n ch = this.peekChar();\n if (ch === /* '+' = */ 0x2b || ch === /* '-' = */ 0x2d) {\n powerValueSign = ch === 0x2d ? -1 : 1;\n this.nextChar(); // Consume the sign character.\n } else if (ch < /* '0' = */ 0x30 || ch > /* '9' = */ 0x39) {\n // The 'E' must be the beginning of a new operator.\n break;\n }\n eNotation = true;\n } else {\n // The last character doesn't belong to us.\n break;\n }\n }\n\n if (divideBy !== 0) {\n baseValue /= divideBy;\n }\n if (eNotation) {\n baseValue *= 10 ** (powerValueSign * powerValue);\n }\n return sign * baseValue;\n }\n\n getString() {\n let numParen = 1;\n let done = false;\n const strBuf = this.strBuf;\n strBuf.length = 0;\n\n let ch = this.nextChar();\n while (true) {\n let charBuffered = false;\n switch (ch | 0) {\n case -1:\n warn(\"Unterminated string\");\n done = true;\n break;\n case 0x28: // '('\n ++numParen;\n strBuf.push(\"(\");\n break;\n case 0x29: // ')'\n if (--numParen === 0) {\n this.nextChar(); // consume strings ')'\n done = true;\n } else {\n strBuf.push(\")\");\n }\n break;\n case 0x5c: // '\\\\'\n ch = this.nextChar();\n switch (ch) {\n case -1:\n warn(\"Unterminated string\");\n done = true;\n break;\n case 0x6e: // 'n'\n strBuf.push(\"\\n\");\n break;\n case 0x72: // 'r'\n strBuf.push(\"\\r\");\n break;\n case 0x74: // 't'\n strBuf.push(\"\\t\");\n break;\n case 0x62: // 'b'\n strBuf.push(\"\\b\");\n break;\n case 0x66: // 'f'\n strBuf.push(\"\\f\");\n break;\n case 0x5c: // '\\'\n case 0x28: // '('\n case 0x29: // ')'\n strBuf.push(String.fromCharCode(ch));\n break;\n case 0x30: // '0'\n case 0x31: // '1'\n case 0x32: // '2'\n case 0x33: // '3'\n case 0x34: // '4'\n case 0x35: // '5'\n case 0x36: // '6'\n case 0x37: // '7'\n let x = ch & 0x0f;\n ch = this.nextChar();\n charBuffered = true;\n if (ch >= /* '0' = */ 0x30 && ch <= /* '7' = */ 0x37) {\n x = (x << 3) + (ch & 0x0f);\n ch = this.nextChar();\n if (ch >= /* '0' = */ 0x30 && ch /* '7' = */ <= 0x37) {\n charBuffered = false;\n x = (x << 3) + (ch & 0x0f);\n }\n }\n strBuf.push(String.fromCharCode(x));\n break;\n case 0x0d: // CR\n if (this.peekChar() === /* LF = */ 0x0a) {\n this.nextChar();\n }\n break;\n case 0x0a: // LF\n break;\n default:\n strBuf.push(String.fromCharCode(ch));\n break;\n }\n break;\n default:\n strBuf.push(String.fromCharCode(ch));\n break;\n }\n if (done) {\n break;\n }\n if (!charBuffered) {\n ch = this.nextChar();\n }\n }\n return strBuf.join(\"\");\n }\n\n getName() {\n let ch, previousCh;\n const strBuf = this.strBuf;\n strBuf.length = 0;\n\n while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) {\n if (ch === /* '#' = */ 0x23) {\n ch = this.nextChar();\n if (specialChars[ch]) {\n warn(\n \"Lexer_getName: \" +\n \"NUMBER SIGN (#) should be followed by a hexadecimal number.\"\n );\n strBuf.push(\"#\");\n break;\n }\n const x = toHexDigit(ch);\n if (x !== -1) {\n previousCh = ch;\n ch = this.nextChar();\n const x2 = toHexDigit(ch);\n if (x2 === -1) {\n warn(\n `Lexer_getName: Illegal digit (${String.fromCharCode(ch)}) ` +\n \"in hexadecimal number.\"\n );\n strBuf.push(\"#\", String.fromCharCode(previousCh));\n if (specialChars[ch]) {\n break;\n }\n strBuf.push(String.fromCharCode(ch));\n continue;\n }\n strBuf.push(String.fromCharCode((x << 4) | x2));\n } else {\n strBuf.push(\"#\", String.fromCharCode(ch));\n }\n } else {\n strBuf.push(String.fromCharCode(ch));\n }\n }\n if (strBuf.length > 127) {\n warn(`Name token is longer than allowed by the spec: ${strBuf.length}`);\n }\n return Name.get(strBuf.join(\"\"));\n }\n\n /**\n * @private\n */\n _hexStringWarn(ch) {\n const MAX_HEX_STRING_NUM_WARN = 5;\n\n if (this._hexStringNumWarn++ === MAX_HEX_STRING_NUM_WARN) {\n warn(\"getHexString - ignoring additional invalid characters.\");\n return;\n }\n if (this._hexStringNumWarn > MAX_HEX_STRING_NUM_WARN) {\n // Limit the number of warning messages printed for a `this.getHexString`\n // invocation, since corrupt PDF documents may otherwise spam the console\n // enough to affect general performance negatively.\n return;\n }\n warn(`getHexString - ignoring invalid character: ${ch}`);\n }\n\n getHexString() {\n const strBuf = this.strBuf;\n strBuf.length = 0;\n let ch = this.currentChar;\n let isFirstHex = true;\n let firstDigit, secondDigit;\n this._hexStringNumWarn = 0;\n\n while (true) {\n if (ch < 0) {\n warn(\"Unterminated hex string\");\n break;\n } else if (ch === /* '>' = */ 0x3e) {\n this.nextChar();\n break;\n } else if (specialChars[ch] === 1) {\n ch = this.nextChar();\n continue;\n } else {\n if (isFirstHex) {\n firstDigit = toHexDigit(ch);\n if (firstDigit === -1) {\n this._hexStringWarn(ch);\n ch = this.nextChar();\n continue;\n }\n } else {\n secondDigit = toHexDigit(ch);\n if (secondDigit === -1) {\n this._hexStringWarn(ch);\n ch = this.nextChar();\n continue;\n }\n strBuf.push(String.fromCharCode((firstDigit << 4) | secondDigit));\n }\n isFirstHex = !isFirstHex;\n ch = this.nextChar();\n }\n }\n return strBuf.join(\"\");\n }\n\n getObj() {\n // Skip whitespace and comments.\n let comment = false;\n let ch = this.currentChar;\n while (true) {\n if (ch < 0) {\n return EOF;\n }\n if (comment) {\n if (ch === /* LF = */ 0x0a || ch === /* CR = */ 0x0d) {\n comment = false;\n }\n } else if (ch === /* '%' = */ 0x25) {\n comment = true;\n } else if (specialChars[ch] !== 1) {\n break;\n }\n ch = this.nextChar();\n }\n\n // Start reading a token.\n switch (ch | 0) {\n case 0x30: // '0'\n case 0x31: // '1'\n case 0x32: // '2'\n case 0x33: // '3'\n case 0x34: // '4'\n case 0x35: // '5'\n case 0x36: // '6'\n case 0x37: // '7'\n case 0x38: // '8'\n case 0x39: // '9'\n case 0x2b: // '+'\n case 0x2d: // '-'\n case 0x2e: // '.'\n return this.getNumber();\n case 0x28: // '('\n return this.getString();\n case 0x2f: // '/'\n return this.getName();\n // array punctuation\n case 0x5b: // '['\n this.nextChar();\n return Cmd.get(\"[\");\n case 0x5d: // ']'\n this.nextChar();\n return Cmd.get(\"]\");\n // hex string or dict punctuation\n case 0x3c: // '<'\n ch = this.nextChar();\n if (ch === 0x3c) {\n // dict punctuation\n this.nextChar();\n return Cmd.get(\"<<\");\n }\n return this.getHexString();\n // dict punctuation\n case 0x3e: // '>'\n ch = this.nextChar();\n if (ch === 0x3e) {\n this.nextChar();\n return Cmd.get(\">>\");\n }\n return Cmd.get(\">\");\n case 0x7b: // '{'\n this.nextChar();\n return Cmd.get(\"{\");\n case 0x7d: // '}'\n this.nextChar();\n return Cmd.get(\"}\");\n case 0x29: // ')'\n // Consume the current character in order to avoid permanently hanging\n // the worker thread if `Lexer.getObj` is called from within a loop\n // containing try-catch statements, since we would otherwise attempt\n // to parse the *same* character over and over (fixes issue8061.pdf).\n this.nextChar();\n throw new FormatError(`Illegal character: ${ch}`);\n }\n\n // Start reading a command.\n let str = String.fromCharCode(ch);\n // A valid command cannot start with a non-visible ASCII character,\n // and the next character may be (the start of) a valid command.\n if (ch < 0x20 || ch > 0x7f) {\n const nextCh = this.peekChar();\n if (nextCh >= 0x20 && nextCh <= 0x7f) {\n this.nextChar();\n return Cmd.get(str);\n }\n }\n const knownCommands = this.knownCommands;\n let knownCommandFound = knownCommands?.[str] !== undefined;\n while ((ch = this.nextChar()) >= 0 && !specialChars[ch]) {\n // Stop if a known command is found and next character does not make\n // the string a command.\n const possibleCommand = str + String.fromCharCode(ch);\n if (knownCommandFound && knownCommands[possibleCommand] === undefined) {\n break;\n }\n if (str.length === 128) {\n throw new FormatError(`Command token too long: ${str.length}`);\n }\n str = possibleCommand;\n knownCommandFound = knownCommands?.[str] !== undefined;\n }\n if (str === \"true\") {\n return true;\n }\n if (str === \"false\") {\n return false;\n }\n if (str === \"null\") {\n return null;\n }\n\n if (str === \"BI\") {\n // Keep track of the current stream position, since it's needed in order\n // to correctly cache inline images; see `Parser.makeInlineImage`.\n this.beginInlineImagePos = this.stream.pos;\n }\n\n return Cmd.get(str);\n }\n\n skipToNextLine() {\n let ch = this.currentChar;\n while (ch >= 0) {\n if (ch === /* CR = */ 0x0d) {\n ch = this.nextChar();\n if (ch === /* LF = */ 0x0a) {\n this.nextChar();\n }\n break;\n } else if (ch === /* LF = */ 0x0a) {\n this.nextChar();\n break;\n }\n ch = this.nextChar();\n }\n }\n}\n\nclass Linearization {\n static create(stream) {\n function getInt(linDict, name, allowZeroValue = false) {\n const obj = linDict.get(name);\n if (Number.isInteger(obj) && (allowZeroValue ? obj >= 0 : obj > 0)) {\n return obj;\n }\n throw new Error(\n `The \"${name}\" parameter in the linearization ` +\n \"dictionary is invalid.\"\n );\n }\n\n function getHints(linDict) {\n const hints = linDict.get(\"H\");\n let hintsLength;\n\n if (\n Array.isArray(hints) &&\n ((hintsLength = hints.length) === 2 || hintsLength === 4)\n ) {\n for (let index = 0; index < hintsLength; index++) {\n const hint = hints[index];\n if (!(Number.isInteger(hint) && hint > 0)) {\n throw new Error(\n `Hint (${index}) in the linearization dictionary is invalid.`\n );\n }\n }\n return hints;\n }\n throw new Error(\"Hint array in the linearization dictionary is invalid.\");\n }\n\n const parser = new Parser({\n lexer: new Lexer(stream),\n xref: null,\n });\n const obj1 = parser.getObj();\n const obj2 = parser.getObj();\n const obj3 = parser.getObj();\n const linDict = parser.getObj();\n let obj, length;\n if (\n !(\n Number.isInteger(obj1) &&\n Number.isInteger(obj2) &&\n isCmd(obj3, \"obj\") &&\n linDict instanceof Dict &&\n typeof (obj = linDict.get(\"Linearized\")) === \"number\" &&\n obj > 0\n )\n ) {\n return null; // No valid linearization dictionary found.\n } else if ((length = getInt(linDict, \"L\")) !== stream.length) {\n throw new Error(\n 'The \"L\" parameter in the linearization dictionary ' +\n \"does not equal the stream length.\"\n );\n }\n return {\n length,\n hints: getHints(linDict),\n objectNumberFirst: getInt(linDict, \"O\"),\n endFirst: getInt(linDict, \"E\"),\n numPages: getInt(linDict, \"N\"),\n mainXRefEntriesOffset: getInt(linDict, \"T\"),\n pageFirst: linDict.has(\"P\")\n ? getInt(linDict, \"P\", /* allowZeroValue = */ true)\n : 0,\n };\n }\n}\n\nexport { Lexer, Linearization, Parser };\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 CMapCompressionType,\n FormatError,\n unreachable,\n warn,\n} from \"../shared/util.js\";\nimport { Cmd, EOF, isCmd, Name } from \"./primitives.js\";\nimport { BaseStream } from \"./base_stream.js\";\nimport { BinaryCMapReader } from \"./binary_cmap.js\";\nimport { Lexer } from \"./parser.js\";\nimport { MissingDataException } from \"./core_utils.js\";\nimport { Stream } from \"./stream.js\";\n\nconst BUILT_IN_CMAPS = [\n // << Start unicode maps.\n \"Adobe-GB1-UCS2\",\n \"Adobe-CNS1-UCS2\",\n \"Adobe-Japan1-UCS2\",\n \"Adobe-Korea1-UCS2\",\n // >> End unicode maps.\n \"78-EUC-H\",\n \"78-EUC-V\",\n \"78-H\",\n \"78-RKSJ-H\",\n \"78-RKSJ-V\",\n \"78-V\",\n \"78ms-RKSJ-H\",\n \"78ms-RKSJ-V\",\n \"83pv-RKSJ-H\",\n \"90ms-RKSJ-H\",\n \"90ms-RKSJ-V\",\n \"90msp-RKSJ-H\",\n \"90msp-RKSJ-V\",\n \"90pv-RKSJ-H\",\n \"90pv-RKSJ-V\",\n \"Add-H\",\n \"Add-RKSJ-H\",\n \"Add-RKSJ-V\",\n \"Add-V\",\n \"Adobe-CNS1-0\",\n \"Adobe-CNS1-1\",\n \"Adobe-CNS1-2\",\n \"Adobe-CNS1-3\",\n \"Adobe-CNS1-4\",\n \"Adobe-CNS1-5\",\n \"Adobe-CNS1-6\",\n \"Adobe-GB1-0\",\n \"Adobe-GB1-1\",\n \"Adobe-GB1-2\",\n \"Adobe-GB1-3\",\n \"Adobe-GB1-4\",\n \"Adobe-GB1-5\",\n \"Adobe-Japan1-0\",\n \"Adobe-Japan1-1\",\n \"Adobe-Japan1-2\",\n \"Adobe-Japan1-3\",\n \"Adobe-Japan1-4\",\n \"Adobe-Japan1-5\",\n \"Adobe-Japan1-6\",\n \"Adobe-Korea1-0\",\n \"Adobe-Korea1-1\",\n \"Adobe-Korea1-2\",\n \"B5-H\",\n \"B5-V\",\n \"B5pc-H\",\n \"B5pc-V\",\n \"CNS-EUC-H\",\n \"CNS-EUC-V\",\n \"CNS1-H\",\n \"CNS1-V\",\n \"CNS2-H\",\n \"CNS2-V\",\n \"ETHK-B5-H\",\n \"ETHK-B5-V\",\n \"ETen-B5-H\",\n \"ETen-B5-V\",\n \"ETenms-B5-H\",\n \"ETenms-B5-V\",\n \"EUC-H\",\n \"EUC-V\",\n \"Ext-H\",\n \"Ext-RKSJ-H\",\n \"Ext-RKSJ-V\",\n \"Ext-V\",\n \"GB-EUC-H\",\n \"GB-EUC-V\",\n \"GB-H\",\n \"GB-V\",\n \"GBK-EUC-H\",\n \"GBK-EUC-V\",\n \"GBK2K-H\",\n \"GBK2K-V\",\n \"GBKp-EUC-H\",\n \"GBKp-EUC-V\",\n \"GBT-EUC-H\",\n \"GBT-EUC-V\",\n \"GBT-H\",\n \"GBT-V\",\n \"GBTpc-EUC-H\",\n \"GBTpc-EUC-V\",\n \"GBpc-EUC-H\",\n \"GBpc-EUC-V\",\n \"H\",\n \"HKdla-B5-H\",\n \"HKdla-B5-V\",\n \"HKdlb-B5-H\",\n \"HKdlb-B5-V\",\n \"HKgccs-B5-H\",\n \"HKgccs-B5-V\",\n \"HKm314-B5-H\",\n \"HKm314-B5-V\",\n \"HKm471-B5-H\",\n \"HKm471-B5-V\",\n \"HKscs-B5-H\",\n \"HKscs-B5-V\",\n \"Hankaku\",\n \"Hiragana\",\n \"KSC-EUC-H\",\n \"KSC-EUC-V\",\n \"KSC-H\",\n \"KSC-Johab-H\",\n \"KSC-Johab-V\",\n \"KSC-V\",\n \"KSCms-UHC-H\",\n \"KSCms-UHC-HW-H\",\n \"KSCms-UHC-HW-V\",\n \"KSCms-UHC-V\",\n \"KSCpc-EUC-H\",\n \"KSCpc-EUC-V\",\n \"Katakana\",\n \"NWP-H\",\n \"NWP-V\",\n \"RKSJ-H\",\n \"RKSJ-V\",\n \"Roman\",\n \"UniCNS-UCS2-H\",\n \"UniCNS-UCS2-V\",\n \"UniCNS-UTF16-H\",\n \"UniCNS-UTF16-V\",\n \"UniCNS-UTF32-H\",\n \"UniCNS-UTF32-V\",\n \"UniCNS-UTF8-H\",\n \"UniCNS-UTF8-V\",\n \"UniGB-UCS2-H\",\n \"UniGB-UCS2-V\",\n \"UniGB-UTF16-H\",\n \"UniGB-UTF16-V\",\n \"UniGB-UTF32-H\",\n \"UniGB-UTF32-V\",\n \"UniGB-UTF8-H\",\n \"UniGB-UTF8-V\",\n \"UniJIS-UCS2-H\",\n \"UniJIS-UCS2-HW-H\",\n \"UniJIS-UCS2-HW-V\",\n \"UniJIS-UCS2-V\",\n \"UniJIS-UTF16-H\",\n \"UniJIS-UTF16-V\",\n \"UniJIS-UTF32-H\",\n \"UniJIS-UTF32-V\",\n \"UniJIS-UTF8-H\",\n \"UniJIS-UTF8-V\",\n \"UniJIS2004-UTF16-H\",\n \"UniJIS2004-UTF16-V\",\n \"UniJIS2004-UTF32-H\",\n \"UniJIS2004-UTF32-V\",\n \"UniJIS2004-UTF8-H\",\n \"UniJIS2004-UTF8-V\",\n \"UniJISPro-UCS2-HW-V\",\n \"UniJISPro-UCS2-V\",\n \"UniJISPro-UTF8-V\",\n \"UniJISX0213-UTF32-H\",\n \"UniJISX0213-UTF32-V\",\n \"UniJISX02132004-UTF32-H\",\n \"UniJISX02132004-UTF32-V\",\n \"UniKS-UCS2-H\",\n \"UniKS-UCS2-V\",\n \"UniKS-UTF16-H\",\n \"UniKS-UTF16-V\",\n \"UniKS-UTF32-H\",\n \"UniKS-UTF32-V\",\n \"UniKS-UTF8-H\",\n \"UniKS-UTF8-V\",\n \"V\",\n \"WP-Symbol\",\n];\n\n// Heuristic to avoid hanging the worker-thread for CMap data with ridiculously\n// large ranges, such as e.g. 0xFFFFFFFF (fixes issue11922_reduced.pdf).\nconst MAX_MAP_RANGE = 2 ** 24 - 1; // = 0xFFFFFF\n\n// CMap, not to be confused with TrueType's cmap.\nclass CMap {\n constructor(builtInCMap = false) {\n // Codespace ranges are stored as follows:\n // [[1BytePairs], [2BytePairs], [3BytePairs], [4BytePairs]]\n // where nBytePairs are ranges e.g. [low1, high1, low2, high2, ...]\n this.codespaceRanges = [[], [], [], []];\n this.numCodespaceRanges = 0;\n // Map entries have one of two forms.\n // - cid chars are 16-bit unsigned integers, stored as integers.\n // - bf chars are variable-length byte sequences, stored as strings, with\n // one byte per character.\n this._map = [];\n this.name = \"\";\n this.vertical = false;\n this.useCMap = null;\n this.builtInCMap = builtInCMap;\n }\n\n addCodespaceRange(n, low, high) {\n this.codespaceRanges[n - 1].push(low, high);\n this.numCodespaceRanges++;\n }\n\n mapCidRange(low, high, dstLow) {\n if (high - low > MAX_MAP_RANGE) {\n throw new Error(\"mapCidRange - ignoring data above MAX_MAP_RANGE.\");\n }\n while (low <= high) {\n this._map[low++] = dstLow++;\n }\n }\n\n mapBfRange(low, high, dstLow) {\n if (high - low > MAX_MAP_RANGE) {\n throw new Error(\"mapBfRange - ignoring data above MAX_MAP_RANGE.\");\n }\n const lastByte = dstLow.length - 1;\n while (low <= high) {\n this._map[low++] = dstLow;\n // Only the last byte has to be incremented (in the normal case).\n const nextCharCode = dstLow.charCodeAt(lastByte) + 1;\n if (nextCharCode > 0xff) {\n dstLow =\n dstLow.substring(0, lastByte - 1) +\n String.fromCharCode(dstLow.charCodeAt(lastByte - 1) + 1) +\n \"\\x00\";\n continue;\n }\n dstLow =\n dstLow.substring(0, lastByte) + String.fromCharCode(nextCharCode);\n }\n }\n\n mapBfRangeToArray(low, high, array) {\n if (high - low > MAX_MAP_RANGE) {\n throw new Error(\"mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.\");\n }\n const ii = array.length;\n let i = 0;\n while (low <= high && i < ii) {\n this._map[low] = array[i++];\n ++low;\n }\n }\n\n // This is used for both bf and cid chars.\n mapOne(src, dst) {\n this._map[src] = dst;\n }\n\n lookup(code) {\n return this._map[code];\n }\n\n contains(code) {\n return this._map[code] !== undefined;\n }\n\n forEach(callback) {\n // Most maps have fewer than 65536 entries, and for those we use normal\n // array iteration. But really sparse tables are possible -- e.g. with\n // indices in the *billions*. For such tables we use for..in, which isn't\n // ideal because it stringifies the indices for all present elements, but\n // it does avoid iterating over every undefined entry.\n const map = this._map;\n const length = map.length;\n if (length <= 0x10000) {\n for (let i = 0; i < length; i++) {\n if (map[i] !== undefined) {\n callback(i, map[i]);\n }\n }\n } else {\n for (const i in map) {\n callback(i, map[i]);\n }\n }\n }\n\n charCodeOf(value) {\n // `Array.prototype.indexOf` is *extremely* inefficient for arrays which\n // are both very sparse and very large (see issue8372.pdf).\n const map = this._map;\n if (map.length <= 0x10000) {\n return map.indexOf(value);\n }\n for (const charCode in map) {\n if (map[charCode] === value) {\n return charCode | 0;\n }\n }\n return -1;\n }\n\n getMap() {\n return this._map;\n }\n\n readCharCode(str, offset, out) {\n let c = 0;\n const codespaceRanges = this.codespaceRanges;\n // 9.7.6.2 CMap Mapping\n // The code length is at most 4.\n for (let n = 0, nn = codespaceRanges.length; n < nn; n++) {\n c = ((c << 8) | str.charCodeAt(offset + n)) >>> 0;\n // Check each codespace range to see if it falls within.\n const codespaceRange = codespaceRanges[n];\n for (let k = 0, kk = codespaceRange.length; k < kk; ) {\n const low = codespaceRange[k++];\n const high = codespaceRange[k++];\n if (c >= low && c <= high) {\n out.charcode = c;\n out.length = n + 1;\n return;\n }\n }\n }\n out.charcode = 0;\n out.length = 1;\n }\n\n getCharCodeLength(charCode) {\n const codespaceRanges = this.codespaceRanges;\n for (let n = 0, nn = codespaceRanges.length; n < nn; n++) {\n // Check each codespace range to see if it falls within.\n const codespaceRange = codespaceRanges[n];\n for (let k = 0, kk = codespaceRange.length; k < kk; ) {\n const low = codespaceRange[k++];\n const high = codespaceRange[k++];\n if (charCode >= low && charCode <= high) {\n return n + 1;\n }\n }\n }\n return 1;\n }\n\n get length() {\n return this._map.length;\n }\n\n get isIdentityCMap() {\n if (!(this.name === \"Identity-H\" || this.name === \"Identity-V\")) {\n return false;\n }\n if (this._map.length !== 0x10000) {\n return false;\n }\n for (let i = 0; i < 0x10000; i++) {\n if (this._map[i] !== i) {\n return false;\n }\n }\n return true;\n }\n}\n\n// A special case of CMap, where the _map array implicitly has a length of\n// 65536 and each element is equal to its index.\nclass IdentityCMap extends CMap {\n constructor(vertical, n) {\n super();\n\n this.vertical = vertical;\n this.addCodespaceRange(n, 0, 0xffff);\n }\n\n mapCidRange(low, high, dstLow) {\n unreachable(\"should not call mapCidRange\");\n }\n\n mapBfRange(low, high, dstLow) {\n unreachable(\"should not call mapBfRange\");\n }\n\n mapBfRangeToArray(low, high, array) {\n unreachable(\"should not call mapBfRangeToArray\");\n }\n\n mapOne(src, dst) {\n unreachable(\"should not call mapCidOne\");\n }\n\n lookup(code) {\n return Number.isInteger(code) && code <= 0xffff ? code : undefined;\n }\n\n contains(code) {\n return Number.isInteger(code) && code <= 0xffff;\n }\n\n forEach(callback) {\n for (let i = 0; i <= 0xffff; i++) {\n callback(i, i);\n }\n }\n\n charCodeOf(value) {\n return Number.isInteger(value) && value <= 0xffff ? value : -1;\n }\n\n getMap() {\n // Sometimes identity maps must be instantiated, but it's rare.\n const map = new Array(0x10000);\n for (let i = 0; i <= 0xffff; i++) {\n map[i] = i;\n }\n return map;\n }\n\n get length() {\n return 0x10000;\n }\n\n // eslint-disable-next-line getter-return\n get isIdentityCMap() {\n unreachable(\"should not access .isIdentityCMap\");\n }\n}\n\nfunction strToInt(str) {\n let a = 0;\n for (let i = 0; i < str.length; i++) {\n a = (a << 8) | str.charCodeAt(i);\n }\n return a >>> 0;\n}\n\nfunction expectString(obj) {\n if (typeof obj !== \"string\") {\n throw new FormatError(\"Malformed CMap: expected string.\");\n }\n}\n\nfunction expectInt(obj) {\n if (!Number.isInteger(obj)) {\n throw new FormatError(\"Malformed CMap: expected int.\");\n }\n}\n\nfunction parseBfChar(cMap, lexer) {\n while (true) {\n let obj = lexer.getObj();\n if (obj === EOF) {\n break;\n }\n if (isCmd(obj, \"endbfchar\")) {\n return;\n }\n expectString(obj);\n const src = strToInt(obj);\n obj = lexer.getObj();\n // TODO are /dstName used?\n expectString(obj);\n const dst = obj;\n cMap.mapOne(src, dst);\n }\n}\n\nfunction parseBfRange(cMap, lexer) {\n while (true) {\n let obj = lexer.getObj();\n if (obj === EOF) {\n break;\n }\n if (isCmd(obj, \"endbfrange\")) {\n return;\n }\n expectString(obj);\n const low = strToInt(obj);\n obj = lexer.getObj();\n expectString(obj);\n const high = strToInt(obj);\n obj = lexer.getObj();\n if (Number.isInteger(obj) || typeof obj === \"string\") {\n const dstLow = Number.isInteger(obj) ? String.fromCharCode(obj) : obj;\n cMap.mapBfRange(low, high, dstLow);\n } else if (isCmd(obj, \"[\")) {\n obj = lexer.getObj();\n const array = [];\n while (!isCmd(obj, \"]\") && obj !== EOF) {\n array.push(obj);\n obj = lexer.getObj();\n }\n cMap.mapBfRangeToArray(low, high, array);\n } else {\n break;\n }\n }\n throw new FormatError(\"Invalid bf range.\");\n}\n\nfunction parseCidChar(cMap, lexer) {\n while (true) {\n let obj = lexer.getObj();\n if (obj === EOF) {\n break;\n }\n if (isCmd(obj, \"endcidchar\")) {\n return;\n }\n expectString(obj);\n const src = strToInt(obj);\n obj = lexer.getObj();\n expectInt(obj);\n const dst = obj;\n cMap.mapOne(src, dst);\n }\n}\n\nfunction parseCidRange(cMap, lexer) {\n while (true) {\n let obj = lexer.getObj();\n if (obj === EOF) {\n break;\n }\n if (isCmd(obj, \"endcidrange\")) {\n return;\n }\n expectString(obj);\n const low = strToInt(obj);\n obj = lexer.getObj();\n expectString(obj);\n const high = strToInt(obj);\n obj = lexer.getObj();\n expectInt(obj);\n const dstLow = obj;\n cMap.mapCidRange(low, high, dstLow);\n }\n}\n\nfunction parseCodespaceRange(cMap, lexer) {\n while (true) {\n let obj = lexer.getObj();\n if (obj === EOF) {\n break;\n }\n if (isCmd(obj, \"endcodespacerange\")) {\n return;\n }\n if (typeof obj !== \"string\") {\n break;\n }\n const low = strToInt(obj);\n obj = lexer.getObj();\n if (typeof obj !== \"string\") {\n break;\n }\n const high = strToInt(obj);\n cMap.addCodespaceRange(obj.length, low, high);\n }\n throw new FormatError(\"Invalid codespace range.\");\n}\n\nfunction parseWMode(cMap, lexer) {\n const obj = lexer.getObj();\n if (Number.isInteger(obj)) {\n cMap.vertical = !!obj;\n }\n}\n\nfunction parseCMapName(cMap, lexer) {\n const obj = lexer.getObj();\n if (obj instanceof Name) {\n cMap.name = obj.name;\n }\n}\n\nasync function parseCMap(cMap, lexer, fetchBuiltInCMap, useCMap) {\n let previous, embeddedUseCMap;\n objLoop: while (true) {\n try {\n const obj = lexer.getObj();\n if (obj === EOF) {\n break;\n } else if (obj instanceof Name) {\n if (obj.name === \"WMode\") {\n parseWMode(cMap, lexer);\n } else if (obj.name === \"CMapName\") {\n parseCMapName(cMap, lexer);\n }\n previous = obj;\n } else if (obj instanceof Cmd) {\n switch (obj.cmd) {\n case \"endcmap\":\n break objLoop;\n case \"usecmap\":\n if (previous instanceof Name) {\n embeddedUseCMap = previous.name;\n }\n break;\n case \"begincodespacerange\":\n parseCodespaceRange(cMap, lexer);\n break;\n case \"beginbfchar\":\n parseBfChar(cMap, lexer);\n break;\n case \"begincidchar\":\n parseCidChar(cMap, lexer);\n break;\n case \"beginbfrange\":\n parseBfRange(cMap, lexer);\n break;\n case \"begincidrange\":\n parseCidRange(cMap, lexer);\n break;\n }\n }\n } catch (ex) {\n if (ex instanceof MissingDataException) {\n throw ex;\n }\n warn(\"Invalid cMap data: \" + ex);\n continue;\n }\n }\n\n if (!useCMap && embeddedUseCMap) {\n // Load the useCMap definition from the file only if there wasn't one\n // specified.\n useCMap = embeddedUseCMap;\n }\n if (useCMap) {\n return extendCMap(cMap, fetchBuiltInCMap, useCMap);\n }\n return cMap;\n}\n\nasync function extendCMap(cMap, fetchBuiltInCMap, useCMap) {\n cMap.useCMap = await createBuiltInCMap(useCMap, fetchBuiltInCMap);\n // If there aren't any code space ranges defined clone all the parent ones\n // into this cMap.\n if (cMap.numCodespaceRanges === 0) {\n const useCodespaceRanges = cMap.useCMap.codespaceRanges;\n for (let i = 0; i < useCodespaceRanges.length; i++) {\n cMap.codespaceRanges[i] = useCodespaceRanges[i].slice();\n }\n cMap.numCodespaceRanges = cMap.useCMap.numCodespaceRanges;\n }\n // Merge the map into the current one, making sure not to override\n // any previously defined entries.\n cMap.useCMap.forEach(function (key, value) {\n if (!cMap.contains(key)) {\n cMap.mapOne(key, cMap.useCMap.lookup(key));\n }\n });\n\n return cMap;\n}\n\nasync function createBuiltInCMap(name, fetchBuiltInCMap) {\n if (name === \"Identity-H\") {\n return new IdentityCMap(false, 2);\n } else if (name === \"Identity-V\") {\n return new IdentityCMap(true, 2);\n }\n if (!BUILT_IN_CMAPS.includes(name)) {\n throw new Error(\"Unknown CMap name: \" + name);\n }\n if (!fetchBuiltInCMap) {\n throw new Error(\"Built-in CMap parameters are not provided.\");\n }\n\n const { cMapData, compressionType } = await fetchBuiltInCMap(name);\n const cMap = new CMap(true);\n\n if (compressionType === CMapCompressionType.BINARY) {\n return new BinaryCMapReader().process(cMapData, cMap, useCMap => {\n return extendCMap(cMap, fetchBuiltInCMap, useCMap);\n });\n }\n if (compressionType === CMapCompressionType.NONE) {\n const lexer = new Lexer(new Stream(cMapData));\n return parseCMap(cMap, lexer, fetchBuiltInCMap, null);\n }\n throw new Error(`Invalid CMap \"compressionType\" value: ${compressionType}`);\n}\n\nclass CMapFactory {\n static async create({ encoding, fetchBuiltInCMap, useCMap }) {\n if (encoding instanceof Name) {\n return createBuiltInCMap(encoding.name, fetchBuiltInCMap);\n } else if (encoding instanceof BaseStream) {\n const parsedCMap = await parseCMap(\n /* cMap = */ new CMap(),\n /* lexer = */ new Lexer(encoding),\n fetchBuiltInCMap,\n useCMap\n );\n\n if (parsedCMap.isIdentityCMap) {\n return createBuiltInCMap(parsedCMap.name, fetchBuiltInCMap);\n }\n return parsedCMap;\n }\n throw new Error(\"Encoding required.\");\n }\n}\n\nexport { CMap, CMapFactory, IdentityCMap };\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// prettier-ignore\nconst ISOAdobeCharset = [\n \".notdef\", \"space\", \"exclam\", \"quotedbl\", \"numbersign\", \"dollar\",\n \"percent\", \"ampersand\", \"quoteright\", \"parenleft\", \"parenright\",\n \"asterisk\", \"plus\", \"comma\", \"hyphen\", \"period\", \"slash\", \"zero\",\n \"one\", \"two\", \"three\", \"four\", \"five\", \"six\", \"seven\", \"eight\",\n \"nine\", \"colon\", \"semicolon\", \"less\", \"equal\", \"greater\", \"question\",\n \"at\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\",\n \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\",\n \"bracketleft\", \"backslash\", \"bracketright\", \"asciicircum\", \"underscore\",\n \"quoteleft\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\",\n \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\",\n \"braceleft\", \"bar\", \"braceright\", \"asciitilde\", \"exclamdown\", \"cent\",\n \"sterling\", \"fraction\", \"yen\", \"florin\", \"section\", \"currency\",\n \"quotesingle\", \"quotedblleft\", \"guillemotleft\", \"guilsinglleft\",\n \"guilsinglright\", \"fi\", \"fl\", \"endash\", \"dagger\", \"daggerdbl\",\n \"periodcentered\", \"paragraph\", \"bullet\", \"quotesinglbase\",\n \"quotedblbase\", \"quotedblright\", \"guillemotright\", \"ellipsis\",\n \"perthousand\", \"questiondown\", \"grave\", \"acute\", \"circumflex\", \"tilde\",\n \"macron\", \"breve\", \"dotaccent\", \"dieresis\", \"ring\", \"cedilla\",\n \"hungarumlaut\", \"ogonek\", \"caron\", \"emdash\", \"AE\", \"ordfeminine\",\n \"Lslash\", \"Oslash\", \"OE\", \"ordmasculine\", \"ae\", \"dotlessi\", \"lslash\",\n \"oslash\", \"oe\", \"germandbls\", \"onesuperior\", \"logicalnot\", \"mu\",\n \"trademark\", \"Eth\", \"onehalf\", \"plusminus\", \"Thorn\", \"onequarter\",\n \"divide\", \"brokenbar\", \"degree\", \"thorn\", \"threequarters\", \"twosuperior\",\n \"registered\", \"minus\", \"eth\", \"multiply\", \"threesuperior\", \"copyright\",\n \"Aacute\", \"Acircumflex\", \"Adieresis\", \"Agrave\", \"Aring\", \"Atilde\",\n \"Ccedilla\", \"Eacute\", \"Ecircumflex\", \"Edieresis\", \"Egrave\", \"Iacute\",\n \"Icircumflex\", \"Idieresis\", \"Igrave\", \"Ntilde\", \"Oacute\", \"Ocircumflex\",\n \"Odieresis\", \"Ograve\", \"Otilde\", \"Scaron\", \"Uacute\", \"Ucircumflex\",\n \"Udieresis\", \"Ugrave\", \"Yacute\", \"Ydieresis\", \"Zcaron\", \"aacute\",\n \"acircumflex\", \"adieresis\", \"agrave\", \"aring\", \"atilde\", \"ccedilla\",\n \"eacute\", \"ecircumflex\", \"edieresis\", \"egrave\", \"iacute\", \"icircumflex\",\n \"idieresis\", \"igrave\", \"ntilde\", \"oacute\", \"ocircumflex\", \"odieresis\",\n \"ograve\", \"otilde\", \"scaron\", \"uacute\", \"ucircumflex\", \"udieresis\",\n \"ugrave\", \"yacute\", \"ydieresis\", \"zcaron\"\n];\n\n// prettier-ignore\nconst ExpertCharset = [\n \".notdef\", \"space\", \"exclamsmall\", \"Hungarumlautsmall\", \"dollaroldstyle\",\n \"dollarsuperior\", \"ampersandsmall\", \"Acutesmall\", \"parenleftsuperior\",\n \"parenrightsuperior\", \"twodotenleader\", \"onedotenleader\", \"comma\",\n \"hyphen\", \"period\", \"fraction\", \"zerooldstyle\", \"oneoldstyle\",\n \"twooldstyle\", \"threeoldstyle\", \"fouroldstyle\", \"fiveoldstyle\",\n \"sixoldstyle\", \"sevenoldstyle\", \"eightoldstyle\", \"nineoldstyle\",\n \"colon\", \"semicolon\", \"commasuperior\", \"threequartersemdash\",\n \"periodsuperior\", \"questionsmall\", \"asuperior\", \"bsuperior\",\n \"centsuperior\", \"dsuperior\", \"esuperior\", \"isuperior\", \"lsuperior\",\n \"msuperior\", \"nsuperior\", \"osuperior\", \"rsuperior\", \"ssuperior\",\n \"tsuperior\", \"ff\", \"fi\", \"fl\", \"ffi\", \"ffl\", \"parenleftinferior\",\n \"parenrightinferior\", \"Circumflexsmall\", \"hyphensuperior\", \"Gravesmall\",\n \"Asmall\", \"Bsmall\", \"Csmall\", \"Dsmall\", \"Esmall\", \"Fsmall\", \"Gsmall\",\n \"Hsmall\", \"Ismall\", \"Jsmall\", \"Ksmall\", \"Lsmall\", \"Msmall\", \"Nsmall\",\n \"Osmall\", \"Psmall\", \"Qsmall\", \"Rsmall\", \"Ssmall\", \"Tsmall\", \"Usmall\",\n \"Vsmall\", \"Wsmall\", \"Xsmall\", \"Ysmall\", \"Zsmall\", \"colonmonetary\",\n \"onefitted\", \"rupiah\", \"Tildesmall\", \"exclamdownsmall\", \"centoldstyle\",\n \"Lslashsmall\", \"Scaronsmall\", \"Zcaronsmall\", \"Dieresissmall\",\n \"Brevesmall\", \"Caronsmall\", \"Dotaccentsmall\", \"Macronsmall\",\n \"figuredash\", \"hypheninferior\", \"Ogoneksmall\", \"Ringsmall\",\n \"Cedillasmall\", \"onequarter\", \"onehalf\", \"threequarters\",\n \"questiondownsmall\", \"oneeighth\", \"threeeighths\", \"fiveeighths\",\n \"seveneighths\", \"onethird\", \"twothirds\", \"zerosuperior\", \"onesuperior\",\n \"twosuperior\", \"threesuperior\", \"foursuperior\", \"fivesuperior\",\n \"sixsuperior\", \"sevensuperior\", \"eightsuperior\", \"ninesuperior\",\n \"zeroinferior\", \"oneinferior\", \"twoinferior\", \"threeinferior\",\n \"fourinferior\", \"fiveinferior\", \"sixinferior\", \"seveninferior\",\n \"eightinferior\", \"nineinferior\", \"centinferior\", \"dollarinferior\",\n \"periodinferior\", \"commainferior\", \"Agravesmall\", \"Aacutesmall\",\n \"Acircumflexsmall\", \"Atildesmall\", \"Adieresissmall\", \"Aringsmall\",\n \"AEsmall\", \"Ccedillasmall\", \"Egravesmall\", \"Eacutesmall\",\n \"Ecircumflexsmall\", \"Edieresissmall\", \"Igravesmall\", \"Iacutesmall\",\n \"Icircumflexsmall\", \"Idieresissmall\", \"Ethsmall\", \"Ntildesmall\",\n \"Ogravesmall\", \"Oacutesmall\", \"Ocircumflexsmall\", \"Otildesmall\",\n \"Odieresissmall\", \"OEsmall\", \"Oslashsmall\", \"Ugravesmall\", \"Uacutesmall\",\n \"Ucircumflexsmall\", \"Udieresissmall\", \"Yacutesmall\", \"Thornsmall\",\n \"Ydieresissmall\"\n];\n\n// prettier-ignore\nconst ExpertSubsetCharset = [\n \".notdef\", \"space\", \"dollaroldstyle\", \"dollarsuperior\",\n \"parenleftsuperior\", \"parenrightsuperior\", \"twodotenleader\",\n \"onedotenleader\", \"comma\", \"hyphen\", \"period\", \"fraction\",\n \"zerooldstyle\", \"oneoldstyle\", \"twooldstyle\", \"threeoldstyle\",\n \"fouroldstyle\", \"fiveoldstyle\", \"sixoldstyle\", \"sevenoldstyle\",\n \"eightoldstyle\", \"nineoldstyle\", \"colon\", \"semicolon\", \"commasuperior\",\n \"threequartersemdash\", \"periodsuperior\", \"asuperior\", \"bsuperior\",\n \"centsuperior\", \"dsuperior\", \"esuperior\", \"isuperior\", \"lsuperior\",\n \"msuperior\", \"nsuperior\", \"osuperior\", \"rsuperior\", \"ssuperior\",\n \"tsuperior\", \"ff\", \"fi\", \"fl\", \"ffi\", \"ffl\", \"parenleftinferior\",\n \"parenrightinferior\", \"hyphensuperior\", \"colonmonetary\", \"onefitted\",\n \"rupiah\", \"centoldstyle\", \"figuredash\", \"hypheninferior\", \"onequarter\",\n \"onehalf\", \"threequarters\", \"oneeighth\", \"threeeighths\", \"fiveeighths\",\n \"seveneighths\", \"onethird\", \"twothirds\", \"zerosuperior\", \"onesuperior\",\n \"twosuperior\", \"threesuperior\", \"foursuperior\", \"fivesuperior\",\n \"sixsuperior\", \"sevensuperior\", \"eightsuperior\", \"ninesuperior\",\n \"zeroinferior\", \"oneinferior\", \"twoinferior\", \"threeinferior\",\n \"fourinferior\", \"fiveinferior\", \"sixinferior\", \"seveninferior\",\n \"eightinferior\", \"nineinferior\", \"centinferior\", \"dollarinferior\",\n \"periodinferior\", \"commainferior\"\n];\n\nexport { ExpertCharset, ExpertSubsetCharset, ISOAdobeCharset };\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// prettier-ignore\nconst ExpertEncoding = [\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"space\", \"exclamsmall\", \"Hungarumlautsmall\", \"\", \"dollaroldstyle\",\n \"dollarsuperior\", \"ampersandsmall\", \"Acutesmall\", \"parenleftsuperior\",\n \"parenrightsuperior\", \"twodotenleader\", \"onedotenleader\", \"comma\",\n \"hyphen\", \"period\", \"fraction\", \"zerooldstyle\", \"oneoldstyle\",\n \"twooldstyle\", \"threeoldstyle\", \"fouroldstyle\", \"fiveoldstyle\",\n \"sixoldstyle\", \"sevenoldstyle\", \"eightoldstyle\", \"nineoldstyle\", \"colon\",\n \"semicolon\", \"commasuperior\", \"threequartersemdash\", \"periodsuperior\",\n \"questionsmall\", \"\", \"asuperior\", \"bsuperior\", \"centsuperior\", \"dsuperior\",\n \"esuperior\", \"\", \"\", \"\", \"isuperior\", \"\", \"\", \"lsuperior\", \"msuperior\",\n \"nsuperior\", \"osuperior\", \"\", \"\", \"rsuperior\", \"ssuperior\", \"tsuperior\",\n \"\", \"ff\", \"fi\", \"fl\", \"ffi\", \"ffl\", \"parenleftinferior\", \"\",\n \"parenrightinferior\", \"Circumflexsmall\", \"hyphensuperior\", \"Gravesmall\",\n \"Asmall\", \"Bsmall\", \"Csmall\", \"Dsmall\", \"Esmall\", \"Fsmall\", \"Gsmall\",\n \"Hsmall\", \"Ismall\", \"Jsmall\", \"Ksmall\", \"Lsmall\", \"Msmall\", \"Nsmall\",\n \"Osmall\", \"Psmall\", \"Qsmall\", \"Rsmall\", \"Ssmall\", \"Tsmall\", \"Usmall\",\n \"Vsmall\", \"Wsmall\", \"Xsmall\", \"Ysmall\", \"Zsmall\", \"colonmonetary\",\n \"onefitted\", \"rupiah\", \"Tildesmall\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"\", \"\", \"\", \"\", \"\", \"\", \"exclamdownsmall\", \"centoldstyle\", \"Lslashsmall\",\n \"\", \"\", \"Scaronsmall\", \"Zcaronsmall\", \"Dieresissmall\", \"Brevesmall\",\n \"Caronsmall\", \"\", \"Dotaccentsmall\", \"\", \"\", \"Macronsmall\", \"\", \"\",\n \"figuredash\", \"hypheninferior\", \"\", \"\", \"Ogoneksmall\", \"Ringsmall\",\n \"Cedillasmall\", \"\", \"\", \"\", \"onequarter\", \"onehalf\", \"threequarters\",\n \"questiondownsmall\", \"oneeighth\", \"threeeighths\", \"fiveeighths\",\n \"seveneighths\", \"onethird\", \"twothirds\", \"\", \"\", \"zerosuperior\",\n \"onesuperior\", \"twosuperior\", \"threesuperior\", \"foursuperior\",\n \"fivesuperior\", \"sixsuperior\", \"sevensuperior\", \"eightsuperior\",\n \"ninesuperior\", \"zeroinferior\", \"oneinferior\", \"twoinferior\",\n \"threeinferior\", \"fourinferior\", \"fiveinferior\", \"sixinferior\",\n \"seveninferior\", \"eightinferior\", \"nineinferior\", \"centinferior\",\n \"dollarinferior\", \"periodinferior\", \"commainferior\", \"Agravesmall\",\n \"Aacutesmall\", \"Acircumflexsmall\", \"Atildesmall\", \"Adieresissmall\",\n \"Aringsmall\", \"AEsmall\", \"Ccedillasmall\", \"Egravesmall\", \"Eacutesmall\",\n \"Ecircumflexsmall\", \"Edieresissmall\", \"Igravesmall\", \"Iacutesmall\",\n \"Icircumflexsmall\", \"Idieresissmall\", \"Ethsmall\", \"Ntildesmall\",\n \"Ogravesmall\", \"Oacutesmall\", \"Ocircumflexsmall\", \"Otildesmall\",\n \"Odieresissmall\", \"OEsmall\", \"Oslashsmall\", \"Ugravesmall\", \"Uacutesmall\",\n \"Ucircumflexsmall\", \"Udieresissmall\", \"Yacutesmall\", \"Thornsmall\",\n \"Ydieresissmall\"];\n\n// prettier-ignore\nconst MacExpertEncoding = [\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"space\", \"exclamsmall\", \"Hungarumlautsmall\", \"centoldstyle\",\n \"dollaroldstyle\", \"dollarsuperior\", \"ampersandsmall\", \"Acutesmall\",\n \"parenleftsuperior\", \"parenrightsuperior\", \"twodotenleader\",\n \"onedotenleader\", \"comma\", \"hyphen\", \"period\", \"fraction\", \"zerooldstyle\",\n \"oneoldstyle\", \"twooldstyle\", \"threeoldstyle\", \"fouroldstyle\",\n \"fiveoldstyle\", \"sixoldstyle\", \"sevenoldstyle\", \"eightoldstyle\",\n \"nineoldstyle\", \"colon\", \"semicolon\", \"\", \"threequartersemdash\", \"\",\n \"questionsmall\", \"\", \"\", \"\", \"\", \"Ethsmall\", \"\", \"\", \"onequarter\",\n \"onehalf\", \"threequarters\", \"oneeighth\", \"threeeighths\", \"fiveeighths\",\n \"seveneighths\", \"onethird\", \"twothirds\", \"\", \"\", \"\", \"\", \"\", \"\", \"ff\",\n \"fi\", \"fl\", \"ffi\", \"ffl\", \"parenleftinferior\", \"\", \"parenrightinferior\",\n \"Circumflexsmall\", \"hypheninferior\", \"Gravesmall\", \"Asmall\", \"Bsmall\",\n \"Csmall\", \"Dsmall\", \"Esmall\", \"Fsmall\", \"Gsmall\", \"Hsmall\", \"Ismall\",\n \"Jsmall\", \"Ksmall\", \"Lsmall\", \"Msmall\", \"Nsmall\", \"Osmall\", \"Psmall\",\n \"Qsmall\", \"Rsmall\", \"Ssmall\", \"Tsmall\", \"Usmall\", \"Vsmall\", \"Wsmall\",\n \"Xsmall\", \"Ysmall\", \"Zsmall\", \"colonmonetary\", \"onefitted\", \"rupiah\",\n \"Tildesmall\", \"\", \"\", \"asuperior\", \"centsuperior\", \"\", \"\", \"\", \"\",\n \"Aacutesmall\", \"Agravesmall\", \"Acircumflexsmall\", \"Adieresissmall\",\n \"Atildesmall\", \"Aringsmall\", \"Ccedillasmall\", \"Eacutesmall\", \"Egravesmall\",\n \"Ecircumflexsmall\", \"Edieresissmall\", \"Iacutesmall\", \"Igravesmall\",\n \"Icircumflexsmall\", \"Idieresissmall\", \"Ntildesmall\", \"Oacutesmall\",\n \"Ogravesmall\", \"Ocircumflexsmall\", \"Odieresissmall\", \"Otildesmall\",\n \"Uacutesmall\", \"Ugravesmall\", \"Ucircumflexsmall\", \"Udieresissmall\", \"\",\n \"eightsuperior\", \"fourinferior\", \"threeinferior\", \"sixinferior\",\n \"eightinferior\", \"seveninferior\", \"Scaronsmall\", \"\", \"centinferior\",\n \"twoinferior\", \"\", \"Dieresissmall\", \"\", \"Caronsmall\", \"osuperior\",\n \"fiveinferior\", \"\", \"commainferior\", \"periodinferior\", \"Yacutesmall\", \"\",\n \"dollarinferior\", \"\", \"\", \"Thornsmall\", \"\", \"nineinferior\", \"zeroinferior\",\n \"Zcaronsmall\", \"AEsmall\", \"Oslashsmall\", \"questiondownsmall\",\n \"oneinferior\", \"Lslashsmall\", \"\", \"\", \"\", \"\", \"\", \"\", \"Cedillasmall\", \"\",\n \"\", \"\", \"\", \"\", \"OEsmall\", \"figuredash\", \"hyphensuperior\", \"\", \"\", \"\", \"\",\n \"exclamdownsmall\", \"\", \"Ydieresissmall\", \"\", \"onesuperior\", \"twosuperior\",\n \"threesuperior\", \"foursuperior\", \"fivesuperior\", \"sixsuperior\",\n \"sevensuperior\", \"ninesuperior\", \"zerosuperior\", \"\", \"esuperior\",\n \"rsuperior\", \"tsuperior\", \"\", \"\", \"isuperior\", \"ssuperior\", \"dsuperior\",\n \"\", \"\", \"\", \"\", \"\", \"lsuperior\", \"Ogoneksmall\", \"Brevesmall\",\n \"Macronsmall\", \"bsuperior\", \"nsuperior\", \"msuperior\", \"commasuperior\",\n \"periodsuperior\", \"Dotaccentsmall\", \"Ringsmall\", \"\", \"\", \"\", \"\"];\n\n// prettier-ignore\nconst MacRomanEncoding = [\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"space\", \"exclam\", \"quotedbl\", \"numbersign\", \"dollar\", \"percent\",\n \"ampersand\", \"quotesingle\", \"parenleft\", \"parenright\", \"asterisk\", \"plus\",\n \"comma\", \"hyphen\", \"period\", \"slash\", \"zero\", \"one\", \"two\", \"three\",\n \"four\", \"five\", \"six\", \"seven\", \"eight\", \"nine\", \"colon\", \"semicolon\",\n \"less\", \"equal\", \"greater\", \"question\", \"at\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\",\n \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\",\n \"V\", \"W\", \"X\", \"Y\", \"Z\", \"bracketleft\", \"backslash\", \"bracketright\",\n \"asciicircum\", \"underscore\", \"grave\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\",\n \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\",\n \"w\", \"x\", \"y\", \"z\", \"braceleft\", \"bar\", \"braceright\", \"asciitilde\", \"\",\n \"Adieresis\", \"Aring\", \"Ccedilla\", \"Eacute\", \"Ntilde\", \"Odieresis\",\n \"Udieresis\", \"aacute\", \"agrave\", \"acircumflex\", \"adieresis\", \"atilde\",\n \"aring\", \"ccedilla\", \"eacute\", \"egrave\", \"ecircumflex\", \"edieresis\",\n \"iacute\", \"igrave\", \"icircumflex\", \"idieresis\", \"ntilde\", \"oacute\",\n \"ograve\", \"ocircumflex\", \"odieresis\", \"otilde\", \"uacute\", \"ugrave\",\n \"ucircumflex\", \"udieresis\", \"dagger\", \"degree\", \"cent\", \"sterling\",\n \"section\", \"bullet\", \"paragraph\", \"germandbls\", \"registered\", \"copyright\",\n \"trademark\", \"acute\", \"dieresis\", \"notequal\", \"AE\", \"Oslash\", \"infinity\",\n \"plusminus\", \"lessequal\", \"greaterequal\", \"yen\", \"mu\", \"partialdiff\",\n \"summation\", \"product\", \"pi\", \"integral\", \"ordfeminine\", \"ordmasculine\",\n \"Omega\", \"ae\", \"oslash\", \"questiondown\", \"exclamdown\", \"logicalnot\",\n \"radical\", \"florin\", \"approxequal\", \"Delta\", \"guillemotleft\",\n \"guillemotright\", \"ellipsis\", \"space\", \"Agrave\", \"Atilde\", \"Otilde\", \"OE\",\n \"oe\", \"endash\", \"emdash\", \"quotedblleft\", \"quotedblright\", \"quoteleft\",\n \"quoteright\", \"divide\", \"lozenge\", \"ydieresis\", \"Ydieresis\", \"fraction\",\n \"currency\", \"guilsinglleft\", \"guilsinglright\", \"fi\", \"fl\", \"daggerdbl\",\n \"periodcentered\", \"quotesinglbase\", \"quotedblbase\", \"perthousand\",\n \"Acircumflex\", \"Ecircumflex\", \"Aacute\", \"Edieresis\", \"Egrave\", \"Iacute\",\n \"Icircumflex\", \"Idieresis\", \"Igrave\", \"Oacute\", \"Ocircumflex\", \"apple\",\n \"Ograve\", \"Uacute\", \"Ucircumflex\", \"Ugrave\", \"dotlessi\", \"circumflex\",\n \"tilde\", \"macron\", \"breve\", \"dotaccent\", \"ring\", \"cedilla\", \"hungarumlaut\",\n \"ogonek\", \"caron\"];\n\n// prettier-ignore\nconst StandardEncoding = [\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"space\", \"exclam\", \"quotedbl\", \"numbersign\", \"dollar\", \"percent\",\n \"ampersand\", \"quoteright\", \"parenleft\", \"parenright\", \"asterisk\", \"plus\",\n \"comma\", \"hyphen\", \"period\", \"slash\", \"zero\", \"one\", \"two\", \"three\",\n \"four\", \"five\", \"six\", \"seven\", \"eight\", \"nine\", \"colon\", \"semicolon\",\n \"less\", \"equal\", \"greater\", \"question\", \"at\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\",\n \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\",\n \"V\", \"W\", \"X\", \"Y\", \"Z\", \"bracketleft\", \"backslash\", \"bracketright\",\n \"asciicircum\", \"underscore\", \"quoteleft\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\",\n \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\",\n \"v\", \"w\", \"x\", \"y\", \"z\", \"braceleft\", \"bar\", \"braceright\", \"asciitilde\",\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"exclamdown\",\n \"cent\", \"sterling\", \"fraction\", \"yen\", \"florin\", \"section\", \"currency\",\n \"quotesingle\", \"quotedblleft\", \"guillemotleft\", \"guilsinglleft\",\n \"guilsinglright\", \"fi\", \"fl\", \"\", \"endash\", \"dagger\", \"daggerdbl\",\n \"periodcentered\", \"\", \"paragraph\", \"bullet\", \"quotesinglbase\",\n \"quotedblbase\", \"quotedblright\", \"guillemotright\", \"ellipsis\",\n \"perthousand\", \"\", \"questiondown\", \"\", \"grave\", \"acute\", \"circumflex\",\n \"tilde\", \"macron\", \"breve\", \"dotaccent\", \"dieresis\", \"\", \"ring\", \"cedilla\",\n \"\", \"hungarumlaut\", \"ogonek\", \"caron\", \"emdash\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"AE\", \"\", \"ordfeminine\", \"\", \"\",\n \"\", \"\", \"Lslash\", \"Oslash\", \"OE\", \"ordmasculine\", \"\", \"\", \"\", \"\", \"\", \"ae\",\n \"\", \"\", \"\", \"dotlessi\", \"\", \"\", \"lslash\", \"oslash\", \"oe\", \"germandbls\", \"\",\n \"\", \"\", \"\"];\n\n// prettier-ignore\nconst WinAnsiEncoding = [\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"space\", \"exclam\", \"quotedbl\", \"numbersign\", \"dollar\", \"percent\",\n \"ampersand\", \"quotesingle\", \"parenleft\", \"parenright\", \"asterisk\", \"plus\",\n \"comma\", \"hyphen\", \"period\", \"slash\", \"zero\", \"one\", \"two\", \"three\",\n \"four\", \"five\", \"six\", \"seven\", \"eight\", \"nine\", \"colon\", \"semicolon\",\n \"less\", \"equal\", \"greater\", \"question\", \"at\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\",\n \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\",\n \"V\", \"W\", \"X\", \"Y\", \"Z\", \"bracketleft\", \"backslash\", \"bracketright\",\n \"asciicircum\", \"underscore\", \"grave\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\",\n \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\",\n \"w\", \"x\", \"y\", \"z\", \"braceleft\", \"bar\", \"braceright\", \"asciitilde\",\n \"bullet\", \"Euro\", \"bullet\", \"quotesinglbase\", \"florin\", \"quotedblbase\",\n \"ellipsis\", \"dagger\", \"daggerdbl\", \"circumflex\", \"perthousand\", \"Scaron\",\n \"guilsinglleft\", \"OE\", \"bullet\", \"Zcaron\", \"bullet\", \"bullet\", \"quoteleft\",\n \"quoteright\", \"quotedblleft\", \"quotedblright\", \"bullet\", \"endash\",\n \"emdash\", \"tilde\", \"trademark\", \"scaron\", \"guilsinglright\", \"oe\", \"bullet\",\n \"zcaron\", \"Ydieresis\", \"space\", \"exclamdown\", \"cent\", \"sterling\",\n \"currency\", \"yen\", \"brokenbar\", \"section\", \"dieresis\", \"copyright\",\n \"ordfeminine\", \"guillemotleft\", \"logicalnot\", \"hyphen\", \"registered\",\n \"macron\", \"degree\", \"plusminus\", \"twosuperior\", \"threesuperior\", \"acute\",\n \"mu\", \"paragraph\", \"periodcentered\", \"cedilla\", \"onesuperior\",\n \"ordmasculine\", \"guillemotright\", \"onequarter\", \"onehalf\", \"threequarters\",\n \"questiondown\", \"Agrave\", \"Aacute\", \"Acircumflex\", \"Atilde\", \"Adieresis\",\n \"Aring\", \"AE\", \"Ccedilla\", \"Egrave\", \"Eacute\", \"Ecircumflex\", \"Edieresis\",\n \"Igrave\", \"Iacute\", \"Icircumflex\", \"Idieresis\", \"Eth\", \"Ntilde\", \"Ograve\",\n \"Oacute\", \"Ocircumflex\", \"Otilde\", \"Odieresis\", \"multiply\", \"Oslash\",\n \"Ugrave\", \"Uacute\", \"Ucircumflex\", \"Udieresis\", \"Yacute\", \"Thorn\",\n \"germandbls\", \"agrave\", \"aacute\", \"acircumflex\", \"atilde\", \"adieresis\",\n \"aring\", \"ae\", \"ccedilla\", \"egrave\", \"eacute\", \"ecircumflex\", \"edieresis\",\n \"igrave\", \"iacute\", \"icircumflex\", \"idieresis\", \"eth\", \"ntilde\", \"ograve\",\n \"oacute\", \"ocircumflex\", \"otilde\", \"odieresis\", \"divide\", \"oslash\",\n \"ugrave\", \"uacute\", \"ucircumflex\", \"udieresis\", \"yacute\", \"thorn\",\n \"ydieresis\"];\n\n// prettier-ignore\nconst SymbolSetEncoding = [\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"space\", \"exclam\", \"universal\", \"numbersign\", \"existential\", \"percent\",\n \"ampersand\", \"suchthat\", \"parenleft\", \"parenright\", \"asteriskmath\", \"plus\",\n \"comma\", \"minus\", \"period\", \"slash\", \"zero\", \"one\", \"two\", \"three\", \"four\",\n \"five\", \"six\", \"seven\", \"eight\", \"nine\", \"colon\", \"semicolon\", \"less\",\n \"equal\", \"greater\", \"question\", \"congruent\", \"Alpha\", \"Beta\", \"Chi\",\n \"Delta\", \"Epsilon\", \"Phi\", \"Gamma\", \"Eta\", \"Iota\", \"theta1\", \"Kappa\",\n \"Lambda\", \"Mu\", \"Nu\", \"Omicron\", \"Pi\", \"Theta\", \"Rho\", \"Sigma\", \"Tau\",\n \"Upsilon\", \"sigma1\", \"Omega\", \"Xi\", \"Psi\", \"Zeta\", \"bracketleft\",\n \"therefore\", \"bracketright\", \"perpendicular\", \"underscore\", \"radicalex\",\n \"alpha\", \"beta\", \"chi\", \"delta\", \"epsilon\", \"phi\", \"gamma\", \"eta\", \"iota\",\n \"phi1\", \"kappa\", \"lambda\", \"mu\", \"nu\", \"omicron\", \"pi\", \"theta\", \"rho\",\n \"sigma\", \"tau\", \"upsilon\", \"omega1\", \"omega\", \"xi\", \"psi\", \"zeta\",\n \"braceleft\", \"bar\", \"braceright\", \"similar\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"Euro\", \"Upsilon1\", \"minute\", \"lessequal\",\n \"fraction\", \"infinity\", \"florin\", \"club\", \"diamond\", \"heart\", \"spade\",\n \"arrowboth\", \"arrowleft\", \"arrowup\", \"arrowright\", \"arrowdown\", \"degree\",\n \"plusminus\", \"second\", \"greaterequal\", \"multiply\", \"proportional\",\n \"partialdiff\", \"bullet\", \"divide\", \"notequal\", \"equivalence\",\n \"approxequal\", \"ellipsis\", \"arrowvertex\", \"arrowhorizex\", \"carriagereturn\",\n \"aleph\", \"Ifraktur\", \"Rfraktur\", \"weierstrass\", \"circlemultiply\",\n \"circleplus\", \"emptyset\", \"intersection\", \"union\", \"propersuperset\",\n \"reflexsuperset\", \"notsubset\", \"propersubset\", \"reflexsubset\", \"element\",\n \"notelement\", \"angle\", \"gradient\", \"registerserif\", \"copyrightserif\",\n \"trademarkserif\", \"product\", \"radical\", \"dotmath\", \"logicalnot\",\n \"logicaland\", \"logicalor\", \"arrowdblboth\", \"arrowdblleft\", \"arrowdblup\",\n \"arrowdblright\", \"arrowdbldown\", \"lozenge\", \"angleleft\", \"registersans\",\n \"copyrightsans\", \"trademarksans\", \"summation\", \"parenlefttp\",\n \"parenleftex\", \"parenleftbt\", \"bracketlefttp\", \"bracketleftex\",\n \"bracketleftbt\", \"bracelefttp\", \"braceleftmid\", \"braceleftbt\", \"braceex\",\n \"\", \"angleright\", \"integral\", \"integraltp\", \"integralex\", \"integralbt\",\n \"parenrighttp\", \"parenrightex\", \"parenrightbt\", \"bracketrighttp\",\n \"bracketrightex\", \"bracketrightbt\", \"bracerighttp\", \"bracerightmid\",\n \"bracerightbt\", \"\"];\n\n// prettier-ignore\nconst ZapfDingbatsEncoding = [\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"space\", \"a1\", \"a2\", \"a202\", \"a3\", \"a4\", \"a5\", \"a119\", \"a118\", \"a117\",\n \"a11\", \"a12\", \"a13\", \"a14\", \"a15\", \"a16\", \"a105\", \"a17\", \"a18\", \"a19\",\n \"a20\", \"a21\", \"a22\", \"a23\", \"a24\", \"a25\", \"a26\", \"a27\", \"a28\", \"a6\", \"a7\",\n \"a8\", \"a9\", \"a10\", \"a29\", \"a30\", \"a31\", \"a32\", \"a33\", \"a34\", \"a35\", \"a36\",\n \"a37\", \"a38\", \"a39\", \"a40\", \"a41\", \"a42\", \"a43\", \"a44\", \"a45\", \"a46\",\n \"a47\", \"a48\", \"a49\", \"a50\", \"a51\", \"a52\", \"a53\", \"a54\", \"a55\", \"a56\",\n \"a57\", \"a58\", \"a59\", \"a60\", \"a61\", \"a62\", \"a63\", \"a64\", \"a65\", \"a66\",\n \"a67\", \"a68\", \"a69\", \"a70\", \"a71\", \"a72\", \"a73\", \"a74\", \"a203\", \"a75\",\n \"a204\", \"a76\", \"a77\", \"a78\", \"a79\", \"a81\", \"a82\", \"a83\", \"a84\", \"a97\",\n \"a98\", \"a99\", \"a100\", \"\", \"a89\", \"a90\", \"a93\", \"a94\", \"a91\", \"a92\", \"a205\",\n \"a85\", \"a206\", \"a86\", \"a87\", \"a88\", \"a95\", \"a96\", \"\", \"\", \"\", \"\", \"\", \"\",\n \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"a101\", \"a102\", \"a103\",\n \"a104\", \"a106\", \"a107\", \"a108\", \"a112\", \"a111\", \"a110\", \"a109\", \"a120\",\n \"a121\", \"a122\", \"a123\", \"a124\", \"a125\", \"a126\", \"a127\", \"a128\", \"a129\",\n \"a130\", \"a131\", \"a132\", \"a133\", \"a134\", \"a135\", \"a136\", \"a137\", \"a138\",\n \"a139\", \"a140\", \"a141\", \"a142\", \"a143\", \"a144\", \"a145\", \"a146\", \"a147\",\n \"a148\", \"a149\", \"a150\", \"a151\", \"a152\", \"a153\", \"a154\", \"a155\", \"a156\",\n \"a157\", \"a158\", \"a159\", \"a160\", \"a161\", \"a163\", \"a164\", \"a196\", \"a165\",\n \"a192\", \"a166\", \"a167\", \"a168\", \"a169\", \"a170\", \"a171\", \"a172\", \"a173\",\n \"a162\", \"a174\", \"a175\", \"a176\", \"a177\", \"a178\", \"a179\", \"a193\", \"a180\",\n \"a199\", \"a181\", \"a200\", \"a182\", \"\", \"a201\", \"a183\", \"a184\", \"a197\", \"a185\",\n \"a194\", \"a198\", \"a186\", \"a195\", \"a187\", \"a188\", \"a189\", \"a190\", \"a191\", \"\"];\n\nfunction getEncoding(encodingName) {\n switch (encodingName) {\n case \"WinAnsiEncoding\":\n return WinAnsiEncoding;\n case \"StandardEncoding\":\n return StandardEncoding;\n case \"MacRomanEncoding\":\n return MacRomanEncoding;\n case \"SymbolSetEncoding\":\n return SymbolSetEncoding;\n case \"ZapfDingbatsEncoding\":\n return ZapfDingbatsEncoding;\n case \"ExpertEncoding\":\n return ExpertEncoding;\n case \"MacExpertEncoding\":\n return MacExpertEncoding;\n default:\n return null;\n }\n}\n\nexport {\n ExpertEncoding,\n getEncoding,\n MacRomanEncoding,\n StandardEncoding,\n SymbolSetEncoding,\n WinAnsiEncoding,\n ZapfDingbatsEncoding,\n};\n","/* Copyright 2016 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n bytesToString,\n FormatError,\n info,\n shadow,\n stringToBytes,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport {\n ExpertCharset,\n ExpertSubsetCharset,\n ISOAdobeCharset,\n} from \"./charsets.js\";\nimport { ExpertEncoding, StandardEncoding } from \"./encodings.js\";\n\n// Maximum subroutine call depth of type 2 charstrings. Matches OTS.\nconst MAX_SUBR_NESTING = 10;\n\n/**\n * The CFF class takes a Type1 file and wrap it into a\n * 'Compact Font Format' which itself embed Type2 charstrings.\n */\n// prettier-ignore\nconst CFFStandardStrings = [\n \".notdef\", \"space\", \"exclam\", \"quotedbl\", \"numbersign\", \"dollar\", \"percent\",\n \"ampersand\", \"quoteright\", \"parenleft\", \"parenright\", \"asterisk\", \"plus\",\n \"comma\", \"hyphen\", \"period\", \"slash\", \"zero\", \"one\", \"two\", \"three\", \"four\",\n \"five\", \"six\", \"seven\", \"eight\", \"nine\", \"colon\", \"semicolon\", \"less\",\n \"equal\", \"greater\", \"question\", \"at\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\",\n \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\", \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\",\n \"X\", \"Y\", \"Z\", \"bracketleft\", \"backslash\", \"bracketright\", \"asciicircum\",\n \"underscore\", \"quoteleft\", \"a\", \"b\", \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\",\n \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\", \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\",\n \"z\", \"braceleft\", \"bar\", \"braceright\", \"asciitilde\", \"exclamdown\", \"cent\",\n \"sterling\", \"fraction\", \"yen\", \"florin\", \"section\", \"currency\",\n \"quotesingle\", \"quotedblleft\", \"guillemotleft\", \"guilsinglleft\",\n \"guilsinglright\", \"fi\", \"fl\", \"endash\", \"dagger\", \"daggerdbl\",\n \"periodcentered\", \"paragraph\", \"bullet\", \"quotesinglbase\", \"quotedblbase\",\n \"quotedblright\", \"guillemotright\", \"ellipsis\", \"perthousand\", \"questiondown\",\n \"grave\", \"acute\", \"circumflex\", \"tilde\", \"macron\", \"breve\", \"dotaccent\",\n \"dieresis\", \"ring\", \"cedilla\", \"hungarumlaut\", \"ogonek\", \"caron\", \"emdash\",\n \"AE\", \"ordfeminine\", \"Lslash\", \"Oslash\", \"OE\", \"ordmasculine\", \"ae\",\n \"dotlessi\", \"lslash\", \"oslash\", \"oe\", \"germandbls\", \"onesuperior\",\n \"logicalnot\", \"mu\", \"trademark\", \"Eth\", \"onehalf\", \"plusminus\", \"Thorn\",\n \"onequarter\", \"divide\", \"brokenbar\", \"degree\", \"thorn\", \"threequarters\",\n \"twosuperior\", \"registered\", \"minus\", \"eth\", \"multiply\", \"threesuperior\",\n \"copyright\", \"Aacute\", \"Acircumflex\", \"Adieresis\", \"Agrave\", \"Aring\",\n \"Atilde\", \"Ccedilla\", \"Eacute\", \"Ecircumflex\", \"Edieresis\", \"Egrave\",\n \"Iacute\", \"Icircumflex\", \"Idieresis\", \"Igrave\", \"Ntilde\", \"Oacute\",\n \"Ocircumflex\", \"Odieresis\", \"Ograve\", \"Otilde\", \"Scaron\", \"Uacute\",\n \"Ucircumflex\", \"Udieresis\", \"Ugrave\", \"Yacute\", \"Ydieresis\", \"Zcaron\",\n \"aacute\", \"acircumflex\", \"adieresis\", \"agrave\", \"aring\", \"atilde\",\n \"ccedilla\", \"eacute\", \"ecircumflex\", \"edieresis\", \"egrave\", \"iacute\",\n \"icircumflex\", \"idieresis\", \"igrave\", \"ntilde\", \"oacute\", \"ocircumflex\",\n \"odieresis\", \"ograve\", \"otilde\", \"scaron\", \"uacute\", \"ucircumflex\",\n \"udieresis\", \"ugrave\", \"yacute\", \"ydieresis\", \"zcaron\", \"exclamsmall\",\n \"Hungarumlautsmall\", \"dollaroldstyle\", \"dollarsuperior\", \"ampersandsmall\",\n \"Acutesmall\", \"parenleftsuperior\", \"parenrightsuperior\", \"twodotenleader\",\n \"onedotenleader\", \"zerooldstyle\", \"oneoldstyle\", \"twooldstyle\",\n \"threeoldstyle\", \"fouroldstyle\", \"fiveoldstyle\", \"sixoldstyle\",\n \"sevenoldstyle\", \"eightoldstyle\", \"nineoldstyle\", \"commasuperior\",\n \"threequartersemdash\", \"periodsuperior\", \"questionsmall\", \"asuperior\",\n \"bsuperior\", \"centsuperior\", \"dsuperior\", \"esuperior\", \"isuperior\",\n \"lsuperior\", \"msuperior\", \"nsuperior\", \"osuperior\", \"rsuperior\", \"ssuperior\",\n \"tsuperior\", \"ff\", \"ffi\", \"ffl\", \"parenleftinferior\", \"parenrightinferior\",\n \"Circumflexsmall\", \"hyphensuperior\", \"Gravesmall\", \"Asmall\", \"Bsmall\",\n \"Csmall\", \"Dsmall\", \"Esmall\", \"Fsmall\", \"Gsmall\", \"Hsmall\", \"Ismall\",\n \"Jsmall\", \"Ksmall\", \"Lsmall\", \"Msmall\", \"Nsmall\", \"Osmall\", \"Psmall\",\n \"Qsmall\", \"Rsmall\", \"Ssmall\", \"Tsmall\", \"Usmall\", \"Vsmall\", \"Wsmall\",\n \"Xsmall\", \"Ysmall\", \"Zsmall\", \"colonmonetary\", \"onefitted\", \"rupiah\",\n \"Tildesmall\", \"exclamdownsmall\", \"centoldstyle\", \"Lslashsmall\",\n \"Scaronsmall\", \"Zcaronsmall\", \"Dieresissmall\", \"Brevesmall\", \"Caronsmall\",\n \"Dotaccentsmall\", \"Macronsmall\", \"figuredash\", \"hypheninferior\",\n \"Ogoneksmall\", \"Ringsmall\", \"Cedillasmall\", \"questiondownsmall\", \"oneeighth\",\n \"threeeighths\", \"fiveeighths\", \"seveneighths\", \"onethird\", \"twothirds\",\n \"zerosuperior\", \"foursuperior\", \"fivesuperior\", \"sixsuperior\",\n \"sevensuperior\", \"eightsuperior\", \"ninesuperior\", \"zeroinferior\",\n \"oneinferior\", \"twoinferior\", \"threeinferior\", \"fourinferior\",\n \"fiveinferior\", \"sixinferior\", \"seveninferior\", \"eightinferior\",\n \"nineinferior\", \"centinferior\", \"dollarinferior\", \"periodinferior\",\n \"commainferior\", \"Agravesmall\", \"Aacutesmall\", \"Acircumflexsmall\",\n \"Atildesmall\", \"Adieresissmall\", \"Aringsmall\", \"AEsmall\", \"Ccedillasmall\",\n \"Egravesmall\", \"Eacutesmall\", \"Ecircumflexsmall\", \"Edieresissmall\",\n \"Igravesmall\", \"Iacutesmall\", \"Icircumflexsmall\", \"Idieresissmall\",\n \"Ethsmall\", \"Ntildesmall\", \"Ogravesmall\", \"Oacutesmall\", \"Ocircumflexsmall\",\n \"Otildesmall\", \"Odieresissmall\", \"OEsmall\", \"Oslashsmall\", \"Ugravesmall\",\n \"Uacutesmall\", \"Ucircumflexsmall\", \"Udieresissmall\", \"Yacutesmall\",\n \"Thornsmall\", \"Ydieresissmall\", \"001.000\", \"001.001\", \"001.002\", \"001.003\",\n \"Black\", \"Bold\", \"Book\", \"Light\", \"Medium\", \"Regular\", \"Roman\", \"Semibold\"\n];\n\nconst NUM_STANDARD_CFF_STRINGS = 391;\n\nconst CharstringValidationData = [\n /* 0 */ null,\n /* 1 */ { id: \"hstem\", min: 2, stackClearing: true, stem: true },\n /* 2 */ null,\n /* 3 */ { id: \"vstem\", min: 2, stackClearing: true, stem: true },\n /* 4 */ { id: \"vmoveto\", min: 1, stackClearing: true },\n /* 5 */ { id: \"rlineto\", min: 2, resetStack: true },\n /* 6 */ { id: \"hlineto\", min: 1, resetStack: true },\n /* 7 */ { id: \"vlineto\", min: 1, resetStack: true },\n /* 8 */ { id: \"rrcurveto\", min: 6, resetStack: true },\n /* 9 */ null,\n /* 10 */ { id: \"callsubr\", min: 1, undefStack: true },\n /* 11 */ { id: \"return\", min: 0, undefStack: true },\n /* 12 */ null,\n /* 13 */ null,\n /* 14 */ { id: \"endchar\", min: 0, stackClearing: true },\n /* 15 */ null,\n /* 16 */ null,\n /* 17 */ null,\n /* 18 */ { id: \"hstemhm\", min: 2, stackClearing: true, stem: true },\n /* 19 */ { id: \"hintmask\", min: 0, stackClearing: true },\n /* 20 */ { id: \"cntrmask\", min: 0, stackClearing: true },\n /* 21 */ { id: \"rmoveto\", min: 2, stackClearing: true },\n /* 22 */ { id: \"hmoveto\", min: 1, stackClearing: true },\n /* 23 */ { id: \"vstemhm\", min: 2, stackClearing: true, stem: true },\n /* 24 */ { id: \"rcurveline\", min: 8, resetStack: true },\n /* 25 */ { id: \"rlinecurve\", min: 8, resetStack: true },\n /* 26 */ { id: \"vvcurveto\", min: 4, resetStack: true },\n /* 27 */ { id: \"hhcurveto\", min: 4, resetStack: true },\n /* 28 */ null, // shortint\n /* 29 */ { id: \"callgsubr\", min: 1, undefStack: true },\n /* 30 */ { id: \"vhcurveto\", min: 4, resetStack: true },\n /* 31 */ { id: \"hvcurveto\", min: 4, resetStack: true },\n];\n\nconst CharstringValidationData12 = [\n null,\n null,\n null,\n { id: \"and\", min: 2, stackDelta: -1 },\n { id: \"or\", min: 2, stackDelta: -1 },\n { id: \"not\", min: 1, stackDelta: 0 },\n null,\n null,\n null,\n { id: \"abs\", min: 1, stackDelta: 0 },\n {\n id: \"add\",\n min: 2,\n stackDelta: -1,\n stackFn(stack, index) {\n stack[index - 2] = stack[index - 2] + stack[index - 1];\n },\n },\n {\n id: \"sub\",\n min: 2,\n stackDelta: -1,\n stackFn(stack, index) {\n stack[index - 2] = stack[index - 2] - stack[index - 1];\n },\n },\n {\n id: \"div\",\n min: 2,\n stackDelta: -1,\n stackFn(stack, index) {\n stack[index - 2] = stack[index - 2] / stack[index - 1];\n },\n },\n null,\n {\n id: \"neg\",\n min: 1,\n stackDelta: 0,\n stackFn(stack, index) {\n stack[index - 1] = -stack[index - 1];\n },\n },\n { id: \"eq\", min: 2, stackDelta: -1 },\n null,\n null,\n { id: \"drop\", min: 1, stackDelta: -1 },\n null,\n { id: \"put\", min: 2, stackDelta: -2 },\n { id: \"get\", min: 1, stackDelta: 0 },\n { id: \"ifelse\", min: 4, stackDelta: -3 },\n { id: \"random\", min: 0, stackDelta: 1 },\n {\n id: \"mul\",\n min: 2,\n stackDelta: -1,\n stackFn(stack, index) {\n stack[index - 2] = stack[index - 2] * stack[index - 1];\n },\n },\n null,\n { id: \"sqrt\", min: 1, stackDelta: 0 },\n { id: \"dup\", min: 1, stackDelta: 1 },\n { id: \"exch\", min: 2, stackDelta: 0 },\n { id: \"index\", min: 2, stackDelta: 0 },\n { id: \"roll\", min: 3, stackDelta: -2 },\n null,\n null,\n null,\n { id: \"hflex\", min: 7, resetStack: true },\n { id: \"flex\", min: 13, resetStack: true },\n { id: \"hflex1\", min: 9, resetStack: true },\n { id: \"flex1\", min: 11, resetStack: true },\n];\n\nclass CFFParser {\n constructor(file, properties, seacAnalysisEnabled) {\n this.bytes = file.getBytes();\n this.properties = properties;\n this.seacAnalysisEnabled = !!seacAnalysisEnabled;\n }\n\n parse() {\n const properties = this.properties;\n const cff = new CFF();\n this.cff = cff;\n\n // The first five sections must be in order, all the others are reached\n // via offsets contained in one of the below.\n const header = this.parseHeader();\n const nameIndex = this.parseIndex(header.endPos);\n const topDictIndex = this.parseIndex(nameIndex.endPos);\n const stringIndex = this.parseIndex(topDictIndex.endPos);\n const globalSubrIndex = this.parseIndex(stringIndex.endPos);\n\n const topDictParsed = this.parseDict(topDictIndex.obj.get(0));\n const topDict = this.createDict(CFFTopDict, topDictParsed, cff.strings);\n\n cff.header = header.obj;\n cff.names = this.parseNameIndex(nameIndex.obj);\n cff.strings = this.parseStringIndex(stringIndex.obj);\n cff.topDict = topDict;\n cff.globalSubrIndex = globalSubrIndex.obj;\n\n this.parsePrivateDict(cff.topDict);\n\n cff.isCIDFont = topDict.hasName(\"ROS\");\n\n const charStringOffset = topDict.getByName(\"CharStrings\");\n const charStringIndex = this.parseIndex(charStringOffset).obj;\n\n const fontMatrix = topDict.getByName(\"FontMatrix\");\n if (fontMatrix) {\n properties.fontMatrix = fontMatrix;\n }\n\n const fontBBox = topDict.getByName(\"FontBBox\");\n if (fontBBox) {\n // adjusting ascent/descent\n properties.ascent = Math.max(fontBBox[3], fontBBox[1]);\n properties.descent = Math.min(fontBBox[1], fontBBox[3]);\n properties.ascentScaled = true;\n }\n\n let charset, encoding;\n if (cff.isCIDFont) {\n const fdArrayIndex = this.parseIndex(topDict.getByName(\"FDArray\")).obj;\n for (let i = 0, ii = fdArrayIndex.count; i < ii; ++i) {\n const dictRaw = fdArrayIndex.get(i);\n const fontDict = this.createDict(\n CFFTopDict,\n this.parseDict(dictRaw),\n cff.strings\n );\n this.parsePrivateDict(fontDict);\n cff.fdArray.push(fontDict);\n }\n // cid fonts don't have an encoding\n encoding = null;\n charset = this.parseCharsets(\n topDict.getByName(\"charset\"),\n charStringIndex.count,\n cff.strings,\n true\n );\n cff.fdSelect = this.parseFDSelect(\n topDict.getByName(\"FDSelect\"),\n charStringIndex.count\n );\n } else {\n charset = this.parseCharsets(\n topDict.getByName(\"charset\"),\n charStringIndex.count,\n cff.strings,\n false\n );\n encoding = this.parseEncoding(\n topDict.getByName(\"Encoding\"),\n properties,\n cff.strings,\n charset.charset\n );\n }\n\n cff.charset = charset;\n cff.encoding = encoding;\n\n const charStringsAndSeacs = this.parseCharStrings({\n charStrings: charStringIndex,\n localSubrIndex: topDict.privateDict.subrsIndex,\n globalSubrIndex: globalSubrIndex.obj,\n fdSelect: cff.fdSelect,\n fdArray: cff.fdArray,\n privateDict: topDict.privateDict,\n });\n cff.charStrings = charStringsAndSeacs.charStrings;\n cff.seacs = charStringsAndSeacs.seacs;\n cff.widths = charStringsAndSeacs.widths;\n\n return cff;\n }\n\n parseHeader() {\n let bytes = this.bytes;\n const bytesLength = bytes.length;\n let offset = 0;\n\n // Prevent an infinite loop, by checking that the offset is within the\n // bounds of the bytes array. Necessary in empty, or invalid, font files.\n while (offset < bytesLength && bytes[offset] !== 1) {\n ++offset;\n }\n if (offset >= bytesLength) {\n throw new FormatError(\"Invalid CFF header\");\n }\n if (offset !== 0) {\n info(\"cff data is shifted\");\n bytes = bytes.subarray(offset);\n this.bytes = bytes;\n }\n const major = bytes[0];\n const minor = bytes[1];\n const hdrSize = bytes[2];\n const offSize = bytes[3];\n const header = new CFFHeader(major, minor, hdrSize, offSize);\n return { obj: header, endPos: hdrSize };\n }\n\n parseDict(dict) {\n let pos = 0;\n\n function parseOperand() {\n let value = dict[pos++];\n if (value === 30) {\n return parseFloatOperand();\n } else if (value === 28) {\n value = dict[pos++];\n value = ((value << 24) | (dict[pos++] << 16)) >> 16;\n return value;\n } else if (value === 29) {\n value = dict[pos++];\n value = (value << 8) | dict[pos++];\n value = (value << 8) | dict[pos++];\n value = (value << 8) | dict[pos++];\n return value;\n } else if (value >= 32 && value <= 246) {\n return value - 139;\n } else if (value >= 247 && value <= 250) {\n return (value - 247) * 256 + dict[pos++] + 108;\n } else if (value >= 251 && value <= 254) {\n return -((value - 251) * 256) - dict[pos++] - 108;\n }\n warn('CFFParser_parseDict: \"' + value + '\" is a reserved command.');\n return NaN;\n }\n\n function parseFloatOperand() {\n let str = \"\";\n const eof = 15;\n // prettier-ignore\n const lookup = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\",\n \"9\", \".\", \"E\", \"E-\", null, \"-\"];\n const length = dict.length;\n while (pos < length) {\n const b = dict[pos++];\n const b1 = b >> 4;\n const b2 = b & 15;\n\n if (b1 === eof) {\n break;\n }\n str += lookup[b1];\n\n if (b2 === eof) {\n break;\n }\n str += lookup[b2];\n }\n return parseFloat(str);\n }\n\n let operands = [];\n const entries = [];\n\n pos = 0;\n const end = dict.length;\n while (pos < end) {\n let b = dict[pos];\n if (b <= 21) {\n if (b === 12) {\n b = (b << 8) | dict[++pos];\n }\n entries.push([b, operands]);\n operands = [];\n ++pos;\n } else {\n operands.push(parseOperand());\n }\n }\n return entries;\n }\n\n parseIndex(pos) {\n const cffIndex = new CFFIndex();\n const bytes = this.bytes;\n const count = (bytes[pos++] << 8) | bytes[pos++];\n const offsets = [];\n let end = pos;\n let i, ii;\n\n if (count !== 0) {\n const offsetSize = bytes[pos++];\n // add 1 for offset to determine size of last object\n const startPos = pos + (count + 1) * offsetSize - 1;\n\n for (i = 0, ii = count + 1; i < ii; ++i) {\n let offset = 0;\n for (let j = 0; j < offsetSize; ++j) {\n offset <<= 8;\n offset += bytes[pos++];\n }\n offsets.push(startPos + offset);\n }\n end = offsets[count];\n }\n for (i = 0, ii = offsets.length - 1; i < ii; ++i) {\n const offsetStart = offsets[i];\n const offsetEnd = offsets[i + 1];\n cffIndex.add(bytes.subarray(offsetStart, offsetEnd));\n }\n return { obj: cffIndex, endPos: end };\n }\n\n parseNameIndex(index) {\n const names = [];\n for (let i = 0, ii = index.count; i < ii; ++i) {\n const name = index.get(i);\n names.push(bytesToString(name));\n }\n return names;\n }\n\n parseStringIndex(index) {\n const strings = new CFFStrings();\n for (let i = 0, ii = index.count; i < ii; ++i) {\n const data = index.get(i);\n strings.add(bytesToString(data));\n }\n return strings;\n }\n\n createDict(Type, dict, strings) {\n const cffDict = new Type(strings);\n for (const [key, value] of dict) {\n cffDict.setByKey(key, value);\n }\n return cffDict;\n }\n\n parseCharString(state, data, localSubrIndex, globalSubrIndex) {\n if (!data || state.callDepth > MAX_SUBR_NESTING) {\n return false;\n }\n let stackSize = state.stackSize;\n const stack = state.stack;\n\n let length = data.length;\n\n for (let j = 0; j < length; ) {\n const value = data[j++];\n let validationCommand = null;\n if (value === 12) {\n const q = data[j++];\n if (q === 0) {\n // The CFF specification state that the 'dotsection' command\n // (12, 0) is deprecated and treated as a no-op, but all Type2\n // charstrings processors should support them. Unfortunately\n // the font sanitizer don't. As a workaround the sequence (12, 0)\n // is replaced by a useless (0, hmoveto).\n data[j - 2] = 139;\n data[j - 1] = 22;\n stackSize = 0;\n } else {\n validationCommand = CharstringValidationData12[q];\n }\n } else if (value === 28) {\n // number (16 bit)\n stack[stackSize] = ((data[j] << 24) | (data[j + 1] << 16)) >> 16;\n j += 2;\n stackSize++;\n } else if (value === 14) {\n if (stackSize >= 4) {\n stackSize -= 4;\n if (this.seacAnalysisEnabled) {\n state.seac = stack.slice(stackSize, stackSize + 4);\n return false;\n }\n }\n validationCommand = CharstringValidationData[value];\n } else if (value >= 32 && value <= 246) {\n // number\n stack[stackSize] = value - 139;\n stackSize++;\n } else if (value >= 247 && value <= 254) {\n // number (+1 bytes)\n stack[stackSize] =\n value < 251\n ? ((value - 247) << 8) + data[j] + 108\n : -((value - 251) << 8) - data[j] - 108;\n j++;\n stackSize++;\n } else if (value === 255) {\n // number (32 bit)\n stack[stackSize] =\n ((data[j] << 24) |\n (data[j + 1] << 16) |\n (data[j + 2] << 8) |\n data[j + 3]) /\n 65536;\n j += 4;\n stackSize++;\n } else if (value === 19 || value === 20) {\n state.hints += stackSize >> 1;\n if (state.hints === 0) {\n // Not a valid value (see bug 1529502): just remove it.\n data.copyWithin(j - 1, j, -1);\n j -= 1;\n length -= 1;\n continue;\n }\n // skipping right amount of hints flag data\n j += (state.hints + 7) >> 3;\n stackSize %= 2;\n validationCommand = CharstringValidationData[value];\n } else if (value === 10 || value === 29) {\n const subrsIndex = value === 10 ? localSubrIndex : globalSubrIndex;\n if (!subrsIndex) {\n validationCommand = CharstringValidationData[value];\n warn(\"Missing subrsIndex for \" + validationCommand.id);\n return false;\n }\n let bias = 32768;\n if (subrsIndex.count < 1240) {\n bias = 107;\n } else if (subrsIndex.count < 33900) {\n bias = 1131;\n }\n const subrNumber = stack[--stackSize] + bias;\n if (\n subrNumber < 0 ||\n subrNumber >= subrsIndex.count ||\n isNaN(subrNumber)\n ) {\n validationCommand = CharstringValidationData[value];\n warn(\"Out of bounds subrIndex for \" + validationCommand.id);\n return false;\n }\n state.stackSize = stackSize;\n state.callDepth++;\n const valid = this.parseCharString(\n state,\n subrsIndex.get(subrNumber),\n localSubrIndex,\n globalSubrIndex\n );\n if (!valid) {\n return false;\n }\n state.callDepth--;\n stackSize = state.stackSize;\n continue;\n } else if (value === 11) {\n state.stackSize = stackSize;\n return true;\n } else if (value === 0 && j === data.length) {\n // Operator 0 is not used according to the current spec and\n // it's the last char and consequently it's likely a terminator.\n // So just replace it by endchar command to make OTS happy.\n data[j - 1] = 14;\n validationCommand = CharstringValidationData[14];\n } else if (value === 9) {\n // Not a valid value.\n data.copyWithin(j - 1, j, -1);\n j -= 1;\n length -= 1;\n continue;\n } else {\n validationCommand = CharstringValidationData[value];\n }\n if (validationCommand) {\n if (validationCommand.stem) {\n state.hints += stackSize >> 1;\n if (value === 3 || value === 23) {\n // vstem or vstemhm.\n state.hasVStems = true;\n } else if (state.hasVStems && (value === 1 || value === 18)) {\n // Some browsers don't draw glyphs that specify vstems before\n // hstems. As a workaround, replace hstem (1) and hstemhm (18)\n // with a pointless vstem (3) or vstemhm (23).\n warn(\"CFF stem hints are in wrong order\");\n data[j - 1] = value === 1 ? 3 : 23;\n }\n }\n if (\"min\" in validationCommand) {\n if (!state.undefStack && stackSize < validationCommand.min) {\n warn(\n \"Not enough parameters for \" +\n validationCommand.id +\n \"; actual: \" +\n stackSize +\n \", expected: \" +\n validationCommand.min\n );\n\n if (stackSize === 0) {\n // Just \"fix\" the outline in replacing command by a endchar:\n // it could lead to wrong rendering of some glyphs or not.\n // For example, the pdf in #6132 is well-rendered.\n data[j - 1] = 14;\n return true;\n }\n return false;\n }\n }\n if (state.firstStackClearing && validationCommand.stackClearing) {\n state.firstStackClearing = false;\n // the optional character width can be found before the first\n // stack-clearing command arguments\n stackSize -= validationCommand.min;\n if (stackSize >= 2 && validationCommand.stem) {\n // there are even amount of arguments for stem commands\n stackSize %= 2;\n } else if (stackSize > 1) {\n warn(\"Found too many parameters for stack-clearing command\");\n }\n if (stackSize > 0) {\n // Width can be any number since its the difference\n // from nominalWidthX.\n state.width = stack[stackSize - 1];\n }\n }\n if (\"stackDelta\" in validationCommand) {\n if (\"stackFn\" in validationCommand) {\n validationCommand.stackFn(stack, stackSize);\n }\n stackSize += validationCommand.stackDelta;\n } else if (validationCommand.stackClearing) {\n stackSize = 0;\n } else if (validationCommand.resetStack) {\n stackSize = 0;\n state.undefStack = false;\n } else if (validationCommand.undefStack) {\n stackSize = 0;\n state.undefStack = true;\n state.firstStackClearing = false;\n }\n }\n }\n if (length < data.length) {\n data.fill(/* endchar = */ 14, length);\n }\n state.stackSize = stackSize;\n return true;\n }\n\n parseCharStrings({\n charStrings,\n localSubrIndex,\n globalSubrIndex,\n fdSelect,\n fdArray,\n privateDict,\n }) {\n const seacs = [];\n const widths = [];\n const count = charStrings.count;\n for (let i = 0; i < count; i++) {\n const charstring = charStrings.get(i);\n const state = {\n callDepth: 0,\n stackSize: 0,\n stack: [],\n undefStack: true,\n hints: 0,\n firstStackClearing: true,\n seac: null,\n width: null,\n hasVStems: false,\n };\n let valid = true;\n let localSubrToUse = null;\n let privateDictToUse = privateDict;\n if (fdSelect && fdArray.length) {\n const fdIndex = fdSelect.getFDIndex(i);\n if (fdIndex === -1) {\n warn(\"Glyph index is not in fd select.\");\n valid = false;\n }\n if (fdIndex >= fdArray.length) {\n warn(\"Invalid fd index for glyph index.\");\n valid = false;\n }\n if (valid) {\n privateDictToUse = fdArray[fdIndex].privateDict;\n localSubrToUse = privateDictToUse.subrsIndex;\n }\n } else if (localSubrIndex) {\n localSubrToUse = localSubrIndex;\n }\n if (valid) {\n valid = this.parseCharString(\n state,\n charstring,\n localSubrToUse,\n globalSubrIndex\n );\n }\n if (state.width !== null) {\n const nominalWidth = privateDictToUse.getByName(\"nominalWidthX\");\n widths[i] = nominalWidth + state.width;\n } else {\n const defaultWidth = privateDictToUse.getByName(\"defaultWidthX\");\n widths[i] = defaultWidth;\n }\n if (state.seac !== null) {\n seacs[i] = state.seac;\n }\n if (!valid) {\n // resetting invalid charstring to single 'endchar'\n charStrings.set(i, new Uint8Array([14]));\n }\n }\n return { charStrings, seacs, widths };\n }\n\n emptyPrivateDictionary(parentDict) {\n const privateDict = this.createDict(CFFPrivateDict, [], parentDict.strings);\n parentDict.setByKey(18, [0, 0]);\n parentDict.privateDict = privateDict;\n }\n\n parsePrivateDict(parentDict) {\n // no private dict, do nothing\n if (!parentDict.hasName(\"Private\")) {\n this.emptyPrivateDictionary(parentDict);\n return;\n }\n const privateOffset = parentDict.getByName(\"Private\");\n // make sure the params are formatted correctly\n if (!Array.isArray(privateOffset) || privateOffset.length !== 2) {\n parentDict.removeByName(\"Private\");\n return;\n }\n const size = privateOffset[0];\n const offset = privateOffset[1];\n // remove empty dicts or ones that refer to invalid location\n if (size === 0 || offset >= this.bytes.length) {\n this.emptyPrivateDictionary(parentDict);\n return;\n }\n\n const privateDictEnd = offset + size;\n const dictData = this.bytes.subarray(offset, privateDictEnd);\n const dict = this.parseDict(dictData);\n const privateDict = this.createDict(\n CFFPrivateDict,\n dict,\n parentDict.strings\n );\n parentDict.privateDict = privateDict;\n\n if (privateDict.getByName(\"ExpansionFactor\") === 0) {\n // Firefox doesn't render correctly such a font on Windows (see issue\n // 15289), hence we just reset it to its default value.\n privateDict.setByName(\"ExpansionFactor\", 0.06);\n }\n\n // Parse the Subrs index also since it's relative to the private dict.\n if (!privateDict.getByName(\"Subrs\")) {\n return;\n }\n const subrsOffset = privateDict.getByName(\"Subrs\");\n const relativeOffset = offset + subrsOffset;\n // Validate the offset.\n if (subrsOffset === 0 || relativeOffset >= this.bytes.length) {\n this.emptyPrivateDictionary(parentDict);\n return;\n }\n const subrsIndex = this.parseIndex(relativeOffset);\n privateDict.subrsIndex = subrsIndex.obj;\n }\n\n parseCharsets(pos, length, strings, cid) {\n if (pos === 0) {\n return new CFFCharset(\n true,\n CFFCharsetPredefinedTypes.ISO_ADOBE,\n ISOAdobeCharset\n );\n } else if (pos === 1) {\n return new CFFCharset(\n true,\n CFFCharsetPredefinedTypes.EXPERT,\n ExpertCharset\n );\n } else if (pos === 2) {\n return new CFFCharset(\n true,\n CFFCharsetPredefinedTypes.EXPERT_SUBSET,\n ExpertSubsetCharset\n );\n }\n\n const bytes = this.bytes;\n const start = pos;\n const format = bytes[pos++];\n const charset = [cid ? 0 : \".notdef\"];\n let id, count, i;\n\n // subtract 1 for the .notdef glyph\n length -= 1;\n\n switch (format) {\n case 0:\n for (i = 0; i < length; i++) {\n id = (bytes[pos++] << 8) | bytes[pos++];\n charset.push(cid ? id : strings.get(id));\n }\n break;\n case 1:\n while (charset.length <= length) {\n id = (bytes[pos++] << 8) | bytes[pos++];\n count = bytes[pos++];\n for (i = 0; i <= count; i++) {\n charset.push(cid ? id++ : strings.get(id++));\n }\n }\n break;\n case 2:\n while (charset.length <= length) {\n id = (bytes[pos++] << 8) | bytes[pos++];\n count = (bytes[pos++] << 8) | bytes[pos++];\n for (i = 0; i <= count; i++) {\n charset.push(cid ? id++ : strings.get(id++));\n }\n }\n break;\n default:\n throw new FormatError(\"Unknown charset format\");\n }\n // Raw won't be needed if we actually compile the charset.\n const end = pos;\n const raw = bytes.subarray(start, end);\n\n return new CFFCharset(false, format, charset, raw);\n }\n\n parseEncoding(pos, properties, strings, charset) {\n const encoding = Object.create(null);\n const bytes = this.bytes;\n let predefined = false;\n let format, i, ii;\n let raw = null;\n\n function readSupplement() {\n const supplementsCount = bytes[pos++];\n for (i = 0; i < supplementsCount; i++) {\n const code = bytes[pos++];\n const sid = (bytes[pos++] << 8) + (bytes[pos++] & 0xff);\n encoding[code] = charset.indexOf(strings.get(sid));\n }\n }\n\n if (pos === 0 || pos === 1) {\n predefined = true;\n format = pos;\n const baseEncoding = pos ? ExpertEncoding : StandardEncoding;\n for (i = 0, ii = charset.length; i < ii; i++) {\n const index = baseEncoding.indexOf(charset[i]);\n if (index !== -1) {\n encoding[index] = i;\n }\n }\n } else {\n const dataStart = pos;\n format = bytes[pos++];\n switch (format & 0x7f) {\n case 0:\n const glyphsCount = bytes[pos++];\n for (i = 1; i <= glyphsCount; i++) {\n encoding[bytes[pos++]] = i;\n }\n break;\n\n case 1:\n const rangesCount = bytes[pos++];\n let gid = 1;\n for (i = 0; i < rangesCount; i++) {\n const start = bytes[pos++];\n const left = bytes[pos++];\n for (let j = start; j <= start + left; j++) {\n encoding[j] = gid++;\n }\n }\n break;\n\n default:\n throw new FormatError(`Unknown encoding format: ${format} in CFF`);\n }\n const dataEnd = pos;\n if (format & 0x80) {\n // hasSupplement\n // The font sanitizer does not support CFF encoding with a\n // supplement, since the encoding is not really used to map\n // between gid to glyph, let's overwrite what is declared in\n // the top dictionary to let the sanitizer think the font use\n // StandardEncoding, that's a lie but that's ok.\n bytes[dataStart] &= 0x7f;\n readSupplement();\n }\n raw = bytes.subarray(dataStart, dataEnd);\n }\n format &= 0x7f;\n return new CFFEncoding(predefined, format, encoding, raw);\n }\n\n parseFDSelect(pos, length) {\n const bytes = this.bytes;\n const format = bytes[pos++];\n const fdSelect = [];\n let i;\n\n switch (format) {\n case 0:\n for (i = 0; i < length; ++i) {\n const id = bytes[pos++];\n fdSelect.push(id);\n }\n break;\n case 3:\n const rangesCount = (bytes[pos++] << 8) | bytes[pos++];\n for (i = 0; i < rangesCount; ++i) {\n let first = (bytes[pos++] << 8) | bytes[pos++];\n if (i === 0 && first !== 0) {\n warn(\n \"parseFDSelect: The first range must have a first GID of 0\" +\n \" -- trying to recover.\"\n );\n first = 0;\n }\n const fdIndex = bytes[pos++];\n const next = (bytes[pos] << 8) | bytes[pos + 1];\n for (let j = first; j < next; ++j) {\n fdSelect.push(fdIndex);\n }\n }\n // Advance past the sentinel(next).\n pos += 2;\n break;\n default:\n throw new FormatError(`parseFDSelect: Unknown format \"${format}\".`);\n }\n if (fdSelect.length !== length) {\n throw new FormatError(\"parseFDSelect: Invalid font data.\");\n }\n\n return new CFFFDSelect(format, fdSelect);\n }\n}\n\n// Compact Font Format\nclass CFF {\n constructor() {\n this.header = null;\n this.names = [];\n this.topDict = null;\n this.strings = new CFFStrings();\n this.globalSubrIndex = null;\n\n // The following could really be per font, but since we only have one font\n // store them here.\n this.encoding = null;\n this.charset = null;\n this.charStrings = null;\n this.fdArray = [];\n this.fdSelect = null;\n\n this.isCIDFont = false;\n }\n\n duplicateFirstGlyph() {\n // Browsers will not display a glyph at position 0. Typically glyph 0 is\n // notdef, but a number of fonts put a valid glyph there so it must be\n // duplicated and appended.\n if (this.charStrings.count >= 65535) {\n warn(\"Not enough space in charstrings to duplicate first glyph.\");\n return;\n }\n const glyphZero = this.charStrings.get(0);\n this.charStrings.add(glyphZero);\n if (this.isCIDFont) {\n this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0]);\n }\n }\n\n hasGlyphId(id) {\n if (id < 0 || id >= this.charStrings.count) {\n return false;\n }\n const glyph = this.charStrings.get(id);\n return glyph.length > 0;\n }\n}\n\nclass CFFHeader {\n constructor(major, minor, hdrSize, offSize) {\n this.major = major;\n this.minor = minor;\n this.hdrSize = hdrSize;\n this.offSize = offSize;\n }\n}\n\nclass CFFStrings {\n constructor() {\n this.strings = [];\n }\n\n get(index) {\n if (index >= 0 && index <= NUM_STANDARD_CFF_STRINGS - 1) {\n return CFFStandardStrings[index];\n }\n if (index - NUM_STANDARD_CFF_STRINGS <= this.strings.length) {\n return this.strings[index - NUM_STANDARD_CFF_STRINGS];\n }\n return CFFStandardStrings[0];\n }\n\n getSID(str) {\n let index = CFFStandardStrings.indexOf(str);\n if (index !== -1) {\n return index;\n }\n index = this.strings.indexOf(str);\n if (index !== -1) {\n return index + NUM_STANDARD_CFF_STRINGS;\n }\n return -1;\n }\n\n add(value) {\n this.strings.push(value);\n }\n\n get count() {\n return this.strings.length;\n }\n}\n\nclass CFFIndex {\n constructor() {\n this.objects = [];\n this.length = 0;\n }\n\n add(data) {\n this.length += data.length;\n this.objects.push(data);\n }\n\n set(index, data) {\n this.length += data.length - this.objects[index].length;\n this.objects[index] = data;\n }\n\n get(index) {\n return this.objects[index];\n }\n\n get count() {\n return this.objects.length;\n }\n}\n\nclass CFFDict {\n constructor(tables, strings) {\n this.keyToNameMap = tables.keyToNameMap;\n this.nameToKeyMap = tables.nameToKeyMap;\n this.defaults = tables.defaults;\n this.types = tables.types;\n this.opcodes = tables.opcodes;\n this.order = tables.order;\n this.strings = strings;\n this.values = Object.create(null);\n }\n\n // value should always be an array\n setByKey(key, value) {\n if (!(key in this.keyToNameMap)) {\n return false;\n }\n // ignore empty values\n if (value.length === 0) {\n return true;\n }\n // Ignore invalid values (fixes bug1068432.pdf and bug1308536.pdf).\n for (const val of value) {\n if (isNaN(val)) {\n warn(`Invalid CFFDict value: \"${value}\" for key \"${key}\".`);\n return true;\n }\n }\n const type = this.types[key];\n // remove the array wrapping these types of values\n if (type === \"num\" || type === \"sid\" || type === \"offset\") {\n value = value[0];\n }\n this.values[key] = value;\n return true;\n }\n\n setByName(name, value) {\n if (!(name in this.nameToKeyMap)) {\n throw new FormatError(`Invalid dictionary name \"${name}\"`);\n }\n this.values[this.nameToKeyMap[name]] = value;\n }\n\n hasName(name) {\n return this.nameToKeyMap[name] in this.values;\n }\n\n getByName(name) {\n if (!(name in this.nameToKeyMap)) {\n throw new FormatError(`Invalid dictionary name ${name}\"`);\n }\n const key = this.nameToKeyMap[name];\n if (!(key in this.values)) {\n return this.defaults[key];\n }\n return this.values[key];\n }\n\n removeByName(name) {\n delete this.values[this.nameToKeyMap[name]];\n }\n\n static createTables(layout) {\n const tables = {\n keyToNameMap: {},\n nameToKeyMap: {},\n defaults: {},\n types: {},\n opcodes: {},\n order: [],\n };\n for (const entry of layout) {\n const key = Array.isArray(entry[0])\n ? (entry[0][0] << 8) + entry[0][1]\n : entry[0];\n tables.keyToNameMap[key] = entry[1];\n tables.nameToKeyMap[entry[1]] = key;\n tables.types[key] = entry[2];\n tables.defaults[key] = entry[3];\n tables.opcodes[key] = Array.isArray(entry[0]) ? entry[0] : [entry[0]];\n tables.order.push(key);\n }\n return tables;\n }\n}\n\nconst CFFTopDictLayout = [\n [[12, 30], \"ROS\", [\"sid\", \"sid\", \"num\"], null],\n [[12, 20], \"SyntheticBase\", \"num\", null],\n [0, \"version\", \"sid\", null],\n [1, \"Notice\", \"sid\", null],\n [[12, 0], \"Copyright\", \"sid\", null],\n [2, \"FullName\", \"sid\", null],\n [3, \"FamilyName\", \"sid\", null],\n [4, \"Weight\", \"sid\", null],\n [[12, 1], \"isFixedPitch\", \"num\", 0],\n [[12, 2], \"ItalicAngle\", \"num\", 0],\n [[12, 3], \"UnderlinePosition\", \"num\", -100],\n [[12, 4], \"UnderlineThickness\", \"num\", 50],\n [[12, 5], \"PaintType\", \"num\", 0],\n [[12, 6], \"CharstringType\", \"num\", 2],\n // prettier-ignore\n [[12, 7], \"FontMatrix\", [\"num\", \"num\", \"num\", \"num\", \"num\", \"num\"],\n [0.001, 0, 0, 0.001, 0, 0]],\n [13, \"UniqueID\", \"num\", null],\n [5, \"FontBBox\", [\"num\", \"num\", \"num\", \"num\"], [0, 0, 0, 0]],\n [[12, 8], \"StrokeWidth\", \"num\", 0],\n [14, \"XUID\", \"array\", null],\n [15, \"charset\", \"offset\", 0],\n [16, \"Encoding\", \"offset\", 0],\n [17, \"CharStrings\", \"offset\", 0],\n [18, \"Private\", [\"offset\", \"offset\"], null],\n [[12, 21], \"PostScript\", \"sid\", null],\n [[12, 22], \"BaseFontName\", \"sid\", null],\n [[12, 23], \"BaseFontBlend\", \"delta\", null],\n [[12, 31], \"CIDFontVersion\", \"num\", 0],\n [[12, 32], \"CIDFontRevision\", \"num\", 0],\n [[12, 33], \"CIDFontType\", \"num\", 0],\n [[12, 34], \"CIDCount\", \"num\", 8720],\n [[12, 35], \"UIDBase\", \"num\", null],\n // XXX: CID Fonts on DirectWrite 6.1 only seem to work if FDSelect comes\n // before FDArray.\n [[12, 37], \"FDSelect\", \"offset\", null],\n [[12, 36], \"FDArray\", \"offset\", null],\n [[12, 38], \"FontName\", \"sid\", null],\n];\n\nclass CFFTopDict extends CFFDict {\n static get tables() {\n return shadow(this, \"tables\", this.createTables(CFFTopDictLayout));\n }\n\n constructor(strings) {\n super(CFFTopDict.tables, strings);\n this.privateDict = null;\n }\n}\n\nconst CFFPrivateDictLayout = [\n [6, \"BlueValues\", \"delta\", null],\n [7, \"OtherBlues\", \"delta\", null],\n [8, \"FamilyBlues\", \"delta\", null],\n [9, \"FamilyOtherBlues\", \"delta\", null],\n [[12, 9], \"BlueScale\", \"num\", 0.039625],\n [[12, 10], \"BlueShift\", \"num\", 7],\n [[12, 11], \"BlueFuzz\", \"num\", 1],\n [10, \"StdHW\", \"num\", null],\n [11, \"StdVW\", \"num\", null],\n [[12, 12], \"StemSnapH\", \"delta\", null],\n [[12, 13], \"StemSnapV\", \"delta\", null],\n [[12, 14], \"ForceBold\", \"num\", 0],\n [[12, 17], \"LanguageGroup\", \"num\", 0],\n [[12, 18], \"ExpansionFactor\", \"num\", 0.06],\n [[12, 19], \"initialRandomSeed\", \"num\", 0],\n [20, \"defaultWidthX\", \"num\", 0],\n [21, \"nominalWidthX\", \"num\", 0],\n [19, \"Subrs\", \"offset\", null],\n];\n\nclass CFFPrivateDict extends CFFDict {\n static get tables() {\n return shadow(this, \"tables\", this.createTables(CFFPrivateDictLayout));\n }\n\n constructor(strings) {\n super(CFFPrivateDict.tables, strings);\n this.subrsIndex = null;\n }\n}\n\nconst CFFCharsetPredefinedTypes = {\n ISO_ADOBE: 0,\n EXPERT: 1,\n EXPERT_SUBSET: 2,\n};\n\nclass CFFCharset {\n constructor(predefined, format, charset, raw) {\n this.predefined = predefined;\n this.format = format;\n this.charset = charset;\n this.raw = raw;\n }\n}\n\nclass CFFEncoding {\n constructor(predefined, format, encoding, raw) {\n this.predefined = predefined;\n this.format = format;\n this.encoding = encoding;\n this.raw = raw;\n }\n}\n\nclass CFFFDSelect {\n constructor(format, fdSelect) {\n this.format = format;\n this.fdSelect = fdSelect;\n }\n\n getFDIndex(glyphIndex) {\n if (glyphIndex < 0 || glyphIndex >= this.fdSelect.length) {\n return -1;\n }\n return this.fdSelect[glyphIndex];\n }\n}\n\n// Helper class to keep track of where an offset is within the data and helps\n// filling in that offset once it's known.\nclass CFFOffsetTracker {\n constructor() {\n this.offsets = Object.create(null);\n }\n\n isTracking(key) {\n return key in this.offsets;\n }\n\n track(key, location) {\n if (key in this.offsets) {\n throw new FormatError(`Already tracking location of ${key}`);\n }\n this.offsets[key] = location;\n }\n\n offset(value) {\n for (const key in this.offsets) {\n this.offsets[key] += value;\n }\n }\n\n setEntryLocation(key, values, output) {\n if (!(key in this.offsets)) {\n throw new FormatError(`Not tracking location of ${key}`);\n }\n const data = output.data;\n const dataOffset = this.offsets[key];\n const size = 5;\n for (let i = 0, ii = values.length; i < ii; ++i) {\n const offset0 = i * size + dataOffset;\n const offset1 = offset0 + 1;\n const offset2 = offset0 + 2;\n const offset3 = offset0 + 3;\n const offset4 = offset0 + 4;\n // It's easy to screw up offsets so perform this sanity check.\n if (\n data[offset0] !== 0x1d ||\n data[offset1] !== 0 ||\n data[offset2] !== 0 ||\n data[offset3] !== 0 ||\n data[offset4] !== 0\n ) {\n throw new FormatError(\"writing to an offset that is not empty\");\n }\n const value = values[i];\n data[offset0] = 0x1d;\n data[offset1] = (value >> 24) & 0xff;\n data[offset2] = (value >> 16) & 0xff;\n data[offset3] = (value >> 8) & 0xff;\n data[offset4] = value & 0xff;\n }\n }\n}\n\n// Takes a CFF and converts it to the binary representation.\nclass CFFCompiler {\n constructor(cff) {\n this.cff = cff;\n }\n\n compile() {\n const cff = this.cff;\n const output = {\n data: [],\n length: 0,\n add(data) {\n try {\n // It's possible to exceed the call stack maximum size when trying\n // to push too much elements.\n // In case of failure, we fallback to the `concat` method.\n this.data.push(...data);\n } catch {\n this.data = this.data.concat(data);\n }\n this.length = this.data.length;\n },\n };\n\n // Compile the five entries that must be in order.\n const header = this.compileHeader(cff.header);\n output.add(header);\n\n const nameIndex = this.compileNameIndex(cff.names);\n output.add(nameIndex);\n\n if (cff.isCIDFont) {\n // The spec is unclear on how font matrices should relate to each other\n // when there is one in the main top dict and the sub top dicts.\n // Windows handles this differently than linux and osx so we have to\n // normalize to work on all.\n // Rules based off of some mailing list discussions:\n // - If main font has a matrix and subfont doesn't, use the main matrix.\n // - If no main font matrix and there is a subfont matrix, use the\n // subfont matrix.\n // - If both have matrices, concat together.\n // - If neither have matrices, use default.\n // To make this work on all platforms we move the top matrix into each\n // sub top dict and concat if necessary.\n if (cff.topDict.hasName(\"FontMatrix\")) {\n const base = cff.topDict.getByName(\"FontMatrix\");\n cff.topDict.removeByName(\"FontMatrix\");\n for (const subDict of cff.fdArray) {\n let matrix = base.slice(0);\n if (subDict.hasName(\"FontMatrix\")) {\n matrix = Util.transform(matrix, subDict.getByName(\"FontMatrix\"));\n }\n subDict.setByName(\"FontMatrix\", matrix);\n }\n }\n }\n\n const xuid = cff.topDict.getByName(\"XUID\");\n if (xuid?.length > 16) {\n // Length of XUID array must not be greater than 16 (issue #12399).\n cff.topDict.removeByName(\"XUID\");\n }\n\n cff.topDict.setByName(\"charset\", 0);\n let compiled = this.compileTopDicts(\n [cff.topDict],\n output.length,\n cff.isCIDFont\n );\n output.add(compiled.output);\n const topDictTracker = compiled.trackers[0];\n\n const stringIndex = this.compileStringIndex(cff.strings.strings);\n output.add(stringIndex);\n\n const globalSubrIndex = this.compileIndex(cff.globalSubrIndex);\n output.add(globalSubrIndex);\n\n // Now start on the other entries that have no specific order.\n if (cff.encoding && cff.topDict.hasName(\"Encoding\")) {\n if (cff.encoding.predefined) {\n topDictTracker.setEntryLocation(\n \"Encoding\",\n [cff.encoding.format],\n output\n );\n } else {\n const encoding = this.compileEncoding(cff.encoding);\n topDictTracker.setEntryLocation(\"Encoding\", [output.length], output);\n output.add(encoding);\n }\n }\n const charset = this.compileCharset(\n cff.charset,\n cff.charStrings.count,\n cff.strings,\n cff.isCIDFont\n );\n topDictTracker.setEntryLocation(\"charset\", [output.length], output);\n output.add(charset);\n\n const charStrings = this.compileCharStrings(cff.charStrings);\n topDictTracker.setEntryLocation(\"CharStrings\", [output.length], output);\n output.add(charStrings);\n\n if (cff.isCIDFont) {\n // For some reason FDSelect must be in front of FDArray on windows. OSX\n // and linux don't seem to care.\n topDictTracker.setEntryLocation(\"FDSelect\", [output.length], output);\n const fdSelect = this.compileFDSelect(cff.fdSelect);\n output.add(fdSelect);\n // It is unclear if the sub font dictionary can have CID related\n // dictionary keys, but the sanitizer doesn't like them so remove them.\n compiled = this.compileTopDicts(cff.fdArray, output.length, true);\n topDictTracker.setEntryLocation(\"FDArray\", [output.length], output);\n output.add(compiled.output);\n const fontDictTrackers = compiled.trackers;\n\n this.compilePrivateDicts(cff.fdArray, fontDictTrackers, output);\n }\n\n this.compilePrivateDicts([cff.topDict], [topDictTracker], output);\n\n // If the font data ends with INDEX whose object data is zero-length,\n // the sanitizer will bail out. Add a dummy byte to avoid that.\n output.add([0]);\n\n return output.data;\n }\n\n encodeNumber(value) {\n if (Number.isInteger(value)) {\n return this.encodeInteger(value);\n }\n return this.encodeFloat(value);\n }\n\n static get EncodeFloatRegExp() {\n return shadow(\n this,\n \"EncodeFloatRegExp\",\n /\\.(\\d*?)(?:9{5,20}|0{5,20})\\d{0,2}(?:e(.+)|$)/\n );\n }\n\n encodeFloat(num) {\n let value = num.toString();\n\n // Rounding inaccurate doubles.\n const m = CFFCompiler.EncodeFloatRegExp.exec(value);\n if (m) {\n const epsilon = parseFloat(\"1e\" + ((m[2] ? +m[2] : 0) + m[1].length));\n value = (Math.round(num * epsilon) / epsilon).toString();\n }\n\n let nibbles = \"\";\n let i, ii;\n for (i = 0, ii = value.length; i < ii; ++i) {\n const a = value[i];\n if (a === \"e\") {\n nibbles += value[++i] === \"-\" ? \"c\" : \"b\";\n } else if (a === \".\") {\n nibbles += \"a\";\n } else if (a === \"-\") {\n nibbles += \"e\";\n } else {\n nibbles += a;\n }\n }\n nibbles += nibbles.length & 1 ? \"f\" : \"ff\";\n const out = [30];\n for (i = 0, ii = nibbles.length; i < ii; i += 2) {\n out.push(parseInt(nibbles.substring(i, i + 2), 16));\n }\n return out;\n }\n\n encodeInteger(value) {\n let code;\n if (value >= -107 && value <= 107) {\n code = [value + 139];\n } else if (value >= 108 && value <= 1131) {\n value -= 108;\n code = [(value >> 8) + 247, value & 0xff];\n } else if (value >= -1131 && value <= -108) {\n value = -value - 108;\n code = [(value >> 8) + 251, value & 0xff];\n } else if (value >= -32768 && value <= 32767) {\n code = [0x1c, (value >> 8) & 0xff, value & 0xff];\n } else {\n code = [\n 0x1d,\n (value >> 24) & 0xff,\n (value >> 16) & 0xff,\n (value >> 8) & 0xff,\n value & 0xff,\n ];\n }\n return code;\n }\n\n compileHeader(header) {\n // `header.hdrSize` can be any value but we only write 4 values\n // so header size is 4 (prevents OTS from rejecting the font).\n return [header.major, header.minor, 4, header.offSize];\n }\n\n compileNameIndex(names) {\n const nameIndex = new CFFIndex();\n for (const name of names) {\n // OTS doesn't allow names to be over 127 characters.\n const length = Math.min(name.length, 127);\n let sanitizedName = new Array(length);\n for (let j = 0; j < length; j++) {\n // OTS requires chars to be between a range and not certain other\n // chars.\n let char = name[j];\n if (\n char < \"!\" ||\n char > \"~\" ||\n char === \"[\" ||\n char === \"]\" ||\n char === \"(\" ||\n char === \")\" ||\n char === \"{\" ||\n char === \"}\" ||\n char === \"<\" ||\n char === \">\" ||\n char === \"/\" ||\n char === \"%\"\n ) {\n char = \"_\";\n }\n sanitizedName[j] = char;\n }\n sanitizedName = sanitizedName.join(\"\");\n\n if (sanitizedName === \"\") {\n sanitizedName = \"Bad_Font_Name\";\n }\n nameIndex.add(stringToBytes(sanitizedName));\n }\n return this.compileIndex(nameIndex);\n }\n\n compileTopDicts(dicts, length, removeCidKeys) {\n const fontDictTrackers = [];\n let fdArrayIndex = new CFFIndex();\n for (const fontDict of dicts) {\n if (removeCidKeys) {\n fontDict.removeByName(\"CIDFontVersion\");\n fontDict.removeByName(\"CIDFontRevision\");\n fontDict.removeByName(\"CIDFontType\");\n fontDict.removeByName(\"CIDCount\");\n fontDict.removeByName(\"UIDBase\");\n }\n const fontDictTracker = new CFFOffsetTracker();\n const fontDictData = this.compileDict(fontDict, fontDictTracker);\n fontDictTrackers.push(fontDictTracker);\n fdArrayIndex.add(fontDictData);\n fontDictTracker.offset(length);\n }\n fdArrayIndex = this.compileIndex(fdArrayIndex, fontDictTrackers);\n return {\n trackers: fontDictTrackers,\n output: fdArrayIndex,\n };\n }\n\n compilePrivateDicts(dicts, trackers, output) {\n for (let i = 0, ii = dicts.length; i < ii; ++i) {\n const fontDict = dicts[i];\n const privateDict = fontDict.privateDict;\n if (!privateDict || !fontDict.hasName(\"Private\")) {\n throw new FormatError(\"There must be a private dictionary.\");\n }\n const privateDictTracker = new CFFOffsetTracker();\n const privateDictData = this.compileDict(privateDict, privateDictTracker);\n\n let outputLength = output.length;\n privateDictTracker.offset(outputLength);\n if (!privateDictData.length) {\n // The private dictionary was empty, set the output length to zero to\n // ensure the offset length isn't out of bounds in the eyes of the\n // sanitizer.\n outputLength = 0;\n }\n\n trackers[i].setEntryLocation(\n \"Private\",\n [privateDictData.length, outputLength],\n output\n );\n output.add(privateDictData);\n\n if (privateDict.subrsIndex && privateDict.hasName(\"Subrs\")) {\n const subrs = this.compileIndex(privateDict.subrsIndex);\n privateDictTracker.setEntryLocation(\n \"Subrs\",\n [privateDictData.length],\n output\n );\n output.add(subrs);\n }\n }\n }\n\n compileDict(dict, offsetTracker) {\n const out = [];\n // The dictionary keys must be in a certain order.\n for (const key of dict.order) {\n if (!(key in dict.values)) {\n continue;\n }\n let values = dict.values[key];\n let types = dict.types[key];\n if (!Array.isArray(types)) {\n types = [types];\n }\n if (!Array.isArray(values)) {\n values = [values];\n }\n\n // Remove any empty dict values.\n if (values.length === 0) {\n continue;\n }\n\n for (let j = 0, jj = types.length; j < jj; ++j) {\n const type = types[j];\n const value = values[j];\n switch (type) {\n case \"num\":\n case \"sid\":\n out.push(...this.encodeNumber(value));\n break;\n case \"offset\":\n // For offsets we just insert a 32bit integer so we don't have to\n // deal with figuring out the length of the offset when it gets\n // replaced later on by the compiler.\n const name = dict.keyToNameMap[key];\n // Some offsets have the offset and the length, so just record the\n // position of the first one.\n if (!offsetTracker.isTracking(name)) {\n offsetTracker.track(name, out.length);\n }\n out.push(0x1d, 0, 0, 0, 0);\n break;\n case \"array\":\n case \"delta\":\n out.push(...this.encodeNumber(value));\n for (let k = 1, kk = values.length; k < kk; ++k) {\n out.push(...this.encodeNumber(values[k]));\n }\n break;\n default:\n throw new FormatError(`Unknown data type of ${type}`);\n }\n }\n out.push(...dict.opcodes[key]);\n }\n return out;\n }\n\n compileStringIndex(strings) {\n const stringIndex = new CFFIndex();\n for (const string of strings) {\n stringIndex.add(stringToBytes(string));\n }\n return this.compileIndex(stringIndex);\n }\n\n compileCharStrings(charStrings) {\n const charStringsIndex = new CFFIndex();\n for (let i = 0; i < charStrings.count; i++) {\n const glyph = charStrings.get(i);\n // If the CharString outline is empty, replace it with .notdef to\n // prevent OTS from rejecting the font (fixes bug1252420.pdf).\n if (glyph.length === 0) {\n charStringsIndex.add(new Uint8Array([0x8b, 0x0e]));\n continue;\n }\n charStringsIndex.add(glyph);\n }\n return this.compileIndex(charStringsIndex);\n }\n\n compileCharset(charset, numGlyphs, strings, isCIDFont) {\n // Freetype requires the number of charset strings be correct and MacOS\n // requires a valid mapping for printing.\n let out;\n const numGlyphsLessNotDef = numGlyphs - 1;\n if (isCIDFont) {\n // In a CID font, the charset is a mapping of CIDs not SIDs so just\n // create an identity mapping.\n out = new Uint8Array([\n 2, // format\n 0, // first CID upper byte\n 0, // first CID lower byte\n (numGlyphsLessNotDef >> 8) & 0xff,\n numGlyphsLessNotDef & 0xff,\n ]);\n } else {\n const length = 1 + numGlyphsLessNotDef * 2;\n out = new Uint8Array(length);\n out[0] = 0; // format 0\n let charsetIndex = 0;\n const numCharsets = charset.charset.length;\n let warned = false;\n for (let i = 1; i < out.length; i += 2) {\n let sid = 0;\n if (charsetIndex < numCharsets) {\n const name = charset.charset[charsetIndex++];\n sid = strings.getSID(name);\n if (sid === -1) {\n sid = 0;\n if (!warned) {\n warned = true;\n warn(`Couldn't find ${name} in CFF strings`);\n }\n }\n }\n out[i] = (sid >> 8) & 0xff;\n out[i + 1] = sid & 0xff;\n }\n }\n return this.compileTypedArray(out);\n }\n\n compileEncoding(encoding) {\n return this.compileTypedArray(encoding.raw);\n }\n\n compileFDSelect(fdSelect) {\n const format = fdSelect.format;\n let out, i;\n switch (format) {\n case 0:\n out = new Uint8Array(1 + fdSelect.fdSelect.length);\n out[0] = format;\n for (i = 0; i < fdSelect.fdSelect.length; i++) {\n out[i + 1] = fdSelect.fdSelect[i];\n }\n break;\n case 3:\n const start = 0;\n let lastFD = fdSelect.fdSelect[0];\n const ranges = [\n format,\n 0, // nRanges place holder\n 0, // nRanges place holder\n (start >> 8) & 0xff,\n start & 0xff,\n lastFD,\n ];\n for (i = 1; i < fdSelect.fdSelect.length; i++) {\n const currentFD = fdSelect.fdSelect[i];\n if (currentFD !== lastFD) {\n ranges.push((i >> 8) & 0xff, i & 0xff, currentFD);\n lastFD = currentFD;\n }\n }\n // 3 bytes are pushed for every range and there are 3 header bytes.\n const numRanges = (ranges.length - 3) / 3;\n ranges[1] = (numRanges >> 8) & 0xff;\n ranges[2] = numRanges & 0xff;\n // sentinel\n ranges.push((i >> 8) & 0xff, i & 0xff);\n out = new Uint8Array(ranges);\n break;\n }\n return this.compileTypedArray(out);\n }\n\n compileTypedArray(data) {\n return Array.from(data);\n }\n\n compileIndex(index, trackers = []) {\n const objects = index.objects;\n // First 2 bytes contains the number of objects contained into this index\n const count = objects.length;\n\n // If there is no object, just create an index.\n if (count === 0) {\n return [0, 0];\n }\n\n const data = [(count >> 8) & 0xff, count & 0xff];\n\n let lastOffset = 1,\n i;\n for (i = 0; i < count; ++i) {\n lastOffset += objects[i].length;\n }\n\n let offsetSize;\n if (lastOffset < 0x100) {\n offsetSize = 1;\n } else if (lastOffset < 0x10000) {\n offsetSize = 2;\n } else if (lastOffset < 0x1000000) {\n offsetSize = 3;\n } else {\n offsetSize = 4;\n }\n\n // Next byte contains the offset size use to reference object in the file\n data.push(offsetSize);\n\n // Add another offset after this one because we need a new offset\n let relativeOffset = 1;\n for (i = 0; i < count + 1; i++) {\n if (offsetSize === 1) {\n data.push(relativeOffset & 0xff);\n } else if (offsetSize === 2) {\n data.push((relativeOffset >> 8) & 0xff, relativeOffset & 0xff);\n } else if (offsetSize === 3) {\n data.push(\n (relativeOffset >> 16) & 0xff,\n (relativeOffset >> 8) & 0xff,\n relativeOffset & 0xff\n );\n } else {\n data.push(\n (relativeOffset >>> 24) & 0xff,\n (relativeOffset >> 16) & 0xff,\n (relativeOffset >> 8) & 0xff,\n relativeOffset & 0xff\n );\n }\n\n if (objects[i]) {\n relativeOffset += objects[i].length;\n }\n }\n\n for (i = 0; i < count; i++) {\n // Notify the tracker where the object will be offset in the data.\n if (trackers[i]) {\n trackers[i].offset(data.length);\n }\n data.push(...objects[i]);\n }\n return data;\n }\n}\n\nexport {\n CFF,\n CFFCharset,\n CFFCompiler,\n CFFFDSelect,\n CFFHeader,\n CFFIndex,\n CFFParser,\n CFFPrivateDict,\n CFFStandardStrings,\n CFFStrings,\n CFFTopDict,\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 { getLookupTableFactory } from \"./core_utils.js\";\n\nconst getGlyphsUnicode = getLookupTableFactory(function (t) {\n t.A = 0x0041;\n t.AE = 0x00c6;\n t.AEacute = 0x01fc;\n t.AEmacron = 0x01e2;\n t.AEsmall = 0xf7e6;\n t.Aacute = 0x00c1;\n t.Aacutesmall = 0xf7e1;\n t.Abreve = 0x0102;\n t.Abreveacute = 0x1eae;\n t.Abrevecyrillic = 0x04d0;\n t.Abrevedotbelow = 0x1eb6;\n t.Abrevegrave = 0x1eb0;\n t.Abrevehookabove = 0x1eb2;\n t.Abrevetilde = 0x1eb4;\n t.Acaron = 0x01cd;\n t.Acircle = 0x24b6;\n t.Acircumflex = 0x00c2;\n t.Acircumflexacute = 0x1ea4;\n t.Acircumflexdotbelow = 0x1eac;\n t.Acircumflexgrave = 0x1ea6;\n t.Acircumflexhookabove = 0x1ea8;\n t.Acircumflexsmall = 0xf7e2;\n t.Acircumflextilde = 0x1eaa;\n t.Acute = 0xf6c9;\n t.Acutesmall = 0xf7b4;\n t.Acyrillic = 0x0410;\n t.Adblgrave = 0x0200;\n t.Adieresis = 0x00c4;\n t.Adieresiscyrillic = 0x04d2;\n t.Adieresismacron = 0x01de;\n t.Adieresissmall = 0xf7e4;\n t.Adotbelow = 0x1ea0;\n t.Adotmacron = 0x01e0;\n t.Agrave = 0x00c0;\n t.Agravesmall = 0xf7e0;\n t.Ahookabove = 0x1ea2;\n t.Aiecyrillic = 0x04d4;\n t.Ainvertedbreve = 0x0202;\n t.Alpha = 0x0391;\n t.Alphatonos = 0x0386;\n t.Amacron = 0x0100;\n t.Amonospace = 0xff21;\n t.Aogonek = 0x0104;\n t.Aring = 0x00c5;\n t.Aringacute = 0x01fa;\n t.Aringbelow = 0x1e00;\n t.Aringsmall = 0xf7e5;\n t.Asmall = 0xf761;\n t.Atilde = 0x00c3;\n t.Atildesmall = 0xf7e3;\n t.Aybarmenian = 0x0531;\n t.B = 0x0042;\n t.Bcircle = 0x24b7;\n t.Bdotaccent = 0x1e02;\n t.Bdotbelow = 0x1e04;\n t.Becyrillic = 0x0411;\n t.Benarmenian = 0x0532;\n t.Beta = 0x0392;\n t.Bhook = 0x0181;\n t.Blinebelow = 0x1e06;\n t.Bmonospace = 0xff22;\n t.Brevesmall = 0xf6f4;\n t.Bsmall = 0xf762;\n t.Btopbar = 0x0182;\n t.C = 0x0043;\n t.Caarmenian = 0x053e;\n t.Cacute = 0x0106;\n t.Caron = 0xf6ca;\n t.Caronsmall = 0xf6f5;\n t.Ccaron = 0x010c;\n t.Ccedilla = 0x00c7;\n t.Ccedillaacute = 0x1e08;\n t.Ccedillasmall = 0xf7e7;\n t.Ccircle = 0x24b8;\n t.Ccircumflex = 0x0108;\n t.Cdot = 0x010a;\n t.Cdotaccent = 0x010a;\n t.Cedillasmall = 0xf7b8;\n t.Chaarmenian = 0x0549;\n t.Cheabkhasiancyrillic = 0x04bc;\n t.Checyrillic = 0x0427;\n t.Chedescenderabkhasiancyrillic = 0x04be;\n t.Chedescendercyrillic = 0x04b6;\n t.Chedieresiscyrillic = 0x04f4;\n t.Cheharmenian = 0x0543;\n t.Chekhakassiancyrillic = 0x04cb;\n t.Cheverticalstrokecyrillic = 0x04b8;\n t.Chi = 0x03a7;\n t.Chook = 0x0187;\n t.Circumflexsmall = 0xf6f6;\n t.Cmonospace = 0xff23;\n t.Coarmenian = 0x0551;\n t.Csmall = 0xf763;\n t.D = 0x0044;\n t.DZ = 0x01f1;\n t.DZcaron = 0x01c4;\n t.Daarmenian = 0x0534;\n t.Dafrican = 0x0189;\n t.Dcaron = 0x010e;\n t.Dcedilla = 0x1e10;\n t.Dcircle = 0x24b9;\n t.Dcircumflexbelow = 0x1e12;\n t.Dcroat = 0x0110;\n t.Ddotaccent = 0x1e0a;\n t.Ddotbelow = 0x1e0c;\n t.Decyrillic = 0x0414;\n t.Deicoptic = 0x03ee;\n t.Delta = 0x2206;\n t.Deltagreek = 0x0394;\n t.Dhook = 0x018a;\n t.Dieresis = 0xf6cb;\n t.DieresisAcute = 0xf6cc;\n t.DieresisGrave = 0xf6cd;\n t.Dieresissmall = 0xf7a8;\n t.Digammagreek = 0x03dc;\n t.Djecyrillic = 0x0402;\n t.Dlinebelow = 0x1e0e;\n t.Dmonospace = 0xff24;\n t.Dotaccentsmall = 0xf6f7;\n t.Dslash = 0x0110;\n t.Dsmall = 0xf764;\n t.Dtopbar = 0x018b;\n t.Dz = 0x01f2;\n t.Dzcaron = 0x01c5;\n t.Dzeabkhasiancyrillic = 0x04e0;\n t.Dzecyrillic = 0x0405;\n t.Dzhecyrillic = 0x040f;\n t.E = 0x0045;\n t.Eacute = 0x00c9;\n t.Eacutesmall = 0xf7e9;\n t.Ebreve = 0x0114;\n t.Ecaron = 0x011a;\n t.Ecedillabreve = 0x1e1c;\n t.Echarmenian = 0x0535;\n t.Ecircle = 0x24ba;\n t.Ecircumflex = 0x00ca;\n t.Ecircumflexacute = 0x1ebe;\n t.Ecircumflexbelow = 0x1e18;\n t.Ecircumflexdotbelow = 0x1ec6;\n t.Ecircumflexgrave = 0x1ec0;\n t.Ecircumflexhookabove = 0x1ec2;\n t.Ecircumflexsmall = 0xf7ea;\n t.Ecircumflextilde = 0x1ec4;\n t.Ecyrillic = 0x0404;\n t.Edblgrave = 0x0204;\n t.Edieresis = 0x00cb;\n t.Edieresissmall = 0xf7eb;\n t.Edot = 0x0116;\n t.Edotaccent = 0x0116;\n t.Edotbelow = 0x1eb8;\n t.Efcyrillic = 0x0424;\n t.Egrave = 0x00c8;\n t.Egravesmall = 0xf7e8;\n t.Eharmenian = 0x0537;\n t.Ehookabove = 0x1eba;\n t.Eightroman = 0x2167;\n t.Einvertedbreve = 0x0206;\n t.Eiotifiedcyrillic = 0x0464;\n t.Elcyrillic = 0x041b;\n t.Elevenroman = 0x216a;\n t.Emacron = 0x0112;\n t.Emacronacute = 0x1e16;\n t.Emacrongrave = 0x1e14;\n t.Emcyrillic = 0x041c;\n t.Emonospace = 0xff25;\n t.Encyrillic = 0x041d;\n t.Endescendercyrillic = 0x04a2;\n t.Eng = 0x014a;\n t.Enghecyrillic = 0x04a4;\n t.Enhookcyrillic = 0x04c7;\n t.Eogonek = 0x0118;\n t.Eopen = 0x0190;\n t.Epsilon = 0x0395;\n t.Epsilontonos = 0x0388;\n t.Ercyrillic = 0x0420;\n t.Ereversed = 0x018e;\n t.Ereversedcyrillic = 0x042d;\n t.Escyrillic = 0x0421;\n t.Esdescendercyrillic = 0x04aa;\n t.Esh = 0x01a9;\n t.Esmall = 0xf765;\n t.Eta = 0x0397;\n t.Etarmenian = 0x0538;\n t.Etatonos = 0x0389;\n t.Eth = 0x00d0;\n t.Ethsmall = 0xf7f0;\n t.Etilde = 0x1ebc;\n t.Etildebelow = 0x1e1a;\n t.Euro = 0x20ac;\n t.Ezh = 0x01b7;\n t.Ezhcaron = 0x01ee;\n t.Ezhreversed = 0x01b8;\n t.F = 0x0046;\n t.Fcircle = 0x24bb;\n t.Fdotaccent = 0x1e1e;\n t.Feharmenian = 0x0556;\n t.Feicoptic = 0x03e4;\n t.Fhook = 0x0191;\n t.Fitacyrillic = 0x0472;\n t.Fiveroman = 0x2164;\n t.Fmonospace = 0xff26;\n t.Fourroman = 0x2163;\n t.Fsmall = 0xf766;\n t.G = 0x0047;\n t.GBsquare = 0x3387;\n t.Gacute = 0x01f4;\n t.Gamma = 0x0393;\n t.Gammaafrican = 0x0194;\n t.Gangiacoptic = 0x03ea;\n t.Gbreve = 0x011e;\n t.Gcaron = 0x01e6;\n t.Gcedilla = 0x0122;\n t.Gcircle = 0x24bc;\n t.Gcircumflex = 0x011c;\n t.Gcommaaccent = 0x0122;\n t.Gdot = 0x0120;\n t.Gdotaccent = 0x0120;\n t.Gecyrillic = 0x0413;\n t.Ghadarmenian = 0x0542;\n t.Ghemiddlehookcyrillic = 0x0494;\n t.Ghestrokecyrillic = 0x0492;\n t.Gheupturncyrillic = 0x0490;\n t.Ghook = 0x0193;\n t.Gimarmenian = 0x0533;\n t.Gjecyrillic = 0x0403;\n t.Gmacron = 0x1e20;\n t.Gmonospace = 0xff27;\n t.Grave = 0xf6ce;\n t.Gravesmall = 0xf760;\n t.Gsmall = 0xf767;\n t.Gsmallhook = 0x029b;\n t.Gstroke = 0x01e4;\n t.H = 0x0048;\n t.H18533 = 0x25cf;\n t.H18543 = 0x25aa;\n t.H18551 = 0x25ab;\n t.H22073 = 0x25a1;\n t.HPsquare = 0x33cb;\n t.Haabkhasiancyrillic = 0x04a8;\n t.Hadescendercyrillic = 0x04b2;\n t.Hardsigncyrillic = 0x042a;\n t.Hbar = 0x0126;\n t.Hbrevebelow = 0x1e2a;\n t.Hcedilla = 0x1e28;\n t.Hcircle = 0x24bd;\n t.Hcircumflex = 0x0124;\n t.Hdieresis = 0x1e26;\n t.Hdotaccent = 0x1e22;\n t.Hdotbelow = 0x1e24;\n t.Hmonospace = 0xff28;\n t.Hoarmenian = 0x0540;\n t.Horicoptic = 0x03e8;\n t.Hsmall = 0xf768;\n t.Hungarumlaut = 0xf6cf;\n t.Hungarumlautsmall = 0xf6f8;\n t.Hzsquare = 0x3390;\n t.I = 0x0049;\n t.IAcyrillic = 0x042f;\n t.IJ = 0x0132;\n t.IUcyrillic = 0x042e;\n t.Iacute = 0x00cd;\n t.Iacutesmall = 0xf7ed;\n t.Ibreve = 0x012c;\n t.Icaron = 0x01cf;\n t.Icircle = 0x24be;\n t.Icircumflex = 0x00ce;\n t.Icircumflexsmall = 0xf7ee;\n t.Icyrillic = 0x0406;\n t.Idblgrave = 0x0208;\n t.Idieresis = 0x00cf;\n t.Idieresisacute = 0x1e2e;\n t.Idieresiscyrillic = 0x04e4;\n t.Idieresissmall = 0xf7ef;\n t.Idot = 0x0130;\n t.Idotaccent = 0x0130;\n t.Idotbelow = 0x1eca;\n t.Iebrevecyrillic = 0x04d6;\n t.Iecyrillic = 0x0415;\n t.Ifraktur = 0x2111;\n t.Igrave = 0x00cc;\n t.Igravesmall = 0xf7ec;\n t.Ihookabove = 0x1ec8;\n t.Iicyrillic = 0x0418;\n t.Iinvertedbreve = 0x020a;\n t.Iishortcyrillic = 0x0419;\n t.Imacron = 0x012a;\n t.Imacroncyrillic = 0x04e2;\n t.Imonospace = 0xff29;\n t.Iniarmenian = 0x053b;\n t.Iocyrillic = 0x0401;\n t.Iogonek = 0x012e;\n t.Iota = 0x0399;\n t.Iotaafrican = 0x0196;\n t.Iotadieresis = 0x03aa;\n t.Iotatonos = 0x038a;\n t.Ismall = 0xf769;\n t.Istroke = 0x0197;\n t.Itilde = 0x0128;\n t.Itildebelow = 0x1e2c;\n t.Izhitsacyrillic = 0x0474;\n t.Izhitsadblgravecyrillic = 0x0476;\n t.J = 0x004a;\n t.Jaarmenian = 0x0541;\n t.Jcircle = 0x24bf;\n t.Jcircumflex = 0x0134;\n t.Jecyrillic = 0x0408;\n t.Jheharmenian = 0x054b;\n t.Jmonospace = 0xff2a;\n t.Jsmall = 0xf76a;\n t.K = 0x004b;\n t.KBsquare = 0x3385;\n t.KKsquare = 0x33cd;\n t.Kabashkircyrillic = 0x04a0;\n t.Kacute = 0x1e30;\n t.Kacyrillic = 0x041a;\n t.Kadescendercyrillic = 0x049a;\n t.Kahookcyrillic = 0x04c3;\n t.Kappa = 0x039a;\n t.Kastrokecyrillic = 0x049e;\n t.Kaverticalstrokecyrillic = 0x049c;\n t.Kcaron = 0x01e8;\n t.Kcedilla = 0x0136;\n t.Kcircle = 0x24c0;\n t.Kcommaaccent = 0x0136;\n t.Kdotbelow = 0x1e32;\n t.Keharmenian = 0x0554;\n t.Kenarmenian = 0x053f;\n t.Khacyrillic = 0x0425;\n t.Kheicoptic = 0x03e6;\n t.Khook = 0x0198;\n t.Kjecyrillic = 0x040c;\n t.Klinebelow = 0x1e34;\n t.Kmonospace = 0xff2b;\n t.Koppacyrillic = 0x0480;\n t.Koppagreek = 0x03de;\n t.Ksicyrillic = 0x046e;\n t.Ksmall = 0xf76b;\n t.L = 0x004c;\n t.LJ = 0x01c7;\n t.LL = 0xf6bf;\n t.Lacute = 0x0139;\n t.Lambda = 0x039b;\n t.Lcaron = 0x013d;\n t.Lcedilla = 0x013b;\n t.Lcircle = 0x24c1;\n t.Lcircumflexbelow = 0x1e3c;\n t.Lcommaaccent = 0x013b;\n t.Ldot = 0x013f;\n t.Ldotaccent = 0x013f;\n t.Ldotbelow = 0x1e36;\n t.Ldotbelowmacron = 0x1e38;\n t.Liwnarmenian = 0x053c;\n t.Lj = 0x01c8;\n t.Ljecyrillic = 0x0409;\n t.Llinebelow = 0x1e3a;\n t.Lmonospace = 0xff2c;\n t.Lslash = 0x0141;\n t.Lslashsmall = 0xf6f9;\n t.Lsmall = 0xf76c;\n t.M = 0x004d;\n t.MBsquare = 0x3386;\n t.Macron = 0xf6d0;\n t.Macronsmall = 0xf7af;\n t.Macute = 0x1e3e;\n t.Mcircle = 0x24c2;\n t.Mdotaccent = 0x1e40;\n t.Mdotbelow = 0x1e42;\n t.Menarmenian = 0x0544;\n t.Mmonospace = 0xff2d;\n t.Msmall = 0xf76d;\n t.Mturned = 0x019c;\n t.Mu = 0x039c;\n t.N = 0x004e;\n t.NJ = 0x01ca;\n t.Nacute = 0x0143;\n t.Ncaron = 0x0147;\n t.Ncedilla = 0x0145;\n t.Ncircle = 0x24c3;\n t.Ncircumflexbelow = 0x1e4a;\n t.Ncommaaccent = 0x0145;\n t.Ndotaccent = 0x1e44;\n t.Ndotbelow = 0x1e46;\n t.Nhookleft = 0x019d;\n t.Nineroman = 0x2168;\n t.Nj = 0x01cb;\n t.Njecyrillic = 0x040a;\n t.Nlinebelow = 0x1e48;\n t.Nmonospace = 0xff2e;\n t.Nowarmenian = 0x0546;\n t.Nsmall = 0xf76e;\n t.Ntilde = 0x00d1;\n t.Ntildesmall = 0xf7f1;\n t.Nu = 0x039d;\n t.O = 0x004f;\n t.OE = 0x0152;\n t.OEsmall = 0xf6fa;\n t.Oacute = 0x00d3;\n t.Oacutesmall = 0xf7f3;\n t.Obarredcyrillic = 0x04e8;\n t.Obarreddieresiscyrillic = 0x04ea;\n t.Obreve = 0x014e;\n t.Ocaron = 0x01d1;\n t.Ocenteredtilde = 0x019f;\n t.Ocircle = 0x24c4;\n t.Ocircumflex = 0x00d4;\n t.Ocircumflexacute = 0x1ed0;\n t.Ocircumflexdotbelow = 0x1ed8;\n t.Ocircumflexgrave = 0x1ed2;\n t.Ocircumflexhookabove = 0x1ed4;\n t.Ocircumflexsmall = 0xf7f4;\n t.Ocircumflextilde = 0x1ed6;\n t.Ocyrillic = 0x041e;\n t.Odblacute = 0x0150;\n t.Odblgrave = 0x020c;\n t.Odieresis = 0x00d6;\n t.Odieresiscyrillic = 0x04e6;\n t.Odieresissmall = 0xf7f6;\n t.Odotbelow = 0x1ecc;\n t.Ogoneksmall = 0xf6fb;\n t.Ograve = 0x00d2;\n t.Ogravesmall = 0xf7f2;\n t.Oharmenian = 0x0555;\n t.Ohm = 0x2126;\n t.Ohookabove = 0x1ece;\n t.Ohorn = 0x01a0;\n t.Ohornacute = 0x1eda;\n t.Ohorndotbelow = 0x1ee2;\n t.Ohorngrave = 0x1edc;\n t.Ohornhookabove = 0x1ede;\n t.Ohorntilde = 0x1ee0;\n t.Ohungarumlaut = 0x0150;\n t.Oi = 0x01a2;\n t.Oinvertedbreve = 0x020e;\n t.Omacron = 0x014c;\n t.Omacronacute = 0x1e52;\n t.Omacrongrave = 0x1e50;\n t.Omega = 0x2126;\n t.Omegacyrillic = 0x0460;\n t.Omegagreek = 0x03a9;\n t.Omegaroundcyrillic = 0x047a;\n t.Omegatitlocyrillic = 0x047c;\n t.Omegatonos = 0x038f;\n t.Omicron = 0x039f;\n t.Omicrontonos = 0x038c;\n t.Omonospace = 0xff2f;\n t.Oneroman = 0x2160;\n t.Oogonek = 0x01ea;\n t.Oogonekmacron = 0x01ec;\n t.Oopen = 0x0186;\n t.Oslash = 0x00d8;\n t.Oslashacute = 0x01fe;\n t.Oslashsmall = 0xf7f8;\n t.Osmall = 0xf76f;\n t.Ostrokeacute = 0x01fe;\n t.Otcyrillic = 0x047e;\n t.Otilde = 0x00d5;\n t.Otildeacute = 0x1e4c;\n t.Otildedieresis = 0x1e4e;\n t.Otildesmall = 0xf7f5;\n t.P = 0x0050;\n t.Pacute = 0x1e54;\n t.Pcircle = 0x24c5;\n t.Pdotaccent = 0x1e56;\n t.Pecyrillic = 0x041f;\n t.Peharmenian = 0x054a;\n t.Pemiddlehookcyrillic = 0x04a6;\n t.Phi = 0x03a6;\n t.Phook = 0x01a4;\n t.Pi = 0x03a0;\n t.Piwrarmenian = 0x0553;\n t.Pmonospace = 0xff30;\n t.Psi = 0x03a8;\n t.Psicyrillic = 0x0470;\n t.Psmall = 0xf770;\n t.Q = 0x0051;\n t.Qcircle = 0x24c6;\n t.Qmonospace = 0xff31;\n t.Qsmall = 0xf771;\n t.R = 0x0052;\n t.Raarmenian = 0x054c;\n t.Racute = 0x0154;\n t.Rcaron = 0x0158;\n t.Rcedilla = 0x0156;\n t.Rcircle = 0x24c7;\n t.Rcommaaccent = 0x0156;\n t.Rdblgrave = 0x0210;\n t.Rdotaccent = 0x1e58;\n t.Rdotbelow = 0x1e5a;\n t.Rdotbelowmacron = 0x1e5c;\n t.Reharmenian = 0x0550;\n t.Rfraktur = 0x211c;\n t.Rho = 0x03a1;\n t.Ringsmall = 0xf6fc;\n t.Rinvertedbreve = 0x0212;\n t.Rlinebelow = 0x1e5e;\n t.Rmonospace = 0xff32;\n t.Rsmall = 0xf772;\n t.Rsmallinverted = 0x0281;\n t.Rsmallinvertedsuperior = 0x02b6;\n t.S = 0x0053;\n t.SF010000 = 0x250c;\n t.SF020000 = 0x2514;\n t.SF030000 = 0x2510;\n t.SF040000 = 0x2518;\n t.SF050000 = 0x253c;\n t.SF060000 = 0x252c;\n t.SF070000 = 0x2534;\n t.SF080000 = 0x251c;\n t.SF090000 = 0x2524;\n t.SF100000 = 0x2500;\n t.SF110000 = 0x2502;\n t.SF190000 = 0x2561;\n t.SF200000 = 0x2562;\n t.SF210000 = 0x2556;\n t.SF220000 = 0x2555;\n t.SF230000 = 0x2563;\n t.SF240000 = 0x2551;\n t.SF250000 = 0x2557;\n t.SF260000 = 0x255d;\n t.SF270000 = 0x255c;\n t.SF280000 = 0x255b;\n t.SF360000 = 0x255e;\n t.SF370000 = 0x255f;\n t.SF380000 = 0x255a;\n t.SF390000 = 0x2554;\n t.SF400000 = 0x2569;\n t.SF410000 = 0x2566;\n t.SF420000 = 0x2560;\n t.SF430000 = 0x2550;\n t.SF440000 = 0x256c;\n t.SF450000 = 0x2567;\n t.SF460000 = 0x2568;\n t.SF470000 = 0x2564;\n t.SF480000 = 0x2565;\n t.SF490000 = 0x2559;\n t.SF500000 = 0x2558;\n t.SF510000 = 0x2552;\n t.SF520000 = 0x2553;\n t.SF530000 = 0x256b;\n t.SF540000 = 0x256a;\n t.Sacute = 0x015a;\n t.Sacutedotaccent = 0x1e64;\n t.Sampigreek = 0x03e0;\n t.Scaron = 0x0160;\n t.Scarondotaccent = 0x1e66;\n t.Scaronsmall = 0xf6fd;\n t.Scedilla = 0x015e;\n t.Schwa = 0x018f;\n t.Schwacyrillic = 0x04d8;\n t.Schwadieresiscyrillic = 0x04da;\n t.Scircle = 0x24c8;\n t.Scircumflex = 0x015c;\n t.Scommaaccent = 0x0218;\n t.Sdotaccent = 0x1e60;\n t.Sdotbelow = 0x1e62;\n t.Sdotbelowdotaccent = 0x1e68;\n t.Seharmenian = 0x054d;\n t.Sevenroman = 0x2166;\n t.Shaarmenian = 0x0547;\n t.Shacyrillic = 0x0428;\n t.Shchacyrillic = 0x0429;\n t.Sheicoptic = 0x03e2;\n t.Shhacyrillic = 0x04ba;\n t.Shimacoptic = 0x03ec;\n t.Sigma = 0x03a3;\n t.Sixroman = 0x2165;\n t.Smonospace = 0xff33;\n t.Softsigncyrillic = 0x042c;\n t.Ssmall = 0xf773;\n t.Stigmagreek = 0x03da;\n t.T = 0x0054;\n t.Tau = 0x03a4;\n t.Tbar = 0x0166;\n t.Tcaron = 0x0164;\n t.Tcedilla = 0x0162;\n t.Tcircle = 0x24c9;\n t.Tcircumflexbelow = 0x1e70;\n t.Tcommaaccent = 0x0162;\n t.Tdotaccent = 0x1e6a;\n t.Tdotbelow = 0x1e6c;\n t.Tecyrillic = 0x0422;\n t.Tedescendercyrillic = 0x04ac;\n t.Tenroman = 0x2169;\n t.Tetsecyrillic = 0x04b4;\n t.Theta = 0x0398;\n t.Thook = 0x01ac;\n t.Thorn = 0x00de;\n t.Thornsmall = 0xf7fe;\n t.Threeroman = 0x2162;\n t.Tildesmall = 0xf6fe;\n t.Tiwnarmenian = 0x054f;\n t.Tlinebelow = 0x1e6e;\n t.Tmonospace = 0xff34;\n t.Toarmenian = 0x0539;\n t.Tonefive = 0x01bc;\n t.Tonesix = 0x0184;\n t.Tonetwo = 0x01a7;\n t.Tretroflexhook = 0x01ae;\n t.Tsecyrillic = 0x0426;\n t.Tshecyrillic = 0x040b;\n t.Tsmall = 0xf774;\n t.Twelveroman = 0x216b;\n t.Tworoman = 0x2161;\n t.U = 0x0055;\n t.Uacute = 0x00da;\n t.Uacutesmall = 0xf7fa;\n t.Ubreve = 0x016c;\n t.Ucaron = 0x01d3;\n t.Ucircle = 0x24ca;\n t.Ucircumflex = 0x00db;\n t.Ucircumflexbelow = 0x1e76;\n t.Ucircumflexsmall = 0xf7fb;\n t.Ucyrillic = 0x0423;\n t.Udblacute = 0x0170;\n t.Udblgrave = 0x0214;\n t.Udieresis = 0x00dc;\n t.Udieresisacute = 0x01d7;\n t.Udieresisbelow = 0x1e72;\n t.Udieresiscaron = 0x01d9;\n t.Udieresiscyrillic = 0x04f0;\n t.Udieresisgrave = 0x01db;\n t.Udieresismacron = 0x01d5;\n t.Udieresissmall = 0xf7fc;\n t.Udotbelow = 0x1ee4;\n t.Ugrave = 0x00d9;\n t.Ugravesmall = 0xf7f9;\n t.Uhookabove = 0x1ee6;\n t.Uhorn = 0x01af;\n t.Uhornacute = 0x1ee8;\n t.Uhorndotbelow = 0x1ef0;\n t.Uhorngrave = 0x1eea;\n t.Uhornhookabove = 0x1eec;\n t.Uhorntilde = 0x1eee;\n t.Uhungarumlaut = 0x0170;\n t.Uhungarumlautcyrillic = 0x04f2;\n t.Uinvertedbreve = 0x0216;\n t.Ukcyrillic = 0x0478;\n t.Umacron = 0x016a;\n t.Umacroncyrillic = 0x04ee;\n t.Umacrondieresis = 0x1e7a;\n t.Umonospace = 0xff35;\n t.Uogonek = 0x0172;\n t.Upsilon = 0x03a5;\n t.Upsilon1 = 0x03d2;\n t.Upsilonacutehooksymbolgreek = 0x03d3;\n t.Upsilonafrican = 0x01b1;\n t.Upsilondieresis = 0x03ab;\n t.Upsilondieresishooksymbolgreek = 0x03d4;\n t.Upsilonhooksymbol = 0x03d2;\n t.Upsilontonos = 0x038e;\n t.Uring = 0x016e;\n t.Ushortcyrillic = 0x040e;\n t.Usmall = 0xf775;\n t.Ustraightcyrillic = 0x04ae;\n t.Ustraightstrokecyrillic = 0x04b0;\n t.Utilde = 0x0168;\n t.Utildeacute = 0x1e78;\n t.Utildebelow = 0x1e74;\n t.V = 0x0056;\n t.Vcircle = 0x24cb;\n t.Vdotbelow = 0x1e7e;\n t.Vecyrillic = 0x0412;\n t.Vewarmenian = 0x054e;\n t.Vhook = 0x01b2;\n t.Vmonospace = 0xff36;\n t.Voarmenian = 0x0548;\n t.Vsmall = 0xf776;\n t.Vtilde = 0x1e7c;\n t.W = 0x0057;\n t.Wacute = 0x1e82;\n t.Wcircle = 0x24cc;\n t.Wcircumflex = 0x0174;\n t.Wdieresis = 0x1e84;\n t.Wdotaccent = 0x1e86;\n t.Wdotbelow = 0x1e88;\n t.Wgrave = 0x1e80;\n t.Wmonospace = 0xff37;\n t.Wsmall = 0xf777;\n t.X = 0x0058;\n t.Xcircle = 0x24cd;\n t.Xdieresis = 0x1e8c;\n t.Xdotaccent = 0x1e8a;\n t.Xeharmenian = 0x053d;\n t.Xi = 0x039e;\n t.Xmonospace = 0xff38;\n t.Xsmall = 0xf778;\n t.Y = 0x0059;\n t.Yacute = 0x00dd;\n t.Yacutesmall = 0xf7fd;\n t.Yatcyrillic = 0x0462;\n t.Ycircle = 0x24ce;\n t.Ycircumflex = 0x0176;\n t.Ydieresis = 0x0178;\n t.Ydieresissmall = 0xf7ff;\n t.Ydotaccent = 0x1e8e;\n t.Ydotbelow = 0x1ef4;\n t.Yericyrillic = 0x042b;\n t.Yerudieresiscyrillic = 0x04f8;\n t.Ygrave = 0x1ef2;\n t.Yhook = 0x01b3;\n t.Yhookabove = 0x1ef6;\n t.Yiarmenian = 0x0545;\n t.Yicyrillic = 0x0407;\n t.Yiwnarmenian = 0x0552;\n t.Ymonospace = 0xff39;\n t.Ysmall = 0xf779;\n t.Ytilde = 0x1ef8;\n t.Yusbigcyrillic = 0x046a;\n t.Yusbigiotifiedcyrillic = 0x046c;\n t.Yuslittlecyrillic = 0x0466;\n t.Yuslittleiotifiedcyrillic = 0x0468;\n t.Z = 0x005a;\n t.Zaarmenian = 0x0536;\n t.Zacute = 0x0179;\n t.Zcaron = 0x017d;\n t.Zcaronsmall = 0xf6ff;\n t.Zcircle = 0x24cf;\n t.Zcircumflex = 0x1e90;\n t.Zdot = 0x017b;\n t.Zdotaccent = 0x017b;\n t.Zdotbelow = 0x1e92;\n t.Zecyrillic = 0x0417;\n t.Zedescendercyrillic = 0x0498;\n t.Zedieresiscyrillic = 0x04de;\n t.Zeta = 0x0396;\n t.Zhearmenian = 0x053a;\n t.Zhebrevecyrillic = 0x04c1;\n t.Zhecyrillic = 0x0416;\n t.Zhedescendercyrillic = 0x0496;\n t.Zhedieresiscyrillic = 0x04dc;\n t.Zlinebelow = 0x1e94;\n t.Zmonospace = 0xff3a;\n t.Zsmall = 0xf77a;\n t.Zstroke = 0x01b5;\n t.a = 0x0061;\n t.aabengali = 0x0986;\n t.aacute = 0x00e1;\n t.aadeva = 0x0906;\n t.aagujarati = 0x0a86;\n t.aagurmukhi = 0x0a06;\n t.aamatragurmukhi = 0x0a3e;\n t.aarusquare = 0x3303;\n t.aavowelsignbengali = 0x09be;\n t.aavowelsigndeva = 0x093e;\n t.aavowelsigngujarati = 0x0abe;\n t.abbreviationmarkarmenian = 0x055f;\n t.abbreviationsigndeva = 0x0970;\n t.abengali = 0x0985;\n t.abopomofo = 0x311a;\n t.abreve = 0x0103;\n t.abreveacute = 0x1eaf;\n t.abrevecyrillic = 0x04d1;\n t.abrevedotbelow = 0x1eb7;\n t.abrevegrave = 0x1eb1;\n t.abrevehookabove = 0x1eb3;\n t.abrevetilde = 0x1eb5;\n t.acaron = 0x01ce;\n t.acircle = 0x24d0;\n t.acircumflex = 0x00e2;\n t.acircumflexacute = 0x1ea5;\n t.acircumflexdotbelow = 0x1ead;\n t.acircumflexgrave = 0x1ea7;\n t.acircumflexhookabove = 0x1ea9;\n t.acircumflextilde = 0x1eab;\n t.acute = 0x00b4;\n t.acutebelowcmb = 0x0317;\n t.acutecmb = 0x0301;\n t.acutecomb = 0x0301;\n t.acutedeva = 0x0954;\n t.acutelowmod = 0x02cf;\n t.acutetonecmb = 0x0341;\n t.acyrillic = 0x0430;\n t.adblgrave = 0x0201;\n t.addakgurmukhi = 0x0a71;\n t.adeva = 0x0905;\n t.adieresis = 0x00e4;\n t.adieresiscyrillic = 0x04d3;\n t.adieresismacron = 0x01df;\n t.adotbelow = 0x1ea1;\n t.adotmacron = 0x01e1;\n t.ae = 0x00e6;\n t.aeacute = 0x01fd;\n t.aekorean = 0x3150;\n t.aemacron = 0x01e3;\n t.afii00208 = 0x2015;\n t.afii08941 = 0x20a4;\n t.afii10017 = 0x0410;\n t.afii10018 = 0x0411;\n t.afii10019 = 0x0412;\n t.afii10020 = 0x0413;\n t.afii10021 = 0x0414;\n t.afii10022 = 0x0415;\n t.afii10023 = 0x0401;\n t.afii10024 = 0x0416;\n t.afii10025 = 0x0417;\n t.afii10026 = 0x0418;\n t.afii10027 = 0x0419;\n t.afii10028 = 0x041a;\n t.afii10029 = 0x041b;\n t.afii10030 = 0x041c;\n t.afii10031 = 0x041d;\n t.afii10032 = 0x041e;\n t.afii10033 = 0x041f;\n t.afii10034 = 0x0420;\n t.afii10035 = 0x0421;\n t.afii10036 = 0x0422;\n t.afii10037 = 0x0423;\n t.afii10038 = 0x0424;\n t.afii10039 = 0x0425;\n t.afii10040 = 0x0426;\n t.afii10041 = 0x0427;\n t.afii10042 = 0x0428;\n t.afii10043 = 0x0429;\n t.afii10044 = 0x042a;\n t.afii10045 = 0x042b;\n t.afii10046 = 0x042c;\n t.afii10047 = 0x042d;\n t.afii10048 = 0x042e;\n t.afii10049 = 0x042f;\n t.afii10050 = 0x0490;\n t.afii10051 = 0x0402;\n t.afii10052 = 0x0403;\n t.afii10053 = 0x0404;\n t.afii10054 = 0x0405;\n t.afii10055 = 0x0406;\n t.afii10056 = 0x0407;\n t.afii10057 = 0x0408;\n t.afii10058 = 0x0409;\n t.afii10059 = 0x040a;\n t.afii10060 = 0x040b;\n t.afii10061 = 0x040c;\n t.afii10062 = 0x040e;\n t.afii10063 = 0xf6c4;\n t.afii10064 = 0xf6c5;\n t.afii10065 = 0x0430;\n t.afii10066 = 0x0431;\n t.afii10067 = 0x0432;\n t.afii10068 = 0x0433;\n t.afii10069 = 0x0434;\n t.afii10070 = 0x0435;\n t.afii10071 = 0x0451;\n t.afii10072 = 0x0436;\n t.afii10073 = 0x0437;\n t.afii10074 = 0x0438;\n t.afii10075 = 0x0439;\n t.afii10076 = 0x043a;\n t.afii10077 = 0x043b;\n t.afii10078 = 0x043c;\n t.afii10079 = 0x043d;\n t.afii10080 = 0x043e;\n t.afii10081 = 0x043f;\n t.afii10082 = 0x0440;\n t.afii10083 = 0x0441;\n t.afii10084 = 0x0442;\n t.afii10085 = 0x0443;\n t.afii10086 = 0x0444;\n t.afii10087 = 0x0445;\n t.afii10088 = 0x0446;\n t.afii10089 = 0x0447;\n t.afii10090 = 0x0448;\n t.afii10091 = 0x0449;\n t.afii10092 = 0x044a;\n t.afii10093 = 0x044b;\n t.afii10094 = 0x044c;\n t.afii10095 = 0x044d;\n t.afii10096 = 0x044e;\n t.afii10097 = 0x044f;\n t.afii10098 = 0x0491;\n t.afii10099 = 0x0452;\n t.afii10100 = 0x0453;\n t.afii10101 = 0x0454;\n t.afii10102 = 0x0455;\n t.afii10103 = 0x0456;\n t.afii10104 = 0x0457;\n t.afii10105 = 0x0458;\n t.afii10106 = 0x0459;\n t.afii10107 = 0x045a;\n t.afii10108 = 0x045b;\n t.afii10109 = 0x045c;\n t.afii10110 = 0x045e;\n t.afii10145 = 0x040f;\n t.afii10146 = 0x0462;\n t.afii10147 = 0x0472;\n t.afii10148 = 0x0474;\n t.afii10192 = 0xf6c6;\n t.afii10193 = 0x045f;\n t.afii10194 = 0x0463;\n t.afii10195 = 0x0473;\n t.afii10196 = 0x0475;\n t.afii10831 = 0xf6c7;\n t.afii10832 = 0xf6c8;\n t.afii10846 = 0x04d9;\n t.afii299 = 0x200e;\n t.afii300 = 0x200f;\n t.afii301 = 0x200d;\n t.afii57381 = 0x066a;\n t.afii57388 = 0x060c;\n t.afii57392 = 0x0660;\n t.afii57393 = 0x0661;\n t.afii57394 = 0x0662;\n t.afii57395 = 0x0663;\n t.afii57396 = 0x0664;\n t.afii57397 = 0x0665;\n t.afii57398 = 0x0666;\n t.afii57399 = 0x0667;\n t.afii57400 = 0x0668;\n t.afii57401 = 0x0669;\n t.afii57403 = 0x061b;\n t.afii57407 = 0x061f;\n t.afii57409 = 0x0621;\n t.afii57410 = 0x0622;\n t.afii57411 = 0x0623;\n t.afii57412 = 0x0624;\n t.afii57413 = 0x0625;\n t.afii57414 = 0x0626;\n t.afii57415 = 0x0627;\n t.afii57416 = 0x0628;\n t.afii57417 = 0x0629;\n t.afii57418 = 0x062a;\n t.afii57419 = 0x062b;\n t.afii57420 = 0x062c;\n t.afii57421 = 0x062d;\n t.afii57422 = 0x062e;\n t.afii57423 = 0x062f;\n t.afii57424 = 0x0630;\n t.afii57425 = 0x0631;\n t.afii57426 = 0x0632;\n t.afii57427 = 0x0633;\n t.afii57428 = 0x0634;\n t.afii57429 = 0x0635;\n t.afii57430 = 0x0636;\n t.afii57431 = 0x0637;\n t.afii57432 = 0x0638;\n t.afii57433 = 0x0639;\n t.afii57434 = 0x063a;\n t.afii57440 = 0x0640;\n t.afii57441 = 0x0641;\n t.afii57442 = 0x0642;\n t.afii57443 = 0x0643;\n t.afii57444 = 0x0644;\n t.afii57445 = 0x0645;\n t.afii57446 = 0x0646;\n t.afii57448 = 0x0648;\n t.afii57449 = 0x0649;\n t.afii57450 = 0x064a;\n t.afii57451 = 0x064b;\n t.afii57452 = 0x064c;\n t.afii57453 = 0x064d;\n t.afii57454 = 0x064e;\n t.afii57455 = 0x064f;\n t.afii57456 = 0x0650;\n t.afii57457 = 0x0651;\n t.afii57458 = 0x0652;\n t.afii57470 = 0x0647;\n t.afii57505 = 0x06a4;\n t.afii57506 = 0x067e;\n t.afii57507 = 0x0686;\n t.afii57508 = 0x0698;\n t.afii57509 = 0x06af;\n t.afii57511 = 0x0679;\n t.afii57512 = 0x0688;\n t.afii57513 = 0x0691;\n t.afii57514 = 0x06ba;\n t.afii57519 = 0x06d2;\n t.afii57534 = 0x06d5;\n t.afii57636 = 0x20aa;\n t.afii57645 = 0x05be;\n t.afii57658 = 0x05c3;\n t.afii57664 = 0x05d0;\n t.afii57665 = 0x05d1;\n t.afii57666 = 0x05d2;\n t.afii57667 = 0x05d3;\n t.afii57668 = 0x05d4;\n t.afii57669 = 0x05d5;\n t.afii57670 = 0x05d6;\n t.afii57671 = 0x05d7;\n t.afii57672 = 0x05d8;\n t.afii57673 = 0x05d9;\n t.afii57674 = 0x05da;\n t.afii57675 = 0x05db;\n t.afii57676 = 0x05dc;\n t.afii57677 = 0x05dd;\n t.afii57678 = 0x05de;\n t.afii57679 = 0x05df;\n t.afii57680 = 0x05e0;\n t.afii57681 = 0x05e1;\n t.afii57682 = 0x05e2;\n t.afii57683 = 0x05e3;\n t.afii57684 = 0x05e4;\n t.afii57685 = 0x05e5;\n t.afii57686 = 0x05e6;\n t.afii57687 = 0x05e7;\n t.afii57688 = 0x05e8;\n t.afii57689 = 0x05e9;\n t.afii57690 = 0x05ea;\n t.afii57694 = 0xfb2a;\n t.afii57695 = 0xfb2b;\n t.afii57700 = 0xfb4b;\n t.afii57705 = 0xfb1f;\n t.afii57716 = 0x05f0;\n t.afii57717 = 0x05f1;\n t.afii57718 = 0x05f2;\n t.afii57723 = 0xfb35;\n t.afii57793 = 0x05b4;\n t.afii57794 = 0x05b5;\n t.afii57795 = 0x05b6;\n t.afii57796 = 0x05bb;\n t.afii57797 = 0x05b8;\n t.afii57798 = 0x05b7;\n t.afii57799 = 0x05b0;\n t.afii57800 = 0x05b2;\n t.afii57801 = 0x05b1;\n t.afii57802 = 0x05b3;\n t.afii57803 = 0x05c2;\n t.afii57804 = 0x05c1;\n t.afii57806 = 0x05b9;\n t.afii57807 = 0x05bc;\n t.afii57839 = 0x05bd;\n t.afii57841 = 0x05bf;\n t.afii57842 = 0x05c0;\n t.afii57929 = 0x02bc;\n t.afii61248 = 0x2105;\n t.afii61289 = 0x2113;\n t.afii61352 = 0x2116;\n t.afii61573 = 0x202c;\n t.afii61574 = 0x202d;\n t.afii61575 = 0x202e;\n t.afii61664 = 0x200c;\n t.afii63167 = 0x066d;\n t.afii64937 = 0x02bd;\n t.agrave = 0x00e0;\n t.agujarati = 0x0a85;\n t.agurmukhi = 0x0a05;\n t.ahiragana = 0x3042;\n t.ahookabove = 0x1ea3;\n t.aibengali = 0x0990;\n t.aibopomofo = 0x311e;\n t.aideva = 0x0910;\n t.aiecyrillic = 0x04d5;\n t.aigujarati = 0x0a90;\n t.aigurmukhi = 0x0a10;\n t.aimatragurmukhi = 0x0a48;\n t.ainarabic = 0x0639;\n t.ainfinalarabic = 0xfeca;\n t.aininitialarabic = 0xfecb;\n t.ainmedialarabic = 0xfecc;\n t.ainvertedbreve = 0x0203;\n t.aivowelsignbengali = 0x09c8;\n t.aivowelsigndeva = 0x0948;\n t.aivowelsigngujarati = 0x0ac8;\n t.akatakana = 0x30a2;\n t.akatakanahalfwidth = 0xff71;\n t.akorean = 0x314f;\n t.alef = 0x05d0;\n t.alefarabic = 0x0627;\n t.alefdageshhebrew = 0xfb30;\n t.aleffinalarabic = 0xfe8e;\n t.alefhamzaabovearabic = 0x0623;\n t.alefhamzaabovefinalarabic = 0xfe84;\n t.alefhamzabelowarabic = 0x0625;\n t.alefhamzabelowfinalarabic = 0xfe88;\n t.alefhebrew = 0x05d0;\n t.aleflamedhebrew = 0xfb4f;\n t.alefmaddaabovearabic = 0x0622;\n t.alefmaddaabovefinalarabic = 0xfe82;\n t.alefmaksuraarabic = 0x0649;\n t.alefmaksurafinalarabic = 0xfef0;\n t.alefmaksurainitialarabic = 0xfef3;\n t.alefmaksuramedialarabic = 0xfef4;\n t.alefpatahhebrew = 0xfb2e;\n t.alefqamatshebrew = 0xfb2f;\n t.aleph = 0x2135;\n t.allequal = 0x224c;\n t.alpha = 0x03b1;\n t.alphatonos = 0x03ac;\n t.amacron = 0x0101;\n t.amonospace = 0xff41;\n t.ampersand = 0x0026;\n t.ampersandmonospace = 0xff06;\n t.ampersandsmall = 0xf726;\n t.amsquare = 0x33c2;\n t.anbopomofo = 0x3122;\n t.angbopomofo = 0x3124;\n t.angbracketleft = 0x3008; // Glyph is missing from Adobe's original list.\n t.angbracketright = 0x3009; // Glyph is missing from Adobe's original list.\n t.angkhankhuthai = 0x0e5a;\n t.angle = 0x2220;\n t.anglebracketleft = 0x3008;\n t.anglebracketleftvertical = 0xfe3f;\n t.anglebracketright = 0x3009;\n t.anglebracketrightvertical = 0xfe40;\n t.angleleft = 0x2329;\n t.angleright = 0x232a;\n t.angstrom = 0x212b;\n t.anoteleia = 0x0387;\n t.anudattadeva = 0x0952;\n t.anusvarabengali = 0x0982;\n t.anusvaradeva = 0x0902;\n t.anusvaragujarati = 0x0a82;\n t.aogonek = 0x0105;\n t.apaatosquare = 0x3300;\n t.aparen = 0x249c;\n t.apostrophearmenian = 0x055a;\n t.apostrophemod = 0x02bc;\n t.apple = 0xf8ff;\n t.approaches = 0x2250;\n t.approxequal = 0x2248;\n t.approxequalorimage = 0x2252;\n t.approximatelyequal = 0x2245;\n t.araeaekorean = 0x318e;\n t.araeakorean = 0x318d;\n t.arc = 0x2312;\n t.arighthalfring = 0x1e9a;\n t.aring = 0x00e5;\n t.aringacute = 0x01fb;\n t.aringbelow = 0x1e01;\n t.arrowboth = 0x2194;\n t.arrowdashdown = 0x21e3;\n t.arrowdashleft = 0x21e0;\n t.arrowdashright = 0x21e2;\n t.arrowdashup = 0x21e1;\n t.arrowdblboth = 0x21d4;\n t.arrowdbldown = 0x21d3;\n t.arrowdblleft = 0x21d0;\n t.arrowdblright = 0x21d2;\n t.arrowdblup = 0x21d1;\n t.arrowdown = 0x2193;\n t.arrowdownleft = 0x2199;\n t.arrowdownright = 0x2198;\n t.arrowdownwhite = 0x21e9;\n t.arrowheaddownmod = 0x02c5;\n t.arrowheadleftmod = 0x02c2;\n t.arrowheadrightmod = 0x02c3;\n t.arrowheadupmod = 0x02c4;\n t.arrowhorizex = 0xf8e7;\n t.arrowleft = 0x2190;\n t.arrowleftdbl = 0x21d0;\n t.arrowleftdblstroke = 0x21cd;\n t.arrowleftoverright = 0x21c6;\n t.arrowleftwhite = 0x21e6;\n t.arrowright = 0x2192;\n t.arrowrightdblstroke = 0x21cf;\n t.arrowrightheavy = 0x279e;\n t.arrowrightoverleft = 0x21c4;\n t.arrowrightwhite = 0x21e8;\n t.arrowtableft = 0x21e4;\n t.arrowtabright = 0x21e5;\n t.arrowup = 0x2191;\n t.arrowupdn = 0x2195;\n t.arrowupdnbse = 0x21a8;\n t.arrowupdownbase = 0x21a8;\n t.arrowupleft = 0x2196;\n t.arrowupleftofdown = 0x21c5;\n t.arrowupright = 0x2197;\n t.arrowupwhite = 0x21e7;\n t.arrowvertex = 0xf8e6;\n t.asciicircum = 0x005e;\n t.asciicircummonospace = 0xff3e;\n t.asciitilde = 0x007e;\n t.asciitildemonospace = 0xff5e;\n t.ascript = 0x0251;\n t.ascriptturned = 0x0252;\n t.asmallhiragana = 0x3041;\n t.asmallkatakana = 0x30a1;\n t.asmallkatakanahalfwidth = 0xff67;\n t.asterisk = 0x002a;\n t.asteriskaltonearabic = 0x066d;\n t.asteriskarabic = 0x066d;\n t.asteriskmath = 0x2217;\n t.asteriskmonospace = 0xff0a;\n t.asterisksmall = 0xfe61;\n t.asterism = 0x2042;\n t.asuperior = 0xf6e9;\n t.asymptoticallyequal = 0x2243;\n t.at = 0x0040;\n t.atilde = 0x00e3;\n t.atmonospace = 0xff20;\n t.atsmall = 0xfe6b;\n t.aturned = 0x0250;\n t.aubengali = 0x0994;\n t.aubopomofo = 0x3120;\n t.audeva = 0x0914;\n t.augujarati = 0x0a94;\n t.augurmukhi = 0x0a14;\n t.aulengthmarkbengali = 0x09d7;\n t.aumatragurmukhi = 0x0a4c;\n t.auvowelsignbengali = 0x09cc;\n t.auvowelsigndeva = 0x094c;\n t.auvowelsigngujarati = 0x0acc;\n t.avagrahadeva = 0x093d;\n t.aybarmenian = 0x0561;\n t.ayin = 0x05e2;\n t.ayinaltonehebrew = 0xfb20;\n t.ayinhebrew = 0x05e2;\n t.b = 0x0062;\n t.babengali = 0x09ac;\n t.backslash = 0x005c;\n t.backslashmonospace = 0xff3c;\n t.badeva = 0x092c;\n t.bagujarati = 0x0aac;\n t.bagurmukhi = 0x0a2c;\n t.bahiragana = 0x3070;\n t.bahtthai = 0x0e3f;\n t.bakatakana = 0x30d0;\n t.bar = 0x007c;\n t.barmonospace = 0xff5c;\n t.bbopomofo = 0x3105;\n t.bcircle = 0x24d1;\n t.bdotaccent = 0x1e03;\n t.bdotbelow = 0x1e05;\n t.beamedsixteenthnotes = 0x266c;\n t.because = 0x2235;\n t.becyrillic = 0x0431;\n t.beharabic = 0x0628;\n t.behfinalarabic = 0xfe90;\n t.behinitialarabic = 0xfe91;\n t.behiragana = 0x3079;\n t.behmedialarabic = 0xfe92;\n t.behmeeminitialarabic = 0xfc9f;\n t.behmeemisolatedarabic = 0xfc08;\n t.behnoonfinalarabic = 0xfc6d;\n t.bekatakana = 0x30d9;\n t.benarmenian = 0x0562;\n t.bet = 0x05d1;\n t.beta = 0x03b2;\n t.betasymbolgreek = 0x03d0;\n t.betdagesh = 0xfb31;\n t.betdageshhebrew = 0xfb31;\n t.bethebrew = 0x05d1;\n t.betrafehebrew = 0xfb4c;\n t.bhabengali = 0x09ad;\n t.bhadeva = 0x092d;\n t.bhagujarati = 0x0aad;\n t.bhagurmukhi = 0x0a2d;\n t.bhook = 0x0253;\n t.bihiragana = 0x3073;\n t.bikatakana = 0x30d3;\n t.bilabialclick = 0x0298;\n t.bindigurmukhi = 0x0a02;\n t.birusquare = 0x3331;\n t.blackcircle = 0x25cf;\n t.blackdiamond = 0x25c6;\n t.blackdownpointingtriangle = 0x25bc;\n t.blackleftpointingpointer = 0x25c4;\n t.blackleftpointingtriangle = 0x25c0;\n t.blacklenticularbracketleft = 0x3010;\n t.blacklenticularbracketleftvertical = 0xfe3b;\n t.blacklenticularbracketright = 0x3011;\n t.blacklenticularbracketrightvertical = 0xfe3c;\n t.blacklowerlefttriangle = 0x25e3;\n t.blacklowerrighttriangle = 0x25e2;\n t.blackrectangle = 0x25ac;\n t.blackrightpointingpointer = 0x25ba;\n t.blackrightpointingtriangle = 0x25b6;\n t.blacksmallsquare = 0x25aa;\n t.blacksmilingface = 0x263b;\n t.blacksquare = 0x25a0;\n t.blackstar = 0x2605;\n t.blackupperlefttriangle = 0x25e4;\n t.blackupperrighttriangle = 0x25e5;\n t.blackuppointingsmalltriangle = 0x25b4;\n t.blackuppointingtriangle = 0x25b2;\n t.blank = 0x2423;\n t.blinebelow = 0x1e07;\n t.block = 0x2588;\n t.bmonospace = 0xff42;\n t.bobaimaithai = 0x0e1a;\n t.bohiragana = 0x307c;\n t.bokatakana = 0x30dc;\n t.bparen = 0x249d;\n t.bqsquare = 0x33c3;\n t.braceex = 0xf8f4;\n t.braceleft = 0x007b;\n t.braceleftbt = 0xf8f3;\n t.braceleftmid = 0xf8f2;\n t.braceleftmonospace = 0xff5b;\n t.braceleftsmall = 0xfe5b;\n t.bracelefttp = 0xf8f1;\n t.braceleftvertical = 0xfe37;\n t.braceright = 0x007d;\n t.bracerightbt = 0xf8fe;\n t.bracerightmid = 0xf8fd;\n t.bracerightmonospace = 0xff5d;\n t.bracerightsmall = 0xfe5c;\n t.bracerighttp = 0xf8fc;\n t.bracerightvertical = 0xfe38;\n t.bracketleft = 0x005b;\n t.bracketleftbt = 0xf8f0;\n t.bracketleftex = 0xf8ef;\n t.bracketleftmonospace = 0xff3b;\n t.bracketlefttp = 0xf8ee;\n t.bracketright = 0x005d;\n t.bracketrightbt = 0xf8fb;\n t.bracketrightex = 0xf8fa;\n t.bracketrightmonospace = 0xff3d;\n t.bracketrighttp = 0xf8f9;\n t.breve = 0x02d8;\n t.brevebelowcmb = 0x032e;\n t.brevecmb = 0x0306;\n t.breveinvertedbelowcmb = 0x032f;\n t.breveinvertedcmb = 0x0311;\n t.breveinverteddoublecmb = 0x0361;\n t.bridgebelowcmb = 0x032a;\n t.bridgeinvertedbelowcmb = 0x033a;\n t.brokenbar = 0x00a6;\n t.bstroke = 0x0180;\n t.bsuperior = 0xf6ea;\n t.btopbar = 0x0183;\n t.buhiragana = 0x3076;\n t.bukatakana = 0x30d6;\n t.bullet = 0x2022;\n t.bulletinverse = 0x25d8;\n t.bulletoperator = 0x2219;\n t.bullseye = 0x25ce;\n t.c = 0x0063;\n t.caarmenian = 0x056e;\n t.cabengali = 0x099a;\n t.cacute = 0x0107;\n t.cadeva = 0x091a;\n t.cagujarati = 0x0a9a;\n t.cagurmukhi = 0x0a1a;\n t.calsquare = 0x3388;\n t.candrabindubengali = 0x0981;\n t.candrabinducmb = 0x0310;\n t.candrabindudeva = 0x0901;\n t.candrabindugujarati = 0x0a81;\n t.capslock = 0x21ea;\n t.careof = 0x2105;\n t.caron = 0x02c7;\n t.caronbelowcmb = 0x032c;\n t.caroncmb = 0x030c;\n t.carriagereturn = 0x21b5;\n t.cbopomofo = 0x3118;\n t.ccaron = 0x010d;\n t.ccedilla = 0x00e7;\n t.ccedillaacute = 0x1e09;\n t.ccircle = 0x24d2;\n t.ccircumflex = 0x0109;\n t.ccurl = 0x0255;\n t.cdot = 0x010b;\n t.cdotaccent = 0x010b;\n t.cdsquare = 0x33c5;\n t.cedilla = 0x00b8;\n t.cedillacmb = 0x0327;\n t.cent = 0x00a2;\n t.centigrade = 0x2103;\n t.centinferior = 0xf6df;\n t.centmonospace = 0xffe0;\n t.centoldstyle = 0xf7a2;\n t.centsuperior = 0xf6e0;\n t.chaarmenian = 0x0579;\n t.chabengali = 0x099b;\n t.chadeva = 0x091b;\n t.chagujarati = 0x0a9b;\n t.chagurmukhi = 0x0a1b;\n t.chbopomofo = 0x3114;\n t.cheabkhasiancyrillic = 0x04bd;\n t.checkmark = 0x2713;\n t.checyrillic = 0x0447;\n t.chedescenderabkhasiancyrillic = 0x04bf;\n t.chedescendercyrillic = 0x04b7;\n t.chedieresiscyrillic = 0x04f5;\n t.cheharmenian = 0x0573;\n t.chekhakassiancyrillic = 0x04cc;\n t.cheverticalstrokecyrillic = 0x04b9;\n t.chi = 0x03c7;\n t.chieuchacirclekorean = 0x3277;\n t.chieuchaparenkorean = 0x3217;\n t.chieuchcirclekorean = 0x3269;\n t.chieuchkorean = 0x314a;\n t.chieuchparenkorean = 0x3209;\n t.chochangthai = 0x0e0a;\n t.chochanthai = 0x0e08;\n t.chochingthai = 0x0e09;\n t.chochoethai = 0x0e0c;\n t.chook = 0x0188;\n t.cieucacirclekorean = 0x3276;\n t.cieucaparenkorean = 0x3216;\n t.cieuccirclekorean = 0x3268;\n t.cieuckorean = 0x3148;\n t.cieucparenkorean = 0x3208;\n t.cieucuparenkorean = 0x321c;\n t.circle = 0x25cb;\n t.circlecopyrt = 0x00a9; // Glyph is missing from Adobe's original list.\n t.circlemultiply = 0x2297;\n t.circleot = 0x2299;\n t.circleplus = 0x2295;\n t.circlepostalmark = 0x3036;\n t.circlewithlefthalfblack = 0x25d0;\n t.circlewithrighthalfblack = 0x25d1;\n t.circumflex = 0x02c6;\n t.circumflexbelowcmb = 0x032d;\n t.circumflexcmb = 0x0302;\n t.clear = 0x2327;\n t.clickalveolar = 0x01c2;\n t.clickdental = 0x01c0;\n t.clicklateral = 0x01c1;\n t.clickretroflex = 0x01c3;\n t.club = 0x2663;\n t.clubsuitblack = 0x2663;\n t.clubsuitwhite = 0x2667;\n t.cmcubedsquare = 0x33a4;\n t.cmonospace = 0xff43;\n t.cmsquaredsquare = 0x33a0;\n t.coarmenian = 0x0581;\n t.colon = 0x003a;\n t.colonmonetary = 0x20a1;\n t.colonmonospace = 0xff1a;\n t.colonsign = 0x20a1;\n t.colonsmall = 0xfe55;\n t.colontriangularhalfmod = 0x02d1;\n t.colontriangularmod = 0x02d0;\n t.comma = 0x002c;\n t.commaabovecmb = 0x0313;\n t.commaaboverightcmb = 0x0315;\n t.commaaccent = 0xf6c3;\n t.commaarabic = 0x060c;\n t.commaarmenian = 0x055d;\n t.commainferior = 0xf6e1;\n t.commamonospace = 0xff0c;\n t.commareversedabovecmb = 0x0314;\n t.commareversedmod = 0x02bd;\n t.commasmall = 0xfe50;\n t.commasuperior = 0xf6e2;\n t.commaturnedabovecmb = 0x0312;\n t.commaturnedmod = 0x02bb;\n t.compass = 0x263c;\n t.congruent = 0x2245;\n t.contourintegral = 0x222e;\n t.control = 0x2303;\n t.controlACK = 0x0006;\n t.controlBEL = 0x0007;\n t.controlBS = 0x0008;\n t.controlCAN = 0x0018;\n t.controlCR = 0x000d;\n t.controlDC1 = 0x0011;\n t.controlDC2 = 0x0012;\n t.controlDC3 = 0x0013;\n t.controlDC4 = 0x0014;\n t.controlDEL = 0x007f;\n t.controlDLE = 0x0010;\n t.controlEM = 0x0019;\n t.controlENQ = 0x0005;\n t.controlEOT = 0x0004;\n t.controlESC = 0x001b;\n t.controlETB = 0x0017;\n t.controlETX = 0x0003;\n t.controlFF = 0x000c;\n t.controlFS = 0x001c;\n t.controlGS = 0x001d;\n t.controlHT = 0x0009;\n t.controlLF = 0x000a;\n t.controlNAK = 0x0015;\n t.controlNULL = 0x0000; // Glyph is missing from Adobe's original list.\n t.controlRS = 0x001e;\n t.controlSI = 0x000f;\n t.controlSO = 0x000e;\n t.controlSOT = 0x0002;\n t.controlSTX = 0x0001;\n t.controlSUB = 0x001a;\n t.controlSYN = 0x0016;\n t.controlUS = 0x001f;\n t.controlVT = 0x000b;\n t.copyright = 0x00a9;\n t.copyrightsans = 0xf8e9;\n t.copyrightserif = 0xf6d9;\n t.cornerbracketleft = 0x300c;\n t.cornerbracketlefthalfwidth = 0xff62;\n t.cornerbracketleftvertical = 0xfe41;\n t.cornerbracketright = 0x300d;\n t.cornerbracketrighthalfwidth = 0xff63;\n t.cornerbracketrightvertical = 0xfe42;\n t.corporationsquare = 0x337f;\n t.cosquare = 0x33c7;\n t.coverkgsquare = 0x33c6;\n t.cparen = 0x249e;\n t.cruzeiro = 0x20a2;\n t.cstretched = 0x0297;\n t.curlyand = 0x22cf;\n t.curlyor = 0x22ce;\n t.currency = 0x00a4;\n t.cyrBreve = 0xf6d1;\n t.cyrFlex = 0xf6d2;\n t.cyrbreve = 0xf6d4;\n t.cyrflex = 0xf6d5;\n t.d = 0x0064;\n t.daarmenian = 0x0564;\n t.dabengali = 0x09a6;\n t.dadarabic = 0x0636;\n t.dadeva = 0x0926;\n t.dadfinalarabic = 0xfebe;\n t.dadinitialarabic = 0xfebf;\n t.dadmedialarabic = 0xfec0;\n t.dagesh = 0x05bc;\n t.dageshhebrew = 0x05bc;\n t.dagger = 0x2020;\n t.daggerdbl = 0x2021;\n t.dagujarati = 0x0aa6;\n t.dagurmukhi = 0x0a26;\n t.dahiragana = 0x3060;\n t.dakatakana = 0x30c0;\n t.dalarabic = 0x062f;\n t.dalet = 0x05d3;\n t.daletdagesh = 0xfb33;\n t.daletdageshhebrew = 0xfb33;\n t.dalethebrew = 0x05d3;\n t.dalfinalarabic = 0xfeaa;\n t.dammaarabic = 0x064f;\n t.dammalowarabic = 0x064f;\n t.dammatanaltonearabic = 0x064c;\n t.dammatanarabic = 0x064c;\n t.danda = 0x0964;\n t.dargahebrew = 0x05a7;\n t.dargalefthebrew = 0x05a7;\n t.dasiapneumatacyrilliccmb = 0x0485;\n t.dblGrave = 0xf6d3;\n t.dblanglebracketleft = 0x300a;\n t.dblanglebracketleftvertical = 0xfe3d;\n t.dblanglebracketright = 0x300b;\n t.dblanglebracketrightvertical = 0xfe3e;\n t.dblarchinvertedbelowcmb = 0x032b;\n t.dblarrowleft = 0x21d4;\n t.dblarrowright = 0x21d2;\n t.dbldanda = 0x0965;\n t.dblgrave = 0xf6d6;\n t.dblgravecmb = 0x030f;\n t.dblintegral = 0x222c;\n t.dbllowline = 0x2017;\n t.dbllowlinecmb = 0x0333;\n t.dbloverlinecmb = 0x033f;\n t.dblprimemod = 0x02ba;\n t.dblverticalbar = 0x2016;\n t.dblverticallineabovecmb = 0x030e;\n t.dbopomofo = 0x3109;\n t.dbsquare = 0x33c8;\n t.dcaron = 0x010f;\n t.dcedilla = 0x1e11;\n t.dcircle = 0x24d3;\n t.dcircumflexbelow = 0x1e13;\n t.dcroat = 0x0111;\n t.ddabengali = 0x09a1;\n t.ddadeva = 0x0921;\n t.ddagujarati = 0x0aa1;\n t.ddagurmukhi = 0x0a21;\n t.ddalarabic = 0x0688;\n t.ddalfinalarabic = 0xfb89;\n t.dddhadeva = 0x095c;\n t.ddhabengali = 0x09a2;\n t.ddhadeva = 0x0922;\n t.ddhagujarati = 0x0aa2;\n t.ddhagurmukhi = 0x0a22;\n t.ddotaccent = 0x1e0b;\n t.ddotbelow = 0x1e0d;\n t.decimalseparatorarabic = 0x066b;\n t.decimalseparatorpersian = 0x066b;\n t.decyrillic = 0x0434;\n t.degree = 0x00b0;\n t.dehihebrew = 0x05ad;\n t.dehiragana = 0x3067;\n t.deicoptic = 0x03ef;\n t.dekatakana = 0x30c7;\n t.deleteleft = 0x232b;\n t.deleteright = 0x2326;\n t.delta = 0x03b4;\n t.deltaturned = 0x018d;\n t.denominatorminusonenumeratorbengali = 0x09f8;\n t.dezh = 0x02a4;\n t.dhabengali = 0x09a7;\n t.dhadeva = 0x0927;\n t.dhagujarati = 0x0aa7;\n t.dhagurmukhi = 0x0a27;\n t.dhook = 0x0257;\n t.dialytikatonos = 0x0385;\n t.dialytikatonoscmb = 0x0344;\n t.diamond = 0x2666;\n t.diamondsuitwhite = 0x2662;\n t.dieresis = 0x00a8;\n t.dieresisacute = 0xf6d7;\n t.dieresisbelowcmb = 0x0324;\n t.dieresiscmb = 0x0308;\n t.dieresisgrave = 0xf6d8;\n t.dieresistonos = 0x0385;\n t.dihiragana = 0x3062;\n t.dikatakana = 0x30c2;\n t.dittomark = 0x3003;\n t.divide = 0x00f7;\n t.divides = 0x2223;\n t.divisionslash = 0x2215;\n t.djecyrillic = 0x0452;\n t.dkshade = 0x2593;\n t.dlinebelow = 0x1e0f;\n t.dlsquare = 0x3397;\n t.dmacron = 0x0111;\n t.dmonospace = 0xff44;\n t.dnblock = 0x2584;\n t.dochadathai = 0x0e0e;\n t.dodekthai = 0x0e14;\n t.dohiragana = 0x3069;\n t.dokatakana = 0x30c9;\n t.dollar = 0x0024;\n t.dollarinferior = 0xf6e3;\n t.dollarmonospace = 0xff04;\n t.dollaroldstyle = 0xf724;\n t.dollarsmall = 0xfe69;\n t.dollarsuperior = 0xf6e4;\n t.dong = 0x20ab;\n t.dorusquare = 0x3326;\n t.dotaccent = 0x02d9;\n t.dotaccentcmb = 0x0307;\n t.dotbelowcmb = 0x0323;\n t.dotbelowcomb = 0x0323;\n t.dotkatakana = 0x30fb;\n t.dotlessi = 0x0131;\n t.dotlessj = 0xf6be;\n t.dotlessjstrokehook = 0x0284;\n t.dotmath = 0x22c5;\n t.dottedcircle = 0x25cc;\n t.doubleyodpatah = 0xfb1f;\n t.doubleyodpatahhebrew = 0xfb1f;\n t.downtackbelowcmb = 0x031e;\n t.downtackmod = 0x02d5;\n t.dparen = 0x249f;\n t.dsuperior = 0xf6eb;\n t.dtail = 0x0256;\n t.dtopbar = 0x018c;\n t.duhiragana = 0x3065;\n t.dukatakana = 0x30c5;\n t.dz = 0x01f3;\n t.dzaltone = 0x02a3;\n t.dzcaron = 0x01c6;\n t.dzcurl = 0x02a5;\n t.dzeabkhasiancyrillic = 0x04e1;\n t.dzecyrillic = 0x0455;\n t.dzhecyrillic = 0x045f;\n t.e = 0x0065;\n t.eacute = 0x00e9;\n t.earth = 0x2641;\n t.ebengali = 0x098f;\n t.ebopomofo = 0x311c;\n t.ebreve = 0x0115;\n t.ecandradeva = 0x090d;\n t.ecandragujarati = 0x0a8d;\n t.ecandravowelsigndeva = 0x0945;\n t.ecandravowelsigngujarati = 0x0ac5;\n t.ecaron = 0x011b;\n t.ecedillabreve = 0x1e1d;\n t.echarmenian = 0x0565;\n t.echyiwnarmenian = 0x0587;\n t.ecircle = 0x24d4;\n t.ecircumflex = 0x00ea;\n t.ecircumflexacute = 0x1ebf;\n t.ecircumflexbelow = 0x1e19;\n t.ecircumflexdotbelow = 0x1ec7;\n t.ecircumflexgrave = 0x1ec1;\n t.ecircumflexhookabove = 0x1ec3;\n t.ecircumflextilde = 0x1ec5;\n t.ecyrillic = 0x0454;\n t.edblgrave = 0x0205;\n t.edeva = 0x090f;\n t.edieresis = 0x00eb;\n t.edot = 0x0117;\n t.edotaccent = 0x0117;\n t.edotbelow = 0x1eb9;\n t.eegurmukhi = 0x0a0f;\n t.eematragurmukhi = 0x0a47;\n t.efcyrillic = 0x0444;\n t.egrave = 0x00e8;\n t.egujarati = 0x0a8f;\n t.eharmenian = 0x0567;\n t.ehbopomofo = 0x311d;\n t.ehiragana = 0x3048;\n t.ehookabove = 0x1ebb;\n t.eibopomofo = 0x311f;\n t.eight = 0x0038;\n t.eightarabic = 0x0668;\n t.eightbengali = 0x09ee;\n t.eightcircle = 0x2467;\n t.eightcircleinversesansserif = 0x2791;\n t.eightdeva = 0x096e;\n t.eighteencircle = 0x2471;\n t.eighteenparen = 0x2485;\n t.eighteenperiod = 0x2499;\n t.eightgujarati = 0x0aee;\n t.eightgurmukhi = 0x0a6e;\n t.eighthackarabic = 0x0668;\n t.eighthangzhou = 0x3028;\n t.eighthnotebeamed = 0x266b;\n t.eightideographicparen = 0x3227;\n t.eightinferior = 0x2088;\n t.eightmonospace = 0xff18;\n t.eightoldstyle = 0xf738;\n t.eightparen = 0x247b;\n t.eightperiod = 0x248f;\n t.eightpersian = 0x06f8;\n t.eightroman = 0x2177;\n t.eightsuperior = 0x2078;\n t.eightthai = 0x0e58;\n t.einvertedbreve = 0x0207;\n t.eiotifiedcyrillic = 0x0465;\n t.ekatakana = 0x30a8;\n t.ekatakanahalfwidth = 0xff74;\n t.ekonkargurmukhi = 0x0a74;\n t.ekorean = 0x3154;\n t.elcyrillic = 0x043b;\n t.element = 0x2208;\n t.elevencircle = 0x246a;\n t.elevenparen = 0x247e;\n t.elevenperiod = 0x2492;\n t.elevenroman = 0x217a;\n t.ellipsis = 0x2026;\n t.ellipsisvertical = 0x22ee;\n t.emacron = 0x0113;\n t.emacronacute = 0x1e17;\n t.emacrongrave = 0x1e15;\n t.emcyrillic = 0x043c;\n t.emdash = 0x2014;\n t.emdashvertical = 0xfe31;\n t.emonospace = 0xff45;\n t.emphasismarkarmenian = 0x055b;\n t.emptyset = 0x2205;\n t.enbopomofo = 0x3123;\n t.encyrillic = 0x043d;\n t.endash = 0x2013;\n t.endashvertical = 0xfe32;\n t.endescendercyrillic = 0x04a3;\n t.eng = 0x014b;\n t.engbopomofo = 0x3125;\n t.enghecyrillic = 0x04a5;\n t.enhookcyrillic = 0x04c8;\n t.enspace = 0x2002;\n t.eogonek = 0x0119;\n t.eokorean = 0x3153;\n t.eopen = 0x025b;\n t.eopenclosed = 0x029a;\n t.eopenreversed = 0x025c;\n t.eopenreversedclosed = 0x025e;\n t.eopenreversedhook = 0x025d;\n t.eparen = 0x24a0;\n t.epsilon = 0x03b5;\n t.epsilontonos = 0x03ad;\n t.equal = 0x003d;\n t.equalmonospace = 0xff1d;\n t.equalsmall = 0xfe66;\n t.equalsuperior = 0x207c;\n t.equivalence = 0x2261;\n t.erbopomofo = 0x3126;\n t.ercyrillic = 0x0440;\n t.ereversed = 0x0258;\n t.ereversedcyrillic = 0x044d;\n t.escyrillic = 0x0441;\n t.esdescendercyrillic = 0x04ab;\n t.esh = 0x0283;\n t.eshcurl = 0x0286;\n t.eshortdeva = 0x090e;\n t.eshortvowelsigndeva = 0x0946;\n t.eshreversedloop = 0x01aa;\n t.eshsquatreversed = 0x0285;\n t.esmallhiragana = 0x3047;\n t.esmallkatakana = 0x30a7;\n t.esmallkatakanahalfwidth = 0xff6a;\n t.estimated = 0x212e;\n t.esuperior = 0xf6ec;\n t.eta = 0x03b7;\n t.etarmenian = 0x0568;\n t.etatonos = 0x03ae;\n t.eth = 0x00f0;\n t.etilde = 0x1ebd;\n t.etildebelow = 0x1e1b;\n t.etnahtafoukhhebrew = 0x0591;\n t.etnahtafoukhlefthebrew = 0x0591;\n t.etnahtahebrew = 0x0591;\n t.etnahtalefthebrew = 0x0591;\n t.eturned = 0x01dd;\n t.eukorean = 0x3161;\n t.euro = 0x20ac;\n t.evowelsignbengali = 0x09c7;\n t.evowelsigndeva = 0x0947;\n t.evowelsigngujarati = 0x0ac7;\n t.exclam = 0x0021;\n t.exclamarmenian = 0x055c;\n t.exclamdbl = 0x203c;\n t.exclamdown = 0x00a1;\n t.exclamdownsmall = 0xf7a1;\n t.exclammonospace = 0xff01;\n t.exclamsmall = 0xf721;\n t.existential = 0x2203;\n t.ezh = 0x0292;\n t.ezhcaron = 0x01ef;\n t.ezhcurl = 0x0293;\n t.ezhreversed = 0x01b9;\n t.ezhtail = 0x01ba;\n t.f = 0x0066;\n t.fadeva = 0x095e;\n t.fagurmukhi = 0x0a5e;\n t.fahrenheit = 0x2109;\n t.fathaarabic = 0x064e;\n t.fathalowarabic = 0x064e;\n t.fathatanarabic = 0x064b;\n t.fbopomofo = 0x3108;\n t.fcircle = 0x24d5;\n t.fdotaccent = 0x1e1f;\n t.feharabic = 0x0641;\n t.feharmenian = 0x0586;\n t.fehfinalarabic = 0xfed2;\n t.fehinitialarabic = 0xfed3;\n t.fehmedialarabic = 0xfed4;\n t.feicoptic = 0x03e5;\n t.female = 0x2640;\n t.ff = 0xfb00;\n t.f_f = 0xfb00;\n t.ffi = 0xfb03;\n t.f_f_i = 0xfb03;\n t.ffl = 0xfb04;\n t.f_f_l = 0xfb04;\n t.fi = 0xfb01;\n t.f_i = 0xfb01;\n t.fifteencircle = 0x246e;\n t.fifteenparen = 0x2482;\n t.fifteenperiod = 0x2496;\n t.figuredash = 0x2012;\n t.filledbox = 0x25a0;\n t.filledrect = 0x25ac;\n t.finalkaf = 0x05da;\n t.finalkafdagesh = 0xfb3a;\n t.finalkafdageshhebrew = 0xfb3a;\n t.finalkafhebrew = 0x05da;\n t.finalmem = 0x05dd;\n t.finalmemhebrew = 0x05dd;\n t.finalnun = 0x05df;\n t.finalnunhebrew = 0x05df;\n t.finalpe = 0x05e3;\n t.finalpehebrew = 0x05e3;\n t.finaltsadi = 0x05e5;\n t.finaltsadihebrew = 0x05e5;\n t.firsttonechinese = 0x02c9;\n t.fisheye = 0x25c9;\n t.fitacyrillic = 0x0473;\n t.five = 0x0035;\n t.fivearabic = 0x0665;\n t.fivebengali = 0x09eb;\n t.fivecircle = 0x2464;\n t.fivecircleinversesansserif = 0x278e;\n t.fivedeva = 0x096b;\n t.fiveeighths = 0x215d;\n t.fivegujarati = 0x0aeb;\n t.fivegurmukhi = 0x0a6b;\n t.fivehackarabic = 0x0665;\n t.fivehangzhou = 0x3025;\n t.fiveideographicparen = 0x3224;\n t.fiveinferior = 0x2085;\n t.fivemonospace = 0xff15;\n t.fiveoldstyle = 0xf735;\n t.fiveparen = 0x2478;\n t.fiveperiod = 0x248c;\n t.fivepersian = 0x06f5;\n t.fiveroman = 0x2174;\n t.fivesuperior = 0x2075;\n t.fivethai = 0x0e55;\n t.fl = 0xfb02;\n t.f_l = 0xfb02;\n t.florin = 0x0192;\n t.fmonospace = 0xff46;\n t.fmsquare = 0x3399;\n t.fofanthai = 0x0e1f;\n t.fofathai = 0x0e1d;\n t.fongmanthai = 0x0e4f;\n t.forall = 0x2200;\n t.four = 0x0034;\n t.fourarabic = 0x0664;\n t.fourbengali = 0x09ea;\n t.fourcircle = 0x2463;\n t.fourcircleinversesansserif = 0x278d;\n t.fourdeva = 0x096a;\n t.fourgujarati = 0x0aea;\n t.fourgurmukhi = 0x0a6a;\n t.fourhackarabic = 0x0664;\n t.fourhangzhou = 0x3024;\n t.fourideographicparen = 0x3223;\n t.fourinferior = 0x2084;\n t.fourmonospace = 0xff14;\n t.fournumeratorbengali = 0x09f7;\n t.fouroldstyle = 0xf734;\n t.fourparen = 0x2477;\n t.fourperiod = 0x248b;\n t.fourpersian = 0x06f4;\n t.fourroman = 0x2173;\n t.foursuperior = 0x2074;\n t.fourteencircle = 0x246d;\n t.fourteenparen = 0x2481;\n t.fourteenperiod = 0x2495;\n t.fourthai = 0x0e54;\n t.fourthtonechinese = 0x02cb;\n t.fparen = 0x24a1;\n t.fraction = 0x2044;\n t.franc = 0x20a3;\n t.g = 0x0067;\n t.gabengali = 0x0997;\n t.gacute = 0x01f5;\n t.gadeva = 0x0917;\n t.gafarabic = 0x06af;\n t.gaffinalarabic = 0xfb93;\n t.gafinitialarabic = 0xfb94;\n t.gafmedialarabic = 0xfb95;\n t.gagujarati = 0x0a97;\n t.gagurmukhi = 0x0a17;\n t.gahiragana = 0x304c;\n t.gakatakana = 0x30ac;\n t.gamma = 0x03b3;\n t.gammalatinsmall = 0x0263;\n t.gammasuperior = 0x02e0;\n t.gangiacoptic = 0x03eb;\n t.gbopomofo = 0x310d;\n t.gbreve = 0x011f;\n t.gcaron = 0x01e7;\n t.gcedilla = 0x0123;\n t.gcircle = 0x24d6;\n t.gcircumflex = 0x011d;\n t.gcommaaccent = 0x0123;\n t.gdot = 0x0121;\n t.gdotaccent = 0x0121;\n t.gecyrillic = 0x0433;\n t.gehiragana = 0x3052;\n t.gekatakana = 0x30b2;\n t.geometricallyequal = 0x2251;\n t.gereshaccenthebrew = 0x059c;\n t.gereshhebrew = 0x05f3;\n t.gereshmuqdamhebrew = 0x059d;\n t.germandbls = 0x00df;\n t.gershayimaccenthebrew = 0x059e;\n t.gershayimhebrew = 0x05f4;\n t.getamark = 0x3013;\n t.ghabengali = 0x0998;\n t.ghadarmenian = 0x0572;\n t.ghadeva = 0x0918;\n t.ghagujarati = 0x0a98;\n t.ghagurmukhi = 0x0a18;\n t.ghainarabic = 0x063a;\n t.ghainfinalarabic = 0xfece;\n t.ghaininitialarabic = 0xfecf;\n t.ghainmedialarabic = 0xfed0;\n t.ghemiddlehookcyrillic = 0x0495;\n t.ghestrokecyrillic = 0x0493;\n t.gheupturncyrillic = 0x0491;\n t.ghhadeva = 0x095a;\n t.ghhagurmukhi = 0x0a5a;\n t.ghook = 0x0260;\n t.ghzsquare = 0x3393;\n t.gihiragana = 0x304e;\n t.gikatakana = 0x30ae;\n t.gimarmenian = 0x0563;\n t.gimel = 0x05d2;\n t.gimeldagesh = 0xfb32;\n t.gimeldageshhebrew = 0xfb32;\n t.gimelhebrew = 0x05d2;\n t.gjecyrillic = 0x0453;\n t.glottalinvertedstroke = 0x01be;\n t.glottalstop = 0x0294;\n t.glottalstopinverted = 0x0296;\n t.glottalstopmod = 0x02c0;\n t.glottalstopreversed = 0x0295;\n t.glottalstopreversedmod = 0x02c1;\n t.glottalstopreversedsuperior = 0x02e4;\n t.glottalstopstroke = 0x02a1;\n t.glottalstopstrokereversed = 0x02a2;\n t.gmacron = 0x1e21;\n t.gmonospace = 0xff47;\n t.gohiragana = 0x3054;\n t.gokatakana = 0x30b4;\n t.gparen = 0x24a2;\n t.gpasquare = 0x33ac;\n t.gradient = 0x2207;\n t.grave = 0x0060;\n t.gravebelowcmb = 0x0316;\n t.gravecmb = 0x0300;\n t.gravecomb = 0x0300;\n t.gravedeva = 0x0953;\n t.gravelowmod = 0x02ce;\n t.gravemonospace = 0xff40;\n t.gravetonecmb = 0x0340;\n t.greater = 0x003e;\n t.greaterequal = 0x2265;\n t.greaterequalorless = 0x22db;\n t.greatermonospace = 0xff1e;\n t.greaterorequivalent = 0x2273;\n t.greaterorless = 0x2277;\n t.greateroverequal = 0x2267;\n t.greatersmall = 0xfe65;\n t.gscript = 0x0261;\n t.gstroke = 0x01e5;\n t.guhiragana = 0x3050;\n t.guillemotleft = 0x00ab;\n t.guillemotright = 0x00bb;\n t.guilsinglleft = 0x2039;\n t.guilsinglright = 0x203a;\n t.gukatakana = 0x30b0;\n t.guramusquare = 0x3318;\n t.gysquare = 0x33c9;\n t.h = 0x0068;\n t.haabkhasiancyrillic = 0x04a9;\n t.haaltonearabic = 0x06c1;\n t.habengali = 0x09b9;\n t.hadescendercyrillic = 0x04b3;\n t.hadeva = 0x0939;\n t.hagujarati = 0x0ab9;\n t.hagurmukhi = 0x0a39;\n t.haharabic = 0x062d;\n t.hahfinalarabic = 0xfea2;\n t.hahinitialarabic = 0xfea3;\n t.hahiragana = 0x306f;\n t.hahmedialarabic = 0xfea4;\n t.haitusquare = 0x332a;\n t.hakatakana = 0x30cf;\n t.hakatakanahalfwidth = 0xff8a;\n t.halantgurmukhi = 0x0a4d;\n t.hamzaarabic = 0x0621;\n t.hamzalowarabic = 0x0621;\n t.hangulfiller = 0x3164;\n t.hardsigncyrillic = 0x044a;\n t.harpoonleftbarbup = 0x21bc;\n t.harpoonrightbarbup = 0x21c0;\n t.hasquare = 0x33ca;\n t.hatafpatah = 0x05b2;\n t.hatafpatah16 = 0x05b2;\n t.hatafpatah23 = 0x05b2;\n t.hatafpatah2f = 0x05b2;\n t.hatafpatahhebrew = 0x05b2;\n t.hatafpatahnarrowhebrew = 0x05b2;\n t.hatafpatahquarterhebrew = 0x05b2;\n t.hatafpatahwidehebrew = 0x05b2;\n t.hatafqamats = 0x05b3;\n t.hatafqamats1b = 0x05b3;\n t.hatafqamats28 = 0x05b3;\n t.hatafqamats34 = 0x05b3;\n t.hatafqamatshebrew = 0x05b3;\n t.hatafqamatsnarrowhebrew = 0x05b3;\n t.hatafqamatsquarterhebrew = 0x05b3;\n t.hatafqamatswidehebrew = 0x05b3;\n t.hatafsegol = 0x05b1;\n t.hatafsegol17 = 0x05b1;\n t.hatafsegol24 = 0x05b1;\n t.hatafsegol30 = 0x05b1;\n t.hatafsegolhebrew = 0x05b1;\n t.hatafsegolnarrowhebrew = 0x05b1;\n t.hatafsegolquarterhebrew = 0x05b1;\n t.hatafsegolwidehebrew = 0x05b1;\n t.hbar = 0x0127;\n t.hbopomofo = 0x310f;\n t.hbrevebelow = 0x1e2b;\n t.hcedilla = 0x1e29;\n t.hcircle = 0x24d7;\n t.hcircumflex = 0x0125;\n t.hdieresis = 0x1e27;\n t.hdotaccent = 0x1e23;\n t.hdotbelow = 0x1e25;\n t.he = 0x05d4;\n t.heart = 0x2665;\n t.heartsuitblack = 0x2665;\n t.heartsuitwhite = 0x2661;\n t.hedagesh = 0xfb34;\n t.hedageshhebrew = 0xfb34;\n t.hehaltonearabic = 0x06c1;\n t.heharabic = 0x0647;\n t.hehebrew = 0x05d4;\n t.hehfinalaltonearabic = 0xfba7;\n t.hehfinalalttwoarabic = 0xfeea;\n t.hehfinalarabic = 0xfeea;\n t.hehhamzaabovefinalarabic = 0xfba5;\n t.hehhamzaaboveisolatedarabic = 0xfba4;\n t.hehinitialaltonearabic = 0xfba8;\n t.hehinitialarabic = 0xfeeb;\n t.hehiragana = 0x3078;\n t.hehmedialaltonearabic = 0xfba9;\n t.hehmedialarabic = 0xfeec;\n t.heiseierasquare = 0x337b;\n t.hekatakana = 0x30d8;\n t.hekatakanahalfwidth = 0xff8d;\n t.hekutaarusquare = 0x3336;\n t.henghook = 0x0267;\n t.herutusquare = 0x3339;\n t.het = 0x05d7;\n t.hethebrew = 0x05d7;\n t.hhook = 0x0266;\n t.hhooksuperior = 0x02b1;\n t.hieuhacirclekorean = 0x327b;\n t.hieuhaparenkorean = 0x321b;\n t.hieuhcirclekorean = 0x326d;\n t.hieuhkorean = 0x314e;\n t.hieuhparenkorean = 0x320d;\n t.hihiragana = 0x3072;\n t.hikatakana = 0x30d2;\n t.hikatakanahalfwidth = 0xff8b;\n t.hiriq = 0x05b4;\n t.hiriq14 = 0x05b4;\n t.hiriq21 = 0x05b4;\n t.hiriq2d = 0x05b4;\n t.hiriqhebrew = 0x05b4;\n t.hiriqnarrowhebrew = 0x05b4;\n t.hiriqquarterhebrew = 0x05b4;\n t.hiriqwidehebrew = 0x05b4;\n t.hlinebelow = 0x1e96;\n t.hmonospace = 0xff48;\n t.hoarmenian = 0x0570;\n t.hohipthai = 0x0e2b;\n t.hohiragana = 0x307b;\n t.hokatakana = 0x30db;\n t.hokatakanahalfwidth = 0xff8e;\n t.holam = 0x05b9;\n t.holam19 = 0x05b9;\n t.holam26 = 0x05b9;\n t.holam32 = 0x05b9;\n t.holamhebrew = 0x05b9;\n t.holamnarrowhebrew = 0x05b9;\n t.holamquarterhebrew = 0x05b9;\n t.holamwidehebrew = 0x05b9;\n t.honokhukthai = 0x0e2e;\n t.hookabovecomb = 0x0309;\n t.hookcmb = 0x0309;\n t.hookpalatalizedbelowcmb = 0x0321;\n t.hookretroflexbelowcmb = 0x0322;\n t.hoonsquare = 0x3342;\n t.horicoptic = 0x03e9;\n t.horizontalbar = 0x2015;\n t.horncmb = 0x031b;\n t.hotsprings = 0x2668;\n t.house = 0x2302;\n t.hparen = 0x24a3;\n t.hsuperior = 0x02b0;\n t.hturned = 0x0265;\n t.huhiragana = 0x3075;\n t.huiitosquare = 0x3333;\n t.hukatakana = 0x30d5;\n t.hukatakanahalfwidth = 0xff8c;\n t.hungarumlaut = 0x02dd;\n t.hungarumlautcmb = 0x030b;\n t.hv = 0x0195;\n t.hyphen = 0x002d;\n t.hypheninferior = 0xf6e5;\n t.hyphenmonospace = 0xff0d;\n t.hyphensmall = 0xfe63;\n t.hyphensuperior = 0xf6e6;\n t.hyphentwo = 0x2010;\n t.i = 0x0069;\n t.iacute = 0x00ed;\n t.iacyrillic = 0x044f;\n t.ibengali = 0x0987;\n t.ibopomofo = 0x3127;\n t.ibreve = 0x012d;\n t.icaron = 0x01d0;\n t.icircle = 0x24d8;\n t.icircumflex = 0x00ee;\n t.icyrillic = 0x0456;\n t.idblgrave = 0x0209;\n t.ideographearthcircle = 0x328f;\n t.ideographfirecircle = 0x328b;\n t.ideographicallianceparen = 0x323f;\n t.ideographiccallparen = 0x323a;\n t.ideographiccentrecircle = 0x32a5;\n t.ideographicclose = 0x3006;\n t.ideographiccomma = 0x3001;\n t.ideographiccommaleft = 0xff64;\n t.ideographiccongratulationparen = 0x3237;\n t.ideographiccorrectcircle = 0x32a3;\n t.ideographicearthparen = 0x322f;\n t.ideographicenterpriseparen = 0x323d;\n t.ideographicexcellentcircle = 0x329d;\n t.ideographicfestivalparen = 0x3240;\n t.ideographicfinancialcircle = 0x3296;\n t.ideographicfinancialparen = 0x3236;\n t.ideographicfireparen = 0x322b;\n t.ideographichaveparen = 0x3232;\n t.ideographichighcircle = 0x32a4;\n t.ideographiciterationmark = 0x3005;\n t.ideographiclaborcircle = 0x3298;\n t.ideographiclaborparen = 0x3238;\n t.ideographicleftcircle = 0x32a7;\n t.ideographiclowcircle = 0x32a6;\n t.ideographicmedicinecircle = 0x32a9;\n t.ideographicmetalparen = 0x322e;\n t.ideographicmoonparen = 0x322a;\n t.ideographicnameparen = 0x3234;\n t.ideographicperiod = 0x3002;\n t.ideographicprintcircle = 0x329e;\n t.ideographicreachparen = 0x3243;\n t.ideographicrepresentparen = 0x3239;\n t.ideographicresourceparen = 0x323e;\n t.ideographicrightcircle = 0x32a8;\n t.ideographicsecretcircle = 0x3299;\n t.ideographicselfparen = 0x3242;\n t.ideographicsocietyparen = 0x3233;\n t.ideographicspace = 0x3000;\n t.ideographicspecialparen = 0x3235;\n t.ideographicstockparen = 0x3231;\n t.ideographicstudyparen = 0x323b;\n t.ideographicsunparen = 0x3230;\n t.ideographicsuperviseparen = 0x323c;\n t.ideographicwaterparen = 0x322c;\n t.ideographicwoodparen = 0x322d;\n t.ideographiczero = 0x3007;\n t.ideographmetalcircle = 0x328e;\n t.ideographmooncircle = 0x328a;\n t.ideographnamecircle = 0x3294;\n t.ideographsuncircle = 0x3290;\n t.ideographwatercircle = 0x328c;\n t.ideographwoodcircle = 0x328d;\n t.ideva = 0x0907;\n t.idieresis = 0x00ef;\n t.idieresisacute = 0x1e2f;\n t.idieresiscyrillic = 0x04e5;\n t.idotbelow = 0x1ecb;\n t.iebrevecyrillic = 0x04d7;\n t.iecyrillic = 0x0435;\n t.ieungacirclekorean = 0x3275;\n t.ieungaparenkorean = 0x3215;\n t.ieungcirclekorean = 0x3267;\n t.ieungkorean = 0x3147;\n t.ieungparenkorean = 0x3207;\n t.igrave = 0x00ec;\n t.igujarati = 0x0a87;\n t.igurmukhi = 0x0a07;\n t.ihiragana = 0x3044;\n t.ihookabove = 0x1ec9;\n t.iibengali = 0x0988;\n t.iicyrillic = 0x0438;\n t.iideva = 0x0908;\n t.iigujarati = 0x0a88;\n t.iigurmukhi = 0x0a08;\n t.iimatragurmukhi = 0x0a40;\n t.iinvertedbreve = 0x020b;\n t.iishortcyrillic = 0x0439;\n t.iivowelsignbengali = 0x09c0;\n t.iivowelsigndeva = 0x0940;\n t.iivowelsigngujarati = 0x0ac0;\n t.ij = 0x0133;\n t.ikatakana = 0x30a4;\n t.ikatakanahalfwidth = 0xff72;\n t.ikorean = 0x3163;\n t.ilde = 0x02dc;\n t.iluyhebrew = 0x05ac;\n t.imacron = 0x012b;\n t.imacroncyrillic = 0x04e3;\n t.imageorapproximatelyequal = 0x2253;\n t.imatragurmukhi = 0x0a3f;\n t.imonospace = 0xff49;\n t.increment = 0x2206;\n t.infinity = 0x221e;\n t.iniarmenian = 0x056b;\n t.integral = 0x222b;\n t.integralbottom = 0x2321;\n t.integralbt = 0x2321;\n t.integralex = 0xf8f5;\n t.integraltop = 0x2320;\n t.integraltp = 0x2320;\n t.intersection = 0x2229;\n t.intisquare = 0x3305;\n t.invbullet = 0x25d8;\n t.invcircle = 0x25d9;\n t.invsmileface = 0x263b;\n t.iocyrillic = 0x0451;\n t.iogonek = 0x012f;\n t.iota = 0x03b9;\n t.iotadieresis = 0x03ca;\n t.iotadieresistonos = 0x0390;\n t.iotalatin = 0x0269;\n t.iotatonos = 0x03af;\n t.iparen = 0x24a4;\n t.irigurmukhi = 0x0a72;\n t.ismallhiragana = 0x3043;\n t.ismallkatakana = 0x30a3;\n t.ismallkatakanahalfwidth = 0xff68;\n t.issharbengali = 0x09fa;\n t.istroke = 0x0268;\n t.isuperior = 0xf6ed;\n t.iterationhiragana = 0x309d;\n t.iterationkatakana = 0x30fd;\n t.itilde = 0x0129;\n t.itildebelow = 0x1e2d;\n t.iubopomofo = 0x3129;\n t.iucyrillic = 0x044e;\n t.ivowelsignbengali = 0x09bf;\n t.ivowelsigndeva = 0x093f;\n t.ivowelsigngujarati = 0x0abf;\n t.izhitsacyrillic = 0x0475;\n t.izhitsadblgravecyrillic = 0x0477;\n t.j = 0x006a;\n t.jaarmenian = 0x0571;\n t.jabengali = 0x099c;\n t.jadeva = 0x091c;\n t.jagujarati = 0x0a9c;\n t.jagurmukhi = 0x0a1c;\n t.jbopomofo = 0x3110;\n t.jcaron = 0x01f0;\n t.jcircle = 0x24d9;\n t.jcircumflex = 0x0135;\n t.jcrossedtail = 0x029d;\n t.jdotlessstroke = 0x025f;\n t.jecyrillic = 0x0458;\n t.jeemarabic = 0x062c;\n t.jeemfinalarabic = 0xfe9e;\n t.jeeminitialarabic = 0xfe9f;\n t.jeemmedialarabic = 0xfea0;\n t.jeharabic = 0x0698;\n t.jehfinalarabic = 0xfb8b;\n t.jhabengali = 0x099d;\n t.jhadeva = 0x091d;\n t.jhagujarati = 0x0a9d;\n t.jhagurmukhi = 0x0a1d;\n t.jheharmenian = 0x057b;\n t.jis = 0x3004;\n t.jmonospace = 0xff4a;\n t.jparen = 0x24a5;\n t.jsuperior = 0x02b2;\n t.k = 0x006b;\n t.kabashkircyrillic = 0x04a1;\n t.kabengali = 0x0995;\n t.kacute = 0x1e31;\n t.kacyrillic = 0x043a;\n t.kadescendercyrillic = 0x049b;\n t.kadeva = 0x0915;\n t.kaf = 0x05db;\n t.kafarabic = 0x0643;\n t.kafdagesh = 0xfb3b;\n t.kafdageshhebrew = 0xfb3b;\n t.kaffinalarabic = 0xfeda;\n t.kafhebrew = 0x05db;\n t.kafinitialarabic = 0xfedb;\n t.kafmedialarabic = 0xfedc;\n t.kafrafehebrew = 0xfb4d;\n t.kagujarati = 0x0a95;\n t.kagurmukhi = 0x0a15;\n t.kahiragana = 0x304b;\n t.kahookcyrillic = 0x04c4;\n t.kakatakana = 0x30ab;\n t.kakatakanahalfwidth = 0xff76;\n t.kappa = 0x03ba;\n t.kappasymbolgreek = 0x03f0;\n t.kapyeounmieumkorean = 0x3171;\n t.kapyeounphieuphkorean = 0x3184;\n t.kapyeounpieupkorean = 0x3178;\n t.kapyeounssangpieupkorean = 0x3179;\n t.karoriisquare = 0x330d;\n t.kashidaautoarabic = 0x0640;\n t.kashidaautonosidebearingarabic = 0x0640;\n t.kasmallkatakana = 0x30f5;\n t.kasquare = 0x3384;\n t.kasraarabic = 0x0650;\n t.kasratanarabic = 0x064d;\n t.kastrokecyrillic = 0x049f;\n t.katahiraprolongmarkhalfwidth = 0xff70;\n t.kaverticalstrokecyrillic = 0x049d;\n t.kbopomofo = 0x310e;\n t.kcalsquare = 0x3389;\n t.kcaron = 0x01e9;\n t.kcedilla = 0x0137;\n t.kcircle = 0x24da;\n t.kcommaaccent = 0x0137;\n t.kdotbelow = 0x1e33;\n t.keharmenian = 0x0584;\n t.kehiragana = 0x3051;\n t.kekatakana = 0x30b1;\n t.kekatakanahalfwidth = 0xff79;\n t.kenarmenian = 0x056f;\n t.kesmallkatakana = 0x30f6;\n t.kgreenlandic = 0x0138;\n t.khabengali = 0x0996;\n t.khacyrillic = 0x0445;\n t.khadeva = 0x0916;\n t.khagujarati = 0x0a96;\n t.khagurmukhi = 0x0a16;\n t.khaharabic = 0x062e;\n t.khahfinalarabic = 0xfea6;\n t.khahinitialarabic = 0xfea7;\n t.khahmedialarabic = 0xfea8;\n t.kheicoptic = 0x03e7;\n t.khhadeva = 0x0959;\n t.khhagurmukhi = 0x0a59;\n t.khieukhacirclekorean = 0x3278;\n t.khieukhaparenkorean = 0x3218;\n t.khieukhcirclekorean = 0x326a;\n t.khieukhkorean = 0x314b;\n t.khieukhparenkorean = 0x320a;\n t.khokhaithai = 0x0e02;\n t.khokhonthai = 0x0e05;\n t.khokhuatthai = 0x0e03;\n t.khokhwaithai = 0x0e04;\n t.khomutthai = 0x0e5b;\n t.khook = 0x0199;\n t.khorakhangthai = 0x0e06;\n t.khzsquare = 0x3391;\n t.kihiragana = 0x304d;\n t.kikatakana = 0x30ad;\n t.kikatakanahalfwidth = 0xff77;\n t.kiroguramusquare = 0x3315;\n t.kiromeetorusquare = 0x3316;\n t.kirosquare = 0x3314;\n t.kiyeokacirclekorean = 0x326e;\n t.kiyeokaparenkorean = 0x320e;\n t.kiyeokcirclekorean = 0x3260;\n t.kiyeokkorean = 0x3131;\n t.kiyeokparenkorean = 0x3200;\n t.kiyeoksioskorean = 0x3133;\n t.kjecyrillic = 0x045c;\n t.klinebelow = 0x1e35;\n t.klsquare = 0x3398;\n t.kmcubedsquare = 0x33a6;\n t.kmonospace = 0xff4b;\n t.kmsquaredsquare = 0x33a2;\n t.kohiragana = 0x3053;\n t.kohmsquare = 0x33c0;\n t.kokaithai = 0x0e01;\n t.kokatakana = 0x30b3;\n t.kokatakanahalfwidth = 0xff7a;\n t.kooposquare = 0x331e;\n t.koppacyrillic = 0x0481;\n t.koreanstandardsymbol = 0x327f;\n t.koroniscmb = 0x0343;\n t.kparen = 0x24a6;\n t.kpasquare = 0x33aa;\n t.ksicyrillic = 0x046f;\n t.ktsquare = 0x33cf;\n t.kturned = 0x029e;\n t.kuhiragana = 0x304f;\n t.kukatakana = 0x30af;\n t.kukatakanahalfwidth = 0xff78;\n t.kvsquare = 0x33b8;\n t.kwsquare = 0x33be;\n t.l = 0x006c;\n t.labengali = 0x09b2;\n t.lacute = 0x013a;\n t.ladeva = 0x0932;\n t.lagujarati = 0x0ab2;\n t.lagurmukhi = 0x0a32;\n t.lakkhangyaothai = 0x0e45;\n t.lamaleffinalarabic = 0xfefc;\n t.lamalefhamzaabovefinalarabic = 0xfef8;\n t.lamalefhamzaaboveisolatedarabic = 0xfef7;\n t.lamalefhamzabelowfinalarabic = 0xfefa;\n t.lamalefhamzabelowisolatedarabic = 0xfef9;\n t.lamalefisolatedarabic = 0xfefb;\n t.lamalefmaddaabovefinalarabic = 0xfef6;\n t.lamalefmaddaaboveisolatedarabic = 0xfef5;\n t.lamarabic = 0x0644;\n t.lambda = 0x03bb;\n t.lambdastroke = 0x019b;\n t.lamed = 0x05dc;\n t.lameddagesh = 0xfb3c;\n t.lameddageshhebrew = 0xfb3c;\n t.lamedhebrew = 0x05dc;\n t.lamfinalarabic = 0xfede;\n t.lamhahinitialarabic = 0xfcca;\n t.laminitialarabic = 0xfedf;\n t.lamjeeminitialarabic = 0xfcc9;\n t.lamkhahinitialarabic = 0xfccb;\n t.lamlamhehisolatedarabic = 0xfdf2;\n t.lammedialarabic = 0xfee0;\n t.lammeemhahinitialarabic = 0xfd88;\n t.lammeeminitialarabic = 0xfccc;\n t.largecircle = 0x25ef;\n t.lbar = 0x019a;\n t.lbelt = 0x026c;\n t.lbopomofo = 0x310c;\n t.lcaron = 0x013e;\n t.lcedilla = 0x013c;\n t.lcircle = 0x24db;\n t.lcircumflexbelow = 0x1e3d;\n t.lcommaaccent = 0x013c;\n t.ldot = 0x0140;\n t.ldotaccent = 0x0140;\n t.ldotbelow = 0x1e37;\n t.ldotbelowmacron = 0x1e39;\n t.leftangleabovecmb = 0x031a;\n t.lefttackbelowcmb = 0x0318;\n t.less = 0x003c;\n t.lessequal = 0x2264;\n t.lessequalorgreater = 0x22da;\n t.lessmonospace = 0xff1c;\n t.lessorequivalent = 0x2272;\n t.lessorgreater = 0x2276;\n t.lessoverequal = 0x2266;\n t.lesssmall = 0xfe64;\n t.lezh = 0x026e;\n t.lfblock = 0x258c;\n t.lhookretroflex = 0x026d;\n t.lira = 0x20a4;\n t.liwnarmenian = 0x056c;\n t.lj = 0x01c9;\n t.ljecyrillic = 0x0459;\n t.ll = 0xf6c0;\n t.lladeva = 0x0933;\n t.llagujarati = 0x0ab3;\n t.llinebelow = 0x1e3b;\n t.llladeva = 0x0934;\n t.llvocalicbengali = 0x09e1;\n t.llvocalicdeva = 0x0961;\n t.llvocalicvowelsignbengali = 0x09e3;\n t.llvocalicvowelsigndeva = 0x0963;\n t.lmiddletilde = 0x026b;\n t.lmonospace = 0xff4c;\n t.lmsquare = 0x33d0;\n t.lochulathai = 0x0e2c;\n t.logicaland = 0x2227;\n t.logicalnot = 0x00ac;\n t.logicalnotreversed = 0x2310;\n t.logicalor = 0x2228;\n t.lolingthai = 0x0e25;\n t.longs = 0x017f;\n t.lowlinecenterline = 0xfe4e;\n t.lowlinecmb = 0x0332;\n t.lowlinedashed = 0xfe4d;\n t.lozenge = 0x25ca;\n t.lparen = 0x24a7;\n t.lslash = 0x0142;\n t.lsquare = 0x2113;\n t.lsuperior = 0xf6ee;\n t.ltshade = 0x2591;\n t.luthai = 0x0e26;\n t.lvocalicbengali = 0x098c;\n t.lvocalicdeva = 0x090c;\n t.lvocalicvowelsignbengali = 0x09e2;\n t.lvocalicvowelsigndeva = 0x0962;\n t.lxsquare = 0x33d3;\n t.m = 0x006d;\n t.mabengali = 0x09ae;\n t.macron = 0x00af;\n t.macronbelowcmb = 0x0331;\n t.macroncmb = 0x0304;\n t.macronlowmod = 0x02cd;\n t.macronmonospace = 0xffe3;\n t.macute = 0x1e3f;\n t.madeva = 0x092e;\n t.magujarati = 0x0aae;\n t.magurmukhi = 0x0a2e;\n t.mahapakhhebrew = 0x05a4;\n t.mahapakhlefthebrew = 0x05a4;\n t.mahiragana = 0x307e;\n t.maichattawalowleftthai = 0xf895;\n t.maichattawalowrightthai = 0xf894;\n t.maichattawathai = 0x0e4b;\n t.maichattawaupperleftthai = 0xf893;\n t.maieklowleftthai = 0xf88c;\n t.maieklowrightthai = 0xf88b;\n t.maiekthai = 0x0e48;\n t.maiekupperleftthai = 0xf88a;\n t.maihanakatleftthai = 0xf884;\n t.maihanakatthai = 0x0e31;\n t.maitaikhuleftthai = 0xf889;\n t.maitaikhuthai = 0x0e47;\n t.maitholowleftthai = 0xf88f;\n t.maitholowrightthai = 0xf88e;\n t.maithothai = 0x0e49;\n t.maithoupperleftthai = 0xf88d;\n t.maitrilowleftthai = 0xf892;\n t.maitrilowrightthai = 0xf891;\n t.maitrithai = 0x0e4a;\n t.maitriupperleftthai = 0xf890;\n t.maiyamokthai = 0x0e46;\n t.makatakana = 0x30de;\n t.makatakanahalfwidth = 0xff8f;\n t.male = 0x2642;\n t.mansyonsquare = 0x3347;\n t.maqafhebrew = 0x05be;\n t.mars = 0x2642;\n t.masoracirclehebrew = 0x05af;\n t.masquare = 0x3383;\n t.mbopomofo = 0x3107;\n t.mbsquare = 0x33d4;\n t.mcircle = 0x24dc;\n t.mcubedsquare = 0x33a5;\n t.mdotaccent = 0x1e41;\n t.mdotbelow = 0x1e43;\n t.meemarabic = 0x0645;\n t.meemfinalarabic = 0xfee2;\n t.meeminitialarabic = 0xfee3;\n t.meemmedialarabic = 0xfee4;\n t.meemmeeminitialarabic = 0xfcd1;\n t.meemmeemisolatedarabic = 0xfc48;\n t.meetorusquare = 0x334d;\n t.mehiragana = 0x3081;\n t.meizierasquare = 0x337e;\n t.mekatakana = 0x30e1;\n t.mekatakanahalfwidth = 0xff92;\n t.mem = 0x05de;\n t.memdagesh = 0xfb3e;\n t.memdageshhebrew = 0xfb3e;\n t.memhebrew = 0x05de;\n t.menarmenian = 0x0574;\n t.merkhahebrew = 0x05a5;\n t.merkhakefulahebrew = 0x05a6;\n t.merkhakefulalefthebrew = 0x05a6;\n t.merkhalefthebrew = 0x05a5;\n t.mhook = 0x0271;\n t.mhzsquare = 0x3392;\n t.middledotkatakanahalfwidth = 0xff65;\n t.middot = 0x00b7;\n t.mieumacirclekorean = 0x3272;\n t.mieumaparenkorean = 0x3212;\n t.mieumcirclekorean = 0x3264;\n t.mieumkorean = 0x3141;\n t.mieumpansioskorean = 0x3170;\n t.mieumparenkorean = 0x3204;\n t.mieumpieupkorean = 0x316e;\n t.mieumsioskorean = 0x316f;\n t.mihiragana = 0x307f;\n t.mikatakana = 0x30df;\n t.mikatakanahalfwidth = 0xff90;\n t.minus = 0x2212;\n t.minusbelowcmb = 0x0320;\n t.minuscircle = 0x2296;\n t.minusmod = 0x02d7;\n t.minusplus = 0x2213;\n t.minute = 0x2032;\n t.miribaarusquare = 0x334a;\n t.mirisquare = 0x3349;\n t.mlonglegturned = 0x0270;\n t.mlsquare = 0x3396;\n t.mmcubedsquare = 0x33a3;\n t.mmonospace = 0xff4d;\n t.mmsquaredsquare = 0x339f;\n t.mohiragana = 0x3082;\n t.mohmsquare = 0x33c1;\n t.mokatakana = 0x30e2;\n t.mokatakanahalfwidth = 0xff93;\n t.molsquare = 0x33d6;\n t.momathai = 0x0e21;\n t.moverssquare = 0x33a7;\n t.moverssquaredsquare = 0x33a8;\n t.mparen = 0x24a8;\n t.mpasquare = 0x33ab;\n t.mssquare = 0x33b3;\n t.msuperior = 0xf6ef;\n t.mturned = 0x026f;\n t.mu = 0x00b5;\n t.mu1 = 0x00b5;\n t.muasquare = 0x3382;\n t.muchgreater = 0x226b;\n t.muchless = 0x226a;\n t.mufsquare = 0x338c;\n t.mugreek = 0x03bc;\n t.mugsquare = 0x338d;\n t.muhiragana = 0x3080;\n t.mukatakana = 0x30e0;\n t.mukatakanahalfwidth = 0xff91;\n t.mulsquare = 0x3395;\n t.multiply = 0x00d7;\n t.mumsquare = 0x339b;\n t.munahhebrew = 0x05a3;\n t.munahlefthebrew = 0x05a3;\n t.musicalnote = 0x266a;\n t.musicalnotedbl = 0x266b;\n t.musicflatsign = 0x266d;\n t.musicsharpsign = 0x266f;\n t.mussquare = 0x33b2;\n t.muvsquare = 0x33b6;\n t.muwsquare = 0x33bc;\n t.mvmegasquare = 0x33b9;\n t.mvsquare = 0x33b7;\n t.mwmegasquare = 0x33bf;\n t.mwsquare = 0x33bd;\n t.n = 0x006e;\n t.nabengali = 0x09a8;\n t.nabla = 0x2207;\n t.nacute = 0x0144;\n t.nadeva = 0x0928;\n t.nagujarati = 0x0aa8;\n t.nagurmukhi = 0x0a28;\n t.nahiragana = 0x306a;\n t.nakatakana = 0x30ca;\n t.nakatakanahalfwidth = 0xff85;\n t.napostrophe = 0x0149;\n t.nasquare = 0x3381;\n t.nbopomofo = 0x310b;\n t.nbspace = 0x00a0;\n t.ncaron = 0x0148;\n t.ncedilla = 0x0146;\n t.ncircle = 0x24dd;\n t.ncircumflexbelow = 0x1e4b;\n t.ncommaaccent = 0x0146;\n t.ndotaccent = 0x1e45;\n t.ndotbelow = 0x1e47;\n t.nehiragana = 0x306d;\n t.nekatakana = 0x30cd;\n t.nekatakanahalfwidth = 0xff88;\n t.newsheqelsign = 0x20aa;\n t.nfsquare = 0x338b;\n t.ngabengali = 0x0999;\n t.ngadeva = 0x0919;\n t.ngagujarati = 0x0a99;\n t.ngagurmukhi = 0x0a19;\n t.ngonguthai = 0x0e07;\n t.nhiragana = 0x3093;\n t.nhookleft = 0x0272;\n t.nhookretroflex = 0x0273;\n t.nieunacirclekorean = 0x326f;\n t.nieunaparenkorean = 0x320f;\n t.nieuncieuckorean = 0x3135;\n t.nieuncirclekorean = 0x3261;\n t.nieunhieuhkorean = 0x3136;\n t.nieunkorean = 0x3134;\n t.nieunpansioskorean = 0x3168;\n t.nieunparenkorean = 0x3201;\n t.nieunsioskorean = 0x3167;\n t.nieuntikeutkorean = 0x3166;\n t.nihiragana = 0x306b;\n t.nikatakana = 0x30cb;\n t.nikatakanahalfwidth = 0xff86;\n t.nikhahitleftthai = 0xf899;\n t.nikhahitthai = 0x0e4d;\n t.nine = 0x0039;\n t.ninearabic = 0x0669;\n t.ninebengali = 0x09ef;\n t.ninecircle = 0x2468;\n t.ninecircleinversesansserif = 0x2792;\n t.ninedeva = 0x096f;\n t.ninegujarati = 0x0aef;\n t.ninegurmukhi = 0x0a6f;\n t.ninehackarabic = 0x0669;\n t.ninehangzhou = 0x3029;\n t.nineideographicparen = 0x3228;\n t.nineinferior = 0x2089;\n t.ninemonospace = 0xff19;\n t.nineoldstyle = 0xf739;\n t.nineparen = 0x247c;\n t.nineperiod = 0x2490;\n t.ninepersian = 0x06f9;\n t.nineroman = 0x2178;\n t.ninesuperior = 0x2079;\n t.nineteencircle = 0x2472;\n t.nineteenparen = 0x2486;\n t.nineteenperiod = 0x249a;\n t.ninethai = 0x0e59;\n t.nj = 0x01cc;\n t.njecyrillic = 0x045a;\n t.nkatakana = 0x30f3;\n t.nkatakanahalfwidth = 0xff9d;\n t.nlegrightlong = 0x019e;\n t.nlinebelow = 0x1e49;\n t.nmonospace = 0xff4e;\n t.nmsquare = 0x339a;\n t.nnabengali = 0x09a3;\n t.nnadeva = 0x0923;\n t.nnagujarati = 0x0aa3;\n t.nnagurmukhi = 0x0a23;\n t.nnnadeva = 0x0929;\n t.nohiragana = 0x306e;\n t.nokatakana = 0x30ce;\n t.nokatakanahalfwidth = 0xff89;\n t.nonbreakingspace = 0x00a0;\n t.nonenthai = 0x0e13;\n t.nonuthai = 0x0e19;\n t.noonarabic = 0x0646;\n t.noonfinalarabic = 0xfee6;\n t.noonghunnaarabic = 0x06ba;\n t.noonghunnafinalarabic = 0xfb9f;\n t.nooninitialarabic = 0xfee7;\n t.noonjeeminitialarabic = 0xfcd2;\n t.noonjeemisolatedarabic = 0xfc4b;\n t.noonmedialarabic = 0xfee8;\n t.noonmeeminitialarabic = 0xfcd5;\n t.noonmeemisolatedarabic = 0xfc4e;\n t.noonnoonfinalarabic = 0xfc8d;\n t.notcontains = 0x220c;\n t.notelement = 0x2209;\n t.notelementof = 0x2209;\n t.notequal = 0x2260;\n t.notgreater = 0x226f;\n t.notgreaternorequal = 0x2271;\n t.notgreaternorless = 0x2279;\n t.notidentical = 0x2262;\n t.notless = 0x226e;\n t.notlessnorequal = 0x2270;\n t.notparallel = 0x2226;\n t.notprecedes = 0x2280;\n t.notsubset = 0x2284;\n t.notsucceeds = 0x2281;\n t.notsuperset = 0x2285;\n t.nowarmenian = 0x0576;\n t.nparen = 0x24a9;\n t.nssquare = 0x33b1;\n t.nsuperior = 0x207f;\n t.ntilde = 0x00f1;\n t.nu = 0x03bd;\n t.nuhiragana = 0x306c;\n t.nukatakana = 0x30cc;\n t.nukatakanahalfwidth = 0xff87;\n t.nuktabengali = 0x09bc;\n t.nuktadeva = 0x093c;\n t.nuktagujarati = 0x0abc;\n t.nuktagurmukhi = 0x0a3c;\n t.numbersign = 0x0023;\n t.numbersignmonospace = 0xff03;\n t.numbersignsmall = 0xfe5f;\n t.numeralsigngreek = 0x0374;\n t.numeralsignlowergreek = 0x0375;\n t.numero = 0x2116;\n t.nun = 0x05e0;\n t.nundagesh = 0xfb40;\n t.nundageshhebrew = 0xfb40;\n t.nunhebrew = 0x05e0;\n t.nvsquare = 0x33b5;\n t.nwsquare = 0x33bb;\n t.nyabengali = 0x099e;\n t.nyadeva = 0x091e;\n t.nyagujarati = 0x0a9e;\n t.nyagurmukhi = 0x0a1e;\n t.o = 0x006f;\n t.oacute = 0x00f3;\n t.oangthai = 0x0e2d;\n t.obarred = 0x0275;\n t.obarredcyrillic = 0x04e9;\n t.obarreddieresiscyrillic = 0x04eb;\n t.obengali = 0x0993;\n t.obopomofo = 0x311b;\n t.obreve = 0x014f;\n t.ocandradeva = 0x0911;\n t.ocandragujarati = 0x0a91;\n t.ocandravowelsigndeva = 0x0949;\n t.ocandravowelsigngujarati = 0x0ac9;\n t.ocaron = 0x01d2;\n t.ocircle = 0x24de;\n t.ocircumflex = 0x00f4;\n t.ocircumflexacute = 0x1ed1;\n t.ocircumflexdotbelow = 0x1ed9;\n t.ocircumflexgrave = 0x1ed3;\n t.ocircumflexhookabove = 0x1ed5;\n t.ocircumflextilde = 0x1ed7;\n t.ocyrillic = 0x043e;\n t.odblacute = 0x0151;\n t.odblgrave = 0x020d;\n t.odeva = 0x0913;\n t.odieresis = 0x00f6;\n t.odieresiscyrillic = 0x04e7;\n t.odotbelow = 0x1ecd;\n t.oe = 0x0153;\n t.oekorean = 0x315a;\n t.ogonek = 0x02db;\n t.ogonekcmb = 0x0328;\n t.ograve = 0x00f2;\n t.ogujarati = 0x0a93;\n t.oharmenian = 0x0585;\n t.ohiragana = 0x304a;\n t.ohookabove = 0x1ecf;\n t.ohorn = 0x01a1;\n t.ohornacute = 0x1edb;\n t.ohorndotbelow = 0x1ee3;\n t.ohorngrave = 0x1edd;\n t.ohornhookabove = 0x1edf;\n t.ohorntilde = 0x1ee1;\n t.ohungarumlaut = 0x0151;\n t.oi = 0x01a3;\n t.oinvertedbreve = 0x020f;\n t.okatakana = 0x30aa;\n t.okatakanahalfwidth = 0xff75;\n t.okorean = 0x3157;\n t.olehebrew = 0x05ab;\n t.omacron = 0x014d;\n t.omacronacute = 0x1e53;\n t.omacrongrave = 0x1e51;\n t.omdeva = 0x0950;\n t.omega = 0x03c9;\n t.omega1 = 0x03d6;\n t.omegacyrillic = 0x0461;\n t.omegalatinclosed = 0x0277;\n t.omegaroundcyrillic = 0x047b;\n t.omegatitlocyrillic = 0x047d;\n t.omegatonos = 0x03ce;\n t.omgujarati = 0x0ad0;\n t.omicron = 0x03bf;\n t.omicrontonos = 0x03cc;\n t.omonospace = 0xff4f;\n t.one = 0x0031;\n t.onearabic = 0x0661;\n t.onebengali = 0x09e7;\n t.onecircle = 0x2460;\n t.onecircleinversesansserif = 0x278a;\n t.onedeva = 0x0967;\n t.onedotenleader = 0x2024;\n t.oneeighth = 0x215b;\n t.onefitted = 0xf6dc;\n t.onegujarati = 0x0ae7;\n t.onegurmukhi = 0x0a67;\n t.onehackarabic = 0x0661;\n t.onehalf = 0x00bd;\n t.onehangzhou = 0x3021;\n t.oneideographicparen = 0x3220;\n t.oneinferior = 0x2081;\n t.onemonospace = 0xff11;\n t.onenumeratorbengali = 0x09f4;\n t.oneoldstyle = 0xf731;\n t.oneparen = 0x2474;\n t.oneperiod = 0x2488;\n t.onepersian = 0x06f1;\n t.onequarter = 0x00bc;\n t.oneroman = 0x2170;\n t.onesuperior = 0x00b9;\n t.onethai = 0x0e51;\n t.onethird = 0x2153;\n t.oogonek = 0x01eb;\n t.oogonekmacron = 0x01ed;\n t.oogurmukhi = 0x0a13;\n t.oomatragurmukhi = 0x0a4b;\n t.oopen = 0x0254;\n t.oparen = 0x24aa;\n t.openbullet = 0x25e6;\n t.option = 0x2325;\n t.ordfeminine = 0x00aa;\n t.ordmasculine = 0x00ba;\n t.orthogonal = 0x221f;\n t.oshortdeva = 0x0912;\n t.oshortvowelsigndeva = 0x094a;\n t.oslash = 0x00f8;\n t.oslashacute = 0x01ff;\n t.osmallhiragana = 0x3049;\n t.osmallkatakana = 0x30a9;\n t.osmallkatakanahalfwidth = 0xff6b;\n t.ostrokeacute = 0x01ff;\n t.osuperior = 0xf6f0;\n t.otcyrillic = 0x047f;\n t.otilde = 0x00f5;\n t.otildeacute = 0x1e4d;\n t.otildedieresis = 0x1e4f;\n t.oubopomofo = 0x3121;\n t.overline = 0x203e;\n t.overlinecenterline = 0xfe4a;\n t.overlinecmb = 0x0305;\n t.overlinedashed = 0xfe49;\n t.overlinedblwavy = 0xfe4c;\n t.overlinewavy = 0xfe4b;\n t.overscore = 0x00af;\n t.ovowelsignbengali = 0x09cb;\n t.ovowelsigndeva = 0x094b;\n t.ovowelsigngujarati = 0x0acb;\n t.p = 0x0070;\n t.paampssquare = 0x3380;\n t.paasentosquare = 0x332b;\n t.pabengali = 0x09aa;\n t.pacute = 0x1e55;\n t.padeva = 0x092a;\n t.pagedown = 0x21df;\n t.pageup = 0x21de;\n t.pagujarati = 0x0aaa;\n t.pagurmukhi = 0x0a2a;\n t.pahiragana = 0x3071;\n t.paiyannoithai = 0x0e2f;\n t.pakatakana = 0x30d1;\n t.palatalizationcyrilliccmb = 0x0484;\n t.palochkacyrillic = 0x04c0;\n t.pansioskorean = 0x317f;\n t.paragraph = 0x00b6;\n t.parallel = 0x2225;\n t.parenleft = 0x0028;\n t.parenleftaltonearabic = 0xfd3e;\n t.parenleftbt = 0xf8ed;\n t.parenleftex = 0xf8ec;\n t.parenleftinferior = 0x208d;\n t.parenleftmonospace = 0xff08;\n t.parenleftsmall = 0xfe59;\n t.parenleftsuperior = 0x207d;\n t.parenlefttp = 0xf8eb;\n t.parenleftvertical = 0xfe35;\n t.parenright = 0x0029;\n t.parenrightaltonearabic = 0xfd3f;\n t.parenrightbt = 0xf8f8;\n t.parenrightex = 0xf8f7;\n t.parenrightinferior = 0x208e;\n t.parenrightmonospace = 0xff09;\n t.parenrightsmall = 0xfe5a;\n t.parenrightsuperior = 0x207e;\n t.parenrighttp = 0xf8f6;\n t.parenrightvertical = 0xfe36;\n t.partialdiff = 0x2202;\n t.paseqhebrew = 0x05c0;\n t.pashtahebrew = 0x0599;\n t.pasquare = 0x33a9;\n t.patah = 0x05b7;\n t.patah11 = 0x05b7;\n t.patah1d = 0x05b7;\n t.patah2a = 0x05b7;\n t.patahhebrew = 0x05b7;\n t.patahnarrowhebrew = 0x05b7;\n t.patahquarterhebrew = 0x05b7;\n t.patahwidehebrew = 0x05b7;\n t.pazerhebrew = 0x05a1;\n t.pbopomofo = 0x3106;\n t.pcircle = 0x24df;\n t.pdotaccent = 0x1e57;\n t.pe = 0x05e4;\n t.pecyrillic = 0x043f;\n t.pedagesh = 0xfb44;\n t.pedageshhebrew = 0xfb44;\n t.peezisquare = 0x333b;\n t.pefinaldageshhebrew = 0xfb43;\n t.peharabic = 0x067e;\n t.peharmenian = 0x057a;\n t.pehebrew = 0x05e4;\n t.pehfinalarabic = 0xfb57;\n t.pehinitialarabic = 0xfb58;\n t.pehiragana = 0x307a;\n t.pehmedialarabic = 0xfb59;\n t.pekatakana = 0x30da;\n t.pemiddlehookcyrillic = 0x04a7;\n t.perafehebrew = 0xfb4e;\n t.percent = 0x0025;\n t.percentarabic = 0x066a;\n t.percentmonospace = 0xff05;\n t.percentsmall = 0xfe6a;\n t.period = 0x002e;\n t.periodarmenian = 0x0589;\n t.periodcentered = 0x00b7;\n t.periodhalfwidth = 0xff61;\n t.periodinferior = 0xf6e7;\n t.periodmonospace = 0xff0e;\n t.periodsmall = 0xfe52;\n t.periodsuperior = 0xf6e8;\n t.perispomenigreekcmb = 0x0342;\n t.perpendicular = 0x22a5;\n t.perthousand = 0x2030;\n t.peseta = 0x20a7;\n t.pfsquare = 0x338a;\n t.phabengali = 0x09ab;\n t.phadeva = 0x092b;\n t.phagujarati = 0x0aab;\n t.phagurmukhi = 0x0a2b;\n t.phi = 0x03c6;\n t.phi1 = 0x03d5;\n t.phieuphacirclekorean = 0x327a;\n t.phieuphaparenkorean = 0x321a;\n t.phieuphcirclekorean = 0x326c;\n t.phieuphkorean = 0x314d;\n t.phieuphparenkorean = 0x320c;\n t.philatin = 0x0278;\n t.phinthuthai = 0x0e3a;\n t.phisymbolgreek = 0x03d5;\n t.phook = 0x01a5;\n t.phophanthai = 0x0e1e;\n t.phophungthai = 0x0e1c;\n t.phosamphaothai = 0x0e20;\n t.pi = 0x03c0;\n t.pieupacirclekorean = 0x3273;\n t.pieupaparenkorean = 0x3213;\n t.pieupcieuckorean = 0x3176;\n t.pieupcirclekorean = 0x3265;\n t.pieupkiyeokkorean = 0x3172;\n t.pieupkorean = 0x3142;\n t.pieupparenkorean = 0x3205;\n t.pieupsioskiyeokkorean = 0x3174;\n t.pieupsioskorean = 0x3144;\n t.pieupsiostikeutkorean = 0x3175;\n t.pieupthieuthkorean = 0x3177;\n t.pieuptikeutkorean = 0x3173;\n t.pihiragana = 0x3074;\n t.pikatakana = 0x30d4;\n t.pisymbolgreek = 0x03d6;\n t.piwrarmenian = 0x0583;\n t.planckover2pi = 0x210f;\n t.planckover2pi1 = 0x210f;\n t.plus = 0x002b;\n t.plusbelowcmb = 0x031f;\n t.pluscircle = 0x2295;\n t.plusminus = 0x00b1;\n t.plusmod = 0x02d6;\n t.plusmonospace = 0xff0b;\n t.plussmall = 0xfe62;\n t.plussuperior = 0x207a;\n t.pmonospace = 0xff50;\n t.pmsquare = 0x33d8;\n t.pohiragana = 0x307d;\n t.pointingindexdownwhite = 0x261f;\n t.pointingindexleftwhite = 0x261c;\n t.pointingindexrightwhite = 0x261e;\n t.pointingindexupwhite = 0x261d;\n t.pokatakana = 0x30dd;\n t.poplathai = 0x0e1b;\n t.postalmark = 0x3012;\n t.postalmarkface = 0x3020;\n t.pparen = 0x24ab;\n t.precedes = 0x227a;\n t.prescription = 0x211e;\n t.primemod = 0x02b9;\n t.primereversed = 0x2035;\n t.product = 0x220f;\n t.projective = 0x2305;\n t.prolongedkana = 0x30fc;\n t.propellor = 0x2318;\n t.propersubset = 0x2282;\n t.propersuperset = 0x2283;\n t.proportion = 0x2237;\n t.proportional = 0x221d;\n t.psi = 0x03c8;\n t.psicyrillic = 0x0471;\n t.psilipneumatacyrilliccmb = 0x0486;\n t.pssquare = 0x33b0;\n t.puhiragana = 0x3077;\n t.pukatakana = 0x30d7;\n t.pvsquare = 0x33b4;\n t.pwsquare = 0x33ba;\n t.q = 0x0071;\n t.qadeva = 0x0958;\n t.qadmahebrew = 0x05a8;\n t.qafarabic = 0x0642;\n t.qaffinalarabic = 0xfed6;\n t.qafinitialarabic = 0xfed7;\n t.qafmedialarabic = 0xfed8;\n t.qamats = 0x05b8;\n t.qamats10 = 0x05b8;\n t.qamats1a = 0x05b8;\n t.qamats1c = 0x05b8;\n t.qamats27 = 0x05b8;\n t.qamats29 = 0x05b8;\n t.qamats33 = 0x05b8;\n t.qamatsde = 0x05b8;\n t.qamatshebrew = 0x05b8;\n t.qamatsnarrowhebrew = 0x05b8;\n t.qamatsqatanhebrew = 0x05b8;\n t.qamatsqatannarrowhebrew = 0x05b8;\n t.qamatsqatanquarterhebrew = 0x05b8;\n t.qamatsqatanwidehebrew = 0x05b8;\n t.qamatsquarterhebrew = 0x05b8;\n t.qamatswidehebrew = 0x05b8;\n t.qarneyparahebrew = 0x059f;\n t.qbopomofo = 0x3111;\n t.qcircle = 0x24e0;\n t.qhook = 0x02a0;\n t.qmonospace = 0xff51;\n t.qof = 0x05e7;\n t.qofdagesh = 0xfb47;\n t.qofdageshhebrew = 0xfb47;\n t.qofhebrew = 0x05e7;\n t.qparen = 0x24ac;\n t.quarternote = 0x2669;\n t.qubuts = 0x05bb;\n t.qubuts18 = 0x05bb;\n t.qubuts25 = 0x05bb;\n t.qubuts31 = 0x05bb;\n t.qubutshebrew = 0x05bb;\n t.qubutsnarrowhebrew = 0x05bb;\n t.qubutsquarterhebrew = 0x05bb;\n t.qubutswidehebrew = 0x05bb;\n t.question = 0x003f;\n t.questionarabic = 0x061f;\n t.questionarmenian = 0x055e;\n t.questiondown = 0x00bf;\n t.questiondownsmall = 0xf7bf;\n t.questiongreek = 0x037e;\n t.questionmonospace = 0xff1f;\n t.questionsmall = 0xf73f;\n t.quotedbl = 0x0022;\n t.quotedblbase = 0x201e;\n t.quotedblleft = 0x201c;\n t.quotedblmonospace = 0xff02;\n t.quotedblprime = 0x301e;\n t.quotedblprimereversed = 0x301d;\n t.quotedblright = 0x201d;\n t.quoteleft = 0x2018;\n t.quoteleftreversed = 0x201b;\n t.quotereversed = 0x201b;\n t.quoteright = 0x2019;\n t.quoterightn = 0x0149;\n t.quotesinglbase = 0x201a;\n t.quotesingle = 0x0027;\n t.quotesinglemonospace = 0xff07;\n t.r = 0x0072;\n t.raarmenian = 0x057c;\n t.rabengali = 0x09b0;\n t.racute = 0x0155;\n t.radeva = 0x0930;\n t.radical = 0x221a;\n t.radicalex = 0xf8e5;\n t.radoverssquare = 0x33ae;\n t.radoverssquaredsquare = 0x33af;\n t.radsquare = 0x33ad;\n t.rafe = 0x05bf;\n t.rafehebrew = 0x05bf;\n t.ragujarati = 0x0ab0;\n t.ragurmukhi = 0x0a30;\n t.rahiragana = 0x3089;\n t.rakatakana = 0x30e9;\n t.rakatakanahalfwidth = 0xff97;\n t.ralowerdiagonalbengali = 0x09f1;\n t.ramiddlediagonalbengali = 0x09f0;\n t.ramshorn = 0x0264;\n t.ratio = 0x2236;\n t.rbopomofo = 0x3116;\n t.rcaron = 0x0159;\n t.rcedilla = 0x0157;\n t.rcircle = 0x24e1;\n t.rcommaaccent = 0x0157;\n t.rdblgrave = 0x0211;\n t.rdotaccent = 0x1e59;\n t.rdotbelow = 0x1e5b;\n t.rdotbelowmacron = 0x1e5d;\n t.referencemark = 0x203b;\n t.reflexsubset = 0x2286;\n t.reflexsuperset = 0x2287;\n t.registered = 0x00ae;\n t.registersans = 0xf8e8;\n t.registerserif = 0xf6da;\n t.reharabic = 0x0631;\n t.reharmenian = 0x0580;\n t.rehfinalarabic = 0xfeae;\n t.rehiragana = 0x308c;\n t.rekatakana = 0x30ec;\n t.rekatakanahalfwidth = 0xff9a;\n t.resh = 0x05e8;\n t.reshdageshhebrew = 0xfb48;\n t.reshhebrew = 0x05e8;\n t.reversedtilde = 0x223d;\n t.reviahebrew = 0x0597;\n t.reviamugrashhebrew = 0x0597;\n t.revlogicalnot = 0x2310;\n t.rfishhook = 0x027e;\n t.rfishhookreversed = 0x027f;\n t.rhabengali = 0x09dd;\n t.rhadeva = 0x095d;\n t.rho = 0x03c1;\n t.rhook = 0x027d;\n t.rhookturned = 0x027b;\n t.rhookturnedsuperior = 0x02b5;\n t.rhosymbolgreek = 0x03f1;\n t.rhotichookmod = 0x02de;\n t.rieulacirclekorean = 0x3271;\n t.rieulaparenkorean = 0x3211;\n t.rieulcirclekorean = 0x3263;\n t.rieulhieuhkorean = 0x3140;\n t.rieulkiyeokkorean = 0x313a;\n t.rieulkiyeoksioskorean = 0x3169;\n t.rieulkorean = 0x3139;\n t.rieulmieumkorean = 0x313b;\n t.rieulpansioskorean = 0x316c;\n t.rieulparenkorean = 0x3203;\n t.rieulphieuphkorean = 0x313f;\n t.rieulpieupkorean = 0x313c;\n t.rieulpieupsioskorean = 0x316b;\n t.rieulsioskorean = 0x313d;\n t.rieulthieuthkorean = 0x313e;\n t.rieultikeutkorean = 0x316a;\n t.rieulyeorinhieuhkorean = 0x316d;\n t.rightangle = 0x221f;\n t.righttackbelowcmb = 0x0319;\n t.righttriangle = 0x22bf;\n t.rihiragana = 0x308a;\n t.rikatakana = 0x30ea;\n t.rikatakanahalfwidth = 0xff98;\n t.ring = 0x02da;\n t.ringbelowcmb = 0x0325;\n t.ringcmb = 0x030a;\n t.ringhalfleft = 0x02bf;\n t.ringhalfleftarmenian = 0x0559;\n t.ringhalfleftbelowcmb = 0x031c;\n t.ringhalfleftcentered = 0x02d3;\n t.ringhalfright = 0x02be;\n t.ringhalfrightbelowcmb = 0x0339;\n t.ringhalfrightcentered = 0x02d2;\n t.rinvertedbreve = 0x0213;\n t.rittorusquare = 0x3351;\n t.rlinebelow = 0x1e5f;\n t.rlongleg = 0x027c;\n t.rlonglegturned = 0x027a;\n t.rmonospace = 0xff52;\n t.rohiragana = 0x308d;\n t.rokatakana = 0x30ed;\n t.rokatakanahalfwidth = 0xff9b;\n t.roruathai = 0x0e23;\n t.rparen = 0x24ad;\n t.rrabengali = 0x09dc;\n t.rradeva = 0x0931;\n t.rragurmukhi = 0x0a5c;\n t.rreharabic = 0x0691;\n t.rrehfinalarabic = 0xfb8d;\n t.rrvocalicbengali = 0x09e0;\n t.rrvocalicdeva = 0x0960;\n t.rrvocalicgujarati = 0x0ae0;\n t.rrvocalicvowelsignbengali = 0x09c4;\n t.rrvocalicvowelsigndeva = 0x0944;\n t.rrvocalicvowelsigngujarati = 0x0ac4;\n t.rsuperior = 0xf6f1;\n t.rtblock = 0x2590;\n t.rturned = 0x0279;\n t.rturnedsuperior = 0x02b4;\n t.ruhiragana = 0x308b;\n t.rukatakana = 0x30eb;\n t.rukatakanahalfwidth = 0xff99;\n t.rupeemarkbengali = 0x09f2;\n t.rupeesignbengali = 0x09f3;\n t.rupiah = 0xf6dd;\n t.ruthai = 0x0e24;\n t.rvocalicbengali = 0x098b;\n t.rvocalicdeva = 0x090b;\n t.rvocalicgujarati = 0x0a8b;\n t.rvocalicvowelsignbengali = 0x09c3;\n t.rvocalicvowelsigndeva = 0x0943;\n t.rvocalicvowelsigngujarati = 0x0ac3;\n t.s = 0x0073;\n t.sabengali = 0x09b8;\n t.sacute = 0x015b;\n t.sacutedotaccent = 0x1e65;\n t.sadarabic = 0x0635;\n t.sadeva = 0x0938;\n t.sadfinalarabic = 0xfeba;\n t.sadinitialarabic = 0xfebb;\n t.sadmedialarabic = 0xfebc;\n t.sagujarati = 0x0ab8;\n t.sagurmukhi = 0x0a38;\n t.sahiragana = 0x3055;\n t.sakatakana = 0x30b5;\n t.sakatakanahalfwidth = 0xff7b;\n t.sallallahoualayhewasallamarabic = 0xfdfa;\n t.samekh = 0x05e1;\n t.samekhdagesh = 0xfb41;\n t.samekhdageshhebrew = 0xfb41;\n t.samekhhebrew = 0x05e1;\n t.saraaathai = 0x0e32;\n t.saraaethai = 0x0e41;\n t.saraaimaimalaithai = 0x0e44;\n t.saraaimaimuanthai = 0x0e43;\n t.saraamthai = 0x0e33;\n t.saraathai = 0x0e30;\n t.saraethai = 0x0e40;\n t.saraiileftthai = 0xf886;\n t.saraiithai = 0x0e35;\n t.saraileftthai = 0xf885;\n t.saraithai = 0x0e34;\n t.saraothai = 0x0e42;\n t.saraueeleftthai = 0xf888;\n t.saraueethai = 0x0e37;\n t.saraueleftthai = 0xf887;\n t.sarauethai = 0x0e36;\n t.sarauthai = 0x0e38;\n t.sarauuthai = 0x0e39;\n t.sbopomofo = 0x3119;\n t.scaron = 0x0161;\n t.scarondotaccent = 0x1e67;\n t.scedilla = 0x015f;\n t.schwa = 0x0259;\n t.schwacyrillic = 0x04d9;\n t.schwadieresiscyrillic = 0x04db;\n t.schwahook = 0x025a;\n t.scircle = 0x24e2;\n t.scircumflex = 0x015d;\n t.scommaaccent = 0x0219;\n t.sdotaccent = 0x1e61;\n t.sdotbelow = 0x1e63;\n t.sdotbelowdotaccent = 0x1e69;\n t.seagullbelowcmb = 0x033c;\n t.second = 0x2033;\n t.secondtonechinese = 0x02ca;\n t.section = 0x00a7;\n t.seenarabic = 0x0633;\n t.seenfinalarabic = 0xfeb2;\n t.seeninitialarabic = 0xfeb3;\n t.seenmedialarabic = 0xfeb4;\n t.segol = 0x05b6;\n t.segol13 = 0x05b6;\n t.segol1f = 0x05b6;\n t.segol2c = 0x05b6;\n t.segolhebrew = 0x05b6;\n t.segolnarrowhebrew = 0x05b6;\n t.segolquarterhebrew = 0x05b6;\n t.segoltahebrew = 0x0592;\n t.segolwidehebrew = 0x05b6;\n t.seharmenian = 0x057d;\n t.sehiragana = 0x305b;\n t.sekatakana = 0x30bb;\n t.sekatakanahalfwidth = 0xff7e;\n t.semicolon = 0x003b;\n t.semicolonarabic = 0x061b;\n t.semicolonmonospace = 0xff1b;\n t.semicolonsmall = 0xfe54;\n t.semivoicedmarkkana = 0x309c;\n t.semivoicedmarkkanahalfwidth = 0xff9f;\n t.sentisquare = 0x3322;\n t.sentosquare = 0x3323;\n t.seven = 0x0037;\n t.sevenarabic = 0x0667;\n t.sevenbengali = 0x09ed;\n t.sevencircle = 0x2466;\n t.sevencircleinversesansserif = 0x2790;\n t.sevendeva = 0x096d;\n t.seveneighths = 0x215e;\n t.sevengujarati = 0x0aed;\n t.sevengurmukhi = 0x0a6d;\n t.sevenhackarabic = 0x0667;\n t.sevenhangzhou = 0x3027;\n t.sevenideographicparen = 0x3226;\n t.seveninferior = 0x2087;\n t.sevenmonospace = 0xff17;\n t.sevenoldstyle = 0xf737;\n t.sevenparen = 0x247a;\n t.sevenperiod = 0x248e;\n t.sevenpersian = 0x06f7;\n t.sevenroman = 0x2176;\n t.sevensuperior = 0x2077;\n t.seventeencircle = 0x2470;\n t.seventeenparen = 0x2484;\n t.seventeenperiod = 0x2498;\n t.seventhai = 0x0e57;\n t.sfthyphen = 0x00ad;\n t.shaarmenian = 0x0577;\n t.shabengali = 0x09b6;\n t.shacyrillic = 0x0448;\n t.shaddaarabic = 0x0651;\n t.shaddadammaarabic = 0xfc61;\n t.shaddadammatanarabic = 0xfc5e;\n t.shaddafathaarabic = 0xfc60;\n t.shaddakasraarabic = 0xfc62;\n t.shaddakasratanarabic = 0xfc5f;\n t.shade = 0x2592;\n t.shadedark = 0x2593;\n t.shadelight = 0x2591;\n t.shademedium = 0x2592;\n t.shadeva = 0x0936;\n t.shagujarati = 0x0ab6;\n t.shagurmukhi = 0x0a36;\n t.shalshelethebrew = 0x0593;\n t.shbopomofo = 0x3115;\n t.shchacyrillic = 0x0449;\n t.sheenarabic = 0x0634;\n t.sheenfinalarabic = 0xfeb6;\n t.sheeninitialarabic = 0xfeb7;\n t.sheenmedialarabic = 0xfeb8;\n t.sheicoptic = 0x03e3;\n t.sheqel = 0x20aa;\n t.sheqelhebrew = 0x20aa;\n t.sheva = 0x05b0;\n t.sheva115 = 0x05b0;\n t.sheva15 = 0x05b0;\n t.sheva22 = 0x05b0;\n t.sheva2e = 0x05b0;\n t.shevahebrew = 0x05b0;\n t.shevanarrowhebrew = 0x05b0;\n t.shevaquarterhebrew = 0x05b0;\n t.shevawidehebrew = 0x05b0;\n t.shhacyrillic = 0x04bb;\n t.shimacoptic = 0x03ed;\n t.shin = 0x05e9;\n t.shindagesh = 0xfb49;\n t.shindageshhebrew = 0xfb49;\n t.shindageshshindot = 0xfb2c;\n t.shindageshshindothebrew = 0xfb2c;\n t.shindageshsindot = 0xfb2d;\n t.shindageshsindothebrew = 0xfb2d;\n t.shindothebrew = 0x05c1;\n t.shinhebrew = 0x05e9;\n t.shinshindot = 0xfb2a;\n t.shinshindothebrew = 0xfb2a;\n t.shinsindot = 0xfb2b;\n t.shinsindothebrew = 0xfb2b;\n t.shook = 0x0282;\n t.sigma = 0x03c3;\n t.sigma1 = 0x03c2;\n t.sigmafinal = 0x03c2;\n t.sigmalunatesymbolgreek = 0x03f2;\n t.sihiragana = 0x3057;\n t.sikatakana = 0x30b7;\n t.sikatakanahalfwidth = 0xff7c;\n t.siluqhebrew = 0x05bd;\n t.siluqlefthebrew = 0x05bd;\n t.similar = 0x223c;\n t.sindothebrew = 0x05c2;\n t.siosacirclekorean = 0x3274;\n t.siosaparenkorean = 0x3214;\n t.sioscieuckorean = 0x317e;\n t.sioscirclekorean = 0x3266;\n t.sioskiyeokkorean = 0x317a;\n t.sioskorean = 0x3145;\n t.siosnieunkorean = 0x317b;\n t.siosparenkorean = 0x3206;\n t.siospieupkorean = 0x317d;\n t.siostikeutkorean = 0x317c;\n t.six = 0x0036;\n t.sixarabic = 0x0666;\n t.sixbengali = 0x09ec;\n t.sixcircle = 0x2465;\n t.sixcircleinversesansserif = 0x278f;\n t.sixdeva = 0x096c;\n t.sixgujarati = 0x0aec;\n t.sixgurmukhi = 0x0a6c;\n t.sixhackarabic = 0x0666;\n t.sixhangzhou = 0x3026;\n t.sixideographicparen = 0x3225;\n t.sixinferior = 0x2086;\n t.sixmonospace = 0xff16;\n t.sixoldstyle = 0xf736;\n t.sixparen = 0x2479;\n t.sixperiod = 0x248d;\n t.sixpersian = 0x06f6;\n t.sixroman = 0x2175;\n t.sixsuperior = 0x2076;\n t.sixteencircle = 0x246f;\n t.sixteencurrencydenominatorbengali = 0x09f9;\n t.sixteenparen = 0x2483;\n t.sixteenperiod = 0x2497;\n t.sixthai = 0x0e56;\n t.slash = 0x002f;\n t.slashmonospace = 0xff0f;\n t.slong = 0x017f;\n t.slongdotaccent = 0x1e9b;\n t.smileface = 0x263a;\n t.smonospace = 0xff53;\n t.sofpasuqhebrew = 0x05c3;\n t.softhyphen = 0x00ad;\n t.softsigncyrillic = 0x044c;\n t.sohiragana = 0x305d;\n t.sokatakana = 0x30bd;\n t.sokatakanahalfwidth = 0xff7f;\n t.soliduslongoverlaycmb = 0x0338;\n t.solidusshortoverlaycmb = 0x0337;\n t.sorusithai = 0x0e29;\n t.sosalathai = 0x0e28;\n t.sosothai = 0x0e0b;\n t.sosuathai = 0x0e2a;\n t.space = 0x0020;\n t.spacehackarabic = 0x0020;\n t.spade = 0x2660;\n t.spadesuitblack = 0x2660;\n t.spadesuitwhite = 0x2664;\n t.sparen = 0x24ae;\n t.squarebelowcmb = 0x033b;\n t.squarecc = 0x33c4;\n t.squarecm = 0x339d;\n t.squarediagonalcrosshatchfill = 0x25a9;\n t.squarehorizontalfill = 0x25a4;\n t.squarekg = 0x338f;\n t.squarekm = 0x339e;\n t.squarekmcapital = 0x33ce;\n t.squareln = 0x33d1;\n t.squarelog = 0x33d2;\n t.squaremg = 0x338e;\n t.squaremil = 0x33d5;\n t.squaremm = 0x339c;\n t.squaremsquared = 0x33a1;\n t.squareorthogonalcrosshatchfill = 0x25a6;\n t.squareupperlefttolowerrightfill = 0x25a7;\n t.squareupperrighttolowerleftfill = 0x25a8;\n t.squareverticalfill = 0x25a5;\n t.squarewhitewithsmallblack = 0x25a3;\n t.srsquare = 0x33db;\n t.ssabengali = 0x09b7;\n t.ssadeva = 0x0937;\n t.ssagujarati = 0x0ab7;\n t.ssangcieuckorean = 0x3149;\n t.ssanghieuhkorean = 0x3185;\n t.ssangieungkorean = 0x3180;\n t.ssangkiyeokkorean = 0x3132;\n t.ssangnieunkorean = 0x3165;\n t.ssangpieupkorean = 0x3143;\n t.ssangsioskorean = 0x3146;\n t.ssangtikeutkorean = 0x3138;\n t.ssuperior = 0xf6f2;\n t.sterling = 0x00a3;\n t.sterlingmonospace = 0xffe1;\n t.strokelongoverlaycmb = 0x0336;\n t.strokeshortoverlaycmb = 0x0335;\n t.subset = 0x2282;\n t.subsetnotequal = 0x228a;\n t.subsetorequal = 0x2286;\n t.succeeds = 0x227b;\n t.suchthat = 0x220b;\n t.suhiragana = 0x3059;\n t.sukatakana = 0x30b9;\n t.sukatakanahalfwidth = 0xff7d;\n t.sukunarabic = 0x0652;\n t.summation = 0x2211;\n t.sun = 0x263c;\n t.superset = 0x2283;\n t.supersetnotequal = 0x228b;\n t.supersetorequal = 0x2287;\n t.svsquare = 0x33dc;\n t.syouwaerasquare = 0x337c;\n t.t = 0x0074;\n t.tabengali = 0x09a4;\n t.tackdown = 0x22a4;\n t.tackleft = 0x22a3;\n t.tadeva = 0x0924;\n t.tagujarati = 0x0aa4;\n t.tagurmukhi = 0x0a24;\n t.taharabic = 0x0637;\n t.tahfinalarabic = 0xfec2;\n t.tahinitialarabic = 0xfec3;\n t.tahiragana = 0x305f;\n t.tahmedialarabic = 0xfec4;\n t.taisyouerasquare = 0x337d;\n t.takatakana = 0x30bf;\n t.takatakanahalfwidth = 0xff80;\n t.tatweelarabic = 0x0640;\n t.tau = 0x03c4;\n t.tav = 0x05ea;\n t.tavdages = 0xfb4a;\n t.tavdagesh = 0xfb4a;\n t.tavdageshhebrew = 0xfb4a;\n t.tavhebrew = 0x05ea;\n t.tbar = 0x0167;\n t.tbopomofo = 0x310a;\n t.tcaron = 0x0165;\n t.tccurl = 0x02a8;\n t.tcedilla = 0x0163;\n t.tcheharabic = 0x0686;\n t.tchehfinalarabic = 0xfb7b;\n t.tchehinitialarabic = 0xfb7c;\n t.tchehmedialarabic = 0xfb7d;\n t.tcircle = 0x24e3;\n t.tcircumflexbelow = 0x1e71;\n t.tcommaaccent = 0x0163;\n t.tdieresis = 0x1e97;\n t.tdotaccent = 0x1e6b;\n t.tdotbelow = 0x1e6d;\n t.tecyrillic = 0x0442;\n t.tedescendercyrillic = 0x04ad;\n t.teharabic = 0x062a;\n t.tehfinalarabic = 0xfe96;\n t.tehhahinitialarabic = 0xfca2;\n t.tehhahisolatedarabic = 0xfc0c;\n t.tehinitialarabic = 0xfe97;\n t.tehiragana = 0x3066;\n t.tehjeeminitialarabic = 0xfca1;\n t.tehjeemisolatedarabic = 0xfc0b;\n t.tehmarbutaarabic = 0x0629;\n t.tehmarbutafinalarabic = 0xfe94;\n t.tehmedialarabic = 0xfe98;\n t.tehmeeminitialarabic = 0xfca4;\n t.tehmeemisolatedarabic = 0xfc0e;\n t.tehnoonfinalarabic = 0xfc73;\n t.tekatakana = 0x30c6;\n t.tekatakanahalfwidth = 0xff83;\n t.telephone = 0x2121;\n t.telephoneblack = 0x260e;\n t.telishagedolahebrew = 0x05a0;\n t.telishaqetanahebrew = 0x05a9;\n t.tencircle = 0x2469;\n t.tenideographicparen = 0x3229;\n t.tenparen = 0x247d;\n t.tenperiod = 0x2491;\n t.tenroman = 0x2179;\n t.tesh = 0x02a7;\n t.tet = 0x05d8;\n t.tetdagesh = 0xfb38;\n t.tetdageshhebrew = 0xfb38;\n t.tethebrew = 0x05d8;\n t.tetsecyrillic = 0x04b5;\n t.tevirhebrew = 0x059b;\n t.tevirlefthebrew = 0x059b;\n t.thabengali = 0x09a5;\n t.thadeva = 0x0925;\n t.thagujarati = 0x0aa5;\n t.thagurmukhi = 0x0a25;\n t.thalarabic = 0x0630;\n t.thalfinalarabic = 0xfeac;\n t.thanthakhatlowleftthai = 0xf898;\n t.thanthakhatlowrightthai = 0xf897;\n t.thanthakhatthai = 0x0e4c;\n t.thanthakhatupperleftthai = 0xf896;\n t.theharabic = 0x062b;\n t.thehfinalarabic = 0xfe9a;\n t.thehinitialarabic = 0xfe9b;\n t.thehmedialarabic = 0xfe9c;\n t.thereexists = 0x2203;\n t.therefore = 0x2234;\n t.theta = 0x03b8;\n t.theta1 = 0x03d1;\n t.thetasymbolgreek = 0x03d1;\n t.thieuthacirclekorean = 0x3279;\n t.thieuthaparenkorean = 0x3219;\n t.thieuthcirclekorean = 0x326b;\n t.thieuthkorean = 0x314c;\n t.thieuthparenkorean = 0x320b;\n t.thirteencircle = 0x246c;\n t.thirteenparen = 0x2480;\n t.thirteenperiod = 0x2494;\n t.thonangmonthothai = 0x0e11;\n t.thook = 0x01ad;\n t.thophuthaothai = 0x0e12;\n t.thorn = 0x00fe;\n t.thothahanthai = 0x0e17;\n t.thothanthai = 0x0e10;\n t.thothongthai = 0x0e18;\n t.thothungthai = 0x0e16;\n t.thousandcyrillic = 0x0482;\n t.thousandsseparatorarabic = 0x066c;\n t.thousandsseparatorpersian = 0x066c;\n t.three = 0x0033;\n t.threearabic = 0x0663;\n t.threebengali = 0x09e9;\n t.threecircle = 0x2462;\n t.threecircleinversesansserif = 0x278c;\n t.threedeva = 0x0969;\n t.threeeighths = 0x215c;\n t.threegujarati = 0x0ae9;\n t.threegurmukhi = 0x0a69;\n t.threehackarabic = 0x0663;\n t.threehangzhou = 0x3023;\n t.threeideographicparen = 0x3222;\n t.threeinferior = 0x2083;\n t.threemonospace = 0xff13;\n t.threenumeratorbengali = 0x09f6;\n t.threeoldstyle = 0xf733;\n t.threeparen = 0x2476;\n t.threeperiod = 0x248a;\n t.threepersian = 0x06f3;\n t.threequarters = 0x00be;\n t.threequartersemdash = 0xf6de;\n t.threeroman = 0x2172;\n t.threesuperior = 0x00b3;\n t.threethai = 0x0e53;\n t.thzsquare = 0x3394;\n t.tihiragana = 0x3061;\n t.tikatakana = 0x30c1;\n t.tikatakanahalfwidth = 0xff81;\n t.tikeutacirclekorean = 0x3270;\n t.tikeutaparenkorean = 0x3210;\n t.tikeutcirclekorean = 0x3262;\n t.tikeutkorean = 0x3137;\n t.tikeutparenkorean = 0x3202;\n t.tilde = 0x02dc;\n t.tildebelowcmb = 0x0330;\n t.tildecmb = 0x0303;\n t.tildecomb = 0x0303;\n t.tildedoublecmb = 0x0360;\n t.tildeoperator = 0x223c;\n t.tildeoverlaycmb = 0x0334;\n t.tildeverticalcmb = 0x033e;\n t.timescircle = 0x2297;\n t.tipehahebrew = 0x0596;\n t.tipehalefthebrew = 0x0596;\n t.tippigurmukhi = 0x0a70;\n t.titlocyrilliccmb = 0x0483;\n t.tiwnarmenian = 0x057f;\n t.tlinebelow = 0x1e6f;\n t.tmonospace = 0xff54;\n t.toarmenian = 0x0569;\n t.tohiragana = 0x3068;\n t.tokatakana = 0x30c8;\n t.tokatakanahalfwidth = 0xff84;\n t.tonebarextrahighmod = 0x02e5;\n t.tonebarextralowmod = 0x02e9;\n t.tonebarhighmod = 0x02e6;\n t.tonebarlowmod = 0x02e8;\n t.tonebarmidmod = 0x02e7;\n t.tonefive = 0x01bd;\n t.tonesix = 0x0185;\n t.tonetwo = 0x01a8;\n t.tonos = 0x0384;\n t.tonsquare = 0x3327;\n t.topatakthai = 0x0e0f;\n t.tortoiseshellbracketleft = 0x3014;\n t.tortoiseshellbracketleftsmall = 0xfe5d;\n t.tortoiseshellbracketleftvertical = 0xfe39;\n t.tortoiseshellbracketright = 0x3015;\n t.tortoiseshellbracketrightsmall = 0xfe5e;\n t.tortoiseshellbracketrightvertical = 0xfe3a;\n t.totaothai = 0x0e15;\n t.tpalatalhook = 0x01ab;\n t.tparen = 0x24af;\n t.trademark = 0x2122;\n t.trademarksans = 0xf8ea;\n t.trademarkserif = 0xf6db;\n t.tretroflexhook = 0x0288;\n t.triagdn = 0x25bc;\n t.triaglf = 0x25c4;\n t.triagrt = 0x25ba;\n t.triagup = 0x25b2;\n t.ts = 0x02a6;\n t.tsadi = 0x05e6;\n t.tsadidagesh = 0xfb46;\n t.tsadidageshhebrew = 0xfb46;\n t.tsadihebrew = 0x05e6;\n t.tsecyrillic = 0x0446;\n t.tsere = 0x05b5;\n t.tsere12 = 0x05b5;\n t.tsere1e = 0x05b5;\n t.tsere2b = 0x05b5;\n t.tserehebrew = 0x05b5;\n t.tserenarrowhebrew = 0x05b5;\n t.tserequarterhebrew = 0x05b5;\n t.tserewidehebrew = 0x05b5;\n t.tshecyrillic = 0x045b;\n t.tsuperior = 0xf6f3;\n t.ttabengali = 0x099f;\n t.ttadeva = 0x091f;\n t.ttagujarati = 0x0a9f;\n t.ttagurmukhi = 0x0a1f;\n t.tteharabic = 0x0679;\n t.ttehfinalarabic = 0xfb67;\n t.ttehinitialarabic = 0xfb68;\n t.ttehmedialarabic = 0xfb69;\n t.tthabengali = 0x09a0;\n t.tthadeva = 0x0920;\n t.tthagujarati = 0x0aa0;\n t.tthagurmukhi = 0x0a20;\n t.tturned = 0x0287;\n t.tuhiragana = 0x3064;\n t.tukatakana = 0x30c4;\n t.tukatakanahalfwidth = 0xff82;\n t.tusmallhiragana = 0x3063;\n t.tusmallkatakana = 0x30c3;\n t.tusmallkatakanahalfwidth = 0xff6f;\n t.twelvecircle = 0x246b;\n t.twelveparen = 0x247f;\n t.twelveperiod = 0x2493;\n t.twelveroman = 0x217b;\n t.twentycircle = 0x2473;\n t.twentyhangzhou = 0x5344;\n t.twentyparen = 0x2487;\n t.twentyperiod = 0x249b;\n t.two = 0x0032;\n t.twoarabic = 0x0662;\n t.twobengali = 0x09e8;\n t.twocircle = 0x2461;\n t.twocircleinversesansserif = 0x278b;\n t.twodeva = 0x0968;\n t.twodotenleader = 0x2025;\n t.twodotleader = 0x2025;\n t.twodotleadervertical = 0xfe30;\n t.twogujarati = 0x0ae8;\n t.twogurmukhi = 0x0a68;\n t.twohackarabic = 0x0662;\n t.twohangzhou = 0x3022;\n t.twoideographicparen = 0x3221;\n t.twoinferior = 0x2082;\n t.twomonospace = 0xff12;\n t.twonumeratorbengali = 0x09f5;\n t.twooldstyle = 0xf732;\n t.twoparen = 0x2475;\n t.twoperiod = 0x2489;\n t.twopersian = 0x06f2;\n t.tworoman = 0x2171;\n t.twostroke = 0x01bb;\n t.twosuperior = 0x00b2;\n t.twothai = 0x0e52;\n t.twothirds = 0x2154;\n t.u = 0x0075;\n t.uacute = 0x00fa;\n t.ubar = 0x0289;\n t.ubengali = 0x0989;\n t.ubopomofo = 0x3128;\n t.ubreve = 0x016d;\n t.ucaron = 0x01d4;\n t.ucircle = 0x24e4;\n t.ucircumflex = 0x00fb;\n t.ucircumflexbelow = 0x1e77;\n t.ucyrillic = 0x0443;\n t.udattadeva = 0x0951;\n t.udblacute = 0x0171;\n t.udblgrave = 0x0215;\n t.udeva = 0x0909;\n t.udieresis = 0x00fc;\n t.udieresisacute = 0x01d8;\n t.udieresisbelow = 0x1e73;\n t.udieresiscaron = 0x01da;\n t.udieresiscyrillic = 0x04f1;\n t.udieresisgrave = 0x01dc;\n t.udieresismacron = 0x01d6;\n t.udotbelow = 0x1ee5;\n t.ugrave = 0x00f9;\n t.ugujarati = 0x0a89;\n t.ugurmukhi = 0x0a09;\n t.uhiragana = 0x3046;\n t.uhookabove = 0x1ee7;\n t.uhorn = 0x01b0;\n t.uhornacute = 0x1ee9;\n t.uhorndotbelow = 0x1ef1;\n t.uhorngrave = 0x1eeb;\n t.uhornhookabove = 0x1eed;\n t.uhorntilde = 0x1eef;\n t.uhungarumlaut = 0x0171;\n t.uhungarumlautcyrillic = 0x04f3;\n t.uinvertedbreve = 0x0217;\n t.ukatakana = 0x30a6;\n t.ukatakanahalfwidth = 0xff73;\n t.ukcyrillic = 0x0479;\n t.ukorean = 0x315c;\n t.umacron = 0x016b;\n t.umacroncyrillic = 0x04ef;\n t.umacrondieresis = 0x1e7b;\n t.umatragurmukhi = 0x0a41;\n t.umonospace = 0xff55;\n t.underscore = 0x005f;\n t.underscoredbl = 0x2017;\n t.underscoremonospace = 0xff3f;\n t.underscorevertical = 0xfe33;\n t.underscorewavy = 0xfe4f;\n t.union = 0x222a;\n t.universal = 0x2200;\n t.uogonek = 0x0173;\n t.uparen = 0x24b0;\n t.upblock = 0x2580;\n t.upperdothebrew = 0x05c4;\n t.upsilon = 0x03c5;\n t.upsilondieresis = 0x03cb;\n t.upsilondieresistonos = 0x03b0;\n t.upsilonlatin = 0x028a;\n t.upsilontonos = 0x03cd;\n t.uptackbelowcmb = 0x031d;\n t.uptackmod = 0x02d4;\n t.uragurmukhi = 0x0a73;\n t.uring = 0x016f;\n t.ushortcyrillic = 0x045e;\n t.usmallhiragana = 0x3045;\n t.usmallkatakana = 0x30a5;\n t.usmallkatakanahalfwidth = 0xff69;\n t.ustraightcyrillic = 0x04af;\n t.ustraightstrokecyrillic = 0x04b1;\n t.utilde = 0x0169;\n t.utildeacute = 0x1e79;\n t.utildebelow = 0x1e75;\n t.uubengali = 0x098a;\n t.uudeva = 0x090a;\n t.uugujarati = 0x0a8a;\n t.uugurmukhi = 0x0a0a;\n t.uumatragurmukhi = 0x0a42;\n t.uuvowelsignbengali = 0x09c2;\n t.uuvowelsigndeva = 0x0942;\n t.uuvowelsigngujarati = 0x0ac2;\n t.uvowelsignbengali = 0x09c1;\n t.uvowelsigndeva = 0x0941;\n t.uvowelsigngujarati = 0x0ac1;\n t.v = 0x0076;\n t.vadeva = 0x0935;\n t.vagujarati = 0x0ab5;\n t.vagurmukhi = 0x0a35;\n t.vakatakana = 0x30f7;\n t.vav = 0x05d5;\n t.vavdagesh = 0xfb35;\n t.vavdagesh65 = 0xfb35;\n t.vavdageshhebrew = 0xfb35;\n t.vavhebrew = 0x05d5;\n t.vavholam = 0xfb4b;\n t.vavholamhebrew = 0xfb4b;\n t.vavvavhebrew = 0x05f0;\n t.vavyodhebrew = 0x05f1;\n t.vcircle = 0x24e5;\n t.vdotbelow = 0x1e7f;\n t.vecyrillic = 0x0432;\n t.veharabic = 0x06a4;\n t.vehfinalarabic = 0xfb6b;\n t.vehinitialarabic = 0xfb6c;\n t.vehmedialarabic = 0xfb6d;\n t.vekatakana = 0x30f9;\n t.venus = 0x2640;\n t.verticalbar = 0x007c;\n t.verticallineabovecmb = 0x030d;\n t.verticallinebelowcmb = 0x0329;\n t.verticallinelowmod = 0x02cc;\n t.verticallinemod = 0x02c8;\n t.vewarmenian = 0x057e;\n t.vhook = 0x028b;\n t.vikatakana = 0x30f8;\n t.viramabengali = 0x09cd;\n t.viramadeva = 0x094d;\n t.viramagujarati = 0x0acd;\n t.visargabengali = 0x0983;\n t.visargadeva = 0x0903;\n t.visargagujarati = 0x0a83;\n t.vmonospace = 0xff56;\n t.voarmenian = 0x0578;\n t.voicediterationhiragana = 0x309e;\n t.voicediterationkatakana = 0x30fe;\n t.voicedmarkkana = 0x309b;\n t.voicedmarkkanahalfwidth = 0xff9e;\n t.vokatakana = 0x30fa;\n t.vparen = 0x24b1;\n t.vtilde = 0x1e7d;\n t.vturned = 0x028c;\n t.vuhiragana = 0x3094;\n t.vukatakana = 0x30f4;\n t.w = 0x0077;\n t.wacute = 0x1e83;\n t.waekorean = 0x3159;\n t.wahiragana = 0x308f;\n t.wakatakana = 0x30ef;\n t.wakatakanahalfwidth = 0xff9c;\n t.wakorean = 0x3158;\n t.wasmallhiragana = 0x308e;\n t.wasmallkatakana = 0x30ee;\n t.wattosquare = 0x3357;\n t.wavedash = 0x301c;\n t.wavyunderscorevertical = 0xfe34;\n t.wawarabic = 0x0648;\n t.wawfinalarabic = 0xfeee;\n t.wawhamzaabovearabic = 0x0624;\n t.wawhamzaabovefinalarabic = 0xfe86;\n t.wbsquare = 0x33dd;\n t.wcircle = 0x24e6;\n t.wcircumflex = 0x0175;\n t.wdieresis = 0x1e85;\n t.wdotaccent = 0x1e87;\n t.wdotbelow = 0x1e89;\n t.wehiragana = 0x3091;\n t.weierstrass = 0x2118;\n t.wekatakana = 0x30f1;\n t.wekorean = 0x315e;\n t.weokorean = 0x315d;\n t.wgrave = 0x1e81;\n t.whitebullet = 0x25e6;\n t.whitecircle = 0x25cb;\n t.whitecircleinverse = 0x25d9;\n t.whitecornerbracketleft = 0x300e;\n t.whitecornerbracketleftvertical = 0xfe43;\n t.whitecornerbracketright = 0x300f;\n t.whitecornerbracketrightvertical = 0xfe44;\n t.whitediamond = 0x25c7;\n t.whitediamondcontainingblacksmalldiamond = 0x25c8;\n t.whitedownpointingsmalltriangle = 0x25bf;\n t.whitedownpointingtriangle = 0x25bd;\n t.whiteleftpointingsmalltriangle = 0x25c3;\n t.whiteleftpointingtriangle = 0x25c1;\n t.whitelenticularbracketleft = 0x3016;\n t.whitelenticularbracketright = 0x3017;\n t.whiterightpointingsmalltriangle = 0x25b9;\n t.whiterightpointingtriangle = 0x25b7;\n t.whitesmallsquare = 0x25ab;\n t.whitesmilingface = 0x263a;\n t.whitesquare = 0x25a1;\n t.whitestar = 0x2606;\n t.whitetelephone = 0x260f;\n t.whitetortoiseshellbracketleft = 0x3018;\n t.whitetortoiseshellbracketright = 0x3019;\n t.whiteuppointingsmalltriangle = 0x25b5;\n t.whiteuppointingtriangle = 0x25b3;\n t.wihiragana = 0x3090;\n t.wikatakana = 0x30f0;\n t.wikorean = 0x315f;\n t.wmonospace = 0xff57;\n t.wohiragana = 0x3092;\n t.wokatakana = 0x30f2;\n t.wokatakanahalfwidth = 0xff66;\n t.won = 0x20a9;\n t.wonmonospace = 0xffe6;\n t.wowaenthai = 0x0e27;\n t.wparen = 0x24b2;\n t.wring = 0x1e98;\n t.wsuperior = 0x02b7;\n t.wturned = 0x028d;\n t.wynn = 0x01bf;\n t.x = 0x0078;\n t.xabovecmb = 0x033d;\n t.xbopomofo = 0x3112;\n t.xcircle = 0x24e7;\n t.xdieresis = 0x1e8d;\n t.xdotaccent = 0x1e8b;\n t.xeharmenian = 0x056d;\n t.xi = 0x03be;\n t.xmonospace = 0xff58;\n t.xparen = 0x24b3;\n t.xsuperior = 0x02e3;\n t.y = 0x0079;\n t.yaadosquare = 0x334e;\n t.yabengali = 0x09af;\n t.yacute = 0x00fd;\n t.yadeva = 0x092f;\n t.yaekorean = 0x3152;\n t.yagujarati = 0x0aaf;\n t.yagurmukhi = 0x0a2f;\n t.yahiragana = 0x3084;\n t.yakatakana = 0x30e4;\n t.yakatakanahalfwidth = 0xff94;\n t.yakorean = 0x3151;\n t.yamakkanthai = 0x0e4e;\n t.yasmallhiragana = 0x3083;\n t.yasmallkatakana = 0x30e3;\n t.yasmallkatakanahalfwidth = 0xff6c;\n t.yatcyrillic = 0x0463;\n t.ycircle = 0x24e8;\n t.ycircumflex = 0x0177;\n t.ydieresis = 0x00ff;\n t.ydotaccent = 0x1e8f;\n t.ydotbelow = 0x1ef5;\n t.yeharabic = 0x064a;\n t.yehbarreearabic = 0x06d2;\n t.yehbarreefinalarabic = 0xfbaf;\n t.yehfinalarabic = 0xfef2;\n t.yehhamzaabovearabic = 0x0626;\n t.yehhamzaabovefinalarabic = 0xfe8a;\n t.yehhamzaaboveinitialarabic = 0xfe8b;\n t.yehhamzaabovemedialarabic = 0xfe8c;\n t.yehinitialarabic = 0xfef3;\n t.yehmedialarabic = 0xfef4;\n t.yehmeeminitialarabic = 0xfcdd;\n t.yehmeemisolatedarabic = 0xfc58;\n t.yehnoonfinalarabic = 0xfc94;\n t.yehthreedotsbelowarabic = 0x06d1;\n t.yekorean = 0x3156;\n t.yen = 0x00a5;\n t.yenmonospace = 0xffe5;\n t.yeokorean = 0x3155;\n t.yeorinhieuhkorean = 0x3186;\n t.yerahbenyomohebrew = 0x05aa;\n t.yerahbenyomolefthebrew = 0x05aa;\n t.yericyrillic = 0x044b;\n t.yerudieresiscyrillic = 0x04f9;\n t.yesieungkorean = 0x3181;\n t.yesieungpansioskorean = 0x3183;\n t.yesieungsioskorean = 0x3182;\n t.yetivhebrew = 0x059a;\n t.ygrave = 0x1ef3;\n t.yhook = 0x01b4;\n t.yhookabove = 0x1ef7;\n t.yiarmenian = 0x0575;\n t.yicyrillic = 0x0457;\n t.yikorean = 0x3162;\n t.yinyang = 0x262f;\n t.yiwnarmenian = 0x0582;\n t.ymonospace = 0xff59;\n t.yod = 0x05d9;\n t.yoddagesh = 0xfb39;\n t.yoddageshhebrew = 0xfb39;\n t.yodhebrew = 0x05d9;\n t.yodyodhebrew = 0x05f2;\n t.yodyodpatahhebrew = 0xfb1f;\n t.yohiragana = 0x3088;\n t.yoikorean = 0x3189;\n t.yokatakana = 0x30e8;\n t.yokatakanahalfwidth = 0xff96;\n t.yokorean = 0x315b;\n t.yosmallhiragana = 0x3087;\n t.yosmallkatakana = 0x30e7;\n t.yosmallkatakanahalfwidth = 0xff6e;\n t.yotgreek = 0x03f3;\n t.yoyaekorean = 0x3188;\n t.yoyakorean = 0x3187;\n t.yoyakthai = 0x0e22;\n t.yoyingthai = 0x0e0d;\n t.yparen = 0x24b4;\n t.ypogegrammeni = 0x037a;\n t.ypogegrammenigreekcmb = 0x0345;\n t.yr = 0x01a6;\n t.yring = 0x1e99;\n t.ysuperior = 0x02b8;\n t.ytilde = 0x1ef9;\n t.yturned = 0x028e;\n t.yuhiragana = 0x3086;\n t.yuikorean = 0x318c;\n t.yukatakana = 0x30e6;\n t.yukatakanahalfwidth = 0xff95;\n t.yukorean = 0x3160;\n t.yusbigcyrillic = 0x046b;\n t.yusbigiotifiedcyrillic = 0x046d;\n t.yuslittlecyrillic = 0x0467;\n t.yuslittleiotifiedcyrillic = 0x0469;\n t.yusmallhiragana = 0x3085;\n t.yusmallkatakana = 0x30e5;\n t.yusmallkatakanahalfwidth = 0xff6d;\n t.yuyekorean = 0x318b;\n t.yuyeokorean = 0x318a;\n t.yyabengali = 0x09df;\n t.yyadeva = 0x095f;\n t.z = 0x007a;\n t.zaarmenian = 0x0566;\n t.zacute = 0x017a;\n t.zadeva = 0x095b;\n t.zagurmukhi = 0x0a5b;\n t.zaharabic = 0x0638;\n t.zahfinalarabic = 0xfec6;\n t.zahinitialarabic = 0xfec7;\n t.zahiragana = 0x3056;\n t.zahmedialarabic = 0xfec8;\n t.zainarabic = 0x0632;\n t.zainfinalarabic = 0xfeb0;\n t.zakatakana = 0x30b6;\n t.zaqefgadolhebrew = 0x0595;\n t.zaqefqatanhebrew = 0x0594;\n t.zarqahebrew = 0x0598;\n t.zayin = 0x05d6;\n t.zayindagesh = 0xfb36;\n t.zayindageshhebrew = 0xfb36;\n t.zayinhebrew = 0x05d6;\n t.zbopomofo = 0x3117;\n t.zcaron = 0x017e;\n t.zcircle = 0x24e9;\n t.zcircumflex = 0x1e91;\n t.zcurl = 0x0291;\n t.zdot = 0x017c;\n t.zdotaccent = 0x017c;\n t.zdotbelow = 0x1e93;\n t.zecyrillic = 0x0437;\n t.zedescendercyrillic = 0x0499;\n t.zedieresiscyrillic = 0x04df;\n t.zehiragana = 0x305c;\n t.zekatakana = 0x30bc;\n t.zero = 0x0030;\n t.zeroarabic = 0x0660;\n t.zerobengali = 0x09e6;\n t.zerodeva = 0x0966;\n t.zerogujarati = 0x0ae6;\n t.zerogurmukhi = 0x0a66;\n t.zerohackarabic = 0x0660;\n t.zeroinferior = 0x2080;\n t.zeromonospace = 0xff10;\n t.zerooldstyle = 0xf730;\n t.zeropersian = 0x06f0;\n t.zerosuperior = 0x2070;\n t.zerothai = 0x0e50;\n t.zerowidthjoiner = 0xfeff;\n t.zerowidthnonjoiner = 0x200c;\n t.zerowidthspace = 0x200b;\n t.zeta = 0x03b6;\n t.zhbopomofo = 0x3113;\n t.zhearmenian = 0x056a;\n t.zhebrevecyrillic = 0x04c2;\n t.zhecyrillic = 0x0436;\n t.zhedescendercyrillic = 0x0497;\n t.zhedieresiscyrillic = 0x04dd;\n t.zihiragana = 0x3058;\n t.zikatakana = 0x30b8;\n t.zinorhebrew = 0x05ae;\n t.zlinebelow = 0x1e95;\n t.zmonospace = 0xff5a;\n t.zohiragana = 0x305e;\n t.zokatakana = 0x30be;\n t.zparen = 0x24b5;\n t.zretroflexhook = 0x0290;\n t.zstroke = 0x01b6;\n t.zuhiragana = 0x305a;\n t.zukatakana = 0x30ba;\n t[\".notdef\"] = 0x0000;\n\n // TeX-specific glyph names.\n t.angbracketleftbig = 0x2329;\n t.angbracketleftBig = 0x2329;\n t.angbracketleftbigg = 0x2329;\n t.angbracketleftBigg = 0x2329;\n t.angbracketrightBig = 0x232a;\n t.angbracketrightbig = 0x232a;\n t.angbracketrightBigg = 0x232a;\n t.angbracketrightbigg = 0x232a;\n t.arrowhookleft = 0x21aa;\n t.arrowhookright = 0x21a9;\n t.arrowlefttophalf = 0x21bc;\n t.arrowleftbothalf = 0x21bd;\n t.arrownortheast = 0x2197;\n t.arrownorthwest = 0x2196;\n t.arrowrighttophalf = 0x21c0;\n t.arrowrightbothalf = 0x21c1;\n t.arrowsoutheast = 0x2198;\n t.arrowsouthwest = 0x2199;\n t.backslashbig = 0x2216;\n t.backslashBig = 0x2216;\n t.backslashBigg = 0x2216;\n t.backslashbigg = 0x2216;\n t.bardbl = 0x2016;\n t.bracehtipdownleft = 0xfe37;\n t.bracehtipdownright = 0xfe37;\n t.bracehtipupleft = 0xfe38;\n t.bracehtipupright = 0xfe38;\n t.braceleftBig = 0x007b;\n t.braceleftbig = 0x007b;\n t.braceleftbigg = 0x007b;\n t.braceleftBigg = 0x007b;\n t.bracerightBig = 0x007d;\n t.bracerightbig = 0x007d;\n t.bracerightbigg = 0x007d;\n t.bracerightBigg = 0x007d;\n t.bracketleftbig = 0x005b;\n t.bracketleftBig = 0x005b;\n t.bracketleftbigg = 0x005b;\n t.bracketleftBigg = 0x005b;\n t.bracketrightBig = 0x005d;\n t.bracketrightbig = 0x005d;\n t.bracketrightbigg = 0x005d;\n t.bracketrightBigg = 0x005d;\n t.ceilingleftbig = 0x2308;\n t.ceilingleftBig = 0x2308;\n t.ceilingleftBigg = 0x2308;\n t.ceilingleftbigg = 0x2308;\n t.ceilingrightbig = 0x2309;\n t.ceilingrightBig = 0x2309;\n t.ceilingrightbigg = 0x2309;\n t.ceilingrightBigg = 0x2309;\n t.circledotdisplay = 0x2299;\n t.circledottext = 0x2299;\n t.circlemultiplydisplay = 0x2297;\n t.circlemultiplytext = 0x2297;\n t.circleplusdisplay = 0x2295;\n t.circleplustext = 0x2295;\n t.contintegraldisplay = 0x222e;\n t.contintegraltext = 0x222e;\n t.coproductdisplay = 0x2210;\n t.coproducttext = 0x2210;\n t.floorleftBig = 0x230a;\n t.floorleftbig = 0x230a;\n t.floorleftbigg = 0x230a;\n t.floorleftBigg = 0x230a;\n t.floorrightbig = 0x230b;\n t.floorrightBig = 0x230b;\n t.floorrightBigg = 0x230b;\n t.floorrightbigg = 0x230b;\n t.hatwide = 0x0302;\n t.hatwider = 0x0302;\n t.hatwidest = 0x0302;\n t.intercal = 0x1d40;\n t.integraldisplay = 0x222b;\n t.integraltext = 0x222b;\n t.intersectiondisplay = 0x22c2;\n t.intersectiontext = 0x22c2;\n t.logicalanddisplay = 0x2227;\n t.logicalandtext = 0x2227;\n t.logicalordisplay = 0x2228;\n t.logicalortext = 0x2228;\n t.parenleftBig = 0x0028;\n t.parenleftbig = 0x0028;\n t.parenleftBigg = 0x0028;\n t.parenleftbigg = 0x0028;\n t.parenrightBig = 0x0029;\n t.parenrightbig = 0x0029;\n t.parenrightBigg = 0x0029;\n t.parenrightbigg = 0x0029;\n t.prime = 0x2032;\n t.productdisplay = 0x220f;\n t.producttext = 0x220f;\n t.radicalbig = 0x221a;\n t.radicalBig = 0x221a;\n t.radicalBigg = 0x221a;\n t.radicalbigg = 0x221a;\n t.radicalbt = 0x221a;\n t.radicaltp = 0x221a;\n t.radicalvertex = 0x221a;\n t.slashbig = 0x002f;\n t.slashBig = 0x002f;\n t.slashBigg = 0x002f;\n t.slashbigg = 0x002f;\n t.summationdisplay = 0x2211;\n t.summationtext = 0x2211;\n t.tildewide = 0x02dc;\n t.tildewider = 0x02dc;\n t.tildewidest = 0x02dc;\n t.uniondisplay = 0x22c3;\n t.unionmultidisplay = 0x228e;\n t.unionmultitext = 0x228e;\n t.unionsqdisplay = 0x2294;\n t.unionsqtext = 0x2294;\n t.uniontext = 0x22c3;\n t.vextenddouble = 0x2225;\n t.vextendsingle = 0x2223;\n});\n\nconst getDingbatsGlyphsUnicode = getLookupTableFactory(function (t) {\n t.space = 0x0020;\n t.a1 = 0x2701;\n t.a2 = 0x2702;\n t.a202 = 0x2703;\n t.a3 = 0x2704;\n t.a4 = 0x260e;\n t.a5 = 0x2706;\n t.a119 = 0x2707;\n t.a118 = 0x2708;\n t.a117 = 0x2709;\n t.a11 = 0x261b;\n t.a12 = 0x261e;\n t.a13 = 0x270c;\n t.a14 = 0x270d;\n t.a15 = 0x270e;\n t.a16 = 0x270f;\n t.a105 = 0x2710;\n t.a17 = 0x2711;\n t.a18 = 0x2712;\n t.a19 = 0x2713;\n t.a20 = 0x2714;\n t.a21 = 0x2715;\n t.a22 = 0x2716;\n t.a23 = 0x2717;\n t.a24 = 0x2718;\n t.a25 = 0x2719;\n t.a26 = 0x271a;\n t.a27 = 0x271b;\n t.a28 = 0x271c;\n t.a6 = 0x271d;\n t.a7 = 0x271e;\n t.a8 = 0x271f;\n t.a9 = 0x2720;\n t.a10 = 0x2721;\n t.a29 = 0x2722;\n t.a30 = 0x2723;\n t.a31 = 0x2724;\n t.a32 = 0x2725;\n t.a33 = 0x2726;\n t.a34 = 0x2727;\n t.a35 = 0x2605;\n t.a36 = 0x2729;\n t.a37 = 0x272a;\n t.a38 = 0x272b;\n t.a39 = 0x272c;\n t.a40 = 0x272d;\n t.a41 = 0x272e;\n t.a42 = 0x272f;\n t.a43 = 0x2730;\n t.a44 = 0x2731;\n t.a45 = 0x2732;\n t.a46 = 0x2733;\n t.a47 = 0x2734;\n t.a48 = 0x2735;\n t.a49 = 0x2736;\n t.a50 = 0x2737;\n t.a51 = 0x2738;\n t.a52 = 0x2739;\n t.a53 = 0x273a;\n t.a54 = 0x273b;\n t.a55 = 0x273c;\n t.a56 = 0x273d;\n t.a57 = 0x273e;\n t.a58 = 0x273f;\n t.a59 = 0x2740;\n t.a60 = 0x2741;\n t.a61 = 0x2742;\n t.a62 = 0x2743;\n t.a63 = 0x2744;\n t.a64 = 0x2745;\n t.a65 = 0x2746;\n t.a66 = 0x2747;\n t.a67 = 0x2748;\n t.a68 = 0x2749;\n t.a69 = 0x274a;\n t.a70 = 0x274b;\n t.a71 = 0x25cf;\n t.a72 = 0x274d;\n t.a73 = 0x25a0;\n t.a74 = 0x274f;\n t.a203 = 0x2750;\n t.a75 = 0x2751;\n t.a204 = 0x2752;\n t.a76 = 0x25b2;\n t.a77 = 0x25bc;\n t.a78 = 0x25c6;\n t.a79 = 0x2756;\n t.a81 = 0x25d7;\n t.a82 = 0x2758;\n t.a83 = 0x2759;\n t.a84 = 0x275a;\n t.a97 = 0x275b;\n t.a98 = 0x275c;\n t.a99 = 0x275d;\n t.a100 = 0x275e;\n t.a101 = 0x2761;\n t.a102 = 0x2762;\n t.a103 = 0x2763;\n t.a104 = 0x2764;\n t.a106 = 0x2765;\n t.a107 = 0x2766;\n t.a108 = 0x2767;\n t.a112 = 0x2663;\n t.a111 = 0x2666;\n t.a110 = 0x2665;\n t.a109 = 0x2660;\n t.a120 = 0x2460;\n t.a121 = 0x2461;\n t.a122 = 0x2462;\n t.a123 = 0x2463;\n t.a124 = 0x2464;\n t.a125 = 0x2465;\n t.a126 = 0x2466;\n t.a127 = 0x2467;\n t.a128 = 0x2468;\n t.a129 = 0x2469;\n t.a130 = 0x2776;\n t.a131 = 0x2777;\n t.a132 = 0x2778;\n t.a133 = 0x2779;\n t.a134 = 0x277a;\n t.a135 = 0x277b;\n t.a136 = 0x277c;\n t.a137 = 0x277d;\n t.a138 = 0x277e;\n t.a139 = 0x277f;\n t.a140 = 0x2780;\n t.a141 = 0x2781;\n t.a142 = 0x2782;\n t.a143 = 0x2783;\n t.a144 = 0x2784;\n t.a145 = 0x2785;\n t.a146 = 0x2786;\n t.a147 = 0x2787;\n t.a148 = 0x2788;\n t.a149 = 0x2789;\n t.a150 = 0x278a;\n t.a151 = 0x278b;\n t.a152 = 0x278c;\n t.a153 = 0x278d;\n t.a154 = 0x278e;\n t.a155 = 0x278f;\n t.a156 = 0x2790;\n t.a157 = 0x2791;\n t.a158 = 0x2792;\n t.a159 = 0x2793;\n t.a160 = 0x2794;\n t.a161 = 0x2192;\n t.a163 = 0x2194;\n t.a164 = 0x2195;\n t.a196 = 0x2798;\n t.a165 = 0x2799;\n t.a192 = 0x279a;\n t.a166 = 0x279b;\n t.a167 = 0x279c;\n t.a168 = 0x279d;\n t.a169 = 0x279e;\n t.a170 = 0x279f;\n t.a171 = 0x27a0;\n t.a172 = 0x27a1;\n t.a173 = 0x27a2;\n t.a162 = 0x27a3;\n t.a174 = 0x27a4;\n t.a175 = 0x27a5;\n t.a176 = 0x27a6;\n t.a177 = 0x27a7;\n t.a178 = 0x27a8;\n t.a179 = 0x27a9;\n t.a193 = 0x27aa;\n t.a180 = 0x27ab;\n t.a199 = 0x27ac;\n t.a181 = 0x27ad;\n t.a200 = 0x27ae;\n t.a182 = 0x27af;\n t.a201 = 0x27b1;\n t.a183 = 0x27b2;\n t.a184 = 0x27b3;\n t.a197 = 0x27b4;\n t.a185 = 0x27b5;\n t.a194 = 0x27b6;\n t.a198 = 0x27b7;\n t.a186 = 0x27b8;\n t.a195 = 0x27b9;\n t.a187 = 0x27ba;\n t.a188 = 0x27bb;\n t.a189 = 0x27bc;\n t.a190 = 0x27bd;\n t.a191 = 0x27be;\n t.a89 = 0x2768; // 0xF8D7\n t.a90 = 0x2769; // 0xF8D8\n t.a93 = 0x276a; // 0xF8D9\n t.a94 = 0x276b; // 0xF8DA\n t.a91 = 0x276c; // 0xF8DB\n t.a92 = 0x276d; // 0xF8DC\n t.a205 = 0x276e; // 0xF8DD\n t.a85 = 0x276f; // 0xF8DE\n t.a206 = 0x2770; // 0xF8DF\n t.a86 = 0x2771; // 0xF8E0\n t.a87 = 0x2772; // 0xF8E1\n t.a88 = 0x2773; // 0xF8E2\n t.a95 = 0x2774; // 0xF8E3\n t.a96 = 0x2775; // 0xF8E4\n t[\".notdef\"] = 0x0000;\n});\n\nexport { getDingbatsGlyphsUnicode, getGlyphsUnicode };\n","/* Copyright 2016 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { getLookupTableFactory } from \"./core_utils.js\";\n\n// Some characters, e.g. copyrightserif, are mapped to the private use area\n// and might not be displayed using standard fonts. Mapping/hacking well-known\n// chars to the similar equivalents in the normal characters range.\nconst getSpecialPUASymbols = getLookupTableFactory(function (t) {\n t[63721] = 0x00a9; // copyrightsans (0xF8E9) => copyright\n t[63193] = 0x00a9; // copyrightserif (0xF6D9) => copyright\n t[63720] = 0x00ae; // registersans (0xF8E8) => registered\n t[63194] = 0x00ae; // registerserif (0xF6DA) => registered\n t[63722] = 0x2122; // trademarksans (0xF8EA) => trademark\n t[63195] = 0x2122; // trademarkserif (0xF6DB) => trademark\n t[63729] = 0x23a7; // bracelefttp (0xF8F1)\n t[63730] = 0x23a8; // braceleftmid (0xF8F2)\n t[63731] = 0x23a9; // braceleftbt (0xF8F3)\n t[63740] = 0x23ab; // bracerighttp (0xF8FC)\n t[63741] = 0x23ac; // bracerightmid (0xF8FD)\n t[63742] = 0x23ad; // bracerightbt (0xF8FE)\n t[63726] = 0x23a1; // bracketlefttp (0xF8EE)\n t[63727] = 0x23a2; // bracketleftex (0xF8EF)\n t[63728] = 0x23a3; // bracketleftbt (0xF8F0)\n t[63737] = 0x23a4; // bracketrighttp (0xF8F9)\n t[63738] = 0x23a5; // bracketrightex (0xF8FA)\n t[63739] = 0x23a6; // bracketrightbt (0xF8FB)\n t[63723] = 0x239b; // parenlefttp (0xF8EB)\n t[63724] = 0x239c; // parenleftex (0xF8EC)\n t[63725] = 0x239d; // parenleftbt (0xF8ED)\n t[63734] = 0x239e; // parenrighttp (0xF8F6)\n t[63735] = 0x239f; // parenrightex (0xF8F7)\n t[63736] = 0x23a0; // parenrightbt (0xF8F8)\n});\n\nfunction mapSpecialUnicodeValues(code) {\n if (code >= 0xfff0 && code <= 0xffff) {\n // Specials unicode block.\n return 0;\n } else if (code >= 0xf600 && code <= 0xf8ff) {\n return getSpecialPUASymbols()[code] || code;\n } else if (code === /* softhyphen = */ 0x00ad) {\n return 0x002d; // hyphen\n }\n return code;\n}\n\nfunction getUnicodeForGlyph(name, glyphsUnicodeMap) {\n let unicode = glyphsUnicodeMap[name];\n if (unicode !== undefined) {\n return unicode;\n }\n if (!name) {\n return -1;\n }\n // Try to recover valid Unicode values from 'uniXXXX'/'uXXXX{XX}' glyphs.\n if (name[0] === \"u\") {\n const nameLen = name.length;\n let hexStr;\n\n if (nameLen === 7 && name[1] === \"n\" && name[2] === \"i\") {\n // 'uniXXXX'\n hexStr = name.substring(3);\n } else if (nameLen >= 5 && nameLen <= 7) {\n // 'uXXXX{XX}'\n hexStr = name.substring(1);\n } else {\n return -1;\n }\n // Check for upper-case hexadecimal characters, to avoid false positives.\n if (hexStr === hexStr.toUpperCase()) {\n unicode = parseInt(hexStr, 16);\n if (unicode >= 0) {\n return unicode;\n }\n }\n }\n return -1;\n}\n\n// See https://learn.microsoft.com/en-us/typography/opentype/spec/os2#ulunicoderange1-bits-031ulunicoderange2-bits-3263ulunicoderange3-bits-6495ulunicoderange4-bits-96127\nconst UnicodeRanges = [\n [0x0000, 0x007f], // 0 - Basic Latin\n [0x0080, 0x00ff], // 1 - Latin-1 Supplement\n [0x0100, 0x017f], // 2 - Latin Extended-A\n [0x0180, 0x024f], // 3 - Latin Extended-B\n [0x0250, 0x02af, 0x1d00, 0x1d7f, 0x1d80, 0x1dbf], // 4 - IPA Extensions - Phonetic Extensions - Phonetic Extensions Supplement\n [0x02b0, 0x02ff, 0xa700, 0xa71f], // 5 - Spacing Modifier Letters - Modifier Tone Letters\n [0x0300, 0x036f, 0x1dc0, 0x1dff], // 6 - Combining Diacritical Marks - Combining Diacritical Marks Supplement\n [0x0370, 0x03ff], // 7 - Greek and Coptic\n [0x2c80, 0x2cff], // 8 - Coptic\n [0x0400, 0x04ff, 0x0500, 0x052f, 0x2de0, 0x2dff, 0xa640, 0xa69f], // 9 - Cyrillic - Cyrillic Supplement - Cyrillic Extended-A - Cyrillic Extended-B\n [0x0530, 0x058f], // 10 - Armenian\n [0x0590, 0x05ff], // 11 - Hebrew\n [0xa500, 0xa63f], // 12 - Vai\n [0x0600, 0x06ff, 0x0750, 0x077f], // 13 - Arabic - Arabic Supplement\n [0x07c0, 0x07ff], // 14 - NKo\n [0x0900, 0x097f], // 15 - Devanagari\n [0x0980, 0x09ff], // 16 - Bengali\n [0x0a00, 0x0a7f], // 17 - Gurmukhi\n [0x0a80, 0x0aff], // 18 - Gujarati\n [0x0b00, 0x0b7f], // 19 - Oriya\n [0x0b80, 0x0bff], // 20 - Tamil\n [0x0c00, 0x0c7f], // 21 - Telugu\n [0x0c80, 0x0cff], // 22 - Kannada\n [0x0d00, 0x0d7f], // 23 - Malayalam\n [0x0e00, 0x0e7f], // 24 - Thai\n [0x0e80, 0x0eff], // 25 - Lao\n [0x10a0, 0x10ff, 0x2d00, 0x2d2f], // 26 - Georgian - Georgian Supplement\n [0x1b00, 0x1b7f], // 27 - Balinese\n [0x1100, 0x11ff], // 28 - Hangul Jamo\n [0x1e00, 0x1eff, 0x2c60, 0x2c7f, 0xa720, 0xa7ff], // 29 - Latin Extended Additional - Latin Extended-C - Latin Extended-D\n [0x1f00, 0x1fff], // 30 - Greek Extended\n [0x2000, 0x206f, 0x2e00, 0x2e7f], // 31 - General Punctuation - Supplemental Punctuation\n [0x2070, 0x209f], // 32 - Superscripts And Subscripts\n [0x20a0, 0x20cf], // 33 - Currency Symbol\n [0x20d0, 0x20ff], // 34 - Combining Diacritical Marks\n [0x2100, 0x214f], // 35 - Letterlike Symbols\n [0x2150, 0x218f], // 36 - Number Forms\n [0x2190, 0x21ff, 0x27f0, 0x27ff, 0x2900, 0x297f, 0x2b00, 0x2bff], // 37 - Arrows - Supplemental Arrows-A - Supplemental Arrows-B - Miscellaneous Symbols and Arrows\n [0x2200, 0x22ff, 0x2a00, 0x2aff, 0x27c0, 0x27ef, 0x2980, 0x29ff], // 38 - Mathematical Operators - Supplemental Mathematical Operators - Miscellaneous Mathematical Symbols-A - Miscellaneous Mathematical Symbols-B\n [0x2300, 0x23ff], // 39 - Miscellaneous Technical\n [0x2400, 0x243f], // 40 - Control Pictures\n [0x2440, 0x245f], // 41 - Optical Character Recognition\n [0x2460, 0x24ff], // 42 - Enclosed Alphanumerics\n [0x2500, 0x257f], // 43 - Box Drawing\n [0x2580, 0x259f], // 44 - Block Elements\n [0x25a0, 0x25ff], // 45 - Geometric Shapes\n [0x2600, 0x26ff], // 46 - Miscellaneous Symbols\n [0x2700, 0x27bf], // 47 - Dingbats\n [0x3000, 0x303f], // 48 - CJK Symbols And Punctuation\n [0x3040, 0x309f], // 49 - Hiragana\n [0x30a0, 0x30ff, 0x31f0, 0x31ff], // 50 - Katakana - Katakana Phonetic Extensions\n [0x3100, 0x312f, 0x31a0, 0x31bf], // 51 - Bopomofo - Bopomofo Extended\n [0x3130, 0x318f], // 52 - Hangul Compatibility Jamo\n [0xa840, 0xa87f], // 53 - Phags-pa\n [0x3200, 0x32ff], // 54 - Enclosed CJK Letters And Months\n [0x3300, 0x33ff], // 55 - CJK Compatibility\n [0xac00, 0xd7af], // 56 - Hangul Syllables\n [0xd800, 0xdfff], // 57 - Non-Plane 0 *\n [0x10900, 0x1091f], // 58 - Phoenicia\n [\n 0x4e00, 0x9fff, 0x2e80, 0x2eff, 0x2f00, 0x2fdf, 0x2ff0, 0x2fff, 0x3400,\n 0x4dbf, 0x20000, 0x2a6df, 0x3190, 0x319f,\n ], // 59 - CJK Unified Ideographs - CJK Radicals Supplement - Kangxi Radicals - Ideographic Description Characters - CJK Unified Ideographs Extension A - CJK Unified Ideographs Extension B - Kanbun\n [0xe000, 0xf8ff], // 60 - Private Use Area (plane 0)\n [0x31c0, 0x31ef, 0xf900, 0xfaff, 0x2f800, 0x2fa1f], // 61 - CJK Strokes - CJK Compatibility Ideographs - CJK Compatibility Ideographs Supplement\n [0xfb00, 0xfb4f], // 62 - Alphabetic Presentation Forms\n [0xfb50, 0xfdff], // 63 - Arabic Presentation Forms-A\n [0xfe20, 0xfe2f], // 64 - Combining Half Marks\n [0xfe10, 0xfe1f], // 65 - Vertical Forms\n [0xfe50, 0xfe6f], // 66 - Small Form Variants\n [0xfe70, 0xfeff], // 67 - Arabic Presentation Forms-B\n [0xff00, 0xffef], // 68 - Halfwidth And Fullwidth Forms\n [0xfff0, 0xffff], // 69 - Specials\n [0x0f00, 0x0fff], // 70 - Tibetan\n [0x0700, 0x074f], // 71 - Syriac\n [0x0780, 0x07bf], // 72 - Thaana\n [0x0d80, 0x0dff], // 73 - Sinhala\n [0x1000, 0x109f], // 74 - Myanmar\n [0x1200, 0x137f, 0x1380, 0x139f, 0x2d80, 0x2ddf], // 75 - Ethiopic - Ethiopic Supplement - Ethiopic Extended\n [0x13a0, 0x13ff], // 76 - Cherokee\n [0x1400, 0x167f], // 77 - Unified Canadian Aboriginal Syllabics\n [0x1680, 0x169f], // 78 - Ogham\n [0x16a0, 0x16ff], // 79 - Runic\n [0x1780, 0x17ff], // 80 - Khmer\n [0x1800, 0x18af], // 81 - Mongolian\n [0x2800, 0x28ff], // 82 - Braille Patterns\n [0xa000, 0xa48f], // 83 - Yi Syllables\n [0x1700, 0x171f, 0x1720, 0x173f, 0x1740, 0x175f, 0x1760, 0x177f], // 84 - Tagalog - Hanunoo - Buhid - Tagbanwa\n [0x10300, 0x1032f], // 85 - Old Italic\n [0x10330, 0x1034f], // 86 - Gothic\n [0x10400, 0x1044f], // 87 - Deseret\n [0x1d000, 0x1d0ff, 0x1d100, 0x1d1ff, 0x1d200, 0x1d24f], // 88 - Byzantine Musical Symbols - Musical Symbols - Ancient Greek Musical Notation\n [0x1d400, 0x1d7ff], // 89 - Mathematical Alphanumeric Symbols\n [0xff000, 0xffffd], // 90 - Private Use (plane 15)\n [0xfe00, 0xfe0f, 0xe0100, 0xe01ef], // 91 - Variation Selectors - Variation Selectors Supplement\n [0xe0000, 0xe007f], // 92 - Tags\n [0x1900, 0x194f], // 93 - Limbu\n [0x1950, 0x197f], // 94 - Tai Le\n [0x1980, 0x19df], // 95 - New Tai Lue\n [0x1a00, 0x1a1f], // 96 - Buginese\n [0x2c00, 0x2c5f], // 97 - Glagolitic\n [0x2d30, 0x2d7f], // 98 - Tifinagh\n [0x4dc0, 0x4dff], // 99 - Yijing Hexagram Symbols\n [0xa800, 0xa82f], // 100 - Syloti Nagri\n [0x10000, 0x1007f, 0x10080, 0x100ff, 0x10100, 0x1013f], // 101 - Linear B Syllabary - Linear B Ideograms - Aegean Numbers\n [0x10140, 0x1018f], // 102 - Ancient Greek Numbers\n [0x10380, 0x1039f], // 103 - Ugaritic\n [0x103a0, 0x103df], // 104 - Old Persian\n [0x10450, 0x1047f], // 105 - Shavian\n [0x10480, 0x104af], // 106 - Osmanya\n [0x10800, 0x1083f], // 107 - Cypriot Syllabary\n [0x10a00, 0x10a5f], // 108 - Kharoshthi\n [0x1d300, 0x1d35f], // 109 - Tai Xuan Jing Symbols\n [0x12000, 0x123ff, 0x12400, 0x1247f], // 110 - Cuneiform - Cuneiform Numbers and Punctuation\n [0x1d360, 0x1d37f], // 111 - Counting Rod Numerals\n [0x1b80, 0x1bbf], // 112 - Sundanese\n [0x1c00, 0x1c4f], // 113 - Lepcha\n [0x1c50, 0x1c7f], // 114 - Ol Chiki\n [0xa880, 0xa8df], // 115 - Saurashtra\n [0xa900, 0xa92f], // 116 - Kayah Li\n [0xa930, 0xa95f], // 117 - Rejang\n [0xaa00, 0xaa5f], // 118 - Cham\n [0x10190, 0x101cf], // 119 - Ancient Symbols\n [0x101d0, 0x101ff], // 120 - Phaistos Disc\n [0x102a0, 0x102df, 0x10280, 0x1029f, 0x10920, 0x1093f], // 121 - Carian - Lycian - Lydian\n [0x1f030, 0x1f09f, 0x1f000, 0x1f02f], // 122 - Domino Tiles - Mahjong Tiles\n];\n\nfunction getUnicodeRangeFor(value, lastPosition = -1) {\n // TODO: create a map range => position, sort the ranges and cache it.\n // Then we can make a binary search for finding a range for a given unicode.\n if (lastPosition !== -1) {\n const range = UnicodeRanges[lastPosition];\n for (let i = 0, ii = range.length; i < ii; i += 2) {\n if (value >= range[i] && value <= range[i + 1]) {\n return lastPosition;\n }\n }\n }\n for (let i = 0, ii = UnicodeRanges.length; i < ii; i++) {\n const range = UnicodeRanges[i];\n for (let j = 0, jj = range.length; j < jj; j += 2) {\n if (value >= range[j] && value <= range[j + 1]) {\n return i;\n }\n }\n }\n return -1;\n}\n\nconst SpecialCharRegExp = new RegExp(\"^(\\\\s)|(\\\\p{Mn})|(\\\\p{Cf})$\", \"u\");\nconst CategoryCache = new Map();\n\nfunction getCharUnicodeCategory(char) {\n const cachedCategory = CategoryCache.get(char);\n if (cachedCategory) {\n return cachedCategory;\n }\n const groups = char.match(SpecialCharRegExp);\n const category = {\n isWhitespace: !!groups?.[1],\n isZeroWidthDiacritic: !!groups?.[2],\n isInvisibleFormatMark: !!groups?.[3],\n };\n CategoryCache.set(char, category);\n return category;\n}\n\nfunction clearUnicodeCaches() {\n CategoryCache.clear();\n}\n\nexport {\n clearUnicodeCaches,\n getCharUnicodeCategory,\n getUnicodeForGlyph,\n getUnicodeRangeFor,\n mapSpecialUnicodeValues,\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 { getEncoding, StandardEncoding } from \"./encodings.js\";\nimport { getGlyphsUnicode } from \"./glyphlist.js\";\nimport { getUnicodeForGlyph } from \"./unicode.js\";\nimport { info } from \"../shared/util.js\";\n\n// Accented characters have issues on Windows and Linux. When this flag is\n// enabled glyphs that use seac and seac style endchar operators are truncated\n// and we instead just store the glyph id's of the base glyph and its accent to\n// be drawn individually.\n// Linux (freetype) requires that when a seac style endchar is used\n// that the charset must be a predefined one, however we build a\n// custom one. Windows just refuses to draw glyphs with seac operators.\nconst SEAC_ANALYSIS_ENABLED = true;\n\nconst FontFlags = {\n FixedPitch: 1,\n Serif: 2,\n Symbolic: 4,\n Script: 8,\n Nonsymbolic: 32,\n Italic: 64,\n AllCap: 65536,\n SmallCap: 131072,\n ForceBold: 262144,\n};\n\n// prettier-ignore\nconst MacStandardGlyphOrdering = [\n \".notdef\", \".null\", \"nonmarkingreturn\", \"space\", \"exclam\", \"quotedbl\",\n \"numbersign\", \"dollar\", \"percent\", \"ampersand\", \"quotesingle\", \"parenleft\",\n \"parenright\", \"asterisk\", \"plus\", \"comma\", \"hyphen\", \"period\", \"slash\",\n \"zero\", \"one\", \"two\", \"three\", \"four\", \"five\", \"six\", \"seven\", \"eight\",\n \"nine\", \"colon\", \"semicolon\", \"less\", \"equal\", \"greater\", \"question\", \"at\",\n \"A\", \"B\", \"C\", \"D\", \"E\", \"F\", \"G\", \"H\", \"I\", \"J\", \"K\", \"L\", \"M\", \"N\", \"O\",\n \"P\", \"Q\", \"R\", \"S\", \"T\", \"U\", \"V\", \"W\", \"X\", \"Y\", \"Z\", \"bracketleft\",\n \"backslash\", \"bracketright\", \"asciicircum\", \"underscore\", \"grave\", \"a\", \"b\",\n \"c\", \"d\", \"e\", \"f\", \"g\", \"h\", \"i\", \"j\", \"k\", \"l\", \"m\", \"n\", \"o\", \"p\", \"q\",\n \"r\", \"s\", \"t\", \"u\", \"v\", \"w\", \"x\", \"y\", \"z\", \"braceleft\", \"bar\", \"braceright\",\n \"asciitilde\", \"Adieresis\", \"Aring\", \"Ccedilla\", \"Eacute\", \"Ntilde\",\n \"Odieresis\", \"Udieresis\", \"aacute\", \"agrave\", \"acircumflex\", \"adieresis\",\n \"atilde\", \"aring\", \"ccedilla\", \"eacute\", \"egrave\", \"ecircumflex\", \"edieresis\",\n \"iacute\", \"igrave\", \"icircumflex\", \"idieresis\", \"ntilde\", \"oacute\", \"ograve\",\n \"ocircumflex\", \"odieresis\", \"otilde\", \"uacute\", \"ugrave\", \"ucircumflex\",\n \"udieresis\", \"dagger\", \"degree\", \"cent\", \"sterling\", \"section\", \"bullet\",\n \"paragraph\", \"germandbls\", \"registered\", \"copyright\", \"trademark\", \"acute\",\n \"dieresis\", \"notequal\", \"AE\", \"Oslash\", \"infinity\", \"plusminus\", \"lessequal\",\n \"greaterequal\", \"yen\", \"mu\", \"partialdiff\", \"summation\", \"product\", \"pi\",\n \"integral\", \"ordfeminine\", \"ordmasculine\", \"Omega\", \"ae\", \"oslash\",\n \"questiondown\", \"exclamdown\", \"logicalnot\", \"radical\", \"florin\",\n \"approxequal\", \"Delta\", \"guillemotleft\", \"guillemotright\", \"ellipsis\",\n \"nonbreakingspace\", \"Agrave\", \"Atilde\", \"Otilde\", \"OE\", \"oe\", \"endash\",\n \"emdash\", \"quotedblleft\", \"quotedblright\", \"quoteleft\", \"quoteright\",\n \"divide\", \"lozenge\", \"ydieresis\", \"Ydieresis\", \"fraction\", \"currency\",\n \"guilsinglleft\", \"guilsinglright\", \"fi\", \"fl\", \"daggerdbl\", \"periodcentered\",\n \"quotesinglbase\", \"quotedblbase\", \"perthousand\", \"Acircumflex\",\n \"Ecircumflex\", \"Aacute\", \"Edieresis\", \"Egrave\", \"Iacute\", \"Icircumflex\",\n \"Idieresis\", \"Igrave\", \"Oacute\", \"Ocircumflex\", \"apple\", \"Ograve\", \"Uacute\",\n \"Ucircumflex\", \"Ugrave\", \"dotlessi\", \"circumflex\", \"tilde\", \"macron\",\n \"breve\", \"dotaccent\", \"ring\", \"cedilla\", \"hungarumlaut\", \"ogonek\", \"caron\",\n \"Lslash\", \"lslash\", \"Scaron\", \"scaron\", \"Zcaron\", \"zcaron\", \"brokenbar\",\n \"Eth\", \"eth\", \"Yacute\", \"yacute\", \"Thorn\", \"thorn\", \"minus\", \"multiply\",\n \"onesuperior\", \"twosuperior\", \"threesuperior\", \"onehalf\", \"onequarter\",\n \"threequarters\", \"franc\", \"Gbreve\", \"gbreve\", \"Idotaccent\", \"Scedilla\",\n \"scedilla\", \"Cacute\", \"cacute\", \"Ccaron\", \"ccaron\", \"dcroat\"];\n\n// Some bad PDF generators, e.g. Scribus PDF, include glyph names\n// in a 'uniXXXX' format -- attempting to recover proper ones.\nfunction recoverGlyphName(name, glyphsUnicodeMap) {\n if (glyphsUnicodeMap[name] !== undefined) {\n return name;\n }\n // The glyph name is non-standard, trying to recover.\n const unicode = getUnicodeForGlyph(name, glyphsUnicodeMap);\n if (unicode !== -1) {\n for (const key in glyphsUnicodeMap) {\n if (glyphsUnicodeMap[key] === unicode) {\n return key;\n }\n }\n }\n info(\"Unable to recover a standard glyph name for: \" + name);\n return name;\n}\n\n/**\n * Shared logic for building a char code to glyph id mapping for Type1 and\n * simple CFF fonts. See section 9.6.6.2 of the spec.\n * @param {Object} properties Font properties object.\n * @param {Object} builtInEncoding The encoding contained within the actual font\n * data.\n * @param {Array} glyphNames Array of glyph names where the index is the\n * glyph ID.\n * @returns {Object} A char code to glyph ID map.\n */\nfunction type1FontGlyphMapping(properties, builtInEncoding, glyphNames) {\n const charCodeToGlyphId = Object.create(null);\n let glyphId, charCode, baseEncoding;\n const isSymbolicFont = !!(properties.flags & FontFlags.Symbolic);\n\n if (properties.isInternalFont) {\n baseEncoding = builtInEncoding;\n for (charCode = 0; charCode < baseEncoding.length; charCode++) {\n glyphId = glyphNames.indexOf(baseEncoding[charCode]);\n charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : /* notdef = */ 0;\n }\n } else if (properties.baseEncodingName) {\n // If a valid base encoding name was used, the mapping is initialized with\n // that.\n baseEncoding = getEncoding(properties.baseEncodingName);\n for (charCode = 0; charCode < baseEncoding.length; charCode++) {\n glyphId = glyphNames.indexOf(baseEncoding[charCode]);\n charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : /* notdef = */ 0;\n }\n } else if (isSymbolicFont) {\n // For a symbolic font the encoding should be the fonts built-in encoding.\n for (charCode in builtInEncoding) {\n charCodeToGlyphId[charCode] = builtInEncoding[charCode];\n }\n } else {\n // For non-symbolic fonts that don't have a base encoding the standard\n // encoding should be used.\n baseEncoding = StandardEncoding;\n for (charCode = 0; charCode < baseEncoding.length; charCode++) {\n glyphId = glyphNames.indexOf(baseEncoding[charCode]);\n charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : /* notdef = */ 0;\n }\n }\n\n // Lastly, merge in the differences.\n const differences = properties.differences;\n let glyphsUnicodeMap;\n if (differences) {\n for (charCode in differences) {\n const glyphName = differences[charCode];\n glyphId = glyphNames.indexOf(glyphName);\n\n if (glyphId === -1) {\n if (!glyphsUnicodeMap) {\n glyphsUnicodeMap = getGlyphsUnicode();\n }\n const standardGlyphName = recoverGlyphName(glyphName, glyphsUnicodeMap);\n if (standardGlyphName !== glyphName) {\n glyphId = glyphNames.indexOf(standardGlyphName);\n }\n }\n charCodeToGlyphId[charCode] = glyphId >= 0 ? glyphId : /* notdef = */ 0;\n }\n }\n return charCodeToGlyphId;\n}\n\nfunction normalizeFontName(name) {\n return name.replaceAll(/[,_]/g, \"-\").replaceAll(/\\s/g, \"\");\n}\n\nexport {\n FontFlags,\n MacStandardGlyphOrdering,\n normalizeFontName,\n recoverGlyphName,\n SEAC_ANALYSIS_ENABLED,\n type1FontGlyphMapping,\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 { getLookupTableFactory } from \"./core_utils.js\";\nimport { normalizeFontName } from \"./fonts_utils.js\";\n\n/**\n * Hold a map of decoded fonts and of the standard fourteen Type1\n * fonts and their acronyms.\n */\nconst getStdFontMap = getLookupTableFactory(function (t) {\n // The standard 14 fonts:\n t[\"Times-Roman\"] = \"Times-Roman\";\n t.Helvetica = \"Helvetica\";\n t.Courier = \"Courier\";\n t.Symbol = \"Symbol\";\n t[\"Times-Bold\"] = \"Times-Bold\";\n t[\"Helvetica-Bold\"] = \"Helvetica-Bold\";\n t[\"Courier-Bold\"] = \"Courier-Bold\";\n t.ZapfDingbats = \"ZapfDingbats\";\n t[\"Times-Italic\"] = \"Times-Italic\";\n t[\"Helvetica-Oblique\"] = \"Helvetica-Oblique\";\n t[\"Courier-Oblique\"] = \"Courier-Oblique\";\n t[\"Times-BoldItalic\"] = \"Times-BoldItalic\";\n t[\"Helvetica-BoldOblique\"] = \"Helvetica-BoldOblique\";\n t[\"Courier-BoldOblique\"] = \"Courier-BoldOblique\";\n\n // Extra mappings\n t.ArialNarrow = \"Helvetica\";\n t[\"ArialNarrow-Bold\"] = \"Helvetica-Bold\";\n t[\"ArialNarrow-BoldItalic\"] = \"Helvetica-BoldOblique\";\n t[\"ArialNarrow-Italic\"] = \"Helvetica-Oblique\";\n t.ArialBlack = \"Helvetica\";\n t[\"ArialBlack-Bold\"] = \"Helvetica-Bold\";\n t[\"ArialBlack-BoldItalic\"] = \"Helvetica-BoldOblique\";\n t[\"ArialBlack-Italic\"] = \"Helvetica-Oblique\";\n t[\"Arial-Black\"] = \"Helvetica\";\n t[\"Arial-Black-Bold\"] = \"Helvetica-Bold\";\n t[\"Arial-Black-BoldItalic\"] = \"Helvetica-BoldOblique\";\n t[\"Arial-Black-Italic\"] = \"Helvetica-Oblique\";\n t.Arial = \"Helvetica\";\n t[\"Arial-Bold\"] = \"Helvetica-Bold\";\n t[\"Arial-BoldItalic\"] = \"Helvetica-BoldOblique\";\n t[\"Arial-Italic\"] = \"Helvetica-Oblique\";\n t.ArialMT = \"Helvetica\";\n t[\"Arial-BoldItalicMT\"] = \"Helvetica-BoldOblique\";\n t[\"Arial-BoldMT\"] = \"Helvetica-Bold\";\n t[\"Arial-ItalicMT\"] = \"Helvetica-Oblique\";\n t[\"Arial-BoldItalicMT-BoldItalic\"] = \"Helvetica-BoldOblique\";\n t[\"Arial-BoldMT-Bold\"] = \"Helvetica-Bold\";\n t[\"Arial-ItalicMT-Italic\"] = \"Helvetica-Oblique\";\n t.ArialUnicodeMS = \"Helvetica\";\n t[\"ArialUnicodeMS-Bold\"] = \"Helvetica-Bold\";\n t[\"ArialUnicodeMS-BoldItalic\"] = \"Helvetica-BoldOblique\";\n t[\"ArialUnicodeMS-Italic\"] = \"Helvetica-Oblique\";\n t[\"Courier-BoldItalic\"] = \"Courier-BoldOblique\";\n t[\"Courier-Italic\"] = \"Courier-Oblique\";\n t.CourierNew = \"Courier\";\n t[\"CourierNew-Bold\"] = \"Courier-Bold\";\n t[\"CourierNew-BoldItalic\"] = \"Courier-BoldOblique\";\n t[\"CourierNew-Italic\"] = \"Courier-Oblique\";\n t[\"CourierNewPS-BoldItalicMT\"] = \"Courier-BoldOblique\";\n t[\"CourierNewPS-BoldMT\"] = \"Courier-Bold\";\n t[\"CourierNewPS-ItalicMT\"] = \"Courier-Oblique\";\n t.CourierNewPSMT = \"Courier\";\n t[\"Helvetica-BoldItalic\"] = \"Helvetica-BoldOblique\";\n t[\"Helvetica-Italic\"] = \"Helvetica-Oblique\";\n t[\"Symbol-Bold\"] = \"Symbol\";\n t[\"Symbol-BoldItalic\"] = \"Symbol\";\n t[\"Symbol-Italic\"] = \"Symbol\";\n t.TimesNewRoman = \"Times-Roman\";\n t[\"TimesNewRoman-Bold\"] = \"Times-Bold\";\n t[\"TimesNewRoman-BoldItalic\"] = \"Times-BoldItalic\";\n t[\"TimesNewRoman-Italic\"] = \"Times-Italic\";\n t.TimesNewRomanPS = \"Times-Roman\";\n t[\"TimesNewRomanPS-Bold\"] = \"Times-Bold\";\n t[\"TimesNewRomanPS-BoldItalic\"] = \"Times-BoldItalic\";\n t[\"TimesNewRomanPS-BoldItalicMT\"] = \"Times-BoldItalic\";\n t[\"TimesNewRomanPS-BoldMT\"] = \"Times-Bold\";\n t[\"TimesNewRomanPS-Italic\"] = \"Times-Italic\";\n t[\"TimesNewRomanPS-ItalicMT\"] = \"Times-Italic\";\n t.TimesNewRomanPSMT = \"Times-Roman\";\n t[\"TimesNewRomanPSMT-Bold\"] = \"Times-Bold\";\n t[\"TimesNewRomanPSMT-BoldItalic\"] = \"Times-BoldItalic\";\n t[\"TimesNewRomanPSMT-Italic\"] = \"Times-Italic\";\n});\n\n// Contains mapping for standard fonts and xfa fonts.\nconst getFontNameToFileMap = getLookupTableFactory(function (t) {\n t.Courier = \"FoxitFixed.pfb\";\n t[\"Courier-Bold\"] = \"FoxitFixedBold.pfb\";\n t[\"Courier-BoldOblique\"] = \"FoxitFixedBoldItalic.pfb\";\n t[\"Courier-Oblique\"] = \"FoxitFixedItalic.pfb\";\n t.Helvetica = \"LiberationSans-Regular.ttf\";\n t[\"Helvetica-Bold\"] = \"LiberationSans-Bold.ttf\";\n t[\"Helvetica-BoldOblique\"] = \"LiberationSans-BoldItalic.ttf\";\n t[\"Helvetica-Oblique\"] = \"LiberationSans-Italic.ttf\";\n t[\"Times-Roman\"] = \"FoxitSerif.pfb\";\n t[\"Times-Bold\"] = \"FoxitSerifBold.pfb\";\n t[\"Times-BoldItalic\"] = \"FoxitSerifBoldItalic.pfb\";\n t[\"Times-Italic\"] = \"FoxitSerifItalic.pfb\";\n t.Symbol = \"FoxitSymbol.pfb\";\n t.ZapfDingbats = \"FoxitDingbats.pfb\";\n t[\"LiberationSans-Regular\"] = \"LiberationSans-Regular.ttf\";\n t[\"LiberationSans-Bold\"] = \"LiberationSans-Bold.ttf\";\n t[\"LiberationSans-Italic\"] = \"LiberationSans-Italic.ttf\";\n t[\"LiberationSans-BoldItalic\"] = \"LiberationSans-BoldItalic.ttf\";\n});\n\n/**\n * Holds the map of the non-standard fonts that might be included as\n * a standard fonts without glyph data.\n */\nconst getNonStdFontMap = getLookupTableFactory(function (t) {\n t.Calibri = \"Helvetica\";\n t[\"Calibri-Bold\"] = \"Helvetica-Bold\";\n t[\"Calibri-BoldItalic\"] = \"Helvetica-BoldOblique\";\n t[\"Calibri-Italic\"] = \"Helvetica-Oblique\";\n t.CenturyGothic = \"Helvetica\";\n t[\"CenturyGothic-Bold\"] = \"Helvetica-Bold\";\n t[\"CenturyGothic-BoldItalic\"] = \"Helvetica-BoldOblique\";\n t[\"CenturyGothic-Italic\"] = \"Helvetica-Oblique\";\n t.ComicSansMS = \"Comic Sans MS\";\n t[\"ComicSansMS-Bold\"] = \"Comic Sans MS-Bold\";\n t[\"ComicSansMS-BoldItalic\"] = \"Comic Sans MS-BoldItalic\";\n t[\"ComicSansMS-Italic\"] = \"Comic Sans MS-Italic\";\n t.Impact = \"Helvetica\";\n t[\"ItcSymbol-Bold\"] = \"Helvetica-Bold\";\n t[\"ItcSymbol-BoldItalic\"] = \"Helvetica-BoldOblique\";\n t[\"ItcSymbol-Book\"] = \"Helvetica\";\n t[\"ItcSymbol-BookItalic\"] = \"Helvetica-Oblique\";\n t[\"ItcSymbol-Medium\"] = \"Helvetica\";\n t[\"ItcSymbol-MediumItalic\"] = \"Helvetica-Oblique\";\n t.LucidaConsole = \"Courier\";\n t[\"LucidaConsole-Bold\"] = \"Courier-Bold\";\n t[\"LucidaConsole-BoldItalic\"] = \"Courier-BoldOblique\";\n t[\"LucidaConsole-Italic\"] = \"Courier-Oblique\";\n t[\"LucidaSans-Demi\"] = \"Helvetica-Bold\";\n t[\"MS-Gothic\"] = \"MS Gothic\";\n t[\"MS-Gothic-Bold\"] = \"MS Gothic-Bold\";\n t[\"MS-Gothic-BoldItalic\"] = \"MS Gothic-BoldItalic\";\n t[\"MS-Gothic-Italic\"] = \"MS Gothic-Italic\";\n t[\"MS-Mincho\"] = \"MS Mincho\";\n t[\"MS-Mincho-Bold\"] = \"MS Mincho-Bold\";\n t[\"MS-Mincho-BoldItalic\"] = \"MS Mincho-BoldItalic\";\n t[\"MS-Mincho-Italic\"] = \"MS Mincho-Italic\";\n t[\"MS-PGothic\"] = \"MS PGothic\";\n t[\"MS-PGothic-Bold\"] = \"MS PGothic-Bold\";\n t[\"MS-PGothic-BoldItalic\"] = \"MS PGothic-BoldItalic\";\n t[\"MS-PGothic-Italic\"] = \"MS PGothic-Italic\";\n t[\"MS-PMincho\"] = \"MS PMincho\";\n t[\"MS-PMincho-Bold\"] = \"MS PMincho-Bold\";\n t[\"MS-PMincho-BoldItalic\"] = \"MS PMincho-BoldItalic\";\n t[\"MS-PMincho-Italic\"] = \"MS PMincho-Italic\";\n t.NuptialScript = \"Times-Italic\";\n t.SegoeUISymbol = \"Helvetica\";\n});\n\nconst getSerifFonts = getLookupTableFactory(function (t) {\n t[\"Adobe Jenson\"] = true;\n t[\"Adobe Text\"] = true;\n t.Albertus = true;\n t.Aldus = true;\n t.Alexandria = true;\n t.Algerian = true;\n t[\"American Typewriter\"] = true;\n t.Antiqua = true;\n t.Apex = true;\n t.Arno = true;\n t.Aster = true;\n t.Aurora = true;\n t.Baskerville = true;\n t.Bell = true;\n t.Bembo = true;\n t[\"Bembo Schoolbook\"] = true;\n t.Benguiat = true;\n t[\"Berkeley Old Style\"] = true;\n t[\"Bernhard Modern\"] = true;\n t[\"Berthold City\"] = true;\n t.Bodoni = true;\n t[\"Bauer Bodoni\"] = true;\n t[\"Book Antiqua\"] = true;\n t.Bookman = true;\n t[\"Bordeaux Roman\"] = true;\n t[\"Californian FB\"] = true;\n t.Calisto = true;\n t.Calvert = true;\n t.Capitals = true;\n t.Cambria = true;\n t.Cartier = true;\n t.Caslon = true;\n t.Catull = true;\n t.Centaur = true;\n t[\"Century Old Style\"] = true;\n t[\"Century Schoolbook\"] = true;\n t.Chaparral = true;\n t[\"Charis SIL\"] = true;\n t.Cheltenham = true;\n t[\"Cholla Slab\"] = true;\n t.Clarendon = true;\n t.Clearface = true;\n t.Cochin = true;\n t.Colonna = true;\n t[\"Computer Modern\"] = true;\n t[\"Concrete Roman\"] = true;\n t.Constantia = true;\n t[\"Cooper Black\"] = true;\n t.Corona = true;\n t.Ecotype = true;\n t.Egyptienne = true;\n t.Elephant = true;\n t.Excelsior = true;\n t.Fairfield = true;\n t[\"FF Scala\"] = true;\n t.Folkard = true;\n t.Footlight = true;\n t.FreeSerif = true;\n t[\"Friz Quadrata\"] = true;\n t.Garamond = true;\n t.Gentium = true;\n t.Georgia = true;\n t.Gloucester = true;\n t[\"Goudy Old Style\"] = true;\n t[\"Goudy Schoolbook\"] = true;\n t[\"Goudy Pro Font\"] = true;\n t.Granjon = true;\n t[\"Guardian Egyptian\"] = true;\n t.Heather = true;\n t.Hercules = true;\n t[\"High Tower Text\"] = true;\n t.Hiroshige = true;\n t[\"Hoefler Text\"] = true;\n t[\"Humana Serif\"] = true;\n t.Imprint = true;\n t[\"Ionic No. 5\"] = true;\n t.Janson = true;\n t.Joanna = true;\n t.Korinna = true;\n t.Lexicon = true;\n t.LiberationSerif = true;\n t[\"Liberation Serif\"] = true;\n t[\"Linux Libertine\"] = true;\n t.Literaturnaya = true;\n t.Lucida = true;\n t[\"Lucida Bright\"] = true;\n t.Melior = true;\n t.Memphis = true;\n t.Miller = true;\n t.Minion = true;\n t.Modern = true;\n t[\"Mona Lisa\"] = true;\n t[\"Mrs Eaves\"] = true;\n t[\"MS Serif\"] = true;\n t[\"Museo Slab\"] = true;\n t[\"New York\"] = true;\n t[\"Nimbus Roman\"] = true;\n t[\"NPS Rawlinson Roadway\"] = true;\n t.NuptialScript = true;\n t.Palatino = true;\n t.Perpetua = true;\n t.Plantin = true;\n t[\"Plantin Schoolbook\"] = true;\n t.Playbill = true;\n t[\"Poor Richard\"] = true;\n t[\"Rawlinson Roadway\"] = true;\n t.Renault = true;\n t.Requiem = true;\n t.Rockwell = true;\n t.Roman = true;\n t[\"Rotis Serif\"] = true;\n t.Sabon = true;\n t.Scala = true;\n t.Seagull = true;\n t.Sistina = true;\n t.Souvenir = true;\n t.STIX = true;\n t[\"Stone Informal\"] = true;\n t[\"Stone Serif\"] = true;\n t.Sylfaen = true;\n t.Times = true;\n t.Trajan = true;\n t[\"Trinité\"] = true;\n t[\"Trump Mediaeval\"] = true;\n t.Utopia = true;\n t[\"Vale Type\"] = true;\n t[\"Bitstream Vera\"] = true;\n t[\"Vera Serif\"] = true;\n t.Versailles = true;\n t.Wanted = true;\n t.Weiss = true;\n t[\"Wide Latin\"] = true;\n t.Windsor = true;\n t.XITS = true;\n});\n\nconst getSymbolsFonts = getLookupTableFactory(function (t) {\n t.Dingbats = true;\n t.Symbol = true;\n t.ZapfDingbats = true;\n t.Wingdings = true;\n t[\"Wingdings-Bold\"] = true;\n t[\"Wingdings-Regular\"] = true;\n});\n\n// Glyph map for well-known standard fonts. Sometimes Ghostscript uses CID\n// fonts, but does not embed the CID to GID mapping. The mapping is incomplete\n// for all glyphs, but common for some set of the standard fonts.\nconst getGlyphMapForStandardFonts = getLookupTableFactory(function (t) {\n t[2] = 10;\n t[3] = 32;\n t[4] = 33;\n t[5] = 34;\n t[6] = 35;\n t[7] = 36;\n t[8] = 37;\n t[9] = 38;\n t[10] = 39;\n t[11] = 40;\n t[12] = 41;\n t[13] = 42;\n t[14] = 43;\n t[15] = 44;\n t[16] = 45;\n t[17] = 46;\n t[18] = 47;\n t[19] = 48;\n t[20] = 49;\n t[21] = 50;\n t[22] = 51;\n t[23] = 52;\n t[24] = 53;\n t[25] = 54;\n t[26] = 55;\n t[27] = 56;\n t[28] = 57;\n t[29] = 58;\n t[30] = 894;\n t[31] = 60;\n t[32] = 61;\n t[33] = 62;\n t[34] = 63;\n t[35] = 64;\n t[36] = 65;\n t[37] = 66;\n t[38] = 67;\n t[39] = 68;\n t[40] = 69;\n t[41] = 70;\n t[42] = 71;\n t[43] = 72;\n t[44] = 73;\n t[45] = 74;\n t[46] = 75;\n t[47] = 76;\n t[48] = 77;\n t[49] = 78;\n t[50] = 79;\n t[51] = 80;\n t[52] = 81;\n t[53] = 82;\n t[54] = 83;\n t[55] = 84;\n t[56] = 85;\n t[57] = 86;\n t[58] = 87;\n t[59] = 88;\n t[60] = 89;\n t[61] = 90;\n t[62] = 91;\n t[63] = 92;\n t[64] = 93;\n t[65] = 94;\n t[66] = 95;\n t[67] = 96;\n t[68] = 97;\n t[69] = 98;\n t[70] = 99;\n t[71] = 100;\n t[72] = 101;\n t[73] = 102;\n t[74] = 103;\n t[75] = 104;\n t[76] = 105;\n t[77] = 106;\n t[78] = 107;\n t[79] = 108;\n t[80] = 109;\n t[81] = 110;\n t[82] = 111;\n t[83] = 112;\n t[84] = 113;\n t[85] = 114;\n t[86] = 115;\n t[87] = 116;\n t[88] = 117;\n t[89] = 118;\n t[90] = 119;\n t[91] = 120;\n t[92] = 121;\n t[93] = 122;\n t[94] = 123;\n t[95] = 124;\n t[96] = 125;\n t[97] = 126;\n t[98] = 196;\n t[99] = 197;\n t[100] = 199;\n t[101] = 201;\n t[102] = 209;\n t[103] = 214;\n t[104] = 220;\n t[105] = 225;\n t[106] = 224;\n t[107] = 226;\n t[108] = 228;\n t[109] = 227;\n t[110] = 229;\n t[111] = 231;\n t[112] = 233;\n t[113] = 232;\n t[114] = 234;\n t[115] = 235;\n t[116] = 237;\n t[117] = 236;\n t[118] = 238;\n t[119] = 239;\n t[120] = 241;\n t[121] = 243;\n t[122] = 242;\n t[123] = 244;\n t[124] = 246;\n t[125] = 245;\n t[126] = 250;\n t[127] = 249;\n t[128] = 251;\n t[129] = 252;\n t[130] = 8224;\n t[131] = 176;\n t[132] = 162;\n t[133] = 163;\n t[134] = 167;\n t[135] = 8226;\n t[136] = 182;\n t[137] = 223;\n t[138] = 174;\n t[139] = 169;\n t[140] = 8482;\n t[141] = 180;\n t[142] = 168;\n t[143] = 8800;\n t[144] = 198;\n t[145] = 216;\n t[146] = 8734;\n t[147] = 177;\n t[148] = 8804;\n t[149] = 8805;\n t[150] = 165;\n t[151] = 181;\n t[152] = 8706;\n t[153] = 8721;\n t[154] = 8719;\n t[156] = 8747;\n t[157] = 170;\n t[158] = 186;\n t[159] = 8486;\n t[160] = 230;\n t[161] = 248;\n t[162] = 191;\n t[163] = 161;\n t[164] = 172;\n t[165] = 8730;\n t[166] = 402;\n t[167] = 8776;\n t[168] = 8710;\n t[169] = 171;\n t[170] = 187;\n t[171] = 8230;\n t[179] = 8220;\n t[180] = 8221;\n t[181] = 8216;\n t[182] = 8217;\n t[200] = 193;\n t[203] = 205;\n t[207] = 211;\n t[210] = 218;\n t[223] = 711;\n t[224] = 321;\n t[225] = 322;\n t[226] = 352;\n t[227] = 353;\n t[228] = 381;\n t[229] = 382;\n t[233] = 221;\n t[234] = 253;\n t[252] = 263;\n t[253] = 268;\n t[254] = 269;\n t[258] = 258;\n t[260] = 260;\n t[261] = 261;\n t[265] = 280;\n t[266] = 281;\n t[267] = 282;\n t[268] = 283;\n t[269] = 313;\n t[275] = 323;\n t[276] = 324;\n t[278] = 328;\n t[283] = 344;\n t[284] = 345;\n t[285] = 346;\n t[286] = 347;\n t[292] = 367;\n t[295] = 377;\n t[296] = 378;\n t[298] = 380;\n t[305] = 963;\n t[306] = 964;\n t[307] = 966;\n t[308] = 8215;\n t[309] = 8252;\n t[310] = 8319;\n t[311] = 8359;\n t[312] = 8592;\n t[313] = 8593;\n t[337] = 9552;\n t[493] = 1039;\n t[494] = 1040;\n t[672] = 1488;\n t[673] = 1489;\n t[674] = 1490;\n t[675] = 1491;\n t[676] = 1492;\n t[677] = 1493;\n t[678] = 1494;\n t[679] = 1495;\n t[680] = 1496;\n t[681] = 1497;\n t[682] = 1498;\n t[683] = 1499;\n t[684] = 1500;\n t[685] = 1501;\n t[686] = 1502;\n t[687] = 1503;\n t[688] = 1504;\n t[689] = 1505;\n t[690] = 1506;\n t[691] = 1507;\n t[692] = 1508;\n t[693] = 1509;\n t[694] = 1510;\n t[695] = 1511;\n t[696] = 1512;\n t[697] = 1513;\n t[698] = 1514;\n t[705] = 1524;\n t[706] = 8362;\n t[710] = 64288;\n t[711] = 64298;\n t[759] = 1617;\n t[761] = 1776;\n t[763] = 1778;\n t[775] = 1652;\n t[777] = 1764;\n t[778] = 1780;\n t[779] = 1781;\n t[780] = 1782;\n t[782] = 771;\n t[783] = 64726;\n t[786] = 8363;\n t[788] = 8532;\n t[790] = 768;\n t[791] = 769;\n t[792] = 768;\n t[795] = 803;\n t[797] = 64336;\n t[798] = 64337;\n t[799] = 64342;\n t[800] = 64343;\n t[801] = 64344;\n t[802] = 64345;\n t[803] = 64362;\n t[804] = 64363;\n t[805] = 64364;\n t[2424] = 7821;\n t[2425] = 7822;\n t[2426] = 7823;\n t[2427] = 7824;\n t[2428] = 7825;\n t[2429] = 7826;\n t[2430] = 7827;\n t[2433] = 7682;\n t[2678] = 8045;\n t[2679] = 8046;\n t[2830] = 1552;\n t[2838] = 686;\n t[2840] = 751;\n t[2842] = 753;\n t[2843] = 754;\n t[2844] = 755;\n t[2846] = 757;\n t[2856] = 767;\n t[2857] = 848;\n t[2858] = 849;\n t[2862] = 853;\n t[2863] = 854;\n t[2864] = 855;\n t[2865] = 861;\n t[2866] = 862;\n t[2906] = 7460;\n t[2908] = 7462;\n t[2909] = 7463;\n t[2910] = 7464;\n t[2912] = 7466;\n t[2913] = 7467;\n t[2914] = 7468;\n t[2916] = 7470;\n t[2917] = 7471;\n t[2918] = 7472;\n t[2920] = 7474;\n t[2921] = 7475;\n t[2922] = 7476;\n t[2924] = 7478;\n t[2925] = 7479;\n t[2926] = 7480;\n t[2928] = 7482;\n t[2929] = 7483;\n t[2930] = 7484;\n t[2932] = 7486;\n t[2933] = 7487;\n t[2934] = 7488;\n t[2936] = 7490;\n t[2937] = 7491;\n t[2938] = 7492;\n t[2940] = 7494;\n t[2941] = 7495;\n t[2942] = 7496;\n t[2944] = 7498;\n t[2946] = 7500;\n t[2948] = 7502;\n t[2950] = 7504;\n t[2951] = 7505;\n t[2952] = 7506;\n t[2954] = 7508;\n t[2955] = 7509;\n t[2956] = 7510;\n t[2958] = 7512;\n t[2959] = 7513;\n t[2960] = 7514;\n t[2962] = 7516;\n t[2963] = 7517;\n t[2964] = 7518;\n t[2966] = 7520;\n t[2967] = 7521;\n t[2968] = 7522;\n t[2970] = 7524;\n t[2971] = 7525;\n t[2972] = 7526;\n t[2974] = 7528;\n t[2975] = 7529;\n t[2976] = 7530;\n t[2978] = 1537;\n t[2979] = 1538;\n t[2980] = 1539;\n t[2982] = 1549;\n t[2983] = 1551;\n t[2984] = 1552;\n t[2986] = 1554;\n t[2987] = 1555;\n t[2988] = 1556;\n t[2990] = 1623;\n t[2991] = 1624;\n t[2995] = 1775;\n t[2999] = 1791;\n t[3002] = 64290;\n t[3003] = 64291;\n t[3004] = 64292;\n t[3006] = 64294;\n t[3007] = 64295;\n t[3008] = 64296;\n t[3011] = 1900;\n t[3014] = 8223;\n t[3015] = 8244;\n t[3017] = 7532;\n t[3018] = 7533;\n t[3019] = 7534;\n t[3075] = 7590;\n t[3076] = 7591;\n t[3079] = 7594;\n t[3080] = 7595;\n t[3083] = 7598;\n t[3084] = 7599;\n t[3087] = 7602;\n t[3088] = 7603;\n t[3091] = 7606;\n t[3092] = 7607;\n t[3095] = 7610;\n t[3096] = 7611;\n t[3099] = 7614;\n t[3100] = 7615;\n t[3103] = 7618;\n t[3104] = 7619;\n t[3107] = 8337;\n t[3108] = 8338;\n t[3116] = 1884;\n t[3119] = 1885;\n t[3120] = 1885;\n t[3123] = 1886;\n t[3124] = 1886;\n t[3127] = 1887;\n t[3128] = 1887;\n t[3131] = 1888;\n t[3132] = 1888;\n t[3135] = 1889;\n t[3136] = 1889;\n t[3139] = 1890;\n t[3140] = 1890;\n t[3143] = 1891;\n t[3144] = 1891;\n t[3147] = 1892;\n t[3148] = 1892;\n t[3153] = 580;\n t[3154] = 581;\n t[3157] = 584;\n t[3158] = 585;\n t[3161] = 588;\n t[3162] = 589;\n t[3165] = 891;\n t[3166] = 892;\n t[3169] = 1274;\n t[3170] = 1275;\n t[3173] = 1278;\n t[3174] = 1279;\n t[3181] = 7622;\n t[3182] = 7623;\n t[3282] = 11799;\n t[3316] = 578;\n t[3379] = 42785;\n t[3393] = 1159;\n t[3416] = 8377;\n});\n\n// The glyph map for ArialBlack differs slightly from the glyph map used for\n// other well-known standard fonts. Hence we use this (incomplete) CID to GID\n// mapping to adjust the glyph map for non-embedded ArialBlack fonts.\nconst getSupplementalGlyphMapForArialBlack = getLookupTableFactory(\n function (t) {\n t[227] = 322;\n t[264] = 261;\n t[291] = 346;\n }\n);\n\n// The glyph map for Calibri (a Windows font) differs from the glyph map used\n// in the standard fonts. Hence we use this (incomplete) CID to GID mapping to\n// adjust the glyph map for non-embedded Calibri fonts.\nconst getSupplementalGlyphMapForCalibri = getLookupTableFactory(function (t) {\n t[1] = 32;\n t[4] = 65;\n t[5] = 192;\n t[6] = 193;\n t[9] = 196;\n t[17] = 66;\n t[18] = 67;\n t[21] = 268;\n t[24] = 68;\n t[28] = 69;\n t[29] = 200;\n t[30] = 201;\n t[32] = 282;\n t[38] = 70;\n t[39] = 71;\n t[44] = 72;\n t[47] = 73;\n t[48] = 204;\n t[49] = 205;\n t[58] = 74;\n t[60] = 75;\n t[62] = 76;\n t[68] = 77;\n t[69] = 78;\n t[75] = 79;\n t[76] = 210;\n t[80] = 214;\n t[87] = 80;\n t[89] = 81;\n t[90] = 82;\n t[92] = 344;\n t[94] = 83;\n t[97] = 352;\n t[100] = 84;\n t[104] = 85;\n t[109] = 220;\n t[115] = 86;\n t[116] = 87;\n t[121] = 88;\n t[122] = 89;\n t[124] = 221;\n t[127] = 90;\n t[129] = 381;\n t[258] = 97;\n t[259] = 224;\n t[260] = 225;\n t[263] = 228;\n t[268] = 261;\n t[271] = 98;\n t[272] = 99;\n t[273] = 263;\n t[275] = 269;\n t[282] = 100;\n t[286] = 101;\n t[287] = 232;\n t[288] = 233;\n t[290] = 283;\n t[295] = 281;\n t[296] = 102;\n t[336] = 103;\n t[346] = 104;\n t[349] = 105;\n t[350] = 236;\n t[351] = 237;\n t[361] = 106;\n t[364] = 107;\n t[367] = 108;\n t[371] = 322;\n t[373] = 109;\n t[374] = 110;\n t[381] = 111;\n t[382] = 242;\n t[383] = 243;\n t[386] = 246;\n t[393] = 112;\n t[395] = 113;\n t[396] = 114;\n t[398] = 345;\n t[400] = 115;\n t[401] = 347;\n t[403] = 353;\n t[410] = 116;\n t[437] = 117;\n t[442] = 252;\n t[448] = 118;\n t[449] = 119;\n t[454] = 120;\n t[455] = 121;\n t[457] = 253;\n t[460] = 122;\n t[462] = 382;\n t[463] = 380;\n t[853] = 44;\n t[855] = 58;\n t[856] = 46;\n t[876] = 47;\n t[878] = 45;\n t[882] = 45;\n t[894] = 40;\n t[895] = 41;\n t[896] = 91;\n t[897] = 93;\n t[923] = 64;\n t[1004] = 48;\n t[1005] = 49;\n t[1006] = 50;\n t[1007] = 51;\n t[1008] = 52;\n t[1009] = 53;\n t[1010] = 54;\n t[1011] = 55;\n t[1012] = 56;\n t[1013] = 57;\n t[1081] = 37;\n t[1085] = 43;\n t[1086] = 45;\n});\n\nfunction getStandardFontName(name) {\n const fontName = normalizeFontName(name);\n const stdFontMap = getStdFontMap();\n return stdFontMap[fontName];\n}\n\nfunction isKnownFontName(name) {\n const fontName = normalizeFontName(name);\n return !!(\n getStdFontMap()[fontName] ||\n getNonStdFontMap()[fontName] ||\n getSerifFonts()[fontName] ||\n getSymbolsFonts()[fontName]\n );\n}\n\nexport {\n getFontNameToFileMap,\n getGlyphMapForStandardFonts,\n getNonStdFontMap,\n getSerifFonts,\n getStandardFontName,\n getStdFontMap,\n getSupplementalGlyphMapForArialBlack,\n getSupplementalGlyphMapForCalibri,\n getSymbolsFonts,\n isKnownFontName,\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 { unreachable } from \"../shared/util.js\";\n\nclass ToUnicodeMap {\n constructor(cmap = []) {\n // The elements of this._map can be integers or strings, depending on how\n // `cmap` was created.\n this._map = cmap;\n }\n\n get length() {\n return this._map.length;\n }\n\n forEach(callback) {\n for (const charCode in this._map) {\n callback(charCode, this._map[charCode].charCodeAt(0));\n }\n }\n\n has(i) {\n return this._map[i] !== undefined;\n }\n\n get(i) {\n return this._map[i];\n }\n\n charCodeOf(value) {\n // `Array.prototype.indexOf` is *extremely* inefficient for arrays which\n // are both very sparse and very large (see issue8372.pdf).\n const map = this._map;\n if (map.length <= 0x10000) {\n return map.indexOf(value);\n }\n for (const charCode in map) {\n if (map[charCode] === value) {\n return charCode | 0;\n }\n }\n return -1;\n }\n\n amend(map) {\n for (const charCode in map) {\n this._map[charCode] = map[charCode];\n }\n }\n}\n\nclass IdentityToUnicodeMap {\n constructor(firstChar, lastChar) {\n this.firstChar = firstChar;\n this.lastChar = lastChar;\n }\n\n get length() {\n return this.lastChar + 1 - this.firstChar;\n }\n\n forEach(callback) {\n for (let i = this.firstChar, ii = this.lastChar; i <= ii; i++) {\n callback(i, i);\n }\n }\n\n has(i) {\n return this.firstChar <= i && i <= this.lastChar;\n }\n\n get(i) {\n if (this.firstChar <= i && i <= this.lastChar) {\n return String.fromCharCode(i);\n }\n return undefined;\n }\n\n charCodeOf(v) {\n return Number.isInteger(v) && v >= this.firstChar && v <= this.lastChar\n ? v\n : -1;\n }\n\n amend(map) {\n unreachable(\"Should not call amend()\");\n }\n}\n\nexport { IdentityToUnicodeMap, ToUnicodeMap };\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 { CFFCompiler, CFFParser } from \"./cff_parser.js\";\nimport { SEAC_ANALYSIS_ENABLED, type1FontGlyphMapping } from \"./fonts_utils.js\";\nimport { warn } from \"../shared/util.js\";\n\nclass CFFFont {\n constructor(file, properties) {\n this.properties = properties;\n\n const parser = new CFFParser(file, properties, SEAC_ANALYSIS_ENABLED);\n this.cff = parser.parse();\n this.cff.duplicateFirstGlyph();\n const compiler = new CFFCompiler(this.cff);\n this.seacs = this.cff.seacs;\n try {\n this.data = compiler.compile();\n } catch {\n warn(\"Failed to compile font \" + properties.loadedName);\n // There may have just been an issue with the compiler, set the data\n // anyway and hope the font loaded.\n this.data = file;\n }\n this._createBuiltInEncoding();\n }\n\n get numGlyphs() {\n return this.cff.charStrings.count;\n }\n\n getCharset() {\n return this.cff.charset.charset;\n }\n\n getGlyphMapping() {\n const cff = this.cff;\n const properties = this.properties;\n const { cidToGidMap, cMap } = properties;\n const charsets = cff.charset.charset;\n let charCodeToGlyphId;\n let glyphId;\n\n if (properties.composite) {\n let invCidToGidMap;\n if (cidToGidMap?.length > 0) {\n invCidToGidMap = Object.create(null);\n for (let i = 0, ii = cidToGidMap.length; i < ii; i++) {\n const gid = cidToGidMap[i];\n if (gid !== undefined) {\n invCidToGidMap[gid] = i;\n }\n }\n }\n\n charCodeToGlyphId = Object.create(null);\n let charCode;\n if (cff.isCIDFont) {\n // If the font is actually a CID font then we should use the charset\n // to map CIDs to GIDs.\n for (glyphId = 0; glyphId < charsets.length; glyphId++) {\n const cid = charsets[glyphId];\n charCode = cMap.charCodeOf(cid);\n\n if (invCidToGidMap?.[charCode] !== undefined) {\n // According to the PDF specification, see Table 117, it's not clear\n // that a /CIDToGIDMap should be used with any non-TrueType fonts,\n // however it's necessary to do so in order to fix issue 15559.\n //\n // It seems, in the CFF-case, that the /CIDToGIDMap needs to be used\n // \"inverted\" compared to the TrueType-case. Here it thus seem to be\n // a charCode mapping, rather than the normal CID to GID mapping.\n charCode = invCidToGidMap[charCode];\n }\n charCodeToGlyphId[charCode] = glyphId;\n }\n } else {\n // If it is NOT actually a CID font then CIDs should be mapped\n // directly to GIDs.\n for (glyphId = 0; glyphId < cff.charStrings.count; glyphId++) {\n charCode = cMap.charCodeOf(glyphId);\n charCodeToGlyphId[charCode] = glyphId;\n }\n }\n return charCodeToGlyphId;\n }\n\n let encoding = cff.encoding ? cff.encoding.encoding : null;\n if (properties.isInternalFont) {\n encoding = properties.defaultEncoding;\n }\n charCodeToGlyphId = type1FontGlyphMapping(properties, encoding, charsets);\n return charCodeToGlyphId;\n }\n\n hasGlyphId(id) {\n return this.cff.hasGlyphId(id);\n }\n\n /**\n * @private\n */\n _createBuiltInEncoding() {\n const { charset, encoding } = this.cff;\n if (!charset || !encoding) {\n return;\n }\n const charsets = charset.charset,\n encodings = encoding.encoding;\n const map = [];\n\n for (const charCode in encodings) {\n const glyphId = encodings[charCode];\n if (glyphId >= 0) {\n const glyphName = charsets[glyphId];\n if (glyphName) {\n map[charCode] = glyphName;\n }\n }\n }\n if (map.length > 0) {\n this.properties.builtInEncoding = map;\n }\n }\n}\n\nexport { CFFFont };\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 bytesToString,\n FONT_IDENTITY_MATRIX,\n FormatError,\n unreachable,\n warn,\n} from \"../shared/util.js\";\nimport { CFFParser } from \"./cff_parser.js\";\nimport { getGlyphsUnicode } from \"./glyphlist.js\";\nimport { StandardEncoding } from \"./encodings.js\";\nimport { Stream } from \"./stream.js\";\n\n// TODO: use DataView and its methods.\n\nfunction getUint32(data, offset) {\n return (\n ((data[offset] << 24) |\n (data[offset + 1] << 16) |\n (data[offset + 2] << 8) |\n data[offset + 3]) >>>\n 0\n );\n}\n\nfunction getUint16(data, offset) {\n return (data[offset] << 8) | data[offset + 1];\n}\n\nfunction getInt16(data, offset) {\n return ((data[offset] << 24) | (data[offset + 1] << 16)) >> 16;\n}\n\nfunction getInt8(data, offset) {\n return (data[offset] << 24) >> 24;\n}\n\nfunction getFloat214(data, offset) {\n return getInt16(data, offset) / 16384;\n}\n\nfunction getSubroutineBias(subrs) {\n const numSubrs = subrs.length;\n let bias = 32768;\n if (numSubrs < 1240) {\n bias = 107;\n } else if (numSubrs < 33900) {\n bias = 1131;\n }\n return bias;\n}\n\nfunction parseCmap(data, start, end) {\n const offset =\n getUint16(data, start + 2) === 1\n ? getUint32(data, start + 8)\n : getUint32(data, start + 16);\n const format = getUint16(data, start + offset);\n let ranges, p, i;\n if (format === 4) {\n getUint16(data, start + offset + 2); // length\n const segCount = getUint16(data, start + offset + 6) >> 1;\n p = start + offset + 14;\n ranges = [];\n for (i = 0; i < segCount; i++, p += 2) {\n ranges[i] = { end: getUint16(data, p) };\n }\n p += 2;\n for (i = 0; i < segCount; i++, p += 2) {\n ranges[i].start = getUint16(data, p);\n }\n for (i = 0; i < segCount; i++, p += 2) {\n ranges[i].idDelta = getUint16(data, p);\n }\n for (i = 0; i < segCount; i++, p += 2) {\n let idOffset = getUint16(data, p);\n if (idOffset === 0) {\n continue;\n }\n ranges[i].ids = [];\n for (let j = 0, jj = ranges[i].end - ranges[i].start + 1; j < jj; j++) {\n ranges[i].ids[j] = getUint16(data, p + idOffset);\n idOffset += 2;\n }\n }\n return ranges;\n } else if (format === 12) {\n const groups = getUint32(data, start + offset + 12);\n p = start + offset + 16;\n ranges = [];\n for (i = 0; i < groups; i++) {\n start = getUint32(data, p);\n ranges.push({\n start,\n end: getUint32(data, p + 4),\n idDelta: getUint32(data, p + 8) - start,\n });\n p += 12;\n }\n return ranges;\n }\n throw new FormatError(`unsupported cmap: ${format}`);\n}\n\nfunction parseCff(data, start, end, seacAnalysisEnabled) {\n const properties = {};\n const parser = new CFFParser(\n new Stream(data, start, end - start),\n properties,\n seacAnalysisEnabled\n );\n const cff = parser.parse();\n return {\n glyphs: cff.charStrings.objects,\n subrs: cff.topDict.privateDict?.subrsIndex?.objects,\n gsubrs: cff.globalSubrIndex?.objects,\n isCFFCIDFont: cff.isCIDFont,\n fdSelect: cff.fdSelect,\n fdArray: cff.fdArray,\n };\n}\n\nfunction parseGlyfTable(glyf, loca, isGlyphLocationsLong) {\n let itemSize, itemDecode;\n if (isGlyphLocationsLong) {\n itemSize = 4;\n itemDecode = getUint32;\n } else {\n itemSize = 2;\n itemDecode = (data, offset) => 2 * getUint16(data, offset);\n }\n const glyphs = [];\n let startOffset = itemDecode(loca, 0);\n for (let j = itemSize; j < loca.length; j += itemSize) {\n const endOffset = itemDecode(loca, j);\n glyphs.push(glyf.subarray(startOffset, endOffset));\n startOffset = endOffset;\n }\n return glyphs;\n}\n\nfunction lookupCmap(ranges, unicode) {\n const code = unicode.codePointAt(0);\n let gid = 0,\n l = 0,\n r = ranges.length - 1;\n while (l < r) {\n const c = (l + r + 1) >> 1;\n if (code < ranges[c].start) {\n r = c - 1;\n } else {\n l = c;\n }\n }\n if (ranges[l].start <= code && code <= ranges[l].end) {\n gid =\n (ranges[l].idDelta +\n (ranges[l].ids ? ranges[l].ids[code - ranges[l].start] : code)) &\n 0xffff;\n }\n return {\n charCode: code,\n glyphId: gid,\n };\n}\n\nfunction compileGlyf(code, cmds, font) {\n function moveTo(x, y) {\n cmds.push({ cmd: \"moveTo\", args: [x, y] });\n }\n function lineTo(x, y) {\n cmds.push({ cmd: \"lineTo\", args: [x, y] });\n }\n function quadraticCurveTo(xa, ya, x, y) {\n cmds.push({ cmd: \"quadraticCurveTo\", args: [xa, ya, x, y] });\n }\n\n let i = 0;\n const numberOfContours = getInt16(code, i);\n let flags;\n let x = 0,\n y = 0;\n i += 10;\n if (numberOfContours < 0) {\n // composite glyph\n do {\n flags = getUint16(code, i);\n const glyphIndex = getUint16(code, i + 2);\n i += 4;\n let arg1, arg2;\n if (flags & 0x01) {\n if (flags & 0x02) {\n arg1 = getInt16(code, i);\n arg2 = getInt16(code, i + 2);\n } else {\n arg1 = getUint16(code, i);\n arg2 = getUint16(code, i + 2);\n }\n i += 4;\n } else if (flags & 0x02) {\n arg1 = getInt8(code, i++);\n arg2 = getInt8(code, i++);\n } else {\n arg1 = code[i++];\n arg2 = code[i++];\n }\n if (flags & 0x02) {\n x = arg1;\n y = arg2;\n } else {\n x = 0;\n y = 0;\n }\n let scaleX = 1,\n scaleY = 1,\n scale01 = 0,\n scale10 = 0;\n if (flags & 0x08) {\n scaleX = scaleY = getFloat214(code, i);\n i += 2;\n } else if (flags & 0x40) {\n scaleX = getFloat214(code, i);\n scaleY = getFloat214(code, i + 2);\n i += 4;\n } else if (flags & 0x80) {\n scaleX = getFloat214(code, i);\n scale01 = getFloat214(code, i + 2);\n scale10 = getFloat214(code, i + 4);\n scaleY = getFloat214(code, i + 6);\n i += 8;\n }\n const subglyph = font.glyphs[glyphIndex];\n if (subglyph) {\n // TODO: the transform should be applied only if there is a scale:\n // https://github.com/freetype/freetype/blob/edd4fedc5427cf1cf1f4b045e53ff91eb282e9d4/src/truetype/ttgload.c#L1205\n cmds.push(\n { cmd: \"save\" },\n {\n cmd: \"transform\",\n args: [scaleX, scale01, scale10, scaleY, x, y],\n }\n );\n\n if (!(flags & 0x02)) {\n // TODO: we must use arg1 and arg2 to make something similar to:\n // https://github.com/freetype/freetype/blob/edd4fedc5427cf1cf1f4b045e53ff91eb282e9d4/src/truetype/ttgload.c#L1209\n }\n compileGlyf(subglyph, cmds, font);\n cmds.push({ cmd: \"restore\" });\n }\n } while (flags & 0x20);\n } else {\n // simple glyph\n const endPtsOfContours = [];\n let j, jj;\n for (j = 0; j < numberOfContours; j++) {\n endPtsOfContours.push(getUint16(code, i));\n i += 2;\n }\n const instructionLength = getUint16(code, i);\n i += 2 + instructionLength; // skipping the instructions\n const numberOfPoints = endPtsOfContours.at(-1) + 1;\n const points = [];\n while (points.length < numberOfPoints) {\n flags = code[i++];\n let repeat = 1;\n if (flags & 0x08) {\n repeat += code[i++];\n }\n while (repeat-- > 0) {\n points.push({ flags });\n }\n }\n for (j = 0; j < numberOfPoints; j++) {\n switch (points[j].flags & 0x12) {\n case 0x00:\n x += getInt16(code, i);\n i += 2;\n break;\n case 0x02:\n x -= code[i++];\n break;\n case 0x12:\n x += code[i++];\n break;\n }\n points[j].x = x;\n }\n for (j = 0; j < numberOfPoints; j++) {\n switch (points[j].flags & 0x24) {\n case 0x00:\n y += getInt16(code, i);\n i += 2;\n break;\n case 0x04:\n y -= code[i++];\n break;\n case 0x24:\n y += code[i++];\n break;\n }\n points[j].y = y;\n }\n\n let startPoint = 0;\n for (i = 0; i < numberOfContours; i++) {\n const endPoint = endPtsOfContours[i];\n // contours might have implicit points, which is located in the middle\n // between two neighboring off-curve points\n const contour = points.slice(startPoint, endPoint + 1);\n if (contour[0].flags & 1) {\n contour.push(contour[0]); // using start point at the contour end\n } else if (contour.at(-1).flags & 1) {\n // first is off-curve point, trying to use one from the end\n contour.unshift(contour.at(-1));\n } else {\n // start and end are off-curve points, creating implicit one\n const p = {\n flags: 1,\n x: (contour[0].x + contour.at(-1).x) / 2,\n y: (contour[0].y + contour.at(-1).y) / 2,\n };\n contour.unshift(p);\n contour.push(p);\n }\n moveTo(contour[0].x, contour[0].y);\n for (j = 1, jj = contour.length; j < jj; j++) {\n if (contour[j].flags & 1) {\n lineTo(contour[j].x, contour[j].y);\n } else if (contour[j + 1].flags & 1) {\n quadraticCurveTo(\n contour[j].x,\n contour[j].y,\n contour[j + 1].x,\n contour[j + 1].y\n );\n j++;\n } else {\n quadraticCurveTo(\n contour[j].x,\n contour[j].y,\n (contour[j].x + contour[j + 1].x) / 2,\n (contour[j].y + contour[j + 1].y) / 2\n );\n }\n }\n startPoint = endPoint + 1;\n }\n }\n}\n\nfunction compileCharString(charStringCode, cmds, font, glyphId) {\n function moveTo(x, y) {\n cmds.push({ cmd: \"moveTo\", args: [x, y] });\n }\n function lineTo(x, y) {\n cmds.push({ cmd: \"lineTo\", args: [x, y] });\n }\n function bezierCurveTo(x1, y1, x2, y2, x, y) {\n cmds.push({ cmd: \"bezierCurveTo\", args: [x1, y1, x2, y2, x, y] });\n }\n\n const stack = [];\n let x = 0,\n y = 0;\n let stems = 0;\n\n function parse(code) {\n let i = 0;\n while (i < code.length) {\n let stackClean = false;\n let v = code[i++];\n let xa, xb, ya, yb, y1, y2, y3, n, subrCode;\n switch (v) {\n case 1: // hstem\n stems += stack.length >> 1;\n stackClean = true;\n break;\n case 3: // vstem\n stems += stack.length >> 1;\n stackClean = true;\n break;\n case 4: // vmoveto\n y += stack.pop();\n moveTo(x, y);\n stackClean = true;\n break;\n case 5: // rlineto\n while (stack.length > 0) {\n x += stack.shift();\n y += stack.shift();\n lineTo(x, y);\n }\n break;\n case 6: // hlineto\n while (stack.length > 0) {\n x += stack.shift();\n lineTo(x, y);\n if (stack.length === 0) {\n break;\n }\n y += stack.shift();\n lineTo(x, y);\n }\n break;\n case 7: // vlineto\n while (stack.length > 0) {\n y += stack.shift();\n lineTo(x, y);\n if (stack.length === 0) {\n break;\n }\n x += stack.shift();\n lineTo(x, y);\n }\n break;\n case 8: // rrcurveto\n while (stack.length > 0) {\n xa = x + stack.shift();\n ya = y + stack.shift();\n xb = xa + stack.shift();\n yb = ya + stack.shift();\n x = xb + stack.shift();\n y = yb + stack.shift();\n bezierCurveTo(xa, ya, xb, yb, x, y);\n }\n break;\n case 10: // callsubr\n n = stack.pop();\n subrCode = null;\n if (font.isCFFCIDFont) {\n const fdIndex = font.fdSelect.getFDIndex(glyphId);\n if (fdIndex >= 0 && fdIndex < font.fdArray.length) {\n const fontDict = font.fdArray[fdIndex];\n let subrs;\n if (fontDict.privateDict?.subrsIndex) {\n subrs = fontDict.privateDict.subrsIndex.objects;\n }\n if (subrs) {\n // Add subroutine bias.\n n += getSubroutineBias(subrs);\n subrCode = subrs[n];\n }\n } else {\n warn(\"Invalid fd index for glyph index.\");\n }\n } else {\n subrCode = font.subrs[n + font.subrsBias];\n }\n if (subrCode) {\n parse(subrCode);\n }\n break;\n case 11: // return\n return;\n case 12:\n v = code[i++];\n switch (v) {\n case 34: // flex\n xa = x + stack.shift();\n xb = xa + stack.shift();\n y1 = y + stack.shift();\n x = xb + stack.shift();\n bezierCurveTo(xa, y, xb, y1, x, y1);\n xa = x + stack.shift();\n xb = xa + stack.shift();\n x = xb + stack.shift();\n bezierCurveTo(xa, y1, xb, y, x, y);\n break;\n case 35: // flex\n xa = x + stack.shift();\n ya = y + stack.shift();\n xb = xa + stack.shift();\n yb = ya + stack.shift();\n x = xb + stack.shift();\n y = yb + stack.shift();\n bezierCurveTo(xa, ya, xb, yb, x, y);\n xa = x + stack.shift();\n ya = y + stack.shift();\n xb = xa + stack.shift();\n yb = ya + stack.shift();\n x = xb + stack.shift();\n y = yb + stack.shift();\n bezierCurveTo(xa, ya, xb, yb, x, y);\n stack.pop(); // fd\n break;\n case 36: // hflex1\n xa = x + stack.shift();\n y1 = y + stack.shift();\n xb = xa + stack.shift();\n y2 = y1 + stack.shift();\n x = xb + stack.shift();\n bezierCurveTo(xa, y1, xb, y2, x, y2);\n xa = x + stack.shift();\n xb = xa + stack.shift();\n y3 = y2 + stack.shift();\n x = xb + stack.shift();\n bezierCurveTo(xa, y2, xb, y3, x, y);\n break;\n case 37: // flex1\n const x0 = x,\n y0 = y;\n xa = x + stack.shift();\n ya = y + stack.shift();\n xb = xa + stack.shift();\n yb = ya + stack.shift();\n x = xb + stack.shift();\n y = yb + stack.shift();\n bezierCurveTo(xa, ya, xb, yb, x, y);\n xa = x + stack.shift();\n ya = y + stack.shift();\n xb = xa + stack.shift();\n yb = ya + stack.shift();\n x = xb;\n y = yb;\n if (Math.abs(x - x0) > Math.abs(y - y0)) {\n x += stack.shift();\n } else {\n y += stack.shift();\n }\n bezierCurveTo(xa, ya, xb, yb, x, y);\n break;\n default:\n throw new FormatError(`unknown operator: 12 ${v}`);\n }\n break;\n case 14: // endchar\n if (stack.length >= 4) {\n const achar = stack.pop();\n const bchar = stack.pop();\n y = stack.pop();\n x = stack.pop();\n cmds.push({ cmd: \"save\" }, { cmd: \"translate\", args: [x, y] });\n let cmap = lookupCmap(\n font.cmap,\n String.fromCharCode(font.glyphNameMap[StandardEncoding[achar]])\n );\n compileCharString(\n font.glyphs[cmap.glyphId],\n cmds,\n font,\n cmap.glyphId\n );\n cmds.push({ cmd: \"restore\" });\n\n cmap = lookupCmap(\n font.cmap,\n String.fromCharCode(font.glyphNameMap[StandardEncoding[bchar]])\n );\n compileCharString(\n font.glyphs[cmap.glyphId],\n cmds,\n font,\n cmap.glyphId\n );\n }\n return;\n case 18: // hstemhm\n stems += stack.length >> 1;\n stackClean = true;\n break;\n case 19: // hintmask\n stems += stack.length >> 1;\n i += (stems + 7) >> 3;\n stackClean = true;\n break;\n case 20: // cntrmask\n stems += stack.length >> 1;\n i += (stems + 7) >> 3;\n stackClean = true;\n break;\n case 21: // rmoveto\n y += stack.pop();\n x += stack.pop();\n moveTo(x, y);\n stackClean = true;\n break;\n case 22: // hmoveto\n x += stack.pop();\n moveTo(x, y);\n stackClean = true;\n break;\n case 23: // vstemhm\n stems += stack.length >> 1;\n stackClean = true;\n break;\n case 24: // rcurveline\n while (stack.length > 2) {\n xa = x + stack.shift();\n ya = y + stack.shift();\n xb = xa + stack.shift();\n yb = ya + stack.shift();\n x = xb + stack.shift();\n y = yb + stack.shift();\n bezierCurveTo(xa, ya, xb, yb, x, y);\n }\n x += stack.shift();\n y += stack.shift();\n lineTo(x, y);\n break;\n case 25: // rlinecurve\n while (stack.length > 6) {\n x += stack.shift();\n y += stack.shift();\n lineTo(x, y);\n }\n xa = x + stack.shift();\n ya = y + stack.shift();\n xb = xa + stack.shift();\n yb = ya + stack.shift();\n x = xb + stack.shift();\n y = yb + stack.shift();\n bezierCurveTo(xa, ya, xb, yb, x, y);\n break;\n case 26: // vvcurveto\n if (stack.length % 2) {\n x += stack.shift();\n }\n while (stack.length > 0) {\n xa = x;\n ya = y + stack.shift();\n xb = xa + stack.shift();\n yb = ya + stack.shift();\n x = xb;\n y = yb + stack.shift();\n bezierCurveTo(xa, ya, xb, yb, x, y);\n }\n break;\n case 27: // hhcurveto\n if (stack.length % 2) {\n y += stack.shift();\n }\n while (stack.length > 0) {\n xa = x + stack.shift();\n ya = y;\n xb = xa + stack.shift();\n yb = ya + stack.shift();\n x = xb + stack.shift();\n y = yb;\n bezierCurveTo(xa, ya, xb, yb, x, y);\n }\n break;\n case 28:\n stack.push(((code[i] << 24) | (code[i + 1] << 16)) >> 16);\n i += 2;\n break;\n case 29: // callgsubr\n n = stack.pop() + font.gsubrsBias;\n subrCode = font.gsubrs[n];\n if (subrCode) {\n parse(subrCode);\n }\n break;\n case 30: // vhcurveto\n while (stack.length > 0) {\n xa = x;\n ya = y + stack.shift();\n xb = xa + stack.shift();\n yb = ya + stack.shift();\n x = xb + stack.shift();\n y = yb + (stack.length === 1 ? stack.shift() : 0);\n bezierCurveTo(xa, ya, xb, yb, x, y);\n if (stack.length === 0) {\n break;\n }\n\n xa = x + stack.shift();\n ya = y;\n xb = xa + stack.shift();\n yb = ya + stack.shift();\n y = yb + stack.shift();\n x = xb + (stack.length === 1 ? stack.shift() : 0);\n bezierCurveTo(xa, ya, xb, yb, x, y);\n }\n break;\n case 31: // hvcurveto\n while (stack.length > 0) {\n xa = x + stack.shift();\n ya = y;\n xb = xa + stack.shift();\n yb = ya + stack.shift();\n y = yb + stack.shift();\n x = xb + (stack.length === 1 ? stack.shift() : 0);\n bezierCurveTo(xa, ya, xb, yb, x, y);\n if (stack.length === 0) {\n break;\n }\n\n xa = x;\n ya = y + stack.shift();\n xb = xa + stack.shift();\n yb = ya + stack.shift();\n x = xb + stack.shift();\n y = yb + (stack.length === 1 ? stack.shift() : 0);\n bezierCurveTo(xa, ya, xb, yb, x, y);\n }\n break;\n default:\n if (v < 32) {\n throw new FormatError(`unknown operator: ${v}`);\n }\n if (v < 247) {\n stack.push(v - 139);\n } else if (v < 251) {\n stack.push((v - 247) * 256 + code[i++] + 108);\n } else if (v < 255) {\n stack.push(-(v - 251) * 256 - code[i++] - 108);\n } else {\n stack.push(\n ((code[i] << 24) |\n (code[i + 1] << 16) |\n (code[i + 2] << 8) |\n code[i + 3]) /\n 65536\n );\n i += 4;\n }\n break;\n }\n if (stackClean) {\n stack.length = 0;\n }\n }\n }\n parse(charStringCode);\n}\n\nconst NOOP = [];\n\nclass CompiledFont {\n constructor(fontMatrix) {\n if (this.constructor === CompiledFont) {\n unreachable(\"Cannot initialize CompiledFont.\");\n }\n this.fontMatrix = fontMatrix;\n\n this.compiledGlyphs = Object.create(null);\n this.compiledCharCodeToGlyphId = Object.create(null);\n }\n\n getPathJs(unicode) {\n const { charCode, glyphId } = lookupCmap(this.cmap, unicode);\n let fn = this.compiledGlyphs[glyphId];\n if (!fn) {\n try {\n fn = this.compileGlyph(this.glyphs[glyphId], glyphId);\n this.compiledGlyphs[glyphId] = fn;\n } catch (ex) {\n // Avoid attempting to re-compile a corrupt glyph.\n this.compiledGlyphs[glyphId] = NOOP;\n\n if (this.compiledCharCodeToGlyphId[charCode] === undefined) {\n this.compiledCharCodeToGlyphId[charCode] = glyphId;\n }\n throw ex;\n }\n }\n if (this.compiledCharCodeToGlyphId[charCode] === undefined) {\n this.compiledCharCodeToGlyphId[charCode] = glyphId;\n }\n return fn;\n }\n\n compileGlyph(code, glyphId) {\n if (!code || code.length === 0 || code[0] === 14) {\n return NOOP;\n }\n\n let fontMatrix = this.fontMatrix;\n if (this.isCFFCIDFont) {\n // Top DICT's FontMatrix can be ignored because CFFCompiler always\n // removes it and copies to FDArray DICTs.\n const fdIndex = this.fdSelect.getFDIndex(glyphId);\n if (fdIndex >= 0 && fdIndex < this.fdArray.length) {\n const fontDict = this.fdArray[fdIndex];\n fontMatrix = fontDict.getByName(\"FontMatrix\") || FONT_IDENTITY_MATRIX;\n } else {\n warn(\"Invalid fd index for glyph index.\");\n }\n }\n\n const cmds = [\n { cmd: \"save\" },\n { cmd: \"transform\", args: fontMatrix.slice() },\n { cmd: \"scale\", args: [\"size\", \"-size\"] },\n ];\n this.compileGlyphImpl(code, cmds, glyphId);\n\n cmds.push({ cmd: \"restore\" });\n\n return cmds;\n }\n\n compileGlyphImpl() {\n unreachable(\"Children classes should implement this.\");\n }\n\n hasBuiltPath(unicode) {\n const { charCode, glyphId } = lookupCmap(this.cmap, unicode);\n return (\n this.compiledGlyphs[glyphId] !== undefined &&\n this.compiledCharCodeToGlyphId[charCode] !== undefined\n );\n }\n}\n\nclass TrueTypeCompiled extends CompiledFont {\n constructor(glyphs, cmap, fontMatrix) {\n super(fontMatrix || [0.000488, 0, 0, 0.000488, 0, 0]);\n\n this.glyphs = glyphs;\n this.cmap = cmap;\n }\n\n compileGlyphImpl(code, cmds) {\n compileGlyf(code, cmds, this);\n }\n}\n\nclass Type2Compiled extends CompiledFont {\n constructor(cffInfo, cmap, fontMatrix, glyphNameMap) {\n super(fontMatrix || [0.001, 0, 0, 0.001, 0, 0]);\n\n this.glyphs = cffInfo.glyphs;\n this.gsubrs = cffInfo.gsubrs || [];\n this.subrs = cffInfo.subrs || [];\n this.cmap = cmap;\n this.glyphNameMap = glyphNameMap || getGlyphsUnicode();\n\n this.gsubrsBias = getSubroutineBias(this.gsubrs);\n this.subrsBias = getSubroutineBias(this.subrs);\n\n this.isCFFCIDFont = cffInfo.isCFFCIDFont;\n this.fdSelect = cffInfo.fdSelect;\n this.fdArray = cffInfo.fdArray;\n }\n\n compileGlyphImpl(code, cmds, glyphId) {\n compileCharString(code, cmds, this, glyphId);\n }\n}\n\nclass FontRendererFactory {\n static create(font, seacAnalysisEnabled) {\n const data = new Uint8Array(font.data);\n let cmap, glyf, loca, cff, indexToLocFormat, unitsPerEm;\n const numTables = getUint16(data, 4);\n for (let i = 0, p = 12; i < numTables; i++, p += 16) {\n const tag = bytesToString(data.subarray(p, p + 4));\n const offset = getUint32(data, p + 8);\n const length = getUint32(data, p + 12);\n switch (tag) {\n case \"cmap\":\n cmap = parseCmap(data, offset, offset + length);\n break;\n case \"glyf\":\n glyf = data.subarray(offset, offset + length);\n break;\n case \"loca\":\n loca = data.subarray(offset, offset + length);\n break;\n case \"head\":\n unitsPerEm = getUint16(data, offset + 18);\n indexToLocFormat = getUint16(data, offset + 50);\n break;\n case \"CFF \":\n cff = parseCff(data, offset, offset + length, seacAnalysisEnabled);\n break;\n }\n }\n\n if (glyf) {\n const fontMatrix = !unitsPerEm\n ? font.fontMatrix\n : [1 / unitsPerEm, 0, 0, 1 / unitsPerEm, 0, 0];\n return new TrueTypeCompiled(\n parseGlyfTable(glyf, loca, indexToLocFormat),\n cmap,\n fontMatrix\n );\n }\n return new Type2Compiled(cff, cmap, font.fontMatrix, font.glyphNameMap);\n }\n}\n\nexport { FontRendererFactory };\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 { getLookupTableFactory } from \"./core_utils.js\";\n\n// The Metrics object contains glyph widths (in glyph space units).\n// As per PDF spec, for most fonts (Type 3 being an exception) a glyph\n// space unit corresponds to 1/1000th of text space unit.\nconst getMetrics = getLookupTableFactory(function (t) {\n t.Courier = 600;\n t[\"Courier-Bold\"] = 600;\n t[\"Courier-BoldOblique\"] = 600;\n t[\"Courier-Oblique\"] = 600;\n // eslint-disable-next-line no-shadow\n t.Helvetica = getLookupTableFactory(function (t) {\n t.space = 278;\n t.exclam = 278;\n t.quotedbl = 355;\n t.numbersign = 556;\n t.dollar = 556;\n t.percent = 889;\n t.ampersand = 667;\n t.quoteright = 222;\n t.parenleft = 333;\n t.parenright = 333;\n t.asterisk = 389;\n t.plus = 584;\n t.comma = 278;\n t.hyphen = 333;\n t.period = 278;\n t.slash = 278;\n t.zero = 556;\n t.one = 556;\n t.two = 556;\n t.three = 556;\n t.four = 556;\n t.five = 556;\n t.six = 556;\n t.seven = 556;\n t.eight = 556;\n t.nine = 556;\n t.colon = 278;\n t.semicolon = 278;\n t.less = 584;\n t.equal = 584;\n t.greater = 584;\n t.question = 556;\n t.at = 1015;\n t.A = 667;\n t.B = 667;\n t.C = 722;\n t.D = 722;\n t.E = 667;\n t.F = 611;\n t.G = 778;\n t.H = 722;\n t.I = 278;\n t.J = 500;\n t.K = 667;\n t.L = 556;\n t.M = 833;\n t.N = 722;\n t.O = 778;\n t.P = 667;\n t.Q = 778;\n t.R = 722;\n t.S = 667;\n t.T = 611;\n t.U = 722;\n t.V = 667;\n t.W = 944;\n t.X = 667;\n t.Y = 667;\n t.Z = 611;\n t.bracketleft = 278;\n t.backslash = 278;\n t.bracketright = 278;\n t.asciicircum = 469;\n t.underscore = 556;\n t.quoteleft = 222;\n t.a = 556;\n t.b = 556;\n t.c = 500;\n t.d = 556;\n t.e = 556;\n t.f = 278;\n t.g = 556;\n t.h = 556;\n t.i = 222;\n t.j = 222;\n t.k = 500;\n t.l = 222;\n t.m = 833;\n t.n = 556;\n t.o = 556;\n t.p = 556;\n t.q = 556;\n t.r = 333;\n t.s = 500;\n t.t = 278;\n t.u = 556;\n t.v = 500;\n t.w = 722;\n t.x = 500;\n t.y = 500;\n t.z = 500;\n t.braceleft = 334;\n t.bar = 260;\n t.braceright = 334;\n t.asciitilde = 584;\n t.exclamdown = 333;\n t.cent = 556;\n t.sterling = 556;\n t.fraction = 167;\n t.yen = 556;\n t.florin = 556;\n t.section = 556;\n t.currency = 556;\n t.quotesingle = 191;\n t.quotedblleft = 333;\n t.guillemotleft = 556;\n t.guilsinglleft = 333;\n t.guilsinglright = 333;\n t.fi = 500;\n t.fl = 500;\n t.endash = 556;\n t.dagger = 556;\n t.daggerdbl = 556;\n t.periodcentered = 278;\n t.paragraph = 537;\n t.bullet = 350;\n t.quotesinglbase = 222;\n t.quotedblbase = 333;\n t.quotedblright = 333;\n t.guillemotright = 556;\n t.ellipsis = 1000;\n t.perthousand = 1000;\n t.questiondown = 611;\n t.grave = 333;\n t.acute = 333;\n t.circumflex = 333;\n t.tilde = 333;\n t.macron = 333;\n t.breve = 333;\n t.dotaccent = 333;\n t.dieresis = 333;\n t.ring = 333;\n t.cedilla = 333;\n t.hungarumlaut = 333;\n t.ogonek = 333;\n t.caron = 333;\n t.emdash = 1000;\n t.AE = 1000;\n t.ordfeminine = 370;\n t.Lslash = 556;\n t.Oslash = 778;\n t.OE = 1000;\n t.ordmasculine = 365;\n t.ae = 889;\n t.dotlessi = 278;\n t.lslash = 222;\n t.oslash = 611;\n t.oe = 944;\n t.germandbls = 611;\n t.Idieresis = 278;\n t.eacute = 556;\n t.abreve = 556;\n t.uhungarumlaut = 556;\n t.ecaron = 556;\n t.Ydieresis = 667;\n t.divide = 584;\n t.Yacute = 667;\n t.Acircumflex = 667;\n t.aacute = 556;\n t.Ucircumflex = 722;\n t.yacute = 500;\n t.scommaaccent = 500;\n t.ecircumflex = 556;\n t.Uring = 722;\n t.Udieresis = 722;\n t.aogonek = 556;\n t.Uacute = 722;\n t.uogonek = 556;\n t.Edieresis = 667;\n t.Dcroat = 722;\n t.commaaccent = 250;\n t.copyright = 737;\n t.Emacron = 667;\n t.ccaron = 500;\n t.aring = 556;\n t.Ncommaaccent = 722;\n t.lacute = 222;\n t.agrave = 556;\n t.Tcommaaccent = 611;\n t.Cacute = 722;\n t.atilde = 556;\n t.Edotaccent = 667;\n t.scaron = 500;\n t.scedilla = 500;\n t.iacute = 278;\n t.lozenge = 471;\n t.Rcaron = 722;\n t.Gcommaaccent = 778;\n t.ucircumflex = 556;\n t.acircumflex = 556;\n t.Amacron = 667;\n t.rcaron = 333;\n t.ccedilla = 500;\n t.Zdotaccent = 611;\n t.Thorn = 667;\n t.Omacron = 778;\n t.Racute = 722;\n t.Sacute = 667;\n t.dcaron = 643;\n t.Umacron = 722;\n t.uring = 556;\n t.threesuperior = 333;\n t.Ograve = 778;\n t.Agrave = 667;\n t.Abreve = 667;\n t.multiply = 584;\n t.uacute = 556;\n t.Tcaron = 611;\n t.partialdiff = 476;\n t.ydieresis = 500;\n t.Nacute = 722;\n t.icircumflex = 278;\n t.Ecircumflex = 667;\n t.adieresis = 556;\n t.edieresis = 556;\n t.cacute = 500;\n t.nacute = 556;\n t.umacron = 556;\n t.Ncaron = 722;\n t.Iacute = 278;\n t.plusminus = 584;\n t.brokenbar = 260;\n t.registered = 737;\n t.Gbreve = 778;\n t.Idotaccent = 278;\n t.summation = 600;\n t.Egrave = 667;\n t.racute = 333;\n t.omacron = 556;\n t.Zacute = 611;\n t.Zcaron = 611;\n t.greaterequal = 549;\n t.Eth = 722;\n t.Ccedilla = 722;\n t.lcommaaccent = 222;\n t.tcaron = 317;\n t.eogonek = 556;\n t.Uogonek = 722;\n t.Aacute = 667;\n t.Adieresis = 667;\n t.egrave = 556;\n t.zacute = 500;\n t.iogonek = 222;\n t.Oacute = 778;\n t.oacute = 556;\n t.amacron = 556;\n t.sacute = 500;\n t.idieresis = 278;\n t.Ocircumflex = 778;\n t.Ugrave = 722;\n t.Delta = 612;\n t.thorn = 556;\n t.twosuperior = 333;\n t.Odieresis = 778;\n t.mu = 556;\n t.igrave = 278;\n t.ohungarumlaut = 556;\n t.Eogonek = 667;\n t.dcroat = 556;\n t.threequarters = 834;\n t.Scedilla = 667;\n t.lcaron = 299;\n t.Kcommaaccent = 667;\n t.Lacute = 556;\n t.trademark = 1000;\n t.edotaccent = 556;\n t.Igrave = 278;\n t.Imacron = 278;\n t.Lcaron = 556;\n t.onehalf = 834;\n t.lessequal = 549;\n t.ocircumflex = 556;\n t.ntilde = 556;\n t.Uhungarumlaut = 722;\n t.Eacute = 667;\n t.emacron = 556;\n t.gbreve = 556;\n t.onequarter = 834;\n t.Scaron = 667;\n t.Scommaaccent = 667;\n t.Ohungarumlaut = 778;\n t.degree = 400;\n t.ograve = 556;\n t.Ccaron = 722;\n t.ugrave = 556;\n t.radical = 453;\n t.Dcaron = 722;\n t.rcommaaccent = 333;\n t.Ntilde = 722;\n t.otilde = 556;\n t.Rcommaaccent = 722;\n t.Lcommaaccent = 556;\n t.Atilde = 667;\n t.Aogonek = 667;\n t.Aring = 667;\n t.Otilde = 778;\n t.zdotaccent = 500;\n t.Ecaron = 667;\n t.Iogonek = 278;\n t.kcommaaccent = 500;\n t.minus = 584;\n t.Icircumflex = 278;\n t.ncaron = 556;\n t.tcommaaccent = 278;\n t.logicalnot = 584;\n t.odieresis = 556;\n t.udieresis = 556;\n t.notequal = 549;\n t.gcommaaccent = 556;\n t.eth = 556;\n t.zcaron = 500;\n t.ncommaaccent = 556;\n t.onesuperior = 333;\n t.imacron = 278;\n t.Euro = 556;\n });\n // eslint-disable-next-line no-shadow\n t[\"Helvetica-Bold\"] = getLookupTableFactory(function (t) {\n t.space = 278;\n t.exclam = 333;\n t.quotedbl = 474;\n t.numbersign = 556;\n t.dollar = 556;\n t.percent = 889;\n t.ampersand = 722;\n t.quoteright = 278;\n t.parenleft = 333;\n t.parenright = 333;\n t.asterisk = 389;\n t.plus = 584;\n t.comma = 278;\n t.hyphen = 333;\n t.period = 278;\n t.slash = 278;\n t.zero = 556;\n t.one = 556;\n t.two = 556;\n t.three = 556;\n t.four = 556;\n t.five = 556;\n t.six = 556;\n t.seven = 556;\n t.eight = 556;\n t.nine = 556;\n t.colon = 333;\n t.semicolon = 333;\n t.less = 584;\n t.equal = 584;\n t.greater = 584;\n t.question = 611;\n t.at = 975;\n t.A = 722;\n t.B = 722;\n t.C = 722;\n t.D = 722;\n t.E = 667;\n t.F = 611;\n t.G = 778;\n t.H = 722;\n t.I = 278;\n t.J = 556;\n t.K = 722;\n t.L = 611;\n t.M = 833;\n t.N = 722;\n t.O = 778;\n t.P = 667;\n t.Q = 778;\n t.R = 722;\n t.S = 667;\n t.T = 611;\n t.U = 722;\n t.V = 667;\n t.W = 944;\n t.X = 667;\n t.Y = 667;\n t.Z = 611;\n t.bracketleft = 333;\n t.backslash = 278;\n t.bracketright = 333;\n t.asciicircum = 584;\n t.underscore = 556;\n t.quoteleft = 278;\n t.a = 556;\n t.b = 611;\n t.c = 556;\n t.d = 611;\n t.e = 556;\n t.f = 333;\n t.g = 611;\n t.h = 611;\n t.i = 278;\n t.j = 278;\n t.k = 556;\n t.l = 278;\n t.m = 889;\n t.n = 611;\n t.o = 611;\n t.p = 611;\n t.q = 611;\n t.r = 389;\n t.s = 556;\n t.t = 333;\n t.u = 611;\n t.v = 556;\n t.w = 778;\n t.x = 556;\n t.y = 556;\n t.z = 500;\n t.braceleft = 389;\n t.bar = 280;\n t.braceright = 389;\n t.asciitilde = 584;\n t.exclamdown = 333;\n t.cent = 556;\n t.sterling = 556;\n t.fraction = 167;\n t.yen = 556;\n t.florin = 556;\n t.section = 556;\n t.currency = 556;\n t.quotesingle = 238;\n t.quotedblleft = 500;\n t.guillemotleft = 556;\n t.guilsinglleft = 333;\n t.guilsinglright = 333;\n t.fi = 611;\n t.fl = 611;\n t.endash = 556;\n t.dagger = 556;\n t.daggerdbl = 556;\n t.periodcentered = 278;\n t.paragraph = 556;\n t.bullet = 350;\n t.quotesinglbase = 278;\n t.quotedblbase = 500;\n t.quotedblright = 500;\n t.guillemotright = 556;\n t.ellipsis = 1000;\n t.perthousand = 1000;\n t.questiondown = 611;\n t.grave = 333;\n t.acute = 333;\n t.circumflex = 333;\n t.tilde = 333;\n t.macron = 333;\n t.breve = 333;\n t.dotaccent = 333;\n t.dieresis = 333;\n t.ring = 333;\n t.cedilla = 333;\n t.hungarumlaut = 333;\n t.ogonek = 333;\n t.caron = 333;\n t.emdash = 1000;\n t.AE = 1000;\n t.ordfeminine = 370;\n t.Lslash = 611;\n t.Oslash = 778;\n t.OE = 1000;\n t.ordmasculine = 365;\n t.ae = 889;\n t.dotlessi = 278;\n t.lslash = 278;\n t.oslash = 611;\n t.oe = 944;\n t.germandbls = 611;\n t.Idieresis = 278;\n t.eacute = 556;\n t.abreve = 556;\n t.uhungarumlaut = 611;\n t.ecaron = 556;\n t.Ydieresis = 667;\n t.divide = 584;\n t.Yacute = 667;\n t.Acircumflex = 722;\n t.aacute = 556;\n t.Ucircumflex = 722;\n t.yacute = 556;\n t.scommaaccent = 556;\n t.ecircumflex = 556;\n t.Uring = 722;\n t.Udieresis = 722;\n t.aogonek = 556;\n t.Uacute = 722;\n t.uogonek = 611;\n t.Edieresis = 667;\n t.Dcroat = 722;\n t.commaaccent = 250;\n t.copyright = 737;\n t.Emacron = 667;\n t.ccaron = 556;\n t.aring = 556;\n t.Ncommaaccent = 722;\n t.lacute = 278;\n t.agrave = 556;\n t.Tcommaaccent = 611;\n t.Cacute = 722;\n t.atilde = 556;\n t.Edotaccent = 667;\n t.scaron = 556;\n t.scedilla = 556;\n t.iacute = 278;\n t.lozenge = 494;\n t.Rcaron = 722;\n t.Gcommaaccent = 778;\n t.ucircumflex = 611;\n t.acircumflex = 556;\n t.Amacron = 722;\n t.rcaron = 389;\n t.ccedilla = 556;\n t.Zdotaccent = 611;\n t.Thorn = 667;\n t.Omacron = 778;\n t.Racute = 722;\n t.Sacute = 667;\n t.dcaron = 743;\n t.Umacron = 722;\n t.uring = 611;\n t.threesuperior = 333;\n t.Ograve = 778;\n t.Agrave = 722;\n t.Abreve = 722;\n t.multiply = 584;\n t.uacute = 611;\n t.Tcaron = 611;\n t.partialdiff = 494;\n t.ydieresis = 556;\n t.Nacute = 722;\n t.icircumflex = 278;\n t.Ecircumflex = 667;\n t.adieresis = 556;\n t.edieresis = 556;\n t.cacute = 556;\n t.nacute = 611;\n t.umacron = 611;\n t.Ncaron = 722;\n t.Iacute = 278;\n t.plusminus = 584;\n t.brokenbar = 280;\n t.registered = 737;\n t.Gbreve = 778;\n t.Idotaccent = 278;\n t.summation = 600;\n t.Egrave = 667;\n t.racute = 389;\n t.omacron = 611;\n t.Zacute = 611;\n t.Zcaron = 611;\n t.greaterequal = 549;\n t.Eth = 722;\n t.Ccedilla = 722;\n t.lcommaaccent = 278;\n t.tcaron = 389;\n t.eogonek = 556;\n t.Uogonek = 722;\n t.Aacute = 722;\n t.Adieresis = 722;\n t.egrave = 556;\n t.zacute = 500;\n t.iogonek = 278;\n t.Oacute = 778;\n t.oacute = 611;\n t.amacron = 556;\n t.sacute = 556;\n t.idieresis = 278;\n t.Ocircumflex = 778;\n t.Ugrave = 722;\n t.Delta = 612;\n t.thorn = 611;\n t.twosuperior = 333;\n t.Odieresis = 778;\n t.mu = 611;\n t.igrave = 278;\n t.ohungarumlaut = 611;\n t.Eogonek = 667;\n t.dcroat = 611;\n t.threequarters = 834;\n t.Scedilla = 667;\n t.lcaron = 400;\n t.Kcommaaccent = 722;\n t.Lacute = 611;\n t.trademark = 1000;\n t.edotaccent = 556;\n t.Igrave = 278;\n t.Imacron = 278;\n t.Lcaron = 611;\n t.onehalf = 834;\n t.lessequal = 549;\n t.ocircumflex = 611;\n t.ntilde = 611;\n t.Uhungarumlaut = 722;\n t.Eacute = 667;\n t.emacron = 556;\n t.gbreve = 611;\n t.onequarter = 834;\n t.Scaron = 667;\n t.Scommaaccent = 667;\n t.Ohungarumlaut = 778;\n t.degree = 400;\n t.ograve = 611;\n t.Ccaron = 722;\n t.ugrave = 611;\n t.radical = 549;\n t.Dcaron = 722;\n t.rcommaaccent = 389;\n t.Ntilde = 722;\n t.otilde = 611;\n t.Rcommaaccent = 722;\n t.Lcommaaccent = 611;\n t.Atilde = 722;\n t.Aogonek = 722;\n t.Aring = 722;\n t.Otilde = 778;\n t.zdotaccent = 500;\n t.Ecaron = 667;\n t.Iogonek = 278;\n t.kcommaaccent = 556;\n t.minus = 584;\n t.Icircumflex = 278;\n t.ncaron = 611;\n t.tcommaaccent = 333;\n t.logicalnot = 584;\n t.odieresis = 611;\n t.udieresis = 611;\n t.notequal = 549;\n t.gcommaaccent = 611;\n t.eth = 611;\n t.zcaron = 500;\n t.ncommaaccent = 611;\n t.onesuperior = 333;\n t.imacron = 278;\n t.Euro = 556;\n });\n // eslint-disable-next-line no-shadow\n t[\"Helvetica-BoldOblique\"] = getLookupTableFactory(function (t) {\n t.space = 278;\n t.exclam = 333;\n t.quotedbl = 474;\n t.numbersign = 556;\n t.dollar = 556;\n t.percent = 889;\n t.ampersand = 722;\n t.quoteright = 278;\n t.parenleft = 333;\n t.parenright = 333;\n t.asterisk = 389;\n t.plus = 584;\n t.comma = 278;\n t.hyphen = 333;\n t.period = 278;\n t.slash = 278;\n t.zero = 556;\n t.one = 556;\n t.two = 556;\n t.three = 556;\n t.four = 556;\n t.five = 556;\n t.six = 556;\n t.seven = 556;\n t.eight = 556;\n t.nine = 556;\n t.colon = 333;\n t.semicolon = 333;\n t.less = 584;\n t.equal = 584;\n t.greater = 584;\n t.question = 611;\n t.at = 975;\n t.A = 722;\n t.B = 722;\n t.C = 722;\n t.D = 722;\n t.E = 667;\n t.F = 611;\n t.G = 778;\n t.H = 722;\n t.I = 278;\n t.J = 556;\n t.K = 722;\n t.L = 611;\n t.M = 833;\n t.N = 722;\n t.O = 778;\n t.P = 667;\n t.Q = 778;\n t.R = 722;\n t.S = 667;\n t.T = 611;\n t.U = 722;\n t.V = 667;\n t.W = 944;\n t.X = 667;\n t.Y = 667;\n t.Z = 611;\n t.bracketleft = 333;\n t.backslash = 278;\n t.bracketright = 333;\n t.asciicircum = 584;\n t.underscore = 556;\n t.quoteleft = 278;\n t.a = 556;\n t.b = 611;\n t.c = 556;\n t.d = 611;\n t.e = 556;\n t.f = 333;\n t.g = 611;\n t.h = 611;\n t.i = 278;\n t.j = 278;\n t.k = 556;\n t.l = 278;\n t.m = 889;\n t.n = 611;\n t.o = 611;\n t.p = 611;\n t.q = 611;\n t.r = 389;\n t.s = 556;\n t.t = 333;\n t.u = 611;\n t.v = 556;\n t.w = 778;\n t.x = 556;\n t.y = 556;\n t.z = 500;\n t.braceleft = 389;\n t.bar = 280;\n t.braceright = 389;\n t.asciitilde = 584;\n t.exclamdown = 333;\n t.cent = 556;\n t.sterling = 556;\n t.fraction = 167;\n t.yen = 556;\n t.florin = 556;\n t.section = 556;\n t.currency = 556;\n t.quotesingle = 238;\n t.quotedblleft = 500;\n t.guillemotleft = 556;\n t.guilsinglleft = 333;\n t.guilsinglright = 333;\n t.fi = 611;\n t.fl = 611;\n t.endash = 556;\n t.dagger = 556;\n t.daggerdbl = 556;\n t.periodcentered = 278;\n t.paragraph = 556;\n t.bullet = 350;\n t.quotesinglbase = 278;\n t.quotedblbase = 500;\n t.quotedblright = 500;\n t.guillemotright = 556;\n t.ellipsis = 1000;\n t.perthousand = 1000;\n t.questiondown = 611;\n t.grave = 333;\n t.acute = 333;\n t.circumflex = 333;\n t.tilde = 333;\n t.macron = 333;\n t.breve = 333;\n t.dotaccent = 333;\n t.dieresis = 333;\n t.ring = 333;\n t.cedilla = 333;\n t.hungarumlaut = 333;\n t.ogonek = 333;\n t.caron = 333;\n t.emdash = 1000;\n t.AE = 1000;\n t.ordfeminine = 370;\n t.Lslash = 611;\n t.Oslash = 778;\n t.OE = 1000;\n t.ordmasculine = 365;\n t.ae = 889;\n t.dotlessi = 278;\n t.lslash = 278;\n t.oslash = 611;\n t.oe = 944;\n t.germandbls = 611;\n t.Idieresis = 278;\n t.eacute = 556;\n t.abreve = 556;\n t.uhungarumlaut = 611;\n t.ecaron = 556;\n t.Ydieresis = 667;\n t.divide = 584;\n t.Yacute = 667;\n t.Acircumflex = 722;\n t.aacute = 556;\n t.Ucircumflex = 722;\n t.yacute = 556;\n t.scommaaccent = 556;\n t.ecircumflex = 556;\n t.Uring = 722;\n t.Udieresis = 722;\n t.aogonek = 556;\n t.Uacute = 722;\n t.uogonek = 611;\n t.Edieresis = 667;\n t.Dcroat = 722;\n t.commaaccent = 250;\n t.copyright = 737;\n t.Emacron = 667;\n t.ccaron = 556;\n t.aring = 556;\n t.Ncommaaccent = 722;\n t.lacute = 278;\n t.agrave = 556;\n t.Tcommaaccent = 611;\n t.Cacute = 722;\n t.atilde = 556;\n t.Edotaccent = 667;\n t.scaron = 556;\n t.scedilla = 556;\n t.iacute = 278;\n t.lozenge = 494;\n t.Rcaron = 722;\n t.Gcommaaccent = 778;\n t.ucircumflex = 611;\n t.acircumflex = 556;\n t.Amacron = 722;\n t.rcaron = 389;\n t.ccedilla = 556;\n t.Zdotaccent = 611;\n t.Thorn = 667;\n t.Omacron = 778;\n t.Racute = 722;\n t.Sacute = 667;\n t.dcaron = 743;\n t.Umacron = 722;\n t.uring = 611;\n t.threesuperior = 333;\n t.Ograve = 778;\n t.Agrave = 722;\n t.Abreve = 722;\n t.multiply = 584;\n t.uacute = 611;\n t.Tcaron = 611;\n t.partialdiff = 494;\n t.ydieresis = 556;\n t.Nacute = 722;\n t.icircumflex = 278;\n t.Ecircumflex = 667;\n t.adieresis = 556;\n t.edieresis = 556;\n t.cacute = 556;\n t.nacute = 611;\n t.umacron = 611;\n t.Ncaron = 722;\n t.Iacute = 278;\n t.plusminus = 584;\n t.brokenbar = 280;\n t.registered = 737;\n t.Gbreve = 778;\n t.Idotaccent = 278;\n t.summation = 600;\n t.Egrave = 667;\n t.racute = 389;\n t.omacron = 611;\n t.Zacute = 611;\n t.Zcaron = 611;\n t.greaterequal = 549;\n t.Eth = 722;\n t.Ccedilla = 722;\n t.lcommaaccent = 278;\n t.tcaron = 389;\n t.eogonek = 556;\n t.Uogonek = 722;\n t.Aacute = 722;\n t.Adieresis = 722;\n t.egrave = 556;\n t.zacute = 500;\n t.iogonek = 278;\n t.Oacute = 778;\n t.oacute = 611;\n t.amacron = 556;\n t.sacute = 556;\n t.idieresis = 278;\n t.Ocircumflex = 778;\n t.Ugrave = 722;\n t.Delta = 612;\n t.thorn = 611;\n t.twosuperior = 333;\n t.Odieresis = 778;\n t.mu = 611;\n t.igrave = 278;\n t.ohungarumlaut = 611;\n t.Eogonek = 667;\n t.dcroat = 611;\n t.threequarters = 834;\n t.Scedilla = 667;\n t.lcaron = 400;\n t.Kcommaaccent = 722;\n t.Lacute = 611;\n t.trademark = 1000;\n t.edotaccent = 556;\n t.Igrave = 278;\n t.Imacron = 278;\n t.Lcaron = 611;\n t.onehalf = 834;\n t.lessequal = 549;\n t.ocircumflex = 611;\n t.ntilde = 611;\n t.Uhungarumlaut = 722;\n t.Eacute = 667;\n t.emacron = 556;\n t.gbreve = 611;\n t.onequarter = 834;\n t.Scaron = 667;\n t.Scommaaccent = 667;\n t.Ohungarumlaut = 778;\n t.degree = 400;\n t.ograve = 611;\n t.Ccaron = 722;\n t.ugrave = 611;\n t.radical = 549;\n t.Dcaron = 722;\n t.rcommaaccent = 389;\n t.Ntilde = 722;\n t.otilde = 611;\n t.Rcommaaccent = 722;\n t.Lcommaaccent = 611;\n t.Atilde = 722;\n t.Aogonek = 722;\n t.Aring = 722;\n t.Otilde = 778;\n t.zdotaccent = 500;\n t.Ecaron = 667;\n t.Iogonek = 278;\n t.kcommaaccent = 556;\n t.minus = 584;\n t.Icircumflex = 278;\n t.ncaron = 611;\n t.tcommaaccent = 333;\n t.logicalnot = 584;\n t.odieresis = 611;\n t.udieresis = 611;\n t.notequal = 549;\n t.gcommaaccent = 611;\n t.eth = 611;\n t.zcaron = 500;\n t.ncommaaccent = 611;\n t.onesuperior = 333;\n t.imacron = 278;\n t.Euro = 556;\n });\n // eslint-disable-next-line no-shadow\n t[\"Helvetica-Oblique\"] = getLookupTableFactory(function (t) {\n t.space = 278;\n t.exclam = 278;\n t.quotedbl = 355;\n t.numbersign = 556;\n t.dollar = 556;\n t.percent = 889;\n t.ampersand = 667;\n t.quoteright = 222;\n t.parenleft = 333;\n t.parenright = 333;\n t.asterisk = 389;\n t.plus = 584;\n t.comma = 278;\n t.hyphen = 333;\n t.period = 278;\n t.slash = 278;\n t.zero = 556;\n t.one = 556;\n t.two = 556;\n t.three = 556;\n t.four = 556;\n t.five = 556;\n t.six = 556;\n t.seven = 556;\n t.eight = 556;\n t.nine = 556;\n t.colon = 278;\n t.semicolon = 278;\n t.less = 584;\n t.equal = 584;\n t.greater = 584;\n t.question = 556;\n t.at = 1015;\n t.A = 667;\n t.B = 667;\n t.C = 722;\n t.D = 722;\n t.E = 667;\n t.F = 611;\n t.G = 778;\n t.H = 722;\n t.I = 278;\n t.J = 500;\n t.K = 667;\n t.L = 556;\n t.M = 833;\n t.N = 722;\n t.O = 778;\n t.P = 667;\n t.Q = 778;\n t.R = 722;\n t.S = 667;\n t.T = 611;\n t.U = 722;\n t.V = 667;\n t.W = 944;\n t.X = 667;\n t.Y = 667;\n t.Z = 611;\n t.bracketleft = 278;\n t.backslash = 278;\n t.bracketright = 278;\n t.asciicircum = 469;\n t.underscore = 556;\n t.quoteleft = 222;\n t.a = 556;\n t.b = 556;\n t.c = 500;\n t.d = 556;\n t.e = 556;\n t.f = 278;\n t.g = 556;\n t.h = 556;\n t.i = 222;\n t.j = 222;\n t.k = 500;\n t.l = 222;\n t.m = 833;\n t.n = 556;\n t.o = 556;\n t.p = 556;\n t.q = 556;\n t.r = 333;\n t.s = 500;\n t.t = 278;\n t.u = 556;\n t.v = 500;\n t.w = 722;\n t.x = 500;\n t.y = 500;\n t.z = 500;\n t.braceleft = 334;\n t.bar = 260;\n t.braceright = 334;\n t.asciitilde = 584;\n t.exclamdown = 333;\n t.cent = 556;\n t.sterling = 556;\n t.fraction = 167;\n t.yen = 556;\n t.florin = 556;\n t.section = 556;\n t.currency = 556;\n t.quotesingle = 191;\n t.quotedblleft = 333;\n t.guillemotleft = 556;\n t.guilsinglleft = 333;\n t.guilsinglright = 333;\n t.fi = 500;\n t.fl = 500;\n t.endash = 556;\n t.dagger = 556;\n t.daggerdbl = 556;\n t.periodcentered = 278;\n t.paragraph = 537;\n t.bullet = 350;\n t.quotesinglbase = 222;\n t.quotedblbase = 333;\n t.quotedblright = 333;\n t.guillemotright = 556;\n t.ellipsis = 1000;\n t.perthousand = 1000;\n t.questiondown = 611;\n t.grave = 333;\n t.acute = 333;\n t.circumflex = 333;\n t.tilde = 333;\n t.macron = 333;\n t.breve = 333;\n t.dotaccent = 333;\n t.dieresis = 333;\n t.ring = 333;\n t.cedilla = 333;\n t.hungarumlaut = 333;\n t.ogonek = 333;\n t.caron = 333;\n t.emdash = 1000;\n t.AE = 1000;\n t.ordfeminine = 370;\n t.Lslash = 556;\n t.Oslash = 778;\n t.OE = 1000;\n t.ordmasculine = 365;\n t.ae = 889;\n t.dotlessi = 278;\n t.lslash = 222;\n t.oslash = 611;\n t.oe = 944;\n t.germandbls = 611;\n t.Idieresis = 278;\n t.eacute = 556;\n t.abreve = 556;\n t.uhungarumlaut = 556;\n t.ecaron = 556;\n t.Ydieresis = 667;\n t.divide = 584;\n t.Yacute = 667;\n t.Acircumflex = 667;\n t.aacute = 556;\n t.Ucircumflex = 722;\n t.yacute = 500;\n t.scommaaccent = 500;\n t.ecircumflex = 556;\n t.Uring = 722;\n t.Udieresis = 722;\n t.aogonek = 556;\n t.Uacute = 722;\n t.uogonek = 556;\n t.Edieresis = 667;\n t.Dcroat = 722;\n t.commaaccent = 250;\n t.copyright = 737;\n t.Emacron = 667;\n t.ccaron = 500;\n t.aring = 556;\n t.Ncommaaccent = 722;\n t.lacute = 222;\n t.agrave = 556;\n t.Tcommaaccent = 611;\n t.Cacute = 722;\n t.atilde = 556;\n t.Edotaccent = 667;\n t.scaron = 500;\n t.scedilla = 500;\n t.iacute = 278;\n t.lozenge = 471;\n t.Rcaron = 722;\n t.Gcommaaccent = 778;\n t.ucircumflex = 556;\n t.acircumflex = 556;\n t.Amacron = 667;\n t.rcaron = 333;\n t.ccedilla = 500;\n t.Zdotaccent = 611;\n t.Thorn = 667;\n t.Omacron = 778;\n t.Racute = 722;\n t.Sacute = 667;\n t.dcaron = 643;\n t.Umacron = 722;\n t.uring = 556;\n t.threesuperior = 333;\n t.Ograve = 778;\n t.Agrave = 667;\n t.Abreve = 667;\n t.multiply = 584;\n t.uacute = 556;\n t.Tcaron = 611;\n t.partialdiff = 476;\n t.ydieresis = 500;\n t.Nacute = 722;\n t.icircumflex = 278;\n t.Ecircumflex = 667;\n t.adieresis = 556;\n t.edieresis = 556;\n t.cacute = 500;\n t.nacute = 556;\n t.umacron = 556;\n t.Ncaron = 722;\n t.Iacute = 278;\n t.plusminus = 584;\n t.brokenbar = 260;\n t.registered = 737;\n t.Gbreve = 778;\n t.Idotaccent = 278;\n t.summation = 600;\n t.Egrave = 667;\n t.racute = 333;\n t.omacron = 556;\n t.Zacute = 611;\n t.Zcaron = 611;\n t.greaterequal = 549;\n t.Eth = 722;\n t.Ccedilla = 722;\n t.lcommaaccent = 222;\n t.tcaron = 317;\n t.eogonek = 556;\n t.Uogonek = 722;\n t.Aacute = 667;\n t.Adieresis = 667;\n t.egrave = 556;\n t.zacute = 500;\n t.iogonek = 222;\n t.Oacute = 778;\n t.oacute = 556;\n t.amacron = 556;\n t.sacute = 500;\n t.idieresis = 278;\n t.Ocircumflex = 778;\n t.Ugrave = 722;\n t.Delta = 612;\n t.thorn = 556;\n t.twosuperior = 333;\n t.Odieresis = 778;\n t.mu = 556;\n t.igrave = 278;\n t.ohungarumlaut = 556;\n t.Eogonek = 667;\n t.dcroat = 556;\n t.threequarters = 834;\n t.Scedilla = 667;\n t.lcaron = 299;\n t.Kcommaaccent = 667;\n t.Lacute = 556;\n t.trademark = 1000;\n t.edotaccent = 556;\n t.Igrave = 278;\n t.Imacron = 278;\n t.Lcaron = 556;\n t.onehalf = 834;\n t.lessequal = 549;\n t.ocircumflex = 556;\n t.ntilde = 556;\n t.Uhungarumlaut = 722;\n t.Eacute = 667;\n t.emacron = 556;\n t.gbreve = 556;\n t.onequarter = 834;\n t.Scaron = 667;\n t.Scommaaccent = 667;\n t.Ohungarumlaut = 778;\n t.degree = 400;\n t.ograve = 556;\n t.Ccaron = 722;\n t.ugrave = 556;\n t.radical = 453;\n t.Dcaron = 722;\n t.rcommaaccent = 333;\n t.Ntilde = 722;\n t.otilde = 556;\n t.Rcommaaccent = 722;\n t.Lcommaaccent = 556;\n t.Atilde = 667;\n t.Aogonek = 667;\n t.Aring = 667;\n t.Otilde = 778;\n t.zdotaccent = 500;\n t.Ecaron = 667;\n t.Iogonek = 278;\n t.kcommaaccent = 500;\n t.minus = 584;\n t.Icircumflex = 278;\n t.ncaron = 556;\n t.tcommaaccent = 278;\n t.logicalnot = 584;\n t.odieresis = 556;\n t.udieresis = 556;\n t.notequal = 549;\n t.gcommaaccent = 556;\n t.eth = 556;\n t.zcaron = 500;\n t.ncommaaccent = 556;\n t.onesuperior = 333;\n t.imacron = 278;\n t.Euro = 556;\n });\n // eslint-disable-next-line no-shadow\n t.Symbol = getLookupTableFactory(function (t) {\n t.space = 250;\n t.exclam = 333;\n t.universal = 713;\n t.numbersign = 500;\n t.existential = 549;\n t.percent = 833;\n t.ampersand = 778;\n t.suchthat = 439;\n t.parenleft = 333;\n t.parenright = 333;\n t.asteriskmath = 500;\n t.plus = 549;\n t.comma = 250;\n t.minus = 549;\n t.period = 250;\n t.slash = 278;\n t.zero = 500;\n t.one = 500;\n t.two = 500;\n t.three = 500;\n t.four = 500;\n t.five = 500;\n t.six = 500;\n t.seven = 500;\n t.eight = 500;\n t.nine = 500;\n t.colon = 278;\n t.semicolon = 278;\n t.less = 549;\n t.equal = 549;\n t.greater = 549;\n t.question = 444;\n t.congruent = 549;\n t.Alpha = 722;\n t.Beta = 667;\n t.Chi = 722;\n t.Delta = 612;\n t.Epsilon = 611;\n t.Phi = 763;\n t.Gamma = 603;\n t.Eta = 722;\n t.Iota = 333;\n t.theta1 = 631;\n t.Kappa = 722;\n t.Lambda = 686;\n t.Mu = 889;\n t.Nu = 722;\n t.Omicron = 722;\n t.Pi = 768;\n t.Theta = 741;\n t.Rho = 556;\n t.Sigma = 592;\n t.Tau = 611;\n t.Upsilon = 690;\n t.sigma1 = 439;\n t.Omega = 768;\n t.Xi = 645;\n t.Psi = 795;\n t.Zeta = 611;\n t.bracketleft = 333;\n t.therefore = 863;\n t.bracketright = 333;\n t.perpendicular = 658;\n t.underscore = 500;\n t.radicalex = 500;\n t.alpha = 631;\n t.beta = 549;\n t.chi = 549;\n t.delta = 494;\n t.epsilon = 439;\n t.phi = 521;\n t.gamma = 411;\n t.eta = 603;\n t.iota = 329;\n t.phi1 = 603;\n t.kappa = 549;\n t.lambda = 549;\n t.mu = 576;\n t.nu = 521;\n t.omicron = 549;\n t.pi = 549;\n t.theta = 521;\n t.rho = 549;\n t.sigma = 603;\n t.tau = 439;\n t.upsilon = 576;\n t.omega1 = 713;\n t.omega = 686;\n t.xi = 493;\n t.psi = 686;\n t.zeta = 494;\n t.braceleft = 480;\n t.bar = 200;\n t.braceright = 480;\n t.similar = 549;\n t.Euro = 750;\n t.Upsilon1 = 620;\n t.minute = 247;\n t.lessequal = 549;\n t.fraction = 167;\n t.infinity = 713;\n t.florin = 500;\n t.club = 753;\n t.diamond = 753;\n t.heart = 753;\n t.spade = 753;\n t.arrowboth = 1042;\n t.arrowleft = 987;\n t.arrowup = 603;\n t.arrowright = 987;\n t.arrowdown = 603;\n t.degree = 400;\n t.plusminus = 549;\n t.second = 411;\n t.greaterequal = 549;\n t.multiply = 549;\n t.proportional = 713;\n t.partialdiff = 494;\n t.bullet = 460;\n t.divide = 549;\n t.notequal = 549;\n t.equivalence = 549;\n t.approxequal = 549;\n t.ellipsis = 1000;\n t.arrowvertex = 603;\n t.arrowhorizex = 1000;\n t.carriagereturn = 658;\n t.aleph = 823;\n t.Ifraktur = 686;\n t.Rfraktur = 795;\n t.weierstrass = 987;\n t.circlemultiply = 768;\n t.circleplus = 768;\n t.emptyset = 823;\n t.intersection = 768;\n t.union = 768;\n t.propersuperset = 713;\n t.reflexsuperset = 713;\n t.notsubset = 713;\n t.propersubset = 713;\n t.reflexsubset = 713;\n t.element = 713;\n t.notelement = 713;\n t.angle = 768;\n t.gradient = 713;\n t.registerserif = 790;\n t.copyrightserif = 790;\n t.trademarkserif = 890;\n t.product = 823;\n t.radical = 549;\n t.dotmath = 250;\n t.logicalnot = 713;\n t.logicaland = 603;\n t.logicalor = 603;\n t.arrowdblboth = 1042;\n t.arrowdblleft = 987;\n t.arrowdblup = 603;\n t.arrowdblright = 987;\n t.arrowdbldown = 603;\n t.lozenge = 494;\n t.angleleft = 329;\n t.registersans = 790;\n t.copyrightsans = 790;\n t.trademarksans = 786;\n t.summation = 713;\n t.parenlefttp = 384;\n t.parenleftex = 384;\n t.parenleftbt = 384;\n t.bracketlefttp = 384;\n t.bracketleftex = 384;\n t.bracketleftbt = 384;\n t.bracelefttp = 494;\n t.braceleftmid = 494;\n t.braceleftbt = 494;\n t.braceex = 494;\n t.angleright = 329;\n t.integral = 274;\n t.integraltp = 686;\n t.integralex = 686;\n t.integralbt = 686;\n t.parenrighttp = 384;\n t.parenrightex = 384;\n t.parenrightbt = 384;\n t.bracketrighttp = 384;\n t.bracketrightex = 384;\n t.bracketrightbt = 384;\n t.bracerighttp = 494;\n t.bracerightmid = 494;\n t.bracerightbt = 494;\n t.apple = 790;\n });\n // eslint-disable-next-line no-shadow\n t[\"Times-Roman\"] = getLookupTableFactory(function (t) {\n t.space = 250;\n t.exclam = 333;\n t.quotedbl = 408;\n t.numbersign = 500;\n t.dollar = 500;\n t.percent = 833;\n t.ampersand = 778;\n t.quoteright = 333;\n t.parenleft = 333;\n t.parenright = 333;\n t.asterisk = 500;\n t.plus = 564;\n t.comma = 250;\n t.hyphen = 333;\n t.period = 250;\n t.slash = 278;\n t.zero = 500;\n t.one = 500;\n t.two = 500;\n t.three = 500;\n t.four = 500;\n t.five = 500;\n t.six = 500;\n t.seven = 500;\n t.eight = 500;\n t.nine = 500;\n t.colon = 278;\n t.semicolon = 278;\n t.less = 564;\n t.equal = 564;\n t.greater = 564;\n t.question = 444;\n t.at = 921;\n t.A = 722;\n t.B = 667;\n t.C = 667;\n t.D = 722;\n t.E = 611;\n t.F = 556;\n t.G = 722;\n t.H = 722;\n t.I = 333;\n t.J = 389;\n t.K = 722;\n t.L = 611;\n t.M = 889;\n t.N = 722;\n t.O = 722;\n t.P = 556;\n t.Q = 722;\n t.R = 667;\n t.S = 556;\n t.T = 611;\n t.U = 722;\n t.V = 722;\n t.W = 944;\n t.X = 722;\n t.Y = 722;\n t.Z = 611;\n t.bracketleft = 333;\n t.backslash = 278;\n t.bracketright = 333;\n t.asciicircum = 469;\n t.underscore = 500;\n t.quoteleft = 333;\n t.a = 444;\n t.b = 500;\n t.c = 444;\n t.d = 500;\n t.e = 444;\n t.f = 333;\n t.g = 500;\n t.h = 500;\n t.i = 278;\n t.j = 278;\n t.k = 500;\n t.l = 278;\n t.m = 778;\n t.n = 500;\n t.o = 500;\n t.p = 500;\n t.q = 500;\n t.r = 333;\n t.s = 389;\n t.t = 278;\n t.u = 500;\n t.v = 500;\n t.w = 722;\n t.x = 500;\n t.y = 500;\n t.z = 444;\n t.braceleft = 480;\n t.bar = 200;\n t.braceright = 480;\n t.asciitilde = 541;\n t.exclamdown = 333;\n t.cent = 500;\n t.sterling = 500;\n t.fraction = 167;\n t.yen = 500;\n t.florin = 500;\n t.section = 500;\n t.currency = 500;\n t.quotesingle = 180;\n t.quotedblleft = 444;\n t.guillemotleft = 500;\n t.guilsinglleft = 333;\n t.guilsinglright = 333;\n t.fi = 556;\n t.fl = 556;\n t.endash = 500;\n t.dagger = 500;\n t.daggerdbl = 500;\n t.periodcentered = 250;\n t.paragraph = 453;\n t.bullet = 350;\n t.quotesinglbase = 333;\n t.quotedblbase = 444;\n t.quotedblright = 444;\n t.guillemotright = 500;\n t.ellipsis = 1000;\n t.perthousand = 1000;\n t.questiondown = 444;\n t.grave = 333;\n t.acute = 333;\n t.circumflex = 333;\n t.tilde = 333;\n t.macron = 333;\n t.breve = 333;\n t.dotaccent = 333;\n t.dieresis = 333;\n t.ring = 333;\n t.cedilla = 333;\n t.hungarumlaut = 333;\n t.ogonek = 333;\n t.caron = 333;\n t.emdash = 1000;\n t.AE = 889;\n t.ordfeminine = 276;\n t.Lslash = 611;\n t.Oslash = 722;\n t.OE = 889;\n t.ordmasculine = 310;\n t.ae = 667;\n t.dotlessi = 278;\n t.lslash = 278;\n t.oslash = 500;\n t.oe = 722;\n t.germandbls = 500;\n t.Idieresis = 333;\n t.eacute = 444;\n t.abreve = 444;\n t.uhungarumlaut = 500;\n t.ecaron = 444;\n t.Ydieresis = 722;\n t.divide = 564;\n t.Yacute = 722;\n t.Acircumflex = 722;\n t.aacute = 444;\n t.Ucircumflex = 722;\n t.yacute = 500;\n t.scommaaccent = 389;\n t.ecircumflex = 444;\n t.Uring = 722;\n t.Udieresis = 722;\n t.aogonek = 444;\n t.Uacute = 722;\n t.uogonek = 500;\n t.Edieresis = 611;\n t.Dcroat = 722;\n t.commaaccent = 250;\n t.copyright = 760;\n t.Emacron = 611;\n t.ccaron = 444;\n t.aring = 444;\n t.Ncommaaccent = 722;\n t.lacute = 278;\n t.agrave = 444;\n t.Tcommaaccent = 611;\n t.Cacute = 667;\n t.atilde = 444;\n t.Edotaccent = 611;\n t.scaron = 389;\n t.scedilla = 389;\n t.iacute = 278;\n t.lozenge = 471;\n t.Rcaron = 667;\n t.Gcommaaccent = 722;\n t.ucircumflex = 500;\n t.acircumflex = 444;\n t.Amacron = 722;\n t.rcaron = 333;\n t.ccedilla = 444;\n t.Zdotaccent = 611;\n t.Thorn = 556;\n t.Omacron = 722;\n t.Racute = 667;\n t.Sacute = 556;\n t.dcaron = 588;\n t.Umacron = 722;\n t.uring = 500;\n t.threesuperior = 300;\n t.Ograve = 722;\n t.Agrave = 722;\n t.Abreve = 722;\n t.multiply = 564;\n t.uacute = 500;\n t.Tcaron = 611;\n t.partialdiff = 476;\n t.ydieresis = 500;\n t.Nacute = 722;\n t.icircumflex = 278;\n t.Ecircumflex = 611;\n t.adieresis = 444;\n t.edieresis = 444;\n t.cacute = 444;\n t.nacute = 500;\n t.umacron = 500;\n t.Ncaron = 722;\n t.Iacute = 333;\n t.plusminus = 564;\n t.brokenbar = 200;\n t.registered = 760;\n t.Gbreve = 722;\n t.Idotaccent = 333;\n t.summation = 600;\n t.Egrave = 611;\n t.racute = 333;\n t.omacron = 500;\n t.Zacute = 611;\n t.Zcaron = 611;\n t.greaterequal = 549;\n t.Eth = 722;\n t.Ccedilla = 667;\n t.lcommaaccent = 278;\n t.tcaron = 326;\n t.eogonek = 444;\n t.Uogonek = 722;\n t.Aacute = 722;\n t.Adieresis = 722;\n t.egrave = 444;\n t.zacute = 444;\n t.iogonek = 278;\n t.Oacute = 722;\n t.oacute = 500;\n t.amacron = 444;\n t.sacute = 389;\n t.idieresis = 278;\n t.Ocircumflex = 722;\n t.Ugrave = 722;\n t.Delta = 612;\n t.thorn = 500;\n t.twosuperior = 300;\n t.Odieresis = 722;\n t.mu = 500;\n t.igrave = 278;\n t.ohungarumlaut = 500;\n t.Eogonek = 611;\n t.dcroat = 500;\n t.threequarters = 750;\n t.Scedilla = 556;\n t.lcaron = 344;\n t.Kcommaaccent = 722;\n t.Lacute = 611;\n t.trademark = 980;\n t.edotaccent = 444;\n t.Igrave = 333;\n t.Imacron = 333;\n t.Lcaron = 611;\n t.onehalf = 750;\n t.lessequal = 549;\n t.ocircumflex = 500;\n t.ntilde = 500;\n t.Uhungarumlaut = 722;\n t.Eacute = 611;\n t.emacron = 444;\n t.gbreve = 500;\n t.onequarter = 750;\n t.Scaron = 556;\n t.Scommaaccent = 556;\n t.Ohungarumlaut = 722;\n t.degree = 400;\n t.ograve = 500;\n t.Ccaron = 667;\n t.ugrave = 500;\n t.radical = 453;\n t.Dcaron = 722;\n t.rcommaaccent = 333;\n t.Ntilde = 722;\n t.otilde = 500;\n t.Rcommaaccent = 667;\n t.Lcommaaccent = 611;\n t.Atilde = 722;\n t.Aogonek = 722;\n t.Aring = 722;\n t.Otilde = 722;\n t.zdotaccent = 444;\n t.Ecaron = 611;\n t.Iogonek = 333;\n t.kcommaaccent = 500;\n t.minus = 564;\n t.Icircumflex = 333;\n t.ncaron = 500;\n t.tcommaaccent = 278;\n t.logicalnot = 564;\n t.odieresis = 500;\n t.udieresis = 500;\n t.notequal = 549;\n t.gcommaaccent = 500;\n t.eth = 500;\n t.zcaron = 444;\n t.ncommaaccent = 500;\n t.onesuperior = 300;\n t.imacron = 278;\n t.Euro = 500;\n });\n // eslint-disable-next-line no-shadow\n t[\"Times-Bold\"] = getLookupTableFactory(function (t) {\n t.space = 250;\n t.exclam = 333;\n t.quotedbl = 555;\n t.numbersign = 500;\n t.dollar = 500;\n t.percent = 1000;\n t.ampersand = 833;\n t.quoteright = 333;\n t.parenleft = 333;\n t.parenright = 333;\n t.asterisk = 500;\n t.plus = 570;\n t.comma = 250;\n t.hyphen = 333;\n t.period = 250;\n t.slash = 278;\n t.zero = 500;\n t.one = 500;\n t.two = 500;\n t.three = 500;\n t.four = 500;\n t.five = 500;\n t.six = 500;\n t.seven = 500;\n t.eight = 500;\n t.nine = 500;\n t.colon = 333;\n t.semicolon = 333;\n t.less = 570;\n t.equal = 570;\n t.greater = 570;\n t.question = 500;\n t.at = 930;\n t.A = 722;\n t.B = 667;\n t.C = 722;\n t.D = 722;\n t.E = 667;\n t.F = 611;\n t.G = 778;\n t.H = 778;\n t.I = 389;\n t.J = 500;\n t.K = 778;\n t.L = 667;\n t.M = 944;\n t.N = 722;\n t.O = 778;\n t.P = 611;\n t.Q = 778;\n t.R = 722;\n t.S = 556;\n t.T = 667;\n t.U = 722;\n t.V = 722;\n t.W = 1000;\n t.X = 722;\n t.Y = 722;\n t.Z = 667;\n t.bracketleft = 333;\n t.backslash = 278;\n t.bracketright = 333;\n t.asciicircum = 581;\n t.underscore = 500;\n t.quoteleft = 333;\n t.a = 500;\n t.b = 556;\n t.c = 444;\n t.d = 556;\n t.e = 444;\n t.f = 333;\n t.g = 500;\n t.h = 556;\n t.i = 278;\n t.j = 333;\n t.k = 556;\n t.l = 278;\n t.m = 833;\n t.n = 556;\n t.o = 500;\n t.p = 556;\n t.q = 556;\n t.r = 444;\n t.s = 389;\n t.t = 333;\n t.u = 556;\n t.v = 500;\n t.w = 722;\n t.x = 500;\n t.y = 500;\n t.z = 444;\n t.braceleft = 394;\n t.bar = 220;\n t.braceright = 394;\n t.asciitilde = 520;\n t.exclamdown = 333;\n t.cent = 500;\n t.sterling = 500;\n t.fraction = 167;\n t.yen = 500;\n t.florin = 500;\n t.section = 500;\n t.currency = 500;\n t.quotesingle = 278;\n t.quotedblleft = 500;\n t.guillemotleft = 500;\n t.guilsinglleft = 333;\n t.guilsinglright = 333;\n t.fi = 556;\n t.fl = 556;\n t.endash = 500;\n t.dagger = 500;\n t.daggerdbl = 500;\n t.periodcentered = 250;\n t.paragraph = 540;\n t.bullet = 350;\n t.quotesinglbase = 333;\n t.quotedblbase = 500;\n t.quotedblright = 500;\n t.guillemotright = 500;\n t.ellipsis = 1000;\n t.perthousand = 1000;\n t.questiondown = 500;\n t.grave = 333;\n t.acute = 333;\n t.circumflex = 333;\n t.tilde = 333;\n t.macron = 333;\n t.breve = 333;\n t.dotaccent = 333;\n t.dieresis = 333;\n t.ring = 333;\n t.cedilla = 333;\n t.hungarumlaut = 333;\n t.ogonek = 333;\n t.caron = 333;\n t.emdash = 1000;\n t.AE = 1000;\n t.ordfeminine = 300;\n t.Lslash = 667;\n t.Oslash = 778;\n t.OE = 1000;\n t.ordmasculine = 330;\n t.ae = 722;\n t.dotlessi = 278;\n t.lslash = 278;\n t.oslash = 500;\n t.oe = 722;\n t.germandbls = 556;\n t.Idieresis = 389;\n t.eacute = 444;\n t.abreve = 500;\n t.uhungarumlaut = 556;\n t.ecaron = 444;\n t.Ydieresis = 722;\n t.divide = 570;\n t.Yacute = 722;\n t.Acircumflex = 722;\n t.aacute = 500;\n t.Ucircumflex = 722;\n t.yacute = 500;\n t.scommaaccent = 389;\n t.ecircumflex = 444;\n t.Uring = 722;\n t.Udieresis = 722;\n t.aogonek = 500;\n t.Uacute = 722;\n t.uogonek = 556;\n t.Edieresis = 667;\n t.Dcroat = 722;\n t.commaaccent = 250;\n t.copyright = 747;\n t.Emacron = 667;\n t.ccaron = 444;\n t.aring = 500;\n t.Ncommaaccent = 722;\n t.lacute = 278;\n t.agrave = 500;\n t.Tcommaaccent = 667;\n t.Cacute = 722;\n t.atilde = 500;\n t.Edotaccent = 667;\n t.scaron = 389;\n t.scedilla = 389;\n t.iacute = 278;\n t.lozenge = 494;\n t.Rcaron = 722;\n t.Gcommaaccent = 778;\n t.ucircumflex = 556;\n t.acircumflex = 500;\n t.Amacron = 722;\n t.rcaron = 444;\n t.ccedilla = 444;\n t.Zdotaccent = 667;\n t.Thorn = 611;\n t.Omacron = 778;\n t.Racute = 722;\n t.Sacute = 556;\n t.dcaron = 672;\n t.Umacron = 722;\n t.uring = 556;\n t.threesuperior = 300;\n t.Ograve = 778;\n t.Agrave = 722;\n t.Abreve = 722;\n t.multiply = 570;\n t.uacute = 556;\n t.Tcaron = 667;\n t.partialdiff = 494;\n t.ydieresis = 500;\n t.Nacute = 722;\n t.icircumflex = 278;\n t.Ecircumflex = 667;\n t.adieresis = 500;\n t.edieresis = 444;\n t.cacute = 444;\n t.nacute = 556;\n t.umacron = 556;\n t.Ncaron = 722;\n t.Iacute = 389;\n t.plusminus = 570;\n t.brokenbar = 220;\n t.registered = 747;\n t.Gbreve = 778;\n t.Idotaccent = 389;\n t.summation = 600;\n t.Egrave = 667;\n t.racute = 444;\n t.omacron = 500;\n t.Zacute = 667;\n t.Zcaron = 667;\n t.greaterequal = 549;\n t.Eth = 722;\n t.Ccedilla = 722;\n t.lcommaaccent = 278;\n t.tcaron = 416;\n t.eogonek = 444;\n t.Uogonek = 722;\n t.Aacute = 722;\n t.Adieresis = 722;\n t.egrave = 444;\n t.zacute = 444;\n t.iogonek = 278;\n t.Oacute = 778;\n t.oacute = 500;\n t.amacron = 500;\n t.sacute = 389;\n t.idieresis = 278;\n t.Ocircumflex = 778;\n t.Ugrave = 722;\n t.Delta = 612;\n t.thorn = 556;\n t.twosuperior = 300;\n t.Odieresis = 778;\n t.mu = 556;\n t.igrave = 278;\n t.ohungarumlaut = 500;\n t.Eogonek = 667;\n t.dcroat = 556;\n t.threequarters = 750;\n t.Scedilla = 556;\n t.lcaron = 394;\n t.Kcommaaccent = 778;\n t.Lacute = 667;\n t.trademark = 1000;\n t.edotaccent = 444;\n t.Igrave = 389;\n t.Imacron = 389;\n t.Lcaron = 667;\n t.onehalf = 750;\n t.lessequal = 549;\n t.ocircumflex = 500;\n t.ntilde = 556;\n t.Uhungarumlaut = 722;\n t.Eacute = 667;\n t.emacron = 444;\n t.gbreve = 500;\n t.onequarter = 750;\n t.Scaron = 556;\n t.Scommaaccent = 556;\n t.Ohungarumlaut = 778;\n t.degree = 400;\n t.ograve = 500;\n t.Ccaron = 722;\n t.ugrave = 556;\n t.radical = 549;\n t.Dcaron = 722;\n t.rcommaaccent = 444;\n t.Ntilde = 722;\n t.otilde = 500;\n t.Rcommaaccent = 722;\n t.Lcommaaccent = 667;\n t.Atilde = 722;\n t.Aogonek = 722;\n t.Aring = 722;\n t.Otilde = 778;\n t.zdotaccent = 444;\n t.Ecaron = 667;\n t.Iogonek = 389;\n t.kcommaaccent = 556;\n t.minus = 570;\n t.Icircumflex = 389;\n t.ncaron = 556;\n t.tcommaaccent = 333;\n t.logicalnot = 570;\n t.odieresis = 500;\n t.udieresis = 556;\n t.notequal = 549;\n t.gcommaaccent = 500;\n t.eth = 500;\n t.zcaron = 444;\n t.ncommaaccent = 556;\n t.onesuperior = 300;\n t.imacron = 278;\n t.Euro = 500;\n });\n // eslint-disable-next-line no-shadow\n t[\"Times-BoldItalic\"] = getLookupTableFactory(function (t) {\n t.space = 250;\n t.exclam = 389;\n t.quotedbl = 555;\n t.numbersign = 500;\n t.dollar = 500;\n t.percent = 833;\n t.ampersand = 778;\n t.quoteright = 333;\n t.parenleft = 333;\n t.parenright = 333;\n t.asterisk = 500;\n t.plus = 570;\n t.comma = 250;\n t.hyphen = 333;\n t.period = 250;\n t.slash = 278;\n t.zero = 500;\n t.one = 500;\n t.two = 500;\n t.three = 500;\n t.four = 500;\n t.five = 500;\n t.six = 500;\n t.seven = 500;\n t.eight = 500;\n t.nine = 500;\n t.colon = 333;\n t.semicolon = 333;\n t.less = 570;\n t.equal = 570;\n t.greater = 570;\n t.question = 500;\n t.at = 832;\n t.A = 667;\n t.B = 667;\n t.C = 667;\n t.D = 722;\n t.E = 667;\n t.F = 667;\n t.G = 722;\n t.H = 778;\n t.I = 389;\n t.J = 500;\n t.K = 667;\n t.L = 611;\n t.M = 889;\n t.N = 722;\n t.O = 722;\n t.P = 611;\n t.Q = 722;\n t.R = 667;\n t.S = 556;\n t.T = 611;\n t.U = 722;\n t.V = 667;\n t.W = 889;\n t.X = 667;\n t.Y = 611;\n t.Z = 611;\n t.bracketleft = 333;\n t.backslash = 278;\n t.bracketright = 333;\n t.asciicircum = 570;\n t.underscore = 500;\n t.quoteleft = 333;\n t.a = 500;\n t.b = 500;\n t.c = 444;\n t.d = 500;\n t.e = 444;\n t.f = 333;\n t.g = 500;\n t.h = 556;\n t.i = 278;\n t.j = 278;\n t.k = 500;\n t.l = 278;\n t.m = 778;\n t.n = 556;\n t.o = 500;\n t.p = 500;\n t.q = 500;\n t.r = 389;\n t.s = 389;\n t.t = 278;\n t.u = 556;\n t.v = 444;\n t.w = 667;\n t.x = 500;\n t.y = 444;\n t.z = 389;\n t.braceleft = 348;\n t.bar = 220;\n t.braceright = 348;\n t.asciitilde = 570;\n t.exclamdown = 389;\n t.cent = 500;\n t.sterling = 500;\n t.fraction = 167;\n t.yen = 500;\n t.florin = 500;\n t.section = 500;\n t.currency = 500;\n t.quotesingle = 278;\n t.quotedblleft = 500;\n t.guillemotleft = 500;\n t.guilsinglleft = 333;\n t.guilsinglright = 333;\n t.fi = 556;\n t.fl = 556;\n t.endash = 500;\n t.dagger = 500;\n t.daggerdbl = 500;\n t.periodcentered = 250;\n t.paragraph = 500;\n t.bullet = 350;\n t.quotesinglbase = 333;\n t.quotedblbase = 500;\n t.quotedblright = 500;\n t.guillemotright = 500;\n t.ellipsis = 1000;\n t.perthousand = 1000;\n t.questiondown = 500;\n t.grave = 333;\n t.acute = 333;\n t.circumflex = 333;\n t.tilde = 333;\n t.macron = 333;\n t.breve = 333;\n t.dotaccent = 333;\n t.dieresis = 333;\n t.ring = 333;\n t.cedilla = 333;\n t.hungarumlaut = 333;\n t.ogonek = 333;\n t.caron = 333;\n t.emdash = 1000;\n t.AE = 944;\n t.ordfeminine = 266;\n t.Lslash = 611;\n t.Oslash = 722;\n t.OE = 944;\n t.ordmasculine = 300;\n t.ae = 722;\n t.dotlessi = 278;\n t.lslash = 278;\n t.oslash = 500;\n t.oe = 722;\n t.germandbls = 500;\n t.Idieresis = 389;\n t.eacute = 444;\n t.abreve = 500;\n t.uhungarumlaut = 556;\n t.ecaron = 444;\n t.Ydieresis = 611;\n t.divide = 570;\n t.Yacute = 611;\n t.Acircumflex = 667;\n t.aacute = 500;\n t.Ucircumflex = 722;\n t.yacute = 444;\n t.scommaaccent = 389;\n t.ecircumflex = 444;\n t.Uring = 722;\n t.Udieresis = 722;\n t.aogonek = 500;\n t.Uacute = 722;\n t.uogonek = 556;\n t.Edieresis = 667;\n t.Dcroat = 722;\n t.commaaccent = 250;\n t.copyright = 747;\n t.Emacron = 667;\n t.ccaron = 444;\n t.aring = 500;\n t.Ncommaaccent = 722;\n t.lacute = 278;\n t.agrave = 500;\n t.Tcommaaccent = 611;\n t.Cacute = 667;\n t.atilde = 500;\n t.Edotaccent = 667;\n t.scaron = 389;\n t.scedilla = 389;\n t.iacute = 278;\n t.lozenge = 494;\n t.Rcaron = 667;\n t.Gcommaaccent = 722;\n t.ucircumflex = 556;\n t.acircumflex = 500;\n t.Amacron = 667;\n t.rcaron = 389;\n t.ccedilla = 444;\n t.Zdotaccent = 611;\n t.Thorn = 611;\n t.Omacron = 722;\n t.Racute = 667;\n t.Sacute = 556;\n t.dcaron = 608;\n t.Umacron = 722;\n t.uring = 556;\n t.threesuperior = 300;\n t.Ograve = 722;\n t.Agrave = 667;\n t.Abreve = 667;\n t.multiply = 570;\n t.uacute = 556;\n t.Tcaron = 611;\n t.partialdiff = 494;\n t.ydieresis = 444;\n t.Nacute = 722;\n t.icircumflex = 278;\n t.Ecircumflex = 667;\n t.adieresis = 500;\n t.edieresis = 444;\n t.cacute = 444;\n t.nacute = 556;\n t.umacron = 556;\n t.Ncaron = 722;\n t.Iacute = 389;\n t.plusminus = 570;\n t.brokenbar = 220;\n t.registered = 747;\n t.Gbreve = 722;\n t.Idotaccent = 389;\n t.summation = 600;\n t.Egrave = 667;\n t.racute = 389;\n t.omacron = 500;\n t.Zacute = 611;\n t.Zcaron = 611;\n t.greaterequal = 549;\n t.Eth = 722;\n t.Ccedilla = 667;\n t.lcommaaccent = 278;\n t.tcaron = 366;\n t.eogonek = 444;\n t.Uogonek = 722;\n t.Aacute = 667;\n t.Adieresis = 667;\n t.egrave = 444;\n t.zacute = 389;\n t.iogonek = 278;\n t.Oacute = 722;\n t.oacute = 500;\n t.amacron = 500;\n t.sacute = 389;\n t.idieresis = 278;\n t.Ocircumflex = 722;\n t.Ugrave = 722;\n t.Delta = 612;\n t.thorn = 500;\n t.twosuperior = 300;\n t.Odieresis = 722;\n t.mu = 576;\n t.igrave = 278;\n t.ohungarumlaut = 500;\n t.Eogonek = 667;\n t.dcroat = 500;\n t.threequarters = 750;\n t.Scedilla = 556;\n t.lcaron = 382;\n t.Kcommaaccent = 667;\n t.Lacute = 611;\n t.trademark = 1000;\n t.edotaccent = 444;\n t.Igrave = 389;\n t.Imacron = 389;\n t.Lcaron = 611;\n t.onehalf = 750;\n t.lessequal = 549;\n t.ocircumflex = 500;\n t.ntilde = 556;\n t.Uhungarumlaut = 722;\n t.Eacute = 667;\n t.emacron = 444;\n t.gbreve = 500;\n t.onequarter = 750;\n t.Scaron = 556;\n t.Scommaaccent = 556;\n t.Ohungarumlaut = 722;\n t.degree = 400;\n t.ograve = 500;\n t.Ccaron = 667;\n t.ugrave = 556;\n t.radical = 549;\n t.Dcaron = 722;\n t.rcommaaccent = 389;\n t.Ntilde = 722;\n t.otilde = 500;\n t.Rcommaaccent = 667;\n t.Lcommaaccent = 611;\n t.Atilde = 667;\n t.Aogonek = 667;\n t.Aring = 667;\n t.Otilde = 722;\n t.zdotaccent = 389;\n t.Ecaron = 667;\n t.Iogonek = 389;\n t.kcommaaccent = 500;\n t.minus = 606;\n t.Icircumflex = 389;\n t.ncaron = 556;\n t.tcommaaccent = 278;\n t.logicalnot = 606;\n t.odieresis = 500;\n t.udieresis = 556;\n t.notequal = 549;\n t.gcommaaccent = 500;\n t.eth = 500;\n t.zcaron = 389;\n t.ncommaaccent = 556;\n t.onesuperior = 300;\n t.imacron = 278;\n t.Euro = 500;\n });\n // eslint-disable-next-line no-shadow\n t[\"Times-Italic\"] = getLookupTableFactory(function (t) {\n t.space = 250;\n t.exclam = 333;\n t.quotedbl = 420;\n t.numbersign = 500;\n t.dollar = 500;\n t.percent = 833;\n t.ampersand = 778;\n t.quoteright = 333;\n t.parenleft = 333;\n t.parenright = 333;\n t.asterisk = 500;\n t.plus = 675;\n t.comma = 250;\n t.hyphen = 333;\n t.period = 250;\n t.slash = 278;\n t.zero = 500;\n t.one = 500;\n t.two = 500;\n t.three = 500;\n t.four = 500;\n t.five = 500;\n t.six = 500;\n t.seven = 500;\n t.eight = 500;\n t.nine = 500;\n t.colon = 333;\n t.semicolon = 333;\n t.less = 675;\n t.equal = 675;\n t.greater = 675;\n t.question = 500;\n t.at = 920;\n t.A = 611;\n t.B = 611;\n t.C = 667;\n t.D = 722;\n t.E = 611;\n t.F = 611;\n t.G = 722;\n t.H = 722;\n t.I = 333;\n t.J = 444;\n t.K = 667;\n t.L = 556;\n t.M = 833;\n t.N = 667;\n t.O = 722;\n t.P = 611;\n t.Q = 722;\n t.R = 611;\n t.S = 500;\n t.T = 556;\n t.U = 722;\n t.V = 611;\n t.W = 833;\n t.X = 611;\n t.Y = 556;\n t.Z = 556;\n t.bracketleft = 389;\n t.backslash = 278;\n t.bracketright = 389;\n t.asciicircum = 422;\n t.underscore = 500;\n t.quoteleft = 333;\n t.a = 500;\n t.b = 500;\n t.c = 444;\n t.d = 500;\n t.e = 444;\n t.f = 278;\n t.g = 500;\n t.h = 500;\n t.i = 278;\n t.j = 278;\n t.k = 444;\n t.l = 278;\n t.m = 722;\n t.n = 500;\n t.o = 500;\n t.p = 500;\n t.q = 500;\n t.r = 389;\n t.s = 389;\n t.t = 278;\n t.u = 500;\n t.v = 444;\n t.w = 667;\n t.x = 444;\n t.y = 444;\n t.z = 389;\n t.braceleft = 400;\n t.bar = 275;\n t.braceright = 400;\n t.asciitilde = 541;\n t.exclamdown = 389;\n t.cent = 500;\n t.sterling = 500;\n t.fraction = 167;\n t.yen = 500;\n t.florin = 500;\n t.section = 500;\n t.currency = 500;\n t.quotesingle = 214;\n t.quotedblleft = 556;\n t.guillemotleft = 500;\n t.guilsinglleft = 333;\n t.guilsinglright = 333;\n t.fi = 500;\n t.fl = 500;\n t.endash = 500;\n t.dagger = 500;\n t.daggerdbl = 500;\n t.periodcentered = 250;\n t.paragraph = 523;\n t.bullet = 350;\n t.quotesinglbase = 333;\n t.quotedblbase = 556;\n t.quotedblright = 556;\n t.guillemotright = 500;\n t.ellipsis = 889;\n t.perthousand = 1000;\n t.questiondown = 500;\n t.grave = 333;\n t.acute = 333;\n t.circumflex = 333;\n t.tilde = 333;\n t.macron = 333;\n t.breve = 333;\n t.dotaccent = 333;\n t.dieresis = 333;\n t.ring = 333;\n t.cedilla = 333;\n t.hungarumlaut = 333;\n t.ogonek = 333;\n t.caron = 333;\n t.emdash = 889;\n t.AE = 889;\n t.ordfeminine = 276;\n t.Lslash = 556;\n t.Oslash = 722;\n t.OE = 944;\n t.ordmasculine = 310;\n t.ae = 667;\n t.dotlessi = 278;\n t.lslash = 278;\n t.oslash = 500;\n t.oe = 667;\n t.germandbls = 500;\n t.Idieresis = 333;\n t.eacute = 444;\n t.abreve = 500;\n t.uhungarumlaut = 500;\n t.ecaron = 444;\n t.Ydieresis = 556;\n t.divide = 675;\n t.Yacute = 556;\n t.Acircumflex = 611;\n t.aacute = 500;\n t.Ucircumflex = 722;\n t.yacute = 444;\n t.scommaaccent = 389;\n t.ecircumflex = 444;\n t.Uring = 722;\n t.Udieresis = 722;\n t.aogonek = 500;\n t.Uacute = 722;\n t.uogonek = 500;\n t.Edieresis = 611;\n t.Dcroat = 722;\n t.commaaccent = 250;\n t.copyright = 760;\n t.Emacron = 611;\n t.ccaron = 444;\n t.aring = 500;\n t.Ncommaaccent = 667;\n t.lacute = 278;\n t.agrave = 500;\n t.Tcommaaccent = 556;\n t.Cacute = 667;\n t.atilde = 500;\n t.Edotaccent = 611;\n t.scaron = 389;\n t.scedilla = 389;\n t.iacute = 278;\n t.lozenge = 471;\n t.Rcaron = 611;\n t.Gcommaaccent = 722;\n t.ucircumflex = 500;\n t.acircumflex = 500;\n t.Amacron = 611;\n t.rcaron = 389;\n t.ccedilla = 444;\n t.Zdotaccent = 556;\n t.Thorn = 611;\n t.Omacron = 722;\n t.Racute = 611;\n t.Sacute = 500;\n t.dcaron = 544;\n t.Umacron = 722;\n t.uring = 500;\n t.threesuperior = 300;\n t.Ograve = 722;\n t.Agrave = 611;\n t.Abreve = 611;\n t.multiply = 675;\n t.uacute = 500;\n t.Tcaron = 556;\n t.partialdiff = 476;\n t.ydieresis = 444;\n t.Nacute = 667;\n t.icircumflex = 278;\n t.Ecircumflex = 611;\n t.adieresis = 500;\n t.edieresis = 444;\n t.cacute = 444;\n t.nacute = 500;\n t.umacron = 500;\n t.Ncaron = 667;\n t.Iacute = 333;\n t.plusminus = 675;\n t.brokenbar = 275;\n t.registered = 760;\n t.Gbreve = 722;\n t.Idotaccent = 333;\n t.summation = 600;\n t.Egrave = 611;\n t.racute = 389;\n t.omacron = 500;\n t.Zacute = 556;\n t.Zcaron = 556;\n t.greaterequal = 549;\n t.Eth = 722;\n t.Ccedilla = 667;\n t.lcommaaccent = 278;\n t.tcaron = 300;\n t.eogonek = 444;\n t.Uogonek = 722;\n t.Aacute = 611;\n t.Adieresis = 611;\n t.egrave = 444;\n t.zacute = 389;\n t.iogonek = 278;\n t.Oacute = 722;\n t.oacute = 500;\n t.amacron = 500;\n t.sacute = 389;\n t.idieresis = 278;\n t.Ocircumflex = 722;\n t.Ugrave = 722;\n t.Delta = 612;\n t.thorn = 500;\n t.twosuperior = 300;\n t.Odieresis = 722;\n t.mu = 500;\n t.igrave = 278;\n t.ohungarumlaut = 500;\n t.Eogonek = 611;\n t.dcroat = 500;\n t.threequarters = 750;\n t.Scedilla = 500;\n t.lcaron = 300;\n t.Kcommaaccent = 667;\n t.Lacute = 556;\n t.trademark = 980;\n t.edotaccent = 444;\n t.Igrave = 333;\n t.Imacron = 333;\n t.Lcaron = 611;\n t.onehalf = 750;\n t.lessequal = 549;\n t.ocircumflex = 500;\n t.ntilde = 500;\n t.Uhungarumlaut = 722;\n t.Eacute = 611;\n t.emacron = 444;\n t.gbreve = 500;\n t.onequarter = 750;\n t.Scaron = 500;\n t.Scommaaccent = 500;\n t.Ohungarumlaut = 722;\n t.degree = 400;\n t.ograve = 500;\n t.Ccaron = 667;\n t.ugrave = 500;\n t.radical = 453;\n t.Dcaron = 722;\n t.rcommaaccent = 389;\n t.Ntilde = 667;\n t.otilde = 500;\n t.Rcommaaccent = 611;\n t.Lcommaaccent = 556;\n t.Atilde = 611;\n t.Aogonek = 611;\n t.Aring = 611;\n t.Otilde = 722;\n t.zdotaccent = 389;\n t.Ecaron = 611;\n t.Iogonek = 333;\n t.kcommaaccent = 444;\n t.minus = 675;\n t.Icircumflex = 333;\n t.ncaron = 500;\n t.tcommaaccent = 278;\n t.logicalnot = 675;\n t.odieresis = 500;\n t.udieresis = 500;\n t.notequal = 549;\n t.gcommaaccent = 500;\n t.eth = 500;\n t.zcaron = 389;\n t.ncommaaccent = 500;\n t.onesuperior = 300;\n t.imacron = 278;\n t.Euro = 500;\n });\n // eslint-disable-next-line no-shadow\n t.ZapfDingbats = getLookupTableFactory(function (t) {\n t.space = 278;\n t.a1 = 974;\n t.a2 = 961;\n t.a202 = 974;\n t.a3 = 980;\n t.a4 = 719;\n t.a5 = 789;\n t.a119 = 790;\n t.a118 = 791;\n t.a117 = 690;\n t.a11 = 960;\n t.a12 = 939;\n t.a13 = 549;\n t.a14 = 855;\n t.a15 = 911;\n t.a16 = 933;\n t.a105 = 911;\n t.a17 = 945;\n t.a18 = 974;\n t.a19 = 755;\n t.a20 = 846;\n t.a21 = 762;\n t.a22 = 761;\n t.a23 = 571;\n t.a24 = 677;\n t.a25 = 763;\n t.a26 = 760;\n t.a27 = 759;\n t.a28 = 754;\n t.a6 = 494;\n t.a7 = 552;\n t.a8 = 537;\n t.a9 = 577;\n t.a10 = 692;\n t.a29 = 786;\n t.a30 = 788;\n t.a31 = 788;\n t.a32 = 790;\n t.a33 = 793;\n t.a34 = 794;\n t.a35 = 816;\n t.a36 = 823;\n t.a37 = 789;\n t.a38 = 841;\n t.a39 = 823;\n t.a40 = 833;\n t.a41 = 816;\n t.a42 = 831;\n t.a43 = 923;\n t.a44 = 744;\n t.a45 = 723;\n t.a46 = 749;\n t.a47 = 790;\n t.a48 = 792;\n t.a49 = 695;\n t.a50 = 776;\n t.a51 = 768;\n t.a52 = 792;\n t.a53 = 759;\n t.a54 = 707;\n t.a55 = 708;\n t.a56 = 682;\n t.a57 = 701;\n t.a58 = 826;\n t.a59 = 815;\n t.a60 = 789;\n t.a61 = 789;\n t.a62 = 707;\n t.a63 = 687;\n t.a64 = 696;\n t.a65 = 689;\n t.a66 = 786;\n t.a67 = 787;\n t.a68 = 713;\n t.a69 = 791;\n t.a70 = 785;\n t.a71 = 791;\n t.a72 = 873;\n t.a73 = 761;\n t.a74 = 762;\n t.a203 = 762;\n t.a75 = 759;\n t.a204 = 759;\n t.a76 = 892;\n t.a77 = 892;\n t.a78 = 788;\n t.a79 = 784;\n t.a81 = 438;\n t.a82 = 138;\n t.a83 = 277;\n t.a84 = 415;\n t.a97 = 392;\n t.a98 = 392;\n t.a99 = 668;\n t.a100 = 668;\n t.a89 = 390;\n t.a90 = 390;\n t.a93 = 317;\n t.a94 = 317;\n t.a91 = 276;\n t.a92 = 276;\n t.a205 = 509;\n t.a85 = 509;\n t.a206 = 410;\n t.a86 = 410;\n t.a87 = 234;\n t.a88 = 234;\n t.a95 = 334;\n t.a96 = 334;\n t.a101 = 732;\n t.a102 = 544;\n t.a103 = 544;\n t.a104 = 910;\n t.a106 = 667;\n t.a107 = 760;\n t.a108 = 760;\n t.a112 = 776;\n t.a111 = 595;\n t.a110 = 694;\n t.a109 = 626;\n t.a120 = 788;\n t.a121 = 788;\n t.a122 = 788;\n t.a123 = 788;\n t.a124 = 788;\n t.a125 = 788;\n t.a126 = 788;\n t.a127 = 788;\n t.a128 = 788;\n t.a129 = 788;\n t.a130 = 788;\n t.a131 = 788;\n t.a132 = 788;\n t.a133 = 788;\n t.a134 = 788;\n t.a135 = 788;\n t.a136 = 788;\n t.a137 = 788;\n t.a138 = 788;\n t.a139 = 788;\n t.a140 = 788;\n t.a141 = 788;\n t.a142 = 788;\n t.a143 = 788;\n t.a144 = 788;\n t.a145 = 788;\n t.a146 = 788;\n t.a147 = 788;\n t.a148 = 788;\n t.a149 = 788;\n t.a150 = 788;\n t.a151 = 788;\n t.a152 = 788;\n t.a153 = 788;\n t.a154 = 788;\n t.a155 = 788;\n t.a156 = 788;\n t.a157 = 788;\n t.a158 = 788;\n t.a159 = 788;\n t.a160 = 894;\n t.a161 = 838;\n t.a163 = 1016;\n t.a164 = 458;\n t.a196 = 748;\n t.a165 = 924;\n t.a192 = 748;\n t.a166 = 918;\n t.a167 = 927;\n t.a168 = 928;\n t.a169 = 928;\n t.a170 = 834;\n t.a171 = 873;\n t.a172 = 828;\n t.a173 = 924;\n t.a162 = 924;\n t.a174 = 917;\n t.a175 = 930;\n t.a176 = 931;\n t.a177 = 463;\n t.a178 = 883;\n t.a179 = 836;\n t.a193 = 836;\n t.a180 = 867;\n t.a199 = 867;\n t.a181 = 696;\n t.a200 = 696;\n t.a182 = 874;\n t.a201 = 874;\n t.a183 = 760;\n t.a184 = 946;\n t.a197 = 771;\n t.a185 = 865;\n t.a194 = 771;\n t.a198 = 888;\n t.a186 = 967;\n t.a195 = 888;\n t.a187 = 831;\n t.a188 = 873;\n t.a189 = 927;\n t.a190 = 970;\n t.a191 = 918;\n });\n});\n\nconst getFontBasicMetrics = getLookupTableFactory(function (t) {\n t.Courier = {\n ascent: 629,\n descent: -157,\n capHeight: 562,\n xHeight: -426,\n };\n t[\"Courier-Bold\"] = {\n ascent: 629,\n descent: -157,\n capHeight: 562,\n xHeight: 439,\n };\n t[\"Courier-Oblique\"] = {\n ascent: 629,\n descent: -157,\n capHeight: 562,\n xHeight: 426,\n };\n t[\"Courier-BoldOblique\"] = {\n ascent: 629,\n descent: -157,\n capHeight: 562,\n xHeight: 426,\n };\n t.Helvetica = {\n ascent: 718,\n descent: -207,\n capHeight: 718,\n xHeight: 523,\n };\n t[\"Helvetica-Bold\"] = {\n ascent: 718,\n descent: -207,\n capHeight: 718,\n xHeight: 532,\n };\n t[\"Helvetica-Oblique\"] = {\n ascent: 718,\n descent: -207,\n capHeight: 718,\n xHeight: 523,\n };\n t[\"Helvetica-BoldOblique\"] = {\n ascent: 718,\n descent: -207,\n capHeight: 718,\n xHeight: 532,\n };\n t[\"Times-Roman\"] = {\n ascent: 683,\n descent: -217,\n capHeight: 662,\n xHeight: 450,\n };\n t[\"Times-Bold\"] = {\n ascent: 683,\n descent: -217,\n capHeight: 676,\n xHeight: 461,\n };\n t[\"Times-Italic\"] = {\n ascent: 683,\n descent: -217,\n capHeight: 653,\n xHeight: 441,\n };\n t[\"Times-BoldItalic\"] = {\n ascent: 683,\n descent: -217,\n capHeight: 669,\n xHeight: 462,\n };\n t.Symbol = {\n ascent: Math.NaN,\n descent: Math.NaN,\n capHeight: Math.NaN,\n xHeight: Math.NaN,\n };\n t.ZapfDingbats = {\n ascent: Math.NaN,\n descent: Math.NaN,\n capHeight: Math.NaN,\n xHeight: Math.NaN,\n };\n});\n\nexport { getFontBasicMetrics, getMetrics };\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\nconst ON_CURVE_POINT = 1 << 0;\nconst X_SHORT_VECTOR = 1 << 1;\nconst Y_SHORT_VECTOR = 1 << 2;\nconst REPEAT_FLAG = 1 << 3;\nconst X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR = 1 << 4;\nconst Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR = 1 << 5;\nconst OVERLAP_SIMPLE = 1 << 6;\n\nconst ARG_1_AND_2_ARE_WORDS = 1 << 0;\nconst ARGS_ARE_XY_VALUES = 1 << 1;\n// const ROUND_XY_TO_GRID = 1 << 2;\nconst WE_HAVE_A_SCALE = 1 << 3;\nconst MORE_COMPONENTS = 1 << 5;\nconst WE_HAVE_AN_X_AND_Y_SCALE = 1 << 6;\nconst WE_HAVE_A_TWO_BY_TWO = 1 << 7;\nconst WE_HAVE_INSTRUCTIONS = 1 << 8;\n// const USE_MY_METRICS = 1 << 9;\n// const OVERLAP_COMPOUND = 1 << 10;\n// const SCALED_COMPONENT_OFFSET = 1 << 11;\n// const UNSCALED_COMPONENT_OFFSET = 1 << 12;\n\n/**\n * GlyfTable object represents a glyf table containing glyph information:\n * - glyph header (xMin, yMin, xMax, yMax);\n * - contours if any;\n * - components if the glyph is a composite.\n *\n * It's possible to re-scale each glyph in order to have a new font which\n * exactly fits an other one: the goal is to be able to build some substitution\n * font for well-known fonts (Myriad, Arial, ...).\n *\n * A full description of glyf table can be found here\n * https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6glyf.html\n */\nclass GlyfTable {\n constructor({ glyfTable, isGlyphLocationsLong, locaTable, numGlyphs }) {\n this.glyphs = [];\n const loca = new DataView(\n locaTable.buffer,\n locaTable.byteOffset,\n locaTable.byteLength\n );\n const glyf = new DataView(\n glyfTable.buffer,\n glyfTable.byteOffset,\n glyfTable.byteLength\n );\n const offsetSize = isGlyphLocationsLong ? 4 : 2;\n let prev = isGlyphLocationsLong ? loca.getUint32(0) : 2 * loca.getUint16(0);\n let pos = 0;\n for (let i = 0; i < numGlyphs; i++) {\n pos += offsetSize;\n const next = isGlyphLocationsLong\n ? loca.getUint32(pos)\n : 2 * loca.getUint16(pos);\n if (next === prev) {\n this.glyphs.push(new Glyph({}));\n continue;\n }\n\n const glyph = Glyph.parse(prev, glyf);\n this.glyphs.push(glyph);\n\n prev = next;\n }\n }\n\n getSize() {\n return this.glyphs.reduce((a, g) => {\n const size = g.getSize();\n // Round to next multiple of 4 if needed.\n return a + ((size + 3) & ~3);\n }, 0);\n }\n\n write() {\n const totalSize = this.getSize();\n const glyfTable = new DataView(new ArrayBuffer(totalSize));\n const isLocationLong = totalSize > /* 0xffff * 2 */ 0x1fffe;\n const offsetSize = isLocationLong ? 4 : 2;\n const locaTable = new DataView(\n new ArrayBuffer((this.glyphs.length + 1) * offsetSize)\n );\n\n if (isLocationLong) {\n locaTable.setUint32(0, 0);\n } else {\n locaTable.setUint16(0, 0);\n }\n\n let pos = 0;\n let locaIndex = 0;\n for (const glyph of this.glyphs) {\n pos += glyph.write(pos, glyfTable);\n // Round to next multiple of 4 if needed.\n pos = (pos + 3) & ~3;\n\n locaIndex += offsetSize;\n if (isLocationLong) {\n locaTable.setUint32(locaIndex, pos);\n } else {\n locaTable.setUint16(locaIndex, pos >> 1);\n }\n }\n\n return {\n isLocationLong,\n loca: new Uint8Array(locaTable.buffer),\n glyf: new Uint8Array(glyfTable.buffer),\n };\n }\n\n scale(factors) {\n for (let i = 0, ii = this.glyphs.length; i < ii; i++) {\n this.glyphs[i].scale(factors[i]);\n }\n }\n}\n\nclass Glyph {\n constructor({ header = null, simple = null, composites = null }) {\n this.header = header;\n this.simple = simple;\n this.composites = composites;\n }\n\n static parse(pos, glyf) {\n const [read, header] = GlyphHeader.parse(pos, glyf);\n pos += read;\n\n if (header.numberOfContours < 0) {\n // Composite glyph.\n const composites = [];\n while (true) {\n const [n, composite] = CompositeGlyph.parse(pos, glyf);\n pos += n;\n composites.push(composite);\n if (!(composite.flags & MORE_COMPONENTS)) {\n break;\n }\n }\n\n return new Glyph({ header, composites });\n }\n\n const simple = SimpleGlyph.parse(pos, glyf, header.numberOfContours);\n\n return new Glyph({ header, simple });\n }\n\n getSize() {\n if (!this.header) {\n return 0;\n }\n const size = this.simple\n ? this.simple.getSize()\n : this.composites.reduce((a, c) => a + c.getSize(), 0);\n return this.header.getSize() + size;\n }\n\n write(pos, buf) {\n if (!this.header) {\n return 0;\n }\n\n const spos = pos;\n pos += this.header.write(pos, buf);\n if (this.simple) {\n pos += this.simple.write(pos, buf);\n } else {\n for (const composite of this.composites) {\n pos += composite.write(pos, buf);\n }\n }\n\n return pos - spos;\n }\n\n scale(factor) {\n if (!this.header) {\n return;\n }\n\n const xMiddle = (this.header.xMin + this.header.xMax) / 2;\n this.header.scale(xMiddle, factor);\n if (this.simple) {\n this.simple.scale(xMiddle, factor);\n } else {\n for (const composite of this.composites) {\n composite.scale(xMiddle, factor);\n }\n }\n }\n}\n\nclass GlyphHeader {\n constructor({ numberOfContours, xMin, yMin, xMax, yMax }) {\n this.numberOfContours = numberOfContours;\n this.xMin = xMin;\n this.yMin = yMin;\n this.xMax = xMax;\n this.yMax = yMax;\n }\n\n static parse(pos, glyf) {\n return [\n 10,\n new GlyphHeader({\n numberOfContours: glyf.getInt16(pos),\n xMin: glyf.getInt16(pos + 2),\n yMin: glyf.getInt16(pos + 4),\n xMax: glyf.getInt16(pos + 6),\n yMax: glyf.getInt16(pos + 8),\n }),\n ];\n }\n\n getSize() {\n return 10;\n }\n\n write(pos, buf) {\n buf.setInt16(pos, this.numberOfContours);\n buf.setInt16(pos + 2, this.xMin);\n buf.setInt16(pos + 4, this.yMin);\n buf.setInt16(pos + 6, this.xMax);\n buf.setInt16(pos + 8, this.yMax);\n\n return 10;\n }\n\n scale(x, factor) {\n this.xMin = Math.round(x + (this.xMin - x) * factor);\n this.xMax = Math.round(x + (this.xMax - x) * factor);\n }\n}\n\nclass Contour {\n constructor({ flags, xCoordinates, yCoordinates }) {\n this.xCoordinates = xCoordinates;\n this.yCoordinates = yCoordinates;\n this.flags = flags;\n }\n}\n\nclass SimpleGlyph {\n constructor({ contours, instructions }) {\n this.contours = contours;\n this.instructions = instructions;\n }\n\n static parse(pos, glyf, numberOfContours) {\n const endPtsOfContours = [];\n for (let i = 0; i < numberOfContours; i++) {\n const endPt = glyf.getUint16(pos);\n pos += 2;\n endPtsOfContours.push(endPt);\n }\n const numberOfPt = endPtsOfContours[numberOfContours - 1] + 1;\n const instructionLength = glyf.getUint16(pos);\n pos += 2;\n const instructions = new Uint8Array(glyf).slice(\n pos,\n pos + instructionLength\n );\n pos += instructionLength;\n\n const flags = [];\n for (let i = 0; i < numberOfPt; pos++, i++) {\n let flag = glyf.getUint8(pos);\n flags.push(flag);\n if (flag & REPEAT_FLAG) {\n const count = glyf.getUint8(++pos);\n flag ^= REPEAT_FLAG;\n for (let m = 0; m < count; m++) {\n flags.push(flag);\n }\n i += count;\n }\n }\n\n const allXCoordinates = [];\n let xCoordinates = [];\n let yCoordinates = [];\n let pointFlags = [];\n const contours = [];\n let endPtsOfContoursIndex = 0;\n let lastCoordinate = 0;\n\n // Get x coordinates.\n for (let i = 0; i < numberOfPt; i++) {\n const flag = flags[i];\n if (flag & X_SHORT_VECTOR) {\n // 8-bits unsigned value.\n const x = glyf.getUint8(pos++);\n lastCoordinate += flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR ? x : -x;\n xCoordinates.push(lastCoordinate);\n } else if (flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR) {\n // IS_SAME.\n xCoordinates.push(lastCoordinate);\n } else {\n lastCoordinate += glyf.getInt16(pos);\n pos += 2;\n xCoordinates.push(lastCoordinate);\n }\n\n if (endPtsOfContours[endPtsOfContoursIndex] === i) {\n // Next entry is the first one of a new contour.\n endPtsOfContoursIndex++;\n allXCoordinates.push(xCoordinates);\n xCoordinates = [];\n }\n }\n\n lastCoordinate = 0;\n endPtsOfContoursIndex = 0;\n for (let i = 0; i < numberOfPt; i++) {\n const flag = flags[i];\n if (flag & Y_SHORT_VECTOR) {\n // 8-bits unsigned value.\n const y = glyf.getUint8(pos++);\n lastCoordinate += flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR ? y : -y;\n yCoordinates.push(lastCoordinate);\n } else if (flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR) {\n // IS_SAME.\n yCoordinates.push(lastCoordinate);\n } else {\n lastCoordinate += glyf.getInt16(pos);\n pos += 2;\n yCoordinates.push(lastCoordinate);\n }\n\n pointFlags.push((flag & ON_CURVE_POINT) | (flag & OVERLAP_SIMPLE));\n\n if (endPtsOfContours[endPtsOfContoursIndex] === i) {\n // Next entry is the first one of a new contour.\n xCoordinates = allXCoordinates[endPtsOfContoursIndex];\n endPtsOfContoursIndex++;\n contours.push(\n new Contour({\n flags: pointFlags,\n xCoordinates,\n yCoordinates,\n })\n );\n yCoordinates = [];\n pointFlags = [];\n }\n }\n\n return new SimpleGlyph({\n contours,\n instructions,\n });\n }\n\n getSize() {\n let size = this.contours.length * 2 + 2 + this.instructions.length;\n let lastX = 0;\n let lastY = 0;\n for (const contour of this.contours) {\n size += contour.flags.length;\n for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) {\n const x = contour.xCoordinates[i];\n const y = contour.yCoordinates[i];\n let abs = Math.abs(x - lastX);\n if (abs > 255) {\n size += 2;\n } else if (abs > 0) {\n size += 1;\n }\n lastX = x;\n\n abs = Math.abs(y - lastY);\n if (abs > 255) {\n size += 2;\n } else if (abs > 0) {\n size += 1;\n }\n lastY = y;\n }\n }\n return size;\n }\n\n write(pos, buf) {\n const spos = pos;\n const xCoordinates = [];\n const yCoordinates = [];\n const flags = [];\n let lastX = 0;\n let lastY = 0;\n\n for (const contour of this.contours) {\n for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) {\n let flag = contour.flags[i];\n const x = contour.xCoordinates[i];\n let delta = x - lastX;\n if (delta === 0) {\n flag |= X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR;\n xCoordinates.push(0);\n } else {\n const abs = Math.abs(delta);\n if (abs <= 255) {\n flag |=\n delta >= 0\n ? X_SHORT_VECTOR | X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR\n : X_SHORT_VECTOR;\n xCoordinates.push(abs);\n } else {\n xCoordinates.push(delta);\n }\n }\n lastX = x;\n\n const y = contour.yCoordinates[i];\n delta = y - lastY;\n if (delta === 0) {\n flag |= Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR;\n yCoordinates.push(0);\n } else {\n const abs = Math.abs(delta);\n if (abs <= 255) {\n flag |=\n delta >= 0\n ? Y_SHORT_VECTOR | Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR\n : Y_SHORT_VECTOR;\n yCoordinates.push(abs);\n } else {\n yCoordinates.push(delta);\n }\n }\n lastY = y;\n\n flags.push(flag);\n }\n\n // Write endPtsOfContours entry.\n buf.setUint16(pos, xCoordinates.length - 1);\n pos += 2;\n }\n\n // Write instructionLength.\n buf.setUint16(pos, this.instructions.length);\n pos += 2;\n if (this.instructions.length) {\n // Write instructions.\n new Uint8Array(buf.buffer, 0, buf.buffer.byteLength).set(\n this.instructions,\n pos\n );\n pos += this.instructions.length;\n }\n\n // Write flags.\n for (const flag of flags) {\n buf.setUint8(pos++, flag);\n }\n\n // Write xCoordinates.\n for (let i = 0, ii = xCoordinates.length; i < ii; i++) {\n const x = xCoordinates[i];\n const flag = flags[i];\n if (flag & X_SHORT_VECTOR) {\n buf.setUint8(pos++, x);\n } else if (!(flag & X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR)) {\n buf.setInt16(pos, x);\n pos += 2;\n }\n }\n\n // Write yCoordinates.\n for (let i = 0, ii = yCoordinates.length; i < ii; i++) {\n const y = yCoordinates[i];\n const flag = flags[i];\n if (flag & Y_SHORT_VECTOR) {\n buf.setUint8(pos++, y);\n } else if (!(flag & Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR)) {\n buf.setInt16(pos, y);\n pos += 2;\n }\n }\n\n return pos - spos;\n }\n\n scale(x, factor) {\n for (const contour of this.contours) {\n if (contour.xCoordinates.length === 0) {\n continue;\n }\n\n for (let i = 0, ii = contour.xCoordinates.length; i < ii; i++) {\n contour.xCoordinates[i] = Math.round(\n x + (contour.xCoordinates[i] - x) * factor\n );\n }\n }\n }\n}\n\nclass CompositeGlyph {\n constructor({\n flags,\n glyphIndex,\n argument1,\n argument2,\n transf,\n instructions,\n }) {\n this.flags = flags;\n this.glyphIndex = glyphIndex;\n this.argument1 = argument1;\n this.argument2 = argument2;\n this.transf = transf;\n this.instructions = instructions;\n }\n\n static parse(pos, glyf) {\n const spos = pos;\n const transf = [];\n let flags = glyf.getUint16(pos);\n const glyphIndex = glyf.getUint16(pos + 2);\n pos += 4;\n\n let argument1, argument2;\n if (flags & ARG_1_AND_2_ARE_WORDS) {\n if (flags & ARGS_ARE_XY_VALUES) {\n argument1 = glyf.getInt16(pos);\n argument2 = glyf.getInt16(pos + 2);\n } else {\n argument1 = glyf.getUint16(pos);\n argument2 = glyf.getUint16(pos + 2);\n }\n pos += 4;\n flags ^= ARG_1_AND_2_ARE_WORDS;\n } else {\n if (flags & ARGS_ARE_XY_VALUES) {\n argument1 = glyf.getInt8(pos);\n argument2 = glyf.getInt8(pos + 1);\n } else {\n argument1 = glyf.getUint8(pos);\n argument2 = glyf.getUint8(pos + 1);\n }\n pos += 2;\n }\n\n if (flags & WE_HAVE_A_SCALE) {\n // Single F2.14.\n transf.push(glyf.getUint16(pos));\n pos += 2;\n } else if (flags & WE_HAVE_AN_X_AND_Y_SCALE) {\n // Two F2.14.\n transf.push(glyf.getUint16(pos), glyf.getUint16(pos + 2));\n pos += 4;\n } else if (flags & WE_HAVE_A_TWO_BY_TWO) {\n // Four F2.14.\n transf.push(\n glyf.getUint16(pos),\n glyf.getUint16(pos + 2),\n glyf.getUint16(pos + 4),\n glyf.getUint16(pos + 6)\n );\n pos += 8;\n }\n\n let instructions = null;\n if (flags & WE_HAVE_INSTRUCTIONS) {\n const instructionLength = glyf.getUint16(pos);\n pos += 2;\n instructions = new Uint8Array(glyf).slice(pos, pos + instructionLength);\n pos += instructionLength;\n }\n\n return [\n pos - spos,\n new CompositeGlyph({\n flags,\n glyphIndex,\n argument1,\n argument2,\n transf,\n instructions,\n }),\n ];\n }\n\n getSize() {\n let size = 2 + 2 + this.transf.length * 2;\n if (this.flags & WE_HAVE_INSTRUCTIONS) {\n size += 2 + this.instructions.length;\n }\n\n size += 2;\n if (this.flags & 2) {\n // Arguments are signed.\n if (\n !(\n this.argument1 >= -128 &&\n this.argument1 <= 127 &&\n this.argument2 >= -128 &&\n this.argument2 <= 127\n )\n ) {\n size += 2;\n }\n } else if (\n !(\n this.argument1 >= 0 &&\n this.argument1 <= 255 &&\n this.argument2 >= 0 &&\n this.argument2 <= 255\n )\n ) {\n size += 2;\n }\n\n return size;\n }\n\n write(pos, buf) {\n const spos = pos;\n\n if (this.flags & ARGS_ARE_XY_VALUES) {\n // Arguments are signed.\n if (\n !(\n this.argument1 >= -128 &&\n this.argument1 <= 127 &&\n this.argument2 >= -128 &&\n this.argument2 <= 127\n )\n ) {\n this.flags |= ARG_1_AND_2_ARE_WORDS;\n }\n } else if (\n !(\n this.argument1 >= 0 &&\n this.argument1 <= 255 &&\n this.argument2 >= 0 &&\n this.argument2 <= 255\n )\n ) {\n this.flags |= ARG_1_AND_2_ARE_WORDS;\n }\n\n buf.setUint16(pos, this.flags);\n buf.setUint16(pos + 2, this.glyphIndex);\n pos += 4;\n\n if (this.flags & ARG_1_AND_2_ARE_WORDS) {\n if (this.flags & ARGS_ARE_XY_VALUES) {\n buf.setInt16(pos, this.argument1);\n buf.setInt16(pos + 2, this.argument2);\n } else {\n buf.setUint16(pos, this.argument1);\n buf.setUint16(pos + 2, this.argument2);\n }\n pos += 4;\n } else {\n buf.setUint8(pos, this.argument1);\n buf.setUint8(pos + 1, this.argument2);\n pos += 2;\n }\n\n if (this.flags & WE_HAVE_INSTRUCTIONS) {\n buf.setUint16(pos, this.instructions.length);\n pos += 2;\n // Write instructions.\n if (this.instructions.length) {\n new Uint8Array(buf.buffer, 0, buf.buffer.byteLength).set(\n this.instructions,\n pos\n );\n pos += this.instructions.length;\n }\n }\n\n return pos - spos;\n }\n\n scale(x, factor) {}\n}\n\nexport { GlyfTable };\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 { readUint32 } from \"./core_utils.js\";\nimport { string32 } from \"../shared/util.js\";\n\nfunction writeInt16(dest, offset, num) {\n dest[offset] = (num >> 8) & 0xff;\n dest[offset + 1] = num & 0xff;\n}\n\nfunction writeInt32(dest, offset, num) {\n dest[offset] = (num >> 24) & 0xff;\n dest[offset + 1] = (num >> 16) & 0xff;\n dest[offset + 2] = (num >> 8) & 0xff;\n dest[offset + 3] = num & 0xff;\n}\n\nfunction writeData(dest, offset, data) {\n if (data instanceof Uint8Array) {\n dest.set(data, offset);\n } else if (typeof data === \"string\") {\n for (let i = 0, ii = data.length; i < ii; i++) {\n dest[offset++] = data.charCodeAt(i) & 0xff;\n }\n } else {\n // treating everything else as array\n for (const num of data) {\n dest[offset++] = num & 0xff;\n }\n }\n}\n\nconst OTF_HEADER_SIZE = 12;\nconst OTF_TABLE_ENTRY_SIZE = 16;\n\nclass OpenTypeFileBuilder {\n constructor(sfnt) {\n this.sfnt = sfnt;\n this.tables = Object.create(null);\n }\n\n static getSearchParams(entriesCount, entrySize) {\n let maxPower2 = 1,\n log2 = 0;\n while ((maxPower2 ^ entriesCount) > maxPower2) {\n maxPower2 <<= 1;\n log2++;\n }\n const searchRange = maxPower2 * entrySize;\n return {\n range: searchRange,\n entry: log2,\n rangeShift: entrySize * entriesCount - searchRange,\n };\n }\n\n toArray() {\n let sfnt = this.sfnt;\n\n // Tables needs to be written by ascendant alphabetic order\n const tables = this.tables;\n const tablesNames = Object.keys(tables);\n tablesNames.sort();\n const numTables = tablesNames.length;\n\n let i, j, jj, table, tableName;\n // layout the tables data\n let offset = OTF_HEADER_SIZE + numTables * OTF_TABLE_ENTRY_SIZE;\n const tableOffsets = [offset];\n for (i = 0; i < numTables; i++) {\n table = tables[tablesNames[i]];\n const paddedLength = ((table.length + 3) & ~3) >>> 0;\n offset += paddedLength;\n tableOffsets.push(offset);\n }\n\n const file = new Uint8Array(offset);\n // write the table data first (mostly for checksum)\n for (i = 0; i < numTables; i++) {\n table = tables[tablesNames[i]];\n writeData(file, tableOffsets[i], table);\n }\n\n // sfnt version (4 bytes)\n if (sfnt === \"true\") {\n // Windows hates the Mac TrueType sfnt version number\n sfnt = string32(0x00010000);\n }\n file[0] = sfnt.charCodeAt(0) & 0xff;\n file[1] = sfnt.charCodeAt(1) & 0xff;\n file[2] = sfnt.charCodeAt(2) & 0xff;\n file[3] = sfnt.charCodeAt(3) & 0xff;\n\n // numTables (2 bytes)\n writeInt16(file, 4, numTables);\n\n const searchParams = OpenTypeFileBuilder.getSearchParams(numTables, 16);\n\n // searchRange (2 bytes)\n writeInt16(file, 6, searchParams.range);\n // entrySelector (2 bytes)\n writeInt16(file, 8, searchParams.entry);\n // rangeShift (2 bytes)\n writeInt16(file, 10, searchParams.rangeShift);\n\n offset = OTF_HEADER_SIZE;\n // writing table entries\n for (i = 0; i < numTables; i++) {\n tableName = tablesNames[i];\n file[offset] = tableName.charCodeAt(0) & 0xff;\n file[offset + 1] = tableName.charCodeAt(1) & 0xff;\n file[offset + 2] = tableName.charCodeAt(2) & 0xff;\n file[offset + 3] = tableName.charCodeAt(3) & 0xff;\n\n // checksum\n let checksum = 0;\n for (j = tableOffsets[i], jj = tableOffsets[i + 1]; j < jj; j += 4) {\n const quad = readUint32(file, j);\n checksum = (checksum + quad) >>> 0;\n }\n writeInt32(file, offset + 4, checksum);\n\n // offset\n writeInt32(file, offset + 8, tableOffsets[i]);\n // length\n writeInt32(file, offset + 12, tables[tableName].length);\n\n offset += OTF_TABLE_ENTRY_SIZE;\n }\n return file;\n }\n\n addTable(tag, data) {\n if (tag in this.tables) {\n throw new Error(\"Table \" + tag + \" already exists\");\n }\n this.tables[tag] = data;\n }\n}\n\nexport { OpenTypeFileBuilder };\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 { getEncoding } from \"./encodings.js\";\nimport { isWhiteSpace } from \"./core_utils.js\";\nimport { Stream } from \"./stream.js\";\nimport { warn } from \"../shared/util.js\";\n\n// Hinting is currently disabled due to unknown problems on windows\n// in tracemonkey and various other pdfs with type1 fonts.\nconst HINTING_ENABLED = false;\n\nconst COMMAND_MAP = {\n hstem: [1],\n vstem: [3],\n vmoveto: [4],\n rlineto: [5],\n hlineto: [6],\n vlineto: [7],\n rrcurveto: [8],\n callsubr: [10],\n flex: [12, 35],\n drop: [12, 18],\n endchar: [14],\n rmoveto: [21],\n hmoveto: [22],\n vhcurveto: [30],\n hvcurveto: [31],\n};\n\n/**\n * CharStrings are encoded following the the CharString Encoding sequence\n * describe in Chapter 6 of the \"Adobe Type1 Font Format\" specification.\n * The value in a byte indicates a command, a number, or subsequent bytes\n * that are to be interpreted in a special way.\n *\n * CharString Number Encoding:\n * A CharString byte containing the values from 32 through 255 inclusive\n * indicate an integer. These values are decoded in four ranges.\n *\n * 1. A CharString byte containing a value, v, between 32 and 246 inclusive,\n * indicate the integer v - 139. Thus, the integer values from -107 through\n * 107 inclusive may be encoded in single byte.\n *\n * 2. A CharString byte containing a value, v, between 247 and 250 inclusive,\n * indicates an integer involving the next byte, w, according to the formula:\n * [(v - 247) x 256] + w + 108\n *\n * 3. A CharString byte containing a value, v, between 251 and 254 inclusive,\n * indicates an integer involving the next byte, w, according to the formula:\n * -[(v - 251) * 256] - w - 108\n *\n * 4. A CharString containing the value 255 indicates that the next 4 bytes\n * are a two complement signed integer. The first of these bytes contains the\n * highest order bits, the second byte contains the next higher order bits\n * and the fourth byte contain the lowest order bits.\n *\n *\n * CharString Command Encoding:\n * CharStrings commands are encoded in 1 or 2 bytes.\n *\n * Single byte commands are encoded in 1 byte that contains a value between\n * 0 and 31 inclusive.\n * If a command byte contains the value 12, then the value in the next byte\n * indicates a command. This \"escape\" mechanism allows many extra commands\n * to be encoded and this encoding technique helps to minimize the length of\n * the charStrings.\n */\nclass Type1CharString {\n constructor() {\n this.width = 0;\n this.lsb = 0;\n this.flexing = false;\n this.output = [];\n this.stack = [];\n }\n\n convert(encoded, subrs, seacAnalysisEnabled) {\n const count = encoded.length;\n let error = false;\n let wx, sbx, subrNumber;\n for (let i = 0; i < count; i++) {\n let value = encoded[i];\n if (value < 32) {\n if (value === 12) {\n value = (value << 8) + encoded[++i];\n }\n switch (value) {\n case 1: // hstem\n if (!HINTING_ENABLED) {\n this.stack = [];\n break;\n }\n error = this.executeCommand(2, COMMAND_MAP.hstem);\n break;\n case 3: // vstem\n if (!HINTING_ENABLED) {\n this.stack = [];\n break;\n }\n error = this.executeCommand(2, COMMAND_MAP.vstem);\n break;\n case 4: // vmoveto\n if (this.flexing) {\n if (this.stack.length < 1) {\n error = true;\n break;\n }\n // Add the dx for flex and but also swap the values so they are\n // the right order.\n const dy = this.stack.pop();\n this.stack.push(0, dy);\n break;\n }\n error = this.executeCommand(1, COMMAND_MAP.vmoveto);\n break;\n case 5: // rlineto\n error = this.executeCommand(2, COMMAND_MAP.rlineto);\n break;\n case 6: // hlineto\n error = this.executeCommand(1, COMMAND_MAP.hlineto);\n break;\n case 7: // vlineto\n error = this.executeCommand(1, COMMAND_MAP.vlineto);\n break;\n case 8: // rrcurveto\n error = this.executeCommand(6, COMMAND_MAP.rrcurveto);\n break;\n case 9: // closepath\n // closepath is a Type1 command that does not take argument and is\n // useless in Type2 and it can simply be ignored.\n this.stack = [];\n break;\n case 10: // callsubr\n if (this.stack.length < 1) {\n error = true;\n break;\n }\n subrNumber = this.stack.pop();\n if (!subrs[subrNumber]) {\n error = true;\n break;\n }\n error = this.convert(subrs[subrNumber], subrs, seacAnalysisEnabled);\n break;\n case 11: // return\n return error;\n case 13: // hsbw\n if (this.stack.length < 2) {\n error = true;\n break;\n }\n // To convert to type2 we have to move the width value to the\n // first part of the charstring and then use hmoveto with lsb.\n wx = this.stack.pop();\n sbx = this.stack.pop();\n this.lsb = sbx;\n this.width = wx;\n this.stack.push(wx, sbx);\n error = this.executeCommand(2, COMMAND_MAP.hmoveto);\n break;\n case 14: // endchar\n this.output.push(COMMAND_MAP.endchar[0]);\n break;\n case 21: // rmoveto\n if (this.flexing) {\n break;\n }\n error = this.executeCommand(2, COMMAND_MAP.rmoveto);\n break;\n case 22: // hmoveto\n if (this.flexing) {\n // Add the dy for flex.\n this.stack.push(0);\n break;\n }\n error = this.executeCommand(1, COMMAND_MAP.hmoveto);\n break;\n case 30: // vhcurveto\n error = this.executeCommand(4, COMMAND_MAP.vhcurveto);\n break;\n case 31: // hvcurveto\n error = this.executeCommand(4, COMMAND_MAP.hvcurveto);\n break;\n case (12 << 8) + 0: // dotsection\n // dotsection is a Type1 command to specify some hinting feature\n // for dots that do not take a parameter and it can safely be\n // ignored for Type2.\n this.stack = [];\n break;\n case (12 << 8) + 1: // vstem3\n if (!HINTING_ENABLED) {\n this.stack = [];\n break;\n }\n // [vh]stem3 are Type1 only and Type2 supports [vh]stem with\n // multiple parameters, so instead of returning [vh]stem3 take a\n // shortcut and return [vhstem] instead.\n error = this.executeCommand(2, COMMAND_MAP.vstem);\n break;\n case (12 << 8) + 2: // hstem3\n if (!HINTING_ENABLED) {\n this.stack = [];\n break;\n }\n // See vstem3.\n error = this.executeCommand(2, COMMAND_MAP.hstem);\n break;\n case (12 << 8) + 6: // seac\n // seac is like type 2's special endchar but it doesn't use the\n // first argument asb, so remove it.\n if (seacAnalysisEnabled) {\n const asb = this.stack.at(-5);\n this.seac = this.stack.splice(-4, 4);\n this.seac[0] += this.lsb - asb;\n error = this.executeCommand(0, COMMAND_MAP.endchar);\n } else {\n error = this.executeCommand(4, COMMAND_MAP.endchar);\n }\n break;\n case (12 << 8) + 7: // sbw\n if (this.stack.length < 4) {\n error = true;\n break;\n }\n // To convert to type2 we have to move the width value to the\n // first part of the charstring and then use rmoveto with\n // (dx, dy). The height argument will not be used for vmtx and\n // vhea tables reconstruction -- ignoring it.\n this.stack.pop(); // wy\n wx = this.stack.pop();\n const sby = this.stack.pop();\n sbx = this.stack.pop();\n this.lsb = sbx;\n this.width = wx;\n this.stack.push(wx, sbx, sby);\n error = this.executeCommand(3, COMMAND_MAP.rmoveto);\n break;\n case (12 << 8) + 12: // div\n if (this.stack.length < 2) {\n error = true;\n break;\n }\n const num2 = this.stack.pop();\n const num1 = this.stack.pop();\n this.stack.push(num1 / num2);\n break;\n case (12 << 8) + 16: // callothersubr\n if (this.stack.length < 2) {\n error = true;\n break;\n }\n subrNumber = this.stack.pop();\n const numArgs = this.stack.pop();\n if (subrNumber === 0 && numArgs === 3) {\n const flexArgs = this.stack.splice(-17, 17);\n this.stack.push(\n flexArgs[2] + flexArgs[0], // bcp1x + rpx\n flexArgs[3] + flexArgs[1], // bcp1y + rpy\n flexArgs[4], // bcp2x\n flexArgs[5], // bcp2y\n flexArgs[6], // p2x\n flexArgs[7], // p2y\n flexArgs[8], // bcp3x\n flexArgs[9], // bcp3y\n flexArgs[10], // bcp4x\n flexArgs[11], // bcp4y\n flexArgs[12], // p3x\n flexArgs[13], // p3y\n flexArgs[14] // flexDepth\n // 15 = finalx unused by flex\n // 16 = finaly unused by flex\n );\n error = this.executeCommand(13, COMMAND_MAP.flex, true);\n this.flexing = false;\n this.stack.push(flexArgs[15], flexArgs[16]);\n } else if (subrNumber === 1 && numArgs === 0) {\n this.flexing = true;\n }\n break;\n case (12 << 8) + 17: // pop\n // Ignore this since it is only used with othersubr.\n break;\n case (12 << 8) + 33: // setcurrentpoint\n // Ignore for now.\n this.stack = [];\n break;\n default:\n warn('Unknown type 1 charstring command of \"' + value + '\"');\n break;\n }\n if (error) {\n break;\n }\n continue;\n } else if (value <= 246) {\n value -= 139;\n } else if (value <= 250) {\n value = (value - 247) * 256 + encoded[++i] + 108;\n } else if (value <= 254) {\n value = -((value - 251) * 256) - encoded[++i] - 108;\n } else {\n value =\n ((encoded[++i] & 0xff) << 24) |\n ((encoded[++i] & 0xff) << 16) |\n ((encoded[++i] & 0xff) << 8) |\n ((encoded[++i] & 0xff) << 0);\n }\n this.stack.push(value);\n }\n return error;\n }\n\n executeCommand(howManyArgs, command, keepStack) {\n const stackLength = this.stack.length;\n if (howManyArgs > stackLength) {\n return true;\n }\n const start = stackLength - howManyArgs;\n for (let i = start; i < stackLength; i++) {\n let value = this.stack[i];\n if (Number.isInteger(value)) {\n this.output.push(28, (value >> 8) & 0xff, value & 0xff);\n } else {\n // fixed point\n value = (65536 * value) | 0;\n this.output.push(\n 255,\n (value >> 24) & 0xff,\n (value >> 16) & 0xff,\n (value >> 8) & 0xff,\n value & 0xff\n );\n }\n }\n this.output.push(...command);\n if (keepStack) {\n this.stack.splice(start, howManyArgs);\n } else {\n this.stack.length = 0;\n }\n return false;\n }\n}\n\n/**\n * Decrypt a Sequence of Ciphertext Bytes to Produce the Original Sequence\n * of Plaintext Bytes. The function takes a key as a parameter which can be\n * for decrypting the eexec block or for decoding charStrings.\n */\nconst EEXEC_ENCRYPT_KEY = 55665;\nconst CHAR_STRS_ENCRYPT_KEY = 4330;\n\nfunction isHexDigit(code) {\n return (\n (code >= 48 && code <= 57) || // '0'-'9'\n (code >= 65 && code <= 70) || // 'A'-'F'\n (code >= 97 && code <= 102) // 'a'-'f'\n );\n}\n\nfunction decrypt(data, key, discardNumber) {\n if (discardNumber >= data.length) {\n return new Uint8Array(0);\n }\n const c1 = 52845,\n c2 = 22719;\n let r = key | 0,\n i,\n j;\n for (i = 0; i < discardNumber; i++) {\n r = ((data[i] + r) * c1 + c2) & ((1 << 16) - 1);\n }\n const count = data.length - discardNumber;\n const decrypted = new Uint8Array(count);\n for (i = discardNumber, j = 0; j < count; i++, j++) {\n const value = data[i];\n decrypted[j] = value ^ (r >> 8);\n r = ((value + r) * c1 + c2) & ((1 << 16) - 1);\n }\n return decrypted;\n}\n\nfunction decryptAscii(data, key, discardNumber) {\n const c1 = 52845,\n c2 = 22719;\n let r = key | 0;\n const count = data.length,\n maybeLength = count >>> 1;\n const decrypted = new Uint8Array(maybeLength);\n let i, j;\n for (i = 0, j = 0; i < count; i++) {\n const digit1 = data[i];\n if (!isHexDigit(digit1)) {\n continue;\n }\n i++;\n let digit2;\n while (i < count && !isHexDigit((digit2 = data[i]))) {\n i++;\n }\n if (i < count) {\n const value = parseInt(String.fromCharCode(digit1, digit2), 16);\n decrypted[j++] = value ^ (r >> 8);\n r = ((value + r) * c1 + c2) & ((1 << 16) - 1);\n }\n }\n return decrypted.slice(discardNumber, j);\n}\n\nfunction isSpecial(c) {\n return (\n c === /* '/' = */ 0x2f ||\n c === /* '[' = */ 0x5b ||\n c === /* ']' = */ 0x5d ||\n c === /* '{' = */ 0x7b ||\n c === /* '}' = */ 0x7d ||\n c === /* '(' = */ 0x28 ||\n c === /* ')' = */ 0x29\n );\n}\n\n/**\n * Type1Parser encapsulate the needed code for parsing a Type1 font program.\n * Some of its logic depends on the Type2 charstrings structure.\n * NOTE: This doesn't really parse the font since that would require evaluation\n * of PostScript, but it is possible in most cases to extract what we need\n * without a full parse.\n */\nclass Type1Parser {\n constructor(stream, encrypted, seacAnalysisEnabled) {\n if (encrypted) {\n const data = stream.getBytes();\n const isBinary = !(\n (isHexDigit(data[0]) || isWhiteSpace(data[0])) &&\n isHexDigit(data[1]) &&\n isHexDigit(data[2]) &&\n isHexDigit(data[3]) &&\n isHexDigit(data[4]) &&\n isHexDigit(data[5]) &&\n isHexDigit(data[6]) &&\n isHexDigit(data[7])\n );\n stream = new Stream(\n isBinary\n ? decrypt(data, EEXEC_ENCRYPT_KEY, 4)\n : decryptAscii(data, EEXEC_ENCRYPT_KEY, 4)\n );\n }\n this.seacAnalysisEnabled = !!seacAnalysisEnabled;\n\n this.stream = stream;\n this.nextChar();\n }\n\n readNumberArray() {\n this.getToken(); // read '[' or '{' (arrays can start with either)\n const array = [];\n while (true) {\n const token = this.getToken();\n if (token === null || token === \"]\" || token === \"}\") {\n break;\n }\n array.push(parseFloat(token || 0));\n }\n return array;\n }\n\n readNumber() {\n const token = this.getToken();\n return parseFloat(token || 0);\n }\n\n readInt() {\n // Use '| 0' to prevent setting a double into length such as the double\n // does not flow into the loop variable.\n const token = this.getToken();\n return parseInt(token || 0, 10) | 0;\n }\n\n readBoolean() {\n const token = this.getToken();\n // Use 1 and 0 since that's what type2 charstrings use.\n return token === \"true\" ? 1 : 0;\n }\n\n nextChar() {\n return (this.currentChar = this.stream.getByte());\n }\n\n prevChar() {\n this.stream.skip(-2);\n return (this.currentChar = this.stream.getByte());\n }\n\n getToken() {\n // Eat whitespace and comments.\n let comment = false;\n let ch = this.currentChar;\n while (true) {\n if (ch === -1) {\n return null;\n }\n\n if (comment) {\n if (ch === 0x0a || ch === 0x0d) {\n comment = false;\n }\n } else if (ch === /* '%' = */ 0x25) {\n comment = true;\n } else if (!isWhiteSpace(ch)) {\n break;\n }\n ch = this.nextChar();\n }\n if (isSpecial(ch)) {\n this.nextChar();\n return String.fromCharCode(ch);\n }\n let token = \"\";\n do {\n token += String.fromCharCode(ch);\n ch = this.nextChar();\n } while (ch >= 0 && !isWhiteSpace(ch) && !isSpecial(ch));\n return token;\n }\n\n readCharStrings(bytes, lenIV) {\n if (lenIV === -1) {\n // This isn't in the spec, but Adobe's tx program handles -1\n // as plain text.\n return bytes;\n }\n return decrypt(bytes, CHAR_STRS_ENCRYPT_KEY, lenIV);\n }\n\n /*\n * Returns an object containing a Subrs array and a CharStrings\n * array extracted from and eexec encrypted block of data\n */\n extractFontProgram(properties) {\n const stream = this.stream;\n\n const subrs = [],\n charstrings = [];\n const privateData = Object.create(null);\n privateData.lenIV = 4;\n const program = {\n subrs: [],\n charstrings: [],\n properties: {\n privateData,\n },\n };\n let token, length, data, lenIV;\n while ((token = this.getToken()) !== null) {\n if (token !== \"/\") {\n continue;\n }\n token = this.getToken();\n switch (token) {\n case \"CharStrings\":\n // The number immediately following CharStrings must be greater or\n // equal to the number of CharStrings.\n this.getToken();\n this.getToken(); // read in 'dict'\n this.getToken(); // read in 'dup'\n this.getToken(); // read in 'begin'\n while (true) {\n token = this.getToken();\n if (token === null || token === \"end\") {\n break;\n }\n\n if (token !== \"/\") {\n continue;\n }\n const glyph = this.getToken();\n length = this.readInt();\n this.getToken(); // read in 'RD' or '-|'\n data = length > 0 ? stream.getBytes(length) : new Uint8Array(0);\n lenIV = program.properties.privateData.lenIV;\n const encoded = this.readCharStrings(data, lenIV);\n this.nextChar();\n token = this.getToken(); // read in 'ND' or '|-'\n if (token === \"noaccess\") {\n this.getToken(); // read in 'def'\n } else if (token === \"/\") {\n // The expected 'ND' or '|-' token is missing, avoid swallowing\n // the start of the next glyph (fixes issue14462_reduced.pdf).\n this.prevChar();\n }\n charstrings.push({\n glyph,\n encoded,\n });\n }\n break;\n case \"Subrs\":\n this.readInt(); // num\n this.getToken(); // read in 'array'\n while (this.getToken() === \"dup\") {\n const index = this.readInt();\n length = this.readInt();\n this.getToken(); // read in 'RD' or '-|'\n data = length > 0 ? stream.getBytes(length) : new Uint8Array(0);\n lenIV = program.properties.privateData.lenIV;\n const encoded = this.readCharStrings(data, lenIV);\n this.nextChar();\n token = this.getToken(); // read in 'NP' or '|'\n if (token === \"noaccess\") {\n this.getToken(); // read in 'put'\n }\n subrs[index] = encoded;\n }\n break;\n case \"BlueValues\":\n case \"OtherBlues\":\n case \"FamilyBlues\":\n case \"FamilyOtherBlues\":\n const blueArray = this.readNumberArray();\n // *Blue* values may contain invalid data: disables reading of\n // those values when hinting is disabled.\n if (\n blueArray.length > 0 &&\n blueArray.length % 2 === 0 &&\n HINTING_ENABLED\n ) {\n program.properties.privateData[token] = blueArray;\n }\n break;\n case \"StemSnapH\":\n case \"StemSnapV\":\n program.properties.privateData[token] = this.readNumberArray();\n break;\n case \"StdHW\":\n case \"StdVW\":\n program.properties.privateData[token] = this.readNumberArray()[0];\n break;\n case \"BlueShift\":\n case \"lenIV\":\n case \"BlueFuzz\":\n case \"BlueScale\":\n case \"LanguageGroup\":\n program.properties.privateData[token] = this.readNumber();\n break;\n case \"ExpansionFactor\":\n // Firefox doesn't render correctly a font with a null factor on\n // Windows (see issue 15289), hence we just reset it to its default\n // value (0.06).\n program.properties.privateData[token] = this.readNumber() || 0.06;\n break;\n case \"ForceBold\":\n program.properties.privateData[token] = this.readBoolean();\n break;\n }\n }\n\n for (const { encoded, glyph } of charstrings) {\n const charString = new Type1CharString();\n const error = charString.convert(\n encoded,\n subrs,\n this.seacAnalysisEnabled\n );\n let output = charString.output;\n if (error) {\n // It seems when FreeType encounters an error while evaluating a glyph\n // that it completely ignores the glyph so we'll mimic that behaviour\n // here and put an endchar to make the validator happy.\n output = [14];\n }\n const charStringObject = {\n glyphName: glyph,\n charstring: output,\n width: charString.width,\n lsb: charString.lsb,\n seac: charString.seac,\n };\n if (glyph === \".notdef\") {\n // Make sure .notdef is at index zero (issue #11477).\n program.charstrings.unshift(charStringObject);\n } else {\n program.charstrings.push(charStringObject);\n }\n\n // Attempt to replace missing widths, from the font dictionary /Widths\n // entry, with ones from the font data (fixes issue11150_reduced.pdf).\n if (properties.builtInEncoding) {\n const index = properties.builtInEncoding.indexOf(glyph);\n if (\n index > -1 &&\n properties.widths[index] === undefined &&\n index >= properties.firstChar &&\n index <= properties.lastChar\n ) {\n properties.widths[index] = charString.width;\n }\n }\n }\n\n return program;\n }\n\n extractFontHeader(properties) {\n let token;\n while ((token = this.getToken()) !== null) {\n if (token !== \"/\") {\n continue;\n }\n token = this.getToken();\n switch (token) {\n case \"FontMatrix\":\n const matrix = this.readNumberArray();\n properties.fontMatrix = matrix;\n break;\n case \"Encoding\":\n const encodingArg = this.getToken();\n let encoding;\n if (!/^\\d+$/.test(encodingArg)) {\n // encoding name is specified\n encoding = getEncoding(encodingArg);\n } else {\n encoding = [];\n const size = parseInt(encodingArg, 10) | 0;\n this.getToken(); // read in 'array'\n\n for (let j = 0; j < size; j++) {\n token = this.getToken();\n // skipping till first dup or def (e.g. ignoring for statement)\n while (token !== \"dup\" && token !== \"def\") {\n token = this.getToken();\n if (token === null) {\n return; // invalid header\n }\n }\n if (token === \"def\") {\n break; // read all array data\n }\n const index = this.readInt();\n this.getToken(); // read in '/'\n const glyph = this.getToken();\n encoding[index] = glyph;\n this.getToken(); // read the in 'put'\n }\n }\n properties.builtInEncoding = encoding;\n break;\n case \"FontBBox\":\n const fontBBox = this.readNumberArray();\n // adjusting ascent/descent\n properties.ascent = Math.max(fontBBox[3], fontBBox[1]);\n properties.descent = Math.min(fontBBox[1], fontBBox[3]);\n properties.ascentScaled = true;\n break;\n }\n }\n }\n}\n\nexport { Type1Parser };\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 CFF,\n CFFCharset,\n CFFCompiler,\n CFFHeader,\n CFFIndex,\n CFFPrivateDict,\n CFFStandardStrings,\n CFFStrings,\n CFFTopDict,\n} from \"./cff_parser.js\";\nimport { FormatError, warn } from \"../shared/util.js\";\nimport { SEAC_ANALYSIS_ENABLED, type1FontGlyphMapping } from \"./fonts_utils.js\";\nimport { isWhiteSpace } from \"./core_utils.js\";\nimport { Stream } from \"./stream.js\";\nimport { Type1Parser } from \"./type1_parser.js\";\n\nfunction findBlock(streamBytes, signature, startIndex) {\n const streamBytesLength = streamBytes.length;\n const signatureLength = signature.length;\n const scanLength = streamBytesLength - signatureLength;\n\n let i = startIndex,\n found = false;\n while (i < scanLength) {\n let j = 0;\n while (j < signatureLength && streamBytes[i + j] === signature[j]) {\n j++;\n }\n if (j >= signatureLength) {\n // `signature` found, skip over whitespace.\n i += j;\n while (i < streamBytesLength && isWhiteSpace(streamBytes[i])) {\n i++;\n }\n found = true;\n break;\n }\n i++;\n }\n return {\n found,\n length: i,\n };\n}\n\nfunction getHeaderBlock(stream, suggestedLength) {\n const EEXEC_SIGNATURE = [0x65, 0x65, 0x78, 0x65, 0x63];\n\n const streamStartPos = stream.pos; // Save the initial stream position.\n let headerBytes, headerBytesLength, block;\n try {\n headerBytes = stream.getBytes(suggestedLength);\n headerBytesLength = headerBytes.length;\n } catch {\n // Ignore errors if the `suggestedLength` is huge enough that a Uint8Array\n // cannot hold the result of `getBytes`, and fallback to simply checking\n // the entire stream (fixes issue3928.pdf).\n }\n\n if (headerBytesLength === suggestedLength) {\n // Most of the time `suggestedLength` is correct, so to speed things up we\n // initially only check the last few bytes to see if the header was found.\n // Otherwise we (potentially) check the entire stream to prevent errors in\n // `Type1Parser` (fixes issue5686.pdf).\n block = findBlock(\n headerBytes,\n EEXEC_SIGNATURE,\n suggestedLength - 2 * EEXEC_SIGNATURE.length\n );\n\n if (block.found && block.length === suggestedLength) {\n return {\n stream: new Stream(headerBytes),\n length: suggestedLength,\n };\n }\n }\n warn('Invalid \"Length1\" property in Type1 font -- trying to recover.');\n stream.pos = streamStartPos; // Reset the stream position.\n\n const SCAN_BLOCK_LENGTH = 2048;\n let actualLength;\n while (true) {\n const scanBytes = stream.peekBytes(SCAN_BLOCK_LENGTH);\n block = findBlock(scanBytes, EEXEC_SIGNATURE, 0);\n\n if (block.length === 0) {\n break;\n }\n stream.pos += block.length; // Update the stream position.\n\n if (block.found) {\n actualLength = stream.pos - streamStartPos;\n break;\n }\n }\n stream.pos = streamStartPos; // Reset the stream position.\n\n if (actualLength) {\n return {\n stream: new Stream(stream.getBytes(actualLength)),\n length: actualLength,\n };\n }\n warn('Unable to recover \"Length1\" property in Type1 font -- using as is.');\n return {\n stream: new Stream(stream.getBytes(suggestedLength)),\n length: suggestedLength,\n };\n}\n\nfunction getEexecBlock(stream, suggestedLength) {\n // We should ideally parse the eexec block to ensure that `suggestedLength`\n // is correct, so we don't truncate the block data if it's too small.\n // However, this would also require checking if the fixed-content portion\n // exists (using the 'Length3' property), and ensuring that it's valid.\n //\n // Given that `suggestedLength` almost always is correct, all the validation\n // would require a great deal of unnecessary parsing for most fonts.\n // To save time, we always fetch the entire stream instead, which also avoid\n // issues if `suggestedLength` is huge (see comment in `getHeaderBlock`).\n //\n // NOTE: This means that the function can include the fixed-content portion\n // in the returned eexec block. In practice this does *not* seem to matter,\n // since `Type1Parser_extractFontProgram` will skip over any non-commands.\n const eexecBytes = stream.getBytes();\n if (eexecBytes.length === 0) {\n throw new FormatError(\"getEexecBlock - no font program found.\");\n }\n return {\n stream: new Stream(eexecBytes),\n length: eexecBytes.length,\n };\n}\n\n/**\n * Type1Font is also a CIDFontType0.\n */\nclass Type1Font {\n constructor(name, file, properties) {\n // Some bad generators embed pfb file as is, we have to strip 6-byte header.\n // Also, length1 and length2 might be off by 6 bytes as well.\n // http://www.math.ubc.ca/~cass/piscript/type1.pdf\n const PFB_HEADER_SIZE = 6;\n let headerBlockLength = properties.length1;\n let eexecBlockLength = properties.length2;\n let pfbHeader = file.peekBytes(PFB_HEADER_SIZE);\n const pfbHeaderPresent = pfbHeader[0] === 0x80 && pfbHeader[1] === 0x01;\n if (pfbHeaderPresent) {\n file.skip(PFB_HEADER_SIZE);\n headerBlockLength =\n (pfbHeader[5] << 24) |\n (pfbHeader[4] << 16) |\n (pfbHeader[3] << 8) |\n pfbHeader[2];\n }\n\n // Get the data block containing glyphs and subrs information\n const headerBlock = getHeaderBlock(file, headerBlockLength);\n const headerBlockParser = new Type1Parser(\n headerBlock.stream,\n false,\n SEAC_ANALYSIS_ENABLED\n );\n headerBlockParser.extractFontHeader(properties);\n\n if (pfbHeaderPresent) {\n pfbHeader = file.getBytes(PFB_HEADER_SIZE);\n eexecBlockLength =\n (pfbHeader[5] << 24) |\n (pfbHeader[4] << 16) |\n (pfbHeader[3] << 8) |\n pfbHeader[2];\n }\n\n // Decrypt the data blocks and retrieve it's content\n const eexecBlock = getEexecBlock(file, eexecBlockLength);\n const eexecBlockParser = new Type1Parser(\n eexecBlock.stream,\n true,\n SEAC_ANALYSIS_ENABLED\n );\n const data = eexecBlockParser.extractFontProgram(properties);\n for (const key in data.properties) {\n properties[key] = data.properties[key];\n }\n\n const charstrings = data.charstrings;\n const type2Charstrings = this.getType2Charstrings(charstrings);\n const subrs = this.getType2Subrs(data.subrs);\n\n this.charstrings = charstrings;\n this.data = this.wrap(\n name,\n type2Charstrings,\n this.charstrings,\n subrs,\n properties\n );\n this.seacs = this.getSeacs(data.charstrings);\n }\n\n get numGlyphs() {\n return this.charstrings.length + 1;\n }\n\n getCharset() {\n const charset = [\".notdef\"];\n for (const { glyphName } of this.charstrings) {\n charset.push(glyphName);\n }\n return charset;\n }\n\n getGlyphMapping(properties) {\n const charstrings = this.charstrings;\n\n if (properties.composite) {\n const charCodeToGlyphId = Object.create(null);\n // Map CIDs directly to GIDs.\n for (\n let glyphId = 0, charstringsLen = charstrings.length;\n glyphId < charstringsLen;\n glyphId++\n ) {\n const charCode = properties.cMap.charCodeOf(glyphId);\n // Add 1 because glyph 0 is duplicated.\n charCodeToGlyphId[charCode] = glyphId + 1;\n }\n return charCodeToGlyphId;\n }\n\n const glyphNames = [\".notdef\"];\n let builtInEncoding, glyphId;\n for (glyphId = 0; glyphId < charstrings.length; glyphId++) {\n glyphNames.push(charstrings[glyphId].glyphName);\n }\n const encoding = properties.builtInEncoding;\n if (encoding) {\n builtInEncoding = Object.create(null);\n for (const charCode in encoding) {\n glyphId = glyphNames.indexOf(encoding[charCode]);\n if (glyphId >= 0) {\n builtInEncoding[charCode] = glyphId;\n }\n }\n }\n\n return type1FontGlyphMapping(properties, builtInEncoding, glyphNames);\n }\n\n hasGlyphId(id) {\n if (id < 0 || id >= this.numGlyphs) {\n return false;\n }\n if (id === 0) {\n // notdef is always defined.\n return true;\n }\n const glyph = this.charstrings[id - 1];\n return glyph.charstring.length > 0;\n }\n\n getSeacs(charstrings) {\n const seacMap = [];\n for (let i = 0, ii = charstrings.length; i < ii; i++) {\n const charstring = charstrings[i];\n if (charstring.seac) {\n // Offset by 1 for .notdef\n seacMap[i + 1] = charstring.seac;\n }\n }\n return seacMap;\n }\n\n getType2Charstrings(type1Charstrings) {\n const type2Charstrings = [];\n for (const type1Charstring of type1Charstrings) {\n type2Charstrings.push(type1Charstring.charstring);\n }\n return type2Charstrings;\n }\n\n getType2Subrs(type1Subrs) {\n let bias = 0;\n const count = type1Subrs.length;\n if (count < 1133) {\n bias = 107;\n } else if (count < 33769) {\n bias = 1131;\n } else {\n bias = 32768;\n }\n\n // Add a bunch of empty subrs to deal with the Type2 bias\n const type2Subrs = [];\n let i;\n for (i = 0; i < bias; i++) {\n type2Subrs.push([0x0b]);\n }\n\n for (i = 0; i < count; i++) {\n type2Subrs.push(type1Subrs[i]);\n }\n\n return type2Subrs;\n }\n\n wrap(name, glyphs, charstrings, subrs, properties) {\n const cff = new CFF();\n cff.header = new CFFHeader(1, 0, 4, 4);\n\n cff.names = [name];\n\n const topDict = new CFFTopDict();\n // CFF strings IDs 0...390 are predefined names, so refering\n // to entries in our own String INDEX starts at SID 391.\n topDict.setByName(\"version\", 391);\n topDict.setByName(\"Notice\", 392);\n topDict.setByName(\"FullName\", 393);\n topDict.setByName(\"FamilyName\", 394);\n topDict.setByName(\"Weight\", 395);\n topDict.setByName(\"Encoding\", null); // placeholder\n topDict.setByName(\"FontMatrix\", properties.fontMatrix);\n topDict.setByName(\"FontBBox\", properties.bbox);\n topDict.setByName(\"charset\", null); // placeholder\n topDict.setByName(\"CharStrings\", null); // placeholder\n topDict.setByName(\"Private\", null); // placeholder\n cff.topDict = topDict;\n\n const strings = new CFFStrings();\n strings.add(\"Version 0.11\"); // Version\n strings.add(\"See original notice\"); // Notice\n strings.add(name); // FullName\n strings.add(name); // FamilyName\n strings.add(\"Medium\"); // Weight\n cff.strings = strings;\n\n cff.globalSubrIndex = new CFFIndex();\n\n const count = glyphs.length;\n const charsetArray = [\".notdef\"];\n let i, ii;\n for (i = 0; i < count; i++) {\n const glyphName = charstrings[i].glyphName;\n const index = CFFStandardStrings.indexOf(glyphName);\n if (index === -1) {\n strings.add(glyphName);\n }\n charsetArray.push(glyphName);\n }\n cff.charset = new CFFCharset(false, 0, charsetArray);\n\n const charStringsIndex = new CFFIndex();\n charStringsIndex.add([0x8b, 0x0e]); // .notdef\n for (i = 0; i < count; i++) {\n charStringsIndex.add(glyphs[i]);\n }\n cff.charStrings = charStringsIndex;\n\n const privateDict = new CFFPrivateDict();\n privateDict.setByName(\"Subrs\", null); // placeholder\n const fields = [\n \"BlueValues\",\n \"OtherBlues\",\n \"FamilyBlues\",\n \"FamilyOtherBlues\",\n \"StemSnapH\",\n \"StemSnapV\",\n \"BlueShift\",\n \"BlueFuzz\",\n \"BlueScale\",\n \"LanguageGroup\",\n \"ExpansionFactor\",\n \"ForceBold\",\n \"StdHW\",\n \"StdVW\",\n ];\n for (i = 0, ii = fields.length; i < ii; i++) {\n const field = fields[i];\n if (!(field in properties.privateData)) {\n continue;\n }\n const value = properties.privateData[field];\n if (Array.isArray(value)) {\n // All of the private dictionary array data in CFF must be stored as\n // \"delta-encoded\" numbers.\n for (let j = value.length - 1; j > 0; j--) {\n value[j] -= value[j - 1]; // ... difference from previous value\n }\n }\n privateDict.setByName(field, value);\n }\n cff.topDict.privateDict = privateDict;\n\n const subrIndex = new CFFIndex();\n for (i = 0, ii = subrs.length; i < ii; i++) {\n subrIndex.add(subrs[i]);\n }\n privateDict.subrsIndex = subrIndex;\n\n const compiler = new CFFCompiler(cff);\n return compiler.compile();\n }\n}\n\nexport { Type1Font };\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 FONT_IDENTITY_MATRIX,\n FormatError,\n info,\n shadow,\n string32,\n warn,\n} from \"../shared/util.js\";\nimport { CFFCompiler, CFFParser } from \"./cff_parser.js\";\nimport {\n FontFlags,\n MacStandardGlyphOrdering,\n normalizeFontName,\n recoverGlyphName,\n SEAC_ANALYSIS_ENABLED,\n} from \"./fonts_utils.js\";\nimport {\n getCharUnicodeCategory,\n getUnicodeForGlyph,\n getUnicodeRangeFor,\n mapSpecialUnicodeValues,\n} from \"./unicode.js\";\nimport { getDingbatsGlyphsUnicode, getGlyphsUnicode } from \"./glyphlist.js\";\nimport {\n getEncoding,\n MacRomanEncoding,\n StandardEncoding,\n SymbolSetEncoding,\n WinAnsiEncoding,\n ZapfDingbatsEncoding,\n} from \"./encodings.js\";\nimport {\n getGlyphMapForStandardFonts,\n getNonStdFontMap,\n getSerifFonts,\n getStdFontMap,\n getSupplementalGlyphMapForArialBlack,\n getSupplementalGlyphMapForCalibri,\n} from \"./standard_fonts.js\";\nimport { IdentityToUnicodeMap, ToUnicodeMap } from \"./to_unicode_map.js\";\nimport { CFFFont } from \"./cff_font.js\";\nimport { FontRendererFactory } from \"./font_renderer.js\";\nimport { getFontBasicMetrics } from \"./metrics.js\";\nimport { GlyfTable } from \"./glyf.js\";\nimport { IdentityCMap } from \"./cmap.js\";\nimport { OpenTypeFileBuilder } from \"./opentype_file_builder.js\";\nimport { readUint32 } from \"./core_utils.js\";\nimport { Stream } from \"./stream.js\";\nimport { Type1Font } from \"./type1_font.js\";\n\n// Unicode Private Use Areas:\nconst PRIVATE_USE_AREAS = [\n [0xe000, 0xf8ff], // BMP (0)\n [0x100000, 0x10fffd], // PUP (16)\n];\n\n// PDF Glyph Space Units are one Thousandth of a TextSpace Unit\n// except for Type 3 fonts\nconst PDF_GLYPH_SPACE_UNITS = 1000;\n\nconst EXPORT_DATA_PROPERTIES = [\n \"ascent\",\n \"bbox\",\n \"black\",\n \"bold\",\n \"charProcOperatorList\",\n \"composite\",\n \"cssFontInfo\",\n \"data\",\n \"defaultVMetrics\",\n \"defaultWidth\",\n \"descent\",\n \"fallbackName\",\n \"fontMatrix\",\n \"isInvalidPDFjsFont\",\n \"isType3Font\",\n \"italic\",\n \"loadedName\",\n \"mimetype\",\n \"missingFile\",\n \"name\",\n \"remeasure\",\n \"subtype\",\n \"systemFontInfo\",\n \"type\",\n \"vertical\",\n];\n\nconst EXPORT_DATA_EXTRA_PROPERTIES = [\n \"cMap\",\n \"defaultEncoding\",\n \"differences\",\n \"isMonospace\",\n \"isSerifFont\",\n \"isSymbolicFont\",\n \"seacMap\",\n \"toFontChar\",\n \"toUnicode\",\n \"vmetrics\",\n \"widths\",\n];\n\nfunction adjustWidths(properties) {\n if (!properties.fontMatrix) {\n return;\n }\n if (properties.fontMatrix[0] === FONT_IDENTITY_MATRIX[0]) {\n return;\n }\n // adjusting width to fontMatrix scale\n const scale = 0.001 / properties.fontMatrix[0];\n const glyphsWidths = properties.widths;\n for (const glyph in glyphsWidths) {\n glyphsWidths[glyph] *= scale;\n }\n properties.defaultWidth *= scale;\n}\n\nfunction adjustTrueTypeToUnicode(properties, isSymbolicFont, nameRecords) {\n if (properties.isInternalFont) {\n return;\n }\n if (properties.hasIncludedToUnicodeMap) {\n return; // The font dictionary has a `ToUnicode` entry.\n }\n if (properties.hasEncoding) {\n return; // The font dictionary has an `Encoding` entry.\n }\n if (properties.toUnicode instanceof IdentityToUnicodeMap) {\n return;\n }\n if (!isSymbolicFont) {\n return; // A non-symbolic font should default to `StandardEncoding`.\n }\n if (nameRecords.length === 0) {\n return;\n }\n\n // Try to infer if the fallback encoding should really be `WinAnsiEncoding`.\n if (properties.defaultEncoding === WinAnsiEncoding) {\n return;\n }\n for (const r of nameRecords) {\n if (!isWinNameRecord(r)) {\n return; // Not Windows, hence `WinAnsiEncoding` wouldn't make sense.\n }\n }\n const encoding = WinAnsiEncoding;\n\n const toUnicode = [],\n glyphsUnicodeMap = getGlyphsUnicode();\n for (const charCode in encoding) {\n const glyphName = encoding[charCode];\n if (glyphName === \"\") {\n continue;\n }\n const unicode = glyphsUnicodeMap[glyphName];\n if (unicode === undefined) {\n continue;\n }\n toUnicode[charCode] = String.fromCharCode(unicode);\n }\n if (toUnicode.length > 0) {\n properties.toUnicode.amend(toUnicode);\n }\n}\n\nfunction adjustType1ToUnicode(properties, builtInEncoding) {\n if (properties.isInternalFont) {\n return;\n }\n if (properties.hasIncludedToUnicodeMap) {\n return; // The font dictionary has a `ToUnicode` entry.\n }\n if (builtInEncoding === properties.defaultEncoding) {\n return; // No point in trying to adjust `toUnicode` if the encodings match.\n }\n if (properties.toUnicode instanceof IdentityToUnicodeMap) {\n return;\n }\n const toUnicode = [],\n glyphsUnicodeMap = getGlyphsUnicode();\n for (const charCode in builtInEncoding) {\n if (properties.hasEncoding) {\n if (\n properties.baseEncodingName ||\n properties.differences[charCode] !== undefined\n ) {\n continue; // The font dictionary has an `Encoding`/`Differences` entry.\n }\n }\n const glyphName = builtInEncoding[charCode];\n const unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap);\n if (unicode !== -1) {\n toUnicode[charCode] = String.fromCharCode(unicode);\n }\n }\n if (toUnicode.length > 0) {\n properties.toUnicode.amend(toUnicode);\n }\n}\n\n/**\n * NOTE: This function should only be called at the *end* of font-parsing,\n * after e.g. `adjustType1ToUnicode` has run, to prevent any issues.\n */\nfunction amendFallbackToUnicode(properties) {\n if (!properties.fallbackToUnicode) {\n return;\n }\n if (properties.toUnicode instanceof IdentityToUnicodeMap) {\n return;\n }\n const toUnicode = [];\n for (const charCode in properties.fallbackToUnicode) {\n if (properties.toUnicode.has(charCode)) {\n continue; // The font dictionary has a `ToUnicode` entry.\n }\n toUnicode[charCode] = properties.fallbackToUnicode[charCode];\n }\n if (toUnicode.length > 0) {\n properties.toUnicode.amend(toUnicode);\n }\n}\n\nclass Glyph {\n constructor(\n originalCharCode,\n fontChar,\n unicode,\n accent,\n width,\n vmetric,\n operatorListId,\n isSpace,\n isInFont\n ) {\n this.originalCharCode = originalCharCode;\n this.fontChar = fontChar;\n this.unicode = unicode;\n this.accent = accent;\n this.width = width;\n this.vmetric = vmetric;\n this.operatorListId = operatorListId;\n this.isSpace = isSpace;\n this.isInFont = isInFont;\n }\n\n /**\n * This property, which is only used by `PartialEvaluator.getTextContent`,\n * is purposely made non-serializable.\n * @type {Object}\n */\n get category() {\n return shadow(\n this,\n \"category\",\n getCharUnicodeCategory(this.unicode),\n /* nonSerializable = */ true\n );\n }\n}\n\nfunction int16(b0, b1) {\n return (b0 << 8) + b1;\n}\n\nfunction writeSignedInt16(bytes, index, value) {\n bytes[index + 1] = value;\n bytes[index] = value >>> 8;\n}\n\nfunction signedInt16(b0, b1) {\n const value = (b0 << 8) + b1;\n return value & (1 << 15) ? value - 0x10000 : value;\n}\n\nfunction writeUint32(bytes, index, value) {\n bytes[index + 3] = value & 0xff;\n bytes[index + 2] = value >>> 8;\n bytes[index + 1] = value >>> 16;\n bytes[index] = value >>> 24;\n}\n\nfunction int32(b0, b1, b2, b3) {\n return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3;\n}\n\nfunction string16(value) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n typeof value === \"number\" && Math.abs(value) < 2 ** 16,\n `string16: Unexpected input \"${value}\".`\n );\n }\n return String.fromCharCode((value >> 8) & 0xff, value & 0xff);\n}\n\nfunction safeString16(value) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n typeof value === \"number\" && !Number.isNaN(value),\n `safeString16: Unexpected input \"${value}\".`\n );\n }\n // clamp value to the 16-bit int range\n if (value > 0x7fff) {\n value = 0x7fff;\n } else if (value < -0x8000) {\n value = -0x8000;\n }\n return String.fromCharCode((value >> 8) & 0xff, value & 0xff);\n}\n\nfunction isTrueTypeFile(file) {\n const header = file.peekBytes(4);\n return (\n readUint32(header, 0) === 0x00010000 || bytesToString(header) === \"true\"\n );\n}\n\nfunction isTrueTypeCollectionFile(file) {\n const header = file.peekBytes(4);\n return bytesToString(header) === \"ttcf\";\n}\n\nfunction isOpenTypeFile(file) {\n const header = file.peekBytes(4);\n return bytesToString(header) === \"OTTO\";\n}\n\nfunction isType1File(file) {\n const header = file.peekBytes(2);\n // All Type1 font programs must begin with the comment '%!' (0x25 + 0x21).\n if (header[0] === 0x25 && header[1] === 0x21) {\n return true;\n }\n // ... obviously some fonts violate that part of the specification,\n // please refer to the comment in |Type1Font| below (pfb file header).\n if (header[0] === 0x80 && header[1] === 0x01) {\n return true;\n }\n return false;\n}\n\n/**\n * Compared to other font formats, the header in CFF files is not constant\n * but contains version numbers. To reduce the possibility of misclassifying\n * font files as CFF, it's recommended to check for other font formats first.\n */\nfunction isCFFFile(file) {\n const header = file.peekBytes(4);\n if (\n /* major version, [1, 255] */ header[0] >= 1 &&\n /* minor version, [0, 255]; header[1] */\n /* header size, [0, 255]; header[2] */\n /* offset(0) size, [1, 4] */ header[3] >= 1 &&\n header[3] <= 4\n ) {\n return true;\n }\n return false;\n}\n\nfunction getFontFileType(file, { type, subtype, composite }) {\n let fileType, fileSubtype;\n\n if (isTrueTypeFile(file) || isTrueTypeCollectionFile(file)) {\n fileType = composite ? \"CIDFontType2\" : \"TrueType\";\n } else if (isOpenTypeFile(file)) {\n fileType = composite ? \"CIDFontType2\" : \"OpenType\";\n } else if (isType1File(file)) {\n if (composite) {\n fileType = \"CIDFontType0\";\n } else {\n fileType = type === \"MMType1\" ? \"MMType1\" : \"Type1\";\n }\n } else if (isCFFFile(file)) {\n if (composite) {\n fileType = \"CIDFontType0\";\n fileSubtype = \"CIDFontType0C\";\n } else {\n fileType = type === \"MMType1\" ? \"MMType1\" : \"Type1\";\n fileSubtype = \"Type1C\";\n }\n } else {\n warn(\"getFontFileType: Unable to detect correct font file Type/Subtype.\");\n fileType = type;\n fileSubtype = subtype;\n }\n\n return [fileType, fileSubtype];\n}\n\nfunction applyStandardFontGlyphMap(map, glyphMap) {\n for (const charCode in glyphMap) {\n map[+charCode] = glyphMap[charCode];\n }\n}\n\nfunction buildToFontChar(encoding, glyphsUnicodeMap, differences) {\n const toFontChar = [];\n let unicode;\n for (let i = 0, ii = encoding.length; i < ii; i++) {\n unicode = getUnicodeForGlyph(encoding[i], glyphsUnicodeMap);\n if (unicode !== -1) {\n toFontChar[i] = unicode;\n }\n }\n for (const charCode in differences) {\n unicode = getUnicodeForGlyph(differences[charCode], glyphsUnicodeMap);\n if (unicode !== -1) {\n toFontChar[+charCode] = unicode;\n }\n }\n return toFontChar;\n}\n\n// Please refer to:\n// - https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6name.html\nfunction isMacNameRecord(r) {\n return r.platform === 1 && r.encoding === 0 && r.language === 0;\n}\n\n// Please refer to:\n// - https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6name.html\n// - https://learn.microsoft.com/en-us/typography/opentype/spec/name#windows-language-ids\nfunction isWinNameRecord(r) {\n return r.platform === 3 && r.encoding === 1 && r.language === 0x409;\n}\n\nfunction convertCidString(charCode, cid, shouldThrow = false) {\n switch (cid.length) {\n case 1:\n return cid.charCodeAt(0);\n case 2:\n return (cid.charCodeAt(0) << 8) | cid.charCodeAt(1);\n }\n const msg = `Unsupported CID string (charCode ${charCode}): \"${cid}\".`;\n if (shouldThrow) {\n throw new FormatError(msg);\n }\n warn(msg);\n return cid;\n}\n\n/**\n * Rebuilds the char code to glyph ID map by moving all char codes to the\n * private use area. This is done to avoid issues with various problematic\n * unicode areas where either a glyph won't be drawn or is deformed by a\n * shaper.\n * @returns {Object} Two properties:\n * 'toFontChar' - maps original char codes(the value that will be read\n * from commands such as show text) to the char codes that will be used in the\n * font that we build\n * 'charCodeToGlyphId' - maps the new font char codes to glyph ids\n */\nfunction adjustMapping(charCodeToGlyphId, hasGlyph, newGlyphZeroId, toUnicode) {\n const newMap = Object.create(null);\n const toUnicodeExtraMap = new Map();\n const toFontChar = [];\n const usedGlyphIds = new Set();\n let privateUseAreaIndex = 0;\n const privateUseOffetStart = PRIVATE_USE_AREAS[privateUseAreaIndex][0];\n let nextAvailableFontCharCode = privateUseOffetStart;\n let privateUseOffetEnd = PRIVATE_USE_AREAS[privateUseAreaIndex][1];\n const isInPrivateArea = code =>\n (PRIVATE_USE_AREAS[0][0] <= code && code <= PRIVATE_USE_AREAS[0][1]) ||\n (PRIVATE_USE_AREAS[1][0] <= code && code <= PRIVATE_USE_AREAS[1][1]);\n for (let originalCharCode in charCodeToGlyphId) {\n originalCharCode |= 0;\n let glyphId = charCodeToGlyphId[originalCharCode];\n // For missing glyphs don't create the mappings so the glyph isn't\n // drawn.\n if (!hasGlyph(glyphId)) {\n continue;\n }\n if (nextAvailableFontCharCode > privateUseOffetEnd) {\n privateUseAreaIndex++;\n if (privateUseAreaIndex >= PRIVATE_USE_AREAS.length) {\n warn(\"Ran out of space in font private use area.\");\n break;\n }\n nextAvailableFontCharCode = PRIVATE_USE_AREAS[privateUseAreaIndex][0];\n privateUseOffetEnd = PRIVATE_USE_AREAS[privateUseAreaIndex][1];\n }\n const fontCharCode = nextAvailableFontCharCode++;\n if (glyphId === 0) {\n glyphId = newGlyphZeroId;\n }\n\n // Fix for bug 1778484:\n // The charcodes are moved into a private use area to fix some rendering\n // issues (https://github.com/mozilla/pdf.js/pull/9340) but when printing\n // to PDF the generated font will contain wrong chars. We can avoid that by\n // adding the unicode to the cmap and the print backend will then map the\n // glyph ids to the correct unicode.\n let unicode = toUnicode.get(originalCharCode);\n if (typeof unicode === \"string\") {\n unicode = unicode.codePointAt(0);\n }\n if (unicode && !isInPrivateArea(unicode) && !usedGlyphIds.has(glyphId)) {\n toUnicodeExtraMap.set(unicode, glyphId);\n usedGlyphIds.add(glyphId);\n }\n\n newMap[fontCharCode] = glyphId;\n toFontChar[originalCharCode] = fontCharCode;\n }\n return {\n toFontChar,\n charCodeToGlyphId: newMap,\n toUnicodeExtraMap,\n nextAvailableFontCharCode,\n };\n}\n\nfunction getRanges(glyphs, toUnicodeExtraMap, numGlyphs) {\n // Array.sort() sorts by characters, not numerically, so convert to an\n // array of characters.\n const codes = [];\n for (const charCode in glyphs) {\n // Remove an invalid glyph ID mappings to make OTS happy.\n if (glyphs[charCode] >= numGlyphs) {\n continue;\n }\n codes.push({ fontCharCode: charCode | 0, glyphId: glyphs[charCode] });\n }\n if (toUnicodeExtraMap) {\n for (const [unicode, glyphId] of toUnicodeExtraMap) {\n if (glyphId >= numGlyphs) {\n continue;\n }\n codes.push({ fontCharCode: unicode, glyphId });\n }\n }\n // Some fonts have zero glyphs and are used only for text selection, but\n // there needs to be at least one to build a valid cmap table.\n if (codes.length === 0) {\n codes.push({ fontCharCode: 0, glyphId: 0 });\n }\n codes.sort(function fontGetRangesSort(a, b) {\n return a.fontCharCode - b.fontCharCode;\n });\n\n // Split the sorted codes into ranges.\n const ranges = [];\n const length = codes.length;\n for (let n = 0; n < length; ) {\n const start = codes[n].fontCharCode;\n const codeIndices = [codes[n].glyphId];\n ++n;\n let end = start;\n while (n < length && end + 1 === codes[n].fontCharCode) {\n codeIndices.push(codes[n].glyphId);\n ++end;\n ++n;\n if (end === 0xffff) {\n break;\n }\n }\n ranges.push([start, end, codeIndices]);\n }\n\n return ranges;\n}\n\nfunction createCmapTable(glyphs, toUnicodeExtraMap, numGlyphs) {\n const ranges = getRanges(glyphs, toUnicodeExtraMap, numGlyphs);\n const numTables = ranges.at(-1)[1] > 0xffff ? 2 : 1;\n let cmap =\n \"\\x00\\x00\" + // version\n string16(numTables) + // numTables\n \"\\x00\\x03\" + // platformID\n \"\\x00\\x01\" + // encodingID\n string32(4 + numTables * 8); // start of the table record\n\n let i, ii, j, jj;\n for (i = ranges.length - 1; i >= 0; --i) {\n if (ranges[i][0] <= 0xffff) {\n break;\n }\n }\n const bmpLength = i + 1;\n\n if (ranges[i][0] < 0xffff && ranges[i][1] === 0xffff) {\n ranges[i][1] = 0xfffe;\n }\n const trailingRangesCount = ranges[i][1] < 0xffff ? 1 : 0;\n const segCount = bmpLength + trailingRangesCount;\n const searchParams = OpenTypeFileBuilder.getSearchParams(segCount, 2);\n\n // Fill up the 4 parallel arrays describing the segments.\n let startCount = \"\";\n let endCount = \"\";\n let idDeltas = \"\";\n let idRangeOffsets = \"\";\n let glyphsIds = \"\";\n let bias = 0;\n\n let range, start, end, codes;\n for (i = 0, ii = bmpLength; i < ii; i++) {\n range = ranges[i];\n start = range[0];\n end = range[1];\n startCount += string16(start);\n endCount += string16(end);\n codes = range[2];\n let contiguous = true;\n for (j = 1, jj = codes.length; j < jj; ++j) {\n if (codes[j] !== codes[j - 1] + 1) {\n contiguous = false;\n break;\n }\n }\n if (!contiguous) {\n const offset = (segCount - i) * 2 + bias * 2;\n bias += end - start + 1;\n\n idDeltas += string16(0);\n idRangeOffsets += string16(offset);\n\n for (j = 0, jj = codes.length; j < jj; ++j) {\n glyphsIds += string16(codes[j]);\n }\n } else {\n const startCode = codes[0];\n\n idDeltas += string16((startCode - start) & 0xffff);\n idRangeOffsets += string16(0);\n }\n }\n\n if (trailingRangesCount > 0) {\n endCount += \"\\xFF\\xFF\";\n startCount += \"\\xFF\\xFF\";\n idDeltas += \"\\x00\\x01\";\n idRangeOffsets += \"\\x00\\x00\";\n }\n\n const format314 =\n \"\\x00\\x00\" + // language\n string16(2 * segCount) +\n string16(searchParams.range) +\n string16(searchParams.entry) +\n string16(searchParams.rangeShift) +\n endCount +\n \"\\x00\\x00\" +\n startCount +\n idDeltas +\n idRangeOffsets +\n glyphsIds;\n\n let format31012 = \"\";\n let header31012 = \"\";\n if (numTables > 1) {\n cmap +=\n \"\\x00\\x03\" + // platformID\n \"\\x00\\x0A\" + // encodingID\n string32(4 + numTables * 8 + 4 + format314.length); // start of the table record\n format31012 = \"\";\n for (i = 0, ii = ranges.length; i < ii; i++) {\n range = ranges[i];\n start = range[0];\n codes = range[2];\n let code = codes[0];\n for (j = 1, jj = codes.length; j < jj; ++j) {\n if (codes[j] !== codes[j - 1] + 1) {\n end = range[0] + j - 1;\n format31012 +=\n string32(start) + // startCharCode\n string32(end) + // endCharCode\n string32(code); // startGlyphID\n start = end + 1;\n code = codes[j];\n }\n }\n format31012 +=\n string32(start) + // startCharCode\n string32(range[1]) + // endCharCode\n string32(code); // startGlyphID\n }\n header31012 =\n \"\\x00\\x0C\" + // format\n \"\\x00\\x00\" + // reserved\n string32(format31012.length + 16) + // length\n \"\\x00\\x00\\x00\\x00\" + // language\n string32(format31012.length / 12); // nGroups\n }\n\n return (\n cmap +\n \"\\x00\\x04\" + // format\n string16(format314.length + 4) + // length\n format314 +\n header31012 +\n format31012\n );\n}\n\nfunction validateOS2Table(os2, file) {\n file.pos = (file.start || 0) + os2.offset;\n const version = file.getUint16();\n // TODO verify all OS/2 tables fields, but currently we validate only those\n // that give us issues\n file.skip(60); // skipping type, misc sizes, panose, unicode ranges\n const selection = file.getUint16();\n if (version < 4 && selection & 0x0300) {\n return false;\n }\n const firstChar = file.getUint16();\n const lastChar = file.getUint16();\n if (firstChar > lastChar) {\n return false;\n }\n file.skip(6); // skipping sTypoAscender/Descender/LineGap\n const usWinAscent = file.getUint16();\n if (usWinAscent === 0) {\n // makes font unreadable by windows\n return false;\n }\n\n // OS/2 appears to be valid, resetting some fields\n os2.data[8] = os2.data[9] = 0; // IE rejects fonts if fsType != 0\n return true;\n}\n\nfunction createOS2Table(properties, charstrings, override) {\n override ||= {\n unitsPerEm: 0,\n yMax: 0,\n yMin: 0,\n ascent: 0,\n descent: 0,\n };\n\n let ulUnicodeRange1 = 0;\n let ulUnicodeRange2 = 0;\n let ulUnicodeRange3 = 0;\n let ulUnicodeRange4 = 0;\n\n let firstCharIndex = null;\n let lastCharIndex = 0;\n let position = -1;\n\n if (charstrings) {\n for (let code in charstrings) {\n code |= 0;\n if (firstCharIndex > code || !firstCharIndex) {\n firstCharIndex = code;\n }\n if (lastCharIndex < code) {\n lastCharIndex = code;\n }\n\n position = getUnicodeRangeFor(code, position);\n if (position < 32) {\n ulUnicodeRange1 |= 1 << position;\n } else if (position < 64) {\n ulUnicodeRange2 |= 1 << (position - 32);\n } else if (position < 96) {\n ulUnicodeRange3 |= 1 << (position - 64);\n } else if (position < 123) {\n ulUnicodeRange4 |= 1 << (position - 96);\n } else {\n throw new FormatError(\n \"Unicode ranges Bits > 123 are reserved for internal usage\"\n );\n }\n }\n if (lastCharIndex > 0xffff) {\n // OS2 only supports a 16 bit int. The spec says if supplementary\n // characters are used the field should just be set to 0xFFFF.\n lastCharIndex = 0xffff;\n }\n } else {\n // TODO\n firstCharIndex = 0;\n lastCharIndex = 255;\n }\n\n const bbox = properties.bbox || [0, 0, 0, 0];\n const unitsPerEm =\n override.unitsPerEm ||\n 1 / (properties.fontMatrix || FONT_IDENTITY_MATRIX)[0];\n\n // if the font units differ to the PDF glyph space units\n // then scale up the values\n const scale = properties.ascentScaled\n ? 1.0\n : unitsPerEm / PDF_GLYPH_SPACE_UNITS;\n\n const typoAscent =\n override.ascent || Math.round(scale * (properties.ascent || bbox[3]));\n let typoDescent =\n override.descent || Math.round(scale * (properties.descent || bbox[1]));\n if (typoDescent > 0 && properties.descent > 0 && bbox[1] < 0) {\n typoDescent = -typoDescent; // fixing incorrect descent\n }\n const winAscent = override.yMax || typoAscent;\n const winDescent = -override.yMin || -typoDescent;\n\n return (\n \"\\x00\\x03\" + // version\n \"\\x02\\x24\" + // xAvgCharWidth\n \"\\x01\\xF4\" + // usWeightClass\n \"\\x00\\x05\" + // usWidthClass\n \"\\x00\\x00\" + // fstype (0 to let the font loads via font-face on IE)\n \"\\x02\\x8A\" + // ySubscriptXSize\n \"\\x02\\xBB\" + // ySubscriptYSize\n \"\\x00\\x00\" + // ySubscriptXOffset\n \"\\x00\\x8C\" + // ySubscriptYOffset\n \"\\x02\\x8A\" + // ySuperScriptXSize\n \"\\x02\\xBB\" + // ySuperScriptYSize\n \"\\x00\\x00\" + // ySuperScriptXOffset\n \"\\x01\\xDF\" + // ySuperScriptYOffset\n \"\\x00\\x31\" + // yStrikeOutSize\n \"\\x01\\x02\" + // yStrikeOutPosition\n \"\\x00\\x00\" + // sFamilyClass\n \"\\x00\\x00\\x06\" +\n String.fromCharCode(properties.fixedPitch ? 0x09 : 0x00) +\n \"\\x00\\x00\\x00\\x00\\x00\\x00\" + // Panose\n string32(ulUnicodeRange1) + // ulUnicodeRange1 (Bits 0-31)\n string32(ulUnicodeRange2) + // ulUnicodeRange2 (Bits 32-63)\n string32(ulUnicodeRange3) + // ulUnicodeRange3 (Bits 64-95)\n string32(ulUnicodeRange4) + // ulUnicodeRange4 (Bits 96-127)\n \"\\x2A\\x32\\x31\\x2A\" + // achVendID\n string16(properties.italicAngle ? 1 : 0) + // fsSelection\n string16(firstCharIndex || properties.firstChar) + // usFirstCharIndex\n string16(lastCharIndex || properties.lastChar) + // usLastCharIndex\n string16(typoAscent) + // sTypoAscender\n string16(typoDescent) + // sTypoDescender\n \"\\x00\\x64\" + // sTypoLineGap (7%-10% of the unitsPerEM value)\n string16(winAscent) + // usWinAscent\n string16(winDescent) + // usWinDescent\n \"\\x00\\x00\\x00\\x00\" + // ulCodePageRange1 (Bits 0-31)\n \"\\x00\\x00\\x00\\x00\" + // ulCodePageRange2 (Bits 32-63)\n string16(properties.xHeight) + // sxHeight\n string16(properties.capHeight) + // sCapHeight\n string16(0) + // usDefaultChar\n string16(firstCharIndex || properties.firstChar) + // usBreakChar\n \"\\x00\\x03\"\n ); // usMaxContext\n}\n\nfunction createPostTable(properties) {\n const angle = Math.floor(properties.italicAngle * 2 ** 16);\n return (\n \"\\x00\\x03\\x00\\x00\" + // Version number\n string32(angle) + // italicAngle\n \"\\x00\\x00\" + // underlinePosition\n \"\\x00\\x00\" + // underlineThickness\n string32(properties.fixedPitch ? 1 : 0) + // isFixedPitch\n \"\\x00\\x00\\x00\\x00\" + // minMemType42\n \"\\x00\\x00\\x00\\x00\" + // maxMemType42\n \"\\x00\\x00\\x00\\x00\" + // minMemType1\n \"\\x00\\x00\\x00\\x00\"\n ); // maxMemType1\n}\n\nfunction createPostscriptName(name) {\n // See https://docs.microsoft.com/en-us/typography/opentype/spec/recom#name.\n return name.replaceAll(/[^\\x21-\\x7E]|[[\\](){}<>/%]/g, \"\").slice(0, 63);\n}\n\nfunction createNameTable(name, proto) {\n if (!proto) {\n proto = [[], []]; // no strings and unicode strings\n }\n\n const strings = [\n proto[0][0] || \"Original licence\", // 0.Copyright\n proto[0][1] || name, // 1.Font family\n proto[0][2] || \"Unknown\", // 2.Font subfamily (font weight)\n proto[0][3] || \"uniqueID\", // 3.Unique ID\n proto[0][4] || name, // 4.Full font name\n proto[0][5] || \"Version 0.11\", // 5.Version\n proto[0][6] || createPostscriptName(name), // 6.Postscript name\n proto[0][7] || \"Unknown\", // 7.Trademark\n proto[0][8] || \"Unknown\", // 8.Manufacturer\n proto[0][9] || \"Unknown\", // 9.Designer\n ];\n\n // Mac want 1-byte per character strings while Windows want\n // 2-bytes per character, so duplicate the names table\n const stringsUnicode = [];\n let i, ii, j, jj, str;\n for (i = 0, ii = strings.length; i < ii; i++) {\n str = proto[1][i] || strings[i];\n\n const strBufUnicode = [];\n for (j = 0, jj = str.length; j < jj; j++) {\n strBufUnicode.push(string16(str.charCodeAt(j)));\n }\n stringsUnicode.push(strBufUnicode.join(\"\"));\n }\n\n const names = [strings, stringsUnicode];\n const platforms = [\"\\x00\\x01\", \"\\x00\\x03\"];\n const encodings = [\"\\x00\\x00\", \"\\x00\\x01\"];\n const languages = [\"\\x00\\x00\", \"\\x04\\x09\"];\n\n const namesRecordCount = strings.length * platforms.length;\n let nameTable =\n \"\\x00\\x00\" + // format\n string16(namesRecordCount) + // Number of names Record\n string16(namesRecordCount * 12 + 6); // Storage\n\n // Build the name records field\n let strOffset = 0;\n for (i = 0, ii = platforms.length; i < ii; i++) {\n const strs = names[i];\n for (j = 0, jj = strs.length; j < jj; j++) {\n str = strs[j];\n const nameRecord =\n platforms[i] + // platform ID\n encodings[i] + // encoding ID\n languages[i] + // language ID\n string16(j) + // name ID\n string16(str.length) +\n string16(strOffset);\n nameTable += nameRecord;\n strOffset += str.length;\n }\n }\n\n nameTable += strings.join(\"\") + stringsUnicode.join(\"\");\n return nameTable;\n}\n\n/**\n * 'Font' is the class the outside world should use, it encapsulate all the font\n * decoding logics whatever type it is (assuming the font type is supported).\n */\nclass Font {\n constructor(name, file, properties) {\n this.name = name;\n this.psName = null;\n this.mimetype = null;\n this.disableFontFace = false;\n\n this.loadedName = properties.loadedName;\n this.isType3Font = properties.isType3Font;\n this.missingFile = false;\n this.cssFontInfo = properties.cssFontInfo;\n\n this._charsCache = Object.create(null);\n this._glyphCache = Object.create(null);\n\n let isSerifFont = !!(properties.flags & FontFlags.Serif);\n // Fallback to checking the font name, in order to improve text-selection,\n // since the /Flags-entry is often wrong (fixes issue13845.pdf).\n if (!isSerifFont && !properties.isSimulatedFlags) {\n const baseName = name.replaceAll(/[,_]/g, \"-\").split(\"-\")[0],\n serifFonts = getSerifFonts();\n for (const namePart of baseName.split(\"+\")) {\n if (serifFonts[namePart]) {\n isSerifFont = true;\n break;\n }\n }\n }\n this.isSerifFont = isSerifFont;\n\n this.isSymbolicFont = !!(properties.flags & FontFlags.Symbolic);\n this.isMonospace = !!(properties.flags & FontFlags.FixedPitch);\n\n let { type, subtype } = properties;\n this.type = type;\n this.subtype = subtype;\n this.systemFontInfo = properties.systemFontInfo;\n\n const matches = name.match(/^InvalidPDFjsFont_(.*)_\\d+$/);\n this.isInvalidPDFjsFont = !!matches;\n if (this.isInvalidPDFjsFont) {\n this.fallbackName = matches[1];\n } else if (this.isMonospace) {\n this.fallbackName = \"monospace\";\n } else if (this.isSerifFont) {\n this.fallbackName = \"serif\";\n } else {\n this.fallbackName = \"sans-serif\";\n }\n\n if (this.systemFontInfo?.guessFallback) {\n // Once the fallback name is guessed, we don't want to guess it again.\n this.systemFontInfo.guessFallback = false;\n this.systemFontInfo.css += `,${this.fallbackName}`;\n }\n\n this.differences = properties.differences;\n this.widths = properties.widths;\n this.defaultWidth = properties.defaultWidth;\n this.composite = properties.composite;\n this.cMap = properties.cMap;\n this.capHeight = properties.capHeight / PDF_GLYPH_SPACE_UNITS;\n this.ascent = properties.ascent / PDF_GLYPH_SPACE_UNITS;\n this.descent = properties.descent / PDF_GLYPH_SPACE_UNITS;\n this.lineHeight = this.ascent - this.descent;\n this.fontMatrix = properties.fontMatrix;\n this.bbox = properties.bbox;\n this.defaultEncoding = properties.defaultEncoding;\n\n this.toUnicode = properties.toUnicode;\n this.toFontChar = [];\n\n if (properties.type === \"Type3\") {\n for (let charCode = 0; charCode < 256; charCode++) {\n this.toFontChar[charCode] =\n this.differences[charCode] || properties.defaultEncoding[charCode];\n }\n return;\n }\n\n this.cidEncoding = properties.cidEncoding || \"\";\n this.vertical = !!properties.vertical;\n if (this.vertical) {\n this.vmetrics = properties.vmetrics;\n this.defaultVMetrics = properties.defaultVMetrics;\n }\n\n if (!file || file.isEmpty) {\n if (file) {\n // Some bad PDF generators will include empty font files,\n // attempting to recover by assuming that no file exists.\n warn('Font file is empty in \"' + name + '\" (' + this.loadedName + \")\");\n }\n this.fallbackToSystemFont(properties);\n return;\n }\n\n // Parse the font file to determine the correct type/subtype, rather than\n // relying on the (often incorrect) data in the font dictionary; (see e.g.\n // issue6782.pdf, issue7598.pdf, and issue9949.pdf).\n [type, subtype] = getFontFileType(file, properties);\n\n if (type !== this.type || subtype !== this.subtype) {\n info(\n \"Inconsistent font file Type/SubType, expected: \" +\n `${this.type}/${this.subtype} but found: ${type}/${subtype}.`\n );\n }\n\n let data;\n try {\n switch (type) {\n case \"MMType1\":\n info(\"MMType1 font (\" + name + \"), falling back to Type1.\");\n /* falls through */\n case \"Type1\":\n case \"CIDFontType0\":\n this.mimetype = \"font/opentype\";\n\n const cff =\n subtype === \"Type1C\" || subtype === \"CIDFontType0C\"\n ? new CFFFont(file, properties)\n : new Type1Font(name, file, properties);\n\n adjustWidths(properties);\n\n // Wrap the CFF data inside an OTF font file\n data = this.convert(name, cff, properties);\n break;\n\n case \"OpenType\":\n case \"TrueType\":\n case \"CIDFontType2\":\n this.mimetype = \"font/opentype\";\n\n // Repair the TrueType file. It is can be damaged in the point of\n // view of the sanitizer\n data = this.checkAndRepair(name, file, properties);\n if (this.isOpenType) {\n adjustWidths(properties);\n\n type = \"OpenType\";\n }\n break;\n\n default:\n throw new FormatError(`Font ${type} is not supported`);\n }\n } catch (e) {\n warn(e);\n this.fallbackToSystemFont(properties);\n return;\n }\n\n amendFallbackToUnicode(properties);\n this.data = data;\n\n // Transfer some properties again that could change during font conversion\n this.type = type;\n this.subtype = subtype;\n this.fontMatrix = properties.fontMatrix;\n this.widths = properties.widths;\n this.defaultWidth = properties.defaultWidth;\n this.toUnicode = properties.toUnicode;\n this.seacMap = properties.seacMap;\n }\n\n get renderer() {\n const renderer = FontRendererFactory.create(this, SEAC_ANALYSIS_ENABLED);\n return shadow(this, \"renderer\", renderer);\n }\n\n exportData(extraProperties = false) {\n const exportDataProperties = extraProperties\n ? [...EXPORT_DATA_PROPERTIES, ...EXPORT_DATA_EXTRA_PROPERTIES]\n : EXPORT_DATA_PROPERTIES;\n\n const data = Object.create(null);\n let property, value;\n for (property of exportDataProperties) {\n value = this[property];\n // Ignore properties that haven't been explicitly set.\n if (value !== undefined) {\n data[property] = value;\n }\n }\n return data;\n }\n\n fallbackToSystemFont(properties) {\n this.missingFile = true;\n // The file data is not specified. Trying to fix the font name\n // to be used with the canvas.font.\n const { name, type } = this;\n let fontName = normalizeFontName(name);\n const stdFontMap = getStdFontMap(),\n nonStdFontMap = getNonStdFontMap();\n const isStandardFont = !!stdFontMap[fontName];\n const isMappedToStandardFont = !!(\n nonStdFontMap[fontName] && stdFontMap[nonStdFontMap[fontName]]\n );\n\n fontName = stdFontMap[fontName] || nonStdFontMap[fontName] || fontName;\n\n const fontBasicMetricsMap = getFontBasicMetrics();\n const metrics = fontBasicMetricsMap[fontName];\n if (metrics) {\n if (isNaN(this.ascent)) {\n this.ascent = metrics.ascent / PDF_GLYPH_SPACE_UNITS;\n }\n if (isNaN(this.descent)) {\n this.descent = metrics.descent / PDF_GLYPH_SPACE_UNITS;\n }\n if (isNaN(this.capHeight)) {\n this.capHeight = metrics.capHeight / PDF_GLYPH_SPACE_UNITS;\n }\n }\n\n this.bold = /bold/gi.test(fontName);\n this.italic = /oblique|italic/gi.test(fontName);\n\n // Use 'name' instead of 'fontName' here because the original\n // name ArialBlack for example will be replaced by Helvetica.\n this.black = /Black/g.test(name);\n\n // Use 'name' instead of 'fontName' here because the original\n // name ArialNarrow for example will be replaced by Helvetica.\n const isNarrow = /Narrow/g.test(name);\n\n // if at least one width is present, remeasure all chars when exists\n this.remeasure =\n (!isStandardFont || isNarrow) && Object.keys(this.widths).length > 0;\n if (\n (isStandardFont || isMappedToStandardFont) &&\n type === \"CIDFontType2\" &&\n this.cidEncoding.startsWith(\"Identity-\")\n ) {\n const cidToGidMap = properties.cidToGidMap;\n // Standard fonts might be embedded as CID font without glyph mapping.\n // Building one based on GlyphMapForStandardFonts.\n const map = [];\n applyStandardFontGlyphMap(map, getGlyphMapForStandardFonts());\n\n if (/Arial-?Black/i.test(name)) {\n applyStandardFontGlyphMap(map, getSupplementalGlyphMapForArialBlack());\n } else if (/Calibri/i.test(name)) {\n applyStandardFontGlyphMap(map, getSupplementalGlyphMapForCalibri());\n }\n\n // Always update the glyph mapping with the `cidToGidMap` when it exists\n // (fixes issue12418_reduced.pdf).\n if (cidToGidMap) {\n for (const charCode in map) {\n const cid = map[charCode];\n if (cidToGidMap[cid] !== undefined) {\n map[+charCode] = cidToGidMap[cid];\n }\n }\n // When the /CIDToGIDMap is \"incomplete\", fallback to the included\n // /ToUnicode-map regardless of its encoding (fixes issue11915.pdf).\n if (\n cidToGidMap.length !== this.toUnicode.length &&\n properties.hasIncludedToUnicodeMap &&\n this.toUnicode instanceof IdentityToUnicodeMap\n ) {\n this.toUnicode.forEach(function (charCode, unicodeCharCode) {\n const cid = map[charCode];\n if (cidToGidMap[cid] === undefined) {\n map[+charCode] = unicodeCharCode;\n }\n });\n }\n }\n\n if (!(this.toUnicode instanceof IdentityToUnicodeMap)) {\n this.toUnicode.forEach(function (charCode, unicodeCharCode) {\n map[+charCode] = unicodeCharCode;\n });\n }\n this.toFontChar = map;\n this.toUnicode = new ToUnicodeMap(map);\n } else if (/Symbol/i.test(fontName)) {\n this.toFontChar = buildToFontChar(\n SymbolSetEncoding,\n getGlyphsUnicode(),\n this.differences\n );\n } else if (/Dingbats/i.test(fontName)) {\n this.toFontChar = buildToFontChar(\n ZapfDingbatsEncoding,\n getDingbatsGlyphsUnicode(),\n this.differences\n );\n } else if (isStandardFont) {\n const map = buildToFontChar(\n this.defaultEncoding,\n getGlyphsUnicode(),\n this.differences\n );\n\n if (\n type === \"CIDFontType2\" &&\n !this.cidEncoding.startsWith(\"Identity-\") &&\n !(this.toUnicode instanceof IdentityToUnicodeMap)\n ) {\n this.toUnicode.forEach(function (charCode, unicodeCharCode) {\n map[+charCode] = unicodeCharCode;\n });\n }\n this.toFontChar = map;\n } else {\n const glyphsUnicodeMap = getGlyphsUnicode();\n const map = [];\n this.toUnicode.forEach((charCode, unicodeCharCode) => {\n if (!this.composite) {\n const glyphName =\n this.differences[charCode] || this.defaultEncoding[charCode];\n const unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap);\n if (unicode !== -1) {\n unicodeCharCode = unicode;\n }\n }\n map[+charCode] = unicodeCharCode;\n });\n\n // Attempt to improve the glyph mapping for (some) composite fonts that\n // appear to lack meaningful ToUnicode data.\n if (this.composite && this.toUnicode instanceof IdentityToUnicodeMap) {\n if (/Tahoma|Verdana/i.test(name)) {\n // Fixes issue15719.pdf and issue11242_reduced.pdf.\n applyStandardFontGlyphMap(map, getGlyphMapForStandardFonts());\n }\n }\n this.toFontChar = map;\n }\n\n amendFallbackToUnicode(properties);\n this.loadedName = fontName.split(\"-\")[0];\n }\n\n checkAndRepair(name, font, properties) {\n const VALID_TABLES = [\n \"OS/2\",\n \"cmap\",\n \"head\",\n \"hhea\",\n \"hmtx\",\n \"maxp\",\n \"name\",\n \"post\",\n \"loca\",\n \"glyf\",\n \"fpgm\",\n \"prep\",\n \"cvt \",\n \"CFF \",\n ];\n\n function readTables(file, numTables) {\n const tables = Object.create(null);\n tables[\"OS/2\"] = null;\n tables.cmap = null;\n tables.head = null;\n tables.hhea = null;\n tables.hmtx = null;\n tables.maxp = null;\n tables.name = null;\n tables.post = null;\n\n for (let i = 0; i < numTables; i++) {\n const table = readTableEntry(file);\n if (!VALID_TABLES.includes(table.tag)) {\n continue; // skipping table if it's not a required or optional table\n }\n if (table.length === 0) {\n continue; // skipping empty tables\n }\n tables[table.tag] = table;\n }\n return tables;\n }\n\n function readTableEntry(file) {\n const tag = file.getString(4);\n\n const checksum = file.getInt32() >>> 0;\n const offset = file.getInt32() >>> 0;\n const length = file.getInt32() >>> 0;\n\n // Read the table associated data\n const previousPosition = file.pos;\n file.pos = file.start || 0;\n file.skip(offset);\n const data = file.getBytes(length);\n file.pos = previousPosition;\n\n if (tag === \"head\") {\n // clearing checksum adjustment\n data[8] = data[9] = data[10] = data[11] = 0;\n data[17] |= 0x20; // Set font optimized for cleartype flag.\n }\n\n return {\n tag,\n checksum,\n length,\n offset,\n data,\n };\n }\n\n function readOpenTypeHeader(ttf) {\n return {\n version: ttf.getString(4),\n numTables: ttf.getUint16(),\n searchRange: ttf.getUint16(),\n entrySelector: ttf.getUint16(),\n rangeShift: ttf.getUint16(),\n };\n }\n\n function readTrueTypeCollectionHeader(ttc) {\n const ttcTag = ttc.getString(4);\n assert(ttcTag === \"ttcf\", \"Must be a TrueType Collection font.\");\n\n const majorVersion = ttc.getUint16();\n const minorVersion = ttc.getUint16();\n const numFonts = ttc.getInt32() >>> 0;\n const offsetTable = [];\n for (let i = 0; i < numFonts; i++) {\n offsetTable.push(ttc.getInt32() >>> 0);\n }\n\n const header = {\n ttcTag,\n majorVersion,\n minorVersion,\n numFonts,\n offsetTable,\n };\n switch (majorVersion) {\n case 1:\n return header;\n case 2:\n header.dsigTag = ttc.getInt32() >>> 0;\n header.dsigLength = ttc.getInt32() >>> 0;\n header.dsigOffset = ttc.getInt32() >>> 0;\n return header;\n }\n throw new FormatError(\n `Invalid TrueType Collection majorVersion: ${majorVersion}.`\n );\n }\n\n function readTrueTypeCollectionData(ttc, fontName) {\n const { numFonts, offsetTable } = readTrueTypeCollectionHeader(ttc);\n const fontNameParts = fontName.split(\"+\");\n let fallbackData;\n\n for (let i = 0; i < numFonts; i++) {\n ttc.pos = (ttc.start || 0) + offsetTable[i];\n const potentialHeader = readOpenTypeHeader(ttc);\n const potentialTables = readTables(ttc, potentialHeader.numTables);\n\n if (!potentialTables.name) {\n throw new FormatError(\n 'TrueType Collection font must contain a \"name\" table.'\n );\n }\n const [nameTable] = readNameTable(potentialTables.name);\n\n for (let j = 0, jj = nameTable.length; j < jj; j++) {\n for (let k = 0, kk = nameTable[j].length; k < kk; k++) {\n const nameEntry = nameTable[j][k]?.replaceAll(/\\s/g, \"\");\n if (!nameEntry) {\n continue;\n }\n if (nameEntry === fontName) {\n return {\n header: potentialHeader,\n tables: potentialTables,\n };\n }\n if (fontNameParts.length < 2) {\n continue;\n }\n for (const part of fontNameParts) {\n if (nameEntry === part) {\n fallbackData = {\n name: part,\n header: potentialHeader,\n tables: potentialTables,\n };\n }\n }\n }\n }\n }\n if (fallbackData) {\n warn(\n `TrueType Collection does not contain \"${fontName}\" font, ` +\n `falling back to \"${fallbackData.name}\" font instead.`\n );\n return {\n header: fallbackData.header,\n tables: fallbackData.tables,\n };\n }\n throw new FormatError(\n `TrueType Collection does not contain \"${fontName}\" font.`\n );\n }\n\n /**\n * Read the appropriate subtable from the cmap according to 9.6.6.4 from\n * PDF spec\n */\n function readCmapTable(cmap, file, isSymbolicFont, hasEncoding) {\n if (!cmap) {\n warn(\"No cmap table available.\");\n return {\n platformId: -1,\n encodingId: -1,\n mappings: [],\n hasShortCmap: false,\n };\n }\n let segment;\n let start = (file.start || 0) + cmap.offset;\n file.pos = start;\n\n file.skip(2); // version\n const numTables = file.getUint16();\n\n let potentialTable;\n let canBreak = false;\n // There's an order of preference in terms of which cmap subtable to\n // use:\n // - non-symbolic fonts the preference is a 3,1 table then a 1,0 table\n // - symbolic fonts the preference is a 3,0 table then a 1,0 table\n // The following takes advantage of the fact that the tables are sorted\n // to work.\n for (let i = 0; i < numTables; i++) {\n const platformId = file.getUint16();\n const encodingId = file.getUint16();\n const offset = file.getInt32() >>> 0;\n let useTable = false;\n\n // Sometimes there are multiple of the same type of table. Default\n // to choosing the first table and skip the rest.\n if (\n potentialTable?.platformId === platformId &&\n potentialTable?.encodingId === encodingId\n ) {\n continue;\n }\n\n if (\n platformId === 0 &&\n (encodingId === /* Unicode Default */ 0 ||\n encodingId === /* Unicode 1.1 */ 1 ||\n encodingId === /* Unicode BMP */ 3)\n ) {\n useTable = true;\n // Continue the loop since there still may be a higher priority\n // table.\n } else if (platformId === 1 && encodingId === 0) {\n useTable = true;\n // Continue the loop since there still may be a higher priority\n // table.\n } else if (\n platformId === 3 &&\n encodingId === 1 &&\n (hasEncoding || !potentialTable)\n ) {\n useTable = true;\n if (!isSymbolicFont) {\n canBreak = true;\n }\n } else if (isSymbolicFont && platformId === 3 && encodingId === 0) {\n useTable = true;\n\n let correctlySorted = true;\n if (i < numTables - 1) {\n const nextBytes = file.peekBytes(2),\n nextPlatformId = int16(nextBytes[0], nextBytes[1]);\n if (nextPlatformId < platformId) {\n correctlySorted = false;\n }\n }\n if (correctlySorted) {\n canBreak = true;\n }\n }\n\n if (useTable) {\n potentialTable = {\n platformId,\n encodingId,\n offset,\n };\n }\n if (canBreak) {\n break;\n }\n }\n\n if (potentialTable) {\n file.pos = start + potentialTable.offset;\n }\n if (!potentialTable || file.peekByte() === -1) {\n warn(\"Could not find a preferred cmap table.\");\n return {\n platformId: -1,\n encodingId: -1,\n mappings: [],\n hasShortCmap: false,\n };\n }\n\n const format = file.getUint16();\n let hasShortCmap = false;\n const mappings = [];\n let j, glyphId;\n\n // TODO(mack): refactor this cmap subtable reading logic out\n if (format === 0) {\n file.skip(2 + 2); // length + language\n\n for (j = 0; j < 256; j++) {\n const index = file.getByte();\n if (!index) {\n continue;\n }\n mappings.push({\n charCode: j,\n glyphId: index,\n });\n }\n hasShortCmap = true;\n } else if (format === 2) {\n file.skip(2 + 2); // length + language\n\n const subHeaderKeys = [];\n let maxSubHeaderKey = 0;\n // Read subHeaderKeys. If subHeaderKeys[i] === 0, then i is a\n // single-byte character. Otherwise, i is the first byte of a\n // multi-byte character, and the value is 8*index into\n // subHeaders.\n for (let i = 0; i < 256; i++) {\n const subHeaderKey = file.getUint16() >> 3;\n subHeaderKeys.push(subHeaderKey);\n maxSubHeaderKey = Math.max(subHeaderKey, maxSubHeaderKey);\n }\n // Read subHeaders. The number of entries is determined\n // dynamically based on the subHeaderKeys found above.\n const subHeaders = [];\n for (let i = 0; i <= maxSubHeaderKey; i++) {\n subHeaders.push({\n firstCode: file.getUint16(),\n entryCount: file.getUint16(),\n idDelta: signedInt16(file.getByte(), file.getByte()),\n idRangePos: file.pos + file.getUint16(),\n });\n }\n for (let i = 0; i < 256; i++) {\n if (subHeaderKeys[i] === 0) {\n // i is a single-byte code.\n file.pos = subHeaders[0].idRangePos + 2 * i;\n glyphId = file.getUint16();\n mappings.push({\n charCode: i,\n glyphId,\n });\n } else {\n // i is the first byte of a two-byte code.\n const s = subHeaders[subHeaderKeys[i]];\n for (j = 0; j < s.entryCount; j++) {\n const charCode = (i << 8) + j + s.firstCode;\n file.pos = s.idRangePos + 2 * j;\n glyphId = file.getUint16();\n if (glyphId !== 0) {\n glyphId = (glyphId + s.idDelta) % 65536;\n }\n mappings.push({\n charCode,\n glyphId,\n });\n }\n }\n }\n } else if (format === 4) {\n file.skip(2 + 2); // length + language\n\n // re-creating the table in format 4 since the encoding\n // might be changed\n const segCount = file.getUint16() >> 1;\n file.skip(6); // skipping range fields\n const segments = [];\n let segIndex;\n for (segIndex = 0; segIndex < segCount; segIndex++) {\n segments.push({ end: file.getUint16() });\n }\n file.skip(2);\n for (segIndex = 0; segIndex < segCount; segIndex++) {\n segments[segIndex].start = file.getUint16();\n }\n\n for (segIndex = 0; segIndex < segCount; segIndex++) {\n segments[segIndex].delta = file.getUint16();\n }\n\n let offsetsCount = 0,\n offsetIndex;\n for (segIndex = 0; segIndex < segCount; segIndex++) {\n segment = segments[segIndex];\n const rangeOffset = file.getUint16();\n if (!rangeOffset) {\n segment.offsetIndex = -1;\n continue;\n }\n\n offsetIndex = (rangeOffset >> 1) - (segCount - segIndex);\n segment.offsetIndex = offsetIndex;\n offsetsCount = Math.max(\n offsetsCount,\n offsetIndex + segment.end - segment.start + 1\n );\n }\n\n const offsets = [];\n for (j = 0; j < offsetsCount; j++) {\n offsets.push(file.getUint16());\n }\n\n for (segIndex = 0; segIndex < segCount; segIndex++) {\n segment = segments[segIndex];\n start = segment.start;\n const end = segment.end;\n const delta = segment.delta;\n offsetIndex = segment.offsetIndex;\n\n for (j = start; j <= end; j++) {\n if (j === 0xffff) {\n continue;\n }\n\n glyphId = offsetIndex < 0 ? j : offsets[offsetIndex + j - start];\n glyphId = (glyphId + delta) & 0xffff;\n mappings.push({\n charCode: j,\n glyphId,\n });\n }\n }\n } else if (format === 6) {\n file.skip(2 + 2); // length + language\n\n // Format 6 is a 2-bytes dense mapping, which means the font data\n // lives glue together even if they are pretty far in the unicode\n // table. (This looks weird, so I can have missed something), this\n // works on Linux but seems to fails on Mac so let's rewrite the\n // cmap table to a 3-1-4 style\n const firstCode = file.getUint16();\n const entryCount = file.getUint16();\n\n for (j = 0; j < entryCount; j++) {\n glyphId = file.getUint16();\n const charCode = firstCode + j;\n\n mappings.push({\n charCode,\n glyphId,\n });\n }\n } else if (format === 12) {\n file.skip(2 + 4 + 4); // reserved + length + language\n\n const nGroups = file.getInt32() >>> 0;\n for (j = 0; j < nGroups; j++) {\n const startCharCode = file.getInt32() >>> 0;\n const endCharCode = file.getInt32() >>> 0;\n let glyphCode = file.getInt32() >>> 0;\n\n for (\n let charCode = startCharCode;\n charCode <= endCharCode;\n charCode++\n ) {\n mappings.push({\n charCode,\n glyphId: glyphCode++,\n });\n }\n }\n } else {\n warn(\"cmap table has unsupported format: \" + format);\n return {\n platformId: -1,\n encodingId: -1,\n mappings: [],\n hasShortCmap: false,\n };\n }\n\n // removing duplicate entries\n mappings.sort(function (a, b) {\n return a.charCode - b.charCode;\n });\n for (let i = 1; i < mappings.length; i++) {\n if (mappings[i - 1].charCode === mappings[i].charCode) {\n mappings.splice(i, 1);\n i--;\n }\n }\n\n return {\n platformId: potentialTable.platformId,\n encodingId: potentialTable.encodingId,\n mappings,\n hasShortCmap,\n };\n }\n\n function sanitizeMetrics(\n file,\n header,\n metrics,\n headTable,\n numGlyphs,\n dupFirstEntry\n ) {\n if (!header) {\n if (metrics) {\n metrics.data = null;\n }\n return;\n }\n\n file.pos = (file.start || 0) + header.offset;\n file.pos += 4; // version\n file.pos += 2; // ascent\n file.pos += 2; // descent\n file.pos += 2; // linegap\n file.pos += 2; // adv_width_max\n file.pos += 2; // min_sb1\n file.pos += 2; // min_sb2\n file.pos += 2; // max_extent\n file.pos += 2; // caret_slope_rise\n file.pos += 2; // caret_slope_run\n const caretOffset = file.getUint16();\n file.pos += 8; // reserved\n file.pos += 2; // format\n let numOfMetrics = file.getUint16();\n\n if (caretOffset !== 0) {\n const macStyle = int16(headTable.data[44], headTable.data[45]);\n if (!(macStyle & 2)) {\n // Suppress OTS warnings about the `caretOffset` in the hhea-table.\n header.data[22] = 0;\n header.data[23] = 0;\n }\n }\n\n if (numOfMetrics > numGlyphs) {\n info(\n `The numOfMetrics (${numOfMetrics}) should not be ` +\n `greater than the numGlyphs (${numGlyphs}).`\n );\n // Reduce numOfMetrics if it is greater than numGlyphs\n numOfMetrics = numGlyphs;\n header.data[34] = (numOfMetrics & 0xff00) >> 8;\n header.data[35] = numOfMetrics & 0x00ff;\n }\n\n const numOfSidebearings = numGlyphs - numOfMetrics;\n const numMissing =\n numOfSidebearings - ((metrics.length - numOfMetrics * 4) >> 1);\n\n if (numMissing > 0) {\n // For each missing glyph, we set both the width and lsb to 0 (zero).\n // Since we need to add two properties for each glyph, this explains\n // the use of |numMissing * 2| when initializing the typed array.\n const entries = new Uint8Array(metrics.length + numMissing * 2);\n entries.set(metrics.data);\n if (dupFirstEntry) {\n // Set the sidebearing value of the duplicated glyph.\n entries[metrics.length] = metrics.data[2];\n entries[metrics.length + 1] = metrics.data[3];\n }\n metrics.data = entries;\n }\n }\n\n function sanitizeGlyph(\n source,\n sourceStart,\n sourceEnd,\n dest,\n destStart,\n hintsValid\n ) {\n const glyphProfile = {\n length: 0,\n sizeOfInstructions: 0,\n };\n if (\n sourceStart < 0 ||\n sourceStart >= source.length ||\n sourceEnd > source.length ||\n sourceEnd - sourceStart <= 12\n ) {\n // If the offsets are wrong or the glyph is too small, remove it.\n return glyphProfile;\n }\n const glyf = source.subarray(sourceStart, sourceEnd);\n\n // Sanitize the glyph bounding box.\n const xMin = signedInt16(glyf[2], glyf[3]);\n const yMin = signedInt16(glyf[4], glyf[5]);\n const xMax = signedInt16(glyf[6], glyf[7]);\n const yMax = signedInt16(glyf[8], glyf[9]);\n\n if (xMin > xMax) {\n writeSignedInt16(glyf, 2, xMax);\n writeSignedInt16(glyf, 6, xMin);\n }\n if (yMin > yMax) {\n writeSignedInt16(glyf, 4, yMax);\n writeSignedInt16(glyf, 8, yMin);\n }\n\n const contoursCount = signedInt16(glyf[0], glyf[1]);\n if (contoursCount < 0) {\n if (contoursCount < -1) {\n // OTS doesn't like contour count to be less than -1.\n // The glyph data offsets are very likely wrong and\n // having something lower than -1, very likely, implies\n // to have some garbage data.\n return glyphProfile;\n }\n // complex glyph, writing as is\n dest.set(glyf, destStart);\n glyphProfile.length = glyf.length;\n return glyphProfile;\n }\n\n let i,\n j = 10,\n flagsCount = 0;\n for (i = 0; i < contoursCount; i++) {\n const endPoint = (glyf[j] << 8) | glyf[j + 1];\n flagsCount = endPoint + 1;\n j += 2;\n }\n // skipping instructions\n const instructionsStart = j;\n const instructionsLength = (glyf[j] << 8) | glyf[j + 1];\n glyphProfile.sizeOfInstructions = instructionsLength;\n j += 2 + instructionsLength;\n const instructionsEnd = j;\n // validating flags\n let coordinatesLength = 0;\n for (i = 0; i < flagsCount; i++) {\n const flag = glyf[j++];\n if (flag & 0xc0) {\n // reserved flags must be zero, cleaning up\n glyf[j - 1] = flag & 0x3f;\n }\n let xLength = 2;\n if (flag & 2) {\n xLength = 1;\n } else if (flag & 16) {\n xLength = 0;\n }\n let yLength = 2;\n if (flag & 4) {\n yLength = 1;\n } else if (flag & 32) {\n yLength = 0;\n }\n const xyLength = xLength + yLength;\n coordinatesLength += xyLength;\n if (flag & 8) {\n const repeat = glyf[j++];\n if (repeat === 0) {\n // The repeat count should be non-zero when the repeat flag is set.\n glyf[j - 1] ^= 8;\n }\n i += repeat;\n coordinatesLength += repeat * xyLength;\n }\n }\n // glyph without coordinates will be rejected\n if (coordinatesLength === 0) {\n return glyphProfile;\n }\n let glyphDataLength = j + coordinatesLength;\n if (glyphDataLength > glyf.length) {\n // not enough data for coordinates\n return glyphProfile;\n }\n if (!hintsValid && instructionsLength > 0) {\n dest.set(glyf.subarray(0, instructionsStart), destStart);\n dest.set([0, 0], destStart + instructionsStart);\n dest.set(\n glyf.subarray(instructionsEnd, glyphDataLength),\n destStart + instructionsStart + 2\n );\n glyphDataLength -= instructionsLength;\n if (glyf.length - glyphDataLength > 3) {\n glyphDataLength = (glyphDataLength + 3) & ~3;\n }\n glyphProfile.length = glyphDataLength;\n return glyphProfile;\n }\n if (glyf.length - glyphDataLength > 3) {\n // truncating and aligning to 4 bytes the long glyph data\n glyphDataLength = (glyphDataLength + 3) & ~3;\n dest.set(glyf.subarray(0, glyphDataLength), destStart);\n glyphProfile.length = glyphDataLength;\n return glyphProfile;\n }\n // glyph data is fine\n dest.set(glyf, destStart);\n glyphProfile.length = glyf.length;\n return glyphProfile;\n }\n\n function sanitizeHead(head, numGlyphs, locaLength) {\n const data = head.data;\n\n // Validate version:\n // Should always be 0x00010000\n const version = int32(data[0], data[1], data[2], data[3]);\n if (version >> 16 !== 1) {\n info(\"Attempting to fix invalid version in head table: \" + version);\n data[0] = 0;\n data[1] = 1;\n data[2] = 0;\n data[3] = 0;\n }\n\n const indexToLocFormat = int16(data[50], data[51]);\n if (indexToLocFormat < 0 || indexToLocFormat > 1) {\n info(\n \"Attempting to fix invalid indexToLocFormat in head table: \" +\n indexToLocFormat\n );\n\n // The value of indexToLocFormat should be 0 if the loca table\n // consists of short offsets, and should be 1 if the loca table\n // consists of long offsets.\n //\n // The number of entries in the loca table should be numGlyphs + 1.\n //\n // Using this information, we can work backwards to deduce if the\n // size of each offset in the loca table, and thus figure out the\n // appropriate value for indexToLocFormat.\n\n const numGlyphsPlusOne = numGlyphs + 1;\n if (locaLength === numGlyphsPlusOne << 1) {\n // 0x0000 indicates the loca table consists of short offsets\n data[50] = 0;\n data[51] = 0;\n } else if (locaLength === numGlyphsPlusOne << 2) {\n // 0x0001 indicates the loca table consists of long offsets\n data[50] = 0;\n data[51] = 1;\n } else {\n throw new FormatError(\n \"Could not fix indexToLocFormat: \" + indexToLocFormat\n );\n }\n }\n }\n\n function sanitizeGlyphLocations(\n loca,\n glyf,\n numGlyphs,\n isGlyphLocationsLong,\n hintsValid,\n dupFirstEntry,\n maxSizeOfInstructions\n ) {\n let itemSize, itemDecode, itemEncode;\n if (isGlyphLocationsLong) {\n itemSize = 4;\n itemDecode = function fontItemDecodeLong(data, offset) {\n return (\n (data[offset] << 24) |\n (data[offset + 1] << 16) |\n (data[offset + 2] << 8) |\n data[offset + 3]\n );\n };\n itemEncode = function fontItemEncodeLong(data, offset, value) {\n data[offset] = (value >>> 24) & 0xff;\n data[offset + 1] = (value >> 16) & 0xff;\n data[offset + 2] = (value >> 8) & 0xff;\n data[offset + 3] = value & 0xff;\n };\n } else {\n itemSize = 2;\n itemDecode = function fontItemDecode(data, offset) {\n return (data[offset] << 9) | (data[offset + 1] << 1);\n };\n itemEncode = function fontItemEncode(data, offset, value) {\n data[offset] = (value >> 9) & 0xff;\n data[offset + 1] = (value >> 1) & 0xff;\n };\n }\n // The first glyph is duplicated.\n const numGlyphsOut = dupFirstEntry ? numGlyphs + 1 : numGlyphs;\n const locaDataSize = itemSize * (1 + numGlyphsOut);\n // Resize loca table to account for duplicated glyph.\n const locaData = new Uint8Array(locaDataSize);\n locaData.set(loca.data.subarray(0, locaDataSize));\n loca.data = locaData;\n // removing the invalid glyphs\n const oldGlyfData = glyf.data;\n const oldGlyfDataLength = oldGlyfData.length;\n const newGlyfData = new Uint8Array(oldGlyfDataLength);\n\n // The spec says the offsets should be in ascending order, however\n // this is not true for some fonts or they use the offset of 0 to mark a\n // glyph as missing. OTS requires the offsets to be in order and not to\n // be zero, so we must sort and rebuild the loca table and potentially\n // re-arrange the glyf data.\n let i, j;\n const locaEntries = [];\n // There are numGlyphs + 1 loca table entries.\n for (i = 0, j = 0; i < numGlyphs + 1; i++, j += itemSize) {\n let offset = itemDecode(locaData, j);\n if (offset > oldGlyfDataLength) {\n offset = oldGlyfDataLength;\n }\n locaEntries.push({\n index: i,\n offset,\n endOffset: 0,\n });\n }\n locaEntries.sort((a, b) => {\n return a.offset - b.offset;\n });\n // Now the offsets are sorted, calculate the end offset of each glyph.\n // The last loca entry's endOffset is not calculated since it's the end\n // of the data and will be stored on the previous entry's endOffset.\n for (i = 0; i < numGlyphs; i++) {\n locaEntries[i].endOffset = locaEntries[i + 1].offset;\n }\n // Re-sort so glyphs aren't out of order.\n locaEntries.sort((a, b) => {\n return a.index - b.index;\n });\n // Calculate the endOffset of the \"first\" glyph correctly when there are\n // *multiple* empty ones at the start of the data (fixes issue14618.pdf).\n for (i = 0; i < numGlyphs; i++) {\n const { offset, endOffset } = locaEntries[i];\n if (offset !== 0 || endOffset !== 0) {\n break;\n }\n const nextOffset = locaEntries[i + 1].offset;\n if (nextOffset === 0) {\n continue;\n }\n locaEntries[i].endOffset = nextOffset;\n break;\n }\n\n const missingGlyphs = Object.create(null);\n let writeOffset = 0;\n itemEncode(locaData, 0, writeOffset);\n for (i = 0, j = itemSize; i < numGlyphs; i++, j += itemSize) {\n const glyphProfile = sanitizeGlyph(\n oldGlyfData,\n locaEntries[i].offset,\n locaEntries[i].endOffset,\n newGlyfData,\n writeOffset,\n hintsValid\n );\n const newLength = glyphProfile.length;\n if (newLength === 0) {\n missingGlyphs[i] = true;\n }\n if (glyphProfile.sizeOfInstructions > maxSizeOfInstructions) {\n maxSizeOfInstructions = glyphProfile.sizeOfInstructions;\n }\n writeOffset += newLength;\n itemEncode(locaData, j, writeOffset);\n }\n\n if (writeOffset === 0) {\n // glyf table cannot be empty -- redoing the glyf and loca tables\n // to have single glyph with one point\n const simpleGlyph = new Uint8Array([\n 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0,\n ]);\n for (i = 0, j = itemSize; i < numGlyphsOut; i++, j += itemSize) {\n itemEncode(locaData, j, simpleGlyph.length);\n }\n glyf.data = simpleGlyph;\n } else if (dupFirstEntry) {\n // Browsers will not display a glyph at position 0. Typically glyph 0\n // is notdef, but a number of fonts put a valid glyph there so it must\n // be duplicated and appended.\n const firstEntryLength = itemDecode(locaData, itemSize);\n if (newGlyfData.length > firstEntryLength + writeOffset) {\n glyf.data = newGlyfData.subarray(0, firstEntryLength + writeOffset);\n } else {\n glyf.data = new Uint8Array(firstEntryLength + writeOffset);\n glyf.data.set(newGlyfData.subarray(0, writeOffset));\n }\n glyf.data.set(newGlyfData.subarray(0, firstEntryLength), writeOffset);\n itemEncode(\n loca.data,\n locaData.length - itemSize,\n writeOffset + firstEntryLength\n );\n } else {\n glyf.data = newGlyfData.subarray(0, writeOffset);\n }\n return {\n missingGlyphs,\n maxSizeOfInstructions,\n };\n }\n\n function readPostScriptTable(post, propertiesObj, maxpNumGlyphs) {\n const start = (font.start || 0) + post.offset;\n font.pos = start;\n\n const length = post.length,\n end = start + length;\n const version = font.getInt32();\n // skip rest to the tables\n font.skip(28);\n\n let glyphNames;\n let valid = true;\n let i;\n\n switch (version) {\n case 0x00010000:\n glyphNames = MacStandardGlyphOrdering;\n break;\n case 0x00020000:\n const numGlyphs = font.getUint16();\n if (numGlyphs !== maxpNumGlyphs) {\n valid = false;\n break;\n }\n const glyphNameIndexes = [];\n for (i = 0; i < numGlyphs; ++i) {\n const index = font.getUint16();\n if (index >= 32768) {\n valid = false;\n break;\n }\n glyphNameIndexes.push(index);\n }\n if (!valid) {\n break;\n }\n const customNames = [],\n strBuf = [];\n while (font.pos < end) {\n const stringLength = font.getByte();\n strBuf.length = stringLength;\n for (i = 0; i < stringLength; ++i) {\n strBuf[i] = String.fromCharCode(font.getByte());\n }\n customNames.push(strBuf.join(\"\"));\n }\n glyphNames = [];\n for (i = 0; i < numGlyphs; ++i) {\n const j = glyphNameIndexes[i];\n if (j < 258) {\n glyphNames.push(MacStandardGlyphOrdering[j]);\n continue;\n }\n glyphNames.push(customNames[j - 258]);\n }\n break;\n case 0x00030000:\n break;\n default:\n warn(\"Unknown/unsupported post table version \" + version);\n valid = false;\n if (propertiesObj.defaultEncoding) {\n glyphNames = propertiesObj.defaultEncoding;\n }\n break;\n }\n propertiesObj.glyphNames = glyphNames;\n return valid;\n }\n\n function readNameTable(nameTable) {\n const start = (font.start || 0) + nameTable.offset;\n font.pos = start;\n\n const names = [[], []],\n records = [];\n const length = nameTable.length,\n end = start + length;\n const format = font.getUint16();\n const FORMAT_0_HEADER_LENGTH = 6;\n if (format !== 0 || length < FORMAT_0_HEADER_LENGTH) {\n // unsupported name table format or table \"too\" small\n return [names, records];\n }\n const numRecords = font.getUint16();\n const stringsStart = font.getUint16();\n const NAME_RECORD_LENGTH = 12;\n let i, ii;\n\n for (i = 0; i < numRecords && font.pos + NAME_RECORD_LENGTH <= end; i++) {\n const r = {\n platform: font.getUint16(),\n encoding: font.getUint16(),\n language: font.getUint16(),\n name: font.getUint16(),\n length: font.getUint16(),\n offset: font.getUint16(),\n };\n // using only Macintosh and Windows platform/encoding names\n if (isMacNameRecord(r) || isWinNameRecord(r)) {\n records.push(r);\n }\n }\n for (i = 0, ii = records.length; i < ii; i++) {\n const record = records[i];\n if (record.length <= 0) {\n continue; // Nothing to process, ignoring.\n }\n const pos = start + stringsStart + record.offset;\n if (pos + record.length > end) {\n continue; // outside of name table, ignoring\n }\n font.pos = pos;\n const nameIndex = record.name;\n if (record.encoding) {\n // unicode\n let str = \"\";\n for (let j = 0, jj = record.length; j < jj; j += 2) {\n str += String.fromCharCode(font.getUint16());\n }\n names[1][nameIndex] = str;\n } else {\n names[0][nameIndex] = font.getString(record.length);\n }\n }\n return [names, records];\n }\n\n // prettier-ignore\n const TTOpsStackDeltas = [\n 0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, 0, 0, -2, -5,\n -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, -1,\n 1, -1, -999, 0, 1, 0, -1, -2, 0, -1, -2, -1, -1, 0, -1, -1,\n 0, 0, -999, -999, -1, -1, -1, -1, -2, -999, -2, -2, -999, 0, -2, -2,\n 0, 0, -2, 0, -2, 0, 0, 0, -2, -1, -1, 1, 1, 0, 0, -1,\n -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, 0, -999, -1, -1,\n -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n -2, -999, -999, -999, -999, -999, -1, -1, -2, -2, 0, 0, 0, 0, -1, -1,\n -999, -2, -2, 0, 0, -1, -2, -2, 0, 0, 0, -1, -1, -1, -2];\n // 0xC0-DF == -1 and 0xE0-FF == -2\n\n function sanitizeTTProgram(table, ttContext) {\n let data = table.data;\n let i = 0,\n j,\n n,\n b,\n funcId,\n pc,\n lastEndf = 0,\n lastDeff = 0;\n const stack = [];\n const callstack = [];\n const functionsCalled = [];\n let tooComplexToFollowFunctions = ttContext.tooComplexToFollowFunctions;\n let inFDEF = false,\n ifLevel = 0,\n inELSE = 0;\n for (let ii = data.length; i < ii; ) {\n const op = data[i++];\n // The TrueType instruction set docs can be found at\n // https://developer.apple.com/fonts/TTRefMan/RM05/Chap5.html\n if (op === 0x40) {\n // NPUSHB - pushes n bytes\n n = data[i++];\n if (inFDEF || inELSE) {\n i += n;\n } else {\n for (j = 0; j < n; j++) {\n stack.push(data[i++]);\n }\n }\n } else if (op === 0x41) {\n // NPUSHW - pushes n words\n n = data[i++];\n if (inFDEF || inELSE) {\n i += n * 2;\n } else {\n for (j = 0; j < n; j++) {\n b = data[i++];\n stack.push((b << 8) | data[i++]);\n }\n }\n } else if ((op & 0xf8) === 0xb0) {\n // PUSHB - pushes bytes\n n = op - 0xb0 + 1;\n if (inFDEF || inELSE) {\n i += n;\n } else {\n for (j = 0; j < n; j++) {\n stack.push(data[i++]);\n }\n }\n } else if ((op & 0xf8) === 0xb8) {\n // PUSHW - pushes words\n n = op - 0xb8 + 1;\n if (inFDEF || inELSE) {\n i += n * 2;\n } else {\n for (j = 0; j < n; j++) {\n b = data[i++];\n stack.push((b << 8) | data[i++]);\n }\n }\n } else if (op === 0x2b && !tooComplexToFollowFunctions) {\n // CALL\n if (!inFDEF && !inELSE) {\n // collecting information about which functions are used\n funcId = stack.at(-1);\n if (isNaN(funcId)) {\n info(\"TT: CALL empty stack (or invalid entry).\");\n } else {\n ttContext.functionsUsed[funcId] = true;\n if (funcId in ttContext.functionsStackDeltas) {\n const newStackLength =\n stack.length + ttContext.functionsStackDeltas[funcId];\n if (newStackLength < 0) {\n warn(\"TT: CALL invalid functions stack delta.\");\n ttContext.hintsValid = false;\n return;\n }\n stack.length = newStackLength;\n } else if (\n funcId in ttContext.functionsDefined &&\n !functionsCalled.includes(funcId)\n ) {\n callstack.push({ data, i, stackTop: stack.length - 1 });\n functionsCalled.push(funcId);\n pc = ttContext.functionsDefined[funcId];\n if (!pc) {\n warn(\"TT: CALL non-existent function\");\n ttContext.hintsValid = false;\n return;\n }\n data = pc.data;\n i = pc.i;\n }\n }\n }\n } else if (op === 0x2c && !tooComplexToFollowFunctions) {\n // FDEF\n if (inFDEF || inELSE) {\n warn(\"TT: nested FDEFs not allowed\");\n tooComplexToFollowFunctions = true;\n }\n inFDEF = true;\n // collecting information about which functions are defined\n lastDeff = i;\n funcId = stack.pop();\n ttContext.functionsDefined[funcId] = { data, i };\n } else if (op === 0x2d) {\n // ENDF - end of function\n if (inFDEF) {\n inFDEF = false;\n lastEndf = i;\n } else {\n pc = callstack.pop();\n if (!pc) {\n warn(\"TT: ENDF bad stack\");\n ttContext.hintsValid = false;\n return;\n }\n funcId = functionsCalled.pop();\n data = pc.data;\n i = pc.i;\n ttContext.functionsStackDeltas[funcId] = stack.length - pc.stackTop;\n }\n } else if (op === 0x89) {\n // IDEF - instruction definition\n if (inFDEF || inELSE) {\n warn(\"TT: nested IDEFs not allowed\");\n tooComplexToFollowFunctions = true;\n }\n inFDEF = true;\n // recording it as a function to track ENDF\n lastDeff = i;\n } else if (op === 0x58) {\n // IF\n ++ifLevel;\n } else if (op === 0x1b) {\n // ELSE\n inELSE = ifLevel;\n } else if (op === 0x59) {\n // EIF\n if (inELSE === ifLevel) {\n inELSE = 0;\n }\n --ifLevel;\n } else if (op === 0x1c) {\n // JMPR\n if (!inFDEF && !inELSE) {\n const offset = stack.at(-1);\n // only jumping forward to prevent infinite loop\n if (offset > 0) {\n i += offset - 1;\n }\n }\n }\n // Adjusting stack not extactly, but just enough to get function id\n if (!inFDEF && !inELSE) {\n let stackDelta = 0;\n if (op <= 0x8e) {\n stackDelta = TTOpsStackDeltas[op];\n } else if (op >= 0xc0 && op <= 0xdf) {\n stackDelta = -1;\n } else if (op >= 0xe0) {\n stackDelta = -2;\n }\n if (op >= 0x71 && op <= 0x75) {\n n = stack.pop();\n if (!isNaN(n)) {\n stackDelta = -n * 2;\n }\n }\n while (stackDelta < 0 && stack.length > 0) {\n stack.pop();\n stackDelta++;\n }\n while (stackDelta > 0) {\n stack.push(NaN); // pushing any number into stack\n stackDelta--;\n }\n }\n }\n ttContext.tooComplexToFollowFunctions = tooComplexToFollowFunctions;\n const content = [data];\n if (i > data.length) {\n content.push(new Uint8Array(i - data.length));\n }\n if (lastDeff > lastEndf) {\n warn(\"TT: complementing a missing function tail\");\n // new function definition started, but not finished\n // complete function by [CLEAR, ENDF]\n content.push(new Uint8Array([0x22, 0x2d]));\n }\n foldTTTable(table, content);\n }\n\n function checkInvalidFunctions(ttContext, maxFunctionDefs) {\n if (ttContext.tooComplexToFollowFunctions) {\n return;\n }\n if (ttContext.functionsDefined.length > maxFunctionDefs) {\n warn(\"TT: more functions defined than expected\");\n ttContext.hintsValid = false;\n return;\n }\n for (let j = 0, jj = ttContext.functionsUsed.length; j < jj; j++) {\n if (j > maxFunctionDefs) {\n warn(\"TT: invalid function id: \" + j);\n ttContext.hintsValid = false;\n return;\n }\n if (ttContext.functionsUsed[j] && !ttContext.functionsDefined[j]) {\n warn(\"TT: undefined function: \" + j);\n ttContext.hintsValid = false;\n return;\n }\n }\n }\n\n function foldTTTable(table, content) {\n if (content.length > 1) {\n // concatenating the content items\n let newLength = 0;\n let j, jj;\n for (j = 0, jj = content.length; j < jj; j++) {\n newLength += content[j].length;\n }\n newLength = (newLength + 3) & ~3;\n const result = new Uint8Array(newLength);\n let pos = 0;\n for (j = 0, jj = content.length; j < jj; j++) {\n result.set(content[j], pos);\n pos += content[j].length;\n }\n table.data = result;\n table.length = newLength;\n }\n }\n\n function sanitizeTTPrograms(fpgm, prep, cvt, maxFunctionDefs) {\n const ttContext = {\n functionsDefined: [],\n functionsUsed: [],\n functionsStackDeltas: [],\n tooComplexToFollowFunctions: false,\n hintsValid: true,\n };\n if (fpgm) {\n sanitizeTTProgram(fpgm, ttContext);\n }\n if (prep) {\n sanitizeTTProgram(prep, ttContext);\n }\n if (fpgm) {\n checkInvalidFunctions(ttContext, maxFunctionDefs);\n }\n if (cvt && cvt.length & 1) {\n const cvtData = new Uint8Array(cvt.length + 1);\n cvtData.set(cvt.data);\n cvt.data = cvtData;\n }\n return ttContext.hintsValid;\n }\n\n // The following steps modify the original font data, making copy\n font = new Stream(new Uint8Array(font.getBytes()));\n\n let header, tables;\n if (isTrueTypeCollectionFile(font)) {\n const ttcData = readTrueTypeCollectionData(font, this.name);\n header = ttcData.header;\n tables = ttcData.tables;\n } else {\n header = readOpenTypeHeader(font);\n tables = readTables(font, header.numTables);\n }\n let cff, cffFile;\n\n const isTrueType = !tables[\"CFF \"];\n if (!isTrueType) {\n const isComposite =\n properties.composite &&\n (properties.cidToGidMap?.length > 0 ||\n !(properties.cMap instanceof IdentityCMap));\n // OpenType font (skip composite fonts with non-default glyph mapping).\n if (\n (header.version === \"OTTO\" && !isComposite) ||\n !tables.head ||\n !tables.hhea ||\n !tables.maxp ||\n !tables.post\n ) {\n // No major tables: throwing everything at `CFFFont`.\n cffFile = new Stream(tables[\"CFF \"].data);\n cff = new CFFFont(cffFile, properties);\n\n adjustWidths(properties);\n\n return this.convert(name, cff, properties);\n }\n\n delete tables.glyf;\n delete tables.loca;\n delete tables.fpgm;\n delete tables.prep;\n delete tables[\"cvt \"];\n this.isOpenType = true;\n } else {\n if (!tables.loca) {\n throw new FormatError('Required \"loca\" table is not found');\n }\n if (!tables.glyf) {\n warn('Required \"glyf\" table is not found -- trying to recover.');\n // Note: We use `sanitizeGlyphLocations` to add dummy glyf data below.\n tables.glyf = {\n tag: \"glyf\",\n data: new Uint8Array(0),\n };\n }\n this.isOpenType = false;\n }\n\n if (!tables.maxp) {\n throw new FormatError('Required \"maxp\" table is not found');\n }\n\n font.pos = (font.start || 0) + tables.maxp.offset;\n let version = font.getInt32();\n const numGlyphs = font.getUint16();\n\n if (version !== 0x00010000 && version !== 0x00005000) {\n // https://learn.microsoft.com/en-us/typography/opentype/spec/maxp\n if (tables.maxp.length === 6) {\n version = 0x0005000;\n } else if (tables.maxp.length >= 32) {\n version = 0x00010000;\n } else {\n throw new FormatError(`\"maxp\" table has a wrong version number`);\n }\n writeUint32(tables.maxp.data, 0, version);\n }\n\n if (properties.scaleFactors?.length === numGlyphs && isTrueType) {\n const { scaleFactors } = properties;\n const isGlyphLocationsLong = int16(\n tables.head.data[50],\n tables.head.data[51]\n );\n\n const glyphs = new GlyfTable({\n glyfTable: tables.glyf.data,\n isGlyphLocationsLong,\n locaTable: tables.loca.data,\n numGlyphs,\n });\n glyphs.scale(scaleFactors);\n\n const { glyf, loca, isLocationLong } = glyphs.write();\n tables.glyf.data = glyf;\n tables.loca.data = loca;\n\n if (isLocationLong !== !!isGlyphLocationsLong) {\n tables.head.data[50] = 0;\n tables.head.data[51] = isLocationLong ? 1 : 0;\n }\n\n const metrics = tables.hmtx.data;\n\n for (let i = 0; i < numGlyphs; i++) {\n const j = 4 * i;\n const advanceWidth = Math.round(\n scaleFactors[i] * int16(metrics[j], metrics[j + 1])\n );\n metrics[j] = (advanceWidth >> 8) & 0xff;\n metrics[j + 1] = advanceWidth & 0xff;\n const lsb = Math.round(\n scaleFactors[i] * signedInt16(metrics[j + 2], metrics[j + 3])\n );\n writeSignedInt16(metrics, j + 2, lsb);\n }\n }\n\n // Glyph 0 is duplicated and appended.\n let numGlyphsOut = numGlyphs + 1;\n let dupFirstEntry = true;\n if (numGlyphsOut > 0xffff) {\n dupFirstEntry = false;\n numGlyphsOut = numGlyphs;\n warn(\"Not enough space in glyfs to duplicate first glyph.\");\n }\n let maxFunctionDefs = 0;\n let maxSizeOfInstructions = 0;\n if (version >= 0x00010000 && tables.maxp.length >= 32) {\n // maxZones can be invalid\n font.pos += 8;\n const maxZones = font.getUint16();\n if (maxZones > 2) {\n // reset to 2 if font has invalid maxZones\n tables.maxp.data[14] = 0;\n tables.maxp.data[15] = 2;\n }\n font.pos += 4;\n maxFunctionDefs = font.getUint16();\n font.pos += 4;\n maxSizeOfInstructions = font.getUint16();\n }\n\n tables.maxp.data[4] = numGlyphsOut >> 8;\n tables.maxp.data[5] = numGlyphsOut & 255;\n\n const hintsValid = sanitizeTTPrograms(\n tables.fpgm,\n tables.prep,\n tables[\"cvt \"],\n maxFunctionDefs\n );\n if (!hintsValid) {\n delete tables.fpgm;\n delete tables.prep;\n delete tables[\"cvt \"];\n }\n\n // Ensure the hmtx table contains the advance width and\n // sidebearings information for numGlyphs in the maxp table\n sanitizeMetrics(\n font,\n tables.hhea,\n tables.hmtx,\n tables.head,\n numGlyphsOut,\n dupFirstEntry\n );\n\n if (!tables.head) {\n throw new FormatError('Required \"head\" table is not found');\n }\n\n sanitizeHead(tables.head, numGlyphs, isTrueType ? tables.loca.length : 0);\n\n let missingGlyphs = Object.create(null);\n if (isTrueType) {\n const isGlyphLocationsLong = int16(\n tables.head.data[50],\n tables.head.data[51]\n );\n const glyphsInfo = sanitizeGlyphLocations(\n tables.loca,\n tables.glyf,\n numGlyphs,\n isGlyphLocationsLong,\n hintsValid,\n dupFirstEntry,\n maxSizeOfInstructions\n );\n missingGlyphs = glyphsInfo.missingGlyphs;\n\n // Some fonts have incorrect maxSizeOfInstructions values, so we use\n // the computed value instead.\n if (version >= 0x00010000 && tables.maxp.length >= 32) {\n tables.maxp.data[26] = glyphsInfo.maxSizeOfInstructions >> 8;\n tables.maxp.data[27] = glyphsInfo.maxSizeOfInstructions & 255;\n }\n }\n if (!tables.hhea) {\n throw new FormatError('Required \"hhea\" table is not found');\n }\n\n // Sanitizer reduces the glyph advanceWidth to the maxAdvanceWidth\n // Sometimes it's 0. That needs to be fixed\n if (tables.hhea.data[10] === 0 && tables.hhea.data[11] === 0) {\n tables.hhea.data[10] = 0xff;\n tables.hhea.data[11] = 0xff;\n }\n\n // Extract some more font properties from the OpenType head and\n // hhea tables; yMin and descent value are always negative.\n const metricsOverride = {\n unitsPerEm: int16(tables.head.data[18], tables.head.data[19]),\n yMax: signedInt16(tables.head.data[42], tables.head.data[43]),\n yMin: signedInt16(tables.head.data[38], tables.head.data[39]),\n ascent: signedInt16(tables.hhea.data[4], tables.hhea.data[5]),\n descent: signedInt16(tables.hhea.data[6], tables.hhea.data[7]),\n lineGap: signedInt16(tables.hhea.data[8], tables.hhea.data[9]),\n };\n\n // PDF FontDescriptor metrics lie -- using data from actual font.\n this.ascent = metricsOverride.ascent / metricsOverride.unitsPerEm;\n this.descent = metricsOverride.descent / metricsOverride.unitsPerEm;\n this.lineGap = metricsOverride.lineGap / metricsOverride.unitsPerEm;\n\n if (this.cssFontInfo?.lineHeight) {\n this.lineHeight = this.cssFontInfo.metrics.lineHeight;\n this.lineGap = this.cssFontInfo.metrics.lineGap;\n } else {\n this.lineHeight = this.ascent - this.descent + this.lineGap;\n }\n\n // The 'post' table has glyphs names.\n if (tables.post) {\n readPostScriptTable(tables.post, properties, numGlyphs);\n }\n\n // The original 'post' table is not needed, replace it.\n tables.post = {\n tag: \"post\",\n data: createPostTable(properties),\n };\n\n const charCodeToGlyphId = [];\n\n // Helper function to try to skip mapping of empty glyphs.\n function hasGlyph(glyphId) {\n return !missingGlyphs[glyphId];\n }\n\n if (properties.composite) {\n const cidToGidMap = properties.cidToGidMap || [];\n const isCidToGidMapEmpty = cidToGidMap.length === 0;\n\n properties.cMap.forEach(function (charCode, cid) {\n if (typeof cid === \"string\") {\n cid = convertCidString(charCode, cid, /* shouldThrow = */ true);\n }\n if (cid > 0xffff) {\n throw new FormatError(\"Max size of CID is 65,535\");\n }\n let glyphId = -1;\n if (isCidToGidMapEmpty) {\n glyphId = cid;\n } else if (cidToGidMap[cid] !== undefined) {\n glyphId = cidToGidMap[cid];\n }\n\n if (glyphId >= 0 && glyphId < numGlyphs && hasGlyph(glyphId)) {\n charCodeToGlyphId[charCode] = glyphId;\n }\n });\n } else {\n // Most of the following logic in this code branch is based on the\n // 9.6.6.4 of the PDF spec.\n const cmapTable = readCmapTable(\n tables.cmap,\n font,\n this.isSymbolicFont,\n properties.hasEncoding\n );\n const cmapPlatformId = cmapTable.platformId;\n const cmapEncodingId = cmapTable.encodingId;\n const cmapMappings = cmapTable.mappings;\n let baseEncoding = [],\n forcePostTable = false;\n if (\n properties.hasEncoding &&\n (properties.baseEncodingName === \"MacRomanEncoding\" ||\n properties.baseEncodingName === \"WinAnsiEncoding\")\n ) {\n baseEncoding = getEncoding(properties.baseEncodingName);\n }\n\n // If the font has an encoding and is not symbolic then follow the rules\n // in section 9.6.6.4 of the spec on how to map 3,1 and 1,0 cmaps.\n if (\n properties.hasEncoding &&\n !this.isSymbolicFont &&\n ((cmapPlatformId === 3 && cmapEncodingId === 1) ||\n (cmapPlatformId === 1 && cmapEncodingId === 0))\n ) {\n const glyphsUnicodeMap = getGlyphsUnicode();\n for (let charCode = 0; charCode < 256; charCode++) {\n let glyphName;\n if (this.differences[charCode] !== undefined) {\n glyphName = this.differences[charCode];\n } else if (baseEncoding.length && baseEncoding[charCode] !== \"\") {\n glyphName = baseEncoding[charCode];\n } else {\n glyphName = StandardEncoding[charCode];\n }\n if (!glyphName) {\n continue;\n }\n // Ensure that non-standard glyph names are resolved to valid ones.\n const standardGlyphName = recoverGlyphName(\n glyphName,\n glyphsUnicodeMap\n );\n\n let unicodeOrCharCode;\n if (cmapPlatformId === 3 && cmapEncodingId === 1) {\n unicodeOrCharCode = glyphsUnicodeMap[standardGlyphName];\n } else if (cmapPlatformId === 1 && cmapEncodingId === 0) {\n // TODO: the encoding needs to be updated with mac os table.\n unicodeOrCharCode = MacRomanEncoding.indexOf(standardGlyphName);\n }\n\n if (unicodeOrCharCode === undefined) {\n // Not a valid glyph name, fallback to using the /ToUnicode map\n // when no post-table exists (fixes issue13316_reduced.pdf).\n if (\n !properties.glyphNames &&\n properties.hasIncludedToUnicodeMap &&\n !(this.toUnicode instanceof IdentityToUnicodeMap)\n ) {\n const unicode = this.toUnicode.get(charCode);\n if (unicode) {\n unicodeOrCharCode = unicode.codePointAt(0);\n }\n }\n\n if (unicodeOrCharCode === undefined) {\n continue; // No valid glyph mapping found.\n }\n }\n\n for (const mapping of cmapMappings) {\n if (mapping.charCode !== unicodeOrCharCode) {\n continue;\n }\n charCodeToGlyphId[charCode] = mapping.glyphId;\n break;\n }\n }\n } else if (cmapPlatformId === 0) {\n // Default Unicode semantics, use the charcodes as is.\n for (const mapping of cmapMappings) {\n charCodeToGlyphId[mapping.charCode] = mapping.glyphId;\n }\n // Always prefer the BaseEncoding/Differences arrays, when they exist\n // (fixes issue13433.pdf).\n forcePostTable = true;\n } else {\n // When there is only a (1, 0) cmap table, the char code is a single\n // byte and it is used directly as the char code.\n\n // When a (3, 0) cmap table is present, it is used instead but the\n // spec has special rules for char codes in the range of 0xF000 to\n // 0xF0FF and it says the (3, 0) table should map the values from\n // the (1, 0) table by prepending 0xF0 to the char codes. To reverse\n // this, the upper bits of the char code are cleared, but only for the\n // special range since some PDFs have char codes outside of this range\n // (e.g. 0x2013) which when masked would overwrite other values in the\n // cmap.\n for (const mapping of cmapMappings) {\n let charCode = mapping.charCode;\n if (\n cmapPlatformId === 3 &&\n charCode >= 0xf000 &&\n charCode <= 0xf0ff\n ) {\n charCode &= 0xff;\n }\n charCodeToGlyphId[charCode] = mapping.glyphId;\n }\n }\n\n // Last, try to map any missing charcodes using the post table.\n if (\n properties.glyphNames &&\n (baseEncoding.length || this.differences.length)\n ) {\n for (let i = 0; i < 256; ++i) {\n if (!forcePostTable && charCodeToGlyphId[i] !== undefined) {\n continue;\n }\n const glyphName = this.differences[i] || baseEncoding[i];\n if (!glyphName) {\n continue;\n }\n const glyphId = properties.glyphNames.indexOf(glyphName);\n if (glyphId > 0 && hasGlyph(glyphId)) {\n charCodeToGlyphId[i] = glyphId;\n }\n }\n }\n }\n\n if (charCodeToGlyphId.length === 0) {\n // defines at least one glyph\n charCodeToGlyphId[0] = 0;\n }\n\n // Typically glyph 0 is duplicated and the mapping must be updated, but if\n // there isn't enough room to duplicate, the glyph id is left the same. In\n // this case, glyph 0 may not work correctly, but that is better than\n // having the whole font fail.\n let glyphZeroId = numGlyphsOut - 1;\n if (!dupFirstEntry) {\n glyphZeroId = 0;\n }\n\n // When `cssFontInfo` is set, the font is used to render text in the HTML\n // view (e.g. with Xfa) so nothing must be moved in the private use area.\n if (!properties.cssFontInfo) {\n // Converting glyphs and ids into font's cmap table\n const newMapping = adjustMapping(\n charCodeToGlyphId,\n hasGlyph,\n glyphZeroId,\n this.toUnicode\n );\n this.toFontChar = newMapping.toFontChar;\n tables.cmap = {\n tag: \"cmap\",\n data: createCmapTable(\n newMapping.charCodeToGlyphId,\n newMapping.toUnicodeExtraMap,\n numGlyphsOut\n ),\n };\n\n if (!tables[\"OS/2\"] || !validateOS2Table(tables[\"OS/2\"], font)) {\n tables[\"OS/2\"] = {\n tag: \"OS/2\",\n data: createOS2Table(\n properties,\n newMapping.charCodeToGlyphId,\n metricsOverride\n ),\n };\n }\n }\n\n if (!isTrueType) {\n try {\n // Trying to repair CFF file\n cffFile = new Stream(tables[\"CFF \"].data);\n const parser = new CFFParser(\n cffFile,\n properties,\n SEAC_ANALYSIS_ENABLED\n );\n cff = parser.parse();\n cff.duplicateFirstGlyph();\n const compiler = new CFFCompiler(cff);\n tables[\"CFF \"].data = compiler.compile();\n } catch {\n warn(\"Failed to compile font \" + properties.loadedName);\n }\n }\n\n // Re-creating 'name' table\n if (!tables.name) {\n tables.name = {\n tag: \"name\",\n data: createNameTable(this.name),\n };\n } else {\n // ... using existing 'name' table as prototype\n const [namePrototype, nameRecords] = readNameTable(tables.name);\n\n tables.name.data = createNameTable(name, namePrototype);\n this.psName = namePrototype[0][6] || null;\n\n if (!properties.composite) {\n // For TrueType fonts that do not include `ToUnicode` or `Encoding`\n // data, attempt to use the name-table to improve text selection.\n adjustTrueTypeToUnicode(properties, this.isSymbolicFont, nameRecords);\n }\n }\n\n const builder = new OpenTypeFileBuilder(header.version);\n for (const tableTag in tables) {\n builder.addTable(tableTag, tables[tableTag].data);\n }\n return builder.toArray();\n }\n\n convert(fontName, font, properties) {\n // TODO: Check the charstring widths to determine this.\n properties.fixedPitch = false;\n\n if (properties.builtInEncoding) {\n // For Type1 fonts that do not include either `ToUnicode` or `Encoding`\n // data, attempt to use the `builtInEncoding` to improve text selection.\n adjustType1ToUnicode(properties, properties.builtInEncoding);\n }\n\n // Type 1 fonts have a notdef inserted at the beginning, so glyph 0\n // becomes glyph 1. In a CFF font glyph 0 is appended to the end of the\n // char strings.\n let glyphZeroId = 1;\n if (font instanceof CFFFont) {\n glyphZeroId = font.numGlyphs - 1;\n }\n const mapping = font.getGlyphMapping(properties);\n let newMapping = null;\n let newCharCodeToGlyphId = mapping;\n let toUnicodeExtraMap = null;\n\n // When `cssFontInfo` is set, the font is used to render text in the HTML\n // view (e.g. with Xfa) so nothing must be moved in the private use area.\n if (!properties.cssFontInfo) {\n newMapping = adjustMapping(\n mapping,\n font.hasGlyphId.bind(font),\n glyphZeroId,\n this.toUnicode\n );\n this.toFontChar = newMapping.toFontChar;\n newCharCodeToGlyphId = newMapping.charCodeToGlyphId;\n toUnicodeExtraMap = newMapping.toUnicodeExtraMap;\n }\n const numGlyphs = font.numGlyphs;\n\n function getCharCodes(charCodeToGlyphId, glyphId) {\n let charCodes = null;\n for (const charCode in charCodeToGlyphId) {\n if (glyphId === charCodeToGlyphId[charCode]) {\n (charCodes ||= []).push(charCode | 0);\n }\n }\n return charCodes;\n }\n\n function createCharCode(charCodeToGlyphId, glyphId) {\n for (const charCode in charCodeToGlyphId) {\n if (glyphId === charCodeToGlyphId[charCode]) {\n return charCode | 0;\n }\n }\n newMapping.charCodeToGlyphId[newMapping.nextAvailableFontCharCode] =\n glyphId;\n return newMapping.nextAvailableFontCharCode++;\n }\n\n const seacs = font.seacs;\n if (newMapping && SEAC_ANALYSIS_ENABLED && seacs?.length) {\n const matrix = properties.fontMatrix || FONT_IDENTITY_MATRIX;\n const charset = font.getCharset();\n const seacMap = Object.create(null);\n for (let glyphId in seacs) {\n glyphId |= 0;\n const seac = seacs[glyphId];\n const baseGlyphName = StandardEncoding[seac[2]];\n const accentGlyphName = StandardEncoding[seac[3]];\n const baseGlyphId = charset.indexOf(baseGlyphName);\n const accentGlyphId = charset.indexOf(accentGlyphName);\n if (baseGlyphId < 0 || accentGlyphId < 0) {\n continue;\n }\n const accentOffset = {\n x: seac[0] * matrix[0] + seac[1] * matrix[2] + matrix[4],\n y: seac[0] * matrix[1] + seac[1] * matrix[3] + matrix[5],\n };\n\n const charCodes = getCharCodes(mapping, glyphId);\n if (!charCodes) {\n // There's no point in mapping it if the char code was never mapped\n // to begin with.\n continue;\n }\n for (const charCode of charCodes) {\n // Find a fontCharCode that maps to the base and accent glyphs.\n // If one doesn't exists, create it.\n const charCodeToGlyphId = newMapping.charCodeToGlyphId;\n const baseFontCharCode = createCharCode(\n charCodeToGlyphId,\n baseGlyphId\n );\n const accentFontCharCode = createCharCode(\n charCodeToGlyphId,\n accentGlyphId\n );\n seacMap[charCode] = {\n baseFontCharCode,\n accentFontCharCode,\n accentOffset,\n };\n }\n }\n properties.seacMap = seacMap;\n }\n\n const unitsPerEm = 1 / (properties.fontMatrix || FONT_IDENTITY_MATRIX)[0];\n\n const builder = new OpenTypeFileBuilder(\"\\x4F\\x54\\x54\\x4F\");\n // PostScript Font Program\n builder.addTable(\"CFF \", font.data);\n // OS/2 and Windows Specific metrics\n builder.addTable(\"OS/2\", createOS2Table(properties, newCharCodeToGlyphId));\n // Character to glyphs mapping\n builder.addTable(\n \"cmap\",\n createCmapTable(newCharCodeToGlyphId, toUnicodeExtraMap, numGlyphs)\n );\n // Font header\n builder.addTable(\n \"head\",\n \"\\x00\\x01\\x00\\x00\" + // Version number\n \"\\x00\\x00\\x10\\x00\" + // fontRevision\n \"\\x00\\x00\\x00\\x00\" + // checksumAdjustement\n \"\\x5F\\x0F\\x3C\\xF5\" + // magicNumber\n \"\\x00\\x00\" + // Flags\n safeString16(unitsPerEm) + // unitsPerEM\n \"\\x00\\x00\\x00\\x00\\x9e\\x0b\\x7e\\x27\" + // creation date\n \"\\x00\\x00\\x00\\x00\\x9e\\x0b\\x7e\\x27\" + // modifification date\n \"\\x00\\x00\" + // xMin\n safeString16(properties.descent) + // yMin\n \"\\x0F\\xFF\" + // xMax\n safeString16(properties.ascent) + // yMax\n string16(properties.italicAngle ? 2 : 0) + // macStyle\n \"\\x00\\x11\" + // lowestRecPPEM\n \"\\x00\\x00\" + // fontDirectionHint\n \"\\x00\\x00\" + // indexToLocFormat\n \"\\x00\\x00\"\n ); // glyphDataFormat\n\n // Horizontal header\n builder.addTable(\n \"hhea\",\n \"\\x00\\x01\\x00\\x00\" + // Version number\n safeString16(properties.ascent) + // Typographic Ascent\n safeString16(properties.descent) + // Typographic Descent\n \"\\x00\\x00\" + // Line Gap\n \"\\xFF\\xFF\" + // advanceWidthMax\n \"\\x00\\x00\" + // minLeftSidebearing\n \"\\x00\\x00\" + // minRightSidebearing\n \"\\x00\\x00\" + // xMaxExtent\n safeString16(properties.capHeight) + // caretSlopeRise\n safeString16(Math.tan(properties.italicAngle) * properties.xHeight) + // caretSlopeRun\n \"\\x00\\x00\" + // caretOffset\n \"\\x00\\x00\" + // -reserved-\n \"\\x00\\x00\" + // -reserved-\n \"\\x00\\x00\" + // -reserved-\n \"\\x00\\x00\" + // -reserved-\n \"\\x00\\x00\" + // metricDataFormat\n string16(numGlyphs)\n ); // Number of HMetrics\n\n // Horizontal metrics\n builder.addTable(\n \"hmtx\",\n (function fontFieldsHmtx() {\n const charstrings = font.charstrings;\n const cffWidths = font.cff ? font.cff.widths : null;\n let hmtx = \"\\x00\\x00\\x00\\x00\"; // Fake .notdef\n for (let i = 1, ii = numGlyphs; i < ii; i++) {\n let width = 0;\n if (charstrings) {\n const charstring = charstrings[i - 1];\n width = \"width\" in charstring ? charstring.width : 0;\n } else if (cffWidths) {\n width = Math.ceil(cffWidths[i] || 0);\n }\n hmtx += string16(width) + string16(0);\n }\n return hmtx;\n })()\n );\n\n // Maximum profile\n builder.addTable(\n \"maxp\",\n \"\\x00\\x00\\x50\\x00\" + string16(numGlyphs) // Version number\n ); // Num of glyphs\n\n // Naming tables\n builder.addTable(\"name\", createNameTable(fontName));\n\n // PostScript information\n builder.addTable(\"post\", createPostTable(properties));\n\n return builder.toArray();\n }\n\n get spaceWidth() {\n // trying to estimate space character width\n const possibleSpaceReplacements = [\"space\", \"minus\", \"one\", \"i\", \"I\"];\n let width;\n for (const glyphName of possibleSpaceReplacements) {\n // if possible, getting width by glyph name\n if (glyphName in this.widths) {\n width = this.widths[glyphName];\n break;\n }\n const glyphsUnicodeMap = getGlyphsUnicode();\n const glyphUnicode = glyphsUnicodeMap[glyphName];\n // finding the charcode via unicodeToCID map\n let charcode = 0;\n if (this.composite && this.cMap.contains(glyphUnicode)) {\n charcode = this.cMap.lookup(glyphUnicode);\n\n if (typeof charcode === \"string\") {\n charcode = convertCidString(glyphUnicode, charcode);\n }\n }\n // ... via toUnicode map\n if (!charcode && this.toUnicode) {\n charcode = this.toUnicode.charCodeOf(glyphUnicode);\n }\n // setting it to unicode if negative or undefined\n if (charcode <= 0) {\n charcode = glyphUnicode;\n }\n // trying to get width via charcode\n width = this.widths[charcode];\n if (width) {\n break; // the non-zero width found\n }\n }\n return shadow(this, \"spaceWidth\", width || this.defaultWidth);\n }\n\n /**\n * @private\n */\n _charToGlyph(charcode, isSpace = false) {\n let glyph = this._glyphCache[charcode];\n // All `Glyph`-properties, except `isSpace` in multi-byte strings,\n // depend indirectly on the `charcode`.\n if (glyph?.isSpace === isSpace) {\n return glyph;\n }\n let fontCharCode, width, operatorListId;\n\n let widthCode = charcode;\n if (this.cMap?.contains(charcode)) {\n widthCode = this.cMap.lookup(charcode);\n\n if (typeof widthCode === \"string\") {\n widthCode = convertCidString(charcode, widthCode);\n }\n }\n width = this.widths[widthCode];\n if (typeof width !== \"number\") {\n width = this.defaultWidth;\n }\n const vmetric = this.vmetrics?.[widthCode];\n\n let unicode = this.toUnicode.get(charcode) || charcode;\n if (typeof unicode === \"number\") {\n unicode = String.fromCharCode(unicode);\n }\n\n let isInFont = this.toFontChar[charcode] !== undefined;\n // First try the toFontChar map, if it's not there then try falling\n // back to the char code.\n fontCharCode = this.toFontChar[charcode] || charcode;\n if (this.missingFile) {\n const glyphName =\n this.differences[charcode] || this.defaultEncoding[charcode];\n if (\n (glyphName === \".notdef\" || glyphName === \"\") &&\n this.type === \"Type1\"\n ) {\n // .notdef glyphs should be invisible in non-embedded Type1 fonts, so\n // replace them with spaces.\n fontCharCode = 0x20;\n }\n fontCharCode = mapSpecialUnicodeValues(fontCharCode);\n }\n\n if (this.isType3Font) {\n // Font char code in this case is actually a glyph name.\n operatorListId = fontCharCode;\n }\n\n let accent = null;\n if (this.seacMap?.[charcode]) {\n isInFont = true;\n const seac = this.seacMap[charcode];\n fontCharCode = seac.baseFontCharCode;\n accent = {\n fontChar: String.fromCodePoint(seac.accentFontCharCode),\n offset: seac.accentOffset,\n };\n }\n\n let fontChar = \"\";\n if (typeof fontCharCode === \"number\") {\n if (fontCharCode <= 0x10ffff) {\n fontChar = String.fromCodePoint(fontCharCode);\n } else {\n warn(`charToGlyph - invalid fontCharCode: ${fontCharCode}`);\n }\n }\n\n glyph = new Glyph(\n charcode,\n fontChar,\n unicode,\n accent,\n width,\n vmetric,\n operatorListId,\n isSpace,\n isInFont\n );\n return (this._glyphCache[charcode] = glyph);\n }\n\n charsToGlyphs(chars) {\n // If we translated this string before, just grab it from the cache.\n let glyphs = this._charsCache[chars];\n if (glyphs) {\n return glyphs;\n }\n glyphs = [];\n\n if (this.cMap) {\n // Composite fonts have multi-byte strings, convert the string from\n // single-byte to multi-byte.\n const c = Object.create(null),\n ii = chars.length;\n let i = 0;\n while (i < ii) {\n this.cMap.readCharCode(chars, i, c);\n const { charcode, length } = c;\n i += length;\n // Space is char with code 0x20 and length 1 in multiple-byte codes.\n const glyph = this._charToGlyph(\n charcode,\n length === 1 && chars.charCodeAt(i - 1) === 0x20\n );\n glyphs.push(glyph);\n }\n } else {\n for (let i = 0, ii = chars.length; i < ii; ++i) {\n const charcode = chars.charCodeAt(i);\n const glyph = this._charToGlyph(charcode, charcode === 0x20);\n glyphs.push(glyph);\n }\n }\n\n // Enter the translated string into the cache.\n return (this._charsCache[chars] = glyphs);\n }\n\n /**\n * Chars can have different sizes (depends on the encoding).\n * @param {String} a string encoded with font encoding.\n * @returns {Array<Array<number>>} the positions of each char in the string.\n */\n getCharPositions(chars) {\n // This function doesn't use a cache because\n // it's called only when saving or printing.\n const positions = [];\n\n if (this.cMap) {\n const c = Object.create(null);\n let i = 0;\n while (i < chars.length) {\n this.cMap.readCharCode(chars, i, c);\n const length = c.length;\n positions.push([i, i + length]);\n i += length;\n }\n } else {\n for (let i = 0, ii = chars.length; i < ii; ++i) {\n positions.push([i, i + 1]);\n }\n }\n\n return positions;\n }\n\n get glyphCacheValues() {\n return Object.values(this._glyphCache);\n }\n\n /**\n * Encode a js string using font encoding.\n * The resulting array contains an encoded string at even positions\n * (can be empty) and a non-encoded one at odd positions.\n * @param {String} a js string.\n * @returns {Array<String>} an array of encoded strings or non-encoded ones.\n */\n encodeString(str) {\n const buffers = [];\n const currentBuf = [];\n\n // buffers will contain: encoded, non-encoded, encoded, ...\n // currentBuf is pushed in buffers each time there is a change.\n // So when buffers.length is odd then the last string is an encoded one\n // and currentBuf contains non-encoded chars.\n const hasCurrentBufErrors = () => buffers.length % 2 === 1;\n\n const getCharCode =\n this.toUnicode instanceof IdentityToUnicodeMap\n ? unicode => this.toUnicode.charCodeOf(unicode)\n : unicode => this.toUnicode.charCodeOf(String.fromCodePoint(unicode));\n\n for (let i = 0, ii = str.length; i < ii; i++) {\n const unicode = str.codePointAt(i);\n if (unicode > 0xd7ff && (unicode < 0xe000 || unicode > 0xfffd)) {\n // unicode is represented by two uint16\n i++;\n }\n if (this.toUnicode) {\n const charCode = getCharCode(unicode);\n if (charCode !== -1) {\n if (hasCurrentBufErrors()) {\n buffers.push(currentBuf.join(\"\"));\n currentBuf.length = 0;\n }\n const charCodeLength = this.cMap\n ? this.cMap.getCharCodeLength(charCode)\n : 1;\n for (let j = charCodeLength - 1; j >= 0; j--) {\n currentBuf.push(String.fromCharCode((charCode >> (8 * j)) & 0xff));\n }\n continue;\n }\n }\n\n // unicode can't be encoded\n if (!hasCurrentBufErrors()) {\n buffers.push(currentBuf.join(\"\"));\n currentBuf.length = 0;\n }\n currentBuf.push(String.fromCodePoint(unicode));\n }\n\n buffers.push(currentBuf.join(\"\"));\n\n return buffers;\n }\n}\n\nclass ErrorFont {\n constructor(error) {\n this.error = error;\n this.loadedName = \"g_font_error\";\n this.missingFile = true;\n }\n\n charsToGlyphs() {\n return [];\n }\n\n encodeString(chars) {\n return [chars];\n }\n\n exportData(extraProperties = false) {\n return { error: this.error };\n }\n}\n\nexport { ErrorFont, Font };\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 FormatError,\n info,\n unreachable,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport { BaseStream } from \"./base_stream.js\";\nimport { ColorSpace } from \"./colorspace.js\";\nimport { MissingDataException } from \"./core_utils.js\";\n\nconst ShadingType = {\n FUNCTION_BASED: 1,\n AXIAL: 2,\n RADIAL: 3,\n FREE_FORM_MESH: 4,\n LATTICE_FORM_MESH: 5,\n COONS_PATCH_MESH: 6,\n TENSOR_PATCH_MESH: 7,\n};\n\nclass Pattern {\n constructor() {\n unreachable(\"Cannot initialize Pattern.\");\n }\n\n static parseShading(\n shading,\n xref,\n res,\n pdfFunctionFactory,\n localColorSpaceCache\n ) {\n const dict = shading instanceof BaseStream ? shading.dict : shading;\n const type = dict.get(\"ShadingType\");\n\n try {\n switch (type) {\n case ShadingType.AXIAL:\n case ShadingType.RADIAL:\n return new RadialAxialShading(\n dict,\n xref,\n res,\n pdfFunctionFactory,\n localColorSpaceCache\n );\n case ShadingType.FREE_FORM_MESH:\n case ShadingType.LATTICE_FORM_MESH:\n case ShadingType.COONS_PATCH_MESH:\n case ShadingType.TENSOR_PATCH_MESH:\n return new MeshShading(\n shading,\n xref,\n res,\n pdfFunctionFactory,\n localColorSpaceCache\n );\n default:\n throw new FormatError(\"Unsupported ShadingType: \" + type);\n }\n } catch (ex) {\n if (ex instanceof MissingDataException) {\n throw ex;\n }\n warn(ex);\n return new DummyShading();\n }\n }\n}\n\nclass BaseShading {\n // A small number to offset the first/last color stops so we can insert ones\n // to support extend. Number.MIN_VALUE is too small and breaks the extend.\n static SMALL_NUMBER = 1e-6;\n\n constructor() {\n if (this.constructor === BaseShading) {\n unreachable(\"Cannot initialize BaseShading.\");\n }\n }\n\n getIR() {\n unreachable(\"Abstract method `getIR` called.\");\n }\n}\n\n// Radial and axial shading have very similar implementations\n// If needed, the implementations can be broken into two classes.\nclass RadialAxialShading extends BaseShading {\n constructor(dict, xref, resources, pdfFunctionFactory, localColorSpaceCache) {\n super();\n this.coordsArr = dict.getArray(\"Coords\");\n this.shadingType = dict.get(\"ShadingType\");\n const cs = ColorSpace.parse({\n cs: dict.getRaw(\"CS\") || dict.getRaw(\"ColorSpace\"),\n xref,\n resources,\n pdfFunctionFactory,\n localColorSpaceCache,\n });\n const bbox = dict.getArray(\"BBox\");\n this.bbox =\n Array.isArray(bbox) && bbox.length === 4\n ? Util.normalizeRect(bbox)\n : null;\n\n let t0 = 0.0,\n t1 = 1.0;\n if (dict.has(\"Domain\")) {\n const domainArr = dict.getArray(\"Domain\");\n t0 = domainArr[0];\n t1 = domainArr[1];\n }\n\n let extendStart = false,\n extendEnd = false;\n if (dict.has(\"Extend\")) {\n const extendArr = dict.getArray(\"Extend\");\n extendStart = extendArr[0];\n extendEnd = extendArr[1];\n }\n\n if (\n this.shadingType === ShadingType.RADIAL &&\n (!extendStart || !extendEnd)\n ) {\n // Radial gradient only currently works if either circle is fully within\n // the other circle.\n const [x1, y1, r1, x2, y2, r2] = this.coordsArr;\n const distance = Math.hypot(x1 - x2, y1 - y2);\n if (r1 <= r2 + distance && r2 <= r1 + distance) {\n warn(\"Unsupported radial gradient.\");\n }\n }\n\n this.extendStart = extendStart;\n this.extendEnd = extendEnd;\n\n const fnObj = dict.getRaw(\"Function\");\n const fn = pdfFunctionFactory.createFromArray(fnObj);\n\n // Use lcm(1,2,3,4,5,6,7,8,10) = 840 (including 9 increases this to 2520)\n // to catch evenly spaced stops. oeis.org/A003418\n const NUMBER_OF_SAMPLES = 840;\n const step = (t1 - t0) / NUMBER_OF_SAMPLES;\n\n const colorStops = (this.colorStops = []);\n\n // Protect against bad domains.\n if (t0 >= t1 || step <= 0) {\n // Acrobat doesn't seem to handle these cases so we'll ignore for\n // now.\n info(\"Bad shading domain.\");\n return;\n }\n\n const color = new Float32Array(cs.numComps),\n ratio = new Float32Array(1);\n let rgbColor;\n\n let iBase = 0;\n ratio[0] = t0;\n fn(ratio, 0, color, 0);\n let rgbBase = cs.getRgb(color, 0);\n const cssColorBase = Util.makeHexColor(rgbBase[0], rgbBase[1], rgbBase[2]);\n colorStops.push([0, cssColorBase]);\n\n let iPrev = 1;\n ratio[0] = t0 + step;\n fn(ratio, 0, color, 0);\n let rgbPrev = cs.getRgb(color, 0);\n\n // Slopes are rise / run.\n // A max slope is from the least value the base component could have been\n // to the greatest value the current component could have been.\n // A min slope is from the greatest value the base component could have been\n // to the least value the current component could have been.\n // Each component could have been rounded up to .5 from its original value\n // so the conservative deltas are +-1 (+-.5 for base and -+.5 for current).\n\n // The run is iPrev - iBase = 1, so omitted.\n let maxSlopeR = rgbPrev[0] - rgbBase[0] + 1;\n let maxSlopeG = rgbPrev[1] - rgbBase[1] + 1;\n let maxSlopeB = rgbPrev[2] - rgbBase[2] + 1;\n let minSlopeR = rgbPrev[0] - rgbBase[0] - 1;\n let minSlopeG = rgbPrev[1] - rgbBase[1] - 1;\n let minSlopeB = rgbPrev[2] - rgbBase[2] - 1;\n\n for (let i = 2; i < NUMBER_OF_SAMPLES; i++) {\n ratio[0] = t0 + i * step;\n fn(ratio, 0, color, 0);\n rgbColor = cs.getRgb(color, 0);\n\n // Keep going if the maximum minimum slope <= the minimum maximum slope.\n // Otherwise add a rgbPrev color stop and make it the new base.\n\n const run = i - iBase;\n maxSlopeR = Math.min(maxSlopeR, (rgbColor[0] - rgbBase[0] + 1) / run);\n maxSlopeG = Math.min(maxSlopeG, (rgbColor[1] - rgbBase[1] + 1) / run);\n maxSlopeB = Math.min(maxSlopeB, (rgbColor[2] - rgbBase[2] + 1) / run);\n minSlopeR = Math.max(minSlopeR, (rgbColor[0] - rgbBase[0] - 1) / run);\n minSlopeG = Math.max(minSlopeG, (rgbColor[1] - rgbBase[1] - 1) / run);\n minSlopeB = Math.max(minSlopeB, (rgbColor[2] - rgbBase[2] - 1) / run);\n\n const slopesExist =\n minSlopeR <= maxSlopeR &&\n minSlopeG <= maxSlopeG &&\n minSlopeB <= maxSlopeB;\n\n if (!slopesExist) {\n const cssColor = Util.makeHexColor(rgbPrev[0], rgbPrev[1], rgbPrev[2]);\n colorStops.push([iPrev / NUMBER_OF_SAMPLES, cssColor]);\n\n // TODO: When fn frequency is high (iPrev - iBase === 1 twice in a row),\n // send the color space and function to do the sampling display side.\n\n // The run is i - iPrev = 1, so omitted.\n maxSlopeR = rgbColor[0] - rgbPrev[0] + 1;\n maxSlopeG = rgbColor[1] - rgbPrev[1] + 1;\n maxSlopeB = rgbColor[2] - rgbPrev[2] + 1;\n minSlopeR = rgbColor[0] - rgbPrev[0] - 1;\n minSlopeG = rgbColor[1] - rgbPrev[1] - 1;\n minSlopeB = rgbColor[2] - rgbPrev[2] - 1;\n\n iBase = iPrev;\n rgbBase = rgbPrev;\n }\n\n iPrev = i;\n rgbPrev = rgbColor;\n }\n const cssColor = Util.makeHexColor(rgbPrev[0], rgbPrev[1], rgbPrev[2]);\n colorStops.push([1, cssColor]);\n\n let background = \"transparent\";\n if (dict.has(\"Background\")) {\n rgbColor = cs.getRgb(dict.get(\"Background\"), 0);\n background = Util.makeHexColor(rgbColor[0], rgbColor[1], rgbColor[2]);\n }\n\n if (!extendStart) {\n // Insert a color stop at the front and offset the first real color stop\n // so it doesn't conflict with the one we insert.\n colorStops.unshift([0, background]);\n colorStops[1][0] += BaseShading.SMALL_NUMBER;\n }\n if (!extendEnd) {\n // Same idea as above in extendStart but for the end.\n colorStops.at(-1)[0] -= BaseShading.SMALL_NUMBER;\n colorStops.push([1, background]);\n }\n\n this.colorStops = colorStops;\n }\n\n getIR() {\n const coordsArr = this.coordsArr;\n const shadingType = this.shadingType;\n let type, p0, p1, r0, r1;\n if (shadingType === ShadingType.AXIAL) {\n p0 = [coordsArr[0], coordsArr[1]];\n p1 = [coordsArr[2], coordsArr[3]];\n r0 = null;\n r1 = null;\n type = \"axial\";\n } else if (shadingType === ShadingType.RADIAL) {\n p0 = [coordsArr[0], coordsArr[1]];\n p1 = [coordsArr[3], coordsArr[4]];\n r0 = coordsArr[2];\n r1 = coordsArr[5];\n type = \"radial\";\n } else {\n unreachable(`getPattern type unknown: ${shadingType}`);\n }\n\n return [\"RadialAxial\", type, this.bbox, this.colorStops, p0, p1, r0, r1];\n }\n}\n\n// All mesh shadings. For now, they will be presented as set of the triangles\n// to be drawn on the canvas and rgb color for each vertex.\nclass MeshStreamReader {\n constructor(stream, context) {\n this.stream = stream;\n this.context = context;\n this.buffer = 0;\n this.bufferLength = 0;\n\n const numComps = context.numComps;\n this.tmpCompsBuf = new Float32Array(numComps);\n const csNumComps = context.colorSpace.numComps;\n this.tmpCsCompsBuf = context.colorFn\n ? new Float32Array(csNumComps)\n : this.tmpCompsBuf;\n }\n\n get hasData() {\n if (this.stream.end) {\n return this.stream.pos < this.stream.end;\n }\n if (this.bufferLength > 0) {\n return true;\n }\n const nextByte = this.stream.getByte();\n if (nextByte < 0) {\n return false;\n }\n this.buffer = nextByte;\n this.bufferLength = 8;\n return true;\n }\n\n readBits(n) {\n let buffer = this.buffer;\n let bufferLength = this.bufferLength;\n if (n === 32) {\n if (bufferLength === 0) {\n return (\n ((this.stream.getByte() << 24) |\n (this.stream.getByte() << 16) |\n (this.stream.getByte() << 8) |\n this.stream.getByte()) >>>\n 0\n );\n }\n buffer =\n (buffer << 24) |\n (this.stream.getByte() << 16) |\n (this.stream.getByte() << 8) |\n this.stream.getByte();\n const nextByte = this.stream.getByte();\n this.buffer = nextByte & ((1 << bufferLength) - 1);\n return (\n ((buffer << (8 - bufferLength)) |\n ((nextByte & 0xff) >> bufferLength)) >>>\n 0\n );\n }\n if (n === 8 && bufferLength === 0) {\n return this.stream.getByte();\n }\n while (bufferLength < n) {\n buffer = (buffer << 8) | this.stream.getByte();\n bufferLength += 8;\n }\n bufferLength -= n;\n this.bufferLength = bufferLength;\n this.buffer = buffer & ((1 << bufferLength) - 1);\n return buffer >> bufferLength;\n }\n\n align() {\n this.buffer = 0;\n this.bufferLength = 0;\n }\n\n readFlag() {\n return this.readBits(this.context.bitsPerFlag);\n }\n\n readCoordinate() {\n const bitsPerCoordinate = this.context.bitsPerCoordinate;\n const xi = this.readBits(bitsPerCoordinate);\n const yi = this.readBits(bitsPerCoordinate);\n const decode = this.context.decode;\n const scale =\n bitsPerCoordinate < 32\n ? 1 / ((1 << bitsPerCoordinate) - 1)\n : 2.3283064365386963e-10; // 2 ^ -32\n return [\n xi * scale * (decode[1] - decode[0]) + decode[0],\n yi * scale * (decode[3] - decode[2]) + decode[2],\n ];\n }\n\n readComponents() {\n const numComps = this.context.numComps;\n const bitsPerComponent = this.context.bitsPerComponent;\n const scale =\n bitsPerComponent < 32\n ? 1 / ((1 << bitsPerComponent) - 1)\n : 2.3283064365386963e-10; // 2 ^ -32\n const decode = this.context.decode;\n const components = this.tmpCompsBuf;\n for (let i = 0, j = 4; i < numComps; i++, j += 2) {\n const ci = this.readBits(bitsPerComponent);\n components[i] = ci * scale * (decode[j + 1] - decode[j]) + decode[j];\n }\n const color = this.tmpCsCompsBuf;\n if (this.context.colorFn) {\n this.context.colorFn(components, 0, color, 0);\n }\n return this.context.colorSpace.getRgb(color, 0);\n }\n}\n\nlet bCache = Object.create(null);\n\nfunction buildB(count) {\n const lut = [];\n for (let i = 0; i <= count; i++) {\n const t = i / count,\n t_ = 1 - t;\n lut.push(\n new Float32Array([t_ ** 3, 3 * t * t_ ** 2, 3 * t ** 2 * t_, t ** 3])\n );\n }\n return lut;\n}\nfunction getB(count) {\n return (bCache[count] ||= buildB(count));\n}\n\nfunction clearPatternCaches() {\n bCache = Object.create(null);\n}\n\nclass MeshShading extends BaseShading {\n static MIN_SPLIT_PATCH_CHUNKS_AMOUNT = 3;\n\n static MAX_SPLIT_PATCH_CHUNKS_AMOUNT = 20;\n\n // Count of triangles per entire mesh bounds.\n static TRIANGLE_DENSITY = 20;\n\n constructor(\n stream,\n xref,\n resources,\n pdfFunctionFactory,\n localColorSpaceCache\n ) {\n super();\n if (!(stream instanceof BaseStream)) {\n throw new FormatError(\"Mesh data is not a stream\");\n }\n const dict = stream.dict;\n this.shadingType = dict.get(\"ShadingType\");\n const bbox = dict.getArray(\"BBox\");\n this.bbox =\n Array.isArray(bbox) && bbox.length === 4\n ? Util.normalizeRect(bbox)\n : null;\n const cs = ColorSpace.parse({\n cs: dict.getRaw(\"CS\") || dict.getRaw(\"ColorSpace\"),\n xref,\n resources,\n pdfFunctionFactory,\n localColorSpaceCache,\n });\n this.background = dict.has(\"Background\")\n ? cs.getRgb(dict.get(\"Background\"), 0)\n : null;\n\n const fnObj = dict.getRaw(\"Function\");\n const fn = fnObj ? pdfFunctionFactory.createFromArray(fnObj) : null;\n\n this.coords = [];\n this.colors = [];\n this.figures = [];\n\n const decodeContext = {\n bitsPerCoordinate: dict.get(\"BitsPerCoordinate\"),\n bitsPerComponent: dict.get(\"BitsPerComponent\"),\n bitsPerFlag: dict.get(\"BitsPerFlag\"),\n decode: dict.getArray(\"Decode\"),\n colorFn: fn,\n colorSpace: cs,\n numComps: fn ? 1 : cs.numComps,\n };\n const reader = new MeshStreamReader(stream, decodeContext);\n\n let patchMesh = false;\n switch (this.shadingType) {\n case ShadingType.FREE_FORM_MESH:\n this._decodeType4Shading(reader);\n break;\n case ShadingType.LATTICE_FORM_MESH:\n const verticesPerRow = dict.get(\"VerticesPerRow\") | 0;\n if (verticesPerRow < 2) {\n throw new FormatError(\"Invalid VerticesPerRow\");\n }\n this._decodeType5Shading(reader, verticesPerRow);\n break;\n case ShadingType.COONS_PATCH_MESH:\n this._decodeType6Shading(reader);\n patchMesh = true;\n break;\n case ShadingType.TENSOR_PATCH_MESH:\n this._decodeType7Shading(reader);\n patchMesh = true;\n break;\n default:\n unreachable(\"Unsupported mesh type.\");\n break;\n }\n\n if (patchMesh) {\n // Dirty bounds calculation, to determine how dense the triangles will be.\n this._updateBounds();\n for (let i = 0, ii = this.figures.length; i < ii; i++) {\n this._buildFigureFromPatch(i);\n }\n }\n // Calculate bounds.\n this._updateBounds();\n\n this._packData();\n }\n\n _decodeType4Shading(reader) {\n const coords = this.coords;\n const colors = this.colors;\n const operators = [];\n const ps = []; // not maintaining cs since that will match ps\n let verticesLeft = 0; // assuming we have all data to start a new triangle\n while (reader.hasData) {\n const f = reader.readFlag();\n const coord = reader.readCoordinate();\n const color = reader.readComponents();\n if (verticesLeft === 0) {\n // ignoring flags if we started a triangle\n if (!(0 <= f && f <= 2)) {\n throw new FormatError(\"Unknown type4 flag\");\n }\n switch (f) {\n case 0:\n verticesLeft = 3;\n break;\n case 1:\n ps.push(ps.at(-2), ps.at(-1));\n verticesLeft = 1;\n break;\n case 2:\n ps.push(ps.at(-3), ps.at(-1));\n verticesLeft = 1;\n break;\n }\n operators.push(f);\n }\n ps.push(coords.length);\n coords.push(coord);\n colors.push(color);\n verticesLeft--;\n\n reader.align();\n }\n this.figures.push({\n type: \"triangles\",\n coords: new Int32Array(ps),\n colors: new Int32Array(ps),\n });\n }\n\n _decodeType5Shading(reader, verticesPerRow) {\n const coords = this.coords;\n const colors = this.colors;\n const ps = []; // not maintaining cs since that will match ps\n while (reader.hasData) {\n const coord = reader.readCoordinate();\n const color = reader.readComponents();\n ps.push(coords.length);\n coords.push(coord);\n colors.push(color);\n }\n this.figures.push({\n type: \"lattice\",\n coords: new Int32Array(ps),\n colors: new Int32Array(ps),\n verticesPerRow,\n });\n }\n\n _decodeType6Shading(reader) {\n // A special case of Type 7. The p11, p12, p21, p22 automatically filled\n const coords = this.coords;\n const colors = this.colors;\n const ps = new Int32Array(16); // p00, p10, ..., p30, p01, ..., p33\n const cs = new Int32Array(4); // c00, c30, c03, c33\n while (reader.hasData) {\n const f = reader.readFlag();\n if (!(0 <= f && f <= 3)) {\n throw new FormatError(\"Unknown type6 flag\");\n }\n const pi = coords.length;\n for (let i = 0, ii = f !== 0 ? 8 : 12; i < ii; i++) {\n coords.push(reader.readCoordinate());\n }\n const ci = colors.length;\n for (let i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) {\n colors.push(reader.readComponents());\n }\n let tmp1, tmp2, tmp3, tmp4;\n switch (f) {\n // prettier-ignore\n case 0:\n ps[12] = pi + 3; ps[13] = pi + 4; ps[14] = pi + 5; ps[15] = pi + 6;\n ps[ 8] = pi + 2; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 7;\n ps[ 4] = pi + 1; /* calculated below */ ps[ 7] = pi + 8;\n ps[ 0] = pi; ps[ 1] = pi + 11; ps[ 2] = pi + 10; ps[ 3] = pi + 9;\n cs[2] = ci + 1; cs[3] = ci + 2;\n cs[0] = ci; cs[1] = ci + 3;\n break;\n // prettier-ignore\n case 1:\n tmp1 = ps[12]; tmp2 = ps[13]; tmp3 = ps[14]; tmp4 = ps[15];\n ps[12] = tmp4; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2;\n ps[ 8] = tmp3; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 3;\n ps[ 4] = tmp2; /* calculated below */ ps[ 7] = pi + 4;\n ps[ 0] = tmp1; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5;\n tmp1 = cs[2]; tmp2 = cs[3];\n cs[2] = tmp2; cs[3] = ci;\n cs[0] = tmp1; cs[1] = ci + 1;\n break;\n // prettier-ignore\n case 2:\n tmp1 = ps[15];\n tmp2 = ps[11];\n ps[12] = ps[3]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2;\n ps[ 8] = ps[7]; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 3;\n ps[ 4] = tmp2; /* calculated below */ ps[ 7] = pi + 4;\n ps[ 0] = tmp1; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5;\n tmp1 = cs[3];\n cs[2] = cs[1]; cs[3] = ci;\n cs[0] = tmp1; cs[1] = ci + 1;\n break;\n // prettier-ignore\n case 3:\n ps[12] = ps[0]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2;\n ps[ 8] = ps[1]; /* values for 5, 6, 9, 10 are */ ps[11] = pi + 3;\n ps[ 4] = ps[2]; /* calculated below */ ps[ 7] = pi + 4;\n ps[ 0] = ps[3]; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5;\n cs[2] = cs[0]; cs[3] = ci;\n cs[0] = cs[1]; cs[1] = ci + 1;\n break;\n }\n // set p11, p12, p21, p22\n ps[5] = coords.length;\n coords.push([\n (-4 * coords[ps[0]][0] -\n coords[ps[15]][0] +\n 6 * (coords[ps[4]][0] + coords[ps[1]][0]) -\n 2 * (coords[ps[12]][0] + coords[ps[3]][0]) +\n 3 * (coords[ps[13]][0] + coords[ps[7]][0])) /\n 9,\n (-4 * coords[ps[0]][1] -\n coords[ps[15]][1] +\n 6 * (coords[ps[4]][1] + coords[ps[1]][1]) -\n 2 * (coords[ps[12]][1] + coords[ps[3]][1]) +\n 3 * (coords[ps[13]][1] + coords[ps[7]][1])) /\n 9,\n ]);\n ps[6] = coords.length;\n coords.push([\n (-4 * coords[ps[3]][0] -\n coords[ps[12]][0] +\n 6 * (coords[ps[2]][0] + coords[ps[7]][0]) -\n 2 * (coords[ps[0]][0] + coords[ps[15]][0]) +\n 3 * (coords[ps[4]][0] + coords[ps[14]][0])) /\n 9,\n (-4 * coords[ps[3]][1] -\n coords[ps[12]][1] +\n 6 * (coords[ps[2]][1] + coords[ps[7]][1]) -\n 2 * (coords[ps[0]][1] + coords[ps[15]][1]) +\n 3 * (coords[ps[4]][1] + coords[ps[14]][1])) /\n 9,\n ]);\n ps[9] = coords.length;\n coords.push([\n (-4 * coords[ps[12]][0] -\n coords[ps[3]][0] +\n 6 * (coords[ps[8]][0] + coords[ps[13]][0]) -\n 2 * (coords[ps[0]][0] + coords[ps[15]][0]) +\n 3 * (coords[ps[11]][0] + coords[ps[1]][0])) /\n 9,\n (-4 * coords[ps[12]][1] -\n coords[ps[3]][1] +\n 6 * (coords[ps[8]][1] + coords[ps[13]][1]) -\n 2 * (coords[ps[0]][1] + coords[ps[15]][1]) +\n 3 * (coords[ps[11]][1] + coords[ps[1]][1])) /\n 9,\n ]);\n ps[10] = coords.length;\n coords.push([\n (-4 * coords[ps[15]][0] -\n coords[ps[0]][0] +\n 6 * (coords[ps[11]][0] + coords[ps[14]][0]) -\n 2 * (coords[ps[12]][0] + coords[ps[3]][0]) +\n 3 * (coords[ps[2]][0] + coords[ps[8]][0])) /\n 9,\n (-4 * coords[ps[15]][1] -\n coords[ps[0]][1] +\n 6 * (coords[ps[11]][1] + coords[ps[14]][1]) -\n 2 * (coords[ps[12]][1] + coords[ps[3]][1]) +\n 3 * (coords[ps[2]][1] + coords[ps[8]][1])) /\n 9,\n ]);\n this.figures.push({\n type: \"patch\",\n coords: new Int32Array(ps), // making copies of ps and cs\n colors: new Int32Array(cs),\n });\n }\n }\n\n _decodeType7Shading(reader) {\n const coords = this.coords;\n const colors = this.colors;\n const ps = new Int32Array(16); // p00, p10, ..., p30, p01, ..., p33\n const cs = new Int32Array(4); // c00, c30, c03, c33\n while (reader.hasData) {\n const f = reader.readFlag();\n if (!(0 <= f && f <= 3)) {\n throw new FormatError(\"Unknown type7 flag\");\n }\n const pi = coords.length;\n for (let i = 0, ii = f !== 0 ? 12 : 16; i < ii; i++) {\n coords.push(reader.readCoordinate());\n }\n const ci = colors.length;\n for (let i = 0, ii = f !== 0 ? 2 : 4; i < ii; i++) {\n colors.push(reader.readComponents());\n }\n let tmp1, tmp2, tmp3, tmp4;\n switch (f) {\n // prettier-ignore\n case 0:\n ps[12] = pi + 3; ps[13] = pi + 4; ps[14] = pi + 5; ps[15] = pi + 6;\n ps[ 8] = pi + 2; ps[ 9] = pi + 13; ps[10] = pi + 14; ps[11] = pi + 7;\n ps[ 4] = pi + 1; ps[ 5] = pi + 12; ps[ 6] = pi + 15; ps[ 7] = pi + 8;\n ps[ 0] = pi; ps[ 1] = pi + 11; ps[ 2] = pi + 10; ps[ 3] = pi + 9;\n cs[2] = ci + 1; cs[3] = ci + 2;\n cs[0] = ci; cs[1] = ci + 3;\n break;\n // prettier-ignore\n case 1:\n tmp1 = ps[12]; tmp2 = ps[13]; tmp3 = ps[14]; tmp4 = ps[15];\n ps[12] = tmp4; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2;\n ps[ 8] = tmp3; ps[ 9] = pi + 9; ps[10] = pi + 10; ps[11] = pi + 3;\n ps[ 4] = tmp2; ps[ 5] = pi + 8; ps[ 6] = pi + 11; ps[ 7] = pi + 4;\n ps[ 0] = tmp1; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5;\n tmp1 = cs[2]; tmp2 = cs[3];\n cs[2] = tmp2; cs[3] = ci;\n cs[0] = tmp1; cs[1] = ci + 1;\n break;\n // prettier-ignore\n case 2:\n tmp1 = ps[15];\n tmp2 = ps[11];\n ps[12] = ps[3]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2;\n ps[ 8] = ps[7]; ps[ 9] = pi + 9; ps[10] = pi + 10; ps[11] = pi + 3;\n ps[ 4] = tmp2; ps[ 5] = pi + 8; ps[ 6] = pi + 11; ps[ 7] = pi + 4;\n ps[ 0] = tmp1; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5;\n tmp1 = cs[3];\n cs[2] = cs[1]; cs[3] = ci;\n cs[0] = tmp1; cs[1] = ci + 1;\n break;\n // prettier-ignore\n case 3:\n ps[12] = ps[0]; ps[13] = pi + 0; ps[14] = pi + 1; ps[15] = pi + 2;\n ps[ 8] = ps[1]; ps[ 9] = pi + 9; ps[10] = pi + 10; ps[11] = pi + 3;\n ps[ 4] = ps[2]; ps[ 5] = pi + 8; ps[ 6] = pi + 11; ps[ 7] = pi + 4;\n ps[ 0] = ps[3]; ps[ 1] = pi + 7; ps[ 2] = pi + 6; ps[ 3] = pi + 5;\n cs[2] = cs[0]; cs[3] = ci;\n cs[0] = cs[1]; cs[1] = ci + 1;\n break;\n }\n this.figures.push({\n type: \"patch\",\n coords: new Int32Array(ps), // making copies of ps and cs\n colors: new Int32Array(cs),\n });\n }\n }\n\n _buildFigureFromPatch(index) {\n const figure = this.figures[index];\n assert(figure.type === \"patch\", \"Unexpected patch mesh figure\");\n\n const coords = this.coords,\n colors = this.colors;\n const pi = figure.coords;\n const ci = figure.colors;\n\n const figureMinX = Math.min(\n coords[pi[0]][0],\n coords[pi[3]][0],\n coords[pi[12]][0],\n coords[pi[15]][0]\n );\n const figureMinY = Math.min(\n coords[pi[0]][1],\n coords[pi[3]][1],\n coords[pi[12]][1],\n coords[pi[15]][1]\n );\n const figureMaxX = Math.max(\n coords[pi[0]][0],\n coords[pi[3]][0],\n coords[pi[12]][0],\n coords[pi[15]][0]\n );\n const figureMaxY = Math.max(\n coords[pi[0]][1],\n coords[pi[3]][1],\n coords[pi[12]][1],\n coords[pi[15]][1]\n );\n let splitXBy = Math.ceil(\n ((figureMaxX - figureMinX) * MeshShading.TRIANGLE_DENSITY) /\n (this.bounds[2] - this.bounds[0])\n );\n splitXBy = Math.max(\n MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,\n Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitXBy)\n );\n let splitYBy = Math.ceil(\n ((figureMaxY - figureMinY) * MeshShading.TRIANGLE_DENSITY) /\n (this.bounds[3] - this.bounds[1])\n );\n splitYBy = Math.max(\n MeshShading.MIN_SPLIT_PATCH_CHUNKS_AMOUNT,\n Math.min(MeshShading.MAX_SPLIT_PATCH_CHUNKS_AMOUNT, splitYBy)\n );\n\n const verticesPerRow = splitXBy + 1;\n const figureCoords = new Int32Array((splitYBy + 1) * verticesPerRow);\n const figureColors = new Int32Array((splitYBy + 1) * verticesPerRow);\n let k = 0;\n const cl = new Uint8Array(3),\n cr = new Uint8Array(3);\n const c0 = colors[ci[0]],\n c1 = colors[ci[1]],\n c2 = colors[ci[2]],\n c3 = colors[ci[3]];\n const bRow = getB(splitYBy),\n bCol = getB(splitXBy);\n for (let row = 0; row <= splitYBy; row++) {\n cl[0] = ((c0[0] * (splitYBy - row) + c2[0] * row) / splitYBy) | 0;\n cl[1] = ((c0[1] * (splitYBy - row) + c2[1] * row) / splitYBy) | 0;\n cl[2] = ((c0[2] * (splitYBy - row) + c2[2] * row) / splitYBy) | 0;\n\n cr[0] = ((c1[0] * (splitYBy - row) + c3[0] * row) / splitYBy) | 0;\n cr[1] = ((c1[1] * (splitYBy - row) + c3[1] * row) / splitYBy) | 0;\n cr[2] = ((c1[2] * (splitYBy - row) + c3[2] * row) / splitYBy) | 0;\n\n for (let col = 0; col <= splitXBy; col++, k++) {\n if (\n (row === 0 || row === splitYBy) &&\n (col === 0 || col === splitXBy)\n ) {\n continue;\n }\n let x = 0,\n y = 0;\n let q = 0;\n for (let i = 0; i <= 3; i++) {\n for (let j = 0; j <= 3; j++, q++) {\n const m = bRow[row][i] * bCol[col][j];\n x += coords[pi[q]][0] * m;\n y += coords[pi[q]][1] * m;\n }\n }\n figureCoords[k] = coords.length;\n coords.push([x, y]);\n figureColors[k] = colors.length;\n const newColor = new Uint8Array(3);\n newColor[0] = ((cl[0] * (splitXBy - col) + cr[0] * col) / splitXBy) | 0;\n newColor[1] = ((cl[1] * (splitXBy - col) + cr[1] * col) / splitXBy) | 0;\n newColor[2] = ((cl[2] * (splitXBy - col) + cr[2] * col) / splitXBy) | 0;\n colors.push(newColor);\n }\n }\n figureCoords[0] = pi[0];\n figureColors[0] = ci[0];\n figureCoords[splitXBy] = pi[3];\n figureColors[splitXBy] = ci[1];\n figureCoords[verticesPerRow * splitYBy] = pi[12];\n figureColors[verticesPerRow * splitYBy] = ci[2];\n figureCoords[verticesPerRow * splitYBy + splitXBy] = pi[15];\n figureColors[verticesPerRow * splitYBy + splitXBy] = ci[3];\n\n this.figures[index] = {\n type: \"lattice\",\n coords: figureCoords,\n colors: figureColors,\n verticesPerRow,\n };\n }\n\n _updateBounds() {\n let minX = this.coords[0][0],\n minY = this.coords[0][1],\n maxX = minX,\n maxY = minY;\n for (let i = 1, ii = this.coords.length; i < ii; i++) {\n const x = this.coords[i][0],\n y = this.coords[i][1];\n minX = minX > x ? x : minX;\n minY = minY > y ? y : minY;\n maxX = maxX < x ? x : maxX;\n maxY = maxY < y ? y : maxY;\n }\n this.bounds = [minX, minY, maxX, maxY];\n }\n\n _packData() {\n let i, ii, j, jj;\n\n const coords = this.coords;\n const coordsPacked = new Float32Array(coords.length * 2);\n for (i = 0, j = 0, ii = coords.length; i < ii; i++) {\n const xy = coords[i];\n coordsPacked[j++] = xy[0];\n coordsPacked[j++] = xy[1];\n }\n this.coords = coordsPacked;\n\n const colors = this.colors;\n const colorsPacked = new Uint8Array(colors.length * 3);\n for (i = 0, j = 0, ii = colors.length; i < ii; i++) {\n const c = colors[i];\n colorsPacked[j++] = c[0];\n colorsPacked[j++] = c[1];\n colorsPacked[j++] = c[2];\n }\n this.colors = colorsPacked;\n\n const figures = this.figures;\n for (i = 0, ii = figures.length; i < ii; i++) {\n const figure = figures[i],\n ps = figure.coords,\n cs = figure.colors;\n for (j = 0, jj = ps.length; j < jj; j++) {\n ps[j] *= 2;\n cs[j] *= 3;\n }\n }\n }\n\n getIR() {\n return [\n \"Mesh\",\n this.shadingType,\n this.coords,\n this.colors,\n this.figures,\n this.bounds,\n this.bbox,\n this.background,\n ];\n }\n}\n\nclass DummyShading extends BaseShading {\n getIR() {\n return [\"Dummy\"];\n }\n}\n\nfunction getTilingPatternIR(operatorList, dict, color) {\n const matrix = dict.getArray(\"Matrix\");\n const bbox = Util.normalizeRect(dict.getArray(\"BBox\"));\n const xstep = dict.get(\"XStep\");\n const ystep = dict.get(\"YStep\");\n const paintType = dict.get(\"PaintType\");\n const tilingType = dict.get(\"TilingType\");\n\n // Ensure that the pattern has a non-zero width and height, to prevent errors\n // in `pattern_helper.js` (fixes issue8330.pdf).\n if (bbox[2] - bbox[0] === 0 || bbox[3] - bbox[1] === 0) {\n throw new FormatError(`Invalid getTilingPatternIR /BBox array: [${bbox}].`);\n }\n\n return [\n \"TilingPattern\",\n color,\n operatorList,\n matrix,\n bbox,\n xstep,\n ystep,\n paintType,\n tilingType,\n ];\n}\n\nexport { clearPatternCaches, getTilingPatternIR, Pattern };\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// Factors to rescale LiberationSans-Bold.ttf to have the same\n// metrics as calibrib.ttf.\nconst CalibriBoldFactors = [\n 1.3877, 1, 1, 1, 0.97801, 0.92482, 0.89552, 0.91133, 0.81988, 0.97566,\n 0.98152, 0.93548, 0.93548, 1.2798, 0.85284, 0.92794, 1, 0.96134, 1.54657,\n 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133,\n 0.91133, 0.91133, 0.82845, 0.82845, 0.85284, 0.85284, 0.85284, 0.75859,\n 0.92138, 0.83908, 0.7762, 0.73293, 0.87289, 0.73133, 0.7514, 0.81921, 0.87356,\n 0.95958, 0.59526, 0.75727, 0.69225, 1.04924, 0.9121, 0.86943, 0.79795,\n 0.88198, 0.77958, 0.70864, 0.81055, 0.90399, 0.88653, 0.96017, 0.82577,\n 0.77892, 0.78257, 0.97507, 1.54657, 0.97507, 0.85284, 0.89552, 0.90176,\n 0.88762, 0.8785, 0.75241, 0.8785, 0.90518, 0.95015, 0.77618, 0.8785, 0.88401,\n 0.91916, 0.86304, 0.88401, 0.91488, 0.8785, 0.8801, 0.8785, 0.8785, 0.91343,\n 0.7173, 1.04106, 0.8785, 0.85075, 0.95794, 0.82616, 0.85162, 0.79492, 0.88331,\n 1.69808, 0.88331, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133,\n 1.7801, 0.89552, 1.24487, 1.13254, 1.12401, 0.96839, 0.85284, 0.68787,\n 0.70645, 0.85592, 0.90747, 1.01466, 1.0088, 0.90323, 1, 1.07463, 1, 0.91056,\n 0.75806, 1.19118, 0.96839, 0.78864, 0.82845, 0.84133, 0.75859, 0.83908,\n 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.77539, 0.73293, 0.73133,\n 0.73133, 0.73133, 0.73133, 0.95958, 0.95958, 0.95958, 0.95958, 0.88506,\n 0.9121, 0.86943, 0.86943, 0.86943, 0.86943, 0.86943, 0.85284, 0.87508,\n 0.90399, 0.90399, 0.90399, 0.90399, 0.77892, 0.79795, 0.90807, 0.88762,\n 0.88762, 0.88762, 0.88762, 0.88762, 0.88762, 0.8715, 0.75241, 0.90518,\n 0.90518, 0.90518, 0.90518, 0.88401, 0.88401, 0.88401, 0.88401, 0.8785, 0.8785,\n 0.8801, 0.8801, 0.8801, 0.8801, 0.8801, 0.90747, 0.89049, 0.8785, 0.8785,\n 0.8785, 0.8785, 0.85162, 0.8785, 0.85162, 0.83908, 0.88762, 0.83908, 0.88762,\n 0.83908, 0.88762, 0.73293, 0.75241, 0.73293, 0.75241, 0.73293, 0.75241,\n 0.73293, 0.75241, 0.87289, 0.83016, 0.88506, 0.93125, 0.73133, 0.90518,\n 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518,\n 0.81921, 0.77618, 0.81921, 0.77618, 0.81921, 0.77618, 1, 1, 0.87356, 0.8785,\n 0.91075, 0.89608, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401,\n 0.95958, 0.88401, 0.95958, 0.88401, 0.76229, 0.90167, 0.59526, 0.91916, 1, 1,\n 0.86304, 0.69225, 0.88401, 1, 1, 0.70424, 0.79468, 0.91926, 0.88175, 0.70823,\n 0.94903, 0.9121, 0.8785, 1, 1, 0.9121, 0.8785, 0.87802, 0.88656, 0.8785,\n 0.86943, 0.8801, 0.86943, 0.8801, 0.86943, 0.8801, 0.87402, 0.89291, 0.77958,\n 0.91343, 1, 1, 0.77958, 0.91343, 0.70864, 0.7173, 0.70864, 0.7173, 0.70864,\n 0.7173, 0.70864, 0.7173, 1, 1, 0.81055, 0.75841, 0.81055, 1.06452, 0.90399,\n 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785,\n 0.90399, 0.8785, 0.96017, 0.95794, 0.77892, 0.85162, 0.77892, 0.78257,\n 0.79492, 0.78257, 0.79492, 0.78257, 0.79492, 0.9297, 0.56892, 0.83908,\n 0.88762, 0.77539, 0.8715, 0.87508, 0.89049, 1, 1, 0.81055, 1.04106, 1.20528,\n 1.20528, 1, 1.15543, 0.70674, 0.98387, 0.94721, 1.33431, 1.45894, 0.95161,\n 1.06303, 0.83908, 0.80352, 0.57184, 0.6965, 0.56289, 0.82001, 0.56029,\n 0.81235, 1.02988, 0.83908, 0.7762, 0.68156, 0.80367, 0.73133, 0.78257,\n 0.87356, 0.86943, 0.95958, 0.75727, 0.89019, 1.04924, 0.9121, 0.7648, 0.86943,\n 0.87356, 0.79795, 0.78275, 0.81055, 0.77892, 0.9762, 0.82577, 0.99819,\n 0.84896, 0.95958, 0.77892, 0.96108, 1.01407, 0.89049, 1.02988, 0.94211,\n 0.96108, 0.8936, 0.84021, 0.87842, 0.96399, 0.79109, 0.89049, 1.00813,\n 1.02988, 0.86077, 0.87445, 0.92099, 0.84723, 0.86513, 0.8801, 0.75638,\n 0.85714, 0.78216, 0.79586, 0.87965, 0.94211, 0.97747, 0.78287, 0.97926,\n 0.84971, 1.02988, 0.94211, 0.8801, 0.94211, 0.84971, 0.73133, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 0.90264, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 0.90518, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90548, 1, 1, 1, 1, 1, 1,\n 0.96017, 0.95794, 0.96017, 0.95794, 0.96017, 0.95794, 0.77892, 0.85162, 1, 1,\n 0.89552, 0.90527, 1, 0.90363, 0.92794, 0.92794, 0.92794, 0.92794, 0.87012,\n 0.87012, 0.87012, 0.89552, 0.89552, 1.42259, 0.71143, 1.06152, 1, 1, 1.03372,\n 1.03372, 0.97171, 1.4956, 2.2807, 0.93835, 0.83406, 0.91133, 0.84107, 0.91133,\n 1, 1, 1, 0.72021, 1, 1.23108, 0.83489, 0.88525, 0.88525, 0.81499, 0.90527,\n 1.81055, 0.90527, 1.81055, 1.31006, 1.53711, 0.94434, 1.08696, 1, 0.95018,\n 0.77192, 0.85284, 0.90747, 1.17534, 0.69825, 0.9716, 1.37077, 0.90747,\n 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572,\n 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.08004, 0.91027, 1, 1, 1,\n 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90727, 0.90727, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n];\nconst CalibriBoldMetrics = { lineHeight: 1.2207, lineGap: 0.2207 };\n\n// Factors to rescale LiberationSans-BoldItalic.ttf to have the same\n// metrics as calibriz.ttf.\nconst CalibriBoldItalicFactors = [\n 1.3877, 1, 1, 1, 0.97801, 0.92482, 0.89552, 0.91133, 0.81988, 0.97566,\n 0.98152, 0.93548, 0.93548, 1.2798, 0.85284, 0.92794, 1, 0.96134, 1.56239,\n 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133,\n 0.91133, 0.91133, 0.82845, 0.82845, 0.85284, 0.85284, 0.85284, 0.75859,\n 0.92138, 0.83908, 0.7762, 0.71805, 0.87289, 0.73133, 0.7514, 0.81921, 0.87356,\n 0.95958, 0.59526, 0.75727, 0.69225, 1.04924, 0.90872, 0.85938, 0.79795,\n 0.87068, 0.77958, 0.69766, 0.81055, 0.90399, 0.88653, 0.96068, 0.82577,\n 0.77892, 0.78257, 0.97507, 1.529, 0.97507, 0.85284, 0.89552, 0.90176, 0.94908,\n 0.86411, 0.74012, 0.86411, 0.88323, 0.95015, 0.86411, 0.86331, 0.88401,\n 0.91916, 0.86304, 0.88401, 0.9039, 0.86331, 0.86331, 0.86411, 0.86411,\n 0.90464, 0.70852, 1.04106, 0.86331, 0.84372, 0.95794, 0.82616, 0.84548,\n 0.79492, 0.88331, 1.69808, 0.88331, 0.85284, 0.97801, 0.89552, 0.91133,\n 0.89552, 0.91133, 1.7801, 0.89552, 1.24487, 1.13254, 1.19129, 0.96839,\n 0.85284, 0.68787, 0.70645, 0.85592, 0.90747, 1.01466, 1.0088, 0.90323, 1,\n 1.07463, 1, 0.91056, 0.75806, 1.19118, 0.96839, 0.78864, 0.82845, 0.84133,\n 0.75859, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.77539,\n 0.71805, 0.73133, 0.73133, 0.73133, 0.73133, 0.95958, 0.95958, 0.95958,\n 0.95958, 0.88506, 0.90872, 0.85938, 0.85938, 0.85938, 0.85938, 0.85938,\n 0.85284, 0.87068, 0.90399, 0.90399, 0.90399, 0.90399, 0.77892, 0.79795,\n 0.90807, 0.94908, 0.94908, 0.94908, 0.94908, 0.94908, 0.94908, 0.85887,\n 0.74012, 0.88323, 0.88323, 0.88323, 0.88323, 0.88401, 0.88401, 0.88401,\n 0.88401, 0.8785, 0.86331, 0.86331, 0.86331, 0.86331, 0.86331, 0.86331,\n 0.90747, 0.89049, 0.86331, 0.86331, 0.86331, 0.86331, 0.84548, 0.86411,\n 0.84548, 0.83908, 0.94908, 0.83908, 0.94908, 0.83908, 0.94908, 0.71805,\n 0.74012, 0.71805, 0.74012, 0.71805, 0.74012, 0.71805, 0.74012, 0.87289,\n 0.79538, 0.88506, 0.92726, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133,\n 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.81921, 0.86411, 0.81921,\n 0.86411, 0.81921, 0.86411, 1, 1, 0.87356, 0.86331, 0.91075, 0.8777, 0.95958,\n 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958,\n 0.88401, 0.76467, 0.90167, 0.59526, 0.91916, 1, 1, 0.86304, 0.69225, 0.88401,\n 1, 1, 0.70424, 0.77312, 0.91926, 0.88175, 0.70823, 0.94903, 0.90872, 0.86331,\n 1, 1, 0.90872, 0.86331, 0.86906, 0.88116, 0.86331, 0.85938, 0.86331, 0.85938,\n 0.86331, 0.85938, 0.86331, 0.87402, 0.86549, 0.77958, 0.90464, 1, 1, 0.77958,\n 0.90464, 0.69766, 0.70852, 0.69766, 0.70852, 0.69766, 0.70852, 0.69766,\n 0.70852, 1, 1, 0.81055, 0.75841, 0.81055, 1.06452, 0.90399, 0.86331, 0.90399,\n 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399,\n 0.86331, 0.96068, 0.95794, 0.77892, 0.84548, 0.77892, 0.78257, 0.79492,\n 0.78257, 0.79492, 0.78257, 0.79492, 0.9297, 0.56892, 0.83908, 0.94908,\n 0.77539, 0.85887, 0.87068, 0.89049, 1, 1, 0.81055, 1.04106, 1.20528, 1.20528,\n 1, 1.15543, 0.70088, 0.98387, 0.94721, 1.33431, 1.45894, 0.95161, 1.48387,\n 0.83908, 0.80352, 0.57118, 0.6965, 0.56347, 0.79179, 0.55853, 0.80346,\n 1.02988, 0.83908, 0.7762, 0.67174, 0.86036, 0.73133, 0.78257, 0.87356,\n 0.86441, 0.95958, 0.75727, 0.89019, 1.04924, 0.90872, 0.74889, 0.85938,\n 0.87891, 0.79795, 0.7957, 0.81055, 0.77892, 0.97447, 0.82577, 0.97466,\n 0.87179, 0.95958, 0.77892, 0.94252, 0.95612, 0.8753, 1.02988, 0.92733,\n 0.94252, 0.87411, 0.84021, 0.8728, 0.95612, 0.74081, 0.8753, 1.02189, 1.02988,\n 0.84814, 0.87445, 0.91822, 0.84723, 0.85668, 0.86331, 0.81344, 0.87581,\n 0.76422, 0.82046, 0.96057, 0.92733, 0.99375, 0.78022, 0.95452, 0.86015,\n 1.02988, 0.92733, 0.86331, 0.92733, 0.86015, 0.73133, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 0.90631, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.88323, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.85174, 1, 1, 1, 1, 1, 1, 0.96068, 0.95794,\n 0.96068, 0.95794, 0.96068, 0.95794, 0.77892, 0.84548, 1, 1, 0.89552, 0.90527,\n 1, 0.90363, 0.92794, 0.92794, 0.92794, 0.89807, 0.87012, 0.87012, 0.87012,\n 0.89552, 0.89552, 1.42259, 0.71094, 1.06152, 1, 1, 1.03372, 1.03372, 0.97171,\n 1.4956, 2.2807, 0.92972, 0.83406, 0.91133, 0.83326, 0.91133, 1, 1, 1, 0.72021,\n 1, 1.23108, 0.83489, 0.88525, 0.88525, 0.81499, 0.90616, 1.81055, 0.90527,\n 1.81055, 1.3107, 1.53711, 0.94434, 1.08696, 1, 0.95018, 0.77192, 0.85284,\n 0.90747, 1.17534, 0.69825, 0.9716, 1.37077, 0.90747, 0.90747, 0.85356,\n 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572,\n 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.08004, 0.91027, 1, 1, 1, 0.99862, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90727, 0.90727, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1,\n];\nconst CalibriBoldItalicMetrics = { lineHeight: 1.2207, lineGap: 0.2207 };\n\n// Factors to rescale LiberationSans-Italic.ttf to have the same\n// metrics as calibrii.ttf.\nconst CalibriItalicFactors = [\n 1.3877, 1, 1, 1, 1.17223, 1.1293, 0.89552, 0.91133, 0.80395, 1.02269, 1.15601,\n 0.91056, 0.91056, 1.2798, 0.85284, 0.89807, 1, 0.90861, 1.39543, 0.91133,\n 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133,\n 0.91133, 0.96309, 0.96309, 0.85284, 0.85284, 0.85284, 0.83319, 0.88071,\n 0.8675, 0.81552, 0.72346, 0.85193, 0.73206, 0.7522, 0.81105, 0.86275, 0.90685,\n 0.6377, 0.77892, 0.75593, 1.02638, 0.89249, 0.84118, 0.77452, 0.85374,\n 0.75186, 0.67789, 0.79776, 0.88844, 0.85066, 0.94309, 0.77818, 0.7306,\n 0.76659, 1.10369, 1.38313, 1.10369, 1.06139, 0.89552, 0.8739, 0.9245, 0.9245,\n 0.83203, 0.9245, 0.85865, 1.09842, 0.9245, 0.9245, 1.03297, 1.07692, 0.90918,\n 1.03297, 0.94959, 0.9245, 0.92274, 0.9245, 0.9245, 1.02933, 0.77832, 1.20562,\n 0.9245, 0.8916, 0.98986, 0.86621, 0.89453, 0.79004, 0.94152, 1.77256, 0.94152,\n 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.91729, 0.89552,\n 1.17889, 1.13254, 1.16359, 0.92098, 0.85284, 0.68787, 0.71353, 0.84737,\n 0.90747, 1.0088, 1.0044, 0.87683, 1, 1.09091, 1, 0.92229, 0.739, 1.15642,\n 0.92098, 0.76288, 0.80504, 0.80972, 0.75859, 0.8675, 0.8675, 0.8675, 0.8675,\n 0.8675, 0.8675, 0.76318, 0.72346, 0.73206, 0.73206, 0.73206, 0.73206, 0.90685,\n 0.90685, 0.90685, 0.90685, 0.86477, 0.89249, 0.84118, 0.84118, 0.84118,\n 0.84118, 0.84118, 0.85284, 0.84557, 0.88844, 0.88844, 0.88844, 0.88844,\n 0.7306, 0.77452, 0.86331, 0.9245, 0.9245, 0.9245, 0.9245, 0.9245, 0.9245,\n 0.84843, 0.83203, 0.85865, 0.85865, 0.85865, 0.85865, 0.82601, 0.82601,\n 0.82601, 0.82601, 0.94469, 0.9245, 0.92274, 0.92274, 0.92274, 0.92274,\n 0.92274, 0.90747, 0.86651, 0.9245, 0.9245, 0.9245, 0.9245, 0.89453, 0.9245,\n 0.89453, 0.8675, 0.9245, 0.8675, 0.9245, 0.8675, 0.9245, 0.72346, 0.83203,\n 0.72346, 0.83203, 0.72346, 0.83203, 0.72346, 0.83203, 0.85193, 0.8875,\n 0.86477, 0.99034, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865,\n 0.73206, 0.85865, 0.73206, 0.85865, 0.81105, 0.9245, 0.81105, 0.9245, 0.81105,\n 0.9245, 1, 1, 0.86275, 0.9245, 0.90872, 0.93591, 0.90685, 0.82601, 0.90685,\n 0.82601, 0.90685, 0.82601, 0.90685, 1.03297, 0.90685, 0.82601, 0.77896,\n 1.05611, 0.6377, 1.07692, 1, 1, 0.90918, 0.75593, 1.03297, 1, 1, 0.76032,\n 0.9375, 0.98156, 0.93407, 0.77261, 1.11429, 0.89249, 0.9245, 1, 1, 0.89249,\n 0.9245, 0.92534, 0.86698, 0.9245, 0.84118, 0.92274, 0.84118, 0.92274, 0.84118,\n 0.92274, 0.8667, 0.86291, 0.75186, 1.02933, 1, 1, 0.75186, 1.02933, 0.67789,\n 0.77832, 0.67789, 0.77832, 0.67789, 0.77832, 0.67789, 0.77832, 1, 1, 0.79776,\n 0.97655, 0.79776, 1.23023, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245,\n 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.94309, 0.98986, 0.7306,\n 0.89453, 0.7306, 0.76659, 0.79004, 0.76659, 0.79004, 0.76659, 0.79004,\n 1.09231, 0.54873, 0.8675, 0.9245, 0.76318, 0.84843, 0.84557, 0.86651, 1, 1,\n 0.79776, 1.20562, 1.18622, 1.18622, 1, 1.1437, 0.67009, 0.96334, 0.93695,\n 1.35191, 1.40909, 0.95161, 1.48387, 0.8675, 0.90861, 0.6192, 0.7363, 0.64824,\n 0.82411, 0.56321, 0.85696, 1.23516, 0.8675, 0.81552, 0.7286, 0.84134, 0.73206,\n 0.76659, 0.86275, 0.84369, 0.90685, 0.77892, 0.85871, 1.02638, 0.89249,\n 0.75828, 0.84118, 0.85984, 0.77452, 0.76466, 0.79776, 0.7306, 0.90782,\n 0.77818, 0.903, 0.87291, 0.90685, 0.7306, 0.99058, 1.03667, 0.94635, 1.23516,\n 0.9849, 0.99058, 0.92393, 0.8916, 0.942, 1.03667, 0.75026, 0.94635, 1.0297,\n 1.23516, 0.90918, 0.94048, 0.98217, 0.89746, 0.84153, 0.92274, 0.82507,\n 0.88832, 0.84438, 0.88178, 1.03525, 0.9849, 1.00225, 0.78086, 0.97248,\n 0.89404, 1.23516, 0.9849, 0.92274, 0.9849, 0.89404, 0.73206, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 0.89693, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.85865,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90933, 1, 1, 1, 1, 1, 1, 0.94309,\n 0.98986, 0.94309, 0.98986, 0.94309, 0.98986, 0.7306, 0.89453, 1, 1, 0.89552,\n 0.90527, 1, 0.90186, 1.12308, 1.12308, 1.12308, 1.12308, 1.2566, 1.2566,\n 1.2566, 0.89552, 0.89552, 1.42259, 0.68994, 1.03809, 1, 1, 1.0176, 1.0176,\n 1.11523, 1.4956, 2.01462, 0.97858, 0.82616, 0.91133, 0.83437, 0.91133, 1, 1,\n 1, 0.70508, 1, 1.23108, 0.79801, 0.84426, 0.84426, 0.774, 0.90572, 1.81055,\n 0.90749, 1.81055, 1.28809, 1.55469, 0.94434, 1.07806, 1, 0.97094, 0.7589,\n 0.85284, 0.90747, 1.19658, 0.69825, 0.97622, 1.33512, 0.90747, 0.90747,\n 0.85284, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8,\n 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.0336, 0.91027, 1, 1, 1,\n 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05859, 1.05859, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n];\nconst CalibriItalicMetrics = { lineHeight: 1.2207, lineGap: 0.2207 };\n\n// Factors to rescale LiberationSans-Regular.ttf to have the same\n// metrics as calibri.ttf.\nconst CalibriRegularFactors = [\n 1.3877, 1, 1, 1, 1.17223, 1.1293, 0.89552, 0.91133, 0.80395, 1.02269, 1.15601,\n 0.91056, 0.91056, 1.2798, 0.85284, 0.89807, 1, 0.90861, 1.39016, 0.91133,\n 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133,\n 0.91133, 0.96309, 0.96309, 0.85284, 0.85284, 0.85284, 0.83319, 0.88071,\n 0.8675, 0.81552, 0.73834, 0.85193, 0.73206, 0.7522, 0.81105, 0.86275, 0.90685,\n 0.6377, 0.77892, 0.75593, 1.02638, 0.89385, 0.85122, 0.77452, 0.86503,\n 0.75186, 0.68887, 0.79776, 0.88844, 0.85066, 0.94258, 0.77818, 0.7306,\n 0.76659, 1.10369, 1.39016, 1.10369, 1.06139, 0.89552, 0.8739, 0.86128,\n 0.94469, 0.8457, 0.94469, 0.89464, 1.09842, 0.84636, 0.94469, 1.03297,\n 1.07692, 0.90918, 1.03297, 0.95897, 0.94469, 0.9482, 0.94469, 0.94469,\n 1.04692, 0.78223, 1.20562, 0.94469, 0.90332, 0.98986, 0.86621, 0.90527,\n 0.79004, 0.94152, 1.77256, 0.94152, 0.85284, 0.97801, 0.89552, 0.91133,\n 0.89552, 0.91133, 1.91729, 0.89552, 1.17889, 1.13254, 1.08707, 0.92098,\n 0.85284, 0.68787, 0.71353, 0.84737, 0.90747, 1.0088, 1.0044, 0.87683, 1,\n 1.09091, 1, 0.92229, 0.739, 1.15642, 0.92098, 0.76288, 0.80504, 0.80972,\n 0.75859, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.76318, 0.73834,\n 0.73206, 0.73206, 0.73206, 0.73206, 0.90685, 0.90685, 0.90685, 0.90685,\n 0.86477, 0.89385, 0.85122, 0.85122, 0.85122, 0.85122, 0.85122, 0.85284,\n 0.85311, 0.88844, 0.88844, 0.88844, 0.88844, 0.7306, 0.77452, 0.86331,\n 0.86128, 0.86128, 0.86128, 0.86128, 0.86128, 0.86128, 0.8693, 0.8457, 0.89464,\n 0.89464, 0.89464, 0.89464, 0.82601, 0.82601, 0.82601, 0.82601, 0.94469,\n 0.94469, 0.9482, 0.9482, 0.9482, 0.9482, 0.9482, 0.90747, 0.86651, 0.94469,\n 0.94469, 0.94469, 0.94469, 0.90527, 0.94469, 0.90527, 0.8675, 0.86128, 0.8675,\n 0.86128, 0.8675, 0.86128, 0.73834, 0.8457, 0.73834, 0.8457, 0.73834, 0.8457,\n 0.73834, 0.8457, 0.85193, 0.92454, 0.86477, 0.9921, 0.73206, 0.89464, 0.73206,\n 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.81105,\n 0.84636, 0.81105, 0.84636, 0.81105, 0.84636, 1, 1, 0.86275, 0.94469, 0.90872,\n 0.95786, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685,\n 1.03297, 0.90685, 0.82601, 0.77741, 1.05611, 0.6377, 1.07692, 1, 1, 0.90918,\n 0.75593, 1.03297, 1, 1, 0.76032, 0.90452, 0.98156, 1.11842, 0.77261, 1.11429,\n 0.89385, 0.94469, 1, 1, 0.89385, 0.94469, 0.95877, 0.86901, 0.94469, 0.85122,\n 0.9482, 0.85122, 0.9482, 0.85122, 0.9482, 0.8667, 0.90016, 0.75186, 1.04692,\n 1, 1, 0.75186, 1.04692, 0.68887, 0.78223, 0.68887, 0.78223, 0.68887, 0.78223,\n 0.68887, 0.78223, 1, 1, 0.79776, 0.92188, 0.79776, 1.23023, 0.88844, 0.94469,\n 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469,\n 0.88844, 0.94469, 0.94258, 0.98986, 0.7306, 0.90527, 0.7306, 0.76659, 0.79004,\n 0.76659, 0.79004, 0.76659, 0.79004, 1.09231, 0.54873, 0.8675, 0.86128,\n 0.76318, 0.8693, 0.85311, 0.86651, 1, 1, 0.79776, 1.20562, 1.18622, 1.18622,\n 1, 1.1437, 0.67742, 0.96334, 0.93695, 1.35191, 1.40909, 0.95161, 1.48387,\n 0.86686, 0.90861, 0.62267, 0.74359, 0.65649, 0.85498, 0.56963, 0.88254,\n 1.23516, 0.8675, 0.81552, 0.75443, 0.84503, 0.73206, 0.76659, 0.86275,\n 0.85122, 0.90685, 0.77892, 0.85746, 1.02638, 0.89385, 0.75657, 0.85122,\n 0.86275, 0.77452, 0.74171, 0.79776, 0.7306, 0.95165, 0.77818, 0.89772,\n 0.88831, 0.90685, 0.7306, 0.98142, 1.02191, 0.96576, 1.23516, 0.99018,\n 0.98142, 0.9236, 0.89258, 0.94035, 1.02191, 0.78848, 0.96576, 0.9561, 1.23516,\n 0.90918, 0.92578, 0.95424, 0.89746, 0.83969, 0.9482, 0.80113, 0.89442,\n 0.85208, 0.86155, 0.98022, 0.99018, 1.00452, 0.81209, 0.99247, 0.89181,\n 1.23516, 0.99018, 0.9482, 0.99018, 0.89181, 0.73206, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 0.88844, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89464, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.96766, 1, 1, 1, 1, 1, 1, 0.94258, 0.98986,\n 0.94258, 0.98986, 0.94258, 0.98986, 0.7306, 0.90527, 1, 1, 0.89552, 0.90527,\n 1, 0.90186, 1.12308, 1.12308, 1.12308, 1.12308, 1.2566, 1.2566, 1.2566,\n 0.89552, 0.89552, 1.42259, 0.69043, 1.03809, 1, 1, 1.0176, 1.0176, 1.11523,\n 1.4956, 2.01462, 0.99331, 0.82616, 0.91133, 0.84286, 0.91133, 1, 1, 1,\n 0.70508, 1, 1.23108, 0.79801, 0.84426, 0.84426, 0.774, 0.90527, 1.81055,\n 0.90527, 1.81055, 1.28809, 1.55469, 0.94434, 1.07806, 1, 0.97094, 0.7589,\n 0.85284, 0.90747, 1.19658, 0.69825, 0.97622, 1.33512, 0.90747, 0.90747,\n 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8,\n 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.0336, 0.91027, 1, 1, 1,\n 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05859, 1.05859, 1, 1, 1,\n 1.07185, 0.99413, 0.96334, 1.08065, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n];\nconst CalibriRegularMetrics = { lineHeight: 1.2207, lineGap: 0.2207 };\n\nexport {\n CalibriBoldFactors,\n CalibriBoldItalicFactors,\n CalibriBoldItalicMetrics,\n CalibriBoldMetrics,\n CalibriItalicFactors,\n CalibriItalicMetrics,\n CalibriRegularFactors,\n CalibriRegularMetrics,\n};\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// Factors to rescale LiberationSans-Bold.ttf to have the same\n// metrics as NimbusSans-Bold.otf.\nconst HelveticaBoldFactors = [\n 0.76116, 1, 1, 1.0006, 0.99998, 0.99974, 0.99973, 0.99973, 0.99982, 0.99977,\n 1.00087, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006,\n 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973,\n 0.99973, 0.99973, 0.99998, 1, 1.00003, 1.00003, 1.00003, 1.00026, 0.9999,\n 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977,\n 1.0006, 0.99973, 0.99977, 1.00026, 0.99999, 0.99977, 1.00022, 1.00001,\n 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001,\n 1.00001, 1.00026, 0.99998, 1.0006, 0.99998, 1.00003, 0.99973, 0.99998,\n 0.99973, 1.00026, 0.99973, 1.00026, 0.99973, 0.99998, 1.00026, 1.00026,\n 1.0006, 1.0006, 0.99973, 1.0006, 0.99982, 1.00026, 1.00026, 1.00026, 1.00026,\n 0.99959, 0.99973, 0.99998, 1.00026, 0.99973, 1.00022, 0.99973, 0.99973, 1,\n 0.99959, 1.00077, 0.99959, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973,\n 0.99973, 1.00077, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003,\n 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.99973, 1.0006,\n 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 0.99977,\n 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 1, 0.99977, 1.00001, 1.00001,\n 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022,\n 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977,\n 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973,\n 0.99973, 0.99973, 0.99973, 0.99982, 0.99973, 0.99973, 0.99973, 0.99973,\n 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.00026, 1.00026, 1.00026, 1.00026,\n 1.00026, 1.00026, 1.00026, 1.06409, 1.00026, 1.00026, 1.00026, 1.00026,\n 1.00026, 0.99973, 1.00026, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973,\n 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973,\n 0.99977, 0.99973, 0.99977, 1.03374, 0.99977, 1.00026, 1.00001, 0.99973,\n 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973,\n 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026,\n 0.99977, 1.00026, 0.99977, 1.00026, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006,\n 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.00042, 0.99973, 0.99973, 1.0006,\n 0.99977, 0.99973, 0.99973, 1.00026, 1.0006, 1.00026, 1.0006, 1.00026, 1.03828,\n 1.00026, 0.99999, 1.00026, 1.0006, 0.99977, 1.00026, 0.99977, 1.00026,\n 0.99977, 1.00026, 0.9993, 0.9998, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026,\n 1.00022, 1.00026, 1, 1.00016, 0.99977, 0.99959, 0.99977, 0.99959, 0.99977,\n 0.99959, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001,\n 0.99973, 1.00026, 0.99998, 1.00026, 0.8121, 1.00026, 0.99998, 0.99977,\n 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977,\n 1.00026, 0.99977, 1.00026, 1.00016, 1.00022, 1.00001, 0.99973, 1.00001,\n 1.00026, 1, 1.00026, 1, 1.00026, 1, 1.0006, 0.99973, 0.99977, 0.99973, 1,\n 0.99982, 1.00022, 1.00026, 1.00001, 0.99973, 1.00026, 0.99998, 0.99998,\n 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998,\n 0.99998, 1.00034, 0.99977, 1, 0.99997, 1.00026, 1.00078, 1.00036, 0.99973,\n 1.00013, 1.0006, 0.99977, 0.99977, 0.99988, 0.85148, 1.00001, 1.00026,\n 0.99977, 1.00022, 1.0006, 0.99977, 1.00001, 0.99999, 0.99977, 1.00069,\n 1.00022, 0.99977, 1.00001, 0.99984, 1.00026, 1.00001, 1.00024, 1.00001,\n 0.9999, 1, 1.0006, 1.00001, 1.00041, 0.99962, 1.00026, 1.0006, 0.99995,\n 1.00041, 0.99942, 0.99973, 0.99927, 1.00082, 0.99902, 1.00026, 1.00087,\n 1.0006, 1.00069, 0.99973, 0.99867, 0.99973, 0.9993, 1.00026, 1.00049, 1.00056,\n 1, 0.99988, 0.99935, 0.99995, 0.99954, 1.00055, 0.99945, 1.00032, 1.0006,\n 0.99995, 1.00026, 0.99995, 1.00032, 1.00001, 1.00008, 0.99971, 1.00019,\n 0.9994, 1.00001, 1.0006, 1.00044, 0.99973, 1.00023, 1.00047, 1, 0.99942,\n 0.99561, 0.99989, 1.00035, 0.99977, 1.00035, 0.99977, 1.00019, 0.99944,\n 1.00001, 1.00021, 0.99926, 1.00035, 1.00035, 0.99942, 1.00048, 0.99999,\n 0.99977, 1.00022, 1.00035, 1.00001, 0.99977, 1.00026, 0.99989, 1.00057,\n 1.00001, 0.99936, 1.00052, 1.00012, 0.99996, 1.00043, 1, 1.00035, 0.9994,\n 0.99976, 1.00035, 0.99973, 1.00052, 1.00041, 1.00119, 1.00037, 0.99973,\n 1.00002, 0.99986, 1.00041, 1.00041, 0.99902, 0.9996, 1.00034, 0.99999,\n 1.00026, 0.99999, 1.00026, 0.99973, 1.00052, 0.99973, 1, 0.99973, 1.00041,\n 1.00075, 0.9994, 1.0003, 0.99999, 1, 1.00041, 0.99955, 1, 0.99915, 0.99973,\n 0.99973, 1.00026, 1.00119, 0.99955, 0.99973, 1.0006, 0.99911, 1.0006, 1.00026,\n 0.99972, 1.00026, 0.99902, 1.00041, 0.99973, 0.99999, 1, 1, 1.00038, 1.0005,\n 1.00016, 1.00022, 1.00016, 1.00022, 1.00016, 1.00022, 1.00001, 0.99973, 1, 1,\n 0.99973, 1, 1, 0.99955, 1.0006, 1.0006, 1.0006, 1.0006, 1, 1, 1, 0.99973,\n 0.99973, 0.99972, 1, 1, 1.00106, 0.99999, 0.99998, 0.99998, 0.99999, 0.99998,\n 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 0.99971, 1.00047, 1.00023, 1,\n 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1, 1, 1, 1, 1, 1, 1,\n 0.99972, 1, 1.20985, 1.39713, 1.00003, 1.00031, 1.00015, 1, 0.99561, 1.00027,\n 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999,\n 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144,\n 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144,\n 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144,\n 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144,\n 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144,\n 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625,\n 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.99972,\n 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1,\n 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998,\n 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n];\nconst HelveticaBoldMetrics = { lineHeight: 1.2, lineGap: 0.2 };\n\n// Factors to rescale LiberationSans-BoldItalic.ttf to have the same\n// metrics as NimbusSans-BoldItalic.otf.\nconst HelveticaBoldItalicFactors = [\n 0.76116, 1, 1, 1.0006, 0.99998, 0.99974, 0.99973, 0.99973, 0.99982, 0.99977,\n 1.00087, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006,\n 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973,\n 0.99973, 0.99973, 0.99998, 1, 1.00003, 1.00003, 1.00003, 1.00026, 0.9999,\n 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977,\n 1.0006, 0.99973, 0.99977, 1.00026, 0.99999, 0.99977, 1.00022, 1.00001,\n 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001,\n 1.00001, 1.00026, 0.99998, 1.0006, 0.99998, 1.00003, 0.99973, 0.99998,\n 0.99973, 1.00026, 0.99973, 1.00026, 0.99973, 0.99998, 1.00026, 1.00026,\n 1.0006, 1.0006, 0.99973, 1.0006, 0.99982, 1.00026, 1.00026, 1.00026, 1.00026,\n 0.99959, 0.99973, 0.99998, 1.00026, 0.99973, 1.00022, 0.99973, 0.99973, 1,\n 0.99959, 1.00077, 0.99959, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973,\n 0.99973, 1.00077, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003,\n 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.99973, 1.0006,\n 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 0.99977,\n 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 1, 0.99977, 1.00001, 1.00001,\n 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022,\n 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977,\n 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973,\n 0.99973, 0.99973, 0.99973, 0.99982, 0.99973, 0.99973, 0.99973, 0.99973,\n 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.00026, 1.00026, 1.00026, 1.00026,\n 1.00026, 1.00026, 1.00026, 1.06409, 1.00026, 1.00026, 1.00026, 1.00026,\n 1.00026, 0.99973, 1.00026, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973,\n 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973,\n 0.99977, 0.99973, 0.99977, 1.0044, 0.99977, 1.00026, 1.00001, 0.99973,\n 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973,\n 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026,\n 0.99977, 1.00026, 0.99977, 1.00026, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006,\n 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99971, 0.99973, 0.99973, 1.0006,\n 0.99977, 0.99973, 0.99973, 1.00026, 1.0006, 1.00026, 1.0006, 1.00026, 1.01011,\n 1.00026, 0.99999, 1.00026, 1.0006, 0.99977, 1.00026, 0.99977, 1.00026,\n 0.99977, 1.00026, 0.9993, 0.9998, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026,\n 1.00022, 1.00026, 1, 1.00016, 0.99977, 0.99959, 0.99977, 0.99959, 0.99977,\n 0.99959, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001,\n 0.99973, 1.00026, 0.99998, 1.00026, 0.8121, 1.00026, 0.99998, 0.99977,\n 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977,\n 1.00026, 0.99977, 1.00026, 1.00016, 1.00022, 1.00001, 0.99973, 1.00001,\n 1.00026, 1, 1.00026, 1, 1.00026, 1, 1.0006, 0.99973, 0.99977, 0.99973, 1,\n 0.99982, 1.00022, 1.00026, 1.00001, 0.99973, 1.00026, 0.99998, 0.99998,\n 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998,\n 0.99998, 0.99998, 0.99977, 1, 1, 1.00026, 0.99969, 0.99972, 0.99981, 0.9998,\n 1.0006, 0.99977, 0.99977, 1.00022, 0.91155, 1.00001, 1.00026, 0.99977,\n 1.00022, 1.0006, 0.99977, 1.00001, 0.99999, 0.99977, 0.99966, 1.00022,\n 1.00032, 1.00001, 0.99944, 1.00026, 1.00001, 0.99968, 1.00001, 1.00047, 1,\n 1.0006, 1.00001, 0.99981, 1.00101, 1.00026, 1.0006, 0.99948, 0.99981, 1.00064,\n 0.99973, 0.99942, 1.00101, 1.00061, 1.00026, 1.00069, 1.0006, 1.00014,\n 0.99973, 1.01322, 0.99973, 1.00065, 1.00026, 1.00012, 0.99923, 1, 1.00064,\n 1.00076, 0.99948, 1.00055, 1.00063, 1.00007, 0.99943, 1.0006, 0.99948,\n 1.00026, 0.99948, 0.99943, 1.00001, 1.00001, 1.00029, 1.00038, 1.00035,\n 1.00001, 1.0006, 1.0006, 0.99973, 0.99978, 1.00001, 1.00057, 0.99989, 0.99967,\n 0.99964, 0.99967, 0.99977, 0.99999, 0.99977, 1.00038, 0.99977, 1.00001,\n 0.99973, 1.00066, 0.99967, 0.99967, 1.00041, 0.99998, 0.99999, 0.99977,\n 1.00022, 0.99967, 1.00001, 0.99977, 1.00026, 0.99964, 1.00031, 1.00001,\n 0.99999, 0.99999, 1, 1.00023, 1, 1, 0.99999, 1.00035, 1.00001, 0.99999,\n 0.99973, 0.99977, 0.99999, 1.00058, 0.99973, 0.99973, 0.99955, 0.9995,\n 1.00026, 1.00026, 1.00032, 0.99989, 1.00034, 0.99999, 1.00026, 1.00026,\n 1.00026, 0.99973, 0.45998, 0.99973, 1.00026, 0.99973, 1.00001, 0.99999,\n 0.99982, 0.99994, 0.99996, 1, 1.00042, 1.00044, 1.00029, 1.00023, 0.99973,\n 0.99973, 1.00026, 0.99949, 1.00002, 0.99973, 1.0006, 1.0006, 1.0006, 0.99975,\n 1.00026, 1.00026, 1.00032, 0.98685, 0.99973, 1.00026, 1, 1, 0.99966, 1.00044,\n 1.00016, 1.00022, 1.00016, 1.00022, 1.00016, 1.00022, 1.00001, 0.99973, 1, 1,\n 0.99973, 1, 1, 0.99955, 1.0006, 1.0006, 1.0006, 1.0006, 1, 1, 1, 0.99973,\n 0.99973, 0.99972, 1, 1, 1.00106, 0.99999, 0.99998, 0.99998, 0.99999, 0.99998,\n 1.66475, 1, 0.99973, 0.99973, 1, 0.99973, 0.99971, 0.99978, 1, 1, 0.99991,\n 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1.00098, 1, 1, 1, 1.00049, 1, 1,\n 0.99972, 1, 1.20985, 1.39713, 1.00003, 1.00031, 1.00015, 1, 0.99561, 1.00027,\n 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999,\n 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144,\n 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144,\n 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144,\n 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144,\n 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144,\n 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625,\n 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.99972,\n 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1,\n 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998,\n 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n];\nconst HelveticaBoldItalicMetrics = { lineHeight: 1.35, lineGap: 0.2 };\n\n// Factors to rescale LiberationSans-Italic.ttf to have the same\n// metrics as NimbusSans-Italic.otf.\nconst HelveticaItalicFactors = [\n 0.76116, 1, 1, 1.0006, 1.0006, 1.00006, 0.99973, 0.99973, 0.99982, 1.00001,\n 1.00043, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006,\n 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973,\n 0.99973, 0.99973, 1.0006, 1, 1.00003, 1.00003, 1.00003, 0.99973, 0.99987,\n 1.00001, 1.00001, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977,\n 1.0006, 1, 1.00001, 0.99973, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022,\n 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001,\n 1.00026, 1.0006, 1.0006, 1.0006, 0.99949, 0.99973, 0.99998, 0.99973, 0.99973,\n 1, 0.99973, 0.99973, 1.0006, 0.99973, 0.99973, 0.99924, 0.99924, 1, 0.99924,\n 0.99999, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.0006, 0.99973, 1,\n 0.99977, 1, 1, 1, 1.00005, 1.0009, 1.00005, 1.00003, 0.99998, 0.99973,\n 0.99973, 0.99973, 0.99973, 1.0009, 0.99973, 0.99998, 1.00025, 0.99968,\n 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1,\n 0.9998, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002,\n 1.00026, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1, 0.99977,\n 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977,\n 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022,\n 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973,\n 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 1, 0.99973, 0.99973,\n 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973,\n 0.99973, 0.99973, 0.99973, 0.99973, 1.06409, 1.00026, 0.99973, 0.99973,\n 0.99973, 0.99973, 1, 0.99973, 1, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001,\n 0.99973, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1.0288,\n 0.99977, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973,\n 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973,\n 1.00022, 0.99973, 1.00022, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973,\n 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99924, 1.0006,\n 1.0006, 0.99946, 1.00034, 1, 0.99924, 1.00001, 1, 1, 0.99973, 0.99924,\n 0.99973, 0.99924, 0.99973, 1.06311, 0.99973, 1.00024, 0.99973, 0.99924,\n 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.00041, 0.9998,\n 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1, 1.00016,\n 0.99977, 0.99998, 0.99977, 0.99998, 0.99977, 0.99998, 1.00001, 1, 1.00001, 1,\n 1.00001, 1, 1.00001, 1, 1.00026, 1.0006, 1.00026, 0.89547, 1.00026, 1.0006,\n 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973,\n 0.99977, 0.99973, 0.99977, 0.99973, 1.00016, 0.99977, 1.00001, 1, 1.00001,\n 1.00026, 1, 1.00026, 1, 1.00026, 1, 0.99924, 0.99973, 1.00001, 0.99973, 1,\n 0.99982, 1.00022, 1.00026, 1.00001, 1, 1.00026, 1.0006, 0.99998, 0.99998,\n 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998,\n 0.99998, 1.00001, 1, 1.00054, 0.99977, 1.00084, 1.00007, 0.99973, 1.00013,\n 0.99924, 1.00001, 1.00001, 0.99945, 0.91221, 1.00001, 1.00026, 0.99977,\n 1.00022, 1.0006, 1.00001, 1.00001, 0.99999, 0.99977, 0.99933, 1.00022,\n 1.00054, 1.00001, 1.00065, 1.00026, 1.00001, 1.0001, 1.00001, 1.00052, 1,\n 1.0006, 1.00001, 0.99945, 0.99897, 0.99968, 0.99924, 1.00036, 0.99945,\n 0.99949, 1, 1.0006, 0.99897, 0.99918, 0.99968, 0.99911, 0.99924, 1, 0.99962,\n 1.01487, 1, 1.0005, 0.99973, 1.00012, 1.00043, 1, 0.99995, 0.99994, 1.00036,\n 0.99947, 1.00019, 1.00063, 1.00025, 0.99924, 1.00036, 0.99973, 1.00036,\n 1.00025, 1.00001, 1.00001, 1.00027, 1.0001, 1.00068, 1.00001, 1.0006, 1.0006,\n 1, 1.00008, 0.99957, 0.99972, 0.9994, 0.99954, 0.99975, 1.00051, 1.00001,\n 1.00019, 1.00001, 1.0001, 0.99986, 1.00001, 1.00001, 1.00038, 0.99954,\n 0.99954, 0.9994, 1.00066, 0.99999, 0.99977, 1.00022, 1.00054, 1.00001,\n 0.99977, 1.00026, 0.99975, 1.0001, 1.00001, 0.99993, 0.9995, 0.99955, 1.00016,\n 0.99978, 0.99974, 1.00019, 1.00022, 0.99955, 1.00053, 0.99973, 1.00089,\n 1.00005, 0.99967, 1.00048, 0.99973, 1.00002, 1.00034, 0.99973, 0.99973,\n 0.99964, 1.00006, 1.00066, 0.99947, 0.99973, 0.98894, 0.99973, 1, 0.44898, 1,\n 0.99946, 1, 1.00039, 1.00082, 0.99991, 0.99991, 0.99985, 1.00022, 1.00023,\n 1.00061, 1.00006, 0.99966, 0.99973, 0.99973, 0.99973, 1.00019, 1.0008, 1,\n 0.99924, 0.99924, 0.99924, 0.99983, 1.00044, 0.99973, 0.99964, 0.98332, 1,\n 0.99973, 1, 1, 0.99962, 0.99895, 1.00016, 0.99977, 1.00016, 0.99977, 1.00016,\n 0.99977, 1.00001, 1, 1, 1, 0.99973, 1, 1, 0.99955, 0.99924, 0.99924, 0.99924,\n 0.99924, 0.99998, 0.99998, 0.99998, 0.99973, 0.99973, 0.99972, 1, 1, 1.00267,\n 0.99999, 0.99998, 0.99998, 1, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023,\n 0.99973, 1.00423, 0.99925, 0.99999, 1, 0.99991, 0.99984, 1.00002, 1.00002,\n 1.00002, 1.00002, 1.00049, 1, 1.00245, 1, 1, 1, 1, 0.96329, 1, 1.20985,\n 1.39713, 1.00003, 0.8254, 1.00015, 1, 1.00035, 1.00027, 1.00031, 1.00031,\n 1.00003, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6,\n 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144,\n 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144,\n 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144,\n 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144,\n 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144,\n 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861,\n 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.95317, 0.99999, 0.99999,\n 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962,\n 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n];\nconst HelveticaItalicMetrics = { lineHeight: 1.35, lineGap: 0.2 };\n\n// Factors to rescale LiberationSans-Regular.ttf to have the same\n// metrics as NimbusSans-Regular.otf.\nconst HelveticaRegularFactors = [\n 0.76116, 1, 1, 1.0006, 1.0006, 1.00006, 0.99973, 0.99973, 0.99982, 1.00001,\n 1.00043, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006,\n 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973,\n 0.99973, 0.99973, 1.0006, 1, 1.00003, 1.00003, 1.00003, 0.99973, 0.99987,\n 1.00001, 1.00001, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977,\n 1.0006, 1, 1.00001, 0.99973, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022,\n 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001,\n 1.00026, 1.0006, 1.0006, 1.0006, 0.99949, 0.99973, 0.99998, 0.99973, 0.99973,\n 1, 0.99973, 0.99973, 1.0006, 0.99973, 0.99973, 0.99924, 0.99924, 1, 0.99924,\n 0.99999, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.0006, 0.99973, 1,\n 0.99977, 1, 1, 1, 1.00005, 1.0009, 1.00005, 1.00003, 0.99998, 0.99973,\n 0.99973, 0.99973, 0.99973, 1.0009, 0.99973, 0.99998, 1.00025, 0.99968,\n 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1,\n 0.9998, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002,\n 1.00026, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1, 0.99977,\n 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977,\n 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022,\n 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973,\n 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 1, 0.99973, 0.99973,\n 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973,\n 0.99973, 0.99973, 0.99973, 0.99973, 1.06409, 1.00026, 0.99973, 0.99973,\n 0.99973, 0.99973, 1, 0.99973, 1, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001,\n 0.99973, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1.04596,\n 0.99977, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973,\n 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973,\n 1.00022, 0.99973, 1.00022, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973,\n 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99924, 1.0006,\n 1.0006, 1.00019, 1.00034, 1, 0.99924, 1.00001, 1, 1, 0.99973, 0.99924,\n 0.99973, 0.99924, 0.99973, 1.02572, 0.99973, 1.00005, 0.99973, 0.99924,\n 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99999, 0.9998,\n 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1, 1.00016,\n 0.99977, 0.99998, 0.99977, 0.99998, 0.99977, 0.99998, 1.00001, 1, 1.00001, 1,\n 1.00001, 1, 1.00001, 1, 1.00026, 1.0006, 1.00026, 0.84533, 1.00026, 1.0006,\n 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973,\n 0.99977, 0.99973, 0.99977, 0.99973, 1.00016, 0.99977, 1.00001, 1, 1.00001,\n 1.00026, 1, 1.00026, 1, 1.00026, 1, 0.99924, 0.99973, 1.00001, 0.99973, 1,\n 0.99982, 1.00022, 1.00026, 1.00001, 1, 1.00026, 1.0006, 0.99998, 0.99998,\n 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998,\n 0.99998, 0.99928, 1, 0.99977, 1.00013, 1.00055, 0.99947, 0.99945, 0.99941,\n 0.99924, 1.00001, 1.00001, 1.0004, 0.91621, 1.00001, 1.00026, 0.99977,\n 1.00022, 1.0006, 1.00001, 1.00005, 0.99999, 0.99977, 1.00015, 1.00022,\n 0.99977, 1.00001, 0.99973, 1.00026, 1.00001, 1.00019, 1.00001, 0.99946, 1,\n 1.0006, 1.00001, 0.99978, 1.00045, 0.99973, 0.99924, 1.00023, 0.99978,\n 0.99966, 1, 1.00065, 1.00045, 1.00019, 0.99973, 0.99973, 0.99924, 1, 1,\n 0.96499, 1, 1.00055, 0.99973, 1.00008, 1.00027, 1, 0.9997, 0.99995, 1.00023,\n 0.99933, 1.00019, 1.00015, 1.00031, 0.99924, 1.00023, 0.99973, 1.00023,\n 1.00031, 1.00001, 0.99928, 1.00029, 1.00092, 1.00035, 1.00001, 1.0006, 1.0006,\n 1, 0.99988, 0.99975, 1, 1.00082, 0.99561, 0.9996, 1.00035, 1.00001, 0.99962,\n 1.00001, 1.00092, 0.99964, 1.00001, 0.99963, 0.99999, 1.00035, 1.00035,\n 1.00082, 0.99962, 0.99999, 0.99977, 1.00022, 1.00035, 1.00001, 0.99977,\n 1.00026, 0.9996, 0.99967, 1.00001, 1.00034, 1.00074, 1.00054, 1.00053,\n 1.00063, 0.99971, 0.99962, 1.00035, 0.99975, 0.99977, 0.99973, 1.00043,\n 0.99953, 1.0007, 0.99915, 0.99973, 1.00008, 0.99892, 1.00073, 1.00073,\n 1.00114, 0.99915, 1.00073, 0.99955, 0.99973, 1.00092, 0.99973, 1, 0.99998, 1,\n 1.0003, 1, 1.00043, 1.00001, 0.99969, 1.0003, 1, 1.00035, 1.00001, 0.9995, 1,\n 1.00092, 0.99973, 0.99973, 0.99973, 1.0007, 0.9995, 1, 0.99924, 1.0006,\n 0.99924, 0.99972, 1.00062, 0.99973, 1.00114, 1.00073, 1, 0.99955, 1, 1,\n 1.00047, 0.99968, 1.00016, 0.99977, 1.00016, 0.99977, 1.00016, 0.99977,\n 1.00001, 1, 1, 1, 0.99973, 1, 1, 0.99955, 0.99924, 0.99924, 0.99924, 0.99924,\n 0.99998, 0.99998, 0.99998, 0.99973, 0.99973, 0.99972, 1, 1, 1.00267, 0.99999,\n 0.99998, 0.99998, 1, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973,\n 0.99971, 0.99925, 1.00023, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002,\n 1.00002, 1, 1, 1, 1, 1, 1, 1, 0.96329, 1, 1.20985, 1.39713, 1.00003, 0.8254,\n 1.00015, 1, 1.00035, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031,\n 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144,\n 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144,\n 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144,\n 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144,\n 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144,\n 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144,\n 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026,\n 1.00026, 1.00026, 0.95317, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1,\n 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n];\nconst HelveticaRegularMetrics = { lineHeight: 1.2, lineGap: 0.2 };\n\nexport {\n HelveticaBoldFactors,\n HelveticaBoldItalicFactors,\n HelveticaBoldItalicMetrics,\n HelveticaBoldMetrics,\n HelveticaItalicFactors,\n HelveticaItalicMetrics,\n HelveticaRegularFactors,\n HelveticaRegularMetrics,\n};\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// Widths of glyphs in LiberationSans-Bold.ttf.\nconst LiberationSansBoldWidths = [\n 365, 0, 333, 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, 278,\n 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333,\n 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556,\n 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667,\n 611, 333, 278, 333, 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, 611,\n 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778,\n 556, 556, 500, 389, 280, 389, 584, 333, 556, 556, 556, 556, 280, 556, 333,\n 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 556, 278, 333,\n 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1000, 722,\n 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778,\n 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556,\n 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611,\n 611, 611, 549, 611, 611, 611, 611, 611, 556, 611, 556, 722, 556, 722, 556,\n 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 719, 722, 611, 667,\n 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 611, 778, 611, 778, 611,\n 778, 611, 722, 611, 722, 611, 278, 278, 278, 278, 278, 278, 278, 278, 278,\n 278, 785, 556, 556, 278, 722, 556, 556, 611, 278, 611, 278, 611, 385, 611,\n 479, 611, 278, 722, 611, 722, 611, 722, 611, 708, 723, 611, 778, 611, 778,\n 611, 778, 611, 1000, 944, 722, 389, 722, 389, 722, 389, 667, 556, 667, 556,\n 667, 556, 667, 556, 611, 333, 611, 479, 611, 333, 722, 611, 722, 611, 722,\n 611, 722, 611, 722, 611, 722, 611, 944, 778, 667, 556, 667, 611, 500, 611,\n 500, 611, 500, 278, 556, 722, 556, 1000, 889, 778, 611, 667, 556, 611, 333,\n 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 465, 722, 333, 853, 906,\n 474, 825, 927, 838, 278, 722, 722, 601, 719, 667, 611, 722, 778, 278, 722,\n 667, 833, 722, 644, 778, 722, 667, 600, 611, 667, 821, 667, 809, 802, 278,\n 667, 615, 451, 611, 278, 582, 615, 610, 556, 606, 475, 460, 611, 541, 278,\n 558, 556, 612, 556, 445, 611, 766, 619, 520, 684, 446, 582, 715, 576, 753,\n 845, 278, 582, 611, 582, 845, 667, 669, 885, 567, 711, 667, 278, 276, 556,\n 1094, 1062, 875, 610, 722, 622, 719, 722, 719, 722, 567, 712, 667, 904, 626,\n 719, 719, 610, 702, 833, 722, 778, 719, 667, 722, 611, 622, 854, 667, 730,\n 703, 1005, 1019, 870, 979, 719, 711, 1031, 719, 556, 618, 615, 417, 635, 556,\n 709, 497, 615, 615, 500, 635, 740, 604, 611, 604, 611, 556, 490, 556, 875,\n 556, 615, 581, 833, 844, 729, 854, 615, 552, 854, 583, 556, 556, 611, 417,\n 552, 556, 278, 281, 278, 969, 906, 611, 500, 615, 556, 604, 778, 611, 487,\n 447, 944, 778, 944, 778, 944, 778, 667, 556, 333, 333, 556, 1000, 1000, 552,\n 278, 278, 278, 278, 500, 500, 500, 556, 556, 350, 1000, 1000, 240, 479, 333,\n 333, 604, 333, 167, 396, 556, 556, 1094, 556, 885, 489, 1115, 1000, 768, 600,\n 834, 834, 834, 834, 1000, 500, 1000, 500, 1000, 500, 500, 494, 612, 823, 713,\n 584, 549, 713, 979, 722, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604,\n 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708,\n 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708,\n 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708,\n 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604,\n 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750,\n 611, 611, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 333, 333, 333,\n 333, 333, 333, 333, 333,\n];\n\n// Char code of glyphs in LiberationSans-Bold.ttf.\nconst LiberationSansBoldMapping = [\n -1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,\n 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,\n 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,\n 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,\n 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,\n 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167,\n 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183,\n 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198,\n 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213,\n 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,\n 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243,\n 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258,\n 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273,\n 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288,\n 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303,\n 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318,\n 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333,\n 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348,\n 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363,\n 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378,\n 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538,\n 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904,\n 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921,\n 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937,\n 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952,\n 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967,\n 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030,\n 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043,\n 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056,\n 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069,\n 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082,\n 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095,\n 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108,\n 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139,\n 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211,\n 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226,\n 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359,\n 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593,\n 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735,\n 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474,\n 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555,\n 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568,\n 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600,\n 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650,\n 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792,\n 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1,\n -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n];\n\n// Widths of glyphs in LiberationSans-BoldItalic.ttf.\nconst LiberationSansBoldItalicWidths = [\n 365, 0, 333, 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, 278,\n 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333,\n 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556,\n 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667,\n 611, 333, 278, 333, 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, 611,\n 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778,\n 556, 556, 500, 389, 280, 389, 584, 333, 556, 556, 556, 556, 280, 556, 333,\n 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 556, 278, 333,\n 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1000, 722,\n 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778,\n 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556,\n 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611,\n 611, 611, 549, 611, 611, 611, 611, 611, 556, 611, 556, 722, 556, 722, 556,\n 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 740, 722, 611, 667,\n 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 611, 778, 611, 778, 611,\n 778, 611, 722, 611, 722, 611, 278, 278, 278, 278, 278, 278, 278, 278, 278,\n 278, 782, 556, 556, 278, 722, 556, 556, 611, 278, 611, 278, 611, 396, 611,\n 479, 611, 278, 722, 611, 722, 611, 722, 611, 708, 723, 611, 778, 611, 778,\n 611, 778, 611, 1000, 944, 722, 389, 722, 389, 722, 389, 667, 556, 667, 556,\n 667, 556, 667, 556, 611, 333, 611, 479, 611, 333, 722, 611, 722, 611, 722,\n 611, 722, 611, 722, 611, 722, 611, 944, 778, 667, 556, 667, 611, 500, 611,\n 500, 611, 500, 278, 556, 722, 556, 1000, 889, 778, 611, 667, 556, 611, 333,\n 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 722, 333, 854, 906,\n 473, 844, 930, 847, 278, 722, 722, 610, 671, 667, 611, 722, 778, 278, 722,\n 667, 833, 722, 657, 778, 718, 667, 590, 611, 667, 822, 667, 829, 781, 278,\n 667, 620, 479, 611, 278, 591, 620, 621, 556, 610, 479, 492, 611, 558, 278,\n 566, 556, 603, 556, 450, 611, 712, 605, 532, 664, 409, 591, 704, 578, 773,\n 834, 278, 591, 611, 591, 834, 667, 667, 886, 614, 719, 667, 278, 278, 556,\n 1094, 1042, 854, 622, 719, 677, 719, 722, 708, 722, 614, 722, 667, 927, 643,\n 719, 719, 615, 687, 833, 722, 778, 719, 667, 722, 611, 677, 781, 667, 729,\n 708, 979, 989, 854, 1000, 708, 719, 1042, 729, 556, 619, 604, 534, 618, 556,\n 736, 510, 611, 611, 507, 622, 740, 604, 611, 611, 611, 556, 889, 556, 885,\n 556, 646, 583, 889, 935, 707, 854, 594, 552, 865, 589, 556, 556, 611, 469,\n 563, 556, 278, 278, 278, 969, 906, 611, 507, 619, 556, 611, 778, 611, 575,\n 467, 944, 778, 944, 778, 944, 778, 667, 556, 333, 333, 556, 1000, 1000, 552,\n 278, 278, 278, 278, 500, 500, 500, 556, 556, 350, 1000, 1000, 240, 479, 333,\n 333, 604, 333, 167, 396, 556, 556, 1104, 556, 885, 516, 1146, 1000, 768, 600,\n 834, 834, 834, 834, 999, 500, 1000, 500, 1000, 500, 500, 494, 612, 823, 713,\n 584, 549, 713, 979, 722, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604,\n 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708,\n 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708,\n 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708,\n 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604,\n 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750,\n 611, 611, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 333, 333, 333,\n 333, 333, 333, 333, 333,\n];\n\n// Char code of glyphs in LiberationSans-BoldItalic.ttf.\nconst LiberationSansBoldItalicMapping = [\n -1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,\n 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,\n 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,\n 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,\n 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,\n 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167,\n 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183,\n 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198,\n 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213,\n 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,\n 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243,\n 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258,\n 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273,\n 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288,\n 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303,\n 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318,\n 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333,\n 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348,\n 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363,\n 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378,\n 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538,\n 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904,\n 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921,\n 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937,\n 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952,\n 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967,\n 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030,\n 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043,\n 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056,\n 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069,\n 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082,\n 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095,\n 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108,\n 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139,\n 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211,\n 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226,\n 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359,\n 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593,\n 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735,\n 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474,\n 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555,\n 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568,\n 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600,\n 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650,\n 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792,\n 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1,\n -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n];\n\n// Widths of glyphs in LiberationSans-Italic.ttf.\nconst LiberationSansItalicWidths = [\n 365, 0, 333, 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278,\n 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278,\n 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500,\n 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667,\n 611, 278, 278, 278, 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, 556,\n 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722,\n 500, 500, 500, 334, 260, 334, 584, 333, 556, 556, 556, 556, 260, 556, 333,\n 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 537, 278, 333,\n 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1000, 722,\n 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778,\n 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556,\n 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556,\n 556, 556, 549, 611, 556, 556, 556, 556, 500, 556, 500, 667, 556, 667, 556,\n 667, 556, 722, 500, 722, 500, 722, 500, 722, 500, 722, 625, 722, 556, 667,\n 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 556, 778, 556, 778, 556,\n 778, 556, 722, 556, 722, 556, 278, 278, 278, 278, 278, 278, 278, 222, 278,\n 278, 733, 444, 500, 222, 667, 500, 500, 556, 222, 556, 222, 556, 281, 556,\n 400, 556, 222, 722, 556, 722, 556, 722, 556, 615, 723, 556, 778, 556, 778,\n 556, 778, 556, 1000, 944, 722, 333, 722, 333, 722, 333, 667, 500, 667, 500,\n 667, 500, 667, 500, 611, 278, 611, 354, 611, 278, 722, 556, 722, 556, 722,\n 556, 722, 556, 722, 556, 722, 556, 944, 722, 667, 500, 667, 611, 500, 611,\n 500, 611, 500, 222, 556, 667, 556, 1000, 889, 778, 611, 667, 500, 611, 278,\n 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 667, 278, 789, 846,\n 389, 794, 865, 775, 222, 667, 667, 570, 671, 667, 611, 722, 778, 278, 667,\n 667, 833, 722, 648, 778, 725, 667, 600, 611, 667, 837, 667, 831, 761, 278,\n 667, 570, 439, 555, 222, 550, 570, 571, 500, 556, 439, 463, 555, 542, 222,\n 500, 492, 548, 500, 447, 556, 670, 573, 486, 603, 374, 550, 652, 546, 728,\n 779, 222, 550, 556, 550, 779, 667, 667, 843, 544, 708, 667, 278, 278, 500,\n 1066, 982, 844, 589, 715, 639, 724, 667, 651, 667, 544, 704, 667, 917, 614,\n 715, 715, 589, 686, 833, 722, 778, 725, 667, 722, 611, 639, 795, 667, 727,\n 673, 920, 923, 805, 886, 651, 694, 1022, 682, 556, 562, 522, 493, 553, 556,\n 688, 465, 556, 556, 472, 564, 686, 550, 556, 556, 556, 500, 833, 500, 835,\n 500, 572, 518, 830, 851, 621, 736, 526, 492, 752, 534, 556, 556, 556, 378,\n 496, 500, 222, 222, 222, 910, 828, 556, 472, 565, 500, 556, 778, 556, 492,\n 339, 944, 722, 944, 722, 944, 722, 667, 500, 333, 333, 556, 1000, 1000, 552,\n 222, 222, 222, 222, 333, 333, 333, 556, 556, 350, 1000, 1000, 188, 354, 333,\n 333, 500, 333, 167, 365, 556, 556, 1094, 556, 885, 323, 1083, 1000, 768, 600,\n 834, 834, 834, 834, 1000, 500, 998, 500, 1000, 500, 500, 494, 612, 823, 713,\n 584, 549, 713, 979, 719, 274, 549, 549, 584, 549, 549, 604, 584, 604, 604,\n 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708,\n 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708,\n 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708,\n 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604,\n 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750,\n 500, 500, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 294, 294, 324,\n 324, 316, 328, 398, 285,\n];\n\n// Char code of glyphs in LiberationSans-Italic.ttf.\nconst LiberationSansItalicMapping = [\n -1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,\n 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,\n 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,\n 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,\n 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,\n 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167,\n 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183,\n 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198,\n 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213,\n 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,\n 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243,\n 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258,\n 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273,\n 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288,\n 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303,\n 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318,\n 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333,\n 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348,\n 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363,\n 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378,\n 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538,\n 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904,\n 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921,\n 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937,\n 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952,\n 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967,\n 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030,\n 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043,\n 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056,\n 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069,\n 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082,\n 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095,\n 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108,\n 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139,\n 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211,\n 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226,\n 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359,\n 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593,\n 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735,\n 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474,\n 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555,\n 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568,\n 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600,\n 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650,\n 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792,\n 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1,\n -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n];\n\n// Widths of glyphs in LiberationSans-Regular.ttf.\nconst LiberationSansRegularWidths = [\n 365, 0, 333, 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278,\n 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278,\n 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500,\n 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667,\n 611, 278, 278, 278, 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, 556,\n 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722,\n 500, 500, 500, 334, 260, 334, 584, 333, 556, 556, 556, 556, 260, 556, 333,\n 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 537, 278, 333,\n 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1000, 722,\n 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778,\n 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556,\n 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556,\n 556, 556, 549, 611, 556, 556, 556, 556, 500, 556, 500, 667, 556, 667, 556,\n 667, 556, 722, 500, 722, 500, 722, 500, 722, 500, 722, 615, 722, 556, 667,\n 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 556, 778, 556, 778, 556,\n 778, 556, 722, 556, 722, 556, 278, 278, 278, 278, 278, 278, 278, 222, 278,\n 278, 735, 444, 500, 222, 667, 500, 500, 556, 222, 556, 222, 556, 292, 556,\n 334, 556, 222, 722, 556, 722, 556, 722, 556, 604, 723, 556, 778, 556, 778,\n 556, 778, 556, 1000, 944, 722, 333, 722, 333, 722, 333, 667, 500, 667, 500,\n 667, 500, 667, 500, 611, 278, 611, 375, 611, 278, 722, 556, 722, 556, 722,\n 556, 722, 556, 722, 556, 722, 556, 944, 722, 667, 500, 667, 611, 500, 611,\n 500, 611, 500, 222, 556, 667, 556, 1000, 889, 778, 611, 667, 500, 611, 278,\n 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 667, 278, 784, 838,\n 384, 774, 855, 752, 222, 667, 667, 551, 668, 667, 611, 722, 778, 278, 667,\n 668, 833, 722, 650, 778, 722, 667, 618, 611, 667, 798, 667, 835, 748, 278,\n 667, 578, 446, 556, 222, 547, 578, 575, 500, 557, 446, 441, 556, 556, 222,\n 500, 500, 576, 500, 448, 556, 690, 569, 482, 617, 395, 547, 648, 525, 713,\n 781, 222, 547, 556, 547, 781, 667, 667, 865, 542, 719, 667, 278, 278, 500,\n 1057, 1010, 854, 583, 722, 635, 719, 667, 656, 667, 542, 677, 667, 923, 604,\n 719, 719, 583, 656, 833, 722, 778, 719, 667, 722, 611, 635, 760, 667, 740,\n 667, 917, 938, 792, 885, 656, 719, 1010, 722, 556, 573, 531, 365, 583, 556,\n 669, 458, 559, 559, 438, 583, 688, 552, 556, 542, 556, 500, 458, 500, 823,\n 500, 573, 521, 802, 823, 625, 719, 521, 510, 750, 542, 556, 556, 556, 365,\n 510, 500, 222, 278, 222, 906, 812, 556, 438, 559, 500, 552, 778, 556, 489,\n 411, 944, 722, 944, 722, 944, 722, 667, 500, 333, 333, 556, 1000, 1000, 552,\n 222, 222, 222, 222, 333, 333, 333, 556, 556, 350, 1000, 1000, 188, 354, 333,\n 333, 500, 333, 167, 365, 556, 556, 1094, 556, 885, 323, 1073, 1000, 768, 600,\n 834, 834, 834, 834, 1000, 500, 1000, 500, 1000, 500, 500, 494, 612, 823, 713,\n 584, 549, 713, 979, 719, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604,\n 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708,\n 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708,\n 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708,\n 708, 708, 729, 604, 604, 354, 354, 1000, 990, 990, 990, 990, 494, 604, 604,\n 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750,\n 500, 500, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 294, 294, 324,\n 324, 316, 328, 398, 285,\n];\n\n// Char code of glyphs in LiberationSans-Regular.ttf.\nconst LiberationSansRegularMapping = [\n -1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47,\n 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66,\n 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85,\n 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103,\n 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,\n 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167,\n 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183,\n 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198,\n 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213,\n 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228,\n 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243,\n 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258,\n 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273,\n 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288,\n 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303,\n 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318,\n 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333,\n 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348,\n 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363,\n 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378,\n 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538,\n 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904,\n 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921,\n 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937,\n 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952,\n 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967,\n 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030,\n 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043,\n 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056,\n 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069,\n 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082,\n 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095,\n 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108,\n 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139,\n 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211,\n 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226,\n 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359,\n 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593,\n 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735,\n 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474,\n 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555,\n 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568,\n 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600,\n 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650,\n 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792,\n 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1,\n -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,\n];\n\nexport {\n LiberationSansBoldItalicMapping,\n LiberationSansBoldItalicWidths,\n LiberationSansBoldMapping,\n LiberationSansBoldWidths,\n LiberationSansItalicMapping,\n LiberationSansItalicWidths,\n LiberationSansRegularMapping,\n LiberationSansRegularWidths,\n};\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// Factors to rescale LiberationSans-Bold.ttf to have the same\n// metrics as MyriadPro-Bold.otf.\nconst MyriadProBoldFactors = [\n 1.36898, 1, 1, 0.72706, 0.80479, 0.83734, 0.98894, 0.99793, 0.9897, 0.93884,\n 0.86209, 0.94292, 0.94292, 1.16661, 1.02058, 0.93582, 0.96694, 0.93582,\n 1.19137, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793,\n 0.99793, 0.99793, 0.99793, 0.78076, 0.78076, 1.02058, 1.02058, 1.02058,\n 0.72851, 0.78966, 0.90838, 0.83637, 0.82391, 0.96376, 0.80061, 0.86275,\n 0.8768, 0.95407, 1.0258, 0.73901, 0.85022, 0.83655, 1.0156, 0.95546, 0.92179,\n 0.87107, 0.92179, 0.82114, 0.8096, 0.89713, 0.94438, 0.95353, 0.94083,\n 0.91905, 0.90406, 0.9446, 0.94292, 1.18777, 0.94292, 1.02058, 0.89903,\n 0.90088, 0.94938, 0.97898, 0.81093, 0.97571, 0.94938, 1.024, 0.9577, 0.95933,\n 0.98621, 1.0474, 0.97455, 0.98981, 0.9672, 0.95933, 0.9446, 0.97898, 0.97407,\n 0.97646, 0.78036, 1.10208, 0.95442, 0.95298, 0.97579, 0.9332, 0.94039, 0.938,\n 0.80687, 1.01149, 0.80687, 1.02058, 0.80479, 0.99793, 0.99793, 0.99793,\n 0.99793, 1.01149, 1.00872, 0.90088, 0.91882, 1.0213, 0.8361, 1.02058, 0.62295,\n 0.54324, 0.89022, 1.08595, 1, 1, 0.90088, 1, 0.97455, 0.93582, 0.90088, 1,\n 1.05686, 0.8361, 0.99642, 0.99642, 0.99642, 0.72851, 0.90838, 0.90838,\n 0.90838, 0.90838, 0.90838, 0.90838, 0.868, 0.82391, 0.80061, 0.80061, 0.80061,\n 0.80061, 1.0258, 1.0258, 1.0258, 1.0258, 0.97484, 0.95546, 0.92179, 0.92179,\n 0.92179, 0.92179, 0.92179, 1.02058, 0.92179, 0.94438, 0.94438, 0.94438,\n 0.94438, 0.90406, 0.86958, 0.98225, 0.94938, 0.94938, 0.94938, 0.94938,\n 0.94938, 0.94938, 0.9031, 0.81093, 0.94938, 0.94938, 0.94938, 0.94938,\n 0.98621, 0.98621, 0.98621, 0.98621, 0.93969, 0.95933, 0.9446, 0.9446, 0.9446,\n 0.9446, 0.9446, 1.08595, 0.9446, 0.95442, 0.95442, 0.95442, 0.95442, 0.94039,\n 0.97898, 0.94039, 0.90838, 0.94938, 0.90838, 0.94938, 0.90838, 0.94938,\n 0.82391, 0.81093, 0.82391, 0.81093, 0.82391, 0.81093, 0.82391, 0.81093,\n 0.96376, 0.84313, 0.97484, 0.97571, 0.80061, 0.94938, 0.80061, 0.94938,\n 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.8768, 0.9577, 0.8768,\n 0.9577, 0.8768, 0.9577, 1, 1, 0.95407, 0.95933, 0.97069, 0.95933, 1.0258,\n 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621,\n 0.887, 1.01591, 0.73901, 1.0474, 1, 1, 0.97455, 0.83655, 0.98981, 1, 1,\n 0.83655, 0.73977, 0.83655, 0.73903, 0.84638, 1.033, 0.95546, 0.95933, 1, 1,\n 0.95546, 0.95933, 0.8271, 0.95417, 0.95933, 0.92179, 0.9446, 0.92179, 0.9446,\n 0.92179, 0.9446, 0.936, 0.91964, 0.82114, 0.97646, 1, 1, 0.82114, 0.97646,\n 0.8096, 0.78036, 0.8096, 0.78036, 1, 1, 0.8096, 0.78036, 1, 1, 0.89713,\n 0.77452, 0.89713, 1.10208, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438,\n 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94083,\n 0.97579, 0.90406, 0.94039, 0.90406, 0.9446, 0.938, 0.9446, 0.938, 0.9446,\n 0.938, 1, 0.99793, 0.90838, 0.94938, 0.868, 0.9031, 0.92179, 0.9446, 1, 1,\n 0.89713, 1.10208, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088,\n 0.90088, 0.90088, 0.90088, 0.90989, 0.9358, 0.91945, 0.83181, 0.75261,\n 0.87992, 0.82976, 0.96034, 0.83689, 0.97268, 1.0078, 0.90838, 0.83637, 0.8019,\n 0.90157, 0.80061, 0.9446, 0.95407, 0.92436, 1.0258, 0.85022, 0.97153, 1.0156,\n 0.95546, 0.89192, 0.92179, 0.92361, 0.87107, 0.96318, 0.89713, 0.93704,\n 0.95638, 0.91905, 0.91709, 0.92796, 1.0258, 0.93704, 0.94836, 1.0373, 0.95933,\n 1.0078, 0.95871, 0.94836, 0.96174, 0.92601, 0.9498, 0.98607, 0.95776, 0.95933,\n 1.05453, 1.0078, 0.98275, 0.9314, 0.95617, 0.91701, 1.05993, 0.9446, 0.78367,\n 0.9553, 1, 0.86832, 1.0128, 0.95871, 0.99394, 0.87548, 0.96361, 0.86774,\n 1.0078, 0.95871, 0.9446, 0.95871, 0.86774, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.94083, 0.97579, 0.94083, 0.97579, 0.94083,\n 0.97579, 0.90406, 0.94039, 0.96694, 1, 0.89903, 1, 1, 1, 0.93582, 0.93582,\n 0.93582, 1, 0.908, 0.908, 0.918, 0.94219, 0.94219, 0.96544, 1, 1.285, 1, 1,\n 0.81079, 0.81079, 1, 1, 0.74854, 1, 1, 1, 1, 0.99793, 1, 1, 1, 0.65, 1,\n 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.17173, 1, 0.80535, 0.76169,\n 1.02058, 1.0732, 1.05486, 1, 1, 1.30692, 1.08595, 1.08595, 1, 1.08595,\n 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.16161, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n];\nconst MyriadProBoldMetrics = { lineHeight: 1.2, lineGap: 0.2 };\n\n// Factors to rescale LiberationSans-BoldItalic.ttf to have the same\n// metrics as MyriadPro-BoldIt.otf.\nconst MyriadProBoldItalicFactors = [\n 1.36898, 1, 1, 0.66227, 0.80779, 0.81625, 0.97276, 0.97276, 0.97733, 0.92222,\n 0.83266, 0.94292, 0.94292, 1.16148, 1.02058, 0.93582, 0.96694, 0.93582,\n 1.17337, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276,\n 0.97276, 0.97276, 0.97276, 0.78076, 0.78076, 1.02058, 1.02058, 1.02058,\n 0.71541, 0.76813, 0.85576, 0.80591, 0.80729, 0.94299, 0.77512, 0.83655,\n 0.86523, 0.92222, 0.98621, 0.71743, 0.81698, 0.79726, 0.98558, 0.92222,\n 0.90637, 0.83809, 0.90637, 0.80729, 0.76463, 0.86275, 0.90699, 0.91605,\n 0.9154, 0.85308, 0.85458, 0.90531, 0.94292, 1.21296, 0.94292, 1.02058,\n 0.89903, 1.18616, 0.99613, 0.91677, 0.78216, 0.91677, 0.90083, 0.98796,\n 0.9135, 0.92168, 0.95381, 0.98981, 0.95298, 0.95381, 0.93459, 0.92168,\n 0.91513, 0.92004, 0.91677, 0.95077, 0.748, 1.04502, 0.91677, 0.92061, 0.94236,\n 0.89544, 0.89364, 0.9, 0.80687, 0.8578, 0.80687, 1.02058, 0.80779, 0.97276,\n 0.97276, 0.97276, 0.97276, 0.8578, 0.99973, 1.18616, 0.91339, 1.08074,\n 0.82891, 1.02058, 0.55509, 0.71526, 0.89022, 1.08595, 1, 1, 1.18616, 1,\n 0.96736, 0.93582, 1.18616, 1, 1.04864, 0.82711, 0.99043, 0.99043, 0.99043,\n 0.71541, 0.85576, 0.85576, 0.85576, 0.85576, 0.85576, 0.85576, 0.845, 0.80729,\n 0.77512, 0.77512, 0.77512, 0.77512, 0.98621, 0.98621, 0.98621, 0.98621,\n 0.95961, 0.92222, 0.90637, 0.90637, 0.90637, 0.90637, 0.90637, 1.02058,\n 0.90251, 0.90699, 0.90699, 0.90699, 0.90699, 0.85458, 0.83659, 0.94951,\n 0.99613, 0.99613, 0.99613, 0.99613, 0.99613, 0.99613, 0.85811, 0.78216,\n 0.90083, 0.90083, 0.90083, 0.90083, 0.95381, 0.95381, 0.95381, 0.95381,\n 0.9135, 0.92168, 0.91513, 0.91513, 0.91513, 0.91513, 0.91513, 1.08595,\n 0.91677, 0.91677, 0.91677, 0.91677, 0.91677, 0.89364, 0.92332, 0.89364,\n 0.85576, 0.99613, 0.85576, 0.99613, 0.85576, 0.99613, 0.80729, 0.78216,\n 0.80729, 0.78216, 0.80729, 0.78216, 0.80729, 0.78216, 0.94299, 0.76783,\n 0.95961, 0.91677, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083,\n 0.77512, 0.90083, 0.77512, 0.90083, 0.86523, 0.9135, 0.86523, 0.9135, 0.86523,\n 0.9135, 1, 1, 0.92222, 0.92168, 0.92222, 0.92168, 0.98621, 0.95381, 0.98621,\n 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.86036,\n 0.97096, 0.71743, 0.98981, 1, 1, 0.95298, 0.79726, 0.95381, 1, 1, 0.79726,\n 0.6894, 0.79726, 0.74321, 0.81691, 1.0006, 0.92222, 0.92168, 1, 1, 0.92222,\n 0.92168, 0.79464, 0.92098, 0.92168, 0.90637, 0.91513, 0.90637, 0.91513,\n 0.90637, 0.91513, 0.909, 0.87514, 0.80729, 0.95077, 1, 1, 0.80729, 0.95077,\n 0.76463, 0.748, 0.76463, 0.748, 1, 1, 0.76463, 0.748, 1, 1, 0.86275, 0.72651,\n 0.86275, 1.04502, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677,\n 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.9154, 0.94236,\n 0.85458, 0.89364, 0.85458, 0.90531, 0.9, 0.90531, 0.9, 0.90531, 0.9, 1,\n 0.97276, 0.85576, 0.99613, 0.845, 0.85811, 0.90251, 0.91677, 1, 1, 0.86275,\n 1.04502, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616,\n 1.18616, 1.18616, 1.00899, 1.30628, 0.85576, 0.80178, 0.66862, 0.7927,\n 0.69323, 0.88127, 0.72459, 0.89711, 0.95381, 0.85576, 0.80591, 0.7805,\n 0.94729, 0.77512, 0.90531, 0.92222, 0.90637, 0.98621, 0.81698, 0.92655,\n 0.98558, 0.92222, 0.85359, 0.90637, 0.90976, 0.83809, 0.94523, 0.86275,\n 0.83509, 0.93157, 0.85308, 0.83392, 0.92346, 0.98621, 0.83509, 0.92886,\n 0.91324, 0.92168, 0.95381, 0.90646, 0.92886, 0.90557, 0.86847, 0.90276,\n 0.91324, 0.86842, 0.92168, 0.99531, 0.95381, 0.9224, 0.85408, 0.92699,\n 0.86847, 1.0051, 0.91513, 0.80487, 0.93481, 1, 0.88159, 1.05214, 0.90646,\n 0.97355, 0.81539, 0.89398, 0.85923, 0.95381, 0.90646, 0.91513, 0.90646,\n 0.85923, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 0.9154, 0.94236, 0.9154, 0.94236, 0.9154, 0.94236, 0.85458, 0.89364, 0.96694,\n 1, 0.89903, 1, 1, 1, 0.91782, 0.91782, 0.91782, 1, 0.896, 0.896, 0.896,\n 0.9332, 0.9332, 0.95973, 1, 1.26, 1, 1, 0.80479, 0.80178, 1, 1, 0.85633, 1, 1,\n 1, 1, 0.97276, 1, 1, 1, 0.698, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1.14542, 1, 0.79199, 0.78694, 1.02058, 1.03493, 1.05486, 1, 1, 1.23026,\n 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.20006, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n];\nconst MyriadProBoldItalicMetrics = { lineHeight: 1.2, lineGap: 0.2 };\n\n// Factors to rescale LiberationSans-Italic.ttf to have the same\n// metrics as MyriadPro-It.otf.\nconst MyriadProItalicFactors = [\n 1.36898, 1, 1, 0.65507, 0.84943, 0.85639, 0.88465, 0.88465, 0.86936, 0.88307,\n 0.86948, 0.85283, 0.85283, 1.06383, 1.02058, 0.75945, 0.9219, 0.75945,\n 1.17337, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465,\n 0.88465, 0.88465, 0.88465, 0.75945, 0.75945, 1.02058, 1.02058, 1.02058,\n 0.69046, 0.70926, 0.85158, 0.77812, 0.76852, 0.89591, 0.70466, 0.76125,\n 0.80094, 0.86822, 0.83864, 0.728, 0.77212, 0.79475, 0.93637, 0.87514, 0.8588,\n 0.76013, 0.8588, 0.72421, 0.69866, 0.77598, 0.85991, 0.80811, 0.87832,\n 0.78112, 0.77512, 0.8562, 1.0222, 1.18417, 1.0222, 1.27014, 0.89903, 1.15012,\n 0.93859, 0.94399, 0.846, 0.94399, 0.81453, 1.0186, 0.94219, 0.96017, 1.03075,\n 1.02175, 0.912, 1.03075, 0.96998, 0.96017, 0.93859, 0.94399, 0.94399, 0.95493,\n 0.746, 1.12658, 0.94578, 0.91, 0.979, 0.882, 0.882, 0.83, 0.85034, 0.83537,\n 0.85034, 1.02058, 0.70869, 0.88465, 0.88465, 0.88465, 0.88465, 0.83537,\n 0.90083, 1.15012, 0.9161, 0.94565, 0.73541, 1.02058, 0.53609, 0.69353,\n 0.79519, 1.08595, 1, 1, 1.15012, 1, 0.91974, 0.75945, 1.15012, 1, 0.9446,\n 0.73361, 0.9005, 0.9005, 0.9005, 0.62864, 0.85158, 0.85158, 0.85158, 0.85158,\n 0.85158, 0.85158, 0.773, 0.76852, 0.70466, 0.70466, 0.70466, 0.70466, 0.83864,\n 0.83864, 0.83864, 0.83864, 0.90561, 0.87514, 0.8588, 0.8588, 0.8588, 0.8588,\n 0.8588, 1.02058, 0.85751, 0.85991, 0.85991, 0.85991, 0.85991, 0.77512,\n 0.76013, 0.88075, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859,\n 0.8075, 0.846, 0.81453, 0.81453, 0.81453, 0.81453, 0.82424, 0.82424, 0.82424,\n 0.82424, 0.9278, 0.96017, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859,\n 1.08595, 0.8562, 0.94578, 0.94578, 0.94578, 0.94578, 0.882, 0.94578, 0.882,\n 0.85158, 0.93859, 0.85158, 0.93859, 0.85158, 0.93859, 0.76852, 0.846, 0.76852,\n 0.846, 0.76852, 0.846, 0.76852, 0.846, 0.89591, 0.8544, 0.90561, 0.94399,\n 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453,\n 0.70466, 0.81453, 0.80094, 0.94219, 0.80094, 0.94219, 0.80094, 0.94219, 1, 1,\n 0.86822, 0.96017, 0.86822, 0.96017, 0.83864, 0.82424, 0.83864, 0.82424,\n 0.83864, 0.82424, 0.83864, 1.03075, 0.83864, 0.82424, 0.81402, 1.02738, 0.728,\n 1.02175, 1, 1, 0.912, 0.79475, 1.03075, 1, 1, 0.79475, 0.83911, 0.79475,\n 0.66266, 0.80553, 1.06676, 0.87514, 0.96017, 1, 1, 0.87514, 0.96017, 0.86865,\n 0.87396, 0.96017, 0.8588, 0.93859, 0.8588, 0.93859, 0.8588, 0.93859, 0.867,\n 0.84759, 0.72421, 0.95493, 1, 1, 0.72421, 0.95493, 0.69866, 0.746, 0.69866,\n 0.746, 1, 1, 0.69866, 0.746, 1, 1, 0.77598, 0.88417, 0.77598, 1.12658,\n 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578,\n 0.85991, 0.94578, 0.85991, 0.94578, 0.87832, 0.979, 0.77512, 0.882, 0.77512,\n 0.8562, 0.83, 0.8562, 0.83, 0.8562, 0.83, 1, 0.88465, 0.85158, 0.93859, 0.773,\n 0.8075, 0.85751, 0.8562, 1, 1, 0.77598, 1.12658, 1.15012, 1.15012, 1.15012,\n 1.15012, 1.15012, 1.15313, 1.15012, 1.15012, 1.15012, 1.08106, 1.03901,\n 0.85158, 0.77025, 0.62264, 0.7646, 0.65351, 0.86026, 0.69461, 0.89947,\n 1.03075, 0.85158, 0.77812, 0.76449, 0.88836, 0.70466, 0.8562, 0.86822, 0.8588,\n 0.83864, 0.77212, 0.85308, 0.93637, 0.87514, 0.82352, 0.8588, 0.85701,\n 0.76013, 0.89058, 0.77598, 0.8156, 0.82565, 0.78112, 0.77899, 0.89386,\n 0.83864, 0.8156, 0.9486, 0.92388, 0.96186, 1.03075, 0.91123, 0.9486, 0.93298,\n 0.878, 0.93942, 0.92388, 0.84596, 0.96186, 0.95119, 1.03075, 0.922, 0.88787,\n 0.95829, 0.88, 0.93559, 0.93859, 0.78815, 0.93758, 1, 0.89217, 1.03737,\n 0.91123, 0.93969, 0.77487, 0.85769, 0.86799, 1.03075, 0.91123, 0.93859,\n 0.91123, 0.86799, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 0.87832, 0.979, 0.87832, 0.979, 0.87832, 0.979, 0.77512, 0.882, 0.9219,\n 1, 0.89903, 1, 1, 1, 0.87321, 0.87321, 0.87321, 1, 1.027, 1.027, 1.027,\n 0.86847, 0.86847, 0.79121, 1, 1.124, 1, 1, 0.73572, 0.73572, 1, 1, 0.85034, 1,\n 1, 1, 1, 0.88465, 1, 1, 1, 0.669, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1.04828, 1, 0.74948, 0.75187, 1.02058, 0.98391, 1.02119, 1, 1, 1.06233,\n 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05233, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n];\nconst MyriadProItalicMetrics = { lineHeight: 1.2, lineGap: 0.2 };\n\n// Factors to rescale LiberationSans-Regular.ttf to have the same\n// metrics as MyriadPro-Regular.otf.\nconst MyriadProRegularFactors = [\n 1.36898, 1, 1, 0.76305, 0.82784, 0.94935, 0.89364, 0.92241, 0.89073, 0.90706,\n 0.98472, 0.85283, 0.85283, 1.0664, 1.02058, 0.74505, 0.9219, 0.74505, 1.23456,\n 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241,\n 0.92241, 0.92241, 0.74505, 0.74505, 1.02058, 1.02058, 1.02058, 0.73002,\n 0.72601, 0.91755, 0.8126, 0.80314, 0.92222, 0.73764, 0.79726, 0.83051,\n 0.90284, 0.86023, 0.74, 0.8126, 0.84869, 0.96518, 0.91115, 0.8858, 0.79761,\n 0.8858, 0.74498, 0.73914, 0.81363, 0.89591, 0.83659, 0.89633, 0.85608, 0.8111,\n 0.90531, 1.0222, 1.22736, 1.0222, 1.27014, 0.89903, 0.90088, 0.86667, 1.0231,\n 0.896, 1.01411, 0.90083, 1.05099, 1.00512, 0.99793, 1.05326, 1.09377, 0.938,\n 1.06226, 1.00119, 0.99793, 0.98714, 1.0231, 1.01231, 0.98196, 0.792, 1.19137,\n 0.99074, 0.962, 1.01915, 0.926, 0.942, 0.856, 0.85034, 0.92006, 0.85034,\n 1.02058, 0.69067, 0.92241, 0.92241, 0.92241, 0.92241, 0.92006, 0.9332,\n 0.90088, 0.91882, 0.93484, 0.75339, 1.02058, 0.56866, 0.54324, 0.79519,\n 1.08595, 1, 1, 0.90088, 1, 0.95325, 0.74505, 0.90088, 1, 0.97198, 0.75339,\n 0.91009, 0.91009, 0.91009, 0.66466, 0.91755, 0.91755, 0.91755, 0.91755,\n 0.91755, 0.91755, 0.788, 0.80314, 0.73764, 0.73764, 0.73764, 0.73764, 0.86023,\n 0.86023, 0.86023, 0.86023, 0.92915, 0.91115, 0.8858, 0.8858, 0.8858, 0.8858,\n 0.8858, 1.02058, 0.8858, 0.89591, 0.89591, 0.89591, 0.89591, 0.8111, 0.79611,\n 0.89713, 0.86667, 0.86667, 0.86667, 0.86667, 0.86667, 0.86667, 0.86936, 0.896,\n 0.90083, 0.90083, 0.90083, 0.90083, 0.84224, 0.84224, 0.84224, 0.84224,\n 0.97276, 0.99793, 0.98714, 0.98714, 0.98714, 0.98714, 0.98714, 1.08595,\n 0.89876, 0.99074, 0.99074, 0.99074, 0.99074, 0.942, 1.0231, 0.942, 0.91755,\n 0.86667, 0.91755, 0.86667, 0.91755, 0.86667, 0.80314, 0.896, 0.80314, 0.896,\n 0.80314, 0.896, 0.80314, 0.896, 0.92222, 0.93372, 0.92915, 1.01411, 0.73764,\n 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764,\n 0.90083, 0.83051, 1.00512, 0.83051, 1.00512, 0.83051, 1.00512, 1, 1, 0.90284,\n 0.99793, 0.90976, 0.99793, 0.86023, 0.84224, 0.86023, 0.84224, 0.86023,\n 0.84224, 0.86023, 1.05326, 0.86023, 0.84224, 0.82873, 1.07469, 0.74, 1.09377,\n 1, 1, 0.938, 0.84869, 1.06226, 1, 1, 0.84869, 0.83704, 0.84869, 0.81441,\n 0.85588, 1.08927, 0.91115, 0.99793, 1, 1, 0.91115, 0.99793, 0.91887, 0.90991,\n 0.99793, 0.8858, 0.98714, 0.8858, 0.98714, 0.8858, 0.98714, 0.894, 0.91434,\n 0.74498, 0.98196, 1, 1, 0.74498, 0.98196, 0.73914, 0.792, 0.73914, 0.792, 1,\n 1, 0.73914, 0.792, 1, 1, 0.81363, 0.904, 0.81363, 1.19137, 0.89591, 0.99074,\n 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074,\n 0.89591, 0.99074, 0.89633, 1.01915, 0.8111, 0.942, 0.8111, 0.90531, 0.856,\n 0.90531, 0.856, 0.90531, 0.856, 1, 0.92241, 0.91755, 0.86667, 0.788, 0.86936,\n 0.8858, 0.89876, 1, 1, 0.81363, 1.19137, 0.90088, 0.90088, 0.90088, 0.90088,\n 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90388, 1.03901, 0.92138,\n 0.78105, 0.7154, 0.86169, 0.80513, 0.94007, 0.82528, 0.98612, 1.06226,\n 0.91755, 0.8126, 0.81884, 0.92819, 0.73764, 0.90531, 0.90284, 0.8858, 0.86023,\n 0.8126, 0.91172, 0.96518, 0.91115, 0.83089, 0.8858, 0.87791, 0.79761, 0.89297,\n 0.81363, 0.88157, 0.89992, 0.85608, 0.81992, 0.94307, 0.86023, 0.88157,\n 0.95308, 0.98699, 0.99793, 1.06226, 0.95817, 0.95308, 0.97358, 0.928, 0.98088,\n 0.98699, 0.92761, 0.99793, 0.96017, 1.06226, 0.986, 0.944, 0.95978, 0.938,\n 0.96705, 0.98714, 0.80442, 0.98972, 1, 0.89762, 1.04552, 0.95817, 0.99007,\n 0.87064, 0.91879, 0.88888, 1.06226, 0.95817, 0.98714, 0.95817, 0.88888, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89633, 1.01915,\n 0.89633, 1.01915, 0.89633, 1.01915, 0.8111, 0.942, 0.9219, 1, 0.89903, 1, 1,\n 1, 0.93173, 0.93173, 0.93173, 1, 1.06304, 1.06304, 1.06904, 0.89903, 0.89903,\n 0.80549, 1, 1.156, 1, 1, 0.76575, 0.76575, 1, 1, 0.72458, 1, 1, 1, 1, 0.92241,\n 1, 1, 1, 0.619, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.07257, 1,\n 0.74705, 0.71119, 1.02058, 1.024, 1.02119, 1, 1, 1.1536, 1.08595, 1.08595, 1,\n 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05638, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1,\n];\nconst MyriadProRegularMetrics = { lineHeight: 1.2, lineGap: 0.2 };\n\nexport {\n MyriadProBoldFactors,\n MyriadProBoldItalicFactors,\n MyriadProBoldItalicMetrics,\n MyriadProBoldMetrics,\n MyriadProItalicFactors,\n MyriadProItalicMetrics,\n MyriadProRegularFactors,\n MyriadProRegularMetrics,\n};\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// Factors to rescale LiberationSans-Bold.ttf to have the same\n// metrics as segoeuib.ttf.\nconst SegoeuiBoldFactors = [\n 1.76738, 1, 1, 0.99297, 0.9824, 1.04016, 1.06497, 1.03424, 0.97529, 1.17647,\n 1.23203, 1.1085, 1.1085, 1.16939, 1.2107, 0.9754, 1.21408, 0.9754, 1.59578,\n 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424,\n 1.03424, 1.03424, 0.81378, 0.81378, 1.2107, 1.2107, 1.2107, 0.71703, 0.97847,\n 0.97363, 0.88776, 0.8641, 1.02096, 0.79795, 0.85132, 0.914, 1.06085, 1.1406,\n 0.8007, 0.89858, 0.83693, 1.14889, 1.09398, 0.97489, 0.92094, 0.97489,\n 0.90399, 0.84041, 0.95923, 1.00135, 1, 1.06467, 0.98243, 0.90996, 0.99361,\n 1.1085, 1.56942, 1.1085, 1.2107, 0.74627, 0.94282, 0.96752, 1.01519, 0.86304,\n 1.01359, 0.97278, 1.15103, 1.01359, 0.98561, 1.02285, 1.02285, 1.00527,\n 1.02285, 1.0302, 0.99041, 1.0008, 1.01519, 1.01359, 1.02258, 0.79104, 1.16862,\n 0.99041, 0.97454, 1.02511, 0.99298, 0.96752, 0.95801, 0.94856, 1.16579,\n 0.94856, 1.2107, 0.9824, 1.03424, 1.03424, 1, 1.03424, 1.16579, 0.8727,\n 1.3871, 1.18622, 1.10818, 1.04478, 1.2107, 1.18622, 0.75155, 0.94994, 1.28826,\n 1.21408, 1.21408, 0.91056, 1, 0.91572, 0.9754, 0.64663, 1.18328, 1.24866,\n 1.04478, 1.14169, 1.15749, 1.17389, 0.71703, 0.97363, 0.97363, 0.97363,\n 0.97363, 0.97363, 0.97363, 0.93506, 0.8641, 0.79795, 0.79795, 0.79795,\n 0.79795, 1.1406, 1.1406, 1.1406, 1.1406, 1.02096, 1.09398, 0.97426, 0.97426,\n 0.97426, 0.97426, 0.97426, 1.2107, 0.97489, 1.00135, 1.00135, 1.00135,\n 1.00135, 0.90996, 0.92094, 1.02798, 0.96752, 0.96752, 0.96752, 0.96752,\n 0.96752, 0.96752, 0.93136, 0.86304, 0.97278, 0.97278, 0.97278, 0.97278,\n 1.02285, 1.02285, 1.02285, 1.02285, 0.97122, 0.99041, 1, 1, 1, 1, 1, 1.28826,\n 1.0008, 0.99041, 0.99041, 0.99041, 0.99041, 0.96752, 1.01519, 0.96752,\n 0.97363, 0.96752, 0.97363, 0.96752, 0.97363, 0.96752, 0.8641, 0.86304, 0.8641,\n 0.86304, 0.8641, 0.86304, 0.8641, 0.86304, 1.02096, 1.03057, 1.02096, 1.03517,\n 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278,\n 0.79795, 0.97278, 0.914, 1.01359, 0.914, 1.01359, 0.914, 1.01359, 1, 1,\n 1.06085, 0.98561, 1.06085, 1.00879, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406,\n 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 0.97138, 1.08692, 0.8007, 1.02285,\n 1, 1, 1.00527, 0.83693, 1.02285, 1, 1, 0.83693, 0.9455, 0.83693, 0.90418,\n 0.83693, 1.13005, 1.09398, 0.99041, 1, 1, 1.09398, 0.99041, 0.96692, 1.09251,\n 0.99041, 0.97489, 1.0008, 0.97489, 1.0008, 0.97489, 1.0008, 0.93994, 0.97931,\n 0.90399, 1.02258, 1, 1, 0.90399, 1.02258, 0.84041, 0.79104, 0.84041, 0.79104,\n 0.84041, 0.79104, 0.84041, 0.79104, 1, 1, 0.95923, 1.07034, 0.95923, 1.16862,\n 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041,\n 1.00135, 0.99041, 1.00135, 0.99041, 1.06467, 1.02511, 0.90996, 0.96752,\n 0.90996, 0.99361, 0.95801, 0.99361, 0.95801, 0.99361, 0.95801, 1.07733,\n 1.03424, 0.97363, 0.96752, 0.93506, 0.93136, 0.97489, 1.0008, 1, 1, 0.95923,\n 1.16862, 1.15103, 1.15103, 1.01173, 1.03959, 0.75953, 0.81378, 0.79912,\n 1.15103, 1.21994, 0.95161, 0.87815, 1.01149, 0.81525, 0.7676, 0.98167,\n 1.01134, 1.02546, 0.84097, 1.03089, 1.18102, 0.97363, 0.88776, 0.85134,\n 0.97826, 0.79795, 0.99361, 1.06085, 0.97489, 1.1406, 0.89858, 1.0388, 1.14889,\n 1.09398, 0.86039, 0.97489, 1.0595, 0.92094, 0.94793, 0.95923, 0.90996,\n 0.99346, 0.98243, 1.02112, 0.95493, 1.1406, 0.90996, 1.03574, 1.02597, 1.0008,\n 1.18102, 1.06628, 1.03574, 1.0192, 1.01932, 1.00886, 0.97531, 1.0106, 1.0008,\n 1.13189, 1.18102, 1.02277, 0.98683, 1.0016, 0.99561, 1.07237, 1.0008, 0.90434,\n 0.99921, 0.93803, 0.8965, 1.23085, 1.06628, 1.04983, 0.96268, 1.0499, 0.98439,\n 1.18102, 1.06628, 1.0008, 1.06628, 0.98439, 0.79795, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1.09466, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.97278, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.02065, 1, 1, 1, 1, 1, 1, 1.06467, 1.02511,\n 1.06467, 1.02511, 1.06467, 1.02511, 0.90996, 0.96752, 1, 1.21408, 0.89903, 1,\n 1, 0.75155, 1.04394, 1.04394, 1.04394, 1.04394, 0.98633, 0.98633, 0.98633,\n 0.73047, 0.73047, 1.20642, 0.91211, 1.25635, 1.222, 1.02956, 1.03372, 1.03372,\n 0.96039, 1.24633, 1, 1.12454, 0.93503, 1.03424, 1.19687, 1.03424, 1, 1, 1,\n 0.771, 1, 1, 1.15749, 1.15749, 1.15749, 1.10948, 0.86279, 0.94434, 0.86279,\n 0.94434, 0.86182, 1, 1, 1.16897, 1, 0.96085, 0.90137, 1.2107, 1.18416,\n 1.13973, 0.69825, 0.9716, 2.10339, 1.29004, 1.29004, 1.21172, 1.29004,\n 1.29004, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025,\n 1.18874, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886,\n 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.09193, 1.09193, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n];\nconst SegoeuiBoldMetrics = { lineHeight: 1.33008, lineGap: 0 };\n\n// Factors to rescale LiberationSans-BoldItalic.ttf to have the same\n// metrics as segoeuiz.ttf.\nconst SegoeuiBoldItalicFactors = [\n 1.76738, 1, 1, 0.98946, 1.03959, 1.04016, 1.02809, 1.036, 0.97639, 1.10953,\n 1.23203, 1.11144, 1.11144, 1.16939, 1.21237, 0.9754, 1.21261, 0.9754, 1.59754,\n 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 0.81378,\n 0.81378, 1.21237, 1.21237, 1.21237, 0.73541, 0.97847, 0.97363, 0.89723,\n 0.87897, 1.0426, 0.79429, 0.85292, 0.91149, 1.05815, 1.1406, 0.79631, 0.90128,\n 0.83853, 1.04396, 1.10615, 0.97552, 0.94436, 0.97552, 0.88641, 0.80527,\n 0.96083, 1.00135, 1, 1.06777, 0.9817, 0.91142, 0.99361, 1.11144, 1.57293,\n 1.11144, 1.21237, 0.74627, 1.31818, 1.06585, 0.97042, 0.83055, 0.97042,\n 0.93503, 1.1261, 0.97042, 0.97922, 1.14236, 0.94552, 1.01054, 1.14236,\n 1.02471, 0.97922, 0.94165, 0.97042, 0.97042, 1.0276, 0.78929, 1.1261, 0.97922,\n 0.95874, 1.02197, 0.98507, 0.96752, 0.97168, 0.95107, 1.16579, 0.95107,\n 1.21237, 1.03959, 1.036, 1.036, 1, 1.036, 1.16579, 0.87357, 1.31818, 1.18754,\n 1.26781, 1.05356, 1.21237, 1.18622, 0.79487, 0.94994, 1.29004, 1.24047,\n 1.24047, 1.31818, 1, 0.91484, 0.9754, 1.31818, 1.1349, 1.24866, 1.05356,\n 1.13934, 1.15574, 1.17389, 0.73541, 0.97363, 0.97363, 0.97363, 0.97363,\n 0.97363, 0.97363, 0.94385, 0.87897, 0.79429, 0.79429, 0.79429, 0.79429,\n 1.1406, 1.1406, 1.1406, 1.1406, 1.0426, 1.10615, 0.97552, 0.97552, 0.97552,\n 0.97552, 0.97552, 1.21237, 0.97552, 1.00135, 1.00135, 1.00135, 1.00135,\n 0.91142, 0.94436, 0.98721, 1.06585, 1.06585, 1.06585, 1.06585, 1.06585,\n 1.06585, 0.96705, 0.83055, 0.93503, 0.93503, 0.93503, 0.93503, 1.14236,\n 1.14236, 1.14236, 1.14236, 0.93125, 0.97922, 0.94165, 0.94165, 0.94165,\n 0.94165, 0.94165, 1.29004, 0.94165, 0.97922, 0.97922, 0.97922, 0.97922,\n 0.96752, 0.97042, 0.96752, 0.97363, 1.06585, 0.97363, 1.06585, 0.97363,\n 1.06585, 0.87897, 0.83055, 0.87897, 0.83055, 0.87897, 0.83055, 0.87897,\n 0.83055, 1.0426, 1.0033, 1.0426, 0.97042, 0.79429, 0.93503, 0.79429, 0.93503,\n 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, 0.91149, 0.97042,\n 0.91149, 0.97042, 0.91149, 0.97042, 1, 1, 1.05815, 0.97922, 1.05815, 0.97922,\n 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406,\n 1.14236, 0.97441, 1.04302, 0.79631, 1.01582, 1, 1, 1.01054, 0.83853, 1.14236,\n 1, 1, 0.83853, 1.09125, 0.83853, 0.90418, 0.83853, 1.19508, 1.10615, 0.97922,\n 1, 1, 1.10615, 0.97922, 1.01034, 1.10466, 0.97922, 0.97552, 0.94165, 0.97552,\n 0.94165, 0.97552, 0.94165, 0.91602, 0.91981, 0.88641, 1.0276, 1, 1, 0.88641,\n 1.0276, 0.80527, 0.78929, 0.80527, 0.78929, 0.80527, 0.78929, 0.80527,\n 0.78929, 1, 1, 0.96083, 1.05403, 0.95923, 1.16862, 1.00135, 0.97922, 1.00135,\n 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135,\n 0.97922, 1.06777, 1.02197, 0.91142, 0.96752, 0.91142, 0.99361, 0.97168,\n 0.99361, 0.97168, 0.99361, 0.97168, 1.23199, 1.036, 0.97363, 1.06585, 0.94385,\n 0.96705, 0.97552, 0.94165, 1, 1, 0.96083, 1.1261, 1.31818, 1.31818, 1.31818,\n 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 0.95161, 1.27126,\n 1.00811, 0.83284, 0.77702, 0.99137, 0.95253, 1.0347, 0.86142, 1.07205,\n 1.14236, 0.97363, 0.89723, 0.86869, 1.09818, 0.79429, 0.99361, 1.05815,\n 0.97552, 1.1406, 0.90128, 1.06662, 1.04396, 1.10615, 0.84918, 0.97552,\n 1.04694, 0.94436, 0.98015, 0.96083, 0.91142, 1.00356, 0.9817, 1.01945,\n 0.98999, 1.1406, 0.91142, 1.04961, 0.9898, 1.00639, 1.14236, 1.07514, 1.04961,\n 0.99607, 1.02897, 1.008, 0.9898, 0.95134, 1.00639, 1.11121, 1.14236, 1.00518,\n 0.97981, 1.02186, 1, 1.08578, 0.94165, 0.99314, 0.98387, 0.93028, 0.93377,\n 1.35125, 1.07514, 1.10687, 0.93491, 1.04232, 1.00351, 1.14236, 1.07514,\n 0.94165, 1.07514, 1.00351, 0.79429, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1.09097, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.93503, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 0.96609, 1, 1, 1, 1, 1, 1, 1.06777, 1.02197, 1.06777,\n 1.02197, 1.06777, 1.02197, 0.91142, 0.96752, 1, 1.21261, 0.89903, 1, 1,\n 0.75155, 1.04745, 1.04745, 1.04745, 1.04394, 0.98633, 0.98633, 0.98633,\n 0.72959, 0.72959, 1.20502, 0.91406, 1.26514, 1.222, 1.02956, 1.03372, 1.03372,\n 0.96039, 1.24633, 1, 1.09125, 0.93327, 1.03336, 1.16541, 1.036, 1, 1, 1,\n 0.771, 1, 1, 1.15574, 1.15574, 1.15574, 1.15574, 0.86364, 0.94434, 0.86279,\n 0.94434, 0.86224, 1, 1, 1.16798, 1, 0.96085, 0.90068, 1.21237, 1.18416,\n 1.13904, 0.69825, 0.9716, 2.10339, 1.29004, 1.29004, 1.21339, 1.29004,\n 1.29004, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025,\n 1.18775, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886,\n 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.13269, 1.13269, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n];\nconst SegoeuiBoldItalicMetrics = { lineHeight: 1.33008, lineGap: 0 };\n\n// Factors to rescale LiberationSans-Italic.ttf to have the same\n// metrics as segoeuii.ttf.\nconst SegoeuiItalicFactors = [\n 1.76738, 1, 1, 0.98946, 1.14763, 1.05365, 1.06234, 0.96927, 0.92586, 1.15373,\n 1.18414, 0.91349, 0.91349, 1.07403, 1.17308, 0.78383, 1.20088, 0.78383,\n 1.42531, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927,\n 0.96927, 0.96927, 0.96927, 0.78383, 0.78383, 1.17308, 1.17308, 1.17308,\n 0.77349, 0.94565, 0.94729, 0.85944, 0.88506, 0.9858, 0.74817, 0.80016,\n 0.88449, 0.98039, 0.95782, 0.69238, 0.89898, 0.83231, 0.98183, 1.03989,\n 0.96924, 0.86237, 0.96924, 0.80595, 0.74524, 0.86091, 0.95402, 0.94143,\n 0.98448, 0.8858, 0.83089, 0.93285, 1.0949, 1.39016, 1.0949, 1.45994, 0.74627,\n 1.04839, 0.97454, 0.97454, 0.87207, 0.97454, 0.87533, 1.06151, 0.97454,\n 1.00176, 1.16484, 1.08132, 0.98047, 1.16484, 1.02989, 1.01054, 0.96225,\n 0.97454, 0.97454, 1.06598, 0.79004, 1.16344, 1.00351, 0.94629, 0.9973,\n 0.91016, 0.96777, 0.9043, 0.91082, 0.92481, 0.91082, 1.17308, 0.95748,\n 0.96927, 0.96927, 1, 0.96927, 0.92481, 0.80597, 1.04839, 1.23393, 1.1781,\n 0.9245, 1.17308, 1.20808, 0.63218, 0.94261, 1.24822, 1.09971, 1.09971,\n 1.04839, 1, 0.85273, 0.78032, 1.04839, 1.09971, 1.22326, 0.9245, 1.09836,\n 1.13525, 1.15222, 0.70424, 0.94729, 0.94729, 0.94729, 0.94729, 0.94729,\n 0.94729, 0.85498, 0.88506, 0.74817, 0.74817, 0.74817, 0.74817, 0.95782,\n 0.95782, 0.95782, 0.95782, 0.9858, 1.03989, 0.96924, 0.96924, 0.96924,\n 0.96924, 0.96924, 1.17308, 0.96924, 0.95402, 0.95402, 0.95402, 0.95402,\n 0.83089, 0.86237, 0.88409, 0.97454, 0.97454, 0.97454, 0.97454, 0.97454,\n 0.97454, 0.92916, 0.87207, 0.87533, 0.87533, 0.87533, 0.87533, 0.93146,\n 0.93146, 0.93146, 0.93146, 0.93854, 1.01054, 0.96225, 0.96225, 0.96225,\n 0.96225, 0.96225, 1.24822, 0.8761, 1.00351, 1.00351, 1.00351, 1.00351,\n 0.96777, 0.97454, 0.96777, 0.94729, 0.97454, 0.94729, 0.97454, 0.94729,\n 0.97454, 0.88506, 0.87207, 0.88506, 0.87207, 0.88506, 0.87207, 0.88506,\n 0.87207, 0.9858, 0.95391, 0.9858, 0.97454, 0.74817, 0.87533, 0.74817, 0.87533,\n 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.88449, 0.97454,\n 0.88449, 0.97454, 0.88449, 0.97454, 1, 1, 0.98039, 1.00176, 0.98039, 1.00176,\n 0.95782, 0.93146, 0.95782, 0.93146, 0.95782, 0.93146, 0.95782, 1.16484,\n 0.95782, 0.93146, 0.84421, 1.12761, 0.69238, 1.08132, 1, 1, 0.98047, 0.83231,\n 1.16484, 1, 1, 0.84723, 1.04861, 0.84723, 0.78755, 0.83231, 1.23736, 1.03989,\n 1.01054, 1, 1, 1.03989, 1.01054, 0.9857, 1.03849, 1.01054, 0.96924, 0.96225,\n 0.96924, 0.96225, 0.96924, 0.96225, 0.92383, 0.90171, 0.80595, 1.06598, 1, 1,\n 0.80595, 1.06598, 0.74524, 0.79004, 0.74524, 0.79004, 0.74524, 0.79004,\n 0.74524, 0.79004, 1, 1, 0.86091, 1.02759, 0.85771, 1.16344, 0.95402, 1.00351,\n 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351,\n 0.95402, 1.00351, 0.98448, 0.9973, 0.83089, 0.96777, 0.83089, 0.93285, 0.9043,\n 0.93285, 0.9043, 0.93285, 0.9043, 1.31868, 0.96927, 0.94729, 0.97454, 0.85498,\n 0.92916, 0.96924, 0.8761, 1, 1, 0.86091, 1.16344, 1.04839, 1.04839, 1.04839,\n 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 0.81965, 0.81965,\n 0.94729, 0.78032, 0.71022, 0.90883, 0.84171, 0.99877, 0.77596, 1.05734, 1.2,\n 0.94729, 0.85944, 0.82791, 0.9607, 0.74817, 0.93285, 0.98039, 0.96924,\n 0.95782, 0.89898, 0.98316, 0.98183, 1.03989, 0.78614, 0.96924, 0.97642,\n 0.86237, 0.86075, 0.86091, 0.83089, 0.90082, 0.8858, 0.97296, 1.01284,\n 0.95782, 0.83089, 1.0976, 1.04, 1.03342, 1.2, 1.0675, 1.0976, 0.98205,\n 1.03809, 1.05097, 1.04, 0.95364, 1.03342, 1.05401, 1.2, 1.02148, 1.0119,\n 1.04724, 1.0127, 1.02732, 0.96225, 0.8965, 0.97783, 0.93574, 0.94818, 1.30679,\n 1.0675, 1.11826, 0.99821, 1.0557, 1.0326, 1.2, 1.0675, 0.96225, 1.0675,\n 1.0326, 0.74817, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.03754, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.87533, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 0.98705, 1, 1, 1, 1, 1, 1, 0.98448, 0.9973, 0.98448, 0.9973, 0.98448, 0.9973,\n 0.83089, 0.96777, 1, 1.20088, 0.89903, 1, 1, 0.75155, 0.94945, 0.94945,\n 0.94945, 0.94945, 1.12317, 1.12317, 1.12317, 0.67603, 0.67603, 1.15621,\n 0.73584, 1.21191, 1.22135, 1.06483, 0.94868, 0.94868, 0.95996, 1.24633, 1,\n 1.07497, 0.87709, 0.96927, 1.01473, 0.96927, 1, 1, 1, 0.77295, 1, 1, 1.09836,\n 1.09836, 1.09836, 1.01522, 0.86321, 0.94434, 0.8649, 0.94434, 0.86182, 1, 1,\n 1.083, 1, 0.91578, 0.86438, 1.17308, 1.18416, 1.14589, 0.69825, 0.97622,\n 1.96791, 1.24822, 1.24822, 1.17308, 1.24822, 1.24822, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862,\n 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.17984, 1.42603, 1, 1.42603,\n 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1,\n 1.10742, 1.10742, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n];\nconst SegoeuiItalicMetrics = { lineHeight: 1.33008, lineGap: 0 };\n\n// Factors to rescale LiberationSans-Regular.ttf to have the same\n// metrics as segoeui.ttf.\nconst SegoeuiRegularFactors = [\n 1.76738, 1, 1, 0.98594, 1.02285, 1.10454, 1.06234, 0.96927, 0.92037, 1.19985,\n 1.2046, 0.90616, 0.90616, 1.07152, 1.1714, 0.78032, 1.20088, 0.78032, 1.40246,\n 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927,\n 0.96927, 0.96927, 0.78032, 0.78032, 1.1714, 1.1714, 1.1714, 0.80597, 0.94084,\n 0.96706, 0.85944, 0.85734, 0.97093, 0.75842, 0.79936, 0.88198, 0.9831,\n 0.95782, 0.71387, 0.86969, 0.84636, 1.07796, 1.03584, 0.96924, 0.83968,\n 0.96924, 0.82826, 0.79649, 0.85771, 0.95132, 0.93119, 0.98965, 0.88433,\n 0.8287, 0.93365, 1.08612, 1.3638, 1.08612, 1.45786, 0.74627, 0.80499, 0.91484,\n 1.05707, 0.92383, 1.05882, 0.9403, 1.12654, 1.05882, 1.01756, 1.09011,\n 1.09011, 0.99414, 1.09011, 1.034, 1.01756, 1.05356, 1.05707, 1.05882, 1.04399,\n 0.84863, 1.21968, 1.01756, 0.95801, 1.00068, 0.91797, 0.96777, 0.9043,\n 0.90351, 0.92105, 0.90351, 1.1714, 0.85337, 0.96927, 0.96927, 0.99912,\n 0.96927, 0.92105, 0.80597, 1.2434, 1.20808, 1.05937, 0.90957, 1.1714, 1.20808,\n 0.75155, 0.94261, 1.24644, 1.09971, 1.09971, 0.84751, 1, 0.85273, 0.78032,\n 0.61584, 1.05425, 1.17914, 0.90957, 1.08665, 1.11593, 1.14169, 0.73381,\n 0.96706, 0.96706, 0.96706, 0.96706, 0.96706, 0.96706, 0.86035, 0.85734,\n 0.75842, 0.75842, 0.75842, 0.75842, 0.95782, 0.95782, 0.95782, 0.95782,\n 0.97093, 1.03584, 0.96924, 0.96924, 0.96924, 0.96924, 0.96924, 1.1714,\n 0.96924, 0.95132, 0.95132, 0.95132, 0.95132, 0.8287, 0.83968, 0.89049,\n 0.91484, 0.91484, 0.91484, 0.91484, 0.91484, 0.91484, 0.93575, 0.92383,\n 0.9403, 0.9403, 0.9403, 0.9403, 0.8717, 0.8717, 0.8717, 0.8717, 1.00527,\n 1.01756, 1.05356, 1.05356, 1.05356, 1.05356, 1.05356, 1.24644, 0.95923,\n 1.01756, 1.01756, 1.01756, 1.01756, 0.96777, 1.05707, 0.96777, 0.96706,\n 0.91484, 0.96706, 0.91484, 0.96706, 0.91484, 0.85734, 0.92383, 0.85734,\n 0.92383, 0.85734, 0.92383, 0.85734, 0.92383, 0.97093, 1.0969, 0.97093,\n 1.05882, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403,\n 0.75842, 0.9403, 0.88198, 1.05882, 0.88198, 1.05882, 0.88198, 1.05882, 1, 1,\n 0.9831, 1.01756, 0.9831, 1.01756, 0.95782, 0.8717, 0.95782, 0.8717, 0.95782,\n 0.8717, 0.95782, 1.09011, 0.95782, 0.8717, 0.84784, 1.11551, 0.71387, 1.09011,\n 1, 1, 0.99414, 0.84636, 1.09011, 1, 1, 0.84636, 1.0536, 0.84636, 0.94298,\n 0.84636, 1.23297, 1.03584, 1.01756, 1, 1, 1.03584, 1.01756, 1.00323, 1.03444,\n 1.01756, 0.96924, 1.05356, 0.96924, 1.05356, 0.96924, 1.05356, 0.93066,\n 0.98293, 0.82826, 1.04399, 1, 1, 0.82826, 1.04399, 0.79649, 0.84863, 0.79649,\n 0.84863, 0.79649, 0.84863, 0.79649, 0.84863, 1, 1, 0.85771, 1.17318, 0.85771,\n 1.21968, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132,\n 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.98965, 1.00068, 0.8287,\n 0.96777, 0.8287, 0.93365, 0.9043, 0.93365, 0.9043, 0.93365, 0.9043, 1.08571,\n 0.96927, 0.96706, 0.91484, 0.86035, 0.93575, 0.96924, 0.95923, 1, 1, 0.85771,\n 1.21968, 1.11437, 1.11437, 0.93109, 0.91202, 0.60411, 0.84164, 0.55572,\n 1.01173, 0.97361, 0.81818, 0.81818, 0.96635, 0.78032, 0.72727, 0.92366,\n 0.98601, 1.03405, 0.77968, 1.09799, 1.2, 0.96706, 0.85944, 0.85638, 0.96491,\n 0.75842, 0.93365, 0.9831, 0.96924, 0.95782, 0.86969, 0.94152, 1.07796,\n 1.03584, 0.78437, 0.96924, 0.98715, 0.83968, 0.83491, 0.85771, 0.8287,\n 0.94492, 0.88433, 0.9287, 1.0098, 0.95782, 0.8287, 1.0625, 0.98248, 1.03424,\n 1.2, 1.01071, 1.0625, 0.95246, 1.03809, 1.04912, 0.98248, 1.00221, 1.03424,\n 1.05443, 1.2, 1.04785, 0.99609, 1.00169, 1.05176, 0.99346, 1.05356, 0.9087,\n 1.03004, 0.95542, 0.93117, 1.23362, 1.01071, 1.07831, 1.02512, 1.05205,\n 1.03502, 1.2, 1.01071, 1.05356, 1.01071, 1.03502, 0.75842, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1.03719, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9403,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.04021, 1, 1, 1, 1, 1, 1, 0.98965,\n 1.00068, 0.98965, 1.00068, 0.98965, 1.00068, 0.8287, 0.96777, 1, 1.20088,\n 0.89903, 1, 1, 0.75155, 1.03077, 1.03077, 1.03077, 1.03077, 1.13196, 1.13196,\n 1.13196, 0.67428, 0.67428, 1.16039, 0.73291, 1.20996, 1.22135, 1.06483,\n 0.94868, 0.94868, 0.95996, 1.24633, 1, 1.07497, 0.87796, 0.96927, 1.01518,\n 0.96927, 1, 1, 1, 0.77295, 1, 1, 1.10539, 1.10539, 1.11358, 1.06967, 0.86279,\n 0.94434, 0.86279, 0.94434, 0.86182, 1, 1, 1.083, 1, 0.91578, 0.86507, 1.1714,\n 1.18416, 1.14589, 0.69825, 0.97622, 1.9697, 1.24822, 1.24822, 1.17238,\n 1.24822, 1.24822, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025,\n 0.87025, 1.18083, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1,\n 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.10938, 1.10938, 1, 1, 1,\n 1.05425, 1.09971, 1.09971, 1.09971, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,\n];\nconst SegoeuiRegularMetrics = { lineHeight: 1.33008, lineGap: 0 };\n\nexport {\n SegoeuiBoldFactors,\n SegoeuiBoldItalicFactors,\n SegoeuiBoldItalicMetrics,\n SegoeuiBoldMetrics,\n SegoeuiItalicFactors,\n SegoeuiItalicMetrics,\n SegoeuiRegularFactors,\n SegoeuiRegularMetrics,\n};\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n CalibriBoldFactors,\n CalibriBoldItalicFactors,\n CalibriBoldItalicMetrics,\n CalibriBoldMetrics,\n CalibriItalicFactors,\n CalibriItalicMetrics,\n CalibriRegularFactors,\n CalibriRegularMetrics,\n} from \"./calibri_factors.js\";\nimport { Dict, Name } from \"./primitives.js\";\nimport {\n HelveticaBoldFactors,\n HelveticaBoldItalicFactors,\n HelveticaBoldItalicMetrics,\n HelveticaBoldMetrics,\n HelveticaItalicFactors,\n HelveticaItalicMetrics,\n HelveticaRegularFactors,\n HelveticaRegularMetrics,\n} from \"./helvetica_factors.js\";\nimport {\n LiberationSansBoldItalicMapping,\n LiberationSansBoldItalicWidths,\n LiberationSansBoldMapping,\n LiberationSansBoldWidths,\n LiberationSansItalicMapping,\n LiberationSansItalicWidths,\n LiberationSansRegularMapping,\n LiberationSansRegularWidths,\n} from \"./liberationsans_widths.js\";\nimport {\n MyriadProBoldFactors,\n MyriadProBoldItalicFactors,\n MyriadProBoldItalicMetrics,\n MyriadProBoldMetrics,\n MyriadProItalicFactors,\n MyriadProItalicMetrics,\n MyriadProRegularFactors,\n MyriadProRegularMetrics,\n} from \"./myriadpro_factors.js\";\nimport {\n SegoeuiBoldFactors,\n SegoeuiBoldItalicFactors,\n SegoeuiBoldItalicMetrics,\n SegoeuiBoldMetrics,\n SegoeuiItalicFactors,\n SegoeuiItalicMetrics,\n SegoeuiRegularFactors,\n SegoeuiRegularMetrics,\n} from \"./segoeui_factors.js\";\nimport { getLookupTableFactory } from \"./core_utils.js\";\nimport { normalizeFontName } from \"./fonts_utils.js\";\n\nconst getXFAFontMap = getLookupTableFactory(function (t) {\n t[\"MyriadPro-Regular\"] = t[\"PdfJS-Fallback-Regular\"] = {\n name: \"LiberationSans-Regular\",\n factors: MyriadProRegularFactors,\n baseWidths: LiberationSansRegularWidths,\n baseMapping: LiberationSansRegularMapping,\n metrics: MyriadProRegularMetrics,\n };\n t[\"MyriadPro-Bold\"] = t[\"PdfJS-Fallback-Bold\"] = {\n name: \"LiberationSans-Bold\",\n factors: MyriadProBoldFactors,\n baseWidths: LiberationSansBoldWidths,\n baseMapping: LiberationSansBoldMapping,\n metrics: MyriadProBoldMetrics,\n };\n t[\"MyriadPro-It\"] =\n t[\"MyriadPro-Italic\"] =\n t[\"PdfJS-Fallback-Italic\"] =\n {\n name: \"LiberationSans-Italic\",\n factors: MyriadProItalicFactors,\n baseWidths: LiberationSansItalicWidths,\n baseMapping: LiberationSansItalicMapping,\n metrics: MyriadProItalicMetrics,\n };\n t[\"MyriadPro-BoldIt\"] =\n t[\"MyriadPro-BoldItalic\"] =\n t[\"PdfJS-Fallback-BoldItalic\"] =\n {\n name: \"LiberationSans-BoldItalic\",\n factors: MyriadProBoldItalicFactors,\n baseWidths: LiberationSansBoldItalicWidths,\n baseMapping: LiberationSansBoldItalicMapping,\n metrics: MyriadProBoldItalicMetrics,\n };\n t.ArialMT =\n t.Arial =\n t[\"Arial-Regular\"] =\n {\n name: \"LiberationSans-Regular\",\n baseWidths: LiberationSansRegularWidths,\n baseMapping: LiberationSansRegularMapping,\n };\n t[\"Arial-BoldMT\"] = t[\"Arial-Bold\"] = {\n name: \"LiberationSans-Bold\",\n baseWidths: LiberationSansBoldWidths,\n baseMapping: LiberationSansBoldMapping,\n };\n t[\"Arial-ItalicMT\"] = t[\"Arial-Italic\"] = {\n name: \"LiberationSans-Italic\",\n baseWidths: LiberationSansItalicWidths,\n baseMapping: LiberationSansItalicMapping,\n };\n t[\"Arial-BoldItalicMT\"] = t[\"Arial-BoldItalic\"] = {\n name: \"LiberationSans-BoldItalic\",\n baseWidths: LiberationSansBoldItalicWidths,\n baseMapping: LiberationSansBoldItalicMapping,\n };\n t[\"Calibri-Regular\"] = {\n name: \"LiberationSans-Regular\",\n factors: CalibriRegularFactors,\n baseWidths: LiberationSansRegularWidths,\n baseMapping: LiberationSansRegularMapping,\n metrics: CalibriRegularMetrics,\n };\n t[\"Calibri-Bold\"] = {\n name: \"LiberationSans-Bold\",\n factors: CalibriBoldFactors,\n baseWidths: LiberationSansBoldWidths,\n baseMapping: LiberationSansBoldMapping,\n metrics: CalibriBoldMetrics,\n };\n t[\"Calibri-Italic\"] = {\n name: \"LiberationSans-Italic\",\n factors: CalibriItalicFactors,\n baseWidths: LiberationSansItalicWidths,\n baseMapping: LiberationSansItalicMapping,\n metrics: CalibriItalicMetrics,\n };\n t[\"Calibri-BoldItalic\"] = {\n name: \"LiberationSans-BoldItalic\",\n factors: CalibriBoldItalicFactors,\n baseWidths: LiberationSansBoldItalicWidths,\n baseMapping: LiberationSansBoldItalicMapping,\n metrics: CalibriBoldItalicMetrics,\n };\n t[\"Segoeui-Regular\"] = {\n name: \"LiberationSans-Regular\",\n factors: SegoeuiRegularFactors,\n baseWidths: LiberationSansRegularWidths,\n baseMapping: LiberationSansRegularMapping,\n metrics: SegoeuiRegularMetrics,\n };\n t[\"Segoeui-Bold\"] = {\n name: \"LiberationSans-Bold\",\n factors: SegoeuiBoldFactors,\n baseWidths: LiberationSansBoldWidths,\n baseMapping: LiberationSansBoldMapping,\n metrics: SegoeuiBoldMetrics,\n };\n t[\"Segoeui-Italic\"] = {\n name: \"LiberationSans-Italic\",\n factors: SegoeuiItalicFactors,\n baseWidths: LiberationSansItalicWidths,\n baseMapping: LiberationSansItalicMapping,\n metrics: SegoeuiItalicMetrics,\n };\n t[\"Segoeui-BoldItalic\"] = {\n name: \"LiberationSans-BoldItalic\",\n factors: SegoeuiBoldItalicFactors,\n baseWidths: LiberationSansBoldItalicWidths,\n baseMapping: LiberationSansBoldItalicMapping,\n metrics: SegoeuiBoldItalicMetrics,\n };\n t[\"Helvetica-Regular\"] = t.Helvetica = {\n name: \"LiberationSans-Regular\",\n factors: HelveticaRegularFactors,\n baseWidths: LiberationSansRegularWidths,\n baseMapping: LiberationSansRegularMapping,\n metrics: HelveticaRegularMetrics,\n };\n t[\"Helvetica-Bold\"] = {\n name: \"LiberationSans-Bold\",\n factors: HelveticaBoldFactors,\n baseWidths: LiberationSansBoldWidths,\n baseMapping: LiberationSansBoldMapping,\n metrics: HelveticaBoldMetrics,\n };\n t[\"Helvetica-Italic\"] = {\n name: \"LiberationSans-Italic\",\n factors: HelveticaItalicFactors,\n baseWidths: LiberationSansItalicWidths,\n baseMapping: LiberationSansItalicMapping,\n metrics: HelveticaItalicMetrics,\n };\n t[\"Helvetica-BoldItalic\"] = {\n name: \"LiberationSans-BoldItalic\",\n factors: HelveticaBoldItalicFactors,\n baseWidths: LiberationSansBoldItalicWidths,\n baseMapping: LiberationSansBoldItalicMapping,\n metrics: HelveticaBoldItalicMetrics,\n };\n});\n\nfunction getXfaFontName(name) {\n const fontName = normalizeFontName(name);\n const fontMap = getXFAFontMap();\n return fontMap[fontName];\n}\n\nfunction getXfaFontWidths(name) {\n const info = getXfaFontName(name);\n if (!info) {\n return null;\n }\n\n const { baseWidths, baseMapping, factors } = info;\n const rescaledBaseWidths = !factors\n ? baseWidths\n : baseWidths.map((w, i) => w * factors[i]);\n\n let currentCode = -2;\n let currentArray;\n\n // Widths array for composite font is:\n // CharCode1 [10, 20, 30] ...\n // which means:\n // - CharCode1 has a width equal to 10\n // - CharCode1+1 has a width equal to 20\n // - CharCode1+2 has a width equal to 30\n //\n // The baseMapping array contains a map for glyph index to unicode.\n // So from baseMapping we'll get sorted unicodes and their positions\n // (i.e. glyph indices) and then we put widths in an array for the\n // the consecutive unicodes.\n const newWidths = [];\n for (const [unicode, glyphIndex] of baseMapping\n .map(\n (charUnicode, index) => [\n charUnicode,\n index,\n ] /* collect unicode and glyph index */\n )\n .sort(\n ([unicode1], [unicode2]) =>\n unicode1 - unicode2 /* order by unicode only */\n )) {\n if (unicode === -1) {\n continue;\n }\n\n if (unicode === currentCode + 1) {\n currentArray.push(rescaledBaseWidths[glyphIndex]);\n currentCode += 1;\n } else {\n currentCode = unicode;\n currentArray = [rescaledBaseWidths[glyphIndex]];\n newWidths.push(unicode, currentArray);\n }\n }\n\n return newWidths;\n}\n\nfunction getXfaFontDict(name) {\n const widths = getXfaFontWidths(name);\n const dict = new Dict(null);\n dict.set(\"BaseFont\", Name.get(name));\n dict.set(\"Type\", Name.get(\"Font\"));\n dict.set(\"Subtype\", Name.get(\"CIDFontType2\"));\n dict.set(\"Encoding\", Name.get(\"Identity-H\"));\n dict.set(\"CIDToGIDMap\", Name.get(\"Identity\"));\n dict.set(\"W\", widths);\n dict.set(\"FirstChar\", widths[0]);\n dict.set(\"LastChar\", widths.at(-2) + widths.at(-1).length - 1);\n const descriptor = new Dict(null);\n dict.set(\"FontDescriptor\", descriptor);\n const systemInfo = new Dict(null);\n systemInfo.set(\"Ordering\", \"Identity\");\n systemInfo.set(\"Registry\", \"Adobe\");\n systemInfo.set(\"Supplement\", 0);\n dict.set(\"CIDSystemInfo\", systemInfo);\n\n return dict;\n}\n\nexport { getXfaFontDict, getXfaFontName };\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, shadow } from \"../shared/util.js\";\nimport { EOF } from \"./primitives.js\";\nimport { isWhiteSpace } from \"./core_utils.js\";\n\nclass PostScriptParser {\n constructor(lexer) {\n this.lexer = lexer;\n this.operators = [];\n this.token = null;\n this.prev = null;\n }\n\n nextToken() {\n this.prev = this.token;\n this.token = this.lexer.getToken();\n }\n\n accept(type) {\n if (this.token.type === type) {\n this.nextToken();\n return true;\n }\n return false;\n }\n\n expect(type) {\n if (this.accept(type)) {\n return true;\n }\n throw new FormatError(\n `Unexpected symbol: found ${this.token.type} expected ${type}.`\n );\n }\n\n parse() {\n this.nextToken();\n this.expect(PostScriptTokenTypes.LBRACE);\n this.parseBlock();\n this.expect(PostScriptTokenTypes.RBRACE);\n return this.operators;\n }\n\n parseBlock() {\n while (true) {\n if (this.accept(PostScriptTokenTypes.NUMBER)) {\n this.operators.push(this.prev.value);\n } else if (this.accept(PostScriptTokenTypes.OPERATOR)) {\n this.operators.push(this.prev.value);\n } else if (this.accept(PostScriptTokenTypes.LBRACE)) {\n this.parseCondition();\n } else {\n return;\n }\n }\n }\n\n parseCondition() {\n // Add two place holders that will be updated later\n const conditionLocation = this.operators.length;\n this.operators.push(null, null);\n\n this.parseBlock();\n this.expect(PostScriptTokenTypes.RBRACE);\n if (this.accept(PostScriptTokenTypes.IF)) {\n // The true block is right after the 'if' so it just falls through on true\n // else it jumps and skips the true block.\n this.operators[conditionLocation] = this.operators.length;\n this.operators[conditionLocation + 1] = \"jz\";\n } else if (this.accept(PostScriptTokenTypes.LBRACE)) {\n const jumpLocation = this.operators.length;\n this.operators.push(null, null);\n const endOfTrue = this.operators.length;\n this.parseBlock();\n this.expect(PostScriptTokenTypes.RBRACE);\n this.expect(PostScriptTokenTypes.IFELSE);\n // The jump is added at the end of the true block to skip the false block.\n this.operators[jumpLocation] = this.operators.length;\n this.operators[jumpLocation + 1] = \"j\";\n\n this.operators[conditionLocation] = endOfTrue;\n this.operators[conditionLocation + 1] = \"jz\";\n } else {\n throw new FormatError(\"PS Function: error parsing conditional.\");\n }\n }\n}\n\nconst PostScriptTokenTypes = {\n LBRACE: 0,\n RBRACE: 1,\n NUMBER: 2,\n OPERATOR: 3,\n IF: 4,\n IFELSE: 5,\n};\n\nclass PostScriptToken {\n static get opCache() {\n return shadow(this, \"opCache\", Object.create(null));\n }\n\n constructor(type, value) {\n this.type = type;\n this.value = value;\n }\n\n static getOperator(op) {\n return (PostScriptToken.opCache[op] ||= new PostScriptToken(\n PostScriptTokenTypes.OPERATOR,\n op\n ));\n }\n\n static get LBRACE() {\n return shadow(\n this,\n \"LBRACE\",\n new PostScriptToken(PostScriptTokenTypes.LBRACE, \"{\")\n );\n }\n\n static get RBRACE() {\n return shadow(\n this,\n \"RBRACE\",\n new PostScriptToken(PostScriptTokenTypes.RBRACE, \"}\")\n );\n }\n\n static get IF() {\n return shadow(\n this,\n \"IF\",\n new PostScriptToken(PostScriptTokenTypes.IF, \"IF\")\n );\n }\n\n static get IFELSE() {\n return shadow(\n this,\n \"IFELSE\",\n new PostScriptToken(PostScriptTokenTypes.IFELSE, \"IFELSE\")\n );\n }\n}\n\nclass PostScriptLexer {\n constructor(stream) {\n this.stream = stream;\n this.nextChar();\n\n this.strBuf = [];\n }\n\n nextChar() {\n return (this.currentChar = this.stream.getByte());\n }\n\n getToken() {\n let comment = false;\n let ch = this.currentChar;\n\n // skip comments\n while (true) {\n if (ch < 0) {\n return EOF;\n }\n\n if (comment) {\n if (ch === 0x0a || ch === 0x0d) {\n comment = false;\n }\n } else if (ch === /* '%' = */ 0x25) {\n comment = true;\n } else if (!isWhiteSpace(ch)) {\n break;\n }\n ch = this.nextChar();\n }\n switch (ch | 0) {\n case 0x30: // '0'\n case 0x31: // '1'\n case 0x32: // '2'\n case 0x33: // '3'\n case 0x34: // '4'\n case 0x35: // '5'\n case 0x36: // '6'\n case 0x37: // '7'\n case 0x38: // '8'\n case 0x39: // '9'\n case 0x2b: // '+'\n case 0x2d: // '-'\n case 0x2e: // '.'\n return new PostScriptToken(\n PostScriptTokenTypes.NUMBER,\n this.getNumber()\n );\n case 0x7b: // '{'\n this.nextChar();\n return PostScriptToken.LBRACE;\n case 0x7d: // '}'\n this.nextChar();\n return PostScriptToken.RBRACE;\n }\n // operator\n const strBuf = this.strBuf;\n strBuf.length = 0;\n strBuf[0] = String.fromCharCode(ch);\n\n while (\n (ch = this.nextChar()) >= 0 &&\n ((ch >= /* 'A' = */ 0x41 && ch <= /* 'Z' = */ 0x5a) ||\n (ch >= /* 'a' = */ 0x61 && ch <= /* 'z' = */ 0x7a))\n ) {\n strBuf.push(String.fromCharCode(ch));\n }\n const str = strBuf.join(\"\");\n switch (str.toLowerCase()) {\n case \"if\":\n return PostScriptToken.IF;\n case \"ifelse\":\n return PostScriptToken.IFELSE;\n default:\n return PostScriptToken.getOperator(str);\n }\n }\n\n getNumber() {\n let ch = this.currentChar;\n const strBuf = this.strBuf;\n strBuf.length = 0;\n strBuf[0] = String.fromCharCode(ch);\n\n while ((ch = this.nextChar()) >= 0) {\n if (\n (ch >= /* '0' = */ 0x30 && ch <= /* '9' = */ 0x39) ||\n ch === /* '-' = */ 0x2d ||\n ch === /* '.' = */ 0x2e\n ) {\n strBuf.push(String.fromCharCode(ch));\n } else {\n break;\n }\n }\n const value = parseFloat(strBuf.join(\"\"));\n if (isNaN(value)) {\n throw new FormatError(`Invalid floating point number: ${value}`);\n }\n return value;\n }\n}\n\nexport { PostScriptLexer, PostScriptParser };\n","/* Copyright 2019 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 MAX_IMAGE_SIZE_TO_CACHE,\n unreachable,\n warn,\n} from \"../shared/util.js\";\nimport { RefSetCache } from \"./primitives.js\";\n\nclass BaseLocalCache {\n constructor(options) {\n if (this.constructor === BaseLocalCache) {\n unreachable(\"Cannot initialize BaseLocalCache.\");\n }\n this._onlyRefs = options?.onlyRefs === true;\n\n if (!this._onlyRefs) {\n this._nameRefMap = new Map();\n this._imageMap = new Map();\n }\n this._imageCache = new RefSetCache();\n }\n\n getByName(name) {\n if (this._onlyRefs) {\n unreachable(\"Should not call `getByName` method.\");\n }\n const ref = this._nameRefMap.get(name);\n if (ref) {\n return this.getByRef(ref);\n }\n return this._imageMap.get(name) || null;\n }\n\n getByRef(ref) {\n return this._imageCache.get(ref) || null;\n }\n\n set(name, ref, data) {\n unreachable(\"Abstract method `set` called.\");\n }\n}\n\nclass LocalImageCache extends BaseLocalCache {\n set(name, ref = null, data) {\n if (typeof name !== \"string\") {\n throw new Error('LocalImageCache.set - expected \"name\" argument.');\n }\n if (ref) {\n if (this._imageCache.has(ref)) {\n return;\n }\n this._nameRefMap.set(name, ref);\n this._imageCache.put(ref, data);\n return;\n }\n // name\n if (this._imageMap.has(name)) {\n return;\n }\n this._imageMap.set(name, data);\n }\n}\n\nclass LocalColorSpaceCache extends BaseLocalCache {\n set(name = null, ref = null, data) {\n if (typeof name !== \"string\" && !ref) {\n throw new Error(\n 'LocalColorSpaceCache.set - expected \"name\" and/or \"ref\" argument.'\n );\n }\n if (ref) {\n if (this._imageCache.has(ref)) {\n return;\n }\n if (name !== null) {\n // Optional when `ref` is defined.\n this._nameRefMap.set(name, ref);\n }\n this._imageCache.put(ref, data);\n return;\n }\n // name\n if (this._imageMap.has(name)) {\n return;\n }\n this._imageMap.set(name, data);\n }\n}\n\nclass LocalFunctionCache extends BaseLocalCache {\n constructor(options) {\n super({ onlyRefs: true });\n }\n\n set(name = null, ref, data) {\n if (!ref) {\n throw new Error('LocalFunctionCache.set - expected \"ref\" argument.');\n }\n if (this._imageCache.has(ref)) {\n return;\n }\n this._imageCache.put(ref, data);\n }\n}\n\nclass LocalGStateCache extends BaseLocalCache {\n set(name, ref = null, data) {\n if (typeof name !== \"string\") {\n throw new Error('LocalGStateCache.set - expected \"name\" argument.');\n }\n if (ref) {\n if (this._imageCache.has(ref)) {\n return;\n }\n this._nameRefMap.set(name, ref);\n this._imageCache.put(ref, data);\n return;\n }\n // name\n if (this._imageMap.has(name)) {\n return;\n }\n this._imageMap.set(name, data);\n }\n}\n\nclass LocalTilingPatternCache extends BaseLocalCache {\n constructor(options) {\n super({ onlyRefs: true });\n }\n\n set(name = null, ref, data) {\n if (!ref) {\n throw new Error('LocalTilingPatternCache.set - expected \"ref\" argument.');\n }\n if (this._imageCache.has(ref)) {\n return;\n }\n this._imageCache.put(ref, data);\n }\n}\n\nclass RegionalImageCache extends BaseLocalCache {\n constructor(options) {\n super({ onlyRefs: true });\n }\n\n set(name = null, ref, data) {\n if (!ref) {\n throw new Error('RegionalImageCache.set - expected \"ref\" argument.');\n }\n if (this._imageCache.has(ref)) {\n return;\n }\n this._imageCache.put(ref, data);\n }\n}\n\nclass GlobalImageCache {\n static NUM_PAGES_THRESHOLD = 2;\n\n static MIN_IMAGES_TO_CACHE = 10;\n\n static MAX_BYTE_SIZE = 5 * MAX_IMAGE_SIZE_TO_CACHE;\n\n constructor() {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n GlobalImageCache.NUM_PAGES_THRESHOLD > 1,\n \"GlobalImageCache - invalid NUM_PAGES_THRESHOLD constant.\"\n );\n }\n this._refCache = new RefSetCache();\n this._imageCache = new RefSetCache();\n }\n\n get _byteSize() {\n let byteSize = 0;\n for (const imageData of this._imageCache) {\n byteSize += imageData.byteSize;\n }\n return byteSize;\n }\n\n get _cacheLimitReached() {\n if (this._imageCache.size < GlobalImageCache.MIN_IMAGES_TO_CACHE) {\n return false;\n }\n if (this._byteSize < GlobalImageCache.MAX_BYTE_SIZE) {\n return false;\n }\n return true;\n }\n\n shouldCache(ref, pageIndex) {\n let pageIndexSet = this._refCache.get(ref);\n if (!pageIndexSet) {\n pageIndexSet = new Set();\n this._refCache.put(ref, pageIndexSet);\n }\n pageIndexSet.add(pageIndex);\n\n if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) {\n return false;\n }\n if (!this._imageCache.has(ref) && this._cacheLimitReached) {\n return false;\n }\n return true;\n }\n\n /**\n * PLEASE NOTE: Must be called *after* the `setData` method.\n */\n addByteSize(ref, byteSize) {\n const imageData = this._imageCache.get(ref);\n if (!imageData) {\n return; // The image data isn't cached (the limit was reached).\n }\n if (imageData.byteSize) {\n return; // The byte-size has already been set.\n }\n imageData.byteSize = byteSize;\n }\n\n getData(ref, pageIndex) {\n const pageIndexSet = this._refCache.get(ref);\n if (!pageIndexSet) {\n return null;\n }\n if (pageIndexSet.size < GlobalImageCache.NUM_PAGES_THRESHOLD) {\n return null;\n }\n const imageData = this._imageCache.get(ref);\n if (!imageData) {\n return null;\n }\n // Ensure that we keep track of all pages containing the image reference.\n pageIndexSet.add(pageIndex);\n\n return imageData;\n }\n\n setData(ref, data) {\n if (!this._refCache.has(ref)) {\n throw new Error(\n 'GlobalImageCache.setData - expected \"shouldCache\" to have been called.'\n );\n }\n if (this._imageCache.has(ref)) {\n return;\n }\n if (this._cacheLimitReached) {\n warn(\"GlobalImageCache.setData - cache limit reached.\");\n return;\n }\n this._imageCache.put(ref, data);\n }\n\n clear(onlyData = false) {\n if (!onlyData) {\n this._refCache.clear();\n }\n this._imageCache.clear();\n }\n}\n\nexport {\n GlobalImageCache,\n LocalColorSpaceCache,\n LocalFunctionCache,\n LocalGStateCache,\n LocalImageCache,\n LocalTilingPatternCache,\n RegionalImageCache,\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 { Dict, Ref } from \"./primitives.js\";\nimport {\n FeatureTest,\n FormatError,\n info,\n shadow,\n unreachable,\n} from \"../shared/util.js\";\nimport { PostScriptLexer, PostScriptParser } from \"./ps_parser.js\";\nimport { BaseStream } from \"./base_stream.js\";\nimport { LocalFunctionCache } from \"./image_utils.js\";\n\nclass PDFFunctionFactory {\n constructor({ xref, isEvalSupported = true }) {\n this.xref = xref;\n this.isEvalSupported = isEvalSupported !== false;\n }\n\n create(fn) {\n const cachedFunction = this.getCached(fn);\n if (cachedFunction) {\n return cachedFunction;\n }\n const parsedFunction = PDFFunction.parse({\n xref: this.xref,\n isEvalSupported: this.isEvalSupported,\n fn: fn instanceof Ref ? this.xref.fetch(fn) : fn,\n });\n\n // Attempt to cache the parsed Function, by reference.\n this._cache(fn, parsedFunction);\n\n return parsedFunction;\n }\n\n createFromArray(fnObj) {\n const cachedFunction = this.getCached(fnObj);\n if (cachedFunction) {\n return cachedFunction;\n }\n const parsedFunction = PDFFunction.parseArray({\n xref: this.xref,\n isEvalSupported: this.isEvalSupported,\n fnObj: fnObj instanceof Ref ? this.xref.fetch(fnObj) : fnObj,\n });\n\n // Attempt to cache the parsed Function, by reference.\n this._cache(fnObj, parsedFunction);\n\n return parsedFunction;\n }\n\n getCached(cacheKey) {\n let fnRef;\n if (cacheKey instanceof Ref) {\n fnRef = cacheKey;\n } else if (cacheKey instanceof Dict) {\n fnRef = cacheKey.objId;\n } else if (cacheKey instanceof BaseStream) {\n fnRef = cacheKey.dict?.objId;\n }\n if (fnRef) {\n const localFunction = this._localFunctionCache.getByRef(fnRef);\n if (localFunction) {\n return localFunction;\n }\n }\n return null;\n }\n\n /**\n * @private\n */\n _cache(cacheKey, parsedFunction) {\n if (!parsedFunction) {\n throw new Error(\n 'PDFFunctionFactory._cache - expected \"parsedFunction\" argument.'\n );\n }\n let fnRef;\n if (cacheKey instanceof Ref) {\n fnRef = cacheKey;\n } else if (cacheKey instanceof Dict) {\n fnRef = cacheKey.objId;\n } else if (cacheKey instanceof BaseStream) {\n fnRef = cacheKey.dict?.objId;\n }\n if (fnRef) {\n this._localFunctionCache.set(/* name = */ null, fnRef, parsedFunction);\n }\n }\n\n /**\n * @private\n */\n get _localFunctionCache() {\n return shadow(this, \"_localFunctionCache\", new LocalFunctionCache());\n }\n}\n\nfunction toNumberArray(arr) {\n if (!Array.isArray(arr)) {\n return null;\n }\n const length = arr.length;\n for (let i = 0; i < length; i++) {\n if (typeof arr[i] !== \"number\") {\n // Non-number is found -- convert all items to numbers.\n const result = new Array(length);\n for (let j = 0; j < length; j++) {\n result[j] = +arr[j];\n }\n return result;\n }\n }\n return arr;\n}\n\nclass PDFFunction {\n static getSampleArray(size, outputSize, bps, stream) {\n let i, ii;\n let length = 1;\n for (i = 0, ii = size.length; i < ii; i++) {\n length *= size[i];\n }\n length *= outputSize;\n\n const array = new Array(length);\n let codeSize = 0;\n let codeBuf = 0;\n // 32 is a valid bps so shifting won't work\n const sampleMul = 1.0 / (2.0 ** bps - 1);\n\n const strBytes = stream.getBytes((length * bps + 7) / 8);\n let strIdx = 0;\n for (i = 0; i < length; i++) {\n while (codeSize < bps) {\n codeBuf <<= 8;\n codeBuf |= strBytes[strIdx++];\n codeSize += 8;\n }\n codeSize -= bps;\n array[i] = (codeBuf >> codeSize) * sampleMul;\n codeBuf &= (1 << codeSize) - 1;\n }\n return array;\n }\n\n static parse({ xref, isEvalSupported, fn }) {\n const dict = fn.dict || fn;\n const typeNum = dict.get(\"FunctionType\");\n\n switch (typeNum) {\n case 0:\n return this.constructSampled({ xref, isEvalSupported, fn, dict });\n case 1:\n break;\n case 2:\n return this.constructInterpolated({ xref, isEvalSupported, dict });\n case 3:\n return this.constructStiched({ xref, isEvalSupported, dict });\n case 4:\n return this.constructPostScript({ xref, isEvalSupported, fn, dict });\n }\n throw new FormatError(\"Unknown type of function\");\n }\n\n static parseArray({ xref, isEvalSupported, fnObj }) {\n if (!Array.isArray(fnObj)) {\n // not an array -- parsing as regular function\n return this.parse({ xref, isEvalSupported, fn: fnObj });\n }\n\n const fnArray = [];\n for (const fn of fnObj) {\n fnArray.push(\n this.parse({ xref, isEvalSupported, fn: xref.fetchIfRef(fn) })\n );\n }\n return function (src, srcOffset, dest, destOffset) {\n for (let i = 0, ii = fnArray.length; i < ii; i++) {\n fnArray[i](src, srcOffset, dest, destOffset + i);\n }\n };\n }\n\n static constructSampled({ xref, isEvalSupported, fn, dict }) {\n function toMultiArray(arr) {\n const inputLength = arr.length;\n const out = [];\n let index = 0;\n for (let i = 0; i < inputLength; i += 2) {\n out[index++] = [arr[i], arr[i + 1]];\n }\n return out;\n }\n // See chapter 3, page 109 of the PDF reference\n function interpolate(x, xmin, xmax, ymin, ymax) {\n return ymin + (x - xmin) * ((ymax - ymin) / (xmax - xmin));\n }\n\n let domain = toNumberArray(dict.getArray(\"Domain\"));\n let range = toNumberArray(dict.getArray(\"Range\"));\n\n if (!domain || !range) {\n throw new FormatError(\"No domain or range\");\n }\n\n const inputSize = domain.length / 2;\n const outputSize = range.length / 2;\n\n domain = toMultiArray(domain);\n range = toMultiArray(range);\n\n const size = toNumberArray(dict.getArray(\"Size\"));\n const bps = dict.get(\"BitsPerSample\");\n const order = dict.get(\"Order\") || 1;\n if (order !== 1) {\n // No description how cubic spline interpolation works in PDF32000:2008\n // As in poppler, ignoring order, linear interpolation may work as good\n info(\"No support for cubic spline interpolation: \" + order);\n }\n\n let encode = toNumberArray(dict.getArray(\"Encode\"));\n if (!encode) {\n encode = [];\n for (let i = 0; i < inputSize; ++i) {\n encode.push([0, size[i] - 1]);\n }\n } else {\n encode = toMultiArray(encode);\n }\n\n let decode = toNumberArray(dict.getArray(\"Decode\"));\n decode = !decode ? range : toMultiArray(decode);\n\n const samples = this.getSampleArray(size, outputSize, bps, fn);\n // const mask = 2 ** bps - 1;\n\n return function constructSampledFn(src, srcOffset, dest, destOffset) {\n // See chapter 3, page 110 of the PDF reference.\n\n // Building the cube vertices: its part and sample index\n // http://rjwagner49.com/Mathematics/Interpolation.pdf\n const cubeVertices = 1 << inputSize;\n const cubeN = new Float64Array(cubeVertices);\n const cubeVertex = new Uint32Array(cubeVertices);\n let i, j;\n for (j = 0; j < cubeVertices; j++) {\n cubeN[j] = 1;\n }\n\n let k = outputSize,\n pos = 1;\n // Map x_i to y_j for 0 <= i < m using the sampled function.\n for (i = 0; i < inputSize; ++i) {\n // x_i' = min(max(x_i, Domain_2i), Domain_2i+1)\n const domain_2i = domain[i][0];\n const domain_2i_1 = domain[i][1];\n const xi = Math.min(\n Math.max(src[srcOffset + i], domain_2i),\n domain_2i_1\n );\n\n // e_i = Interpolate(x_i', Domain_2i, Domain_2i+1,\n // Encode_2i, Encode_2i+1)\n let e = interpolate(\n xi,\n domain_2i,\n domain_2i_1,\n encode[i][0],\n encode[i][1]\n );\n\n // e_i' = min(max(e_i, 0), Size_i - 1)\n const size_i = size[i];\n e = Math.min(Math.max(e, 0), size_i - 1);\n\n // Adjusting the cube: N and vertex sample index\n const e0 = e < size_i - 1 ? Math.floor(e) : e - 1; // e1 = e0 + 1;\n const n0 = e0 + 1 - e; // (e1 - e) / (e1 - e0);\n const n1 = e - e0; // (e - e0) / (e1 - e0);\n const offset0 = e0 * k;\n const offset1 = offset0 + k; // e1 * k\n for (j = 0; j < cubeVertices; j++) {\n if (j & pos) {\n cubeN[j] *= n1;\n cubeVertex[j] += offset1;\n } else {\n cubeN[j] *= n0;\n cubeVertex[j] += offset0;\n }\n }\n\n k *= size_i;\n pos <<= 1;\n }\n\n for (j = 0; j < outputSize; ++j) {\n // Sum all cube vertices' samples portions\n let rj = 0;\n for (i = 0; i < cubeVertices; i++) {\n rj += samples[cubeVertex[i] + j] * cubeN[i];\n }\n\n // r_j' = Interpolate(r_j, 0, 2^BitsPerSample - 1,\n // Decode_2j, Decode_2j+1)\n rj = interpolate(rj, 0, 1, decode[j][0], decode[j][1]);\n\n // y_j = min(max(r_j, range_2j), range_2j+1)\n dest[destOffset + j] = Math.min(Math.max(rj, range[j][0]), range[j][1]);\n }\n };\n }\n\n static constructInterpolated({ xref, isEvalSupported, dict }) {\n const c0 = toNumberArray(dict.getArray(\"C0\")) || [0];\n const c1 = toNumberArray(dict.getArray(\"C1\")) || [1];\n const n = dict.get(\"N\");\n\n const diff = [];\n for (let i = 0, ii = c0.length; i < ii; ++i) {\n diff.push(c1[i] - c0[i]);\n }\n const length = diff.length;\n\n return function constructInterpolatedFn(src, srcOffset, dest, destOffset) {\n const x = n === 1 ? src[srcOffset] : src[srcOffset] ** n;\n\n for (let j = 0; j < length; ++j) {\n dest[destOffset + j] = c0[j] + x * diff[j];\n }\n };\n }\n\n static constructStiched({ xref, isEvalSupported, dict }) {\n const domain = toNumberArray(dict.getArray(\"Domain\"));\n\n if (!domain) {\n throw new FormatError(\"No domain\");\n }\n\n const inputSize = domain.length / 2;\n if (inputSize !== 1) {\n throw new FormatError(\"Bad domain for stiched function\");\n }\n\n const fns = [];\n for (const fn of dict.get(\"Functions\")) {\n fns.push(this.parse({ xref, isEvalSupported, fn: xref.fetchIfRef(fn) }));\n }\n\n const bounds = toNumberArray(dict.getArray(\"Bounds\"));\n const encode = toNumberArray(dict.getArray(\"Encode\"));\n const tmpBuf = new Float32Array(1);\n\n return function constructStichedFn(src, srcOffset, dest, destOffset) {\n const clip = function constructStichedFromIRClip(v, min, max) {\n if (v > max) {\n v = max;\n } else if (v < min) {\n v = min;\n }\n return v;\n };\n\n // clip to domain\n const v = clip(src[srcOffset], domain[0], domain[1]);\n // calculate which bound the value is in\n const length = bounds.length;\n let i;\n for (i = 0; i < length; ++i) {\n if (v < bounds[i]) {\n break;\n }\n }\n\n // encode value into domain of function\n let dmin = domain[0];\n if (i > 0) {\n dmin = bounds[i - 1];\n }\n let dmax = domain[1];\n if (i < bounds.length) {\n dmax = bounds[i];\n }\n\n const rmin = encode[2 * i];\n const rmax = encode[2 * i + 1];\n\n // Prevent the value from becoming NaN as a result\n // of division by zero (fixes issue6113.pdf).\n tmpBuf[0] =\n dmin === dmax\n ? rmin\n : rmin + ((v - dmin) * (rmax - rmin)) / (dmax - dmin);\n\n // call the appropriate function\n fns[i](tmpBuf, 0, dest, destOffset);\n };\n }\n\n static constructPostScript({ xref, isEvalSupported, fn, dict }) {\n const domain = toNumberArray(dict.getArray(\"Domain\"));\n const range = toNumberArray(dict.getArray(\"Range\"));\n\n if (!domain) {\n throw new FormatError(\"No domain.\");\n }\n\n if (!range) {\n throw new FormatError(\"No range.\");\n }\n\n const lexer = new PostScriptLexer(fn);\n const parser = new PostScriptParser(lexer);\n const code = parser.parse();\n\n if (isEvalSupported && FeatureTest.isEvalSupported) {\n const compiled = new PostScriptCompiler().compile(code, domain, range);\n if (compiled) {\n // Compiled function consists of simple expressions such as addition,\n // subtraction, Math.max, and also contains 'var' and 'return'\n // statements. See the generation in the PostScriptCompiler below.\n // eslint-disable-next-line no-new-func\n return new Function(\"src\", \"srcOffset\", \"dest\", \"destOffset\", compiled);\n }\n }\n info(\"Unable to compile PS function\");\n\n const numOutputs = range.length >> 1;\n const numInputs = domain.length >> 1;\n const evaluator = new PostScriptEvaluator(code);\n // Cache the values for a big speed up, the cache size is limited though\n // since the number of possible values can be huge from a PS function.\n const cache = Object.create(null);\n // The MAX_CACHE_SIZE is set to ~4x the maximum number of distinct values\n // seen in our tests.\n const MAX_CACHE_SIZE = 2048 * 4;\n let cache_available = MAX_CACHE_SIZE;\n const tmpBuf = new Float32Array(numInputs);\n\n return function constructPostScriptFn(src, srcOffset, dest, destOffset) {\n let i, value;\n let key = \"\";\n const input = tmpBuf;\n for (i = 0; i < numInputs; i++) {\n value = src[srcOffset + i];\n input[i] = value;\n key += value + \"_\";\n }\n\n const cachedValue = cache[key];\n if (cachedValue !== undefined) {\n dest.set(cachedValue, destOffset);\n return;\n }\n\n const output = new Float32Array(numOutputs);\n const stack = evaluator.execute(input);\n const stackIndex = stack.length - numOutputs;\n for (i = 0; i < numOutputs; i++) {\n value = stack[stackIndex + i];\n let bound = range[i * 2];\n if (value < bound) {\n value = bound;\n } else {\n bound = range[i * 2 + 1];\n if (value > bound) {\n value = bound;\n }\n }\n output[i] = value;\n }\n if (cache_available > 0) {\n cache_available--;\n cache[key] = output;\n }\n dest.set(output, destOffset);\n };\n }\n}\n\nfunction isPDFFunction(v) {\n let fnDict;\n if (v instanceof Dict) {\n fnDict = v;\n } else if (v instanceof BaseStream) {\n fnDict = v.dict;\n } else {\n return false;\n }\n return fnDict.has(\"FunctionType\");\n}\n\nclass PostScriptStack {\n static MAX_STACK_SIZE = 100;\n\n constructor(initialStack) {\n this.stack = initialStack ? Array.from(initialStack) : [];\n }\n\n push(value) {\n if (this.stack.length >= PostScriptStack.MAX_STACK_SIZE) {\n throw new Error(\"PostScript function stack overflow.\");\n }\n this.stack.push(value);\n }\n\n pop() {\n if (this.stack.length <= 0) {\n throw new Error(\"PostScript function stack underflow.\");\n }\n return this.stack.pop();\n }\n\n copy(n) {\n if (this.stack.length + n >= PostScriptStack.MAX_STACK_SIZE) {\n throw new Error(\"PostScript function stack overflow.\");\n }\n const stack = this.stack;\n for (let i = stack.length - n, j = n - 1; j >= 0; j--, i++) {\n stack.push(stack[i]);\n }\n }\n\n index(n) {\n this.push(this.stack[this.stack.length - n - 1]);\n }\n\n // rotate the last n stack elements p times\n roll(n, p) {\n const stack = this.stack;\n const l = stack.length - n;\n const r = stack.length - 1;\n const c = l + (p - Math.floor(p / n) * n);\n\n for (let i = l, j = r; i < j; i++, j--) {\n const t = stack[i];\n stack[i] = stack[j];\n stack[j] = t;\n }\n for (let i = l, j = c - 1; i < j; i++, j--) {\n const t = stack[i];\n stack[i] = stack[j];\n stack[j] = t;\n }\n for (let i = c, j = r; i < j; i++, j--) {\n const t = stack[i];\n stack[i] = stack[j];\n stack[j] = t;\n }\n }\n}\n\nclass PostScriptEvaluator {\n constructor(operators) {\n this.operators = operators;\n }\n\n execute(initialStack) {\n const stack = new PostScriptStack(initialStack);\n let counter = 0;\n const operators = this.operators;\n const length = operators.length;\n let operator, a, b;\n while (counter < length) {\n operator = operators[counter++];\n if (typeof operator === \"number\") {\n // Operator is really an operand and should be pushed to the stack.\n stack.push(operator);\n continue;\n }\n switch (operator) {\n // non standard ps operators\n case \"jz\": // jump if false\n b = stack.pop();\n a = stack.pop();\n if (!a) {\n counter = b;\n }\n break;\n case \"j\": // jump\n a = stack.pop();\n counter = a;\n break;\n\n // all ps operators in alphabetical order (excluding if/ifelse)\n case \"abs\":\n a = stack.pop();\n stack.push(Math.abs(a));\n break;\n case \"add\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a + b);\n break;\n case \"and\":\n b = stack.pop();\n a = stack.pop();\n if (typeof a === \"boolean\" && typeof b === \"boolean\") {\n stack.push(a && b);\n } else {\n stack.push(a & b);\n }\n break;\n case \"atan\":\n b = stack.pop();\n a = stack.pop();\n a = (Math.atan2(a, b) / Math.PI) * 180;\n if (a < 0) {\n a += 360;\n }\n stack.push(a);\n break;\n case \"bitshift\":\n b = stack.pop();\n a = stack.pop();\n if (a > 0) {\n stack.push(a << b);\n } else {\n stack.push(a >> b);\n }\n break;\n case \"ceiling\":\n a = stack.pop();\n stack.push(Math.ceil(a));\n break;\n case \"copy\":\n a = stack.pop();\n stack.copy(a);\n break;\n case \"cos\":\n a = stack.pop();\n stack.push(Math.cos(((a % 360) / 180) * Math.PI));\n break;\n case \"cvi\":\n a = stack.pop() | 0;\n stack.push(a);\n break;\n case \"cvr\":\n // noop\n break;\n case \"div\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a / b);\n break;\n case \"dup\":\n stack.copy(1);\n break;\n case \"eq\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a === b);\n break;\n case \"exch\":\n stack.roll(2, 1);\n break;\n case \"exp\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a ** b);\n break;\n case \"false\":\n stack.push(false);\n break;\n case \"floor\":\n a = stack.pop();\n stack.push(Math.floor(a));\n break;\n case \"ge\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a >= b);\n break;\n case \"gt\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a > b);\n break;\n case \"idiv\":\n b = stack.pop();\n a = stack.pop();\n stack.push((a / b) | 0);\n break;\n case \"index\":\n a = stack.pop();\n stack.index(a);\n break;\n case \"le\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a <= b);\n break;\n case \"ln\":\n a = stack.pop();\n stack.push(Math.log(a));\n break;\n case \"log\":\n a = stack.pop();\n stack.push(Math.log10(a));\n break;\n case \"lt\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a < b);\n break;\n case \"mod\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a % b);\n break;\n case \"mul\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a * b);\n break;\n case \"ne\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a !== b);\n break;\n case \"neg\":\n a = stack.pop();\n stack.push(-a);\n break;\n case \"not\":\n a = stack.pop();\n if (typeof a === \"boolean\") {\n stack.push(!a);\n } else {\n stack.push(~a);\n }\n break;\n case \"or\":\n b = stack.pop();\n a = stack.pop();\n if (typeof a === \"boolean\" && typeof b === \"boolean\") {\n stack.push(a || b);\n } else {\n stack.push(a | b);\n }\n break;\n case \"pop\":\n stack.pop();\n break;\n case \"roll\":\n b = stack.pop();\n a = stack.pop();\n stack.roll(a, b);\n break;\n case \"round\":\n a = stack.pop();\n stack.push(Math.round(a));\n break;\n case \"sin\":\n a = stack.pop();\n stack.push(Math.sin(((a % 360) / 180) * Math.PI));\n break;\n case \"sqrt\":\n a = stack.pop();\n stack.push(Math.sqrt(a));\n break;\n case \"sub\":\n b = stack.pop();\n a = stack.pop();\n stack.push(a - b);\n break;\n case \"true\":\n stack.push(true);\n break;\n case \"truncate\":\n a = stack.pop();\n a = a < 0 ? Math.ceil(a) : Math.floor(a);\n stack.push(a);\n break;\n case \"xor\":\n b = stack.pop();\n a = stack.pop();\n if (typeof a === \"boolean\" && typeof b === \"boolean\") {\n stack.push(a !== b);\n } else {\n stack.push(a ^ b);\n }\n break;\n default:\n throw new FormatError(`Unknown operator ${operator}`);\n }\n }\n return stack.stack;\n }\n}\n\nclass AstNode {\n constructor(type) {\n this.type = type;\n }\n\n visit(visitor) {\n unreachable(\"abstract method\");\n }\n}\n\nclass AstArgument extends AstNode {\n constructor(index, min, max) {\n super(\"args\");\n this.index = index;\n this.min = min;\n this.max = max;\n }\n\n visit(visitor) {\n visitor.visitArgument(this);\n }\n}\n\nclass AstLiteral extends AstNode {\n constructor(number) {\n super(\"literal\");\n this.number = number;\n this.min = number;\n this.max = number;\n }\n\n visit(visitor) {\n visitor.visitLiteral(this);\n }\n}\n\nclass AstBinaryOperation extends AstNode {\n constructor(op, arg1, arg2, min, max) {\n super(\"binary\");\n this.op = op;\n this.arg1 = arg1;\n this.arg2 = arg2;\n this.min = min;\n this.max = max;\n }\n\n visit(visitor) {\n visitor.visitBinaryOperation(this);\n }\n}\n\nclass AstMin extends AstNode {\n constructor(arg, max) {\n super(\"max\");\n this.arg = arg;\n this.min = arg.min;\n this.max = max;\n }\n\n visit(visitor) {\n visitor.visitMin(this);\n }\n}\n\nclass AstVariable extends AstNode {\n constructor(index, min, max) {\n super(\"var\");\n this.index = index;\n this.min = min;\n this.max = max;\n }\n\n visit(visitor) {\n visitor.visitVariable(this);\n }\n}\n\nclass AstVariableDefinition extends AstNode {\n constructor(variable, arg) {\n super(\"definition\");\n this.variable = variable;\n this.arg = arg;\n }\n\n visit(visitor) {\n visitor.visitVariableDefinition(this);\n }\n}\n\nclass ExpressionBuilderVisitor {\n constructor() {\n this.parts = [];\n }\n\n visitArgument(arg) {\n this.parts.push(\n \"Math.max(\",\n arg.min,\n \", Math.min(\",\n arg.max,\n \", src[srcOffset + \",\n arg.index,\n \"]))\"\n );\n }\n\n visitVariable(variable) {\n this.parts.push(\"v\", variable.index);\n }\n\n visitLiteral(literal) {\n this.parts.push(literal.number);\n }\n\n visitBinaryOperation(operation) {\n this.parts.push(\"(\");\n operation.arg1.visit(this);\n this.parts.push(\" \", operation.op, \" \");\n operation.arg2.visit(this);\n this.parts.push(\")\");\n }\n\n visitVariableDefinition(definition) {\n this.parts.push(\"var \");\n definition.variable.visit(this);\n this.parts.push(\" = \");\n definition.arg.visit(this);\n this.parts.push(\";\");\n }\n\n visitMin(max) {\n this.parts.push(\"Math.min(\");\n max.arg.visit(this);\n this.parts.push(\", \", max.max, \")\");\n }\n\n toString() {\n return this.parts.join(\"\");\n }\n}\n\nfunction buildAddOperation(num1, num2) {\n if (num2.type === \"literal\" && num2.number === 0) {\n // optimization: second operand is 0\n return num1;\n }\n if (num1.type === \"literal\" && num1.number === 0) {\n // optimization: first operand is 0\n return num2;\n }\n if (num2.type === \"literal\" && num1.type === \"literal\") {\n // optimization: operands operand are literals\n return new AstLiteral(num1.number + num2.number);\n }\n return new AstBinaryOperation(\n \"+\",\n num1,\n num2,\n num1.min + num2.min,\n num1.max + num2.max\n );\n}\n\nfunction buildMulOperation(num1, num2) {\n if (num2.type === \"literal\") {\n // optimization: second operands is a literal...\n if (num2.number === 0) {\n return new AstLiteral(0); // and it's 0\n } else if (num2.number === 1) {\n return num1; // and it's 1\n } else if (num1.type === \"literal\") {\n // ... and first operands is a literal too\n return new AstLiteral(num1.number * num2.number);\n }\n }\n if (num1.type === \"literal\") {\n // optimization: first operands is a literal...\n if (num1.number === 0) {\n return new AstLiteral(0); // and it's 0\n } else if (num1.number === 1) {\n return num2; // and it's 1\n }\n }\n const min = Math.min(\n num1.min * num2.min,\n num1.min * num2.max,\n num1.max * num2.min,\n num1.max * num2.max\n );\n const max = Math.max(\n num1.min * num2.min,\n num1.min * num2.max,\n num1.max * num2.min,\n num1.max * num2.max\n );\n return new AstBinaryOperation(\"*\", num1, num2, min, max);\n}\n\nfunction buildSubOperation(num1, num2) {\n if (num2.type === \"literal\") {\n // optimization: second operands is a literal...\n if (num2.number === 0) {\n return num1; // ... and it's 0\n } else if (num1.type === \"literal\") {\n // ... and first operands is a literal too\n return new AstLiteral(num1.number - num2.number);\n }\n }\n if (\n num2.type === \"binary\" &&\n num2.op === \"-\" &&\n num1.type === \"literal\" &&\n num1.number === 1 &&\n num2.arg1.type === \"literal\" &&\n num2.arg1.number === 1\n ) {\n // optimization for case: 1 - (1 - x)\n return num2.arg2;\n }\n return new AstBinaryOperation(\n \"-\",\n num1,\n num2,\n num1.min - num2.max,\n num1.max - num2.min\n );\n}\n\nfunction buildMinOperation(num1, max) {\n if (num1.min >= max) {\n // optimization: num1 min value is not less than required max\n return new AstLiteral(max); // just returning max\n } else if (num1.max <= max) {\n // optimization: num1 max value is not greater than required max\n return num1; // just returning an argument\n }\n return new AstMin(num1, max);\n}\n\n// Most of the PDFs functions consist of simple operations such as:\n// roll, exch, sub, cvr, pop, index, dup, mul, if, gt, add.\n//\n// We can compile most of such programs, and at the same moment, we can\n// optimize some expressions using basic math properties. Keeping track of\n// min/max values will allow us to avoid extra Math.min/Math.max calls.\nclass PostScriptCompiler {\n compile(code, domain, range) {\n const stack = [];\n const instructions = [];\n const inputSize = domain.length >> 1,\n outputSize = range.length >> 1;\n let lastRegister = 0;\n let n, j;\n let num1, num2, ast1, ast2, tmpVar, item;\n for (let i = 0; i < inputSize; i++) {\n stack.push(new AstArgument(i, domain[i * 2], domain[i * 2 + 1]));\n }\n\n for (let i = 0, ii = code.length; i < ii; i++) {\n item = code[i];\n if (typeof item === \"number\") {\n stack.push(new AstLiteral(item));\n continue;\n }\n\n switch (item) {\n case \"add\":\n if (stack.length < 2) {\n return null;\n }\n num2 = stack.pop();\n num1 = stack.pop();\n stack.push(buildAddOperation(num1, num2));\n break;\n case \"cvr\":\n if (stack.length < 1) {\n return null;\n }\n break;\n case \"mul\":\n if (stack.length < 2) {\n return null;\n }\n num2 = stack.pop();\n num1 = stack.pop();\n stack.push(buildMulOperation(num1, num2));\n break;\n case \"sub\":\n if (stack.length < 2) {\n return null;\n }\n num2 = stack.pop();\n num1 = stack.pop();\n stack.push(buildSubOperation(num1, num2));\n break;\n case \"exch\":\n if (stack.length < 2) {\n return null;\n }\n ast1 = stack.pop();\n ast2 = stack.pop();\n stack.push(ast1, ast2);\n break;\n case \"pop\":\n if (stack.length < 1) {\n return null;\n }\n stack.pop();\n break;\n case \"index\":\n if (stack.length < 1) {\n return null;\n }\n num1 = stack.pop();\n if (num1.type !== \"literal\") {\n return null;\n }\n n = num1.number;\n if (n < 0 || !Number.isInteger(n) || stack.length < n) {\n return null;\n }\n ast1 = stack[stack.length - n - 1];\n if (ast1.type === \"literal\" || ast1.type === \"var\") {\n stack.push(ast1);\n break;\n }\n tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max);\n stack[stack.length - n - 1] = tmpVar;\n stack.push(tmpVar);\n instructions.push(new AstVariableDefinition(tmpVar, ast1));\n break;\n case \"dup\":\n if (stack.length < 1) {\n return null;\n }\n if (\n typeof code[i + 1] === \"number\" &&\n code[i + 2] === \"gt\" &&\n code[i + 3] === i + 7 &&\n code[i + 4] === \"jz\" &&\n code[i + 5] === \"pop\" &&\n code[i + 6] === code[i + 1]\n ) {\n // special case of the commands sequence for the min operation\n num1 = stack.pop();\n stack.push(buildMinOperation(num1, code[i + 1]));\n i += 6;\n break;\n }\n ast1 = stack.at(-1);\n if (ast1.type === \"literal\" || ast1.type === \"var\") {\n // we don't have to save into intermediate variable a literal or\n // variable.\n stack.push(ast1);\n break;\n }\n tmpVar = new AstVariable(lastRegister++, ast1.min, ast1.max);\n stack[stack.length - 1] = tmpVar;\n stack.push(tmpVar);\n instructions.push(new AstVariableDefinition(tmpVar, ast1));\n break;\n case \"roll\":\n if (stack.length < 2) {\n return null;\n }\n num2 = stack.pop();\n num1 = stack.pop();\n if (num2.type !== \"literal\" || num1.type !== \"literal\") {\n // both roll operands must be numbers\n return null;\n }\n j = num2.number;\n n = num1.number;\n if (\n n <= 0 ||\n !Number.isInteger(n) ||\n !Number.isInteger(j) ||\n stack.length < n\n ) {\n // ... and integers\n return null;\n }\n j = ((j % n) + n) % n;\n if (j === 0) {\n break; // just skipping -- there are nothing to rotate\n }\n stack.push(...stack.splice(stack.length - n, n - j));\n break;\n default:\n return null; // unsupported operator\n }\n }\n\n if (stack.length !== outputSize) {\n return null;\n }\n\n const result = [];\n for (const instruction of instructions) {\n const statementBuilder = new ExpressionBuilderVisitor();\n instruction.visit(statementBuilder);\n result.push(statementBuilder.toString());\n }\n for (let i = 0, ii = stack.length; i < ii; i++) {\n const expr = stack[i],\n statementBuilder = new ExpressionBuilderVisitor();\n expr.visit(statementBuilder);\n const min = range[i * 2],\n max = range[i * 2 + 1];\n const out = [statementBuilder.toString()];\n if (min > expr.min) {\n out.unshift(\"Math.max(\", min, \", \");\n out.push(\")\");\n }\n if (max < expr.max) {\n out.unshift(\"Math.min(\", max, \", \");\n out.push(\")\");\n }\n out.unshift(\"dest[destOffset + \", i, \"] = \");\n out.push(\";\");\n result.push(out.join(\"\"));\n }\n return result.join(\"\\n\");\n }\n}\n\nexport {\n isPDFFunction,\n PDFFunctionFactory,\n PostScriptCompiler,\n PostScriptEvaluator,\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 { warn } from \"../shared/util.js\";\n\n// Character types for symbols from 0000 to 00FF.\n// Source: ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt\n// prettier-ignore\nconst baseTypes = [\n \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"S\", \"B\", \"S\",\n \"WS\", \"B\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\",\n \"BN\", \"BN\", \"BN\", \"BN\", \"B\", \"B\", \"B\", \"S\", \"WS\", \"ON\", \"ON\", \"ET\",\n \"ET\", \"ET\", \"ON\", \"ON\", \"ON\", \"ON\", \"ON\", \"ES\", \"CS\", \"ES\", \"CS\", \"CS\",\n \"EN\", \"EN\", \"EN\", \"EN\", \"EN\", \"EN\", \"EN\", \"EN\", \"EN\", \"EN\", \"CS\", \"ON\",\n \"ON\", \"ON\", \"ON\", \"ON\", \"ON\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\",\n \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\",\n \"L\", \"L\", \"L\", \"L\", \"ON\", \"ON\", \"ON\", \"ON\", \"ON\", \"ON\", \"L\", \"L\", \"L\",\n \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\",\n \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"ON\", \"ON\", \"ON\", \"ON\",\n \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"B\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\",\n \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\",\n \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"BN\", \"CS\", \"ON\", \"ET\",\n \"ET\", \"ET\", \"ET\", \"ON\", \"ON\", \"ON\", \"ON\", \"L\", \"ON\", \"ON\", \"BN\", \"ON\",\n \"ON\", \"ET\", \"ET\", \"EN\", \"EN\", \"ON\", \"L\", \"ON\", \"ON\", \"ON\", \"EN\", \"L\",\n \"ON\", \"ON\", \"ON\", \"ON\", \"ON\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\",\n \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\",\n \"L\", \"ON\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\",\n \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\",\n \"L\", \"L\", \"L\", \"L\", \"L\", \"ON\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\", \"L\"\n];\n\n// Character types for symbols from 0600 to 06FF.\n// Source: ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt\n// Note that 061D does not exist in the Unicode standard (see\n// http://unicode.org/charts/PDF/U0600.pdf), so we replace it with an\n// empty string and issue a warning if we encounter this character. The\n// empty string is required to properly index the items after it.\n// prettier-ignore\nconst arabicTypes = [\n \"AN\", \"AN\", \"AN\", \"AN\", \"AN\", \"AN\", \"ON\", \"ON\", \"AL\", \"ET\", \"ET\", \"AL\",\n \"CS\", \"AL\", \"ON\", \"ON\", \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"NSM\",\n \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"AL\", \"AL\", \"\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\",\n \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\",\n \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\",\n \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\",\n \"AL\", \"AL\", \"AL\", \"AL\", \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"NSM\",\n \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"NSM\",\n \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"AN\", \"AN\", \"AN\", \"AN\", \"AN\", \"AN\", \"AN\",\n \"AN\", \"AN\", \"AN\", \"ET\", \"AN\", \"AN\", \"AL\", \"AL\", \"AL\", \"NSM\", \"AL\", \"AL\",\n \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\",\n \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\",\n \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\",\n \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\",\n \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\",\n \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\",\n \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\",\n \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\",\n \"AL\", \"AL\", \"AL\", \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"AN\",\n \"ON\", \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"AL\", \"AL\", \"NSM\", \"NSM\",\n \"ON\", \"NSM\", \"NSM\", \"NSM\", \"NSM\", \"AL\", \"AL\", \"EN\", \"EN\", \"EN\", \"EN\",\n \"EN\", \"EN\", \"EN\", \"EN\", \"EN\", \"EN\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\", \"AL\"\n];\n\nfunction isOdd(i) {\n return (i & 1) !== 0;\n}\n\nfunction isEven(i) {\n return (i & 1) === 0;\n}\n\nfunction findUnequal(arr, start, value) {\n let j, jj;\n for (j = start, jj = arr.length; j < jj; ++j) {\n if (arr[j] !== value) {\n return j;\n }\n }\n return j;\n}\n\nfunction setValues(arr, start, end, value) {\n for (let j = start; j < end; ++j) {\n arr[j] = value;\n }\n}\n\nfunction reverseValues(arr, start, end) {\n for (let i = start, j = end - 1; i < j; ++i, --j) {\n const temp = arr[i];\n arr[i] = arr[j];\n arr[j] = temp;\n }\n}\n\nfunction createBidiText(str, isLTR, vertical = false) {\n let dir = \"ltr\";\n if (vertical) {\n dir = \"ttb\";\n } else if (!isLTR) {\n dir = \"rtl\";\n }\n return { str, dir };\n}\n\n// These are used in bidi(), which is called frequently. We re-use them on\n// each call to avoid unnecessary allocations.\nconst chars = [];\nconst types = [];\n\nfunction bidi(str, startLevel = -1, vertical = false) {\n let isLTR = true;\n const strLength = str.length;\n if (strLength === 0 || vertical) {\n return createBidiText(str, isLTR, vertical);\n }\n\n // Get types and fill arrays\n chars.length = strLength;\n types.length = strLength;\n let numBidi = 0;\n\n let i, ii;\n for (i = 0; i < strLength; ++i) {\n chars[i] = str.charAt(i);\n\n const charCode = str.charCodeAt(i);\n let charType = \"L\";\n if (charCode <= 0x00ff) {\n charType = baseTypes[charCode];\n } else if (0x0590 <= charCode && charCode <= 0x05f4) {\n charType = \"R\";\n } else if (0x0600 <= charCode && charCode <= 0x06ff) {\n charType = arabicTypes[charCode & 0xff];\n if (!charType) {\n warn(\"Bidi: invalid Unicode character \" + charCode.toString(16));\n }\n } else if (\n (0x0700 <= charCode && charCode <= 0x08ac) ||\n (0xfb50 <= charCode && charCode <= 0xfdff) ||\n (0xfe70 <= charCode && charCode <= 0xfeff)\n ) {\n charType = \"AL\";\n }\n if (charType === \"R\" || charType === \"AL\" || charType === \"AN\") {\n numBidi++;\n }\n types[i] = charType;\n }\n\n // Detect the bidi method\n // - If there are no rtl characters then no bidi needed\n // - If less than 30% chars are rtl then string is primarily ltr,\n // unless the string is very short.\n // - If more than 30% chars are rtl then string is primarily rtl\n if (numBidi === 0) {\n isLTR = true;\n return createBidiText(str, isLTR);\n }\n\n if (startLevel === -1) {\n if (numBidi / strLength < 0.3 && strLength > 4) {\n isLTR = true;\n startLevel = 0;\n } else {\n isLTR = false;\n startLevel = 1;\n }\n }\n\n const levels = [];\n for (i = 0; i < strLength; ++i) {\n levels[i] = startLevel;\n }\n\n /*\n X1-X10: skip most of this, since we are NOT doing the embeddings.\n */\n const e = isOdd(startLevel) ? \"R\" : \"L\";\n const sor = e;\n const eor = sor;\n\n /*\n W1. Examine each non-spacing mark (NSM) in the level run, and change the\n type of the NSM to the type of the previous character. If the NSM is at the\n start of the level run, it will get the type of sor.\n */\n let lastType = sor;\n for (i = 0; i < strLength; ++i) {\n if (types[i] === \"NSM\") {\n types[i] = lastType;\n } else {\n lastType = types[i];\n }\n }\n\n /*\n W2. Search backwards from each instance of a European number until the\n first strong type (R, L, AL, or sor) is found. If an AL is found, change\n the type of the European number to Arabic number.\n */\n lastType = sor;\n let t;\n for (i = 0; i < strLength; ++i) {\n t = types[i];\n if (t === \"EN\") {\n types[i] = lastType === \"AL\" ? \"AN\" : \"EN\";\n } else if (t === \"R\" || t === \"L\" || t === \"AL\") {\n lastType = t;\n }\n }\n\n /*\n W3. Change all ALs to R.\n */\n for (i = 0; i < strLength; ++i) {\n t = types[i];\n if (t === \"AL\") {\n types[i] = \"R\";\n }\n }\n\n /*\n W4. A single European separator between two European numbers changes to a\n European number. A single common separator between two numbers of the same\n type changes to that type:\n */\n for (i = 1; i < strLength - 1; ++i) {\n if (types[i] === \"ES\" && types[i - 1] === \"EN\" && types[i + 1] === \"EN\") {\n types[i] = \"EN\";\n }\n if (\n types[i] === \"CS\" &&\n (types[i - 1] === \"EN\" || types[i - 1] === \"AN\") &&\n types[i + 1] === types[i - 1]\n ) {\n types[i] = types[i - 1];\n }\n }\n\n /*\n W5. A sequence of European terminators adjacent to European numbers changes\n to all European numbers:\n */\n for (i = 0; i < strLength; ++i) {\n if (types[i] === \"EN\") {\n // do before\n for (let j = i - 1; j >= 0; --j) {\n if (types[j] !== \"ET\") {\n break;\n }\n types[j] = \"EN\";\n }\n // do after\n for (let j = i + 1; j < strLength; ++j) {\n if (types[j] !== \"ET\") {\n break;\n }\n types[j] = \"EN\";\n }\n }\n }\n\n /*\n W6. Otherwise, separators and terminators change to Other Neutral:\n */\n for (i = 0; i < strLength; ++i) {\n t = types[i];\n if (t === \"WS\" || t === \"ES\" || t === \"ET\" || t === \"CS\") {\n types[i] = \"ON\";\n }\n }\n\n /*\n W7. Search backwards from each instance of a European number until the\n first strong type (R, L, or sor) is found. If an L is found, then change\n the type of the European number to L.\n */\n lastType = sor;\n for (i = 0; i < strLength; ++i) {\n t = types[i];\n if (t === \"EN\") {\n types[i] = lastType === \"L\" ? \"L\" : \"EN\";\n } else if (t === \"R\" || t === \"L\") {\n lastType = t;\n }\n }\n\n /*\n N1. A sequence of neutrals takes the direction of the surrounding strong\n text if the text on both sides has the same direction. European and Arabic\n numbers are treated as though they were R. Start-of-level-run (sor) and\n end-of-level-run (eor) are used at level run boundaries.\n */\n for (i = 0; i < strLength; ++i) {\n if (types[i] === \"ON\") {\n const end = findUnequal(types, i + 1, \"ON\");\n let before = sor;\n if (i > 0) {\n before = types[i - 1];\n }\n\n let after = eor;\n if (end + 1 < strLength) {\n after = types[end + 1];\n }\n if (before !== \"L\") {\n before = \"R\";\n }\n if (after !== \"L\") {\n after = \"R\";\n }\n if (before === after) {\n setValues(types, i, end, before);\n }\n i = end - 1; // reset to end (-1 so next iteration is ok)\n }\n }\n\n /*\n N2. Any remaining neutrals take the embedding direction.\n */\n for (i = 0; i < strLength; ++i) {\n if (types[i] === \"ON\") {\n types[i] = e;\n }\n }\n\n /*\n I1. For all characters with an even (left-to-right) embedding direction,\n those of type R go up one level and those of type AN or EN go up two\n levels.\n I2. For all characters with an odd (right-to-left) embedding direction,\n those of type L, EN or AN go up one level.\n */\n for (i = 0; i < strLength; ++i) {\n t = types[i];\n if (isEven(levels[i])) {\n if (t === \"R\") {\n levels[i] += 1;\n } else if (t === \"AN\" || t === \"EN\") {\n levels[i] += 2;\n }\n } else if (/* isOdd && */ t === \"L\" || t === \"AN\" || t === \"EN\") {\n levels[i] += 1;\n }\n }\n\n /*\n L1. On each line, reset the embedding level of the following characters to\n the paragraph embedding level:\n\n segment separators,\n paragraph separators,\n any sequence of whitespace characters preceding a segment separator or\n paragraph separator, and any sequence of white space characters at the end\n of the line.\n */\n\n // don't bother as text is only single line\n\n /*\n L2. From the highest level found in the text to the lowest odd level on\n each line, reverse any contiguous sequence of characters that are at that\n level or higher.\n */\n\n // find highest level & lowest odd level\n let highestLevel = -1;\n let lowestOddLevel = 99;\n let level;\n for (i = 0, ii = levels.length; i < ii; ++i) {\n level = levels[i];\n if (highestLevel < level) {\n highestLevel = level;\n }\n if (lowestOddLevel > level && isOdd(level)) {\n lowestOddLevel = level;\n }\n }\n\n // now reverse between those limits\n for (level = highestLevel; level >= lowestOddLevel; --level) {\n // find segments to reverse\n let start = -1;\n for (i = 0, ii = levels.length; i < ii; ++i) {\n if (levels[i] < level) {\n if (start >= 0) {\n reverseValues(chars, start, i);\n start = -1;\n }\n } else if (start < 0) {\n start = i;\n }\n }\n if (start >= 0) {\n reverseValues(chars, start, levels.length);\n }\n }\n\n /*\n L3. Combining marks applied to a right-to-left base character will at this\n point precede their base character. If the rendering engine expects them to\n follow the base characters in the final display process, then the ordering\n of the marks and the base character must be reversed.\n */\n\n // don't bother for now\n\n /*\n L4. A character that possesses the mirrored property as specified by\n Section 4.7, Mirrored, must be depicted by a mirrored glyph if the resolved\n directionality of that character is R.\n */\n\n // don't mirror as characters are already mirrored in the pdf\n\n // Finally, return string\n for (i = 0, ii = chars.length; i < ii; ++i) {\n const ch = chars[i];\n if (ch === \"<\" || ch === \">\") {\n chars[i] = \"\";\n }\n }\n return createBidiText(chars.join(\"\"), isLTR);\n}\n\nexport { bidi };\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 { normalizeFontName } from \"./fonts_utils.js\";\nimport { validateFontName } from \"./core_utils.js\";\n\nconst NORMAL = {\n style: \"normal\",\n weight: \"normal\",\n};\nconst BOLD = {\n style: \"normal\",\n weight: \"bold\",\n};\nconst ITALIC = {\n style: \"italic\",\n weight: \"normal\",\n};\nconst BOLDITALIC = {\n style: \"italic\",\n weight: \"bold\",\n};\n\nconst substitutionMap = new Map([\n [\n \"Times-Roman\",\n {\n local: [\n \"Times New Roman\",\n \"Times-Roman\",\n \"Times\",\n \"Liberation Serif\",\n \"Nimbus Roman\",\n \"Nimbus Roman L\",\n \"Tinos\",\n \"Thorndale\",\n \"TeX Gyre Termes\",\n \"FreeSerif\",\n \"DejaVu Serif\",\n \"Bitstream Vera Serif\",\n \"Ubuntu\",\n ],\n style: NORMAL,\n ultimate: \"serif\",\n },\n ],\n [\n \"Times-Bold\",\n {\n alias: \"Times-Roman\",\n style: BOLD,\n ultimate: \"serif\",\n },\n ],\n [\n \"Times-Italic\",\n {\n alias: \"Times-Roman\",\n style: ITALIC,\n ultimate: \"serif\",\n },\n ],\n [\n \"Times-BoldItalic\",\n {\n alias: \"Times-Roman\",\n style: BOLDITALIC,\n ultimate: \"serif\",\n },\n ],\n [\n \"Helvetica\",\n {\n local: [\n \"Helvetica\",\n \"Helvetica Neue\",\n \"Arial\",\n \"Arial Nova\",\n \"Liberation Sans\",\n \"Arimo\",\n \"Nimbus Sans\",\n \"Nimbus Sans L\",\n \"A030\",\n \"TeX Gyre Heros\",\n \"FreeSans\",\n \"DejaVu Sans\",\n \"Albany\",\n \"Bitstream Vera Sans\",\n \"Arial Unicode MS\",\n \"Microsoft Sans Serif\",\n \"Apple Symbols\",\n \"Cantarell\",\n ],\n path: \"LiberationSans-Regular.ttf\",\n style: NORMAL,\n ultimate: \"sans-serif\",\n },\n ],\n [\n \"Helvetica-Bold\",\n {\n alias: \"Helvetica\",\n path: \"LiberationSans-Bold.ttf\",\n style: BOLD,\n ultimate: \"sans-serif\",\n },\n ],\n [\n \"Helvetica-Oblique\",\n {\n alias: \"Helvetica\",\n path: \"LiberationSans-Italic.ttf\",\n style: ITALIC,\n ultimate: \"sans-serif\",\n },\n ],\n [\n \"Helvetica-BoldOblique\",\n {\n alias: \"Helvetica\",\n path: \"LiberationSans-BoldItalic.ttf\",\n style: BOLDITALIC,\n ultimate: \"sans-serif\",\n },\n ],\n [\n \"Courier\",\n {\n local: [\n \"Courier\",\n \"Courier New\",\n \"Liberation Mono\",\n \"Nimbus Mono\",\n \"Nimbus Mono L\",\n \"Cousine\",\n \"Cumberland\",\n \"TeX Gyre Cursor\",\n \"FreeMono\",\n ],\n style: NORMAL,\n ultimate: \"monospace\",\n },\n ],\n [\n \"Courier-Bold\",\n {\n alias: \"Courier\",\n style: BOLD,\n ultimate: \"monospace\",\n },\n ],\n [\n \"Courier-Oblique\",\n {\n alias: \"Courier\",\n style: ITALIC,\n ultimate: \"monospace\",\n },\n ],\n [\n \"Courier-BoldOblique\",\n {\n alias: \"Courier\",\n style: BOLDITALIC,\n ultimate: \"monospace\",\n },\n ],\n [\n \"ArialBlack\",\n {\n local: [\"Arial Black\"],\n style: {\n style: \"normal\",\n weight: \"900\",\n },\n fallback: \"Helvetica-Bold\",\n },\n ],\n [\n \"ArialBlack-Bold\",\n {\n alias: \"ArialBlack\",\n },\n ],\n [\n \"ArialBlack-Italic\",\n {\n alias: \"ArialBlack\",\n style: {\n style: \"italic\",\n weight: \"900\",\n },\n fallback: \"Helvetica-BoldOblique\",\n },\n ],\n [\n \"ArialBlack-BoldItalic\",\n {\n alias: \"ArialBlack-Italic\",\n },\n ],\n [\n \"ArialNarrow\",\n {\n local: [\n \"Arial Narrow\",\n \"Liberation Sans Narrow\",\n \"Helvetica Condensed\",\n \"Nimbus Sans Narrow\",\n \"TeX Gyre Heros Cn\",\n ],\n style: NORMAL,\n fallback: \"Helvetica\",\n },\n ],\n [\n \"ArialNarrow-Bold\",\n {\n alias: \"ArialNarrow\",\n style: BOLD,\n fallback: \"Helvetica-Bold\",\n },\n ],\n [\n \"ArialNarrow-Italic\",\n {\n alias: \"ArialNarrow\",\n style: ITALIC,\n fallback: \"Helvetica-Oblique\",\n },\n ],\n [\n \"ArialNarrow-BoldItalic\",\n {\n alias: \"ArialNarrow\",\n style: BOLDITALIC,\n fallback: \"Helvetica-BoldOblique\",\n },\n ],\n [\n \"Calibri\",\n {\n local: [\"Calibri\", \"Carlito\"],\n style: NORMAL,\n fallback: \"Helvetica\",\n },\n ],\n [\n \"Calibri-Bold\",\n {\n alias: \"Calibri\",\n style: BOLD,\n fallback: \"Helvetica-Bold\",\n },\n ],\n [\n \"Calibri-Italic\",\n {\n alias: \"Calibri\",\n style: ITALIC,\n fallback: \"Helvetica-Oblique\",\n },\n ],\n [\n \"Calibri-BoldItalic\",\n {\n alias: \"Calibri\",\n style: BOLDITALIC,\n fallback: \"Helvetica-BoldOblique\",\n },\n ],\n [\n \"Wingdings\",\n {\n local: [\"Wingdings\", \"URW Dingbats\"],\n style: NORMAL,\n },\n ],\n [\n \"Wingdings-Regular\",\n {\n alias: \"Wingdings\",\n },\n ],\n [\n \"Wingdings-Bold\",\n {\n alias: \"Wingdings\",\n },\n ],\n]);\n\nconst fontAliases = new Map([[\"Arial-Black\", \"ArialBlack\"]]);\n\nfunction getStyleToAppend(style) {\n switch (style) {\n case BOLD:\n return \"Bold\";\n case ITALIC:\n return \"Italic\";\n case BOLDITALIC:\n return \"Bold Italic\";\n default:\n if (style?.weight === \"bold\") {\n return \"Bold\";\n }\n if (style?.style === \"italic\") {\n return \"Italic\";\n }\n }\n return \"\";\n}\n\n/**\n * Generate font description.\n * @param {Object} param0, font substitution description.\n * @param {Array<String>} src, contains src values (local(...) or url(...)).\n * @param {String} localFontPath, path to local fonts.\n * @param {boolean} useFallback, whether to use fallback font.\n * @param {boolean} usePath, whether to use path to font.\n * @param {String} append, style (Bold, Italic, ...) to append to font name.\n * @return {Object} { style, ultimate }.\n */\nfunction generateFont(\n { alias, local, path, fallback, style, ultimate },\n src,\n localFontPath,\n useFallback = true,\n usePath = true,\n append = \"\"\n) {\n const result = {\n style: null,\n ultimate: null,\n };\n if (local) {\n const extra = append ? ` ${append}` : \"\";\n for (const name of local) {\n src.push(`local(${name}${extra})`);\n }\n }\n if (alias) {\n const substitution = substitutionMap.get(alias);\n const aliasAppend = append || getStyleToAppend(style);\n Object.assign(\n result,\n generateFont(\n substitution,\n src,\n localFontPath,\n /* useFallback = */ useFallback && !fallback,\n /* usePath = */ usePath && !path,\n aliasAppend\n )\n );\n }\n if (style) {\n result.style = style;\n }\n if (ultimate) {\n result.ultimate = ultimate;\n }\n if (useFallback && fallback) {\n const fallbackInfo = substitutionMap.get(fallback);\n const { ultimate: fallbackUltimate } = generateFont(\n fallbackInfo,\n src,\n localFontPath,\n useFallback,\n /* usePath = */ usePath && !path,\n append\n );\n result.ultimate ||= fallbackUltimate;\n }\n if (usePath && path && localFontPath) {\n src.push(`url(${localFontPath}${path})`);\n }\n\n return result;\n}\n\n/**\n * Get a font substitution for a given font.\n * The general idea is to have enough information to create a CSS rule like\n * this:\n * @font-face {\n * font-family: 'Times';\n * src: local('Times New Roman'), local('Subst1'), local('Subst2'),\n * url(.../TimesNewRoman.ttf)\n * font-weight: normal;\n * font-style: normal;\n * }\n * or use the FontFace API.\n *\n * @param {Map} systemFontCache The cache of local fonts.\n * @param {Object} idFactory The ids factory.\n * @param {String} localFontPath Path to the fonts directory.\n * @param {String} baseFontName The font name to be substituted.\n * @param {String|undefined} standardFontName The standard font name to use\n * if the base font is not available.\n * @returns an Object with the CSS, the loaded name, the src and the style.\n */\nfunction getFontSubstitution(\n systemFontCache,\n idFactory,\n localFontPath,\n baseFontName,\n standardFontName\n) {\n if (baseFontName.startsWith(\"InvalidPDFjsFont_\")) {\n return null;\n }\n\n // It's possible to have a font name with spaces, commas or dashes, hence we\n // just replace them by a dash.\n baseFontName = normalizeFontName(baseFontName);\n\n const key = baseFontName;\n let substitutionInfo = systemFontCache.get(key);\n if (substitutionInfo) {\n return substitutionInfo;\n }\n\n // First, check if we've a substitution for the base font.\n let substitution = substitutionMap.get(baseFontName);\n if (!substitution) {\n // Check if we've an alias for the base font, Arial-Black is the same as\n // ArialBlack\n for (const [alias, subst] of fontAliases) {\n if (baseFontName.startsWith(alias)) {\n baseFontName = `${subst}${baseFontName.substring(alias.length)}`;\n substitution = substitutionMap.get(baseFontName);\n break;\n }\n }\n }\n\n let mustAddBaseFont = false;\n if (!substitution) {\n // If not, check if we've a substitution for the standard font.\n substitution = substitutionMap.get(standardFontName);\n mustAddBaseFont = true;\n }\n\n const loadedName = `${idFactory.getDocId()}_s${idFactory.createFontId()}`;\n if (!substitution) {\n if (!validateFontName(baseFontName)) {\n systemFontCache.set(key, null);\n // If the baseFontName is not valid we don't want to use it.\n return null;\n }\n // Maybe we'll be lucky and the OS will have the font.\n const bold = /bold/gi.test(baseFontName);\n const italic = /oblique|italic/gi.test(baseFontName);\n const style =\n (bold && italic && BOLDITALIC) ||\n (bold && BOLD) ||\n (italic && ITALIC) ||\n NORMAL;\n substitutionInfo = {\n css: loadedName,\n guessFallback: true,\n loadedName,\n baseFontName,\n src: `local(${baseFontName})`,\n style,\n };\n systemFontCache.set(key, substitutionInfo);\n return substitutionInfo;\n }\n\n const src = [];\n // Maybe the OS will have the exact font we want so just prepend it to the\n // list.\n if (mustAddBaseFont && validateFontName(baseFontName)) {\n src.push(`local(${baseFontName})`);\n }\n const { style, ultimate } = generateFont(substitution, src, localFontPath);\n const guessFallback = ultimate === null;\n const fallback = guessFallback ? \"\" : `,${ultimate}`;\n\n substitutionInfo = {\n css: `${loadedName}${fallback}`,\n guessFallback,\n loadedName,\n baseFontName,\n src: src.join(\",\"),\n style,\n };\n systemFontCache.set(key, substitutionInfo);\n\n return substitutionInfo;\n}\n\nexport { getFontSubstitution };\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 { FeatureTest, ImageKind, shadow } from \"../shared/util.js\";\n\nconst MIN_IMAGE_DIM = 2048;\n\n// In Chrome, there aren't max dimensions but only a max area. So an image with\n// a very large dimensions is acceptable but it probably doesn't hurt to reduce\n// it when considering that it will finally rendered on a small canvas.\nconst MAX_IMAGE_DIM = 65537;\nconst MAX_ERROR = 128;\n\n// Large images are encoded in using the BMP format (it's a way faster than\n// encoding in PNG because there are no checksums to compute).\n// Unfortunately, createImageBitmap will create a task in the main thread in\n// order to build the bitmap, hence the main thread is blocked during the\n// decoding which can be a bit long (see bug 1817244).\n// When bug 1759728 is fixed we can remove the BMP workaround and at least it\n// should be a way faster to create the bitmap.\n\nclass ImageResizer {\n constructor(imgData, isMask) {\n this._imgData = imgData;\n this._isMask = isMask;\n }\n\n static needsToBeResized(width, height) {\n if (width <= this._goodSquareLength && height <= this._goodSquareLength) {\n return false;\n }\n\n const { MAX_DIM } = this;\n if (width > MAX_DIM || height > MAX_DIM) {\n return true;\n }\n\n const area = width * height;\n if (this._hasMaxArea) {\n return area > this.MAX_AREA;\n }\n\n if (area < this._goodSquareLength ** 2) {\n return false;\n }\n\n // We try as much as possible to avoid to compute the max area.\n if (this._areGoodDims(width, height)) {\n this._goodSquareLength = Math.max(\n this._goodSquareLength,\n Math.floor(Math.sqrt(width * height))\n );\n return false;\n }\n\n // TODO: the computation can be a bit long because we potentially allocate\n // some large canvas, so in the Firefox case this value (and MAX_DIM) can be\n // infered from prefs (MAX_AREA = gfx.max-alloc-size / 4, 4 is because of\n // RGBA).\n this._goodSquareLength = this._guessMax(\n this._goodSquareLength,\n MAX_DIM,\n MAX_ERROR,\n 0\n );\n const maxArea = (this.MAX_AREA = this._goodSquareLength ** 2);\n\n return area > maxArea;\n }\n\n static get MAX_DIM() {\n return shadow(\n this,\n \"MAX_DIM\",\n this._guessMax(MIN_IMAGE_DIM, MAX_IMAGE_DIM, 0, 1)\n );\n }\n\n static get MAX_AREA() {\n this._hasMaxArea = true;\n return shadow(\n this,\n \"MAX_AREA\",\n this._guessMax(\n ImageResizer._goodSquareLength,\n this.MAX_DIM,\n MAX_ERROR,\n 0\n ) ** 2\n );\n }\n\n static set MAX_AREA(area) {\n if (area >= 0) {\n this._hasMaxArea = true;\n shadow(this, \"MAX_AREA\", area);\n }\n }\n\n static setMaxArea(area) {\n if (!this._hasMaxArea) {\n // Divide by 4 to have the value in pixels.\n this.MAX_AREA = area >> 2;\n }\n }\n\n static _areGoodDims(width, height) {\n try {\n // This code is working in either Firefox or Chrome.\n // There is a faster solution using transferToImageBitmap which is faster\n // in Firefox (when the dimensions are wrong the resulting bitmap has its\n // dimensions equal to 1) but it doesn't find the correct values in\n // Chrome.\n const canvas = new OffscreenCanvas(width, height);\n const ctx = canvas.getContext(\"2d\");\n ctx.fillRect(0, 0, 1, 1);\n const opacity = ctx.getImageData(0, 0, 1, 1).data[3];\n canvas.width = canvas.height = 1;\n return opacity !== 0;\n } catch {\n return false;\n }\n }\n\n static _guessMax(start, end, tolerance, defaultHeight) {\n // We don't really need to have exact values.\n // When we're here then we're in a corner case: we've a very large image.\n // So we could potentially downscale an image which fits in the canvas,\n // it's maybe a pity in term of perfs but we'll reduce the memory use.\n // The tolerance is the acceptable error we can make on the limit we want.\n // On Chrome, when the tolerance 0 then it can take ~5s to compute the max\n // area... and having a tolerance of 128 divides the time by 2.\n while (start + tolerance + 1 < end) {\n const middle = Math.floor((start + end) / 2);\n const height = defaultHeight || middle;\n if (this._areGoodDims(middle, height)) {\n start = middle;\n } else {\n end = middle;\n }\n }\n return start;\n }\n\n static async createImage(imgData, isMask = false) {\n return new ImageResizer(imgData, isMask)._createImage();\n }\n\n async _createImage() {\n const data = this._encodeBMP();\n const blob = new Blob([data.buffer], {\n type: \"image/bmp\",\n });\n const bitmapPromise = createImageBitmap(blob);\n\n const { MAX_AREA, MAX_DIM } = ImageResizer;\n const { _imgData: imgData } = this;\n const { width, height } = imgData;\n const minFactor = Math.max(\n width / MAX_DIM,\n height / MAX_DIM,\n Math.sqrt((width * height) / MAX_AREA)\n );\n\n const firstFactor = Math.max(minFactor, 2);\n\n // Add 1 to the ratio and round it with 1 digit.\n // We add 1.25 in order to have a final image under the limits\n // (and not just at the limits) to reduce memory use.\n const factor = Math.round(10 * (minFactor + 1.25)) / 10 / firstFactor;\n\n const N = Math.floor(Math.log2(factor));\n const steps = new Array(N + 2).fill(2);\n steps[0] = firstFactor;\n steps.splice(-1, 1, factor / (1 << N));\n\n let newWidth = width;\n let newHeight = height;\n let bitmap = await bitmapPromise;\n\n for (const step of steps) {\n const prevWidth = newWidth;\n const prevHeight = newHeight;\n\n // See bug 1820511 (Windows specific bug).\n // TODO: once the above bug is fixed we could revert to:\n // newWidth = Math.floor(newWidth / 2);\n newWidth = Math.floor(newWidth / step) - 1;\n newHeight = Math.floor(newHeight / step) - 1;\n\n const canvas = new OffscreenCanvas(newWidth, newHeight);\n const ctx = canvas.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 = canvas.transferToImageBitmap();\n }\n\n imgData.data = null;\n imgData.bitmap = bitmap;\n imgData.width = newWidth;\n imgData.height = newHeight;\n\n return imgData;\n }\n\n _encodeBMP() {\n const { width, height, kind } = this._imgData;\n let data = this._imgData.data;\n let bitPerPixel;\n let colorTable = new Uint8Array(0);\n let maskTable = colorTable;\n let compression = 0;\n\n // Each row of the image must be padded in order to have a final size which\n // is a multiple of 4.\n\n switch (kind) {\n case ImageKind.GRAYSCALE_1BPP: {\n bitPerPixel = 1;\n colorTable = new Uint8Array(\n this._isMask\n ? [255, 255, 255, 255, 0, 0, 0, 0]\n : [0, 0, 0, 0, 255, 255, 255, 255]\n );\n const rowLen = (width + 7) >> 3;\n const rowSize = (rowLen + 3) & -4;\n if (rowLen !== rowSize) {\n const newData = new Uint8Array(rowSize * height);\n let k = 0;\n for (\n let i = 0, ii = height * rowLen;\n i < ii;\n i += rowLen, k += rowSize\n ) {\n newData.set(data.subarray(i, i + rowLen), k);\n }\n data = newData;\n }\n break;\n }\n case ImageKind.RGB_24BPP: {\n bitPerPixel = 24;\n if (width & 3) {\n const rowLen = 3 * width;\n const rowSize = (rowLen + 3) & -4;\n const extraLen = rowSize - rowLen;\n const newData = new Uint8Array(rowSize * height);\n let k = 0;\n for (let i = 0, ii = height * rowLen; i < ii; i += rowLen) {\n const row = data.subarray(i, i + rowLen);\n for (let j = 0; j < rowLen; j += 3) {\n newData[k++] = row[j + 2];\n newData[k++] = row[j + 1];\n newData[k++] = row[j];\n }\n k += extraLen;\n }\n data = newData;\n } else {\n for (let i = 0, ii = data.length; i < ii; i += 3) {\n // Just swap R and B.\n const tmp = data[i];\n data[i] = data[i + 2];\n data[i + 2] = tmp;\n }\n }\n break;\n }\n case ImageKind.RGBA_32BPP:\n bitPerPixel = 32;\n compression = 3;\n maskTable = new Uint8Array(\n 4 /* R mask */ +\n 4 /* G mask */ +\n 4 /* B mask */ +\n 4 /* A mask */ +\n 52 /* Windows color space stuff */\n );\n const view = new DataView(maskTable.buffer);\n if (FeatureTest.isLittleEndian) {\n view.setUint32(0, 0x000000ff, true);\n view.setUint32(4, 0x0000ff00, true);\n view.setUint32(8, 0x00ff0000, true);\n view.setUint32(12, 0xff000000, true);\n } else {\n view.setUint32(0, 0xff000000, true);\n view.setUint32(4, 0x00ff0000, true);\n view.setUint32(8, 0x0000ff00, true);\n view.setUint32(12, 0x000000ff, true);\n }\n break;\n default:\n throw new Error(\"invalid format\");\n }\n\n let i = 0;\n const headerLength = 40 + maskTable.length;\n const fileLength = 14 + headerLength + colorTable.length + data.length;\n const bmpData = new Uint8Array(fileLength);\n const view = new DataView(bmpData.buffer);\n\n // Signature.\n view.setUint16(i, 0x4d42, true);\n i += 2;\n\n // File size.\n view.setUint32(i, fileLength, true);\n i += 4;\n\n // Reserved.\n view.setUint32(i, 0, true);\n i += 4;\n\n // Data offset.\n view.setUint32(i, 14 + headerLength + colorTable.length, true);\n i += 4;\n\n // Header size.\n view.setUint32(i, headerLength, true);\n i += 4;\n\n // Width.\n view.setInt32(i, width, true);\n i += 4;\n\n // Height.\n // Negative height indicates that the image is stored from top to bottom.\n view.setInt32(i, -height, true);\n i += 4;\n\n // Number of planes (must be 1).\n view.setUint16(i, 1, true);\n i += 2;\n\n // Number of bit per pixel.\n view.setUint16(i, bitPerPixel, true);\n i += 2;\n\n // Compression method.\n view.setUint32(i, compression, true);\n i += 4;\n\n // The image size.\n view.setUint32(i, 0, true);\n i += 4;\n\n // Horizontal resolution.\n view.setInt32(i, 0, true);\n i += 4;\n\n // Vertical resolution.\n view.setInt32(i, 0, true);\n i += 4;\n\n // Number of colors in the palette (0 to default).\n view.setUint32(i, colorTable.length / 4, true);\n i += 4;\n\n // Number of important colors used (0 to default).\n view.setUint32(i, 0, true);\n i += 4;\n\n bmpData.set(maskTable, i);\n i += maskTable.length;\n\n bmpData.set(colorTable, i);\n i += colorTable.length;\n\n bmpData.set(data, i);\n\n return bmpData;\n }\n}\n\nImageResizer._goodSquareLength = MIN_IMAGE_DIM;\n\nexport { ImageResizer };\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 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 { ImageKind, OPS, RenderingIntentFlag, warn } from \"../shared/util.js\";\n\nfunction addState(parentState, pattern, checkFn, iterateFn, processFn) {\n let state = parentState;\n for (let i = 0, ii = pattern.length - 1; i < ii; i++) {\n const item = pattern[i];\n state = state[item] ||= [];\n }\n state[pattern.at(-1)] = {\n checkFn,\n iterateFn,\n processFn,\n };\n}\n\nconst InitialState = [];\n\n// This replaces (save, transform, paintInlineImageXObject, restore)+\n// sequences with one |paintInlineImageXObjectGroup| operation.\naddState(\n InitialState,\n [OPS.save, OPS.transform, OPS.paintInlineImageXObject, OPS.restore],\n null,\n function iterateInlineImageGroup(context, i) {\n const fnArray = context.fnArray;\n const iFirstSave = context.iCurr - 3;\n const pos = (i - iFirstSave) % 4;\n switch (pos) {\n case 0:\n return fnArray[i] === OPS.save;\n case 1:\n return fnArray[i] === OPS.transform;\n case 2:\n return fnArray[i] === OPS.paintInlineImageXObject;\n case 3:\n return fnArray[i] === OPS.restore;\n }\n throw new Error(`iterateInlineImageGroup - invalid pos: ${pos}`);\n },\n function foundInlineImageGroup(context, i) {\n const MIN_IMAGES_IN_INLINE_IMAGES_BLOCK = 10;\n const MAX_IMAGES_IN_INLINE_IMAGES_BLOCK = 200;\n const MAX_WIDTH = 1000;\n const IMAGE_PADDING = 1;\n\n const fnArray = context.fnArray,\n argsArray = context.argsArray;\n const curr = context.iCurr;\n const iFirstSave = curr - 3;\n const iFirstTransform = curr - 2;\n const iFirstPIIXO = curr - 1;\n\n const count = Math.min(\n Math.floor((i - iFirstSave) / 4),\n MAX_IMAGES_IN_INLINE_IMAGES_BLOCK\n );\n if (count < MIN_IMAGES_IN_INLINE_IMAGES_BLOCK) {\n return i - ((i - iFirstSave) % 4);\n }\n\n // assuming that heights of those image is too small (~1 pixel)\n // packing as much as possible by lines\n let maxX = 0;\n const map = [];\n let maxLineHeight = 0;\n let currentX = IMAGE_PADDING,\n currentY = IMAGE_PADDING;\n for (let q = 0; q < count; q++) {\n const transform = argsArray[iFirstTransform + (q << 2)];\n const img = argsArray[iFirstPIIXO + (q << 2)][0];\n if (currentX + img.width > MAX_WIDTH) {\n // starting new line\n maxX = Math.max(maxX, currentX);\n currentY += maxLineHeight + 2 * IMAGE_PADDING;\n currentX = 0;\n maxLineHeight = 0;\n }\n map.push({\n transform,\n x: currentX,\n y: currentY,\n w: img.width,\n h: img.height,\n });\n currentX += img.width + 2 * IMAGE_PADDING;\n maxLineHeight = Math.max(maxLineHeight, img.height);\n }\n const imgWidth = Math.max(maxX, currentX) + IMAGE_PADDING;\n const imgHeight = currentY + maxLineHeight + IMAGE_PADDING;\n const imgData = new Uint8Array(imgWidth * imgHeight * 4);\n const imgRowSize = imgWidth << 2;\n for (let q = 0; q < count; q++) {\n const data = argsArray[iFirstPIIXO + (q << 2)][0].data;\n // Copy image by lines and extends pixels into padding.\n const rowSize = map[q].w << 2;\n let dataOffset = 0;\n let offset = (map[q].x + map[q].y * imgWidth) << 2;\n imgData.set(data.subarray(0, rowSize), offset - imgRowSize);\n for (let k = 0, kk = map[q].h; k < kk; k++) {\n imgData.set(data.subarray(dataOffset, dataOffset + rowSize), offset);\n dataOffset += rowSize;\n offset += imgRowSize;\n }\n imgData.set(data.subarray(dataOffset - rowSize, dataOffset), offset);\n while (offset >= 0) {\n data[offset - 4] = data[offset];\n data[offset - 3] = data[offset + 1];\n data[offset - 2] = data[offset + 2];\n data[offset - 1] = data[offset + 3];\n data[offset + rowSize] = data[offset + rowSize - 4];\n data[offset + rowSize + 1] = data[offset + rowSize - 3];\n data[offset + rowSize + 2] = data[offset + rowSize - 2];\n data[offset + rowSize + 3] = data[offset + rowSize - 1];\n offset -= imgRowSize;\n }\n }\n\n const img = {\n width: imgWidth,\n height: imgHeight,\n };\n if (context.isOffscreenCanvasSupported) {\n const canvas = new OffscreenCanvas(imgWidth, imgHeight);\n const ctx = canvas.getContext(\"2d\");\n ctx.putImageData(\n new ImageData(\n new Uint8ClampedArray(imgData.buffer),\n imgWidth,\n imgHeight\n ),\n 0,\n 0\n );\n img.bitmap = canvas.transferToImageBitmap();\n img.data = null;\n } else {\n img.kind = ImageKind.RGBA_32BPP;\n img.data = imgData;\n }\n\n // Replace queue items.\n fnArray.splice(iFirstSave, count * 4, OPS.paintInlineImageXObjectGroup);\n argsArray.splice(iFirstSave, count * 4, [img, map]);\n\n return iFirstSave + 1;\n }\n);\n\n// This replaces (save, transform, paintImageMaskXObject, restore)+\n// sequences with one |paintImageMaskXObjectGroup| or one\n// |paintImageMaskXObjectRepeat| operation.\naddState(\n InitialState,\n [OPS.save, OPS.transform, OPS.paintImageMaskXObject, OPS.restore],\n null,\n function iterateImageMaskGroup(context, i) {\n const fnArray = context.fnArray;\n const iFirstSave = context.iCurr - 3;\n const pos = (i - iFirstSave) % 4;\n switch (pos) {\n case 0:\n return fnArray[i] === OPS.save;\n case 1:\n return fnArray[i] === OPS.transform;\n case 2:\n return fnArray[i] === OPS.paintImageMaskXObject;\n case 3:\n return fnArray[i] === OPS.restore;\n }\n throw new Error(`iterateImageMaskGroup - invalid pos: ${pos}`);\n },\n function foundImageMaskGroup(context, i) {\n const MIN_IMAGES_IN_MASKS_BLOCK = 10;\n const MAX_IMAGES_IN_MASKS_BLOCK = 100;\n const MAX_SAME_IMAGES_IN_MASKS_BLOCK = 1000;\n\n const fnArray = context.fnArray,\n argsArray = context.argsArray;\n const curr = context.iCurr;\n const iFirstSave = curr - 3;\n const iFirstTransform = curr - 2;\n const iFirstPIMXO = curr - 1;\n\n // At this point, i is the index of the first op past the last valid\n // quartet.\n let count = Math.floor((i - iFirstSave) / 4);\n if (count < MIN_IMAGES_IN_MASKS_BLOCK) {\n return i - ((i - iFirstSave) % 4);\n }\n\n let isSameImage = false;\n let iTransform, transformArgs;\n const firstPIMXOArg0 = argsArray[iFirstPIMXO][0];\n const firstTransformArg0 = argsArray[iFirstTransform][0],\n firstTransformArg1 = argsArray[iFirstTransform][1],\n firstTransformArg2 = argsArray[iFirstTransform][2],\n firstTransformArg3 = argsArray[iFirstTransform][3];\n\n if (firstTransformArg1 === firstTransformArg2) {\n isSameImage = true;\n iTransform = iFirstTransform + 4;\n let iPIMXO = iFirstPIMXO + 4;\n for (let q = 1; q < count; q++, iTransform += 4, iPIMXO += 4) {\n transformArgs = argsArray[iTransform];\n if (\n argsArray[iPIMXO][0] !== firstPIMXOArg0 ||\n transformArgs[0] !== firstTransformArg0 ||\n transformArgs[1] !== firstTransformArg1 ||\n transformArgs[2] !== firstTransformArg2 ||\n transformArgs[3] !== firstTransformArg3\n ) {\n if (q < MIN_IMAGES_IN_MASKS_BLOCK) {\n isSameImage = false;\n } else {\n count = q;\n }\n break; // different image or transform\n }\n }\n }\n\n if (isSameImage) {\n count = Math.min(count, MAX_SAME_IMAGES_IN_MASKS_BLOCK);\n const positions = new Float32Array(count * 2);\n iTransform = iFirstTransform;\n for (let q = 0; q < count; q++, iTransform += 4) {\n transformArgs = argsArray[iTransform];\n positions[q << 1] = transformArgs[4];\n positions[(q << 1) + 1] = transformArgs[5];\n }\n\n // Replace queue items.\n fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectRepeat);\n argsArray.splice(iFirstSave, count * 4, [\n firstPIMXOArg0,\n firstTransformArg0,\n firstTransformArg1,\n firstTransformArg2,\n firstTransformArg3,\n positions,\n ]);\n } else {\n count = Math.min(count, MAX_IMAGES_IN_MASKS_BLOCK);\n const images = [];\n for (let q = 0; q < count; q++) {\n transformArgs = argsArray[iFirstTransform + (q << 2)];\n const maskParams = argsArray[iFirstPIMXO + (q << 2)][0];\n images.push({\n data: maskParams.data,\n width: maskParams.width,\n height: maskParams.height,\n interpolate: maskParams.interpolate,\n count: maskParams.count,\n transform: transformArgs,\n });\n }\n\n // Replace queue items.\n fnArray.splice(iFirstSave, count * 4, OPS.paintImageMaskXObjectGroup);\n argsArray.splice(iFirstSave, count * 4, [images]);\n }\n\n return iFirstSave + 1;\n }\n);\n\n// This replaces (save, transform, paintImageXObject, restore)+ sequences\n// with one paintImageXObjectRepeat operation, if the |transform| and\n// |paintImageXObjectRepeat| ops are appropriate.\naddState(\n InitialState,\n [OPS.save, OPS.transform, OPS.paintImageXObject, OPS.restore],\n function (context) {\n const argsArray = context.argsArray;\n const iFirstTransform = context.iCurr - 2;\n return (\n argsArray[iFirstTransform][1] === 0 && argsArray[iFirstTransform][2] === 0\n );\n },\n function iterateImageGroup(context, i) {\n const fnArray = context.fnArray,\n argsArray = context.argsArray;\n const iFirstSave = context.iCurr - 3;\n const pos = (i - iFirstSave) % 4;\n switch (pos) {\n case 0:\n return fnArray[i] === OPS.save;\n case 1:\n if (fnArray[i] !== OPS.transform) {\n return false;\n }\n const iFirstTransform = context.iCurr - 2;\n const firstTransformArg0 = argsArray[iFirstTransform][0];\n const firstTransformArg3 = argsArray[iFirstTransform][3];\n if (\n argsArray[i][0] !== firstTransformArg0 ||\n argsArray[i][1] !== 0 ||\n argsArray[i][2] !== 0 ||\n argsArray[i][3] !== firstTransformArg3\n ) {\n return false; // transforms don't match\n }\n return true;\n case 2:\n if (fnArray[i] !== OPS.paintImageXObject) {\n return false;\n }\n const iFirstPIXO = context.iCurr - 1;\n const firstPIXOArg0 = argsArray[iFirstPIXO][0];\n if (argsArray[i][0] !== firstPIXOArg0) {\n return false; // images don't match\n }\n return true;\n case 3:\n return fnArray[i] === OPS.restore;\n }\n throw new Error(`iterateImageGroup - invalid pos: ${pos}`);\n },\n function (context, i) {\n const MIN_IMAGES_IN_BLOCK = 3;\n const MAX_IMAGES_IN_BLOCK = 1000;\n\n const fnArray = context.fnArray,\n argsArray = context.argsArray;\n const curr = context.iCurr;\n const iFirstSave = curr - 3;\n const iFirstTransform = curr - 2;\n const iFirstPIXO = curr - 1;\n const firstPIXOArg0 = argsArray[iFirstPIXO][0];\n const firstTransformArg0 = argsArray[iFirstTransform][0];\n const firstTransformArg3 = argsArray[iFirstTransform][3];\n\n // At this point, i is the index of the first op past the last valid\n // quartet.\n const count = Math.min(\n Math.floor((i - iFirstSave) / 4),\n MAX_IMAGES_IN_BLOCK\n );\n if (count < MIN_IMAGES_IN_BLOCK) {\n return i - ((i - iFirstSave) % 4);\n }\n\n // Extract the (x,y) positions from all of the matching transforms.\n const positions = new Float32Array(count * 2);\n let iTransform = iFirstTransform;\n for (let q = 0; q < count; q++, iTransform += 4) {\n const transformArgs = argsArray[iTransform];\n positions[q << 1] = transformArgs[4];\n positions[(q << 1) + 1] = transformArgs[5];\n }\n\n // Replace queue items.\n const args = [\n firstPIXOArg0,\n firstTransformArg0,\n firstTransformArg3,\n positions,\n ];\n fnArray.splice(iFirstSave, count * 4, OPS.paintImageXObjectRepeat);\n argsArray.splice(iFirstSave, count * 4, args);\n\n return iFirstSave + 1;\n }\n);\n\n// This replaces (beginText, setFont, setTextMatrix, showText, endText)+\n// sequences with (beginText, setFont, (setTextMatrix, showText)+, endText)+\n// sequences, if the font for each one is the same.\naddState(\n InitialState,\n [OPS.beginText, OPS.setFont, OPS.setTextMatrix, OPS.showText, OPS.endText],\n null,\n function iterateShowTextGroup(context, i) {\n const fnArray = context.fnArray,\n argsArray = context.argsArray;\n const iFirstSave = context.iCurr - 4;\n const pos = (i - iFirstSave) % 5;\n switch (pos) {\n case 0:\n return fnArray[i] === OPS.beginText;\n case 1:\n return fnArray[i] === OPS.setFont;\n case 2:\n return fnArray[i] === OPS.setTextMatrix;\n case 3:\n if (fnArray[i] !== OPS.showText) {\n return false;\n }\n const iFirstSetFont = context.iCurr - 3;\n const firstSetFontArg0 = argsArray[iFirstSetFont][0];\n const firstSetFontArg1 = argsArray[iFirstSetFont][1];\n if (\n argsArray[i][0] !== firstSetFontArg0 ||\n argsArray[i][1] !== firstSetFontArg1\n ) {\n return false; // fonts don't match\n }\n return true;\n case 4:\n return fnArray[i] === OPS.endText;\n }\n throw new Error(`iterateShowTextGroup - invalid pos: ${pos}`);\n },\n function (context, i) {\n const MIN_CHARS_IN_BLOCK = 3;\n const MAX_CHARS_IN_BLOCK = 1000;\n\n const fnArray = context.fnArray,\n argsArray = context.argsArray;\n const curr = context.iCurr;\n const iFirstBeginText = curr - 4;\n const iFirstSetFont = curr - 3;\n const iFirstSetTextMatrix = curr - 2;\n const iFirstShowText = curr - 1;\n const iFirstEndText = curr;\n const firstSetFontArg0 = argsArray[iFirstSetFont][0];\n const firstSetFontArg1 = argsArray[iFirstSetFont][1];\n\n // At this point, i is the index of the first op past the last valid\n // quintet.\n let count = Math.min(\n Math.floor((i - iFirstBeginText) / 5),\n MAX_CHARS_IN_BLOCK\n );\n if (count < MIN_CHARS_IN_BLOCK) {\n return i - ((i - iFirstBeginText) % 5);\n }\n\n // If the preceding quintet is (<something>, setFont, setTextMatrix,\n // showText, endText), include that as well. (E.g. <something> might be\n // |dependency|.)\n let iFirst = iFirstBeginText;\n if (\n iFirstBeginText >= 4 &&\n fnArray[iFirstBeginText - 4] === fnArray[iFirstSetFont] &&\n fnArray[iFirstBeginText - 3] === fnArray[iFirstSetTextMatrix] &&\n fnArray[iFirstBeginText - 2] === fnArray[iFirstShowText] &&\n fnArray[iFirstBeginText - 1] === fnArray[iFirstEndText] &&\n argsArray[iFirstBeginText - 4][0] === firstSetFontArg0 &&\n argsArray[iFirstBeginText - 4][1] === firstSetFontArg1\n ) {\n count++;\n iFirst -= 5;\n }\n\n // Remove (endText, beginText, setFont) trios.\n let iEndText = iFirst + 4;\n for (let q = 1; q < count; q++) {\n fnArray.splice(iEndText, 3);\n argsArray.splice(iEndText, 3);\n iEndText += 2;\n }\n\n return iEndText + 1;\n }\n);\n\nclass NullOptimizer {\n constructor(queue) {\n this.queue = queue;\n }\n\n _optimize() {}\n\n push(fn, args) {\n this.queue.fnArray.push(fn);\n this.queue.argsArray.push(args);\n this._optimize();\n }\n\n flush() {}\n\n reset() {}\n}\n\nclass QueueOptimizer extends NullOptimizer {\n constructor(queue) {\n super(queue);\n this.state = null;\n this.context = {\n iCurr: 0,\n fnArray: queue.fnArray,\n argsArray: queue.argsArray,\n isOffscreenCanvasSupported: false,\n };\n this.match = null;\n this.lastProcessed = 0;\n }\n\n // eslint-disable-next-line accessor-pairs\n set isOffscreenCanvasSupported(value) {\n this.context.isOffscreenCanvasSupported = value;\n }\n\n _optimize() {\n // Process new fnArray item(s) chunk.\n const fnArray = this.queue.fnArray;\n let i = this.lastProcessed,\n ii = fnArray.length;\n let state = this.state;\n let match = this.match;\n if (!state && !match && i + 1 === ii && !InitialState[fnArray[i]]) {\n // Micro-optimization for the common case: last item is not\n // optimizable, just skipping it.\n this.lastProcessed = ii;\n return;\n }\n\n const context = this.context;\n while (i < ii) {\n if (match) {\n // Already find a block of potentially optimizable items, iterating...\n const iterate = (0, match.iterateFn)(context, i);\n if (iterate) {\n i++;\n continue;\n }\n // Found last items for the block, processing...\n i = (0, match.processFn)(context, i + 1);\n ii = fnArray.length;\n match = null;\n state = null;\n if (i >= ii) {\n break;\n }\n }\n // Find the potentially optimizable items.\n state = (state || InitialState)[fnArray[i]];\n if (!state || Array.isArray(state)) {\n i++;\n continue;\n }\n // Found a start of the block based on addState rules.\n context.iCurr = i;\n i++;\n if (state.checkFn && !(0, state.checkFn)(context)) {\n // Check failed, continue search...\n state = null;\n continue;\n }\n match = state;\n state = null;\n }\n this.state = state;\n this.match = match;\n this.lastProcessed = i;\n }\n\n flush() {\n while (this.match) {\n const length = this.queue.fnArray.length;\n this.lastProcessed = (0, this.match.processFn)(this.context, length);\n this.match = null;\n this.state = null;\n // Repeat optimization until all chunks are exhausted.\n this._optimize();\n }\n }\n\n reset() {\n this.state = null;\n this.match = null;\n this.lastProcessed = 0;\n }\n}\n\nclass OperatorList {\n static CHUNK_SIZE = 1000;\n\n // Close to chunk size.\n static CHUNK_SIZE_ABOUT = this.CHUNK_SIZE - 5;\n\n constructor(intent = 0, streamSink) {\n this._streamSink = streamSink;\n this.fnArray = [];\n this.argsArray = [];\n this.optimizer =\n streamSink && !(intent & RenderingIntentFlag.OPLIST)\n ? new QueueOptimizer(this)\n : new NullOptimizer(this);\n this.dependencies = new Set();\n this._totalLength = 0;\n this.weight = 0;\n this._resolved = streamSink ? null : Promise.resolve();\n }\n\n // eslint-disable-next-line accessor-pairs\n set isOffscreenCanvasSupported(value) {\n this.optimizer.isOffscreenCanvasSupported = value;\n }\n\n get length() {\n return this.argsArray.length;\n }\n\n get ready() {\n return this._resolved || this._streamSink.ready;\n }\n\n /**\n * @type {number} The total length of the entire operator list, since\n * `this.length === 0` after flushing.\n */\n get totalLength() {\n return this._totalLength + this.length;\n }\n\n addOp(fn, args) {\n this.optimizer.push(fn, args);\n this.weight++;\n if (this._streamSink) {\n if (this.weight >= OperatorList.CHUNK_SIZE) {\n this.flush();\n } else if (\n this.weight >= OperatorList.CHUNK_SIZE_ABOUT &&\n (fn === OPS.restore || fn === OPS.endText)\n ) {\n // Heuristic to flush on boundary of restore or endText.\n this.flush();\n }\n }\n }\n\n addImageOps(fn, args, optionalContent) {\n if (optionalContent !== undefined) {\n this.addOp(OPS.beginMarkedContentProps, [\"OC\", optionalContent]);\n }\n\n this.addOp(fn, args);\n\n if (optionalContent !== undefined) {\n this.addOp(OPS.endMarkedContent, []);\n }\n }\n\n addDependency(dependency) {\n if (this.dependencies.has(dependency)) {\n return;\n }\n this.dependencies.add(dependency);\n this.addOp(OPS.dependency, [dependency]);\n }\n\n addDependencies(dependencies) {\n for (const dependency of dependencies) {\n this.addDependency(dependency);\n }\n }\n\n addOpList(opList) {\n if (!(opList instanceof OperatorList)) {\n warn('addOpList - ignoring invalid \"opList\" parameter.');\n return;\n }\n for (const dependency of opList.dependencies) {\n this.dependencies.add(dependency);\n }\n for (let i = 0, ii = opList.length; i < ii; i++) {\n this.addOp(opList.fnArray[i], opList.argsArray[i]);\n }\n }\n\n getIR() {\n return {\n fnArray: this.fnArray,\n argsArray: this.argsArray,\n length: this.length,\n };\n }\n\n get _transfers() {\n const transfers = [];\n const { fnArray, argsArray, length } = this;\n for (let i = 0; i < length; i++) {\n switch (fnArray[i]) {\n case OPS.paintInlineImageXObject:\n case OPS.paintInlineImageXObjectGroup:\n case OPS.paintImageMaskXObject:\n const arg = argsArray[i][0]; // First parameter in imgData.\n if (!arg.cached && arg.data?.buffer instanceof ArrayBuffer) {\n transfers.push(arg.data.buffer);\n }\n break;\n }\n }\n return transfers;\n }\n\n flush(lastChunk = false, separateAnnots = null) {\n this.optimizer.flush();\n const length = this.length;\n this._totalLength += length;\n\n this._streamSink.enqueue(\n {\n fnArray: this.fnArray,\n argsArray: this.argsArray,\n lastChunk,\n separateAnnots,\n length,\n },\n 1,\n this._transfers\n );\n\n this.dependencies.clear();\n this.fnArray.length = 0;\n this.argsArray.length = 0;\n this.weight = 0;\n this.optimizer.reset();\n }\n}\n\nexport { OperatorList };\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 FeatureTest,\n FormatError,\n ImageKind,\n info,\n warn,\n} from \"../shared/util.js\";\nimport {\n convertBlackAndWhiteToRGBA,\n convertToRGBA,\n} from \"../shared/image_utils.js\";\nimport { BaseStream } from \"./base_stream.js\";\nimport { ColorSpace } from \"./colorspace.js\";\nimport { DecodeStream } from \"./decode_stream.js\";\nimport { ImageResizer } from \"./image_resizer.js\";\nimport { JpegStream } from \"./jpeg_stream.js\";\nimport { JpxImage } from \"./jpx.js\";\nimport { Name } from \"./primitives.js\";\n\n/**\n * Decode and clamp a value. The formula is different from the spec because we\n * don't decode to float range [0,1], we decode it in the [0,max] range.\n */\nfunction decodeAndClamp(value, addend, coefficient, max) {\n value = addend + value * coefficient;\n // Clamp the value to the range\n if (value < 0) {\n value = 0;\n } else if (value > max) {\n value = max;\n }\n return value;\n}\n\n/**\n * Resizes an image mask with 1 component.\n * @param {TypedArray} src - The source buffer.\n * @param {number} bpc - Number of bits per component.\n * @param {number} w1 - Original width.\n * @param {number} h1 - Original height.\n * @param {number} w2 - New width.\n * @param {number} h2 - New height.\n * @returns {TypedArray} The resized image mask buffer.\n */\nfunction resizeImageMask(src, bpc, w1, h1, w2, h2) {\n const length = w2 * h2;\n let dest;\n if (bpc <= 8) {\n dest = new Uint8Array(length);\n } else if (bpc <= 16) {\n dest = new Uint16Array(length);\n } else {\n dest = new Uint32Array(length);\n }\n const xRatio = w1 / w2;\n const yRatio = h1 / h2;\n let i,\n j,\n py,\n newIndex = 0,\n oldIndex;\n const xScaled = new Uint16Array(w2);\n const w1Scanline = w1;\n\n for (i = 0; i < w2; i++) {\n xScaled[i] = Math.floor(i * xRatio);\n }\n for (i = 0; i < h2; i++) {\n py = Math.floor(i * yRatio) * w1Scanline;\n for (j = 0; j < w2; j++) {\n oldIndex = py + xScaled[j];\n dest[newIndex++] = src[oldIndex];\n }\n }\n return dest;\n}\n\nclass PDFImage {\n constructor({\n xref,\n res,\n image,\n isInline = false,\n smask = null,\n mask = null,\n isMask = false,\n pdfFunctionFactory,\n localColorSpaceCache,\n }) {\n this.image = image;\n const dict = image.dict;\n\n const filter = dict.get(\"F\", \"Filter\");\n let filterName;\n if (filter instanceof Name) {\n filterName = filter.name;\n } else if (Array.isArray(filter)) {\n const filterZero = xref.fetchIfRef(filter[0]);\n if (filterZero instanceof Name) {\n filterName = filterZero.name;\n }\n }\n switch (filterName) {\n case \"JPXDecode\":\n const jpxImage = new JpxImage();\n jpxImage.parseImageProperties(image.stream);\n image.stream.reset();\n\n image.width = jpxImage.width;\n image.height = jpxImage.height;\n image.bitsPerComponent = jpxImage.bitsPerComponent;\n image.numComps = jpxImage.componentsCount;\n break;\n case \"JBIG2Decode\":\n image.bitsPerComponent = 1;\n image.numComps = 1;\n break;\n }\n\n let width = dict.get(\"W\", \"Width\");\n let height = dict.get(\"H\", \"Height\");\n\n if (\n Number.isInteger(image.width) &&\n image.width > 0 &&\n Number.isInteger(image.height) &&\n image.height > 0 &&\n (image.width !== width || image.height !== height)\n ) {\n warn(\n \"PDFImage - using the Width/Height of the image data, \" +\n \"rather than the image dictionary.\"\n );\n width = image.width;\n height = image.height;\n }\n if (width < 1 || height < 1) {\n throw new FormatError(\n `Invalid image width: ${width} or height: ${height}`\n );\n }\n this.width = width;\n this.height = height;\n\n this.interpolate = dict.get(\"I\", \"Interpolate\");\n this.imageMask = dict.get(\"IM\", \"ImageMask\") || false;\n this.matte = dict.get(\"Matte\") || false;\n\n let bitsPerComponent = image.bitsPerComponent;\n if (!bitsPerComponent) {\n bitsPerComponent = dict.get(\"BPC\", \"BitsPerComponent\");\n if (!bitsPerComponent) {\n if (this.imageMask) {\n bitsPerComponent = 1;\n } else {\n throw new FormatError(\n `Bits per component missing in image: ${this.imageMask}`\n );\n }\n }\n }\n this.bpc = bitsPerComponent;\n\n if (!this.imageMask) {\n let colorSpace = dict.getRaw(\"CS\") || dict.getRaw(\"ColorSpace\");\n if (!colorSpace) {\n info(\"JPX images (which do not require color spaces)\");\n switch (image.numComps) {\n case 1:\n colorSpace = Name.get(\"DeviceGray\");\n break;\n case 3:\n colorSpace = Name.get(\"DeviceRGB\");\n break;\n case 4:\n colorSpace = Name.get(\"DeviceCMYK\");\n break;\n default:\n throw new Error(\n `JPX images with ${image.numComps} color components not supported.`\n );\n }\n }\n this.colorSpace = ColorSpace.parse({\n cs: colorSpace,\n xref,\n resources: isInline ? res : null,\n pdfFunctionFactory,\n localColorSpaceCache,\n });\n this.numComps = this.colorSpace.numComps;\n }\n\n this.decode = dict.getArray(\"D\", \"Decode\");\n this.needsDecode = false;\n if (\n this.decode &&\n ((this.colorSpace &&\n !this.colorSpace.isDefaultDecode(this.decode, bitsPerComponent)) ||\n (isMask &&\n !ColorSpace.isDefaultDecode(this.decode, /* numComps = */ 1)))\n ) {\n this.needsDecode = true;\n // Do some preprocessing to avoid more math.\n const max = (1 << bitsPerComponent) - 1;\n this.decodeCoefficients = [];\n this.decodeAddends = [];\n const isIndexed = this.colorSpace?.name === \"Indexed\";\n for (let i = 0, j = 0; i < this.decode.length; i += 2, ++j) {\n const dmin = this.decode[i];\n const dmax = this.decode[i + 1];\n this.decodeCoefficients[j] = isIndexed\n ? (dmax - dmin) / max\n : dmax - dmin;\n this.decodeAddends[j] = isIndexed ? dmin : max * dmin;\n }\n }\n\n if (smask) {\n this.smask = new PDFImage({\n xref,\n res,\n image: smask,\n isInline,\n pdfFunctionFactory,\n localColorSpaceCache,\n });\n } else if (mask) {\n if (mask instanceof BaseStream) {\n const maskDict = mask.dict,\n imageMask = maskDict.get(\"IM\", \"ImageMask\");\n if (!imageMask) {\n warn(\"Ignoring /Mask in image without /ImageMask.\");\n } else {\n this.mask = new PDFImage({\n xref,\n res,\n image: mask,\n isInline,\n isMask: true,\n pdfFunctionFactory,\n localColorSpaceCache,\n });\n }\n } else {\n // Color key mask (just an array).\n this.mask = mask;\n }\n }\n }\n\n /**\n * Handles processing of image data and returns the Promise that is resolved\n * with a PDFImage when the image is ready to be used.\n */\n static async buildImage({\n xref,\n res,\n image,\n isInline = false,\n pdfFunctionFactory,\n localColorSpaceCache,\n }) {\n const imageData = image;\n let smaskData = null;\n let maskData = null;\n\n const smask = image.dict.get(\"SMask\");\n const mask = image.dict.get(\"Mask\");\n\n if (smask) {\n if (smask instanceof BaseStream) {\n smaskData = smask;\n } else {\n warn(\"Unsupported /SMask format.\");\n }\n } else if (mask) {\n if (mask instanceof BaseStream || Array.isArray(mask)) {\n maskData = mask;\n } else {\n warn(\"Unsupported /Mask format.\");\n }\n }\n\n return new PDFImage({\n xref,\n res,\n image: imageData,\n isInline,\n smask: smaskData,\n mask: maskData,\n pdfFunctionFactory,\n localColorSpaceCache,\n });\n }\n\n static createRawMask({\n imgArray,\n width,\n height,\n imageIsFromDecodeStream,\n inverseDecode,\n interpolate,\n }) {\n // |imgArray| might not contain full data for every pixel of the mask, so\n // we need to distinguish between |computedLength| and |actualLength|.\n // In particular, if inverseDecode is true, then the array we return must\n // have a length of |computedLength|.\n\n const computedLength = ((width + 7) >> 3) * height;\n const actualLength = imgArray.byteLength;\n const haveFullData = computedLength === actualLength;\n let data, i;\n\n if (imageIsFromDecodeStream && (!inverseDecode || haveFullData)) {\n // imgArray came from a DecodeStream and its data is in an appropriate\n // form, so we can just transfer it.\n data = imgArray;\n } else if (!inverseDecode) {\n data = new Uint8Array(imgArray);\n } else {\n data = new Uint8Array(computedLength);\n data.set(imgArray);\n data.fill(0xff, actualLength);\n }\n\n // If necessary, invert the original mask data (but not any extra we might\n // have added above). It's safe to modify the array -- whether it's the\n // original or a copy, we're about to transfer it anyway, so nothing else\n // in this thread can be relying on its contents.\n if (inverseDecode) {\n for (i = 0; i < actualLength; i++) {\n data[i] ^= 0xff;\n }\n }\n\n return { data, width, height, interpolate };\n }\n\n static async createMask({\n imgArray,\n width,\n height,\n imageIsFromDecodeStream,\n inverseDecode,\n interpolate,\n isOffscreenCanvasSupported = false,\n }) {\n const isSingleOpaquePixel =\n width === 1 &&\n height === 1 &&\n inverseDecode === (imgArray.length === 0 || !!(imgArray[0] & 128));\n\n if (isSingleOpaquePixel) {\n return { isSingleOpaquePixel };\n }\n\n if (isOffscreenCanvasSupported) {\n if (ImageResizer.needsToBeResized(width, height)) {\n const data = new Uint8ClampedArray(width * height * 4);\n convertBlackAndWhiteToRGBA({\n src: imgArray,\n dest: data,\n width,\n height,\n nonBlackColor: 0,\n inverseDecode,\n });\n return ImageResizer.createImage({\n kind: ImageKind.RGBA_32BPP,\n data,\n width,\n height,\n interpolate,\n });\n }\n\n const canvas = new OffscreenCanvas(width, height);\n const ctx = canvas.getContext(\"2d\");\n const imgData = ctx.createImageData(width, height);\n convertBlackAndWhiteToRGBA({\n src: imgArray,\n dest: imgData.data,\n width,\n height,\n nonBlackColor: 0,\n inverseDecode,\n });\n\n ctx.putImageData(imgData, 0, 0);\n const bitmap = canvas.transferToImageBitmap();\n\n return {\n data: null,\n width,\n height,\n interpolate,\n bitmap,\n };\n }\n\n // Get the data almost as they're and they'll be decoded\n // just before being drawn.\n return this.createRawMask({\n imgArray,\n width,\n height,\n inverseDecode,\n imageIsFromDecodeStream,\n interpolate,\n });\n }\n\n get drawWidth() {\n return Math.max(this.width, this.smask?.width || 0, this.mask?.width || 0);\n }\n\n get drawHeight() {\n return Math.max(\n this.height,\n this.smask?.height || 0,\n this.mask?.height || 0\n );\n }\n\n decodeBuffer(buffer) {\n const bpc = this.bpc;\n const numComps = this.numComps;\n\n const decodeAddends = this.decodeAddends;\n const decodeCoefficients = this.decodeCoefficients;\n const max = (1 << bpc) - 1;\n let i, ii;\n\n if (bpc === 1) {\n // If the buffer needed decode that means it just needs to be inverted.\n for (i = 0, ii = buffer.length; i < ii; i++) {\n buffer[i] = +!buffer[i];\n }\n return;\n }\n let index = 0;\n for (i = 0, ii = this.width * this.height; i < ii; i++) {\n for (let j = 0; j < numComps; j++) {\n buffer[index] = decodeAndClamp(\n buffer[index],\n decodeAddends[j],\n decodeCoefficients[j],\n max\n );\n index++;\n }\n }\n }\n\n getComponents(buffer) {\n const bpc = this.bpc;\n\n // This image doesn't require any extra work.\n if (bpc === 8) {\n return buffer;\n }\n\n const width = this.width;\n const height = this.height;\n const numComps = this.numComps;\n\n const length = width * height * numComps;\n let bufferPos = 0;\n let output;\n if (bpc <= 8) {\n output = new Uint8Array(length);\n } else if (bpc <= 16) {\n output = new Uint16Array(length);\n } else {\n output = new Uint32Array(length);\n }\n const rowComps = width * numComps;\n\n const max = (1 << bpc) - 1;\n let i = 0,\n ii,\n buf;\n\n if (bpc === 1) {\n // Optimization for reading 1 bpc images.\n let mask, loop1End, loop2End;\n for (let j = 0; j < height; j++) {\n loop1End = i + (rowComps & ~7);\n loop2End = i + rowComps;\n\n // unroll loop for all full bytes\n while (i < loop1End) {\n buf = buffer[bufferPos++];\n output[i] = (buf >> 7) & 1;\n output[i + 1] = (buf >> 6) & 1;\n output[i + 2] = (buf >> 5) & 1;\n output[i + 3] = (buf >> 4) & 1;\n output[i + 4] = (buf >> 3) & 1;\n output[i + 5] = (buf >> 2) & 1;\n output[i + 6] = (buf >> 1) & 1;\n output[i + 7] = buf & 1;\n i += 8;\n }\n\n // handle remaining bits\n if (i < loop2End) {\n buf = buffer[bufferPos++];\n mask = 128;\n while (i < loop2End) {\n output[i++] = +!!(buf & mask);\n mask >>= 1;\n }\n }\n }\n } else {\n // The general case that handles all other bpc values.\n let bits = 0;\n buf = 0;\n for (i = 0, ii = length; i < ii; ++i) {\n if (i % rowComps === 0) {\n buf = 0;\n bits = 0;\n }\n\n while (bits < bpc) {\n buf = (buf << 8) | buffer[bufferPos++];\n bits += 8;\n }\n\n const remainingBits = bits - bpc;\n let value = buf >> remainingBits;\n if (value < 0) {\n value = 0;\n } else if (value > max) {\n value = max;\n }\n output[i] = value;\n buf &= (1 << remainingBits) - 1;\n bits = remainingBits;\n }\n }\n return output;\n }\n\n fillOpacity(rgbaBuf, width, height, actualHeight, image) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n rgbaBuf instanceof Uint8ClampedArray,\n 'PDFImage.fillOpacity: Unsupported \"rgbaBuf\" type.'\n );\n }\n const smask = this.smask;\n const mask = this.mask;\n let alphaBuf, sw, sh, i, ii, j;\n\n if (smask) {\n sw = smask.width;\n sh = smask.height;\n alphaBuf = new Uint8ClampedArray(sw * sh);\n smask.fillGrayBuffer(alphaBuf);\n if (sw !== width || sh !== height) {\n alphaBuf = resizeImageMask(alphaBuf, smask.bpc, sw, sh, width, height);\n }\n } else if (mask) {\n if (mask instanceof PDFImage) {\n sw = mask.width;\n sh = mask.height;\n alphaBuf = new Uint8ClampedArray(sw * sh);\n mask.numComps = 1;\n mask.fillGrayBuffer(alphaBuf);\n\n // Need to invert values in rgbaBuf\n for (i = 0, ii = sw * sh; i < ii; ++i) {\n alphaBuf[i] = 255 - alphaBuf[i];\n }\n\n if (sw !== width || sh !== height) {\n alphaBuf = resizeImageMask(alphaBuf, mask.bpc, sw, sh, width, height);\n }\n } else if (Array.isArray(mask)) {\n // Color key mask: if any of the components are outside the range\n // then they should be painted.\n alphaBuf = new Uint8ClampedArray(width * height);\n const numComps = this.numComps;\n for (i = 0, ii = width * height; i < ii; ++i) {\n let opacity = 0;\n const imageOffset = i * numComps;\n for (j = 0; j < numComps; ++j) {\n const color = image[imageOffset + j];\n const maskOffset = j * 2;\n if (color < mask[maskOffset] || color > mask[maskOffset + 1]) {\n opacity = 255;\n break;\n }\n }\n alphaBuf[i] = opacity;\n }\n } else {\n throw new FormatError(\"Unknown mask format.\");\n }\n }\n\n if (alphaBuf) {\n for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) {\n rgbaBuf[j] = alphaBuf[i];\n }\n } else {\n // No mask.\n for (i = 0, j = 3, ii = width * actualHeight; i < ii; ++i, j += 4) {\n rgbaBuf[j] = 255;\n }\n }\n }\n\n undoPreblend(buffer, width, height) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n buffer instanceof Uint8ClampedArray,\n 'PDFImage.undoPreblend: Unsupported \"buffer\" type.'\n );\n }\n const matte = this.smask?.matte;\n if (!matte) {\n return;\n }\n const matteRgb = this.colorSpace.getRgb(matte, 0);\n const matteR = matteRgb[0];\n const matteG = matteRgb[1];\n const matteB = matteRgb[2];\n const length = width * height * 4;\n for (let i = 0; i < length; i += 4) {\n const alpha = buffer[i + 3];\n if (alpha === 0) {\n // according formula we have to get Infinity in all components\n // making it white (typical paper color) should be okay\n buffer[i] = 255;\n buffer[i + 1] = 255;\n buffer[i + 2] = 255;\n continue;\n }\n const k = 255 / alpha;\n buffer[i] = (buffer[i] - matteR) * k + matteR;\n buffer[i + 1] = (buffer[i + 1] - matteG) * k + matteG;\n buffer[i + 2] = (buffer[i + 2] - matteB) * k + matteB;\n }\n }\n\n async createImageData(forceRGBA = false, isOffscreenCanvasSupported = false) {\n const drawWidth = this.drawWidth;\n const drawHeight = this.drawHeight;\n const imgData = {\n width: drawWidth,\n height: drawHeight,\n interpolate: this.interpolate,\n kind: 0,\n data: null,\n // Other fields are filled in below.\n };\n\n const numComps = this.numComps;\n const originalWidth = this.width;\n const originalHeight = this.height;\n const bpc = this.bpc;\n\n // Rows start at byte boundary.\n const rowBytes = (originalWidth * numComps * bpc + 7) >> 3;\n const mustBeResized =\n isOffscreenCanvasSupported &&\n ImageResizer.needsToBeResized(drawWidth, drawHeight);\n\n if (!forceRGBA) {\n // If it is a 1-bit-per-pixel grayscale (i.e. black-and-white) image\n // without any complications, we pass a same-sized copy to the main\n // thread rather than expanding by 32x to RGBA form. This saves *lots*\n // of memory for many scanned documents. It's also much faster.\n //\n // Similarly, if it is a 24-bit-per pixel RGB image without any\n // complications, we avoid expanding by 1.333x to RGBA form.\n let kind;\n if (this.colorSpace.name === \"DeviceGray\" && bpc === 1) {\n kind = ImageKind.GRAYSCALE_1BPP;\n } else if (\n this.colorSpace.name === \"DeviceRGB\" &&\n bpc === 8 &&\n !this.needsDecode\n ) {\n kind = ImageKind.RGB_24BPP;\n }\n if (\n kind &&\n !this.smask &&\n !this.mask &&\n drawWidth === originalWidth &&\n drawHeight === originalHeight\n ) {\n const data = this.getImageBytes(originalHeight * rowBytes, {});\n if (isOffscreenCanvasSupported) {\n if (mustBeResized) {\n return ImageResizer.createImage(\n {\n data,\n kind,\n width: drawWidth,\n height: drawHeight,\n interpolate: this.interpolate,\n },\n this.needsDecode\n );\n }\n return this.createBitmap(kind, originalWidth, originalHeight, data);\n }\n imgData.kind = kind;\n imgData.data = data;\n\n if (this.needsDecode) {\n // Invert the buffer (which must be grayscale if we reached here).\n assert(\n kind === ImageKind.GRAYSCALE_1BPP,\n \"PDFImage.createImageData: The image must be grayscale.\"\n );\n const buffer = imgData.data;\n for (let i = 0, ii = buffer.length; i < ii; i++) {\n buffer[i] ^= 0xff;\n }\n }\n return imgData;\n }\n if (\n this.image instanceof JpegStream &&\n !this.smask &&\n !this.mask &&\n !this.needsDecode\n ) {\n let imageLength = originalHeight * rowBytes;\n if (isOffscreenCanvasSupported && !mustBeResized) {\n let isHandled = false;\n switch (this.colorSpace.name) {\n case \"DeviceGray\":\n // Avoid truncating the image, since `JpegImage.getData`\n // will expand the image data when `forceRGB === true`.\n imageLength *= 4;\n isHandled = true;\n break;\n case \"DeviceRGB\":\n imageLength = (imageLength / 3) * 4;\n isHandled = true;\n break;\n case \"DeviceCMYK\":\n isHandled = true;\n break;\n }\n\n if (isHandled) {\n const rgba = this.getImageBytes(imageLength, {\n drawWidth,\n drawHeight,\n forceRGBA: true,\n });\n return this.createBitmap(\n ImageKind.RGBA_32BPP,\n drawWidth,\n drawHeight,\n rgba\n );\n }\n } else {\n switch (this.colorSpace.name) {\n case \"DeviceGray\":\n imageLength *= 3;\n /* falls through */\n case \"DeviceRGB\":\n case \"DeviceCMYK\":\n imgData.kind = ImageKind.RGB_24BPP;\n imgData.data = this.getImageBytes(imageLength, {\n drawWidth,\n drawHeight,\n forceRGB: true,\n });\n if (mustBeResized) {\n // The image is too big so we resize it.\n return ImageResizer.createImage(imgData);\n }\n return imgData;\n }\n }\n }\n }\n\n const imgArray = this.getImageBytes(originalHeight * rowBytes, {\n internal: true,\n });\n // imgArray can be incomplete (e.g. after CCITT fax encoding).\n const actualHeight =\n 0 | (((imgArray.length / rowBytes) * drawHeight) / originalHeight);\n\n const comps = this.getComponents(imgArray);\n\n // If opacity data is present, use RGBA_32BPP form. Otherwise, use the\n // more compact RGB_24BPP form if allowable.\n let alpha01, maybeUndoPreblend;\n\n let canvas, ctx, canvasImgData, data;\n if (isOffscreenCanvasSupported && !mustBeResized) {\n canvas = new OffscreenCanvas(drawWidth, drawHeight);\n ctx = canvas.getContext(\"2d\");\n canvasImgData = ctx.createImageData(drawWidth, drawHeight);\n data = canvasImgData.data;\n }\n\n imgData.kind = ImageKind.RGBA_32BPP;\n\n if (!forceRGBA && !this.smask && !this.mask) {\n if (!isOffscreenCanvasSupported || mustBeResized) {\n imgData.kind = ImageKind.RGB_24BPP;\n data = new Uint8ClampedArray(drawWidth * drawHeight * 3);\n alpha01 = 0;\n } else {\n const arr = new Uint32Array(data.buffer);\n arr.fill(FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff);\n alpha01 = 1;\n }\n maybeUndoPreblend = false;\n } else {\n if (!isOffscreenCanvasSupported || mustBeResized) {\n data = new Uint8ClampedArray(drawWidth * drawHeight * 4);\n }\n\n alpha01 = 1;\n maybeUndoPreblend = true;\n\n // Color key masking (opacity) must be performed before decoding.\n this.fillOpacity(data, drawWidth, drawHeight, actualHeight, comps);\n }\n\n if (this.needsDecode) {\n this.decodeBuffer(comps);\n }\n this.colorSpace.fillRgb(\n data,\n originalWidth,\n originalHeight,\n drawWidth,\n drawHeight,\n actualHeight,\n bpc,\n comps,\n alpha01\n );\n if (maybeUndoPreblend) {\n this.undoPreblend(data, drawWidth, actualHeight);\n }\n\n if (isOffscreenCanvasSupported && !mustBeResized) {\n ctx.putImageData(canvasImgData, 0, 0);\n const bitmap = canvas.transferToImageBitmap();\n\n return {\n data: null,\n width: drawWidth,\n height: drawHeight,\n bitmap,\n interpolate: this.interpolate,\n };\n }\n\n imgData.data = data;\n if (mustBeResized) {\n return ImageResizer.createImage(imgData);\n }\n return imgData;\n }\n\n fillGrayBuffer(buffer) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n buffer instanceof Uint8ClampedArray,\n 'PDFImage.fillGrayBuffer: Unsupported \"buffer\" type.'\n );\n }\n const numComps = this.numComps;\n if (numComps !== 1) {\n throw new FormatError(\n `Reading gray scale from a color image: ${numComps}`\n );\n }\n\n const width = this.width;\n const height = this.height;\n const bpc = this.bpc;\n\n // rows start at byte boundary\n const rowBytes = (width * numComps * bpc + 7) >> 3;\n const imgArray = this.getImageBytes(height * rowBytes, { internal: true });\n\n const comps = this.getComponents(imgArray);\n let i, length;\n\n if (bpc === 1) {\n // inline decoding (= inversion) for 1 bpc images\n length = width * height;\n if (this.needsDecode) {\n // invert and scale to {0, 255}\n for (i = 0; i < length; ++i) {\n buffer[i] = (comps[i] - 1) & 255;\n }\n } else {\n // scale to {0, 255}\n for (i = 0; i < length; ++i) {\n buffer[i] = -comps[i] & 255;\n }\n }\n return;\n }\n\n if (this.needsDecode) {\n this.decodeBuffer(comps);\n }\n length = width * height;\n // we aren't using a colorspace so we need to scale the value\n const scale = 255 / ((1 << bpc) - 1);\n for (i = 0; i < length; ++i) {\n buffer[i] = scale * comps[i];\n }\n }\n\n createBitmap(kind, width, height, src) {\n const canvas = new OffscreenCanvas(width, height);\n const ctx = canvas.getContext(\"2d\");\n let imgData;\n if (kind === ImageKind.RGBA_32BPP) {\n imgData = new ImageData(src, width, height);\n } else {\n imgData = ctx.createImageData(width, height);\n convertToRGBA({\n kind,\n src,\n dest: new Uint32Array(imgData.data.buffer),\n width,\n height,\n inverseDecode: this.needsDecode,\n });\n }\n ctx.putImageData(imgData, 0, 0);\n const bitmap = canvas.transferToImageBitmap();\n\n return {\n data: null,\n width,\n height,\n bitmap,\n interpolate: this.interpolate,\n };\n }\n\n getImageBytes(\n length,\n {\n drawWidth,\n drawHeight,\n forceRGBA = false,\n forceRGB = false,\n internal = false,\n }\n ) {\n this.image.reset();\n this.image.drawWidth = drawWidth || this.width;\n this.image.drawHeight = drawHeight || this.height;\n this.image.forceRGBA = !!forceRGBA;\n this.image.forceRGB = !!forceRGB;\n const imageBytes = this.image.getBytes(length);\n\n // If imageBytes came from a DecodeStream, we're safe to transfer it\n // (and thus detach its underlying buffer) because it will constitute\n // the entire DecodeStream's data. But if it came from a Stream, we\n // need to copy it because it'll only be a portion of the Stream's\n // data, and the rest will be read later on.\n if (internal || this.image instanceof DecodeStream) {\n return imageBytes;\n }\n assert(\n imageBytes instanceof Uint8Array,\n 'PDFImage.getImageBytes: Unsupported \"imageBytes\" type.'\n );\n return new Uint8Array(imageBytes);\n }\n}\n\nexport { PDFImage };\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/* eslint-disable no-var */\n\nimport {\n AbortException,\n assert,\n CMapCompressionType,\n FONT_IDENTITY_MATRIX,\n FormatError,\n IDENTITY_MATRIX,\n info,\n isArrayEqual,\n normalizeUnicode,\n OPS,\n PromiseCapability,\n shadow,\n stringToPDFString,\n TextRenderingMode,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport { CMapFactory, IdentityCMap } from \"./cmap.js\";\nimport { Cmd, Dict, EOF, isName, Name, Ref, RefSet } from \"./primitives.js\";\nimport { ErrorFont, Font } from \"./fonts.js\";\nimport {\n getEncoding,\n MacRomanEncoding,\n StandardEncoding,\n SymbolSetEncoding,\n WinAnsiEncoding,\n ZapfDingbatsEncoding,\n} from \"./encodings.js\";\nimport {\n getFontNameToFileMap,\n getSerifFonts,\n getStandardFontName,\n getStdFontMap,\n getSymbolsFonts,\n isKnownFontName,\n} from \"./standard_fonts.js\";\nimport { getTilingPatternIR, Pattern } from \"./pattern.js\";\nimport { getXfaFontDict, getXfaFontName } from \"./xfa_fonts.js\";\nimport { IdentityToUnicodeMap, ToUnicodeMap } from \"./to_unicode_map.js\";\nimport { isPDFFunction, PDFFunctionFactory } from \"./function.js\";\nimport { Lexer, Parser } from \"./parser.js\";\nimport {\n LocalColorSpaceCache,\n LocalGStateCache,\n LocalImageCache,\n LocalTilingPatternCache,\n RegionalImageCache,\n} from \"./image_utils.js\";\nimport { NullStream, Stream } from \"./stream.js\";\nimport { BaseStream } from \"./base_stream.js\";\nimport { bidi } from \"./bidi.js\";\nimport { ColorSpace } from \"./colorspace.js\";\nimport { DecodeStream } from \"./decode_stream.js\";\nimport { FontFlags } from \"./fonts_utils.js\";\nimport { getFontSubstitution } from \"./font_substitutions.js\";\nimport { getGlyphsUnicode } from \"./glyphlist.js\";\nimport { getMetrics } from \"./metrics.js\";\nimport { getUnicodeForGlyph } from \"./unicode.js\";\nimport { ImageResizer } from \"./image_resizer.js\";\nimport { MurmurHash3_64 } from \"../shared/murmurhash3.js\";\nimport { OperatorList } from \"./operator_list.js\";\nimport { PDFImage } from \"./image.js\";\n\nconst DefaultPartialEvaluatorOptions = Object.freeze({\n maxImageSize: -1,\n disableFontFace: false,\n ignoreErrors: false,\n isEvalSupported: true,\n isOffscreenCanvasSupported: false,\n canvasMaxAreaInBytes: -1,\n fontExtraProperties: false,\n useSystemFonts: true,\n cMapUrl: null,\n standardFontDataUrl: null,\n});\n\nconst PatternType = {\n TILING: 1,\n SHADING: 2,\n};\n\n// Optionally avoid sending individual, or very few, text chunks to reduce\n// `postMessage` overhead with ReadableStream (see issue 13962).\n//\n// PLEASE NOTE: This value should *not* be too large (it's used as a lower limit\n// in `enqueueChunk`), since that would cause streaming of textContent to become\n// essentially useless in practice by sending all (or most) chunks at once.\n// Also, a too large value would (indirectly) affect the main-thread `textLayer`\n// building negatively by forcing all textContent to be handled at once, which\n// could easily end up hurting *overall* performance (e.g. rendering as well).\nconst TEXT_CHUNK_BATCH_SIZE = 10;\n\nconst deferred = Promise.resolve();\n\n// Convert PDF blend mode names to HTML5 blend mode names.\nfunction normalizeBlendMode(value, parsingArray = false) {\n if (Array.isArray(value)) {\n // Use the first *supported* BM value in the Array (fixes issue11279.pdf).\n for (const val of value) {\n const maybeBM = normalizeBlendMode(val, /* parsingArray = */ true);\n if (maybeBM) {\n return maybeBM;\n }\n }\n warn(`Unsupported blend mode Array: ${value}`);\n return \"source-over\";\n }\n\n if (!(value instanceof Name)) {\n if (parsingArray) {\n return null;\n }\n return \"source-over\";\n }\n switch (value.name) {\n case \"Normal\":\n case \"Compatible\":\n return \"source-over\";\n case \"Multiply\":\n return \"multiply\";\n case \"Screen\":\n return \"screen\";\n case \"Overlay\":\n return \"overlay\";\n case \"Darken\":\n return \"darken\";\n case \"Lighten\":\n return \"lighten\";\n case \"ColorDodge\":\n return \"color-dodge\";\n case \"ColorBurn\":\n return \"color-burn\";\n case \"HardLight\":\n return \"hard-light\";\n case \"SoftLight\":\n return \"soft-light\";\n case \"Difference\":\n return \"difference\";\n case \"Exclusion\":\n return \"exclusion\";\n case \"Hue\":\n return \"hue\";\n case \"Saturation\":\n return \"saturation\";\n case \"Color\":\n return \"color\";\n case \"Luminosity\":\n return \"luminosity\";\n }\n if (parsingArray) {\n return null;\n }\n warn(`Unsupported blend mode: ${value.name}`);\n return \"source-over\";\n}\n\nfunction incrementCachedImageMaskCount(data) {\n if (data.fn === OPS.paintImageMaskXObject && data.args[0]?.count > 0) {\n data.args[0].count++;\n }\n}\n\n// Trying to minimize Date.now() usage and check every 100 time.\nclass TimeSlotManager {\n static TIME_SLOT_DURATION_MS = 20;\n\n static CHECK_TIME_EVERY = 100;\n\n constructor() {\n this.reset();\n }\n\n check() {\n if (++this.checked < TimeSlotManager.CHECK_TIME_EVERY) {\n return false;\n }\n this.checked = 0;\n return this.endTime <= Date.now();\n }\n\n reset() {\n this.endTime = Date.now() + TimeSlotManager.TIME_SLOT_DURATION_MS;\n this.checked = 0;\n }\n}\n\nclass PartialEvaluator {\n constructor({\n xref,\n handler,\n pageIndex,\n idFactory,\n fontCache,\n builtInCMapCache,\n standardFontDataCache,\n globalImageCache,\n systemFontCache,\n options = null,\n }) {\n this.xref = xref;\n this.handler = handler;\n this.pageIndex = pageIndex;\n this.idFactory = idFactory;\n this.fontCache = fontCache;\n this.builtInCMapCache = builtInCMapCache;\n this.standardFontDataCache = standardFontDataCache;\n this.globalImageCache = globalImageCache;\n this.systemFontCache = systemFontCache;\n this.options = options || DefaultPartialEvaluatorOptions;\n this.parsingType3Font = false;\n\n this._regionalImageCache = new RegionalImageCache();\n this._fetchBuiltInCMapBound = this.fetchBuiltInCMap.bind(this);\n ImageResizer.setMaxArea(this.options.canvasMaxAreaInBytes);\n }\n\n /**\n * Since Functions are only cached (locally) by reference, we can share one\n * `PDFFunctionFactory` instance within this `PartialEvaluator` instance.\n */\n get _pdfFunctionFactory() {\n const pdfFunctionFactory = new PDFFunctionFactory({\n xref: this.xref,\n isEvalSupported: this.options.isEvalSupported,\n });\n return shadow(this, \"_pdfFunctionFactory\", pdfFunctionFactory);\n }\n\n clone(newOptions = null) {\n const newEvaluator = Object.create(this);\n newEvaluator.options = Object.assign(\n Object.create(null),\n this.options,\n newOptions\n );\n return newEvaluator;\n }\n\n hasBlendModes(resources, nonBlendModesSet) {\n if (!(resources instanceof Dict)) {\n return false;\n }\n if (resources.objId && nonBlendModesSet.has(resources.objId)) {\n return false;\n }\n\n const processed = new RefSet(nonBlendModesSet);\n if (resources.objId) {\n processed.put(resources.objId);\n }\n\n const nodes = [resources],\n xref = this.xref;\n while (nodes.length) {\n const node = nodes.shift();\n // First check the current resources for blend modes.\n const graphicStates = node.get(\"ExtGState\");\n if (graphicStates instanceof Dict) {\n for (let graphicState of graphicStates.getRawValues()) {\n if (graphicState instanceof Ref) {\n if (processed.has(graphicState)) {\n continue; // The ExtGState has already been processed.\n }\n try {\n graphicState = xref.fetch(graphicState);\n } catch (ex) {\n // Avoid parsing a corrupt ExtGState more than once.\n processed.put(graphicState);\n\n info(`hasBlendModes - ignoring ExtGState: \"${ex}\".`);\n continue;\n }\n }\n if (!(graphicState instanceof Dict)) {\n continue;\n }\n if (graphicState.objId) {\n processed.put(graphicState.objId);\n }\n\n const bm = graphicState.get(\"BM\");\n if (bm instanceof Name) {\n if (bm.name !== \"Normal\") {\n return true;\n }\n continue;\n }\n if (bm !== undefined && Array.isArray(bm)) {\n for (const element of bm) {\n if (element instanceof Name && element.name !== \"Normal\") {\n return true;\n }\n }\n }\n }\n }\n // Descend into the XObjects to look for more resources and blend modes.\n const xObjects = node.get(\"XObject\");\n if (!(xObjects instanceof Dict)) {\n continue;\n }\n for (let xObject of xObjects.getRawValues()) {\n if (xObject instanceof Ref) {\n if (processed.has(xObject)) {\n // The XObject has already been processed, and by avoiding a\n // redundant `xref.fetch` we can *significantly* reduce the load\n // time for badly generated PDF files (fixes issue6961.pdf).\n continue;\n }\n try {\n xObject = xref.fetch(xObject);\n } catch (ex) {\n // Avoid parsing a corrupt XObject more than once.\n processed.put(xObject);\n\n info(`hasBlendModes - ignoring XObject: \"${ex}\".`);\n continue;\n }\n }\n if (!(xObject instanceof BaseStream)) {\n continue;\n }\n if (xObject.dict.objId) {\n processed.put(xObject.dict.objId);\n }\n const xResources = xObject.dict.get(\"Resources\");\n if (!(xResources instanceof Dict)) {\n continue;\n }\n // Checking objId to detect an infinite loop.\n if (xResources.objId && processed.has(xResources.objId)) {\n continue;\n }\n\n nodes.push(xResources);\n if (xResources.objId) {\n processed.put(xResources.objId);\n }\n }\n }\n\n // When no blend modes exist, there's no need re-fetch/re-parse any of the\n // processed `Ref`s again for subsequent pages. This helps reduce redundant\n // `XRef.fetch` calls for some documents (e.g. issue6961.pdf).\n for (const ref of processed) {\n nonBlendModesSet.put(ref);\n }\n return false;\n }\n\n async fetchBuiltInCMap(name) {\n const cachedData = this.builtInCMapCache.get(name);\n if (cachedData) {\n return cachedData;\n }\n let data;\n\n if (this.options.cMapUrl !== null) {\n // Only compressed CMaps are (currently) supported here.\n const url = `${this.options.cMapUrl}${name}.bcmap`;\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(\n `fetchBuiltInCMap: failed to fetch file \"${url}\" with \"${response.statusText}\".`\n );\n }\n data = {\n cMapData: new Uint8Array(await response.arrayBuffer()),\n compressionType: CMapCompressionType.BINARY,\n };\n } else {\n // Get the data on the main-thread instead.\n data = await this.handler.sendWithPromise(\"FetchBuiltInCMap\", { name });\n }\n\n if (data.compressionType !== CMapCompressionType.NONE) {\n // Given the size of uncompressed CMaps, only cache compressed ones.\n this.builtInCMapCache.set(name, data);\n }\n return data;\n }\n\n async fetchStandardFontData(name) {\n const cachedData = this.standardFontDataCache.get(name);\n if (cachedData) {\n return new Stream(cachedData);\n }\n\n // The symbol fonts are not consistent across platforms, always load the\n // standard font data for them.\n if (\n this.options.useSystemFonts &&\n name !== \"Symbol\" &&\n name !== \"ZapfDingbats\"\n ) {\n return null;\n }\n\n const standardFontNameToFileName = getFontNameToFileMap(),\n filename = standardFontNameToFileName[name];\n let data;\n\n if (this.options.standardFontDataUrl !== null) {\n const url = `${this.options.standardFontDataUrl}${filename}`;\n const response = await fetch(url);\n if (!response.ok) {\n warn(\n `fetchStandardFontData: failed to fetch file \"${url}\" with \"${response.statusText}\".`\n );\n } else {\n data = new Uint8Array(await response.arrayBuffer());\n }\n } else {\n // Get the data on the main-thread instead.\n try {\n data = await this.handler.sendWithPromise(\"FetchStandardFontData\", {\n filename,\n });\n } catch (e) {\n warn(\n `fetchStandardFontData: failed to fetch file \"${filename}\" with \"${e}\".`\n );\n }\n }\n\n if (!data) {\n return null;\n }\n // Cache the \"raw\" standard font data, to avoid fetching it repeatedly\n // (see e.g. issue 11399).\n this.standardFontDataCache.set(name, data);\n\n return new Stream(data);\n }\n\n async buildFormXObject(\n resources,\n xobj,\n smask,\n operatorList,\n task,\n initialState,\n localColorSpaceCache\n ) {\n const dict = xobj.dict;\n const matrix = dict.getArray(\"Matrix\");\n let bbox = dict.getArray(\"BBox\");\n bbox =\n Array.isArray(bbox) && bbox.length === 4\n ? Util.normalizeRect(bbox)\n : null;\n\n let optionalContent, groupOptions;\n if (dict.has(\"OC\")) {\n optionalContent = await this.parseMarkedContentProps(\n dict.get(\"OC\"),\n resources\n );\n }\n if (optionalContent !== undefined) {\n operatorList.addOp(OPS.beginMarkedContentProps, [\"OC\", optionalContent]);\n }\n const group = dict.get(\"Group\");\n if (group) {\n groupOptions = {\n matrix,\n bbox,\n smask,\n isolated: false,\n knockout: false,\n };\n\n const groupSubtype = group.get(\"S\");\n let colorSpace = null;\n if (isName(groupSubtype, \"Transparency\")) {\n groupOptions.isolated = group.get(\"I\") || false;\n groupOptions.knockout = group.get(\"K\") || false;\n if (group.has(\"CS\")) {\n const cs = group.getRaw(\"CS\");\n\n const cachedColorSpace = ColorSpace.getCached(\n cs,\n this.xref,\n localColorSpaceCache\n );\n if (cachedColorSpace) {\n colorSpace = cachedColorSpace;\n } else {\n colorSpace = await this.parseColorSpace({\n cs,\n resources,\n localColorSpaceCache,\n });\n }\n }\n }\n\n if (smask?.backdrop) {\n colorSpace ||= ColorSpace.singletons.rgb;\n smask.backdrop = colorSpace.getRgb(smask.backdrop, 0);\n }\n\n operatorList.addOp(OPS.beginGroup, [groupOptions]);\n }\n\n // If it's a group, a new canvas will be created that is the size of the\n // bounding box and translated to the correct position so we don't need to\n // apply the bounding box to it.\n const args = group ? [matrix, null] : [matrix, bbox];\n operatorList.addOp(OPS.paintFormXObjectBegin, args);\n\n return this.getOperatorList({\n stream: xobj,\n task,\n resources: dict.get(\"Resources\") || resources,\n operatorList,\n initialState,\n }).then(function () {\n operatorList.addOp(OPS.paintFormXObjectEnd, []);\n\n if (group) {\n operatorList.addOp(OPS.endGroup, [groupOptions]);\n }\n\n if (optionalContent !== undefined) {\n operatorList.addOp(OPS.endMarkedContent, []);\n }\n });\n }\n\n _sendImgData(objId, imgData, cacheGlobally = false) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n imgData\n ) {\n assert(Number.isInteger(imgData.dataLen), \"Expected dataLen to be set.\");\n }\n const transfers = imgData ? [imgData.bitmap || imgData.data.buffer] : null;\n\n if (this.parsingType3Font || cacheGlobally) {\n return this.handler.send(\n \"commonobj\",\n [objId, \"Image\", imgData],\n transfers\n );\n }\n return this.handler.send(\n \"obj\",\n [objId, this.pageIndex, \"Image\", imgData],\n transfers\n );\n }\n\n async buildPaintImageXObject({\n resources,\n image,\n isInline = false,\n operatorList,\n cacheKey,\n localImageCache,\n localColorSpaceCache,\n }) {\n const dict = image.dict;\n const imageRef = dict.objId;\n const w = dict.get(\"W\", \"Width\");\n const h = dict.get(\"H\", \"Height\");\n\n if (!(w && typeof w === \"number\") || !(h && typeof h === \"number\")) {\n warn(\"Image dimensions are missing, or not numbers.\");\n return;\n }\n const maxImageSize = this.options.maxImageSize;\n if (maxImageSize !== -1 && w * h > maxImageSize) {\n const msg = \"Image exceeded maximum allowed size and was removed.\";\n\n if (this.options.ignoreErrors) {\n warn(msg);\n return;\n }\n throw new Error(msg);\n }\n\n let optionalContent;\n if (dict.has(\"OC\")) {\n optionalContent = await this.parseMarkedContentProps(\n dict.get(\"OC\"),\n resources\n );\n }\n\n const imageMask = dict.get(\"IM\", \"ImageMask\") || false;\n let imgData, args;\n if (imageMask) {\n // This depends on a tmpCanvas being filled with the\n // current fillStyle, such that processing the pixel\n // data can't be done here. Instead of creating a\n // complete PDFImage, only read the information needed\n // for later.\n const interpolate = dict.get(\"I\", \"Interpolate\");\n const bitStrideLength = (w + 7) >> 3;\n const imgArray = image.getBytes(bitStrideLength * h);\n const decode = dict.getArray(\"D\", \"Decode\");\n\n if (this.parsingType3Font) {\n imgData = PDFImage.createRawMask({\n imgArray,\n width: w,\n height: h,\n imageIsFromDecodeStream: image instanceof DecodeStream,\n inverseDecode: decode?.[0] > 0,\n interpolate,\n });\n\n imgData.cached = !!cacheKey;\n args = [imgData];\n\n operatorList.addImageOps(\n OPS.paintImageMaskXObject,\n args,\n optionalContent\n );\n\n if (cacheKey) {\n const cacheData = {\n fn: OPS.paintImageMaskXObject,\n args,\n optionalContent,\n };\n localImageCache.set(cacheKey, imageRef, cacheData);\n\n if (imageRef) {\n this._regionalImageCache.set(\n /* name = */ null,\n imageRef,\n cacheData\n );\n }\n }\n return;\n }\n\n imgData = await PDFImage.createMask({\n imgArray,\n width: w,\n height: h,\n imageIsFromDecodeStream: image instanceof DecodeStream,\n inverseDecode: decode?.[0] > 0,\n interpolate,\n isOffscreenCanvasSupported: this.options.isOffscreenCanvasSupported,\n });\n\n if (imgData.isSingleOpaquePixel) {\n // Handles special case of mainly LaTeX documents which use image\n // masks to draw lines with the current fill style.\n operatorList.addImageOps(\n OPS.paintSolidColorImageMask,\n [],\n optionalContent\n );\n\n if (cacheKey) {\n const cacheData = {\n fn: OPS.paintSolidColorImageMask,\n args: [],\n optionalContent,\n };\n localImageCache.set(cacheKey, imageRef, cacheData);\n\n if (imageRef) {\n this._regionalImageCache.set(\n /* name = */ null,\n imageRef,\n cacheData\n );\n }\n }\n return;\n }\n\n const objId = `mask_${this.idFactory.createObjId()}`;\n operatorList.addDependency(objId);\n\n imgData.dataLen = imgData.bitmap\n ? imgData.width * imgData.height * 4\n : imgData.data.length;\n this._sendImgData(objId, imgData);\n\n args = [\n {\n data: objId,\n width: imgData.width,\n height: imgData.height,\n interpolate: imgData.interpolate,\n count: 1,\n },\n ];\n operatorList.addImageOps(\n OPS.paintImageMaskXObject,\n args,\n optionalContent\n );\n\n if (cacheKey) {\n const cacheData = {\n fn: OPS.paintImageMaskXObject,\n args,\n optionalContent,\n };\n localImageCache.set(cacheKey, imageRef, cacheData);\n\n if (imageRef) {\n this._regionalImageCache.set(/* name = */ null, imageRef, cacheData);\n }\n }\n return;\n }\n\n const SMALL_IMAGE_DIMENSIONS = 200;\n // Inlining small images into the queue as RGB data\n if (\n isInline &&\n !dict.has(\"SMask\") &&\n !dict.has(\"Mask\") &&\n w + h < SMALL_IMAGE_DIMENSIONS\n ) {\n const imageObj = new PDFImage({\n xref: this.xref,\n res: resources,\n image,\n isInline,\n pdfFunctionFactory: this._pdfFunctionFactory,\n localColorSpaceCache,\n });\n // We force the use of RGBA_32BPP images here, because we can't handle\n // any other kind.\n imgData = await imageObj.createImageData(\n /* forceRGBA = */ true,\n /* isOffscreenCanvasSupported = */ false\n );\n operatorList.isOffscreenCanvasSupported =\n this.options.isOffscreenCanvasSupported;\n operatorList.addImageOps(\n OPS.paintInlineImageXObject,\n [imgData],\n optionalContent\n );\n return;\n }\n\n // If there is no imageMask, create the PDFImage and a lot\n // of image processing can be done here.\n let objId = `img_${this.idFactory.createObjId()}`,\n cacheGlobally = false;\n\n if (this.parsingType3Font) {\n objId = `${this.idFactory.getDocId()}_type3_${objId}`;\n } else if (cacheKey && imageRef) {\n cacheGlobally = this.globalImageCache.shouldCache(\n imageRef,\n this.pageIndex\n );\n\n if (cacheGlobally) {\n assert(!isInline, \"Cannot cache an inline image globally.\");\n\n objId = `${this.idFactory.getDocId()}_${objId}`;\n }\n }\n\n // Ensure that the dependency is added before the image is decoded.\n operatorList.addDependency(objId);\n args = [objId, w, h];\n operatorList.addImageOps(OPS.paintImageXObject, args, optionalContent);\n\n // For large images, at least 500x500 in size, that we'll cache globally\n // check if the image is still cached locally on the main-thread to avoid\n // having to re-parse the image (since that can be slow).\n if (cacheGlobally && w * h > 250000) {\n const localLength = await this.handler.sendWithPromise(\"commonobj\", [\n objId,\n \"CopyLocalImage\",\n { imageRef },\n ]);\n\n if (localLength) {\n this.globalImageCache.setData(imageRef, {\n objId,\n fn: OPS.paintImageXObject,\n args,\n optionalContent,\n byteSize: 0, // Temporary entry, to avoid `setData` returning early.\n });\n this.globalImageCache.addByteSize(imageRef, localLength);\n return;\n }\n }\n\n PDFImage.buildImage({\n xref: this.xref,\n res: resources,\n image,\n isInline,\n pdfFunctionFactory: this._pdfFunctionFactory,\n localColorSpaceCache,\n })\n .then(async imageObj => {\n imgData = await imageObj.createImageData(\n /* forceRGBA = */ false,\n /* isOffscreenCanvasSupported = */ this.options\n .isOffscreenCanvasSupported\n );\n imgData.dataLen = imgData.bitmap\n ? imgData.width * imgData.height * 4\n : imgData.data.length;\n imgData.ref = imageRef;\n\n if (cacheGlobally) {\n this.globalImageCache.addByteSize(imageRef, imgData.dataLen);\n }\n return this._sendImgData(objId, imgData, cacheGlobally);\n })\n .catch(reason => {\n warn(`Unable to decode image \"${objId}\": \"${reason}\".`);\n\n return this._sendImgData(objId, /* imgData = */ null, cacheGlobally);\n });\n\n if (cacheKey) {\n const cacheData = {\n fn: OPS.paintImageXObject,\n args,\n optionalContent,\n };\n localImageCache.set(cacheKey, imageRef, cacheData);\n\n if (imageRef) {\n this._regionalImageCache.set(/* name = */ null, imageRef, cacheData);\n\n if (cacheGlobally) {\n this.globalImageCache.setData(imageRef, {\n objId,\n fn: OPS.paintImageXObject,\n args,\n optionalContent,\n byteSize: 0, // Temporary entry, note `addByteSize` above.\n });\n }\n }\n }\n }\n\n handleSMask(\n smask,\n resources,\n operatorList,\n task,\n stateManager,\n localColorSpaceCache\n ) {\n const smaskContent = smask.get(\"G\");\n const smaskOptions = {\n subtype: smask.get(\"S\").name,\n backdrop: smask.get(\"BC\"),\n };\n\n // The SMask might have a alpha/luminosity value transfer function --\n // we will build a map of integer values in range 0..255 to be fast.\n const transferObj = smask.get(\"TR\");\n if (isPDFFunction(transferObj)) {\n const transferFn = this._pdfFunctionFactory.create(transferObj);\n const transferMap = new Uint8Array(256);\n const tmp = new Float32Array(1);\n for (let i = 0; i < 256; i++) {\n tmp[0] = i / 255;\n transferFn(tmp, 0, tmp, 0);\n transferMap[i] = (tmp[0] * 255) | 0;\n }\n smaskOptions.transferMap = transferMap;\n }\n\n return this.buildFormXObject(\n resources,\n smaskContent,\n smaskOptions,\n operatorList,\n task,\n stateManager.state.clone(),\n localColorSpaceCache\n );\n }\n\n handleTransferFunction(tr) {\n let transferArray;\n if (Array.isArray(tr)) {\n transferArray = tr;\n } else if (isPDFFunction(tr)) {\n transferArray = [tr];\n } else {\n return null; // Not a valid transfer function entry.\n }\n\n const transferMaps = [];\n let numFns = 0,\n numEffectfulFns = 0;\n for (const entry of transferArray) {\n const transferObj = this.xref.fetchIfRef(entry);\n numFns++;\n\n if (isName(transferObj, \"Identity\")) {\n transferMaps.push(null);\n continue;\n } else if (!isPDFFunction(transferObj)) {\n return null; // Not a valid transfer function object.\n }\n\n const transferFn = this._pdfFunctionFactory.create(transferObj);\n const transferMap = new Uint8Array(256),\n tmp = new Float32Array(1);\n for (let j = 0; j < 256; j++) {\n tmp[0] = j / 255;\n transferFn(tmp, 0, tmp, 0);\n transferMap[j] = (tmp[0] * 255) | 0;\n }\n transferMaps.push(transferMap);\n numEffectfulFns++;\n }\n\n if (!(numFns === 1 || numFns === 4)) {\n return null; // Only 1 or 4 functions are supported, by the specification.\n }\n if (numEffectfulFns === 0) {\n return null; // Only /Identity transfer functions found, which are no-ops.\n }\n return transferMaps;\n }\n\n handleTilingType(\n fn,\n color,\n resources,\n pattern,\n patternDict,\n operatorList,\n task,\n localTilingPatternCache\n ) {\n // Create an IR of the pattern code.\n const tilingOpList = new OperatorList();\n // Merge the available resources, to prevent issues when the patternDict\n // is missing some /Resources entries (fixes issue6541.pdf).\n const patternResources = Dict.merge({\n xref: this.xref,\n dictArray: [patternDict.get(\"Resources\"), resources],\n });\n\n return this.getOperatorList({\n stream: pattern,\n task,\n resources: patternResources,\n operatorList: tilingOpList,\n })\n .then(function () {\n const operatorListIR = tilingOpList.getIR();\n const tilingPatternIR = getTilingPatternIR(\n operatorListIR,\n patternDict,\n color\n );\n // Add the dependencies to the parent operator list so they are\n // resolved before the sub operator list is executed synchronously.\n operatorList.addDependencies(tilingOpList.dependencies);\n operatorList.addOp(fn, tilingPatternIR);\n\n if (patternDict.objId) {\n localTilingPatternCache.set(/* name = */ null, patternDict.objId, {\n operatorListIR,\n dict: patternDict,\n });\n }\n })\n .catch(reason => {\n if (reason instanceof AbortException) {\n return;\n }\n if (this.options.ignoreErrors) {\n warn(`handleTilingType - ignoring pattern: \"${reason}\".`);\n return;\n }\n throw reason;\n });\n }\n\n handleSetFont(\n resources,\n fontArgs,\n fontRef,\n operatorList,\n task,\n state,\n fallbackFontDict = null,\n cssFontInfo = null\n ) {\n const fontName = fontArgs?.[0] instanceof Name ? fontArgs[0].name : null;\n\n return this.loadFont(\n fontName,\n fontRef,\n resources,\n fallbackFontDict,\n cssFontInfo\n )\n .then(translated => {\n if (!translated.font.isType3Font) {\n return translated;\n }\n return translated\n .loadType3Data(this, resources, task)\n .then(function () {\n // Add the dependencies to the parent operatorList so they are\n // resolved before Type3 operatorLists are executed synchronously.\n operatorList.addDependencies(translated.type3Dependencies);\n\n return translated;\n })\n .catch(reason => {\n return new TranslatedFont({\n loadedName: \"g_font_error\",\n font: new ErrorFont(`Type3 font load error: ${reason}`),\n dict: translated.font,\n evaluatorOptions: this.options,\n });\n });\n })\n .then(translated => {\n state.font = translated.font;\n translated.send(this.handler);\n return translated.loadedName;\n });\n }\n\n handleText(chars, state) {\n const font = state.font;\n const glyphs = font.charsToGlyphs(chars);\n\n if (font.data) {\n const isAddToPathSet = !!(\n state.textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG\n );\n if (\n isAddToPathSet ||\n state.fillColorSpace.name === \"Pattern\" ||\n font.disableFontFace ||\n this.options.disableFontFace\n ) {\n PartialEvaluator.buildFontPaths(\n font,\n glyphs,\n this.handler,\n this.options\n );\n }\n }\n return glyphs;\n }\n\n ensureStateFont(state) {\n if (state.font) {\n return;\n }\n const reason = new FormatError(\n \"Missing setFont (Tf) operator before text rendering operator.\"\n );\n\n if (this.options.ignoreErrors) {\n warn(`ensureStateFont: \"${reason}\".`);\n return;\n }\n throw reason;\n }\n\n async setGState({\n resources,\n gState,\n operatorList,\n cacheKey,\n task,\n stateManager,\n localGStateCache,\n localColorSpaceCache,\n }) {\n const gStateRef = gState.objId;\n let isSimpleGState = true;\n // This array holds the converted/processed state data.\n const gStateObj = [];\n let promise = Promise.resolve();\n for (const key of gState.getKeys()) {\n const value = gState.get(key);\n switch (key) {\n case \"Type\":\n break;\n case \"LW\":\n case \"LC\":\n case \"LJ\":\n case \"ML\":\n case \"D\":\n case \"RI\":\n case \"FL\":\n case \"CA\":\n case \"ca\":\n gStateObj.push([key, value]);\n break;\n case \"Font\":\n isSimpleGState = false;\n\n promise = promise.then(() => {\n return this.handleSetFont(\n resources,\n null,\n value[0],\n operatorList,\n task,\n stateManager.state\n ).then(function (loadedName) {\n operatorList.addDependency(loadedName);\n gStateObj.push([key, [loadedName, value[1]]]);\n });\n });\n break;\n case \"BM\":\n gStateObj.push([key, normalizeBlendMode(value)]);\n break;\n case \"SMask\":\n if (isName(value, \"None\")) {\n gStateObj.push([key, false]);\n break;\n }\n if (value instanceof Dict) {\n isSimpleGState = false;\n\n promise = promise.then(() => {\n return this.handleSMask(\n value,\n resources,\n operatorList,\n task,\n stateManager,\n localColorSpaceCache\n );\n });\n gStateObj.push([key, true]);\n } else {\n warn(\"Unsupported SMask type\");\n }\n break;\n case \"TR\":\n const transferMaps = this.handleTransferFunction(value);\n gStateObj.push([key, transferMaps]);\n break;\n // Only generate info log messages for the following since\n // they are unlikely to have a big impact on the rendering.\n case \"OP\":\n case \"op\":\n case \"OPM\":\n case \"BG\":\n case \"BG2\":\n case \"UCR\":\n case \"UCR2\":\n case \"TR2\":\n case \"HT\":\n case \"SM\":\n case \"SA\":\n case \"AIS\":\n case \"TK\":\n // TODO implement these operators.\n info(\"graphic state operator \" + key);\n break;\n default:\n info(\"Unknown graphic state operator \" + key);\n break;\n }\n }\n return promise.then(function () {\n if (gStateObj.length > 0) {\n operatorList.addOp(OPS.setGState, [gStateObj]);\n }\n\n if (isSimpleGState) {\n localGStateCache.set(cacheKey, gStateRef, gStateObj);\n }\n });\n }\n\n loadFont(\n fontName,\n font,\n resources,\n fallbackFontDict = null,\n cssFontInfo = null\n ) {\n const errorFont = async () => {\n return new TranslatedFont({\n loadedName: \"g_font_error\",\n font: new ErrorFont(`Font \"${fontName}\" is not available.`),\n dict: font,\n evaluatorOptions: this.options,\n });\n };\n\n let fontRef;\n if (font) {\n // Loading by ref.\n if (font instanceof Ref) {\n fontRef = font;\n }\n } else {\n // Loading by name.\n const fontRes = resources.get(\"Font\");\n if (fontRes) {\n fontRef = fontRes.getRaw(fontName);\n }\n }\n if (fontRef) {\n if (this.parsingType3Font && this.type3FontRefs.has(fontRef)) {\n return errorFont();\n }\n\n if (this.fontCache.has(fontRef)) {\n return this.fontCache.get(fontRef);\n }\n\n font = this.xref.fetchIfRef(fontRef);\n }\n\n if (!(font instanceof Dict)) {\n if (!this.options.ignoreErrors && !this.parsingType3Font) {\n warn(`Font \"${fontName}\" is not available.`);\n return errorFont();\n }\n warn(\n `Font \"${fontName}\" is not available -- attempting to fallback to a default font.`\n );\n\n // Falling back to a default font to avoid completely broken rendering,\n // but note that there're no guarantees that things will look \"correct\".\n font = fallbackFontDict || PartialEvaluator.fallbackFontDict;\n }\n\n // We are holding `font.cacheKey` references only for `fontRef`s that\n // are not actually `Ref`s, but rather `Dict`s. See explanation below.\n if (font.cacheKey && this.fontCache.has(font.cacheKey)) {\n return this.fontCache.get(font.cacheKey);\n }\n\n const fontCapability = new PromiseCapability();\n\n let preEvaluatedFont;\n try {\n preEvaluatedFont = this.preEvaluateFont(font);\n preEvaluatedFont.cssFontInfo = cssFontInfo;\n } catch (reason) {\n warn(`loadFont - preEvaluateFont failed: \"${reason}\".`);\n return errorFont();\n }\n const { descriptor, hash } = preEvaluatedFont;\n\n const fontRefIsRef = fontRef instanceof Ref;\n let fontID;\n\n if (hash && descriptor instanceof Dict) {\n const fontAliases = (descriptor.fontAliases ||= Object.create(null));\n\n if (fontAliases[hash]) {\n const aliasFontRef = fontAliases[hash].aliasRef;\n if (fontRefIsRef && aliasFontRef && this.fontCache.has(aliasFontRef)) {\n this.fontCache.putAlias(fontRef, aliasFontRef);\n return this.fontCache.get(fontRef);\n }\n } else {\n fontAliases[hash] = {\n fontID: this.idFactory.createFontId(),\n };\n }\n\n if (fontRefIsRef) {\n fontAliases[hash].aliasRef = fontRef;\n }\n fontID = fontAliases[hash].fontID;\n } else {\n fontID = this.idFactory.createFontId();\n }\n assert(\n fontID?.startsWith(\"f\"),\n 'The \"fontID\" must be (correctly) defined.'\n );\n\n // Workaround for bad PDF generators that reference fonts incorrectly,\n // where `fontRef` is a `Dict` rather than a `Ref` (fixes bug946506.pdf).\n // In this case we cannot put the font into `this.fontCache` (which is\n // a `RefSetCache`), since it's not possible to use a `Dict` as a key.\n //\n // However, if we don't cache the font it's not possible to remove it\n // when `cleanup` is triggered from the API, which causes issues on\n // subsequent rendering operations (see issue7403.pdf) and would force us\n // to unnecessarily load the same fonts over and over.\n //\n // Instead, we cheat a bit by using a modified `fontID` as a key in\n // `this.fontCache`, to allow the font to be cached.\n // NOTE: This works because `RefSetCache` calls `toString()` on provided\n // keys. Also, since `fontRef` is used when getting cached fonts,\n // we'll not accidentally match fonts cached with the `fontID`.\n if (fontRefIsRef) {\n this.fontCache.put(fontRef, fontCapability.promise);\n } else {\n font.cacheKey = `cacheKey_${fontID}`;\n this.fontCache.put(font.cacheKey, fontCapability.promise);\n }\n\n // Keep track of each font we translated so the caller can\n // load them asynchronously before calling display on a page.\n font.loadedName = `${this.idFactory.getDocId()}_${fontID}`;\n\n this.translateFont(preEvaluatedFont)\n .then(translatedFont => {\n fontCapability.resolve(\n new TranslatedFont({\n loadedName: font.loadedName,\n font: translatedFont,\n dict: font,\n evaluatorOptions: this.options,\n })\n );\n })\n .catch(reason => {\n // TODO fontCapability.reject?\n warn(`loadFont - translateFont failed: \"${reason}\".`);\n\n fontCapability.resolve(\n new TranslatedFont({\n loadedName: font.loadedName,\n font: new ErrorFont(\n reason instanceof Error ? reason.message : reason\n ),\n dict: font,\n evaluatorOptions: this.options,\n })\n );\n });\n return fontCapability.promise;\n }\n\n buildPath(operatorList, fn, args, parsingText = false) {\n const lastIndex = operatorList.length - 1;\n if (!args) {\n args = [];\n }\n if (\n lastIndex < 0 ||\n operatorList.fnArray[lastIndex] !== OPS.constructPath\n ) {\n // Handle corrupt PDF documents that contains path operators inside of\n // text objects, which may shift subsequent text, by enclosing the path\n // operator in save/restore operators (fixes issue10542_reduced.pdf).\n //\n // Note that this will effectively disable the optimization in the\n // `else` branch below, but given that this type of corruption is\n // *extremely* rare that shouldn't really matter much in practice.\n if (parsingText) {\n warn(`Encountered path operator \"${fn}\" inside of a text object.`);\n operatorList.addOp(OPS.save, null);\n }\n\n let minMax;\n switch (fn) {\n case OPS.rectangle:\n const x = args[0] + args[2];\n const y = args[1] + args[3];\n minMax = [\n Math.min(args[0], x),\n Math.max(args[0], x),\n Math.min(args[1], y),\n Math.max(args[1], y),\n ];\n break;\n case OPS.moveTo:\n case OPS.lineTo:\n minMax = [args[0], args[0], args[1], args[1]];\n break;\n default:\n minMax = [Infinity, -Infinity, Infinity, -Infinity];\n break;\n }\n operatorList.addOp(OPS.constructPath, [[fn], args, minMax]);\n\n if (parsingText) {\n operatorList.addOp(OPS.restore, null);\n }\n } else {\n const opArgs = operatorList.argsArray[lastIndex];\n opArgs[0].push(fn);\n opArgs[1].push(...args);\n const minMax = opArgs[2];\n\n // Compute min/max in the worker instead of the main thread.\n // If the current matrix (when drawing) is a scaling one\n // then min/max can be easily computed in using those values.\n // Only rectangle, lineTo and moveTo are handled here since\n // Bezier stuff requires to have the starting point.\n switch (fn) {\n case OPS.rectangle:\n const x = args[0] + args[2];\n const y = args[1] + args[3];\n minMax[0] = Math.min(minMax[0], args[0], x);\n minMax[1] = Math.max(minMax[1], args[0], x);\n minMax[2] = Math.min(minMax[2], args[1], y);\n minMax[3] = Math.max(minMax[3], args[1], y);\n break;\n case OPS.moveTo:\n case OPS.lineTo:\n minMax[0] = Math.min(minMax[0], args[0]);\n minMax[1] = Math.max(minMax[1], args[0]);\n minMax[2] = Math.min(minMax[2], args[1]);\n minMax[3] = Math.max(minMax[3], args[1]);\n break;\n }\n }\n }\n\n parseColorSpace({ cs, resources, localColorSpaceCache }) {\n return ColorSpace.parseAsync({\n cs,\n xref: this.xref,\n resources,\n pdfFunctionFactory: this._pdfFunctionFactory,\n localColorSpaceCache,\n }).catch(reason => {\n if (reason instanceof AbortException) {\n return null;\n }\n if (this.options.ignoreErrors) {\n warn(`parseColorSpace - ignoring ColorSpace: \"${reason}\".`);\n return null;\n }\n throw reason;\n });\n }\n\n parseShading({\n shading,\n resources,\n localColorSpaceCache,\n localShadingPatternCache,\n }) {\n // Shadings and patterns may be referenced by the same name but the resource\n // dictionary could be different so we can't use the name for the cache key.\n let id = localShadingPatternCache.get(shading);\n if (!id) {\n var shadingFill = Pattern.parseShading(\n shading,\n this.xref,\n resources,\n this._pdfFunctionFactory,\n localColorSpaceCache\n );\n const patternIR = shadingFill.getIR();\n id = `pattern_${this.idFactory.createObjId()}`;\n if (this.parsingType3Font) {\n id = `${this.idFactory.getDocId()}_type3_${id}`;\n }\n localShadingPatternCache.set(shading, id);\n\n if (this.parsingType3Font) {\n this.handler.send(\"commonobj\", [id, \"Pattern\", patternIR]);\n } else {\n this.handler.send(\"obj\", [id, this.pageIndex, \"Pattern\", patternIR]);\n }\n }\n return id;\n }\n\n handleColorN(\n operatorList,\n fn,\n args,\n cs,\n patterns,\n resources,\n task,\n localColorSpaceCache,\n localTilingPatternCache,\n localShadingPatternCache\n ) {\n // compile tiling patterns\n const patternName = args.pop();\n // SCN/scn applies patterns along with normal colors\n if (patternName instanceof Name) {\n const rawPattern = patterns.getRaw(patternName.name);\n\n const localTilingPattern =\n rawPattern instanceof Ref &&\n localTilingPatternCache.getByRef(rawPattern);\n if (localTilingPattern) {\n try {\n const color = cs.base ? cs.base.getRgb(args, 0) : null;\n const tilingPatternIR = getTilingPatternIR(\n localTilingPattern.operatorListIR,\n localTilingPattern.dict,\n color\n );\n operatorList.addOp(fn, tilingPatternIR);\n return undefined;\n } catch {\n // Handle any errors during normal TilingPattern parsing.\n }\n }\n\n const pattern = this.xref.fetchIfRef(rawPattern);\n if (pattern) {\n const dict = pattern instanceof BaseStream ? pattern.dict : pattern;\n const typeNum = dict.get(\"PatternType\");\n\n if (typeNum === PatternType.TILING) {\n const color = cs.base ? cs.base.getRgb(args, 0) : null;\n return this.handleTilingType(\n fn,\n color,\n resources,\n pattern,\n dict,\n operatorList,\n task,\n localTilingPatternCache\n );\n } else if (typeNum === PatternType.SHADING) {\n const shading = dict.get(\"Shading\");\n const matrix = dict.getArray(\"Matrix\");\n const objId = this.parseShading({\n shading,\n resources,\n localColorSpaceCache,\n localShadingPatternCache,\n });\n operatorList.addOp(fn, [\"Shading\", objId, matrix]);\n return undefined;\n }\n throw new FormatError(`Unknown PatternType: ${typeNum}`);\n }\n }\n throw new FormatError(`Unknown PatternName: ${patternName}`);\n }\n\n _parseVisibilityExpression(array, nestingCounter, currentResult) {\n const MAX_NESTING = 10;\n if (++nestingCounter > MAX_NESTING) {\n warn(\"Visibility expression is too deeply nested\");\n return;\n }\n const length = array.length;\n const operator = this.xref.fetchIfRef(array[0]);\n if (length < 2 || !(operator instanceof Name)) {\n warn(\"Invalid visibility expression\");\n return;\n }\n switch (operator.name) {\n case \"And\":\n case \"Or\":\n case \"Not\":\n currentResult.push(operator.name);\n break;\n default:\n warn(`Invalid operator ${operator.name} in visibility expression`);\n return;\n }\n for (let i = 1; i < length; i++) {\n const raw = array[i];\n const object = this.xref.fetchIfRef(raw);\n if (Array.isArray(object)) {\n const nestedResult = [];\n currentResult.push(nestedResult);\n // Recursively parse a subarray.\n this._parseVisibilityExpression(object, nestingCounter, nestedResult);\n } else if (raw instanceof Ref) {\n // Reference to an OCG dictionary.\n currentResult.push(raw.toString());\n }\n }\n }\n\n async parseMarkedContentProps(contentProperties, resources) {\n let optionalContent;\n if (contentProperties instanceof Name) {\n const properties = resources.get(\"Properties\");\n optionalContent = properties.get(contentProperties.name);\n } else if (contentProperties instanceof Dict) {\n optionalContent = contentProperties;\n } else {\n throw new FormatError(\"Optional content properties malformed.\");\n }\n\n const optionalContentType = optionalContent.get(\"Type\")?.name;\n if (optionalContentType === \"OCG\") {\n return {\n type: optionalContentType,\n id: optionalContent.objId,\n };\n } else if (optionalContentType === \"OCMD\") {\n const expression = optionalContent.get(\"VE\");\n if (Array.isArray(expression)) {\n const result = [];\n this._parseVisibilityExpression(expression, 0, result);\n if (result.length > 0) {\n return {\n type: \"OCMD\",\n expression: result,\n };\n }\n }\n\n const optionalContentGroups = optionalContent.get(\"OCGs\");\n if (\n Array.isArray(optionalContentGroups) ||\n optionalContentGroups instanceof Dict\n ) {\n const groupIds = [];\n if (Array.isArray(optionalContentGroups)) {\n for (const ocg of optionalContentGroups) {\n groupIds.push(ocg.toString());\n }\n } else {\n // Dictionary, just use the obj id.\n groupIds.push(optionalContentGroups.objId);\n }\n\n return {\n type: optionalContentType,\n ids: groupIds,\n policy:\n optionalContent.get(\"P\") instanceof Name\n ? optionalContent.get(\"P\").name\n : null,\n expression: null,\n };\n } else if (optionalContentGroups instanceof Ref) {\n return {\n type: optionalContentType,\n id: optionalContentGroups.toString(),\n };\n }\n }\n return null;\n }\n\n getOperatorList({\n stream,\n task,\n resources,\n operatorList,\n initialState = null,\n fallbackFontDict = null,\n }) {\n // Ensure that `resources`/`initialState` is correctly initialized,\n // even if the provided parameter is e.g. `null`.\n resources ||= Dict.empty;\n initialState ||= new EvalState();\n\n if (!operatorList) {\n throw new Error('getOperatorList: missing \"operatorList\" parameter');\n }\n\n const self = this;\n const xref = this.xref;\n let parsingText = false;\n const localImageCache = new LocalImageCache();\n const localColorSpaceCache = new LocalColorSpaceCache();\n const localGStateCache = new LocalGStateCache();\n const localTilingPatternCache = new LocalTilingPatternCache();\n const localShadingPatternCache = new Map();\n\n const xobjs = resources.get(\"XObject\") || Dict.empty;\n const patterns = resources.get(\"Pattern\") || Dict.empty;\n const stateManager = new StateManager(initialState);\n const preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager);\n const timeSlotManager = new TimeSlotManager();\n\n function closePendingRestoreOPS(argument) {\n for (let i = 0, ii = preprocessor.savedStatesDepth; i < ii; i++) {\n operatorList.addOp(OPS.restore, []);\n }\n }\n\n return new Promise(function promiseBody(resolve, reject) {\n const next = function (promise) {\n Promise.all([promise, operatorList.ready]).then(function () {\n try {\n promiseBody(resolve, reject);\n } catch (ex) {\n reject(ex);\n }\n }, reject);\n };\n task.ensureNotTerminated();\n timeSlotManager.reset();\n\n const operation = {};\n let stop, i, ii, cs, name, isValidName;\n while (!(stop = timeSlotManager.check())) {\n // The arguments parsed by read() are used beyond this loop, so we\n // cannot reuse the same array on each iteration. Therefore we pass\n // in |null| as the initial value (see the comment on\n // EvaluatorPreprocessor_read() for why).\n operation.args = null;\n if (!preprocessor.read(operation)) {\n break;\n }\n let args = operation.args;\n let fn = operation.fn;\n\n switch (fn | 0) {\n case OPS.paintXObject:\n // eagerly compile XForm objects\n isValidName = args[0] instanceof Name;\n name = args[0].name;\n\n if (isValidName) {\n const localImage = localImageCache.getByName(name);\n if (localImage) {\n operatorList.addImageOps(\n localImage.fn,\n localImage.args,\n localImage.optionalContent\n );\n\n incrementCachedImageMaskCount(localImage);\n args = null;\n continue;\n }\n }\n\n next(\n new Promise(function (resolveXObject, rejectXObject) {\n if (!isValidName) {\n throw new FormatError(\"XObject must be referred to by name.\");\n }\n\n let xobj = xobjs.getRaw(name);\n if (xobj instanceof Ref) {\n const localImage =\n localImageCache.getByRef(xobj) ||\n self._regionalImageCache.getByRef(xobj);\n if (localImage) {\n operatorList.addImageOps(\n localImage.fn,\n localImage.args,\n localImage.optionalContent\n );\n\n incrementCachedImageMaskCount(localImage);\n resolveXObject();\n return;\n }\n\n const globalImage = self.globalImageCache.getData(\n xobj,\n self.pageIndex\n );\n if (globalImage) {\n operatorList.addDependency(globalImage.objId);\n operatorList.addImageOps(\n globalImage.fn,\n globalImage.args,\n globalImage.optionalContent\n );\n\n resolveXObject();\n return;\n }\n\n xobj = xref.fetch(xobj);\n }\n\n if (!(xobj instanceof BaseStream)) {\n throw new FormatError(\"XObject should be a stream\");\n }\n\n const type = xobj.dict.get(\"Subtype\");\n if (!(type instanceof Name)) {\n throw new FormatError(\"XObject should have a Name subtype\");\n }\n\n if (type.name === \"Form\") {\n stateManager.save();\n self\n .buildFormXObject(\n resources,\n xobj,\n null,\n operatorList,\n task,\n stateManager.state.clone(),\n localColorSpaceCache\n )\n .then(function () {\n stateManager.restore();\n resolveXObject();\n }, rejectXObject);\n return;\n } else if (type.name === \"Image\") {\n self\n .buildPaintImageXObject({\n resources,\n image: xobj,\n operatorList,\n cacheKey: name,\n localImageCache,\n localColorSpaceCache,\n })\n .then(resolveXObject, rejectXObject);\n return;\n } else if (type.name === \"PS\") {\n // PostScript XObjects are unused when viewing documents.\n // See section 4.7.1 of Adobe's PDF reference.\n info(\"Ignored XObject subtype PS\");\n } else {\n throw new FormatError(\n `Unhandled XObject subtype ${type.name}`\n );\n }\n resolveXObject();\n }).catch(function (reason) {\n if (reason instanceof AbortException) {\n return;\n }\n if (self.options.ignoreErrors) {\n warn(`getOperatorList - ignoring XObject: \"${reason}\".`);\n return;\n }\n throw reason;\n })\n );\n return;\n case OPS.setFont:\n var fontSize = args[1];\n // eagerly collect all fonts\n next(\n self\n .handleSetFont(\n resources,\n args,\n null,\n operatorList,\n task,\n stateManager.state,\n fallbackFontDict\n )\n .then(function (loadedName) {\n operatorList.addDependency(loadedName);\n operatorList.addOp(OPS.setFont, [loadedName, fontSize]);\n })\n );\n return;\n case OPS.beginText:\n parsingText = true;\n break;\n case OPS.endText:\n parsingText = false;\n break;\n case OPS.endInlineImage:\n var cacheKey = args[0].cacheKey;\n if (cacheKey) {\n const localImage = localImageCache.getByName(cacheKey);\n if (localImage) {\n operatorList.addImageOps(\n localImage.fn,\n localImage.args,\n localImage.optionalContent\n );\n\n incrementCachedImageMaskCount(localImage);\n args = null;\n continue;\n }\n }\n next(\n self.buildPaintImageXObject({\n resources,\n image: args[0],\n isInline: true,\n operatorList,\n cacheKey,\n localImageCache,\n localColorSpaceCache,\n })\n );\n return;\n case OPS.showText:\n if (!stateManager.state.font) {\n self.ensureStateFont(stateManager.state);\n continue;\n }\n args[0] = self.handleText(args[0], stateManager.state);\n break;\n case OPS.showSpacedText:\n if (!stateManager.state.font) {\n self.ensureStateFont(stateManager.state);\n continue;\n }\n var combinedGlyphs = [];\n var state = stateManager.state;\n for (const arrItem of args[0]) {\n if (typeof arrItem === \"string\") {\n combinedGlyphs.push(...self.handleText(arrItem, state));\n } else if (typeof arrItem === \"number\") {\n combinedGlyphs.push(arrItem);\n }\n }\n args[0] = combinedGlyphs;\n fn = OPS.showText;\n break;\n case OPS.nextLineShowText:\n if (!stateManager.state.font) {\n self.ensureStateFont(stateManager.state);\n continue;\n }\n operatorList.addOp(OPS.nextLine);\n args[0] = self.handleText(args[0], stateManager.state);\n fn = OPS.showText;\n break;\n case OPS.nextLineSetSpacingShowText:\n if (!stateManager.state.font) {\n self.ensureStateFont(stateManager.state);\n continue;\n }\n operatorList.addOp(OPS.nextLine);\n operatorList.addOp(OPS.setWordSpacing, [args.shift()]);\n operatorList.addOp(OPS.setCharSpacing, [args.shift()]);\n args[0] = self.handleText(args[0], stateManager.state);\n fn = OPS.showText;\n break;\n case OPS.setTextRenderingMode:\n stateManager.state.textRenderingMode = args[0];\n break;\n\n case OPS.setFillColorSpace: {\n const cachedColorSpace = ColorSpace.getCached(\n args[0],\n xref,\n localColorSpaceCache\n );\n if (cachedColorSpace) {\n stateManager.state.fillColorSpace = cachedColorSpace;\n continue;\n }\n\n next(\n self\n .parseColorSpace({\n cs: args[0],\n resources,\n localColorSpaceCache,\n })\n .then(function (colorSpace) {\n if (colorSpace) {\n stateManager.state.fillColorSpace = colorSpace;\n }\n })\n );\n return;\n }\n case OPS.setStrokeColorSpace: {\n const cachedColorSpace = ColorSpace.getCached(\n args[0],\n xref,\n localColorSpaceCache\n );\n if (cachedColorSpace) {\n stateManager.state.strokeColorSpace = cachedColorSpace;\n continue;\n }\n\n next(\n self\n .parseColorSpace({\n cs: args[0],\n resources,\n localColorSpaceCache,\n })\n .then(function (colorSpace) {\n if (colorSpace) {\n stateManager.state.strokeColorSpace = colorSpace;\n }\n })\n );\n return;\n }\n case OPS.setFillColor:\n cs = stateManager.state.fillColorSpace;\n args = cs.getRgb(args, 0);\n fn = OPS.setFillRGBColor;\n break;\n case OPS.setStrokeColor:\n cs = stateManager.state.strokeColorSpace;\n args = cs.getRgb(args, 0);\n fn = OPS.setStrokeRGBColor;\n break;\n case OPS.setFillGray:\n stateManager.state.fillColorSpace = ColorSpace.singletons.gray;\n args = ColorSpace.singletons.gray.getRgb(args, 0);\n fn = OPS.setFillRGBColor;\n break;\n case OPS.setStrokeGray:\n stateManager.state.strokeColorSpace = ColorSpace.singletons.gray;\n args = ColorSpace.singletons.gray.getRgb(args, 0);\n fn = OPS.setStrokeRGBColor;\n break;\n case OPS.setFillCMYKColor:\n stateManager.state.fillColorSpace = ColorSpace.singletons.cmyk;\n args = ColorSpace.singletons.cmyk.getRgb(args, 0);\n fn = OPS.setFillRGBColor;\n break;\n case OPS.setStrokeCMYKColor:\n stateManager.state.strokeColorSpace = ColorSpace.singletons.cmyk;\n args = ColorSpace.singletons.cmyk.getRgb(args, 0);\n fn = OPS.setStrokeRGBColor;\n break;\n case OPS.setFillRGBColor:\n stateManager.state.fillColorSpace = ColorSpace.singletons.rgb;\n args = ColorSpace.singletons.rgb.getRgb(args, 0);\n break;\n case OPS.setStrokeRGBColor:\n stateManager.state.strokeColorSpace = ColorSpace.singletons.rgb;\n args = ColorSpace.singletons.rgb.getRgb(args, 0);\n break;\n case OPS.setFillColorN:\n cs = stateManager.state.fillColorSpace;\n if (cs.name === \"Pattern\") {\n next(\n self.handleColorN(\n operatorList,\n OPS.setFillColorN,\n args,\n cs,\n patterns,\n resources,\n task,\n localColorSpaceCache,\n localTilingPatternCache,\n localShadingPatternCache\n )\n );\n return;\n }\n args = cs.getRgb(args, 0);\n fn = OPS.setFillRGBColor;\n break;\n case OPS.setStrokeColorN:\n cs = stateManager.state.strokeColorSpace;\n if (cs.name === \"Pattern\") {\n next(\n self.handleColorN(\n operatorList,\n OPS.setStrokeColorN,\n args,\n cs,\n patterns,\n resources,\n task,\n localColorSpaceCache,\n localTilingPatternCache,\n localShadingPatternCache\n )\n );\n return;\n }\n args = cs.getRgb(args, 0);\n fn = OPS.setStrokeRGBColor;\n break;\n\n case OPS.shadingFill:\n var shadingRes = resources.get(\"Shading\");\n if (!shadingRes) {\n throw new FormatError(\"No shading resource found\");\n }\n\n var shading = shadingRes.get(args[0].name);\n if (!shading) {\n throw new FormatError(\"No shading object found\");\n }\n const patternId = self.parseShading({\n shading,\n resources,\n localColorSpaceCache,\n localShadingPatternCache,\n });\n args = [patternId];\n fn = OPS.shadingFill;\n break;\n case OPS.setGState:\n isValidName = args[0] instanceof Name;\n name = args[0].name;\n\n if (isValidName) {\n const localGStateObj = localGStateCache.getByName(name);\n if (localGStateObj) {\n if (localGStateObj.length > 0) {\n operatorList.addOp(OPS.setGState, [localGStateObj]);\n }\n args = null;\n continue;\n }\n }\n\n next(\n new Promise(function (resolveGState, rejectGState) {\n if (!isValidName) {\n throw new FormatError(\"GState must be referred to by name.\");\n }\n\n const extGState = resources.get(\"ExtGState\");\n if (!(extGState instanceof Dict)) {\n throw new FormatError(\"ExtGState should be a dictionary.\");\n }\n\n const gState = extGState.get(name);\n // TODO: Attempt to lookup cached GStates by reference as well,\n // if and only if there are PDF documents where doing so\n // would significantly improve performance.\n if (!(gState instanceof Dict)) {\n throw new FormatError(\"GState should be a dictionary.\");\n }\n\n self\n .setGState({\n resources,\n gState,\n operatorList,\n cacheKey: name,\n task,\n stateManager,\n localGStateCache,\n localColorSpaceCache,\n })\n .then(resolveGState, rejectGState);\n }).catch(function (reason) {\n if (reason instanceof AbortException) {\n return;\n }\n if (self.options.ignoreErrors) {\n warn(`getOperatorList - ignoring ExtGState: \"${reason}\".`);\n return;\n }\n throw reason;\n })\n );\n return;\n case OPS.moveTo:\n case OPS.lineTo:\n case OPS.curveTo:\n case OPS.curveTo2:\n case OPS.curveTo3:\n case OPS.closePath:\n case OPS.rectangle:\n self.buildPath(operatorList, fn, args, parsingText);\n continue;\n case OPS.markPoint:\n case OPS.markPointProps:\n case OPS.beginCompat:\n case OPS.endCompat:\n // Ignore operators where the corresponding handlers are known to\n // be no-op in CanvasGraphics (display/canvas.js). This prevents\n // serialization errors and is also a bit more efficient.\n // We could also try to serialize all objects in a general way,\n // e.g. as done in https://github.com/mozilla/pdf.js/pull/6266,\n // but doing so is meaningless without knowing the semantics.\n continue;\n case OPS.beginMarkedContentProps:\n if (!(args[0] instanceof Name)) {\n warn(`Expected name for beginMarkedContentProps arg0=${args[0]}`);\n continue;\n }\n if (args[0].name === \"OC\") {\n next(\n self\n .parseMarkedContentProps(args[1], resources)\n .then(data => {\n operatorList.addOp(OPS.beginMarkedContentProps, [\n \"OC\",\n data,\n ]);\n })\n .catch(reason => {\n if (reason instanceof AbortException) {\n return;\n }\n if (self.options.ignoreErrors) {\n warn(\n `getOperatorList - ignoring beginMarkedContentProps: \"${reason}\".`\n );\n return;\n }\n throw reason;\n })\n );\n return;\n }\n // Other marked content types aren't supported yet.\n args = [\n args[0].name,\n args[1] instanceof Dict ? args[1].get(\"MCID\") : null,\n ];\n\n break;\n case OPS.beginMarkedContent:\n case OPS.endMarkedContent:\n default:\n // Note: Ignore the operator if it has `Dict` arguments, since\n // those are non-serializable, otherwise postMessage will throw\n // \"An object could not be cloned.\".\n if (args !== null) {\n for (i = 0, ii = args.length; i < ii; i++) {\n if (args[i] instanceof Dict) {\n break;\n }\n }\n if (i < ii) {\n warn(\"getOperatorList - ignoring operator: \" + fn);\n continue;\n }\n }\n }\n operatorList.addOp(fn, args);\n }\n if (stop) {\n next(deferred);\n return;\n }\n // Some PDFs don't close all restores inside object/form.\n // Closing those for them.\n closePendingRestoreOPS();\n resolve();\n }).catch(reason => {\n if (reason instanceof AbortException) {\n return;\n }\n if (this.options.ignoreErrors) {\n warn(\n `getOperatorList - ignoring errors during \"${task.name}\" ` +\n `task: \"${reason}\".`\n );\n\n closePendingRestoreOPS();\n return;\n }\n throw reason;\n });\n }\n\n getTextContent({\n stream,\n task,\n resources,\n stateManager = null,\n includeMarkedContent = false,\n sink,\n seenStyles = new Set(),\n viewBox,\n markedContentData = null,\n disableNormalization = false,\n }) {\n // Ensure that `resources`/`stateManager` is correctly initialized,\n // even if the provided parameter is e.g. `null`.\n resources ||= Dict.empty;\n stateManager ||= new StateManager(new TextState());\n\n if (includeMarkedContent) {\n markedContentData ||= { level: 0 };\n }\n\n const textContent = {\n items: [],\n styles: Object.create(null),\n };\n const textContentItem = {\n initialized: false,\n str: [],\n totalWidth: 0,\n totalHeight: 0,\n width: 0,\n height: 0,\n vertical: false,\n prevTransform: null,\n textAdvanceScale: 0,\n spaceInFlowMin: 0,\n spaceInFlowMax: 0,\n trackingSpaceMin: Infinity,\n negativeSpaceMax: -Infinity,\n notASpace: -Infinity,\n transform: null,\n fontName: null,\n hasEOL: false,\n };\n\n // Use a circular buffer (length === 2) to save the last chars in the\n // text stream.\n // This implementation of the circular buffer is using a fixed array\n // and the position of the next element:\n // function addElement(x) {\n // buffer[pos] = x;\n // pos = (pos + 1) % buffer.length;\n // }\n // It's a way faster than:\n // function addElement(x) {\n // buffer.push(x);\n // buffer.shift();\n // }\n //\n // It's useful to know when we need to add a whitespace in the\n // text chunk.\n const twoLastChars = [\" \", \" \"];\n let twoLastCharsPos = 0;\n\n /**\n * Save the last char.\n * @param {string} char\n * @returns {boolean} true when the two last chars before adding the new one\n * are a non-whitespace followed by a whitespace.\n */\n function saveLastChar(char) {\n const nextPos = (twoLastCharsPos + 1) % 2;\n const ret =\n twoLastChars[twoLastCharsPos] !== \" \" && twoLastChars[nextPos] === \" \";\n twoLastChars[twoLastCharsPos] = char;\n twoLastCharsPos = nextPos;\n\n return ret;\n }\n\n function shouldAddWhitepsace() {\n return (\n twoLastChars[twoLastCharsPos] !== \" \" &&\n twoLastChars[(twoLastCharsPos + 1) % 2] === \" \"\n );\n }\n\n function resetLastChars() {\n twoLastChars[0] = twoLastChars[1] = \" \";\n twoLastCharsPos = 0;\n }\n\n // Used in addFakeSpaces.\n\n // A white <= fontSize * TRACKING_SPACE_FACTOR is a tracking space\n // so it doesn't count as a space.\n const TRACKING_SPACE_FACTOR = 0.102;\n\n // When a white <= fontSize * NOT_A_SPACE_FACTOR, there is no space\n // even if one is present in the text stream.\n const NOT_A_SPACE_FACTOR = 0.03;\n\n // A negative white < fontSize * NEGATIVE_SPACE_FACTOR induces\n // a break (a new chunk of text is created).\n // It doesn't change anything when the text is copied but\n // it improves potential mismatch between text layer and canvas.\n const NEGATIVE_SPACE_FACTOR = -0.2;\n\n // A white with a width in [fontSize * MIN_FACTOR; fontSize * MAX_FACTOR]\n // is a space which will be inserted in the current flow of words.\n // If the width is outside of this range then the flow is broken\n // (which means a new span in the text layer).\n // It's useful to adjust the best as possible the span in the layer\n // to what is displayed in the canvas.\n const SPACE_IN_FLOW_MIN_FACTOR = 0.102;\n const SPACE_IN_FLOW_MAX_FACTOR = 0.6;\n\n // If a char is too high/too low compared to the previous we just create\n // a new chunk.\n // If the advance isn't in the +/-VERTICAL_SHIFT_RATIO * height range then\n // a new chunk is created.\n const VERTICAL_SHIFT_RATIO = 0.25;\n\n const self = this;\n const xref = this.xref;\n const showSpacedTextBuffer = [];\n\n // The xobj is parsed iff it's needed, e.g. if there is a `DO` cmd.\n let xobjs = null;\n const emptyXObjectCache = new LocalImageCache();\n const emptyGStateCache = new LocalGStateCache();\n\n const preprocessor = new EvaluatorPreprocessor(stream, xref, stateManager);\n\n let textState;\n\n function pushWhitespace({\n width = 0,\n height = 0,\n transform = textContentItem.prevTransform,\n fontName = textContentItem.fontName,\n }) {\n textContent.items.push({\n str: \" \",\n dir: \"ltr\",\n width,\n height,\n transform,\n fontName,\n hasEOL: false,\n });\n }\n\n function getCurrentTextTransform() {\n // 9.4.4 Text Space Details\n const font = textState.font;\n const tsm = [\n textState.fontSize * textState.textHScale,\n 0,\n 0,\n textState.fontSize,\n 0,\n textState.textRise,\n ];\n\n if (\n font.isType3Font &&\n (textState.fontSize <= 1 || font.isCharBBox) &&\n !isArrayEqual(textState.fontMatrix, FONT_IDENTITY_MATRIX)\n ) {\n const glyphHeight = font.bbox[3] - font.bbox[1];\n if (glyphHeight > 0) {\n tsm[3] *= glyphHeight * textState.fontMatrix[3];\n }\n }\n\n return Util.transform(\n textState.ctm,\n Util.transform(textState.textMatrix, tsm)\n );\n }\n\n function ensureTextContentItem() {\n if (textContentItem.initialized) {\n return textContentItem;\n }\n const { font, loadedName } = textState;\n if (!seenStyles.has(loadedName)) {\n seenStyles.add(loadedName);\n textContent.styles[loadedName] = {\n fontFamily: font.fallbackName,\n ascent: font.ascent,\n descent: font.descent,\n vertical: font.vertical,\n };\n if (self.options.fontExtraProperties && font.systemFontInfo) {\n const style = textContent.styles[loadedName];\n style.fontSubstitution = font.systemFontInfo.css;\n style.fontSubstitutionLoadedName = font.systemFontInfo.loadedName;\n }\n }\n textContentItem.fontName = loadedName;\n\n const trm = (textContentItem.transform = getCurrentTextTransform());\n if (!font.vertical) {\n textContentItem.width = textContentItem.totalWidth = 0;\n textContentItem.height = textContentItem.totalHeight = Math.hypot(\n trm[2],\n trm[3]\n );\n textContentItem.vertical = false;\n } else {\n textContentItem.width = textContentItem.totalWidth = Math.hypot(\n trm[0],\n trm[1]\n );\n textContentItem.height = textContentItem.totalHeight = 0;\n textContentItem.vertical = true;\n }\n\n const scaleLineX = Math.hypot(\n textState.textLineMatrix[0],\n textState.textLineMatrix[1]\n );\n const scaleCtmX = Math.hypot(textState.ctm[0], textState.ctm[1]);\n textContentItem.textAdvanceScale = scaleCtmX * scaleLineX;\n\n const { fontSize } = textState;\n textContentItem.trackingSpaceMin = fontSize * TRACKING_SPACE_FACTOR;\n textContentItem.notASpace = fontSize * NOT_A_SPACE_FACTOR;\n textContentItem.negativeSpaceMax = fontSize * NEGATIVE_SPACE_FACTOR;\n textContentItem.spaceInFlowMin = fontSize * SPACE_IN_FLOW_MIN_FACTOR;\n textContentItem.spaceInFlowMax = fontSize * SPACE_IN_FLOW_MAX_FACTOR;\n textContentItem.hasEOL = false;\n\n textContentItem.initialized = true;\n return textContentItem;\n }\n\n function updateAdvanceScale() {\n if (!textContentItem.initialized) {\n return;\n }\n\n const scaleLineX = Math.hypot(\n textState.textLineMatrix[0],\n textState.textLineMatrix[1]\n );\n const scaleCtmX = Math.hypot(textState.ctm[0], textState.ctm[1]);\n const scaleFactor = scaleCtmX * scaleLineX;\n if (scaleFactor === textContentItem.textAdvanceScale) {\n return;\n }\n\n if (!textContentItem.vertical) {\n textContentItem.totalWidth +=\n textContentItem.width * textContentItem.textAdvanceScale;\n textContentItem.width = 0;\n } else {\n textContentItem.totalHeight +=\n textContentItem.height * textContentItem.textAdvanceScale;\n textContentItem.height = 0;\n }\n\n textContentItem.textAdvanceScale = scaleFactor;\n }\n\n function runBidiTransform(textChunk) {\n let text = textChunk.str.join(\"\");\n if (!disableNormalization) {\n text = normalizeUnicode(text);\n }\n const bidiResult = bidi(text, -1, textChunk.vertical);\n return {\n str: bidiResult.str,\n dir: bidiResult.dir,\n width: Math.abs(textChunk.totalWidth),\n height: Math.abs(textChunk.totalHeight),\n transform: textChunk.transform,\n fontName: textChunk.fontName,\n hasEOL: textChunk.hasEOL,\n };\n }\n\n function handleSetFont(fontName, fontRef) {\n return self\n .loadFont(fontName, fontRef, resources)\n .then(function (translated) {\n if (!translated.font.isType3Font) {\n return translated;\n }\n return translated\n .loadType3Data(self, resources, task)\n .catch(function () {\n // Ignore Type3-parsing errors, since we only use `loadType3Data`\n // here to ensure that we'll always obtain a useful /FontBBox.\n })\n .then(function () {\n return translated;\n });\n })\n .then(function (translated) {\n textState.loadedName = translated.loadedName;\n textState.font = translated.font;\n textState.fontMatrix =\n translated.font.fontMatrix || FONT_IDENTITY_MATRIX;\n });\n }\n\n function applyInverseRotation(x, y, matrix) {\n const scale = Math.hypot(matrix[0], matrix[1]);\n return [\n (matrix[0] * x + matrix[1] * y) / scale,\n (matrix[2] * x + matrix[3] * y) / scale,\n ];\n }\n\n function compareWithLastPosition(glyphWidth) {\n const currentTransform = getCurrentTextTransform();\n let posX = currentTransform[4];\n let posY = currentTransform[5];\n\n // Check if the glyph is in the viewbox.\n if (textState.font?.vertical) {\n if (\n posX < viewBox[0] ||\n posX > viewBox[2] ||\n posY + glyphWidth < viewBox[1] ||\n posY > viewBox[3]\n ) {\n return false;\n }\n } else if (\n posX + glyphWidth < viewBox[0] ||\n posX > viewBox[2] ||\n posY < viewBox[1] ||\n posY > viewBox[3]\n ) {\n return false;\n }\n\n if (!textState.font || !textContentItem.prevTransform) {\n return true;\n }\n\n let lastPosX = textContentItem.prevTransform[4];\n let lastPosY = textContentItem.prevTransform[5];\n\n if (lastPosX === posX && lastPosY === posY) {\n return true;\n }\n\n let rotate = -1;\n // Take into account the rotation is the current transform.\n if (\n currentTransform[0] &&\n currentTransform[1] === 0 &&\n currentTransform[2] === 0\n ) {\n rotate = currentTransform[0] > 0 ? 0 : 180;\n } else if (\n currentTransform[1] &&\n currentTransform[0] === 0 &&\n currentTransform[3] === 0\n ) {\n rotate = currentTransform[1] > 0 ? 90 : 270;\n }\n\n switch (rotate) {\n case 0:\n break;\n case 90:\n [posX, posY] = [posY, posX];\n [lastPosX, lastPosY] = [lastPosY, lastPosX];\n break;\n case 180:\n [posX, posY, lastPosX, lastPosY] = [\n -posX,\n -posY,\n -lastPosX,\n -lastPosY,\n ];\n break;\n case 270:\n [posX, posY] = [-posY, -posX];\n [lastPosX, lastPosY] = [-lastPosY, -lastPosX];\n break;\n default:\n // This is not a 0, 90, 180, 270 rotation so:\n // - remove the scale factor from the matrix to get a rotation matrix\n // - apply the inverse (which is the transposed) to the positions\n // and we can then compare positions of the glyphes to detect\n // a whitespace.\n [posX, posY] = applyInverseRotation(posX, posY, currentTransform);\n [lastPosX, lastPosY] = applyInverseRotation(\n lastPosX,\n lastPosY,\n textContentItem.prevTransform\n );\n }\n\n if (textState.font.vertical) {\n const advanceY = (lastPosY - posY) / textContentItem.textAdvanceScale;\n const advanceX = posX - lastPosX;\n\n // When the total height of the current chunk is negative\n // then we're writing from bottom to top.\n const textOrientation = Math.sign(textContentItem.height);\n if (advanceY < textOrientation * textContentItem.negativeSpaceMax) {\n if (\n Math.abs(advanceX) >\n 0.5 * textContentItem.width /* not the same column */\n ) {\n appendEOL();\n return true;\n }\n\n resetLastChars();\n flushTextContentItem();\n return true;\n }\n\n if (Math.abs(advanceX) > textContentItem.width) {\n appendEOL();\n return true;\n }\n\n if (advanceY <= textOrientation * textContentItem.notASpace) {\n // The real spacing between 2 consecutive chars is thin enough to be\n // considered a non-space.\n resetLastChars();\n }\n\n if (advanceY <= textOrientation * textContentItem.trackingSpaceMin) {\n if (shouldAddWhitepsace()) {\n // The space is very thin, hence it deserves to have its own span in\n // order to avoid too much shift between the canvas and the text\n // layer.\n resetLastChars();\n flushTextContentItem();\n pushWhitespace({ height: Math.abs(advanceY) });\n } else {\n textContentItem.height += advanceY;\n }\n } else if (\n !addFakeSpaces(\n advanceY,\n textContentItem.prevTransform,\n textOrientation\n )\n ) {\n if (textContentItem.str.length === 0) {\n resetLastChars();\n pushWhitespace({ height: Math.abs(advanceY) });\n } else {\n textContentItem.height += advanceY;\n }\n }\n\n if (Math.abs(advanceX) > textContentItem.width * VERTICAL_SHIFT_RATIO) {\n flushTextContentItem();\n }\n\n return true;\n }\n\n const advanceX = (posX - lastPosX) / textContentItem.textAdvanceScale;\n const advanceY = posY - lastPosY;\n\n // When the total width of the current chunk is negative\n // then we're writing from right to left.\n const textOrientation = Math.sign(textContentItem.width);\n if (advanceX < textOrientation * textContentItem.negativeSpaceMax) {\n if (\n Math.abs(advanceY) >\n 0.5 * textContentItem.height /* not the same line */\n ) {\n appendEOL();\n return true;\n }\n\n // We're moving back so in case the last char was a whitespace\n // we cancel it: it doesn't make sense to insert it.\n resetLastChars();\n flushTextContentItem();\n return true;\n }\n\n if (Math.abs(advanceY) > textContentItem.height) {\n appendEOL();\n return true;\n }\n\n if (advanceX <= textOrientation * textContentItem.notASpace) {\n // The real spacing between 2 consecutive chars is thin enough to be\n // considered a non-space.\n resetLastChars();\n }\n\n if (advanceX <= textOrientation * textContentItem.trackingSpaceMin) {\n if (shouldAddWhitepsace()) {\n // The space is very thin, hence it deserves to have its own span in\n // order to avoid too much shift between the canvas and the text\n // layer.\n resetLastChars();\n flushTextContentItem();\n pushWhitespace({ width: Math.abs(advanceX) });\n } else {\n textContentItem.width += advanceX;\n }\n } else if (\n !addFakeSpaces(advanceX, textContentItem.prevTransform, textOrientation)\n ) {\n if (textContentItem.str.length === 0) {\n resetLastChars();\n pushWhitespace({ width: Math.abs(advanceX) });\n } else {\n textContentItem.width += advanceX;\n }\n }\n\n if (Math.abs(advanceY) > textContentItem.height * VERTICAL_SHIFT_RATIO) {\n flushTextContentItem();\n }\n\n return true;\n }\n\n function buildTextContentItem({ chars, extraSpacing }) {\n const font = textState.font;\n if (!chars) {\n // Just move according to the space we have.\n const charSpacing = textState.charSpacing + extraSpacing;\n if (charSpacing) {\n if (!font.vertical) {\n textState.translateTextMatrix(\n charSpacing * textState.textHScale,\n 0\n );\n } else {\n textState.translateTextMatrix(0, -charSpacing);\n }\n }\n\n return;\n }\n\n const glyphs = font.charsToGlyphs(chars);\n const scale = textState.fontMatrix[0] * textState.fontSize;\n\n for (let i = 0, ii = glyphs.length; i < ii; i++) {\n const glyph = glyphs[i];\n const { category } = glyph;\n\n if (category.isInvisibleFormatMark) {\n continue;\n }\n let charSpacing =\n textState.charSpacing + (i + 1 === ii ? extraSpacing : 0);\n\n let glyphWidth = glyph.width;\n if (font.vertical) {\n glyphWidth = glyph.vmetric ? glyph.vmetric[0] : -glyphWidth;\n }\n let scaledDim = glyphWidth * scale;\n\n if (category.isWhitespace) {\n // Don't push a \" \" in the textContentItem\n // (except when it's between two non-spaces chars),\n // it will be done (if required) in next call to\n // compareWithLastPosition.\n // This way we can merge real spaces and spaces due to cursor moves.\n if (!font.vertical) {\n charSpacing += scaledDim + textState.wordSpacing;\n textState.translateTextMatrix(\n charSpacing * textState.textHScale,\n 0\n );\n } else {\n charSpacing += -scaledDim + textState.wordSpacing;\n textState.translateTextMatrix(0, -charSpacing);\n }\n saveLastChar(\" \");\n continue;\n }\n\n if (\n !category.isZeroWidthDiacritic &&\n !compareWithLastPosition(scaledDim)\n ) {\n // The glyph is not in page so just skip it but move the cursor.\n if (!font.vertical) {\n textState.translateTextMatrix(scaledDim * textState.textHScale, 0);\n } else {\n textState.translateTextMatrix(0, scaledDim);\n }\n continue;\n }\n\n // Must be called after compareWithLastPosition because\n // the textContentItem could have been flushed.\n const textChunk = ensureTextContentItem();\n if (category.isZeroWidthDiacritic) {\n scaledDim = 0;\n }\n\n if (!font.vertical) {\n scaledDim *= textState.textHScale;\n textState.translateTextMatrix(scaledDim, 0);\n textChunk.width += scaledDim;\n } else {\n textState.translateTextMatrix(0, scaledDim);\n scaledDim = Math.abs(scaledDim);\n textChunk.height += scaledDim;\n }\n\n if (scaledDim) {\n // Save the position of the last visible character.\n textChunk.prevTransform = getCurrentTextTransform();\n }\n\n const glyphUnicode = glyph.unicode;\n if (saveLastChar(glyphUnicode)) {\n // The two last chars are a non-whitespace followed by a whitespace\n // and then this non-whitespace, so we insert a whitespace here.\n // Replaces all whitespaces with standard spaces (0x20), to avoid\n // alignment issues between the textLayer and the canvas if the text\n // contains e.g. tabs (fixes issue6612.pdf).\n textChunk.str.push(\" \");\n }\n textChunk.str.push(glyphUnicode);\n\n if (charSpacing) {\n if (!font.vertical) {\n textState.translateTextMatrix(\n charSpacing * textState.textHScale,\n 0\n );\n } else {\n textState.translateTextMatrix(0, -charSpacing);\n }\n }\n }\n }\n\n function appendEOL() {\n resetLastChars();\n if (textContentItem.initialized) {\n textContentItem.hasEOL = true;\n flushTextContentItem();\n } else {\n textContent.items.push({\n str: \"\",\n dir: \"ltr\",\n width: 0,\n height: 0,\n transform: getCurrentTextTransform(),\n fontName: textState.loadedName,\n hasEOL: true,\n });\n }\n }\n\n function addFakeSpaces(width, transf, textOrientation) {\n if (\n textOrientation * textContentItem.spaceInFlowMin <= width &&\n width <= textOrientation * textContentItem.spaceInFlowMax\n ) {\n if (textContentItem.initialized) {\n resetLastChars();\n textContentItem.str.push(\" \");\n }\n return false;\n }\n\n const fontName = textContentItem.fontName;\n\n let height = 0;\n if (textContentItem.vertical) {\n height = width;\n width = 0;\n }\n\n flushTextContentItem();\n resetLastChars();\n pushWhitespace({\n width: Math.abs(width),\n height: Math.abs(height),\n transform: transf || getCurrentTextTransform(),\n fontName,\n });\n\n return true;\n }\n\n function flushTextContentItem() {\n if (!textContentItem.initialized || !textContentItem.str) {\n return;\n }\n\n // Do final text scaling.\n if (!textContentItem.vertical) {\n textContentItem.totalWidth +=\n textContentItem.width * textContentItem.textAdvanceScale;\n } else {\n textContentItem.totalHeight +=\n textContentItem.height * textContentItem.textAdvanceScale;\n }\n\n textContent.items.push(runBidiTransform(textContentItem));\n textContentItem.initialized = false;\n textContentItem.str.length = 0;\n }\n\n function enqueueChunk(batch = false) {\n const length = textContent.items.length;\n if (length === 0) {\n return;\n }\n if (batch && length < TEXT_CHUNK_BATCH_SIZE) {\n return;\n }\n sink.enqueue(textContent, length);\n textContent.items = [];\n textContent.styles = Object.create(null);\n }\n\n const timeSlotManager = new TimeSlotManager();\n\n return new Promise(function promiseBody(resolve, reject) {\n const next = function (promise) {\n enqueueChunk(/* batch = */ true);\n Promise.all([promise, sink.ready]).then(function () {\n try {\n promiseBody(resolve, reject);\n } catch (ex) {\n reject(ex);\n }\n }, reject);\n };\n task.ensureNotTerminated();\n timeSlotManager.reset();\n\n const operation = {};\n let stop,\n args = [];\n while (!(stop = timeSlotManager.check())) {\n // The arguments parsed by read() are not used beyond this loop, so\n // we can reuse the same array on every iteration, thus avoiding\n // unnecessary allocations.\n args.length = 0;\n operation.args = args;\n if (!preprocessor.read(operation)) {\n break;\n }\n\n const previousState = textState;\n textState = stateManager.state;\n const fn = operation.fn;\n args = operation.args;\n\n switch (fn | 0) {\n case OPS.setFont:\n // Optimization to ignore multiple identical Tf commands.\n var fontNameArg = args[0].name,\n fontSizeArg = args[1];\n if (\n textState.font &&\n fontNameArg === textState.fontName &&\n fontSizeArg === textState.fontSize\n ) {\n break;\n }\n\n flushTextContentItem();\n textState.fontName = fontNameArg;\n textState.fontSize = fontSizeArg;\n next(handleSetFont(fontNameArg, null));\n return;\n case OPS.setTextRise:\n textState.textRise = args[0];\n break;\n case OPS.setHScale:\n textState.textHScale = args[0] / 100;\n break;\n case OPS.setLeading:\n textState.leading = args[0];\n break;\n case OPS.moveText:\n textState.translateTextLineMatrix(args[0], args[1]);\n textState.textMatrix = textState.textLineMatrix.slice();\n break;\n case OPS.setLeadingMoveText:\n textState.leading = -args[1];\n textState.translateTextLineMatrix(args[0], args[1]);\n textState.textMatrix = textState.textLineMatrix.slice();\n break;\n case OPS.nextLine:\n textState.carriageReturn();\n break;\n case OPS.setTextMatrix:\n textState.setTextMatrix(\n args[0],\n args[1],\n args[2],\n args[3],\n args[4],\n args[5]\n );\n textState.setTextLineMatrix(\n args[0],\n args[1],\n args[2],\n args[3],\n args[4],\n args[5]\n );\n updateAdvanceScale();\n break;\n case OPS.setCharSpacing:\n textState.charSpacing = args[0];\n break;\n case OPS.setWordSpacing:\n textState.wordSpacing = args[0];\n break;\n case OPS.beginText:\n textState.textMatrix = IDENTITY_MATRIX.slice();\n textState.textLineMatrix = IDENTITY_MATRIX.slice();\n break;\n case OPS.showSpacedText:\n if (!stateManager.state.font) {\n self.ensureStateFont(stateManager.state);\n continue;\n }\n\n const spaceFactor =\n ((textState.font.vertical ? 1 : -1) * textState.fontSize) / 1000;\n const elements = args[0];\n for (let i = 0, ii = elements.length; i < ii; i++) {\n const item = elements[i];\n if (typeof item === \"string\") {\n showSpacedTextBuffer.push(item);\n } else if (typeof item === \"number\" && item !== 0) {\n // PDF Specification 5.3.2 states:\n // The number is expressed in thousandths of a unit of text\n // space.\n // This amount is subtracted from the current horizontal or\n // vertical coordinate, depending on the writing mode.\n // In the default coordinate system, a positive adjustment\n // has the effect of moving the next glyph painted either to\n // the left or down by the given amount.\n const str = showSpacedTextBuffer.join(\"\");\n showSpacedTextBuffer.length = 0;\n buildTextContentItem({\n chars: str,\n extraSpacing: item * spaceFactor,\n });\n }\n }\n\n if (showSpacedTextBuffer.length > 0) {\n const str = showSpacedTextBuffer.join(\"\");\n showSpacedTextBuffer.length = 0;\n buildTextContentItem({\n chars: str,\n extraSpacing: 0,\n });\n }\n break;\n case OPS.showText:\n if (!stateManager.state.font) {\n self.ensureStateFont(stateManager.state);\n continue;\n }\n buildTextContentItem({\n chars: args[0],\n extraSpacing: 0,\n });\n break;\n case OPS.nextLineShowText:\n if (!stateManager.state.font) {\n self.ensureStateFont(stateManager.state);\n continue;\n }\n textState.carriageReturn();\n buildTextContentItem({\n chars: args[0],\n extraSpacing: 0,\n });\n break;\n case OPS.nextLineSetSpacingShowText:\n if (!stateManager.state.font) {\n self.ensureStateFont(stateManager.state);\n continue;\n }\n textState.wordSpacing = args[0];\n textState.charSpacing = args[1];\n textState.carriageReturn();\n buildTextContentItem({\n chars: args[2],\n extraSpacing: 0,\n });\n break;\n case OPS.paintXObject:\n flushTextContentItem();\n if (!xobjs) {\n xobjs = resources.get(\"XObject\") || Dict.empty;\n }\n\n var isValidName = args[0] instanceof Name;\n var name = args[0].name;\n\n if (isValidName && emptyXObjectCache.getByName(name)) {\n break;\n }\n\n next(\n new Promise(function (resolveXObject, rejectXObject) {\n if (!isValidName) {\n throw new FormatError(\"XObject must be referred to by name.\");\n }\n\n let xobj = xobjs.getRaw(name);\n if (xobj instanceof Ref) {\n if (emptyXObjectCache.getByRef(xobj)) {\n resolveXObject();\n return;\n }\n\n const globalImage = self.globalImageCache.getData(\n xobj,\n self.pageIndex\n );\n if (globalImage) {\n resolveXObject();\n return;\n }\n\n xobj = xref.fetch(xobj);\n }\n\n if (!(xobj instanceof BaseStream)) {\n throw new FormatError(\"XObject should be a stream\");\n }\n\n const type = xobj.dict.get(\"Subtype\");\n if (!(type instanceof Name)) {\n throw new FormatError(\"XObject should have a Name subtype\");\n }\n\n if (type.name !== \"Form\") {\n emptyXObjectCache.set(name, xobj.dict.objId, true);\n\n resolveXObject();\n return;\n }\n\n // Use a new `StateManager` to prevent incorrect positioning\n // of textItems *after* the Form XObject, since errors in the\n // data can otherwise prevent `restore` operators from\n // executing.\n // NOTE: Only an issue when `options.ignoreErrors === true`.\n const currentState = stateManager.state.clone();\n const xObjStateManager = new StateManager(currentState);\n\n const matrix = xobj.dict.getArray(\"Matrix\");\n if (Array.isArray(matrix) && matrix.length === 6) {\n xObjStateManager.transform(matrix);\n }\n\n // Enqueue the `textContent` chunk before parsing the /Form\n // XObject.\n enqueueChunk();\n const sinkWrapper = {\n enqueueInvoked: false,\n\n enqueue(chunk, size) {\n this.enqueueInvoked = true;\n sink.enqueue(chunk, size);\n },\n\n get desiredSize() {\n return sink.desiredSize;\n },\n\n get ready() {\n return sink.ready;\n },\n };\n\n self\n .getTextContent({\n stream: xobj,\n task,\n resources: xobj.dict.get(\"Resources\") || resources,\n stateManager: xObjStateManager,\n includeMarkedContent,\n sink: sinkWrapper,\n seenStyles,\n viewBox,\n markedContentData,\n disableNormalization,\n })\n .then(function () {\n if (!sinkWrapper.enqueueInvoked) {\n emptyXObjectCache.set(name, xobj.dict.objId, true);\n }\n resolveXObject();\n }, rejectXObject);\n }).catch(function (reason) {\n if (reason instanceof AbortException) {\n return;\n }\n if (self.options.ignoreErrors) {\n // Error(s) in the XObject -- allow text-extraction to\n // continue.\n warn(`getTextContent - ignoring XObject: \"${reason}\".`);\n return;\n }\n throw reason;\n })\n );\n return;\n case OPS.setGState:\n isValidName = args[0] instanceof Name;\n name = args[0].name;\n\n if (isValidName && emptyGStateCache.getByName(name)) {\n break;\n }\n\n next(\n new Promise(function (resolveGState, rejectGState) {\n if (!isValidName) {\n throw new FormatError(\"GState must be referred to by name.\");\n }\n\n const extGState = resources.get(\"ExtGState\");\n if (!(extGState instanceof Dict)) {\n throw new FormatError(\"ExtGState should be a dictionary.\");\n }\n\n const gState = extGState.get(name);\n // TODO: Attempt to lookup cached GStates by reference as well,\n // if and only if there are PDF documents where doing so\n // would significantly improve performance.\n if (!(gState instanceof Dict)) {\n throw new FormatError(\"GState should be a dictionary.\");\n }\n\n const gStateFont = gState.get(\"Font\");\n if (!gStateFont) {\n emptyGStateCache.set(name, gState.objId, true);\n\n resolveGState();\n return;\n }\n flushTextContentItem();\n\n textState.fontName = null;\n textState.fontSize = gStateFont[1];\n handleSetFont(null, gStateFont[0]).then(\n resolveGState,\n rejectGState\n );\n }).catch(function (reason) {\n if (reason instanceof AbortException) {\n return;\n }\n if (self.options.ignoreErrors) {\n // Error(s) in the ExtGState -- allow text-extraction to\n // continue.\n warn(`getTextContent - ignoring ExtGState: \"${reason}\".`);\n return;\n }\n throw reason;\n })\n );\n return;\n case OPS.beginMarkedContent:\n flushTextContentItem();\n if (includeMarkedContent) {\n markedContentData.level++;\n\n textContent.items.push({\n type: \"beginMarkedContent\",\n tag: args[0] instanceof Name ? args[0].name : null,\n });\n }\n break;\n case OPS.beginMarkedContentProps:\n flushTextContentItem();\n if (includeMarkedContent) {\n markedContentData.level++;\n\n let mcid = null;\n if (args[1] instanceof Dict) {\n mcid = args[1].get(\"MCID\");\n }\n textContent.items.push({\n type: \"beginMarkedContentProps\",\n id: Number.isInteger(mcid)\n ? `${self.idFactory.getPageObjId()}_mc${mcid}`\n : null,\n tag: args[0] instanceof Name ? args[0].name : null,\n });\n }\n break;\n case OPS.endMarkedContent:\n flushTextContentItem();\n if (includeMarkedContent) {\n if (markedContentData.level === 0) {\n // Handle unbalanced beginMarkedContent/endMarkedContent\n // operators (fixes issue15629.pdf).\n break;\n }\n markedContentData.level--;\n\n textContent.items.push({\n type: \"endMarkedContent\",\n });\n }\n break;\n case OPS.restore:\n if (\n previousState &&\n (previousState.font !== textState.font ||\n previousState.fontSize !== textState.fontSize ||\n previousState.fontName !== textState.fontName)\n ) {\n flushTextContentItem();\n }\n break;\n } // switch\n if (textContent.items.length >= sink.desiredSize) {\n // Wait for ready, if we reach highWaterMark.\n stop = true;\n break;\n }\n } // while\n if (stop) {\n next(deferred);\n return;\n }\n flushTextContentItem();\n enqueueChunk();\n resolve();\n }).catch(reason => {\n if (reason instanceof AbortException) {\n return;\n }\n if (this.options.ignoreErrors) {\n // Error(s) in the TextContent -- allow text-extraction to continue.\n warn(\n `getTextContent - ignoring errors during \"${task.name}\" ` +\n `task: \"${reason}\".`\n );\n\n flushTextContentItem();\n enqueueChunk();\n return;\n }\n throw reason;\n });\n }\n\n extractDataStructures(dict, baseDict, properties) {\n const xref = this.xref;\n let cidToGidBytes;\n // 9.10.2\n const toUnicodePromise = this.readToUnicode(\n properties.toUnicode || dict.get(\"ToUnicode\") || baseDict.get(\"ToUnicode\")\n );\n\n if (properties.composite) {\n // CIDSystemInfo helps to match CID to glyphs\n const cidSystemInfo = dict.get(\"CIDSystemInfo\");\n if (cidSystemInfo instanceof Dict) {\n properties.cidSystemInfo = {\n registry: stringToPDFString(cidSystemInfo.get(\"Registry\")),\n ordering: stringToPDFString(cidSystemInfo.get(\"Ordering\")),\n supplement: cidSystemInfo.get(\"Supplement\"),\n };\n }\n\n try {\n const cidToGidMap = dict.get(\"CIDToGIDMap\");\n if (cidToGidMap instanceof BaseStream) {\n cidToGidBytes = cidToGidMap.getBytes();\n }\n } catch (ex) {\n if (!this.options.ignoreErrors) {\n throw ex;\n }\n warn(`extractDataStructures - ignoring CIDToGIDMap data: \"${ex}\".`);\n }\n }\n\n // Based on 9.6.6 of the spec the encoding can come from multiple places\n // and depends on the font type. The base encoding and differences are\n // read here, but the encoding that is actually used is chosen during\n // glyph mapping in the font.\n // TODO: Loading the built in encoding in the font would allow the\n // differences to be merged in here not require us to hold on to it.\n const differences = [];\n let baseEncodingName = null;\n let encoding;\n if (dict.has(\"Encoding\")) {\n encoding = dict.get(\"Encoding\");\n if (encoding instanceof Dict) {\n baseEncodingName = encoding.get(\"BaseEncoding\");\n baseEncodingName =\n baseEncodingName instanceof Name ? baseEncodingName.name : null;\n // Load the differences between the base and original\n if (encoding.has(\"Differences\")) {\n const diffEncoding = encoding.get(\"Differences\");\n let index = 0;\n for (const entry of diffEncoding) {\n const data = xref.fetchIfRef(entry);\n if (typeof data === \"number\") {\n index = data;\n } else if (data instanceof Name) {\n differences[index++] = data.name;\n } else {\n throw new FormatError(\n `Invalid entry in 'Differences' array: ${data}`\n );\n }\n }\n }\n } else if (encoding instanceof Name) {\n baseEncodingName = encoding.name;\n } else {\n const msg = \"Encoding is not a Name nor a Dict\";\n\n if (!this.options.ignoreErrors) {\n throw new FormatError(msg);\n }\n warn(msg);\n }\n // According to table 114 if the encoding is a named encoding it must be\n // one of these predefined encodings.\n if (\n baseEncodingName !== \"MacRomanEncoding\" &&\n baseEncodingName !== \"MacExpertEncoding\" &&\n baseEncodingName !== \"WinAnsiEncoding\"\n ) {\n baseEncodingName = null;\n }\n }\n\n const nonEmbeddedFont = !properties.file || properties.isInternalFont,\n isSymbolsFontName = getSymbolsFonts()[properties.name];\n // Ignore an incorrectly specified named encoding for non-embedded\n // symbol fonts (fixes issue16464.pdf).\n if (baseEncodingName && nonEmbeddedFont && isSymbolsFontName) {\n baseEncodingName = null;\n }\n\n if (baseEncodingName) {\n properties.defaultEncoding = getEncoding(baseEncodingName);\n } else {\n const isSymbolicFont = !!(properties.flags & FontFlags.Symbolic);\n const isNonsymbolicFont = !!(properties.flags & FontFlags.Nonsymbolic);\n // According to \"Table 114\" in section \"9.6.6.1 General\" (under\n // \"9.6.6 Character Encoding\") of the PDF specification, a Nonsymbolic\n // font should use the `StandardEncoding` if no encoding is specified.\n encoding = StandardEncoding;\n if (properties.type === \"TrueType\" && !isNonsymbolicFont) {\n encoding = WinAnsiEncoding;\n }\n // The Symbolic attribute can be misused for regular fonts\n // Heuristic: we have to check if the font is a standard one also\n if (isSymbolicFont || isSymbolsFontName) {\n encoding = MacRomanEncoding;\n if (nonEmbeddedFont) {\n if (/Symbol/i.test(properties.name)) {\n encoding = SymbolSetEncoding;\n } else if (/Dingbats/i.test(properties.name)) {\n encoding = ZapfDingbatsEncoding;\n } else if (/Wingdings/i.test(properties.name)) {\n encoding = WinAnsiEncoding;\n }\n }\n }\n properties.defaultEncoding = encoding;\n }\n\n properties.differences = differences;\n properties.baseEncodingName = baseEncodingName;\n properties.hasEncoding = !!baseEncodingName || differences.length > 0;\n properties.dict = dict;\n return toUnicodePromise\n .then(readToUnicode => {\n properties.toUnicode = readToUnicode;\n return this.buildToUnicode(properties);\n })\n .then(builtToUnicode => {\n properties.toUnicode = builtToUnicode;\n if (cidToGidBytes) {\n properties.cidToGidMap = this.readCidToGidMap(\n cidToGidBytes,\n builtToUnicode\n );\n }\n return properties;\n });\n }\n\n /**\n * @returns {Array}\n * @private\n */\n _simpleFontToUnicode(properties, forceGlyphs = false) {\n assert(!properties.composite, \"Must be a simple font.\");\n\n const toUnicode = [];\n const encoding = properties.defaultEncoding.slice();\n const baseEncodingName = properties.baseEncodingName;\n // Merge in the differences array.\n const differences = properties.differences;\n for (const charcode in differences) {\n const glyphName = differences[charcode];\n if (glyphName === \".notdef\") {\n // Skip .notdef to prevent rendering errors, e.g. boxes appearing\n // where there should be spaces (fixes issue5256.pdf).\n continue;\n }\n encoding[charcode] = glyphName;\n }\n const glyphsUnicodeMap = getGlyphsUnicode();\n for (const charcode in encoding) {\n // a) Map the character code to a character name.\n let glyphName = encoding[charcode];\n if (glyphName === \"\") {\n continue;\n }\n // b) Look up the character name in the Adobe Glyph List (see the\n // Bibliography) to obtain the corresponding Unicode value.\n let unicode = glyphsUnicodeMap[glyphName];\n if (unicode !== undefined) {\n toUnicode[charcode] = String.fromCharCode(unicode);\n continue;\n }\n // (undocumented) c) Few heuristics to recognize unknown glyphs\n // NOTE: Adobe Reader does not do this step, but OSX Preview does\n let code = 0;\n switch (glyphName[0]) {\n case \"G\": // Gxx glyph\n if (glyphName.length === 3) {\n code = parseInt(glyphName.substring(1), 16);\n }\n break;\n case \"g\": // g00xx glyph\n if (glyphName.length === 5) {\n code = parseInt(glyphName.substring(1), 16);\n }\n break;\n case \"C\": // Cdd{d} glyph\n case \"c\": // cdd{d} glyph\n if (glyphName.length >= 3 && glyphName.length <= 4) {\n const codeStr = glyphName.substring(1);\n\n if (forceGlyphs) {\n code = parseInt(codeStr, 16);\n break;\n }\n // Normally the Cdd{d}/cdd{d} glyphName format will contain\n // regular, i.e. base 10, charCodes (see issue4550.pdf)...\n code = +codeStr;\n\n // ... however some PDF generators violate that assumption by\n // containing glyph, i.e. base 16, codes instead.\n // In that case we need to re-parse the *entire* encoding to\n // prevent broken text-selection (fixes issue9655_reduced.pdf).\n if (Number.isNaN(code) && Number.isInteger(parseInt(codeStr, 16))) {\n return this._simpleFontToUnicode(\n properties,\n /* forceGlyphs */ true\n );\n }\n }\n break;\n case \"u\": // 'uniXXXX'/'uXXXX{XX}' glyphs\n unicode = getUnicodeForGlyph(glyphName, glyphsUnicodeMap);\n if (unicode !== -1) {\n code = unicode;\n }\n break;\n default:\n // Support (some) non-standard ligatures.\n switch (glyphName) {\n case \"f_h\":\n case \"f_t\":\n case \"T_h\":\n toUnicode[charcode] = glyphName.replaceAll(\"_\", \"\");\n continue;\n }\n break;\n }\n if (code > 0 && code <= 0x10ffff && Number.isInteger(code)) {\n // If `baseEncodingName` is one the predefined encodings, and `code`\n // equals `charcode`, using the glyph defined in the baseEncoding\n // seems to yield a better `toUnicode` mapping (fixes issue 5070).\n if (baseEncodingName && code === +charcode) {\n const baseEncoding = getEncoding(baseEncodingName);\n if (baseEncoding && (glyphName = baseEncoding[charcode])) {\n toUnicode[charcode] = String.fromCharCode(\n glyphsUnicodeMap[glyphName]\n );\n continue;\n }\n }\n toUnicode[charcode] = String.fromCodePoint(code);\n }\n }\n return toUnicode;\n }\n\n /**\n * Builds a char code to unicode map based on section 9.10 of the spec.\n * @param {Object} properties Font properties object.\n * @returns {Promise} A Promise that is resolved with a\n * {ToUnicodeMap|IdentityToUnicodeMap} object.\n */\n async buildToUnicode(properties) {\n properties.hasIncludedToUnicodeMap = properties.toUnicode?.length > 0;\n\n // Section 9.10.2 Mapping Character Codes to Unicode Values\n if (properties.hasIncludedToUnicodeMap) {\n // Some fonts contain incomplete ToUnicode data, causing issues with\n // text-extraction. For simple fonts, containing encoding information,\n // use a fallback ToUnicode map to improve this (fixes issue8229.pdf).\n if (!properties.composite && properties.hasEncoding) {\n properties.fallbackToUnicode = this._simpleFontToUnicode(properties);\n }\n return properties.toUnicode;\n }\n\n // According to the spec if the font is a simple font we should only map\n // to unicode if the base encoding is MacRoman, MacExpert, or WinAnsi or\n // the differences array only contains adobe standard or symbol set names,\n // in pratice it seems better to always try to create a toUnicode map\n // based of the default encoding.\n if (!properties.composite /* is simple font */) {\n return new ToUnicodeMap(this._simpleFontToUnicode(properties));\n }\n\n // If the font is a composite font that uses one of the predefined CMaps\n // listed in Table 118 (except Identity–H and Identity–V) or whose\n // descendant CIDFont uses the Adobe-GB1, Adobe-CNS1, Adobe-Japan1, or\n // Adobe-Korea1 character collection:\n if (\n properties.composite &&\n ((properties.cMap.builtInCMap &&\n !(properties.cMap instanceof IdentityCMap)) ||\n (properties.cidSystemInfo.registry === \"Adobe\" &&\n (properties.cidSystemInfo.ordering === \"GB1\" ||\n properties.cidSystemInfo.ordering === \"CNS1\" ||\n properties.cidSystemInfo.ordering === \"Japan1\" ||\n properties.cidSystemInfo.ordering === \"Korea1\")))\n ) {\n // Then:\n // a) Map the character code to a character identifier (CID) according\n // to the font’s CMap.\n // b) Obtain the registry and ordering of the character collection used\n // by the font’s CMap (for example, Adobe and Japan1) from its\n // CIDSystemInfo dictionary.\n const { registry, ordering } = properties.cidSystemInfo;\n // c) Construct a second CMap name by concatenating the registry and\n // ordering obtained in step (b) in the format registry–ordering–UCS2\n // (for example, Adobe–Japan1–UCS2).\n const ucs2CMapName = Name.get(`${registry}-${ordering}-UCS2`);\n // d) Obtain the CMap with the name constructed in step (c) (available\n // from the ASN Web site; see the Bibliography).\n const ucs2CMap = await CMapFactory.create({\n encoding: ucs2CMapName,\n fetchBuiltInCMap: this._fetchBuiltInCMapBound,\n useCMap: null,\n });\n const toUnicode = [],\n buf = [];\n properties.cMap.forEach(function (charcode, cid) {\n if (cid > 0xffff) {\n throw new FormatError(\"Max size of CID is 65,535\");\n }\n // e) Map the CID obtained in step (a) according to the CMap\n // obtained in step (d), producing a Unicode value.\n const ucs2 = ucs2CMap.lookup(cid);\n if (ucs2) {\n buf.length = 0;\n // Support multi-byte entries (fixes issue16176.pdf).\n for (let i = 0, ii = ucs2.length; i < ii; i += 2) {\n buf.push((ucs2.charCodeAt(i) << 8) + ucs2.charCodeAt(i + 1));\n }\n toUnicode[charcode] = String.fromCharCode(...buf);\n }\n });\n return new ToUnicodeMap(toUnicode);\n }\n\n // The viewer's choice, just use an identity map.\n return new IdentityToUnicodeMap(properties.firstChar, properties.lastChar);\n }\n\n readToUnicode(cmapObj) {\n if (!cmapObj) {\n return Promise.resolve(null);\n }\n if (cmapObj instanceof Name) {\n return CMapFactory.create({\n encoding: cmapObj,\n fetchBuiltInCMap: this._fetchBuiltInCMapBound,\n useCMap: null,\n }).then(function (cmap) {\n if (cmap instanceof IdentityCMap) {\n return new IdentityToUnicodeMap(0, 0xffff);\n }\n return new ToUnicodeMap(cmap.getMap());\n });\n } else if (cmapObj instanceof BaseStream) {\n return CMapFactory.create({\n encoding: cmapObj,\n fetchBuiltInCMap: this._fetchBuiltInCMapBound,\n useCMap: null,\n }).then(\n function (cmap) {\n if (cmap instanceof IdentityCMap) {\n return new IdentityToUnicodeMap(0, 0xffff);\n }\n const map = new Array(cmap.length);\n // Convert UTF-16BE\n // NOTE: cmap can be a sparse array, so use forEach instead of\n // `for(;;)` to iterate over all keys.\n cmap.forEach(function (charCode, token) {\n // Some cmaps contain *only* CID characters (fixes issue9367.pdf).\n if (typeof token === \"number\") {\n map[charCode] = String.fromCodePoint(token);\n return;\n }\n const str = [];\n for (let k = 0; k < token.length; k += 2) {\n const w1 = (token.charCodeAt(k) << 8) | token.charCodeAt(k + 1);\n if ((w1 & 0xf800) !== 0xd800) {\n // w1 < 0xD800 || w1 > 0xDFFF\n str.push(w1);\n continue;\n }\n k += 2;\n const w2 = (token.charCodeAt(k) << 8) | token.charCodeAt(k + 1);\n str.push(((w1 & 0x3ff) << 10) + (w2 & 0x3ff) + 0x10000);\n }\n map[charCode] = String.fromCodePoint(...str);\n });\n return new ToUnicodeMap(map);\n },\n reason => {\n if (reason instanceof AbortException) {\n return null;\n }\n if (this.options.ignoreErrors) {\n warn(`readToUnicode - ignoring ToUnicode data: \"${reason}\".`);\n return null;\n }\n throw reason;\n }\n );\n }\n return Promise.resolve(null);\n }\n\n readCidToGidMap(glyphsData, toUnicode) {\n // Extract the encoding from the CIDToGIDMap\n\n // Set encoding 0 to later verify the font has an encoding\n const result = [];\n for (let j = 0, jj = glyphsData.length; j < jj; j++) {\n const glyphID = (glyphsData[j++] << 8) | glyphsData[j];\n const code = j >> 1;\n if (glyphID === 0 && !toUnicode.has(code)) {\n continue;\n }\n result[code] = glyphID;\n }\n return result;\n }\n\n extractWidths(dict, descriptor, properties) {\n const xref = this.xref;\n let glyphsWidths = [];\n let defaultWidth = 0;\n const glyphsVMetrics = [];\n let defaultVMetrics;\n let i, ii, j, jj, start, code, widths;\n if (properties.composite) {\n defaultWidth = dict.has(\"DW\") ? dict.get(\"DW\") : 1000;\n\n widths = dict.get(\"W\");\n if (widths) {\n for (i = 0, ii = widths.length; i < ii; i++) {\n start = xref.fetchIfRef(widths[i++]);\n code = xref.fetchIfRef(widths[i]);\n if (Array.isArray(code)) {\n for (j = 0, jj = code.length; j < jj; j++) {\n glyphsWidths[start++] = xref.fetchIfRef(code[j]);\n }\n } else {\n const width = xref.fetchIfRef(widths[++i]);\n for (j = start; j <= code; j++) {\n glyphsWidths[j] = width;\n }\n }\n }\n }\n\n if (properties.vertical) {\n let vmetrics = dict.getArray(\"DW2\") || [880, -1000];\n defaultVMetrics = [vmetrics[1], defaultWidth * 0.5, vmetrics[0]];\n vmetrics = dict.get(\"W2\");\n if (vmetrics) {\n for (i = 0, ii = vmetrics.length; i < ii; i++) {\n start = xref.fetchIfRef(vmetrics[i++]);\n code = xref.fetchIfRef(vmetrics[i]);\n if (Array.isArray(code)) {\n for (j = 0, jj = code.length; j < jj; j++) {\n glyphsVMetrics[start++] = [\n xref.fetchIfRef(code[j++]),\n xref.fetchIfRef(code[j++]),\n xref.fetchIfRef(code[j]),\n ];\n }\n } else {\n const vmetric = [\n xref.fetchIfRef(vmetrics[++i]),\n xref.fetchIfRef(vmetrics[++i]),\n xref.fetchIfRef(vmetrics[++i]),\n ];\n for (j = start; j <= code; j++) {\n glyphsVMetrics[j] = vmetric;\n }\n }\n }\n }\n }\n } else {\n const firstChar = properties.firstChar;\n widths = dict.get(\"Widths\");\n if (widths) {\n j = firstChar;\n for (i = 0, ii = widths.length; i < ii; i++) {\n glyphsWidths[j++] = xref.fetchIfRef(widths[i]);\n }\n defaultWidth = parseFloat(descriptor.get(\"MissingWidth\")) || 0;\n } else {\n // Trying get the BaseFont metrics (see comment above).\n const baseFontName = dict.get(\"BaseFont\");\n if (baseFontName instanceof Name) {\n const metrics = this.getBaseFontMetrics(baseFontName.name);\n\n glyphsWidths = this.buildCharCodeToWidth(metrics.widths, properties);\n defaultWidth = metrics.defaultWidth;\n }\n }\n }\n\n // Heuristic: detection of monospace font by checking all non-zero widths\n let isMonospace = true;\n let firstWidth = defaultWidth;\n for (const glyph in glyphsWidths) {\n const glyphWidth = glyphsWidths[glyph];\n if (!glyphWidth) {\n continue;\n }\n if (!firstWidth) {\n firstWidth = glyphWidth;\n continue;\n }\n if (firstWidth !== glyphWidth) {\n isMonospace = false;\n break;\n }\n }\n if (isMonospace) {\n properties.flags |= FontFlags.FixedPitch;\n } else {\n // Clear the flag.\n properties.flags &= ~FontFlags.FixedPitch;\n }\n\n properties.defaultWidth = defaultWidth;\n properties.widths = glyphsWidths;\n properties.defaultVMetrics = defaultVMetrics;\n properties.vmetrics = glyphsVMetrics;\n }\n\n isSerifFont(baseFontName) {\n // Simulating descriptor flags attribute\n const fontNameWoStyle = baseFontName.split(\"-\")[0];\n return (\n fontNameWoStyle in getSerifFonts() || /serif/gi.test(fontNameWoStyle)\n );\n }\n\n getBaseFontMetrics(name) {\n let defaultWidth = 0;\n let widths = Object.create(null);\n let monospace = false;\n const stdFontMap = getStdFontMap();\n let lookupName = stdFontMap[name] || name;\n const Metrics = getMetrics();\n\n if (!(lookupName in Metrics)) {\n // Use default fonts for looking up font metrics if the passed\n // font is not a base font\n lookupName = this.isSerifFont(name) ? \"Times-Roman\" : \"Helvetica\";\n }\n const glyphWidths = Metrics[lookupName];\n\n if (typeof glyphWidths === \"number\") {\n defaultWidth = glyphWidths;\n monospace = true;\n } else {\n widths = glyphWidths(); // expand lazy widths array\n }\n\n return {\n defaultWidth,\n monospace,\n widths,\n };\n }\n\n buildCharCodeToWidth(widthsByGlyphName, properties) {\n const widths = Object.create(null);\n const differences = properties.differences;\n const encoding = properties.defaultEncoding;\n for (let charCode = 0; charCode < 256; charCode++) {\n if (charCode in differences && widthsByGlyphName[differences[charCode]]) {\n widths[charCode] = widthsByGlyphName[differences[charCode]];\n continue;\n }\n if (charCode in encoding && widthsByGlyphName[encoding[charCode]]) {\n widths[charCode] = widthsByGlyphName[encoding[charCode]];\n continue;\n }\n }\n return widths;\n }\n\n preEvaluateFont(dict) {\n const baseDict = dict;\n let type = dict.get(\"Subtype\");\n if (!(type instanceof Name)) {\n throw new FormatError(\"invalid font Subtype\");\n }\n\n let composite = false;\n let hash, toUnicode;\n if (type.name === \"Type0\") {\n // If font is a composite\n // - get the descendant font\n // - set the type according to the descendant font\n // - get the FontDescriptor from the descendant font\n const df = dict.get(\"DescendantFonts\");\n if (!df) {\n throw new FormatError(\"Descendant fonts are not specified\");\n }\n dict = Array.isArray(df) ? this.xref.fetchIfRef(df[0]) : df;\n\n if (!(dict instanceof Dict)) {\n throw new FormatError(\"Descendant font is not a dictionary.\");\n }\n type = dict.get(\"Subtype\");\n if (!(type instanceof Name)) {\n throw new FormatError(\"invalid font Subtype\");\n }\n composite = true;\n }\n\n const firstChar = dict.get(\"FirstChar\") || 0,\n lastChar = dict.get(\"LastChar\") || (composite ? 0xffff : 0xff);\n const descriptor = dict.get(\"FontDescriptor\");\n if (descriptor) {\n hash = new MurmurHash3_64();\n\n const encoding = baseDict.getRaw(\"Encoding\");\n if (encoding instanceof Name) {\n hash.update(encoding.name);\n } else if (encoding instanceof Ref) {\n hash.update(encoding.toString());\n } else if (encoding instanceof Dict) {\n for (const entry of encoding.getRawValues()) {\n if (entry instanceof Name) {\n hash.update(entry.name);\n } else if (entry instanceof Ref) {\n hash.update(entry.toString());\n } else if (Array.isArray(entry)) {\n // 'Differences' array (fixes bug1157493.pdf).\n const diffLength = entry.length,\n diffBuf = new Array(diffLength);\n\n for (let j = 0; j < diffLength; j++) {\n const diffEntry = entry[j];\n if (diffEntry instanceof Name) {\n diffBuf[j] = diffEntry.name;\n } else if (\n typeof diffEntry === \"number\" ||\n diffEntry instanceof Ref\n ) {\n diffBuf[j] = diffEntry.toString();\n }\n }\n hash.update(diffBuf.join());\n }\n }\n }\n\n hash.update(`${firstChar}-${lastChar}`); // Fixes issue10665_reduced.pdf\n\n toUnicode = dict.get(\"ToUnicode\") || baseDict.get(\"ToUnicode\");\n if (toUnicode instanceof BaseStream) {\n const stream = toUnicode.str || toUnicode;\n const uint8array = stream.buffer\n ? new Uint8Array(stream.buffer.buffer, 0, stream.bufferLength)\n : new Uint8Array(\n stream.bytes.buffer,\n stream.start,\n stream.end - stream.start\n );\n hash.update(uint8array);\n } else if (toUnicode instanceof Name) {\n hash.update(toUnicode.name);\n }\n\n const widths = dict.get(\"Widths\") || baseDict.get(\"Widths\");\n if (Array.isArray(widths)) {\n const widthsBuf = [];\n for (const entry of widths) {\n if (typeof entry === \"number\" || entry instanceof Ref) {\n widthsBuf.push(entry.toString());\n }\n }\n hash.update(widthsBuf.join());\n }\n\n if (composite) {\n hash.update(\"compositeFont\");\n\n const compositeWidths = dict.get(\"W\") || baseDict.get(\"W\");\n if (Array.isArray(compositeWidths)) {\n const widthsBuf = [];\n for (const entry of compositeWidths) {\n if (typeof entry === \"number\" || entry instanceof Ref) {\n widthsBuf.push(entry.toString());\n } else if (Array.isArray(entry)) {\n const subWidthsBuf = [];\n for (const element of entry) {\n if (typeof element === \"number\" || element instanceof Ref) {\n subWidthsBuf.push(element.toString());\n }\n }\n widthsBuf.push(`[${subWidthsBuf.join()}]`);\n }\n }\n hash.update(widthsBuf.join());\n }\n\n const cidToGidMap =\n dict.getRaw(\"CIDToGIDMap\") || baseDict.getRaw(\"CIDToGIDMap\");\n if (cidToGidMap instanceof Name) {\n hash.update(cidToGidMap.name);\n } else if (cidToGidMap instanceof Ref) {\n hash.update(cidToGidMap.toString());\n } else if (cidToGidMap instanceof BaseStream) {\n hash.update(cidToGidMap.peekBytes());\n }\n }\n }\n\n return {\n descriptor,\n dict,\n baseDict,\n composite,\n type: type.name,\n firstChar,\n lastChar,\n toUnicode,\n hash: hash ? hash.hexdigest() : \"\",\n };\n }\n\n async translateFont({\n descriptor,\n dict,\n baseDict,\n composite,\n type,\n firstChar,\n lastChar,\n toUnicode,\n cssFontInfo,\n }) {\n const isType3Font = type === \"Type3\";\n let properties;\n\n if (!descriptor) {\n if (isType3Font) {\n // FontDescriptor is only required for Type3 fonts when the document\n // is a tagged pdf. Create a barbebones one to get by.\n descriptor = new Dict(null);\n descriptor.set(\"FontName\", Name.get(type));\n descriptor.set(\"FontBBox\", dict.getArray(\"FontBBox\") || [0, 0, 0, 0]);\n } else {\n // Before PDF 1.5 if the font was one of the base 14 fonts, having a\n // FontDescriptor was not required.\n // This case is here for compatibility.\n let baseFontName = dict.get(\"BaseFont\");\n if (!(baseFontName instanceof Name)) {\n throw new FormatError(\"Base font is not specified\");\n }\n\n // Using base font name as a font name.\n baseFontName = baseFontName.name.replaceAll(/[,_]/g, \"-\");\n const metrics = this.getBaseFontMetrics(baseFontName);\n\n // Simulating descriptor flags attribute\n const fontNameWoStyle = baseFontName.split(\"-\")[0];\n const flags =\n (this.isSerifFont(fontNameWoStyle) ? FontFlags.Serif : 0) |\n (metrics.monospace ? FontFlags.FixedPitch : 0) |\n (getSymbolsFonts()[fontNameWoStyle]\n ? FontFlags.Symbolic\n : FontFlags.Nonsymbolic);\n\n properties = {\n type,\n name: baseFontName,\n loadedName: baseDict.loadedName,\n systemFontInfo: null,\n widths: metrics.widths,\n defaultWidth: metrics.defaultWidth,\n isSimulatedFlags: true,\n flags,\n firstChar,\n lastChar,\n toUnicode,\n xHeight: 0,\n capHeight: 0,\n italicAngle: 0,\n isType3Font,\n };\n const widths = dict.get(\"Widths\");\n\n const standardFontName = getStandardFontName(baseFontName);\n let file = null;\n if (standardFontName) {\n file = await this.fetchStandardFontData(standardFontName);\n properties.isInternalFont = !!file;\n }\n if (!properties.isInternalFont && this.options.useSystemFonts) {\n properties.systemFontInfo = getFontSubstitution(\n this.systemFontCache,\n this.idFactory,\n this.options.standardFontDataUrl,\n baseFontName,\n standardFontName\n );\n }\n return this.extractDataStructures(dict, dict, properties).then(\n newProperties => {\n if (widths) {\n const glyphWidths = [];\n let j = firstChar;\n for (const width of widths) {\n glyphWidths[j++] = this.xref.fetchIfRef(width);\n }\n newProperties.widths = glyphWidths;\n } else {\n newProperties.widths = this.buildCharCodeToWidth(\n metrics.widths,\n newProperties\n );\n }\n return new Font(baseFontName, file, newProperties);\n }\n );\n }\n }\n\n // According to the spec if 'FontDescriptor' is declared, 'FirstChar',\n // 'LastChar' and 'Widths' should exist too, but some PDF encoders seem\n // to ignore this rule when a variant of a standard font is used.\n // TODO Fill the width array depending on which of the base font this is\n // a variant.\n\n let fontName = descriptor.get(\"FontName\");\n let baseFont = dict.get(\"BaseFont\");\n // Some bad PDFs have a string as the font name.\n if (typeof fontName === \"string\") {\n fontName = Name.get(fontName);\n }\n if (typeof baseFont === \"string\") {\n baseFont = Name.get(baseFont);\n }\n\n const fontNameStr = fontName?.name;\n const baseFontStr = baseFont?.name;\n if (!isType3Font && fontNameStr !== baseFontStr) {\n info(\n `The FontDescriptor's FontName is \"${fontNameStr}\" but ` +\n `should be the same as the Font's BaseFont \"${baseFontStr}\".`\n );\n // - Workaround for cases where e.g. fontNameStr = 'Arial' and\n // baseFontStr = 'Arial,Bold' (needed when no font file is embedded).\n //\n // - Workaround for cases where e.g. fontNameStr = 'wg09np' and\n // baseFontStr = 'Wingdings-Regular' (fixes issue7454.pdf).\n if (\n fontNameStr &&\n baseFontStr &&\n (baseFontStr.startsWith(fontNameStr) ||\n (!isKnownFontName(fontNameStr) && isKnownFontName(baseFontStr)))\n ) {\n fontName = null;\n }\n }\n fontName ||= baseFont;\n\n if (!(fontName instanceof Name)) {\n throw new FormatError(\"invalid font name\");\n }\n\n let fontFile, subtype, length1, length2, length3;\n try {\n fontFile = descriptor.get(\"FontFile\", \"FontFile2\", \"FontFile3\");\n } catch (ex) {\n if (!this.options.ignoreErrors) {\n throw ex;\n }\n warn(`translateFont - fetching \"${fontName.name}\" font file: \"${ex}\".`);\n fontFile = new NullStream();\n }\n let isInternalFont = false;\n let glyphScaleFactors = null;\n let systemFontInfo = null;\n if (fontFile) {\n if (fontFile.dict) {\n const subtypeEntry = fontFile.dict.get(\"Subtype\");\n if (subtypeEntry instanceof Name) {\n subtype = subtypeEntry.name;\n }\n length1 = fontFile.dict.get(\"Length1\");\n length2 = fontFile.dict.get(\"Length2\");\n length3 = fontFile.dict.get(\"Length3\");\n }\n } else if (cssFontInfo) {\n // We've a missing XFA font.\n const standardFontName = getXfaFontName(fontName.name);\n if (standardFontName) {\n cssFontInfo.fontFamily = `${cssFontInfo.fontFamily}-PdfJS-XFA`;\n cssFontInfo.metrics = standardFontName.metrics || null;\n glyphScaleFactors = standardFontName.factors || null;\n fontFile = await this.fetchStandardFontData(standardFontName.name);\n isInternalFont = !!fontFile;\n\n // We're using a substitution font but for example widths (if any)\n // are related to the glyph positions in the font.\n // So we overwrite everything here to be sure that widths are\n // correct.\n baseDict = dict = getXfaFontDict(fontName.name);\n composite = true;\n }\n } else if (!isType3Font) {\n const standardFontName = getStandardFontName(fontName.name);\n if (standardFontName) {\n fontFile = await this.fetchStandardFontData(standardFontName);\n isInternalFont = !!fontFile;\n }\n if (!isInternalFont && this.options.useSystemFonts) {\n systemFontInfo = getFontSubstitution(\n this.systemFontCache,\n this.idFactory,\n this.options.standardFontDataUrl,\n fontName.name,\n standardFontName\n );\n }\n }\n\n properties = {\n type,\n name: fontName.name,\n subtype,\n file: fontFile,\n length1,\n length2,\n length3,\n isInternalFont,\n loadedName: baseDict.loadedName,\n composite,\n fixedPitch: false,\n fontMatrix: dict.getArray(\"FontMatrix\") || FONT_IDENTITY_MATRIX,\n firstChar,\n lastChar,\n toUnicode,\n bbox: descriptor.getArray(\"FontBBox\") || dict.getArray(\"FontBBox\"),\n ascent: descriptor.get(\"Ascent\"),\n descent: descriptor.get(\"Descent\"),\n xHeight: descriptor.get(\"XHeight\") || 0,\n capHeight: descriptor.get(\"CapHeight\") || 0,\n flags: descriptor.get(\"Flags\"),\n italicAngle: descriptor.get(\"ItalicAngle\") || 0,\n isType3Font,\n cssFontInfo,\n scaleFactors: glyphScaleFactors,\n systemFontInfo,\n };\n\n if (composite) {\n const cidEncoding = baseDict.get(\"Encoding\");\n if (cidEncoding instanceof Name) {\n properties.cidEncoding = cidEncoding.name;\n }\n const cMap = await CMapFactory.create({\n encoding: cidEncoding,\n fetchBuiltInCMap: this._fetchBuiltInCMapBound,\n useCMap: null,\n });\n properties.cMap = cMap;\n properties.vertical = properties.cMap.vertical;\n }\n\n return this.extractDataStructures(dict, baseDict, properties).then(\n newProperties => {\n this.extractWidths(dict, descriptor, newProperties);\n\n return new Font(fontName.name, fontFile, newProperties);\n }\n );\n }\n\n static buildFontPaths(font, glyphs, handler, evaluatorOptions) {\n function buildPath(fontChar) {\n const glyphName = `${font.loadedName}_path_${fontChar}`;\n try {\n if (font.renderer.hasBuiltPath(fontChar)) {\n return;\n }\n handler.send(\"commonobj\", [\n glyphName,\n \"FontPath\",\n font.renderer.getPathJs(fontChar),\n ]);\n } catch (reason) {\n if (evaluatorOptions.ignoreErrors) {\n warn(`buildFontPaths - ignoring ${glyphName} glyph: \"${reason}\".`);\n return;\n }\n throw reason;\n }\n }\n\n for (const glyph of glyphs) {\n buildPath(glyph.fontChar);\n\n // If the glyph has an accent we need to build a path for its\n // fontChar too, otherwise CanvasGraphics_paintChar will fail.\n const accent = glyph.accent;\n if (accent?.fontChar) {\n buildPath(accent.fontChar);\n }\n }\n }\n\n static get fallbackFontDict() {\n const dict = new Dict();\n dict.set(\"BaseFont\", Name.get(\"Helvetica\"));\n dict.set(\"Type\", Name.get(\"FallbackType\"));\n dict.set(\"Subtype\", Name.get(\"FallbackType\"));\n dict.set(\"Encoding\", Name.get(\"WinAnsiEncoding\"));\n\n return shadow(this, \"fallbackFontDict\", dict);\n }\n}\n\nclass TranslatedFont {\n constructor({ loadedName, font, dict, evaluatorOptions }) {\n this.loadedName = loadedName;\n this.font = font;\n this.dict = dict;\n this._evaluatorOptions = evaluatorOptions || DefaultPartialEvaluatorOptions;\n this.type3Loaded = null;\n this.type3Dependencies = font.isType3Font ? new Set() : null;\n this.sent = false;\n }\n\n send(handler) {\n if (this.sent) {\n return;\n }\n this.sent = true;\n\n handler.send(\"commonobj\", [\n this.loadedName,\n \"Font\",\n this.font.exportData(this._evaluatorOptions.fontExtraProperties),\n ]);\n }\n\n fallback(handler) {\n if (!this.font.data) {\n return;\n }\n // When font loading failed, fall back to the built-in font renderer.\n this.font.disableFontFace = true;\n // An arbitrary number of text rendering operators could have been\n // encountered between the point in time when the 'Font' message was sent\n // to the main-thread, and the point in time when the 'FontFallback'\n // message was received on the worker-thread.\n // To ensure that all 'FontPath's are available on the main-thread, when\n // font loading failed, attempt to resend *all* previously parsed glyphs.\n PartialEvaluator.buildFontPaths(\n this.font,\n /* glyphs = */ this.font.glyphCacheValues,\n handler,\n this._evaluatorOptions\n );\n }\n\n loadType3Data(evaluator, resources, task) {\n if (this.type3Loaded) {\n return this.type3Loaded;\n }\n if (!this.font.isType3Font) {\n throw new Error(\"Must be a Type3 font.\");\n }\n // When parsing Type3 glyphs, always ignore them if there are errors.\n // Compared to the parsing of e.g. an entire page, it doesn't really\n // make sense to only be able to render a Type3 glyph partially.\n const type3Evaluator = evaluator.clone({ ignoreErrors: false });\n type3Evaluator.parsingType3Font = true;\n // Prevent circular references in Type3 fonts.\n const type3FontRefs = new RefSet(evaluator.type3FontRefs);\n if (this.dict.objId && !type3FontRefs.has(this.dict.objId)) {\n type3FontRefs.put(this.dict.objId);\n }\n type3Evaluator.type3FontRefs = type3FontRefs;\n\n const translatedFont = this.font,\n type3Dependencies = this.type3Dependencies;\n let loadCharProcsPromise = Promise.resolve();\n const charProcs = this.dict.get(\"CharProcs\");\n const fontResources = this.dict.get(\"Resources\") || resources;\n const charProcOperatorList = Object.create(null);\n\n const fontBBox = Util.normalizeRect(translatedFont.bbox || [0, 0, 0, 0]),\n width = fontBBox[2] - fontBBox[0],\n height = fontBBox[3] - fontBBox[1];\n const fontBBoxSize = Math.hypot(width, height);\n\n for (const key of charProcs.getKeys()) {\n loadCharProcsPromise = loadCharProcsPromise.then(() => {\n const glyphStream = charProcs.get(key);\n const operatorList = new OperatorList();\n return type3Evaluator\n .getOperatorList({\n stream: glyphStream,\n task,\n resources: fontResources,\n operatorList,\n })\n .then(() => {\n // According to the PDF specification, section \"9.6.5 Type 3 Fonts\"\n // and \"Table 113\":\n // \"A glyph description that begins with the d1 operator should\n // not execute any operators that set the colour (or other\n // colour-related parameters) in the graphics state;\n // any use of such operators shall be ignored.\"\n if (operatorList.fnArray[0] === OPS.setCharWidthAndBounds) {\n this._removeType3ColorOperators(operatorList, fontBBoxSize);\n }\n charProcOperatorList[key] = operatorList.getIR();\n\n for (const dependency of operatorList.dependencies) {\n type3Dependencies.add(dependency);\n }\n })\n .catch(function (reason) {\n warn(`Type3 font resource \"${key}\" is not available.`);\n const dummyOperatorList = new OperatorList();\n charProcOperatorList[key] = dummyOperatorList.getIR();\n });\n });\n }\n this.type3Loaded = loadCharProcsPromise.then(() => {\n translatedFont.charProcOperatorList = charProcOperatorList;\n if (this._bbox) {\n translatedFont.isCharBBox = true;\n translatedFont.bbox = this._bbox;\n }\n });\n return this.type3Loaded;\n }\n\n /**\n * @private\n */\n _removeType3ColorOperators(operatorList, fontBBoxSize = NaN) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n operatorList.fnArray[0] === OPS.setCharWidthAndBounds,\n \"Type3 glyph shall start with the d1 operator.\"\n );\n }\n const charBBox = Util.normalizeRect(operatorList.argsArray[0].slice(2)),\n width = charBBox[2] - charBBox[0],\n height = charBBox[3] - charBBox[1];\n const charBBoxSize = Math.hypot(width, height);\n\n if (width === 0 || height === 0) {\n // Skip the d1 operator when its bounds are bogus (fixes issue14953.pdf).\n operatorList.fnArray.splice(0, 1);\n operatorList.argsArray.splice(0, 1);\n } else if (\n fontBBoxSize === 0 ||\n Math.round(charBBoxSize / fontBBoxSize) >= 10\n ) {\n // Override the fontBBox when it's undefined/empty, or when it's at least\n // (approximately) one order of magnitude smaller than the charBBox\n // (fixes issue14999_reduced.pdf).\n if (!this._bbox) {\n this._bbox = [Infinity, Infinity, -Infinity, -Infinity];\n }\n this._bbox[0] = Math.min(this._bbox[0], charBBox[0]);\n this._bbox[1] = Math.min(this._bbox[1], charBBox[1]);\n this._bbox[2] = Math.max(this._bbox[2], charBBox[2]);\n this._bbox[3] = Math.max(this._bbox[3], charBBox[3]);\n }\n\n let i = 0,\n ii = operatorList.length;\n while (i < ii) {\n switch (operatorList.fnArray[i]) {\n case OPS.setCharWidthAndBounds:\n break; // Handled above.\n case OPS.setStrokeColorSpace:\n case OPS.setFillColorSpace:\n case OPS.setStrokeColor:\n case OPS.setStrokeColorN:\n case OPS.setFillColor:\n case OPS.setFillColorN:\n case OPS.setStrokeGray:\n case OPS.setFillGray:\n case OPS.setStrokeRGBColor:\n case OPS.setFillRGBColor:\n case OPS.setStrokeCMYKColor:\n case OPS.setFillCMYKColor:\n case OPS.shadingFill:\n case OPS.setRenderingIntent:\n operatorList.fnArray.splice(i, 1);\n operatorList.argsArray.splice(i, 1);\n ii--;\n continue;\n\n case OPS.setGState:\n const [gStateObj] = operatorList.argsArray[i];\n let j = 0,\n jj = gStateObj.length;\n while (j < jj) {\n const [gStateKey] = gStateObj[j];\n switch (gStateKey) {\n case \"TR\":\n case \"TR2\":\n case \"HT\":\n case \"BG\":\n case \"BG2\":\n case \"UCR\":\n case \"UCR2\":\n gStateObj.splice(j, 1);\n jj--;\n continue;\n }\n j++;\n }\n break;\n }\n i++;\n }\n }\n}\n\nclass StateManager {\n constructor(initialState = new EvalState()) {\n this.state = initialState;\n this.stateStack = [];\n }\n\n save() {\n const old = this.state;\n this.stateStack.push(this.state);\n this.state = old.clone();\n }\n\n restore() {\n const prev = this.stateStack.pop();\n if (prev) {\n this.state = prev;\n }\n }\n\n transform(args) {\n this.state.ctm = Util.transform(this.state.ctm, args);\n }\n}\n\nclass TextState {\n constructor() {\n this.ctm = new Float32Array(IDENTITY_MATRIX);\n this.fontName = null;\n this.fontSize = 0;\n this.loadedName = null;\n this.font = null;\n this.fontMatrix = FONT_IDENTITY_MATRIX;\n this.textMatrix = IDENTITY_MATRIX.slice();\n this.textLineMatrix = IDENTITY_MATRIX.slice();\n this.charSpacing = 0;\n this.wordSpacing = 0;\n this.leading = 0;\n this.textHScale = 1;\n this.textRise = 0;\n }\n\n setTextMatrix(a, b, c, d, e, f) {\n const m = this.textMatrix;\n m[0] = a;\n m[1] = b;\n m[2] = c;\n m[3] = d;\n m[4] = e;\n m[5] = f;\n }\n\n setTextLineMatrix(a, b, c, d, e, f) {\n const m = this.textLineMatrix;\n m[0] = a;\n m[1] = b;\n m[2] = c;\n m[3] = d;\n m[4] = e;\n m[5] = f;\n }\n\n translateTextMatrix(x, y) {\n const m = this.textMatrix;\n m[4] = m[0] * x + m[2] * y + m[4];\n m[5] = m[1] * x + m[3] * y + m[5];\n }\n\n translateTextLineMatrix(x, y) {\n const m = this.textLineMatrix;\n m[4] = m[0] * x + m[2] * y + m[4];\n m[5] = m[1] * x + m[3] * y + m[5];\n }\n\n carriageReturn() {\n this.translateTextLineMatrix(0, -this.leading);\n this.textMatrix = this.textLineMatrix.slice();\n }\n\n clone() {\n const clone = Object.create(this);\n clone.textMatrix = this.textMatrix.slice();\n clone.textLineMatrix = this.textLineMatrix.slice();\n clone.fontMatrix = this.fontMatrix.slice();\n return clone;\n }\n}\n\nclass EvalState {\n constructor() {\n this.ctm = new Float32Array(IDENTITY_MATRIX);\n this.font = null;\n this.textRenderingMode = TextRenderingMode.FILL;\n this.fillColorSpace = ColorSpace.singletons.gray;\n this.strokeColorSpace = ColorSpace.singletons.gray;\n }\n\n clone() {\n return Object.create(this);\n }\n}\n\nclass EvaluatorPreprocessor {\n static get opMap() {\n // Specifies properties for each command\n //\n // If variableArgs === true: [0, `numArgs`] expected\n // If variableArgs === false: exactly `numArgs` expected\n return shadow(this, \"opMap\", {\n // Graphic state\n w: { id: OPS.setLineWidth, numArgs: 1, variableArgs: false },\n J: { id: OPS.setLineCap, numArgs: 1, variableArgs: false },\n j: { id: OPS.setLineJoin, numArgs: 1, variableArgs: false },\n M: { id: OPS.setMiterLimit, numArgs: 1, variableArgs: false },\n d: { id: OPS.setDash, numArgs: 2, variableArgs: false },\n ri: { id: OPS.setRenderingIntent, numArgs: 1, variableArgs: false },\n i: { id: OPS.setFlatness, numArgs: 1, variableArgs: false },\n gs: { id: OPS.setGState, numArgs: 1, variableArgs: false },\n q: { id: OPS.save, numArgs: 0, variableArgs: false },\n Q: { id: OPS.restore, numArgs: 0, variableArgs: false },\n cm: { id: OPS.transform, numArgs: 6, variableArgs: false },\n\n // Path\n m: { id: OPS.moveTo, numArgs: 2, variableArgs: false },\n l: { id: OPS.lineTo, numArgs: 2, variableArgs: false },\n c: { id: OPS.curveTo, numArgs: 6, variableArgs: false },\n v: { id: OPS.curveTo2, numArgs: 4, variableArgs: false },\n y: { id: OPS.curveTo3, numArgs: 4, variableArgs: false },\n h: { id: OPS.closePath, numArgs: 0, variableArgs: false },\n re: { id: OPS.rectangle, numArgs: 4, variableArgs: false },\n S: { id: OPS.stroke, numArgs: 0, variableArgs: false },\n s: { id: OPS.closeStroke, numArgs: 0, variableArgs: false },\n f: { id: OPS.fill, numArgs: 0, variableArgs: false },\n F: { id: OPS.fill, numArgs: 0, variableArgs: false },\n \"f*\": { id: OPS.eoFill, numArgs: 0, variableArgs: false },\n B: { id: OPS.fillStroke, numArgs: 0, variableArgs: false },\n \"B*\": { id: OPS.eoFillStroke, numArgs: 0, variableArgs: false },\n b: { id: OPS.closeFillStroke, numArgs: 0, variableArgs: false },\n \"b*\": { id: OPS.closeEOFillStroke, numArgs: 0, variableArgs: false },\n n: { id: OPS.endPath, numArgs: 0, variableArgs: false },\n\n // Clipping\n W: { id: OPS.clip, numArgs: 0, variableArgs: false },\n \"W*\": { id: OPS.eoClip, numArgs: 0, variableArgs: false },\n\n // Text\n BT: { id: OPS.beginText, numArgs: 0, variableArgs: false },\n ET: { id: OPS.endText, numArgs: 0, variableArgs: false },\n Tc: { id: OPS.setCharSpacing, numArgs: 1, variableArgs: false },\n Tw: { id: OPS.setWordSpacing, numArgs: 1, variableArgs: false },\n Tz: { id: OPS.setHScale, numArgs: 1, variableArgs: false },\n TL: { id: OPS.setLeading, numArgs: 1, variableArgs: false },\n Tf: { id: OPS.setFont, numArgs: 2, variableArgs: false },\n Tr: { id: OPS.setTextRenderingMode, numArgs: 1, variableArgs: false },\n Ts: { id: OPS.setTextRise, numArgs: 1, variableArgs: false },\n Td: { id: OPS.moveText, numArgs: 2, variableArgs: false },\n TD: { id: OPS.setLeadingMoveText, numArgs: 2, variableArgs: false },\n Tm: { id: OPS.setTextMatrix, numArgs: 6, variableArgs: false },\n \"T*\": { id: OPS.nextLine, numArgs: 0, variableArgs: false },\n Tj: { id: OPS.showText, numArgs: 1, variableArgs: false },\n TJ: { id: OPS.showSpacedText, numArgs: 1, variableArgs: false },\n \"'\": { id: OPS.nextLineShowText, numArgs: 1, variableArgs: false },\n '\"': {\n id: OPS.nextLineSetSpacingShowText,\n numArgs: 3,\n variableArgs: false,\n },\n\n // Type3 fonts\n d0: { id: OPS.setCharWidth, numArgs: 2, variableArgs: false },\n d1: {\n id: OPS.setCharWidthAndBounds,\n numArgs: 6,\n variableArgs: false,\n },\n\n // Color\n CS: { id: OPS.setStrokeColorSpace, numArgs: 1, variableArgs: false },\n cs: { id: OPS.setFillColorSpace, numArgs: 1, variableArgs: false },\n SC: { id: OPS.setStrokeColor, numArgs: 4, variableArgs: true },\n SCN: { id: OPS.setStrokeColorN, numArgs: 33, variableArgs: true },\n sc: { id: OPS.setFillColor, numArgs: 4, variableArgs: true },\n scn: { id: OPS.setFillColorN, numArgs: 33, variableArgs: true },\n G: { id: OPS.setStrokeGray, numArgs: 1, variableArgs: false },\n g: { id: OPS.setFillGray, numArgs: 1, variableArgs: false },\n RG: { id: OPS.setStrokeRGBColor, numArgs: 3, variableArgs: false },\n rg: { id: OPS.setFillRGBColor, numArgs: 3, variableArgs: false },\n K: { id: OPS.setStrokeCMYKColor, numArgs: 4, variableArgs: false },\n k: { id: OPS.setFillCMYKColor, numArgs: 4, variableArgs: false },\n\n // Shading\n sh: { id: OPS.shadingFill, numArgs: 1, variableArgs: false },\n\n // Images\n BI: { id: OPS.beginInlineImage, numArgs: 0, variableArgs: false },\n ID: { id: OPS.beginImageData, numArgs: 0, variableArgs: false },\n EI: { id: OPS.endInlineImage, numArgs: 1, variableArgs: false },\n\n // XObjects\n Do: { id: OPS.paintXObject, numArgs: 1, variableArgs: false },\n MP: { id: OPS.markPoint, numArgs: 1, variableArgs: false },\n DP: { id: OPS.markPointProps, numArgs: 2, variableArgs: false },\n BMC: { id: OPS.beginMarkedContent, numArgs: 1, variableArgs: false },\n BDC: {\n id: OPS.beginMarkedContentProps,\n numArgs: 2,\n variableArgs: false,\n },\n EMC: { id: OPS.endMarkedContent, numArgs: 0, variableArgs: false },\n\n // Compatibility\n BX: { id: OPS.beginCompat, numArgs: 0, variableArgs: false },\n EX: { id: OPS.endCompat, numArgs: 0, variableArgs: false },\n\n // (reserved partial commands for the lexer)\n BM: null,\n BD: null,\n true: null,\n fa: null,\n fal: null,\n fals: null,\n false: null,\n nu: null,\n nul: null,\n null: null,\n });\n }\n\n static MAX_INVALID_PATH_OPS = 10;\n\n constructor(stream, xref, stateManager = new StateManager()) {\n // TODO(mduan): pass array of knownCommands rather than this.opMap\n // dictionary\n this.parser = new Parser({\n lexer: new Lexer(stream, EvaluatorPreprocessor.opMap),\n xref,\n });\n this.stateManager = stateManager;\n this.nonProcessedArgs = [];\n this._isPathOp = false;\n this._numInvalidPathOPS = 0;\n }\n\n get savedStatesDepth() {\n return this.stateManager.stateStack.length;\n }\n\n // |operation| is an object with two fields:\n //\n // - |fn| is an out param.\n //\n // - |args| is an inout param. On entry, it should have one of two values.\n //\n // - An empty array. This indicates that the caller is providing the\n // array in which the args will be stored in. The caller should use\n // this value if it can reuse a single array for each call to read().\n //\n // - |null|. This indicates that the caller needs this function to create\n // the array in which any args are stored in. If there are zero args,\n // this function will leave |operation.args| as |null| (thus avoiding\n // allocations that would occur if we used an empty array to represent\n // zero arguments). Otherwise, it will replace |null| with a new array\n // containing the arguments. The caller should use this value if it\n // cannot reuse an array for each call to read().\n //\n // These two modes are present because this function is very hot and so\n // avoiding allocations where possible is worthwhile.\n //\n read(operation) {\n let args = operation.args;\n while (true) {\n const obj = this.parser.getObj();\n if (obj instanceof Cmd) {\n const cmd = obj.cmd;\n // Check that the command is valid\n const opSpec = EvaluatorPreprocessor.opMap[cmd];\n if (!opSpec) {\n warn(`Unknown command \"${cmd}\".`);\n continue;\n }\n\n const fn = opSpec.id;\n const numArgs = opSpec.numArgs;\n let argsLength = args !== null ? args.length : 0;\n\n // If the *previous* command wasn't a path operator, reset the heuristic\n // used with incomplete path operators below (fixes issue14917.pdf).\n if (!this._isPathOp) {\n this._numInvalidPathOPS = 0;\n }\n this._isPathOp = fn >= OPS.moveTo && fn <= OPS.endPath;\n\n if (!opSpec.variableArgs) {\n // Postscript commands can be nested, e.g. /F2 /GS2 gs 5.711 Tf\n if (argsLength !== numArgs) {\n const nonProcessedArgs = this.nonProcessedArgs;\n while (argsLength > numArgs) {\n nonProcessedArgs.push(args.shift());\n argsLength--;\n }\n while (argsLength < numArgs && nonProcessedArgs.length !== 0) {\n if (args === null) {\n args = [];\n }\n args.unshift(nonProcessedArgs.pop());\n argsLength++;\n }\n }\n\n if (argsLength < numArgs) {\n const partialMsg =\n `command ${cmd}: expected ${numArgs} args, ` +\n `but received ${argsLength} args.`;\n\n // Incomplete path operators, in particular, can result in fairly\n // chaotic rendering artifacts. Hence the following heuristics is\n // used to error, rather than just warn, once a number of invalid\n // path operators have been encountered (fixes bug1443140.pdf).\n if (\n this._isPathOp &&\n ++this._numInvalidPathOPS >\n EvaluatorPreprocessor.MAX_INVALID_PATH_OPS\n ) {\n throw new FormatError(`Invalid ${partialMsg}`);\n }\n // If we receive too few arguments, it's not possible to execute\n // the command, hence we skip the command.\n warn(`Skipping ${partialMsg}`);\n if (args !== null) {\n args.length = 0;\n }\n continue;\n }\n } else if (argsLength > numArgs) {\n info(\n `Command ${cmd}: expected [0, ${numArgs}] args, ` +\n `but received ${argsLength} args.`\n );\n }\n\n // TODO figure out how to type-check vararg functions\n this.preprocessCommand(fn, args);\n\n operation.fn = fn;\n operation.args = args;\n return true;\n }\n if (obj === EOF) {\n return false; // no more commands\n }\n // argument\n if (obj !== null) {\n if (args === null) {\n args = [];\n }\n args.push(obj);\n if (args.length > 33) {\n throw new FormatError(\"Too many arguments\");\n }\n }\n }\n }\n\n preprocessCommand(fn, args) {\n switch (fn | 0) {\n case OPS.save:\n this.stateManager.save();\n break;\n case OPS.restore:\n this.stateManager.restore();\n break;\n case OPS.transform:\n this.stateManager.transform(args);\n break;\n }\n }\n}\n\nexport { EvaluatorPreprocessor, PartialEvaluator };\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 { Dict, Name } from \"./primitives.js\";\nimport {\n escapePDFName,\n getRotationMatrix,\n numberToString,\n stringToUTF16HexString,\n} from \"./core_utils.js\";\nimport {\n LINE_DESCENT_FACTOR,\n LINE_FACTOR,\n OPS,\n shadow,\n warn,\n} from \"../shared/util.js\";\nimport { ColorSpace } from \"./colorspace.js\";\nimport { EvaluatorPreprocessor } from \"./evaluator.js\";\nimport { LocalColorSpaceCache } from \"./image_utils.js\";\nimport { PDFFunctionFactory } from \"./function.js\";\nimport { StringStream } from \"./stream.js\";\n\nclass DefaultAppearanceEvaluator extends EvaluatorPreprocessor {\n constructor(str) {\n super(new StringStream(str));\n }\n\n parse() {\n const operation = {\n fn: 0,\n args: [],\n };\n const result = {\n fontSize: 0,\n fontName: \"\",\n fontColor: /* black = */ new Uint8ClampedArray(3),\n };\n\n try {\n while (true) {\n operation.args.length = 0; // Ensure that `args` it's always reset.\n\n if (!this.read(operation)) {\n break;\n }\n if (this.savedStatesDepth !== 0) {\n continue; // Don't get info in save/restore sections.\n }\n const { fn, args } = operation;\n\n switch (fn | 0) {\n case OPS.setFont:\n const [fontName, fontSize] = args;\n if (fontName instanceof Name) {\n result.fontName = fontName.name;\n }\n if (typeof fontSize === \"number\" && fontSize > 0) {\n result.fontSize = fontSize;\n }\n break;\n case OPS.setFillRGBColor:\n ColorSpace.singletons.rgb.getRgbItem(args, 0, result.fontColor, 0);\n break;\n case OPS.setFillGray:\n ColorSpace.singletons.gray.getRgbItem(args, 0, result.fontColor, 0);\n break;\n case OPS.setFillCMYKColor:\n ColorSpace.singletons.cmyk.getRgbItem(args, 0, result.fontColor, 0);\n break;\n }\n }\n } catch (reason) {\n warn(`parseDefaultAppearance - ignoring errors: \"${reason}\".`);\n }\n\n return result;\n }\n}\n\n// Parse DA to extract font and color information.\nfunction parseDefaultAppearance(str) {\n return new DefaultAppearanceEvaluator(str).parse();\n}\n\nclass AppearanceStreamEvaluator extends EvaluatorPreprocessor {\n constructor(stream, evaluatorOptions, xref) {\n super(stream);\n this.stream = stream;\n this.evaluatorOptions = evaluatorOptions;\n this.xref = xref;\n\n this.resources = stream.dict?.get(\"Resources\");\n }\n\n parse() {\n const operation = {\n fn: 0,\n args: [],\n };\n let result = {\n scaleFactor: 1,\n fontSize: 0,\n fontName: \"\",\n fontColor: /* black = */ new Uint8ClampedArray(3),\n fillColorSpace: ColorSpace.singletons.gray,\n };\n let breakLoop = false;\n const stack = [];\n\n try {\n while (true) {\n operation.args.length = 0; // Ensure that `args` it's always reset.\n\n if (breakLoop || !this.read(operation)) {\n break;\n }\n const { fn, args } = operation;\n\n switch (fn | 0) {\n case OPS.save:\n stack.push({\n scaleFactor: result.scaleFactor,\n fontSize: result.fontSize,\n fontName: result.fontName,\n fontColor: result.fontColor.slice(),\n fillColorSpace: result.fillColorSpace,\n });\n break;\n case OPS.restore:\n result = stack.pop() || result;\n break;\n case OPS.setTextMatrix:\n result.scaleFactor *= Math.hypot(args[0], args[1]);\n break;\n case OPS.setFont:\n const [fontName, fontSize] = args;\n if (fontName instanceof Name) {\n result.fontName = fontName.name;\n }\n if (typeof fontSize === \"number\" && fontSize > 0) {\n result.fontSize = fontSize * result.scaleFactor;\n }\n break;\n case OPS.setFillColorSpace:\n result.fillColorSpace = ColorSpace.parse({\n cs: args[0],\n xref: this.xref,\n resources: this.resources,\n pdfFunctionFactory: this._pdfFunctionFactory,\n localColorSpaceCache: this._localColorSpaceCache,\n });\n break;\n case OPS.setFillColor:\n const cs = result.fillColorSpace;\n cs.getRgbItem(args, 0, result.fontColor, 0);\n break;\n case OPS.setFillRGBColor:\n ColorSpace.singletons.rgb.getRgbItem(args, 0, result.fontColor, 0);\n break;\n case OPS.setFillGray:\n ColorSpace.singletons.gray.getRgbItem(args, 0, result.fontColor, 0);\n break;\n case OPS.setFillCMYKColor:\n ColorSpace.singletons.cmyk.getRgbItem(args, 0, result.fontColor, 0);\n break;\n case OPS.showText:\n case OPS.showSpacedText:\n case OPS.nextLineShowText:\n case OPS.nextLineSetSpacingShowText:\n breakLoop = true;\n break;\n }\n }\n } catch (reason) {\n warn(`parseAppearanceStream - ignoring errors: \"${reason}\".`);\n }\n this.stream.reset();\n delete result.scaleFactor;\n delete result.fillColorSpace;\n\n return result;\n }\n\n get _localColorSpaceCache() {\n return shadow(this, \"_localColorSpaceCache\", new LocalColorSpaceCache());\n }\n\n get _pdfFunctionFactory() {\n const pdfFunctionFactory = new PDFFunctionFactory({\n xref: this.xref,\n isEvalSupported: this.evaluatorOptions.isEvalSupported,\n });\n return shadow(this, \"_pdfFunctionFactory\", pdfFunctionFactory);\n }\n}\n\n// Parse appearance stream to extract font and color information.\n// It returns the font properties used to render the first text object.\nfunction parseAppearanceStream(stream, evaluatorOptions, xref) {\n return new AppearanceStreamEvaluator(stream, evaluatorOptions, xref).parse();\n}\n\nfunction getPdfColor(color, isFill) {\n if (color[0] === color[1] && color[1] === color[2]) {\n const gray = color[0] / 255;\n return `${numberToString(gray)} ${isFill ? \"g\" : \"G\"}`;\n }\n return (\n Array.from(color, c => numberToString(c / 255)).join(\" \") +\n ` ${isFill ? \"rg\" : \"RG\"}`\n );\n}\n\n// Create default appearance string from some information.\nfunction createDefaultAppearance({ fontSize, fontName, fontColor }) {\n return `/${escapePDFName(fontName)} ${fontSize} Tf ${getPdfColor(\n fontColor,\n /* isFill */ true\n )}`;\n}\n\nclass FakeUnicodeFont {\n constructor(xref, fontFamily) {\n this.xref = xref;\n this.widths = null;\n this.firstChar = Infinity;\n this.lastChar = -Infinity;\n this.fontFamily = fontFamily;\n\n const canvas = new OffscreenCanvas(1, 1);\n this.ctxMeasure = canvas.getContext(\"2d\");\n\n if (!FakeUnicodeFont._fontNameId) {\n FakeUnicodeFont._fontNameId = 1;\n }\n this.fontName = Name.get(\n `InvalidPDFjsFont_${fontFamily}_${FakeUnicodeFont._fontNameId++}`\n );\n }\n\n get toUnicodeRef() {\n if (!FakeUnicodeFont._toUnicodeRef) {\n const toUnicode = `/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo\n<< /Registry (Adobe)\n/Ordering (UCS) /Supplement 0 >> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000> <FFFF>\nendcodespacerange\n1 beginbfrange\n<0000> <FFFF> <0000>\nendbfrange\nendcmap CMapName currentdict /CMap defineresource pop end end`;\n const toUnicodeStream = (FakeUnicodeFont.toUnicodeStream =\n new StringStream(toUnicode));\n const toUnicodeDict = new Dict(this.xref);\n toUnicodeStream.dict = toUnicodeDict;\n toUnicodeDict.set(\"Length\", toUnicode.length);\n FakeUnicodeFont._toUnicodeRef =\n this.xref.getNewPersistentRef(toUnicodeStream);\n }\n\n return FakeUnicodeFont._toUnicodeRef;\n }\n\n get fontDescriptorRef() {\n if (!FakeUnicodeFont._fontDescriptorRef) {\n const fontDescriptor = new Dict(this.xref);\n fontDescriptor.set(\"Type\", Name.get(\"FontDescriptor\"));\n fontDescriptor.set(\"FontName\", this.fontName);\n fontDescriptor.set(\"FontFamily\", \"MyriadPro Regular\");\n fontDescriptor.set(\"FontBBox\", [0, 0, 0, 0]);\n fontDescriptor.set(\"FontStretch\", Name.get(\"Normal\"));\n fontDescriptor.set(\"FontWeight\", 400);\n fontDescriptor.set(\"ItalicAngle\", 0);\n\n FakeUnicodeFont._fontDescriptorRef =\n this.xref.getNewPersistentRef(fontDescriptor);\n }\n\n return FakeUnicodeFont._fontDescriptorRef;\n }\n\n get descendantFontRef() {\n const descendantFont = new Dict(this.xref);\n descendantFont.set(\"BaseFont\", this.fontName);\n descendantFont.set(\"Type\", Name.get(\"Font\"));\n descendantFont.set(\"Subtype\", Name.get(\"CIDFontType0\"));\n descendantFont.set(\"CIDToGIDMap\", Name.get(\"Identity\"));\n descendantFont.set(\"FirstChar\", this.firstChar);\n descendantFont.set(\"LastChar\", this.lastChar);\n descendantFont.set(\"FontDescriptor\", this.fontDescriptorRef);\n descendantFont.set(\"DW\", 1000);\n\n const widths = [];\n const chars = [...this.widths.entries()].sort();\n let currentChar = null;\n let currentWidths = null;\n for (const [char, width] of chars) {\n if (!currentChar) {\n currentChar = char;\n currentWidths = [width];\n continue;\n }\n if (char === currentChar + currentWidths.length) {\n currentWidths.push(width);\n } else {\n widths.push(currentChar, currentWidths);\n currentChar = char;\n currentWidths = [width];\n }\n }\n\n if (currentChar) {\n widths.push(currentChar, currentWidths);\n }\n\n descendantFont.set(\"W\", widths);\n\n const cidSystemInfo = new Dict(this.xref);\n cidSystemInfo.set(\"Ordering\", \"Identity\");\n cidSystemInfo.set(\"Registry\", \"Adobe\");\n cidSystemInfo.set(\"Supplement\", 0);\n descendantFont.set(\"CIDSystemInfo\", cidSystemInfo);\n\n return this.xref.getNewPersistentRef(descendantFont);\n }\n\n get baseFontRef() {\n const baseFont = new Dict(this.xref);\n baseFont.set(\"BaseFont\", this.fontName);\n baseFont.set(\"Type\", Name.get(\"Font\"));\n baseFont.set(\"Subtype\", Name.get(\"Type0\"));\n baseFont.set(\"Encoding\", Name.get(\"Identity-H\"));\n baseFont.set(\"DescendantFonts\", [this.descendantFontRef]);\n baseFont.set(\"ToUnicode\", this.toUnicodeRef);\n\n return this.xref.getNewPersistentRef(baseFont);\n }\n\n get resources() {\n const resources = new Dict(this.xref);\n const font = new Dict(this.xref);\n font.set(this.fontName.name, this.baseFontRef);\n resources.set(\"Font\", font);\n\n return resources;\n }\n\n _createContext() {\n this.widths = new Map();\n this.ctxMeasure.font = `1000px ${this.fontFamily}`;\n\n return this.ctxMeasure;\n }\n\n createFontResources(text) {\n const ctx = this._createContext();\n for (const line of text.split(/\\r\\n?|\\n/)) {\n for (const char of line.split(\"\")) {\n const code = char.charCodeAt(0);\n if (this.widths.has(code)) {\n continue;\n }\n const metrics = ctx.measureText(char);\n const width = Math.ceil(metrics.width);\n this.widths.set(code, width);\n this.firstChar = Math.min(code, this.firstChar);\n this.lastChar = Math.max(code, this.lastChar);\n }\n }\n\n return this.resources;\n }\n\n createAppearance(text, rect, rotation, fontSize, bgColor, strokeAlpha) {\n const ctx = this._createContext();\n const lines = [];\n let maxWidth = -Infinity;\n for (const line of text.split(/\\r\\n?|\\n/)) {\n lines.push(line);\n // The line width isn't the sum of the char widths, because in some\n // languages, like arabic, it'd be wrong because of ligatures.\n const lineWidth = ctx.measureText(line).width;\n maxWidth = Math.max(maxWidth, lineWidth);\n for (const char of line.split(\"\")) {\n const code = char.charCodeAt(0);\n let width = this.widths.get(code);\n if (width === undefined) {\n const metrics = ctx.measureText(char);\n width = Math.ceil(metrics.width);\n this.widths.set(code, width);\n this.firstChar = Math.min(code, this.firstChar);\n this.lastChar = Math.max(code, this.lastChar);\n }\n }\n }\n maxWidth *= fontSize / 1000;\n\n const [x1, y1, x2, y2] = rect;\n let w = x2 - x1;\n let h = y2 - y1;\n\n if (rotation % 180 !== 0) {\n [w, h] = [h, w];\n }\n\n let hscale = 1;\n if (maxWidth > w) {\n hscale = w / maxWidth;\n }\n let vscale = 1;\n const lineHeight = LINE_FACTOR * fontSize;\n const lineDescent = LINE_DESCENT_FACTOR * fontSize;\n const maxHeight = lineHeight * lines.length;\n if (maxHeight > h) {\n vscale = h / maxHeight;\n }\n const fscale = Math.min(hscale, vscale);\n const newFontSize = fontSize * fscale;\n\n const buffer = [\n \"q\",\n `0 0 ${numberToString(w)} ${numberToString(h)} re W n`,\n `BT`,\n `1 0 0 1 0 ${numberToString(h + lineDescent)} Tm 0 Tc ${getPdfColor(\n bgColor,\n /* isFill */ true\n )}`,\n `/${this.fontName.name} ${numberToString(newFontSize)} Tf`,\n ];\n\n const { resources } = this;\n strokeAlpha =\n typeof strokeAlpha === \"number\" && strokeAlpha >= 0 && strokeAlpha <= 1\n ? strokeAlpha\n : 1;\n\n if (strokeAlpha !== 1) {\n buffer.push(\"/R0 gs\");\n const extGState = new Dict(this.xref);\n const r0 = new Dict(this.xref);\n r0.set(\"ca\", strokeAlpha);\n r0.set(\"CA\", strokeAlpha);\n r0.set(\"Type\", Name.get(\"ExtGState\"));\n extGState.set(\"R0\", r0);\n resources.set(\"ExtGState\", extGState);\n }\n\n const vShift = numberToString(lineHeight);\n for (const line of lines) {\n buffer.push(`0 -${vShift} Td <${stringToUTF16HexString(line)}> Tj`);\n }\n buffer.push(\"ET\", \"Q\");\n const appearance = buffer.join(\"\\n\");\n\n const appearanceStreamDict = new Dict(this.xref);\n appearanceStreamDict.set(\"Subtype\", Name.get(\"Form\"));\n appearanceStreamDict.set(\"Type\", Name.get(\"XObject\"));\n appearanceStreamDict.set(\"BBox\", [0, 0, w, h]);\n appearanceStreamDict.set(\"Length\", appearance.length);\n appearanceStreamDict.set(\"Resources\", resources);\n\n if (rotation) {\n const matrix = getRotationMatrix(rotation, w, h);\n appearanceStreamDict.set(\"Matrix\", matrix);\n }\n\n const ap = new StringStream(appearance);\n ap.dict = appearanceStreamDict;\n\n return ap;\n }\n}\n\nexport {\n createDefaultAppearance,\n FakeUnicodeFont,\n getPdfColor,\n parseAppearanceStream,\n parseDefaultAppearance,\n};\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Dict, RefSet } from \"./primitives.js\";\nimport { FormatError, unreachable, warn } from \"../shared/util.js\";\n\n/**\n * A NameTree/NumberTree is like a Dict but has some advantageous properties,\n * see the specification (7.9.6 and 7.9.7) for additional details.\n * TODO: implement all the Dict functions and make this more efficient.\n */\nclass NameOrNumberTree {\n constructor(root, xref, type) {\n if (this.constructor === NameOrNumberTree) {\n unreachable(\"Cannot initialize NameOrNumberTree.\");\n }\n this.root = root;\n this.xref = xref;\n this._type = type;\n }\n\n getAll() {\n const map = new Map();\n if (!this.root) {\n return map;\n }\n const xref = this.xref;\n // Reading Name/Number tree.\n const processed = new RefSet();\n processed.put(this.root);\n const queue = [this.root];\n while (queue.length > 0) {\n const obj = xref.fetchIfRef(queue.shift());\n if (!(obj instanceof Dict)) {\n continue;\n }\n if (obj.has(\"Kids\")) {\n const kids = obj.get(\"Kids\");\n if (!Array.isArray(kids)) {\n continue;\n }\n for (const kid of kids) {\n if (processed.has(kid)) {\n throw new FormatError(`Duplicate entry in \"${this._type}\" tree.`);\n }\n queue.push(kid);\n processed.put(kid);\n }\n continue;\n }\n const entries = obj.get(this._type);\n if (!Array.isArray(entries)) {\n continue;\n }\n for (let i = 0, ii = entries.length; i < ii; i += 2) {\n map.set(xref.fetchIfRef(entries[i]), xref.fetchIfRef(entries[i + 1]));\n }\n }\n return map;\n }\n\n get(key) {\n if (!this.root) {\n return null;\n }\n const xref = this.xref;\n let kidsOrEntries = xref.fetchIfRef(this.root);\n let loopCount = 0;\n const MAX_LEVELS = 10;\n\n // Perform a binary search to quickly find the entry that\n // contains the key we are looking for.\n while (kidsOrEntries.has(\"Kids\")) {\n if (++loopCount > MAX_LEVELS) {\n warn(`Search depth limit reached for \"${this._type}\" tree.`);\n return null;\n }\n\n const kids = kidsOrEntries.get(\"Kids\");\n if (!Array.isArray(kids)) {\n return null;\n }\n\n let l = 0,\n r = kids.length - 1;\n while (l <= r) {\n const m = (l + r) >> 1;\n const kid = xref.fetchIfRef(kids[m]);\n const limits = kid.get(\"Limits\");\n\n if (key < xref.fetchIfRef(limits[0])) {\n r = m - 1;\n } else if (key > xref.fetchIfRef(limits[1])) {\n l = m + 1;\n } else {\n kidsOrEntries = kid;\n break;\n }\n }\n if (l > r) {\n return null;\n }\n }\n\n // If we get here, then we have found the right entry. Now go through the\n // entries in the dictionary until we find the key we're looking for.\n const entries = kidsOrEntries.get(this._type);\n if (Array.isArray(entries)) {\n // Perform a binary search to reduce the lookup time.\n let l = 0,\n r = entries.length - 2;\n while (l <= r) {\n // Check only even indices (0, 2, 4, ...) because the\n // odd indices contain the actual data.\n const tmp = (l + r) >> 1,\n m = tmp + (tmp & 1);\n const currentKey = xref.fetchIfRef(entries[m]);\n if (key < currentKey) {\n r = m - 2;\n } else if (key > currentKey) {\n l = m + 2;\n } else {\n return xref.fetchIfRef(entries[m + 1]);\n }\n }\n }\n return null;\n }\n}\n\nclass NameTree extends NameOrNumberTree {\n constructor(root, xref) {\n super(root, xref, \"Names\");\n }\n}\n\nclass NumberTree extends NameOrNumberTree {\n constructor(root, xref) {\n super(root, xref, \"Nums\");\n }\n}\n\nexport { NameTree, NumberTree };\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 { clearPatternCaches } from \"./pattern.js\";\nimport { clearPrimitiveCaches } from \"./primitives.js\";\nimport { clearUnicodeCaches } from \"./unicode.js\";\n\nfunction clearGlobalCaches() {\n clearPatternCaches();\n clearPrimitiveCaches();\n clearUnicodeCaches();\n}\n\nexport { clearGlobalCaches };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { stringToPDFString, warn } from \"../shared/util.js\";\nimport { BaseStream } from \"./base_stream.js\";\nimport { Dict } from \"./primitives.js\";\n\nfunction pickPlatformItem(dict) {\n // Look for the filename in this order:\n // UF, F, Unix, Mac, DOS\n if (dict.has(\"UF\")) {\n return dict.get(\"UF\");\n } else if (dict.has(\"F\")) {\n return dict.get(\"F\");\n } else if (dict.has(\"Unix\")) {\n return dict.get(\"Unix\");\n } else if (dict.has(\"Mac\")) {\n return dict.get(\"Mac\");\n } else if (dict.has(\"DOS\")) {\n return dict.get(\"DOS\");\n }\n return null;\n}\n\n/**\n * \"A PDF file can refer to the contents of another file by using a File\n * Specification (PDF 1.1)\", see the spec (7.11) for more details.\n * NOTE: Only embedded files are supported (as part of the attachments support)\n * TODO: support the 'URL' file system (with caching if !/V), portable\n * collections attributes and related files (/RF)\n */\nclass FileSpec {\n constructor(root, xref) {\n if (!(root instanceof Dict)) {\n return;\n }\n this.xref = xref;\n this.root = root;\n if (root.has(\"FS\")) {\n this.fs = root.get(\"FS\");\n }\n this.description = root.has(\"Desc\")\n ? stringToPDFString(root.get(\"Desc\"))\n : \"\";\n if (root.has(\"RF\")) {\n warn(\"Related file specifications are not supported\");\n }\n this.contentAvailable = true;\n if (!root.has(\"EF\")) {\n this.contentAvailable = false;\n warn(\"Non-embedded file specifications are not supported\");\n }\n }\n\n get filename() {\n if (!this._filename && this.root) {\n const filename = pickPlatformItem(this.root) || \"unnamed\";\n this._filename = stringToPDFString(filename)\n .replaceAll(\"\\\\\\\\\", \"\\\\\")\n .replaceAll(\"\\\\/\", \"/\")\n .replaceAll(\"\\\\\", \"/\");\n }\n return this._filename;\n }\n\n get content() {\n if (!this.contentAvailable) {\n return null;\n }\n if (!this.contentRef && this.root) {\n this.contentRef = pickPlatformItem(this.root.get(\"EF\"));\n }\n let content = null;\n if (this.contentRef) {\n const fileObj = this.xref.fetchIfRef(this.contentRef);\n if (fileObj instanceof BaseStream) {\n content = fileObj.getBytes();\n } else {\n warn(\n \"Embedded file specification points to non-existing/invalid content\"\n );\n }\n } else {\n warn(\"Embedded file specification does not have a content\");\n }\n return content;\n }\n\n get serializable() {\n return {\n filename: this.filename,\n content: this.content,\n };\n }\n}\n\nexport { FileSpec };\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// The code for XMLParserBase copied from\n// https://github.com/mozilla/shumway/blob/16451d8836fa85f4b16eeda8b4bda2fa9e2b22b0/src/avm2/natives/xml.ts\n\nimport { encodeToXmlString } from \"./core_utils.js\";\n\nconst XMLParserErrorCode = {\n NoError: 0,\n EndOfDocument: -1,\n UnterminatedCdat: -2,\n UnterminatedXmlDeclaration: -3,\n UnterminatedDoctypeDeclaration: -4,\n UnterminatedComment: -5,\n MalformedElement: -6,\n OutOfMemory: -7,\n UnterminatedAttributeValue: -8,\n UnterminatedElement: -9,\n ElementNeverBegun: -10,\n};\n\nfunction isWhitespace(s, index) {\n const ch = s[index];\n return ch === \" \" || ch === \"\\n\" || ch === \"\\r\" || ch === \"\\t\";\n}\n\nfunction isWhitespaceString(s) {\n for (let i = 0, ii = s.length; i < ii; i++) {\n if (!isWhitespace(s, i)) {\n return false;\n }\n }\n return true;\n}\n\nclass XMLParserBase {\n _resolveEntities(s) {\n return s.replaceAll(/&([^;]+);/g, (all, entity) => {\n if (entity.substring(0, 2) === \"#x\") {\n return String.fromCodePoint(parseInt(entity.substring(2), 16));\n } else if (entity.substring(0, 1) === \"#\") {\n return String.fromCodePoint(parseInt(entity.substring(1), 10));\n }\n switch (entity) {\n case \"lt\":\n return \"<\";\n case \"gt\":\n return \">\";\n case \"amp\":\n return \"&\";\n case \"quot\":\n return '\"';\n case \"apos\":\n return \"'\";\n }\n return this.onResolveEntity(entity);\n });\n }\n\n _parseContent(s, start) {\n const attributes = [];\n let pos = start;\n\n function skipWs() {\n while (pos < s.length && isWhitespace(s, pos)) {\n ++pos;\n }\n }\n\n while (\n pos < s.length &&\n !isWhitespace(s, pos) &&\n s[pos] !== \">\" &&\n s[pos] !== \"/\"\n ) {\n ++pos;\n }\n const name = s.substring(start, pos);\n skipWs();\n while (\n pos < s.length &&\n s[pos] !== \">\" &&\n s[pos] !== \"/\" &&\n s[pos] !== \"?\"\n ) {\n skipWs();\n let attrName = \"\",\n attrValue = \"\";\n while (pos < s.length && !isWhitespace(s, pos) && s[pos] !== \"=\") {\n attrName += s[pos];\n ++pos;\n }\n skipWs();\n if (s[pos] !== \"=\") {\n return null;\n }\n ++pos;\n skipWs();\n const attrEndChar = s[pos];\n if (attrEndChar !== '\"' && attrEndChar !== \"'\") {\n return null;\n }\n const attrEndIndex = s.indexOf(attrEndChar, ++pos);\n if (attrEndIndex < 0) {\n return null;\n }\n attrValue = s.substring(pos, attrEndIndex);\n attributes.push({\n name: attrName,\n value: this._resolveEntities(attrValue),\n });\n pos = attrEndIndex + 1;\n skipWs();\n }\n return {\n name,\n attributes,\n parsed: pos - start,\n };\n }\n\n _parseProcessingInstruction(s, start) {\n let pos = start;\n\n function skipWs() {\n while (pos < s.length && isWhitespace(s, pos)) {\n ++pos;\n }\n }\n\n while (\n pos < s.length &&\n !isWhitespace(s, pos) &&\n s[pos] !== \">\" &&\n s[pos] !== \"?\" &&\n s[pos] !== \"/\"\n ) {\n ++pos;\n }\n const name = s.substring(start, pos);\n skipWs();\n const attrStart = pos;\n while (pos < s.length && (s[pos] !== \"?\" || s[pos + 1] !== \">\")) {\n ++pos;\n }\n const value = s.substring(attrStart, pos);\n return {\n name,\n value,\n parsed: pos - start,\n };\n }\n\n parseXml(s) {\n let i = 0;\n while (i < s.length) {\n const ch = s[i];\n let j = i;\n if (ch === \"<\") {\n ++j;\n const ch2 = s[j];\n let q;\n switch (ch2) {\n case \"/\":\n ++j;\n q = s.indexOf(\">\", j);\n if (q < 0) {\n this.onError(XMLParserErrorCode.UnterminatedElement);\n return;\n }\n this.onEndElement(s.substring(j, q));\n j = q + 1;\n break;\n case \"?\":\n ++j;\n const pi = this._parseProcessingInstruction(s, j);\n if (s.substring(j + pi.parsed, j + pi.parsed + 2) !== \"?>\") {\n this.onError(XMLParserErrorCode.UnterminatedXmlDeclaration);\n return;\n }\n this.onPi(pi.name, pi.value);\n j += pi.parsed + 2;\n break;\n case \"!\":\n if (s.substring(j + 1, j + 3) === \"--\") {\n q = s.indexOf(\"-->\", j + 3);\n if (q < 0) {\n this.onError(XMLParserErrorCode.UnterminatedComment);\n return;\n }\n this.onComment(s.substring(j + 3, q));\n j = q + 3;\n } else if (s.substring(j + 1, j + 8) === \"[CDATA[\") {\n q = s.indexOf(\"]]>\", j + 8);\n if (q < 0) {\n this.onError(XMLParserErrorCode.UnterminatedCdat);\n return;\n }\n this.onCdata(s.substring(j + 8, q));\n j = q + 3;\n } else if (s.substring(j + 1, j + 8) === \"DOCTYPE\") {\n const q2 = s.indexOf(\"[\", j + 8);\n let complexDoctype = false;\n q = s.indexOf(\">\", j + 8);\n if (q < 0) {\n this.onError(XMLParserErrorCode.UnterminatedDoctypeDeclaration);\n return;\n }\n if (q2 > 0 && q > q2) {\n q = s.indexOf(\"]>\", j + 8);\n if (q < 0) {\n this.onError(\n XMLParserErrorCode.UnterminatedDoctypeDeclaration\n );\n return;\n }\n complexDoctype = true;\n }\n const doctypeContent = s.substring(\n j + 8,\n q + (complexDoctype ? 1 : 0)\n );\n this.onDoctype(doctypeContent);\n j = q + (complexDoctype ? 2 : 1);\n } else {\n this.onError(XMLParserErrorCode.MalformedElement);\n return;\n }\n break;\n default:\n const content = this._parseContent(s, j);\n if (content === null) {\n this.onError(XMLParserErrorCode.MalformedElement);\n return;\n }\n let isClosed = false;\n if (\n s.substring(j + content.parsed, j + content.parsed + 2) === \"/>\"\n ) {\n isClosed = true;\n } else if (\n s.substring(j + content.parsed, j + content.parsed + 1) !== \">\"\n ) {\n this.onError(XMLParserErrorCode.UnterminatedElement);\n return;\n }\n this.onBeginElement(content.name, content.attributes, isClosed);\n j += content.parsed + (isClosed ? 2 : 1);\n break;\n }\n } else {\n while (j < s.length && s[j] !== \"<\") {\n j++;\n }\n const text = s.substring(i, j);\n this.onText(this._resolveEntities(text));\n }\n i = j;\n }\n }\n\n onResolveEntity(name) {\n return `&${name};`;\n }\n\n onPi(name, value) {}\n\n onComment(text) {}\n\n onCdata(text) {}\n\n onDoctype(doctypeContent) {}\n\n onText(text) {}\n\n onBeginElement(name, attributes, isEmpty) {}\n\n onEndElement(name) {}\n\n onError(code) {}\n}\n\nclass SimpleDOMNode {\n constructor(nodeName, nodeValue) {\n this.nodeName = nodeName;\n this.nodeValue = nodeValue;\n\n Object.defineProperty(this, \"parentNode\", { value: null, writable: true });\n }\n\n get firstChild() {\n return this.childNodes?.[0];\n }\n\n get nextSibling() {\n const childNodes = this.parentNode.childNodes;\n if (!childNodes) {\n return undefined;\n }\n const index = childNodes.indexOf(this);\n if (index === -1) {\n return undefined;\n }\n return childNodes[index + 1];\n }\n\n get textContent() {\n if (!this.childNodes) {\n return this.nodeValue || \"\";\n }\n return this.childNodes\n .map(function (child) {\n return child.textContent;\n })\n .join(\"\");\n }\n\n get children() {\n return this.childNodes || [];\n }\n\n hasChildNodes() {\n return this.childNodes?.length > 0;\n }\n\n /**\n * Search a node in the tree with the given path\n * foo.bar[nnn], i.e. find the nnn-th node named\n * bar under a node named foo.\n *\n * @param {Array} paths - an array of objects as\n * returned by {parseXFAPath}.\n * @param {number} pos - the current position in\n * the paths array.\n * @returns {SimpleDOMNode} The node corresponding\n * to the path or null if not found.\n */\n searchNode(paths, pos) {\n if (pos >= paths.length) {\n return this;\n }\n\n const component = paths[pos];\n if (component.name.startsWith(\"#\") && pos < paths.length - 1) {\n // If it starts with a # then it's a class which is not a concept for\n // datasets elements (https://www.pdfa.org/norm-refs/XFA-3_3.pdf#page=96).\n return this.searchNode(paths, pos + 1);\n }\n const stack = [];\n let node = this;\n\n while (true) {\n if (component.name === node.nodeName) {\n if (component.pos === 0) {\n const res = node.searchNode(paths, pos + 1);\n if (res !== null) {\n return res;\n }\n } else if (stack.length === 0) {\n return null;\n } else {\n const [parent] = stack.pop();\n let siblingPos = 0;\n for (const child of parent.childNodes) {\n if (component.name === child.nodeName) {\n if (siblingPos === component.pos) {\n return child.searchNode(paths, pos + 1);\n }\n siblingPos++;\n }\n }\n // We didn't find the correct sibling\n // so just return the first found node\n return node.searchNode(paths, pos + 1);\n }\n }\n\n if (node.childNodes?.length > 0) {\n stack.push([node, 0]);\n node = node.childNodes[0];\n } else if (stack.length === 0) {\n return null;\n } else {\n while (stack.length !== 0) {\n const [parent, currentPos] = stack.pop();\n const newPos = currentPos + 1;\n if (newPos < parent.childNodes.length) {\n stack.push([parent, newPos]);\n node = parent.childNodes[newPos];\n break;\n }\n }\n if (stack.length === 0) {\n return null;\n }\n }\n }\n }\n\n dump(buffer) {\n if (this.nodeName === \"#text\") {\n buffer.push(encodeToXmlString(this.nodeValue));\n return;\n }\n\n buffer.push(`<${this.nodeName}`);\n if (this.attributes) {\n for (const attribute of this.attributes) {\n buffer.push(\n ` ${attribute.name}=\"${encodeToXmlString(attribute.value)}\"`\n );\n }\n }\n if (this.hasChildNodes()) {\n buffer.push(\">\");\n for (const child of this.childNodes) {\n child.dump(buffer);\n }\n buffer.push(`</${this.nodeName}>`);\n } else if (this.nodeValue) {\n buffer.push(`>${encodeToXmlString(this.nodeValue)}</${this.nodeName}>`);\n } else {\n buffer.push(\"/>\");\n }\n }\n}\n\nclass SimpleXMLParser extends XMLParserBase {\n constructor({ hasAttributes = false, lowerCaseName = false }) {\n super();\n this._currentFragment = null;\n this._stack = null;\n this._errorCode = XMLParserErrorCode.NoError;\n this._hasAttributes = hasAttributes;\n this._lowerCaseName = lowerCaseName;\n }\n\n parseFromString(data) {\n this._currentFragment = [];\n this._stack = [];\n this._errorCode = XMLParserErrorCode.NoError;\n\n this.parseXml(data);\n\n if (this._errorCode !== XMLParserErrorCode.NoError) {\n return undefined; // return undefined on error\n }\n\n // We should only have one root.\n const [documentElement] = this._currentFragment;\n if (!documentElement) {\n return undefined; // Return undefined if no root was found.\n }\n return { documentElement };\n }\n\n onText(text) {\n if (isWhitespaceString(text)) {\n return;\n }\n const node = new SimpleDOMNode(\"#text\", text);\n this._currentFragment.push(node);\n }\n\n onCdata(text) {\n const node = new SimpleDOMNode(\"#text\", text);\n this._currentFragment.push(node);\n }\n\n onBeginElement(name, attributes, isEmpty) {\n if (this._lowerCaseName) {\n name = name.toLowerCase();\n }\n const node = new SimpleDOMNode(name);\n node.childNodes = [];\n if (this._hasAttributes) {\n node.attributes = attributes;\n }\n this._currentFragment.push(node);\n if (isEmpty) {\n return;\n }\n this._stack.push(this._currentFragment);\n this._currentFragment = node.childNodes;\n }\n\n onEndElement(name) {\n this._currentFragment = this._stack.pop() || [];\n const lastElement = this._currentFragment.at(-1);\n if (!lastElement) {\n return null;\n }\n for (const childNode of lastElement.childNodes) {\n childNode.parentNode = lastElement;\n }\n return lastElement;\n }\n\n onError(code) {\n this._errorCode = code;\n }\n}\n\nexport { SimpleDOMNode, SimpleXMLParser, XMLParserBase, XMLParserErrorCode };\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 { SimpleXMLParser } from \"./xml_parser.js\";\n\nclass MetadataParser {\n constructor(data) {\n // Ghostscript may produce invalid metadata, so try to repair that first.\n data = this._repair(data);\n\n // Convert the string to an XML document.\n const parser = new SimpleXMLParser({ lowerCaseName: true });\n const xmlDocument = parser.parseFromString(data);\n\n this._metadataMap = new Map();\n this._data = data;\n\n if (xmlDocument) {\n this._parse(xmlDocument);\n }\n }\n\n _repair(data) {\n // Start by removing any \"junk\" before the first tag (see issue 10395).\n return data\n .replace(/^[^<]+/, \"\")\n .replaceAll(/>\\\\376\\\\377([^<]+)/g, function (all, codes) {\n const bytes = codes\n .replaceAll(/\\\\([0-3])([0-7])([0-7])/g, function (code, d1, d2, d3) {\n return String.fromCharCode(d1 * 64 + d2 * 8 + d3 * 1);\n })\n .replaceAll(/&(amp|apos|gt|lt|quot);/g, function (str, name) {\n switch (name) {\n case \"amp\":\n return \"&\";\n case \"apos\":\n return \"'\";\n case \"gt\":\n return \">\";\n case \"lt\":\n return \"<\";\n case \"quot\":\n return '\"';\n }\n throw new Error(`_repair: ${name} isn't defined.`);\n });\n\n const charBuf = [\">\"];\n for (let i = 0, ii = bytes.length; i < ii; i += 2) {\n const code = bytes.charCodeAt(i) * 256 + bytes.charCodeAt(i + 1);\n if (\n code >= /* Space = */ 32 &&\n code < /* Delete = */ 127 &&\n code !== /* '<' = */ 60 &&\n code !== /* '>' = */ 62 &&\n code !== /* '&' = */ 38\n ) {\n charBuf.push(String.fromCharCode(code));\n } else {\n charBuf.push(\n \"&#x\" + (0x10000 + code).toString(16).substring(1) + \";\"\n );\n }\n }\n return charBuf.join(\"\");\n });\n }\n\n _getSequence(entry) {\n const name = entry.nodeName;\n if (name !== \"rdf:bag\" && name !== \"rdf:seq\" && name !== \"rdf:alt\") {\n return null;\n }\n return entry.childNodes.filter(node => node.nodeName === \"rdf:li\");\n }\n\n _parseArray(entry) {\n if (!entry.hasChildNodes()) {\n return;\n }\n // Child must be a Bag (unordered array) or a Seq.\n const [seqNode] = entry.childNodes;\n const sequence = this._getSequence(seqNode) || [];\n\n this._metadataMap.set(\n entry.nodeName,\n sequence.map(node => node.textContent.trim())\n );\n }\n\n _parse(xmlDocument) {\n let rdf = xmlDocument.documentElement;\n\n if (rdf.nodeName !== \"rdf:rdf\") {\n // Wrapped in <xmpmeta>\n rdf = rdf.firstChild;\n while (rdf && rdf.nodeName !== \"rdf:rdf\") {\n rdf = rdf.nextSibling;\n }\n }\n\n if (!rdf || rdf.nodeName !== \"rdf:rdf\" || !rdf.hasChildNodes()) {\n return;\n }\n\n for (const desc of rdf.childNodes) {\n if (desc.nodeName !== \"rdf:description\") {\n continue;\n }\n\n for (const entry of desc.childNodes) {\n const name = entry.nodeName;\n switch (name) {\n case \"#text\":\n continue;\n case \"dc:creator\":\n case \"dc:subject\":\n this._parseArray(entry);\n continue;\n }\n this._metadataMap.set(name, entry.textContent.trim());\n }\n }\n }\n\n get serializable() {\n return {\n parsedData: this._metadataMap,\n rawData: this._data,\n };\n }\n}\n\nexport { MetadataParser };\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 { DecodeStream } from \"./decode_stream.js\";\n\nconst chunkSize = 512;\n\nclass DecryptStream extends DecodeStream {\n constructor(str, maybeLength, decrypt) {\n super(maybeLength);\n\n this.str = str;\n this.dict = str.dict;\n this.decrypt = decrypt;\n this.nextChunk = null;\n this.initialized = false;\n }\n\n readBlock() {\n let chunk;\n if (this.initialized) {\n chunk = this.nextChunk;\n } else {\n chunk = this.str.getBytes(chunkSize);\n this.initialized = true;\n }\n if (!chunk || chunk.length === 0) {\n this.eof = true;\n return;\n }\n this.nextChunk = this.str.getBytes(chunkSize);\n const hasMoreData = this.nextChunk?.length > 0;\n\n const decrypt = this.decrypt;\n chunk = decrypt(chunk, !hasMoreData);\n\n const bufferLength = this.bufferLength,\n newLength = bufferLength + chunk.length,\n buffer = this.ensureBuffer(newLength);\n buffer.set(chunk, bufferLength);\n this.bufferLength = newLength;\n }\n}\n\nexport { DecryptStream };\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 bytesToString,\n FormatError,\n isArrayEqual,\n PasswordException,\n PasswordResponses,\n stringToBytes,\n unreachable,\n utf8StringToString,\n warn,\n} from \"../shared/util.js\";\nimport { Dict, isName, Name } from \"./primitives.js\";\nimport { DecryptStream } from \"./decrypt_stream.js\";\n\nclass ARCFourCipher {\n constructor(key) {\n this.a = 0;\n this.b = 0;\n const s = new Uint8Array(256);\n const keyLength = key.length;\n\n for (let i = 0; i < 256; ++i) {\n s[i] = i;\n }\n for (let i = 0, j = 0; i < 256; ++i) {\n const tmp = s[i];\n j = (j + tmp + key[i % keyLength]) & 0xff;\n s[i] = s[j];\n s[j] = tmp;\n }\n this.s = s;\n }\n\n encryptBlock(data) {\n let a = this.a,\n b = this.b;\n const s = this.s;\n const n = data.length;\n const output = new Uint8Array(n);\n for (let i = 0; i < n; ++i) {\n a = (a + 1) & 0xff;\n const tmp = s[a];\n b = (b + tmp) & 0xff;\n const tmp2 = s[b];\n s[a] = tmp2;\n s[b] = tmp;\n output[i] = data[i] ^ s[(tmp + tmp2) & 0xff];\n }\n this.a = a;\n this.b = b;\n return output;\n }\n\n decryptBlock(data) {\n return this.encryptBlock(data);\n }\n\n encrypt(data) {\n return this.encryptBlock(data);\n }\n}\n\nconst calculateMD5 = (function calculateMD5Closure() {\n const r = new Uint8Array([\n 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5,\n 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11,\n 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10,\n 15, 21,\n ]);\n\n const k = new Int32Array([\n -680876936, -389564586, 606105819, -1044525330, -176418897, 1200080426,\n -1473231341, -45705983, 1770035416, -1958414417, -42063, -1990404162,\n 1804603682, -40341101, -1502002290, 1236535329, -165796510, -1069501632,\n 643717713, -373897302, -701558691, 38016083, -660478335, -405537848,\n 568446438, -1019803690, -187363961, 1163531501, -1444681467, -51403784,\n 1735328473, -1926607734, -378558, -2022574463, 1839030562, -35309556,\n -1530992060, 1272893353, -155497632, -1094730640, 681279174, -358537222,\n -722521979, 76029189, -640364487, -421815835, 530742520, -995338651,\n -198630844, 1126891415, -1416354905, -57434055, 1700485571, -1894986606,\n -1051523, -2054922799, 1873313359, -30611744, -1560198380, 1309151649,\n -145523070, -1120210379, 718787259, -343485551,\n ]);\n\n function hash(data, offset, length) {\n let h0 = 1732584193,\n h1 = -271733879,\n h2 = -1732584194,\n h3 = 271733878;\n // pre-processing\n const paddedLength = (length + 72) & ~63; // data + 9 extra bytes\n const padded = new Uint8Array(paddedLength);\n let i, j;\n for (i = 0; i < length; ++i) {\n padded[i] = data[offset++];\n }\n padded[i++] = 0x80;\n const n = paddedLength - 8;\n while (i < n) {\n padded[i++] = 0;\n }\n padded[i++] = (length << 3) & 0xff;\n padded[i++] = (length >> 5) & 0xff;\n padded[i++] = (length >> 13) & 0xff;\n padded[i++] = (length >> 21) & 0xff;\n padded[i++] = (length >>> 29) & 0xff;\n padded[i++] = 0;\n padded[i++] = 0;\n padded[i++] = 0;\n const w = new Int32Array(16);\n for (i = 0; i < paddedLength; ) {\n for (j = 0; j < 16; ++j, i += 4) {\n w[j] =\n padded[i] |\n (padded[i + 1] << 8) |\n (padded[i + 2] << 16) |\n (padded[i + 3] << 24);\n }\n let a = h0,\n b = h1,\n c = h2,\n d = h3,\n f,\n g;\n for (j = 0; j < 64; ++j) {\n if (j < 16) {\n f = (b & c) | (~b & d);\n g = j;\n } else if (j < 32) {\n f = (d & b) | (~d & c);\n g = (5 * j + 1) & 15;\n } else if (j < 48) {\n f = b ^ c ^ d;\n g = (3 * j + 5) & 15;\n } else {\n f = c ^ (b | ~d);\n g = (7 * j) & 15;\n }\n const tmp = d,\n rotateArg = (a + f + k[j] + w[g]) | 0,\n rotate = r[j];\n d = c;\n c = b;\n b = (b + ((rotateArg << rotate) | (rotateArg >>> (32 - rotate)))) | 0;\n a = tmp;\n }\n h0 = (h0 + a) | 0;\n h1 = (h1 + b) | 0;\n h2 = (h2 + c) | 0;\n h3 = (h3 + d) | 0;\n }\n // prettier-ignore\n return new Uint8Array([\n h0 & 0xFF, (h0 >> 8) & 0xFF, (h0 >> 16) & 0xFF, (h0 >>> 24) & 0xFF,\n h1 & 0xFF, (h1 >> 8) & 0xFF, (h1 >> 16) & 0xFF, (h1 >>> 24) & 0xFF,\n h2 & 0xFF, (h2 >> 8) & 0xFF, (h2 >> 16) & 0xFF, (h2 >>> 24) & 0xFF,\n h3 & 0xFF, (h3 >> 8) & 0xFF, (h3 >> 16) & 0xFF, (h3 >>> 24) & 0xFF\n ]);\n }\n\n return hash;\n})();\n\nclass Word64 {\n constructor(highInteger, lowInteger) {\n this.high = highInteger | 0;\n this.low = lowInteger | 0;\n }\n\n and(word) {\n this.high &= word.high;\n this.low &= word.low;\n }\n\n xor(word) {\n this.high ^= word.high;\n this.low ^= word.low;\n }\n\n or(word) {\n this.high |= word.high;\n this.low |= word.low;\n }\n\n shiftRight(places) {\n if (places >= 32) {\n this.low = (this.high >>> (places - 32)) | 0;\n this.high = 0;\n } else {\n this.low = (this.low >>> places) | (this.high << (32 - places));\n this.high = (this.high >>> places) | 0;\n }\n }\n\n shiftLeft(places) {\n if (places >= 32) {\n this.high = this.low << (places - 32);\n this.low = 0;\n } else {\n this.high = (this.high << places) | (this.low >>> (32 - places));\n this.low <<= places;\n }\n }\n\n rotateRight(places) {\n let low, high;\n if (places & 32) {\n high = this.low;\n low = this.high;\n } else {\n low = this.low;\n high = this.high;\n }\n places &= 31;\n this.low = (low >>> places) | (high << (32 - places));\n this.high = (high >>> places) | (low << (32 - places));\n }\n\n not() {\n this.high = ~this.high;\n this.low = ~this.low;\n }\n\n add(word) {\n const lowAdd = (this.low >>> 0) + (word.low >>> 0);\n let highAdd = (this.high >>> 0) + (word.high >>> 0);\n if (lowAdd > 0xffffffff) {\n highAdd += 1;\n }\n this.low = lowAdd | 0;\n this.high = highAdd | 0;\n }\n\n copyTo(bytes, offset) {\n bytes[offset] = (this.high >>> 24) & 0xff;\n bytes[offset + 1] = (this.high >> 16) & 0xff;\n bytes[offset + 2] = (this.high >> 8) & 0xff;\n bytes[offset + 3] = this.high & 0xff;\n bytes[offset + 4] = (this.low >>> 24) & 0xff;\n bytes[offset + 5] = (this.low >> 16) & 0xff;\n bytes[offset + 6] = (this.low >> 8) & 0xff;\n bytes[offset + 7] = this.low & 0xff;\n }\n\n assign(word) {\n this.high = word.high;\n this.low = word.low;\n }\n}\n\nconst calculateSHA256 = (function calculateSHA256Closure() {\n function rotr(x, n) {\n return (x >>> n) | (x << (32 - n));\n }\n\n function ch(x, y, z) {\n return (x & y) ^ (~x & z);\n }\n\n function maj(x, y, z) {\n return (x & y) ^ (x & z) ^ (y & z);\n }\n\n function sigma(x) {\n return rotr(x, 2) ^ rotr(x, 13) ^ rotr(x, 22);\n }\n\n function sigmaPrime(x) {\n return rotr(x, 6) ^ rotr(x, 11) ^ rotr(x, 25);\n }\n\n function littleSigma(x) {\n return rotr(x, 7) ^ rotr(x, 18) ^ (x >>> 3);\n }\n\n function littleSigmaPrime(x) {\n return rotr(x, 17) ^ rotr(x, 19) ^ (x >>> 10);\n }\n\n const k = [\n 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1,\n 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,\n 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786,\n 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,\n 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147,\n 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,\n 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b,\n 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,\n 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a,\n 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,\n 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2,\n ];\n\n function hash(data, offset, length) {\n // initial hash values\n let h0 = 0x6a09e667,\n h1 = 0xbb67ae85,\n h2 = 0x3c6ef372,\n h3 = 0xa54ff53a,\n h4 = 0x510e527f,\n h5 = 0x9b05688c,\n h6 = 0x1f83d9ab,\n h7 = 0x5be0cd19;\n // pre-processing\n const paddedLength = Math.ceil((length + 9) / 64) * 64;\n const padded = new Uint8Array(paddedLength);\n let i, j;\n for (i = 0; i < length; ++i) {\n padded[i] = data[offset++];\n }\n padded[i++] = 0x80;\n const n = paddedLength - 8;\n while (i < n) {\n padded[i++] = 0;\n }\n padded[i++] = 0;\n padded[i++] = 0;\n padded[i++] = 0;\n padded[i++] = (length >>> 29) & 0xff;\n padded[i++] = (length >> 21) & 0xff;\n padded[i++] = (length >> 13) & 0xff;\n padded[i++] = (length >> 5) & 0xff;\n padded[i++] = (length << 3) & 0xff;\n const w = new Uint32Array(64);\n // for each 512 bit block\n for (i = 0; i < paddedLength; ) {\n for (j = 0; j < 16; ++j) {\n w[j] =\n (padded[i] << 24) |\n (padded[i + 1] << 16) |\n (padded[i + 2] << 8) |\n padded[i + 3];\n i += 4;\n }\n\n for (j = 16; j < 64; ++j) {\n w[j] =\n (littleSigmaPrime(w[j - 2]) +\n w[j - 7] +\n littleSigma(w[j - 15]) +\n w[j - 16]) |\n 0;\n }\n let a = h0,\n b = h1,\n c = h2,\n d = h3,\n e = h4,\n f = h5,\n g = h6,\n h = h7,\n t1,\n t2;\n for (j = 0; j < 64; ++j) {\n t1 = h + sigmaPrime(e) + ch(e, f, g) + k[j] + w[j];\n t2 = sigma(a) + maj(a, b, c);\n h = g;\n g = f;\n f = e;\n e = (d + t1) | 0;\n d = c;\n c = b;\n b = a;\n a = (t1 + t2) | 0;\n }\n h0 = (h0 + a) | 0;\n h1 = (h1 + b) | 0;\n h2 = (h2 + c) | 0;\n h3 = (h3 + d) | 0;\n h4 = (h4 + e) | 0;\n h5 = (h5 + f) | 0;\n h6 = (h6 + g) | 0;\n h7 = (h7 + h) | 0;\n }\n // prettier-ignore\n return new Uint8Array([\n (h0 >> 24) & 0xFF, (h0 >> 16) & 0xFF, (h0 >> 8) & 0xFF, (h0) & 0xFF,\n (h1 >> 24) & 0xFF, (h1 >> 16) & 0xFF, (h1 >> 8) & 0xFF, (h1) & 0xFF,\n (h2 >> 24) & 0xFF, (h2 >> 16) & 0xFF, (h2 >> 8) & 0xFF, (h2) & 0xFF,\n (h3 >> 24) & 0xFF, (h3 >> 16) & 0xFF, (h3 >> 8) & 0xFF, (h3) & 0xFF,\n (h4 >> 24) & 0xFF, (h4 >> 16) & 0xFF, (h4 >> 8) & 0xFF, (h4) & 0xFF,\n (h5 >> 24) & 0xFF, (h5 >> 16) & 0xFF, (h5 >> 8) & 0xFF, (h5) & 0xFF,\n (h6 >> 24) & 0xFF, (h6 >> 16) & 0xFF, (h6 >> 8) & 0xFF, (h6) & 0xFF,\n (h7 >> 24) & 0xFF, (h7 >> 16) & 0xFF, (h7 >> 8) & 0xFF, (h7) & 0xFF\n ]);\n }\n\n return hash;\n})();\n\nconst calculateSHA512 = (function calculateSHA512Closure() {\n function ch(result, x, y, z, tmp) {\n result.assign(x);\n result.and(y);\n tmp.assign(x);\n tmp.not();\n tmp.and(z);\n result.xor(tmp);\n }\n\n function maj(result, x, y, z, tmp) {\n result.assign(x);\n result.and(y);\n tmp.assign(x);\n tmp.and(z);\n result.xor(tmp);\n tmp.assign(y);\n tmp.and(z);\n result.xor(tmp);\n }\n\n function sigma(result, x, tmp) {\n result.assign(x);\n result.rotateRight(28);\n tmp.assign(x);\n tmp.rotateRight(34);\n result.xor(tmp);\n tmp.assign(x);\n tmp.rotateRight(39);\n result.xor(tmp);\n }\n\n function sigmaPrime(result, x, tmp) {\n result.assign(x);\n result.rotateRight(14);\n tmp.assign(x);\n tmp.rotateRight(18);\n result.xor(tmp);\n tmp.assign(x);\n tmp.rotateRight(41);\n result.xor(tmp);\n }\n\n function littleSigma(result, x, tmp) {\n result.assign(x);\n result.rotateRight(1);\n tmp.assign(x);\n tmp.rotateRight(8);\n result.xor(tmp);\n tmp.assign(x);\n tmp.shiftRight(7);\n result.xor(tmp);\n }\n\n function littleSigmaPrime(result, x, tmp) {\n result.assign(x);\n result.rotateRight(19);\n tmp.assign(x);\n tmp.rotateRight(61);\n result.xor(tmp);\n tmp.assign(x);\n tmp.shiftRight(6);\n result.xor(tmp);\n }\n\n // prettier-ignore\n const k = [\n new Word64(0x428a2f98, 0xd728ae22), new Word64(0x71374491, 0x23ef65cd),\n new Word64(0xb5c0fbcf, 0xec4d3b2f), new Word64(0xe9b5dba5, 0x8189dbbc),\n new Word64(0x3956c25b, 0xf348b538), new Word64(0x59f111f1, 0xb605d019),\n new Word64(0x923f82a4, 0xaf194f9b), new Word64(0xab1c5ed5, 0xda6d8118),\n new Word64(0xd807aa98, 0xa3030242), new Word64(0x12835b01, 0x45706fbe),\n new Word64(0x243185be, 0x4ee4b28c), new Word64(0x550c7dc3, 0xd5ffb4e2),\n new Word64(0x72be5d74, 0xf27b896f), new Word64(0x80deb1fe, 0x3b1696b1),\n new Word64(0x9bdc06a7, 0x25c71235), new Word64(0xc19bf174, 0xcf692694),\n new Word64(0xe49b69c1, 0x9ef14ad2), new Word64(0xefbe4786, 0x384f25e3),\n new Word64(0x0fc19dc6, 0x8b8cd5b5), new Word64(0x240ca1cc, 0x77ac9c65),\n new Word64(0x2de92c6f, 0x592b0275), new Word64(0x4a7484aa, 0x6ea6e483),\n new Word64(0x5cb0a9dc, 0xbd41fbd4), new Word64(0x76f988da, 0x831153b5),\n new Word64(0x983e5152, 0xee66dfab), new Word64(0xa831c66d, 0x2db43210),\n new Word64(0xb00327c8, 0x98fb213f), new Word64(0xbf597fc7, 0xbeef0ee4),\n new Word64(0xc6e00bf3, 0x3da88fc2), new Word64(0xd5a79147, 0x930aa725),\n new Word64(0x06ca6351, 0xe003826f), new Word64(0x14292967, 0x0a0e6e70),\n new Word64(0x27b70a85, 0x46d22ffc), new Word64(0x2e1b2138, 0x5c26c926),\n new Word64(0x4d2c6dfc, 0x5ac42aed), new Word64(0x53380d13, 0x9d95b3df),\n new Word64(0x650a7354, 0x8baf63de), new Word64(0x766a0abb, 0x3c77b2a8),\n new Word64(0x81c2c92e, 0x47edaee6), new Word64(0x92722c85, 0x1482353b),\n new Word64(0xa2bfe8a1, 0x4cf10364), new Word64(0xa81a664b, 0xbc423001),\n new Word64(0xc24b8b70, 0xd0f89791), new Word64(0xc76c51a3, 0x0654be30),\n new Word64(0xd192e819, 0xd6ef5218), new Word64(0xd6990624, 0x5565a910),\n new Word64(0xf40e3585, 0x5771202a), new Word64(0x106aa070, 0x32bbd1b8),\n new Word64(0x19a4c116, 0xb8d2d0c8), new Word64(0x1e376c08, 0x5141ab53),\n new Word64(0x2748774c, 0xdf8eeb99), new Word64(0x34b0bcb5, 0xe19b48a8),\n new Word64(0x391c0cb3, 0xc5c95a63), new Word64(0x4ed8aa4a, 0xe3418acb),\n new Word64(0x5b9cca4f, 0x7763e373), new Word64(0x682e6ff3, 0xd6b2b8a3),\n new Word64(0x748f82ee, 0x5defb2fc), new Word64(0x78a5636f, 0x43172f60),\n new Word64(0x84c87814, 0xa1f0ab72), new Word64(0x8cc70208, 0x1a6439ec),\n new Word64(0x90befffa, 0x23631e28), new Word64(0xa4506ceb, 0xde82bde9),\n new Word64(0xbef9a3f7, 0xb2c67915), new Word64(0xc67178f2, 0xe372532b),\n new Word64(0xca273ece, 0xea26619c), new Word64(0xd186b8c7, 0x21c0c207),\n new Word64(0xeada7dd6, 0xcde0eb1e), new Word64(0xf57d4f7f, 0xee6ed178),\n new Word64(0x06f067aa, 0x72176fba), new Word64(0x0a637dc5, 0xa2c898a6),\n new Word64(0x113f9804, 0xbef90dae), new Word64(0x1b710b35, 0x131c471b),\n new Word64(0x28db77f5, 0x23047d84), new Word64(0x32caab7b, 0x40c72493),\n new Word64(0x3c9ebe0a, 0x15c9bebc), new Word64(0x431d67c4, 0x9c100d4c),\n new Word64(0x4cc5d4be, 0xcb3e42b6), new Word64(0x597f299c, 0xfc657e2a),\n new Word64(0x5fcb6fab, 0x3ad6faec), new Word64(0x6c44198c, 0x4a475817)];\n\n function hash(data, offset, length, mode384 = false) {\n // initial hash values\n let h0, h1, h2, h3, h4, h5, h6, h7;\n if (!mode384) {\n h0 = new Word64(0x6a09e667, 0xf3bcc908);\n h1 = new Word64(0xbb67ae85, 0x84caa73b);\n h2 = new Word64(0x3c6ef372, 0xfe94f82b);\n h3 = new Word64(0xa54ff53a, 0x5f1d36f1);\n h4 = new Word64(0x510e527f, 0xade682d1);\n h5 = new Word64(0x9b05688c, 0x2b3e6c1f);\n h6 = new Word64(0x1f83d9ab, 0xfb41bd6b);\n h7 = new Word64(0x5be0cd19, 0x137e2179);\n } else {\n // SHA384 is exactly the same\n // except with different starting values and a trimmed result\n h0 = new Word64(0xcbbb9d5d, 0xc1059ed8);\n h1 = new Word64(0x629a292a, 0x367cd507);\n h2 = new Word64(0x9159015a, 0x3070dd17);\n h3 = new Word64(0x152fecd8, 0xf70e5939);\n h4 = new Word64(0x67332667, 0xffc00b31);\n h5 = new Word64(0x8eb44a87, 0x68581511);\n h6 = new Word64(0xdb0c2e0d, 0x64f98fa7);\n h7 = new Word64(0x47b5481d, 0xbefa4fa4);\n }\n\n // pre-processing\n const paddedLength = Math.ceil((length + 17) / 128) * 128;\n const padded = new Uint8Array(paddedLength);\n let i, j;\n for (i = 0; i < length; ++i) {\n padded[i] = data[offset++];\n }\n padded[i++] = 0x80;\n const n = paddedLength - 16;\n while (i < n) {\n padded[i++] = 0;\n }\n padded[i++] = 0;\n padded[i++] = 0;\n padded[i++] = 0;\n padded[i++] = 0;\n padded[i++] = 0;\n padded[i++] = 0;\n padded[i++] = 0;\n padded[i++] = 0;\n padded[i++] = 0;\n padded[i++] = 0;\n padded[i++] = 0;\n padded[i++] = (length >>> 29) & 0xff;\n padded[i++] = (length >> 21) & 0xff;\n padded[i++] = (length >> 13) & 0xff;\n padded[i++] = (length >> 5) & 0xff;\n padded[i++] = (length << 3) & 0xff;\n\n const w = new Array(80);\n for (i = 0; i < 80; i++) {\n w[i] = new Word64(0, 0);\n }\n let a = new Word64(0, 0),\n b = new Word64(0, 0),\n c = new Word64(0, 0);\n let d = new Word64(0, 0),\n e = new Word64(0, 0),\n f = new Word64(0, 0);\n let g = new Word64(0, 0),\n h = new Word64(0, 0);\n const t1 = new Word64(0, 0),\n t2 = new Word64(0, 0);\n const tmp1 = new Word64(0, 0),\n tmp2 = new Word64(0, 0);\n let tmp3;\n\n // for each 1024 bit block\n for (i = 0; i < paddedLength; ) {\n for (j = 0; j < 16; ++j) {\n w[j].high =\n (padded[i] << 24) |\n (padded[i + 1] << 16) |\n (padded[i + 2] << 8) |\n padded[i + 3];\n w[j].low =\n (padded[i + 4] << 24) |\n (padded[i + 5] << 16) |\n (padded[i + 6] << 8) |\n padded[i + 7];\n i += 8;\n }\n for (j = 16; j < 80; ++j) {\n tmp3 = w[j];\n littleSigmaPrime(tmp3, w[j - 2], tmp2);\n tmp3.add(w[j - 7]);\n littleSigma(tmp1, w[j - 15], tmp2);\n tmp3.add(tmp1);\n tmp3.add(w[j - 16]);\n }\n\n a.assign(h0);\n b.assign(h1);\n c.assign(h2);\n d.assign(h3);\n e.assign(h4);\n f.assign(h5);\n g.assign(h6);\n h.assign(h7);\n for (j = 0; j < 80; ++j) {\n t1.assign(h);\n sigmaPrime(tmp1, e, tmp2);\n t1.add(tmp1);\n ch(tmp1, e, f, g, tmp2);\n t1.add(tmp1);\n t1.add(k[j]);\n t1.add(w[j]);\n\n sigma(t2, a, tmp2);\n maj(tmp1, a, b, c, tmp2);\n t2.add(tmp1);\n\n tmp3 = h;\n h = g;\n g = f;\n f = e;\n d.add(t1);\n e = d;\n d = c;\n c = b;\n b = a;\n tmp3.assign(t1);\n tmp3.add(t2);\n a = tmp3;\n }\n h0.add(a);\n h1.add(b);\n h2.add(c);\n h3.add(d);\n h4.add(e);\n h5.add(f);\n h6.add(g);\n h7.add(h);\n }\n\n let result;\n if (!mode384) {\n result = new Uint8Array(64);\n h0.copyTo(result, 0);\n h1.copyTo(result, 8);\n h2.copyTo(result, 16);\n h3.copyTo(result, 24);\n h4.copyTo(result, 32);\n h5.copyTo(result, 40);\n h6.copyTo(result, 48);\n h7.copyTo(result, 56);\n } else {\n result = new Uint8Array(48);\n h0.copyTo(result, 0);\n h1.copyTo(result, 8);\n h2.copyTo(result, 16);\n h3.copyTo(result, 24);\n h4.copyTo(result, 32);\n h5.copyTo(result, 40);\n }\n return result;\n }\n\n return hash;\n})();\n\nfunction calculateSHA384(data, offset, length) {\n return calculateSHA512(data, offset, length, /* mode384 = */ true);\n}\n\nclass NullCipher {\n decryptBlock(data) {\n return data;\n }\n\n encrypt(data) {\n return data;\n }\n}\n\nclass AESBaseCipher {\n constructor() {\n if (this.constructor === AESBaseCipher) {\n unreachable(\"Cannot initialize AESBaseCipher.\");\n }\n\n this._s = new Uint8Array([\n 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b,\n 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0,\n 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26,\n 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15,\n 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2,\n 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0,\n 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed,\n 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf,\n 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f,\n 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5,\n 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec,\n 0x5f, 0x97, 0x44, 0x17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 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61,\n 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63,\n 0x55, 0x21, 0x0c, 0x7d,\n ]);\n\n this._mix = new Uint32Array([\n 0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927,\n 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45,\n 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb,\n 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381,\n 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf,\n 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66,\n 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28,\n 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012,\n 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec,\n 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e,\n 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd,\n 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7,\n 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89,\n 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b,\n 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815,\n 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f,\n 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa,\n 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8,\n 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36,\n 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c,\n 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742,\n 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea,\n 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4,\n 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e,\n 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360,\n 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502,\n 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87,\n 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd,\n 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3,\n 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621,\n 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f,\n 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55,\n 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26,\n 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844,\n 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba,\n 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480,\n 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce,\n 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67,\n 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929,\n 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713,\n 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed,\n 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f,\n 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3,\n ]);\n\n this._mixCol = new Uint8Array(256);\n for (let i = 0; i < 256; i++) {\n this._mixCol[i] = i < 128 ? i << 1 : (i << 1) ^ 0x1b;\n }\n\n this.buffer = new Uint8Array(16);\n this.bufferPosition = 0;\n }\n\n _expandKey(cipherKey) {\n unreachable(\"Cannot call `_expandKey` on the base class\");\n }\n\n _decrypt(input, key) {\n let t, u, v;\n const state = new Uint8Array(16);\n state.set(input);\n\n // AddRoundKey\n for (let j = 0, k = this._keySize; j < 16; ++j, ++k) {\n state[j] ^= key[k];\n }\n for (let i = this._cyclesOfRepetition - 1; i >= 1; --i) {\n // InvShiftRows\n t = state[13];\n state[13] = state[9];\n state[9] = state[5];\n state[5] = state[1];\n state[1] = t;\n t = state[14];\n u = state[10];\n state[14] = state[6];\n state[10] = state[2];\n state[6] = t;\n state[2] = u;\n t = state[15];\n u = state[11];\n v = state[7];\n state[15] = state[3];\n state[11] = t;\n state[7] = u;\n state[3] = v;\n // InvSubBytes\n for (let j = 0; j < 16; ++j) {\n state[j] = this._inv_s[state[j]];\n }\n // AddRoundKey\n for (let j = 0, k = i * 16; j < 16; ++j, ++k) {\n state[j] ^= key[k];\n }\n // InvMixColumns\n for (let j = 0; j < 16; j += 4) {\n const s0 = this._mix[state[j]];\n const s1 = this._mix[state[j + 1]];\n const s2 = this._mix[state[j + 2]];\n const s3 = this._mix[state[j + 3]];\n t =\n s0 ^\n (s1 >>> 8) ^\n (s1 << 24) ^\n (s2 >>> 16) ^\n (s2 << 16) ^\n (s3 >>> 24) ^\n (s3 << 8);\n state[j] = (t >>> 24) & 0xff;\n state[j + 1] = (t >> 16) & 0xff;\n state[j + 2] = (t >> 8) & 0xff;\n state[j + 3] = t & 0xff;\n }\n }\n // InvShiftRows\n t = state[13];\n state[13] = state[9];\n state[9] = state[5];\n state[5] = state[1];\n state[1] = t;\n t = state[14];\n u = state[10];\n state[14] = state[6];\n state[10] = state[2];\n state[6] = t;\n state[2] = u;\n t = state[15];\n u = state[11];\n v = state[7];\n state[15] = state[3];\n state[11] = t;\n state[7] = u;\n state[3] = v;\n for (let j = 0; j < 16; ++j) {\n // InvSubBytes\n state[j] = this._inv_s[state[j]];\n // AddRoundKey\n state[j] ^= key[j];\n }\n return state;\n }\n\n _encrypt(input, key) {\n const s = this._s;\n\n let t, u, v;\n const state = new Uint8Array(16);\n state.set(input);\n\n for (let j = 0; j < 16; ++j) {\n // AddRoundKey\n state[j] ^= key[j];\n }\n\n for (let i = 1; i < this._cyclesOfRepetition; i++) {\n // SubBytes\n for (let j = 0; j < 16; ++j) {\n state[j] = s[state[j]];\n }\n // ShiftRows\n v = state[1];\n state[1] = state[5];\n state[5] = state[9];\n state[9] = state[13];\n state[13] = v;\n v = state[2];\n u = state[6];\n state[2] = state[10];\n state[6] = state[14];\n state[10] = v;\n state[14] = u;\n v = state[3];\n u = state[7];\n t = state[11];\n state[3] = state[15];\n state[7] = v;\n state[11] = u;\n state[15] = t;\n // MixColumns\n for (let j = 0; j < 16; j += 4) {\n const s0 = state[j + 0];\n const s1 = state[j + 1];\n const s2 = state[j + 2];\n const s3 = state[j + 3];\n t = s0 ^ s1 ^ s2 ^ s3;\n state[j + 0] ^= t ^ this._mixCol[s0 ^ s1];\n state[j + 1] ^= t ^ this._mixCol[s1 ^ s2];\n state[j + 2] ^= t ^ this._mixCol[s2 ^ s3];\n state[j + 3] ^= t ^ this._mixCol[s3 ^ s0];\n }\n // AddRoundKey\n for (let j = 0, k = i * 16; j < 16; ++j, ++k) {\n state[j] ^= key[k];\n }\n }\n\n // SubBytes\n for (let j = 0; j < 16; ++j) {\n state[j] = s[state[j]];\n }\n // ShiftRows\n v = state[1];\n state[1] = state[5];\n state[5] = state[9];\n state[9] = state[13];\n state[13] = v;\n v = state[2];\n u = state[6];\n state[2] = state[10];\n state[6] = state[14];\n state[10] = v;\n state[14] = u;\n v = state[3];\n u = state[7];\n t = state[11];\n state[3] = state[15];\n state[7] = v;\n state[11] = u;\n state[15] = t;\n // AddRoundKey\n for (let j = 0, k = this._keySize; j < 16; ++j, ++k) {\n state[j] ^= key[k];\n }\n return state;\n }\n\n _decryptBlock2(data, finalize) {\n const sourceLength = data.length;\n let buffer = this.buffer,\n bufferLength = this.bufferPosition;\n const result = [];\n let iv = this.iv;\n\n for (let i = 0; i < sourceLength; ++i) {\n buffer[bufferLength] = data[i];\n ++bufferLength;\n if (bufferLength < 16) {\n continue;\n }\n // buffer is full, decrypting\n const plain = this._decrypt(buffer, this._key);\n // xor-ing the IV vector to get plain text\n for (let j = 0; j < 16; ++j) {\n plain[j] ^= iv[j];\n }\n iv = buffer;\n result.push(plain);\n buffer = new Uint8Array(16);\n bufferLength = 0;\n }\n // saving incomplete buffer\n this.buffer = buffer;\n this.bufferLength = bufferLength;\n this.iv = iv;\n if (result.length === 0) {\n return new Uint8Array(0);\n }\n // combining plain text blocks into one\n let outputLength = 16 * result.length;\n if (finalize) {\n // undo a padding that is described in RFC 2898\n const lastBlock = result.at(-1);\n let psLen = lastBlock[15];\n if (psLen <= 16) {\n for (let i = 15, ii = 16 - psLen; i >= ii; --i) {\n if (lastBlock[i] !== psLen) {\n // Invalid padding, assume that the block has no padding.\n psLen = 0;\n break;\n }\n }\n outputLength -= psLen;\n result[result.length - 1] = lastBlock.subarray(0, 16 - psLen);\n }\n }\n const output = new Uint8Array(outputLength);\n for (let i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) {\n output.set(result[i], j);\n }\n return output;\n }\n\n decryptBlock(data, finalize, iv = null) {\n const sourceLength = data.length;\n const buffer = this.buffer;\n let bufferLength = this.bufferPosition;\n // If an IV is not supplied, wait for IV values. They are at the start\n // of the stream.\n if (iv) {\n this.iv = iv;\n } else {\n for (\n let i = 0;\n bufferLength < 16 && i < sourceLength;\n ++i, ++bufferLength\n ) {\n buffer[bufferLength] = data[i];\n }\n if (bufferLength < 16) {\n // Need more data.\n this.bufferLength = bufferLength;\n return new Uint8Array(0);\n }\n this.iv = buffer;\n data = data.subarray(16);\n }\n this.buffer = new Uint8Array(16);\n this.bufferLength = 0;\n // starting decryption\n this.decryptBlock = this._decryptBlock2;\n return this.decryptBlock(data, finalize);\n }\n\n encrypt(data, iv) {\n const sourceLength = data.length;\n let buffer = this.buffer,\n bufferLength = this.bufferPosition;\n const result = [];\n\n if (!iv) {\n iv = new Uint8Array(16);\n }\n for (let i = 0; i < sourceLength; ++i) {\n buffer[bufferLength] = data[i];\n ++bufferLength;\n if (bufferLength < 16) {\n continue;\n }\n\n for (let j = 0; j < 16; ++j) {\n buffer[j] ^= iv[j];\n }\n\n // buffer is full, encrypting\n const cipher = this._encrypt(buffer, this._key);\n iv = cipher;\n result.push(cipher);\n buffer = new Uint8Array(16);\n bufferLength = 0;\n }\n // saving incomplete buffer\n this.buffer = buffer;\n this.bufferLength = bufferLength;\n this.iv = iv;\n if (result.length === 0) {\n return new Uint8Array(0);\n }\n // combining plain text blocks into one\n const outputLength = 16 * result.length;\n const output = new Uint8Array(outputLength);\n for (let i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) {\n output.set(result[i], j);\n }\n return output;\n }\n}\n\nclass AES128Cipher extends AESBaseCipher {\n constructor(key) {\n super();\n\n this._cyclesOfRepetition = 10;\n this._keySize = 160; // bits\n\n this._rcon = new Uint8Array([\n 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c,\n 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a,\n 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd,\n 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a,\n 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80,\n 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6,\n 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72,\n 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc,\n 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10,\n 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e,\n 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5,\n 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94,\n 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02,\n 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d,\n 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d,\n 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f,\n 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb,\n 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c,\n 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a,\n 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd,\n 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a,\n 0x74, 0xe8, 0xcb, 0x8d,\n ]);\n\n this._key = this._expandKey(key);\n }\n\n _expandKey(cipherKey) {\n const b = 176;\n const s = this._s;\n const rcon = this._rcon;\n\n const result = new Uint8Array(b);\n result.set(cipherKey);\n\n for (let j = 16, i = 1; j < b; ++i) {\n // RotWord\n let t1 = result[j - 3];\n let t2 = result[j - 2];\n let t3 = result[j - 1];\n let t4 = result[j - 4];\n // SubWord\n t1 = s[t1];\n t2 = s[t2];\n t3 = s[t3];\n t4 = s[t4];\n // Rcon\n t1 ^= rcon[i];\n for (let n = 0; n < 4; ++n) {\n result[j] = t1 ^= result[j - 16];\n j++;\n result[j] = t2 ^= result[j - 16];\n j++;\n result[j] = t3 ^= result[j - 16];\n j++;\n result[j] = t4 ^= result[j - 16];\n j++;\n }\n }\n return result;\n }\n}\n\nclass AES256Cipher extends AESBaseCipher {\n constructor(key) {\n super();\n\n this._cyclesOfRepetition = 14;\n this._keySize = 224; // bits\n\n this._key = this._expandKey(key);\n }\n\n _expandKey(cipherKey) {\n const b = 240;\n const s = this._s;\n\n const result = new Uint8Array(b);\n result.set(cipherKey);\n\n let r = 1;\n let t1, t2, t3, t4;\n for (let j = 32, i = 1; j < b; ++i) {\n if (j % 32 === 16) {\n t1 = s[t1];\n t2 = s[t2];\n t3 = s[t3];\n t4 = s[t4];\n } else if (j % 32 === 0) {\n // RotWord\n t1 = result[j - 3];\n t2 = result[j - 2];\n t3 = result[j - 1];\n t4 = result[j - 4];\n // SubWord\n t1 = s[t1];\n t2 = s[t2];\n t3 = s[t3];\n t4 = s[t4];\n // Rcon\n t1 ^= r;\n if ((r <<= 1) >= 256) {\n r = (r ^ 0x1b) & 0xff;\n }\n }\n\n for (let n = 0; n < 4; ++n) {\n result[j] = t1 ^= result[j - 32];\n j++;\n result[j] = t2 ^= result[j - 32];\n j++;\n result[j] = t3 ^= result[j - 32];\n j++;\n result[j] = t4 ^= result[j - 32];\n j++;\n }\n }\n return result;\n }\n}\n\nclass PDF17 {\n checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) {\n const hashData = new Uint8Array(password.length + 56);\n hashData.set(password, 0);\n hashData.set(ownerValidationSalt, password.length);\n hashData.set(userBytes, password.length + ownerValidationSalt.length);\n const result = calculateSHA256(hashData, 0, hashData.length);\n return isArrayEqual(result, ownerPassword);\n }\n\n checkUserPassword(password, userValidationSalt, userPassword) {\n const hashData = new Uint8Array(password.length + 8);\n hashData.set(password, 0);\n hashData.set(userValidationSalt, password.length);\n const result = calculateSHA256(hashData, 0, hashData.length);\n return isArrayEqual(result, userPassword);\n }\n\n getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) {\n const hashData = new Uint8Array(password.length + 56);\n hashData.set(password, 0);\n hashData.set(ownerKeySalt, password.length);\n hashData.set(userBytes, password.length + ownerKeySalt.length);\n const key = calculateSHA256(hashData, 0, hashData.length);\n const cipher = new AES256Cipher(key);\n return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16));\n }\n\n getUserKey(password, userKeySalt, userEncryption) {\n const hashData = new Uint8Array(password.length + 8);\n hashData.set(password, 0);\n hashData.set(userKeySalt, password.length);\n // `key` is the decryption key for the UE string.\n const key = calculateSHA256(hashData, 0, hashData.length);\n const cipher = new AES256Cipher(key);\n return cipher.decryptBlock(userEncryption, false, new Uint8Array(16));\n }\n}\n\nclass PDF20 {\n _hash(password, input, userBytes) {\n // This refers to Algorithm 2.B as defined in ISO 32000-2.\n let k = calculateSHA256(input, 0, input.length).subarray(0, 32);\n let e = [0];\n let i = 0;\n while (i < 64 || e.at(-1) > i - 32) {\n const combinedLength = password.length + k.length + userBytes.length,\n combinedArray = new Uint8Array(combinedLength);\n let writeOffset = 0;\n combinedArray.set(password, writeOffset);\n writeOffset += password.length;\n combinedArray.set(k, writeOffset);\n writeOffset += k.length;\n combinedArray.set(userBytes, writeOffset);\n\n const k1 = new Uint8Array(combinedLength * 64);\n for (let j = 0, pos = 0; j < 64; j++, pos += combinedLength) {\n k1.set(combinedArray, pos);\n }\n // AES128 CBC NO PADDING with first 16 bytes of k as the key\n // and the second 16 as the iv.\n const cipher = new AES128Cipher(k.subarray(0, 16));\n e = cipher.encrypt(k1, k.subarray(16, 32));\n // Now we have to take the first 16 bytes of an unsigned big endian\n // integer and compute the remainder modulo 3. That is a fairly large\n // number and JavaScript isn't going to handle that well.\n // The number is e0 + 256 * e1 + 256^2 * e2... and 256 % 3 === 1, hence\n // the powers of 256 are === 1 modulo 3 and finally the number modulo 3\n // is equal to the remainder modulo 3 of the sum of the e_n.\n const remainder = e.slice(0, 16).reduce((a, b) => a + b, 0) % 3;\n if (remainder === 0) {\n k = calculateSHA256(e, 0, e.length);\n } else if (remainder === 1) {\n k = calculateSHA384(e, 0, e.length);\n } else if (remainder === 2) {\n k = calculateSHA512(e, 0, e.length);\n }\n i++;\n }\n return k.subarray(0, 32);\n }\n\n checkOwnerPassword(password, ownerValidationSalt, userBytes, ownerPassword) {\n const hashData = new Uint8Array(password.length + 56);\n hashData.set(password, 0);\n hashData.set(ownerValidationSalt, password.length);\n hashData.set(userBytes, password.length + ownerValidationSalt.length);\n const result = this._hash(password, hashData, userBytes);\n return isArrayEqual(result, ownerPassword);\n }\n\n checkUserPassword(password, userValidationSalt, userPassword) {\n const hashData = new Uint8Array(password.length + 8);\n hashData.set(password, 0);\n hashData.set(userValidationSalt, password.length);\n const result = this._hash(password, hashData, []);\n return isArrayEqual(result, userPassword);\n }\n\n getOwnerKey(password, ownerKeySalt, userBytes, ownerEncryption) {\n const hashData = new Uint8Array(password.length + 56);\n hashData.set(password, 0);\n hashData.set(ownerKeySalt, password.length);\n hashData.set(userBytes, password.length + ownerKeySalt.length);\n const key = this._hash(password, hashData, userBytes);\n const cipher = new AES256Cipher(key);\n return cipher.decryptBlock(ownerEncryption, false, new Uint8Array(16));\n }\n\n getUserKey(password, userKeySalt, userEncryption) {\n const hashData = new Uint8Array(password.length + 8);\n hashData.set(password, 0);\n hashData.set(userKeySalt, password.length);\n // `key` is the decryption key for the UE string.\n const key = this._hash(password, hashData, []);\n const cipher = new AES256Cipher(key);\n return cipher.decryptBlock(userEncryption, false, new Uint8Array(16));\n }\n}\n\nclass CipherTransform {\n constructor(stringCipherConstructor, streamCipherConstructor) {\n this.StringCipherConstructor = stringCipherConstructor;\n this.StreamCipherConstructor = streamCipherConstructor;\n }\n\n createStream(stream, length) {\n const cipher = new this.StreamCipherConstructor();\n return new DecryptStream(\n stream,\n length,\n function cipherTransformDecryptStream(data, finalize) {\n return cipher.decryptBlock(data, finalize);\n }\n );\n }\n\n decryptString(s) {\n const cipher = new this.StringCipherConstructor();\n let data = stringToBytes(s);\n data = cipher.decryptBlock(data, true);\n return bytesToString(data);\n }\n\n encryptString(s) {\n const cipher = new this.StringCipherConstructor();\n if (cipher instanceof AESBaseCipher) {\n // Append some chars equal to \"16 - (M mod 16)\"\n // where M is the string length (see section 7.6.2 in PDF specification)\n // to have a final string where the length is a multiple of 16.\n // Special note:\n // \"Note that the pad is present when M is evenly divisible by 16;\n // it contains 16 bytes of 0x10.\"\n const strLen = s.length;\n const pad = 16 - (strLen % 16);\n s += String.fromCharCode(pad).repeat(pad);\n\n // Generate an initialization vector\n const iv = new Uint8Array(16);\n if (typeof crypto !== \"undefined\") {\n crypto.getRandomValues(iv);\n } else {\n for (let i = 0; i < 16; i++) {\n iv[i] = Math.floor(256 * Math.random());\n }\n }\n\n let data = stringToBytes(s);\n data = cipher.encrypt(data, iv);\n\n const buf = new Uint8Array(16 + data.length);\n buf.set(iv);\n buf.set(data, 16);\n\n return bytesToString(buf);\n }\n\n let data = stringToBytes(s);\n data = cipher.encrypt(data);\n return bytesToString(data);\n }\n}\n\nclass CipherTransformFactory {\n static #defaultPasswordBytes = new Uint8Array([\n 0x28, 0xbf, 0x4e, 0x5e, 0x4e, 0x75, 0x8a, 0x41, 0x64, 0x00, 0x4e, 0x56,\n 0xff, 0xfa, 0x01, 0x08, 0x2e, 0x2e, 0x00, 0xb6, 0xd0, 0x68, 0x3e, 0x80,\n 0x2f, 0x0c, 0xa9, 0xfe, 0x64, 0x53, 0x69, 0x7a,\n ]);\n\n #createEncryptionKey20(\n revision,\n password,\n ownerPassword,\n ownerValidationSalt,\n ownerKeySalt,\n uBytes,\n userPassword,\n userValidationSalt,\n userKeySalt,\n ownerEncryption,\n userEncryption,\n perms\n ) {\n if (password) {\n const passwordLength = Math.min(127, password.length);\n password = password.subarray(0, passwordLength);\n } else {\n password = [];\n }\n const pdfAlgorithm = revision === 6 ? new PDF20() : new PDF17();\n\n if (\n pdfAlgorithm.checkUserPassword(password, userValidationSalt, userPassword)\n ) {\n return pdfAlgorithm.getUserKey(password, userKeySalt, userEncryption);\n } else if (\n password.length &&\n pdfAlgorithm.checkOwnerPassword(\n password,\n ownerValidationSalt,\n uBytes,\n ownerPassword\n )\n ) {\n return pdfAlgorithm.getOwnerKey(\n password,\n ownerKeySalt,\n uBytes,\n ownerEncryption\n );\n }\n\n return null;\n }\n\n #prepareKeyData(\n fileId,\n password,\n ownerPassword,\n userPassword,\n flags,\n revision,\n keyLength,\n encryptMetadata\n ) {\n const hashDataSize = 40 + ownerPassword.length + fileId.length;\n const hashData = new Uint8Array(hashDataSize);\n let i = 0,\n j,\n n;\n if (password) {\n n = Math.min(32, password.length);\n for (; i < n; ++i) {\n hashData[i] = password[i];\n }\n }\n j = 0;\n while (i < 32) {\n hashData[i++] = CipherTransformFactory.#defaultPasswordBytes[j++];\n }\n // as now the padded password in the hashData[0..i]\n for (j = 0, n = ownerPassword.length; j < n; ++j) {\n hashData[i++] = ownerPassword[j];\n }\n hashData[i++] = flags & 0xff;\n hashData[i++] = (flags >> 8) & 0xff;\n hashData[i++] = (flags >> 16) & 0xff;\n hashData[i++] = (flags >>> 24) & 0xff;\n for (j = 0, n = fileId.length; j < n; ++j) {\n hashData[i++] = fileId[j];\n }\n if (revision >= 4 && !encryptMetadata) {\n hashData[i++] = 0xff;\n hashData[i++] = 0xff;\n hashData[i++] = 0xff;\n hashData[i++] = 0xff;\n }\n let hash = calculateMD5(hashData, 0, i);\n const keyLengthInBytes = keyLength >> 3;\n if (revision >= 3) {\n for (j = 0; j < 50; ++j) {\n hash = calculateMD5(hash, 0, keyLengthInBytes);\n }\n }\n const encryptionKey = hash.subarray(0, keyLengthInBytes);\n let cipher, checkData;\n\n if (revision >= 3) {\n for (i = 0; i < 32; ++i) {\n hashData[i] = CipherTransformFactory.#defaultPasswordBytes[i];\n }\n for (j = 0, n = fileId.length; j < n; ++j) {\n hashData[i++] = fileId[j];\n }\n cipher = new ARCFourCipher(encryptionKey);\n checkData = cipher.encryptBlock(calculateMD5(hashData, 0, i));\n n = encryptionKey.length;\n const derivedKey = new Uint8Array(n);\n for (j = 1; j <= 19; ++j) {\n for (let k = 0; k < n; ++k) {\n derivedKey[k] = encryptionKey[k] ^ j;\n }\n cipher = new ARCFourCipher(derivedKey);\n checkData = cipher.encryptBlock(checkData);\n }\n for (j = 0, n = checkData.length; j < n; ++j) {\n if (userPassword[j] !== checkData[j]) {\n return null;\n }\n }\n } else {\n cipher = new ARCFourCipher(encryptionKey);\n checkData = cipher.encryptBlock(\n CipherTransformFactory.#defaultPasswordBytes\n );\n for (j = 0, n = checkData.length; j < n; ++j) {\n if (userPassword[j] !== checkData[j]) {\n return null;\n }\n }\n }\n return encryptionKey;\n }\n\n #decodeUserPassword(password, ownerPassword, revision, keyLength) {\n const hashData = new Uint8Array(32);\n let i = 0;\n const n = Math.min(32, password.length);\n for (; i < n; ++i) {\n hashData[i] = password[i];\n }\n let j = 0;\n while (i < 32) {\n hashData[i++] = CipherTransformFactory.#defaultPasswordBytes[j++];\n }\n let hash = calculateMD5(hashData, 0, i);\n const keyLengthInBytes = keyLength >> 3;\n if (revision >= 3) {\n for (j = 0; j < 50; ++j) {\n hash = calculateMD5(hash, 0, hash.length);\n }\n }\n\n let cipher, userPassword;\n if (revision >= 3) {\n userPassword = ownerPassword;\n const derivedKey = new Uint8Array(keyLengthInBytes);\n for (j = 19; j >= 0; j--) {\n for (let k = 0; k < keyLengthInBytes; ++k) {\n derivedKey[k] = hash[k] ^ j;\n }\n cipher = new ARCFourCipher(derivedKey);\n userPassword = cipher.encryptBlock(userPassword);\n }\n } else {\n cipher = new ARCFourCipher(hash.subarray(0, keyLengthInBytes));\n userPassword = cipher.encryptBlock(ownerPassword);\n }\n return userPassword;\n }\n\n #buildObjectKey(num, gen, encryptionKey, isAes = false) {\n const key = new Uint8Array(encryptionKey.length + 9);\n const n = encryptionKey.length;\n let i;\n for (i = 0; i < n; ++i) {\n key[i] = encryptionKey[i];\n }\n key[i++] = num & 0xff;\n key[i++] = (num >> 8) & 0xff;\n key[i++] = (num >> 16) & 0xff;\n key[i++] = gen & 0xff;\n key[i++] = (gen >> 8) & 0xff;\n if (isAes) {\n key[i++] = 0x73;\n key[i++] = 0x41;\n key[i++] = 0x6c;\n key[i++] = 0x54;\n }\n const hash = calculateMD5(key, 0, i);\n return hash.subarray(0, Math.min(encryptionKey.length + 5, 16));\n }\n\n #buildCipherConstructor(cf, name, num, gen, key) {\n if (!(name instanceof Name)) {\n throw new FormatError(\"Invalid crypt filter name.\");\n }\n const self = this;\n const cryptFilter = cf.get(name.name);\n const cfm = cryptFilter?.get(\"CFM\");\n\n if (!cfm || cfm.name === \"None\") {\n return function () {\n return new NullCipher();\n };\n }\n if (cfm.name === \"V2\") {\n return function () {\n return new ARCFourCipher(\n self.#buildObjectKey(num, gen, key, /* isAes = */ false)\n );\n };\n }\n if (cfm.name === \"AESV2\") {\n return function () {\n return new AES128Cipher(\n self.#buildObjectKey(num, gen, key, /* isAes = */ true)\n );\n };\n }\n if (cfm.name === \"AESV3\") {\n return function () {\n return new AES256Cipher(key);\n };\n }\n throw new FormatError(\"Unknown crypto method\");\n }\n\n constructor(dict, fileId, password) {\n const filter = dict.get(\"Filter\");\n if (!isName(filter, \"Standard\")) {\n throw new FormatError(\"unknown encryption method\");\n }\n this.filterName = filter.name;\n this.dict = dict;\n const algorithm = dict.get(\"V\");\n if (\n !Number.isInteger(algorithm) ||\n (algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && algorithm !== 5)\n ) {\n throw new FormatError(\"unsupported encryption algorithm\");\n }\n this.algorithm = algorithm;\n let keyLength = dict.get(\"Length\");\n if (!keyLength) {\n // Spec asks to rely on encryption dictionary's Length entry, however\n // some PDFs don't have it. Trying to recover.\n if (algorithm <= 3) {\n // For 1 and 2 it's fixed to 40-bit, for 3 40-bit is a minimal value.\n keyLength = 40;\n } else {\n // Trying to find default handler -- it usually has Length.\n const cfDict = dict.get(\"CF\");\n const streamCryptoName = dict.get(\"StmF\");\n if (cfDict instanceof Dict && streamCryptoName instanceof Name) {\n cfDict.suppressEncryption = true; // See comment below.\n const handlerDict = cfDict.get(streamCryptoName.name);\n keyLength = handlerDict?.get(\"Length\") || 128;\n if (keyLength < 40) {\n // Sometimes it's incorrect value of bits, generators specify\n // bytes.\n keyLength <<= 3;\n }\n }\n }\n }\n if (!Number.isInteger(keyLength) || keyLength < 40 || keyLength % 8 !== 0) {\n throw new FormatError(\"invalid key length\");\n }\n\n const ownerBytes = stringToBytes(dict.get(\"O\")),\n userBytes = stringToBytes(dict.get(\"U\"));\n // prepare keys\n const ownerPassword = ownerBytes.subarray(0, 32);\n const userPassword = userBytes.subarray(0, 32);\n const flags = dict.get(\"P\");\n const revision = dict.get(\"R\");\n // meaningful when V is 4 or 5\n const encryptMetadata =\n (algorithm === 4 || algorithm === 5) &&\n dict.get(\"EncryptMetadata\") !== false;\n this.encryptMetadata = encryptMetadata;\n\n const fileIdBytes = stringToBytes(fileId);\n let passwordBytes;\n if (password) {\n if (revision === 6) {\n try {\n password = utf8StringToString(password);\n } catch {\n warn(\n \"CipherTransformFactory: Unable to convert UTF8 encoded password.\"\n );\n }\n }\n passwordBytes = stringToBytes(password);\n }\n\n let encryptionKey;\n if (algorithm !== 5) {\n encryptionKey = this.#prepareKeyData(\n fileIdBytes,\n passwordBytes,\n ownerPassword,\n userPassword,\n flags,\n revision,\n keyLength,\n encryptMetadata\n );\n } else {\n const ownerValidationSalt = ownerBytes.subarray(32, 40);\n const ownerKeySalt = ownerBytes.subarray(40, 48);\n const uBytes = userBytes.subarray(0, 48);\n const userValidationSalt = userBytes.subarray(32, 40);\n const userKeySalt = userBytes.subarray(40, 48);\n const ownerEncryption = stringToBytes(dict.get(\"OE\"));\n const userEncryption = stringToBytes(dict.get(\"UE\"));\n const perms = stringToBytes(dict.get(\"Perms\"));\n encryptionKey = this.#createEncryptionKey20(\n revision,\n passwordBytes,\n ownerPassword,\n ownerValidationSalt,\n ownerKeySalt,\n uBytes,\n userPassword,\n userValidationSalt,\n userKeySalt,\n ownerEncryption,\n userEncryption,\n perms\n );\n }\n if (!encryptionKey && !password) {\n throw new PasswordException(\n \"No password given\",\n PasswordResponses.NEED_PASSWORD\n );\n } else if (!encryptionKey && password) {\n // Attempting use the password as an owner password\n const decodedPassword = this.#decodeUserPassword(\n passwordBytes,\n ownerPassword,\n revision,\n keyLength\n );\n encryptionKey = this.#prepareKeyData(\n fileIdBytes,\n decodedPassword,\n ownerPassword,\n userPassword,\n flags,\n revision,\n keyLength,\n encryptMetadata\n );\n }\n\n if (!encryptionKey) {\n throw new PasswordException(\n \"Incorrect Password\",\n PasswordResponses.INCORRECT_PASSWORD\n );\n }\n\n this.encryptionKey = encryptionKey;\n\n if (algorithm >= 4) {\n const cf = dict.get(\"CF\");\n if (cf instanceof Dict) {\n // The 'CF' dictionary itself should not be encrypted, and by setting\n // `suppressEncryption` we can prevent an infinite loop inside of\n // `XRef_fetchUncompressed` if the dictionary contains indirect\n // objects (fixes issue7665.pdf).\n cf.suppressEncryption = true;\n }\n this.cf = cf;\n this.stmf = dict.get(\"StmF\") || Name.get(\"Identity\");\n this.strf = dict.get(\"StrF\") || Name.get(\"Identity\");\n this.eff = dict.get(\"EFF\") || this.stmf;\n }\n }\n\n createCipherTransform(num, gen) {\n if (this.algorithm === 4 || this.algorithm === 5) {\n return new CipherTransform(\n this.#buildCipherConstructor(\n this.cf,\n this.strf,\n num,\n gen,\n this.encryptionKey\n ),\n this.#buildCipherConstructor(\n this.cf,\n this.stmf,\n num,\n gen,\n this.encryptionKey\n )\n );\n }\n // algorithms 1 and 2\n const key = this.#buildObjectKey(\n num,\n gen,\n this.encryptionKey,\n /* isAes = */ false\n );\n const cipherConstructor = function () {\n return new ARCFourCipher(key);\n };\n return new CipherTransform(cipherConstructor, cipherConstructor);\n }\n}\n\nexport {\n AES128Cipher,\n AES256Cipher,\n ARCFourCipher,\n calculateMD5,\n calculateSHA256,\n calculateSHA384,\n calculateSHA512,\n CipherTransformFactory,\n PDF17,\n PDF20,\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 { bytesToString, info, warn } from \"../shared/util.js\";\nimport { Dict, isName, Name, Ref } from \"./primitives.js\";\nimport {\n escapePDFName,\n escapeString,\n numberToString,\n parseXFAPath,\n} from \"./core_utils.js\";\nimport { SimpleDOMNode, SimpleXMLParser } from \"./xml_parser.js\";\nimport { BaseStream } from \"./base_stream.js\";\nimport { calculateMD5 } from \"./crypto.js\";\n\nasync function writeObject(ref, obj, buffer, { encrypt = null }) {\n const transform = encrypt?.createCipherTransform(ref.num, ref.gen);\n buffer.push(`${ref.num} ${ref.gen} obj\\n`);\n if (obj instanceof Dict) {\n await writeDict(obj, buffer, transform);\n } else if (obj instanceof BaseStream) {\n await writeStream(obj, buffer, transform);\n } else if (Array.isArray(obj)) {\n await writeArray(obj, buffer, transform);\n }\n buffer.push(\"\\nendobj\\n\");\n}\n\nasync function writeDict(dict, buffer, transform) {\n buffer.push(\"<<\");\n for (const key of dict.getKeys()) {\n buffer.push(` /${escapePDFName(key)} `);\n await writeValue(dict.getRaw(key), buffer, transform);\n }\n buffer.push(\">>\");\n}\n\nasync function writeStream(stream, buffer, transform) {\n let bytes = stream.getBytes();\n const { dict } = stream;\n\n const [filter, params] = await Promise.all([\n dict.getAsync(\"Filter\"),\n dict.getAsync(\"DecodeParms\"),\n ]);\n\n const filterZero = Array.isArray(filter)\n ? await dict.xref.fetchIfRefAsync(filter[0])\n : filter;\n const isFilterZeroFlateDecode = isName(filterZero, \"FlateDecode\");\n\n // If the string is too small there is no real benefit in compressing it.\n // The number 256 is arbitrary, but it should be reasonable.\n const MIN_LENGTH_FOR_COMPRESSING = 256;\n\n if (\n typeof CompressionStream !== \"undefined\" &&\n (bytes.length >= MIN_LENGTH_FOR_COMPRESSING || isFilterZeroFlateDecode)\n ) {\n try {\n const cs = new CompressionStream(\"deflate\");\n const writer = cs.writable.getWriter();\n writer.write(bytes);\n writer.close();\n\n // Response::text doesn't return the correct data.\n const buf = await new Response(cs.readable).arrayBuffer();\n bytes = new Uint8Array(buf);\n\n let newFilter, newParams;\n if (!filter) {\n newFilter = Name.get(\"FlateDecode\");\n } else if (!isFilterZeroFlateDecode) {\n newFilter = Array.isArray(filter)\n ? [Name.get(\"FlateDecode\"), ...filter]\n : [Name.get(\"FlateDecode\"), filter];\n if (params) {\n newParams = Array.isArray(params)\n ? [null, ...params]\n : [null, params];\n }\n }\n if (newFilter) {\n dict.set(\"Filter\", newFilter);\n }\n if (newParams) {\n dict.set(\"DecodeParms\", newParams);\n }\n } catch (ex) {\n info(`writeStream - cannot compress data: \"${ex}\".`);\n }\n }\n\n let string = bytesToString(bytes);\n if (transform) {\n string = transform.encryptString(string);\n }\n\n dict.set(\"Length\", string.length);\n await writeDict(dict, buffer, transform);\n buffer.push(\" stream\\n\", string, \"\\nendstream\");\n}\n\nasync function writeArray(array, buffer, transform) {\n buffer.push(\"[\");\n let first = true;\n for (const val of array) {\n if (!first) {\n buffer.push(\" \");\n } else {\n first = false;\n }\n await writeValue(val, buffer, transform);\n }\n buffer.push(\"]\");\n}\n\nasync function writeValue(value, buffer, transform) {\n if (value instanceof Name) {\n buffer.push(`/${escapePDFName(value.name)}`);\n } else if (value instanceof Ref) {\n buffer.push(`${value.num} ${value.gen} R`);\n } else if (Array.isArray(value)) {\n await writeArray(value, buffer, transform);\n } else if (typeof value === \"string\") {\n if (transform) {\n value = transform.encryptString(value);\n }\n buffer.push(`(${escapeString(value)})`);\n } else if (typeof value === \"number\") {\n buffer.push(numberToString(value));\n } else if (typeof value === \"boolean\") {\n buffer.push(value.toString());\n } else if (value instanceof Dict) {\n await writeDict(value, buffer, transform);\n } else if (value instanceof BaseStream) {\n await writeStream(value, buffer, transform);\n } else if (value === null) {\n buffer.push(\"null\");\n } else {\n warn(`Unhandled value in writer: ${typeof value}, please file a bug.`);\n }\n}\n\nfunction writeInt(number, size, offset, buffer) {\n for (let i = size + offset - 1; i > offset - 1; i--) {\n buffer[i] = number & 0xff;\n number >>= 8;\n }\n return offset + size;\n}\n\nfunction writeString(string, offset, buffer) {\n for (let i = 0, len = string.length; i < len; i++) {\n buffer[offset + i] = string.charCodeAt(i) & 0xff;\n }\n}\n\nfunction computeMD5(filesize, xrefInfo) {\n const time = Math.floor(Date.now() / 1000);\n const filename = xrefInfo.filename || \"\";\n const md5Buffer = [time.toString(), filename, filesize.toString()];\n let md5BufferLen = md5Buffer.reduce((a, str) => a + str.length, 0);\n for (const value of Object.values(xrefInfo.info)) {\n md5Buffer.push(value);\n md5BufferLen += value.length;\n }\n\n const array = new Uint8Array(md5BufferLen);\n let offset = 0;\n for (const str of md5Buffer) {\n writeString(str, offset, array);\n offset += str.length;\n }\n return bytesToString(calculateMD5(array));\n}\n\nfunction writeXFADataForAcroform(str, newRefs) {\n const xml = new SimpleXMLParser({ hasAttributes: true }).parseFromString(str);\n\n for (const { xfa } of newRefs) {\n if (!xfa) {\n continue;\n }\n const { path, value } = xfa;\n if (!path) {\n continue;\n }\n const nodePath = parseXFAPath(path);\n let node = xml.documentElement.searchNode(nodePath, 0);\n if (!node && nodePath.length > 1) {\n // If we're lucky the last element in the path will identify the node.\n node = xml.documentElement.searchNode([nodePath.at(-1)], 0);\n }\n if (node) {\n node.childNodes = Array.isArray(value)\n ? value.map(val => new SimpleDOMNode(\"value\", val))\n : [new SimpleDOMNode(\"#text\", value)];\n } else {\n warn(`Node not found for path: ${path}`);\n }\n }\n const buffer = [];\n xml.documentElement.dump(buffer);\n return buffer.join(\"\");\n}\n\nasync function updateAcroform({\n xref,\n acroForm,\n acroFormRef,\n hasXfa,\n hasXfaDatasetsEntry,\n xfaDatasetsRef,\n needAppearances,\n newRefs,\n}) {\n if (hasXfa && !hasXfaDatasetsEntry && !xfaDatasetsRef) {\n warn(\"XFA - Cannot save it\");\n }\n\n if (!needAppearances && (!hasXfa || !xfaDatasetsRef || hasXfaDatasetsEntry)) {\n return;\n }\n\n const dict = acroForm.clone();\n\n if (hasXfa && !hasXfaDatasetsEntry) {\n // We've a XFA array which doesn't contain a datasets entry.\n // So we'll update the AcroForm dictionary to have an XFA containing\n // the datasets.\n const newXfa = acroForm.get(\"XFA\").slice();\n newXfa.splice(2, 0, \"datasets\");\n newXfa.splice(3, 0, xfaDatasetsRef);\n\n dict.set(\"XFA\", newXfa);\n }\n\n if (needAppearances) {\n dict.set(\"NeedAppearances\", true);\n }\n\n const buffer = [];\n await writeObject(acroFormRef, dict, buffer, xref);\n\n newRefs.push({ ref: acroFormRef, data: buffer.join(\"\") });\n}\n\nfunction updateXFA({ xfaData, xfaDatasetsRef, newRefs, xref }) {\n if (xfaData === null) {\n const datasets = xref.fetchIfRef(xfaDatasetsRef);\n xfaData = writeXFADataForAcroform(datasets.getString(), newRefs);\n }\n\n const encrypt = xref.encrypt;\n if (encrypt) {\n const transform = encrypt.createCipherTransform(\n xfaDatasetsRef.num,\n xfaDatasetsRef.gen\n );\n xfaData = transform.encryptString(xfaData);\n }\n const data =\n `${xfaDatasetsRef.num} ${xfaDatasetsRef.gen} obj\\n` +\n `<< /Type /EmbeddedFile /Length ${xfaData.length}>>\\nstream\\n` +\n xfaData +\n \"\\nendstream\\nendobj\\n\";\n\n newRefs.push({ ref: xfaDatasetsRef, data });\n}\n\nasync function incrementalUpdate({\n originalData,\n xrefInfo,\n newRefs,\n xref = null,\n hasXfa = false,\n xfaDatasetsRef = null,\n hasXfaDatasetsEntry = false,\n needAppearances,\n acroFormRef = null,\n acroForm = null,\n xfaData = null,\n}) {\n await updateAcroform({\n xref,\n acroForm,\n acroFormRef,\n hasXfa,\n hasXfaDatasetsEntry,\n xfaDatasetsRef,\n needAppearances,\n newRefs,\n });\n\n if (hasXfa) {\n updateXFA({\n xfaData,\n xfaDatasetsRef,\n newRefs,\n xref,\n });\n }\n\n const newXref = new Dict(null);\n const refForXrefTable = xrefInfo.newRef;\n\n let buffer, baseOffset;\n const lastByte = originalData.at(-1);\n if (lastByte === /* \\n */ 0x0a || lastByte === /* \\r */ 0x0d) {\n buffer = [];\n baseOffset = originalData.length;\n } else {\n // Avoid to concatenate %%EOF with an object definition\n buffer = [\"\\n\"];\n baseOffset = originalData.length + 1;\n }\n\n newXref.set(\"Size\", refForXrefTable.num + 1);\n newXref.set(\"Prev\", xrefInfo.startXRef);\n newXref.set(\"Type\", Name.get(\"XRef\"));\n\n if (xrefInfo.rootRef !== null) {\n newXref.set(\"Root\", xrefInfo.rootRef);\n }\n if (xrefInfo.infoRef !== null) {\n newXref.set(\"Info\", xrefInfo.infoRef);\n }\n if (xrefInfo.encryptRef !== null) {\n newXref.set(\"Encrypt\", xrefInfo.encryptRef);\n }\n\n // Add a ref for the new xref and sort them\n newRefs.push({ ref: refForXrefTable, data: \"\" });\n newRefs = newRefs.sort((a, b) => {\n // compare the refs\n return a.ref.num - b.ref.num;\n });\n\n const xrefTableData = [[0, 1, 0xffff]];\n const indexes = [0, 1];\n let maxOffset = 0;\n for (const { ref, data } of newRefs) {\n maxOffset = Math.max(maxOffset, baseOffset);\n xrefTableData.push([1, baseOffset, Math.min(ref.gen, 0xffff)]);\n baseOffset += data.length;\n indexes.push(ref.num, 1);\n buffer.push(data);\n }\n\n newXref.set(\"Index\", indexes);\n\n if (Array.isArray(xrefInfo.fileIds) && xrefInfo.fileIds.length > 0) {\n const md5 = computeMD5(baseOffset, xrefInfo);\n newXref.set(\"ID\", [xrefInfo.fileIds[0], md5]);\n }\n\n const offsetSize = Math.ceil(Math.log2(maxOffset) / 8);\n const sizes = [1, offsetSize, 2];\n const structSize = sizes[0] + sizes[1] + sizes[2];\n const tableLength = structSize * xrefTableData.length;\n newXref.set(\"W\", sizes);\n newXref.set(\"Length\", tableLength);\n\n buffer.push(`${refForXrefTable.num} ${refForXrefTable.gen} obj\\n`);\n await writeDict(newXref, buffer, null);\n buffer.push(\" stream\\n\");\n\n const bufferLen = buffer.reduce((a, str) => a + str.length, 0);\n const footer = `\\nendstream\\nendobj\\nstartxref\\n${baseOffset}\\n%%EOF\\n`;\n const array = new Uint8Array(\n originalData.length + bufferLen + tableLength + footer.length\n );\n\n // Original data\n array.set(originalData);\n let offset = originalData.length;\n\n // New data\n for (const str of buffer) {\n writeString(str, offset, array);\n offset += str.length;\n }\n\n // New xref table\n for (const [type, objOffset, gen] of xrefTableData) {\n offset = writeInt(type, sizes[0], offset, array);\n offset = writeInt(objOffset, sizes[1], offset, array);\n offset = writeInt(gen, sizes[2], offset, array);\n }\n\n // Add the footer\n writeString(footer, offset, array);\n\n return array;\n}\n\nexport { incrementalUpdate, writeDict, writeObject };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AnnotationPrefix, stringToPDFString, warn } from \"../shared/util.js\";\nimport { Dict, isName, Name, Ref, RefSetCache } from \"./primitives.js\";\nimport { NumberTree } from \"./name_number_tree.js\";\nimport { writeObject } from \"./writer.js\";\n\nconst MAX_DEPTH = 40;\n\nconst StructElementType = {\n PAGE_CONTENT: 1,\n STREAM_CONTENT: 2,\n OBJECT: 3,\n ANNOTATION: 4,\n ELEMENT: 5,\n};\n\nclass StructTreeRoot {\n constructor(rootDict, rootRef) {\n this.dict = rootDict;\n this.ref = rootRef instanceof Ref ? rootRef : null;\n this.roleMap = new Map();\n this.structParentIds = null;\n }\n\n init() {\n this.readRoleMap();\n }\n\n #addIdToPage(pageRef, id, type) {\n if (!(pageRef instanceof Ref) || id < 0) {\n return;\n }\n this.structParentIds ||= new RefSetCache();\n let ids = this.structParentIds.get(pageRef);\n if (!ids) {\n ids = [];\n this.structParentIds.put(pageRef, ids);\n }\n ids.push([id, type]);\n }\n\n addAnnotationIdToPage(pageRef, id) {\n this.#addIdToPage(pageRef, id, StructElementType.ANNOTATION);\n }\n\n readRoleMap() {\n const roleMapDict = this.dict.get(\"RoleMap\");\n if (!(roleMapDict instanceof Dict)) {\n return;\n }\n roleMapDict.forEach((key, value) => {\n if (!(value instanceof Name)) {\n return;\n }\n this.roleMap.set(key, value.name);\n });\n }\n\n static async canCreateStructureTree({\n catalogRef,\n pdfManager,\n newAnnotationsByPage,\n }) {\n if (!(catalogRef instanceof Ref)) {\n warn(\"Cannot save the struct tree: no catalog reference.\");\n return false;\n }\n\n let nextKey = 0;\n let hasNothingToUpdate = true;\n\n for (const [pageIndex, elements] of newAnnotationsByPage) {\n const { ref: pageRef } = await pdfManager.getPage(pageIndex);\n if (!(pageRef instanceof Ref)) {\n warn(`Cannot save the struct tree: page ${pageIndex} has no ref.`);\n hasNothingToUpdate = true;\n break;\n }\n for (const element of elements) {\n if (element.accessibilityData?.type) {\n // Each tag must have a structure type.\n element.parentTreeId = nextKey++;\n hasNothingToUpdate = false;\n }\n }\n }\n\n if (hasNothingToUpdate) {\n for (const elements of newAnnotationsByPage.values()) {\n for (const element of elements) {\n delete element.parentTreeId;\n }\n }\n return false;\n }\n\n return true;\n }\n\n static async createStructureTree({\n newAnnotationsByPage,\n xref,\n catalogRef,\n pdfManager,\n newRefs,\n }) {\n const root = pdfManager.catalog.cloneDict();\n const structTreeRootRef = xref.getNewTemporaryRef();\n root.set(\"StructTreeRoot\", structTreeRootRef);\n\n const buffer = [];\n await writeObject(catalogRef, root, buffer, xref);\n newRefs.push({ ref: catalogRef, data: buffer.join(\"\") });\n\n const structTreeRoot = new Dict(xref);\n structTreeRoot.set(\"Type\", Name.get(\"StructTreeRoot\"));\n const parentTreeRef = xref.getNewTemporaryRef();\n structTreeRoot.set(\"ParentTree\", parentTreeRef);\n const kids = [];\n structTreeRoot.set(\"K\", kids);\n\n const parentTree = new Dict(xref);\n const nums = [];\n parentTree.set(\"Nums\", nums);\n\n const nextKey = await this.#writeKids({\n newAnnotationsByPage,\n structTreeRootRef,\n kids,\n nums,\n xref,\n pdfManager,\n newRefs,\n buffer,\n });\n structTreeRoot.set(\"ParentTreeNextKey\", nextKey);\n\n buffer.length = 0;\n await writeObject(parentTreeRef, parentTree, buffer, xref);\n newRefs.push({ ref: parentTreeRef, data: buffer.join(\"\") });\n\n buffer.length = 0;\n await writeObject(structTreeRootRef, structTreeRoot, buffer, xref);\n newRefs.push({ ref: structTreeRootRef, data: buffer.join(\"\") });\n }\n\n async canUpdateStructTree({ pdfManager, xref, newAnnotationsByPage }) {\n if (!this.ref) {\n warn(\"Cannot update the struct tree: no root reference.\");\n return false;\n }\n\n let nextKey = this.dict.get(\"ParentTreeNextKey\");\n if (!Number.isInteger(nextKey) || nextKey < 0) {\n warn(\"Cannot update the struct tree: invalid next key.\");\n return false;\n }\n\n const parentTree = this.dict.get(\"ParentTree\");\n if (!(parentTree instanceof Dict)) {\n warn(\"Cannot update the struct tree: ParentTree isn't a dict.\");\n return false;\n }\n const nums = parentTree.get(\"Nums\");\n if (!Array.isArray(nums)) {\n warn(\"Cannot update the struct tree: nums isn't an array.\");\n return false;\n }\n const numberTree = new NumberTree(parentTree, xref);\n\n for (const pageIndex of newAnnotationsByPage.keys()) {\n const { pageDict } = await pdfManager.getPage(pageIndex);\n if (!pageDict.has(\"StructParents\")) {\n // StructParents is required when the content stream has some tagged\n // contents but a page can just have tagged annotations.\n continue;\n }\n const id = pageDict.get(\"StructParents\");\n if (!Number.isInteger(id) || !Array.isArray(numberTree.get(id))) {\n warn(`Cannot save the struct tree: page ${pageIndex} has a wrong id.`);\n return false;\n }\n }\n\n let hasNothingToUpdate = true;\n for (const [pageIndex, elements] of newAnnotationsByPage) {\n const { pageDict } = await pdfManager.getPage(pageIndex);\n StructTreeRoot.#collectParents({\n elements,\n xref: this.dict.xref,\n pageDict,\n numberTree,\n });\n\n for (const element of elements) {\n if (element.accessibilityData?.type) {\n // Each tag must have a structure type.\n element.parentTreeId = nextKey++;\n hasNothingToUpdate = false;\n }\n }\n }\n\n if (hasNothingToUpdate) {\n for (const elements of newAnnotationsByPage.values()) {\n for (const element of elements) {\n delete element.parentTreeId;\n delete element.structTreeParent;\n }\n }\n return false;\n }\n\n return true;\n }\n\n async updateStructureTree({ newAnnotationsByPage, pdfManager, newRefs }) {\n const xref = this.dict.xref;\n const structTreeRoot = this.dict.clone();\n const structTreeRootRef = this.ref;\n\n let parentTreeRef = structTreeRoot.getRaw(\"ParentTree\");\n let parentTree;\n if (parentTreeRef instanceof Ref) {\n parentTree = xref.fetch(parentTreeRef);\n } else {\n parentTree = parentTreeRef;\n parentTreeRef = xref.getNewTemporaryRef();\n structTreeRoot.set(\"ParentTree\", parentTreeRef);\n }\n parentTree = parentTree.clone();\n\n let nums = parentTree.getRaw(\"Nums\");\n let numsRef = null;\n if (nums instanceof Ref) {\n numsRef = nums;\n nums = xref.fetch(numsRef);\n }\n nums = nums.slice();\n if (!numsRef) {\n parentTree.set(\"Nums\", nums);\n }\n\n let kids = structTreeRoot.getRaw(\"K\");\n let kidsRef = null;\n if (kids instanceof Ref) {\n kidsRef = kids;\n kids = xref.fetch(kidsRef);\n } else {\n kidsRef = xref.getNewTemporaryRef();\n structTreeRoot.set(\"K\", kidsRef);\n }\n kids = Array.isArray(kids) ? kids.slice() : [kids];\n\n const buffer = [];\n const newNextkey = await StructTreeRoot.#writeKids({\n newAnnotationsByPage,\n structTreeRootRef,\n kids,\n nums,\n xref,\n pdfManager,\n newRefs,\n buffer,\n });\n structTreeRoot.set(\"ParentTreeNextKey\", newNextkey);\n\n buffer.length = 0;\n await writeObject(kidsRef, kids, buffer, xref);\n newRefs.push({ ref: kidsRef, data: buffer.join(\"\") });\n\n if (numsRef) {\n buffer.length = 0;\n await writeObject(numsRef, nums, buffer, xref);\n newRefs.push({ ref: numsRef, data: buffer.join(\"\") });\n }\n\n buffer.length = 0;\n await writeObject(parentTreeRef, parentTree, buffer, xref);\n newRefs.push({ ref: parentTreeRef, data: buffer.join(\"\") });\n\n buffer.length = 0;\n await writeObject(structTreeRootRef, structTreeRoot, buffer, xref);\n newRefs.push({ ref: structTreeRootRef, data: buffer.join(\"\") });\n }\n\n static async #writeKids({\n newAnnotationsByPage,\n structTreeRootRef,\n kids,\n nums,\n xref,\n pdfManager,\n newRefs,\n buffer,\n }) {\n const objr = Name.get(\"OBJR\");\n let nextKey = -Infinity;\n\n for (const [pageIndex, elements] of newAnnotationsByPage) {\n const { ref: pageRef } = await pdfManager.getPage(pageIndex);\n const isPageRef = pageRef instanceof Ref;\n for (const {\n accessibilityData,\n ref,\n parentTreeId,\n structTreeParent,\n } of elements) {\n if (!accessibilityData?.type) {\n continue;\n }\n const { type, title, lang, alt, expanded, actualText } =\n accessibilityData;\n nextKey = Math.max(nextKey, parentTreeId);\n\n const tagRef = xref.getNewTemporaryRef();\n const tagDict = new Dict(xref);\n\n // The structure type is required.\n tagDict.set(\"S\", Name.get(type));\n\n if (title) {\n tagDict.set(\"T\", title);\n }\n if (lang) {\n tagDict.set(\"Lang\", lang);\n }\n if (alt) {\n tagDict.set(\"Alt\", alt);\n }\n if (expanded) {\n tagDict.set(\"E\", expanded);\n }\n if (actualText) {\n tagDict.set(\"ActualText\", actualText);\n }\n\n if (structTreeParent) {\n await this.#updateParentTag({\n structTreeParent,\n tagDict,\n newTagRef: tagRef,\n fallbackRef: structTreeRootRef,\n xref,\n newRefs,\n buffer,\n });\n } else {\n tagDict.set(\"P\", structTreeRootRef);\n }\n\n const objDict = new Dict(xref);\n tagDict.set(\"K\", objDict);\n objDict.set(\"Type\", objr);\n if (isPageRef) {\n // Pg is optional.\n objDict.set(\"Pg\", pageRef);\n }\n objDict.set(\"Obj\", ref);\n\n buffer.length = 0;\n await writeObject(tagRef, tagDict, buffer, xref);\n newRefs.push({ ref: tagRef, data: buffer.join(\"\") });\n\n nums.push(parentTreeId, tagRef);\n kids.push(tagRef);\n }\n }\n return nextKey + 1;\n }\n\n static #collectParents({ elements, xref, pageDict, numberTree }) {\n const idToElement = new Map();\n for (const element of elements) {\n if (element.structTreeParentId) {\n const id = parseInt(element.structTreeParentId.split(\"_mc\")[1], 10);\n idToElement.set(id, element);\n }\n }\n\n const id = pageDict.get(\"StructParents\");\n if (!Number.isInteger(id)) {\n return;\n }\n // The parentArray type has already been checked by the caller.\n const parentArray = numberTree.get(id);\n\n const updateElement = (kid, pageKid, kidRef) => {\n const element = idToElement.get(kid);\n if (element) {\n const parentRef = pageKid.getRaw(\"P\");\n const parentDict = xref.fetchIfRef(parentRef);\n if (parentRef instanceof Ref && parentDict instanceof Dict) {\n // It should always the case, but we check just in case.\n element.structTreeParent = { ref: kidRef, dict: pageKid };\n }\n return true;\n }\n return false;\n };\n for (const kidRef of parentArray) {\n if (!(kidRef instanceof Ref)) {\n continue;\n }\n const pageKid = xref.fetch(kidRef);\n const k = pageKid.get(\"K\");\n if (Number.isInteger(k)) {\n updateElement(k, pageKid, kidRef);\n continue;\n }\n\n if (!Array.isArray(k)) {\n continue;\n }\n for (let kid of k) {\n kid = xref.fetchIfRef(kid);\n if (Number.isInteger(kid) && updateElement(kid, pageKid, kidRef)) {\n break;\n }\n }\n }\n }\n\n static async #updateParentTag({\n structTreeParent: { ref, dict },\n tagDict,\n newTagRef,\n fallbackRef,\n xref,\n newRefs,\n buffer,\n }) {\n // We get the parent of the tag.\n const parentRef = dict.getRaw(\"P\");\n let parentDict = xref.fetchIfRef(parentRef);\n\n tagDict.set(\"P\", parentRef);\n\n // We get the kids in order to insert a new tag at the right position.\n let saveParentDict = false;\n let parentKids;\n let parentKidsRef = parentDict.getRaw(\"K\");\n if (!(parentKidsRef instanceof Ref)) {\n parentKids = parentKidsRef;\n parentKidsRef = xref.getNewTemporaryRef();\n parentDict = parentDict.clone();\n parentDict.set(\"K\", parentKidsRef);\n saveParentDict = true;\n } else {\n parentKids = xref.fetch(parentKidsRef);\n }\n\n if (Array.isArray(parentKids)) {\n const index = parentKids.indexOf(ref);\n if (index >= 0) {\n parentKids = parentKids.slice();\n parentKids.splice(index + 1, 0, newTagRef);\n } else {\n warn(\"Cannot update the struct tree: parent kid not found.\");\n tagDict.set(\"P\", fallbackRef);\n return;\n }\n } else if (parentKids instanceof Dict) {\n parentKids = [parentKidsRef, newTagRef];\n parentKidsRef = xref.getNewTemporaryRef();\n parentDict.set(\"K\", parentKidsRef);\n saveParentDict = true;\n }\n\n buffer.length = 0;\n await writeObject(parentKidsRef, parentKids, buffer, xref);\n newRefs.push({ ref: parentKidsRef, data: buffer.join(\"\") });\n\n if (!saveParentDict) {\n return;\n }\n\n buffer.length = 0;\n await writeObject(parentRef, parentDict, buffer, xref);\n newRefs.push({ ref: parentRef, data: buffer.join(\"\") });\n }\n}\n\n/**\n * Instead of loading the whole tree we load just the page's relevant structure\n * elements, which means we need a wrapper structure to represent the tree.\n */\nclass StructElementNode {\n constructor(tree, dict) {\n this.tree = tree;\n this.dict = dict;\n this.kids = [];\n this.parseKids();\n }\n\n get role() {\n const nameObj = this.dict.get(\"S\");\n const name = nameObj instanceof Name ? nameObj.name : \"\";\n const { root } = this.tree;\n if (root.roleMap.has(name)) {\n return root.roleMap.get(name);\n }\n return name;\n }\n\n parseKids() {\n let pageObjId = null;\n const objRef = this.dict.getRaw(\"Pg\");\n if (objRef instanceof Ref) {\n pageObjId = objRef.toString();\n }\n const kids = this.dict.get(\"K\");\n if (Array.isArray(kids)) {\n for (const kid of kids) {\n const element = this.parseKid(pageObjId, kid);\n if (element) {\n this.kids.push(element);\n }\n }\n } else {\n const element = this.parseKid(pageObjId, kids);\n if (element) {\n this.kids.push(element);\n }\n }\n }\n\n parseKid(pageObjId, kid) {\n // A direct link to content, the integer is an mcid.\n if (Number.isInteger(kid)) {\n if (this.tree.pageDict.objId !== pageObjId) {\n return null;\n }\n\n return new StructElement({\n type: StructElementType.PAGE_CONTENT,\n mcid: kid,\n pageObjId,\n });\n }\n\n // Find the dictionary for the kid.\n let kidDict = null;\n if (kid instanceof Ref) {\n kidDict = this.dict.xref.fetch(kid);\n } else if (kid instanceof Dict) {\n kidDict = kid;\n }\n if (!kidDict) {\n return null;\n }\n const pageRef = kidDict.getRaw(\"Pg\");\n if (pageRef instanceof Ref) {\n pageObjId = pageRef.toString();\n }\n\n const type =\n kidDict.get(\"Type\") instanceof Name ? kidDict.get(\"Type\").name : null;\n if (type === \"MCR\") {\n if (this.tree.pageDict.objId !== pageObjId) {\n return null;\n }\n const kidRef = kidDict.getRaw(\"Stm\");\n return new StructElement({\n type: StructElementType.STREAM_CONTENT,\n refObjId: kidRef instanceof Ref ? kidRef.toString() : null,\n pageObjId,\n mcid: kidDict.get(\"MCID\"),\n });\n }\n\n if (type === \"OBJR\") {\n if (this.tree.pageDict.objId !== pageObjId) {\n return null;\n }\n const kidRef = kidDict.getRaw(\"Obj\");\n return new StructElement({\n type: StructElementType.OBJECT,\n refObjId: kidRef instanceof Ref ? kidRef.toString() : null,\n pageObjId,\n });\n }\n\n return new StructElement({\n type: StructElementType.ELEMENT,\n dict: kidDict,\n });\n }\n}\n\nclass StructElement {\n constructor({\n type,\n dict = null,\n mcid = null,\n pageObjId = null,\n refObjId = null,\n }) {\n this.type = type;\n this.dict = dict;\n this.mcid = mcid;\n this.pageObjId = pageObjId;\n this.refObjId = refObjId;\n this.parentNode = null;\n }\n}\n\nclass StructTreePage {\n constructor(structTreeRoot, pageDict) {\n this.root = structTreeRoot;\n this.rootDict = structTreeRoot ? structTreeRoot.dict : null;\n this.pageDict = pageDict;\n this.nodes = [];\n }\n\n parse(pageRef) {\n if (!this.root || !this.rootDict) {\n return;\n }\n\n const parentTree = this.rootDict.get(\"ParentTree\");\n if (!parentTree) {\n return;\n }\n const id = this.pageDict.get(\"StructParents\");\n const ids =\n pageRef instanceof Ref && this.root.structParentIds?.get(pageRef);\n if (!Number.isInteger(id) && !ids) {\n return;\n }\n\n const map = new Map();\n const numberTree = new NumberTree(parentTree, this.rootDict.xref);\n\n if (Number.isInteger(id)) {\n const parentArray = numberTree.get(id);\n if (Array.isArray(parentArray)) {\n for (const ref of parentArray) {\n if (ref instanceof Ref) {\n this.addNode(this.rootDict.xref.fetch(ref), map);\n }\n }\n }\n }\n\n if (!ids) {\n return;\n }\n for (const [elemId, type] of ids) {\n const obj = numberTree.get(elemId);\n if (obj) {\n const elem = this.addNode(this.rootDict.xref.fetchIfRef(obj), map);\n if (\n elem?.kids?.length === 1 &&\n elem.kids[0].type === StructElementType.OBJECT\n ) {\n // The node in the struct tree is wrapping an object (annotation\n // or xobject), so we need to update the type of the node to match\n // the type of the object.\n elem.kids[0].type = type;\n }\n }\n }\n }\n\n addNode(dict, map, level = 0) {\n if (level > MAX_DEPTH) {\n warn(\"StructTree MAX_DEPTH reached.\");\n return null;\n }\n\n if (map.has(dict)) {\n return map.get(dict);\n }\n\n const element = new StructElementNode(this, dict);\n map.set(dict, element);\n\n const parent = dict.get(\"P\");\n\n if (!parent || isName(parent.get(\"Type\"), \"StructTreeRoot\")) {\n if (!this.addTopLevelNode(dict, element)) {\n map.delete(dict);\n }\n return element;\n }\n\n const parentNode = this.addNode(parent, map, level + 1);\n if (!parentNode) {\n return element;\n }\n let save = false;\n for (const kid of parentNode.kids) {\n if (kid.type === StructElementType.ELEMENT && kid.dict === dict) {\n kid.parentNode = element;\n save = true;\n }\n }\n if (!save) {\n map.delete(dict);\n }\n return element;\n }\n\n addTopLevelNode(dict, element) {\n const obj = this.rootDict.get(\"K\");\n if (!obj) {\n return false;\n }\n\n if (obj instanceof Dict) {\n if (obj.objId !== dict.objId) {\n return false;\n }\n this.nodes[0] = element;\n return true;\n }\n\n if (!Array.isArray(obj)) {\n return true;\n }\n let save = false;\n for (let i = 0; i < obj.length; i++) {\n const kidRef = obj[i];\n if (kidRef?.toString() === dict.objId) {\n this.nodes[i] = element;\n save = true;\n }\n }\n return save;\n }\n\n /**\n * Convert the tree structure into a simplified object literal that can\n * be sent to the main thread.\n * @returns {Object}\n */\n get serializable() {\n function nodeToSerializable(node, parent, level = 0) {\n if (level > MAX_DEPTH) {\n warn(\"StructTree too deep to be fully serialized.\");\n return;\n }\n const obj = Object.create(null);\n obj.role = node.role;\n obj.children = [];\n parent.children.push(obj);\n const alt = node.dict.get(\"Alt\");\n if (typeof alt === \"string\") {\n obj.alt = stringToPDFString(alt);\n }\n const lang = node.dict.get(\"Lang\");\n if (typeof lang === \"string\") {\n obj.lang = stringToPDFString(lang);\n }\n\n for (const kid of node.kids) {\n const kidElement =\n kid.type === StructElementType.ELEMENT ? kid.parentNode : null;\n if (kidElement) {\n nodeToSerializable(kidElement, obj, level + 1);\n continue;\n } else if (\n kid.type === StructElementType.PAGE_CONTENT ||\n kid.type === StructElementType.STREAM_CONTENT\n ) {\n obj.children.push({\n type: \"content\",\n id: `p${kid.pageObjId}_mc${kid.mcid}`,\n });\n } else if (kid.type === StructElementType.OBJECT) {\n obj.children.push({\n type: \"object\",\n id: kid.refObjId,\n });\n } else if (kid.type === StructElementType.ANNOTATION) {\n obj.children.push({\n type: \"annotation\",\n id: `${AnnotationPrefix}${kid.refObjId}`,\n });\n }\n }\n }\n\n const root = Object.create(null);\n root.children = [];\n root.role = \"Root\";\n for (const child of this.nodes) {\n if (!child) {\n continue;\n }\n nodeToSerializable(child, root);\n }\n return root;\n }\n}\n\nexport { StructTreePage, StructTreeRoot };\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 collectActions,\n MissingDataException,\n PDF_VERSION_REGEXP,\n recoverJsURL,\n toRomanNumerals,\n XRefEntryException,\n} from \"./core_utils.js\";\nimport {\n createValidAbsoluteUrl,\n DocumentActionEventType,\n FormatError,\n info,\n objectSize,\n PermissionFlag,\n shadow,\n stringToPDFString,\n stringToUTF8String,\n warn,\n} from \"../shared/util.js\";\nimport {\n Dict,\n isDict,\n isName,\n isRefsEqual,\n Name,\n Ref,\n RefSet,\n RefSetCache,\n} from \"./primitives.js\";\nimport { NameTree, NumberTree } from \"./name_number_tree.js\";\nimport { BaseStream } from \"./base_stream.js\";\nimport { clearGlobalCaches } from \"./cleanup_helper.js\";\nimport { ColorSpace } from \"./colorspace.js\";\nimport { FileSpec } from \"./file_spec.js\";\nimport { GlobalImageCache } from \"./image_utils.js\";\nimport { MetadataParser } from \"./metadata_parser.js\";\nimport { StructTreeRoot } from \"./struct_tree.js\";\n\nfunction fetchDestination(dest) {\n if (dest instanceof Dict) {\n dest = dest.get(\"D\");\n }\n return Array.isArray(dest) ? dest : null;\n}\n\nfunction fetchRemoteDest(action) {\n let dest = action.get(\"D\");\n if (dest) {\n if (dest instanceof Name) {\n dest = dest.name;\n }\n if (typeof dest === \"string\") {\n return stringToPDFString(dest);\n } else if (Array.isArray(dest)) {\n return JSON.stringify(dest);\n }\n }\n return null;\n}\n\nclass Catalog {\n constructor(pdfManager, xref) {\n this.pdfManager = pdfManager;\n this.xref = xref;\n\n this._catDict = xref.getCatalogObj();\n if (!(this._catDict instanceof Dict)) {\n throw new FormatError(\"Catalog object is not a dictionary.\");\n }\n // Given that `XRef.parse` will both fetch *and* validate the /Pages-entry,\n // the following call must always succeed here:\n this.toplevelPagesDict; // eslint-disable-line no-unused-expressions\n\n this._actualNumPages = null;\n\n this.fontCache = new RefSetCache();\n this.builtInCMapCache = new Map();\n this.standardFontDataCache = new Map();\n this.globalImageCache = new GlobalImageCache();\n this.pageKidsCountCache = new RefSetCache();\n this.pageIndexCache = new RefSetCache();\n this.nonBlendModesSet = new RefSet();\n this.systemFontCache = new Map();\n }\n\n cloneDict() {\n return this._catDict.clone();\n }\n\n get version() {\n const version = this._catDict.get(\"Version\");\n if (version instanceof Name) {\n if (PDF_VERSION_REGEXP.test(version.name)) {\n return shadow(this, \"version\", version.name);\n }\n warn(`Invalid PDF catalog version: ${version.name}`);\n }\n return shadow(this, \"version\", null);\n }\n\n get lang() {\n const lang = this._catDict.get(\"Lang\");\n return shadow(\n this,\n \"lang\",\n typeof lang === \"string\" ? stringToPDFString(lang) : null\n );\n }\n\n /**\n * @type {boolean} `true` for pure XFA documents,\n * `false` for XFA Foreground documents.\n */\n get needsRendering() {\n const needsRendering = this._catDict.get(\"NeedsRendering\");\n return shadow(\n this,\n \"needsRendering\",\n typeof needsRendering === \"boolean\" ? needsRendering : false\n );\n }\n\n get collection() {\n let collection = null;\n try {\n const obj = this._catDict.get(\"Collection\");\n if (obj instanceof Dict && obj.size > 0) {\n collection = obj;\n }\n } catch (ex) {\n if (ex instanceof MissingDataException) {\n throw ex;\n }\n info(\"Cannot fetch Collection entry; assuming no collection is present.\");\n }\n return shadow(this, \"collection\", collection);\n }\n\n get acroForm() {\n let acroForm = null;\n try {\n const obj = this._catDict.get(\"AcroForm\");\n if (obj instanceof Dict && obj.size > 0) {\n acroForm = obj;\n }\n } catch (ex) {\n if (ex instanceof MissingDataException) {\n throw ex;\n }\n info(\"Cannot fetch AcroForm entry; assuming no forms are present.\");\n }\n return shadow(this, \"acroForm\", acroForm);\n }\n\n get acroFormRef() {\n const value = this._catDict.getRaw(\"AcroForm\");\n return shadow(this, \"acroFormRef\", value instanceof Ref ? value : null);\n }\n\n get metadata() {\n const streamRef = this._catDict.getRaw(\"Metadata\");\n if (!(streamRef instanceof Ref)) {\n return shadow(this, \"metadata\", null);\n }\n\n let metadata = null;\n try {\n const stream = this.xref.fetch(\n streamRef,\n /* suppressEncryption = */ !this.xref.encrypt?.encryptMetadata\n );\n\n if (stream instanceof BaseStream && stream.dict instanceof Dict) {\n const type = stream.dict.get(\"Type\");\n const subtype = stream.dict.get(\"Subtype\");\n\n if (isName(type, \"Metadata\") && isName(subtype, \"XML\")) {\n // XXX: This should examine the charset the XML document defines,\n // however since there are currently no real means to decode arbitrary\n // charsets, let's just hope that the author of the PDF was reasonable\n // enough to stick with the XML default charset, which is UTF-8.\n const data = stringToUTF8String(stream.getString());\n if (data) {\n metadata = new MetadataParser(data).serializable;\n }\n }\n }\n } catch (ex) {\n if (ex instanceof MissingDataException) {\n throw ex;\n }\n info(`Skipping invalid Metadata: \"${ex}\".`);\n }\n return shadow(this, \"metadata\", metadata);\n }\n\n get markInfo() {\n let markInfo = null;\n try {\n markInfo = this._readMarkInfo();\n } catch (ex) {\n if (ex instanceof MissingDataException) {\n throw ex;\n }\n warn(\"Unable to read mark info.\");\n }\n return shadow(this, \"markInfo\", markInfo);\n }\n\n /**\n * @private\n */\n _readMarkInfo() {\n const obj = this._catDict.get(\"MarkInfo\");\n if (!(obj instanceof Dict)) {\n return null;\n }\n\n const markInfo = {\n Marked: false,\n UserProperties: false,\n Suspects: false,\n };\n for (const key in markInfo) {\n const value = obj.get(key);\n if (typeof value === \"boolean\") {\n markInfo[key] = value;\n }\n }\n\n return markInfo;\n }\n\n get structTreeRoot() {\n let structTree = null;\n try {\n structTree = this._readStructTreeRoot();\n } catch (ex) {\n if (ex instanceof MissingDataException) {\n throw ex;\n }\n warn(\"Unable read to structTreeRoot info.\");\n }\n return shadow(this, \"structTreeRoot\", structTree);\n }\n\n /**\n * @private\n */\n _readStructTreeRoot() {\n const rawObj = this._catDict.getRaw(\"StructTreeRoot\");\n const obj = this.xref.fetchIfRef(rawObj);\n if (!(obj instanceof Dict)) {\n return null;\n }\n\n const root = new StructTreeRoot(obj, rawObj);\n root.init();\n return root;\n }\n\n get toplevelPagesDict() {\n const pagesObj = this._catDict.get(\"Pages\");\n if (!(pagesObj instanceof Dict)) {\n throw new FormatError(\"Invalid top-level pages dictionary.\");\n }\n return shadow(this, \"toplevelPagesDict\", pagesObj);\n }\n\n get documentOutline() {\n let obj = null;\n try {\n obj = this._readDocumentOutline();\n } catch (ex) {\n if (ex instanceof MissingDataException) {\n throw ex;\n }\n warn(\"Unable to read document outline.\");\n }\n return shadow(this, \"documentOutline\", obj);\n }\n\n /**\n * @private\n */\n _readDocumentOutline() {\n let obj = this._catDict.get(\"Outlines\");\n if (!(obj instanceof Dict)) {\n return null;\n }\n obj = obj.getRaw(\"First\");\n if (!(obj instanceof Ref)) {\n return null;\n }\n\n const root = { items: [] };\n const queue = [{ obj, parent: root }];\n // To avoid recursion, keep track of the already processed items.\n const processed = new RefSet();\n processed.put(obj);\n const xref = this.xref,\n blackColor = new Uint8ClampedArray(3);\n\n while (queue.length > 0) {\n const i = queue.shift();\n const outlineDict = xref.fetchIfRef(i.obj);\n if (outlineDict === null) {\n continue;\n }\n if (!outlineDict.has(\"Title\")) {\n throw new FormatError(\"Invalid outline item encountered.\");\n }\n\n const data = { url: null, dest: null, action: null };\n Catalog.parseDestDictionary({\n destDict: outlineDict,\n resultObj: data,\n docBaseUrl: this.baseUrl,\n docAttachments: this.attachments,\n });\n const title = outlineDict.get(\"Title\");\n const flags = outlineDict.get(\"F\") || 0;\n const color = outlineDict.getArray(\"C\");\n const count = outlineDict.get(\"Count\");\n let rgbColor = blackColor;\n\n // We only need to parse the color when it's valid, and non-default.\n if (\n Array.isArray(color) &&\n color.length === 3 &&\n (color[0] !== 0 || color[1] !== 0 || color[2] !== 0)\n ) {\n rgbColor = ColorSpace.singletons.rgb.getRgb(color, 0);\n }\n\n const outlineItem = {\n action: data.action,\n attachment: data.attachment,\n dest: data.dest,\n url: data.url,\n unsafeUrl: data.unsafeUrl,\n newWindow: data.newWindow,\n setOCGState: data.setOCGState,\n title: stringToPDFString(title),\n color: rgbColor,\n count: Number.isInteger(count) ? count : undefined,\n bold: !!(flags & 2),\n italic: !!(flags & 1),\n items: [],\n };\n\n i.parent.items.push(outlineItem);\n obj = outlineDict.getRaw(\"First\");\n if (obj instanceof Ref && !processed.has(obj)) {\n queue.push({ obj, parent: outlineItem });\n processed.put(obj);\n }\n obj = outlineDict.getRaw(\"Next\");\n if (obj instanceof Ref && !processed.has(obj)) {\n queue.push({ obj, parent: i.parent });\n processed.put(obj);\n }\n }\n return root.items.length > 0 ? root.items : null;\n }\n\n get permissions() {\n let permissions = null;\n try {\n permissions = this._readPermissions();\n } catch (ex) {\n if (ex instanceof MissingDataException) {\n throw ex;\n }\n warn(\"Unable to read permissions.\");\n }\n return shadow(this, \"permissions\", permissions);\n }\n\n /**\n * @private\n */\n _readPermissions() {\n const encrypt = this.xref.trailer.get(\"Encrypt\");\n if (!(encrypt instanceof Dict)) {\n return null;\n }\n\n let flags = encrypt.get(\"P\");\n if (typeof flags !== \"number\") {\n return null;\n }\n\n // PDF integer objects are represented internally in signed 2's complement\n // form. Therefore, convert the signed decimal integer to a signed 2's\n // complement binary integer so we can use regular bitwise operations on it.\n flags += 2 ** 32;\n\n const permissions = [];\n for (const key in PermissionFlag) {\n const value = PermissionFlag[key];\n if (flags & value) {\n permissions.push(value);\n }\n }\n return permissions;\n }\n\n get optionalContentConfig() {\n let config = null;\n try {\n const properties = this._catDict.get(\"OCProperties\");\n if (!properties) {\n return shadow(this, \"optionalContentConfig\", null);\n }\n const defaultConfig = properties.get(\"D\");\n if (!defaultConfig) {\n return shadow(this, \"optionalContentConfig\", null);\n }\n const groupsData = properties.get(\"OCGs\");\n if (!Array.isArray(groupsData)) {\n return shadow(this, \"optionalContentConfig\", null);\n }\n const groups = [];\n const groupRefs = new RefSet();\n // Ensure all the optional content groups are valid.\n for (const groupRef of groupsData) {\n if (!(groupRef instanceof Ref) || groupRefs.has(groupRef)) {\n continue;\n }\n groupRefs.put(groupRef);\n const group = this.xref.fetch(groupRef);\n groups.push({\n id: groupRef.toString(),\n name:\n typeof group.get(\"Name\") === \"string\"\n ? stringToPDFString(group.get(\"Name\"))\n : null,\n intent:\n typeof group.get(\"Intent\") === \"string\"\n ? stringToPDFString(group.get(\"Intent\"))\n : null,\n });\n }\n config = this._readOptionalContentConfig(defaultConfig, groupRefs);\n config.groups = groups;\n } catch (ex) {\n if (ex instanceof MissingDataException) {\n throw ex;\n }\n warn(`Unable to read optional content config: ${ex}`);\n }\n return shadow(this, \"optionalContentConfig\", config);\n }\n\n _readOptionalContentConfig(config, contentGroupRefs) {\n function parseOnOff(refs) {\n const onParsed = [];\n if (Array.isArray(refs)) {\n for (const value of refs) {\n if (!(value instanceof Ref)) {\n continue;\n }\n if (contentGroupRefs.has(value)) {\n onParsed.push(value.toString());\n }\n }\n }\n return onParsed;\n }\n\n function parseOrder(refs, nestedLevels = 0) {\n if (!Array.isArray(refs)) {\n return null;\n }\n const order = [];\n\n for (const value of refs) {\n if (value instanceof Ref && contentGroupRefs.has(value)) {\n parsedOrderRefs.put(value); // Handle \"hidden\" groups, see below.\n\n order.push(value.toString());\n continue;\n }\n // Handle nested /Order arrays (see e.g. issue 9462 and bug 1240641).\n const nestedOrder = parseNestedOrder(value, nestedLevels);\n if (nestedOrder) {\n order.push(nestedOrder);\n }\n }\n\n if (nestedLevels > 0) {\n return order;\n }\n const hiddenGroups = [];\n for (const groupRef of contentGroupRefs) {\n if (parsedOrderRefs.has(groupRef)) {\n continue;\n }\n hiddenGroups.push(groupRef.toString());\n }\n if (hiddenGroups.length) {\n order.push({ name: null, order: hiddenGroups });\n }\n\n return order;\n }\n\n function parseNestedOrder(ref, nestedLevels) {\n if (++nestedLevels > MAX_NESTED_LEVELS) {\n warn(\"parseNestedOrder - reached MAX_NESTED_LEVELS.\");\n return null;\n }\n const value = xref.fetchIfRef(ref);\n if (!Array.isArray(value)) {\n return null;\n }\n const nestedName = xref.fetchIfRef(value[0]);\n if (typeof nestedName !== \"string\") {\n return null;\n }\n const nestedOrder = parseOrder(value.slice(1), nestedLevels);\n if (!nestedOrder || !nestedOrder.length) {\n return null;\n }\n return { name: stringToPDFString(nestedName), order: nestedOrder };\n }\n\n const xref = this.xref,\n parsedOrderRefs = new RefSet(),\n MAX_NESTED_LEVELS = 10;\n\n return {\n name:\n typeof config.get(\"Name\") === \"string\"\n ? stringToPDFString(config.get(\"Name\"))\n : null,\n creator:\n typeof config.get(\"Creator\") === \"string\"\n ? stringToPDFString(config.get(\"Creator\"))\n : null,\n baseState:\n config.get(\"BaseState\") instanceof Name\n ? config.get(\"BaseState\").name\n : null,\n on: parseOnOff(config.get(\"ON\")),\n off: parseOnOff(config.get(\"OFF\")),\n order: parseOrder(config.get(\"Order\")),\n groups: null,\n };\n }\n\n setActualNumPages(num = null) {\n this._actualNumPages = num;\n }\n\n get hasActualNumPages() {\n return this._actualNumPages !== null;\n }\n\n get _pagesCount() {\n const obj = this.toplevelPagesDict.get(\"Count\");\n if (!Number.isInteger(obj)) {\n throw new FormatError(\n \"Page count in top-level pages dictionary is not an integer.\"\n );\n }\n return shadow(this, \"_pagesCount\", obj);\n }\n\n get numPages() {\n return this.hasActualNumPages ? this._actualNumPages : this._pagesCount;\n }\n\n get destinations() {\n const obj = this._readDests(),\n dests = Object.create(null);\n if (obj instanceof NameTree) {\n for (const [key, value] of obj.getAll()) {\n const dest = fetchDestination(value);\n if (dest) {\n dests[stringToPDFString(key)] = dest;\n }\n }\n } else if (obj instanceof Dict) {\n obj.forEach(function (key, value) {\n const dest = fetchDestination(value);\n if (dest) {\n dests[key] = dest;\n }\n });\n }\n return shadow(this, \"destinations\", dests);\n }\n\n getDestination(id) {\n const obj = this._readDests();\n if (obj instanceof NameTree) {\n const dest = fetchDestination(obj.get(id));\n if (dest) {\n return dest;\n }\n // Fallback to checking the *entire* NameTree, in an attempt to handle\n // corrupt PDF documents with out-of-order NameTrees (fixes issue 10272).\n const allDest = this.destinations[id];\n if (allDest) {\n warn(`Found \"${id}\" at an incorrect position in the NameTree.`);\n return allDest;\n }\n } else if (obj instanceof Dict) {\n const dest = fetchDestination(obj.get(id));\n if (dest) {\n return dest;\n }\n }\n return null;\n }\n\n /**\n * @private\n */\n _readDests() {\n const obj = this._catDict.get(\"Names\");\n if (obj?.has(\"Dests\")) {\n return new NameTree(obj.getRaw(\"Dests\"), this.xref);\n } else if (this._catDict.has(\"Dests\")) {\n // Simple destination dictionary.\n return this._catDict.get(\"Dests\");\n }\n return undefined;\n }\n\n get pageLabels() {\n let obj = null;\n try {\n obj = this._readPageLabels();\n } catch (ex) {\n if (ex instanceof MissingDataException) {\n throw ex;\n }\n warn(\"Unable to read page labels.\");\n }\n return shadow(this, \"pageLabels\", obj);\n }\n\n /**\n * @private\n */\n _readPageLabels() {\n const obj = this._catDict.getRaw(\"PageLabels\");\n if (!obj) {\n return null;\n }\n\n const pageLabels = new Array(this.numPages);\n let style = null,\n prefix = \"\";\n\n const numberTree = new NumberTree(obj, this.xref);\n const nums = numberTree.getAll();\n let currentLabel = \"\",\n currentIndex = 1;\n\n for (let i = 0, ii = this.numPages; i < ii; i++) {\n const labelDict = nums.get(i);\n\n if (labelDict !== undefined) {\n if (!(labelDict instanceof Dict)) {\n throw new FormatError(\"PageLabel is not a dictionary.\");\n }\n\n if (\n labelDict.has(\"Type\") &&\n !isName(labelDict.get(\"Type\"), \"PageLabel\")\n ) {\n throw new FormatError(\"Invalid type in PageLabel dictionary.\");\n }\n\n if (labelDict.has(\"S\")) {\n const s = labelDict.get(\"S\");\n if (!(s instanceof Name)) {\n throw new FormatError(\"Invalid style in PageLabel dictionary.\");\n }\n style = s.name;\n } else {\n style = null;\n }\n\n if (labelDict.has(\"P\")) {\n const p = labelDict.get(\"P\");\n if (typeof p !== \"string\") {\n throw new FormatError(\"Invalid prefix in PageLabel dictionary.\");\n }\n prefix = stringToPDFString(p);\n } else {\n prefix = \"\";\n }\n\n if (labelDict.has(\"St\")) {\n const st = labelDict.get(\"St\");\n if (!(Number.isInteger(st) && st >= 1)) {\n throw new FormatError(\"Invalid start in PageLabel dictionary.\");\n }\n currentIndex = st;\n } else {\n currentIndex = 1;\n }\n }\n\n switch (style) {\n case \"D\":\n currentLabel = currentIndex;\n break;\n case \"R\":\n case \"r\":\n currentLabel = toRomanNumerals(currentIndex, style === \"r\");\n break;\n case \"A\":\n case \"a\":\n const LIMIT = 26; // Use only the characters A-Z, or a-z.\n const A_UPPER_CASE = 0x41,\n A_LOWER_CASE = 0x61;\n\n const baseCharCode = style === \"a\" ? A_LOWER_CASE : A_UPPER_CASE;\n const letterIndex = currentIndex - 1;\n const character = String.fromCharCode(\n baseCharCode + (letterIndex % LIMIT)\n );\n currentLabel = character.repeat(Math.floor(letterIndex / LIMIT) + 1);\n break;\n default:\n if (style) {\n throw new FormatError(\n `Invalid style \"${style}\" in PageLabel dictionary.`\n );\n }\n currentLabel = \"\";\n }\n\n pageLabels[i] = prefix + currentLabel;\n currentIndex++;\n }\n return pageLabels;\n }\n\n get pageLayout() {\n const obj = this._catDict.get(\"PageLayout\");\n // Purposely use a non-standard default value, rather than 'SinglePage', to\n // allow differentiating between `undefined` and /SinglePage since that does\n // affect the Scroll mode (continuous/non-continuous) used in Adobe Reader.\n let pageLayout = \"\";\n\n if (obj instanceof Name) {\n switch (obj.name) {\n case \"SinglePage\":\n case \"OneColumn\":\n case \"TwoColumnLeft\":\n case \"TwoColumnRight\":\n case \"TwoPageLeft\":\n case \"TwoPageRight\":\n pageLayout = obj.name;\n }\n }\n return shadow(this, \"pageLayout\", pageLayout);\n }\n\n get pageMode() {\n const obj = this._catDict.get(\"PageMode\");\n let pageMode = \"UseNone\"; // Default value.\n\n if (obj instanceof Name) {\n switch (obj.name) {\n case \"UseNone\":\n case \"UseOutlines\":\n case \"UseThumbs\":\n case \"FullScreen\":\n case \"UseOC\":\n case \"UseAttachments\":\n pageMode = obj.name;\n }\n }\n return shadow(this, \"pageMode\", pageMode);\n }\n\n get viewerPreferences() {\n const obj = this._catDict.get(\"ViewerPreferences\");\n if (!(obj instanceof Dict)) {\n return shadow(this, \"viewerPreferences\", null);\n }\n let prefs = null;\n\n for (const key of obj.getKeys()) {\n const value = obj.get(key);\n let prefValue;\n\n switch (key) {\n case \"HideToolbar\":\n case \"HideMenubar\":\n case \"HideWindowUI\":\n case \"FitWindow\":\n case \"CenterWindow\":\n case \"DisplayDocTitle\":\n case \"PickTrayByPDFSize\":\n if (typeof value === \"boolean\") {\n prefValue = value;\n }\n break;\n case \"NonFullScreenPageMode\":\n if (value instanceof Name) {\n switch (value.name) {\n case \"UseNone\":\n case \"UseOutlines\":\n case \"UseThumbs\":\n case \"UseOC\":\n prefValue = value.name;\n break;\n default:\n prefValue = \"UseNone\";\n }\n }\n break;\n case \"Direction\":\n if (value instanceof Name) {\n switch (value.name) {\n case \"L2R\":\n case \"R2L\":\n prefValue = value.name;\n break;\n default:\n prefValue = \"L2R\";\n }\n }\n break;\n case \"ViewArea\":\n case \"ViewClip\":\n case \"PrintArea\":\n case \"PrintClip\":\n if (value instanceof Name) {\n switch (value.name) {\n case \"MediaBox\":\n case \"CropBox\":\n case \"BleedBox\":\n case \"TrimBox\":\n case \"ArtBox\":\n prefValue = value.name;\n break;\n default:\n prefValue = \"CropBox\";\n }\n }\n break;\n case \"PrintScaling\":\n if (value instanceof Name) {\n switch (value.name) {\n case \"None\":\n case \"AppDefault\":\n prefValue = value.name;\n break;\n default:\n prefValue = \"AppDefault\";\n }\n }\n break;\n case \"Duplex\":\n if (value instanceof Name) {\n switch (value.name) {\n case \"Simplex\":\n case \"DuplexFlipShortEdge\":\n case \"DuplexFlipLongEdge\":\n prefValue = value.name;\n break;\n default:\n prefValue = \"None\";\n }\n }\n break;\n case \"PrintPageRange\":\n // The number of elements must be even.\n if (Array.isArray(value) && value.length % 2 === 0) {\n const isValid = value.every((page, i, arr) => {\n return (\n Number.isInteger(page) &&\n page > 0 &&\n (i === 0 || page >= arr[i - 1]) &&\n page <= this.numPages\n );\n });\n if (isValid) {\n prefValue = value;\n }\n }\n break;\n case \"NumCopies\":\n if (Number.isInteger(value) && value > 0) {\n prefValue = value;\n }\n break;\n default:\n warn(`Ignoring non-standard key in ViewerPreferences: ${key}.`);\n continue;\n }\n\n if (prefValue === undefined) {\n warn(`Bad value, for key \"${key}\", in ViewerPreferences: ${value}.`);\n continue;\n }\n if (!prefs) {\n prefs = Object.create(null);\n }\n prefs[key] = prefValue;\n }\n return shadow(this, \"viewerPreferences\", prefs);\n }\n\n get openAction() {\n const obj = this._catDict.get(\"OpenAction\");\n const openAction = Object.create(null);\n\n if (obj instanceof Dict) {\n // Convert the OpenAction dictionary into a format that works with\n // `parseDestDictionary`, to avoid having to re-implement those checks.\n const destDict = new Dict(this.xref);\n destDict.set(\"A\", obj);\n\n const resultObj = { url: null, dest: null, action: null };\n Catalog.parseDestDictionary({ destDict, resultObj });\n\n if (Array.isArray(resultObj.dest)) {\n openAction.dest = resultObj.dest;\n } else if (resultObj.action) {\n openAction.action = resultObj.action;\n }\n } else if (Array.isArray(obj)) {\n openAction.dest = obj;\n }\n return shadow(\n this,\n \"openAction\",\n objectSize(openAction) > 0 ? openAction : null\n );\n }\n\n get attachments() {\n const obj = this._catDict.get(\"Names\");\n let attachments = null;\n\n if (obj instanceof Dict && obj.has(\"EmbeddedFiles\")) {\n const nameTree = new NameTree(obj.getRaw(\"EmbeddedFiles\"), this.xref);\n for (const [key, value] of nameTree.getAll()) {\n const fs = new FileSpec(value, this.xref);\n if (!attachments) {\n attachments = Object.create(null);\n }\n attachments[stringToPDFString(key)] = fs.serializable;\n }\n }\n return shadow(this, \"attachments\", attachments);\n }\n\n get xfaImages() {\n const obj = this._catDict.get(\"Names\");\n let xfaImages = null;\n\n if (obj instanceof Dict && obj.has(\"XFAImages\")) {\n const nameTree = new NameTree(obj.getRaw(\"XFAImages\"), this.xref);\n for (const [key, value] of nameTree.getAll()) {\n if (!xfaImages) {\n xfaImages = new Dict(this.xref);\n }\n xfaImages.set(stringToPDFString(key), value);\n }\n }\n return shadow(this, \"xfaImages\", xfaImages);\n }\n\n _collectJavaScript() {\n const obj = this._catDict.get(\"Names\");\n let javaScript = null;\n\n function appendIfJavaScriptDict(name, jsDict) {\n if (!(jsDict instanceof Dict)) {\n return;\n }\n if (!isName(jsDict.get(\"S\"), \"JavaScript\")) {\n return;\n }\n\n let js = jsDict.get(\"JS\");\n if (js instanceof BaseStream) {\n js = js.getString();\n } else if (typeof js !== \"string\") {\n return;\n }\n js = stringToPDFString(js).replaceAll(\"\\x00\", \"\");\n // Skip empty entries, similar to the `_collectJS` function.\n if (js) {\n (javaScript ||= new Map()).set(name, js);\n }\n }\n\n if (obj instanceof Dict && obj.has(\"JavaScript\")) {\n const nameTree = new NameTree(obj.getRaw(\"JavaScript\"), this.xref);\n for (const [key, value] of nameTree.getAll()) {\n appendIfJavaScriptDict(stringToPDFString(key), value);\n }\n }\n // Append OpenAction \"JavaScript\" actions, if any, to the JavaScript map.\n const openAction = this._catDict.get(\"OpenAction\");\n if (openAction) {\n appendIfJavaScriptDict(\"OpenAction\", openAction);\n }\n\n return javaScript;\n }\n\n get jsActions() {\n const javaScript = this._collectJavaScript();\n let actions = collectActions(\n this.xref,\n this._catDict,\n DocumentActionEventType\n );\n\n if (javaScript) {\n actions ||= Object.create(null);\n\n for (const [key, val] of javaScript) {\n if (key in actions) {\n actions[key].push(val);\n } else {\n actions[key] = [val];\n }\n }\n }\n return shadow(this, \"jsActions\", actions);\n }\n\n async fontFallback(id, handler) {\n const translatedFonts = await Promise.all(this.fontCache);\n\n for (const translatedFont of translatedFonts) {\n if (translatedFont.loadedName === id) {\n translatedFont.fallback(handler);\n return;\n }\n }\n }\n\n async cleanup(manuallyTriggered = false) {\n clearGlobalCaches();\n this.globalImageCache.clear(/* onlyData = */ manuallyTriggered);\n this.pageKidsCountCache.clear();\n this.pageIndexCache.clear();\n this.nonBlendModesSet.clear();\n\n const translatedFonts = await Promise.all(this.fontCache);\n\n for (const { dict } of translatedFonts) {\n delete dict.cacheKey;\n }\n this.fontCache.clear();\n this.builtInCMapCache.clear();\n this.standardFontDataCache.clear();\n this.systemFontCache.clear();\n }\n\n async getPageDict(pageIndex) {\n const nodesToVisit = [this.toplevelPagesDict];\n const visitedNodes = new RefSet();\n\n const pagesRef = this._catDict.getRaw(\"Pages\");\n if (pagesRef instanceof Ref) {\n visitedNodes.put(pagesRef);\n }\n const xref = this.xref,\n pageKidsCountCache = this.pageKidsCountCache,\n pageIndexCache = this.pageIndexCache;\n let currentPageIndex = 0;\n\n while (nodesToVisit.length) {\n const currentNode = nodesToVisit.pop();\n\n if (currentNode instanceof Ref) {\n const count = pageKidsCountCache.get(currentNode);\n // Skip nodes where the page can't be.\n if (count >= 0 && currentPageIndex + count <= pageIndex) {\n currentPageIndex += count;\n continue;\n }\n // Prevent circular references in the /Pages tree.\n if (visitedNodes.has(currentNode)) {\n throw new FormatError(\"Pages tree contains circular reference.\");\n }\n visitedNodes.put(currentNode);\n\n const obj = await xref.fetchAsync(currentNode);\n if (obj instanceof Dict) {\n let type = obj.getRaw(\"Type\");\n if (type instanceof Ref) {\n type = await xref.fetchAsync(type);\n }\n if (isName(type, \"Page\") || !obj.has(\"Kids\")) {\n // Cache the Page reference, since it can *greatly* improve\n // performance by reducing redundant lookups in long documents\n // where all nodes are found at *one* level of the tree.\n if (!pageKidsCountCache.has(currentNode)) {\n pageKidsCountCache.put(currentNode, 1);\n }\n // Help improve performance of the `getPageIndex` method.\n if (!pageIndexCache.has(currentNode)) {\n pageIndexCache.put(currentNode, currentPageIndex);\n }\n\n if (currentPageIndex === pageIndex) {\n return [obj, currentNode];\n }\n currentPageIndex++;\n continue;\n }\n }\n nodesToVisit.push(obj);\n continue;\n }\n\n // Must be a child page dictionary.\n if (!(currentNode instanceof Dict)) {\n throw new FormatError(\n \"Page dictionary kid reference points to wrong type of object.\"\n );\n }\n const { objId } = currentNode;\n\n let count = currentNode.getRaw(\"Count\");\n if (count instanceof Ref) {\n count = await xref.fetchAsync(count);\n }\n if (Number.isInteger(count) && count >= 0) {\n // Cache the Kids count, since it can reduce redundant lookups in\n // documents where all nodes are found at *one* level of the tree.\n if (objId && !pageKidsCountCache.has(objId)) {\n pageKidsCountCache.put(objId, count);\n }\n\n // Skip nodes where the page can't be.\n if (currentPageIndex + count <= pageIndex) {\n currentPageIndex += count;\n continue;\n }\n }\n\n let kids = currentNode.getRaw(\"Kids\");\n if (kids instanceof Ref) {\n kids = await xref.fetchAsync(kids);\n }\n if (!Array.isArray(kids)) {\n // Prevent errors in corrupt PDF documents that violate the\n // specification by *inlining* Page dicts directly in the Kids\n // array, rather than using indirect objects (fixes issue9540.pdf).\n let type = currentNode.getRaw(\"Type\");\n if (type instanceof Ref) {\n type = await xref.fetchAsync(type);\n }\n if (isName(type, \"Page\") || !currentNode.has(\"Kids\")) {\n if (currentPageIndex === pageIndex) {\n return [currentNode, null];\n }\n currentPageIndex++;\n continue;\n }\n\n throw new FormatError(\"Page dictionary kids object is not an array.\");\n }\n\n // Always check all `Kids` nodes, to avoid getting stuck in an empty\n // node further down in the tree (see issue5644.pdf, issue8088.pdf),\n // and to ensure that we actually find the correct `Page` dict.\n for (let last = kids.length - 1; last >= 0; last--) {\n nodesToVisit.push(kids[last]);\n }\n }\n\n throw new Error(`Page index ${pageIndex} not found.`);\n }\n\n /**\n * Eagerly fetches the entire /Pages-tree; should ONLY be used as a fallback.\n * @returns {Promise<Map>}\n */\n async getAllPageDicts(recoveryMode = false) {\n const { ignoreErrors } = this.pdfManager.evaluatorOptions;\n\n const queue = [{ currentNode: this.toplevelPagesDict, posInKids: 0 }];\n const visitedNodes = new RefSet();\n\n const pagesRef = this._catDict.getRaw(\"Pages\");\n if (pagesRef instanceof Ref) {\n visitedNodes.put(pagesRef);\n }\n const map = new Map(),\n xref = this.xref,\n pageIndexCache = this.pageIndexCache;\n let pageIndex = 0;\n\n function addPageDict(pageDict, pageRef) {\n // Help improve performance of the `getPageIndex` method.\n if (pageRef && !pageIndexCache.has(pageRef)) {\n pageIndexCache.put(pageRef, pageIndex);\n }\n\n map.set(pageIndex++, [pageDict, pageRef]);\n }\n function addPageError(error) {\n if (error instanceof XRefEntryException && !recoveryMode) {\n throw error;\n }\n if (recoveryMode && ignoreErrors && pageIndex === 0) {\n // Ensure that the viewer will always load (fixes issue15590.pdf).\n warn(`getAllPageDicts - Skipping invalid first page: \"${error}\".`);\n error = Dict.empty;\n }\n\n map.set(pageIndex++, [error, null]);\n }\n\n while (queue.length > 0) {\n const queueItem = queue.at(-1);\n const { currentNode, posInKids } = queueItem;\n\n let kids = currentNode.getRaw(\"Kids\");\n if (kids instanceof Ref) {\n try {\n kids = await xref.fetchAsync(kids);\n } catch (ex) {\n addPageError(ex);\n break;\n }\n }\n if (!Array.isArray(kids)) {\n addPageError(\n new FormatError(\"Page dictionary kids object is not an array.\")\n );\n break;\n }\n\n if (posInKids >= kids.length) {\n queue.pop();\n continue;\n }\n\n const kidObj = kids[posInKids];\n let obj;\n if (kidObj instanceof Ref) {\n // Prevent circular references in the /Pages tree.\n if (visitedNodes.has(kidObj)) {\n addPageError(\n new FormatError(\"Pages tree contains circular reference.\")\n );\n break;\n }\n visitedNodes.put(kidObj);\n\n try {\n obj = await xref.fetchAsync(kidObj);\n } catch (ex) {\n addPageError(ex);\n break;\n }\n } else {\n // Prevent errors in corrupt PDF documents that violate the\n // specification by *inlining* Page dicts directly in the Kids\n // array, rather than using indirect objects (see issue9540.pdf).\n obj = kidObj;\n }\n if (!(obj instanceof Dict)) {\n addPageError(\n new FormatError(\n \"Page dictionary kid reference points to wrong type of object.\"\n )\n );\n break;\n }\n\n let type = obj.getRaw(\"Type\");\n if (type instanceof Ref) {\n try {\n type = await xref.fetchAsync(type);\n } catch (ex) {\n addPageError(ex);\n break;\n }\n }\n if (isName(type, \"Page\") || !obj.has(\"Kids\")) {\n addPageDict(obj, kidObj instanceof Ref ? kidObj : null);\n } else {\n queue.push({ currentNode: obj, posInKids: 0 });\n }\n queueItem.posInKids++;\n }\n return map;\n }\n\n getPageIndex(pageRef) {\n const cachedPageIndex = this.pageIndexCache.get(pageRef);\n if (cachedPageIndex !== undefined) {\n return Promise.resolve(cachedPageIndex);\n }\n\n // The page tree nodes have the count of all the leaves below them. To get\n // how many pages are before we just have to walk up the tree and keep\n // adding the count of siblings to the left of the node.\n const xref = this.xref;\n\n function pagesBeforeRef(kidRef) {\n let total = 0,\n parentRef;\n\n return xref\n .fetchAsync(kidRef)\n .then(function (node) {\n if (\n isRefsEqual(kidRef, pageRef) &&\n !isDict(node, \"Page\") &&\n !(node instanceof Dict && !node.has(\"Type\") && node.has(\"Contents\"))\n ) {\n throw new FormatError(\n \"The reference does not point to a /Page dictionary.\"\n );\n }\n if (!node) {\n return null;\n }\n if (!(node instanceof Dict)) {\n throw new FormatError(\"Node must be a dictionary.\");\n }\n parentRef = node.getRaw(\"Parent\");\n return node.getAsync(\"Parent\");\n })\n .then(function (parent) {\n if (!parent) {\n return null;\n }\n if (!(parent instanceof Dict)) {\n throw new FormatError(\"Parent must be a dictionary.\");\n }\n return parent.getAsync(\"Kids\");\n })\n .then(function (kids) {\n if (!kids) {\n return null;\n }\n\n const kidPromises = [];\n let found = false;\n for (const kid of kids) {\n if (!(kid instanceof Ref)) {\n throw new FormatError(\"Kid must be a reference.\");\n }\n if (isRefsEqual(kid, kidRef)) {\n found = true;\n break;\n }\n kidPromises.push(\n xref.fetchAsync(kid).then(function (obj) {\n if (!(obj instanceof Dict)) {\n throw new FormatError(\"Kid node must be a dictionary.\");\n }\n if (obj.has(\"Count\")) {\n total += obj.get(\"Count\");\n } else {\n // Page leaf node.\n total++;\n }\n })\n );\n }\n if (!found) {\n throw new FormatError(\"Kid reference not found in parent's kids.\");\n }\n return Promise.all(kidPromises).then(function () {\n return [total, parentRef];\n });\n });\n }\n\n let total = 0;\n const next = ref =>\n pagesBeforeRef(ref).then(args => {\n if (!args) {\n this.pageIndexCache.put(pageRef, total);\n return total;\n }\n const [count, parentRef] = args;\n total += count;\n return next(parentRef);\n });\n\n return next(pageRef);\n }\n\n get baseUrl() {\n const uri = this._catDict.get(\"URI\");\n if (uri instanceof Dict) {\n const base = uri.get(\"Base\");\n if (typeof base === \"string\") {\n const absoluteUrl = createValidAbsoluteUrl(base, null, {\n tryConvertEncoding: true,\n });\n if (absoluteUrl) {\n return shadow(this, \"baseUrl\", absoluteUrl.href);\n }\n }\n }\n return shadow(this, \"baseUrl\", this.pdfManager.docBaseUrl);\n }\n\n /**\n * @typedef {Object} ParseDestDictionaryParameters\n * @property {Dict} destDict - The dictionary containing the destination.\n * @property {Object} resultObj - The object where the parsed destination\n * properties will be placed.\n * @property {string} [docBaseUrl] - The document base URL that is used when\n * attempting to recover valid absolute URLs from relative ones.\n * @property {Object} [docAttachments] - The document attachments (may not\n * exist in most PDF documents).\n */\n\n /**\n * Helper function used to parse the contents of destination dictionaries.\n * @param {ParseDestDictionaryParameters} params\n */\n static parseDestDictionary({\n destDict,\n resultObj,\n docBaseUrl = null,\n docAttachments = null,\n }) {\n if (!(destDict instanceof Dict)) {\n warn(\"parseDestDictionary: `destDict` must be a dictionary.\");\n return;\n }\n\n let action = destDict.get(\"A\"),\n url,\n dest;\n if (!(action instanceof Dict)) {\n if (destDict.has(\"Dest\")) {\n // A /Dest entry should *only* contain a Name or an Array, but some bad\n // PDF generators ignore that and treat it as an /A entry.\n action = destDict.get(\"Dest\");\n } else {\n action = destDict.get(\"AA\");\n if (action instanceof Dict) {\n if (action.has(\"D\")) {\n // MouseDown\n action = action.get(\"D\");\n } else if (action.has(\"U\")) {\n // MouseUp\n action = action.get(\"U\");\n }\n }\n }\n }\n\n if (action instanceof Dict) {\n const actionType = action.get(\"S\");\n if (!(actionType instanceof Name)) {\n warn(\"parseDestDictionary: Invalid type in Action dictionary.\");\n return;\n }\n const actionName = actionType.name;\n\n switch (actionName) {\n case \"ResetForm\":\n const flags = action.get(\"Flags\");\n const include = ((typeof flags === \"number\" ? flags : 0) & 1) === 0;\n const fields = [];\n const refs = [];\n for (const obj of action.get(\"Fields\") || []) {\n if (obj instanceof Ref) {\n refs.push(obj.toString());\n } else if (typeof obj === \"string\") {\n fields.push(stringToPDFString(obj));\n }\n }\n resultObj.resetForm = { fields, refs, include };\n break;\n case \"URI\":\n url = action.get(\"URI\");\n if (url instanceof Name) {\n // Some bad PDFs do not put parentheses around relative URLs.\n url = \"/\" + url.name;\n }\n break;\n\n case \"GoTo\":\n dest = action.get(\"D\");\n break;\n\n case \"Launch\":\n // We neither want, nor can, support arbitrary 'Launch' actions.\n // However, in practice they are mostly used for linking to other PDF\n // files, which we thus attempt to support (utilizing `docBaseUrl`).\n /* falls through */\n\n case \"GoToR\":\n const urlDict = action.get(\"F\");\n if (urlDict instanceof Dict) {\n // We assume that we found a FileSpec dictionary\n // and fetch the URL without checking any further.\n url = urlDict.get(\"F\") || null;\n } else if (typeof urlDict === \"string\") {\n url = urlDict;\n }\n\n // NOTE: the destination is relative to the *remote* document.\n const remoteDest = fetchRemoteDest(action);\n if (remoteDest && typeof url === \"string\") {\n url = /* baseUrl = */ url.split(\"#\", 1)[0] + \"#\" + remoteDest;\n }\n // The 'NewWindow' property, equal to `LinkTarget.BLANK`.\n const newWindow = action.get(\"NewWindow\");\n if (typeof newWindow === \"boolean\") {\n resultObj.newWindow = newWindow;\n }\n break;\n\n case \"GoToE\":\n const target = action.get(\"T\");\n let attachment;\n\n if (docAttachments && target instanceof Dict) {\n const relationship = target.get(\"R\");\n const name = target.get(\"N\");\n\n if (isName(relationship, \"C\") && typeof name === \"string\") {\n attachment = docAttachments[stringToPDFString(name)];\n }\n }\n\n if (attachment) {\n resultObj.attachment = attachment;\n\n // NOTE: the destination is relative to the *attachment*.\n const attachmentDest = fetchRemoteDest(action);\n if (attachmentDest) {\n resultObj.attachmentDest = attachmentDest;\n }\n } else {\n warn(`parseDestDictionary - unimplemented \"GoToE\" action.`);\n }\n break;\n\n case \"Named\":\n const namedAction = action.get(\"N\");\n if (namedAction instanceof Name) {\n resultObj.action = namedAction.name;\n }\n break;\n\n case \"SetOCGState\":\n const state = action.get(\"State\");\n const preserveRB = action.get(\"PreserveRB\");\n\n if (!Array.isArray(state) || state.length === 0) {\n break;\n }\n const stateArr = [];\n\n for (const elem of state) {\n if (elem instanceof Name) {\n switch (elem.name) {\n case \"ON\":\n case \"OFF\":\n case \"Toggle\":\n stateArr.push(elem.name);\n break;\n }\n } else if (elem instanceof Ref) {\n stateArr.push(elem.toString());\n }\n }\n\n if (stateArr.length !== state.length) {\n break; // Some of the original entries are not valid.\n }\n resultObj.setOCGState = {\n state: stateArr,\n preserveRB: typeof preserveRB === \"boolean\" ? preserveRB : true,\n };\n break;\n\n case \"JavaScript\":\n const jsAction = action.get(\"JS\");\n let js;\n\n if (jsAction instanceof BaseStream) {\n js = jsAction.getString();\n } else if (typeof jsAction === \"string\") {\n js = jsAction;\n }\n\n const jsURL = js && recoverJsURL(stringToPDFString(js));\n if (jsURL) {\n url = jsURL.url;\n resultObj.newWindow = jsURL.newWindow;\n break;\n }\n /* falls through */\n default:\n if (actionName === \"JavaScript\" || actionName === \"SubmitForm\") {\n // Don't bother the user with a warning for actions that require\n // scripting support, since those will be handled separately.\n break;\n }\n warn(`parseDestDictionary - unsupported action: \"${actionName}\".`);\n break;\n }\n } else if (destDict.has(\"Dest\")) {\n // Simple destination.\n dest = destDict.get(\"Dest\");\n }\n\n if (typeof url === \"string\") {\n const absoluteUrl = createValidAbsoluteUrl(url, docBaseUrl, {\n addDefaultProtocol: true,\n tryConvertEncoding: true,\n });\n if (absoluteUrl) {\n resultObj.url = absoluteUrl.href;\n }\n resultObj.unsafeUrl = url;\n }\n if (dest) {\n if (dest instanceof Name) {\n dest = dest.name;\n }\n if (typeof dest === \"string\") {\n resultObj.dest = stringToPDFString(dest);\n } else if (Array.isArray(dest)) {\n resultObj.dest = dest;\n }\n }\n }\n}\n\nexport { Catalog };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Dict, Ref, RefSet } from \"./primitives.js\";\nimport { BaseStream } from \"./base_stream.js\";\nimport { MissingDataException } from \"./core_utils.js\";\nimport { warn } from \"../shared/util.js\";\n\nfunction mayHaveChildren(value) {\n return (\n value instanceof Ref ||\n value instanceof Dict ||\n value instanceof BaseStream ||\n Array.isArray(value)\n );\n}\n\nfunction addChildren(node, nodesToVisit) {\n if (node instanceof Dict) {\n node = node.getRawValues();\n } else if (node instanceof BaseStream) {\n node = node.dict.getRawValues();\n } else if (!Array.isArray(node)) {\n return;\n }\n for (const rawValue of node) {\n if (mayHaveChildren(rawValue)) {\n nodesToVisit.push(rawValue);\n }\n }\n}\n\n/**\n * A helper for loading missing data in `Dict` graphs. It traverses the graph\n * depth first and queues up any objects that have missing data. Once it has\n * has traversed as many objects that are available it attempts to bundle the\n * missing data requests and then resume from the nodes that weren't ready.\n *\n * NOTE: It provides protection from circular references by keeping track of\n * loaded references. However, you must be careful not to load any graphs\n * that have references to the catalog or other pages since that will cause the\n * entire PDF document object graph to be traversed.\n */\nclass ObjectLoader {\n constructor(dict, keys, xref) {\n this.dict = dict;\n this.keys = keys;\n this.xref = xref;\n this.refSet = null;\n }\n\n async load() {\n // Don't walk the graph if all the data is already loaded.\n if (this.xref.stream.isDataLoaded) {\n return undefined;\n }\n\n const { keys, dict } = this;\n this.refSet = new RefSet();\n // Setup the initial nodes to visit.\n const nodesToVisit = [];\n for (const key of keys) {\n const rawValue = dict.getRaw(key);\n // Skip nodes that are guaranteed to be empty.\n if (rawValue !== undefined) {\n nodesToVisit.push(rawValue);\n }\n }\n return this._walk(nodesToVisit);\n }\n\n async _walk(nodesToVisit) {\n const nodesToRevisit = [];\n const pendingRequests = [];\n // DFS walk of the object graph.\n while (nodesToVisit.length) {\n let currentNode = nodesToVisit.pop();\n\n // Only references or chunked streams can cause missing data exceptions.\n if (currentNode instanceof Ref) {\n // Skip nodes that have already been visited.\n if (this.refSet.has(currentNode)) {\n continue;\n }\n try {\n this.refSet.put(currentNode);\n currentNode = this.xref.fetch(currentNode);\n } catch (ex) {\n if (!(ex instanceof MissingDataException)) {\n warn(`ObjectLoader._walk - requesting all data: \"${ex}\".`);\n this.refSet = null;\n\n const { manager } = this.xref.stream;\n return manager.requestAllChunks();\n }\n nodesToRevisit.push(currentNode);\n pendingRequests.push({ begin: ex.begin, end: ex.end });\n }\n }\n if (currentNode instanceof BaseStream) {\n const baseStreams = currentNode.getBaseStreams();\n if (baseStreams) {\n let foundMissingData = false;\n for (const stream of baseStreams) {\n if (stream.isDataLoaded) {\n continue;\n }\n foundMissingData = true;\n pendingRequests.push({ begin: stream.start, end: stream.end });\n }\n if (foundMissingData) {\n nodesToRevisit.push(currentNode);\n }\n }\n }\n\n addChildren(currentNode, nodesToVisit);\n }\n\n if (pendingRequests.length) {\n await this.xref.stream.manager.requestRanges(pendingRequests);\n\n for (const node of nodesToRevisit) {\n // Remove any reference nodes from the current `RefSet` so they\n // aren't skipped when we revist them.\n if (node instanceof Ref) {\n this.refSet.remove(node);\n }\n }\n return this._walk(nodesToRevisit);\n }\n // Everything is loaded.\n this.refSet = null;\n return undefined;\n }\n}\n\nexport { ObjectLoader };\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// We use these symbols to avoid name conflict between tags\n// and properties/methods names.\nconst $acceptWhitespace = Symbol();\nconst $addHTML = Symbol();\nconst $appendChild = Symbol();\nconst $childrenToHTML = Symbol();\nconst $clean = Symbol();\nconst $cleanPage = Symbol();\nconst $cleanup = Symbol();\nconst $clone = Symbol();\nconst $consumed = Symbol();\nconst $content = Symbol(\"content\");\nconst $data = Symbol(\"data\");\nconst $dump = Symbol();\nconst $extra = Symbol(\"extra\");\nconst $finalize = Symbol();\nconst $flushHTML = Symbol();\nconst $getAttributeIt = Symbol();\nconst $getAttributes = Symbol();\nconst $getAvailableSpace = Symbol();\nconst $getChildrenByClass = Symbol();\nconst $getChildrenByName = Symbol();\nconst $getChildrenByNameIt = Symbol();\nconst $getDataValue = Symbol();\nconst $getExtra = Symbol();\nconst $getRealChildrenByNameIt = Symbol();\nconst $getChildren = Symbol();\nconst $getContainedChildren = Symbol();\nconst $getNextPage = Symbol();\nconst $getSubformParent = Symbol();\nconst $getParent = Symbol();\nconst $getTemplateRoot = Symbol();\nconst $globalData = Symbol();\nconst $hasSettableValue = Symbol();\nconst $ids = Symbol();\nconst $indexOf = Symbol();\nconst $insertAt = Symbol();\nconst $isCDATAXml = Symbol();\nconst $isBindable = Symbol();\nconst $isDataValue = Symbol();\nconst $isDescendent = Symbol();\nconst $isNsAgnostic = Symbol();\nconst $isSplittable = Symbol();\nconst $isThereMoreWidth = Symbol();\nconst $isTransparent = Symbol();\nconst $isUsable = Symbol();\nconst $lastAttribute = Symbol();\nconst $namespaceId = Symbol(\"namespaceId\");\nconst $nodeName = Symbol(\"nodeName\");\nconst $nsAttributes = Symbol();\nconst $onChild = Symbol();\nconst $onChildCheck = Symbol();\nconst $onText = Symbol();\nconst $pushGlyphs = Symbol();\nconst $popPara = Symbol();\nconst $pushPara = Symbol();\nconst $removeChild = Symbol();\nconst $root = Symbol(\"root\");\nconst $resolvePrototypes = Symbol();\nconst $searchNode = Symbol();\nconst $setId = Symbol();\nconst $setSetAttributes = Symbol();\nconst $setValue = Symbol();\nconst $tabIndex = Symbol();\nconst $text = Symbol();\nconst $toPages = Symbol();\nconst $toHTML = Symbol();\nconst $toString = Symbol();\nconst $toStyle = Symbol();\nconst $uid = Symbol(\"uid\");\n\nexport {\n $acceptWhitespace,\n $addHTML,\n $appendChild,\n $childrenToHTML,\n $clean,\n $cleanPage,\n $cleanup,\n $clone,\n $consumed,\n $content,\n $data,\n $dump,\n $extra,\n $finalize,\n $flushHTML,\n $getAttributeIt,\n $getAttributes,\n $getAvailableSpace,\n $getChildren,\n $getChildrenByClass,\n $getChildrenByName,\n $getChildrenByNameIt,\n $getContainedChildren,\n $getDataValue,\n $getExtra,\n $getNextPage,\n $getParent,\n $getRealChildrenByNameIt,\n $getSubformParent,\n $getTemplateRoot,\n $globalData,\n $hasSettableValue,\n $ids,\n $indexOf,\n $insertAt,\n $isBindable,\n $isCDATAXml,\n $isDataValue,\n $isDescendent,\n $isNsAgnostic,\n $isSplittable,\n $isThereMoreWidth,\n $isTransparent,\n $isUsable,\n $lastAttribute,\n $namespaceId,\n $nodeName,\n $nsAttributes,\n $onChild,\n $onChildCheck,\n $onText,\n $popPara,\n $pushGlyphs,\n $pushPara,\n $removeChild,\n $resolvePrototypes,\n $root,\n $searchNode,\n $setId,\n $setSetAttributes,\n $setValue,\n $tabIndex,\n $text,\n $toHTML,\n $toPages,\n $toString,\n $toStyle,\n $uid,\n};\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\nconst $buildXFAObject = Symbol();\n\nconst NamespaceIds = {\n config: {\n id: 0,\n check: ns => ns.startsWith(\"http://www.xfa.org/schema/xci/\"),\n },\n connectionSet: {\n id: 1,\n check: ns => ns.startsWith(\"http://www.xfa.org/schema/xfa-connection-set/\"),\n },\n datasets: {\n id: 2,\n check: ns => ns.startsWith(\"http://www.xfa.org/schema/xfa-data/\"),\n },\n form: {\n id: 3,\n check: ns => ns.startsWith(\"http://www.xfa.org/schema/xfa-form/\"),\n },\n localeSet: {\n id: 4,\n check: ns => ns.startsWith(\"http://www.xfa.org/schema/xfa-locale-set/\"),\n },\n pdf: {\n id: 5,\n check: ns => ns === \"http://ns.adobe.com/xdp/pdf/\",\n },\n signature: {\n id: 6,\n check: ns => ns === \"http://www.w3.org/2000/09/xmldsig#\",\n },\n sourceSet: {\n id: 7,\n check: ns => ns.startsWith(\"http://www.xfa.org/schema/xfa-source-set/\"),\n },\n stylesheet: {\n id: 8,\n check: ns => ns === \"http://www.w3.org/1999/XSL/Transform\",\n },\n template: {\n id: 9,\n check: ns => ns.startsWith(\"http://www.xfa.org/schema/xfa-template/\"),\n },\n xdc: {\n id: 10,\n check: ns => ns.startsWith(\"http://www.xfa.org/schema/xdc/\"),\n },\n xdp: {\n id: 11,\n check: ns => ns === \"http://ns.adobe.com/xdp/\",\n },\n xfdf: {\n id: 12,\n check: ns => ns === \"http://ns.adobe.com/xfdf/\",\n },\n xhtml: {\n id: 13,\n check: ns => ns === \"http://www.w3.org/1999/xhtml\",\n },\n xmpmeta: {\n id: 14,\n check: ns => ns === \"http://ns.adobe.com/xmpmeta/\",\n },\n};\n\nexport { $buildXFAObject, NamespaceIds };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { shadow } from \"../../shared/util.js\";\n\nconst dimConverters = {\n pt: x => x,\n cm: x => (x / 2.54) * 72,\n mm: x => (x / (10 * 2.54)) * 72,\n in: x => x * 72,\n px: x => x,\n};\nconst measurementPattern = /([+-]?\\d+\\.?\\d*)(.*)/;\n\nfunction stripQuotes(str) {\n if (str.startsWith(\"'\") || str.startsWith('\"')) {\n return str.slice(1, -1);\n }\n return str;\n}\n\nfunction getInteger({ data, defaultValue, validate }) {\n if (!data) {\n return defaultValue;\n }\n data = data.trim();\n const n = parseInt(data, 10);\n if (!isNaN(n) && validate(n)) {\n return n;\n }\n return defaultValue;\n}\n\nfunction getFloat({ data, defaultValue, validate }) {\n if (!data) {\n return defaultValue;\n }\n data = data.trim();\n const n = parseFloat(data);\n if (!isNaN(n) && validate(n)) {\n return n;\n }\n return defaultValue;\n}\n\nfunction getKeyword({ data, defaultValue, validate }) {\n if (!data) {\n return defaultValue;\n }\n data = data.trim();\n if (validate(data)) {\n return data;\n }\n return defaultValue;\n}\n\nfunction getStringOption(data, options) {\n return getKeyword({\n data,\n defaultValue: options[0],\n validate: k => options.includes(k),\n });\n}\n\nfunction getMeasurement(str, def = \"0\") {\n def ||= \"0\";\n if (!str) {\n return getMeasurement(def);\n }\n const match = str.trim().match(measurementPattern);\n if (!match) {\n return getMeasurement(def);\n }\n const [, valueStr, unit] = match;\n const value = parseFloat(valueStr);\n if (isNaN(value)) {\n return getMeasurement(def);\n }\n\n if (value === 0) {\n return 0;\n }\n\n const conv = dimConverters[unit];\n if (conv) {\n return conv(value);\n }\n\n return value;\n}\n\nfunction getRatio(data) {\n if (!data) {\n return { num: 1, den: 1 };\n }\n const ratio = data\n .trim()\n .split(/\\s*:\\s*/)\n .map(x => parseFloat(x))\n .filter(x => !isNaN(x));\n if (ratio.length === 1) {\n ratio.push(1);\n }\n\n if (ratio.length === 0) {\n return { num: 1, den: 1 };\n }\n\n const [num, den] = ratio;\n return { num, den };\n}\n\nfunction getRelevant(data) {\n if (!data) {\n return [];\n }\n return data\n .trim()\n .split(/\\s+/)\n .map(e => {\n return {\n excluded: e[0] === \"-\",\n viewname: e.substring(1),\n };\n });\n}\n\nfunction getColor(data, def = [0, 0, 0]) {\n let [r, g, b] = def;\n if (!data) {\n return { r, g, b };\n }\n const color = data\n .trim()\n .split(/\\s*,\\s*/)\n .map(c => Math.min(Math.max(0, parseInt(c.trim(), 10)), 255))\n .map(c => (isNaN(c) ? 0 : c));\n\n if (color.length < 3) {\n return { r, g, b };\n }\n\n [r, g, b] = color;\n return { r, g, b };\n}\n\nfunction getBBox(data) {\n const def = -1;\n if (!data) {\n return { x: def, y: def, width: def, height: def };\n }\n const bbox = data\n .trim()\n .split(/\\s*,\\s*/)\n .map(m => getMeasurement(m, \"-1\"));\n if (bbox.length < 4 || bbox[2] < 0 || bbox[3] < 0) {\n return { x: def, y: def, width: def, height: def };\n }\n\n const [x, y, width, height] = bbox;\n return { x, y, width, height };\n}\n\nclass HTMLResult {\n static get FAILURE() {\n return shadow(this, \"FAILURE\", new HTMLResult(false, null, null, null));\n }\n\n static get EMPTY() {\n return shadow(this, \"EMPTY\", new HTMLResult(true, null, null, null));\n }\n\n constructor(success, html, bbox, breakNode) {\n this.success = success;\n this.html = html;\n this.bbox = bbox;\n this.breakNode = breakNode;\n }\n\n isBreak() {\n return !!this.breakNode;\n }\n\n static breakNode(node) {\n return new HTMLResult(false, null, null, node);\n }\n\n static success(html, bbox = null) {\n return new HTMLResult(true, html, bbox, null);\n }\n}\n\nexport {\n getBBox,\n getColor,\n getFloat,\n getInteger,\n getKeyword,\n getMeasurement,\n getRatio,\n getRelevant,\n getStringOption,\n HTMLResult,\n stripQuotes,\n};\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { $globalData } from \"./symbol_utils.js\";\nimport { stripQuotes } from \"./utils.js\";\nimport { warn } from \"../../shared/util.js\";\n\nclass FontFinder {\n constructor(pdfFonts) {\n this.fonts = new Map();\n this.cache = new Map();\n this.warned = new Set();\n this.defaultFont = null;\n this.add(pdfFonts);\n }\n\n add(pdfFonts, reallyMissingFonts = null) {\n for (const pdfFont of pdfFonts) {\n this.addPdfFont(pdfFont);\n }\n for (const pdfFont of this.fonts.values()) {\n if (!pdfFont.regular) {\n pdfFont.regular = pdfFont.italic || pdfFont.bold || pdfFont.bolditalic;\n }\n }\n\n if (!reallyMissingFonts || reallyMissingFonts.size === 0) {\n return;\n }\n const myriad = this.fonts.get(\"PdfJS-Fallback-PdfJS-XFA\");\n for (const missing of reallyMissingFonts) {\n this.fonts.set(missing, myriad);\n }\n }\n\n addPdfFont(pdfFont) {\n const cssFontInfo = pdfFont.cssFontInfo;\n const name = cssFontInfo.fontFamily;\n let font = this.fonts.get(name);\n if (!font) {\n font = Object.create(null);\n this.fonts.set(name, font);\n if (!this.defaultFont) {\n this.defaultFont = font;\n }\n }\n let property = \"\";\n const fontWeight = parseFloat(cssFontInfo.fontWeight);\n if (parseFloat(cssFontInfo.italicAngle) !== 0) {\n property = fontWeight >= 700 ? \"bolditalic\" : \"italic\";\n } else if (fontWeight >= 700) {\n property = \"bold\";\n }\n\n if (!property) {\n if (pdfFont.name.includes(\"Bold\") || pdfFont.psName?.includes(\"Bold\")) {\n property = \"bold\";\n }\n if (\n pdfFont.name.includes(\"Italic\") ||\n pdfFont.name.endsWith(\"It\") ||\n pdfFont.psName?.includes(\"Italic\") ||\n pdfFont.psName?.endsWith(\"It\")\n ) {\n property += \"italic\";\n }\n }\n\n if (!property) {\n property = \"regular\";\n }\n\n font[property] = pdfFont;\n }\n\n getDefault() {\n return this.defaultFont;\n }\n\n find(fontName, mustWarn = true) {\n let font = this.fonts.get(fontName) || this.cache.get(fontName);\n if (font) {\n return font;\n }\n\n const pattern = /,|-|_| |bolditalic|bold|italic|regular|it/gi;\n let name = fontName.replaceAll(pattern, \"\");\n font = this.fonts.get(name);\n if (font) {\n this.cache.set(fontName, font);\n return font;\n }\n name = name.toLowerCase();\n\n const maybe = [];\n for (const [family, pdfFont] of this.fonts.entries()) {\n if (family.replaceAll(pattern, \"\").toLowerCase().startsWith(name)) {\n maybe.push(pdfFont);\n }\n }\n\n if (maybe.length === 0) {\n for (const [, pdfFont] of this.fonts.entries()) {\n if (\n pdfFont.regular.name\n ?.replaceAll(pattern, \"\")\n .toLowerCase()\n .startsWith(name)\n ) {\n maybe.push(pdfFont);\n }\n }\n }\n\n if (maybe.length === 0) {\n name = name.replaceAll(/psmt|mt/gi, \"\");\n for (const [family, pdfFont] of this.fonts.entries()) {\n if (family.replaceAll(pattern, \"\").toLowerCase().startsWith(name)) {\n maybe.push(pdfFont);\n }\n }\n }\n\n if (maybe.length === 0) {\n for (const pdfFont of this.fonts.values()) {\n if (\n pdfFont.regular.name\n ?.replaceAll(pattern, \"\")\n .toLowerCase()\n .startsWith(name)\n ) {\n maybe.push(pdfFont);\n }\n }\n }\n\n if (maybe.length >= 1) {\n if (maybe.length !== 1 && mustWarn) {\n warn(`XFA - Too many choices to guess the correct font: ${fontName}`);\n }\n this.cache.set(fontName, maybe[0]);\n return maybe[0];\n }\n\n if (mustWarn && !this.warned.has(fontName)) {\n this.warned.add(fontName);\n warn(`XFA - Cannot find the font: ${fontName}`);\n }\n return null;\n }\n}\n\nfunction selectFont(xfaFont, typeface) {\n if (xfaFont.posture === \"italic\") {\n if (xfaFont.weight === \"bold\") {\n return typeface.bolditalic;\n }\n return typeface.italic;\n } else if (xfaFont.weight === \"bold\") {\n return typeface.bold;\n }\n\n return typeface.regular;\n}\n\nfunction getMetrics(xfaFont, real = false) {\n let pdfFont = null;\n if (xfaFont) {\n const name = stripQuotes(xfaFont.typeface);\n const typeface = xfaFont[$globalData].fontFinder.find(name);\n pdfFont = selectFont(xfaFont, typeface);\n }\n\n if (!pdfFont) {\n return {\n lineHeight: 12,\n lineGap: 2,\n lineNoGap: 10,\n };\n }\n\n const size = xfaFont.size || 10;\n const lineHeight = pdfFont.lineHeight\n ? Math.max(real ? 0 : 1.2, pdfFont.lineHeight)\n : 1.2;\n const lineGap = pdfFont.lineGap === undefined ? 0.2 : pdfFont.lineGap;\n return {\n lineHeight: lineHeight * size,\n lineGap: lineGap * size,\n lineNoGap: Math.max(1, lineHeight - lineGap) * size,\n };\n}\n\nexport { FontFinder, getMetrics, selectFont };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { selectFont } from \"./fonts.js\";\n\nconst WIDTH_FACTOR = 1.02;\n\nclass FontInfo {\n constructor(xfaFont, margin, lineHeight, fontFinder) {\n this.lineHeight = lineHeight;\n this.paraMargin = margin || {\n top: 0,\n bottom: 0,\n left: 0,\n right: 0,\n };\n\n if (!xfaFont) {\n [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder);\n return;\n }\n\n this.xfaFont = {\n typeface: xfaFont.typeface,\n posture: xfaFont.posture,\n weight: xfaFont.weight,\n size: xfaFont.size,\n letterSpacing: xfaFont.letterSpacing,\n };\n const typeface = fontFinder.find(xfaFont.typeface);\n if (!typeface) {\n [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder);\n return;\n }\n\n this.pdfFont = selectFont(xfaFont, typeface);\n\n if (!this.pdfFont) {\n [this.pdfFont, this.xfaFont] = this.defaultFont(fontFinder);\n }\n }\n\n defaultFont(fontFinder) {\n // TODO: Add a default font based on Liberation.\n const font =\n fontFinder.find(\"Helvetica\", false) ||\n fontFinder.find(\"Myriad Pro\", false) ||\n fontFinder.find(\"Arial\", false) ||\n fontFinder.getDefault();\n if (font?.regular) {\n const pdfFont = font.regular;\n const info = pdfFont.cssFontInfo;\n const xfaFont = {\n typeface: info.fontFamily,\n posture: \"normal\",\n weight: \"normal\",\n size: 10,\n letterSpacing: 0,\n };\n return [pdfFont, xfaFont];\n }\n\n const xfaFont = {\n typeface: \"Courier\",\n posture: \"normal\",\n weight: \"normal\",\n size: 10,\n letterSpacing: 0,\n };\n return [null, xfaFont];\n }\n}\n\nclass FontSelector {\n constructor(\n defaultXfaFont,\n defaultParaMargin,\n defaultLineHeight,\n fontFinder\n ) {\n this.fontFinder = fontFinder;\n this.stack = [\n new FontInfo(\n defaultXfaFont,\n defaultParaMargin,\n defaultLineHeight,\n fontFinder\n ),\n ];\n }\n\n pushData(xfaFont, margin, lineHeight) {\n const lastFont = this.stack.at(-1);\n for (const name of [\n \"typeface\",\n \"posture\",\n \"weight\",\n \"size\",\n \"letterSpacing\",\n ]) {\n if (!xfaFont[name]) {\n xfaFont[name] = lastFont.xfaFont[name];\n }\n }\n\n for (const name of [\"top\", \"bottom\", \"left\", \"right\"]) {\n if (isNaN(margin[name])) {\n margin[name] = lastFont.paraMargin[name];\n }\n }\n\n const fontInfo = new FontInfo(\n xfaFont,\n margin,\n lineHeight || lastFont.lineHeight,\n this.fontFinder\n );\n if (!fontInfo.pdfFont) {\n fontInfo.pdfFont = lastFont.pdfFont;\n }\n\n this.stack.push(fontInfo);\n }\n\n popFont() {\n this.stack.pop();\n }\n\n topFont() {\n return this.stack.at(-1);\n }\n}\n\n/**\n * Compute a text area dimensions based on font metrics.\n */\nclass TextMeasure {\n constructor(defaultXfaFont, defaultParaMargin, defaultLineHeight, fonts) {\n this.glyphs = [];\n this.fontSelector = new FontSelector(\n defaultXfaFont,\n defaultParaMargin,\n defaultLineHeight,\n fonts\n );\n this.extraHeight = 0;\n }\n\n pushData(xfaFont, margin, lineHeight) {\n this.fontSelector.pushData(xfaFont, margin, lineHeight);\n }\n\n popFont(xfaFont) {\n return this.fontSelector.popFont();\n }\n\n addPara() {\n const lastFont = this.fontSelector.topFont();\n this.extraHeight += lastFont.paraMargin.top + lastFont.paraMargin.bottom;\n }\n\n addString(str) {\n if (!str) {\n return;\n }\n\n const lastFont = this.fontSelector.topFont();\n const fontSize = lastFont.xfaFont.size;\n if (lastFont.pdfFont) {\n const letterSpacing = lastFont.xfaFont.letterSpacing;\n const pdfFont = lastFont.pdfFont;\n const fontLineHeight = pdfFont.lineHeight || 1.2;\n const lineHeight =\n lastFont.lineHeight || Math.max(1.2, fontLineHeight) * fontSize;\n const lineGap = pdfFont.lineGap === undefined ? 0.2 : pdfFont.lineGap;\n const noGap = fontLineHeight - lineGap;\n const firstLineHeight = Math.max(1, noGap) * fontSize;\n const scale = fontSize / 1000;\n const fallbackWidth =\n pdfFont.defaultWidth || pdfFont.charsToGlyphs(\" \")[0].width;\n\n for (const line of str.split(/[\\u2029\\n]/)) {\n const encodedLine = pdfFont.encodeString(line).join(\"\");\n const glyphs = pdfFont.charsToGlyphs(encodedLine);\n\n for (const glyph of glyphs) {\n const width = glyph.width || fallbackWidth;\n this.glyphs.push([\n width * scale + letterSpacing,\n lineHeight,\n firstLineHeight,\n glyph.unicode,\n false,\n ]);\n }\n\n this.glyphs.push([0, 0, 0, \"\\n\", true]);\n }\n this.glyphs.pop();\n return;\n }\n\n // When we have no font in the pdf, just use the font size as default width.\n for (const line of str.split(/[\\u2029\\n]/)) {\n for (const char of line.split(\"\")) {\n this.glyphs.push([fontSize, 1.2 * fontSize, fontSize, char, false]);\n }\n\n this.glyphs.push([0, 0, 0, \"\\n\", true]);\n }\n this.glyphs.pop();\n }\n\n compute(maxWidth) {\n let lastSpacePos = -1,\n lastSpaceWidth = 0,\n width = 0,\n height = 0,\n currentLineWidth = 0,\n currentLineHeight = 0;\n let isBroken = false;\n let isFirstLine = true;\n\n for (let i = 0, ii = this.glyphs.length; i < ii; i++) {\n const [glyphWidth, lineHeight, firstLineHeight, char, isEOL] =\n this.glyphs[i];\n const isSpace = char === \" \";\n const glyphHeight = isFirstLine ? firstLineHeight : lineHeight;\n if (isEOL) {\n width = Math.max(width, currentLineWidth);\n currentLineWidth = 0;\n height += currentLineHeight;\n currentLineHeight = glyphHeight;\n lastSpacePos = -1;\n lastSpaceWidth = 0;\n isFirstLine = false;\n continue;\n }\n\n if (isSpace) {\n if (currentLineWidth + glyphWidth > maxWidth) {\n // We can break here but the space is not taken into account.\n width = Math.max(width, currentLineWidth);\n currentLineWidth = 0;\n height += currentLineHeight;\n currentLineHeight = glyphHeight;\n lastSpacePos = -1;\n lastSpaceWidth = 0;\n isBroken = true;\n isFirstLine = false;\n } else {\n currentLineHeight = Math.max(glyphHeight, currentLineHeight);\n lastSpaceWidth = currentLineWidth;\n currentLineWidth += glyphWidth;\n lastSpacePos = i;\n }\n continue;\n }\n\n if (currentLineWidth + glyphWidth > maxWidth) {\n // We must break to the last white position (if available)\n height += currentLineHeight;\n currentLineHeight = glyphHeight;\n if (lastSpacePos !== -1) {\n i = lastSpacePos;\n width = Math.max(width, lastSpaceWidth);\n currentLineWidth = 0;\n lastSpacePos = -1;\n lastSpaceWidth = 0;\n } else {\n // Just break in the middle of the word\n width = Math.max(width, currentLineWidth);\n currentLineWidth = glyphWidth;\n }\n isBroken = true;\n isFirstLine = false;\n\n continue;\n }\n\n currentLineWidth += glyphWidth;\n currentLineHeight = Math.max(glyphHeight, currentLineHeight);\n }\n\n width = Math.max(width, currentLineWidth);\n height += currentLineHeight + this.extraHeight;\n\n return { width: WIDTH_FACTOR * width, height, isBroken };\n }\n}\n\nexport { TextMeasure };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n $getChildren,\n $getChildrenByClass,\n $getChildrenByName,\n $getParent,\n} from \"./symbol_utils.js\";\nimport { warn } from \"../../shared/util.js\";\n\nconst namePattern = /^[^.[]+/;\nconst indexPattern = /^[^\\]]+/;\nconst operators = {\n dot: 0,\n dotDot: 1,\n dotHash: 2,\n dotBracket: 3,\n dotParen: 4,\n};\n\nconst shortcuts = new Map([\n [\"$data\", (root, current) => (root.datasets ? root.datasets.data : root)],\n [\n \"$record\",\n (root, current) =>\n (root.datasets ? root.datasets.data : root)[$getChildren]()[0],\n ],\n [\"$template\", (root, current) => root.template],\n [\"$connectionSet\", (root, current) => root.connectionSet],\n [\"$form\", (root, current) => root.form],\n [\"$layout\", (root, current) => root.layout],\n [\"$host\", (root, current) => root.host],\n [\"$dataWindow\", (root, current) => root.dataWindow],\n [\"$event\", (root, current) => root.event],\n [\"!\", (root, current) => root.datasets],\n [\"$xfa\", (root, current) => root],\n [\"xfa\", (root, current) => root],\n [\"$\", (root, current) => current],\n]);\n\nconst somCache = new WeakMap();\n\nfunction parseIndex(index) {\n index = index.trim();\n if (index === \"*\") {\n return Infinity;\n }\n return parseInt(index, 10) || 0;\n}\n\n// For now expressions containing .[...] or .(...) are not\n// evaluated so don't parse them.\n// TODO: implement that stuff and the remove the noExpr param.\nfunction parseExpression(expr, dotDotAllowed, noExpr = true) {\n let match = expr.match(namePattern);\n if (!match) {\n return null;\n }\n\n let [name] = match;\n const parsed = [\n {\n name,\n cacheName: \".\" + name,\n index: 0,\n js: null,\n formCalc: null,\n operator: operators.dot,\n },\n ];\n\n let pos = name.length;\n\n while (pos < expr.length) {\n const spos = pos;\n const char = expr.charAt(pos++);\n if (char === \"[\") {\n match = expr.slice(pos).match(indexPattern);\n if (!match) {\n warn(\"XFA - Invalid index in SOM expression\");\n return null;\n }\n parsed.at(-1).index = parseIndex(match[0]);\n pos += match[0].length + 1;\n continue;\n }\n\n let operator;\n switch (expr.charAt(pos)) {\n case \".\":\n if (!dotDotAllowed) {\n return null;\n }\n pos++;\n operator = operators.dotDot;\n break;\n case \"#\":\n pos++;\n operator = operators.dotHash;\n break;\n case \"[\":\n if (noExpr) {\n warn(\n \"XFA - SOM expression contains a FormCalc subexpression which is not supported for now.\"\n );\n return null;\n }\n // TODO: FormCalc expression so need to use the parser\n operator = operators.dotBracket;\n break;\n case \"(\":\n if (noExpr) {\n warn(\n \"XFA - SOM expression contains a JavaScript subexpression which is not supported for now.\"\n );\n return null;\n }\n // TODO:\n // JavaScript expression: should be a boolean operation with a path\n // so maybe we can have our own parser for that stuff or\n // maybe use the formcalc one.\n operator = operators.dotParen;\n break;\n default:\n operator = operators.dot;\n break;\n }\n\n match = expr.slice(pos).match(namePattern);\n if (!match) {\n break;\n }\n\n [name] = match;\n pos += name.length;\n parsed.push({\n name,\n cacheName: expr.slice(spos, pos),\n operator,\n index: 0,\n js: null,\n formCalc: null,\n });\n }\n return parsed;\n}\n\nfunction searchNode(\n root,\n container,\n expr,\n dotDotAllowed = true,\n useCache = true\n) {\n const parsed = parseExpression(expr, dotDotAllowed);\n if (!parsed) {\n return null;\n }\n\n const fn = shortcuts.get(parsed[0].name);\n let i = 0;\n let isQualified;\n if (fn) {\n isQualified = true;\n root = [fn(root, container)];\n i = 1;\n } else {\n isQualified = container === null;\n root = [container || root];\n }\n\n for (let ii = parsed.length; i < ii; i++) {\n const { name, cacheName, operator, index } = parsed[i];\n const nodes = [];\n for (const node of root) {\n if (!node.isXFAObject) {\n continue;\n }\n\n let children, cached;\n\n if (useCache) {\n cached = somCache.get(node);\n if (!cached) {\n cached = new Map();\n somCache.set(node, cached);\n }\n children = cached.get(cacheName);\n }\n\n if (!children) {\n switch (operator) {\n case operators.dot:\n children = node[$getChildrenByName](name, false);\n break;\n case operators.dotDot:\n children = node[$getChildrenByName](name, true);\n break;\n case operators.dotHash:\n children = node[$getChildrenByClass](name);\n children = children.isXFAObjectArray\n ? children.children\n : [children];\n break;\n default:\n break;\n }\n if (useCache) {\n cached.set(cacheName, children);\n }\n }\n\n if (children.length > 0) {\n nodes.push(children);\n }\n }\n\n if (nodes.length === 0 && !isQualified && i === 0) {\n // We've an unqualified expression and we didn't find anything\n // so look at container and siblings of container and so on.\n // http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.364.2157&rep=rep1&type=pdf#page=114\n const parent = container[$getParent]();\n container = parent;\n if (!container) {\n return null;\n }\n i = -1;\n root = [container];\n continue;\n }\n\n root = isFinite(index)\n ? nodes.filter(node => index < node.length).map(node => node[index])\n : nodes.flat();\n }\n\n if (root.length === 0) {\n return null;\n }\n\n return root;\n}\n\nfunction createDataNode(root, container, expr) {\n const parsed = parseExpression(expr);\n if (!parsed) {\n return null;\n }\n\n if (parsed.some(x => x.operator === operators.dotDot)) {\n return null;\n }\n\n const fn = shortcuts.get(parsed[0].name);\n let i = 0;\n if (fn) {\n root = fn(root, container);\n i = 1;\n } else {\n root = container || root;\n }\n\n for (let ii = parsed.length; i < ii; i++) {\n const { name, operator, index } = parsed[i];\n if (!isFinite(index)) {\n parsed[i].index = 0;\n return root.createNodes(parsed.slice(i));\n }\n\n let children;\n switch (operator) {\n case operators.dot:\n children = root[$getChildrenByName](name, false);\n break;\n case operators.dotDot:\n children = root[$getChildrenByName](name, true);\n break;\n case operators.dotHash:\n children = root[$getChildrenByClass](name);\n children = children.isXFAObjectArray ? children.children : [children];\n break;\n default:\n break;\n }\n\n if (children.length === 0) {\n return root.createNodes(parsed.slice(i));\n }\n\n if (index < children.length) {\n const child = children[index];\n if (!child.isXFAObject) {\n warn(`XFA - Cannot create a node.`);\n return null;\n }\n root = child;\n } else {\n parsed[i].index = index - children.length;\n return root.createNodes(parsed.slice(i));\n }\n }\n return null;\n}\n\nexport { createDataNode, searchNode };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n $acceptWhitespace,\n $addHTML,\n $appendChild,\n $childrenToHTML,\n $clean,\n $cleanup,\n $clone,\n $consumed,\n $content,\n $dump,\n $extra,\n $finalize,\n $flushHTML,\n $getAttributeIt,\n $getAttributes,\n $getAvailableSpace,\n $getChildren,\n $getChildrenByClass,\n $getChildrenByName,\n $getChildrenByNameIt,\n $getContainedChildren,\n $getDataValue,\n $getParent,\n $getRealChildrenByNameIt,\n $getSubformParent,\n $getTemplateRoot,\n $globalData,\n $hasSettableValue,\n $indexOf,\n $insertAt,\n $isBindable,\n $isCDATAXml,\n $isDataValue,\n $isDescendent,\n $isNsAgnostic,\n $isSplittable,\n $isThereMoreWidth,\n $isTransparent,\n $lastAttribute,\n $namespaceId,\n $nodeName,\n $nsAttributes,\n $onChild,\n $onChildCheck,\n $onText,\n $popPara,\n $pushPara,\n $removeChild,\n $resolvePrototypes,\n $root,\n $setId,\n $setSetAttributes,\n $setValue,\n $text,\n $toHTML,\n $toString,\n $toStyle,\n $uid,\n} from \"./symbol_utils.js\";\nimport { getInteger, getKeyword, HTMLResult } from \"./utils.js\";\nimport { shadow, utf8StringToString, warn } from \"../../shared/util.js\";\nimport { encodeToXmlString } from \"../core_utils.js\";\nimport { NamespaceIds } from \"./namespaces.js\";\nimport { searchNode } from \"./som.js\";\n\nconst _applyPrototype = Symbol();\nconst _attributes = Symbol();\nconst _attributeNames = Symbol();\nconst _children = Symbol(\"_children\");\nconst _cloneAttribute = Symbol();\nconst _dataValue = Symbol();\nconst _defaultValue = Symbol();\nconst _filteredChildrenGenerator = Symbol();\nconst _getPrototype = Symbol();\nconst _getUnsetAttributes = Symbol();\nconst _hasChildren = Symbol();\nconst _max = Symbol();\nconst _options = Symbol();\nconst _parent = Symbol(\"parent\");\nconst _resolvePrototypesHelper = Symbol();\nconst _setAttributes = Symbol();\nconst _validator = Symbol();\n\nlet uid = 0;\n\nconst NS_DATASETS = NamespaceIds.datasets.id;\n\nclass XFAObject {\n constructor(nsId, name, hasChildren = false) {\n this[$namespaceId] = nsId;\n this[$nodeName] = name;\n this[_hasChildren] = hasChildren;\n this[_parent] = null;\n this[_children] = [];\n this[$uid] = `${name}${uid++}`;\n this[$globalData] = null;\n }\n\n get isXFAObject() {\n return true;\n }\n\n get isXFAObjectArray() {\n return false;\n }\n\n createNodes(path) {\n let root = this,\n node = null;\n for (const { name, index } of path) {\n for (let i = 0, ii = isFinite(index) ? index : 0; i <= ii; i++) {\n const nsId =\n root[$namespaceId] === NS_DATASETS ? -1 : root[$namespaceId];\n node = new XmlObject(nsId, name);\n root[$appendChild](node);\n }\n root = node;\n }\n return node;\n }\n\n [$onChild](child) {\n if (!this[_hasChildren] || !this[$onChildCheck](child)) {\n return false;\n }\n\n const name = child[$nodeName];\n const node = this[name];\n\n if (node instanceof XFAObjectArray) {\n if (node.push(child)) {\n this[$appendChild](child);\n return true;\n }\n } else {\n // IRL it's possible to already have a node.\n // So just replace it with the last version.\n if (node !== null) {\n this[$removeChild](node);\n }\n this[name] = child;\n this[$appendChild](child);\n return true;\n }\n\n let id = \"\";\n if (this.id) {\n id = ` (id: ${this.id})`;\n } else if (this.name) {\n id = ` (name: ${this.name} ${this.h.value})`;\n }\n warn(`XFA - node \"${this[$nodeName]}\"${id} has already enough \"${name}\"!`);\n return false;\n }\n\n [$onChildCheck](child) {\n return (\n this.hasOwnProperty(child[$nodeName]) &&\n child[$namespaceId] === this[$namespaceId]\n );\n }\n\n [$isNsAgnostic]() {\n return false;\n }\n\n [$acceptWhitespace]() {\n return false;\n }\n\n [$isCDATAXml]() {\n return false;\n }\n\n [$isBindable]() {\n return false;\n }\n\n [$popPara]() {\n if (this.para) {\n this[$getTemplateRoot]()[$extra].paraStack.pop();\n }\n }\n\n [$pushPara]() {\n this[$getTemplateRoot]()[$extra].paraStack.push(this.para);\n }\n\n [$setId](ids) {\n if (this.id && this[$namespaceId] === NamespaceIds.template.id) {\n ids.set(this.id, this);\n }\n }\n\n [$getTemplateRoot]() {\n return this[$globalData].template;\n }\n\n [$isSplittable]() {\n return false;\n }\n\n /**\n Return true if this node (typically a container)\n can provide more width during layout.\n The goal is to help to know what a descendant must\n do in case of horizontal overflow.\n */\n [$isThereMoreWidth]() {\n return false;\n }\n\n [$appendChild](child) {\n child[_parent] = this;\n this[_children].push(child);\n if (!child[$globalData] && this[$globalData]) {\n child[$globalData] = this[$globalData];\n }\n }\n\n [$removeChild](child) {\n const i = this[_children].indexOf(child);\n this[_children].splice(i, 1);\n }\n\n [$hasSettableValue]() {\n return this.hasOwnProperty(\"value\");\n }\n\n [$setValue](_) {}\n\n [$onText](_) {}\n\n [$finalize]() {}\n\n [$clean](builder) {\n delete this[_hasChildren];\n if (this[$cleanup]) {\n builder.clean(this[$cleanup]);\n delete this[$cleanup];\n }\n }\n\n [$indexOf](child) {\n return this[_children].indexOf(child);\n }\n\n [$insertAt](i, child) {\n child[_parent] = this;\n this[_children].splice(i, 0, child);\n if (!child[$globalData] && this[$globalData]) {\n child[$globalData] = this[$globalData];\n }\n }\n\n /**\n * If true the element is transparent when searching a node using\n * a SOM expression which means that looking for \"foo.bar\" in\n * <... name=\"foo\"><toto><titi><... name=\"bar\"></titi></toto>...\n * is fine because toto and titi are transparent.\n */\n [$isTransparent]() {\n return !this.name;\n }\n\n [$lastAttribute]() {\n return \"\";\n }\n\n [$text]() {\n if (this[_children].length === 0) {\n return this[$content];\n }\n return this[_children].map(c => c[$text]()).join(\"\");\n }\n\n get [_attributeNames]() {\n // Lazily get attributes names\n const proto = Object.getPrototypeOf(this);\n if (!proto._attributes) {\n const attributes = (proto._attributes = new Set());\n for (const name of Object.getOwnPropertyNames(this)) {\n if (\n this[name] === null ||\n this[name] instanceof XFAObject ||\n this[name] instanceof XFAObjectArray\n ) {\n break;\n }\n attributes.add(name);\n }\n }\n return shadow(this, _attributeNames, proto._attributes);\n }\n\n [$isDescendent](parent) {\n let node = this;\n while (node) {\n if (node === parent) {\n return true;\n }\n node = node[$getParent]();\n }\n return false;\n }\n\n [$getParent]() {\n return this[_parent];\n }\n\n [$getSubformParent]() {\n return this[$getParent]();\n }\n\n [$getChildren](name = null) {\n if (!name) {\n return this[_children];\n }\n\n return this[name];\n }\n\n [$dump]() {\n const dumped = Object.create(null);\n if (this[$content]) {\n dumped.$content = this[$content];\n }\n\n for (const name of Object.getOwnPropertyNames(this)) {\n const value = this[name];\n if (value === null) {\n continue;\n }\n if (value instanceof XFAObject) {\n dumped[name] = value[$dump]();\n } else if (value instanceof XFAObjectArray) {\n if (!value.isEmpty()) {\n dumped[name] = value.dump();\n }\n } else {\n dumped[name] = value;\n }\n }\n\n return dumped;\n }\n\n [$toStyle]() {\n return null;\n }\n\n [$toHTML]() {\n return HTMLResult.EMPTY;\n }\n\n *[$getContainedChildren]() {\n // This function is overriden in Subform and SubformSet.\n for (const node of this[$getChildren]()) {\n yield node;\n }\n }\n\n *[_filteredChildrenGenerator](filter, include) {\n for (const node of this[$getContainedChildren]()) {\n if (!filter || include === filter.has(node[$nodeName])) {\n const availableSpace = this[$getAvailableSpace]();\n const res = node[$toHTML](availableSpace);\n if (!res.success) {\n this[$extra].failingNode = node;\n }\n yield res;\n }\n }\n }\n\n [$flushHTML]() {\n return null;\n }\n\n [$addHTML](html, bbox) {\n this[$extra].children.push(html);\n }\n\n [$getAvailableSpace]() {}\n\n [$childrenToHTML]({ filter = null, include = true }) {\n if (!this[$extra].generator) {\n this[$extra].generator = this[_filteredChildrenGenerator](\n filter,\n include\n );\n } else {\n const availableSpace = this[$getAvailableSpace]();\n const res = this[$extra].failingNode[$toHTML](availableSpace);\n if (!res.success) {\n return res;\n }\n if (res.html) {\n this[$addHTML](res.html, res.bbox);\n }\n delete this[$extra].failingNode;\n }\n\n while (true) {\n const gen = this[$extra].generator.next();\n if (gen.done) {\n break;\n }\n const res = gen.value;\n if (!res.success) {\n return res;\n }\n if (res.html) {\n this[$addHTML](res.html, res.bbox);\n }\n }\n\n this[$extra].generator = null;\n\n return HTMLResult.EMPTY;\n }\n\n [$setSetAttributes](attributes) {\n // Just keep set attributes because it can be used in a proto.\n this[_setAttributes] = new Set(Object.keys(attributes));\n }\n\n /**\n * Get attribute names which have been set in the proto but not in this.\n */\n [_getUnsetAttributes](protoAttributes) {\n const allAttr = this[_attributeNames];\n const setAttr = this[_setAttributes];\n return [...protoAttributes].filter(x => allAttr.has(x) && !setAttr.has(x));\n }\n\n /**\n * Update the node with properties coming from a prototype and apply\n * this function recursively to all children.\n */\n [$resolvePrototypes](ids, ancestors = new Set()) {\n for (const child of this[_children]) {\n child[_resolvePrototypesHelper](ids, ancestors);\n }\n }\n\n [_resolvePrototypesHelper](ids, ancestors) {\n const proto = this[_getPrototype](ids, ancestors);\n if (proto) {\n // _applyPrototype will apply $resolvePrototypes with correct ancestors\n // to avoid infinite loop.\n this[_applyPrototype](proto, ids, ancestors);\n } else {\n this[$resolvePrototypes](ids, ancestors);\n }\n }\n\n [_getPrototype](ids, ancestors) {\n const { use, usehref } = this;\n if (!use && !usehref) {\n return null;\n }\n\n let proto = null;\n let somExpression = null;\n let id = null;\n let ref = use;\n\n // If usehref and use are non-empty then use usehref.\n if (usehref) {\n ref = usehref;\n // Href can be one of the following:\n // - #ID\n // - URI#ID\n // - #som(expression)\n // - URI#som(expression)\n // - URI\n // For now we don't handle URI other than \".\" (current document).\n if (usehref.startsWith(\"#som(\") && usehref.endsWith(\")\")) {\n somExpression = usehref.slice(\"#som(\".length, -1);\n } else if (usehref.startsWith(\".#som(\") && usehref.endsWith(\")\")) {\n somExpression = usehref.slice(\".#som(\".length, -1);\n } else if (usehref.startsWith(\"#\")) {\n id = usehref.slice(1);\n } else if (usehref.startsWith(\".#\")) {\n id = usehref.slice(2);\n }\n } else if (use.startsWith(\"#\")) {\n id = use.slice(1);\n } else {\n somExpression = use;\n }\n\n this.use = this.usehref = \"\";\n if (id) {\n proto = ids.get(id);\n } else {\n proto = searchNode(\n ids.get($root),\n this,\n somExpression,\n true /* = dotDotAllowed */,\n false /* = useCache */\n );\n if (proto) {\n proto = proto[0];\n }\n }\n\n if (!proto) {\n warn(`XFA - Invalid prototype reference: ${ref}.`);\n return null;\n }\n\n if (proto[$nodeName] !== this[$nodeName]) {\n warn(\n `XFA - Incompatible prototype: ${proto[$nodeName]} !== ${this[$nodeName]}.`\n );\n return null;\n }\n\n if (ancestors.has(proto)) {\n // We've a cycle so break it.\n warn(`XFA - Cycle detected in prototypes use.`);\n return null;\n }\n\n ancestors.add(proto);\n\n // The prototype can have a \"use\" attribute itself.\n const protoProto = proto[_getPrototype](ids, ancestors);\n if (protoProto) {\n proto[_applyPrototype](protoProto, ids, ancestors);\n }\n\n // The prototype can have a child which itself has a \"use\" property.\n proto[$resolvePrototypes](ids, ancestors);\n\n ancestors.delete(proto);\n\n return proto;\n }\n\n [_applyPrototype](proto, ids, ancestors) {\n if (ancestors.has(proto)) {\n // We've a cycle so break it.\n warn(`XFA - Cycle detected in prototypes use.`);\n return;\n }\n\n if (!this[$content] && proto[$content]) {\n this[$content] = proto[$content];\n }\n\n const newAncestors = new Set(ancestors);\n newAncestors.add(proto);\n\n for (const unsetAttrName of this[_getUnsetAttributes](\n proto[_setAttributes]\n )) {\n this[unsetAttrName] = proto[unsetAttrName];\n if (this[_setAttributes]) {\n this[_setAttributes].add(unsetAttrName);\n }\n }\n\n for (const name of Object.getOwnPropertyNames(this)) {\n if (this[_attributeNames].has(name)) {\n continue;\n }\n const value = this[name];\n const protoValue = proto[name];\n\n if (value instanceof XFAObjectArray) {\n for (const child of value[_children]) {\n child[_resolvePrototypesHelper](ids, ancestors);\n }\n\n for (\n let i = value[_children].length, ii = protoValue[_children].length;\n i < ii;\n i++\n ) {\n const child = proto[_children][i][$clone]();\n if (value.push(child)) {\n child[_parent] = this;\n this[_children].push(child);\n child[_resolvePrototypesHelper](ids, ancestors);\n } else {\n // No need to continue: other nodes will be rejected.\n break;\n }\n }\n continue;\n }\n\n if (value !== null) {\n value[$resolvePrototypes](ids, ancestors);\n if (protoValue) {\n // protoValue must be treated as a prototype for value.\n value[_applyPrototype](protoValue, ids, ancestors);\n }\n continue;\n }\n\n if (protoValue !== null) {\n const child = protoValue[$clone]();\n child[_parent] = this;\n this[name] = child;\n this[_children].push(child);\n child[_resolvePrototypesHelper](ids, ancestors);\n }\n }\n }\n\n static [_cloneAttribute](obj) {\n if (Array.isArray(obj)) {\n return obj.map(x => XFAObject[_cloneAttribute](x));\n }\n if (typeof obj === \"object\" && obj !== null) {\n return Object.assign({}, obj);\n }\n return obj;\n }\n\n [$clone]() {\n const clone = Object.create(Object.getPrototypeOf(this));\n for (const $symbol of Object.getOwnPropertySymbols(this)) {\n try {\n clone[$symbol] = this[$symbol];\n } catch {\n shadow(clone, $symbol, this[$symbol]);\n }\n }\n clone[$uid] = `${clone[$nodeName]}${uid++}`;\n clone[_children] = [];\n\n for (const name of Object.getOwnPropertyNames(this)) {\n if (this[_attributeNames].has(name)) {\n clone[name] = XFAObject[_cloneAttribute](this[name]);\n continue;\n }\n const value = this[name];\n clone[name] =\n value instanceof XFAObjectArray\n ? new XFAObjectArray(value[_max])\n : null;\n }\n\n for (const child of this[_children]) {\n const name = child[$nodeName];\n const clonedChild = child[$clone]();\n clone[_children].push(clonedChild);\n clonedChild[_parent] = clone;\n if (clone[name] === null) {\n clone[name] = clonedChild;\n } else {\n clone[name][_children].push(clonedChild);\n }\n }\n\n return clone;\n }\n\n [$getChildren](name = null) {\n if (!name) {\n return this[_children];\n }\n\n return this[_children].filter(c => c[$nodeName] === name);\n }\n\n [$getChildrenByClass](name) {\n return this[name];\n }\n\n [$getChildrenByName](name, allTransparent, first = true) {\n return Array.from(this[$getChildrenByNameIt](name, allTransparent, first));\n }\n\n *[$getChildrenByNameIt](name, allTransparent, first = true) {\n if (name === \"parent\") {\n yield this[_parent];\n return;\n }\n\n for (const child of this[_children]) {\n if (child[$nodeName] === name) {\n yield child;\n }\n\n if (child.name === name) {\n yield child;\n }\n\n if (allTransparent || child[$isTransparent]()) {\n yield* child[$getChildrenByNameIt](name, allTransparent, false);\n }\n }\n\n if (first && this[_attributeNames].has(name)) {\n yield new XFAAttribute(this, name, this[name]);\n }\n }\n}\n\nclass XFAObjectArray {\n constructor(max = Infinity) {\n this[_max] = max;\n this[_children] = [];\n }\n\n get isXFAObject() {\n return false;\n }\n\n get isXFAObjectArray() {\n return true;\n }\n\n push(child) {\n const len = this[_children].length;\n if (len <= this[_max]) {\n this[_children].push(child);\n return true;\n }\n warn(\n `XFA - node \"${child[$nodeName]}\" accepts no more than ${this[_max]} children`\n );\n return false;\n }\n\n isEmpty() {\n return this[_children].length === 0;\n }\n\n dump() {\n return this[_children].length === 1\n ? this[_children][0][$dump]()\n : this[_children].map(x => x[$dump]());\n }\n\n [$clone]() {\n const clone = new XFAObjectArray(this[_max]);\n clone[_children] = this[_children].map(c => c[$clone]());\n return clone;\n }\n\n get children() {\n return this[_children];\n }\n\n clear() {\n this[_children].length = 0;\n }\n}\n\nclass XFAAttribute {\n constructor(node, name, value) {\n this[_parent] = node;\n this[$nodeName] = name;\n this[$content] = value;\n this[$consumed] = false;\n this[$uid] = `attribute${uid++}`;\n }\n\n [$getParent]() {\n return this[_parent];\n }\n\n [$isDataValue]() {\n return true;\n }\n\n [$getDataValue]() {\n return this[$content].trim();\n }\n\n [$setValue](value) {\n value = value.value || \"\";\n this[$content] = value.toString();\n }\n\n [$text]() {\n return this[$content];\n }\n\n [$isDescendent](parent) {\n return this[_parent] === parent || this[_parent][$isDescendent](parent);\n }\n}\n\nclass XmlObject extends XFAObject {\n constructor(nsId, name, attributes = {}) {\n super(nsId, name);\n this[$content] = \"\";\n this[_dataValue] = null;\n if (name !== \"#text\") {\n const map = new Map();\n this[_attributes] = map;\n for (const [attrName, value] of Object.entries(attributes)) {\n map.set(attrName, new XFAAttribute(this, attrName, value));\n }\n if (attributes.hasOwnProperty($nsAttributes)) {\n // XFA attributes.\n const dataNode = attributes[$nsAttributes].xfa.dataNode;\n if (dataNode !== undefined) {\n if (dataNode === \"dataGroup\") {\n this[_dataValue] = false;\n } else if (dataNode === \"dataValue\") {\n this[_dataValue] = true;\n }\n }\n }\n }\n this[$consumed] = false;\n }\n\n [$toString](buf) {\n const tagName = this[$nodeName];\n if (tagName === \"#text\") {\n buf.push(encodeToXmlString(this[$content]));\n return;\n }\n const utf8TagName = utf8StringToString(tagName);\n const prefix = this[$namespaceId] === NS_DATASETS ? \"xfa:\" : \"\";\n buf.push(`<${prefix}${utf8TagName}`);\n for (const [name, value] of this[_attributes].entries()) {\n const utf8Name = utf8StringToString(name);\n buf.push(` ${utf8Name}=\"${encodeToXmlString(value[$content])}\"`);\n }\n if (this[_dataValue] !== null) {\n if (this[_dataValue]) {\n buf.push(` xfa:dataNode=\"dataValue\"`);\n } else {\n buf.push(` xfa:dataNode=\"dataGroup\"`);\n }\n }\n if (!this[$content] && this[_children].length === 0) {\n buf.push(\"/>\");\n return;\n }\n\n buf.push(\">\");\n if (this[$content]) {\n if (typeof this[$content] === \"string\") {\n buf.push(encodeToXmlString(this[$content]));\n } else {\n this[$content][$toString](buf);\n }\n } else {\n for (const child of this[_children]) {\n child[$toString](buf);\n }\n }\n buf.push(`</${prefix}${utf8TagName}>`);\n }\n\n [$onChild](child) {\n if (this[$content]) {\n const node = new XmlObject(this[$namespaceId], \"#text\");\n this[$appendChild](node);\n node[$content] = this[$content];\n this[$content] = \"\";\n }\n this[$appendChild](child);\n return true;\n }\n\n [$onText](str) {\n this[$content] += str;\n }\n\n [$finalize]() {\n if (this[$content] && this[_children].length > 0) {\n const node = new XmlObject(this[$namespaceId], \"#text\");\n this[$appendChild](node);\n node[$content] = this[$content];\n delete this[$content];\n }\n }\n\n [$toHTML]() {\n if (this[$nodeName] === \"#text\") {\n return HTMLResult.success({\n name: \"#text\",\n value: this[$content],\n });\n }\n\n return HTMLResult.EMPTY;\n }\n\n [$getChildren](name = null) {\n if (!name) {\n return this[_children];\n }\n\n return this[_children].filter(c => c[$nodeName] === name);\n }\n\n [$getAttributes]() {\n return this[_attributes];\n }\n\n [$getChildrenByClass](name) {\n const value = this[_attributes].get(name);\n if (value !== undefined) {\n return value;\n }\n return this[$getChildren](name);\n }\n\n *[$getChildrenByNameIt](name, allTransparent) {\n const value = this[_attributes].get(name);\n if (value) {\n yield value;\n }\n\n for (const child of this[_children]) {\n if (child[$nodeName] === name) {\n yield child;\n }\n\n if (allTransparent) {\n yield* child[$getChildrenByNameIt](name, allTransparent);\n }\n }\n }\n\n *[$getAttributeIt](name, skipConsumed) {\n const value = this[_attributes].get(name);\n if (value && (!skipConsumed || !value[$consumed])) {\n yield value;\n }\n for (const child of this[_children]) {\n yield* child[$getAttributeIt](name, skipConsumed);\n }\n }\n\n *[$getRealChildrenByNameIt](name, allTransparent, skipConsumed) {\n for (const child of this[_children]) {\n if (child[$nodeName] === name && (!skipConsumed || !child[$consumed])) {\n yield child;\n }\n\n if (allTransparent) {\n yield* child[$getRealChildrenByNameIt](\n name,\n allTransparent,\n skipConsumed\n );\n }\n }\n }\n\n [$isDataValue]() {\n if (this[_dataValue] === null) {\n return (\n this[_children].length === 0 ||\n this[_children][0][$namespaceId] === NamespaceIds.xhtml.id\n );\n }\n return this[_dataValue];\n }\n\n [$getDataValue]() {\n if (this[_dataValue] === null) {\n if (this[_children].length === 0) {\n return this[$content].trim();\n }\n if (this[_children][0][$namespaceId] === NamespaceIds.xhtml.id) {\n return this[_children][0][$text]().trim();\n }\n return null;\n }\n return this[$content].trim();\n }\n\n [$setValue](value) {\n value = value.value || \"\";\n this[$content] = value.toString();\n }\n\n [$dump](hasNS = false) {\n const dumped = Object.create(null);\n if (hasNS) {\n dumped.$ns = this[$namespaceId];\n }\n if (this[$content]) {\n dumped.$content = this[$content];\n }\n dumped.$name = this[$nodeName];\n\n dumped.children = [];\n for (const child of this[_children]) {\n dumped.children.push(child[$dump](hasNS));\n }\n\n dumped.attributes = Object.create(null);\n for (const [name, value] of this[_attributes]) {\n dumped.attributes[name] = value[$content];\n }\n\n return dumped;\n }\n}\n\nclass ContentObject extends XFAObject {\n constructor(nsId, name) {\n super(nsId, name);\n this[$content] = \"\";\n }\n\n [$onText](text) {\n this[$content] += text;\n }\n\n [$finalize]() {}\n}\n\nclass OptionObject extends ContentObject {\n constructor(nsId, name, options) {\n super(nsId, name);\n this[_options] = options;\n }\n\n [$finalize]() {\n this[$content] = getKeyword({\n data: this[$content],\n defaultValue: this[_options][0],\n validate: k => this[_options].includes(k),\n });\n }\n\n [$clean](builder) {\n super[$clean](builder);\n delete this[_options];\n }\n}\n\nclass StringObject extends ContentObject {\n [$finalize]() {\n this[$content] = this[$content].trim();\n }\n}\n\nclass IntegerObject extends ContentObject {\n constructor(nsId, name, defaultValue, validator) {\n super(nsId, name);\n this[_defaultValue] = defaultValue;\n this[_validator] = validator;\n }\n\n [$finalize]() {\n this[$content] = getInteger({\n data: this[$content],\n defaultValue: this[_defaultValue],\n validate: this[_validator],\n });\n }\n\n [$clean](builder) {\n super[$clean](builder);\n delete this[_defaultValue];\n delete this[_validator];\n }\n}\n\nclass Option01 extends IntegerObject {\n constructor(nsId, name) {\n super(nsId, name, 0, n => n === 1);\n }\n}\n\nclass Option10 extends IntegerObject {\n constructor(nsId, name) {\n super(nsId, name, 1, n => n === 0);\n }\n}\n\nexport {\n ContentObject,\n IntegerObject,\n Option01,\n Option10,\n OptionObject,\n StringObject,\n XFAAttribute,\n XFAObject,\n XFAObjectArray,\n XmlObject,\n};\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n $content,\n $extra,\n $getParent,\n $getSubformParent,\n $getTemplateRoot,\n $globalData,\n $nodeName,\n $pushGlyphs,\n $text,\n $toStyle,\n} from \"./symbol_utils.js\";\nimport { createValidAbsoluteUrl, warn } from \"../../shared/util.js\";\nimport { getMeasurement, stripQuotes } from \"./utils.js\";\nimport { selectFont } from \"./fonts.js\";\nimport { TextMeasure } from \"./text.js\";\nimport { XFAObject } from \"./xfa_object.js\";\n\nfunction measureToString(m) {\n if (typeof m === \"string\") {\n return \"0px\";\n }\n\n return Number.isInteger(m) ? `${m}px` : `${m.toFixed(2)}px`;\n}\n\nconst converters = {\n anchorType(node, style) {\n const parent = node[$getSubformParent]();\n if (!parent || (parent.layout && parent.layout !== \"position\")) {\n // anchorType is only used in a positioned layout.\n return;\n }\n\n if (!(\"transform\" in style)) {\n style.transform = \"\";\n }\n switch (node.anchorType) {\n case \"bottomCenter\":\n style.transform += \"translate(-50%, -100%)\";\n break;\n case \"bottomLeft\":\n style.transform += \"translate(0,-100%)\";\n break;\n case \"bottomRight\":\n style.transform += \"translate(-100%,-100%)\";\n break;\n case \"middleCenter\":\n style.transform += \"translate(-50%,-50%)\";\n break;\n case \"middleLeft\":\n style.transform += \"translate(0,-50%)\";\n break;\n case \"middleRight\":\n style.transform += \"translate(-100%,-50%)\";\n break;\n case \"topCenter\":\n style.transform += \"translate(-50%,0)\";\n break;\n case \"topRight\":\n style.transform += \"translate(-100%,0)\";\n break;\n }\n },\n dimensions(node, style) {\n const parent = node[$getSubformParent]();\n let width = node.w;\n const height = node.h;\n if (parent.layout?.includes(\"row\")) {\n const extra = parent[$extra];\n const colSpan = node.colSpan;\n let w;\n if (colSpan === -1) {\n w = extra.columnWidths\n .slice(extra.currentColumn)\n .reduce((a, x) => a + x, 0);\n extra.currentColumn = 0;\n } else {\n w = extra.columnWidths\n .slice(extra.currentColumn, extra.currentColumn + colSpan)\n .reduce((a, x) => a + x, 0);\n extra.currentColumn =\n (extra.currentColumn + node.colSpan) % extra.columnWidths.length;\n }\n\n if (!isNaN(w)) {\n width = node.w = w;\n }\n }\n\n style.width = width !== \"\" ? measureToString(width) : \"auto\";\n\n style.height = height !== \"\" ? measureToString(height) : \"auto\";\n },\n position(node, style) {\n const parent = node[$getSubformParent]();\n if (parent?.layout && parent.layout !== \"position\") {\n // IRL, we've some x/y in tb layout.\n // Specs say x/y is only used in positioned layout.\n return;\n }\n\n style.position = \"absolute\";\n style.left = measureToString(node.x);\n style.top = measureToString(node.y);\n },\n rotate(node, style) {\n if (node.rotate) {\n if (!(\"transform\" in style)) {\n style.transform = \"\";\n }\n style.transform += `rotate(-${node.rotate}deg)`;\n style.transformOrigin = \"top left\";\n }\n },\n presence(node, style) {\n switch (node.presence) {\n case \"invisible\":\n style.visibility = \"hidden\";\n break;\n case \"hidden\":\n case \"inactive\":\n style.display = \"none\";\n break;\n }\n },\n hAlign(node, style) {\n if (node[$nodeName] === \"para\") {\n switch (node.hAlign) {\n case \"justifyAll\":\n style.textAlign = \"justify-all\";\n break;\n case \"radix\":\n // TODO: implement this correctly !\n style.textAlign = \"left\";\n break;\n default:\n style.textAlign = node.hAlign;\n }\n } else {\n switch (node.hAlign) {\n case \"left\":\n style.alignSelf = \"start\";\n break;\n case \"center\":\n style.alignSelf = \"center\";\n break;\n case \"right\":\n style.alignSelf = \"end\";\n break;\n }\n }\n },\n margin(node, style) {\n if (node.margin) {\n style.margin = node.margin[$toStyle]().margin;\n }\n },\n};\n\nfunction setMinMaxDimensions(node, style) {\n const parent = node[$getSubformParent]();\n if (parent.layout === \"position\") {\n if (node.minW > 0) {\n style.minWidth = measureToString(node.minW);\n }\n if (node.maxW > 0) {\n style.maxWidth = measureToString(node.maxW);\n }\n if (node.minH > 0) {\n style.minHeight = measureToString(node.minH);\n }\n if (node.maxH > 0) {\n style.maxHeight = measureToString(node.maxH);\n }\n }\n}\n\nfunction layoutText(text, xfaFont, margin, lineHeight, fontFinder, width) {\n const measure = new TextMeasure(xfaFont, margin, lineHeight, fontFinder);\n if (typeof text === \"string\") {\n measure.addString(text);\n } else {\n text[$pushGlyphs](measure);\n }\n\n return measure.compute(width);\n}\n\nfunction layoutNode(node, availableSpace) {\n let height = null;\n let width = null;\n let isBroken = false;\n\n if ((!node.w || !node.h) && node.value) {\n let marginH = 0;\n let marginV = 0;\n if (node.margin) {\n marginH = node.margin.leftInset + node.margin.rightInset;\n marginV = node.margin.topInset + node.margin.bottomInset;\n }\n\n let lineHeight = null;\n let margin = null;\n if (node.para) {\n margin = Object.create(null);\n lineHeight = node.para.lineHeight === \"\" ? null : node.para.lineHeight;\n margin.top = node.para.spaceAbove === \"\" ? 0 : node.para.spaceAbove;\n margin.bottom = node.para.spaceBelow === \"\" ? 0 : node.para.spaceBelow;\n margin.left = node.para.marginLeft === \"\" ? 0 : node.para.marginLeft;\n margin.right = node.para.marginRight === \"\" ? 0 : node.para.marginRight;\n }\n\n let font = node.font;\n if (!font) {\n const root = node[$getTemplateRoot]();\n let parent = node[$getParent]();\n while (parent && parent !== root) {\n if (parent.font) {\n font = parent.font;\n break;\n }\n parent = parent[$getParent]();\n }\n }\n\n const maxWidth = (node.w || availableSpace.width) - marginH;\n const fontFinder = node[$globalData].fontFinder;\n if (\n node.value.exData &&\n node.value.exData[$content] &&\n node.value.exData.contentType === \"text/html\"\n ) {\n const res = layoutText(\n node.value.exData[$content],\n font,\n margin,\n lineHeight,\n fontFinder,\n maxWidth\n );\n width = res.width;\n height = res.height;\n isBroken = res.isBroken;\n } else {\n const text = node.value[$text]();\n if (text) {\n const res = layoutText(\n text,\n font,\n margin,\n lineHeight,\n fontFinder,\n maxWidth\n );\n width = res.width;\n height = res.height;\n isBroken = res.isBroken;\n }\n }\n\n if (width !== null && !node.w) {\n width += marginH;\n }\n\n if (height !== null && !node.h) {\n height += marginV;\n }\n }\n return { w: width, h: height, isBroken };\n}\n\nfunction computeBbox(node, html, availableSpace) {\n let bbox;\n if (node.w !== \"\" && node.h !== \"\") {\n bbox = [node.x, node.y, node.w, node.h];\n } else {\n if (!availableSpace) {\n return null;\n }\n let width = node.w;\n if (width === \"\") {\n if (node.maxW === 0) {\n const parent = node[$getSubformParent]();\n width = parent.layout === \"position\" && parent.w !== \"\" ? 0 : node.minW;\n } else {\n width = Math.min(node.maxW, availableSpace.width);\n }\n html.attributes.style.width = measureToString(width);\n }\n\n let height = node.h;\n if (height === \"\") {\n if (node.maxH === 0) {\n const parent = node[$getSubformParent]();\n height =\n parent.layout === \"position\" && parent.h !== \"\" ? 0 : node.minH;\n } else {\n height = Math.min(node.maxH, availableSpace.height);\n }\n html.attributes.style.height = measureToString(height);\n }\n\n bbox = [node.x, node.y, width, height];\n }\n return bbox;\n}\n\nfunction fixDimensions(node) {\n const parent = node[$getSubformParent]();\n if (parent.layout?.includes(\"row\")) {\n const extra = parent[$extra];\n const colSpan = node.colSpan;\n let width;\n if (colSpan === -1) {\n width = extra.columnWidths\n .slice(extra.currentColumn)\n .reduce((a, w) => a + w, 0);\n } else {\n width = extra.columnWidths\n .slice(extra.currentColumn, extra.currentColumn + colSpan)\n .reduce((a, w) => a + w, 0);\n }\n if (!isNaN(width)) {\n node.w = width;\n }\n }\n\n if (parent.layout && parent.layout !== \"position\") {\n // Useless in this context.\n node.x = node.y = 0;\n }\n\n if (node.layout === \"table\") {\n if (node.w === \"\" && Array.isArray(node.columnWidths)) {\n node.w = node.columnWidths.reduce((a, x) => a + x, 0);\n }\n }\n}\n\nfunction layoutClass(node) {\n switch (node.layout) {\n case \"position\":\n return \"xfaPosition\";\n case \"lr-tb\":\n return \"xfaLrTb\";\n case \"rl-row\":\n return \"xfaRlRow\";\n case \"rl-tb\":\n return \"xfaRlTb\";\n case \"row\":\n return \"xfaRow\";\n case \"table\":\n return \"xfaTable\";\n case \"tb\":\n return \"xfaTb\";\n default:\n return \"xfaPosition\";\n }\n}\n\nfunction toStyle(node, ...names) {\n const style = Object.create(null);\n for (const name of names) {\n const value = node[name];\n if (value === null) {\n continue;\n }\n if (converters.hasOwnProperty(name)) {\n converters[name](node, style);\n continue;\n }\n\n if (value instanceof XFAObject) {\n const newStyle = value[$toStyle]();\n if (newStyle) {\n Object.assign(style, newStyle);\n } else {\n warn(`(DEBUG) - XFA - style for ${name} not implemented yet`);\n }\n }\n }\n return style;\n}\n\nfunction createWrapper(node, html) {\n const { attributes } = html;\n const { style } = attributes;\n\n const wrapper = {\n name: \"div\",\n attributes: {\n class: [\"xfaWrapper\"],\n style: Object.create(null),\n },\n children: [],\n };\n\n attributes.class.push(\"xfaWrapped\");\n\n if (node.border) {\n const { widths, insets } = node.border[$extra];\n let width, height;\n let top = insets[0];\n let left = insets[3];\n const insetsH = insets[0] + insets[2];\n const insetsW = insets[1] + insets[3];\n switch (node.border.hand) {\n case \"even\":\n top -= widths[0] / 2;\n left -= widths[3] / 2;\n width = `calc(100% + ${(widths[1] + widths[3]) / 2 - insetsW}px)`;\n height = `calc(100% + ${(widths[0] + widths[2]) / 2 - insetsH}px)`;\n break;\n case \"left\":\n top -= widths[0];\n left -= widths[3];\n width = `calc(100% + ${widths[1] + widths[3] - insetsW}px)`;\n height = `calc(100% + ${widths[0] + widths[2] - insetsH}px)`;\n break;\n case \"right\":\n width = insetsW ? `calc(100% - ${insetsW}px)` : \"100%\";\n height = insetsH ? `calc(100% - ${insetsH}px)` : \"100%\";\n break;\n }\n const classNames = [\"xfaBorder\"];\n if (isPrintOnly(node.border)) {\n classNames.push(\"xfaPrintOnly\");\n }\n\n const border = {\n name: \"div\",\n attributes: {\n class: classNames,\n style: {\n top: `${top}px`,\n left: `${left}px`,\n width,\n height,\n },\n },\n children: [],\n };\n\n for (const key of [\n \"border\",\n \"borderWidth\",\n \"borderColor\",\n \"borderRadius\",\n \"borderStyle\",\n ]) {\n if (style[key] !== undefined) {\n border.attributes.style[key] = style[key];\n delete style[key];\n }\n }\n wrapper.children.push(border, html);\n } else {\n wrapper.children.push(html);\n }\n\n for (const key of [\n \"background\",\n \"backgroundClip\",\n \"top\",\n \"left\",\n \"width\",\n \"height\",\n \"minWidth\",\n \"minHeight\",\n \"maxWidth\",\n \"maxHeight\",\n \"transform\",\n \"transformOrigin\",\n \"visibility\",\n ]) {\n if (style[key] !== undefined) {\n wrapper.attributes.style[key] = style[key];\n delete style[key];\n }\n }\n\n wrapper.attributes.style.position =\n style.position === \"absolute\" ? \"absolute\" : \"relative\";\n delete style.position;\n\n if (style.alignSelf) {\n wrapper.attributes.style.alignSelf = style.alignSelf;\n delete style.alignSelf;\n }\n\n return wrapper;\n}\n\nfunction fixTextIndent(styles) {\n const indent = getMeasurement(styles.textIndent, \"0px\");\n if (indent >= 0) {\n return;\n }\n\n // If indent is negative then it's a hanging indent.\n const align = styles.textAlign === \"right\" ? \"right\" : \"left\";\n const name = \"padding\" + (align === \"left\" ? \"Left\" : \"Right\");\n const padding = getMeasurement(styles[name], \"0px\");\n styles[name] = `${padding - indent}px`;\n}\n\nfunction setAccess(node, classNames) {\n switch (node.access) {\n case \"nonInteractive\":\n classNames.push(\"xfaNonInteractive\");\n break;\n case \"readOnly\":\n classNames.push(\"xfaReadOnly\");\n break;\n case \"protected\":\n classNames.push(\"xfaDisabled\");\n break;\n }\n}\n\nfunction isPrintOnly(node) {\n return (\n node.relevant.length > 0 &&\n !node.relevant[0].excluded &&\n node.relevant[0].viewname === \"print\"\n );\n}\n\nfunction getCurrentPara(node) {\n const stack = node[$getTemplateRoot]()[$extra].paraStack;\n return stack.length ? stack.at(-1) : null;\n}\n\nfunction setPara(node, nodeStyle, value) {\n if (value.attributes.class?.includes(\"xfaRich\")) {\n if (nodeStyle) {\n if (node.h === \"\") {\n nodeStyle.height = \"auto\";\n }\n if (node.w === \"\") {\n nodeStyle.width = \"auto\";\n }\n }\n\n const para = getCurrentPara(node);\n if (para) {\n // By definition exData are external data so para\n // has no effect on it.\n const valueStyle = value.attributes.style;\n valueStyle.display = \"flex\";\n valueStyle.flexDirection = \"column\";\n switch (para.vAlign) {\n case \"top\":\n valueStyle.justifyContent = \"start\";\n break;\n case \"bottom\":\n valueStyle.justifyContent = \"end\";\n break;\n case \"middle\":\n valueStyle.justifyContent = \"center\";\n break;\n }\n\n const paraStyle = para[$toStyle]();\n for (const [key, val] of Object.entries(paraStyle)) {\n if (!(key in valueStyle)) {\n valueStyle[key] = val;\n }\n }\n }\n }\n}\n\nfunction setFontFamily(xfaFont, node, fontFinder, style) {\n if (!fontFinder) {\n // The font cannot be found in the pdf so use the default one.\n delete style.fontFamily;\n return;\n }\n\n const name = stripQuotes(xfaFont.typeface);\n style.fontFamily = `\"${name}\"`;\n\n const typeface = fontFinder.find(name);\n if (typeface) {\n const { fontFamily } = typeface.regular.cssFontInfo;\n if (fontFamily !== name) {\n style.fontFamily = `\"${fontFamily}\"`;\n }\n\n const para = getCurrentPara(node);\n if (para && para.lineHeight !== \"\") {\n return;\n }\n\n if (style.lineHeight) {\n // Already something so don't overwrite.\n return;\n }\n\n const pdfFont = selectFont(xfaFont, typeface);\n if (pdfFont) {\n style.lineHeight = Math.max(1.2, pdfFont.lineHeight);\n }\n }\n}\n\nfunction fixURL(str) {\n const absoluteUrl = createValidAbsoluteUrl(str, /* baseUrl = */ null, {\n addDefaultProtocol: true,\n tryConvertEncoding: true,\n });\n return absoluteUrl ? absoluteUrl.href : null;\n}\n\nexport {\n computeBbox,\n createWrapper,\n fixDimensions,\n fixTextIndent,\n fixURL,\n isPrintOnly,\n layoutClass,\n layoutNode,\n measureToString,\n setAccess,\n setFontFamily,\n setMinMaxDimensions,\n setPara,\n toStyle,\n};\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n $extra,\n $flushHTML,\n $getSubformParent,\n $getTemplateRoot,\n $isSplittable,\n $isThereMoreWidth,\n} from \"./symbol_utils.js\";\nimport { measureToString } from \"./html_utils.js\";\n\n// Subform and ExclGroup have a layout so they share these functions.\n\n/**\n * How layout works ?\n *\n * A container has an initial space (with a width and a height) to fit in,\n * which means that once all the children have been added then\n * the total width/height must be lower than the given ones in\n * the initial space.\n * So if the container has known dimensions and these ones are ok with the\n * space then continue else we return HTMLResult.FAILURE: it's up to the\n * parent to deal with this failure (e.g. if parent layout is lr-tb and\n * we fail to add a child at end of line (lr) then we try to add it on the\n * next line).\n * And then we run through the children, each child gets its initial space\n * in calling its parent $getAvailableSpace method\n * (see _filteredChildrenGenerator and $childrenToHTML in xfa_object.js)\n * then we try to layout child in its space. If everything is ok then we add\n * the result to its parent through $addHTML which will recompute the available\n * space in parent according to its layout property else we return\n * HTMLResult.Failure.\n * Before a failure some children may have been layed out: they've been saved in\n * [$extra].children and [$extra] has properties generator and failingNode\n * in order to save the state where we were before a failure.\n * This [$extra].children property is useful when a container has to be splited.\n * So if a container is unbreakable, we must delete its [$extra] property before\n * returning.\n */\n\nfunction createLine(node, children) {\n return {\n name: \"div\",\n attributes: {\n class: [node.layout === \"lr-tb\" ? \"xfaLr\" : \"xfaRl\"],\n },\n children,\n };\n}\n\nfunction flushHTML(node) {\n if (!node[$extra]) {\n return null;\n }\n\n const attributes = node[$extra].attributes;\n const html = {\n name: \"div\",\n attributes,\n children: node[$extra].children,\n };\n\n if (node[$extra].failingNode) {\n const htmlFromFailing = node[$extra].failingNode[$flushHTML]();\n if (htmlFromFailing) {\n if (node.layout.endsWith(\"-tb\")) {\n html.children.push(createLine(node, [htmlFromFailing]));\n } else {\n html.children.push(htmlFromFailing);\n }\n }\n }\n\n if (html.children.length === 0) {\n return null;\n }\n\n return html;\n}\n\nfunction addHTML(node, html, bbox) {\n const extra = node[$extra];\n const availableSpace = extra.availableSpace;\n\n const [x, y, w, h] = bbox;\n switch (node.layout) {\n case \"position\": {\n extra.width = Math.max(extra.width, x + w);\n extra.height = Math.max(extra.height, y + h);\n extra.children.push(html);\n break;\n }\n case \"lr-tb\":\n case \"rl-tb\":\n if (!extra.line || extra.attempt === 1) {\n extra.line = createLine(node, []);\n extra.children.push(extra.line);\n extra.numberInLine = 0;\n }\n\n extra.numberInLine += 1;\n extra.line.children.push(html);\n\n if (extra.attempt === 0) {\n // Add the element on the line\n extra.currentWidth += w;\n extra.height = Math.max(extra.height, extra.prevHeight + h);\n } else {\n extra.currentWidth = w;\n extra.prevHeight = extra.height;\n extra.height += h;\n\n // The element has been added on a new line so switch to line mode now.\n extra.attempt = 0;\n }\n extra.width = Math.max(extra.width, extra.currentWidth);\n break;\n case \"rl-row\":\n case \"row\": {\n extra.children.push(html);\n extra.width += w;\n extra.height = Math.max(extra.height, h);\n const height = measureToString(extra.height);\n for (const child of extra.children) {\n child.attributes.style.height = height;\n }\n break;\n }\n case \"table\": {\n extra.width = Math.min(availableSpace.width, Math.max(extra.width, w));\n extra.height += h;\n extra.children.push(html);\n break;\n }\n case \"tb\": {\n // Even if the subform can possibly take all the available width,\n // we must compute the final width as it is in order to be able\n // for example to center the subform within its parent.\n extra.width = Math.min(availableSpace.width, Math.max(extra.width, w));\n extra.height += h;\n extra.children.push(html);\n break;\n }\n }\n}\n\nfunction getAvailableSpace(node) {\n const availableSpace = node[$extra].availableSpace;\n const marginV = node.margin\n ? node.margin.topInset + node.margin.bottomInset\n : 0;\n const marginH = node.margin\n ? node.margin.leftInset + node.margin.rightInset\n : 0;\n\n switch (node.layout) {\n case \"lr-tb\":\n case \"rl-tb\":\n if (node[$extra].attempt === 0) {\n return {\n width: availableSpace.width - marginH - node[$extra].currentWidth,\n height: availableSpace.height - marginV - node[$extra].prevHeight,\n };\n }\n return {\n width: availableSpace.width - marginH,\n height: availableSpace.height - marginV - node[$extra].height,\n };\n case \"rl-row\":\n case \"row\":\n const width = node[$extra].columnWidths\n .slice(node[$extra].currentColumn)\n .reduce((a, x) => a + x);\n return { width, height: availableSpace.height - marginH };\n case \"table\":\n case \"tb\":\n return {\n width: availableSpace.width - marginH,\n height: availableSpace.height - marginV - node[$extra].height,\n };\n case \"position\":\n default:\n return availableSpace;\n }\n}\n\nfunction getTransformedBBox(node) {\n // Take into account rotation and anchor to get the real bounding box.\n let w = node.w === \"\" ? NaN : node.w;\n let h = node.h === \"\" ? NaN : node.h;\n let [centerX, centerY] = [0, 0];\n switch (node.anchorType || \"\") {\n case \"bottomCenter\":\n [centerX, centerY] = [w / 2, h];\n break;\n case \"bottomLeft\":\n [centerX, centerY] = [0, h];\n break;\n case \"bottomRight\":\n [centerX, centerY] = [w, h];\n break;\n case \"middleCenter\":\n [centerX, centerY] = [w / 2, h / 2];\n break;\n case \"middleLeft\":\n [centerX, centerY] = [0, h / 2];\n break;\n case \"middleRight\":\n [centerX, centerY] = [w, h / 2];\n break;\n case \"topCenter\":\n [centerX, centerY] = [w / 2, 0];\n break;\n case \"topRight\":\n [centerX, centerY] = [w, 0];\n break;\n }\n\n let x, y;\n switch (node.rotate || 0) {\n case 0:\n [x, y] = [-centerX, -centerY];\n break;\n case 90:\n [x, y] = [-centerY, centerX];\n [w, h] = [h, -w];\n break;\n case 180:\n [x, y] = [centerX, centerY];\n [w, h] = [-w, -h];\n break;\n case 270:\n [x, y] = [centerY, -centerX];\n [w, h] = [-h, w];\n break;\n }\n\n return [\n node.x + x + Math.min(0, w),\n node.y + y + Math.min(0, h),\n Math.abs(w),\n Math.abs(h),\n ];\n}\n\n/**\n * Returning true means that the node will be layed out\n * else the layout will go to its next step (changing of line\n * in case of lr-tb or changing content area...).\n */\nfunction checkDimensions(node, space) {\n if (node[$getTemplateRoot]()[$extra].firstUnsplittable === null) {\n return true;\n }\n\n if (node.w === 0 || node.h === 0) {\n return true;\n }\n\n const ERROR = 2;\n const parent = node[$getSubformParent]();\n const attempt = parent[$extra]?.attempt || 0;\n\n const [, y, w, h] = getTransformedBBox(node);\n switch (parent.layout) {\n case \"lr-tb\":\n case \"rl-tb\":\n if (attempt === 0) {\n // Try to put an element in the line.\n\n if (!node[$getTemplateRoot]()[$extra].noLayoutFailure) {\n if (node.h !== \"\" && Math.round(h - space.height) > ERROR) {\n // Not enough height.\n return false;\n }\n\n if (node.w !== \"\") {\n if (Math.round(w - space.width) <= ERROR) {\n return true;\n }\n if (parent[$extra].numberInLine === 0) {\n return space.height > ERROR;\n }\n\n return false;\n }\n\n return space.width > ERROR;\n }\n\n // No layout failure.\n\n // Put the element on the line but we can fail\n // and then in the second step (next line) we'll accept.\n if (node.w !== \"\") {\n return Math.round(w - space.width) <= ERROR;\n }\n\n return space.width > ERROR;\n }\n\n // Second attempt: try to put the element on the next line.\n\n if (node[$getTemplateRoot]()[$extra].noLayoutFailure) {\n // We cannot fail.\n return true;\n }\n\n if (node.h !== \"\" && Math.round(h - space.height) > ERROR) {\n return false;\n }\n\n if (node.w === \"\" || Math.round(w - space.width) <= ERROR) {\n return space.height > ERROR;\n }\n\n if (parent[$isThereMoreWidth]()) {\n return false;\n }\n\n return space.height > ERROR;\n case \"table\":\n case \"tb\":\n if (node[$getTemplateRoot]()[$extra].noLayoutFailure) {\n return true;\n }\n\n // If the node has a height then check if it's fine with available height.\n // If the node is breakable then we can return true.\n if (node.h !== \"\" && !node[$isSplittable]()) {\n return Math.round(h - space.height) <= ERROR;\n }\n // Else wait and see: this node will be layed out itself\n // in the provided space and maybe a children won't fit.\n\n if (node.w === \"\" || Math.round(w - space.width) <= ERROR) {\n return space.height > ERROR;\n }\n\n if (parent[$isThereMoreWidth]()) {\n return false;\n }\n\n return space.height > ERROR;\n case \"position\":\n if (node[$getTemplateRoot]()[$extra].noLayoutFailure) {\n return true;\n }\n\n if (node.h === \"\" || Math.round(h + y - space.height) <= ERROR) {\n return true;\n }\n\n const area = node[$getTemplateRoot]()[$extra].currentContentArea;\n return h + y > area.h;\n case \"rl-row\":\n case \"row\":\n if (node[$getTemplateRoot]()[$extra].noLayoutFailure) {\n return true;\n }\n\n if (node.h !== \"\") {\n return Math.round(h - space.height) <= ERROR;\n }\n return true;\n default:\n // No layout, so accept everything.\n return true;\n }\n}\n\nexport { addHTML, checkDimensions, flushHTML, getAvailableSpace };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n $acceptWhitespace,\n $addHTML,\n $appendChild,\n $childrenToHTML,\n $clean,\n $cleanPage,\n $content,\n $data,\n $extra,\n $finalize,\n $flushHTML,\n $getAvailableSpace,\n $getChildren,\n $getContainedChildren,\n $getExtra,\n $getNextPage,\n $getParent,\n $getSubformParent,\n $getTemplateRoot,\n $globalData,\n $hasSettableValue,\n $ids,\n $isBindable,\n $isCDATAXml,\n $isSplittable,\n $isThereMoreWidth,\n $isTransparent,\n $isUsable,\n $namespaceId,\n $nodeName,\n $onChild,\n $onText,\n $popPara,\n $pushPara,\n $removeChild,\n $searchNode,\n $setSetAttributes,\n $setValue,\n $tabIndex,\n $text,\n $toHTML,\n $toPages,\n $toStyle,\n $uid,\n} from \"./symbol_utils.js\";\nimport { $buildXFAObject, NamespaceIds } from \"./namespaces.js\";\nimport {\n addHTML,\n checkDimensions,\n flushHTML,\n getAvailableSpace,\n} from \"./layout.js\";\nimport {\n computeBbox,\n createWrapper,\n fixDimensions,\n fixTextIndent,\n fixURL,\n isPrintOnly,\n layoutClass,\n layoutNode,\n measureToString,\n setAccess,\n setFontFamily,\n setMinMaxDimensions,\n setPara,\n toStyle,\n} from \"./html_utils.js\";\nimport {\n ContentObject,\n Option01,\n OptionObject,\n StringObject,\n XFAObject,\n XFAObjectArray,\n} from \"./xfa_object.js\";\nimport {\n getBBox,\n getColor,\n getFloat,\n getInteger,\n getKeyword,\n getMeasurement,\n getRatio,\n getRelevant,\n getStringOption,\n HTMLResult,\n} from \"./utils.js\";\nimport { stringToBytes, Util, warn } from \"../../shared/util.js\";\nimport { getMetrics } from \"./fonts.js\";\nimport { recoverJsURL } from \"../core_utils.js\";\nimport { searchNode } from \"./som.js\";\n\nconst TEMPLATE_NS_ID = NamespaceIds.template.id;\nconst SVG_NS = \"http://www.w3.org/2000/svg\";\n\n// In case of lr-tb (and rl-tb) layouts, we try:\n// - to put the container at the end of a line\n// - and if it fails we try on the next line.\n// If both tries failed then it's up to the parent\n// to handle the situation.\nconst MAX_ATTEMPTS_FOR_LRTB_LAYOUT = 2;\n\n// It's possible to have a bug in the layout and so as\n// a consequence we could loop for ever in Template::toHTML()\n// so in order to avoid that (and avoid a OOM crash) we break\n// the loop after having MAX_EMPTY_PAGES empty pages.\nconst MAX_EMPTY_PAGES = 3;\n\n// Default value to start with for the tabIndex property.\nconst DEFAULT_TAB_INDEX = 5000;\n\nconst HEADING_PATTERN = /^H(\\d+)$/;\n\n// Allowed mime types for images\nconst MIMES = new Set([\n \"image/gif\",\n \"image/jpeg\",\n \"image/jpg\",\n \"image/pjpeg\",\n \"image/png\",\n \"image/apng\",\n \"image/x-png\",\n \"image/bmp\",\n \"image/x-ms-bmp\",\n \"image/tiff\",\n \"image/tif\",\n \"application/octet-stream\",\n]);\n\nconst IMAGES_HEADERS = [\n [[0x42, 0x4d], \"image/bmp\"],\n [[0xff, 0xd8, 0xff], \"image/jpeg\"],\n [[0x49, 0x49, 0x2a, 0x00], \"image/tiff\"],\n [[0x4d, 0x4d, 0x00, 0x2a], \"image/tiff\"],\n [[0x47, 0x49, 0x46, 0x38, 0x39, 0x61], \"image/gif\"],\n [[0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a], \"image/png\"],\n];\n\nfunction getBorderDims(node) {\n if (!node || !node.border) {\n return { w: 0, h: 0 };\n }\n\n const borderExtra = node.border[$getExtra]();\n if (!borderExtra) {\n return { w: 0, h: 0 };\n }\n\n return {\n w:\n borderExtra.widths[0] +\n borderExtra.widths[2] +\n borderExtra.insets[0] +\n borderExtra.insets[2],\n h:\n borderExtra.widths[1] +\n borderExtra.widths[3] +\n borderExtra.insets[1] +\n borderExtra.insets[3],\n };\n}\n\nfunction hasMargin(node) {\n return (\n node.margin &&\n (node.margin.topInset ||\n node.margin.rightInset ||\n node.margin.bottomInset ||\n node.margin.leftInset)\n );\n}\n\nfunction _setValue(templateNode, value) {\n if (!templateNode.value) {\n const nodeValue = new Value({});\n templateNode[$appendChild](nodeValue);\n templateNode.value = nodeValue;\n }\n templateNode.value[$setValue](value);\n}\n\nfunction* getContainedChildren(node) {\n for (const child of node[$getChildren]()) {\n if (child instanceof SubformSet) {\n yield* child[$getContainedChildren]();\n continue;\n }\n yield child;\n }\n}\n\nfunction isRequired(node) {\n return node.validate?.nullTest === \"error\";\n}\n\nfunction setTabIndex(node) {\n while (node) {\n if (!node.traversal) {\n node[$tabIndex] = node[$getParent]()[$tabIndex];\n return;\n }\n\n if (node[$tabIndex]) {\n return;\n }\n\n let next = null;\n for (const child of node.traversal[$getChildren]()) {\n if (child.operation === \"next\") {\n next = child;\n break;\n }\n }\n\n if (!next || !next.ref) {\n node[$tabIndex] = node[$getParent]()[$tabIndex];\n return;\n }\n\n const root = node[$getTemplateRoot]();\n node[$tabIndex] = ++root[$tabIndex];\n\n const ref = root[$searchNode](next.ref, node);\n if (!ref) {\n return;\n }\n\n node = ref[0];\n }\n}\n\nfunction applyAssist(obj, attributes) {\n const assist = obj.assist;\n if (assist) {\n const assistTitle = assist[$toHTML]();\n if (assistTitle) {\n attributes.title = assistTitle;\n }\n const role = assist.role;\n const match = role.match(HEADING_PATTERN);\n if (match) {\n const ariaRole = \"heading\";\n const ariaLevel = match[1];\n attributes.role = ariaRole;\n attributes[\"aria-level\"] = ariaLevel;\n }\n }\n // XXX: We could end up in a situation where the obj has a heading role and\n // is also a table. For now prioritize the table role.\n if (obj.layout === \"table\") {\n attributes.role = \"table\";\n } else if (obj.layout === \"row\") {\n attributes.role = \"row\";\n } else {\n const parent = obj[$getParent]();\n if (parent.layout === \"row\") {\n attributes.role = parent.assist?.role === \"TH\" ? \"columnheader\" : \"cell\";\n }\n }\n}\n\nfunction ariaLabel(obj) {\n if (!obj.assist) {\n return null;\n }\n const assist = obj.assist;\n if (assist.speak && assist.speak[$content] !== \"\") {\n return assist.speak[$content];\n }\n if (assist.toolTip) {\n return assist.toolTip[$content];\n }\n // TODO: support finding the related caption element. See xfa_bug1718037.pdf\n // for an example.\n return null;\n}\n\nfunction valueToHtml(value) {\n return HTMLResult.success({\n name: \"div\",\n attributes: {\n class: [\"xfaRich\"],\n style: Object.create(null),\n },\n children: [\n {\n name: \"span\",\n attributes: {\n style: Object.create(null),\n },\n value,\n },\n ],\n });\n}\n\nfunction setFirstUnsplittable(node) {\n const root = node[$getTemplateRoot]();\n if (root[$extra].firstUnsplittable === null) {\n root[$extra].firstUnsplittable = node;\n root[$extra].noLayoutFailure = true;\n }\n}\n\nfunction unsetFirstUnsplittable(node) {\n const root = node[$getTemplateRoot]();\n if (root[$extra].firstUnsplittable === node) {\n root[$extra].noLayoutFailure = false;\n }\n}\n\nfunction handleBreak(node) {\n if (node[$extra]) {\n return false;\n }\n\n node[$extra] = Object.create(null);\n\n if (node.targetType === \"auto\") {\n return false;\n }\n\n const root = node[$getTemplateRoot]();\n let target = null;\n if (node.target) {\n target = root[$searchNode](node.target, node[$getParent]());\n if (!target) {\n return false;\n }\n target = target[0];\n }\n\n const { currentPageArea, currentContentArea } = root[$extra];\n\n if (node.targetType === \"pageArea\") {\n if (!(target instanceof PageArea)) {\n target = null;\n }\n\n if (node.startNew) {\n node[$extra].target = target || currentPageArea;\n return true;\n } else if (target && target !== currentPageArea) {\n node[$extra].target = target;\n return true;\n }\n\n return false;\n }\n\n if (!(target instanceof ContentArea)) {\n target = null;\n }\n\n const pageArea = target && target[$getParent]();\n\n let index;\n let nextPageArea = pageArea;\n if (node.startNew) {\n // startNew === 1 so we must create a new container (pageArea or\n // contentArea).\n if (target) {\n const contentAreas = pageArea.contentArea.children;\n const indexForCurrent = contentAreas.indexOf(currentContentArea);\n const indexForTarget = contentAreas.indexOf(target);\n if (indexForCurrent !== -1 && indexForCurrent < indexForTarget) {\n // The next container is after the current container so\n // we can stay on the same page.\n nextPageArea = null;\n }\n index = indexForTarget - 1;\n } else {\n index = currentPageArea.contentArea.children.indexOf(currentContentArea);\n }\n } else if (target && target !== currentContentArea) {\n const contentAreas = pageArea.contentArea.children;\n index = contentAreas.indexOf(target) - 1;\n nextPageArea = pageArea === currentPageArea ? null : pageArea;\n } else {\n return false;\n }\n\n node[$extra].target = nextPageArea;\n node[$extra].index = index;\n return true;\n}\n\nfunction handleOverflow(node, extraNode, space) {\n const root = node[$getTemplateRoot]();\n const saved = root[$extra].noLayoutFailure;\n const savedMethod = extraNode[$getSubformParent];\n\n // Replace $getSubformParent to emulate that extraNode is just\n // under node.\n extraNode[$getSubformParent] = () => node;\n\n root[$extra].noLayoutFailure = true;\n const res = extraNode[$toHTML](space);\n node[$addHTML](res.html, res.bbox);\n root[$extra].noLayoutFailure = saved;\n extraNode[$getSubformParent] = savedMethod;\n}\n\nclass AppearanceFilter extends StringObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"appearanceFilter\");\n this.id = attributes.id || \"\";\n this.type = getStringOption(attributes.type, [\"optional\", \"required\"]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass Arc extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"arc\", /* hasChildren = */ true);\n this.circular = getInteger({\n data: attributes.circular,\n defaultValue: 0,\n validate: x => x === 1,\n });\n this.hand = getStringOption(attributes.hand, [\"even\", \"left\", \"right\"]);\n this.id = attributes.id || \"\";\n this.startAngle = getFloat({\n data: attributes.startAngle,\n defaultValue: 0,\n validate: x => true,\n });\n this.sweepAngle = getFloat({\n data: attributes.sweepAngle,\n defaultValue: 360,\n validate: x => true,\n });\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.edge = null;\n this.fill = null;\n }\n\n [$toHTML]() {\n const edge = this.edge || new Edge({});\n const edgeStyle = edge[$toStyle]();\n const style = Object.create(null);\n if (this.fill?.presence === \"visible\") {\n Object.assign(style, this.fill[$toStyle]());\n } else {\n style.fill = \"transparent\";\n }\n style.strokeWidth = measureToString(\n edge.presence === \"visible\" ? edge.thickness : 0\n );\n style.stroke = edgeStyle.color;\n let arc;\n const attributes = {\n xmlns: SVG_NS,\n style: {\n width: \"100%\",\n height: \"100%\",\n overflow: \"visible\",\n },\n };\n\n if (this.sweepAngle === 360) {\n arc = {\n name: \"ellipse\",\n attributes: {\n xmlns: SVG_NS,\n cx: \"50%\",\n cy: \"50%\",\n rx: \"50%\",\n ry: \"50%\",\n style,\n },\n };\n } else {\n const startAngle = (this.startAngle * Math.PI) / 180;\n const sweepAngle = (this.sweepAngle * Math.PI) / 180;\n const largeArc = this.sweepAngle > 180 ? 1 : 0;\n const [x1, y1, x2, y2] = [\n 50 * (1 + Math.cos(startAngle)),\n 50 * (1 - Math.sin(startAngle)),\n 50 * (1 + Math.cos(startAngle + sweepAngle)),\n 50 * (1 - Math.sin(startAngle + sweepAngle)),\n ];\n\n arc = {\n name: \"path\",\n attributes: {\n xmlns: SVG_NS,\n d: `M ${x1} ${y1} A 50 50 0 ${largeArc} 0 ${x2} ${y2}`,\n vectorEffect: \"non-scaling-stroke\",\n style,\n },\n };\n\n Object.assign(attributes, {\n viewBox: \"0 0 100 100\",\n preserveAspectRatio: \"none\",\n });\n }\n\n const svg = {\n name: \"svg\",\n children: [arc],\n attributes,\n };\n\n const parent = this[$getParent]()[$getParent]();\n if (hasMargin(parent)) {\n return HTMLResult.success({\n name: \"div\",\n attributes: {\n style: {\n display: \"inline\",\n width: \"100%\",\n height: \"100%\",\n },\n },\n children: [svg],\n });\n }\n\n svg.attributes.style.position = \"absolute\";\n return HTMLResult.success(svg);\n }\n}\n\nclass Area extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"area\", /* hasChildren = */ true);\n this.colSpan = getInteger({\n data: attributes.colSpan,\n defaultValue: 1,\n validate: n => n >= 1 || n === -1,\n });\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.relevant = getRelevant(attributes.relevant);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.x = getMeasurement(attributes.x, \"0pt\");\n this.y = getMeasurement(attributes.y, \"0pt\");\n this.desc = null;\n this.extras = null;\n this.area = new XFAObjectArray();\n this.draw = new XFAObjectArray();\n this.exObject = new XFAObjectArray();\n this.exclGroup = new XFAObjectArray();\n this.field = new XFAObjectArray();\n this.subform = new XFAObjectArray();\n this.subformSet = new XFAObjectArray();\n }\n\n *[$getContainedChildren]() {\n // This function is overriden in order to fake that subforms under\n // this set are in fact under parent subform.\n yield* getContainedChildren(this);\n }\n\n [$isTransparent]() {\n return true;\n }\n\n [$isBindable]() {\n return true;\n }\n\n [$addHTML](html, bbox) {\n const [x, y, w, h] = bbox;\n this[$extra].width = Math.max(this[$extra].width, x + w);\n this[$extra].height = Math.max(this[$extra].height, y + h);\n\n this[$extra].children.push(html);\n }\n\n [$getAvailableSpace]() {\n return this[$extra].availableSpace;\n }\n\n [$toHTML](availableSpace) {\n // TODO: incomplete.\n const style = toStyle(this, \"position\");\n const attributes = {\n style,\n id: this[$uid],\n class: [\"xfaArea\"],\n };\n\n if (isPrintOnly(this)) {\n attributes.class.push(\"xfaPrintOnly\");\n }\n\n if (this.name) {\n attributes.xfaName = this.name;\n }\n\n const children = [];\n this[$extra] = {\n children,\n width: 0,\n height: 0,\n availableSpace,\n };\n\n const result = this[$childrenToHTML]({\n filter: new Set([\n \"area\",\n \"draw\",\n \"field\",\n \"exclGroup\",\n \"subform\",\n \"subformSet\",\n ]),\n include: true,\n });\n\n if (!result.success) {\n if (result.isBreak()) {\n return result;\n }\n // Nothing to propose for the element which doesn't fit the\n // available space.\n delete this[$extra];\n return HTMLResult.FAILURE;\n }\n\n style.width = measureToString(this[$extra].width);\n style.height = measureToString(this[$extra].height);\n\n const html = {\n name: \"div\",\n attributes,\n children,\n };\n\n const bbox = [this.x, this.y, this[$extra].width, this[$extra].height];\n delete this[$extra];\n\n return HTMLResult.success(html, bbox);\n }\n}\n\nclass Assist extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"assist\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.role = attributes.role || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.speak = null;\n this.toolTip = null;\n }\n\n [$toHTML]() {\n return this.toolTip?.[$content] || null;\n }\n}\n\nclass Barcode extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"barcode\", /* hasChildren = */ true);\n this.charEncoding = getKeyword({\n data: attributes.charEncoding\n ? attributes.charEncoding.toLowerCase()\n : \"\",\n defaultValue: \"\",\n validate: k =>\n [\n \"utf-8\",\n \"big-five\",\n \"fontspecific\",\n \"gbk\",\n \"gb-18030\",\n \"gb-2312\",\n \"ksc-5601\",\n \"none\",\n \"shift-jis\",\n \"ucs-2\",\n \"utf-16\",\n ].includes(k) || k.match(/iso-8859-\\d{2}/),\n });\n this.checksum = getStringOption(attributes.checksum, [\n \"none\",\n \"1mod10\",\n \"1mod10_1mod11\",\n \"2mod10\",\n \"auto\",\n ]);\n this.dataColumnCount = getInteger({\n data: attributes.dataColumnCount,\n defaultValue: -1,\n validate: x => x >= 0,\n });\n this.dataLength = getInteger({\n data: attributes.dataLength,\n defaultValue: -1,\n validate: x => x >= 0,\n });\n this.dataPrep = getStringOption(attributes.dataPrep, [\n \"none\",\n \"flateCompress\",\n ]);\n this.dataRowCount = getInteger({\n data: attributes.dataRowCount,\n defaultValue: -1,\n validate: x => x >= 0,\n });\n this.endChar = attributes.endChar || \"\";\n this.errorCorrectionLevel = getInteger({\n data: attributes.errorCorrectionLevel,\n defaultValue: -1,\n validate: x => x >= 0 && x <= 8,\n });\n this.id = attributes.id || \"\";\n this.moduleHeight = getMeasurement(attributes.moduleHeight, \"5mm\");\n this.moduleWidth = getMeasurement(attributes.moduleWidth, \"0.25mm\");\n this.printCheckDigit = getInteger({\n data: attributes.printCheckDigit,\n defaultValue: 0,\n validate: x => x === 1,\n });\n this.rowColumnRatio = getRatio(attributes.rowColumnRatio);\n this.startChar = attributes.startChar || \"\";\n this.textLocation = getStringOption(attributes.textLocation, [\n \"below\",\n \"above\",\n \"aboveEmbedded\",\n \"belowEmbedded\",\n \"none\",\n ]);\n this.truncate = getInteger({\n data: attributes.truncate,\n defaultValue: 0,\n validate: x => x === 1,\n });\n this.type = getStringOption(\n attributes.type ? attributes.type.toLowerCase() : \"\",\n [\n \"aztec\",\n \"codabar\",\n \"code2of5industrial\",\n \"code2of5interleaved\",\n \"code2of5matrix\",\n \"code2of5standard\",\n \"code3of9\",\n \"code3of9extended\",\n \"code11\",\n \"code49\",\n \"code93\",\n \"code128\",\n \"code128a\",\n \"code128b\",\n \"code128c\",\n \"code128sscc\",\n \"datamatrix\",\n \"ean8\",\n \"ean8add2\",\n \"ean8add5\",\n \"ean13\",\n \"ean13add2\",\n \"ean13add5\",\n \"ean13pwcd\",\n \"fim\",\n \"logmars\",\n \"maxicode\",\n \"msi\",\n \"pdf417\",\n \"pdf417macro\",\n \"plessey\",\n \"postauscust2\",\n \"postauscust3\",\n \"postausreplypaid\",\n \"postausstandard\",\n \"postukrm4scc\",\n \"postusdpbc\",\n \"postusimb\",\n \"postusstandard\",\n \"postus5zip\",\n \"qrcode\",\n \"rfid\",\n \"rss14\",\n \"rss14expanded\",\n \"rss14limited\",\n \"rss14stacked\",\n \"rss14stackedomni\",\n \"rss14truncated\",\n \"telepen\",\n \"ucc128\",\n \"ucc128random\",\n \"ucc128sscc\",\n \"upca\",\n \"upcaadd2\",\n \"upcaadd5\",\n \"upcapwcd\",\n \"upce\",\n \"upceadd2\",\n \"upceadd5\",\n \"upcean2\",\n \"upcean5\",\n \"upsmaxicode\",\n ]\n );\n this.upsMode = getStringOption(attributes.upsMode, [\n \"usCarrier\",\n \"internationalCarrier\",\n \"secureSymbol\",\n \"standardSymbol\",\n ]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.wideNarrowRatio = getRatio(attributes.wideNarrowRatio);\n this.encrypt = null;\n this.extras = null;\n }\n}\n\nclass Bind extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"bind\", /* hasChildren = */ true);\n this.match = getStringOption(attributes.match, [\n \"once\",\n \"dataRef\",\n \"global\",\n \"none\",\n ]);\n this.ref = attributes.ref || \"\";\n this.picture = null;\n }\n}\n\nclass BindItems extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"bindItems\");\n this.connection = attributes.connection || \"\";\n this.labelRef = attributes.labelRef || \"\";\n this.ref = attributes.ref || \"\";\n this.valueRef = attributes.valueRef || \"\";\n }\n}\n\nclass Bookend extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"bookend\");\n this.id = attributes.id || \"\";\n this.leader = attributes.leader || \"\";\n this.trailer = attributes.trailer || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass BooleanElement extends Option01 {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"boolean\");\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n\n [$toHTML](availableSpace) {\n return valueToHtml(this[$content] === 1 ? \"1\" : \"0\");\n }\n}\n\nclass Border extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"border\", /* hasChildren = */ true);\n this.break = getStringOption(attributes.break, [\"close\", \"open\"]);\n this.hand = getStringOption(attributes.hand, [\"even\", \"left\", \"right\"]);\n this.id = attributes.id || \"\";\n this.presence = getStringOption(attributes.presence, [\n \"visible\",\n \"hidden\",\n \"inactive\",\n \"invisible\",\n ]);\n this.relevant = getRelevant(attributes.relevant);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.corner = new XFAObjectArray(4);\n this.edge = new XFAObjectArray(4);\n this.extras = null;\n this.fill = null;\n this.margin = null;\n }\n\n [$getExtra]() {\n if (!this[$extra]) {\n const edges = this.edge.children.slice();\n if (edges.length < 4) {\n const defaultEdge = edges.at(-1) || new Edge({});\n for (let i = edges.length; i < 4; i++) {\n edges.push(defaultEdge);\n }\n }\n\n const widths = edges.map(edge => edge.thickness);\n const insets = [0, 0, 0, 0];\n if (this.margin) {\n insets[0] = this.margin.topInset;\n insets[1] = this.margin.rightInset;\n insets[2] = this.margin.bottomInset;\n insets[3] = this.margin.leftInset;\n }\n this[$extra] = { widths, insets, edges };\n }\n return this[$extra];\n }\n\n [$toStyle]() {\n // TODO: incomplete (hand).\n const { edges } = this[$getExtra]();\n const edgeStyles = edges.map(node => {\n const style = node[$toStyle]();\n style.color ||= \"#000000\";\n return style;\n });\n\n const style = Object.create(null);\n if (this.margin) {\n Object.assign(style, this.margin[$toStyle]());\n }\n\n if (this.fill?.presence === \"visible\") {\n Object.assign(style, this.fill[$toStyle]());\n }\n\n if (this.corner.children.some(node => node.radius !== 0)) {\n const cornerStyles = this.corner.children.map(node => node[$toStyle]());\n if (cornerStyles.length === 2 || cornerStyles.length === 3) {\n const last = cornerStyles.at(-1);\n for (let i = cornerStyles.length; i < 4; i++) {\n cornerStyles.push(last);\n }\n }\n\n style.borderRadius = cornerStyles.map(s => s.radius).join(\" \");\n }\n\n switch (this.presence) {\n case \"invisible\":\n case \"hidden\":\n style.borderStyle = \"\";\n break;\n case \"inactive\":\n style.borderStyle = \"none\";\n break;\n default:\n style.borderStyle = edgeStyles.map(s => s.style).join(\" \");\n break;\n }\n\n style.borderWidth = edgeStyles.map(s => s.width).join(\" \");\n style.borderColor = edgeStyles.map(s => s.color).join(\" \");\n\n return style;\n }\n}\n\nclass Break extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"break\", /* hasChildren = */ true);\n this.after = getStringOption(attributes.after, [\n \"auto\",\n \"contentArea\",\n \"pageArea\",\n \"pageEven\",\n \"pageOdd\",\n ]);\n this.afterTarget = attributes.afterTarget || \"\";\n this.before = getStringOption(attributes.before, [\n \"auto\",\n \"contentArea\",\n \"pageArea\",\n \"pageEven\",\n \"pageOdd\",\n ]);\n this.beforeTarget = attributes.beforeTarget || \"\";\n this.bookendLeader = attributes.bookendLeader || \"\";\n this.bookendTrailer = attributes.bookendTrailer || \"\";\n this.id = attributes.id || \"\";\n this.overflowLeader = attributes.overflowLeader || \"\";\n this.overflowTarget = attributes.overflowTarget || \"\";\n this.overflowTrailer = attributes.overflowTrailer || \"\";\n this.startNew = getInteger({\n data: attributes.startNew,\n defaultValue: 0,\n validate: x => x === 1,\n });\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.extras = null;\n }\n}\n\nclass BreakAfter extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"breakAfter\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.leader = attributes.leader || \"\";\n this.startNew = getInteger({\n data: attributes.startNew,\n defaultValue: 0,\n validate: x => x === 1,\n });\n this.target = attributes.target || \"\";\n this.targetType = getStringOption(attributes.targetType, [\n \"auto\",\n \"contentArea\",\n \"pageArea\",\n ]);\n this.trailer = attributes.trailer || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.script = null;\n }\n}\n\nclass BreakBefore extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"breakBefore\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.leader = attributes.leader || \"\";\n this.startNew = getInteger({\n data: attributes.startNew,\n defaultValue: 0,\n validate: x => x === 1,\n });\n this.target = attributes.target || \"\";\n this.targetType = getStringOption(attributes.targetType, [\n \"auto\",\n \"contentArea\",\n \"pageArea\",\n ]);\n this.trailer = attributes.trailer || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.script = null;\n }\n\n [$toHTML](availableSpace) {\n this[$extra] = {};\n return HTMLResult.FAILURE;\n }\n}\n\nclass Button extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"button\", /* hasChildren = */ true);\n this.highlight = getStringOption(attributes.highlight, [\n \"inverted\",\n \"none\",\n \"outline\",\n \"push\",\n ]);\n this.id = attributes.id || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.extras = null;\n }\n\n [$toHTML](availableSpace) {\n // TODO: highlight.\n\n const parent = this[$getParent]();\n const grandpa = parent[$getParent]();\n const htmlButton = {\n name: \"button\",\n attributes: {\n id: this[$uid],\n class: [\"xfaButton\"],\n style: {},\n },\n children: [],\n };\n\n for (const event of grandpa.event.children) {\n // if (true) break;\n if (event.activity !== \"click\" || !event.script) {\n continue;\n }\n const jsURL = recoverJsURL(event.script[$content]);\n if (!jsURL) {\n continue;\n }\n const href = fixURL(jsURL.url);\n if (!href) {\n continue;\n }\n\n // we've an url so generate a <a>\n htmlButton.children.push({\n name: \"a\",\n attributes: {\n id: \"link\" + this[$uid],\n href,\n newWindow: jsURL.newWindow,\n class: [\"xfaLink\"],\n style: {},\n },\n children: [],\n });\n }\n\n return HTMLResult.success(htmlButton);\n }\n}\n\nclass Calculate extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"calculate\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.override = getStringOption(attributes.override, [\n \"disabled\",\n \"error\",\n \"ignore\",\n \"warning\",\n ]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.extras = null;\n this.message = null;\n this.script = null;\n }\n}\n\nclass Caption extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"caption\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.placement = getStringOption(attributes.placement, [\n \"left\",\n \"bottom\",\n \"inline\",\n \"right\",\n \"top\",\n ]);\n this.presence = getStringOption(attributes.presence, [\n \"visible\",\n \"hidden\",\n \"inactive\",\n \"invisible\",\n ]);\n this.reserve = Math.ceil(getMeasurement(attributes.reserve));\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.extras = null;\n this.font = null;\n this.margin = null;\n this.para = null;\n this.value = null;\n }\n\n [$setValue](value) {\n _setValue(this, value);\n }\n\n [$getExtra](availableSpace) {\n if (!this[$extra]) {\n let { width, height } = availableSpace;\n switch (this.placement) {\n case \"left\":\n case \"right\":\n case \"inline\":\n width = this.reserve <= 0 ? width : this.reserve;\n break;\n case \"top\":\n case \"bottom\":\n height = this.reserve <= 0 ? height : this.reserve;\n break;\n }\n\n this[$extra] = layoutNode(this, { width, height });\n }\n return this[$extra];\n }\n\n [$toHTML](availableSpace) {\n // TODO: incomplete.\n if (!this.value) {\n return HTMLResult.EMPTY;\n }\n\n this[$pushPara]();\n const value = this.value[$toHTML](availableSpace).html;\n\n if (!value) {\n this[$popPara]();\n return HTMLResult.EMPTY;\n }\n\n const savedReserve = this.reserve;\n if (this.reserve <= 0) {\n const { w, h } = this[$getExtra](availableSpace);\n switch (this.placement) {\n case \"left\":\n case \"right\":\n case \"inline\":\n this.reserve = w;\n break;\n case \"top\":\n case \"bottom\":\n this.reserve = h;\n break;\n }\n }\n\n const children = [];\n if (typeof value === \"string\") {\n children.push({\n name: \"#text\",\n value,\n });\n } else {\n children.push(value);\n }\n\n const style = toStyle(this, \"font\", \"margin\", \"visibility\");\n switch (this.placement) {\n case \"left\":\n case \"right\":\n if (this.reserve > 0) {\n style.width = measureToString(this.reserve);\n }\n break;\n case \"top\":\n case \"bottom\":\n if (this.reserve > 0) {\n style.height = measureToString(this.reserve);\n }\n break;\n }\n\n setPara(this, null, value);\n this[$popPara]();\n\n this.reserve = savedReserve;\n\n return HTMLResult.success({\n name: \"div\",\n attributes: {\n style,\n class: [\"xfaCaption\"],\n },\n children,\n });\n }\n}\n\nclass Certificate extends StringObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"certificate\");\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass Certificates extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"certificates\", /* hasChildren = */ true);\n this.credentialServerPolicy = getStringOption(\n attributes.credentialServerPolicy,\n [\"optional\", \"required\"]\n );\n this.id = attributes.id || \"\";\n this.url = attributes.url || \"\";\n this.urlPolicy = attributes.urlPolicy || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.encryption = null;\n this.issuers = null;\n this.keyUsage = null;\n this.oids = null;\n this.signing = null;\n this.subjectDNs = null;\n }\n}\n\nclass CheckButton extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"checkButton\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.mark = getStringOption(attributes.mark, [\n \"default\",\n \"check\",\n \"circle\",\n \"cross\",\n \"diamond\",\n \"square\",\n \"star\",\n ]);\n this.shape = getStringOption(attributes.shape, [\"square\", \"round\"]);\n this.size = getMeasurement(attributes.size, \"10pt\");\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.border = null;\n this.extras = null;\n this.margin = null;\n }\n\n [$toHTML](availableSpace) {\n // TODO: border, shape and mark.\n\n const style = toStyle(\"margin\");\n const size = measureToString(this.size);\n\n style.width = style.height = size;\n\n let type;\n let className;\n let groupId;\n const field = this[$getParent]()[$getParent]();\n const items =\n (field.items.children.length &&\n field.items.children[0][$toHTML]().html) ||\n [];\n const exportedValue = {\n on: (items[0] !== undefined ? items[0] : \"on\").toString(),\n off: (items[1] !== undefined ? items[1] : \"off\").toString(),\n };\n\n const value = field.value?.[$text]() || \"off\";\n const checked = value === exportedValue.on || undefined;\n const container = field[$getSubformParent]();\n const fieldId = field[$uid];\n let dataId;\n\n if (container instanceof ExclGroup) {\n groupId = container[$uid];\n type = \"radio\";\n className = \"xfaRadio\";\n dataId = container[$data]?.[$uid] || container[$uid];\n } else {\n type = \"checkbox\";\n className = \"xfaCheckbox\";\n dataId = field[$data]?.[$uid] || field[$uid];\n }\n\n const input = {\n name: \"input\",\n attributes: {\n class: [className],\n style,\n fieldId,\n dataId,\n type,\n checked,\n xfaOn: exportedValue.on,\n xfaOff: exportedValue.off,\n \"aria-label\": ariaLabel(field),\n \"aria-required\": false,\n },\n };\n\n if (groupId) {\n input.attributes.name = groupId;\n }\n\n if (isRequired(field)) {\n input.attributes[\"aria-required\"] = true;\n input.attributes.required = true;\n }\n\n return HTMLResult.success({\n name: \"label\",\n attributes: {\n class: [\"xfaLabel\"],\n },\n children: [input],\n });\n }\n}\n\nclass ChoiceList extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"choiceList\", /* hasChildren = */ true);\n this.commitOn = getStringOption(attributes.commitOn, [\"select\", \"exit\"]);\n this.id = attributes.id || \"\";\n this.open = getStringOption(attributes.open, [\n \"userControl\",\n \"always\",\n \"multiSelect\",\n \"onEntry\",\n ]);\n this.textEntry = getInteger({\n data: attributes.textEntry,\n defaultValue: 0,\n validate: x => x === 1,\n });\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.border = null;\n this.extras = null;\n this.margin = null;\n }\n\n [$toHTML](availableSpace) {\n // TODO: incomplete.\n const style = toStyle(this, \"border\", \"margin\");\n const ui = this[$getParent]();\n const field = ui[$getParent]();\n const fontSize = field.font?.size || 10;\n const optionStyle = {\n fontSize: `calc(${fontSize}px * var(--scale-factor))`,\n };\n const children = [];\n\n if (field.items.children.length > 0) {\n const items = field.items;\n let displayedIndex = 0;\n let saveIndex = 0;\n if (items.children.length === 2) {\n displayedIndex = items.children[0].save;\n saveIndex = 1 - displayedIndex;\n }\n const displayed = items.children[displayedIndex][$toHTML]().html;\n const values = items.children[saveIndex][$toHTML]().html;\n\n let selected = false;\n const value = field.value?.[$text]() || \"\";\n for (let i = 0, ii = displayed.length; i < ii; i++) {\n const option = {\n name: \"option\",\n attributes: {\n value: values[i] || displayed[i],\n style: optionStyle,\n },\n value: displayed[i],\n };\n if (values[i] === value) {\n option.attributes.selected = selected = true;\n }\n children.push(option);\n }\n\n if (!selected) {\n children.splice(0, 0, {\n name: \"option\",\n attributes: {\n hidden: true,\n selected: true,\n },\n value: \" \",\n });\n }\n }\n\n const selectAttributes = {\n class: [\"xfaSelect\"],\n fieldId: field[$uid],\n dataId: field[$data]?.[$uid] || field[$uid],\n style,\n \"aria-label\": ariaLabel(field),\n \"aria-required\": false,\n };\n\n if (isRequired(field)) {\n selectAttributes[\"aria-required\"] = true;\n selectAttributes.required = true;\n }\n\n if (this.open === \"multiSelect\") {\n selectAttributes.multiple = true;\n }\n\n return HTMLResult.success({\n name: \"label\",\n attributes: {\n class: [\"xfaLabel\"],\n },\n children: [\n {\n name: \"select\",\n children,\n attributes: selectAttributes,\n },\n ],\n });\n }\n}\n\nclass Color extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"color\", /* hasChildren = */ true);\n this.cSpace = getStringOption(attributes.cSpace, [\"SRGB\"]);\n this.id = attributes.id || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.value = attributes.value ? getColor(attributes.value) : \"\";\n this.extras = null;\n }\n\n [$hasSettableValue]() {\n return false;\n }\n\n [$toStyle]() {\n return this.value\n ? Util.makeHexColor(this.value.r, this.value.g, this.value.b)\n : null;\n }\n}\n\nclass Comb extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"comb\");\n this.id = attributes.id || \"\";\n this.numberOfCells = getInteger({\n data: attributes.numberOfCells,\n defaultValue: 0,\n validate: x => x >= 0,\n });\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass Connect extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"connect\", /* hasChildren = */ true);\n this.connection = attributes.connection || \"\";\n this.id = attributes.id || \"\";\n this.ref = attributes.ref || \"\";\n this.usage = getStringOption(attributes.usage, [\n \"exportAndImport\",\n \"exportOnly\",\n \"importOnly\",\n ]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.picture = null;\n }\n}\n\nclass ContentArea extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"contentArea\", /* hasChildren = */ true);\n this.h = getMeasurement(attributes.h);\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.relevant = getRelevant(attributes.relevant);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.w = getMeasurement(attributes.w);\n this.x = getMeasurement(attributes.x, \"0pt\");\n this.y = getMeasurement(attributes.y, \"0pt\");\n this.desc = null;\n this.extras = null;\n }\n\n [$toHTML](availableSpace) {\n // TODO: incomplete.\n const left = measureToString(this.x);\n const top = measureToString(this.y);\n\n const style = {\n left,\n top,\n width: measureToString(this.w),\n height: measureToString(this.h),\n };\n\n const classNames = [\"xfaContentarea\"];\n\n if (isPrintOnly(this)) {\n classNames.push(\"xfaPrintOnly\");\n }\n\n return HTMLResult.success({\n name: \"div\",\n children: [],\n attributes: {\n style,\n class: classNames,\n id: this[$uid],\n },\n });\n }\n}\n\nclass Corner extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"corner\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.inverted = getInteger({\n data: attributes.inverted,\n defaultValue: 0,\n validate: x => x === 1,\n });\n this.join = getStringOption(attributes.join, [\"square\", \"round\"]);\n this.presence = getStringOption(attributes.presence, [\n \"visible\",\n \"hidden\",\n \"inactive\",\n \"invisible\",\n ]);\n this.radius = getMeasurement(attributes.radius);\n this.stroke = getStringOption(attributes.stroke, [\n \"solid\",\n \"dashDot\",\n \"dashDotDot\",\n \"dashed\",\n \"dotted\",\n \"embossed\",\n \"etched\",\n \"lowered\",\n \"raised\",\n ]);\n this.thickness = getMeasurement(attributes.thickness, \"0.5pt\");\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.color = null;\n this.extras = null;\n }\n\n [$toStyle]() {\n // In using CSS it's only possible to handle radius\n // (at least with basic css).\n // Is there a real use (interest ?) of all these properties ?\n // Maybe it's possible to implement them using svg and border-image...\n // TODO: implement all the missing properties.\n const style = toStyle(this, \"visibility\");\n style.radius = measureToString(this.join === \"square\" ? 0 : this.radius);\n return style;\n }\n}\n\nclass DateElement extends ContentObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"date\");\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n\n [$finalize]() {\n const date = this[$content].trim();\n this[$content] = date ? new Date(date) : null;\n }\n\n [$toHTML](availableSpace) {\n return valueToHtml(this[$content] ? this[$content].toString() : \"\");\n }\n}\n\nclass DateTime extends ContentObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"dateTime\");\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n\n [$finalize]() {\n const date = this[$content].trim();\n this[$content] = date ? new Date(date) : null;\n }\n\n [$toHTML](availableSpace) {\n return valueToHtml(this[$content] ? this[$content].toString() : \"\");\n }\n}\n\nclass DateTimeEdit extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"dateTimeEdit\", /* hasChildren = */ true);\n this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, [\n \"auto\",\n \"off\",\n \"on\",\n ]);\n this.id = attributes.id || \"\";\n this.picker = getStringOption(attributes.picker, [\"host\", \"none\"]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.border = null;\n this.comb = null;\n this.extras = null;\n this.margin = null;\n }\n\n [$toHTML](availableSpace) {\n // TODO: incomplete.\n // When the picker is host we should use type=date for the input\n // but we need to put the buttons outside the text-field.\n const style = toStyle(this, \"border\", \"font\", \"margin\");\n const field = this[$getParent]()[$getParent]();\n const html = {\n name: \"input\",\n attributes: {\n type: \"text\",\n fieldId: field[$uid],\n dataId: field[$data]?.[$uid] || field[$uid],\n class: [\"xfaTextfield\"],\n style,\n \"aria-label\": ariaLabel(field),\n \"aria-required\": false,\n },\n };\n\n if (isRequired(field)) {\n html.attributes[\"aria-required\"] = true;\n html.attributes.required = true;\n }\n\n return HTMLResult.success({\n name: \"label\",\n attributes: {\n class: [\"xfaLabel\"],\n },\n children: [html],\n });\n }\n}\n\nclass Decimal extends ContentObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"decimal\");\n this.fracDigits = getInteger({\n data: attributes.fracDigits,\n defaultValue: 2,\n validate: x => true,\n });\n this.id = attributes.id || \"\";\n this.leadDigits = getInteger({\n data: attributes.leadDigits,\n defaultValue: -1,\n validate: x => true,\n });\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n\n [$finalize]() {\n const number = parseFloat(this[$content].trim());\n this[$content] = isNaN(number) ? null : number;\n }\n\n [$toHTML](availableSpace) {\n return valueToHtml(\n this[$content] !== null ? this[$content].toString() : \"\"\n );\n }\n}\n\nclass DefaultUi extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"defaultUi\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.extras = null;\n }\n}\n\nclass Desc extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"desc\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.boolean = new XFAObjectArray();\n this.date = new XFAObjectArray();\n this.dateTime = new XFAObjectArray();\n this.decimal = new XFAObjectArray();\n this.exData = new XFAObjectArray();\n this.float = new XFAObjectArray();\n this.image = new XFAObjectArray();\n this.integer = new XFAObjectArray();\n this.text = new XFAObjectArray();\n this.time = new XFAObjectArray();\n }\n}\n\nclass DigestMethod extends OptionObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"digestMethod\", [\n \"\",\n \"SHA1\",\n \"SHA256\",\n \"SHA512\",\n \"RIPEMD160\",\n ]);\n this.id = attributes.id || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass DigestMethods extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"digestMethods\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.type = getStringOption(attributes.type, [\"optional\", \"required\"]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.digestMethod = new XFAObjectArray();\n }\n}\n\nclass Draw extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"draw\", /* hasChildren = */ true);\n this.anchorType = getStringOption(attributes.anchorType, [\n \"topLeft\",\n \"bottomCenter\",\n \"bottomLeft\",\n \"bottomRight\",\n \"middleCenter\",\n \"middleLeft\",\n \"middleRight\",\n \"topCenter\",\n \"topRight\",\n ]);\n this.colSpan = getInteger({\n data: attributes.colSpan,\n defaultValue: 1,\n validate: n => n >= 1 || n === -1,\n });\n this.h = attributes.h ? getMeasurement(attributes.h) : \"\";\n this.hAlign = getStringOption(attributes.hAlign, [\n \"left\",\n \"center\",\n \"justify\",\n \"justifyAll\",\n \"radix\",\n \"right\",\n ]);\n this.id = attributes.id || \"\";\n this.locale = attributes.locale || \"\";\n this.maxH = getMeasurement(attributes.maxH, \"0pt\");\n this.maxW = getMeasurement(attributes.maxW, \"0pt\");\n this.minH = getMeasurement(attributes.minH, \"0pt\");\n this.minW = getMeasurement(attributes.minW, \"0pt\");\n this.name = attributes.name || \"\";\n this.presence = getStringOption(attributes.presence, [\n \"visible\",\n \"hidden\",\n \"inactive\",\n \"invisible\",\n ]);\n this.relevant = getRelevant(attributes.relevant);\n this.rotate = getInteger({\n data: attributes.rotate,\n defaultValue: 0,\n validate: x => x % 90 === 0,\n });\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.w = attributes.w ? getMeasurement(attributes.w) : \"\";\n this.x = getMeasurement(attributes.x, \"0pt\");\n this.y = getMeasurement(attributes.y, \"0pt\");\n this.assist = null;\n this.border = null;\n this.caption = null;\n this.desc = null;\n this.extras = null;\n this.font = null;\n this.keep = null;\n this.margin = null;\n this.para = null;\n this.traversal = null;\n this.ui = null;\n this.value = null;\n this.setProperty = new XFAObjectArray();\n }\n\n [$setValue](value) {\n _setValue(this, value);\n }\n\n [$toHTML](availableSpace) {\n setTabIndex(this);\n\n if (this.presence === \"hidden\" || this.presence === \"inactive\") {\n return HTMLResult.EMPTY;\n }\n\n fixDimensions(this);\n this[$pushPara]();\n\n // If at least one dimension is missing and we've a text\n // then we can guess it in laying out the text.\n const savedW = this.w;\n const savedH = this.h;\n const { w, h, isBroken } = layoutNode(this, availableSpace);\n if (w && this.w === \"\") {\n // If the parent layout is lr-tb with a w=100 and we already have a child\n // which takes 90 on the current line.\n // If we have a text with a length (in px) equal to 100 then it'll be\n // splitted into almost 10 chunks: so it won't be nice.\n // So if we've potentially more width to provide in some parent containers\n // let's increase it to give a chance to have a better rendering.\n if (isBroken && this[$getSubformParent]()[$isThereMoreWidth]()) {\n this[$popPara]();\n return HTMLResult.FAILURE;\n }\n\n this.w = w;\n }\n if (h && this.h === \"\") {\n this.h = h;\n }\n\n setFirstUnsplittable(this);\n if (!checkDimensions(this, availableSpace)) {\n this.w = savedW;\n this.h = savedH;\n this[$popPara]();\n return HTMLResult.FAILURE;\n }\n unsetFirstUnsplittable(this);\n\n const style = toStyle(\n this,\n \"font\",\n \"hAlign\",\n \"dimensions\",\n \"position\",\n \"presence\",\n \"rotate\",\n \"anchorType\",\n \"border\",\n \"margin\"\n );\n\n setMinMaxDimensions(this, style);\n\n if (style.margin) {\n style.padding = style.margin;\n delete style.margin;\n }\n\n const classNames = [\"xfaDraw\"];\n if (this.font) {\n classNames.push(\"xfaFont\");\n }\n if (isPrintOnly(this)) {\n classNames.push(\"xfaPrintOnly\");\n }\n\n const attributes = {\n style,\n id: this[$uid],\n class: classNames,\n };\n\n if (this.name) {\n attributes.xfaName = this.name;\n }\n\n const html = {\n name: \"div\",\n attributes,\n children: [],\n };\n\n applyAssist(this, attributes);\n\n const bbox = computeBbox(this, html, availableSpace);\n\n const value = this.value ? this.value[$toHTML](availableSpace).html : null;\n if (value === null) {\n this.w = savedW;\n this.h = savedH;\n this[$popPara]();\n return HTMLResult.success(createWrapper(this, html), bbox);\n }\n\n html.children.push(value);\n setPara(this, style, value);\n\n this.w = savedW;\n this.h = savedH;\n\n this[$popPara]();\n return HTMLResult.success(createWrapper(this, html), bbox);\n }\n}\n\nclass Edge extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"edge\", /* hasChildren = */ true);\n this.cap = getStringOption(attributes.cap, [\"square\", \"butt\", \"round\"]);\n this.id = attributes.id || \"\";\n this.presence = getStringOption(attributes.presence, [\n \"visible\",\n \"hidden\",\n \"inactive\",\n \"invisible\",\n ]);\n this.stroke = getStringOption(attributes.stroke, [\n \"solid\",\n \"dashDot\",\n \"dashDotDot\",\n \"dashed\",\n \"dotted\",\n \"embossed\",\n \"etched\",\n \"lowered\",\n \"raised\",\n ]);\n this.thickness = getMeasurement(attributes.thickness, \"0.5pt\");\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.color = null;\n this.extras = null;\n }\n\n [$toStyle]() {\n // TODO: dashDot & dashDotDot.\n const style = toStyle(this, \"visibility\");\n Object.assign(style, {\n linecap: this.cap,\n width: measureToString(this.thickness),\n color: this.color ? this.color[$toStyle]() : \"#000000\",\n style: \"\",\n });\n\n if (this.presence !== \"visible\") {\n style.style = \"none\";\n } else {\n switch (this.stroke) {\n case \"solid\":\n style.style = \"solid\";\n break;\n case \"dashDot\":\n style.style = \"dashed\";\n break;\n case \"dashDotDot\":\n style.style = \"dashed\";\n break;\n case \"dashed\":\n style.style = \"dashed\";\n break;\n case \"dotted\":\n style.style = \"dotted\";\n break;\n case \"embossed\":\n style.style = \"ridge\";\n break;\n case \"etched\":\n style.style = \"groove\";\n break;\n case \"lowered\":\n style.style = \"inset\";\n break;\n case \"raised\":\n style.style = \"outset\";\n break;\n }\n }\n return style;\n }\n}\n\nclass Encoding extends OptionObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"encoding\", [\n \"adbe.x509.rsa_sha1\",\n \"adbe.pkcs7.detached\",\n \"adbe.pkcs7.sha1\",\n ]);\n this.id = attributes.id || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass Encodings extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"encodings\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.type = getStringOption(attributes.type, [\"optional\", \"required\"]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.encoding = new XFAObjectArray();\n }\n}\n\nclass Encrypt extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"encrypt\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.certificate = null;\n }\n}\n\nclass EncryptData extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"encryptData\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.operation = getStringOption(attributes.operation, [\n \"encrypt\",\n \"decrypt\",\n ]);\n this.target = attributes.target || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.filter = null;\n this.manifest = null;\n }\n}\n\nclass Encryption extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"encryption\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.type = getStringOption(attributes.type, [\"optional\", \"required\"]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.certificate = new XFAObjectArray();\n }\n}\n\nclass EncryptionMethod extends OptionObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"encryptionMethod\", [\n \"\",\n \"AES256-CBC\",\n \"TRIPLEDES-CBC\",\n \"AES128-CBC\",\n \"AES192-CBC\",\n ]);\n this.id = attributes.id || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass EncryptionMethods extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"encryptionMethods\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.type = getStringOption(attributes.type, [\"optional\", \"required\"]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.encryptionMethod = new XFAObjectArray();\n }\n}\n\nclass Event extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"event\", /* hasChildren = */ true);\n this.activity = getStringOption(attributes.activity, [\n \"click\",\n \"change\",\n \"docClose\",\n \"docReady\",\n \"enter\",\n \"exit\",\n \"full\",\n \"indexChange\",\n \"initialize\",\n \"mouseDown\",\n \"mouseEnter\",\n \"mouseExit\",\n \"mouseUp\",\n \"postExecute\",\n \"postOpen\",\n \"postPrint\",\n \"postSave\",\n \"postSign\",\n \"postSubmit\",\n \"preExecute\",\n \"preOpen\",\n \"prePrint\",\n \"preSave\",\n \"preSign\",\n \"preSubmit\",\n \"ready\",\n \"validationState\",\n ]);\n this.id = attributes.id || \"\";\n this.listen = getStringOption(attributes.listen, [\n \"refOnly\",\n \"refAndDescendents\",\n ]);\n this.name = attributes.name || \"\";\n this.ref = attributes.ref || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.extras = null;\n\n // One-of properties\n this.encryptData = null;\n this.execute = null;\n this.script = null;\n this.signData = null;\n this.submit = null;\n }\n}\n\nclass ExData extends ContentObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"exData\");\n this.contentType = attributes.contentType || \"\";\n this.href = attributes.href || \"\";\n this.id = attributes.id || \"\";\n this.maxLength = getInteger({\n data: attributes.maxLength,\n defaultValue: -1,\n validate: x => x >= -1,\n });\n this.name = attributes.name || \"\";\n this.rid = attributes.rid || \"\";\n this.transferEncoding = getStringOption(attributes.transferEncoding, [\n \"none\",\n \"base64\",\n \"package\",\n ]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n\n [$isCDATAXml]() {\n return this.contentType === \"text/html\";\n }\n\n [$onChild](child) {\n if (\n this.contentType === \"text/html\" &&\n child[$namespaceId] === NamespaceIds.xhtml.id\n ) {\n this[$content] = child;\n return true;\n }\n\n if (this.contentType === \"text/xml\") {\n this[$content] = child;\n return true;\n }\n\n return false;\n }\n\n [$toHTML](availableSpace) {\n if (this.contentType !== \"text/html\" || !this[$content]) {\n // TODO: fix other cases.\n return HTMLResult.EMPTY;\n }\n\n return this[$content][$toHTML](availableSpace);\n }\n}\n\nclass ExObject extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"exObject\", /* hasChildren = */ true);\n this.archive = attributes.archive || \"\";\n this.classId = attributes.classId || \"\";\n this.codeBase = attributes.codeBase || \"\";\n this.codeType = attributes.codeType || \"\";\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.extras = null;\n this.boolean = new XFAObjectArray();\n this.date = new XFAObjectArray();\n this.dateTime = new XFAObjectArray();\n this.decimal = new XFAObjectArray();\n this.exData = new XFAObjectArray();\n this.exObject = new XFAObjectArray();\n this.float = new XFAObjectArray();\n this.image = new XFAObjectArray();\n this.integer = new XFAObjectArray();\n this.text = new XFAObjectArray();\n this.time = new XFAObjectArray();\n }\n}\n\nclass ExclGroup extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"exclGroup\", /* hasChildren = */ true);\n this.access = getStringOption(attributes.access, [\n \"open\",\n \"nonInteractive\",\n \"protected\",\n \"readOnly\",\n ]);\n this.accessKey = attributes.accessKey || \"\";\n this.anchorType = getStringOption(attributes.anchorType, [\n \"topLeft\",\n \"bottomCenter\",\n \"bottomLeft\",\n \"bottomRight\",\n \"middleCenter\",\n \"middleLeft\",\n \"middleRight\",\n \"topCenter\",\n \"topRight\",\n ]);\n this.colSpan = getInteger({\n data: attributes.colSpan,\n defaultValue: 1,\n validate: n => n >= 1 || n === -1,\n });\n this.h = attributes.h ? getMeasurement(attributes.h) : \"\";\n this.hAlign = getStringOption(attributes.hAlign, [\n \"left\",\n \"center\",\n \"justify\",\n \"justifyAll\",\n \"radix\",\n \"right\",\n ]);\n this.id = attributes.id || \"\";\n this.layout = getStringOption(attributes.layout, [\n \"position\",\n \"lr-tb\",\n \"rl-row\",\n \"rl-tb\",\n \"row\",\n \"table\",\n \"tb\",\n ]);\n this.maxH = getMeasurement(attributes.maxH, \"0pt\");\n this.maxW = getMeasurement(attributes.maxW, \"0pt\");\n this.minH = getMeasurement(attributes.minH, \"0pt\");\n this.minW = getMeasurement(attributes.minW, \"0pt\");\n this.name = attributes.name || \"\";\n this.presence = getStringOption(attributes.presence, [\n \"visible\",\n \"hidden\",\n \"inactive\",\n \"invisible\",\n ]);\n this.relevant = getRelevant(attributes.relevant);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.w = attributes.w ? getMeasurement(attributes.w) : \"\";\n this.x = getMeasurement(attributes.x, \"0pt\");\n this.y = getMeasurement(attributes.y, \"0pt\");\n this.assist = null;\n this.bind = null;\n this.border = null;\n this.calculate = null;\n this.caption = null;\n this.desc = null;\n this.extras = null;\n this.margin = null;\n this.para = null;\n this.traversal = null;\n this.validate = null;\n this.connect = new XFAObjectArray();\n this.event = new XFAObjectArray();\n this.field = new XFAObjectArray();\n this.setProperty = new XFAObjectArray();\n }\n\n [$isBindable]() {\n return true;\n }\n\n [$hasSettableValue]() {\n return true;\n }\n\n [$setValue](value) {\n for (const field of this.field.children) {\n if (!field.value) {\n const nodeValue = new Value({});\n field[$appendChild](nodeValue);\n field.value = nodeValue;\n }\n\n field.value[$setValue](value);\n }\n }\n\n [$isThereMoreWidth]() {\n return (\n (this.layout.endsWith(\"-tb\") &&\n this[$extra].attempt === 0 &&\n this[$extra].numberInLine > 0) ||\n this[$getParent]()[$isThereMoreWidth]()\n );\n }\n\n [$isSplittable]() {\n // We cannot cache the result here because the contentArea\n // can change.\n const parent = this[$getSubformParent]();\n if (!parent[$isSplittable]()) {\n return false;\n }\n\n if (this[$extra]._isSplittable !== undefined) {\n return this[$extra]._isSplittable;\n }\n\n if (this.layout === \"position\" || this.layout.includes(\"row\")) {\n this[$extra]._isSplittable = false;\n return false;\n }\n\n if (parent.layout?.endsWith(\"-tb\") && parent[$extra].numberInLine !== 0) {\n // See comment in Subform::[$isSplittable] for an explanation.\n return false;\n }\n\n this[$extra]._isSplittable = true;\n return true;\n }\n\n [$flushHTML]() {\n return flushHTML(this);\n }\n\n [$addHTML](html, bbox) {\n addHTML(this, html, bbox);\n }\n\n [$getAvailableSpace]() {\n return getAvailableSpace(this);\n }\n\n [$toHTML](availableSpace) {\n setTabIndex(this);\n if (\n this.presence === \"hidden\" ||\n this.presence === \"inactive\" ||\n this.h === 0 ||\n this.w === 0\n ) {\n return HTMLResult.EMPTY;\n }\n\n fixDimensions(this);\n\n const children = [];\n const attributes = {\n id: this[$uid],\n class: [],\n };\n\n setAccess(this, attributes.class);\n\n if (!this[$extra]) {\n this[$extra] = Object.create(null);\n }\n\n Object.assign(this[$extra], {\n children,\n attributes,\n attempt: 0,\n line: null,\n numberInLine: 0,\n availableSpace: {\n width: Math.min(this.w || Infinity, availableSpace.width),\n height: Math.min(this.h || Infinity, availableSpace.height),\n },\n width: 0,\n height: 0,\n prevHeight: 0,\n currentWidth: 0,\n });\n\n const isSplittable = this[$isSplittable]();\n if (!isSplittable) {\n setFirstUnsplittable(this);\n }\n\n if (!checkDimensions(this, availableSpace)) {\n return HTMLResult.FAILURE;\n }\n const filter = new Set([\"field\"]);\n\n if (this.layout.includes(\"row\")) {\n const columnWidths = this[$getSubformParent]().columnWidths;\n if (Array.isArray(columnWidths) && columnWidths.length > 0) {\n this[$extra].columnWidths = columnWidths;\n this[$extra].currentColumn = 0;\n }\n }\n\n const style = toStyle(\n this,\n \"anchorType\",\n \"dimensions\",\n \"position\",\n \"presence\",\n \"border\",\n \"margin\",\n \"hAlign\"\n );\n const classNames = [\"xfaExclgroup\"];\n const cl = layoutClass(this);\n if (cl) {\n classNames.push(cl);\n }\n\n if (isPrintOnly(this)) {\n classNames.push(\"xfaPrintOnly\");\n }\n\n attributes.style = style;\n attributes.class = classNames;\n\n if (this.name) {\n attributes.xfaName = this.name;\n }\n\n this[$pushPara]();\n const isLrTb = this.layout === \"lr-tb\" || this.layout === \"rl-tb\";\n const maxRun = isLrTb ? MAX_ATTEMPTS_FOR_LRTB_LAYOUT : 1;\n for (; this[$extra].attempt < maxRun; this[$extra].attempt++) {\n if (isLrTb && this[$extra].attempt === MAX_ATTEMPTS_FOR_LRTB_LAYOUT - 1) {\n // If the layout is lr-tb then having attempt equals to\n // MAX_ATTEMPTS_FOR_LRTB_LAYOUT-1 means that we're trying to layout\n // on the next line so this on is empty.\n this[$extra].numberInLine = 0;\n }\n const result = this[$childrenToHTML]({\n filter,\n include: true,\n });\n if (result.success) {\n break;\n }\n if (result.isBreak()) {\n this[$popPara]();\n return result;\n }\n if (\n isLrTb &&\n this[$extra].attempt === 0 &&\n this[$extra].numberInLine === 0 &&\n !this[$getTemplateRoot]()[$extra].noLayoutFailure\n ) {\n // See comment in Subform::[$toHTML].\n this[$extra].attempt = maxRun;\n break;\n }\n }\n\n this[$popPara]();\n\n if (!isSplittable) {\n unsetFirstUnsplittable(this);\n }\n\n if (this[$extra].attempt === maxRun) {\n if (!isSplittable) {\n delete this[$extra];\n }\n return HTMLResult.FAILURE;\n }\n\n let marginH = 0;\n let marginV = 0;\n if (this.margin) {\n marginH = this.margin.leftInset + this.margin.rightInset;\n marginV = this.margin.topInset + this.margin.bottomInset;\n }\n\n const width = Math.max(this[$extra].width + marginH, this.w || 0);\n const height = Math.max(this[$extra].height + marginV, this.h || 0);\n const bbox = [this.x, this.y, width, height];\n\n if (this.w === \"\") {\n style.width = measureToString(width);\n }\n if (this.h === \"\") {\n style.height = measureToString(height);\n }\n\n const html = {\n name: \"div\",\n attributes,\n children,\n };\n\n applyAssist(this, attributes);\n\n delete this[$extra];\n\n return HTMLResult.success(createWrapper(this, html), bbox);\n }\n}\n\nclass Execute extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"execute\");\n this.connection = attributes.connection || \"\";\n this.executeType = getStringOption(attributes.executeType, [\n \"import\",\n \"remerge\",\n ]);\n this.id = attributes.id || \"\";\n this.runAt = getStringOption(attributes.runAt, [\n \"client\",\n \"both\",\n \"server\",\n ]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass Extras extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"extras\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.boolean = new XFAObjectArray();\n this.date = new XFAObjectArray();\n this.dateTime = new XFAObjectArray();\n this.decimal = new XFAObjectArray();\n this.exData = new XFAObjectArray();\n this.extras = new XFAObjectArray();\n this.float = new XFAObjectArray();\n this.image = new XFAObjectArray();\n this.integer = new XFAObjectArray();\n this.text = new XFAObjectArray();\n this.time = new XFAObjectArray();\n }\n\n // (Spec) The XFA template grammar defines the extras and desc elements,\n // which can be used to add human-readable or machine-readable\n // data to a template.\n}\n\nclass Field extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"field\", /* hasChildren = */ true);\n this.access = getStringOption(attributes.access, [\n \"open\",\n \"nonInteractive\",\n \"protected\",\n \"readOnly\",\n ]);\n this.accessKey = attributes.accessKey || \"\";\n this.anchorType = getStringOption(attributes.anchorType, [\n \"topLeft\",\n \"bottomCenter\",\n \"bottomLeft\",\n \"bottomRight\",\n \"middleCenter\",\n \"middleLeft\",\n \"middleRight\",\n \"topCenter\",\n \"topRight\",\n ]);\n this.colSpan = getInteger({\n data: attributes.colSpan,\n defaultValue: 1,\n validate: n => n >= 1 || n === -1,\n });\n this.h = attributes.h ? getMeasurement(attributes.h) : \"\";\n this.hAlign = getStringOption(attributes.hAlign, [\n \"left\",\n \"center\",\n \"justify\",\n \"justifyAll\",\n \"radix\",\n \"right\",\n ]);\n this.id = attributes.id || \"\";\n this.locale = attributes.locale || \"\";\n this.maxH = getMeasurement(attributes.maxH, \"0pt\");\n this.maxW = getMeasurement(attributes.maxW, \"0pt\");\n this.minH = getMeasurement(attributes.minH, \"0pt\");\n this.minW = getMeasurement(attributes.minW, \"0pt\");\n this.name = attributes.name || \"\";\n this.presence = getStringOption(attributes.presence, [\n \"visible\",\n \"hidden\",\n \"inactive\",\n \"invisible\",\n ]);\n this.relevant = getRelevant(attributes.relevant);\n this.rotate = getInteger({\n data: attributes.rotate,\n defaultValue: 0,\n validate: x => x % 90 === 0,\n });\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.w = attributes.w ? getMeasurement(attributes.w) : \"\";\n this.x = getMeasurement(attributes.x, \"0pt\");\n this.y = getMeasurement(attributes.y, \"0pt\");\n this.assist = null;\n this.bind = null;\n this.border = null;\n this.calculate = null;\n this.caption = null;\n this.desc = null;\n this.extras = null;\n this.font = null;\n this.format = null;\n // For a choice list, one list is used to have display entries\n // and the other for the exported values\n this.items = new XFAObjectArray(2);\n this.keep = null;\n this.margin = null;\n this.para = null;\n this.traversal = null;\n this.ui = null;\n this.validate = null;\n this.value = null;\n this.bindItems = new XFAObjectArray();\n this.connect = new XFAObjectArray();\n this.event = new XFAObjectArray();\n this.setProperty = new XFAObjectArray();\n }\n\n [$isBindable]() {\n return true;\n }\n\n [$setValue](value) {\n _setValue(this, value);\n }\n\n [$toHTML](availableSpace) {\n setTabIndex(this);\n\n if (!this.ui) {\n // It's allowed to not have an ui, specs say:\n // If the UI element contains no children or is not present,\n // the application chooses a default user interface for the\n // container, based on the type of the container's content.\n\n this.ui = new Ui({});\n this.ui[$globalData] = this[$globalData];\n this[$appendChild](this.ui);\n let node;\n\n // The items element can have 2 element max and\n // according to the items specs it's likely a good\n // way to guess the correct ui type.\n switch (this.items.children.length) {\n case 0:\n node = new TextEdit({});\n this.ui.textEdit = node;\n break;\n case 1:\n node = new CheckButton({});\n this.ui.checkButton = node;\n break;\n case 2:\n node = new ChoiceList({});\n this.ui.choiceList = node;\n break;\n }\n this.ui[$appendChild](node);\n }\n\n if (\n !this.ui ||\n this.presence === \"hidden\" ||\n this.presence === \"inactive\" ||\n this.h === 0 ||\n this.w === 0\n ) {\n return HTMLResult.EMPTY;\n }\n\n if (this.caption) {\n // Maybe we already tried to layout this field with\n // another availableSpace, so to avoid to use the cached\n // value just delete it.\n delete this.caption[$extra];\n }\n\n this[$pushPara]();\n\n const caption = this.caption\n ? this.caption[$toHTML](availableSpace).html\n : null;\n const savedW = this.w;\n const savedH = this.h;\n let marginH = 0;\n let marginV = 0;\n if (this.margin) {\n marginH = this.margin.leftInset + this.margin.rightInset;\n marginV = this.margin.topInset + this.margin.bottomInset;\n }\n\n let borderDims = null;\n if (this.w === \"\" || this.h === \"\") {\n let width = null;\n let height = null;\n\n let uiW = 0;\n let uiH = 0;\n if (this.ui.checkButton) {\n uiW = uiH = this.ui.checkButton.size;\n } else {\n const { w, h } = layoutNode(this, availableSpace);\n if (w !== null) {\n uiW = w;\n uiH = h;\n } else {\n uiH = getMetrics(this.font, /* real = */ true).lineNoGap;\n }\n }\n\n borderDims = getBorderDims(this.ui[$getExtra]());\n uiW += borderDims.w;\n uiH += borderDims.h;\n\n if (this.caption) {\n const { w, h, isBroken } = this.caption[$getExtra](availableSpace);\n // See comment in Draw::[$toHTML] to have an explanation\n // about this line.\n if (isBroken && this[$getSubformParent]()[$isThereMoreWidth]()) {\n this[$popPara]();\n return HTMLResult.FAILURE;\n }\n\n width = w;\n height = h;\n\n switch (this.caption.placement) {\n case \"left\":\n case \"right\":\n case \"inline\":\n width += uiW;\n break;\n case \"top\":\n case \"bottom\":\n height += uiH;\n break;\n }\n } else {\n width = uiW;\n height = uiH;\n }\n\n if (width && this.w === \"\") {\n width += marginH;\n this.w = Math.min(\n this.maxW <= 0 ? Infinity : this.maxW,\n this.minW + 1 < width ? width : this.minW\n );\n }\n\n if (height && this.h === \"\") {\n height += marginV;\n this.h = Math.min(\n this.maxH <= 0 ? Infinity : this.maxH,\n this.minH + 1 < height ? height : this.minH\n );\n }\n }\n\n this[$popPara]();\n\n fixDimensions(this);\n\n setFirstUnsplittable(this);\n if (!checkDimensions(this, availableSpace)) {\n this.w = savedW;\n this.h = savedH;\n this[$popPara]();\n return HTMLResult.FAILURE;\n }\n unsetFirstUnsplittable(this);\n\n const style = toStyle(\n this,\n \"font\",\n \"dimensions\",\n \"position\",\n \"rotate\",\n \"anchorType\",\n \"presence\",\n \"margin\",\n \"hAlign\"\n );\n\n setMinMaxDimensions(this, style);\n\n const classNames = [\"xfaField\"];\n // If no font, font properties are inherited.\n if (this.font) {\n classNames.push(\"xfaFont\");\n }\n\n if (isPrintOnly(this)) {\n classNames.push(\"xfaPrintOnly\");\n }\n\n const attributes = {\n style,\n id: this[$uid],\n class: classNames,\n };\n\n if (style.margin) {\n style.padding = style.margin;\n delete style.margin;\n }\n\n setAccess(this, classNames);\n\n if (this.name) {\n attributes.xfaName = this.name;\n }\n\n const children = [];\n const html = {\n name: \"div\",\n attributes,\n children,\n };\n\n applyAssist(this, attributes);\n\n const borderStyle = this.border ? this.border[$toStyle]() : null;\n const bbox = computeBbox(this, html, availableSpace);\n const ui = this.ui[$toHTML]().html;\n if (!ui) {\n Object.assign(style, borderStyle);\n return HTMLResult.success(createWrapper(this, html), bbox);\n }\n\n if (this[$tabIndex]) {\n if (ui.children?.[0]) {\n ui.children[0].attributes.tabindex = this[$tabIndex];\n } else {\n ui.attributes.tabindex = this[$tabIndex];\n }\n }\n\n if (!ui.attributes.style) {\n ui.attributes.style = Object.create(null);\n }\n\n let aElement = null;\n\n if (this.ui.button) {\n if (ui.children.length === 1) {\n [aElement] = ui.children.splice(0, 1);\n }\n Object.assign(ui.attributes.style, borderStyle);\n } else {\n Object.assign(style, borderStyle);\n }\n\n children.push(ui);\n\n if (this.value) {\n if (this.ui.imageEdit) {\n ui.children.push(this.value[$toHTML]().html);\n } else if (!this.ui.button) {\n let value = \"\";\n if (this.value.exData) {\n value = this.value.exData[$text]();\n } else if (this.value.text) {\n value = this.value.text[$getExtra]();\n } else {\n const htmlValue = this.value[$toHTML]().html;\n if (htmlValue !== null) {\n value = htmlValue.children[0].value;\n }\n }\n if (this.ui.textEdit && this.value.text?.maxChars) {\n ui.children[0].attributes.maxLength = this.value.text.maxChars;\n }\n\n if (value) {\n if (this.ui.numericEdit) {\n value = parseFloat(value);\n value = isNaN(value) ? \"\" : value.toString();\n }\n\n if (ui.children[0].name === \"textarea\") {\n ui.children[0].attributes.textContent = value;\n } else {\n ui.children[0].attributes.value = value;\n }\n }\n }\n }\n\n if (!this.ui.imageEdit && ui.children?.[0] && this.h) {\n borderDims = borderDims || getBorderDims(this.ui[$getExtra]());\n\n let captionHeight = 0;\n if (this.caption && [\"top\", \"bottom\"].includes(this.caption.placement)) {\n captionHeight = this.caption.reserve;\n if (captionHeight <= 0) {\n captionHeight = this.caption[$getExtra](availableSpace).h;\n }\n const inputHeight = this.h - captionHeight - marginV - borderDims.h;\n ui.children[0].attributes.style.height = measureToString(inputHeight);\n } else {\n ui.children[0].attributes.style.height = \"100%\";\n }\n }\n\n if (aElement) {\n ui.children.push(aElement);\n }\n\n if (!caption) {\n if (ui.attributes.class) {\n // Even if no caption this class will help to center the ui.\n ui.attributes.class.push(\"xfaLeft\");\n }\n this.w = savedW;\n this.h = savedH;\n\n return HTMLResult.success(createWrapper(this, html), bbox);\n }\n\n if (this.ui.button) {\n if (style.padding) {\n delete style.padding;\n }\n if (caption.name === \"div\") {\n caption.name = \"span\";\n }\n ui.children.push(caption);\n return HTMLResult.success(html, bbox);\n } else if (this.ui.checkButton) {\n caption.attributes.class[0] = \"xfaCaptionForCheckButton\";\n }\n\n if (!ui.attributes.class) {\n ui.attributes.class = [];\n }\n\n ui.children.splice(0, 0, caption);\n\n switch (this.caption.placement) {\n case \"left\":\n ui.attributes.class.push(\"xfaLeft\");\n break;\n case \"right\":\n ui.attributes.class.push(\"xfaRight\");\n break;\n case \"top\":\n ui.attributes.class.push(\"xfaTop\");\n break;\n case \"bottom\":\n ui.attributes.class.push(\"xfaBottom\");\n break;\n case \"inline\":\n // TODO;\n ui.attributes.class.push(\"xfaLeft\");\n break;\n }\n\n this.w = savedW;\n this.h = savedH;\n return HTMLResult.success(createWrapper(this, html), bbox);\n }\n}\n\nclass Fill extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"fill\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.presence = getStringOption(attributes.presence, [\n \"visible\",\n \"hidden\",\n \"inactive\",\n \"invisible\",\n ]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.color = null;\n this.extras = null;\n\n // One-of properties or none\n this.linear = null;\n this.pattern = null;\n this.radial = null;\n this.solid = null;\n this.stipple = null;\n }\n\n [$toStyle]() {\n const parent = this[$getParent]();\n const grandpa = parent[$getParent]();\n const ggrandpa = grandpa[$getParent]();\n const style = Object.create(null);\n\n // Use for color, i.e. #...\n let propName = \"color\";\n\n // Use for non-color, i.e. gradient, radial-gradient...\n let altPropName = propName;\n\n if (parent instanceof Border) {\n propName = \"background-color\";\n altPropName = \"background\";\n if (ggrandpa instanceof Ui) {\n // The default fill color is white.\n style.backgroundColor = \"white\";\n }\n }\n if (parent instanceof Rectangle || parent instanceof Arc) {\n propName = altPropName = \"fill\";\n style.fill = \"white\";\n }\n\n for (const name of Object.getOwnPropertyNames(this)) {\n if (name === \"extras\" || name === \"color\") {\n continue;\n }\n const obj = this[name];\n if (!(obj instanceof XFAObject)) {\n continue;\n }\n\n const color = obj[$toStyle](this.color);\n if (color) {\n style[color.startsWith(\"#\") ? propName : altPropName] = color;\n }\n return style;\n }\n\n if (this.color?.value) {\n const color = this.color[$toStyle]();\n style[color.startsWith(\"#\") ? propName : altPropName] = color;\n }\n\n return style;\n }\n}\n\nclass Filter extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"filter\", /* hasChildren = */ true);\n this.addRevocationInfo = getStringOption(attributes.addRevocationInfo, [\n \"\",\n \"required\",\n \"optional\",\n \"none\",\n ]);\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.version = getInteger({\n data: this.version,\n defaultValue: 5,\n validate: x => x >= 1 && x <= 5,\n });\n this.appearanceFilter = null;\n this.certificates = null;\n this.digestMethods = null;\n this.encodings = null;\n this.encryptionMethods = null;\n this.handler = null;\n this.lockDocument = null;\n this.mdp = null;\n this.reasons = null;\n this.timeStamp = null;\n }\n}\n\nclass Float extends ContentObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"float\");\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n\n [$finalize]() {\n const number = parseFloat(this[$content].trim());\n this[$content] = isNaN(number) ? null : number;\n }\n\n [$toHTML](availableSpace) {\n return valueToHtml(\n this[$content] !== null ? this[$content].toString() : \"\"\n );\n }\n}\n\nclass Font extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"font\", /* hasChildren = */ true);\n this.baselineShift = getMeasurement(attributes.baselineShift);\n this.fontHorizontalScale = getFloat({\n data: attributes.fontHorizontalScale,\n defaultValue: 100,\n validate: x => x >= 0,\n });\n this.fontVerticalScale = getFloat({\n data: attributes.fontVerticalScale,\n defaultValue: 100,\n validate: x => x >= 0,\n });\n this.id = attributes.id || \"\";\n this.kerningMode = getStringOption(attributes.kerningMode, [\n \"none\",\n \"pair\",\n ]);\n this.letterSpacing = getMeasurement(attributes.letterSpacing, \"0\");\n this.lineThrough = getInteger({\n data: attributes.lineThrough,\n defaultValue: 0,\n validate: x => x === 1 || x === 2,\n });\n this.lineThroughPeriod = getStringOption(attributes.lineThroughPeriod, [\n \"all\",\n \"word\",\n ]);\n this.overline = getInteger({\n data: attributes.overline,\n defaultValue: 0,\n validate: x => x === 1 || x === 2,\n });\n this.overlinePeriod = getStringOption(attributes.overlinePeriod, [\n \"all\",\n \"word\",\n ]);\n this.posture = getStringOption(attributes.posture, [\"normal\", \"italic\"]);\n this.size = getMeasurement(attributes.size, \"10pt\");\n this.typeface = attributes.typeface || \"Courier\";\n this.underline = getInteger({\n data: attributes.underline,\n defaultValue: 0,\n validate: x => x === 1 || x === 2,\n });\n this.underlinePeriod = getStringOption(attributes.underlinePeriod, [\n \"all\",\n \"word\",\n ]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.weight = getStringOption(attributes.weight, [\"normal\", \"bold\"]);\n this.extras = null;\n this.fill = null;\n }\n\n [$clean](builder) {\n super[$clean](builder);\n this[$globalData].usedTypefaces.add(this.typeface);\n }\n\n [$toStyle]() {\n const style = toStyle(this, \"fill\");\n const color = style.color;\n if (color) {\n if (color === \"#000000\") {\n // Default font color.\n delete style.color;\n } else if (!color.startsWith(\"#\")) {\n // We've a gradient which is not possible for a font color\n // so use a workaround.\n style.background = color;\n style.backgroundClip = \"text\";\n style.color = \"transparent\";\n }\n }\n\n if (this.baselineShift) {\n style.verticalAlign = measureToString(this.baselineShift);\n }\n\n // TODO: fontHorizontalScale\n // TODO: fontVerticalScale\n\n style.fontKerning = this.kerningMode === \"none\" ? \"none\" : \"normal\";\n style.letterSpacing = measureToString(this.letterSpacing);\n\n if (this.lineThrough !== 0) {\n style.textDecoration = \"line-through\";\n if (this.lineThrough === 2) {\n style.textDecorationStyle = \"double\";\n }\n }\n\n // TODO: lineThroughPeriod\n\n if (this.overline !== 0) {\n style.textDecoration = \"overline\";\n if (this.overline === 2) {\n style.textDecorationStyle = \"double\";\n }\n }\n\n // TODO: overlinePeriod\n\n style.fontStyle = this.posture;\n style.fontSize = measureToString(0.99 * this.size);\n\n setFontFamily(this, this, this[$globalData].fontFinder, style);\n\n if (this.underline !== 0) {\n style.textDecoration = \"underline\";\n if (this.underline === 2) {\n style.textDecorationStyle = \"double\";\n }\n }\n\n // TODO: underlinePeriod\n\n style.fontWeight = this.weight;\n\n return style;\n }\n}\n\nclass Format extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"format\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.extras = null;\n this.picture = null;\n }\n}\n\nclass Handler extends StringObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"handler\");\n this.id = attributes.id || \"\";\n this.type = getStringOption(attributes.type, [\"optional\", \"required\"]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass Hyphenation extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"hyphenation\");\n this.excludeAllCaps = getInteger({\n data: attributes.excludeAllCaps,\n defaultValue: 0,\n validate: x => x === 1,\n });\n this.excludeInitialCap = getInteger({\n data: attributes.excludeInitialCap,\n defaultValue: 0,\n validate: x => x === 1,\n });\n this.hyphenate = getInteger({\n data: attributes.hyphenate,\n defaultValue: 0,\n validate: x => x === 1,\n });\n this.id = attributes.id || \"\";\n this.pushCharacterCount = getInteger({\n data: attributes.pushCharacterCount,\n defaultValue: 3,\n validate: x => x >= 0,\n });\n this.remainCharacterCount = getInteger({\n data: attributes.remainCharacterCount,\n defaultValue: 3,\n validate: x => x >= 0,\n });\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.wordCharacterCount = getInteger({\n data: attributes.wordCharacterCount,\n defaultValue: 7,\n validate: x => x >= 0,\n });\n }\n}\n\nclass Image extends StringObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"image\");\n this.aspect = getStringOption(attributes.aspect, [\n \"fit\",\n \"actual\",\n \"height\",\n \"none\",\n \"width\",\n ]);\n this.contentType = attributes.contentType || \"\";\n this.href = attributes.href || \"\";\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.transferEncoding = getStringOption(attributes.transferEncoding, [\n \"base64\",\n \"none\",\n \"package\",\n ]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n\n [$toHTML]() {\n if (this.contentType && !MIMES.has(this.contentType.toLowerCase())) {\n return HTMLResult.EMPTY;\n }\n\n let buffer =\n this[$globalData].images && this[$globalData].images.get(this.href);\n if (!buffer && (this.href || !this[$content])) {\n // In general, we don't get remote data and use what we have\n // in the pdf itself, so no picture for non null href.\n return HTMLResult.EMPTY;\n }\n\n if (!buffer && this.transferEncoding === \"base64\") {\n buffer = stringToBytes(atob(this[$content]));\n }\n\n if (!buffer) {\n return HTMLResult.EMPTY;\n }\n\n if (!this.contentType) {\n for (const [header, type] of IMAGES_HEADERS) {\n if (\n buffer.length > header.length &&\n header.every((x, i) => x === buffer[i])\n ) {\n this.contentType = type;\n break;\n }\n }\n if (!this.contentType) {\n return HTMLResult.EMPTY;\n }\n }\n\n // TODO: Firefox doesn't support natively tiff (and tif) format.\n const blob = new Blob([buffer], { type: this.contentType });\n let style;\n switch (this.aspect) {\n case \"fit\":\n case \"actual\":\n // TODO: check what to do with actual.\n // Normally we should return {auto, auto} for it but\n // it implies some wrong rendering (see xfa_bug1716816.pdf).\n break;\n case \"height\":\n style = {\n height: \"100%\",\n objectFit: \"fill\",\n };\n break;\n case \"none\":\n style = {\n width: \"100%\",\n height: \"100%\",\n objectFit: \"fill\",\n };\n break;\n case \"width\":\n style = {\n width: \"100%\",\n objectFit: \"fill\",\n };\n break;\n }\n const parent = this[$getParent]();\n return HTMLResult.success({\n name: \"img\",\n attributes: {\n class: [\"xfaImage\"],\n style,\n src: URL.createObjectURL(blob),\n alt: parent ? ariaLabel(parent[$getParent]()) : null,\n },\n });\n }\n}\n\nclass ImageEdit extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"imageEdit\", /* hasChildren = */ true);\n this.data = getStringOption(attributes.data, [\"link\", \"embed\"]);\n this.id = attributes.id || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.border = null;\n this.extras = null;\n this.margin = null;\n }\n\n [$toHTML](availableSpace) {\n if (this.data === \"embed\") {\n return HTMLResult.success({\n name: \"div\",\n children: [],\n attributes: {},\n });\n }\n\n return HTMLResult.EMPTY;\n }\n}\n\nclass Integer extends ContentObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"integer\");\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n\n [$finalize]() {\n const number = parseInt(this[$content].trim(), 10);\n this[$content] = isNaN(number) ? null : number;\n }\n\n [$toHTML](availableSpace) {\n return valueToHtml(\n this[$content] !== null ? this[$content].toString() : \"\"\n );\n }\n}\n\nclass Issuers extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"issuers\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.type = getStringOption(attributes.type, [\"optional\", \"required\"]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.certificate = new XFAObjectArray();\n }\n}\n\nclass Items extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"items\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.presence = getStringOption(attributes.presence, [\n \"visible\",\n \"hidden\",\n \"inactive\",\n \"invisible\",\n ]);\n this.ref = attributes.ref || \"\";\n this.save = getInteger({\n data: attributes.save,\n defaultValue: 0,\n validate: x => x === 1,\n });\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.boolean = new XFAObjectArray();\n this.date = new XFAObjectArray();\n this.dateTime = new XFAObjectArray();\n this.decimal = new XFAObjectArray();\n this.exData = new XFAObjectArray();\n this.float = new XFAObjectArray();\n this.image = new XFAObjectArray();\n this.integer = new XFAObjectArray();\n this.text = new XFAObjectArray();\n this.time = new XFAObjectArray();\n }\n\n [$toHTML]() {\n const output = [];\n for (const child of this[$getChildren]()) {\n output.push(child[$text]());\n }\n return HTMLResult.success(output);\n }\n}\n\nclass Keep extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"keep\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n const options = [\"none\", \"contentArea\", \"pageArea\"];\n this.intact = getStringOption(attributes.intact, options);\n this.next = getStringOption(attributes.next, options);\n this.previous = getStringOption(attributes.previous, options);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.extras = null;\n }\n}\n\nclass KeyUsage extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"keyUsage\");\n const options = [\"\", \"yes\", \"no\"];\n this.crlSign = getStringOption(attributes.crlSign, options);\n this.dataEncipherment = getStringOption(\n attributes.dataEncipherment,\n options\n );\n this.decipherOnly = getStringOption(attributes.decipherOnly, options);\n this.digitalSignature = getStringOption(\n attributes.digitalSignature,\n options\n );\n this.encipherOnly = getStringOption(attributes.encipherOnly, options);\n this.id = attributes.id || \"\";\n this.keyAgreement = getStringOption(attributes.keyAgreement, options);\n this.keyCertSign = getStringOption(attributes.keyCertSign, options);\n this.keyEncipherment = getStringOption(attributes.keyEncipherment, options);\n this.nonRepudiation = getStringOption(attributes.nonRepudiation, options);\n this.type = getStringOption(attributes.type, [\"optional\", \"required\"]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass Line extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"line\", /* hasChildren = */ true);\n this.hand = getStringOption(attributes.hand, [\"even\", \"left\", \"right\"]);\n this.id = attributes.id || \"\";\n this.slope = getStringOption(attributes.slope, [\"\\\\\", \"/\"]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.edge = null;\n }\n\n [$toHTML]() {\n const parent = this[$getParent]()[$getParent]();\n const edge = this.edge || new Edge({});\n const edgeStyle = edge[$toStyle]();\n const style = Object.create(null);\n const thickness = edge.presence === \"visible\" ? edge.thickness : 0;\n style.strokeWidth = measureToString(thickness);\n style.stroke = edgeStyle.color;\n let x1, y1, x2, y2;\n let width = \"100%\";\n let height = \"100%\";\n\n if (parent.w <= thickness) {\n [x1, y1, x2, y2] = [\"50%\", 0, \"50%\", \"100%\"];\n width = style.strokeWidth;\n } else if (parent.h <= thickness) {\n [x1, y1, x2, y2] = [0, \"50%\", \"100%\", \"50%\"];\n height = style.strokeWidth;\n } else if (this.slope === \"\\\\\") {\n [x1, y1, x2, y2] = [0, 0, \"100%\", \"100%\"];\n } else {\n [x1, y1, x2, y2] = [0, \"100%\", \"100%\", 0];\n }\n\n const line = {\n name: \"line\",\n attributes: {\n xmlns: SVG_NS,\n x1,\n y1,\n x2,\n y2,\n style,\n },\n };\n\n const svg = {\n name: \"svg\",\n children: [line],\n attributes: {\n xmlns: SVG_NS,\n width,\n height,\n style: {\n overflow: \"visible\",\n },\n },\n };\n\n if (hasMargin(parent)) {\n return HTMLResult.success({\n name: \"div\",\n attributes: {\n style: {\n display: \"inline\",\n width: \"100%\",\n height: \"100%\",\n },\n },\n children: [svg],\n });\n }\n\n svg.attributes.style.position = \"absolute\";\n return HTMLResult.success(svg);\n }\n}\n\nclass Linear extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"linear\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.type = getStringOption(attributes.type, [\n \"toRight\",\n \"toBottom\",\n \"toLeft\",\n \"toTop\",\n ]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.color = null;\n this.extras = null;\n }\n\n [$toStyle](startColor) {\n startColor = startColor ? startColor[$toStyle]() : \"#FFFFFF\";\n const transf = this.type.replace(/([RBLT])/, \" $1\").toLowerCase();\n const endColor = this.color ? this.color[$toStyle]() : \"#000000\";\n return `linear-gradient(${transf}, ${startColor}, ${endColor})`;\n }\n}\n\nclass LockDocument extends ContentObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"lockDocument\");\n this.id = attributes.id || \"\";\n this.type = getStringOption(attributes.type, [\"optional\", \"required\"]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n\n [$finalize]() {\n this[$content] = getStringOption(this[$content], [\"auto\", \"0\", \"1\"]);\n }\n}\n\nclass Manifest extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"manifest\", /* hasChildren = */ true);\n this.action = getStringOption(attributes.action, [\n \"include\",\n \"all\",\n \"exclude\",\n ]);\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.extras = null;\n this.ref = new XFAObjectArray();\n }\n}\n\nclass Margin extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"margin\", /* hasChildren = */ true);\n this.bottomInset = getMeasurement(attributes.bottomInset, \"0\");\n this.id = attributes.id || \"\";\n this.leftInset = getMeasurement(attributes.leftInset, \"0\");\n this.rightInset = getMeasurement(attributes.rightInset, \"0\");\n this.topInset = getMeasurement(attributes.topInset, \"0\");\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.extras = null;\n }\n\n [$toStyle]() {\n return {\n margin:\n measureToString(this.topInset) +\n \" \" +\n measureToString(this.rightInset) +\n \" \" +\n measureToString(this.bottomInset) +\n \" \" +\n measureToString(this.leftInset),\n };\n }\n}\n\nclass Mdp extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"mdp\");\n this.id = attributes.id || \"\";\n this.permissions = getInteger({\n data: attributes.permissions,\n defaultValue: 2,\n validate: x => x === 1 || x === 3,\n });\n this.signatureType = getStringOption(attributes.signatureType, [\n \"filler\",\n \"author\",\n ]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass Medium extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"medium\");\n this.id = attributes.id || \"\";\n this.imagingBBox = getBBox(attributes.imagingBBox);\n this.long = getMeasurement(attributes.long);\n this.orientation = getStringOption(attributes.orientation, [\n \"portrait\",\n \"landscape\",\n ]);\n this.short = getMeasurement(attributes.short);\n this.stock = attributes.stock || \"\";\n this.trayIn = getStringOption(attributes.trayIn, [\n \"auto\",\n \"delegate\",\n \"pageFront\",\n ]);\n this.trayOut = getStringOption(attributes.trayOut, [\"auto\", \"delegate\"]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass Message extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"message\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.text = new XFAObjectArray();\n }\n}\n\nclass NumericEdit extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"numericEdit\", /* hasChildren = */ true);\n this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, [\n \"auto\",\n \"off\",\n \"on\",\n ]);\n this.id = attributes.id || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.border = null;\n this.comb = null;\n this.extras = null;\n this.margin = null;\n }\n\n [$toHTML](availableSpace) {\n // TODO: incomplete.\n const style = toStyle(this, \"border\", \"font\", \"margin\");\n const field = this[$getParent]()[$getParent]();\n const html = {\n name: \"input\",\n attributes: {\n type: \"text\",\n fieldId: field[$uid],\n dataId: field[$data]?.[$uid] || field[$uid],\n class: [\"xfaTextfield\"],\n style,\n \"aria-label\": ariaLabel(field),\n \"aria-required\": false,\n },\n };\n\n if (isRequired(field)) {\n html.attributes[\"aria-required\"] = true;\n html.attributes.required = true;\n }\n\n return HTMLResult.success({\n name: \"label\",\n attributes: {\n class: [\"xfaLabel\"],\n },\n children: [html],\n });\n }\n}\n\nclass Occur extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"occur\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.initial =\n attributes.initial !== \"\"\n ? getInteger({\n data: attributes.initial,\n defaultValue: \"\",\n validate: x => true,\n })\n : \"\";\n this.max =\n attributes.max !== \"\"\n ? getInteger({\n data: attributes.max,\n defaultValue: 1,\n validate: x => true,\n })\n : \"\";\n this.min =\n attributes.min !== \"\"\n ? getInteger({\n data: attributes.min,\n defaultValue: 1,\n validate: x => true,\n })\n : \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.extras = null;\n }\n\n [$clean]() {\n const parent = this[$getParent]();\n const originalMin = this.min;\n\n if (this.min === \"\") {\n this.min =\n parent instanceof PageArea || parent instanceof PageSet ? 0 : 1;\n }\n if (this.max === \"\") {\n if (originalMin === \"\") {\n this.max =\n parent instanceof PageArea || parent instanceof PageSet ? -1 : 1;\n } else {\n this.max = this.min;\n }\n }\n\n if (this.max !== -1 && this.max < this.min) {\n this.max = this.min;\n }\n\n if (this.initial === \"\") {\n this.initial = parent instanceof Template ? 1 : this.min;\n }\n }\n}\n\nclass Oid extends StringObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"oid\");\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass Oids extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"oids\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.type = getStringOption(attributes.type, [\"optional\", \"required\"]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.oid = new XFAObjectArray();\n }\n}\n\nclass Overflow extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"overflow\");\n this.id = attributes.id || \"\";\n this.leader = attributes.leader || \"\";\n this.target = attributes.target || \"\";\n this.trailer = attributes.trailer || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n\n [$getExtra]() {\n if (!this[$extra]) {\n const parent = this[$getParent]();\n const root = this[$getTemplateRoot]();\n const target = root[$searchNode](this.target, parent);\n const leader = root[$searchNode](this.leader, parent);\n const trailer = root[$searchNode](this.trailer, parent);\n this[$extra] = {\n target: target?.[0] || null,\n leader: leader?.[0] || null,\n trailer: trailer?.[0] || null,\n addLeader: false,\n addTrailer: false,\n };\n }\n return this[$extra];\n }\n}\n\nclass PageArea extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"pageArea\", /* hasChildren = */ true);\n this.blankOrNotBlank = getStringOption(attributes.blankOrNotBlank, [\n \"any\",\n \"blank\",\n \"notBlank\",\n ]);\n this.id = attributes.id || \"\";\n this.initialNumber = getInteger({\n data: attributes.initialNumber,\n defaultValue: 1,\n validate: x => true,\n });\n this.name = attributes.name || \"\";\n this.numbered = getInteger({\n data: attributes.numbered,\n defaultValue: 1,\n validate: x => true,\n });\n this.oddOrEven = getStringOption(attributes.oddOrEven, [\n \"any\",\n \"even\",\n \"odd\",\n ]);\n this.pagePosition = getStringOption(attributes.pagePosition, [\n \"any\",\n \"first\",\n \"last\",\n \"only\",\n \"rest\",\n ]);\n this.relevant = getRelevant(attributes.relevant);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.desc = null;\n this.extras = null;\n this.medium = null;\n this.occur = null;\n this.area = new XFAObjectArray();\n this.contentArea = new XFAObjectArray();\n this.draw = new XFAObjectArray();\n this.exclGroup = new XFAObjectArray();\n this.field = new XFAObjectArray();\n this.subform = new XFAObjectArray();\n }\n\n [$isUsable]() {\n if (!this[$extra]) {\n this[$extra] = {\n numberOfUse: 0,\n };\n return true;\n }\n return (\n !this.occur ||\n this.occur.max === -1 ||\n this[$extra].numberOfUse < this.occur.max\n );\n }\n\n [$cleanPage]() {\n delete this[$extra];\n }\n\n [$getNextPage]() {\n if (!this[$extra]) {\n this[$extra] = {\n numberOfUse: 0,\n };\n }\n\n const parent = this[$getParent]();\n if (parent.relation === \"orderedOccurrence\") {\n if (this[$isUsable]()) {\n this[$extra].numberOfUse += 1;\n return this;\n }\n }\n\n return parent[$getNextPage]();\n }\n\n [$getAvailableSpace]() {\n return this[$extra].space || { width: 0, height: 0 };\n }\n\n [$toHTML]() {\n // TODO: incomplete.\n if (!this[$extra]) {\n this[$extra] = {\n numberOfUse: 1,\n };\n }\n\n const children = [];\n this[$extra].children = children;\n\n const style = Object.create(null);\n if (this.medium && this.medium.short && this.medium.long) {\n style.width = measureToString(this.medium.short);\n style.height = measureToString(this.medium.long);\n this[$extra].space = {\n width: this.medium.short,\n height: this.medium.long,\n };\n if (this.medium.orientation === \"landscape\") {\n const x = style.width;\n style.width = style.height;\n style.height = x;\n this[$extra].space = {\n width: this.medium.long,\n height: this.medium.short,\n };\n }\n } else {\n warn(\"XFA - No medium specified in pageArea: please file a bug.\");\n }\n\n this[$childrenToHTML]({\n filter: new Set([\"area\", \"draw\", \"field\", \"subform\"]),\n include: true,\n });\n\n // contentarea must be the last container to be sure it is\n // on top of the others.\n this[$childrenToHTML]({\n filter: new Set([\"contentArea\"]),\n include: true,\n });\n\n return HTMLResult.success({\n name: \"div\",\n children,\n attributes: {\n class: [\"xfaPage\"],\n id: this[$uid],\n style,\n xfaName: this.name,\n },\n });\n }\n}\n\nclass PageSet extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"pageSet\", /* hasChildren = */ true);\n this.duplexImposition = getStringOption(attributes.duplexImposition, [\n \"longEdge\",\n \"shortEdge\",\n ]);\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.relation = getStringOption(attributes.relation, [\n \"orderedOccurrence\",\n \"duplexPaginated\",\n \"simplexPaginated\",\n ]);\n this.relevant = getRelevant(attributes.relevant);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.extras = null;\n this.occur = null;\n this.pageArea = new XFAObjectArray();\n this.pageSet = new XFAObjectArray();\n }\n\n [$cleanPage]() {\n for (const page of this.pageArea.children) {\n page[$cleanPage]();\n }\n for (const page of this.pageSet.children) {\n page[$cleanPage]();\n }\n }\n\n [$isUsable]() {\n return (\n !this.occur ||\n this.occur.max === -1 ||\n this[$extra].numberOfUse < this.occur.max\n );\n }\n\n [$getNextPage]() {\n if (!this[$extra]) {\n this[$extra] = {\n numberOfUse: 1,\n pageIndex: -1,\n pageSetIndex: -1,\n };\n }\n\n if (this.relation === \"orderedOccurrence\") {\n if (this[$extra].pageIndex + 1 < this.pageArea.children.length) {\n this[$extra].pageIndex += 1;\n const pageArea = this.pageArea.children[this[$extra].pageIndex];\n return pageArea[$getNextPage]();\n }\n\n if (this[$extra].pageSetIndex + 1 < this.pageSet.children.length) {\n this[$extra].pageSetIndex += 1;\n return this.pageSet.children[this[$extra].pageSetIndex][$getNextPage]();\n }\n\n if (this[$isUsable]()) {\n this[$extra].numberOfUse += 1;\n this[$extra].pageIndex = -1;\n this[$extra].pageSetIndex = -1;\n return this[$getNextPage]();\n }\n\n const parent = this[$getParent]();\n if (parent instanceof PageSet) {\n return parent[$getNextPage]();\n }\n\n this[$cleanPage]();\n return this[$getNextPage]();\n }\n const pageNumber = this[$getTemplateRoot]()[$extra].pageNumber;\n const parity = pageNumber % 2 === 0 ? \"even\" : \"odd\";\n const position = pageNumber === 0 ? \"first\" : \"rest\";\n\n let page = this.pageArea.children.find(\n p => p.oddOrEven === parity && p.pagePosition === position\n );\n if (page) {\n return page;\n }\n\n page = this.pageArea.children.find(\n p => p.oddOrEven === \"any\" && p.pagePosition === position\n );\n if (page) {\n return page;\n }\n\n page = this.pageArea.children.find(\n p => p.oddOrEven === \"any\" && p.pagePosition === \"any\"\n );\n if (page) {\n return page;\n }\n\n return this.pageArea.children[0];\n }\n}\n\nclass Para extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"para\", /* hasChildren = */ true);\n this.hAlign = getStringOption(attributes.hAlign, [\n \"left\",\n \"center\",\n \"justify\",\n \"justifyAll\",\n \"radix\",\n \"right\",\n ]);\n this.id = attributes.id || \"\";\n this.lineHeight = attributes.lineHeight\n ? getMeasurement(attributes.lineHeight, \"0pt\")\n : \"\";\n this.marginLeft = attributes.marginLeft\n ? getMeasurement(attributes.marginLeft, \"0pt\")\n : \"\";\n this.marginRight = attributes.marginRight\n ? getMeasurement(attributes.marginRight, \"0pt\")\n : \"\";\n this.orphans = getInteger({\n data: attributes.orphans,\n defaultValue: 0,\n validate: x => x >= 0,\n });\n this.preserve = attributes.preserve || \"\";\n this.radixOffset = attributes.radixOffset\n ? getMeasurement(attributes.radixOffset, \"0pt\")\n : \"\";\n this.spaceAbove = attributes.spaceAbove\n ? getMeasurement(attributes.spaceAbove, \"0pt\")\n : \"\";\n this.spaceBelow = attributes.spaceBelow\n ? getMeasurement(attributes.spaceBelow, \"0pt\")\n : \"\";\n this.tabDefault = attributes.tabDefault\n ? getMeasurement(this.tabDefault)\n : \"\";\n this.tabStops = (attributes.tabStops || \"\")\n .trim()\n .split(/\\s+/)\n .map((x, i) => (i % 2 === 1 ? getMeasurement(x) : x));\n this.textIndent = attributes.textIndent\n ? getMeasurement(attributes.textIndent, \"0pt\")\n : \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.vAlign = getStringOption(attributes.vAlign, [\n \"top\",\n \"bottom\",\n \"middle\",\n ]);\n this.widows = getInteger({\n data: attributes.widows,\n defaultValue: 0,\n validate: x => x >= 0,\n });\n this.hyphenation = null;\n }\n\n [$toStyle]() {\n const style = toStyle(this, \"hAlign\");\n if (this.marginLeft !== \"\") {\n style.paddingLeft = measureToString(this.marginLeft);\n }\n if (this.marginRight !== \"\") {\n style.paddingight = measureToString(this.marginRight);\n }\n if (this.spaceAbove !== \"\") {\n style.paddingTop = measureToString(this.spaceAbove);\n }\n if (this.spaceBelow !== \"\") {\n style.paddingBottom = measureToString(this.spaceBelow);\n }\n if (this.textIndent !== \"\") {\n style.textIndent = measureToString(this.textIndent);\n fixTextIndent(style);\n }\n\n if (this.lineHeight > 0) {\n style.lineHeight = measureToString(this.lineHeight);\n }\n\n if (this.tabDefault !== \"\") {\n style.tabSize = measureToString(this.tabDefault);\n }\n\n if (this.tabStops.length > 0) {\n // TODO\n }\n\n if (this.hyphenatation) {\n Object.assign(style, this.hyphenatation[$toStyle]());\n }\n\n return style;\n }\n}\n\nclass PasswordEdit extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"passwordEdit\", /* hasChildren = */ true);\n this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, [\n \"auto\",\n \"off\",\n \"on\",\n ]);\n this.id = attributes.id || \"\";\n this.passwordChar = attributes.passwordChar || \"*\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.border = null;\n this.extras = null;\n this.margin = null;\n }\n}\n\nclass Pattern extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"pattern\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.type = getStringOption(attributes.type, [\n \"crossHatch\",\n \"crossDiagonal\",\n \"diagonalLeft\",\n \"diagonalRight\",\n \"horizontal\",\n \"vertical\",\n ]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.color = null;\n this.extras = null;\n }\n\n [$toStyle](startColor) {\n startColor = startColor ? startColor[$toStyle]() : \"#FFFFFF\";\n const endColor = this.color ? this.color[$toStyle]() : \"#000000\";\n const width = 5;\n const cmd = \"repeating-linear-gradient\";\n const colors = `${startColor},${startColor} ${width}px,${endColor} ${width}px,${endColor} ${\n 2 * width\n }px`;\n switch (this.type) {\n case \"crossHatch\":\n return `${cmd}(to top,${colors}) ${cmd}(to right,${colors})`;\n case \"crossDiagonal\":\n return `${cmd}(45deg,${colors}) ${cmd}(-45deg,${colors})`;\n case \"diagonalLeft\":\n return `${cmd}(45deg,${colors})`;\n case \"diagonalRight\":\n return `${cmd}(-45deg,${colors})`;\n case \"horizontal\":\n return `${cmd}(to top,${colors})`;\n case \"vertical\":\n return `${cmd}(to right,${colors})`;\n }\n\n return \"\";\n }\n}\n\nclass Picture extends StringObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"picture\");\n this.id = attributes.id || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass Proto extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"proto\", /* hasChildren = */ true);\n this.appearanceFilter = new XFAObjectArray();\n this.arc = new XFAObjectArray();\n this.area = new XFAObjectArray();\n this.assist = new XFAObjectArray();\n this.barcode = new XFAObjectArray();\n this.bindItems = new XFAObjectArray();\n this.bookend = new XFAObjectArray();\n this.boolean = new XFAObjectArray();\n this.border = new XFAObjectArray();\n this.break = new XFAObjectArray();\n this.breakAfter = new XFAObjectArray();\n this.breakBefore = new XFAObjectArray();\n this.button = new XFAObjectArray();\n this.calculate = new XFAObjectArray();\n this.caption = new XFAObjectArray();\n this.certificate = new XFAObjectArray();\n this.certificates = new XFAObjectArray();\n this.checkButton = new XFAObjectArray();\n this.choiceList = new XFAObjectArray();\n this.color = new XFAObjectArray();\n this.comb = new XFAObjectArray();\n this.connect = new XFAObjectArray();\n this.contentArea = new XFAObjectArray();\n this.corner = new XFAObjectArray();\n this.date = new XFAObjectArray();\n this.dateTime = new XFAObjectArray();\n this.dateTimeEdit = new XFAObjectArray();\n this.decimal = new XFAObjectArray();\n this.defaultUi = new XFAObjectArray();\n this.desc = new XFAObjectArray();\n this.digestMethod = new XFAObjectArray();\n this.digestMethods = new XFAObjectArray();\n this.draw = new XFAObjectArray();\n this.edge = new XFAObjectArray();\n this.encoding = new XFAObjectArray();\n this.encodings = new XFAObjectArray();\n this.encrypt = new XFAObjectArray();\n this.encryptData = new XFAObjectArray();\n this.encryption = new XFAObjectArray();\n this.encryptionMethod = new XFAObjectArray();\n this.encryptionMethods = new XFAObjectArray();\n this.event = new XFAObjectArray();\n this.exData = new XFAObjectArray();\n this.exObject = new XFAObjectArray();\n this.exclGroup = new XFAObjectArray();\n this.execute = new XFAObjectArray();\n this.extras = new XFAObjectArray();\n this.field = new XFAObjectArray();\n this.fill = new XFAObjectArray();\n this.filter = new XFAObjectArray();\n this.float = new XFAObjectArray();\n this.font = new XFAObjectArray();\n this.format = new XFAObjectArray();\n this.handler = new XFAObjectArray();\n this.hyphenation = new XFAObjectArray();\n this.image = new XFAObjectArray();\n this.imageEdit = new XFAObjectArray();\n this.integer = new XFAObjectArray();\n this.issuers = new XFAObjectArray();\n this.items = new XFAObjectArray();\n this.keep = new XFAObjectArray();\n this.keyUsage = new XFAObjectArray();\n this.line = new XFAObjectArray();\n this.linear = new XFAObjectArray();\n this.lockDocument = new XFAObjectArray();\n this.manifest = new XFAObjectArray();\n this.margin = new XFAObjectArray();\n this.mdp = new XFAObjectArray();\n this.medium = new XFAObjectArray();\n this.message = new XFAObjectArray();\n this.numericEdit = new XFAObjectArray();\n this.occur = new XFAObjectArray();\n this.oid = new XFAObjectArray();\n this.oids = new XFAObjectArray();\n this.overflow = new XFAObjectArray();\n this.pageArea = new XFAObjectArray();\n this.pageSet = new XFAObjectArray();\n this.para = new XFAObjectArray();\n this.passwordEdit = new XFAObjectArray();\n this.pattern = new XFAObjectArray();\n this.picture = new XFAObjectArray();\n this.radial = new XFAObjectArray();\n this.reason = new XFAObjectArray();\n this.reasons = new XFAObjectArray();\n this.rectangle = new XFAObjectArray();\n this.ref = new XFAObjectArray();\n this.script = new XFAObjectArray();\n this.setProperty = new XFAObjectArray();\n this.signData = new XFAObjectArray();\n this.signature = new XFAObjectArray();\n this.signing = new XFAObjectArray();\n this.solid = new XFAObjectArray();\n this.speak = new XFAObjectArray();\n this.stipple = new XFAObjectArray();\n this.subform = new XFAObjectArray();\n this.subformSet = new XFAObjectArray();\n this.subjectDN = new XFAObjectArray();\n this.subjectDNs = new XFAObjectArray();\n this.submit = new XFAObjectArray();\n this.text = new XFAObjectArray();\n this.textEdit = new XFAObjectArray();\n this.time = new XFAObjectArray();\n this.timeStamp = new XFAObjectArray();\n this.toolTip = new XFAObjectArray();\n this.traversal = new XFAObjectArray();\n this.traverse = new XFAObjectArray();\n this.ui = new XFAObjectArray();\n this.validate = new XFAObjectArray();\n this.value = new XFAObjectArray();\n this.variables = new XFAObjectArray();\n }\n}\n\nclass Radial extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"radial\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.type = getStringOption(attributes.type, [\"toEdge\", \"toCenter\"]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.color = null;\n this.extras = null;\n }\n\n [$toStyle](startColor) {\n startColor = startColor ? startColor[$toStyle]() : \"#FFFFFF\";\n const endColor = this.color ? this.color[$toStyle]() : \"#000000\";\n const colors =\n this.type === \"toEdge\"\n ? `${startColor},${endColor}`\n : `${endColor},${startColor}`;\n return `radial-gradient(circle at center, ${colors})`;\n }\n}\n\nclass Reason extends StringObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"reason\");\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass Reasons extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"reasons\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.type = getStringOption(attributes.type, [\"optional\", \"required\"]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.reason = new XFAObjectArray();\n }\n}\n\nclass Rectangle extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"rectangle\", /* hasChildren = */ true);\n this.hand = getStringOption(attributes.hand, [\"even\", \"left\", \"right\"]);\n this.id = attributes.id || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.corner = new XFAObjectArray(4);\n this.edge = new XFAObjectArray(4);\n this.fill = null;\n }\n\n [$toHTML]() {\n const edge = this.edge.children.length\n ? this.edge.children[0]\n : new Edge({});\n const edgeStyle = edge[$toStyle]();\n const style = Object.create(null);\n if (this.fill?.presence === \"visible\") {\n Object.assign(style, this.fill[$toStyle]());\n } else {\n style.fill = \"transparent\";\n }\n style.strokeWidth = measureToString(\n edge.presence === \"visible\" ? edge.thickness : 0\n );\n style.stroke = edgeStyle.color;\n\n const corner = this.corner.children.length\n ? this.corner.children[0]\n : new Corner({});\n const cornerStyle = corner[$toStyle]();\n\n const rect = {\n name: \"rect\",\n attributes: {\n xmlns: SVG_NS,\n width: \"100%\",\n height: \"100%\",\n x: 0,\n y: 0,\n rx: cornerStyle.radius,\n ry: cornerStyle.radius,\n style,\n },\n };\n\n const svg = {\n name: \"svg\",\n children: [rect],\n attributes: {\n xmlns: SVG_NS,\n style: {\n overflow: \"visible\",\n },\n width: \"100%\",\n height: \"100%\",\n },\n };\n\n const parent = this[$getParent]()[$getParent]();\n if (hasMargin(parent)) {\n return HTMLResult.success({\n name: \"div\",\n attributes: {\n style: {\n display: \"inline\",\n width: \"100%\",\n height: \"100%\",\n },\n },\n children: [svg],\n });\n }\n\n svg.attributes.style.position = \"absolute\";\n return HTMLResult.success(svg);\n }\n}\n\nclass RefElement extends StringObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"ref\");\n this.id = attributes.id || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass Script extends StringObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"script\");\n this.binding = attributes.binding || \"\";\n this.contentType = attributes.contentType || \"\";\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.runAt = getStringOption(attributes.runAt, [\n \"client\",\n \"both\",\n \"server\",\n ]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass SetProperty extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"setProperty\");\n this.connection = attributes.connection || \"\";\n this.ref = attributes.ref || \"\";\n this.target = attributes.target || \"\";\n }\n}\n\nclass SignData extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"signData\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.operation = getStringOption(attributes.operation, [\n \"sign\",\n \"clear\",\n \"verify\",\n ]);\n this.ref = attributes.ref || \"\";\n this.target = attributes.target || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.filter = null;\n this.manifest = null;\n }\n}\n\nclass Signature extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"signature\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.type = getStringOption(attributes.type, [\"PDF1.3\", \"PDF1.6\"]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.border = null;\n this.extras = null;\n this.filter = null;\n this.manifest = null;\n this.margin = null;\n }\n}\n\nclass Signing extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"signing\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.type = getStringOption(attributes.type, [\"optional\", \"required\"]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.certificate = new XFAObjectArray();\n }\n}\n\nclass Solid extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"solid\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.extras = null;\n }\n\n [$toStyle](startColor) {\n return startColor ? startColor[$toStyle]() : \"#FFFFFF\";\n }\n}\n\nclass Speak extends StringObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"speak\");\n this.disable = getInteger({\n data: attributes.disable,\n defaultValue: 0,\n validate: x => x === 1,\n });\n this.id = attributes.id || \"\";\n this.priority = getStringOption(attributes.priority, [\n \"custom\",\n \"caption\",\n \"name\",\n \"toolTip\",\n ]);\n this.rid = attributes.rid || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass Stipple extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"stipple\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.rate = getInteger({\n data: attributes.rate,\n defaultValue: 50,\n validate: x => x >= 0 && x <= 100,\n });\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.color = null;\n this.extras = null;\n }\n\n [$toStyle](bgColor) {\n const alpha = this.rate / 100;\n return Util.makeHexColor(\n Math.round(bgColor.value.r * (1 - alpha) + this.value.r * alpha),\n Math.round(bgColor.value.g * (1 - alpha) + this.value.g * alpha),\n Math.round(bgColor.value.b * (1 - alpha) + this.value.b * alpha)\n );\n }\n}\n\nclass Subform extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"subform\", /* hasChildren = */ true);\n this.access = getStringOption(attributes.access, [\n \"open\",\n \"nonInteractive\",\n \"protected\",\n \"readOnly\",\n ]);\n this.allowMacro = getInteger({\n data: attributes.allowMacro,\n defaultValue: 0,\n validate: x => x === 1,\n });\n this.anchorType = getStringOption(attributes.anchorType, [\n \"topLeft\",\n \"bottomCenter\",\n \"bottomLeft\",\n \"bottomRight\",\n \"middleCenter\",\n \"middleLeft\",\n \"middleRight\",\n \"topCenter\",\n \"topRight\",\n ]);\n this.colSpan = getInteger({\n data: attributes.colSpan,\n defaultValue: 1,\n validate: n => n >= 1 || n === -1,\n });\n this.columnWidths = (attributes.columnWidths || \"\")\n .trim()\n .split(/\\s+/)\n .map(x => (x === \"-1\" ? -1 : getMeasurement(x)));\n this.h = attributes.h ? getMeasurement(attributes.h) : \"\";\n this.hAlign = getStringOption(attributes.hAlign, [\n \"left\",\n \"center\",\n \"justify\",\n \"justifyAll\",\n \"radix\",\n \"right\",\n ]);\n this.id = attributes.id || \"\";\n this.layout = getStringOption(attributes.layout, [\n \"position\",\n \"lr-tb\",\n \"rl-row\",\n \"rl-tb\",\n \"row\",\n \"table\",\n \"tb\",\n ]);\n this.locale = attributes.locale || \"\";\n this.maxH = getMeasurement(attributes.maxH, \"0pt\");\n this.maxW = getMeasurement(attributes.maxW, \"0pt\");\n this.mergeMode = getStringOption(attributes.mergeMode, [\n \"consumeData\",\n \"matchTemplate\",\n ]);\n this.minH = getMeasurement(attributes.minH, \"0pt\");\n this.minW = getMeasurement(attributes.minW, \"0pt\");\n this.name = attributes.name || \"\";\n this.presence = getStringOption(attributes.presence, [\n \"visible\",\n \"hidden\",\n \"inactive\",\n \"invisible\",\n ]);\n this.relevant = getRelevant(attributes.relevant);\n this.restoreState = getStringOption(attributes.restoreState, [\n \"manual\",\n \"auto\",\n ]);\n this.scope = getStringOption(attributes.scope, [\"name\", \"none\"]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.w = attributes.w ? getMeasurement(attributes.w) : \"\";\n this.x = getMeasurement(attributes.x, \"0pt\");\n this.y = getMeasurement(attributes.y, \"0pt\");\n this.assist = null;\n this.bind = null;\n this.bookend = null;\n this.border = null;\n this.break = null;\n this.calculate = null;\n this.desc = null;\n this.extras = null;\n this.keep = null;\n this.margin = null;\n this.occur = null;\n this.overflow = null;\n this.pageSet = null;\n this.para = null;\n this.traversal = null;\n this.validate = null;\n this.variables = null;\n this.area = new XFAObjectArray();\n this.breakAfter = new XFAObjectArray();\n this.breakBefore = new XFAObjectArray();\n this.connect = new XFAObjectArray();\n this.draw = new XFAObjectArray();\n this.event = new XFAObjectArray();\n this.exObject = new XFAObjectArray();\n this.exclGroup = new XFAObjectArray();\n this.field = new XFAObjectArray();\n this.proto = new XFAObjectArray();\n this.setProperty = new XFAObjectArray();\n this.subform = new XFAObjectArray();\n this.subformSet = new XFAObjectArray();\n }\n\n [$getSubformParent]() {\n const parent = this[$getParent]();\n if (parent instanceof SubformSet) {\n return parent[$getSubformParent]();\n }\n return parent;\n }\n\n [$isBindable]() {\n return true;\n }\n\n [$isThereMoreWidth]() {\n return (\n (this.layout.endsWith(\"-tb\") &&\n this[$extra].attempt === 0 &&\n this[$extra].numberInLine > 0) ||\n this[$getParent]()[$isThereMoreWidth]()\n );\n }\n\n *[$getContainedChildren]() {\n // This function is overriden in order to fake that subforms under\n // this set are in fact under parent subform.\n yield* getContainedChildren(this);\n }\n\n [$flushHTML]() {\n return flushHTML(this);\n }\n\n [$addHTML](html, bbox) {\n addHTML(this, html, bbox);\n }\n\n [$getAvailableSpace]() {\n return getAvailableSpace(this);\n }\n\n [$isSplittable]() {\n // We cannot cache the result here because the contentArea\n // can change.\n const parent = this[$getSubformParent]();\n if (!parent[$isSplittable]()) {\n return false;\n }\n\n if (this[$extra]._isSplittable !== undefined) {\n return this[$extra]._isSplittable;\n }\n\n if (this.layout === \"position\" || this.layout.includes(\"row\")) {\n this[$extra]._isSplittable = false;\n return false;\n }\n\n if (this.keep && this.keep.intact !== \"none\") {\n this[$extra]._isSplittable = false;\n return false;\n }\n\n if (parent.layout?.endsWith(\"-tb\") && parent[$extra].numberInLine !== 0) {\n // If parent can fit in w=100 and there's already an element which takes\n // 90 then we've 10 for this element. Suppose this element has a tb layout\n // and 5 elements have a width of 7 and the 6th has a width of 20:\n // then this element (and all its content) must move on the next line.\n // If this element is splittable then the first 5 children will stay\n // at the end of the line: we don't want that.\n return false;\n }\n\n this[$extra]._isSplittable = true;\n\n return true;\n }\n\n [$toHTML](availableSpace) {\n setTabIndex(this);\n\n if (this.break) {\n // break element is deprecated so plug it on one of its replacement\n // breakBefore or breakAfter.\n if (this.break.after !== \"auto\" || this.break.afterTarget !== \"\") {\n const node = new BreakAfter({\n targetType: this.break.after,\n target: this.break.afterTarget,\n startNew: this.break.startNew.toString(),\n });\n node[$globalData] = this[$globalData];\n this[$appendChild](node);\n this.breakAfter.push(node);\n }\n\n if (this.break.before !== \"auto\" || this.break.beforeTarget !== \"\") {\n const node = new BreakBefore({\n targetType: this.break.before,\n target: this.break.beforeTarget,\n startNew: this.break.startNew.toString(),\n });\n node[$globalData] = this[$globalData];\n this[$appendChild](node);\n this.breakBefore.push(node);\n }\n\n if (this.break.overflowTarget !== \"\") {\n const node = new Overflow({\n target: this.break.overflowTarget,\n leader: this.break.overflowLeader,\n trailer: this.break.overflowTrailer,\n });\n node[$globalData] = this[$globalData];\n this[$appendChild](node);\n this.overflow.push(node);\n }\n\n this[$removeChild](this.break);\n this.break = null;\n }\n\n if (this.presence === \"hidden\" || this.presence === \"inactive\") {\n return HTMLResult.EMPTY;\n }\n\n if (\n this.breakBefore.children.length > 1 ||\n this.breakAfter.children.length > 1\n ) {\n // Specs are always talking about the breakBefore element\n // and it doesn't really make sense to have several ones.\n warn(\n \"XFA - Several breakBefore or breakAfter in subforms: please file a bug.\"\n );\n }\n\n if (this.breakBefore.children.length >= 1) {\n const breakBefore = this.breakBefore.children[0];\n if (handleBreak(breakBefore)) {\n return HTMLResult.breakNode(breakBefore);\n }\n }\n\n if (this[$extra]?.afterBreakAfter) {\n return HTMLResult.EMPTY;\n }\n\n // TODO: incomplete.\n fixDimensions(this);\n const children = [];\n const attributes = {\n id: this[$uid],\n class: [],\n };\n\n setAccess(this, attributes.class);\n\n if (!this[$extra]) {\n this[$extra] = Object.create(null);\n }\n\n Object.assign(this[$extra], {\n children,\n line: null,\n attributes,\n attempt: 0,\n numberInLine: 0,\n availableSpace: {\n width: Math.min(this.w || Infinity, availableSpace.width),\n height: Math.min(this.h || Infinity, availableSpace.height),\n },\n width: 0,\n height: 0,\n prevHeight: 0,\n currentWidth: 0,\n });\n\n const root = this[$getTemplateRoot]();\n const savedNoLayoutFailure = root[$extra].noLayoutFailure;\n\n const isSplittable = this[$isSplittable]();\n if (!isSplittable) {\n setFirstUnsplittable(this);\n }\n\n if (!checkDimensions(this, availableSpace)) {\n return HTMLResult.FAILURE;\n }\n\n const filter = new Set([\n \"area\",\n \"draw\",\n \"exclGroup\",\n \"field\",\n \"subform\",\n \"subformSet\",\n ]);\n\n if (this.layout.includes(\"row\")) {\n const columnWidths = this[$getSubformParent]().columnWidths;\n if (Array.isArray(columnWidths) && columnWidths.length > 0) {\n this[$extra].columnWidths = columnWidths;\n this[$extra].currentColumn = 0;\n }\n }\n\n const style = toStyle(\n this,\n \"anchorType\",\n \"dimensions\",\n \"position\",\n \"presence\",\n \"border\",\n \"margin\",\n \"hAlign\"\n );\n const classNames = [\"xfaSubform\"];\n const cl = layoutClass(this);\n if (cl) {\n classNames.push(cl);\n }\n\n attributes.style = style;\n attributes.class = classNames;\n\n if (this.name) {\n attributes.xfaName = this.name;\n }\n\n if (this.overflow) {\n const overflowExtra = this.overflow[$getExtra]();\n if (overflowExtra.addLeader) {\n overflowExtra.addLeader = false;\n handleOverflow(this, overflowExtra.leader, availableSpace);\n }\n }\n\n this[$pushPara]();\n const isLrTb = this.layout === \"lr-tb\" || this.layout === \"rl-tb\";\n const maxRun = isLrTb ? MAX_ATTEMPTS_FOR_LRTB_LAYOUT : 1;\n for (; this[$extra].attempt < maxRun; this[$extra].attempt++) {\n if (isLrTb && this[$extra].attempt === MAX_ATTEMPTS_FOR_LRTB_LAYOUT - 1) {\n // If the layout is lr-tb then having attempt equals to\n // MAX_ATTEMPTS_FOR_LRTB_LAYOUT-1 means that we're trying to layout\n // on the next line so this on is empty.\n this[$extra].numberInLine = 0;\n }\n const result = this[$childrenToHTML]({\n filter,\n include: true,\n });\n if (result.success) {\n break;\n }\n if (result.isBreak()) {\n this[$popPara]();\n return result;\n }\n if (\n isLrTb &&\n this[$extra].attempt === 0 &&\n this[$extra].numberInLine === 0 &&\n !root[$extra].noLayoutFailure\n ) {\n // We're failing to put the first element on the line so no\n // need to test on the next line.\n // The goal is not only to avoid some useless checks but to avoid\n // bugs too: if a descendant managed to put a node and failed\n // on the next one, going to the next step here will imply to\n // visit the descendant again, clear [$extra].children and restart\n // on the failing node, consequently the first node just disappears\n // because it has never been flushed.\n this[$extra].attempt = maxRun;\n break;\n }\n }\n\n this[$popPara]();\n if (!isSplittable) {\n unsetFirstUnsplittable(this);\n }\n root[$extra].noLayoutFailure = savedNoLayoutFailure;\n\n if (this[$extra].attempt === maxRun) {\n if (this.overflow) {\n this[$getTemplateRoot]()[$extra].overflowNode = this.overflow;\n }\n\n if (!isSplittable) {\n // Since a new try will happen in a new container with maybe\n // new dimensions, we invalidate already layed out components.\n delete this[$extra];\n }\n return HTMLResult.FAILURE;\n }\n\n if (this.overflow) {\n const overflowExtra = this.overflow[$getExtra]();\n if (overflowExtra.addTrailer) {\n overflowExtra.addTrailer = false;\n handleOverflow(this, overflowExtra.trailer, availableSpace);\n }\n }\n\n let marginH = 0;\n let marginV = 0;\n if (this.margin) {\n marginH = this.margin.leftInset + this.margin.rightInset;\n marginV = this.margin.topInset + this.margin.bottomInset;\n }\n\n const width = Math.max(this[$extra].width + marginH, this.w || 0);\n const height = Math.max(this[$extra].height + marginV, this.h || 0);\n const bbox = [this.x, this.y, width, height];\n\n if (this.w === \"\") {\n style.width = measureToString(width);\n }\n if (this.h === \"\") {\n style.height = measureToString(height);\n }\n\n if (\n (style.width === \"0px\" || style.height === \"0px\") &&\n children.length === 0\n ) {\n return HTMLResult.EMPTY;\n }\n\n const html = {\n name: \"div\",\n attributes,\n children,\n };\n\n applyAssist(this, attributes);\n\n const result = HTMLResult.success(createWrapper(this, html), bbox);\n\n if (this.breakAfter.children.length >= 1) {\n const breakAfter = this.breakAfter.children[0];\n if (handleBreak(breakAfter)) {\n this[$extra].afterBreakAfter = result;\n return HTMLResult.breakNode(breakAfter);\n }\n }\n\n delete this[$extra];\n\n return result;\n }\n}\n\nclass SubformSet extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"subformSet\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.relation = getStringOption(attributes.relation, [\n \"ordered\",\n \"choice\",\n \"unordered\",\n ]);\n this.relevant = getRelevant(attributes.relevant);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.bookend = null;\n this.break = null;\n this.desc = null;\n this.extras = null;\n this.occur = null;\n this.overflow = null;\n this.breakAfter = new XFAObjectArray();\n this.breakBefore = new XFAObjectArray();\n this.subform = new XFAObjectArray();\n this.subformSet = new XFAObjectArray();\n\n // TODO: need to handle break stuff and relation.\n }\n\n *[$getContainedChildren]() {\n // This function is overriden in order to fake that subforms under\n // this set are in fact under parent subform.\n yield* getContainedChildren(this);\n }\n\n [$getSubformParent]() {\n let parent = this[$getParent]();\n while (!(parent instanceof Subform)) {\n parent = parent[$getParent]();\n }\n return parent;\n }\n\n [$isBindable]() {\n return true;\n }\n}\n\nclass SubjectDN extends ContentObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"subjectDN\");\n this.delimiter = attributes.delimiter || \",\";\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n\n [$finalize]() {\n this[$content] = new Map(\n this[$content].split(this.delimiter).map(kv => {\n kv = kv.split(\"=\", 2);\n kv[0] = kv[0].trim();\n return kv;\n })\n );\n }\n}\n\nclass SubjectDNs extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"subjectDNs\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.type = getStringOption(attributes.type, [\"optional\", \"required\"]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.subjectDN = new XFAObjectArray();\n }\n}\n\nclass Submit extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"submit\", /* hasChildren = */ true);\n this.embedPDF = getInteger({\n data: attributes.embedPDF,\n defaultValue: 0,\n validate: x => x === 1,\n });\n this.format = getStringOption(attributes.format, [\n \"xdp\",\n \"formdata\",\n \"pdf\",\n \"urlencoded\",\n \"xfd\",\n \"xml\",\n ]);\n this.id = attributes.id || \"\";\n this.target = attributes.target || \"\";\n this.textEncoding = getKeyword({\n data: attributes.textEncoding\n ? attributes.textEncoding.toLowerCase()\n : \"\",\n defaultValue: \"\",\n validate: k =>\n [\n \"utf-8\",\n \"big-five\",\n \"fontspecific\",\n \"gbk\",\n \"gb-18030\",\n \"gb-2312\",\n \"ksc-5601\",\n \"none\",\n \"shift-jis\",\n \"ucs-2\",\n \"utf-16\",\n ].includes(k) || k.match(/iso-8859-\\d{2}/),\n });\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.xdpContent = attributes.xdpContent || \"\";\n this.encrypt = null;\n this.encryptData = new XFAObjectArray();\n this.signData = new XFAObjectArray();\n }\n}\n\nclass Template extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"template\", /* hasChildren = */ true);\n this.baseProfile = getStringOption(attributes.baseProfile, [\n \"full\",\n \"interactiveForms\",\n ]);\n this.extras = null;\n\n // Spec is unclear:\n // A container element that describes a single subform capable of\n // enclosing other containers.\n // Can we have more than one subform ?\n this.subform = new XFAObjectArray();\n }\n\n [$finalize]() {\n if (this.subform.children.length === 0) {\n warn(\"XFA - No subforms in template node.\");\n }\n if (this.subform.children.length >= 2) {\n warn(\"XFA - Several subforms in template node: please file a bug.\");\n }\n this[$tabIndex] = DEFAULT_TAB_INDEX;\n }\n\n [$isSplittable]() {\n return true;\n }\n\n [$searchNode](expr, container) {\n if (expr.startsWith(\"#\")) {\n // This is an id.\n return [this[$ids].get(expr.slice(1))];\n }\n return searchNode(this, container, expr, true, true);\n }\n\n /**\n * This function is a generator because the conversion into\n * pages is done asynchronously and we want to save the state\n * of the function where we were in the previous iteration.\n */\n *[$toPages]() {\n if (!this.subform.children.length) {\n return HTMLResult.success({\n name: \"div\",\n children: [],\n });\n }\n this[$extra] = {\n overflowNode: null,\n firstUnsplittable: null,\n currentContentArea: null,\n currentPageArea: null,\n noLayoutFailure: false,\n pageNumber: 1,\n pagePosition: \"first\",\n oddOrEven: \"odd\",\n blankOrNotBlank: \"nonBlank\",\n paraStack: [],\n };\n\n const root = this.subform.children[0];\n root.pageSet[$cleanPage]();\n\n const pageAreas = root.pageSet.pageArea.children;\n const mainHtml = {\n name: \"div\",\n children: [],\n };\n\n let pageArea = null;\n let breakBefore = null;\n let breakBeforeTarget = null;\n if (root.breakBefore.children.length >= 1) {\n breakBefore = root.breakBefore.children[0];\n breakBeforeTarget = breakBefore.target;\n } else if (\n root.subform.children.length >= 1 &&\n root.subform.children[0].breakBefore.children.length >= 1\n ) {\n breakBefore = root.subform.children[0].breakBefore.children[0];\n breakBeforeTarget = breakBefore.target;\n } else if (root.break?.beforeTarget) {\n breakBefore = root.break;\n breakBeforeTarget = breakBefore.beforeTarget;\n } else if (\n root.subform.children.length >= 1 &&\n root.subform.children[0].break?.beforeTarget\n ) {\n breakBefore = root.subform.children[0].break;\n breakBeforeTarget = breakBefore.beforeTarget;\n }\n\n if (breakBefore) {\n const target = this[$searchNode](\n breakBeforeTarget,\n breakBefore[$getParent]()\n );\n if (target instanceof PageArea) {\n pageArea = target;\n // Consume breakBefore.\n breakBefore[$extra] = {};\n }\n }\n\n if (!pageArea) {\n pageArea = pageAreas[0];\n }\n\n pageArea[$extra] = {\n numberOfUse: 1,\n };\n\n const pageAreaParent = pageArea[$getParent]();\n pageAreaParent[$extra] = {\n numberOfUse: 1,\n pageIndex: pageAreaParent.pageArea.children.indexOf(pageArea),\n pageSetIndex: 0,\n };\n\n let targetPageArea;\n let leader = null;\n let trailer = null;\n let hasSomething = true;\n let hasSomethingCounter = 0;\n let startIndex = 0;\n\n while (true) {\n if (!hasSomething) {\n mainHtml.children.pop();\n // Nothing has been added in the previous page\n if (++hasSomethingCounter === MAX_EMPTY_PAGES) {\n warn(\"XFA - Something goes wrong: please file a bug.\");\n return mainHtml;\n }\n } else {\n hasSomethingCounter = 0;\n }\n\n targetPageArea = null;\n this[$extra].currentPageArea = pageArea;\n const page = pageArea[$toHTML]().html;\n mainHtml.children.push(page);\n\n if (leader) {\n this[$extra].noLayoutFailure = true;\n page.children.push(leader[$toHTML](pageArea[$extra].space).html);\n leader = null;\n }\n\n if (trailer) {\n this[$extra].noLayoutFailure = true;\n page.children.push(trailer[$toHTML](pageArea[$extra].space).html);\n trailer = null;\n }\n\n const contentAreas = pageArea.contentArea.children;\n const htmlContentAreas = page.children.filter(node =>\n node.attributes.class.includes(\"xfaContentarea\")\n );\n\n hasSomething = false;\n this[$extra].firstUnsplittable = null;\n this[$extra].noLayoutFailure = false;\n\n const flush = index => {\n const html = root[$flushHTML]();\n if (html) {\n hasSomething ||= html.children?.length > 0;\n htmlContentAreas[index].children.push(html);\n }\n };\n\n for (let i = startIndex, ii = contentAreas.length; i < ii; i++) {\n const contentArea = (this[$extra].currentContentArea = contentAreas[i]);\n const space = { width: contentArea.w, height: contentArea.h };\n startIndex = 0;\n\n if (leader) {\n htmlContentAreas[i].children.push(leader[$toHTML](space).html);\n leader = null;\n }\n\n if (trailer) {\n htmlContentAreas[i].children.push(trailer[$toHTML](space).html);\n trailer = null;\n }\n\n const html = root[$toHTML](space);\n if (html.success) {\n if (html.html) {\n hasSomething ||= html.html.children?.length > 0;\n htmlContentAreas[i].children.push(html.html);\n } else if (!hasSomething && mainHtml.children.length > 1) {\n mainHtml.children.pop();\n }\n return mainHtml;\n }\n\n if (html.isBreak()) {\n const node = html.breakNode;\n flush(i);\n\n if (node.targetType === \"auto\") {\n continue;\n }\n\n if (node.leader) {\n leader = this[$searchNode](node.leader, node[$getParent]());\n leader = leader ? leader[0] : null;\n }\n\n if (node.trailer) {\n trailer = this[$searchNode](node.trailer, node[$getParent]());\n trailer = trailer ? trailer[0] : null;\n }\n\n if (node.targetType === \"pageArea\") {\n targetPageArea = node[$extra].target;\n i = Infinity;\n } else if (!node[$extra].target) {\n // We stay on the same page.\n i = node[$extra].index;\n } else {\n targetPageArea = node[$extra].target;\n startIndex = node[$extra].index + 1;\n i = Infinity;\n }\n\n continue;\n }\n\n if (this[$extra].overflowNode) {\n const node = this[$extra].overflowNode;\n this[$extra].overflowNode = null;\n\n const overflowExtra = node[$getExtra]();\n const target = overflowExtra.target;\n overflowExtra.addLeader = overflowExtra.leader !== null;\n overflowExtra.addTrailer = overflowExtra.trailer !== null;\n\n flush(i);\n\n const currentIndex = i;\n\n i = Infinity;\n if (target instanceof PageArea) {\n // We must stop the contentAreas filling and go to the next page.\n targetPageArea = target;\n } else if (target instanceof ContentArea) {\n const index = contentAreas.indexOf(target);\n if (index !== -1) {\n if (index > currentIndex) {\n // In the next loop iteration `i` will be incremented, note the\n // `continue` just below, hence we need to subtract one here.\n i = index - 1;\n } else {\n // The targetted contentArea has already been filled\n // so create a new page.\n startIndex = index;\n }\n } else {\n targetPageArea = target[$getParent]();\n startIndex = targetPageArea.contentArea.children.indexOf(target);\n }\n }\n continue;\n }\n\n flush(i);\n }\n\n this[$extra].pageNumber += 1;\n if (targetPageArea) {\n if (targetPageArea[$isUsable]()) {\n targetPageArea[$extra].numberOfUse += 1;\n } else {\n targetPageArea = null;\n }\n }\n pageArea = targetPageArea || pageArea[$getNextPage]();\n yield null;\n }\n }\n}\n\nclass Text extends ContentObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"text\");\n this.id = attributes.id || \"\";\n this.maxChars = getInteger({\n data: attributes.maxChars,\n defaultValue: 0,\n validate: x => x >= 0,\n });\n this.name = attributes.name || \"\";\n this.rid = attributes.rid || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n\n [$acceptWhitespace]() {\n return true;\n }\n\n [$onChild](child) {\n if (child[$namespaceId] === NamespaceIds.xhtml.id) {\n this[$content] = child;\n return true;\n }\n warn(`XFA - Invalid content in Text: ${child[$nodeName]}.`);\n return false;\n }\n\n [$onText](str) {\n if (this[$content] instanceof XFAObject) {\n return;\n }\n super[$onText](str);\n }\n\n [$finalize]() {\n if (typeof this[$content] === \"string\") {\n this[$content] = this[$content].replaceAll(\"\\r\\n\", \"\\n\");\n }\n }\n\n [$getExtra]() {\n if (typeof this[$content] === \"string\") {\n return this[$content]\n .split(/[\\u2029\\u2028\\n]/)\n .reduce((acc, line) => {\n if (line) {\n acc.push(line);\n }\n return acc;\n }, [])\n .join(\"\\n\");\n }\n return this[$content][$text]();\n }\n\n [$toHTML](availableSpace) {\n if (typeof this[$content] === \"string\") {\n // \\u2028 is a line separator.\n // \\u2029 is a paragraph separator.\n const html = valueToHtml(this[$content]).html;\n\n if (this[$content].includes(\"\\u2029\")) {\n // We've plain text containing a paragraph separator\n // so convert it into a set of <p>.\n html.name = \"div\";\n html.children = [];\n this[$content]\n .split(\"\\u2029\")\n .map(para =>\n // Convert a paragraph into a set of <span> (for lines)\n // separated by <br>.\n para.split(/[\\u2028\\n]/).reduce((acc, line) => {\n acc.push(\n {\n name: \"span\",\n value: line,\n },\n {\n name: \"br\",\n }\n );\n return acc;\n }, [])\n )\n .forEach(lines => {\n html.children.push({\n name: \"p\",\n children: lines,\n });\n });\n } else if (/[\\u2028\\n]/.test(this[$content])) {\n html.name = \"div\";\n html.children = [];\n // Convert plain text into a set of <span> (for lines)\n // separated by <br>.\n this[$content].split(/[\\u2028\\n]/).forEach(line => {\n html.children.push(\n {\n name: \"span\",\n value: line,\n },\n {\n name: \"br\",\n }\n );\n });\n }\n\n return HTMLResult.success(html);\n }\n\n return this[$content][$toHTML](availableSpace);\n }\n}\n\nclass TextEdit extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"textEdit\", /* hasChildren = */ true);\n this.allowRichText = getInteger({\n data: attributes.allowRichText,\n defaultValue: 0,\n validate: x => x === 1,\n });\n this.hScrollPolicy = getStringOption(attributes.hScrollPolicy, [\n \"auto\",\n \"off\",\n \"on\",\n ]);\n this.id = attributes.id || \"\";\n this.multiLine = getInteger({\n data: attributes.multiLine,\n defaultValue: \"\",\n validate: x => x === 0 || x === 1,\n });\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.vScrollPolicy = getStringOption(attributes.vScrollPolicy, [\n \"auto\",\n \"off\",\n \"on\",\n ]);\n this.border = null;\n this.comb = null;\n this.extras = null;\n this.margin = null;\n }\n\n [$toHTML](availableSpace) {\n // TODO: incomplete.\n const style = toStyle(this, \"border\", \"font\", \"margin\");\n let html;\n const field = this[$getParent]()[$getParent]();\n if (this.multiLine === \"\") {\n this.multiLine = field instanceof Draw ? 1 : 0;\n }\n if (this.multiLine === 1) {\n html = {\n name: \"textarea\",\n attributes: {\n dataId: field[$data]?.[$uid] || field[$uid],\n fieldId: field[$uid],\n class: [\"xfaTextfield\"],\n style,\n \"aria-label\": ariaLabel(field),\n \"aria-required\": false,\n },\n };\n } else {\n html = {\n name: \"input\",\n attributes: {\n type: \"text\",\n dataId: field[$data]?.[$uid] || field[$uid],\n fieldId: field[$uid],\n class: [\"xfaTextfield\"],\n style,\n \"aria-label\": ariaLabel(field),\n \"aria-required\": false,\n },\n };\n }\n\n if (isRequired(field)) {\n html.attributes[\"aria-required\"] = true;\n html.attributes.required = true;\n }\n\n return HTMLResult.success({\n name: \"label\",\n attributes: {\n class: [\"xfaLabel\"],\n },\n children: [html],\n });\n }\n}\n\nclass Time extends StringObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"time\");\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n\n [$finalize]() {\n // TODO: need to handle the string as a time and not as a date.\n const date = this[$content].trim();\n this[$content] = date ? new Date(date) : null;\n }\n\n [$toHTML](availableSpace) {\n return valueToHtml(this[$content] ? this[$content].toString() : \"\");\n }\n}\n\nclass TimeStamp extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"timeStamp\");\n this.id = attributes.id || \"\";\n this.server = attributes.server || \"\";\n this.type = getStringOption(attributes.type, [\"optional\", \"required\"]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass ToolTip extends StringObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"toolTip\");\n this.id = attributes.id || \"\";\n this.rid = attributes.rid || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass Traversal extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"traversal\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.extras = null;\n this.traverse = new XFAObjectArray();\n }\n}\n\nclass Traverse extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"traverse\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.operation = getStringOption(attributes.operation, [\n \"next\",\n \"back\",\n \"down\",\n \"first\",\n \"left\",\n \"right\",\n \"up\",\n ]);\n this.ref = attributes.ref || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.extras = null;\n this.script = null;\n }\n\n get name() {\n // SOM expression: see page 94\n return this.operation;\n }\n\n [$isTransparent]() {\n return false;\n }\n}\n\nclass Ui extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"ui\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.extras = null;\n this.picture = null;\n\n // One-of properties\n this.barcode = null;\n this.button = null;\n this.checkButton = null;\n this.choiceList = null;\n this.dateTimeEdit = null;\n this.defaultUi = null;\n this.imageEdit = null;\n this.numericEdit = null;\n this.passwordEdit = null;\n this.signature = null;\n this.textEdit = null;\n }\n\n [$getExtra]() {\n if (this[$extra] === undefined) {\n for (const name of Object.getOwnPropertyNames(this)) {\n if (name === \"extras\" || name === \"picture\") {\n continue;\n }\n const obj = this[name];\n if (!(obj instanceof XFAObject)) {\n continue;\n }\n\n this[$extra] = obj;\n return obj;\n }\n this[$extra] = null;\n }\n return this[$extra];\n }\n\n [$toHTML](availableSpace) {\n // TODO: picture.\n const obj = this[$getExtra]();\n if (obj) {\n return obj[$toHTML](availableSpace);\n }\n return HTMLResult.EMPTY;\n }\n}\n\nclass Validate extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"validate\", /* hasChildren = */ true);\n this.formatTest = getStringOption(attributes.formatTest, [\n \"warning\",\n \"disabled\",\n \"error\",\n ]);\n this.id = attributes.id || \"\";\n this.nullTest = getStringOption(attributes.nullTest, [\n \"disabled\",\n \"error\",\n \"warning\",\n ]);\n this.scriptTest = getStringOption(attributes.scriptTest, [\n \"error\",\n \"disabled\",\n \"warning\",\n ]);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.extras = null;\n this.message = null;\n this.picture = null;\n this.script = null;\n }\n}\n\nclass Value extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"value\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.override = getInteger({\n data: attributes.override,\n defaultValue: 0,\n validate: x => x === 1,\n });\n this.relevant = getRelevant(attributes.relevant);\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n\n // One-of properties\n this.arc = null;\n this.boolean = null;\n this.date = null;\n this.dateTime = null;\n this.decimal = null;\n this.exData = null;\n this.float = null;\n this.image = null;\n this.integer = null;\n this.line = null;\n this.rectangle = null;\n this.text = null;\n this.time = null;\n }\n\n [$setValue](value) {\n const parent = this[$getParent]();\n if (parent instanceof Field) {\n if (parent.ui?.imageEdit) {\n if (!this.image) {\n this.image = new Image({});\n this[$appendChild](this.image);\n }\n this.image[$content] = value[$content];\n return;\n }\n }\n\n const valueName = value[$nodeName];\n if (this[valueName] !== null) {\n this[valueName][$content] = value[$content];\n return;\n }\n\n // Reset all the properties.\n for (const name of Object.getOwnPropertyNames(this)) {\n const obj = this[name];\n if (obj instanceof XFAObject) {\n this[name] = null;\n this[$removeChild](obj);\n }\n }\n\n this[value[$nodeName]] = value;\n this[$appendChild](value);\n }\n\n [$text]() {\n if (this.exData) {\n if (typeof this.exData[$content] === \"string\") {\n return this.exData[$content].trim();\n }\n return this.exData[$content][$text]().trim();\n }\n for (const name of Object.getOwnPropertyNames(this)) {\n if (name === \"image\") {\n continue;\n }\n const obj = this[name];\n if (obj instanceof XFAObject) {\n return (obj[$content] || \"\").toString().trim();\n }\n }\n return null;\n }\n\n [$toHTML](availableSpace) {\n for (const name of Object.getOwnPropertyNames(this)) {\n const obj = this[name];\n if (!(obj instanceof XFAObject)) {\n continue;\n }\n\n return obj[$toHTML](availableSpace);\n }\n\n return HTMLResult.EMPTY;\n }\n}\n\nclass Variables extends XFAObject {\n constructor(attributes) {\n super(TEMPLATE_NS_ID, \"variables\", /* hasChildren = */ true);\n this.id = attributes.id || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n this.boolean = new XFAObjectArray();\n this.date = new XFAObjectArray();\n this.dateTime = new XFAObjectArray();\n this.decimal = new XFAObjectArray();\n this.exData = new XFAObjectArray();\n this.float = new XFAObjectArray();\n this.image = new XFAObjectArray();\n this.integer = new XFAObjectArray();\n this.manifest = new XFAObjectArray();\n this.script = new XFAObjectArray();\n this.text = new XFAObjectArray();\n this.time = new XFAObjectArray();\n }\n\n [$isTransparent]() {\n return true;\n }\n}\n\nclass TemplateNamespace {\n static [$buildXFAObject](name, attributes) {\n if (TemplateNamespace.hasOwnProperty(name)) {\n const node = TemplateNamespace[name](attributes);\n node[$setSetAttributes](attributes);\n return node;\n }\n return undefined;\n }\n\n static appearanceFilter(attrs) {\n return new AppearanceFilter(attrs);\n }\n\n static arc(attrs) {\n return new Arc(attrs);\n }\n\n static area(attrs) {\n return new Area(attrs);\n }\n\n static assist(attrs) {\n return new Assist(attrs);\n }\n\n static barcode(attrs) {\n return new Barcode(attrs);\n }\n\n static bind(attrs) {\n return new Bind(attrs);\n }\n\n static bindItems(attrs) {\n return new BindItems(attrs);\n }\n\n static bookend(attrs) {\n return new Bookend(attrs);\n }\n\n static boolean(attrs) {\n return new BooleanElement(attrs);\n }\n\n static border(attrs) {\n return new Border(attrs);\n }\n\n static break(attrs) {\n return new Break(attrs);\n }\n\n static breakAfter(attrs) {\n return new BreakAfter(attrs);\n }\n\n static breakBefore(attrs) {\n return new BreakBefore(attrs);\n }\n\n static button(attrs) {\n return new Button(attrs);\n }\n\n static calculate(attrs) {\n return new Calculate(attrs);\n }\n\n static caption(attrs) {\n return new Caption(attrs);\n }\n\n static certificate(attrs) {\n return new Certificate(attrs);\n }\n\n static certificates(attrs) {\n return new Certificates(attrs);\n }\n\n static checkButton(attrs) {\n return new CheckButton(attrs);\n }\n\n static choiceList(attrs) {\n return new ChoiceList(attrs);\n }\n\n static color(attrs) {\n return new Color(attrs);\n }\n\n static comb(attrs) {\n return new Comb(attrs);\n }\n\n static connect(attrs) {\n return new Connect(attrs);\n }\n\n static contentArea(attrs) {\n return new ContentArea(attrs);\n }\n\n static corner(attrs) {\n return new Corner(attrs);\n }\n\n static date(attrs) {\n return new DateElement(attrs);\n }\n\n static dateTime(attrs) {\n return new DateTime(attrs);\n }\n\n static dateTimeEdit(attrs) {\n return new DateTimeEdit(attrs);\n }\n\n static decimal(attrs) {\n return new Decimal(attrs);\n }\n\n static defaultUi(attrs) {\n return new DefaultUi(attrs);\n }\n\n static desc(attrs) {\n return new Desc(attrs);\n }\n\n static digestMethod(attrs) {\n return new DigestMethod(attrs);\n }\n\n static digestMethods(attrs) {\n return new DigestMethods(attrs);\n }\n\n static draw(attrs) {\n return new Draw(attrs);\n }\n\n static edge(attrs) {\n return new Edge(attrs);\n }\n\n static encoding(attrs) {\n return new Encoding(attrs);\n }\n\n static encodings(attrs) {\n return new Encodings(attrs);\n }\n\n static encrypt(attrs) {\n return new Encrypt(attrs);\n }\n\n static encryptData(attrs) {\n return new EncryptData(attrs);\n }\n\n static encryption(attrs) {\n return new Encryption(attrs);\n }\n\n static encryptionMethod(attrs) {\n return new EncryptionMethod(attrs);\n }\n\n static encryptionMethods(attrs) {\n return new EncryptionMethods(attrs);\n }\n\n static event(attrs) {\n return new Event(attrs);\n }\n\n static exData(attrs) {\n return new ExData(attrs);\n }\n\n static exObject(attrs) {\n return new ExObject(attrs);\n }\n\n static exclGroup(attrs) {\n return new ExclGroup(attrs);\n }\n\n static execute(attrs) {\n return new Execute(attrs);\n }\n\n static extras(attrs) {\n return new Extras(attrs);\n }\n\n static field(attrs) {\n return new Field(attrs);\n }\n\n static fill(attrs) {\n return new Fill(attrs);\n }\n\n static filter(attrs) {\n return new Filter(attrs);\n }\n\n static float(attrs) {\n return new Float(attrs);\n }\n\n static font(attrs) {\n return new Font(attrs);\n }\n\n static format(attrs) {\n return new Format(attrs);\n }\n\n static handler(attrs) {\n return new Handler(attrs);\n }\n\n static hyphenation(attrs) {\n return new Hyphenation(attrs);\n }\n\n static image(attrs) {\n return new Image(attrs);\n }\n\n static imageEdit(attrs) {\n return new ImageEdit(attrs);\n }\n\n static integer(attrs) {\n return new Integer(attrs);\n }\n\n static issuers(attrs) {\n return new Issuers(attrs);\n }\n\n static items(attrs) {\n return new Items(attrs);\n }\n\n static keep(attrs) {\n return new Keep(attrs);\n }\n\n static keyUsage(attrs) {\n return new KeyUsage(attrs);\n }\n\n static line(attrs) {\n return new Line(attrs);\n }\n\n static linear(attrs) {\n return new Linear(attrs);\n }\n\n static lockDocument(attrs) {\n return new LockDocument(attrs);\n }\n\n static manifest(attrs) {\n return new Manifest(attrs);\n }\n\n static margin(attrs) {\n return new Margin(attrs);\n }\n\n static mdp(attrs) {\n return new Mdp(attrs);\n }\n\n static medium(attrs) {\n return new Medium(attrs);\n }\n\n static message(attrs) {\n return new Message(attrs);\n }\n\n static numericEdit(attrs) {\n return new NumericEdit(attrs);\n }\n\n static occur(attrs) {\n return new Occur(attrs);\n }\n\n static oid(attrs) {\n return new Oid(attrs);\n }\n\n static oids(attrs) {\n return new Oids(attrs);\n }\n\n static overflow(attrs) {\n return new Overflow(attrs);\n }\n\n static pageArea(attrs) {\n return new PageArea(attrs);\n }\n\n static pageSet(attrs) {\n return new PageSet(attrs);\n }\n\n static para(attrs) {\n return new Para(attrs);\n }\n\n static passwordEdit(attrs) {\n return new PasswordEdit(attrs);\n }\n\n static pattern(attrs) {\n return new Pattern(attrs);\n }\n\n static picture(attrs) {\n return new Picture(attrs);\n }\n\n static proto(attrs) {\n return new Proto(attrs);\n }\n\n static radial(attrs) {\n return new Radial(attrs);\n }\n\n static reason(attrs) {\n return new Reason(attrs);\n }\n\n static reasons(attrs) {\n return new Reasons(attrs);\n }\n\n static rectangle(attrs) {\n return new Rectangle(attrs);\n }\n\n static ref(attrs) {\n return new RefElement(attrs);\n }\n\n static script(attrs) {\n return new Script(attrs);\n }\n\n static setProperty(attrs) {\n return new SetProperty(attrs);\n }\n\n static signData(attrs) {\n return new SignData(attrs);\n }\n\n static signature(attrs) {\n return new Signature(attrs);\n }\n\n static signing(attrs) {\n return new Signing(attrs);\n }\n\n static solid(attrs) {\n return new Solid(attrs);\n }\n\n static speak(attrs) {\n return new Speak(attrs);\n }\n\n static stipple(attrs) {\n return new Stipple(attrs);\n }\n\n static subform(attrs) {\n return new Subform(attrs);\n }\n\n static subformSet(attrs) {\n return new SubformSet(attrs);\n }\n\n static subjectDN(attrs) {\n return new SubjectDN(attrs);\n }\n\n static subjectDNs(attrs) {\n return new SubjectDNs(attrs);\n }\n\n static submit(attrs) {\n return new Submit(attrs);\n }\n\n static template(attrs) {\n return new Template(attrs);\n }\n\n static text(attrs) {\n return new Text(attrs);\n }\n\n static textEdit(attrs) {\n return new TextEdit(attrs);\n }\n\n static time(attrs) {\n return new Time(attrs);\n }\n\n static timeStamp(attrs) {\n return new TimeStamp(attrs);\n }\n\n static toolTip(attrs) {\n return new ToolTip(attrs);\n }\n\n static traversal(attrs) {\n return new Traversal(attrs);\n }\n\n static traverse(attrs) {\n return new Traverse(attrs);\n }\n\n static ui(attrs) {\n return new Ui(attrs);\n }\n\n static validate(attrs) {\n return new Validate(attrs);\n }\n\n static value(attrs) {\n return new Value(attrs);\n }\n\n static variables(attrs) {\n return new Variables(attrs);\n }\n}\n\nexport {\n BindItems,\n Field,\n Items,\n SetProperty,\n Template,\n TemplateNamespace,\n Text,\n Value,\n};\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n $appendChild,\n $clone,\n $consumed,\n $content,\n $data,\n $finalize,\n $getAttributeIt,\n $getChildren,\n $getDataValue,\n $getParent,\n $getRealChildrenByNameIt,\n $hasSettableValue,\n $indexOf,\n $insertAt,\n $isBindable,\n $isDataValue,\n $isDescendent,\n $namespaceId,\n $nodeName,\n $removeChild,\n $setValue,\n $text,\n} from \"./symbol_utils.js\";\nimport { BindItems, Field, Items, SetProperty, Text } from \"./template.js\";\nimport { createDataNode, searchNode } from \"./som.js\";\nimport { XFAAttribute, XFAObjectArray, XmlObject } from \"./xfa_object.js\";\nimport { NamespaceIds } from \"./namespaces.js\";\nimport { warn } from \"../../shared/util.js\";\n\nconst NS_DATASETS = NamespaceIds.datasets.id;\n\nfunction createText(content) {\n const node = new Text({});\n node[$content] = content;\n return node;\n}\n\nclass Binder {\n constructor(root) {\n this.root = root;\n this.datasets = root.datasets;\n this.data =\n root.datasets?.data || new XmlObject(NamespaceIds.datasets.id, \"data\");\n this.emptyMerge = this.data[$getChildren]().length === 0;\n\n this.root.form = this.form = root.template[$clone]();\n }\n\n _isConsumeData() {\n return !this.emptyMerge && this._mergeMode;\n }\n\n _isMatchTemplate() {\n return !this._isConsumeData();\n }\n\n bind() {\n this._bindElement(this.form, this.data);\n return this.form;\n }\n\n getData() {\n return this.data;\n }\n\n _bindValue(formNode, data, picture) {\n // Nodes must have the same \"type\": container or value.\n // Here we make the link between form node and\n // data node (through $data property): we'll use it\n // to save form data.\n\n formNode[$data] = data;\n if (formNode[$hasSettableValue]()) {\n if (data[$isDataValue]()) {\n const value = data[$getDataValue]();\n // TODO: use picture.\n formNode[$setValue](createText(value));\n } else if (\n formNode instanceof Field &&\n formNode.ui?.choiceList?.open === \"multiSelect\"\n ) {\n const value = data[$getChildren]()\n .map(child => child[$content].trim())\n .join(\"\\n\");\n formNode[$setValue](createText(value));\n } else if (this._isConsumeData()) {\n warn(`XFA - Nodes haven't the same type.`);\n }\n } else if (!data[$isDataValue]() || this._isMatchTemplate()) {\n this._bindElement(formNode, data);\n } else {\n warn(`XFA - Nodes haven't the same type.`);\n }\n }\n\n _findDataByNameToConsume(name, isValue, dataNode, global) {\n if (!name) {\n return null;\n }\n\n // Firstly, we try to find a node with the given name:\n // - in dataNode;\n // - if not found, then in parent;\n // - and if not in found, then in grand-parent.\n let generator, match;\n for (let i = 0; i < 3; i++) {\n generator = dataNode[$getRealChildrenByNameIt](\n name,\n /* allTransparent = */ false,\n /* skipConsumed = */ true\n );\n // Try to find a match of the same kind.\n while (true) {\n match = generator.next().value;\n if (!match) {\n break;\n }\n\n if (isValue === match[$isDataValue]()) {\n return match;\n }\n }\n if (\n dataNode[$namespaceId] === NamespaceIds.datasets.id &&\n dataNode[$nodeName] === \"data\"\n ) {\n break;\n }\n dataNode = dataNode[$getParent]();\n }\n\n if (!global) {\n return null;\n }\n\n // Secondly, if global try to find it just under the root of datasets\n // (which is the location of global variables).\n generator = this.data[$getRealChildrenByNameIt](\n name,\n /* allTransparent = */ true,\n /* skipConsumed = */ false\n );\n\n match = generator.next().value;\n if (match) {\n return match;\n }\n\n // Thirdly, try to find it in attributes.\n generator = this.data[$getAttributeIt](name, /* skipConsumed = */ true);\n match = generator.next().value;\n if (match?.[$isDataValue]()) {\n return match;\n }\n\n return null;\n }\n\n _setProperties(formNode, dataNode) {\n // For example:\n // <field name=\"LastName\" ...>\n // <setProperty ref=\"$data.Main.Style.NameFont\" target=\"font.typeface\"/>\n // <setProperty ref=\"$data.Main.Style.NameSize\" target=\"font.size\"/>\n // <setProperty ref=\"$data.Main.Help.LastName\" target=\"assist.toolTip\"/>\n // </field>\n\n if (!formNode.hasOwnProperty(\"setProperty\")) {\n return;\n }\n\n for (const { ref, target, connection } of formNode.setProperty.children) {\n if (connection) {\n // TODO: evaluate if we should implement this feature.\n // Skip for security reasons.\n continue;\n }\n if (!ref) {\n continue;\n }\n\n const nodes = searchNode(\n this.root,\n dataNode,\n ref,\n false /* = dotDotAllowed */,\n false /* = useCache */\n );\n if (!nodes) {\n warn(`XFA - Invalid reference: ${ref}.`);\n continue;\n }\n const [node] = nodes;\n\n if (!node[$isDescendent](this.data)) {\n warn(`XFA - Invalid node: must be a data node.`);\n continue;\n }\n\n const targetNodes = searchNode(\n this.root,\n formNode,\n target,\n false /* = dotDotAllowed */,\n false /* = useCache */\n );\n if (!targetNodes) {\n warn(`XFA - Invalid target: ${target}.`);\n continue;\n }\n const [targetNode] = targetNodes;\n\n if (!targetNode[$isDescendent](formNode)) {\n warn(`XFA - Invalid target: must be a property or subproperty.`);\n continue;\n }\n\n const targetParent = targetNode[$getParent]();\n if (\n targetNode instanceof SetProperty ||\n targetParent instanceof SetProperty\n ) {\n warn(\n `XFA - Invalid target: cannot be a setProperty or one of its properties.`\n );\n continue;\n }\n\n if (\n targetNode instanceof BindItems ||\n targetParent instanceof BindItems\n ) {\n warn(\n `XFA - Invalid target: cannot be a bindItems or one of its properties.`\n );\n continue;\n }\n\n const content = node[$text]();\n const name = targetNode[$nodeName];\n\n if (targetNode instanceof XFAAttribute) {\n const attrs = Object.create(null);\n attrs[name] = content;\n const obj = Reflect.construct(\n Object.getPrototypeOf(targetParent).constructor,\n [attrs]\n );\n targetParent[name] = obj[name];\n continue;\n }\n\n if (!targetNode.hasOwnProperty($content)) {\n warn(`XFA - Invalid node to use in setProperty`);\n continue;\n }\n\n targetNode[$data] = node;\n targetNode[$content] = content;\n targetNode[$finalize]();\n }\n }\n\n _bindItems(formNode, dataNode) {\n // For example:\n // <field name=\"CardName\"...>\n // <bindItems ref=\"$data.main.ccs.cc[*]\" labelRef=\"uiname\"\n // valueRef=\"token\"/>\n // <ui><choiceList/></ui>\n // </field>\n\n if (\n !formNode.hasOwnProperty(\"items\") ||\n !formNode.hasOwnProperty(\"bindItems\") ||\n formNode.bindItems.isEmpty()\n ) {\n return;\n }\n\n for (const item of formNode.items.children) {\n formNode[$removeChild](item);\n }\n\n formNode.items.clear();\n\n const labels = new Items({});\n const values = new Items({});\n\n formNode[$appendChild](labels);\n formNode.items.push(labels);\n\n formNode[$appendChild](values);\n formNode.items.push(values);\n\n for (const { ref, labelRef, valueRef, connection } of formNode.bindItems\n .children) {\n if (connection) {\n // TODO: evaluate if we should implement this feature.\n // Skip for security reasons.\n continue;\n }\n if (!ref) {\n continue;\n }\n\n const nodes = searchNode(\n this.root,\n dataNode,\n ref,\n false /* = dotDotAllowed */,\n false /* = useCache */\n );\n if (!nodes) {\n warn(`XFA - Invalid reference: ${ref}.`);\n continue;\n }\n for (const node of nodes) {\n if (!node[$isDescendent](this.datasets)) {\n warn(`XFA - Invalid ref (${ref}): must be a datasets child.`);\n continue;\n }\n\n const labelNodes = searchNode(\n this.root,\n node,\n labelRef,\n true /* = dotDotAllowed */,\n false /* = useCache */\n );\n if (!labelNodes) {\n warn(`XFA - Invalid label: ${labelRef}.`);\n continue;\n }\n const [labelNode] = labelNodes;\n\n if (!labelNode[$isDescendent](this.datasets)) {\n warn(`XFA - Invalid label: must be a datasets child.`);\n continue;\n }\n\n const valueNodes = searchNode(\n this.root,\n node,\n valueRef,\n true /* = dotDotAllowed */,\n false /* = useCache */\n );\n if (!valueNodes) {\n warn(`XFA - Invalid value: ${valueRef}.`);\n continue;\n }\n const [valueNode] = valueNodes;\n\n if (!valueNode[$isDescendent](this.datasets)) {\n warn(`XFA - Invalid value: must be a datasets child.`);\n continue;\n }\n\n const label = createText(labelNode[$text]());\n const value = createText(valueNode[$text]());\n\n labels[$appendChild](label);\n labels.text.push(label);\n\n values[$appendChild](value);\n values.text.push(value);\n }\n }\n }\n\n _bindOccurrences(formNode, matches, picture) {\n // Insert nodes which are not in the template but reflect\n // what we've in data tree.\n\n let baseClone;\n if (matches.length > 1) {\n // Clone before binding to avoid bad state.\n baseClone = formNode[$clone]();\n baseClone[$removeChild](baseClone.occur);\n baseClone.occur = null;\n }\n\n this._bindValue(formNode, matches[0], picture);\n this._setProperties(formNode, matches[0]);\n this._bindItems(formNode, matches[0]);\n\n if (matches.length === 1) {\n return;\n }\n\n const parent = formNode[$getParent]();\n const name = formNode[$nodeName];\n const pos = parent[$indexOf](formNode);\n\n for (let i = 1, ii = matches.length; i < ii; i++) {\n const match = matches[i];\n const clone = baseClone[$clone]();\n parent[name].push(clone);\n parent[$insertAt](pos + i, clone);\n\n this._bindValue(clone, match, picture);\n this._setProperties(clone, match);\n this._bindItems(clone, match);\n }\n }\n\n _createOccurrences(formNode) {\n if (!this.emptyMerge) {\n return;\n }\n\n const { occur } = formNode;\n if (!occur || occur.initial <= 1) {\n return;\n }\n\n const parent = formNode[$getParent]();\n const name = formNode[$nodeName];\n\n if (!(parent[name] instanceof XFAObjectArray)) {\n return;\n }\n\n let currentNumber;\n if (formNode.name) {\n currentNumber = parent[name].children.filter(\n e => e.name === formNode.name\n ).length;\n } else {\n currentNumber = parent[name].children.length;\n }\n\n const pos = parent[$indexOf](formNode) + 1;\n const ii = occur.initial - currentNumber;\n if (ii) {\n const nodeClone = formNode[$clone]();\n nodeClone[$removeChild](nodeClone.occur);\n nodeClone.occur = null;\n parent[name].push(nodeClone);\n parent[$insertAt](pos, nodeClone);\n\n for (let i = 1; i < ii; i++) {\n const clone = nodeClone[$clone]();\n parent[name].push(clone);\n parent[$insertAt](pos + i, clone);\n }\n }\n }\n\n _getOccurInfo(formNode) {\n const { name, occur } = formNode;\n if (!occur || !name) {\n return [1, 1];\n }\n const max = occur.max === -1 ? Infinity : occur.max;\n return [occur.min, max];\n }\n\n _setAndBind(formNode, dataNode) {\n this._setProperties(formNode, dataNode);\n this._bindItems(formNode, dataNode);\n this._bindElement(formNode, dataNode);\n }\n\n _bindElement(formNode, dataNode) {\n // Some nodes can be useless because min=0 so remove them\n // after the loop to avoid bad things.\n\n const uselessNodes = [];\n\n this._createOccurrences(formNode);\n\n for (const child of formNode[$getChildren]()) {\n if (child[$data]) {\n // Already bound.\n continue;\n }\n\n if (this._mergeMode === undefined && child[$nodeName] === \"subform\") {\n this._mergeMode = child.mergeMode === \"consumeData\";\n\n // XFA specs p. 182:\n // The highest-level subform and the data node representing\n // the current record are special; they are always\n // bound even if their names don't match.\n const dataChildren = dataNode[$getChildren]();\n if (dataChildren.length > 0) {\n this._bindOccurrences(child, [dataChildren[0]], null);\n } else if (this.emptyMerge) {\n const nsId =\n dataNode[$namespaceId] === NS_DATASETS\n ? -1\n : dataNode[$namespaceId];\n const dataChild = (child[$data] = new XmlObject(\n nsId,\n child.name || \"root\"\n ));\n dataNode[$appendChild](dataChild);\n this._bindElement(child, dataChild);\n }\n continue;\n }\n\n if (!child[$isBindable]()) {\n // The node cannot contain some new data so there is nothing\n // to create in the data node.\n continue;\n }\n\n let global = false;\n let picture = null;\n let ref = null;\n let match = null;\n if (child.bind) {\n switch (child.bind.match) {\n case \"none\":\n this._setAndBind(child, dataNode);\n continue;\n case \"global\":\n global = true;\n break;\n case \"dataRef\":\n if (!child.bind.ref) {\n warn(`XFA - ref is empty in node ${child[$nodeName]}.`);\n this._setAndBind(child, dataNode);\n continue;\n }\n ref = child.bind.ref;\n break;\n default:\n break;\n }\n if (child.bind.picture) {\n picture = child.bind.picture[$content];\n }\n }\n\n const [min, max] = this._getOccurInfo(child);\n\n if (ref) {\n // Don't use a cache for searching: nodes can change during binding.\n match = searchNode(\n this.root,\n dataNode,\n ref,\n true /* = dotDotAllowed */,\n false /* = useCache */\n );\n if (match === null) {\n // Nothing found: we must create some nodes in data in order\n // to have something to match with the given expression.\n // See http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.364.2157&rep=rep1&type=pdf#page=199\n match = createDataNode(this.data, dataNode, ref);\n if (!match) {\n // For example if the node contains a .(...) then it isn't\n // findable.\n // TODO: remove this when .(...) is implemented.\n continue;\n }\n if (this._isConsumeData()) {\n match[$consumed] = true;\n }\n\n // Don't bind the value in newly created node because it's empty.\n this._setAndBind(child, match);\n continue;\n } else {\n if (this._isConsumeData()) {\n // Filter out consumed nodes.\n match = match.filter(node => !node[$consumed]);\n }\n if (match.length > max) {\n match = match.slice(0, max);\n } else if (match.length === 0) {\n match = null;\n }\n if (match && this._isConsumeData()) {\n match.forEach(node => {\n node[$consumed] = true;\n });\n }\n }\n } else {\n if (!child.name) {\n this._setAndBind(child, dataNode);\n continue;\n }\n if (this._isConsumeData()) {\n // In consumeData mode, search for the next node with the given name.\n // occurs.max gives us the max number of node to match.\n const matches = [];\n while (matches.length < max) {\n const found = this._findDataByNameToConsume(\n child.name,\n child[$hasSettableValue](),\n dataNode,\n global\n );\n\n if (!found) {\n break;\n }\n found[$consumed] = true;\n matches.push(found);\n }\n match = matches.length > 0 ? matches : null;\n } else {\n // If we've an empty merge, there are no reason\n // to make multiple bind so skip consumed nodes.\n match = dataNode[$getRealChildrenByNameIt](\n child.name,\n /* allTransparent = */ false,\n /* skipConsumed = */ this.emptyMerge\n ).next().value;\n if (!match) {\n // If there is no match (no data) and `min === 0` then\n // the container is entirely excluded.\n // https://www.pdfa.org/norm-refs/XFA-3_3.pdf#G12.1428332\n if (min === 0) {\n uselessNodes.push(child);\n continue;\n }\n // We're in matchTemplate mode so create a node in data to reflect\n // what we've in template.\n const nsId =\n dataNode[$namespaceId] === NS_DATASETS\n ? -1\n : dataNode[$namespaceId];\n match = child[$data] = new XmlObject(nsId, child.name);\n if (this.emptyMerge) {\n match[$consumed] = true;\n }\n dataNode[$appendChild](match);\n\n // Don't bind the value in newly created node because it's empty.\n this._setAndBind(child, match);\n continue;\n }\n if (this.emptyMerge) {\n match[$consumed] = true;\n }\n match = [match];\n }\n }\n\n if (match) {\n this._bindOccurrences(child, match, picture);\n } else if (min > 0) {\n this._setAndBind(child, dataNode);\n } else {\n uselessNodes.push(child);\n }\n }\n\n uselessNodes.forEach(node => node[$getParent]()[$removeChild](node));\n }\n}\n\nexport { Binder };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n $getAttributes,\n $getChildren,\n $nodeName,\n $setValue,\n $toString,\n $uid,\n} from \"./symbol_utils.js\";\n\nclass DataHandler {\n constructor(root, data) {\n this.data = data;\n this.dataset = root.datasets || null;\n }\n\n serialize(storage) {\n const stack = [[-1, this.data[$getChildren]()]];\n\n while (stack.length > 0) {\n const last = stack.at(-1);\n const [i, children] = last;\n if (i + 1 === children.length) {\n stack.pop();\n continue;\n }\n\n const child = children[++last[0]];\n const storageEntry = storage.get(child[$uid]);\n if (storageEntry) {\n child[$setValue](storageEntry);\n } else {\n const attributes = child[$getAttributes]();\n for (const value of attributes.values()) {\n const entry = storage.get(value[$uid]);\n if (entry) {\n value[$setValue](entry);\n break;\n }\n }\n }\n\n const nodes = child[$getChildren]();\n if (nodes.length > 0) {\n stack.push([-1, nodes]);\n }\n }\n\n const buf = [\n `<xfa:datasets xmlns:xfa=\"http://www.xfa.org/schema/xfa-data/1.0/\">`,\n ];\n if (this.dataset) {\n // Dump nodes other than data: they can contains for example\n // some data for choice lists.\n for (const child of this.dataset[$getChildren]()) {\n if (child[$nodeName] !== \"data\") {\n child[$toString](buf);\n }\n }\n }\n this.data[$toString](buf);\n buf.push(\"</xfa:datasets>\");\n\n return buf.join(\"\");\n }\n}\n\nexport { DataHandler };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { $buildXFAObject, NamespaceIds } from \"./namespaces.js\";\nimport { $content, $finalize } from \"./symbol_utils.js\";\nimport {\n ContentObject,\n IntegerObject,\n Option01,\n Option10,\n OptionObject,\n StringObject,\n XFAObject,\n XFAObjectArray,\n} from \"./xfa_object.js\";\nimport { getInteger, getStringOption } from \"./utils.js\";\nimport { shadow, warn } from \"../../shared/util.js\";\n\nconst CONFIG_NS_ID = NamespaceIds.config.id;\n\nclass Acrobat extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"acrobat\", /* hasChildren = */ true);\n this.acrobat7 = null;\n this.autoSave = null;\n this.common = null;\n this.validate = null;\n this.validateApprovalSignatures = null;\n this.submitUrl = new XFAObjectArray();\n }\n}\n\nclass Acrobat7 extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"acrobat7\", /* hasChildren = */ true);\n this.dynamicRender = null;\n }\n}\n\nclass ADBE_JSConsole extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"ADBE_JSConsole\", [\"delegate\", \"Enable\", \"Disable\"]);\n }\n}\n\nclass ADBE_JSDebugger extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"ADBE_JSDebugger\", [\"delegate\", \"Enable\", \"Disable\"]);\n }\n}\n\nclass AddSilentPrint extends Option01 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"addSilentPrint\");\n }\n}\n\nclass AddViewerPreferences extends Option01 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"addViewerPreferences\");\n }\n}\n\nclass AdjustData extends Option10 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"adjustData\");\n }\n}\n\nclass AdobeExtensionLevel extends IntegerObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"adobeExtensionLevel\", 0, n => n >= 1 && n <= 8);\n }\n}\n\nclass Agent extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"agent\", /* hasChildren = */ true);\n this.name = attributes.name ? attributes.name.trim() : \"\";\n this.common = new XFAObjectArray();\n }\n}\n\nclass AlwaysEmbed extends ContentObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"alwaysEmbed\");\n }\n}\n\nclass Amd extends StringObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"amd\");\n }\n}\n\nclass Area extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"area\");\n this.level = getInteger({\n data: attributes.level,\n defaultValue: 0,\n validate: n => n >= 1 && n <= 3,\n });\n this.name = getStringOption(attributes.name, [\n \"\",\n \"barcode\",\n \"coreinit\",\n \"deviceDriver\",\n \"font\",\n \"general\",\n \"layout\",\n \"merge\",\n \"script\",\n \"signature\",\n \"sourceSet\",\n \"templateCache\",\n ]);\n }\n}\n\nclass Attributes extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"attributes\", [\"preserve\", \"delegate\", \"ignore\"]);\n }\n}\n\nclass AutoSave extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"autoSave\", [\"disabled\", \"enabled\"]);\n }\n}\n\nclass Base extends StringObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"base\");\n }\n}\n\nclass BatchOutput extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"batchOutput\");\n this.format = getStringOption(attributes.format, [\n \"none\",\n \"concat\",\n \"zip\",\n \"zipCompress\",\n ]);\n }\n}\n\nclass BehaviorOverride extends ContentObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"behaviorOverride\");\n }\n\n [$finalize]() {\n this[$content] = new Map(\n this[$content]\n .trim()\n .split(/\\s+/)\n .filter(x => x.includes(\":\"))\n .map(x => x.split(\":\", 2))\n );\n }\n}\n\nclass Cache extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"cache\", /* hasChildren = */ true);\n this.templateCache = null;\n }\n}\n\nclass Change extends Option01 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"change\");\n }\n}\n\nclass Common extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"common\", /* hasChildren = */ true);\n this.data = null;\n this.locale = null;\n this.localeSet = null;\n this.messaging = null;\n this.suppressBanner = null;\n this.template = null;\n this.validationMessaging = null;\n this.versionControl = null;\n this.log = new XFAObjectArray();\n }\n}\n\nclass Compress extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"compress\");\n this.scope = getStringOption(attributes.scope, [\"imageOnly\", \"document\"]);\n }\n}\n\nclass CompressLogicalStructure extends Option01 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"compressLogicalStructure\");\n }\n}\n\nclass CompressObjectStream extends Option10 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"compressObjectStream\");\n }\n}\n\nclass Compression extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"compression\", /* hasChildren = */ true);\n this.compressLogicalStructure = null;\n this.compressObjectStream = null;\n this.level = null;\n this.type = null;\n }\n}\n\nclass Config extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"config\", /* hasChildren = */ true);\n this.acrobat = null;\n this.present = null;\n this.trace = null;\n this.agent = new XFAObjectArray();\n }\n}\n\nclass Conformance extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"conformance\", [\"A\", \"B\"]);\n }\n}\n\nclass ContentCopy extends Option01 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"contentCopy\");\n }\n}\n\nclass Copies extends IntegerObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"copies\", 1, n => n >= 1);\n }\n}\n\nclass Creator extends StringObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"creator\");\n }\n}\n\nclass CurrentPage extends IntegerObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"currentPage\", 0, n => n >= 0);\n }\n}\n\nclass Data extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"data\", /* hasChildren = */ true);\n this.adjustData = null;\n this.attributes = null;\n this.incrementalLoad = null;\n this.outputXSL = null;\n this.range = null;\n this.record = null;\n this.startNode = null;\n this.uri = null;\n this.window = null;\n this.xsl = null;\n this.excludeNS = new XFAObjectArray();\n this.transform = new XFAObjectArray();\n }\n}\n\nclass Debug extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"debug\", /* hasChildren = */ true);\n this.uri = null;\n }\n}\n\nclass DefaultTypeface extends ContentObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"defaultTypeface\");\n this.writingScript = getStringOption(attributes.writingScript, [\n \"*\",\n \"Arabic\",\n \"Cyrillic\",\n \"EastEuropeanRoman\",\n \"Greek\",\n \"Hebrew\",\n \"Japanese\",\n \"Korean\",\n \"Roman\",\n \"SimplifiedChinese\",\n \"Thai\",\n \"TraditionalChinese\",\n \"Vietnamese\",\n ]);\n }\n}\n\nclass Destination extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"destination\", [\n \"pdf\",\n \"pcl\",\n \"ps\",\n \"webClient\",\n \"zpl\",\n ]);\n }\n}\n\nclass DocumentAssembly extends Option01 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"documentAssembly\");\n }\n}\n\nclass Driver extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"driver\", /* hasChildren = */ true);\n this.name = attributes.name ? attributes.name.trim() : \"\";\n this.fontInfo = null;\n this.xdc = null;\n }\n}\n\nclass DuplexOption extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"duplexOption\", [\n \"simplex\",\n \"duplexFlipLongEdge\",\n \"duplexFlipShortEdge\",\n ]);\n }\n}\n\nclass DynamicRender extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"dynamicRender\", [\"forbidden\", \"required\"]);\n }\n}\n\nclass Embed extends Option01 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"embed\");\n }\n}\n\nclass Encrypt extends Option01 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"encrypt\");\n }\n}\n\nclass Encryption extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"encryption\", /* hasChildren = */ true);\n this.encrypt = null;\n this.encryptionLevel = null;\n this.permissions = null;\n }\n}\n\nclass EncryptionLevel extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"encryptionLevel\", [\"40bit\", \"128bit\"]);\n }\n}\n\nclass Enforce extends StringObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"enforce\");\n }\n}\n\nclass Equate extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"equate\");\n\n this.force = getInteger({\n data: attributes.force,\n defaultValue: 1,\n validate: n => n === 0,\n });\n\n this.from = attributes.from || \"\";\n this.to = attributes.to || \"\";\n }\n}\n\nclass EquateRange extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"equateRange\");\n\n this.from = attributes.from || \"\";\n this.to = attributes.to || \"\";\n this._unicodeRange = attributes.unicodeRange || \"\";\n }\n\n get unicodeRange() {\n const ranges = [];\n const unicodeRegex = /U\\+([0-9a-fA-F]+)/;\n const unicodeRange = this._unicodeRange;\n for (let range of unicodeRange\n .split(\",\")\n .map(x => x.trim())\n .filter(x => !!x)) {\n range = range.split(\"-\", 2).map(x => {\n const found = x.match(unicodeRegex);\n if (!found) {\n return 0;\n }\n return parseInt(found[1], 16);\n });\n if (range.length === 1) {\n range.push(range[0]);\n }\n ranges.push(range);\n }\n return shadow(this, \"unicodeRange\", ranges);\n }\n}\n\nclass Exclude extends ContentObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"exclude\");\n }\n\n [$finalize]() {\n this[$content] = this[$content]\n .trim()\n .split(/\\s+/)\n .filter(\n x =>\n x &&\n [\n \"calculate\",\n \"close\",\n \"enter\",\n \"exit\",\n \"initialize\",\n \"ready\",\n \"validate\",\n ].includes(x)\n );\n }\n}\n\nclass ExcludeNS extends StringObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"excludeNS\");\n }\n}\n\nclass FlipLabel extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"flipLabel\", [\"usePrinterSetting\", \"on\", \"off\"]);\n }\n}\n\nclass FontInfo extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"fontInfo\", /* hasChildren = */ true);\n this.embed = null;\n this.map = null;\n this.subsetBelow = null;\n this.alwaysEmbed = new XFAObjectArray();\n this.defaultTypeface = new XFAObjectArray();\n this.neverEmbed = new XFAObjectArray();\n }\n}\n\nclass FormFieldFilling extends Option01 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"formFieldFilling\");\n }\n}\n\nclass GroupParent extends StringObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"groupParent\");\n }\n}\n\nclass IfEmpty extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"ifEmpty\", [\n \"dataValue\",\n \"dataGroup\",\n \"ignore\",\n \"remove\",\n ]);\n }\n}\n\nclass IncludeXDPContent extends StringObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"includeXDPContent\");\n }\n}\n\nclass IncrementalLoad extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"incrementalLoad\", [\"none\", \"forwardOnly\"]);\n }\n}\n\nclass IncrementalMerge extends Option01 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"incrementalMerge\");\n }\n}\n\nclass Interactive extends Option01 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"interactive\");\n }\n}\n\nclass Jog extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"jog\", [\"usePrinterSetting\", \"none\", \"pageSet\"]);\n }\n}\n\nclass LabelPrinter extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"labelPrinter\", /* hasChildren = */ true);\n this.name = getStringOption(attributes.name, [\"zpl\", \"dpl\", \"ipl\", \"tcpl\"]);\n this.batchOutput = null;\n this.flipLabel = null;\n this.fontInfo = null;\n this.xdc = null;\n }\n}\n\nclass Layout extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"layout\", [\"paginate\", \"panel\"]);\n }\n}\n\nclass Level extends IntegerObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"level\", 0, n => n > 0);\n }\n}\n\nclass Linearized extends Option01 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"linearized\");\n }\n}\n\nclass Locale extends StringObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"locale\");\n }\n}\n\nclass LocaleSet extends StringObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"localeSet\");\n }\n}\n\nclass Log extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"log\", /* hasChildren = */ true);\n this.mode = null;\n this.threshold = null;\n this.to = null;\n this.uri = null;\n }\n}\n\n// Renamed in MapElement to avoid confusion with usual js Map.\nclass MapElement extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"map\", /* hasChildren = */ true);\n this.equate = new XFAObjectArray();\n this.equateRange = new XFAObjectArray();\n }\n}\n\nclass MediumInfo extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"mediumInfo\", /* hasChildren = */ true);\n this.map = null;\n }\n}\n\nclass Message extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"message\", /* hasChildren = */ true);\n this.msgId = null;\n this.severity = null;\n }\n}\n\nclass Messaging extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"messaging\", /* hasChildren = */ true);\n this.message = new XFAObjectArray();\n }\n}\n\nclass Mode extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"mode\", [\"append\", \"overwrite\"]);\n }\n}\n\nclass ModifyAnnots extends Option01 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"modifyAnnots\");\n }\n}\n\nclass MsgId extends IntegerObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"msgId\", 1, n => n >= 1);\n }\n}\n\nclass NameAttr extends StringObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"nameAttr\");\n }\n}\n\nclass NeverEmbed extends ContentObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"neverEmbed\");\n }\n}\n\nclass NumberOfCopies extends IntegerObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"numberOfCopies\", null, n => n >= 2 && n <= 5);\n }\n}\n\nclass OpenAction extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"openAction\", /* hasChildren = */ true);\n this.destination = null;\n }\n}\n\nclass Output extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"output\", /* hasChildren = */ true);\n this.to = null;\n this.type = null;\n this.uri = null;\n }\n}\n\nclass OutputBin extends StringObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"outputBin\");\n }\n}\n\nclass OutputXSL extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"outputXSL\", /* hasChildren = */ true);\n this.uri = null;\n }\n}\n\nclass Overprint extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"overprint\", [\"none\", \"both\", \"draw\", \"field\"]);\n }\n}\n\nclass Packets extends StringObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"packets\");\n }\n\n [$finalize]() {\n if (this[$content] === \"*\") {\n return;\n }\n this[$content] = this[$content]\n .trim()\n .split(/\\s+/)\n .filter(x =>\n [\"config\", \"datasets\", \"template\", \"xfdf\", \"xslt\"].includes(x)\n );\n }\n}\n\nclass PageOffset extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"pageOffset\");\n this.x = getInteger({\n data: attributes.x,\n defaultValue: \"useXDCSetting\",\n validate: n => true,\n });\n this.y = getInteger({\n data: attributes.y,\n defaultValue: \"useXDCSetting\",\n validate: n => true,\n });\n }\n}\n\nclass PageRange extends StringObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"pageRange\");\n }\n\n [$finalize]() {\n const numbers = this[$content]\n .trim()\n .split(/\\s+/)\n .map(x => parseInt(x, 10));\n const ranges = [];\n for (let i = 0, ii = numbers.length; i < ii; i += 2) {\n ranges.push(numbers.slice(i, i + 2));\n }\n this[$content] = ranges;\n }\n}\n\nclass Pagination extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"pagination\", [\n \"simplex\",\n \"duplexShortEdge\",\n \"duplexLongEdge\",\n ]);\n }\n}\n\nclass PaginationOverride extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"paginationOverride\", [\n \"none\",\n \"forceDuplex\",\n \"forceDuplexLongEdge\",\n \"forceDuplexShortEdge\",\n \"forceSimplex\",\n ]);\n }\n}\n\nclass Part extends IntegerObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"part\", 1, n => false);\n }\n}\n\nclass Pcl extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"pcl\", /* hasChildren = */ true);\n this.name = attributes.name || \"\";\n this.batchOutput = null;\n this.fontInfo = null;\n this.jog = null;\n this.mediumInfo = null;\n this.outputBin = null;\n this.pageOffset = null;\n this.staple = null;\n this.xdc = null;\n }\n}\n\nclass Pdf extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"pdf\", /* hasChildren = */ true);\n this.name = attributes.name || \"\";\n this.adobeExtensionLevel = null;\n this.batchOutput = null;\n this.compression = null;\n this.creator = null;\n this.encryption = null;\n this.fontInfo = null;\n this.interactive = null;\n this.linearized = null;\n this.openAction = null;\n this.pdfa = null;\n this.producer = null;\n this.renderPolicy = null;\n this.scriptModel = null;\n this.silentPrint = null;\n this.submitFormat = null;\n this.tagged = null;\n this.version = null;\n this.viewerPreferences = null;\n this.xdc = null;\n }\n}\n\nclass Pdfa extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"pdfa\", /* hasChildren = */ true);\n this.amd = null;\n this.conformance = null;\n this.includeXDPContent = null;\n this.part = null;\n }\n}\n\nclass Permissions extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"permissions\", /* hasChildren = */ true);\n this.accessibleContent = null;\n this.change = null;\n this.contentCopy = null;\n this.documentAssembly = null;\n this.formFieldFilling = null;\n this.modifyAnnots = null;\n this.plaintextMetadata = null;\n this.print = null;\n this.printHighQuality = null;\n }\n}\n\nclass PickTrayByPDFSize extends Option01 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"pickTrayByPDFSize\");\n }\n}\n\nclass Picture extends StringObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"picture\");\n }\n\n // TODO: check the validity of the picture clause.\n // See page 1150 in the spec.\n}\n\nclass PlaintextMetadata extends Option01 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"plaintextMetadata\");\n }\n}\n\nclass Presence extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"presence\", [\n \"preserve\",\n \"dissolve\",\n \"dissolveStructure\",\n \"ignore\",\n \"remove\",\n ]);\n }\n}\n\nclass Present extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"present\", /* hasChildren = */ true);\n this.behaviorOverride = null;\n this.cache = null;\n this.common = null;\n this.copies = null;\n this.destination = null;\n this.incrementalMerge = null;\n this.layout = null;\n this.output = null;\n this.overprint = null;\n this.pagination = null;\n this.paginationOverride = null;\n this.script = null;\n this.validate = null;\n this.xdp = null;\n this.driver = new XFAObjectArray();\n this.labelPrinter = new XFAObjectArray();\n this.pcl = new XFAObjectArray();\n this.pdf = new XFAObjectArray();\n this.ps = new XFAObjectArray();\n this.submitUrl = new XFAObjectArray();\n this.webClient = new XFAObjectArray();\n this.zpl = new XFAObjectArray();\n }\n}\n\nclass Print extends Option01 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"print\");\n }\n}\n\nclass PrintHighQuality extends Option01 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"printHighQuality\");\n }\n}\n\nclass PrintScaling extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"printScaling\", [\"appdefault\", \"noScaling\"]);\n }\n}\n\nclass PrinterName extends StringObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"printerName\");\n }\n}\n\nclass Producer extends StringObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"producer\");\n }\n}\n\nclass Ps extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"ps\", /* hasChildren = */ true);\n this.name = attributes.name || \"\";\n this.batchOutput = null;\n this.fontInfo = null;\n this.jog = null;\n this.mediumInfo = null;\n this.outputBin = null;\n this.staple = null;\n this.xdc = null;\n }\n}\n\nclass Range extends ContentObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"range\");\n }\n\n [$finalize]() {\n this[$content] = this[$content]\n .trim()\n .split(/\\s*,\\s*/, 2)\n .map(range => range.split(\"-\").map(x => parseInt(x.trim(), 10)))\n .filter(range => range.every(x => !isNaN(x)))\n .map(range => {\n if (range.length === 1) {\n range.push(range[0]);\n }\n return range;\n });\n }\n}\n\nclass Record extends ContentObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"record\");\n }\n\n [$finalize]() {\n this[$content] = this[$content].trim();\n const n = parseInt(this[$content], 10);\n if (!isNaN(n) && n >= 0) {\n this[$content] = n;\n }\n }\n}\n\nclass Relevant extends ContentObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"relevant\");\n }\n\n [$finalize]() {\n this[$content] = this[$content].trim().split(/\\s+/);\n }\n}\n\nclass Rename extends ContentObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"rename\");\n }\n\n [$finalize]() {\n this[$content] = this[$content].trim();\n // String must be a XFA name: same as XML one except that there\n // is no colon.\n if (\n this[$content].toLowerCase().startsWith(\"xml\") ||\n new RegExp(\"[\\\\p{L}_][\\\\p{L}\\\\d._\\\\p{M}-]*\", \"u\").test(this[$content])\n ) {\n warn(\"XFA - Rename: invalid XFA name\");\n }\n }\n}\n\nclass RenderPolicy extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"renderPolicy\", [\"server\", \"client\"]);\n }\n}\n\nclass RunScripts extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"runScripts\", [\"both\", \"client\", \"none\", \"server\"]);\n }\n}\n\nclass Script extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"script\", /* hasChildren = */ true);\n this.currentPage = null;\n this.exclude = null;\n this.runScripts = null;\n }\n}\n\nclass ScriptModel extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"scriptModel\", [\"XFA\", \"none\"]);\n }\n}\n\nclass Severity extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"severity\", [\n \"ignore\",\n \"error\",\n \"information\",\n \"trace\",\n \"warning\",\n ]);\n }\n}\n\nclass SilentPrint extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"silentPrint\", /* hasChildren = */ true);\n this.addSilentPrint = null;\n this.printerName = null;\n }\n}\n\nclass Staple extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"staple\");\n this.mode = getStringOption(attributes.mode, [\n \"usePrinterSetting\",\n \"on\",\n \"off\",\n ]);\n }\n}\n\nclass StartNode extends StringObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"startNode\");\n }\n}\n\nclass StartPage extends IntegerObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"startPage\", 0, n => true);\n }\n}\n\nclass SubmitFormat extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"submitFormat\", [\n \"html\",\n \"delegate\",\n \"fdf\",\n \"xml\",\n \"pdf\",\n ]);\n }\n}\n\nclass SubmitUrl extends StringObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"submitUrl\");\n }\n}\n\nclass SubsetBelow extends IntegerObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"subsetBelow\", 100, n => n >= 0 && n <= 100);\n }\n}\n\nclass SuppressBanner extends Option01 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"suppressBanner\");\n }\n}\n\nclass Tagged extends Option01 {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"tagged\");\n }\n}\n\nclass Template extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"template\", /* hasChildren = */ true);\n this.base = null;\n this.relevant = null;\n this.startPage = null;\n this.uri = null;\n this.xsl = null;\n }\n}\n\nclass Threshold extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"threshold\", [\n \"trace\",\n \"error\",\n \"information\",\n \"warning\",\n ]);\n }\n}\n\nclass To extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"to\", [\n \"null\",\n \"memory\",\n \"stderr\",\n \"stdout\",\n \"system\",\n \"uri\",\n ]);\n }\n}\n\nclass TemplateCache extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"templateCache\");\n this.maxEntries = getInteger({\n data: attributes.maxEntries,\n defaultValue: 5,\n validate: n => n >= 0,\n });\n }\n}\n\nclass Trace extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"trace\", /* hasChildren = */ true);\n this.area = new XFAObjectArray();\n }\n}\n\nclass Transform extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"transform\", /* hasChildren = */ true);\n this.groupParent = null;\n this.ifEmpty = null;\n this.nameAttr = null;\n this.picture = null;\n this.presence = null;\n this.rename = null;\n this.whitespace = null;\n }\n}\n\nclass Type extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"type\", [\n \"none\",\n \"ascii85\",\n \"asciiHex\",\n \"ccittfax\",\n \"flate\",\n \"lzw\",\n \"runLength\",\n \"native\",\n \"xdp\",\n \"mergedXDP\",\n ]);\n }\n}\n\nclass Uri extends StringObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"uri\");\n }\n}\n\nclass Validate extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"validate\", [\n \"preSubmit\",\n \"prePrint\",\n \"preExecute\",\n \"preSave\",\n ]);\n }\n}\n\nclass ValidateApprovalSignatures extends ContentObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"validateApprovalSignatures\");\n }\n\n [$finalize]() {\n this[$content] = this[$content]\n .trim()\n .split(/\\s+/)\n .filter(x => [\"docReady\", \"postSign\"].includes(x));\n }\n}\n\nclass ValidationMessaging extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"validationMessaging\", [\n \"allMessagesIndividually\",\n \"allMessagesTogether\",\n \"firstMessageOnly\",\n \"noMessages\",\n ]);\n }\n}\n\nclass Version extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"version\", [\"1.7\", \"1.6\", \"1.5\", \"1.4\", \"1.3\", \"1.2\"]);\n }\n}\n\nclass VersionControl extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"VersionControl\");\n this.outputBelow = getStringOption(attributes.outputBelow, [\n \"warn\",\n \"error\",\n \"update\",\n ]);\n this.sourceAbove = getStringOption(attributes.sourceAbove, [\n \"warn\",\n \"error\",\n ]);\n this.sourceBelow = getStringOption(attributes.sourceBelow, [\n \"update\",\n \"maintain\",\n ]);\n }\n}\n\nclass ViewerPreferences extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"viewerPreferences\", /* hasChildren = */ true);\n this.ADBE_JSConsole = null;\n this.ADBE_JSDebugger = null;\n this.addViewerPreferences = null;\n this.duplexOption = null;\n this.enforce = null;\n this.numberOfCopies = null;\n this.pageRange = null;\n this.pickTrayByPDFSize = null;\n this.printScaling = null;\n }\n}\n\nclass WebClient extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"webClient\", /* hasChildren = */ true);\n this.name = attributes.name ? attributes.name.trim() : \"\";\n this.fontInfo = null;\n this.xdc = null;\n }\n}\n\nclass Whitespace extends OptionObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"whitespace\", [\n \"preserve\",\n \"ltrim\",\n \"normalize\",\n \"rtrim\",\n \"trim\",\n ]);\n }\n}\n\nclass Window extends ContentObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"window\");\n }\n\n [$finalize]() {\n const pair = this[$content]\n .trim()\n .split(/\\s*,\\s*/, 2)\n .map(x => parseInt(x, 10));\n if (pair.some(x => isNaN(x))) {\n this[$content] = [0, 0];\n return;\n }\n if (pair.length === 1) {\n pair.push(pair[0]);\n }\n this[$content] = pair;\n }\n}\n\nclass Xdc extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"xdc\", /* hasChildren = */ true);\n this.uri = new XFAObjectArray();\n this.xsl = new XFAObjectArray();\n }\n}\n\nclass Xdp extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"xdp\", /* hasChildren = */ true);\n this.packets = null;\n }\n}\n\nclass Xsl extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"xsl\", /* hasChildren = */ true);\n this.debug = null;\n this.uri = null;\n }\n}\n\nclass Zpl extends XFAObject {\n constructor(attributes) {\n super(CONFIG_NS_ID, \"zpl\", /* hasChildren = */ true);\n this.name = attributes.name ? attributes.name.trim() : \"\";\n this.batchOutput = null;\n this.flipLabel = null;\n this.fontInfo = null;\n this.xdc = null;\n }\n}\n\nclass ConfigNamespace {\n static [$buildXFAObject](name, attributes) {\n if (ConfigNamespace.hasOwnProperty(name)) {\n return ConfigNamespace[name](attributes);\n }\n return undefined;\n }\n\n static acrobat(attrs) {\n return new Acrobat(attrs);\n }\n\n static acrobat7(attrs) {\n return new Acrobat7(attrs);\n }\n\n static ADBE_JSConsole(attrs) {\n return new ADBE_JSConsole(attrs);\n }\n\n static ADBE_JSDebugger(attrs) {\n return new ADBE_JSDebugger(attrs);\n }\n\n static addSilentPrint(attrs) {\n return new AddSilentPrint(attrs);\n }\n\n static addViewerPreferences(attrs) {\n return new AddViewerPreferences(attrs);\n }\n\n static adjustData(attrs) {\n return new AdjustData(attrs);\n }\n\n static adobeExtensionLevel(attrs) {\n return new AdobeExtensionLevel(attrs);\n }\n\n static agent(attrs) {\n return new Agent(attrs);\n }\n\n static alwaysEmbed(attrs) {\n return new AlwaysEmbed(attrs);\n }\n\n static amd(attrs) {\n return new Amd(attrs);\n }\n\n static area(attrs) {\n return new Area(attrs);\n }\n\n static attributes(attrs) {\n return new Attributes(attrs);\n }\n\n static autoSave(attrs) {\n return new AutoSave(attrs);\n }\n\n static base(attrs) {\n return new Base(attrs);\n }\n\n static batchOutput(attrs) {\n return new BatchOutput(attrs);\n }\n\n static behaviorOverride(attrs) {\n return new BehaviorOverride(attrs);\n }\n\n static cache(attrs) {\n return new Cache(attrs);\n }\n\n static change(attrs) {\n return new Change(attrs);\n }\n\n static common(attrs) {\n return new Common(attrs);\n }\n\n static compress(attrs) {\n return new Compress(attrs);\n }\n\n static compressLogicalStructure(attrs) {\n return new CompressLogicalStructure(attrs);\n }\n\n static compressObjectStream(attrs) {\n return new CompressObjectStream(attrs);\n }\n\n static compression(attrs) {\n return new Compression(attrs);\n }\n\n static config(attrs) {\n return new Config(attrs);\n }\n\n static conformance(attrs) {\n return new Conformance(attrs);\n }\n\n static contentCopy(attrs) {\n return new ContentCopy(attrs);\n }\n\n static copies(attrs) {\n return new Copies(attrs);\n }\n\n static creator(attrs) {\n return new Creator(attrs);\n }\n\n static currentPage(attrs) {\n return new CurrentPage(attrs);\n }\n\n static data(attrs) {\n return new Data(attrs);\n }\n\n static debug(attrs) {\n return new Debug(attrs);\n }\n\n static defaultTypeface(attrs) {\n return new DefaultTypeface(attrs);\n }\n\n static destination(attrs) {\n return new Destination(attrs);\n }\n\n static documentAssembly(attrs) {\n return new DocumentAssembly(attrs);\n }\n\n static driver(attrs) {\n return new Driver(attrs);\n }\n\n static duplexOption(attrs) {\n return new DuplexOption(attrs);\n }\n\n static dynamicRender(attrs) {\n return new DynamicRender(attrs);\n }\n\n static embed(attrs) {\n return new Embed(attrs);\n }\n\n static encrypt(attrs) {\n return new Encrypt(attrs);\n }\n\n static encryption(attrs) {\n return new Encryption(attrs);\n }\n\n static encryptionLevel(attrs) {\n return new EncryptionLevel(attrs);\n }\n\n static enforce(attrs) {\n return new Enforce(attrs);\n }\n\n static equate(attrs) {\n return new Equate(attrs);\n }\n\n static equateRange(attrs) {\n return new EquateRange(attrs);\n }\n\n static exclude(attrs) {\n return new Exclude(attrs);\n }\n\n static excludeNS(attrs) {\n return new ExcludeNS(attrs);\n }\n\n static flipLabel(attrs) {\n return new FlipLabel(attrs);\n }\n\n static fontInfo(attrs) {\n return new FontInfo(attrs);\n }\n\n static formFieldFilling(attrs) {\n return new FormFieldFilling(attrs);\n }\n\n static groupParent(attrs) {\n return new GroupParent(attrs);\n }\n\n static ifEmpty(attrs) {\n return new IfEmpty(attrs);\n }\n\n static includeXDPContent(attrs) {\n return new IncludeXDPContent(attrs);\n }\n\n static incrementalLoad(attrs) {\n return new IncrementalLoad(attrs);\n }\n\n static incrementalMerge(attrs) {\n return new IncrementalMerge(attrs);\n }\n\n static interactive(attrs) {\n return new Interactive(attrs);\n }\n\n static jog(attrs) {\n return new Jog(attrs);\n }\n\n static labelPrinter(attrs) {\n return new LabelPrinter(attrs);\n }\n\n static layout(attrs) {\n return new Layout(attrs);\n }\n\n static level(attrs) {\n return new Level(attrs);\n }\n\n static linearized(attrs) {\n return new Linearized(attrs);\n }\n\n static locale(attrs) {\n return new Locale(attrs);\n }\n\n static localeSet(attrs) {\n return new LocaleSet(attrs);\n }\n\n static log(attrs) {\n return new Log(attrs);\n }\n\n static map(attrs) {\n return new MapElement(attrs);\n }\n\n static mediumInfo(attrs) {\n return new MediumInfo(attrs);\n }\n\n static message(attrs) {\n return new Message(attrs);\n }\n\n static messaging(attrs) {\n return new Messaging(attrs);\n }\n\n static mode(attrs) {\n return new Mode(attrs);\n }\n\n static modifyAnnots(attrs) {\n return new ModifyAnnots(attrs);\n }\n\n static msgId(attrs) {\n return new MsgId(attrs);\n }\n\n static nameAttr(attrs) {\n return new NameAttr(attrs);\n }\n\n static neverEmbed(attrs) {\n return new NeverEmbed(attrs);\n }\n\n static numberOfCopies(attrs) {\n return new NumberOfCopies(attrs);\n }\n\n static openAction(attrs) {\n return new OpenAction(attrs);\n }\n\n static output(attrs) {\n return new Output(attrs);\n }\n\n static outputBin(attrs) {\n return new OutputBin(attrs);\n }\n\n static outputXSL(attrs) {\n return new OutputXSL(attrs);\n }\n\n static overprint(attrs) {\n return new Overprint(attrs);\n }\n\n static packets(attrs) {\n return new Packets(attrs);\n }\n\n static pageOffset(attrs) {\n return new PageOffset(attrs);\n }\n\n static pageRange(attrs) {\n return new PageRange(attrs);\n }\n\n static pagination(attrs) {\n return new Pagination(attrs);\n }\n\n static paginationOverride(attrs) {\n return new PaginationOverride(attrs);\n }\n\n static part(attrs) {\n return new Part(attrs);\n }\n\n static pcl(attrs) {\n return new Pcl(attrs);\n }\n\n static pdf(attrs) {\n return new Pdf(attrs);\n }\n\n static pdfa(attrs) {\n return new Pdfa(attrs);\n }\n\n static permissions(attrs) {\n return new Permissions(attrs);\n }\n\n static pickTrayByPDFSize(attrs) {\n return new PickTrayByPDFSize(attrs);\n }\n\n static picture(attrs) {\n return new Picture(attrs);\n }\n\n static plaintextMetadata(attrs) {\n return new PlaintextMetadata(attrs);\n }\n\n static presence(attrs) {\n return new Presence(attrs);\n }\n\n static present(attrs) {\n return new Present(attrs);\n }\n\n static print(attrs) {\n return new Print(attrs);\n }\n\n static printHighQuality(attrs) {\n return new PrintHighQuality(attrs);\n }\n\n static printScaling(attrs) {\n return new PrintScaling(attrs);\n }\n\n static printerName(attrs) {\n return new PrinterName(attrs);\n }\n\n static producer(attrs) {\n return new Producer(attrs);\n }\n\n static ps(attrs) {\n return new Ps(attrs);\n }\n\n static range(attrs) {\n return new Range(attrs);\n }\n\n static record(attrs) {\n return new Record(attrs);\n }\n\n static relevant(attrs) {\n return new Relevant(attrs);\n }\n\n static rename(attrs) {\n return new Rename(attrs);\n }\n\n static renderPolicy(attrs) {\n return new RenderPolicy(attrs);\n }\n\n static runScripts(attrs) {\n return new RunScripts(attrs);\n }\n\n static script(attrs) {\n return new Script(attrs);\n }\n\n static scriptModel(attrs) {\n return new ScriptModel(attrs);\n }\n\n static severity(attrs) {\n return new Severity(attrs);\n }\n\n static silentPrint(attrs) {\n return new SilentPrint(attrs);\n }\n\n static staple(attrs) {\n return new Staple(attrs);\n }\n\n static startNode(attrs) {\n return new StartNode(attrs);\n }\n\n static startPage(attrs) {\n return new StartPage(attrs);\n }\n\n static submitFormat(attrs) {\n return new SubmitFormat(attrs);\n }\n\n static submitUrl(attrs) {\n return new SubmitUrl(attrs);\n }\n\n static subsetBelow(attrs) {\n return new SubsetBelow(attrs);\n }\n\n static suppressBanner(attrs) {\n return new SuppressBanner(attrs);\n }\n\n static tagged(attrs) {\n return new Tagged(attrs);\n }\n\n static template(attrs) {\n return new Template(attrs);\n }\n\n static templateCache(attrs) {\n return new TemplateCache(attrs);\n }\n\n static threshold(attrs) {\n return new Threshold(attrs);\n }\n\n static to(attrs) {\n return new To(attrs);\n }\n\n static trace(attrs) {\n return new Trace(attrs);\n }\n\n static transform(attrs) {\n return new Transform(attrs);\n }\n\n static type(attrs) {\n return new Type(attrs);\n }\n\n static uri(attrs) {\n return new Uri(attrs);\n }\n\n static validate(attrs) {\n return new Validate(attrs);\n }\n\n static validateApprovalSignatures(attrs) {\n return new ValidateApprovalSignatures(attrs);\n }\n\n static validationMessaging(attrs) {\n return new ValidationMessaging(attrs);\n }\n\n static version(attrs) {\n return new Version(attrs);\n }\n\n static versionControl(attrs) {\n return new VersionControl(attrs);\n }\n\n static viewerPreferences(attrs) {\n return new ViewerPreferences(attrs);\n }\n\n static webClient(attrs) {\n return new WebClient(attrs);\n }\n\n static whitespace(attrs) {\n return new Whitespace(attrs);\n }\n\n static window(attrs) {\n return new Window(attrs);\n }\n\n static xdc(attrs) {\n return new Xdc(attrs);\n }\n\n static xdp(attrs) {\n return new Xdp(attrs);\n }\n\n static xsl(attrs) {\n return new Xsl(attrs);\n }\n\n static zpl(attrs) {\n return new Zpl(attrs);\n }\n}\n\nexport { ConfigNamespace };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { $buildXFAObject, NamespaceIds } from \"./namespaces.js\";\nimport { StringObject, XFAObject, XFAObjectArray } from \"./xfa_object.js\";\n\nconst CONNECTION_SET_NS_ID = NamespaceIds.connectionSet.id;\n\nclass ConnectionSet extends XFAObject {\n constructor(attributes) {\n super(CONNECTION_SET_NS_ID, \"connectionSet\", /* hasChildren = */ true);\n this.wsdlConnection = new XFAObjectArray();\n this.xmlConnection = new XFAObjectArray();\n this.xsdConnection = new XFAObjectArray();\n }\n}\n\nclass EffectiveInputPolicy extends XFAObject {\n constructor(attributes) {\n super(CONNECTION_SET_NS_ID, \"effectiveInputPolicy\");\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass EffectiveOutputPolicy extends XFAObject {\n constructor(attributes) {\n super(CONNECTION_SET_NS_ID, \"effectiveOutputPolicy\");\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass Operation extends StringObject {\n constructor(attributes) {\n super(CONNECTION_SET_NS_ID, \"operation\");\n this.id = attributes.id || \"\";\n this.input = attributes.input || \"\";\n this.name = attributes.name || \"\";\n this.output = attributes.output || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass RootElement extends StringObject {\n constructor(attributes) {\n super(CONNECTION_SET_NS_ID, \"rootElement\");\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass SoapAction extends StringObject {\n constructor(attributes) {\n super(CONNECTION_SET_NS_ID, \"soapAction\");\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass SoapAddress extends StringObject {\n constructor(attributes) {\n super(CONNECTION_SET_NS_ID, \"soapAddress\");\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass Uri extends StringObject {\n constructor(attributes) {\n super(CONNECTION_SET_NS_ID, \"uri\");\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass WsdlAddress extends StringObject {\n constructor(attributes) {\n super(CONNECTION_SET_NS_ID, \"wsdlAddress\");\n this.id = attributes.id || \"\";\n this.name = attributes.name || \"\";\n this.use = attributes.use || \"\";\n this.usehref = attributes.usehref || \"\";\n }\n}\n\nclass WsdlConnection extends XFAObject {\n constructor(attributes) {\n super(CONNECTION_SET_NS_ID, \"wsdlConnection\", /* hasChildren = */ true);\n this.dataDescription = attributes.dataDescription || \"\";\n this.name = attributes.name || \"\";\n this.effectiveInputPolicy = null;\n this.effectiveOutputPolicy = null;\n this.operation = null;\n this.soapAction = null;\n this.soapAddress = null;\n this.wsdlAddress = null;\n }\n}\n\nclass XmlConnection extends XFAObject {\n constructor(attributes) {\n super(CONNECTION_SET_NS_ID, \"xmlConnection\", /* hasChildren = */ true);\n this.dataDescription = attributes.dataDescription || \"\";\n this.name = attributes.name || \"\";\n this.uri = null;\n }\n}\n\nclass XsdConnection extends XFAObject {\n constructor(attributes) {\n super(CONNECTION_SET_NS_ID, \"xsdConnection\", /* hasChildren = */ true);\n this.dataDescription = attributes.dataDescription || \"\";\n this.name = attributes.name || \"\";\n this.rootElement = null;\n this.uri = null;\n }\n}\n\nclass ConnectionSetNamespace {\n static [$buildXFAObject](name, attributes) {\n if (ConnectionSetNamespace.hasOwnProperty(name)) {\n return ConnectionSetNamespace[name](attributes);\n }\n return undefined;\n }\n\n static connectionSet(attrs) {\n return new ConnectionSet(attrs);\n }\n\n static effectiveInputPolicy(attrs) {\n return new EffectiveInputPolicy(attrs);\n }\n\n static effectiveOutputPolicy(attrs) {\n return new EffectiveOutputPolicy(attrs);\n }\n\n static operation(attrs) {\n return new Operation(attrs);\n }\n\n static rootElement(attrs) {\n return new RootElement(attrs);\n }\n\n static soapAction(attrs) {\n return new SoapAction(attrs);\n }\n\n static soapAddress(attrs) {\n return new SoapAddress(attrs);\n }\n\n static uri(attrs) {\n return new Uri(attrs);\n }\n\n static wsdlAddress(attrs) {\n return new WsdlAddress(attrs);\n }\n\n static wsdlConnection(attrs) {\n return new WsdlConnection(attrs);\n }\n\n static xmlConnection(attrs) {\n return new XmlConnection(attrs);\n }\n\n static xsdConnection(attrs) {\n return new XsdConnection(attrs);\n }\n}\n\nexport { ConnectionSetNamespace };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n $appendChild,\n $isNsAgnostic,\n $namespaceId,\n $nodeName,\n $onChild,\n} from \"./symbol_utils.js\";\nimport { $buildXFAObject, NamespaceIds } from \"./namespaces.js\";\nimport { XFAObject, XmlObject } from \"./xfa_object.js\";\n\nconst DATASETS_NS_ID = NamespaceIds.datasets.id;\n\nclass Data extends XmlObject {\n constructor(attributes) {\n super(DATASETS_NS_ID, \"data\", attributes);\n }\n\n [$isNsAgnostic]() {\n return true;\n }\n}\n\nclass Datasets extends XFAObject {\n constructor(attributes) {\n super(DATASETS_NS_ID, \"datasets\", /* hasChildren = */ true);\n this.data = null;\n this.Signature = null;\n }\n\n [$onChild](child) {\n const name = child[$nodeName];\n if (\n (name === \"data\" && child[$namespaceId] === DATASETS_NS_ID) ||\n (name === \"Signature\" &&\n child[$namespaceId] === NamespaceIds.signature.id)\n ) {\n this[name] = child;\n }\n this[$appendChild](child);\n }\n}\n\nclass DatasetsNamespace {\n static [$buildXFAObject](name, attributes) {\n if (DatasetsNamespace.hasOwnProperty(name)) {\n return DatasetsNamespace[name](attributes);\n }\n return undefined;\n }\n\n static datasets(attributes) {\n return new Datasets(attributes);\n }\n\n static data(attributes) {\n return new Data(attributes);\n }\n}\n\nexport { DatasetsNamespace };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { $buildXFAObject, NamespaceIds } from \"./namespaces.js\";\nimport {\n ContentObject,\n StringObject,\n XFAObject,\n XFAObjectArray,\n} from \"./xfa_object.js\";\nimport { getInteger, getStringOption } from \"./utils.js\";\n\nconst LOCALE_SET_NS_ID = NamespaceIds.localeSet.id;\n\nclass CalendarSymbols extends XFAObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"calendarSymbols\", /* hasChildren = */ true);\n this.name = \"gregorian\";\n this.dayNames = new XFAObjectArray(2);\n this.eraNames = null;\n this.meridiemNames = null;\n this.monthNames = new XFAObjectArray(2);\n }\n}\n\nclass CurrencySymbol extends StringObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"currencySymbol\");\n this.name = getStringOption(attributes.name, [\n \"symbol\",\n \"isoname\",\n \"decimal\",\n ]);\n }\n}\n\nclass CurrencySymbols extends XFAObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"currencySymbols\", /* hasChildren = */ true);\n this.currencySymbol = new XFAObjectArray(3);\n }\n}\n\nclass DatePattern extends StringObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"datePattern\");\n this.name = getStringOption(attributes.name, [\n \"full\",\n \"long\",\n \"med\",\n \"short\",\n ]);\n }\n}\n\nclass DatePatterns extends XFAObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"datePatterns\", /* hasChildren = */ true);\n this.datePattern = new XFAObjectArray(4);\n }\n}\n\nclass DateTimeSymbols extends ContentObject {\n // TODO: spec unclear about the format of the array.\n\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"dateTimeSymbols\");\n }\n}\n\nclass Day extends StringObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"day\");\n }\n}\n\nclass DayNames extends XFAObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"dayNames\", /* hasChildren = */ true);\n this.abbr = getInteger({\n data: attributes.abbr,\n defaultValue: 0,\n validate: x => x === 1,\n });\n this.day = new XFAObjectArray(7);\n }\n}\n\nclass Era extends StringObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"era\");\n }\n}\n\nclass EraNames extends XFAObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"eraNames\", /* hasChildren = */ true);\n this.era = new XFAObjectArray(2);\n }\n}\n\nclass Locale extends XFAObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"locale\", /* hasChildren = */ true);\n this.desc = attributes.desc || \"\";\n this.name = \"isoname\";\n this.calendarSymbols = null;\n this.currencySymbols = null;\n this.datePatterns = null;\n this.dateTimeSymbols = null;\n this.numberPatterns = null;\n this.numberSymbols = null;\n this.timePatterns = null;\n this.typeFaces = null;\n }\n}\n\nclass LocaleSet extends XFAObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"localeSet\", /* hasChildren = */ true);\n this.locale = new XFAObjectArray();\n }\n}\n\nclass Meridiem extends StringObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"meridiem\");\n }\n}\n\nclass MeridiemNames extends XFAObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"meridiemNames\", /* hasChildren = */ true);\n this.meridiem = new XFAObjectArray(2);\n }\n}\n\nclass Month extends StringObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"month\");\n }\n}\n\nclass MonthNames extends XFAObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"monthNames\", /* hasChildren = */ true);\n this.abbr = getInteger({\n data: attributes.abbr,\n defaultValue: 0,\n validate: x => x === 1,\n });\n this.month = new XFAObjectArray(12);\n }\n}\n\nclass NumberPattern extends StringObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"numberPattern\");\n this.name = getStringOption(attributes.name, [\n \"full\",\n \"long\",\n \"med\",\n \"short\",\n ]);\n }\n}\n\nclass NumberPatterns extends XFAObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"numberPatterns\", /* hasChildren = */ true);\n this.numberPattern = new XFAObjectArray(4);\n }\n}\n\nclass NumberSymbol extends StringObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"numberSymbol\");\n this.name = getStringOption(attributes.name, [\n \"decimal\",\n \"grouping\",\n \"percent\",\n \"minus\",\n \"zero\",\n ]);\n }\n}\n\nclass NumberSymbols extends XFAObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"numberSymbols\", /* hasChildren = */ true);\n this.numberSymbol = new XFAObjectArray(5);\n }\n}\n\nclass TimePattern extends StringObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"timePattern\");\n this.name = getStringOption(attributes.name, [\n \"full\",\n \"long\",\n \"med\",\n \"short\",\n ]);\n }\n}\n\nclass TimePatterns extends XFAObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"timePatterns\", /* hasChildren = */ true);\n this.timePattern = new XFAObjectArray(4);\n }\n}\n\nclass TypeFace extends XFAObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"typeFace\", /* hasChildren = */ true);\n this.name = attributes.name | \"\";\n }\n}\n\nclass TypeFaces extends XFAObject {\n constructor(attributes) {\n super(LOCALE_SET_NS_ID, \"typeFaces\", /* hasChildren = */ true);\n this.typeFace = new XFAObjectArray();\n }\n}\n\nclass LocaleSetNamespace {\n static [$buildXFAObject](name, attributes) {\n if (LocaleSetNamespace.hasOwnProperty(name)) {\n return LocaleSetNamespace[name](attributes);\n }\n return undefined;\n }\n\n static calendarSymbols(attrs) {\n return new CalendarSymbols(attrs);\n }\n\n static currencySymbol(attrs) {\n return new CurrencySymbol(attrs);\n }\n\n static currencySymbols(attrs) {\n return new CurrencySymbols(attrs);\n }\n\n static datePattern(attrs) {\n return new DatePattern(attrs);\n }\n\n static datePatterns(attrs) {\n return new DatePatterns(attrs);\n }\n\n static dateTimeSymbols(attrs) {\n return new DateTimeSymbols(attrs);\n }\n\n static day(attrs) {\n return new Day(attrs);\n }\n\n static dayNames(attrs) {\n return new DayNames(attrs);\n }\n\n static era(attrs) {\n return new Era(attrs);\n }\n\n static eraNames(attrs) {\n return new EraNames(attrs);\n }\n\n static locale(attrs) {\n return new Locale(attrs);\n }\n\n static localeSet(attrs) {\n return new LocaleSet(attrs);\n }\n\n static meridiem(attrs) {\n return new Meridiem(attrs);\n }\n\n static meridiemNames(attrs) {\n return new MeridiemNames(attrs);\n }\n\n static month(attrs) {\n return new Month(attrs);\n }\n\n static monthNames(attrs) {\n return new MonthNames(attrs);\n }\n\n static numberPattern(attrs) {\n return new NumberPattern(attrs);\n }\n\n static numberPatterns(attrs) {\n return new NumberPatterns(attrs);\n }\n\n static numberSymbol(attrs) {\n return new NumberSymbol(attrs);\n }\n\n static numberSymbols(attrs) {\n return new NumberSymbols(attrs);\n }\n\n static timePattern(attrs) {\n return new TimePattern(attrs);\n }\n\n static timePatterns(attrs) {\n return new TimePatterns(attrs);\n }\n\n static typeFace(attrs) {\n return new TypeFace(attrs);\n }\n\n static typeFaces(attrs) {\n return new TypeFaces(attrs);\n }\n}\n\nexport { LocaleSetNamespace };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { $buildXFAObject, NamespaceIds } from \"./namespaces.js\";\nimport { XFAObject } from \"./xfa_object.js\";\n\nconst SIGNATURE_NS_ID = NamespaceIds.signature.id;\n\nclass Signature extends XFAObject {\n constructor(attributes) {\n super(SIGNATURE_NS_ID, \"signature\", /* hasChildren = */ true);\n }\n}\n\nclass SignatureNamespace {\n static [$buildXFAObject](name, attributes) {\n if (SignatureNamespace.hasOwnProperty(name)) {\n return SignatureNamespace[name](attributes);\n }\n return undefined;\n }\n\n static signature(attributes) {\n return new Signature(attributes);\n }\n}\n\nexport { SignatureNamespace };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { $buildXFAObject, NamespaceIds } from \"./namespaces.js\";\nimport { XFAObject } from \"./xfa_object.js\";\n\nconst STYLESHEET_NS_ID = NamespaceIds.stylesheet.id;\n\nclass Stylesheet extends XFAObject {\n constructor(attributes) {\n super(STYLESHEET_NS_ID, \"stylesheet\", /* hasChildren = */ true);\n }\n}\n\nclass StylesheetNamespace {\n static [$buildXFAObject](name, attributes) {\n if (StylesheetNamespace.hasOwnProperty(name)) {\n return StylesheetNamespace[name](attributes);\n }\n return undefined;\n }\n\n static stylesheet(attributes) {\n return new Stylesheet(attributes);\n }\n}\n\nexport { StylesheetNamespace };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { $buildXFAObject, NamespaceIds } from \"./namespaces.js\";\nimport { $namespaceId, $nodeName, $onChildCheck } from \"./symbol_utils.js\";\nimport { XFAObject, XFAObjectArray } from \"./xfa_object.js\";\n\nconst XDP_NS_ID = NamespaceIds.xdp.id;\n\nclass Xdp extends XFAObject {\n constructor(attributes) {\n super(XDP_NS_ID, \"xdp\", /* hasChildren = */ true);\n this.uuid = attributes.uuid || \"\";\n this.timeStamp = attributes.timeStamp || \"\";\n this.config = null;\n this.connectionSet = null;\n this.datasets = null;\n this.localeSet = null;\n this.stylesheet = new XFAObjectArray();\n this.template = null;\n }\n\n [$onChildCheck](child) {\n const ns = NamespaceIds[child[$nodeName]];\n return ns && child[$namespaceId] === ns.id;\n }\n}\n\nclass XdpNamespace {\n static [$buildXFAObject](name, attributes) {\n if (XdpNamespace.hasOwnProperty(name)) {\n return XdpNamespace[name](attributes);\n }\n return undefined;\n }\n\n static xdp(attributes) {\n return new Xdp(attributes);\n }\n}\n\nexport { XdpNamespace };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n $acceptWhitespace,\n $childrenToHTML,\n $clean,\n $content,\n $extra,\n $getChildren,\n $getParent,\n $globalData,\n $nodeName,\n $onText,\n $pushGlyphs,\n $text,\n $toHTML,\n} from \"./symbol_utils.js\";\nimport { $buildXFAObject, NamespaceIds } from \"./namespaces.js\";\nimport {\n fixTextIndent,\n fixURL,\n measureToString,\n setFontFamily,\n} from \"./html_utils.js\";\nimport { getMeasurement, HTMLResult, stripQuotes } from \"./utils.js\";\nimport { XmlObject } from \"./xfa_object.js\";\n\nconst XHTML_NS_ID = NamespaceIds.xhtml.id;\nconst $richText = Symbol();\n\nconst VALID_STYLES = new Set([\n \"color\",\n \"font\",\n \"font-family\",\n \"font-size\",\n \"font-stretch\",\n \"font-style\",\n \"font-weight\",\n \"margin\",\n \"margin-bottom\",\n \"margin-left\",\n \"margin-right\",\n \"margin-top\",\n \"letter-spacing\",\n \"line-height\",\n \"orphans\",\n \"page-break-after\",\n \"page-break-before\",\n \"page-break-inside\",\n \"tab-interval\",\n \"tab-stop\",\n \"text-align\",\n \"text-decoration\",\n \"text-indent\",\n \"vertical-align\",\n \"widows\",\n \"kerning-mode\",\n \"xfa-font-horizontal-scale\",\n \"xfa-font-vertical-scale\",\n \"xfa-spacerun\",\n \"xfa-tab-stops\",\n]);\n\nconst StyleMapping = new Map([\n [\"page-break-after\", \"breakAfter\"],\n [\"page-break-before\", \"breakBefore\"],\n [\"page-break-inside\", \"breakInside\"],\n [\"kerning-mode\", value => (value === \"none\" ? \"none\" : \"normal\")],\n [\n \"xfa-font-horizontal-scale\",\n value =>\n `scaleX(${Math.max(0, Math.min(parseInt(value) / 100)).toFixed(2)})`,\n ],\n [\n \"xfa-font-vertical-scale\",\n value =>\n `scaleY(${Math.max(0, Math.min(parseInt(value) / 100)).toFixed(2)})`,\n ],\n [\"xfa-spacerun\", \"\"],\n [\"xfa-tab-stops\", \"\"],\n [\n \"font-size\",\n (value, original) => {\n value = original.fontSize = getMeasurement(value);\n return measureToString(0.99 * value);\n },\n ],\n [\"letter-spacing\", value => measureToString(getMeasurement(value))],\n [\"line-height\", value => measureToString(getMeasurement(value))],\n [\"margin\", value => measureToString(getMeasurement(value))],\n [\"margin-bottom\", value => measureToString(getMeasurement(value))],\n [\"margin-left\", value => measureToString(getMeasurement(value))],\n [\"margin-right\", value => measureToString(getMeasurement(value))],\n [\"margin-top\", value => measureToString(getMeasurement(value))],\n [\"text-indent\", value => measureToString(getMeasurement(value))],\n [\"font-family\", value => value],\n [\"vertical-align\", value => measureToString(getMeasurement(value))],\n]);\n\nconst spacesRegExp = /\\s+/g;\nconst crlfRegExp = /[\\r\\n]+/g;\nconst crlfForRichTextRegExp = /\\r\\n?/g;\n\nfunction mapStyle(styleStr, node, richText) {\n const style = Object.create(null);\n if (!styleStr) {\n return style;\n }\n const original = Object.create(null);\n for (const [key, value] of styleStr.split(\";\").map(s => s.split(\":\", 2))) {\n const mapping = StyleMapping.get(key);\n if (mapping === \"\") {\n continue;\n }\n let newValue = value;\n if (mapping) {\n newValue =\n typeof mapping === \"string\" ? mapping : mapping(value, original);\n }\n if (key.endsWith(\"scale\")) {\n style.transform = style.transform\n ? `${style[key]} ${newValue}`\n : newValue;\n } else {\n style[key.replaceAll(/-([a-zA-Z])/g, (_, x) => x.toUpperCase())] =\n newValue;\n }\n }\n\n if (style.fontFamily) {\n setFontFamily(\n {\n typeface: style.fontFamily,\n weight: style.fontWeight || \"normal\",\n posture: style.fontStyle || \"normal\",\n size: original.fontSize || 0,\n },\n node,\n node[$globalData].fontFinder,\n style\n );\n }\n\n if (\n richText &&\n style.verticalAlign &&\n style.verticalAlign !== \"0px\" &&\n style.fontSize\n ) {\n // A non-zero verticalAlign means that we've a sub/super-script and\n // consequently the font size must be decreased.\n // https://www.adobe.com/content/dam/acom/en/devnet/pdf/pdfs/PDF32000_2008.pdf#G11.2097514\n // And the two following factors to position the scripts have been\n // found here:\n // https://en.wikipedia.org/wiki/Subscript_and_superscript#Desktop_publishing\n const SUB_SUPER_SCRIPT_FACTOR = 0.583;\n const VERTICAL_FACTOR = 0.333;\n const fontSize = getMeasurement(style.fontSize);\n style.fontSize = measureToString(fontSize * SUB_SUPER_SCRIPT_FACTOR);\n style.verticalAlign = measureToString(\n Math.sign(getMeasurement(style.verticalAlign)) *\n fontSize *\n VERTICAL_FACTOR\n );\n }\n\n if (richText && style.fontSize) {\n style.fontSize = `calc(${style.fontSize} * var(--scale-factor))`;\n }\n\n fixTextIndent(style);\n return style;\n}\n\nfunction checkStyle(node) {\n if (!node.style) {\n return \"\";\n }\n\n // Remove any non-allowed keys.\n return node.style\n .trim()\n .split(/\\s*;\\s*/)\n .filter(s => !!s)\n .map(s => s.split(/\\s*:\\s*/, 2))\n .filter(([key, value]) => {\n if (key === \"font-family\") {\n node[$globalData].usedTypefaces.add(value);\n }\n return VALID_STYLES.has(key);\n })\n .map(kv => kv.join(\":\"))\n .join(\";\");\n}\n\nconst NoWhites = new Set([\"body\", \"html\"]);\n\nclass XhtmlObject extends XmlObject {\n constructor(attributes, name) {\n super(XHTML_NS_ID, name);\n this[$richText] = false;\n this.style = attributes.style || \"\";\n }\n\n [$clean](builder) {\n super[$clean](builder);\n this.style = checkStyle(this);\n }\n\n [$acceptWhitespace]() {\n return !NoWhites.has(this[$nodeName]);\n }\n\n [$onText](str, richText = false) {\n if (!richText) {\n str = str.replaceAll(crlfRegExp, \"\");\n if (!this.style.includes(\"xfa-spacerun:yes\")) {\n str = str.replaceAll(spacesRegExp, \" \");\n }\n } else {\n this[$richText] = true;\n }\n\n if (str) {\n this[$content] += str;\n }\n }\n\n [$pushGlyphs](measure, mustPop = true) {\n const xfaFont = Object.create(null);\n const margin = {\n top: NaN,\n bottom: NaN,\n left: NaN,\n right: NaN,\n };\n let lineHeight = null;\n for (const [key, value] of this.style\n .split(\";\")\n .map(s => s.split(\":\", 2))) {\n switch (key) {\n case \"font-family\":\n xfaFont.typeface = stripQuotes(value);\n break;\n case \"font-size\":\n xfaFont.size = getMeasurement(value);\n break;\n case \"font-weight\":\n xfaFont.weight = value;\n break;\n case \"font-style\":\n xfaFont.posture = value;\n break;\n case \"letter-spacing\":\n xfaFont.letterSpacing = getMeasurement(value);\n break;\n case \"margin\":\n const values = value.split(/ \\t/).map(x => getMeasurement(x));\n switch (values.length) {\n case 1:\n margin.top =\n margin.bottom =\n margin.left =\n margin.right =\n values[0];\n break;\n case 2:\n margin.top = margin.bottom = values[0];\n margin.left = margin.right = values[1];\n break;\n case 3:\n margin.top = values[0];\n margin.bottom = values[2];\n margin.left = margin.right = values[1];\n break;\n case 4:\n margin.top = values[0];\n margin.left = values[1];\n margin.bottom = values[2];\n margin.right = values[3];\n break;\n }\n break;\n case \"margin-top\":\n margin.top = getMeasurement(value);\n break;\n case \"margin-bottom\":\n margin.bottom = getMeasurement(value);\n break;\n case \"margin-left\":\n margin.left = getMeasurement(value);\n break;\n case \"margin-right\":\n margin.right = getMeasurement(value);\n break;\n case \"line-height\":\n lineHeight = getMeasurement(value);\n break;\n }\n }\n\n measure.pushData(xfaFont, margin, lineHeight);\n\n if (this[$content]) {\n measure.addString(this[$content]);\n } else {\n for (const child of this[$getChildren]()) {\n if (child[$nodeName] === \"#text\") {\n measure.addString(child[$content]);\n continue;\n }\n child[$pushGlyphs](measure);\n }\n }\n\n if (mustPop) {\n measure.popFont();\n }\n }\n\n [$toHTML](availableSpace) {\n const children = [];\n this[$extra] = {\n children,\n };\n\n this[$childrenToHTML]({});\n\n if (children.length === 0 && !this[$content]) {\n return HTMLResult.EMPTY;\n }\n\n let value;\n if (this[$richText]) {\n value = this[$content]\n ? this[$content].replaceAll(crlfForRichTextRegExp, \"\\n\")\n : undefined;\n } else {\n value = this[$content] || undefined;\n }\n\n return HTMLResult.success({\n name: this[$nodeName],\n attributes: {\n href: this.href,\n style: mapStyle(this.style, this, this[$richText]),\n },\n children,\n value,\n });\n }\n}\n\nclass A extends XhtmlObject {\n constructor(attributes) {\n super(attributes, \"a\");\n this.href = fixURL(attributes.href) || \"\";\n }\n}\n\nclass B extends XhtmlObject {\n constructor(attributes) {\n super(attributes, \"b\");\n }\n\n [$pushGlyphs](measure) {\n measure.pushFont({ weight: \"bold\" });\n super[$pushGlyphs](measure);\n measure.popFont();\n }\n}\n\nclass Body extends XhtmlObject {\n constructor(attributes) {\n super(attributes, \"body\");\n }\n\n [$toHTML](availableSpace) {\n const res = super[$toHTML](availableSpace);\n const { html } = res;\n if (!html) {\n return HTMLResult.EMPTY;\n }\n html.name = \"div\";\n html.attributes.class = [\"xfaRich\"];\n return res;\n }\n}\n\nclass Br extends XhtmlObject {\n constructor(attributes) {\n super(attributes, \"br\");\n }\n\n [$text]() {\n return \"\\n\";\n }\n\n [$pushGlyphs](measure) {\n measure.addString(\"\\n\");\n }\n\n [$toHTML](availableSpace) {\n return HTMLResult.success({\n name: \"br\",\n });\n }\n}\n\nclass Html extends XhtmlObject {\n constructor(attributes) {\n super(attributes, \"html\");\n }\n\n [$toHTML](availableSpace) {\n const children = [];\n this[$extra] = {\n children,\n };\n\n this[$childrenToHTML]({});\n if (children.length === 0) {\n return HTMLResult.success({\n name: \"div\",\n attributes: {\n class: [\"xfaRich\"],\n style: {},\n },\n value: this[$content] || \"\",\n });\n }\n\n if (children.length === 1) {\n const child = children[0];\n if (child.attributes?.class.includes(\"xfaRich\")) {\n return HTMLResult.success(child);\n }\n }\n\n return HTMLResult.success({\n name: \"div\",\n attributes: {\n class: [\"xfaRich\"],\n style: {},\n },\n children,\n });\n }\n}\n\nclass I extends XhtmlObject {\n constructor(attributes) {\n super(attributes, \"i\");\n }\n\n [$pushGlyphs](measure) {\n measure.pushFont({ posture: \"italic\" });\n super[$pushGlyphs](measure);\n measure.popFont();\n }\n}\n\nclass Li extends XhtmlObject {\n constructor(attributes) {\n super(attributes, \"li\");\n }\n}\n\nclass Ol extends XhtmlObject {\n constructor(attributes) {\n super(attributes, \"ol\");\n }\n}\n\nclass P extends XhtmlObject {\n constructor(attributes) {\n super(attributes, \"p\");\n }\n\n [$pushGlyphs](measure) {\n super[$pushGlyphs](measure, /* mustPop = */ false);\n measure.addString(\"\\n\");\n measure.addPara();\n measure.popFont();\n }\n\n [$text]() {\n const siblings = this[$getParent]()[$getChildren]();\n if (siblings.at(-1) === this) {\n return super[$text]();\n }\n return super[$text]() + \"\\n\";\n }\n}\n\nclass Span extends XhtmlObject {\n constructor(attributes) {\n super(attributes, \"span\");\n }\n}\n\nclass Sub extends XhtmlObject {\n constructor(attributes) {\n super(attributes, \"sub\");\n }\n}\n\nclass Sup extends XhtmlObject {\n constructor(attributes) {\n super(attributes, \"sup\");\n }\n}\n\nclass Ul extends XhtmlObject {\n constructor(attributes) {\n super(attributes, \"ul\");\n }\n}\n\nclass XhtmlNamespace {\n static [$buildXFAObject](name, attributes) {\n if (XhtmlNamespace.hasOwnProperty(name)) {\n return XhtmlNamespace[name](attributes);\n }\n return undefined;\n }\n\n static a(attributes) {\n return new A(attributes);\n }\n\n static b(attributes) {\n return new B(attributes);\n }\n\n static body(attributes) {\n return new Body(attributes);\n }\n\n static br(attributes) {\n return new Br(attributes);\n }\n\n static html(attributes) {\n return new Html(attributes);\n }\n\n static i(attributes) {\n return new I(attributes);\n }\n\n static li(attributes) {\n return new Li(attributes);\n }\n\n static ol(attributes) {\n return new Ol(attributes);\n }\n\n static p(attributes) {\n return new P(attributes);\n }\n\n static span(attributes) {\n return new Span(attributes);\n }\n\n static sub(attributes) {\n return new Sub(attributes);\n }\n\n static sup(attributes) {\n return new Sup(attributes);\n }\n\n static ul(attributes) {\n return new Ul(attributes);\n }\n}\n\nexport { XhtmlNamespace };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { ConfigNamespace } from \"./config.js\";\nimport { ConnectionSetNamespace } from \"./connection_set.js\";\nimport { DatasetsNamespace } from \"./datasets.js\";\nimport { LocaleSetNamespace } from \"./locale_set.js\";\nimport { SignatureNamespace } from \"./signature.js\";\nimport { StylesheetNamespace } from \"./stylesheet.js\";\nimport { TemplateNamespace } from \"./template.js\";\nimport { XdpNamespace } from \"./xdp.js\";\nimport { XhtmlNamespace } from \"./xhtml.js\";\n\nconst NamespaceSetUp = {\n config: ConfigNamespace,\n connection: ConnectionSetNamespace,\n datasets: DatasetsNamespace,\n localeSet: LocaleSetNamespace,\n signature: SignatureNamespace,\n stylesheet: StylesheetNamespace,\n template: TemplateNamespace,\n xdp: XdpNamespace,\n xhtml: XhtmlNamespace,\n};\n\nexport { NamespaceSetUp };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { $buildXFAObject } from \"./namespaces.js\";\nimport { XmlObject } from \"./xfa_object.js\";\n\nclass UnknownNamespace {\n constructor(nsId) {\n this.namespaceId = nsId;\n }\n\n [$buildXFAObject](name, attributes) {\n return new XmlObject(this.namespaceId, name, attributes);\n }\n}\n\nexport { UnknownNamespace };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { $buildXFAObject, NamespaceIds } from \"./namespaces.js\";\nimport {\n $cleanup,\n $finalize,\n $ids,\n $isNsAgnostic,\n $nsAttributes,\n $onChild,\n $resolvePrototypes,\n $root,\n} from \"./symbol_utils.js\";\nimport { NamespaceSetUp } from \"./setup.js\";\nimport { Template } from \"./template.js\";\nimport { UnknownNamespace } from \"./unknown.js\";\nimport { warn } from \"../../shared/util.js\";\nimport { XFAObject } from \"./xfa_object.js\";\n\nclass Root extends XFAObject {\n constructor(ids) {\n super(-1, \"root\", Object.create(null));\n this.element = null;\n this[$ids] = ids;\n }\n\n [$onChild](child) {\n this.element = child;\n return true;\n }\n\n [$finalize]() {\n super[$finalize]();\n if (this.element.template instanceof Template) {\n // Set the root element in $ids using a symbol in order\n // to avoid conflict with real IDs.\n this[$ids].set($root, this.element);\n\n this.element.template[$resolvePrototypes](this[$ids]);\n this.element.template[$ids] = this[$ids];\n }\n }\n}\n\nclass Empty extends XFAObject {\n constructor() {\n super(-1, \"\", Object.create(null));\n }\n\n [$onChild](_) {\n return false;\n }\n}\n\nclass Builder {\n constructor(rootNameSpace = null) {\n this._namespaceStack = [];\n this._nsAgnosticLevel = 0;\n\n // Each prefix has its own stack\n this._namespacePrefixes = new Map();\n this._namespaces = new Map();\n this._nextNsId = Math.max(\n ...Object.values(NamespaceIds).map(({ id }) => id)\n );\n this._currentNamespace =\n rootNameSpace || new UnknownNamespace(++this._nextNsId);\n }\n\n buildRoot(ids) {\n return new Root(ids);\n }\n\n build({ nsPrefix, name, attributes, namespace, prefixes }) {\n const hasNamespaceDef = namespace !== null;\n if (hasNamespaceDef) {\n // Define the current namespace to use.\n this._namespaceStack.push(this._currentNamespace);\n this._currentNamespace = this._searchNamespace(namespace);\n }\n\n if (prefixes) {\n // The xml node may have namespace prefix definitions\n this._addNamespacePrefix(prefixes);\n }\n\n if (attributes.hasOwnProperty($nsAttributes)) {\n // Only support xfa-data namespace.\n const dataTemplate = NamespaceSetUp.datasets;\n const nsAttrs = attributes[$nsAttributes];\n let xfaAttrs = null;\n for (const [ns, attrs] of Object.entries(nsAttrs)) {\n const nsToUse = this._getNamespaceToUse(ns);\n if (nsToUse === dataTemplate) {\n xfaAttrs = { xfa: attrs };\n break;\n }\n }\n if (xfaAttrs) {\n attributes[$nsAttributes] = xfaAttrs;\n } else {\n delete attributes[$nsAttributes];\n }\n }\n\n const namespaceToUse = this._getNamespaceToUse(nsPrefix);\n const node =\n namespaceToUse?.[$buildXFAObject](name, attributes) || new Empty();\n\n if (node[$isNsAgnostic]()) {\n this._nsAgnosticLevel++;\n }\n\n // In case the node has some namespace things,\n // we must pop the different stacks.\n if (hasNamespaceDef || prefixes || node[$isNsAgnostic]()) {\n node[$cleanup] = {\n hasNamespace: hasNamespaceDef,\n prefixes,\n nsAgnostic: node[$isNsAgnostic](),\n };\n }\n\n return node;\n }\n\n isNsAgnostic() {\n return this._nsAgnosticLevel > 0;\n }\n\n _searchNamespace(nsName) {\n let ns = this._namespaces.get(nsName);\n if (ns) {\n return ns;\n }\n for (const [name, { check }] of Object.entries(NamespaceIds)) {\n if (check(nsName)) {\n ns = NamespaceSetUp[name];\n if (ns) {\n this._namespaces.set(nsName, ns);\n return ns;\n }\n // The namespace is known but not handled.\n break;\n }\n }\n\n ns = new UnknownNamespace(++this._nextNsId);\n this._namespaces.set(nsName, ns);\n return ns;\n }\n\n _addNamespacePrefix(prefixes) {\n for (const { prefix, value } of prefixes) {\n const namespace = this._searchNamespace(value);\n let prefixStack = this._namespacePrefixes.get(prefix);\n if (!prefixStack) {\n prefixStack = [];\n this._namespacePrefixes.set(prefix, prefixStack);\n }\n prefixStack.push(namespace);\n }\n }\n\n _getNamespaceToUse(prefix) {\n if (!prefix) {\n return this._currentNamespace;\n }\n const prefixStack = this._namespacePrefixes.get(prefix);\n if (prefixStack?.length > 0) {\n return prefixStack.at(-1);\n }\n\n warn(`Unknown namespace prefix: ${prefix}.`);\n return null;\n }\n\n clean(data) {\n const { hasNamespace, prefixes, nsAgnostic } = data;\n if (hasNamespace) {\n this._currentNamespace = this._namespaceStack.pop();\n }\n if (prefixes) {\n prefixes.forEach(({ prefix }) => {\n this._namespacePrefixes.get(prefix).pop();\n });\n }\n if (nsAgnostic) {\n this._nsAgnosticLevel--;\n }\n }\n}\n\nexport { Builder };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n $acceptWhitespace,\n $clean,\n $content,\n $finalize,\n $globalData,\n $isCDATAXml,\n $nsAttributes,\n $onChild,\n $onText,\n $setId,\n} from \"./symbol_utils.js\";\nimport { XMLParserBase, XMLParserErrorCode } from \"../xml_parser.js\";\nimport { Builder } from \"./builder.js\";\nimport { warn } from \"../../shared/util.js\";\n\nclass XFAParser extends XMLParserBase {\n constructor(rootNameSpace = null, richText = false) {\n super();\n this._builder = new Builder(rootNameSpace);\n this._stack = [];\n this._globalData = {\n usedTypefaces: new Set(),\n };\n this._ids = new Map();\n this._current = this._builder.buildRoot(this._ids);\n this._errorCode = XMLParserErrorCode.NoError;\n this._whiteRegex = /^\\s+$/;\n this._nbsps = /\\xa0+/g;\n this._richText = richText;\n }\n\n parse(data) {\n this.parseXml(data);\n\n if (this._errorCode !== XMLParserErrorCode.NoError) {\n return undefined;\n }\n\n this._current[$finalize]();\n\n return this._current.element;\n }\n\n onText(text) {\n // Normally by definition a   is unbreakable\n // but in real life Acrobat can break strings on  .\n text = text.replace(this._nbsps, match => match.slice(1) + \" \");\n if (this._richText || this._current[$acceptWhitespace]()) {\n this._current[$onText](text, this._richText);\n return;\n }\n\n if (this._whiteRegex.test(text)) {\n return;\n }\n this._current[$onText](text.trim());\n }\n\n onCdata(text) {\n this._current[$onText](text);\n }\n\n _mkAttributes(attributes, tagName) {\n // Transform attributes into an object and get out\n // namespaces information.\n let namespace = null;\n let prefixes = null;\n const attributeObj = Object.create({});\n for (const { name, value } of attributes) {\n if (name === \"xmlns\") {\n if (!namespace) {\n namespace = value;\n } else {\n warn(`XFA - multiple namespace definition in <${tagName}>`);\n }\n } else if (name.startsWith(\"xmlns:\")) {\n const prefix = name.substring(\"xmlns:\".length);\n if (!prefixes) {\n prefixes = [];\n }\n prefixes.push({ prefix, value });\n } else {\n const i = name.indexOf(\":\");\n if (i === -1) {\n attributeObj[name] = value;\n } else {\n // Attributes can have their own namespace.\n // For example in data, we can have <foo xfa:dataNode=\"dataGroup\"/>\n let nsAttrs = attributeObj[$nsAttributes];\n if (!nsAttrs) {\n nsAttrs = attributeObj[$nsAttributes] = Object.create(null);\n }\n const [ns, attrName] = [name.slice(0, i), name.slice(i + 1)];\n const attrs = (nsAttrs[ns] ||= Object.create(null));\n attrs[attrName] = value;\n }\n }\n }\n\n return [namespace, prefixes, attributeObj];\n }\n\n _getNameAndPrefix(name, nsAgnostic) {\n const i = name.indexOf(\":\");\n if (i === -1) {\n return [name, null];\n }\n return [name.substring(i + 1), nsAgnostic ? \"\" : name.substring(0, i)];\n }\n\n onBeginElement(tagName, attributes, isEmpty) {\n const [namespace, prefixes, attributesObj] = this._mkAttributes(\n attributes,\n tagName\n );\n const [name, nsPrefix] = this._getNameAndPrefix(\n tagName,\n this._builder.isNsAgnostic()\n );\n const node = this._builder.build({\n nsPrefix,\n name,\n attributes: attributesObj,\n namespace,\n prefixes,\n });\n node[$globalData] = this._globalData;\n\n if (isEmpty) {\n // No children: just push the node into its parent.\n node[$finalize]();\n if (this._current[$onChild](node)) {\n node[$setId](this._ids);\n }\n node[$clean](this._builder);\n return;\n }\n\n this._stack.push(this._current);\n this._current = node;\n }\n\n onEndElement(name) {\n const node = this._current;\n if (node[$isCDATAXml]() && typeof node[$content] === \"string\") {\n const parser = new XFAParser();\n parser._globalData = this._globalData;\n const root = parser.parse(node[$content]);\n node[$content] = null;\n node[$onChild](root);\n }\n\n node[$finalize]();\n this._current = this._stack.pop();\n if (this._current[$onChild](node)) {\n node[$setId](this._ids);\n }\n node[$clean](this._builder);\n }\n\n onError(code) {\n this._errorCode = code;\n }\n}\n\nexport { XFAParser };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n $appendChild,\n $globalData,\n $nodeName,\n $text,\n $toHTML,\n $toPages,\n} from \"./symbol_utils.js\";\nimport { Binder } from \"./bind.js\";\nimport { DataHandler } from \"./data.js\";\nimport { FontFinder } from \"./fonts.js\";\nimport { stripQuotes } from \"./utils.js\";\nimport { warn } from \"../../shared/util.js\";\nimport { XFAParser } from \"./parser.js\";\nimport { XhtmlNamespace } from \"./xhtml.js\";\n\nclass XFAFactory {\n constructor(data) {\n try {\n this.root = new XFAParser().parse(XFAFactory._createDocument(data));\n const binder = new Binder(this.root);\n this.form = binder.bind();\n this.dataHandler = new DataHandler(this.root, binder.getData());\n this.form[$globalData].template = this.form;\n } catch (e) {\n warn(`XFA - an error occurred during parsing and binding: ${e}`);\n }\n }\n\n isValid() {\n return this.root && this.form;\n }\n\n /**\n * In order to avoid to block the event loop, the conversion\n * into pages is made asynchronously.\n */\n _createPagesHelper() {\n const iterator = this.form[$toPages]();\n return new Promise((resolve, reject) => {\n const nextIteration = () => {\n try {\n const value = iterator.next();\n if (value.done) {\n resolve(value.value);\n } else {\n setTimeout(nextIteration, 0);\n }\n } catch (e) {\n reject(e);\n }\n };\n setTimeout(nextIteration, 0);\n });\n }\n\n async _createPages() {\n try {\n this.pages = await this._createPagesHelper();\n this.dims = this.pages.children.map(c => {\n const { width, height } = c.attributes.style;\n return [0, 0, parseInt(width), parseInt(height)];\n });\n } catch (e) {\n warn(`XFA - an error occurred during layout: ${e}`);\n }\n }\n\n getBoundingBox(pageIndex) {\n return this.dims[pageIndex];\n }\n\n async getNumPages() {\n if (!this.pages) {\n await this._createPages();\n }\n return this.dims.length;\n }\n\n setImages(images) {\n this.form[$globalData].images = images;\n }\n\n setFonts(fonts) {\n this.form[$globalData].fontFinder = new FontFinder(fonts);\n const missingFonts = [];\n for (let typeface of this.form[$globalData].usedTypefaces) {\n typeface = stripQuotes(typeface);\n const font = this.form[$globalData].fontFinder.find(typeface);\n if (!font) {\n missingFonts.push(typeface);\n }\n }\n\n if (missingFonts.length > 0) {\n return missingFonts;\n }\n\n return null;\n }\n\n appendFonts(fonts, reallyMissingFonts) {\n this.form[$globalData].fontFinder.add(fonts, reallyMissingFonts);\n }\n\n async getPages() {\n if (!this.pages) {\n await this._createPages();\n }\n const pages = this.pages;\n this.pages = null;\n return pages;\n }\n\n serializeData(storage) {\n return this.dataHandler.serialize(storage);\n }\n\n static _createDocument(data) {\n if (!data[\"/xdp:xdp\"]) {\n return data[\"xdp:xdp\"];\n }\n return Object.values(data).join(\"\");\n }\n\n static getRichTextAsHtml(rc) {\n if (!rc || typeof rc !== \"string\") {\n return null;\n }\n\n try {\n let root = new XFAParser(XhtmlNamespace, /* richText */ true).parse(rc);\n if (![\"body\", \"xhtml\"].includes(root[$nodeName])) {\n // No body, so create one.\n const newRoot = XhtmlNamespace.body({});\n newRoot[$appendChild](root);\n root = newRoot;\n }\n\n const result = root[$toHTML]();\n if (!result.success) {\n return null;\n }\n\n const { html } = result;\n const { attributes } = html;\n if (attributes) {\n if (attributes.class) {\n attributes.class = attributes.class.filter(\n attr => !attr.startsWith(\"xfa\")\n );\n }\n attributes.dir = \"auto\";\n }\n\n return { html, str: root[$text]() };\n } catch (e) {\n warn(`XFA - an error occurred during parsing of rich text: ${e}`);\n }\n return null;\n }\n}\n\nexport { XFAFactory };\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 AnnotationActionEventType,\n AnnotationBorderStyleType,\n AnnotationEditorType,\n AnnotationFieldFlag,\n AnnotationFlag,\n AnnotationReplyType,\n AnnotationType,\n assert,\n BASELINE_FACTOR,\n FeatureTest,\n getModificationDate,\n IDENTITY_MATRIX,\n info,\n LINE_DESCENT_FACTOR,\n LINE_FACTOR,\n OPS,\n RenderingIntentFlag,\n shadow,\n stringToPDFString,\n unreachable,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport {\n collectActions,\n escapeString,\n getInheritableProperty,\n getRotationMatrix,\n isAscii,\n numberToString,\n stringToUTF16String,\n} from \"./core_utils.js\";\nimport {\n createDefaultAppearance,\n FakeUnicodeFont,\n getPdfColor,\n parseAppearanceStream,\n parseDefaultAppearance,\n} from \"./default_appearance.js\";\nimport { Dict, isName, isRefsEqual, Name, Ref, RefSet } from \"./primitives.js\";\nimport { Stream, StringStream } from \"./stream.js\";\nimport { BaseStream } from \"./base_stream.js\";\nimport { bidi } from \"./bidi.js\";\nimport { Catalog } from \"./catalog.js\";\nimport { ColorSpace } from \"./colorspace.js\";\nimport { FileSpec } from \"./file_spec.js\";\nimport { JpegStream } from \"./jpeg_stream.js\";\nimport { ObjectLoader } from \"./object_loader.js\";\nimport { OperatorList } from \"./operator_list.js\";\nimport { writeObject } from \"./writer.js\";\nimport { XFAFactory } from \"./xfa/factory.js\";\n\nclass AnnotationFactory {\n static createGlobals(pdfManager) {\n return Promise.all([\n pdfManager.ensureCatalog(\"acroForm\"),\n pdfManager.ensureDoc(\"xfaDatasets\"),\n pdfManager.ensureCatalog(\"structTreeRoot\"),\n // Only necessary to prevent the `Catalog.baseUrl`-getter, used\n // with some Annotations, from throwing and thus breaking parsing:\n pdfManager.ensureCatalog(\"baseUrl\"),\n // Only necessary to prevent the `Catalog.attachments`-getter, used\n // with \"GoToE\" actions, from throwing and thus breaking parsing:\n pdfManager.ensureCatalog(\"attachments\"),\n ]).then(\n ([acroForm, xfaDatasets, structTreeRoot, baseUrl, attachments]) => {\n return {\n pdfManager,\n acroForm: acroForm instanceof Dict ? acroForm : Dict.empty,\n xfaDatasets,\n structTreeRoot,\n baseUrl,\n attachments,\n };\n },\n reason => {\n warn(`createGlobals: \"${reason}\".`);\n return null;\n }\n );\n }\n\n /**\n * Create an `Annotation` object of the correct type for the given reference\n * to an annotation dictionary. This yields a promise that is resolved when\n * the `Annotation` object is constructed.\n *\n * @param {XRef} xref\n * @param {Object} ref\n * @params {Object} annotationGlobals\n * @param {Object} idFactory\n * @param {boolean} [collectFields]\n * @param {Object} [pageRef]\n * @returns {Promise} A promise that is resolved with an {Annotation}\n * instance.\n */\n static async create(\n xref,\n ref,\n annotationGlobals,\n idFactory,\n collectFields,\n pageRef\n ) {\n const pageIndex = collectFields\n ? await this._getPageIndex(xref, ref, annotationGlobals.pdfManager)\n : null;\n\n return annotationGlobals.pdfManager.ensure(this, \"_create\", [\n xref,\n ref,\n annotationGlobals,\n idFactory,\n collectFields,\n pageIndex,\n pageRef,\n ]);\n }\n\n /**\n * @private\n */\n static _create(\n xref,\n ref,\n annotationGlobals,\n idFactory,\n collectFields = false,\n pageIndex = null,\n pageRef = null\n ) {\n const dict = xref.fetchIfRef(ref);\n if (!(dict instanceof Dict)) {\n return undefined;\n }\n\n const { acroForm, pdfManager } = annotationGlobals;\n const id =\n ref instanceof Ref ? ref.toString() : `annot_${idFactory.createObjId()}`;\n\n // Determine the annotation's subtype.\n let subtype = dict.get(\"Subtype\");\n subtype = subtype instanceof Name ? subtype.name : null;\n\n // Return the right annotation object based on the subtype and field type.\n const parameters = {\n xref,\n ref,\n dict,\n subtype,\n id,\n annotationGlobals,\n collectFields,\n needAppearances:\n !collectFields && acroForm.get(\"NeedAppearances\") === true,\n pageIndex,\n evaluatorOptions: pdfManager.evaluatorOptions,\n pageRef,\n };\n\n switch (subtype) {\n case \"Link\":\n return new LinkAnnotation(parameters);\n\n case \"Text\":\n return new TextAnnotation(parameters);\n\n case \"Widget\":\n let fieldType = getInheritableProperty({ dict, key: \"FT\" });\n fieldType = fieldType instanceof Name ? fieldType.name : null;\n\n switch (fieldType) {\n case \"Tx\":\n return new TextWidgetAnnotation(parameters);\n case \"Btn\":\n return new ButtonWidgetAnnotation(parameters);\n case \"Ch\":\n return new ChoiceWidgetAnnotation(parameters);\n case \"Sig\":\n return new SignatureWidgetAnnotation(parameters);\n }\n warn(\n `Unimplemented widget field type \"${fieldType}\", ` +\n \"falling back to base field type.\"\n );\n return new WidgetAnnotation(parameters);\n\n case \"Popup\":\n return new PopupAnnotation(parameters);\n\n case \"FreeText\":\n return new FreeTextAnnotation(parameters);\n\n case \"Line\":\n return new LineAnnotation(parameters);\n\n case \"Square\":\n return new SquareAnnotation(parameters);\n\n case \"Circle\":\n return new CircleAnnotation(parameters);\n\n case \"PolyLine\":\n return new PolylineAnnotation(parameters);\n\n case \"Polygon\":\n return new PolygonAnnotation(parameters);\n\n case \"Caret\":\n return new CaretAnnotation(parameters);\n\n case \"Ink\":\n return new InkAnnotation(parameters);\n\n case \"Highlight\":\n return new HighlightAnnotation(parameters);\n\n case \"Underline\":\n return new UnderlineAnnotation(parameters);\n\n case \"Squiggly\":\n return new SquigglyAnnotation(parameters);\n\n case \"StrikeOut\":\n return new StrikeOutAnnotation(parameters);\n\n case \"Stamp\":\n return new StampAnnotation(parameters);\n\n case \"FileAttachment\":\n return new FileAttachmentAnnotation(parameters);\n\n default:\n if (!collectFields) {\n if (!subtype) {\n warn(\"Annotation is missing the required /Subtype.\");\n } else {\n warn(\n `Unimplemented annotation type \"${subtype}\", ` +\n \"falling back to base annotation.\"\n );\n }\n }\n return new Annotation(parameters);\n }\n }\n\n static async _getPageIndex(xref, ref, pdfManager) {\n try {\n const annotDict = await xref.fetchIfRefAsync(ref);\n if (!(annotDict instanceof Dict)) {\n return -1;\n }\n const pageRef = annotDict.getRaw(\"P\");\n if (pageRef instanceof Ref) {\n try {\n const pageIndex = await pdfManager.ensureCatalog(\"getPageIndex\", [\n pageRef,\n ]);\n return pageIndex;\n } catch (ex) {\n info(`_getPageIndex -- not a valid page reference: \"${ex}\".`);\n }\n }\n if (annotDict.has(\"Kids\")) {\n return -1; // Not an annotation reference.\n }\n // Fallback to, potentially, checking the annotations of all pages.\n // PLEASE NOTE: This could force the *entire* PDF document to load,\n // hence it absolutely cannot be done unconditionally.\n const numPages = await pdfManager.ensureDoc(\"numPages\");\n\n for (let pageIndex = 0; pageIndex < numPages; pageIndex++) {\n const page = await pdfManager.getPage(pageIndex);\n const annotations = await pdfManager.ensure(page, \"annotations\");\n\n for (const annotRef of annotations) {\n if (annotRef instanceof Ref && isRefsEqual(annotRef, ref)) {\n return pageIndex;\n }\n }\n }\n } catch (ex) {\n warn(`_getPageIndex: \"${ex}\".`);\n }\n return -1;\n }\n\n static generateImages(annotations, xref, isOffscreenCanvasSupported) {\n if (!isOffscreenCanvasSupported) {\n warn(\n \"generateImages: OffscreenCanvas is not supported, cannot save or print some annotations with images.\"\n );\n return null;\n }\n let imagePromises;\n for (const { bitmapId, bitmap } of annotations) {\n if (!bitmap) {\n continue;\n }\n imagePromises ||= new Map();\n imagePromises.set(bitmapId, StampAnnotation.createImage(bitmap, xref));\n }\n\n return imagePromises;\n }\n\n static async saveNewAnnotations(evaluator, task, annotations, imagePromises) {\n const xref = evaluator.xref;\n let baseFontRef;\n const dependencies = [];\n const promises = [];\n const { isOffscreenCanvasSupported } = evaluator.options;\n\n for (const annotation of annotations) {\n if (annotation.deleted) {\n continue;\n }\n switch (annotation.annotationType) {\n case AnnotationEditorType.FREETEXT:\n if (!baseFontRef) {\n const baseFont = new Dict(xref);\n baseFont.set(\"BaseFont\", Name.get(\"Helvetica\"));\n baseFont.set(\"Type\", Name.get(\"Font\"));\n baseFont.set(\"Subtype\", Name.get(\"Type1\"));\n baseFont.set(\"Encoding\", Name.get(\"WinAnsiEncoding\"));\n const buffer = [];\n baseFontRef = xref.getNewTemporaryRef();\n await writeObject(baseFontRef, baseFont, buffer, xref);\n dependencies.push({ ref: baseFontRef, data: buffer.join(\"\") });\n }\n promises.push(\n FreeTextAnnotation.createNewAnnotation(\n xref,\n annotation,\n dependencies,\n { evaluator, task, baseFontRef }\n )\n );\n break;\n case AnnotationEditorType.HIGHLIGHT:\n promises.push(\n HighlightAnnotation.createNewAnnotation(\n xref,\n annotation,\n dependencies\n )\n );\n break;\n case AnnotationEditorType.INK:\n promises.push(\n InkAnnotation.createNewAnnotation(xref, annotation, dependencies)\n );\n break;\n case AnnotationEditorType.STAMP:\n if (!isOffscreenCanvasSupported) {\n break;\n }\n const image = await imagePromises.get(annotation.bitmapId);\n if (image.imageStream) {\n const { imageStream, smaskStream } = image;\n const buffer = [];\n if (smaskStream) {\n const smaskRef = xref.getNewTemporaryRef();\n await writeObject(smaskRef, smaskStream, buffer, xref);\n dependencies.push({ ref: smaskRef, data: buffer.join(\"\") });\n imageStream.dict.set(\"SMask\", smaskRef);\n buffer.length = 0;\n }\n const imageRef = (image.imageRef = xref.getNewTemporaryRef());\n await writeObject(imageRef, imageStream, buffer, xref);\n dependencies.push({ ref: imageRef, data: buffer.join(\"\") });\n image.imageStream = image.smaskStream = null;\n }\n promises.push(\n StampAnnotation.createNewAnnotation(\n xref,\n annotation,\n dependencies,\n { image }\n )\n );\n break;\n }\n }\n\n return {\n annotations: await Promise.all(promises),\n dependencies,\n };\n }\n\n static async printNewAnnotations(\n annotationGlobals,\n evaluator,\n task,\n annotations,\n imagePromises\n ) {\n if (!annotations) {\n return null;\n }\n\n const { options, xref } = evaluator;\n const promises = [];\n for (const annotation of annotations) {\n if (annotation.deleted) {\n continue;\n }\n switch (annotation.annotationType) {\n case AnnotationEditorType.FREETEXT:\n promises.push(\n FreeTextAnnotation.createNewPrintAnnotation(\n annotationGlobals,\n xref,\n annotation,\n {\n evaluator,\n task,\n evaluatorOptions: options,\n }\n )\n );\n break;\n case AnnotationEditorType.HIGHLIGHT:\n promises.push(\n HighlightAnnotation.createNewPrintAnnotation(\n annotationGlobals,\n xref,\n annotation,\n {\n evaluatorOptions: options,\n }\n )\n );\n break;\n case AnnotationEditorType.INK:\n promises.push(\n InkAnnotation.createNewPrintAnnotation(\n annotationGlobals,\n xref,\n annotation,\n {\n evaluatorOptions: options,\n }\n )\n );\n break;\n case AnnotationEditorType.STAMP:\n if (!options.isOffscreenCanvasSupported) {\n break;\n }\n const image = await imagePromises.get(annotation.bitmapId);\n if (image.imageStream) {\n const { imageStream, smaskStream } = image;\n if (smaskStream) {\n imageStream.dict.set(\"SMask\", smaskStream);\n }\n image.imageRef = new JpegStream(imageStream, imageStream.length);\n image.imageStream = image.smaskStream = null;\n }\n promises.push(\n StampAnnotation.createNewPrintAnnotation(\n annotationGlobals,\n xref,\n annotation,\n {\n image,\n evaluatorOptions: options,\n }\n )\n );\n break;\n }\n }\n\n return Promise.all(promises);\n }\n}\n\nfunction getRgbColor(color, defaultColor = new Uint8ClampedArray(3)) {\n if (!Array.isArray(color)) {\n return defaultColor;\n }\n\n const rgbColor = defaultColor || new Uint8ClampedArray(3);\n switch (color.length) {\n case 0: // Transparent, which we indicate with a null value\n return null;\n\n case 1: // Convert grayscale to RGB\n ColorSpace.singletons.gray.getRgbItem(color, 0, rgbColor, 0);\n return rgbColor;\n\n case 3: // Convert RGB percentages to RGB\n ColorSpace.singletons.rgb.getRgbItem(color, 0, rgbColor, 0);\n return rgbColor;\n\n case 4: // Convert CMYK to RGB\n ColorSpace.singletons.cmyk.getRgbItem(color, 0, rgbColor, 0);\n return rgbColor;\n\n default:\n return defaultColor;\n }\n}\n\nfunction getPdfColorArray(color) {\n return Array.from(color, c => c / 255);\n}\n\nfunction getQuadPoints(dict, rect) {\n // The region is described as a number of quadrilaterals.\n // Each quadrilateral must consist of eight coordinates.\n const quadPoints = dict.getArray(\"QuadPoints\");\n if (\n !Array.isArray(quadPoints) ||\n quadPoints.length === 0 ||\n quadPoints.length % 8 > 0\n ) {\n return null;\n }\n\n const quadPointsLists = [];\n for (let i = 0, ii = quadPoints.length / 8; i < ii; i++) {\n // Each series of eight numbers represents the coordinates for one\n // quadrilateral in the order [x1, y1, x2, y2, x3, y3, x4, y4].\n // Convert this to an array of objects with x and y coordinates.\n let minX = Infinity,\n maxX = -Infinity,\n minY = Infinity,\n maxY = -Infinity;\n for (let j = i * 8, jj = i * 8 + 8; j < jj; j += 2) {\n const x = quadPoints[j];\n const y = quadPoints[j + 1];\n\n minX = Math.min(x, minX);\n maxX = Math.max(x, maxX);\n minY = Math.min(y, minY);\n maxY = Math.max(y, maxY);\n }\n // The quadpoints should be ignored if any coordinate in the array\n // lies outside the region specified by the rectangle. The rectangle\n // can be `null` for markup annotations since their rectangle may be\n // incorrect (fixes bug 1538111).\n if (\n rect !== null &&\n (minX < rect[0] || maxX > rect[2] || minY < rect[1] || maxY > rect[3])\n ) {\n return null;\n }\n // The PDF specification states in section 12.5.6.10 (figure 64) that the\n // order of the quadpoints should be bottom left, bottom right, top right\n // and top left. However, in practice PDF files use a different order,\n // namely bottom left, bottom right, top left and top right (this is also\n // mentioned on https://github.com/highkite/pdfAnnotate#QuadPoints), so\n // this is the actual order we should work with. However, the situation is\n // even worse since Adobe's own applications and other applications violate\n // the specification and create annotations with other orders, namely top\n // left, top right, bottom left and bottom right or even top left,\n // top right, bottom right and bottom left. To avoid inconsistency and\n // broken rendering, we normalize all lists to put the quadpoints in the\n // same standard order (see https://stackoverflow.com/a/10729881).\n quadPointsLists.push([\n { x: minX, y: maxY },\n { x: maxX, y: maxY },\n { x: minX, y: minY },\n { x: maxX, y: minY },\n ]);\n }\n return quadPointsLists;\n}\n\nfunction getTransformMatrix(rect, bbox, matrix) {\n // 12.5.5: Algorithm: Appearance streams\n const [minX, minY, maxX, maxY] = Util.getAxialAlignedBoundingBox(\n bbox,\n matrix\n );\n if (minX === maxX || minY === maxY) {\n // From real-life file, bbox was [0, 0, 0, 0]. In this case,\n // just apply the transform for rect\n return [1, 0, 0, 1, rect[0], rect[1]];\n }\n\n const xRatio = (rect[2] - rect[0]) / (maxX - minX);\n const yRatio = (rect[3] - rect[1]) / (maxY - minY);\n return [\n xRatio,\n 0,\n 0,\n yRatio,\n rect[0] - minX * xRatio,\n rect[1] - minY * yRatio,\n ];\n}\n\nclass Annotation {\n constructor(params) {\n const { dict, xref, annotationGlobals } = params;\n\n this.setTitle(dict.get(\"T\"));\n this.setContents(dict.get(\"Contents\"));\n this.setModificationDate(dict.get(\"M\"));\n this.setFlags(dict.get(\"F\"));\n this.setRectangle(dict.getArray(\"Rect\"));\n this.setColor(dict.getArray(\"C\"));\n this.setBorderStyle(dict);\n this.setAppearance(dict);\n this.setOptionalContent(dict);\n\n const MK = dict.get(\"MK\");\n this.setBorderAndBackgroundColors(MK);\n this.setRotation(MK, dict);\n this.ref = params.ref instanceof Ref ? params.ref : null;\n\n this._streams = [];\n if (this.appearance) {\n this._streams.push(this.appearance);\n }\n\n // The annotation cannot be changed (neither its position/visibility nor its\n // contents), hence we can just display its appearance and don't generate\n // a HTML element for it.\n const isLocked = !!(this.flags & AnnotationFlag.LOCKED);\n const isContentLocked = !!(this.flags & AnnotationFlag.LOCKEDCONTENTS);\n\n if (annotationGlobals.structTreeRoot) {\n let structParent = dict.get(\"StructParent\");\n structParent =\n Number.isInteger(structParent) && structParent >= 0 ? structParent : -1;\n\n annotationGlobals.structTreeRoot.addAnnotationIdToPage(\n params.pageRef,\n structParent\n );\n }\n\n // Expose public properties using a data object.\n this.data = {\n annotationFlags: this.flags,\n borderStyle: this.borderStyle,\n color: this.color,\n backgroundColor: this.backgroundColor,\n borderColor: this.borderColor,\n rotation: this.rotation,\n contentsObj: this._contents,\n hasAppearance: !!this.appearance,\n id: params.id,\n modificationDate: this.modificationDate,\n rect: this.rectangle,\n subtype: params.subtype,\n hasOwnCanvas: false,\n noRotate: !!(this.flags & AnnotationFlag.NOROTATE),\n noHTML: isLocked && isContentLocked,\n };\n\n if (params.collectFields) {\n // Fields can act as container for other fields and have\n // some actions even if no Annotation inherit from them.\n // Those fields can be referenced by CO (calculation order).\n const kids = dict.get(\"Kids\");\n if (Array.isArray(kids)) {\n const kidIds = [];\n for (const kid of kids) {\n if (kid instanceof Ref) {\n kidIds.push(kid.toString());\n }\n }\n if (kidIds.length !== 0) {\n this.data.kidIds = kidIds;\n }\n }\n\n this.data.actions = collectActions(xref, dict, AnnotationActionEventType);\n this.data.fieldName = this._constructFieldName(dict);\n this.data.pageIndex = params.pageIndex;\n }\n\n this._isOffscreenCanvasSupported =\n params.evaluatorOptions.isOffscreenCanvasSupported;\n this._fallbackFontDict = null;\n this._needAppearances = false;\n }\n\n /**\n * @private\n */\n _hasFlag(flags, flag) {\n return !!(flags & flag);\n }\n\n /**\n * @private\n */\n _isViewable(flags) {\n return (\n !this._hasFlag(flags, AnnotationFlag.INVISIBLE) &&\n !this._hasFlag(flags, AnnotationFlag.NOVIEW)\n );\n }\n\n /**\n * @private\n */\n _isPrintable(flags) {\n // In Acrobat, hidden flag cancels the print one\n // (see annotation_hidden_print.pdf).\n return (\n this._hasFlag(flags, AnnotationFlag.PRINT) &&\n !this._hasFlag(flags, AnnotationFlag.HIDDEN) &&\n !this._hasFlag(flags, AnnotationFlag.INVISIBLE)\n );\n }\n\n /**\n * Check if the annotation must be displayed by taking into account\n * the value found in the annotationStorage which may have been set\n * through JS.\n *\n * @public\n * @memberof Annotation\n * @param {AnnotationStorage} [annotationStorage] - Storage for annotation\n * @param {boolean} [_renderForms] - if true widgets are rendered thanks to\n * the annotation layer.\n */\n mustBeViewed(annotationStorage, _renderForms) {\n const noView = annotationStorage?.get(this.data.id)?.noView;\n if (noView !== undefined) {\n return !noView;\n }\n return this.viewable && !this._hasFlag(this.flags, AnnotationFlag.HIDDEN);\n }\n\n /**\n * Check if the annotation must be printed by taking into account\n * the value found in the annotationStorage which may have been set\n * through JS.\n *\n * @public\n * @memberof Annotation\n * @param {AnnotationStorage} [annotationStorage] - Storage for annotation\n */\n mustBePrinted(annotationStorage) {\n const noPrint = annotationStorage?.get(this.data.id)?.noPrint;\n if (noPrint !== undefined) {\n return !noPrint;\n }\n return this.printable;\n }\n\n /**\n * @type {boolean}\n */\n get viewable() {\n if (this.data.quadPoints === null) {\n return false;\n }\n if (this.flags === 0) {\n return true;\n }\n return this._isViewable(this.flags);\n }\n\n /**\n * @type {boolean}\n */\n get printable() {\n if (this.data.quadPoints === null) {\n return false;\n }\n if (this.flags === 0) {\n return false;\n }\n return this._isPrintable(this.flags);\n }\n\n /**\n * @private\n */\n _parseStringHelper(data) {\n const str = typeof data === \"string\" ? stringToPDFString(data) : \"\";\n const dir = str && bidi(str).dir === \"rtl\" ? \"rtl\" : \"ltr\";\n\n return { str, dir };\n }\n\n setDefaultAppearance(params) {\n const { dict, annotationGlobals } = params;\n\n const defaultAppearance =\n getInheritableProperty({ dict, key: \"DA\" }) ||\n annotationGlobals.acroForm.get(\"DA\");\n this._defaultAppearance =\n typeof defaultAppearance === \"string\" ? defaultAppearance : \"\";\n this.data.defaultAppearanceData = parseDefaultAppearance(\n this._defaultAppearance\n );\n }\n\n /**\n * Set the title.\n *\n * @param {string} title - The title of the annotation, used e.g. with\n * PopupAnnotations.\n */\n setTitle(title) {\n this._title = this._parseStringHelper(title);\n }\n\n /**\n * Set the contents.\n *\n * @param {string} contents - Text to display for the annotation or, if the\n * type of annotation does not display text, a\n * description of the annotation's contents\n */\n setContents(contents) {\n this._contents = this._parseStringHelper(contents);\n }\n\n /**\n * Set the modification date.\n *\n * @public\n * @memberof Annotation\n * @param {string} modificationDate - PDF date string that indicates when the\n * annotation was last modified\n */\n setModificationDate(modificationDate) {\n this.modificationDate =\n typeof modificationDate === \"string\" ? modificationDate : null;\n }\n\n /**\n * Set the flags.\n *\n * @public\n * @memberof Annotation\n * @param {number} flags - Unsigned 32-bit integer specifying annotation\n * characteristics\n * @see {@link shared/util.js}\n */\n setFlags(flags) {\n this.flags = Number.isInteger(flags) && flags > 0 ? flags : 0;\n if (\n this.flags & AnnotationFlag.INVISIBLE &&\n this.constructor.name !== \"Annotation\"\n ) {\n // From the pdf spec v1.7, section 12.5.3 (Annotation Flags):\n // If set, do not display the annotation if it does not belong to one of\n // the standard annotation types and no annotation handler is available.\n //\n // So we can remove the flag in case we have a known annotation type.\n this.flags ^= AnnotationFlag.INVISIBLE;\n }\n }\n\n /**\n * Check if a provided flag is set.\n *\n * @public\n * @memberof Annotation\n * @param {number} flag - Hexadecimal representation for an annotation\n * characteristic\n * @returns {boolean}\n * @see {@link shared/util.js}\n */\n hasFlag(flag) {\n return this._hasFlag(this.flags, flag);\n }\n\n /**\n * Set the rectangle.\n *\n * @public\n * @memberof Annotation\n * @param {Array} rectangle - The rectangle array with exactly four entries\n */\n setRectangle(rectangle) {\n this.rectangle =\n Array.isArray(rectangle) && rectangle.length === 4\n ? Util.normalizeRect(rectangle)\n : [0, 0, 0, 0];\n }\n\n /**\n * Set the color and take care of color space conversion.\n * The default value is black, in RGB color space.\n *\n * @public\n * @memberof Annotation\n * @param {Array} color - The color array containing either 0\n * (transparent), 1 (grayscale), 3 (RGB) or\n * 4 (CMYK) elements\n */\n setColor(color) {\n this.color = getRgbColor(color);\n }\n\n /**\n * Set the line endings; should only be used with specific annotation types.\n * @param {Array} lineEndings - The line endings array.\n */\n setLineEndings(lineEndings) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: setLineEndings\");\n }\n this.lineEndings = [\"None\", \"None\"]; // The default values.\n\n if (Array.isArray(lineEndings) && lineEndings.length === 2) {\n for (let i = 0; i < 2; i++) {\n const obj = lineEndings[i];\n\n if (obj instanceof Name) {\n switch (obj.name) {\n case \"None\":\n continue;\n case \"Square\":\n case \"Circle\":\n case \"Diamond\":\n case \"OpenArrow\":\n case \"ClosedArrow\":\n case \"Butt\":\n case \"ROpenArrow\":\n case \"RClosedArrow\":\n case \"Slash\":\n this.lineEndings[i] = obj.name;\n continue;\n }\n }\n warn(`Ignoring invalid lineEnding: ${obj}`);\n }\n }\n }\n\n setRotation(mk, dict) {\n this.rotation = 0;\n let angle = mk instanceof Dict ? mk.get(\"R\") || 0 : dict.get(\"Rotate\") || 0;\n if (Number.isInteger(angle) && angle !== 0) {\n angle %= 360;\n if (angle < 0) {\n angle += 360;\n }\n if (angle % 90 === 0) {\n this.rotation = angle;\n }\n }\n }\n\n /**\n * Set the color for background and border if any.\n * The default values are transparent.\n *\n * @public\n * @memberof Annotation\n * @param {Dict} mk - The MK dictionary\n */\n setBorderAndBackgroundColors(mk) {\n if (mk instanceof Dict) {\n this.borderColor = getRgbColor(mk.getArray(\"BC\"), null);\n this.backgroundColor = getRgbColor(mk.getArray(\"BG\"), null);\n } else {\n this.borderColor = this.backgroundColor = null;\n }\n }\n\n /**\n * Set the border style (as AnnotationBorderStyle object).\n *\n * @public\n * @memberof Annotation\n * @param {Dict} borderStyle - The border style dictionary\n */\n setBorderStyle(borderStyle) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(this.rectangle, \"setRectangle must have been called previously.\");\n }\n\n this.borderStyle = new AnnotationBorderStyle();\n if (!(borderStyle instanceof Dict)) {\n return;\n }\n if (borderStyle.has(\"BS\")) {\n const dict = borderStyle.get(\"BS\");\n\n if (dict instanceof Dict) {\n const dictType = dict.get(\"Type\");\n\n if (!dictType || isName(dictType, \"Border\")) {\n this.borderStyle.setWidth(dict.get(\"W\"), this.rectangle);\n this.borderStyle.setStyle(dict.get(\"S\"));\n this.borderStyle.setDashArray(dict.getArray(\"D\"));\n }\n }\n } else if (borderStyle.has(\"Border\")) {\n const array = borderStyle.getArray(\"Border\");\n if (Array.isArray(array) && array.length >= 3) {\n this.borderStyle.setHorizontalCornerRadius(array[0]);\n this.borderStyle.setVerticalCornerRadius(array[1]);\n this.borderStyle.setWidth(array[2], this.rectangle);\n\n if (array.length === 4) {\n // Dash array available\n this.borderStyle.setDashArray(array[3], /* forceStyle = */ true);\n }\n }\n } else {\n // There are no border entries in the dictionary. According to the\n // specification, we should draw a solid border of width 1 in that\n // case, but Adobe Reader did not implement that part of the\n // specification and instead draws no border at all, so we do the same.\n // See also https://github.com/mozilla/pdf.js/issues/6179.\n this.borderStyle.setWidth(0);\n }\n }\n\n /**\n * Set the (normal) appearance.\n *\n * @public\n * @memberof Annotation\n * @param {Dict} dict - The annotation's data dictionary\n */\n setAppearance(dict) {\n this.appearance = null;\n\n const appearanceStates = dict.get(\"AP\");\n if (!(appearanceStates instanceof Dict)) {\n return;\n }\n\n // In case the normal appearance is a stream, then it is used directly.\n const normalAppearanceState = appearanceStates.get(\"N\");\n if (normalAppearanceState instanceof BaseStream) {\n this.appearance = normalAppearanceState;\n return;\n }\n if (!(normalAppearanceState instanceof Dict)) {\n return;\n }\n\n // In case the normal appearance is a dictionary, the `AS` entry provides\n // the key of the stream in this dictionary.\n const as = dict.get(\"AS\");\n if (!(as instanceof Name) || !normalAppearanceState.has(as.name)) {\n return;\n }\n const appearance = normalAppearanceState.get(as.name);\n if (appearance instanceof BaseStream) {\n this.appearance = appearance;\n }\n }\n\n setOptionalContent(dict) {\n this.oc = null;\n\n const oc = dict.get(\"OC\");\n if (oc instanceof Name) {\n warn(\"setOptionalContent: Support for /Name-entry is not implemented.\");\n } else if (oc instanceof Dict) {\n this.oc = oc;\n }\n }\n\n loadResources(keys, appearance) {\n return appearance.dict.getAsync(\"Resources\").then(resources => {\n if (!resources) {\n return undefined;\n }\n\n const objectLoader = new ObjectLoader(resources, keys, resources.xref);\n return objectLoader.load().then(function () {\n return resources;\n });\n });\n }\n\n async getOperatorList(\n evaluator,\n task,\n intent,\n renderForms,\n annotationStorage\n ) {\n const data = this.data;\n let appearance = this.appearance;\n const isUsingOwnCanvas = !!(\n this.data.hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY\n );\n if (!appearance) {\n if (!isUsingOwnCanvas) {\n return {\n opList: new OperatorList(),\n separateForm: false,\n separateCanvas: false,\n };\n }\n appearance = new StringStream(\"\");\n appearance.dict = new Dict();\n }\n\n const appearanceDict = appearance.dict;\n const resources = await this.loadResources(\n [\"ExtGState\", \"ColorSpace\", \"Pattern\", \"Shading\", \"XObject\", \"Font\"],\n appearance\n );\n const bbox = appearanceDict.getArray(\"BBox\") || [0, 0, 1, 1];\n const matrix = appearanceDict.getArray(\"Matrix\") || [1, 0, 0, 1, 0, 0];\n const transform = getTransformMatrix(data.rect, bbox, matrix);\n\n const opList = new OperatorList();\n\n let optionalContent;\n if (this.oc) {\n optionalContent = await evaluator.parseMarkedContentProps(\n this.oc,\n /* resources = */ null\n );\n }\n if (optionalContent !== undefined) {\n opList.addOp(OPS.beginMarkedContentProps, [\"OC\", optionalContent]);\n }\n\n opList.addOp(OPS.beginAnnotation, [\n data.id,\n data.rect,\n transform,\n matrix,\n isUsingOwnCanvas,\n ]);\n\n await evaluator.getOperatorList({\n stream: appearance,\n task,\n resources,\n operatorList: opList,\n fallbackFontDict: this._fallbackFontDict,\n });\n opList.addOp(OPS.endAnnotation, []);\n\n if (optionalContent !== undefined) {\n opList.addOp(OPS.endMarkedContent, []);\n }\n this.reset();\n return { opList, separateForm: false, separateCanvas: isUsingOwnCanvas };\n }\n\n async save(evaluator, task, annotationStorage) {\n return null;\n }\n\n get hasTextContent() {\n return false;\n }\n\n async extractTextContent(evaluator, task, viewBox) {\n if (!this.appearance) {\n return;\n }\n\n const resources = await this.loadResources(\n [\"ExtGState\", \"Font\", \"Properties\", \"XObject\"],\n this.appearance\n );\n\n const text = [];\n const buffer = [];\n let firstPosition = null;\n const sink = {\n desiredSize: Math.Infinity,\n ready: true,\n\n enqueue(chunk, size) {\n for (const item of chunk.items) {\n if (item.str === undefined) {\n continue;\n }\n firstPosition ||= item.transform.slice(-2);\n buffer.push(item.str);\n if (item.hasEOL) {\n text.push(buffer.join(\"\"));\n buffer.length = 0;\n }\n }\n },\n };\n\n await evaluator.getTextContent({\n stream: this.appearance,\n task,\n resources,\n includeMarkedContent: true,\n sink,\n viewBox,\n });\n this.reset();\n\n if (buffer.length) {\n text.push(buffer.join(\"\"));\n }\n\n if (text.length > 1 || text[0]) {\n const appearanceDict = this.appearance.dict;\n const bbox = appearanceDict.getArray(\"BBox\") || [0, 0, 1, 1];\n const matrix = appearanceDict.getArray(\"Matrix\") || [1, 0, 0, 1, 0, 0];\n const rect = this.data.rect;\n const transform = getTransformMatrix(rect, bbox, matrix);\n transform[4] -= rect[0];\n transform[5] -= rect[1];\n firstPosition = Util.applyTransform(firstPosition, transform);\n firstPosition = Util.applyTransform(firstPosition, matrix);\n\n this.data.textPosition = firstPosition;\n this.data.textContent = text;\n }\n }\n\n /**\n * Get field data for usage in JS sandbox.\n *\n * Field object is defined here:\n * https://www.adobe.com/content/dam/acom/en/devnet/acrobat/pdfs/js_api_reference.pdf#page=16\n *\n * @public\n * @memberof Annotation\n * @returns {Object | null}\n */\n getFieldObject() {\n if (this.data.kidIds) {\n return {\n id: this.data.id,\n actions: this.data.actions,\n name: this.data.fieldName,\n strokeColor: this.data.borderColor,\n fillColor: this.data.backgroundColor,\n type: \"\",\n kidIds: this.data.kidIds,\n page: this.data.pageIndex,\n rotation: this.rotation,\n };\n }\n return null;\n }\n\n /**\n * Reset the annotation.\n *\n * This involves resetting the various streams that are either cached on the\n * annotation instance or created during its construction.\n *\n * @public\n * @memberof Annotation\n */\n reset() {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n this.appearance &&\n !this._streams.includes(this.appearance)\n ) {\n unreachable(\"The appearance stream should always be reset.\");\n }\n\n for (const stream of this._streams) {\n stream.reset();\n }\n }\n\n /**\n * Construct the (fully qualified) field name from the (partial) field\n * names of the field and its ancestors.\n *\n * @private\n * @memberof Annotation\n * @param {Dict} dict - Complete widget annotation dictionary\n * @returns {string}\n */\n _constructFieldName(dict) {\n // Both the `Parent` and `T` fields are optional. While at least one of\n // them should be provided, bad PDF generators may fail to do so.\n if (!dict.has(\"T\") && !dict.has(\"Parent\")) {\n warn(\"Unknown field name, falling back to empty field name.\");\n return \"\";\n }\n\n // If no parent exists, the partial and fully qualified names are equal.\n if (!dict.has(\"Parent\")) {\n return stringToPDFString(dict.get(\"T\"));\n }\n\n // Form the fully qualified field name by appending the partial name to\n // the parent's fully qualified name, separated by a period.\n const fieldName = [];\n if (dict.has(\"T\")) {\n fieldName.unshift(stringToPDFString(dict.get(\"T\")));\n }\n\n let loopDict = dict;\n const visited = new RefSet();\n if (dict.objId) {\n visited.put(dict.objId);\n }\n while (loopDict.has(\"Parent\")) {\n loopDict = loopDict.get(\"Parent\");\n if (\n !(loopDict instanceof Dict) ||\n (loopDict.objId && visited.has(loopDict.objId))\n ) {\n // Even though it is not allowed according to the PDF specification,\n // bad PDF generators may provide a `Parent` entry that is not a\n // dictionary, but `null` for example (issue 8143).\n //\n // If parent has been already visited, it means that we're\n // in an infinite loop.\n break;\n }\n if (loopDict.objId) {\n visited.put(loopDict.objId);\n }\n\n if (loopDict.has(\"T\")) {\n fieldName.unshift(stringToPDFString(loopDict.get(\"T\")));\n }\n }\n return fieldName.join(\".\");\n }\n}\n\n/**\n * Contains all data regarding an annotation's border style.\n */\nclass AnnotationBorderStyle {\n constructor() {\n this.width = 1;\n this.style = AnnotationBorderStyleType.SOLID;\n this.dashArray = [3];\n this.horizontalCornerRadius = 0;\n this.verticalCornerRadius = 0;\n }\n\n /**\n * Set the width.\n *\n * @public\n * @memberof AnnotationBorderStyle\n * @param {number} width - The width.\n * @param {Array} rect - The annotation `Rect` entry.\n */\n setWidth(width, rect = [0, 0, 0, 0]) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n Array.isArray(rect) && rect.length === 4,\n \"A valid `rect` parameter must be provided.\"\n );\n }\n\n // Some corrupt PDF generators may provide the width as a `Name`,\n // rather than as a number (fixes issue 10385).\n if (width instanceof Name) {\n this.width = 0; // This is consistent with the behaviour in Adobe Reader.\n return;\n }\n if (typeof width === \"number\") {\n if (width > 0) {\n const maxWidth = (rect[2] - rect[0]) / 2;\n const maxHeight = (rect[3] - rect[1]) / 2;\n\n // Ignore large `width`s, since they lead to the Annotation overflowing\n // the size set by the `Rect` entry thus causing the `annotationLayer`\n // to render it over the surrounding document (fixes bug1552113.pdf).\n if (\n maxWidth > 0 &&\n maxHeight > 0 &&\n (width > maxWidth || width > maxHeight)\n ) {\n warn(`AnnotationBorderStyle.setWidth - ignoring width: ${width}`);\n width = 1;\n }\n }\n this.width = width;\n }\n }\n\n /**\n * Set the style.\n *\n * @public\n * @memberof AnnotationBorderStyle\n * @param {Name} style - The annotation style.\n * @see {@link shared/util.js}\n */\n setStyle(style) {\n if (!(style instanceof Name)) {\n return;\n }\n switch (style.name) {\n case \"S\":\n this.style = AnnotationBorderStyleType.SOLID;\n break;\n\n case \"D\":\n this.style = AnnotationBorderStyleType.DASHED;\n break;\n\n case \"B\":\n this.style = AnnotationBorderStyleType.BEVELED;\n break;\n\n case \"I\":\n this.style = AnnotationBorderStyleType.INSET;\n break;\n\n case \"U\":\n this.style = AnnotationBorderStyleType.UNDERLINE;\n break;\n\n default:\n break;\n }\n }\n\n /**\n * Set the dash array.\n *\n * @public\n * @memberof AnnotationBorderStyle\n * @param {Array} dashArray - The dash array with at least one element\n * @param {boolean} [forceStyle]\n */\n setDashArray(dashArray, forceStyle = false) {\n // We validate the dash array, but we do not use it because CSS does not\n // allow us to change spacing of dashes. For more information, visit\n // http://www.w3.org/TR/css3-background/#the-border-style.\n if (Array.isArray(dashArray) && dashArray.length > 0) {\n // According to the PDF specification: the elements in `dashArray`\n // shall be numbers that are nonnegative and not all equal to zero.\n let isValid = true;\n let allZeros = true;\n for (const element of dashArray) {\n const validNumber = +element >= 0;\n if (!validNumber) {\n isValid = false;\n break;\n } else if (element > 0) {\n allZeros = false;\n }\n }\n if (isValid && !allZeros) {\n this.dashArray = dashArray;\n\n if (forceStyle) {\n // Even though we cannot use the dash array in the display layer,\n // at least ensure that we use the correct border-style.\n this.setStyle(Name.get(\"D\"));\n }\n } else {\n this.width = 0; // Adobe behavior when the array is invalid.\n }\n } else if (dashArray) {\n this.width = 0; // Adobe behavior when the array is invalid.\n }\n }\n\n /**\n * Set the horizontal corner radius (from a Border dictionary).\n *\n * @public\n * @memberof AnnotationBorderStyle\n * @param {number} radius - The horizontal corner radius.\n */\n setHorizontalCornerRadius(radius) {\n if (Number.isInteger(radius)) {\n this.horizontalCornerRadius = radius;\n }\n }\n\n /**\n * Set the vertical corner radius (from a Border dictionary).\n *\n * @public\n * @memberof AnnotationBorderStyle\n * @param {number} radius - The vertical corner radius.\n */\n setVerticalCornerRadius(radius) {\n if (Number.isInteger(radius)) {\n this.verticalCornerRadius = radius;\n }\n }\n}\n\nclass MarkupAnnotation extends Annotation {\n constructor(params) {\n super(params);\n\n const { dict } = params;\n\n if (dict.has(\"IRT\")) {\n const rawIRT = dict.getRaw(\"IRT\");\n this.data.inReplyTo = rawIRT instanceof Ref ? rawIRT.toString() : null;\n\n const rt = dict.get(\"RT\");\n this.data.replyType =\n rt instanceof Name ? rt.name : AnnotationReplyType.REPLY;\n }\n let popupRef = null;\n\n if (this.data.replyType === AnnotationReplyType.GROUP) {\n // Subordinate annotations in a group should inherit\n // the group attributes from the primary annotation.\n const parent = dict.get(\"IRT\");\n\n this.setTitle(parent.get(\"T\"));\n this.data.titleObj = this._title;\n\n this.setContents(parent.get(\"Contents\"));\n this.data.contentsObj = this._contents;\n\n if (!parent.has(\"CreationDate\")) {\n this.data.creationDate = null;\n } else {\n this.setCreationDate(parent.get(\"CreationDate\"));\n this.data.creationDate = this.creationDate;\n }\n\n if (!parent.has(\"M\")) {\n this.data.modificationDate = null;\n } else {\n this.setModificationDate(parent.get(\"M\"));\n this.data.modificationDate = this.modificationDate;\n }\n\n popupRef = parent.getRaw(\"Popup\");\n\n if (!parent.has(\"C\")) {\n // Fall back to the default background color.\n this.data.color = null;\n } else {\n this.setColor(parent.getArray(\"C\"));\n this.data.color = this.color;\n }\n } else {\n this.data.titleObj = this._title;\n\n this.setCreationDate(dict.get(\"CreationDate\"));\n this.data.creationDate = this.creationDate;\n\n popupRef = dict.getRaw(\"Popup\");\n\n if (!dict.has(\"C\")) {\n // Fall back to the default background color.\n this.data.color = null;\n }\n }\n\n this.data.popupRef = popupRef instanceof Ref ? popupRef.toString() : null;\n\n if (dict.has(\"RC\")) {\n this.data.richText = XFAFactory.getRichTextAsHtml(dict.get(\"RC\"));\n }\n }\n\n /**\n * Set the creation date.\n *\n * @public\n * @memberof MarkupAnnotation\n * @param {string} creationDate - PDF date string that indicates when the\n * annotation was originally created\n */\n setCreationDate(creationDate) {\n this.creationDate = typeof creationDate === \"string\" ? creationDate : null;\n }\n\n _setDefaultAppearance({\n xref,\n extra,\n strokeColor,\n fillColor,\n blendMode,\n strokeAlpha,\n fillAlpha,\n pointsCallback,\n }) {\n let minX = Number.MAX_VALUE;\n let minY = Number.MAX_VALUE;\n let maxX = Number.MIN_VALUE;\n let maxY = Number.MIN_VALUE;\n\n const buffer = [\"q\"];\n if (extra) {\n buffer.push(extra);\n }\n if (strokeColor) {\n buffer.push(`${strokeColor[0]} ${strokeColor[1]} ${strokeColor[2]} RG`);\n }\n if (fillColor) {\n buffer.push(`${fillColor[0]} ${fillColor[1]} ${fillColor[2]} rg`);\n }\n\n let pointsArray = this.data.quadPoints;\n if (!pointsArray) {\n // If there are no quadpoints, the rectangle should be used instead.\n // Convert the rectangle definition to a points array similar to how the\n // quadpoints are defined.\n pointsArray = [\n [\n { x: this.rectangle[0], y: this.rectangle[3] },\n { x: this.rectangle[2], y: this.rectangle[3] },\n { x: this.rectangle[0], y: this.rectangle[1] },\n { x: this.rectangle[2], y: this.rectangle[1] },\n ],\n ];\n }\n\n for (const points of pointsArray) {\n const [mX, MX, mY, MY] = pointsCallback(buffer, points);\n minX = Math.min(minX, mX);\n maxX = Math.max(maxX, MX);\n minY = Math.min(minY, mY);\n maxY = Math.max(maxY, MY);\n }\n buffer.push(\"Q\");\n\n const formDict = new Dict(xref);\n const appearanceStreamDict = new Dict(xref);\n appearanceStreamDict.set(\"Subtype\", Name.get(\"Form\"));\n\n const appearanceStream = new StringStream(buffer.join(\" \"));\n appearanceStream.dict = appearanceStreamDict;\n formDict.set(\"Fm0\", appearanceStream);\n\n const gsDict = new Dict(xref);\n if (blendMode) {\n gsDict.set(\"BM\", Name.get(blendMode));\n }\n if (typeof strokeAlpha === \"number\") {\n gsDict.set(\"CA\", strokeAlpha);\n }\n if (typeof fillAlpha === \"number\") {\n gsDict.set(\"ca\", fillAlpha);\n }\n\n const stateDict = new Dict(xref);\n stateDict.set(\"GS0\", gsDict);\n\n const resources = new Dict(xref);\n resources.set(\"ExtGState\", stateDict);\n resources.set(\"XObject\", formDict);\n\n const appearanceDict = new Dict(xref);\n appearanceDict.set(\"Resources\", resources);\n const bbox = (this.data.rect = [minX, minY, maxX, maxY]);\n appearanceDict.set(\"BBox\", bbox);\n\n this.appearance = new StringStream(\"/GS0 gs /Fm0 Do\");\n this.appearance.dict = appearanceDict;\n\n // This method is only called if there is no appearance for the annotation,\n // so `this.appearance` is not pushed yet in the `Annotation` constructor.\n this._streams.push(this.appearance, appearanceStream);\n }\n\n static async createNewAnnotation(xref, annotation, dependencies, params) {\n const annotationRef = (annotation.ref ||= xref.getNewTemporaryRef());\n const ap = await this.createNewAppearanceStream(annotation, xref, params);\n const buffer = [];\n let annotationDict;\n\n if (ap) {\n const apRef = xref.getNewTemporaryRef();\n annotationDict = this.createNewDict(annotation, xref, { apRef });\n await writeObject(apRef, ap, buffer, xref);\n dependencies.push({ ref: apRef, data: buffer.join(\"\") });\n } else {\n annotationDict = this.createNewDict(annotation, xref, {});\n }\n if (Number.isInteger(annotation.parentTreeId)) {\n annotationDict.set(\"StructParent\", annotation.parentTreeId);\n }\n\n buffer.length = 0;\n await writeObject(annotationRef, annotationDict, buffer, xref);\n\n return { ref: annotationRef, data: buffer.join(\"\") };\n }\n\n static async createNewPrintAnnotation(\n annotationGlobals,\n xref,\n annotation,\n params\n ) {\n const ap = await this.createNewAppearanceStream(annotation, xref, params);\n const annotationDict = this.createNewDict(annotation, xref, { ap });\n\n const newAnnotation = new this.prototype.constructor({\n dict: annotationDict,\n xref,\n annotationGlobals,\n evaluatorOptions: params.evaluatorOptions,\n });\n\n if (annotation.ref) {\n newAnnotation.ref = newAnnotation.refToReplace = annotation.ref;\n }\n\n return newAnnotation;\n }\n}\n\nclass WidgetAnnotation extends Annotation {\n constructor(params) {\n super(params);\n\n const { dict, xref, annotationGlobals } = params;\n const data = this.data;\n this._needAppearances = params.needAppearances;\n\n data.annotationType = AnnotationType.WIDGET;\n if (data.fieldName === undefined) {\n data.fieldName = this._constructFieldName(dict);\n }\n\n if (data.actions === undefined) {\n data.actions = collectActions(xref, dict, AnnotationActionEventType);\n }\n\n let fieldValue = getInheritableProperty({\n dict,\n key: \"V\",\n getArray: true,\n });\n data.fieldValue = this._decodeFormValue(fieldValue);\n\n const defaultFieldValue = getInheritableProperty({\n dict,\n key: \"DV\",\n getArray: true,\n });\n data.defaultFieldValue = this._decodeFormValue(defaultFieldValue);\n\n if (fieldValue === undefined && annotationGlobals.xfaDatasets) {\n // Try to figure out if we have something in the xfa dataset.\n const path = this._title.str;\n if (path) {\n this._hasValueFromXFA = true;\n data.fieldValue = fieldValue =\n annotationGlobals.xfaDatasets.getValue(path);\n }\n }\n\n // When no \"V\" entry exists, let the fieldValue fallback to the \"DV\" entry\n // (fixes issue13823.pdf).\n if (fieldValue === undefined && data.defaultFieldValue !== null) {\n data.fieldValue = data.defaultFieldValue;\n }\n\n data.alternativeText = stringToPDFString(dict.get(\"TU\") || \"\");\n\n this.setDefaultAppearance(params);\n\n data.hasAppearance ||=\n this._needAppearances &&\n data.fieldValue !== undefined &&\n data.fieldValue !== null;\n\n const fieldType = getInheritableProperty({ dict, key: \"FT\" });\n data.fieldType = fieldType instanceof Name ? fieldType.name : null;\n\n const localResources = getInheritableProperty({ dict, key: \"DR\" });\n const acroFormResources = annotationGlobals.acroForm.get(\"DR\");\n const appearanceResources = this.appearance?.dict.get(\"Resources\");\n\n this._fieldResources = {\n localResources,\n acroFormResources,\n appearanceResources,\n mergedResources: Dict.merge({\n xref,\n dictArray: [localResources, appearanceResources, acroFormResources],\n mergeSubDicts: true,\n }),\n };\n\n data.fieldFlags = getInheritableProperty({ dict, key: \"Ff\" });\n if (!Number.isInteger(data.fieldFlags) || data.fieldFlags < 0) {\n data.fieldFlags = 0;\n }\n\n data.readOnly = this.hasFieldFlag(AnnotationFieldFlag.READONLY);\n data.required = this.hasFieldFlag(AnnotationFieldFlag.REQUIRED);\n data.hidden =\n this._hasFlag(data.annotationFlags, AnnotationFlag.HIDDEN) ||\n this._hasFlag(data.annotationFlags, AnnotationFlag.NOVIEW);\n }\n\n /**\n * Decode the given form value.\n *\n * @private\n * @memberof WidgetAnnotation\n * @param {Array<string>|Name|string} formValue - The (possibly encoded)\n * form value.\n * @returns {Array<string>|string|null}\n */\n _decodeFormValue(formValue) {\n if (Array.isArray(formValue)) {\n return formValue\n .filter(item => typeof item === \"string\")\n .map(item => stringToPDFString(item));\n } else if (formValue instanceof Name) {\n return stringToPDFString(formValue.name);\n } else if (typeof formValue === \"string\") {\n return stringToPDFString(formValue);\n }\n return null;\n }\n\n /**\n * Check if a provided field flag is set.\n *\n * @public\n * @memberof WidgetAnnotation\n * @param {number} flag - Hexadecimal representation for an annotation\n * field characteristic\n * @returns {boolean}\n * @see {@link shared/util.js}\n */\n hasFieldFlag(flag) {\n return !!(this.data.fieldFlags & flag);\n }\n\n /** @inheritdoc */\n _isViewable(flags) {\n // We don't take into account the `NOVIEW` or `HIDDEN` flags here,\n // since the visibility can be changed by js code, hence in case\n // it's made viewable, we should render it (with visibility set to\n // hidden).\n // We don't take into account the `INVISIBLE` flag here, since we've a known\n // annotation type.\n return true;\n }\n\n /** @inheritdoc */\n mustBeViewed(annotationStorage, renderForms) {\n if (renderForms) {\n return this.viewable;\n }\n return (\n super.mustBeViewed(annotationStorage, renderForms) &&\n !this._hasFlag(this.flags, AnnotationFlag.NOVIEW)\n );\n }\n\n getRotationMatrix(annotationStorage) {\n let rotation = annotationStorage?.get(this.data.id)?.rotation;\n if (rotation === undefined) {\n rotation = this.rotation;\n }\n\n if (rotation === 0) {\n return IDENTITY_MATRIX;\n }\n\n const width = this.data.rect[2] - this.data.rect[0];\n const height = this.data.rect[3] - this.data.rect[1];\n\n return getRotationMatrix(rotation, width, height);\n }\n\n getBorderAndBackgroundAppearances(annotationStorage) {\n let rotation = annotationStorage?.get(this.data.id)?.rotation;\n if (rotation === undefined) {\n rotation = this.rotation;\n }\n\n if (!this.backgroundColor && !this.borderColor) {\n return \"\";\n }\n const width = this.data.rect[2] - this.data.rect[0];\n const height = this.data.rect[3] - this.data.rect[1];\n const rect =\n rotation === 0 || rotation === 180\n ? `0 0 ${width} ${height} re`\n : `0 0 ${height} ${width} re`;\n\n let str = \"\";\n if (this.backgroundColor) {\n str = `${getPdfColor(\n this.backgroundColor,\n /* isFill */ true\n )} ${rect} f `;\n }\n\n if (this.borderColor) {\n const borderWidth = this.borderStyle.width || 1;\n str += `${borderWidth} w ${getPdfColor(\n this.borderColor,\n /* isFill */ false\n )} ${rect} S `;\n }\n\n return str;\n }\n\n async getOperatorList(\n evaluator,\n task,\n intent,\n renderForms,\n annotationStorage\n ) {\n // Do not render form elements on the canvas when interactive forms are\n // enabled. The display layer is responsible for rendering them instead.\n if (\n renderForms &&\n !(this instanceof SignatureWidgetAnnotation) &&\n !this.data.noHTML &&\n !this.data.hasOwnCanvas\n ) {\n return {\n opList: new OperatorList(),\n separateForm: true,\n separateCanvas: false,\n };\n }\n\n if (!this._hasText) {\n return super.getOperatorList(\n evaluator,\n task,\n intent,\n renderForms,\n annotationStorage\n );\n }\n\n const content = await this._getAppearance(\n evaluator,\n task,\n intent,\n annotationStorage\n );\n if (this.appearance && content === null) {\n return super.getOperatorList(\n evaluator,\n task,\n intent,\n renderForms,\n annotationStorage\n );\n }\n\n const opList = new OperatorList();\n\n // Even if there is an appearance stream, ignore it. This is the\n // behaviour used by Adobe Reader.\n if (!this._defaultAppearance || content === null) {\n return { opList, separateForm: false, separateCanvas: false };\n }\n\n const isUsingOwnCanvas = !!(\n this.data.hasOwnCanvas && intent & RenderingIntentFlag.DISPLAY\n );\n\n const matrix = [1, 0, 0, 1, 0, 0];\n const bbox = [\n 0,\n 0,\n this.data.rect[2] - this.data.rect[0],\n this.data.rect[3] - this.data.rect[1],\n ];\n const transform = getTransformMatrix(this.data.rect, bbox, matrix);\n\n let optionalContent;\n if (this.oc) {\n optionalContent = await evaluator.parseMarkedContentProps(\n this.oc,\n /* resources = */ null\n );\n }\n if (optionalContent !== undefined) {\n opList.addOp(OPS.beginMarkedContentProps, [\"OC\", optionalContent]);\n }\n\n opList.addOp(OPS.beginAnnotation, [\n this.data.id,\n this.data.rect,\n transform,\n this.getRotationMatrix(annotationStorage),\n isUsingOwnCanvas,\n ]);\n\n const stream = new StringStream(content);\n await evaluator.getOperatorList({\n stream,\n task,\n resources: this._fieldResources.mergedResources,\n operatorList: opList,\n });\n opList.addOp(OPS.endAnnotation, []);\n\n if (optionalContent !== undefined) {\n opList.addOp(OPS.endMarkedContent, []);\n }\n return { opList, separateForm: false, separateCanvas: isUsingOwnCanvas };\n }\n\n _getMKDict(rotation) {\n const mk = new Dict(null);\n if (rotation) {\n mk.set(\"R\", rotation);\n }\n if (this.borderColor) {\n mk.set(\"BC\", getPdfColorArray(this.borderColor));\n }\n if (this.backgroundColor) {\n mk.set(\"BG\", getPdfColorArray(this.backgroundColor));\n }\n return mk.size > 0 ? mk : null;\n }\n\n amendSavedDict(annotationStorage, dict) {}\n\n async save(evaluator, task, annotationStorage) {\n const storageEntry = annotationStorage?.get(this.data.id);\n let value = storageEntry?.value,\n rotation = storageEntry?.rotation;\n if (value === this.data.fieldValue || value === undefined) {\n if (!this._hasValueFromXFA && rotation === undefined) {\n return null;\n }\n value ||= this.data.fieldValue;\n }\n\n // Value can be an array (with choice list and multiple selections)\n if (\n rotation === undefined &&\n !this._hasValueFromXFA &&\n Array.isArray(value) &&\n Array.isArray(this.data.fieldValue) &&\n value.length === this.data.fieldValue.length &&\n value.every((x, i) => x === this.data.fieldValue[i])\n ) {\n return null;\n }\n\n if (rotation === undefined) {\n rotation = this.rotation;\n }\n\n let appearance = null;\n if (!this._needAppearances) {\n appearance = await this._getAppearance(\n evaluator,\n task,\n RenderingIntentFlag.SAVE,\n annotationStorage\n );\n if (appearance === null) {\n // Appearance didn't change.\n return null;\n }\n } else {\n // No need to create an appearance: the pdf has the flag /NeedAppearances\n // which means that it's up to the reader to produce an appearance.\n }\n\n let needAppearances = false;\n if (appearance?.needAppearances) {\n needAppearances = true;\n appearance = null;\n }\n\n const { xref } = evaluator;\n\n const originalDict = xref.fetchIfRef(this.ref);\n if (!(originalDict instanceof Dict)) {\n return null;\n }\n\n const dict = new Dict(xref);\n for (const key of originalDict.getKeys()) {\n if (key !== \"AP\") {\n dict.set(key, originalDict.getRaw(key));\n }\n }\n\n const xfa = {\n path: this.data.fieldName,\n value,\n };\n\n const encoder = val => {\n return isAscii(val)\n ? val\n : stringToUTF16String(val, /* bigEndian = */ true);\n };\n dict.set(\"V\", Array.isArray(value) ? value.map(encoder) : encoder(value));\n this.amendSavedDict(annotationStorage, dict);\n\n const maybeMK = this._getMKDict(rotation);\n if (maybeMK) {\n dict.set(\"MK\", maybeMK);\n }\n\n const buffer = [];\n const changes = [\n // data for the original object\n // V field changed + reference for new AP\n { ref: this.ref, data: \"\", xfa, needAppearances },\n ];\n if (appearance !== null) {\n const newRef = xref.getNewTemporaryRef();\n const AP = new Dict(xref);\n dict.set(\"AP\", AP);\n AP.set(\"N\", newRef);\n\n const resources = this._getSaveFieldResources(xref);\n const appearanceStream = new StringStream(appearance);\n const appearanceDict = (appearanceStream.dict = new Dict(xref));\n appearanceDict.set(\"Subtype\", Name.get(\"Form\"));\n appearanceDict.set(\"Resources\", resources);\n appearanceDict.set(\"BBox\", [\n 0,\n 0,\n this.data.rect[2] - this.data.rect[0],\n this.data.rect[3] - this.data.rect[1],\n ]);\n\n const rotationMatrix = this.getRotationMatrix(annotationStorage);\n if (rotationMatrix !== IDENTITY_MATRIX) {\n // The matrix isn't the identity one.\n appearanceDict.set(\"Matrix\", rotationMatrix);\n }\n\n await writeObject(newRef, appearanceStream, buffer, xref);\n\n changes.push(\n // data for the new AP\n {\n ref: newRef,\n data: buffer.join(\"\"),\n xfa: null,\n needAppearances: false,\n }\n );\n buffer.length = 0;\n }\n\n dict.set(\"M\", `D:${getModificationDate()}`);\n await writeObject(this.ref, dict, buffer, xref);\n\n changes[0].data = buffer.join(\"\");\n\n return changes;\n }\n\n async _getAppearance(evaluator, task, intent, annotationStorage) {\n const isPassword = this.hasFieldFlag(AnnotationFieldFlag.PASSWORD);\n if (isPassword) {\n return null;\n }\n const storageEntry = annotationStorage?.get(this.data.id);\n let value, rotation;\n if (storageEntry) {\n value = storageEntry.formattedValue || storageEntry.value;\n rotation = storageEntry.rotation;\n }\n\n if (\n rotation === undefined &&\n value === undefined &&\n !this._needAppearances\n ) {\n if (!this._hasValueFromXFA || this.appearance) {\n // The annotation hasn't been rendered so use the appearance.\n return null;\n }\n }\n\n // Empty or it has a trailing whitespace.\n const colors = this.getBorderAndBackgroundAppearances(annotationStorage);\n\n if (value === undefined) {\n // The annotation has its value in XFA datasets but not in the V field.\n value = this.data.fieldValue;\n if (!value) {\n return `/Tx BMC q ${colors}Q EMC`;\n }\n }\n\n if (Array.isArray(value) && value.length === 1) {\n value = value[0];\n }\n\n assert(typeof value === \"string\", \"Expected `value` to be a string.\");\n value = value.trim();\n\n if (this.data.combo) {\n // The value can be one of the exportValue or any other values.\n const option = this.data.options.find(\n ({ exportValue }) => value === exportValue\n );\n value = option?.displayValue || value;\n }\n\n if (value === \"\") {\n // the field is empty: nothing to render\n return `/Tx BMC q ${colors}Q EMC`;\n }\n\n if (rotation === undefined) {\n rotation = this.rotation;\n }\n\n let lineCount = -1;\n let lines;\n\n // We could have a text containing for example some sequences of chars and\n // their diacritics (e.g. \"é\".normalize(\"NFKD\") shows 1 char when it's 2).\n // Positioning diacritics is really something we don't want to do here.\n // So if a font has a glyph for a acute accent and one for \"e\" then we won't\n // get any encoding issues but we'll render \"e\" and then \"´\".\n // It's why we normalize the string. We use NFC to preserve the initial\n // string, (e.g. \"²\".normalize(\"NFC\") === \"²\"\n // but \"²\".normalize(\"NFKC\") === \"2\").\n //\n // TODO: it isn't a perfect solution, some chars like \"ẹ́\" will be\n // decomposed into two chars (\"ẹ\" and \"´\"), so we should detect such\n // situations and then use either FakeUnicodeFont or set the\n // /NeedAppearances flag.\n if (this.data.multiLine) {\n lines = value.split(/\\r\\n?|\\n/).map(line => line.normalize(\"NFC\"));\n lineCount = lines.length;\n } else {\n lines = [value.replace(/\\r\\n?|\\n/, \"\").normalize(\"NFC\")];\n }\n\n const defaultPadding = 1;\n const defaultHPadding = 2;\n let totalHeight = this.data.rect[3] - this.data.rect[1];\n let totalWidth = this.data.rect[2] - this.data.rect[0];\n\n if (rotation === 90 || rotation === 270) {\n [totalWidth, totalHeight] = [totalHeight, totalWidth];\n }\n\n if (!this._defaultAppearance) {\n // The DA is required and must be a string.\n // If there is no font named Helvetica in the resource dictionary,\n // the evaluator will fall back to a default font.\n // Doing so prevents exceptions and allows saving/printing\n // the file as expected.\n this.data.defaultAppearanceData = parseDefaultAppearance(\n (this._defaultAppearance = \"/Helvetica 0 Tf 0 g\")\n );\n }\n\n let font = await WidgetAnnotation._getFontData(\n evaluator,\n task,\n this.data.defaultAppearanceData,\n this._fieldResources.mergedResources\n );\n\n let defaultAppearance, fontSize, lineHeight;\n const encodedLines = [];\n let encodingError = false;\n for (const line of lines) {\n const encodedString = font.encodeString(line);\n if (encodedString.length > 1) {\n encodingError = true;\n }\n encodedLines.push(encodedString.join(\"\"));\n }\n\n if (encodingError && intent & RenderingIntentFlag.SAVE) {\n // We don't have a way to render the field, so we just rely on the\n // /NeedAppearances trick to let the different sofware correctly render\n // this pdf.\n return { needAppearances: true };\n }\n\n // We check that the font is able to encode the string.\n if (encodingError && this._isOffscreenCanvasSupported) {\n // If it can't then we fallback on fake unicode font (mapped to sans-serif\n // for the rendering).\n // It means that a printed form can be rendered differently (it depends on\n // the sans-serif font) but at least we've something to render.\n // In an ideal world the associated font should correctly handle the\n // possible chars but a user can add a smiley or whatever.\n // We could try to embed a font but it means that we must have access\n // to the raw font file.\n const fontFamily = this.data.comb ? \"monospace\" : \"sans-serif\";\n const fakeUnicodeFont = new FakeUnicodeFont(evaluator.xref, fontFamily);\n const resources = fakeUnicodeFont.createFontResources(lines.join(\"\"));\n const newFont = resources.getRaw(\"Font\");\n\n if (this._fieldResources.mergedResources.has(\"Font\")) {\n const oldFont = this._fieldResources.mergedResources.get(\"Font\");\n for (const key of newFont.getKeys()) {\n oldFont.set(key, newFont.getRaw(key));\n }\n } else {\n this._fieldResources.mergedResources.set(\"Font\", newFont);\n }\n\n const fontName = fakeUnicodeFont.fontName.name;\n font = await WidgetAnnotation._getFontData(\n evaluator,\n task,\n { fontName, fontSize: 0 },\n resources\n );\n\n for (let i = 0, ii = encodedLines.length; i < ii; i++) {\n encodedLines[i] = stringToUTF16String(lines[i]);\n }\n\n const savedDefaultAppearance = Object.assign(\n Object.create(null),\n this.data.defaultAppearanceData\n );\n this.data.defaultAppearanceData.fontSize = 0;\n this.data.defaultAppearanceData.fontName = fontName;\n\n [defaultAppearance, fontSize, lineHeight] = this._computeFontSize(\n totalHeight - 2 * defaultPadding,\n totalWidth - 2 * defaultHPadding,\n value,\n font,\n lineCount\n );\n\n this.data.defaultAppearanceData = savedDefaultAppearance;\n } else {\n if (!this._isOffscreenCanvasSupported) {\n warn(\n \"_getAppearance: OffscreenCanvas is not supported, annotation may not render correctly.\"\n );\n }\n\n [defaultAppearance, fontSize, lineHeight] = this._computeFontSize(\n totalHeight - 2 * defaultPadding,\n totalWidth - 2 * defaultHPadding,\n value,\n font,\n lineCount\n );\n }\n\n let descent = font.descent;\n if (isNaN(descent)) {\n descent = BASELINE_FACTOR * lineHeight;\n } else {\n descent = Math.max(\n BASELINE_FACTOR * lineHeight,\n Math.abs(descent) * fontSize\n );\n }\n\n // Take into account the space we have to compute the default vertical\n // padding.\n const defaultVPadding = Math.min(\n Math.floor((totalHeight - fontSize) / 2),\n defaultPadding\n );\n const alignment = this.data.textAlignment;\n\n if (this.data.multiLine) {\n return this._getMultilineAppearance(\n defaultAppearance,\n encodedLines,\n font,\n fontSize,\n totalWidth,\n totalHeight,\n alignment,\n defaultHPadding,\n defaultVPadding,\n descent,\n lineHeight,\n annotationStorage\n );\n }\n\n if (this.data.comb) {\n return this._getCombAppearance(\n defaultAppearance,\n font,\n encodedLines[0],\n fontSize,\n totalWidth,\n totalHeight,\n defaultHPadding,\n defaultVPadding,\n descent,\n lineHeight,\n annotationStorage\n );\n }\n\n const bottomPadding = defaultVPadding + descent;\n if (alignment === 0 || alignment > 2) {\n // Left alignment: nothing to do\n return (\n `/Tx BMC q ${colors}BT ` +\n defaultAppearance +\n ` 1 0 0 1 ${numberToString(defaultHPadding)} ${numberToString(\n bottomPadding\n )} Tm (${escapeString(encodedLines[0])}) Tj` +\n \" ET Q EMC\"\n );\n }\n\n const prevInfo = { shift: 0 };\n const renderedText = this._renderText(\n encodedLines[0],\n font,\n fontSize,\n totalWidth,\n alignment,\n prevInfo,\n defaultHPadding,\n bottomPadding\n );\n return (\n `/Tx BMC q ${colors}BT ` +\n defaultAppearance +\n ` 1 0 0 1 0 0 Tm ${renderedText}` +\n \" ET Q EMC\"\n );\n }\n\n static async _getFontData(evaluator, task, appearanceData, resources) {\n const operatorList = new OperatorList();\n const initialState = {\n font: null,\n clone() {\n return this;\n },\n };\n\n const { fontName, fontSize } = appearanceData;\n await evaluator.handleSetFont(\n resources,\n [fontName && Name.get(fontName), fontSize],\n /* fontRef = */ null,\n operatorList,\n task,\n initialState,\n /* fallbackFontDict = */ null\n );\n\n return initialState.font;\n }\n\n _getTextWidth(text, font) {\n return (\n font\n .charsToGlyphs(text)\n .reduce((width, glyph) => width + glyph.width, 0) / 1000\n );\n }\n\n _computeFontSize(height, width, text, font, lineCount) {\n let { fontSize } = this.data.defaultAppearanceData;\n let lineHeight = (fontSize || 12) * LINE_FACTOR,\n numberOfLines = Math.round(height / lineHeight);\n\n if (!fontSize) {\n // A zero value for size means that the font shall be auto-sized:\n // its size shall be computed as a function of the height of the\n // annotation rectangle (see 12.7.3.3).\n\n const roundWithTwoDigits = x => Math.floor(x * 100) / 100;\n\n if (lineCount === -1) {\n const textWidth = this._getTextWidth(text, font);\n fontSize = roundWithTwoDigits(\n Math.min(\n height / LINE_FACTOR,\n textWidth > width ? width / textWidth : Infinity\n )\n );\n numberOfLines = 1;\n } else {\n const lines = text.split(/\\r\\n?|\\n/);\n const cachedLines = [];\n for (const line of lines) {\n const encoded = font.encodeString(line).join(\"\");\n const glyphs = font.charsToGlyphs(encoded);\n const positions = font.getCharPositions(encoded);\n cachedLines.push({\n line: encoded,\n glyphs,\n positions,\n });\n }\n\n const isTooBig = fsize => {\n // Return true when the text doesn't fit the given height.\n let totalHeight = 0;\n for (const cache of cachedLines) {\n const chunks = this._splitLine(null, font, fsize, width, cache);\n totalHeight += chunks.length * fsize;\n if (totalHeight > height) {\n return true;\n }\n }\n return false;\n };\n\n // Hard to guess how many lines there are.\n // The field may have been sized to have 10 lines\n // and the user entered only 1 so if we get font size from\n // height and number of lines then we'll get something too big.\n // So we compute a fake number of lines based on height and\n // a font size equal to 12 (this is the default font size in\n // Acrobat).\n // Then we'll adjust font size to what we have really.\n numberOfLines = Math.max(numberOfLines, lineCount);\n\n while (true) {\n lineHeight = height / numberOfLines;\n fontSize = roundWithTwoDigits(lineHeight / LINE_FACTOR);\n\n if (isTooBig(fontSize)) {\n numberOfLines++;\n continue;\n }\n\n break;\n }\n }\n\n const { fontName, fontColor } = this.data.defaultAppearanceData;\n this._defaultAppearance = createDefaultAppearance({\n fontSize,\n fontName,\n fontColor,\n });\n }\n\n return [this._defaultAppearance, fontSize, height / numberOfLines];\n }\n\n _renderText(\n text,\n font,\n fontSize,\n totalWidth,\n alignment,\n prevInfo,\n hPadding,\n vPadding\n ) {\n // TODO: we need to take into account (if possible) how the text\n // is rendered. For example in arabic, the cumulated width of some\n // glyphs isn't equal to the width of the rendered glyphs because\n // of ligatures.\n let shift;\n if (alignment === 1) {\n // Center\n const width = this._getTextWidth(text, font) * fontSize;\n shift = (totalWidth - width) / 2;\n } else if (alignment === 2) {\n // Right\n const width = this._getTextWidth(text, font) * fontSize;\n shift = totalWidth - width - hPadding;\n } else {\n shift = hPadding;\n }\n const shiftStr = numberToString(shift - prevInfo.shift);\n prevInfo.shift = shift;\n vPadding = numberToString(vPadding);\n\n return `${shiftStr} ${vPadding} Td (${escapeString(text)}) Tj`;\n }\n\n /**\n * @private\n */\n _getSaveFieldResources(xref) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n this.data.defaultAppearanceData,\n \"Expected `_defaultAppearanceData` to have been set.\"\n );\n }\n const { localResources, appearanceResources, acroFormResources } =\n this._fieldResources;\n\n const fontName = this.data.defaultAppearanceData?.fontName;\n if (!fontName) {\n return localResources || Dict.empty;\n }\n\n for (const resources of [localResources, appearanceResources]) {\n if (resources instanceof Dict) {\n const localFont = resources.get(\"Font\");\n if (localFont instanceof Dict && localFont.has(fontName)) {\n return resources;\n }\n }\n }\n if (acroFormResources instanceof Dict) {\n const acroFormFont = acroFormResources.get(\"Font\");\n if (acroFormFont instanceof Dict && acroFormFont.has(fontName)) {\n const subFontDict = new Dict(xref);\n subFontDict.set(fontName, acroFormFont.getRaw(fontName));\n\n const subResourcesDict = new Dict(xref);\n subResourcesDict.set(\"Font\", subFontDict);\n\n return Dict.merge({\n xref,\n dictArray: [subResourcesDict, localResources],\n mergeSubDicts: true,\n });\n }\n }\n return localResources || Dict.empty;\n }\n\n getFieldObject() {\n return null;\n }\n}\n\nclass TextWidgetAnnotation extends WidgetAnnotation {\n constructor(params) {\n super(params);\n\n this.data.hasOwnCanvas = this.data.readOnly && !this.data.noHTML;\n this._hasText = true;\n\n const dict = params.dict;\n\n // The field value is always a string.\n if (typeof this.data.fieldValue !== \"string\") {\n this.data.fieldValue = \"\";\n }\n\n // Determine the alignment of text in the field.\n let alignment = getInheritableProperty({ dict, key: \"Q\" });\n if (!Number.isInteger(alignment) || alignment < 0 || alignment > 2) {\n alignment = null;\n }\n this.data.textAlignment = alignment;\n\n // Determine the maximum length of text in the field.\n let maximumLength = getInheritableProperty({ dict, key: \"MaxLen\" });\n if (!Number.isInteger(maximumLength) || maximumLength < 0) {\n maximumLength = 0;\n }\n this.data.maxLen = maximumLength;\n\n // Process field flags for the display layer.\n this.data.multiLine = this.hasFieldFlag(AnnotationFieldFlag.MULTILINE);\n this.data.comb =\n this.hasFieldFlag(AnnotationFieldFlag.COMB) &&\n !this.hasFieldFlag(AnnotationFieldFlag.MULTILINE) &&\n !this.hasFieldFlag(AnnotationFieldFlag.PASSWORD) &&\n !this.hasFieldFlag(AnnotationFieldFlag.FILESELECT) &&\n this.data.maxLen !== 0;\n this.data.doNotScroll = this.hasFieldFlag(AnnotationFieldFlag.DONOTSCROLL);\n }\n\n get hasTextContent() {\n return !!this.appearance && !this._needAppearances;\n }\n\n _getCombAppearance(\n defaultAppearance,\n font,\n text,\n fontSize,\n width,\n height,\n hPadding,\n vPadding,\n descent,\n lineHeight,\n annotationStorage\n ) {\n const combWidth = width / this.data.maxLen;\n // Empty or it has a trailing whitespace.\n const colors = this.getBorderAndBackgroundAppearances(annotationStorage);\n\n const buf = [];\n const positions = font.getCharPositions(text);\n for (const [start, end] of positions) {\n buf.push(`(${escapeString(text.substring(start, end))}) Tj`);\n }\n\n const renderedComb = buf.join(` ${numberToString(combWidth)} 0 Td `);\n return (\n `/Tx BMC q ${colors}BT ` +\n defaultAppearance +\n ` 1 0 0 1 ${numberToString(hPadding)} ${numberToString(\n vPadding + descent\n )} Tm ${renderedComb}` +\n \" ET Q EMC\"\n );\n }\n\n _getMultilineAppearance(\n defaultAppearance,\n lines,\n font,\n fontSize,\n width,\n height,\n alignment,\n hPadding,\n vPadding,\n descent,\n lineHeight,\n annotationStorage\n ) {\n const buf = [];\n const totalWidth = width - 2 * hPadding;\n const prevInfo = { shift: 0 };\n for (let i = 0, ii = lines.length; i < ii; i++) {\n const line = lines[i];\n const chunks = this._splitLine(line, font, fontSize, totalWidth);\n for (let j = 0, jj = chunks.length; j < jj; j++) {\n const chunk = chunks[j];\n const vShift =\n i === 0 && j === 0 ? -vPadding - (lineHeight - descent) : -lineHeight;\n buf.push(\n this._renderText(\n chunk,\n font,\n fontSize,\n width,\n alignment,\n prevInfo,\n hPadding,\n vShift\n )\n );\n }\n }\n\n // Empty or it has a trailing whitespace.\n const colors = this.getBorderAndBackgroundAppearances(annotationStorage);\n const renderedText = buf.join(\"\\n\");\n\n return (\n `/Tx BMC q ${colors}BT ` +\n defaultAppearance +\n ` 1 0 0 1 0 ${numberToString(height)} Tm ${renderedText}` +\n \" ET Q EMC\"\n );\n }\n\n _splitLine(line, font, fontSize, width, cache = {}) {\n line = cache.line || line;\n\n const glyphs = cache.glyphs || font.charsToGlyphs(line);\n\n if (glyphs.length <= 1) {\n // Nothing to split\n return [line];\n }\n\n const positions = cache.positions || font.getCharPositions(line);\n const scale = fontSize / 1000;\n const chunks = [];\n\n let lastSpacePosInStringStart = -1,\n lastSpacePosInStringEnd = -1,\n lastSpacePos = -1,\n startChunk = 0,\n currentWidth = 0;\n\n for (let i = 0, ii = glyphs.length; i < ii; i++) {\n const [start, end] = positions[i];\n const glyph = glyphs[i];\n const glyphWidth = glyph.width * scale;\n if (glyph.unicode === \" \") {\n if (currentWidth + glyphWidth > width) {\n // We can break here\n chunks.push(line.substring(startChunk, start));\n startChunk = start;\n currentWidth = glyphWidth;\n lastSpacePosInStringStart = -1;\n lastSpacePos = -1;\n } else {\n currentWidth += glyphWidth;\n lastSpacePosInStringStart = start;\n lastSpacePosInStringEnd = end;\n lastSpacePos = i;\n }\n } else if (currentWidth + glyphWidth > width) {\n // We must break to the last white position (if available)\n if (lastSpacePosInStringStart !== -1) {\n chunks.push(line.substring(startChunk, lastSpacePosInStringEnd));\n startChunk = lastSpacePosInStringEnd;\n i = lastSpacePos + 1;\n lastSpacePosInStringStart = -1;\n currentWidth = 0;\n } else {\n // Just break in the middle of the word\n chunks.push(line.substring(startChunk, start));\n startChunk = start;\n currentWidth = glyphWidth;\n }\n } else {\n currentWidth += glyphWidth;\n }\n }\n\n if (startChunk < line.length) {\n chunks.push(line.substring(startChunk, line.length));\n }\n\n return chunks;\n }\n\n getFieldObject() {\n return {\n id: this.data.id,\n value: this.data.fieldValue,\n defaultValue: this.data.defaultFieldValue || \"\",\n multiline: this.data.multiLine,\n password: this.hasFieldFlag(AnnotationFieldFlag.PASSWORD),\n charLimit: this.data.maxLen,\n comb: this.data.comb,\n editable: !this.data.readOnly,\n hidden: this.data.hidden,\n name: this.data.fieldName,\n rect: this.data.rect,\n actions: this.data.actions,\n page: this.data.pageIndex,\n strokeColor: this.data.borderColor,\n fillColor: this.data.backgroundColor,\n rotation: this.rotation,\n type: \"text\",\n };\n }\n}\n\nclass ButtonWidgetAnnotation extends WidgetAnnotation {\n constructor(params) {\n super(params);\n\n this.checkedAppearance = null;\n this.uncheckedAppearance = null;\n\n this.data.checkBox =\n !this.hasFieldFlag(AnnotationFieldFlag.RADIO) &&\n !this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON);\n this.data.radioButton =\n this.hasFieldFlag(AnnotationFieldFlag.RADIO) &&\n !this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON);\n this.data.pushButton = this.hasFieldFlag(AnnotationFieldFlag.PUSHBUTTON);\n this.data.isTooltipOnly = false;\n\n if (this.data.checkBox) {\n this._processCheckBox(params);\n } else if (this.data.radioButton) {\n this._processRadioButton(params);\n } else if (this.data.pushButton) {\n this.data.hasOwnCanvas = true;\n this.data.noHTML = false;\n this._processPushButton(params);\n } else {\n warn(\"Invalid field flags for button widget annotation\");\n }\n }\n\n async getOperatorList(\n evaluator,\n task,\n intent,\n renderForms,\n annotationStorage\n ) {\n if (this.data.pushButton) {\n return super.getOperatorList(\n evaluator,\n task,\n intent,\n false, // we use normalAppearance to render the button\n annotationStorage\n );\n }\n\n let value = null;\n let rotation = null;\n if (annotationStorage) {\n const storageEntry = annotationStorage.get(this.data.id);\n value = storageEntry ? storageEntry.value : null;\n rotation = storageEntry ? storageEntry.rotation : null;\n }\n\n if (value === null && this.appearance) {\n // Nothing in the annotationStorage.\n // But we've a default appearance so use it.\n return super.getOperatorList(\n evaluator,\n task,\n intent,\n renderForms,\n annotationStorage\n );\n }\n\n if (value === null || value === undefined) {\n // There is no default appearance so use the one derived\n // from the field value.\n value = this.data.checkBox\n ? this.data.fieldValue === this.data.exportValue\n : this.data.fieldValue === this.data.buttonValue;\n }\n\n const appearance = value\n ? this.checkedAppearance\n : this.uncheckedAppearance;\n if (appearance) {\n const savedAppearance = this.appearance;\n const savedMatrix = appearance.dict.getArray(\"Matrix\") || IDENTITY_MATRIX;\n\n if (rotation) {\n appearance.dict.set(\n \"Matrix\",\n this.getRotationMatrix(annotationStorage)\n );\n }\n\n this.appearance = appearance;\n const operatorList = super.getOperatorList(\n evaluator,\n task,\n intent,\n renderForms,\n annotationStorage\n );\n this.appearance = savedAppearance;\n appearance.dict.set(\"Matrix\", savedMatrix);\n return operatorList;\n }\n\n // No appearance\n return {\n opList: new OperatorList(),\n separateForm: false,\n separateCanvas: false,\n };\n }\n\n async save(evaluator, task, annotationStorage) {\n if (this.data.checkBox) {\n return this._saveCheckbox(evaluator, task, annotationStorage);\n }\n\n if (this.data.radioButton) {\n return this._saveRadioButton(evaluator, task, annotationStorage);\n }\n\n // Nothing to save\n return null;\n }\n\n async _saveCheckbox(evaluator, task, annotationStorage) {\n if (!annotationStorage) {\n return null;\n }\n const storageEntry = annotationStorage.get(this.data.id);\n let rotation = storageEntry?.rotation,\n value = storageEntry?.value;\n\n if (rotation === undefined) {\n if (value === undefined) {\n return null;\n }\n\n const defaultValue = this.data.fieldValue === this.data.exportValue;\n if (defaultValue === value) {\n return null;\n }\n }\n\n const dict = evaluator.xref.fetchIfRef(this.ref);\n if (!(dict instanceof Dict)) {\n return null;\n }\n\n if (rotation === undefined) {\n rotation = this.rotation;\n }\n if (value === undefined) {\n value = this.data.fieldValue === this.data.exportValue;\n }\n\n const xfa = {\n path: this.data.fieldName,\n value: value ? this.data.exportValue : \"\",\n };\n\n const name = Name.get(value ? this.data.exportValue : \"Off\");\n dict.set(\"V\", name);\n dict.set(\"AS\", name);\n dict.set(\"M\", `D:${getModificationDate()}`);\n\n const maybeMK = this._getMKDict(rotation);\n if (maybeMK) {\n dict.set(\"MK\", maybeMK);\n }\n\n const buffer = [];\n await writeObject(this.ref, dict, buffer, evaluator.xref);\n\n return [{ ref: this.ref, data: buffer.join(\"\"), xfa }];\n }\n\n async _saveRadioButton(evaluator, task, annotationStorage) {\n if (!annotationStorage) {\n return null;\n }\n const storageEntry = annotationStorage.get(this.data.id);\n let rotation = storageEntry?.rotation,\n value = storageEntry?.value;\n\n if (rotation === undefined) {\n if (value === undefined) {\n return null;\n }\n\n const defaultValue = this.data.fieldValue === this.data.buttonValue;\n if (defaultValue === value) {\n return null;\n }\n }\n\n const dict = evaluator.xref.fetchIfRef(this.ref);\n if (!(dict instanceof Dict)) {\n return null;\n }\n\n if (value === undefined) {\n value = this.data.fieldValue === this.data.buttonValue;\n }\n\n if (rotation === undefined) {\n rotation = this.rotation;\n }\n\n const xfa = {\n path: this.data.fieldName,\n value: value ? this.data.buttonValue : \"\",\n };\n\n const name = Name.get(value ? this.data.buttonValue : \"Off\");\n const buffer = [];\n let parentData = null;\n\n if (value) {\n if (this.parent instanceof Ref) {\n const parent = evaluator.xref.fetch(this.parent);\n parent.set(\"V\", name);\n await writeObject(this.parent, parent, buffer, evaluator.xref);\n parentData = buffer.join(\"\");\n buffer.length = 0;\n } else if (this.parent instanceof Dict) {\n this.parent.set(\"V\", name);\n }\n }\n\n dict.set(\"AS\", name);\n dict.set(\"M\", `D:${getModificationDate()}`);\n\n const maybeMK = this._getMKDict(rotation);\n if (maybeMK) {\n dict.set(\"MK\", maybeMK);\n }\n\n await writeObject(this.ref, dict, buffer, evaluator.xref);\n const newRefs = [{ ref: this.ref, data: buffer.join(\"\"), xfa }];\n if (parentData) {\n newRefs.push({ ref: this.parent, data: parentData, xfa: null });\n }\n\n return newRefs;\n }\n\n _getDefaultCheckedAppearance(params, type) {\n const width = this.data.rect[2] - this.data.rect[0];\n const height = this.data.rect[3] - this.data.rect[1];\n const bbox = [0, 0, width, height];\n\n // Ratio used to have a mark slightly smaller than the bbox.\n const FONT_RATIO = 0.8;\n const fontSize = Math.min(width, height) * FONT_RATIO;\n\n // Char Metrics\n // Widths came from widths for ZapfDingbats.\n // Heights are guessed with Fontforge and FoxitDingbats.pfb.\n let metrics, char;\n if (type === \"check\") {\n // Char 33 (2713 in unicode)\n metrics = {\n width: 0.755 * fontSize,\n height: 0.705 * fontSize,\n };\n char = \"\\x33\";\n } else if (type === \"disc\") {\n // Char 6C (25CF in unicode)\n metrics = {\n width: 0.791 * fontSize,\n height: 0.705 * fontSize,\n };\n char = \"\\x6C\";\n } else {\n unreachable(`_getDefaultCheckedAppearance - unsupported type: ${type}`);\n }\n\n // Values to center the glyph in the bbox.\n const xShift = numberToString((width - metrics.width) / 2);\n const yShift = numberToString((height - metrics.height) / 2);\n\n const appearance = `q BT /PdfJsZaDb ${fontSize} Tf 0 g ${xShift} ${yShift} Td (${char}) Tj ET Q`;\n\n const appearanceStreamDict = new Dict(params.xref);\n appearanceStreamDict.set(\"FormType\", 1);\n appearanceStreamDict.set(\"Subtype\", Name.get(\"Form\"));\n appearanceStreamDict.set(\"Type\", Name.get(\"XObject\"));\n appearanceStreamDict.set(\"BBox\", bbox);\n appearanceStreamDict.set(\"Matrix\", [1, 0, 0, 1, 0, 0]);\n appearanceStreamDict.set(\"Length\", appearance.length);\n\n const resources = new Dict(params.xref);\n const font = new Dict(params.xref);\n font.set(\"PdfJsZaDb\", this.fallbackFontDict);\n resources.set(\"Font\", font);\n\n appearanceStreamDict.set(\"Resources\", resources);\n\n this.checkedAppearance = new StringStream(appearance);\n this.checkedAppearance.dict = appearanceStreamDict;\n\n this._streams.push(this.checkedAppearance);\n }\n\n _processCheckBox(params) {\n const customAppearance = params.dict.get(\"AP\");\n if (!(customAppearance instanceof Dict)) {\n return;\n }\n\n const normalAppearance = customAppearance.get(\"N\");\n if (!(normalAppearance instanceof Dict)) {\n return;\n }\n\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=1722036.\n // If we've an AS and a V then take AS.\n const asValue = this._decodeFormValue(params.dict.get(\"AS\"));\n if (typeof asValue === \"string\") {\n this.data.fieldValue = asValue;\n }\n\n const yes =\n this.data.fieldValue !== null && this.data.fieldValue !== \"Off\"\n ? this.data.fieldValue\n : \"Yes\";\n\n const exportValues = normalAppearance.getKeys();\n if (exportValues.length === 0) {\n exportValues.push(\"Off\", yes);\n } else if (exportValues.length === 1) {\n if (exportValues[0] === \"Off\") {\n exportValues.push(yes);\n } else {\n exportValues.unshift(\"Off\");\n }\n } else if (exportValues.includes(yes)) {\n exportValues.length = 0;\n exportValues.push(\"Off\", yes);\n } else {\n const otherYes = exportValues.find(v => v !== \"Off\");\n exportValues.length = 0;\n exportValues.push(\"Off\", otherYes);\n }\n\n // Don't use a \"V\" entry pointing to a non-existent appearance state,\n // see e.g. bug1720411.pdf where it's an *empty* Name-instance.\n if (!exportValues.includes(this.data.fieldValue)) {\n this.data.fieldValue = \"Off\";\n }\n\n this.data.exportValue = exportValues[1];\n\n const checkedAppearance = normalAppearance.get(this.data.exportValue);\n this.checkedAppearance =\n checkedAppearance instanceof BaseStream ? checkedAppearance : null;\n const uncheckedAppearance = normalAppearance.get(\"Off\");\n this.uncheckedAppearance =\n uncheckedAppearance instanceof BaseStream ? uncheckedAppearance : null;\n\n if (this.checkedAppearance) {\n this._streams.push(this.checkedAppearance);\n } else {\n this._getDefaultCheckedAppearance(params, \"check\");\n }\n if (this.uncheckedAppearance) {\n this._streams.push(this.uncheckedAppearance);\n }\n this._fallbackFontDict = this.fallbackFontDict;\n if (this.data.defaultFieldValue === null) {\n this.data.defaultFieldValue = \"Off\";\n }\n }\n\n _processRadioButton(params) {\n this.data.buttonValue = null;\n\n // The parent field's `V` entry holds a `Name` object with the appearance\n // state of whichever child field is currently in the \"on\" state.\n const fieldParent = params.dict.get(\"Parent\");\n if (fieldParent instanceof Dict) {\n this.parent = params.dict.getRaw(\"Parent\");\n const fieldParentValue = fieldParent.get(\"V\");\n if (fieldParentValue instanceof Name) {\n this.data.fieldValue = this._decodeFormValue(fieldParentValue);\n }\n }\n\n // The button's value corresponds to its appearance state.\n const appearanceStates = params.dict.get(\"AP\");\n if (!(appearanceStates instanceof Dict)) {\n return;\n }\n const normalAppearance = appearanceStates.get(\"N\");\n if (!(normalAppearance instanceof Dict)) {\n return;\n }\n for (const key of normalAppearance.getKeys()) {\n if (key !== \"Off\") {\n this.data.buttonValue = this._decodeFormValue(key);\n break;\n }\n }\n\n const checkedAppearance = normalAppearance.get(this.data.buttonValue);\n this.checkedAppearance =\n checkedAppearance instanceof BaseStream ? checkedAppearance : null;\n const uncheckedAppearance = normalAppearance.get(\"Off\");\n this.uncheckedAppearance =\n uncheckedAppearance instanceof BaseStream ? uncheckedAppearance : null;\n\n if (this.checkedAppearance) {\n this._streams.push(this.checkedAppearance);\n } else {\n this._getDefaultCheckedAppearance(params, \"disc\");\n }\n if (this.uncheckedAppearance) {\n this._streams.push(this.uncheckedAppearance);\n }\n this._fallbackFontDict = this.fallbackFontDict;\n if (this.data.defaultFieldValue === null) {\n this.data.defaultFieldValue = \"Off\";\n }\n }\n\n _processPushButton(params) {\n const { dict, annotationGlobals } = params;\n\n if (!dict.has(\"A\") && !dict.has(\"AA\") && !this.data.alternativeText) {\n warn(\"Push buttons without action dictionaries are not supported\");\n return;\n }\n\n this.data.isTooltipOnly = !dict.has(\"A\") && !dict.has(\"AA\");\n\n Catalog.parseDestDictionary({\n destDict: dict,\n resultObj: this.data,\n docBaseUrl: annotationGlobals.baseUrl,\n docAttachments: annotationGlobals.attachments,\n });\n }\n\n getFieldObject() {\n let type = \"button\";\n let exportValues;\n if (this.data.checkBox) {\n type = \"checkbox\";\n exportValues = this.data.exportValue;\n } else if (this.data.radioButton) {\n type = \"radiobutton\";\n exportValues = this.data.buttonValue;\n }\n return {\n id: this.data.id,\n value: this.data.fieldValue || \"Off\",\n defaultValue: this.data.defaultFieldValue,\n exportValues,\n editable: !this.data.readOnly,\n name: this.data.fieldName,\n rect: this.data.rect,\n hidden: this.data.hidden,\n actions: this.data.actions,\n page: this.data.pageIndex,\n strokeColor: this.data.borderColor,\n fillColor: this.data.backgroundColor,\n rotation: this.rotation,\n type,\n };\n }\n\n get fallbackFontDict() {\n const dict = new Dict();\n dict.set(\"BaseFont\", Name.get(\"ZapfDingbats\"));\n dict.set(\"Type\", Name.get(\"FallbackType\"));\n dict.set(\"Subtype\", Name.get(\"FallbackType\"));\n dict.set(\"Encoding\", Name.get(\"ZapfDingbatsEncoding\"));\n\n return shadow(this, \"fallbackFontDict\", dict);\n }\n}\n\nclass ChoiceWidgetAnnotation extends WidgetAnnotation {\n constructor(params) {\n super(params);\n\n const { dict, xref } = params;\n\n this.indices = dict.getArray(\"I\");\n this.hasIndices = Array.isArray(this.indices) && this.indices.length > 0;\n\n // Determine the options. The options array may consist of strings or\n // arrays. If the array consists of arrays, then the first element of\n // each array is the export value and the second element of each array is\n // the display value. If the array consists of strings, then these\n // represent both the export and display value. In this case, we convert\n // it to an array of arrays as well for convenience in the display layer.\n // Note that the specification does not state that the `Opt` field is\n // inheritable, but in practice PDF generators do make annotations\n // inherit the options from a parent annotation (issue 8094).\n this.data.options = [];\n\n const options = getInheritableProperty({ dict, key: \"Opt\" });\n if (Array.isArray(options)) {\n for (let i = 0, ii = options.length; i < ii; i++) {\n const option = xref.fetchIfRef(options[i]);\n const isOptionArray = Array.isArray(option);\n\n this.data.options[i] = {\n exportValue: this._decodeFormValue(\n isOptionArray ? xref.fetchIfRef(option[0]) : option\n ),\n displayValue: this._decodeFormValue(\n isOptionArray ? xref.fetchIfRef(option[1]) : option\n ),\n };\n }\n }\n\n if (!this.hasIndices) {\n // The field value can be `null` if no item is selected, a string if one\n // item is selected or an array of strings if multiple items are selected.\n // For consistency in the API and convenience in the display layer, we\n // always make the field value an array with zero, one or multiple items.\n if (typeof this.data.fieldValue === \"string\") {\n this.data.fieldValue = [this.data.fieldValue];\n } else if (!this.data.fieldValue) {\n this.data.fieldValue = [];\n }\n } else {\n // The specs say that we should have an indices array only with\n // multiselectable Choice and the \"V\" entry should have the\n // precedence, but Acrobat itself is using it whatever the\n // the \"V\" entry is (see bug 1770750).\n this.data.fieldValue = [];\n const ii = this.data.options.length;\n for (const i of this.indices) {\n if (Number.isInteger(i) && i >= 0 && i < ii) {\n this.data.fieldValue.push(this.data.options[i].exportValue);\n }\n }\n }\n\n // Process field flags for the display layer.\n this.data.combo = this.hasFieldFlag(AnnotationFieldFlag.COMBO);\n this.data.multiSelect = this.hasFieldFlag(AnnotationFieldFlag.MULTISELECT);\n this._hasText = true;\n }\n\n getFieldObject() {\n const type = this.data.combo ? \"combobox\" : \"listbox\";\n const value =\n this.data.fieldValue.length > 0 ? this.data.fieldValue[0] : null;\n return {\n id: this.data.id,\n value,\n defaultValue: this.data.defaultFieldValue,\n editable: !this.data.readOnly,\n name: this.data.fieldName,\n rect: this.data.rect,\n numItems: this.data.fieldValue.length,\n multipleSelection: this.data.multiSelect,\n hidden: this.data.hidden,\n actions: this.data.actions,\n items: this.data.options,\n page: this.data.pageIndex,\n strokeColor: this.data.borderColor,\n fillColor: this.data.backgroundColor,\n rotation: this.rotation,\n type,\n };\n }\n\n amendSavedDict(annotationStorage, dict) {\n if (!this.hasIndices) {\n return;\n }\n let values = annotationStorage?.get(this.data.id)?.value;\n if (!Array.isArray(values)) {\n values = [values];\n }\n const indices = [];\n const { options } = this.data;\n for (let i = 0, j = 0, ii = options.length; i < ii; i++) {\n if (options[i].exportValue === values[j]) {\n indices.push(i);\n j += 1;\n }\n }\n dict.set(\"I\", indices);\n }\n\n async _getAppearance(evaluator, task, intent, annotationStorage) {\n if (this.data.combo) {\n return super._getAppearance(evaluator, task, intent, annotationStorage);\n }\n\n let exportedValue, rotation;\n const storageEntry = annotationStorage?.get(this.data.id);\n if (storageEntry) {\n rotation = storageEntry.rotation;\n exportedValue = storageEntry.value;\n }\n\n if (\n rotation === undefined &&\n exportedValue === undefined &&\n !this._needAppearances\n ) {\n // The annotation hasn't been rendered so use the appearance\n return null;\n }\n\n if (exportedValue === undefined) {\n exportedValue = this.data.fieldValue;\n } else if (!Array.isArray(exportedValue)) {\n exportedValue = [exportedValue];\n }\n\n const defaultPadding = 1;\n const defaultHPadding = 2;\n let totalHeight = this.data.rect[3] - this.data.rect[1];\n let totalWidth = this.data.rect[2] - this.data.rect[0];\n\n if (rotation === 90 || rotation === 270) {\n [totalWidth, totalHeight] = [totalHeight, totalWidth];\n }\n\n const lineCount = this.data.options.length;\n const valueIndices = [];\n for (let i = 0; i < lineCount; i++) {\n const { exportValue } = this.data.options[i];\n if (exportedValue.includes(exportValue)) {\n valueIndices.push(i);\n }\n }\n\n if (!this._defaultAppearance) {\n // The DA is required and must be a string.\n // If there is no font named Helvetica in the resource dictionary,\n // the evaluator will fall back to a default font.\n // Doing so prevents exceptions and allows saving/printing\n // the file as expected.\n this.data.defaultAppearanceData = parseDefaultAppearance(\n (this._defaultAppearance = \"/Helvetica 0 Tf 0 g\")\n );\n }\n\n const font = await WidgetAnnotation._getFontData(\n evaluator,\n task,\n this.data.defaultAppearanceData,\n this._fieldResources.mergedResources\n );\n\n let defaultAppearance;\n let { fontSize } = this.data.defaultAppearanceData;\n if (!fontSize) {\n const lineHeight = (totalHeight - defaultPadding) / lineCount;\n let lineWidth = -1;\n let value;\n for (const { displayValue } of this.data.options) {\n const width = this._getTextWidth(displayValue, font);\n if (width > lineWidth) {\n lineWidth = width;\n value = displayValue;\n }\n }\n\n [defaultAppearance, fontSize] = this._computeFontSize(\n lineHeight,\n totalWidth - 2 * defaultHPadding,\n value,\n font,\n -1\n );\n } else {\n defaultAppearance = this._defaultAppearance;\n }\n\n const lineHeight = fontSize * LINE_FACTOR;\n const vPadding = (lineHeight - fontSize) / 2;\n const numberOfVisibleLines = Math.floor(totalHeight / lineHeight);\n\n let firstIndex = 0;\n if (valueIndices.length > 0) {\n const minIndex = Math.min(...valueIndices);\n const maxIndex = Math.max(...valueIndices);\n\n firstIndex = Math.max(0, maxIndex - numberOfVisibleLines + 1);\n if (firstIndex > minIndex) {\n firstIndex = minIndex;\n }\n }\n const end = Math.min(firstIndex + numberOfVisibleLines + 1, lineCount);\n\n const buf = [\"/Tx BMC q\", `1 1 ${totalWidth} ${totalHeight} re W n`];\n\n if (valueIndices.length) {\n // This value has been copied/pasted from annotation-choice-widget.pdf.\n // It corresponds to rgb(153, 193, 218).\n buf.push(\"0.600006 0.756866 0.854904 rg\");\n\n // Highlight the lines in filling a blue rectangle at the selected\n // positions.\n for (const index of valueIndices) {\n if (firstIndex <= index && index < end) {\n buf.push(\n `1 ${\n totalHeight - (index - firstIndex + 1) * lineHeight\n } ${totalWidth} ${lineHeight} re f`\n );\n }\n }\n }\n buf.push(\"BT\", defaultAppearance, `1 0 0 1 0 ${totalHeight} Tm`);\n\n const prevInfo = { shift: 0 };\n for (let i = firstIndex; i < end; i++) {\n const { displayValue } = this.data.options[i];\n const vpadding = i === firstIndex ? vPadding : 0;\n buf.push(\n this._renderText(\n displayValue,\n font,\n fontSize,\n totalWidth,\n 0,\n prevInfo,\n defaultHPadding,\n -lineHeight + vpadding\n )\n );\n }\n\n buf.push(\"ET Q EMC\");\n\n return buf.join(\"\\n\");\n }\n}\n\nclass SignatureWidgetAnnotation extends WidgetAnnotation {\n constructor(params) {\n super(params);\n\n // Unset the fieldValue since it's (most likely) a `Dict` which is\n // non-serializable and will thus cause errors when sending annotations\n // to the main-thread (issue 10347).\n this.data.fieldValue = null;\n this.data.hasOwnCanvas = this.data.noRotate;\n this.data.noHTML = !this.data.hasOwnCanvas;\n }\n\n getFieldObject() {\n return {\n id: this.data.id,\n value: null,\n page: this.data.pageIndex,\n type: \"signature\",\n };\n }\n}\n\nclass TextAnnotation extends MarkupAnnotation {\n constructor(params) {\n const DEFAULT_ICON_SIZE = 22; // px\n\n super(params);\n\n // No rotation for Text (see 12.5.6.4).\n this.data.noRotate = true;\n this.data.hasOwnCanvas = this.data.noRotate;\n this.data.noHTML = false;\n\n const { dict } = params;\n this.data.annotationType = AnnotationType.TEXT;\n\n if (this.data.hasAppearance) {\n this.data.name = \"NoIcon\";\n } else {\n this.data.rect[1] = this.data.rect[3] - DEFAULT_ICON_SIZE;\n this.data.rect[2] = this.data.rect[0] + DEFAULT_ICON_SIZE;\n this.data.name = dict.has(\"Name\") ? dict.get(\"Name\").name : \"Note\";\n }\n\n if (dict.has(\"State\")) {\n this.data.state = dict.get(\"State\") || null;\n this.data.stateModel = dict.get(\"StateModel\") || null;\n } else {\n this.data.state = null;\n this.data.stateModel = null;\n }\n }\n}\n\nclass LinkAnnotation extends Annotation {\n constructor(params) {\n super(params);\n\n const { dict, annotationGlobals } = params;\n this.data.annotationType = AnnotationType.LINK;\n\n const quadPoints = getQuadPoints(dict, this.rectangle);\n if (quadPoints) {\n this.data.quadPoints = quadPoints;\n }\n\n // The color entry for a link annotation is the color of the border.\n this.data.borderColor ||= this.data.color;\n\n Catalog.parseDestDictionary({\n destDict: dict,\n resultObj: this.data,\n docBaseUrl: annotationGlobals.baseUrl,\n docAttachments: annotationGlobals.attachments,\n });\n }\n}\n\nclass PopupAnnotation extends Annotation {\n constructor(params) {\n super(params);\n\n const { dict } = params;\n this.data.annotationType = AnnotationType.POPUP;\n\n // A pop-up is never rendered on the main canvas so we must render its HTML\n // version.\n this.data.noHTML = false;\n\n if (\n this.data.rect[0] === this.data.rect[2] ||\n this.data.rect[1] === this.data.rect[3]\n ) {\n this.data.rect = null;\n }\n\n let parentItem = dict.get(\"Parent\");\n if (!parentItem) {\n warn(\"Popup annotation has a missing or invalid parent annotation.\");\n return;\n }\n\n const parentRect = parentItem.getArray(\"Rect\");\n this.data.parentRect =\n Array.isArray(parentRect) && parentRect.length === 4\n ? Util.normalizeRect(parentRect)\n : null;\n\n const rt = parentItem.get(\"RT\");\n if (isName(rt, AnnotationReplyType.GROUP)) {\n // Subordinate annotations in a group should inherit\n // the group attributes from the primary annotation.\n parentItem = parentItem.get(\"IRT\");\n }\n\n if (!parentItem.has(\"M\")) {\n this.data.modificationDate = null;\n } else {\n this.setModificationDate(parentItem.get(\"M\"));\n this.data.modificationDate = this.modificationDate;\n }\n\n if (!parentItem.has(\"C\")) {\n // Fall back to the default background color.\n this.data.color = null;\n } else {\n this.setColor(parentItem.getArray(\"C\"));\n this.data.color = this.color;\n }\n\n // If the Popup annotation is not viewable, but the parent annotation is,\n // that is most likely a bug. Fallback to inherit the flags from the parent\n // annotation (this is consistent with the behaviour in Adobe Reader).\n if (!this.viewable) {\n const parentFlags = parentItem.get(\"F\");\n if (this._isViewable(parentFlags)) {\n this.setFlags(parentFlags);\n }\n }\n\n this.setTitle(parentItem.get(\"T\"));\n this.data.titleObj = this._title;\n\n this.setContents(parentItem.get(\"Contents\"));\n this.data.contentsObj = this._contents;\n\n if (parentItem.has(\"RC\")) {\n this.data.richText = XFAFactory.getRichTextAsHtml(parentItem.get(\"RC\"));\n }\n\n this.data.open = !!dict.get(\"Open\");\n }\n}\n\nclass FreeTextAnnotation extends MarkupAnnotation {\n constructor(params) {\n super(params);\n\n // It uses its own canvas in order to be hidden if edited.\n // But if it has the noHTML flag, it means that we don't want to be able\n // to modify it so we can just draw it on the main canvas.\n this.data.hasOwnCanvas = !this.data.noHTML;\n // We want to be able to add mouse listeners to the annotation.\n this.data.noHTML = false;\n\n const { evaluatorOptions, xref } = params;\n this.data.annotationType = AnnotationType.FREETEXT;\n this.setDefaultAppearance(params);\n if (this.appearance) {\n const { fontColor, fontSize } = parseAppearanceStream(\n this.appearance,\n evaluatorOptions,\n xref\n );\n this.data.defaultAppearanceData.fontColor = fontColor;\n this.data.defaultAppearanceData.fontSize = fontSize || 10;\n } else if (this._isOffscreenCanvasSupported) {\n const strokeAlpha = params.dict.get(\"CA\");\n const fakeUnicodeFont = new FakeUnicodeFont(xref, \"sans-serif\");\n this.data.defaultAppearanceData.fontSize ||= 10;\n const { fontColor, fontSize } = this.data.defaultAppearanceData;\n this.appearance = fakeUnicodeFont.createAppearance(\n this._contents.str,\n this.rectangle,\n this.rotation,\n fontSize,\n fontColor,\n strokeAlpha\n );\n this._streams.push(this.appearance, FakeUnicodeFont.toUnicodeStream);\n } else {\n warn(\n \"FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly.\"\n );\n }\n }\n\n get hasTextContent() {\n return !!this.appearance;\n }\n\n static createNewDict(annotation, xref, { apRef, ap }) {\n const { color, fontSize, rect, rotation, user, value } = annotation;\n const freetext = new Dict(xref);\n freetext.set(\"Type\", Name.get(\"Annot\"));\n freetext.set(\"Subtype\", Name.get(\"FreeText\"));\n freetext.set(\"CreationDate\", `D:${getModificationDate()}`);\n freetext.set(\"Rect\", rect);\n const da = `/Helv ${fontSize} Tf ${getPdfColor(color, /* isFill */ true)}`;\n freetext.set(\"DA\", da);\n freetext.set(\n \"Contents\",\n isAscii(value)\n ? value\n : stringToUTF16String(value, /* bigEndian = */ true)\n );\n freetext.set(\"F\", 4);\n freetext.set(\"Border\", [0, 0, 0]);\n freetext.set(\"Rotate\", rotation);\n\n if (user) {\n freetext.set(\n \"T\",\n isAscii(user) ? user : stringToUTF16String(user, /* bigEndian = */ true)\n );\n }\n\n if (apRef || ap) {\n const n = new Dict(xref);\n freetext.set(\"AP\", n);\n\n if (apRef) {\n n.set(\"N\", apRef);\n } else {\n n.set(\"N\", ap);\n }\n }\n\n return freetext;\n }\n\n static async createNewAppearanceStream(annotation, xref, params) {\n const { baseFontRef, evaluator, task } = params;\n const { color, fontSize, rect, rotation, value } = annotation;\n\n const resources = new Dict(xref);\n const font = new Dict(xref);\n\n if (baseFontRef) {\n font.set(\"Helv\", baseFontRef);\n } else {\n const baseFont = new Dict(xref);\n baseFont.set(\"BaseFont\", Name.get(\"Helvetica\"));\n baseFont.set(\"Type\", Name.get(\"Font\"));\n baseFont.set(\"Subtype\", Name.get(\"Type1\"));\n baseFont.set(\"Encoding\", Name.get(\"WinAnsiEncoding\"));\n font.set(\"Helv\", baseFont);\n }\n resources.set(\"Font\", font);\n\n const helv = await WidgetAnnotation._getFontData(\n evaluator,\n task,\n {\n fontName: \"Helv\",\n fontSize,\n },\n resources\n );\n\n const [x1, y1, x2, y2] = rect;\n let w = x2 - x1;\n let h = y2 - y1;\n\n if (rotation % 180 !== 0) {\n [w, h] = [h, w];\n }\n\n const lines = value.split(\"\\n\");\n const scale = fontSize / 1000;\n let totalWidth = -Infinity;\n const encodedLines = [];\n for (let line of lines) {\n const encoded = helv.encodeString(line);\n if (encoded.length > 1) {\n // The font doesn't contain all the chars.\n return null;\n }\n line = encoded.join(\"\");\n encodedLines.push(line);\n let lineWidth = 0;\n const glyphs = helv.charsToGlyphs(line);\n for (const glyph of glyphs) {\n lineWidth += glyph.width * scale;\n }\n totalWidth = Math.max(totalWidth, lineWidth);\n }\n\n let hscale = 1;\n if (totalWidth > w) {\n hscale = w / totalWidth;\n }\n let vscale = 1;\n const lineHeight = LINE_FACTOR * fontSize;\n const lineAscent = (LINE_FACTOR - LINE_DESCENT_FACTOR) * fontSize;\n const totalHeight = lineHeight * lines.length;\n if (totalHeight > h) {\n vscale = h / totalHeight;\n }\n const fscale = Math.min(hscale, vscale);\n const newFontSize = fontSize * fscale;\n let firstPoint, clipBox, matrix;\n switch (rotation) {\n case 0:\n matrix = [1, 0, 0, 1];\n clipBox = [rect[0], rect[1], w, h];\n firstPoint = [rect[0], rect[3] - lineAscent];\n break;\n case 90:\n matrix = [0, 1, -1, 0];\n clipBox = [rect[1], -rect[2], w, h];\n firstPoint = [rect[1], -rect[0] - lineAscent];\n break;\n case 180:\n matrix = [-1, 0, 0, -1];\n clipBox = [-rect[2], -rect[3], w, h];\n firstPoint = [-rect[2], -rect[1] - lineAscent];\n break;\n case 270:\n matrix = [0, -1, 1, 0];\n clipBox = [-rect[3], rect[0], w, h];\n firstPoint = [-rect[3], rect[2] - lineAscent];\n break;\n }\n\n const buffer = [\n \"q\",\n `${matrix.join(\" \")} 0 0 cm`,\n `${clipBox.join(\" \")} re W n`,\n `BT`,\n `${getPdfColor(color, /* isFill */ true)}`,\n `0 Tc /Helv ${numberToString(newFontSize)} Tf`,\n ];\n\n buffer.push(\n `${firstPoint.join(\" \")} Td (${escapeString(encodedLines[0])}) Tj`\n );\n const vShift = numberToString(lineHeight);\n for (let i = 1, ii = encodedLines.length; i < ii; i++) {\n const line = encodedLines[i];\n buffer.push(`0 -${vShift} Td (${escapeString(line)}) Tj`);\n }\n buffer.push(\"ET\", \"Q\");\n const appearance = buffer.join(\"\\n\");\n\n const appearanceStreamDict = new Dict(xref);\n appearanceStreamDict.set(\"FormType\", 1);\n appearanceStreamDict.set(\"Subtype\", Name.get(\"Form\"));\n appearanceStreamDict.set(\"Type\", Name.get(\"XObject\"));\n appearanceStreamDict.set(\"BBox\", rect);\n appearanceStreamDict.set(\"Resources\", resources);\n appearanceStreamDict.set(\"Matrix\", [1, 0, 0, 1, -rect[0], -rect[1]]);\n\n const ap = new StringStream(appearance);\n ap.dict = appearanceStreamDict;\n\n return ap;\n }\n}\n\nclass LineAnnotation extends MarkupAnnotation {\n constructor(params) {\n super(params);\n\n const { dict, xref } = params;\n this.data.annotationType = AnnotationType.LINE;\n this.data.hasOwnCanvas = this.data.noRotate;\n this.data.noHTML = false;\n\n const lineCoordinates = dict.getArray(\"L\");\n this.data.lineCoordinates = Util.normalizeRect(lineCoordinates);\n\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n this.setLineEndings(dict.getArray(\"LE\"));\n this.data.lineEndings = this.lineEndings;\n }\n\n if (!this.appearance) {\n // The default stroke color is black.\n const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];\n const strokeAlpha = dict.get(\"CA\");\n\n const interiorColor = getRgbColor(dict.getArray(\"IC\"), null);\n // The default fill color is transparent. Setting the fill colour is\n // necessary if/when we want to add support for non-default line endings.\n const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null;\n const fillAlpha = fillColor ? strokeAlpha : null;\n\n const borderWidth = this.borderStyle.width || 1,\n borderAdjust = 2 * borderWidth;\n\n // If the /Rect-entry is empty/wrong, create a fallback rectangle so that\n // we get similar rendering/highlighting behaviour as in Adobe Reader.\n const bbox = [\n this.data.lineCoordinates[0] - borderAdjust,\n this.data.lineCoordinates[1] - borderAdjust,\n this.data.lineCoordinates[2] + borderAdjust,\n this.data.lineCoordinates[3] + borderAdjust,\n ];\n if (!Util.intersect(this.rectangle, bbox)) {\n this.rectangle = bbox;\n }\n\n this._setDefaultAppearance({\n xref,\n extra: `${borderWidth} w`,\n strokeColor,\n fillColor,\n strokeAlpha,\n fillAlpha,\n pointsCallback: (buffer, points) => {\n buffer.push(\n `${lineCoordinates[0]} ${lineCoordinates[1]} m`,\n `${lineCoordinates[2]} ${lineCoordinates[3]} l`,\n \"S\"\n );\n return [\n points[0].x - borderWidth,\n points[1].x + borderWidth,\n points[3].y - borderWidth,\n points[1].y + borderWidth,\n ];\n },\n });\n }\n }\n}\n\nclass SquareAnnotation extends MarkupAnnotation {\n constructor(params) {\n super(params);\n\n const { dict, xref } = params;\n this.data.annotationType = AnnotationType.SQUARE;\n this.data.hasOwnCanvas = this.data.noRotate;\n this.data.noHTML = false;\n\n if (!this.appearance) {\n // The default stroke color is black.\n const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];\n const strokeAlpha = dict.get(\"CA\");\n\n const interiorColor = getRgbColor(dict.getArray(\"IC\"), null);\n // The default fill color is transparent.\n const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null;\n const fillAlpha = fillColor ? strokeAlpha : null;\n\n if (this.borderStyle.width === 0 && !fillColor) {\n // Prevent rendering a \"hairline\" border (fixes issue14164.pdf).\n return;\n }\n\n this._setDefaultAppearance({\n xref,\n extra: `${this.borderStyle.width} w`,\n strokeColor,\n fillColor,\n strokeAlpha,\n fillAlpha,\n pointsCallback: (buffer, points) => {\n const x = points[2].x + this.borderStyle.width / 2;\n const y = points[2].y + this.borderStyle.width / 2;\n const width = points[3].x - points[2].x - this.borderStyle.width;\n const height = points[1].y - points[3].y - this.borderStyle.width;\n buffer.push(`${x} ${y} ${width} ${height} re`);\n if (fillColor) {\n buffer.push(\"B\");\n } else {\n buffer.push(\"S\");\n }\n return [points[0].x, points[1].x, points[3].y, points[1].y];\n },\n });\n }\n }\n}\n\nclass CircleAnnotation extends MarkupAnnotation {\n constructor(params) {\n super(params);\n\n const { dict, xref } = params;\n this.data.annotationType = AnnotationType.CIRCLE;\n\n if (!this.appearance) {\n // The default stroke color is black.\n const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];\n const strokeAlpha = dict.get(\"CA\");\n\n const interiorColor = getRgbColor(dict.getArray(\"IC\"), null);\n // The default fill color is transparent.\n const fillColor = interiorColor ? getPdfColorArray(interiorColor) : null;\n const fillAlpha = fillColor ? strokeAlpha : null;\n\n if (this.borderStyle.width === 0 && !fillColor) {\n // Prevent rendering a \"hairline\" border (fixes issue14164.pdf).\n return;\n }\n\n // Circles are approximated by Bézier curves with four segments since\n // there is no circle primitive in the PDF specification. For the control\n // points distance, see https://stackoverflow.com/a/27863181.\n const controlPointsDistance = (4 / 3) * Math.tan(Math.PI / (2 * 4));\n\n this._setDefaultAppearance({\n xref,\n extra: `${this.borderStyle.width} w`,\n strokeColor,\n fillColor,\n strokeAlpha,\n fillAlpha,\n pointsCallback: (buffer, points) => {\n const x0 = points[0].x + this.borderStyle.width / 2;\n const y0 = points[0].y - this.borderStyle.width / 2;\n const x1 = points[3].x - this.borderStyle.width / 2;\n const y1 = points[3].y + this.borderStyle.width / 2;\n const xMid = x0 + (x1 - x0) / 2;\n const yMid = y0 + (y1 - y0) / 2;\n const xOffset = ((x1 - x0) / 2) * controlPointsDistance;\n const yOffset = ((y1 - y0) / 2) * controlPointsDistance;\n\n buffer.push(\n `${xMid} ${y1} m`,\n `${xMid + xOffset} ${y1} ${x1} ${yMid + yOffset} ${x1} ${yMid} c`,\n `${x1} ${yMid - yOffset} ${xMid + xOffset} ${y0} ${xMid} ${y0} c`,\n `${xMid - xOffset} ${y0} ${x0} ${yMid - yOffset} ${x0} ${yMid} c`,\n `${x0} ${yMid + yOffset} ${xMid - xOffset} ${y1} ${xMid} ${y1} c`,\n \"h\"\n );\n if (fillColor) {\n buffer.push(\"B\");\n } else {\n buffer.push(\"S\");\n }\n return [points[0].x, points[1].x, points[3].y, points[1].y];\n },\n });\n }\n }\n}\n\nclass PolylineAnnotation extends MarkupAnnotation {\n constructor(params) {\n super(params);\n\n const { dict, xref } = params;\n this.data.annotationType = AnnotationType.POLYLINE;\n this.data.hasOwnCanvas = this.data.noRotate;\n this.data.noHTML = false;\n this.data.vertices = [];\n\n if (\n (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) &&\n !(this instanceof PolygonAnnotation)\n ) {\n // Only meaningful for polyline annotations.\n this.setLineEndings(dict.getArray(\"LE\"));\n this.data.lineEndings = this.lineEndings;\n }\n\n // The vertices array is an array of numbers representing the alternating\n // horizontal and vertical coordinates, respectively, of each vertex.\n // Convert this to an array of objects with x and y coordinates.\n const rawVertices = dict.getArray(\"Vertices\");\n if (!Array.isArray(rawVertices)) {\n return;\n }\n for (let i = 0, ii = rawVertices.length; i < ii; i += 2) {\n this.data.vertices.push({\n x: rawVertices[i],\n y: rawVertices[i + 1],\n });\n }\n\n if (!this.appearance) {\n // The default stroke color is black.\n const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];\n const strokeAlpha = dict.get(\"CA\");\n\n const borderWidth = this.borderStyle.width || 1,\n borderAdjust = 2 * borderWidth;\n\n // If the /Rect-entry is empty/wrong, create a fallback rectangle so that\n // we get similar rendering/highlighting behaviour as in Adobe Reader.\n const bbox = [Infinity, Infinity, -Infinity, -Infinity];\n for (const vertex of this.data.vertices) {\n bbox[0] = Math.min(bbox[0], vertex.x - borderAdjust);\n bbox[1] = Math.min(bbox[1], vertex.y - borderAdjust);\n bbox[2] = Math.max(bbox[2], vertex.x + borderAdjust);\n bbox[3] = Math.max(bbox[3], vertex.y + borderAdjust);\n }\n if (!Util.intersect(this.rectangle, bbox)) {\n this.rectangle = bbox;\n }\n\n this._setDefaultAppearance({\n xref,\n extra: `${borderWidth} w`,\n strokeColor,\n strokeAlpha,\n pointsCallback: (buffer, points) => {\n const vertices = this.data.vertices;\n for (let i = 0, ii = vertices.length; i < ii; i++) {\n buffer.push(\n `${vertices[i].x} ${vertices[i].y} ${i === 0 ? \"m\" : \"l\"}`\n );\n }\n buffer.push(\"S\");\n return [points[0].x, points[1].x, points[3].y, points[1].y];\n },\n });\n }\n }\n}\n\nclass PolygonAnnotation extends PolylineAnnotation {\n constructor(params) {\n // Polygons are specific forms of polylines, so reuse their logic.\n super(params);\n\n this.data.annotationType = AnnotationType.POLYGON;\n }\n}\n\nclass CaretAnnotation extends MarkupAnnotation {\n constructor(params) {\n super(params);\n\n this.data.annotationType = AnnotationType.CARET;\n }\n}\n\nclass InkAnnotation extends MarkupAnnotation {\n constructor(params) {\n super(params);\n\n this.data.hasOwnCanvas = this.data.noRotate;\n this.data.noHTML = false;\n\n const { dict, xref } = params;\n this.data.annotationType = AnnotationType.INK;\n this.data.inkLists = [];\n\n const rawInkLists = dict.getArray(\"InkList\");\n if (!Array.isArray(rawInkLists)) {\n return;\n }\n for (let i = 0, ii = rawInkLists.length; i < ii; ++i) {\n // The raw ink lists array contains arrays of numbers representing\n // the alternating horizontal and vertical coordinates, respectively,\n // of each vertex. Convert this to an array of objects with x and y\n // coordinates.\n this.data.inkLists.push([]);\n for (let j = 0, jj = rawInkLists[i].length; j < jj; j += 2) {\n this.data.inkLists[i].push({\n x: xref.fetchIfRef(rawInkLists[i][j]),\n y: xref.fetchIfRef(rawInkLists[i][j + 1]),\n });\n }\n }\n\n if (!this.appearance) {\n // The default stroke color is black.\n const strokeColor = this.color ? getPdfColorArray(this.color) : [0, 0, 0];\n const strokeAlpha = dict.get(\"CA\");\n\n const borderWidth = this.borderStyle.width || 1,\n borderAdjust = 2 * borderWidth;\n\n // If the /Rect-entry is empty/wrong, create a fallback rectangle so that\n // we get similar rendering/highlighting behaviour as in Adobe Reader.\n const bbox = [Infinity, Infinity, -Infinity, -Infinity];\n for (const inkLists of this.data.inkLists) {\n for (const vertex of inkLists) {\n bbox[0] = Math.min(bbox[0], vertex.x - borderAdjust);\n bbox[1] = Math.min(bbox[1], vertex.y - borderAdjust);\n bbox[2] = Math.max(bbox[2], vertex.x + borderAdjust);\n bbox[3] = Math.max(bbox[3], vertex.y + borderAdjust);\n }\n }\n if (!Util.intersect(this.rectangle, bbox)) {\n this.rectangle = bbox;\n }\n\n this._setDefaultAppearance({\n xref,\n extra: `${borderWidth} w`,\n strokeColor,\n strokeAlpha,\n pointsCallback: (buffer, points) => {\n // According to the specification, see \"12.5.6.13 Ink Annotations\":\n // When drawn, the points shall be connected by straight lines or\n // curves in an implementation-dependent way.\n // In order to simplify things, we utilize straight lines for now.\n for (const inkList of this.data.inkLists) {\n for (let i = 0, ii = inkList.length; i < ii; i++) {\n buffer.push(\n `${inkList[i].x} ${inkList[i].y} ${i === 0 ? \"m\" : \"l\"}`\n );\n }\n buffer.push(\"S\");\n }\n return [points[0].x, points[1].x, points[3].y, points[1].y];\n },\n });\n }\n }\n\n static createNewDict(annotation, xref, { apRef, ap }) {\n const { color, opacity, paths, rect, rotation, thickness } = annotation;\n const ink = new Dict(xref);\n ink.set(\"Type\", Name.get(\"Annot\"));\n ink.set(\"Subtype\", Name.get(\"Ink\"));\n ink.set(\"CreationDate\", `D:${getModificationDate()}`);\n ink.set(\"Rect\", rect);\n ink.set(\n \"InkList\",\n paths.map(p => p.points)\n );\n ink.set(\"F\", 4);\n ink.set(\"Rotate\", rotation);\n\n // Line thickness.\n const bs = new Dict(xref);\n ink.set(\"BS\", bs);\n bs.set(\"W\", thickness);\n\n // Color.\n ink.set(\n \"C\",\n Array.from(color, c => c / 255)\n );\n\n // Opacity.\n ink.set(\"CA\", opacity);\n\n const n = new Dict(xref);\n ink.set(\"AP\", n);\n\n if (apRef) {\n n.set(\"N\", apRef);\n } else {\n n.set(\"N\", ap);\n }\n\n return ink;\n }\n\n static async createNewAppearanceStream(annotation, xref, params) {\n const { color, rect, paths, thickness, opacity } = annotation;\n\n const appearanceBuffer = [\n `${thickness} w 1 J 1 j`,\n `${getPdfColor(color, /* isFill */ false)}`,\n ];\n\n if (opacity !== 1) {\n appearanceBuffer.push(\"/R0 gs\");\n }\n\n const buffer = [];\n for (const { bezier } of paths) {\n buffer.length = 0;\n buffer.push(\n `${numberToString(bezier[0])} ${numberToString(bezier[1])} m`\n );\n for (let i = 2, ii = bezier.length; i < ii; i += 6) {\n const curve = bezier\n .slice(i, i + 6)\n .map(numberToString)\n .join(\" \");\n buffer.push(`${curve} c`);\n }\n buffer.push(\"S\");\n appearanceBuffer.push(buffer.join(\"\\n\"));\n }\n const appearance = appearanceBuffer.join(\"\\n\");\n\n const appearanceStreamDict = new Dict(xref);\n appearanceStreamDict.set(\"FormType\", 1);\n appearanceStreamDict.set(\"Subtype\", Name.get(\"Form\"));\n appearanceStreamDict.set(\"Type\", Name.get(\"XObject\"));\n appearanceStreamDict.set(\"BBox\", rect);\n appearanceStreamDict.set(\"Length\", appearance.length);\n\n if (opacity !== 1) {\n const resources = new Dict(xref);\n const extGState = new Dict(xref);\n const r0 = new Dict(xref);\n r0.set(\"CA\", opacity);\n r0.set(\"Type\", Name.get(\"ExtGState\"));\n extGState.set(\"R0\", r0);\n resources.set(\"ExtGState\", extGState);\n appearanceStreamDict.set(\"Resources\", resources);\n }\n\n const ap = new StringStream(appearance);\n ap.dict = appearanceStreamDict;\n\n return ap;\n }\n}\n\nclass HighlightAnnotation extends MarkupAnnotation {\n constructor(params) {\n super(params);\n\n const { dict, xref } = params;\n this.data.annotationType = AnnotationType.HIGHLIGHT;\n\n const quadPoints = (this.data.quadPoints = getQuadPoints(dict, null));\n if (quadPoints) {\n const resources = this.appearance?.dict.get(\"Resources\");\n\n if (!this.appearance || !resources?.has(\"ExtGState\")) {\n if (this.appearance) {\n // Workaround for cases where there's no /ExtGState-entry directly\n // available, e.g. when the appearance stream contains a /XObject of\n // the /Form-type, since that causes the highlighting to completely\n // obscure the PDF content below it (fixes issue13242.pdf).\n warn(\"HighlightAnnotation - ignoring built-in appearance stream.\");\n }\n // Default color is yellow in Acrobat Reader\n const fillColor = this.color ? getPdfColorArray(this.color) : [1, 1, 0];\n const fillAlpha = dict.get(\"CA\");\n\n this._setDefaultAppearance({\n xref,\n fillColor,\n blendMode: \"Multiply\",\n fillAlpha,\n pointsCallback: (buffer, points) => {\n buffer.push(\n `${points[0].x} ${points[0].y} m`,\n `${points[1].x} ${points[1].y} l`,\n `${points[3].x} ${points[3].y} l`,\n `${points[2].x} ${points[2].y} l`,\n \"f\"\n );\n return [points[0].x, points[1].x, points[3].y, points[1].y];\n },\n });\n }\n } else {\n this.data.popupRef = null;\n }\n }\n\n static createNewDict(annotation, xref, { apRef, ap }) {\n const { color, opacity, rect, rotation, user, quadPoints } = annotation;\n const highlight = new Dict(xref);\n highlight.set(\"Type\", Name.get(\"Annot\"));\n highlight.set(\"Subtype\", Name.get(\"Highlight\"));\n highlight.set(\"CreationDate\", `D:${getModificationDate()}`);\n highlight.set(\"Rect\", rect);\n highlight.set(\"F\", 4);\n highlight.set(\"Border\", [0, 0, 0]);\n highlight.set(\"Rotate\", rotation);\n highlight.set(\"QuadPoints\", quadPoints);\n\n // Color.\n highlight.set(\n \"C\",\n Array.from(color, c => c / 255)\n );\n\n // Opacity.\n highlight.set(\"CA\", opacity);\n\n if (user) {\n highlight.set(\n \"T\",\n isAscii(user) ? user : stringToUTF16String(user, /* bigEndian = */ true)\n );\n }\n\n if (apRef || ap) {\n const n = new Dict(xref);\n highlight.set(\"AP\", n);\n n.set(\"N\", apRef || ap);\n }\n\n return highlight;\n }\n\n static async createNewAppearanceStream(annotation, xref, params) {\n const { color, rect, outlines, opacity } = annotation;\n\n const appearanceBuffer = [\n `${getPdfColor(color, /* isFill */ true)}`,\n \"/R0 gs\",\n ];\n\n const buffer = [];\n for (const outline of outlines) {\n buffer.length = 0;\n buffer.push(\n `${numberToString(outline[0])} ${numberToString(outline[1])} m`\n );\n for (let i = 2, ii = outline.length; i < ii; i += 2) {\n buffer.push(\n `${numberToString(outline[i])} ${numberToString(outline[i + 1])} l`\n );\n }\n buffer.push(\"h\");\n appearanceBuffer.push(buffer.join(\"\\n\"));\n }\n appearanceBuffer.push(\"f*\");\n const appearance = appearanceBuffer.join(\"\\n\");\n\n const appearanceStreamDict = new Dict(xref);\n appearanceStreamDict.set(\"FormType\", 1);\n appearanceStreamDict.set(\"Subtype\", Name.get(\"Form\"));\n appearanceStreamDict.set(\"Type\", Name.get(\"XObject\"));\n appearanceStreamDict.set(\"BBox\", rect);\n appearanceStreamDict.set(\"Length\", appearance.length);\n\n const resources = new Dict(xref);\n const extGState = new Dict(xref);\n resources.set(\"ExtGState\", extGState);\n appearanceStreamDict.set(\"Resources\", resources);\n const r0 = new Dict(xref);\n extGState.set(\"R0\", r0);\n r0.set(\"BM\", Name.get(\"Multiply\"));\n\n if (opacity !== 1) {\n r0.set(\"ca\", opacity);\n r0.set(\"Type\", Name.get(\"ExtGState\"));\n }\n\n const ap = new StringStream(appearance);\n ap.dict = appearanceStreamDict;\n\n return ap;\n }\n}\n\nclass UnderlineAnnotation extends MarkupAnnotation {\n constructor(params) {\n super(params);\n\n const { dict, xref } = params;\n this.data.annotationType = AnnotationType.UNDERLINE;\n\n const quadPoints = (this.data.quadPoints = getQuadPoints(dict, null));\n if (quadPoints) {\n if (!this.appearance) {\n // Default color is black\n const strokeColor = this.color\n ? getPdfColorArray(this.color)\n : [0, 0, 0];\n const strokeAlpha = dict.get(\"CA\");\n\n // The values 0.571 and 1.3 below corresponds to what Acrobat is doing.\n this._setDefaultAppearance({\n xref,\n extra: \"[] 0 d 0.571 w\",\n strokeColor,\n strokeAlpha,\n pointsCallback: (buffer, points) => {\n buffer.push(\n `${points[2].x} ${points[2].y + 1.3} m`,\n `${points[3].x} ${points[3].y + 1.3} l`,\n \"S\"\n );\n return [points[0].x, points[1].x, points[3].y, points[1].y];\n },\n });\n }\n } else {\n this.data.popupRef = null;\n }\n }\n}\n\nclass SquigglyAnnotation extends MarkupAnnotation {\n constructor(params) {\n super(params);\n\n const { dict, xref } = params;\n this.data.annotationType = AnnotationType.SQUIGGLY;\n\n const quadPoints = (this.data.quadPoints = getQuadPoints(dict, null));\n if (quadPoints) {\n if (!this.appearance) {\n // Default color is black\n const strokeColor = this.color\n ? getPdfColorArray(this.color)\n : [0, 0, 0];\n const strokeAlpha = dict.get(\"CA\");\n\n this._setDefaultAppearance({\n xref,\n extra: \"[] 0 d 1 w\",\n strokeColor,\n strokeAlpha,\n pointsCallback: (buffer, points) => {\n const dy = (points[0].y - points[2].y) / 6;\n let shift = dy;\n let x = points[2].x;\n const y = points[2].y;\n const xEnd = points[3].x;\n buffer.push(`${x} ${y + shift} m`);\n do {\n x += 2;\n shift = shift === 0 ? dy : 0;\n buffer.push(`${x} ${y + shift} l`);\n } while (x < xEnd);\n buffer.push(\"S\");\n return [points[2].x, xEnd, y - 2 * dy, y + 2 * dy];\n },\n });\n }\n } else {\n this.data.popupRef = null;\n }\n }\n}\n\nclass StrikeOutAnnotation extends MarkupAnnotation {\n constructor(params) {\n super(params);\n\n const { dict, xref } = params;\n this.data.annotationType = AnnotationType.STRIKEOUT;\n\n const quadPoints = (this.data.quadPoints = getQuadPoints(dict, null));\n if (quadPoints) {\n if (!this.appearance) {\n // Default color is black\n const strokeColor = this.color\n ? getPdfColorArray(this.color)\n : [0, 0, 0];\n const strokeAlpha = dict.get(\"CA\");\n\n this._setDefaultAppearance({\n xref,\n extra: \"[] 0 d 1 w\",\n strokeColor,\n strokeAlpha,\n pointsCallback: (buffer, points) => {\n buffer.push(\n `${(points[0].x + points[2].x) / 2} ` +\n `${(points[0].y + points[2].y) / 2} m`,\n `${(points[1].x + points[3].x) / 2} ` +\n `${(points[1].y + points[3].y) / 2} l`,\n \"S\"\n );\n return [points[0].x, points[1].x, points[3].y, points[1].y];\n },\n });\n }\n } else {\n this.data.popupRef = null;\n }\n }\n}\n\nclass StampAnnotation extends MarkupAnnotation {\n constructor(params) {\n super(params);\n\n this.data.annotationType = AnnotationType.STAMP;\n this.data.hasOwnCanvas = this.data.noRotate;\n this.data.noHTML = false;\n }\n\n static async createImage(bitmap, xref) {\n // TODO: when printing, we could have a specific internal colorspace\n // (e.g. something like DeviceRGBA) in order avoid any conversion (i.e. no\n // jpeg, no rgba to rgb conversion, etc...)\n\n const { width, height } = bitmap;\n const canvas = new OffscreenCanvas(width, height);\n const ctx = canvas.getContext(\"2d\", { alpha: true });\n\n // Draw the image and get the data in order to extract the transparency.\n ctx.drawImage(bitmap, 0, 0);\n const data = ctx.getImageData(0, 0, width, height).data;\n const buf32 = new Uint32Array(data.buffer);\n const hasAlpha = buf32.some(\n FeatureTest.isLittleEndian\n ? x => x >>> 24 !== 0xff\n : x => (x & 0xff) !== 0xff\n );\n\n if (hasAlpha) {\n // Redraw the image on a white background in order to remove the thin gray\n // line which can appear when exporting to jpeg.\n ctx.fillStyle = \"white\";\n ctx.fillRect(0, 0, width, height);\n ctx.drawImage(bitmap, 0, 0);\n }\n\n const jpegBufferPromise = canvas\n .convertToBlob({ type: \"image/jpeg\", quality: 1 })\n .then(blob => {\n return blob.arrayBuffer();\n });\n\n const xobjectName = Name.get(\"XObject\");\n const imageName = Name.get(\"Image\");\n const image = new Dict(xref);\n image.set(\"Type\", xobjectName);\n image.set(\"Subtype\", imageName);\n image.set(\"BitsPerComponent\", 8);\n image.set(\"ColorSpace\", Name.get(\"DeviceRGB\"));\n image.set(\"Filter\", Name.get(\"DCTDecode\"));\n image.set(\"BBox\", [0, 0, width, height]);\n image.set(\"Width\", width);\n image.set(\"Height\", height);\n\n let smaskStream = null;\n if (hasAlpha) {\n const alphaBuffer = new Uint8Array(buf32.length);\n if (FeatureTest.isLittleEndian) {\n for (let i = 0, ii = buf32.length; i < ii; i++) {\n alphaBuffer[i] = buf32[i] >>> 24;\n }\n } else {\n for (let i = 0, ii = buf32.length; i < ii; i++) {\n alphaBuffer[i] = buf32[i] & 0xff;\n }\n }\n\n const smask = new Dict(xref);\n smask.set(\"Type\", xobjectName);\n smask.set(\"Subtype\", imageName);\n smask.set(\"BitsPerComponent\", 8);\n smask.set(\"ColorSpace\", Name.get(\"DeviceGray\"));\n smask.set(\"Width\", width);\n smask.set(\"Height\", height);\n\n smaskStream = new Stream(alphaBuffer, 0, 0, smask);\n }\n const imageStream = new Stream(await jpegBufferPromise, 0, 0, image);\n\n return {\n imageStream,\n smaskStream,\n width,\n height,\n };\n }\n\n static createNewDict(annotation, xref, { apRef, ap }) {\n const { rect, rotation, user } = annotation;\n const stamp = new Dict(xref);\n stamp.set(\"Type\", Name.get(\"Annot\"));\n stamp.set(\"Subtype\", Name.get(\"Stamp\"));\n stamp.set(\"CreationDate\", `D:${getModificationDate()}`);\n stamp.set(\"Rect\", rect);\n stamp.set(\"F\", 4);\n stamp.set(\"Border\", [0, 0, 0]);\n stamp.set(\"Rotate\", rotation);\n\n if (user) {\n stamp.set(\n \"T\",\n isAscii(user) ? user : stringToUTF16String(user, /* bigEndian = */ true)\n );\n }\n\n if (apRef || ap) {\n const n = new Dict(xref);\n stamp.set(\"AP\", n);\n\n if (apRef) {\n n.set(\"N\", apRef);\n } else {\n n.set(\"N\", ap);\n }\n }\n\n return stamp;\n }\n\n static async createNewAppearanceStream(annotation, xref, params) {\n const { rotation } = annotation;\n const { imageRef, width, height } = params.image;\n const resources = new Dict(xref);\n const xobject = new Dict(xref);\n resources.set(\"XObject\", xobject);\n xobject.set(\"Im0\", imageRef);\n const appearance = `q ${width} 0 0 ${height} 0 0 cm /Im0 Do Q`;\n\n const appearanceStreamDict = new Dict(xref);\n appearanceStreamDict.set(\"FormType\", 1);\n appearanceStreamDict.set(\"Subtype\", Name.get(\"Form\"));\n appearanceStreamDict.set(\"Type\", Name.get(\"XObject\"));\n appearanceStreamDict.set(\"BBox\", [0, 0, width, height]);\n appearanceStreamDict.set(\"Resources\", resources);\n\n if (rotation) {\n const matrix = getRotationMatrix(rotation, width, height);\n appearanceStreamDict.set(\"Matrix\", matrix);\n }\n\n const ap = new StringStream(appearance);\n ap.dict = appearanceStreamDict;\n\n return ap;\n }\n}\n\nclass FileAttachmentAnnotation extends MarkupAnnotation {\n constructor(params) {\n super(params);\n\n const { dict, xref } = params;\n const file = new FileSpec(dict.get(\"FS\"), xref);\n\n this.data.annotationType = AnnotationType.FILEATTACHMENT;\n this.data.hasOwnCanvas = this.data.noRotate;\n this.data.noHTML = false;\n this.data.file = file.serializable;\n\n const name = dict.get(\"Name\");\n this.data.name =\n name instanceof Name ? stringToPDFString(name.name) : \"PushPin\";\n\n const fillAlpha = dict.get(\"ca\");\n this.data.fillAlpha =\n typeof fillAlpha === \"number\" && fillAlpha >= 0 && fillAlpha <= 1\n ? fillAlpha\n : null;\n }\n}\n\nexport {\n Annotation,\n AnnotationBorderStyle,\n AnnotationFactory,\n getQuadPoints,\n MarkupAnnotation,\n PopupAnnotation,\n};\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 { stringToUTF8String, warn } from \"../shared/util.js\";\nimport { parseXFAPath } from \"./core_utils.js\";\nimport { SimpleXMLParser } from \"./xml_parser.js\";\n\nfunction decodeString(str) {\n try {\n return stringToUTF8String(str);\n } catch (ex) {\n warn(`UTF-8 decoding failed: \"${ex}\".`);\n return str;\n }\n}\n\nclass DatasetXMLParser extends SimpleXMLParser {\n constructor(options) {\n super(options);\n this.node = null;\n }\n\n onEndElement(name) {\n const node = super.onEndElement(name);\n if (node && name === \"xfa:datasets\") {\n this.node = node;\n\n // We don't need anything else, so just kill the parser.\n throw new Error(\"Aborting DatasetXMLParser.\");\n }\n }\n}\n\nclass DatasetReader {\n constructor(data) {\n if (data.datasets) {\n this.node = new SimpleXMLParser({ hasAttributes: true }).parseFromString(\n data.datasets\n ).documentElement;\n } else {\n const parser = new DatasetXMLParser({ hasAttributes: true });\n try {\n parser.parseFromString(data[\"xdp:xdp\"]);\n } catch {}\n this.node = parser.node;\n }\n }\n\n getValue(path) {\n if (!this.node || !path) {\n return \"\";\n }\n const node = this.node.searchNode(parseXFAPath(path), 0);\n\n if (!node) {\n return \"\";\n }\n\n const first = node.firstChild;\n if (first?.nodeName === \"value\") {\n return node.children.map(child => decodeString(child.textContent));\n }\n\n return decodeString(node.textContent);\n }\n}\n\nexport { DatasetReader };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n assert,\n bytesToString,\n FormatError,\n info,\n InvalidPDFException,\n warn,\n} from \"../shared/util.js\";\nimport { CIRCULAR_REF, Cmd, Dict, isCmd, Ref, RefSet } from \"./primitives.js\";\nimport { Lexer, Parser } from \"./parser.js\";\nimport {\n MissingDataException,\n ParserEOFException,\n XRefEntryException,\n XRefParseException,\n} from \"./core_utils.js\";\nimport { BaseStream } from \"./base_stream.js\";\nimport { CipherTransformFactory } from \"./crypto.js\";\n\nclass XRef {\n #firstXRefStmPos = null;\n\n constructor(stream, pdfManager) {\n this.stream = stream;\n this.pdfManager = pdfManager;\n this.entries = [];\n this._xrefStms = new Set();\n this._cacheMap = new Map(); // Prepare the XRef cache.\n this._pendingRefs = new RefSet();\n this._newPersistentRefNum = null;\n this._newTemporaryRefNum = null;\n this._persistentRefsCache = null;\n }\n\n getNewPersistentRef(obj) {\n // When printing we don't care that much about the ref number by itself, it\n // can increase for ever and it allows to keep some re-usable refs.\n if (this._newPersistentRefNum === null) {\n this._newPersistentRefNum = this.entries.length || 1;\n }\n const num = this._newPersistentRefNum++;\n this._cacheMap.set(num, obj);\n return Ref.get(num, 0);\n }\n\n getNewTemporaryRef() {\n // When saving we want to have some minimal numbers.\n // Those refs are only created in order to be written in the final pdf\n // stream.\n if (this._newTemporaryRefNum === null) {\n this._newTemporaryRefNum = this.entries.length || 1;\n if (this._newPersistentRefNum) {\n this._persistentRefsCache = new Map();\n for (\n let i = this._newTemporaryRefNum;\n i < this._newPersistentRefNum;\n i++\n ) {\n // We *temporarily* clear the cache, see `resetNewTemporaryRef` below,\n // to avoid any conflict with the refs created during saving.\n this._persistentRefsCache.set(i, this._cacheMap.get(i));\n this._cacheMap.delete(i);\n }\n }\n }\n return Ref.get(this._newTemporaryRefNum++, 0);\n }\n\n resetNewTemporaryRef() {\n // Called once saving is finished.\n this._newTemporaryRefNum = null;\n if (this._persistentRefsCache) {\n for (const [num, obj] of this._persistentRefsCache) {\n this._cacheMap.set(num, obj);\n }\n }\n this._persistentRefsCache = null;\n }\n\n setStartXRef(startXRef) {\n // Store the starting positions of xref tables as we process them\n // so we can recover from missing data errors\n this.startXRefQueue = [startXRef];\n }\n\n parse(recoveryMode = false) {\n let trailerDict;\n if (!recoveryMode) {\n trailerDict = this.readXRef();\n } else {\n warn(\"Indexing all PDF objects\");\n trailerDict = this.indexObjects();\n }\n trailerDict.assignXref(this);\n this.trailer = trailerDict;\n\n let encrypt;\n try {\n encrypt = trailerDict.get(\"Encrypt\");\n } catch (ex) {\n if (ex instanceof MissingDataException) {\n throw ex;\n }\n warn(`XRef.parse - Invalid \"Encrypt\" reference: \"${ex}\".`);\n }\n if (encrypt instanceof Dict) {\n const ids = trailerDict.get(\"ID\");\n const fileId = ids?.length ? ids[0] : \"\";\n // The 'Encrypt' dictionary itself should not be encrypted, and by\n // setting `suppressEncryption` we can prevent an infinite loop inside\n // of `XRef_fetchUncompressed` if the dictionary contains indirect\n // objects (fixes issue7665.pdf).\n encrypt.suppressEncryption = true;\n this.encrypt = new CipherTransformFactory(\n encrypt,\n fileId,\n this.pdfManager.password\n );\n }\n\n // Get the root dictionary (catalog) object, and do some basic validation.\n let root;\n try {\n root = trailerDict.get(\"Root\");\n } catch (ex) {\n if (ex instanceof MissingDataException) {\n throw ex;\n }\n warn(`XRef.parse - Invalid \"Root\" reference: \"${ex}\".`);\n }\n if (root instanceof Dict) {\n try {\n const pages = root.get(\"Pages\");\n if (pages instanceof Dict) {\n this.root = root;\n return;\n }\n } catch (ex) {\n if (ex instanceof MissingDataException) {\n throw ex;\n }\n warn(`XRef.parse - Invalid \"Pages\" reference: \"${ex}\".`);\n }\n }\n\n if (!recoveryMode) {\n throw new XRefParseException();\n }\n // Even recovery failed, there's nothing more we can do here.\n throw new InvalidPDFException(\"Invalid Root reference.\");\n }\n\n processXRefTable(parser) {\n if (!(\"tableState\" in this)) {\n // Stores state of the table as we process it so we can resume\n // from middle of table in case of missing data error\n this.tableState = {\n entryNum: 0,\n streamPos: parser.lexer.stream.pos,\n parserBuf1: parser.buf1,\n parserBuf2: parser.buf2,\n };\n }\n\n const obj = this.readXRefTable(parser);\n\n // Sanity check\n if (!isCmd(obj, \"trailer\")) {\n throw new FormatError(\n \"Invalid XRef table: could not find trailer dictionary\"\n );\n }\n // Read trailer dictionary, e.g.\n // trailer\n // << /Size 22\n // /Root 20R\n // /Info 10R\n // /ID [ <81b14aafa313db63dbd6f981e49f94f4> ]\n // >>\n // The parser goes through the entire stream << ... >> and provides\n // a getter interface for the key-value table\n let dict = parser.getObj();\n\n // The pdflib PDF generator can generate a nested trailer dictionary\n if (!(dict instanceof Dict) && dict.dict) {\n dict = dict.dict;\n }\n if (!(dict instanceof Dict)) {\n throw new FormatError(\n \"Invalid XRef table: could not parse trailer dictionary\"\n );\n }\n delete this.tableState;\n\n return dict;\n }\n\n readXRefTable(parser) {\n // Example of cross-reference table:\n // xref\n // 0 1 <-- subsection header (first obj #, obj count)\n // 0000000000 65535 f <-- actual object (offset, generation #, f/n)\n // 23 2 <-- subsection header ... and so on ...\n // 0000025518 00002 n\n // 0000025635 00000 n\n // trailer\n // ...\n\n const stream = parser.lexer.stream;\n const tableState = this.tableState;\n stream.pos = tableState.streamPos;\n parser.buf1 = tableState.parserBuf1;\n parser.buf2 = tableState.parserBuf2;\n\n // Outer loop is over subsection headers\n let obj;\n\n while (true) {\n if (!(\"firstEntryNum\" in tableState) || !(\"entryCount\" in tableState)) {\n if (isCmd((obj = parser.getObj()), \"trailer\")) {\n break;\n }\n tableState.firstEntryNum = obj;\n tableState.entryCount = parser.getObj();\n }\n\n let first = tableState.firstEntryNum;\n const count = tableState.entryCount;\n if (!Number.isInteger(first) || !Number.isInteger(count)) {\n throw new FormatError(\n \"Invalid XRef table: wrong types in subsection header\"\n );\n }\n // Inner loop is over objects themselves\n for (let i = tableState.entryNum; i < count; i++) {\n tableState.streamPos = stream.pos;\n tableState.entryNum = i;\n tableState.parserBuf1 = parser.buf1;\n tableState.parserBuf2 = parser.buf2;\n\n const entry = {};\n entry.offset = parser.getObj();\n entry.gen = parser.getObj();\n const type = parser.getObj();\n\n if (type instanceof Cmd) {\n switch (type.cmd) {\n case \"f\":\n entry.free = true;\n break;\n case \"n\":\n entry.uncompressed = true;\n break;\n }\n }\n\n // Validate entry obj\n if (\n !Number.isInteger(entry.offset) ||\n !Number.isInteger(entry.gen) ||\n !(entry.free || entry.uncompressed)\n ) {\n throw new FormatError(\n `Invalid entry in XRef subsection: ${first}, ${count}`\n );\n }\n\n // The first xref table entry, i.e. obj 0, should be free. Attempting\n // to adjust an incorrect first obj # (fixes issue 3248 and 7229).\n if (i === 0 && entry.free && first === 1) {\n first = 0;\n }\n\n if (!this.entries[i + first]) {\n this.entries[i + first] = entry;\n }\n }\n\n tableState.entryNum = 0;\n tableState.streamPos = stream.pos;\n tableState.parserBuf1 = parser.buf1;\n tableState.parserBuf2 = parser.buf2;\n delete tableState.firstEntryNum;\n delete tableState.entryCount;\n }\n\n // Sanity check: as per spec, first object must be free\n if (this.entries[0] && !this.entries[0].free) {\n throw new FormatError(\"Invalid XRef table: unexpected first object\");\n }\n return obj;\n }\n\n processXRefStream(stream) {\n if (!(\"streamState\" in this)) {\n // Stores state of the stream as we process it so we can resume\n // from middle of stream in case of missing data error\n const streamParameters = stream.dict;\n const byteWidths = streamParameters.get(\"W\");\n let range = streamParameters.get(\"Index\");\n if (!range) {\n range = [0, streamParameters.get(\"Size\")];\n }\n\n this.streamState = {\n entryRanges: range,\n byteWidths,\n entryNum: 0,\n streamPos: stream.pos,\n };\n }\n this.readXRefStream(stream);\n delete this.streamState;\n\n return stream.dict;\n }\n\n readXRefStream(stream) {\n const streamState = this.streamState;\n stream.pos = streamState.streamPos;\n\n const [typeFieldWidth, offsetFieldWidth, generationFieldWidth] =\n streamState.byteWidths;\n\n const entryRanges = streamState.entryRanges;\n while (entryRanges.length > 0) {\n const [first, n] = entryRanges;\n\n if (!Number.isInteger(first) || !Number.isInteger(n)) {\n throw new FormatError(`Invalid XRef range fields: ${first}, ${n}`);\n }\n if (\n !Number.isInteger(typeFieldWidth) ||\n !Number.isInteger(offsetFieldWidth) ||\n !Number.isInteger(generationFieldWidth)\n ) {\n throw new FormatError(\n `Invalid XRef entry fields length: ${first}, ${n}`\n );\n }\n for (let i = streamState.entryNum; i < n; ++i) {\n streamState.entryNum = i;\n streamState.streamPos = stream.pos;\n\n let type = 0,\n offset = 0,\n generation = 0;\n for (let j = 0; j < typeFieldWidth; ++j) {\n const typeByte = stream.getByte();\n if (typeByte === -1) {\n throw new FormatError(\"Invalid XRef byteWidths 'type'.\");\n }\n type = (type << 8) | typeByte;\n }\n // if type field is absent, its default value is 1\n if (typeFieldWidth === 0) {\n type = 1;\n }\n for (let j = 0; j < offsetFieldWidth; ++j) {\n const offsetByte = stream.getByte();\n if (offsetByte === -1) {\n throw new FormatError(\"Invalid XRef byteWidths 'offset'.\");\n }\n offset = (offset << 8) | offsetByte;\n }\n for (let j = 0; j < generationFieldWidth; ++j) {\n const generationByte = stream.getByte();\n if (generationByte === -1) {\n throw new FormatError(\"Invalid XRef byteWidths 'generation'.\");\n }\n generation = (generation << 8) | generationByte;\n }\n const entry = {};\n entry.offset = offset;\n entry.gen = generation;\n switch (type) {\n case 0:\n entry.free = true;\n break;\n case 1:\n entry.uncompressed = true;\n break;\n case 2:\n break;\n default:\n throw new FormatError(`Invalid XRef entry type: ${type}`);\n }\n if (!this.entries[first + i]) {\n this.entries[first + i] = entry;\n }\n }\n\n streamState.entryNum = 0;\n streamState.streamPos = stream.pos;\n entryRanges.splice(0, 2);\n }\n }\n\n indexObjects() {\n // Simple scan through the PDF content to find objects,\n // trailers and XRef streams.\n const TAB = 0x9,\n LF = 0xa,\n CR = 0xd,\n SPACE = 0x20;\n const PERCENT = 0x25,\n LT = 0x3c;\n\n function readToken(data, offset) {\n let token = \"\",\n ch = data[offset];\n while (ch !== LF && ch !== CR && ch !== LT) {\n if (++offset >= data.length) {\n break;\n }\n token += String.fromCharCode(ch);\n ch = data[offset];\n }\n return token;\n }\n function skipUntil(data, offset, what) {\n const length = what.length,\n dataLength = data.length;\n let skipped = 0;\n // finding byte sequence\n while (offset < dataLength) {\n let i = 0;\n while (i < length && data[offset + i] === what[i]) {\n ++i;\n }\n if (i >= length) {\n break; // sequence found\n }\n offset++;\n skipped++;\n }\n return skipped;\n }\n const gEndobjRegExp = /\\b(endobj|\\d+\\s+\\d+\\s+obj|xref|trailer\\s*<<)\\b/g;\n const gStartxrefRegExp = /\\b(startxref|\\d+\\s+\\d+\\s+obj)\\b/g;\n const objRegExp = /^(\\d+)\\s+(\\d+)\\s+obj\\b/;\n\n const trailerBytes = new Uint8Array([116, 114, 97, 105, 108, 101, 114]);\n const startxrefBytes = new Uint8Array([\n 115, 116, 97, 114, 116, 120, 114, 101, 102,\n ]);\n const xrefBytes = new Uint8Array([47, 88, 82, 101, 102]);\n\n // Clear out any existing entries, since they may be bogus.\n this.entries.length = 0;\n this._cacheMap.clear();\n\n const stream = this.stream;\n stream.pos = 0;\n const buffer = stream.getBytes(),\n bufferStr = bytesToString(buffer),\n length = buffer.length;\n let position = stream.start;\n const trailers = [],\n xrefStms = [];\n while (position < length) {\n let ch = buffer[position];\n if (ch === TAB || ch === LF || ch === CR || ch === SPACE) {\n ++position;\n continue;\n }\n if (ch === PERCENT) {\n // %-comment\n do {\n ++position;\n if (position >= length) {\n break;\n }\n ch = buffer[position];\n } while (ch !== LF && ch !== CR);\n continue;\n }\n const token = readToken(buffer, position);\n let m;\n if (\n token.startsWith(\"xref\") &&\n (token.length === 4 || /\\s/.test(token[4]))\n ) {\n position += skipUntil(buffer, position, trailerBytes);\n trailers.push(position);\n position += skipUntil(buffer, position, startxrefBytes);\n } else if ((m = objRegExp.exec(token))) {\n const num = m[1] | 0,\n gen = m[2] | 0;\n\n const startPos = position + token.length;\n let contentLength,\n updateEntries = false;\n if (!this.entries[num]) {\n updateEntries = true;\n } else if (this.entries[num].gen === gen) {\n // Before overwriting an existing entry, ensure that the new one won't\n // cause *immediate* errors when it's accessed (fixes issue13783.pdf).\n try {\n const parser = new Parser({\n lexer: new Lexer(stream.makeSubStream(startPos)),\n });\n parser.getObj();\n updateEntries = true;\n } catch (ex) {\n if (ex instanceof ParserEOFException) {\n warn(`indexObjects -- checking object (${token}): \"${ex}\".`);\n } else {\n // The error may come from the `Parser`-instance being initialized\n // without an `XRef`-instance (we don't have a usable one yet).\n updateEntries = true;\n }\n }\n }\n if (updateEntries) {\n this.entries[num] = {\n offset: position - stream.start,\n gen,\n uncompressed: true,\n };\n }\n\n // Find the next \"obj\" string, rather than \"endobj\", to ensure that\n // we won't skip over a new 'obj' operator in corrupt files where\n // 'endobj' operators are missing (fixes issue9105_reduced.pdf).\n gEndobjRegExp.lastIndex = startPos;\n const match = gEndobjRegExp.exec(bufferStr);\n\n if (match) {\n const endPos = gEndobjRegExp.lastIndex + 1;\n contentLength = endPos - position;\n\n if (match[1] !== \"endobj\") {\n warn(\n `indexObjects: Found \"${match[1]}\" inside of another \"obj\", ` +\n 'caused by missing \"endobj\" -- trying to recover.'\n );\n contentLength -= match[1].length + 1;\n }\n } else {\n contentLength = length - position;\n }\n const content = buffer.subarray(position, position + contentLength);\n\n // checking XRef stream suspect\n // (it shall have '/XRef' and next char is not a letter)\n const xrefTagOffset = skipUntil(content, 0, xrefBytes);\n if (xrefTagOffset < contentLength && content[xrefTagOffset + 5] < 64) {\n xrefStms.push(position - stream.start);\n this._xrefStms.add(position - stream.start); // Avoid recursion\n }\n\n position += contentLength;\n } else if (\n token.startsWith(\"trailer\") &&\n (token.length === 7 || /\\s/.test(token[7]))\n ) {\n trailers.push(position);\n\n const startPos = position + token.length;\n let contentLength;\n // Attempt to handle (some) corrupt documents, where no 'startxref'\n // operators are present (fixes issue15590.pdf).\n gStartxrefRegExp.lastIndex = startPos;\n const match = gStartxrefRegExp.exec(bufferStr);\n\n if (match) {\n const endPos = gStartxrefRegExp.lastIndex + 1;\n contentLength = endPos - position;\n\n if (match[1] !== \"startxref\") {\n warn(\n `indexObjects: Found \"${match[1]}\" after \"trailer\", ` +\n 'caused by missing \"startxref\" -- trying to recover.'\n );\n contentLength -= match[1].length + 1;\n }\n } else {\n contentLength = length - position;\n }\n position += contentLength;\n } else {\n position += token.length + 1;\n }\n }\n // reading XRef streams\n for (const xrefStm of xrefStms) {\n this.startXRefQueue.push(xrefStm);\n this.readXRef(/* recoveryMode */ true);\n }\n\n const trailerDicts = [];\n // Pre-parsing the trailers to check if the document is possibly encrypted.\n let isEncrypted = false;\n for (const trailer of trailers) {\n stream.pos = trailer;\n const parser = new Parser({\n lexer: new Lexer(stream),\n xref: this,\n allowStreams: true,\n recoveryMode: true,\n });\n const obj = parser.getObj();\n if (!isCmd(obj, \"trailer\")) {\n continue;\n }\n // read the trailer dictionary\n const dict = parser.getObj();\n if (!(dict instanceof Dict)) {\n continue;\n }\n trailerDicts.push(dict);\n\n if (dict.has(\"Encrypt\")) {\n isEncrypted = true;\n }\n }\n\n // finding main trailer\n let trailerDict, trailerError;\n for (const dict of [...trailerDicts, \"genFallback\", ...trailerDicts]) {\n if (dict === \"genFallback\") {\n if (!trailerError) {\n break; // No need to fallback if there were no validation errors.\n }\n this._generationFallback = true;\n continue;\n }\n // Do some basic validation of the trailer/root dictionary candidate.\n let validPagesDict = false;\n try {\n const rootDict = dict.get(\"Root\");\n if (!(rootDict instanceof Dict)) {\n continue;\n }\n const pagesDict = rootDict.get(\"Pages\");\n if (!(pagesDict instanceof Dict)) {\n continue;\n }\n const pagesCount = pagesDict.get(\"Count\");\n if (Number.isInteger(pagesCount)) {\n validPagesDict = true;\n }\n // The top-level /Pages dictionary isn't obviously corrupt.\n } catch (ex) {\n trailerError = ex;\n continue;\n }\n // taking the first one with 'ID'\n if (\n validPagesDict &&\n (!isEncrypted || dict.has(\"Encrypt\")) &&\n dict.has(\"ID\")\n ) {\n return dict;\n }\n // The current dictionary is a candidate, but continue searching.\n trailerDict = dict;\n }\n // No trailer with 'ID', taking last one (if exists).\n if (trailerDict) {\n return trailerDict;\n }\n // No trailer dictionary found, taking the \"top\"-dictionary (if exists).\n if (this.topDict) {\n return this.topDict;\n }\n // nothing helps\n throw new InvalidPDFException(\"Invalid PDF structure.\");\n }\n\n readXRef(recoveryMode = false) {\n const stream = this.stream;\n // Keep track of already parsed XRef tables, to prevent an infinite loop\n // when parsing corrupt PDF files where e.g. the /Prev entries create a\n // circular dependency between tables (fixes bug1393476.pdf).\n const startXRefParsedCache = new Set();\n\n while (this.startXRefQueue.length) {\n try {\n const startXRef = this.startXRefQueue[0];\n\n if (startXRefParsedCache.has(startXRef)) {\n warn(\"readXRef - skipping XRef table since it was already parsed.\");\n this.startXRefQueue.shift();\n continue;\n }\n startXRefParsedCache.add(startXRef);\n\n stream.pos = startXRef + stream.start;\n\n const parser = new Parser({\n lexer: new Lexer(stream),\n xref: this,\n allowStreams: true,\n });\n let obj = parser.getObj();\n let dict;\n\n // Get dictionary\n if (isCmd(obj, \"xref\")) {\n // Parse end-of-file XRef\n dict = this.processXRefTable(parser);\n if (!this.topDict) {\n this.topDict = dict;\n }\n\n // Recursively get other XRefs 'XRefStm', if any\n obj = dict.get(\"XRefStm\");\n if (Number.isInteger(obj) && !this._xrefStms.has(obj)) {\n // ignore previously loaded xref streams\n // (possible infinite recursion)\n this._xrefStms.add(obj);\n this.startXRefQueue.push(obj);\n this.#firstXRefStmPos ??= obj;\n }\n } else if (Number.isInteger(obj)) {\n // Parse in-stream XRef\n if (\n !Number.isInteger(parser.getObj()) ||\n !isCmd(parser.getObj(), \"obj\") ||\n !((obj = parser.getObj()) instanceof BaseStream)\n ) {\n throw new FormatError(\"Invalid XRef stream\");\n }\n dict = this.processXRefStream(obj);\n if (!this.topDict) {\n this.topDict = dict;\n }\n if (!dict) {\n throw new FormatError(\"Failed to read XRef stream\");\n }\n } else {\n throw new FormatError(\"Invalid XRef stream header\");\n }\n\n // Recursively get previous dictionary, if any\n obj = dict.get(\"Prev\");\n if (Number.isInteger(obj)) {\n this.startXRefQueue.push(obj);\n } else if (obj instanceof Ref) {\n // The spec says Prev must not be a reference, i.e. \"/Prev NNN\"\n // This is a fallback for non-compliant PDFs, i.e. \"/Prev NNN 0 R\"\n this.startXRefQueue.push(obj.num);\n }\n } catch (e) {\n if (e instanceof MissingDataException) {\n throw e;\n }\n info(\"(while reading XRef): \" + e);\n }\n this.startXRefQueue.shift();\n }\n\n if (this.topDict) {\n return this.topDict;\n }\n if (recoveryMode) {\n return undefined;\n }\n throw new XRefParseException();\n }\n\n get lastXRefStreamPos() {\n return (\n this.#firstXRefStmPos ??\n (this._xrefStms.size > 0 ? Math.max(...this._xrefStms) : null)\n );\n }\n\n getEntry(i) {\n const xrefEntry = this.entries[i];\n if (xrefEntry && !xrefEntry.free && xrefEntry.offset) {\n return xrefEntry;\n }\n return null;\n }\n\n fetchIfRef(obj, suppressEncryption = false) {\n if (obj instanceof Ref) {\n return this.fetch(obj, suppressEncryption);\n }\n return obj;\n }\n\n fetch(ref, suppressEncryption = false) {\n if (!(ref instanceof Ref)) {\n throw new Error(\"ref object is not a reference\");\n }\n const num = ref.num;\n\n // The XRef cache is populated with objects which are obtained through\n // `Parser.getObj`, and indirectly via `Lexer.getObj`. Neither of these\n // methods should ever return `undefined` (note the `assert` calls below).\n const cacheEntry = this._cacheMap.get(num);\n if (cacheEntry !== undefined) {\n // In documents with Object Streams, it's possible that cached `Dict`s\n // have not been assigned an `objId` yet (see e.g. issue3115r.pdf).\n if (cacheEntry instanceof Dict && !cacheEntry.objId) {\n cacheEntry.objId = ref.toString();\n }\n return cacheEntry;\n }\n let xrefEntry = this.getEntry(num);\n\n if (xrefEntry === null) {\n // The referenced entry can be free.\n this._cacheMap.set(num, xrefEntry);\n return xrefEntry;\n }\n // Prevent circular references, in corrupt PDF documents, from hanging the\n // worker-thread. This relies, implicitly, on the parsing being synchronous.\n if (this._pendingRefs.has(ref)) {\n this._pendingRefs.remove(ref);\n\n warn(`Ignoring circular reference: ${ref}.`);\n return CIRCULAR_REF;\n }\n this._pendingRefs.put(ref);\n\n try {\n xrefEntry = xrefEntry.uncompressed\n ? this.fetchUncompressed(ref, xrefEntry, suppressEncryption)\n : this.fetchCompressed(ref, xrefEntry, suppressEncryption);\n this._pendingRefs.remove(ref);\n } catch (ex) {\n this._pendingRefs.remove(ref);\n throw ex;\n }\n if (xrefEntry instanceof Dict) {\n xrefEntry.objId = ref.toString();\n } else if (xrefEntry instanceof BaseStream) {\n xrefEntry.dict.objId = ref.toString();\n }\n return xrefEntry;\n }\n\n fetchUncompressed(ref, xrefEntry, suppressEncryption = false) {\n const gen = ref.gen;\n let num = ref.num;\n if (xrefEntry.gen !== gen) {\n const msg = `Inconsistent generation in XRef: ${ref}`;\n // Try falling back to a *previous* generation (fixes issue15577.pdf).\n if (this._generationFallback && xrefEntry.gen < gen) {\n warn(msg);\n return this.fetchUncompressed(\n Ref.get(num, xrefEntry.gen),\n xrefEntry,\n suppressEncryption\n );\n }\n throw new XRefEntryException(msg);\n }\n const stream = this.stream.makeSubStream(\n xrefEntry.offset + this.stream.start\n );\n const parser = new Parser({\n lexer: new Lexer(stream),\n xref: this,\n allowStreams: true,\n });\n const obj1 = parser.getObj();\n const obj2 = parser.getObj();\n const obj3 = parser.getObj();\n\n if (obj1 !== num || obj2 !== gen || !(obj3 instanceof Cmd)) {\n throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${ref}`);\n }\n if (obj3.cmd !== \"obj\") {\n // some bad PDFs use \"obj1234\" and really mean 1234\n if (obj3.cmd.startsWith(\"obj\")) {\n num = parseInt(obj3.cmd.substring(3), 10);\n if (!Number.isNaN(num)) {\n return num;\n }\n }\n throw new XRefEntryException(`Bad (uncompressed) XRef entry: ${ref}`);\n }\n xrefEntry =\n this.encrypt && !suppressEncryption\n ? parser.getObj(this.encrypt.createCipherTransform(num, gen))\n : parser.getObj();\n if (!(xrefEntry instanceof BaseStream)) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n xrefEntry !== undefined,\n 'fetchUncompressed: The \"xrefEntry\" cannot be undefined.'\n );\n }\n this._cacheMap.set(num, xrefEntry);\n }\n return xrefEntry;\n }\n\n fetchCompressed(ref, xrefEntry, suppressEncryption = false) {\n const tableOffset = xrefEntry.offset;\n const stream = this.fetch(Ref.get(tableOffset, 0));\n if (!(stream instanceof BaseStream)) {\n throw new FormatError(\"bad ObjStm stream\");\n }\n const first = stream.dict.get(\"First\");\n const n = stream.dict.get(\"N\");\n if (!Number.isInteger(first) || !Number.isInteger(n)) {\n throw new FormatError(\"invalid first and n parameters for ObjStm stream\");\n }\n let parser = new Parser({\n lexer: new Lexer(stream),\n xref: this,\n allowStreams: true,\n });\n const nums = new Array(n);\n const offsets = new Array(n);\n // read the object numbers to populate cache\n for (let i = 0; i < n; ++i) {\n const num = parser.getObj();\n if (!Number.isInteger(num)) {\n throw new FormatError(\n `invalid object number in the ObjStm stream: ${num}`\n );\n }\n const offset = parser.getObj();\n if (!Number.isInteger(offset)) {\n throw new FormatError(\n `invalid object offset in the ObjStm stream: ${offset}`\n );\n }\n nums[i] = num;\n offsets[i] = offset;\n }\n\n const start = (stream.start || 0) + first;\n const entries = new Array(n);\n // read stream objects for cache\n for (let i = 0; i < n; ++i) {\n const length = i < n - 1 ? offsets[i + 1] - offsets[i] : undefined;\n if (length < 0) {\n throw new FormatError(\"Invalid offset in the ObjStm stream.\");\n }\n parser = new Parser({\n lexer: new Lexer(\n stream.makeSubStream(start + offsets[i], length, stream.dict)\n ),\n xref: this,\n allowStreams: true,\n });\n\n const obj = parser.getObj();\n entries[i] = obj;\n if (obj instanceof BaseStream) {\n continue;\n }\n const num = nums[i],\n entry = this.entries[num];\n if (entry && entry.offset === tableOffset && entry.gen === i) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n obj !== undefined,\n 'fetchCompressed: The \"obj\" cannot be undefined.'\n );\n }\n this._cacheMap.set(num, obj);\n }\n }\n xrefEntry = entries[xrefEntry.gen];\n if (xrefEntry === undefined) {\n throw new XRefEntryException(`Bad (compressed) XRef entry: ${ref}`);\n }\n return xrefEntry;\n }\n\n async fetchIfRefAsync(obj, suppressEncryption) {\n if (obj instanceof Ref) {\n return this.fetchAsync(obj, suppressEncryption);\n }\n return obj;\n }\n\n async fetchAsync(ref, suppressEncryption) {\n try {\n return this.fetch(ref, suppressEncryption);\n } catch (ex) {\n if (!(ex instanceof MissingDataException)) {\n throw ex;\n }\n await this.pdfManager.requestRange(ex.begin, ex.end);\n return this.fetchAsync(ref, suppressEncryption);\n }\n }\n\n getCatalogObj() {\n return this.root;\n }\n}\n\nexport { XRef };\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 AnnotationEditorPrefix,\n assert,\n FormatError,\n info,\n InvalidPDFException,\n isArrayEqual,\n PageActionEventType,\n RenderingIntentFlag,\n shadow,\n stringToBytes,\n stringToPDFString,\n stringToUTF8String,\n unreachable,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport { AnnotationFactory, PopupAnnotation } from \"./annotation.js\";\nimport {\n collectActions,\n getInheritableProperty,\n getNewAnnotationsMap,\n isWhiteSpace,\n MissingDataException,\n PDF_VERSION_REGEXP,\n validateCSSFont,\n XRefEntryException,\n XRefParseException,\n} from \"./core_utils.js\";\nimport { Dict, isName, isRefsEqual, Name, Ref, RefSet } from \"./primitives.js\";\nimport { getXfaFontDict, getXfaFontName } from \"./xfa_fonts.js\";\nimport { BaseStream } from \"./base_stream.js\";\nimport { calculateMD5 } from \"./crypto.js\";\nimport { Catalog } from \"./catalog.js\";\nimport { clearGlobalCaches } from \"./cleanup_helper.js\";\nimport { DatasetReader } from \"./dataset_reader.js\";\nimport { Linearization } from \"./parser.js\";\nimport { NullStream } from \"./stream.js\";\nimport { ObjectLoader } from \"./object_loader.js\";\nimport { OperatorList } from \"./operator_list.js\";\nimport { PartialEvaluator } from \"./evaluator.js\";\nimport { StreamsSequenceStream } from \"./decode_stream.js\";\nimport { StructTreePage } from \"./struct_tree.js\";\nimport { writeObject } from \"./writer.js\";\nimport { XFAFactory } from \"./xfa/factory.js\";\nimport { XRef } from \"./xref.js\";\n\nconst DEFAULT_USER_UNIT = 1.0;\nconst LETTER_SIZE_MEDIABOX = [0, 0, 612, 792];\n\nclass Page {\n constructor({\n pdfManager,\n xref,\n pageIndex,\n pageDict,\n ref,\n globalIdFactory,\n fontCache,\n builtInCMapCache,\n standardFontDataCache,\n globalImageCache,\n systemFontCache,\n nonBlendModesSet,\n xfaFactory,\n }) {\n this.pdfManager = pdfManager;\n this.pageIndex = pageIndex;\n this.pageDict = pageDict;\n this.xref = xref;\n this.ref = ref;\n this.fontCache = fontCache;\n this.builtInCMapCache = builtInCMapCache;\n this.standardFontDataCache = standardFontDataCache;\n this.globalImageCache = globalImageCache;\n this.systemFontCache = systemFontCache;\n this.nonBlendModesSet = nonBlendModesSet;\n this.evaluatorOptions = pdfManager.evaluatorOptions;\n this.resourcesPromise = null;\n this.xfaFactory = xfaFactory;\n\n const idCounters = {\n obj: 0,\n };\n this._localIdFactory = class extends globalIdFactory {\n static createObjId() {\n return `p${pageIndex}_${++idCounters.obj}`;\n }\n\n static getPageObjId() {\n return `p${ref.toString()}`;\n }\n };\n }\n\n /**\n * @private\n */\n _getInheritableProperty(key, getArray = false) {\n const value = getInheritableProperty({\n dict: this.pageDict,\n key,\n getArray,\n stopWhenFound: false,\n });\n if (!Array.isArray(value)) {\n return value;\n }\n if (value.length === 1 || !(value[0] instanceof Dict)) {\n return value[0];\n }\n return Dict.merge({ xref: this.xref, dictArray: value });\n }\n\n get content() {\n return this.pageDict.getArray(\"Contents\");\n }\n\n get resources() {\n // For robustness: The spec states that a \\Resources entry has to be\n // present, but can be empty. Some documents still omit it; in this case\n // we return an empty dictionary.\n const resources = this._getInheritableProperty(\"Resources\");\n\n return shadow(\n this,\n \"resources\",\n resources instanceof Dict ? resources : Dict.empty\n );\n }\n\n _getBoundingBox(name) {\n if (this.xfaData) {\n return this.xfaData.bbox;\n }\n let box = this._getInheritableProperty(name, /* getArray = */ true);\n\n if (Array.isArray(box) && box.length === 4) {\n box = Util.normalizeRect(box);\n if (box[2] - box[0] > 0 && box[3] - box[1] > 0) {\n return box;\n }\n warn(`Empty, or invalid, /${name} entry.`);\n }\n return null;\n }\n\n get mediaBox() {\n // Reset invalid media box to letter size.\n return shadow(\n this,\n \"mediaBox\",\n this._getBoundingBox(\"MediaBox\") || LETTER_SIZE_MEDIABOX\n );\n }\n\n get cropBox() {\n // Reset invalid crop box to media box.\n return shadow(\n this,\n \"cropBox\",\n this._getBoundingBox(\"CropBox\") || this.mediaBox\n );\n }\n\n get userUnit() {\n let obj = this.pageDict.get(\"UserUnit\");\n if (typeof obj !== \"number\" || obj <= 0) {\n obj = DEFAULT_USER_UNIT;\n }\n return shadow(this, \"userUnit\", obj);\n }\n\n get view() {\n // From the spec, 6th ed., p.963:\n // \"The crop, bleed, trim, and art boxes should not ordinarily\n // extend beyond the boundaries of the media box. If they do, they are\n // effectively reduced to their intersection with the media box.\"\n const { cropBox, mediaBox } = this;\n\n if (cropBox !== mediaBox && !isArrayEqual(cropBox, mediaBox)) {\n const box = Util.intersect(cropBox, mediaBox);\n if (box && box[2] - box[0] > 0 && box[3] - box[1] > 0) {\n return shadow(this, \"view\", box);\n }\n warn(\"Empty /CropBox and /MediaBox intersection.\");\n }\n return shadow(this, \"view\", mediaBox);\n }\n\n get rotate() {\n let rotate = this._getInheritableProperty(\"Rotate\") || 0;\n\n // Normalize rotation so it's a multiple of 90 and between 0 and 270.\n if (rotate % 90 !== 0) {\n rotate = 0;\n } else if (rotate >= 360) {\n rotate %= 360;\n } else if (rotate < 0) {\n // The spec doesn't cover negatives. Assume it's counterclockwise\n // rotation. The following is the other implementation of modulo.\n rotate = ((rotate % 360) + 360) % 360;\n }\n return shadow(this, \"rotate\", rotate);\n }\n\n /**\n * @private\n */\n _onSubStreamError(reason, objId) {\n if (this.evaluatorOptions.ignoreErrors) {\n warn(`getContentStream - ignoring sub-stream (${objId}): \"${reason}\".`);\n return;\n }\n throw reason;\n }\n\n /**\n * @returns {Promise<BaseStream>}\n */\n getContentStream() {\n return this.pdfManager.ensure(this, \"content\").then(content => {\n if (content instanceof BaseStream) {\n return content;\n }\n if (Array.isArray(content)) {\n return new StreamsSequenceStream(\n content,\n this._onSubStreamError.bind(this)\n );\n }\n // Replace non-existent page content with empty content.\n return new NullStream();\n });\n }\n\n get xfaData() {\n return shadow(\n this,\n \"xfaData\",\n this.xfaFactory\n ? { bbox: this.xfaFactory.getBoundingBox(this.pageIndex) }\n : null\n );\n }\n\n #replaceIdByRef(annotations, deletedAnnotations, existingAnnotations) {\n for (const annotation of annotations) {\n if (annotation.id) {\n const ref = Ref.fromString(annotation.id);\n if (!ref) {\n warn(`A non-linked annotation cannot be modified: ${annotation.id}`);\n continue;\n }\n if (annotation.deleted) {\n deletedAnnotations.put(ref);\n continue;\n }\n existingAnnotations?.put(ref);\n annotation.ref = ref;\n delete annotation.id;\n }\n }\n }\n\n async saveNewAnnotations(handler, task, annotations, imagePromises) {\n if (this.xfaFactory) {\n throw new Error(\"XFA: Cannot save new annotations.\");\n }\n\n const partialEvaluator = new PartialEvaluator({\n xref: this.xref,\n handler,\n pageIndex: this.pageIndex,\n idFactory: this._localIdFactory,\n fontCache: this.fontCache,\n builtInCMapCache: this.builtInCMapCache,\n standardFontDataCache: this.standardFontDataCache,\n globalImageCache: this.globalImageCache,\n systemFontCache: this.systemFontCache,\n options: this.evaluatorOptions,\n });\n\n const deletedAnnotations = new RefSet();\n const existingAnnotations = new RefSet();\n this.#replaceIdByRef(annotations, deletedAnnotations, existingAnnotations);\n\n const pageDict = this.pageDict;\n const annotationsArray = this.annotations.filter(\n a => !(a instanceof Ref && deletedAnnotations.has(a))\n );\n const newData = await AnnotationFactory.saveNewAnnotations(\n partialEvaluator,\n task,\n annotations,\n imagePromises\n );\n\n for (const { ref } of newData.annotations) {\n // Don't add an existing annotation ref to the annotations array.\n if (ref instanceof Ref && !existingAnnotations.has(ref)) {\n annotationsArray.push(ref);\n }\n }\n\n const savedDict = pageDict.get(\"Annots\");\n pageDict.set(\"Annots\", annotationsArray);\n const buffer = [];\n await writeObject(this.ref, pageDict, buffer, this.xref);\n if (savedDict) {\n pageDict.set(\"Annots\", savedDict);\n }\n\n const objects = newData.dependencies;\n objects.push(\n { ref: this.ref, data: buffer.join(\"\") },\n ...newData.annotations\n );\n\n return objects;\n }\n\n save(handler, task, annotationStorage) {\n const partialEvaluator = new PartialEvaluator({\n xref: this.xref,\n handler,\n pageIndex: this.pageIndex,\n idFactory: this._localIdFactory,\n fontCache: this.fontCache,\n builtInCMapCache: this.builtInCMapCache,\n standardFontDataCache: this.standardFontDataCache,\n globalImageCache: this.globalImageCache,\n systemFontCache: this.systemFontCache,\n options: this.evaluatorOptions,\n });\n\n // Fetch the page's annotations and save the content\n // in case of interactive form fields.\n return this._parsedAnnotations.then(function (annotations) {\n const newRefsPromises = [];\n for (const annotation of annotations) {\n if (!annotation.mustBePrinted(annotationStorage)) {\n continue;\n }\n newRefsPromises.push(\n annotation\n .save(partialEvaluator, task, annotationStorage)\n .catch(function (reason) {\n warn(\n \"save - ignoring annotation data during \" +\n `\"${task.name}\" task: \"${reason}\".`\n );\n return null;\n })\n );\n }\n\n return Promise.all(newRefsPromises).then(function (newRefs) {\n return newRefs.filter(newRef => !!newRef);\n });\n });\n }\n\n loadResources(keys) {\n if (!this.resourcesPromise) {\n // TODO: add async `_getInheritableProperty` and remove this.\n this.resourcesPromise = this.pdfManager.ensure(this, \"resources\");\n }\n return this.resourcesPromise.then(() => {\n const objectLoader = new ObjectLoader(this.resources, keys, this.xref);\n return objectLoader.load();\n });\n }\n\n getOperatorList({\n handler,\n sink,\n task,\n intent,\n cacheKey,\n annotationStorage = null,\n }) {\n const contentStreamPromise = this.getContentStream();\n const resourcesPromise = this.loadResources([\n \"ColorSpace\",\n \"ExtGState\",\n \"Font\",\n \"Pattern\",\n \"Properties\",\n \"Shading\",\n \"XObject\",\n ]);\n\n const partialEvaluator = new PartialEvaluator({\n xref: this.xref,\n handler,\n pageIndex: this.pageIndex,\n idFactory: this._localIdFactory,\n fontCache: this.fontCache,\n builtInCMapCache: this.builtInCMapCache,\n standardFontDataCache: this.standardFontDataCache,\n globalImageCache: this.globalImageCache,\n systemFontCache: this.systemFontCache,\n options: this.evaluatorOptions,\n });\n\n const newAnnotationsByPage = !this.xfaFactory\n ? getNewAnnotationsMap(annotationStorage)\n : null;\n let deletedAnnotations = null;\n\n let newAnnotationsPromise = Promise.resolve(null);\n if (newAnnotationsByPage) {\n const newAnnotations = newAnnotationsByPage.get(this.pageIndex);\n if (newAnnotations) {\n const annotationGlobalsPromise =\n this.pdfManager.ensureDoc(\"annotationGlobals\");\n let imagePromises;\n\n // An annotation can contain a reference to a bitmap, but this bitmap\n // is defined in another annotation. So we need to find this annotation\n // and generate the bitmap.\n const missingBitmaps = new Set();\n for (const { bitmapId, bitmap } of newAnnotations) {\n if (bitmapId && !bitmap && !missingBitmaps.has(bitmapId)) {\n missingBitmaps.add(bitmapId);\n }\n }\n\n const { isOffscreenCanvasSupported } = this.evaluatorOptions;\n if (missingBitmaps.size > 0) {\n const annotationWithBitmaps = newAnnotations.slice();\n for (const [key, annotation] of annotationStorage) {\n if (!key.startsWith(AnnotationEditorPrefix)) {\n continue;\n }\n if (annotation.bitmap && missingBitmaps.has(annotation.bitmapId)) {\n annotationWithBitmaps.push(annotation);\n }\n }\n // The array annotationWithBitmaps cannot be empty: the check above\n // makes sure to have at least one annotation containing the bitmap.\n imagePromises = AnnotationFactory.generateImages(\n annotationWithBitmaps,\n this.xref,\n isOffscreenCanvasSupported\n );\n } else {\n imagePromises = AnnotationFactory.generateImages(\n newAnnotations,\n this.xref,\n isOffscreenCanvasSupported\n );\n }\n\n deletedAnnotations = new RefSet();\n this.#replaceIdByRef(newAnnotations, deletedAnnotations, null);\n\n newAnnotationsPromise = annotationGlobalsPromise.then(\n annotationGlobals => {\n if (!annotationGlobals) {\n return null;\n }\n\n return AnnotationFactory.printNewAnnotations(\n annotationGlobals,\n partialEvaluator,\n task,\n newAnnotations,\n imagePromises\n );\n }\n );\n }\n }\n const dataPromises = Promise.all([contentStreamPromise, resourcesPromise]);\n const pageListPromise = dataPromises.then(([contentStream]) => {\n const opList = new OperatorList(intent, sink);\n\n handler.send(\"StartRenderPage\", {\n transparency: partialEvaluator.hasBlendModes(\n this.resources,\n this.nonBlendModesSet\n ),\n pageIndex: this.pageIndex,\n cacheKey,\n });\n\n return partialEvaluator\n .getOperatorList({\n stream: contentStream,\n task,\n resources: this.resources,\n operatorList: opList,\n })\n .then(function () {\n return opList;\n });\n });\n\n // Fetch the page's annotations and add their operator lists to the\n // page's operator list to render them.\n return Promise.all([\n pageListPromise,\n this._parsedAnnotations,\n newAnnotationsPromise,\n ]).then(function ([pageOpList, annotations, newAnnotations]) {\n if (newAnnotations) {\n // Some annotations can already exist (if it has the refToReplace\n // property). In this case, we replace the old annotation by the new\n // one.\n annotations = annotations.filter(\n a => !(a.ref && deletedAnnotations.has(a.ref))\n );\n for (let i = 0, ii = newAnnotations.length; i < ii; i++) {\n const newAnnotation = newAnnotations[i];\n if (newAnnotation.refToReplace) {\n const j = annotations.findIndex(\n a => a.ref && isRefsEqual(a.ref, newAnnotation.refToReplace)\n );\n if (j >= 0) {\n annotations.splice(j, 1, newAnnotation);\n newAnnotations.splice(i--, 1);\n ii--;\n }\n }\n }\n annotations = annotations.concat(newAnnotations);\n }\n if (\n annotations.length === 0 ||\n intent & RenderingIntentFlag.ANNOTATIONS_DISABLE\n ) {\n pageOpList.flush(/* lastChunk = */ true);\n return { length: pageOpList.totalLength };\n }\n const renderForms = !!(intent & RenderingIntentFlag.ANNOTATIONS_FORMS),\n intentAny = !!(intent & RenderingIntentFlag.ANY),\n intentDisplay = !!(intent & RenderingIntentFlag.DISPLAY),\n intentPrint = !!(intent & RenderingIntentFlag.PRINT);\n\n // Collect the operator list promises for the annotations. Each promise\n // is resolved with the complete operator list for a single annotation.\n const opListPromises = [];\n for (const annotation of annotations) {\n if (\n intentAny ||\n (intentDisplay &&\n annotation.mustBeViewed(annotationStorage, renderForms)) ||\n (intentPrint && annotation.mustBePrinted(annotationStorage))\n ) {\n opListPromises.push(\n annotation\n .getOperatorList(\n partialEvaluator,\n task,\n intent,\n renderForms,\n annotationStorage\n )\n .catch(function (reason) {\n warn(\n \"getOperatorList - ignoring annotation data during \" +\n `\"${task.name}\" task: \"${reason}\".`\n );\n return {\n opList: null,\n separateForm: false,\n separateCanvas: false,\n };\n })\n );\n }\n }\n\n return Promise.all(opListPromises).then(function (opLists) {\n let form = false,\n canvas = false;\n\n for (const { opList, separateForm, separateCanvas } of opLists) {\n pageOpList.addOpList(opList);\n\n form ||= separateForm;\n canvas ||= separateCanvas;\n }\n pageOpList.flush(\n /* lastChunk = */ true,\n /* separateAnnots = */ { form, canvas }\n );\n return { length: pageOpList.totalLength };\n });\n });\n }\n\n extractTextContent({\n handler,\n task,\n includeMarkedContent,\n disableNormalization,\n sink,\n }) {\n const contentStreamPromise = this.getContentStream();\n const resourcesPromise = this.loadResources([\n \"ExtGState\",\n \"Font\",\n \"Properties\",\n \"XObject\",\n ]);\n\n const dataPromises = Promise.all([contentStreamPromise, resourcesPromise]);\n return dataPromises.then(([contentStream]) => {\n const partialEvaluator = new PartialEvaluator({\n xref: this.xref,\n handler,\n pageIndex: this.pageIndex,\n idFactory: this._localIdFactory,\n fontCache: this.fontCache,\n builtInCMapCache: this.builtInCMapCache,\n standardFontDataCache: this.standardFontDataCache,\n globalImageCache: this.globalImageCache,\n systemFontCache: this.systemFontCache,\n options: this.evaluatorOptions,\n });\n\n return partialEvaluator.getTextContent({\n stream: contentStream,\n task,\n resources: this.resources,\n includeMarkedContent,\n disableNormalization,\n sink,\n viewBox: this.view,\n });\n });\n }\n\n async getStructTree() {\n const structTreeRoot =\n await this.pdfManager.ensureCatalog(\"structTreeRoot\");\n if (!structTreeRoot) {\n return null;\n }\n // Ensure that the structTree will contain the page's annotations.\n await this._parsedAnnotations;\n\n const structTree = await this.pdfManager.ensure(this, \"_parseStructTree\", [\n structTreeRoot,\n ]);\n return structTree.serializable;\n }\n\n /**\n * @private\n */\n _parseStructTree(structTreeRoot) {\n const tree = new StructTreePage(structTreeRoot, this.pageDict);\n tree.parse(this.ref);\n return tree;\n }\n\n async getAnnotationsData(handler, task, intent) {\n const annotations = await this._parsedAnnotations;\n if (annotations.length === 0) {\n return annotations;\n }\n\n const annotationsData = [],\n textContentPromises = [];\n let partialEvaluator;\n\n const intentAny = !!(intent & RenderingIntentFlag.ANY),\n intentDisplay = !!(intent & RenderingIntentFlag.DISPLAY),\n intentPrint = !!(intent & RenderingIntentFlag.PRINT);\n\n for (const annotation of annotations) {\n // Get the annotation even if it's hidden because\n // JS can change its display.\n const isVisible = intentAny || (intentDisplay && annotation.viewable);\n if (isVisible || (intentPrint && annotation.printable)) {\n annotationsData.push(annotation.data);\n }\n\n if (annotation.hasTextContent && isVisible) {\n partialEvaluator ||= new PartialEvaluator({\n xref: this.xref,\n handler,\n pageIndex: this.pageIndex,\n idFactory: this._localIdFactory,\n fontCache: this.fontCache,\n builtInCMapCache: this.builtInCMapCache,\n standardFontDataCache: this.standardFontDataCache,\n globalImageCache: this.globalImageCache,\n systemFontCache: this.systemFontCache,\n options: this.evaluatorOptions,\n });\n\n textContentPromises.push(\n annotation\n .extractTextContent(partialEvaluator, task, [\n -Infinity,\n -Infinity,\n Infinity,\n Infinity,\n ])\n .catch(function (reason) {\n warn(\n `getAnnotationsData - ignoring textContent during \"${task.name}\" task: \"${reason}\".`\n );\n })\n );\n }\n }\n\n await Promise.all(textContentPromises);\n return annotationsData;\n }\n\n get annotations() {\n const annots = this._getInheritableProperty(\"Annots\");\n return shadow(this, \"annotations\", Array.isArray(annots) ? annots : []);\n }\n\n get _parsedAnnotations() {\n const promise = this.pdfManager\n .ensure(this, \"annotations\")\n .then(async annots => {\n if (annots.length === 0) {\n return annots;\n }\n const annotationGlobals =\n await this.pdfManager.ensureDoc(\"annotationGlobals\");\n if (!annotationGlobals) {\n return [];\n }\n\n const annotationPromises = [];\n for (const annotationRef of annots) {\n annotationPromises.push(\n AnnotationFactory.create(\n this.xref,\n annotationRef,\n annotationGlobals,\n this._localIdFactory,\n /* collectFields */ false,\n this.ref\n ).catch(function (reason) {\n warn(`_parsedAnnotations: \"${reason}\".`);\n return null;\n })\n );\n }\n\n const sortedAnnotations = [];\n let popupAnnotations;\n // Ensure that PopupAnnotations are handled last, since they depend on\n // their parent Annotation in the display layer; fixes issue 11362.\n for (const annotation of await Promise.all(annotationPromises)) {\n if (!annotation) {\n continue;\n }\n if (annotation instanceof PopupAnnotation) {\n (popupAnnotations ||= []).push(annotation);\n continue;\n }\n sortedAnnotations.push(annotation);\n }\n if (popupAnnotations) {\n sortedAnnotations.push(...popupAnnotations);\n }\n\n return sortedAnnotations;\n });\n\n return shadow(this, \"_parsedAnnotations\", promise);\n }\n\n get jsActions() {\n const actions = collectActions(\n this.xref,\n this.pageDict,\n PageActionEventType\n );\n return shadow(this, \"jsActions\", actions);\n }\n}\n\nconst PDF_HEADER_SIGNATURE = new Uint8Array([0x25, 0x50, 0x44, 0x46, 0x2d]);\nconst STARTXREF_SIGNATURE = new Uint8Array([\n 0x73, 0x74, 0x61, 0x72, 0x74, 0x78, 0x72, 0x65, 0x66,\n]);\nconst ENDOBJ_SIGNATURE = new Uint8Array([0x65, 0x6e, 0x64, 0x6f, 0x62, 0x6a]);\n\nconst FINGERPRINT_FIRST_BYTES = 1024;\nconst EMPTY_FINGERPRINT =\n \"\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\";\n\nfunction find(stream, signature, limit = 1024, backwards = false) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(limit > 0, 'The \"limit\" must be a positive integer.');\n }\n const signatureLength = signature.length;\n\n const scanBytes = stream.peekBytes(limit);\n const scanLength = scanBytes.length - signatureLength;\n\n if (scanLength <= 0) {\n return false;\n }\n if (backwards) {\n const signatureEnd = signatureLength - 1;\n\n let pos = scanBytes.length - 1;\n while (pos >= signatureEnd) {\n let j = 0;\n while (\n j < signatureLength &&\n scanBytes[pos - j] === signature[signatureEnd - j]\n ) {\n j++;\n }\n if (j >= signatureLength) {\n // `signature` found.\n stream.pos += pos - signatureEnd;\n return true;\n }\n pos--;\n }\n } else {\n // forwards\n let pos = 0;\n while (pos <= scanLength) {\n let j = 0;\n while (j < signatureLength && scanBytes[pos + j] === signature[j]) {\n j++;\n }\n if (j >= signatureLength) {\n // `signature` found.\n stream.pos += pos;\n return true;\n }\n pos++;\n }\n }\n return false;\n}\n\n/**\n * The `PDFDocument` class holds all the (worker-thread) data of the PDF file.\n */\nclass PDFDocument {\n constructor(pdfManager, stream) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n stream instanceof BaseStream,\n 'PDFDocument: Invalid \"stream\" argument.'\n );\n }\n if (stream.length <= 0) {\n throw new InvalidPDFException(\n \"The PDF file is empty, i.e. its size is zero bytes.\"\n );\n }\n\n this.pdfManager = pdfManager;\n this.stream = stream;\n this.xref = new XRef(stream, pdfManager);\n this._pagePromises = new Map();\n this._version = null;\n\n const idCounters = {\n font: 0,\n };\n this._globalIdFactory = class {\n static getDocId() {\n return `g_${pdfManager.docId}`;\n }\n\n static createFontId() {\n return `f${++idCounters.font}`;\n }\n\n static createObjId() {\n unreachable(\"Abstract method `createObjId` called.\");\n }\n\n static getPageObjId() {\n unreachable(\"Abstract method `getPageObjId` called.\");\n }\n };\n }\n\n parse(recoveryMode) {\n this.xref.parse(recoveryMode);\n this.catalog = new Catalog(this.pdfManager, this.xref);\n }\n\n get linearization() {\n let linearization = null;\n try {\n linearization = Linearization.create(this.stream);\n } catch (err) {\n if (err instanceof MissingDataException) {\n throw err;\n }\n info(err);\n }\n return shadow(this, \"linearization\", linearization);\n }\n\n get startXRef() {\n const stream = this.stream;\n let startXRef = 0;\n\n if (this.linearization) {\n // Find the end of the first object.\n stream.reset();\n if (find(stream, ENDOBJ_SIGNATURE)) {\n startXRef = stream.pos + 6 - stream.start;\n }\n } else {\n // Find `startxref` by checking backwards from the end of the file.\n const step = 1024;\n const startXRefLength = STARTXREF_SIGNATURE.length;\n let found = false,\n pos = stream.end;\n\n while (!found && pos > 0) {\n pos -= step - startXRefLength;\n if (pos < 0) {\n pos = 0;\n }\n stream.pos = pos;\n found = find(stream, STARTXREF_SIGNATURE, step, true);\n }\n\n if (found) {\n stream.skip(9);\n let ch;\n do {\n ch = stream.getByte();\n } while (isWhiteSpace(ch));\n let str = \"\";\n while (ch >= /* Space = */ 0x20 && ch <= /* '9' = */ 0x39) {\n str += String.fromCharCode(ch);\n ch = stream.getByte();\n }\n startXRef = parseInt(str, 10);\n if (isNaN(startXRef)) {\n startXRef = 0;\n }\n }\n }\n return shadow(this, \"startXRef\", startXRef);\n }\n\n // Find the header, get the PDF format version and setup the\n // stream to start from the header.\n checkHeader() {\n const stream = this.stream;\n stream.reset();\n\n if (!find(stream, PDF_HEADER_SIGNATURE)) {\n // May not be a PDF file, but don't throw an error and let\n // parsing continue.\n return;\n }\n stream.moveStart();\n\n // Skip over the \"%PDF-\" prefix, since it was found above.\n stream.skip(PDF_HEADER_SIGNATURE.length);\n // Read the PDF format version.\n let version = \"\",\n ch;\n while (\n (ch = stream.getByte()) > /* Space = */ 0x20 &&\n version.length < /* MAX_PDF_VERSION_LENGTH = */ 7\n ) {\n version += String.fromCharCode(ch);\n }\n\n if (PDF_VERSION_REGEXP.test(version)) {\n this._version = version;\n } else {\n warn(`Invalid PDF header version: ${version}`);\n }\n }\n\n parseStartXRef() {\n this.xref.setStartXRef(this.startXRef);\n }\n\n get numPages() {\n let num = 0;\n if (this.catalog.hasActualNumPages) {\n num = this.catalog.numPages;\n } else if (this.xfaFactory) {\n // num is a Promise.\n num = this.xfaFactory.getNumPages();\n } else if (this.linearization) {\n num = this.linearization.numPages;\n } else {\n num = this.catalog.numPages;\n }\n return shadow(this, \"numPages\", num);\n }\n\n /**\n * @private\n */\n _hasOnlyDocumentSignatures(fields, recursionDepth = 0) {\n const RECURSION_LIMIT = 10;\n\n if (!Array.isArray(fields)) {\n return false;\n }\n return fields.every(field => {\n field = this.xref.fetchIfRef(field);\n if (!(field instanceof Dict)) {\n return false;\n }\n if (field.has(\"Kids\")) {\n if (++recursionDepth > RECURSION_LIMIT) {\n warn(\"_hasOnlyDocumentSignatures: maximum recursion depth reached\");\n return false;\n }\n return this._hasOnlyDocumentSignatures(\n field.get(\"Kids\"),\n recursionDepth\n );\n }\n const isSignature = isName(field.get(\"FT\"), \"Sig\");\n const rectangle = field.get(\"Rect\");\n const isInvisible =\n Array.isArray(rectangle) && rectangle.every(value => value === 0);\n return isSignature && isInvisible;\n });\n }\n\n get _xfaStreams() {\n const acroForm = this.catalog.acroForm;\n if (!acroForm) {\n return null;\n }\n\n const xfa = acroForm.get(\"XFA\");\n const entries = {\n \"xdp:xdp\": \"\",\n template: \"\",\n datasets: \"\",\n config: \"\",\n connectionSet: \"\",\n localeSet: \"\",\n stylesheet: \"\",\n \"/xdp:xdp\": \"\",\n };\n if (xfa instanceof BaseStream && !xfa.isEmpty) {\n entries[\"xdp:xdp\"] = xfa;\n return entries;\n }\n\n if (!Array.isArray(xfa) || xfa.length === 0) {\n return null;\n }\n\n for (let i = 0, ii = xfa.length; i < ii; i += 2) {\n let name;\n if (i === 0) {\n name = \"xdp:xdp\";\n } else if (i === ii - 2) {\n name = \"/xdp:xdp\";\n } else {\n name = xfa[i];\n }\n\n if (!entries.hasOwnProperty(name)) {\n continue;\n }\n const data = this.xref.fetchIfRef(xfa[i + 1]);\n if (!(data instanceof BaseStream) || data.isEmpty) {\n continue;\n }\n entries[name] = data;\n }\n return entries;\n }\n\n get xfaDatasets() {\n const streams = this._xfaStreams;\n if (!streams) {\n return shadow(this, \"xfaDatasets\", null);\n }\n for (const key of [\"datasets\", \"xdp:xdp\"]) {\n const stream = streams[key];\n if (!stream) {\n continue;\n }\n try {\n const str = stringToUTF8String(stream.getString());\n const data = { [key]: str };\n return shadow(this, \"xfaDatasets\", new DatasetReader(data));\n } catch {\n warn(\"XFA - Invalid utf-8 string.\");\n break;\n }\n }\n return shadow(this, \"xfaDatasets\", null);\n }\n\n get xfaData() {\n const streams = this._xfaStreams;\n if (!streams) {\n return null;\n }\n const data = Object.create(null);\n for (const [key, stream] of Object.entries(streams)) {\n if (!stream) {\n continue;\n }\n try {\n data[key] = stringToUTF8String(stream.getString());\n } catch {\n warn(\"XFA - Invalid utf-8 string.\");\n return null;\n }\n }\n return data;\n }\n\n get xfaFactory() {\n let data;\n if (\n this.pdfManager.enableXfa &&\n this.catalog.needsRendering &&\n this.formInfo.hasXfa &&\n !this.formInfo.hasAcroForm\n ) {\n data = this.xfaData;\n }\n return shadow(this, \"xfaFactory\", data ? new XFAFactory(data) : null);\n }\n\n get isPureXfa() {\n return this.xfaFactory ? this.xfaFactory.isValid() : false;\n }\n\n get htmlForXfa() {\n return this.xfaFactory ? this.xfaFactory.getPages() : null;\n }\n\n async loadXfaImages() {\n const xfaImagesDict = await this.pdfManager.ensureCatalog(\"xfaImages\");\n if (!xfaImagesDict) {\n return;\n }\n\n const keys = xfaImagesDict.getKeys();\n const objectLoader = new ObjectLoader(xfaImagesDict, keys, this.xref);\n await objectLoader.load();\n\n const xfaImages = new Map();\n for (const key of keys) {\n const stream = xfaImagesDict.get(key);\n if (stream instanceof BaseStream) {\n xfaImages.set(key, stream.getBytes());\n }\n }\n\n this.xfaFactory.setImages(xfaImages);\n }\n\n async loadXfaFonts(handler, task) {\n const acroForm = await this.pdfManager.ensureCatalog(\"acroForm\");\n if (!acroForm) {\n return;\n }\n const resources = await acroForm.getAsync(\"DR\");\n if (!(resources instanceof Dict)) {\n return;\n }\n const objectLoader = new ObjectLoader(resources, [\"Font\"], this.xref);\n await objectLoader.load();\n\n const fontRes = resources.get(\"Font\");\n if (!(fontRes instanceof Dict)) {\n return;\n }\n\n const options = Object.assign(\n Object.create(null),\n this.pdfManager.evaluatorOptions\n );\n options.useSystemFonts = false;\n\n const partialEvaluator = new PartialEvaluator({\n xref: this.xref,\n handler,\n pageIndex: -1,\n idFactory: this._globalIdFactory,\n fontCache: this.catalog.fontCache,\n builtInCMapCache: this.catalog.builtInCMapCache,\n standardFontDataCache: this.catalog.standardFontDataCache,\n options,\n });\n const operatorList = new OperatorList();\n const pdfFonts = [];\n const initialState = {\n get font() {\n return pdfFonts.at(-1);\n },\n set font(font) {\n pdfFonts.push(font);\n },\n clone() {\n return this;\n },\n };\n\n const fonts = new Map();\n fontRes.forEach((fontName, font) => {\n fonts.set(fontName, font);\n });\n const promises = [];\n\n for (const [fontName, font] of fonts) {\n const descriptor = font.get(\"FontDescriptor\");\n if (!(descriptor instanceof Dict)) {\n continue;\n }\n let fontFamily = descriptor.get(\"FontFamily\");\n // For example, \"Wingdings 3\" is not a valid font name in the css specs.\n fontFamily = fontFamily.replaceAll(/[ ]+(\\d)/g, \"$1\");\n const fontWeight = descriptor.get(\"FontWeight\");\n\n // Angle is expressed in degrees counterclockwise in PDF\n // when it's clockwise in CSS\n // (see https://drafts.csswg.org/css-fonts-4/#valdef-font-style-oblique-angle)\n const italicAngle = -descriptor.get(\"ItalicAngle\");\n const cssFontInfo = { fontFamily, fontWeight, italicAngle };\n\n if (!validateCSSFont(cssFontInfo)) {\n continue;\n }\n promises.push(\n partialEvaluator\n .handleSetFont(\n resources,\n [Name.get(fontName), 1],\n /* fontRef = */ null,\n operatorList,\n task,\n initialState,\n /* fallbackFontDict = */ null,\n /* cssFontInfo = */ cssFontInfo\n )\n .catch(function (reason) {\n warn(`loadXfaFonts: \"${reason}\".`);\n return null;\n })\n );\n }\n\n await Promise.all(promises);\n const missingFonts = this.xfaFactory.setFonts(pdfFonts);\n\n if (!missingFonts) {\n return;\n }\n\n options.ignoreErrors = true;\n promises.length = 0;\n pdfFonts.length = 0;\n\n const reallyMissingFonts = new Set();\n for (const missing of missingFonts) {\n if (!getXfaFontName(`${missing}-Regular`)) {\n // No substitution available: we'll fallback on Myriad.\n reallyMissingFonts.add(missing);\n }\n }\n\n if (reallyMissingFonts.size) {\n missingFonts.push(\"PdfJS-Fallback\");\n }\n\n for (const missing of missingFonts) {\n if (reallyMissingFonts.has(missing)) {\n continue;\n }\n for (const fontInfo of [\n { name: \"Regular\", fontWeight: 400, italicAngle: 0 },\n { name: \"Bold\", fontWeight: 700, italicAngle: 0 },\n { name: \"Italic\", fontWeight: 400, italicAngle: 12 },\n { name: \"BoldItalic\", fontWeight: 700, italicAngle: 12 },\n ]) {\n const name = `${missing}-${fontInfo.name}`;\n const dict = getXfaFontDict(name);\n\n promises.push(\n partialEvaluator\n .handleSetFont(\n resources,\n [Name.get(name), 1],\n /* fontRef = */ null,\n operatorList,\n task,\n initialState,\n /* fallbackFontDict = */ dict,\n /* cssFontInfo = */ {\n fontFamily: missing,\n fontWeight: fontInfo.fontWeight,\n italicAngle: fontInfo.italicAngle,\n }\n )\n .catch(function (reason) {\n warn(`loadXfaFonts: \"${reason}\".`);\n return null;\n })\n );\n }\n }\n\n await Promise.all(promises);\n this.xfaFactory.appendFonts(pdfFonts, reallyMissingFonts);\n }\n\n async serializeXfaData(annotationStorage) {\n return this.xfaFactory\n ? this.xfaFactory.serializeData(annotationStorage)\n : null;\n }\n\n /**\n * The specification states in section 7.5.2 that the version from\n * the catalog, if present, should overwrite the version from the header.\n */\n get version() {\n return this.catalog.version || this._version;\n }\n\n get formInfo() {\n const formInfo = {\n hasFields: false,\n hasAcroForm: false,\n hasXfa: false,\n hasSignatures: false,\n };\n const acroForm = this.catalog.acroForm;\n if (!acroForm) {\n return shadow(this, \"formInfo\", formInfo);\n }\n\n try {\n const fields = acroForm.get(\"Fields\");\n const hasFields = Array.isArray(fields) && fields.length > 0;\n formInfo.hasFields = hasFields; // Used by the `fieldObjects` getter.\n\n // The document contains XFA data if the `XFA` entry is a non-empty\n // array or stream.\n const xfa = acroForm.get(\"XFA\");\n formInfo.hasXfa =\n (Array.isArray(xfa) && xfa.length > 0) ||\n (xfa instanceof BaseStream && !xfa.isEmpty);\n\n // The document contains AcroForm data if the `Fields` entry is a\n // non-empty array and it doesn't consist of only document signatures.\n // This second check is required for files that don't actually contain\n // AcroForm data (only XFA data), but that use the `Fields` entry to\n // store (invisible) document signatures. This can be detected using\n // the first bit of the `SigFlags` integer (see Table 219 in the\n // specification).\n const sigFlags = acroForm.get(\"SigFlags\");\n const hasSignatures = !!(sigFlags & 0x1);\n const hasOnlyDocumentSignatures =\n hasSignatures && this._hasOnlyDocumentSignatures(fields);\n formInfo.hasAcroForm = hasFields && !hasOnlyDocumentSignatures;\n formInfo.hasSignatures = hasSignatures;\n } catch (ex) {\n if (ex instanceof MissingDataException) {\n throw ex;\n }\n warn(`Cannot fetch form information: \"${ex}\".`);\n }\n return shadow(this, \"formInfo\", formInfo);\n }\n\n get documentInfo() {\n const docInfo = {\n PDFFormatVersion: this.version,\n Language: this.catalog.lang,\n EncryptFilterName: this.xref.encrypt\n ? this.xref.encrypt.filterName\n : null,\n IsLinearized: !!this.linearization,\n IsAcroFormPresent: this.formInfo.hasAcroForm,\n IsXFAPresent: this.formInfo.hasXfa,\n IsCollectionPresent: !!this.catalog.collection,\n IsSignaturesPresent: this.formInfo.hasSignatures,\n };\n\n let infoDict;\n try {\n infoDict = this.xref.trailer.get(\"Info\");\n } catch (err) {\n if (err instanceof MissingDataException) {\n throw err;\n }\n info(\"The document information dictionary is invalid.\");\n }\n if (!(infoDict instanceof Dict)) {\n return shadow(this, \"documentInfo\", docInfo);\n }\n\n for (const key of infoDict.getKeys()) {\n const value = infoDict.get(key);\n\n switch (key) {\n case \"Title\":\n case \"Author\":\n case \"Subject\":\n case \"Keywords\":\n case \"Creator\":\n case \"Producer\":\n case \"CreationDate\":\n case \"ModDate\":\n if (typeof value === \"string\") {\n docInfo[key] = stringToPDFString(value);\n continue;\n }\n break;\n case \"Trapped\":\n if (value instanceof Name) {\n docInfo[key] = value;\n continue;\n }\n break;\n default:\n // For custom values, only accept white-listed types to prevent\n // errors that would occur when trying to send non-serializable\n // objects to the main-thread (for example `Dict` or `Stream`).\n let customValue;\n switch (typeof value) {\n case \"string\":\n customValue = stringToPDFString(value);\n break;\n case \"number\":\n case \"boolean\":\n customValue = value;\n break;\n default:\n if (value instanceof Name) {\n customValue = value;\n }\n break;\n }\n\n if (customValue === undefined) {\n warn(`Bad value, for custom key \"${key}\", in Info: ${value}.`);\n continue;\n }\n if (!docInfo.Custom) {\n docInfo.Custom = Object.create(null);\n }\n docInfo.Custom[key] = customValue;\n continue;\n }\n warn(`Bad value, for key \"${key}\", in Info: ${value}.`);\n }\n return shadow(this, \"documentInfo\", docInfo);\n }\n\n get fingerprints() {\n function validate(data) {\n return (\n typeof data === \"string\" &&\n data.length > 0 &&\n data !== EMPTY_FINGERPRINT\n );\n }\n\n function hexString(hash) {\n const buf = [];\n for (const num of hash) {\n const hex = num.toString(16);\n buf.push(hex.padStart(2, \"0\"));\n }\n return buf.join(\"\");\n }\n\n const idArray = this.xref.trailer.get(\"ID\");\n let hashOriginal, hashModified;\n if (Array.isArray(idArray) && validate(idArray[0])) {\n hashOriginal = stringToBytes(idArray[0]);\n\n if (idArray[1] !== idArray[0] && validate(idArray[1])) {\n hashModified = stringToBytes(idArray[1]);\n }\n } else {\n hashOriginal = calculateMD5(\n this.stream.getByteRange(0, FINGERPRINT_FIRST_BYTES),\n 0,\n FINGERPRINT_FIRST_BYTES\n );\n }\n\n return shadow(this, \"fingerprints\", [\n hexString(hashOriginal),\n hashModified ? hexString(hashModified) : null,\n ]);\n }\n\n async _getLinearizationPage(pageIndex) {\n const { catalog, linearization, xref } = this;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n linearization?.pageFirst === pageIndex,\n \"_getLinearizationPage - invalid pageIndex argument.\"\n );\n }\n\n const ref = Ref.get(linearization.objectNumberFirst, 0);\n try {\n const obj = await xref.fetchAsync(ref);\n // Ensure that the object that was found is actually a Page dictionary.\n if (obj instanceof Dict) {\n let type = obj.getRaw(\"Type\");\n if (type instanceof Ref) {\n type = await xref.fetchAsync(type);\n }\n if (isName(type, \"Page\") || (!obj.has(\"Type\") && !obj.has(\"Kids\"))) {\n if (!catalog.pageKidsCountCache.has(ref)) {\n catalog.pageKidsCountCache.put(ref, 1); // Cache the Page reference.\n }\n // Help improve performance of the `Catalog.getPageIndex` method.\n if (!catalog.pageIndexCache.has(ref)) {\n catalog.pageIndexCache.put(ref, 0);\n }\n\n return [obj, ref];\n }\n }\n throw new FormatError(\n \"The Linearization dictionary doesn't point to a valid Page dictionary.\"\n );\n } catch (reason) {\n warn(`_getLinearizationPage: \"${reason.message}\".`);\n return catalog.getPageDict(pageIndex);\n }\n }\n\n getPage(pageIndex) {\n const cachedPromise = this._pagePromises.get(pageIndex);\n if (cachedPromise) {\n return cachedPromise;\n }\n const { catalog, linearization, xfaFactory } = this;\n\n let promise;\n if (xfaFactory) {\n promise = Promise.resolve([Dict.empty, null]);\n } else if (linearization?.pageFirst === pageIndex) {\n promise = this._getLinearizationPage(pageIndex);\n } else {\n promise = catalog.getPageDict(pageIndex);\n }\n promise = promise.then(([pageDict, ref]) => {\n return new Page({\n pdfManager: this.pdfManager,\n xref: this.xref,\n pageIndex,\n pageDict,\n ref,\n globalIdFactory: this._globalIdFactory,\n fontCache: catalog.fontCache,\n builtInCMapCache: catalog.builtInCMapCache,\n standardFontDataCache: catalog.standardFontDataCache,\n globalImageCache: catalog.globalImageCache,\n systemFontCache: catalog.systemFontCache,\n nonBlendModesSet: catalog.nonBlendModesSet,\n xfaFactory,\n });\n });\n\n this._pagePromises.set(pageIndex, promise);\n return promise;\n }\n\n async checkFirstPage(recoveryMode = false) {\n if (recoveryMode) {\n return;\n }\n try {\n await this.getPage(0);\n } catch (reason) {\n if (reason instanceof XRefEntryException) {\n // Clear out the various caches to ensure that we haven't stored any\n // inconsistent and/or incorrect state, since that could easily break\n // subsequent `this.getPage` calls.\n this._pagePromises.delete(0);\n await this.cleanup();\n\n throw new XRefParseException();\n }\n }\n }\n\n async checkLastPage(recoveryMode = false) {\n const { catalog, pdfManager } = this;\n\n catalog.setActualNumPages(); // Ensure that it's always reset.\n let numPages;\n\n try {\n await Promise.all([\n pdfManager.ensureDoc(\"xfaFactory\"),\n pdfManager.ensureDoc(\"linearization\"),\n pdfManager.ensureCatalog(\"numPages\"),\n ]);\n\n if (this.xfaFactory) {\n return; // The Page count is always calculated for XFA-documents.\n } else if (this.linearization) {\n numPages = this.linearization.numPages;\n } else {\n numPages = catalog.numPages;\n }\n\n if (!Number.isInteger(numPages)) {\n throw new FormatError(\"Page count is not an integer.\");\n } else if (numPages <= 1) {\n return;\n }\n await this.getPage(numPages - 1);\n } catch (reason) {\n // Clear out the various caches to ensure that we haven't stored any\n // inconsistent and/or incorrect state, since that could easily break\n // subsequent `this.getPage` calls.\n this._pagePromises.delete(numPages - 1);\n await this.cleanup();\n\n if (reason instanceof XRefEntryException && !recoveryMode) {\n throw new XRefParseException();\n }\n warn(`checkLastPage - invalid /Pages tree /Count: ${numPages}.`);\n\n let pagesTree;\n try {\n pagesTree = await catalog.getAllPageDicts(recoveryMode);\n } catch (reasonAll) {\n if (reasonAll instanceof XRefEntryException && !recoveryMode) {\n throw new XRefParseException();\n }\n catalog.setActualNumPages(1);\n return;\n }\n\n for (const [pageIndex, [pageDict, ref]] of pagesTree) {\n let promise;\n if (pageDict instanceof Error) {\n promise = Promise.reject(pageDict);\n\n // Prevent \"uncaught exception: Object\"-messages in the console.\n promise.catch(() => {});\n } else {\n promise = Promise.resolve(\n new Page({\n pdfManager,\n xref: this.xref,\n pageIndex,\n pageDict,\n ref,\n globalIdFactory: this._globalIdFactory,\n fontCache: catalog.fontCache,\n builtInCMapCache: catalog.builtInCMapCache,\n standardFontDataCache: catalog.standardFontDataCache,\n globalImageCache: catalog.globalImageCache,\n systemFontCache: catalog.systemFontCache,\n nonBlendModesSet: catalog.nonBlendModesSet,\n xfaFactory: null,\n })\n );\n }\n\n this._pagePromises.set(pageIndex, promise);\n }\n catalog.setActualNumPages(pagesTree.size);\n }\n }\n\n fontFallback(id, handler) {\n return this.catalog.fontFallback(id, handler);\n }\n\n async cleanup(manuallyTriggered = false) {\n return this.catalog\n ? this.catalog.cleanup(manuallyTriggered)\n : clearGlobalCaches();\n }\n\n async #collectFieldObjects(\n name,\n fieldRef,\n promises,\n annotationGlobals,\n visitedRefs\n ) {\n const { xref } = this;\n\n if (!(fieldRef instanceof Ref) || visitedRefs.has(fieldRef)) {\n return;\n }\n visitedRefs.put(fieldRef);\n const field = await xref.fetchAsync(fieldRef);\n if (!(field instanceof Dict)) {\n return;\n }\n if (field.has(\"T\")) {\n const partName = stringToPDFString(await field.getAsync(\"T\"));\n name = name === \"\" ? partName : `${name}.${partName}`;\n } else {\n let obj = field;\n while (true) {\n obj = obj.getRaw(\"Parent\");\n if (obj instanceof Ref) {\n if (visitedRefs.has(obj)) {\n break;\n }\n obj = await xref.fetchAsync(obj);\n }\n if (!(obj instanceof Dict)) {\n break;\n }\n if (obj.has(\"T\")) {\n const partName = stringToPDFString(await obj.getAsync(\"T\"));\n name = name === \"\" ? partName : `${name}.${partName}`;\n break;\n }\n }\n }\n\n if (!promises.has(name)) {\n promises.set(name, []);\n }\n promises.get(name).push(\n AnnotationFactory.create(\n xref,\n fieldRef,\n annotationGlobals,\n /* idFactory = */ null,\n /* collectFields */ true,\n /* pageRef */ null\n )\n .then(annotation => annotation?.getFieldObject())\n .catch(function (reason) {\n warn(`#collectFieldObjects: \"${reason}\".`);\n return null;\n })\n );\n\n if (!field.has(\"Kids\")) {\n return;\n }\n const kids = await field.getAsync(\"Kids\");\n if (Array.isArray(kids)) {\n for (const kid of kids) {\n await this.#collectFieldObjects(\n name,\n kid,\n promises,\n annotationGlobals,\n visitedRefs\n );\n }\n }\n }\n\n get fieldObjects() {\n if (!this.formInfo.hasFields) {\n return shadow(this, \"fieldObjects\", Promise.resolve(null));\n }\n\n const promise = Promise.all([\n this.pdfManager.ensureDoc(\"annotationGlobals\"),\n this.pdfManager.ensureCatalog(\"acroForm\"),\n ]).then(async ([annotationGlobals, acroForm]) => {\n if (!annotationGlobals) {\n return null;\n }\n\n const visitedRefs = new RefSet();\n const allFields = Object.create(null);\n const fieldPromises = new Map();\n for (const fieldRef of await acroForm.getAsync(\"Fields\")) {\n await this.#collectFieldObjects(\n \"\",\n fieldRef,\n fieldPromises,\n annotationGlobals,\n visitedRefs\n );\n }\n\n const allPromises = [];\n for (const [name, promises] of fieldPromises) {\n allPromises.push(\n Promise.all(promises).then(fields => {\n fields = fields.filter(field => !!field);\n if (fields.length > 0) {\n allFields[name] = fields;\n }\n })\n );\n }\n\n await Promise.all(allPromises);\n return allFields;\n });\n\n return shadow(this, \"fieldObjects\", promise);\n }\n\n get hasJSActions() {\n const promise = this.pdfManager.ensureDoc(\"_parseHasJSActions\");\n return shadow(this, \"hasJSActions\", promise);\n }\n\n /**\n * @private\n */\n async _parseHasJSActions() {\n const [catalogJsActions, fieldObjects] = await Promise.all([\n this.pdfManager.ensureCatalog(\"jsActions\"),\n this.pdfManager.ensureDoc(\"fieldObjects\"),\n ]);\n\n if (catalogJsActions) {\n return true;\n }\n if (fieldObjects) {\n return Object.values(fieldObjects).some(fieldObject =>\n fieldObject.some(object => object.actions !== null)\n );\n }\n return false;\n }\n\n get calculationOrderIds() {\n const acroForm = this.catalog.acroForm;\n if (!acroForm?.has(\"CO\")) {\n return shadow(this, \"calculationOrderIds\", null);\n }\n\n const calculationOrder = acroForm.get(\"CO\");\n if (!Array.isArray(calculationOrder) || calculationOrder.length === 0) {\n return shadow(this, \"calculationOrderIds\", null);\n }\n\n const ids = [];\n for (const id of calculationOrder) {\n if (id instanceof Ref) {\n ids.push(id.toString());\n }\n }\n if (ids.length === 0) {\n return shadow(this, \"calculationOrderIds\", null);\n }\n return shadow(this, \"calculationOrderIds\", ids);\n }\n\n get annotationGlobals() {\n return shadow(\n this,\n \"annotationGlobals\",\n AnnotationFactory.createGlobals(this.pdfManager)\n );\n }\n}\n\nexport { Page, PDFDocument };\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 createValidAbsoluteUrl,\n FeatureTest,\n unreachable,\n warn,\n} from \"../shared/util.js\";\nimport { ChunkedStreamManager } from \"./chunked_stream.js\";\nimport { MissingDataException } from \"./core_utils.js\";\nimport { PDFDocument } from \"./document.js\";\nimport { Stream } from \"./stream.js\";\n\nfunction parseDocBaseUrl(url) {\n if (url) {\n const absoluteUrl = createValidAbsoluteUrl(url);\n if (absoluteUrl) {\n return absoluteUrl.href;\n }\n warn(`Invalid absolute docBaseUrl: \"${url}\".`);\n }\n return null;\n}\n\nclass BasePdfManager {\n constructor(args) {\n if (this.constructor === BasePdfManager) {\n unreachable(\"Cannot initialize BasePdfManager.\");\n }\n this._docBaseUrl = parseDocBaseUrl(args.docBaseUrl);\n this._docId = args.docId;\n this._password = args.password;\n this.enableXfa = args.enableXfa;\n\n // Check `OffscreenCanvas` support once, rather than repeatedly throughout\n // the worker-thread code.\n args.evaluatorOptions.isOffscreenCanvasSupported &&=\n FeatureTest.isOffscreenCanvasSupported;\n this.evaluatorOptions = args.evaluatorOptions;\n }\n\n get docId() {\n return this._docId;\n }\n\n get password() {\n return this._password;\n }\n\n get docBaseUrl() {\n return this._docBaseUrl;\n }\n\n get catalog() {\n return this.pdfDocument.catalog;\n }\n\n ensureDoc(prop, args) {\n return this.ensure(this.pdfDocument, prop, args);\n }\n\n ensureXRef(prop, args) {\n return this.ensure(this.pdfDocument.xref, prop, args);\n }\n\n ensureCatalog(prop, args) {\n return this.ensure(this.pdfDocument.catalog, prop, args);\n }\n\n getPage(pageIndex) {\n return this.pdfDocument.getPage(pageIndex);\n }\n\n fontFallback(id, handler) {\n return this.pdfDocument.fontFallback(id, handler);\n }\n\n loadXfaFonts(handler, task) {\n return this.pdfDocument.loadXfaFonts(handler, task);\n }\n\n loadXfaImages() {\n return this.pdfDocument.loadXfaImages();\n }\n\n serializeXfaData(annotationStorage) {\n return this.pdfDocument.serializeXfaData(annotationStorage);\n }\n\n cleanup(manuallyTriggered = false) {\n return this.pdfDocument.cleanup(manuallyTriggered);\n }\n\n async ensure(obj, prop, args) {\n unreachable(\"Abstract method `ensure` called\");\n }\n\n requestRange(begin, end) {\n unreachable(\"Abstract method `requestRange` called\");\n }\n\n requestLoadedStream(noFetch = false) {\n unreachable(\"Abstract method `requestLoadedStream` called\");\n }\n\n sendProgressiveData(chunk) {\n unreachable(\"Abstract method `sendProgressiveData` called\");\n }\n\n updatePassword(password) {\n this._password = password;\n }\n\n terminate(reason) {\n unreachable(\"Abstract method `terminate` called\");\n }\n}\n\nclass LocalPdfManager extends BasePdfManager {\n constructor(args) {\n super(args);\n\n const stream = new Stream(args.source);\n this.pdfDocument = new PDFDocument(this, stream);\n this._loadedStreamPromise = Promise.resolve(stream);\n }\n\n async ensure(obj, prop, args) {\n const value = obj[prop];\n if (typeof value === \"function\") {\n return value.apply(obj, args);\n }\n return value;\n }\n\n requestRange(begin, end) {\n return Promise.resolve();\n }\n\n requestLoadedStream(noFetch = false) {\n return this._loadedStreamPromise;\n }\n\n terminate(reason) {}\n}\n\nclass NetworkPdfManager extends BasePdfManager {\n constructor(args) {\n super(args);\n\n this.streamManager = new ChunkedStreamManager(args.source, {\n msgHandler: args.handler,\n length: args.length,\n disableAutoFetch: args.disableAutoFetch,\n rangeChunkSize: args.rangeChunkSize,\n });\n this.pdfDocument = new PDFDocument(this, this.streamManager.getStream());\n }\n\n async ensure(obj, prop, args) {\n try {\n const value = obj[prop];\n if (typeof value === \"function\") {\n return value.apply(obj, args);\n }\n return value;\n } catch (ex) {\n if (!(ex instanceof MissingDataException)) {\n throw ex;\n }\n await this.requestRange(ex.begin, ex.end);\n return this.ensure(obj, prop, args);\n }\n }\n\n requestRange(begin, end) {\n return this.streamManager.requestRange(begin, end);\n }\n\n requestLoadedStream(noFetch = false) {\n return this.streamManager.requestAllChunks(noFetch);\n }\n\n sendProgressiveData(chunk) {\n this.streamManager.onReceiveData({ chunk });\n }\n\n terminate(reason) {\n this.streamManager.abort(reason);\n }\n}\n\nexport { LocalPdfManager, NetworkPdfManager };\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 2019 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 } from \"../shared/util.js\";\n\n/** @implements {IPDFStream} */\nclass PDFWorkerStream {\n constructor(msgHandler) {\n this._msgHandler = msgHandler;\n this._contentLength = null;\n this._fullRequestReader = null;\n this._rangeRequestReaders = [];\n }\n\n getFullReader() {\n assert(\n !this._fullRequestReader,\n \"PDFWorkerStream.getFullReader can only be called once.\"\n );\n this._fullRequestReader = new PDFWorkerStreamReader(this._msgHandler);\n return this._fullRequestReader;\n }\n\n getRangeReader(begin, end) {\n const reader = new PDFWorkerStreamRangeReader(begin, end, this._msgHandler);\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 PDFWorkerStreamReader {\n constructor(msgHandler) {\n this._msgHandler = msgHandler;\n this.onProgress = null;\n\n this._contentLength = null;\n this._isRangeSupported = false;\n this._isStreamingSupported = false;\n\n const readableStream = this._msgHandler.sendWithStream(\"GetReader\");\n this._reader = readableStream.getReader();\n\n this._headersReady = this._msgHandler\n .sendWithPromise(\"ReaderHeadersReady\")\n .then(data => {\n this._isStreamingSupported = data.isStreamingSupported;\n this._isRangeSupported = data.isRangeSupported;\n this._contentLength = data.contentLength;\n });\n }\n\n get headersReady() {\n return this._headersReady;\n }\n\n get contentLength() {\n return this._contentLength;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n get isRangeSupported() {\n return this._isRangeSupported;\n }\n\n async read() {\n const { value, done } = await this._reader.read();\n if (done) {\n return { value: undefined, done: true };\n }\n // `value` is wrapped into Uint8Array, we need to\n // unwrap it to ArrayBuffer for further processing.\n return { value: value.buffer, done: false };\n }\n\n cancel(reason) {\n this._reader.cancel(reason);\n }\n}\n\n/** @implements {IPDFStreamRangeReader} */\nclass PDFWorkerStreamRangeReader {\n constructor(begin, end, msgHandler) {\n this._msgHandler = msgHandler;\n this.onProgress = null;\n\n const readableStream = this._msgHandler.sendWithStream(\"GetRangeReader\", {\n begin,\n end,\n });\n this._reader = readableStream.getReader();\n }\n\n get isStreamingSupported() {\n return false;\n }\n\n async read() {\n const { value, done } = await this._reader.read();\n if (done) {\n return { value: undefined, done: true };\n }\n return { value: value.buffer, done: false };\n }\n\n cancel(reason) {\n this._reader.cancel(reason);\n }\n}\n\nexport { PDFWorkerStream };\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 getVerbosityLevel,\n info,\n InvalidPDFException,\n isNodeJS,\n MissingPDFException,\n PasswordException,\n PromiseCapability,\n setVerbosityLevel,\n stringToPDFString,\n UnexpectedResponseException,\n UnknownErrorException,\n VerbosityLevel,\n warn,\n} from \"../shared/util.js\";\nimport {\n arrayBuffersToBytes,\n getNewAnnotationsMap,\n XRefParseException,\n} from \"./core_utils.js\";\nimport { Dict, Ref } from \"./primitives.js\";\nimport { LocalPdfManager, NetworkPdfManager } from \"./pdf_manager.js\";\nimport { AnnotationFactory } from \"./annotation.js\";\nimport { clearGlobalCaches } from \"./cleanup_helper.js\";\nimport { incrementalUpdate } from \"./writer.js\";\nimport { MessageHandler } from \"../shared/message_handler.js\";\nimport { PDFWorkerStream } from \"./worker_stream.js\";\nimport { StructTreeRoot } from \"./struct_tree.js\";\n\nclass WorkerTask {\n constructor(name) {\n this.name = name;\n this.terminated = false;\n this._capability = new PromiseCapability();\n }\n\n get finished() {\n return this._capability.promise;\n }\n\n finish() {\n this._capability.resolve();\n }\n\n terminate() {\n this.terminated = true;\n }\n\n ensureNotTerminated() {\n if (this.terminated) {\n throw new Error(\"Worker task was terminated\");\n }\n }\n}\n\nclass WorkerMessageHandler {\n static setup(handler, port) {\n let testMessageProcessed = false;\n handler.on(\"test\", function (data) {\n if (testMessageProcessed) {\n return; // we already processed 'test' message once\n }\n testMessageProcessed = true;\n\n // Ensure that `TypedArray`s can be sent to the worker.\n handler.send(\"test\", data instanceof Uint8Array);\n });\n\n handler.on(\"configure\", function (data) {\n setVerbosityLevel(data.verbosity);\n });\n\n handler.on(\"GetDocRequest\", function (data) {\n return WorkerMessageHandler.createDocumentHandler(data, port);\n });\n }\n\n static createDocumentHandler(docParams, port) {\n // This context is actually holds references on pdfManager and handler,\n // until the latter is destroyed.\n let pdfManager;\n let terminated = false;\n let cancelXHRs = null;\n const WorkerTasks = new Set();\n const verbosity = getVerbosityLevel();\n\n const { docId, apiVersion } = docParams;\n const workerVersion =\n typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"TESTING\")\n ? PDFJSDev.eval(\"BUNDLE_VERSION\")\n : null;\n if (apiVersion !== workerVersion) {\n throw new Error(\n `The API version \"${apiVersion}\" does not match ` +\n `the Worker version \"${workerVersion}\".`\n );\n }\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n // Fail early, and predictably, rather than having (some) fonts fail to\n // load/render with slightly cryptic error messages in environments where\n // the `Array.prototype` has been *incorrectly* extended.\n //\n // PLEASE NOTE: We do *not* want to slow down font parsing by adding\n // `hasOwnProperty` checks all over the code-base.\n const enumerableProperties = [];\n for (const property in []) {\n enumerableProperties.push(property);\n }\n if (enumerableProperties.length) {\n throw new Error(\n \"The `Array.prototype` contains unexpected enumerable properties: \" +\n enumerableProperties.join(\", \") +\n \"; thus breaking e.g. `for...in` iteration of `Array`s.\"\n );\n }\n }\n const workerHandlerName = docId + \"_worker\";\n let handler = new MessageHandler(workerHandlerName, docId, port);\n\n function ensureNotTerminated() {\n if (terminated) {\n throw new Error(\"Worker was terminated\");\n }\n }\n\n function startWorkerTask(task) {\n WorkerTasks.add(task);\n }\n\n function finishWorkerTask(task) {\n task.finish();\n WorkerTasks.delete(task);\n }\n\n async function loadDocument(recoveryMode) {\n await pdfManager.ensureDoc(\"checkHeader\");\n await pdfManager.ensureDoc(\"parseStartXRef\");\n await pdfManager.ensureDoc(\"parse\", [recoveryMode]);\n\n // Check that at least the first page can be successfully loaded,\n // since otherwise the XRef table is definitely not valid.\n await pdfManager.ensureDoc(\"checkFirstPage\", [recoveryMode]);\n // Check that the last page can be successfully loaded, to ensure that\n // `numPages` is correct, and fallback to walking the entire /Pages-tree.\n await pdfManager.ensureDoc(\"checkLastPage\", [recoveryMode]);\n\n const isPureXfa = await pdfManager.ensureDoc(\"isPureXfa\");\n if (isPureXfa) {\n const task = new WorkerTask(\"loadXfaFonts\");\n startWorkerTask(task);\n await Promise.all([\n pdfManager\n .loadXfaFonts(handler, task)\n .catch(reason => {\n // Ignore errors, to allow the document to load.\n })\n .then(() => finishWorkerTask(task)),\n pdfManager.loadXfaImages(),\n ]);\n }\n\n const [numPages, fingerprints] = await Promise.all([\n pdfManager.ensureDoc(\"numPages\"),\n pdfManager.ensureDoc(\"fingerprints\"),\n ]);\n\n // Get htmlForXfa after numPages to avoid to create HTML twice.\n const htmlForXfa = isPureXfa\n ? await pdfManager.ensureDoc(\"htmlForXfa\")\n : null;\n\n return { numPages, fingerprints, htmlForXfa };\n }\n\n function getPdfManager({\n data,\n password,\n disableAutoFetch,\n rangeChunkSize,\n length,\n docBaseUrl,\n enableXfa,\n evaluatorOptions,\n }) {\n const pdfManagerArgs = {\n source: null,\n disableAutoFetch,\n docBaseUrl,\n docId,\n enableXfa,\n evaluatorOptions,\n handler,\n length,\n password,\n rangeChunkSize,\n };\n const pdfManagerCapability = new PromiseCapability();\n let newPdfManager;\n\n if (data) {\n try {\n pdfManagerArgs.source = data;\n\n newPdfManager = new LocalPdfManager(pdfManagerArgs);\n pdfManagerCapability.resolve(newPdfManager);\n } catch (ex) {\n pdfManagerCapability.reject(ex);\n }\n return pdfManagerCapability.promise;\n }\n\n let pdfStream,\n cachedChunks = [];\n try {\n pdfStream = new PDFWorkerStream(handler);\n } catch (ex) {\n pdfManagerCapability.reject(ex);\n return pdfManagerCapability.promise;\n }\n\n const fullRequest = pdfStream.getFullReader();\n fullRequest.headersReady\n .then(function () {\n if (!fullRequest.isRangeSupported) {\n return;\n }\n pdfManagerArgs.source = pdfStream;\n pdfManagerArgs.length = fullRequest.contentLength;\n // We don't need auto-fetch when streaming is enabled.\n pdfManagerArgs.disableAutoFetch ||= fullRequest.isStreamingSupported;\n\n newPdfManager = new NetworkPdfManager(pdfManagerArgs);\n // There may be a chance that `newPdfManager` is not initialized for\n // the first few runs of `readchunk` block of code. Be sure to send\n // all cached chunks, if any, to chunked_stream via pdf_manager.\n for (const chunk of cachedChunks) {\n newPdfManager.sendProgressiveData(chunk);\n }\n\n cachedChunks = [];\n pdfManagerCapability.resolve(newPdfManager);\n cancelXHRs = null;\n })\n .catch(function (reason) {\n pdfManagerCapability.reject(reason);\n cancelXHRs = null;\n });\n\n let loaded = 0;\n const flushChunks = function () {\n const pdfFile = arrayBuffersToBytes(cachedChunks);\n if (length && pdfFile.length !== length) {\n warn(\"reported HTTP length is different from actual\");\n }\n // the data is array, instantiating directly from it\n try {\n pdfManagerArgs.source = pdfFile;\n\n newPdfManager = new LocalPdfManager(pdfManagerArgs);\n pdfManagerCapability.resolve(newPdfManager);\n } catch (ex) {\n pdfManagerCapability.reject(ex);\n }\n cachedChunks = [];\n };\n new Promise(function (resolve, reject) {\n const readChunk = function ({ value, done }) {\n try {\n ensureNotTerminated();\n if (done) {\n if (!newPdfManager) {\n flushChunks();\n }\n cancelXHRs = null;\n return;\n }\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n value instanceof ArrayBuffer,\n \"readChunk (getPdfManager) - expected an ArrayBuffer.\"\n );\n }\n loaded += value.byteLength;\n\n if (!fullRequest.isStreamingSupported) {\n handler.send(\"DocProgress\", {\n loaded,\n total: Math.max(loaded, fullRequest.contentLength || 0),\n });\n }\n\n if (newPdfManager) {\n newPdfManager.sendProgressiveData(value);\n } else {\n cachedChunks.push(value);\n }\n fullRequest.read().then(readChunk, reject);\n } catch (e) {\n reject(e);\n }\n };\n fullRequest.read().then(readChunk, reject);\n }).catch(function (e) {\n pdfManagerCapability.reject(e);\n cancelXHRs = null;\n });\n\n cancelXHRs = function (reason) {\n pdfStream.cancelAllRequests(reason);\n };\n\n return pdfManagerCapability.promise;\n }\n\n function setupDoc(data) {\n function onSuccess(doc) {\n ensureNotTerminated();\n handler.send(\"GetDoc\", { pdfInfo: doc });\n }\n\n function onFailure(ex) {\n ensureNotTerminated();\n\n if (ex instanceof PasswordException) {\n const task = new WorkerTask(`PasswordException: response ${ex.code}`);\n startWorkerTask(task);\n\n handler\n .sendWithPromise(\"PasswordRequest\", ex)\n .then(function ({ password }) {\n finishWorkerTask(task);\n pdfManager.updatePassword(password);\n pdfManagerReady();\n })\n .catch(function () {\n finishWorkerTask(task);\n handler.send(\"DocException\", ex);\n });\n } else if (\n ex instanceof InvalidPDFException ||\n ex instanceof MissingPDFException ||\n ex instanceof UnexpectedResponseException ||\n ex instanceof UnknownErrorException\n ) {\n handler.send(\"DocException\", ex);\n } else {\n handler.send(\n \"DocException\",\n new UnknownErrorException(ex.message, ex.toString())\n );\n }\n }\n\n function pdfManagerReady() {\n ensureNotTerminated();\n\n loadDocument(false).then(onSuccess, function (reason) {\n ensureNotTerminated();\n\n // Try again with recoveryMode == true\n if (!(reason instanceof XRefParseException)) {\n onFailure(reason);\n return;\n }\n pdfManager.requestLoadedStream().then(function () {\n ensureNotTerminated();\n\n loadDocument(true).then(onSuccess, onFailure);\n });\n });\n }\n\n ensureNotTerminated();\n\n getPdfManager(data)\n .then(function (newPdfManager) {\n if (terminated) {\n // We were in a process of setting up the manager, but it got\n // terminated in the middle.\n newPdfManager.terminate(\n new AbortException(\"Worker was terminated.\")\n );\n throw new Error(\"Worker was terminated\");\n }\n pdfManager = newPdfManager;\n\n pdfManager.requestLoadedStream(/* noFetch = */ true).then(stream => {\n handler.send(\"DataLoaded\", { length: stream.bytes.byteLength });\n });\n })\n .then(pdfManagerReady, onFailure);\n }\n\n handler.on(\"GetPage\", function (data) {\n return pdfManager.getPage(data.pageIndex).then(function (page) {\n return Promise.all([\n pdfManager.ensure(page, \"rotate\"),\n pdfManager.ensure(page, \"ref\"),\n pdfManager.ensure(page, \"userUnit\"),\n pdfManager.ensure(page, \"view\"),\n ]).then(function ([rotate, ref, userUnit, view]) {\n return {\n rotate,\n ref,\n userUnit,\n view,\n };\n });\n });\n });\n\n handler.on(\"GetPageIndex\", function (data) {\n const pageRef = Ref.get(data.num, data.gen);\n return pdfManager.ensureCatalog(\"getPageIndex\", [pageRef]);\n });\n\n handler.on(\"GetDestinations\", function (data) {\n return pdfManager.ensureCatalog(\"destinations\");\n });\n\n handler.on(\"GetDestination\", function (data) {\n return pdfManager.ensureCatalog(\"getDestination\", [data.id]);\n });\n\n handler.on(\"GetPageLabels\", function (data) {\n return pdfManager.ensureCatalog(\"pageLabels\");\n });\n\n handler.on(\"GetPageLayout\", function (data) {\n return pdfManager.ensureCatalog(\"pageLayout\");\n });\n\n handler.on(\"GetPageMode\", function (data) {\n return pdfManager.ensureCatalog(\"pageMode\");\n });\n\n handler.on(\"GetViewerPreferences\", function (data) {\n return pdfManager.ensureCatalog(\"viewerPreferences\");\n });\n\n handler.on(\"GetOpenAction\", function (data) {\n return pdfManager.ensureCatalog(\"openAction\");\n });\n\n handler.on(\"GetAttachments\", function (data) {\n return pdfManager.ensureCatalog(\"attachments\");\n });\n\n handler.on(\"GetDocJSActions\", function (data) {\n return pdfManager.ensureCatalog(\"jsActions\");\n });\n\n handler.on(\"GetPageJSActions\", function ({ pageIndex }) {\n return pdfManager.getPage(pageIndex).then(function (page) {\n return pdfManager.ensure(page, \"jsActions\");\n });\n });\n\n handler.on(\"GetOutline\", function (data) {\n return pdfManager.ensureCatalog(\"documentOutline\");\n });\n\n handler.on(\"GetOptionalContentConfig\", function (data) {\n return pdfManager.ensureCatalog(\"optionalContentConfig\");\n });\n\n handler.on(\"GetPermissions\", function (data) {\n return pdfManager.ensureCatalog(\"permissions\");\n });\n\n handler.on(\"GetMetadata\", function (data) {\n return Promise.all([\n pdfManager.ensureDoc(\"documentInfo\"),\n pdfManager.ensureCatalog(\"metadata\"),\n ]);\n });\n\n handler.on(\"GetMarkInfo\", function (data) {\n return pdfManager.ensureCatalog(\"markInfo\");\n });\n\n handler.on(\"GetData\", function (data) {\n return pdfManager.requestLoadedStream().then(function (stream) {\n return stream.bytes;\n });\n });\n\n handler.on(\"GetAnnotations\", function ({ pageIndex, intent }) {\n return pdfManager.getPage(pageIndex).then(function (page) {\n const task = new WorkerTask(`GetAnnotations: page ${pageIndex}`);\n startWorkerTask(task);\n\n return page.getAnnotationsData(handler, task, intent).then(\n data => {\n finishWorkerTask(task);\n return data;\n },\n reason => {\n finishWorkerTask(task);\n throw reason;\n }\n );\n });\n });\n\n handler.on(\"GetFieldObjects\", function (data) {\n return pdfManager.ensureDoc(\"fieldObjects\");\n });\n\n handler.on(\"HasJSActions\", function (data) {\n return pdfManager.ensureDoc(\"hasJSActions\");\n });\n\n handler.on(\"GetCalculationOrderIds\", function (data) {\n return pdfManager.ensureDoc(\"calculationOrderIds\");\n });\n\n handler.on(\n \"SaveDocument\",\n async function ({ isPureXfa, numPages, annotationStorage, filename }) {\n const globalPromises = [\n pdfManager.requestLoadedStream(),\n pdfManager.ensureCatalog(\"acroForm\"),\n pdfManager.ensureCatalog(\"acroFormRef\"),\n pdfManager.ensureDoc(\"startXRef\"),\n pdfManager.ensureDoc(\"xref\"),\n pdfManager.ensureDoc(\"linearization\"),\n pdfManager.ensureCatalog(\"structTreeRoot\"),\n ];\n const promises = [];\n\n const newAnnotationsByPage = !isPureXfa\n ? getNewAnnotationsMap(annotationStorage)\n : null;\n const [\n stream,\n acroForm,\n acroFormRef,\n startXRef,\n xref,\n linearization,\n _structTreeRoot,\n ] = await Promise.all(globalPromises);\n const catalogRef = xref.trailer.getRaw(\"Root\") || null;\n let structTreeRoot;\n\n if (newAnnotationsByPage) {\n if (!_structTreeRoot) {\n if (\n await StructTreeRoot.canCreateStructureTree({\n catalogRef,\n pdfManager,\n newAnnotationsByPage,\n })\n ) {\n structTreeRoot = null;\n }\n } else if (\n await _structTreeRoot.canUpdateStructTree({\n pdfManager,\n xref,\n newAnnotationsByPage,\n })\n ) {\n structTreeRoot = _structTreeRoot;\n }\n\n const imagePromises = AnnotationFactory.generateImages(\n annotationStorage.values(),\n xref,\n pdfManager.evaluatorOptions.isOffscreenCanvasSupported\n );\n const newAnnotationPromises =\n structTreeRoot === undefined ? promises : [];\n for (const [pageIndex, annotations] of newAnnotationsByPage) {\n newAnnotationPromises.push(\n pdfManager.getPage(pageIndex).then(page => {\n const task = new WorkerTask(`Save (editor): page ${pageIndex}`);\n return page\n .saveNewAnnotations(handler, task, annotations, imagePromises)\n .finally(function () {\n finishWorkerTask(task);\n });\n })\n );\n }\n if (structTreeRoot === null) {\n // No structTreeRoot exists, so we need to create one.\n promises.push(\n Promise.all(newAnnotationPromises).then(async newRefs => {\n await StructTreeRoot.createStructureTree({\n newAnnotationsByPage,\n xref,\n catalogRef,\n pdfManager,\n newRefs,\n });\n return newRefs;\n })\n );\n } else if (structTreeRoot) {\n promises.push(\n Promise.all(newAnnotationPromises).then(async newRefs => {\n await structTreeRoot.updateStructureTree({\n newAnnotationsByPage,\n pdfManager,\n newRefs,\n });\n return newRefs;\n })\n );\n }\n }\n\n if (isPureXfa) {\n promises.push(pdfManager.serializeXfaData(annotationStorage));\n } else {\n for (let pageIndex = 0; pageIndex < numPages; pageIndex++) {\n promises.push(\n pdfManager.getPage(pageIndex).then(function (page) {\n const task = new WorkerTask(`Save: page ${pageIndex}`);\n return page\n .save(handler, task, annotationStorage)\n .finally(function () {\n finishWorkerTask(task);\n });\n })\n );\n }\n }\n const refs = await Promise.all(promises);\n\n let newRefs = [];\n let xfaData = null;\n if (isPureXfa) {\n xfaData = refs[0];\n if (!xfaData) {\n return stream.bytes;\n }\n } else {\n newRefs = refs.flat(2);\n\n if (newRefs.length === 0) {\n // No new refs so just return the initial bytes\n return stream.bytes;\n }\n }\n\n const needAppearances =\n acroFormRef &&\n acroForm instanceof Dict &&\n newRefs.some(ref => ref.needAppearances);\n\n const xfa = (acroForm instanceof Dict && acroForm.get(\"XFA\")) || null;\n let xfaDatasetsRef = null;\n let hasXfaDatasetsEntry = false;\n if (Array.isArray(xfa)) {\n for (let i = 0, ii = xfa.length; i < ii; i += 2) {\n if (xfa[i] === \"datasets\") {\n xfaDatasetsRef = xfa[i + 1];\n hasXfaDatasetsEntry = true;\n }\n }\n if (xfaDatasetsRef === null) {\n xfaDatasetsRef = xref.getNewTemporaryRef();\n }\n } else if (xfa) {\n // TODO: Support XFA streams.\n warn(\"Unsupported XFA type.\");\n }\n\n let newXrefInfo = Object.create(null);\n if (xref.trailer) {\n // Get string info from Info in order to compute fileId.\n const infoObj = Object.create(null);\n const xrefInfo = xref.trailer.get(\"Info\") || null;\n if (xrefInfo instanceof Dict) {\n xrefInfo.forEach((key, value) => {\n if (typeof value === \"string\") {\n infoObj[key] = stringToPDFString(value);\n }\n });\n }\n\n newXrefInfo = {\n rootRef: catalogRef,\n encryptRef: xref.trailer.getRaw(\"Encrypt\") || null,\n newRef: xref.getNewTemporaryRef(),\n infoRef: xref.trailer.getRaw(\"Info\") || null,\n info: infoObj,\n fileIds: xref.trailer.get(\"ID\") || null,\n startXRef: linearization\n ? startXRef\n : xref.lastXRefStreamPos ?? startXRef,\n filename,\n };\n }\n\n return incrementalUpdate({\n originalData: stream.bytes,\n xrefInfo: newXrefInfo,\n newRefs,\n xref,\n hasXfa: !!xfa,\n xfaDatasetsRef,\n hasXfaDatasetsEntry,\n needAppearances,\n acroFormRef,\n acroForm,\n xfaData,\n }).finally(() => {\n xref.resetNewTemporaryRef();\n });\n }\n );\n\n handler.on(\"GetOperatorList\", function (data, sink) {\n const pageIndex = data.pageIndex;\n pdfManager.getPage(pageIndex).then(function (page) {\n const task = new WorkerTask(`GetOperatorList: page ${pageIndex}`);\n startWorkerTask(task);\n\n // NOTE: Keep this condition in sync with the `info` helper function.\n const start = verbosity >= VerbosityLevel.INFOS ? Date.now() : 0;\n\n // Pre compile the pdf page and fetch the fonts/images.\n page\n .getOperatorList({\n handler,\n sink,\n task,\n intent: data.intent,\n cacheKey: data.cacheKey,\n annotationStorage: data.annotationStorage,\n })\n .then(\n function (operatorListInfo) {\n finishWorkerTask(task);\n\n if (start) {\n info(\n `page=${pageIndex + 1} - getOperatorList: time=` +\n `${Date.now() - start}ms, len=${operatorListInfo.length}`\n );\n }\n sink.close();\n },\n function (reason) {\n finishWorkerTask(task);\n if (task.terminated) {\n return; // ignoring errors from the terminated thread\n }\n sink.error(reason);\n\n // TODO: Should `reason` be re-thrown here (currently that casues\n // \"Uncaught exception: ...\" messages in the console)?\n }\n );\n });\n });\n\n handler.on(\"GetTextContent\", function (data, sink) {\n const { pageIndex, includeMarkedContent, disableNormalization } = data;\n\n pdfManager.getPage(pageIndex).then(function (page) {\n const task = new WorkerTask(\"GetTextContent: page \" + pageIndex);\n startWorkerTask(task);\n\n // NOTE: Keep this condition in sync with the `info` helper function.\n const start = verbosity >= VerbosityLevel.INFOS ? Date.now() : 0;\n\n page\n .extractTextContent({\n handler,\n task,\n sink,\n includeMarkedContent,\n disableNormalization,\n })\n .then(\n function () {\n finishWorkerTask(task);\n\n if (start) {\n info(\n `page=${pageIndex + 1} - getTextContent: time=` +\n `${Date.now() - start}ms`\n );\n }\n sink.close();\n },\n function (reason) {\n finishWorkerTask(task);\n if (task.terminated) {\n return; // ignoring errors from the terminated thread\n }\n sink.error(reason);\n\n // TODO: Should `reason` be re-thrown here (currently that casues\n // \"Uncaught exception: ...\" messages in the console)?\n }\n );\n });\n });\n\n handler.on(\"GetStructTree\", function (data) {\n return pdfManager.getPage(data.pageIndex).then(function (page) {\n return pdfManager.ensure(page, \"getStructTree\");\n });\n });\n\n handler.on(\"FontFallback\", function (data) {\n return pdfManager.fontFallback(data.id, handler);\n });\n\n handler.on(\"Cleanup\", function (data) {\n return pdfManager.cleanup(/* manuallyTriggered = */ true);\n });\n\n handler.on(\"Terminate\", function (data) {\n terminated = true;\n\n const waitOn = [];\n if (pdfManager) {\n pdfManager.terminate(new AbortException(\"Worker was terminated.\"));\n\n const cleanupPromise = pdfManager.cleanup();\n waitOn.push(cleanupPromise);\n\n pdfManager = null;\n } else {\n clearGlobalCaches();\n }\n if (cancelXHRs) {\n cancelXHRs(new AbortException(\"Worker was terminated.\"));\n }\n\n for (const task of WorkerTasks) {\n waitOn.push(task.finished);\n task.terminate();\n }\n\n return Promise.all(waitOn).then(function () {\n // Notice that even if we destroying handler, resolved response promise\n // must be sent back.\n handler.destroy();\n handler = null;\n });\n });\n\n handler.on(\"Ready\", function (data) {\n setupDoc(docParams);\n docParams = null; // we don't need docParams anymore -- saving memory.\n });\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n handler.on(\"GetXFADatasets\", function (data) {\n return pdfManager.ensureDoc(\"xfaDatasets\");\n });\n handler.on(\"GetXRefPrevValue\", function (data) {\n return pdfManager\n .ensureXRef(\"trailer\")\n .then(trailer => trailer.get(\"Prev\"));\n });\n handler.on(\"GetAnnotArray\", function (data) {\n return pdfManager.getPage(data.pageIndex).then(function (page) {\n return page.annotations.map(a => a.toString());\n });\n });\n }\n\n return workerHandlerName;\n }\n\n static initializeFromPort(port) {\n const handler = new MessageHandler(\"worker\", \"main\", port);\n WorkerMessageHandler.setup(handler, port);\n handler.send(\"ready\", null);\n }\n}\n\nfunction isMessagePort(maybePort) {\n return (\n typeof maybePort.postMessage === \"function\" && \"onmessage\" in maybePort\n );\n}\n\n// Worker thread (and not Node.js)?\nif (\n typeof window === \"undefined\" &&\n !isNodeJS &&\n typeof self !== \"undefined\" &&\n isMessagePort(self)\n) {\n WorkerMessageHandler.initializeFromPort(self);\n}\n\nexport { WorkerMessageHandler, WorkerTask };\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 { WorkerMessageHandler } from \"./core/worker.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 { WorkerMessageHandler };\n"],"names":["isNodeJS","process","versions","nw","electron","type","IDENTITY_MATRIX","FONT_IDENTITY_MATRIX","MAX_IMAGE_SIZE_TO_CACHE","LINE_FACTOR","LINE_DESCENT_FACTOR","BASELINE_FACTOR","RenderingIntentFlag","ANY","DISPLAY","PRINT","SAVE","ANNOTATIONS_FORMS","ANNOTATIONS_STORAGE","ANNOTATIONS_DISABLE","OPLIST","AnnotationMode","DISABLE","ENABLE","ENABLE_FORMS","ENABLE_STORAGE","AnnotationEditorPrefix","AnnotationEditorType","NONE","FREETEXT","HIGHLIGHT","STAMP","INK","AnnotationEditorParamsType","RESIZE","CREATE","FREETEXT_SIZE","FREETEXT_COLOR","FREETEXT_OPACITY","INK_COLOR","INK_THICKNESS","INK_OPACITY","HIGHLIGHT_COLOR","HIGHLIGHT_DEFAULT_COLOR","PermissionFlag","MODIFY_CONTENTS","COPY","MODIFY_ANNOTATIONS","FILL_INTERACTIVE_FORMS","COPY_FOR_ACCESSIBILITY","ASSEMBLE","PRINT_HIGH_QUALITY","TextRenderingMode","FILL","STROKE","FILL_STROKE","INVISIBLE","FILL_ADD_TO_PATH","STROKE_ADD_TO_PATH","FILL_STROKE_ADD_TO_PATH","ADD_TO_PATH","FILL_STROKE_MASK","ADD_TO_PATH_FLAG","ImageKind","GRAYSCALE_1BPP","RGB_24BPP","RGBA_32BPP","AnnotationType","TEXT","LINK","LINE","SQUARE","CIRCLE","POLYGON","POLYLINE","UNDERLINE","SQUIGGLY","STRIKEOUT","CARET","POPUP","FILEATTACHMENT","SOUND","MOVIE","WIDGET","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","AnnotationBorderStyleType","SOLID","DASHED","BEVELED","INSET","AnnotationActionEventType","E","X","D","U","Fo","Bl","PO","PC","PV","PI","K","F","V","C","DocumentActionEventType","WC","WS","DS","WP","DP","PageActionEventType","O","VerbosityLevel","ERRORS","WARNINGS","INFOS","CMapCompressionType","BINARY","OPS","dependency","setLineWidth","setLineCap","setLineJoin","setMiterLimit","setDash","setRenderingIntent","setFlatness","setGState","save","restore","transform","moveTo","lineTo","curveTo","curveTo2","curveTo3","closePath","rectangle","stroke","closeStroke","fill","eoFill","fillStroke","eoFillStroke","closeFillStroke","closeEOFillStroke","endPath","clip","eoClip","beginText","endText","setCharSpacing","setWordSpacing","setHScale","setLeading","setFont","setTextRenderingMode","setTextRise","moveText","setLeadingMoveText","setTextMatrix","nextLine","showText","showSpacedText","nextLineShowText","nextLineSetSpacingShowText","setCharWidth","setCharWidthAndBounds","setStrokeColorSpace","setFillColorSpace","setStrokeColor","setStrokeColorN","setFillColor","setFillColorN","setStrokeGray","setFillGray","setStrokeRGBColor","setFillRGBColor","setStrokeCMYKColor","setFillCMYKColor","shadingFill","beginInlineImage","beginImageData","endInlineImage","paintXObject","markPoint","markPointProps","beginMarkedContent","beginMarkedContentProps","endMarkedContent","beginCompat","endCompat","paintFormXObjectBegin","paintFormXObjectEnd","beginGroup","endGroup","beginAnnotation","endAnnotation","paintImageMaskXObject","paintImageMaskXObjectGroup","paintImageXObject","paintInlineImageXObject","paintInlineImageXObjectGroup","paintImageXObjectRepeat","paintImageMaskXObjectRepeat","paintSolidColorImageMask","constructPath","PasswordResponses","NEED_PASSWORD","INCORRECT_PASSWORD","verbosity","setVerbosityLevel","level","Number","isInteger","getVerbosityLevel","info","msg","console","log","warn","unreachable","Error","assert","cond","_isValidProtocol","url","protocol","createValidAbsoluteUrl","baseUrl","options","addDefaultProtocol","startsWith","dots","match","length","tryConvertEncoding","stringToUTF8String","absoluteUrl","URL","shadow","obj","prop","value","nonSerializable","Object","defineProperty","enumerable","configurable","writable","BaseException","BaseExceptionClosure","message","name","constructor","prototype","PasswordException","code","UnknownErrorException","details","InvalidPDFException","MissingPDFException","UnexpectedResponseException","status","FormatError","AbortException","bytesToString","bytes","undefined","MAX_ARGUMENT_COUNT","String","fromCharCode","apply","strBuf","i","chunkEnd","Math","min","chunk","subarray","push","join","stringToBytes","str","Uint8Array","charCodeAt","string32","objectSize","keys","objectFromMap","map","create","key","isLittleEndian","buffer8","view32","Uint32Array","buffer","isEvalSupported","Function","FeatureTest","isOffscreenCanvasSupported","OffscreenCanvas","platform","navigator","isMac","includes","isCSSRoundSupported","globalThis","CSS","supports","hexNumbers","Array","n","toString","padStart","Util","makeHexColor","r","g","b","scaleMinMax","minMax","temp","m1","m2","applyTransform","p","m","xt","yt","applyInverseTransform","d","getAxialAlignedBoundingBox","p1","p2","slice","p3","p4","max","inverseTransform","singularValueDecompose2dScale","transpose","a","c","first","second","sqrt","sx","sy","normalizeRect","rect","intersect","rect1","rect2","xLow","xHigh","yLow","yHigh","bezierBoundingBox","x0","y0","x1","y1","x2","y2","x3","y3","tvalues","bounds","t","t1","t2","b2ac","sqrtb2ac","abs","j","mt","jlen","PDFStringTranslateTable","stringToPDFString","encoding","decoder","TextDecoder","fatal","decoded","decode","replaceAll","ex","ii","charCode","charAt","decodeURIComponent","escape","utf8StringToString","unescape","encodeURIComponent","isArrayBuffer","v","byteLength","isArrayEqual","arr1","arr2","getModificationDate","date","Date","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","PromiseCapability","settled","promise","Promise","resolve","reject","data","reason","NormalizeRegex","NormalizationMap","normalizeUnicode","Map","_","normalize","get","getUuid","crypto","randomUUID","buf","getRandomValues","floor","random","AnnotationPrefix","CIRCULAR_REF","Symbol","EOF","CmdCache","NameCache","RefCache","clearPrimitiveCaches","Name","Cmd","cmd","nonSerializableClosure","Dict","xref","_map","objId","suppressEncryption","__nonSerializable__","assignXref","newXref","size","key1","key2","key3","Ref","fetch","getAsync","fetchAsync","getArray","isArray","getRaw","getKeys","getRawValues","values","set","has","forEach","callback","empty","emptyDict","merge","dictArray","mergeSubDicts","mergedDict","properties","dict","entries","property","subDict","clear","clone","num","gen","fromString","ref","exec","parseInt","RefSet","parent","_set","Set","put","add","remove","delete","iterator","RefSetCache","putAlias","aliasRef","isName","isCmd","isDict","isRefsEqual","v1","v2","BaseStream","isEmpty","isDataLoaded","getByte","getBytes","peekByte","peekedByte","pos","peekBytes","getUint16","b0","b1","getInt32","b2","b3","getByteRange","begin","end","getString","skip","reset","moveStart","makeSubStream","start","getBaseStreams","PDF_VERSION_REGEXP","getLookupTableFactory","initializer","lookup","MissingDataException","ParserEOFException","XRefEntryException","XRefParseException","arrayBuffersToBytes","arr","dataLength","item","getInheritableProperty","stopWhenFound","visited","ROMAN_NUMBER_MAP","toRomanNumerals","number","lowerCase","romanBuf","romanStr","toLowerCase","log2","x","ceil","readInt8","offset","readUint16","readUint32","isWhiteSpace","ch","parseXFAPath","path","positionPattern","split","component","escapePDFName","char","substring","escapeString","_collectJS","entry","list","parents","element","js","collectActions","eventType","actions","additionalActionsDicts","additionalActions","action","actionDict","Action","XMLEntities","encodeToXmlString","codePointAt","entity","toUpperCase","validateFontName","fontFamily","mustWarn","re","RegExp","test","ident","validateCSSFont","cssFontInfo","DEFAULT_CSS_FONT_OBLIQUE","DEFAULT_CSS_FONT_WEIGHT","CSS_FONT_WEIGHT_VALUES","fontWeight","italicAngle","weight","angle","parseFloat","isNaN","recoverJsURL","URL_OPEN_METHODS","regex","jsUrl","newWindow","numberToString","roundedValue","round","toFixed","getNewAnnotationsMap","annotationStorage","newAnnotationsByPage","annotations","pageIndex","isAscii","stringToUTF16HexString","stringToUTF16String","bigEndian","getRotationMatrix","rotation","width","height","Stream","arrayBuffer","strEnd","StringStream","NullStream","ChunkedStream","chunkSize","manager","_loadedChunks","numChunks","progressiveDataLength","lastSuccessfulEnsureByteChunk","getMissingChunks","chunks","numChunksLoaded","onReceiveData","beginChunk","endChunk","curChunk","onReceiveProgressiveData","position","ensureByte","ensureRange","nextEmptyChunk","hasChunk","ChunkedStreamSubstream","missingChunks","subStream","ChunkedStreamManager","pdfNetworkStream","args","rangeChunkSize","stream","disableAutoFetch","msgHandler","currRequestId","_chunksNeededByRequest","_requestsByChunk","_promisesByRequest","aborted","_loadedStreamCapability","sendRequest","rangeReader","getRangeReader","isStreamingSupported","onProgress","bind","loaded","readChunk","done","chunkData","read","then","e","requestAllChunks","noFetch","_requestChunks","requestId","chunksNeeded","capability","chunksToRequest","requestIds","groupedChunksToRequest","groupChunks","groupedChunk","catch","getStream","requestRange","getBeginChunk","getEndChunk","requestRanges","ranges","range","sort","groupedChunks","prevChunk","send","total","isProgressive","loadedRequests","lastChunk","onError","err","abort","cancelAllRequests","resizeRgbImage","src","dest","w1","h1","w2","h2","alpha01","COMPONENTS","xRatio","yRatio","newIndex","oldIndex","xScaled","Uint16Array","w1Scanline","py","ColorSpace","numComps","getRgb","srcOffset","rgb","Uint8ClampedArray","getRgbItem","destOffset","getRgbBuffer","count","bits","getOutputLength","inputLength","isPassthrough","isDefaultDecode","decodeMap","bpc","fillRgb","originalWidth","originalHeight","actualHeight","comps","rgbBuf","numComponentColors","needsResizing","allColors","colorMap","destPos","rgbPos","usesZeroToOneRange","_cache","cacheKey","localColorSpaceCache","parsedColorSpace","csName","csRef","getCached","localColorSpace","getByRef","getByName","parseAsync","cs","resources","pdfFunctionFactory","_parse","parse","cachedColorSpace","fetchIfRef","singletons","gray","cmyk","PatternCS","colorSpaces","resourcesCS","mode","params","baseCS","whitePoint","blackPoint","gamma","CalGrayCS","matrix","CalRGBCS","alt","altCS","hiVal","IndexedCS","tintFn","AlternateCS","LabCS","DeviceGrayCS","DeviceRgbCS","DeviceCmykCS","base","tmpBuf","Float32Array","scale","baseNumComps","baseBuf","scaled","tinted","highVal","outputDelta","lookupPos","q","toRgb","srcScale","y","k","XW","YW","ZW","XB","YB","ZB","G","A","AG","L","val","BRADFORD_SCALE_MATRIX","BRADFORD_SCALE_INVERSE_MATRIX","SRGB_D65_XYZ_TO_RGB_MATRIX","FLAT_WHITEPOINT_MATRIX","tempNormalizeMatrix","tempConvertMatrix1","tempConvertMatrix2","DECODE_L_CONSTANT","GR","GG","GB","MXA","MYA","MZA","MXB","MYB","MZB","MXC","MYC","MZC","matrixProduct","result","toFlat","sourceWhitePoint","LMS","toD65","D65X","D65Y","D65Z","sRGBTransferFunction","color","adjustToRange","decodeL","compensateBlackPoint","sourceBlackPoint","XYZ_Flat","zeroDecodeL","X_DST","X_SRC","Y_DST","Y_SRC","Z_DST","Z_SRC","X_Scale","X_Offset","Y_Scale","Y_Offset","Z_Scale","Z_Offset","normalizeWhitePointToFlat","XYZ_In","LMS_Flat","normalizeWhitePointToD65","LMS_D65","B","AGR","BGG","CGB","Y","Z","XYZ","XYZ_Black","XYZ_D65","SRGB","amin","amax","bmin","bmax","fn_g","high1","low2","high2","maxVal","Ls","as","bs","M","N","hexToInt","hexToStr","addHex","incHex","MAX_NUM_SIZE","MAX_ENCODED_NUM_SIZE","BinaryCMapStream","readByte","readNumber","last","readSigned","readHex","readHexNumber","stack","sp","bufferSize","readHexSigned","sign","readString","len","BinaryCMapReader","cMap","extend","header","vertical","useCMap","tmp","sequence","dataSize","ucs2DataSize","subitemsCount","addCodespaceRange","mapOne","mapCidRange","mapBfRange","emptyBuffer","DecodeStream","maybeMinBufferLength","_rawMinBufferLength","bufferLength","eof","minBufferLength","readBlock","ensureBuffer","requested","buffer2","bufEnd","StreamsSequenceStream","streams","maybeLength","_onError","shift","newLength","baseStreamsBuf","baseStreams","Ascii85Stream","input","TILDA_CHAR","Z_LOWER_CHAR","AsciiHexStream","firstDigit","UPSTREAM_BLOCK_SIZE","maxDecodeLength","digit","ccittEOL","ccittEOF","twoDimPass","twoDimHoriz","twoDimVert0","twoDimVertR1","twoDimVertL1","twoDimVertR2","twoDimVertL2","twoDimVertR3","twoDimVertL3","twoDimTable","whiteTable1","whiteTable2","blackTable1","blackTable2","blackTable3","CCITTFaxDecoder","source","next","eoline","EndOfLine","byteAlign","EncodedByteAlign","columns","Columns","rows","Rows","eoblock","EndOfBlock","black","BlackIs1","codingLine","refLine","codingPos","row","nextLine2D","inputBits","inputBuf","outputBits","rowsDone","code1","_lookBits","_eatBits","readNextChar","refPos","blackPixels","code2","code3","_getTwoDimCode","_addPixels","_getBlackCode","_getWhiteCode","_addPixelsNeg","gotEOL","a1","_findTableCode","table","limit","limitValue","CCITTFaxStream","ccittFaxDecoder","codeLenCodeMap","Int32Array","lengthDecode","distDecode","fixedLitCodeTab","fixedDistCodeTab","FlateStream","cmf","flg","codeSize","codeBuf","getBits","getCode","codes","maxLen","codeLen","codeVal","generateHuffmanTable","lengths","endsStreamOnError","hdr","blockLen","check","block","litCodeTable","distCodeTable","numLitCodes","numDistCodes","numCodeLenCodes","codeLenCodeLengths","codeLenCodeTab","codeLengths","bitsLength","bitsOffset","what","repeatLength","dist","QeTable","qe","nmps","nlps","switchFlag","ArithmeticDecoder","bp","dataEnd","chigh","clow","byteIn","ct","readBit","contexts","cx_index","cx_mps","qeTableIcx","qeIcx","Jbig2Error","ContextCache","getContexts","id","Int8Array","DecodingContext","contextCache","cache","MAX_INT_32","MIN_INT_32","decodeInteger","procedure","prev","readBits","bit","signedValue","decodeIAID","codeLength","SegmentTypes","CodingTemplates","RefinementTemplates","coding","reference","ReusedContexts","RefinementReusedContexts","decodeBitmapTemplate0","decodingContext","bitmap","contextLabel","pixel","row1","row2","OLD_PIXEL_MASK","decodeBitmap","mmr","templateIndex","prediction","at","Reader","decodeMMRBitmap","useskip","template","concat","templateLength","templateX","templateY","changingTemplateEntries","reuseMask","minX","maxX","minY","changingEntriesLength","changingTemplateX","changingTemplateY","changingTemplateBit","sbb_left","sbb_top","sbb_right","pseudoPixelContext","ltp","i0","j0","sltp","decodeRefinement","referenceBitmap","offsetX","offsetY","codingTemplate","codingTemplateLength","codingTemplateX","codingTemplateY","referenceTemplate","referenceTemplateLength","referenceTemplateX","referenceTemplateY","referenceWidth","referenceHeight","decodeSymbolDictionary","huffman","refinement","symbols","numberOfNewSymbols","numberOfExportedSymbols","huffmanTables","refinementTemplateIndex","refinementAt","huffmanInput","newSymbols","currentHeight","symbolCodeLength","tableB1","symbolWidths","getStandardTable","deltaHeight","tableDeltaHeight","currentWidth","totalWidth","firstSymbol","deltaWidth","tableDeltaWidth","numberOfInstances","decodeTextRegion","symbolId","rdx","rdy","symbol","bitmapSize","tableBitmapSize","collectiveBitmap","readUncompressedBitmap","originalEnd","bitmapEnd","numberOfSymbolsDecoded","xMin","xMax","bitmapWidth","symbolBitmap","exportedSymbols","flags","currentFlag","totalSymbolsLength","runLength","defaultPixelValue","numberOfSymbolInstances","stripSize","inputSymbols","transposed","dsOffset","referenceCorner","combinationOperator","logStripSize","stripT","tableDeltaT","firstS","deltaT","deltaFirstS","tableFirstS","currentS","currentT","symbolIDTable","applyRefinement","symbolWidth","symbolHeight","rdw","rdh","offsetT","offsetS","s2","symbolRow","maxWidth","deltaS","tableDeltaS","decodePatternDictionary","patternWidth","patternHeight","maxPatternIndex","collectiveWidth","patterns","patternBitmap","decodeHalftoneRegion","regionWidth","regionHeight","enableSkip","gridWidth","gridHeight","gridOffsetX","gridOffsetY","gridVectorX","gridVectorY","regionBitmap","numberOfPatterns","pattern0","bitsPerValue","grayScaleBitPlanes","mmrInput","mg","ng","patternIndex","patternRow","regionRow","regionX","regionY","readSegmentHeader","segmentHeader","segmentType","typeName","deferredNonRetain","pageAssociationFieldSize","referredFlags","referredToCount","retainBits","referredToSegmentNumberSize","referredTo","pageAssociation","genericRegionInfo","readRegionSegmentInformation","genericRegionSegmentFlags","RegionSegmentInformationFieldLength","genericRegionMmr","searchPatternLength","searchPattern","headerEnd","readSegments","segments","segment","randomAccess","processSegment","visitor","atLength","dictionary","dictionaryFlags","huffmanDHSelector","huffmanDWSelector","bitmapSizeSelector","aggregationInstancesSelector","bitmapCodingContextUsed","bitmapCodingContextRetained","refinementTemplate","textRegion","textRegionSegmentFlags","textRegionHuffmanFlags","huffmanFS","huffmanDS","huffmanDT","huffmanRefinementDW","huffmanRefinementDH","huffmanRefinementDX","huffmanRefinementDY","huffmanRefinementSizeSelector","patternDictionary","patternDictionaryFlags","halftoneRegion","halftoneRegionFlags","genericRegion","pageInfo","resolutionX","resolutionY","pageSegmentFlags","lossless","requiresBuffer","combinationOperatorOverride","callbackName","processSegments","parseJbig2Chunks","SimpleSegmentVisitor","parseJbig2","onPageInformation","currentPageInfo","rowSize","drawBitmap","regionInfo","mask0","offset0","mask","onImmediateGenericRegion","region","onImmediateLosslessGenericRegion","arguments","onSymbolDictionary","currentSegment","referredSegments","getSymbolDictionaryHuffmanTables","customTables","referredSegment","referredSymbols","onImmediateTextRegion","getTextRegionHuffmanTables","onImmediateLosslessTextRegion","onPatternDictionary","onImmediateHalftoneRegion","onImmediateLosslessHalftoneRegion","onTables","decodeTablesSegment","HuffmanLine","lineData","isOOB","rangeLow","prefixLength","rangeLength","prefixCode","isLowerRange","HuffmanTreeNode","line","children","isLeaf","buildTree","node","decodeNode","reader","htOffset","HuffmanTable","lines","prefixCodesDone","assignPrefixCodes","rootNode","linesLength","prefixLengthMax","histogram","currentLength","firstCode","currentCode","currentTemp","lowestValue","highestValue","prefixSizeBits","rangeSizeBits","currentRangeLow","standardTablesCache","currentByte","numBits","getCustomHuffmanTable","index","currentIndex","numberOfSymbols","runCodesTable","repeatedLength","numberOfRepeats","customIndex","tableAggregateInstances","endOfBlock","lookForEOFLimit","Jbig2Image","parseChunks","Jbig2Stream","jbig2Image","globalsStream","globals","convertToRGBA","kind","convertBlackAndWhiteToRGBA","convertRGBToRGBA","srcPos","nonBlackColor","inverseDecode","zeroMapping","oneMapping","widthInSource","widthRemainder","srcLength","elem","len32","src32","s1","s3","jj","grayToRGBA","JpegError","DNLMarkerError","scanLines","EOIMarkerError","dctZigZag","dctCos1","dctSin1","dctCos3","dctSin3","dctCos6","dctSin6","dctSqrt2","dctSqrt1d2","buildHuffmanTable","pop","getBlockBufferOffset","col","blocksPerLine","decodeScan","frame","components","resetInterval","spectralStart","spectralEnd","successivePrev","successive","parseDNLMarker","mcusPerLine","progressive","startOffset","bitsData","bitsCount","nextByte","maybeScanLines","blockRow","precision","decodeHuffman","tree","receive","receiveAndExtend","decodeBaseline","blockOffset","huffmanTableDC","diff","blockData","pred","rs","huffmanTableAC","s","z","decodeDCFirst","decodeDCSuccessive","eobrun","decodeACFirst","successiveACState","successiveACNextValue","decodeACSuccessive","offsetZ","decodeMcu","mcu","mcuRow","mcuCol","blockCol","h","decodeBlock","componentsLength","decodeFn","fileMarker","mcuExpected","blocksPerColumn","mcusPerColumn","mcuToRead","findNextFileMarker","invalid","partialMsg","marker","quantizeAndInverse","blockBufferOffset","qt","quantizationTable","v0","v3","v4","v5","v6","v7","p0","p5","p6","p7","buildComponentData","computationBuffer","Int16Array","currentPos","startPos","maxPos","newPos","currentMarker","newMarker","JpegImage","decodeTransform","colorTransform","_decodeTransform","_colorTransform","dnlScanLines","readDataBlock","endOffset","array","prepareComponents","samplesPerLine","maxH","maxV","blocksPerLineForMcu","blocksPerColumnForMcu","blocksBufferSize","jfif","adobe","numSOSMarkers","quantizationTables","huffmanTablesAC","huffmanTablesDC","markerLoop","l","appData","version","major","minor","densityUnits","xDensity","yDensity","thumbWidth","thumbHeight","thumbData","flags0","flags1","transformCode","quantizationTablesLength","quantizationTablesEnd","quantizationTableSpec","tableData","extended","sofScanLines","componentIds","componentsCount","componentId","qId","quantizationId","huffmanLength","huffmanTableSpec","codeLengthSum","huffmanValues","selectorsCount","componentIndex","tableSpec","successiveApproximation","processed","nextFileMarker","output","scaleX","scaleY","numComponents","_getLinearizedBlockData","isSourcePDF","componentScaleX","componentScaleY","blocksPerScanline","xScaleBlockOffset","mask3LSB","lastComponentScaleX","_isColorConversionNeeded","_convertYccToRgb","Cb","Cr","_convertYccToRgba","out","_convertYcckToRgb","_convertYcckToRgba","_convertYcckToCmyk","_convertCmykToRgb","_convertCmykToRgba","getData","forceRGBA","forceRGB","rgbaData","grayColor","JpegStream","jpegOptions","decodeArr","bitsPerComponent","decodeArrLength","transformNeeded","maxValue","jpegImage","drawWidth","drawHeight","JpxError","SubbandsGainLog2","LL","LH","HL","HH","JpxImage","failOnCorruptedImage","head","parseCodestream","headerSize","lbox","tbox","jumpDataLength","method","colorspace","headerType","parseImageProperties","newByte","oldByte","Xsiz","Ysiz","XOsiz","YOsiz","Csiz","context","doNotRecover","sqcd","spqcds","spqcdSize","scalarExpounded","tile","mainHeader","siz","XTsiz","YTsiz","XTOsiz","YTOsiz","isSigned","XRsiz","YRsiz","calculateComponentDimensions","SIZ","calculateTileGrids","QCC","COC","qcd","noQuantization","guardBits","spqcd","epsilon","mu","SPqcds","QCD","currentTile","qcc","cqcc","cod","scod","entropyCoderWithCustomPrecincts","sopMarkerUsed","ephMarkerUsed","progressionOrder","layersCount","multipleComponentTransform","decompositionLevelsCount","xcb","ycb","blockStyle","selectiveArithmeticCodingBypass","resetContextProbabilities","terminationOnEachCodingPass","verticallyStripe","predictableTermination","segmentationSymbolUsed","reversibleTransformation","precinctsSizes","precinctsSize","PPx","PPy","unsupported","COD","partIndex","partsCount","initializeTile","buildPackets","parseTilePackets","tiles","transformComponents","numXtiles","numYtiles","tx0","ty0","tx1","ty1","tileComponent","tcx0","tcy0","tcx1","tcy1","getBlocksDimensions","codOrCoc","codingStyleParameters","xcb_","ycb_","buildPrecincts","resolution","dimensions","precinctWidth","precinctHeight","isZeroRes","resLevel","precinctWidthInSubband","precinctHeightInSubband","numprecinctswide","trx1","trx0","numprecinctshigh","try1","try0","numprecincts","precinctParameters","buildCodeblocks","subband","codeblockWidth","codeblockHeight","cbx0","tbx0","cby0","tby0","cbx1","tbx1","cby1","tby1","codeblocks","precincts","codeblock","precinctNumber","cbx","cby","tbx0_","tby0_","tbx1_","tby1_","pi","pj","subbandType","Lblock","precinct","cbxMin","cbxMax","cbyMin","cbyMax","codeblockParameters","numcodeblockwide","numcodeblockhigh","createPacket","layerNumber","precinctCodeblocks","subbands","LayerResolutionComponentPositionIterator","tileIndex","codingStyleDefaultParameters","maxDecompositionLevelsCount","nextPacket","JpxImage_nextPacket","resolutions","packet","ResolutionLayerComponentPositionIterator","ResolutionPositionComponentLayerIterator","maxNumPrecinctsInLevel","maxNumPrecincts","PositionComponentResolutionLayerIterator","getPrecinctSizesInImageScale","precinctsIterationSizes","px","maxNumHigh","maxNumWide","sizeInImageScale","getPrecinctIndexIfExist","ComponentPositionResolutionLayerIterator","pxIndex","pyIndex","precinctIterationSizes","posX","minWidth","posY","minHeight","startPrecinctRowIndex","MAX_VALUE","sizePerComponent","sizePerResolution","minWidthCurrentComponent","minHeightCurrentComponent","maxNumWideCurrentComponent","maxNumHighCurrentComponent","widthCurrentResolution","heightCurrentResolution","blocksDimensions","bscale","resolutionSubbands","packetsIterator","skipNextBit","skipMarkerIfEqual","skipBytes","alignToByte","readCodingpasses","queue","codeblockColumn","codeblockRow","codeblockIncluded","firstTimeInclusion","valueReady","zeroBitPlanesTree","included","inclusionTree","InclusionTree","TagTree","nextLevel","incrementValue","zeroBitPlanes","codingpasses","codingpassesLog2","codedDataLength","packetItem","copyCoefficients","coefficients","levelWidth","levelHeight","delta","mb","reversible","right","bottom","blockWidth","blockHeight","bitModel","BitModel","currentCodingpassType","totalLength","dataItem","encodedData","setDecoder","runSignificancePropagationPass","runMagnitudeRefinementPass","runCleanupPass","checkSegmentationSymbol","coefficentsSign","magnitude","coefficentsMagnitude","bitsDecoded","magnitudeCorrection","nb","interleave","levelOffset","transformTile","quantizationParameters","ReversibleTransform","IrreversibleTransform","subbandCoefficients","gainLog2","items","calculate","left","top","resultImages","transformedTiles","tile0","fourComponents","y0items","y1items","y2items","y3items","component0","qcdOrQcc","levelsLength","levels","currentLevel","defaultValue","stopValue","propagateValues","levelIndex","currentValue","UNIFORM_CONTEXT","RUNLENGTH_CONTEXT","LLAndLHContextsLabel","HLContextLabel","HHContextLabel","contextLabelTable","coefficientCount","neighborsSignificance","processingFlags","setNeighborsSignificance","column","labels","processedInverseMask","processedMask","firstMagnitudeBitMask","i1","decision","decodeSignBit","contribution","sign0","sign1","significance1","horizontalContribution","width4","index0","indexNext","significance","oneRowDown","twoRowsDown","threeRowsDown","iNext","indexBase","checkAllEmpty","allEmpty","hasSignificantCoefficent","i2","Transform","u0","ll","iterate","j1","j2","filter","hl_lh_hh","llWidth","llHeight","llItems","u","bufferPadding","rowBuffer","numBuffers","colBuffers","currentBuffer","current","alpha","beta","K_","JpxStream","jpxImage","tileCount","tileComponents","tileWidth","tileHeight","tileLeft","tileTop","srcPosition","dataPosition","imgRowSize","tileRowSize","rowBytes","LZWStream","earlyChange","cachedData","bitsCached","maxLzwDictionarySize","lzwState","nextCode","dictionaryValues","dictionaryLengths","dictionaryPrevCodes","currentSequence","currentSequenceLength","lastCode","blockSize","decodedSizeDelta","estimatedDecodedSize","prevCode","decodedLength","currentBufferLength","hasPrev","PredictorStream","predictor","readBlockTiff","readBlockPng","colors","pixBytes","rawBytes","inbuf","outbuf","inbits","outbits","bytesPerPixel","sum","compArray","bitMask","kk","prevRow","up","upLeft","pa","pb","pc","RunLengthStream","repeatHeader","MAX_LENGTH_TO_CACHE","getInlineImageCacheKey","Parser","lexer","allowStreams","recoveryMode","imageCache","_imageId","refill","buf1","getObj","buf2","tryShift","cipherTransform","makeInlineImage","makeStream","decryptString","findDefaultInlineStreamEnd","I","SPACE","LF","CR","NUL","knownCommands","state","maybeEIPos","followingBytes","tmpLexer","Lexer","_hexStringWarn","numArgs","nextObj","knownCommand","variableArgs","findDCTDecodeInlineStreamEnd","foundEOI","markerLength","inlineStreamSkipEI","findASCII85DecodeInlineStreamEnd","TILDE","GT","tildePos","maybeEI","findASCIIHexDecodeInlineStreamEnd","dictMap","dictLength","beginInlineImagePos","Filter","filterName","filterZero","initialStreamPos","cacheEntry","imageStream","createStream","_findStreamLength","signature","SCAN_BLOCK_LENGTH","signatureLength","scanBytes","scanLength","skipToNextLine","nextChar","ENDSTREAM_SIGNATURE","actualLength","MAX_TRUNCATION","TRUNCATED_SIGNATURE","lastByte","makeFilter","filterArray","paramsArray","specialChars","toHexDigit","_hexStringNumWarn","currentChar","peekChar","getNumber","eNotation","divideBy","baseValue","powerValue","powerValueSign","currentDigit","numParen","charBuffered","getName","previousCh","MAX_HEX_STRING_NUM_WARN","getHexString","isFirstHex","secondDigit","comment","nextCh","knownCommandFound","possibleCommand","Linearization","getInt","linDict","allowZeroValue","getHints","hints","hintsLength","hint","parser","obj1","obj2","obj3","objectNumberFirst","endFirst","numPages","mainXRefEntriesOffset","pageFirst","BUILT_IN_CMAPS","MAX_MAP_RANGE","CMap","builtInCMap","codespaceRanges","numCodespaceRanges","low","high","dstLow","nextCharCode","mapBfRangeToArray","dst","contains","charCodeOf","indexOf","getMap","readCharCode","nn","codespaceRange","charcode","getCharCodeLength","isIdentityCMap","IdentityCMap","strToInt","expectString","expectInt","parseBfChar","parseBfRange","parseCidChar","parseCidRange","parseCodespaceRange","parseWMode","parseCMapName","parseCMap","fetchBuiltInCMap","previous","embeddedUseCMap","objLoop","extendCMap","createBuiltInCMap","useCodespaceRanges","cMapData","compressionType","CMapFactory","parsedCMap","ISOAdobeCharset","ExpertCharset","ExpertSubsetCharset","ExpertEncoding","MacExpertEncoding","MacRomanEncoding","StandardEncoding","WinAnsiEncoding","SymbolSetEncoding","ZapfDingbatsEncoding","getEncoding","encodingName","MAX_SUBR_NESTING","CFFStandardStrings","NUM_STANDARD_CFF_STRINGS","CharstringValidationData","stackClearing","stem","resetStack","undefStack","CharstringValidationData12","stackDelta","stackFn","CFFParser","file","seacAnalysisEnabled","cff","CFF","parseHeader","nameIndex","parseIndex","endPos","topDictIndex","stringIndex","globalSubrIndex","topDictParsed","parseDict","topDict","createDict","CFFTopDict","strings","names","parseNameIndex","parseStringIndex","parsePrivateDict","isCIDFont","hasName","charStringOffset","charStringIndex","fontMatrix","fontBBox","ascent","descent","ascentScaled","charset","fdArrayIndex","dictRaw","fontDict","fdArray","parseCharsets","fdSelect","parseFDSelect","parseEncoding","charStringsAndSeacs","parseCharStrings","charStrings","localSubrIndex","privateDict","subrsIndex","seacs","widths","bytesLength","hdrSize","offSize","CFFHeader","parseOperand","parseFloatOperand","NaN","operands","cffIndex","CFFIndex","offsets","offsetSize","offsetStart","offsetEnd","CFFStrings","Type","cffDict","setByKey","parseCharString","callDepth","stackSize","validationCommand","seac","copyWithin","bias","subrNumber","valid","hasVStems","firstStackClearing","charstring","localSubrToUse","privateDictToUse","fdIndex","getFDIndex","nominalWidth","defaultWidth","emptyPrivateDictionary","parentDict","CFFPrivateDict","privateOffset","removeByName","privateDictEnd","dictData","setByName","subrsOffset","relativeOffset","cid","CFFCharset","CFFCharsetPredefinedTypes","ISO_ADOBE","EXPERT","EXPERT_SUBSET","format","raw","predefined","readSupplement","supplementsCount","sid","baseEncoding","dataStart","glyphsCount","rangesCount","gid","CFFEncoding","CFFFDSelect","duplicateFirstGlyph","glyphZero","hasGlyphId","glyph","getSID","objects","CFFDict","tables","keyToNameMap","nameToKeyMap","defaults","types","opcodes","order","createTables","layout","CFFTopDictLayout","CFFPrivateDictLayout","glyphIndex","CFFOffsetTracker","isTracking","track","location","setEntryLocation","dataOffset","offset1","offset2","offset3","offset4","CFFCompiler","compile","compileHeader","compileNameIndex","xuid","compiled","compileTopDicts","topDictTracker","trackers","compileStringIndex","compileIndex","compileEncoding","compileCharset","compileCharStrings","compileFDSelect","fontDictTrackers","compilePrivateDicts","encodeNumber","encodeInteger","encodeFloat","EncodeFloatRegExp","nibbles","sanitizedName","dicts","removeCidKeys","fontDictTracker","fontDictData","compileDict","privateDictTracker","privateDictData","outputLength","subrs","offsetTracker","string","charStringsIndex","numGlyphs","numGlyphsLessNotDef","charsetIndex","numCharsets","warned","compileTypedArray","lastFD","currentFD","numRanges","from","lastOffset","getGlyphsUnicode","AE","AEacute","AEmacron","AEsmall","Aacute","Aacutesmall","Abreve","Abreveacute","Abrevecyrillic","Abrevedotbelow","Abrevegrave","Abrevehookabove","Abrevetilde","Acaron","Acircle","Acircumflex","Acircumflexacute","Acircumflexdotbelow","Acircumflexgrave","Acircumflexhookabove","Acircumflexsmall","Acircumflextilde","Acute","Acutesmall","Acyrillic","Adblgrave","Adieresis","Adieresiscyrillic","Adieresismacron","Adieresissmall","Adotbelow","Adotmacron","Agrave","Agravesmall","Ahookabove","Aiecyrillic","Ainvertedbreve","Alpha","Alphatonos","Amacron","Amonospace","Aogonek","Aring","Aringacute","Aringbelow","Aringsmall","Asmall","Atilde","Atildesmall","Aybarmenian","Bcircle","Bdotaccent","Bdotbelow","Becyrillic","Benarmenian","Beta","Bhook","Blinebelow","Bmonospace","Brevesmall","Bsmall","Btopbar","Caarmenian","Cacute","Caron","Caronsmall","Ccaron","Ccedilla","Ccedillaacute","Ccedillasmall","Ccircle","Ccircumflex","Cdot","Cdotaccent","Cedillasmall","Chaarmenian","Cheabkhasiancyrillic","Checyrillic","Chedescenderabkhasiancyrillic","Chedescendercyrillic","Chedieresiscyrillic","Cheharmenian","Chekhakassiancyrillic","Cheverticalstrokecyrillic","Chi","Chook","Circumflexsmall","Cmonospace","Coarmenian","Csmall","DZ","DZcaron","Daarmenian","Dafrican","Dcaron","Dcedilla","Dcircle","Dcircumflexbelow","Dcroat","Ddotaccent","Ddotbelow","Decyrillic","Deicoptic","Delta","Deltagreek","Dhook","Dieresis","DieresisAcute","DieresisGrave","Dieresissmall","Digammagreek","Djecyrillic","Dlinebelow","Dmonospace","Dotaccentsmall","Dslash","Dsmall","Dtopbar","Dz","Dzcaron","Dzeabkhasiancyrillic","Dzecyrillic","Dzhecyrillic","Eacute","Eacutesmall","Ebreve","Ecaron","Ecedillabreve","Echarmenian","Ecircle","Ecircumflex","Ecircumflexacute","Ecircumflexbelow","Ecircumflexdotbelow","Ecircumflexgrave","Ecircumflexhookabove","Ecircumflexsmall","Ecircumflextilde","Ecyrillic","Edblgrave","Edieresis","Edieresissmall","Edot","Edotaccent","Edotbelow","Efcyrillic","Egrave","Egravesmall","Eharmenian","Ehookabove","Eightroman","Einvertedbreve","Eiotifiedcyrillic","Elcyrillic","Elevenroman","Emacron","Emacronacute","Emacrongrave","Emcyrillic","Emonospace","Encyrillic","Endescendercyrillic","Eng","Enghecyrillic","Enhookcyrillic","Eogonek","Eopen","Epsilon","Epsilontonos","Ercyrillic","Ereversed","Ereversedcyrillic","Escyrillic","Esdescendercyrillic","Esh","Esmall","Eta","Etarmenian","Etatonos","Eth","Ethsmall","Etilde","Etildebelow","Euro","Ezh","Ezhcaron","Ezhreversed","Fcircle","Fdotaccent","Feharmenian","Feicoptic","Fhook","Fitacyrillic","Fiveroman","Fmonospace","Fourroman","Fsmall","GBsquare","Gacute","Gamma","Gammaafrican","Gangiacoptic","Gbreve","Gcaron","Gcedilla","Gcircle","Gcircumflex","Gcommaaccent","Gdot","Gdotaccent","Gecyrillic","Ghadarmenian","Ghemiddlehookcyrillic","Ghestrokecyrillic","Gheupturncyrillic","Ghook","Gimarmenian","Gjecyrillic","Gmacron","Gmonospace","Grave","Gravesmall","Gsmall","Gsmallhook","Gstroke","H","H18533","H18543","H18551","H22073","HPsquare","Haabkhasiancyrillic","Hadescendercyrillic","Hardsigncyrillic","Hbar","Hbrevebelow","Hcedilla","Hcircle","Hcircumflex","Hdieresis","Hdotaccent","Hdotbelow","Hmonospace","Hoarmenian","Horicoptic","Hsmall","Hungarumlaut","Hungarumlautsmall","Hzsquare","IAcyrillic","IJ","IUcyrillic","Iacute","Iacutesmall","Ibreve","Icaron","Icircle","Icircumflex","Icircumflexsmall","Icyrillic","Idblgrave","Idieresis","Idieresisacute","Idieresiscyrillic","Idieresissmall","Idot","Idotaccent","Idotbelow","Iebrevecyrillic","Iecyrillic","Ifraktur","Igrave","Igravesmall","Ihookabove","Iicyrillic","Iinvertedbreve","Iishortcyrillic","Imacron","Imacroncyrillic","Imonospace","Iniarmenian","Iocyrillic","Iogonek","Iota","Iotaafrican","Iotadieresis","Iotatonos","Ismall","Istroke","Itilde","Itildebelow","Izhitsacyrillic","Izhitsadblgravecyrillic","J","Jaarmenian","Jcircle","Jcircumflex","Jecyrillic","Jheharmenian","Jmonospace","Jsmall","KBsquare","KKsquare","Kabashkircyrillic","Kacute","Kacyrillic","Kadescendercyrillic","Kahookcyrillic","Kappa","Kastrokecyrillic","Kaverticalstrokecyrillic","Kcaron","Kcedilla","Kcircle","Kcommaaccent","Kdotbelow","Keharmenian","Kenarmenian","Khacyrillic","Kheicoptic","Khook","Kjecyrillic","Klinebelow","Kmonospace","Koppacyrillic","Koppagreek","Ksicyrillic","Ksmall","LJ","Lacute","Lambda","Lcaron","Lcedilla","Lcircle","Lcircumflexbelow","Lcommaaccent","Ldot","Ldotaccent","Ldotbelow","Ldotbelowmacron","Liwnarmenian","Lj","Ljecyrillic","Llinebelow","Lmonospace","Lslash","Lslashsmall","Lsmall","MBsquare","Macron","Macronsmall","Macute","Mcircle","Mdotaccent","Mdotbelow","Menarmenian","Mmonospace","Msmall","Mturned","Mu","NJ","Nacute","Ncaron","Ncedilla","Ncircle","Ncircumflexbelow","Ncommaaccent","Ndotaccent","Ndotbelow","Nhookleft","Nineroman","Nj","Njecyrillic","Nlinebelow","Nmonospace","Nowarmenian","Nsmall","Ntilde","Ntildesmall","Nu","OE","OEsmall","Oacute","Oacutesmall","Obarredcyrillic","Obarreddieresiscyrillic","Obreve","Ocaron","Ocenteredtilde","Ocircle","Ocircumflex","Ocircumflexacute","Ocircumflexdotbelow","Ocircumflexgrave","Ocircumflexhookabove","Ocircumflexsmall","Ocircumflextilde","Ocyrillic","Odblacute","Odblgrave","Odieresis","Odieresiscyrillic","Odieresissmall","Odotbelow","Ogoneksmall","Ograve","Ogravesmall","Oharmenian","Ohm","Ohookabove","Ohorn","Ohornacute","Ohorndotbelow","Ohorngrave","Ohornhookabove","Ohorntilde","Ohungarumlaut","Oi","Oinvertedbreve","Omacron","Omacronacute","Omacrongrave","Omega","Omegacyrillic","Omegagreek","Omegaroundcyrillic","Omegatitlocyrillic","Omegatonos","Omicron","Omicrontonos","Omonospace","Oneroman","Oogonek","Oogonekmacron","Oopen","Oslash","Oslashacute","Oslashsmall","Osmall","Ostrokeacute","Otcyrillic","Otilde","Otildeacute","Otildedieresis","Otildesmall","P","Pacute","Pcircle","Pdotaccent","Pecyrillic","Peharmenian","Pemiddlehookcyrillic","Phi","Phook","Pi","Piwrarmenian","Pmonospace","Psi","Psicyrillic","Psmall","Q","Qcircle","Qmonospace","Qsmall","R","Raarmenian","Racute","Rcaron","Rcedilla","Rcircle","Rcommaaccent","Rdblgrave","Rdotaccent","Rdotbelow","Rdotbelowmacron","Reharmenian","Rfraktur","Rho","Ringsmall","Rinvertedbreve","Rlinebelow","Rmonospace","Rsmall","Rsmallinverted","Rsmallinvertedsuperior","S","SF010000","SF020000","SF030000","SF040000","SF050000","SF060000","SF070000","SF080000","SF090000","SF100000","SF110000","SF190000","SF200000","SF210000","SF220000","SF230000","SF240000","SF250000","SF260000","SF270000","SF280000","SF360000","SF370000","SF380000","SF390000","SF400000","SF410000","SF420000","SF430000","SF440000","SF450000","SF460000","SF470000","SF480000","SF490000","SF500000","SF510000","SF520000","SF530000","SF540000","Sacute","Sacutedotaccent","Sampigreek","Scaron","Scarondotaccent","Scaronsmall","Scedilla","Schwa","Schwacyrillic","Schwadieresiscyrillic","Scircle","Scircumflex","Scommaaccent","Sdotaccent","Sdotbelow","Sdotbelowdotaccent","Seharmenian","Sevenroman","Shaarmenian","Shacyrillic","Shchacyrillic","Sheicoptic","Shhacyrillic","Shimacoptic","Sigma","Sixroman","Smonospace","Softsigncyrillic","Ssmall","Stigmagreek","T","Tau","Tbar","Tcaron","Tcedilla","Tcircle","Tcircumflexbelow","Tcommaaccent","Tdotaccent","Tdotbelow","Tecyrillic","Tedescendercyrillic","Tenroman","Tetsecyrillic","Theta","Thook","Thorn","Thornsmall","Threeroman","Tildesmall","Tiwnarmenian","Tlinebelow","Tmonospace","Toarmenian","Tonefive","Tonesix","Tonetwo","Tretroflexhook","Tsecyrillic","Tshecyrillic","Tsmall","Twelveroman","Tworoman","Uacute","Uacutesmall","Ubreve","Ucaron","Ucircle","Ucircumflex","Ucircumflexbelow","Ucircumflexsmall","Ucyrillic","Udblacute","Udblgrave","Udieresis","Udieresisacute","Udieresisbelow","Udieresiscaron","Udieresiscyrillic","Udieresisgrave","Udieresismacron","Udieresissmall","Udotbelow","Ugrave","Ugravesmall","Uhookabove","Uhorn","Uhornacute","Uhorndotbelow","Uhorngrave","Uhornhookabove","Uhorntilde","Uhungarumlaut","Uhungarumlautcyrillic","Uinvertedbreve","Ukcyrillic","Umacron","Umacroncyrillic","Umacrondieresis","Umonospace","Uogonek","Upsilon","Upsilon1","Upsilonacutehooksymbolgreek","Upsilonafrican","Upsilondieresis","Upsilondieresishooksymbolgreek","Upsilonhooksymbol","Upsilontonos","Uring","Ushortcyrillic","Usmall","Ustraightcyrillic","Ustraightstrokecyrillic","Utilde","Utildeacute","Utildebelow","Vcircle","Vdotbelow","Vecyrillic","Vewarmenian","Vhook","Vmonospace","Voarmenian","Vsmall","Vtilde","W","Wacute","Wcircle","Wcircumflex","Wdieresis","Wdotaccent","Wdotbelow","Wgrave","Wmonospace","Wsmall","Xcircle","Xdieresis","Xdotaccent","Xeharmenian","Xi","Xmonospace","Xsmall","Yacute","Yacutesmall","Yatcyrillic","Ycircle","Ycircumflex","Ydieresis","Ydieresissmall","Ydotaccent","Ydotbelow","Yericyrillic","Yerudieresiscyrillic","Ygrave","Yhook","Yhookabove","Yiarmenian","Yicyrillic","Yiwnarmenian","Ymonospace","Ysmall","Ytilde","Yusbigcyrillic","Yusbigiotifiedcyrillic","Yuslittlecyrillic","Yuslittleiotifiedcyrillic","Zaarmenian","Zacute","Zcaron","Zcaronsmall","Zcircle","Zcircumflex","Zdot","Zdotaccent","Zdotbelow","Zecyrillic","Zedescendercyrillic","Zedieresiscyrillic","Zeta","Zhearmenian","Zhebrevecyrillic","Zhecyrillic","Zhedescendercyrillic","Zhedieresiscyrillic","Zlinebelow","Zmonospace","Zsmall","Zstroke","aabengali","aacute","aadeva","aagujarati","aagurmukhi","aamatragurmukhi","aarusquare","aavowelsignbengali","aavowelsigndeva","aavowelsigngujarati","abbreviationmarkarmenian","abbreviationsigndeva","abengali","abopomofo","abreve","abreveacute","abrevecyrillic","abrevedotbelow","abrevegrave","abrevehookabove","abrevetilde","acaron","acircle","acircumflex","acircumflexacute","acircumflexdotbelow","acircumflexgrave","acircumflexhookabove","acircumflextilde","acute","acutebelowcmb","acutecmb","acutecomb","acutedeva","acutelowmod","acutetonecmb","acyrillic","adblgrave","addakgurmukhi","adeva","adieresis","adieresiscyrillic","adieresismacron","adotbelow","adotmacron","ae","aeacute","aekorean","aemacron","afii00208","afii08941","afii10017","afii10018","afii10019","afii10020","afii10021","afii10022","afii10023","afii10024","afii10025","afii10026","afii10027","afii10028","afii10029","afii10030","afii10031","afii10032","afii10033","afii10034","afii10035","afii10036","afii10037","afii10038","afii10039","afii10040","afii10041","afii10042","afii10043","afii10044","afii10045","afii10046","afii10047","afii10048","afii10049","afii10050","afii10051","afii10052","afii10053","afii10054","afii10055","afii10056","afii10057","afii10058","afii10059","afii10060","afii10061","afii10062","afii10063","afii10064","afii10065","afii10066","afii10067","afii10068","afii10069","afii10070","afii10071","afii10072","afii10073","afii10074","afii10075","afii10076","afii10077","afii10078","afii10079","afii10080","afii10081","afii10082","afii10083","afii10084","afii10085","afii10086","afii10087","afii10088","afii10089","afii10090","afii10091","afii10092","afii10093","afii10094","afii10095","afii10096","afii10097","afii10098","afii10099","afii10100","afii10101","afii10102","afii10103","afii10104","afii10105","afii10106","afii10107","afii10108","afii10109","afii10110","afii10145","afii10146","afii10147","afii10148","afii10192","afii10193","afii10194","afii10195","afii10196","afii10831","afii10832","afii10846","afii299","afii300","afii301","afii57381","afii57388","afii57392","afii57393","afii57394","afii57395","afii57396","afii57397","afii57398","afii57399","afii57400","afii57401","afii57403","afii57407","afii57409","afii57410","afii57411","afii57412","afii57413","afii57414","afii57415","afii57416","afii57417","afii57418","afii57419","afii57420","afii57421","afii57422","afii57423","afii57424","afii57425","afii57426","afii57427","afii57428","afii57429","afii57430","afii57431","afii57432","afii57433","afii57434","afii57440","afii57441","afii57442","afii57443","afii57444","afii57445","afii57446","afii57448","afii57449","afii57450","afii57451","afii57452","afii57453","afii57454","afii57455","afii57456","afii57457","afii57458","afii57470","afii57505","afii57506","afii57507","afii57508","afii57509","afii57511","afii57512","afii57513","afii57514","afii57519","afii57534","afii57636","afii57645","afii57658","afii57664","afii57665","afii57666","afii57667","afii57668","afii57669","afii57670","afii57671","afii57672","afii57673","afii57674","afii57675","afii57676","afii57677","afii57678","afii57679","afii57680","afii57681","afii57682","afii57683","afii57684","afii57685","afii57686","afii57687","afii57688","afii57689","afii57690","afii57694","afii57695","afii57700","afii57705","afii57716","afii57717","afii57718","afii57723","afii57793","afii57794","afii57795","afii57796","afii57797","afii57798","afii57799","afii57800","afii57801","afii57802","afii57803","afii57804","afii57806","afii57807","afii57839","afii57841","afii57842","afii57929","afii61248","afii61289","afii61352","afii61573","afii61574","afii61575","afii61664","afii63167","afii64937","agrave","agujarati","agurmukhi","ahiragana","ahookabove","aibengali","aibopomofo","aideva","aiecyrillic","aigujarati","aigurmukhi","aimatragurmukhi","ainarabic","ainfinalarabic","aininitialarabic","ainmedialarabic","ainvertedbreve","aivowelsignbengali","aivowelsigndeva","aivowelsigngujarati","akatakana","akatakanahalfwidth","akorean","alef","alefarabic","alefdageshhebrew","aleffinalarabic","alefhamzaabovearabic","alefhamzaabovefinalarabic","alefhamzabelowarabic","alefhamzabelowfinalarabic","alefhebrew","aleflamedhebrew","alefmaddaabovearabic","alefmaddaabovefinalarabic","alefmaksuraarabic","alefmaksurafinalarabic","alefmaksurainitialarabic","alefmaksuramedialarabic","alefpatahhebrew","alefqamatshebrew","aleph","allequal","alphatonos","amacron","amonospace","ampersand","ampersandmonospace","ampersandsmall","amsquare","anbopomofo","angbopomofo","angbracketleft","angbracketright","angkhankhuthai","anglebracketleft","anglebracketleftvertical","anglebracketright","anglebracketrightvertical","angleleft","angleright","angstrom","anoteleia","anudattadeva","anusvarabengali","anusvaradeva","anusvaragujarati","aogonek","apaatosquare","aparen","apostrophearmenian","apostrophemod","apple","approaches","approxequal","approxequalorimage","approximatelyequal","araeaekorean","araeakorean","arc","arighthalfring","aring","aringacute","aringbelow","arrowboth","arrowdashdown","arrowdashleft","arrowdashright","arrowdashup","arrowdblboth","arrowdbldown","arrowdblleft","arrowdblright","arrowdblup","arrowdown","arrowdownleft","arrowdownright","arrowdownwhite","arrowheaddownmod","arrowheadleftmod","arrowheadrightmod","arrowheadupmod","arrowhorizex","arrowleft","arrowleftdbl","arrowleftdblstroke","arrowleftoverright","arrowleftwhite","arrowright","arrowrightdblstroke","arrowrightheavy","arrowrightoverleft","arrowrightwhite","arrowtableft","arrowtabright","arrowup","arrowupdn","arrowupdnbse","arrowupdownbase","arrowupleft","arrowupleftofdown","arrowupright","arrowupwhite","arrowvertex","asciicircum","asciicircummonospace","asciitilde","asciitildemonospace","ascript","ascriptturned","asmallhiragana","asmallkatakana","asmallkatakanahalfwidth","asterisk","asteriskaltonearabic","asteriskarabic","asteriskmath","asteriskmonospace","asterisksmall","asterism","asuperior","asymptoticallyequal","atilde","atmonospace","atsmall","aturned","aubengali","aubopomofo","audeva","augujarati","augurmukhi","aulengthmarkbengali","aumatragurmukhi","auvowelsignbengali","auvowelsigndeva","auvowelsigngujarati","avagrahadeva","aybarmenian","ayin","ayinaltonehebrew","ayinhebrew","babengali","backslash","backslashmonospace","badeva","bagujarati","bagurmukhi","bahiragana","bahtthai","bakatakana","bar","barmonospace","bbopomofo","bcircle","bdotaccent","bdotbelow","beamedsixteenthnotes","because","becyrillic","beharabic","behfinalarabic","behinitialarabic","behiragana","behmedialarabic","behmeeminitialarabic","behmeemisolatedarabic","behnoonfinalarabic","bekatakana","benarmenian","bet","betasymbolgreek","betdagesh","betdageshhebrew","bethebrew","betrafehebrew","bhabengali","bhadeva","bhagujarati","bhagurmukhi","bhook","bihiragana","bikatakana","bilabialclick","bindigurmukhi","birusquare","blackcircle","blackdiamond","blackdownpointingtriangle","blackleftpointingpointer","blackleftpointingtriangle","blacklenticularbracketleft","blacklenticularbracketleftvertical","blacklenticularbracketright","blacklenticularbracketrightvertical","blacklowerlefttriangle","blacklowerrighttriangle","blackrectangle","blackrightpointingpointer","blackrightpointingtriangle","blacksmallsquare","blacksmilingface","blacksquare","blackstar","blackupperlefttriangle","blackupperrighttriangle","blackuppointingsmalltriangle","blackuppointingtriangle","blank","blinebelow","bmonospace","bobaimaithai","bohiragana","bokatakana","bparen","bqsquare","braceex","braceleft","braceleftbt","braceleftmid","braceleftmonospace","braceleftsmall","bracelefttp","braceleftvertical","braceright","bracerightbt","bracerightmid","bracerightmonospace","bracerightsmall","bracerighttp","bracerightvertical","bracketleft","bracketleftbt","bracketleftex","bracketleftmonospace","bracketlefttp","bracketright","bracketrightbt","bracketrightex","bracketrightmonospace","bracketrighttp","breve","brevebelowcmb","brevecmb","breveinvertedbelowcmb","breveinvertedcmb","breveinverteddoublecmb","bridgebelowcmb","bridgeinvertedbelowcmb","brokenbar","bstroke","bsuperior","btopbar","buhiragana","bukatakana","bullet","bulletinverse","bulletoperator","bullseye","caarmenian","cabengali","cacute","cadeva","cagujarati","cagurmukhi","calsquare","candrabindubengali","candrabinducmb","candrabindudeva","candrabindugujarati","capslock","careof","caron","caronbelowcmb","caroncmb","carriagereturn","cbopomofo","ccaron","ccedilla","ccedillaacute","ccircle","ccircumflex","ccurl","cdot","cdotaccent","cdsquare","cedilla","cedillacmb","cent","centigrade","centinferior","centmonospace","centoldstyle","centsuperior","chaarmenian","chabengali","chadeva","chagujarati","chagurmukhi","chbopomofo","cheabkhasiancyrillic","checkmark","checyrillic","chedescenderabkhasiancyrillic","chedescendercyrillic","chedieresiscyrillic","cheharmenian","chekhakassiancyrillic","cheverticalstrokecyrillic","chi","chieuchacirclekorean","chieuchaparenkorean","chieuchcirclekorean","chieuchkorean","chieuchparenkorean","chochangthai","chochanthai","chochingthai","chochoethai","chook","cieucacirclekorean","cieucaparenkorean","cieuccirclekorean","cieuckorean","cieucparenkorean","cieucuparenkorean","circle","circlecopyrt","circlemultiply","circleot","circleplus","circlepostalmark","circlewithlefthalfblack","circlewithrighthalfblack","circumflex","circumflexbelowcmb","circumflexcmb","clickalveolar","clickdental","clicklateral","clickretroflex","club","clubsuitblack","clubsuitwhite","cmcubedsquare","cmonospace","cmsquaredsquare","coarmenian","colon","colonmonetary","colonmonospace","colonsign","colonsmall","colontriangularhalfmod","colontriangularmod","comma","commaabovecmb","commaaboverightcmb","commaaccent","commaarabic","commaarmenian","commainferior","commamonospace","commareversedabovecmb","commareversedmod","commasmall","commasuperior","commaturnedabovecmb","commaturnedmod","compass","congruent","contourintegral","control","controlACK","controlBEL","controlBS","controlCAN","controlCR","controlDC1","controlDC2","controlDC3","controlDC4","controlDEL","controlDLE","controlEM","controlENQ","controlEOT","controlESC","controlETB","controlETX","controlFF","controlFS","controlGS","controlHT","controlLF","controlNAK","controlNULL","controlRS","controlSI","controlSO","controlSOT","controlSTX","controlSUB","controlSYN","controlUS","controlVT","copyright","copyrightsans","copyrightserif","cornerbracketleft","cornerbracketlefthalfwidth","cornerbracketleftvertical","cornerbracketright","cornerbracketrighthalfwidth","cornerbracketrightvertical","corporationsquare","cosquare","coverkgsquare","cparen","cruzeiro","cstretched","curlyand","curlyor","currency","cyrBreve","cyrFlex","cyrbreve","cyrflex","daarmenian","dabengali","dadarabic","dadeva","dadfinalarabic","dadinitialarabic","dadmedialarabic","dagesh","dageshhebrew","dagger","daggerdbl","dagujarati","dagurmukhi","dahiragana","dakatakana","dalarabic","dalet","daletdagesh","daletdageshhebrew","dalethebrew","dalfinalarabic","dammaarabic","dammalowarabic","dammatanaltonearabic","dammatanarabic","danda","dargahebrew","dargalefthebrew","dasiapneumatacyrilliccmb","dblGrave","dblanglebracketleft","dblanglebracketleftvertical","dblanglebracketright","dblanglebracketrightvertical","dblarchinvertedbelowcmb","dblarrowleft","dblarrowright","dbldanda","dblgrave","dblgravecmb","dblintegral","dbllowline","dbllowlinecmb","dbloverlinecmb","dblprimemod","dblverticalbar","dblverticallineabovecmb","dbopomofo","dbsquare","dcaron","dcedilla","dcircle","dcircumflexbelow","dcroat","ddabengali","ddadeva","ddagujarati","ddagurmukhi","ddalarabic","ddalfinalarabic","dddhadeva","ddhabengali","ddhadeva","ddhagujarati","ddhagurmukhi","ddotaccent","ddotbelow","decimalseparatorarabic","decimalseparatorpersian","decyrillic","degree","dehihebrew","dehiragana","deicoptic","dekatakana","deleteleft","deleteright","deltaturned","denominatorminusonenumeratorbengali","dezh","dhabengali","dhadeva","dhagujarati","dhagurmukhi","dhook","dialytikatonos","dialytikatonoscmb","diamond","diamondsuitwhite","dieresis","dieresisacute","dieresisbelowcmb","dieresiscmb","dieresisgrave","dieresistonos","dihiragana","dikatakana","dittomark","divide","divides","divisionslash","djecyrillic","dkshade","dlinebelow","dlsquare","dmacron","dmonospace","dnblock","dochadathai","dodekthai","dohiragana","dokatakana","dollar","dollarinferior","dollarmonospace","dollaroldstyle","dollarsmall","dollarsuperior","dong","dorusquare","dotaccent","dotaccentcmb","dotbelowcmb","dotbelowcomb","dotkatakana","dotlessi","dotlessj","dotlessjstrokehook","dotmath","dottedcircle","doubleyodpatah","doubleyodpatahhebrew","downtackbelowcmb","downtackmod","dparen","dsuperior","dtail","dtopbar","duhiragana","dukatakana","dz","dzaltone","dzcaron","dzcurl","dzeabkhasiancyrillic","dzecyrillic","dzhecyrillic","eacute","earth","ebengali","ebopomofo","ebreve","ecandradeva","ecandragujarati","ecandravowelsigndeva","ecandravowelsigngujarati","ecaron","ecedillabreve","echarmenian","echyiwnarmenian","ecircle","ecircumflex","ecircumflexacute","ecircumflexbelow","ecircumflexdotbelow","ecircumflexgrave","ecircumflexhookabove","ecircumflextilde","ecyrillic","edblgrave","edeva","edieresis","edot","edotaccent","edotbelow","eegurmukhi","eematragurmukhi","efcyrillic","egrave","egujarati","eharmenian","ehbopomofo","ehiragana","ehookabove","eibopomofo","eight","eightarabic","eightbengali","eightcircle","eightcircleinversesansserif","eightdeva","eighteencircle","eighteenparen","eighteenperiod","eightgujarati","eightgurmukhi","eighthackarabic","eighthangzhou","eighthnotebeamed","eightideographicparen","eightinferior","eightmonospace","eightoldstyle","eightparen","eightperiod","eightpersian","eightroman","eightsuperior","eightthai","einvertedbreve","eiotifiedcyrillic","ekatakana","ekatakanahalfwidth","ekonkargurmukhi","ekorean","elcyrillic","elevencircle","elevenparen","elevenperiod","elevenroman","ellipsis","ellipsisvertical","emacron","emacronacute","emacrongrave","emcyrillic","emdash","emdashvertical","emonospace","emphasismarkarmenian","emptyset","enbopomofo","encyrillic","endash","endashvertical","endescendercyrillic","eng","engbopomofo","enghecyrillic","enhookcyrillic","enspace","eogonek","eokorean","eopen","eopenclosed","eopenreversed","eopenreversedclosed","eopenreversedhook","eparen","epsilontonos","equal","equalmonospace","equalsmall","equalsuperior","equivalence","erbopomofo","ercyrillic","ereversed","ereversedcyrillic","escyrillic","esdescendercyrillic","esh","eshcurl","eshortdeva","eshortvowelsigndeva","eshreversedloop","eshsquatreversed","esmallhiragana","esmallkatakana","esmallkatakanahalfwidth","estimated","esuperior","eta","etarmenian","etatonos","eth","etilde","etildebelow","etnahtafoukhhebrew","etnahtafoukhlefthebrew","etnahtahebrew","etnahtalefthebrew","eturned","eukorean","euro","evowelsignbengali","evowelsigndeva","evowelsigngujarati","exclam","exclamarmenian","exclamdbl","exclamdown","exclamdownsmall","exclammonospace","exclamsmall","existential","ezh","ezhcaron","ezhcurl","ezhreversed","ezhtail","f","fadeva","fagurmukhi","fahrenheit","fathaarabic","fathalowarabic","fathatanarabic","fbopomofo","fcircle","fdotaccent","feharabic","feharmenian","fehfinalarabic","fehinitialarabic","fehmedialarabic","feicoptic","female","ff","f_f","ffi","f_f_i","ffl","f_f_l","fi","f_i","fifteencircle","fifteenparen","fifteenperiod","figuredash","filledbox","filledrect","finalkaf","finalkafdagesh","finalkafdageshhebrew","finalkafhebrew","finalmem","finalmemhebrew","finalnun","finalnunhebrew","finalpe","finalpehebrew","finaltsadi","finaltsadihebrew","firsttonechinese","fisheye","fitacyrillic","five","fivearabic","fivebengali","fivecircle","fivecircleinversesansserif","fivedeva","fiveeighths","fivegujarati","fivegurmukhi","fivehackarabic","fivehangzhou","fiveideographicparen","fiveinferior","fivemonospace","fiveoldstyle","fiveparen","fiveperiod","fivepersian","fiveroman","fivesuperior","fivethai","fl","f_l","florin","fmonospace","fmsquare","fofanthai","fofathai","fongmanthai","forall","four","fourarabic","fourbengali","fourcircle","fourcircleinversesansserif","fourdeva","fourgujarati","fourgurmukhi","fourhackarabic","fourhangzhou","fourideographicparen","fourinferior","fourmonospace","fournumeratorbengali","fouroldstyle","fourparen","fourperiod","fourpersian","fourroman","foursuperior","fourteencircle","fourteenparen","fourteenperiod","fourthai","fourthtonechinese","fparen","fraction","franc","gabengali","gacute","gadeva","gafarabic","gaffinalarabic","gafinitialarabic","gafmedialarabic","gagujarati","gagurmukhi","gahiragana","gakatakana","gammalatinsmall","gammasuperior","gangiacoptic","gbopomofo","gbreve","gcaron","gcedilla","gcircle","gcircumflex","gcommaaccent","gdot","gdotaccent","gecyrillic","gehiragana","gekatakana","geometricallyequal","gereshaccenthebrew","gereshhebrew","gereshmuqdamhebrew","germandbls","gershayimaccenthebrew","gershayimhebrew","getamark","ghabengali","ghadarmenian","ghadeva","ghagujarati","ghagurmukhi","ghainarabic","ghainfinalarabic","ghaininitialarabic","ghainmedialarabic","ghemiddlehookcyrillic","ghestrokecyrillic","gheupturncyrillic","ghhadeva","ghhagurmukhi","ghook","ghzsquare","gihiragana","gikatakana","gimarmenian","gimel","gimeldagesh","gimeldageshhebrew","gimelhebrew","gjecyrillic","glottalinvertedstroke","glottalstop","glottalstopinverted","glottalstopmod","glottalstopreversed","glottalstopreversedmod","glottalstopreversedsuperior","glottalstopstroke","glottalstopstrokereversed","gmacron","gmonospace","gohiragana","gokatakana","gparen","gpasquare","gradient","grave","gravebelowcmb","gravecmb","gravecomb","gravedeva","gravelowmod","gravemonospace","gravetonecmb","greater","greaterequal","greaterequalorless","greatermonospace","greaterorequivalent","greaterorless","greateroverequal","greatersmall","gscript","gstroke","guhiragana","guillemotleft","guillemotright","guilsinglleft","guilsinglright","gukatakana","guramusquare","gysquare","haabkhasiancyrillic","haaltonearabic","habengali","hadescendercyrillic","hadeva","hagujarati","hagurmukhi","haharabic","hahfinalarabic","hahinitialarabic","hahiragana","hahmedialarabic","haitusquare","hakatakana","hakatakanahalfwidth","halantgurmukhi","hamzaarabic","hamzalowarabic","hangulfiller","hardsigncyrillic","harpoonleftbarbup","harpoonrightbarbup","hasquare","hatafpatah","hatafpatah16","hatafpatah23","hatafpatah2f","hatafpatahhebrew","hatafpatahnarrowhebrew","hatafpatahquarterhebrew","hatafpatahwidehebrew","hatafqamats","hatafqamats1b","hatafqamats28","hatafqamats34","hatafqamatshebrew","hatafqamatsnarrowhebrew","hatafqamatsquarterhebrew","hatafqamatswidehebrew","hatafsegol","hatafsegol17","hatafsegol24","hatafsegol30","hatafsegolhebrew","hatafsegolnarrowhebrew","hatafsegolquarterhebrew","hatafsegolwidehebrew","hbar","hbopomofo","hbrevebelow","hcedilla","hcircle","hcircumflex","hdieresis","hdotaccent","hdotbelow","he","heart","heartsuitblack","heartsuitwhite","hedagesh","hedageshhebrew","hehaltonearabic","heharabic","hehebrew","hehfinalaltonearabic","hehfinalalttwoarabic","hehfinalarabic","hehhamzaabovefinalarabic","hehhamzaaboveisolatedarabic","hehinitialaltonearabic","hehinitialarabic","hehiragana","hehmedialaltonearabic","hehmedialarabic","heiseierasquare","hekatakana","hekatakanahalfwidth","hekutaarusquare","henghook","herutusquare","het","hethebrew","hhook","hhooksuperior","hieuhacirclekorean","hieuhaparenkorean","hieuhcirclekorean","hieuhkorean","hieuhparenkorean","hihiragana","hikatakana","hikatakanahalfwidth","hiriq","hiriq14","hiriq21","hiriq2d","hiriqhebrew","hiriqnarrowhebrew","hiriqquarterhebrew","hiriqwidehebrew","hlinebelow","hmonospace","hoarmenian","hohipthai","hohiragana","hokatakana","hokatakanahalfwidth","holam","holam19","holam26","holam32","holamhebrew","holamnarrowhebrew","holamquarterhebrew","holamwidehebrew","honokhukthai","hookabovecomb","hookcmb","hookpalatalizedbelowcmb","hookretroflexbelowcmb","hoonsquare","horicoptic","horizontalbar","horncmb","hotsprings","house","hparen","hsuperior","hturned","huhiragana","huiitosquare","hukatakana","hukatakanahalfwidth","hungarumlaut","hungarumlautcmb","hv","hyphen","hypheninferior","hyphenmonospace","hyphensmall","hyphensuperior","hyphentwo","iacute","iacyrillic","ibengali","ibopomofo","ibreve","icaron","icircle","icircumflex","icyrillic","idblgrave","ideographearthcircle","ideographfirecircle","ideographicallianceparen","ideographiccallparen","ideographiccentrecircle","ideographicclose","ideographiccomma","ideographiccommaleft","ideographiccongratulationparen","ideographiccorrectcircle","ideographicearthparen","ideographicenterpriseparen","ideographicexcellentcircle","ideographicfestivalparen","ideographicfinancialcircle","ideographicfinancialparen","ideographicfireparen","ideographichaveparen","ideographichighcircle","ideographiciterationmark","ideographiclaborcircle","ideographiclaborparen","ideographicleftcircle","ideographiclowcircle","ideographicmedicinecircle","ideographicmetalparen","ideographicmoonparen","ideographicnameparen","ideographicperiod","ideographicprintcircle","ideographicreachparen","ideographicrepresentparen","ideographicresourceparen","ideographicrightcircle","ideographicsecretcircle","ideographicselfparen","ideographicsocietyparen","ideographicspace","ideographicspecialparen","ideographicstockparen","ideographicstudyparen","ideographicsunparen","ideographicsuperviseparen","ideographicwaterparen","ideographicwoodparen","ideographiczero","ideographmetalcircle","ideographmooncircle","ideographnamecircle","ideographsuncircle","ideographwatercircle","ideographwoodcircle","ideva","idieresis","idieresisacute","idieresiscyrillic","idotbelow","iebrevecyrillic","iecyrillic","ieungacirclekorean","ieungaparenkorean","ieungcirclekorean","ieungkorean","ieungparenkorean","igrave","igujarati","igurmukhi","ihiragana","ihookabove","iibengali","iicyrillic","iideva","iigujarati","iigurmukhi","iimatragurmukhi","iinvertedbreve","iishortcyrillic","iivowelsignbengali","iivowelsigndeva","iivowelsigngujarati","ij","ikatakana","ikatakanahalfwidth","ikorean","ilde","iluyhebrew","imacron","imacroncyrillic","imageorapproximatelyequal","imatragurmukhi","imonospace","increment","infinity","iniarmenian","integral","integralbottom","integralbt","integralex","integraltop","integraltp","intersection","intisquare","invbullet","invcircle","invsmileface","iocyrillic","iogonek","iota","iotadieresis","iotadieresistonos","iotalatin","iotatonos","iparen","irigurmukhi","ismallhiragana","ismallkatakana","ismallkatakanahalfwidth","issharbengali","istroke","isuperior","iterationhiragana","iterationkatakana","itilde","itildebelow","iubopomofo","iucyrillic","ivowelsignbengali","ivowelsigndeva","ivowelsigngujarati","izhitsacyrillic","izhitsadblgravecyrillic","jaarmenian","jabengali","jadeva","jagujarati","jagurmukhi","jbopomofo","jcaron","jcircle","jcircumflex","jcrossedtail","jdotlessstroke","jecyrillic","jeemarabic","jeemfinalarabic","jeeminitialarabic","jeemmedialarabic","jeharabic","jehfinalarabic","jhabengali","jhadeva","jhagujarati","jhagurmukhi","jheharmenian","jis","jmonospace","jparen","jsuperior","kabashkircyrillic","kabengali","kacute","kacyrillic","kadescendercyrillic","kadeva","kaf","kafarabic","kafdagesh","kafdageshhebrew","kaffinalarabic","kafhebrew","kafinitialarabic","kafmedialarabic","kafrafehebrew","kagujarati","kagurmukhi","kahiragana","kahookcyrillic","kakatakana","kakatakanahalfwidth","kappa","kappasymbolgreek","kapyeounmieumkorean","kapyeounphieuphkorean","kapyeounpieupkorean","kapyeounssangpieupkorean","karoriisquare","kashidaautoarabic","kashidaautonosidebearingarabic","kasmallkatakana","kasquare","kasraarabic","kasratanarabic","kastrokecyrillic","katahiraprolongmarkhalfwidth","kaverticalstrokecyrillic","kbopomofo","kcalsquare","kcaron","kcedilla","kcircle","kcommaaccent","kdotbelow","keharmenian","kehiragana","kekatakana","kekatakanahalfwidth","kenarmenian","kesmallkatakana","kgreenlandic","khabengali","khacyrillic","khadeva","khagujarati","khagurmukhi","khaharabic","khahfinalarabic","khahinitialarabic","khahmedialarabic","kheicoptic","khhadeva","khhagurmukhi","khieukhacirclekorean","khieukhaparenkorean","khieukhcirclekorean","khieukhkorean","khieukhparenkorean","khokhaithai","khokhonthai","khokhuatthai","khokhwaithai","khomutthai","khook","khorakhangthai","khzsquare","kihiragana","kikatakana","kikatakanahalfwidth","kiroguramusquare","kiromeetorusquare","kirosquare","kiyeokacirclekorean","kiyeokaparenkorean","kiyeokcirclekorean","kiyeokkorean","kiyeokparenkorean","kiyeoksioskorean","kjecyrillic","klinebelow","klsquare","kmcubedsquare","kmonospace","kmsquaredsquare","kohiragana","kohmsquare","kokaithai","kokatakana","kokatakanahalfwidth","kooposquare","koppacyrillic","koreanstandardsymbol","koroniscmb","kparen","kpasquare","ksicyrillic","ktsquare","kturned","kuhiragana","kukatakana","kukatakanahalfwidth","kvsquare","kwsquare","labengali","lacute","ladeva","lagujarati","lagurmukhi","lakkhangyaothai","lamaleffinalarabic","lamalefhamzaabovefinalarabic","lamalefhamzaaboveisolatedarabic","lamalefhamzabelowfinalarabic","lamalefhamzabelowisolatedarabic","lamalefisolatedarabic","lamalefmaddaabovefinalarabic","lamalefmaddaaboveisolatedarabic","lamarabic","lambda","lambdastroke","lamed","lameddagesh","lameddageshhebrew","lamedhebrew","lamfinalarabic","lamhahinitialarabic","laminitialarabic","lamjeeminitialarabic","lamkhahinitialarabic","lamlamhehisolatedarabic","lammedialarabic","lammeemhahinitialarabic","lammeeminitialarabic","largecircle","lbar","lbelt","lbopomofo","lcaron","lcedilla","lcircle","lcircumflexbelow","lcommaaccent","ldot","ldotaccent","ldotbelow","ldotbelowmacron","leftangleabovecmb","lefttackbelowcmb","less","lessequal","lessequalorgreater","lessmonospace","lessorequivalent","lessorgreater","lessoverequal","lesssmall","lezh","lfblock","lhookretroflex","lira","liwnarmenian","lj","ljecyrillic","lladeva","llagujarati","llinebelow","llladeva","llvocalicbengali","llvocalicdeva","llvocalicvowelsignbengali","llvocalicvowelsigndeva","lmiddletilde","lmonospace","lmsquare","lochulathai","logicaland","logicalnot","logicalnotreversed","logicalor","lolingthai","longs","lowlinecenterline","lowlinecmb","lowlinedashed","lozenge","lparen","lslash","lsquare","lsuperior","ltshade","luthai","lvocalicbengali","lvocalicdeva","lvocalicvowelsignbengali","lvocalicvowelsigndeva","lxsquare","mabengali","macron","macronbelowcmb","macroncmb","macronlowmod","macronmonospace","macute","madeva","magujarati","magurmukhi","mahapakhhebrew","mahapakhlefthebrew","mahiragana","maichattawalowleftthai","maichattawalowrightthai","maichattawathai","maichattawaupperleftthai","maieklowleftthai","maieklowrightthai","maiekthai","maiekupperleftthai","maihanakatleftthai","maihanakatthai","maitaikhuleftthai","maitaikhuthai","maitholowleftthai","maitholowrightthai","maithothai","maithoupperleftthai","maitrilowleftthai","maitrilowrightthai","maitrithai","maitriupperleftthai","maiyamokthai","makatakana","makatakanahalfwidth","male","mansyonsquare","maqafhebrew","mars","masoracirclehebrew","masquare","mbopomofo","mbsquare","mcircle","mcubedsquare","mdotaccent","mdotbelow","meemarabic","meemfinalarabic","meeminitialarabic","meemmedialarabic","meemmeeminitialarabic","meemmeemisolatedarabic","meetorusquare","mehiragana","meizierasquare","mekatakana","mekatakanahalfwidth","mem","memdagesh","memdageshhebrew","memhebrew","menarmenian","merkhahebrew","merkhakefulahebrew","merkhakefulalefthebrew","merkhalefthebrew","mhook","mhzsquare","middledotkatakanahalfwidth","middot","mieumacirclekorean","mieumaparenkorean","mieumcirclekorean","mieumkorean","mieumpansioskorean","mieumparenkorean","mieumpieupkorean","mieumsioskorean","mihiragana","mikatakana","mikatakanahalfwidth","minus","minusbelowcmb","minuscircle","minusmod","minusplus","minute","miribaarusquare","mirisquare","mlonglegturned","mlsquare","mmcubedsquare","mmonospace","mmsquaredsquare","mohiragana","mohmsquare","mokatakana","mokatakanahalfwidth","molsquare","momathai","moverssquare","moverssquaredsquare","mparen","mpasquare","mssquare","msuperior","mturned","mu1","muasquare","muchgreater","muchless","mufsquare","mugreek","mugsquare","muhiragana","mukatakana","mukatakanahalfwidth","mulsquare","multiply","mumsquare","munahhebrew","munahlefthebrew","musicalnote","musicalnotedbl","musicflatsign","musicsharpsign","mussquare","muvsquare","muwsquare","mvmegasquare","mvsquare","mwmegasquare","mwsquare","nabengali","nabla","nacute","nadeva","nagujarati","nagurmukhi","nahiragana","nakatakana","nakatakanahalfwidth","napostrophe","nasquare","nbopomofo","nbspace","ncaron","ncedilla","ncircle","ncircumflexbelow","ncommaaccent","ndotaccent","ndotbelow","nehiragana","nekatakana","nekatakanahalfwidth","newsheqelsign","nfsquare","ngabengali","ngadeva","ngagujarati","ngagurmukhi","ngonguthai","nhiragana","nhookleft","nhookretroflex","nieunacirclekorean","nieunaparenkorean","nieuncieuckorean","nieuncirclekorean","nieunhieuhkorean","nieunkorean","nieunpansioskorean","nieunparenkorean","nieunsioskorean","nieuntikeutkorean","nihiragana","nikatakana","nikatakanahalfwidth","nikhahitleftthai","nikhahitthai","nine","ninearabic","ninebengali","ninecircle","ninecircleinversesansserif","ninedeva","ninegujarati","ninegurmukhi","ninehackarabic","ninehangzhou","nineideographicparen","nineinferior","ninemonospace","nineoldstyle","nineparen","nineperiod","ninepersian","nineroman","ninesuperior","nineteencircle","nineteenparen","nineteenperiod","ninethai","nj","njecyrillic","nkatakana","nkatakanahalfwidth","nlegrightlong","nlinebelow","nmonospace","nmsquare","nnabengali","nnadeva","nnagujarati","nnagurmukhi","nnnadeva","nohiragana","nokatakana","nokatakanahalfwidth","nonbreakingspace","nonenthai","nonuthai","noonarabic","noonfinalarabic","noonghunnaarabic","noonghunnafinalarabic","nooninitialarabic","noonjeeminitialarabic","noonjeemisolatedarabic","noonmedialarabic","noonmeeminitialarabic","noonmeemisolatedarabic","noonnoonfinalarabic","notcontains","notelement","notelementof","notequal","notgreater","notgreaternorequal","notgreaternorless","notidentical","notless","notlessnorequal","notparallel","notprecedes","notsubset","notsucceeds","notsuperset","nowarmenian","nparen","nssquare","nsuperior","ntilde","nu","nuhiragana","nukatakana","nukatakanahalfwidth","nuktabengali","nuktadeva","nuktagujarati","nuktagurmukhi","numbersign","numbersignmonospace","numbersignsmall","numeralsigngreek","numeralsignlowergreek","numero","nun","nundagesh","nundageshhebrew","nunhebrew","nvsquare","nwsquare","nyabengali","nyadeva","nyagujarati","nyagurmukhi","o","oacute","oangthai","obarred","obarredcyrillic","obarreddieresiscyrillic","obengali","obopomofo","obreve","ocandradeva","ocandragujarati","ocandravowelsigndeva","ocandravowelsigngujarati","ocaron","ocircle","ocircumflex","ocircumflexacute","ocircumflexdotbelow","ocircumflexgrave","ocircumflexhookabove","ocircumflextilde","ocyrillic","odblacute","odblgrave","odeva","odieresis","odieresiscyrillic","odotbelow","oe","oekorean","ogonek","ogonekcmb","ograve","ogujarati","oharmenian","ohiragana","ohookabove","ohorn","ohornacute","ohorndotbelow","ohorngrave","ohornhookabove","ohorntilde","ohungarumlaut","oi","oinvertedbreve","okatakana","okatakanahalfwidth","okorean","olehebrew","omacron","omacronacute","omacrongrave","omdeva","omega","omega1","omegacyrillic","omegalatinclosed","omegaroundcyrillic","omegatitlocyrillic","omegatonos","omgujarati","omicron","omicrontonos","omonospace","one","onearabic","onebengali","onecircle","onecircleinversesansserif","onedeva","onedotenleader","oneeighth","onefitted","onegujarati","onegurmukhi","onehackarabic","onehalf","onehangzhou","oneideographicparen","oneinferior","onemonospace","onenumeratorbengali","oneoldstyle","oneparen","oneperiod","onepersian","onequarter","oneroman","onesuperior","onethai","onethird","oogonek","oogonekmacron","oogurmukhi","oomatragurmukhi","oopen","oparen","openbullet","option","ordfeminine","ordmasculine","orthogonal","oshortdeva","oshortvowelsigndeva","oslash","oslashacute","osmallhiragana","osmallkatakana","osmallkatakanahalfwidth","ostrokeacute","osuperior","otcyrillic","otilde","otildeacute","otildedieresis","oubopomofo","overline","overlinecenterline","overlinecmb","overlinedashed","overlinedblwavy","overlinewavy","overscore","ovowelsignbengali","ovowelsigndeva","ovowelsigngujarati","paampssquare","paasentosquare","pabengali","pacute","padeva","pagedown","pageup","pagujarati","pagurmukhi","pahiragana","paiyannoithai","pakatakana","palatalizationcyrilliccmb","palochkacyrillic","pansioskorean","paragraph","parallel","parenleft","parenleftaltonearabic","parenleftbt","parenleftex","parenleftinferior","parenleftmonospace","parenleftsmall","parenleftsuperior","parenlefttp","parenleftvertical","parenright","parenrightaltonearabic","parenrightbt","parenrightex","parenrightinferior","parenrightmonospace","parenrightsmall","parenrightsuperior","parenrighttp","parenrightvertical","partialdiff","paseqhebrew","pashtahebrew","pasquare","patah","patah11","patah1d","patah2a","patahhebrew","patahnarrowhebrew","patahquarterhebrew","patahwidehebrew","pazerhebrew","pbopomofo","pcircle","pdotaccent","pe","pecyrillic","pedagesh","pedageshhebrew","peezisquare","pefinaldageshhebrew","peharabic","peharmenian","pehebrew","pehfinalarabic","pehinitialarabic","pehiragana","pehmedialarabic","pekatakana","pemiddlehookcyrillic","perafehebrew","percent","percentarabic","percentmonospace","percentsmall","period","periodarmenian","periodcentered","periodhalfwidth","periodinferior","periodmonospace","periodsmall","periodsuperior","perispomenigreekcmb","perpendicular","perthousand","peseta","pfsquare","phabengali","phadeva","phagujarati","phagurmukhi","phi","phi1","phieuphacirclekorean","phieuphaparenkorean","phieuphcirclekorean","phieuphkorean","phieuphparenkorean","philatin","phinthuthai","phisymbolgreek","phook","phophanthai","phophungthai","phosamphaothai","pieupacirclekorean","pieupaparenkorean","pieupcieuckorean","pieupcirclekorean","pieupkiyeokkorean","pieupkorean","pieupparenkorean","pieupsioskiyeokkorean","pieupsioskorean","pieupsiostikeutkorean","pieupthieuthkorean","pieuptikeutkorean","pihiragana","pikatakana","pisymbolgreek","piwrarmenian","planckover2pi","planckover2pi1","plus","plusbelowcmb","pluscircle","plusminus","plusmod","plusmonospace","plussmall","plussuperior","pmonospace","pmsquare","pohiragana","pointingindexdownwhite","pointingindexleftwhite","pointingindexrightwhite","pointingindexupwhite","pokatakana","poplathai","postalmark","postalmarkface","pparen","precedes","prescription","primemod","primereversed","product","projective","prolongedkana","propellor","propersubset","propersuperset","proportion","proportional","psi","psicyrillic","psilipneumatacyrilliccmb","pssquare","puhiragana","pukatakana","pvsquare","pwsquare","qadeva","qadmahebrew","qafarabic","qaffinalarabic","qafinitialarabic","qafmedialarabic","qamats","qamats10","qamats1a","qamats1c","qamats27","qamats29","qamats33","qamatsde","qamatshebrew","qamatsnarrowhebrew","qamatsqatanhebrew","qamatsqatannarrowhebrew","qamatsqatanquarterhebrew","qamatsqatanwidehebrew","qamatsquarterhebrew","qamatswidehebrew","qarneyparahebrew","qbopomofo","qcircle","qhook","qmonospace","qof","qofdagesh","qofdageshhebrew","qofhebrew","qparen","quarternote","qubuts","qubuts18","qubuts25","qubuts31","qubutshebrew","qubutsnarrowhebrew","qubutsquarterhebrew","qubutswidehebrew","question","questionarabic","questionarmenian","questiondown","questiondownsmall","questiongreek","questionmonospace","questionsmall","quotedbl","quotedblbase","quotedblleft","quotedblmonospace","quotedblprime","quotedblprimereversed","quotedblright","quoteleft","quoteleftreversed","quotereversed","quoteright","quoterightn","quotesinglbase","quotesingle","quotesinglemonospace","raarmenian","rabengali","racute","radeva","radical","radicalex","radoverssquare","radoverssquaredsquare","radsquare","rafe","rafehebrew","ragujarati","ragurmukhi","rahiragana","rakatakana","rakatakanahalfwidth","ralowerdiagonalbengali","ramiddlediagonalbengali","ramshorn","ratio","rbopomofo","rcaron","rcedilla","rcircle","rcommaaccent","rdblgrave","rdotaccent","rdotbelow","rdotbelowmacron","referencemark","reflexsubset","reflexsuperset","registered","registersans","registerserif","reharabic","reharmenian","rehfinalarabic","rehiragana","rekatakana","rekatakanahalfwidth","resh","reshdageshhebrew","reshhebrew","reversedtilde","reviahebrew","reviamugrashhebrew","revlogicalnot","rfishhook","rfishhookreversed","rhabengali","rhadeva","rho","rhook","rhookturned","rhookturnedsuperior","rhosymbolgreek","rhotichookmod","rieulacirclekorean","rieulaparenkorean","rieulcirclekorean","rieulhieuhkorean","rieulkiyeokkorean","rieulkiyeoksioskorean","rieulkorean","rieulmieumkorean","rieulpansioskorean","rieulparenkorean","rieulphieuphkorean","rieulpieupkorean","rieulpieupsioskorean","rieulsioskorean","rieulthieuthkorean","rieultikeutkorean","rieulyeorinhieuhkorean","rightangle","righttackbelowcmb","righttriangle","rihiragana","rikatakana","rikatakanahalfwidth","ring","ringbelowcmb","ringcmb","ringhalfleft","ringhalfleftarmenian","ringhalfleftbelowcmb","ringhalfleftcentered","ringhalfright","ringhalfrightbelowcmb","ringhalfrightcentered","rinvertedbreve","rittorusquare","rlinebelow","rlongleg","rlonglegturned","rmonospace","rohiragana","rokatakana","rokatakanahalfwidth","roruathai","rparen","rrabengali","rradeva","rragurmukhi","rreharabic","rrehfinalarabic","rrvocalicbengali","rrvocalicdeva","rrvocalicgujarati","rrvocalicvowelsignbengali","rrvocalicvowelsigndeva","rrvocalicvowelsigngujarati","rsuperior","rtblock","rturned","rturnedsuperior","ruhiragana","rukatakana","rukatakanahalfwidth","rupeemarkbengali","rupeesignbengali","rupiah","ruthai","rvocalicbengali","rvocalicdeva","rvocalicgujarati","rvocalicvowelsignbengali","rvocalicvowelsigndeva","rvocalicvowelsigngujarati","sabengali","sacute","sacutedotaccent","sadarabic","sadeva","sadfinalarabic","sadinitialarabic","sadmedialarabic","sagujarati","sagurmukhi","sahiragana","sakatakana","sakatakanahalfwidth","sallallahoualayhewasallamarabic","samekh","samekhdagesh","samekhdageshhebrew","samekhhebrew","saraaathai","saraaethai","saraaimaimalaithai","saraaimaimuanthai","saraamthai","saraathai","saraethai","saraiileftthai","saraiithai","saraileftthai","saraithai","saraothai","saraueeleftthai","saraueethai","saraueleftthai","sarauethai","sarauthai","sarauuthai","sbopomofo","scaron","scarondotaccent","scedilla","schwa","schwacyrillic","schwadieresiscyrillic","schwahook","scircle","scircumflex","scommaaccent","sdotaccent","sdotbelow","sdotbelowdotaccent","seagullbelowcmb","secondtonechinese","section","seenarabic","seenfinalarabic","seeninitialarabic","seenmedialarabic","segol","segol13","segol1f","segol2c","segolhebrew","segolnarrowhebrew","segolquarterhebrew","segoltahebrew","segolwidehebrew","seharmenian","sehiragana","sekatakana","sekatakanahalfwidth","semicolon","semicolonarabic","semicolonmonospace","semicolonsmall","semivoicedmarkkana","semivoicedmarkkanahalfwidth","sentisquare","sentosquare","seven","sevenarabic","sevenbengali","sevencircle","sevencircleinversesansserif","sevendeva","seveneighths","sevengujarati","sevengurmukhi","sevenhackarabic","sevenhangzhou","sevenideographicparen","seveninferior","sevenmonospace","sevenoldstyle","sevenparen","sevenperiod","sevenpersian","sevenroman","sevensuperior","seventeencircle","seventeenparen","seventeenperiod","seventhai","sfthyphen","shaarmenian","shabengali","shacyrillic","shaddaarabic","shaddadammaarabic","shaddadammatanarabic","shaddafathaarabic","shaddakasraarabic","shaddakasratanarabic","shade","shadedark","shadelight","shademedium","shadeva","shagujarati","shagurmukhi","shalshelethebrew","shbopomofo","shchacyrillic","sheenarabic","sheenfinalarabic","sheeninitialarabic","sheenmedialarabic","sheicoptic","sheqel","sheqelhebrew","sheva","sheva115","sheva15","sheva22","sheva2e","shevahebrew","shevanarrowhebrew","shevaquarterhebrew","shevawidehebrew","shhacyrillic","shimacoptic","shin","shindagesh","shindageshhebrew","shindageshshindot","shindageshshindothebrew","shindageshsindot","shindageshsindothebrew","shindothebrew","shinhebrew","shinshindot","shinshindothebrew","shinsindot","shinsindothebrew","shook","sigma","sigma1","sigmafinal","sigmalunatesymbolgreek","sihiragana","sikatakana","sikatakanahalfwidth","siluqhebrew","siluqlefthebrew","similar","sindothebrew","siosacirclekorean","siosaparenkorean","sioscieuckorean","sioscirclekorean","sioskiyeokkorean","sioskorean","siosnieunkorean","siosparenkorean","siospieupkorean","siostikeutkorean","six","sixarabic","sixbengali","sixcircle","sixcircleinversesansserif","sixdeva","sixgujarati","sixgurmukhi","sixhackarabic","sixhangzhou","sixideographicparen","sixinferior","sixmonospace","sixoldstyle","sixparen","sixperiod","sixpersian","sixroman","sixsuperior","sixteencircle","sixteencurrencydenominatorbengali","sixteenparen","sixteenperiod","sixthai","slash","slashmonospace","slong","slongdotaccent","smileface","smonospace","sofpasuqhebrew","softhyphen","softsigncyrillic","sohiragana","sokatakana","sokatakanahalfwidth","soliduslongoverlaycmb","solidusshortoverlaycmb","sorusithai","sosalathai","sosothai","sosuathai","space","spacehackarabic","spade","spadesuitblack","spadesuitwhite","sparen","squarebelowcmb","squarecc","squarecm","squarediagonalcrosshatchfill","squarehorizontalfill","squarekg","squarekm","squarekmcapital","squareln","squarelog","squaremg","squaremil","squaremm","squaremsquared","squareorthogonalcrosshatchfill","squareupperlefttolowerrightfill","squareupperrighttolowerleftfill","squareverticalfill","squarewhitewithsmallblack","srsquare","ssabengali","ssadeva","ssagujarati","ssangcieuckorean","ssanghieuhkorean","ssangieungkorean","ssangkiyeokkorean","ssangnieunkorean","ssangpieupkorean","ssangsioskorean","ssangtikeutkorean","ssuperior","sterling","sterlingmonospace","strokelongoverlaycmb","strokeshortoverlaycmb","subset","subsetnotequal","subsetorequal","succeeds","suchthat","suhiragana","sukatakana","sukatakanahalfwidth","sukunarabic","summation","sun","superset","supersetnotequal","supersetorequal","svsquare","syouwaerasquare","tabengali","tackdown","tackleft","tadeva","tagujarati","tagurmukhi","taharabic","tahfinalarabic","tahinitialarabic","tahiragana","tahmedialarabic","taisyouerasquare","takatakana","takatakanahalfwidth","tatweelarabic","tau","tav","tavdages","tavdagesh","tavdageshhebrew","tavhebrew","tbar","tbopomofo","tcaron","tccurl","tcedilla","tcheharabic","tchehfinalarabic","tchehinitialarabic","tchehmedialarabic","tcircle","tcircumflexbelow","tcommaaccent","tdieresis","tdotaccent","tdotbelow","tecyrillic","tedescendercyrillic","teharabic","tehfinalarabic","tehhahinitialarabic","tehhahisolatedarabic","tehinitialarabic","tehiragana","tehjeeminitialarabic","tehjeemisolatedarabic","tehmarbutaarabic","tehmarbutafinalarabic","tehmedialarabic","tehmeeminitialarabic","tehmeemisolatedarabic","tehnoonfinalarabic","tekatakana","tekatakanahalfwidth","telephone","telephoneblack","telishagedolahebrew","telishaqetanahebrew","tencircle","tenideographicparen","tenparen","tenperiod","tenroman","tesh","tet","tetdagesh","tetdageshhebrew","tethebrew","tetsecyrillic","tevirhebrew","tevirlefthebrew","thabengali","thadeva","thagujarati","thagurmukhi","thalarabic","thalfinalarabic","thanthakhatlowleftthai","thanthakhatlowrightthai","thanthakhatthai","thanthakhatupperleftthai","theharabic","thehfinalarabic","thehinitialarabic","thehmedialarabic","thereexists","therefore","theta","theta1","thetasymbolgreek","thieuthacirclekorean","thieuthaparenkorean","thieuthcirclekorean","thieuthkorean","thieuthparenkorean","thirteencircle","thirteenparen","thirteenperiod","thonangmonthothai","thook","thophuthaothai","thorn","thothahanthai","thothanthai","thothongthai","thothungthai","thousandcyrillic","thousandsseparatorarabic","thousandsseparatorpersian","three","threearabic","threebengali","threecircle","threecircleinversesansserif","threedeva","threeeighths","threegujarati","threegurmukhi","threehackarabic","threehangzhou","threeideographicparen","threeinferior","threemonospace","threenumeratorbengali","threeoldstyle","threeparen","threeperiod","threepersian","threequarters","threequartersemdash","threeroman","threesuperior","threethai","thzsquare","tihiragana","tikatakana","tikatakanahalfwidth","tikeutacirclekorean","tikeutaparenkorean","tikeutcirclekorean","tikeutkorean","tikeutparenkorean","tilde","tildebelowcmb","tildecmb","tildecomb","tildedoublecmb","tildeoperator","tildeoverlaycmb","tildeverticalcmb","timescircle","tipehahebrew","tipehalefthebrew","tippigurmukhi","titlocyrilliccmb","tiwnarmenian","tlinebelow","tmonospace","toarmenian","tohiragana","tokatakana","tokatakanahalfwidth","tonebarextrahighmod","tonebarextralowmod","tonebarhighmod","tonebarlowmod","tonebarmidmod","tonefive","tonesix","tonetwo","tonos","tonsquare","topatakthai","tortoiseshellbracketleft","tortoiseshellbracketleftsmall","tortoiseshellbracketleftvertical","tortoiseshellbracketright","tortoiseshellbracketrightsmall","tortoiseshellbracketrightvertical","totaothai","tpalatalhook","tparen","trademark","trademarksans","trademarkserif","tretroflexhook","triagdn","triaglf","triagrt","triagup","ts","tsadi","tsadidagesh","tsadidageshhebrew","tsadihebrew","tsecyrillic","tsere","tsere12","tsere1e","tsere2b","tserehebrew","tserenarrowhebrew","tserequarterhebrew","tserewidehebrew","tshecyrillic","tsuperior","ttabengali","ttadeva","ttagujarati","ttagurmukhi","tteharabic","ttehfinalarabic","ttehinitialarabic","ttehmedialarabic","tthabengali","tthadeva","tthagujarati","tthagurmukhi","tturned","tuhiragana","tukatakana","tukatakanahalfwidth","tusmallhiragana","tusmallkatakana","tusmallkatakanahalfwidth","twelvecircle","twelveparen","twelveperiod","twelveroman","twentycircle","twentyhangzhou","twentyparen","twentyperiod","two","twoarabic","twobengali","twocircle","twocircleinversesansserif","twodeva","twodotenleader","twodotleader","twodotleadervertical","twogujarati","twogurmukhi","twohackarabic","twohangzhou","twoideographicparen","twoinferior","twomonospace","twonumeratorbengali","twooldstyle","twoparen","twoperiod","twopersian","tworoman","twostroke","twosuperior","twothai","twothirds","uacute","ubar","ubengali","ubopomofo","ubreve","ucaron","ucircle","ucircumflex","ucircumflexbelow","ucyrillic","udattadeva","udblacute","udblgrave","udeva","udieresis","udieresisacute","udieresisbelow","udieresiscaron","udieresiscyrillic","udieresisgrave","udieresismacron","udotbelow","ugrave","ugujarati","ugurmukhi","uhiragana","uhookabove","uhorn","uhornacute","uhorndotbelow","uhorngrave","uhornhookabove","uhorntilde","uhungarumlaut","uhungarumlautcyrillic","uinvertedbreve","ukatakana","ukatakanahalfwidth","ukcyrillic","ukorean","umacron","umacroncyrillic","umacrondieresis","umatragurmukhi","umonospace","underscore","underscoredbl","underscoremonospace","underscorevertical","underscorewavy","union","universal","uogonek","uparen","upblock","upperdothebrew","upsilon","upsilondieresis","upsilondieresistonos","upsilonlatin","upsilontonos","uptackbelowcmb","uptackmod","uragurmukhi","uring","ushortcyrillic","usmallhiragana","usmallkatakana","usmallkatakanahalfwidth","ustraightcyrillic","ustraightstrokecyrillic","utilde","utildeacute","utildebelow","uubengali","uudeva","uugujarati","uugurmukhi","uumatragurmukhi","uuvowelsignbengali","uuvowelsigndeva","uuvowelsigngujarati","uvowelsignbengali","uvowelsigndeva","uvowelsigngujarati","vadeva","vagujarati","vagurmukhi","vakatakana","vav","vavdagesh","vavdagesh65","vavdageshhebrew","vavhebrew","vavholam","vavholamhebrew","vavvavhebrew","vavyodhebrew","vcircle","vdotbelow","vecyrillic","veharabic","vehfinalarabic","vehinitialarabic","vehmedialarabic","vekatakana","venus","verticalbar","verticallineabovecmb","verticallinebelowcmb","verticallinelowmod","verticallinemod","vewarmenian","vhook","vikatakana","viramabengali","viramadeva","viramagujarati","visargabengali","visargadeva","visargagujarati","vmonospace","voarmenian","voicediterationhiragana","voicediterationkatakana","voicedmarkkana","voicedmarkkanahalfwidth","vokatakana","vparen","vtilde","vturned","vuhiragana","vukatakana","w","wacute","waekorean","wahiragana","wakatakana","wakatakanahalfwidth","wakorean","wasmallhiragana","wasmallkatakana","wattosquare","wavedash","wavyunderscorevertical","wawarabic","wawfinalarabic","wawhamzaabovearabic","wawhamzaabovefinalarabic","wbsquare","wcircle","wcircumflex","wdieresis","wdotaccent","wdotbelow","wehiragana","weierstrass","wekatakana","wekorean","weokorean","wgrave","whitebullet","whitecircle","whitecircleinverse","whitecornerbracketleft","whitecornerbracketleftvertical","whitecornerbracketright","whitecornerbracketrightvertical","whitediamond","whitediamondcontainingblacksmalldiamond","whitedownpointingsmalltriangle","whitedownpointingtriangle","whiteleftpointingsmalltriangle","whiteleftpointingtriangle","whitelenticularbracketleft","whitelenticularbracketright","whiterightpointingsmalltriangle","whiterightpointingtriangle","whitesmallsquare","whitesmilingface","whitesquare","whitestar","whitetelephone","whitetortoiseshellbracketleft","whitetortoiseshellbracketright","whiteuppointingsmalltriangle","whiteuppointingtriangle","wihiragana","wikatakana","wikorean","wmonospace","wohiragana","wokatakana","wokatakanahalfwidth","won","wonmonospace","wowaenthai","wparen","wring","wsuperior","wturned","wynn","xabovecmb","xbopomofo","xcircle","xdieresis","xdotaccent","xeharmenian","xi","xmonospace","xparen","xsuperior","yaadosquare","yabengali","yacute","yadeva","yaekorean","yagujarati","yagurmukhi","yahiragana","yakatakana","yakatakanahalfwidth","yakorean","yamakkanthai","yasmallhiragana","yasmallkatakana","yasmallkatakanahalfwidth","yatcyrillic","ycircle","ycircumflex","ydieresis","ydotaccent","ydotbelow","yeharabic","yehbarreearabic","yehbarreefinalarabic","yehfinalarabic","yehhamzaabovearabic","yehhamzaabovefinalarabic","yehhamzaaboveinitialarabic","yehhamzaabovemedialarabic","yehinitialarabic","yehmedialarabic","yehmeeminitialarabic","yehmeemisolatedarabic","yehnoonfinalarabic","yehthreedotsbelowarabic","yekorean","yen","yenmonospace","yeokorean","yeorinhieuhkorean","yerahbenyomohebrew","yerahbenyomolefthebrew","yericyrillic","yerudieresiscyrillic","yesieungkorean","yesieungpansioskorean","yesieungsioskorean","yetivhebrew","ygrave","yhook","yhookabove","yiarmenian","yicyrillic","yikorean","yinyang","yiwnarmenian","ymonospace","yod","yoddagesh","yoddageshhebrew","yodhebrew","yodyodhebrew","yodyodpatahhebrew","yohiragana","yoikorean","yokatakana","yokatakanahalfwidth","yokorean","yosmallhiragana","yosmallkatakana","yosmallkatakanahalfwidth","yotgreek","yoyaekorean","yoyakorean","yoyakthai","yoyingthai","yparen","ypogegrammeni","ypogegrammenigreekcmb","yr","yring","ysuperior","ytilde","yturned","yuhiragana","yuikorean","yukatakana","yukatakanahalfwidth","yukorean","yusbigcyrillic","yusbigiotifiedcyrillic","yuslittlecyrillic","yuslittleiotifiedcyrillic","yusmallhiragana","yusmallkatakana","yusmallkatakanahalfwidth","yuyekorean","yuyeokorean","yyabengali","yyadeva","zaarmenian","zacute","zadeva","zagurmukhi","zaharabic","zahfinalarabic","zahinitialarabic","zahiragana","zahmedialarabic","zainarabic","zainfinalarabic","zakatakana","zaqefgadolhebrew","zaqefqatanhebrew","zarqahebrew","zayin","zayindagesh","zayindageshhebrew","zayinhebrew","zbopomofo","zcaron","zcircle","zcircumflex","zcurl","zdot","zdotaccent","zdotbelow","zecyrillic","zedescendercyrillic","zedieresiscyrillic","zehiragana","zekatakana","zero","zeroarabic","zerobengali","zerodeva","zerogujarati","zerogurmukhi","zerohackarabic","zeroinferior","zeromonospace","zerooldstyle","zeropersian","zerosuperior","zerothai","zerowidthjoiner","zerowidthnonjoiner","zerowidthspace","zeta","zhbopomofo","zhearmenian","zhebrevecyrillic","zhecyrillic","zhedescendercyrillic","zhedieresiscyrillic","zihiragana","zikatakana","zinorhebrew","zlinebelow","zmonospace","zohiragana","zokatakana","zparen","zretroflexhook","zstroke","zuhiragana","zukatakana","angbracketleftbig","angbracketleftBig","angbracketleftbigg","angbracketleftBigg","angbracketrightBig","angbracketrightbig","angbracketrightBigg","angbracketrightbigg","arrowhookleft","arrowhookright","arrowlefttophalf","arrowleftbothalf","arrownortheast","arrownorthwest","arrowrighttophalf","arrowrightbothalf","arrowsoutheast","arrowsouthwest","backslashbig","backslashBig","backslashBigg","backslashbigg","bardbl","bracehtipdownleft","bracehtipdownright","bracehtipupleft","bracehtipupright","braceleftBig","braceleftbig","braceleftbigg","braceleftBigg","bracerightBig","bracerightbig","bracerightbigg","bracerightBigg","bracketleftbig","bracketleftBig","bracketleftbigg","bracketleftBigg","bracketrightBig","bracketrightbig","bracketrightbigg","bracketrightBigg","ceilingleftbig","ceilingleftBig","ceilingleftBigg","ceilingleftbigg","ceilingrightbig","ceilingrightBig","ceilingrightbigg","ceilingrightBigg","circledotdisplay","circledottext","circlemultiplydisplay","circlemultiplytext","circleplusdisplay","circleplustext","contintegraldisplay","contintegraltext","coproductdisplay","coproducttext","floorleftBig","floorleftbig","floorleftbigg","floorleftBigg","floorrightbig","floorrightBig","floorrightBigg","floorrightbigg","hatwide","hatwider","hatwidest","intercal","integraldisplay","integraltext","intersectiondisplay","intersectiontext","logicalanddisplay","logicalandtext","logicalordisplay","logicalortext","parenleftBig","parenleftbig","parenleftBigg","parenleftbigg","parenrightBig","parenrightbig","parenrightBigg","parenrightbigg","prime","productdisplay","producttext","radicalbig","radicalBig","radicalBigg","radicalbigg","radicalbt","radicaltp","radicalvertex","slashbig","slashBig","slashBigg","slashbigg","summationdisplay","summationtext","tildewide","tildewider","tildewidest","uniondisplay","unionmultidisplay","unionmultitext","unionsqdisplay","unionsqtext","uniontext","vextenddouble","vextendsingle","getDingbatsGlyphsUnicode","a2","a202","a3","a4","a5","a119","a118","a117","a11","a12","a13","a14","a15","a16","a105","a17","a18","a19","a20","a21","a22","a23","a24","a25","a26","a27","a28","a6","a7","a8","a9","a10","a29","a30","a31","a32","a33","a34","a35","a36","a37","a38","a39","a40","a41","a42","a43","a44","a45","a46","a47","a48","a49","a50","a51","a52","a53","a54","a55","a56","a57","a58","a59","a60","a61","a62","a63","a64","a65","a66","a67","a68","a69","a70","a71","a72","a73","a74","a203","a75","a204","a76","a77","a78","a79","a81","a82","a83","a84","a97","a98","a99","a100","a101","a102","a103","a104","a106","a107","a108","a112","a111","a110","a109","a120","a121","a122","a123","a124","a125","a126","a127","a128","a129","a130","a131","a132","a133","a134","a135","a136","a137","a138","a139","a140","a141","a142","a143","a144","a145","a146","a147","a148","a149","a150","a151","a152","a153","a154","a155","a156","a157","a158","a159","a160","a161","a163","a164","a196","a165","a192","a166","a167","a168","a169","a170","a171","a172","a173","a162","a174","a175","a176","a177","a178","a179","a193","a180","a199","a181","a200","a182","a201","a183","a184","a197","a185","a194","a198","a186","a195","a187","a188","a189","a190","a191","a89","a90","a93","a94","a91","a92","a205","a85","a206","a86","a87","a88","a95","a96","getSpecialPUASymbols","mapSpecialUnicodeValues","getUnicodeForGlyph","glyphsUnicodeMap","unicode","nameLen","hexStr","UnicodeRanges","getUnicodeRangeFor","lastPosition","SpecialCharRegExp","CategoryCache","getCharUnicodeCategory","cachedCategory","groups","category","isWhitespace","isZeroWidthDiacritic","isInvisibleFormatMark","clearUnicodeCaches","SEAC_ANALYSIS_ENABLED","FontFlags","FixedPitch","Serif","Symbolic","Script","Nonsymbolic","Italic","AllCap","SmallCap","ForceBold","MacStandardGlyphOrdering","recoverGlyphName","type1FontGlyphMapping","builtInEncoding","glyphNames","charCodeToGlyphId","glyphId","isSymbolicFont","isInternalFont","baseEncodingName","differences","glyphName","standardGlyphName","normalizeFontName","getStdFontMap","Helvetica","Courier","ZapfDingbats","ArialNarrow","ArialBlack","Arial","ArialMT","ArialUnicodeMS","CourierNew","CourierNewPSMT","TimesNewRoman","TimesNewRomanPS","TimesNewRomanPSMT","getFontNameToFileMap","getNonStdFontMap","Calibri","CenturyGothic","ComicSansMS","Impact","LucidaConsole","NuptialScript","SegoeUISymbol","getSerifFonts","Albertus","Aldus","Alexandria","Algerian","Antiqua","Apex","Arno","Aster","Aurora","Baskerville","Bell","Bembo","Benguiat","Bodoni","Bookman","Calisto","Calvert","Capitals","Cambria","Cartier","Caslon","Catull","Centaur","Chaparral","Cheltenham","Clarendon","Clearface","Cochin","Colonna","Constantia","Corona","Ecotype","Egyptienne","Elephant","Excelsior","Fairfield","Folkard","Footlight","FreeSerif","Garamond","Gentium","Georgia","Gloucester","Granjon","Heather","Hercules","Hiroshige","Imprint","Janson","Joanna","Korinna","Lexicon","LiberationSerif","Literaturnaya","Lucida","Melior","Memphis","Miller","Minion","Modern","Palatino","Perpetua","Plantin","Playbill","Renault","Requiem","Rockwell","Roman","Sabon","Scala","Seagull","Sistina","Souvenir","STIX","Sylfaen","Times","Trajan","Utopia","Versailles","Wanted","Weiss","Windsor","XITS","getSymbolsFonts","Dingbats","Wingdings","getGlyphMapForStandardFonts","getSupplementalGlyphMapForArialBlack","getSupplementalGlyphMapForCalibri","getStandardFontName","fontName","stdFontMap","isKnownFontName","ToUnicodeMap","cmap","amend","IdentityToUnicodeMap","firstChar","lastChar","CFFFont","compiler","loadedName","_createBuiltInEncoding","getCharset","getGlyphMapping","cidToGidMap","charsets","composite","invCidToGidMap","defaultEncoding","encodings","getUint32","getInt16","getInt8","getFloat214","getSubroutineBias","numSubrs","parseCmap","segCount","idDelta","idOffset","ids","parseCff","glyphs","gsubrs","isCFFCIDFont","parseGlyfTable","glyf","loca","isGlyphLocationsLong","itemSize","itemDecode","lookupCmap","compileGlyf","cmds","font","quadraticCurveTo","xa","ya","numberOfContours","arg1","arg2","scale01","scale10","subglyph","endPtsOfContours","instructionLength","numberOfPoints","points","repeat","startPoint","endPoint","contour","unshift","compileCharString","charStringCode","bezierCurveTo","stems","stackClean","xb","yb","subrCode","subrsBias","achar","bchar","glyphNameMap","gsubrsBias","NOOP","CompiledFont","compiledGlyphs","compiledCharCodeToGlyphId","getPathJs","fn","compileGlyph","compileGlyphImpl","hasBuiltPath","TrueTypeCompiled","Type2Compiled","cffInfo","FontRendererFactory","indexToLocFormat","unitsPerEm","numTables","tag","getMetrics","getFontBasicMetrics","capHeight","xHeight","ON_CURVE_POINT","X_SHORT_VECTOR","Y_SHORT_VECTOR","REPEAT_FLAG","X_IS_SAME_OR_POSITIVE_X_SHORT_VECTOR","Y_IS_SAME_OR_POSITIVE_Y_SHORT_VECTOR","OVERLAP_SIMPLE","ARG_1_AND_2_ARE_WORDS","ARGS_ARE_XY_VALUES","WE_HAVE_A_SCALE","MORE_COMPONENTS","WE_HAVE_AN_X_AND_Y_SCALE","WE_HAVE_A_TWO_BY_TWO","WE_HAVE_INSTRUCTIONS","GlyfTable","glyfTable","locaTable","DataView","byteOffset","Glyph","getSize","reduce","write","totalSize","ArrayBuffer","isLocationLong","setUint32","setUint16","locaIndex","factors","simple","composites","GlyphHeader","CompositeGlyph","SimpleGlyph","spos","factor","xMiddle","yMin","yMax","setInt16","Contour","xCoordinates","yCoordinates","contours","instructions","endPt","numberOfPt","flag","getUint8","allXCoordinates","pointFlags","endPtsOfContoursIndex","lastCoordinate","lastX","lastY","setUint8","argument1","argument2","transf","writeInt16","writeInt32","writeData","OTF_HEADER_SIZE","OTF_TABLE_ENTRY_SIZE","OpenTypeFileBuilder","sfnt","getSearchParams","entriesCount","entrySize","maxPower2","searchRange","rangeShift","toArray","tablesNames","tableName","tableOffsets","paddedLength","searchParams","checksum","quad","addTable","HINTING_ENABLED","COMMAND_MAP","hstem","vstem","vmoveto","rlineto","hlineto","vlineto","rrcurveto","callsubr","flex","drop","endchar","rmoveto","hmoveto","vhcurveto","hvcurveto","Type1CharString","lsb","flexing","convert","encoded","error","wx","sbx","executeCommand","dy","asb","splice","sby","num2","num1","flexArgs","howManyArgs","command","keepStack","stackLength","EEXEC_ENCRYPT_KEY","CHAR_STRS_ENCRYPT_KEY","isHexDigit","decrypt","discardNumber","c1","c2","decrypted","decryptAscii","digit1","digit2","isSpecial","Type1Parser","encrypted","isBinary","readNumberArray","getToken","token","readInt","readBoolean","prevChar","readCharStrings","lenIV","extractFontProgram","charstrings","privateData","program","blueArray","charString","charStringObject","extractFontHeader","encodingArg","findBlock","streamBytes","startIndex","streamBytesLength","found","getHeaderBlock","suggestedLength","EEXEC_SIGNATURE","streamStartPos","headerBytes","headerBytesLength","getEexecBlock","eexecBytes","Type1Font","PFB_HEADER_SIZE","headerBlockLength","length1","eexecBlockLength","length2","pfbHeader","pfbHeaderPresent","headerBlock","headerBlockParser","eexecBlock","eexecBlockParser","type2Charstrings","getType2Charstrings","getType2Subrs","wrap","getSeacs","charstringsLen","seacMap","type1Charstrings","type1Charstring","type1Subrs","type2Subrs","bbox","charsetArray","fields","field","subrIndex","PRIVATE_USE_AREAS","PDF_GLYPH_SPACE_UNITS","EXPORT_DATA_PROPERTIES","EXPORT_DATA_EXTRA_PROPERTIES","adjustWidths","glyphsWidths","adjustTrueTypeToUnicode","nameRecords","hasIncludedToUnicodeMap","hasEncoding","toUnicode","isWinNameRecord","adjustType1ToUnicode","amendFallbackToUnicode","fallbackToUnicode","originalCharCode","fontChar","accent","vmetric","operatorListId","isSpace","isInFont","int16","writeSignedInt16","signedInt16","writeUint32","int32","string16","safeString16","isTrueTypeFile","isTrueTypeCollectionFile","isOpenTypeFile","isType1File","isCFFFile","getFontFileType","subtype","fileType","fileSubtype","applyStandardFontGlyphMap","glyphMap","buildToFontChar","toFontChar","isMacNameRecord","language","convertCidString","shouldThrow","adjustMapping","hasGlyph","newGlyphZeroId","newMap","toUnicodeExtraMap","usedGlyphIds","privateUseAreaIndex","privateUseOffetStart","nextAvailableFontCharCode","privateUseOffetEnd","isInPrivateArea","fontCharCode","getRanges","fontGetRangesSort","codeIndices","createCmapTable","bmpLength","trailingRangesCount","startCount","endCount","idDeltas","idRangeOffsets","glyphsIds","contiguous","startCode","format314","format31012","header31012","validateOS2Table","os2","selection","usWinAscent","createOS2Table","override","ulUnicodeRange1","ulUnicodeRange2","ulUnicodeRange3","ulUnicodeRange4","firstCharIndex","lastCharIndex","typoAscent","typoDescent","winAscent","winDescent","fixedPitch","createPostTable","createPostscriptName","createNameTable","proto","stringsUnicode","strBufUnicode","platforms","languages","namesRecordCount","nameTable","strOffset","strs","nameRecord","Font","psName","mimetype","disableFontFace","isType3Font","missingFile","_charsCache","_glyphCache","isSerifFont","isSimulatedFlags","baseName","serifFonts","namePart","isMonospace","systemFontInfo","matches","isInvalidPDFjsFont","fallbackName","guessFallback","css","lineHeight","cidEncoding","vmetrics","defaultVMetrics","fallbackToSystemFont","checkAndRepair","isOpenType","renderer","exportData","extraProperties","exportDataProperties","nonStdFontMap","isStandardFont","isMappedToStandardFont","fontBasicMetricsMap","metrics","bold","italic","isNarrow","remeasure","unicodeCharCode","VALID_TABLES","readTables","hhea","hmtx","maxp","post","readTableEntry","previousPosition","readOpenTypeHeader","ttf","entrySelector","readTrueTypeCollectionHeader","ttc","ttcTag","majorVersion","minorVersion","numFonts","offsetTable","dsigTag","dsigLength","dsigOffset","readTrueTypeCollectionData","fontNameParts","fallbackData","potentialHeader","potentialTables","readNameTable","nameEntry","part","readCmapTable","platformId","encodingId","mappings","hasShortCmap","potentialTable","canBreak","useTable","correctlySorted","nextBytes","nextPlatformId","subHeaderKeys","maxSubHeaderKey","subHeaderKey","subHeaders","entryCount","idRangePos","segIndex","offsetsCount","offsetIndex","rangeOffset","nGroups","startCharCode","endCharCode","glyphCode","sanitizeMetrics","headTable","dupFirstEntry","caretOffset","numOfMetrics","macStyle","numOfSidebearings","numMissing","sanitizeGlyph","sourceStart","sourceEnd","destStart","hintsValid","glyphProfile","sizeOfInstructions","contoursCount","flagsCount","instructionsStart","instructionsLength","instructionsEnd","coordinatesLength","xLength","yLength","xyLength","glyphDataLength","sanitizeHead","locaLength","numGlyphsPlusOne","sanitizeGlyphLocations","maxSizeOfInstructions","itemEncode","fontItemDecodeLong","fontItemEncodeLong","fontItemDecode","fontItemEncode","numGlyphsOut","locaDataSize","locaData","oldGlyfData","oldGlyfDataLength","newGlyfData","locaEntries","nextOffset","missingGlyphs","writeOffset","simpleGlyph","firstEntryLength","readPostScriptTable","propertiesObj","maxpNumGlyphs","glyphNameIndexes","customNames","stringLength","records","FORMAT_0_HEADER_LENGTH","numRecords","stringsStart","NAME_RECORD_LENGTH","record","TTOpsStackDeltas","sanitizeTTProgram","ttContext","funcId","lastEndf","lastDeff","callstack","functionsCalled","tooComplexToFollowFunctions","inFDEF","ifLevel","inELSE","op","functionsUsed","functionsStackDeltas","newStackLength","functionsDefined","stackTop","content","foldTTTable","checkInvalidFunctions","maxFunctionDefs","sanitizeTTPrograms","fpgm","prep","cvt","cvtData","ttcData","cffFile","isTrueType","isComposite","scaleFactors","advanceWidth","maxZones","glyphsInfo","metricsOverride","lineGap","isCidToGidMapEmpty","cmapTable","cmapPlatformId","cmapEncodingId","cmapMappings","forcePostTable","unicodeOrCharCode","mapping","glyphZeroId","newMapping","namePrototype","builder","tableTag","newCharCodeToGlyphId","getCharCodes","charCodes","createCharCode","baseGlyphName","accentGlyphName","baseGlyphId","accentGlyphId","accentOffset","baseFontCharCode","accentFontCharCode","tan","fontFieldsHmtx","cffWidths","spaceWidth","possibleSpaceReplacements","glyphUnicode","_charToGlyph","widthCode","fromCodePoint","charsToGlyphs","chars","getCharPositions","positions","glyphCacheValues","encodeString","buffers","currentBuf","hasCurrentBufErrors","getCharCode","charCodeLength","ErrorFont","ShadingType","FUNCTION_BASED","AXIAL","RADIAL","FREE_FORM_MESH","LATTICE_FORM_MESH","COONS_PATCH_MESH","TENSOR_PATCH_MESH","Pattern","parseShading","shading","res","RadialAxialShading","MeshShading","DummyShading","BaseShading","SMALL_NUMBER","getIR","coordsArr","shadingType","t0","domainArr","extendStart","extendEnd","extendArr","r1","r2","distance","hypot","fnObj","createFromArray","NUMBER_OF_SAMPLES","step","colorStops","rgbColor","iBase","rgbBase","cssColorBase","iPrev","rgbPrev","maxSlopeR","maxSlopeG","maxSlopeB","minSlopeR","minSlopeG","minSlopeB","run","slopesExist","cssColor","background","r0","MeshStreamReader","tmpCompsBuf","csNumComps","colorSpace","tmpCsCompsBuf","colorFn","hasData","align","readFlag","bitsPerFlag","readCoordinate","bitsPerCoordinate","yi","readComponents","ci","bCache","buildB","lut","t_","getB","clearPatternCaches","MIN_SPLIT_PATCH_CHUNKS_AMOUNT","MAX_SPLIT_PATCH_CHUNKS_AMOUNT","TRIANGLE_DENSITY","coords","figures","decodeContext","patchMesh","_decodeType4Shading","verticesPerRow","_decodeType5Shading","_decodeType6Shading","_decodeType7Shading","_updateBounds","_buildFigureFromPatch","_packData","operators","ps","verticesLeft","coord","tmp1","tmp2","tmp3","tmp4","figure","figureMinX","figureMinY","figureMaxX","figureMaxY","splitXBy","splitYBy","figureCoords","figureColors","cl","cr","c0","c3","bRow","bCol","newColor","maxY","coordsPacked","xy","colorsPacked","getTilingPatternIR","operatorList","xstep","ystep","paintType","tilingType","CalibriBoldFactors","CalibriBoldMetrics","CalibriBoldItalicFactors","CalibriBoldItalicMetrics","CalibriItalicFactors","CalibriItalicMetrics","CalibriRegularFactors","CalibriRegularMetrics","HelveticaBoldFactors","HelveticaBoldMetrics","HelveticaBoldItalicFactors","HelveticaBoldItalicMetrics","HelveticaItalicFactors","HelveticaItalicMetrics","HelveticaRegularFactors","HelveticaRegularMetrics","LiberationSansBoldWidths","LiberationSansBoldMapping","LiberationSansBoldItalicWidths","LiberationSansBoldItalicMapping","LiberationSansItalicWidths","LiberationSansItalicMapping","LiberationSansRegularWidths","LiberationSansRegularMapping","MyriadProBoldFactors","MyriadProBoldMetrics","MyriadProBoldItalicFactors","MyriadProBoldItalicMetrics","MyriadProItalicFactors","MyriadProItalicMetrics","MyriadProRegularFactors","MyriadProRegularMetrics","SegoeuiBoldFactors","SegoeuiBoldMetrics","SegoeuiBoldItalicFactors","SegoeuiBoldItalicMetrics","SegoeuiItalicFactors","SegoeuiItalicMetrics","SegoeuiRegularFactors","SegoeuiRegularMetrics","getXFAFontMap","baseWidths","baseMapping","getXfaFontName","fontMap","getXfaFontWidths","rescaledBaseWidths","currentArray","newWidths","charUnicode","unicode1","unicode2","getXfaFontDict","descriptor","systemInfo","PostScriptParser","nextToken","accept","expect","PostScriptTokenTypes","LBRACE","parseBlock","RBRACE","NUMBER","OPERATOR","parseCondition","conditionLocation","IF","jumpLocation","endOfTrue","IFELSE","PostScriptToken","opCache","getOperator","PostScriptLexer","BaseLocalCache","_onlyRefs","onlyRefs","_nameRefMap","_imageMap","_imageCache","LocalImageCache","LocalColorSpaceCache","LocalFunctionCache","LocalGStateCache","LocalTilingPatternCache","RegionalImageCache","GlobalImageCache","NUM_PAGES_THRESHOLD","MIN_IMAGES_TO_CACHE","MAX_BYTE_SIZE","_refCache","_byteSize","byteSize","imageData","_cacheLimitReached","shouldCache","pageIndexSet","addByteSize","setData","onlyData","PDFFunctionFactory","cachedFunction","parsedFunction","PDFFunction","parseArray","fnRef","localFunction","_localFunctionCache","toNumberArray","getSampleArray","outputSize","bps","sampleMul","strBytes","strIdx","typeNum","constructSampled","constructInterpolated","constructStiched","constructPostScript","fnArray","toMultiArray","interpolate","xmin","xmax","ymin","ymax","domain","inputSize","encode","samples","constructSampledFn","cubeVertices","cubeN","Float64Array","cubeVertex","domain_2i","domain_2i_1","size_i","e0","n0","n1","rj","constructInterpolatedFn","fns","constructStichedFn","constructStichedFromIRClip","dmin","dmax","rmin","rmax","PostScriptCompiler","numOutputs","numInputs","evaluator","PostScriptEvaluator","MAX_CACHE_SIZE","cache_available","constructPostScriptFn","cachedValue","execute","stackIndex","bound","isPDFFunction","fnDict","PostScriptStack","MAX_STACK_SIZE","initialStack","copy","roll","counter","operator","atan2","cos","log10","sin","AstNode","visit","AstArgument","visitArgument","AstLiteral","visitLiteral","AstBinaryOperation","visitBinaryOperation","AstMin","arg","visitMin","AstVariable","visitVariable","AstVariableDefinition","variable","visitVariableDefinition","ExpressionBuilderVisitor","parts","literal","operation","definition","buildAddOperation","buildMulOperation","buildSubOperation","buildMinOperation","lastRegister","ast1","ast2","tmpVar","instruction","statementBuilder","expr","baseTypes","arabicTypes","isOdd","isEven","findUnequal","setValues","reverseValues","createBidiText","isLTR","dir","bidi","startLevel","strLength","numBidi","charType","sor","eor","lastType","before","after","highestLevel","lowestOddLevel","NORMAL","style","BOLD","ITALIC","BOLDITALIC","substitutionMap","local","ultimate","alias","fallback","fontAliases","getStyleToAppend","generateFont","localFontPath","useFallback","usePath","append","extra","substitution","aliasAppend","assign","fallbackInfo","fallbackUltimate","getFontSubstitution","systemFontCache","idFactory","baseFontName","standardFontName","substitutionInfo","subst","mustAddBaseFont","getDocId","createFontId","MIN_IMAGE_DIM","MAX_IMAGE_DIM","MAX_ERROR","ImageResizer","imgData","isMask","_imgData","_isMask","needsToBeResized","_goodSquareLength","MAX_DIM","area","_hasMaxArea","MAX_AREA","_areGoodDims","_guessMax","maxArea","setMaxArea","canvas","ctx","getContext","fillRect","opacity","getImageData","tolerance","defaultHeight","middle","createImage","_createImage","_encodeBMP","blob","Blob","bitmapPromise","createImageBitmap","minFactor","firstFactor","steps","newWidth","newHeight","prevWidth","prevHeight","drawImage","transferToImageBitmap","bitPerPixel","colorTable","maskTable","compression","rowLen","newData","extraLen","view","headerLength","fileLength","bmpData","setInt32","SEED","MASK_HIGH","MASK_LOW","MurmurHash3_64","seed","update","blockCounts","tailLength","dataUint32","k1","k2","C1","C2","C1_LOW","C2_LOW","hexdigest","addState","parentState","pattern","checkFn","iterateFn","processFn","InitialState","iterateInlineImageGroup","iFirstSave","iCurr","foundInlineImageGroup","MIN_IMAGES_IN_INLINE_IMAGES_BLOCK","MAX_IMAGES_IN_INLINE_IMAGES_BLOCK","MAX_WIDTH","IMAGE_PADDING","argsArray","curr","iFirstTransform","iFirstPIIXO","maxLineHeight","currentX","currentY","img","imgWidth","imgHeight","putImageData","ImageData","iterateImageMaskGroup","foundImageMaskGroup","MIN_IMAGES_IN_MASKS_BLOCK","MAX_IMAGES_IN_MASKS_BLOCK","MAX_SAME_IMAGES_IN_MASKS_BLOCK","iFirstPIMXO","isSameImage","iTransform","transformArgs","firstPIMXOArg0","firstTransformArg0","firstTransformArg1","firstTransformArg2","firstTransformArg3","iPIMXO","images","maskParams","iterateImageGroup","iFirstPIXO","firstPIXOArg0","MIN_IMAGES_IN_BLOCK","MAX_IMAGES_IN_BLOCK","iterateShowTextGroup","iFirstSetFont","firstSetFontArg0","firstSetFontArg1","MIN_CHARS_IN_BLOCK","MAX_CHARS_IN_BLOCK","iFirstBeginText","iFirstSetTextMatrix","iFirstShowText","iFirstEndText","iFirst","iEndText","NullOptimizer","_optimize","flush","QueueOptimizer","lastProcessed","OperatorList","CHUNK_SIZE","CHUNK_SIZE_ABOUT","intent","streamSink","_streamSink","optimizer","dependencies","_totalLength","_resolved","ready","addOp","addImageOps","optionalContent","addDependency","addDependencies","addOpList","opList","_transfers","transfers","cached","separateAnnots","enqueue","decodeAndClamp","addend","coefficient","resizeImageMask","PDFImage","image","isInline","smask","imageMask","matte","needsDecode","decodeCoefficients","decodeAddends","isIndexed","maskDict","buildImage","smaskData","maskData","createRawMask","imgArray","imageIsFromDecodeStream","computedLength","haveFullData","createMask","isSingleOpaquePixel","createImageData","decodeBuffer","getComponents","bufferPos","rowComps","loop1End","loop2End","remainingBits","fillOpacity","rgbaBuf","alphaBuf","sw","sh","fillGrayBuffer","imageOffset","maskOffset","undoPreblend","matteRgb","matteR","matteG","matteB","mustBeResized","getImageBytes","createBitmap","imageLength","isHandled","rgba","internal","maybeUndoPreblend","canvasImgData","imageBytes","DefaultPartialEvaluatorOptions","freeze","maxImageSize","ignoreErrors","canvasMaxAreaInBytes","fontExtraProperties","useSystemFonts","cMapUrl","standardFontDataUrl","PatternType","TILING","SHADING","TEXT_CHUNK_BATCH_SIZE","deferred","normalizeBlendMode","parsingArray","maybeBM","incrementCachedImageMaskCount","TimeSlotManager","TIME_SLOT_DURATION_MS","CHECK_TIME_EVERY","checked","endTime","now","PartialEvaluator","handler","fontCache","builtInCMapCache","standardFontDataCache","globalImageCache","parsingType3Font","_regionalImageCache","_fetchBuiltInCMapBound","_pdfFunctionFactory","newOptions","newEvaluator","hasBlendModes","nonBlendModesSet","nodes","graphicStates","graphicState","bm","xObjects","xObject","xResources","response","ok","statusText","sendWithPromise","fetchStandardFontData","standardFontNameToFileName","filename","buildFormXObject","xobj","task","initialState","groupOptions","parseMarkedContentProps","group","isolated","knockout","groupSubtype","parseColorSpace","backdrop","getOperatorList","_sendImgData","cacheGlobally","buildPaintImageXObject","localImageCache","imageRef","bitStrideLength","cacheData","createObjId","dataLen","SMALL_IMAGE_DIMENSIONS","imageObj","localLength","handleSMask","stateManager","smaskContent","smaskOptions","transferObj","transferFn","transferMap","handleTransferFunction","tr","transferArray","transferMaps","numFns","numEffectfulFns","handleTilingType","patternDict","localTilingPatternCache","tilingOpList","patternResources","operatorListIR","tilingPatternIR","handleSetFont","fontArgs","fontRef","fallbackFontDict","loadFont","translated","loadType3Data","type3Dependencies","TranslatedFont","evaluatorOptions","handleText","isAddToPathSet","textRenderingMode","fillColorSpace","buildFontPaths","ensureStateFont","gState","localGStateCache","gStateRef","isSimpleGState","gStateObj","errorFont","fontRes","type3FontRefs","fontCapability","preEvaluatedFont","preEvaluateFont","hash","fontRefIsRef","fontID","aliasFontRef","translateFont","translatedFont","buildPath","parsingText","lastIndex","Infinity","opArgs","localShadingPatternCache","patternIR","handleColorN","patternName","rawPattern","localTilingPattern","_parseVisibilityExpression","nestingCounter","currentResult","MAX_NESTING","object","nestedResult","contentProperties","optionalContentType","expression","optionalContentGroups","groupIds","ocg","policy","EvalState","self","xobjs","StateManager","preprocessor","EvaluatorPreprocessor","timeSlotManager","closePendingRestoreOPS","argument","savedStatesDepth","promiseBody","all","ensureNotTerminated","stop","isValidName","localImage","resolveXObject","rejectXObject","globalImage","fontSize","combinedGlyphs","arrItem","strokeColorSpace","shadingRes","patternId","localGStateObj","resolveGState","rejectGState","extGState","getTextContent","includeMarkedContent","sink","seenStyles","viewBox","markedContentData","disableNormalization","TextState","textContent","styles","textContentItem","initialized","totalHeight","prevTransform","textAdvanceScale","spaceInFlowMin","spaceInFlowMax","trackingSpaceMin","negativeSpaceMax","notASpace","hasEOL","twoLastChars","twoLastCharsPos","saveLastChar","nextPos","ret","shouldAddWhitepsace","resetLastChars","TRACKING_SPACE_FACTOR","NOT_A_SPACE_FACTOR","NEGATIVE_SPACE_FACTOR","SPACE_IN_FLOW_MIN_FACTOR","SPACE_IN_FLOW_MAX_FACTOR","VERTICAL_SHIFT_RATIO","showSpacedTextBuffer","emptyXObjectCache","emptyGStateCache","textState","pushWhitespace","getCurrentTextTransform","tsm","textHScale","textRise","isCharBBox","glyphHeight","ctm","textMatrix","ensureTextContentItem","fontSubstitution","fontSubstitutionLoadedName","trm","scaleLineX","textLineMatrix","scaleCtmX","updateAdvanceScale","scaleFactor","runBidiTransform","textChunk","text","bidiResult","applyInverseRotation","compareWithLastPosition","glyphWidth","currentTransform","lastPosX","lastPosY","rotate","advanceY","advanceX","textOrientation","appendEOL","flushTextContentItem","addFakeSpaces","buildTextContentItem","extraSpacing","charSpacing","translateTextMatrix","scaledDim","wordSpacing","enqueueChunk","batch","previousState","fontNameArg","fontSizeArg","leading","translateTextLineMatrix","carriageReturn","setTextLineMatrix","spaceFactor","elements","currentState","xObjStateManager","sinkWrapper","enqueueInvoked","desiredSize","gStateFont","mcid","getPageObjId","extractDataStructures","baseDict","cidToGidBytes","toUnicodePromise","readToUnicode","cidSystemInfo","registry","ordering","supplement","diffEncoding","nonEmbeddedFont","isSymbolsFontName","isNonsymbolicFont","buildToUnicode","builtToUnicode","readCidToGidMap","_simpleFontToUnicode","forceGlyphs","codeStr","ucs2CMapName","ucs2CMap","ucs2","cmapObj","glyphsData","glyphID","extractWidths","glyphsVMetrics","getBaseFontMetrics","buildCharCodeToWidth","firstWidth","fontNameWoStyle","monospace","lookupName","Metrics","glyphWidths","widthsByGlyphName","df","diffLength","diffBuf","diffEntry","uint8array","widthsBuf","compositeWidths","subWidthsBuf","newProperties","baseFont","fontNameStr","baseFontStr","fontFile","length3","glyphScaleFactors","subtypeEntry","_evaluatorOptions","type3Loaded","sent","type3Evaluator","loadCharProcsPromise","charProcs","fontResources","charProcOperatorList","fontBBoxSize","glyphStream","_removeType3ColorOperators","dummyOperatorList","_bbox","charBBox","charBBoxSize","gStateKey","stateStack","old","opMap","ri","gs","cm","BT","ET","Tc","Tw","Tz","TL","Tf","Tr","Ts","Td","TD","Tm","Tj","TJ","d0","d1","CS","SC","SCN","sc","scn","RG","rg","BI","ID","EI","Do","MP","BMC","BDC","EMC","BX","EX","BM","BD","true","fa","fal","fals","false","nul","null","MAX_INVALID_PATH_OPS","nonProcessedArgs","_isPathOp","_numInvalidPathOPS","opSpec","argsLength","preprocessCommand","DefaultAppearanceEvaluator","fontColor","parseDefaultAppearance","AppearanceStreamEvaluator","breakLoop","_localColorSpaceCache","parseAppearanceStream","getPdfColor","isFill","createDefaultAppearance","FakeUnicodeFont","ctxMeasure","_fontNameId","toUnicodeRef","_toUnicodeRef","toUnicodeStream","toUnicodeDict","getNewPersistentRef","fontDescriptorRef","_fontDescriptorRef","fontDescriptor","descendantFontRef","descendantFont","currentWidths","baseFontRef","_createContext","createFontResources","measureText","createAppearance","bgColor","strokeAlpha","lineWidth","hscale","vscale","lineDescent","maxHeight","fscale","newFontSize","vShift","appearance","appearanceStreamDict","ap","NameOrNumberTree","root","_type","getAll","kids","kid","kidsOrEntries","loopCount","MAX_LEVELS","limits","currentKey","NameTree","NumberTree","clearGlobalCaches","pickPlatformItem","FileSpec","fs","description","contentAvailable","_filename","contentRef","fileObj","serializable","XMLParserErrorCode","NoError","EndOfDocument","UnterminatedCdat","UnterminatedXmlDeclaration","UnterminatedDoctypeDeclaration","UnterminatedComment","MalformedElement","OutOfMemory","UnterminatedAttributeValue","UnterminatedElement","ElementNeverBegun","isWhitespaceString","XMLParserBase","_resolveEntities","onResolveEntity","_parseContent","attributes","skipWs","attrName","attrValue","attrEndChar","attrEndIndex","parsed","_parseProcessingInstruction","attrStart","parseXml","ch2","onEndElement","onPi","onComment","onCdata","q2","complexDoctype","doctypeContent","onDoctype","isClosed","onBeginElement","onText","SimpleDOMNode","nodeName","nodeValue","firstChild","childNodes","nextSibling","parentNode","child","hasChildNodes","searchNode","paths","siblingPos","dump","attribute","SimpleXMLParser","hasAttributes","lowerCaseName","_currentFragment","_stack","_errorCode","_hasAttributes","_lowerCaseName","parseFromString","documentElement","lastElement","childNode","MetadataParser","_repair","xmlDocument","_metadataMap","_data","replace","d2","d3","charBuf","_getSequence","_parseArray","seqNode","trim","rdf","desc","parsedData","rawData","DecryptStream","nextChunk","hasMoreData","ARCFourCipher","keyLength","encryptBlock","decryptBlock","encrypt","calculateMD5","calculateMD5Closure","h0","h3","padded","rotateArg","Word64","highInteger","lowInteger","and","word","xor","or","shiftRight","places","shiftLeft","rotateRight","not","lowAdd","highAdd","copyTo","calculateSHA256","calculateSHA256Closure","rotr","maj","sigmaPrime","littleSigma","littleSigmaPrime","h4","h5","h6","h7","calculateSHA512","calculateSHA512Closure","mode384","calculateSHA384","NullCipher","AESBaseCipher","_s","_inv_s","_mix","_mixCol","bufferPosition","_expandKey","cipherKey","_decrypt","_keySize","_cyclesOfRepetition","s0","_encrypt","_decryptBlock2","finalize","sourceLength","iv","plain","_key","lastBlock","psLen","cipher","AES128Cipher","_rcon","rcon","t3","t4","AES256Cipher","PDF17","checkOwnerPassword","password","ownerValidationSalt","userBytes","ownerPassword","hashData","checkUserPassword","userValidationSalt","userPassword","getOwnerKey","ownerKeySalt","ownerEncryption","getUserKey","userKeySalt","userEncryption","PDF20","_hash","combinedLength","combinedArray","remainder","CipherTransform","stringCipherConstructor","streamCipherConstructor","StringCipherConstructor","StreamCipherConstructor","cipherTransformDecryptStream","encryptString","strLen","pad","CipherTransformFactory","defaultPasswordBytes","createEncryptionKey20","revision","uBytes","perms","passwordLength","pdfAlgorithm","prepareKeyData","fileId","encryptMetadata","hashDataSize","keyLengthInBytes","encryptionKey","checkData","derivedKey","decodeUserPassword","buildObjectKey","isAes","buildCipherConstructor","cf","cryptFilter","cfm","algorithm","cfDict","streamCryptoName","handlerDict","ownerBytes","fileIdBytes","passwordBytes","decodedPassword","stmf","strf","eff","createCipherTransform","cipherConstructor","writeObject","writeDict","writeStream","writeArray","writeValue","fetchIfRefAsync","isFilterZeroFlateDecode","MIN_LENGTH_FOR_COMPRESSING","CompressionStream","writer","getWriter","close","Response","readable","newFilter","newParams","writeInt","writeString","computeMD5","filesize","xrefInfo","time","md5Buffer","md5BufferLen","writeXFADataForAcroform","newRefs","xml","xfa","nodePath","updateAcroform","acroForm","acroFormRef","hasXfa","hasXfaDatasetsEntry","xfaDatasetsRef","needAppearances","newXfa","updateXFA","xfaData","datasets","incrementalUpdate","originalData","refForXrefTable","newRef","baseOffset","startXRef","rootRef","infoRef","encryptRef","xrefTableData","indexes","maxOffset","fileIds","md5","sizes","structSize","tableLength","bufferLen","footer","objOffset","MAX_DEPTH","StructElementType","PAGE_CONTENT","STREAM_CONTENT","OBJECT","ANNOTATION","ELEMENT","StructTreeRoot","rootDict","roleMap","structParentIds","init","readRoleMap","addIdToPage","pageRef","addAnnotationIdToPage","roleMapDict","canCreateStructureTree","catalogRef","pdfManager","nextKey","hasNothingToUpdate","getPage","accessibilityData","parentTreeId","createStructureTree","catalog","cloneDict","structTreeRootRef","getNewTemporaryRef","structTreeRoot","parentTreeRef","parentTree","nums","writeKids","canUpdateStructTree","numberTree","pageDict","collectParents","structTreeParent","updateStructureTree","numsRef","kidsRef","newNextkey","objr","isPageRef","title","lang","expanded","actualText","tagRef","tagDict","updateParentTag","newTagRef","fallbackRef","objDict","idToElement","structTreeParentId","parentArray","updateElement","pageKid","kidRef","parentRef","saveParentDict","parentKids","parentKidsRef","StructElementNode","parseKids","role","nameObj","pageObjId","objRef","parseKid","StructElement","kidDict","refObjId","StructTreePage","addNode","elemId","addTopLevelNode","nodeToSerializable","kidElement","fetchDestination","fetchRemoteDest","JSON","stringify","Catalog","_catDict","getCatalogObj","toplevelPagesDict","_actualNumPages","pageKidsCountCache","pageIndexCache","needsRendering","collection","metadata","streamRef","markInfo","_readMarkInfo","Marked","UserProperties","Suspects","structTree","_readStructTreeRoot","rawObj","pagesObj","documentOutline","_readDocumentOutline","blackColor","outlineDict","parseDestDictionary","destDict","resultObj","docBaseUrl","docAttachments","attachments","outlineItem","attachment","unsafeUrl","setOCGState","permissions","_readPermissions","trailer","optionalContentConfig","config","defaultConfig","groupsData","groupRefs","groupRef","_readOptionalContentConfig","contentGroupRefs","parseOnOff","refs","onParsed","parseOrder","nestedLevels","parsedOrderRefs","nestedOrder","parseNestedOrder","hiddenGroups","MAX_NESTED_LEVELS","nestedName","creator","baseState","on","off","setActualNumPages","hasActualNumPages","_pagesCount","destinations","_readDests","dests","getDestination","allDest","pageLabels","_readPageLabels","prefix","currentLabel","labelDict","st","LIMIT","A_UPPER_CASE","A_LOWER_CASE","baseCharCode","letterIndex","character","pageLayout","pageMode","viewerPreferences","prefs","prefValue","isValid","every","page","openAction","nameTree","xfaImages","_collectJavaScript","javaScript","appendIfJavaScriptDict","jsDict","jsActions","fontFallback","translatedFonts","cleanup","manuallyTriggered","getPageDict","nodesToVisit","visitedNodes","pagesRef","currentPageIndex","currentNode","getAllPageDicts","posInKids","addPageDict","addPageError","queueItem","kidObj","getPageIndex","cachedPageIndex","pagesBeforeRef","kidPromises","uri","href","actionType","actionName","include","resetForm","urlDict","remoteDest","target","relationship","attachmentDest","namedAction","preserveRB","stateArr","jsAction","jsURL","mayHaveChildren","addChildren","rawValue","ObjectLoader","refSet","load","_walk","nodesToRevisit","pendingRequests","foundMissingData","$acceptWhitespace","$addHTML","$appendChild","$childrenToHTML","$clean","$cleanPage","$cleanup","$clone","$consumed","$content","$data","$dump","$extra","$finalize","$flushHTML","$getAttributeIt","$getAttributes","$getAvailableSpace","$getChildrenByClass","$getChildrenByName","$getChildrenByNameIt","$getDataValue","$getExtra","$getRealChildrenByNameIt","$getChildren","$getContainedChildren","$getNextPage","$getSubformParent","$getParent","$getTemplateRoot","$globalData","$hasSettableValue","$ids","$indexOf","$insertAt","$isCDATAXml","$isBindable","$isDataValue","$isDescendent","$isNsAgnostic","$isSplittable","$isThereMoreWidth","$isTransparent","$isUsable","$lastAttribute","$namespaceId","$nodeName","$nsAttributes","$onChild","$onChildCheck","$onText","$pushGlyphs","$popPara","$pushPara","$removeChild","$root","$resolvePrototypes","$searchNode","$setId","$setSetAttributes","$setValue","$tabIndex","$text","$toPages","$toHTML","$toString","$toStyle","$uid","$buildXFAObject","NamespaceIds","ns","connectionSet","form","localeSet","pdf","sourceSet","stylesheet","xdc","xdp","xfdf","xhtml","xmpmeta","dimConverters","pt","mm","in","measurementPattern","stripQuotes","getInteger","validate","getFloat","getKeyword","getStringOption","getMeasurement","def","valueStr","unit","conv","getRatio","den","getRelevant","excluded","viewname","getColor","getBBox","HTMLResult","FAILURE","EMPTY","success","html","breakNode","isBreak","FontFinder","pdfFonts","fonts","defaultFont","reallyMissingFonts","pdfFont","addPdfFont","regular","bolditalic","myriad","missing","endsWith","getDefault","find","maybe","family","selectFont","xfaFont","typeface","posture","real","fontFinder","lineNoGap","WIDTH_FACTOR","FontInfo","margin","paraMargin","letterSpacing","FontSelector","defaultXfaFont","defaultParaMargin","defaultLineHeight","pushData","lastFont","fontInfo","popFont","topFont","TextMeasure","fontSelector","extraHeight","addPara","addString","fontLineHeight","noGap","firstLineHeight","fallbackWidth","encodedLine","compute","lastSpacePos","lastSpaceWidth","currentLineWidth","currentLineHeight","isBroken","isFirstLine","isEOL","namePattern","indexPattern","dot","dotDot","dotHash","dotBracket","dotParen","shortcuts","host","dataWindow","event","somCache","WeakMap","parseExpression","dotDotAllowed","noExpr","cacheName","formCalc","container","useCache","isQualified","isXFAObject","isXFAObjectArray","isFinite","flat","createDataNode","some","createNodes","_applyPrototype","_attributes","_attributeNames","_children","_cloneAttribute","_dataValue","_defaultValue","_filteredChildrenGenerator","_getPrototype","_getUnsetAttributes","_hasChildren","_max","_options","_parent","_resolvePrototypesHelper","_setAttributes","_validator","uid","NS_DATASETS","XFAObject","nsId","hasChildren","XmlObject","XFAObjectArray","hasOwnProperty","para","paraStack","clean","getPrototypeOf","getOwnPropertyNames","dumped","availableSpace","failingNode","generator","protoAttributes","allAttr","setAttr","ancestors","use","usehref","somExpression","protoProto","newAncestors","unsetAttrName","protoValue","$symbol","getOwnPropertySymbols","clonedChild","allTransparent","XFAAttribute","dataNode","tagName","utf8TagName","utf8Name","skipConsumed","hasNS","$ns","$name","ContentObject","OptionObject","StringObject","IntegerObject","validator","Option01","Option10","measureToString","converters","anchorType","colSpan","columnWidths","currentColumn","transformOrigin","presence","visibility","display","hAlign","textAlign","alignSelf","setMinMaxDimensions","minW","maxW","minH","layoutText","measure","layoutNode","marginH","marginV","leftInset","rightInset","topInset","bottomInset","spaceAbove","spaceBelow","marginLeft","marginRight","exData","contentType","computeBbox","fixDimensions","layoutClass","toStyle","newStyle","createWrapper","wrapper","class","border","insets","insetsH","insetsW","hand","classNames","isPrintOnly","fixTextIndent","indent","textIndent","padding","setAccess","access","relevant","getCurrentPara","setPara","nodeStyle","valueStyle","flexDirection","vAlign","justifyContent","paraStyle","setFontFamily","fixURL","createLine","flushHTML","htmlFromFailing","addHTML","attempt","numberInLine","getAvailableSpace","getTransformedBBox","centerX","centerY","checkDimensions","firstUnsplittable","ERROR","noLayoutFailure","currentContentArea","TEMPLATE_NS_ID","SVG_NS","MAX_ATTEMPTS_FOR_LRTB_LAYOUT","MAX_EMPTY_PAGES","DEFAULT_TAB_INDEX","HEADING_PATTERN","MIMES","IMAGES_HEADERS","getBorderDims","borderExtra","hasMargin","_setValue","templateNode","Value","getContainedChildren","SubformSet","isRequired","nullTest","setTabIndex","traversal","applyAssist","assist","assistTitle","ariaRole","ariaLevel","ariaLabel","speak","toolTip","valueToHtml","setFirstUnsplittable","unsetFirstUnsplittable","handleBreak","targetType","currentPageArea","PageArea","startNew","ContentArea","pageArea","nextPageArea","contentAreas","contentArea","indexForCurrent","indexForTarget","handleOverflow","extraNode","saved","savedMethod","AppearanceFilter","Arc","circular","startAngle","sweepAngle","edge","Edge","edgeStyle","strokeWidth","thickness","xmlns","overflow","cx","cy","rx","ry","largeArc","vectorEffect","preserveAspectRatio","svg","Area","extras","draw","exObject","exclGroup","subform","subformSet","xfaName","Assist","Barcode","charEncoding","dataColumnCount","dataPrep","dataRowCount","endChar","errorCorrectionLevel","moduleHeight","moduleWidth","printCheckDigit","rowColumnRatio","startChar","textLocation","truncate","upsMode","wideNarrowRatio","Bind","picture","BindItems","connection","labelRef","valueRef","Bookend","leader","BooleanElement","Border","break","corner","edges","defaultEdge","edgeStyles","radius","cornerStyles","borderRadius","borderStyle","borderWidth","borderColor","Break","afterTarget","beforeTarget","bookendLeader","bookendTrailer","overflowLeader","overflowTarget","overflowTrailer","BreakAfter","script","BreakBefore","Button","highlight","grandpa","htmlButton","activity","Calculate","Caption","placement","reserve","savedReserve","Certificate","Certificates","credentialServerPolicy","urlPolicy","encryption","issuers","keyUsage","oids","signing","subjectDNs","CheckButton","mark","shape","className","groupId","exportedValue","fieldId","dataId","ExclGroup","xfaOn","xfaOff","required","ChoiceList","commitOn","open","textEntry","ui","optionStyle","displayedIndex","saveIndex","displayed","selected","hidden","selectAttributes","multiple","Color","cSpace","Comb","numberOfCells","Connect","usage","Corner","inverted","DateElement","DateTime","DateTimeEdit","hScrollPolicy","picker","comb","Decimal","fracDigits","leadDigits","DefaultUi","Desc","boolean","dateTime","decimal","float","integer","DigestMethod","DigestMethods","digestMethod","Draw","locale","caption","keep","setProperty","savedW","savedH","cap","linecap","Encoding","Encodings","Encrypt","certificate","EncryptData","manifest","Encryption","EncryptionMethod","EncryptionMethods","encryptionMethod","Event","listen","encryptData","signData","submit","ExData","maxLength","rid","transferEncoding","ExObject","archive","classId","codeBase","codeType","accessKey","connect","_isSplittable","isSplittable","isLrTb","maxRun","Execute","executeType","runAt","Extras","Field","bindItems","Ui","TextEdit","textEdit","checkButton","choiceList","borderDims","uiW","uiH","tabindex","aElement","button","imageEdit","htmlValue","maxChars","numericEdit","captionHeight","inputHeight","Fill","linear","radial","solid","stipple","ggrandpa","propName","altPropName","backgroundColor","Rectangle","addRevocationInfo","appearanceFilter","certificates","digestMethods","encryptionMethods","lockDocument","mdp","reasons","timeStamp","Float","baselineShift","fontHorizontalScale","fontVerticalScale","kerningMode","lineThrough","lineThroughPeriod","overlinePeriod","underline","underlinePeriod","usedTypefaces","backgroundClip","verticalAlign","fontKerning","textDecoration","textDecorationStyle","fontStyle","Format","Handler","Hyphenation","excludeAllCaps","excludeInitialCap","hyphenate","pushCharacterCount","remainCharacterCount","wordCharacterCount","Image","aspect","atob","objectFit","createObjectURL","ImageEdit","Integer","Issuers","Items","Keep","intact","KeyUsage","crlSign","dataEncipherment","decipherOnly","digitalSignature","encipherOnly","keyAgreement","keyCertSign","keyEncipherment","nonRepudiation","Line","slope","Linear","startColor","endColor","LockDocument","Manifest","Margin","Mdp","signatureType","Medium","imagingBBox","long","orientation","short","stock","trayIn","trayOut","Message","NumericEdit","Occur","initial","originalMin","PageSet","Template","Oid","Oids","oid","Overflow","addLeader","addTrailer","blankOrNotBlank","initialNumber","numbered","oddOrEven","pagePosition","medium","occur","numberOfUse","relation","duplexImposition","pageSet","pageSetIndex","pageNumber","parity","Para","orphans","preserve","radixOffset","tabDefault","tabStops","widows","hyphenation","paddingLeft","paddingight","paddingTop","paddingBottom","tabSize","hyphenatation","PasswordEdit","passwordChar","Picture","Proto","barcode","bookend","breakAfter","breakBefore","dateTimeEdit","defaultUi","passwordEdit","subjectDN","traverse","variables","Radial","Reason","Reasons","cornerStyle","RefElement","binding","SetProperty","SignData","Signature","Signing","Solid","Speak","disable","priority","Stipple","rate","Subform","allowMacro","mergeMode","restoreState","scope","afterBreakAfter","savedNoLayoutFailure","overflowExtra","overflowNode","SubjectDN","delimiter","kv","SubjectDNs","Submit","embedPDF","textEncoding","xdpContent","baseProfile","pageAreas","mainHtml","breakBeforeTarget","pageAreaParent","targetPageArea","hasSomething","hasSomethingCounter","htmlContentAreas","Text","acc","allowRichText","multiLine","vScrollPolicy","Time","TimeStamp","server","ToolTip","Traversal","Traverse","Validate","formatTest","scriptTest","valueName","Variables","TemplateNamespace","attrs","createText","Binder","emptyMerge","_isConsumeData","_mergeMode","_isMatchTemplate","_bindElement","_bindValue","formNode","_findDataByNameToConsume","isValue","global","_setProperties","targetNodes","targetNode","targetParent","Reflect","construct","_bindItems","labelNodes","labelNode","valueNodes","valueNode","label","_bindOccurrences","baseClone","_createOccurrences","currentNumber","nodeClone","_getOccurInfo","_setAndBind","uselessNodes","dataChildren","dataChild","DataHandler","dataset","serialize","storage","storageEntry","CONFIG_NS_ID","Acrobat","acrobat7","autoSave","common","validateApprovalSignatures","submitUrl","Acrobat7","dynamicRender","ADBE_JSConsole","ADBE_JSDebugger","AddSilentPrint","AddViewerPreferences","AdjustData","AdobeExtensionLevel","Agent","AlwaysEmbed","Amd","Attributes","AutoSave","Base","BatchOutput","BehaviorOverride","Cache","templateCache","Change","Common","messaging","suppressBanner","validationMessaging","versionControl","Compress","CompressLogicalStructure","CompressObjectStream","Compression","compressLogicalStructure","compressObjectStream","Config","acrobat","present","trace","agent","Conformance","ContentCopy","Copies","Creator","CurrentPage","Data","adjustData","incrementalLoad","outputXSL","startNode","window","xsl","excludeNS","Debug","DefaultTypeface","writingScript","Destination","DocumentAssembly","Driver","DuplexOption","DynamicRender","Embed","encryptionLevel","EncryptionLevel","Enforce","Equate","force","to","EquateRange","_unicodeRange","unicodeRange","unicodeRegex","Exclude","ExcludeNS","FlipLabel","embed","subsetBelow","alwaysEmbed","defaultTypeface","neverEmbed","FormFieldFilling","GroupParent","IfEmpty","IncludeXDPContent","IncrementalLoad","IncrementalMerge","Interactive","Jog","LabelPrinter","batchOutput","flipLabel","Layout","Level","Linearized","Locale","LocaleSet","Log","threshold","MapElement","equate","equateRange","MediumInfo","msgId","severity","Messaging","Mode","ModifyAnnots","MsgId","NameAttr","NeverEmbed","NumberOfCopies","OpenAction","destination","Output","OutputBin","OutputXSL","Overprint","Packets","PageOffset","PageRange","numbers","Pagination","PaginationOverride","Part","Pcl","jog","mediumInfo","outputBin","pageOffset","staple","Pdf","adobeExtensionLevel","interactive","linearized","pdfa","producer","renderPolicy","scriptModel","silentPrint","submitFormat","tagged","Pdfa","amd","conformance","includeXDPContent","Permissions","accessibleContent","change","contentCopy","documentAssembly","formFieldFilling","modifyAnnots","plaintextMetadata","print","printHighQuality","PickTrayByPDFSize","PlaintextMetadata","Presence","Present","behaviorOverride","copies","incrementalMerge","overprint","pagination","paginationOverride","driver","labelPrinter","pcl","webClient","zpl","Print","PrintHighQuality","PrintScaling","PrinterName","Producer","Ps","Range","Record","Relevant","Rename","RenderPolicy","RunScripts","currentPage","exclude","runScripts","ScriptModel","Severity","SilentPrint","addSilentPrint","printerName","Staple","StartNode","StartPage","SubmitFormat","SubmitUrl","SubsetBelow","SuppressBanner","Tagged","startPage","Threshold","To","TemplateCache","maxEntries","Trace","groupParent","ifEmpty","nameAttr","rename","whitespace","Uri","ValidateApprovalSignatures","ValidationMessaging","Version","VersionControl","outputBelow","sourceAbove","sourceBelow","ViewerPreferences","addViewerPreferences","duplexOption","enforce","numberOfCopies","pageRange","pickTrayByPDFSize","printScaling","WebClient","Whitespace","Window","pair","Xdc","Xdp","packets","Xsl","debug","Zpl","ConfigNamespace","compress","CONNECTION_SET_NS_ID","ConnectionSet","wsdlConnection","xmlConnection","xsdConnection","EffectiveInputPolicy","EffectiveOutputPolicy","Operation","RootElement","SoapAction","SoapAddress","WsdlAddress","WsdlConnection","dataDescription","effectiveInputPolicy","effectiveOutputPolicy","soapAction","soapAddress","wsdlAddress","XmlConnection","XsdConnection","rootElement","ConnectionSetNamespace","DATASETS_NS_ID","Datasets","DatasetsNamespace","LOCALE_SET_NS_ID","CalendarSymbols","dayNames","eraNames","meridiemNames","monthNames","CurrencySymbol","CurrencySymbols","currencySymbol","DatePattern","DatePatterns","datePattern","DateTimeSymbols","Day","DayNames","abbr","day","Era","EraNames","era","calendarSymbols","currencySymbols","datePatterns","dateTimeSymbols","numberPatterns","numberSymbols","timePatterns","typeFaces","Meridiem","MeridiemNames","meridiem","Month","MonthNames","month","NumberPattern","NumberPatterns","numberPattern","NumberSymbol","NumberSymbols","numberSymbol","TimePattern","TimePatterns","timePattern","TypeFace","TypeFaces","typeFace","LocaleSetNamespace","SIGNATURE_NS_ID","SignatureNamespace","STYLESHEET_NS_ID","Stylesheet","StylesheetNamespace","XDP_NS_ID","uuid","XdpNamespace","XHTML_NS_ID","$richText","VALID_STYLES","StyleMapping","original","spacesRegExp","crlfRegExp","crlfForRichTextRegExp","mapStyle","styleStr","richText","newValue","SUB_SUPER_SCRIPT_FACTOR","VERTICAL_FACTOR","checkStyle","NoWhites","XhtmlObject","mustPop","pushFont","Body","Br","Html","Li","Ol","siblings","Span","Sub","Sup","Ul","XhtmlNamespace","body","br","li","ol","span","sub","sup","ul","NamespaceSetUp","UnknownNamespace","namespaceId","Root","Empty","Builder","rootNameSpace","_namespaceStack","_nsAgnosticLevel","_namespacePrefixes","_namespaces","_nextNsId","_currentNamespace","buildRoot","build","nsPrefix","namespace","prefixes","hasNamespaceDef","_searchNamespace","_addNamespacePrefix","dataTemplate","nsAttrs","xfaAttrs","nsToUse","_getNamespaceToUse","namespaceToUse","hasNamespace","nsAgnostic","isNsAgnostic","nsName","prefixStack","XFAParser","_builder","_globalData","_ids","_current","_whiteRegex","_nbsps","_richText","_mkAttributes","attributeObj","_getNameAndPrefix","attributesObj","XFAFactory","_createDocument","binder","dataHandler","_createPagesHelper","nextIteration","setTimeout","_createPages","pages","dims","getBoundingBox","getNumPages","setImages","setFonts","missingFonts","appendFonts","getPages","serializeData","getRichTextAsHtml","rc","newRoot","attr","AnnotationFactory","createGlobals","ensureCatalog","ensureDoc","xfaDatasets","annotationGlobals","collectFields","_getPageIndex","ensure","_create","parameters","LinkAnnotation","TextAnnotation","fieldType","TextWidgetAnnotation","ButtonWidgetAnnotation","ChoiceWidgetAnnotation","SignatureWidgetAnnotation","WidgetAnnotation","PopupAnnotation","FreeTextAnnotation","LineAnnotation","SquareAnnotation","CircleAnnotation","PolylineAnnotation","PolygonAnnotation","CaretAnnotation","InkAnnotation","HighlightAnnotation","UnderlineAnnotation","SquigglyAnnotation","StrikeOutAnnotation","StampAnnotation","FileAttachmentAnnotation","Annotation","annotDict","annotRef","generateImages","imagePromises","bitmapId","saveNewAnnotations","promises","annotation","deleted","annotationType","createNewAnnotation","smaskStream","smaskRef","printNewAnnotations","createNewPrintAnnotation","getRgbColor","defaultColor","getPdfColorArray","getQuadPoints","quadPoints","quadPointsLists","getTransformMatrix","setTitle","setContents","setModificationDate","setFlags","setRectangle","setColor","setBorderStyle","setAppearance","setOptionalContent","MK","setBorderAndBackgroundColors","setRotation","_streams","isLocked","isContentLocked","structParent","annotationFlags","contentsObj","_contents","hasAppearance","modificationDate","hasOwnCanvas","noRotate","noHTML","kidIds","fieldName","_constructFieldName","_isOffscreenCanvasSupported","_fallbackFontDict","_needAppearances","_hasFlag","_isViewable","_isPrintable","mustBeViewed","_renderForms","noView","viewable","mustBePrinted","noPrint","printable","_parseStringHelper","setDefaultAppearance","defaultAppearance","_defaultAppearance","defaultAppearanceData","_title","contents","hasFlag","setLineEndings","lineEndings","mk","AnnotationBorderStyle","dictType","setWidth","setStyle","setDashArray","setHorizontalCornerRadius","setVerticalCornerRadius","appearanceStates","normalAppearanceState","oc","loadResources","objectLoader","renderForms","isUsingOwnCanvas","separateForm","separateCanvas","appearanceDict","hasTextContent","extractTextContent","firstPosition","textPosition","getFieldObject","strokeColor","fillColor","loopDict","dashArray","horizontalCornerRadius","verticalCornerRadius","forceStyle","allZeros","validNumber","MarkupAnnotation","rawIRT","inReplyTo","rt","replyType","popupRef","titleObj","creationDate","setCreationDate","_setDefaultAppearance","blendMode","fillAlpha","pointsCallback","MIN_VALUE","pointsArray","mX","MX","mY","MY","formDict","appearanceStream","gsDict","stateDict","annotationRef","createNewAppearanceStream","annotationDict","apRef","createNewDict","newAnnotation","refToReplace","fieldValue","_decodeFormValue","defaultFieldValue","_hasValueFromXFA","getValue","alternativeText","localResources","acroFormResources","appearanceResources","_fieldResources","mergedResources","fieldFlags","readOnly","hasFieldFlag","formValue","getBorderAndBackgroundAppearances","_hasText","_getAppearance","_getMKDict","amendSavedDict","originalDict","encoder","maybeMK","changes","AP","_getSaveFieldResources","rotationMatrix","isPassword","formattedValue","combo","exportValue","displayValue","lineCount","defaultPadding","defaultHPadding","_getFontData","encodedLines","encodingError","encodedString","fakeUnicodeFont","newFont","oldFont","savedDefaultAppearance","_computeFontSize","defaultVPadding","alignment","textAlignment","_getMultilineAppearance","_getCombAppearance","bottomPadding","prevInfo","renderedText","_renderText","appearanceData","_getTextWidth","numberOfLines","roundWithTwoDigits","textWidth","cachedLines","isTooBig","fsize","_splitLine","hPadding","vPadding","shiftStr","localFont","acroFormFont","subFontDict","subResourcesDict","maximumLength","doNotScroll","combWidth","renderedComb","lastSpacePosInStringStart","lastSpacePosInStringEnd","startChunk","multiline","charLimit","editable","checkedAppearance","uncheckedAppearance","checkBox","radioButton","pushButton","isTooltipOnly","_processCheckBox","_processRadioButton","_processPushButton","buttonValue","savedAppearance","savedMatrix","_saveCheckbox","_saveRadioButton","parentData","_getDefaultCheckedAppearance","FONT_RATIO","xShift","yShift","customAppearance","normalAppearance","asValue","yes","exportValues","otherYes","fieldParent","fieldParentValue","indices","hasIndices","isOptionArray","multiSelect","numItems","multipleSelection","valueIndices","numberOfVisibleLines","firstIndex","minIndex","maxIndex","vpadding","DEFAULT_ICON_SIZE","stateModel","parentItem","parentRect","parentFlags","user","freetext","da","helv","lineAscent","firstPoint","clipBox","lineCoordinates","interiorColor","borderAdjust","controlPointsDistance","xMid","yMid","xOffset","yOffset","vertices","rawVertices","vertex","inkLists","rawInkLists","inkList","ink","appearanceBuffer","bezier","curve","outlines","outline","xEnd","buf32","hasAlpha","fillStyle","jpegBufferPromise","convertToBlob","quality","xobjectName","imageName","alphaBuffer","stamp","xobject","decodeString","DatasetXMLParser","DatasetReader","XRef","firstXRefStmPos","_xrefStms","_cacheMap","_pendingRefs","_newPersistentRefNum","_newTemporaryRefNum","_persistentRefsCache","resetNewTemporaryRef","setStartXRef","startXRefQueue","trailerDict","readXRef","indexObjects","processXRefTable","tableState","entryNum","streamPos","parserBuf1","parserBuf2","readXRefTable","firstEntryNum","free","uncompressed","processXRefStream","streamParameters","byteWidths","streamState","entryRanges","readXRefStream","typeFieldWidth","offsetFieldWidth","generationFieldWidth","generation","typeByte","offsetByte","generationByte","TAB","PERCENT","LT","readToken","skipUntil","skipped","gEndobjRegExp","gStartxrefRegExp","objRegExp","trailerBytes","startxrefBytes","xrefBytes","bufferStr","trailers","xrefStms","contentLength","updateEntries","xrefTagOffset","xrefStm","trailerDicts","isEncrypted","trailerError","_generationFallback","validPagesDict","pagesDict","pagesCount","startXRefParsedCache","lastXRefStreamPos","getEntry","xrefEntry","fetchUncompressed","fetchCompressed","tableOffset","DEFAULT_USER_UNIT","LETTER_SIZE_MEDIABOX","Page","globalIdFactory","xfaFactory","resourcesPromise","idCounters","_localIdFactory","_getInheritableProperty","_getBoundingBox","box","mediaBox","cropBox","userUnit","_onSubStreamError","getContentStream","replaceIdByRef","deletedAnnotations","existingAnnotations","partialEvaluator","annotationsArray","savedDict","_parsedAnnotations","newRefsPromises","contentStreamPromise","newAnnotationsPromise","newAnnotations","annotationGlobalsPromise","missingBitmaps","annotationWithBitmaps","dataPromises","pageListPromise","contentStream","transparency","pageOpList","findIndex","intentAny","intentDisplay","intentPrint","opListPromises","opLists","getStructTree","_parseStructTree","getAnnotationsData","annotationsData","textContentPromises","isVisible","annots","annotationPromises","sortedAnnotations","popupAnnotations","PDF_HEADER_SIGNATURE","STARTXREF_SIGNATURE","ENDOBJ_SIGNATURE","FINGERPRINT_FIRST_BYTES","EMPTY_FINGERPRINT","backwards","signatureEnd","PDFDocument","_pagePromises","_version","_globalIdFactory","docId","linearization","startXRefLength","checkHeader","parseStartXRef","_hasOnlyDocumentSignatures","recursionDepth","RECURSION_LIMIT","isSignature","isInvisible","_xfaStreams","enableXfa","formInfo","hasAcroForm","isPureXfa","htmlForXfa","loadXfaImages","xfaImagesDict","loadXfaFonts","serializeXfaData","hasFields","hasSignatures","sigFlags","hasOnlyDocumentSignatures","documentInfo","docInfo","PDFFormatVersion","Language","EncryptFilterName","IsLinearized","IsAcroFormPresent","IsXFAPresent","IsCollectionPresent","IsSignaturesPresent","infoDict","customValue","Custom","fingerprints","hexString","hex","idArray","hashOriginal","hashModified","_getLinearizationPage","cachedPromise","checkFirstPage","checkLastPage","pagesTree","reasonAll","collectFieldObjects","fieldRef","visitedRefs","partName","fieldObjects","allFields","fieldPromises","allPromises","hasJSActions","_parseHasJSActions","catalogJsActions","fieldObject","calculationOrderIds","calculationOrder","parseDocBaseUrl","BasePdfManager","_docBaseUrl","_docId","_password","pdfDocument","ensureXRef","requestLoadedStream","sendProgressiveData","updatePassword","terminate","LocalPdfManager","_loadedStreamPromise","NetworkPdfManager","streamManager","CallbackKind","UNKNOWN","DATA","StreamKind","CANCEL","CANCEL_COMPLETE","CLOSE","ENQUEUE","PULL","PULL_COMPLETE","START_COMPLETE","wrapReason","MessageHandler","sourceName","targetName","comObj","callbackId","streamId","streamSinks","streamControllers","callbackCapabilities","actionHandler","_onComObjOnMessage","processStreamMessage","cbSourceName","cbTargetName","postMessage","createStreamSink","addEventListener","ah","sendWithStream","queueingStrategy","ReadableStream","controller","startCapability","startCall","pullCall","cancelCall","pull","pullCapability","cancel","cancelCapability","isCancelled","lastDesiredSize","sinkCapability","onPull","onCancel","streamController","deleteStreamController","allSettled","destroy","removeEventListener","PDFWorkerStream","_msgHandler","_contentLength","_fullRequestReader","_rangeRequestReaders","getFullReader","PDFWorkerStreamReader","PDFWorkerStreamRangeReader","_isRangeSupported","_isStreamingSupported","readableStream","_reader","getReader","_headersReady","isRangeSupported","headersReady","WorkerTask","terminated","_capability","finished","finish","WorkerMessageHandler","setup","port","testMessageProcessed","createDocumentHandler","docParams","cancelXHRs","WorkerTasks","apiVersion","workerVersion","enumerableProperties","workerHandlerName","startWorkerTask","finishWorkerTask","loadDocument","getPdfManager","pdfManagerArgs","pdfManagerCapability","newPdfManager","pdfStream","cachedChunks","fullRequest","flushChunks","pdfFile","setupDoc","onSuccess","doc","pdfInfo","onFailure","pdfManagerReady","globalPromises","_structTreeRoot","newAnnotationPromises","finally","newXrefInfo","infoObj","operatorListInfo","waitOn","cleanupPromise","initializeFromPort","isMessagePort","maybePort","pdfjsVersion","pdfjsBuild"],"sourceRoot":""} diff --git a/shared/templates/shared/pdf_snippet.html b/shared/templates/shared/pdf_snippet.html new file mode 100644 index 0000000000000000000000000000000000000000..0e3f1ebd5c55ccb3557879dd2e645210aebf0286 --- /dev/null +++ b/shared/templates/shared/pdf_snippet.html @@ -0,0 +1,76 @@ +{% load static %} + +{% block scripts %} + <script type="module"> + import * as pdfjsLib from '{% static "shared/vendor/pdf.js-4.0.379/pdf.mjs" %}' + import * as pdfjsWorker from '{% static "shared/vendor/pdf.js-4.0.379/pdf.worker.mjs" %}' + + pdfjsLib.GlobalWorkerOptions.workerSrc = pdfjsWorker; + </script> + + <div class="overflow-x-auto"> + <script data-name="inline-pdf" data-url="{{ request.scheme }}://{{ request.get_host }}{{ page.pdf_url }}"> + let interval = setInterval( + () => { + // get elem + if (typeof window.pdfjsLib == 'undefined') return; + clearInterval(interval); + + [...document.querySelectorAll("[data-name='inline-pdf']")].forEach( + async (script) => { + if (!script.dataset.init) { + const parentNode = script.parentNode; + const docUrl = script.dataset.url; + const pdf = await pdfjsLib.getDocument(docUrl).promise; + + for (let pageNumber = 1; pageNumber <= pdf.numPages; pageNumber++) { + const page = await pdf.getPage(pageNumber); + const viewport = page.getViewport({ scale: 1.5 }); + + // Prepare canvas using PDF page dimensions + const canvas = document.createElement("canvas"); + canvas.setAttribute("aria-hidden", "true"); + const context = canvas.getContext("2d"); + canvas.height = viewport.height; + canvas.width = viewport.width; + + // Render PDF page into canvas context + await page.render({ + canvasContext: context, + viewport: viewport, + }); + + parentNode.appendChild(canvas); + + const loadingElement = document.getElementById("loading") + + if (loadingElement !== null) { + document.getElementById("loading").remove(); + } + } + + script.dataset.init = true; + } + } + ); + + }, + 10 + ); + </script> + </div> + + <div class="text-gray-500 my-6" id="loading"> + Načítání ... + </div> + + {% if download_link %} + <div class="flex flex-col md:flex-row lg:flex-col lg:items-end space-y-2 md:space-y-0 md:space-x-2 lg:space-x-0 lg:space-y-2"> + <a href="{{ request.scheme }}://{{ request.get_host }}{{ page.pdf_url }}"> + <button class="btn btn--inline-icon btn--condensed btn--hoveractive btn--grey-500"> + <div class="btn__body">Odkaz ke stažení PDF</div> + </button> + </a> + </div> + {% endif %} +{% endblock %} diff --git a/uniweb/migrations/0054_alter_uniwebhomepage_top_menu_uniwebpdfpage.py b/uniweb/migrations/0054_alter_uniwebhomepage_top_menu_uniwebpdfpage.py new file mode 100644 index 0000000000000000000000000000000000000000..ccfd7bced1e78a08c97a66efffb574543e9b7690 --- /dev/null +++ b/uniweb/migrations/0054_alter_uniwebhomepage_top_menu_uniwebpdfpage.py @@ -0,0 +1,101 @@ +# Generated by Django 4.1.10 on 2024-01-31 12:56 + +import django.db.models.deletion +import wagtail.blocks +import wagtail.fields +import wagtailmetadata.models +from django.db import migrations, models + +import shared.models.base + + +class Migration(migrations.Migration): + dependencies = [ + ("wagtailcore", "0083_workflowcontenttype"), + ("wagtaildocs", "0012_uploadeddocument"), + ("wagtailimages", "0025_alter_image_file_alter_rendition_file"), + ("uniweb", "0053_rename_date_uniwebarticlepage_timestamp"), + ] + + operations = [ + migrations.AlterField( + model_name="uniwebhomepage", + name="top_menu", + field=wagtail.fields.StreamField( + [ + ( + "item", + wagtail.blocks.StructBlock( + [ + ("name", wagtail.blocks.CharBlock(label="název")), + ( + "page", + wagtail.blocks.PageChooserBlock( + label="stránka", + page_type=[ + "uniweb.UniwebHomePage", + "uniweb.UniwebFlexiblePage", + "uniweb.UniwebArticlesIndexPage", + "uniweb.UniwebFormPage", + "uniweb.UniwebPeoplePage", + "uniweb.UniwebPersonPage", + "uniweb.UniwebPdfPage", + ], + ), + ), + ] + ), + ) + ], + blank=True, + use_json_field=True, + verbose_name="horní menu", + ), + ), + migrations.CreateModel( + name="UniwebPdfPage", + fields=[ + ( + "page_ptr", + models.OneToOneField( + auto_created=True, + on_delete=django.db.models.deletion.CASCADE, + parent_link=True, + primary_key=True, + serialize=False, + to="wagtailcore.page", + ), + ), + ( + "pdf_file", + models.ForeignKey( + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="+", + to="wagtaildocs.document", + verbose_name="PDF dokument", + ), + ), + ( + "search_image", + models.ForeignKey( + blank=True, + null=True, + on_delete=django.db.models.deletion.SET_NULL, + related_name="+", + to="wagtailimages.image", + verbose_name="Search image", + ), + ), + ], + options={ + "verbose_name": "PDF stránka", + }, + bases=( + wagtailmetadata.models.WagtailImageMetadataMixin, + shared.models.base.SubpageMixin, + "wagtailcore.page", + models.Model, + ), + ), + ] diff --git a/uniweb/models.py b/uniweb/models.py index c5705f21efecbdab51e08d60b3eff1f22e3b61f7..32a577983398b5d40eb1a6d8440646a40f3c1f37 100644 --- a/uniweb/models.py +++ b/uniweb/models.py @@ -35,6 +35,7 @@ from shared.models import ( ExtendedMetadataHomePageMixin, ExtendedMetadataPageMixin, FooterMixin, + PdfPageMixin, SharedTaggedUniwebArticle, SubpageMixin, ) @@ -206,6 +207,7 @@ class MenuItemBlock(blocks.StructBlock): "uniweb.UniwebFormPage", "uniweb.UniwebPeoplePage", "uniweb.UniwebPersonPage", + "uniweb.UniwebPdfPage", ], ) @@ -617,7 +619,7 @@ class UniwebArticlePage( ### RELATIONS parent_page_types = ["uniweb.UniwebArticlesIndexPage"] - subpage_types = [] + subpage_types = ["uniweb.UniwebPdfPage"] ### OTHERS @@ -917,3 +919,25 @@ class UniwebPeoplePage( class Meta: verbose_name = "Lidé" + + +class UniwebPdfPage(MetadataPageMixin, SubpageMixin, Page, PdfPageMixin): + """ + Single pdf page display + """ + + ### RELATIONS + parent_page_types = [ + "uniweb.UniwebHomePage", + "uniweb.UniwebArticlePage", + ] + subpage_types = [] + + ### PANELS + + content_panels = Page.content_panels + PdfPageMixin.content_panels + + ### OTHER + + class Meta: + verbose_name = "PDF stránka" diff --git a/uniweb/templates/uniweb/uniweb_pdf_page.html b/uniweb/templates/uniweb/uniweb_pdf_page.html new file mode 100644 index 0000000000000000000000000000000000000000..c5fb42d6fed94766d1bd991c1887696672616bf0 --- /dev/null +++ b/uniweb/templates/uniweb/uniweb_pdf_page.html @@ -0,0 +1,5 @@ +{% extends "uniweb/base.html" %} + +{% block content %} + {% include "shared/pdf_snippet.html" with download_link=True %} +{% endblock %}