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/web
File: viewer.js
setPageLabel(label) {
[12000] Fix | Delete
this.pageLabel = typeof label === "string" ? label : null;
[12001] Fix | Delete
this.anchor.setAttribute("data-l10n-args", this.#pageL10nArgs);
[12002] Fix | Delete
if (this.renderingState !== RenderingStates.FINISHED) {
[12003] Fix | Delete
return;
[12004] Fix | Delete
}
[12005] Fix | Delete
this.image?.setAttribute("data-l10n-args", this.#pageL10nArgs);
[12006] Fix | Delete
}
[12007] Fix | Delete
}
[12008] Fix | Delete
[12009] Fix | Delete
;// CONCATENATED MODULE: ./web/pdf_thumbnail_viewer.js
[12010] Fix | Delete
[12011] Fix | Delete
[12012] Fix | Delete
[12013] Fix | Delete
const THUMBNAIL_SCROLL_MARGIN = -19;
[12014] Fix | Delete
const THUMBNAIL_SELECTED_CLASS = "selected";
[12015] Fix | Delete
class PDFThumbnailViewer {
[12016] Fix | Delete
constructor({
[12017] Fix | Delete
container,
[12018] Fix | Delete
eventBus,
[12019] Fix | Delete
linkService,
[12020] Fix | Delete
renderingQueue,
[12021] Fix | Delete
pageColors
[12022] Fix | Delete
}) {
[12023] Fix | Delete
this.container = container;
[12024] Fix | Delete
this.eventBus = eventBus;
[12025] Fix | Delete
this.linkService = linkService;
[12026] Fix | Delete
this.renderingQueue = renderingQueue;
[12027] Fix | Delete
this.pageColors = pageColors || null;
[12028] Fix | Delete
this.scroll = watchScroll(this.container, this.#scrollUpdated.bind(this));
[12029] Fix | Delete
this.#resetView();
[12030] Fix | Delete
}
[12031] Fix | Delete
#scrollUpdated() {
[12032] Fix | Delete
this.renderingQueue.renderHighestPriority();
[12033] Fix | Delete
}
[12034] Fix | Delete
getThumbnail(index) {
[12035] Fix | Delete
return this._thumbnails[index];
[12036] Fix | Delete
}
[12037] Fix | Delete
#getVisibleThumbs() {
[12038] Fix | Delete
return getVisibleElements({
[12039] Fix | Delete
scrollEl: this.container,
[12040] Fix | Delete
views: this._thumbnails
[12041] Fix | Delete
});
[12042] Fix | Delete
}
[12043] Fix | Delete
scrollThumbnailIntoView(pageNumber) {
[12044] Fix | Delete
if (!this.pdfDocument) {
[12045] Fix | Delete
return;
[12046] Fix | Delete
}
[12047] Fix | Delete
const thumbnailView = this._thumbnails[pageNumber - 1];
[12048] Fix | Delete
if (!thumbnailView) {
[12049] Fix | Delete
console.error('scrollThumbnailIntoView: Invalid "pageNumber" parameter.');
[12050] Fix | Delete
return;
[12051] Fix | Delete
}
[12052] Fix | Delete
if (pageNumber !== this._currentPageNumber) {
[12053] Fix | Delete
const prevThumbnailView = this._thumbnails[this._currentPageNumber - 1];
[12054] Fix | Delete
prevThumbnailView.div.classList.remove(THUMBNAIL_SELECTED_CLASS);
[12055] Fix | Delete
thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS);
[12056] Fix | Delete
}
[12057] Fix | Delete
const {
[12058] Fix | Delete
first,
[12059] Fix | Delete
last,
[12060] Fix | Delete
views
[12061] Fix | Delete
} = this.#getVisibleThumbs();
[12062] Fix | Delete
if (views.length > 0) {
[12063] Fix | Delete
let shouldScroll = false;
[12064] Fix | Delete
if (pageNumber <= first.id || pageNumber >= last.id) {
[12065] Fix | Delete
shouldScroll = true;
[12066] Fix | Delete
} else {
[12067] Fix | Delete
for (const {
[12068] Fix | Delete
id,
[12069] Fix | Delete
percent
[12070] Fix | Delete
} of views) {
[12071] Fix | Delete
if (id !== pageNumber) {
[12072] Fix | Delete
continue;
[12073] Fix | Delete
}
[12074] Fix | Delete
shouldScroll = percent < 100;
[12075] Fix | Delete
break;
[12076] Fix | Delete
}
[12077] Fix | Delete
}
[12078] Fix | Delete
if (shouldScroll) {
[12079] Fix | Delete
scrollIntoView(thumbnailView.div, {
[12080] Fix | Delete
top: THUMBNAIL_SCROLL_MARGIN
[12081] Fix | Delete
});
[12082] Fix | Delete
}
[12083] Fix | Delete
}
[12084] Fix | Delete
this._currentPageNumber = pageNumber;
[12085] Fix | Delete
}
[12086] Fix | Delete
get pagesRotation() {
[12087] Fix | Delete
return this._pagesRotation;
[12088] Fix | Delete
}
[12089] Fix | Delete
set pagesRotation(rotation) {
[12090] Fix | Delete
if (!isValidRotation(rotation)) {
[12091] Fix | Delete
throw new Error("Invalid thumbnails rotation angle.");
[12092] Fix | Delete
}
[12093] Fix | Delete
if (!this.pdfDocument) {
[12094] Fix | Delete
return;
[12095] Fix | Delete
}
[12096] Fix | Delete
if (this._pagesRotation === rotation) {
[12097] Fix | Delete
return;
[12098] Fix | Delete
}
[12099] Fix | Delete
this._pagesRotation = rotation;
[12100] Fix | Delete
const updateArgs = {
[12101] Fix | Delete
rotation
[12102] Fix | Delete
};
[12103] Fix | Delete
for (const thumbnail of this._thumbnails) {
[12104] Fix | Delete
thumbnail.update(updateArgs);
[12105] Fix | Delete
}
[12106] Fix | Delete
}
[12107] Fix | Delete
cleanup() {
[12108] Fix | Delete
for (const thumbnail of this._thumbnails) {
[12109] Fix | Delete
if (thumbnail.renderingState !== RenderingStates.FINISHED) {
[12110] Fix | Delete
thumbnail.reset();
[12111] Fix | Delete
}
[12112] Fix | Delete
}
[12113] Fix | Delete
TempImageFactory.destroyCanvas();
[12114] Fix | Delete
}
[12115] Fix | Delete
#resetView() {
[12116] Fix | Delete
this._thumbnails = [];
[12117] Fix | Delete
this._currentPageNumber = 1;
[12118] Fix | Delete
this._pageLabels = null;
[12119] Fix | Delete
this._pagesRotation = 0;
[12120] Fix | Delete
this.container.textContent = "";
[12121] Fix | Delete
}
[12122] Fix | Delete
setDocument(pdfDocument) {
[12123] Fix | Delete
if (this.pdfDocument) {
[12124] Fix | Delete
this.#cancelRendering();
[12125] Fix | Delete
this.#resetView();
[12126] Fix | Delete
}
[12127] Fix | Delete
this.pdfDocument = pdfDocument;
[12128] Fix | Delete
if (!pdfDocument) {
[12129] Fix | Delete
return;
[12130] Fix | Delete
}
[12131] Fix | Delete
const firstPagePromise = pdfDocument.getPage(1);
[12132] Fix | Delete
const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig({
[12133] Fix | Delete
intent: "display"
[12134] Fix | Delete
});
[12135] Fix | Delete
firstPagePromise.then(firstPdfPage => {
[12136] Fix | Delete
const pagesCount = pdfDocument.numPages;
[12137] Fix | Delete
const viewport = firstPdfPage.getViewport({
[12138] Fix | Delete
scale: 1
[12139] Fix | Delete
});
[12140] Fix | Delete
for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {
[12141] Fix | Delete
const thumbnail = new PDFThumbnailView({
[12142] Fix | Delete
container: this.container,
[12143] Fix | Delete
eventBus: this.eventBus,
[12144] Fix | Delete
id: pageNum,
[12145] Fix | Delete
defaultViewport: viewport.clone(),
[12146] Fix | Delete
optionalContentConfigPromise,
[12147] Fix | Delete
linkService: this.linkService,
[12148] Fix | Delete
renderingQueue: this.renderingQueue,
[12149] Fix | Delete
pageColors: this.pageColors
[12150] Fix | Delete
});
[12151] Fix | Delete
this._thumbnails.push(thumbnail);
[12152] Fix | Delete
}
[12153] Fix | Delete
this._thumbnails[0]?.setPdfPage(firstPdfPage);
[12154] Fix | Delete
const thumbnailView = this._thumbnails[this._currentPageNumber - 1];
[12155] Fix | Delete
thumbnailView.div.classList.add(THUMBNAIL_SELECTED_CLASS);
[12156] Fix | Delete
}).catch(reason => {
[12157] Fix | Delete
console.error("Unable to initialize thumbnail viewer", reason);
[12158] Fix | Delete
});
[12159] Fix | Delete
}
[12160] Fix | Delete
#cancelRendering() {
[12161] Fix | Delete
for (const thumbnail of this._thumbnails) {
[12162] Fix | Delete
thumbnail.cancelRendering();
[12163] Fix | Delete
}
[12164] Fix | Delete
}
[12165] Fix | Delete
setPageLabels(labels) {
[12166] Fix | Delete
if (!this.pdfDocument) {
[12167] Fix | Delete
return;
[12168] Fix | Delete
}
[12169] Fix | Delete
if (!labels) {
[12170] Fix | Delete
this._pageLabels = null;
[12171] Fix | Delete
} else if (!(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)) {
[12172] Fix | Delete
this._pageLabels = null;
[12173] Fix | Delete
console.error("PDFThumbnailViewer_setPageLabels: Invalid page labels.");
[12174] Fix | Delete
} else {
[12175] Fix | Delete
this._pageLabels = labels;
[12176] Fix | Delete
}
[12177] Fix | Delete
for (let i = 0, ii = this._thumbnails.length; i < ii; i++) {
[12178] Fix | Delete
this._thumbnails[i].setPageLabel(this._pageLabels?.[i] ?? null);
[12179] Fix | Delete
}
[12180] Fix | Delete
}
[12181] Fix | Delete
async #ensurePdfPageLoaded(thumbView) {
[12182] Fix | Delete
if (thumbView.pdfPage) {
[12183] Fix | Delete
return thumbView.pdfPage;
[12184] Fix | Delete
}
[12185] Fix | Delete
try {
[12186] Fix | Delete
const pdfPage = await this.pdfDocument.getPage(thumbView.id);
[12187] Fix | Delete
if (!thumbView.pdfPage) {
[12188] Fix | Delete
thumbView.setPdfPage(pdfPage);
[12189] Fix | Delete
}
[12190] Fix | Delete
return pdfPage;
[12191] Fix | Delete
} catch (reason) {
[12192] Fix | Delete
console.error("Unable to get page for thumb view", reason);
[12193] Fix | Delete
return null;
[12194] Fix | Delete
}
[12195] Fix | Delete
}
[12196] Fix | Delete
#getScrollAhead(visible) {
[12197] Fix | Delete
if (visible.first?.id === 1) {
[12198] Fix | Delete
return true;
[12199] Fix | Delete
} else if (visible.last?.id === this._thumbnails.length) {
[12200] Fix | Delete
return false;
[12201] Fix | Delete
}
[12202] Fix | Delete
return this.scroll.down;
[12203] Fix | Delete
}
[12204] Fix | Delete
forceRendering() {
[12205] Fix | Delete
const visibleThumbs = this.#getVisibleThumbs();
[12206] Fix | Delete
const scrollAhead = this.#getScrollAhead(visibleThumbs);
[12207] Fix | Delete
const thumbView = this.renderingQueue.getHighestPriority(visibleThumbs, this._thumbnails, scrollAhead);
[12208] Fix | Delete
if (thumbView) {
[12209] Fix | Delete
this.#ensurePdfPageLoaded(thumbView).then(() => {
[12210] Fix | Delete
this.renderingQueue.renderView(thumbView);
[12211] Fix | Delete
});
[12212] Fix | Delete
return true;
[12213] Fix | Delete
}
[12214] Fix | Delete
return false;
[12215] Fix | Delete
}
[12216] Fix | Delete
}
[12217] Fix | Delete
[12218] Fix | Delete
;// CONCATENATED MODULE: ./web/annotation_editor_layer_builder.js
[12219] Fix | Delete
[12220] Fix | Delete
[12221] Fix | Delete
class AnnotationEditorLayerBuilder {
[12222] Fix | Delete
#annotationLayer = null;
[12223] Fix | Delete
#drawLayer = null;
[12224] Fix | Delete
#onAppend = null;
[12225] Fix | Delete
#textLayer = null;
[12226] Fix | Delete
#uiManager;
[12227] Fix | Delete
constructor(options) {
[12228] Fix | Delete
this.pdfPage = options.pdfPage;
[12229] Fix | Delete
this.accessibilityManager = options.accessibilityManager;
[12230] Fix | Delete
this.l10n = options.l10n;
[12231] Fix | Delete
this.l10n ||= new genericl10n_GenericL10n();
[12232] Fix | Delete
this.annotationEditorLayer = null;
[12233] Fix | Delete
this.div = null;
[12234] Fix | Delete
this._cancelled = false;
[12235] Fix | Delete
this.#uiManager = options.uiManager;
[12236] Fix | Delete
this.#annotationLayer = options.annotationLayer || null;
[12237] Fix | Delete
this.#textLayer = options.textLayer || null;
[12238] Fix | Delete
this.#drawLayer = options.drawLayer || null;
[12239] Fix | Delete
this.#onAppend = options.onAppend || null;
[12240] Fix | Delete
}
[12241] Fix | Delete
async render(viewport, intent = "display") {
[12242] Fix | Delete
if (intent !== "display") {
[12243] Fix | Delete
return;
[12244] Fix | Delete
}
[12245] Fix | Delete
if (this._cancelled) {
[12246] Fix | Delete
return;
[12247] Fix | Delete
}
[12248] Fix | Delete
const clonedViewport = viewport.clone({
[12249] Fix | Delete
dontFlip: true
[12250] Fix | Delete
});
[12251] Fix | Delete
if (this.div) {
[12252] Fix | Delete
this.annotationEditorLayer.update({
[12253] Fix | Delete
viewport: clonedViewport
[12254] Fix | Delete
});
[12255] Fix | Delete
this.show();
[12256] Fix | Delete
return;
[12257] Fix | Delete
}
[12258] Fix | Delete
const div = this.div = document.createElement("div");
[12259] Fix | Delete
div.className = "annotationEditorLayer";
[12260] Fix | Delete
div.hidden = true;
[12261] Fix | Delete
div.dir = this.#uiManager.direction;
[12262] Fix | Delete
this.#onAppend?.(div);
[12263] Fix | Delete
this.annotationEditorLayer = new AnnotationEditorLayer({
[12264] Fix | Delete
uiManager: this.#uiManager,
[12265] Fix | Delete
div,
[12266] Fix | Delete
accessibilityManager: this.accessibilityManager,
[12267] Fix | Delete
pageIndex: this.pdfPage.pageNumber - 1,
[12268] Fix | Delete
l10n: this.l10n,
[12269] Fix | Delete
viewport: clonedViewport,
[12270] Fix | Delete
annotationLayer: this.#annotationLayer,
[12271] Fix | Delete
textLayer: this.#textLayer,
[12272] Fix | Delete
drawLayer: this.#drawLayer
[12273] Fix | Delete
});
[12274] Fix | Delete
const parameters = {
[12275] Fix | Delete
viewport: clonedViewport,
[12276] Fix | Delete
div,
[12277] Fix | Delete
annotations: null,
[12278] Fix | Delete
intent
[12279] Fix | Delete
};
[12280] Fix | Delete
this.annotationEditorLayer.render(parameters);
[12281] Fix | Delete
this.show();
[12282] Fix | Delete
}
[12283] Fix | Delete
cancel() {
[12284] Fix | Delete
this._cancelled = true;
[12285] Fix | Delete
if (!this.div) {
[12286] Fix | Delete
return;
[12287] Fix | Delete
}
[12288] Fix | Delete
this.annotationEditorLayer.destroy();
[12289] Fix | Delete
}
[12290] Fix | Delete
hide() {
[12291] Fix | Delete
if (!this.div) {
[12292] Fix | Delete
return;
[12293] Fix | Delete
}
[12294] Fix | Delete
this.div.hidden = true;
[12295] Fix | Delete
}
[12296] Fix | Delete
show() {
[12297] Fix | Delete
if (!this.div || this.annotationEditorLayer.isInvisible) {
[12298] Fix | Delete
return;
[12299] Fix | Delete
}
[12300] Fix | Delete
this.div.hidden = false;
[12301] Fix | Delete
}
[12302] Fix | Delete
}
[12303] Fix | Delete
[12304] Fix | Delete
;// CONCATENATED MODULE: ./web/annotation_layer_builder.js
[12305] Fix | Delete
[12306] Fix | Delete
[12307] Fix | Delete
class AnnotationLayerBuilder {
[12308] Fix | Delete
#onAppend = null;
[12309] Fix | Delete
#eventAbortController = null;
[12310] Fix | Delete
constructor({
[12311] Fix | Delete
pdfPage,
[12312] Fix | Delete
linkService,
[12313] Fix | Delete
downloadManager,
[12314] Fix | Delete
annotationStorage = null,
[12315] Fix | Delete
imageResourcesPath = "",
[12316] Fix | Delete
renderForms = true,
[12317] Fix | Delete
enableScripting = false,
[12318] Fix | Delete
hasJSActionsPromise = null,
[12319] Fix | Delete
fieldObjectsPromise = null,
[12320] Fix | Delete
annotationCanvasMap = null,
[12321] Fix | Delete
accessibilityManager = null,
[12322] Fix | Delete
annotationEditorUIManager = null,
[12323] Fix | Delete
onAppend = null
[12324] Fix | Delete
}) {
[12325] Fix | Delete
this.pdfPage = pdfPage;
[12326] Fix | Delete
this.linkService = linkService;
[12327] Fix | Delete
this.downloadManager = downloadManager;
[12328] Fix | Delete
this.imageResourcesPath = imageResourcesPath;
[12329] Fix | Delete
this.renderForms = renderForms;
[12330] Fix | Delete
this.annotationStorage = annotationStorage;
[12331] Fix | Delete
this.enableScripting = enableScripting;
[12332] Fix | Delete
this._hasJSActionsPromise = hasJSActionsPromise || Promise.resolve(false);
[12333] Fix | Delete
this._fieldObjectsPromise = fieldObjectsPromise || Promise.resolve(null);
[12334] Fix | Delete
this._annotationCanvasMap = annotationCanvasMap;
[12335] Fix | Delete
this._accessibilityManager = accessibilityManager;
[12336] Fix | Delete
this._annotationEditorUIManager = annotationEditorUIManager;
[12337] Fix | Delete
this.#onAppend = onAppend;
[12338] Fix | Delete
this.annotationLayer = null;
[12339] Fix | Delete
this.div = null;
[12340] Fix | Delete
this._cancelled = false;
[12341] Fix | Delete
this._eventBus = linkService.eventBus;
[12342] Fix | Delete
}
[12343] Fix | Delete
async render(viewport, intent = "display") {
[12344] Fix | Delete
if (this.div) {
[12345] Fix | Delete
if (this._cancelled || !this.annotationLayer) {
[12346] Fix | Delete
return;
[12347] Fix | Delete
}
[12348] Fix | Delete
this.annotationLayer.update({
[12349] Fix | Delete
viewport: viewport.clone({
[12350] Fix | Delete
dontFlip: true
[12351] Fix | Delete
})
[12352] Fix | Delete
});
[12353] Fix | Delete
return;
[12354] Fix | Delete
}
[12355] Fix | Delete
const [annotations, hasJSActions, fieldObjects] = await Promise.all([this.pdfPage.getAnnotations({
[12356] Fix | Delete
intent
[12357] Fix | Delete
}), this._hasJSActionsPromise, this._fieldObjectsPromise]);
[12358] Fix | Delete
if (this._cancelled) {
[12359] Fix | Delete
return;
[12360] Fix | Delete
}
[12361] Fix | Delete
const div = this.div = document.createElement("div");
[12362] Fix | Delete
div.className = "annotationLayer";
[12363] Fix | Delete
this.#onAppend?.(div);
[12364] Fix | Delete
if (annotations.length === 0) {
[12365] Fix | Delete
this.hide();
[12366] Fix | Delete
return;
[12367] Fix | Delete
}
[12368] Fix | Delete
this.annotationLayer = new AnnotationLayer({
[12369] Fix | Delete
div,
[12370] Fix | Delete
accessibilityManager: this._accessibilityManager,
[12371] Fix | Delete
annotationCanvasMap: this._annotationCanvasMap,
[12372] Fix | Delete
annotationEditorUIManager: this._annotationEditorUIManager,
[12373] Fix | Delete
page: this.pdfPage,
[12374] Fix | Delete
viewport: viewport.clone({
[12375] Fix | Delete
dontFlip: true
[12376] Fix | Delete
})
[12377] Fix | Delete
});
[12378] Fix | Delete
await this.annotationLayer.render({
[12379] Fix | Delete
annotations,
[12380] Fix | Delete
imageResourcesPath: this.imageResourcesPath,
[12381] Fix | Delete
renderForms: this.renderForms,
[12382] Fix | Delete
linkService: this.linkService,
[12383] Fix | Delete
downloadManager: this.downloadManager,
[12384] Fix | Delete
annotationStorage: this.annotationStorage,
[12385] Fix | Delete
enableScripting: this.enableScripting,
[12386] Fix | Delete
hasJSActions,
[12387] Fix | Delete
fieldObjects
[12388] Fix | Delete
});
[12389] Fix | Delete
if (this.linkService.isInPresentationMode) {
[12390] Fix | Delete
this.#updatePresentationModeState(PresentationModeState.FULLSCREEN);
[12391] Fix | Delete
}
[12392] Fix | Delete
if (!this.#eventAbortController) {
[12393] Fix | Delete
this.#eventAbortController = new AbortController();
[12394] Fix | Delete
this._eventBus?._on("presentationmodechanged", evt => {
[12395] Fix | Delete
this.#updatePresentationModeState(evt.state);
[12396] Fix | Delete
}, {
[12397] Fix | Delete
signal: this.#eventAbortController.signal
[12398] Fix | Delete
});
[12399] Fix | Delete
}
[12400] Fix | Delete
}
[12401] Fix | Delete
cancel() {
[12402] Fix | Delete
this._cancelled = true;
[12403] Fix | Delete
this.#eventAbortController?.abort();
[12404] Fix | Delete
this.#eventAbortController = null;
[12405] Fix | Delete
}
[12406] Fix | Delete
hide() {
[12407] Fix | Delete
if (!this.div) {
[12408] Fix | Delete
return;
[12409] Fix | Delete
}
[12410] Fix | Delete
this.div.hidden = true;
[12411] Fix | Delete
}
[12412] Fix | Delete
#updatePresentationModeState(state) {
[12413] Fix | Delete
if (!this.div) {
[12414] Fix | Delete
return;
[12415] Fix | Delete
}
[12416] Fix | Delete
let disableFormElements = false;
[12417] Fix | Delete
switch (state) {
[12418] Fix | Delete
case PresentationModeState.FULLSCREEN:
[12419] Fix | Delete
disableFormElements = true;
[12420] Fix | Delete
break;
[12421] Fix | Delete
case PresentationModeState.NORMAL:
[12422] Fix | Delete
break;
[12423] Fix | Delete
default:
[12424] Fix | Delete
return;
[12425] Fix | Delete
}
[12426] Fix | Delete
for (const section of this.div.childNodes) {
[12427] Fix | Delete
if (section.hasAttribute("data-internal-link")) {
[12428] Fix | Delete
continue;
[12429] Fix | Delete
}
[12430] Fix | Delete
section.inert = disableFormElements;
[12431] Fix | Delete
}
[12432] Fix | Delete
}
[12433] Fix | Delete
}
[12434] Fix | Delete
[12435] Fix | Delete
;// CONCATENATED MODULE: ./web/draw_layer_builder.js
[12436] Fix | Delete
[12437] Fix | Delete
class DrawLayerBuilder {
[12438] Fix | Delete
#drawLayer = null;
[12439] Fix | Delete
constructor(options) {
[12440] Fix | Delete
this.pageIndex = options.pageIndex;
[12441] Fix | Delete
}
[12442] Fix | Delete
async render(intent = "display") {
[12443] Fix | Delete
if (intent !== "display" || this.#drawLayer || this._cancelled) {
[12444] Fix | Delete
return;
[12445] Fix | Delete
}
[12446] Fix | Delete
this.#drawLayer = new DrawLayer({
[12447] Fix | Delete
pageIndex: this.pageIndex
[12448] Fix | Delete
});
[12449] Fix | Delete
}
[12450] Fix | Delete
cancel() {
[12451] Fix | Delete
this._cancelled = true;
[12452] Fix | Delete
if (!this.#drawLayer) {
[12453] Fix | Delete
return;
[12454] Fix | Delete
}
[12455] Fix | Delete
this.#drawLayer.destroy();
[12456] Fix | Delete
this.#drawLayer = null;
[12457] Fix | Delete
}
[12458] Fix | Delete
setParent(parent) {
[12459] Fix | Delete
this.#drawLayer?.setParent(parent);
[12460] Fix | Delete
}
[12461] Fix | Delete
getDrawLayer() {
[12462] Fix | Delete
return this.#drawLayer;
[12463] Fix | Delete
}
[12464] Fix | Delete
}
[12465] Fix | Delete
[12466] Fix | Delete
;// CONCATENATED MODULE: ./web/struct_tree_layer_builder.js
[12467] Fix | Delete
[12468] Fix | Delete
const PDF_ROLE_TO_HTML_ROLE = {
[12469] Fix | Delete
Document: null,
[12470] Fix | Delete
DocumentFragment: null,
[12471] Fix | Delete
Part: "group",
[12472] Fix | Delete
Sect: "group",
[12473] Fix | Delete
Div: "group",
[12474] Fix | Delete
Aside: "note",
[12475] Fix | Delete
NonStruct: "none",
[12476] Fix | Delete
P: null,
[12477] Fix | Delete
H: "heading",
[12478] Fix | Delete
Title: null,
[12479] Fix | Delete
FENote: "note",
[12480] Fix | Delete
Sub: "group",
[12481] Fix | Delete
Lbl: null,
[12482] Fix | Delete
Span: null,
[12483] Fix | Delete
Em: null,
[12484] Fix | Delete
Strong: null,
[12485] Fix | Delete
Link: "link",
[12486] Fix | Delete
Annot: "note",
[12487] Fix | Delete
Form: "form",
[12488] Fix | Delete
Ruby: null,
[12489] Fix | Delete
RB: null,
[12490] Fix | Delete
RT: null,
[12491] Fix | Delete
RP: null,
[12492] Fix | Delete
Warichu: null,
[12493] Fix | Delete
WT: null,
[12494] Fix | Delete
WP: null,
[12495] Fix | Delete
L: "list",
[12496] Fix | Delete
LI: "listitem",
[12497] Fix | Delete
LBody: null,
[12498] Fix | Delete
Table: "table",
[12499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function