vue-pdf-lite
Version:
Lightweight Vue 3 composable for exporting HTML to high-quality PDFs with smart pagination.
1,063 lines • 824 kB
JavaScript
import { ref as Ml, nextTick as H0 } from "vue";
var N0 = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
function _0(s) {
return s && s.__esModule && Object.prototype.hasOwnProperty.call(s, "default") ? s.default : s;
}
function T0(s) {
if (s.__esModule) return s;
var n = s.default;
if (typeof n == "function") {
var a = function c() {
return this instanceof c ? Reflect.construct(n, arguments, this.constructor) : n.apply(this, arguments);
};
a.prototype = n.prototype;
} else a = {};
return Object.defineProperty(a, "__esModule", { value: !0 }), Object.keys(s).forEach(function(c) {
var l = Object.getOwnPropertyDescriptor(s, c);
Object.defineProperty(a, c, l.get ? l : {
enumerable: !0,
get: function() {
return s[c];
}
});
}), a;
}
var cf = { exports: {} };
function et(s) {
"@babel/helpers - typeof";
return et = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(n) {
return typeof n;
} : function(n) {
return n && typeof Symbol == "function" && n.constructor === Symbol && n !== Symbol.prototype ? "symbol" : typeof n;
}, et(s);
}
var dr = Uint8Array, Yr = Uint16Array, ku = Int32Array, vc = new dr([
0,
0,
0,
0,
0,
0,
0,
0,
1,
1,
1,
1,
2,
2,
2,
2,
3,
3,
3,
3,
4,
4,
4,
4,
5,
5,
5,
5,
0,
/* unused */
0,
0,
/* impossible */
0
]), mc = new dr([
0,
0,
0,
0,
1,
1,
2,
2,
3,
3,
4,
4,
5,
5,
6,
6,
7,
7,
8,
8,
9,
9,
10,
10,
11,
11,
12,
12,
13,
13,
/* unused */
0,
0
]), Iu = new dr([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), uf = function(s, n) {
for (var a = new Yr(31), c = 0; c < 31; ++c)
a[c] = n += 1 << s[c - 1];
for (var l = new ku(a[30]), c = 1; c < 30; ++c)
for (var u = a[c]; u < a[c + 1]; ++u)
l[u] = u - a[c] << 5 | c;
return { b: a, r: l };
}, lf = uf(vc, 2), ff = lf.b, xu = lf.r;
ff[28] = 258, xu[258] = 28;
var hf = uf(mc, 0), D0 = hf.b, Kl = hf.r, Su = new Yr(32768);
for (var ft = 0; ft < 32768; ++ft) {
var Yi = (ft & 43690) >> 1 | (ft & 21845) << 1;
Yi = (Yi & 52428) >> 2 | (Yi & 13107) << 2, Yi = (Yi & 61680) >> 4 | (Yi & 3855) << 4, Su[ft] = ((Yi & 65280) >> 8 | (Yi & 255) << 8) >> 1;
}
var Ai = function(s, n, a) {
for (var c = s.length, l = 0, u = new Yr(n); l < c; ++l)
s[l] && ++u[s[l] - 1];
var f = new Yr(n);
for (l = 1; l < n; ++l)
f[l] = f[l - 1] + u[l - 1] << 1;
var d;
if (a) {
d = new Yr(1 << n);
var p = 15 - n;
for (l = 0; l < c; ++l)
if (s[l])
for (var C = l << 4 | s[l], Q = n - s[l], y = f[s[l] - 1]++ << Q, L = y | (1 << Q) - 1; y <= L; ++y)
d[Su[y] >> p] = C;
} else
for (d = new Yr(c), l = 0; l < c; ++l)
s[l] && (d[l] = Su[f[s[l] - 1]++] >> 15 - s[l]);
return d;
}, ta = new dr(288);
for (var ft = 0; ft < 144; ++ft)
ta[ft] = 8;
for (var ft = 144; ft < 256; ++ft)
ta[ft] = 9;
for (var ft = 256; ft < 280; ++ft)
ta[ft] = 7;
for (var ft = 280; ft < 288; ++ft)
ta[ft] = 8;
var Uo = new dr(32);
for (var ft = 0; ft < 32; ++ft)
Uo[ft] = 5;
var P0 = /* @__PURE__ */ Ai(ta, 9, 0), O0 = /* @__PURE__ */ Ai(ta, 9, 1), M0 = /* @__PURE__ */ Ai(Uo, 5, 0), K0 = /* @__PURE__ */ Ai(Uo, 5, 1), vu = function(s) {
for (var n = s[0], a = 1; a < s.length; ++a)
s[a] > n && (n = s[a]);
return n;
}, Hn = function(s, n, a) {
var c = n / 8 | 0;
return (s[c] | s[c + 1] << 8) >> (n & 7) & a;
}, mu = function(s, n) {
var a = n / 8 | 0;
return (s[a] | s[a + 1] << 8 | s[a + 2] << 16) >> (n & 7);
}, Ru = function(s) {
return (s + 7) / 8 | 0;
}, Bf = function(s, n, a) {
return (a == null || a > s.length) && (a = s.length), new dr(s.subarray(n, a));
}, k0 = [
"unexpected EOF",
"invalid block type",
"invalid length/literal",
"invalid distance",
"stream finished",
"no stream handler",
,
"no callback",
"invalid UTF-8 data",
"extra field too long",
"date not in range 1980-2099",
"filename too long",
"stream finishing",
"invalid zip data"
// determined by unknown compression method
], _n = function(s, n, a) {
var c = new Error(n || k0[s]);
if (c.code = s, Error.captureStackTrace && Error.captureStackTrace(c, _n), !a)
throw c;
return c;
}, R0 = function(s, n, a, c) {
var l = s.length, u = 0;
if (!l || n.f && !n.l)
return a || new dr(0);
var f = !a, d = f || n.i != 2, p = n.i;
f && (a = new dr(l * 3));
var C = function(TA) {
var qA = a.length;
if (TA > qA) {
var jA = new dr(Math.max(qA * 2, TA));
jA.set(a), a = jA;
}
}, Q = n.f || 0, y = n.p || 0, L = n.b || 0, v = n.l, k = n.d, O = n.m, X = n.n, P = l * 8;
do {
if (!v) {
Q = Hn(s, y, 1);
var R = Hn(s, y + 1, 3);
if (y += 3, R)
if (R == 1)
v = O0, k = K0, O = 9, X = 5;
else if (R == 2) {
var CA = Hn(s, y, 31) + 257, lA = Hn(s, y + 10, 15) + 4, M = CA + Hn(s, y + 5, 31) + 1;
y += 14;
for (var G = new dr(M), oA = new dr(19), N = 0; N < lA; ++N)
oA[Iu[N]] = Hn(s, y + N * 3, 7);
y += lA * 3;
for (var S = vu(oA), J = (1 << S) - 1, V = Ai(oA, S, 1), N = 0; N < M; ) {
var cA = V[Hn(s, y, J)];
y += cA & 15;
var iA = cA >> 4;
if (iA < 16)
G[N++] = iA;
else {
var hA = 0, vA = 0;
for (iA == 16 ? (vA = 3 + Hn(s, y, 3), y += 2, hA = G[N - 1]) : iA == 17 ? (vA = 3 + Hn(s, y, 7), y += 3) : iA == 18 && (vA = 11 + Hn(s, y, 127), y += 7); vA--; )
G[N++] = hA;
}
}
var fA = G.subarray(0, CA), mA = G.subarray(CA);
O = vu(fA), X = vu(mA), v = Ai(fA, O, 1), k = Ai(mA, X, 1);
} else
_n(1);
else {
var iA = Ru(y) + 4, pA = s[iA - 4] | s[iA - 3] << 8, uA = iA + pA;
if (uA > l) {
p && _n(0);
break;
}
d && C(L + pA), a.set(s.subarray(iA, uA), L), n.b = L += pA, n.p = y = uA * 8, n.f = Q;
continue;
}
if (y > P) {
p && _n(0);
break;
}
}
d && C(L + 131072);
for (var bA = (1 << O) - 1, OA = (1 << X) - 1, I = y; ; I = y) {
var hA = v[mu(s, y) & bA], j = hA >> 4;
if (y += hA & 15, y > P) {
p && _n(0);
break;
}
if (hA || _n(2), j < 256)
a[L++] = j;
else if (j == 256) {
I = y, v = null;
break;
} else {
var W = j - 254;
if (j > 264) {
var N = j - 257, Y = vc[N];
W = Hn(s, y, (1 << Y) - 1) + ff[N], y += Y;
}
var aA = k[mu(s, y) & OA], wA = aA >> 4;
aA || _n(3), y += aA & 15;
var mA = D0[wA];
if (wA > 3) {
var Y = mc[wA];
mA += mu(s, y) & (1 << Y) - 1, y += Y;
}
if (y > P) {
p && _n(0);
break;
}
d && C(L + 131072);
var QA = L + W;
if (L < mA) {
var FA = u - mA, PA = Math.min(mA, QA);
for (FA + L < 0 && _n(3); L < PA; ++L)
a[L] = c[FA + L];
}
for (; L < QA; ++L)
a[L] = a[L - mA];
}
}
n.l = v, n.p = I, n.b = L, n.f = Q, v && (Q = 1, n.m = O, n.d = k, n.n = X);
} while (!Q);
return L != a.length && f ? Bf(a, 0, L) : a.subarray(0, L);
}, bi = function(s, n, a) {
a <<= n & 7;
var c = n / 8 | 0;
s[c] |= a, s[c + 1] |= a >> 8;
}, vo = function(s, n, a) {
a <<= n & 7;
var c = n / 8 | 0;
s[c] |= a, s[c + 1] |= a >> 8, s[c + 2] |= a >> 16;
}, Cu = function(s, n) {
for (var a = [], c = 0; c < s.length; ++c)
s[c] && a.push({ s: c, f: s[c] });
var l = a.length, u = a.slice();
if (!l)
return { t: df, l: 0 };
if (l == 1) {
var f = new dr(a[0].s + 1);
return f[a[0].s] = 1, { t: f, l: 1 };
}
a.sort(function(uA, CA) {
return uA.f - CA.f;
}), a.push({ s: -1, f: 25001 });
var d = a[0], p = a[1], C = 0, Q = 1, y = 2;
for (a[0] = { s: -1, f: d.f + p.f, l: d, r: p }; Q != l - 1; )
d = a[a[C].f < a[y].f ? C++ : y++], p = a[C != Q && a[C].f < a[y].f ? C++ : y++], a[Q++] = { s: -1, f: d.f + p.f, l: d, r: p };
for (var L = u[0].s, c = 1; c < l; ++c)
u[c].s > L && (L = u[c].s);
var v = new Yr(L + 1), k = Hu(a[Q - 1], v, 0);
if (k > n) {
var c = 0, O = 0, X = k - n, P = 1 << X;
for (u.sort(function(CA, lA) {
return v[lA.s] - v[CA.s] || CA.f - lA.f;
}); c < l; ++c) {
var R = u[c].s;
if (v[R] > n)
O += P - (1 << k - v[R]), v[R] = n;
else
break;
}
for (O >>= X; O > 0; ) {
var iA = u[c].s;
v[iA] < n ? O -= 1 << n - v[iA]++ - 1 : ++c;
}
for (; c >= 0 && O; --c) {
var pA = u[c].s;
v[pA] == n && (--v[pA], ++O);
}
k = n;
}
return { t: new dr(v), l: k };
}, Hu = function(s, n, a) {
return s.s == -1 ? Math.max(Hu(s.l, n, a + 1), Hu(s.r, n, a + 1)) : n[s.s] = a;
}, kl = function(s) {
for (var n = s.length; n && !s[--n]; )
;
for (var a = new Yr(++n), c = 0, l = s[0], u = 1, f = function(p) {
a[c++] = p;
}, d = 1; d <= n; ++d)
if (s[d] == l && d != n)
++u;
else {
if (!l && u > 2) {
for (; u > 138; u -= 138)
f(32754);
u > 2 && (f(u > 10 ? u - 11 << 5 | 28690 : u - 3 << 5 | 12305), u = 0);
} else if (u > 3) {
for (f(l), --u; u > 6; u -= 6)
f(8304);
u > 2 && (f(u - 3 << 5 | 8208), u = 0);
}
for (; u--; )
f(l);
u = 1, l = s[d];
}
return { c: a.subarray(0, c), n };
}, mo = function(s, n) {
for (var a = 0, c = 0; c < n.length; ++c)
a += s[c] * n[c];
return a;
}, gf = function(s, n, a) {
var c = a.length, l = Ru(n + 2);
s[l] = c & 255, s[l + 1] = c >> 8, s[l + 2] = s[l] ^ 255, s[l + 3] = s[l + 1] ^ 255;
for (var u = 0; u < c; ++u)
s[l + u + 4] = a[u];
return (l + 4 + c) * 8;
}, Rl = function(s, n, a, c, l, u, f, d, p, C, Q) {
bi(n, Q++, a), ++l[256];
for (var y = Cu(l, 15), L = y.t, v = y.l, k = Cu(u, 15), O = k.t, X = k.l, P = kl(L), R = P.c, iA = P.n, pA = kl(O), uA = pA.c, CA = pA.n, lA = new Yr(19), M = 0; M < R.length; ++M)
++lA[R[M] & 31];
for (var M = 0; M < uA.length; ++M)
++lA[uA[M] & 31];
for (var G = Cu(lA, 7), oA = G.t, N = G.l, S = 19; S > 4 && !oA[Iu[S - 1]]; --S)
;
var J = C + 5 << 3, V = mo(l, ta) + mo(u, Uo) + f, cA = mo(l, L) + mo(u, O) + f + 14 + 3 * S + mo(lA, oA) + 2 * lA[16] + 3 * lA[17] + 7 * lA[18];
if (p >= 0 && J <= V && J <= cA)
return gf(n, Q, s.subarray(p, p + C));
var hA, vA, fA, mA;
if (bi(n, Q, 1 + (cA < V)), Q += 2, cA < V) {
hA = Ai(L, v, 0), vA = L, fA = Ai(O, X, 0), mA = O;
var bA = Ai(oA, N, 0);
bi(n, Q, iA - 257), bi(n, Q + 5, CA - 1), bi(n, Q + 10, S - 4), Q += 14;
for (var M = 0; M < S; ++M)
bi(n, Q + 3 * M, oA[Iu[M]]);
Q += 3 * S;
for (var OA = [R, uA], I = 0; I < 2; ++I)
for (var j = OA[I], M = 0; M < j.length; ++M) {
var W = j[M] & 31;
bi(n, Q, bA[W]), Q += oA[W], W > 15 && (bi(n, Q, j[M] >> 5 & 127), Q += j[M] >> 12);
}
} else
hA = P0, vA = ta, fA = M0, mA = Uo;
for (var M = 0; M < d; ++M) {
var Y = c[M];
if (Y > 255) {
var W = Y >> 18 & 31;
vo(n, Q, hA[W + 257]), Q += vA[W + 257], W > 7 && (bi(n, Q, Y >> 23 & 31), Q += vc[W]);
var aA = Y & 31;
vo(n, Q, fA[aA]), Q += mA[aA], aA > 3 && (vo(n, Q, Y >> 5 & 8191), Q += mc[aA]);
} else
vo(n, Q, hA[Y]), Q += vA[Y];
}
return vo(n, Q, hA[256]), Q + vA[256];
}, G0 = /* @__PURE__ */ new ku([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), df = /* @__PURE__ */ new dr(0), j0 = function(s, n, a, c, l, u) {
var f = u.z || s.length, d = new dr(c + f + 5 * (1 + Math.ceil(f / 7e3)) + l), p = d.subarray(c, d.length - l), C = u.l, Q = (u.r || 0) & 7;
if (n) {
Q && (p[0] = u.r >> 3);
for (var y = G0[n - 1], L = y >> 13, v = y & 8191, k = (1 << a) - 1, O = u.p || new Yr(32768), X = u.h || new Yr(k + 1), P = Math.ceil(a / 3), R = 2 * P, iA = function(he) {
return (s[he] ^ s[he + 1] << P ^ s[he + 2] << R) & k;
}, pA = new ku(25e3), uA = new Yr(288), CA = new Yr(32), lA = 0, M = 0, G = u.i || 0, oA = 0, N = u.w || 0, S = 0; G + 2 < f; ++G) {
var J = iA(G), V = G & 32767, cA = X[J];
if (O[V] = cA, X[J] = V, N <= G) {
var hA = f - G;
if ((lA > 7e3 || oA > 24576) && (hA > 423 || !C)) {
Q = Rl(s, p, 0, pA, uA, CA, M, oA, S, G - S, Q), oA = lA = M = 0, S = G;
for (var vA = 0; vA < 286; ++vA)
uA[vA] = 0;
for (var vA = 0; vA < 30; ++vA)
CA[vA] = 0;
}
var fA = 2, mA = 0, bA = v, OA = V - cA & 32767;
if (hA > 2 && J == iA(G - OA))
for (var I = Math.min(L, hA) - 1, j = Math.min(32767, G), W = Math.min(258, hA); OA <= j && --bA && V != cA; ) {
if (s[G + fA] == s[G + fA - OA]) {
for (var Y = 0; Y < W && s[G + Y] == s[G + Y - OA]; ++Y)
;
if (Y > fA) {
if (fA = Y, mA = OA, Y > I)
break;
for (var aA = Math.min(OA, Y - 2), wA = 0, vA = 0; vA < aA; ++vA) {
var QA = G - OA + vA & 32767, FA = O[QA], PA = QA - FA & 32767;
PA > wA && (wA = PA, cA = QA);
}
}
}
V = cA, cA = O[V], OA += V - cA & 32767;
}
if (mA) {
pA[oA++] = 268435456 | xu[fA] << 18 | Kl[mA];
var TA = xu[fA] & 31, qA = Kl[mA] & 31;
M += vc[TA] + mc[qA], ++uA[257 + TA], ++CA[qA], N = G + fA, ++lA;
} else
pA[oA++] = s[G], ++uA[s[G]];
}
}
for (G = Math.max(G, N); G < f; ++G)
pA[oA++] = s[G], ++uA[s[G]];
Q = Rl(s, p, C, pA, uA, CA, M, oA, S, G - S, Q), C || (u.r = Q & 7 | p[Q / 8 | 0] << 3, Q -= 7, u.h = X, u.p = O, u.i = G, u.w = N);
} else {
for (var G = u.w || 0; G < f + C; G += 65535) {
var jA = G + 65535;
jA >= f && (p[Q / 8 | 0] = C, jA = f), Q = gf(p, Q + 1, s.subarray(G, jA));
}
u.i = f;
}
return Bf(d, 0, c + Ru(Q) + l);
}, pf = function() {
var s = 1, n = 0;
return {
p: function(a) {
for (var c = s, l = n, u = a.length | 0, f = 0; f != u; ) {
for (var d = Math.min(f + 2655, u); f < d; ++f)
l += c += a[f];
c = (c & 65535) + 15 * (c >> 16), l = (l & 65535) + 15 * (l >> 16);
}
s = c, n = l;
},
d: function() {
return s %= 65521, n %= 65521, (s & 255) << 24 | (s & 65280) << 8 | (n & 255) << 8 | n >> 8;
}
};
}, V0 = function(s, n, a, c, l) {
if (!l && (l = { l: 1 }, n.dictionary)) {
var u = n.dictionary.subarray(-32768), f = new dr(u.length + s.length);
f.set(u), f.set(s, u.length), s = f, l.w = u.length;
}
return j0(s, n.level == null ? 6 : n.level, n.mem == null ? l.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(s.length))) * 1.5) : 20 : 12 + n.mem, a, c, l);
}, wf = function(s, n, a) {
for (; a; ++n)
s[n] = a, a >>>= 8;
}, q0 = function(s, n) {
var a = n.level, c = a == 0 ? 0 : a < 6 ? 1 : a == 9 ? 3 : 2;
if (s[0] = 120, s[1] = c << 6 | (n.dictionary && 32), s[1] |= 31 - (s[0] << 8 | s[1]) % 31, n.dictionary) {
var l = pf();
l.p(n.dictionary), wf(s, 2, l.d());
}
}, X0 = function(s, n) {
return ((s[0] & 15) != 8 || s[0] >> 4 > 7 || (s[0] << 8 | s[1]) % 31) && _n(6, "invalid zlib data"), (s[1] >> 5 & 1) == 1 && _n(6, "invalid zlib data: " + (s[1] & 32 ? "need" : "unexpected") + " dictionary"), (s[1] >> 3 & 4) + 2;
};
function Nu(s, n) {
n || (n = {});
var a = pf();
a.p(s);
var c = V0(s, n, n.dictionary ? 6 : 2, 4);
return q0(c, n), wf(c, c.length - 4, a.d()), c;
}
function W0(s, n) {
return R0(s.subarray(X0(s), -4), { i: 2 }, n, n);
}
var J0 = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), z0 = 0;
try {
J0.decode(df, { stream: !0 }), z0 = 1;
} catch {
}
/** @license
*
* jsPDF - PDF Document creation from JavaScript
* Version 2.5.2 Built on 2024-09-17T13:29:57.859Z
* CommitID 00000000
*
* Copyright (c) 2010-2021 James Hall <james@parall.ax>, https://github.com/MrRio/jsPDF
* 2015-2021 yWorks GmbH, http://www.yworks.com
* 2015-2021 Lukas Holländer <lukas.hollaender@yworks.com>, https://github.com/HackbrettXXX
* 2016-2018 Aras Abbasi <aras.abbasi@gmail.com>
* 2010 Aaron Spike, https://github.com/acspike
* 2012 Willow Systems Corporation, https://github.com/willowsystems
* 2012 Pablo Hess, https://github.com/pablohess
* 2012 Florian Jenett, https://github.com/fjenett
* 2013 Warren Weckesser, https://github.com/warrenweckesser
* 2013 Youssef Beddad, https://github.com/lifof
* 2013 Lee Driscoll, https://github.com/lsdriscoll
* 2013 Stefan Slonevskiy, https://github.com/stefslon
* 2013 Jeremy Morel, https://github.com/jmorel
* 2013 Christoph Hartmann, https://github.com/chris-rock
* 2014 Juan Pablo Gaviria, https://github.com/juanpgaviria
* 2014 James Makes, https://github.com/dollaruw
* 2014 Diego Casorran, https://github.com/diegocr
* 2014 Steven Spungin, https://github.com/Flamenco
* 2014 Kenneth Glassey, https://github.com/Gavvers
*
* Permission is hereby granted, free of charge, to any person obtaining
* a copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
* LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
* OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Contributor(s):
* siefkenj, ahwolf, rickygu, Midnith, saintclair, eaparango,
* kim3er, mfo, alnorth, Flamenco
*/
var pe = /* @__PURE__ */ function() {
return typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : this;
}();
function Qu() {
pe.console && typeof pe.console.log == "function" && pe.console.log.apply(pe.console, arguments);
}
var st = { log: Qu, warn: function(s) {
pe.console && (typeof pe.console.warn == "function" ? pe.console.warn.apply(pe.console, arguments) : Qu.call(null, arguments));
}, error: function(s) {
pe.console && (typeof pe.console.error == "function" ? pe.console.error.apply(pe.console, arguments) : Qu(s));
} };
function Fu(s, n, a) {
var c = new XMLHttpRequest();
c.open("GET", s), c.responseType = "blob", c.onload = function() {
Ua(c.response, n, a);
}, c.onerror = function() {
st.error("could not download file");
}, c.send();
}
function Gl(s) {
var n = new XMLHttpRequest();
n.open("HEAD", s, !1);
try {
n.send();
} catch {
}
return n.status >= 200 && n.status <= 299;
}
function Bc(s) {
try {
s.dispatchEvent(new MouseEvent("click"));
} catch {
var n = document.createEvent("MouseEvents");
n.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), s.dispatchEvent(n);
}
}
var Co, _u, Ua = pe.saveAs || ((typeof window > "u" ? "undefined" : et(window)) !== "object" || window !== pe ? function() {
} : typeof HTMLAnchorElement < "u" && "download" in HTMLAnchorElement.prototype ? function(s, n, a) {
var c = pe.URL || pe.webkitURL, l = document.createElement("a");
n = n || s.name || "download", l.download = n, l.rel = "noopener", typeof s == "string" ? (l.href = s, l.origin !== location.origin ? Gl(l.href) ? Fu(s, n, a) : Bc(l, l.target = "_blank") : Bc(l)) : (l.href = c.createObjectURL(s), setTimeout(function() {
c.revokeObjectURL(l.href);
}, 4e4), setTimeout(function() {
Bc(l);
}, 0));
} : "msSaveOrOpenBlob" in navigator ? function(s, n, a) {
if (n = n || s.name || "download", typeof s == "string") if (Gl(s)) Fu(s, n, a);
else {
var c = document.createElement("a");
c.href = s, c.target = "_blank", setTimeout(function() {
Bc(c);
});
}
else navigator.msSaveOrOpenBlob(function(l, u) {
return u === void 0 ? u = { autoBom: !1 } : et(u) !== "object" && (st.warn("Deprecated: Expected third argument to be a object"), u = { autoBom: !u }), u.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(l.type) ? new Blob(["\uFEFF", l], { type: l.type }) : l;
}(s, a), n);
} : function(s, n, a, c) {
if ((c = c || open("", "_blank")) && (c.document.title = c.document.body.innerText = "downloading..."), typeof s == "string") return Fu(s, n, a);
var l = s.type === "application/octet-stream", u = /constructor/i.test(pe.HTMLElement) || pe.safari, f = /CriOS\/[\d]+/.test(navigator.userAgent);
if ((f || l && u) && (typeof FileReader > "u" ? "undefined" : et(FileReader)) === "object") {
var d = new FileReader();
d.onloadend = function() {
var Q = d.result;
Q = f ? Q : Q.replace(/^data:[^;]*;/, "data:attachment/file;"), c ? c.location.href = Q : location = Q, c = null;
}, d.readAsDataURL(s);
} else {
var p = pe.URL || pe.webkitURL, C = p.createObjectURL(s);
c ? c.location = C : location.href = C, c = null, setTimeout(function() {
p.revokeObjectURL(C);
}, 4e4);
}
});
/**
* A class to parse color values
* @author Stoyan Stefanov <sstoo@gmail.com>
* {@link http://www.phpied.com/rgb-color-parser-in-javascript/}
* @license Use it if you like it
*/
function vf(s) {
var n;
s = s || "", this.ok = !1, s.charAt(0) == "#" && (s = s.substr(1, 6)), s = { aliceblue: "f0f8ff", antiquewhite: "faebd7", aqua: "00ffff", aquamarine: "7fffd4", azure: "f0ffff", beige: "f5f5dc", bisque: "ffe4c4", black: "000000", blanchedalmond: "ffebcd", blue: "0000ff", blueviolet: "8a2be2", brown: "a52a2a", burlywood: "deb887", cadetblue: "5f9ea0", chartreuse: "7fff00", chocolate: "d2691e", coral: "ff7f50", cornflowerblue: "6495ed", cornsilk: "fff8dc", crimson: "dc143c", cyan: "00ffff", darkblue: "00008b", darkcyan: "008b8b", darkgoldenrod: "b8860b", darkgray: "a9a9a9", darkgreen: "006400", darkkhaki: "bdb76b", darkmagenta: "8b008b", darkolivegreen: "556b2f", darkorange: "ff8c00", darkorchid: "9932cc", darkred: "8b0000", darksalmon: "e9967a", darkseagreen: "8fbc8f", darkslateblue: "483d8b", darkslategray: "2f4f4f", darkturquoise: "00ced1", darkviolet: "9400d3", deeppink: "ff1493", deepskyblue: "00bfff", dimgray: "696969", dodgerblue: "1e90ff", feldspar: "d19275", firebrick: "b22222", floralwhite: "fffaf0", forestgreen: "228b22", fuchsia: "ff00ff", gainsboro: "dcdcdc", ghostwhite: "f8f8ff", gold: "ffd700", goldenrod: "daa520", gray: "808080", green: "008000", greenyellow: "adff2f", honeydew: "f0fff0", hotpink: "ff69b4", indianred: "cd5c5c", indigo: "4b0082", ivory: "fffff0", khaki: "f0e68c", lavender: "e6e6fa", lavenderblush: "fff0f5", lawngreen: "7cfc00", lemonchiffon: "fffacd", lightblue: "add8e6", lightcoral: "f08080", lightcyan: "e0ffff", lightgoldenrodyellow: "fafad2", lightgrey: "d3d3d3", lightgreen: "90ee90", lightpink: "ffb6c1", lightsalmon: "ffa07a", lightseagreen: "20b2aa", lightskyblue: "87cefa", lightslateblue: "8470ff", lightslategray: "778899", lightsteelblue: "b0c4de", lightyellow: "ffffe0", lime: "00ff00", limegreen: "32cd32", linen: "faf0e6", magenta: "ff00ff", maroon: "800000", mediumaquamarine: "66cdaa", mediumblue: "0000cd", mediumorchid: "ba55d3", mediumpurple: "9370d8", mediumseagreen: "3cb371", mediumslateblue: "7b68ee", mediumspringgreen: "00fa9a", mediumturquoise: "48d1cc", mediumvioletred: "c71585", midnightblue: "191970", mintcream: "f5fffa", mistyrose: "ffe4e1", moccasin: "ffe4b5", navajowhite: "ffdead", navy: "000080", oldlace: "fdf5e6", olive: "808000", olivedrab: "6b8e23", orange: "ffa500", orangered: "ff4500", orchid: "da70d6", palegoldenrod: "eee8aa", palegreen: "98fb98", paleturquoise: "afeeee", palevioletred: "d87093", papayawhip: "ffefd5", peachpuff: "ffdab9", peru: "cd853f", pink: "ffc0cb", plum: "dda0dd", powderblue: "b0e0e6", purple: "800080", red: "ff0000", rosybrown: "bc8f8f", royalblue: "4169e1", saddlebrown: "8b4513", salmon: "fa8072", sandybrown: "f4a460", seagreen: "2e8b57", seashell: "fff5ee", sienna: "a0522d", silver: "c0c0c0", skyblue: "87ceeb", slateblue: "6a5acd", slategray: "708090", snow: "fffafa", springgreen: "00ff7f", steelblue: "4682b4", tan: "d2b48c", teal: "008080", thistle: "d8bfd8", tomato: "ff6347", turquoise: "40e0d0", violet: "ee82ee", violetred: "d02090", wheat: "f5deb3", white: "ffffff", whitesmoke: "f5f5f5", yellow: "ffff00", yellowgreen: "9acd32" }[s = (s = s.replace(/ /g, "")).toLowerCase()] || s;
for (var a = [{ re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/, example: ["rgb(123, 234, 45)", "rgb(255,234,245)"], process: function(d) {
return [parseInt(d[1]), parseInt(d[2]), parseInt(d[3])];
} }, { re: /^(\w{2})(\w{2})(\w{2})$/, example: ["#00ff00", "336699"], process: function(d) {
return [parseInt(d[1], 16), parseInt(d[2], 16), parseInt(d[3], 16)];
} }, { re: /^(\w{1})(\w{1})(\w{1})$/, example: ["#fb0", "f0f"], process: function(d) {
return [parseInt(d[1] + d[1], 16), parseInt(d[2] + d[2], 16), parseInt(d[3] + d[3], 16)];
} }], c = 0; c < a.length; c++) {
var l = a[c].re, u = a[c].process, f = l.exec(s);
f && (n = u(f), this.r = n[0], this.g = n[1], this.b = n[2], this.ok = !0);
}
this.r = this.r < 0 || isNaN(this.r) ? 0 : this.r > 255 ? 255 : this.r, this.g = this.g < 0 || isNaN(this.g) ? 0 : this.g > 255 ? 255 : this.g, this.b = this.b < 0 || isNaN(this.b) ? 0 : this.b > 255 ? 255 : this.b, this.toRGB = function() {
return "rgb(" + this.r + ", " + this.g + ", " + this.b + ")";
}, this.toHex = function() {
var d = this.r.toString(16), p = this.g.toString(16), C = this.b.toString(16);
return d.length == 1 && (d = "0" + d), p.length == 1 && (p = "0" + p), C.length == 1 && (C = "0" + C), "#" + d + p + C;
};
}
/**
* @license
* Joseph Myers does not specify a particular license for his work.
*
* Author: Joseph Myers
* Accessed from: http://www.myersdaily.org/joseph/javascript/md5.js
*
* Modified by: Owen Leong
*/
function yu(s, n) {
var a = s[0], c = s[1], l = s[2], u = s[3];
a = fr(a, c, l, u, n[0], 7, -680876936), u = fr(u, a, c, l, n[1], 12, -389564586), l = fr(l, u, a, c, n[2], 17, 606105819), c = fr(c, l, u, a, n[3], 22, -1044525330), a = fr(a, c, l, u, n[4], 7, -176418897), u = fr(u, a, c, l, n[5], 12, 1200080426), l = fr(l, u, a, c, n[6], 17, -1473231341), c = fr(c, l, u, a, n[7], 22, -45705983), a = fr(a, c, l, u, n[8], 7, 1770035416), u = fr(u, a, c, l, n[9], 12, -1958414417), l = fr(l, u, a, c, n[10], 17, -42063), c = fr(c, l, u, a, n[11], 22, -1990404162), a = fr(a, c, l, u, n[12], 7, 1804603682), u = fr(u, a, c, l, n[13], 12, -40341101), l = fr(l, u, a, c, n[14], 17, -1502002290), a = hr(a, c = fr(c, l, u, a, n[15], 22, 1236535329), l, u, n[1], 5, -165796510), u = hr(u, a, c, l, n[6], 9, -1069501632), l = hr(l, u, a, c, n[11], 14, 643717713), c = hr(c, l, u, a, n[0], 20, -373897302), a = hr(a, c, l, u, n[5], 5, -701558691), u = hr(u, a, c, l, n[10], 9, 38016083), l = hr(l, u, a, c, n[15], 14, -660478335), c = hr(c, l, u, a, n[4], 20, -405537848), a = hr(a, c, l, u, n[9], 5, 568446438), u = hr(u, a, c, l, n[14], 9, -1019803690), l = hr(l, u, a, c, n[3], 14, -187363961), c = hr(c, l, u, a, n[8], 20, 1163531501), a = hr(a, c, l, u, n[13], 5, -1444681467), u = hr(u, a, c, l, n[2], 9, -51403784), l = hr(l, u, a, c, n[7], 14, 1735328473), a = Br(a, c = hr(c, l, u, a, n[12], 20, -1926607734), l, u, n[5], 4, -378558), u = Br(u, a, c, l, n[8], 11, -2022574463), l = Br(l, u, a, c, n[11], 16, 1839030562), c = Br(c, l, u, a, n[14], 23, -35309556), a = Br(a, c, l, u, n[1], 4, -1530992060), u = Br(u, a, c, l, n[4], 11, 1272893353), l = Br(l, u, a, c, n[7], 16, -155497632), c = Br(c, l, u, a, n[10], 23, -1094730640), a = Br(a, c, l, u, n[13], 4, 681279174), u = Br(u, a, c, l, n[0], 11, -358537222), l = Br(l, u, a, c, n[3], 16, -722521979), c = Br(c, l, u, a, n[6], 23, 76029189), a = Br(a, c, l, u, n[9], 4, -640364487), u = Br(u, a, c, l, n[12], 11, -421815835), l = Br(l, u, a, c, n[15], 16, 530742520), a = gr(a, c = Br(c, l, u, a, n[2], 23, -995338651), l, u, n[0], 6, -198630844), u = gr(u, a, c, l, n[7], 10, 1126891415), l = gr(l, u, a, c, n[14], 15, -1416354905), c = gr(c, l, u, a, n[5], 21, -57434055), a = gr(a, c, l, u, n[12], 6, 1700485571), u = gr(u, a, c, l, n[3], 10, -1894986606), l = gr(l, u, a, c, n[10], 15, -1051523), c = gr(c, l, u, a, n[1], 21, -2054922799), a = gr(a, c, l, u, n[8], 6, 1873313359), u = gr(u, a, c, l, n[15], 10, -30611744), l = gr(l, u, a, c, n[6], 15, -1560198380), c = gr(c, l, u, a, n[13], 21, 1309151649), a = gr(a, c, l, u, n[4], 6, -145523070), u = gr(u, a, c, l, n[11], 10, -1120210379), l = gr(l, u, a, c, n[2], 15, 718787259), c = gr(c, l, u, a, n[9], 21, -343485551), s[0] = Aa(a, s[0]), s[1] = Aa(c, s[1]), s[2] = Aa(l, s[2]), s[3] = Aa(u, s[3]);
}
function Cc(s, n, a, c, l, u) {
return n = Aa(Aa(n, s), Aa(c, u)), Aa(n << l | n >>> 32 - l, a);
}
function fr(s, n, a, c, l, u, f) {
return Cc(n & a | ~n & c, s, n, l, u, f);
}
function hr(s, n, a, c, l, u, f) {
return Cc(n & c | a & ~c, s, n, l, u, f);
}
function Br(s, n, a, c, l, u, f) {
return Cc(n ^ a ^ c, s, n, l, u, f);
}
function gr(s, n, a, c, l, u, f) {
return Cc(a ^ (n | ~c), s, n, l, u, f);
}
function mf(s) {
var n, a = s.length, c = [1732584193, -271733879, -1732584194, 271733878];
for (n = 64; n <= s.length; n += 64) yu(c, Y0(s.substring(n - 64, n)));
s = s.substring(n - 64);
var l = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
for (n = 0; n < s.length; n++) l[n >> 2] |= s.charCodeAt(n) << (n % 4 << 3);
if (l[n >> 2] |= 128 << (n % 4 << 3), n > 55) for (yu(c, l), n = 0; n < 16; n++) l[n] = 0;
return l[14] = 8 * a, yu(c, l), c;
}
function Y0(s) {
var n, a = [];
for (n = 0; n < 64; n += 4) a[n >> 2] = s.charCodeAt(n) + (s.charCodeAt(n + 1) << 8) + (s.charCodeAt(n + 2) << 16) + (s.charCodeAt(n + 3) << 24);
return a;
}
Co = pe.atob.bind(pe), _u = pe.btoa.bind(pe);
var jl = "0123456789abcdef".split("");
function Z0(s) {
for (var n = "", a = 0; a < 4; a++) n += jl[s >> 8 * a + 4 & 15] + jl[s >> 8 * a & 15];
return n;
}
function $0(s) {
return String.fromCharCode((255 & s) >> 0, (65280 & s) >> 8, (16711680 & s) >> 16, (4278190080 & s) >> 24);
}
function Tu(s) {
return mf(s).map($0).join("");
}
var A1 = function(s) {
for (var n = 0; n < s.length; n++) s[n] = Z0(s[n]);
return s.join("");
}(mf("hello")) != "5d41402abc4b2a76b9719d911017c592";
function Aa(s, n) {
if (A1) {
var a = (65535 & s) + (65535 & n);
return (s >> 16) + (n >> 16) + (a >> 16) << 16 | 65535 & a;
}
return s + n & 4294967295;
}
/**
* @license
* FPDF is released under a permissive license: there is no usage restriction.
* You may embed it freely in your application (commercial or not), with or
* without modifications.
*
* Reference: http://www.fpdf.org/en/script/script37.php
*/
function Du(s, n) {
var a, c, l, u;
if (s !== a) {
for (var f = (l = s, u = 1 + (256 / s.length >> 0), new Array(u + 1).join(l)), d = [], p = 0; p < 256; p++) d[p] = p;
var C = 0;
for (p = 0; p < 256; p++) {
var Q = d[p];
C = (C + Q + f.charCodeAt(p)) % 256, d[p] = d[C], d[C] = Q;
}
a = s, c = d;
} else d = c;
var y = n.length, L = 0, v = 0, k = "";
for (p = 0; p < y; p++) v = (v + (Q = d[L = (L + 1) % 256])) % 256, d[L] = d[v], d[v] = Q, f = d[(d[L] + d[v]) % 256], k += String.fromCharCode(n.charCodeAt(p) ^ f);
return k;
}
/**
* @license
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
* Author: Owen Leong (@owenl131)
* Date: 15 Oct 2020
* References:
* https://www.cs.cmu.edu/~dst/Adobe/Gallery/anon21jul01-pdf-encryption.txt
* https://github.com/foliojs/pdfkit/blob/master/lib/security.js
* http://www.fpdf.org/en/script/script37.php
*/
var Vl = { print: 4, modify: 8, copy: 16, "annot-forms": 32 };
function Is(s, n, a, c) {
this.v = 1, this.r = 2;
var l = 192;
s.forEach(function(d) {
if (Vl.perm !== void 0) throw new Error("Invalid permission: " + d);
l += Vl[d];
}), this.padding = "(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";
var u = (n + this.padding).substr(0, 32), f = (a + this.padding).substr(0, 32);
this.O = this.processOwnerPassword(u, f), this.P = -(1 + (255 ^ l)), this.encryptionKey = Tu(u + this.O + this.lsbFirstWord(this.P) + this.hexToBytes(c)).substr(0, 5), this.U = Du(this.encryptionKey, this.padding);
}
function xs(s) {
if (/[^\u0000-\u00ff]/.test(s)) throw new Error("Invalid PDF Name Object: " + s + ", Only accept ASCII characters.");
for (var n = "", a = s.length, c = 0; c < a; c++) {
var l = s.charCodeAt(c);
l < 33 || l === 35 || l === 37 || l === 40 || l === 41 || l === 47 || l === 60 || l === 62 || l === 91 || l === 93 || l === 123 || l === 125 || l > 126 ? n += "#" + ("0" + l.toString(16)).slice(-2) : n += s[c];
}
return n;
}
function ql(s) {
if (et(s) !== "object") throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");
var n = {};
this.subscribe = function(a, c, l) {
if (l = l || !1, typeof a != "string" || typeof c != "function" || typeof l != "boolean") throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");
n.hasOwnProperty(a) || (n[a] = {});
var u = Math.random().toString(35);
return n[a][u] = [c, !!l], u;
}, this.unsubscribe = function(a) {
for (var c in n) if (n[c][a]) return delete n[c][a], Object.keys(n[c]).length === 0 && delete n[c], !0;
return !1;
}, this.publish = function(a) {
if (n.hasOwnProperty(a)) {
var c = Array.prototype.slice.call(arguments, 1), l = [];
for (var u in n[a]) {
var f = n[a][u];
try {
f[0].apply(s, c);
} catch (d) {
pe.console && st.error("jsPDF PubSub Error", d.message, d);
}
f[1] && l.push(u);
}
l.length && l.forEach(this.unsubscribe);
}
}, this.getTopics = function() {
return n;
};
}
function Lo(s) {
if (!(this instanceof Lo)) return new Lo(s);
var n = "opacity,stroke-opacity".split(",");
for (var a in s) s.hasOwnProperty(a) && n.indexOf(a) >= 0 && (this[a] = s[a]);
this.id = "", this.objectNumber = -1;
}
function Cf(s, n) {
this.gState = s, this.matrix = n, this.id = "", this.objectNumber = -1;
}
function $i(s, n, a, c, l) {
if (!(this instanceof $i)) return new $i(s, n, a, c, l);
this.type = s === "axial" ? 2 : 3, this.coords = n, this.colors = a, Cf.call(this, c, l);
}
function La(s, n, a, c, l) {
if (!(this instanceof La)) return new La(s, n, a, c, l);
this.boundingBox = s, this.xStep = n, this.yStep = a, this.stream = "", this.cloneIndex = 0, Cf.call(this, c, l);
}
function de(s) {
var n, a = typeof arguments[0] == "string" ? arguments[0] : "p", c = arguments[1], l = arguments[2], u = arguments[3], f = [], d = 1, p = 16, C = "S", Q = null;
et(s = s || {}) === "object" && (a = s.orientation, c = s.unit || c, l = s.format || l, u = s.compress || s.compressPdf || u, (Q = s.encryption || null) !== null && (Q.userPassword = Q.userPassword || "", Q.ownerPassword = Q.ownerPassword || "", Q.userPermissions = Q.userPermissions || []), d = typeof s.userUnit == "number" ? Math.abs(s.userUnit) : 1, s.precision !== void 0 && (n = s.precision), s.floatPrecision !== void 0 && (p = s.floatPrecision), C = s.defaultPathOperation || "S"), f = s.filters || (u === !0 ? ["FlateEncode"] : f), c = c || "mm", a = ("" + (a || "P")).toLowerCase();
var y = s.putOnlyUsedFonts || !1, L = {}, v = { internal: {}, __private__: {} };
v.__private__.PubSub = ql;
var k = "1.3", O = v.__private__.getPdfVersion = function() {
return k;
};
v.__private__.setPdfVersion = function(h) {
k = h;
};
var X = { a0: [2383.94, 3370.39], a1: [1683.78, 2383.94], a2: [1190.55, 1683.78], a3: [841.89, 1190.55], a4: [595.28, 841.89], a5: [419.53, 595.28], a6: [297.64, 419.53], a7: [209.76, 297.64], a8: [147.4, 209.76], a9: [104.88, 147.4], a10: [73.7, 104.88], b0: [2834.65, 4008.19], b1: [2004.09, 2834.65], b2: [1417.32, 2004.09], b3: [1000.63, 1417.32], b4: [708.66, 1000.63], b5: [498.9, 708.66], b6: [354.33, 498.9], b7: [249.45, 354.33], b8: [175.75, 249.45], b9: [124.72, 175.75], b10: [87.87, 124.72], c0: [2599.37, 3676.54], c1: [1836.85, 2599.37], c2: [1298.27, 1836.85], c3: [918.43, 1298.27], c4: [649.13, 918.43], c5: [459.21, 649.13], c6: [323.15, 459.21], c7: [229.61, 323.15], c8: [161.57, 229.61], c9: [113.39, 161.57], c10: [79.37, 113.39], dl: [311.81, 623.62], letter: [612, 792], "government-letter": [576, 756], legal: [612, 1008], "junior-legal": [576, 360], ledger: [1224, 792], tabloid: [792, 1224], "credit-card": [153, 243] };
v.__private__.getPageFormats = function() {
return X;
};
var P = v.__private__.getPageFormat = function(h) {
return X[h];
};
l = l || "a4";
var R = { COMPAT: "compat", ADVANCED: "advanced" }, iA = R.COMPAT;
function pA() {
this.saveGraphicsState(), z(new le(JA, 0, 0, -JA, 0, Vn() * JA).toString() + " cm"), this.setFontSize(this.getFontSize() / JA), C = "n", iA = R.ADVANCED;
}
function uA() {
this.restoreGraphicsState(), C = "S", iA = R.COMPAT;
}
var CA = v.__private__.combineFontStyleAndFontWeight = function(h, U) {
if (h == "bold" && U == "normal" || h == "bold" && U == 400 || h == "normal" && U == "italic" || h == "bold" && U == "italic") throw new Error("Invalid Combination of fontweight and fontstyle");
return U && (h = U == 400 || U === "normal" ? h === "italic" ? "italic" : "normal" : U != 700 && U !== "bold" || h !== "normal" ? (U == 700 ? "bold" : U) + "" + h : "bold"), h;
};
v.advancedAPI = function(h) {
var U = iA === R.COMPAT;
return U && pA.call(this), typeof h != "function" || (h(this), U && uA.call(this)), this;
}, v.compatAPI = function(h) {
var U = iA === R.ADVANCED;
return U && uA.call(this), typeof h != "function" || (h(this), U && pA.call(this)), this;
}, v.isAdvancedAPI = function() {
return iA === R.ADVANCED;
};
var lA, M = function(h) {
if (iA !== R.ADVANCED) throw new Error(h + " is only available in 'advanced' API mode. You need to call advancedAPI() first.");
}, G = v.roundToPrecision = v.__private__.roundToPrecision = function(h, U) {
var q = n || U;
if (isNaN(h) || isNaN(q)) throw new Error("Invalid argument passed to jsPDF.roundToPrecision");
return h.toFixed(q).replace(/0+$/, "");
};
lA = v.hpf = v.__private__.hpf = typeof p == "number" ? function(h) {
if (isNaN(h)) throw new Error("Invalid argument passed to jsPDF.hpf");
return G(h, p);
} : p === "smart" ? function(h) {
if (isNaN(h)) throw new Error("Invalid argument passed to jsPDF.hpf");
return G(h, h > -1 && h < 1 ? 16 : 5);
} : function(h) {
if (isNaN(h)) throw new Error("Invalid argument passed to jsPDF.hpf");
return G(h, 16);
};
var oA = v.f2 = v.__private__.f2 = function(h) {
if (isNaN(h)) throw new Error("Invalid argument passed to jsPDF.f2");
return G(h, 2);
}, N = v.__private__.f3 = function(h) {
if (isNaN(h)) throw new Error("Invalid argument passed to jsPDF.f3");
return G(h, 3);
}, S = v.scale = v.__private__.scale = function(h) {
if (isNaN(h)) throw new Error("Invalid argument passed to jsPDF.scale");
return iA === R.COMPAT ? h * JA : iA === R.ADVANCED ? h : void 0;
}, J = function(h) {
return iA === R.COMPAT ? Vn() - h : iA === R.ADVANCED ? h : void 0;
}, V = function(h) {
return S(J(h));
};
v.__private__.setPrecision = v.setPrecision = function(h) {
typeof parseInt(h, 10) == "number" && (n = parseInt(h, 10));
};
var cA, hA = "00000000000000000000000000000000", vA = v.__private__.getFileId = function() {
return hA;
}, fA = v.__private__.setFileId = function(h) {
return hA = h !== void 0 && /^[a-fA-F0-9]{32}$/.test(h) ? h.toUpperCase() : hA.split("").map(function() {
return "ABCDEF0123456789".charAt(Math.floor(16 * Math.random()));
}).join(""), Q !== null && (Rt = new Is(Q.userPermissions, Q.userPassword, Q.ownerPassword, hA)), hA;
};
v.setFileId = function(h) {
return fA(h), this;
}, v.getFileId = function() {
return vA();
};
var mA = v.__private__.convertDateToPDFDate = function(h) {
var U = h.getTimezoneOffset(), q = U < 0 ? "+" : "-", $ = Math.floor(Math.abs(U / 60)), BA = Math.abs(U % 60), UA = [q, W($), "'", W(BA), "'"].join("");
return ["D:", h.getFullYear(), W(h.getMonth() + 1), W(h.getDate()), W(h.getHours()), W(h.getMinutes()), W(h.getSeconds()), UA].join("");
}, bA = v.__private__.convertPDFDateToDate = function(h) {
var U = parseInt(h.substr(2, 4), 10), q = parseInt(h.substr(6, 2), 10) - 1, $ = parseInt(h.substr(8, 2), 10), BA = parseInt(h.substr(10, 2), 10), UA = parseInt(h.substr(12, 2), 10), NA = parseInt(h.substr(14, 2), 10);
return new Date(U, q, $, BA, UA, NA, 0);
}, OA = v.__private__.setCreationDate = function(h) {
var U;
if (h === void 0 && (h = /* @__PURE__ */ new Date()), h instanceof Date) U = mA(h);
else {
if (!/^D:(20[0-2][0-9]|203[0-7]|19[7-9][0-9])(0[0-9]|1[0-2])([0-2][0-9]|3[0-1])(0[0-9]|1[0-9]|2[0-3])(0[0-9]|[1-5][0-9])(0[0-9]|[1-5][0-9])(\+0[0-9]|\+1[0-4]|-0[0-9]|-1[0-1])'(0[0-9]|[1-5][0-9])'?$/.test(h)) throw new Error("Invalid argument passed to jsPDF.setCreationDate");
U = h;
}
return cA = U;
}, I = v.__private__.getCreationDate = function(h) {
var U = cA;
return h === "jsDate" && (U = bA(cA)), U;
};
v.setCreationDate = function(h) {
return OA(h), this;
}, v.getCreationDate = function(h) {
return I(h);
};
var j, W = v.__private__.padd2 = function(h) {
return ("0" + parseInt(h)).slice(-2);
}, Y = v.__private__.padd2Hex = function(h) {
return ("00" + (h = h.toString())).substr(h.length);
}, aA = 0, wA = [], QA = [], FA = 0, PA = [], TA = [], qA = !1, jA = QA, he = function() {
aA = 0, FA = 0, QA = [], wA = [], PA = [], kr = ct(), Sr = ct();
};
v.__private__.setCustomOutputDestination = function(h) {
qA = !0, jA = h;
};
var EA = function(h) {
qA || (jA = h);
};
v.__private__.resetCustomOutputDestination = function() {
qA = !1, jA = QA;
};
var z = v.__private__.out = function(h) {
return h = h.toString(), FA += h.length + 1, jA.push(h), jA;
}, Fe = v.__private__.write = function(h) {
return z(arguments.length === 1 ? h.toString() : Array.prototype.join.call(arguments, " "));
}, ee = v.__private__.getArrayBuffer = function(h) {
for (var U = h.length, q = new ArrayBuffer(U), $ = new Uint8Array(q); U--; ) $[U] = h.charCodeAt(U);
return q;
}, _A = [["Helvetica", "helvetica", "normal", "WinAnsiEncoding"], ["Helvetica-Bold", "helvetica", "bold", "WinAnsiEncoding"], ["Helvetica-Oblique", "helvetica", "italic", "WinAnsiEncoding"], ["Helvetica-BoldOblique", "helvetica", "bolditalic", "WinAnsiEncoding"], ["Courier", "courier", "normal", "WinAnsiEncoding"], ["Courier-Bold", "courier", "bold", "WinAnsiEncoding"], ["Courier-Oblique", "courier", "italic", "WinAnsiEncoding"], ["Courier-BoldOblique", "courier", "bolditalic", "WinAnsiEncoding"], ["Times-Roman", "times", "normal", "WinAnsiEncoding"], ["Times-Bold", "times", "bold", "WinAnsiEncoding"], ["Times-Italic", "times", "italic", "WinAnsiEncoding"], ["Times-BoldItalic", "times", "bolditalic", "WinAnsiEncoding"], ["ZapfDingbats", "zapfdingbats", "normal", null], ["Symbol", "symbol", "normal", null]];
v.__private__.getStandardFonts = function() {
return _A;
};
var KA = s.fontSize || 16;
v.__private__.setFontSize = v.setFontSize = function(h) {
return KA = iA === R.ADVANCED ? h / JA : h, this;
};
var WA, XA = v.__private__.getFontSize = v.getFontSize = function() {
return iA === R.COMPAT ? KA : KA * JA;
}, ie = s.R2L || !1;
v.__private__.setR2L = v.setR2L = function(h) {
return ie = h, this;
}, v.__private__.getR2L = v.getR2L = function() {
return ie;
};
var we, ye = v.__private__.setZoomMode = function(h) {
var U = [void 0, null, "fullwidth", "fullheight", "fullpage", "original"];
if (/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(h)) WA = h;
else if (isNaN(h)) {
if (U.indexOf(h) === -1) throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "' + h + '" is not recognized.');
WA = h;
} else WA = parseInt(h, 10);
};
v.__private__.getZoomMode = function() {
return WA;
};
var Le, Me = v.__private__.setPageMode = function(h) {
if ([void 0, null, "UseNone", "UseOutlines", "UseThumbs", "FullScreen"].indexOf(h) == -1) throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "' + h + '" is not recognized.');
we = h;
};
v.__private__.getPageMode = function() {
return we;
};
var qe = v.__private__.setLayoutMode = function(h) {
if ([void 0, null, "continuous", "single", "twoleft", "tworight", "two"].indexOf(h) == -1) throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "' + h + '" is not recognized.');
Le = h;
};
v.__private__.getLayoutMode = function() {
return Le;
}, v.__private__.setDisplayMode = v.setDisplayMode = function(h, U, q) {
return ye(h), qe(U), Me(q), this;
};
var Be = { title: "", subject: "", author: "", keywords: "", creator: "" };
v.__private__.getDocumentProperty = function(h) {
if (Object.keys(Be).indexOf(h) === -1) throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");
return Be[h];
}, v.__private__.getDocumentProperties = function() {
return Be;
}, v.__private__.setDocumentProperties = v.setProperties = v.setDocumentProperties = function(h) {
for (var U in Be) Be.hasOwnProperty(U) && h[U] && (Be[U] = h[U]);
return this;
}, v.__private__.setDocumentProperty = function(h, U) {
if (Object.keys(Be).indexOf(h) === -1) throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");
return Be[h] = U;
};
var Ie, JA, Bt, be, qt, Ge = {}, Xe = {}, Zr = [], He = {}, ti = {}, it = {}, er = {}, Mr = null, ot = 0, ve = [], De = new ql(v), vn = s.hotfixes || [], Ct = {}, pr = {}, xr = [], le = function h(U, q, $, BA, UA, NA) {
if (!(this instanceof h)) return new h(U, q, $, BA, UA, NA);
isNaN(U) && (U = 1), isNaN(q) && (q = 0), isNaN($) && ($ = 0), isNaN(BA) && (BA = 1), isNaN(UA) && (UA = 0), isNaN(NA) && (NA = 0), this._matrix = [U, q, $, BA, UA, NA];
};
Object.defineProperty(le.prototype, "sx", { get: function() {
return this._matrix[0];
}, set: function(h) {
this._matrix[0] = h;
} }), Object.defineProperty(le.prototype, "shy", { get: function() {
return this._matrix[1];
}, set: function(h) {
this._matrix[1] = h;
} }), Object.defineProperty(le.prototype, "shx", { get: function() {
return this._matrix[2];
}, set: function(h) {
this._matrix[2] = h;
} }), Object.defineProperty(le.prototype, "sy", { get: function() {
return this._matrix[3];
}, set: function(h) {
this._matrix[3] = h;
} }), Object.defineProperty(le.prototype, "tx", { get: function() {
return this._matrix[4];
}, set: function(h) {
this._matrix[4] = h;
} }), Object.defineProperty(le.prototype, "ty", { get: function() {
return this._matrix[5];
}, set: function(h) {
this._matrix[5] = h;
} }), Object.defineProperty(le.prototype, "a", { get: function() {
return this._matrix[0];
}, set: function(h) {
this._matrix[0] = h;
} }), Object.defineProperty(le.prototype, "b", { get: function() {
return this._matrix[1];
}, set: function(h) {
this._matrix[1] = h;
} }), Object.defineProperty(le.prototype, "c", { get: function() {
return this._matrix[2];
}, set: function(h) {
this._matrix[2] = h;
} }), Object.defineProperty(le.prototype, "d", { get: function() {
return this._matrix[3];
}, set: function(h) {
this._matrix[3] = h;
} }), Object.defineProperty(le.prototype, "e", { get: function() {
return this._matrix[4];
}, set: function(h) {
this._matrix[4] = h;
} }), Object.defineProperty(le.prototype, "f", { get: function() {
return this._matrix[5];
}, set: function(h) {
this._matrix[5] = h;
} }), Object.defineProperty(le.prototype, "rotation", { get: function() {
return Math.atan2(this.shx, this.sx);
} }), Object.defineProperty(le.prototype, "scaleX", { get: function() {
return this.decompose().scale.sx;
} }), Object.defineProperty(le.prototype, "scaleY", { get: function() {
return this.decompose().scale.sy;
} }), Object.defineProperty(le.prototype, "isIdentity", { get: function() {
return this.sx === 1 && this.shy === 0 && this.shx === 0 && this.sy === 1 && this.tx === 0 && this.ty === 0;
} }), le.prototype.join = function(h) {
return [this.sx, this.shy, this.shx, this.sy, this.tx, this.ty].map(lA).join(h);
}, le.prototype.multiply = function(h) {
var U = h.sx * this.sx + h.shy * this.shx, q = h.sx * this.shy + h.shy * this.sy, $ = h.shx *