@shznet/pdf-sign-control 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +26 -18
- package/dist/index.js +406 -305
- package/dist/lib/PdfSignControl.d.ts +3 -0
- package/dist/lib/PdfSignControl.d.ts.map +1 -1
- package/dist/lib/engine/PdfViewer.d.ts +3 -0
- package/dist/lib/engine/PdfViewer.d.ts.map +1 -1
- package/package.json +12 -1
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
var
|
|
1
|
+
var Gs = (d) => {
|
|
2
2
|
throw TypeError(d);
|
|
3
3
|
};
|
|
4
|
-
var rs = (d, t, e) => t.has(d) ||
|
|
5
|
-
var q = (d, t, e) => (rs(d, t, "read from private field"), e ? e.call(d) : t.get(d)), xt = (d, t, e) => t.has(d) ?
|
|
4
|
+
var rs = (d, t, e) => t.has(d) || Gs("Cannot " + e);
|
|
5
|
+
var q = (d, t, e) => (rs(d, t, "read from private field"), e ? e.call(d) : t.get(d)), xt = (d, t, e) => t.has(d) ? Gs("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(d) : t.set(d, e), pt = (d, t, e, s) => (rs(d, t, "write to private field"), s ? s.call(d, e) : t.set(d, e), e), Tt = (d, t, e) => (rs(d, t, "access private method"), e);
|
|
6
6
|
var Ws = (d, t, e, s) => ({
|
|
7
7
|
set _(i) {
|
|
8
8
|
pt(d, t, i, e);
|
|
@@ -206,7 +206,7 @@ const dt = typeof process == "object" && process + "" == "[object process]" && !
|
|
|
206
206
|
ERRORS: 0,
|
|
207
207
|
WARNINGS: 1,
|
|
208
208
|
INFOS: 5
|
|
209
|
-
},
|
|
209
|
+
}, Ee = {
|
|
210
210
|
dependency: 1,
|
|
211
211
|
setLineWidth: 2,
|
|
212
212
|
setLineCap: 3,
|
|
@@ -321,11 +321,11 @@ function Je(d) {
|
|
|
321
321
|
function L(d) {
|
|
322
322
|
Qe >= Ke.WARNINGS && console.warn(`Warning: ${d}`);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function G(d) {
|
|
325
325
|
throw new Error(d);
|
|
326
326
|
}
|
|
327
327
|
function B(d, t) {
|
|
328
|
-
d ||
|
|
328
|
+
d || G(t);
|
|
329
329
|
}
|
|
330
330
|
function cn(d) {
|
|
331
331
|
switch (d?.protocol) {
|
|
@@ -399,7 +399,7 @@ class zt extends Qt {
|
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
function vi(d) {
|
|
402
|
-
(typeof d != "object" || d?.length === void 0) &&
|
|
402
|
+
(typeof d != "object" || d?.length === void 0) && G("Invalid argument for bytesToString");
|
|
403
403
|
const t = d.length, e = 8192;
|
|
404
404
|
if (t < e)
|
|
405
405
|
return String.fromCharCode.apply(null, d);
|
|
@@ -411,7 +411,7 @@ function vi(d) {
|
|
|
411
411
|
return s.join("");
|
|
412
412
|
}
|
|
413
413
|
function Te(d) {
|
|
414
|
-
typeof d != "string" &&
|
|
414
|
+
typeof d != "string" && G("Invalid argument for stringToBytes");
|
|
415
415
|
const t = d.length, e = new Uint8Array(t);
|
|
416
416
|
for (let s = 0; s < t; ++s)
|
|
417
417
|
e[s] = d.charCodeAt(s) & 255;
|
|
@@ -504,8 +504,8 @@ class T {
|
|
|
504
504
|
const i = e[0], n = e[1], r = e[2], a = e[3], o = e[4], l = e[5], h = t[0], c = t[1], u = t[2], f = t[3];
|
|
505
505
|
let g = i * h + o, p = g, b = i * u + o, m = b, w = a * c + l, y = w, v = a * f + l, A = v;
|
|
506
506
|
if (n !== 0 || r !== 0) {
|
|
507
|
-
const S = n * h,
|
|
508
|
-
g +=
|
|
507
|
+
const S = n * h, E = n * u, _ = r * c, C = r * f;
|
|
508
|
+
g += _, m += _, b += C, p += C, w += S, A += S, v += E, y += E;
|
|
509
509
|
}
|
|
510
510
|
s[0] = Math.min(s[0], g, b, p, m), s[1] = Math.min(s[1], w, v, y, A), s[2] = Math.max(s[2], g, b, p, m), s[3] = Math.max(s[3], w, v, y, A);
|
|
511
511
|
}
|
|
@@ -608,7 +608,7 @@ function bn(d, t, e) {
|
|
|
608
608
|
function ut(d, t, e) {
|
|
609
609
|
return Math.min(Math.max(d, t), e);
|
|
610
610
|
}
|
|
611
|
-
function
|
|
611
|
+
function Ei(d) {
|
|
612
612
|
return Uint8Array.prototype.toBase64 ? d.toBase64() : btoa(vi(d));
|
|
613
613
|
}
|
|
614
614
|
function yn(d) {
|
|
@@ -622,7 +622,7 @@ typeof Promise.try != "function" && (Promise.try = function(d, ...t) {
|
|
|
622
622
|
typeof Math.sumPrecise != "function" && (Math.sumPrecise = function(d) {
|
|
623
623
|
return d.reduce((t, e) => t + e, 0);
|
|
624
624
|
});
|
|
625
|
-
class
|
|
625
|
+
class _e {
|
|
626
626
|
static textContent(t) {
|
|
627
627
|
const e = [], s = {
|
|
628
628
|
items: e,
|
|
@@ -635,7 +635,7 @@ class Ee {
|
|
|
635
635
|
const a = n.name;
|
|
636
636
|
if (a === "#text")
|
|
637
637
|
r = n.value;
|
|
638
|
-
else if (
|
|
638
|
+
else if (_e.shouldBuildText(a))
|
|
639
639
|
n?.attributes?.textContent ? r = n.attributes.textContent : n.value && (r = n.value);
|
|
640
640
|
else return;
|
|
641
641
|
if (r !== null && e.push({
|
|
@@ -650,7 +650,7 @@ class Ee {
|
|
|
650
650
|
return !(t === "textarea" || t === "input" || t === "option" || t === "select");
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
|
-
class
|
|
653
|
+
class _i {
|
|
654
654
|
static setupStorage(t, e, s, i, n) {
|
|
655
655
|
const r = i.getValue(e, {
|
|
656
656
|
value: null
|
|
@@ -750,7 +750,7 @@ class Ei {
|
|
|
750
750
|
if (i.children.length === 0) {
|
|
751
751
|
if (i.value) {
|
|
752
752
|
const c = document.createTextNode(i.value);
|
|
753
|
-
r.append(c), a &&
|
|
753
|
+
r.append(c), a && _e.shouldBuildText(i.name) && l.push(c);
|
|
754
754
|
}
|
|
755
755
|
return {
|
|
756
756
|
textDivs: l
|
|
@@ -785,7 +785,7 @@ class Ei {
|
|
|
785
785
|
h.push([g, -1, b]);
|
|
786
786
|
else if (g.value) {
|
|
787
787
|
const m = document.createTextNode(g.value);
|
|
788
|
-
a &&
|
|
788
|
+
a && _e.shouldBuildText(p) && l.push(m), b.append(m);
|
|
789
789
|
}
|
|
790
790
|
}
|
|
791
791
|
for (const c of o.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))
|
|
@@ -1019,7 +1019,7 @@ function ye(d, t) {
|
|
|
1019
1019
|
const e = t ? URL.parse(d, t) : URL.parse(d);
|
|
1020
1020
|
return e?.protocol === "http:" || e?.protocol === "https:";
|
|
1021
1021
|
}
|
|
1022
|
-
function
|
|
1022
|
+
function _t(d) {
|
|
1023
1023
|
d.preventDefault();
|
|
1024
1024
|
}
|
|
1025
1025
|
function J(d) {
|
|
@@ -1079,7 +1079,7 @@ function ke(d) {
|
|
|
1079
1079
|
}
|
|
1080
1080
|
return d.startsWith("rgb(") ? d.slice(4, -1).split(",").map((t) => parseInt(t)) : d.startsWith("rgba(") ? d.slice(5, -1).split(",").map((t) => parseInt(t)).slice(0, 3) : (L(`Not a valid color format: "${d}"`), [0, 0, 0]);
|
|
1081
1081
|
}
|
|
1082
|
-
function
|
|
1082
|
+
function En(d) {
|
|
1083
1083
|
const t = document.createElement("span");
|
|
1084
1084
|
t.style.visibility = "hidden", t.style.colorScheme = "only light", document.body.append(t);
|
|
1085
1085
|
for (const e of d.keys()) {
|
|
@@ -1154,7 +1154,7 @@ class Rt {
|
|
|
1154
1154
|
}
|
|
1155
1155
|
}
|
|
1156
1156
|
const ws = ["image/apng", "image/avif", "image/bmp", "image/gif", "image/jpeg", "image/png", "image/svg+xml", "image/webp", "image/x-icon"];
|
|
1157
|
-
class
|
|
1157
|
+
class _n {
|
|
1158
1158
|
static get isDarkMode() {
|
|
1159
1159
|
return I(this, "isDarkMode", !!window?.matchMedia?.("(prefers-color-scheme: dark)").matches);
|
|
1160
1160
|
}
|
|
@@ -1271,7 +1271,7 @@ function Ci({
|
|
|
1271
1271
|
}
|
|
1272
1272
|
i.append(n);
|
|
1273
1273
|
} else
|
|
1274
|
-
|
|
1274
|
+
_i.render({
|
|
1275
1275
|
xfaHtml: d,
|
|
1276
1276
|
div: i,
|
|
1277
1277
|
intent: "richText"
|
|
@@ -1328,7 +1328,7 @@ class ve {
|
|
|
1328
1328
|
const t = this.#t = document.createElement("div");
|
|
1329
1329
|
t.classList.add("editToolbar", "hidden"), t.setAttribute("role", "toolbar");
|
|
1330
1330
|
const e = this.#i._uiManager._signal;
|
|
1331
|
-
e instanceof AbortSignal && !e.aborted && (t.addEventListener("contextmenu",
|
|
1331
|
+
e instanceof AbortSignal && !e.aborted && (t.addEventListener("contextmenu", _t, {
|
|
1332
1332
|
signal: e
|
|
1333
1333
|
}), t.addEventListener("pointerdown", ve.#l, {
|
|
1334
1334
|
signal: e
|
|
@@ -1364,7 +1364,7 @@ class ve {
|
|
|
1364
1364
|
}), t.addEventListener("focusout", this.#d.bind(this), {
|
|
1365
1365
|
capture: !0,
|
|
1366
1366
|
signal: e
|
|
1367
|
-
}), t.addEventListener("contextmenu",
|
|
1367
|
+
}), t.addEventListener("contextmenu", _t, {
|
|
1368
1368
|
signal: e
|
|
1369
1369
|
}), !0);
|
|
1370
1370
|
}
|
|
@@ -1460,7 +1460,7 @@ class Pn {
|
|
|
1460
1460
|
const t = this.#e = document.createElement("div");
|
|
1461
1461
|
t.className = "editToolbar", t.setAttribute("role", "toolbar");
|
|
1462
1462
|
const e = this.#i._signal;
|
|
1463
|
-
e instanceof AbortSignal && !e.aborted && t.addEventListener("contextmenu",
|
|
1463
|
+
e instanceof AbortSignal && !e.aborted && t.addEventListener("contextmenu", _t, {
|
|
1464
1464
|
signal: e
|
|
1465
1465
|
});
|
|
1466
1466
|
const s = this.#t = document.createElement("div");
|
|
@@ -1500,7 +1500,7 @@ class Pn {
|
|
|
1500
1500
|
const r = document.createElement("span");
|
|
1501
1501
|
n.append(r), r.className = "visuallyHidden", r.setAttribute("data-l10n-id", s);
|
|
1502
1502
|
const a = this.#i._signal;
|
|
1503
|
-
a instanceof AbortSignal && !a.aborted && (n.addEventListener("contextmenu",
|
|
1503
|
+
a instanceof AbortSignal && !a.aborted && (n.addEventListener("contextmenu", _t, {
|
|
1504
1504
|
signal: a
|
|
1505
1505
|
}), n.addEventListener("click", i, {
|
|
1506
1506
|
signal: a
|
|
@@ -1792,7 +1792,7 @@ class Rs {
|
|
|
1792
1792
|
static _colorsMapping = /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]);
|
|
1793
1793
|
get _colors() {
|
|
1794
1794
|
const t = /* @__PURE__ */ new Map([["CanvasText", null], ["Canvas", null]]);
|
|
1795
|
-
return
|
|
1795
|
+
return En(t), I(this, "_colors", t);
|
|
1796
1796
|
}
|
|
1797
1797
|
convert(t) {
|
|
1798
1798
|
const e = ke(t);
|
|
@@ -1831,11 +1831,11 @@ class $t {
|
|
|
1831
1831
|
#w = !1;
|
|
1832
1832
|
#y = !1;
|
|
1833
1833
|
#C = null;
|
|
1834
|
-
#
|
|
1834
|
+
#E = null;
|
|
1835
1835
|
#v = null;
|
|
1836
1836
|
#T = null;
|
|
1837
1837
|
#A = !1;
|
|
1838
|
-
#
|
|
1838
|
+
#_ = null;
|
|
1839
1839
|
#k = new Mn();
|
|
1840
1840
|
#P = !1;
|
|
1841
1841
|
#M = !1;
|
|
@@ -1844,7 +1844,7 @@ class $t {
|
|
|
1844
1844
|
#I = null;
|
|
1845
1845
|
#B = null;
|
|
1846
1846
|
#F = null;
|
|
1847
|
-
#
|
|
1847
|
+
#j = null;
|
|
1848
1848
|
#x = F.NONE;
|
|
1849
1849
|
#S = /* @__PURE__ */ new Set();
|
|
1850
1850
|
#L = null;
|
|
@@ -1862,14 +1862,14 @@ class $t {
|
|
|
1862
1862
|
};
|
|
1863
1863
|
#$ = [0, 0];
|
|
1864
1864
|
#O = null;
|
|
1865
|
-
#
|
|
1865
|
+
#G = null;
|
|
1866
1866
|
#J = null;
|
|
1867
1867
|
#Z = null;
|
|
1868
1868
|
#U = null;
|
|
1869
1869
|
static TRANSLATE_SMALL = 1;
|
|
1870
1870
|
static TRANSLATE_BIG = 10;
|
|
1871
1871
|
static get _keyboardManager() {
|
|
1872
|
-
const t = $t.prototype, e = (r) => r.#
|
|
1872
|
+
const t = $t.prototype, e = (r) => r.#G.contains(document.activeElement) && document.activeElement.tagName !== "BUTTON" && r.hasSomethingToControl(), s = (r, {
|
|
1873
1873
|
target: a
|
|
1874
1874
|
}) => {
|
|
1875
1875
|
if (a instanceof HTMLInputElement) {
|
|
@@ -1891,11 +1891,11 @@ class $t {
|
|
|
1891
1891
|
}], [["Enter", "mac+Enter"], t.addNewEditorFromKeyboard, {
|
|
1892
1892
|
checker: (r, {
|
|
1893
1893
|
target: a
|
|
1894
|
-
}) => !(a instanceof HTMLButtonElement) && r.#
|
|
1894
|
+
}) => !(a instanceof HTMLButtonElement) && r.#G.contains(a) && !r.isEnterHandled
|
|
1895
1895
|
}], [[" ", "mac+ "], t.addNewEditorFromKeyboard, {
|
|
1896
1896
|
checker: (r, {
|
|
1897
1897
|
target: a
|
|
1898
|
-
}) => !(a instanceof HTMLButtonElement) && r.#
|
|
1898
|
+
}) => !(a instanceof HTMLButtonElement) && r.#G.contains(document.activeElement)
|
|
1899
1899
|
}], [["Escape", "mac+Escape"], t.unselectAll], [["ArrowLeft", "mac+ArrowLeft"], t.translateSelectedEditors, {
|
|
1900
1900
|
args: [-i, 0],
|
|
1901
1901
|
checker: e
|
|
@@ -1924,7 +1924,7 @@ class $t {
|
|
|
1924
1924
|
}
|
|
1925
1925
|
constructor(t, e, s, i, n, r, a, o, l, h, c, u, f, g, p, b) {
|
|
1926
1926
|
const m = this._signal = this.#t.signal;
|
|
1927
|
-
this.#
|
|
1927
|
+
this.#G = t, this.#J = e, this.#Z = s, this.#r = i, this.#l = n, this.#H = r, this.#W = o, this._eventBus = a, a._on("editingaction", this.onEditingAction.bind(this), {
|
|
1928
1928
|
signal: m
|
|
1929
1929
|
}), a._on("pagechanging", this.onPageChanging.bind(this), {
|
|
1930
1930
|
signal: m
|
|
@@ -1946,7 +1946,7 @@ class $t {
|
|
|
1946
1946
|
}, {
|
|
1947
1947
|
capture: !0,
|
|
1948
1948
|
signal: m
|
|
1949
|
-
}), this.#at(), this.#ut(), this.#et(), this.#n = o.annotationStorage, this.#C = o.filterFactory, this.#z = l, this.#T = h || null, this.#b = c, this.#w = u, this.#y = f, this.#
|
|
1949
|
+
}), this.#at(), this.#ut(), this.#et(), this.#n = o.annotationStorage, this.#C = o.filterFactory, this.#z = l, this.#T = h || null, this.#b = c, this.#w = u, this.#y = f, this.#j = g || null, this.viewParameters = {
|
|
1950
1950
|
realScale: ce.PDF_TO_CSS_UNITS,
|
|
1951
1951
|
rotation: 0
|
|
1952
1952
|
}, this.isShiftKeyDown = !1, this._editorUndoBar = p || null, this._supportsPinchToZoom = b !== !1, n?.setSidebarUiManager(this);
|
|
@@ -1955,13 +1955,13 @@ class $t {
|
|
|
1955
1955
|
this.#U?.resolve(), this.#U = null, this.#t?.abort(), this.#t = null, this._signal = null;
|
|
1956
1956
|
for (const t of this.#a.values())
|
|
1957
1957
|
t.destroy();
|
|
1958
|
-
this.#a.clear(), this.#s.clear(), this.#p.clear(), this.#F?.clear(), this.#e = null, this.#S.clear(), this.#h.destroy(), this.#r?.destroy(), this.#l?.destroy(), this.#H?.destroy(), this.#
|
|
1958
|
+
this.#a.clear(), this.#s.clear(), this.#p.clear(), this.#F?.clear(), this.#e = null, this.#S.clear(), this.#h.destroy(), this.#r?.destroy(), this.#l?.destroy(), this.#H?.destroy(), this.#_?.hide(), this.#_ = null, this.#B?.destroy(), this.#B = null, this.#i = null, this.#E && (clearTimeout(this.#E), this.#E = null), this.#O && (clearTimeout(this.#O), this.#O = null), this._editorUndoBar?.destroy(), this.#W = null;
|
|
1959
1959
|
}
|
|
1960
1960
|
combinedSignal(t) {
|
|
1961
1961
|
return AbortSignal.any([this._signal, t.signal]);
|
|
1962
1962
|
}
|
|
1963
1963
|
get mlManager() {
|
|
1964
|
-
return this.#
|
|
1964
|
+
return this.#j;
|
|
1965
1965
|
}
|
|
1966
1966
|
get useNewAltTextFlow() {
|
|
1967
1967
|
return this.#w;
|
|
@@ -1973,7 +1973,7 @@ class $t {
|
|
|
1973
1973
|
return I(this, "hcmFilter", this.#z ? this.#C.addHCMFilter(this.#z.foreground, this.#z.background) : "none");
|
|
1974
1974
|
}
|
|
1975
1975
|
get direction() {
|
|
1976
|
-
return I(this, "direction", getComputedStyle(this.#
|
|
1976
|
+
return I(this, "direction", getComputedStyle(this.#G).direction);
|
|
1977
1977
|
}
|
|
1978
1978
|
get _highlightColors() {
|
|
1979
1979
|
return I(this, "_highlightColors", this.#T ? new Map(this.#T.split(",").map((t) => (t = t.split("=").map((e) => e.trim()), t[1] = t[1].toUpperCase(), t))) : null);
|
|
@@ -2091,7 +2091,7 @@ class $t {
|
|
|
2091
2091
|
this.#f = t - 1;
|
|
2092
2092
|
}
|
|
2093
2093
|
focusMainContainer() {
|
|
2094
|
-
this.#
|
|
2094
|
+
this.#G.focus();
|
|
2095
2095
|
}
|
|
2096
2096
|
findParent(t, e) {
|
|
2097
2097
|
for (const s of this.#a.values()) {
|
|
@@ -2186,7 +2186,7 @@ class $t {
|
|
|
2186
2186
|
if (!t || t.isCollapsed)
|
|
2187
2187
|
return;
|
|
2188
2188
|
const s = this.#Q(t).closest(".textLayer"), i = this.getSelectionBoxes(s);
|
|
2189
|
-
i && (this.#
|
|
2189
|
+
i && (this.#_ ||= new Pn(this), this.#_.show(s, i, this.direction === "ltr"));
|
|
2190
2190
|
}
|
|
2191
2191
|
getAndRemoveDataFromAnnotationStorage(t) {
|
|
2192
2192
|
if (!this.#n)
|
|
@@ -2204,7 +2204,7 @@ class $t {
|
|
|
2204
2204
|
#rt() {
|
|
2205
2205
|
const t = document.getSelection();
|
|
2206
2206
|
if (!t || t.isCollapsed) {
|
|
2207
|
-
this.#L && (this.#
|
|
2207
|
+
this.#L && (this.#_?.hide(), this.#L = null, this.#D({
|
|
2208
2208
|
hasSelectedText: !1
|
|
2209
2209
|
}));
|
|
2210
2210
|
return;
|
|
@@ -2216,12 +2216,12 @@ class $t {
|
|
|
2216
2216
|
return;
|
|
2217
2217
|
const i = this.#Q(t).closest(".textLayer");
|
|
2218
2218
|
if (!i) {
|
|
2219
|
-
this.#L && (this.#
|
|
2219
|
+
this.#L && (this.#_?.hide(), this.#L = null, this.#D({
|
|
2220
2220
|
hasSelectedText: !1
|
|
2221
2221
|
}));
|
|
2222
2222
|
return;
|
|
2223
2223
|
}
|
|
2224
|
-
if (this.#
|
|
2224
|
+
if (this.#_?.hide(), this.#L = e, this.#D({
|
|
2225
2225
|
hasSelectedText: !0
|
|
2226
2226
|
}), !(this.#x !== F.HIGHLIGHT && this.#x !== F.NONE) && (this.#x === F.HIGHLIGHT && this.showAllEditors("highlight", !0, !0), this.#A = this.isShiftKeyDown, !this.isShiftKeyDown)) {
|
|
2227
2227
|
const n = this.#x === F.HIGHLIGHT ? this.#tt(i) : null;
|
|
@@ -2602,8 +2602,8 @@ class $t {
|
|
|
2602
2602
|
this.#s.set(t.id, t);
|
|
2603
2603
|
}
|
|
2604
2604
|
removeEditor(t) {
|
|
2605
|
-
t.div.contains(document.activeElement) && (this.#
|
|
2606
|
-
this.focusMainContainer(), this.#
|
|
2605
|
+
t.div.contains(document.activeElement) && (this.#E && clearTimeout(this.#E), this.#E = setTimeout(() => {
|
|
2606
|
+
this.focusMainContainer(), this.#E = null;
|
|
2607
2607
|
}, 0)), this.#s.delete(t.id), t.annotationElementId && this.#F?.delete(t.annotationElementId), this.unselect(t), (!t.annotationElementId || !this.#m.has(t.annotationElementId)) && this.#n?.remove(t.id);
|
|
2608
2608
|
}
|
|
2609
2609
|
addDeletedAnnotationElement(t) {
|
|
@@ -2982,7 +2982,7 @@ class Dt {
|
|
|
2982
2982
|
const e = this.#s = document.createElement("span");
|
|
2983
2983
|
t.append(e), this.#d ? (t.classList.add("new"), t.setAttribute("data-l10n-id", Dt.#f.missing), e.setAttribute("data-l10n-id", Dt.#f["missing-label"])) : (t.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-button"), e.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-button-label"));
|
|
2984
2984
|
const s = this.#h._uiManager._signal;
|
|
2985
|
-
t.addEventListener("contextmenu",
|
|
2985
|
+
t.addEventListener("contextmenu", _t, {
|
|
2986
2986
|
signal: s
|
|
2987
2987
|
}), t.addEventListener("pointerdown", (n) => n.stopPropagation(), {
|
|
2988
2988
|
signal: s
|
|
@@ -3204,7 +3204,7 @@ class Ie {
|
|
|
3204
3204
|
const s = this.#s._uiManager._signal;
|
|
3205
3205
|
if (!(s instanceof AbortSignal) || s.aborted)
|
|
3206
3206
|
return t;
|
|
3207
|
-
t.addEventListener("contextmenu",
|
|
3207
|
+
t.addEventListener("contextmenu", _t, {
|
|
3208
3208
|
signal: s
|
|
3209
3209
|
}), e && (t.addEventListener("focusin", (n) => {
|
|
3210
3210
|
this.#s._focusEventsAllowed = !1, J(n);
|
|
@@ -3433,7 +3433,7 @@ class D {
|
|
|
3433
3433
|
#w = !1;
|
|
3434
3434
|
#y = null;
|
|
3435
3435
|
#C = 0;
|
|
3436
|
-
#
|
|
3436
|
+
#E = 0;
|
|
3437
3437
|
#v = null;
|
|
3438
3438
|
#T = null;
|
|
3439
3439
|
isSelected = !1;
|
|
@@ -3447,7 +3447,7 @@ class D {
|
|
|
3447
3447
|
static _l10n = null;
|
|
3448
3448
|
static _l10nResizer = null;
|
|
3449
3449
|
#A = !1;
|
|
3450
|
-
#
|
|
3450
|
+
#_ = D._zIndex++;
|
|
3451
3451
|
static _borderLineWidth = -1;
|
|
3452
3452
|
static _colorManager = new Rs();
|
|
3453
3453
|
static _zIndex = 1;
|
|
@@ -3531,7 +3531,7 @@ class D {
|
|
|
3531
3531
|
return !1;
|
|
3532
3532
|
}
|
|
3533
3533
|
static paste(t, e) {
|
|
3534
|
-
|
|
3534
|
+
G("Not implemented");
|
|
3535
3535
|
}
|
|
3536
3536
|
get propertiesToUpdate() {
|
|
3537
3537
|
return [];
|
|
@@ -3576,7 +3576,7 @@ class D {
|
|
|
3576
3576
|
this.div.style.zIndex = 0;
|
|
3577
3577
|
}
|
|
3578
3578
|
setInForeground() {
|
|
3579
|
-
this.div.style.zIndex = this.#
|
|
3579
|
+
this.div.style.zIndex = this.#_;
|
|
3580
3580
|
}
|
|
3581
3581
|
setParent(t) {
|
|
3582
3582
|
t !== null ? (this.pageIndex = t.pageIndex, this.pageDimensions = t.pageDimensions) : (this.#O(), this.#d?.remove(), this.#d = null), this.parent = t;
|
|
@@ -3773,7 +3773,7 @@ class D {
|
|
|
3773
3773
|
const i = document.createElement("div");
|
|
3774
3774
|
this.#h.append(i), i.classList.add("resizer", s), i.setAttribute("data-resizer-name", s), i.addEventListener("pointerdown", this.#R.bind(this, s), {
|
|
3775
3775
|
signal: e
|
|
3776
|
-
}), i.addEventListener("contextmenu",
|
|
3776
|
+
}), i.addEventListener("contextmenu", _t, {
|
|
3777
3777
|
signal: e
|
|
3778
3778
|
}), i.tabIndex = -1;
|
|
3779
3779
|
}
|
|
@@ -3797,7 +3797,7 @@ class D {
|
|
|
3797
3797
|
}), window.addEventListener("touchmove", J, {
|
|
3798
3798
|
passive: !1,
|
|
3799
3799
|
signal: r
|
|
3800
|
-
}), window.addEventListener("contextmenu",
|
|
3800
|
+
}), window.addEventListener("contextmenu", _t, {
|
|
3801
3801
|
signal: r
|
|
3802
3802
|
}), this.#u = {
|
|
3803
3803
|
savedX: this.x,
|
|
@@ -3872,8 +3872,8 @@ class D {
|
|
|
3872
3872
|
}
|
|
3873
3873
|
const y = p(a, o), v = b(a, o);
|
|
3874
3874
|
let A = u(...v);
|
|
3875
|
-
const S = D._round(n + A[0]),
|
|
3876
|
-
let
|
|
3875
|
+
const S = D._round(n + A[0]), E = D._round(r + A[1]);
|
|
3876
|
+
let _ = 1, C = 1, M, x;
|
|
3877
3877
|
if (e.fromKeyboard)
|
|
3878
3878
|
({
|
|
3879
3879
|
deltaX: M,
|
|
@@ -3888,11 +3888,11 @@ class D {
|
|
|
3888
3888
|
}
|
|
3889
3889
|
if ([M, x] = g(M / s, x / i), m) {
|
|
3890
3890
|
const k = Math.hypot(a, o);
|
|
3891
|
-
|
|
3892
|
-
} else w ?
|
|
3893
|
-
const H = D._round(a *
|
|
3891
|
+
_ = C = Math.max(Math.min(Math.hypot(v[0] - y[0] - M, v[1] - y[1] - x) / k, 1 / a, 1 / o), l / a, h / o);
|
|
3892
|
+
} else w ? _ = ut(Math.abs(v[0] - y[0] - M), l, 1) / a : C = ut(Math.abs(v[1] - y[1] - x), h, 1) / o;
|
|
3893
|
+
const H = D._round(a * _), V = D._round(o * C);
|
|
3894
3894
|
A = u(...b(H, V));
|
|
3895
|
-
const O = S - A[0], tt =
|
|
3895
|
+
const O = S - A[0], tt = E - A[1];
|
|
3896
3896
|
this.#c ||= [this.x, this.y, this.width, this.height], this.width = H, this.height = V, this.x = O, this.y = tt, this.setDims(), this.fixAndSetPosition(), this._onResizing();
|
|
3897
3897
|
}
|
|
3898
3898
|
_onResizing() {
|
|
@@ -4055,13 +4055,13 @@ class D {
|
|
|
4055
4055
|
return this.translate(i, n), Ti(this, t, ["keydown", "pointerdown", "dblclick"]), this.isResizable && this._uiManager._supportsPinchToZoom && (this.#T ||= new ts({
|
|
4056
4056
|
container: t,
|
|
4057
4057
|
isPinchingDisabled: () => !this.isSelected,
|
|
4058
|
-
onPinchStart: this.#
|
|
4058
|
+
onPinchStart: this.#j.bind(this),
|
|
4059
4059
|
onPinching: this.#x.bind(this),
|
|
4060
4060
|
onPinchEnd: this.#S.bind(this),
|
|
4061
4061
|
signal: this._uiManager._signal
|
|
4062
4062
|
})), this.addStandaloneCommentButton(), this._uiManager._editorUndoBar?.hide(), t;
|
|
4063
4063
|
}
|
|
4064
|
-
#
|
|
4064
|
+
#j() {
|
|
4065
4065
|
this.#u = {
|
|
4066
4066
|
savedX: this.x,
|
|
4067
4067
|
savedY: this.y,
|
|
@@ -4073,7 +4073,7 @@ class D {
|
|
|
4073
4073
|
let n = 0.7 * (s / e) + 1 - 0.7;
|
|
4074
4074
|
if (n === 1)
|
|
4075
4075
|
return;
|
|
4076
|
-
const r = this.#M(this.rotation), a = (S,
|
|
4076
|
+
const r = this.#M(this.rotation), a = (S, E) => [r[0] * S + r[2] * E, r[1] * S + r[3] * E], [o, l] = this.parentDimensions, h = this.x, c = this.y, u = this.width, f = this.height, g = D.MIN_SIZE / o, p = D.MIN_SIZE / l;
|
|
4077
4077
|
n = Math.max(Math.min(n, 1 / u, 1 / f), g / u, p / f);
|
|
4078
4078
|
const b = D._round(u * n), m = D._round(f * n);
|
|
4079
4079
|
if (b === u && m === f)
|
|
@@ -4118,7 +4118,7 @@ class D {
|
|
|
4118
4118
|
}, a = (l) => {
|
|
4119
4119
|
i.abort(), this.#n = null, this.#g = !1, this._uiManager.endDragSession() || this.#L(l), s && this._onStopDragging();
|
|
4120
4120
|
};
|
|
4121
|
-
e && (this.#C = t.clientX, this.#
|
|
4121
|
+
e && (this.#C = t.clientX, this.#E = t.clientY, this.#n = t.pointerId, this.#o = t.pointerType, window.addEventListener("pointermove", (l) => {
|
|
4122
4122
|
s || (s = !0, this._uiManager.toggleComment(this, !0, !1), this._onStartDragging());
|
|
4123
4123
|
const {
|
|
4124
4124
|
clientX: h,
|
|
@@ -4129,8 +4129,8 @@ class D {
|
|
|
4129
4129
|
J(l);
|
|
4130
4130
|
return;
|
|
4131
4131
|
}
|
|
4132
|
-
const [f, g] = this.screenToPageTranslation(h - this.#C, c - this.#
|
|
4133
|
-
this.#C = h, this.#
|
|
4132
|
+
const [f, g] = this.screenToPageTranslation(h - this.#C, c - this.#E);
|
|
4133
|
+
this.#C = h, this.#E = c, this._uiManager.dragSelectedEditors(f, g);
|
|
4134
4134
|
}, r), window.addEventListener("touchmove", J, r), window.addEventListener("pointerdown", (l) => {
|
|
4135
4135
|
l.pointerType === this.#o && (this.#T || l.isPrimary) && a(l), J(l);
|
|
4136
4136
|
}, r));
|
|
@@ -4764,7 +4764,7 @@ class Mi extends Ls {
|
|
|
4764
4764
|
};
|
|
4765
4765
|
}
|
|
4766
4766
|
get print() {
|
|
4767
|
-
|
|
4767
|
+
G("Should not call PrintAnnotationStorage.print");
|
|
4768
4768
|
}
|
|
4769
4769
|
get serializable() {
|
|
4770
4770
|
return this.#t;
|
|
@@ -4820,7 +4820,7 @@ class Rn {
|
|
|
4820
4820
|
}
|
|
4821
4821
|
return;
|
|
4822
4822
|
}
|
|
4823
|
-
|
|
4823
|
+
G("Not implemented: loadSystemFont without the Font Loading API.");
|
|
4824
4824
|
}
|
|
4825
4825
|
}
|
|
4826
4826
|
async bind(t) {
|
|
@@ -4883,9 +4883,9 @@ class Rn {
|
|
|
4883
4883
|
function s(v, A) {
|
|
4884
4884
|
return v.charCodeAt(A) << 24 | v.charCodeAt(A + 1) << 16 | v.charCodeAt(A + 2) << 8 | v.charCodeAt(A + 3) & 255;
|
|
4885
4885
|
}
|
|
4886
|
-
function i(v, A, S,
|
|
4887
|
-
const
|
|
4888
|
-
return
|
|
4886
|
+
function i(v, A, S, E) {
|
|
4887
|
+
const _ = v.substring(0, A), C = v.substring(A + S);
|
|
4888
|
+
return _ + E + C;
|
|
4889
4889
|
}
|
|
4890
4890
|
let n, r;
|
|
4891
4891
|
const a = this._document.createElement("canvas");
|
|
@@ -4946,7 +4946,7 @@ class Ln {
|
|
|
4946
4946
|
createFontFaceRule() {
|
|
4947
4947
|
if (!this.data || this.disableFontFace)
|
|
4948
4948
|
return null;
|
|
4949
|
-
const t = `url(data:${this.mimetype};base64,${
|
|
4949
|
+
const t = `url(data:${this.mimetype};base64,${Ei(this.data)});`;
|
|
4950
4950
|
let e;
|
|
4951
4951
|
if (!this.cssFontInfo)
|
|
4952
4952
|
e = `@font-face {font-family:"${this.loadedName}";src:${t}}`;
|
|
@@ -5151,7 +5151,7 @@ class oe {
|
|
|
5151
5151
|
};
|
|
5152
5152
|
}
|
|
5153
5153
|
}
|
|
5154
|
-
class
|
|
5154
|
+
class j {
|
|
5155
5155
|
static bools = ["black", "bold", "disableFontFace", "fontExtraProperties", "isInvalidPDFjsFont", "isType3Font", "italic", "missingFile", "remeasure", "vertical"];
|
|
5156
5156
|
static numbers = ["ascent", "defaultWidth", "descent"];
|
|
5157
5157
|
static strings = ["fallbackName", "loadedName", "mimetype", "name"];
|
|
@@ -5170,7 +5170,7 @@ class G {
|
|
|
5170
5170
|
this.#r = t, this.#n = new TextDecoder(), this.#o = new DataView(this.#r), e && Object.assign(this, e);
|
|
5171
5171
|
}
|
|
5172
5172
|
#h(t) {
|
|
5173
|
-
B(t <
|
|
5173
|
+
B(t < j.bools.length, "Invalid boolean index");
|
|
5174
5174
|
const e = Math.floor(t / 4), s = t * 2 % 8, i = this.#o.getUint8(e) >> s & 3;
|
|
5175
5175
|
return i === 0 ? void 0 : i === 2;
|
|
5176
5176
|
}
|
|
@@ -5205,7 +5205,7 @@ class G {
|
|
|
5205
5205
|
return this.#h(9);
|
|
5206
5206
|
}
|
|
5207
5207
|
#l(t) {
|
|
5208
|
-
return B(t <
|
|
5208
|
+
return B(t < j.numbers.length, "Invalid number index"), this.#o.getFloat64(j.#t + t * 8);
|
|
5209
5209
|
}
|
|
5210
5210
|
get ascent() {
|
|
5211
5211
|
return this.#l(0);
|
|
@@ -5217,7 +5217,7 @@ class G {
|
|
|
5217
5217
|
return this.#l(2);
|
|
5218
5218
|
}
|
|
5219
5219
|
get bbox() {
|
|
5220
|
-
let t =
|
|
5220
|
+
let t = j.#e;
|
|
5221
5221
|
if (this.#o.getUint8(t) === 0)
|
|
5222
5222
|
return;
|
|
5223
5223
|
t += 1;
|
|
@@ -5227,7 +5227,7 @@ class G {
|
|
|
5227
5227
|
return s;
|
|
5228
5228
|
}
|
|
5229
5229
|
get fontMatrix() {
|
|
5230
|
-
let t =
|
|
5230
|
+
let t = j.#i;
|
|
5231
5231
|
if (this.#o.getUint8(t) === 0)
|
|
5232
5232
|
return;
|
|
5233
5233
|
t += 1;
|
|
@@ -5237,7 +5237,7 @@ class G {
|
|
|
5237
5237
|
return s;
|
|
5238
5238
|
}
|
|
5239
5239
|
get defaultVMetrics() {
|
|
5240
|
-
let t =
|
|
5240
|
+
let t = j.#s;
|
|
5241
5241
|
if (this.#o.getUint8(t) === 0)
|
|
5242
5242
|
return;
|
|
5243
5243
|
t += 1;
|
|
@@ -5247,8 +5247,8 @@ class G {
|
|
|
5247
5247
|
return s;
|
|
5248
5248
|
}
|
|
5249
5249
|
#u(t) {
|
|
5250
|
-
B(t <
|
|
5251
|
-
let e =
|
|
5250
|
+
B(t < j.strings.length, "Invalid string index");
|
|
5251
|
+
let e = j.#a + 4;
|
|
5252
5252
|
for (let n = 0; n < t; n++)
|
|
5253
5253
|
e += this.#o.getUint32(e) + 4;
|
|
5254
5254
|
const s = this.#o.getUint32(e), i = new Uint8Array(s);
|
|
@@ -5267,7 +5267,7 @@ class G {
|
|
|
5267
5267
|
return this.#u(3);
|
|
5268
5268
|
}
|
|
5269
5269
|
get data() {
|
|
5270
|
-
let t =
|
|
5270
|
+
let t = j.#a;
|
|
5271
5271
|
const e = this.#o.getUint32(t);
|
|
5272
5272
|
t += 4 + e;
|
|
5273
5273
|
const s = this.#o.getUint32(t);
|
|
@@ -5279,7 +5279,7 @@ class G {
|
|
|
5279
5279
|
return new Uint8Array(this.#r, t + 4, n);
|
|
5280
5280
|
}
|
|
5281
5281
|
clearData() {
|
|
5282
|
-
let t =
|
|
5282
|
+
let t = j.#a;
|
|
5283
5283
|
const e = this.#o.getUint32(t);
|
|
5284
5284
|
t += 4 + e;
|
|
5285
5285
|
const s = this.#o.getUint32(t);
|
|
@@ -5290,7 +5290,7 @@ class G {
|
|
|
5290
5290
|
new Uint8Array(this.#r, t + 4, n).fill(0), this.#o.setUint32(t, 0);
|
|
5291
5291
|
}
|
|
5292
5292
|
get cssFontInfo() {
|
|
5293
|
-
let t =
|
|
5293
|
+
let t = j.#a;
|
|
5294
5294
|
const e = this.#o.getUint32(t);
|
|
5295
5295
|
t += 4 + e;
|
|
5296
5296
|
const s = this.#o.getUint32(t);
|
|
@@ -5302,7 +5302,7 @@ class G {
|
|
|
5302
5302
|
return n.set(new Uint8Array(this.#r, t + 4, i)), new ae(n.buffer);
|
|
5303
5303
|
}
|
|
5304
5304
|
get systemFontInfo() {
|
|
5305
|
-
let t =
|
|
5305
|
+
let t = j.#a;
|
|
5306
5306
|
const e = this.#o.getUint32(t);
|
|
5307
5307
|
t += 4 + e;
|
|
5308
5308
|
const s = this.#o.getUint32(t);
|
|
@@ -5314,43 +5314,43 @@ class G {
|
|
|
5314
5314
|
static write(t) {
|
|
5315
5315
|
const e = t.systemFontInfo ? oe.write(t.systemFontInfo) : null, s = t.cssFontInfo ? ae.write(t.cssFontInfo) : null, i = new TextEncoder(), n = {};
|
|
5316
5316
|
let r = 0;
|
|
5317
|
-
for (const p of
|
|
5317
|
+
for (const p of j.strings)
|
|
5318
5318
|
n[p] = i.encode(t[p]), r += 4 + n[p].length;
|
|
5319
|
-
const a =
|
|
5319
|
+
const a = j.#a + 4 + r + 4 + (e ? e.byteLength : 0) + 4 + (s ? s.byteLength : 0) + 4 + (t.data ? t.data.length : 0), o = new ArrayBuffer(a), l = new Uint8Array(o), h = new DataView(o);
|
|
5320
5320
|
let c = 0;
|
|
5321
|
-
const u =
|
|
5321
|
+
const u = j.bools.length;
|
|
5322
5322
|
let f = 0, g = 0;
|
|
5323
5323
|
for (let p = 0; p < u; p++) {
|
|
5324
|
-
const b = t[
|
|
5324
|
+
const b = t[j.bools[p]];
|
|
5325
5325
|
f |= (b === void 0 ? 0 : b ? 2 : 1) << g, g += 2, (g === 8 || p === u - 1) && (h.setUint8(c++, f), f = 0, g = 0);
|
|
5326
5326
|
}
|
|
5327
|
-
B(c ===
|
|
5328
|
-
for (const p of
|
|
5327
|
+
B(c === j.#t, "FontInfo.write: Boolean properties offset mismatch");
|
|
5328
|
+
for (const p of j.numbers)
|
|
5329
5329
|
h.setFloat64(c, t[p]), c += 8;
|
|
5330
|
-
if (B(c ===
|
|
5330
|
+
if (B(c === j.#e, "FontInfo.write: Number properties offset mismatch"), t.bbox) {
|
|
5331
5331
|
h.setUint8(c++, 4);
|
|
5332
5332
|
for (const p of t.bbox)
|
|
5333
5333
|
h.setInt16(c, p, !0), c += 2;
|
|
5334
5334
|
} else
|
|
5335
5335
|
h.setUint8(c++, 0), c += 8;
|
|
5336
|
-
if (B(c ===
|
|
5336
|
+
if (B(c === j.#i, "FontInfo.write: BBox properties offset mismatch"), t.fontMatrix) {
|
|
5337
5337
|
h.setUint8(c++, 6);
|
|
5338
5338
|
for (const p of t.fontMatrix)
|
|
5339
5339
|
h.setFloat64(c, p, !0), c += 8;
|
|
5340
5340
|
} else
|
|
5341
5341
|
h.setUint8(c++, 0), c += 48;
|
|
5342
|
-
if (B(c ===
|
|
5342
|
+
if (B(c === j.#s, "FontInfo.write: FontMatrix properties offset mismatch"), t.defaultVMetrics) {
|
|
5343
5343
|
h.setUint8(c++, 1);
|
|
5344
5344
|
for (const p of t.defaultVMetrics)
|
|
5345
5345
|
h.setInt16(c, p, !0), c += 2;
|
|
5346
5346
|
} else
|
|
5347
5347
|
h.setUint8(c++, 0), c += 6;
|
|
5348
|
-
B(c ===
|
|
5349
|
-
for (const p of
|
|
5348
|
+
B(c === j.#a, "FontInfo.write: DefaultVMetrics properties offset mismatch"), h.setUint32(j.#a, 0), c += 4;
|
|
5349
|
+
for (const p of j.strings) {
|
|
5350
5350
|
const b = n[p], m = b.length;
|
|
5351
5351
|
h.setUint32(c, m), l.set(b, c + 4), c += 4 + m;
|
|
5352
5352
|
}
|
|
5353
|
-
if (h.setUint32(
|
|
5353
|
+
if (h.setUint32(j.#a, c - j.#a - 4), !e)
|
|
5354
5354
|
h.setUint32(c, 0), c += 4;
|
|
5355
5355
|
else {
|
|
5356
5356
|
const p = e.byteLength;
|
|
@@ -5460,8 +5460,8 @@ class ot {
|
|
|
5460
5460
|
if (h.length > 0) {
|
|
5461
5461
|
let w = h[0], y = h[0], v = h[1], A = h[1];
|
|
5462
5462
|
for (let S = 0; S < h.length; S += 2) {
|
|
5463
|
-
const
|
|
5464
|
-
w = w >
|
|
5463
|
+
const E = h[S], _ = h[S + 1];
|
|
5464
|
+
w = w > E ? E : w, v = v > _ ? _ : v, y = y < E ? E : y, A = A < _ ? _ : A;
|
|
5465
5465
|
}
|
|
5466
5466
|
m = [w, v, y, A];
|
|
5467
5467
|
}
|
|
@@ -5570,7 +5570,7 @@ function ei() {
|
|
|
5570
5570
|
function gt(d) {
|
|
5571
5571
|
if (d instanceof zt || d instanceof bs || d instanceof Xs || d instanceof We || d instanceof os)
|
|
5572
5572
|
return d;
|
|
5573
|
-
switch (d instanceof Error || typeof d == "object" && d !== null ||
|
|
5573
|
+
switch (d instanceof Error || typeof d == "object" && d !== null || G('wrapReason: Expected "reason" to be a (possibly cloned) Error.'), d.name) {
|
|
5574
5574
|
case "AbortException":
|
|
5575
5575
|
return new zt(d.message);
|
|
5576
5576
|
case "InvalidPDFException":
|
|
@@ -5889,7 +5889,7 @@ class ki {
|
|
|
5889
5889
|
t.canvas.width = 0, t.canvas.height = 0, t.canvas = null, t.context = null;
|
|
5890
5890
|
}
|
|
5891
5891
|
_createCanvas(t, e) {
|
|
5892
|
-
|
|
5892
|
+
G("Abstract method `_createCanvas` called.");
|
|
5893
5893
|
}
|
|
5894
5894
|
}
|
|
5895
5895
|
class Un extends ki {
|
|
@@ -5929,7 +5929,7 @@ class Di {
|
|
|
5929
5929
|
});
|
|
5930
5930
|
}
|
|
5931
5931
|
async _fetch(t) {
|
|
5932
|
-
|
|
5932
|
+
G("Abstract method `_fetch` called.");
|
|
5933
5933
|
}
|
|
5934
5934
|
}
|
|
5935
5935
|
class si extends Di {
|
|
@@ -6089,16 +6089,16 @@ class zn extends Ri {
|
|
|
6089
6089
|
let h = Math.round(0.2126 * o[0] + 0.7152 * o[1] + 0.0722 * o[2]), c = Math.round(0.2126 * l[0] + 0.7152 * l[1] + 0.0722 * l[2]), [u, f] = [i, n].map(this.#w.bind(this));
|
|
6090
6090
|
c < h && ([h, c, u, f] = [c, h, f, u]), this.#l.style.color = "";
|
|
6091
6091
|
const g = (m, w, y) => {
|
|
6092
|
-
const v = new Array(256), A = (c - h) / y, S = m / 255,
|
|
6093
|
-
let
|
|
6092
|
+
const v = new Array(256), A = (c - h) / y, S = m / 255, E = (w - m) / (255 * y);
|
|
6093
|
+
let _ = 0;
|
|
6094
6094
|
for (let C = 0; C <= y; C++) {
|
|
6095
|
-
const M = Math.round(h + C * A), x = S + C *
|
|
6096
|
-
for (let H =
|
|
6095
|
+
const M = Math.round(h + C * A), x = S + C * E;
|
|
6096
|
+
for (let H = _; H <= M; H++)
|
|
6097
6097
|
v[H] = x;
|
|
6098
|
-
|
|
6098
|
+
_ = M + 1;
|
|
6099
6099
|
}
|
|
6100
|
-
for (let C =
|
|
6101
|
-
v[C] = v[
|
|
6100
|
+
for (let C = _; C < 256; C++)
|
|
6101
|
+
v[C] = v[_ - 1];
|
|
6102
6102
|
return v.join(",");
|
|
6103
6103
|
}, p = `g_${this.#s}_hcm_${t}_filter`, b = a.filter = this.#g(p);
|
|
6104
6104
|
return this.#m(b), this.#p(g(u[0], f[0], 5), g(u[1], f[1], 5), g(u[2], f[2], 5), b), a.url = this.#d(p), a.url;
|
|
@@ -6153,7 +6153,7 @@ class Li {
|
|
|
6153
6153
|
});
|
|
6154
6154
|
}
|
|
6155
6155
|
async _fetch(t) {
|
|
6156
|
-
|
|
6156
|
+
G("Abstract method `_fetch` called.");
|
|
6157
6157
|
}
|
|
6158
6158
|
}
|
|
6159
6159
|
class ii extends Li {
|
|
@@ -6181,7 +6181,7 @@ class Ii {
|
|
|
6181
6181
|
});
|
|
6182
6182
|
}
|
|
6183
6183
|
async _fetch(t) {
|
|
6184
|
-
|
|
6184
|
+
G("Abstract method `_fetch` called.");
|
|
6185
6185
|
}
|
|
6186
6186
|
}
|
|
6187
6187
|
class ni extends Ii {
|
|
@@ -6202,12 +6202,12 @@ class Vn extends ki {
|
|
|
6202
6202
|
return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t, e);
|
|
6203
6203
|
}
|
|
6204
6204
|
}
|
|
6205
|
-
class
|
|
6205
|
+
class jn extends Di {
|
|
6206
6206
|
async _fetch(t) {
|
|
6207
6207
|
return Is(t);
|
|
6208
6208
|
}
|
|
6209
6209
|
}
|
|
6210
|
-
class
|
|
6210
|
+
class Gn extends Li {
|
|
6211
6211
|
async _fetch(t) {
|
|
6212
6212
|
return Is(t);
|
|
6213
6213
|
}
|
|
@@ -6224,7 +6224,7 @@ const Zt = "__forcedDependency", {
|
|
|
6224
6224
|
function Ne(d, t, e, s, i, n) {
|
|
6225
6225
|
d[t * 4 + 0] = Math.min(d[t * 4 + 0], e), d[t * 4 + 1] = Math.min(d[t * 4 + 1], s), d[t * 4 + 2] = Math.max(d[t * 4 + 2], i), d[t * 4 + 3] = Math.max(d[t * 4 + 3], n);
|
|
6226
6226
|
}
|
|
6227
|
-
const
|
|
6227
|
+
const Es = new Uint32Array(new Uint8Array([255, 255, 0, 0]).buffer)[0];
|
|
6228
6228
|
class Xn {
|
|
6229
6229
|
#t;
|
|
6230
6230
|
#e;
|
|
@@ -6235,7 +6235,7 @@ class Xn {
|
|
|
6235
6235
|
return this.#t.length;
|
|
6236
6236
|
}
|
|
6237
6237
|
isEmpty(t) {
|
|
6238
|
-
return this.#t[t] ===
|
|
6238
|
+
return this.#t[t] === Es;
|
|
6239
6239
|
}
|
|
6240
6240
|
minX(t) {
|
|
6241
6241
|
return this.#e[t * 4 + 0] / 256;
|
|
@@ -6293,7 +6293,7 @@ class qn {
|
|
|
6293
6293
|
}
|
|
6294
6294
|
#b(t, e) {
|
|
6295
6295
|
const s = new ArrayBuffer(t * 4);
|
|
6296
|
-
this.#g = new Uint8ClampedArray(s), this.#c = new Uint32Array(s), e && e.length > 0 ? (this.#c.set(e), this.#c.fill(
|
|
6296
|
+
this.#g = new Uint8ClampedArray(s), this.#c = new Uint32Array(s), e && e.length > 0 ? (this.#c.set(e), this.#c.fill(Es, e.length)) : this.#c.fill(Es);
|
|
6297
6297
|
}
|
|
6298
6298
|
save(t) {
|
|
6299
6299
|
return this.#t = {
|
|
@@ -6586,7 +6586,7 @@ const St = {
|
|
|
6586
6586
|
STROKE: "Stroke",
|
|
6587
6587
|
SHADING: "Shading"
|
|
6588
6588
|
};
|
|
6589
|
-
function
|
|
6589
|
+
function _s(d, t) {
|
|
6590
6590
|
if (!t)
|
|
6591
6591
|
return;
|
|
6592
6592
|
const e = t[2] - t[0], s = t[3] - t[1], i = new Path2D();
|
|
@@ -6597,7 +6597,7 @@ class Fs {
|
|
|
6597
6597
|
return !1;
|
|
6598
6598
|
}
|
|
6599
6599
|
getPattern() {
|
|
6600
|
-
|
|
6600
|
+
G("Abstract method `getPattern` called.");
|
|
6601
6601
|
}
|
|
6602
6602
|
}
|
|
6603
6603
|
class Yn extends Fs {
|
|
@@ -6641,11 +6641,11 @@ class Yn extends Fs {
|
|
|
6641
6641
|
return this._createGradient(t, u);
|
|
6642
6642
|
}
|
|
6643
6643
|
const r = e.current.getClippedPathBoundingBox(i, K(t)) || [0, 0, 0, 0], a = Math.ceil(r[2] - r[0]) || 1, o = Math.ceil(r[3] - r[1]) || 1, l = e.cachedCanvases.getCanvas("pattern", a, o), h = l.context;
|
|
6644
|
-
h.clearRect(0, 0, h.canvas.width, h.canvas.height), h.beginPath(), h.rect(0, 0, h.canvas.width, h.canvas.height), h.translate(-r[0], -r[1]), s = T.transform(s, [1, 0, 0, 1, r[0], r[1]]), h.transform(...e.baseTransform), this.matrix && h.transform(...this.matrix),
|
|
6644
|
+
h.clearRect(0, 0, h.canvas.width, h.canvas.height), h.beginPath(), h.rect(0, 0, h.canvas.width, h.canvas.height), h.translate(-r[0], -r[1]), s = T.transform(s, [1, 0, 0, 1, r[0], r[1]]), h.transform(...e.baseTransform), this.matrix && h.transform(...this.matrix), _s(h, this._bbox), h.fillStyle = this._createGradient(h), h.fill(), n = t.createPattern(l.canvas, "no-repeat");
|
|
6645
6645
|
const c = new DOMMatrix(s);
|
|
6646
6646
|
n.setTransform(c);
|
|
6647
6647
|
} else
|
|
6648
|
-
|
|
6648
|
+
_s(t, this._bbox), n = this._createGradient(t);
|
|
6649
6649
|
return n;
|
|
6650
6650
|
}
|
|
6651
6651
|
}
|
|
@@ -6656,15 +6656,15 @@ function cs(d, t, e, s, i, n, r, a) {
|
|
|
6656
6656
|
const f = (o[e] + t.offsetX) * t.scaleX, g = (o[e + 1] + t.offsetY) * t.scaleY, p = (o[s] + t.offsetX) * t.scaleX, b = (o[s + 1] + t.offsetY) * t.scaleY, m = (o[i] + t.offsetX) * t.scaleX, w = (o[i + 1] + t.offsetY) * t.scaleY;
|
|
6657
6657
|
if (g >= w)
|
|
6658
6658
|
return;
|
|
6659
|
-
const y = l[n], v = l[n + 1], A = l[n + 2], S = l[r],
|
|
6659
|
+
const y = l[n], v = l[n + 1], A = l[n + 2], S = l[r], E = l[r + 1], _ = l[r + 2], C = l[a], M = l[a + 1], x = l[a + 2], H = Math.round(g), V = Math.round(w);
|
|
6660
6660
|
let O, tt, k, R, $, bt, Lt, et;
|
|
6661
6661
|
for (let W = H; W <= V; W++) {
|
|
6662
6662
|
if (W < b) {
|
|
6663
6663
|
const st = W < g ? 0 : (g - W) / (g - b);
|
|
6664
|
-
O = f - (f - p) * st, tt = y - (y - S) * st, k = v - (v -
|
|
6664
|
+
O = f - (f - p) * st, tt = y - (y - S) * st, k = v - (v - E) * st, R = A - (A - _) * st;
|
|
6665
6665
|
} else {
|
|
6666
6666
|
let st;
|
|
6667
|
-
W > w ? st = 1 : b === w ? st = 0 : st = (b - W) / (b - w), O = p - (p - m) * st, tt = S - (S - C) * st, k =
|
|
6667
|
+
W > w ? st = 1 : b === w ? st = 0 : st = (b - W) / (b - w), O = p - (p - m) * st, tt = S - (S - C) * st, k = E - (E - M) * st, R = _ - (_ - x) * st;
|
|
6668
6668
|
}
|
|
6669
6669
|
let X;
|
|
6670
6670
|
W < g ? X = 0 : W > w ? X = 1 : X = (g - W) / (g - w), $ = f - (f - m) * X, bt = y - (y - C) * X, Lt = v - (v - M) * X, et = A - (A - x) * X;
|
|
@@ -6709,8 +6709,8 @@ class Qn extends Fs {
|
|
|
6709
6709
|
}, b = c + 4, m = u + 4, w = s.getCanvas("mesh", b, m), y = w.context, v = y.createImageData(c, u);
|
|
6710
6710
|
if (e) {
|
|
6711
6711
|
const S = v.data;
|
|
6712
|
-
for (let
|
|
6713
|
-
S[
|
|
6712
|
+
for (let E = 0, _ = S.length; E < _; E += 4)
|
|
6713
|
+
S[E] = e[0], S[E + 1] = e[1], S[E + 2] = e[2], S[E + 3] = 255;
|
|
6714
6714
|
}
|
|
6715
6715
|
for (const S of this._figures)
|
|
6716
6716
|
Kn(v, S, p);
|
|
@@ -6726,7 +6726,7 @@ class Qn extends Fs {
|
|
|
6726
6726
|
return !0;
|
|
6727
6727
|
}
|
|
6728
6728
|
getPattern(t, e, s, i) {
|
|
6729
|
-
|
|
6729
|
+
_s(t, this._bbox);
|
|
6730
6730
|
const n = new Float32Array(2);
|
|
6731
6731
|
if (i === ct.SHADING)
|
|
6732
6732
|
T.singularValueDecompose2dScale(K(t), n);
|
|
@@ -6784,14 +6784,14 @@ class Os {
|
|
|
6784
6784
|
const [w, y] = m;
|
|
6785
6785
|
T.singularValueDecompose2dScale(this.baseTransform, m);
|
|
6786
6786
|
const v = w * m[0], A = y * m[1];
|
|
6787
|
-
let S = p,
|
|
6787
|
+
let S = p, E = b, _ = !1, C = !1;
|
|
6788
6788
|
const M = Math.ceil(l * v), x = Math.ceil(h * A), H = Math.ceil(p * v), V = Math.ceil(b * A);
|
|
6789
|
-
M >= H ? S = l :
|
|
6790
|
-
const O = this.getSizeAndScale(S, this.ctx.canvas.width, v), tt = this.getSizeAndScale(
|
|
6791
|
-
if ($.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext($, n, a), R.translate(-O.scale * c, -tt.scale * u), $.transform(0, O.scale, 0, 0, tt.scale, 0, 0), R.save(), $.dependencyTracker?.save(), this.clipBbox($, c, u, f, g), $.baseTransform = K($.ctx), $.executeOperatorList(i), $.endDrawing(), $.dependencyTracker?.restore(), R.restore(),
|
|
6789
|
+
M >= H ? S = l : _ = !0, x >= V ? E = h : C = !0;
|
|
6790
|
+
const O = this.getSizeAndScale(S, this.ctx.canvas.width, v), tt = this.getSizeAndScale(E, this.ctx.canvas.height, A), k = t.cachedCanvases.getCanvas("pattern", O.size, tt.size), R = k.context, $ = o.createCanvasGraphics(R, e);
|
|
6791
|
+
if ($.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext($, n, a), R.translate(-O.scale * c, -tt.scale * u), $.transform(0, O.scale, 0, 0, tt.scale, 0, 0), R.save(), $.dependencyTracker?.save(), this.clipBbox($, c, u, f, g), $.baseTransform = K($.ctx), $.executeOperatorList(i), $.endDrawing(), $.dependencyTracker?.restore(), R.restore(), _ || C) {
|
|
6792
6792
|
const bt = k.canvas;
|
|
6793
|
-
|
|
6794
|
-
const Lt = this.getSizeAndScale(S, this.ctx.canvas.width, v), et = this.getSizeAndScale(
|
|
6793
|
+
_ && (S = l), C && (E = h);
|
|
6794
|
+
const Lt = this.getSizeAndScale(S, this.ctx.canvas.width, v), et = this.getSizeAndScale(E, this.ctx.canvas.height, A), W = Lt.size, X = et.size, Vt = t.cachedCanvases.getCanvas("pattern-workaround", W, X), Nt = Vt.context, Bt = _ ? Math.floor(p / l) : 0, st = C ? Math.floor(b / h) : 0;
|
|
6795
6795
|
for (let de = 0; de <= Bt; de++)
|
|
6796
6796
|
for (let ue = 0; ue <= st; ue++)
|
|
6797
6797
|
Nt.drawImage(bt, W * de, X * ue, W, X, 0, 0, W, X);
|
|
@@ -6940,12 +6940,12 @@ class ir {
|
|
|
6940
6940
|
function He(d, t, e, s, i, n, r, a, o, l) {
|
|
6941
6941
|
const [h, c, u, f, g, p] = K(d);
|
|
6942
6942
|
if (c === 0 && u === 0) {
|
|
6943
|
-
const w = r * h + g, y = Math.round(w), v = a * f + p, A = Math.round(v), S = (r + o) * h + g,
|
|
6944
|
-
return d.setTransform(Math.sign(h), 0, 0, Math.sign(f), y, A), d.drawImage(t, e, s, i, n, 0, 0,
|
|
6943
|
+
const w = r * h + g, y = Math.round(w), v = a * f + p, A = Math.round(v), S = (r + o) * h + g, E = Math.abs(Math.round(S) - y) || 1, _ = (a + l) * f + p, C = Math.abs(Math.round(_) - A) || 1;
|
|
6944
|
+
return d.setTransform(Math.sign(h), 0, 0, Math.sign(f), y, A), d.drawImage(t, e, s, i, n, 0, 0, E, C), d.setTransform(h, c, u, f, g, p), [E, C];
|
|
6945
6945
|
}
|
|
6946
6946
|
if (h === 0 && f === 0) {
|
|
6947
|
-
const w = a * u + g, y = Math.round(w), v = r * c + p, A = Math.round(v), S = (a + l) * u + g,
|
|
6948
|
-
return d.setTransform(0, Math.sign(c), Math.sign(u), 0, y, A), d.drawImage(t, e, s, i, n, 0, 0, C,
|
|
6947
|
+
const w = a * u + g, y = Math.round(w), v = r * c + p, A = Math.round(v), S = (a + l) * u + g, E = Math.abs(Math.round(S) - y) || 1, _ = (r + o) * c + p, C = Math.abs(Math.round(_) - A) || 1;
|
|
6948
|
+
return d.setTransform(0, Math.sign(c), Math.sign(u), 0, y, A), d.drawImage(t, e, s, i, n, 0, 0, C, E), d.setTransform(h, c, u, f, g, p), [C, E];
|
|
6949
6949
|
}
|
|
6950
6950
|
d.drawImage(t, e, s, i, n, r, a, o, l);
|
|
6951
6951
|
const b = Math.hypot(h, c), m = Math.hypot(u, f);
|
|
@@ -6987,7 +6987,7 @@ class di {
|
|
|
6987
6987
|
getPathBoundingBox(t = ct.FILL, e = null) {
|
|
6988
6988
|
const s = this.minMax.slice();
|
|
6989
6989
|
if (t === ct.STROKE) {
|
|
6990
|
-
e ||
|
|
6990
|
+
e || G("Stroke bounding box must include transform."), T.singularValueDecompose2dScale(e, At);
|
|
6991
6991
|
const i = At[0] * this.lineWidth / 2, n = At[1] * this.lineWidth / 2;
|
|
6992
6992
|
s[0] -= i, s[1] -= n, s[2] += i, s[3] += n;
|
|
6993
6993
|
}
|
|
@@ -7021,12 +7021,12 @@ function ui(d, t) {
|
|
|
7021
7021
|
for (u = 0; u < r; u++) {
|
|
7022
7022
|
for (g = u < n ? mt : i, l = 0, f = 0; f < g; f++) {
|
|
7023
7023
|
const S = b - o;
|
|
7024
|
-
let
|
|
7025
|
-
const
|
|
7024
|
+
let E = 0;
|
|
7025
|
+
const _ = S > y ? s : S * 8 - 7, C = _ & -8;
|
|
7026
7026
|
let M = 0, x = 0;
|
|
7027
|
-
for (;
|
|
7027
|
+
for (; E < C; E += 8)
|
|
7028
7028
|
x = h[o++], m[l++] = x & 128 ? v : A, m[l++] = x & 64 ? v : A, m[l++] = x & 32 ? v : A, m[l++] = x & 16 ? v : A, m[l++] = x & 8 ? v : A, m[l++] = x & 4 ? v : A, m[l++] = x & 2 ? v : A, m[l++] = x & 1 ? v : A;
|
|
7029
|
-
for (;
|
|
7029
|
+
for (; E < _; E++)
|
|
7030
7030
|
M === 0 && (x = h[o++], M = 128), m[l++] = x & M ? v : A, M >>= 1;
|
|
7031
7031
|
}
|
|
7032
7032
|
for (; l < w; )
|
|
@@ -7126,7 +7126,7 @@ class le {
|
|
|
7126
7126
|
if (i !== void 0 && o === i.nextBreakPoint)
|
|
7127
7127
|
return i.breakIt(o, s), o;
|
|
7128
7128
|
if (!n || n(o))
|
|
7129
|
-
if (p = a[o], b = r[o] ?? null, p !==
|
|
7129
|
+
if (p = a[o], b = r[o] ?? null, p !== Ee.dependency)
|
|
7130
7130
|
b === null ? this[p](o) : this[p](o, ...b);
|
|
7131
7131
|
else
|
|
7132
7132
|
for (const m of b) {
|
|
@@ -7205,13 +7205,13 @@ class le {
|
|
|
7205
7205
|
f = T.transform(f, [1, 0, 0, 1, 0, -n]);
|
|
7206
7206
|
const g = ne.slice();
|
|
7207
7207
|
T.axialAlignedBoundingBox([0, 0, i, n], f, g);
|
|
7208
|
-
const [p, b, m, w] = g, y = Math.round(m - p) || 1, v = Math.round(w - b) || 1, A = this.cachedCanvases.getCanvas("fillCanvas", y, v), S = A.context,
|
|
7209
|
-
S.translate(-
|
|
7210
|
-
const C = T.transform(Pt(S), [1, 0, 0, 1, -
|
|
7208
|
+
const [p, b, m, w] = g, y = Math.round(m - p) || 1, v = Math.round(w - b) || 1, A = this.cachedCanvases.getCanvas("fillCanvas", y, v), S = A.context, E = p, _ = b;
|
|
7209
|
+
S.translate(-E, -_), S.transform(...f), c || (c = this._scaleImage(u.canvas, Pt(S)), c = c.img, l && a && l.set(h, c)), S.imageSmoothingEnabled = pi(K(S), e.interpolate), He(S, c, 0, 0, c.width, c.height, 0, 0, i, n), S.globalCompositeOperation = "source-in";
|
|
7210
|
+
const C = T.transform(Pt(S), [1, 0, 0, 1, -E, -_]);
|
|
7211
7211
|
return S.fillStyle = a ? r.getPattern(s, this, C, ct.FILL, t) : r, S.fillRect(0, 0, i, n), l && !a && (this.cachedCanvases.delete("fillCanvas"), l.set(h, A.canvas)), this.dependencyTracker?.recordDependencies(t, St.transformAndFill), {
|
|
7212
7212
|
canvas: A.canvas,
|
|
7213
|
-
offsetX: Math.round(
|
|
7214
|
-
offsetY: Math.round(
|
|
7213
|
+
offsetX: Math.round(E),
|
|
7214
|
+
offsetY: Math.round(_)
|
|
7215
7215
|
};
|
|
7216
7216
|
}
|
|
7217
7217
|
setLineWidth(t, e) {
|
|
@@ -7347,7 +7347,7 @@ class le {
|
|
|
7347
7347
|
return;
|
|
7348
7348
|
}
|
|
7349
7349
|
if (this.dependencyTracker !== null) {
|
|
7350
|
-
const r = e ===
|
|
7350
|
+
const r = e === Ee.stroke ? this.current.lineWidth / 2 : 0;
|
|
7351
7351
|
this.dependencyTracker.resetBBox(t).recordBBox(t, this.ctx, i[0] - r, i[2] + r, i[1] - r, i[3] + r).recordDependencies(t, ["transform"]);
|
|
7352
7352
|
}
|
|
7353
7353
|
n instanceof Path2D || (n = s[0] = xi(n)), T.axialAlignedBoundingBox(i, K(this.ctx), this.current.minMax), this[e](t, n), this._pathStartIdx = t;
|
|
@@ -7511,8 +7511,8 @@ class le {
|
|
|
7511
7511
|
b: y,
|
|
7512
7512
|
c: v,
|
|
7513
7513
|
d: A
|
|
7514
|
-
} = m, S = T.inverseTransform(r),
|
|
7515
|
-
T.singularValueDecompose2dScale(
|
|
7514
|
+
} = m, S = T.inverseTransform(r), E = T.transform([w, y, v, A, 0, 0], S);
|
|
7515
|
+
T.singularValueDecompose2dScale(E, At), a.lineWidth *= Math.max(At[0], At[1]) / c, a.stroke(this.#i(b, m, r));
|
|
7516
7516
|
} else
|
|
7517
7517
|
a.lineWidth /= c, a.stroke(b);
|
|
7518
7518
|
a.restore();
|
|
@@ -7566,9 +7566,9 @@ class le {
|
|
|
7566
7566
|
const x = s.strokeColor.getPattern(r, this, Pt(r), ct.STROKE, t);
|
|
7567
7567
|
y = K(r), r.restore(), r.strokeStyle = x;
|
|
7568
7568
|
}
|
|
7569
|
-
let
|
|
7570
|
-
const
|
|
7571
|
-
if (
|
|
7569
|
+
let E = s.lineWidth;
|
|
7570
|
+
const _ = s.textMatrixScale;
|
|
7571
|
+
if (_ === 0 || E === 0 ? S && (E = this.getSinglePixelWidth()) : E /= _, a !== 1 && (r.scale(a, a), E /= a), r.lineWidth = E, i.isInvalidPDFjsFont) {
|
|
7572
7572
|
const x = [];
|
|
7573
7573
|
let H = 0;
|
|
7574
7574
|
for (const O of e)
|
|
@@ -7702,10 +7702,10 @@ class le {
|
|
|
7702
7702
|
this.dependencyTracker?.resetBBox(t).recordFullPageBBox(t).recordDependencies(t, St.transform).recordDependencies(t, St.fill).recordOperation(t), this.compose(this.current.getClippedPathBoundingBox()), this.restore(t);
|
|
7703
7703
|
}
|
|
7704
7704
|
beginInlineImage() {
|
|
7705
|
-
|
|
7705
|
+
G("Should not call beginInlineImage");
|
|
7706
7706
|
}
|
|
7707
7707
|
beginImageData() {
|
|
7708
|
-
|
|
7708
|
+
G("Should not call beginImageData");
|
|
7709
7709
|
}
|
|
7710
7710
|
paintFormXObjectBegin(t, e, s) {
|
|
7711
7711
|
if (this.contentVisible && (this.save(t), this.baseTransformStack.push(this.baseTransform), e && this.transform(t, ...e), this.baseTransform = K(this.ctx), s)) {
|
|
@@ -8024,8 +8024,8 @@ class le {
|
|
|
8024
8024
|
return !0;
|
|
8025
8025
|
}
|
|
8026
8026
|
}
|
|
8027
|
-
for (const d in
|
|
8028
|
-
le.prototype[d] !== void 0 && (le.prototype[
|
|
8027
|
+
for (const d in Ee)
|
|
8028
|
+
le.prototype[d] !== void 0 && (le.prototype[Ee[d]] = le.prototype[d]);
|
|
8029
8029
|
class qt {
|
|
8030
8030
|
static #t = null;
|
|
8031
8031
|
static #e = "";
|
|
@@ -8091,7 +8091,7 @@ class lr {
|
|
|
8091
8091
|
return this.#t ? e?.viewState !== "OFF" : this.#e ? t?.printState !== "OFF" : !0;
|
|
8092
8092
|
}
|
|
8093
8093
|
_setVisible(t, e, s = !1) {
|
|
8094
|
-
t !== ee &&
|
|
8094
|
+
t !== ee && G("Internal method `_setVisible` called."), this.#i = s, this.#s = e;
|
|
8095
8095
|
}
|
|
8096
8096
|
}
|
|
8097
8097
|
class hr {
|
|
@@ -8968,15 +8968,15 @@ class vr {
|
|
|
8968
8968
|
}
|
|
8969
8969
|
}
|
|
8970
8970
|
const Sr = /^[a-z][a-z0-9\-+.]+:/i;
|
|
8971
|
-
function
|
|
8971
|
+
function Er(d) {
|
|
8972
8972
|
if (Sr.test(d))
|
|
8973
8973
|
return new URL(d);
|
|
8974
8974
|
const t = process.getBuiltinModule("url");
|
|
8975
8975
|
return new URL(t.pathToFileURL(d));
|
|
8976
8976
|
}
|
|
8977
|
-
class
|
|
8977
|
+
class _r {
|
|
8978
8978
|
constructor(t) {
|
|
8979
|
-
this.source = t, this.url =
|
|
8979
|
+
this.source = t, this.url = Er(t.url), B(this.url.protocol === "file:", "PDFNodeStream only supports file:// URLs."), this._fullRequestReader = null, this._rangeRequestReaders = [];
|
|
8980
8980
|
}
|
|
8981
8981
|
get _progressiveDataLength() {
|
|
8982
8982
|
return this._fullRequestReader?._loaded ?? 0;
|
|
@@ -9182,7 +9182,7 @@ class wt {
|
|
|
9182
9182
|
static #w = /* @__PURE__ */ new Map();
|
|
9183
9183
|
static #y = /* @__PURE__ */ new Map();
|
|
9184
9184
|
static #C = /* @__PURE__ */ new WeakMap();
|
|
9185
|
-
static #
|
|
9185
|
+
static #E = null;
|
|
9186
9186
|
static #v = /* @__PURE__ */ new Set();
|
|
9187
9187
|
constructor({
|
|
9188
9188
|
textContentSource: t,
|
|
@@ -9210,7 +9210,7 @@ class wt {
|
|
|
9210
9210
|
pageX: r,
|
|
9211
9211
|
pageY: a
|
|
9212
9212
|
} = s.rawDims;
|
|
9213
|
-
this.#b = [1, 0, 0, -1, -r, a + n], this.#o = i, this.#n = n, wt.#M(), e.style.setProperty("--min-font-size", wt.#
|
|
9213
|
+
this.#b = [1, 0, 0, -1, -r, a + n], this.#o = i, this.#n = n, wt.#M(), e.style.setProperty("--min-font-size", wt.#E), Yt(e, s), this.#t.promise.finally(() => {
|
|
9214
9214
|
wt.#v.delete(this), this.#r = null, this.#f = null;
|
|
9215
9215
|
}).catch(() => {
|
|
9216
9216
|
});
|
|
@@ -9252,7 +9252,7 @@ class wt {
|
|
|
9252
9252
|
ctx: wt.#k(this.#a)
|
|
9253
9253
|
};
|
|
9254
9254
|
for (const r of this.#c)
|
|
9255
|
-
n.properties = this.#p.get(r), n.div = r, this.#
|
|
9255
|
+
n.properties = this.#p.get(r), n.div = r, this.#_(n);
|
|
9256
9256
|
}
|
|
9257
9257
|
}
|
|
9258
9258
|
cancel() {
|
|
@@ -9313,12 +9313,12 @@ class wt {
|
|
|
9313
9313
|
const g = Math.abs(t.transform[0]), p = Math.abs(t.transform[3]);
|
|
9314
9314
|
g !== p && Math.max(g, p) / Math.min(g, p) > 1.5 && (f = !0);
|
|
9315
9315
|
}
|
|
9316
|
-
if (f && (s.canvasWidth = r.vertical ? t.height : t.width), this.#p.set(e, s), this.#r.div = e, this.#r.properties = s, this.#
|
|
9316
|
+
if (f && (s.canvasWidth = r.vertical ? t.height : t.width), this.#p.set(e, s), this.#r.div = e, this.#r.properties = s, this.#_(this.#r), s.hasText && this.#e.append(e), s.hasEOL) {
|
|
9317
9317
|
const g = document.createElement("br");
|
|
9318
9318
|
g.setAttribute("role", "presentation"), this.#e.append(g);
|
|
9319
9319
|
}
|
|
9320
9320
|
}
|
|
9321
|
-
#
|
|
9321
|
+
#_(t) {
|
|
9322
9322
|
const {
|
|
9323
9323
|
div: e,
|
|
9324
9324
|
properties: s,
|
|
@@ -9370,10 +9370,10 @@ class wt {
|
|
|
9370
9370
|
e === i.size && s === i.family || (t.font = `${e}px ${s}`, i.size = e, i.family = s);
|
|
9371
9371
|
}
|
|
9372
9372
|
static #M() {
|
|
9373
|
-
if (this.#
|
|
9373
|
+
if (this.#E !== null)
|
|
9374
9374
|
return;
|
|
9375
9375
|
const t = document.createElement("div");
|
|
9376
|
-
t.style.opacity = 0, t.style.lineHeight = 1, t.style.fontSize = "1px", t.style.position = "absolute", t.textContent = "X", document.body.append(t), this.#
|
|
9376
|
+
t.style.opacity = 0, t.style.lineHeight = 1, t.style.fontSize = "1px", t.style.position = "absolute", t.textContent = "X", document.body.append(t), this.#E = t.getBoundingClientRect().height, t.remove();
|
|
9377
9377
|
}
|
|
9378
9378
|
static #N(t, e, s) {
|
|
9379
9379
|
const i = this.#w.get(t);
|
|
@@ -9398,7 +9398,7 @@ function $i(d = {}) {
|
|
|
9398
9398
|
docId: e
|
|
9399
9399
|
} = t, s = d.url ? Fn(d.url) : null, i = d.data ? On(d.data) : null, n = d.httpHeaders || null, r = d.withCredentials === !0, a = d.password ?? null, o = d.range instanceof Vi ? d.range : null, l = Number.isInteger(d.rangeChunkSize) && d.rangeChunkSize > 0 ? d.rangeChunkSize : 2 ** 16;
|
|
9400
9400
|
let h = d.worker instanceof Ce ? d.worker : null;
|
|
9401
|
-
const c = d.verbosity, u = typeof d.docBaseUrl == "string" && !Ze(d.docBaseUrl) ? d.docBaseUrl : null, f = Fe(d.cMapUrl), g = d.cMapPacked !== !1, p = d.CMapReaderFactory || (dt ?
|
|
9401
|
+
const c = d.verbosity, u = typeof d.docBaseUrl == "string" && !Ze(d.docBaseUrl) ? d.docBaseUrl : null, f = Fe(d.cMapUrl), g = d.cMapPacked !== !1, p = d.CMapReaderFactory || (dt ? jn : si), b = Fe(d.iccUrl), m = Fe(d.standardFontDataUrl), w = d.StandardFontDataFactory || (dt ? Gn : ii), y = Fe(d.wasmUrl), v = d.WasmFactory || (dt ? Wn : ni), A = d.stopAtErrors !== !0, S = Number.isInteger(d.maxImageSize) && d.maxImageSize > -1 ? d.maxImageSize : -1, E = d.isEvalSupported !== !1, _ = typeof d.isOffscreenCanvasSupported == "boolean" ? d.isOffscreenCanvasSupported : !dt, C = typeof d.isImageDecoderSupported == "boolean" ? d.isImageDecoderSupported : !dt && (at.platform.isFirefox || !globalThis.chrome), M = Number.isInteger(d.canvasMaxAreaInBytes) ? d.canvasMaxAreaInBytes : -1, x = typeof d.disableFontFace == "boolean" ? d.disableFontFace : dt, H = d.fontExtraProperties === !0, V = d.enableXfa === !0, O = d.ownerDocument || globalThis.document, tt = d.disableRange === !0, k = d.disableStream === !0, R = d.disableAutoFetch === !0, $ = d.pdfBug === !0, bt = d.CanvasFactory || (dt ? Vn : Un), Lt = d.FilterFactory || (dt ? $n : zn), et = d.enableHWA === !0, W = d.useWasm !== !1, X = o ? o.length : d.length ?? NaN, Vt = typeof d.useSystemFonts == "boolean" ? d.useSystemFonts : !dt && !x, Nt = typeof d.useWorkerFetch == "boolean" ? d.useWorkerFetch : !!(p === si && w === ii && v === ni && f && m && y && ye(f, document.baseURI) && ye(m, document.baseURI) && ye(y, document.baseURI)), Bt = null;
|
|
9402
9402
|
ln(c);
|
|
9403
9403
|
const st = {
|
|
9404
9404
|
canvasFactory: new bt({
|
|
@@ -9438,8 +9438,8 @@ function $i(d = {}) {
|
|
|
9438
9438
|
maxImageSize: S,
|
|
9439
9439
|
disableFontFace: x,
|
|
9440
9440
|
ignoreErrors: A,
|
|
9441
|
-
isEvalSupported:
|
|
9442
|
-
isOffscreenCanvasSupported:
|
|
9441
|
+
isEvalSupported: E,
|
|
9442
|
+
isOffscreenCanvasSupported: _,
|
|
9443
9443
|
isImageDecoderSupported: C,
|
|
9444
9444
|
canvasMaxAreaInBytes: M,
|
|
9445
9445
|
fontExtraProperties: H,
|
|
@@ -9475,7 +9475,7 @@ function $i(d = {}) {
|
|
|
9475
9475
|
else if (!i) {
|
|
9476
9476
|
if (!s)
|
|
9477
9477
|
throw new Error("getDocument - no `url` parameter provided.");
|
|
9478
|
-
const ns = ye(s) ? pr : dt ?
|
|
9478
|
+
const ns = ye(s) ? pr : dt ? _r : wr;
|
|
9479
9479
|
is = new ns({
|
|
9480
9480
|
url: s,
|
|
9481
9481
|
length: X,
|
|
@@ -9491,8 +9491,8 @@ function $i(d = {}) {
|
|
|
9491
9491
|
throw new Error("Loading aborted");
|
|
9492
9492
|
if (h.destroyed)
|
|
9493
9493
|
throw new Error("Worker was destroyed");
|
|
9494
|
-
const
|
|
9495
|
-
t._transport = sn,
|
|
9494
|
+
const js = new we(e, ns, h.port), sn = new Dr(js, t, is, ue, st, et);
|
|
9495
|
+
t._transport = sn, js.send("Ready", null);
|
|
9496
9496
|
});
|
|
9497
9497
|
}).catch(t._capability.reject), t;
|
|
9498
9498
|
}
|
|
@@ -9568,7 +9568,7 @@ class Vi {
|
|
|
9568
9568
|
this.#t.resolve();
|
|
9569
9569
|
}
|
|
9570
9570
|
requestDataRange(t, e) {
|
|
9571
|
-
|
|
9571
|
+
G("Abstract method PDFDataRangeTransport.requestDataRange");
|
|
9572
9572
|
}
|
|
9573
9573
|
abort() {
|
|
9574
9574
|
}
|
|
@@ -9780,15 +9780,15 @@ class kr {
|
|
|
9780
9780
|
separateAnnots: null
|
|
9781
9781
|
}, this._stats?.time("Page Request"), this._pumpOperatorList(p));
|
|
9782
9782
|
const v = !!(this._pdfBug && globalThis.StepperManager?.enabled), A = !this.recordedBBoxes && (f || v), S = (C) => {
|
|
9783
|
-
if (w.renderTasks.delete(
|
|
9784
|
-
const M =
|
|
9785
|
-
M && (
|
|
9783
|
+
if (w.renderTasks.delete(E), A) {
|
|
9784
|
+
const M = E.gfx?.dependencyTracker.take();
|
|
9785
|
+
M && (E.stepper && E.stepper.setOperatorBBoxes(M, E.gfx.dependencyTracker.takeDebugMetadata()), f && (this.recordedBBoxes = M));
|
|
9786
9786
|
}
|
|
9787
|
-
y && (this.#t = !0), this.#e(), C ? (
|
|
9787
|
+
y && (this.#t = !0), this.#e(), C ? (E.capability.reject(C), this._abortOperatorList({
|
|
9788
9788
|
intentState: w,
|
|
9789
9789
|
reason: C instanceof Error ? C : new Error(C)
|
|
9790
|
-
})) :
|
|
9791
|
-
},
|
|
9790
|
+
})) : E.capability.resolve(), this._stats && (this._stats.timeEnd("Rendering"), this._stats.timeEnd("Overall"), globalThis.Stats?.enabled && globalThis.Stats.add(this.pageNumber, this._stats));
|
|
9791
|
+
}, E = new re({
|
|
9792
9792
|
callback: S,
|
|
9793
9793
|
params: {
|
|
9794
9794
|
canvas: e,
|
|
@@ -9811,8 +9811,8 @@ class kr {
|
|
|
9811
9811
|
enableHWA: this._transport.enableHWA,
|
|
9812
9812
|
operationsFilter: g
|
|
9813
9813
|
});
|
|
9814
|
-
(w.renderTasks ||= /* @__PURE__ */ new Set()).add(
|
|
9815
|
-
const
|
|
9814
|
+
(w.renderTasks ||= /* @__PURE__ */ new Set()).add(E);
|
|
9815
|
+
const _ = E.task;
|
|
9816
9816
|
return Promise.all([w.displayReadyCapability.promise, o]).then(([C, M]) => {
|
|
9817
9817
|
if (this.destroyed) {
|
|
9818
9818
|
S();
|
|
@@ -9820,11 +9820,11 @@ class kr {
|
|
|
9820
9820
|
}
|
|
9821
9821
|
if (this._stats?.time("Rendering"), !(M.renderingIntent & b))
|
|
9822
9822
|
throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");
|
|
9823
|
-
|
|
9823
|
+
E.initializeGraphics({
|
|
9824
9824
|
transparency: C,
|
|
9825
9825
|
optionalContentConfig: M
|
|
9826
|
-
}),
|
|
9827
|
-
}).catch(S),
|
|
9826
|
+
}), E.operatorListChanged();
|
|
9827
|
+
}).catch(S), _;
|
|
9828
9828
|
}
|
|
9829
9829
|
getOperatorList({
|
|
9830
9830
|
intent: t = "display",
|
|
@@ -9863,7 +9863,7 @@ class kr {
|
|
|
9863
9863
|
}
|
|
9864
9864
|
getTextContent(t = {}) {
|
|
9865
9865
|
if (this._transport._htmlForXfa)
|
|
9866
|
-
return this.getXfa().then((s) =>
|
|
9866
|
+
return this.getXfa().then((s) => _e.textContent(s));
|
|
9867
9867
|
const e = this.streamTextContent(t);
|
|
9868
9868
|
return new Promise(function(s, i) {
|
|
9869
9869
|
function n() {
|
|
@@ -10012,7 +10012,7 @@ class kr {
|
|
|
10012
10012
|
return this._stats;
|
|
10013
10013
|
}
|
|
10014
10014
|
}
|
|
10015
|
-
var Ut, Ct, Ot,
|
|
10015
|
+
var Ut, Ct, Ot, Gt, Ye, Wt, Xt, ft, je, ji, Gi, Ae, he, Ge;
|
|
10016
10016
|
const Y = class Y {
|
|
10017
10017
|
constructor({
|
|
10018
10018
|
name: t = null,
|
|
@@ -10023,13 +10023,13 @@ const Y = class Y {
|
|
|
10023
10023
|
xt(this, Ut, Promise.withResolvers());
|
|
10024
10024
|
xt(this, Ct, null);
|
|
10025
10025
|
xt(this, Ot, null);
|
|
10026
|
-
xt(this,
|
|
10026
|
+
xt(this, Gt, null);
|
|
10027
10027
|
if (this.name = t, this.destroyed = !1, this.verbosity = s, e) {
|
|
10028
10028
|
if (q(Y, Xt).has(e))
|
|
10029
10029
|
throw new Error("Cannot use more than one PDFWorker per port.");
|
|
10030
|
-
q(Y, Xt).set(e, this), Tt(this, ft,
|
|
10030
|
+
q(Y, Xt).set(e, this), Tt(this, ft, ji).call(this, e);
|
|
10031
10031
|
} else
|
|
10032
|
-
Tt(this, ft,
|
|
10032
|
+
Tt(this, ft, Gi).call(this);
|
|
10033
10033
|
}
|
|
10034
10034
|
get promise() {
|
|
10035
10035
|
return q(this, Ut).promise;
|
|
@@ -10041,7 +10041,7 @@ const Y = class Y {
|
|
|
10041
10041
|
return q(this, Ct);
|
|
10042
10042
|
}
|
|
10043
10043
|
destroy() {
|
|
10044
|
-
this.destroyed = !0, q(this,
|
|
10044
|
+
this.destroyed = !0, q(this, Gt)?.terminate(), pt(this, Gt, null), q(Y, Xt).delete(q(this, Ot)), pt(this, Ot, null), q(this, Ct)?.destroy(), pt(this, Ct, null);
|
|
10045
10045
|
}
|
|
10046
10046
|
static create(t) {
|
|
10047
10047
|
const e = q(this, Xt).get(t?.port);
|
|
@@ -10058,22 +10058,22 @@ const Y = class Y {
|
|
|
10058
10058
|
throw new Error('No "GlobalWorkerOptions.workerSrc" specified.');
|
|
10059
10059
|
}
|
|
10060
10060
|
static get _setupFakeWorkerGlobal() {
|
|
10061
|
-
return I(this, "_setupFakeWorkerGlobal", (async () => q(this, he,
|
|
10061
|
+
return I(this, "_setupFakeWorkerGlobal", (async () => q(this, he, Ge) ? q(this, he, Ge) : (await import(
|
|
10062
10062
|
/*webpackIgnore: true*/
|
|
10063
10063
|
/*@vite-ignore*/
|
|
10064
10064
|
this.workerSrc
|
|
10065
10065
|
)).WorkerMessageHandler)());
|
|
10066
10066
|
}
|
|
10067
10067
|
};
|
|
10068
|
-
Ut = new WeakMap(), Ct = new WeakMap(), Ot = new WeakMap(),
|
|
10068
|
+
Ut = new WeakMap(), Ct = new WeakMap(), Ot = new WeakMap(), Gt = new WeakMap(), Ye = new WeakMap(), Wt = new WeakMap(), Xt = new WeakMap(), ft = new WeakSet(), je = function() {
|
|
10069
10069
|
q(this, Ut).resolve(), q(this, Ct).send("configure", {
|
|
10070
10070
|
verbosity: this.verbosity
|
|
10071
10071
|
});
|
|
10072
|
-
},
|
|
10072
|
+
}, ji = function(t) {
|
|
10073
10073
|
pt(this, Ot, t), pt(this, Ct, new we("main", "worker", t)), q(this, Ct).on("ready", () => {
|
|
10074
|
-
}), Tt(this, ft,
|
|
10075
|
-
},
|
|
10076
|
-
if (q(Y, Wt) || q(Y, he,
|
|
10074
|
+
}), Tt(this, ft, je).call(this);
|
|
10075
|
+
}, Gi = function() {
|
|
10076
|
+
if (q(Y, Wt) || q(Y, he, Ge)) {
|
|
10077
10077
|
Tt(this, ft, Ae).call(this);
|
|
10078
10078
|
return;
|
|
10079
10079
|
}
|
|
@@ -10088,7 +10088,7 @@ Ut = new WeakMap(), Ct = new WeakMap(), Ot = new WeakMap(), jt = new WeakMap(),
|
|
|
10088
10088
|
n.abort(), s.destroy(), e.terminate(), this.destroyed ? q(this, Ut).reject(new Error("Worker was destroyed")) : Tt(this, ft, Ae).call(this);
|
|
10089
10089
|
}, n = new AbortController();
|
|
10090
10090
|
e.addEventListener("error", () => {
|
|
10091
|
-
q(this,
|
|
10091
|
+
q(this, Gt) || i();
|
|
10092
10092
|
}, {
|
|
10093
10093
|
signal: n.signal
|
|
10094
10094
|
}), s.on("test", (a) => {
|
|
@@ -10096,7 +10096,7 @@ Ut = new WeakMap(), Ct = new WeakMap(), Ot = new WeakMap(), jt = new WeakMap(),
|
|
|
10096
10096
|
i();
|
|
10097
10097
|
return;
|
|
10098
10098
|
}
|
|
10099
|
-
pt(this, Ct, s), pt(this, Ot, e), pt(this,
|
|
10099
|
+
pt(this, Ct, s), pt(this, Ot, e), pt(this, Gt, e), Tt(this, ft, je).call(this);
|
|
10100
10100
|
}), s.on("ready", (a) => {
|
|
10101
10101
|
if (n.abort(), this.destroyed) {
|
|
10102
10102
|
i();
|
|
@@ -10127,11 +10127,11 @@ Ut = new WeakMap(), Ct = new WeakMap(), Ot = new WeakMap(), jt = new WeakMap(),
|
|
|
10127
10127
|
const e = new Hn();
|
|
10128
10128
|
pt(this, Ot, e);
|
|
10129
10129
|
const s = `fake${Ws(Y, Ye)._++}`, i = new we(s + "_worker", s, e);
|
|
10130
|
-
t.setup(i, e), pt(this, Ct, new we(s, s + "_worker", e)), Tt(this, ft,
|
|
10130
|
+
t.setup(i, e), pt(this, Ct, new we(s, s + "_worker", e)), Tt(this, ft, je).call(this);
|
|
10131
10131
|
}).catch((t) => {
|
|
10132
10132
|
q(this, Ut).reject(new Error(`Setting up fake worker failed: "${t.message}".`));
|
|
10133
10133
|
});
|
|
10134
|
-
}, he = new WeakSet(),
|
|
10134
|
+
}, he = new WeakSet(), Ge = function() {
|
|
10135
10135
|
try {
|
|
10136
10136
|
return globalThis.pdfjsWorker?.WorkerMessageHandler || null;
|
|
10137
10137
|
} catch {
|
|
@@ -10344,7 +10344,7 @@ class Dr {
|
|
|
10344
10344
|
L(`Error during font loading: ${c}`), this.commonObjs.resolve(s, c);
|
|
10345
10345
|
break;
|
|
10346
10346
|
}
|
|
10347
|
-
const r = new
|
|
10347
|
+
const r = new j(n), a = this._params.pdfBug && globalThis.FontInspector?.enabled ? (c, u) => globalThis.FontInspector.fontAdded(c, u) : null, o = new Ln(r, a, n.extra, n.charProcOperatorList);
|
|
10348
10348
|
this.fontLoader.bind(o).catch(() => t.sendWithPromise("FontFallback", {
|
|
10349
10349
|
id: s
|
|
10350
10350
|
})).finally(() => {
|
|
@@ -10657,7 +10657,7 @@ class re {
|
|
|
10657
10657
|
}
|
|
10658
10658
|
}
|
|
10659
10659
|
const Wi = "5.4.530", Lr = "50cc4adac";
|
|
10660
|
-
class
|
|
10660
|
+
class Et {
|
|
10661
10661
|
#t = null;
|
|
10662
10662
|
#e = null;
|
|
10663
10663
|
#i;
|
|
@@ -10670,13 +10670,13 @@ class _t {
|
|
|
10670
10670
|
#l = null;
|
|
10671
10671
|
static #u = null;
|
|
10672
10672
|
static get _keyboardManager() {
|
|
10673
|
-
return I(this, "_keyboardManager", new De([[["Escape", "mac+Escape"],
|
|
10673
|
+
return I(this, "_keyboardManager", new De([[["Escape", "mac+Escape"], Et.prototype._hideDropdownFromKeyboard], [[" ", "mac+ "], Et.prototype._colorSelectFromKeyboard], [["ArrowDown", "ArrowRight", "mac+ArrowDown", "mac+ArrowRight"], Et.prototype._moveToNext], [["ArrowUp", "ArrowLeft", "mac+ArrowUp", "mac+ArrowLeft"], Et.prototype._moveToPrevious], [["Home", "mac+Home"], Et.prototype._moveToBeginning], [["End", "mac+End"], Et.prototype._moveToEnd]]));
|
|
10674
10674
|
}
|
|
10675
10675
|
constructor({
|
|
10676
10676
|
editor: t = null,
|
|
10677
10677
|
uiManager: e = null
|
|
10678
10678
|
}) {
|
|
10679
|
-
t ? (this.#r = !1, this.#n = t) : this.#r = !0, this.#l = t?._uiManager || e, this.#o = this.#l._eventBus, this.#i = t?.color?.toUpperCase() || this.#l?.highlightColors.values().next().value || "#FFFF98",
|
|
10679
|
+
t ? (this.#r = !1, this.#n = t) : this.#r = !0, this.#l = t?._uiManager || e, this.#o = this.#l._eventBus, this.#i = t?.color?.toUpperCase() || this.#l?.highlightColors.values().next().value || "#FFFF98", Et.#u ||= Object.freeze({
|
|
10680
10680
|
blue: "pdfjs-editor-colorpicker-blue",
|
|
10681
10681
|
green: "pdfjs-editor-colorpicker-green",
|
|
10682
10682
|
pink: "pdfjs-editor-colorpicker-pink",
|
|
@@ -10702,12 +10702,12 @@ class _t {
|
|
|
10702
10702
|
}
|
|
10703
10703
|
#d() {
|
|
10704
10704
|
const t = document.createElement("div"), e = this.#l._signal;
|
|
10705
|
-
t.addEventListener("contextmenu",
|
|
10705
|
+
t.addEventListener("contextmenu", _t, {
|
|
10706
10706
|
signal: e
|
|
10707
10707
|
}), t.className = "dropdown", t.role = "listbox", t.ariaMultiSelectable = "false", t.ariaOrientation = "vertical", t.setAttribute("data-l10n-id", "pdfjs-editor-colorpicker-dropdown"), this.#n && (t.id = `${this.#n.id}_colorpicker_dropdown`);
|
|
10708
10708
|
for (const [s, i] of this.#l.highlightColors) {
|
|
10709
10709
|
const n = document.createElement("button");
|
|
10710
|
-
n.tabIndex = "0", n.role = "option", n.setAttribute("data-color", i), n.title = s, n.setAttribute("data-l10n-id",
|
|
10710
|
+
n.tabIndex = "0", n.role = "option", n.setAttribute("data-color", i), n.title = s, n.setAttribute("data-l10n-id", Et.#u[s]);
|
|
10711
10711
|
const r = document.createElement("span");
|
|
10712
10712
|
n.append(r), r.className = "swatch", r.style.backgroundColor = i, n.ariaSelected = i === this.#i, n.addEventListener("click", this.#f.bind(this, i), {
|
|
10713
10713
|
signal: e
|
|
@@ -10765,7 +10765,7 @@ class _t {
|
|
|
10765
10765
|
this.#s.lastElementChild?.focus();
|
|
10766
10766
|
}
|
|
10767
10767
|
#m(t) {
|
|
10768
|
-
|
|
10768
|
+
Et._keyboardManager.exec(this, t);
|
|
10769
10769
|
}
|
|
10770
10770
|
#g(t) {
|
|
10771
10771
|
if (this.#p) {
|
|
@@ -10913,7 +10913,7 @@ class Ir {
|
|
|
10913
10913
|
return this._createSVG(t);
|
|
10914
10914
|
}
|
|
10915
10915
|
_createSVG(t) {
|
|
10916
|
-
|
|
10916
|
+
G("Abstract method `_createSVG` called.");
|
|
10917
10917
|
}
|
|
10918
10918
|
}
|
|
10919
10919
|
class qe extends Ir {
|
|
@@ -10946,7 +10946,7 @@ class ps {
|
|
|
10946
10946
|
case nt.FREETEXT:
|
|
10947
10947
|
return new qi(t);
|
|
10948
10948
|
case nt.LINE:
|
|
10949
|
-
return new
|
|
10949
|
+
return new Gr(t);
|
|
10950
10950
|
case nt.SQUARE:
|
|
10951
10951
|
return new Wr(t);
|
|
10952
10952
|
case nt.CIRCLE:
|
|
@@ -11321,8 +11321,8 @@ class Q {
|
|
|
11321
11321
|
const f = h.createElement("clipPath"), g = `clippath_${this.data.id}`;
|
|
11322
11322
|
f.setAttribute("id", g), f.setAttribute("clipPathUnits", "objectBoundingBox"), u.append(f);
|
|
11323
11323
|
for (let p = 2, b = t.length; p < b; p += 8) {
|
|
11324
|
-
const m = t[p], w = t[p + 1], y = t[p + 2], v = t[p + 3], A = h.createElement("rect"), S = (y - e) / o,
|
|
11325
|
-
A.setAttribute("x", S), A.setAttribute("y",
|
|
11324
|
+
const m = t[p], w = t[p + 1], y = t[p + 2], v = t[p + 3], A = h.createElement("rect"), S = (y - e) / o, E = (n - w) / l, _ = (m - y) / o, C = (w - v) / l;
|
|
11325
|
+
A.setAttribute("x", S), A.setAttribute("y", E), A.setAttribute("width", _), A.setAttribute("height", C), f.append(A), a?.push(`<rect vector-effect="non-scaling-stroke" x="${S}" y="${E}" width="${_}" height="${C}"/>`);
|
|
11326
11326
|
}
|
|
11327
11327
|
this.#e && (a.push("</g></svg>')"), r.backgroundImage = a.join("")), this.container.append(c), this.container.style.clipPath = `url(#${g})`;
|
|
11328
11328
|
}
|
|
@@ -11358,7 +11358,7 @@ class Q {
|
|
|
11358
11358
|
return this.#i;
|
|
11359
11359
|
}
|
|
11360
11360
|
render() {
|
|
11361
|
-
|
|
11361
|
+
G("Abstract method `AnnotationElement.render` called");
|
|
11362
11362
|
}
|
|
11363
11363
|
_getElementsByName(t, e = null) {
|
|
11364
11364
|
const s = [];
|
|
@@ -11877,13 +11877,13 @@ class Hr extends Jt {
|
|
|
11877
11877
|
let A = y, S = v;
|
|
11878
11878
|
switch (p.inputType) {
|
|
11879
11879
|
case "deleteWordBackward": {
|
|
11880
|
-
const
|
|
11881
|
-
|
|
11880
|
+
const E = w.substring(0, y).match(/\w*[^\w]*$/);
|
|
11881
|
+
E && (A -= E[0].length);
|
|
11882
11882
|
break;
|
|
11883
11883
|
}
|
|
11884
11884
|
case "deleteWordForward": {
|
|
11885
|
-
const
|
|
11886
|
-
|
|
11885
|
+
const E = w.substring(y).match(/^[^\w]*\w*/);
|
|
11886
|
+
E && (S += E[0].length);
|
|
11887
11887
|
break;
|
|
11888
11888
|
}
|
|
11889
11889
|
case "deleteContentBackward":
|
|
@@ -12193,7 +12193,7 @@ class Cs extends Q {
|
|
|
12193
12193
|
this.popup = null;
|
|
12194
12194
|
}
|
|
12195
12195
|
#t() {
|
|
12196
|
-
return new
|
|
12196
|
+
return new jr({
|
|
12197
12197
|
container: this.container,
|
|
12198
12198
|
color: this.data.color,
|
|
12199
12199
|
titleObj: this.data.titleObj,
|
|
@@ -12219,9 +12219,9 @@ class Cs extends Q {
|
|
|
12219
12219
|
return this.container.setAttribute("aria-controls", s.map((i) => `${ie}${i}`).join(",")), this.container;
|
|
12220
12220
|
}
|
|
12221
12221
|
}
|
|
12222
|
-
class
|
|
12222
|
+
class jr {
|
|
12223
12223
|
#t = null;
|
|
12224
|
-
#e = this.#
|
|
12224
|
+
#e = this.#j.bind(this);
|
|
12225
12225
|
#i = this.#H.bind(this);
|
|
12226
12226
|
#s = this.#L.bind(this);
|
|
12227
12227
|
#a = this.#S.bind(this);
|
|
@@ -12241,11 +12241,11 @@ class Gr {
|
|
|
12241
12241
|
#w = null;
|
|
12242
12242
|
#y = null;
|
|
12243
12243
|
#C = null;
|
|
12244
|
-
#
|
|
12244
|
+
#E = null;
|
|
12245
12245
|
#v = null;
|
|
12246
12246
|
#T = !1;
|
|
12247
12247
|
#A = null;
|
|
12248
|
-
#
|
|
12248
|
+
#_ = null;
|
|
12249
12249
|
constructor({
|
|
12250
12250
|
container: t,
|
|
12251
12251
|
color: e,
|
|
@@ -12260,7 +12260,7 @@ class Gr {
|
|
|
12260
12260
|
open: c,
|
|
12261
12261
|
commentManager: u = null
|
|
12262
12262
|
}) {
|
|
12263
|
-
this.#n = t, this.#
|
|
12263
|
+
this.#n = t, this.#E = i, this.#o = r, this.#C = a, this.#u = o, this.#r = e, this.#y = l, this.#d = h, this.#l = s, this.#t = u, this.#A = s[0], this.#h = ys.toDateObject(n), this.trigger = s.flatMap((f) => f.getElementsToTriggerPopup()), u || (this.#k(), this.#n.hidden = !0, c && this.#S());
|
|
12264
12264
|
}
|
|
12265
12265
|
#k() {
|
|
12266
12266
|
if (this.#g)
|
|
@@ -12376,10 +12376,10 @@ class Gr {
|
|
|
12376
12376
|
return this.#p;
|
|
12377
12377
|
}
|
|
12378
12378
|
get comment() {
|
|
12379
|
-
return this.#
|
|
12379
|
+
return this.#_ ||= this.#A.commentText, this.#_;
|
|
12380
12380
|
}
|
|
12381
12381
|
set comment(t) {
|
|
12382
|
-
t !== this.comment && (this.#A.commentText = this.#
|
|
12382
|
+
t !== this.comment && (this.#A.commentText = this.#_ = t);
|
|
12383
12383
|
}
|
|
12384
12384
|
focus() {
|
|
12385
12385
|
this.#A.container?.focus();
|
|
@@ -12444,12 +12444,12 @@ class Gr {
|
|
|
12444
12444
|
t.style.backgroundColor = `color-mix(in srgb, ${s} 30%, white)`;
|
|
12445
12445
|
}
|
|
12446
12446
|
const e = document.createElement("span");
|
|
12447
|
-
if (e.className = "header", this.#
|
|
12447
|
+
if (e.className = "header", this.#E?.str) {
|
|
12448
12448
|
const s = document.createElement("span");
|
|
12449
12449
|
s.className = "title", e.append(s), {
|
|
12450
12450
|
dir: s.dir,
|
|
12451
12451
|
str: s.textContent
|
|
12452
|
-
} = this.#
|
|
12452
|
+
} = this.#E;
|
|
12453
12453
|
}
|
|
12454
12454
|
if (t.append(e), this.#h) {
|
|
12455
12455
|
const s = document.createElement("time");
|
|
@@ -12501,7 +12501,7 @@ class Gr {
|
|
|
12501
12501
|
});
|
|
12502
12502
|
return s;
|
|
12503
12503
|
}
|
|
12504
|
-
#
|
|
12504
|
+
#j(t) {
|
|
12505
12505
|
t.altKey || t.shiftKey || t.ctrlKey || t.metaKey || (t.key === "Enter" || t.key === "Escape" && this.#f) && this.#S();
|
|
12506
12506
|
}
|
|
12507
12507
|
updateEdited({
|
|
@@ -12510,7 +12510,7 @@ class Gr {
|
|
|
12510
12510
|
deleted: s
|
|
12511
12511
|
}) {
|
|
12512
12512
|
if (this.#t) {
|
|
12513
|
-
s ? (this.remove(), this.#
|
|
12513
|
+
s ? (this.remove(), this.#_ = null) : e && (e.deleted ? this.remove() : (this.#N(), this.#_ = e.text)), t && (this.#b = null, this.#P(), this.#M());
|
|
12514
12514
|
return;
|
|
12515
12515
|
}
|
|
12516
12516
|
if (s || e?.deleted) {
|
|
@@ -12605,7 +12605,7 @@ class qi extends Q {
|
|
|
12605
12605
|
return !this.data.popupRef && this.hasPopupData && (this.hasOwnCommentButton = !0, this._createPopup()), this._editOnDoubleClick(), this.container;
|
|
12606
12606
|
}
|
|
12607
12607
|
}
|
|
12608
|
-
class
|
|
12608
|
+
class Gr extends Q {
|
|
12609
12609
|
#t = null;
|
|
12610
12610
|
constructor(t) {
|
|
12611
12611
|
super(t, {
|
|
@@ -13647,13 +13647,13 @@ class lt extends D {
|
|
|
13647
13647
|
class P {
|
|
13648
13648
|
static PRECISION = 1e-4;
|
|
13649
13649
|
toSVGPath() {
|
|
13650
|
-
|
|
13650
|
+
G("Abstract method `toSVGPath` must be implemented.");
|
|
13651
13651
|
}
|
|
13652
13652
|
get box() {
|
|
13653
|
-
|
|
13653
|
+
G("Abstract getter `box` must be implemented.");
|
|
13654
13654
|
}
|
|
13655
13655
|
serialize(t, e) {
|
|
13656
|
-
|
|
13656
|
+
G("Abstract method `serialize` must be implemented.");
|
|
13657
13657
|
}
|
|
13658
13658
|
static _rescale(t, e, s, i, n, r) {
|
|
13659
13659
|
r ||= new Float32Array(t.length);
|
|
@@ -13704,7 +13704,7 @@ class P {
|
|
|
13704
13704
|
return [(t + 5 * s) / 6, (e + 5 * i) / 6, (5 * s + n) / 6, (5 * i + r) / 6, (s + n) / 2, (i + r) / 2];
|
|
13705
13705
|
}
|
|
13706
13706
|
}
|
|
13707
|
-
class
|
|
13707
|
+
class jt {
|
|
13708
13708
|
#t;
|
|
13709
13709
|
#e = [];
|
|
13710
13710
|
#i;
|
|
@@ -13720,12 +13720,12 @@ class Gt {
|
|
|
13720
13720
|
#f = [];
|
|
13721
13721
|
static #m = 8;
|
|
13722
13722
|
static #g = 2;
|
|
13723
|
-
static #c =
|
|
13723
|
+
static #c = jt.#m + jt.#g;
|
|
13724
13724
|
constructor({
|
|
13725
13725
|
x: t,
|
|
13726
13726
|
y: e
|
|
13727
13727
|
}, s, i, n, r, a = 0) {
|
|
13728
|
-
this.#t = s, this.#d = n * i, this.#s = r, this.#r.set([NaN, NaN, NaN, NaN, t, e], 6), this.#i = a, this.#l =
|
|
13728
|
+
this.#t = s, this.#d = n * i, this.#s = r, this.#r.set([NaN, NaN, NaN, NaN, t, e], 6), this.#i = a, this.#l = jt.#m * i, this.#h = jt.#c * i, this.#u = i, this.#f.push(t, e);
|
|
13729
13729
|
}
|
|
13730
13730
|
isEmpty() {
|
|
13731
13731
|
return isNaN(this.#r[8]);
|
|
@@ -13747,8 +13747,8 @@ class Gt {
|
|
|
13747
13747
|
const g = f - this.#l, p = g / f, b = p * c, m = p * u;
|
|
13748
13748
|
let w = a, y = o;
|
|
13749
13749
|
a = l, o = h, l += b, h += m, this.#f?.push(t, e);
|
|
13750
|
-
const v = -m / g, A = b / g, S = v * this.#d,
|
|
13751
|
-
return this.#r.set(this.#r.subarray(2, 8), 0), this.#r.set([l + S, h +
|
|
13750
|
+
const v = -m / g, A = b / g, S = v * this.#d, E = A * this.#d;
|
|
13751
|
+
return this.#r.set(this.#r.subarray(2, 8), 0), this.#r.set([l + S, h + E], 4), this.#r.set(this.#r.subarray(14, 18), 12), this.#r.set([l - S, h - E], 16), isNaN(this.#r[6]) ? (this.#a.length === 0 && (this.#r.set([a + S, o + E], 2), this.#a.push(NaN, NaN, NaN, NaN, (a + S - s) / n, (o + E - i) / r), this.#r.set([a - S, o - E], 14), this.#e.push(NaN, NaN, NaN, NaN, (a - S - s) / n, (o - E - i) / r)), this.#r.set([w, y, a, o, l, h], 6), !this.isEmpty()) : (this.#r.set([w, y, a, o, l, h], 6), Math.abs(Math.atan2(y - o, w - a) - Math.atan2(m, b)) < Math.PI / 2 ? ([a, o, l, h] = this.#r.subarray(2, 6), this.#a.push(NaN, NaN, NaN, NaN, ((a + l) / 2 - s) / n, ((o + h) / 2 - i) / r), [a, o, w, y] = this.#r.subarray(14, 18), this.#e.push(NaN, NaN, NaN, NaN, ((w + a) / 2 - s) / n, ((y + o) / 2 - i) / r), !0) : ([w, y, a, o, l, h] = this.#r.subarray(0, 6), this.#a.push(((w + 5 * a) / 6 - s) / n, ((y + 5 * o) / 6 - i) / r, ((5 * a + l) / 6 - s) / n, ((5 * o + h) / 6 - i) / r, ((a + l) / 2 - s) / n, ((o + h) / 2 - i) / r), [l, h, a, o, w, y] = this.#r.subarray(12, 18), this.#e.push(((w + 5 * a) / 6 - s) / n, ((y + 5 * o) / 6 - i) / r, ((5 * a + l) / 6 - s) / n, ((5 * o + h) / 6 - i) / r, ((a + l) / 2 - s) / n, ((o + h) / 2 - i) / r), !0));
|
|
13752
13752
|
}
|
|
13753
13753
|
toSVGPath() {
|
|
13754
13754
|
if (this.isEmpty())
|
|
@@ -13804,13 +13804,13 @@ class Gt {
|
|
|
13804
13804
|
}
|
|
13805
13805
|
l[h] = e[c + u], l[h + 1] = e[c + u + 1], h += 2;
|
|
13806
13806
|
}
|
|
13807
|
-
return this.#
|
|
13807
|
+
return this.#E(l, h), this.newFreeDrawOutline(l, o, this.#t, this.#u, this.#i, this.#s);
|
|
13808
13808
|
}
|
|
13809
13809
|
#C(t) {
|
|
13810
13810
|
const e = this.#r, [s, i, n, r] = this.#t, [a, o, l, h] = this.#p(), c = new Float32Array(36);
|
|
13811
13811
|
return c.set([NaN, NaN, NaN, NaN, (e[2] - s) / n, (e[3] - i) / r, NaN, NaN, NaN, NaN, (e[4] - s) / n, (e[5] - i) / r, NaN, NaN, NaN, NaN, a, o, NaN, NaN, NaN, NaN, l, h, NaN, NaN, NaN, NaN, (e[16] - s) / n, (e[17] - i) / r, NaN, NaN, NaN, NaN, (e[14] - s) / n, (e[15] - i) / r], 0), this.newFreeDrawOutline(c, t, this.#t, this.#u, this.#i, this.#s);
|
|
13812
13812
|
}
|
|
13813
|
-
#
|
|
13813
|
+
#E(t, e) {
|
|
13814
13814
|
const s = this.#e;
|
|
13815
13815
|
return t.set([NaN, NaN, NaN, NaN, s[4], s[5]], e), e += 6;
|
|
13816
13816
|
}
|
|
@@ -13885,7 +13885,7 @@ class Ji extends P {
|
|
|
13885
13885
|
return this.#e;
|
|
13886
13886
|
}
|
|
13887
13887
|
newOutliner(t, e, s, i, n, r = 0) {
|
|
13888
|
-
return new
|
|
13888
|
+
return new jt(t, e, s, i, n, r);
|
|
13889
13889
|
}
|
|
13890
13890
|
getNewOutline(t, e) {
|
|
13891
13891
|
const [s, i, n, r] = this.#e, [a, o, l, h] = this.#t, c = n * l, u = r * h, f = s * l + a, g = i * h + o, p = this.newOutliner({
|
|
@@ -13914,8 +13914,8 @@ class xs {
|
|
|
13914
13914
|
width: m,
|
|
13915
13915
|
height: w
|
|
13916
13916
|
} of t) {
|
|
13917
|
-
const y = Math.floor((p - e) / r) * r, v = Math.ceil((p + m + e) / r) * r, A = Math.floor((b - e) / r) * r, S = Math.ceil((b + w + e) / r) * r,
|
|
13918
|
-
this.#s.push(
|
|
13917
|
+
const y = Math.floor((p - e) / r) * r, v = Math.ceil((p + m + e) / r) * r, A = Math.floor((b - e) / r) * r, S = Math.ceil((b + w + e) / r) * r, E = [y, A, S, !0], _ = [v, A, S, !1];
|
|
13918
|
+
this.#s.push(E, _), T.rectBoundingBox(y, A, v, S, n);
|
|
13919
13919
|
}
|
|
13920
13920
|
const a = n[2] - n[0] + 2 * s, o = n[3] - n[1] + 2 * s, l = n[0] - s, h = n[1] - s;
|
|
13921
13921
|
let c = i ? -1 / 0 : 1 / 0, u = 1 / 0;
|
|
@@ -14061,7 +14061,7 @@ class ta extends P {
|
|
|
14061
14061
|
return ["highlightOutline"];
|
|
14062
14062
|
}
|
|
14063
14063
|
}
|
|
14064
|
-
class Ts extends
|
|
14064
|
+
class Ts extends jt {
|
|
14065
14065
|
newFreeDrawOutline(t, e, s, i, n, r) {
|
|
14066
14066
|
return new ea(t, e, s, i, n, r);
|
|
14067
14067
|
}
|
|
@@ -14176,12 +14176,12 @@ class Z extends D {
|
|
|
14176
14176
|
else if (this.parent) {
|
|
14177
14177
|
const c = this.parent.viewport.rotation;
|
|
14178
14178
|
this.parent.drawLayer.updateProperties(this.#u, {
|
|
14179
|
-
bbox: Z.#
|
|
14179
|
+
bbox: Z.#_(this.#l.box, (c - this.rotation + 360) % 360),
|
|
14180
14180
|
path: {
|
|
14181
14181
|
d: t.toSVGPath()
|
|
14182
14182
|
}
|
|
14183
14183
|
}), this.parent.drawLayer.updateProperties(this.#g, {
|
|
14184
|
-
bbox: Z.#
|
|
14184
|
+
bbox: Z.#_(this.#r.box, c),
|
|
14185
14185
|
path: {
|
|
14186
14186
|
d: this.#r.toSVGPath()
|
|
14187
14187
|
}
|
|
@@ -14242,7 +14242,7 @@ class Z extends D {
|
|
|
14242
14242
|
this.#C(e);
|
|
14243
14243
|
break;
|
|
14244
14244
|
case N.HIGHLIGHT_THICKNESS:
|
|
14245
|
-
this.#
|
|
14245
|
+
this.#E(e);
|
|
14246
14246
|
break;
|
|
14247
14247
|
}
|
|
14248
14248
|
}
|
|
@@ -14277,7 +14277,7 @@ class Z extends D {
|
|
|
14277
14277
|
color: this._uiManager.getNonHCMColorName(t)
|
|
14278
14278
|
}, !0);
|
|
14279
14279
|
}
|
|
14280
|
-
#
|
|
14280
|
+
#E(t) {
|
|
14281
14281
|
const e = this.#p, s = (i) => {
|
|
14282
14282
|
this.#p = i, this.#v(i);
|
|
14283
14283
|
};
|
|
@@ -14295,7 +14295,7 @@ class Z extends D {
|
|
|
14295
14295
|
}, !0);
|
|
14296
14296
|
}
|
|
14297
14297
|
get toolbarButtons() {
|
|
14298
|
-
return this._uiManager.highlightColors ? [["colorPicker", this.#a = new
|
|
14298
|
+
return this._uiManager.highlightColors ? [["colorPicker", this.#a = new Et({
|
|
14299
14299
|
editor: this
|
|
14300
14300
|
})]] : super.toolbarButtons;
|
|
14301
14301
|
}
|
|
@@ -14366,7 +14366,7 @@ class Z extends D {
|
|
|
14366
14366
|
}
|
|
14367
14367
|
}, this.#d), this.#h && (this.#h.style.clipPath = this.#s));
|
|
14368
14368
|
}
|
|
14369
|
-
static #
|
|
14369
|
+
static #_([t, e, s, i], n) {
|
|
14370
14370
|
switch (n) {
|
|
14371
14371
|
case 90:
|
|
14372
14372
|
return [1 - e - i, t, i, s];
|
|
@@ -14382,13 +14382,13 @@ class Z extends D {
|
|
|
14382
14382
|
drawLayer: e
|
|
14383
14383
|
} = this.parent;
|
|
14384
14384
|
let s;
|
|
14385
|
-
this.#d ? (t = (t - this.rotation + 360) % 360, s = Z.#
|
|
14385
|
+
this.#d ? (t = (t - this.rotation + 360) % 360, s = Z.#_(this.#l.box, t)) : s = Z.#_([this.x, this.y, this.width, this.height], t), e.updateProperties(this.#u, {
|
|
14386
14386
|
bbox: s,
|
|
14387
14387
|
root: {
|
|
14388
14388
|
"data-main-rotation": t
|
|
14389
14389
|
}
|
|
14390
14390
|
}), e.updateProperties(this.#g, {
|
|
14391
|
-
bbox: Z.#
|
|
14391
|
+
bbox: Z.#_(this.#r.box, t),
|
|
14392
14392
|
root: {
|
|
14393
14393
|
"data-main-rotation": t
|
|
14394
14394
|
}
|
|
@@ -14511,7 +14511,7 @@ class Z extends D {
|
|
|
14511
14511
|
capture: !0,
|
|
14512
14512
|
passive: !1,
|
|
14513
14513
|
signal: c
|
|
14514
|
-
}), window.addEventListener("contextmenu",
|
|
14514
|
+
}), window.addEventListener("contextmenu", _t, {
|
|
14515
14515
|
signal: c
|
|
14516
14516
|
}), s.addEventListener("pointermove", this.#I.bind(this, t), {
|
|
14517
14517
|
signal: c
|
|
@@ -14566,8 +14566,8 @@ class Z extends D {
|
|
|
14566
14566
|
popupRef: v,
|
|
14567
14567
|
richText: A,
|
|
14568
14568
|
contentsObj: S,
|
|
14569
|
-
creationDate:
|
|
14570
|
-
modificationDate:
|
|
14569
|
+
creationDate: E,
|
|
14570
|
+
modificationDate: _
|
|
14571
14571
|
},
|
|
14572
14572
|
parent: {
|
|
14573
14573
|
page: {
|
|
@@ -14590,8 +14590,8 @@ class Z extends D {
|
|
|
14590
14590
|
popupRef: v,
|
|
14591
14591
|
richText: A,
|
|
14592
14592
|
comment: S?.str || null,
|
|
14593
|
-
creationDate:
|
|
14594
|
-
modificationDate:
|
|
14593
|
+
creationDate: E,
|
|
14594
|
+
modificationDate: _
|
|
14595
14595
|
};
|
|
14596
14596
|
} else if (t instanceof Hs) {
|
|
14597
14597
|
const {
|
|
@@ -14607,8 +14607,8 @@ class Z extends D {
|
|
|
14607
14607
|
popupRef: v,
|
|
14608
14608
|
richText: A,
|
|
14609
14609
|
contentsObj: S,
|
|
14610
|
-
creationDate:
|
|
14611
|
-
modificationDate:
|
|
14610
|
+
creationDate: E,
|
|
14611
|
+
modificationDate: _
|
|
14612
14612
|
},
|
|
14613
14613
|
parent: {
|
|
14614
14614
|
page: {
|
|
@@ -14631,8 +14631,8 @@ class Z extends D {
|
|
|
14631
14631
|
popupRef: v,
|
|
14632
14632
|
richText: A,
|
|
14633
14633
|
comment: S?.str || null,
|
|
14634
|
-
creationDate:
|
|
14635
|
-
modificationDate:
|
|
14634
|
+
creationDate: E,
|
|
14635
|
+
modificationDate: _
|
|
14636
14636
|
};
|
|
14637
14637
|
}
|
|
14638
14638
|
const {
|
|
@@ -14743,7 +14743,7 @@ class Zi {
|
|
|
14743
14743
|
this.updateProperties(t);
|
|
14744
14744
|
}
|
|
14745
14745
|
clone() {
|
|
14746
|
-
|
|
14746
|
+
G("Not implemented");
|
|
14747
14747
|
}
|
|
14748
14748
|
}
|
|
14749
14749
|
class U extends D {
|
|
@@ -14786,10 +14786,10 @@ class U extends D {
|
|
|
14786
14786
|
return t;
|
|
14787
14787
|
}
|
|
14788
14788
|
static getDefaultDrawingOptions(t) {
|
|
14789
|
-
|
|
14789
|
+
G("Not implemented");
|
|
14790
14790
|
}
|
|
14791
14791
|
static get typesMap() {
|
|
14792
|
-
|
|
14792
|
+
G("Not implemented");
|
|
14793
14793
|
}
|
|
14794
14794
|
static get isDrawer() {
|
|
14795
14795
|
return !0;
|
|
@@ -15014,7 +15014,7 @@ class U extends D {
|
|
|
15014
15014
|
return s.append(i), i.setAttribute("aria-hidden", "true"), i.className = "internal", this.setDims(), this._uiManager.addShouldRescale(this), this.disableEditing(), this._isCopy && this._moveAfterPaste(t, e), s;
|
|
15015
15015
|
}
|
|
15016
15016
|
static createDrawerInstance(t, e, s, i, n) {
|
|
15017
|
-
|
|
15017
|
+
G("Not implemented");
|
|
15018
15018
|
}
|
|
15019
15019
|
static startDrawing(t, e, s, i) {
|
|
15020
15020
|
const {
|
|
@@ -15048,7 +15048,7 @@ class U extends D {
|
|
|
15048
15048
|
capture: !0,
|
|
15049
15049
|
passive: !1,
|
|
15050
15050
|
signal: g
|
|
15051
|
-
}), window.addEventListener("contextmenu",
|
|
15051
|
+
}), window.addEventListener("contextmenu", _t, {
|
|
15052
15052
|
signal: g
|
|
15053
15053
|
}), n.addEventListener("pointermove", this._drawMove.bind(this), {
|
|
15054
15054
|
signal: g
|
|
@@ -15127,7 +15127,7 @@ class U extends D {
|
|
|
15127
15127
|
createDrawingOptions(t) {
|
|
15128
15128
|
}
|
|
15129
15129
|
static deserializeDraw(t, e, s, i, n, r) {
|
|
15130
|
-
|
|
15130
|
+
G("Not implemented");
|
|
15131
15131
|
}
|
|
15132
15132
|
static async deserialize(t, e, s) {
|
|
15133
15133
|
const {
|
|
@@ -15397,11 +15397,11 @@ class Le extends P {
|
|
|
15397
15397
|
}
|
|
15398
15398
|
const y = new Float32Array(3 * (w - 2));
|
|
15399
15399
|
r.push(y);
|
|
15400
|
-
let [v, A, S,
|
|
15400
|
+
let [v, A, S, E] = m.subarray(0, 4);
|
|
15401
15401
|
y.set([NaN, NaN, NaN, NaN, v, A], 0);
|
|
15402
|
-
for (let
|
|
15403
|
-
const C = m[
|
|
15404
|
-
y.set(P.createBezierPoints(v, A, S,
|
|
15402
|
+
for (let _ = 4; _ < w; _ += 2) {
|
|
15403
|
+
const C = m[_], M = m[_ + 1];
|
|
15404
|
+
y.set(P.createBezierPoints(v, A, S, E, C, M), (_ - 2) * 3), [v, A, S, E] = [S, E, C, M];
|
|
15405
15405
|
}
|
|
15406
15406
|
}
|
|
15407
15407
|
}
|
|
@@ -15868,8 +15868,8 @@ class se {
|
|
|
15868
15868
|
continue;
|
|
15869
15869
|
}
|
|
15870
15870
|
let A = this.#i[2 * v], S = this.#i[2 * v + 1];
|
|
15871
|
-
const
|
|
15872
|
-
g =
|
|
15871
|
+
const E = h + A, _ = c + S;
|
|
15872
|
+
g = E, p = _;
|
|
15873
15873
|
let C = h, M = c;
|
|
15874
15874
|
for (; ; ) {
|
|
15875
15875
|
const x = this.#a(r, e, C, M, g, p, 1);
|
|
@@ -15877,7 +15877,7 @@ class se {
|
|
|
15877
15877
|
const H = C + A, V = M + S;
|
|
15878
15878
|
b.push(V, H);
|
|
15879
15879
|
const O = C * e + M;
|
|
15880
|
-
if (r[O + 1] === 0 ? r[O] = -a : r[O] === 1 && (r[O] = a), H === h && V === c && C ===
|
|
15880
|
+
if (r[O + 1] === 0 ? r[O] = -a : r[O] === 1 && (r[O] = a), H === h && V === c && C === E && M === _) {
|
|
15881
15881
|
r[u] !== 1 && (o = Math.abs(r[u]));
|
|
15882
15882
|
break;
|
|
15883
15883
|
} else
|
|
@@ -15889,15 +15889,15 @@ class se {
|
|
|
15889
15889
|
}
|
|
15890
15890
|
static #n(t, e, s, i) {
|
|
15891
15891
|
if (s - e <= 4) {
|
|
15892
|
-
for (let
|
|
15893
|
-
i.push(t[
|
|
15892
|
+
for (let E = e; E < s - 2; E += 2)
|
|
15893
|
+
i.push(t[E], t[E + 1]);
|
|
15894
15894
|
return;
|
|
15895
15895
|
}
|
|
15896
15896
|
const n = t[e], r = t[e + 1], a = t[s - 4] - n, o = t[s - 3] - r, l = Math.hypot(a, o), h = a / l, c = o / l, u = h * r - c * n, f = o / a, g = 1 / l, p = Math.atan(f), b = Math.cos(p), m = Math.sin(p), w = g * (Math.abs(b) + Math.abs(m)), y = g * (1 - w + w ** 2), v = Math.max(Math.atan(Math.abs(m + b) * y), Math.atan(Math.abs(m - b) * y));
|
|
15897
15897
|
let A = 0, S = e;
|
|
15898
|
-
for (let
|
|
15899
|
-
const
|
|
15900
|
-
|
|
15898
|
+
for (let E = e + 2; E < s - 2; E += 2) {
|
|
15899
|
+
const _ = Math.abs(u - h * t[E + 1] + c * t[E]);
|
|
15900
|
+
_ > A && (S = E, A = _);
|
|
15901
15901
|
}
|
|
15902
15902
|
A > (l * v) ** 2 ? (this.#n(t, e, S + 2, i), this.#n(t, S, s, i)) : i.push(n, r);
|
|
15903
15903
|
}
|
|
@@ -15921,13 +15921,13 @@ class se {
|
|
|
15921
15921
|
const m = p * e + b, w = t[m];
|
|
15922
15922
|
let y = 0, v = 0;
|
|
15923
15923
|
for (let S = 0; S < r; S++) {
|
|
15924
|
-
const
|
|
15925
|
-
if (!(
|
|
15926
|
-
for (let
|
|
15927
|
-
const C = b +
|
|
15924
|
+
const E = p + S - l;
|
|
15925
|
+
if (!(E < 0 || E >= s))
|
|
15926
|
+
for (let _ = 0; _ < r; _++) {
|
|
15927
|
+
const C = b + _ - l;
|
|
15928
15928
|
if (C < 0 || C >= e)
|
|
15929
15929
|
continue;
|
|
15930
|
-
const M = t[
|
|
15930
|
+
const M = t[E * e + C], x = a[S * r + _] * h[Math.abs(M - w)];
|
|
15931
15931
|
y += M * x, v += x;
|
|
15932
15932
|
}
|
|
15933
15933
|
}
|
|
@@ -16014,7 +16014,7 @@ class se {
|
|
|
16014
16014
|
alpha: !0,
|
|
16015
16015
|
willReadFrequently: !0
|
|
16016
16016
|
}), h.font = u, h.filter = "grayscale(1)", h.fillStyle = "white", h.fillRect(0, 0, A, S), h.fillStyle = "black", h.fillText(t, A * (v - 1) / 2, S * (3 - v) / 2);
|
|
16017
|
-
const
|
|
16017
|
+
const E = this.#u(h.getImageData(0, 0, A, S).data), _ = this.#l(E), C = this.#d(_), M = this.#r(E, A, S, C);
|
|
16018
16018
|
return this.processDrawnLines({
|
|
16019
16019
|
lines: {
|
|
16020
16020
|
curves: M,
|
|
@@ -16075,11 +16075,11 @@ class se {
|
|
|
16075
16075
|
A[0] = y[0] * g, A[1] = y[1] * p, S.set([NaN, NaN, NaN, NaN, A[0], A[1]], 0);
|
|
16076
16076
|
continue;
|
|
16077
16077
|
}
|
|
16078
|
-
let [
|
|
16079
|
-
|
|
16078
|
+
let [E, _, C, M] = y;
|
|
16079
|
+
E *= g, _ *= p, C *= g, M *= p, A.set([E, _, C, M], 0), S.set([NaN, NaN, NaN, NaN, E, _], 0);
|
|
16080
16080
|
for (let x = 4; x < v; x += 2) {
|
|
16081
16081
|
const H = A[x] = y[x] * g, V = A[x + 1] = y[x + 1] * p;
|
|
16082
|
-
S.set(P.createBezierPoints(
|
|
16082
|
+
S.set(P.createBezierPoints(E, _, C, M, H, V), (x - 2) * 3), [E, _, C, M] = [C, M, H, V];
|
|
16083
16083
|
}
|
|
16084
16084
|
}
|
|
16085
16085
|
if (u.length === 0)
|
|
@@ -16127,7 +16127,7 @@ class se {
|
|
|
16127
16127
|
}
|
|
16128
16128
|
p.close();
|
|
16129
16129
|
const m = await new Response(g.readable).arrayBuffer(), w = new Uint8Array(m);
|
|
16130
|
-
return
|
|
16130
|
+
return Ei(w);
|
|
16131
16131
|
}
|
|
16132
16132
|
static async decompressSignature(t) {
|
|
16133
16133
|
try {
|
|
@@ -16690,7 +16690,7 @@ class ia extends D {
|
|
|
16690
16690
|
const g = h.getContext("2d");
|
|
16691
16691
|
g.filter = this._uiManager.hcmFilter;
|
|
16692
16692
|
let p = "white", b = "#cfcfd8";
|
|
16693
|
-
this._uiManager.hcmFilter !== "none" ? b = "black" :
|
|
16693
|
+
this._uiManager.hcmFilter !== "none" ? b = "black" : _n.isDarkMode && (p = "#8f8f9d", b = "#42414d");
|
|
16694
16694
|
const m = 15, w = m * r.sx, y = m * r.sy, v = new OffscreenCanvas(w * 2, y * 2), A = v.getContext("2d");
|
|
16695
16695
|
A.fillStyle = p, A.fillRect(0, 0, w * 2, y * 2), A.fillStyle = b, A.fillRect(0, 0, w, y), A.fillRect(w, y, w, y), g.fillStyle = g.createPattern(v, "repeat"), g.fillRect(0, 0, u, f), g.drawImage(a, 0, 0, a.width, a.height, 0, 0, u, f);
|
|
16696
16696
|
}
|
|
@@ -16776,9 +16776,9 @@ class ia extends D {
|
|
|
16776
16776
|
richText: v,
|
|
16777
16777
|
contentsObj: A,
|
|
16778
16778
|
creationDate: S,
|
|
16779
|
-
modificationDate:
|
|
16779
|
+
modificationDate: E
|
|
16780
16780
|
},
|
|
16781
|
-
container:
|
|
16781
|
+
container: _,
|
|
16782
16782
|
parent: {
|
|
16783
16783
|
page: {
|
|
16784
16784
|
pageNumber: C
|
|
@@ -16790,7 +16790,7 @@ class ia extends D {
|
|
|
16790
16790
|
M ? (delete t.canvas, {
|
|
16791
16791
|
id: x,
|
|
16792
16792
|
bitmap: H
|
|
16793
|
-
} = s.imageManager.getFromCanvas(
|
|
16793
|
+
} = s.imageManager.getFromCanvas(_.id, M), M.remove()) : (n = !0, t._hasNoCanvas = !0);
|
|
16794
16794
|
const V = (await e._structTree.getAriaAttributes(`${ie}${m}`))?.get("aria-label") || "";
|
|
16795
16795
|
i = t = {
|
|
16796
16796
|
annotationType: F.STAMP,
|
|
@@ -16812,7 +16812,7 @@ class ia extends D {
|
|
|
16812
16812
|
richText: v,
|
|
16813
16813
|
comment: A?.str || null,
|
|
16814
16814
|
creationDate: S,
|
|
16815
|
-
modificationDate:
|
|
16815
|
+
modificationDate: E
|
|
16816
16816
|
};
|
|
16817
16817
|
}
|
|
16818
16818
|
const r = await super.deserialize(t, e, s), {
|
|
@@ -17219,7 +17219,7 @@ class Ft {
|
|
|
17219
17219
|
const {
|
|
17220
17220
|
offsetX: s,
|
|
17221
17221
|
offsetY: i
|
|
17222
|
-
} = this.#
|
|
17222
|
+
} = this.#E(), n = this.getNextId(), r = this.#C({
|
|
17223
17223
|
parent: this,
|
|
17224
17224
|
id: n,
|
|
17225
17225
|
x: s,
|
|
@@ -17248,7 +17248,7 @@ class Ft {
|
|
|
17248
17248
|
get boundingClientRect() {
|
|
17249
17249
|
return this.div.getBoundingClientRect();
|
|
17250
17250
|
}
|
|
17251
|
-
#
|
|
17251
|
+
#E() {
|
|
17252
17252
|
const {
|
|
17253
17253
|
x: t,
|
|
17254
17254
|
y: e,
|
|
@@ -17261,7 +17261,7 @@ class Ft {
|
|
|
17261
17261
|
};
|
|
17262
17262
|
}
|
|
17263
17263
|
addNewEditor(t = {}) {
|
|
17264
|
-
this.createAndAddNewEditor(this.#
|
|
17264
|
+
this.createAndAddNewEditor(this.#E(), !0, t);
|
|
17265
17265
|
}
|
|
17266
17266
|
setSelected(t) {
|
|
17267
17267
|
this.#c.setSelected(t);
|
|
@@ -17525,7 +17525,7 @@ globalThis.pdfjsLib = {
|
|
|
17525
17525
|
AnnotationType: nt,
|
|
17526
17526
|
applyOpacity: xn,
|
|
17527
17527
|
build: Lr,
|
|
17528
|
-
ColorPicker:
|
|
17528
|
+
ColorPicker: Et,
|
|
17529
17529
|
createValidAbsoluteUrl: wi,
|
|
17530
17530
|
CSSConstants: Cn,
|
|
17531
17531
|
DOMSVGFactory: qe,
|
|
@@ -17546,9 +17546,9 @@ globalThis.pdfjsLib = {
|
|
|
17546
17546
|
isPdfFile: ks,
|
|
17547
17547
|
isValidExplicitDest: Bn,
|
|
17548
17548
|
MathClamp: ut,
|
|
17549
|
-
noContextMenu:
|
|
17549
|
+
noContextMenu: _t,
|
|
17550
17550
|
normalizeUnicode: mn,
|
|
17551
|
-
OPS:
|
|
17551
|
+
OPS: Ee,
|
|
17552
17552
|
OutputScale: Rt,
|
|
17553
17553
|
PasswordResponses: on,
|
|
17554
17554
|
PDFDataRangeTransport: Vi,
|
|
@@ -17570,7 +17570,7 @@ globalThis.pdfjsLib = {
|
|
|
17570
17570
|
Util: T,
|
|
17571
17571
|
VerbosityLevel: Ke,
|
|
17572
17572
|
version: Wi,
|
|
17573
|
-
XfaLayer:
|
|
17573
|
+
XfaLayer: _i
|
|
17574
17574
|
};
|
|
17575
17575
|
class na {
|
|
17576
17576
|
document = null;
|
|
@@ -18352,12 +18352,12 @@ class ua {
|
|
|
18352
18352
|
let o = document.elementsFromPoint(e, s).find((A) => A.classList && A.classList.contains("page-view"));
|
|
18353
18353
|
if (!o || !o.dataset.pageIndex) {
|
|
18354
18354
|
const A = Array.from(this.container.querySelectorAll(".page-view"));
|
|
18355
|
-
let S = 1 / 0,
|
|
18356
|
-
if (A.forEach((
|
|
18357
|
-
const C =
|
|
18358
|
-
O < S && (S = O,
|
|
18359
|
-
}),
|
|
18360
|
-
o =
|
|
18355
|
+
let S = 1 / 0, E = null;
|
|
18356
|
+
if (A.forEach((_) => {
|
|
18357
|
+
const C = _.getBoundingClientRect(), M = Math.max(C.left, Math.min(i, C.right)), x = Math.max(C.top, Math.min(n, C.bottom)), H = i - M, V = n - x, O = Math.sqrt(H * H + V * V);
|
|
18358
|
+
O < S && (S = O, E = _);
|
|
18359
|
+
}), E)
|
|
18360
|
+
o = E;
|
|
18361
18361
|
else {
|
|
18362
18362
|
console.warn("No pages found to snap to."), this.strategy?.setFields(this.fields);
|
|
18363
18363
|
return;
|
|
@@ -18385,6 +18385,104 @@ class ua {
|
|
|
18385
18385
|
off(t, e) {
|
|
18386
18386
|
this.eventBus.off(t, e);
|
|
18387
18387
|
}
|
|
18388
|
+
async print(t) {
|
|
18389
|
+
if (!this.pdfDocument) return;
|
|
18390
|
+
const e = document.createElement("iframe");
|
|
18391
|
+
e.style.position = "fixed", e.style.top = "0", e.style.left = "-10000px", e.style.width = "0", e.style.height = "0", e.style.border = "none", e.style.visibility = "hidden", document.body.appendChild(e);
|
|
18392
|
+
const s = e.contentWindow?.document;
|
|
18393
|
+
if (!s)
|
|
18394
|
+
throw document.body.removeChild(e), new Error("Could not create print iframe");
|
|
18395
|
+
Array.from(document.styleSheets).forEach((r) => {
|
|
18396
|
+
try {
|
|
18397
|
+
if (r.href) {
|
|
18398
|
+
const a = document.createElement("link");
|
|
18399
|
+
a.rel = "stylesheet", a.href = r.href, s.head.appendChild(a);
|
|
18400
|
+
} else if (r.cssRules) {
|
|
18401
|
+
const a = document.createElement("style");
|
|
18402
|
+
Array.from(r.cssRules).forEach((o) => {
|
|
18403
|
+
a.appendChild(document.createTextNode(o.cssText));
|
|
18404
|
+
}), s.head.appendChild(a);
|
|
18405
|
+
}
|
|
18406
|
+
} catch (a) {
|
|
18407
|
+
console.warn("Could not copy stylesheet", a);
|
|
18408
|
+
}
|
|
18409
|
+
});
|
|
18410
|
+
const i = document.createElement("style");
|
|
18411
|
+
i.textContent = `
|
|
18412
|
+
@page { margin: 0; size: auto; }
|
|
18413
|
+
html, body {
|
|
18414
|
+
margin: 0 !important;
|
|
18415
|
+
padding: 0 !important;
|
|
18416
|
+
height: auto !important;
|
|
18417
|
+
overflow: visible !important;
|
|
18418
|
+
background-color: white !important;
|
|
18419
|
+
}
|
|
18420
|
+
/* Hide scrollbars */
|
|
18421
|
+
::-webkit-scrollbar { display: none; }
|
|
18422
|
+
* { -ms-overflow-style: none; scrollbar-width: none; }
|
|
18423
|
+
|
|
18424
|
+
.print-page {
|
|
18425
|
+
position: relative;
|
|
18426
|
+
page-break-after: always;
|
|
18427
|
+
width: 100%;
|
|
18428
|
+
overflow: hidden;
|
|
18429
|
+
margin: 0;
|
|
18430
|
+
padding: 0;
|
|
18431
|
+
}
|
|
18432
|
+
.print-page img {
|
|
18433
|
+
display: block;
|
|
18434
|
+
width: 100%;
|
|
18435
|
+
height: auto;
|
|
18436
|
+
}
|
|
18437
|
+
.print-field {
|
|
18438
|
+
position: absolute;
|
|
18439
|
+
border: 1px solid transparent;
|
|
18440
|
+
}
|
|
18441
|
+
/* Hide UI controls in print */
|
|
18442
|
+
.sc-resize-handle, .sc-delete-btn { display: none !important; }
|
|
18443
|
+
`, s.head.appendChild(i);
|
|
18444
|
+
const n = document.createElement("div");
|
|
18445
|
+
s.body.appendChild(n);
|
|
18446
|
+
try {
|
|
18447
|
+
const a = this.pdfDocument.numPages;
|
|
18448
|
+
for (let o = 1; o <= a; o++) {
|
|
18449
|
+
const l = await this.pdfDocument.getPage(o), h = l.getViewport({ scale: 2 }), c = document.createElement("canvas"), u = c.getContext("2d");
|
|
18450
|
+
if (!u) continue;
|
|
18451
|
+
c.width = h.width, c.height = h.height, await l.render({
|
|
18452
|
+
canvasContext: u,
|
|
18453
|
+
viewport: h
|
|
18454
|
+
}).promise;
|
|
18455
|
+
const f = document.createElement("div");
|
|
18456
|
+
f.className = "print-page";
|
|
18457
|
+
const g = document.createElement("img");
|
|
18458
|
+
g.src = c.toDataURL("image/jpeg", 0.8), f.appendChild(g), t?.withSignatures && this.fields.filter((b) => b.pageIndex === o - 1).forEach((b) => {
|
|
18459
|
+
const m = document.createElement("div");
|
|
18460
|
+
m.className = "print-field select-none";
|
|
18461
|
+
const w = l.getViewport({ scale: 1 }), y = b.rect.x / w.width * 100, A = (w.height - b.rect.y - b.rect.height) / w.height * 100, S = b.rect.width / w.width * 100, E = b.rect.height / w.height * 100;
|
|
18462
|
+
if (m.style.left = `${y}%`, m.style.top = `${A}%`, m.style.width = `${S}%`, m.style.height = `${E}%`, m.style.display = "flex", m.style.alignItems = "center", m.style.justifyContent = "center", m.style.overflow = "hidden", b.style && Object.assign(m.style, b.style), b.type === "text")
|
|
18463
|
+
m.textContent = b.content || "", m.style.fontFamily = "sans-serif", m.style.fontSize = "2cqw", m.style.whiteSpace = "pre-wrap", m.style.textAlign = "center";
|
|
18464
|
+
else if (b.type === "image") {
|
|
18465
|
+
const _ = document.createElement("img");
|
|
18466
|
+
_.src = b.content || "", _.style.width = "100%", _.style.height = "100%", _.style.objectFit = "contain", m.appendChild(_);
|
|
18467
|
+
} else if (b.type === "signature") {
|
|
18468
|
+
m.innerHTML = b.content || "";
|
|
18469
|
+
const _ = m.querySelector("img");
|
|
18470
|
+
_ && (_.style.width = "100%", _.style.height = "100%");
|
|
18471
|
+
const C = m.querySelector("svg");
|
|
18472
|
+
C && (C.style.width = "100%", C.style.height = "100%");
|
|
18473
|
+
}
|
|
18474
|
+
f.appendChild(m);
|
|
18475
|
+
}), n.appendChild(f);
|
|
18476
|
+
}
|
|
18477
|
+
await new Promise((o) => setTimeout(o, 500)), e.contentWindow?.focus(), e.contentWindow?.print();
|
|
18478
|
+
} catch (r) {
|
|
18479
|
+
throw console.error("Print failed", r), r;
|
|
18480
|
+
} finally {
|
|
18481
|
+
setTimeout(() => {
|
|
18482
|
+
document.body.contains(e) && document.body.removeChild(e);
|
|
18483
|
+
}, 3e5);
|
|
18484
|
+
}
|
|
18485
|
+
}
|
|
18388
18486
|
destroy() {
|
|
18389
18487
|
this.isDestroyed = !0, this.zoomHandler.destroy(), this.strategy?.destroy(), this.loader.destroy(), this.eventBus.clear(), this.container.innerHTML = "";
|
|
18390
18488
|
}
|
|
@@ -18450,6 +18548,9 @@ class pa {
|
|
|
18450
18548
|
updateField(t, e) {
|
|
18451
18549
|
this.viewer.updateField(t, e);
|
|
18452
18550
|
}
|
|
18551
|
+
async print(t) {
|
|
18552
|
+
return this.viewer.print(t);
|
|
18553
|
+
}
|
|
18453
18554
|
destroy() {
|
|
18454
18555
|
this.viewer.destroy();
|
|
18455
18556
|
}
|