@shznet/pdf-sign-react 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -1
- package/dist/index.js +313 -204
- package/dist/lib/pdf-sign-react.d.ts +7 -0
- package/dist/lib/pdf-sign-react.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as an } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as on, useRef as rs, useImperativeHandle as hn, useEffect as
|
|
2
|
+
import { forwardRef as on, useRef as rs, useImperativeHandle as hn, useEffect as Kt } from "react";
|
|
3
3
|
var vi = (c) => {
|
|
4
4
|
throw TypeError(c);
|
|
5
5
|
}, Ds = (c, t, e) => t.has(c) || vi("Cannot " + e), Y = (c, t, e) => (Ds(c, t, "read from private field"), e ? e.call(c) : t.get(c)), Ft = (c, t, e) => t.has(c) ? vi("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(c) : t.set(c, e), mt = (c, t, e, s) => (Ds(c, t, "write to private field"), t.set(c, e), e), It = (c, t, e) => (Ds(c, t, "access private method"), e), ln = (c, t, e, s) => ({
|
|
@@ -164,7 +164,7 @@ const dt = typeof process == "object" && process + "" == "[object process]" && !
|
|
|
164
164
|
INVISIBLE: 3,
|
|
165
165
|
FILL_STROKE_MASK: 3,
|
|
166
166
|
ADD_TO_PATH_FLAG: 4
|
|
167
|
-
},
|
|
167
|
+
}, je = {
|
|
168
168
|
GRAYSCALE_1BPP: 1,
|
|
169
169
|
RGB_24BPP: 2,
|
|
170
170
|
RGBA_32BPP: 3
|
|
@@ -195,7 +195,7 @@ const dt = typeof process == "object" && process + "" == "[object process]" && !
|
|
|
195
195
|
WATERMARK: 24,
|
|
196
196
|
THREED: 25,
|
|
197
197
|
REDACT: 26
|
|
198
|
-
},
|
|
198
|
+
}, Zt = {
|
|
199
199
|
SOLID: 1,
|
|
200
200
|
DASHED: 2,
|
|
201
201
|
BEVELED: 3,
|
|
@@ -320,11 +320,11 @@ function Je(c) {
|
|
|
320
320
|
function I(c) {
|
|
321
321
|
Qe >= Ke.WARNINGS && console.warn(`Warning: ${c}`);
|
|
322
322
|
}
|
|
323
|
-
function
|
|
323
|
+
function j(c) {
|
|
324
324
|
throw new Error(c);
|
|
325
325
|
}
|
|
326
326
|
function B(c, t) {
|
|
327
|
-
c ||
|
|
327
|
+
c || j(t);
|
|
328
328
|
}
|
|
329
329
|
function mn(c) {
|
|
330
330
|
switch (c?.protocol) {
|
|
@@ -398,7 +398,7 @@ class $t extends Xt {
|
|
|
398
398
|
}
|
|
399
399
|
}
|
|
400
400
|
function _i(c) {
|
|
401
|
-
(typeof c != "object" || c?.length === void 0) &&
|
|
401
|
+
(typeof c != "object" || c?.length === void 0) && j("Invalid argument for bytesToString");
|
|
402
402
|
const t = c.length, e = 8192;
|
|
403
403
|
if (t < e)
|
|
404
404
|
return String.fromCharCode.apply(null, c);
|
|
@@ -410,7 +410,7 @@ function _i(c) {
|
|
|
410
410
|
return s.join("");
|
|
411
411
|
}
|
|
412
412
|
function Me(c) {
|
|
413
|
-
typeof c != "string" &&
|
|
413
|
+
typeof c != "string" && j("Invalid argument for stringToBytes");
|
|
414
414
|
const t = c.length, e = new Uint8Array(t);
|
|
415
415
|
for (let s = 0; s < t; ++s)
|
|
416
416
|
e[s] = c.charCodeAt(s) & 255;
|
|
@@ -567,7 +567,7 @@ function Si() {
|
|
|
567
567
|
const c = new Uint8Array(32);
|
|
568
568
|
return crypto.getRandomValues(c), _i(c);
|
|
569
569
|
}
|
|
570
|
-
const
|
|
570
|
+
const se = "pdfjs_internal_id_";
|
|
571
571
|
function _n(c, t, e) {
|
|
572
572
|
if (!Array.isArray(e) || e.length < 2)
|
|
573
573
|
return !1;
|
|
@@ -799,7 +799,7 @@ class Ci {
|
|
|
799
799
|
}
|
|
800
800
|
}
|
|
801
801
|
const Rt = "http://www.w3.org/2000/svg";
|
|
802
|
-
class
|
|
802
|
+
class ce {
|
|
803
803
|
static CSS = 96;
|
|
804
804
|
static PDF = 72;
|
|
805
805
|
static PDF_TO_CSS_UNITS = this.CSS / this.PDF;
|
|
@@ -1110,7 +1110,7 @@ function Et(c) {
|
|
|
1110
1110
|
} = c.getTransform().invertSelf();
|
|
1111
1111
|
return [t, e, s, i, n, r];
|
|
1112
1112
|
}
|
|
1113
|
-
function
|
|
1113
|
+
function jt(c, t, e = !1, s = !0) {
|
|
1114
1114
|
if (t instanceof ke) {
|
|
1115
1115
|
const {
|
|
1116
1116
|
pageWidth: i,
|
|
@@ -1843,7 +1843,7 @@ class zt {
|
|
|
1843
1843
|
#L = null;
|
|
1844
1844
|
#B = null;
|
|
1845
1845
|
#F = null;
|
|
1846
|
-
#
|
|
1846
|
+
#G = null;
|
|
1847
1847
|
#C = F.NONE;
|
|
1848
1848
|
#x = /* @__PURE__ */ new Set();
|
|
1849
1849
|
#I = null;
|
|
@@ -1861,14 +1861,14 @@ class zt {
|
|
|
1861
1861
|
};
|
|
1862
1862
|
#U = [0, 0];
|
|
1863
1863
|
#N = null;
|
|
1864
|
-
#
|
|
1864
|
+
#j = null;
|
|
1865
1865
|
#J = null;
|
|
1866
1866
|
#Z = null;
|
|
1867
1867
|
#$ = null;
|
|
1868
1868
|
static TRANSLATE_SMALL = 1;
|
|
1869
1869
|
static TRANSLATE_BIG = 10;
|
|
1870
1870
|
static get _keyboardManager() {
|
|
1871
|
-
const t = zt.prototype, e = (r) => r.#
|
|
1871
|
+
const t = zt.prototype, e = (r) => r.#j.contains(document.activeElement) && document.activeElement.tagName !== "BUTTON" && r.hasSomethingToControl(), s = (r, {
|
|
1872
1872
|
target: a
|
|
1873
1873
|
}) => {
|
|
1874
1874
|
if (a instanceof HTMLInputElement) {
|
|
@@ -1890,11 +1890,11 @@ class zt {
|
|
|
1890
1890
|
}], [["Enter", "mac+Enter"], t.addNewEditorFromKeyboard, {
|
|
1891
1891
|
checker: (r, {
|
|
1892
1892
|
target: a
|
|
1893
|
-
}) => !(a instanceof HTMLButtonElement) && r.#
|
|
1893
|
+
}) => !(a instanceof HTMLButtonElement) && r.#j.contains(a) && !r.isEnterHandled
|
|
1894
1894
|
}], [[" ", "mac+ "], t.addNewEditorFromKeyboard, {
|
|
1895
1895
|
checker: (r, {
|
|
1896
1896
|
target: a
|
|
1897
|
-
}) => !(a instanceof HTMLButtonElement) && r.#
|
|
1897
|
+
}) => !(a instanceof HTMLButtonElement) && r.#j.contains(document.activeElement)
|
|
1898
1898
|
}], [["Escape", "mac+Escape"], t.unselectAll], [["ArrowLeft", "mac+ArrowLeft"], t.translateSelectedEditors, {
|
|
1899
1899
|
args: [-i, 0],
|
|
1900
1900
|
checker: e
|
|
@@ -1923,7 +1923,7 @@ class zt {
|
|
|
1923
1923
|
}
|
|
1924
1924
|
constructor(t, e, s, i, n, r, a, o, h, l, d, u, p, f, g, b) {
|
|
1925
1925
|
const m = this._signal = this.#t.signal;
|
|
1926
|
-
this.#
|
|
1926
|
+
this.#j = t, this.#J = e, this.#Z = s, this.#r = i, this.#h = n, this.#H = r, this.#W = o, this._eventBus = a, a._on("editingaction", this.onEditingAction.bind(this), {
|
|
1927
1927
|
signal: m
|
|
1928
1928
|
}), a._on("pagechanging", this.onPageChanging.bind(this), {
|
|
1929
1929
|
signal: m
|
|
@@ -1945,8 +1945,8 @@ class zt {
|
|
|
1945
1945
|
}, {
|
|
1946
1946
|
capture: !0,
|
|
1947
1947
|
signal: m
|
|
1948
|
-
}), this.#at(), this.#ut(), this.#et(), this.#n = o.annotationStorage, this.#E = o.filterFactory, this.#z = h, this.#T = l || null, this.#b = d, this.#w = u, this.#y = p, this.#
|
|
1949
|
-
realScale:
|
|
1948
|
+
}), this.#at(), this.#ut(), this.#et(), this.#n = o.annotationStorage, this.#E = o.filterFactory, this.#z = h, this.#T = l || null, this.#b = d, this.#w = u, this.#y = p, this.#G = f || null, this.viewParameters = {
|
|
1949
|
+
realScale: ce.PDF_TO_CSS_UNITS,
|
|
1950
1950
|
rotation: 0
|
|
1951
1951
|
}, this.isShiftKeyDown = !1, this._editorUndoBar = g || null, this._supportsPinchToZoom = b !== !1, n?.setSidebarUiManager(this);
|
|
1952
1952
|
}
|
|
@@ -1960,7 +1960,7 @@ class zt {
|
|
|
1960
1960
|
return AbortSignal.any([this._signal, t.signal]);
|
|
1961
1961
|
}
|
|
1962
1962
|
get mlManager() {
|
|
1963
|
-
return this.#
|
|
1963
|
+
return this.#G;
|
|
1964
1964
|
}
|
|
1965
1965
|
get useNewAltTextFlow() {
|
|
1966
1966
|
return this.#w;
|
|
@@ -1972,7 +1972,7 @@ class zt {
|
|
|
1972
1972
|
return L(this, "hcmFilter", this.#z ? this.#E.addHCMFilter(this.#z.foreground, this.#z.background) : "none");
|
|
1973
1973
|
}
|
|
1974
1974
|
get direction() {
|
|
1975
|
-
return L(this, "direction", getComputedStyle(this.#
|
|
1975
|
+
return L(this, "direction", getComputedStyle(this.#j).direction);
|
|
1976
1976
|
}
|
|
1977
1977
|
get _highlightColors() {
|
|
1978
1978
|
return L(this, "_highlightColors", this.#T ? new Map(this.#T.split(",").map((t) => (t = t.split("=").map((e) => e.trim()), t[1] = t[1].toUpperCase(), t))) : null);
|
|
@@ -2090,7 +2090,7 @@ class zt {
|
|
|
2090
2090
|
this.#p = t - 1;
|
|
2091
2091
|
}
|
|
2092
2092
|
focusMainContainer() {
|
|
2093
|
-
this.#
|
|
2093
|
+
this.#j.focus();
|
|
2094
2094
|
}
|
|
2095
2095
|
findParent(t, e) {
|
|
2096
2096
|
for (const s of this.#a.values()) {
|
|
@@ -2117,7 +2117,7 @@ class zt {
|
|
|
2117
2117
|
onScaleChanging({
|
|
2118
2118
|
scale: t
|
|
2119
2119
|
}) {
|
|
2120
|
-
this.commitOrRemove(), this.viewParameters.realScale = t *
|
|
2120
|
+
this.commitOrRemove(), this.viewParameters.realScale = t * ce.PDF_TO_CSS_UNITS;
|
|
2121
2121
|
for (const e of this.#g)
|
|
2122
2122
|
e.onScaleChanging();
|
|
2123
2123
|
this.#d?.onScaleChanging();
|
|
@@ -3530,7 +3530,7 @@ class D {
|
|
|
3530
3530
|
return !1;
|
|
3531
3531
|
}
|
|
3532
3532
|
static paste(t, e) {
|
|
3533
|
-
|
|
3533
|
+
j("Not implemented");
|
|
3534
3534
|
}
|
|
3535
3535
|
get propertiesToUpdate() {
|
|
3536
3536
|
return [];
|
|
@@ -4054,13 +4054,13 @@ class D {
|
|
|
4054
4054
|
return this.translate(i, n), Pi(this, t, ["keydown", "pointerdown", "dblclick"]), this.isResizable && this._uiManager._supportsPinchToZoom && (this.#T ||= new ts({
|
|
4055
4055
|
container: t,
|
|
4056
4056
|
isPinchingDisabled: () => !this.isSelected,
|
|
4057
|
-
onPinchStart: this.#
|
|
4057
|
+
onPinchStart: this.#G.bind(this),
|
|
4058
4058
|
onPinching: this.#C.bind(this),
|
|
4059
4059
|
onPinchEnd: this.#x.bind(this),
|
|
4060
4060
|
signal: this._uiManager._signal
|
|
4061
4061
|
})), this.addStandaloneCommentButton(), this._uiManager._editorUndoBar?.hide(), t;
|
|
4062
4062
|
}
|
|
4063
|
-
#
|
|
4063
|
+
#G() {
|
|
4064
4064
|
this.#u = {
|
|
4065
4065
|
savedX: this.x,
|
|
4066
4066
|
savedY: this.y,
|
|
@@ -4763,7 +4763,7 @@ class Di extends Ns {
|
|
|
4763
4763
|
};
|
|
4764
4764
|
}
|
|
4765
4765
|
get print() {
|
|
4766
|
-
|
|
4766
|
+
j("Should not call PrintAnnotationStorage.print");
|
|
4767
4767
|
}
|
|
4768
4768
|
get serializable() {
|
|
4769
4769
|
return this.#t;
|
|
@@ -4819,7 +4819,7 @@ class Bn {
|
|
|
4819
4819
|
}
|
|
4820
4820
|
return;
|
|
4821
4821
|
}
|
|
4822
|
-
|
|
4822
|
+
j("Not implemented: loadSystemFont without the Font Loading API.");
|
|
4823
4823
|
}
|
|
4824
4824
|
}
|
|
4825
4825
|
async bind(t) {
|
|
@@ -5047,7 +5047,7 @@ class Hn {
|
|
|
5047
5047
|
return this.#t.defaultVMetrics;
|
|
5048
5048
|
}
|
|
5049
5049
|
}
|
|
5050
|
-
class
|
|
5050
|
+
class ae {
|
|
5051
5051
|
#t;
|
|
5052
5052
|
#e;
|
|
5053
5053
|
#i;
|
|
@@ -5055,13 +5055,13 @@ class re {
|
|
|
5055
5055
|
static write(t) {
|
|
5056
5056
|
const e = new TextEncoder(), s = {};
|
|
5057
5057
|
let i = 0;
|
|
5058
|
-
for (const h of
|
|
5058
|
+
for (const h of ae.strings) {
|
|
5059
5059
|
const l = e.encode(t[h]);
|
|
5060
5060
|
s[h] = l, i += 4 + l.length;
|
|
5061
5061
|
}
|
|
5062
5062
|
const n = new ArrayBuffer(i), r = new Uint8Array(n), a = new DataView(n);
|
|
5063
5063
|
let o = 0;
|
|
5064
|
-
for (const h of
|
|
5064
|
+
for (const h of ae.strings) {
|
|
5065
5065
|
const l = s[h], d = l.length;
|
|
5066
5066
|
a.setUint32(o, d), r.set(l, o + 4), o += 4 + d;
|
|
5067
5067
|
}
|
|
@@ -5071,7 +5071,7 @@ class re {
|
|
|
5071
5071
|
this.#t = t, this.#e = new DataView(this.#t), this.#i = new TextDecoder();
|
|
5072
5072
|
}
|
|
5073
5073
|
#s(t) {
|
|
5074
|
-
B(t <
|
|
5074
|
+
B(t < ae.strings.length, "Invalid string index");
|
|
5075
5075
|
let e = 0;
|
|
5076
5076
|
for (let i = 0; i < t; i++)
|
|
5077
5077
|
e += this.#e.getUint32(e) + 4;
|
|
@@ -5088,7 +5088,7 @@ class re {
|
|
|
5088
5088
|
return this.#s(2);
|
|
5089
5089
|
}
|
|
5090
5090
|
}
|
|
5091
|
-
class
|
|
5091
|
+
class oe {
|
|
5092
5092
|
#t;
|
|
5093
5093
|
#e;
|
|
5094
5094
|
#i;
|
|
@@ -5096,7 +5096,7 @@ class ae {
|
|
|
5096
5096
|
static write(t) {
|
|
5097
5097
|
const e = new TextEncoder(), s = {};
|
|
5098
5098
|
let i = 0;
|
|
5099
|
-
for (const u of
|
|
5099
|
+
for (const u of oe.strings) {
|
|
5100
5100
|
const p = e.encode(t[u]);
|
|
5101
5101
|
s[u] = p, i += 4 + p.length;
|
|
5102
5102
|
}
|
|
@@ -5106,7 +5106,7 @@ class ae {
|
|
|
5106
5106
|
const o = new ArrayBuffer(a), h = new Uint8Array(o), l = new DataView(o);
|
|
5107
5107
|
let d = 0;
|
|
5108
5108
|
l.setUint8(d++, t.guessFallback ? 1 : 0), l.setUint32(d, 0), d += 4, i = 0;
|
|
5109
|
-
for (const u of
|
|
5109
|
+
for (const u of oe.strings) {
|
|
5110
5110
|
const p = s[u], f = p.length;
|
|
5111
5111
|
i += 4 + f, l.setUint32(d, f), h.set(p, d + 4), d += 4 + f;
|
|
5112
5112
|
}
|
|
@@ -5119,7 +5119,7 @@ class ae {
|
|
|
5119
5119
|
return this.#e.getUint8(0) !== 0;
|
|
5120
5120
|
}
|
|
5121
5121
|
#s(t) {
|
|
5122
|
-
B(t <
|
|
5122
|
+
B(t < oe.strings.length, "Invalid string index");
|
|
5123
5123
|
let e = 5;
|
|
5124
5124
|
for (let i = 0; i < t; i++)
|
|
5125
5125
|
e += this.#e.getUint32(e) + 4;
|
|
@@ -5150,7 +5150,7 @@ class ae {
|
|
|
5150
5150
|
};
|
|
5151
5151
|
}
|
|
5152
5152
|
}
|
|
5153
|
-
class
|
|
5153
|
+
class G {
|
|
5154
5154
|
static bools = ["black", "bold", "disableFontFace", "fontExtraProperties", "isInvalidPDFjsFont", "isType3Font", "italic", "missingFile", "remeasure", "vertical"];
|
|
5155
5155
|
static numbers = ["ascent", "defaultWidth", "descent"];
|
|
5156
5156
|
static strings = ["fallbackName", "loadedName", "mimetype", "name"];
|
|
@@ -5169,7 +5169,7 @@ class j {
|
|
|
5169
5169
|
this.#r = t, this.#n = new TextDecoder(), this.#o = new DataView(this.#r), e && Object.assign(this, e);
|
|
5170
5170
|
}
|
|
5171
5171
|
#l(t) {
|
|
5172
|
-
B(t <
|
|
5172
|
+
B(t < G.bools.length, "Invalid boolean index");
|
|
5173
5173
|
const e = Math.floor(t / 4), s = t * 2 % 8, i = this.#o.getUint8(e) >> s & 3;
|
|
5174
5174
|
return i === 0 ? void 0 : i === 2;
|
|
5175
5175
|
}
|
|
@@ -5204,7 +5204,7 @@ class j {
|
|
|
5204
5204
|
return this.#l(9);
|
|
5205
5205
|
}
|
|
5206
5206
|
#h(t) {
|
|
5207
|
-
return B(t <
|
|
5207
|
+
return B(t < G.numbers.length, "Invalid number index"), this.#o.getFloat64(G.#t + t * 8);
|
|
5208
5208
|
}
|
|
5209
5209
|
get ascent() {
|
|
5210
5210
|
return this.#h(0);
|
|
@@ -5216,7 +5216,7 @@ class j {
|
|
|
5216
5216
|
return this.#h(2);
|
|
5217
5217
|
}
|
|
5218
5218
|
get bbox() {
|
|
5219
|
-
let t =
|
|
5219
|
+
let t = G.#e;
|
|
5220
5220
|
if (this.#o.getUint8(t) === 0)
|
|
5221
5221
|
return;
|
|
5222
5222
|
t += 1;
|
|
@@ -5226,7 +5226,7 @@ class j {
|
|
|
5226
5226
|
return e;
|
|
5227
5227
|
}
|
|
5228
5228
|
get fontMatrix() {
|
|
5229
|
-
let t =
|
|
5229
|
+
let t = G.#i;
|
|
5230
5230
|
if (this.#o.getUint8(t) === 0)
|
|
5231
5231
|
return;
|
|
5232
5232
|
t += 1;
|
|
@@ -5236,7 +5236,7 @@ class j {
|
|
|
5236
5236
|
return e;
|
|
5237
5237
|
}
|
|
5238
5238
|
get defaultVMetrics() {
|
|
5239
|
-
let t =
|
|
5239
|
+
let t = G.#s;
|
|
5240
5240
|
if (this.#o.getUint8(t) === 0)
|
|
5241
5241
|
return;
|
|
5242
5242
|
t += 1;
|
|
@@ -5246,8 +5246,8 @@ class j {
|
|
|
5246
5246
|
return e;
|
|
5247
5247
|
}
|
|
5248
5248
|
#u(t) {
|
|
5249
|
-
B(t <
|
|
5250
|
-
let e =
|
|
5249
|
+
B(t < G.strings.length, "Invalid string index");
|
|
5250
|
+
let e = G.#a + 4;
|
|
5251
5251
|
for (let n = 0; n < t; n++)
|
|
5252
5252
|
e += this.#o.getUint32(e) + 4;
|
|
5253
5253
|
const s = this.#o.getUint32(e), i = new Uint8Array(s);
|
|
@@ -5266,7 +5266,7 @@ class j {
|
|
|
5266
5266
|
return this.#u(3);
|
|
5267
5267
|
}
|
|
5268
5268
|
get data() {
|
|
5269
|
-
let t =
|
|
5269
|
+
let t = G.#a;
|
|
5270
5270
|
const e = this.#o.getUint32(t);
|
|
5271
5271
|
t += 4 + e;
|
|
5272
5272
|
const s = this.#o.getUint32(t);
|
|
@@ -5278,7 +5278,7 @@ class j {
|
|
|
5278
5278
|
return new Uint8Array(this.#r, t + 4, n);
|
|
5279
5279
|
}
|
|
5280
5280
|
clearData() {
|
|
5281
|
-
let t =
|
|
5281
|
+
let t = G.#a;
|
|
5282
5282
|
const e = this.#o.getUint32(t);
|
|
5283
5283
|
t += 4 + e;
|
|
5284
5284
|
const s = this.#o.getUint32(t);
|
|
@@ -5289,7 +5289,7 @@ class j {
|
|
|
5289
5289
|
new Uint8Array(this.#r, t + 4, n).fill(0), this.#o.setUint32(t, 0);
|
|
5290
5290
|
}
|
|
5291
5291
|
get cssFontInfo() {
|
|
5292
|
-
let t =
|
|
5292
|
+
let t = G.#a;
|
|
5293
5293
|
const e = this.#o.getUint32(t);
|
|
5294
5294
|
t += 4 + e;
|
|
5295
5295
|
const s = this.#o.getUint32(t);
|
|
@@ -5298,58 +5298,58 @@ class j {
|
|
|
5298
5298
|
if (i === 0)
|
|
5299
5299
|
return null;
|
|
5300
5300
|
const n = new Uint8Array(i);
|
|
5301
|
-
return n.set(new Uint8Array(this.#r, t + 4, i)), new
|
|
5301
|
+
return n.set(new Uint8Array(this.#r, t + 4, i)), new ae(n.buffer);
|
|
5302
5302
|
}
|
|
5303
5303
|
get systemFontInfo() {
|
|
5304
|
-
let t =
|
|
5304
|
+
let t = G.#a;
|
|
5305
5305
|
const e = this.#o.getUint32(t);
|
|
5306
5306
|
t += 4 + e;
|
|
5307
5307
|
const s = this.#o.getUint32(t);
|
|
5308
5308
|
if (s === 0)
|
|
5309
5309
|
return null;
|
|
5310
5310
|
const i = new Uint8Array(s);
|
|
5311
|
-
return i.set(new Uint8Array(this.#r, t + 4, s)), new
|
|
5311
|
+
return i.set(new Uint8Array(this.#r, t + 4, s)), new oe(i.buffer);
|
|
5312
5312
|
}
|
|
5313
5313
|
static write(t) {
|
|
5314
|
-
const e = t.systemFontInfo ?
|
|
5314
|
+
const e = t.systemFontInfo ? oe.write(t.systemFontInfo) : null, s = t.cssFontInfo ? ae.write(t.cssFontInfo) : null, i = new TextEncoder(), n = {};
|
|
5315
5315
|
let r = 0;
|
|
5316
|
-
for (const g of
|
|
5316
|
+
for (const g of G.strings)
|
|
5317
5317
|
n[g] = i.encode(t[g]), r += 4 + n[g].length;
|
|
5318
|
-
const a =
|
|
5318
|
+
const a = G.#a + 4 + r + 4 + (e ? e.byteLength : 0) + 4 + (s ? s.byteLength : 0) + 4 + (t.data ? t.data.length : 0), o = new ArrayBuffer(a), h = new Uint8Array(o), l = new DataView(o);
|
|
5319
5319
|
let d = 0;
|
|
5320
|
-
const u =
|
|
5320
|
+
const u = G.bools.length;
|
|
5321
5321
|
let p = 0, f = 0;
|
|
5322
5322
|
for (let g = 0; g < u; g++) {
|
|
5323
|
-
const b = t[
|
|
5323
|
+
const b = t[G.bools[g]];
|
|
5324
5324
|
p |= (b === void 0 ? 0 : b ? 2 : 1) << f, f += 2, (f === 8 || g === u - 1) && (l.setUint8(d++, p), p = 0, f = 0);
|
|
5325
5325
|
}
|
|
5326
|
-
B(d ===
|
|
5327
|
-
for (const g of
|
|
5326
|
+
B(d === G.#t, "FontInfo.write: Boolean properties offset mismatch");
|
|
5327
|
+
for (const g of G.numbers)
|
|
5328
5328
|
l.setFloat64(d, t[g]), d += 8;
|
|
5329
|
-
if (B(d ===
|
|
5329
|
+
if (B(d === G.#e, "FontInfo.write: Number properties offset mismatch"), t.bbox) {
|
|
5330
5330
|
l.setUint8(d++, 4);
|
|
5331
5331
|
for (const g of t.bbox)
|
|
5332
5332
|
l.setInt16(d, g, !0), d += 2;
|
|
5333
5333
|
} else
|
|
5334
5334
|
l.setUint8(d++, 0), d += 8;
|
|
5335
|
-
if (B(d ===
|
|
5335
|
+
if (B(d === G.#i, "FontInfo.write: BBox properties offset mismatch"), t.fontMatrix) {
|
|
5336
5336
|
l.setUint8(d++, 6);
|
|
5337
5337
|
for (const g of t.fontMatrix)
|
|
5338
5338
|
l.setFloat64(d, g, !0), d += 8;
|
|
5339
5339
|
} else
|
|
5340
5340
|
l.setUint8(d++, 0), d += 48;
|
|
5341
|
-
if (B(d ===
|
|
5341
|
+
if (B(d === G.#s, "FontInfo.write: FontMatrix properties offset mismatch"), t.defaultVMetrics) {
|
|
5342
5342
|
l.setUint8(d++, 1);
|
|
5343
5343
|
for (const g of t.defaultVMetrics)
|
|
5344
5344
|
l.setInt16(d, g, !0), d += 2;
|
|
5345
5345
|
} else
|
|
5346
5346
|
l.setUint8(d++, 0), d += 6;
|
|
5347
|
-
B(d ===
|
|
5348
|
-
for (const g of
|
|
5347
|
+
B(d === G.#a, "FontInfo.write: DefaultVMetrics properties offset mismatch"), l.setUint32(G.#a, 0), d += 4;
|
|
5348
|
+
for (const g of G.strings) {
|
|
5349
5349
|
const b = n[g], m = b.length;
|
|
5350
5350
|
l.setUint32(d, m), h.set(b, d + 4), d += 4 + m;
|
|
5351
5351
|
}
|
|
5352
|
-
if (l.setUint32(
|
|
5352
|
+
if (l.setUint32(G.#a, d - G.#a - 4), !e)
|
|
5353
5353
|
l.setUint32(d, 0), d += 4;
|
|
5354
5354
|
else {
|
|
5355
5355
|
const g = e.byteLength;
|
|
@@ -5512,8 +5512,8 @@ function Ne(c) {
|
|
|
5512
5512
|
return c;
|
|
5513
5513
|
throw new Error(`Invalid factory url: "${c}" must include trailing slash.`);
|
|
5514
5514
|
}
|
|
5515
|
-
const _s = (c) => typeof c == "object" && Number.isInteger(c?.num) && c.num >= 0 && Number.isInteger(c?.gen) && c.gen >= 0, Vn = (c) => typeof c == "object" && typeof c?.name == "string",
|
|
5516
|
-
class
|
|
5515
|
+
const _s = (c) => typeof c == "object" && Number.isInteger(c?.num) && c.num >= 0 && Number.isInteger(c?.gen) && c.gen >= 0, Vn = (c) => typeof c == "object" && typeof c?.name == "string", Gn = _n.bind(null, _s, Vn);
|
|
5516
|
+
class jn {
|
|
5517
5517
|
#t = /* @__PURE__ */ new Map();
|
|
5518
5518
|
#e = Promise.resolve();
|
|
5519
5519
|
postMessage(t, e) {
|
|
@@ -5569,7 +5569,7 @@ function si() {
|
|
|
5569
5569
|
function pt(c) {
|
|
5570
5570
|
if (c instanceof $t || c instanceof ys || c instanceof Xs || c instanceof We || c instanceof os)
|
|
5571
5571
|
return c;
|
|
5572
|
-
switch (c instanceof Error || typeof c == "object" && c !== null ||
|
|
5572
|
+
switch (c instanceof Error || typeof c == "object" && c !== null || j('wrapReason: Expected "reason" to be a (possibly cloned) Error.'), c.name) {
|
|
5573
5573
|
case "AbortException":
|
|
5574
5574
|
return new $t(c.message);
|
|
5575
5575
|
case "InvalidPDFException":
|
|
@@ -5888,7 +5888,7 @@ class Ri {
|
|
|
5888
5888
|
t.canvas.width = 0, t.canvas.height = 0, t.canvas = null, t.context = null;
|
|
5889
5889
|
}
|
|
5890
5890
|
_createCanvas(t, e) {
|
|
5891
|
-
|
|
5891
|
+
j("Abstract method `_createCanvas` called.");
|
|
5892
5892
|
}
|
|
5893
5893
|
}
|
|
5894
5894
|
class Wn extends Ri {
|
|
@@ -5928,7 +5928,7 @@ class Ii {
|
|
|
5928
5928
|
});
|
|
5929
5929
|
}
|
|
5930
5930
|
async _fetch(t) {
|
|
5931
|
-
|
|
5931
|
+
j("Abstract method `_fetch` called.");
|
|
5932
5932
|
}
|
|
5933
5933
|
}
|
|
5934
5934
|
class ii extends Ii {
|
|
@@ -6152,7 +6152,7 @@ class Fi {
|
|
|
6152
6152
|
});
|
|
6153
6153
|
}
|
|
6154
6154
|
async _fetch(t) {
|
|
6155
|
-
|
|
6155
|
+
j("Abstract method `_fetch` called.");
|
|
6156
6156
|
}
|
|
6157
6157
|
}
|
|
6158
6158
|
class ni extends Fi {
|
|
@@ -6180,7 +6180,7 @@ class Ni {
|
|
|
6180
6180
|
});
|
|
6181
6181
|
}
|
|
6182
6182
|
async _fetch(t) {
|
|
6183
|
-
|
|
6183
|
+
j("Abstract method `_fetch` called.");
|
|
6184
6184
|
}
|
|
6185
6185
|
}
|
|
6186
6186
|
class ri extends Ni {
|
|
@@ -6216,7 +6216,7 @@ class Jn extends Ni {
|
|
|
6216
6216
|
return Os(t);
|
|
6217
6217
|
}
|
|
6218
6218
|
}
|
|
6219
|
-
const
|
|
6219
|
+
const Qt = "__forcedDependency", {
|
|
6220
6220
|
floor: ai,
|
|
6221
6221
|
ceil: oi
|
|
6222
6222
|
} = Math;
|
|
@@ -6267,7 +6267,7 @@ class tr {
|
|
|
6267
6267
|
transform: [],
|
|
6268
6268
|
moveText: [],
|
|
6269
6269
|
sameLineText: [],
|
|
6270
|
-
[
|
|
6270
|
+
[Qt]: []
|
|
6271
6271
|
};
|
|
6272
6272
|
#i = /* @__PURE__ */ new Map();
|
|
6273
6273
|
#s = [];
|
|
@@ -6308,8 +6308,8 @@ class tr {
|
|
|
6308
6308
|
sameLineText: {
|
|
6309
6309
|
__proto__: this.#e.sameLineText
|
|
6310
6310
|
},
|
|
6311
|
-
[
|
|
6312
|
-
__proto__: this.#e[
|
|
6311
|
+
[Qt]: {
|
|
6312
|
+
__proto__: this.#e[Qt]
|
|
6313
6313
|
}
|
|
6314
6314
|
}, this.#n = {
|
|
6315
6315
|
__proto__: this.#n
|
|
@@ -6362,7 +6362,7 @@ class tr {
|
|
|
6362
6362
|
this.#t[t] = this.#i.get(e) ?? s;
|
|
6363
6363
|
}
|
|
6364
6364
|
recordFutureForcedDependency(t, e) {
|
|
6365
|
-
return this.recordIncrementalData(
|
|
6365
|
+
return this.recordIncrementalData(Qt, e), this;
|
|
6366
6366
|
}
|
|
6367
6367
|
inheritSimpleDataAsFutureForcedDependencies(t) {
|
|
6368
6368
|
for (const e of t)
|
|
@@ -6371,7 +6371,7 @@ class tr {
|
|
|
6371
6371
|
}
|
|
6372
6372
|
inheritPendingDependenciesAsFutureForcedDependencies() {
|
|
6373
6373
|
for (const t of this.#h)
|
|
6374
|
-
this.recordFutureForcedDependency(
|
|
6374
|
+
this.recordFutureForcedDependency(Qt, t);
|
|
6375
6375
|
return this;
|
|
6376
6376
|
}
|
|
6377
6377
|
resetBBox(t) {
|
|
@@ -6419,7 +6419,7 @@ class tr {
|
|
|
6419
6419
|
return this.#i.has(e) && this.#h.add(this.#i.get(e)), this;
|
|
6420
6420
|
}
|
|
6421
6421
|
recordOperation(t, e = !1) {
|
|
6422
|
-
if (this.recordDependencies(t, [
|
|
6422
|
+
if (this.recordDependencies(t, [Qt]), this.#g) {
|
|
6423
6423
|
const s = He(this.#g, t), {
|
|
6424
6424
|
dependencies: i
|
|
6425
6425
|
} = s;
|
|
@@ -6596,7 +6596,7 @@ class Bs {
|
|
|
6596
6596
|
return !1;
|
|
6597
6597
|
}
|
|
6598
6598
|
getPattern() {
|
|
6599
|
-
|
|
6599
|
+
j("Abstract method `getPattern` called.");
|
|
6600
6600
|
}
|
|
6601
6601
|
}
|
|
6602
6602
|
class er extends Bs {
|
|
@@ -6791,9 +6791,9 @@ class Hs {
|
|
|
6791
6791
|
const ft = k.canvas;
|
|
6792
6792
|
S && (x = h), E && (_ = l);
|
|
6793
6793
|
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, Ot = S ? Math.floor(g / h) : 0, et = E ? Math.floor(b / l) : 0;
|
|
6794
|
-
for (let
|
|
6795
|
-
for (let
|
|
6796
|
-
Nt.drawImage(ft, W *
|
|
6794
|
+
for (let de = 0; de <= Ot; de++)
|
|
6795
|
+
for (let ue = 0; ue <= et; ue++)
|
|
6796
|
+
Nt.drawImage(ft, W * de, q * ue, W, q, 0, 0, W, q);
|
|
6797
6797
|
return {
|
|
6798
6798
|
canvas: Ut.canvas,
|
|
6799
6799
|
scaleX: Dt.scale,
|
|
@@ -6880,7 +6880,7 @@ function ar({
|
|
|
6880
6880
|
destPos: p
|
|
6881
6881
|
};
|
|
6882
6882
|
}
|
|
6883
|
-
const li = 16, ci = 100, or = 15, di = 10, gt = 16, ds = new DOMMatrix(), wt = new Float32Array(2),
|
|
6883
|
+
const li = 16, ci = 100, or = 15, di = 10, gt = 16, ds = new DOMMatrix(), wt = new Float32Array(2), ie = new Float32Array([1 / 0, 1 / 0, -1 / 0, -1 / 0]);
|
|
6884
6884
|
function hr(c, t) {
|
|
6885
6885
|
if (c._removeMirroring)
|
|
6886
6886
|
throw new Error("Context is already forwarding operations.");
|
|
@@ -6977,7 +6977,7 @@ class ui {
|
|
|
6977
6977
|
activeSMask = null;
|
|
6978
6978
|
transferMaps = "none";
|
|
6979
6979
|
constructor(t, e, s) {
|
|
6980
|
-
s?.(this), this.clipBox = new Float32Array([0, 0, t, e]), this.minMax =
|
|
6980
|
+
s?.(this), this.clipBox = new Float32Array([0, 0, t, e]), this.minMax = ie.slice();
|
|
6981
6981
|
}
|
|
6982
6982
|
clone() {
|
|
6983
6983
|
const t = Object.create(this);
|
|
@@ -6986,7 +6986,7 @@ class ui {
|
|
|
6986
6986
|
getPathBoundingBox(t = ct.FILL, e = null) {
|
|
6987
6987
|
const s = this.minMax.slice();
|
|
6988
6988
|
if (t === ct.STROKE) {
|
|
6989
|
-
e ||
|
|
6989
|
+
e || j("Stroke bounding box must include transform."), T.singularValueDecompose2dScale(e, wt);
|
|
6990
6990
|
const i = wt[0] * this.lineWidth / 2, n = wt[1] * this.lineWidth / 2;
|
|
6991
6991
|
s[0] -= i, s[1] -= n, s[2] += i, s[3] += n;
|
|
6992
6992
|
}
|
|
@@ -7000,7 +7000,7 @@ class ui {
|
|
|
7000
7000
|
return this.minMax[0] === 1 / 0;
|
|
7001
7001
|
}
|
|
7002
7002
|
startNewPathAndClipBox(t) {
|
|
7003
|
-
this.clipBox.set(t, 0), this.minMax.set(
|
|
7003
|
+
this.clipBox.set(t, 0), this.minMax.set(ie, 0);
|
|
7004
7004
|
}
|
|
7005
7005
|
getClippedPathBoundingBox(t = ct.FILL, e = null) {
|
|
7006
7006
|
return T.intersect(this.clipBox, this.getPathBoundingBox(t, e));
|
|
@@ -7015,7 +7015,7 @@ function pi(c, t) {
|
|
|
7015
7015
|
let o = 0, h;
|
|
7016
7016
|
const l = t.data, d = a.data;
|
|
7017
7017
|
let u, p, f, g;
|
|
7018
|
-
if (t.kind ===
|
|
7018
|
+
if (t.kind === je.GRAYSCALE_1BPP) {
|
|
7019
7019
|
const b = l.byteLength, m = new Uint32Array(d.buffer, 0, d.byteLength >> 2), w = m.length, y = s + 7 >> 3, v = 4294967295, A = at.isLittleEndian ? 4278190080 : 255;
|
|
7020
7020
|
for (u = 0; u < r; u++) {
|
|
7021
7021
|
for (f = u < n ? gt : i, h = 0, p = 0; p < f; p++) {
|
|
@@ -7032,11 +7032,11 @@ function pi(c, t) {
|
|
|
7032
7032
|
m[h++] = 0;
|
|
7033
7033
|
c.putImageData(a, 0, u * gt);
|
|
7034
7034
|
}
|
|
7035
|
-
} else if (t.kind ===
|
|
7035
|
+
} else if (t.kind === je.RGBA_32BPP) {
|
|
7036
7036
|
for (p = 0, g = s * gt * 4, u = 0; u < n; u++)
|
|
7037
7037
|
d.set(l.subarray(o, o + g)), o += g, c.putImageData(a, 0, p), p += gt;
|
|
7038
7038
|
u < r && (g = s * i * 4, d.set(l.subarray(o, o + g)), c.putImageData(a, 0, p));
|
|
7039
|
-
} else if (t.kind ===
|
|
7039
|
+
} else if (t.kind === je.RGB_24BPP)
|
|
7040
7040
|
for (f = gt, g = s * f, u = 0; u < r; u++) {
|
|
7041
7041
|
for (u >= n && (f = i, g = s * f), h = 0, p = g; p--; )
|
|
7042
7042
|
d[h++] = l[o++], d[h++] = l[o++], d[h++] = l[o++], d[h++] = 255;
|
|
@@ -7084,11 +7084,11 @@ function fi(c, t) {
|
|
|
7084
7084
|
if (t)
|
|
7085
7085
|
return !0;
|
|
7086
7086
|
T.singularValueDecompose2dScale(c, wt);
|
|
7087
|
-
const e = Math.fround(kt.pixelRatio *
|
|
7087
|
+
const e = Math.fround(kt.pixelRatio * ce.PDF_TO_CSS_UNITS);
|
|
7088
7088
|
return wt[0] <= e && wt[1] <= e;
|
|
7089
7089
|
}
|
|
7090
7090
|
const cr = ["butt", "round", "square"], dr = ["miter", "round", "bevel"], ur = {}, mi = {};
|
|
7091
|
-
class
|
|
7091
|
+
class he {
|
|
7092
7092
|
constructor(t, e, s, i, n, {
|
|
7093
7093
|
optionalContentConfig: r,
|
|
7094
7094
|
markedContentStack: a = null
|
|
@@ -7202,7 +7202,7 @@ class oe {
|
|
|
7202
7202
|
d || (u = this.cachedCanvases.getCanvas("maskCanvas", i, n), gi(u.context, e));
|
|
7203
7203
|
let p = T.transform(o, [1 / i, 0, 0, -1 / n, 0, 0]);
|
|
7204
7204
|
p = T.transform(p, [1, 0, 0, 1, 0, -n]);
|
|
7205
|
-
const f =
|
|
7205
|
+
const f = ie.slice();
|
|
7206
7206
|
T.axialAlignedBoundingBox([0, 0, i, n], p, f);
|
|
7207
7207
|
const [g, b, m, w] = f, y = Math.round(m - g) || 1, v = Math.round(w - b) || 1, A = this.cachedCanvases.getCanvas("fillCanvas", y, v), x = A.context, _ = g, S = b;
|
|
7208
7208
|
x.translate(-_, -S), x.transform(...p), d || (d = this._scaleImage(u.canvas, Et(x)), d = d.img, h && a && h.set(l, d)), x.imageSmoothingEnabled = fi(X(x), e.interpolate), $e(x, d, 0, 0, d.width, d.height, 0, 0, i, n), x.globalCompositeOperation = "source-in";
|
|
@@ -7648,7 +7648,7 @@ class oe {
|
|
|
7648
7648
|
let s;
|
|
7649
7649
|
if (e[0] === "TilingPattern") {
|
|
7650
7650
|
const i = this.baseTransform || X(this.ctx), n = {
|
|
7651
|
-
createCanvasGraphics: (r, a) => new
|
|
7651
|
+
createCanvasGraphics: (r, a) => new he(r, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
|
|
7652
7652
|
optionalContentConfig: this.optionalContentConfig,
|
|
7653
7653
|
markedContentStack: this.markedContentStack
|
|
7654
7654
|
}, void 0, void 0, this.dependencyTracker ? new qe(this.dependencyTracker, a, !0) : null)
|
|
@@ -7692,7 +7692,7 @@ class oe {
|
|
|
7692
7692
|
const {
|
|
7693
7693
|
width: r,
|
|
7694
7694
|
height: a
|
|
7695
|
-
} = s.canvas, o =
|
|
7695
|
+
} = s.canvas, o = ie.slice();
|
|
7696
7696
|
T.axialAlignedBoundingBox([0, 0, r, a], n, o);
|
|
7697
7697
|
const [h, l, d, u] = o;
|
|
7698
7698
|
this.ctx.fillRect(h, l, d - h, u - l);
|
|
@@ -7701,10 +7701,10 @@ class oe {
|
|
|
7701
7701
|
this.dependencyTracker?.resetBBox(t).recordFullPageBBox(t).recordDependencies(t, At.transform).recordDependencies(t, At.fill).recordOperation(t), this.compose(this.current.getClippedPathBoundingBox()), this.restore(t);
|
|
7702
7702
|
}
|
|
7703
7703
|
beginInlineImage() {
|
|
7704
|
-
|
|
7704
|
+
j("Should not call beginInlineImage");
|
|
7705
7705
|
}
|
|
7706
7706
|
beginImageData() {
|
|
7707
|
-
|
|
7707
|
+
j("Should not call beginImageData");
|
|
7708
7708
|
}
|
|
7709
7709
|
paintFormXObjectBegin(t, e, s) {
|
|
7710
7710
|
if (this.contentVisible && (this.save(t), this.baseTransformStack.push(this.baseTransform), e && this.transform(t, ...e), this.baseTransform = X(this.ctx), s)) {
|
|
@@ -7725,7 +7725,7 @@ class oe {
|
|
|
7725
7725
|
const i = X(s);
|
|
7726
7726
|
if (e.matrix && s.transform(...e.matrix), !e.bbox)
|
|
7727
7727
|
throw new Error("Bounding box is required.");
|
|
7728
|
-
let n =
|
|
7728
|
+
let n = ie.slice();
|
|
7729
7729
|
T.axialAlignedBoundingBox(e.bbox, X(s), n);
|
|
7730
7730
|
const r = [0, 0, s.canvas.width, s.canvas.height];
|
|
7731
7731
|
n = T.intersect(n, r) || [0, 0, 0, 0];
|
|
@@ -7763,7 +7763,7 @@ class oe {
|
|
|
7763
7763
|
this.ctx.restore();
|
|
7764
7764
|
const n = X(this.ctx);
|
|
7765
7765
|
this.restore(t), this.ctx.save(), this.ctx.setTransform(...n);
|
|
7766
|
-
const r =
|
|
7766
|
+
const r = ie.slice();
|
|
7767
7767
|
T.axialAlignedBoundingBox([0, 0, s.canvas.width, s.canvas.height], n, r), this.ctx.drawImage(s.canvas, 0, 0), this.ctx.restore(), this.compose(r);
|
|
7768
7768
|
}
|
|
7769
7769
|
}
|
|
@@ -8024,7 +8024,7 @@ class oe {
|
|
|
8024
8024
|
}
|
|
8025
8025
|
}
|
|
8026
8026
|
for (const c in Ee)
|
|
8027
|
-
|
|
8027
|
+
he.prototype[c] !== void 0 && (he.prototype[Ee[c]] = he.prototype[c]);
|
|
8028
8028
|
class Wt {
|
|
8029
8029
|
static #t = null;
|
|
8030
8030
|
static #e = "";
|
|
@@ -8064,7 +8064,7 @@ class pr {
|
|
|
8064
8064
|
return this.#t.entries();
|
|
8065
8065
|
}
|
|
8066
8066
|
}
|
|
8067
|
-
const
|
|
8067
|
+
const te = /* @__PURE__ */ Symbol("INTERNAL");
|
|
8068
8068
|
class gr {
|
|
8069
8069
|
#t = !1;
|
|
8070
8070
|
#e = !1;
|
|
@@ -8090,7 +8090,7 @@ class gr {
|
|
|
8090
8090
|
return this.#t ? e?.viewState !== "OFF" : this.#e ? t?.printState !== "OFF" : !0;
|
|
8091
8091
|
}
|
|
8092
8092
|
_setVisible(t, e, s = !1) {
|
|
8093
|
-
t !==
|
|
8093
|
+
t !== te && j("Internal method `_setVisible` called."), this.#i = s, this.#s = e;
|
|
8094
8094
|
}
|
|
8095
8095
|
}
|
|
8096
8096
|
class fr {
|
|
@@ -8105,11 +8105,11 @@ class fr {
|
|
|
8105
8105
|
this.#e.set(s.id, new gr(e, s));
|
|
8106
8106
|
if (t.baseState === "OFF")
|
|
8107
8107
|
for (const s of this.#e.values())
|
|
8108
|
-
s._setVisible(
|
|
8108
|
+
s._setVisible(te, !1);
|
|
8109
8109
|
for (const s of t.on)
|
|
8110
|
-
this.#e.get(s)._setVisible(
|
|
8110
|
+
this.#e.get(s)._setVisible(te, !0);
|
|
8111
8111
|
for (const s of t.off)
|
|
8112
|
-
this.#e.get(s)._setVisible(
|
|
8112
|
+
this.#e.get(s)._setVisible(te, !1);
|
|
8113
8113
|
this.#i = this.getHash();
|
|
8114
8114
|
}
|
|
8115
8115
|
}
|
|
@@ -8200,8 +8200,8 @@ class fr {
|
|
|
8200
8200
|
if (s && e && i.rbGroups.length)
|
|
8201
8201
|
for (const n of i.rbGroups)
|
|
8202
8202
|
for (const r of n)
|
|
8203
|
-
r !== t && this.#e.get(r)?._setVisible(
|
|
8204
|
-
i._setVisible(
|
|
8203
|
+
r !== t && this.#e.get(r)?._setVisible(te, !1, !0);
|
|
8204
|
+
i._setVisible(te, !!e, !0), this.#t = null;
|
|
8205
8205
|
}
|
|
8206
8206
|
setOCGState({
|
|
8207
8207
|
state: t,
|
|
@@ -9209,7 +9209,7 @@ class yt {
|
|
|
9209
9209
|
pageX: r,
|
|
9210
9210
|
pageY: a
|
|
9211
9211
|
} = s.rawDims;
|
|
9212
|
-
this.#b = [1, 0, 0, -1, -r, a + n], this.#o = i, this.#n = n, yt.#P(), e.style.setProperty("--min-font-size", yt.#_),
|
|
9212
|
+
this.#b = [1, 0, 0, -1, -r, a + n], this.#o = i, this.#n = n, yt.#P(), e.style.setProperty("--min-font-size", yt.#_), jt(e, s), this.#t.promise.finally(() => {
|
|
9213
9213
|
yt.#A.delete(this), this.#r = null, this.#p = null;
|
|
9214
9214
|
}).catch(() => {
|
|
9215
9215
|
});
|
|
@@ -9241,7 +9241,7 @@ class yt {
|
|
|
9241
9241
|
onBefore: e = null
|
|
9242
9242
|
}) {
|
|
9243
9243
|
const s = t.scale * kt.pixelRatio, i = t.rotation;
|
|
9244
|
-
if (i !== this.#u && (e?.(), this.#u = i,
|
|
9244
|
+
if (i !== this.#u && (e?.(), this.#u = i, jt(this.#h, {
|
|
9245
9245
|
rotation: i
|
|
9246
9246
|
})), s !== this.#d) {
|
|
9247
9247
|
e?.(), this.#d = s;
|
|
@@ -9387,7 +9387,7 @@ class yt {
|
|
|
9387
9387
|
}
|
|
9388
9388
|
}
|
|
9389
9389
|
const Lr = 100;
|
|
9390
|
-
function
|
|
9390
|
+
function Gi(c = {}) {
|
|
9391
9391
|
typeof c == "string" || c instanceof URL ? c = {
|
|
9392
9392
|
url: c
|
|
9393
9393
|
} : (c instanceof ArrayBuffer || ArrayBuffer.isView(c)) && (c = {
|
|
@@ -9395,7 +9395,7 @@ function ji(c = {}) {
|
|
|
9395
9395
|
});
|
|
9396
9396
|
const t = new $s(), {
|
|
9397
9397
|
docId: e
|
|
9398
|
-
} = t, s = c.url ? zn(c.url) : null, i = c.data ? Un(c.data) : null, n = c.httpHeaders || null, r = c.withCredentials === !0, a = c.password ?? null, o = c.range instanceof
|
|
9398
|
+
} = t, s = c.url ? zn(c.url) : null, i = c.data ? Un(c.data) : null, n = c.httpHeaders || null, r = c.withCredentials === !0, a = c.password ?? null, o = c.range instanceof ji ? c.range : null, h = Number.isInteger(c.rangeChunkSize) && c.rangeChunkSize > 0 ? c.rangeChunkSize : 2 ** 16;
|
|
9399
9399
|
let l = c.worker instanceof Cs ? c.worker : null;
|
|
9400
9400
|
const d = c.verbosity, u = typeof c.docBaseUrl == "string" && !Ze(c.docBaseUrl) ? c.docBaseUrl : null, p = Ne(c.cMapUrl), f = c.cMapPacked !== !1, g = c.CMapReaderFactory || (dt ? Kn : ii), b = Ne(c.iccUrl), m = Ne(c.standardFontDataUrl), w = c.StandardFontDataFactory || (dt ? Qn : ni), y = Ne(c.wasmUrl), v = c.WasmFactory || (dt ? Jn : ri), A = c.stopAtErrors !== !0, x = Number.isInteger(c.maxImageSize) && c.maxImageSize > -1 ? c.maxImageSize : -1, _ = c.isEvalSupported !== !1, S = typeof c.isOffscreenCanvasSupported == "boolean" ? c.isOffscreenCanvasSupported : !dt, E = typeof c.isImageDecoderSupported == "boolean" ? c.isImageDecoderSupported : !dt && (at.platform.isFirefox || !globalThis.chrome), P = Number.isInteger(c.canvasMaxAreaInBytes) ? c.canvasMaxAreaInBytes : -1, C = typeof c.disableFontFace == "boolean" ? c.disableFontFace : dt, H = c.fontExtraProperties === !0, V = c.enableXfa === !0, N = c.ownerDocument || globalThis.document, Z = c.disableRange === !0, k = c.disableStream === !0, R = c.disableAutoFetch === !0, U = c.pdfBug === !0, ft = c.CanvasFactory || (dt ? Yn : Wn), Dt = c.FilterFactory || (dt ? Xn : qn), tt = c.enableHWA === !0, W = c.useWasm !== !1, q = o ? o.length : c.length ?? NaN, Ut = typeof c.useSystemFonts == "boolean" ? c.useSystemFonts : !dt && !C, Nt = typeof c.useWorkerFetch == "boolean" ? c.useWorkerFetch : !!(g === ii && w === ni && v === ri && p && m && y && we(p, document.baseURI) && we(m, document.baseURI) && we(y, document.baseURI)), Ot = null;
|
|
9401
9401
|
gn(d);
|
|
@@ -9423,7 +9423,7 @@ function ji(c = {}) {
|
|
|
9423
9423
|
verbosity: d,
|
|
9424
9424
|
port: Wt.workerPort
|
|
9425
9425
|
}), t._worker = l);
|
|
9426
|
-
const
|
|
9426
|
+
const de = {
|
|
9427
9427
|
docId: e,
|
|
9428
9428
|
apiVersion: "5.4.530",
|
|
9429
9429
|
data: i,
|
|
@@ -9450,7 +9450,7 @@ function ji(c = {}) {
|
|
|
9450
9450
|
standardFontDataUrl: m,
|
|
9451
9451
|
wasmUrl: y
|
|
9452
9452
|
}
|
|
9453
|
-
},
|
|
9453
|
+
}, ue = {
|
|
9454
9454
|
ownerDocument: N,
|
|
9455
9455
|
pdfBug: U,
|
|
9456
9456
|
styleElement: Ot,
|
|
@@ -9464,7 +9464,7 @@ function ji(c = {}) {
|
|
|
9464
9464
|
throw new Error("Loading aborted");
|
|
9465
9465
|
if (l.destroyed)
|
|
9466
9466
|
throw new Error("Worker was destroyed");
|
|
9467
|
-
const nn = l.messageHandler.sendWithPromise("GetDocRequest",
|
|
9467
|
+
const nn = l.messageHandler.sendWithPromise("GetDocRequest", de, i ? [i.buffer] : null);
|
|
9468
9468
|
let is;
|
|
9469
9469
|
if (o)
|
|
9470
9470
|
is = new mr(o, {
|
|
@@ -9490,7 +9490,7 @@ function ji(c = {}) {
|
|
|
9490
9490
|
throw new Error("Loading aborted");
|
|
9491
9491
|
if (l.destroyed)
|
|
9492
9492
|
throw new Error("Worker was destroyed");
|
|
9493
|
-
const qs = new ve(e, ns, l.port), rn = new Or(qs, t, is,
|
|
9493
|
+
const qs = new ve(e, ns, l.port), rn = new Or(qs, t, is, ue, et, tt);
|
|
9494
9494
|
t._transport = rn, qs.send("Ready", null);
|
|
9495
9495
|
});
|
|
9496
9496
|
}).catch(t._capability.reject), t;
|
|
@@ -9520,7 +9520,7 @@ class $s {
|
|
|
9520
9520
|
return this._transport.getData();
|
|
9521
9521
|
}
|
|
9522
9522
|
}
|
|
9523
|
-
class
|
|
9523
|
+
class ji {
|
|
9524
9524
|
#t = Promise.withResolvers();
|
|
9525
9525
|
#e = [];
|
|
9526
9526
|
#i = [];
|
|
@@ -9567,7 +9567,7 @@ class Gi {
|
|
|
9567
9567
|
this.#t.resolve();
|
|
9568
9568
|
}
|
|
9569
9569
|
requestDataRange(t, e) {
|
|
9570
|
-
|
|
9570
|
+
j("Abstract method PDFDataRangeTransport.requestDataRange");
|
|
9571
9571
|
}
|
|
9572
9572
|
abort() {
|
|
9573
9573
|
}
|
|
@@ -9787,7 +9787,7 @@ class Nr {
|
|
|
9787
9787
|
intentState: w,
|
|
9788
9788
|
reason: E instanceof Error ? E : new Error(E)
|
|
9789
9789
|
})) : _.capability.resolve(), this._stats && (this._stats.timeEnd("Rendering"), this._stats.timeEnd("Overall"), globalThis.Stats?.enabled && globalThis.Stats.add(this.pageNumber, this._stats));
|
|
9790
|
-
}, _ = new
|
|
9790
|
+
}, _ = new re({
|
|
9791
9791
|
callback: x,
|
|
9792
9792
|
params: {
|
|
9793
9793
|
canvas: e,
|
|
@@ -10011,17 +10011,17 @@ class Nr {
|
|
|
10011
10011
|
return this._stats;
|
|
10012
10012
|
}
|
|
10013
10013
|
}
|
|
10014
|
-
var Vt, Pt, Ht,
|
|
10014
|
+
var Vt, Pt, Ht, le, gs, Jt, ne, St, Ue, Wi, qi, me, _e, Xe;
|
|
10015
10015
|
const rt = class Ae {
|
|
10016
10016
|
constructor({
|
|
10017
10017
|
name: t = null,
|
|
10018
10018
|
port: e = null,
|
|
10019
10019
|
verbosity: s = fn()
|
|
10020
10020
|
} = {}) {
|
|
10021
|
-
if (Ft(this, St), Ft(this, Vt, Promise.withResolvers()), Ft(this, Pt, null), Ft(this, Ht, null), Ft(this,
|
|
10022
|
-
if (Y(Ae,
|
|
10021
|
+
if (Ft(this, St), Ft(this, Vt, Promise.withResolvers()), Ft(this, Pt, null), Ft(this, Ht, null), Ft(this, le, null), this.name = t, this.destroyed = !1, this.verbosity = s, e) {
|
|
10022
|
+
if (Y(Ae, ne).has(e))
|
|
10023
10023
|
throw new Error("Cannot use more than one PDFWorker per port.");
|
|
10024
|
-
Y(Ae,
|
|
10024
|
+
Y(Ae, ne).set(e, this), It(this, St, Wi).call(this, e);
|
|
10025
10025
|
} else
|
|
10026
10026
|
It(this, St, qi).call(this);
|
|
10027
10027
|
}
|
|
@@ -10035,10 +10035,10 @@ const rt = class Ae {
|
|
|
10035
10035
|
return Y(this, Pt);
|
|
10036
10036
|
}
|
|
10037
10037
|
destroy() {
|
|
10038
|
-
this.destroyed = !0, Y(this,
|
|
10038
|
+
this.destroyed = !0, Y(this, le)?.terminate(), mt(this, le, null), Y(Ae, ne).delete(Y(this, Ht)), mt(this, Ht, null), Y(this, Pt)?.destroy(), mt(this, Pt, null);
|
|
10039
10039
|
}
|
|
10040
10040
|
static create(t) {
|
|
10041
|
-
const e = Y(this,
|
|
10041
|
+
const e = Y(this, ne).get(t?.port);
|
|
10042
10042
|
if (e) {
|
|
10043
10043
|
if (e._pendingDestroy)
|
|
10044
10044
|
throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");
|
|
@@ -10059,7 +10059,7 @@ const rt = class Ae {
|
|
|
10059
10059
|
)).WorkerMessageHandler)());
|
|
10060
10060
|
}
|
|
10061
10061
|
};
|
|
10062
|
-
Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /* @__PURE__ */ new WeakMap(),
|
|
10062
|
+
Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /* @__PURE__ */ new WeakMap(), le = /* @__PURE__ */ new WeakMap(), gs = /* @__PURE__ */ new WeakMap(), Jt = /* @__PURE__ */ new WeakMap(), ne = /* @__PURE__ */ new WeakMap(), St = /* @__PURE__ */ new WeakSet(), Ue = function() {
|
|
10063
10063
|
Y(this, Vt).resolve(), Y(this, Pt).send("configure", {
|
|
10064
10064
|
verbosity: this.verbosity
|
|
10065
10065
|
});
|
|
@@ -10067,7 +10067,7 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10067
10067
|
mt(this, Ht, c), mt(this, Pt, new ve("main", "worker", c)), Y(this, Pt).on("ready", () => {
|
|
10068
10068
|
}), It(this, St, Ue).call(this);
|
|
10069
10069
|
}, qi = function() {
|
|
10070
|
-
if (Y(rt,
|
|
10070
|
+
if (Y(rt, Jt) || Y(rt, _e, Xe)) {
|
|
10071
10071
|
It(this, St, me).call(this);
|
|
10072
10072
|
return;
|
|
10073
10073
|
}
|
|
@@ -10082,7 +10082,7 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10082
10082
|
i.abort(), e.destroy(), t.terminate(), this.destroyed ? Y(this, Vt).reject(new Error("Worker was destroyed")) : It(this, St, me).call(this);
|
|
10083
10083
|
}, i = new AbortController();
|
|
10084
10084
|
t.addEventListener("error", () => {
|
|
10085
|
-
Y(this,
|
|
10085
|
+
Y(this, le) || s();
|
|
10086
10086
|
}, {
|
|
10087
10087
|
signal: i.signal
|
|
10088
10088
|
}), e.on("test", (r) => {
|
|
@@ -10090,7 +10090,7 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10090
10090
|
s();
|
|
10091
10091
|
return;
|
|
10092
10092
|
}
|
|
10093
|
-
mt(this, Pt, e), mt(this, Ht, t), mt(this,
|
|
10093
|
+
mt(this, Pt, e), mt(this, Ht, t), mt(this, le, t), It(this, St, Ue).call(this);
|
|
10094
10094
|
}), e.on("ready", (r) => {
|
|
10095
10095
|
if (i.abort(), this.destroyed) {
|
|
10096
10096
|
s();
|
|
@@ -10113,12 +10113,12 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10113
10113
|
}
|
|
10114
10114
|
It(this, St, me).call(this);
|
|
10115
10115
|
}, me = function() {
|
|
10116
|
-
Y(rt,
|
|
10116
|
+
Y(rt, Jt) || (I("Setting up fake worker."), mt(rt, Jt, !0)), rt._setupFakeWorkerGlobal.then((c) => {
|
|
10117
10117
|
if (this.destroyed) {
|
|
10118
10118
|
Y(this, Vt).reject(new Error("Worker was destroyed"));
|
|
10119
10119
|
return;
|
|
10120
10120
|
}
|
|
10121
|
-
const t = new
|
|
10121
|
+
const t = new jn();
|
|
10122
10122
|
mt(this, Ht, t);
|
|
10123
10123
|
const e = `fake${ln(rt, gs)._++}`, s = new ve(e + "_worker", e, t);
|
|
10124
10124
|
c.setup(s, t), mt(this, Pt, new ve(e, e + "_worker", t)), It(this, St, Ue).call(this);
|
|
@@ -10131,7 +10131,7 @@ Vt = /* @__PURE__ */ new WeakMap(), Pt = /* @__PURE__ */ new WeakMap(), Ht = /*
|
|
|
10131
10131
|
} catch {
|
|
10132
10132
|
return null;
|
|
10133
10133
|
}
|
|
10134
|
-
}, Ft(rt, _e), Ft(rt, gs, 0), Ft(rt,
|
|
10134
|
+
}, Ft(rt, _e), Ft(rt, gs, 0), Ft(rt, Jt, !1), Ft(rt, ne, /* @__PURE__ */ new WeakMap()), dt && (mt(rt, Jt, !0), Wt.workerSrc ||= "./pdf.worker.mjs"), rt._isSameOrigin = (c, t) => {
|
|
10135
10135
|
const e = URL.parse(c);
|
|
10136
10136
|
if (!e?.origin || e.origin === "null")
|
|
10137
10137
|
return !1;
|
|
@@ -10336,7 +10336,7 @@ class Or {
|
|
|
10336
10336
|
I(`Error during font loading: ${d}`), this.commonObjs.resolve(s, d);
|
|
10337
10337
|
break;
|
|
10338
10338
|
}
|
|
10339
|
-
const r = new
|
|
10339
|
+
const r = new G(n), a = this._params.pdfBug && globalThis.FontInspector?.enabled ? (d, u) => globalThis.FontInspector.fontAdded(d, u) : null, o = new Hn(r, a, n.extra, n.charProcOperatorList);
|
|
10340
10340
|
this.fontLoader.bind(o).catch(() => t.sendWithPromise("FontFallback", {
|
|
10341
10341
|
id: s
|
|
10342
10342
|
})).finally(() => {
|
|
@@ -10571,7 +10571,7 @@ class Br {
|
|
|
10571
10571
|
return t.form || t.canvas && e?.size > 0;
|
|
10572
10572
|
}
|
|
10573
10573
|
}
|
|
10574
|
-
class
|
|
10574
|
+
class re {
|
|
10575
10575
|
#t = null;
|
|
10576
10576
|
static #e = /* @__PURE__ */ new WeakSet();
|
|
10577
10577
|
constructor({
|
|
@@ -10603,9 +10603,9 @@ class ne {
|
|
|
10603
10603
|
if (this.cancelled)
|
|
10604
10604
|
return;
|
|
10605
10605
|
if (this._canvas) {
|
|
10606
|
-
if (
|
|
10606
|
+
if (re.#e.has(this._canvas))
|
|
10607
10607
|
throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");
|
|
10608
|
-
|
|
10608
|
+
re.#e.add(this._canvas);
|
|
10609
10609
|
}
|
|
10610
10610
|
this._pdfBug && globalThis.StepperManager?.enabled && (this.stepper = globalThis.StepperManager.create(this._pageIndex), this.stepper.init(this.operatorList), this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint());
|
|
10611
10611
|
const {
|
|
@@ -10617,7 +10617,7 @@ class ne {
|
|
|
10617
10617
|
alpha: !1,
|
|
10618
10618
|
willReadFrequently: !this._enableHWA
|
|
10619
10619
|
});
|
|
10620
|
-
this.gfx = new
|
|
10620
|
+
this.gfx = new he(a, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
|
|
10621
10621
|
optionalContentConfig: e
|
|
10622
10622
|
}, this.annotationCanvasMap, this.pageColors, r), this.gfx.beginDrawing({
|
|
10623
10623
|
transform: i,
|
|
@@ -10627,7 +10627,7 @@ class ne {
|
|
|
10627
10627
|
}), this.operatorListIdx = 0, this.graphicsReady = !0, this.graphicsReadyCallback?.();
|
|
10628
10628
|
}
|
|
10629
10629
|
cancel(t = null, e = 0) {
|
|
10630
|
-
this.running = !1, this.cancelled = !0, this.gfx?.endDrawing(), this.#t && (window.cancelAnimationFrame(this.#t), this.#t = null),
|
|
10630
|
+
this.running = !1, this.cancelled = !0, this.gfx?.endDrawing(), this.#t && (window.cancelAnimationFrame(this.#t), this.#t = null), re.#e.delete(this._canvas), t ||= new Rs(`Rendering cancelled, page ${this._pageIndex + 1}`, e), this.callback(t), this.task.onError?.(t);
|
|
10631
10631
|
}
|
|
10632
10632
|
operatorListChanged() {
|
|
10633
10633
|
if (!this.graphicsReady) {
|
|
@@ -10645,7 +10645,7 @@ class ne {
|
|
|
10645
10645
|
}) : Promise.resolve().then(this._nextBound).catch(this._cancelBound);
|
|
10646
10646
|
}
|
|
10647
10647
|
async _next() {
|
|
10648
|
-
this.cancelled || (this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper, this._operationsFilter), this.operatorListIdx === this.operatorList.argsArray.length && (this.running = !1, this.operatorList.lastChunk && (this.gfx.endDrawing(),
|
|
10648
|
+
this.cancelled || (this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper, this._operationsFilter), this.operatorListIdx === this.operatorList.argsArray.length && (this.running = !1, this.operatorList.lastChunk && (this.gfx.endDrawing(), re.#e.delete(this._canvas), this.callback())));
|
|
10649
10649
|
}
|
|
10650
10650
|
}
|
|
10651
10651
|
const Xi = "5.4.530", Hr = "50cc4adac";
|
|
@@ -10905,7 +10905,7 @@ class $r {
|
|
|
10905
10905
|
return this._createSVG(t);
|
|
10906
10906
|
}
|
|
10907
10907
|
_createSVG(t) {
|
|
10908
|
-
|
|
10908
|
+
j("Abstract method `_createSVG` called.");
|
|
10909
10909
|
}
|
|
10910
10910
|
}
|
|
10911
10911
|
class Ye extends $r {
|
|
@@ -10920,11 +10920,11 @@ class fs {
|
|
|
10920
10920
|
case it.LINK:
|
|
10921
10921
|
return new zs(t);
|
|
10922
10922
|
case it.TEXT:
|
|
10923
|
-
return new
|
|
10923
|
+
return new Gr(t);
|
|
10924
10924
|
case it.WIDGET:
|
|
10925
10925
|
switch (t.data.fieldType) {
|
|
10926
10926
|
case "Tx":
|
|
10927
|
-
return new
|
|
10927
|
+
return new jr(t);
|
|
10928
10928
|
case "Btn":
|
|
10929
10929
|
return t.data.radioButton ? new Yi(t) : t.data.checkBox ? new qr(t) : new Xr(t);
|
|
10930
10930
|
case "Ch":
|
|
@@ -11139,19 +11139,19 @@ class K {
|
|
|
11139
11139
|
r.borderRadius = w;
|
|
11140
11140
|
}
|
|
11141
11141
|
switch (e.borderStyle.style) {
|
|
11142
|
-
case
|
|
11142
|
+
case Zt.SOLID:
|
|
11143
11143
|
r.borderStyle = "solid";
|
|
11144
11144
|
break;
|
|
11145
|
-
case
|
|
11145
|
+
case Zt.DASHED:
|
|
11146
11146
|
r.borderStyle = "dashed";
|
|
11147
11147
|
break;
|
|
11148
|
-
case
|
|
11148
|
+
case Zt.BEVELED:
|
|
11149
11149
|
I("Unimplemented border style: beveled");
|
|
11150
11150
|
break;
|
|
11151
|
-
case
|
|
11151
|
+
case Zt.INSET:
|
|
11152
11152
|
I("Unimplemented border style: inset");
|
|
11153
11153
|
break;
|
|
11154
|
-
case
|
|
11154
|
+
case Zt.UNDERLINE:
|
|
11155
11155
|
r.borderBottomStyle = "solid";
|
|
11156
11156
|
break;
|
|
11157
11157
|
}
|
|
@@ -11350,7 +11350,7 @@ class K {
|
|
|
11350
11350
|
return this.#i;
|
|
11351
11351
|
}
|
|
11352
11352
|
render() {
|
|
11353
|
-
|
|
11353
|
+
j("Abstract method `AnnotationElement.render` called");
|
|
11354
11354
|
}
|
|
11355
11355
|
_getElementsByName(t, e = null) {
|
|
11356
11356
|
const s = [];
|
|
@@ -11593,7 +11593,7 @@ class zs extends K {
|
|
|
11593
11593
|
};
|
|
11594
11594
|
}
|
|
11595
11595
|
}
|
|
11596
|
-
class
|
|
11596
|
+
class Gr extends K {
|
|
11597
11597
|
constructor(t) {
|
|
11598
11598
|
super(t, {
|
|
11599
11599
|
isRenderable: !0
|
|
@@ -11678,7 +11678,7 @@ class Yt extends K {
|
|
|
11678
11678
|
e ? t.setAttribute("required", !0) : t.removeAttribute("required"), t.setAttribute("aria-required", e);
|
|
11679
11679
|
}
|
|
11680
11680
|
}
|
|
11681
|
-
class
|
|
11681
|
+
class jr extends Yt {
|
|
11682
11682
|
constructor(t) {
|
|
11683
11683
|
const e = t.renderForms || t.data.hasOwnCanvas || !t.data.hasAppearance && !!t.data.fieldValue;
|
|
11684
11684
|
super(t, {
|
|
@@ -12208,12 +12208,12 @@ class Ts extends K {
|
|
|
12208
12208
|
const e = this.popup = this.#t(), s = [];
|
|
12209
12209
|
for (const i of this.elements)
|
|
12210
12210
|
i.popup = e, i.container.ariaHasPopup = "dialog", s.push(i.data.id), i.addHighlightArea();
|
|
12211
|
-
return this.container.setAttribute("aria-controls", s.map((i) => `${
|
|
12211
|
+
return this.container.setAttribute("aria-controls", s.map((i) => `${se}${i}`).join(",")), this.container;
|
|
12212
12212
|
}
|
|
12213
12213
|
}
|
|
12214
12214
|
class Kr {
|
|
12215
12215
|
#t = null;
|
|
12216
|
-
#e = this.#
|
|
12216
|
+
#e = this.#G.bind(this);
|
|
12217
12217
|
#i = this.#H.bind(this);
|
|
12218
12218
|
#s = this.#I.bind(this);
|
|
12219
12219
|
#a = this.#x.bind(this);
|
|
@@ -12493,7 +12493,7 @@ class Kr {
|
|
|
12493
12493
|
});
|
|
12494
12494
|
return s;
|
|
12495
12495
|
}
|
|
12496
|
-
#
|
|
12496
|
+
#G(t) {
|
|
12497
12497
|
t.altKey || t.shiftKey || t.ctrlKey || t.metaKey || (t.key === "Enter" || t.key === "Escape" && this.#p) && this.#x();
|
|
12498
12498
|
}
|
|
12499
12499
|
updateEdited({
|
|
@@ -12977,7 +12977,7 @@ class Vs {
|
|
|
12977
12977
|
const {
|
|
12978
12978
|
annotations: e
|
|
12979
12979
|
} = t, s = this.div;
|
|
12980
|
-
|
|
12980
|
+
jt(s, this.viewport);
|
|
12981
12981
|
const i = /* @__PURE__ */ new Map(), n = [], r = {
|
|
12982
12982
|
data: null,
|
|
12983
12983
|
layer: s,
|
|
@@ -13028,7 +13028,7 @@ class Vs {
|
|
|
13028
13028
|
if (!h.isRenderable)
|
|
13029
13029
|
continue;
|
|
13030
13030
|
const l = h.render();
|
|
13031
|
-
h.contentElement.id = `${
|
|
13031
|
+
h.contentElement.id = `${se}${a.id}`, a.hidden && (l.style.visibility = "hidden"), o.at(-1).container.after(l);
|
|
13032
13032
|
}
|
|
13033
13033
|
this.#h();
|
|
13034
13034
|
}
|
|
@@ -13045,7 +13045,7 @@ class Vs {
|
|
|
13045
13045
|
id: i
|
|
13046
13046
|
}
|
|
13047
13047
|
} of this.#n) {
|
|
13048
|
-
const n = s.id = `${
|
|
13048
|
+
const n = s.id = `${se}${i}`;
|
|
13049
13049
|
t.push(this.#a?.getAriaAttributes(n).then((r) => {
|
|
13050
13050
|
if (r)
|
|
13051
13051
|
for (const [a, o] of r)
|
|
@@ -13092,7 +13092,7 @@ class Vs {
|
|
|
13092
13092
|
for (const s of t) {
|
|
13093
13093
|
s.borderStyle ||= Vs._defaultBorderStyle, e.data = s;
|
|
13094
13094
|
const i = fs.create(e);
|
|
13095
|
-
i.isRenderable && (i.render(), i.contentElement.id = `${
|
|
13095
|
+
i.isRenderable && (i.render(), i.contentElement.id = `${se}${s.id}`, this.#n.push(i));
|
|
13096
13096
|
}
|
|
13097
13097
|
await this.#l();
|
|
13098
13098
|
}
|
|
@@ -13100,7 +13100,7 @@ class Vs {
|
|
|
13100
13100
|
viewport: t
|
|
13101
13101
|
}) {
|
|
13102
13102
|
const e = this.div;
|
|
13103
|
-
this.viewport = t,
|
|
13103
|
+
this.viewport = t, jt(e, {
|
|
13104
13104
|
rotation: t.rotation
|
|
13105
13105
|
}), this.#h(), e.hidden = !1;
|
|
13106
13106
|
}
|
|
@@ -13147,7 +13147,7 @@ class Vs {
|
|
|
13147
13147
|
linkService: this.#r,
|
|
13148
13148
|
annotationStorage: this.#i
|
|
13149
13149
|
});
|
|
13150
|
-
return n.render(), n.contentElement.id = `${
|
|
13150
|
+
return n.render(), n.contentElement.id = `${se}${s}`, n.createOrUpdatePopup(), this.#n.push(n), n;
|
|
13151
13151
|
}
|
|
13152
13152
|
removeAnnotation(t) {
|
|
13153
13153
|
const e = this.#n.findIndex((i) => i.data.id === t);
|
|
@@ -13170,7 +13170,7 @@ class Vs {
|
|
|
13170
13170
|
return L(this, "_defaultBorderStyle", Object.freeze({
|
|
13171
13171
|
width: 1,
|
|
13172
13172
|
rawWidth: 1,
|
|
13173
|
-
style:
|
|
13173
|
+
style: Zt.SOLID,
|
|
13174
13174
|
dashArray: [3],
|
|
13175
13175
|
horizontalCornerRadius: 0,
|
|
13176
13176
|
verticalCornerRadius: 0
|
|
@@ -13639,13 +13639,13 @@ class ht extends D {
|
|
|
13639
13639
|
class M {
|
|
13640
13640
|
static PRECISION = 1e-4;
|
|
13641
13641
|
toSVGPath() {
|
|
13642
|
-
|
|
13642
|
+
j("Abstract method `toSVGPath` must be implemented.");
|
|
13643
13643
|
}
|
|
13644
13644
|
get box() {
|
|
13645
|
-
|
|
13645
|
+
j("Abstract getter `box` must be implemented.");
|
|
13646
13646
|
}
|
|
13647
13647
|
serialize(t, e) {
|
|
13648
|
-
|
|
13648
|
+
j("Abstract method `serialize` must be implemented.");
|
|
13649
13649
|
}
|
|
13650
13650
|
static _rescale(t, e, s, i, n, r) {
|
|
13651
13651
|
r ||= new Float32Array(t.length);
|
|
@@ -13696,7 +13696,7 @@ class M {
|
|
|
13696
13696
|
return [(t + 5 * s) / 6, (e + 5 * i) / 6, (5 * s + n) / 6, (5 * i + r) / 6, (s + n) / 2, (i + r) / 2];
|
|
13697
13697
|
}
|
|
13698
13698
|
}
|
|
13699
|
-
class
|
|
13699
|
+
class Gt {
|
|
13700
13700
|
#t;
|
|
13701
13701
|
#e = [];
|
|
13702
13702
|
#i;
|
|
@@ -13712,12 +13712,12 @@ class jt {
|
|
|
13712
13712
|
#p = [];
|
|
13713
13713
|
static #m = 8;
|
|
13714
13714
|
static #f = 2;
|
|
13715
|
-
static #c =
|
|
13715
|
+
static #c = Gt.#m + Gt.#f;
|
|
13716
13716
|
constructor({
|
|
13717
13717
|
x: t,
|
|
13718
13718
|
y: e
|
|
13719
13719
|
}, s, i, n, r, a = 0) {
|
|
13720
|
-
this.#t = s, this.#d = n * i, this.#s = r, this.#r.set([NaN, NaN, NaN, NaN, t, e], 6), this.#i = a, this.#h =
|
|
13720
|
+
this.#t = s, this.#d = n * i, this.#s = r, this.#r.set([NaN, NaN, NaN, NaN, t, e], 6), this.#i = a, this.#h = Gt.#m * i, this.#l = Gt.#c * i, this.#u = i, this.#p.push(t, e);
|
|
13721
13721
|
}
|
|
13722
13722
|
isEmpty() {
|
|
13723
13723
|
return isNaN(this.#r[8]);
|
|
@@ -13877,7 +13877,7 @@ class tn extends M {
|
|
|
13877
13877
|
return this.#e;
|
|
13878
13878
|
}
|
|
13879
13879
|
newOutliner(t, e, s, i, n, r = 0) {
|
|
13880
|
-
return new
|
|
13880
|
+
return new Gt(t, e, s, i, n, r);
|
|
13881
13881
|
}
|
|
13882
13882
|
getNewOutline(t, e) {
|
|
13883
13883
|
const [s, i, n, r] = this.#e, [a, o, h, l] = this.#t, d = n * h, u = r * l, p = s * h + a, f = i * l + o, g = this.newOutliner({
|
|
@@ -14053,7 +14053,7 @@ class aa extends M {
|
|
|
14053
14053
|
return ["highlightOutline"];
|
|
14054
14054
|
}
|
|
14055
14055
|
}
|
|
14056
|
-
class Ps extends
|
|
14056
|
+
class Ps extends Gt {
|
|
14057
14057
|
newFreeDrawOutline(t, e, s, i, n, r) {
|
|
14058
14058
|
return new oa(t, e, s, i, n, r);
|
|
14059
14059
|
}
|
|
@@ -14735,7 +14735,7 @@ class en {
|
|
|
14735
14735
|
this.updateProperties(t);
|
|
14736
14736
|
}
|
|
14737
14737
|
clone() {
|
|
14738
|
-
|
|
14738
|
+
j("Not implemented");
|
|
14739
14739
|
}
|
|
14740
14740
|
}
|
|
14741
14741
|
class $ extends D {
|
|
@@ -14778,10 +14778,10 @@ class $ extends D {
|
|
|
14778
14778
|
return t;
|
|
14779
14779
|
}
|
|
14780
14780
|
static getDefaultDrawingOptions(t) {
|
|
14781
|
-
|
|
14781
|
+
j("Not implemented");
|
|
14782
14782
|
}
|
|
14783
14783
|
static get typesMap() {
|
|
14784
|
-
|
|
14784
|
+
j("Not implemented");
|
|
14785
14785
|
}
|
|
14786
14786
|
static get isDrawer() {
|
|
14787
14787
|
return !0;
|
|
@@ -15006,7 +15006,7 @@ class $ extends D {
|
|
|
15006
15006
|
return s.append(i), i.setAttribute("aria-hidden", "true"), i.className = "internal", this.setDims(), this._uiManager.addShouldRescale(this), this.disableEditing(), this._isCopy && this._moveAfterPaste(t, e), s;
|
|
15007
15007
|
}
|
|
15008
15008
|
static createDrawerInstance(t, e, s, i, n) {
|
|
15009
|
-
|
|
15009
|
+
j("Not implemented");
|
|
15010
15010
|
}
|
|
15011
15011
|
static startDrawing(t, e, s, i) {
|
|
15012
15012
|
const {
|
|
@@ -15119,7 +15119,7 @@ class $ extends D {
|
|
|
15119
15119
|
createDrawingOptions(t) {
|
|
15120
15120
|
}
|
|
15121
15121
|
static deserializeDraw(t, e, s, i, n, r) {
|
|
15122
|
-
|
|
15122
|
+
j("Not implemented");
|
|
15123
15123
|
}
|
|
15124
15124
|
static async deserialize(t, e, s) {
|
|
15125
15125
|
const {
|
|
@@ -15611,7 +15611,7 @@ class ss extends en {
|
|
|
15611
15611
|
return t.updateAll(this), t;
|
|
15612
15612
|
}
|
|
15613
15613
|
}
|
|
15614
|
-
class
|
|
15614
|
+
class Gs extends $ {
|
|
15615
15615
|
static _type = "ink";
|
|
15616
15616
|
static _editorType = F.INK;
|
|
15617
15617
|
static _defaultDrawingOptions = null;
|
|
@@ -15723,7 +15723,7 @@ class js extends $ {
|
|
|
15723
15723
|
thickness: e,
|
|
15724
15724
|
opacity: s
|
|
15725
15725
|
}) {
|
|
15726
|
-
this._drawingOptions =
|
|
15726
|
+
this._drawingOptions = Gs.getDefaultDrawingOptions({
|
|
15727
15727
|
stroke: T.makeHexColor(...t),
|
|
15728
15728
|
"stroke-width": e,
|
|
15729
15729
|
"stroke-opacity": s
|
|
@@ -15784,8 +15784,8 @@ class ks extends Le {
|
|
|
15784
15784
|
return t.endsWith("Z") || (t += "Z"), t;
|
|
15785
15785
|
}
|
|
15786
15786
|
}
|
|
15787
|
-
const
|
|
15788
|
-
class
|
|
15787
|
+
const Ge = 8, ye = 3;
|
|
15788
|
+
class ee {
|
|
15789
15789
|
static #t = {
|
|
15790
15790
|
maxDim: 512,
|
|
15791
15791
|
sigmaSFactor: 0.02,
|
|
@@ -16102,7 +16102,7 @@ class te {
|
|
|
16102
16102
|
}
|
|
16103
16103
|
let h;
|
|
16104
16104
|
r >= -128 && a <= 127 ? h = Int8Array : r >= -32768 && a <= 32767 ? h = Int16Array : h = Int32Array;
|
|
16105
|
-
const l = t.length, d =
|
|
16105
|
+
const l = t.length, d = Ge + ye * l, u = new Uint32Array(d);
|
|
16106
16106
|
let p = 0;
|
|
16107
16107
|
u[p++] = d * Uint32Array.BYTES_PER_ELEMENT + (o - 2 * l) * h.BYTES_PER_ELEMENT, u[p++] = 0, u[p++] = i, u[p++] = n, u[p++] = e ? 0 : 1, u[p++] = Math.max(0, Math.floor(s ?? 0)), u[p++] = l, u[p++] = h.BYTES_PER_ELEMENT;
|
|
16108
16108
|
for (const y of t)
|
|
@@ -16136,7 +16136,7 @@ class te {
|
|
|
16136
16136
|
const o = new Uint32Array(r.buffer, 0, r.length >> 2), h = o[1];
|
|
16137
16137
|
if (h !== 0)
|
|
16138
16138
|
throw new Error(`Invalid version: ${h}`);
|
|
16139
|
-
const l = o[2], d = o[3], u = o[4] === 0, p = o[5], f = o[6], g = o[7], b = [], m = (
|
|
16139
|
+
const l = o[2], d = o[3], u = o[4] === 0, p = o[5], f = o[6], g = o[7], b = [], m = (Ge + ye * f) * Uint32Array.BYTES_PER_ELEMENT;
|
|
16140
16140
|
let w;
|
|
16141
16141
|
switch (g) {
|
|
16142
16142
|
case Int8Array.BYTES_PER_ELEMENT:
|
|
@@ -16151,10 +16151,10 @@ class te {
|
|
|
16151
16151
|
}
|
|
16152
16152
|
a = 0;
|
|
16153
16153
|
for (let y = 0; y < f; y++) {
|
|
16154
|
-
const v = o[ye * y +
|
|
16154
|
+
const v = o[ye * y + Ge], A = new Float32Array(v + 2);
|
|
16155
16155
|
b.push(A);
|
|
16156
16156
|
for (let x = 0; x < ye - 1; x++)
|
|
16157
|
-
A[x] = o[ye * y +
|
|
16157
|
+
A[x] = o[ye * y + Ge + x + 1];
|
|
16158
16158
|
for (let x = 0; x < v; x++)
|
|
16159
16159
|
A[x + 2] = A[x] + w[a++];
|
|
16160
16160
|
}
|
|
@@ -16170,7 +16170,7 @@ class te {
|
|
|
16170
16170
|
}
|
|
16171
16171
|
}
|
|
16172
16172
|
}
|
|
16173
|
-
class
|
|
16173
|
+
class js extends en {
|
|
16174
16174
|
constructor() {
|
|
16175
16175
|
super(), super.updateProperties({
|
|
16176
16176
|
fill: D._defaultLineColor,
|
|
@@ -16178,7 +16178,7 @@ class Gs extends en {
|
|
|
16178
16178
|
});
|
|
16179
16179
|
}
|
|
16180
16180
|
clone() {
|
|
16181
|
-
const t = new
|
|
16181
|
+
const t = new js();
|
|
16182
16182
|
return t.updateAll(this), t;
|
|
16183
16183
|
}
|
|
16184
16184
|
}
|
|
@@ -16210,7 +16210,7 @@ class Tt extends $ {
|
|
|
16210
16210
|
}), this._willKeepAspectRatio = !0, this.#i = t.signatureData || null, this.#e = null, this.defaultL10nId = "pdfjs-editor-signature-editor1";
|
|
16211
16211
|
}
|
|
16212
16212
|
static initialize(t, e) {
|
|
16213
|
-
D.initialize(t, e), this._defaultDrawingOptions = new
|
|
16213
|
+
D.initialize(t, e), this._defaultDrawingOptions = new js(), this._defaultDrawnSignatureOptions = new Ws(e.viewParameters);
|
|
16214
16214
|
}
|
|
16215
16215
|
static getDefaultDrawingOptions(t) {
|
|
16216
16216
|
const e = this._defaultDrawingOptions.clone();
|
|
@@ -16266,7 +16266,7 @@ class Tt extends $ {
|
|
|
16266
16266
|
pageHeight: d
|
|
16267
16267
|
},
|
|
16268
16268
|
rotation: u
|
|
16269
|
-
} = this.parent.viewport, p =
|
|
16269
|
+
} = this.parent.viewport, p = ee.processDrawnLines({
|
|
16270
16270
|
lines: i,
|
|
16271
16271
|
pageWidth: l,
|
|
16272
16272
|
pageHeight: d,
|
|
@@ -16309,7 +16309,7 @@ class Tt extends $ {
|
|
|
16309
16309
|
thickness: s,
|
|
16310
16310
|
width: i,
|
|
16311
16311
|
height: n
|
|
16312
|
-
} = this.#i, r = Math.max(i, n), a =
|
|
16312
|
+
} = this.#i, r = Math.max(i, n), a = ee.processDrawnLines({
|
|
16313
16313
|
lines: {
|
|
16314
16314
|
curves: t.map((o) => ({
|
|
16315
16315
|
points: o
|
|
@@ -16366,7 +16366,7 @@ class Tt extends $ {
|
|
|
16366
16366
|
},
|
|
16367
16367
|
rotation: i
|
|
16368
16368
|
} = this.parent.viewport;
|
|
16369
|
-
return
|
|
16369
|
+
return ee.process(t, e, s, i, Tt._INNER_MARGIN);
|
|
16370
16370
|
}
|
|
16371
16371
|
getFromText(t, e) {
|
|
16372
16372
|
const {
|
|
@@ -16376,7 +16376,7 @@ class Tt extends $ {
|
|
|
16376
16376
|
},
|
|
16377
16377
|
rotation: n
|
|
16378
16378
|
} = this.parent.viewport;
|
|
16379
|
-
return
|
|
16379
|
+
return ee.extractContoursFromText(t, e, s, i, n, Tt._INNER_MARGIN);
|
|
16380
16380
|
}
|
|
16381
16381
|
getDrawnSignature(t) {
|
|
16382
16382
|
const {
|
|
@@ -16386,7 +16386,7 @@ class Tt extends $ {
|
|
|
16386
16386
|
},
|
|
16387
16387
|
rotation: i
|
|
16388
16388
|
} = this.parent.viewport;
|
|
16389
|
-
return
|
|
16389
|
+
return ee.processDrawnLines({
|
|
16390
16390
|
lines: t,
|
|
16391
16391
|
pageWidth: e,
|
|
16392
16392
|
pageHeight: s,
|
|
@@ -16749,7 +16749,7 @@ class la extends D {
|
|
|
16749
16749
|
} = this.#t, e.getContext("2d").drawImage(this.#t, 0, 0), e.toDataURL();
|
|
16750
16750
|
}
|
|
16751
16751
|
if (this.#h) {
|
|
16752
|
-
const [e, s] = this.pageDimensions, i = Math.round(this.width * e *
|
|
16752
|
+
const [e, s] = this.pageDimensions, i = Math.round(this.width * e * ce.PDF_TO_CSS_UNITS), n = Math.round(this.height * s * ce.PDF_TO_CSS_UNITS), r = new OffscreenCanvas(i, n);
|
|
16753
16753
|
return r.getContext("2d").drawImage(this.#t, 0, 0, this.#t.width, this.#t.height, 0, 0, i, n), r.transferToImageBitmap();
|
|
16754
16754
|
}
|
|
16755
16755
|
return structuredClone(this.#t);
|
|
@@ -16782,7 +16782,7 @@ class la extends D {
|
|
|
16782
16782
|
id: C,
|
|
16783
16783
|
bitmap: H
|
|
16784
16784
|
} = s.imageManager.getFromCanvas(S.id, P), P.remove()) : (n = !0, t._hasNoCanvas = !0);
|
|
16785
|
-
const V = (await e._structTree.getAriaAttributes(`${
|
|
16785
|
+
const V = (await e._structTree.getAriaAttributes(`${se}${m}`))?.get("aria-label") || "";
|
|
16786
16786
|
i = t = {
|
|
16787
16787
|
annotationType: F.STAMP,
|
|
16788
16788
|
bitmapId: C,
|
|
@@ -16892,7 +16892,7 @@ class Lt {
|
|
|
16892
16892
|
#f = -1;
|
|
16893
16893
|
#c;
|
|
16894
16894
|
static _initialized = !1;
|
|
16895
|
-
static #g = new Map([ht,
|
|
16895
|
+
static #g = new Map([ht, Gs, la, J, Tt].map((t) => [t._editorType, t]));
|
|
16896
16896
|
constructor({
|
|
16897
16897
|
uiManager: t,
|
|
16898
16898
|
pageIndex: e,
|
|
@@ -17352,7 +17352,7 @@ class Lt {
|
|
|
17352
17352
|
render({
|
|
17353
17353
|
viewport: t
|
|
17354
17354
|
}) {
|
|
17355
|
-
this.viewport = t,
|
|
17355
|
+
this.viewport = t, jt(this.div, t);
|
|
17356
17356
|
for (const e of this.#c.getEditors(this.pageIndex))
|
|
17357
17357
|
this.add(e), e.rebuild();
|
|
17358
17358
|
this.updateMode();
|
|
@@ -17362,7 +17362,7 @@ class Lt {
|
|
|
17362
17362
|
}) {
|
|
17363
17363
|
this.#c.commitOrRemove(), this.#A();
|
|
17364
17364
|
const e = this.viewport.rotation, s = t.rotation;
|
|
17365
|
-
if (this.viewport = t,
|
|
17365
|
+
if (this.viewport = t, jt(this.div, {
|
|
17366
17366
|
rotation: s
|
|
17367
17367
|
}), e !== s)
|
|
17368
17368
|
for (const i of this.#r.values())
|
|
@@ -17524,35 +17524,35 @@ globalThis.pdfjsLib = {
|
|
|
17524
17524
|
FeatureTest: at,
|
|
17525
17525
|
fetchData: Pe,
|
|
17526
17526
|
findContrastColor: In,
|
|
17527
|
-
getDocument:
|
|
17527
|
+
getDocument: Gi,
|
|
17528
17528
|
getFilenameFromUrl: En,
|
|
17529
17529
|
getPdfFilenameFromUrl: Cn,
|
|
17530
17530
|
getRGB: De,
|
|
17531
17531
|
getUuid: Si,
|
|
17532
17532
|
getXfaPageViewport: Mn,
|
|
17533
17533
|
GlobalWorkerOptions: Wt,
|
|
17534
|
-
ImageKind:
|
|
17534
|
+
ImageKind: je,
|
|
17535
17535
|
InvalidPDFException: ys,
|
|
17536
17536
|
isDataScheme: Ze,
|
|
17537
17537
|
isPdfFile: Is,
|
|
17538
|
-
isValidExplicitDest:
|
|
17538
|
+
isValidExplicitDest: Gn,
|
|
17539
17539
|
MathClamp: ut,
|
|
17540
17540
|
noContextMenu: _t,
|
|
17541
17541
|
normalizeUnicode: xn,
|
|
17542
17542
|
OPS: Ee,
|
|
17543
17543
|
OutputScale: kt,
|
|
17544
17544
|
PasswordResponses: pn,
|
|
17545
|
-
PDFDataRangeTransport:
|
|
17545
|
+
PDFDataRangeTransport: ji,
|
|
17546
17546
|
PDFDateString: ws,
|
|
17547
17547
|
PDFWorker: Cs,
|
|
17548
17548
|
PermissionFlag: un,
|
|
17549
|
-
PixelsPerInch:
|
|
17549
|
+
PixelsPerInch: ce,
|
|
17550
17550
|
RenderingCancelledException: Rs,
|
|
17551
17551
|
renderRichText: Ti,
|
|
17552
17552
|
ResponseException: We,
|
|
17553
|
-
setLayerDimensions:
|
|
17553
|
+
setLayerDimensions: jt,
|
|
17554
17554
|
shadow: L,
|
|
17555
|
-
SignatureExtractor:
|
|
17555
|
+
SignatureExtractor: ee,
|
|
17556
17556
|
stopEvent: Q,
|
|
17557
17557
|
SupportedImageMimeTypes: vs,
|
|
17558
17558
|
TextLayer: yt,
|
|
@@ -17570,7 +17570,7 @@ class ca {
|
|
|
17570
17570
|
}
|
|
17571
17571
|
async loadDocument(t) {
|
|
17572
17572
|
try {
|
|
17573
|
-
const e =
|
|
17573
|
+
const e = Gi(t);
|
|
17574
17574
|
return this.document = await e.promise, this.document;
|
|
17575
17575
|
} catch (e) {
|
|
17576
17576
|
throw console.error("Error loading PDF document:", e), e;
|
|
@@ -18376,6 +18376,104 @@ class ya {
|
|
|
18376
18376
|
off(t, e) {
|
|
18377
18377
|
this.eventBus.off(t, e);
|
|
18378
18378
|
}
|
|
18379
|
+
async print(t) {
|
|
18380
|
+
if (!this.pdfDocument) return;
|
|
18381
|
+
const e = document.createElement("iframe");
|
|
18382
|
+
e.style.position = "fixed", e.style.top = "0", e.style.left = "-10000px", e.style.width = "0", e.style.height = "0", e.style.border = "none", e.style.visibility = "hidden", document.body.appendChild(e);
|
|
18383
|
+
const s = e.contentWindow?.document;
|
|
18384
|
+
if (!s)
|
|
18385
|
+
throw document.body.removeChild(e), new Error("Could not create print iframe");
|
|
18386
|
+
Array.from(document.styleSheets).forEach((r) => {
|
|
18387
|
+
try {
|
|
18388
|
+
if (r.href) {
|
|
18389
|
+
const a = document.createElement("link");
|
|
18390
|
+
a.rel = "stylesheet", a.href = r.href, s.head.appendChild(a);
|
|
18391
|
+
} else if (r.cssRules) {
|
|
18392
|
+
const a = document.createElement("style");
|
|
18393
|
+
Array.from(r.cssRules).forEach((o) => {
|
|
18394
|
+
a.appendChild(document.createTextNode(o.cssText));
|
|
18395
|
+
}), s.head.appendChild(a);
|
|
18396
|
+
}
|
|
18397
|
+
} catch (a) {
|
|
18398
|
+
console.warn("Could not copy stylesheet", a);
|
|
18399
|
+
}
|
|
18400
|
+
});
|
|
18401
|
+
const i = document.createElement("style");
|
|
18402
|
+
i.textContent = `
|
|
18403
|
+
@page { margin: 0; size: auto; }
|
|
18404
|
+
html, body {
|
|
18405
|
+
margin: 0 !important;
|
|
18406
|
+
padding: 0 !important;
|
|
18407
|
+
height: auto !important;
|
|
18408
|
+
overflow: visible !important;
|
|
18409
|
+
background-color: white !important;
|
|
18410
|
+
}
|
|
18411
|
+
/* Hide scrollbars */
|
|
18412
|
+
::-webkit-scrollbar { display: none; }
|
|
18413
|
+
* { -ms-overflow-style: none; scrollbar-width: none; }
|
|
18414
|
+
|
|
18415
|
+
.print-page {
|
|
18416
|
+
position: relative;
|
|
18417
|
+
page-break-after: always;
|
|
18418
|
+
width: 100%;
|
|
18419
|
+
overflow: hidden;
|
|
18420
|
+
margin: 0;
|
|
18421
|
+
padding: 0;
|
|
18422
|
+
}
|
|
18423
|
+
.print-page img {
|
|
18424
|
+
display: block;
|
|
18425
|
+
width: 100%;
|
|
18426
|
+
height: auto;
|
|
18427
|
+
}
|
|
18428
|
+
.print-field {
|
|
18429
|
+
position: absolute;
|
|
18430
|
+
border: 1px solid transparent;
|
|
18431
|
+
}
|
|
18432
|
+
/* Hide UI controls in print */
|
|
18433
|
+
.sc-resize-handle, .sc-delete-btn { display: none !important; }
|
|
18434
|
+
`, s.head.appendChild(i);
|
|
18435
|
+
const n = document.createElement("div");
|
|
18436
|
+
s.body.appendChild(n);
|
|
18437
|
+
try {
|
|
18438
|
+
const r = this.pdfDocument.numPages;
|
|
18439
|
+
for (let a = 1; a <= r; a++) {
|
|
18440
|
+
const o = await this.pdfDocument.getPage(a), h = o.getViewport({ scale: 2 }), l = document.createElement("canvas"), d = l.getContext("2d");
|
|
18441
|
+
if (!d) continue;
|
|
18442
|
+
l.width = h.width, l.height = h.height, await o.render({
|
|
18443
|
+
canvasContext: d,
|
|
18444
|
+
viewport: h
|
|
18445
|
+
}).promise;
|
|
18446
|
+
const u = document.createElement("div");
|
|
18447
|
+
u.className = "print-page";
|
|
18448
|
+
const p = document.createElement("img");
|
|
18449
|
+
p.src = l.toDataURL("image/jpeg", 0.8), u.appendChild(p), t?.withSignatures && this.fields.filter((f) => f.pageIndex === a - 1).forEach((f) => {
|
|
18450
|
+
const g = document.createElement("div");
|
|
18451
|
+
g.className = "print-field select-none";
|
|
18452
|
+
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;
|
|
18453
|
+
if (g.style.left = `${m}%`, g.style.top = `${w}%`, g.style.width = `${y}%`, g.style.height = `${v}%`, g.style.display = "flex", g.style.alignItems = "center", g.style.justifyContent = "center", g.style.overflow = "hidden", f.style && Object.assign(g.style, f.style), f.type === "text")
|
|
18454
|
+
g.textContent = f.content || "", g.style.fontFamily = "sans-serif", g.style.fontSize = "2cqw", g.style.whiteSpace = "pre-wrap", g.style.textAlign = "center";
|
|
18455
|
+
else if (f.type === "image") {
|
|
18456
|
+
const A = document.createElement("img");
|
|
18457
|
+
A.src = f.content || "", A.style.width = "100%", A.style.height = "100%", A.style.objectFit = "contain", g.appendChild(A);
|
|
18458
|
+
} else if (f.type === "signature") {
|
|
18459
|
+
g.innerHTML = f.content || "";
|
|
18460
|
+
const A = g.querySelector("img");
|
|
18461
|
+
A && (A.style.width = "100%", A.style.height = "100%");
|
|
18462
|
+
const x = g.querySelector("svg");
|
|
18463
|
+
x && (x.style.width = "100%", x.style.height = "100%");
|
|
18464
|
+
}
|
|
18465
|
+
u.appendChild(g);
|
|
18466
|
+
}), n.appendChild(u);
|
|
18467
|
+
}
|
|
18468
|
+
await new Promise((a) => setTimeout(a, 500)), e.contentWindow?.focus(), e.contentWindow?.print();
|
|
18469
|
+
} catch (r) {
|
|
18470
|
+
throw console.error("Print failed", r), r;
|
|
18471
|
+
} finally {
|
|
18472
|
+
setTimeout(() => {
|
|
18473
|
+
document.body.contains(e) && document.body.removeChild(e);
|
|
18474
|
+
}, 3e5);
|
|
18475
|
+
}
|
|
18476
|
+
}
|
|
18379
18477
|
destroy() {
|
|
18380
18478
|
this.isDestroyed = !0, this.zoomHandler.destroy(), this.strategy?.destroy(), this.loader.destroy(), this.eventBus.clear(), this.container.innerHTML = "";
|
|
18381
18479
|
}
|
|
@@ -18441,6 +18539,9 @@ class wa {
|
|
|
18441
18539
|
updateField(t, e) {
|
|
18442
18540
|
this.viewer.updateField(t, e);
|
|
18443
18541
|
}
|
|
18542
|
+
async print(t) {
|
|
18543
|
+
return this.viewer.print(t);
|
|
18544
|
+
}
|
|
18444
18545
|
destroy() {
|
|
18445
18546
|
this.viewer.destroy();
|
|
18446
18547
|
}
|
|
@@ -18462,12 +18563,15 @@ const xa = on((c, t) => {
|
|
|
18462
18563
|
setViewMode: async (n) => {
|
|
18463
18564
|
s.current && await s.current.setViewMode(n);
|
|
18464
18565
|
},
|
|
18465
|
-
getViewMode: () => s.current?.getViewMode() ?? "scroll"
|
|
18566
|
+
getViewMode: () => s.current?.getViewMode() ?? "scroll",
|
|
18567
|
+
print: async (n) => {
|
|
18568
|
+
s.current && await s.current.print(n);
|
|
18569
|
+
}
|
|
18466
18570
|
}));
|
|
18467
18571
|
const i = rs(c);
|
|
18468
|
-
return
|
|
18572
|
+
return Kt(() => {
|
|
18469
18573
|
i.current = c;
|
|
18470
|
-
}),
|
|
18574
|
+
}), Kt(() => {
|
|
18471
18575
|
if (!(!e.current || s.current))
|
|
18472
18576
|
return s.current = new wa({
|
|
18473
18577
|
container: e.current,
|
|
@@ -18481,11 +18585,16 @@ const xa = on((c, t) => {
|
|
|
18481
18585
|
}), s.current.on("field:add", (n) => i.current.onFieldAdd?.(n)), s.current.on("field:remove", (n) => i.current.onFieldRemove?.(n)), s.current.on("field:update", (n) => i.current.onFieldUpdate?.(n)), s.current.on("fields:change", (n) => i.current.onFieldsChange?.(n)), c.onReady && c.onReady(s.current), () => {
|
|
18482
18586
|
s.current?.destroy(), s.current = null;
|
|
18483
18587
|
};
|
|
18484
|
-
}, []),
|
|
18588
|
+
}, []), Kt(() => {
|
|
18485
18589
|
s.current && c.src && s.current.load(c.src).then(() => c.onLoad?.()).catch((n) => c.onError?.(n));
|
|
18486
|
-
}, [c.src]),
|
|
18590
|
+
}, [c.src]), Kt(() => {
|
|
18487
18591
|
s.current && c.viewMode && s.current.setViewMode(c.viewMode);
|
|
18488
|
-
}, [c.viewMode]),
|
|
18592
|
+
}, [c.viewMode]), Kt(() => {
|
|
18593
|
+
if (s.current && c.scale !== void 0) {
|
|
18594
|
+
const n = s.current.getScale();
|
|
18595
|
+
Math.abs(n - c.scale) > 1e-3 && s.current.setScale(c.scale);
|
|
18596
|
+
}
|
|
18597
|
+
}, [c.scale]), Kt(() => {
|
|
18489
18598
|
if (s.current && c.fields) {
|
|
18490
18599
|
const n = s.current.getFields();
|
|
18491
18600
|
if (JSON.stringify(n) === JSON.stringify(c.fields))
|