Edit File by line

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /home/sportsfever/public_html/filemanger/function.php on line 93

Warning: Undefined array key "page_file_edit_line" in /home/sportsfever/public_html/filemanger/edit_text_line.php on line 32
/home/sportsfe.../httpdocs/clone/wp-conte.../plugins/embedpre.../assets/pdf/build
File: script.js
let p0 = scaleFactor * (bezier[0] - padding);
[23000] Fix | Delete
let p1 = scaleFactor * (bezier[1] - padding);
[23001] Fix | Delete
for (let i = 2, ii = bezier.length; i < ii; i += 6) {
[23002] Fix | Delete
const p10 = scaleFactor * (bezier[i] - padding);
[23003] Fix | Delete
const p11 = scaleFactor * (bezier[i + 1] - padding);
[23004] Fix | Delete
const p20 = scaleFactor * (bezier[i + 2] - padding);
[23005] Fix | Delete
const p21 = scaleFactor * (bezier[i + 3] - padding);
[23006] Fix | Delete
const p30 = scaleFactor * (bezier[i + 4] - padding);
[23007] Fix | Delete
const p31 = scaleFactor * (bezier[i + 5] - padding);
[23008] Fix | Delete
path.push([[p0, p1], [p10, p11], [p20, p21], [p30, p31]]);
[23009] Fix | Delete
p0 = p30;
[23010] Fix | Delete
p1 = p31;
[23011] Fix | Delete
}
[23012] Fix | Delete
const path2D = this.#buildPath2D(path);
[23013] Fix | Delete
editor.bezierPath2D.push(path2D);
[23014] Fix | Delete
}
[23015] Fix | Delete
const bbox = editor.#getBbox();
[23016] Fix | Delete
editor.#baseWidth = Math.max(AnnotationEditor.MIN_SIZE, bbox[2] - bbox[0]);
[23017] Fix | Delete
editor.#baseHeight = Math.max(AnnotationEditor.MIN_SIZE, bbox[3] - bbox[1]);
[23018] Fix | Delete
editor.#setScaleFactor(width, height);
[23019] Fix | Delete
return editor;
[23020] Fix | Delete
}
[23021] Fix | Delete
serialize() {
[23022] Fix | Delete
if (this.isEmpty()) {
[23023] Fix | Delete
return null;
[23024] Fix | Delete
}
[23025] Fix | Delete
const rect = this.getRect(0, 0);
[23026] Fix | Delete
const color = AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);
[23027] Fix | Delete
return {
[23028] Fix | Delete
annotationType: AnnotationEditorType.INK,
[23029] Fix | Delete
color,
[23030] Fix | Delete
thickness: this.thickness,
[23031] Fix | Delete
opacity: this.opacity,
[23032] Fix | Delete
paths: this.#serializePaths(this.scaleFactor / this.parentScale, this.translationX, this.translationY, rect),
[23033] Fix | Delete
pageIndex: this.pageIndex,
[23034] Fix | Delete
rect,
[23035] Fix | Delete
rotation: this.rotation,
[23036] Fix | Delete
structTreeParentId: this._structTreeParentId
[23037] Fix | Delete
};
[23038] Fix | Delete
}
[23039] Fix | Delete
}
[23040] Fix | Delete
[23041] Fix | Delete
;// CONCATENATED MODULE: ./src/display/editor/stamp.js
[23042] Fix | Delete
[23043] Fix | Delete
[23044] Fix | Delete
[23045] Fix | Delete
[23046] Fix | Delete
[23047] Fix | Delete
[23048] Fix | Delete
[23049] Fix | Delete
class StampEditor extends AnnotationEditor {
[23050] Fix | Delete
#bitmap = null;
[23051] Fix | Delete
#bitmapId = null;
[23052] Fix | Delete
#bitmapPromise = null;
[23053] Fix | Delete
#bitmapUrl = null;
[23054] Fix | Delete
#bitmapFile = null;
[23055] Fix | Delete
#bitmapFileName = "";
[23056] Fix | Delete
#canvas = null;
[23057] Fix | Delete
#observer = null;
[23058] Fix | Delete
#resizeTimeoutId = null;
[23059] Fix | Delete
#isSvg = false;
[23060] Fix | Delete
#hasBeenAddedInUndoStack = false;
[23061] Fix | Delete
static _type = "stamp";
[23062] Fix | Delete
static _editorType = AnnotationEditorType.STAMP;
[23063] Fix | Delete
constructor(params) {
[23064] Fix | Delete
super({
[23065] Fix | Delete
...params,
[23066] Fix | Delete
name: "stampEditor"
[23067] Fix | Delete
});
[23068] Fix | Delete
this.#bitmapUrl = params.bitmapUrl;
[23069] Fix | Delete
this.#bitmapFile = params.bitmapFile;
[23070] Fix | Delete
}
[23071] Fix | Delete
static initialize(l10n, uiManager) {
[23072] Fix | Delete
AnnotationEditor.initialize(l10n, uiManager);
[23073] Fix | Delete
}
[23074] Fix | Delete
static get supportedTypes() {
[23075] Fix | Delete
const types = ["apng", "avif", "bmp", "gif", "jpeg", "png", "svg+xml", "webp", "x-icon"];
[23076] Fix | Delete
return shadow(this, "supportedTypes", types.map(type => `image/${type}`));
[23077] Fix | Delete
}
[23078] Fix | Delete
static get supportedTypesStr() {
[23079] Fix | Delete
return shadow(this, "supportedTypesStr", this.supportedTypes.join(","));
[23080] Fix | Delete
}
[23081] Fix | Delete
static isHandlingMimeForPasting(mime) {
[23082] Fix | Delete
return this.supportedTypes.includes(mime);
[23083] Fix | Delete
}
[23084] Fix | Delete
static paste(item, parent) {
[23085] Fix | Delete
parent.pasteEditor(AnnotationEditorType.STAMP, {
[23086] Fix | Delete
bitmapFile: item.getAsFile()
[23087] Fix | Delete
});
[23088] Fix | Delete
}
[23089] Fix | Delete
#getBitmapFetched(data, fromId = false) {
[23090] Fix | Delete
if (!data) {
[23091] Fix | Delete
this.remove();
[23092] Fix | Delete
return;
[23093] Fix | Delete
}
[23094] Fix | Delete
this.#bitmap = data.bitmap;
[23095] Fix | Delete
if (!fromId) {
[23096] Fix | Delete
this.#bitmapId = data.id;
[23097] Fix | Delete
this.#isSvg = data.isSvg;
[23098] Fix | Delete
}
[23099] Fix | Delete
if (data.file) {
[23100] Fix | Delete
this.#bitmapFileName = data.file.name;
[23101] Fix | Delete
}
[23102] Fix | Delete
this.#createCanvas();
[23103] Fix | Delete
}
[23104] Fix | Delete
#getBitmapDone() {
[23105] Fix | Delete
this.#bitmapPromise = null;
[23106] Fix | Delete
this._uiManager.enableWaiting(false);
[23107] Fix | Delete
if (this.#canvas) {
[23108] Fix | Delete
this.div.focus();
[23109] Fix | Delete
}
[23110] Fix | Delete
}
[23111] Fix | Delete
#getBitmap() {
[23112] Fix | Delete
if (this.#bitmapId) {
[23113] Fix | Delete
this._uiManager.enableWaiting(true);
[23114] Fix | Delete
this._uiManager.imageManager.getFromId(this.#bitmapId).then(data => this.#getBitmapFetched(data, true)).finally(() => this.#getBitmapDone());
[23115] Fix | Delete
return;
[23116] Fix | Delete
}
[23117] Fix | Delete
if (this.#bitmapUrl) {
[23118] Fix | Delete
const url = this.#bitmapUrl;
[23119] Fix | Delete
this.#bitmapUrl = null;
[23120] Fix | Delete
this._uiManager.enableWaiting(true);
[23121] Fix | Delete
this.#bitmapPromise = this._uiManager.imageManager.getFromUrl(url).then(data => this.#getBitmapFetched(data)).finally(() => this.#getBitmapDone());
[23122] Fix | Delete
return;
[23123] Fix | Delete
}
[23124] Fix | Delete
if (this.#bitmapFile) {
[23125] Fix | Delete
const file = this.#bitmapFile;
[23126] Fix | Delete
this.#bitmapFile = null;
[23127] Fix | Delete
this._uiManager.enableWaiting(true);
[23128] Fix | Delete
this.#bitmapPromise = this._uiManager.imageManager.getFromFile(file).then(data => this.#getBitmapFetched(data)).finally(() => this.#getBitmapDone());
[23129] Fix | Delete
return;
[23130] Fix | Delete
}
[23131] Fix | Delete
const input = document.createElement("input");
[23132] Fix | Delete
input.type = "file";
[23133] Fix | Delete
input.accept = StampEditor.supportedTypesStr;
[23134] Fix | Delete
this.#bitmapPromise = new Promise(resolve => {
[23135] Fix | Delete
input.addEventListener("change", async () => {
[23136] Fix | Delete
if (!input.files || input.files.length === 0) {
[23137] Fix | Delete
this.remove();
[23138] Fix | Delete
} else {
[23139] Fix | Delete
this._uiManager.enableWaiting(true);
[23140] Fix | Delete
const data = await this._uiManager.imageManager.getFromFile(input.files[0]);
[23141] Fix | Delete
this.#getBitmapFetched(data);
[23142] Fix | Delete
}
[23143] Fix | Delete
resolve();
[23144] Fix | Delete
});
[23145] Fix | Delete
input.addEventListener("cancel", () => {
[23146] Fix | Delete
this.remove();
[23147] Fix | Delete
resolve();
[23148] Fix | Delete
});
[23149] Fix | Delete
}).finally(() => this.#getBitmapDone());
[23150] Fix | Delete
input.click();
[23151] Fix | Delete
}
[23152] Fix | Delete
remove() {
[23153] Fix | Delete
if (this.#bitmapId) {
[23154] Fix | Delete
this.#bitmap = null;
[23155] Fix | Delete
this._uiManager.imageManager.deleteId(this.#bitmapId);
[23156] Fix | Delete
this.#canvas?.remove();
[23157] Fix | Delete
this.#canvas = null;
[23158] Fix | Delete
this.#observer?.disconnect();
[23159] Fix | Delete
this.#observer = null;
[23160] Fix | Delete
if (this.#resizeTimeoutId) {
[23161] Fix | Delete
clearTimeout(this.#resizeTimeoutId);
[23162] Fix | Delete
this.#resizeTimeoutId = null;
[23163] Fix | Delete
}
[23164] Fix | Delete
}
[23165] Fix | Delete
super.remove();
[23166] Fix | Delete
}
[23167] Fix | Delete
rebuild() {
[23168] Fix | Delete
if (!this.parent) {
[23169] Fix | Delete
if (this.#bitmapId) {
[23170] Fix | Delete
this.#getBitmap();
[23171] Fix | Delete
}
[23172] Fix | Delete
return;
[23173] Fix | Delete
}
[23174] Fix | Delete
super.rebuild();
[23175] Fix | Delete
if (this.div === null) {
[23176] Fix | Delete
return;
[23177] Fix | Delete
}
[23178] Fix | Delete
if (this.#bitmapId && this.#canvas === null) {
[23179] Fix | Delete
this.#getBitmap();
[23180] Fix | Delete
}
[23181] Fix | Delete
if (!this.isAttachedToDOM) {
[23182] Fix | Delete
this.parent.add(this);
[23183] Fix | Delete
}
[23184] Fix | Delete
}
[23185] Fix | Delete
onceAdded() {
[23186] Fix | Delete
this._isDraggable = true;
[23187] Fix | Delete
this.div.focus();
[23188] Fix | Delete
}
[23189] Fix | Delete
isEmpty() {
[23190] Fix | Delete
return !(this.#bitmapPromise || this.#bitmap || this.#bitmapUrl || this.#bitmapFile || this.#bitmapId);
[23191] Fix | Delete
}
[23192] Fix | Delete
get isResizable() {
[23193] Fix | Delete
return true;
[23194] Fix | Delete
}
[23195] Fix | Delete
render() {
[23196] Fix | Delete
if (this.div) {
[23197] Fix | Delete
return this.div;
[23198] Fix | Delete
}
[23199] Fix | Delete
let baseX, baseY;
[23200] Fix | Delete
if (this.width) {
[23201] Fix | Delete
baseX = this.x;
[23202] Fix | Delete
baseY = this.y;
[23203] Fix | Delete
}
[23204] Fix | Delete
super.render();
[23205] Fix | Delete
this.div.hidden = true;
[23206] Fix | Delete
this.addAltTextButton();
[23207] Fix | Delete
if (this.#bitmap) {
[23208] Fix | Delete
this.#createCanvas();
[23209] Fix | Delete
} else {
[23210] Fix | Delete
this.#getBitmap();
[23211] Fix | Delete
}
[23212] Fix | Delete
if (this.width) {
[23213] Fix | Delete
const [parentWidth, parentHeight] = this.parentDimensions;
[23214] Fix | Delete
this.setAt(baseX * parentWidth, baseY * parentHeight, this.width * parentWidth, this.height * parentHeight);
[23215] Fix | Delete
}
[23216] Fix | Delete
return this.div;
[23217] Fix | Delete
}
[23218] Fix | Delete
#createCanvas() {
[23219] Fix | Delete
const {
[23220] Fix | Delete
div
[23221] Fix | Delete
} = this;
[23222] Fix | Delete
let {
[23223] Fix | Delete
width,
[23224] Fix | Delete
height
[23225] Fix | Delete
} = this.#bitmap;
[23226] Fix | Delete
const [pageWidth, pageHeight] = this.pageDimensions;
[23227] Fix | Delete
const MAX_RATIO = 0.75;
[23228] Fix | Delete
if (this.width) {
[23229] Fix | Delete
width = this.width * pageWidth;
[23230] Fix | Delete
height = this.height * pageHeight;
[23231] Fix | Delete
} else if (width > MAX_RATIO * pageWidth || height > MAX_RATIO * pageHeight) {
[23232] Fix | Delete
const factor = Math.min(MAX_RATIO * pageWidth / width, MAX_RATIO * pageHeight / height);
[23233] Fix | Delete
width *= factor;
[23234] Fix | Delete
height *= factor;
[23235] Fix | Delete
}
[23236] Fix | Delete
const [parentWidth, parentHeight] = this.parentDimensions;
[23237] Fix | Delete
this.setDims(width * parentWidth / pageWidth, height * parentHeight / pageHeight);
[23238] Fix | Delete
this._uiManager.enableWaiting(false);
[23239] Fix | Delete
const canvas = this.#canvas = document.createElement("canvas");
[23240] Fix | Delete
div.append(canvas);
[23241] Fix | Delete
div.hidden = false;
[23242] Fix | Delete
this.#drawBitmap(width, height);
[23243] Fix | Delete
this.#createObserver();
[23244] Fix | Delete
if (!this.#hasBeenAddedInUndoStack) {
[23245] Fix | Delete
this.parent.addUndoableEditor(this);
[23246] Fix | Delete
this.#hasBeenAddedInUndoStack = true;
[23247] Fix | Delete
}
[23248] Fix | Delete
this._reportTelemetry({
[23249] Fix | Delete
action: "inserted_image"
[23250] Fix | Delete
});
[23251] Fix | Delete
if (this.#bitmapFileName) {
[23252] Fix | Delete
canvas.setAttribute("aria-label", this.#bitmapFileName);
[23253] Fix | Delete
}
[23254] Fix | Delete
}
[23255] Fix | Delete
#setDimensions(width, height) {
[23256] Fix | Delete
const [parentWidth, parentHeight] = this.parentDimensions;
[23257] Fix | Delete
this.width = width / parentWidth;
[23258] Fix | Delete
this.height = height / parentHeight;
[23259] Fix | Delete
this.setDims(width, height);
[23260] Fix | Delete
if (this._initialOptions?.isCentered) {
[23261] Fix | Delete
this.center();
[23262] Fix | Delete
} else {
[23263] Fix | Delete
this.fixAndSetPosition();
[23264] Fix | Delete
}
[23265] Fix | Delete
this._initialOptions = null;
[23266] Fix | Delete
if (this.#resizeTimeoutId !== null) {
[23267] Fix | Delete
clearTimeout(this.#resizeTimeoutId);
[23268] Fix | Delete
}
[23269] Fix | Delete
const TIME_TO_WAIT = 200;
[23270] Fix | Delete
this.#resizeTimeoutId = setTimeout(() => {
[23271] Fix | Delete
this.#resizeTimeoutId = null;
[23272] Fix | Delete
this.#drawBitmap(width, height);
[23273] Fix | Delete
}, TIME_TO_WAIT);
[23274] Fix | Delete
}
[23275] Fix | Delete
#scaleBitmap(width, height) {
[23276] Fix | Delete
const {
[23277] Fix | Delete
width: bitmapWidth,
[23278] Fix | Delete
height: bitmapHeight
[23279] Fix | Delete
} = this.#bitmap;
[23280] Fix | Delete
let newWidth = bitmapWidth;
[23281] Fix | Delete
let newHeight = bitmapHeight;
[23282] Fix | Delete
let bitmap = this.#bitmap;
[23283] Fix | Delete
while (newWidth > 2 * width || newHeight > 2 * height) {
[23284] Fix | Delete
const prevWidth = newWidth;
[23285] Fix | Delete
const prevHeight = newHeight;
[23286] Fix | Delete
if (newWidth > 2 * width) {
[23287] Fix | Delete
newWidth = newWidth >= 16384 ? Math.floor(newWidth / 2) - 1 : Math.ceil(newWidth / 2);
[23288] Fix | Delete
}
[23289] Fix | Delete
if (newHeight > 2 * height) {
[23290] Fix | Delete
newHeight = newHeight >= 16384 ? Math.floor(newHeight / 2) - 1 : Math.ceil(newHeight / 2);
[23291] Fix | Delete
}
[23292] Fix | Delete
const offscreen = new OffscreenCanvas(newWidth, newHeight);
[23293] Fix | Delete
const ctx = offscreen.getContext("2d");
[23294] Fix | Delete
ctx.drawImage(bitmap, 0, 0, prevWidth, prevHeight, 0, 0, newWidth, newHeight);
[23295] Fix | Delete
bitmap = offscreen.transferToImageBitmap();
[23296] Fix | Delete
}
[23297] Fix | Delete
return bitmap;
[23298] Fix | Delete
}
[23299] Fix | Delete
#drawBitmap(width, height) {
[23300] Fix | Delete
width = Math.ceil(width);
[23301] Fix | Delete
height = Math.ceil(height);
[23302] Fix | Delete
const canvas = this.#canvas;
[23303] Fix | Delete
if (!canvas || canvas.width === width && canvas.height === height) {
[23304] Fix | Delete
return;
[23305] Fix | Delete
}
[23306] Fix | Delete
canvas.width = width;
[23307] Fix | Delete
canvas.height = height;
[23308] Fix | Delete
const bitmap = this.#isSvg ? this.#bitmap : this.#scaleBitmap(width, height);
[23309] Fix | Delete
if (this._uiManager.hasMLManager && !this.hasAltText()) {
[23310] Fix | Delete
const offscreen = new OffscreenCanvas(width, height);
[23311] Fix | Delete
const ctx = offscreen.getContext("2d");
[23312] Fix | Delete
ctx.drawImage(bitmap, 0, 0, bitmap.width, bitmap.height, 0, 0, width, height);
[23313] Fix | Delete
this._uiManager.mlGuess({
[23314] Fix | Delete
service: "image-to-text",
[23315] Fix | Delete
request: {
[23316] Fix | Delete
data: ctx.getImageData(0, 0, width, height).data,
[23317] Fix | Delete
width,
[23318] Fix | Delete
height,
[23319] Fix | Delete
channels: 4
[23320] Fix | Delete
}
[23321] Fix | Delete
}).then(response => {
[23322] Fix | Delete
const altText = response?.output || "";
[23323] Fix | Delete
if (this.parent && altText && !this.hasAltText()) {
[23324] Fix | Delete
this.altTextData = {
[23325] Fix | Delete
altText,
[23326] Fix | Delete
decorative: false
[23327] Fix | Delete
};
[23328] Fix | Delete
}
[23329] Fix | Delete
});
[23330] Fix | Delete
}
[23331] Fix | Delete
const ctx = canvas.getContext("2d");
[23332] Fix | Delete
ctx.filter = this._uiManager.hcmFilter;
[23333] Fix | Delete
ctx.drawImage(bitmap, 0, 0, bitmap.width, bitmap.height, 0, 0, width, height);
[23334] Fix | Delete
}
[23335] Fix | Delete
getImageForAltText() {
[23336] Fix | Delete
return this.#canvas;
[23337] Fix | Delete
}
[23338] Fix | Delete
#serializeBitmap(toUrl) {
[23339] Fix | Delete
if (toUrl) {
[23340] Fix | Delete
if (this.#isSvg) {
[23341] Fix | Delete
const url = this._uiManager.imageManager.getSvgUrl(this.#bitmapId);
[23342] Fix | Delete
if (url) {
[23343] Fix | Delete
return url;
[23344] Fix | Delete
}
[23345] Fix | Delete
}
[23346] Fix | Delete
const canvas = document.createElement("canvas");
[23347] Fix | Delete
({
[23348] Fix | Delete
width: canvas.width,
[23349] Fix | Delete
height: canvas.height
[23350] Fix | Delete
} = this.#bitmap);
[23351] Fix | Delete
const ctx = canvas.getContext("2d");
[23352] Fix | Delete
ctx.drawImage(this.#bitmap, 0, 0);
[23353] Fix | Delete
return canvas.toDataURL();
[23354] Fix | Delete
}
[23355] Fix | Delete
if (this.#isSvg) {
[23356] Fix | Delete
const [pageWidth, pageHeight] = this.pageDimensions;
[23357] Fix | Delete
const width = Math.round(this.width * pageWidth * PixelsPerInch.PDF_TO_CSS_UNITS);
[23358] Fix | Delete
const height = Math.round(this.height * pageHeight * PixelsPerInch.PDF_TO_CSS_UNITS);
[23359] Fix | Delete
const offscreen = new OffscreenCanvas(width, height);
[23360] Fix | Delete
const ctx = offscreen.getContext("2d");
[23361] Fix | Delete
ctx.drawImage(this.#bitmap, 0, 0, this.#bitmap.width, this.#bitmap.height, 0, 0, width, height);
[23362] Fix | Delete
return offscreen.transferToImageBitmap();
[23363] Fix | Delete
}
[23364] Fix | Delete
return structuredClone(this.#bitmap);
[23365] Fix | Delete
}
[23366] Fix | Delete
#createObserver() {
[23367] Fix | Delete
this.#observer = new ResizeObserver(entries => {
[23368] Fix | Delete
const rect = entries[0].contentRect;
[23369] Fix | Delete
if (rect.width && rect.height) {
[23370] Fix | Delete
this.#setDimensions(rect.width, rect.height);
[23371] Fix | Delete
}
[23372] Fix | Delete
});
[23373] Fix | Delete
this.#observer.observe(this.div);
[23374] Fix | Delete
}
[23375] Fix | Delete
static deserialize(data, parent, uiManager) {
[23376] Fix | Delete
if (data instanceof StampAnnotationElement) {
[23377] Fix | Delete
return null;
[23378] Fix | Delete
}
[23379] Fix | Delete
const editor = super.deserialize(data, parent, uiManager);
[23380] Fix | Delete
const {
[23381] Fix | Delete
rect,
[23382] Fix | Delete
bitmapUrl,
[23383] Fix | Delete
bitmapId,
[23384] Fix | Delete
isSvg,
[23385] Fix | Delete
accessibilityData
[23386] Fix | Delete
} = data;
[23387] Fix | Delete
if (bitmapId && uiManager.imageManager.isValidId(bitmapId)) {
[23388] Fix | Delete
editor.#bitmapId = bitmapId;
[23389] Fix | Delete
} else {
[23390] Fix | Delete
editor.#bitmapUrl = bitmapUrl;
[23391] Fix | Delete
}
[23392] Fix | Delete
editor.#isSvg = isSvg;
[23393] Fix | Delete
const [parentWidth, parentHeight] = editor.pageDimensions;
[23394] Fix | Delete
editor.width = (rect[2] - rect[0]) / parentWidth;
[23395] Fix | Delete
editor.height = (rect[3] - rect[1]) / parentHeight;
[23396] Fix | Delete
if (accessibilityData) {
[23397] Fix | Delete
editor.altTextData = accessibilityData;
[23398] Fix | Delete
}
[23399] Fix | Delete
return editor;
[23400] Fix | Delete
}
[23401] Fix | Delete
serialize(isForCopying = false, context = null) {
[23402] Fix | Delete
if (this.isEmpty()) {
[23403] Fix | Delete
return null;
[23404] Fix | Delete
}
[23405] Fix | Delete
const serialized = {
[23406] Fix | Delete
annotationType: AnnotationEditorType.STAMP,
[23407] Fix | Delete
bitmapId: this.#bitmapId,
[23408] Fix | Delete
pageIndex: this.pageIndex,
[23409] Fix | Delete
rect: this.getRect(0, 0),
[23410] Fix | Delete
rotation: this.rotation,
[23411] Fix | Delete
isSvg: this.#isSvg,
[23412] Fix | Delete
structTreeParentId: this._structTreeParentId
[23413] Fix | Delete
};
[23414] Fix | Delete
if (isForCopying) {
[23415] Fix | Delete
serialized.bitmapUrl = this.#serializeBitmap(true);
[23416] Fix | Delete
serialized.accessibilityData = this.altTextData;
[23417] Fix | Delete
return serialized;
[23418] Fix | Delete
}
[23419] Fix | Delete
const {
[23420] Fix | Delete
decorative,
[23421] Fix | Delete
altText
[23422] Fix | Delete
} = this.altTextData;
[23423] Fix | Delete
if (!decorative && altText) {
[23424] Fix | Delete
serialized.accessibilityData = {
[23425] Fix | Delete
type: "Figure",
[23426] Fix | Delete
alt: altText
[23427] Fix | Delete
};
[23428] Fix | Delete
}
[23429] Fix | Delete
if (context === null) {
[23430] Fix | Delete
return serialized;
[23431] Fix | Delete
}
[23432] Fix | Delete
context.stamps ||= new Map();
[23433] Fix | Delete
const area = this.#isSvg ? (serialized.rect[2] - serialized.rect[0]) * (serialized.rect[3] - serialized.rect[1]) : null;
[23434] Fix | Delete
if (!context.stamps.has(this.#bitmapId)) {
[23435] Fix | Delete
context.stamps.set(this.#bitmapId, {
[23436] Fix | Delete
area,
[23437] Fix | Delete
serialized
[23438] Fix | Delete
});
[23439] Fix | Delete
serialized.bitmap = this.#serializeBitmap(false);
[23440] Fix | Delete
} else if (this.#isSvg) {
[23441] Fix | Delete
const prevData = context.stamps.get(this.#bitmapId);
[23442] Fix | Delete
if (area > prevData.area) {
[23443] Fix | Delete
prevData.area = area;
[23444] Fix | Delete
prevData.serialized.bitmap.close();
[23445] Fix | Delete
prevData.serialized.bitmap = this.#serializeBitmap(false);
[23446] Fix | Delete
}
[23447] Fix | Delete
}
[23448] Fix | Delete
return serialized;
[23449] Fix | Delete
}
[23450] Fix | Delete
}
[23451] Fix | Delete
[23452] Fix | Delete
;// CONCATENATED MODULE: ./src/display/editor/annotation_editor_layer.js
[23453] Fix | Delete
[23454] Fix | Delete
[23455] Fix | Delete
[23456] Fix | Delete
[23457] Fix | Delete
[23458] Fix | Delete
[23459] Fix | Delete
[23460] Fix | Delete
[23461] Fix | Delete
[23462] Fix | Delete
[23463] Fix | Delete
[23464] Fix | Delete
[23465] Fix | Delete
[23466] Fix | Delete
[23467] Fix | Delete
[23468] Fix | Delete
class AnnotationEditorLayer {
[23469] Fix | Delete
#accessibilityManager;
[23470] Fix | Delete
#allowClick = false;
[23471] Fix | Delete
#annotationLayer = null;
[23472] Fix | Delete
#boundPointerup = null;
[23473] Fix | Delete
#boundPointerdown = null;
[23474] Fix | Delete
#boundTextLayerPointerDown = null;
[23475] Fix | Delete
#editorFocusTimeoutId = null;
[23476] Fix | Delete
#editors = new Map();
[23477] Fix | Delete
#hadPointerDown = false;
[23478] Fix | Delete
#isCleaningUp = false;
[23479] Fix | Delete
#isDisabling = false;
[23480] Fix | Delete
#textLayer = null;
[23481] Fix | Delete
#uiManager;
[23482] Fix | Delete
static _initialized = false;
[23483] Fix | Delete
static #editorTypes = new Map([FreeTextEditor, InkEditor, StampEditor, HighlightEditor].map(type => [type._editorType, type]));
[23484] Fix | Delete
constructor({
[23485] Fix | Delete
uiManager,
[23486] Fix | Delete
pageIndex,
[23487] Fix | Delete
div,
[23488] Fix | Delete
accessibilityManager,
[23489] Fix | Delete
annotationLayer,
[23490] Fix | Delete
drawLayer,
[23491] Fix | Delete
textLayer,
[23492] Fix | Delete
viewport,
[23493] Fix | Delete
l10n
[23494] Fix | Delete
}) {
[23495] Fix | Delete
const editorTypes = [...AnnotationEditorLayer.#editorTypes.values()];
[23496] Fix | Delete
if (!AnnotationEditorLayer._initialized) {
[23497] Fix | Delete
AnnotationEditorLayer._initialized = true;
[23498] Fix | Delete
for (const editorType of editorTypes) {
[23499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function