: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
this._onMouseMove = this.#onMouseMove.bind(this);
this._endPan = this.#endPan.bind(this);
const overlay = this.overlay = document.createElement("div");
overlay.className = "grab-to-pan-grabbing";
this.element.addEventListener("mousedown", this._onMouseDown, true);
this.element.classList.add(CSS_CLASS_GRAB);
this.element.removeEventListener("mousedown", this._onMouseDown, true);
this.element.classList.remove(CSS_CLASS_GRAB);
return node.matches("a[href], a[href] *, input, textarea, button, button *, select, option");
if (event.button !== 0 || this.ignoreTarget(event.target)) {
if (event.originalTarget) {
event.originalTarget.tagName;
this.scrollLeftStart = this.element.scrollLeft;
this.scrollTopStart = this.element.scrollTop;
this.clientXStart = event.clientX;
this.clientYStart = event.clientY;
this.document.addEventListener("mousemove", this._onMouseMove, true);
this.document.addEventListener("mouseup", this._endPan, true);
this.element.addEventListener("scroll", this._endPan, true);
const focusedElement = document.activeElement;
if (focusedElement && !focusedElement.contains(event.target)) {
this.element.removeEventListener("scroll", this._endPan, true);
if (!(event.buttons & 1)) {
const xDiff = event.clientX - this.clientXStart;
const yDiff = event.clientY - this.clientYStart;
top: this.scrollTopStart - yDiff,
left: this.scrollLeftStart - xDiff,
if (!this.overlay.parentNode) {
document.body.append(this.overlay);
this.element.removeEventListener("scroll", this._endPan, true);
this.document.removeEventListener("mousemove", this._onMouseMove, true);
this.document.removeEventListener("mouseup", this._endPan, true);
;// CONCATENATED MODULE: ./web/pdf_cursor_tools.js
#active = CursorTool.SELECT;
cursorToolOnLoad = CursorTool.SELECT
this.container = container;
this.eventBus = eventBus;
this.#addEventListeners();
Promise.resolve().then(() => {
this.switchTool(cursorToolOnLoad);
if (this.#prevActive !== null) {
if (tool === this.#active) {
const disableActiveTool = () => {
this._handTool.deactivate();
this._handTool.activate();
console.error(`switchTool: "${tool}" is an unsupported value.`);
this.eventBus.dispatch("cursortoolchanged", {
this.eventBus._on("switchcursortool", evt => {
this.switchTool(evt.tool);
} else if (this.#prevActive !== null) {
annotationEditorMode = AnnotationEditorType.NONE;
presentationModeState = PresentationModeState.NORMAL;
let annotationEditorMode = AnnotationEditorType.NONE,
presentationModeState = PresentationModeState.NORMAL;
const disableActive = () => {
const prevActive = this.#active;
this.switchTool(CursorTool.SELECT);
this.#prevActive ??= prevActive;
const enableActive = () => {
const prevActive = this.#prevActive;
if (prevActive !== null && annotationEditorMode === AnnotationEditorType.NONE && presentationModeState === PresentationModeState.NORMAL) {
this.switchTool(prevActive);
this.eventBus._on("annotationeditormodechanged", ({
annotationEditorMode = mode;
if (mode === AnnotationEditorType.NONE) {
this.eventBus._on("presentationmodechanged", ({
presentationModeState = state;
if (state === PresentationModeState.NORMAL) {
} else if (state === PresentationModeState.FULLSCREEN) {
return shadow(this, "_handTool", new GrabToPan({
;// CONCATENATED MODULE: ./web/pdf_document_properties.js
const DEFAULT_FIELD_CONTENT = "-";
const NON_METRIC_LOCALES = ["en-us", "en-lr", "my"];
const METRIC_PAGE_NAMES = {
function getPageName(size, isPortrait, pageNames) {
const width = isPortrait ? size.width : size.height;
const height = isPortrait ? size.height : size.width;
return pageNames[`${width}x${height}`];
class PDFDocumentProperties {
}, overlayManager, eventBus, l10n, fileNameLookup) {
this.overlayManager = overlayManager;
this._fileNameLookup = fileNameLookup;
closeButton.addEventListener("click", this.close.bind(this));
this.overlayManager.register(this.dialog);
eventBus._on("pagechanging", evt => {
this._currentPageNumber = evt.pageNumber;
eventBus._on("rotationchanging", evt => {
this._pagesRotation = evt.pagesRotation;
this._isNonMetricLocale = NON_METRIC_LOCALES.includes(l10n.getLanguage());
await Promise.all([this.overlayManager.open(this.dialog), this._dataAvailableCapability.promise]);
const currentPageNumber = this._currentPageNumber;
const pagesRotation = this._pagesRotation;
if (this.#fieldData && currentPageNumber === this.#fieldData._currentPageNumber && pagesRotation === this.#fieldData._pagesRotation) {
} = await this.pdfDocument.getMetadata();
const [fileName, fileSize, creationDate, modificationDate, pageSize, isLinearized] = await Promise.all([this._fileNameLookup(), this.#parseFileSize(contentLength), this.#parseDate(info.CreationDate), this.#parseDate(info.ModDate), this.pdfDocument.getPage(currentPageNumber).then(pdfPage => {
return this.#parsePageSize(getPageSizeInches(pdfPage), pagesRotation);
}), this.#parseLinearization(info.IsLinearized)]);
this.#fieldData = Object.freeze({
version: info.PDFFormatVersion,
pageCount: this.pdfDocument.numPages,
linearized: isLinearized,
_currentPageNumber: currentPageNumber,
_pagesRotation: pagesRotation
} = await this.pdfDocument.getDownloadInfo();
if (contentLength === length) {
const data = Object.assign(Object.create(null), this.#fieldData);
data.fileSize = await this.#parseFileSize(length);
this.#fieldData = Object.freeze(data);
this.overlayManager.close(this.dialog);
setDocument(pdfDocument) {
this.pdfDocument = pdfDocument;
this._dataAvailableCapability.resolve();
this._dataAvailableCapability = Promise.withResolvers();
this._currentPageNumber = 1;
#updateUI(reset = false) {
if (reset || !this.#fieldData) {
for (const id in this.fields) {
this.fields[id].textContent = DEFAULT_FIELD_CONTENT;
if (this.overlayManager.active !== this.dialog) {
for (const id in this.fields) {
const content = this.#fieldData[id];
this.fields[id].textContent = content || content === 0 ? content : DEFAULT_FIELD_CONTENT;
async #parseFileSize(fileSize = 0) {
const kb = fileSize / 1024,
return this.l10n.get(`pdfjs-document-properties-${mb >= 1 ? "mb" : "kb"}`, {
size_mb: mb >= 1 && (+mb.toPrecision(3)).toLocaleString(),
size_kb: mb < 1 && (+kb.toPrecision(3)).toLocaleString(),
size_b: fileSize.toLocaleString()
async #parsePageSize(pageSizeInches, pagesRotation) {
if (pagesRotation % 180 !== 0) {
width: pageSizeInches.height,
height: pageSizeInches.width
const isPortrait = isPortraitOrientation(pageSizeInches);
width: Math.round(pageSizeInches.width * 100) / 100,
height: Math.round(pageSizeInches.height * 100) / 100
width: Math.round(pageSizeInches.width * 25.4 * 10) / 10,
height: Math.round(pageSizeInches.height * 25.4 * 10) / 10
let rawName = getPageName(sizeInches, isPortrait, US_PAGE_NAMES) || getPageName(sizeMillimeters, isPortrait, METRIC_PAGE_NAMES);
if (!rawName && !(Number.isInteger(sizeMillimeters.width) && Number.isInteger(sizeMillimeters.height))) {
const exactMillimeters = {
width: pageSizeInches.width * 25.4,
height: pageSizeInches.height * 25.4
width: Math.round(sizeMillimeters.width),
height: Math.round(sizeMillimeters.height)
if (Math.abs(exactMillimeters.width - intMillimeters.width) < 0.1 && Math.abs(exactMillimeters.height - intMillimeters.height) < 0.1) {
rawName = getPageName(intMillimeters, isPortrait, METRIC_PAGE_NAMES);
width: Math.round(intMillimeters.width / 25.4 * 100) / 100,
height: Math.round(intMillimeters.height / 25.4 * 100) / 100
sizeMillimeters = intMillimeters;
}, unit, name, orientation] = await Promise.all([this._isNonMetricLocale ? sizeInches : sizeMillimeters, this.l10n.get(`pdfjs-document-properties-page-size-unit-${this._isNonMetricLocale ? "inches" : "millimeters"}`), rawName && this.l10n.get(`pdfjs-document-properties-page-size-name-${rawName}`), this.l10n.get(`pdfjs-document-properties-page-size-orientation-${isPortrait ? "portrait" : "landscape"}`)]);
return this.l10n.get(`pdfjs-document-properties-page-size-dimension-${name ? "name-" : ""}string`, {
width: width.toLocaleString(),
height: height.toLocaleString(),
async #parseDate(inputDate) {
const dateObject = PDFDateString.toDateObject(inputDate);
return this.l10n.get("pdfjs-document-properties-date-string", {
date: dateObject.toLocaleDateString(),
time: dateObject.toLocaleTimeString()
#parseLinearization(isLinearized) {
return this.l10n.get(`pdfjs-document-properties-linearized-${isLinearized ? "yes" : "no"}`);
;// CONCATENATED MODULE: ./web/pdf_find_utils.js
HALFWIDTH_KATAKANA_LETTER: 6,
function isAlphabeticalScript(charCode) {
return charCode < 0x2e80;
function isAscii(charCode) {
return (charCode & 0xff80) === 0;
function isAsciiAlpha(charCode) {
return charCode >= 0x61 && charCode <= 0x7a || charCode >= 0x41 && charCode <= 0x5a;
function isAsciiDigit(charCode) {
return charCode >= 0x30 && charCode <= 0x39;
function isAsciiSpace(charCode) {
return charCode === 0x20 || charCode === 0x09 || charCode === 0x0d || charCode === 0x0a;
function isHan(charCode) {
return charCode >= 0x3400 && charCode <= 0x9fff || charCode >= 0xf900 && charCode <= 0xfaff;
function isKatakana(charCode) {
return charCode >= 0x30a0 && charCode <= 0x30ff;
function isHiragana(charCode) {
return charCode >= 0x3040 && charCode <= 0x309f;
function isHalfwidthKatakana(charCode) {
return charCode >= 0xff60 && charCode <= 0xff9f;
function isThai(charCode) {
return (charCode & 0xff80) === 0x0e00;
function getCharacterType(charCode) {
if (isAlphabeticalScript(charCode)) {
if (isAsciiSpace(charCode)) {
return CharacterType.SPACE;
} else if (isAsciiAlpha(charCode) || isAsciiDigit(charCode) || charCode === 0x5f) {
return CharacterType.ALPHA_LETTER;
return CharacterType.PUNCT;
} else if (isThai(charCode)) {
return CharacterType.THAI_LETTER;
} else if (charCode === 0xa0) {
return CharacterType.SPACE;
return CharacterType.ALPHA_LETTER;
return CharacterType.HAN_LETTER;
} else if (isKatakana(charCode)) {
return CharacterType.KATAKANA_LETTER;
} else if (isHiragana(charCode)) {
return CharacterType.HIRAGANA_LETTER;
} else if (isHalfwidthKatakana(charCode)) {
return CharacterType.HALFWIDTH_KATAKANA_LETTER;
return CharacterType.ALPHA_LETTER;
function getNormalizeWithNFKC() {
NormalizeWithNFKC ||= ` ¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰꟲ-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩`;
return NormalizeWithNFKC;
;// CONCATENATED MODULE: ./web/pdf_find_controller.js
const FIND_TIMEOUT = 250;
const MATCH_SCROLL_OFFSET_TOP = -50;
const MATCH_SCROLL_OFFSET_LEFT = -400;
const CHARACTERS_TO_NORMALIZE = {