@shznet/pdf-sign-standalone 0.2.2 → 1.0.0
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/dist/index.js +469 -443
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
var yi = (d) => {
|
|
2
2
|
throw TypeError(d);
|
|
3
|
-
},
|
|
3
|
+
}, Ms = (d, t, e) => t.has(d) || yi("Cannot " + e), Y = (d, t, e) => (Ms(d, t, "read from private field"), e ? e.call(d) : t.get(d)), Ft = (d, t, e) => t.has(d) ? yi("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(d) : t.set(d, e), mt = (d, t, e, s) => (Ms(d, t, "write to private field"), t.set(d, e), e), It = (d, t, e) => (Ms(d, t, "access private method"), e), nn = (d, t, e, s) => ({
|
|
4
4
|
set _(i) {
|
|
5
5
|
mt(d, t, i);
|
|
6
6
|
},
|
|
@@ -114,7 +114,7 @@ const dt = typeof process == "object" && process + "" == "[object process]" && !
|
|
|
114
114
|
ANNOTATIONS_DISABLE: 64,
|
|
115
115
|
IS_EDITING: 128,
|
|
116
116
|
OPLIST: 256
|
|
117
|
-
},
|
|
117
|
+
}, Ot = {
|
|
118
118
|
DISABLE: 0,
|
|
119
119
|
ENABLE: 1,
|
|
120
120
|
ENABLE_FORMS: 2,
|
|
@@ -129,7 +129,7 @@ const dt = typeof process == "object" && process + "" == "[object process]" && !
|
|
|
129
129
|
POPUP: 16,
|
|
130
130
|
SIGNATURE: 101,
|
|
131
131
|
COMMENT: 102
|
|
132
|
-
},
|
|
132
|
+
}, B = {
|
|
133
133
|
RESIZE: 1,
|
|
134
134
|
CREATE: 2,
|
|
135
135
|
FREETEXT_SIZE: 11,
|
|
@@ -315,13 +315,13 @@ function cn() {
|
|
|
315
315
|
function Qe(d) {
|
|
316
316
|
Ke >= Ye.INFOS && console.info(`Info: ${d}`);
|
|
317
317
|
}
|
|
318
|
-
function
|
|
318
|
+
function I(d) {
|
|
319
319
|
Ke >= Ye.WARNINGS && console.warn(`Warning: ${d}`);
|
|
320
320
|
}
|
|
321
321
|
function j(d) {
|
|
322
322
|
throw new Error(d);
|
|
323
323
|
}
|
|
324
|
-
function
|
|
324
|
+
function O(d, t) {
|
|
325
325
|
d || j(t);
|
|
326
326
|
}
|
|
327
327
|
function dn(d) {
|
|
@@ -796,13 +796,13 @@ class Ei {
|
|
|
796
796
|
t.div.style.transform = e, t.div.hidden = !1;
|
|
797
797
|
}
|
|
798
798
|
}
|
|
799
|
-
const
|
|
799
|
+
const Rt = "http://www.w3.org/2000/svg";
|
|
800
800
|
class le {
|
|
801
801
|
static CSS = 96;
|
|
802
802
|
static PDF = 72;
|
|
803
803
|
static PDF_TO_CSS_UNITS = this.CSS / this.PDF;
|
|
804
804
|
}
|
|
805
|
-
async function
|
|
805
|
+
async function Pe(d, t = "text") {
|
|
806
806
|
if (ye(d, document.baseURI)) {
|
|
807
807
|
const e = await fetch(d);
|
|
808
808
|
if (!e.ok)
|
|
@@ -837,7 +837,7 @@ async function Me(d, t = "text") {
|
|
|
837
837
|
}, i.send(null);
|
|
838
838
|
});
|
|
839
839
|
}
|
|
840
|
-
class
|
|
840
|
+
class Me {
|
|
841
841
|
constructor({
|
|
842
842
|
viewBox: t,
|
|
843
843
|
userUnit: e,
|
|
@@ -886,7 +886,7 @@ class Pe {
|
|
|
886
886
|
offsetY: i = this.offsetY,
|
|
887
887
|
dontFlip: n = !1
|
|
888
888
|
} = {}) {
|
|
889
|
-
return new
|
|
889
|
+
return new Me({
|
|
890
890
|
viewBox: this.viewBox.slice(),
|
|
891
891
|
userUnit: this.userUnit,
|
|
892
892
|
scale: t,
|
|
@@ -933,7 +933,7 @@ function An(d, t = "document.pdf") {
|
|
|
933
933
|
if (typeof d != "string")
|
|
934
934
|
return t;
|
|
935
935
|
if (Je(d))
|
|
936
|
-
return
|
|
936
|
+
return I('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'), t;
|
|
937
937
|
const e = ((r) => {
|
|
938
938
|
try {
|
|
939
939
|
return new URL(r);
|
|
@@ -986,10 +986,10 @@ class Xs {
|
|
|
986
986
|
started = /* @__PURE__ */ Object.create(null);
|
|
987
987
|
times = [];
|
|
988
988
|
time(t) {
|
|
989
|
-
t in this.started &&
|
|
989
|
+
t in this.started && I(`Timer is already running for ${t}`), this.started[t] = Date.now();
|
|
990
990
|
}
|
|
991
991
|
timeEnd(t) {
|
|
992
|
-
t in this.started ||
|
|
992
|
+
t in this.started || I(`Timer has not been started for ${t}`), this.times.push({
|
|
993
993
|
name: t,
|
|
994
994
|
start: this.started[t],
|
|
995
995
|
end: Date.now()
|
|
@@ -1062,7 +1062,7 @@ function _n(d, {
|
|
|
1062
1062
|
width: s,
|
|
1063
1063
|
height: i
|
|
1064
1064
|
} = d.attributes.style, n = [0, 0, parseInt(s), parseInt(i)];
|
|
1065
|
-
return new
|
|
1065
|
+
return new Me({
|
|
1066
1066
|
viewBox: n,
|
|
1067
1067
|
userUnit: 1,
|
|
1068
1068
|
scale: t,
|
|
@@ -1074,7 +1074,7 @@ function ke(d) {
|
|
|
1074
1074
|
const t = parseInt(d.slice(1), 16);
|
|
1075
1075
|
return [(t & 16711680) >> 16, (t & 65280) >> 8, t & 255];
|
|
1076
1076
|
}
|
|
1077
|
-
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) : (
|
|
1077
|
+
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) : (I(`Not a valid color format: "${d}"`), [0, 0, 0]);
|
|
1078
1078
|
}
|
|
1079
1079
|
function En(d) {
|
|
1080
1080
|
const t = document.createElement("span");
|
|
@@ -1109,7 +1109,7 @@ function St(d) {
|
|
|
1109
1109
|
return [t, e, s, i, n, r];
|
|
1110
1110
|
}
|
|
1111
1111
|
function jt(d, t, e = !1, s = !0) {
|
|
1112
|
-
if (t instanceof
|
|
1112
|
+
if (t instanceof Me) {
|
|
1113
1113
|
const {
|
|
1114
1114
|
pageWidth: i,
|
|
1115
1115
|
pageHeight: n
|
|
@@ -1230,7 +1230,7 @@ function Qs(d, t, e) {
|
|
|
1230
1230
|
return s > i ? (s + 0.05) / (i + 0.05) : (i + 0.05) / (s + 0.05);
|
|
1231
1231
|
}
|
|
1232
1232
|
const Js = /* @__PURE__ */ new Map();
|
|
1233
|
-
function
|
|
1233
|
+
function Pn(d, t) {
|
|
1234
1234
|
const e = d[0] + d[1] * 256 + d[2] * 65536 + t[0] * 16777216 + t[1] * 4294967296 + t[2] * 1099511627776;
|
|
1235
1235
|
let s = Js.get(e);
|
|
1236
1236
|
if (s)
|
|
@@ -1297,7 +1297,7 @@ function Ci(d) {
|
|
|
1297
1297
|
t.closePath();
|
|
1298
1298
|
break;
|
|
1299
1299
|
default:
|
|
1300
|
-
|
|
1300
|
+
I(`Unrecognized drawing path operator: ${d[e - 1]}`);
|
|
1301
1301
|
break;
|
|
1302
1302
|
}
|
|
1303
1303
|
return t;
|
|
@@ -1446,7 +1446,7 @@ class Ae {
|
|
|
1446
1446
|
this.#t.remove(), this.#e?.destroy(), this.#e = null;
|
|
1447
1447
|
}
|
|
1448
1448
|
}
|
|
1449
|
-
class
|
|
1449
|
+
class Mn {
|
|
1450
1450
|
#t = null;
|
|
1451
1451
|
#e = null;
|
|
1452
1452
|
#i;
|
|
@@ -1556,7 +1556,7 @@ class kn {
|
|
|
1556
1556
|
return `${_e}${this.#t++}`;
|
|
1557
1557
|
}
|
|
1558
1558
|
}
|
|
1559
|
-
class
|
|
1559
|
+
class Rs {
|
|
1560
1560
|
#t = xi();
|
|
1561
1561
|
#e = 0;
|
|
1562
1562
|
#i = null;
|
|
@@ -1583,8 +1583,8 @@ class Is {
|
|
|
1583
1583
|
isSvg: !1
|
|
1584
1584
|
};
|
|
1585
1585
|
let i;
|
|
1586
|
-
if (typeof e == "string" ? (s.url = e, i = await
|
|
1587
|
-
const n =
|
|
1586
|
+
if (typeof e == "string" ? (s.url = e, i = await Pe(e, "blob")) : e instanceof File ? i = s.file = e : e instanceof Blob && (i = e), i.type === "image/svg+xml") {
|
|
1587
|
+
const n = Rs._isSVGFittingCanvas, r = new FileReader(), a = new Image(), o = new Promise((h, l) => {
|
|
1588
1588
|
a.onload = () => {
|
|
1589
1589
|
s.bitmap = a, s.isSvg = !0, h();
|
|
1590
1590
|
}, r.onload = async () => {
|
|
@@ -1597,7 +1597,7 @@ class Is {
|
|
|
1597
1597
|
s.bitmap = await createImageBitmap(i);
|
|
1598
1598
|
s.refCounter = 1;
|
|
1599
1599
|
} catch (i) {
|
|
1600
|
-
|
|
1600
|
+
I(i), s = null;
|
|
1601
1601
|
}
|
|
1602
1602
|
return this.#i.set(t, s), s && this.#i.set(s.id, s), s;
|
|
1603
1603
|
}
|
|
@@ -1785,7 +1785,7 @@ class De {
|
|
|
1785
1785
|
a && !a(t, e) || (i.bind(t, ...r, e)(), n || Q(e));
|
|
1786
1786
|
}
|
|
1787
1787
|
}
|
|
1788
|
-
class
|
|
1788
|
+
class Is {
|
|
1789
1789
|
static _colorsMapping = /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]);
|
|
1790
1790
|
get _colors() {
|
|
1791
1791
|
const t = /* @__PURE__ */ new Map([["CanvasText", null], ["Canvas", null]]);
|
|
@@ -1797,7 +1797,7 @@ class Rs {
|
|
|
1797
1797
|
return e;
|
|
1798
1798
|
for (const [s, i] of this._colors)
|
|
1799
1799
|
if (i.every((n, r) => n === e[r]))
|
|
1800
|
-
return
|
|
1800
|
+
return Is._colorsMapping.get(s);
|
|
1801
1801
|
return e;
|
|
1802
1802
|
}
|
|
1803
1803
|
getHexCode(t) {
|
|
@@ -1834,17 +1834,17 @@ class zt {
|
|
|
1834
1834
|
#v = !1;
|
|
1835
1835
|
#E = null;
|
|
1836
1836
|
#k = new kn();
|
|
1837
|
-
#M = !1;
|
|
1838
1837
|
#P = !1;
|
|
1839
|
-
#
|
|
1840
|
-
#
|
|
1838
|
+
#M = !1;
|
|
1839
|
+
#B = !1;
|
|
1840
|
+
#R = null;
|
|
1841
1841
|
#L = null;
|
|
1842
|
-
#
|
|
1842
|
+
#O = null;
|
|
1843
1843
|
#F = null;
|
|
1844
1844
|
#G = null;
|
|
1845
1845
|
#C = F.NONE;
|
|
1846
1846
|
#x = /* @__PURE__ */ new Set();
|
|
1847
|
-
#
|
|
1847
|
+
#I = null;
|
|
1848
1848
|
#H = null;
|
|
1849
1849
|
#z = null;
|
|
1850
1850
|
#q = null;
|
|
@@ -1934,12 +1934,12 @@ class zt {
|
|
|
1934
1934
|
}), a._on("switchannotationeditorparams", (w) => this.updateParams(w.type, w.value), {
|
|
1935
1935
|
signal: m
|
|
1936
1936
|
}), window.addEventListener("pointerdown", () => {
|
|
1937
|
-
this.#
|
|
1937
|
+
this.#M = !0;
|
|
1938
1938
|
}, {
|
|
1939
1939
|
capture: !0,
|
|
1940
1940
|
signal: m
|
|
1941
1941
|
}), window.addEventListener("pointerup", () => {
|
|
1942
|
-
this.#
|
|
1942
|
+
this.#M = !1;
|
|
1943
1943
|
}, {
|
|
1944
1944
|
capture: !0,
|
|
1945
1945
|
signal: m
|
|
@@ -1952,7 +1952,7 @@ class zt {
|
|
|
1952
1952
|
this.#$?.resolve(), this.#$ = null, this.#t?.abort(), this.#t = null, this._signal = null;
|
|
1953
1953
|
for (const t of this.#a.values())
|
|
1954
1954
|
t.destroy();
|
|
1955
|
-
this.#a.clear(), this.#s.clear(), this.#g.clear(), this.#F?.clear(), this.#e = null, this.#x.clear(), this.#l.destroy(), this.#r?.destroy(), this.#h?.destroy(), this.#H?.destroy(), this.#E?.hide(), this.#E = null, this.#
|
|
1955
|
+
this.#a.clear(), this.#s.clear(), this.#g.clear(), this.#F?.clear(), this.#e = null, this.#x.clear(), this.#l.destroy(), this.#r?.destroy(), this.#h?.destroy(), this.#H?.destroy(), this.#E?.hide(), this.#E = null, this.#O?.destroy(), this.#O = null, this.#i = null, this.#_ && (clearTimeout(this.#_), this.#_ = null), this.#N && (clearTimeout(this.#N), this.#N = null), this._editorUndoBar?.destroy(), this.#W = null;
|
|
1956
1956
|
}
|
|
1957
1957
|
combinedSignal(t) {
|
|
1958
1958
|
return AbortSignal.any([this._signal, t.signal]);
|
|
@@ -2008,7 +2008,7 @@ class zt {
|
|
|
2008
2008
|
t ? (this.unselectAll(), this.disableUserSelect(!0)) : this.disableUserSelect(!1), this.#d = t;
|
|
2009
2009
|
}
|
|
2010
2010
|
setMainHighlightColorPicker(t) {
|
|
2011
|
-
this.#
|
|
2011
|
+
this.#O = t;
|
|
2012
2012
|
}
|
|
2013
2013
|
editAltText(t, e = !1) {
|
|
2014
2014
|
this.#r?.editAltText(this, t, e);
|
|
@@ -2183,7 +2183,7 @@ class zt {
|
|
|
2183
2183
|
if (!t || t.isCollapsed)
|
|
2184
2184
|
return;
|
|
2185
2185
|
const e = this.#Q(t).closest(".textLayer"), s = this.getSelectionBoxes(e);
|
|
2186
|
-
s && (this.#E ||= new
|
|
2186
|
+
s && (this.#E ||= new Mn(this), this.#E.show(e, s, this.direction === "ltr"));
|
|
2187
2187
|
}
|
|
2188
2188
|
getAndRemoveDataFromAnnotationStorage(t) {
|
|
2189
2189
|
if (!this.#n)
|
|
@@ -2201,7 +2201,7 @@ class zt {
|
|
|
2201
2201
|
#rt() {
|
|
2202
2202
|
const t = document.getSelection();
|
|
2203
2203
|
if (!t || t.isCollapsed) {
|
|
2204
|
-
this.#
|
|
2204
|
+
this.#I && (this.#E?.hide(), this.#I = null, this.#D({
|
|
2205
2205
|
hasSelectedText: !1
|
|
2206
2206
|
}));
|
|
2207
2207
|
return;
|
|
@@ -2209,20 +2209,20 @@ class zt {
|
|
|
2209
2209
|
const {
|
|
2210
2210
|
anchorNode: e
|
|
2211
2211
|
} = t;
|
|
2212
|
-
if (e === this.#
|
|
2212
|
+
if (e === this.#I)
|
|
2213
2213
|
return;
|
|
2214
2214
|
const s = this.#Q(t).closest(".textLayer");
|
|
2215
2215
|
if (!s) {
|
|
2216
|
-
this.#
|
|
2216
|
+
this.#I && (this.#E?.hide(), this.#I = null, this.#D({
|
|
2217
2217
|
hasSelectedText: !1
|
|
2218
2218
|
}));
|
|
2219
2219
|
return;
|
|
2220
2220
|
}
|
|
2221
|
-
if (this.#E?.hide(), this.#
|
|
2221
|
+
if (this.#E?.hide(), this.#I = e, this.#D({
|
|
2222
2222
|
hasSelectedText: !0
|
|
2223
2223
|
}), !(this.#C !== F.HIGHLIGHT && this.#C !== F.NONE) && (this.#C === F.HIGHLIGHT && this.showAllEditors("highlight", !0, !0), this.#v = this.isShiftKeyDown, !this.isShiftKeyDown)) {
|
|
2224
2224
|
const i = this.#C === F.HIGHLIGHT ? this.#tt(s) : null;
|
|
2225
|
-
if (i?.toggleDrawing(), this.#
|
|
2225
|
+
if (i?.toggleDrawing(), this.#M) {
|
|
2226
2226
|
const n = new AbortController(), r = this.combinedSignal(n), a = (o) => {
|
|
2227
2227
|
o.type === "pointerup" && o.button !== 0 || (n.abort(), i?.toggleDrawing(!0), o.type === "pointerup" && this.#Y("main_toolbar"));
|
|
2228
2228
|
};
|
|
@@ -2281,10 +2281,10 @@ class zt {
|
|
|
2281
2281
|
}), e.focus();
|
|
2282
2282
|
}
|
|
2283
2283
|
#et() {
|
|
2284
|
-
if (this.#
|
|
2284
|
+
if (this.#R)
|
|
2285
2285
|
return;
|
|
2286
|
-
this.#
|
|
2287
|
-
const t = this.combinedSignal(this.#
|
|
2286
|
+
this.#R = new AbortController();
|
|
2287
|
+
const t = this.combinedSignal(this.#R);
|
|
2288
2288
|
window.addEventListener("keydown", this.keydown.bind(this), {
|
|
2289
2289
|
signal: t
|
|
2290
2290
|
}), window.addEventListener("keyup", this.keyup.bind(this), {
|
|
@@ -2292,7 +2292,7 @@ class zt {
|
|
|
2292
2292
|
});
|
|
2293
2293
|
}
|
|
2294
2294
|
#lt() {
|
|
2295
|
-
this.#
|
|
2295
|
+
this.#R?.abort(), this.#R = null;
|
|
2296
2296
|
}
|
|
2297
2297
|
#ct() {
|
|
2298
2298
|
if (this.#u)
|
|
@@ -2372,7 +2372,7 @@ class zt {
|
|
|
2372
2372
|
try {
|
|
2373
2373
|
s = JSON.parse(s);
|
|
2374
2374
|
} catch (n) {
|
|
2375
|
-
|
|
2375
|
+
I(`paste: "${n.message}".`);
|
|
2376
2376
|
return;
|
|
2377
2377
|
}
|
|
2378
2378
|
if (!Array.isArray(s))
|
|
@@ -2401,7 +2401,7 @@ class zt {
|
|
|
2401
2401
|
mustExec: !0
|
|
2402
2402
|
});
|
|
2403
2403
|
} catch (n) {
|
|
2404
|
-
|
|
2404
|
+
I(`paste: "${n.message}".`);
|
|
2405
2405
|
}
|
|
2406
2406
|
}
|
|
2407
2407
|
keydown(t) {
|
|
@@ -2432,7 +2432,7 @@ class zt {
|
|
|
2432
2432
|
Object.entries(t).some(([e, s]) => this.#X[e] !== s) && (this._eventBus.dispatch("annotationeditorstateschanged", {
|
|
2433
2433
|
source: this,
|
|
2434
2434
|
details: Object.assign(this.#X, t)
|
|
2435
|
-
}), this.#C === F.HIGHLIGHT && t.hasSelectedEditor === !1 && this.#V([[
|
|
2435
|
+
}), this.#C === F.HIGHLIGHT && t.hasSelectedEditor === !1 && this.#V([[B.HIGHLIGHT_FREE, !0]]));
|
|
2436
2436
|
}
|
|
2437
2437
|
#V(t) {
|
|
2438
2438
|
this._eventBus.dispatch("annotationeditorparamschanged", {
|
|
@@ -2471,7 +2471,7 @@ class zt {
|
|
|
2471
2471
|
return this.#p;
|
|
2472
2472
|
}
|
|
2473
2473
|
addLayer(t) {
|
|
2474
|
-
this.#a.set(t.pageIndex, t), this.#
|
|
2474
|
+
this.#a.set(t.pageIndex, t), this.#P ? t.enable() : t.disable();
|
|
2475
2475
|
}
|
|
2476
2476
|
removeLayer(t) {
|
|
2477
2477
|
this.#a.delete(t.pageIndex);
|
|
@@ -2532,10 +2532,10 @@ class zt {
|
|
|
2532
2532
|
updateParams(t, e) {
|
|
2533
2533
|
if (this.#c) {
|
|
2534
2534
|
switch (t) {
|
|
2535
|
-
case
|
|
2535
|
+
case B.CREATE:
|
|
2536
2536
|
this.currentLayer.addNewEditor(e);
|
|
2537
2537
|
return;
|
|
2538
|
-
case
|
|
2538
|
+
case B.HIGHLIGHT_SHOW_ALL:
|
|
2539
2539
|
this._eventBus.dispatch("reporttelemetry", {
|
|
2540
2540
|
source: this,
|
|
2541
2541
|
details: {
|
|
@@ -2559,18 +2559,18 @@ class zt {
|
|
|
2559
2559
|
showAllEditors(t, e, s = !1) {
|
|
2560
2560
|
for (const i of this.#s.values())
|
|
2561
2561
|
i.editorType === t && i.show(e);
|
|
2562
|
-
(this.#q?.get(
|
|
2562
|
+
(this.#q?.get(B.HIGHLIGHT_SHOW_ALL) ?? !0) !== e && this.#V([[B.HIGHLIGHT_SHOW_ALL, e]]);
|
|
2563
2563
|
}
|
|
2564
2564
|
enableWaiting(t = !1) {
|
|
2565
|
-
if (this.#
|
|
2566
|
-
this.#
|
|
2565
|
+
if (this.#B !== t) {
|
|
2566
|
+
this.#B = t;
|
|
2567
2567
|
for (const e of this.#a.values())
|
|
2568
2568
|
t ? e.disableClick() : e.enableClick(), e.div.classList.toggle("waiting", t);
|
|
2569
2569
|
}
|
|
2570
2570
|
}
|
|
2571
2571
|
async #pt() {
|
|
2572
|
-
if (!this.#
|
|
2573
|
-
this.#
|
|
2572
|
+
if (!this.#P) {
|
|
2573
|
+
this.#P = !0;
|
|
2574
2574
|
const t = [];
|
|
2575
2575
|
for (const e of this.#a.values())
|
|
2576
2576
|
t.push(e.enable());
|
|
@@ -2580,8 +2580,8 @@ class zt {
|
|
|
2580
2580
|
}
|
|
2581
2581
|
}
|
|
2582
2582
|
#gt() {
|
|
2583
|
-
if (this.unselectAll(), this.#
|
|
2584
|
-
this.#
|
|
2583
|
+
if (this.unselectAll(), this.#P) {
|
|
2584
|
+
this.#P = !1;
|
|
2585
2585
|
for (const t of this.#a.values())
|
|
2586
2586
|
t.disable();
|
|
2587
2587
|
for (const t of this.#s.values())
|
|
@@ -2855,7 +2855,7 @@ class zt {
|
|
|
2855
2855
|
return this.#C !== F.NONE;
|
|
2856
2856
|
}
|
|
2857
2857
|
get imageManager() {
|
|
2858
|
-
return L(this, "imageManager", new
|
|
2858
|
+
return L(this, "imageManager", new Rs());
|
|
2859
2859
|
}
|
|
2860
2860
|
getSelectionBoxes(t) {
|
|
2861
2861
|
if (!t)
|
|
@@ -2945,7 +2945,7 @@ class zt {
|
|
|
2945
2945
|
(this.#F ||= /* @__PURE__ */ new Map()).set(t, e);
|
|
2946
2946
|
}
|
|
2947
2947
|
}
|
|
2948
|
-
class
|
|
2948
|
+
class Pt {
|
|
2949
2949
|
#t = null;
|
|
2950
2950
|
#e = !1;
|
|
2951
2951
|
#i = null;
|
|
@@ -2961,7 +2961,7 @@ class Mt {
|
|
|
2961
2961
|
static #p = null;
|
|
2962
2962
|
static _l10n = null;
|
|
2963
2963
|
constructor(t) {
|
|
2964
|
-
this.#l = t, this.#d = t._uiManager.useNewAltTextFlow,
|
|
2964
|
+
this.#l = t, this.#d = t._uiManager.useNewAltTextFlow, Pt.#p ||= Object.freeze({
|
|
2965
2965
|
added: "pdfjs-editor-new-alt-text-added-button",
|
|
2966
2966
|
"added-label": "pdfjs-editor-new-alt-text-added-button-label",
|
|
2967
2967
|
missing: "pdfjs-editor-new-alt-text-missing-button",
|
|
@@ -2971,13 +2971,13 @@ class Mt {
|
|
|
2971
2971
|
});
|
|
2972
2972
|
}
|
|
2973
2973
|
static initialize(t) {
|
|
2974
|
-
|
|
2974
|
+
Pt._l10n ??= t;
|
|
2975
2975
|
}
|
|
2976
2976
|
async render() {
|
|
2977
2977
|
const t = this.#i = document.createElement("button");
|
|
2978
2978
|
t.className = "altText", t.tabIndex = "0";
|
|
2979
2979
|
const e = this.#s = document.createElement("span");
|
|
2980
|
-
t.append(e), this.#d ? (t.classList.add("new"), t.setAttribute("data-l10n-id",
|
|
2980
|
+
t.append(e), this.#d ? (t.classList.add("new"), t.setAttribute("data-l10n-id", Pt.#p.missing), e.setAttribute("data-l10n-id", Pt.#p["missing-label"])) : (t.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-button"), e.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-button-label"));
|
|
2981
2981
|
const s = this.#l._uiManager._signal;
|
|
2982
2982
|
t.addEventListener("contextmenu", _t, {
|
|
2983
2983
|
signal: s
|
|
@@ -3019,7 +3019,7 @@ class Mt {
|
|
|
3019
3019
|
return this.#h;
|
|
3020
3020
|
}
|
|
3021
3021
|
async setGuessedText(t) {
|
|
3022
|
-
this.#t === null && (this.#h = t, this.#u = await
|
|
3022
|
+
this.#t === null && (this.#h = t, this.#u = await Pt._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer", {
|
|
3023
3023
|
generatedAltText: t
|
|
3024
3024
|
}), this.#f());
|
|
3025
3025
|
}
|
|
@@ -3077,7 +3077,7 @@ class Mt {
|
|
|
3077
3077
|
if (!t)
|
|
3078
3078
|
return;
|
|
3079
3079
|
if (this.#d) {
|
|
3080
|
-
if (t.classList.toggle("done", !!this.#t), t.setAttribute("data-l10n-id",
|
|
3080
|
+
if (t.classList.toggle("done", !!this.#t), t.setAttribute("data-l10n-id", Pt.#p[this.#m]), this.#s?.setAttribute("data-l10n-id", Pt.#p[`${this.#m}-label`]), !this.#t) {
|
|
3081
3081
|
this.#a?.remove();
|
|
3082
3082
|
return;
|
|
3083
3083
|
}
|
|
@@ -3446,7 +3446,7 @@ class D {
|
|
|
3446
3446
|
#v = !1;
|
|
3447
3447
|
#E = D._zIndex++;
|
|
3448
3448
|
static _borderLineWidth = -1;
|
|
3449
|
-
static _colorManager = new
|
|
3449
|
+
static _colorManager = new Is();
|
|
3450
3450
|
static _zIndex = 1;
|
|
3451
3451
|
static _telemetryTimeout = 1e3;
|
|
3452
3452
|
static get _resizerKeyboardManager() {
|
|
@@ -3497,7 +3497,7 @@ class D {
|
|
|
3497
3497
|
return L(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText"));
|
|
3498
3498
|
}
|
|
3499
3499
|
static deleteAnnotationElement(t) {
|
|
3500
|
-
const e = new
|
|
3500
|
+
const e = new Rn({
|
|
3501
3501
|
id: t.parent.getNextId(),
|
|
3502
3502
|
parent: t.parent,
|
|
3503
3503
|
uiManager: t._uiManager
|
|
@@ -3701,7 +3701,7 @@ class D {
|
|
|
3701
3701
|
const [h, l] = this.getBaseTranslation();
|
|
3702
3702
|
n += h, r += l, e.left = `${(100 * n).toFixed(2)}%`, e.top = `${(100 * r).toFixed(2)}%`, this.moveInDOM();
|
|
3703
3703
|
}
|
|
3704
|
-
static #
|
|
3704
|
+
static #P(t, e, s) {
|
|
3705
3705
|
switch (s) {
|
|
3706
3706
|
case 90:
|
|
3707
3707
|
return [e, -t];
|
|
@@ -3714,12 +3714,12 @@ class D {
|
|
|
3714
3714
|
}
|
|
3715
3715
|
}
|
|
3716
3716
|
screenToPageTranslation(t, e) {
|
|
3717
|
-
return D.#
|
|
3717
|
+
return D.#P(t, e, this.parentRotation);
|
|
3718
3718
|
}
|
|
3719
3719
|
pageTranslationToScreen(t, e) {
|
|
3720
|
-
return D.#
|
|
3720
|
+
return D.#P(t, e, 360 - this.parentRotation);
|
|
3721
3721
|
}
|
|
3722
|
-
#
|
|
3722
|
+
#M(t) {
|
|
3723
3723
|
switch (t) {
|
|
3724
3724
|
case 90: {
|
|
3725
3725
|
const [e, s] = this.pageDimensions;
|
|
@@ -3761,14 +3761,14 @@ class D {
|
|
|
3761
3761
|
getInitialTranslation() {
|
|
3762
3762
|
return [0, 0];
|
|
3763
3763
|
}
|
|
3764
|
-
#
|
|
3764
|
+
#B() {
|
|
3765
3765
|
if (this.#l)
|
|
3766
3766
|
return;
|
|
3767
3767
|
this.#l = document.createElement("div"), this.#l.classList.add("resizers");
|
|
3768
3768
|
const t = this._willKeepAspectRatio ? ["topLeft", "topRight", "bottomRight", "bottomLeft"] : ["topLeft", "topMiddle", "topRight", "middleRight", "bottomRight", "bottomMiddle", "bottomLeft", "middleLeft"], e = this._uiManager._signal;
|
|
3769
3769
|
for (const s of t) {
|
|
3770
3770
|
const i = document.createElement("div");
|
|
3771
|
-
this.#l.append(i), i.classList.add("resizer", s), i.setAttribute("data-resizer-name", s), i.addEventListener("pointerdown", this.#
|
|
3771
|
+
this.#l.append(i), i.classList.add("resizer", s), i.setAttribute("data-resizer-name", s), i.addEventListener("pointerdown", this.#R.bind(this, s), {
|
|
3772
3772
|
signal: e
|
|
3773
3773
|
}), i.addEventListener("contextmenu", _t, {
|
|
3774
3774
|
signal: e
|
|
@@ -3776,7 +3776,7 @@ class D {
|
|
|
3776
3776
|
}
|
|
3777
3777
|
this.div.prepend(this.#l);
|
|
3778
3778
|
}
|
|
3779
|
-
#
|
|
3779
|
+
#R(t, e) {
|
|
3780
3780
|
e.preventDefault();
|
|
3781
3781
|
const {
|
|
3782
3782
|
isMac: s
|
|
@@ -3805,7 +3805,7 @@ class D {
|
|
|
3805
3805
|
const a = this.parent.div.style.cursor, o = this.div.style.cursor;
|
|
3806
3806
|
this.div.style.cursor = this.parent.div.style.cursor = window.getComputedStyle(e.target).cursor;
|
|
3807
3807
|
const h = () => {
|
|
3808
|
-
n.abort(), this.parent.togglePointerEvents(!0), this.#i?.toggle(!0), this._isDraggable = i, this.parent.div.style.cursor = a, this.div.style.cursor = o, this.#
|
|
3808
|
+
n.abort(), this.parent.togglePointerEvents(!0), this.#i?.toggle(!0), this._isDraggable = i, this.parent.div.style.cursor = a, this.div.style.cursor = o, this.#O();
|
|
3809
3809
|
};
|
|
3810
3810
|
window.addEventListener("pointerup", h, {
|
|
3811
3811
|
signal: r
|
|
@@ -3818,7 +3818,7 @@ class D {
|
|
|
3818
3818
|
}
|
|
3819
3819
|
_onResized() {
|
|
3820
3820
|
}
|
|
3821
|
-
#
|
|
3821
|
+
#O() {
|
|
3822
3822
|
if (!this.#u)
|
|
3823
3823
|
return;
|
|
3824
3824
|
const {
|
|
@@ -3839,54 +3839,54 @@ class D {
|
|
|
3839
3839
|
return Math.round(t * 1e4) / 1e4;
|
|
3840
3840
|
}
|
|
3841
3841
|
#F(t, e) {
|
|
3842
|
-
const [s, i] = this.parentDimensions, n = this.x, r = this.y, a = this.width, o = this.height, h = D.MIN_SIZE / s, l = D.MIN_SIZE / i, c = this.#
|
|
3842
|
+
const [s, i] = this.parentDimensions, n = this.x, r = this.y, a = this.width, o = this.height, h = D.MIN_SIZE / s, l = D.MIN_SIZE / i, c = this.#M(this.rotation), u = (k, R) => [c[0] * k + c[2] * R, c[1] * k + c[3] * R], p = this.#M(360 - this.rotation), f = (k, R) => [p[0] * k + p[2] * R, p[1] * k + p[3] * R];
|
|
3843
3843
|
let g, b, m = !1, w = !1;
|
|
3844
3844
|
switch (t) {
|
|
3845
3845
|
case "topLeft":
|
|
3846
|
-
m = !0, g = (k,
|
|
3846
|
+
m = !0, g = (k, R) => [0, 0], b = (k, R) => [k, R];
|
|
3847
3847
|
break;
|
|
3848
3848
|
case "topMiddle":
|
|
3849
|
-
g = (k,
|
|
3849
|
+
g = (k, R) => [k / 2, 0], b = (k, R) => [k / 2, R];
|
|
3850
3850
|
break;
|
|
3851
3851
|
case "topRight":
|
|
3852
|
-
m = !0, g = (k,
|
|
3852
|
+
m = !0, g = (k, R) => [k, 0], b = (k, R) => [0, R];
|
|
3853
3853
|
break;
|
|
3854
3854
|
case "middleRight":
|
|
3855
|
-
w = !0, g = (k,
|
|
3855
|
+
w = !0, g = (k, R) => [k, R / 2], b = (k, R) => [0, R / 2];
|
|
3856
3856
|
break;
|
|
3857
3857
|
case "bottomRight":
|
|
3858
|
-
m = !0, g = (k,
|
|
3858
|
+
m = !0, g = (k, R) => [k, R], b = (k, R) => [0, 0];
|
|
3859
3859
|
break;
|
|
3860
3860
|
case "bottomMiddle":
|
|
3861
|
-
g = (k,
|
|
3861
|
+
g = (k, R) => [k / 2, R], b = (k, R) => [k / 2, 0];
|
|
3862
3862
|
break;
|
|
3863
3863
|
case "bottomLeft":
|
|
3864
|
-
m = !0, g = (k,
|
|
3864
|
+
m = !0, g = (k, R) => [0, R], b = (k, R) => [k, 0];
|
|
3865
3865
|
break;
|
|
3866
3866
|
case "middleLeft":
|
|
3867
|
-
w = !0, g = (k,
|
|
3867
|
+
w = !0, g = (k, R) => [0, R / 2], b = (k, R) => [k, R / 2];
|
|
3868
3868
|
break;
|
|
3869
3869
|
}
|
|
3870
3870
|
const y = g(a, o), v = b(a, o);
|
|
3871
3871
|
let A = u(...v);
|
|
3872
3872
|
const x = D._round(n + A[0]), _ = D._round(r + A[1]);
|
|
3873
|
-
let E = 1, S = 1,
|
|
3873
|
+
let E = 1, S = 1, M, C;
|
|
3874
3874
|
if (e.fromKeyboard)
|
|
3875
3875
|
({
|
|
3876
|
-
deltaX:
|
|
3876
|
+
deltaX: M,
|
|
3877
3877
|
deltaY: C
|
|
3878
3878
|
} = e);
|
|
3879
3879
|
else {
|
|
3880
3880
|
const {
|
|
3881
3881
|
screenX: k,
|
|
3882
|
-
screenY:
|
|
3882
|
+
screenY: R
|
|
3883
3883
|
} = e, [U, ft] = this.#h;
|
|
3884
|
-
[
|
|
3884
|
+
[M, C] = this.screenToPageTranslation(k - U, R - ft), this.#h[0] = k, this.#h[1] = R;
|
|
3885
3885
|
}
|
|
3886
|
-
if ([
|
|
3886
|
+
if ([M, C] = f(M / s, C / i), m) {
|
|
3887
3887
|
const k = Math.hypot(a, o);
|
|
3888
|
-
E = S = Math.max(Math.min(Math.hypot(v[0] - y[0] -
|
|
3889
|
-
} else w ? E = ut(Math.abs(v[0] - y[0] -
|
|
3888
|
+
E = S = Math.max(Math.min(Math.hypot(v[0] - y[0] - M, v[1] - y[1] - C) / k, 1 / a, 1 / o), h / a, l / o);
|
|
3889
|
+
} else w ? E = ut(Math.abs(v[0] - y[0] - M), h, 1) / a : S = ut(Math.abs(v[1] - y[1] - C), l, 1) / o;
|
|
3890
3890
|
const H = D._round(a * E), V = D._round(o * S);
|
|
3891
3891
|
A = u(...b(H, V));
|
|
3892
3892
|
const N = x - A[0], Z = _ - A[1];
|
|
@@ -3929,7 +3929,7 @@ class D {
|
|
|
3929
3929
|
return this.div.getBoundingClientRect();
|
|
3930
3930
|
}
|
|
3931
3931
|
createAltText() {
|
|
3932
|
-
return this.#i || (
|
|
3932
|
+
return this.#i || (Pt.initialize(D._l10n), this.#i = new Pt(this), this.#t && (this.#i.data = this.#t, this.#t = null)), this.#i;
|
|
3933
3933
|
}
|
|
3934
3934
|
get altTextData() {
|
|
3935
3935
|
return this.#i?.data;
|
|
@@ -4070,7 +4070,7 @@ class D {
|
|
|
4070
4070
|
let i = 0.7 * (s / e) + 1 - 0.7;
|
|
4071
4071
|
if (i === 1)
|
|
4072
4072
|
return;
|
|
4073
|
-
const n = this.#
|
|
4073
|
+
const n = this.#M(this.rotation), r = (A, x) => [n[0] * A + n[2] * x, n[1] * A + n[3] * x], [a, o] = this.parentDimensions, h = this.x, l = this.y, c = this.width, u = this.height, p = D.MIN_SIZE / a, f = D.MIN_SIZE / o;
|
|
4074
4074
|
i = Math.max(Math.min(i, 1 / c, 1 / u), p / c, f / u);
|
|
4075
4075
|
const g = D._round(c * i), b = D._round(u * i);
|
|
4076
4076
|
if (g === c && b === u)
|
|
@@ -4080,7 +4080,7 @@ class D {
|
|
|
4080
4080
|
this.x = w - v[0], this.y = y - v[1], this.width = g, this.height = b, this.setDims(), this.fixAndSetPosition(), this._onResizing();
|
|
4081
4081
|
}
|
|
4082
4082
|
#x() {
|
|
4083
|
-
this.#i?.toggle(!0), this.parent.togglePointerEvents(!0), this.#
|
|
4083
|
+
this.#i?.toggle(!0), this.parent.togglePointerEvents(!0), this.#O();
|
|
4084
4084
|
}
|
|
4085
4085
|
pointerdown(t) {
|
|
4086
4086
|
const {
|
|
@@ -4094,9 +4094,9 @@ class D {
|
|
|
4094
4094
|
this.#H(t);
|
|
4095
4095
|
return;
|
|
4096
4096
|
}
|
|
4097
|
-
this.#
|
|
4097
|
+
this.#I(t);
|
|
4098
4098
|
}
|
|
4099
|
-
#
|
|
4099
|
+
#I(t) {
|
|
4100
4100
|
const {
|
|
4101
4101
|
isMac: e
|
|
4102
4102
|
} = at.platform;
|
|
@@ -4113,7 +4113,7 @@ class D {
|
|
|
4113
4113
|
passive: !1,
|
|
4114
4114
|
signal: n
|
|
4115
4115
|
}, a = (h) => {
|
|
4116
|
-
i.abort(), this.#n = null, this.#f = !1, this._uiManager.endDragSession() || this.#
|
|
4116
|
+
i.abort(), this.#n = null, this.#f = !1, this._uiManager.endDragSession() || this.#I(h), s && this._onStopDragging();
|
|
4117
4117
|
};
|
|
4118
4118
|
e && (this.#S = t.clientX, this.#_ = t.clientY, this.#n = t.pointerId, this.#o = t.pointerType, window.addEventListener("pointermove", (h) => {
|
|
4119
4119
|
s || (s = !0, this._uiManager.toggleComment(this, !0, !1), this._onStartDragging());
|
|
@@ -4321,7 +4321,7 @@ class D {
|
|
|
4321
4321
|
return !1;
|
|
4322
4322
|
}
|
|
4323
4323
|
makeResizable() {
|
|
4324
|
-
this.isResizable && (this.#
|
|
4324
|
+
this.isResizable && (this.#B(), this.#l.classList.remove("hidden"));
|
|
4325
4325
|
}
|
|
4326
4326
|
get toolbarPosition() {
|
|
4327
4327
|
return null;
|
|
@@ -4427,7 +4427,7 @@ class D {
|
|
|
4427
4427
|
});
|
|
4428
4428
|
}
|
|
4429
4429
|
#N() {
|
|
4430
|
-
this.#w = !1, this.#U(-1), this.#
|
|
4430
|
+
this.#w = !1, this.#U(-1), this.#O();
|
|
4431
4431
|
}
|
|
4432
4432
|
_stopResizingWithKeyboard() {
|
|
4433
4433
|
this.#N(), this.div.focus();
|
|
@@ -4564,7 +4564,7 @@ class D {
|
|
|
4564
4564
|
e?.nodeName === "DIV" && e.classList.contains("annotationContent") && e.remove();
|
|
4565
4565
|
}
|
|
4566
4566
|
}
|
|
4567
|
-
class
|
|
4567
|
+
class Rn extends D {
|
|
4568
4568
|
constructor(t) {
|
|
4569
4569
|
super(t), this.annotationElementId = t.annotationElementId, this.deleted = !0;
|
|
4570
4570
|
}
|
|
@@ -4573,7 +4573,7 @@ class In extends D {
|
|
|
4573
4573
|
}
|
|
4574
4574
|
}
|
|
4575
4575
|
const Zs = 3285377520, vt = 4294901760, Ct = 65535;
|
|
4576
|
-
class
|
|
4576
|
+
class Pi {
|
|
4577
4577
|
constructor(t) {
|
|
4578
4578
|
this.h1 = t ? t & 4294967295 : Zs, this.h2 = t ? t & 4294967295 : Zs;
|
|
4579
4579
|
}
|
|
@@ -4661,12 +4661,12 @@ class Ls {
|
|
|
4661
4661
|
this.#t && (this.#t = !1, typeof this.onResetModified == "function" && this.onResetModified());
|
|
4662
4662
|
}
|
|
4663
4663
|
get print() {
|
|
4664
|
-
return new
|
|
4664
|
+
return new Mi(this);
|
|
4665
4665
|
}
|
|
4666
4666
|
get serializable() {
|
|
4667
4667
|
if (this.#s.size === 0)
|
|
4668
4668
|
return vs;
|
|
4669
|
-
const t = /* @__PURE__ */ new Map(), e = new
|
|
4669
|
+
const t = /* @__PURE__ */ new Map(), e = new Pi(), s = [], i = /* @__PURE__ */ Object.create(null);
|
|
4670
4670
|
let n = !1;
|
|
4671
4671
|
for (const [r, a] of this.#s) {
|
|
4672
4672
|
const o = a instanceof D ? a.serialize(!1, i) : a;
|
|
@@ -4743,7 +4743,7 @@ class Ls {
|
|
|
4743
4743
|
return this.#s.entries();
|
|
4744
4744
|
}
|
|
4745
4745
|
}
|
|
4746
|
-
class
|
|
4746
|
+
class Mi extends Ls {
|
|
4747
4747
|
#t;
|
|
4748
4748
|
constructor(t) {
|
|
4749
4749
|
super();
|
|
@@ -4773,7 +4773,7 @@ class Pi extends Ls {
|
|
|
4773
4773
|
});
|
|
4774
4774
|
}
|
|
4775
4775
|
}
|
|
4776
|
-
class
|
|
4776
|
+
class In {
|
|
4777
4777
|
#t = /* @__PURE__ */ new Set();
|
|
4778
4778
|
constructor({
|
|
4779
4779
|
ownerDocument: t = globalThis.document,
|
|
@@ -4803,7 +4803,7 @@ class Rn {
|
|
|
4803
4803
|
_inspectFont: s
|
|
4804
4804
|
}) {
|
|
4805
4805
|
if (!(!t || this.#t.has(t.loadedName))) {
|
|
4806
|
-
if (
|
|
4806
|
+
if (O(!e, "loadSystemFont shouldn't be called when `disableFontFace` is set."), this.isFontLoadingAPISupported) {
|
|
4807
4807
|
const {
|
|
4808
4808
|
loadedName: i,
|
|
4809
4809
|
src: n,
|
|
@@ -4813,7 +4813,7 @@ class Rn {
|
|
|
4813
4813
|
try {
|
|
4814
4814
|
await a.load(), this.#t.add(i), s?.(t);
|
|
4815
4815
|
} catch {
|
|
4816
|
-
|
|
4816
|
+
I(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`), this.removeNativeFontFace(a);
|
|
4817
4817
|
}
|
|
4818
4818
|
return;
|
|
4819
4819
|
}
|
|
@@ -4834,7 +4834,7 @@ class Rn {
|
|
|
4834
4834
|
try {
|
|
4835
4835
|
await s.loaded;
|
|
4836
4836
|
} catch (i) {
|
|
4837
|
-
throw
|
|
4837
|
+
throw I(`Failed to load font '${s.family}': '${i}'.`), t.disableFontFace = !0, i;
|
|
4838
4838
|
}
|
|
4839
4839
|
}
|
|
4840
4840
|
return;
|
|
@@ -4858,7 +4858,7 @@ class Rn {
|
|
|
4858
4858
|
}
|
|
4859
4859
|
_queueLoadingCallback(t) {
|
|
4860
4860
|
function e() {
|
|
4861
|
-
for (
|
|
4861
|
+
for (O(!i.done, "completeRequest() cannot be called twice."), i.done = !0; s.length > 0 && s[0].done; ) {
|
|
4862
4862
|
const n = s.shift();
|
|
4863
4863
|
setTimeout(n.callback, 0);
|
|
4864
4864
|
}
|
|
@@ -4891,7 +4891,7 @@ class Rn {
|
|
|
4891
4891
|
let h = 0;
|
|
4892
4892
|
function l(y, v) {
|
|
4893
4893
|
if (++h > 30) {
|
|
4894
|
-
|
|
4894
|
+
I("Load test font never loaded."), v();
|
|
4895
4895
|
return;
|
|
4896
4896
|
}
|
|
4897
4897
|
if (o.font = "30px " + y, o.fillText(".", 0, 20), o.getImageData(0, 0, 1, 1).data[3] > 0) {
|
|
@@ -4961,7 +4961,7 @@ class Ln {
|
|
|
4961
4961
|
try {
|
|
4962
4962
|
i = t.get(s);
|
|
4963
4963
|
} catch (r) {
|
|
4964
|
-
|
|
4964
|
+
I(`getPathGenerator - ignoring character: "${r}".`);
|
|
4965
4965
|
}
|
|
4966
4966
|
const n = Ci(i?.path);
|
|
4967
4967
|
return this.fontExtraProperties || t.delete(s), this.compiledGlyphs[e] = n;
|
|
@@ -5063,13 +5063,13 @@ class re {
|
|
|
5063
5063
|
const l = s[h], c = l.length;
|
|
5064
5064
|
a.setUint32(o, c), r.set(l, o + 4), o += 4 + c;
|
|
5065
5065
|
}
|
|
5066
|
-
return
|
|
5066
|
+
return O(o === n.byteLength, "CssFontInfo.write: Buffer overflow"), n;
|
|
5067
5067
|
}
|
|
5068
5068
|
constructor(t) {
|
|
5069
5069
|
this.#t = t, this.#e = new DataView(this.#t), this.#i = new TextDecoder();
|
|
5070
5070
|
}
|
|
5071
5071
|
#s(t) {
|
|
5072
|
-
|
|
5072
|
+
O(t < re.strings.length, "Invalid string index");
|
|
5073
5073
|
let e = 0;
|
|
5074
5074
|
for (let i = 0; i < t; i++)
|
|
5075
5075
|
e += this.#e.getUint32(e) + 4;
|
|
@@ -5108,7 +5108,7 @@ class ae {
|
|
|
5108
5108
|
const p = s[u], f = p.length;
|
|
5109
5109
|
i += 4 + f, l.setUint32(c, f), h.set(p, c + 4), c += 4 + f;
|
|
5110
5110
|
}
|
|
5111
|
-
return l.setUint32(c - i - 4, i), t.style && (l.setUint32(c, n.length), h.set(n, c + 4), c += 4 + n.length, l.setUint32(c, r.length), h.set(r, c + 4), c += 4 + r.length),
|
|
5111
|
+
return l.setUint32(c - i - 4, i), t.style && (l.setUint32(c, n.length), h.set(n, c + 4), c += 4 + n.length, l.setUint32(c, r.length), h.set(r, c + 4), c += 4 + r.length), O(c <= o.byteLength, "SubstitionInfo.write: Buffer overflow"), o.transferToFixedLength(c);
|
|
5112
5112
|
}
|
|
5113
5113
|
constructor(t) {
|
|
5114
5114
|
this.#t = t, this.#e = new DataView(this.#t), this.#i = new TextDecoder();
|
|
@@ -5117,7 +5117,7 @@ class ae {
|
|
|
5117
5117
|
return this.#e.getUint8(0) !== 0;
|
|
5118
5118
|
}
|
|
5119
5119
|
#s(t) {
|
|
5120
|
-
|
|
5120
|
+
O(t < ae.strings.length, "Invalid string index");
|
|
5121
5121
|
let e = 5;
|
|
5122
5122
|
for (let i = 0; i < t; i++)
|
|
5123
5123
|
e += this.#e.getUint32(e) + 4;
|
|
@@ -5167,7 +5167,7 @@ class G {
|
|
|
5167
5167
|
this.#r = t, this.#n = new TextDecoder(), this.#o = new DataView(this.#r), e && Object.assign(this, e);
|
|
5168
5168
|
}
|
|
5169
5169
|
#l(t) {
|
|
5170
|
-
|
|
5170
|
+
O(t < G.bools.length, "Invalid boolean index");
|
|
5171
5171
|
const e = Math.floor(t / 4), s = t * 2 % 8, i = this.#o.getUint8(e) >> s & 3;
|
|
5172
5172
|
return i === 0 ? void 0 : i === 2;
|
|
5173
5173
|
}
|
|
@@ -5202,7 +5202,7 @@ class G {
|
|
|
5202
5202
|
return this.#l(9);
|
|
5203
5203
|
}
|
|
5204
5204
|
#h(t) {
|
|
5205
|
-
return
|
|
5205
|
+
return O(t < G.numbers.length, "Invalid number index"), this.#o.getFloat64(G.#t + t * 8);
|
|
5206
5206
|
}
|
|
5207
5207
|
get ascent() {
|
|
5208
5208
|
return this.#h(0);
|
|
@@ -5244,7 +5244,7 @@ class G {
|
|
|
5244
5244
|
return e;
|
|
5245
5245
|
}
|
|
5246
5246
|
#u(t) {
|
|
5247
|
-
|
|
5247
|
+
O(t < G.strings.length, "Invalid string index");
|
|
5248
5248
|
let e = G.#a + 4;
|
|
5249
5249
|
for (let n = 0; n < t; n++)
|
|
5250
5250
|
e += this.#o.getUint32(e) + 4;
|
|
@@ -5321,28 +5321,28 @@ class G {
|
|
|
5321
5321
|
const b = t[G.bools[g]];
|
|
5322
5322
|
p |= (b === void 0 ? 0 : b ? 2 : 1) << f, f += 2, (f === 8 || g === u - 1) && (l.setUint8(c++, p), p = 0, f = 0);
|
|
5323
5323
|
}
|
|
5324
|
-
|
|
5324
|
+
O(c === G.#t, "FontInfo.write: Boolean properties offset mismatch");
|
|
5325
5325
|
for (const g of G.numbers)
|
|
5326
5326
|
l.setFloat64(c, t[g]), c += 8;
|
|
5327
|
-
if (
|
|
5327
|
+
if (O(c === G.#e, "FontInfo.write: Number properties offset mismatch"), t.bbox) {
|
|
5328
5328
|
l.setUint8(c++, 4);
|
|
5329
5329
|
for (const g of t.bbox)
|
|
5330
5330
|
l.setInt16(c, g, !0), c += 2;
|
|
5331
5331
|
} else
|
|
5332
5332
|
l.setUint8(c++, 0), c += 8;
|
|
5333
|
-
if (
|
|
5333
|
+
if (O(c === G.#i, "FontInfo.write: BBox properties offset mismatch"), t.fontMatrix) {
|
|
5334
5334
|
l.setUint8(c++, 6);
|
|
5335
5335
|
for (const g of t.fontMatrix)
|
|
5336
5336
|
l.setFloat64(c, g, !0), c += 8;
|
|
5337
5337
|
} else
|
|
5338
5338
|
l.setUint8(c++, 0), c += 48;
|
|
5339
|
-
if (
|
|
5339
|
+
if (O(c === G.#s, "FontInfo.write: FontMatrix properties offset mismatch"), t.defaultVMetrics) {
|
|
5340
5340
|
l.setUint8(c++, 1);
|
|
5341
5341
|
for (const g of t.defaultVMetrics)
|
|
5342
5342
|
l.setInt16(c, g, !0), c += 2;
|
|
5343
5343
|
} else
|
|
5344
5344
|
l.setUint8(c++, 0), c += 6;
|
|
5345
|
-
|
|
5345
|
+
O(c === G.#a, "FontInfo.write: DefaultVMetrics properties offset mismatch"), l.setUint32(G.#a, 0), c += 4;
|
|
5346
5346
|
for (const g of G.strings) {
|
|
5347
5347
|
const b = n[g], m = b.length;
|
|
5348
5348
|
l.setUint32(c, m), h.set(b, c + 4), c += 4 + m;
|
|
@@ -5351,15 +5351,15 @@ class G {
|
|
|
5351
5351
|
l.setUint32(c, 0), c += 4;
|
|
5352
5352
|
else {
|
|
5353
5353
|
const g = e.byteLength;
|
|
5354
|
-
l.setUint32(c, g),
|
|
5354
|
+
l.setUint32(c, g), O(c + 4 + g <= o.byteLength, "FontInfo.write: Buffer overflow at systemFontInfo"), h.set(new Uint8Array(e), c + 4), c += 4 + g;
|
|
5355
5355
|
}
|
|
5356
5356
|
if (!s)
|
|
5357
5357
|
l.setUint32(c, 0), c += 4;
|
|
5358
5358
|
else {
|
|
5359
5359
|
const g = s.byteLength;
|
|
5360
|
-
l.setUint32(c, g),
|
|
5360
|
+
l.setUint32(c, g), O(c + 4 + g <= o.byteLength, "FontInfo.write: Buffer overflow at cssFontInfo"), h.set(new Uint8Array(s), c + 4), c += 4 + g;
|
|
5361
5361
|
}
|
|
5362
|
-
return t.data === void 0 ? (l.setUint32(c, 0), c += 4) : (l.setUint32(c, t.data.length), h.set(t.data, c + 4), c += 4 + t.data.length),
|
|
5362
|
+
return t.data === void 0 ? (l.setUint32(c, 0), c += 4) : (l.setUint32(c, t.data.length), h.set(t.data, c + 4), c += 4 + t.data.length), O(c <= o.byteLength, "FontInfo.write: Buffer overflow"), o.transferToFixedLength(c);
|
|
5363
5363
|
}
|
|
5364
5364
|
}
|
|
5365
5365
|
class ot {
|
|
@@ -5492,7 +5492,7 @@ function Nn(d) {
|
|
|
5492
5492
|
}
|
|
5493
5493
|
throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");
|
|
5494
5494
|
}
|
|
5495
|
-
function
|
|
5495
|
+
function Bn(d) {
|
|
5496
5496
|
if (dt && typeof Buffer < "u" && d instanceof Buffer)
|
|
5497
5497
|
throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");
|
|
5498
5498
|
if (d instanceof Uint8Array && d.byteLength === d.buffer.byteLength)
|
|
@@ -5510,7 +5510,7 @@ function Fe(d) {
|
|
|
5510
5510
|
return d;
|
|
5511
5511
|
throw new Error(`Invalid factory url: "${d}" must include trailing slash.`);
|
|
5512
5512
|
}
|
|
5513
|
-
const As = (d) => typeof d == "object" && Number.isInteger(d?.num) && d.num >= 0 && Number.isInteger(d?.gen) && d.gen >= 0,
|
|
5513
|
+
const As = (d) => typeof d == "object" && Number.isInteger(d?.num) && d.num >= 0 && Number.isInteger(d?.gen) && d.gen >= 0, On = (d) => typeof d == "object" && typeof d?.name == "string", Hn = yn.bind(null, As, On);
|
|
5514
5514
|
class $n {
|
|
5515
5515
|
#t = /* @__PURE__ */ new Map();
|
|
5516
5516
|
#e = Promise.resolve();
|
|
@@ -5532,7 +5532,7 @@ class $n {
|
|
|
5532
5532
|
signal: n
|
|
5533
5533
|
} = s;
|
|
5534
5534
|
if (n.aborted) {
|
|
5535
|
-
|
|
5535
|
+
I("LoopbackPort - cannot use an `aborted` signal.");
|
|
5536
5536
|
return;
|
|
5537
5537
|
}
|
|
5538
5538
|
const r = () => this.removeEventListener(t, e);
|
|
@@ -5700,7 +5700,7 @@ class we {
|
|
|
5700
5700
|
}), l.promise;
|
|
5701
5701
|
},
|
|
5702
5702
|
cancel: (h) => {
|
|
5703
|
-
|
|
5703
|
+
O(h instanceof Error, "cancel must have a valid reason");
|
|
5704
5704
|
const l = Promise.withResolvers();
|
|
5705
5705
|
return this.streamControllers[n].cancelCall = l, this.streamControllers[n].isClosed = !0, o.postMessage({
|
|
5706
5706
|
sourceName: r,
|
|
@@ -5735,7 +5735,7 @@ class we {
|
|
|
5735
5735
|
}), delete r.streamSinks[e]);
|
|
5736
5736
|
},
|
|
5737
5737
|
error(h) {
|
|
5738
|
-
|
|
5738
|
+
O(h instanceof Error, "error must have a valid reason"), !this.isCancelled && (this.isCancelled = !0, n.postMessage({
|
|
5739
5739
|
sourceName: s,
|
|
5740
5740
|
targetName: i,
|
|
5741
5741
|
stream: st.ERROR,
|
|
@@ -5807,17 +5807,17 @@ class we {
|
|
|
5807
5807
|
});
|
|
5808
5808
|
break;
|
|
5809
5809
|
case st.ENQUEUE:
|
|
5810
|
-
if (
|
|
5810
|
+
if (O(r, "enqueue should have stream controller"), r.isClosed)
|
|
5811
5811
|
break;
|
|
5812
5812
|
r.controller.enqueue(t.chunk);
|
|
5813
5813
|
break;
|
|
5814
5814
|
case st.CLOSE:
|
|
5815
|
-
if (
|
|
5815
|
+
if (O(r, "close should have stream controller"), r.isClosed)
|
|
5816
5816
|
break;
|
|
5817
5817
|
r.isClosed = !0, r.controller.close(), this.#a(r, e);
|
|
5818
5818
|
break;
|
|
5819
5819
|
case st.ERROR:
|
|
5820
|
-
|
|
5820
|
+
O(r, "error should have stream controller"), r.controller.error(pt(t.reason)), this.#a(r, e);
|
|
5821
5821
|
break;
|
|
5822
5822
|
case st.CANCEL_COMPLETE:
|
|
5823
5823
|
t.success ? r.cancelCall.resolve() : r.cancelCall.reject(pt(t.reason)), this.#a(r, e);
|
|
@@ -5931,11 +5931,11 @@ class Di {
|
|
|
5931
5931
|
}
|
|
5932
5932
|
class ei extends Di {
|
|
5933
5933
|
async _fetch(t) {
|
|
5934
|
-
const e = await
|
|
5934
|
+
const e = await Pe(t, this.isCompressed ? "arraybuffer" : "text");
|
|
5935
5935
|
return e instanceof ArrayBuffer ? new Uint8Array(e) : Te(e);
|
|
5936
5936
|
}
|
|
5937
5937
|
}
|
|
5938
|
-
class
|
|
5938
|
+
class Ri {
|
|
5939
5939
|
addFilter(t) {
|
|
5940
5940
|
return "none";
|
|
5941
5941
|
}
|
|
@@ -5954,7 +5954,7 @@ class Ii {
|
|
|
5954
5954
|
destroy(t = !1) {
|
|
5955
5955
|
}
|
|
5956
5956
|
}
|
|
5957
|
-
class Un extends
|
|
5957
|
+
class Un extends Ri {
|
|
5958
5958
|
#t;
|
|
5959
5959
|
#e;
|
|
5960
5960
|
#i;
|
|
@@ -5980,8 +5980,8 @@ class Un extends Ii {
|
|
|
5980
5980
|
style: e
|
|
5981
5981
|
} = t;
|
|
5982
5982
|
e.visibility = "hidden", e.contain = "strict", e.width = e.height = 0, e.position = "absolute", e.top = e.left = 0, e.zIndex = -1;
|
|
5983
|
-
const s = this.#a.createElementNS(
|
|
5984
|
-
s.setAttribute("width", 0), s.setAttribute("height", 0), this.#i = this.#a.createElementNS(
|
|
5983
|
+
const s = this.#a.createElementNS(Rt, "svg");
|
|
5984
|
+
s.setAttribute("width", 0), s.setAttribute("height", 0), this.#i = this.#a.createElementNS(Rt, "defs"), t.append(s), s.append(this.#i), this.#a.body.append(t);
|
|
5985
5985
|
}
|
|
5986
5986
|
return this.#i;
|
|
5987
5987
|
}
|
|
@@ -6002,7 +6002,7 @@ class Un extends Ii {
|
|
|
6002
6002
|
if (this.#t === void 0) {
|
|
6003
6003
|
this.#t = "";
|
|
6004
6004
|
const e = this.#a.URL;
|
|
6005
|
-
e !== this.#a.baseURI && (Je(e) ?
|
|
6005
|
+
e !== this.#a.baseURI && (Je(e) ? I('#createUrl: ignore "data:"-URL for performance reasons.') : this.#t = vi(e, ""));
|
|
6006
6006
|
}
|
|
6007
6007
|
return `url(${this.#t}#${t})`;
|
|
6008
6008
|
}
|
|
@@ -6089,10 +6089,10 @@ class Un extends Ii {
|
|
|
6089
6089
|
const v = new Array(256), A = (c - l) / y, x = m / 255, _ = (w - m) / (255 * y);
|
|
6090
6090
|
let E = 0;
|
|
6091
6091
|
for (let S = 0; S <= y; S++) {
|
|
6092
|
-
const
|
|
6093
|
-
for (let H = E; H <=
|
|
6092
|
+
const M = Math.round(l + S * A), C = x + S * _;
|
|
6093
|
+
for (let H = E; H <= M; H++)
|
|
6094
6094
|
v[H] = C;
|
|
6095
|
-
E =
|
|
6095
|
+
E = M + 1;
|
|
6096
6096
|
}
|
|
6097
6097
|
for (let S = E; S < 256; S++)
|
|
6098
6098
|
v[S] = v[E - 1];
|
|
@@ -6104,34 +6104,34 @@ class Un extends Ii {
|
|
|
6104
6104
|
t && this.#r?.size || (this.#i?.parentNode.parentNode.remove(), this.#i = null, this.#e?.clear(), this.#e = null, this.#r?.clear(), this.#r = null, this.#n = 0);
|
|
6105
6105
|
}
|
|
6106
6106
|
#p(t) {
|
|
6107
|
-
const e = this.#a.createElementNS(
|
|
6107
|
+
const e = this.#a.createElementNS(Rt, "feColorMatrix");
|
|
6108
6108
|
e.setAttribute("type", "matrix"), e.setAttribute("values", "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"), t.append(e);
|
|
6109
6109
|
}
|
|
6110
6110
|
#m(t) {
|
|
6111
|
-
const e = this.#a.createElementNS(
|
|
6111
|
+
const e = this.#a.createElementNS(Rt, "feColorMatrix");
|
|
6112
6112
|
e.setAttribute("type", "matrix"), e.setAttribute("values", "0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"), t.append(e);
|
|
6113
6113
|
}
|
|
6114
6114
|
#f(t) {
|
|
6115
|
-
const e = this.#a.createElementNS(
|
|
6115
|
+
const e = this.#a.createElementNS(Rt, "filter");
|
|
6116
6116
|
return e.setAttribute("color-interpolation-filters", "sRGB"), e.setAttribute("id", t), this.#h.append(e), e;
|
|
6117
6117
|
}
|
|
6118
6118
|
#c(t, e, s) {
|
|
6119
|
-
const i = this.#a.createElementNS(
|
|
6119
|
+
const i = this.#a.createElementNS(Rt, e);
|
|
6120
6120
|
i.setAttribute("type", "discrete"), i.setAttribute("tableValues", s), t.append(i);
|
|
6121
6121
|
}
|
|
6122
6122
|
#g(t, e, s, i) {
|
|
6123
|
-
const n = this.#a.createElementNS(
|
|
6123
|
+
const n = this.#a.createElementNS(Rt, "feComponentTransfer");
|
|
6124
6124
|
i.append(n), this.#c(n, "feFuncR", t), this.#c(n, "feFuncG", e), this.#c(n, "feFuncB", s);
|
|
6125
6125
|
}
|
|
6126
6126
|
#b(t, e) {
|
|
6127
|
-
const s = this.#a.createElementNS(
|
|
6127
|
+
const s = this.#a.createElementNS(Rt, "feComponentTransfer");
|
|
6128
6128
|
e.append(s), this.#c(s, "feFuncA", t);
|
|
6129
6129
|
}
|
|
6130
6130
|
#w(t) {
|
|
6131
6131
|
return this.#h.style.color = t, ke(getComputedStyle(this.#h).getPropertyValue("color"));
|
|
6132
6132
|
}
|
|
6133
6133
|
}
|
|
6134
|
-
class
|
|
6134
|
+
class Ii {
|
|
6135
6135
|
constructor({
|
|
6136
6136
|
baseUrl: t = null
|
|
6137
6137
|
}) {
|
|
@@ -6153,9 +6153,9 @@ class Ri {
|
|
|
6153
6153
|
j("Abstract method `_fetch` called.");
|
|
6154
6154
|
}
|
|
6155
6155
|
}
|
|
6156
|
-
class si extends
|
|
6156
|
+
class si extends Ii {
|
|
6157
6157
|
async _fetch(t) {
|
|
6158
|
-
const e = await
|
|
6158
|
+
const e = await Pe(t, "arraybuffer");
|
|
6159
6159
|
return new Uint8Array(e);
|
|
6160
6160
|
}
|
|
6161
6161
|
}
|
|
@@ -6183,16 +6183,16 @@ class Li {
|
|
|
6183
6183
|
}
|
|
6184
6184
|
class ii extends Li {
|
|
6185
6185
|
async _fetch(t) {
|
|
6186
|
-
const e = await
|
|
6186
|
+
const e = await Pe(t, "arraybuffer");
|
|
6187
6187
|
return new Uint8Array(e);
|
|
6188
6188
|
}
|
|
6189
6189
|
}
|
|
6190
|
-
dt &&
|
|
6190
|
+
dt && I("Please use the `legacy` build in Node.js environments.");
|
|
6191
6191
|
async function Fs(d) {
|
|
6192
6192
|
const t = await process.getBuiltinModule("fs").promises.readFile(d);
|
|
6193
6193
|
return new Uint8Array(t);
|
|
6194
6194
|
}
|
|
6195
|
-
class Vn extends
|
|
6195
|
+
class Vn extends Ri {
|
|
6196
6196
|
}
|
|
6197
6197
|
class Gn extends ki {
|
|
6198
6198
|
_createCanvas(t, e) {
|
|
@@ -6204,7 +6204,7 @@ class jn extends Di {
|
|
|
6204
6204
|
return Fs(t);
|
|
6205
6205
|
}
|
|
6206
6206
|
}
|
|
6207
|
-
class Wn extends
|
|
6207
|
+
class Wn extends Ii {
|
|
6208
6208
|
async _fetch(t) {
|
|
6209
6209
|
return Fs(t);
|
|
6210
6210
|
}
|
|
@@ -6218,7 +6218,7 @@ const Kt = "__forcedDependency", {
|
|
|
6218
6218
|
floor: ni,
|
|
6219
6219
|
ceil: ri
|
|
6220
6220
|
} = Math;
|
|
6221
|
-
function
|
|
6221
|
+
function Be(d, t, e, s, i, n) {
|
|
6222
6222
|
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);
|
|
6223
6223
|
}
|
|
6224
6224
|
const xs = new Uint32Array(new Uint8Array([255, 255, 0, 0]).buffer)[0];
|
|
@@ -6247,7 +6247,7 @@ class Xn {
|
|
|
6247
6247
|
return (this.#e[t * 4 + 3] + 1) / 256;
|
|
6248
6248
|
}
|
|
6249
6249
|
}
|
|
6250
|
-
const
|
|
6250
|
+
const Oe = (d, t) => {
|
|
6251
6251
|
if (!d)
|
|
6252
6252
|
return;
|
|
6253
6253
|
let e = d.get(t);
|
|
@@ -6319,7 +6319,7 @@ class Yn {
|
|
|
6319
6319
|
return this;
|
|
6320
6320
|
this.#t = e, this.#e = Object.getPrototypeOf(this.#e), this.#n = Object.getPrototypeOf(this.#n);
|
|
6321
6321
|
const s = this.#s.pop();
|
|
6322
|
-
return s !== void 0 && (
|
|
6322
|
+
return s !== void 0 && (Oe(this.#g, t)?.dependencies.add(s), this.#c[t] = this.#c[s]), this;
|
|
6323
6323
|
}
|
|
6324
6324
|
recordOpenMarker(t) {
|
|
6325
6325
|
return this.#s.push(t), this;
|
|
@@ -6329,14 +6329,14 @@ class Yn {
|
|
|
6329
6329
|
}
|
|
6330
6330
|
recordCloseMarker(t) {
|
|
6331
6331
|
const e = this.#s.pop();
|
|
6332
|
-
return e !== void 0 && (
|
|
6332
|
+
return e !== void 0 && (Oe(this.#g, t)?.dependencies.add(e), this.#c[t] = this.#c[e]), this;
|
|
6333
6333
|
}
|
|
6334
6334
|
beginMarkedContent(t) {
|
|
6335
6335
|
return this.#a.push(t), this;
|
|
6336
6336
|
}
|
|
6337
6337
|
endMarkedContent(t) {
|
|
6338
6338
|
const e = this.#a.pop();
|
|
6339
|
-
return e !== void 0 && (
|
|
6339
|
+
return e !== void 0 && (Oe(this.#g, t)?.dependencies.add(e), this.#c[t] = this.#c[e]), this;
|
|
6340
6340
|
}
|
|
6341
6341
|
pushBaseTransform(t) {
|
|
6342
6342
|
return this.#r.push(T.multiplyByDOMMatrix(this.#r.at(-1), t.getTransform())), this;
|
|
@@ -6418,20 +6418,20 @@ class Yn {
|
|
|
6418
6418
|
}
|
|
6419
6419
|
recordOperation(t, e = !1) {
|
|
6420
6420
|
if (this.recordDependencies(t, [Kt]), this.#g) {
|
|
6421
|
-
const s =
|
|
6421
|
+
const s = Oe(this.#g, t), {
|
|
6422
6422
|
dependencies: i
|
|
6423
6423
|
} = s;
|
|
6424
6424
|
this.#h.forEach(i.add, i), this.#s.forEach(i.add, i), this.#a.forEach(i.add, i), i.delete(t), s.isRenderingOperation = !0;
|
|
6425
6425
|
}
|
|
6426
6426
|
if (this.#l === t) {
|
|
6427
6427
|
const s = ni(this.#o[0] * 256 / this.#p), i = ni(this.#o[1] * 256 / this.#m), n = ri(this.#o[2] * 256 / this.#p), r = ri(this.#o[3] * 256 / this.#m);
|
|
6428
|
-
|
|
6428
|
+
Be(this.#f, t, s, i, n, r);
|
|
6429
6429
|
for (const a of this.#h)
|
|
6430
|
-
a !== t &&
|
|
6430
|
+
a !== t && Be(this.#f, a, s, i, n, r);
|
|
6431
6431
|
for (const a of this.#s)
|
|
6432
|
-
a !== t &&
|
|
6432
|
+
a !== t && Be(this.#f, a, s, i, n, r);
|
|
6433
6433
|
for (const a of this.#a)
|
|
6434
|
-
a !== t &&
|
|
6434
|
+
a !== t && Be(this.#f, a, s, i, n, r);
|
|
6435
6435
|
e || (this.#h.clear(), this.#l = -1);
|
|
6436
6436
|
}
|
|
6437
6437
|
return this;
|
|
@@ -6653,22 +6653,22 @@ function hs(d, t, e, s, i, n, r, a) {
|
|
|
6653
6653
|
const p = (o[e] + t.offsetX) * t.scaleX, f = (o[e + 1] + t.offsetY) * t.scaleY, g = (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;
|
|
6654
6654
|
if (f >= w)
|
|
6655
6655
|
return;
|
|
6656
|
-
const y = h[n], v = h[n + 1], A = h[n + 2], x = h[r], _ = h[r + 1], E = h[r + 2], S = h[a],
|
|
6657
|
-
let N, Z, k,
|
|
6656
|
+
const y = h[n], v = h[n + 1], A = h[n + 2], x = h[r], _ = h[r + 1], E = h[r + 2], S = h[a], M = h[a + 1], C = h[a + 2], H = Math.round(f), V = Math.round(w);
|
|
6657
|
+
let N, Z, k, R, U, ft, Dt, tt;
|
|
6658
6658
|
for (let W = H; W <= V; W++) {
|
|
6659
6659
|
if (W < b) {
|
|
6660
6660
|
const et = W < f ? 0 : (f - W) / (f - b);
|
|
6661
|
-
N = p - (p - g) * et, Z = y - (y - x) * et, k = v - (v - _) * et,
|
|
6661
|
+
N = p - (p - g) * et, Z = y - (y - x) * et, k = v - (v - _) * et, R = A - (A - E) * et;
|
|
6662
6662
|
} else {
|
|
6663
6663
|
let et;
|
|
6664
|
-
W > w ? et = 1 : b === w ? et = 0 : et = (b - W) / (b - w), N = g - (g - m) * et, Z = x - (x - S) * et, k = _ - (_ -
|
|
6664
|
+
W > w ? et = 1 : b === w ? et = 0 : et = (b - W) / (b - w), N = g - (g - m) * et, Z = x - (x - S) * et, k = _ - (_ - M) * et, R = E - (E - C) * et;
|
|
6665
6665
|
}
|
|
6666
6666
|
let q;
|
|
6667
|
-
W < f ? q = 0 : W > w ? q = 1 : q = (f - W) / (f - w), U = p - (p - m) * q, ft = y - (y - S) * q, Dt = v - (v -
|
|
6667
|
+
W < f ? q = 0 : W > w ? q = 1 : q = (f - W) / (f - w), U = p - (p - m) * q, ft = y - (y - S) * q, Dt = v - (v - M) * q, tt = A - (A - C) * q;
|
|
6668
6668
|
const Ut = Math.round(Math.min(N, U)), Nt = Math.round(Math.max(N, U));
|
|
6669
|
-
let
|
|
6669
|
+
let Bt = c * W + Ut * 4;
|
|
6670
6670
|
for (let et = Ut; et <= Nt; et++)
|
|
6671
|
-
q = (N - et) / (N - U), q < 0 ? q = 0 : q > 1 && (q = 1), l[
|
|
6671
|
+
q = (N - et) / (N - U), q < 0 ? q = 0 : q > 1 && (q = 1), l[Bt++] = Z - (Z - ft) * q | 0, l[Bt++] = k - (k - Dt) * q | 0, l[Bt++] = R - (R - tt) * q | 0, l[Bt++] = 255;
|
|
6672
6672
|
}
|
|
6673
6673
|
}
|
|
6674
6674
|
function Qn(d, t, e) {
|
|
@@ -6757,7 +6757,7 @@ const ai = {
|
|
|
6757
6757
|
COLORED: 1,
|
|
6758
6758
|
UNCOLORED: 2
|
|
6759
6759
|
};
|
|
6760
|
-
class
|
|
6760
|
+
class Bs {
|
|
6761
6761
|
static MAX_PATTERN_SIZE = 3e3;
|
|
6762
6762
|
constructor(t, e, s, i) {
|
|
6763
6763
|
this.color = t[1], this.operatorList = t[2], this.matrix = t[3], this.bbox = t[4], this.xstep = t[5], this.ystep = t[6], this.paintType = t[7], this.tilingType = t[8], this.ctx = e, this.canvasGraphicsFactory = s, this.baseTransform = i;
|
|
@@ -6782,14 +6782,14 @@ class Os {
|
|
|
6782
6782
|
T.singularValueDecompose2dScale(this.baseTransform, m);
|
|
6783
6783
|
const v = w * m[0], A = y * m[1];
|
|
6784
6784
|
let x = g, _ = b, E = !1, S = !1;
|
|
6785
|
-
const
|
|
6786
|
-
|
|
6787
|
-
const N = this.getSizeAndScale(x, this.ctx.canvas.width, v), Z = this.getSizeAndScale(_, this.ctx.canvas.height, A), k = t.cachedCanvases.getCanvas("pattern", N.size, Z.size),
|
|
6788
|
-
if (U.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(U, n, a),
|
|
6785
|
+
const M = Math.ceil(h * v), C = Math.ceil(l * A), H = Math.ceil(g * v), V = Math.ceil(b * A);
|
|
6786
|
+
M >= H ? x = h : E = !0, C >= V ? _ = l : S = !0;
|
|
6787
|
+
const N = this.getSizeAndScale(x, this.ctx.canvas.width, v), Z = this.getSizeAndScale(_, this.ctx.canvas.height, A), k = t.cachedCanvases.getCanvas("pattern", N.size, Z.size), R = k.context, U = o.createCanvasGraphics(R, e);
|
|
6788
|
+
if (U.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(U, n, a), R.translate(-N.scale * c, -Z.scale * u), U.transform(0, N.scale, 0, 0, Z.scale, 0, 0), R.save(), U.dependencyTracker?.save(), this.clipBbox(U, c, u, p, f), U.baseTransform = X(U.ctx), U.executeOperatorList(i), U.endDrawing(), U.dependencyTracker?.restore(), R.restore(), E || S) {
|
|
6789
6789
|
const ft = k.canvas;
|
|
6790
6790
|
E && (x = h), S && (_ = l);
|
|
6791
|
-
const Dt = this.getSizeAndScale(x, this.ctx.canvas.width, v), tt = this.getSizeAndScale(_, this.ctx.canvas.height, A), W = Dt.size, q = tt.size, Ut = t.cachedCanvases.getCanvas("pattern-workaround", W, q), Nt = Ut.context,
|
|
6792
|
-
for (let ce = 0; ce <=
|
|
6791
|
+
const Dt = this.getSizeAndScale(x, this.ctx.canvas.width, v), tt = this.getSizeAndScale(_, this.ctx.canvas.height, A), W = Dt.size, q = tt.size, Ut = t.cachedCanvases.getCanvas("pattern-workaround", W, q), Nt = Ut.context, Bt = E ? Math.floor(g / h) : 0, et = S ? Math.floor(b / l) : 0;
|
|
6792
|
+
for (let ce = 0; ce <= Bt; ce++)
|
|
6793
6793
|
for (let de = 0; de <= et; de++)
|
|
6794
6794
|
Nt.drawImage(ft, W * ce, q * de, W, q, 0, 0, W, q);
|
|
6795
6795
|
return {
|
|
@@ -6809,7 +6809,7 @@ class Os {
|
|
|
6809
6809
|
};
|
|
6810
6810
|
}
|
|
6811
6811
|
getSizeAndScale(t, e, s) {
|
|
6812
|
-
const i = Math.max(
|
|
6812
|
+
const i = Math.max(Bs.MAX_PATTERN_SIZE, e);
|
|
6813
6813
|
let n = Math.ceil(t * s);
|
|
6814
6814
|
return n >= i ? n = i : s = n / t, {
|
|
6815
6815
|
scale: s,
|
|
@@ -7020,11 +7020,11 @@ function di(d, t) {
|
|
|
7020
7020
|
const x = b - o;
|
|
7021
7021
|
let _ = 0;
|
|
7022
7022
|
const E = x > y ? s : x * 8 - 7, S = E & -8;
|
|
7023
|
-
let
|
|
7023
|
+
let M = 0, C = 0;
|
|
7024
7024
|
for (; _ < S; _ += 8)
|
|
7025
7025
|
C = l[o++], m[h++] = C & 128 ? v : A, m[h++] = C & 64 ? v : A, m[h++] = C & 32 ? v : A, m[h++] = C & 16 ? v : A, m[h++] = C & 8 ? v : A, m[h++] = C & 4 ? v : A, m[h++] = C & 2 ? v : A, m[h++] = C & 1 ? v : A;
|
|
7026
7026
|
for (; _ < E; _++)
|
|
7027
|
-
|
|
7027
|
+
M === 0 && (C = l[o++], M = 128), m[h++] = C & M ? v : A, M >>= 1;
|
|
7028
7028
|
}
|
|
7029
7029
|
for (; h < w; )
|
|
7030
7030
|
m[h++] = 0;
|
|
@@ -7184,8 +7184,8 @@ class oe {
|
|
|
7184
7184
|
} = e, r = this.current.fillColor, a = this.current.patternFill, o = X(s);
|
|
7185
7185
|
let h, l, c, u;
|
|
7186
7186
|
if ((e.bitmap || e.data) && e.count > 1) {
|
|
7187
|
-
const
|
|
7188
|
-
l = JSON.stringify(a ? o : [o.slice(0, 4), r]), h = this._cachedBitmapsMap.get(
|
|
7187
|
+
const M = e.bitmap || e.data.buffer;
|
|
7188
|
+
l = JSON.stringify(a ? o : [o.slice(0, 4), r]), h = this._cachedBitmapsMap.get(M), h || (h = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(M, h));
|
|
7189
7189
|
const C = h.get(l);
|
|
7190
7190
|
if (C && !a) {
|
|
7191
7191
|
const H = Math.round(Math.min(o[0], o[2]) + o[4]), V = Math.round(Math.min(o[1], o[3]) + o[5]);
|
|
@@ -7452,7 +7452,7 @@ class oe {
|
|
|
7452
7452
|
const i = this.commonObjs.get(e), n = this.current;
|
|
7453
7453
|
if (!i)
|
|
7454
7454
|
throw new Error(`Can't find font for ${e}`);
|
|
7455
|
-
if (n.fontMatrix = i.fontMatrix || gs, (n.fontMatrix[0] === 0 || n.fontMatrix[3] === 0) &&
|
|
7455
|
+
if (n.fontMatrix = i.fontMatrix || gs, (n.fontMatrix[0] === 0 || n.fontMatrix[3] === 0) && I("Invalid font matrix for font " + e), s < 0 ? (s = -s, n.fontDirection = -1) : n.fontDirection = 1, this.current.font = i, this.current.fontSize = s, i.isType3Font)
|
|
7456
7456
|
return;
|
|
7457
7457
|
const r = i.loadedName || "sans-serif", a = i.systemFontInfo?.css || `"${r}", ${i.fallbackName}`;
|
|
7458
7458
|
let o = "normal";
|
|
@@ -7578,21 +7578,21 @@ class oe {
|
|
|
7578
7578
|
s.x += H * b * c, r.restore(), this.compose();
|
|
7579
7579
|
return;
|
|
7580
7580
|
}
|
|
7581
|
-
let S = 0,
|
|
7582
|
-
for (
|
|
7583
|
-
const C = e[
|
|
7581
|
+
let S = 0, M;
|
|
7582
|
+
for (M = 0; M < u; ++M) {
|
|
7583
|
+
const C = e[M];
|
|
7584
7584
|
if (typeof C == "number") {
|
|
7585
7585
|
S += f * C * n / 1e3;
|
|
7586
7586
|
continue;
|
|
7587
7587
|
}
|
|
7588
7588
|
let H = !1;
|
|
7589
7589
|
const V = (C.isSpace ? h : 0) + o, N = C.fontChar, Z = C.accent;
|
|
7590
|
-
let k,
|
|
7590
|
+
let k, R, U = C.width;
|
|
7591
7591
|
if (p) {
|
|
7592
7592
|
const tt = C.vmetric || g, W = -(C.vmetric ? tt[1] : U * 0.5) * b, q = tt[2] * b;
|
|
7593
|
-
U = tt ? -tt[0] : U, k = W / a,
|
|
7593
|
+
U = tt ? -tt[0] : U, k = W / a, R = (S + q) / a;
|
|
7594
7594
|
} else
|
|
7595
|
-
k = S / a,
|
|
7595
|
+
k = S / a, R = 0;
|
|
7596
7596
|
let ft;
|
|
7597
7597
|
if (i.remeasure && U > 0) {
|
|
7598
7598
|
ft = r.measureText(N);
|
|
@@ -7604,11 +7604,11 @@ class oe {
|
|
|
7604
7604
|
}
|
|
7605
7605
|
if (this.contentVisible && (C.isInFont || i.missingFile)) {
|
|
7606
7606
|
if (m && !Z)
|
|
7607
|
-
r.fillText(N, k,
|
|
7607
|
+
r.fillText(N, k, R), this.dependencyTracker?.recordCharacterBBox(t, r, ft ? {
|
|
7608
7608
|
bbox: null
|
|
7609
|
-
} : i, n / a, k,
|
|
7610
|
-
else if (this.paintChar(t, N, k,
|
|
7611
|
-
const tt = k + n * Z.offset.x / a, W =
|
|
7609
|
+
} : i, n / a, k, R, () => ft ?? r.measureText(N));
|
|
7610
|
+
else if (this.paintChar(t, N, k, R, w, y), Z) {
|
|
7611
|
+
const tt = k + n * Z.offset.x / a, W = R - n * Z.offset.y / a;
|
|
7612
7612
|
this.paintChar(t, Z.fontChar, tt, W, w, y);
|
|
7613
7613
|
}
|
|
7614
7614
|
}
|
|
@@ -7630,7 +7630,7 @@ class oe {
|
|
|
7630
7630
|
continue;
|
|
7631
7631
|
}
|
|
7632
7632
|
const v = (b.isSpace ? l : 0) + h, A = n.charProcOperatorList[b.operatorListId];
|
|
7633
|
-
A ? this.contentVisible && (this.save(), s.scale(r, r), s.transform(...u), this.executeOperatorList(A), this.restore()) :
|
|
7633
|
+
A ? this.contentVisible && (this.save(), s.scale(r, r), s.transform(...u), this.executeOperatorList(A), this.restore()) : I(`Type3 character "${b.operatorListId}" is not available.`);
|
|
7634
7634
|
const x = [b.width, 0];
|
|
7635
7635
|
T.applyTransform(x, u), m = x[0] * r + v, s.translate(m, 0), i.x += m * c;
|
|
7636
7636
|
}
|
|
@@ -7651,7 +7651,7 @@ class oe {
|
|
|
7651
7651
|
markedContentStack: this.markedContentStack
|
|
7652
7652
|
}, void 0, void 0, this.dependencyTracker ? new We(this.dependencyTracker, a, !0) : null)
|
|
7653
7653
|
};
|
|
7654
|
-
s = new
|
|
7654
|
+
s = new Bs(e, this.ctx, n, i);
|
|
7655
7655
|
} else
|
|
7656
7656
|
s = this._getPattern(t, e[1], e[2]);
|
|
7657
7657
|
return s;
|
|
@@ -7719,7 +7719,7 @@ class oe {
|
|
|
7719
7719
|
return;
|
|
7720
7720
|
this.save(t), this.inSMaskMode && (this.endSMaskMode(), this.current.activeSMask = null);
|
|
7721
7721
|
const s = this.ctx;
|
|
7722
|
-
e.isolated || Qe("TODO: Support non-isolated groups."), e.knockout &&
|
|
7722
|
+
e.isolated || Qe("TODO: Support non-isolated groups."), e.knockout && I("Knockout groups not supported.");
|
|
7723
7723
|
const i = X(s);
|
|
7724
7724
|
if (e.matrix && s.transform(...e.matrix), !e.bbox)
|
|
7725
7725
|
throw new Error("Bounding box is required.");
|
|
@@ -7837,7 +7837,7 @@ class oe {
|
|
|
7837
7837
|
return;
|
|
7838
7838
|
const s = this.getObject(t, e);
|
|
7839
7839
|
if (!s) {
|
|
7840
|
-
|
|
7840
|
+
I("Dependent image isn't ready yet");
|
|
7841
7841
|
return;
|
|
7842
7842
|
}
|
|
7843
7843
|
this.paintInlineImageXObject(t, s);
|
|
@@ -7847,7 +7847,7 @@ class oe {
|
|
|
7847
7847
|
return;
|
|
7848
7848
|
const r = this.getObject(t, e);
|
|
7849
7849
|
if (!r) {
|
|
7850
|
-
|
|
7850
|
+
I("Dependent image isn't ready yet");
|
|
7851
7851
|
return;
|
|
7852
7852
|
}
|
|
7853
7853
|
const a = r.width, o = r.height, h = [];
|
|
@@ -8124,7 +8124,7 @@ class cr {
|
|
|
8124
8124
|
else if (this.#e.has(n))
|
|
8125
8125
|
r = this.#e.get(n).visible;
|
|
8126
8126
|
else
|
|
8127
|
-
return
|
|
8127
|
+
return I(`Optional content group not found: ${n}`), !0;
|
|
8128
8128
|
switch (s) {
|
|
8129
8129
|
case "And":
|
|
8130
8130
|
if (!r)
|
|
@@ -8148,14 +8148,14 @@ class cr {
|
|
|
8148
8148
|
if (!t)
|
|
8149
8149
|
return Qe("Optional content group not defined."), !0;
|
|
8150
8150
|
if (t.type === "OCG")
|
|
8151
|
-
return this.#e.has(t.id) ? this.#e.get(t.id).visible : (
|
|
8151
|
+
return this.#e.has(t.id) ? this.#e.get(t.id).visible : (I(`Optional content group not found: ${t.id}`), !0);
|
|
8152
8152
|
if (t.type === "OCMD") {
|
|
8153
8153
|
if (t.expression)
|
|
8154
8154
|
return this.#a(t.expression);
|
|
8155
8155
|
if (!t.policy || t.policy === "AnyOn") {
|
|
8156
8156
|
for (const e of t.ids) {
|
|
8157
8157
|
if (!this.#e.has(e))
|
|
8158
|
-
return
|
|
8158
|
+
return I(`Optional content group not found: ${e}`), !0;
|
|
8159
8159
|
if (this.#e.get(e).visible)
|
|
8160
8160
|
return !0;
|
|
8161
8161
|
}
|
|
@@ -8163,7 +8163,7 @@ class cr {
|
|
|
8163
8163
|
} else if (t.policy === "AllOn") {
|
|
8164
8164
|
for (const e of t.ids) {
|
|
8165
8165
|
if (!this.#e.has(e))
|
|
8166
|
-
return
|
|
8166
|
+
return I(`Optional content group not found: ${e}`), !0;
|
|
8167
8167
|
if (!this.#e.get(e).visible)
|
|
8168
8168
|
return !1;
|
|
8169
8169
|
}
|
|
@@ -8171,7 +8171,7 @@ class cr {
|
|
|
8171
8171
|
} else if (t.policy === "AnyOff") {
|
|
8172
8172
|
for (const e of t.ids) {
|
|
8173
8173
|
if (!this.#e.has(e))
|
|
8174
|
-
return
|
|
8174
|
+
return I(`Optional content group not found: ${e}`), !0;
|
|
8175
8175
|
if (!this.#e.get(e).visible)
|
|
8176
8176
|
return !0;
|
|
8177
8177
|
}
|
|
@@ -8179,20 +8179,20 @@ class cr {
|
|
|
8179
8179
|
} else if (t.policy === "AllOff") {
|
|
8180
8180
|
for (const e of t.ids) {
|
|
8181
8181
|
if (!this.#e.has(e))
|
|
8182
|
-
return
|
|
8182
|
+
return I(`Optional content group not found: ${e}`), !0;
|
|
8183
8183
|
if (this.#e.get(e).visible)
|
|
8184
8184
|
return !1;
|
|
8185
8185
|
}
|
|
8186
8186
|
return !0;
|
|
8187
8187
|
}
|
|
8188
|
-
return
|
|
8188
|
+
return I(`Unknown optional content policy ${t.policy}.`), !0;
|
|
8189
8189
|
}
|
|
8190
|
-
return
|
|
8190
|
+
return I(`Unknown group type ${t.type}.`), !0;
|
|
8191
8191
|
}
|
|
8192
8192
|
setVisibility(t, e = !0, s = !0) {
|
|
8193
8193
|
const i = this.#e.get(t);
|
|
8194
8194
|
if (!i) {
|
|
8195
|
-
|
|
8195
|
+
I(`Optional content group not found: ${t}`);
|
|
8196
8196
|
return;
|
|
8197
8197
|
}
|
|
8198
8198
|
if (s && e && i.rbGroups.length)
|
|
@@ -8242,7 +8242,7 @@ class cr {
|
|
|
8242
8242
|
getHash() {
|
|
8243
8243
|
if (this.#t !== null)
|
|
8244
8244
|
return this.#t;
|
|
8245
|
-
const t = new
|
|
8245
|
+
const t = new Pi();
|
|
8246
8246
|
for (const [e, s] of this.#e)
|
|
8247
8247
|
t.update(`${e}:${s.visible}`);
|
|
8248
8248
|
return this.#t = t.hexdigest();
|
|
@@ -8256,7 +8256,7 @@ class dr {
|
|
|
8256
8256
|
disableRange: e = !1,
|
|
8257
8257
|
disableStream: s = !1
|
|
8258
8258
|
}) {
|
|
8259
|
-
|
|
8259
|
+
O(t, 'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');
|
|
8260
8260
|
const {
|
|
8261
8261
|
length: i,
|
|
8262
8262
|
initialData: n,
|
|
@@ -8296,7 +8296,7 @@ class dr {
|
|
|
8296
8296
|
const i = this._rangeReaders.some(function(n) {
|
|
8297
8297
|
return n._begin !== t ? !1 : (n._enqueue(s), !0);
|
|
8298
8298
|
});
|
|
8299
|
-
|
|
8299
|
+
O(i, "_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.");
|
|
8300
8300
|
}
|
|
8301
8301
|
}
|
|
8302
8302
|
get _progressiveDataLength() {
|
|
@@ -8318,7 +8318,7 @@ class dr {
|
|
|
8318
8318
|
e >= 0 && this._rangeReaders.splice(e, 1);
|
|
8319
8319
|
}
|
|
8320
8320
|
getFullReader() {
|
|
8321
|
-
|
|
8321
|
+
O(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once.");
|
|
8322
8322
|
const t = this._queuedChunks;
|
|
8323
8323
|
return this._queuedChunks = null, new ur(this, t, this._progressiveDone, this._contentDispositionFilename);
|
|
8324
8324
|
}
|
|
@@ -8556,7 +8556,7 @@ function Ni({
|
|
|
8556
8556
|
}, n = parseInt(d.get("Content-Length"), 10);
|
|
8557
8557
|
return !Number.isInteger(n) || (i.suggestedLength = n, n <= 2 * e) || s || !t || d.get("Accept-Ranges") !== "bytes" || (d.get("Content-Encoding") || "identity") !== "identity" || (i.allowRangeRequests = !0), i;
|
|
8558
8558
|
}
|
|
8559
|
-
function
|
|
8559
|
+
function Bi(d) {
|
|
8560
8560
|
const t = d.get("Content-Disposition");
|
|
8561
8561
|
if (t) {
|
|
8562
8562
|
let e = gr(t);
|
|
@@ -8570,10 +8570,10 @@ function Oi(d) {
|
|
|
8570
8570
|
}
|
|
8571
8571
|
return null;
|
|
8572
8572
|
}
|
|
8573
|
-
function
|
|
8573
|
+
function Re(d, t) {
|
|
8574
8574
|
return new je(`Unexpected server response (${d}) while retrieving PDF "${t}".`, d, d === 404 || d === 0 && t.startsWith("file:"));
|
|
8575
8575
|
}
|
|
8576
|
-
function
|
|
8576
|
+
function Oi(d) {
|
|
8577
8577
|
return d === 200 || d === 206;
|
|
8578
8578
|
}
|
|
8579
8579
|
function Hi(d, t, e) {
|
|
@@ -8587,7 +8587,7 @@ function Hi(d, t, e) {
|
|
|
8587
8587
|
};
|
|
8588
8588
|
}
|
|
8589
8589
|
function $i(d) {
|
|
8590
|
-
return d instanceof Uint8Array ? d.buffer : d instanceof ArrayBuffer ? d : (
|
|
8590
|
+
return d instanceof Uint8Array ? d.buffer : d instanceof ArrayBuffer ? d : (I(`getArrayBuffer - unexpected data format: ${d}`), new Uint8Array(d).buffer);
|
|
8591
8591
|
}
|
|
8592
8592
|
class fr {
|
|
8593
8593
|
_responseOrigin = null;
|
|
@@ -8598,7 +8598,7 @@ class fr {
|
|
|
8598
8598
|
return this._fullRequestReader?._loaded ?? 0;
|
|
8599
8599
|
}
|
|
8600
8600
|
getFullReader() {
|
|
8601
|
-
return
|
|
8601
|
+
return O(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."), this._fullRequestReader = new mr(this), this._fullRequestReader;
|
|
8602
8602
|
}
|
|
8603
8603
|
getRangeReader(t, e) {
|
|
8604
8604
|
if (e <= this._progressiveDataLength)
|
|
@@ -8619,8 +8619,8 @@ class mr {
|
|
|
8619
8619
|
this._withCredentials = e.withCredentials || !1, this._contentLength = e.length, this._headersCapability = Promise.withResolvers(), this._disableRange = e.disableRange || !1, this._rangeChunkSize = e.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._abortController = new AbortController(), this._isStreamingSupported = !e.disableStream, this._isRangeSupported = !e.disableRange;
|
|
8620
8620
|
const s = new Headers(t.headers), i = e.url;
|
|
8621
8621
|
fetch(i, Hi(s, this._withCredentials, this._abortController)).then((n) => {
|
|
8622
|
-
if (t._responseOrigin = ts(n.url), !
|
|
8623
|
-
throw
|
|
8622
|
+
if (t._responseOrigin = ts(n.url), !Oi(n.status))
|
|
8623
|
+
throw Re(n.status, i);
|
|
8624
8624
|
this._reader = n.body.getReader(), this._headersCapability.resolve();
|
|
8625
8625
|
const r = n.headers, {
|
|
8626
8626
|
allowRangeRequests: a,
|
|
@@ -8631,7 +8631,7 @@ class mr {
|
|
|
8631
8631
|
rangeChunkSize: this._rangeChunkSize,
|
|
8632
8632
|
disableRange: this._disableRange
|
|
8633
8633
|
});
|
|
8634
|
-
this._isRangeSupported = a, this._contentLength = o || this._contentLength, this._filename =
|
|
8634
|
+
this._isRangeSupported = a, this._contentLength = o || this._contentLength, this._filename = Bi(r), !this._isStreamingSupported && this._isRangeSupported && this.cancel(new $t("Streaming is disabled."));
|
|
8635
8635
|
}).catch(this._headersCapability.reject), this.onProgress = null;
|
|
8636
8636
|
}
|
|
8637
8637
|
get headersReady() {
|
|
@@ -8682,8 +8682,8 @@ class br {
|
|
|
8682
8682
|
const o = ts(a.url);
|
|
8683
8683
|
if (o !== t._responseOrigin)
|
|
8684
8684
|
throw new Error(`Expected range response-origin "${o}" to match "${t._responseOrigin}".`);
|
|
8685
|
-
if (!
|
|
8686
|
-
throw
|
|
8685
|
+
if (!Oi(a.status))
|
|
8686
|
+
throw Re(a.status, r);
|
|
8687
8687
|
this._readCapability.resolve(), this._reader = a.body.getReader();
|
|
8688
8688
|
}).catch(this._readCapability.reject), this.onProgress = null;
|
|
8689
8689
|
}
|
|
@@ -8731,7 +8731,7 @@ class wr {
|
|
|
8731
8731
|
e.open("GET", this.url), e.withCredentials = this.withCredentials;
|
|
8732
8732
|
for (const [n, r] of this.headers)
|
|
8733
8733
|
e.setRequestHeader(n, r);
|
|
8734
|
-
return this.isHttp && "begin" in t && "end" in t ? (e.setRequestHeader("Range", `bytes=${t.begin}-${t.end - 1}`), i.expectedStatus = ds) : i.expectedStatus = cs, e.responseType = "arraybuffer",
|
|
8734
|
+
return this.isHttp && "begin" in t && "end" in t ? (e.setRequestHeader("Range", `bytes=${t.begin}-${t.end - 1}`), i.expectedStatus = ds) : i.expectedStatus = cs, e.responseType = "arraybuffer", O(t.onError, "Expected `onError` callback to be provided."), e.onerror = () => {
|
|
8735
8735
|
t.onError(e.status);
|
|
8736
8736
|
}, e.onreadystatechange = this.onStateChange.bind(this, s), e.onprogress = this.onProgress.bind(this, s), i.onHeadersReceived = t.onHeadersReceived, i.onDone = t.onDone, i.onError = t.onError, i.onProgress = t.onProgress, e.send(null), s;
|
|
8737
8737
|
}
|
|
@@ -8761,7 +8761,7 @@ class wr {
|
|
|
8761
8761
|
o ? s.onDone({
|
|
8762
8762
|
begin: parseInt(o[1], 10),
|
|
8763
8763
|
chunk: r
|
|
8764
|
-
}) : (
|
|
8764
|
+
}) : (I('Missing or invalid "Content-Range" header.'), s.onError(0));
|
|
8765
8765
|
} else r ? s.onDone({
|
|
8766
8766
|
begin: 0,
|
|
8767
8767
|
chunk: r
|
|
@@ -8787,7 +8787,7 @@ class vr {
|
|
|
8787
8787
|
e >= 0 && this._rangeRequestReaders.splice(e, 1);
|
|
8788
8788
|
}
|
|
8789
8789
|
getFullReader() {
|
|
8790
|
-
return
|
|
8790
|
+
return O(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."), this._fullRequestReader = new Ar(this._manager, this._source), this._fullRequestReader;
|
|
8791
8791
|
}
|
|
8792
8792
|
getRangeReader(t, e) {
|
|
8793
8793
|
const s = new xr(this._manager, t, e);
|
|
@@ -8823,7 +8823,7 @@ class Ar {
|
|
|
8823
8823
|
rangeChunkSize: this._rangeChunkSize,
|
|
8824
8824
|
disableRange: this._disableRange
|
|
8825
8825
|
});
|
|
8826
|
-
n && (this._isRangeSupported = !0), this._contentLength = r || this._contentLength, this._filename =
|
|
8826
|
+
n && (this._isRangeSupported = !0), this._contentLength = r || this._contentLength, this._filename = Bi(i), this._isRangeSupported && this._manager.abortRequest(t), this._headersCapability.resolve();
|
|
8827
8827
|
}
|
|
8828
8828
|
_onDone(t) {
|
|
8829
8829
|
if (t && (this._requests.length > 0 ? this._requests.shift().resolve({
|
|
@@ -8839,7 +8839,7 @@ class Ar {
|
|
|
8839
8839
|
}
|
|
8840
8840
|
}
|
|
8841
8841
|
_onError(t) {
|
|
8842
|
-
this._storedError =
|
|
8842
|
+
this._storedError = Re(t, this._url), this._headersCapability.reject(this._storedError);
|
|
8843
8843
|
for (const e of this._requests)
|
|
8844
8844
|
e.reject(this._storedError);
|
|
8845
8845
|
this._requests.length = 0, this._cachedChunks.length = 0;
|
|
@@ -8923,7 +8923,7 @@ class xr {
|
|
|
8923
8923
|
this._requests.length = 0, this._close();
|
|
8924
8924
|
}
|
|
8925
8925
|
_onError(t) {
|
|
8926
|
-
this._storedError ??=
|
|
8926
|
+
this._storedError ??= Re(t, this._url);
|
|
8927
8927
|
for (const e of this._requests)
|
|
8928
8928
|
e.reject(this._storedError);
|
|
8929
8929
|
this._requests.length = 0, this._queuedChunk = null;
|
|
@@ -8973,13 +8973,13 @@ function Er(d) {
|
|
|
8973
8973
|
}
|
|
8974
8974
|
class Sr {
|
|
8975
8975
|
constructor(t) {
|
|
8976
|
-
this.source = t, this.url = Er(t.url),
|
|
8976
|
+
this.source = t, this.url = Er(t.url), O(this.url.protocol === "file:", "PDFNodeStream only supports file:// URLs."), this._fullRequestReader = null, this._rangeRequestReaders = [];
|
|
8977
8977
|
}
|
|
8978
8978
|
get _progressiveDataLength() {
|
|
8979
8979
|
return this._fullRequestReader?._loaded ?? 0;
|
|
8980
8980
|
}
|
|
8981
8981
|
getFullReader() {
|
|
8982
|
-
return
|
|
8982
|
+
return O(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."), this._fullRequestReader = new Cr(this), this._fullRequestReader;
|
|
8983
8983
|
}
|
|
8984
8984
|
getRangeReader(t, e) {
|
|
8985
8985
|
if (e <= this._progressiveDataLength)
|
|
@@ -9002,7 +9002,7 @@ class Cr {
|
|
|
9002
9002
|
s.promises.lstat(this._url).then((i) => {
|
|
9003
9003
|
this._contentLength = i.size, this._setReadableStream(s.createReadStream(this._url)), this._headersCapability.resolve();
|
|
9004
9004
|
}, (i) => {
|
|
9005
|
-
i.code === "ENOENT" && (i =
|
|
9005
|
+
i.code === "ENOENT" && (i = Re(0, this._url.href)), this._storedError = i, this._headersCapability.reject(i);
|
|
9006
9006
|
});
|
|
9007
9007
|
}
|
|
9008
9008
|
get headersReady() {
|
|
@@ -9156,7 +9156,7 @@ class zi {
|
|
|
9156
9156
|
}
|
|
9157
9157
|
}
|
|
9158
9158
|
}
|
|
9159
|
-
const
|
|
9159
|
+
const Pr = 1e5, fi = 30;
|
|
9160
9160
|
class yt {
|
|
9161
9161
|
#t = Promise.withResolvers();
|
|
9162
9162
|
#e = null;
|
|
@@ -9207,7 +9207,7 @@ class yt {
|
|
|
9207
9207
|
pageX: r,
|
|
9208
9208
|
pageY: a
|
|
9209
9209
|
} = s.rawDims;
|
|
9210
|
-
this.#b = [1, 0, 0, -1, -r, a + n], this.#o = i, this.#n = n, yt.#
|
|
9210
|
+
this.#b = [1, 0, 0, -1, -r, a + n], this.#o = i, this.#n = n, yt.#M(), e.style.setProperty("--min-font-size", yt.#_), jt(e, s), this.#t.promise.finally(() => {
|
|
9211
9211
|
yt.#A.delete(this), this.#r = null, this.#p = null;
|
|
9212
9212
|
}).catch(() => {
|
|
9213
9213
|
});
|
|
@@ -9269,8 +9269,8 @@ class yt {
|
|
|
9269
9269
|
this.#r.ctx ??= yt.#k(this.#a);
|
|
9270
9270
|
const e = this.#c, s = this.#m;
|
|
9271
9271
|
for (const i of t) {
|
|
9272
|
-
if (e.length >
|
|
9273
|
-
|
|
9272
|
+
if (e.length > Pr) {
|
|
9273
|
+
I("Ignoring additional textDivs for performance reasons."), this.#i = !0;
|
|
9274
9274
|
return;
|
|
9275
9275
|
}
|
|
9276
9276
|
if (i.str === void 0) {
|
|
@@ -9298,7 +9298,7 @@ class yt {
|
|
|
9298
9298
|
r.vertical && (n += Math.PI / 2);
|
|
9299
9299
|
let a = this.#s && r.fontSubstitution || r.fontFamily;
|
|
9300
9300
|
a = yt.fontFamilyMap.get(a) || a;
|
|
9301
|
-
const o = Math.hypot(i[2], i[3]), h = o * yt.#
|
|
9301
|
+
const o = Math.hypot(i[2], i[3]), h = o * yt.#B(a, r, this.#a);
|
|
9302
9302
|
let l, c;
|
|
9303
9303
|
n === 0 ? (l = i[4], c = i[5] - h) : (l = i[4] + h * Math.sin(n), c = i[5] - h * Math.cos(n));
|
|
9304
9304
|
const u = e.style;
|
|
@@ -9330,7 +9330,7 @@ class yt {
|
|
|
9330
9330
|
canvasWidth: a,
|
|
9331
9331
|
fontSize: o
|
|
9332
9332
|
} = s;
|
|
9333
|
-
yt.#
|
|
9333
|
+
yt.#P(i, o * this.#d, r);
|
|
9334
9334
|
const {
|
|
9335
9335
|
width: h
|
|
9336
9336
|
} = i.measureText(e.textContent);
|
|
@@ -9362,40 +9362,40 @@ class yt {
|
|
|
9362
9362
|
}
|
|
9363
9363
|
return e;
|
|
9364
9364
|
}
|
|
9365
|
-
static #
|
|
9365
|
+
static #P(t, e, s) {
|
|
9366
9366
|
const i = this.#S.get(t);
|
|
9367
9367
|
e === i.size && s === i.family || (t.font = `${e}px ${s}`, i.size = e, i.family = s);
|
|
9368
9368
|
}
|
|
9369
|
-
static #
|
|
9369
|
+
static #M() {
|
|
9370
9370
|
if (this.#_ !== null)
|
|
9371
9371
|
return;
|
|
9372
9372
|
const t = document.createElement("div");
|
|
9373
9373
|
t.style.opacity = 0, t.style.lineHeight = 1, t.style.fontSize = "1px", t.style.position = "absolute", t.textContent = "X", document.body.append(t), this.#_ = t.getBoundingClientRect().height, t.remove();
|
|
9374
9374
|
}
|
|
9375
|
-
static #
|
|
9375
|
+
static #B(t, e, s) {
|
|
9376
9376
|
const i = this.#w.get(t);
|
|
9377
9377
|
if (i)
|
|
9378
9378
|
return i;
|
|
9379
9379
|
const n = this.#k(s);
|
|
9380
|
-
n.canvas.width = n.canvas.height = fi, this.#
|
|
9380
|
+
n.canvas.width = n.canvas.height = fi, this.#P(n, fi, t);
|
|
9381
9381
|
const r = n.measureText(""), a = r.fontBoundingBoxAscent, o = Math.abs(r.fontBoundingBoxDescent);
|
|
9382
9382
|
n.canvas.width = n.canvas.height = 0;
|
|
9383
9383
|
let h = 0.8;
|
|
9384
|
-
return a ? h = a / (a + o) : (at.platform.isFirefox &&
|
|
9384
|
+
return a ? h = a / (a + o) : (at.platform.isFirefox && I("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."), e.ascent ? h = e.ascent : e.descent && (h = 1 + e.descent)), this.#w.set(t, h), h;
|
|
9385
9385
|
}
|
|
9386
9386
|
}
|
|
9387
|
-
const
|
|
9387
|
+
const Mr = 100;
|
|
9388
9388
|
function Ui(d = {}) {
|
|
9389
9389
|
typeof d == "string" || d instanceof URL ? d = {
|
|
9390
9390
|
url: d
|
|
9391
9391
|
} : (d instanceof ArrayBuffer || ArrayBuffer.isView(d)) && (d = {
|
|
9392
9392
|
data: d
|
|
9393
9393
|
});
|
|
9394
|
-
const t = new
|
|
9394
|
+
const t = new Os(), {
|
|
9395
9395
|
docId: e
|
|
9396
|
-
} = t, s = d.url ? Nn(d.url) : null, i = d.data ?
|
|
9396
|
+
} = t, s = d.url ? Nn(d.url) : null, i = d.data ? Bn(d.data) : null, n = d.httpHeaders || null, r = d.withCredentials === !0, a = d.password ?? null, o = d.range instanceof Vi ? d.range : null, h = Number.isInteger(d.rangeChunkSize) && d.rangeChunkSize > 0 ? d.rangeChunkSize : 2 ** 16;
|
|
9397
9397
|
let l = d.worker instanceof Es ? d.worker : null;
|
|
9398
|
-
const c = d.verbosity, u = typeof d.docBaseUrl == "string" && !Je(d.docBaseUrl) ? d.docBaseUrl : null, p = Fe(d.cMapUrl), f = d.cMapPacked !== !1, g = d.CMapReaderFactory || (dt ? jn : ei), b = Fe(d.iccUrl), m = Fe(d.standardFontDataUrl), w = d.StandardFontDataFactory || (dt ? Wn : si), y = Fe(d.wasmUrl), v = d.WasmFactory || (dt ? qn : ii), A = d.stopAtErrors !== !0, x = Number.isInteger(d.maxImageSize) && d.maxImageSize > -1 ? d.maxImageSize : -1, _ = d.isEvalSupported !== !1, E = typeof d.isOffscreenCanvasSupported == "boolean" ? d.isOffscreenCanvasSupported : !dt, S = typeof d.isImageDecoderSupported == "boolean" ? d.isImageDecoderSupported : !dt && (at.platform.isFirefox || !globalThis.chrome),
|
|
9398
|
+
const c = d.verbosity, u = typeof d.docBaseUrl == "string" && !Je(d.docBaseUrl) ? d.docBaseUrl : null, p = Fe(d.cMapUrl), f = d.cMapPacked !== !1, g = d.CMapReaderFactory || (dt ? jn : ei), b = Fe(d.iccUrl), m = Fe(d.standardFontDataUrl), w = d.StandardFontDataFactory || (dt ? Wn : si), y = Fe(d.wasmUrl), v = d.WasmFactory || (dt ? qn : ii), A = d.stopAtErrors !== !0, x = Number.isInteger(d.maxImageSize) && d.maxImageSize > -1 ? d.maxImageSize : -1, _ = d.isEvalSupported !== !1, E = typeof d.isOffscreenCanvasSupported == "boolean" ? d.isOffscreenCanvasSupported : !dt, S = typeof d.isImageDecoderSupported == "boolean" ? d.isImageDecoderSupported : !dt && (at.platform.isFirefox || !globalThis.chrome), M = Number.isInteger(d.canvasMaxAreaInBytes) ? d.canvasMaxAreaInBytes : -1, C = typeof d.disableFontFace == "boolean" ? d.disableFontFace : dt, H = d.fontExtraProperties === !0, V = d.enableXfa === !0, N = d.ownerDocument || globalThis.document, Z = d.disableRange === !0, k = d.disableStream === !0, R = d.disableAutoFetch === !0, U = d.pdfBug === !0, ft = d.CanvasFactory || (dt ? Gn : zn), Dt = d.FilterFactory || (dt ? Vn : Un), tt = d.enableHWA === !0, W = d.useWasm !== !1, q = o ? o.length : d.length ?? NaN, Ut = typeof d.useSystemFonts == "boolean" ? d.useSystemFonts : !dt && !C, Nt = typeof d.useWorkerFetch == "boolean" ? d.useWorkerFetch : !!(g === ei && w === si && v === ii && p && m && y && ye(p, document.baseURI) && ye(m, document.baseURI) && ye(y, document.baseURI)), Bt = null;
|
|
9399
9399
|
ln(c);
|
|
9400
9400
|
const et = {
|
|
9401
9401
|
canvasFactory: new ft({
|
|
@@ -9426,7 +9426,7 @@ function Ui(d = {}) {
|
|
|
9426
9426
|
apiVersion: "5.4.530",
|
|
9427
9427
|
data: i,
|
|
9428
9428
|
password: a,
|
|
9429
|
-
disableAutoFetch:
|
|
9429
|
+
disableAutoFetch: R,
|
|
9430
9430
|
rangeChunkSize: h,
|
|
9431
9431
|
length: q,
|
|
9432
9432
|
docBaseUrl: u,
|
|
@@ -9438,7 +9438,7 @@ function Ui(d = {}) {
|
|
|
9438
9438
|
isEvalSupported: _,
|
|
9439
9439
|
isOffscreenCanvasSupported: E,
|
|
9440
9440
|
isImageDecoderSupported: S,
|
|
9441
|
-
canvasMaxAreaInBytes:
|
|
9441
|
+
canvasMaxAreaInBytes: M,
|
|
9442
9442
|
fontExtraProperties: H,
|
|
9443
9443
|
useSystemFonts: Ut,
|
|
9444
9444
|
useWasm: W,
|
|
@@ -9451,9 +9451,9 @@ function Ui(d = {}) {
|
|
|
9451
9451
|
}, de = {
|
|
9452
9452
|
ownerDocument: N,
|
|
9453
9453
|
pdfBug: U,
|
|
9454
|
-
styleElement:
|
|
9454
|
+
styleElement: Bt,
|
|
9455
9455
|
loadingParams: {
|
|
9456
|
-
disableAutoFetch:
|
|
9456
|
+
disableAutoFetch: R,
|
|
9457
9457
|
enableXfa: V
|
|
9458
9458
|
}
|
|
9459
9459
|
};
|
|
@@ -9488,17 +9488,17 @@ function Ui(d = {}) {
|
|
|
9488
9488
|
throw new Error("Loading aborted");
|
|
9489
9489
|
if (l.destroyed)
|
|
9490
9490
|
throw new Error("Worker was destroyed");
|
|
9491
|
-
const js = new we(e, is, l.port), sn = new
|
|
9491
|
+
const js = new we(e, is, l.port), sn = new Rr(js, t, ss, de, et, tt);
|
|
9492
9492
|
t._transport = sn, js.send("Ready", null);
|
|
9493
9493
|
});
|
|
9494
9494
|
}).catch(t._capability.reject), t;
|
|
9495
9495
|
}
|
|
9496
|
-
class
|
|
9496
|
+
class Os {
|
|
9497
9497
|
static #t = 0;
|
|
9498
9498
|
_capability = Promise.withResolvers();
|
|
9499
9499
|
_transport = null;
|
|
9500
9500
|
_worker = null;
|
|
9501
|
-
docId = `d${
|
|
9501
|
+
docId = `d${Os.#t++}`;
|
|
9502
9502
|
destroyed = !1;
|
|
9503
9503
|
onPassword = null;
|
|
9504
9504
|
onProgress = null;
|
|
@@ -9715,7 +9715,7 @@ class Dr {
|
|
|
9715
9715
|
offsetY: i = 0,
|
|
9716
9716
|
dontFlip: n = !1
|
|
9717
9717
|
} = {}) {
|
|
9718
|
-
return new
|
|
9718
|
+
return new Me({
|
|
9719
9719
|
viewBox: this.view,
|
|
9720
9720
|
userUnit: this.userUnit,
|
|
9721
9721
|
scale: t,
|
|
@@ -9750,7 +9750,7 @@ class Dr {
|
|
|
9750
9750
|
canvas: e = t.canvas,
|
|
9751
9751
|
viewport: s,
|
|
9752
9752
|
intent: i = "display",
|
|
9753
|
-
annotationMode: n =
|
|
9753
|
+
annotationMode: n = Ot.ENABLE,
|
|
9754
9754
|
transform: r = null,
|
|
9755
9755
|
background: a = null,
|
|
9756
9756
|
optionalContentConfigPromise: o = null,
|
|
@@ -9778,8 +9778,8 @@ class Dr {
|
|
|
9778
9778
|
}, this._stats?.time("Page Request"), this._pumpOperatorList(g));
|
|
9779
9779
|
const v = !!(this._pdfBug && globalThis.StepperManager?.enabled), A = !this.recordedBBoxes && (p || v), x = (S) => {
|
|
9780
9780
|
if (w.renderTasks.delete(_), A) {
|
|
9781
|
-
const
|
|
9782
|
-
|
|
9781
|
+
const M = _.gfx?.dependencyTracker.take();
|
|
9782
|
+
M && (_.stepper && _.stepper.setOperatorBBoxes(M, _.gfx.dependencyTracker.takeDebugMetadata()), p && (this.recordedBBoxes = M));
|
|
9783
9783
|
}
|
|
9784
9784
|
y && (this.#t = !0), this.#e(), S ? (_.capability.reject(S), this._abortOperatorList({
|
|
9785
9785
|
intentState: w,
|
|
@@ -9810,22 +9810,22 @@ class Dr {
|
|
|
9810
9810
|
});
|
|
9811
9811
|
(w.renderTasks ||= /* @__PURE__ */ new Set()).add(_);
|
|
9812
9812
|
const E = _.task;
|
|
9813
|
-
return Promise.all([w.displayReadyCapability.promise, o]).then(([S,
|
|
9813
|
+
return Promise.all([w.displayReadyCapability.promise, o]).then(([S, M]) => {
|
|
9814
9814
|
if (this.destroyed) {
|
|
9815
9815
|
x();
|
|
9816
9816
|
return;
|
|
9817
9817
|
}
|
|
9818
|
-
if (this._stats?.time("Rendering"), !(
|
|
9818
|
+
if (this._stats?.time("Rendering"), !(M.renderingIntent & b))
|
|
9819
9819
|
throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");
|
|
9820
9820
|
_.initializeGraphics({
|
|
9821
9821
|
transparency: S,
|
|
9822
|
-
optionalContentConfig:
|
|
9822
|
+
optionalContentConfig: M
|
|
9823
9823
|
}), _.operatorListChanged();
|
|
9824
9824
|
}).catch(x), E;
|
|
9825
9825
|
}
|
|
9826
9826
|
getOperatorList({
|
|
9827
9827
|
intent: t = "display",
|
|
9828
|
-
annotationMode: e =
|
|
9828
|
+
annotationMode: e = Ot.ENABLE,
|
|
9829
9829
|
printAnnotationStorage: s = null,
|
|
9830
9830
|
isEditing: i = !1
|
|
9831
9831
|
} = {}) {
|
|
@@ -9983,7 +9983,7 @@ class Dr {
|
|
|
9983
9983
|
if (t.renderTasks.size > 0)
|
|
9984
9984
|
return;
|
|
9985
9985
|
if (e instanceof ks) {
|
|
9986
|
-
let i =
|
|
9986
|
+
let i = Mr;
|
|
9987
9987
|
e.extraDelay > 0 && e.extraDelay < 1e3 && (i += e.extraDelay), t.streamReaderCancelTimeout = setTimeout(() => {
|
|
9988
9988
|
t.streamReaderCancelTimeout = null, this._abortOperatorList({
|
|
9989
9989
|
intentState: t,
|
|
@@ -10009,19 +10009,19 @@ class Dr {
|
|
|
10009
10009
|
return this._stats;
|
|
10010
10010
|
}
|
|
10011
10011
|
}
|
|
10012
|
-
var Vt,
|
|
10012
|
+
var Vt, Mt, Ht, he, us, Qt, ie, Et, ze, Gi, ji, fe, xe, qe;
|
|
10013
10013
|
const rt = class ve {
|
|
10014
10014
|
constructor({
|
|
10015
10015
|
name: t = null,
|
|
10016
10016
|
port: e = null,
|
|
10017
10017
|
verbosity: s = cn()
|
|
10018
10018
|
} = {}) {
|
|
10019
|
-
if (Ft(this, Et), Ft(this, Vt, Promise.withResolvers()), Ft(this,
|
|
10019
|
+
if (Ft(this, Et), Ft(this, Vt, Promise.withResolvers()), Ft(this, Mt, null), Ft(this, Ht, null), Ft(this, he, null), this.name = t, this.destroyed = !1, this.verbosity = s, e) {
|
|
10020
10020
|
if (Y(ve, ie).has(e))
|
|
10021
10021
|
throw new Error("Cannot use more than one PDFWorker per port.");
|
|
10022
|
-
Y(ve, ie).set(e, this),
|
|
10022
|
+
Y(ve, ie).set(e, this), It(this, Et, Gi).call(this, e);
|
|
10023
10023
|
} else
|
|
10024
|
-
|
|
10024
|
+
It(this, Et, ji).call(this);
|
|
10025
10025
|
}
|
|
10026
10026
|
get promise() {
|
|
10027
10027
|
return Y(this, Vt).promise;
|
|
@@ -10030,10 +10030,10 @@ const rt = class ve {
|
|
|
10030
10030
|
return Y(this, Ht);
|
|
10031
10031
|
}
|
|
10032
10032
|
get messageHandler() {
|
|
10033
|
-
return Y(this,
|
|
10033
|
+
return Y(this, Mt);
|
|
10034
10034
|
}
|
|
10035
10035
|
destroy() {
|
|
10036
|
-
this.destroyed = !0, Y(this, he)?.terminate(), mt(this, he, null), Y(ve, ie).delete(Y(this, Ht)), mt(this, Ht, null), Y(this,
|
|
10036
|
+
this.destroyed = !0, Y(this, he)?.terminate(), mt(this, he, null), Y(ve, ie).delete(Y(this, Ht)), mt(this, Ht, null), Y(this, Mt)?.destroy(), mt(this, Mt, null);
|
|
10037
10037
|
}
|
|
10038
10038
|
static create(t) {
|
|
10039
10039
|
const e = Y(this, ie).get(t?.port);
|
|
@@ -10057,16 +10057,16 @@ const rt = class ve {
|
|
|
10057
10057
|
)).WorkerMessageHandler)());
|
|
10058
10058
|
}
|
|
10059
10059
|
};
|
|
10060
|
-
Vt = /* @__PURE__ */ new WeakMap(),
|
|
10061
|
-
Y(this, Vt).resolve(), Y(this,
|
|
10060
|
+
Vt = /* @__PURE__ */ new WeakMap(), Mt = /* @__PURE__ */ new WeakMap(), Ht = /* @__PURE__ */ new WeakMap(), he = /* @__PURE__ */ new WeakMap(), us = /* @__PURE__ */ new WeakMap(), Qt = /* @__PURE__ */ new WeakMap(), ie = /* @__PURE__ */ new WeakMap(), Et = /* @__PURE__ */ new WeakSet(), ze = function() {
|
|
10061
|
+
Y(this, Vt).resolve(), Y(this, Mt).send("configure", {
|
|
10062
10062
|
verbosity: this.verbosity
|
|
10063
10063
|
});
|
|
10064
10064
|
}, Gi = function(d) {
|
|
10065
|
-
mt(this, Ht, d), mt(this,
|
|
10066
|
-
}),
|
|
10065
|
+
mt(this, Ht, d), mt(this, Mt, new we("main", "worker", d)), Y(this, Mt).on("ready", () => {
|
|
10066
|
+
}), It(this, Et, ze).call(this);
|
|
10067
10067
|
}, ji = function() {
|
|
10068
10068
|
if (Y(rt, Qt) || Y(rt, xe, qe)) {
|
|
10069
|
-
|
|
10069
|
+
It(this, Et, fe).call(this);
|
|
10070
10070
|
return;
|
|
10071
10071
|
}
|
|
10072
10072
|
let {
|
|
@@ -10077,7 +10077,7 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10077
10077
|
const t = new Worker(d, {
|
|
10078
10078
|
type: "module"
|
|
10079
10079
|
}), e = new we("main", "worker", t), s = () => {
|
|
10080
|
-
i.abort(), e.destroy(), t.terminate(), this.destroyed ? Y(this, Vt).reject(new Error("Worker was destroyed")) :
|
|
10080
|
+
i.abort(), e.destroy(), t.terminate(), this.destroyed ? Y(this, Vt).reject(new Error("Worker was destroyed")) : It(this, Et, fe).call(this);
|
|
10081
10081
|
}, i = new AbortController();
|
|
10082
10082
|
t.addEventListener("error", () => {
|
|
10083
10083
|
Y(this, he) || s();
|
|
@@ -10088,7 +10088,7 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10088
10088
|
s();
|
|
10089
10089
|
return;
|
|
10090
10090
|
}
|
|
10091
|
-
mt(this,
|
|
10091
|
+
mt(this, Mt, e), mt(this, Ht, t), mt(this, he, t), It(this, Et, ze).call(this);
|
|
10092
10092
|
}), e.on("ready", (r) => {
|
|
10093
10093
|
if (i.abort(), this.destroyed) {
|
|
10094
10094
|
s();
|
|
@@ -10097,7 +10097,7 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10097
10097
|
try {
|
|
10098
10098
|
n();
|
|
10099
10099
|
} catch {
|
|
10100
|
-
|
|
10100
|
+
It(this, Et, fe).call(this);
|
|
10101
10101
|
}
|
|
10102
10102
|
});
|
|
10103
10103
|
const n = () => {
|
|
@@ -10109,9 +10109,9 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10109
10109
|
} catch {
|
|
10110
10110
|
Qe("The worker has been disabled.");
|
|
10111
10111
|
}
|
|
10112
|
-
|
|
10112
|
+
It(this, Et, fe).call(this);
|
|
10113
10113
|
}, fe = function() {
|
|
10114
|
-
Y(rt, Qt) || (
|
|
10114
|
+
Y(rt, Qt) || (I("Setting up fake worker."), mt(rt, Qt, !0)), rt._setupFakeWorkerGlobal.then((d) => {
|
|
10115
10115
|
if (this.destroyed) {
|
|
10116
10116
|
Y(this, Vt).reject(new Error("Worker was destroyed"));
|
|
10117
10117
|
return;
|
|
@@ -10119,7 +10119,7 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10119
10119
|
const t = new $n();
|
|
10120
10120
|
mt(this, Ht, t);
|
|
10121
10121
|
const e = `fake${nn(rt, us)._++}`, s = new we(e + "_worker", e, t);
|
|
10122
|
-
d.setup(s, t), mt(this,
|
|
10122
|
+
d.setup(s, t), mt(this, Mt, new we(e, e + "_worker", t)), It(this, Et, ze).call(this);
|
|
10123
10123
|
}).catch((d) => {
|
|
10124
10124
|
Y(this, Vt).reject(new Error(`Setting up fake worker failed: "${d.message}".`));
|
|
10125
10125
|
});
|
|
@@ -10146,14 +10146,14 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10146
10146
|
return rt.create(d);
|
|
10147
10147
|
};
|
|
10148
10148
|
let Es = rt;
|
|
10149
|
-
class
|
|
10149
|
+
class Rr {
|
|
10150
10150
|
#t = /* @__PURE__ */ new Map();
|
|
10151
10151
|
#e = /* @__PURE__ */ new Map();
|
|
10152
10152
|
#i = /* @__PURE__ */ new Map();
|
|
10153
10153
|
#s = /* @__PURE__ */ new Map();
|
|
10154
10154
|
#a = null;
|
|
10155
10155
|
constructor(t, e, s, i, n, r) {
|
|
10156
|
-
this.messageHandler = t, this.loadingTask = e, this.commonObjs = new zi(), this.fontLoader = new
|
|
10156
|
+
this.messageHandler = t, this.loadingTask = e, this.commonObjs = new zi(), this.fontLoader = new In({
|
|
10157
10157
|
ownerDocument: i.ownerDocument,
|
|
10158
10158
|
styleElement: i.styleElement
|
|
10159
10159
|
}), this.loadingParams = i.loadingParams, this._params = i, this.canvasFactory = n.canvasFactory, this.filterFactory = n.filterFactory, this.cMapReaderFactory = n.cMapReaderFactory, this.standardFontDataFactory = n.standardFontDataFactory, this.wasmFactory = n.wasmFactory, this.destroyed = !1, this.destroyCapability = null, this._networkStream = s, this._fullReader = null, this._lastProgress = null, this.downloadInfoCapability = Promise.withResolvers(), this.enableHWA = r, this.setupMessageHandler();
|
|
@@ -10168,7 +10168,7 @@ class Ir {
|
|
|
10168
10168
|
get annotationStorage() {
|
|
10169
10169
|
return L(this, "annotationStorage", new Ls());
|
|
10170
10170
|
}
|
|
10171
|
-
getRenderingIntent(t, e =
|
|
10171
|
+
getRenderingIntent(t, e = Ot.ENABLE, s = null, i = !1, n = !1) {
|
|
10172
10172
|
let r = bt.DISPLAY, a = vs;
|
|
10173
10173
|
switch (t) {
|
|
10174
10174
|
case "any":
|
|
@@ -10180,23 +10180,23 @@ class Ir {
|
|
|
10180
10180
|
r = bt.PRINT;
|
|
10181
10181
|
break;
|
|
10182
10182
|
default:
|
|
10183
|
-
|
|
10183
|
+
I(`getRenderingIntent - invalid intent: ${t}`);
|
|
10184
10184
|
}
|
|
10185
|
-
const o = r & bt.PRINT && s instanceof
|
|
10185
|
+
const o = r & bt.PRINT && s instanceof Mi ? s : this.annotationStorage;
|
|
10186
10186
|
switch (e) {
|
|
10187
|
-
case
|
|
10187
|
+
case Ot.DISABLE:
|
|
10188
10188
|
r += bt.ANNOTATIONS_DISABLE;
|
|
10189
10189
|
break;
|
|
10190
|
-
case
|
|
10190
|
+
case Ot.ENABLE:
|
|
10191
10191
|
break;
|
|
10192
|
-
case
|
|
10192
|
+
case Ot.ENABLE_FORMS:
|
|
10193
10193
|
r += bt.ANNOTATIONS_FORMS;
|
|
10194
10194
|
break;
|
|
10195
|
-
case
|
|
10195
|
+
case Ot.ENABLE_STORAGE:
|
|
10196
10196
|
r += bt.ANNOTATIONS_STORAGE, a = o.serializable;
|
|
10197
10197
|
break;
|
|
10198
10198
|
default:
|
|
10199
|
-
|
|
10199
|
+
I(`getRenderingIntent - invalid annotationMode: ${e}`);
|
|
10200
10200
|
}
|
|
10201
10201
|
i && (r += bt.IS_EDITING), n && (r += bt.OPLIST);
|
|
10202
10202
|
const {
|
|
@@ -10229,7 +10229,7 @@ class Ir {
|
|
|
10229
10229
|
loadingTask: e
|
|
10230
10230
|
} = this;
|
|
10231
10231
|
t.on("GetReader", (s, i) => {
|
|
10232
|
-
|
|
10232
|
+
O(this._networkStream, "GetReader - no `IPDFStream` instance available."), this._fullReader = this._networkStream.getFullReader(), this._fullReader.onProgress = (n) => {
|
|
10233
10233
|
this._lastProgress = {
|
|
10234
10234
|
loaded: n.loaded,
|
|
10235
10235
|
total: n.total
|
|
@@ -10243,7 +10243,7 @@ class Ir {
|
|
|
10243
10243
|
i.close();
|
|
10244
10244
|
return;
|
|
10245
10245
|
}
|
|
10246
|
-
|
|
10246
|
+
O(n instanceof ArrayBuffer, "GetReader - expected an ArrayBuffer."), i.enqueue(new Uint8Array(n), 1, [n]);
|
|
10247
10247
|
}).catch((n) => {
|
|
10248
10248
|
i.error(n);
|
|
10249
10249
|
});
|
|
@@ -10271,7 +10271,7 @@ class Ir {
|
|
|
10271
10271
|
contentLength: r
|
|
10272
10272
|
};
|
|
10273
10273
|
}), t.on("GetRangeReader", (s, i) => {
|
|
10274
|
-
|
|
10274
|
+
O(this._networkStream, "GetRangeReader - no `IPDFStream` instance available.");
|
|
10275
10275
|
const n = this._networkStream.getRangeReader(s.begin, s.end);
|
|
10276
10276
|
if (!n) {
|
|
10277
10277
|
i.close();
|
|
@@ -10286,7 +10286,7 @@ class Ir {
|
|
|
10286
10286
|
i.close();
|
|
10287
10287
|
return;
|
|
10288
10288
|
}
|
|
10289
|
-
|
|
10289
|
+
O(r instanceof ArrayBuffer, "GetRangeReader - expected an ArrayBuffer."), i.enqueue(new Uint8Array(r), 1, [r]);
|
|
10290
10290
|
}).catch((r) => {
|
|
10291
10291
|
i.error(r);
|
|
10292
10292
|
});
|
|
@@ -10331,7 +10331,7 @@ class Ir {
|
|
|
10331
10331
|
case "Font":
|
|
10332
10332
|
if ("error" in n) {
|
|
10333
10333
|
const c = n.error;
|
|
10334
|
-
|
|
10334
|
+
I(`Error during font loading: ${c}`), this.commonObjs.resolve(s, c);
|
|
10335
10335
|
break;
|
|
10336
10336
|
}
|
|
10337
10337
|
const r = new G(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);
|
|
@@ -10345,7 +10345,7 @@ class Ir {
|
|
|
10345
10345
|
const {
|
|
10346
10346
|
imageRef: h
|
|
10347
10347
|
} = n;
|
|
10348
|
-
|
|
10348
|
+
O(h, "The imageRef must be defined.");
|
|
10349
10349
|
for (const c of this.#e.values())
|
|
10350
10350
|
for (const [, u] of c.objs)
|
|
10351
10351
|
if (u?.ref === h)
|
|
@@ -10401,7 +10401,7 @@ class Ir {
|
|
|
10401
10401
|
return this.messageHandler.sendWithPromise("GetData", null);
|
|
10402
10402
|
}
|
|
10403
10403
|
saveDocument() {
|
|
10404
|
-
this.annotationStorage.size <= 0 &&
|
|
10404
|
+
this.annotationStorage.size <= 0 && I("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");
|
|
10405
10405
|
const {
|
|
10406
10406
|
map: t,
|
|
10407
10407
|
transfer: e
|
|
@@ -10544,7 +10544,7 @@ class Ir {
|
|
|
10544
10544
|
return this.#s.get(e) ?? null;
|
|
10545
10545
|
}
|
|
10546
10546
|
}
|
|
10547
|
-
class
|
|
10547
|
+
class Ir {
|
|
10548
10548
|
#t = null;
|
|
10549
10549
|
onContinue = null;
|
|
10550
10550
|
onError = null;
|
|
@@ -10588,7 +10588,7 @@ class ne {
|
|
|
10588
10588
|
enableHWA: p = !1,
|
|
10589
10589
|
operationsFilter: f = null
|
|
10590
10590
|
}) {
|
|
10591
|
-
this.callback = t, this.params = e, this.objs = s, this.commonObjs = i, this.annotationCanvasMap = n, this.operatorListIdx = null, this.operatorList = r, this._pageIndex = a, this.canvasFactory = o, this.filterFactory = h, this._pdfBug = c, this.pageColors = u, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = l === !0 && typeof window < "u", this.cancelled = !1, this.capability = Promise.withResolvers(), this.task = new
|
|
10591
|
+
this.callback = t, this.params = e, this.objs = s, this.commonObjs = i, this.annotationCanvasMap = n, this.operatorListIdx = null, this.operatorList = r, this._pageIndex = a, this.canvasFactory = o, this.filterFactory = h, this._pdfBug = c, this.pageColors = u, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = l === !0 && typeof window < "u", this.cancelled = !1, this.capability = Promise.withResolvers(), this.task = new Ir(this), this._cancelBound = this.cancel.bind(this), this._continueBound = this._continue.bind(this), this._scheduleNextBound = this._scheduleNext.bind(this), this._nextBound = this._next.bind(this), this._canvas = e.canvas, this._canvasContext = e.canvas ? null : e.canvasContext, this._enableHWA = p, this._dependencyTracker = e.dependencyTracker, this._operationsFilter = f;
|
|
10592
10592
|
}
|
|
10593
10593
|
get completed() {
|
|
10594
10594
|
return this.capability.promise.catch(function() {
|
|
@@ -10710,7 +10710,7 @@ class xt {
|
|
|
10710
10710
|
#p(t, e) {
|
|
10711
10711
|
e.stopPropagation(), this.#o.dispatch("switchannotationeditorparams", {
|
|
10712
10712
|
source: this,
|
|
10713
|
-
type:
|
|
10713
|
+
type: B.HIGHLIGHT_COLOR,
|
|
10714
10714
|
value: t
|
|
10715
10715
|
}), this.updateColor(t);
|
|
10716
10716
|
}
|
|
@@ -10908,10 +10908,10 @@ class Fr {
|
|
|
10908
10908
|
}
|
|
10909
10909
|
class Xe extends Fr {
|
|
10910
10910
|
_createSVG(t) {
|
|
10911
|
-
return document.createElementNS(
|
|
10911
|
+
return document.createElementNS(Rt, t);
|
|
10912
10912
|
}
|
|
10913
10913
|
}
|
|
10914
|
-
const Nr = 9, qt = /* @__PURE__ */ new WeakSet(),
|
|
10914
|
+
const Nr = 9, qt = /* @__PURE__ */ new WeakSet(), Br = (/* @__PURE__ */ new Date()).getTimezoneOffset() * 60 * 1e3;
|
|
10915
10915
|
class ps {
|
|
10916
10916
|
static create(t) {
|
|
10917
10917
|
switch (t.data.annotationType) {
|
|
@@ -11144,10 +11144,10 @@ class K {
|
|
|
11144
11144
|
r.borderStyle = "dashed";
|
|
11145
11145
|
break;
|
|
11146
11146
|
case Jt.BEVELED:
|
|
11147
|
-
|
|
11147
|
+
I("Unimplemented border style: beveled");
|
|
11148
11148
|
break;
|
|
11149
11149
|
case Jt.INSET:
|
|
11150
|
-
|
|
11150
|
+
I("Unimplemented border style: inset");
|
|
11151
11151
|
break;
|
|
11152
11152
|
case Jt.UNDERLINE:
|
|
11153
11153
|
r.borderBottomStyle = "solid";
|
|
@@ -11364,7 +11364,7 @@ class K {
|
|
|
11364
11364
|
continue;
|
|
11365
11365
|
const o = typeof a == "string" ? a : null, h = document.querySelector(`[data-element-id="${r}"]`);
|
|
11366
11366
|
if (h && !qt.has(h)) {
|
|
11367
|
-
|
|
11367
|
+
I(`_getElementsByName - element not allowed: ${r}`);
|
|
11368
11368
|
continue;
|
|
11369
11369
|
}
|
|
11370
11370
|
s.push({
|
|
@@ -11429,7 +11429,7 @@ class K {
|
|
|
11429
11429
|
return this.data.rect[3] - this.data.rect[1];
|
|
11430
11430
|
}
|
|
11431
11431
|
}
|
|
11432
|
-
class
|
|
11432
|
+
class Or extends K {
|
|
11433
11433
|
constructor(t) {
|
|
11434
11434
|
super(t, {
|
|
11435
11435
|
isRenderable: !0,
|
|
@@ -11514,7 +11514,7 @@ class Hs extends K {
|
|
|
11514
11514
|
_bindResetFormAction(t, e) {
|
|
11515
11515
|
const s = t.onclick;
|
|
11516
11516
|
if (s || (t.href = this.linkService.getAnchorUrl("")), this.#t(), !this._fieldObjects) {
|
|
11517
|
-
|
|
11517
|
+
I('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'), s || (t.onclick = () => !1);
|
|
11518
11518
|
return;
|
|
11519
11519
|
}
|
|
11520
11520
|
t.onclick = () => {
|
|
@@ -11574,7 +11574,7 @@ class Hs extends K {
|
|
|
11574
11574
|
const u = document.querySelector(`[data-element-id="${c}"]`);
|
|
11575
11575
|
if (u) {
|
|
11576
11576
|
if (!qt.has(u)) {
|
|
11577
|
-
|
|
11577
|
+
I(`_bindResetFormAction - element not allowed: ${c}`);
|
|
11578
11578
|
continue;
|
|
11579
11579
|
}
|
|
11580
11580
|
} else continue;
|
|
@@ -11747,7 +11747,7 @@ class $r extends Yt {
|
|
|
11747
11747
|
const w = new Date(m), y = [w.getHours(), w.getMinutes(), w.getSeconds()];
|
|
11748
11748
|
b.value = y.map((v) => v.toString().padStart(2, "0")).join(":");
|
|
11749
11749
|
} else
|
|
11750
|
-
b.value = new Date(m -
|
|
11750
|
+
b.value = new Date(m - Br).toISOString().split(l === "date" ? "T" : ".", 1)[0];
|
|
11751
11751
|
else
|
|
11752
11752
|
b.value = m;
|
|
11753
11753
|
}
|
|
@@ -12213,7 +12213,7 @@ class jr {
|
|
|
12213
12213
|
#t = null;
|
|
12214
12214
|
#e = this.#G.bind(this);
|
|
12215
12215
|
#i = this.#H.bind(this);
|
|
12216
|
-
#s = this.#
|
|
12216
|
+
#s = this.#I.bind(this);
|
|
12217
12217
|
#a = this.#x.bind(this);
|
|
12218
12218
|
#r = null;
|
|
12219
12219
|
#n = null;
|
|
@@ -12272,7 +12272,7 @@ class jr {
|
|
|
12272
12272
|
signal: t
|
|
12273
12273
|
});
|
|
12274
12274
|
}
|
|
12275
|
-
#
|
|
12275
|
+
#P() {
|
|
12276
12276
|
const t = this.#h.find((e) => e.hasCommentButton);
|
|
12277
12277
|
t && (this.#b = t._normalizePoint(t.commentButtonPosition));
|
|
12278
12278
|
}
|
|
@@ -12281,7 +12281,7 @@ class jr {
|
|
|
12281
12281
|
this.#g.parentNode || this.#v.container.after(this.#g);
|
|
12282
12282
|
return;
|
|
12283
12283
|
}
|
|
12284
|
-
if (this.#b || this.#
|
|
12284
|
+
if (this.#b || this.#P(), !this.#b)
|
|
12285
12285
|
return;
|
|
12286
12286
|
const {
|
|
12287
12287
|
signal: t
|
|
@@ -12308,7 +12308,7 @@ class jr {
|
|
|
12308
12308
|
const r = this.#g = document.createElement("button");
|
|
12309
12309
|
r.className = "annotationCommentButton";
|
|
12310
12310
|
const a = this.#v.container;
|
|
12311
|
-
r.style.zIndex = a.style.zIndex + 1, r.tabIndex = 0, r.ariaHasPopup = "dialog", r.ariaControls = "commentPopup", r.setAttribute("data-l10n-id", "pdfjs-show-comment-button"), this.#
|
|
12311
|
+
r.style.zIndex = a.style.zIndex + 1, r.tabIndex = 0, r.ariaHasPopup = "dialog", r.ariaControls = "commentPopup", r.setAttribute("data-l10n-id", "pdfjs-show-comment-button"), this.#B(), this.#M(), r.addEventListener("keydown", this.#e, {
|
|
12312
12312
|
signal: t
|
|
12313
12313
|
}), r.addEventListener("click", s, {
|
|
12314
12314
|
signal: t
|
|
@@ -12319,7 +12319,7 @@ class jr {
|
|
|
12319
12319
|
}), a.after(r);
|
|
12320
12320
|
}
|
|
12321
12321
|
}
|
|
12322
|
-
#
|
|
12322
|
+
#M() {
|
|
12323
12323
|
if (this.#v.extraPopupElement && !this.#v.editor)
|
|
12324
12324
|
return;
|
|
12325
12325
|
this.#g || this.renderCommentButton();
|
|
@@ -12328,7 +12328,7 @@ class jr {
|
|
|
12328
12328
|
} = this.#g;
|
|
12329
12329
|
s.left = `calc(${t}%)`, s.top = `calc(${e}% - var(--comment-button-dim))`;
|
|
12330
12330
|
}
|
|
12331
|
-
#
|
|
12331
|
+
#B() {
|
|
12332
12332
|
this.#v.extraPopupElement || (this.#g || this.renderCommentButton(), this.#g.style.backgroundColor = this.commentButtonColor || "");
|
|
12333
12333
|
}
|
|
12334
12334
|
get commentButtonColor() {
|
|
@@ -12448,20 +12448,20 @@ class jr {
|
|
|
12448
12448
|
})), s.dateTime = this.#l.toISOString(), e.append(s);
|
|
12449
12449
|
}
|
|
12450
12450
|
Si({
|
|
12451
|
-
html: this.#
|
|
12451
|
+
html: this.#R || this.#o.str,
|
|
12452
12452
|
dir: this.#o?.dir,
|
|
12453
12453
|
className: "popupContent"
|
|
12454
12454
|
}, t), this.#n.append(t);
|
|
12455
12455
|
}
|
|
12456
|
-
get #
|
|
12456
|
+
get #R() {
|
|
12457
12457
|
const t = this.#S, e = this.#o;
|
|
12458
12458
|
return t?.str && (!e?.str || e.str === t.str) && this.#S.html || null;
|
|
12459
12459
|
}
|
|
12460
12460
|
get #L() {
|
|
12461
|
-
return this.#
|
|
12461
|
+
return this.#R?.attributes?.style?.fontSize || 0;
|
|
12462
12462
|
}
|
|
12463
|
-
get #
|
|
12464
|
-
return this.#
|
|
12463
|
+
get #O() {
|
|
12464
|
+
return this.#R?.attributes?.style?.color || null;
|
|
12465
12465
|
}
|
|
12466
12466
|
#F(t) {
|
|
12467
12467
|
const e = [], s = {
|
|
@@ -12478,7 +12478,7 @@ class jr {
|
|
|
12478
12478
|
}
|
|
12479
12479
|
}, i = {
|
|
12480
12480
|
style: {
|
|
12481
|
-
color: this.#
|
|
12481
|
+
color: this.#O,
|
|
12482
12482
|
fontSize: this.#L ? `calc(${this.#L}px * var(--total-scale-factor))` : ""
|
|
12483
12483
|
}
|
|
12484
12484
|
};
|
|
@@ -12500,7 +12500,7 @@ class jr {
|
|
|
12500
12500
|
deleted: s
|
|
12501
12501
|
}) {
|
|
12502
12502
|
if (this.#t) {
|
|
12503
|
-
s ? (this.remove(), this.#E = null) : e && (e.deleted ? this.remove() : (this.#
|
|
12503
|
+
s ? (this.remove(), this.#E = null) : e && (e.deleted ? this.remove() : (this.#B(), this.#E = e.text)), t && (this.#b = null, this.#P(), this.#M());
|
|
12504
12504
|
return;
|
|
12505
12505
|
}
|
|
12506
12506
|
if (s || e?.deleted) {
|
|
@@ -12557,9 +12557,9 @@ class jr {
|
|
|
12557
12557
|
this.#t.toggleCommentPopup(this, !1);
|
|
12558
12558
|
return;
|
|
12559
12559
|
}
|
|
12560
|
-
this.#p = !this.#p, this.#p ? (this.#
|
|
12560
|
+
this.#p = !this.#p, this.#p ? (this.#I(), this.#n.addEventListener("click", this.#a), this.#n.addEventListener("keydown", this.#e)) : (this.#H(), this.#n.removeEventListener("click", this.#a), this.#n.removeEventListener("keydown", this.#e));
|
|
12561
12561
|
}
|
|
12562
|
-
#
|
|
12562
|
+
#I() {
|
|
12563
12563
|
this.#m || this.render(), this.isVisible ? this.#p && this.#n.classList.add("focused") : (this.#C(), this.#n.hidden = !1, this.#n.style.zIndex = parseInt(this.#n.style.zIndex) + 1e3);
|
|
12564
12564
|
}
|
|
12565
12565
|
#H() {
|
|
@@ -12569,7 +12569,7 @@ class jr {
|
|
|
12569
12569
|
this.#T = this.isVisible, this.#T && (this.#n.hidden = !0);
|
|
12570
12570
|
}
|
|
12571
12571
|
maybeShow() {
|
|
12572
|
-
this.#t || (this.#k(), this.#T && (this.#m || this.#
|
|
12572
|
+
this.#t || (this.#k(), this.#T && (this.#m || this.#I(), this.#T = !1, this.#n.hidden = !1));
|
|
12573
12573
|
}
|
|
12574
12574
|
get isVisible() {
|
|
12575
12575
|
return this.#t ? !1 : this.#n.hidden === !1;
|
|
@@ -13132,7 +13132,7 @@ class zs {
|
|
|
13132
13132
|
} = this, {
|
|
13133
13133
|
id: s,
|
|
13134
13134
|
rotation: i
|
|
13135
|
-
} = t, n = new
|
|
13135
|
+
} = t, n = new Or({
|
|
13136
13136
|
data: {
|
|
13137
13137
|
id: s,
|
|
13138
13138
|
rect: t.getPDFRect(),
|
|
@@ -13231,35 +13231,35 @@ class ht extends D {
|
|
|
13231
13231
|
}
|
|
13232
13232
|
static updateDefaultParams(t, e) {
|
|
13233
13233
|
switch (t) {
|
|
13234
|
-
case
|
|
13234
|
+
case B.FREETEXT_SIZE:
|
|
13235
13235
|
ht._defaultFontSize = e;
|
|
13236
13236
|
break;
|
|
13237
|
-
case
|
|
13237
|
+
case B.FREETEXT_COLOR:
|
|
13238
13238
|
ht._defaultColor = e;
|
|
13239
13239
|
break;
|
|
13240
13240
|
}
|
|
13241
13241
|
}
|
|
13242
13242
|
updateParams(t, e) {
|
|
13243
13243
|
switch (t) {
|
|
13244
|
-
case
|
|
13244
|
+
case B.FREETEXT_SIZE:
|
|
13245
13245
|
this.#a(e);
|
|
13246
13246
|
break;
|
|
13247
|
-
case
|
|
13247
|
+
case B.FREETEXT_COLOR:
|
|
13248
13248
|
this.#r(e);
|
|
13249
13249
|
break;
|
|
13250
13250
|
}
|
|
13251
13251
|
}
|
|
13252
13252
|
static get defaultPropertiesToUpdate() {
|
|
13253
|
-
return [[
|
|
13253
|
+
return [[B.FREETEXT_SIZE, ht._defaultFontSize], [B.FREETEXT_COLOR, ht._defaultColor || D._defaultLineColor]];
|
|
13254
13254
|
}
|
|
13255
13255
|
get propertiesToUpdate() {
|
|
13256
|
-
return [[
|
|
13256
|
+
return [[B.FREETEXT_SIZE, this.#s], [B.FREETEXT_COLOR, this.color]];
|
|
13257
13257
|
}
|
|
13258
13258
|
get toolbarButtons() {
|
|
13259
13259
|
return this._colorPicker ||= new Ce(this), [["colorPicker", this._colorPicker]];
|
|
13260
13260
|
}
|
|
13261
13261
|
get colorType() {
|
|
13262
|
-
return
|
|
13262
|
+
return B.FREETEXT_COLOR;
|
|
13263
13263
|
}
|
|
13264
13264
|
#a(t) {
|
|
13265
13265
|
const e = (i) => {
|
|
@@ -13270,7 +13270,7 @@ class ht extends D {
|
|
|
13270
13270
|
undo: e.bind(this, s),
|
|
13271
13271
|
post: this._uiManager.updateUI.bind(this._uiManager, this),
|
|
13272
13272
|
mustExec: !0,
|
|
13273
|
-
type:
|
|
13273
|
+
type: B.FREETEXT_SIZE,
|
|
13274
13274
|
overwriteIfSameType: !0,
|
|
13275
13275
|
keepUndo: !0
|
|
13276
13276
|
});
|
|
@@ -13287,7 +13287,7 @@ class ht extends D {
|
|
|
13287
13287
|
undo: e.bind(this, s),
|
|
13288
13288
|
post: this._uiManager.updateUI.bind(this._uiManager, this),
|
|
13289
13289
|
mustExec: !0,
|
|
13290
|
-
type:
|
|
13290
|
+
type: B.FREETEXT_COLOR,
|
|
13291
13291
|
overwriteIfSameType: !0,
|
|
13292
13292
|
keepUndo: !0
|
|
13293
13293
|
});
|
|
@@ -13634,7 +13634,7 @@ class ht extends D {
|
|
|
13634
13634
|
super.resetAnnotationElement(t), t.resetEdited();
|
|
13635
13635
|
}
|
|
13636
13636
|
}
|
|
13637
|
-
class
|
|
13637
|
+
class P {
|
|
13638
13638
|
static PRECISION = 1e-4;
|
|
13639
13639
|
toSVGPath() {
|
|
13640
13640
|
j("Abstract method `toSVGPath` must be implemented.");
|
|
@@ -13809,7 +13809,7 @@ class Gt {
|
|
|
13809
13809
|
return t.set([NaN, NaN, NaN, NaN, (s[0] - n) / a, (s[1] - r) / o, NaN, NaN, NaN, NaN, h, l, NaN, NaN, NaN, NaN, c, u, NaN, NaN, NaN, NaN, (i[0] - n) / a, (i[1] - r) / o], e), e += 24;
|
|
13810
13810
|
}
|
|
13811
13811
|
}
|
|
13812
|
-
class Ji extends
|
|
13812
|
+
class Ji extends P {
|
|
13813
13813
|
#t;
|
|
13814
13814
|
#e = new Float32Array(4);
|
|
13815
13815
|
#i;
|
|
@@ -13841,16 +13841,16 @@ class Ji extends M {
|
|
|
13841
13841
|
let o, h;
|
|
13842
13842
|
switch (n) {
|
|
13843
13843
|
case 0:
|
|
13844
|
-
o =
|
|
13844
|
+
o = P._rescale(this.#n, t, i, r, -a), h = P._rescale(this.#a, t, i, r, -a);
|
|
13845
13845
|
break;
|
|
13846
13846
|
case 90:
|
|
13847
|
-
o =
|
|
13847
|
+
o = P._rescaleAndSwap(this.#n, t, e, r, a), h = P._rescaleAndSwap(this.#a, t, e, r, a);
|
|
13848
13848
|
break;
|
|
13849
13849
|
case 180:
|
|
13850
|
-
o =
|
|
13850
|
+
o = P._rescale(this.#n, s, e, -r, a), h = P._rescale(this.#a, s, e, -r, a);
|
|
13851
13851
|
break;
|
|
13852
13852
|
case 270:
|
|
13853
|
-
o =
|
|
13853
|
+
o = P._rescaleAndSwap(this.#n, s, i, -r, -a), h = P._rescaleAndSwap(this.#a, s, i, -r, -a);
|
|
13854
13854
|
break;
|
|
13855
13855
|
}
|
|
13856
13856
|
return {
|
|
@@ -14015,7 +14015,7 @@ class Cs {
|
|
|
14015
14015
|
return n;
|
|
14016
14016
|
}
|
|
14017
14017
|
}
|
|
14018
|
-
class ea extends
|
|
14018
|
+
class ea extends P {
|
|
14019
14019
|
#t;
|
|
14020
14020
|
#e;
|
|
14021
14021
|
constructor(t, e, s, i) {
|
|
@@ -14210,10 +14210,10 @@ class J extends D {
|
|
|
14210
14210
|
}
|
|
14211
14211
|
static updateDefaultParams(t, e) {
|
|
14212
14212
|
switch (t) {
|
|
14213
|
-
case
|
|
14213
|
+
case B.HIGHLIGHT_COLOR:
|
|
14214
14214
|
J._defaultColor = e;
|
|
14215
14215
|
break;
|
|
14216
|
-
case
|
|
14216
|
+
case B.HIGHLIGHT_THICKNESS:
|
|
14217
14217
|
J._defaultThickness = e;
|
|
14218
14218
|
break;
|
|
14219
14219
|
}
|
|
@@ -14228,19 +14228,19 @@ class J extends D {
|
|
|
14228
14228
|
}
|
|
14229
14229
|
updateParams(t, e) {
|
|
14230
14230
|
switch (t) {
|
|
14231
|
-
case
|
|
14231
|
+
case B.HIGHLIGHT_COLOR:
|
|
14232
14232
|
this.#S(e);
|
|
14233
14233
|
break;
|
|
14234
|
-
case
|
|
14234
|
+
case B.HIGHLIGHT_THICKNESS:
|
|
14235
14235
|
this.#_(e);
|
|
14236
14236
|
break;
|
|
14237
14237
|
}
|
|
14238
14238
|
}
|
|
14239
14239
|
static get defaultPropertiesToUpdate() {
|
|
14240
|
-
return [[
|
|
14240
|
+
return [[B.HIGHLIGHT_COLOR, J._defaultColor], [B.HIGHLIGHT_THICKNESS, J._defaultThickness]];
|
|
14241
14241
|
}
|
|
14242
14242
|
get propertiesToUpdate() {
|
|
14243
|
-
return [[
|
|
14243
|
+
return [[B.HIGHLIGHT_COLOR, this.color || J._defaultColor], [B.HIGHLIGHT_THICKNESS, this.#g || J._defaultThickness], [B.HIGHLIGHT_FREE, this.#d]];
|
|
14244
14244
|
}
|
|
14245
14245
|
onUpdatedColor() {
|
|
14246
14246
|
this.parent?.drawLayer.updateProperties(this.#u, {
|
|
@@ -14259,7 +14259,7 @@ class J extends D {
|
|
|
14259
14259
|
undo: e.bind(this, s, i),
|
|
14260
14260
|
post: this._uiManager.updateUI.bind(this._uiManager, this),
|
|
14261
14261
|
mustExec: !0,
|
|
14262
|
-
type:
|
|
14262
|
+
type: B.HIGHLIGHT_COLOR,
|
|
14263
14263
|
overwriteIfSameType: !0,
|
|
14264
14264
|
keepUndo: !0
|
|
14265
14265
|
}), this._reportTelemetry({
|
|
@@ -14276,7 +14276,7 @@ class J extends D {
|
|
|
14276
14276
|
undo: s.bind(this, e),
|
|
14277
14277
|
post: this._uiManager.updateUI.bind(this._uiManager, this),
|
|
14278
14278
|
mustExec: !0,
|
|
14279
|
-
type:
|
|
14279
|
+
type: B.INK_THICKNESS,
|
|
14280
14280
|
overwriteIfSameType: !0,
|
|
14281
14281
|
keepUndo: !0
|
|
14282
14282
|
}), this._reportTelemetry({
|
|
@@ -14296,13 +14296,13 @@ class J extends D {
|
|
|
14296
14296
|
super.enableEditing(), this.div.classList.toggle("disabled", !1);
|
|
14297
14297
|
}
|
|
14298
14298
|
fixAndSetPosition() {
|
|
14299
|
-
return super.fixAndSetPosition(this.#
|
|
14299
|
+
return super.fixAndSetPosition(this.#M());
|
|
14300
14300
|
}
|
|
14301
14301
|
getBaseTranslation() {
|
|
14302
14302
|
return [0, 0];
|
|
14303
14303
|
}
|
|
14304
14304
|
getRect(t, e) {
|
|
14305
|
-
return super.getRect(t, e, this.#
|
|
14305
|
+
return super.getRect(t, e, this.#M());
|
|
14306
14306
|
}
|
|
14307
14307
|
onceAdded(t) {
|
|
14308
14308
|
this.annotationElementId || this.parent.addUndoableEditor(this), t && this.div.focus();
|
|
@@ -14415,15 +14415,15 @@ class J extends D {
|
|
|
14415
14415
|
switch (this.parent.unselect(this), t) {
|
|
14416
14416
|
case 0:
|
|
14417
14417
|
case 2:
|
|
14418
|
-
this.#
|
|
14418
|
+
this.#P(!0);
|
|
14419
14419
|
break;
|
|
14420
14420
|
case 1:
|
|
14421
14421
|
case 3:
|
|
14422
|
-
this.#
|
|
14422
|
+
this.#P(!1);
|
|
14423
14423
|
break;
|
|
14424
14424
|
}
|
|
14425
14425
|
}
|
|
14426
|
-
#
|
|
14426
|
+
#P(t) {
|
|
14427
14427
|
if (!this.#t)
|
|
14428
14428
|
return;
|
|
14429
14429
|
const e = window.getSelection();
|
|
@@ -14442,7 +14442,7 @@ class J extends D {
|
|
|
14442
14442
|
rootClass: {
|
|
14443
14443
|
selected: !1
|
|
14444
14444
|
}
|
|
14445
|
-
}), this.#d || this.#
|
|
14445
|
+
}), this.#d || this.#P(!1));
|
|
14446
14446
|
}
|
|
14447
14447
|
get _mustFixPosition() {
|
|
14448
14448
|
return !this.#d;
|
|
@@ -14458,10 +14458,10 @@ class J extends D {
|
|
|
14458
14458
|
}
|
|
14459
14459
|
}));
|
|
14460
14460
|
}
|
|
14461
|
-
#
|
|
14461
|
+
#M() {
|
|
14462
14462
|
return this.#d ? this.rotation : 0;
|
|
14463
14463
|
}
|
|
14464
|
-
#
|
|
14464
|
+
#B() {
|
|
14465
14465
|
if (this.#d)
|
|
14466
14466
|
return null;
|
|
14467
14467
|
const [t, e] = this.pageDimensions, [s, i] = this.pageTranslation, n = this.#i, r = new Float32Array(n.length * 8);
|
|
@@ -14477,8 +14477,8 @@ class J extends D {
|
|
|
14477
14477
|
}
|
|
14478
14478
|
return r;
|
|
14479
14479
|
}
|
|
14480
|
-
#
|
|
14481
|
-
return this.#h.serialize(t, this.#
|
|
14480
|
+
#R(t) {
|
|
14481
|
+
return this.#h.serialize(t, this.#M());
|
|
14482
14482
|
}
|
|
14483
14483
|
static startHighlighting(t, e, {
|
|
14484
14484
|
target: s,
|
|
@@ -14491,7 +14491,7 @@ class J extends D {
|
|
|
14491
14491
|
width: o,
|
|
14492
14492
|
height: h
|
|
14493
14493
|
} = s.getBoundingClientRect(), l = new AbortController(), c = t.combinedSignal(l), u = (p) => {
|
|
14494
|
-
l.abort(), this.#
|
|
14494
|
+
l.abort(), this.#O(t, p);
|
|
14495
14495
|
};
|
|
14496
14496
|
window.addEventListener("blur", u, {
|
|
14497
14497
|
signal: c
|
|
@@ -14534,7 +14534,7 @@ class J extends D {
|
|
|
14534
14534
|
}
|
|
14535
14535
|
});
|
|
14536
14536
|
}
|
|
14537
|
-
static #
|
|
14537
|
+
static #O(t, e) {
|
|
14538
14538
|
this._freeHighlight.isEmpty() ? t.drawLayer.remove(this._freeHighlightId) : t.createAndAddNewEditor(e, !1, {
|
|
14539
14539
|
highlightId: this._freeHighlightId,
|
|
14540
14540
|
highlightOutlines: this._freeHighlight.getOutlines(),
|
|
@@ -14687,8 +14687,8 @@ class J extends D {
|
|
|
14687
14687
|
color: e,
|
|
14688
14688
|
opacity: this.opacity,
|
|
14689
14689
|
thickness: this.#g,
|
|
14690
|
-
quadPoints: this.#
|
|
14691
|
-
outlines: this.#
|
|
14690
|
+
quadPoints: this.#B(),
|
|
14691
|
+
outlines: this.#R(s.rect)
|
|
14692
14692
|
}), this.addComment(s), this.annotationElementId && !this.#F(s) ? null : (s.id = this.annotationElementId, s);
|
|
14693
14693
|
}
|
|
14694
14694
|
#F(t) {
|
|
@@ -15086,7 +15086,7 @@ class $ extends D {
|
|
|
15086
15086
|
e.drawLayer.updateProperties(i, s.removeLastElement());
|
|
15087
15087
|
},
|
|
15088
15088
|
mustExec: !1,
|
|
15089
|
-
type:
|
|
15089
|
+
type: B.DRAW_STEP
|
|
15090
15090
|
});
|
|
15091
15091
|
return;
|
|
15092
15092
|
}
|
|
@@ -15097,7 +15097,7 @@ class $ extends D {
|
|
|
15097
15097
|
const e = this._currentParent;
|
|
15098
15098
|
if (!e)
|
|
15099
15099
|
return null;
|
|
15100
|
-
if (e.toggleDrawing(!0), e.cleanUndoStack(
|
|
15100
|
+
if (e.toggleDrawing(!0), e.cleanUndoStack(B.DRAW_STEP), !$.#i.isEmpty()) {
|
|
15101
15101
|
const {
|
|
15102
15102
|
pageDimensions: [s, i],
|
|
15103
15103
|
scale: n
|
|
@@ -15154,7 +15154,7 @@ class ia {
|
|
|
15154
15154
|
#r;
|
|
15155
15155
|
#n = "";
|
|
15156
15156
|
#o = 0;
|
|
15157
|
-
#l = new
|
|
15157
|
+
#l = new Ie();
|
|
15158
15158
|
#h;
|
|
15159
15159
|
#u;
|
|
15160
15160
|
constructor(t, e, s, i, n, r) {
|
|
@@ -15169,7 +15169,7 @@ class ia {
|
|
|
15169
15169
|
t === "stroke-width" && (this.#a = e);
|
|
15170
15170
|
}
|
|
15171
15171
|
#d(t, e) {
|
|
15172
|
-
return
|
|
15172
|
+
return P._normalizePoint(t, e, this.#h, this.#u, this.#s);
|
|
15173
15173
|
}
|
|
15174
15174
|
isEmpty() {
|
|
15175
15175
|
return !this.#i || this.#i.length === 0;
|
|
@@ -15184,7 +15184,7 @@ class ia {
|
|
|
15184
15184
|
path: {
|
|
15185
15185
|
d: this.toSVGPath()
|
|
15186
15186
|
}
|
|
15187
|
-
}) : (isNaN(this.#t[0]) && this.#e.splice(6, 6), this.#t.set([s, i, n, r, t, e], 0), this.#e.push(...
|
|
15187
|
+
}) : (isNaN(this.#t[0]) && this.#e.splice(6, 6), this.#t.set([s, i, n, r, t, e], 0), this.#e.push(...P.createBezierPoints(s, i, n, r, t, e)), {
|
|
15188
15188
|
path: {
|
|
15189
15189
|
d: this.toSVGPath()
|
|
15190
15190
|
}
|
|
@@ -15235,7 +15235,7 @@ class ia {
|
|
|
15235
15235
|
};
|
|
15236
15236
|
}
|
|
15237
15237
|
toSVGPath() {
|
|
15238
|
-
const t =
|
|
15238
|
+
const t = P.svgRound(this.#e[4]), e = P.svgRound(this.#e[5]);
|
|
15239
15239
|
if (this.#r.length === 2)
|
|
15240
15240
|
return this.#n = `${this.#n} M ${t} ${e} Z`, this.#n;
|
|
15241
15241
|
if (this.#r.length <= 6) {
|
|
@@ -15243,13 +15243,13 @@ class ia {
|
|
|
15243
15243
|
this.#n = `${this.#n.slice(0, i)} M ${t} ${e}`, this.#o = 6;
|
|
15244
15244
|
}
|
|
15245
15245
|
if (this.#r.length === 4) {
|
|
15246
|
-
const i =
|
|
15246
|
+
const i = P.svgRound(this.#e[10]), n = P.svgRound(this.#e[11]);
|
|
15247
15247
|
return this.#n = `${this.#n} L ${i} ${n}`, this.#o = 12, this.#n;
|
|
15248
15248
|
}
|
|
15249
15249
|
const s = [];
|
|
15250
15250
|
this.#o === 0 && (s.push(`M ${t} ${e}`), this.#o = 6);
|
|
15251
15251
|
for (let i = this.#o, n = this.#e.length; i < n; i += 6) {
|
|
15252
|
-
const [r, a, o, h, l, c] = this.#e.slice(i, i + 6).map(
|
|
15252
|
+
const [r, a, o, h, l, c] = this.#e.slice(i, i + 6).map(P.svgRound);
|
|
15253
15253
|
s.push(`C${r} ${a} ${o} ${h} ${l} ${c}`);
|
|
15254
15254
|
}
|
|
15255
15255
|
return this.#n += s.join(" "), this.#o = this.#e.length, this.#n;
|
|
@@ -15270,7 +15270,7 @@ class ia {
|
|
|
15270
15270
|
};
|
|
15271
15271
|
}
|
|
15272
15272
|
}
|
|
15273
|
-
class
|
|
15273
|
+
class Ie extends P {
|
|
15274
15274
|
#t;
|
|
15275
15275
|
#e = 0;
|
|
15276
15276
|
#i;
|
|
@@ -15305,16 +15305,16 @@ class Re extends M {
|
|
|
15305
15305
|
for (const {
|
|
15306
15306
|
line: e
|
|
15307
15307
|
} of this.#s) {
|
|
15308
|
-
if (t.push(`M${
|
|
15308
|
+
if (t.push(`M${P.svgRound(e[4])} ${P.svgRound(e[5])}`), e.length === 6) {
|
|
15309
15309
|
t.push("Z");
|
|
15310
15310
|
continue;
|
|
15311
15311
|
}
|
|
15312
15312
|
if (e.length === 12 && isNaN(e[6])) {
|
|
15313
|
-
t.push(`L${
|
|
15313
|
+
t.push(`L${P.svgRound(e[10])} ${P.svgRound(e[11])}`);
|
|
15314
15314
|
continue;
|
|
15315
15315
|
}
|
|
15316
15316
|
for (let s = 6, i = e.length; s < i; s += 6) {
|
|
15317
|
-
const [n, r, a, o, h, l] = e.subarray(s, s + 6).map(
|
|
15317
|
+
const [n, r, a, o, h, l] = e.subarray(s, s + 6).map(P.svgRound);
|
|
15318
15318
|
t.push(`C${n} ${r} ${a} ${o} ${h} ${l}`);
|
|
15319
15319
|
}
|
|
15320
15320
|
}
|
|
@@ -15325,16 +15325,16 @@ class Re extends M {
|
|
|
15325
15325
|
let u, p, f, g, b, m, w, y, v;
|
|
15326
15326
|
switch (this.#o) {
|
|
15327
15327
|
case 0:
|
|
15328
|
-
v =
|
|
15328
|
+
v = P._rescale, u = t, p = e + i, f = s, g = -i, b = t + o * s, m = e + (1 - h - c) * i, w = t + (o + l) * s, y = e + (1 - h) * i;
|
|
15329
15329
|
break;
|
|
15330
15330
|
case 90:
|
|
15331
|
-
v =
|
|
15331
|
+
v = P._rescaleAndSwap, u = t, p = e, f = s, g = i, b = t + h * s, m = e + o * i, w = t + (h + c) * s, y = e + (o + l) * i;
|
|
15332
15332
|
break;
|
|
15333
15333
|
case 180:
|
|
15334
|
-
v =
|
|
15334
|
+
v = P._rescale, u = t + s, p = e, f = -s, g = i, b = t + (1 - o - l) * s, m = e + h * i, w = t + (1 - o) * s, y = e + (h + c) * i;
|
|
15335
15335
|
break;
|
|
15336
15336
|
case 270:
|
|
15337
|
-
v =
|
|
15337
|
+
v = P._rescaleAndSwap, u = t + s, p = e + i, f = -s, g = -i, b = t + (1 - h - c) * s, m = e + (1 - o - l) * i, w = t + (1 - h) * s, y = e + (1 - o) * i;
|
|
15338
15338
|
break;
|
|
15339
15339
|
}
|
|
15340
15340
|
for (const {
|
|
@@ -15360,16 +15360,16 @@ class Re extends M {
|
|
|
15360
15360
|
let c, u, p, f, g;
|
|
15361
15361
|
switch (o) {
|
|
15362
15362
|
case 0:
|
|
15363
|
-
g =
|
|
15363
|
+
g = P._rescale, c = -t / s, u = e / i + 1, p = 1 / s, f = -1 / i;
|
|
15364
15364
|
break;
|
|
15365
15365
|
case 90:
|
|
15366
|
-
g =
|
|
15366
|
+
g = P._rescaleAndSwap, c = -e / i, u = -t / s, p = 1 / i, f = 1 / s;
|
|
15367
15367
|
break;
|
|
15368
15368
|
case 180:
|
|
15369
|
-
g =
|
|
15369
|
+
g = P._rescale, c = t / s + 1, u = -e / i, p = -1 / s, f = 1 / i;
|
|
15370
15370
|
break;
|
|
15371
15371
|
case 270:
|
|
15372
|
-
g =
|
|
15372
|
+
g = P._rescaleAndSwap, c = e / i + 1, u = t / s + 1, p = -1 / i, f = -1 / s;
|
|
15373
15373
|
break;
|
|
15374
15374
|
}
|
|
15375
15375
|
if (!r) {
|
|
@@ -15389,8 +15389,8 @@ class Re extends M {
|
|
|
15389
15389
|
let [v, A, x, _] = m.subarray(0, 4);
|
|
15390
15390
|
y.set([NaN, NaN, NaN, NaN, v, A], 0);
|
|
15391
15391
|
for (let E = 4; E < w; E += 2) {
|
|
15392
|
-
const S = m[E],
|
|
15393
|
-
y.set(
|
|
15392
|
+
const S = m[E], M = m[E + 1];
|
|
15393
|
+
y.set(P.createBezierPoints(v, A, x, _, S, M), (E - 2) * 3), [v, A, x, _] = [x, _, S, M];
|
|
15394
15394
|
}
|
|
15395
15395
|
}
|
|
15396
15396
|
}
|
|
@@ -15455,7 +15455,7 @@ class Re extends M {
|
|
|
15455
15455
|
};
|
|
15456
15456
|
}
|
|
15457
15457
|
get viewBox() {
|
|
15458
|
-
return this.#t.map(
|
|
15458
|
+
return this.#t.map(P.svgRound).join(" ");
|
|
15459
15459
|
}
|
|
15460
15460
|
get defaultProperties() {
|
|
15461
15461
|
const [t, e] = this.#t;
|
|
@@ -15464,7 +15464,7 @@ class Re extends M {
|
|
|
15464
15464
|
viewBox: this.viewBox
|
|
15465
15465
|
},
|
|
15466
15466
|
path: {
|
|
15467
|
-
"transform-origin": `${
|
|
15467
|
+
"transform-origin": `${P.svgRound(t)} ${P.svgRound(e)}`
|
|
15468
15468
|
}
|
|
15469
15469
|
};
|
|
15470
15470
|
}
|
|
@@ -15484,15 +15484,15 @@ class Re extends M {
|
|
|
15484
15484
|
default:
|
|
15485
15485
|
return "";
|
|
15486
15486
|
}
|
|
15487
|
-
return `matrix(${s} ${i} ${n} ${r} ${
|
|
15487
|
+
return `matrix(${s} ${i} ${n} ${r} ${P.svgRound(a)} ${P.svgRound(o)})`;
|
|
15488
15488
|
}
|
|
15489
15489
|
getPathResizingSVGProperties([t, e, s, i]) {
|
|
15490
15490
|
const [n, r] = this.#h(), [a, o, h, l] = this.#t;
|
|
15491
|
-
if (Math.abs(h - n) <=
|
|
15491
|
+
if (Math.abs(h - n) <= P.PRECISION || Math.abs(l - r) <= P.PRECISION) {
|
|
15492
15492
|
const g = t + s / 2 - (a + h / 2), b = e + i / 2 - (o + l / 2);
|
|
15493
15493
|
return {
|
|
15494
15494
|
path: {
|
|
15495
|
-
"transform-origin": `${
|
|
15495
|
+
"transform-origin": `${P.svgRound(t)} ${P.svgRound(e)}`,
|
|
15496
15496
|
transform: `${this.rotationTransform} translate(${g} ${b})`
|
|
15497
15497
|
}
|
|
15498
15498
|
};
|
|
@@ -15500,26 +15500,26 @@ class Re extends M {
|
|
|
15500
15500
|
const c = (s - 2 * n) / (h - 2 * n), u = (i - 2 * r) / (l - 2 * r), p = h / s, f = l / i;
|
|
15501
15501
|
return {
|
|
15502
15502
|
path: {
|
|
15503
|
-
"transform-origin": `${
|
|
15504
|
-
transform: `${this.rotationTransform} scale(${p} ${f}) translate(${
|
|
15503
|
+
"transform-origin": `${P.svgRound(a)} ${P.svgRound(o)}`,
|
|
15504
|
+
transform: `${this.rotationTransform} scale(${p} ${f}) translate(${P.svgRound(n)} ${P.svgRound(r)}) scale(${c} ${u}) translate(${P.svgRound(-n)} ${P.svgRound(-r)})`
|
|
15505
15505
|
}
|
|
15506
15506
|
};
|
|
15507
15507
|
}
|
|
15508
15508
|
getPathResizedSVGProperties([t, e, s, i]) {
|
|
15509
15509
|
const [n, r] = this.#h(), a = this.#t, [o, h, l, c] = a;
|
|
15510
|
-
if (a[0] = t, a[1] = e, a[2] = s, a[3] = i, Math.abs(l - n) <=
|
|
15510
|
+
if (a[0] = t, a[1] = e, a[2] = s, a[3] = i, Math.abs(l - n) <= P.PRECISION || Math.abs(c - r) <= P.PRECISION) {
|
|
15511
15511
|
const b = t + s / 2 - (o + l / 2), m = e + i / 2 - (h + c / 2);
|
|
15512
15512
|
for (const {
|
|
15513
15513
|
line: w,
|
|
15514
15514
|
points: y
|
|
15515
15515
|
} of this.#s)
|
|
15516
|
-
|
|
15516
|
+
P._translate(w, b, m, w), P._translate(y, b, m, y);
|
|
15517
15517
|
return {
|
|
15518
15518
|
root: {
|
|
15519
15519
|
viewBox: this.viewBox
|
|
15520
15520
|
},
|
|
15521
15521
|
path: {
|
|
15522
|
-
"transform-origin": `${
|
|
15522
|
+
"transform-origin": `${P.svgRound(t)} ${P.svgRound(e)}`,
|
|
15523
15523
|
transform: this.rotationTransform || null,
|
|
15524
15524
|
d: this.toSVGPath()
|
|
15525
15525
|
}
|
|
@@ -15531,13 +15531,13 @@ class Re extends M {
|
|
|
15531
15531
|
line: b,
|
|
15532
15532
|
points: m
|
|
15533
15533
|
} of this.#s)
|
|
15534
|
-
|
|
15534
|
+
P._rescale(b, f, g, u, p, b), P._rescale(m, f, g, u, p, m);
|
|
15535
15535
|
return {
|
|
15536
15536
|
root: {
|
|
15537
15537
|
viewBox: this.viewBox
|
|
15538
15538
|
},
|
|
15539
15539
|
path: {
|
|
15540
|
-
"transform-origin": `${
|
|
15540
|
+
"transform-origin": `${P.svgRound(t)} ${P.svgRound(e)}`,
|
|
15541
15541
|
transform: this.rotationTransform || null,
|
|
15542
15542
|
d: this.toSVGPath()
|
|
15543
15543
|
}
|
|
@@ -15550,7 +15550,7 @@ class Re extends M {
|
|
|
15550
15550
|
line: h,
|
|
15551
15551
|
points: l
|
|
15552
15552
|
} of this.#s)
|
|
15553
|
-
|
|
15553
|
+
P._translate(h, a, o, h), P._translate(l, a, o, l);
|
|
15554
15554
|
else {
|
|
15555
15555
|
const h = this.#a / i, l = this.#r / n;
|
|
15556
15556
|
this.#a = i, this.#r = n;
|
|
@@ -15558,7 +15558,7 @@ class Re extends M {
|
|
|
15558
15558
|
line: c,
|
|
15559
15559
|
points: u
|
|
15560
15560
|
} of this.#s)
|
|
15561
|
-
|
|
15561
|
+
P._rescale(c, a, o, h, l, c), P._rescale(u, a, o, h, l, u);
|
|
15562
15562
|
r[2] *= h, r[3] *= l;
|
|
15563
15563
|
}
|
|
15564
15564
|
return r[0] = t, r[1] = e, {
|
|
@@ -15567,7 +15567,7 @@ class Re extends M {
|
|
|
15567
15567
|
},
|
|
15568
15568
|
path: {
|
|
15569
15569
|
d: this.toSVGPath(),
|
|
15570
|
-
"transform-origin": `${
|
|
15570
|
+
"transform-origin": `${P.svgRound(t)} ${P.svgRound(e)}`
|
|
15571
15571
|
}
|
|
15572
15572
|
};
|
|
15573
15573
|
}
|
|
@@ -15582,7 +15582,7 @@ class Re extends M {
|
|
|
15582
15582
|
},
|
|
15583
15583
|
path: {
|
|
15584
15584
|
d: this.toSVGPath(),
|
|
15585
|
-
"transform-origin": `${
|
|
15585
|
+
"transform-origin": `${P.svgRound(t[0])} ${P.svgRound(t[1])}`,
|
|
15586
15586
|
transform: this.rotationTransform || null
|
|
15587
15587
|
},
|
|
15588
15588
|
bbox: t
|
|
@@ -15630,13 +15630,13 @@ class Us extends $ {
|
|
|
15630
15630
|
return !0;
|
|
15631
15631
|
}
|
|
15632
15632
|
static get typesMap() {
|
|
15633
|
-
return L(this, "typesMap", /* @__PURE__ */ new Map([[
|
|
15633
|
+
return L(this, "typesMap", /* @__PURE__ */ new Map([[B.INK_THICKNESS, "stroke-width"], [B.INK_COLOR, "stroke"], [B.INK_OPACITY, "stroke-opacity"]]));
|
|
15634
15634
|
}
|
|
15635
15635
|
static createDrawerInstance(t, e, s, i, n) {
|
|
15636
15636
|
return new ia(t, e, s, i, n, this._defaultDrawingOptions["stroke-width"]);
|
|
15637
15637
|
}
|
|
15638
15638
|
static deserializeDraw(t, e, s, i, n, r) {
|
|
15639
|
-
return
|
|
15639
|
+
return Ie.deserialize(t, e, s, i, n, r);
|
|
15640
15640
|
}
|
|
15641
15641
|
static async deserialize(t, e, s) {
|
|
15642
15642
|
let i = null;
|
|
@@ -15693,7 +15693,7 @@ class Us extends $ {
|
|
|
15693
15693
|
return this._colorPicker ||= new Ce(this), [["colorPicker", this._colorPicker]];
|
|
15694
15694
|
}
|
|
15695
15695
|
get colorType() {
|
|
15696
|
-
return
|
|
15696
|
+
return B.INK_COLOR;
|
|
15697
15697
|
}
|
|
15698
15698
|
get color() {
|
|
15699
15699
|
return this._drawingOptions.stroke;
|
|
@@ -15776,7 +15776,7 @@ class Us extends $ {
|
|
|
15776
15776
|
}), null;
|
|
15777
15777
|
}
|
|
15778
15778
|
}
|
|
15779
|
-
class
|
|
15779
|
+
class Ps extends Ie {
|
|
15780
15780
|
toSVGPath() {
|
|
15781
15781
|
let t = super.toSVGPath();
|
|
15782
15782
|
return t.endsWith("Z") || (t += "Z"), t;
|
|
@@ -15859,18 +15859,18 @@ class te {
|
|
|
15859
15859
|
let A = this.#i[2 * v], x = this.#i[2 * v + 1];
|
|
15860
15860
|
const _ = l + A, E = c + x;
|
|
15861
15861
|
f = _, g = E;
|
|
15862
|
-
let S = l,
|
|
15862
|
+
let S = l, M = c;
|
|
15863
15863
|
for (; ; ) {
|
|
15864
|
-
const C = this.#a(r, e, S,
|
|
15864
|
+
const C = this.#a(r, e, S, M, f, g, 1);
|
|
15865
15865
|
A = this.#i[2 * C], x = this.#i[2 * C + 1];
|
|
15866
|
-
const H = S + A, V =
|
|
15866
|
+
const H = S + A, V = M + x;
|
|
15867
15867
|
b.push(V, H);
|
|
15868
|
-
const N = S * e +
|
|
15869
|
-
if (r[N + 1] === 0 ? r[N] = -a : r[N] === 1 && (r[N] = a), H === l && V === c && S === _ &&
|
|
15868
|
+
const N = S * e + M;
|
|
15869
|
+
if (r[N + 1] === 0 ? r[N] = -a : r[N] === 1 && (r[N] = a), H === l && V === c && S === _ && M === E) {
|
|
15870
15870
|
r[u] !== 1 && (o = Math.abs(r[u]));
|
|
15871
15871
|
break;
|
|
15872
15872
|
} else
|
|
15873
|
-
f = S, g =
|
|
15873
|
+
f = S, g = M, S = H, M = V;
|
|
15874
15874
|
}
|
|
15875
15875
|
}
|
|
15876
15876
|
}
|
|
@@ -15916,8 +15916,8 @@ class te {
|
|
|
15916
15916
|
const S = b + E - h;
|
|
15917
15917
|
if (S < 0 || S >= e)
|
|
15918
15918
|
continue;
|
|
15919
|
-
const
|
|
15920
|
-
y +=
|
|
15919
|
+
const M = t[_ * e + S], C = a[x * r + E] * l[Math.abs(M - w)];
|
|
15920
|
+
y += M * C, v += C;
|
|
15921
15921
|
}
|
|
15922
15922
|
}
|
|
15923
15923
|
const A = p[m] = Math.round(y / v);
|
|
@@ -16003,10 +16003,10 @@ class te {
|
|
|
16003
16003
|
alpha: !0,
|
|
16004
16004
|
willReadFrequently: !0
|
|
16005
16005
|
}), l.font = u, l.filter = "grayscale(1)", l.fillStyle = "white", l.fillRect(0, 0, A, x), l.fillStyle = "black", l.fillText(t, A * (v - 1) / 2, x * (3 - v) / 2);
|
|
16006
|
-
const _ = this.#u(l.getImageData(0, 0, A, x).data), E = this.#h(_), S = this.#d(E),
|
|
16006
|
+
const _ = this.#u(l.getImageData(0, 0, A, x).data), E = this.#h(_), S = this.#d(E), M = this.#r(_, A, x, S);
|
|
16007
16007
|
return this.processDrawnLines({
|
|
16008
16008
|
lines: {
|
|
16009
|
-
curves:
|
|
16009
|
+
curves: M,
|
|
16010
16010
|
width: A,
|
|
16011
16011
|
height: x
|
|
16012
16012
|
},
|
|
@@ -16064,16 +16064,16 @@ class te {
|
|
|
16064
16064
|
A[0] = y[0] * f, A[1] = y[1] * g, x.set([NaN, NaN, NaN, NaN, A[0], A[1]], 0);
|
|
16065
16065
|
continue;
|
|
16066
16066
|
}
|
|
16067
|
-
let [_, E, S,
|
|
16068
|
-
_ *= f, E *= g, S *= f,
|
|
16067
|
+
let [_, E, S, M] = y;
|
|
16068
|
+
_ *= f, E *= g, S *= f, M *= g, A.set([_, E, S, M], 0), x.set([NaN, NaN, NaN, NaN, _, E], 0);
|
|
16069
16069
|
for (let C = 4; C < v; C += 2) {
|
|
16070
16070
|
const H = A[C] = y[C] * f, V = A[C + 1] = y[C + 1] * g;
|
|
16071
|
-
x.set(
|
|
16071
|
+
x.set(P.createBezierPoints(_, E, S, M, H, V), (C - 2) * 3), [_, E, S, M] = [S, M, H, V];
|
|
16072
16072
|
}
|
|
16073
16073
|
}
|
|
16074
16074
|
if (u.length === 0)
|
|
16075
16075
|
return null;
|
|
16076
|
-
const m = a ? new
|
|
16076
|
+
const m = a ? new Ps() : new Ie();
|
|
16077
16077
|
return m.build(u, e, s, 1, i, a ? 0 : c, n), {
|
|
16078
16078
|
outline: m,
|
|
16079
16079
|
newCurves: b,
|
|
@@ -16164,7 +16164,7 @@ class te {
|
|
|
16164
16164
|
height: c
|
|
16165
16165
|
};
|
|
16166
16166
|
} catch (e) {
|
|
16167
|
-
return
|
|
16167
|
+
return I(`decompressSignature: ${e}`), null;
|
|
16168
16168
|
}
|
|
16169
16169
|
}
|
|
16170
16170
|
}
|
|
@@ -16338,7 +16338,7 @@ class Tt extends $ {
|
|
|
16338
16338
|
} = this, {
|
|
16339
16339
|
outline: a
|
|
16340
16340
|
} = this.#i = t;
|
|
16341
|
-
this.#t = a instanceof
|
|
16341
|
+
this.#t = a instanceof Ps, this.description = s;
|
|
16342
16342
|
let o;
|
|
16343
16343
|
this.#t ? o = Tt.getDefaultDrawingOptions() : (o = Tt._defaultDrawnSignatureOptions.clone(), o.updateProperties({
|
|
16344
16344
|
"stroke-width": a.thickness
|
|
@@ -16427,7 +16427,7 @@ class Tt extends $ {
|
|
|
16427
16427
|
}), n;
|
|
16428
16428
|
}
|
|
16429
16429
|
static deserializeDraw(t, e, s, i, n, r) {
|
|
16430
|
-
return r.areContours ?
|
|
16430
|
+
return r.areContours ? Ps.deserialize(t, e, s, i, n, r) : Ie.deserialize(t, e, s, i, n, r);
|
|
16431
16431
|
}
|
|
16432
16432
|
static async deserialize(t, e, s) {
|
|
16433
16433
|
const i = await super.deserialize(t, e, s);
|
|
@@ -16773,13 +16773,13 @@ class na extends D {
|
|
|
16773
16773
|
pageNumber: S
|
|
16774
16774
|
}
|
|
16775
16775
|
},
|
|
16776
|
-
canvas:
|
|
16776
|
+
canvas: M
|
|
16777
16777
|
} = t;
|
|
16778
16778
|
let C, H;
|
|
16779
|
-
|
|
16779
|
+
M ? (delete t.canvas, {
|
|
16780
16780
|
id: C,
|
|
16781
16781
|
bitmap: H
|
|
16782
|
-
} = s.imageManager.getFromCanvas(E.id,
|
|
16782
|
+
} = s.imageManager.getFromCanvas(E.id, M), M.remove()) : (n = !0, t._hasNoCanvas = !0);
|
|
16783
16783
|
const V = (await e._structTree.getAriaAttributes(`${ee}${m}`))?.get("aria-label") || "";
|
|
16784
16784
|
i = t = {
|
|
16785
16785
|
annotationType: F.STAMP,
|
|
@@ -17506,11 +17506,11 @@ globalThis._pdfjsTestingUtils = {
|
|
|
17506
17506
|
globalThis.pdfjsLib = {
|
|
17507
17507
|
AbortException: $t,
|
|
17508
17508
|
AnnotationEditorLayer: Lt,
|
|
17509
|
-
AnnotationEditorParamsType:
|
|
17509
|
+
AnnotationEditorParamsType: B,
|
|
17510
17510
|
AnnotationEditorType: F,
|
|
17511
17511
|
AnnotationEditorUIManager: zt,
|
|
17512
17512
|
AnnotationLayer: zs,
|
|
17513
|
-
AnnotationMode:
|
|
17513
|
+
AnnotationMode: Ot,
|
|
17514
17514
|
AnnotationType: it,
|
|
17515
17515
|
applyOpacity: Tn,
|
|
17516
17516
|
build: Lr,
|
|
@@ -17520,8 +17520,8 @@ globalThis.pdfjsLib = {
|
|
|
17520
17520
|
DOMSVGFactory: Xe,
|
|
17521
17521
|
DrawLayer: lt,
|
|
17522
17522
|
FeatureTest: at,
|
|
17523
|
-
fetchData:
|
|
17524
|
-
findContrastColor:
|
|
17523
|
+
fetchData: Pe,
|
|
17524
|
+
findContrastColor: Pn,
|
|
17525
17525
|
getDocument: Ui,
|
|
17526
17526
|
getFilenameFromUrl: vn,
|
|
17527
17527
|
getPdfFilenameFromUrl: An,
|
|
@@ -18059,7 +18059,7 @@ class da {
|
|
|
18059
18059
|
eventBus: this.eventBus,
|
|
18060
18060
|
pageDimensions: e
|
|
18061
18061
|
});
|
|
18062
|
-
const s = this.fields.filter((i) => i.
|
|
18062
|
+
const s = this.fields.filter((i) => i.pageNumber === t + 1);
|
|
18063
18063
|
this.pageView.setFields(s), this.pdfDocument.getPage(this.currentPage).then((i) => {
|
|
18064
18064
|
this.pageView && this.pageView.pageIndex === i.pageNumber - 1 && this.pageView.setPdfPage(i);
|
|
18065
18065
|
}).catch((i) => {
|
|
@@ -18094,7 +18094,7 @@ class da {
|
|
|
18094
18094
|
}
|
|
18095
18095
|
setFields(t) {
|
|
18096
18096
|
if (this.fields = t, this.pageView) {
|
|
18097
|
-
const e = this.fields.filter((s) => s.
|
|
18097
|
+
const e = this.fields.filter((s) => s.pageNumber === this.currentPage);
|
|
18098
18098
|
this.pageView.setFields(e);
|
|
18099
18099
|
}
|
|
18100
18100
|
}
|
|
@@ -18131,7 +18131,7 @@ class ua {
|
|
|
18131
18131
|
eventBus: this.eventBus,
|
|
18132
18132
|
pageDimensions: e
|
|
18133
18133
|
// Pass dimensions immediately
|
|
18134
|
-
}), i = this.fields.filter((n) => n.
|
|
18134
|
+
}), i = this.fields.filter((n) => n.pageNumber === t);
|
|
18135
18135
|
s.setFields(i), this.pageViews.push(s);
|
|
18136
18136
|
}
|
|
18137
18137
|
this.pageViews.forEach(async (t, e) => {
|
|
@@ -18204,7 +18204,7 @@ class ua {
|
|
|
18204
18204
|
}
|
|
18205
18205
|
setFields(t) {
|
|
18206
18206
|
this.fields = t, this.pageViews.forEach((e) => {
|
|
18207
|
-
const s = this.fields.filter((i) => i.
|
|
18207
|
+
const s = this.fields.filter((i) => i.pageNumber === e.pageIndex + 1);
|
|
18208
18208
|
e.setFields(s);
|
|
18209
18209
|
});
|
|
18210
18210
|
}
|
|
@@ -18294,6 +18294,29 @@ class pa {
|
|
|
18294
18294
|
getScale() {
|
|
18295
18295
|
return this.currentScale;
|
|
18296
18296
|
}
|
|
18297
|
+
/**
|
|
18298
|
+
* Get dimensions of a specific page in PDF points
|
|
18299
|
+
* @param pageIndex - Zero-based page index
|
|
18300
|
+
* @returns Page dimensions { width: number, height: number } or null if page doesn't exist
|
|
18301
|
+
*/
|
|
18302
|
+
async getPageDimensions(t) {
|
|
18303
|
+
if (!this.pdfDocument)
|
|
18304
|
+
throw new Error("PDF not loaded");
|
|
18305
|
+
if (t < 0 || t >= this.pdfDocument.numPages)
|
|
18306
|
+
return null;
|
|
18307
|
+
const e = this.pageInfo.get(t);
|
|
18308
|
+
if (e)
|
|
18309
|
+
return { width: e.width, height: e.height };
|
|
18310
|
+
try {
|
|
18311
|
+
const s = (await this.pdfDocument.getPage(t + 1)).getViewport({ scale: 1 }), i = {
|
|
18312
|
+
width: s.width,
|
|
18313
|
+
height: s.height
|
|
18314
|
+
};
|
|
18315
|
+
return this.pageInfo.set(t, i), i;
|
|
18316
|
+
} catch (s) {
|
|
18317
|
+
return console.error(`Failed to get dimensions for page ${t}:`, s), null;
|
|
18318
|
+
}
|
|
18319
|
+
}
|
|
18297
18320
|
// Field Management
|
|
18298
18321
|
fields = [];
|
|
18299
18322
|
setFields(t) {
|
|
@@ -18307,15 +18330,15 @@ class pa {
|
|
|
18307
18330
|
throw new Error("PDF document not loaded");
|
|
18308
18331
|
if (!this.strategy)
|
|
18309
18332
|
throw new Error("PDF viewer not ready. Please wait for PDF to fully load.");
|
|
18310
|
-
if (this.readyPromise && await this.readyPromise, t.
|
|
18311
|
-
throw new Error(`Invalid page
|
|
18333
|
+
if (this.readyPromise && await this.readyPromise, t.pageNumber < 1 || t.pageNumber > this.pdfDocument.numPages)
|
|
18334
|
+
throw new Error(`Invalid page number: ${t.pageNumber}. Document has ${this.pdfDocument.numPages} pages.`);
|
|
18312
18335
|
if (t.rect.width <= 0 || t.rect.height <= 0)
|
|
18313
18336
|
throw new Error("Field width and height must be greater than 0");
|
|
18314
18337
|
try {
|
|
18315
|
-
let e = this.pageInfo.get(t.
|
|
18338
|
+
let e = this.pageInfo.get(t.pageNumber - 1);
|
|
18316
18339
|
if (!e) {
|
|
18317
|
-
const s = (await this.pdfDocument.getPage(t.
|
|
18318
|
-
this.pageInfo.set(t.
|
|
18340
|
+
const s = (await this.pdfDocument.getPage(t.pageNumber)).getViewport({ scale: 1 });
|
|
18341
|
+
this.pageInfo.set(t.pageNumber - 1, { width: s.width, height: s.height }), e = { width: s.width, height: s.height };
|
|
18319
18342
|
}
|
|
18320
18343
|
if (t.rect.x < 0 || t.rect.y < 0)
|
|
18321
18344
|
throw new Error("Field position out of bounds (negative coordinates).");
|
|
@@ -18343,7 +18366,7 @@ class pa {
|
|
|
18343
18366
|
const v = Array.from(this.container.querySelectorAll(".page-view"));
|
|
18344
18367
|
let A = 1 / 0, x = null;
|
|
18345
18368
|
if (v.forEach((_) => {
|
|
18346
|
-
const E = _.getBoundingClientRect(), S = Math.max(E.left, Math.min(i, E.right)),
|
|
18369
|
+
const E = _.getBoundingClientRect(), S = Math.max(E.left, Math.min(i, E.right)), M = Math.max(E.top, Math.min(n, E.bottom)), C = i - S, H = n - M, V = Math.sqrt(C * C + H * H);
|
|
18347
18370
|
V < A && (A = V, x = _);
|
|
18348
18371
|
}), x)
|
|
18349
18372
|
a = x;
|
|
@@ -18357,10 +18380,10 @@ class pa {
|
|
|
18357
18380
|
this.strategy?.setFields(this.fields);
|
|
18358
18381
|
return;
|
|
18359
18382
|
}
|
|
18360
|
-
const h = parseInt(o, 10), l = a.getBoundingClientRect(), c = this.currentScale, u = i - l.left, p = n - l.top, f = l.height / c, g = l.width / c, b = r.rect.width, m = r.rect.height;
|
|
18383
|
+
const h = parseInt(o, 10) + 1, l = a.getBoundingClientRect(), c = this.currentScale, u = i - l.left, p = n - l.top, f = l.height / c, g = l.width / c, b = r.rect.width, m = r.rect.height;
|
|
18361
18384
|
let w = u / c, y = f - p / c - m;
|
|
18362
18385
|
w = Math.max(0, Math.min(w, g - b)), y = Math.max(0, Math.min(y, f - m)), this.updateField(t, {
|
|
18363
|
-
|
|
18386
|
+
pageNumber: h,
|
|
18364
18387
|
rect: {
|
|
18365
18388
|
...r.rect,
|
|
18366
18389
|
x: w,
|
|
@@ -18444,7 +18467,7 @@ class pa {
|
|
|
18444
18467
|
const u = document.createElement("div");
|
|
18445
18468
|
u.className = "print-page";
|
|
18446
18469
|
const p = document.createElement("img");
|
|
18447
|
-
p.src = l.toDataURL("image/jpeg", 0.8), u.appendChild(p), t?.withSignatures && this.fields.filter((f) => f.
|
|
18470
|
+
p.src = l.toDataURL("image/jpeg", 0.8), u.appendChild(p), t?.withSignatures && this.fields.filter((f) => f.pageNumber === a).forEach((f) => {
|
|
18448
18471
|
const g = document.createElement("div");
|
|
18449
18472
|
g.className = "print-field select-none";
|
|
18450
18473
|
const b = o.getViewport({ scale: 1 }), m = f.rect.x / b.width * 100, w = (b.height - f.rect.y - f.rect.height) / b.height * 100, y = f.rect.width / b.width * 100, v = f.rect.height / b.height * 100;
|
|
@@ -18514,6 +18537,9 @@ class ga {
|
|
|
18514
18537
|
getScale() {
|
|
18515
18538
|
return this.viewer.getScale();
|
|
18516
18539
|
}
|
|
18540
|
+
async getPageDimensions(t) {
|
|
18541
|
+
return this.viewer.getPageDimensions(t - 1);
|
|
18542
|
+
}
|
|
18517
18543
|
// Event handling
|
|
18518
18544
|
on(t, e) {
|
|
18519
18545
|
this.viewer.on(t, e);
|