vue-data-ui
Version:
A user-empowering data visualization Vue 3 components library for eloquent data storytelling
8,095 lines • 486 kB
JavaScript
function he(r) {
"@babel/helpers - typeof";
return he = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(e) {
return typeof e;
} : function(e) {
return e && typeof Symbol == "function" && e.constructor === Symbol && e !== Symbol.prototype ? "symbol" : typeof e;
}, he(r);
}
var tn = Uint8Array, vn = Uint16Array, _o = Int32Array, ps = new tn([
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
]), gs = new tn([
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
]), go = new tn([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), Nu = function(r, e) {
for (var n = new vn(31), a = 0; a < 31; ++a)
n[a] = e += 1 << r[a - 1];
for (var u = new _o(n[30]), a = 1; a < 30; ++a)
for (var s = n[a]; s < n[a + 1]; ++s)
u[s] = s - n[a] << 5 | a;
return { b: n, r: u };
}, Au = Nu(ps, 2), xu = Au.b, mo = Au.r;
xu[28] = 258, mo[258] = 28;
var Su = Nu(gs, 0), _l = Su.b, nu = Su.r, vo = new vn(32768);
for (var we = 0; we < 32768; ++we) {
var kr = (we & 43690) >> 1 | (we & 21845) << 1;
kr = (kr & 52428) >> 2 | (kr & 13107) << 2, kr = (kr & 61680) >> 4 | (kr & 3855) << 4, vo[we] = ((kr & 65280) >> 8 | (kr & 255) << 8) >> 1;
}
var tr = function(r, e, n) {
for (var a = r.length, u = 0, s = new vn(e); u < a; ++u)
r[u] && ++s[r[u] - 1];
var c = new vn(e);
for (u = 1; u < e; ++u)
c[u] = c[u - 1] + s[u - 1] << 1;
var f;
if (n) {
f = new vn(1 << e);
var h = 15 - e;
for (u = 0; u < a; ++u)
if (r[u])
for (var g = u << 4 | r[u], y = e - r[u], w = c[r[u] - 1]++ << y, S = w | (1 << y) - 1; w <= S; ++w)
f[vo[w] >> h] = g;
} else
for (f = new vn(a), u = 0; u < a; ++u)
r[u] && (f[u] = vo[c[r[u] - 1]++] >> 15 - r[u]);
return f;
}, Cr = new tn(288);
for (var we = 0; we < 144; ++we)
Cr[we] = 8;
for (var we = 144; we < 256; ++we)
Cr[we] = 9;
for (var we = 256; we < 280; ++we)
Cr[we] = 7;
for (var we = 280; we < 288; ++we)
Cr[we] = 8;
var da = new tn(32);
for (var we = 0; we < 32; ++we)
da[we] = 5;
var Pl = /* @__PURE__ */ tr(Cr, 9, 0), kl = /* @__PURE__ */ tr(Cr, 9, 1), Fl = /* @__PURE__ */ tr(da, 5, 0), Il = /* @__PURE__ */ tr(da, 5, 1), ao = function(r) {
for (var e = r[0], n = 1; n < r.length; ++n)
r[n] > e && (e = r[n]);
return e;
}, qn = function(r, e, n) {
var a = e / 8 | 0;
return (r[a] | r[a + 1] << 8) >> (e & 7) & n;
}, so = function(r, e) {
var n = e / 8 | 0;
return (r[n] | r[n + 1] << 8 | r[n + 2] << 16) >> (e & 7);
}, Po = function(r) {
return (r + 7) / 8 | 0;
}, _u = function(r, e, n) {
return (n == null || n > r.length) && (n = r.length), new tn(r.subarray(e, n));
}, Cl = [
"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
], Rn = function(r, e, n) {
var a = new Error(e || Cl[r]);
if (a.code = r, Error.captureStackTrace && Error.captureStackTrace(a, Rn), !n)
throw a;
return a;
}, jl = function(r, e, n, a) {
var u = r.length, s = 0;
if (!u || e.f && !e.l)
return n || new tn(0);
var c = !n, f = c || e.i != 2, h = e.i;
c && (n = new tn(u * 3));
var g = function(Nt) {
var Ft = n.length;
if (Nt > Ft) {
var _t = new tn(Math.max(Ft * 2, Nt));
_t.set(n), n = _t;
}
}, y = e.f || 0, w = e.p || 0, S = e.b || 0, p = e.l, O = e.d, F = e.m, q = e.n, _ = u * 8;
do {
if (!p) {
y = qn(r, w, 1);
var M = qn(r, w + 1, 3);
if (w += 3, M)
if (M == 1)
p = kl, O = Il, F = 9, q = 5;
else if (M == 2) {
var wt = qn(r, w, 31) + 257, tt = qn(r, w + 10, 15) + 4, z = wt + qn(r, w + 5, 31) + 1;
w += 14;
for (var rt = new tn(z), pt = new tn(19), P = 0; P < tt; ++P)
pt[go[P]] = qn(r, w + P * 3, 7);
w += tt * 3;
for (var k = ao(pt), W = (1 << k) - 1, D = tr(pt, k, 1), P = 0; P < z; ) {
var ot = D[qn(r, w, W)];
w += ot & 15;
var Y = ot >> 4;
if (Y < 16)
rt[P++] = Y;
else {
var it = 0, ft = 0;
for (Y == 16 ? (ft = 3 + qn(r, w, 3), w += 2, it = rt[P - 1]) : Y == 17 ? (ft = 3 + qn(r, w, 7), w += 3) : Y == 18 && (ft = 11 + qn(r, w, 127), w += 7); ft--; )
rt[P++] = it;
}
}
var $ = rt.subarray(0, wt), lt = rt.subarray(wt);
F = ao($), q = ao(lt), p = tr($, F, 1), O = tr(lt, q, 1);
} else
Rn(1);
else {
var Y = Po(w) + 4, st = r[Y - 4] | r[Y - 3] << 8, ct = Y + st;
if (ct > u) {
h && Rn(0);
break;
}
f && g(S + st), n.set(r.subarray(Y, ct), S), e.b = S += st, e.p = w = ct * 8, e.f = y;
continue;
}
if (w > _) {
h && Rn(0);
break;
}
}
f && g(S + 131072);
for (var dt = (1 << F) - 1, jt = (1 << q) - 1, N = w; ; N = w) {
var it = p[so(r, w) & dt], C = it >> 4;
if (w += it & 15, w > _) {
h && Rn(0);
break;
}
if (it || Rn(2), C < 256)
n[S++] = C;
else if (C == 256) {
N = w, p = null;
break;
} else {
var B = C - 254;
if (C > 264) {
var P = C - 257, T = ps[P];
B = qn(r, w, (1 << T) - 1) + xu[P], w += T;
}
var J = O[so(r, w) & jt], Q = J >> 4;
J || Rn(3), w += J & 15;
var lt = _l[Q];
if (Q > 3) {
var T = gs[Q];
lt += so(r, w) & (1 << T) - 1, w += T;
}
if (w > _) {
h && Rn(0);
break;
}
f && g(S + 131072);
var et = S + B;
if (S < lt) {
var nt = s - lt, At = Math.min(lt, et);
for (nt + S < 0 && Rn(3); S < At; ++S)
n[S] = a[nt + S];
}
for (; S < et; ++S)
n[S] = n[S - lt];
}
}
e.l = p, e.p = N, e.b = S, e.f = y, p && (y = 1, e.m = F, e.d = O, e.n = q);
} while (!y);
return S != n.length && c ? _u(n, 0, S) : n.subarray(0, S);
}, dr = function(r, e, n) {
n <<= e & 7;
var a = e / 8 | 0;
r[a] |= n, r[a + 1] |= n >> 8;
}, ca = function(r, e, n) {
n <<= e & 7;
var a = e / 8 | 0;
r[a] |= n, r[a + 1] |= n >> 8, r[a + 2] |= n >> 16;
}, oo = function(r, e) {
for (var n = [], a = 0; a < r.length; ++a)
r[a] && n.push({ s: a, f: r[a] });
var u = n.length, s = n.slice();
if (!u)
return { t: ku, l: 0 };
if (u == 1) {
var c = new tn(n[0].s + 1);
return c[n[0].s] = 1, { t: c, l: 1 };
}
n.sort(function(ct, wt) {
return ct.f - wt.f;
}), n.push({ s: -1, f: 25001 });
var f = n[0], h = n[1], g = 0, y = 1, w = 2;
for (n[0] = { s: -1, f: f.f + h.f, l: f, r: h }; y != u - 1; )
f = n[n[g].f < n[w].f ? g++ : w++], h = n[g != y && n[g].f < n[w].f ? g++ : w++], n[y++] = { s: -1, f: f.f + h.f, l: f, r: h };
for (var S = s[0].s, a = 1; a < u; ++a)
s[a].s > S && (S = s[a].s);
var p = new vn(S + 1), O = bo(n[y - 1], p, 0);
if (O > e) {
var a = 0, F = 0, q = O - e, _ = 1 << q;
for (s.sort(function(wt, tt) {
return p[tt.s] - p[wt.s] || wt.f - tt.f;
}); a < u; ++a) {
var M = s[a].s;
if (p[M] > e)
F += _ - (1 << O - p[M]), p[M] = e;
else
break;
}
for (F >>= q; F > 0; ) {
var Y = s[a].s;
p[Y] < e ? F -= 1 << e - p[Y]++ - 1 : ++a;
}
for (; a >= 0 && F; --a) {
var st = s[a].s;
p[st] == e && (--p[st], ++F);
}
O = e;
}
return { t: new tn(p), l: O };
}, bo = function(r, e, n) {
return r.s == -1 ? Math.max(bo(r.l, e, n + 1), bo(r.r, e, n + 1)) : e[r.s] = n;
}, ru = function(r) {
for (var e = r.length; e && !r[--e]; )
;
for (var n = new vn(++e), a = 0, u = r[0], s = 1, c = function(h) {
n[a++] = h;
}, f = 1; f <= e; ++f)
if (r[f] == u && f != e)
++s;
else {
if (!u && s > 2) {
for (; s > 138; s -= 138)
c(32754);
s > 2 && (c(s > 10 ? s - 11 << 5 | 28690 : s - 3 << 5 | 12305), s = 0);
} else if (s > 3) {
for (c(u), --s; s > 6; s -= 6)
c(8304);
s > 2 && (c(s - 3 << 5 | 8208), s = 0);
}
for (; s--; )
c(u);
s = 1, u = r[f];
}
return { c: n.subarray(0, a), n: e };
}, fa = function(r, e) {
for (var n = 0, a = 0; a < e.length; ++a)
n += r[a] * e[a];
return n;
}, Pu = function(r, e, n) {
var a = n.length, u = Po(e + 2);
r[u] = a & 255, r[u + 1] = a >> 8, r[u + 2] = r[u] ^ 255, r[u + 3] = r[u + 1] ^ 255;
for (var s = 0; s < a; ++s)
r[u + s + 4] = n[s];
return (u + 4 + a) * 8;
}, iu = function(r, e, n, a, u, s, c, f, h, g, y) {
dr(e, y++, n), ++u[256];
for (var w = oo(u, 15), S = w.t, p = w.l, O = oo(s, 15), F = O.t, q = O.l, _ = ru(S), M = _.c, Y = _.n, st = ru(F), ct = st.c, wt = st.n, tt = new vn(19), z = 0; z < M.length; ++z)
++tt[M[z] & 31];
for (var z = 0; z < ct.length; ++z)
++tt[ct[z] & 31];
for (var rt = oo(tt, 7), pt = rt.t, P = rt.l, k = 19; k > 4 && !pt[go[k - 1]]; --k)
;
var W = g + 5 << 3, D = fa(u, Cr) + fa(s, da) + c, ot = fa(u, S) + fa(s, F) + c + 14 + 3 * k + fa(tt, pt) + 2 * tt[16] + 3 * tt[17] + 7 * tt[18];
if (h >= 0 && W <= D && W <= ot)
return Pu(e, y, r.subarray(h, h + g));
var it, ft, $, lt;
if (dr(e, y, 1 + (ot < D)), y += 2, ot < D) {
it = tr(S, p, 0), ft = S, $ = tr(F, q, 0), lt = F;
var dt = tr(pt, P, 0);
dr(e, y, Y - 257), dr(e, y + 5, wt - 1), dr(e, y + 10, k - 4), y += 14;
for (var z = 0; z < k; ++z)
dr(e, y + 3 * z, pt[go[z]]);
y += 3 * k;
for (var jt = [M, ct], N = 0; N < 2; ++N)
for (var C = jt[N], z = 0; z < C.length; ++z) {
var B = C[z] & 31;
dr(e, y, dt[B]), y += pt[B], B > 15 && (dr(e, y, C[z] >> 5 & 127), y += C[z] >> 12);
}
} else
it = Pl, ft = Cr, $ = Fl, lt = da;
for (var z = 0; z < f; ++z) {
var T = a[z];
if (T > 255) {
var B = T >> 18 & 31;
ca(e, y, it[B + 257]), y += ft[B + 257], B > 7 && (dr(e, y, T >> 23 & 31), y += ps[B]);
var J = T & 31;
ca(e, y, $[J]), y += lt[J], J > 3 && (ca(e, y, T >> 5 & 8191), y += gs[J]);
} else
ca(e, y, it[T]), y += ft[T];
}
return ca(e, y, it[256]), y + ft[256];
}, Ol = /* @__PURE__ */ new _o([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), ku = /* @__PURE__ */ new tn(0), Ml = function(r, e, n, a, u, s) {
var c = s.z || r.length, f = new tn(a + c + 5 * (1 + Math.ceil(c / 7e3)) + u), h = f.subarray(a, f.length - u), g = s.l, y = (s.r || 0) & 7;
if (e) {
y && (h[0] = s.r >> 3);
for (var w = Ol[e - 1], S = w >> 13, p = w & 8191, O = (1 << n) - 1, F = s.p || new vn(32768), q = s.h || new vn(O + 1), _ = Math.ceil(n / 3), M = 2 * _, Y = function(zt) {
return (r[zt] ^ r[zt + 1] << _ ^ r[zt + 2] << M) & O;
}, st = new _o(25e3), ct = new vn(288), wt = new vn(32), tt = 0, z = 0, rt = s.i || 0, pt = 0, P = s.w || 0, k = 0; rt + 2 < c; ++rt) {
var W = Y(rt), D = rt & 32767, ot = q[W];
if (F[D] = ot, q[W] = D, P <= rt) {
var it = c - rt;
if ((tt > 7e3 || pt > 24576) && (it > 423 || !g)) {
y = iu(r, h, 0, st, ct, wt, z, pt, k, rt - k, y), pt = tt = z = 0, k = rt;
for (var ft = 0; ft < 286; ++ft)
ct[ft] = 0;
for (var ft = 0; ft < 30; ++ft)
wt[ft] = 0;
}
var $ = 2, lt = 0, dt = p, jt = D - ot & 32767;
if (it > 2 && W == Y(rt - jt))
for (var N = Math.min(S, it) - 1, C = Math.min(32767, rt), B = Math.min(258, it); jt <= C && --dt && D != ot; ) {
if (r[rt + $] == r[rt + $ - jt]) {
for (var T = 0; T < B && r[rt + T] == r[rt + T - jt]; ++T)
;
if (T > $) {
if ($ = T, lt = jt, T > N)
break;
for (var J = Math.min(jt, T - 2), Q = 0, ft = 0; ft < J; ++ft) {
var et = rt - jt + ft & 32767, nt = F[et], At = et - nt & 32767;
At > Q && (Q = At, ot = et);
}
}
}
D = ot, ot = F[D], jt += D - ot & 32767;
}
if (lt) {
st[pt++] = 268435456 | mo[$] << 18 | nu[lt];
var Nt = mo[$] & 31, Ft = nu[lt] & 31;
z += ps[Nt] + gs[Ft], ++ct[257 + Nt], ++wt[Ft], P = rt + $, ++tt;
} else
st[pt++] = r[rt], ++ct[r[rt]];
}
}
for (rt = Math.max(rt, P); rt < c; ++rt)
st[pt++] = r[rt], ++ct[r[rt]];
y = iu(r, h, g, st, ct, wt, z, pt, k, rt - k, y), g || (s.r = y & 7 | h[y / 8 | 0] << 3, y -= 7, s.h = q, s.p = F, s.i = rt, s.w = P);
} else {
for (var rt = s.w || 0; rt < c + g; rt += 65535) {
var _t = rt + 65535;
_t >= c && (h[y / 8 | 0] = g, _t = c), y = Pu(h, y + 1, r.subarray(rt, _t));
}
s.i = c;
}
return _u(f, 0, a + Po(y) + u);
}, Fu = function() {
var r = 1, e = 0;
return {
p: function(n) {
for (var a = r, u = e, s = n.length | 0, c = 0; c != s; ) {
for (var f = Math.min(c + 2655, s); c < f; ++c)
u += a += n[c];
a = (a & 65535) + 15 * (a >> 16), u = (u & 65535) + 15 * (u >> 16);
}
r = a, e = u;
},
d: function() {
return r %= 65521, e %= 65521, (r & 255) << 24 | (r & 65280) << 8 | (e & 255) << 8 | e >> 8;
}
};
}, Bl = function(r, e, n, a, u) {
if (!u && (u = { l: 1 }, e.dictionary)) {
var s = e.dictionary.subarray(-32768), c = new tn(s.length + r.length);
c.set(s), c.set(r, s.length), r = c, u.w = s.length;
}
return Ml(r, e.level == null ? 6 : e.level, e.mem == null ? u.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(r.length))) * 1.5) : 20 : 12 + e.mem, n, a, u);
}, Iu = function(r, e, n) {
for (; n; ++e)
r[e] = n, n >>>= 8;
}, El = function(r, e) {
var n = e.level, a = n == 0 ? 0 : n < 6 ? 1 : n == 9 ? 3 : 2;
if (r[0] = 120, r[1] = a << 6 | (e.dictionary && 32), r[1] |= 31 - (r[0] << 8 | r[1]) % 31, e.dictionary) {
var u = Fu();
u.p(e.dictionary), Iu(r, 2, u.d());
}
}, ql = function(r, e) {
return ((r[0] & 15) != 8 || r[0] >> 4 > 7 || (r[0] << 8 | r[1]) % 31) && Rn(6, "invalid zlib data"), (r[1] >> 5 & 1) == 1 && Rn(6, "invalid zlib data: " + (r[1] & 32 ? "need" : "unexpected") + " dictionary"), (r[1] >> 3 & 4) + 2;
};
function yo(r, e) {
e || (e = {});
var n = Fu();
n.p(r);
var a = Bl(r, e, e.dictionary ? 6 : 2, 4);
return El(a, e), Iu(a, a.length - 4, n.d()), a;
}
function Dl(r, e) {
return jl(r.subarray(ql(r), -4), { i: 2 }, e, e);
}
var Rl = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), Tl = 0;
try {
Rl.decode(ku, { stream: !0 }), Tl = 1;
} catch {
}
/** @license
*
* jsPDF - PDF Document creation from JavaScript
* Version 3.0.1 Built on 2025-03-17T14:19:36.873Z
* 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 Ht = /* @__PURE__ */ function() {
return typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : this;
}();
function uo() {
Ht.console && typeof Ht.console.log == "function" && Ht.console.log.apply(Ht.console, arguments);
}
var ve = { log: uo, warn: function(r) {
Ht.console && (typeof Ht.console.warn == "function" ? Ht.console.warn.apply(Ht.console, arguments) : uo.call(null, arguments));
}, error: function(r) {
Ht.console && (typeof Ht.console.error == "function" ? Ht.console.error.apply(Ht.console, arguments) : uo(r));
} };
function lo(r, e, n) {
var a = new XMLHttpRequest();
a.open("GET", r), a.responseType = "blob", a.onload = function() {
Gr(a.response, e, n);
}, a.onerror = function() {
ve.error("could not download file");
}, a.send();
}
function au(r) {
var e = new XMLHttpRequest();
e.open("HEAD", r, !1);
try {
e.send();
} catch {
}
return e.status >= 200 && e.status <= 299;
}
function is(r) {
try {
r.dispatchEvent(new MouseEvent("click"));
} catch {
var e = document.createEvent("MouseEvents");
e.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), r.dispatchEvent(e);
}
}
var ha, wo, Gr = Ht.saveAs || ((typeof window > "u" ? "undefined" : he(window)) !== "object" || window !== Ht ? function() {
} : typeof HTMLAnchorElement < "u" && "download" in HTMLAnchorElement.prototype ? function(r, e, n) {
var a = Ht.URL || Ht.webkitURL, u = document.createElement("a");
e = e || r.name || "download", u.download = e, u.rel = "noopener", typeof r == "string" ? (u.href = r, u.origin !== location.origin ? au(u.href) ? lo(r, e, n) : is(u, u.target = "_blank") : is(u)) : (u.href = a.createObjectURL(r), setTimeout(function() {
a.revokeObjectURL(u.href);
}, 4e4), setTimeout(function() {
is(u);
}, 0));
} : "msSaveOrOpenBlob" in navigator ? function(r, e, n) {
if (e = e || r.name || "download", typeof r == "string") if (au(r)) lo(r, e, n);
else {
var a = document.createElement("a");
a.href = r, a.target = "_blank", setTimeout(function() {
is(a);
});
}
else navigator.msSaveOrOpenBlob(function(u, s) {
return s === void 0 ? s = { autoBom: !1 } : he(s) !== "object" && (ve.warn("Deprecated: Expected third argument to be a object"), s = { autoBom: !s }), s.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(u.type) ? new Blob(["\uFEFF", u], { type: u.type }) : u;
}(r, n), e);
} : function(r, e, n, a) {
if ((a = a || open("", "_blank")) && (a.document.title = a.document.body.innerText = "downloading..."), typeof r == "string") return lo(r, e, n);
var u = r.type === "application/octet-stream", s = /constructor/i.test(Ht.HTMLElement) || Ht.safari, c = /CriOS\/[\d]+/.test(navigator.userAgent);
if ((c || u && s) && (typeof FileReader > "u" ? "undefined" : he(FileReader)) === "object") {
var f = new FileReader();
f.onloadend = function() {
var y = f.result;
y = c ? y : y.replace(/^data:[^;]*;/, "data:attachment/file;"), a ? a.location.href = y : location = y, a = null;
}, f.readAsDataURL(r);
} else {
var h = Ht.URL || Ht.webkitURL, g = h.createObjectURL(r);
a ? a.location = g : location.href = g, a = null, setTimeout(function() {
h.revokeObjectURL(g);
}, 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 Cu(r) {
var e;
r = r || "", this.ok = !1, r.charAt(0) == "#" && (r = r.substr(1, 6)), r = { 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" }[r = (r = r.replace(/ /g, "")).toLowerCase()] || r;
for (var n = [{ re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/, example: ["rgb(123, 234, 45)", "rgb(255,234,245)"], process: function(f) {
return [parseInt(f[1]), parseInt(f[2]), parseInt(f[3])];
} }, { re: /^(\w{2})(\w{2})(\w{2})$/, example: ["#00ff00", "336699"], process: function(f) {
return [parseInt(f[1], 16), parseInt(f[2], 16), parseInt(f[3], 16)];
} }, { re: /^(\w{1})(\w{1})(\w{1})$/, example: ["#fb0", "f0f"], process: function(f) {
return [parseInt(f[1] + f[1], 16), parseInt(f[2] + f[2], 16), parseInt(f[3] + f[3], 16)];
} }], a = 0; a < n.length; a++) {
var u = n[a].re, s = n[a].process, c = u.exec(r);
c && (e = s(c), this.r = e[0], this.g = e[1], this.b = e[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 f = this.r.toString(16), h = this.g.toString(16), g = this.b.toString(16);
return f.length == 1 && (f = "0" + f), h.length == 1 && (h = "0" + h), g.length == 1 && (g = "0" + g), "#" + f + h + g;
};
}
/**
* @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 co(r, e) {
var n = r[0], a = r[1], u = r[2], s = r[3];
n = Ke(n, a, u, s, e[0], 7, -680876936), s = Ke(s, n, a, u, e[1], 12, -389564586), u = Ke(u, s, n, a, e[2], 17, 606105819), a = Ke(a, u, s, n, e[3], 22, -1044525330), n = Ke(n, a, u, s, e[4], 7, -176418897), s = Ke(s, n, a, u, e[5], 12, 1200080426), u = Ke(u, s, n, a, e[6], 17, -1473231341), a = Ke(a, u, s, n, e[7], 22, -45705983), n = Ke(n, a, u, s, e[8], 7, 1770035416), s = Ke(s, n, a, u, e[9], 12, -1958414417), u = Ke(u, s, n, a, e[10], 17, -42063), a = Ke(a, u, s, n, e[11], 22, -1990404162), n = Ke(n, a, u, s, e[12], 7, 1804603682), s = Ke(s, n, a, u, e[13], 12, -40341101), u = Ke(u, s, n, a, e[14], 17, -1502002290), n = Ze(n, a = Ke(a, u, s, n, e[15], 22, 1236535329), u, s, e[1], 5, -165796510), s = Ze(s, n, a, u, e[6], 9, -1069501632), u = Ze(u, s, n, a, e[11], 14, 643717713), a = Ze(a, u, s, n, e[0], 20, -373897302), n = Ze(n, a, u, s, e[5], 5, -701558691), s = Ze(s, n, a, u, e[10], 9, 38016083), u = Ze(u, s, n, a, e[15], 14, -660478335), a = Ze(a, u, s, n, e[4], 20, -405537848), n = Ze(n, a, u, s, e[9], 5, 568446438), s = Ze(s, n, a, u, e[14], 9, -1019803690), u = Ze(u, s, n, a, e[3], 14, -187363961), a = Ze(a, u, s, n, e[8], 20, 1163531501), n = Ze(n, a, u, s, e[13], 5, -1444681467), s = Ze(s, n, a, u, e[2], 9, -51403784), u = Ze(u, s, n, a, e[7], 14, 1735328473), n = $e(n, a = Ze(a, u, s, n, e[12], 20, -1926607734), u, s, e[5], 4, -378558), s = $e(s, n, a, u, e[8], 11, -2022574463), u = $e(u, s, n, a, e[11], 16, 1839030562), a = $e(a, u, s, n, e[14], 23, -35309556), n = $e(n, a, u, s, e[1], 4, -1530992060), s = $e(s, n, a, u, e[4], 11, 1272893353), u = $e(u, s, n, a, e[7], 16, -155497632), a = $e(a, u, s, n, e[10], 23, -1094730640), n = $e(n, a, u, s, e[13], 4, 681279174), s = $e(s, n, a, u, e[0], 11, -358537222), u = $e(u, s, n, a, e[3], 16, -722521979), a = $e(a, u, s, n, e[6], 23, 76029189), n = $e(n, a, u, s, e[9], 4, -640364487), s = $e(s, n, a, u, e[12], 11, -421815835), u = $e(u, s, n, a, e[15], 16, 530742520), n = Qe(n, a = $e(a, u, s, n, e[2], 23, -995338651), u, s, e[0], 6, -198630844), s = Qe(s, n, a, u, e[7], 10, 1126891415), u = Qe(u, s, n, a, e[14], 15, -1416354905), a = Qe(a, u, s, n, e[5], 21, -57434055), n = Qe(n, a, u, s, e[12], 6, 1700485571), s = Qe(s, n, a, u, e[3], 10, -1894986606), u = Qe(u, s, n, a, e[10], 15, -1051523), a = Qe(a, u, s, n, e[1], 21, -2054922799), n = Qe(n, a, u, s, e[8], 6, 1873313359), s = Qe(s, n, a, u, e[15], 10, -30611744), u = Qe(u, s, n, a, e[6], 15, -1560198380), a = Qe(a, u, s, n, e[13], 21, 1309151649), n = Qe(n, a, u, s, e[4], 6, -145523070), s = Qe(s, n, a, u, e[11], 10, -1120210379), u = Qe(u, s, n, a, e[2], 15, 718787259), a = Qe(a, u, s, n, e[9], 21, -343485551), r[0] = Ir(n, r[0]), r[1] = Ir(a, r[1]), r[2] = Ir(u, r[2]), r[3] = Ir(s, r[3]);
}
function ms(r, e, n, a, u, s) {
return e = Ir(Ir(e, r), Ir(a, s)), Ir(e << u | e >>> 32 - u, n);
}
function Ke(r, e, n, a, u, s, c) {
return ms(e & n | ~e & a, r, e, u, s, c);
}
function Ze(r, e, n, a, u, s, c) {
return ms(e & a | n & ~a, r, e, u, s, c);
}
function $e(r, e, n, a, u, s, c) {
return ms(e ^ n ^ a, r, e, u, s, c);
}
function Qe(r, e, n, a, u, s, c) {
return ms(n ^ (e | ~a), r, e, u, s, c);
}
function ju(r) {
var e, n = r.length, a = [1732584193, -271733879, -1732584194, 271733878];
for (e = 64; e <= r.length; e += 64) co(a, zl(r.substring(e - 64, e)));
r = r.substring(e - 64);
var u = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
for (e = 0; e < r.length; e++) u[e >> 2] |= r.charCodeAt(e) << (e % 4 << 3);
if (u[e >> 2] |= 128 << (e % 4 << 3), e > 55) for (co(a, u), e = 0; e < 16; e++) u[e] = 0;
return u[14] = 8 * n, co(a, u), a;
}
function zl(r) {
var e, n = [];
for (e = 0; e < 64; e += 4) n[e >> 2] = r.charCodeAt(e) + (r.charCodeAt(e + 1) << 8) + (r.charCodeAt(e + 2) << 16) + (r.charCodeAt(e + 3) << 24);
return n;
}
ha = Ht.atob.bind(Ht), wo = Ht.btoa.bind(Ht);
var su = "0123456789abcdef".split("");
function Ul(r) {
for (var e = "", n = 0; n < 4; n++) e += su[r >> 8 * n + 4 & 15] + su[r >> 8 * n & 15];
return e;
}
function Hl(r) {
return String.fromCharCode((255 & r) >> 0, (65280 & r) >> 8, (16711680 & r) >> 16, (4278190080 & r) >> 24);
}
function Lo(r) {
return ju(r).map(Hl).join("");
}
var Wl = function(r) {
for (var e = 0; e < r.length; e++) r[e] = Ul(r[e]);
return r.join("");
}(ju("hello")) != "5d41402abc4b2a76b9719d911017c592";
function Ir(r, e) {
if (Wl) {
var n = (65535 & r) + (65535 & e);
return (r >> 16) + (e >> 16) + (n >> 16) << 16 | 65535 & n;
}
return r + e & 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 No(r, e) {
var n, a, u, s;
if (r !== n) {
for (var c = (u = r, s = 1 + (256 / r.length >> 0), new Array(s + 1).join(u)), f = [], h = 0; h < 256; h++) f[h] = h;
var g = 0;
for (h = 0; h < 256; h++) {
var y = f[h];
g = (g + y + c.charCodeAt(h)) % 256, f[h] = f[g], f[g] = y;
}
n = r, a = f;
} else f = a;
var w = e.length, S = 0, p = 0, O = "";
for (h = 0; h < w; h++) p = (p + (y = f[S = (S + 1) % 256])) % 256, f[S] = f[p], f[p] = y, c = f[(f[S] + f[p]) % 256], O += String.fromCharCode(e.charCodeAt(h) ^ c);
return O;
}
/**
* @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 ou = { print: 4, modify: 8, copy: 16, "annot-forms": 32 };
function Pi(r, e, n, a) {
this.v = 1, this.r = 2;
var u = 192;
r.forEach(function(f) {
if (ou.perm !== void 0) throw new Error("Invalid permission: " + f);
u += ou[f];
}), this.padding = "(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";
var s = (e + this.padding).substr(0, 32), c = (n + this.padding).substr(0, 32);
this.O = this.processOwnerPassword(s, c), this.P = -(1 + (255 ^ u)), this.encryptionKey = Lo(s + this.O + this.lsbFirstWord(this.P) + this.hexToBytes(a)).substr(0, 5), this.U = No(this.encryptionKey, this.padding);
}
function ki(r) {
if (/[^\u0000-\u00ff]/.test(r)) throw new Error("Invalid PDF Name Object: " + r + ", Only accept ASCII characters.");
for (var e = "", n = r.length, a = 0; a < n; a++) {
var u = r.charCodeAt(a);
u < 33 || u === 35 || u === 37 || u === 40 || u === 41 || u === 47 || u === 60 || u === 62 || u === 91 || u === 93 || u === 123 || u === 125 || u > 126 ? e += "#" + ("0" + u.toString(16)).slice(-2) : e += r[a];
}
return e;
}
function uu(r) {
if (he(r) !== "object") throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");
var e = {};
this.subscribe = function(n, a, u) {
if (u = u || !1, typeof n != "string" || typeof a != "function" || typeof u != "boolean") throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");
e.hasOwnProperty(n) || (e[n] = {});
var s = Math.random().toString(35);
return e[n][s] = [a, !!u], s;
}, this.unsubscribe = function(n) {
for (var a in e) if (e[a][n]) return delete e[a][n], Object.keys(e[a]).length === 0 && delete e[a], !0;
return !1;
}, this.publish = function(n) {
if (e.hasOwnProperty(n)) {
var a = Array.prototype.slice.call(arguments, 1), u = [];
for (var s in e[n]) {
var c = e[n][s];
try {
c[0].apply(r, a);
} catch (f) {
Ht.console && ve.error("jsPDF PubSub Error", f.message, f);
}
c[1] && u.push(s);
}
u.length && u.forEach(this.unsubscribe);
}
}, this.getTopics = function() {
return e;
};
}
function hs(r) {
if (!(this instanceof hs)) return new hs(r);
var e = "opacity,stroke-opacity".split(",");
for (var n in r) r.hasOwnProperty(n) && e.indexOf(n) >= 0 && (this[n] = r[n]);
this.id = "", this.objectNumber = -1;
}
function Ou(r, e) {
this.gState = r, this.matrix = e, this.id = "", this.objectNumber = -1;
}
function Jr(r, e, n, a, u) {
if (!(this instanceof Jr)) return new Jr(r, e, n, a, u);
this.type = r === "axial" ? 2 : 3, this.coords = e, this.colors = n, Ou.call(this, a, u);
}
function Fi(r, e, n, a, u) {
if (!(this instanceof Fi)) return new Fi(r, e, n, a, u);
this.boundingBox = r, this.xStep = e, this.yStep = n, this.stream = "", this.cloneIndex = 0, Ou.call(this, a, u);
}
function Ut(r) {
var e, n = typeof arguments[0] == "string" ? arguments[0] : "p", a = arguments[1], u = arguments[2], s = arguments[3], c = [], f = 1, h = 16, g = "S", y = null;
he(r = r || {}) === "object" && (n = r.orientation, a = r.unit || a, u = r.format || u, s = r.compress || r.compressPdf || s, (y = r.encryption || null) !== null && (y.userPassword = y.userPassword || "", y.ownerPassword = y.ownerPassword || "", y.userPermissions = y.userPermissions || []), f = typeof r.userUnit == "number" ? Math.abs(r.userUnit) : 1, r.precision !== void 0 && (e = r.precision), r.floatPrecision !== void 0 && (h = r.floatPrecision), g = r.defaultPathOperation || "S"), c = r.filters || (s === !0 ? ["FlateEncode"] : c), a = a || "mm", n = ("" + (n || "P")).toLowerCase();
var w = r.putOnlyUsedFonts || !1, S = {}, p = { internal: {}, __private__: {} };
p.__private__.PubSub = uu;
var O = "1.3", F = p.__private__.getPdfVersion = function() {
return O;
};
p.__private__.setPdfVersion = function(o) {
O = o;
};
var q = { 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] };
p.__private__.getPageFormats = function() {
return q;
};
var _ = p.__private__.getPageFormat = function(o) {
return q[o];
};
u = u || "a4";
var M = { COMPAT: "compat", ADVANCED: "advanced" }, Y = M.COMPAT;
function st() {
this.saveGraphicsState(), E(new Tt(Ct, 0, 0, -Ct, 0, mr() * Ct).toString() + " cm"), this.setFontSize(this.getFontSize() / Ct), g = "n", Y = M.ADVANCED;
}
function ct() {
this.restoreGraphicsState(), g = "S", Y = M.COMPAT;
}
var wt = p.__private__.combineFontStyleAndFontWeight = function(o, v) {
if (o == "bold" && v == "normal" || o == "bold" && v == 400 || o == "normal" && v == "italic" || o == "bold" && v == "italic") throw new Error("Invalid Combination of fontweight and fontstyle");
return v && (o = v == 400 || v === "normal" ? o === "italic" ? "italic" : "normal" : v != 700 && v !== "bold" || o !== "normal" ? (v == 700 ? "bold" : v) + "" + o : "bold"), o;
};
p.advancedAPI = function(o) {
var v = Y === M.COMPAT;
return v && st.call(this), typeof o != "function" || (o(this), v && ct.call(this)), this;
}, p.compatAPI = function(o) {
var v = Y === M.ADVANCED;
return v && ct.call(this), typeof o != "function" || (o(this), v && st.call(this)), this;
}, p.isAdvancedAPI = function() {
return Y === M.ADVANCED;
};
var tt, z = function(o) {
if (Y !== M.ADVANCED) throw new Error(o + " is only available in 'advanced' API mode. You need to call advancedAPI() first.");
}, rt = p.roundToPrecision = p.__private__.roundToPrecision = function(o, v) {
var j = e || v;
if (isNaN(o) || isNaN(j)) throw new Error("Invalid argument passed to jsPDF.roundToPrecision");
return o.toFixed(j).replace(/0+$/, "");
};
tt = p.hpf = p.__private__.hpf = typeof h == "number" ? function(o) {
if (isNaN(o)) throw new Error("Invalid argument passed to jsPDF.hpf");
return rt(o, h);
} : h === "smart" ? function(o) {
if (isNaN(o)) throw new Error("Invalid argument passed to jsPDF.hpf");
return rt(o, o > -1 && o < 1 ? 16 : 5);
} : function(o) {
if (isNaN(o)) throw new Error("Invalid argument passed to jsPDF.hpf");
return rt(o, 16);
};
var pt = p.f2 = p.__private__.f2 = function(o) {
if (isNaN(o)) throw new Error("Invalid argument passed to jsPDF.f2");
return rt(o, 2);
}, P = p.__private__.f3 = function(o) {
if (isNaN(o)) throw new Error("Invalid argument passed to jsPDF.f3");
return rt(o, 3);
}, k = p.scale = p.__private__.scale = function(o) {
if (isNaN(o)) throw new Error("Invalid argument passed to jsPDF.scale");
return Y === M.COMPAT ? o * Ct : Y === M.ADVANCED ? o : void 0;
}, W = function(o) {
return Y === M.COMPAT ? mr() - o : Y === M.ADVANCED ? o : void 0;
}, D = function(o) {
return k(W(o));
};
p.__private__.setPrecision = p.setPrecision = function(o) {
typeof parseInt(o, 10) == "number" && (e = parseInt(o, 10));
};
var ot, it = "00000000000000000000000000000000", ft = p.__private__.getFileId = function() {
return it;
}, $ = p.__private__.setFileId = function(o) {
return it = o !== void 0 && /^[a-fA-F0-9]{32}$/.test(o) ? o.toUpperCase() : it.split("").map(function() {
return "ABCDEF0123456789".charAt(Math.floor(16 * Math.random()));
}).join(""), y !== null && (Ye = new Pi(y.userPermissions, y.userPassword, y.ownerPassword, it)), it;
};
p.setFileId = function(o) {
return $(o), this;
}, p.getFileId = function() {
return ft();
};
var lt = p.__private__.convertDateToPDFDate = function(o) {
var v = o.getTimezoneOffset(), j = v < 0 ? "+" : "-", R = Math.floor(Math.abs(v / 60)), X = Math.abs(v % 60), ut = [j, B(R), "'", B(X), "'"].join("");
return ["D:", o.getFullYear(), B(o.getMonth() + 1), B(o.getDate()), B(o.getHours()), B(o.getMinutes()), B(o.getSeconds()), ut].join("");
}, dt = p.__private__.convertPDFDateToDate = function(o) {
var v = parseInt(o.substr(2, 4), 10), j = parseInt(o.substr(6, 2), 10) - 1, R = parseInt(o.substr(8, 2), 10), X = parseInt(o.substr(10, 2), 10), ut = parseInt(o.substr(12, 2), 10), yt = parseInt(o.substr(14, 2), 10);
return new Date(v, j, R, X, ut, yt, 0);
}, jt = p.__private__.setCreationDate = function(o) {
var v;
if (o === void 0 && (o = /* @__PURE__ */ new Date()), o instanceof Date) v = lt(o);
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(o)) throw new Error("Invalid argument passed to jsPDF.setCreationDate");
v = o;
}
return ot = v;
}, N = p.__private__.getCreationDate = function(o) {
var v = ot;
return o === "jsDate" && (v = dt(ot)), v;
};
p.setCreationDate = function(o) {
return jt(o), this;
}, p.getCreationDate = function(o) {
return N(o);
};
var C, B = p.__private__.padd2 = function(o) {
return ("0" + parseInt(o)).slice(-2);
}, T = p.__private__.padd2Hex = function(o) {
return ("00" + (o = o.toString())).substr(o.length);
}, J = 0, Q = [], et = [], nt = 0, At = [], Nt = [], Ft = !1, _t = et, zt = function() {
J = 0, nt = 0, et = [], Q = [], At = [], rr = Me(), Fn = Me();
};
p.__private__.setCustomOutputDestination = function(o) {
Ft = !0, _t = o;
};
var ht = function(o) {
Ft || (_t = o);
};
p.__private__.resetCustomOutputDestination = function() {
Ft = !1, _t = et;
};
var E = p.__private__.out = function(o) {
return o = o.toString(), nt += o.length + 1, _t.push(o), _t;
}, Kt = p.__private__.write = function(o) {
return E(arguments.length === 1 ? o.toString() : Array.prototype.join.call(arguments, " "));
}, Et = p.__private__.getArrayBuffer = function(o) {
for (var v = o.length, j = new ArrayBuffer(v), R = new Uint8Array(j); v--; ) R[v] = o.charCodeAt(v);
return j;
}, Lt = [["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]];
p.__private__.getStandardFonts = function() {
return Lt;
};
var xt = r.fontSize || 16;
p.__private__.setFontSize = p.setFontSize = function(o) {
return xt = Y === M.ADVANCED ? o / Ct : o, this;
};
var It, kt = p.__private__.getFontSize = p.getFontSize = function() {
return Y === M.COMPAT ? xt : xt * Ct;
}, qt = r.R2L || !1;
p.__private__.setR2L = p.setR2L = function(o) {
return qt = o, this;
}, p.__private__.getR2L = p.getR2L = function() {
return qt;
};
var Gt, Qt = p.__private__.setZoomMode = function(o) {
var v = [void 0, null, "fullwidth", "fullheight", "fullpage", "original"];
if (/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(o)) It = o;
else if (isNaN(o)) {
if (v.indexOf(o) === -1) throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "' + o + '" is not recognized.');
It = o;
} else It = parseInt(o, 10);
};
p.__private__.getZoomMode = function() {
return It;
};
var te, ie = p.__private__.setPageMode = function(o) {
if ([void 0, null, "UseNone", "UseOutlines", "UseThumbs", "FullScreen"].indexOf(o) == -1) throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "' + o + '" is not recognized.');
Gt = o;
};
p.__private__.getPageMode = function() {
return Gt;
};
var de = p.__private__.setLayoutMode = function(o) {
if ([void 0, null, "continuous", "single", "twoleft", "tworight", "two"].indexOf(o) == -1) throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "' + o + '" is not recognized.');
te = o;
};
p.__private__.getLayoutMode = function() {
return te;
}, p.__private__.setDisplayMode = p.setDisplayMode = function(o, v, j) {
return Qt(o), de(v), ie(j), this;
};
var Wt = { title: "", subject: "", author: "", keywords: "", creator: "" };
p.__private__.getDocumentProperty = function(o) {
if (Object.keys(Wt).indexOf(o) === -1) throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");
return Wt[o];
}, p.__private__.getDocumentProperties = function() {
return Wt;
}, p.__private__.setDocumentProperties = p.setProperties = p.setDocumentProperties = function(o) {
for (var v in Wt) Wt.hasOwnProperty(v) && o[v] && (Wt[v] = o[v]);
return this;
}, p.__private__.setDocumentProperty = function(o, v) {
if (Object.keys(Wt).indexOf(o) === -1) throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");
return Wt[o] = v;
};
var ee, Ct, Je, se, _n, ge = {}, Le = {}, Un = [], ue = {}, Or = {}, Ae = {}, Pn = {}, nr = null, xe = 0, Jt = [], le = new uu(p), Mr = r.hotfixes || [], We = {}, Hn = {}, Wn = [], Tt = function o(v, j, R, X, ut, yt) {
if (!(this instanceof o)) return new o(v, j, R, X, ut, yt);
isNaN(v) && (v = 1), isNaN(j) && (j = 0), isNaN(R) && (R = 0), isNaN(X) && (X = 1), isNaN(ut) && (ut = 0), isNaN(yt) && (yt = 0), this._matrix = [v, j, R, X, ut, yt];
};
Object.defineProperty(Tt.prototype, "sx", { get: function() {
return this._matrix[0];
}, set: function(o) {
this._matrix[0] = o;
} }), Object.defineProperty(Tt.prototype, "shy", { get: function() {
return this._matrix[1];
}, set: function(o) {
this._matrix[1] = o;
} }), Object.defineProperty(Tt.prototype, "shx", { get: function() {
return this._matrix[2];
}, set: function(o) {
this._matrix[2] = o;
} }), Object.defineProperty(Tt.prototype, "sy", { get: function() {
return this._matrix[3];
}, set: function(o) {
this._matrix[3] = o;
} }), Object.defineProperty(Tt.prototype, "tx", { get: function() {
return this._matrix[4];
}, set: function(o) {
this._matrix[4] = o;
} }), Object.defineProperty(Tt.prototype, "ty", { get: function() {
return this._matrix[5];
}, set: function(o) {
this._matrix[5] = o;
} }), Object.defineProperty(Tt.prototype, "a", { get: function() {
return this._matrix[0];
}, set: function(o) {
this._matrix[0] = o;
} }), Object.defineProperty(Tt.prototype, "b", { get: function() {
return this._matrix[1];
}, set: function(o) {
this._matrix[1] = o;
} }), Object.defineProperty(Tt.prototype, "c", { get: function() {
return this._matrix[2];
}, set: function(o) {
this._matrix[2] = o;
} }), Object.defineProperty(Tt.prototype, "d", { get: function() {
return this._matrix[3];
}, set: function(o) {
this._matrix[3] = o;
} }), Object.defineProperty(Tt.prototype, "e", { get: function() {
return this._matrix[4];
}, set: function(o) {
this._matrix[4] = o;
} }), Object.defineProperty(Tt.prototype, "f", { get: function() {
return this._matrix[5];
}, set: function(o) {
this._matrix[5] = o;
} }), Object.defineProperty(Tt.prototype, "rotation", { get: function() {
return Math.atan2(this.shx, this.sx);
} }), Object.defineProperty(Tt.prototype, "scaleX", { get: function() {
return this.decompose().scale.sx;
} }), Object.defineProperty(Tt.prototype, "scaleY", { get: function() {
return this.decompose().scale.sy;
} }), Object.defineProperty(Tt.prototype, "isIdentity", { get: function() {
return this.sx === 1 && this.shy === 0 && this.shx === 0 && this.sy === 1 && this.tx === 0 && this.ty === 0;
} }), Tt.prototype.join = function(o) {
return [this.sx, this.shy, this.shx, this.sy, this.tx, this.ty].map(tt).join(o);
}, Tt.prototype.multiply = function(o) {
var v = o.sx * this.sx + o.shy * this.shx, j = o.sx * this.shy + o.shy * this.sy, R = o.shx * this.sx + o.sy * this.shx, X = o.shx * this.shy + o.sy * this.sy, ut = o.tx * this.sx + o.ty * this.shx + this.tx, yt = o.tx * this.shy + o.ty * this.sy + this.ty;
return new Tt(v, j, R, X, ut, yt);
}, Tt.prototype.decompose = function() {
var o = this.sx, v = this.shy, j = this.shx, R = this.sy, X = this.tx, ut = this.ty, yt = Math.sqrt(o * o + v * v), Ot = (o /= yt) * j + (v /= yt) * R;
j -= o * Ot, R -= v * Ot;
var Dt = Math.sqrt(j * j + R * R);
return Ot /= Dt, o * (R /= Dt) < v * (j /= Dt) && (o = -o, v = -v, Ot = -Ot, yt = -yt), { scale: new Tt(yt, 0, 0, Dt, 0, 0), translate: new Tt(1, 0, 0, 1, X, ut), rotate: new Tt(o, v, -v, o, 0, 0), skew: new Tt(1, 0, Ot, 1, 0, 0) };
}, Tt.prototype.toString = function(o) {
return this.join(" ");
}, Tt.prototype.inversed = function() {
var o = this.sx, v = this.shy, j = this.shx, R = this.sy, X = this.tx, ut = this.ty, yt = 1 / (o * R - v * j), Ot = R * yt, Dt = -v * yt, Zt = -j * yt, Yt = o * yt;
return new Tt(Ot, Dt, Zt, Yt, -Ot * X - Zt * ut, -Dt * X - Yt * ut);
}, Tt.prototype.applyToPoint = function(o) {
var v = o.x * this.sx + o.y * this.shx + this.tx, j = o.x * this.shy + o.y * this.sy + this.ty;
return new li(v, j);
}, Tt.prototype.applyToRectangle = function(o) {
var v = this.applyToPoint(o), j = this.applyToPoint(new li(o.x + o.w, o.y + o.h));
return new Wi(v.x, v.y, j.x - v.x, j.y - v.y);
}, Tt.prototype.clone = function() {
var o = this.sx, v = this.shy, j = this.shx, R = this.sy, X = this.tx, ut = this.ty;
return new Tt(o, v, j, R, X, ut);
}, p.Matrix = Tt;
var kn = p.matrixMult = function(o, v) {
return v.multiply(o);
}, Vn = new Tt(1, 0, 0, 1, 0, 0);
p.unitMatrix = p.identityMatrix = Vn;
var an = function(o, v) {
if (!Or[o]) {
var j = (v instanceof Jr ? "Sh" : "P") + (Object.keys(ue).length + 1).toString(10);
v.id = j, Or[o] = j, ue[j] = v, le.publish("addPattern", v);
}
};
p.ShadingPattern = Jr, p.TilingPattern = Fi, p.addShadingPattern = function(o, v) {
return z("addShadingPattern()"), an(o, v), this;
}, p.beginTilingPattern = function(o) {
z("beginTilingPattern()"), ja(o.boundingBox[0], o.boundingBox[1], o.boundingBox[2] - o.boundingBox[0], o.boundingBox[3] - o.boundingBox[1], o.matrix);
}, p.endTilingPattern = function(o, v) {
z("endTilingPattern()"), v.stream = Nt[C].join(`
`), an(o, v), le.publish("endTilingPattern", v), Wn.pop().restore();
};
var De = p.__private__.newObject = function() {
var o = Me();
return hn(o, !0), o;
}, Me = p.__private__.newObjectDeferred = function() {
return J++, Q[J] = function() {
return nt;
}, J;
}, hn = function(o, v) {
return v = typeof v == "boolean" && v, Q[o] = nt, v && E(o + " 0 obj"), o;
}, Kr = p.__private__.newAdditionalObject = function() {
var o = { objId: Me(), content: "" };
return At.push(o), o;
}, rr = Me(), Fn = Me(), In = p.__private__.decodeColorString = function(o) {
var v = o.split(" ");
if (v.length !== 2 || v[1] !== "g" && v[1] !== "G")
v.length === 5 && (v[4] === "k" || v[4] === "K") && (v = [(1 - v[0]) * (1 - v[3]), (1 - v[1]) * (1 - v[3]), (1 - v[2]) * (1 - v[3]), "r"]);
else {
var j = parseFloat(v[0]);
v = [j, j, j, "r"];
}
for (var R = "#", X = 0; X < 3; X++) R += ("0" + Math.floor(255 * parseFloat(v[X])).toString(16)).slice(-2);
return R;
}, Cn = p.__private__.encodeColorString = function(o) {
var v;
typeof o == "string" && (o = { ch1: o });
var j = o.ch1, R = o.ch2, X = o.ch3, ut = o.ch4, yt = o.pdfColorType === "draw" ? ["G", "RG", "K"] : ["g", "rg", "k"];
if (typeof j == "string" && j.charAt(0) !== "#") {
var Ot = new Cu(j);
if (Ot.ok) j = Ot.toHex();
else if (!/^\d*\.?\d*$/.test(j)) throw new Error('Invalid color "' + j + '" passed to jsPDF.encodeColorString.');
}
if (typeof j == "string" && /^#[0-9A-Fa-f]{3}$/.test(j) && (j = "#" + j[1] + j[1] + j[2] + j[2] + j[3] + j[3]), typeof j == "string" && /^#[0-9A-Fa-f]{6}$/.test(j)) {
var Dt = parseInt(j.substr(1), 16);
j = Dt >> 16 & 255, R = Dt >> 8 & 255, X = 255 & Dt;
}
if (R === void 0 || ut === void 0 && j === R && R === X) if (typeof j == "string") v = j + " " + yt[0];
else switch (o.precision) {
case 2:
v = pt(j / 255) + " " + yt[0];
break;
case 3:
default:
v = P(j / 255) + " " + yt[0];
}
else if (ut === void 0 || he(ut) === "object") {
if (ut && !isNaN(ut.a) && ut.a === 0) return v = ["1.", "1.", "1.", yt[1]].join(" ");
if (typeof j == "string") v = [j, R, X, yt[1]].join(" ");
else switch (o.precision) {
case 2:
v = [pt(j / 255), pt(R / 255), pt(X / 255), yt[1]].join(" ");
break;
default:
case 3:
v = [P(j / 255), P(R / 255), P(X / 255), yt[1]].join(" ");
}
} else if (typeof j == "string") v = [j, R, X, ut, yt[2]].join(" ");
else switch (o.precision) {
case 2:
v = [pt(j), pt(R), pt(X), pt(ut), yt[2]].join(" ");
break;
case 3:
default:
v = [P(j), P(R), P(X), P(ut), yt[2]].join(" ");
}
return v;
}, Gn = p.__private__.getFilters = function() {
return c;
}, bn = p.__private__.putStream = function(o) {
var v = (o = o || {}).data || "", j = o.filters || Gn(), R = o.alreadyAppliedFilters || [], X = o.addLength1 || !1, ut = v.length, yt = o.objectId, Ot = function(Xe) {
return Xe;
};
if (y !== null && yt === void 0) throw new Error("ObjectId must be passed to putStream for file encryption");
y !== null && (Ot = Ye.encryptor(yt, 0));
var Dt = {};
j === !0 && (j = ["FlateEncode"]);
var Zt = o.additionalKeyValues || [], Yt = (Dt = Ut.API.processDataByFilters !== void 0 ? Ut.API.processDataByFilters(v, j) : { data: v, reverseChain: [] }).reverseChain + (Array.isArray(R) ? R.join(" ") : R.toString());
if (Dt.data.length !== 0 && (Zt.push({ key: "Length", value: Dt.data.length }), X === !0 && Zt.push({ key: "Length1", value: ut })), Yt.length != 0) if (Yt.split("/").length - 1 == 1) Zt.push({ key: "Filter", value: Yt });
else {
Zt.push({ key: "Filter", value: "[" + Yt + "]" });
for (var re = 0; re < Zt.length; re += 1) if (Zt[re].key === "DecodeParms") {
for (var Ne = [], Se = 0; Se < Dt.reverseChain.split("/").length - 1; Se += 1) Ne.push("null");
Ne.push(Zt[re].value), Zt[re].value = "[" + Ne.join(" ") + "]";
}
}
E("<<");
for (var Be = 0; Be < Zt.length; Be++) E("/" + Zt[Be].key + " " + Zt[Be].value);
E(">>"), Dt.data.length !== 0 && (E("stream"), E(Ot(Dt.data)), E("endstream"));
}, Jn = p.__private__.putPage = function(o) {
var v = o.number, j = o.data, R = o.objId, X = o.contentsObjId;
hn(R, !0), E("<</Type /Page"), E("/Parent " + o.rootDictionaryObjId + " 0 R"), E("/Resources " + o.resourceDictionaryObjId + " 0 R"), E("/MediaBox [" + parseFloat(tt(o.mediaBox.bottomLeftX)) + " " + parseFloat(tt(o.mediaBox.bottomLeftY)) + " " + tt(o.mediaBox.topRightX) + " " + tt(o.mediaBox.topRightY) + "]"), o.cropBox !== null && E("/CropBox [" + tt(o.cropBox.bottomLeftX) + " " + tt(o.cropBox.bottomLeftY) + " " + tt(o.cropBox.topRightX) + " " + tt(o.cropBox.topRightY) + "]"), o.bleedBox !== null && E("/BleedBox [" + tt(o.bleedBox.bottomLeftX) + " " + tt(o.bleedBox.bottomLeftY) + " " + tt(o.bleedBox.topRightX) + " " + tt(o.bleedBox.topRightY) + "]"), o.trimBox !== null && E("/TrimBox [" + tt(o.trimBox.bottomLeftX) + " " + tt(o.trimBox.bottomLeftY) + " " + tt(o.trimBox.topRightX) + " " + tt(o.trimBox.topRightY) + "]"), o.artBox !== null && E("/ArtBox [" + tt(o.artBox.bottomLeftX) + " " + tt(o.artBox.bottomLeftY) + " " + tt(o.artBox.topRightX) + " " + tt(o.artBox.topRightY) + "]"), typeof o.userUnit == "number" && o.userUnit !== 1 && E("/UserUnit " + o.userUnit), le.publish("putPage", { objId: R, pageContext: Jt[v], pageNumber: v, page: j }), E("/Contents " + X + " 0 R"), E(">>"), E("endobj");
var ut = j.join(`
`);
return Y === M.ADVANCED && (ut += `
Q`), hn(X, !0), bn({ data: ut, filters: Gn(), objectId: X }), E("endobj"), R;
}, Br = p.__private__.putPages = function() {
var o, v, j = [];
for (o = 1; o <= xe; o++) Jt[o].objId = Me(), Jt[o].contentsObjId = Me();
for (o = 1; o <= xe; o++) j.push(Jn({ number: o, data: Nt[o], objId: Jt[o].objId, contentsObjId: Jt[o].contentsObjId, mediaBox: Jt[o].mediaBox, cropBox: Jt[o].cropBox, bleedBox: Jt[o].bleedBox, trimBox: Jt[o].trimBox, artBox: Jt[o].artBox, userUnit: Jt[o].userUnit, rootDictionaryObjId: rr, resourceDictionaryObjId: Fn }));
hn(rr, !0), E("<</Type /Pages");
var R = "/Kids [";
for (v = 0; v < xe; v++) R += j[v] + " 0 R ";
E(R + "]"), E("/Count " + xe), E(">>"), E("endobj"), le.publish("postPutPages");
}, Zr = function(o) {
le.publish("putFont", { font: o, out: E, newObject: De, putStream: bn }), o.isAlreadyPutted !== !0 && (o.objectNumber = De(), E("<<"), E("/Type /Font"), E("/BaseFont /" + ki(o.postScriptName)), E("/Subtype /Type1"), typeof o.encoding == "string" && E("/Encoding /" + o.encoding), E("/FirstChar 32"), E("/LastChar 255"), E(">>"), E("endobj"));
}, $r = function() {
for (var o in ge) ge.hasOwnProperty(o) && (w === !1 || w === !0 && S.hasOwnProperty(o)) && Zr(ge[o]);
}, Qr = function(o) {
o.objectNumber = De();
var v = [];
v.push({ key: "Type", value: "/XObject" }), v.push({ key: "Subtype", value: "/Form" }), v.push({ key: "BBox", value: "[" + [tt(o.x), tt(o.y), tt(o.x + o.width), tt(o.y + o.height)].join(" ") + "]" }), v.push({ key: "Matrix", value: "[" + o.matrix.toString() + "]" });
var j = o.pages[1].join(`
`);
bn({ data: j, additionalKeyValues: v, objectId: o.objectNumber }), E("endobj");
}, ti = function() {
for (var o in We) We.hasOwnProperty(o) && Qr(We[o]);
}, pa = function(o, v) {
var j, R = [], X = 1 / (v - 1);
for (j = 0; j < 1; j += X) R.push(j);
if (R.push(1), o[0].offset != 0) {
var ut = { offset: 0, color: o[0].color };
o.unshift(ut);
}
if (o[o.length - 1].offset != 1) {
var yt = { offset: 1, color: o[o.length - 1].color };
o.push(yt);
}
for (var Ot = "", Dt = 0, Zt = 0; Zt < R.length; Zt++) {
for (j = R[Zt]; j > o[Dt + 1].offset; ) Dt++;
var Yt = o[Dt].offset, re = (j - Yt) / (o[Dt + 1].offset - Yt), Ne = o[Dt].color, Se = o[Dt + 1].color;
Ot += T(Math.round((1 - re) * Ne[0] + re * Se[0]).toString(16)) + T(Math.round((1 - re) * Ne[1] + re * Se[1]).toString(16)) + T(Math.round((1 - re) * Ne[2] + re * Se[2]).toString(16));
}
return Ot.trim();
}, vs = function(o, v) {
v || (v = 21);
var j = De(), R = pa(o.colors, v), X = [];
X.push({ key: "FunctionType", value: "0" }), X.push({ key: "Domain", value: "[0.0 1.0]" }), X.push({ key: "Size", value: "[" + v + "]" }), X.push({ key: "BitsPerSample", value: "8" }), X.push({ key: "Range", value: "[0.0 1.0 0.0 1.0 0.0 1.0]" }), X.push({ key: "Decode", value: "[0.0 1.0 0.0 1.0 0.0 1.0]" }), bn({ data: R, additionalKeyValues: X, alreadyAppliedFilters: ["/ASCIIHexDecode"], objectId: j }), E("endobj"), o.objectNumber = De(), E("<< /ShadingType " + o.type), E("/ColorSpace /DeviceRGB");
var ut = "/Coords [" + tt(parseFloat(o.coords[0])) + " " + tt(parseFloat(o.coords[1])) + " ";
o.type === 2 ? ut += tt(parseFloat(o.coords[2])) + " " + tt(parseFloat(o.coords[3])) : ut += tt(parseFloat(o.coords[2])) + " " + tt(parseFloat(o.coords[3])) + " " + tt(parseFloat(o.coords[4])) + " " + tt(parseFloat(o.coords[5])), E(ut += "]"), o.matrix && E("/Matrix [" + o.matrix.toString() + "]"), E("/Function " + j + " 0 R"), E("/Extend [true true]"), E(">>"), E("endobj");
}, bs = function(o, v) {
var j = Me(), R = De();
v.push({ resourcesOid: j, objectOid: R }), o.objectNumber = R;
var X = [];
X.push({ key: "Type", value: "/Pattern" }), X.push({ key: "PatternType", value: "1" }), X.push({ key: "PaintType", value: "1" }), X.push({ key: "TilingType", value: "1" }), X.push({ key: "BBox", value: "[" + o.boundingBox.map(tt).join(" ") + "]" }), X.push({ key: "XStep", value: tt(o.xStep) }), X.push({ key: "YStep", value: tt(o.yStep) }), X.push({ key: "Resources", value: j + " 0 R" }), o.matrix && X.push({ key: "Matrix", value: "[" + o.matrix.toString() + "]" }), bn({ data: o.stream, additionalKeyValues: X, objectId: o.objectNumber }), E("endobj");
}, ei = function(o) {
var v;
for (v in ue) ue.hasOwnProperty(v) && (ue[v] instanceof Jr ? vs(ue[v]) : ue[v] instanceof Fi && bs(ue[v], o));
}, ga = function(o) {
for (var v in o.objectNumber = De(), E("<<"), o) switch (v) {
case "opacity":
E("/ca " + pt(o[v]));
break;
case "stroke-opacity":
E("/CA " + pt(o[v]));
}
E(">>"), E("endobj");
}, ys = function() {
var o;
for (o in Ae) Ae.hasOwnProperty(o) && ga(Ae[o]);
}, Mi = function() {
for (var o in E("/XObject <<"), We) We.hasOwnProperty(o) && We[o].objectNumber >= 0 && E("/" + o + " " + We[o].objectNumber + " 0 R");
le.publish("putXobjectDict"), E(">>");
}, ws = function() {
Ye.oid = De(), E("<<"), E("/Filter /Standard"), E("/V " + Ye.v), E("/R " + Ye.r), E("/U <" + Ye.toHexString(Ye.U) + ">"), E("/O <" + Ye.toHexString(Ye.O) + ">"), E("/P " + Ye.P), E(">>"), E("endobj");
}, ma = function() {
for (var o in E("/Font <<"), ge) ge.hasOwnProperty(o) && (w === !1 || w === !0 && S.hasOwnProperty(o)) && E("/" + o + " " + ge[o].objectNumber + " 0 R");
E(">>");
}, Ls = function() {
if (Object.keys(ue).length > 0) {
for (var o in E("/Shading <<"), ue) ue.hasOwnProperty(o) && ue[o] instanceof Jr && ue[o].objectNumber >= 0 && E("/" + o + " " + ue[o].objectNumber + " 0 R");
le.publish("putShadingPatternDict"), E(">>");
}
}, ni = function(o) {
if (Object.keys(ue).length > 0) {
for (var v in E("/Pattern <<"), ue) ue.hasOwnProperty(v) && ue[v] instanceof p.TilingPattern && ue[v].objectNumber >= 0 && ue[v].objectNumber < o && E("/" + v + " " + ue[v].objectNumber + " 0 R");
le.publish("putTilingPatternDict"), E(">>");
}
}, Ns = function() {
if (Object.keys(Ae).length > 0) {
var o;
for (o in E("/ExtGState <<"), Ae) Ae.hasOwnProperty(o) && Ae[o].objectNumber >= 0 && E("/" + o + " " + Ae[o].objectNumber + " 0 R");
le.publish("putGStateDict"), E(">>");
}
}, ke = function(o) {
hn(o.resourcesOid, !0), E("<<"), E("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"), ma(), Ls(), ni(o.objectOid), Ns(), Mi(), E(">>"), E("endobj");
}, va = function() {
var o = [];
$r(), ys(), ti(), ei(o), le.publish("putResources"), o.forEach(ke), ke({ resourcesOid: Fn, objectOid: Number.MAX_SAFE_INTEGER }), le.publish("postPutResources");
}, ba = function() {
le.publish("putAdditionalObjects");
for (var o = 0; o < At.length; o++) {
var v = At[o];
hn(v.objId, !0), E(v.content), E("endobj");
}
le.publish("postPutAdditionalObjects");
}, ya = function(o) {
Le[o.fontName] = Le[o.fontName] || {}, Le[o.fontName][o.fontStyle] = o.id;
}, Bi = function(o, v, j, R, X) {
var ut = { id: "F" + (Object.keys(ge).length + 1).toString(10), postScriptName: o, fontName: v, fontStyle: j, encoding: R, isStandardFont: X || !1, metadata: {} };
return le.publish("addFont", { font: ut, instance: this }), ge[ut.id] = ut, ya(ut), ut.id;
}, As = function(o) {
for (var v = 0, j = Lt.length; v < j; v++) {
var R = Bi.call(this, o[v][0], o[v][1], o[v][2], Lt[v][3], !0);
w === !1 && (S[R] = !0);
var X = o[v][0].split("-");
ya({ id: R, fontName: X[0], fontStyle: X[1] || "" });
}
le.publish("addFonts", { fonts: ge, dictionary: Le });
}, jn = function(o) {
return o.foo = function() {
try {
return o.apply(this, arguments);
} catch (R) {
var v = R.stack || "";
~v.indexOf(" at ") && (v = v.split(" at ")[1]);
var j = "Error in function " + v.split(`
`)[0].split("<")[0] + ": " + R.message;
if (!Ht.console) throw new Error(j);
Ht.console.error(j, R), Ht.alert && alert(j);
}
}, o.foo.bar = o, o.foo;
}, ri = function(o, v) {
var j, R, X, ut, yt, Ot, Dt, Zt, Yt;
if (X = (v = v || {}).sourceEncoding || "Unicode", yt = v.outputEncoding, (v.autoencode || yt) && ge[ee].metadata && ge[ee].metadata[X] && ge[ee].metadata[X].encoding && (ut = ge[ee].metadata[X].encoding, !yt && ge[ee].encoding && (yt = ge[ee].encoding), !yt && ut.codePages && (yt = ut.codePages[0]), typeof yt == "string" && (yt = ut[yt]), yt)) {
for (Dt = !1, Ot = [], j = 0, R = o.length; j < R; j++) (Zt = yt[o.charCodeAt(j)]) ? Ot.push(String.fromCharCode(Zt)) : Ot.push(o[j]), Ot[j].charCodeAt(0) >> 8 && (Dt = !0);
o = Ot.join("");
}
for (j = o.length; Dt === void 0 && j !== 0; ) o.charCodeAt(j - 1) >> 8 && (Dt = !0), j--;
if (!Dt) return o;
for (Ot = v.noBOM ? [] : [254, 255], j = 0, R = o.length; j < R; j++) {
if ((Yt = (Zt = o.charCodeAt(j)) >> 8) >> 8) throw new Error("Character at position " + j + " of string '" + o + "' exceeds 16bits. Cannot be encoded into UCS-2 BE");
Ot.push(Yt), Ot.push(Zt - (Yt << 8));
}
return String.fromCharCode.apply(void 0, Ot);
}, sn = p.__private__.pdfEscape = p.pdfEscape = function(o, v) {
return ri(o, v).replace(/\\/g, "\\\\").replace(/\(/g, "\\(").replace(/\)/g, "\\)");
}, Ei = p.__private__.beginPage = function(o) {
Nt[++xe] = [], Jt[xe] = { objId: 0, contentsObjId: 0, userUnit: Number(f), artBox: null, bleedBox: null, cropBox: null, trimBox: null, mediaBox: { bottomLeftX: 0, bottomLeftY: 0, topRightX: Number(o[0]), topRightY: Number(o[1]) } }, La(xe), ht(Nt[C]);
}, wa = function(o, v) {
var j, R, X;
switch (n = v || n, typeof o == "string" && (j = _(o.toLowerCase()), Array.isArray(j) && (R = j[0], X = j[1])), Array.isArray(o) && (R = o[0] * Ct, X = o[1] * Ct), isNaN(R) && (R = u[0], X = u[1]), (R > 14400 || X > 14400) && (ve.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"), R = Math.min(14400, R), X = Math.min(14400, X)), u = [R, X], n.substr(0, 1)) {
case "l":
X > R && (u = [X, R]);
break;
case "p":
R > X && (u = [X, R]);
}
Ei(u), Pa(Ti), E(On), Ui !== 0 && E(Ui + " J"), Hi !== 0 && E(Hi + " j"), le.publish("addPage", { pageNumber: xe });
}, xs = function(o) {
o > 0 && o <= xe && (Nt.splice(o, 1), Jt.splice(o, 1), xe--, C > xe && (C = xe), this.setPage(C));
}, La = function(o) {
o > 0 && o <= xe && (C = o);
}, Ss = p.__private__.getNumberOfPages = p.getNumberOfPages = function() {
return Nt.length - 1;
}, Na = function(o, v, j) {
var R, X = void 0;
return j = j || {}, o = o !== void 0 ? o : ge[ee].fontName, v = v !== void 0 ? v : ge[ee].fontStyle, R = o.toLowerCase(), Le[R] !== void 0 && Le[R][v] !== void 0 ? X = Le[R][v] : Le[o] !== void 0 && Le[o][v] !== void 0 ? X = Le[o][v] : j.disableWarning === !1 && ve.warn("Unable to look up font label for font '" + o + "', '" + v + "'. Refer to getFontList() for available fonts."), X || j.noFallback || (X = Le.times[v]) == null && (X = Le.times.normal), X;
}, _s = p.__private__.putInfo = function() {
var o = De(), v = function(R) {
return R;
};
for (var j in y !== null && (v = Ye.encryptor(o, 0)), E("<<"), E("/Producer (" + sn(v("jsPDF " + Ut.version)) + ")"), Wt) Wt.hasOwnProperty(j) && Wt[j] && E("/" + j.substr(0, 1).toUpperCase() + j.substr(1) + " (" + sn(v(Wt[j])) + ")");
E("/CreationDate (" + sn(v(ot)) + ")"), E(">>"), E("endobj");
}, qi = p.__private__.putCatalog = function(o) {
var v = (o = o || {}).rootDictionaryObjId || rr;
switch (De(), E("<<"), E("/Type /Catalog"), E("/Pages " + v + " 0 R"), It || (It = "fullwidth"), It) {
case "fullwidth":
E("/OpenAction [3 0 R /FitH null]");
break;
case "fullheight":
E("/OpenAction [3 0 R /FitV null]");
break;
case "fullpage":
E("/OpenAction [3 0 R /Fit]");
break;
case "original":
E("/OpenAction [3 0 R /XYZ null null 1]");
break;
default:
var j = "" + It;
j.substr(j.length - 1) === "%" && (It = parseInt(It) / 100), typeof It == "number" && E("/OpenAction [3 0 R /XYZ null null " + pt(It) + "]");
}
switch (te || (te = "continuous"), te) {
case "continuous":
E("/PageLayout /OneColumn");
break;
case "single":
E("/PageLayout /SinglePage");
break;
case "two":
case "twoleft":
E("/PageLayout /TwoColumnLeft");
break;
case "tworight":
E("/PageLayout /TwoColumnRight");
}
Gt && E("/PageMode /" + Gt), le.publish("putCatalog"), E(">>"), E("endobj");
}, Ps = p.__private__.putTrailer = function() {
E("trailer"), E("<<"), E("/Size " + (J + 1)), E("/Root " + J + " 0 R"), E("/Info " + (J - 1) + " 0 R"), y !== null && E("/Encrypt " + Ye.oid + " 0 R"), E("/ID [ <" + it + "> <" + it + "> ]"), E(">>");
}, ks = p.__private__.putHeader = function() {
E("%PDF-" + O), E("%ºß¬à");
}, Fs = p.__private__.putXRef = function() {
var o = "0000000000";
E("xref"), E("0 " + (J + 1)), E("0000000000 65535 f ");
for (var v = 1; v <= J; v++)
typeof Q[v] == "function" ? E((o + Q[v]()).slice(-10) + " 00000 n ") : Q[v] !== void 0 ? E((o + Q[v]).slice(-10) + " 00000 n ") : E("0000000000 00000 n ");
}, ir = p.__private__.buildDocument = function() {
zt(), ht(et), le.publish("buildDocument"), ks(), Br(), ba(), va(), y !== null && ws(), _s(), qi();
var o = nt;
return Fs(), Ps(), E("startxref"), E("" + o), E("%%EOF"), ht(Nt[C]), et.join(`
`);
}, ii = p.__private__.getBlob = function(o) {
return new Blob([Et(o)], { type: "application/pdf" });
}, ai = p.output = p.__private__.output = jn(function(o, v) {
switch (typeof (v = v || {}) == "string" ? v = { filename: v } : v.filename = v.filename || "generated.pdf", o) {
case void 0:
return ir();
case "save":
p.save(v.filename);
break;
case "arraybuffer":
return Et(ir());
case "blob":
return ii(ir());
case "bloburi":
case "bloburl":
if (Ht.URL !== void 0 && typeof Ht.URL.createObjectURL == "function") return Ht.URL && Ht.URL.createObjectURL(ii(ir())) || void 0;
ve.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");
break;
case "datauristring":
case "dataurlstring":
var j = "", R = ir();
try {
j = wo(R);
} catch {
j = wo(unescape(encodeURIComponent(R)));
}
return "data:application/pdf;filename=" + v.filename + ";base64," + j;
case "pdfobjectnewwindow":
if (Object.prototype.toString.call(Ht) === "[object Window]") {
var X = "https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js", ut = ' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';
v.pdfObjectUrl && (X = v.pdfObjectUrl, ut = "");
var yt = '<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="' + X + '"' + ut + '><\/script><script >PDFObject.embed("' + this.output("dataurlstring") + '", ' + JSON.stringify(v) + ");<\/script></body></html>", Ot = Ht.open();
return Ot !== null && Ot.document.write(yt), Ot;
}
throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");
case "pdfjsnewwindow":
if (Object.prototype.toString.call(Ht) === "[object Window]") {
var Dt = '<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe id="pdfViewer" src="' + (v.pdfJsUrl || "examples/PDF.js/web/viewer.html") + "?file=&downloadName=" + v.filename + '" width="500px" height="400px" /></body></html>', Zt = Ht.open();
if (Zt !== null) {
Zt.document.write(Dt);
var Yt = this;
Zt.document.documentElement.querySelector("#pdfViewer").onload = function() {
Zt.document.title = v.filename, Zt.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(Yt.output("bloburl"));
};
}
return Zt;
}
throw new Error("The option pdfjsnewwindow just works in a browser-environment.");
case "dataurlnewwindow":
if (Object.prototype.toString.call(Ht) !== "[object Window]") throw new Error("The option dataurlnewwindow just works in a browser-environment.");
var re = '<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><iframe src="' + this.output("datauristring", v) + '"></iframe></body></html>', Ne = Ht.open();
if (Ne !== null && (Ne.document.write(re), Ne.document.title = v.filename), Ne || typeof safari > "u") return Ne;
break;
case "datauri":
case "dataurl":
return Ht.document.location.href = this.output("datauristring", v);
default:
return null;
}
}), Aa = function(o) {
return Array.isArray(Mr) === !0 && Mr.indexOf(o) > -1;
};
switch (a) {
case "pt":
Ct = 1;
break;
case "mm":
Ct = 72 / 25.4;
break;
case "cm":
Ct = 72 / 2.54;
break;
case "in":
Ct = 72;
break;
case "px":
Ct = Aa("px_scaling") == 1 ? 0.75 : 96 / 72;
break;
case "pc":
case "em":
Ct = 12;
break;
case "ex":
Ct = 6;
break;
default:
if (typeof a != "number") throw new Error("Invalid unit: " + a);
Ct = a;
}
var Ye = null;
jt(), $();
var Is = function(o) {
return y !== null ? Ye.encryptor(o, 0) : function(v) {
return v;
};
}, xa = p.__private__.getPageInfo = p.getPageInfo = function(o) {
if (isNaN(o) || o % 1 != 0) throw new Error("Invalid argument passed to jsPDF.getPageInfo");
return { objId: Jt[o].objId, pageNumber: o, pageContext: Jt[o] };
}, Vt = p.__private__.getPageInfoByObjId = function(o) {
if (isNaN(o) || o % 1 != 0) throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");
for (var v in Jt) if (Jt[v].objId === o) break;
return xa(v);
}, Cs = p.__private__.getCurrentPageInfo = p.getCurrentPageInfo = function() {
return { objId: Jt[C].objId, pageNumber: C, pageContext: Jt[C] };
};
p.addPage = function() {
return wa.apply(this, arguments), this;
}, p.setPage = function() {
return La.apply(this, arguments), ht.call(this, Nt[C]), this;
}, p.insertPage = function(o) {
return this.addPage(), this.movePage(C, o), this;
}, p.movePage = function(o, v) {
var j, R;
if (o > v) {
j = Nt[o], R = Jt[o];
for (var X = o; X > v; X--) Nt[X] = Nt[X - 1], Jt[X] = Jt[X - 1];
Nt[v] = j, Jt[v] = R, this.setPage(v);
} else if (o < v) {
j = Nt[o], R = Jt[o];
for (var ut = o; ut < v; ut++) Nt[ut] = Nt[ut + 1], Jt[ut] = Jt[ut + 1];
Nt[v] = j, Jt[v] = R, this.setPage(v);
}
return this;
}, p.deletePage = function() {
return xs.apply(this, arguments), this;
}, p.__private__.text = p.text = function(o, v, j, R, X) {
var ut, yt, Ot, Dt, Zt, Yt, re, Ne, Se, Be = (R = R || {}).scope || this;
if (typeof o == "number" && typeof v == "number" && (typeof j == "string" || Array.isArray(j))) {
var Xe = j;
j = v, v = o, o = Xe;
}
if (arguments[3] instanceof Tt ? (z("The transform parameter of text() with a Matrix value"), Se = X) : (Ot = arguments[4], Dt = arguments[5], he(re = arguments[3]) === "object" && re !== null || (typeof Ot == "string" && (Dt = Ot, Ot = null), typeof re == "string" && (Dt = re, re = null), typeof re == "number" && (Ot = re, re = null), R = { flags: re, angle: Ot, align: Dt })), isNaN(v) || isNaN(j) || o == null) throw new Error("Invalid arguments passed to jsPDF.text");
if (o.length === 0) return Be;
var Te = "", Mn = !1, dn = typeof R.lineHeightFactor == "number" ? R.lineHeightFactor : qr, Kn = Be.internal.scaleFactor;
function Oa(be) {
return be = be.split(" ").join(Array(R.TabLen || 9).join(" ")), sn(be, re);
}
function Yi(be) {
for (var ye, Ie = be.concat(), Re = [], lr = Ie.length; lr--; ) typeof (ye = Ie.shift()) == "string" ? Re.push(ye) : Array.isArray(be) && (ye.length === 1 || ye[1] === void 0 && ye[2] === void 0) ? Re.push(ye[0]) : Re.push([ye[0], ye[1], ye[2]]);
return Re;
}
function Xi(be, ye) {
var Ie;
if (typeof be == "string") Ie = ye(be)[0];
else if (Array.isArray(be)) {
for (var Re, lr, ra = be.concat(), wi = [], Da = ra.length; Da--; ) typeof (Re = ra.shift()) == "string" ? wi.push(ye(Re)[0]) : Array.isArray(Re) && typeof Re[0] == "string" && (lr = ye(Re[0], Re[1], Re[2]), wi.push([lr[0], lr[1], lr[2]]));
Ie = wi;
}
return Ie;
}
var fi = !1, Ki = !0;
if (typeof o == "string") fi = !0;
else if (Array.isArray(o)) {
var Zi = o.concat();
yt = [];
for (var hi, Ve = Zi.length; Ve--; ) (typeof (hi = Zi.shift()) != "string" || Array.isArray(hi) && typeof hi[0] != "string") && (Ki = !1);
fi = Ki;
}
if (fi === !1) throw new Error('Type of text must be string or Array. "' + o + '" is not recognized.');
typeof o == "string" && (o = o.match(/[\r?\n]/) ? o.split(/\r\n|\r|\n/g) : [o]);
var di = xt / Be.internal.scaleFactor, pi = di * (dn - 1);
switch (R.baseline) {
case "bottom":
j -= pi;
break;
case "top":
j += di - pi;
break;
case "hanging":
j += di - 2 * pi;
break;
case "middle":
j += di / 2 - pi;
}
if ((Yt = R.maxWidth || 0) > 0 && (typeof o == "string" ? o = Be.splitTextToSize(o, Yt) : Object.prototype.toString.call(o) === "[object Array]" && (o = o.reduce(function(be, ye) {
return be.concat(Be.splitTextToSize(ye, Yt));
}, []))), ut = { text: o, x: v, y: j, options: R, mutex: { pdfEscape: sn, activeFontKey: ee, fonts: ge, activeFontSize: xt } }, le.publish("preProcessText", ut), o = ut.text, Ot = (R = ut.options).angle, !(Se instanceof Tt) && Ot && typeof Ot == "number") {
Ot *= Math.PI / 180, R.rotationDirection === 0 && (Ot = -Ot), Y === M.ADVANCED && (Ot = -Ot);
var gi = Math.cos(Ot), $i = Math.sin(Ot);
Se = new Tt(gi, $i, -$i, gi, 0, 0);
} else Ot && Ot instanceof Tt && (Se = Ot);
Y !== M.ADVANCED || Se || (Se = Vn), (Zt = R.charSpace || ui) !== void 0 && (Te += tt(k(Zt)) + ` Tc
`, this.setCharSpace(this.getCharSpace() || 0)), (Ne = R.horizontalScale) !== void 0 && (Te += tt(100 * Ne) + ` Tz
`), R.lang;
var on = -1, zs = R.renderingMode !== void 0 ? R.renderingMode : R.stroke, Qi = Be.internal.getCurrentPageInfo().pageContext;
switch (zs) {
case 0:
case !1:
case "fill":
on = 0;
break;
case 1:
case !0:
case "stroke":
on = 1;
break;
case 2:
case "fillThenStroke":
on = 2;
break;
case 3:
case "invisible":
on = 3;
break;
case 4:
case "fillAndAddForClipping":
on = 4;
break;
case 5:
case "strokeAndAddPathForClipping":
on = 5;
break;
case 6:
case "fillThenStrokeAndAddToPathForClipping":
on = 6;
break;
case 7:
case "addToPathForClipping":
on = 7;
}
var Ma = Qi.usedRenderingMode !== void 0 ? Qi.usedRenderingMode : -1;
on !== -1 ? Te += on + ` Tr
` : Ma !== -1 && (Te += `0 Tr
`), on !== -1 && (Qi.usedRenderingMode = on), Dt = R.align || "left";
var yn, mi = xt * dn, Ba = Be.internal.pageSize.getWidth(), Ea = ge[ee];
Zt = R.charSpace || ui, Yt = R.maxWidth || 0, re = Object.assign({ autoencode: !0, noBOM: !0 }, R.flags);
var vr = [], Tr = function(be) {
return Be.getStringUnitWidth(be, { font: Ea, charSpace: Zt, fontSize: xt, doKerning: !1 }) * xt / Kn;
};
if (Object.prototype.toString.call(o) === "[object Array]") {
var un;
yt = Yi(o), Dt !== "left" && (yn = yt.map(Tr));
var en, br = 0;
if (Dt === "right") {
v -= yn[0], o = [], Ve = yt.length;
for (var sr = 0; sr < Ve; sr++) sr === 0 ? (en = Xn(v), un = ar(j)) : (en = k(br - yn[sr]), un = -mi), o.push([yt[sr], en, un]), br = yn[sr];
} else if (Dt === "center") {
v -= yn[0] / 2, o = [], Ve = yt.length;
for (var or = 0; or < Ve; or++) or === 0 ? (en = Xn(v), un = ar(j)) : (en = k((br - yn[or]) / 2), un = -mi), o.push([yt[or], en, un]), br = yn[or];
} else if (Dt === "left") {
o = [], Ve = yt.length;
for (var vi = 0; vi < Ve; vi++) o.push(yt[vi]);
} else if (Dt === "justify" && Ea.encoding === "Identity-H") {
o = [], Ve = yt.length, Yt = Yt !== 0 ? Yt : Ba;
for (var ur = 0, Fe = 0; Fe < Ve; Fe++) if (un = Fe === 0 ? ar(j) : -mi, en = Fe === 0 ? Xn(v) : ur, Fe < Ve - 1) {
var ta = k((Yt - yn[Fe]) / (yt[Fe].split(" ").length - 1)), nn = yt[Fe].split(" ");
o.push([nn[0] + " ", en, un]), ur = 0;
for (var wn = 1; wn < nn.length; wn++) {
var bi = (Tr(nn[wn - 1] + " " + nn[wn]) - Tr(nn[wn])) * Kn + ta;
wn == nn.length - 1 ? o.push([nn[wn], bi, 0]) : o.push([nn[wn] + " ", bi, 0]), ur -= bi;
}
} else o.push([yt[Fe], en, un]);
o.push(["", ur, 0]);
} else {
if (Dt !== "justify") throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');
for (o = [], Ve = yt.length, Yt = Yt !== 0 ? Yt : Ba, Fe = 0; Fe < Ve; Fe++) un = Fe === 0 ? ar(j) : -mi, en = Fe === 0 ? Xn(v) : 0, Fe < Ve - 1 ? vr.push(tt(k((Yt - yn[Fe]) / (yt[Fe].split(" ").length - 1)))) : vr.push(0), o.push([yt[Fe], en, un]);
}
}
var qa = typeof R.R2L == "boolean" ? R.R2L : qt;
qa === !0 && (o = Xi(o, function(be, ye, Ie) {
return [be.split("").reverse().join(""), ye, Ie];
})), ut = { text: o, x: v, y: j, options: R, mutex: { pdfEscape: sn, activeFontKey: ee, fonts: ge, activeFontSize: xt } }, le.publish("postProcessText", ut), o = ut.text, Mn = ut.mutex.isHex || !1;
var ea = ge[ee].encoding;
ea !== "WinAnsiEncoding" && ea !== "StandardEncoding" || (o = Xi(o, function(be, ye, Ie) {
return [Oa(be), ye, Ie];
})), yt = Yi(o), o = [];
for (var zr, Ur, yr, Hr = 0, yi = 1, Wr = Array.isArray(yt[0]) ? yi : Hr, wr = "", na = function(be, ye, Ie) {
var Re = "";
return Ie instanceof Tt ? (Ie = typeof R.angle == "number" ? kn(Ie, new Tt(1, 0, 0, 1, be, ye)) : kn(new Tt(1, 0, 0, 1, be, ye), Ie), Y === M.ADVANCED && (Ie = kn(new Tt(1, 0, 0, -1, 0, 0), Ie)), Re = Ie.join(" ") + ` Tm
`) : Re = tt(be) + " " + tt(ye) + ` Td
`, Re;
}, Ln = 0; Ln < yt.length; Ln++) {
switch (wr = "", Wr) {
case yi:
yr = (Mn ? "<" : "(") + yt[Ln][0] + (Mn ? ">" : ")"), zr = parseFloat(yt[Ln][1]), Ur = parseFloat(yt[Ln][2]);
break;
case Hr:
yr = (Mn ? "<" : "(") + yt[Ln] + (Mn ? ">" : ")"), zr = Xn(v), Ur = ar(j);
}
vr !== void 0 && vr[Ln] !== void 0 && (wr = vr[Ln] + ` Tw
`), Ln === 0 ? o.push(wr + na(zr, Ur, Se) + yr) : Wr === Hr ? o.push(wr + yr) : Wr === yi && o.push(wr + na(zr, Ur, Se) + yr);
}
o = Wr === Hr ? o.join(` Tj
T* `) : o.join(` Tj
`), o += ` Tj
`;
var Nn = `BT
/`;
return Nn += ee + " " + xt + ` Tf
`, Nn += tt(xt * dn) + ` TL
`, Nn += Dr + `
`, Nn += Te, Nn += o, E(Nn += "ET"), S[ee] = !0, Be;
};
var js = p.__private__.clip = p.clip = function(o) {
return E(o === "evenodd" ? "W*" : "W"), this;
};
p.clipEvenOdd = function() {
return js("evenodd");
}, p.__private__.discardPath = p.discardPath = function() {
return E("n"), this;
};
var Yn = p.__private__.isValidStyle = function(o) {
var v = !1;
return [void 0, null, "S", "D", "F", "DF", "FD", "f", "f*", "B", "B*", "n"].indexOf(o) !== -1 && (v = !0), v;
};
p.__private__.setDefaultPathOperation = p.setDefaultPathOperation = function(o) {
return Yn(o) && (g = o), this;
};
var Sa = p.__private__.getStyle = p.getStyle = function(o) {
var v = g;
switch (o) {
case "D":
case "S":
v = "S";
break;
case "F":
v = "f";
break;
case "FD":
case "DF":
v = "B";
break;
case "f":
case "f*":
case "B":
case "B*":
v = o;
}
return v;
}, _a = p.close = function() {
return E("h"), this;
};
p.stroke = function() {
return E("S"), this;
}, p.fill = function(o) {
return si("f", o), this;
}, p.fillEvenOdd = function(o) {
return si("f*", o), this;
}, p.fillStroke = function(o) {
return si("B", o), this;
}, p.fillStrokeEvenOdd = function(o) {
return si("B*", o), this;
};
var si = function(o, v) {
he(v) === "object" ? Ms(v, o) : E(o);
}, Di = function(o) {
o === null || Y === M.ADVANCED && o === void 0 || (o = Sa(o), E(o));
};
function Os(o, v, j, R, X) {
var ut = new Fi(v || this.boundingBox, j || this.xStep, R || this.yStep, this.gState, X || this.matrix);
ut.stream = this.stream;
var yt = o + "$$" + this.cloneIndex++ + "$$";
return an(yt, ut), ut;
}
var Ms = function(o, v) {
var j = Or[o.key], R = ue[j];
if (R instanceof Jr) E("q"), E(Bs(v)), R.gState && p.setGState(R.gState), E(o.matrix.toString() + " cm"), E("/" + j + " sh"), E("Q");
else if (R instanceof Fi) {
var X = new Tt(1, 0, 0, -1, 0, mr());
o.matrix && (X = X.multiply(o.matrix || Vn), j = Os.call(R, o.key, o.boundingBox, o.xStep, o.yStep, X).id), E("q"), E("/Pattern cs"), E("/" + j + " scn"), R.gState && p.setGState(R.gState), E(v), E("Q");
}
}, Bs = function(o) {
switch (o) {
case "f":
case "F":
return "W n";
case "f*":
return "W* n";
case "B":
return "W S";
case "B*":
return "W* S";
case "S":
return "W S";
case "n":
return "W n";
}
}, Ri = p.moveTo = function(o, v) {
return E(tt(k(o)) + " " + tt(D(v)) + " m"), this;
}, Er = p.lineTo = function(o, v) {
return E(tt(k(o)) + " " + tt(D(v)) + " l"), this;
}, pr = p.curveTo = function(o, v, j, R, X, ut) {
return E([tt(k(o)), tt(D(v)), tt(k(j)), tt(D(R)), tt(k(X)), tt(D(ut)), "c"].join(" ")), this;
};
p.__private__.line = p.line = function(o, v, j, R, X) {
if (isNaN(o) || isNaN(v) || isNaN(j) || isNaN(R) || !Yn(X)) throw new Error("Invalid arguments passed to jsPDF.line");
return Y === M.COMPAT ? this.lines([[j - o, R - v]], o, v, [1, 1], X || "S") : this.lines([[j - o, R - v]], o, v, [1, 1]).stroke();
}, p.__private__.lines = p.lines = function(o, v, j, R, X, ut) {
var yt, Ot, Dt, Zt, Yt, re, Ne, Se, Be, Xe, Te, Mn;
if (typeof o == "number" && (Mn = j, j = v, v = o, o = Mn), R = R || [1, 1], ut = ut || !1, isNaN(v) || isNaN(j) || !Array.isArray(o) || !Array.isArray(R) || !Yn(X) || typeof ut != "boolean") throw new Error("Invalid arguments passed to jsPDF.lines");
for (Ri(v, j), yt = R[0], Ot = R[1], Zt = o.length, Xe = v, Te = j, Dt = 0; Dt < Zt; Dt++) (Yt = o[Dt]).length === 2 ? (Xe = Yt[0] * yt + Xe, Te = Yt[1] * Ot + Te, Er(Xe, Te)) : (re = Yt[0] * yt + Xe, Ne = Yt[1] * Ot + Te, Se = Yt[2] * yt + Xe, Be = Yt[3] * Ot + Te, Xe = Yt[4] * yt + Xe, Te = Yt[5] * Ot + Te, pr(re, Ne, Se, Be, Xe, Te));
return ut && _a(), Di(X), this;
}, p.path = function(o) {
for (var v = 0; v < o.length; v++) {
var j = o[v], R = j.c;
switch (j.op) {
case "m":
Ri(R[0], R[1]);
break;
case "l":
Er(R[0], R[1]);
break;
case "c":
pr.apply(this, R);
break;
case "h":
_a();
}
}
return this;
}, p.__private__.rect = p.rect = function(o, v, j, R, X) {
if (isNaN(o) || isNaN(v) || isNaN(j) || isNaN(R) || !Yn(X)) throw new Error("Invalid arguments passed to jsPDF.rect");
return Y === M.COMPAT && (R = -R), E([tt(k(o)), tt(D(v)), tt(k(j)), tt(k(R)), "re"].join(" ")), Di(X), this;
}, p.__private__.triangle = p.triangle = function(o, v, j, R, X, ut, yt) {
if (isNaN(o) || isNaN(v) || isNaN(j) || isNaN(R) || isNaN(X) || isNaN(ut) || !Yn(yt)) throw new Error("Invalid arguments passed to jsPDF.triangle");
return this.lines([[j - o, R - v], [X - j, ut - R], [o - X, v - ut]], o, v, [1, 1], yt, !0), this;
}, p.__private__.roundedRect = p.roundedRect = function(o, v, j, R, X, ut, yt) {
if (isNaN(o) || isNaN(v) || isNaN(j) || isNaN(R) || isNaN(X) || isNaN(ut) || !Yn(yt)) throw new Error("Invalid arguments passed to jsPDF.roundedRect");
var Ot = 4 / 3 * (Math.SQRT2 - 1);
return X = Math.min(X, 0.5 * j), ut = Math.min(ut, 0.5 * R), this.lines([[j - 2 * X, 0], [X * Ot, 0, X, ut - ut * Ot, X, ut], [0, R - 2 * ut], [0, ut * Ot, -X * Ot, ut, -X, ut], [2 * X - j, 0], [-X * Ot, 0, -X, -ut * Ot, -X, -ut], [0, 2 * ut - R], [0, -ut * Ot, X * Ot, -ut, X, -ut]], o + X, v, [1, 1], yt, !0), this;
}, p.__private__.ellipse = p.ellipse = function(o, v, j, R, X) {
if (isNaN(o) || isNaN(v) || isNaN(j) || isNaN(R) || !Yn(X)) throw new Error("Invalid arguments passed to jsPDF.ellipse");
var ut = 4 / 3 * (Math.SQRT2 - 1) * j, yt = 4 / 3 * (Math.SQRT2 - 1) * R;
return Ri(o + j, v), pr(o + j, v - yt, o + ut, v - R, o, v - R), pr(o - ut, v - R, o - j, v - yt, o - j, v), pr(o - j, v + yt, o - ut, v + R, o, v + R), pr(o + ut, v + R, o + j, v + yt, o + j, v), Di(X), this;
}, p.__private__.circle = p.circle = function(o, v, j, R) {
if (isNaN(o) || isNaN(v) || isNaN(j) || !Yn(R)) throw new Error("Invalid arguments passed to jsPDF.circle");
return this.ellipse(o, v, j, j, R);
}, p.setFont = function(o, v, j) {
return j && (v = wt(v, j)), ee = Na(o, v, { disableWarning: !1 }), this;
};
var Es = p.__private__.getFont = p.getFont = function() {
return ge[Na.apply(p, arguments)];
};
p.__private__.getFontList = p.getFontList = function() {
var o, v, j = {};
for (o in Le) if (Le.hasOwnProperty(o)) for (v in j[o] = [], Le[o]) Le[o].hasOwnProperty(v) && j[o].push(v);
return j;
}, p.addFont = function(o, v, j, R, X) {
var ut = ["StandardEncoding", "MacRomanEncoding", "Identity-H", "WinAnsiEncoding"];
return arguments[3] && ut.indexOf(arguments[3]) !== -1 ? X = arguments[3] : arguments[3] && ut.indexOf(arguments[3]) == -1 && (j = wt(j, R)), X = X || "Identity-H", Bi.call(this, o, v, j, X);
};
var qr, Ti = r.lineWidth || 0.200025, oi = p.__private__.getLineWidth = p.getLineWidth = function() {
return Ti;
}, Pa = p.__private__.setLineWidth = p.setLineWidth = function(o) {
return Ti = o, E(tt(k(o)) + " w"), this;
};
p.__private__.setLineDash = Ut.API.setLineDash = Ut.API.setLineDashPattern = function(o, v) {
if (o = o || [], v = v || 0, isNaN(v) || !Array.isArray(o)) throw new Error("Invalid arguments passed to jsPDF.setLineDash");
return o = o.map(function(j) {
return tt(k(j));
}).join(" "), v = tt(k(v)), E("[" + o + "] " + v + " d"), this;
};
var ka = p.__private__.getLineHeight = p.getLineHeight = function() {
return xt * qr;
};
p.__private__.getLineHeight = p.getLineHeight = function() {
return xt * qr;
};
var Fa = p.__private__.setLineHeightFactor = p.setLineHeightFactor = function(o) {
return typeof (o = o || 1.15) == "number" && (qr = o), this;
}, Ia = p.__private__.getLineHeightFactor = p.getLineHeightFactor = function() {
return qr;
};
Fa(r.lineHeight);
var Xn = p.__private__.getHorizontalCoordinate = function(o) {
return k(o);
}, ar = p.__private__.getVerticalCoordinate = function(o) {
return Y === M.ADVANCED ? o : Jt[C].mediaBox.topRightY - Jt[C].mediaBox.bottomLeftY - k(o);
}, qs = p.__private__.getHorizontalCoordinateString = p.getHorizontalCoordinateString = function(o) {
return tt(Xn(o));
}, gr = p.__private__.getVerticalCoordinateString = p.getVerticalCoordinateString = function(o) {
return tt(ar(o));
}, On = r.strokeColor || "0 G";
p.__private__.getStrokeColor = p.getDrawColor = function() {
return In(On);
}, p.__private__.setStrokeColor = p.setDrawColor = function(o, v, j, R) {
return On = Cn({ ch1: o, ch2: v, ch3: j, ch4: R, pdfColorType: "draw", precision: 2 }), E(On), this;
};
var zi = r.fillColor || "0 g";
p.__private__.getFillColor = p.getFillColor = function() {
return In(zi);
}, p.__private__.setFillColor = p.setFillColor = function(o, v, j, R) {
return zi = Cn({ ch1: o, ch2: v, ch3: j, ch4: R, pdfColorType: "fill", precision: 2 }), E(zi), this;
};
var Dr = r.textColor || "0 g", Ds = p.__private__.getTextColor = p.getTextColor = function() {
return In(Dr);
};
p.__private__.setTextColor = p.setTextColor = function(o, v, j, R) {
return Dr = Cn({ ch1: o, ch2: v, ch3: j, ch4: R, pdfColorType: "text", precision: 3 }), this;
};
var ui = r.charSpace, Rs = p.__private__.getCharSpace = p.getCharSpace = function() {
return parseFloat(ui || 0);
};
p.__private__.setCharSpace = p.setCharSpace = function(o) {
if (isNaN(o)) throw new Error("Invalid argument passed to jsPDF.setCharSpace");
return ui = o, this;
};
var Ui = 0;
p.CapJoinStyles = { 0: 0, butt: 0, but: 0, miter: 0, 1: 1, round: 1, rounded: 1, circle: 1, 2: 2, projecting: 2, project: 2, square: 2, bevel: 2 }, p.__private__.setLineCap = p.setLineCap = function(o) {
var v = p.CapJoinStyles[o];
if (v === void 0) throw new Error("Line cap style of '" + o + "' is not recognized. See or extend .CapJoinStyles property for valid styles");
return Ui = v, E(v + " J"), this;
};
var Hi = 0;
p.__private__.setLineJoin = p.setLineJoin = function(o) {
var v = p.CapJoinStyles[o];
if (v === void 0) throw new Error("Line join style of '" + o + "' is not recognized. See or extend .CapJoinStyles property for valid styles");
return Hi = v, E(v + " j"), this;
}, p.__private__.setLineMiterLimit = p.__private__.setMiterLimit = p.setLineMiterLimit = p.setMiterLimit = function(o) {
if (o = o || 0, isNaN(o)) throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");
return E(tt(k(o)) + " M"), this;
}, p.GState = hs, p.setGState = function(o) {
(o = typeof o == "string" ? Ae[Pn[o]] : Ca(null, o)).equals(nr) || (E("/" + o.id + " gs"), nr = o);
};
var Ca = function(o, v) {
if (!o || !Pn[o]) {
var j = !1;
for (var R in Ae) if (Ae.hasOwnProperty(R) && Ae[R].equals(v)) {
j = !0;
break;
}
if (j) v = Ae[R];
else {
var X = "GS" + (Object.keys(Ae).length + 1).toString(10);
Ae[X] = v, v.id = X;
}
return o && (Pn[o] = v.id), le.publish("addGState", v), v;
}
};
p.addGState = function(o, v) {
return Ca(o, v), this;
}, p.saveGraphicsState = function() {
return E("q"), Un.push({ key: ee, size: xt, color: Dr }), this;
}, p.restoreGraphicsState = function() {
E("Q");
var o = Un.pop();
return ee = o.key, xt = o.size, Dr = o.color, nr = null, this;
}, p.setCurrentTransformationMatrix = function(o) {
return E(o.toString() + " cm"), this;
}, p.comment = function(o) {
return E("#" + o), this;
};
var li = function(o, v) {
var j = o || 0;
Object.defineProperty(this, "x", { enumerable: !0, get: function() {
return j;
}, set: function(ut) {
isNaN(ut) || (j = parseFloat(ut));
} });
var R = v || 0;
Object.defineProperty(this, "y", { enumerable: !0, get: function() {
return R;
}, set: function(ut) {
isNaN(ut) || (R = parseFloat(ut));
} });
var X = "pt";
return Object.defineProperty(this, "type", { enumerable: !0, get: function() {
return X;
}, set: function(ut) {
X = ut.toString();
} }), this;
}, Wi = function(o, v, j, R) {
li.call(this, o, v), this.type = "rect";
var X = j || 0;
Object.defineProperty(this, "w", { enumerable: !0, get: function() {
return X;
}, set: function(yt) {
isNaN(yt) || (X = parseFloat(yt));
} });
var ut = R || 0;
return Object.defineProperty(this, "h", { enumerable: !0, get: function() {
return ut;
}, set: function(yt) {
isNaN(yt) || (ut = parseFloat(yt));
} }), this;
}, Vi = function() {
this.page = xe, this.currentPage = C, this.pages = Nt.slice(0), this.pagesContext = Jt.slice(0), this.x = Je, this.y = se, this.matrix = _n, this.width = Rr(C), this.height = mr(C), this.outputDestination = _t, this.id = "", this.objectNumber = -1;
};
Vi.prototype.restore = function() {
xe = this.page, C = this.currentPage, Jt = this.pagesContext, Nt = this.pages, Je = this.x, se = this.y, _n = this.matrix, Gi(C, this.width), Ji(C, this.height), _t = this.outputDestination;
};
var ja = function(o, v, j, R, X) {
Wn.push(new Vi()), xe = C = 0, Nt = [], Je = o, se = v, _n = X, Ei([j, R]);
}, Ts = function(o) {
if (Hn[o]) Wn.pop().restore();
else {
var v = new Vi(), j = "Xo" + (Object.keys(We).length + 1).toString(10);
v.id = j, Hn[o] = j, We[j] = v, le.publish("addFormObject", v), Wn.pop().restore();
}
};
for (var ci in p.beginFormObject = function(o, v, j, R, X) {
return ja(o, v, j, R, X), this;
}, p.endFormObject = function(o) {
return Ts(o), this;
}, p.doFormObject = function(o, v) {
var j = We[Hn[o]];
return E("q"), E(v.toString() + " cm"), E("/" + j.id + " Do"), E("Q"), this;
}, p.getFormObject = function(o) {
var v = We[Hn[o]];
return { x: v.x, y: v.y, width: v.width, height: v.height, matrix: v.matrix };
}, p.save = function(o, v) {
return o = o || "generated.pdf", (v = v || {}).returnPromise = v.returnPromise || !1, v.returnPromise === !1 ? (Gr(ii(ir()), o), typeof Gr.unload == "function" && Ht.setTimeout && setTimeout(Gr.unload, 911), this) : new Promise(function(j, R) {
try {
var X = Gr(ii(ir()), o);
typeof Gr.unload == "function" && Ht.setTimeout && setTimeout(Gr.unload, 911), j(X);
} catch (ut) {
R(ut.message);
}
});
}, Ut.API) Ut.API.hasOwnProperty(ci) && (ci === "events" && Ut.API.events.length ? function(o, v) {
var j, R, X;
for (X = v.length - 1; X !== -1; X--) j = v[X][0], R = v[X][1], o.subscribe.apply(o, [j].concat(typeof R == "function" ? [R] : R));
}(le, Ut.API.events) : p[ci] = Ut.API[ci]);
var Rr = p.getPageWidth = function(o) {
return (Jt[o = o || C].mediaBox.topRightX - Jt[o].mediaBox.bottomLeftX) / Ct;
}, Gi = p.setPageWidth = function(o, v) {
Jt[o].mediaBox.topRightX = v * Ct + Jt[o].mediaBox.bottomLeftX;
}, mr = p.getPageHeight = function(o) {
return (Jt[o = o || C].mediaBox.topRightY - Jt[o].mediaBox.bottomLeftY) / Ct;
}, Ji = p.setPageHeight = function(o, v) {
Jt[o].mediaBox.topRightY = v * Ct + Jt[o].mediaBox.bottomLeftY;
};
return p.internal = { pdfEscape: sn, getStyle: Sa, getFont: Es, getFontSize: kt, getCharSpace: Rs, getTextColor: Ds, getLineHeight: ka, getLineHeightFactor: Ia, getLineWidth: oi, write: Kt, getHorizontalCoordinate: Xn, getVerticalCoordinate: ar, getCoordinateString: qs, getVerticalCoordinateString: gr, collections: {}, newObject: De, newAdditionalObject: Kr, newObjectDeferred: Me, newObjectDeferredBegin: hn, getFilters: Gn, putStream: bn, events: le, scaleFactor: Ct, pageSize: { getWidth: function() {
return Rr(C);
}, setWidth: function(o) {
Gi(C, o);
}, getHeight: function() {
return mr(C);
}, setHeight: function(o) {
Ji(C, o);
} }, encryptionOptions: y, encryption: Ye, getEncryptor: Is, output: ai, getNumberOfPages: Ss, pages: Nt, out: E, f2: pt, f3: P, getPageInfo: xa, getPageInfoByObjId: Vt, getCurrentPageInfo: Cs, getPDFVersion: F, Point: li, Rectangle: Wi, Matrix: Tt, hasHotfix: Aa }, Object.defineProperty(p.internal.pageSize, "width", { get: function() {
return Rr(C);
}, set: function(o) {
Gi(C, o);
}, enumerable: !0, configurable: !0 }), Object.defineProperty(p.internal.pageSize, "height", { get: function() {
return mr(C);
}, set: function(o) {
Ji(C, o);
}, enumerable: !0, configurable: !0 }), As.call(p, Lt), ee = "F1", wa(u, n), le.publish("initialized"), p;
}
Pi.prototype.lsbFirstWord = function(r) {
return String.fromCharCode(r >> 0 & 255, r >> 8 & 255, r >> 16 & 255, r >> 24 & 255);
}, Pi.prototype.toHexString = function(r) {
return r.split("").map(function(e) {
return ("0" + (255 & e.charCodeAt(0)).toString(16)).slice(-2);
}).join("");
}, Pi.prototype.hexToBytes = function(r) {
for (var e = [], n = 0; n < r.length; n += 2) e.push(String.fromCharCode(parseInt(r.substr(n, 2), 16)));
return e.join("");
}, Pi.prototype.processOwnerPassword = function(r, e) {
return No(Lo(e).substr(0, 5), r);
}, Pi.prototype.encryptor = function(r, e) {
var n = Lo(this.encryptionKey + String.fromCharCode(255 & r, r >> 8 & 255, r >> 16 & 255, 255 & e, e >> 8 & 255)).substr(0, 10);
return function(a) {
return No(n, a);
};
}, hs.prototype.equals = function(r) {
var e, n = "id,objectNumber,equals";
if (!r || he(r) !== he(this)) return !1;
var a = 0;
for (e in this) if (!(n.indexOf(e) >= 0)) {
if (this.hasOwnProperty(e) && !r.hasOwnProperty(e) || this[e] !== r[e]) return !1;
a++;
}
for (e in r) r.hasOwnProperty(e) && n.indexOf(e) < 0 && a--;
return a === 0;
}, Ut.API = { events: [] }, Ut.version = "3.0.1";
var Pe = Ut.API, ko = 1, Xr = function(r) {
return r.replace(/\\/g, "\\\\").replace(/\(/g, "\\(").replace(/\)/g, "\\)");
}, Si = function(r) {
return r.replace(/\\\\/g, "\\").replace(/\\\(/g, "(").replace(/\\\)/g, ")");
}, Xt = function(r) {
return r.toFixed(2);
}, Fr = function(r) {
return r.toFixed(5);
};
Pe.__acroform__ = {};
var fn = function(r, e) {
r.prototype = Object.create(e.prototype), r.prototype.constructor = r;
}, lu = function(r) {
return r * ko;
}, $n = function(r) {
var e = new Bu(), n = Bt.internal.getHeight(r) || 0, a = Bt.internal.getWidth(r) || 0;
return e.BBox = [0, 0, Number(Xt(a)), Number(Xt(n))], e;
}, Vl = Pe.__acroform__.setBit = function(r, e) {
if (r = r || 0, e = e || 0, isNaN(r) || isNaN(e)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");
return r |= 1 << e;
}, Gl = Pe.__acroform__.clearBit = function(r, e) {
if (r = r || 0, e = e || 0, isNaN(r) || isNaN(e)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");
return r &= ~(1 << e);
}, Jl = Pe.__acroform__.getBit = function(r, e) {
if (isNaN(r) || isNaN(e)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");
return (r & 1 << e) == 0 ? 0 : 1;
}, Ce = Pe.__acroform__.getBitForPdf = function(r, e) {
if (isNaN(r) || isNaN(e)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");
return Jl(r, e - 1);
}, je = Pe.__acroform__.setBitForPdf = function(r, e) {
if (isNaN(r) || isNaN(e)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");
return Vl(r, e - 1);
}, Oe = Pe.__acroform__.clearBitForPdf = function(r, e) {
if (isNaN(r) || isNaN(e)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");
return Gl(r, e - 1);
}, Yl = Pe.__acroform__.calculateCoordinates = function(r, e) {
var n = e.internal.getHorizontalCoordinate, a = e.internal.getVerticalCoordinate, u = r[0], s = r[1], c = r[2], f = r[3], h = {};
return h.lowerLeft_X = n(u) || 0, h.lowerLeft_Y = a(s + f) || 0, h.upperRight_X = n(u + c) || 0, h.upperRight_Y = a(s) || 0, [Number(Xt(h.lowerLeft_X)), Number(Xt(h.lowerLeft_Y)), Number(Xt(h.upperRight_X)), Number(Xt(h.upperRight_Y))];
}, Xl = function(r) {
if (r.appearanceStreamContent) return r.appearanceStreamContent;
if (r.V || r.DV) {
var e = [], n = r._V || r.DV, a = Ao(r, n), u = r.scope.internal.getFont(r.fontName, r.fontStyle).id;
e.push("/Tx BMC"), e.push("q"), e.push("BT"), e.push(r.scope.__private__.encodeColorString(r.color)), e.push("/" + u + " " + Xt(a.fontSize) + " Tf"), e.push("1 0 0 1 0 0 Tm"), e.push(a.text), e.push("ET"), e.push("Q"), e.push("EMC");
var s = $n(r);
return s.scope = r.scope, s.stream = e.join(`
`), s;
}
}, Ao = function(r, e) {
var n = r.fontSize === 0 ? r.maxFontSize : r.fontSize, a = { text: "", fontSize: "" }, u = (e = (e = e.substr(0, 1) == "(" ? e.substr(1) : e).substr(e.length - 1) == ")" ? e.substr(0, e.length - 1) : e).split(" ");
u = r.multiline ? u.map(function(P) {
return P.split(`
`);
}) : u.map(function(P) {
return [P];
});
var s = n, c = Bt.internal.getHeight(r) || 0;
c = c < 0 ? -c : c;
var f = Bt.internal.getWidth(r) || 0;
f = f < 0 ? -f : f;
var h = function(P, k, W) {
if (P + 1 < u.length) {
var D = k + " " + u[P + 1][0];
return as(D, r, W).width <= f - 4;
}
return !1;
};
s++;
t: for (; s > 0; ) {
e = "", s--;
var g, y, w = as("3", r, s).height, S = r.multiline ? c - s : (c - w) / 2, p = S += 2, O = 0, F = 0, q = 0;
if (s <= 0) {
e = `(...) Tj
`, e += "% Width of Text: " + as(e, r, s = 12).width + ", FieldWidth:" + f + `
`;
break;
}
for (var _ = "", M = 0, Y = 0; Y < u.length; Y++) if (u.hasOwnProperty(Y)) {
var st = !1;
if (u[Y].length !== 1 && q !== u[Y].length - 1) {
if ((w + 2) * (M + 2) + 2 > c) continue t;
_ += u[Y][q], st = !0, F = Y, Y--;
} else {
_ = (_ += u[Y][q] + " ").substr(_.length - 1) == " " ? _.substr(0, _.length - 1) : _;
var ct = parseInt(Y), wt = h(ct, _, s), tt = Y >= u.length - 1;
if (wt && !tt) {
_ += " ", q = 0;
continue;
}
if (wt || tt) {
if (tt) F = ct;
else if (r.multiline && (w + 2) * (M + 2) + 2 > c) continue t;
} else {
if (!r.multiline || (w + 2) * (M + 2) + 2 > c) continue t;
F = ct;
}
}
for (var z = "", rt = O; rt <= F; rt++) {
var pt = u[rt];
if (r.multiline) {
if (rt === F) {
z += pt[q] + " ", q = (q + 1) % pt.length;
continue;
}
if (rt === O) {
z += pt[pt.length - 1] + " ";
continue;
}
}
z += pt[0] + " ";
}
switch (z = z.substr(z.length - 1) == " " ? z.substr(0, z.length - 1) : z, y = as(z, r, s).width, r.textAlign) {
case "right":
g = f - y - 2;
break;
case "center":
g = (f - y) / 2;
break;
case "left":
default:
g = 2;
}
e += Xt(g) + " " + Xt(p) + ` Td
`, e += "(" + Xr(z) + `) Tj
`, e += -Xt(g) + ` 0 Td
`, p = -(s + 2), y = 0, O = st ? F : F + 1, M++, _ = "";
}
break;
}
return a.text = e, a.fontSize = s, a;
}, as = function(r, e, n) {
var a = e.scope.internal.getFont(e.fontName, e.fontStyle), u = e.scope.getStringUnitWidth(r, { font: a, fontSize: parseFloat(n), charSpace: 0 }) * parseFloat(n);
return { height: e.scope.getStringUnitWidth("3", { font: a, fontSize: parseFloat(n), charSpace: 0 }) * parseFloat(n) * 1.5, width: u };
}, Kl = { fields: [], xForms: [], acroFormDictionaryRoot: null, printedOut: !1, internal: null, isInitialized: !1 }, Zl = function(r, e) {
var n = { type: "reference", object: r };
e.internal.getPageInfo(r.page).pageContext.annotations.find(function(a) {
return a.type === n.type && a.object === n.object;
}) === void 0 && e.internal.getPageInfo(r.page).pageContext.annotations.push(n);
}, $l = function(r, e) {
for (var n in r) if (r.hasOwnProperty(n)) {
var a = n, u = r[n];
e.internal.newObjectDeferredBegin(u.objId, !0), he(u) === "object" && typeof u.putStream == "function" && u.putStream(), delete r[a];
}
}, Ql = function(r, e) {
if (e.scope = r, r.internal !== void 0 && (r.internal.acroformPlugin === void 0 || r.internal.acroformPlugin.isInitialized === !1)) {
if (Tn.FieldNum = 0, r.internal.acroformPlugin = JSON.parse(JSON.stringify(Kl)), r.internal.acroformPlugin.acroFormDictionaryRoot) throw new Error("Exception while creating AcroformDictionary");
ko = r.internal.scaleFactor, r.internal.acroformPlugin.acroFormDictionaryRoot = new Eu(), r.internal.acroformPlugin.acroFormDictionaryRoot.scope = r, r.internal.acroformPlugin.acroFormDictionaryRoot._eventID = r.internal.events.subscribe("postPutResources", function() {
(function(n) {
n.internal.events.unsubscribe(n.internal.acroformPlugin.acroFormDictionaryRoot._eventID), delete n.internal.acroformPlugin.acroFormDictionaryRoot._eventID, n.internal.acroformPlugin.printedOut = !0;
})(r);
}), r.internal.events.subscribe("buildDocument", function() {
(function(n) {
n.internal.acroformPlugin.acroFormDictionaryRoot.objId = void 0;
var a = n.internal.acroformPlugin.acroFormDictionaryRoot.Fields;
for (var u in a) if (a.hasOwnProperty(u)) {
var s = a[u];
s.objId = void 0, s.hasAnnotation && Zl(s, n);
}
})(r);
}), r.internal.events.subscribe("putCatalog", function() {
(function(n) {
if (n.internal.acroformPlugin.acroFormDictionaryRoot === void 0) throw new Error("putCatalogCallback: Root missing.");
n.internal.write("/AcroForm " + n.internal.acroformPlugin.acroFormDictionaryRoot.objId + " 0 R");
})(r);
}), r.internal.events.subscribe("postPutPages", function(n) {
(function(a, u) {
var s = !a;
for (var c in a || (u.internal.newObjectDeferredBegin(u.internal.acroformPlugin.acroFormDictionaryRoot.objId, !0), u.internal.acroformPlugin.acroFormDictionaryRoot.putStream()), a = a || u.internal.acroformPlugin.acroFormDictionaryRoot.Kids) if (a.hasOwnProperty(c)) {
var f = a[c], h = [], g = f.Rect;
if (f.Rect && (f.Rect = Yl(f.Rect, u)), u.internal.newObjectDeferredBegin(f.objId, !0), f.DA = Bt.createDefaultAppearanceStream(f), he(f) === "object" && typeof f.getKeyValueListForStream == "function" && (h = f.getKeyValueListForStream()), f.Rect = g, f.hasAppearanceStream && !f.appearanceStreamContent) {
var y = Xl(f);
h.push({ key: "AP", value: "<</N " + y + ">>" }), u.internal.acroformPlugin.xForms.push(y);
}
if (f.appearanceStreamContent) {
var w = "";
for (var S in f.appearanceStreamContent) if (f.appearanceStreamContent.hasOwnProperty(S)) {
var p = f.appearanceStreamContent[S];
if (w += "/" + S + " ", w += "<<", Object.keys(p).length >= 1 || Array.isArray(p)) {
for (var c in p) if (p.hasOwnProperty(c)) {
var O = p[c];
typeof O == "function" && (O = O.call(u, f)), w += "/" + c + " " + O + " ", u.internal.acroformPlugin.xForms.indexOf(O) >= 0 || u.internal.acroformPlugin.xForms.push(O);
}
} else typeof (O = p) == "function" && (O = O.call(u, f)), w += "/" + c + " " + O, u.internal.acroformPlugin.xForms.indexOf(O) >= 0 || u.internal.acroformPlugin.xForms.push(O);
w += ">>";
}
h.push({ key: "AP", value: `<<
` + w + ">>" });
}
u.internal.putStream({ additionalKeyValues: h, objectId: f.objId }), u.internal.out("endobj");
}
s && $l(u.internal.acroformPlugin.xForms, u);
})(n, r);
}), r.internal.acroformPlugin.isInitialized = !0;
}
}, Mu = Pe.__acroform__.arrayToPdfArray = function(r, e, n) {
var a = function(c) {
return c;
};
if (Array.isArray(r)) {
for (var u = "[", s = 0; s < r.length; s++) switch (s !== 0 && (u += " "), he(r[s])) {
case "boolean":
case "number":
case "object":
u += r[s].toString();
break;
case "string":
r[s].substr(0, 1) !== "/" ? (e !== void 0 && n && (a = n.internal.getEncryptor(e)), u += "(" + Xr(a(r[s].toString())) + ")") : u += r[s].toString();
}
return u += "]";
}
throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray");
}, fo = function(r, e, n) {
var a = function(u) {
return u;
};
return e !== void 0 && n && (a = n.internal.getEncryptor(e)), (r = r || "").toString(), r = "(" + Xr(a(r)) + ")";
}, Qn = function() {
this._objId = void 0, this._scope = void 0, Object.defineProperty(this, "objId", { get: function() {
if (this._objId === void 0) {
if (this.scope === void 0) return;
this._objId = this.scope.internal.newObjectDeferred();
}
return this._objId;
}, set: function(r) {
this._objId = r;
} }), Object.defineProperty(this, "scope", { value: this._scope, writable: !0 });
};
Qn.prototype.toString = function() {
return this.objId + " 0 R";
}, Qn.prototype.putStream = function() {
var r = this.getKeyValueListForStream();
this.scope.internal.putStream({ data: this.stream, additionalKeyValues: r, objectId: this.objId }), this.scope.internal.out("endobj");
}, Qn.prototype.getKeyValueListForStream = function() {
var r = [], e = Object.getOwnPropertyNames(this).filter(function(s) {
return s != "content" && s != "appearanceStreamContent" && s != "scope" && s != "objId" && s.substring(0, 1) != "_";
});
for (var n in e) if (Object.getOwnPropertyDescriptor(this, e[n]).configurable === !1) {
var a = e[n], u = this[a];
u && (Array.isArray(u) ? r.push({ key: a, value: Mu(u, this.objId, this.scope) }) : u instanceof Qn ? (u.scope = this.scope, r.push({ key: a, value: u.objId + " 0 R" })) : typeof u != "function" && r.push({ key: a, value: u }));
}
return r;
};
var Bu = function() {
Qn.call(this), Object.defineProperty(this, "Type", { value: "/XObject", configurable: !1, writable: !0 }), Object.defineProperty(this, "Subtype", { value: "/Form", configurable: !1, writable: !0 }), Object.defineProperty(this, "FormType", { value: 1, configurable: !1, writable: !0 });
var r, e = [];
Object.defineProperty(this, "BBox", { configurable: !1, get: function() {
return e;
}, set: function(n) {
e = n;
} }), Object.defineProperty(this, "Resources", { value: "2 0 R", configurable: !1, writable: !0 }), Object.defineProperty(this, "stream", { enumerable: !1, configurable: !0, set: function(n) {
r = n.trim();
}, get: function() {
return r || null;
} });
};
fn(Bu, Qn);
var Eu = function() {
Qn.call(this);
var r, e = [];
Object.defineProperty(this, "Kids", { enumerable: !1, configurable: !0, get: function() {
return e.length > 0 ? e : void 0;
} }), Object.defineProperty(this, "Fields", { enumerable: !1, configurable: !1, get: function() {
return e;
} }), Object.defineProperty(this, "DA", { enumerable: !1, configurable: !1, get: function() {
if (r) {
var n = function(a) {
return a;
};
return this.scope && (n = this.scope.internal.getEncryptor(this.objId)), "(" + Xr(n(r)) + ")";
}
}, set: function(n) {
r = n;
} });
};
fn(Eu, Qn);
var Tn = function r() {
Qn.call(this);
var e = 4;
Object.defineProperty(this, "F", { enumerable: !1, configurable: !1, get: function() {
return e;
}, set: function(_) {
if (isNaN(_)) throw new Error('Invalid value "' + _ + '" for attribute F supplied.');
e = _;
} }), Object.defineProperty(this, "showWhenPrinted", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(e, 3);
}, set: function(_) {
_ ? this.F = je(e, 3) : this.F = Oe(e, 3);
} });
var n = 0;
Object.defineProperty(this, "Ff", { enumerable: !1, configurable: !1, get: function() {
return n;
}, set: function(_) {
if (isNaN(_)) throw new Error('Invalid value "' + _ + '" for attribute Ff supplied.');
n = _;
} });
var a = [];
Object.defineProperty(this, "Rect", { enumerable: !1, configurable: !1, get: function() {
if (a.length !== 0) return a;
}, set: function(_) {
a = _ !== void 0 ? _ : [];
} }), Object.defineProperty(this, "x", { enumerable: !0, configurable: !0, get: function() {
return !a || isNaN(a[0]) ? 0 : a[0];
}, set: function(_) {
a[0] = _;
} }), Object.defineProperty(this, "y", { enumerable: !0, configurable: !0, get: function() {
return !a || isNaN(a[1]) ? 0 : a[1];
}, set: function(_) {
a[1] = _;
} }), Object.defineProperty(this, "width", { enumerable: !0, configurable: !0, get: function() {
return !a || isNaN(a[2]) ? 0 : a[2];
}, set: function(_) {
a[2] = _;
} }), Object.defineProperty(this, "height", { enumerable: !0, configurable: !0, get: function() {
return !a || isNaN(a[3]) ? 0 : a[3];
}, set: function(_) {
a[3] = _;
} });
var u = "";
Object.defineProperty(this, "FT", { enumerable: !0, configurable: !1, get: function() {
return u;
}, set: function(_) {
switch (_) {
case "/Btn":
case "/Tx":
case "/Ch":
case "/Sig":
u = _;
break;
default:
throw new Error('Invalid value "' + _ + '" for attribute FT supplied.');
}
} });
var s = null;
Object.defineProperty(this, "T", { enumerable: !0, configurable: !1, get: function() {
if (!s || s.length < 1) {
if (this instanceof ds) return;
s = "FieldObject" + r.FieldNum++;
}
var _ = function(M) {
return M;
};
return this.scope && (_ = this.scope.internal.getEncryptor(this.objId)), "(" + Xr(_(s)) + ")";
}, set: function(_) {
s = _.toString();
} }), Object.defineProperty(this, "fieldName", { configurable: !0, enumerable: !0, get: function() {
return s;
}, set: function(_) {
s = _;
} });
var c = "helvetica";
Object.defineProperty(this, "fontName", { enumerable: !0, configurable: !0, get: function() {
return c;
}, set: function(_) {
c = _;
} });
var f = "normal";
Object.defineProperty(this, "fontStyle", { enumerable: !0, configurable: !0, get: function() {
return f;
}, set: function(_) {
f = _;
} });
var h = 0;
Object.defineProperty(this, "fontSize", { enumerable: !0, configurable: !0, get: function() {
return h;
}, set: function(_) {
h = _;
} });
var g = void 0;
Object.defineProperty(this, "maxFontSize", { enumerable: !0, configurable: !0, get: function() {
return g === void 0 ? 50 / ko : g;
}, set: function(_) {
g = _;
} });
var y = "black";
Object.defineProperty(this, "color", { enumerable: !0, configurable: !0, get: function() {
return y;
}, set: function(_) {
y = _;
} });
var w = "/F1 0 Tf 0 g";
Object.defineProperty(this, "DA", { enumerable: !0, configurable: !1, get: function() {
if (!(!w || this instanceof ds || this instanceof Yr)) return fo(w, this.objId, this.scope);
}, set: function(_) {
_ = _.toString(), w = _;
} });
var S = null;
Object.defineProperty(this, "DV", { enumerable: !1, configurable: !1, get: function() {
if (S) return this instanceof He ? S : fo(S, this.objId, this.scope);
}, set: function(_) {
_ = _.toString(), S = this instanceof He ? _ : _.substr(0, 1) === "(" ? Si(_.substr(1, _.length - 2)) : Si(_);
} }), Object.defineProperty(this, "defaultValue", { enumerable: !0, configurable: !0, get: function() {
return this instanceof He ? Si(S.substr(1, S.length - 1)) : S;
}, set: function(_) {
_ = _.toString(), S = this instanceof He ? "/" + _ : _;
} });
var p = null;
Object.defineProperty(this, "_V", { enumerable: !1, configurable: !1, get: function() {
if (p) return p;
}, set: function(_) {
this.V = _;
} }), Object.defineProperty(this, "V", { enumerable: !1, configurable: !1, get: function() {
if (p) return this instanceof He ? p : fo(p, this.objId, this.scope);
}, set: function(_) {
_ = _.toString(), p = this instanceof He ? _ : _.substr(0, 1) === "(" ? Si(_.substr(1, _.length - 2)) : Si(_);
} }), Object.defineProperty(this, "value", { enumerable: !0, configurable: !0, get: function() {
return this instanceof He ? Si(p.substr(1, p.length - 1)) : p;
}, set: function(_) {
_ = _.toString(), p = this instanceof He ? "/" + _ : _;
} }), Object.defineProperty(this, "hasAnnotation", { enumerable: !0, configurable: !0, get: function() {
return this.Rect;
} }), Object.defineProperty(this, "Type", { enumerable: !0, configurable: !1, get: function() {
return this.hasAnnotation ? "/Annot" : null;
} }), Object.defineProperty(this, "Subtype", { enumerable: !0, configurable: !1, get: function() {
return this.hasAnnotation ? "/Widget" : null;
} });
var O, F = !1;
Object.defineProperty(this, "hasAppearanceStream", { enumerable: !0, configurable: !0, get: function() {
return F;
}, set: function(_) {
_ = !!_, F = _;
} }), Object.defineProperty(this, "page", { enumerable: !0, configurable: !0, get: function() {
if (O) return O;
}, set: function(_) {
O = _;
} }), Object.defineProperty(this, "readOnly", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(this.Ff, 1);
}, set: function(_) {
_ ? this.Ff = je(this.Ff, 1) : this.Ff = Oe(this.Ff, 1);
} }), Object.defineProperty(this, "required", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(this.Ff, 2);
}, set: function(_) {
_ ? this.Ff = je(this.Ff, 2) : this.Ff = Oe(this.Ff, 2);
} }), Object.defineProperty(this, "noExport", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(this.Ff, 3);
}, set: function(_) {
_ ? this.Ff = je(this.Ff, 3) : this.Ff = Oe(this.Ff, 3);
} });
var q = null;
Object.defineProperty(this, "Q", { enumerable: !0, configurable: !1, get: function() {
if (q !== null) return q;
}, set: function(_) {
if ([0, 1, 2].indexOf(_) === -1) throw new Error('Invalid value "' + _ + '" for attribute Q supplied.');
q = _;
} }), Object.defineProperty(this, "textAlign", { get: function() {
var _;
switch (q) {
case 0:
default:
_ = "left";
break;
case 1:
_ = "center";
break;
case 2:
_ = "right";
}
return _;
}, configurable: !0, enumerable: !0, set: function(_) {
switch (_) {
case "right":
case 2:
q = 2;
break;
case "center":
case 1:
q = 1;
break;
case "left":
case 0:
default:
q = 0;
}
} });
};
fn(Tn, Qn);
var Ii = function() {
Tn.call(this), this.FT = "/Ch", this.V = "()", this.fontName = "zapfdingbats";
var r = 0;
Object.defineProperty(this, "TI", { enumerable: !0, configurable: !1, get: function() {
return r;
}, set: function(n) {
r = n;
} }), Object.defineProperty(this, "topIndex", { enumerable: !0, configurable: !0, get: function() {
return r;
}, set: function(n) {
r = n;
} });
var e = [];
Object.defineProperty(this, "Opt", { enumerable: !0, configurable: !1, get: function() {
return Mu(e, this.objId, this.scope);
}, set: function(n) {
var a, u;
u = [], typeof (a = n) == "string" && (u = function(s, c, f) {
f || (f = 1);
for (var h, g = []; h = c.exec(s); ) g.push(h[f]);
return g;
}(a, /\((.*?)\)/g)), e = u;
} }), this.getOptions = function() {
return e;
}, this.setOptions = function(n) {
e = n, this.sort && e.sort();
}, this.addOption = function(n) {
n = (n = n || "").toString(), e.push(n), this.sort && e.sort();
}, this.removeOption = function(n, a) {
for (a = a || !1, n = (n = n || "").toString(); e.indexOf(n) !== -1 && (e.splice(e.indexOf(n), 1), a !== !1); ) ;
}, Object.defineProperty(this, "combo", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(this.Ff, 18);
}, set: function(n) {
n ? this.Ff = je(this.Ff, 18) : this.Ff = Oe(this.Ff, 18);
} }), Object.defineProperty(this, "edit", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(this.Ff, 19);
}, set: function(n) {
this.combo === !0 && (n ? this.Ff = je(this.Ff, 19) : this.Ff = Oe(this.Ff, 19));
} }), Object.defineProperty(this, "sort", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(this.Ff, 20);
}, set: function(n) {
n ? (this.Ff = je(this.Ff, 20), e.sort()) : this.Ff = Oe(this.Ff, 20);
} }), Object.defineProperty(this, "multiSelect", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(this.Ff, 22);
}, set: function(n) {
n ? this.Ff = je(this.Ff, 22) : this.Ff = Oe(this.Ff, 22);
} }), Object.defineProperty(this, "doNotSpellCheck", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(this.Ff, 23);
}, set: function(n) {
n ? this.Ff = je(this.Ff, 23) : this.Ff = Oe(this.Ff, 23);
} }), Object.defineProperty(this, "commitOnSelChange", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(this.Ff, 27);
}, set: function(n) {
n ? this.Ff = je(this.Ff, 27) : this.Ff = Oe(this.Ff, 27);
} }), this.hasAppearanceStream = !1;
};
fn(Ii, Tn);
var Ci = function() {
Ii.call(this), this.fontName = "helvetica", this.combo = !1;
};
fn(Ci, Ii);
var ji = function() {
Ci.call(this), this.combo = !0;
};
fn(ji, Ci);
var us = function() {
ji.call(this), this.edit = !0;
};
fn(us, ji);
var He = function() {
Tn.call(this), this.FT = "/Btn", Object.defineProperty(this, "noToggleToOff", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(this.Ff, 15);
}, set: function(n) {
n ? this.Ff = je(this.Ff, 15) : this.Ff = Oe(this.Ff, 15);
} }), Object.defineProperty(this, "radio", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(this.Ff, 16);
}, set: function(n) {
n ? this.Ff = je(this.Ff, 16) : this.Ff = Oe(this.Ff, 16);
} }), Object.defineProperty(this, "pushButton", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(this.Ff, 17);
}, set: function(n) {
n ? this.Ff = je(this.Ff, 17) : this.Ff = Oe(this.Ff, 17);
} }), Object.defineProperty(this, "radioIsUnison", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(this.Ff, 26);
}, set: function(n) {
n ? this.Ff = je(this.Ff, 26) : this.Ff = Oe(this.Ff, 26);
} });
var r, e = {};
Object.defineProperty(this, "MK", { enumerable: !1, configurable: !1, get: function() {
var n = function(s) {
return s;
};
if (this.scope && (n = this.scope.internal.getEncryptor(this.objId)), Object.keys(e).length !== 0) {
var a, u = [];
for (a in u.push("<<"), e) u.push("/" + a + " (" + Xr(n(e[a])) + ")");
return u.push(">>"), u.join(`
`);
}
}, set: function(n) {
he(n) === "object" && (e = n);
} }), Object.defineProperty(this, "caption", { enumerable: !0, configurable: !0, get: function() {
return e.CA || "";
}, set: function(n) {
typeof n == "string" && (e.CA = n);
} }), Object.defineProperty(this, "AS", { enumerable: !1, configurable: !1, get: function() {
return r;
}, set: function(n) {
r = n;
} }), Object.defineProperty(this, "appearanceState", { enumerable: !0, configurable: !0, get: function() {
return r.substr(1, r.length - 1);
}, set: function(n) {
r = "/" + n;
} });
};
fn(He, Tn);
var ls = function() {
He.call(this), this.pushButton = !0;
};
fn(ls, He);
var Oi = function() {
He.call(this), this.radio = !0, this.pushButton = !1;
var r = [];
Object.defineProperty(this, "Kids", { enumerable: !0, configurable: !1, get: function() {
return r;
}, set: function(e) {
r = e !== void 0 ? e : [];
} });
};
fn(Oi, He);
var ds = function() {
var r, e;
Tn.call(this), Object.defineProperty(this, "Parent", { enumerable: !1, configurable: !1, get: function() {
return r;
}, set: function(u) {
r = u;
} }), Object.defineProperty(this, "optionName", { enumerable: !1, configurable: !0, get: function() {
return e;
}, set: function(u) {
e = u;
} });
var n, a = {};
Object.defineProperty(this, "MK", { enumerable: !1, configurable: !1, get: function() {
var u = function(f) {
return f;
};
this.scope && (u = this.scope.internal.getEncryptor(this.objId));
var s, c = [];
for (s in c.push("<<"), a) c.push("/" + s + " (" + Xr(u(a[s])) + ")");
return c.push(">>"), c.join(`
`);
}, set: function(u) {
he(u) === "object" && (a = u);
} }), Object.defineProperty(this, "caption", { enumerable: !0, configurable: !0, get: function() {
return a.CA || "";
}, set: function(u) {
typeof u == "string" && (a.CA = u);
} }), Object.defineProperty(this, "AS", { enumerable: !1, configurable: !1, get: function() {
return n;
}, set: function(u) {
n = u;
} }), Object.defineProperty(this, "appearanceState", { enumerable: !0, configurable: !0, get: function() {
return n.substr(1, n.length - 1);
}, set: function(u) {
n = "/" + u;
} }), this.caption = "l", this.appearanceState = "Off", this._AppearanceType = Bt.RadioButton.Circle, this.appearanceStreamContent = this._AppearanceType.createAppearanceStream(this.optionName);
};
fn(ds, Tn), Oi.prototype.setAppearance = function(r) {
if (!("createAppearanceStream" in r) || !("getCA" in r)) throw new Error("Couldn't assign Appearance to RadioButton. Appearance was Invalid!");
for (var e in this.Kids) if (this.Kids.hasOwnProperty(e)) {
var n = this.Kids[e];
n.appearanceStreamContent = r.createAppearanceStream(n.optionName), n.caption = r.getCA();
}
}, Oi.prototype.createOption = function(r) {
var e = new ds();
return e.Parent = this, e.optionName = r, this.Kids.push(e), tc.call(this.scope, e), e;
};
var cs = function() {
He.call(this), this.fontName = "zapfdingbats", this.caption = "3", this.appearanceState = "On", this.value = "On", this.textAlign = "center", this.appearanceStreamContent = Bt.CheckBox.createAppearanceStream();
};
fn(cs, He);
var Yr = function() {
Tn.call(this), this.FT = "/Tx", Object.defineProperty(this, "multiline", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(this.Ff, 13);
}, set: function(e) {
e ? this.Ff = je(this.Ff, 13) : this.Ff = Oe(this.Ff, 13);
} }), Object.defineProperty(this, "fileSelect", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(this.Ff, 21);
}, set: function(e) {
e ? this.Ff = je(this.Ff, 21) : this.Ff = Oe(this.Ff, 21);
} }), Object.defineProperty(this, "doNotSpellCheck", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(this.Ff, 23);
}, set: function(e) {
e ? this.Ff = je(this.Ff, 23) : this.Ff = Oe(this.Ff, 23);
} }), Object.defineProperty(this, "doNotScroll", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(this.Ff, 24);
}, set: function(e) {
e ? this.Ff = je(this.Ff, 24) : this.Ff = Oe(this.Ff, 24);
} }), Object.defineProperty(this, "comb", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(this.Ff, 25);
}, set: function(e) {
e ? this.Ff = je(this.Ff, 25) : this.Ff = Oe(this.Ff, 25);
} }), Object.defineProperty(this, "richText", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(this.Ff, 26);
}, set: function(e) {
e ? this.Ff = je(this.Ff, 26) : this.Ff = Oe(this.Ff, 26);
} });
var r = null;
Object.defineProperty(this, "MaxLen", { enumerable: !0, configurable: !1, get: function() {
return r;
}, set: function(e) {
r = e;
} }), Object.defineProperty(this, "maxLength", { enumerable: !0, configurable: !0, get: function() {
return r;
}, set: function(e) {
Number.isInteger(e) && (r = e);
} }), Object.defineProperty(this, "hasAppearanceStream", { enumerable: !0, configurable: !0, get: function() {
return this.V || this.DV;
} });
};
fn(Yr, Tn);
var fs = function() {
Yr.call(this), Object.defineProperty(this, "password", { enumerable: !0, configurable: !0, get: function() {
return !!Ce(this.Ff, 14);
}, set: function(r) {
r ? this.Ff = je(this.Ff, 14) : this.Ff = Oe(this.Ff, 14);
} }), this.password = !0;
};
fn(fs, Yr);
var Bt = { CheckBox: { createAppearanceStream: function() {
return { N: { On: Bt.CheckBox.YesNormal }, D: { On: Bt.CheckBox.YesPushDown, Off: Bt.CheckBox.OffPushDown } };
}, YesPushDown: function(r) {
var e = $n(r);
e.scope = r.scope;
var n = [], a = r.scope.internal.getFont(r.fontName, r.fontStyle).id, u = r.scope.__private__.encodeColorString(r.color), s = Ao(r, r.caption);
return n.push("0.749023 g"), n.push("0 0 " + Xt(Bt.internal.getWidth(r)) + " " + Xt(Bt.internal.getHeight(r)) + " re"), n.push("f"), n.push("BMC"), n.push("q"), n.push("0 0 1 rg"), n.push("/" + a + " " + Xt(s.fontSize) + " Tf " + u), n.push("BT"), n.push(s.text), n.push("ET"), n.push("Q"), n.push("EMC"), e.stream = n.join(`
`), e;
}, YesNormal: function(r) {
var e = $n(r);
e.scope = r.scope;
var n = r.scope.internal.getFont(r.fontName, r.fontStyle).id, a = r.scope.__private__.encodeColorString(r.color), u = [], s = Bt.internal.getHeight(r), c = Bt.internal.getWidth(r), f = Ao(r, r.caption);
return u.push("1 g"), u.push("0 0 " + Xt(c) + " " + Xt(s) + " re"), u.push("f"), u.push("q"), u.push("0 0 1 rg"), u.push("0 0 " + Xt(c - 1) + " " + Xt(s - 1) + " re"), u.push("W"), u.push("n"), u.push("0 g"), u.push("BT"), u.push("/" + n + " " + Xt(f.fontSize) + " Tf " + a), u.push(f.text), u.push("ET"), u.push("Q"), e.stream = u.join(`
`), e;
}, OffPushDown: function(r) {
var e = $n(r);
e.scope = r.scope;
var n = [];
return n.push("0.749023 g"), n.push("0 0 " + Xt(Bt.internal.getWidth(r)) + " " + Xt(Bt.internal.getHeight(r)) + " re"), n.push("f"), e.stream = n.join(`
`), e;
} }, RadioButton: { Circle: { createAppearanceStream: function(r) {
var e = { D: { Off: Bt.RadioButton.Circle.OffPushDown }, N: {} };
return e.N[r] = Bt.RadioButton.Circle.YesNormal, e.D[r] = Bt.RadioButton.Circle.YesPushDown, e;
}, getCA: function() {
return "l";
}, YesNormal: function(r) {
var e = $n(r);
e.scope = r.scope;
var n = [], a = Bt.internal.getWidth(r) <= Bt.internal.getHeight(r) ? Bt.internal.getWidth(r) / 4 : Bt.internal.getHeight(r) / 4;
a = Number((0.9 * a).toFixed(5));
var u = Bt.internal.Bezier_C, s = Number((a * u).toFixed(5));
return n.push("q"), n.push("1 0 0 1 " + Fr(Bt.internal.getWidth(r) / 2) + " " + Fr(Bt.internal.getHeight(r) / 2) + " cm"), n.push(a + " 0 m"), n.push(a + " " + s + " " + s + " " + a + " 0 " + a + " c"), n.push("-" + s + " " + a + " -" + a + " " + s + " -" + a + " 0 c"), n.push("-" + a + " -" + s + " -" + s + " -" + a + " 0 -" + a + " c"), n.push(s + " -" + a + " " + a + " -" + s + " " + a + " 0 c"), n.push("f"), n.push("Q"), e.stream = n.join(`
`), e;
}, YesPushDown: function(r) {
var e = $n(r);
e.scope = r.scope;
var n = [], a = Bt.internal.getWidth(r) <= Bt.internal.getHeight(r) ? Bt.internal.getWidth(r) / 4 : Bt.internal.getHeight(r) / 4;
a = Number((0.9 * a).toFixed(5));
var u = Number((2 * a).toFixed(5)), s = Number((u * Bt.internal.Bezier_C).toFixed(5)), c = Number((a * Bt.internal.Bezier_C).toFixed(5));
return n.push("0.749023 g"), n.push("q"), n.push("1 0 0 1 " + Fr(Bt.internal.getWidth(r) / 2) + " " + Fr(Bt.internal.getHeight(r) / 2) + " cm"), n.push(u + " 0 m"), n.push(u + " " + s + " " + s + " " + u + " 0 " + u + " c"), n.push("-" + s + " " + u + " -" + u + " " + s + " -" + u + " 0 c"), n.push("-" + u + " -" + s + " -" + s + " -" + u + " 0 -" + u + " c"), n.push(s + " -" + u + " " + u + " -" + s + " " + u + " 0 c"), n.push("f"), n.push("Q"), n.push("0 g"), n.push("q"), n.push("1 0 0 1 " + Fr(Bt.internal.getWidth(r) / 2) + " " + Fr(Bt.internal.getHeight(r) / 2) + " cm"), n.push(a + " 0 m"), n.push(a + " " + c + " " + c + " " + a + " 0 " + a + " c"), n.push("-" + c + " " + a + " -" + a + " " + c + " -" + a + " 0 c"), n.push("-" + a + " -" + c + " -" + c + " -" + a + " 0 -" + a + " c"), n.push(c + " -" + a + " " + a + " -" + c + " " + a + " 0 c"), n.push("f"), n.push("Q"), e.stream = n.join(`
`), e;
}, OffPushDown: function(r) {
var e = $n(r);
e.scope = r.scope;
var n = [], a = Bt.internal.getWidth(r) <= Bt.internal.getHeight(r) ? Bt.internal.getWidth(r) / 4 : Bt.internal.getHeight(r) / 4;
a = Number((0.9 * a).toFixed(5));
var u = Number((2 * a).toFixed(5)), s = Number((u * Bt.internal.Bezier_C).toFixed(5));
return n.push("0.749023 g"), n.push("q"), n.push("1 0 0 1 " + Fr(Bt.internal.getWidth(r) / 2) + " " + Fr(Bt.internal.getHeight(r) / 2) + " cm"), n.push(u + " 0 m"), n.push(u + " " + s + " " + s + " " + u + " 0 " + u + " c"), n.push("-" + s + " " + u + " -" + u + " " + s + " -" + u + " 0 c"), n.push("-" + u + " -" + s + " -" + s + " -" + u + " 0 -" + u + " c"), n.push(s + " -" + u + " " + u + " -" + s + " " + u + " 0 c"), n.push("f"), n.push("Q"), e.stream = n.join(`
`), e;
} }, Cross: { createAppearanceStream: function(r) {
var e = { D: { Off: Bt.RadioButton.Cross.OffPushDown }, N: {} };
return e.N[r] = Bt.RadioButton.Cross.YesNormal, e.D[r] = Bt.RadioButton.Cross.YesPushDown, e;
}, getCA: function() {
return "8";
}, YesNormal: function(r) {
var e = $n(r);
e.scope = r.scope;
var n = [], a = Bt.internal.calculateCross(r);
return n.push("q"), n.push("1 1 " + Xt(Bt.internal.getWidth(r) - 2) + " " + Xt(Bt.internal.getHeight(r) - 2) + " re"), n.push("W"), n.push("n"), n.push(Xt(a.x1.x) + " " + Xt(a.x1.y) + " m"), n.push(Xt(a.x2.x) + " " + Xt(a.x2.y) + " l"), n.push(Xt(a.x4.x) + " " + Xt(a.x4.y) + " m"), n.push(Xt(a.x3.x) + " " + Xt(a.x3.y) + " l"), n.push("s"), n.push("Q"), e.stream = n.join(`
`), e;
}, YesPushDown: function(r) {
var e = $n(r);
e.scope = r.scope;
var n = Bt.internal.calculateCross(r), a = [];
return a.push("0.749023 g"), a.push("0 0 " + Xt(Bt.internal.getWidth(r)) + " " + Xt(Bt.internal.getHeight(r)) + " re"), a.push("f"), a.push("q"), a.push("1 1 " + Xt(Bt.internal.getWidth(r) - 2) + " " + Xt(Bt.internal.getHeight(r) - 2) + " re"), a.push("W"), a.push("n"), a.push(Xt(n.x1.x) + " " + Xt(n.x1.y) + " m"), a.push(Xt(n.x2.x) + " " + Xt(n.x2.y) + " l"), a.push(Xt(n.x4.x) + " " + Xt(n.x4.y) + " m"), a.push(Xt(n.x3.x) + " " + Xt(n.x3.y) + " l"), a.push("s"), a.push("Q"), e.stream = a.join(`
`), e;
}, OffPushDown: function(r) {
var e = $n(r);
e.scope = r.scope;
var n = [];
return n.push("0.749023 g"), n.push("0 0 " + Xt(Bt.internal.getWidth(r)) + " " + Xt(Bt.internal.getHeight(r)) + " re"), n.push("f"), e.stream = n.join(`
`), e;
} } }, createDefaultAppearanceStream: function(r) {
var e = r.scope.internal.getFont(r.fontName, r.fontStyle).id, n = r.scope.__private__.encodeColorString(r.color);
return "/" + e + " " + r.fontSize + " Tf " + n;
} };
Bt.internal = { Bezier_C: 0.551915024494, calculateCross: function(r) {
var e = Bt.internal.getWidth(r), n = Bt.internal.getHeight(r), a = Math.min(e, n);
return { x1: { x: (e - a) / 2, y: (n - a) / 2 + a }, x2: { x: (e - a) / 2 + a, y: (n - a) / 2 }, x3: { x: (e - a) / 2, y: (n - a) / 2 }, x4: { x: (e - a) / 2 + a, y: (n - a) / 2 + a } };
} }, Bt.internal.getWidth = function(r) {
var e = 0;
return he(r) === "object" && (e = lu(r.Rect[2])), e;
}, Bt.internal.getHeight = function(r) {
var e = 0;
return he(r) === "object" && (e = lu(r.Rect[3])), e;
};
var tc = Pe.addField = function(r) {
if (Ql(this, r), !(r instanceof Tn)) throw new Error("Invalid argument passed to jsPDF.addField.");
var e;
return (e = r).scope.internal.acroformPlugin.printedOut && (e.scope.internal.acroformPlugin.printedOut = !1, e.scope.internal.acroformPlugin.acroFormDictionaryRoot = null), e.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(e), r.page = r.scope.internal.getCurrentPageInfo().pageNumber, this;
};
Pe.AcroFormChoiceField = Ii, Pe.AcroFormListBox = Ci, Pe.AcroFormComboBox = ji, Pe.AcroFormEditBox = us, Pe.AcroFormButton = He, Pe.AcroFormPushButton = ls, Pe.AcroFormRadioButton = Oi, Pe.AcroFormCheckBox = cs, Pe.AcroFormTextField = Yr, Pe.AcroFormPasswordField = fs, Pe.AcroFormAppearance = Bt, Pe.AcroForm = { ChoiceField: Ii, ListBox: Ci, ComboBox: ji, EditBox: us, Button: He, PushButton: ls, RadioButton: Oi, CheckBox: cs, TextField: Yr, PasswordField: fs, Appearance: Bt }, Ut.AcroForm = { ChoiceField: Ii, ListBox: Ci, ComboBox: ji, EditBox: us, Button: He, PushButton: ls, RadioButton: Oi, CheckBox: cs, TextField: Yr, PasswordField: fs, Appearance: Bt };
Ut.AcroForm;
function qu(r) {
return r.reduce(function(e, n, a) {
return e[n] = a, e;
}, {});
}
(function(r) {
r.__addimage__ = {};
var e = "UNKNOWN", n = { PNG: [[137, 80, 78, 71]], TIFF: [[77, 77, 0, 42], [73, 73, 42, 0]], JPEG: [[255, 216, 255, 224, void 0, void 0, 74, 70, 73, 70, 0], [255, 216, 255, 225, void 0, void 0, 69, 120, 105, 102, 0, 0], [255, 216, 255, 219], [255, 216, 255, 238]], JPEG2000: [[0, 0, 0, 12, 106, 80, 32, 32]], GIF87a: [[71, 73, 70, 56, 55, 97]], GIF89a: [[71, 73, 70, 56, 57, 97]], WEBP: [[82, 73, 70, 70, void 0, void 0, void 0, void 0, 87, 69, 66, 80]], BMP: [[66, 77], [66, 65], [67, 73], [67, 80], [73, 67], [80, 84]] }, a = r.__addimage__.getImageFileTypeByImageData = function(P, k) {
var W, D, ot, it, ft, $ = e;
if ((k = k || e) === "RGBA" || P.data !== void 0 && P.data instanceof Uint8ClampedArray && "height" in P && "width" in P) return "RGBA";
if (wt(P)) for (ft in n) for (ot = n[ft], W = 0; W < ot.length; W += 1) {
for (it = !0, D = 0; D < ot[W].length; D += 1) if (ot[W][D] !== void 0 && ot[W][D] !== P[D]) {
it = !1;
break;
}
if (it === !0) {
$ = ft;
break;
}
}
else for (ft in n) for (ot = n[ft], W = 0; W < ot.length; W += 1) {
for (it = !0, D = 0; D < ot[W].length; D += 1) if (ot[W][D] !== void 0 && ot[W][D] !== P.charCodeAt(D)) {
it = !1;
break;
}
if (it === !0) {
$ = ft;
break;
}
}
return $ === e && k !== e && ($ = k), $;
}, u = function P(k) {
for (var W = this.internal.write, D = this.internal.putStream, ot = (0, this.internal.getFilters)(); ot.indexOf("FlateEncode") !== -1; ) ot.splice(ot.indexOf("FlateEncode"), 1);
k.objectId = this.internal.newObject();
var it = [];
if (it.push({ key: "Type", value: "/XObject" }), it.push({ key: "Subtype", value: "/Image" }), it.push({ key: "Width", value: k.width }), it.push({ key: "Height", value: k.height }), k.colorSpace === q.INDEXED ? it.push({ key: "ColorSpace", value: "[/Indexed /DeviceRGB " + (k.palette.length / 3 - 1) + " " + ("sMask" in k && k.sMask !== void 0 ? k.objectId + 2 : k.objectId + 1) + " 0 R]" }) : (it.push({ key: "ColorSpace", value: "/" + k.colorSpace }), k.colorSpace === q.DEVICE_CMYK && it.push({ key: "Decode", value: "[1 0 1 0 1 0 1 0]" })), it.push({ key: "BitsPerComponent", value: k.bitsPerComponent }), "decodeParameters" in k && k.decodeParameters !== void 0 && it.push({ key: "DecodeParms", value: "<<" + k.decodeParameters + ">>" }), "transparency" in k && Array.isArray(k.transparency)) {
for (var ft = "", $ = 0, lt = k.transparency.length; $ < lt; $++) ft += k.transparency[$] + " " + k.transparency[$] + " ";
it.push({ key: "Mask", value: "[" + ft + "]" });
}
k.sMask !== void 0 && it.push({ key: "SMask", value: k.objectId + 1 + " 0 R" });
var dt = k.filter !== void 0 ? ["/" + k.filter] : void 0;
if (D({ data: k.data, additionalKeyValues: it, alreadyAppliedFilters: dt, objectId: k.objectId }), W("endobj"), "sMask" in k && k.sMask !== void 0) {
var jt = "/Predictor " + k.predictor + " /Colors 1 /BitsPerComponent " + k.bitsPerComponent + " /Columns " + k.width, N = { width: k.width, height: k.height, colorSpace: "DeviceGray", bitsPerComponent: k.bitsPerComponent, decodeParameters: jt, data: k.sMask };
"filter" in k && (N.filter = k.filter), P.call(this, N);
}
if (k.colorSpace === q.INDEXED) {
var C = this.internal.newObject();
D({ data: z(new Uint8Array(k.palette)), objectId: C }), W("endobj");
}
}, s = function() {
var P = this.internal.collections.addImage_images;
for (var k in P) u.call(this, P[k]);
}, c = function() {
var P, k = this.internal.collections.addImage_images, W = this.internal.write;
for (var D in k) W("/I" + (P = k[D]).index, P.objectId, "0", "R");
}, f = function() {
this.internal.collections.addImage_images || (this.internal.collections.addImage_images = {}, this.internal.events.subscribe("putResources", s), this.internal.events.subscribe("putXobjectDict", c));
}, h = function() {
var P = this.internal.collections.addImage_images;
return f.call(this), P;
}, g = function() {
return Object.keys(this.internal.collections.addImage_images).length;
}, y = function(P) {
return typeof r["process" + P.toUpperCase()] == "function";
}, w = function(P) {
return he(P) === "object" && P.nodeType === 1;
}, S = function(P, k) {
if (P.nodeName === "IMG" && P.hasAttribute("src")) {
var W = "" + P.getAttribute("src");
if (W.indexOf("data:image/") === 0) return ha(unescape(W).split("base64,").pop());
var D = r.loadFile(W, !0);
if (D !== void 0) return D;
}
if (P.nodeName === "CANVAS") {
if (P.width === 0 || P.height === 0) throw new Error("Given canvas must have data. Canvas width: " + P.width + ", height: " + P.height);
var ot;
switch (k) {
case "PNG":
ot = "image/png";
break;
case "WEBP":
ot = "image/webp";
break;
case "JPEG":
case "JPG":
default:
ot = "image/jpeg";
}
return ha(P.toDataURL(ot, 1).split("base64,").pop());
}
}, p = function(P) {
var k = this.internal.collections.addImage_images;
if (k) {
for (var W in k) if (P === k[W].alias) return k[W];
}
}, O = function(P, k, W) {
return P || k || (P = -96, k = -96), P < 0 && (P = -1 * W.width * 72 / P / this.internal.scaleFactor), k < 0 && (k = -1 * W.height * 72 / k / this.internal.scaleFactor), P === 0 && (P = k * W.width / W.height), k === 0 && (k = P * W.height / W.width), [P, k];
}, F = function(P, k, W, D, ot, it) {
var ft = O.call(this, W, D, ot), $ = this.internal.getCoordinateString, lt = this.internal.getVerticalCoordinateString, dt = h.call(this);
if (W = ft[0], D = ft[1], dt[ot.index] = ot, it) {
it *= Math.PI / 180;
var jt = Math.cos(it), N = Math.sin(it), C = function(T) {
return T.toFixed(4);
}, B = [C(jt), C(N), C(-1 * N), C(jt), 0, 0, "cm"];
}
this.internal.write("q"), it ? (this.internal.write([1, "0", "0", 1, $(P), lt(k + D), "cm"].join(" ")), this.internal.write(B.join(" ")), this.internal.write([$(W), "0", "0", $(D), "0", "0", "cm"].join(" "))) : this.internal.write([$(W), "0", "0", $(D), $(P), lt(k + D), "cm"].join(" ")), this.isAdvancedAPI() && this.internal.write([1, 0, 0, -1, 0, 0, "cm"].join(" ")), this.internal.write("/I" + ot.index + " Do"), this.internal.write("Q");
}, q = r.color_spaces = { DEVICE_RGB: "DeviceRGB", DEVICE_GRAY: "DeviceGray", DEVICE_CMYK: "DeviceCMYK", CAL_GREY: "CalGray", CAL_RGB: "CalRGB", LAB: "Lab", ICC_BASED: "ICCBased", INDEXED: "Indexed", PATTERN: "Pattern", SEPARATION: "Separation", DEVICE_N: "DeviceN" };
r.decode = { DCT_DECODE: "DCTDecode", FLATE_DECODE: "FlateDecode", LZW_DECODE: "LZWDecode", JPX_DECODE: "JPXDecode", JBIG2_DECODE: "JBIG2Decode", ASCII85_DECODE: "ASCII85Decode", ASCII_HEX_DECODE: "ASCIIHexDecode", RUN_LENGTH_DECODE: "RunLengthDecode", CCITT_FAX_DECODE: "CCITTFaxDecode" };
var _ = r.image_compression = { NONE: "NONE", FAST: "FAST", MEDIUM: "MEDIUM", SLOW: "SLOW" }, M = r.__addimage__.sHashCode = function(P) {
var k, W, D = 0;
if (typeof P == "string") for (W = P.length, k = 0; k < W; k++) D = (D << 5) - D + P.charCodeAt(k), D |= 0;
else if (wt(P)) for (W = P.byteLength / 2, k = 0; k < W; k++) D = (D << 5) - D + P[k], D |= 0;
return D;
}, Y = r.__addimage__.validateStringAsBase64 = function(P) {
(P = P || "").toString().trim();
var k = !0;
return P.length === 0 && (k = !1), P.length % 4 != 0 && (k = !1), /^[A-Za-z0-9+/]+$/.test(P.substr(0, P.length - 2)) === !1 && (k = !1), /^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(P.substr(-2)) === !1 && (k = !1), k;
}, st = r.__addimage__.extractImageFromDataUrl = function(P) {
if (P == null || !(P = P.trim()).startsWith("data:")) return null;
var k = P.indexOf(",");
return k < 0 ? null : P.substring(0, k).trim().endsWith("base64") ? P.substring(k + 1) : null;
}, ct = r.__addimage__.supportsArrayBuffer = function() {
return typeof ArrayBuffer < "u" && typeof Uint8Array < "u";
};
r.__addimage__.isArrayBuffer = function(P) {
return ct() && P instanceof ArrayBuffer;
};
var wt = r.__addimage__.isArrayBufferView = function(P) {
return ct() && typeof Uint32Array < "u" && (P instanceof Int8Array || P instanceof Uint8Array || typeof Uint8ClampedArray < "u" && P instanceof Uint8ClampedArray || P instanceof Int16Array || P instanceof Uint16Array || P instanceof Int32Array || P instanceof Uint32Array || P instanceof Float32Array || P instanceof Float64Array);
}, tt = r.__addimage__.binaryStringToUint8Array = function(P) {
for (var k = P.length, W = new Uint8Array(k), D = 0; D < k; D++) W[D] = P.charCodeAt(D);
return W;
}, z = r.__addimage__.arrayBufferToBinaryString = function(P) {
for (var k = "", W = wt(P) ? P : new Uint8Array(P), D = 0; D < W.length; D += 8192) k += String.fromCharCode.apply(null, W.subarray(D, D + 8192));
return k;
};
r.addImage = function() {
var P, k, W, D, ot, it, ft, $, lt;
if (typeof arguments[1] == "number" ? (k = e, W = arguments[1], D = arguments[2], ot = arguments[3], it = arguments[4], ft = arguments[5], $ = arguments[6], lt = arguments[7]) : (k = arguments[1], W = arguments[2], D = arguments[3], ot = arguments[4], it = arguments[5], ft = arguments[6], $ = arguments[7], lt = arguments[8]), he(P = arguments[0]) === "object" && !w(P) && "imageData" in P) {
var dt = P;
P = dt.imageData, k = dt.format || k || e, W = dt.x || W || 0, D = dt.y || D || 0, ot = dt.w || dt.width || ot, it = dt.h || dt.height || it, ft = dt.alias || ft, $ = dt.compression || $, lt = dt.rotation || dt.angle || lt;
}
var jt = this.internal.getFilters();
if ($ === void 0 && jt.indexOf("FlateEncode") !== -1 && ($ = "SLOW"), isNaN(W) || isNaN(D)) throw new Error("Invalid coordinates passed to jsPDF.addImage");
f.call(this);
var N = rt.call(this, P, k, ft, $);
return F.call(this, W, D, ot, it, N, lt), this;
};
var rt = function(P, k, W, D) {
var ot, it, ft;
if (typeof P == "string" && a(P) === e) {
P = unescape(P);
var $ = pt(P, !1);
($ !== "" || ($ = r.loadFile(P, !0)) !== void 0) && (P = $);
}
if (w(P) && (P = S(P, k)), k = a(P, k), !y(k)) throw new Error("addImage does not support files of type '" + k + "', please ensure that a plugin for '" + k + "' support is added.");
if (((ft = W) == null || ft.length === 0) && (W = function(lt) {
return typeof lt == "string" || wt(lt) ? M(lt) : wt(lt.data) ? M(lt.data) : null;
}(P)), (ot = p.call(this, W)) || (ct() && (P instanceof Uint8Array || k === "RGBA" || (it = P, P = tt(P))), ot = this["process" + k.toUpperCase()](P, g.call(this), W, function(lt) {
return lt && typeof lt == "string" && (lt = lt.toUpperCase()), lt in r.image_compression ? lt : _.NONE;
}(D), it)), !ot) throw new Error("An unknown error occurred whilst processing the image.");
return ot;
}, pt = r.__addimage__.convertBase64ToBinaryString = function(P, k) {
k = typeof k != "boolean" || k;
var W, D = "";
if (typeof P == "string") {
var ot;
W = (ot = st(P)) !== null && ot !== void 0 ? ot : P;
try {
D = ha(W);
} catch (it) {
if (k) throw Y(W) ? new Error("atob-Error in jsPDF.convertBase64ToBinaryString " + it.message) : new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ");
}
}
return D;
};
r.getImageProperties = function(P) {
var k, W, D = "";
if (w(P) && (P = S(P)), typeof P == "string" && a(P) === e && ((D = pt(P, !1)) === "" && (D = r.loadFile(P) || ""), P = D), W = a(P), !y(W)) throw new Error("addImage does not support files of type '" + W + "', please ensure that a plugin for '" + W + "' support is added.");
if (!ct() || P instanceof Uint8Array || (P = tt(P)), !(k = this["process" + W.toUpperCase()](P))) throw new Error("An unknown error occurred whilst processing the image");
return k.fileType = W, k;
};
})(Ut.API), /**
* @license
* Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(r) {
var e = function(n) {
if (n !== void 0 && n != "") return !0;
};
Ut.API.events.push(["addPage", function(n) {
this.internal.getPageInfo(n.pageNumber).pageContext.annotations = [];
}]), r.events.push(["putPage", function(n) {
for (var a, u, s, c = this.internal.getCoordinateString, f = this.internal.getVerticalCoordinateString, h = this.internal.getPageInfoByObjId(n.objId), g = n.pageContext.annotations, y = !1, w = 0; w < g.length && !y; w++) switch ((a = g[w]).type) {
case "link":
(e(a.options.url) || e(a.options.pageNumber)) && (y = !0);
break;
case "reference":
case "text":
case "freetext":
y = !0;
}
if (y != 0) {
this.internal.write("/Annots [");
for (var S = 0; S < g.length; S++) {
a = g[S];
var p = this.internal.pdfEscape, O = this.internal.getEncryptor(n.objId);
switch (a.type) {
case "reference":
this.internal.write(" " + a.object.objId + " 0 R ");
break;
case "text":
var F = this.internal.newAdditionalObject(), q = this.internal.newAdditionalObject(), _ = this.internal.getEncryptor(F.objId), M = a.title || "Note";
s = "<</Type /Annot /Subtype /Text " + (u = "/Rect [" + c(a.bounds.x) + " " + f(a.bounds.y + a.bounds.h) + " " + c(a.bounds.x + a.bounds.w) + " " + f(a.bounds.y) + "] ") + "/Contents (" + p(_(a.contents)) + ")", s += " /Popup " + q.objId + " 0 R", s += " /P " + h.objId + " 0 R", s += " /T (" + p(_(M)) + ") >>", F.content = s;
var Y = F.objId + " 0 R";
s = "<</Type /Annot /Subtype /Popup " + (u = "/Rect [" + c(a.bounds.x + 30) + " " + f(a.bounds.y + a.bounds.h) + " " + c(a.bounds.x + a.bounds.w + 30) + " " + f(a.bounds.y) + "] ") + " /Parent " + Y, a.open && (s += " /Open true"), s += " >>", q.content = s, this.internal.write(F.objId, "0 R", q.objId, "0 R");
break;
case "freetext":
u = "/Rect [" + c(a.bounds.x) + " " + f(a.bounds.y) + " " + c(a.bounds.x + a.bounds.w) + " " + f(a.bounds.y + a.bounds.h) + "] ";
var st = a.color || "#000000";
s = "<</Type /Annot /Subtype /FreeText " + u + "/Contents (" + p(O(a.contents)) + ")", s += " /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#" + st + ")", s += " /Border [0 0 0]", s += " >>", this.internal.write(s);
break;
case "link":
if (a.options.name) {
var ct = this.annotations._nameMap[a.options.name];
a.options.pageNumber = ct.page, a.options.top = ct.y;
} else a.options.top || (a.options.top = 0);
if (u = "/Rect [" + a.finalBounds.x + " " + a.finalBounds.y + " " + a.finalBounds.w + " " + a.finalBounds.h + "] ", s = "", a.options.url) s = "<</Type /Annot /Subtype /Link " + u + "/Border [0 0 0] /A <</S /URI /URI (" + p(O(a.options.url)) + ") >>";
else if (a.options.pageNumber)
switch (s = "<</Type /Annot /Subtype /Link " + u + "/Border [0 0 0] /Dest [" + this.internal.getPageInfo(a.options.pageNumber).objId + " 0 R", a.options.magFactor = a.options.magFactor || "XYZ", a.options.magFactor) {
case "Fit":
s += " /Fit]";
break;
case "FitH":
s += " /FitH " + a.options.top + "]";
break;
case "FitV":
a.options.left = a.options.left || 0, s += " /FitV " + a.options.left + "]";
break;
case "XYZ":
default:
var wt = f(a.options.top);
a.options.left = a.options.left || 0, a.options.zoom === void 0 && (a.options.zoom = 0), s += " /XYZ " + a.options.left + " " + wt + " " + a.options.zoom + "]";
}
s != "" && (s += " >>", this.internal.write(s));
}
}
this.internal.write("]");
}
}]), r.createAnnotation = function(n) {
var a = this.internal.getCurrentPageInfo();
switch (n.type) {
case "link":
this.link(n.bounds.x, n.bounds.y, n.bounds.w, n.bounds.h, n);
break;
case "text":
case "freetext":
a.pageContext.annotations.push(n);
}
}, r.link = function(n, a, u, s, c) {
var f = this.internal.getCurrentPageInfo(), h = this.internal.getCoordinateString, g = this.internal.getVerticalCoordinateString;
f.pageContext.annotations.push({ finalBounds: { x: h(n), y: g(a), w: h(n + u), h: g(a + s) }, options: c, type: "link" });
}, r.textWithLink = function(n, a, u, s) {
var c, f, h = this.getTextWidth(n), g = this.internal.getLineHeight() / this.internal.scaleFactor;
if (s.maxWidth !== void 0) {
f = s.maxWidth;
var y = this.splitTextToSize(n, f).length;
c = Math.ceil(g * y);
} else f = h, c = g;
return this.text(n, a, u, s), u += 0.2 * g, s.align === "center" && (a -= h / 2), s.align === "right" && (a -= h), this.link(a, u - g, f, c, s), h;
}, r.getTextWidth = function(n) {
var a = this.internal.getFontSize();
return this.getStringUnitWidth(n) * a / this.internal.scaleFactor;
};
}(Ut.API), /**
* @license
* Copyright (c) 2017 Aras Abbasi
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(r) {
var e = { 1569: [65152], 1570: [65153, 65154], 1571: [65155, 65156], 1572: [65157, 65158], 1573: [65159, 65160], 1574: [65161, 65162, 65163, 65164], 1575: [65165, 65166], 1576: [65167, 65168, 65169, 65170], 1577: [65171, 65172], 1578: [65173, 65174, 65175, 65176], 1579: [65177, 65178, 65179, 65180], 1580: [65181, 65182, 65183, 65184], 1581: [65185, 65186, 65187, 65188], 1582: [65189, 65190, 65191, 65192], 1583: [65193, 65194], 1584: [65195, 65196], 1585: [65197, 65198], 1586: [65199, 65200], 1587: [65201, 65202, 65203, 65204], 1588: [65205, 65206, 65207, 65208], 1589: [65209, 65210, 65211, 65212], 1590: [65213, 65214, 65215, 65216], 1591: [65217, 65218, 65219, 65220], 1592: [65221, 65222, 65223, 65224], 1593: [65225, 65226, 65227, 65228], 1594: [65229, 65230, 65231, 65232], 1601: [65233, 65234, 65235, 65236], 1602: [65237, 65238, 65239, 65240], 1603: [65241, 65242, 65243, 65244], 1604: [65245, 65246, 65247, 65248], 1605: [65249, 65250, 65251, 65252], 1606: [65253, 65254, 65255, 65256], 1607: [65257, 65258, 65259, 65260], 1608: [65261, 65262], 1609: [65263, 65264, 64488, 64489], 1610: [65265, 65266, 65267, 65268], 1649: [64336, 64337], 1655: [64477], 1657: [64358, 64359, 64360, 64361], 1658: [64350, 64351, 64352, 64353], 1659: [64338, 64339, 64340, 64341], 1662: [64342, 64343, 64344, 64345], 1663: [64354, 64355, 64356, 64357], 1664: [64346, 64347, 64348, 64349], 1667: [64374, 64375, 64376, 64377], 1668: [64370, 64371, 64372, 64373], 1670: [64378, 64379, 64380, 64381], 1671: [64382, 64383, 64384, 64385], 1672: [64392, 64393], 1676: [64388, 64389], 1677: [64386, 64387], 1678: [64390, 64391], 1681: [64396, 64397], 1688: [64394, 64395], 1700: [64362, 64363, 64364, 64365], 1702: [64366, 64367, 64368, 64369], 1705: [64398, 64399, 64400, 64401], 1709: [64467, 64468, 64469, 64470], 1711: [64402, 64403, 64404, 64405], 1713: [64410, 64411, 64412, 64413], 1715: [64406, 64407, 64408, 64409], 1722: [64414, 64415], 1723: [64416, 64417, 64418, 64419], 1726: [64426, 64427, 64428, 64429], 1728: [64420, 64421], 1729: [64422, 64423, 64424, 64425], 1733: [64480, 64481], 1734: [64473, 64474], 1735: [64471, 64472], 1736: [64475, 64476], 1737: [64482, 64483], 1739: [64478, 64479], 1740: [64508, 64509, 64510, 64511], 1744: [64484, 64485, 64486, 64487], 1746: [64430, 64431], 1747: [64432, 64433] }, n = { 65247: { 65154: 65269, 65156: 65271, 65160: 65273, 65166: 65275 }, 65248: { 65154: 65270, 65156: 65272, 65160: 65274, 65166: 65276 }, 65165: { 65247: { 65248: { 65258: 65010 } } }, 1617: { 1612: 64606, 1613: 64607, 1614: 64608, 1615: 64609, 1616: 64610 } }, a = { 1612: 64606, 1613: 64607, 1614: 64608, 1615: 64609, 1616: 64610 }, u = [1570, 1571, 1573, 1575];
r.__arabicParser__ = {};
var s = r.__arabicParser__.isInArabicSubstitutionA = function(F) {
return e[F.charCodeAt(0)] !== void 0;
}, c = r.__arabicParser__.isArabicLetter = function(F) {
return typeof F == "string" && /^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(F);
}, f = r.__arabicParser__.isArabicEndLetter = function(F) {
return c(F) && s(F) && e[F.charCodeAt(0)].length <= 2;
}, h = r.__arabicParser__.isArabicAlfLetter = function(F) {
return c(F) && u.indexOf(F.charCodeAt(0)) >= 0;
};
r.__arabicParser__.arabicLetterHasIsolatedForm = function(F) {
return c(F) && s(F) && e[F.charCodeAt(0)].length >= 1;
};
var g = r.__arabicParser__.arabicLetterHasFinalForm = function(F) {
return c(F) && s(F) && e[F.charCodeAt(0)].length >= 2;
};
r.__arabicParser__.arabicLetterHasInitialForm = function(F) {
return c(F) && s(F) && e[F.charCodeAt(0)].length >= 3;
};
var y = r.__arabicParser__.arabicLetterHasMedialForm = function(F) {
return c(F) && s(F) && e[F.charCodeAt(0)].length == 4;
}, w = r.__arabicParser__.resolveLigatures = function(F) {
var q = 0, _ = n, M = "", Y = 0;
for (q = 0; q < F.length; q += 1) _[F.charCodeAt(q)] !== void 0 ? (Y++, typeof (_ = _[F.charCodeAt(q)]) == "number" && (M += String.fromCharCode(_), _ = n, Y = 0), q === F.length - 1 && (_ = n, M += F.charAt(q - (Y - 1)), q -= Y - 1, Y = 0)) : (_ = n, M += F.charAt(q - Y), q -= Y, Y = 0);
return M;
};
r.__arabicParser__.isArabicDiacritic = function(F) {
return F !== void 0 && a[F.charCodeAt(0)] !== void 0;
};
var S = r.__arabicParser__.getCorrectForm = function(F, q, _) {
return c(F) ? s(F) === !1 ? -1 : !g(F) || !c(q) && !c(_) || !c(_) && f(q) || f(F) && !c(q) || f(F) && h(q) || f(F) && f(q) ? 0 : y(F) && c(q) && !f(q) && c(_) && g(_) ? 3 : f(F) || !c(_) ? 1 : 2 : -1;
}, p = function(F) {
var q = 0, _ = 0, M = 0, Y = "", st = "", ct = "", wt = (F = F || "").split("\\s+"), tt = [];
for (q = 0; q < wt.length; q += 1) {
for (tt.push(""), _ = 0; _ < wt[q].length; _ += 1) Y = wt[q][_], st = wt[q][_ - 1], ct = wt[q][_ + 1], c(Y) ? (M = S(Y, st, ct), tt[q] += M !== -1 ? String.fromCharCode(e[Y.charCodeAt(0)][M]) : Y) : tt[q] += Y;
tt[q] = w(tt[q]);
}
return tt.join(" ");
}, O = r.__arabicParser__.processArabic = r.processArabic = function() {
var F, q = typeof arguments[0] == "string" ? arguments[0] : arguments[0].text, _ = [];
if (Array.isArray(q)) {
var M = 0;
for (_ = [], M = 0; M < q.length; M += 1) Array.isArray(q[M]) ? _.push([p(q[M][0]), q[M][1], q[M][2]]) : _.push([p(q[M])]);
F = _;
} else F = p(q);
return typeof arguments[0] == "string" ? F : (arguments[0].text = F, arguments[0]);
};
r.events.push(["preProcessText", O]);
}(Ut.API), Ut.API.autoPrint = function(r) {
var e;
switch ((r = r || {}).variant = r.variant || "non-conform", r.variant) {
case "javascript":
this.addJS("print({});");
break;
case "non-conform":
default:
this.internal.events.subscribe("postPutResources", function() {
e = this.internal.newObject(), this.internal.out("<<"), this.internal.out("/S /Named"), this.internal.out("/Type /Action"), this.internal.out("/N /Print"), this.internal.out(">>"), this.internal.out("endobj");
}), this.internal.events.subscribe("putCatalog", function() {
this.internal.out("/OpenAction " + e + " 0 R");
});
}
return this;
}, /**
* @license
* Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(r) {
var e = function() {
var n = void 0;
Object.defineProperty(this, "pdf", { get: function() {
return n;
}, set: function(f) {
n = f;
} });
var a = 150;
Object.defineProperty(this, "width", { get: function() {
return a;
}, set: function(f) {
a = isNaN(f) || Number.isInteger(f) === !1 || f < 0 ? 150 : f, this.getContext("2d").pageWrapXEnabled && (this.getContext("2d").pageWrapX = a + 1);
} });
var u = 300;
Object.defineProperty(this, "height", { get: function() {
return u;
}, set: function(f) {
u = isNaN(f) || Number.isInteger(f) === !1 || f < 0 ? 300 : f, this.getContext("2d").pageWrapYEnabled && (this.getContext("2d").pageWrapY = u + 1);
} });
var s = [];
Object.defineProperty(this, "childNodes", { get: function() {
return s;
}, set: function(f) {
s = f;
} });
var c = {};
Object.defineProperty(this, "style", { get: function() {
return c;
}, set: function(f) {
c = f;
} }), Object.defineProperty(this, "parentNode", {});
};
e.prototype.getContext = function(n, a) {
var u;
if ((n = n || "2d") !== "2d") return null;
for (u in a) this.pdf.context2d.hasOwnProperty(u) && (this.pdf.context2d[u] = a[u]);
return this.pdf.context2d._canvas = this, this.pdf.context2d;
}, e.prototype.toDataURL = function() {
throw new Error("toDataURL is not implemented.");
}, r.events.push(["initialized", function() {
this.canvas = new e(), this.canvas.pdf = this;
}]);
}(Ut.API), function(r) {
var e = { left: 0, top: 0, bottom: 0, right: 0 }, n = !1, a = function() {
this.internal.__cell__ === void 0 && (this.internal.__cell__ = {}, this.internal.__cell__.padding = 3, this.internal.__cell__.headerFunction = void 0, this.internal.__cell__.margins = Object.assign({}, e), this.internal.__cell__.margins.width = this.getPageWidth(), u.call(this));
}, u = function() {
this.internal.__cell__.lastCell = new s(), this.internal.__cell__.pages = 1;
}, s = function() {
var h = arguments[0];
Object.defineProperty(this, "x", { enumerable: !0, get: function() {
return h;
}, set: function(F) {
h = F;
} });
var g = arguments[1];
Object.defineProperty(this, "y", { enumerable: !0, get: function() {
return g;
}, set: function(F) {
g = F;
} });
var y = arguments[2];
Object.defineProperty(this, "width", { enumerable: !0, get: function() {
return y;
}, set: function(F) {
y = F;
} });
var w = arguments[3];
Object.defineProperty(this, "height", { enumerable: !0, get: function() {
return w;
}, set: function(F) {
w = F;
} });
var S = arguments[4];
Object.defineProperty(this, "text", { enumerable: !0, get: function() {
return S;
}, set: function(F) {
S = F;
} });
var p = arguments[5];
Object.defineProperty(this, "lineNumber", { enumerable: !0, get: function() {
return p;
}, set: function(F) {
p = F;
} });
var O = arguments[6];
return Object.defineProperty(this, "align", { enumerable: !0, get: function() {
return O;
}, set: function(F) {
O = F;
} }), this;
};
s.prototype.clone = function() {
return new s(this.x, this.y, this.width, this.height, this.text, this.lineNumber, this.align);
}, s.prototype.toArray = function() {
return [this.x, this.y, this.width, this.height, this.text, this.lineNumber, this.align];
}, r.setHeaderFunction = function(h) {
return a.call(this), this.internal.__cell__.headerFunction = typeof h == "function" ? h : void 0, this;
}, r.getTextDimensions = function(h, g) {
a.call(this);
var y = (g = g || {}).fontSize || this.getFontSize(), w = g.font || this.getFont(), S = g.scaleFactor || this.internal.scaleFactor, p = 0, O = 0, F = 0, q = this;
if (!Array.isArray(h) && typeof h != "string") {
if (typeof h != "number") throw new Error("getTextDimensions expects text-parameter to be of type String or type Number or an Array of Strings.");
h = String(h);
}
var _ = g.maxWidth;
_ > 0 ? typeof h == "string" ? h = this.splitTextToSize(h, _) : Object.prototype.toString.call(h) === "[object Array]" && (h = h.reduce(function(Y, st) {
return Y.concat(q.splitTextToSize(st, _));
}, [])) : h = Array.isArray(h) ? h : [h];
for (var M = 0; M < h.length; M++) p < (F = this.getStringUnitWidth(h[M], { font: w }) * y) && (p = F);
return p !== 0 && (O = h.length), { w: p /= S, h: Math.max((O * y * this.getLineHeightFactor() - y * (this.getLineHeightFactor() - 1)) / S, 0) };
}, r.cellAddPage = function() {
a.call(this), this.addPage();
var h = this.internal.__cell__.margins || e;
return this.internal.__cell__.lastCell = new s(h.left, h.top, void 0, void 0), this.internal.__cell__.pages += 1, this;
};
var c = r.cell = function() {
var h;
h = arguments[0] instanceof s ? arguments[0] : new s(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5]), a.call(this);
var g = this.internal.__cell__.lastCell, y = this.internal.__cell__.padding, w = this.internal.__cell__.margins || e, S = this.internal.__cell__.tableHeaderRow, p = this.internal.__cell__.printHeaders;
return g.lineNumber !== void 0 && (g.lineNumber === h.lineNumber ? (h.x = (g.x || 0) + (g.width || 0), h.y = g.y || 0) : g.y + g.height + h.height + w.bottom > this.getPageHeight() ? (this.cellAddPage(), h.y = w.top, p && S && (this.printHeaderRow(h.lineNumber, !0), h.y += S[0].height)) : h.y = g.y + g.height || h.y), h.text[0] !== void 0 && (this.rect(h.x, h.y, h.width, h.height, n === !0 ? "FD" : void 0), h.align === "right" ? this.text(h.text, h.x + h.width - y, h.y + y, { align: "right", baseline: "top" }) : h.align === "center" ? this.text(h.text, h.x + h.width / 2, h.y + y, { align: "center", baseline: "top", maxWidth: h.width - y - y }) : this.text(h.text, h.x + y, h.y + y, { align: "left", baseline: "top", maxWidth: h.width - y - y })), this.internal.__cell__.lastCell = h, this;
};
r.table = function(h, g, y, w, S) {
if (a.call(this), !y) throw new Error("No data for PDF table.");
var p, O, F, q, _ = [], M = [], Y = [], st = {}, ct = {}, wt = [], tt = [], z = (S = S || {}).autoSize || !1, rt = S.printHeaders !== !1, pt = S.css && S.css["font-size"] !== void 0 ? 16 * S.css["font-size"] : S.fontSize || 12, P = S.margins || Object.assign({ width: this.getPageWidth() }, e), k = typeof S.padding == "number" ? S.padding : 3, W = S.headerBackgroundColor || "#c8c8c8", D = S.headerTextColor || "#000";
if (u.call(this), this.internal.__cell__.printHeaders = rt, this.internal.__cell__.margins = P, this.internal.__cell__.table_font_size = pt, this.internal.__cell__.padding = k, this.internal.__cell__.headerBackgroundColor = W, this.internal.__cell__.headerTextColor = D, this.setFontSize(pt), w == null) M = _ = Object.keys(y[0]), Y = _.map(function() {
return "left";
});
else if (Array.isArray(w) && he(w[0]) === "object") for (_ = w.map(function(dt) {
return dt.name;
}), M = w.map(function(dt) {
return dt.prompt || dt.name || "";
}), Y = w.map(function(dt) {
return dt.align || "left";
}), p = 0; p < w.length; p += 1) ct[w[p].name] = w[p].width * (19.049976 / 25.4);
else Array.isArray(w) && typeof w[0] == "string" && (M = _ = w, Y = _.map(function() {
return "left";
}));
if (z || Array.isArray(w) && typeof w[0] == "string") for (p = 0; p < _.length; p += 1) {
for (st[q = _[p]] = y.map(function(dt) {
return dt[q];
}), this.setFont(void 0, "bold"), wt.push(this.getTextDimensions(M[p], { fontSize: this.internal.__cell__.table_font_size, scaleFactor: this.internal.scaleFactor }).w), O = st[q], this.setFont(void 0, "normal"), F = 0; F < O.length; F += 1) wt.push(this.getTextDimensions(O[F], { fontSize: this.internal.__cell__.table_font_size, scaleFactor: this.internal.scaleFactor }).w);
ct[q] = Math.max.apply(null, wt) + k + k, wt = [];
}
if (rt) {
var ot = {};
for (p = 0; p < _.length; p += 1) ot[_[p]] = {}, ot[_[p]].text = M[p], ot[_[p]].align = Y[p];
var it = f.call(this, ot, ct);
tt = _.map(function(dt) {
return new s(h, g, ct[dt], it, ot[dt].text, void 0, ot[dt].align);
}), this.setTableHeaderRow(tt), this.printHeaderRow(1, !1);
}
var ft = w.reduce(function(dt, jt) {
return dt[jt.name] = jt.align, dt;
}, {});
for (p = 0; p < y.length; p += 1) {
"rowStart" in S && S.rowStart instanceof Function && S.rowStart({ row: p, data: y[p] }, this);
var $ = f.call(this, y[p], ct);
for (F = 0; F < _.length; F += 1) {
var lt = y[p][_[F]];
"cellStart" in S && S.cellStart instanceof Function && S.cellStart({ row: p, col: F, data: lt }, this), c.call(this, new s(h, g, ct[_[F]], $, lt, p + 2, ft[_[F]]));
}
}
return this.internal.__cell__.table_x = h, this.internal.__cell__.table_y = g, this;
};
var f = function(h, g) {
var y = this.internal.__cell__.padding, w = this.internal.__cell__.table_font_size, S = this.internal.scaleFactor;
return Object.keys(h).map(function(p) {
var O = h[p];
return this.splitTextToSize(O.hasOwnProperty("text") ? O.text : O, g[p] - y - y);
}, this).map(function(p) {
return this.getLineHeightFactor() * p.length * w / S + y + y;
}, this).reduce(function(p, O) {
return Math.max(p, O);
}, 0);
};
r.setTableHeaderRow = function(h) {
a.call(this), this.internal.__cell__.tableHeaderRow = h;
}, r.printHeaderRow = function(h, g) {
if (a.call(this), !this.internal.__cell__.tableHeaderRow) throw new Error("Property tableHeaderRow does not exist.");
var y;
if (n = !0, typeof this.internal.__cell__.headerFunction == "function") {
var w = this.internal.__cell__.headerFunction(this, this.internal.__cell__.pages);
this.internal.__cell__.lastCell = new s(w[0], w[1], w[2], w[3], void 0, -1);
}
this.setFont(void 0, "bold");
for (var S = [], p = 0; p < this.internal.__cell__.tableHeaderRow.length; p += 1) {
y = this.internal.__cell__.tableHeaderRow[p].clone(), g && (y.y = this.internal.__cell__.margins.top || 0, S.push(y)), y.lineNumber = h;
var O = this.getTextColor();
this.setTextColor(this.internal.__cell__.headerTextColor), this.setFillColor(this.internal.__cell__.headerBackgroundColor), c.call(this, y), this.setTextColor(O);
}
S.length > 0 && this.setTableHeaderRow(S), this.setFont(void 0, "normal"), n = !1;
};
}(Ut.API);
var Du = { italic: ["italic", "oblique", "normal"], oblique: ["oblique", "italic", "normal"], normal: ["normal", "oblique", "italic"] }, Ru = ["ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "normal", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded"], xo = qu(Ru), Tu = [100, 200, 300, 400, 500, 600, 700, 800, 900], ec = qu(Tu);
function So(r) {
var e = r.family.replace(/"|'/g, "").toLowerCase(), n = function(s) {
return Du[s = s || "normal"] ? s : "normal";
}(r.style), a = function(s) {
if (!s) return 400;
if (typeof s == "number") return s >= 100 && s <= 900 && s % 100 == 0 ? s : 400;
if (/^\d00$/.test(s)) return parseInt(s);
switch (s) {
case "bold":
return 700;
case "normal":
default:
return 400;
}
}(r.weight), u = function(s) {
return typeof xo[s = s || "normal"] == "number" ? s : "normal";
}(r.stretch);
return { family: e, style: n, weight: a, stretch: u, src: r.src || [], ref: r.ref || { name: e, style: [u, n, a].join(" ") } };
}
function cu(r, e, n, a) {
var u;
for (u = n; u >= 0 && u < e.length; u += a) if (r[e[u]]) return r[e[u]];
for (u = n; u >= 0 && u < e.length; u -= a) if (r[e[u]]) return r[e[u]];
}
var nc = { "sans-serif": "helvetica", fixed: "courier", monospace: "courier", terminal: "courier", cursive: "times", fantasy: "times", serif: "times" }, fu = { caption: "times", icon: "times", menu: "times", "message-box": "times", "small-caption": "times", "status-bar": "times" };
function hu(r) {
return [r.stretch, r.style, r.weight, r.family].join(" ");
}
function rc(r, e, n) {
for (var a = (n = n || {}).defaultFontFamily || "times", u = Object.assign({}, nc, n.genericFontFamilies || {}), s = null, c = null, f = 0; f < e.length; ++f) if (u[(s = So(e[f])).family] && (s.family = u[s.family]), r.hasOwnProperty(s.family)) {
c = r[s.family];
break;
}
if (!(c = c || r[a])) throw new Error("Could not find a font-family for the rule '" + hu(s) + "' and default family '" + a + "'.");
if (c = function(h, g) {
if (g[h]) return g[h];
var y = xo[h], w = y <= xo.normal ? -1 : 1, S = cu(g, Ru, y, w);
if (!S) throw new Error("Could not find a matching font-stretch value for " + h);
return S;
}(s.stretch, c), c = function(h, g) {
if (g[h]) return g[h];
for (var y = Du[h], w = 0; w < y.length; ++w) if (g[y[w]]) return g[y[w]];
throw new Error("Could not find a matching font-style for " + h);
}(s.style, c), !(c = function(h, g) {
if (g[h]) return g[h];
if (h === 400 && g[500]) return g[500];
if (h === 500 && g[400]) return g[400];
var y = ec[h], w = cu(g, Tu, y, h < 400 ? -1 : 1);
if (!w) throw new Error("Could not find a matching font-weight for value " + h);
return w;
}(s.weight, c))) throw new Error("Failed to resolve a font for the rule '" + hu(s) + "'.");
return c;
}
function du(r) {
return r.trimLeft();
}
function ic(r, e) {
for (var n = 0; n < r.length; ) {
if (r.charAt(n) === e) return [r.substring(0, n), r.substring(n + 1)];
n += 1;
}
return null;
}
function ac(r) {
var e = r.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);
return e === null ? null : [e[0], r.substring(e[0].length)];
}
var ss, pu, gu, ho = ["times"];
(function(r) {
var e, n, a, u, s, c, f, h, g, y = function(N) {
return N = N || {}, this.isStrokeTransparent = N.isStrokeTransparent || !1, this.strokeOpacity = N.strokeOpacity || 1, this.strokeStyle = N.strokeStyle || "#000000", this.fillStyle = N.fillStyle || "#000000", this.isFillTransparent = N.isFillTransparent || !1, this.fillOpacity = N.fillOpacity || 1, this.font = N.font || "10px sans-serif", this.textBaseline = N.textBaseline || "alphabetic", this.textAlign = N.textAlign || "left", this.lineWidth = N.lineWidth || 1, this.lineJoin = N.lineJoin || "miter", this.lineCap = N.lineCap || "butt", this.path = N.path || [], this.transform = N.transform !== void 0 ? N.transform.clone() : new h(), this.globalCompositeOperation = N.globalCompositeOperation || "normal", this.globalAlpha = N.globalAlpha || 1, this.clip_path = N.clip_path || [], this.currentPoint = N.currentPoint || new c(), this.miterLimit = N.miterLimit || 10, this.lastPoint = N.lastPoint || new c(), this.lineDashOffset = N.lineDashOffset || 0, this.lineDash = N.lineDash || [], this.margin = N.margin || [0, 0, 0, 0], this.prevPageLastElemOffset = N.prevPageLastElemOffset || 0, this.ignoreClearRect = typeof N.ignoreClearRect != "boolean" || N.ignoreClearRect, this;
};
r.events.push(["initialized", function() {
this.context2d = new w(this), e = this.internal.f2, n = this.internal.getCoordinateString, a = this.internal.getVerticalCoordinateString, u = this.internal.getHorizontalCoordinate, s = this.internal.getVerticalCoordinate, c = this.internal.Point, f = this.internal.Rectangle, h = this.internal.Matrix, g = new y();
}]);
var w = function(N) {
Object.defineProperty(this, "canvas", { get: function() {
return { parentNode: !1, style: !1 };
} });
var C = N;
Object.defineProperty(this, "pdf", { get: function() {
return C;
} });
var B = !1;
Object.defineProperty(this, "pageWrapXEnabled", { get: function() {
return B;
}, set: function(ht) {
B = !!ht;
} });
var T = !1;
Object.defineProperty(this, "pageWrapYEnabled", { get: function() {
return T;
}, set: function(ht) {
T = !!ht;
} });
var J = 0;
Object.defineProperty(this, "posX", { get: function() {
return J;
}, set: function(ht) {
isNaN(ht) || (J = ht);
} });
var Q = 0;
Object.defineProperty(this, "posY", { get: function() {
return Q;
}, set: function(ht) {
isNaN(ht) || (Q = ht);
} }), Object.defineProperty(this, "margin", { get: function() {
return g.margin;
}, set: function(ht) {
var E;
typeof ht == "number" ? E = [ht, ht, ht, ht] : ((E = new Array(4))[0] = ht[0], E[1] = ht.length >= 2 ? ht[1] : E[0], E[2] = ht.length >= 3 ? ht[2] : E[0], E[3] = ht.length >= 4 ? ht[3] : E[1]), g.margin = E;
} });
var et = !1;
Object.defineProperty(this, "autoPaging", { get: function() {
return et;
}, set: function(ht) {
et = ht;
} });
var nt = 0;
Object.defineProperty(this, "lastBreak", { get: function() {
return nt;
}, set: function(ht) {
nt = ht;
} });
var At = [];
Object.defineProperty(this, "pageBreaks", { get: function() {
return At;
}, set: function(ht) {
At = ht;
} }), Object.defineProperty(this, "ctx", { get: function() {
return g;
}, set: function(ht) {
ht instanceof y && (g = ht);
} }), Object.defineProperty(this, "path", { get: function() {
return g.path;
}, set: function(ht) {
g.path = ht;
} });
var Nt = [];
Object.defineProperty(this, "ctxStack", { get: function() {
return Nt;
}, set: function(ht) {
Nt = ht;
} }), Object.defineProperty(this, "fillStyle", { get: function() {
return this.ctx.fillStyle;
}, set: function(ht) {
var E;
E = S(ht), this.ctx.fillStyle = E.style, this.ctx.isFillTransparent = E.a === 0, this.ctx.fillOpacity = E.a, this.pdf.setFillColor(E.r, E.g, E.b, { a: E.a }), this.pdf.setTextColor(E.r, E.g, E.b, { a: E.a });
} }), Object.defineProperty(this, "strokeStyle", { get: function() {
return this.ctx.strokeStyle;
}, set: function(ht) {
var E = S(ht);
this.ctx.strokeStyle = E.style, this.ctx.isStrokeTransparent = E.a === 0, this.ctx.strokeOpacity = E.a, E.a === 0 ? this.pdf.setDrawColor(255, 255, 255) : (E.a, this.pdf.setDrawColor(E.r, E.g, E.b));
} }), Object.defineProperty(this, "lineCap", { get: function() {
return this.ctx.lineCap;
}, set: function(ht) {
["butt", "round", "square"].indexOf(ht) !== -1 && (this.ctx.lineCap = ht, this.pdf.setLineCap(ht));
} }), Object.defineProperty(this, "lineWidth", { get: function() {
return this.ctx.lineWidth;
}, set: function(ht) {
isNaN(ht) || (this.ctx.lineWidth = ht, this.pdf.setLineWidth(ht));
} }), Object.defineProperty(this, "lineJoin", { get: function() {
return this.ctx.lineJoin;
}, set: function(ht) {
["bevel", "round", "miter"].indexOf(ht) !== -1 && (this.ctx.lineJoin = ht, this.pdf.setLineJoin(ht));
} }), Object.defineProperty(this, "miterLimit", { get: function() {
return this.ctx.miterLimit;
}, set: function(ht) {
isNaN(ht) || (this.ctx.miterLimit = ht, this.pdf.setMiterLimit(ht));
} }), Object.defineProperty(this, "textBaseline", { get: function() {
return this.ctx.textBaseline;
}, set: function(ht) {
this.ctx.textBaseline = ht;
} }), Object.defineProperty(this, "textAlign", { get: function() {
return this.ctx.textAlign;
}, set: function(ht) {
["right", "end", "center", "left", "start"].indexOf(ht) !== -1 && (this.ctx.textAlign = ht);
} });
var Ft = null;
function _t(ht, E) {
if (Ft === null) {
var Kt = function(Et) {
var Lt = [];
return Object.keys(Et).forEach(function(xt) {
Et[xt].forEach(function(It) {
var kt = null;
switch (It) {
case "bold":
kt = { family: xt, weight: "bold" };
break;
case "italic":
kt = { family: xt, style: "italic" };
break;
case "bolditalic":
kt = { family: xt, weight: "bold", style: "italic" };
break;
case "":
case "normal":
kt = { family: xt };
}
kt !== null && (kt.ref = { name: xt, style: It }, Lt.push(kt));
});
}), Lt;
}(ht.getFontList());
Ft = function(Et) {
for (var Lt = {}, xt = 0; xt < Et.length; ++xt) {
var It = So(Et[xt]), kt = It.family, qt = It.stretch, Gt = It.style, Qt = It.weight;
Lt[kt] = Lt[kt] || {}, Lt[kt][qt] = Lt[kt][qt] || {}, Lt[kt][qt][Gt] = Lt[kt][qt][Gt] || {}, Lt[kt][qt][Gt][Qt] = It;
}
return Lt;
}(Kt.concat(E));
}
return Ft;
}
var zt = null;
Object.defineProperty(this, "fontFaces", { get: function() {
return zt;
}, set: function(ht) {
Ft = null, zt = ht;
} }), Object.defineProperty(this, "font", { get: function() {
return this.ctx.font;
}, set: function(ht) {
var E;
if (this.ctx.font = ht, (E = /^\s*(?=(?:(?:[-a-z]+\s*){0,2}(italic|oblique))?)(?=(?:(?:[-a-z]+\s*){0,2}(small-caps))?)(?=(?:(?:[-a-z]+\s*){0,2}(bold(?:er)?|lighter|[1-9]00))?)(?:(?:normal|\1|\2|\3)\s*){0,3}((?:xx?-)?(?:small|large)|medium|smaller|larger|[.\d]+(?:\%|in|[cem]m|ex|p[ctx]))(?:\s*\/\s*(normal|[.\d]+(?:\%|in|[cem]m|ex|p[ctx])))?\s*([-_,\"\'\sa-z]+?)\s*$/i.exec(ht)) !== null) {
var Kt = E[1];
E[2];
var Et = E[3], Lt = E[4];
E[5];
var xt = E[6], It = /^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(Lt)[2];
Lt = Math.floor(It === "px" ? parseFloat(Lt) * this.pdf.internal.scaleFactor : It === "em" ? parseFloat(Lt) * this.pdf.getFontSize() : parseFloat(Lt) * this.pdf.internal.scaleFactor), this.pdf.setFontSize(Lt);
var kt = function(Wt) {
var ee, Ct, Je = [], se = Wt.trim();
if (se === "") return ho;
if (se in fu) return [fu[se]];
for (; se !== ""; ) {
switch (Ct = null, ee = (se = du(se)).charAt(0)) {
case '"':
case "'":
Ct = ic(se.substring(1), ee);
break;
default:
Ct = ac(se);
}
if (Ct === null || (Je.push(Ct[0]), (se = du(Ct[1])) !== "" && se.charAt(0) !== ",")) return ho;
se = se.replace(/^,/, "");
}
return Je;
}(xt);
if (this.fontFaces) {
var qt = rc(_t(this.pdf, this.fontFaces), kt.map(function(Wt) {
return { family: Wt, stretch: "normal", weight: Et, style: Kt };
}));
this.pdf.setFont(qt.ref.name, qt.ref.style);
} else {
var Gt = "";
(Et === "bold" || parseInt(Et, 10) >= 700 || Kt === "bold") && (Gt = "bold"), Kt === "italic" && (Gt += "italic"), Gt.length === 0 && (Gt = "normal");
for (var Qt = "", te = { arial: "Helvetica", Arial: "Helvetica", verdana: "Helvetica", Verdana: "Helvetica", helvetica: "Helvetica", Helvetica: "Helvetica", "sans-serif": "Helvetica", fixed: "Courier", monospace: "Courier", terminal: "Courier", cursive: "Times", fantasy: "Times", serif: "Times" }, ie = 0; ie < kt.length; ie++) {
if (this.pdf.internal.getFont(kt[ie], Gt, { noFallback: !0, disableWarning: !0 }) !== void 0) {
Qt = kt[ie];
break;
}
if (Gt === "bolditalic" && this.pdf.internal.getFont(kt[ie], "bold", { noFallback: !0, disableWarning: !0 }) !== void 0) Qt = kt[ie], Gt = "bold";
else if (this.pdf.internal.getFont(kt[ie], "normal", { noFallback: !0, disableWarning: !0 }) !== void 0) {
Qt = kt[ie], Gt = "normal";
break;
}
}
if (Qt === "") {
for (var de = 0; de < kt.length; de++) if (te[kt[de]]) {
Qt = te[kt[de]];
break;
}
}
Qt = Qt === "" ? "Times" : Qt, this.pdf.setFont(Qt, Gt);
}
}
} }), Object.defineProperty(this, "globalCompositeOperation", { get: function() {
return this.ctx.globalCompositeOperation;
}, set: function(ht) {
this.ctx.globalCompositeOperation = ht;
} }), Object.defineProperty(this, "globalAlpha", { get: function() {
return this.ctx.globalAlpha;
}, set: function(ht) {
this.ctx.globalAlpha = ht;
} }), Object.defineProperty(this, "lineDashOffset", { get: function() {
return this.ctx.lineDashOffset;
}, set: function(ht) {
this.ctx.lineDashOffset = ht, jt.call(this);
} }), Object.defineProperty(this, "lineDash", { get: function() {
return this.ctx.lineDash;
}, set: function(ht) {
this.ctx.lineDash = ht, jt.call(this);
} }), Object.defineProperty(this, "ignoreClearRect", { get: function() {
return this.ctx.ignoreClearRect;
}, set: function(ht) {
this.ctx.ignoreClearRect = !!ht;
} });
};
w.prototype.setLineDash = function(N) {
this.lineDash = N;
}, w.prototype.getLineDash = function() {
return this.lineDash.length % 2 ? this.lineDash.concat(this.lineDash) : this.lineDash.slice();
}, w.prototype.fill = function() {
st.call(this, "fill", !1);
}, w.prototype.stroke = function() {
st.call(this, "stroke", !1);
}, w.prototype.beginPath = function() {
this.path = [{ type: "begin" }];
}, w.prototype.moveTo = function(N, C) {
if (isNaN(N) || isNaN(C)) throw ve.error("jsPDF.context2d.moveTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.moveTo");
var B = this.ctx.transform.applyToPoint(new c(N, C));
this.path.push({ type: "mt", x: B.x, y: B.y }), this.ctx.lastPoint = new c(N, C);
}, w.prototype.closePath = function() {
var N = new c(0, 0), C = 0;
for (C = this.path.length - 1; C !== -1; C--) if (this.path[C].type === "begin" && he(this.path[C + 1]) === "object" && typeof this.path[C + 1].x == "number") {
N = new c(this.path[C + 1].x, this.path[C + 1].y);
break;
}
this.path.push({ type: "close" }), this.ctx.lastPoint = new c(N.x, N.y);
}, w.prototype.lineTo = function(N, C) {
if (isNaN(N) || isNaN(C)) throw ve.error("jsPDF.context2d.lineTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.lineTo");
var B = this.ctx.transform.applyToPoint(new c(N, C));
this.path.push({ type: "lt", x: B.x, y: B.y }), this.ctx.lastPoint = new c(B.x, B.y);
}, w.prototype.clip = function() {
this.ctx.clip_path = JSON.parse(JSON.stringify(this.path)), st.call(this, null, !0);
}, w.prototype.quadraticCurveTo = function(N, C, B, T) {
if (isNaN(B) || isNaN(T) || isNaN(N) || isNaN(C)) throw ve.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");
var J = this.ctx.transform.applyToPoint(new c(B, T)), Q = this.ctx.transform.applyToPoint(new c(N, C));
this.path.push({ type: "qct", x1: Q.x, y1: Q.y, x: J.x, y: J.y }), this.ctx.lastPoint = new c(J.x, J.y);
}, w.prototype.bezierCurveTo = function(N, C, B, T, J, Q) {
if (isNaN(J) || isNaN(Q) || isNaN(N) || isNaN(C) || isNaN(B) || isNaN(T)) throw ve.error("jsPDF.context2d.bezierCurveTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");
var et = this.ctx.transform.applyToPoint(new c(J, Q)), nt = this.ctx.transform.applyToPoint(new c(N, C)), At = this.ctx.transform.applyToPoint(new c(B, T));
this.path.push({ type: "bct", x1: nt.x, y1: nt.y, x2: At.x, y2: At.y, x: et.x, y: et.y }), this.ctx.lastPoint = new c(et.x, et.y);
}, w.prototype.arc = function(N, C, B, T, J, Q) {
if (isNaN(N) || isNaN(C) || isNaN(B) || isNaN(T) || isNaN(J)) throw ve.error("jsPDF.context2d.arc: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.arc");
if (Q = !!Q, !this.ctx.transform.isIdentity) {
var et = this.ctx.transform.applyToPoint(new c(N, C));
N = et.x, C = et.y;
var nt = this.ctx.transform.applyToPoint(new c(0, B)), At = this.ctx.transform.applyToPoint(new c(0, 0));
B = Math.sqrt(Math.pow(nt.x - At.x, 2) + Math.pow(nt.y - At.y, 2));
}
Math.abs(J - T) >= 2 * Math.PI && (T = 0, J = 2 * Math.PI), this.path.push({ type: "arc", x: N, y: C, radius: B, startAngle: T, endAngle: J, counterclockwise: Q });
}, w.prototype.arcTo = function(N, C, B, T, J) {
throw new Error("arcTo not implemented.");
}, w.prototype.rect = function(N, C, B, T) {
if (isNaN(N) || isNaN(C) || isNaN(B) || isNaN(T)) throw ve.error("jsPDF.context2d.rect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.rect");
this.moveTo(N, C), this.lineTo(N + B, C), this.lineTo(N + B, C + T), this.lineTo(N, C + T), this.lineTo(N, C), this.lineTo(N + B, C), this.lineTo(N, C);
}, w.prototype.fillRect = function(N, C, B, T) {
if (isNaN(N) || isNaN(C) || isNaN(B) || isNaN(T)) throw ve.error("jsPDF.context2d.fillRect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.fillRect");
if (!p.call(this)) {
var J = {};
this.lineCap !== "butt" && (J.lineCap = this.lineCap, this.lineCap = "butt"), this.lineJoin !== "miter" && (J.lineJoin = this.lineJoin, this.lineJoin = "miter"), this.beginPath(), this.rect(N, C, B, T), this.fill(), J.hasOwnProperty("lineCap") && (this.lineCap = J.lineCap), J.hasOwnProperty("lineJoin") && (this.lineJoin = J.lineJoin);
}
}, w.prototype.strokeRect = function(N, C, B, T) {
if (isNaN(N) || isNaN(C) || isNaN(B) || isNaN(T)) throw ve.error("jsPDF.context2d.strokeRect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");
O.call(this) || (this.beginPath(), this.rect(N, C, B, T), this.stroke());
}, w.prototype.clearRect = function(N, C, B, T) {
if (isNaN(N) || isNaN(C) || isNaN(B) || isNaN(T)) throw ve.error("jsPDF.context2d.clearRect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.clearRect");
this.ignoreClearRect || (this.fillStyle = "#ffffff", this.fillRect(N, C, B, T));
}, w.prototype.save = function(N) {
N = typeof N != "boolean" || N;
for (var C = this.pdf.internal.getCurrentPageInfo().pageNumber, B = 0; B < this.pdf.internal.getNumberOfPages(); B++) this.pdf.setPage(B + 1), this.pdf.internal.out("q");
if (this.pdf.setPage(C), N) {
this.ctx.fontSize = this.pdf.internal.getFontSize();
var T = new y(this.ctx);
this.ctxStack.push(this.ctx), this.ctx = T;
}
}, w.prototype.restore = function(N) {
N = typeof N != "boolean" || N;
for (var C = this.pdf.internal.getCurrentPageInfo().pageNumber, B = 0; B < this.pdf.internal.getNumberOfPages(); B++) this.pdf.setPage(B + 1), this.pdf.internal.out("Q");
this.pdf.setPage(C), N && this.ctxStack.length !== 0 && (this.ctx = this.ctxStack.pop(), this.fillStyle = this.ctx.fillStyle, this.strokeStyle = this.ctx.strokeStyle, this.font = this.ctx.font, this.lineCap = this.ctx.lineCap, this.lineWidth = this.ctx.lineWidth, this.lineJoin = this.ctx.lineJoin, this.lineDash = this.ctx.lineDash, this.lineDashOffset = this.ctx.lineDashOffset);
}, w.prototype.toDataURL = function() {
throw new Error("toDataUrl not implemented.");
};
var S = function(N) {
var C, B, T, J;
if (N.isCanvasGradient === !0 && (N = N.getColor()), !N) return { r: 0, g: 0, b: 0, a: 0, style: N };
if (/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(N)) C = 0, B = 0, T = 0, J = 0;
else {
var Q = /rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(N);
if (Q !== null) C = parseInt(Q[1]), B = parseInt(Q[2]), T = parseInt(Q[3]), J = 1;
else if ((Q = /rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(N)) !== null) C = parseInt(Q[1]), B = parseInt(Q[2]), T = parseInt(Q[3]), J = parseFloat(Q[4]);
else {
if (J = 1, typeof N == "string" && N.charAt(0) !== "#") {
var et = new Cu(N);
N = et.ok ? et.toHex() : "#000000";
}
N.length === 4 ? (C = N.substring(1, 2), C += C, B = N.substring(2, 3), B += B, T = N.substring(3, 4), T += T) : (C = N.substring(1, 3), B = N.substring(3, 5), T = N.substring(5, 7)), C = parseInt(C, 16), B = parseInt(B, 16), T = parseInt(T, 16);
}
}
return { r: C, g: B, b: T, a: J, style: N };
}, p = function() {
return this.ctx.isFillTransparent || this.globalAlpha == 0;
}, O = function() {
return !!(this.ctx.isStrokeTransparent || this.globalAlpha == 0);
};
w.prototype.fillText = function(N, C, B, T) {
if (isNaN(C) || isNaN(B) || typeof N != "string") throw ve.error("jsPDF.context2d.fillText: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.fillText");
if (T = isNaN(T) ? void 0 : T, !p.call(this)) {
var J = $(this.ctx.transform.rotation), Q = this.ctx.transform.scaleX;
k.call(this, { text: N, x: C, y: B, scale: Q, angle: J, align: this.textAlign, maxWidth: T });
}
}, w.prototype.strokeText = function(N, C, B, T) {
if (isNaN(C) || isNaN(B) || typeof N != "string") throw ve.error("jsPDF.context2d.strokeText: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.strokeText");
if (!O.call(this)) {
T = isNaN(T) ? void 0 : T;
var J = $(this.ctx.transform.rotation), Q = this.ctx.transform.scaleX;
k.call(this, { text: N, x: C, y: B, scale: Q, renderingMode: "stroke", angle: J, align: this.textAlign, maxWidth: T });
}
}, w.prototype.measureText = function(N) {
if (typeof N != "string") throw ve.error("jsPDF.context2d.measureText: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.measureText");
var C = this.pdf, B = this.pdf.internal.scaleFactor, T = C.internal.getFontSize(), J = C.getStringUnitWidth(N) * T / C.internal.scaleFactor, Q = function(et) {
var nt = (et = et || {}).width || 0;
return Object.defineProperty(this, "width", { get: function() {
return nt;
} }), this;
};
return new Q({ width: J *= Math.round(96 * B / 72 * 1e4) / 1e4 });
}, w.prototype.scale = function(N, C) {
if (isNaN(N) || isNaN(C)) throw ve.error("jsPDF.context2d.scale: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.scale");
var B = new h(N, 0, 0, C, 0, 0);
this.ctx.transform = this.ctx.transform.multiply(B);
}, w.prototype.rotate = function(N) {
if (isNaN(N)) throw ve.error("jsPDF.context2d.rotate: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.rotate");
var C = new h(Math.cos(N), Math.sin(N), -Math.sin(N), Math.cos(N), 0, 0);
this.ctx.transform = this.ctx.transform.multiply(C);
}, w.prototype.translate = function(N, C) {
if (isNaN(N) || isNaN(C)) throw ve.error("jsPDF.context2d.translate: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.translate");
var B = new h(1, 0, 0, 1, N, C);
this.ctx.transform = this.ctx.transform.multiply(B);
}, w.prototype.transform = function(N, C, B, T, J, Q) {
if (isNaN(N) || isNaN(C) || isNaN(B) || isNaN(T) || isNaN(J) || isNaN(Q)) throw ve.error("jsPDF.context2d.transform: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.transform");
var et = new h(N, C, B, T, J, Q);
this.ctx.transform = this.ctx.transform.multiply(et);
}, w.prototype.setTransform = function(N, C, B, T, J, Q) {
N = isNaN(N) ? 1 : N, C = isNaN(C) ? 0 : C, B = isNaN(B) ? 0 : B, T = isNaN(T) ? 1 : T, J = isNaN(J) ? 0 : J, Q = isNaN(Q) ? 0 : Q, this.ctx.transform = new h(N, C, B, T, J, Q);
};
var F = function() {
return this.margin[0] > 0 || this.margin[1] > 0 || this.margin[2] > 0 || this.margin[3] > 0;
};
w.prototype.drawImage = function(N, C, B, T, J, Q, et, nt, At) {
var Nt = this.pdf.getImageProperties(N), Ft = 1, _t = 1, zt = 1, ht = 1;
T !== void 0 && nt !== void 0 && (zt = nt / T, ht = At / J, Ft = Nt.width / T * nt / T, _t = Nt.height / J * At / J), Q === void 0 && (Q = C, et = B, C = 0, B = 0), T !== void 0 && nt === void 0 && (nt = T, At = J), T === void 0 && nt === void 0 && (nt = Nt.width, At = Nt.height);
for (var E, Kt = this.ctx.transform.decompose(), Et = $(Kt.rotate.shx), Lt = new h(), xt = (Lt = (Lt = (Lt = Lt.multiply(Kt.translate)).multiply(Kt.skew)).multiply(Kt.scale)).applyToRectangle(new f(Q - C * zt, et - B * ht, T * Ft, J * _t)), It = q.call(this, xt), kt = [], qt = 0; qt < It.length; qt += 1) kt.indexOf(It[qt]) === -1 && kt.push(It[qt]);
if (Y(kt), this.autoPaging) for (var Gt = kt[0], Qt = kt[kt.length - 1], te = Gt; te < Qt + 1; te++) {
this.pdf.setPage(te);
var ie = this.pdf.internal.pageSize.width - this.margin[3] - this.margin[1], de = te === 1 ? this.posY + this.margin[0] : this.margin[0], Wt = this.pdf.internal.pageSize.height - this.posY - this.margin[0] - this.margin[2], ee = this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2], Ct = te === 1 ? 0 : Wt + (te - 2) * ee;
if (this.ctx.clip_path.length !== 0) {
var Je = this.path;
E = JSON.parse(JSON.stringify(this.ctx.clip_path)), this.path = M(E, this.posX + this.margin[3], -Ct + de + this.ctx.prevPageLastElemOffset), ct.call(this, "fill", !0), this.path = Je;
}
var se = JSON.parse(JSON.stringify(xt));
se = M([se], this.posX + this.margin[3], -Ct + de + this.ctx.prevPageLastElemOffset)[0];
var _n = (te > Gt || te < Qt) && F.call(this);
_n && (this.pdf.saveGraphicsState(), this.pdf.rect(this.margin[3], this.margin[0], ie, ee, null).clip().discardPath()), this.pdf.addImage(N, "JPEG", se.x, se.y, se.w, se.h, null, null, Et), _n && this.pdf.restoreGraphicsState();
}
else this.pdf.addImage(N, "JPEG", xt.x, xt.y, xt.w, xt.h, null, null, Et);
};
var q = function(N, C, B) {
var T = [];
C = C || this.pdf.internal.pageSize.width, B = B || this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2];
var J = this.posY + this.ctx.prevPageLastElemOffset;
switch (N.type) {
default:
case "mt":
case "lt":
T.push(Math.floor((N.y + J) / B) + 1);
break;
case "arc":
T.push(Math.floor((N.y + J - N.radius) / B) + 1), T.push(Math.floor((N.y + J + N.radius) / B) + 1);
break;
case "qct":
var Q = lt(this.ctx.lastPoint.x, this.ctx.lastPoint.y, N.x1, N.y1, N.x, N.y);
T.push(Math.floor((Q.y + J) / B) + 1), T.push(Math.floor((Q.y + Q.h + J) / B) + 1);
break;
case "bct":
var et = dt(this.ctx.lastPoint.x, this.ctx.lastPoint.y, N.x1, N.y1, N.x2, N.y2, N.x, N.y);
T.push(Math.floor((et.y + J) / B) + 1), T.push(Math.floor((et.y + et.h + J) / B) + 1);
break;
case "rect":
T.push(Math.floor((N.y + J) / B) + 1), T.push(Math.floor((N.y + N.h + J) / B) + 1);
}
for (var nt = 0; nt < T.length; nt += 1) for (; this.pdf.internal.getNumberOfPages() < T[nt]; ) _.call(this);
return T;
}, _ = function() {
var N = this.fillStyle, C = this.strokeStyle, B = this.font, T = this.lineCap, J = this.lineWidth, Q = this.lineJoin;
this.pdf.addPage(), this.fillStyle = N, this.strokeStyle = C, this.font = B, this.lineCap = T, this.lineWidth = J, this.lineJoin = Q;
}, M = function(N, C, B) {
for (var T = 0; T < N.length; T++) switch (N[T].type) {
case "bct":
N[T].x2 += C, N[T].y2 += B;
case "qct":
N[T].x1 += C, N[T].y1 += B;
case "mt":
case "lt":
case "arc":
default:
N[T].x += C, N[T].y += B;
}
return N;
}, Y = function(N) {
return N.sort(function(C, B) {
return C - B;
});
}, st = function(N, C) {
for (var B, T, J = this.fillStyle, Q = this.strokeStyle, et = this.lineCap, nt = this.lineWidth, At = Math.abs(nt * this.ctx.transform.scaleX), Nt = this.lineJoin, Ft = JSON.parse(JSON.stringify(this.path)), _t = JSON.parse(JSON.stringify(this.path)), zt = [], ht = 0; ht < _t.length; ht++) if (_t[ht].x !== void 0) for (var E = q.call(this, _t[ht]), Kt = 0; Kt < E.length; Kt += 1) zt.indexOf(E[Kt]) === -1 && zt.push(E[Kt]);
for (var Et = 0; Et < zt.length; Et++) for (; this.pdf.internal.getNumberOfPages() < zt[Et]; ) _.call(this);
if (Y(zt), this.autoPaging) for (var Lt = zt[0], xt = zt[zt.length - 1], It = Lt; It < xt + 1; It++) {
this.pdf.setPage(It), this.fillStyle = J, this.strokeStyle = Q, this.lineCap = et, this.lineWidth = At, this.lineJoin = Nt;
var kt = this.pdf.internal.pageSize.width - this.margin[3] - this.margin[1], qt = It === 1 ? this.posY + this.margin[0] : this.margin[0], Gt = this.pdf.internal.pageSize.height - this.posY - this.margin[0] - this.margin[2], Qt = this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2], te = It === 1 ? 0 : Gt + (It - 2) * Qt;
if (this.ctx.clip_path.length !== 0) {
var ie = this.path;
B = JSON.parse(JSON.stringify(this.ctx.clip_path)), this.path = M(B, this.posX + this.margin[3], -te + qt + this.ctx.prevPageLastElemOffset), ct.call(this, N, !0), this.path = ie;
}
if (T = JSON.parse(JSON.stringify(Ft)), this.path = M(T, this.posX + this.margin[3], -te + qt + this.ctx.prevPageLastElemOffset), C === !1 || It === 0) {
var de = (It > Lt || It < xt) && F.call(this);
de && (this.pdf.saveGraphicsState(), this.pdf.rect(this.margin[3], this.margin[0], kt, Qt, null).clip().discardPath()), ct.call(this, N, C), de && this.pdf.restoreGraphicsState();
}
this.lineWidth = nt;
}
else this.lineWidth = At, ct.call(this, N, C), this.lineWidth = nt;
this.path = Ft;
}, ct = function(N, C) {
if ((N !== "stroke" || C || !O.call(this)) && (N === "stroke" || C || !p.call(this))) {
for (var B, T, J = [], Q = this.path, et = 0; et < Q.length; et++) {
var nt = Q[et];
switch (nt.type) {
case "begin":
J.push({ begin: !0 });
break;
case "close":
J.push({ close: !0 });
break;
case "mt":
J.push({ start: nt, deltas: [], abs: [] });
break;
case "lt":
var At = J.length;
if (Q[et - 1] && !isNaN(Q[et - 1].x) && (B = [nt.x - Q[et - 1].x, nt.y - Q[et - 1].y], At > 0)) {
for (; At >= 0; At--) if (J[At - 1].close !== !0 && J[At - 1].begin !== !0) {
J[At - 1].deltas.push(B), J[At - 1].abs.push(nt);
break;
}
}
break;
case "bct":
B = [nt.x1 - Q[et - 1].x, nt.y1 - Q[et - 1].y, nt.x2 - Q[et - 1].x, nt.y2 - Q[et - 1].y, nt.x - Q[et - 1].x, nt.y - Q[et - 1].y], J[J.length - 1].deltas.push(B);
break;
case "qct":
var Nt = Q[et - 1].x + 2 / 3 * (nt.x1 - Q[et - 1].x), Ft = Q[et - 1].y + 2 / 3 * (nt.y1 - Q[et - 1].y), _t = nt.x + 2 / 3 * (nt.x1 - nt.x), zt = nt.y + 2 / 3 * (nt.y1 - nt.y), ht = nt.x, E = nt.y;
B = [Nt - Q[et - 1].x, Ft - Q[et - 1].y, _t - Q[et - 1].x, zt - Q[et - 1].y, ht - Q[et - 1].x, E - Q[et - 1].y], J[J.length - 1].deltas.push(B);
break;
case "arc":
J.push({ deltas: [], abs: [], arc: !0 }), Array.isArray(J[J.length - 1].abs) && J[J.length - 1].abs.push(nt);
}
}
T = C ? null : N === "stroke" ? "stroke" : "fill";
for (var Kt = !1, Et = 0; Et < J.length; Et++) if (J[Et].arc) for (var Lt = J[Et].abs, xt = 0; xt < Lt.length; xt++) {
var It = Lt[xt];
It.type === "arc" ? z.call(this, It.x, It.y, It.radius, It.startAngle, It.endAngle, It.counterclockwise, void 0, C, !Kt) : W.call(this, It.x, It.y), Kt = !0;
}
else if (J[Et].close === !0) this.pdf.internal.out("h"), Kt = !1;
else if (J[Et].begin !== !0) {
var kt = J[Et].start.x, qt = J[Et].start.y;
D.call(this, J[Et].deltas, kt, qt), Kt = !0;
}
T && rt.call(this, T), C && pt.call(this);
}
}, wt = function(N) {
var C = this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor, B = C * (this.pdf.internal.getLineHeightFactor() - 1);
switch (this.ctx.textBaseline) {
case "bottom":
return N - B;
case "top":
return N + C - B;
case "hanging":
return N + C - 2 * B;
case "middle":
return N + C / 2 - B;
case "ideographic":
return N;
case "alphabetic":
default:
return N;
}
}, tt = function(N) {
return N + this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor * (this.pdf.internal.getLineHeightFactor() - 1);
};
w.prototype.createLinearGradient = function() {
var N = function() {
};
return N.colorStops = [], N.addColorStop = function(C, B) {
this.colorStops.push([C, B]);
}, N.getColor = function() {
return this.colorStops.length === 0 ? "#000000" : this.colorStops[0][1];
}, N.isCanvasGradient = !0, N;
}, w.prototype.createPattern = function() {
return this.createLinearGradient();
}, w.prototype.createRadialGradient = function() {
return this.createLinearGradient();
};
var z = function(N, C, B, T, J, Q, et, nt, At) {
for (var Nt = it.call(this, B, T, J, Q), Ft = 0; Ft < Nt.length; Ft++) {
var _t = Nt[Ft];
Ft === 0 && (At ? P.call(this, _t.x1 + N, _t.y1 + C) : W.call(this, _t.x1 + N, _t.y1 + C)), ot.call(this, N, C, _t.x2, _t.y2, _t.x3, _t.y3, _t.x4, _t.y4);
}
nt ? pt.call(this) : rt.call(this, et);
}, rt = function(N) {
switch (N) {
case "stroke":
this.pdf.internal.out("S");
break;
case "fill":
this.pdf.internal.out("f");
}
}, pt = function() {
this.pdf.clip(), this.pdf.discardPath();
}, P = function(N, C) {
this.pdf.internal.out(n(N) + " " + a(C) + " m");
}, k = function(N) {
var C;
switch (N.align) {
case "right":
case "end":
C = "right";
break;
case "center":
C = "center";
break;
case "left":
case "start":
default:
C = "left";
}
var B = this.pdf.getTextDimensions(N.text), T = wt.call(this, N.y), J = tt.call(this, T) - B.h, Q = this.ctx.transform.applyToPoint(new c(N.x, T)), et = this.ctx.transform.decompose(), nt = new h();
nt = (nt = (nt = nt.multiply(et.translate)).multiply(et.skew)).multiply(et.scale);
for (var At, Nt, Ft, _t = this.ctx.transform.applyToRectangle(new f(N.x, T, B.w, B.h)), zt = nt.applyToRectangle(new f(N.x, J, B.w, B.h)), ht = q.call(this, zt), E = [], Kt = 0; Kt < ht.length; Kt += 1) E.indexOf(ht[Kt]) === -1 && E.push(ht[Kt]);
if (Y(E), this.autoPaging) for (var Et = E[0], Lt = E[E.length - 1], xt = Et; xt < Lt + 1; xt++) {
this.pdf.setPage(xt);
var It = xt === 1 ? this.posY + this.margin[0] : this.margin[0], kt = this.pdf.internal.pageSize.height - this.posY - this.margin[0] - this.margin[2], qt = this.pdf.internal.pageSize.height - this.margin[2], Gt = qt - this.margin[0], Qt = this.pdf.internal.pageSize.width - this.margin[1], te = Qt - this.margin[3], ie = xt === 1 ? 0 : kt + (xt - 2) * Gt;
if (this.ctx.clip_path.length !== 0) {
var de = this.path;
At = JSON.parse(JSON.stringify(this.ctx.clip_path)), this.path = M(At, this.posX + this.margin[3], -1 * ie + It), ct.call(this, "fill", !0), this.path = de;
}
var Wt = M([JSON.parse(JSON.stringify(zt))], this.posX + this.margin[3], -ie + It + this.ctx.prevPageLastElemOffset)[0];
N.scale >= 0.01 && (Nt = this.pdf.internal.getFontSize(), this.pdf.setFontSize(Nt * N.scale), Ft = this.lineWidth, this.lineWidth = Ft * N.scale);
var ee = this.autoPaging !== "text";
if (ee || Wt.y + Wt.h <= qt) {
if (ee || Wt.y >= It && Wt.x <= Qt) {
var Ct = ee ? N.text : this.pdf.splitTextToSize(N.text, N.maxWidth || Qt - Wt.x)[0], Je = M([JSON.parse(JSON.stringify(_t))], this.posX + this.margin[3], -ie + It + this.ctx.prevPageLastElemOffset)[0], se = ee && (xt > Et || xt < Lt) && F.call(this);
se && (this.pdf.saveGraphicsState(), this.pdf.rect(this.margin[3], this.margin[0], te, Gt, null).clip().discardPath()), this.pdf.text(Ct, Je.x, Je.y, { angle: N.angle, align: C, renderingMode: N.renderingMode }), se && this.pdf.restoreGraphicsState();
}
} else Wt.y < qt && (this.ctx.prevPageLastElemOffset += qt - Wt.y);
N.scale >= 0.01 && (this.pdf.setFontSize(Nt), this.lineWidth = Ft);
}
else N.scale >= 0.01 && (Nt = this.pdf.internal.getFontSize(), this.pdf.setFontSize(Nt * N.scale), Ft = this.lineWidth, this.lineWidth = Ft * N.scale), this.pdf.text(N.text, Q.x + this.posX, Q.y + this.posY, { angle: N.angle, align: C, renderingMode: N.renderingMode, maxWidth: N.maxWidth }), N.scale >= 0.01 && (this.pdf.setFontSize(Nt), this.lineWidth = Ft);
}, W = function(N, C, B, T) {
B = B || 0, T = T || 0, this.pdf.internal.out(n(N + B) + " " + a(C + T) + " l");
}, D = function(N, C, B) {
return this.pdf.lines(N, C, B, null, null);
}, ot = function(N, C, B, T, J, Q, et, nt) {
this.pdf.internal.out([e(u(B + N)), e(s(T + C)), e(u(J + N)), e(s(Q + C)), e(u(et + N)), e(s(nt + C)), "c"].join(" "));
}, it = function(N, C, B, T) {
for (var J = 2 * Math.PI, Q = Math.PI / 2; C > B; ) C -= J;
var et = Math.abs(B - C);
et < J && T && (et = J - et);
for (var nt = [], At = T ? -1 : 1, Nt = C; et > 1e-5; ) {
var Ft = Nt + At * Math.min(et, Q);
nt.push(ft.call(this, N, Nt, Ft)), et -= Math.abs(Ft - Nt), Nt = Ft;
}
return nt;
}, ft = function(N, C, B) {
var T = (B - C) / 2, J = N * Math.cos(T), Q = N * Math.sin(T), et = J, nt = -Q, At = et * et + nt * nt, Nt = At + et * J + nt * Q, Ft = 4 / 3 * (Math.sqrt(2 * At * Nt) - Nt) / (et * Q - nt * J), _t = et - Ft * nt, zt = nt + Ft * et, ht = _t, E = -zt, Kt = T + C, Et = Math.cos(Kt), Lt = Math.sin(Kt);
return { x1: N * Math.cos(C), y1: N * Math.sin(C), x2: _t * Et - zt * Lt, y2: _t * Lt + zt * Et, x3: ht * Et - E * Lt, y3: ht * Lt + E * Et, x4: N * Math.cos(B), y4: N * Math.sin(B) };
}, $ = function(N) {
return 180 * N / Math.PI;
}, lt = function(N, C, B, T, J, Q) {
var et = N + 0.5 * (B - N), nt = C + 0.5 * (T - C), At = J + 0.5 * (B - J), Nt = Q + 0.5 * (T - Q), Ft = Math.min(N, J, et, At), _t = Math.max(N, J, et, At), zt = Math.min(C, Q, nt, Nt), ht = Math.max(C, Q, nt, Nt);
return new f(Ft, zt, _t - Ft, ht - zt);
}, dt = function(N, C, B, T, J, Q, et, nt) {
var At, Nt, Ft, _t, zt, ht, E, Kt, Et, Lt, xt, It, kt, qt, Gt = B - N, Qt = T - C, te = J - B, ie = Q - T, de = et - J, Wt = nt - Q;
for (Nt = 0; Nt < 41; Nt++) Et = (E = (Ft = N + (At = Nt / 40) * Gt) + At * ((zt = B + At * te) - Ft)) + At * (zt + At * (J + At * de - zt) - E), Lt = (Kt = (_t = C + At * Qt) + At * ((ht = T + At * ie) - _t)) + At * (ht + At * (Q + At * Wt - ht) - Kt), Nt == 0 ? (xt = Et, It = Lt, kt = Et, qt = Lt) : (xt = Math.min(xt, Et), It = Math.min(It, Lt), kt = Math.max(kt, Et), qt = Math.max(qt, Lt));
return new f(Math.round(xt), Math.round(It), Math.round(kt - xt), Math.round(qt - It));
}, jt = function() {
if (this.prevLineDash || this.ctx.lineDash.length || this.ctx.lineDashOffset) {
var N, C, B = (N = this.ctx.lineDash, C = this.ctx.lineDashOffset, JSON.stringify({ lineDash: N, lineDashOffset: C }));
this.prevLineDash !== B && (this.pdf.setLineDash(this.ctx.lineDash, this.ctx.lineDashOffset), this.prevLineDash = B);
}
};
})(Ut.API), /**
* @license
* jsPDF filters PlugIn
* Copyright (c) 2014 Aras Abbasi
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(r) {
var e = function(s) {
var c, f, h, g, y, w, S, p, O, F;
for (f = [], h = 0, g = (s += c = "\0\0\0\0".slice(s.length % 4 || 4)).length; g > h; h += 4) (y = (s.charCodeAt(h) << 24) + (s.charCodeAt(h + 1) << 16) + (s.charCodeAt(h + 2) << 8) + s.charCodeAt(h + 3)) !== 0 ? (w = (y = ((y = ((y = ((y = (y - (F = y % 85)) / 85) - (O = y % 85)) / 85) - (p = y % 85)) / 85) - (S = y % 85)) / 85) % 85, f.push(w + 33, S + 33, p + 33, O + 33, F + 33)) : f.push(122);
return function(q, _) {
for (var M = _; M > 0; M--) q.pop();
}(f, c.length), String.fromCharCode.apply(String, f) + "~>";
}, n = function(s) {
var c, f, h, g, y, w = String, S = "length", p = 255, O = "charCodeAt", F = "slice", q = "replace";
for (s[F](-2), s = s[F](0, -2)[q](/\s/g, "")[q]("z", "!!!!!"), h = [], g = 0, y = (s += c = "uuuuu"[F](s[S] % 5 || 5))[S]; y > g; g += 5) f = 52200625 * (s[O](g) - 33) + 614125 * (s[O](g + 1) - 33) + 7225 * (s[O](g + 2) - 33) + 85 * (s[O](g + 3) - 33) + (s[O](g + 4) - 33), h.push(p & f >> 24, p & f >> 16, p & f >> 8, p & f);
return function(_, M) {
for (var Y = M; Y > 0; Y--) _.pop();
}(h, c[S]), w.fromCharCode.apply(w, h);
}, a = function(s) {
var c = new RegExp(/^([0-9A-Fa-f]{2})+$/);
if ((s = s.replace(/\s/g, "")).indexOf(">") !== -1 && (s = s.substr(0, s.indexOf(">"))), s.length % 2 && (s += "0"), c.test(s) === !1) return "";
for (var f = "", h = 0; h < s.length; h += 2) f += String.fromCharCode("0x" + (s[h] + s[h + 1]));
return f;
}, u = function(s) {
for (var c = new Uint8Array(s.length), f = s.length; f--; ) c[f] = s.charCodeAt(f);
return s = (c = yo(c)).reduce(function(h, g) {
return h + String.fromCharCode(g);
}, "");
};
r.processDataByFilters = function(s, c) {
var f = 0, h = s || "", g = [];
for (typeof (c = c || []) == "string" && (c = [c]), f = 0; f < c.length; f += 1) switch (c[f]) {
case "ASCII85Decode":
case "/ASCII85Decode":
h = n(h), g.push("/ASCII85Encode");
break;
case "ASCII85Encode":
case "/ASCII85Encode":
h = e(h), g.push("/ASCII85Decode");
break;
case "ASCIIHexDecode":
case "/ASCIIHexDecode":
h = a(h), g.push("/ASCIIHexEncode");
break;
case "ASCIIHexEncode":
case "/ASCIIHexEncode":
h = h.split("").map(function(y) {
return ("0" + y.charCodeAt().toString(16)).slice(-2);
}).join("") + ">", g.push("/ASCIIHexDecode");
break;
case "FlateEncode":
case "/FlateEncode":
h = u(h), g.push("/FlateDecode");
break;
default:
throw new Error('The filter: "' + c[f] + '" is not implemented');
}
return { data: h, reverseChain: g.reverse().join(" ") };
};
}(Ut.API), /**
* @license
* jsPDF fileloading PlugIn
* Copyright (c) 2018 Aras Abbasi (aras.abbasi@gmail.com)
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(r) {
r.loadFile = function(e, n, a) {
return function(u, s, c) {
s = s !== !1, c = typeof c == "function" ? c : function() {
};
var f = void 0;
try {
f = function(h, g, y) {
var w = new XMLHttpRequest(), S = 0, p = function(O) {
var F = O.length, q = [], _ = String.fromCharCode;
for (S = 0; S < F; S += 1) q.push(_(255 & O.charCodeAt(S)));
return q.join("");
};
if (w.open("GET", h, !g), w.overrideMimeType("text/plain; charset=x-user-defined"), g === !1 && (w.onload = function() {
w.status === 200 ? y(p(this.responseText)) : y(void 0);
}), w.send(null), g && w.status === 200) return p(w.responseText);
}(u, s, c);
} catch {
}
return f;
}(e, n, a);
}, r.loadImageFile = r.loadFile;
}(Ut.API), function(r) {
function e() {
return (Ht.html2canvas ? Promise.resolve(Ht.html2canvas) : import("./html2canvas.esm-Dr4iCOK6.js")).catch(function(c) {
return Promise.reject(new Error("Could not load html2canvas: " + c));
}).then(function(c) {
return c.default ? c.default : c;
});
}
function n() {
return (Ht.DOMPurify ? Promise.resolve(Ht.DOMPurify) : import("./purify.es-BGDLgQxM.js")).catch(function(c) {
return Promise.reject(new Error("Could not load dompurify: " + c));
}).then(function(c) {
return c.default ? c.default : c;
});
}
var a = function(c) {
var f = he(c);
return f === "undefined" ? "undefined" : f === "string" || c instanceof String ? "string" : f === "number" || c instanceof Number ? "number" : f === "function" || c instanceof Function ? "function" : c && c.constructor === Array ? "array" : c && c.nodeType === 1 ? "element" : f === "object" ? "object" : "unknown";
}, u = function(c, f) {
var h = document.createElement(c);
for (var g in f.className && (h.className = f.className), f.innerHTML && f.dompurify && (h.innerHTML = f.dompurify.sanitize(f.innerHTML)), f.style) h.style[g] = f.style[g];
return h;
}, s = function c(f) {
var h = Object.assign(c.convert(Promise.resolve()), JSON.parse(JSON.stringify(c.template))), g = c.convert(Promise.resolve(), h);
return g = (g = g.setProgress(1, c, 1, [c])).set(f);
};
(s.prototype = Object.create(Promise.prototype)).constructor = s, s.convert = function(c, f) {
return c.__proto__ = f || s.prototype, c;
}, s.template = { prop: { src: null, container: null, overlay: null, canvas: null, img: null, pdf: null, pageSize: null, callback: function() {
} }, progress: { val: 0, state: null, n: 0, stack: [] }, opt: { filename: "file.pdf", margin: [0, 0, 0, 0], enableLinks: !0, x: 0, y: 0, html2canvas: {}, jsPDF: {}, backgroundColor: "transparent" } }, s.prototype.from = function(c, f) {
return this.then(function() {
switch (f = f || function(h) {
switch (a(h)) {
case "string":
return "string";
case "element":
return h.nodeName.toLowerCase() === "canvas" ? "canvas" : "element";
default:
return "unknown";
}
}(c)) {
case "string":
return this.then(n).then(function(h) {
return this.set({ src: u("div", { innerHTML: c, dompurify: h }) });
});
case "element":
return this.set({ src: c });
case "canvas":
return this.set({ canvas: c });
case "img":
return this.set({ img: c });
default:
return this.error("Unknown source type.");
}
});
}, s.prototype.to = function(c) {
switch (c) {
case "container":
return this.toContainer();
case "canvas":
return this.toCanvas();
case "img":
return this.toImg();
case "pdf":
return this.toPdf();
default:
return this.error("Invalid target.");
}
}, s.prototype.toContainer = function() {
return this.thenList([function() {
return this.prop.src || this.error("Cannot duplicate - no source HTML.");
}, function() {
return this.prop.pageSize || this.setPageSize();
}]).then(function() {
var c = { position: "relative", display: "inline-block", width: (typeof this.opt.width != "number" || isNaN(this.opt.width) || typeof this.opt.windowWidth != "number" || isNaN(this.opt.windowWidth) ? Math.max(this.prop.src.clientWidth, this.prop.src.scrollWidth, this.prop.src.offsetWidth) : this.opt.windowWidth) + "px", left: 0, right: 0, top: 0, margin: "auto", backgroundColor: this.opt.backgroundColor }, f = function h(g, y) {
for (var w = g.nodeType === 3 ? document.createTextNode(g.nodeValue) : g.cloneNode(!1), S = g.firstChild; S; S = S.nextSibling) y !== !0 && S.nodeType === 1 && S.nodeName === "SCRIPT" || w.appendChild(h(S, y));
return g.nodeType === 1 && (g.nodeName === "CANVAS" ? (w.width = g.width, w.height = g.height, w.getContext("2d").drawImage(g, 0, 0)) : g.nodeName !== "TEXTAREA" && g.nodeName !== "SELECT" || (w.value = g.value), w.addEventListener("load", function() {
w.scrollTop = g.scrollTop, w.scrollLeft = g.scrollLeft;
}, !0)), w;
}(this.prop.src, this.opt.html2canvas.javascriptEnabled);
f.tagName === "BODY" && (c.height = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight) + "px"), this.prop.overlay = u("div", { className: "html2pdf__overlay", style: { position: "fixed", overflow: "hidden", zIndex: 1e3, left: "-100000px", right: 0, bottom: 0, top: 0 } }), this.prop.container = u("div", { className: "html2pdf__container", style: c }), this.prop.container.appendChild(f), this.prop.container.firstChild.appendChild(u("div", { style: { clear: "both", border: "0 none transparent", margin: 0, padding: 0, height: 0 } })), this.prop.container.style.float = "none", this.prop.overlay.appendChild(this.prop.container), document.body.appendChild(this.prop.overlay), this.prop.container.firstChild.style.position = "relative", this.prop.container.height = Math.max(this.prop.container.firstChild.clientHeight, this.prop.container.firstChild.scrollHeight, this.prop.container.firstChild.offsetHeight) + "px";
});
}, s.prototype.toCanvas = function() {
var c = [function() {
return document.body.contains(this.prop.container) || this.toContainer();
}];
return this.thenList(c).then(e).then(function(f) {
var h = Object.assign({}, this.opt.html2canvas);
return delete h.onrendered, f(this.prop.container, h);
}).then(function(f) {
(this.opt.html2canvas.onrendered || function() {
})(f), this.prop.canvas = f, document.body.removeChild(this.prop.overlay);
});
}, s.prototype.toContext2d = function() {
var c = [function() {
return document.body.contains(this.prop.container) || this.toContainer();
}];
return this.thenList(c).then(e).then(function(f) {
var h = this.opt.jsPDF, g = this.opt.fontFaces, y = typeof this.opt.width != "number" || isNaN(this.opt.width) || typeof this.opt.windowWidth != "number" || isNaN(this.opt.windowWidth) ? 1 : this.opt.width / this.opt.windowWidth, w = Object.assign({ async: !0, allowTaint: !0, scale: y, scrollX: this.opt.scrollX || 0, scrollY: this.opt.scrollY || 0, backgroundColor: "#ffffff", imageTimeout: 15e3, logging: !0, proxy: null, removeContainer: !0, foreignObjectRendering: !1, useCORS: !1 }, this.opt.html2canvas);
if (delete w.onrendered, h.context2d.autoPaging = this.opt.autoPaging === void 0 || this.opt.autoPaging, h.context2d.posX = this.opt.x, h.context2d.posY = this.opt.y, h.context2d.margin = this.opt.margin, h.context2d.fontFaces = g, g) for (var S = 0; S < g.length; ++S) {
var p = g[S], O = p.src.find(function(F) {
return F.format === "truetype";
});
O && h.addFont(O.url, p.ref.name, p.ref.style);
}
return w.windowHeight = w.windowHeight || 0, w.windowHeight = w.windowHeight == 0 ? Math.max(this.prop.container.clientHeight, this.prop.container.scrollHeight, this.prop.container.offsetHeight) : w.windowHeight, h.context2d.save(!0), f(this.prop.container, w);
}).then(function(f) {
this.opt.jsPDF.context2d.restore(!0), (this.opt.html2canvas.onrendered || function() {
})(f), this.prop.canvas = f, document.body.removeChild(this.prop.overlay);
});
}, s.prototype.toImg = function() {
return this.thenList([function() {
return this.prop.canvas || this.toCanvas();
}]).then(function() {
var c = this.prop.canvas.toDataURL("image/" + this.opt.image.type, this.opt.image.quality);
this.prop.img = document.createElement("img"), this.prop.img.src = c;
});
}, s.prototype.toPdf = function() {
return this.thenList([function() {
return this.toContext2d();
}]).then(function() {
this.prop.pdf = this.prop.pdf || this.opt.jsPDF;
});
}, s.prototype.output = function(c, f, h) {
return (h = h || "pdf").toLowerCase() === "img" || h.toLowerCase() === "image" ? this.outputImg(c, f) : this.outputPdf(c, f);
}, s.prototype.outputPdf = function(c, f) {
return this.thenList([function() {
return this.prop.pdf || this.toPdf();
}]).then(function() {
return this.prop.pdf.output(c, f);
});
}, s.prototype.outputImg = function(c) {
return this.thenList([function() {
return this.prop.img || this.toImg();
}]).then(function() {
switch (c) {
case void 0:
case "img":
return this.prop.img;
case "datauristring":
case "dataurlstring":
return this.prop.img.src;
case "datauri":
case "dataurl":
return document.location.href = this.prop.img.src;
default:
throw 'Image output type "' + c + '" is not supported.';
}
});
}, s.prototype.save = function(c) {
return this.thenList([function() {
return this.prop.pdf || this.toPdf();
}]).set(c ? { filename: c } : null).then(function() {
this.prop.pdf.save(this.opt.filename);
});
}, s.prototype.doCallback = function() {
return this.thenList([function() {
return this.prop.pdf || this.toPdf();
}]).then(function() {
this.prop.callback(this.prop.pdf);
});
}, s.prototype.set = function(c) {
if (a(c) !== "object") return this;
var f = Object.keys(c || {}).map(function(h) {
if (h in s.template.prop) return function() {
this.prop[h] = c[h];
};
switch (h) {
case "margin":
return this.setMargin.bind(this, c.margin);
case "jsPDF":
return function() {
return this.opt.jsPDF = c.jsPDF, this.setPageSize();
};
case "pageSize":
return this.setPageSize.bind(this, c.pageSize);
default:
return function() {
this.opt[h] = c[h];
};
}
}, this);
return this.then(function() {
return this.thenList(f);
});
}, s.prototype.get = function(c, f) {
return this.then(function() {
var h = c in s.template.prop ? this.prop[c] : this.opt[c];
return f ? f(h) : h;
});
}, s.prototype.setMargin = function(c) {
return this.then(function() {
switch (a(c)) {
case "number":
c = [c, c, c, c];
case "array":
if (c.length === 2 && (c = [c[0], c[1], c[0], c[1]]), c.length === 4) break;
default:
return this.error("Invalid margin array.");
}
this.opt.margin = c;
}).then(this.setPageSize);
}, s.prototype.setPageSize = function(c) {
function f(h, g) {
return Math.floor(h * g / 72 * 96);
}
return this.then(function() {
(c = c || Ut.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner") || (c.inner = { width: c.width - this.opt.margin[1] - this.opt.margin[3], height: c.height - this.opt.margin[0] - this.opt.margin[2] }, c.inner.px = { width: f(c.inner.width, c.k), height: f(c.inner.height, c.k) }, c.inner.ratio = c.inner.height / c.inner.width), this.prop.pageSize = c;
});
}, s.prototype.setProgress = function(c, f, h, g) {
return c != null && (this.progress.val = c), f != null && (this.progress.state = f), h != null && (this.progress.n = h), g != null && (this.progress.stack = g), this.progress.ratio = this.progress.val / this.progress.state, this;
}, s.prototype.updateProgress = function(c, f, h, g) {
return this.setProgress(c ? this.progress.val + c : null, f || null, h ? this.progress.n + h : null, g ? this.progress.stack.concat(g) : null);
}, s.prototype.then = function(c, f) {
var h = this;
return this.thenCore(c, f, function(g, y) {
return h.updateProgress(null, null, 1, [g]), Promise.prototype.then.call(this, function(w) {
return h.updateProgress(null, g), w;
}).then(g, y).then(function(w) {
return h.updateProgress(1), w;
});
});
}, s.prototype.thenCore = function(c, f, h) {
h = h || Promise.prototype.then, c && (c = c.bind(this)), f && (f = f.bind(this));
var g = Promise.toString().indexOf("[native code]") !== -1 && Promise.name === "Promise" ? this : s.convert(Object.assign({}, this), Promise.prototype), y = h.call(g, c, f);
return s.convert(y, this.__proto__);
}, s.prototype.thenExternal = function(c, f) {
return Promise.prototype.then.call(this, c, f);
}, s.prototype.thenList = function(c) {
var f = this;
return c.forEach(function(h) {
f = f.thenCore(h);
}), f;
}, s.prototype.catch = function(c) {
c && (c = c.bind(this));
var f = Promise.prototype.catch.call(this, c);
return s.convert(f, this);
}, s.prototype.catchExternal = function(c) {
return Promise.prototype.catch.call(this, c);
}, s.prototype.error = function(c) {
return this.then(function() {
throw new Error(c);
});
}, s.prototype.using = s.prototype.set, s.prototype.saveAs = s.prototype.save, s.prototype.export = s.prototype.output, s.prototype.run = s.prototype.then, Ut.getPageSize = function(c, f, h) {
if (he(c) === "object") {
var g = c;
c = g.orientation, f = g.unit || f, h = g.format || h;
}
f = f || "mm", h = h || "a4", c = ("" + (c || "P")).toLowerCase();
var y, w = ("" + h).toLowerCase(), S = { 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] };
switch (f) {
case "pt":
y = 1;
break;
case "mm":
y = 72 / 25.4;
break;
case "cm":
y = 72 / 2.54;
break;
case "in":
y = 72;
break;
case "px":
y = 0.75;
break;
case "pc":
case "em":
y = 12;
break;
case "ex":
y = 6;
break;
default:
throw "Invalid unit: " + f;
}
var p, O = 0, F = 0;
if (S.hasOwnProperty(w)) O = S[w][1] / y, F = S[w][0] / y;
else try {
O = h[1], F = h[0];
} catch {
throw new Error("Invalid format: " + h);
}
if (c === "p" || c === "portrait") c = "p", F > O && (p = F, F = O, O = p);
else {
if (c !== "l" && c !== "landscape") throw "Invalid orientation: " + c;
c = "l", O > F && (p = F, F = O, O = p);
}
return { width: F, height: O, unit: f, k: y, orientation: c };
}, r.html = function(c, f) {
(f = f || {}).callback = f.callback || function() {
}, f.html2canvas = f.html2canvas || {}, f.html2canvas.canvas = f.html2canvas.canvas || this.canvas, f.jsPDF = f.jsPDF || this, f.fontFaces = f.fontFaces ? f.fontFaces.map(So) : null;
var h = new s(f);
return f.worker ? h : h.from(c).doCallback();
};
}(Ut.API), Ut.API.addJS = function(r) {
return gu = r, this.internal.events.subscribe("postPutResources", function() {
ss = this.internal.newObject(), this.internal.out("<<"), this.internal.out("/Names [(EmbeddedJS) " + (ss + 1) + " 0 R]"), this.internal.out(">>"), this.internal.out("endobj"), pu = this.internal.newObject(), this.internal.out("<<"), this.internal.out("/S /JavaScript"), this.internal.out("/JS (" + gu + ")"), this.internal.out(">>"), this.internal.out("endobj");
}), this.internal.events.subscribe("putCatalog", function() {
ss !== void 0 && pu !== void 0 && this.internal.out("/Names <</JavaScript " + ss + " 0 R>>");
}), this;
}, /**
* @license
* Copyright (c) 2014 Steven Spungin (TwelveTone LLC) steven@twelvetone.tv
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(r) {
var e;
r.events.push(["postPutResources", function() {
var n = this, a = /^(\d+) 0 obj$/;
if (this.outline.root.children.length > 0) for (var u = n.outline.render().split(/\r\n/), s = 0; s < u.length; s++) {
var c = u[s], f = a.exec(c);
if (f != null) {
var h = f[1];
n.internal.newObjectDeferredBegin(h, !1);
}
n.internal.write(c);
}
if (this.outline.createNamedDestinations) {
var g = this.internal.pages.length, y = [];
for (s = 0; s < g; s++) {
var w = n.internal.newObject();
y.push(w);
var S = n.internal.getPageInfo(s + 1);
n.internal.write("<< /D[" + S.objId + " 0 R /XYZ null null null]>> endobj");
}
var p = n.internal.newObject();
for (n.internal.write("<< /Names [ "), s = 0; s < y.length; s++) n.internal.write("(page_" + (s + 1) + ")" + y[s] + " 0 R");
n.internal.write(" ] >>", "endobj"), e = n.internal.newObject(), n.internal.write("<< /Dests " + p + " 0 R"), n.internal.write(">>", "endobj");
}
}]), r.events.push(["putCatalog", function() {
this.outline.root.children.length > 0 && (this.internal.write("/Outlines", this.outline.makeRef(this.outline.root)), this.outline.createNamedDestinations && this.internal.write("/Names " + e + " 0 R"));
}]), r.events.push(["initialized", function() {
var n = this;
n.outline = { createNamedDestinations: !1, root: { children: [] } }, n.outline.add = function(a, u, s) {
var c = { title: u, options: s, children: [] };
return a == null && (a = this.root), a.children.push(c), c;
}, n.outline.render = function() {
return this.ctx = {}, this.ctx.val = "", this.ctx.pdf = n, this.genIds_r(this.root), this.renderRoot(this.root), this.renderItems(this.root), this.ctx.val;
}, n.outline.genIds_r = function(a) {
a.id = n.internal.newObjectDeferred();
for (var u = 0; u < a.children.length; u++) this.genIds_r(a.children[u]);
}, n.outline.renderRoot = function(a) {
this.objStart(a), this.line("/Type /Outlines"), a.children.length > 0 && (this.line("/First " + this.makeRef(a.children[0])), this.line("/Last " + this.makeRef(a.children[a.children.length - 1]))), this.line("/Count " + this.count_r({ count: 0 }, a)), this.objEnd();
}, n.outline.renderItems = function(a) {
for (var u = this.ctx.pdf.internal.getVerticalCoordinateString, s = 0; s < a.children.length; s++) {
var c = a.children[s];
this.objStart(c), this.line("/Title " + this.makeString(c.title)), this.line("/Parent " + this.makeRef(a)), s > 0 && this.line("/Prev " + this.makeRef(a.children[s - 1])), s < a.children.length - 1 && this.line("/Next " + this.makeRef(a.children[s + 1])), c.children.length > 0 && (this.line("/First " + this.makeRef(c.children[0])), this.line("/Last " + this.makeRef(c.children[c.children.length - 1])));
var f = this.count = this.count_r({ count: 0 }, c);
if (f > 0 && this.line("/Count " + f), c.options && c.options.pageNumber) {
var h = n.internal.getPageInfo(c.options.pageNumber);
this.line("/Dest [" + h.objId + " 0 R /XYZ 0 " + u(0) + " 0]");
}
this.objEnd();
}
for (var g = 0; g < a.children.length; g++) this.renderItems(a.children[g]);
}, n.outline.line = function(a) {
this.ctx.val += a + `\r
`;
}, n.outline.makeRef = function(a) {
return a.id + " 0 R";
}, n.outline.makeString = function(a) {
return "(" + n.internal.pdfEscape(a) + ")";
}, n.outline.objStart = function(a) {
this.ctx.val += `\r
` + a.id + ` 0 obj\r
<<\r
`;
}, n.outline.objEnd = function() {
this.ctx.val += `>> \r
endobj\r
`;
}, n.outline.count_r = function(a, u) {
for (var s = 0; s < u.children.length; s++) a.count++, this.count_r(a, u.children[s]);
return a.count;
};
}]);
}(Ut.API), /**
* @license
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(r) {
var e = [192, 193, 194, 195, 196, 197, 198, 199];
r.processJPEG = function(n, a, u, s, c, f) {
var h, g = this.decode.DCT_DECODE, y = null;
if (typeof n == "string" || this.__addimage__.isArrayBuffer(n) || this.__addimage__.isArrayBufferView(n)) {
switch (n = c || n, n = this.__addimage__.isArrayBuffer(n) ? new Uint8Array(n) : n, (h = function(w) {
for (var S, p = 256 * w.charCodeAt(4) + w.charCodeAt(5), O = w.length, F = { width: 0, height: 0, numcomponents: 1 }, q = 4; q < O; q += 2) {
if (q += p, e.indexOf(w.charCodeAt(q + 1)) !== -1) {
S = 256 * w.charCodeAt(q + 5) + w.charCodeAt(q + 6), F = { width: 256 * w.charCodeAt(q + 7) + w.charCodeAt(q + 8), height: S, numcomponents: w.charCodeAt(q + 9) };
break;
}
p = 256 * w.charCodeAt(q + 2) + w.charCodeAt(q + 3);
}
return F;
}(n = this.__addimage__.isArrayBufferView(n) ? this.__addimage__.arrayBufferToBinaryString(n) : n)).numcomponents) {
case 1:
f = this.color_spaces.DEVICE_GRAY;
break;
case 4:
f = this.color_spaces.DEVICE_CMYK;
break;
case 3:
f = this.color_spaces.DEVICE_RGB;
}
y = { data: n, width: h.width, height: h.height, colorSpace: f, bitsPerComponent: 8, filter: g, index: a, alias: u };
}
return y;
};
}(Ut.API);
var _i, os, mu, vu, bu, sc = function() {
var r, e, n;
function a(s) {
var c, f, h, g, y, w, S, p, O, F, q, _, M, Y;
for (this.data = s, this.pos = 8, this.palette = [], this.imgData = [], this.transparency = {}, this.animation = null, this.text = {}, w = null; ; ) {
switch (c = this.readUInt32(), O = (function() {
var st, ct;
for (ct = [], st = 0; st < 4; ++st) ct.push(String.fromCharCode(this.data[this.pos++]));
return ct;
}).call(this).join("")) {
case "IHDR":
this.width = this.readUInt32(), this.height = this.readUInt32(), this.bits = this.data[this.pos++], this.colorType = this.data[this.pos++], this.compressionMethod = this.data[this.pos++], this.filterMethod = this.data[this.pos++], this.interlaceMethod = this.data[this.pos++];
break;
case "acTL":
this.animation = { numFrames: this.readUInt32(), numPlays: this.readUInt32() || 1 / 0, frames: [] };
break;
case "PLTE":
this.palette = this.read(c);
break;
case "fcTL":
w && this.animation.frames.push(w), this.pos += 4, w = { width: this.readUInt32(), height: this.readUInt32(), xOffset: this.readUInt32(), yOffset: this.readUInt32() }, y = this.readUInt16(), g = this.readUInt16() || 100, w.delay = 1e3 * y / g, w.disposeOp = this.data[this.pos++], w.blendOp = this.data[this.pos++], w.data = [];
break;
case "IDAT":
case "fdAT":
for (O === "fdAT" && (this.pos += 4, c -= 4), s = (w != null ? w.data : void 0) || this.imgData, _ = 0; 0 <= c ? _ < c : _ > c; 0 <= c ? ++_ : --_) s.push(this.data[this.pos++]);
break;
case "tRNS":
switch (this.transparency = {}, this.colorType) {
case 3:
if (h = this.palette.length / 3, this.transparency.indexed = this.read(c), this.transparency.indexed.length > h) throw new Error("More transparent colors than palette size");
if ((F = h - this.transparency.indexed.length) > 0) for (M = 0; 0 <= F ? M < F : M > F; 0 <= F ? ++M : --M) this.transparency.indexed.push(255);
break;
case 0:
this.transparency.grayscale = this.read(c)[0];
break;
case 2:
this.transparency.rgb = this.read(c);
}
break;
case "tEXt":
S = (q = this.read(c)).indexOf(0), p = String.fromCharCode.apply(String, q.slice(0, S)), this.text[p] = String.fromCharCode.apply(String, q.slice(S + 1));
break;
case "IEND":
return w && this.animation.frames.push(w), this.colors = (function() {
switch (this.colorType) {
case 0:
case 3:
case 4:
return 1;
case 2:
case 6:
return 3;
}
}).call(this), this.hasAlphaChannel = (Y = this.colorType) === 4 || Y === 6, f = this.colors + (this.hasAlphaChannel ? 1 : 0), this.pixelBitlength = this.bits * f, this.colorSpace = (function() {
switch (this.colors) {
case 1:
return "DeviceGray";
case 3:
return "DeviceRGB";
}
}).call(this), void (this.imgData = new Uint8Array(this.imgData));
default:
this.pos += c;
}
if (this.pos += 4, this.pos > this.data.length) throw new Error("Incomplete or corrupt PNG file");
}
}
a.prototype.read = function(s) {
var c, f;
for (f = [], c = 0; 0 <= s ? c < s : c > s; 0 <= s ? ++c : --c) f.push(this.data[this.pos++]);
return f;
}, a.prototype.readUInt32 = function() {
return this.data[this.pos++] << 24 | this.data[this.pos++] << 16 | this.data[this.pos++] << 8 | this.data[this.pos++];
}, a.prototype.readUInt16 = function() {
return this.data[this.pos++] << 8 | this.data[this.pos++];
}, a.prototype.decodePixels = function(s) {
var c = this.pixelBitlength / 8, f = new Uint8Array(this.width * this.height * c), h = 0, g = this;
if (s == null && (s = this.imgData), s.length === 0) return new Uint8Array(0);
function y(w, S, p, O) {
var F, q, _, M, Y, st, ct, wt, tt, z, rt, pt, P, k, W, D, ot, it, ft, $, lt, dt = Math.ceil((g.width - w) / p), jt = Math.ceil((g.height - S) / O), N = g.width == dt && g.height == jt;
for (k = c * dt, pt = N ? f : new Uint8Array(k * jt), st = s.length, P = 0, q = 0; P < jt && h < st; ) {
switch (s[h++]) {
case 0:
for (M = ot = 0; ot < k; M = ot += 1) pt[q++] = s[h++];
break;
case 1:
for (M = it = 0; it < k; M = it += 1) F = s[h++], Y = M < c ? 0 : pt[q - c], pt[q++] = (F + Y) % 256;
break;
case 2:
for (M = ft = 0; ft < k; M = ft += 1) F = s[h++], _ = (M - M % c) / c, W = P && pt[(P - 1) * k + _ * c + M % c], pt[q++] = (W + F) % 256;
break;
case 3:
for (M = $ = 0; $ < k; M = $ += 1) F = s[h++], _ = (M - M % c) / c, Y = M < c ? 0 : pt[q - c], W = P && pt[(P - 1) * k + _ * c + M % c], pt[q++] = (F + Math.floor((Y + W) / 2)) % 256;
break;
case 4:
for (M = lt = 0; lt < k; M = lt += 1) F = s[h++], _ = (M - M % c) / c, Y = M < c ? 0 : pt[q - c], P === 0 ? W = D = 0 : (W = pt[(P - 1) * k + _ * c + M % c], D = _ && pt[(P - 1) * k + (_ - 1) * c + M % c]), ct = Y + W - D, wt = Math.abs(ct - Y), z = Math.abs(ct - W), rt = Math.abs(ct - D), tt = wt <= z && wt <= rt ? Y : z <= rt ? W : D, pt[q++] = (F + tt) % 256;
break;
default:
throw new Error("Invalid filter algorithm: " + s[h - 1]);
}
if (!N) {
var C = ((S + P * O) * g.width + w) * c, B = P * k;
for (M = 0; M < dt; M += 1) {
for (var T = 0; T < c; T += 1) f[C++] = pt[B++];
C += (p - 1) * c;
}
}
P++;
}
}
return s = Dl(s), g.interlaceMethod == 1 ? (y(0, 0, 8, 8), y(4, 0, 8, 8), y(0, 4, 4, 8), y(2, 0, 4, 4), y(0, 2, 2, 4), y(1, 0, 2, 2), y(0, 1, 1, 2)) : y(0, 0, 1, 1), f;
}, a.prototype.decodePalette = function() {
var s, c, f, h, g, y, w, S, p;
for (f = this.palette, y = this.transparency.indexed || [], g = new Uint8Array((y.length || 0) + f.length), h = 0, s = 0, c = w = 0, S = f.length; w < S; c = w += 3) g[h++] = f[c], g[h++] = f[c + 1], g[h++] = f[c + 2], g[h++] = (p = y[s++]) != null ? p : 255;
return g;
}, a.prototype.copyToImageData = function(s, c) {
var f, h, g, y, w, S, p, O, F, q, _;
if (h = this.colors, F = null, f = this.hasAlphaChannel, this.palette.length && (F = (_ = this._decodedPalette) != null ? _ : this._decodedPalette = this.decodePalette(), h = 4, f = !0), O = (g = s.data || s).length, w = F || c, y = S = 0, h === 1) for (; y < O; ) p = F ? 4 * c[y / 4] : S, q = w[p++], g[y++] = q, g[y++] = q, g[y++] = q, g[y++] = f ? w[p++] : 255, S = p;
else for (; y < O; ) p = F ? 4 * c[y / 4] : S, g[y++] = w[p++], g[y++] = w[p++], g[y++] = w[p++], g[y++] = f ? w[p++] : 255, S = p;
}, a.prototype.decode = function() {
var s;
return s = new Uint8Array(this.width * this.height * 4), this.copyToImageData(s, this.decodePixels()), s;
};
var u = function() {
if (Object.prototype.toString.call(Ht) === "[object Window]") {
try {
e = Ht.document.createElement("canvas"), n = e.getContext("2d");
} catch {
return !1;
}
return !0;
}
return !1;
};
return u(), r = function(s) {
var c;
if (u() === !0) return n.width = s.width, n.height = s.height, n.clearRect(0, 0, s.width, s.height), n.putImageData(s, 0, 0), (c = new Image()).src = e.toDataURL(), c;
throw new Error("This method requires a Browser with Canvas-capability.");
}, a.prototype.decodeFrames = function(s) {
var c, f, h, g, y, w, S, p;
if (this.animation) {
for (p = [], f = y = 0, w = (S = this.animation.frames).length; y < w; f = ++y) c = S[f], h = s.createImageData(c.width, c.height), g = this.decodePixels(new Uint8Array(c.data)), this.copyToImageData(h, g), c.imageData = h, p.push(c.image = r(h));
return p;
}
}, a.prototype.renderFrame = function(s, c) {
var f, h, g;
return f = (h = this.animation.frames)[c], g = h[c - 1], c === 0 && s.clearRect(0, 0, this.width, this.height), (g != null ? g.disposeOp : void 0) === 1 ? s.clearRect(g.xOffset, g.yOffset, g.width, g.height) : (g != null ? g.disposeOp : void 0) === 2 && s.putImageData(g.imageData, g.xOffset, g.yOffset), f.blendOp === 0 && s.clearRect(f.xOffset, f.yOffset, f.width, f.height), s.drawImage(f.image, f.xOffset, f.yOffset);
}, a.prototype.animate = function(s) {
var c, f, h, g, y, w, S = this;
return f = 0, w = this.animation, g = w.numFrames, h = w.frames, y = w.numPlays, (c = function() {
var p, O;
if (p = f++ % g, O = h[p], S.renderFrame(s, p), g > 1 && f / g < y) return S.animation._timeout = setTimeout(c, O.delay);
})();
}, a.prototype.stopAnimation = function() {
var s;
return clearTimeout((s = this.animation) != null ? s._timeout : void 0);
}, a.prototype.render = function(s) {
var c, f;
return s._png && s._png.stopAnimation(), s._png = this, s.width = this.width, s.height = this.height, c = s.getContext("2d"), this.animation ? (this.decodeFrames(c), this.animate(c)) : (f = c.createImageData(this.width, this.height), this.copyToImageData(f, this.decodePixels()), c.putImageData(f, 0, 0));
}, a;
}();
/**
* @license
*
* Copyright (c) 2014 James Robb, https://github.com/jamesbrobb
*
* 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.
* ====================================================================
*/
/**
* @license
* (c) Dean McNamee <dean@gmail.com>, 2013.
*
* https://github.com/deanm/omggif
*
* 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.
*
* omggif is a JavaScript implementation of a GIF 89a encoder and decoder,
* including animation and compression. It does not rely on any specific
* underlying system, so should run in the browser, Node, or Plask.
*/
function oc(r) {
var e = 0;
if (r[e++] !== 71 || r[e++] !== 73 || r[e++] !== 70 || r[e++] !== 56 || (r[e++] + 1 & 253) != 56 || r[e++] !== 97) throw new Error("Invalid GIF 87a/89a header.");
var n = r[e++] | r[e++] << 8, a = r[e++] | r[e++] << 8, u = r[e++], s = u >> 7, c = 1 << (7 & u) + 1;
r[e++], r[e++];
var f = null, h = null;
s && (f = e, h = c, e += 3 * c);
var g = !0, y = [], w = 0, S = null, p = 0, O = null;
for (this.width = n, this.height = a; g && e < r.length; ) switch (r[e++]) {
case 33:
switch (r[e++]) {
case 255:
if (r[e] !== 11 || r[e + 1] == 78 && r[e + 2] == 69 && r[e + 3] == 84 && r[e + 4] == 83 && r[e + 5] == 67 && r[e + 6] == 65 && r[e + 7] == 80 && r[e + 8] == 69 && r[e + 9] == 50 && r[e + 10] == 46 && r[e + 11] == 48 && r[e + 12] == 3 && r[e + 13] == 1 && r[e + 16] == 0) e += 14, O = r[e++] | r[e++] << 8, e++;
else for (e += 12; ; ) {
if (!((P = r[e++]) >= 0)) throw Error("Invalid block size");
if (P === 0) break;
e += P;
}
break;
case 249:
if (r[e++] !== 4 || r[e + 4] !== 0) throw new Error("Invalid graphics extension block.");
var F = r[e++];
w = r[e++] | r[e++] << 8, S = r[e++], (1 & F) == 0 && (S = null), p = F >> 2 & 7, e++;
break;
case 254:
for (; ; ) {
if (!((P = r[e++]) >= 0)) throw Error("Invalid block size");
if (P === 0) break;
e += P;
}
break;
default:
throw new Error("Unknown graphic control label: 0x" + r[e - 1].toString(16));
}
break;
case 44:
var q = r[e++] | r[e++] << 8, _ = r[e++] | r[e++] << 8, M = r[e++] | r[e++] << 8, Y = r[e++] | r[e++] << 8, st = r[e++], ct = st >> 6 & 1, wt = 1 << (7 & st) + 1, tt = f, z = h, rt = !1;
st >> 7 && (rt = !0, tt = e, z = wt, e += 3 * wt);
var pt = e;
for (e++; ; ) {
var P;
if (!((P = r[e++]) >= 0)) throw Error("Invalid block size");
if (P === 0) break;
e += P;
}
y.push({ x: q, y: _, width: M, height: Y, has_local_palette: rt, palette_offset: tt, palette_size: z, data_offset: pt, data_length: e - pt, transparent_index: S, interlaced: !!ct, delay: w, disposal: p });
break;
case 59:
g = !1;
break;
default:
throw new Error("Unknown gif block: 0x" + r[e - 1].toString(16));
}
this.numFrames = function() {
return y.length;
}, this.loopCount = function() {
return O;
}, this.frameInfo = function(k) {
if (k < 0 || k >= y.length) throw new Error("Frame index out of range.");
return y[k];
}, this.decodeAndBlitFrameBGRA = function(k, W) {
var D = this.frameInfo(k), ot = D.width * D.height, it = new Uint8Array(ot);
yu(r, D.data_offset, it, ot);
var ft = D.palette_offset, $ = D.transparent_index;
$ === null && ($ = 256);
var lt = D.width, dt = n - lt, jt = lt, N = 4 * (D.y * n + D.x), C = 4 * ((D.y + D.height) * n + D.x), B = N, T = 4 * dt;
D.interlaced === !0 && (T += 4 * n * 7);
for (var J = 8, Q = 0, et = it.length; Q < et; ++Q) {
var nt = it[Q];
if (jt === 0 && (jt = lt, (B += T) >= C && (T = 4 * dt + 4 * n * (J - 1), B = N + (lt + dt) * (J << 1), J >>= 1)), nt === $) B += 4;
else {
var At = r[ft + 3 * nt], Nt = r[ft + 3 * nt + 1], Ft = r[ft + 3 * nt + 2];
W[B++] = Ft, W[B++] = Nt, W[B++] = At, W[B++] = 255;
}
--jt;
}
}, this.decodeAndBlitFrameRGBA = function(k, W) {
var D = this.frameInfo(k), ot = D.width * D.height, it = new Uint8Array(ot);
yu(r, D.data_offset, it, ot);
var ft = D.palette_offset, $ = D.transparent_index;
$ === null && ($ = 256);
var lt = D.width, dt = n - lt, jt = lt, N = 4 * (D.y * n + D.x), C = 4 * ((D.y + D.height) * n + D.x), B = N, T = 4 * dt;
D.interlaced === !0 && (T += 4 * n * 7);
for (var J = 8, Q = 0, et = it.length; Q < et; ++Q) {
var nt = it[Q];
if (jt === 0 && (jt = lt, (B += T) >= C && (T = 4 * dt + 4 * n * (J - 1), B = N + (lt + dt) * (J << 1), J >>= 1)), nt === $) B += 4;
else {
var At = r[ft + 3 * nt], Nt = r[ft + 3 * nt + 1], Ft = r[ft + 3 * nt + 2];
W[B++] = At, W[B++] = Nt, W[B++] = Ft, W[B++] = 255;
}
--jt;
}
};
}
function yu(r, e, n, a) {
for (var u = r[e++], s = 1 << u, c = s + 1, f = c + 1, h = u + 1, g = (1 << h) - 1, y = 0, w = 0, S = 0, p = r[e++], O = new Int32Array(4096), F = null; ; ) {
for (; y < 16 && p !== 0; ) w |= r[e++] << y, y += 8, p === 1 ? p = r[e++] : --p;
if (y < h) break;
var q = w & g;
if (w >>= h, y -= h, q !== s) {
if (q === c) break;
for (var _ = q < f ? q : F, M = 0, Y = _; Y > s; ) Y = O[Y] >> 8, ++M;
var st = Y;
if (S + M + (_ !== q ? 1 : 0) > a) return void ve.log("Warning, gif stream longer than expected.");
n[S++] = st;
var ct = S += M;
for (_ !== q && (n[S++] = st), Y = _; M--; ) Y = O[Y], n[--ct] = 255 & Y, Y >>= 8;
F !== null && f < 4096 && (O[f++] = F << 8 | st, f >= g + 1 && h < 12 && (++h, g = g << 1 | 1)), F = q;
} else f = c + 1, g = (1 << (h = u + 1)) - 1, F = null;
}
return S !== a && ve.log("Warning, gif stream shorter than expected."), n;
}
/**
* @license
Copyright (c) 2008, Adobe Systems Incorporated
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* Neither the name of Adobe Systems Incorporated nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
function po(r) {
var e, n, a, u, s, c = Math.floor, f = new Array(64), h = new Array(64), g = new Array(64), y = new Array(64), w = new Array(65535), S = new Array(65535), p = new Array(64), O = new Array(64), F = [], q = 0, _ = 7, M = new Array(64), Y = new Array(64), st = new Array(64), ct = new Array(256), wt = new Array(2048), tt = [0, 1, 5, 6, 14, 15, 27, 28, 2, 4, 7, 13, 16, 26, 29, 42, 3, 8, 12, 17, 25, 30, 41, 43, 9, 11, 18, 24, 31, 40, 44, 53, 10, 19, 23, 32, 39, 45, 52, 54, 20, 22, 33, 38, 46, 51, 55, 60, 21, 34, 37, 47, 50, 56, 59, 61, 35, 36, 48, 49, 57, 58, 62, 63], z = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], rt = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], pt = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], P = [1, 2, 3, 0, 4, 17, 5, 18, 33, 49, 65, 6, 19, 81, 97, 7, 34, 113, 20, 50, 129, 145, 161, 8, 35, 66, 177, 193, 21, 82, 209, 240, 36, 51, 98, 114, 130, 9, 10, 22, 23, 24, 25, 26, 37, 38, 39, 40, 41, 42, 52, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250], k = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], W = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], D = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], ot = [0, 1, 2, 3, 17, 4, 5, 33, 49, 6, 18, 65, 81, 7, 97, 113, 19, 34, 50, 129, 8, 20, 66, 145, 161, 177, 193, 9, 35, 51, 82, 240, 21, 98, 114, 209, 10, 22, 36, 52, 225, 37, 241, 23, 24, 25, 26, 38, 39, 40, 41, 42, 53, 54, 55, 56, 57, 58, 67, 68, 69, 70, 71, 72, 73, 74, 83, 84, 85, 86, 87, 88, 89, 90, 99, 100, 101, 102, 103, 104, 105, 106, 115, 116, 117, 118, 119, 120, 121, 122, 130, 131, 132, 133, 134, 135, 136, 137, 138, 146, 147, 148, 149, 150, 151, 152, 153, 154, 162, 163, 164, 165, 166, 167, 168, 169, 170, 178, 179, 180, 181, 182, 183, 184, 185, 186, 194, 195, 196, 197, 198, 199, 200, 201, 202, 210, 211, 212, 213, 214, 215, 216, 217, 218, 226, 227, 228, 229, 230, 231, 232, 233, 234, 242, 243, 244, 245, 246, 247, 248, 249, 250];
function it(N, C) {
for (var B = 0, T = 0, J = new Array(), Q = 1; Q <= 16; Q++) {
for (var et = 1; et <= N[Q]; et++) J[C[T]] = [], J[C[T]][0] = B, J[C[T]][1] = Q, T++, B++;
B *= 2;
}
return J;
}
function ft(N) {
for (var C = N[0], B = N[1] - 1; B >= 0; ) C & 1 << B && (q |= 1 << _), B--, --_ < 0 && (q == 255 ? ($(255), $(0)) : $(q), _ = 7, q = 0);
}
function $(N) {
F.push(N);
}
function lt(N) {
$(N >> 8 & 255), $(255 & N);
}
function dt(N, C, B, T, J) {
for (var Q, et = J[0], nt = J[240], At = function(Lt, xt) {
var It, kt, qt, Gt, Qt, te, ie, de, Wt, ee, Ct = 0;
for (Wt = 0; Wt < 8; ++Wt) {
It = Lt[Ct], kt = Lt[Ct + 1], qt = Lt[Ct + 2], Gt = Lt[Ct + 3], Qt = Lt[Ct + 4], te = Lt[Ct + 5], ie = Lt[Ct + 6];
var Je = It + (de = Lt[Ct + 7]), se = It - de, _n = kt + ie, ge = kt - ie, Le = qt + te, Un = qt - te, ue = Gt + Qt, Or = Gt - Qt, Ae = Je + ue, Pn = Je - ue, nr = _n + Le, xe = _n - Le;
Lt[Ct] = Ae + nr, Lt[Ct + 4] = Ae - nr;
var Jt = 0.707106781 * (xe + Pn);
Lt[Ct + 2] = Pn + Jt, Lt[Ct + 6] = Pn - Jt;
var le = 0.382683433 * ((Ae = Or + Un) - (xe = ge + se)), Mr = 0.5411961 * Ae + le, We = 1.306562965 * xe + le, Hn = 0.707106781 * (nr = Un + ge), Wn = se + Hn, Tt = se - Hn;
Lt[Ct + 5] = Tt + Mr, Lt[Ct + 3] = Tt - Mr, Lt[Ct + 1] = Wn + We, Lt[Ct + 7] = Wn - We, Ct += 8;
}
for (Ct = 0, Wt = 0; Wt < 8; ++Wt) {
It = Lt[Ct], kt = Lt[Ct + 8], qt = Lt[Ct + 16], Gt = Lt[Ct + 24], Qt = Lt[Ct + 32], te = Lt[Ct + 40], ie = Lt[Ct + 48];
var kn = It + (de = Lt[Ct + 56]), Vn = It - de, an = kt + ie, De = kt - ie, Me = qt + te, hn = qt - te, Kr = Gt + Qt, rr = Gt - Qt, Fn = kn + Kr, In = kn - Kr, Cn = an + Me, Gn = an - Me;
Lt[Ct] = Fn + Cn, Lt[Ct + 32] = Fn - Cn;
var bn = 0.707106781 * (Gn + In);
Lt[Ct + 16] = In + bn, Lt[Ct + 48] = In - bn;
var Jn = 0.382683433 * ((Fn = rr + hn) - (Gn = De + Vn)), Br = 0.5411961 * Fn + Jn, Zr = 1.306562965 * Gn + Jn, $r = 0.707106781 * (Cn = hn + De), Qr = Vn + $r, ti = Vn - $r;
Lt[Ct + 40] = ti + Br, Lt[Ct + 24] = ti - Br, Lt[Ct + 8] = Qr + Zr, Lt[Ct + 56] = Qr - Zr, Ct++;
}
for (Wt = 0; Wt < 64; ++Wt) ee = Lt[Wt] * xt[Wt], p[Wt] = ee > 0 ? ee + 0.5 | 0 : ee - 0.5 | 0;
return p;
}(N, C), Nt = 0; Nt < 64; ++Nt) O[tt[Nt]] = At[Nt];
var Ft = O[0] - B;
B = O[0], Ft == 0 ? ft(T[0]) : (ft(T[S[Q = 32767 + Ft]]), ft(w[Q]));
for (var _t = 63; _t > 0 && O[_t] == 0; ) _t--;
if (_t == 0) return ft(et), B;
for (var zt, ht = 1; ht <= _t; ) {
for (var E = ht; O[ht] == 0 && ht <= _t; ) ++ht;
var Kt = ht - E;
if (Kt >= 16) {
zt = Kt >> 4;
for (var Et = 1; Et <= zt; ++Et) ft(nt);
Kt &= 15;
}
Q = 32767 + O[ht], ft(J[(Kt << 4) + S[Q]]), ft(w[Q]), ht++;
}
return _t != 63 && ft(et), B;
}
function jt(N) {
N = Math.min(Math.max(N, 1), 100), s != N && (function(C) {
for (var B = [16, 11, 10, 16, 24, 40, 51, 61, 12, 12, 14, 19, 26, 58, 60, 55, 14, 13, 16, 24, 40, 57, 69, 56, 14, 17, 22, 29, 51, 87, 80, 62, 18, 22, 37, 56, 68, 109, 103, 77, 24, 35, 55, 64, 81, 104, 113, 92, 49, 64, 78, 87, 103, 121, 120, 101, 72, 92, 95, 98, 112, 100, 103, 99], T = 0; T < 64; T++) {
var J = c((B[T] * C + 50) / 100);
J = Math.min(Math.max(J, 1), 255), f[tt[T]] = J;
}
for (var Q = [17, 18, 24, 47, 99, 99, 99, 99, 18, 21, 26, 66, 99, 99, 99, 99, 24, 26, 56, 99, 99, 99, 99, 99, 47, 66, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99, 99], et = 0; et < 64; et++) {
var nt = c((Q[et] * C + 50) / 100);
nt = Math.min(Math.max(nt, 1), 255), h[tt[et]] = nt;
}
for (var At = [1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961, 0.275899379], Nt = 0, Ft = 0; Ft < 8; Ft++) for (var _t = 0; _t < 8; _t++) g[Nt] = 1 / (f[tt[Nt]] * At[Ft] * At[_t] * 8), y[Nt] = 1 / (h[tt[Nt]] * At[Ft] * At[_t] * 8), Nt++;
}(N < 50 ? Math.floor(5e3 / N) : Math.floor(200 - 2 * N)), s = N);
}
this.encode = function(N, C) {
C && jt(C), F = new Array(), q = 0, _ = 7, lt(65496), lt(65504), lt(16), $(74), $(70), $(73), $(70), $(0), $(1), $(1), $(0), lt(1), lt(1), $(0), $(0), function() {
lt(65499), lt(132), $(0);
for (var kt = 0; kt < 64; kt++) $(f[kt]);
$(1);
for (var qt = 0; qt < 64; qt++) $(h[qt]);
}(), function(kt, qt) {
lt(65472), lt(17), $(8), lt(qt), lt(kt), $(3), $(1), $(17), $(0), $(2), $(17), $(1), $(3), $(17), $(1);
}(N.width, N.height), function() {
lt(65476), lt(418), $(0);
for (var kt = 0; kt < 16; kt++) $(z[kt + 1]);
for (var qt = 0; qt <= 11; qt++) $(rt[qt]);
$(16);
for (var Gt = 0; Gt < 16; Gt++) $(pt[Gt + 1]);
for (var Qt = 0; Qt <= 161; Qt++) $(P[Qt]);
$(1);
for (var te = 0; te < 16; te++) $(k[te + 1]);
for (var ie = 0; ie <= 11; ie++) $(W[ie]);
$(17);
for (var de = 0; de < 16; de++) $(D[de + 1]);
for (var Wt = 0; Wt <= 161; Wt++) $(ot[Wt]);
}(), lt(65498), lt(12), $(3), $(1), $(0), $(2), $(17), $(3), $(17), $(0), $(63), $(0);
var B = 0, T = 0, J = 0;
q = 0, _ = 7, this.encode.displayName = "_encode_";
for (var Q, et, nt, At, Nt, Ft, _t, zt, ht, E = N.data, Kt = N.width, Et = N.height, Lt = 4 * Kt, xt = 0; xt < Et; ) {
for (Q = 0; Q < Lt; ) {
for (Nt = Lt * xt + Q, _t = -1, zt = 0, ht = 0; ht < 64; ht++) Ft = Nt + (zt = ht >> 3) * Lt + (_t = 4 * (7 & ht)), xt + zt >= Et && (Ft -= Lt * (xt + 1 + zt - Et)), Q + _t >= Lt && (Ft -= Q + _t - Lt + 4), et = E[Ft++], nt = E[Ft++], At = E[Ft++], M[ht] = (wt[et] + wt[nt + 256 >> 0] + wt[At + 512 >> 0] >> 16) - 128, Y[ht] = (wt[et + 768 >> 0] + wt[nt + 1024 >> 0] + wt[At + 1280 >> 0] >> 16) - 128, st[ht] = (wt[et + 1280 >> 0] + wt[nt + 1536 >> 0] + wt[At + 1792 >> 0] >> 16) - 128;
B = dt(M, g, B, e, a), T = dt(Y, y, T, n, u), J = dt(st, y, J, n, u), Q += 32;
}
xt += 8;
}
if (_ >= 0) {
var It = [];
It[1] = _ + 1, It[0] = (1 << _ + 1) - 1, ft(It);
}
return lt(65497), new Uint8Array(F);
}, r = r || 50, function() {
for (var N = String.fromCharCode, C = 0; C < 256; C++) ct[C] = N(C);
}(), e = it(z, rt), n = it(k, W), a = it(pt, P), u = it(D, ot), function() {
for (var N = 1, C = 2, B = 1; B <= 15; B++) {
for (var T = N; T < C; T++) S[32767 + T] = B, w[32767 + T] = [], w[32767 + T][1] = B, w[32767 + T][0] = T;
for (var J = -(C - 1); J <= -N; J++) S[32767 + J] = B, w[32767 + J] = [], w[32767 + J][1] = B, w[32767 + J][0] = C - 1 + J;
N <<= 1, C <<= 1;
}
}(), function() {
for (var N = 0; N < 256; N++) wt[N] = 19595 * N, wt[N + 256 >> 0] = 38470 * N, wt[N + 512 >> 0] = 7471 * N + 32768, wt[N + 768 >> 0] = -11059 * N, wt[N + 1024 >> 0] = -21709 * N, wt[N + 1280 >> 0] = 32768 * N + 8421375, wt[N + 1536 >> 0] = -27439 * N, wt[N + 1792 >> 0] = -5329 * N;
}(), jt(r);
}
/**
* @license
* Copyright (c) 2017 Aras Abbasi
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function Dn(r, e) {
if (this.pos = 0, this.buffer = r, this.datav = new DataView(r.buffer), this.is_with_alpha = !!e, this.bottom_up = !0, this.flag = String.fromCharCode(this.buffer[0]) + String.fromCharCode(this.buffer[1]), this.pos += 2, ["BM", "BA", "CI", "CP", "IC", "PT"].indexOf(this.flag) === -1) throw new Error("Invalid BMP File");
this.parseHeader(), this.parseBGR();
}
function wu(r) {
function e(z) {
if (!z) throw Error("assert :P");
}
function n(z, rt, pt) {
for (var P = 0; 4 > P; P++) if (z[rt + P] != pt.charCodeAt(P)) return !0;
return !1;
}
function a(z, rt, pt, P, k) {
for (var W = 0; W < k; W++) z[rt + W] = pt[P + W];
}
function u(z, rt, pt, P) {
for (var k = 0; k < P; k++) z[rt + k] = pt;
}
function s(z) {
return new Int32Array(z);
}
function c(z, rt) {
for (var pt = [], P = 0; P < z; P++) pt.push(new rt());
return pt;
}
function f(z, rt) {
var pt = [];
return function P(k, W, D) {
for (var ot = D[W], it = 0; it < ot && (k.push(D.length > W + 1 ? [] : new rt()), !(D.length < W + 1)); it++) P(k[it], W + 1, D);
}(pt, 0, z), pt;
}
var h = function() {
var z = this;
function rt(t, i) {
for (var l = 1 << i - 1 >>> 0; t & l; ) l >>>= 1;
return l ? (t & l - 1) + l : t;
}
function pt(t, i, l, d, m) {
e(!(d % l));
do
t[i + (d -= l)] = m;
while (0 < d);
}
function P(t, i, l, d, m) {
if (e(2328 >= m), 512 >= m) var b = s(512);
else if ((b = s(m)) == null) return 0;
return function(L, A, x, I, U, K) {
var Z, G, vt = A, at = 1 << x, H = s(16), V = s(16);
for (e(U != 0), e(I != null), e(L != null), e(0 < x), G = 0; G < U; ++G) {
if (15 < I[G]) return 0;
++H[I[G]];
}
if (H[0] == U) return 0;
for (V[1] = 0, Z = 1; 15 > Z; ++Z) {
if (H[Z] > 1 << Z) return 0;
V[Z + 1] = V[Z] + H[Z];
}
for (G = 0; G < U; ++G) Z = I[G], 0 < I[G] && (K[V[Z]++] = G);
if (V[15] == 1) return (I = new k()).g = 0, I.value = K[0], pt(L, vt, 1, at, I), at;
var gt, bt = -1, mt = at - 1, Mt = 0, St = 1, Rt = 1, Pt = 1 << x;
for (G = 0, Z = 1, U = 2; Z <= x; ++Z, U <<= 1) {
if (St += Rt <<= 1, 0 > (Rt -= H[Z])) return 0;
for (; 0 < H[Z]; --H[Z]) (I = new k()).g = Z, I.value = K[G++], pt(L, vt + Mt, U, Pt, I), Mt = rt(Mt, Z);
}
for (Z = x + 1, U = 2; 15 >= Z; ++Z, U <<= 1) {
if (St += Rt <<= 1, 0 > (Rt -= H[Z])) return 0;
for (; 0 < H[Z]; --H[Z]) {
if (I = new k(), (Mt & mt) != bt) {
for (vt += Pt, gt = 1 << (bt = Z) - x; 15 > bt && !(0 >= (gt -= H[bt])); ) ++bt, gt <<= 1;
at += Pt = 1 << (gt = bt - x), L[A + (bt = Mt & mt)].g = gt + x, L[A + bt].value = vt - A - bt;
}
I.g = Z - x, I.value = K[G++], pt(L, vt + (Mt >> x), U, Pt, I), Mt = rt(Mt, Z);
}
}
return St != 2 * V[15] - 1 ? 0 : at;
}(t, i, l, d, m, b);
}
function k() {
this.value = this.g = 0;
}
function W() {
this.value = this.g = 0;
}
function D() {
this.G = c(5, k), this.H = s(5), this.jc = this.Qb = this.qb = this.nd = 0, this.pd = c(Ve, W);
}
function ot(t, i, l, d) {
e(t != null), e(i != null), e(2147483648 > d), t.Ca = 254, t.I = 0, t.b = -8, t.Ka = 0, t.oa = i, t.pa = l, t.Jd = i, t.Yc = l + d, t.Zc = 4 <= d ? l + d - 4 + 1 : l, Q(t);
}
function it(t, i) {
for (var l = 0; 0 < i--; ) l |= nt(t, 128) << i;
return l;
}
function ft(t, i) {
var l = it(t, i);
return et(t) ? -l : l;
}
function $(t, i, l, d) {
var m, b = 0;
for (e(t != null), e(i != null), e(4294967288 > d), t.Sb = d, t.Ra = 0, t.u = 0, t.h = 0, 4 < d && (d = 4), m = 0; m < d; ++m) b += i[l + m] << 8 * m;
t.Ra = b, t.bb = d, t.oa = i, t.pa = l;
}
function lt(t) {
for (; 8 <= t.u && t.bb < t.Sb; ) t.Ra >>>= 8, t.Ra += t.oa[t.pa + t.bb] << gi - 8 >>> 0, ++t.bb, t.u -= 8;
B(t) && (t.h = 1, t.u = 0);
}
function dt(t, i) {
if (e(0 <= i), !t.h && i <= pi) {
var l = C(t) & di[i];
return t.u += i, lt(t), l;
}
return t.h = 1, t.u = 0;
}
function jt() {
this.b = this.Ca = this.I = 0, this.oa = [], this.pa = 0, this.Jd = [], this.Yc = 0, this.Zc = [], this.Ka = 0;
}
function N() {
this.Ra = 0, this.oa = [], this.h = this.u = this.bb = this.Sb = this.pa = 0;
}
function C(t) {
return t.Ra >>> (t.u & gi - 1) >>> 0;
}
function B(t) {
return e(t.bb <= t.Sb), t.h || t.bb == t.Sb && t.u > gi;
}
function T(t, i) {
t.u = i, t.h = B(t);
}
function J(t) {
t.u >= $i && (e(t.u >= $i), lt(t));
}
function Q(t) {
e(t != null && t.oa != null), t.pa < t.Zc ? (t.I = (t.oa[t.pa++] | t.I << 8) >>> 0, t.b += 8) : (e(t != null && t.oa != null), t.pa < t.Yc ? (t.b += 8, t.I = t.oa[t.pa++] | t.I << 8) : t.Ka ? t.b = 0 : (t.I <<= 8, t.b += 8, t.Ka = 1));
}
function et(t) {
return it(t, 1);
}
function nt(t, i) {
var l = t.Ca;
0 > t.b && Q(t);
var d = t.b, m = l * i >>> 8, b = (t.I >>> d > m) + 0;
for (b ? (l -= m, t.I -= m + 1 << d >>> 0) : l = m + 1, d = l, m = 0; 256 <= d; ) m += 8, d >>= 8;
return d = 7 ^ m + on[d], t.b -= d, t.Ca = (l << d) - 1, b;
}
function At(t, i, l) {
t[i + 0] = l >> 24 & 255, t[i + 1] = l >> 16 & 255, t[i + 2] = l >> 8 & 255, t[i + 3] = l >> 0 & 255;
}
function Nt(t, i) {
return t[i + 0] << 0 | t[i + 1] << 8;
}
function Ft(t, i) {
return Nt(t, i) | t[i + 2] << 16;
}
function _t(t, i) {
return Nt(t, i) | Nt(t, i + 2) << 16;
}
function zt(t, i) {
var l = 1 << i;
return e(t != null), e(0 < i), t.X = s(l), t.X == null ? 0 : (t.Mb = 32 - i, t.Xa = i, 1);
}
function ht(t, i) {
e(t != null), e(i != null), e(t.Xa == i.Xa), a(i.X, 0, t.X, 0, 1 << i.Xa);
}
function E() {
this.X = [], this.Xa = this.Mb = 0;
}
function Kt(t, i, l, d) {
e(l != null), e(d != null);
var m = l[0], b = d[0];
return m == 0 && (m = (t * b + i / 2) / i), b == 0 && (b = (i * m + t / 2) / t), 0 >= m || 0 >= b ? 0 : (l[0] = m, d[0] = b, 1);
}
function Et(t, i) {
return t + (1 << i) - 1 >>> i;
}
function Lt(t, i) {
return ((4278255360 & t) + (4278255360 & i) >>> 0 & 4278255360) + ((16711935 & t) + (16711935 & i) >>> 0 & 16711935) >>> 0;
}
function xt(t, i) {
z[i] = function(l, d, m, b, L, A, x) {
var I;
for (I = 0; I < L; ++I) {
var U = z[t](A[x + I - 1], m, b + I);
A[x + I] = Lt(l[d + I], U);
}
};
}
function It() {
this.ud = this.hd = this.jd = 0;
}
function kt(t, i) {
return ((4278124286 & (t ^ i)) >>> 1) + (t & i) >>> 0;
}
function qt(t) {
return 0 <= t && 256 > t ? t : 0 > t ? 0 : 255 < t ? 255 : void 0;
}
function Gt(t, i) {
return qt(t + (t - i + 0.5 >> 1));
}
function Qt(t, i, l) {
return Math.abs(i - l) - Math.abs(t - l);
}
function te(t, i, l, d, m, b, L) {
for (d = b[L - 1], l = 0; l < m; ++l) b[L + l] = d = Lt(t[i + l], d);
}
function ie(t, i, l, d, m) {
var b;
for (b = 0; b < l; ++b) {
var L = t[i + b], A = L >> 8 & 255, x = 16711935 & (x = (x = 16711935 & L) + ((A << 16) + A));
d[m + b] = (4278255360 & L) + x >>> 0;
}
}
function de(t, i) {
i.jd = t >> 0 & 255, i.hd = t >> 8 & 255, i.ud = t >> 16 & 255;
}
function Wt(t, i, l, d, m, b) {
var L;
for (L = 0; L < d; ++L) {
var A = i[l + L], x = A >>> 8, I = A, U = 255 & (U = (U = A >>> 16) + ((t.jd << 24 >> 24) * (x << 24 >> 24) >>> 5));
I = 255 & (I = (I = I + ((t.hd << 24 >> 24) * (x << 24 >> 24) >>> 5)) + ((t.ud << 24 >> 24) * (U << 24 >> 24) >>> 5)), m[b + L] = (4278255360 & A) + (U << 16) + I;
}
}
function ee(t, i, l, d, m) {
z[i] = function(b, L, A, x, I, U, K, Z, G) {
for (x = K; x < Z; ++x) for (K = 0; K < G; ++K) I[U++] = m(A[d(b[L++])]);
}, z[t] = function(b, L, A, x, I, U, K) {
var Z = 8 >> b.b, G = b.Ea, vt = b.K[0], at = b.w;
if (8 > Z) for (b = (1 << b.b) - 1, at = (1 << Z) - 1; L < A; ++L) {
var H, V = 0;
for (H = 0; H < G; ++H) H & b || (V = d(x[I++])), U[K++] = m(vt[V & at]), V >>= Z;
}
else z["VP8LMapColor" + l](x, I, vt, at, U, K, L, A, G);
};
}
function Ct(t, i, l, d, m) {
for (l = i + l; i < l; ) {
var b = t[i++];
d[m++] = b >> 16 & 255, d[m++] = b >> 8 & 255, d[m++] = b >> 0 & 255;
}
}
function Je(t, i, l, d, m) {
for (l = i + l; i < l; ) {
var b = t[i++];
d[m++] = b >> 16 & 255, d[m++] = b >> 8 & 255, d[m++] = b >> 0 & 255, d[m++] = b >> 24 & 255;
}
}
function se(t, i, l, d, m) {
for (l = i + l; i < l; ) {
var b = (L = t[i++]) >> 16 & 240 | L >> 12 & 15, L = L >> 0 & 240 | L >> 28 & 15;
d[m++] = b, d[m++] = L;
}
}
function _n(t, i, l, d, m) {
for (l = i + l; i < l; ) {
var b = (L = t[i++]) >> 16 & 248 | L >> 13 & 7, L = L >> 5 & 224 | L >> 3 & 31;
d[m++] = b, d[m++] = L;
}
}
function ge(t, i, l, d, m) {
for (l = i + l; i < l; ) {
var b = t[i++];
d[m++] = b >> 0 & 255, d[m++] = b >> 8 & 255, d[m++] = b >> 16 & 255;
}
}
function Le(t, i, l, d, m, b) {
if (b == 0) for (l = i + l; i < l; ) At(d, ((b = t[i++])[0] >> 24 | b[1] >> 8 & 65280 | b[2] << 8 & 16711680 | b[3] << 24) >>> 0), m += 32;
else a(d, m, t, i, l);
}
function Un(t, i) {
z[i][0] = z[t + "0"], z[i][1] = z[t + "1"], z[i][2] = z[t + "2"], z[i][3] = z[t + "3"], z[i][4] = z[t + "4"], z[i][5] = z[t + "5"], z[i][6] = z[t + "6"], z[i][7] = z[t + "7"], z[i][8] = z[t + "8"], z[i][9] = z[t + "9"], z[i][10] = z[t + "10"], z[i][11] = z[t + "11"], z[i][12] = z[t + "12"], z[i][13] = z[t + "13"], z[i][14] = z[t + "0"], z[i][15] = z[t + "0"];
}
function ue(t) {
return t == Ws || t == Vs || t == Wa || t == Gs;
}
function Or() {
this.eb = [], this.size = this.A = this.fb = 0;
}
function Ae() {
this.y = [], this.f = [], this.ea = [], this.F = [], this.Tc = this.Ed = this.Cd = this.Fd = this.lb = this.Db = this.Ab = this.fa = this.J = this.W = this.N = this.O = 0;
}
function Pn() {
this.Rd = this.height = this.width = this.S = 0, this.f = {}, this.f.RGBA = new Or(), this.f.kb = new Ae(), this.sd = null;
}
function nr() {
this.width = [0], this.height = [0], this.Pd = [0], this.Qd = [0], this.format = [0];
}
function xe() {
this.Id = this.fd = this.Md = this.hb = this.ib = this.da = this.bd = this.cd = this.j = this.v = this.Da = this.Sd = this.ob = 0;
}
function Jt(t) {
return alert("todo:WebPSamplerProcessPlane"), t.T;
}
function le(t, i) {
var l = t.T, d = i.ba.f.RGBA, m = d.eb, b = d.fb + t.ka * d.A, L = xn[i.ba.S], A = t.y, x = t.O, I = t.f, U = t.N, K = t.ea, Z = t.W, G = i.cc, vt = i.dc, at = i.Mc, H = i.Nc, V = t.ka, gt = t.ka + t.T, bt = t.U, mt = bt + 1 >> 1;
for (V == 0 ? L(A, x, null, null, I, U, K, Z, I, U, K, Z, m, b, null, null, bt) : (L(i.ec, i.fc, A, x, G, vt, at, H, I, U, K, Z, m, b - d.A, m, b, bt), ++l); V + 2 < gt; V += 2) G = I, vt = U, at = K, H = Z, U += t.Rc, Z += t.Rc, b += 2 * d.A, L(A, (x += 2 * t.fa) - t.fa, A, x, G, vt, at, H, I, U, K, Z, m, b - d.A, m, b, bt);
return x += t.fa, t.j + gt < t.o ? (a(i.ec, i.fc, A, x, bt), a(i.cc, i.dc, I, U, mt), a(i.Mc, i.Nc, K, Z, mt), l--) : 1 & gt || L(A, x, null, null, I, U, K, Z, I, U, K, Z, m, b + d.A, null, null, bt), l;
}
function Mr(t, i, l) {
var d = t.F, m = [t.J];
if (d != null) {
var b = t.U, L = i.ba.S, A = L == Ha || L == Wa;
i = i.ba.f.RGBA;
var x = [0], I = t.ka;
x[0] = t.T, t.Kb && (I == 0 ? --x[0] : (--I, m[0] -= t.width), t.j + t.ka + t.T == t.o && (x[0] = t.o - t.j - I));
var U = i.eb;
I = i.fb + I * i.A, t = ye(d, m[0], t.width, b, x, U, I + (A ? 0 : 3), i.A), e(l == x), t && ue(L) && Nn(U, I, A, b, x, i.A);
}
return 0;
}
function We(t) {
var i = t.ma, l = i.ba.S, d = 11 > l, m = l == za || l == Ua || l == Ha || l == Hs || l == 12 || ue(l);
if (i.memory = null, i.Ib = null, i.Jb = null, i.Nd = null, !Ki(i.Oa, t, m ? 11 : 12)) return 0;
if (m && ue(l) && yt(), t.da) alert("todo:use_scaling");
else {
if (d) {
if (i.Ib = Jt, t.Kb) {
if (l = t.U + 1 >> 1, i.memory = s(t.U + 2 * l), i.memory == null) return 0;
i.ec = i.memory, i.fc = 0, i.cc = i.ec, i.dc = i.fc + t.U, i.Mc = i.cc, i.Nc = i.dc + l, i.Ib = le, yt();
}
} else alert("todo:EmitYUV");
m && (i.Jb = Mr, d && X());
}
if (d && !Do) {
for (t = 0; 256 > t; ++t) ol[t] = 89858 * (t - 128) + Ga >> Va, cl[t] = -22014 * (t - 128) + Ga, ll[t] = -45773 * (t - 128), ul[t] = 113618 * (t - 128) + Ga >> Va;
for (t = aa; t < Xs; ++t) i = 76283 * (t - 16) + Ga >> Va, fl[t - aa] = dn(i, 255), hl[t - aa] = dn(i + 8 >> 4, 15);
Do = 1;
}
return 1;
}
function Hn(t) {
var i = t.ma, l = t.U, d = t.T;
return e(!(1 & t.ka)), 0 >= l || 0 >= d ? 0 : (l = i.Ib(t, i), i.Jb != null && i.Jb(t, i, l), i.Dc += l, 1);
}
function Wn(t) {
t.ma.memory = null;
}
function Tt(t, i, l, d) {
return dt(t, 8) != 47 ? 0 : (i[0] = dt(t, 14) + 1, l[0] = dt(t, 14) + 1, d[0] = dt(t, 1), dt(t, 3) != 0 ? 0 : !t.h);
}
function kn(t, i) {
if (4 > t) return t + 1;
var l = t - 2 >> 1;
return (2 + (1 & t) << l) + dt(i, l) + 1;
}
function Vn(t, i) {
return 120 < i ? i - 120 : 1 <= (l = ((l = Ju[i - 1]) >> 4) * t + (8 - (15 & l))) ? l : 1;
var l;
}
function an(t, i, l) {
var d = C(l), m = t[i += 255 & d].g - 8;
return 0 < m && (T(l, l.u + 8), d = C(l), i += t[i].value, i += d & (1 << m) - 1), T(l, l.u + t[i].g), t[i].value;
}
function De(t, i, l) {
return l.g += t.g, l.value += t.value << i >>> 0, e(8 >= l.g), t.g;
}
function Me(t, i, l) {
var d = t.xc;
return e((i = d == 0 ? 0 : t.vc[t.md * (l >> d) + (i >> d)]) < t.Wb), t.Ya[i];
}
function hn(t, i, l, d) {
var m = t.ab, b = t.c * i, L = t.C;
i = L + i;
var A = l, x = d;
for (d = t.Ta, l = t.Ua; 0 < m--; ) {
var I = t.gc[m], U = L, K = i, Z = A, G = x, vt = (x = d, A = l, I.Ea);
switch (e(U < K), e(K <= I.nc), I.hc) {
case 2:
Ma(Z, G, (K - U) * vt, x, A);
break;
case 0:
var at = U, H = K, V = x, gt = A, bt = (Pt = I).Ea;
at == 0 && (zs(Z, G, null, null, 1, V, gt), te(Z, G + 1, 0, 0, bt - 1, V, gt + 1), G += bt, gt += bt, ++at);
for (var mt = 1 << Pt.b, Mt = mt - 1, St = Et(bt, Pt.b), Rt = Pt.K, Pt = Pt.w + (at >> Pt.b) * St; at < H; ) {
var oe = Rt, ce = Pt, ae = 1;
for (Qi(Z, G, V, gt - bt, 1, V, gt); ae < bt; ) {
var ne = (ae & ~Mt) + mt;
ne > bt && (ne = bt), (0, vr[oe[ce++] >> 8 & 15])(Z, G + +ae, V, gt + ae - bt, ne - ae, V, gt + ae), ae = ne;
}
G += bt, gt += bt, ++at & Mt || (Pt += St);
}
K != I.nc && a(x, A - vt, x, A + (K - U - 1) * vt, vt);
break;
case 1:
for (vt = Z, H = G, bt = (Z = I.Ea) - (gt = Z & ~(V = (G = 1 << I.b) - 1)), at = Et(Z, I.b), mt = I.K, I = I.w + (U >> I.b) * at; U < K; ) {
for (Mt = mt, St = I, Rt = new It(), Pt = H + gt, oe = H + Z; H < Pt; ) de(Mt[St++], Rt), Tr(Rt, vt, H, G, x, A), H += G, A += G;
H < oe && (de(Mt[St++], Rt), Tr(Rt, vt, H, bt, x, A), H += bt, A += bt), ++U & V || (I += at);
}
break;
case 3:
if (Z == x && G == A && 0 < I.b) {
for (H = x, Z = vt = A + (K - U) * vt - (gt = (K - U) * Et(I.Ea, I.b)), G = x, V = A, at = [], gt = (bt = gt) - 1; 0 <= gt; --gt) at[gt] = G[V + gt];
for (gt = bt - 1; 0 <= gt; --gt) H[Z + gt] = at[gt];
yn(I, U, K, x, vt, x, A);
} else yn(I, U, K, Z, G, x, A);
}
A = d, x = l;
}
x != l && a(d, l, A, x, b);
}
function Kr(t, i) {
var l = t.V, d = t.Ba + t.c * t.C, m = i - t.C;
if (e(i <= t.l.o), e(16 >= m), 0 < m) {
var b = t.l, L = t.Ta, A = t.Ua, x = b.width;
if (hn(t, m, l, d), m = A = [A], e((l = t.C) < (d = i)), e(b.v < b.va), d > b.o && (d = b.o), l < b.j) {
var I = b.j - l;
l = b.j, m[0] += I * x;
}
if (l >= d ? l = 0 : (m[0] += 4 * b.v, b.ka = l - b.j, b.U = b.va - b.v, b.T = d - l, l = 1), l) {
if (A = A[0], 11 > (l = t.ca).S) {
var U = l.f.RGBA, K = (d = l.S, m = b.U, b = b.T, I = U.eb, U.A), Z = b;
for (U = U.fb + t.Ma * U.A; 0 < Z--; ) {
var G = L, vt = A, at = m, H = I, V = U;
switch (d) {
case Ta:
un(G, vt, at, H, V);
break;
case za:
en(G, vt, at, H, V);
break;
case Ws:
en(G, vt, at, H, V), Nn(H, V, 0, at, 1, 0);
break;
case Fo:
or(G, vt, at, H, V);
break;
case Ua:
Le(G, vt, at, H, V, 1);
break;
case Vs:
Le(G, vt, at, H, V, 1), Nn(H, V, 0, at, 1, 0);
break;
case Ha:
Le(G, vt, at, H, V, 0);
break;
case Wa:
Le(G, vt, at, H, V, 0), Nn(H, V, 1, at, 1, 0);
break;
case Hs:
br(G, vt, at, H, V);
break;
case Gs:
br(G, vt, at, H, V), be(H, V, at, 1, 0);
break;
case Io:
sr(G, vt, at, H, V);
break;
default:
e(0);
}
A += x, U += K;
}
t.Ma += b;
} else alert("todo:EmitRescaledRowsYUVA");
e(t.Ma <= l.height);
}
}
t.C = i, e(t.C <= t.i);
}
function rr(t) {
var i;
if (0 < t.ua) return 0;
for (i = 0; i < t.Wb; ++i) {
var l = t.Ya[i].G, d = t.Ya[i].H;
if (0 < l[1][d[1] + 0].g || 0 < l[2][d[2] + 0].g || 0 < l[3][d[3] + 0].g) return 0;
}
return 1;
}
function Fn(t, i, l, d, m, b) {
if (t.Z != 0) {
var L = t.qd, A = t.rd;
for (e(Nr[t.Z] != null); i < l; ++i) Nr[t.Z](L, A, d, m, d, m, b), L = d, A = m, m += b;
t.qd = L, t.rd = A;
}
}
function In(t, i) {
var l = t.l.ma, d = l.Z == 0 || l.Z == 1 ? t.l.j : t.C;
if (d = t.C < d ? d : t.C, e(i <= t.l.o), i > d) {
var m = t.l.width, b = l.ca, L = l.tb + m * d, A = t.V, x = t.Ba + t.c * d, I = t.gc;
e(t.ab == 1), e(I[0].hc == 3), Ba(I[0], d, i, A, x, b, L), Fn(l, d, i, b, L, m);
}
t.C = t.Ma = i;
}
function Cn(t, i, l, d, m, b, L) {
var A = t.$ / d, x = t.$ % d, I = t.m, U = t.s, K = l + t.$, Z = K;
m = l + d * m;
var G = l + d * b, vt = 280 + U.ua, at = t.Pb ? A : 16777216, H = 0 < U.ua ? U.Wa : null, V = U.wc, gt = K < G ? Me(U, x, A) : null;
e(t.C < b), e(G <= m);
var bt = !1;
t: for (; ; ) {
for (; bt || K < G; ) {
var mt = 0;
if (A >= at) {
var Mt = K - l;
e((at = t).Pb), at.wd = at.m, at.xd = Mt, 0 < at.s.ua && ht(at.s.Wa, at.s.vb), at = A + Xu;
}
if (x & V || (gt = Me(U, x, A)), e(gt != null), gt.Qb && (i[K] = gt.qb, bt = !0), !bt) if (J(I), gt.jc) {
mt = I, Mt = i;
var St = K, Rt = gt.pd[C(mt) & Ve - 1];
e(gt.jc), 256 > Rt.g ? (T(mt, mt.u + Rt.g), Mt[St] = Rt.value, mt = 0) : (T(mt, mt.u + Rt.g - 256), e(256 <= Rt.value), mt = Rt.value), mt == 0 && (bt = !0);
} else mt = an(gt.G[0], gt.H[0], I);
if (I.h) break;
if (bt || 256 > mt) {
if (!bt) if (gt.nd) i[K] = (gt.qb | mt << 8) >>> 0;
else {
if (J(I), bt = an(gt.G[1], gt.H[1], I), J(I), Mt = an(gt.G[2], gt.H[2], I), St = an(gt.G[3], gt.H[3], I), I.h) break;
i[K] = (St << 24 | bt << 16 | mt << 8 | Mt) >>> 0;
}
if (bt = !1, ++K, ++x >= d && (x = 0, ++A, L != null && A <= b && !(A % 16) && L(t, A), H != null)) for (; Z < K; ) mt = i[Z++], H.X[(506832829 * mt & 4294967295) >>> H.Mb] = mt;
} else if (280 > mt) {
if (mt = kn(mt - 256, I), Mt = an(gt.G[4], gt.H[4], I), J(I), Mt = Vn(d, Mt = kn(Mt, I)), I.h) break;
if (K - l < Mt || m - K < mt) break t;
for (St = 0; St < mt; ++St) i[K + St] = i[K + St - Mt];
for (K += mt, x += mt; x >= d; ) x -= d, ++A, L != null && A <= b && !(A % 16) && L(t, A);
if (e(K <= m), x & V && (gt = Me(U, x, A)), H != null) for (; Z < K; ) mt = i[Z++], H.X[(506832829 * mt & 4294967295) >>> H.Mb] = mt;
} else {
if (!(mt < vt)) break t;
for (bt = mt - 280, e(H != null); Z < K; ) mt = i[Z++], H.X[(506832829 * mt & 4294967295) >>> H.Mb] = mt;
mt = K, e(!(bt >>> (Mt = H).Xa)), i[mt] = Mt.X[bt], bt = !0;
}
bt || e(I.h == B(I));
}
if (t.Pb && I.h && K < m) e(t.m.h), t.a = 5, t.m = t.wd, t.$ = t.xd, 0 < t.s.ua && ht(t.s.vb, t.s.Wa);
else {
if (I.h) break t;
L != null && L(t, A > b ? b : A), t.a = 0, t.$ = K - l;
}
return 1;
}
return t.a = 3, 0;
}
function Gn(t) {
e(t != null), t.vc = null, t.yc = null, t.Ya = null;
var i = t.Wa;
i != null && (i.X = null), t.vb = null, e(t != null);
}
function bn() {
var t = new Ts();
return t == null ? null : (t.a = 0, t.xb = Oo, Un("Predictor", "VP8LPredictors"), Un("Predictor", "VP8LPredictors_C"), Un("PredictorAdd", "VP8LPredictorsAdd"), Un("PredictorAdd", "VP8LPredictorsAdd_C"), Ma = ie, Tr = Wt, un = Ct, en = Je, br = se, sr = _n, or = ge, z.VP8LMapColor32b = mi, z.VP8LMapColor8b = Ea, t);
}
function Jn(t, i, l, d, m) {
var b = 1, L = [t], A = [i], x = d.m, I = d.s, U = null, K = 0;
t: for (; ; ) {
if (l) for (; b && dt(x, 1); ) {
var Z = L, G = A, vt = d, at = 1, H = vt.m, V = vt.gc[vt.ab], gt = dt(H, 2);
if (vt.Oc & 1 << gt) b = 0;
else {
switch (vt.Oc |= 1 << gt, V.hc = gt, V.Ea = Z[0], V.nc = G[0], V.K = [null], ++vt.ab, e(4 >= vt.ab), gt) {
case 0:
case 1:
V.b = dt(H, 3) + 2, at = Jn(Et(V.Ea, V.b), Et(V.nc, V.b), 0, vt, V.K), V.K = V.K[0];
break;
case 3:
var bt, mt = dt(H, 8) + 1, Mt = 16 < mt ? 0 : 4 < mt ? 1 : 2 < mt ? 2 : 3;
if (Z[0] = Et(V.Ea, Mt), V.b = Mt, bt = at = Jn(mt, 1, 0, vt, V.K)) {
var St, Rt = mt, Pt = V, oe = 1 << (8 >> Pt.b), ce = s(oe);
if (ce == null) bt = 0;
else {
var ae = Pt.K[0], ne = Pt.w;
for (ce[0] = Pt.K[0][0], St = 1; St < 1 * Rt; ++St) ce[St] = Lt(ae[ne + St], ce[St - 1]);
for (; St < 4 * oe; ++St) ce[St] = 0;
Pt.K[0] = null, Pt.K[0] = ce, bt = 1;
}
}
at = bt;
break;
case 2:
break;
default:
e(0);
}
b = at;
}
}
if (L = L[0], A = A[0], b && dt(x, 1) && !(b = 1 <= (K = dt(x, 4)) && 11 >= K)) {
d.a = 3;
break t;
}
var me;
if (me = b) e: {
var pe, $t, Ee, ln = d, qe = L, cn = A, fe = K, gn = l, mn = ln.m, ze = ln.s, Ge = [null], rn = 1, Sn = 0, Zn = Yu[fe];
n: for (; ; ) {
if (gn && dt(mn, 1)) {
var Ue = dt(mn, 3) + 2, fr = Et(qe, Ue), Vr = Et(cn, Ue), Li = fr * Vr;
if (!Jn(fr, Vr, 0, ln, Ge)) break n;
for (Ge = Ge[0], ze.xc = Ue, pe = 0; pe < Li; ++pe) {
var Ar = Ge[pe] >> 8 & 65535;
Ge[pe] = Ar, Ar >= rn && (rn = Ar + 1);
}
}
if (mn.h) break n;
for ($t = 0; 5 > $t; ++$t) {
var _e = Co[$t];
!$t && 0 < fe && (_e += 1 << fe), Sn < _e && (Sn = _e);
}
var Ks = c(rn * Zn, k), zo = rn, Uo = c(zo, D);
if (Uo == null) var Ya = null;
else e(65536 >= zo), Ya = Uo;
var sa = s(Sn);
if (Ya == null || sa == null || Ks == null) {
ln.a = 1;
break n;
}
var Xa = Ks;
for (pe = Ee = 0; pe < rn; ++pe) {
var En = Ya[pe], Ni = En.G, Ai = En.H, Ho = 0, Ka = 1, Wo = 0;
for ($t = 0; 5 > $t; ++$t) {
_e = Co[$t], Ni[$t] = Xa, Ai[$t] = Ee, !$t && 0 < fe && (_e += 1 << fe);
i: {
var Za, Zs = _e, $a = ln, oa = sa, gl = Xa, ml = Ee, $s = 0, xr = $a.m, vl = dt(xr, 1);
if (u(oa, 0, 0, Zs), vl) {
var bl = dt(xr, 1) + 1, yl = dt(xr, 1), Vo = dt(xr, yl == 0 ? 1 : 8);
oa[Vo] = 1, bl == 2 && (oa[Vo = dt(xr, 8)] = 1);
var Qa = 1;
} else {
var Go = s(19), Jo = dt(xr, 4) + 4;
if (19 < Jo) {
$a.a = 3;
var ts = 0;
break i;
}
for (Za = 0; Za < Jo; ++Za) Go[Gu[Za]] = dt(xr, 3);
var Qs = void 0, ua = void 0, Yo = $a, wl = Go, es = Zs, Xo = oa, to = 0, Sr = Yo.m, Ko = 8, Zo = c(128, k);
r: for (; P(Zo, 0, 7, wl, 19); ) {
if (dt(Sr, 1)) {
var Ll = 2 + 2 * dt(Sr, 3);
if ((Qs = 2 + dt(Sr, Ll)) > es) break r;
} else Qs = es;
for (ua = 0; ua < es && Qs--; ) {
J(Sr);
var $o = Zo[0 + (127 & C(Sr))];
T(Sr, Sr.u + $o.g);
var xi = $o.value;
if (16 > xi) Xo[ua++] = xi, xi != 0 && (Ko = xi);
else {
var Nl = xi == 16, Qo = xi - 16, Al = Wu[Qo], tu = dt(Sr, Hu[Qo]) + Al;
if (ua + tu > es) break r;
for (var xl = Nl ? Ko : 0; 0 < tu--; ) Xo[ua++] = xl;
}
}
to = 1;
break r;
}
to || (Yo.a = 3), Qa = to;
}
(Qa = Qa && !xr.h) && ($s = P(gl, ml, 8, oa, Zs)), Qa && $s != 0 ? ts = $s : ($a.a = 3, ts = 0);
}
if (ts == 0) break n;
if (Ka && Vu[$t] == 1 && (Ka = Xa[Ee].g == 0), Ho += Xa[Ee].g, Ee += ts, 3 >= $t) {
var la, eo = sa[0];
for (la = 1; la < _e; ++la) sa[la] > eo && (eo = sa[la]);
Wo += eo;
}
}
if (En.nd = Ka, En.Qb = 0, Ka && (En.qb = (Ni[3][Ai[3] + 0].value << 24 | Ni[1][Ai[1] + 0].value << 16 | Ni[2][Ai[2] + 0].value) >>> 0, Ho == 0 && 256 > Ni[0][Ai[0] + 0].value && (En.Qb = 1, En.qb += Ni[0][Ai[0] + 0].value << 8)), En.jc = !En.Qb && 6 > Wo, En.jc) {
var ns, hr = En;
for (ns = 0; ns < Ve; ++ns) {
var _r = ns, Pr = hr.pd[_r], rs = hr.G[0][hr.H[0] + _r];
256 <= rs.value ? (Pr.g = rs.g + 256, Pr.value = rs.value) : (Pr.g = 0, Pr.value = 0, _r >>= De(rs, 8, Pr), _r >>= De(hr.G[1][hr.H[1] + _r], 16, Pr), _r >>= De(hr.G[2][hr.H[2] + _r], 0, Pr), De(hr.G[3][hr.H[3] + _r], 24, Pr));
}
}
}
ze.vc = Ge, ze.Wb = rn, ze.Ya = Ya, ze.yc = Ks, me = 1;
break e;
}
me = 0;
}
if (!(b = me)) {
d.a = 3;
break t;
}
if (0 < K) {
if (I.ua = 1 << K, !zt(I.Wa, K)) {
d.a = 1, b = 0;
break t;
}
} else I.ua = 0;
var no = d, eu = L, Sl = A, ro = no.s, io = ro.xc;
if (no.c = eu, no.i = Sl, ro.md = Et(eu, io), ro.wc = io == 0 ? -1 : (1 << io) - 1, l) {
d.xb = nl;
break t;
}
if ((U = s(L * A)) == null) {
d.a = 1, b = 0;
break t;
}
b = (b = Cn(d, U, 0, L, A, A, null)) && !x.h;
break t;
}
return b ? (m != null ? m[0] = U : (e(U == null), e(l)), d.$ = 0, l || Gn(I)) : Gn(I), b;
}
function Br(t, i) {
var l = t.c * t.i, d = l + i + 16 * i;
return e(t.c <= i), t.V = s(d), t.V == null ? (t.Ta = null, t.Ua = 0, t.a = 1, 0) : (t.Ta = t.V, t.Ua = t.Ba + l + i, 1);
}
function Zr(t, i) {
var l = t.C, d = i - l, m = t.V, b = t.Ba + t.c * l;
for (e(i <= t.l.o); 0 < d; ) {
var L = 16 < d ? 16 : d, A = t.l.ma, x = t.l.width, I = x * L, U = A.ca, K = A.tb + x * l, Z = t.Ta, G = t.Ua;
hn(t, L, m, b), Ie(Z, G, U, K, I), Fn(A, l, l + L, U, K, x), d -= L, m += L * t.c, l += L;
}
e(l == i), t.C = t.Ma = i;
}
function $r() {
this.ub = this.yd = this.td = this.Rb = 0;
}
function Qr() {
this.Kd = this.Ld = this.Ud = this.Td = this.i = this.c = 0;
}
function ti() {
this.Fb = this.Bb = this.Cb = 0, this.Zb = s(4), this.Lb = s(4);
}
function pa() {
this.Yb = function() {
var t = [];
return function i(l, d, m) {
for (var b = m[d], L = 0; L < b && (l.push(m.length > d + 1 ? [] : 0), !(m.length < d + 1)); L++) i(l[L], d + 1, m);
}(t, 0, [3, 11]), t;
}();
}
function vs() {
this.jb = s(3), this.Wc = f([4, 8], pa), this.Xc = f([4, 17], pa);
}
function bs() {
this.Pc = this.wb = this.Tb = this.zd = 0, this.vd = new s(4), this.od = new s(4);
}
function ei() {
this.ld = this.La = this.dd = this.tc = 0;
}
function ga() {
this.Na = this.la = 0;
}
function ys() {
this.Sc = [0, 0], this.Eb = [0, 0], this.Qc = [0, 0], this.ia = this.lc = 0;
}
function Mi() {
this.ad = s(384), this.Za = 0, this.Ob = s(16), this.$b = this.Ad = this.ia = this.Gc = this.Hc = this.Dd = 0;
}
function ws() {
this.uc = this.M = this.Nb = 0, this.wa = Array(new ei()), this.Y = 0, this.ya = Array(new Mi()), this.aa = 0, this.l = new ni();
}
function ma() {
this.y = s(16), this.f = s(8), this.ea = s(8);
}
function Ls() {
this.cb = this.a = 0, this.sc = "", this.m = new jt(), this.Od = new $r(), this.Kc = new Qr(), this.ed = new bs(), this.Qa = new ti(), this.Ic = this.$c = this.Aa = 0, this.D = new ws(), this.Xb = this.Va = this.Hb = this.zb = this.yb = this.Ub = this.za = 0, this.Jc = c(8, jt), this.ia = 0, this.pb = c(4, ys), this.Pa = new vs(), this.Bd = this.kc = 0, this.Ac = [], this.Bc = 0, this.zc = [0, 0, 0, 0], this.Gd = Array(new ma()), this.Hd = 0, this.rb = Array(new ga()), this.sb = 0, this.wa = Array(new ei()), this.Y = 0, this.oc = [], this.pc = 0, this.sa = [], this.ta = 0, this.qa = [], this.ra = 0, this.Ha = [], this.B = this.R = this.Ia = 0, this.Ec = [], this.M = this.ja = this.Vb = this.Fc = 0, this.ya = Array(new Mi()), this.L = this.aa = 0, this.gd = f([4, 2], ei), this.ga = null, this.Fa = [], this.Cc = this.qc = this.P = 0, this.Gb = [], this.Uc = 0, this.mb = [], this.nb = 0, this.rc = [], this.Ga = this.Vc = 0;
}
function ni() {
this.T = this.U = this.ka = this.height = this.width = 0, this.y = [], this.f = [], this.ea = [], this.Rc = this.fa = this.W = this.N = this.O = 0, this.ma = "void", this.put = "VP8IoPutHook", this.ac = "VP8IoSetupHook", this.bc = "VP8IoTeardownHook", this.ha = this.Kb = 0, this.data = [], this.hb = this.ib = this.da = this.o = this.j = this.va = this.v = this.Da = this.ob = this.w = 0, this.F = [], this.J = 0;
}
function Ns() {
var t = new Ls();
return t != null && (t.a = 0, t.sc = "OK", t.cb = 0, t.Xb = 0, ia || (ia = ya)), t;
}
function ke(t, i, l) {
return t.a == 0 && (t.a = i, t.sc = l, t.cb = 0), 0;
}
function va(t, i, l) {
return 3 <= l && t[i + 0] == 157 && t[i + 1] == 1 && t[i + 2] == 42;
}
function ba(t, i) {
if (t == null) return 0;
if (t.a = 0, t.sc = "OK", i == null) return ke(t, 2, "null VP8Io passed to VP8GetHeaders()");
var l = i.data, d = i.w, m = i.ha;
if (4 > m) return ke(t, 7, "Truncated header.");
var b = l[d + 0] | l[d + 1] << 8 | l[d + 2] << 16, L = t.Od;
if (L.Rb = !(1 & b), L.td = b >> 1 & 7, L.yd = b >> 4 & 1, L.ub = b >> 5, 3 < L.td) return ke(t, 3, "Incorrect keyframe parameters.");
if (!L.yd) return ke(t, 4, "Frame not displayable.");
d += 3, m -= 3;
var A = t.Kc;
if (L.Rb) {
if (7 > m) return ke(t, 7, "cannot parse picture header");
if (!va(l, d, m)) return ke(t, 3, "Bad code word");
A.c = 16383 & (l[d + 4] << 8 | l[d + 3]), A.Td = l[d + 4] >> 6, A.i = 16383 & (l[d + 6] << 8 | l[d + 5]), A.Ud = l[d + 6] >> 6, d += 7, m -= 7, t.za = A.c + 15 >> 4, t.Ub = A.i + 15 >> 4, i.width = A.c, i.height = A.i, i.Da = 0, i.j = 0, i.v = 0, i.va = i.width, i.o = i.height, i.da = 0, i.ib = i.width, i.hb = i.height, i.U = i.width, i.T = i.height, u((b = t.Pa).jb, 0, 255, b.jb.length), e((b = t.Qa) != null), b.Cb = 0, b.Bb = 0, b.Fb = 1, u(b.Zb, 0, 0, b.Zb.length), u(b.Lb, 0, 0, b.Lb);
}
if (L.ub > m) return ke(t, 7, "bad partition length");
ot(b = t.m, l, d, L.ub), d += L.ub, m -= L.ub, L.Rb && (A.Ld = et(b), A.Kd = et(b)), A = t.Qa;
var x, I = t.Pa;
if (e(b != null), e(A != null), A.Cb = et(b), A.Cb) {
if (A.Bb = et(b), et(b)) {
for (A.Fb = et(b), x = 0; 4 > x; ++x) A.Zb[x] = et(b) ? ft(b, 7) : 0;
for (x = 0; 4 > x; ++x) A.Lb[x] = et(b) ? ft(b, 6) : 0;
}
if (A.Bb) for (x = 0; 3 > x; ++x) I.jb[x] = et(b) ? it(b, 8) : 255;
} else A.Bb = 0;
if (b.Ka) return ke(t, 3, "cannot parse segment header");
if ((A = t.ed).zd = et(b), A.Tb = it(b, 6), A.wb = it(b, 3), A.Pc = et(b), A.Pc && et(b)) {
for (I = 0; 4 > I; ++I) et(b) && (A.vd[I] = ft(b, 6));
for (I = 0; 4 > I; ++I) et(b) && (A.od[I] = ft(b, 6));
}
if (t.L = A.Tb == 0 ? 0 : A.zd ? 1 : 2, b.Ka) return ke(t, 3, "cannot parse filter header");
var U = m;
if (m = x = d, d = x + U, A = U, t.Xb = (1 << it(t.m, 2)) - 1, U < 3 * (I = t.Xb)) l = 7;
else {
for (x += 3 * I, A -= 3 * I, U = 0; U < I; ++U) {
var K = l[m + 0] | l[m + 1] << 8 | l[m + 2] << 16;
K > A && (K = A), ot(t.Jc[+U], l, x, K), x += K, A -= K, m += 3;
}
ot(t.Jc[+I], l, x, A), l = x < d ? 0 : 5;
}
if (l != 0) return ke(t, l, "cannot parse partitions");
for (l = it(x = t.m, 7), m = et(x) ? ft(x, 4) : 0, d = et(x) ? ft(x, 4) : 0, A = et(x) ? ft(x, 4) : 0, I = et(x) ? ft(x, 4) : 0, x = et(x) ? ft(x, 4) : 0, U = t.Qa, K = 0; 4 > K; ++K) {
if (U.Cb) {
var Z = U.Zb[K];
U.Fb || (Z += l);
} else {
if (0 < K) {
t.pb[K] = t.pb[0];
continue;
}
Z = l;
}
var G = t.pb[K];
G.Sc[0] = Js[dn(Z + m, 127)], G.Sc[1] = Ys[dn(Z + 0, 127)], G.Eb[0] = 2 * Js[dn(Z + d, 127)], G.Eb[1] = 101581 * Ys[dn(Z + A, 127)] >> 16, 8 > G.Eb[1] && (G.Eb[1] = 8), G.Qc[0] = Js[dn(Z + I, 117)], G.Qc[1] = Ys[dn(Z + x, 127)], G.lc = Z + x;
}
if (!L.Rb) return ke(t, 4, "Not a key frame.");
for (et(b), L = t.Pa, l = 0; 4 > l; ++l) {
for (m = 0; 8 > m; ++m) for (d = 0; 3 > d; ++d) for (A = 0; 11 > A; ++A) I = nt(b, tl[l][m][d][A]) ? it(b, 8) : $u[l][m][d][A], L.Wc[l][m].Yb[d][A] = I;
for (m = 0; 17 > m; ++m) L.Xc[l][m] = L.Wc[l][el[m]];
}
return t.kc = et(b), t.kc && (t.Bd = it(b, 8)), t.cb = 1;
}
function ya(t, i, l, d, m, b, L) {
var A = i[m].Yb[l];
for (l = 0; 16 > m; ++m) {
if (!nt(t, A[l + 0])) return m;
for (; !nt(t, A[l + 1]); ) if (A = i[++m].Yb[0], l = 0, m == 16) return 16;
var x = i[m + 1].Yb;
if (nt(t, A[l + 2])) {
var I = t, U = 0;
if (nt(I, (Z = A)[(K = l) + 3])) if (nt(I, Z[K + 6])) {
for (A = 0, K = 2 * (U = nt(I, Z[K + 8])) + (Z = nt(I, Z[K + 9 + U])), U = 0, Z = Ku[K]; Z[A]; ++A) U += U + nt(I, Z[A]);
U += 3 + (8 << K);
} else nt(I, Z[K + 7]) ? (U = 7 + 2 * nt(I, 165), U += nt(I, 145)) : U = 5 + nt(I, 159);
else U = nt(I, Z[K + 4]) ? 3 + nt(I, Z[K + 5]) : 2;
A = x[2];
} else U = 1, A = x[1];
x = L + Zu[m], 0 > (I = t).b && Q(I);
var K, Z = I.b, G = (K = I.Ca >> 1) - (I.I >> Z) >> 31;
--I.b, I.Ca += G, I.Ca |= 1, I.I -= (K + 1 & G) << Z, b[x] = ((U ^ G) - G) * d[(0 < m) + 0];
}
return 16;
}
function Bi(t) {
var i = t.rb[t.sb - 1];
i.la = 0, i.Na = 0, u(t.zc, 0, 0, t.zc.length), t.ja = 0;
}
function As(t, i) {
if (t == null) return 0;
if (i == null) return ke(t, 2, "NULL VP8Io parameter in VP8Decode().");
if (!t.cb && !ba(t, i)) return 0;
if (e(t.cb), i.ac == null || i.ac(i)) {
i.ob && (t.L = 0);
var l = Ja[t.L];
if (t.L == 2 ? (t.yb = 0, t.zb = 0) : (t.yb = i.v - l >> 4, t.zb = i.j - l >> 4, 0 > t.yb && (t.yb = 0), 0 > t.zb && (t.zb = 0)), t.Va = i.o + 15 + l >> 4, t.Hb = i.va + 15 + l >> 4, t.Hb > t.za && (t.Hb = t.za), t.Va > t.Ub && (t.Va = t.Ub), 0 < t.L) {
var d = t.ed;
for (l = 0; 4 > l; ++l) {
var m;
if (t.Qa.Cb) {
var b = t.Qa.Lb[l];
t.Qa.Fb || (b += d.Tb);
} else b = d.Tb;
for (m = 0; 1 >= m; ++m) {
var L = t.gd[l][m], A = b;
if (d.Pc && (A += d.vd[0], m && (A += d.od[0])), 0 < (A = 0 > A ? 0 : 63 < A ? 63 : A)) {
var x = A;
0 < d.wb && (x = 4 < d.wb ? x >> 2 : x >> 1) > 9 - d.wb && (x = 9 - d.wb), 1 > x && (x = 1), L.dd = x, L.tc = 2 * A + x, L.ld = 40 <= A ? 2 : 15 <= A ? 1 : 0;
} else L.tc = 0;
L.La = m;
}
}
}
l = 0;
} else ke(t, 6, "Frame setup failed"), l = t.a;
if (l = l == 0) {
if (l) {
t.$c = 0, 0 < t.Aa || (t.Ic = pl);
t: {
l = t.Ic, d = 4 * (x = t.za);
var I = 32 * x, U = x + 1, K = 0 < t.L ? x * (0 < t.Aa ? 2 : 1) : 0, Z = (t.Aa == 2 ? 2 : 1) * x;
if ((L = d + 832 + (m = 3 * (16 * l + Ja[t.L]) / 2 * I) + (b = t.Fa != null && 0 < t.Fa.length ? t.Kc.c * t.Kc.i : 0)) != L) l = 0;
else {
if (L > t.Vb) {
if (t.Vb = 0, t.Ec = s(L), t.Fc = 0, t.Ec == null) {
l = ke(t, 1, "no memory during frame initialization.");
break t;
}
t.Vb = L;
}
L = t.Ec, A = t.Fc, t.Ac = L, t.Bc = A, A += d, t.Gd = c(I, ma), t.Hd = 0, t.rb = c(U + 1, ga), t.sb = 1, t.wa = K ? c(K, ei) : null, t.Y = 0, t.D.Nb = 0, t.D.wa = t.wa, t.D.Y = t.Y, 0 < t.Aa && (t.D.Y += x), e(!0), t.oc = L, t.pc = A, A += 832, t.ya = c(Z, Mi), t.aa = 0, t.D.ya = t.ya, t.D.aa = t.aa, t.Aa == 2 && (t.D.aa += x), t.R = 16 * x, t.B = 8 * x, x = (I = Ja[t.L]) * t.R, I = I / 2 * t.B, t.sa = L, t.ta = A + x, t.qa = t.sa, t.ra = t.ta + 16 * l * t.R + I, t.Ha = t.qa, t.Ia = t.ra + 8 * l * t.B + I, t.$c = 0, A += m, t.mb = b ? L : null, t.nb = b ? A : null, e(A + b <= t.Fc + t.Vb), Bi(t), u(t.Ac, t.Bc, 0, d), l = 1;
}
}
if (l) {
if (i.ka = 0, i.y = t.sa, i.O = t.ta, i.f = t.qa, i.N = t.ra, i.ea = t.Ha, i.Vd = t.Ia, i.fa = t.R, i.Rc = t.B, i.F = null, i.J = 0, !Da) {
for (l = -255; 255 >= l; ++l) Re[255 + l] = 0 > l ? -l : l;
for (l = -1020; 1020 >= l; ++l) lr[1020 + l] = -128 > l ? -128 : 127 < l ? 127 : l;
for (l = -112; 112 >= l; ++l) ra[112 + l] = -16 > l ? -16 : 15 < l ? 15 : l;
for (l = -255; 510 >= l; ++l) wi[255 + l] = 0 > l ? 0 : 255 < l ? 255 : l;
Da = 1;
}
vi = _s, ur = xs, ta = La, nn = Ss, wn = Na, Fe = wa, bi = zi, qa = Dr, ea = Rs, zr = Ui, Ur = Ds, yr = ui, Hr = Hi, yi = Ca, Wr = Ia, wr = Xn, na = ar, Ln = qs, Bn[0] = Yn, Bn[1] = Ps, Bn[2] = Cs, Bn[3] = js, Bn[4] = Sa, Bn[5] = si, Bn[6] = _a, Bn[7] = Di, Bn[8] = Ms, Bn[9] = Os, Lr[0] = Aa, Lr[1] = Fs, Lr[2] = ir, Lr[3] = ii, Lr[4] = Ye, Lr[5] = Is, Lr[6] = xa, cr[0] = pr, cr[1] = ks, cr[2] = Bs, cr[3] = Ri, cr[4] = qr, cr[5] = Es, cr[6] = Ti, l = 1;
} else l = 0;
}
l && (l = function(G, vt) {
for (G.M = 0; G.M < G.Va; ++G.M) {
var at, H = G.Jc[G.M & G.Xb], V = G.m, gt = G;
for (at = 0; at < gt.za; ++at) {
var bt = V, mt = gt, Mt = mt.Ac, St = mt.Bc + 4 * at, Rt = mt.zc, Pt = mt.ya[mt.aa + at];
if (mt.Qa.Bb ? Pt.$b = nt(bt, mt.Pa.jb[0]) ? 2 + nt(bt, mt.Pa.jb[2]) : nt(bt, mt.Pa.jb[1]) : Pt.$b = 0, mt.kc && (Pt.Ad = nt(bt, mt.Bd)), Pt.Za = !nt(bt, 145) + 0, Pt.Za) {
var oe = Pt.Ob, ce = 0;
for (mt = 0; 4 > mt; ++mt) {
var ae, ne = Rt[0 + mt];
for (ae = 0; 4 > ae; ++ae) {
ne = Qu[Mt[St + ae]][ne];
for (var me = jo[nt(bt, ne[0])]; 0 < me; ) me = jo[2 * me + nt(bt, ne[me])];
ne = -me, Mt[St + ae] = ne;
}
a(oe, ce, Mt, St, 4), ce += 4, Rt[0 + mt] = ne;
}
} else ne = nt(bt, 156) ? nt(bt, 128) ? 1 : 3 : nt(bt, 163) ? 2 : 0, Pt.Ob[0] = ne, u(Mt, St, ne, 4), u(Rt, 0, ne, 4);
Pt.Dd = nt(bt, 142) ? nt(bt, 114) ? nt(bt, 183) ? 1 : 3 : 2 : 0;
}
if (gt.m.Ka) return ke(G, 7, "Premature end-of-partition0 encountered.");
for (; G.ja < G.za; ++G.ja) {
if (gt = H, bt = (V = G).rb[V.sb - 1], Mt = V.rb[V.sb + V.ja], at = V.ya[V.aa + V.ja], St = V.kc ? at.Ad : 0) bt.la = Mt.la = 0, at.Za || (bt.Na = Mt.Na = 0), at.Hc = 0, at.Gc = 0, at.ia = 0;
else {
var pe, $t;
if (bt = Mt, Mt = gt, St = V.Pa.Xc, Rt = V.ya[V.aa + V.ja], Pt = V.pb[Rt.$b], mt = Rt.ad, oe = 0, ce = V.rb[V.sb - 1], ne = ae = 0, u(mt, oe, 0, 384), Rt.Za) var Ee = 0, ln = St[3];
else {
me = s(16);
var qe = bt.Na + ce.Na;
if (qe = ia(Mt, St[1], qe, Pt.Eb, 0, me, 0), bt.Na = ce.Na = (0 < qe) + 0, 1 < qe) vi(me, 0, mt, oe);
else {
var cn = me[0] + 3 >> 3;
for (me = 0; 256 > me; me += 16) mt[oe + me] = cn;
}
Ee = 1, ln = St[0];
}
var fe = 15 & bt.la, gn = 15 & ce.la;
for (me = 0; 4 > me; ++me) {
var mn = 1 & gn;
for (cn = $t = 0; 4 > cn; ++cn) fe = fe >> 1 | (mn = (qe = ia(Mt, ln, qe = mn + (1 & fe), Pt.Sc, Ee, mt, oe)) > Ee) << 7, $t = $t << 2 | (3 < qe ? 3 : 1 < qe ? 2 : mt[oe + 0] != 0), oe += 16;
fe >>= 4, gn = gn >> 1 | mn << 7, ae = (ae << 8 | $t) >>> 0;
}
for (ln = fe, Ee = gn >> 4, pe = 0; 4 > pe; pe += 2) {
for ($t = 0, fe = bt.la >> 4 + pe, gn = ce.la >> 4 + pe, me = 0; 2 > me; ++me) {
for (mn = 1 & gn, cn = 0; 2 > cn; ++cn) qe = mn + (1 & fe), fe = fe >> 1 | (mn = 0 < (qe = ia(Mt, St[2], qe, Pt.Qc, 0, mt, oe))) << 3, $t = $t << 2 | (3 < qe ? 3 : 1 < qe ? 2 : mt[oe + 0] != 0), oe += 16;
fe >>= 2, gn = gn >> 1 | mn << 5;
}
ne |= $t << 4 * pe, ln |= fe << 4 << pe, Ee |= (240 & gn) << pe;
}
bt.la = ln, ce.la = Ee, Rt.Hc = ae, Rt.Gc = ne, Rt.ia = 43690 & ne ? 0 : Pt.ia, St = !(ae | ne);
}
if (0 < V.L && (V.wa[V.Y + V.ja] = V.gd[at.$b][at.Za], V.wa[V.Y + V.ja].La |= !St), gt.Ka) return ke(G, 7, "Premature end-of-file encountered.");
}
if (Bi(G), V = vt, gt = 1, at = (H = G).D, bt = 0 < H.L && H.M >= H.zb && H.M <= H.Va, H.Aa == 0) t: {
if (at.M = H.M, at.uc = bt, Xi(H, at), gt = 1, at = ($t = H.D).Nb, bt = (ne = Ja[H.L]) * H.R, Mt = ne / 2 * H.B, me = 16 * at * H.R, cn = 8 * at * H.B, St = H.sa, Rt = H.ta - bt + me, Pt = H.qa, mt = H.ra - Mt + cn, oe = H.Ha, ce = H.Ia - Mt + cn, gn = (fe = $t.M) == 0, ae = fe >= H.Va - 1, H.Aa == 2 && Xi(H, $t), $t.uc) for (mn = (qe = H).D.M, e(qe.D.uc), $t = qe.yb; $t < qe.Hb; ++$t) {
Ee = $t, ln = mn;
var ze = (Ge = (_e = qe).D).Nb;
pe = _e.R;
var Ge = Ge.wa[Ge.Y + Ee], rn = _e.sa, Sn = _e.ta + 16 * ze * pe + 16 * Ee, Zn = Ge.dd, Ue = Ge.tc;
if (Ue != 0) if (e(3 <= Ue), _e.L == 1) 0 < Ee && wr(rn, Sn, pe, Ue + 4), Ge.La && Ln(rn, Sn, pe, Ue), 0 < ln && Wr(rn, Sn, pe, Ue + 4), Ge.La && na(rn, Sn, pe, Ue);
else {
var fr = _e.B, Vr = _e.qa, Li = _e.ra + 8 * ze * fr + 8 * Ee, Ar = _e.Ha, _e = _e.Ia + 8 * ze * fr + 8 * Ee;
ze = Ge.ld, 0 < Ee && (qa(rn, Sn, pe, Ue + 4, Zn, ze), zr(Vr, Li, Ar, _e, fr, Ue + 4, Zn, ze)), Ge.La && (yr(rn, Sn, pe, Ue, Zn, ze), yi(Vr, Li, Ar, _e, fr, Ue, Zn, ze)), 0 < ln && (bi(rn, Sn, pe, Ue + 4, Zn, ze), ea(Vr, Li, Ar, _e, fr, Ue + 4, Zn, ze)), Ge.La && (Ur(rn, Sn, pe, Ue, Zn, ze), Hr(Vr, Li, Ar, _e, fr, Ue, Zn, ze));
}
}
if (H.ia && alert("todo:DitherRow"), V.put != null) {
if ($t = 16 * fe, fe = 16 * (fe + 1), gn ? (V.y = H.sa, V.O = H.ta + me, V.f = H.qa, V.N = H.ra + cn, V.ea = H.Ha, V.W = H.Ia + cn) : ($t -= ne, V.y = St, V.O = Rt, V.f = Pt, V.N = mt, V.ea = oe, V.W = ce), ae || (fe -= ne), fe > V.o && (fe = V.o), V.F = null, V.J = null, H.Fa != null && 0 < H.Fa.length && $t < fe && (V.J = Ji(H, V, $t, fe - $t), V.F = H.mb, V.F == null && V.F.length == 0)) {
gt = ke(H, 3, "Could not decode alpha data.");
break t;
}
$t < V.j && (ne = V.j - $t, $t = V.j, e(!(1 & ne)), V.O += H.R * ne, V.N += H.B * (ne >> 1), V.W += H.B * (ne >> 1), V.F != null && (V.J += V.width * ne)), $t < fe && (V.O += V.v, V.N += V.v >> 1, V.W += V.v >> 1, V.F != null && (V.J += V.v), V.ka = $t - V.j, V.U = V.va - V.v, V.T = fe - $t, gt = V.put(V));
}
at + 1 != H.Ic || ae || (a(H.sa, H.ta - bt, St, Rt + 16 * H.R, bt), a(H.qa, H.ra - Mt, Pt, mt + 8 * H.B, Mt), a(H.Ha, H.Ia - Mt, oe, ce + 8 * H.B, Mt));
}
if (!gt) return ke(G, 6, "Output aborted.");
}
return 1;
}(t, i)), i.bc != null && i.bc(i), l &= 1;
}
return l ? (t.cb = 0, l) : 0;
}
function jn(t, i, l, d, m) {
m = t[i + l + 32 * d] + (m >> 3), t[i + l + 32 * d] = -256 & m ? 0 > m ? 0 : 255 : m;
}
function ri(t, i, l, d, m, b) {
jn(t, i, 0, l, d + m), jn(t, i, 1, l, d + b), jn(t, i, 2, l, d - b), jn(t, i, 3, l, d - m);
}
function sn(t) {
return (20091 * t >> 16) + t;
}
function Ei(t, i, l, d) {
var m, b = 0, L = s(16);
for (m = 0; 4 > m; ++m) {
var A = t[i + 0] + t[i + 8], x = t[i + 0] - t[i + 8], I = (35468 * t[i + 4] >> 16) - sn(t[i + 12]), U = sn(t[i + 4]) + (35468 * t[i + 12] >> 16);
L[b + 0] = A + U, L[b + 1] = x + I, L[b + 2] = x - I, L[b + 3] = A - U, b += 4, i++;
}
for (m = b = 0; 4 > m; ++m) A = (t = L[b + 0] + 4) + L[b + 8], x = t - L[b + 8], I = (35468 * L[b + 4] >> 16) - sn(L[b + 12]), jn(l, d, 0, 0, A + (U = sn(L[b + 4]) + (35468 * L[b + 12] >> 16))), jn(l, d, 1, 0, x + I), jn(l, d, 2, 0, x - I), jn(l, d, 3, 0, A - U), b++, d += 32;
}
function wa(t, i, l, d) {
var m = t[i + 0] + 4, b = 35468 * t[i + 4] >> 16, L = sn(t[i + 4]), A = 35468 * t[i + 1] >> 16;
ri(l, d, 0, m + L, t = sn(t[i + 1]), A), ri(l, d, 1, m + b, t, A), ri(l, d, 2, m - b, t, A), ri(l, d, 3, m - L, t, A);
}
function xs(t, i, l, d, m) {
Ei(t, i, l, d), m && Ei(t, i + 16, l, d + 4);
}
function La(t, i, l, d) {
ur(t, i + 0, l, d, 1), ur(t, i + 32, l, d + 128, 1);
}
function Ss(t, i, l, d) {
var m;
for (t = t[i + 0] + 4, m = 0; 4 > m; ++m) for (i = 0; 4 > i; ++i) jn(l, d, i, m, t);
}
function Na(t, i, l, d) {
t[i + 0] && nn(t, i + 0, l, d), t[i + 16] && nn(t, i + 16, l, d + 4), t[i + 32] && nn(t, i + 32, l, d + 128), t[i + 48] && nn(t, i + 48, l, d + 128 + 4);
}
function _s(t, i, l, d) {
var m, b = s(16);
for (m = 0; 4 > m; ++m) {
var L = t[i + 0 + m] + t[i + 12 + m], A = t[i + 4 + m] + t[i + 8 + m], x = t[i + 4 + m] - t[i + 8 + m], I = t[i + 0 + m] - t[i + 12 + m];
b[0 + m] = L + A, b[8 + m] = L - A, b[4 + m] = I + x, b[12 + m] = I - x;
}
for (m = 0; 4 > m; ++m) L = (t = b[0 + 4 * m] + 3) + b[3 + 4 * m], A = b[1 + 4 * m] + b[2 + 4 * m], x = b[1 + 4 * m] - b[2 + 4 * m], I = t - b[3 + 4 * m], l[d + 0] = L + A >> 3, l[d + 16] = I + x >> 3, l[d + 32] = L - A >> 3, l[d + 48] = I - x >> 3, d += 64;
}
function qi(t, i, l) {
var d, m = i - 32, b = pn, L = 255 - t[m - 1];
for (d = 0; d < l; ++d) {
var A, x = b, I = L + t[i - 1];
for (A = 0; A < l; ++A) t[i + A] = x[I + t[m + A]];
i += 32;
}
}
function Ps(t, i) {
qi(t, i, 4);
}
function ks(t, i) {
qi(t, i, 8);
}
function Fs(t, i) {
qi(t, i, 16);
}
function ir(t, i) {
var l;
for (l = 0; 16 > l; ++l) a(t, i + 32 * l, t, i - 32, 16);
}
function ii(t, i) {
var l;
for (l = 16; 0 < l; --l) u(t, i, t[i - 1], 16), i += 32;
}
function ai(t, i, l) {
var d;
for (d = 0; 16 > d; ++d) u(i, l + 32 * d, t, 16);
}
function Aa(t, i) {
var l, d = 16;
for (l = 0; 16 > l; ++l) d += t[i - 1 + 32 * l] + t[i + l - 32];
ai(d >> 5, t, i);
}
function Ye(t, i) {
var l, d = 8;
for (l = 0; 16 > l; ++l) d += t[i - 1 + 32 * l];
ai(d >> 4, t, i);
}
function Is(t, i) {
var l, d = 8;
for (l = 0; 16 > l; ++l) d += t[i + l - 32];
ai(d >> 4, t, i);
}
function xa(t, i) {
ai(128, t, i);
}
function Vt(t, i, l) {
return t + 2 * i + l + 2 >> 2;
}
function Cs(t, i) {
var l, d = i - 32;
for (d = new Uint8Array([Vt(t[d - 1], t[d + 0], t[d + 1]), Vt(t[d + 0], t[d + 1], t[d + 2]), Vt(t[d + 1], t[d + 2], t[d + 3]), Vt(t[d + 2], t[d + 3], t[d + 4])]), l = 0; 4 > l; ++l) a(t, i + 32 * l, d, 0, d.length);
}
function js(t, i) {
var l = t[i - 1], d = t[i - 1 + 32], m = t[i - 1 + 64], b = t[i - 1 + 96];
At(t, i + 0, 16843009 * Vt(t[i - 1 - 32], l, d)), At(t, i + 32, 16843009 * Vt(l, d, m)), At(t, i + 64, 16843009 * Vt(d, m, b)), At(t, i + 96, 16843009 * Vt(m, b, b));
}
function Yn(t, i) {
var l, d = 4;
for (l = 0; 4 > l; ++l) d += t[i + l - 32] + t[i - 1 + 32 * l];
for (d >>= 3, l = 0; 4 > l; ++l) u(t, i + 32 * l, d, 4);
}
function Sa(t, i) {
var l = t[i - 1 + 0], d = t[i - 1 + 32], m = t[i - 1 + 64], b = t[i - 1 - 32], L = t[i + 0 - 32], A = t[i + 1 - 32], x = t[i + 2 - 32], I = t[i + 3 - 32];
t[i + 0 + 96] = Vt(d, m, t[i - 1 + 96]), t[i + 1 + 96] = t[i + 0 + 64] = Vt(l, d, m), t[i + 2 + 96] = t[i + 1 + 64] = t[i + 0 + 32] = Vt(b, l, d), t[i + 3 + 96] = t[i + 2 + 64] = t[i + 1 + 32] = t[i + 0 + 0] = Vt(L, b, l), t[i + 3 + 64] = t[i + 2 + 32] = t[i + 1 + 0] = Vt(A, L, b), t[i + 3 + 32] = t[i + 2 + 0] = Vt(x, A, L), t[i + 3 + 0] = Vt(I, x, A);
}
function _a(t, i) {
var l = t[i + 1 - 32], d = t[i + 2 - 32], m = t[i + 3 - 32], b = t[i + 4 - 32], L = t[i + 5 - 32], A = t[i + 6 - 32], x = t[i + 7 - 32];
t[i + 0 + 0] = Vt(t[i + 0 - 32], l, d), t[i + 1 + 0] = t[i + 0 + 32] = Vt(l, d, m), t[i + 2 + 0] = t[i + 1 + 32] = t[i + 0 + 64] = Vt(d, m, b), t[i + 3 + 0] = t[i + 2 + 32] = t[i + 1 + 64] = t[i + 0 + 96] = Vt(m, b, L), t[i + 3 + 32] = t[i + 2 + 64] = t[i + 1 + 96] = Vt(b, L, A), t[i + 3 + 64] = t[i + 2 + 96] = Vt(L, A, x), t[i + 3 + 96] = Vt(A, x, x);
}
function si(t, i) {
var l = t[i - 1 + 0], d = t[i - 1 + 32], m = t[i - 1 + 64], b = t[i - 1 - 32], L = t[i + 0 - 32], A = t[i + 1 - 32], x = t[i + 2 - 32], I = t[i + 3 - 32];
t[i + 0 + 0] = t[i + 1 + 64] = b + L + 1 >> 1, t[i + 1 + 0] = t[i + 2 + 64] = L + A + 1 >> 1, t[i + 2 + 0] = t[i + 3 + 64] = A + x + 1 >> 1, t[i + 3 + 0] = x + I + 1 >> 1, t[i + 0 + 96] = Vt(m, d, l), t[i + 0 + 64] = Vt(d, l, b), t[i + 0 + 32] = t[i + 1 + 96] = Vt(l, b, L), t[i + 1 + 32] = t[i + 2 + 96] = Vt(b, L, A), t[i + 2 + 32] = t[i + 3 + 96] = Vt(L, A, x), t[i + 3 + 32] = Vt(A, x, I);
}
function Di(t, i) {
var l = t[i + 0 - 32], d = t[i + 1 - 32], m = t[i + 2 - 32], b = t[i + 3 - 32], L = t[i + 4 - 32], A = t[i + 5 - 32], x = t[i + 6 - 32], I = t[i + 7 - 32];
t[i + 0 + 0] = l + d + 1 >> 1, t[i + 1 + 0] = t[i + 0 + 64] = d + m + 1 >> 1, t[i + 2 + 0] = t[i + 1 + 64] = m + b + 1 >> 1, t[i + 3 + 0] = t[i + 2 + 64] = b + L + 1 >> 1, t[i + 0 + 32] = Vt(l, d, m), t[i + 1 + 32] = t[i + 0 + 96] = Vt(d, m, b), t[i + 2 + 32] = t[i + 1 + 96] = Vt(m, b, L), t[i + 3 + 32] = t[i + 2 + 96] = Vt(b, L, A), t[i + 3 + 64] = Vt(L, A, x), t[i + 3 + 96] = Vt(A, x, I);
}
function Os(t, i) {
var l = t[i - 1 + 0], d = t[i - 1 + 32], m = t[i - 1 + 64], b = t[i - 1 + 96];
t[i + 0 + 0] = l + d + 1 >> 1, t[i + 2 + 0] = t[i + 0 + 32] = d + m + 1 >> 1, t[i + 2 + 32] = t[i + 0 + 64] = m + b + 1 >> 1, t[i + 1 + 0] = Vt(l, d, m), t[i + 3 + 0] = t[i + 1 + 32] = Vt(d, m, b), t[i + 3 + 32] = t[i + 1 + 64] = Vt(m, b, b), t[i + 3 + 64] = t[i + 2 + 64] = t[i + 0 + 96] = t[i + 1 + 96] = t[i + 2 + 96] = t[i + 3 + 96] = b;
}
function Ms(t, i) {
var l = t[i - 1 + 0], d = t[i - 1 + 32], m = t[i - 1 + 64], b = t[i - 1 + 96], L = t[i - 1 - 32], A = t[i + 0 - 32], x = t[i + 1 - 32], I = t[i + 2 - 32];
t[i + 0 + 0] = t[i + 2 + 32] = l + L + 1 >> 1, t[i + 0 + 32] = t[i + 2 + 64] = d + l + 1 >> 1, t[i + 0 + 64] = t[i + 2 + 96] = m + d + 1 >> 1, t[i + 0 + 96] = b + m + 1 >> 1, t[i + 3 + 0] = Vt(A, x, I), t[i + 2 + 0] = Vt(L, A, x), t[i + 1 + 0] = t[i + 3 + 32] = Vt(l, L, A), t[i + 1 + 32] = t[i + 3 + 64] = Vt(d, l, L), t[i + 1 + 64] = t[i + 3 + 96] = Vt(m, d, l), t[i + 1 + 96] = Vt(b, m, d);
}
function Bs(t, i) {
var l;
for (l = 0; 8 > l; ++l) a(t, i + 32 * l, t, i - 32, 8);
}
function Ri(t, i) {
var l;
for (l = 0; 8 > l; ++l) u(t, i, t[i - 1], 8), i += 32;
}
function Er(t, i, l) {
var d;
for (d = 0; 8 > d; ++d) u(i, l + 32 * d, t, 8);
}
function pr(t, i) {
var l, d = 8;
for (l = 0; 8 > l; ++l) d += t[i + l - 32] + t[i - 1 + 32 * l];
Er(d >> 4, t, i);
}
function Es(t, i) {
var l, d = 4;
for (l = 0; 8 > l; ++l) d += t[i + l - 32];
Er(d >> 3, t, i);
}
function qr(t, i) {
var l, d = 4;
for (l = 0; 8 > l; ++l) d += t[i - 1 + 32 * l];
Er(d >> 3, t, i);
}
function Ti(t, i) {
Er(128, t, i);
}
function oi(t, i, l) {
var d = t[i - l], m = t[i + 0], b = 3 * (m - d) + Us[1020 + t[i - 2 * l] - t[i + l]], L = Ra[112 + (b + 4 >> 3)];
t[i - l] = pn[255 + d + Ra[112 + (b + 3 >> 3)]], t[i + 0] = pn[255 + m - L];
}
function Pa(t, i, l, d) {
var m = t[i + 0], b = t[i + l];
return An[255 + t[i - 2 * l] - t[i - l]] > d || An[255 + b - m] > d;
}
function ka(t, i, l, d) {
return 4 * An[255 + t[i - l] - t[i + 0]] + An[255 + t[i - 2 * l] - t[i + l]] <= d;
}
function Fa(t, i, l, d, m) {
var b = t[i - 3 * l], L = t[i - 2 * l], A = t[i - l], x = t[i + 0], I = t[i + l], U = t[i + 2 * l], K = t[i + 3 * l];
return 4 * An[255 + A - x] + An[255 + L - I] > d ? 0 : An[255 + t[i - 4 * l] - b] <= m && An[255 + b - L] <= m && An[255 + L - A] <= m && An[255 + K - U] <= m && An[255 + U - I] <= m && An[255 + I - x] <= m;
}
function Ia(t, i, l, d) {
var m = 2 * d + 1;
for (d = 0; 16 > d; ++d) ka(t, i + d, l, m) && oi(t, i + d, l);
}
function Xn(t, i, l, d) {
var m = 2 * d + 1;
for (d = 0; 16 > d; ++d) ka(t, i + d * l, 1, m) && oi(t, i + d * l, 1);
}
function ar(t, i, l, d) {
var m;
for (m = 3; 0 < m; --m) Ia(t, i += 4 * l, l, d);
}
function qs(t, i, l, d) {
var m;
for (m = 3; 0 < m; --m) Xn(t, i += 4, l, d);
}
function gr(t, i, l, d, m, b, L, A) {
for (b = 2 * b + 1; 0 < m--; ) {
if (Fa(t, i, l, b, L)) if (Pa(t, i, l, A)) oi(t, i, l);
else {
var x = t, I = i, U = l, K = x[I - 2 * U], Z = x[I - U], G = x[I + 0], vt = x[I + U], at = x[I + 2 * U], H = 27 * (gt = Us[1020 + 3 * (G - Z) + Us[1020 + K - vt]]) + 63 >> 7, V = 18 * gt + 63 >> 7, gt = 9 * gt + 63 >> 7;
x[I - 3 * U] = pn[255 + x[I - 3 * U] + gt], x[I - 2 * U] = pn[255 + K + V], x[I - U] = pn[255 + Z + H], x[I + 0] = pn[255 + G - H], x[I + U] = pn[255 + vt - V], x[I + 2 * U] = pn[255 + at - gt];
}
i += d;
}
}
function On(t, i, l, d, m, b, L, A) {
for (b = 2 * b + 1; 0 < m--; ) {
if (Fa(t, i, l, b, L)) if (Pa(t, i, l, A)) oi(t, i, l);
else {
var x = t, I = i, U = l, K = x[I - U], Z = x[I + 0], G = x[I + U], vt = Ra[112 + ((at = 3 * (Z - K)) + 4 >> 3)], at = Ra[112 + (at + 3 >> 3)], H = vt + 1 >> 1;
x[I - 2 * U] = pn[255 + x[I - 2 * U] + H], x[I - U] = pn[255 + K + at], x[I + 0] = pn[255 + Z - vt], x[I + U] = pn[255 + G - H];
}
i += d;
}
}
function zi(t, i, l, d, m, b) {
gr(t, i, l, 1, 16, d, m, b);
}
function Dr(t, i, l, d, m, b) {
gr(t, i, 1, l, 16, d, m, b);
}
function Ds(t, i, l, d, m, b) {
var L;
for (L = 3; 0 < L; --L) On(t, i += 4 * l, l, 1, 16, d, m, b);
}
function ui(t, i, l, d, m, b) {
var L;
for (L = 3; 0 < L; --L) On(t, i += 4, 1, l, 16, d, m, b);
}
function Rs(t, i, l, d, m, b, L, A) {
gr(t, i, m, 1, 8, b, L, A), gr(l, d, m, 1, 8, b, L, A);
}
function Ui(t, i, l, d, m, b, L, A) {
gr(t, i, 1, m, 8, b, L, A), gr(l, d, 1, m, 8, b, L, A);
}
function Hi(t, i, l, d, m, b, L, A) {
On(t, i + 4 * m, m, 1, 8, b, L, A), On(l, d + 4 * m, m, 1, 8, b, L, A);
}
function Ca(t, i, l, d, m, b, L, A) {
On(t, i + 4, 1, m, 8, b, L, A), On(l, d + 4, 1, m, 8, b, L, A);
}
function li() {
this.ba = new Pn(), this.ec = [], this.cc = [], this.Mc = [], this.Dc = this.Nc = this.dc = this.fc = 0, this.Oa = new xe(), this.memory = 0, this.Ib = "OutputFunc", this.Jb = "OutputAlphaFunc", this.Nd = "OutputRowFunc";
}
function Wi() {
this.data = [], this.offset = this.kd = this.ha = this.w = 0, this.na = [], this.xa = this.gb = this.Ja = this.Sa = this.P = 0;
}
function Vi() {
this.nc = this.Ea = this.b = this.hc = 0, this.K = [], this.w = 0;
}
function ja() {
this.ua = 0, this.Wa = new E(), this.vb = new E(), this.md = this.xc = this.wc = 0, this.vc = [], this.Wb = 0, this.Ya = new D(), this.yc = new k();
}
function Ts() {
this.xb = this.a = 0, this.l = new ni(), this.ca = new Pn(), this.V = [], this.Ba = 0, this.Ta = [], this.Ua = 0, this.m = new N(), this.Pb = 0, this.wd = new N(), this.Ma = this.$ = this.C = this.i = this.c = this.xd = 0, this.s = new ja(), this.ab = 0, this.gc = c(4, Vi), this.Oc = 0;
}
function ci() {
this.Lc = this.Z = this.$a = this.i = this.c = 0, this.l = new ni(), this.ic = 0, this.ca = [], this.tb = 0, this.qd = null, this.rd = 0;
}
function Rr(t, i, l, d, m, b, L) {
for (t = t == null ? 0 : t[i + 0], i = 0; i < L; ++i) m[b + i] = t + l[d + i] & 255, t = m[b + i];
}
function Gi(t, i, l, d, m, b, L) {
var A;
if (t == null) Rr(null, null, l, d, m, b, L);
else for (A = 0; A < L; ++A) m[b + A] = t[i + A] + l[d + A] & 255;
}
function mr(t, i, l, d, m, b, L) {
if (t == null) Rr(null, null, l, d, m, b, L);
else {
var A, x = t[i + 0], I = x, U = x;
for (A = 0; A < L; ++A) I = U + (x = t[i + A]) - I, U = l[d + A] + (-256 & I ? 0 > I ? 0 : 255 : I) & 255, I = x, m[b + A] = U;
}
}
function Ji(t, i, l, d) {
var m = i.width, b = i.o;
if (e(t != null && i != null), 0 > l || 0 >= d || l + d > b) return null;
if (!t.Cc) {
if (t.ga == null) {
var L;
if (t.ga = new ci(), (L = t.ga == null) || (L = i.width * i.o, e(t.Gb.length == 0), t.Gb = s(L), t.Uc = 0, t.Gb == null ? L = 0 : (t.mb = t.Gb, t.nb = t.Uc, t.rc = null, L = 1), L = !L), !L) {
L = t.ga;
var A = t.Fa, x = t.P, I = t.qc, U = t.mb, K = t.nb, Z = x + 1, G = I - 1, vt = L.l;
if (e(A != null && U != null && i != null), Nr[0] = null, Nr[1] = Rr, Nr[2] = Gi, Nr[3] = mr, L.ca = U, L.tb = K, L.c = i.width, L.i = i.height, e(0 < L.c && 0 < L.i), 1 >= I) i = 0;
else if (L.$a = A[x + 0] >> 0 & 3, L.Z = A[x + 0] >> 2 & 3, L.Lc = A[x + 0] >> 4 & 3, x = A[x + 0] >> 6 & 3, 0 > L.$a || 1 < L.$a || 4 <= L.Z || 1 < L.Lc || x) i = 0;
else if (vt.put = Hn, vt.ac = We, vt.bc = Wn, vt.ma = L, vt.width = i.width, vt.height = i.height, vt.Da = i.Da, vt.v = i.v, vt.va = i.va, vt.j = i.j, vt.o = i.o, L.$a) t: {
e(L.$a == 1), i = bn();
e: for (; ; ) {
if (i == null) {
i = 0;
break t;
}
if (e(L != null), L.mc = i, i.c = L.c, i.i = L.i, i.l = L.l, i.l.ma = L, i.l.width = L.c, i.l.height = L.i, i.a = 0, $(i.m, A, Z, G), !Jn(L.c, L.i, 1, i, null) || (i.ab == 1 && i.gc[0].hc == 3 && rr(i.s) ? (L.ic = 1, A = i.c * i.i, i.Ta = null, i.Ua = 0, i.V = s(A), i.Ba = 0, i.V == null ? (i.a = 1, i = 0) : i = 1) : (L.ic = 0, i = Br(i, L.c)), !i)) break e;
i = 1;
break t;
}
L.mc = null, i = 0;
}
else i = G >= L.c * L.i;
L = !i;
}
if (L) return null;
t.ga.Lc != 1 ? t.Ga = 0 : d = b - l;
}
e(t.ga != null), e(l + d <= b);
t: {
if (i = (A = t.ga).c, b = A.l.o, A.$a == 0) {
if (Z = t.rc, G = t.Vc, vt = t.Fa, x = t.P + 1 + l * i, I = t.mb, U = t.nb + l * i, e(x <= t.P + t.qc), A.Z != 0) for (e(Nr[A.Z] != null), L = 0; L < d; ++L) Nr[A.Z](Z, G, vt, x, I, U, i), Z = I, G = U, U += i, x += i;
else for (L = 0; L < d; ++L) a(I, U, vt, x, i), Z = I, G = U, U += i, x += i;
t.rc = Z, t.Vc = G;
} else {
if (e(A.mc != null), i = l + d, e((L = A.mc) != null), e(i <= L.i), L.C >= i) i = 1;
else if (A.ic || X(), A.ic) {
A = L.V, Z = L.Ba, G = L.c;
var at = L.i, H = (vt = 1, x = L.$ / G, I = L.$ % G, U = L.m, K = L.s, L.$), V = G * at, gt = G * i, bt = K.wc, mt = H < gt ? Me(K, I, x) : null;
e(H <= V), e(i <= at), e(rr(K));
e: for (; ; ) {
for (; !U.h && H < gt; ) {
if (I & bt || (mt = Me(K, I, x)), e(mt != null), J(U), 256 > (at = an(mt.G[0], mt.H[0], U))) A[Z + H] = at, ++H, ++I >= G && (I = 0, ++x <= i && !(x % 16) && In(L, x));
else {
if (!(280 > at)) {
vt = 0;
break e;
}
at = kn(at - 256, U);
var Mt, St = an(mt.G[4], mt.H[4], U);
if (J(U), !(H >= (St = Vn(G, St = kn(St, U))) && V - H >= at)) {
vt = 0;
break e;
}
for (Mt = 0; Mt < at; ++Mt) A[Z + H + Mt] = A[Z + H + Mt - St];
for (H += at, I += at; I >= G; ) I -= G, ++x <= i && !(x % 16) && In(L, x);
H < gt && I & bt && (mt = Me(K, I, x));
}
e(U.h == B(U));
}
In(L, x > i ? i : x);
break e;
}
!vt || U.h && H < V ? (vt = 0, L.a = U.h ? 5 : 3) : L.$ = H, i = vt;
} else i = Cn(L, L.V, L.Ba, L.c, L.i, i, Zr);
if (!i) {
d = 0;
break t;
}
}
l + d >= b && (t.Cc = 1), d = 1;
}
if (!d) return null;
if (t.Cc && ((d = t.ga) != null && (d.mc = null), t.ga = null, 0 < t.Ga)) return alert("todo:WebPDequantizeLevels"), null;
}
return t.nb + l * m;
}
function o(t, i, l, d, m, b) {
for (; 0 < m--; ) {
var L, A = t, x = i + (l ? 1 : 0), I = t, U = i + (l ? 0 : 3);
for (L = 0; L < d; ++L) {
var K = I[U + 4 * L];
K != 255 && (K *= 32897, A[x + 4 * L + 0] = A[x + 4 * L + 0] * K >> 23, A[x + 4 * L + 1] = A[x + 4 * L + 1] * K >> 23, A[x + 4 * L + 2] = A[x + 4 * L + 2] * K >> 23);
}
i += b;
}
}
function v(t, i, l, d, m) {
for (; 0 < d--; ) {
var b;
for (b = 0; b < l; ++b) {
var L = t[i + 2 * b + 0], A = 15 & (I = t[i + 2 * b + 1]), x = 4369 * A, I = (240 & I | I >> 4) * x >> 16;
t[i + 2 * b + 0] = (240 & L | L >> 4) * x >> 16 & 240 | (15 & L | L << 4) * x >> 16 >> 4 & 15, t[i + 2 * b + 1] = 240 & I | A;
}
i += m;
}
}
function j(t, i, l, d, m, b, L, A) {
var x, I, U = 255;
for (I = 0; I < m; ++I) {
for (x = 0; x < d; ++x) {
var K = t[i + x];
b[L + 4 * x] = K, U &= K;
}
i += l, L += A;
}
return U != 255;
}
function R(t, i, l, d, m) {
var b;
for (b = 0; b < m; ++b) l[d + b] = t[i + b] >> 8;
}
function X() {
Nn = o, be = v, ye = j, Ie = R;
}
function ut(t, i, l) {
z[t] = function(d, m, b, L, A, x, I, U, K, Z, G, vt, at, H, V, gt, bt) {
var mt, Mt = bt - 1 >> 1, St = A[x + 0] | I[U + 0] << 16, Rt = K[Z + 0] | G[vt + 0] << 16;
e(d != null);
var Pt = 3 * St + Rt + 131074 >> 2;
for (i(d[m + 0], 255 & Pt, Pt >> 16, at, H), b != null && (Pt = 3 * Rt + St + 131074 >> 2, i(b[L + 0], 255 & Pt, Pt >> 16, V, gt)), mt = 1; mt <= Mt; ++mt) {
var oe = A[x + mt] | I[U + mt] << 16, ce = K[Z + mt] | G[vt + mt] << 16, ae = St + oe + Rt + ce + 524296, ne = ae + 2 * (oe + Rt) >> 3;
Pt = ne + St >> 1, St = (ae = ae + 2 * (St + ce) >> 3) + oe >> 1, i(d[m + 2 * mt - 1], 255 & Pt, Pt >> 16, at, H + (2 * mt - 1) * l), i(d[m + 2 * mt - 0], 255 & St, St >> 16, at, H + (2 * mt - 0) * l), b != null && (Pt = ae + Rt >> 1, St = ne + ce >> 1, i(b[L + 2 * mt - 1], 255 & Pt, Pt >> 16, V, gt + (2 * mt - 1) * l), i(b[L + 2 * mt + 0], 255 & St, St >> 16, V, gt + (2 * mt + 0) * l)), St = oe, Rt = ce;
}
1 & bt || (Pt = 3 * St + Rt + 131074 >> 2, i(d[m + bt - 1], 255 & Pt, Pt >> 16, at, H + (bt - 1) * l), b != null && (Pt = 3 * Rt + St + 131074 >> 2, i(b[L + bt - 1], 255 & Pt, Pt >> 16, V, gt + (bt - 1) * l)));
};
}
function yt() {
xn[Ta] = rl, xn[za] = Mo, xn[Fo] = il, xn[Ua] = Bo, xn[Ha] = Eo, xn[Hs] = qo, xn[Io] = al, xn[Ws] = Mo, xn[Vs] = Bo, xn[Wa] = Eo, xn[Gs] = qo;
}
function Ot(t) {
return t & -16384 ? 0 > t ? 0 : 255 : t >> sl;
}
function Dt(t, i) {
return Ot((19077 * t >> 8) + (26149 * i >> 8) - 14234);
}
function Zt(t, i, l) {
return Ot((19077 * t >> 8) - (6419 * i >> 8) - (13320 * l >> 8) + 8708);
}
function Yt(t, i) {
return Ot((19077 * t >> 8) + (33050 * i >> 8) - 17685);
}
function re(t, i, l, d, m) {
d[m + 0] = Dt(t, l), d[m + 1] = Zt(t, i, l), d[m + 2] = Yt(t, i);
}
function Ne(t, i, l, d, m) {
d[m + 0] = Yt(t, i), d[m + 1] = Zt(t, i, l), d[m + 2] = Dt(t, l);
}
function Se(t, i, l, d, m) {
var b = Zt(t, i, l);
i = b << 3 & 224 | Yt(t, i) >> 3, d[m + 0] = 248 & Dt(t, l) | b >> 5, d[m + 1] = i;
}
function Be(t, i, l, d, m) {
var b = 240 & Yt(t, i) | 15;
d[m + 0] = 240 & Dt(t, l) | Zt(t, i, l) >> 4, d[m + 1] = b;
}
function Xe(t, i, l, d, m) {
d[m + 0] = 255, re(t, i, l, d, m + 1);
}
function Te(t, i, l, d, m) {
Ne(t, i, l, d, m), d[m + 3] = 255;
}
function Mn(t, i, l, d, m) {
re(t, i, l, d, m), d[m + 3] = 255;
}
function dn(t, i) {
return 0 > t ? 0 : t > i ? i : t;
}
function Kn(t, i, l) {
z[t] = function(d, m, b, L, A, x, I, U, K) {
for (var Z = U + (-2 & K) * l; U != Z; ) i(d[m + 0], b[L + 0], A[x + 0], I, U), i(d[m + 1], b[L + 0], A[x + 0], I, U + l), m += 2, ++L, ++x, U += 2 * l;
1 & K && i(d[m + 0], b[L + 0], A[x + 0], I, U);
};
}
function Oa(t, i, l) {
return l == 0 ? t == 0 ? i == 0 ? 6 : 5 : i == 0 ? 4 : 0 : l;
}
function Yi(t, i, l, d, m) {
switch (t >>> 30) {
case 3:
ur(i, l, d, m, 0);
break;
case 2:
Fe(i, l, d, m);
break;
case 1:
nn(i, l, d, m);
}
}
function Xi(t, i) {
var l, d, m = i.M, b = i.Nb, L = t.oc, A = t.pc + 40, x = t.oc, I = t.pc + 584, U = t.oc, K = t.pc + 600;
for (l = 0; 16 > l; ++l) L[A + 32 * l - 1] = 129;
for (l = 0; 8 > l; ++l) x[I + 32 * l - 1] = 129, U[K + 32 * l - 1] = 129;
for (0 < m ? L[A - 1 - 32] = x[I - 1 - 32] = U[K - 1 - 32] = 129 : (u(L, A - 32 - 1, 127, 21), u(x, I - 32 - 1, 127, 9), u(U, K - 32 - 1, 127, 9)), d = 0; d < t.za; ++d) {
var Z = i.ya[i.aa + d];
if (0 < d) {
for (l = -1; 16 > l; ++l) a(L, A + 32 * l - 4, L, A + 32 * l + 12, 4);
for (l = -1; 8 > l; ++l) a(x, I + 32 * l - 4, x, I + 32 * l + 4, 4), a(U, K + 32 * l - 4, U, K + 32 * l + 4, 4);
}
var G = t.Gd, vt = t.Hd + d, at = Z.ad, H = Z.Hc;
if (0 < m && (a(L, A - 32, G[vt].y, 0, 16), a(x, I - 32, G[vt].f, 0, 8), a(U, K - 32, G[vt].ea, 0, 8)), Z.Za) {
var V = L, gt = A - 32 + 16;
for (0 < m && (d >= t.za - 1 ? u(V, gt, G[vt].y[15], 4) : a(V, gt, G[vt + 1].y, 0, 4)), l = 0; 4 > l; l++) V[gt + 128 + l] = V[gt + 256 + l] = V[gt + 384 + l] = V[gt + 0 + l];
for (l = 0; 16 > l; ++l, H <<= 2) V = L, gt = A + Ro[l], Bn[Z.Ob[l]](V, gt), Yi(H, at, 16 * +l, V, gt);
} else if (V = Oa(d, m, Z.Ob[0]), Lr[V](L, A), H != 0) for (l = 0; 16 > l; ++l, H <<= 2) Yi(H, at, 16 * +l, L, A + Ro[l]);
for (l = Z.Gc, V = Oa(d, m, Z.Dd), cr[V](x, I), cr[V](U, K), H = at, V = x, gt = I, 255 & (Z = l >> 0) && (170 & Z ? ta(H, 256, V, gt) : wn(H, 256, V, gt)), Z = U, H = K, 255 & (l >>= 8) && (170 & l ? ta(at, 320, Z, H) : wn(at, 320, Z, H)), m < t.Ub - 1 && (a(G[vt].y, 0, L, A + 480, 16), a(G[vt].f, 0, x, I + 224, 8), a(G[vt].ea, 0, U, K + 224, 8)), l = 8 * b * t.B, G = t.sa, vt = t.ta + 16 * d + 16 * b * t.R, at = t.qa, Z = t.ra + 8 * d + l, H = t.Ha, V = t.Ia + 8 * d + l, l = 0; 16 > l; ++l) a(G, vt + l * t.R, L, A + 32 * l, 16);
for (l = 0; 8 > l; ++l) a(at, Z + l * t.B, x, I + 32 * l, 8), a(H, V + l * t.B, U, K + 32 * l, 8);
}
}
function fi(t, i, l, d, m, b, L, A, x) {
var I = [0], U = [0], K = 0, Z = x != null ? x.kd : 0, G = x ?? new Wi();
if (t == null || 12 > l) return 7;
G.data = t, G.w = i, G.ha = l, i = [i], l = [l], G.gb = [G.gb];
t: {
var vt = i, at = l, H = G.gb;
if (e(t != null), e(at != null), e(H != null), H[0] = 0, 12 <= at[0] && !n(t, vt[0], "RIFF")) {
if (n(t, vt[0] + 8, "WEBP")) {
H = 3;
break t;
}
var V = _t(t, vt[0] + 4);
if (12 > V || 4294967286 < V) {
H = 3;
break t;
}
if (Z && V > at[0] - 8) {
H = 7;
break t;
}
H[0] = V, vt[0] += 12, at[0] -= 12;
}
H = 0;
}
if (H != 0) return H;
for (V = 0 < G.gb[0], l = l[0]; ; ) {
t: {
var gt = t;
at = i, H = l;
var bt = I, mt = U, Mt = vt = [0];
if ((Pt = K = [K])[0] = 0, 8 > H[0]) H = 7;
else {
if (!n(gt, at[0], "VP8X")) {
if (_t(gt, at[0] + 4) != 10) {
H = 3;
break t;
}
if (18 > H[0]) {
H = 7;
break t;
}
var St = _t(gt, at[0] + 8), Rt = 1 + Ft(gt, at[0] + 12);
if (2147483648 <= Rt * (gt = 1 + Ft(gt, at[0] + 15))) {
H = 3;
break t;
}
Mt != null && (Mt[0] = St), bt != null && (bt[0] = Rt), mt != null && (mt[0] = gt), at[0] += 18, H[0] -= 18, Pt[0] = 1;
}
H = 0;
}
}
if (K = K[0], vt = vt[0], H != 0) return H;
if (at = !!(2 & vt), !V && K) return 3;
if (b != null && (b[0] = !!(16 & vt)), L != null && (L[0] = at), A != null && (A[0] = 0), L = I[0], vt = U[0], K && at && x == null) {
H = 0;
break;
}
if (4 > l) {
H = 7;
break;
}
if (V && K || !V && !K && !n(t, i[0], "ALPH")) {
l = [l], G.na = [G.na], G.P = [G.P], G.Sa = [G.Sa];
t: {
St = t, H = i, V = l;
var Pt = G.gb;
bt = G.na, mt = G.P, Mt = G.Sa, Rt = 22, e(St != null), e(V != null), gt = H[0];
var oe = V[0];
for (e(bt != null), e(Mt != null), bt[0] = null, mt[0] = null, Mt[0] = 0; ; ) {
if (H[0] = gt, V[0] = oe, 8 > oe) {
H = 7;
break t;
}
var ce = _t(St, gt + 4);
if (4294967286 < ce) {
H = 3;
break t;
}
var ae = 8 + ce + 1 & -2;
if (Rt += ae, 0 < Pt && Rt > Pt) {
H = 3;
break t;
}
if (!n(St, gt, "VP8 ") || !n(St, gt, "VP8L")) {
H = 0;
break t;
}
if (oe[0] < ae) {
H = 7;
break t;
}
n(St, gt, "ALPH") || (bt[0] = St, mt[0] = gt + 8, Mt[0] = ce), gt += ae, oe -= ae;
}
}
if (l = l[0], G.na = G.na[0], G.P = G.P[0], G.Sa = G.Sa[0], H != 0) break;
}
l = [l], G.Ja = [G.Ja], G.xa = [G.xa];
t: if (Pt = t, H = i, V = l, bt = G.gb[0], mt = G.Ja, Mt = G.xa, St = H[0], gt = !n(Pt, St, "VP8 "), Rt = !n(Pt, St, "VP8L"), e(Pt != null), e(V != null), e(mt != null), e(Mt != null), 8 > V[0]) H = 7;
else {
if (gt || Rt) {
if (Pt = _t(Pt, St + 4), 12 <= bt && Pt > bt - 12) {
H = 3;
break t;
}
if (Z && Pt > V[0] - 8) {
H = 7;
break t;
}
mt[0] = Pt, H[0] += 8, V[0] -= 8, Mt[0] = Rt;
} else Mt[0] = 5 <= V[0] && Pt[St + 0] == 47 && !(Pt[St + 4] >> 5), mt[0] = V[0];
H = 0;
}
if (l = l[0], G.Ja = G.Ja[0], G.xa = G.xa[0], i = i[0], H != 0) break;
if (4294967286 < G.Ja) return 3;
if (A == null || at || (A[0] = G.xa ? 2 : 1), L = [L], vt = [vt], G.xa) {
if (5 > l) {
H = 7;
break;
}
A = L, Z = vt, at = b, t == null || 5 > l ? t = 0 : 5 <= l && t[i + 0] == 47 && !(t[i + 4] >> 5) ? (V = [0], Pt = [0], bt = [0], $(mt = new N(), t, i, l), Tt(mt, V, Pt, bt) ? (A != null && (A[0] = V[0]), Z != null && (Z[0] = Pt[0]), at != null && (at[0] = bt[0]), t = 1) : t = 0) : t = 0;
} else {
if (10 > l) {
H = 7;
break;
}
A = vt, t == null || 10 > l || !va(t, i + 3, l - 3) ? t = 0 : (Z = t[i + 0] | t[i + 1] << 8 | t[i + 2] << 16, at = 16383 & (t[i + 7] << 8 | t[i + 6]), t = 16383 & (t[i + 9] << 8 | t[i + 8]), 1 & Z || 3 < (Z >> 1 & 7) || !(Z >> 4 & 1) || Z >> 5 >= G.Ja || !at || !t ? t = 0 : (L && (L[0] = at), A && (A[0] = t), t = 1));
}
if (!t || (L = L[0], vt = vt[0], K && (I[0] != L || U[0] != vt))) return 3;
x != null && (x[0] = G, x.offset = i - x.w, e(4294967286 > i - x.w), e(x.offset == x.ha - l));
break;
}
return H == 0 || H == 7 && K && x == null ? (b != null && (b[0] |= G.na != null && 0 < G.na.length), d != null && (d[0] = L), m != null && (m[0] = vt), 0) : H;
}
function Ki(t, i, l) {
var d = i.width, m = i.height, b = 0, L = 0, A = d, x = m;
if (i.Da = t != null && 0 < t.Da, i.Da && (A = t.cd, x = t.bd, b = t.v, L = t.j, 11 > l || (b &= -2, L &= -2), 0 > b || 0 > L || 0 >= A || 0 >= x || b + A > d || L + x > m)) return 0;
if (i.v = b, i.j = L, i.va = b + A, i.o = L + x, i.U = A, i.T = x, i.da = t != null && 0 < t.da, i.da) {
if (!Kt(A, x, l = [t.ib], b = [t.hb])) return 0;
i.ib = l[0], i.hb = b[0];
}
return i.ob = t != null && t.ob, i.Kb = t == null || !t.Sd, i.da && (i.ob = i.ib < 3 * d / 4 && i.hb < 3 * m / 4, i.Kb = 0), 1;
}
function Zi(t) {
if (t == null) return 2;
if (11 > t.S) {
var i = t.f.RGBA;
i.fb += (t.height - 1) * i.A, i.A = -i.A;
} else i = t.f.kb, t = t.height, i.O += (t - 1) * i.fa, i.fa = -i.fa, i.N += (t - 1 >> 1) * i.Ab, i.Ab = -i.Ab, i.W += (t - 1 >> 1) * i.Db, i.Db = -i.Db, i.F != null && (i.J += (t - 1) * i.lb, i.lb = -i.lb);
return 0;
}
function hi(t, i, l, d) {
if (d == null || 0 >= t || 0 >= i) return 2;
if (l != null) {
if (l.Da) {
var m = l.cd, b = l.bd, L = -2 & l.v, A = -2 & l.j;
if (0 > L || 0 > A || 0 >= m || 0 >= b || L + m > t || A + b > i) return 2;
t = m, i = b;
}
if (l.da) {
if (!Kt(t, i, m = [l.ib], b = [l.hb])) return 2;
t = m[0], i = b[0];
}
}
d.width = t, d.height = i;
t: {
var x = d.width, I = d.height;
if (t = d.S, 0 >= x || 0 >= I || !(t >= Ta && 13 > t)) t = 2;
else {
if (0 >= d.Rd && d.sd == null) {
L = b = m = i = 0;
var U = (A = x * To[t]) * I;
if (11 > t || (b = (I + 1) / 2 * (i = (x + 1) / 2), t == 12 && (L = (m = x) * I)), (I = s(U + 2 * b + L)) == null) {
t = 1;
break t;
}
d.sd = I, 11 > t ? ((x = d.f.RGBA).eb = I, x.fb = 0, x.A = A, x.size = U) : ((x = d.f.kb).y = I, x.O = 0, x.fa = A, x.Fd = U, x.f = I, x.N = 0 + U, x.Ab = i, x.Cd = b, x.ea = I, x.W = 0 + U + b, x.Db = i, x.Ed = b, t == 12 && (x.F = I, x.J = 0 + U + 2 * b), x.Tc = L, x.lb = m);
}
if (i = 1, m = d.S, b = d.width, L = d.height, m >= Ta && 13 > m) if (11 > m) t = d.f.RGBA, i &= (A = Math.abs(t.A)) * (L - 1) + b <= t.size, i &= A >= b * To[m], i &= t.eb != null;
else {
t = d.f.kb, A = (b + 1) / 2, U = (L + 1) / 2, x = Math.abs(t.fa), I = Math.abs(t.Ab);
var K = Math.abs(t.Db), Z = Math.abs(t.lb), G = Z * (L - 1) + b;
i &= x * (L - 1) + b <= t.Fd, i &= I * (U - 1) + A <= t.Cd, i = (i &= K * (U - 1) + A <= t.Ed) & x >= b & I >= A & K >= A, i &= t.y != null, i &= t.f != null, i &= t.ea != null, m == 12 && (i &= Z >= b, i &= G <= t.Tc, i &= t.F != null);
}
else i = 0;
t = i ? 0 : 2;
}
}
return t != 0 || l != null && l.fd && (t = Zi(d)), t;
}
var Ve = 64, di = [0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535, 131071, 262143, 524287, 1048575, 2097151, 4194303, 8388607, 16777215], pi = 24, gi = 32, $i = 8, on = [0, 0, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7];
xt("Predictor0", "PredictorAdd0"), z.Predictor0 = function() {
return 4278190080;
}, z.Predictor1 = function(t) {
return t;
}, z.Predictor2 = function(t, i, l) {
return i[l + 0];
}, z.Predictor3 = function(t, i, l) {
return i[l + 1];
}, z.Predictor4 = function(t, i, l) {
return i[l - 1];
}, z.Predictor5 = function(t, i, l) {
return kt(kt(t, i[l + 1]), i[l + 0]);
}, z.Predictor6 = function(t, i, l) {
return kt(t, i[l - 1]);
}, z.Predictor7 = function(t, i, l) {
return kt(t, i[l + 0]);
}, z.Predictor8 = function(t, i, l) {
return kt(i[l - 1], i[l + 0]);
}, z.Predictor9 = function(t, i, l) {
return kt(i[l + 0], i[l + 1]);
}, z.Predictor10 = function(t, i, l) {
return kt(kt(t, i[l - 1]), kt(i[l + 0], i[l + 1]));
}, z.Predictor11 = function(t, i, l) {
var d = i[l + 0];
return 0 >= Qt(d >> 24 & 255, t >> 24 & 255, (i = i[l - 1]) >> 24 & 255) + Qt(d >> 16 & 255, t >> 16 & 255, i >> 16 & 255) + Qt(d >> 8 & 255, t >> 8 & 255, i >> 8 & 255) + Qt(255 & d, 255 & t, 255 & i) ? d : t;
}, z.Predictor12 = function(t, i, l) {
var d = i[l + 0];
return (qt((t >> 24 & 255) + (d >> 24 & 255) - ((i = i[l - 1]) >> 24 & 255)) << 24 | qt((t >> 16 & 255) + (d >> 16 & 255) - (i >> 16 & 255)) << 16 | qt((t >> 8 & 255) + (d >> 8 & 255) - (i >> 8 & 255)) << 8 | qt((255 & t) + (255 & d) - (255 & i))) >>> 0;
}, z.Predictor13 = function(t, i, l) {
var d = i[l - 1];
return (Gt((t = kt(t, i[l + 0])) >> 24 & 255, d >> 24 & 255) << 24 | Gt(t >> 16 & 255, d >> 16 & 255) << 16 | Gt(t >> 8 & 255, d >> 8 & 255) << 8 | Gt(t >> 0 & 255, d >> 0 & 255)) >>> 0;
};
var zs = z.PredictorAdd0;
z.PredictorAdd1 = te, xt("Predictor2", "PredictorAdd2"), xt("Predictor3", "PredictorAdd3"), xt("Predictor4", "PredictorAdd4"), xt("Predictor5", "PredictorAdd5"), xt("Predictor6", "PredictorAdd6"), xt("Predictor7", "PredictorAdd7"), xt("Predictor8", "PredictorAdd8"), xt("Predictor9", "PredictorAdd9"), xt("Predictor10", "PredictorAdd10"), xt("Predictor11", "PredictorAdd11"), xt("Predictor12", "PredictorAdd12"), xt("Predictor13", "PredictorAdd13");
var Qi = z.PredictorAdd2;
ee("ColorIndexInverseTransform", "MapARGB", "32b", function(t) {
return t >> 8 & 255;
}, function(t) {
return t;
}), ee("VP8LColorIndexInverseTransformAlpha", "MapAlpha", "8b", function(t) {
return t;
}, function(t) {
return t >> 8 & 255;
});
var Ma, yn = z.ColorIndexInverseTransform, mi = z.MapARGB, Ba = z.VP8LColorIndexInverseTransformAlpha, Ea = z.MapAlpha, vr = z.VP8LPredictorsAdd = [];
vr.length = 16, (z.VP8LPredictors = []).length = 16, (z.VP8LPredictorsAdd_C = []).length = 16, (z.VP8LPredictors_C = []).length = 16;
var Tr, un, en, br, sr, or, vi, ur, Fe, ta, nn, wn, bi, qa, ea, zr, Ur, yr, Hr, yi, Wr, wr, na, Ln, Nn, be, ye, Ie, Re = s(511), lr = s(2041), ra = s(225), wi = s(767), Da = 0, Us = lr, Ra = ra, pn = wi, An = Re, Ta = 0, za = 1, Fo = 2, Ua = 3, Ha = 4, Hs = 5, Io = 6, Ws = 7, Vs = 8, Wa = 9, Gs = 10, Hu = [2, 3, 7], Wu = [3, 3, 11], Co = [280, 256, 256, 256, 40], Vu = [0, 1, 1, 1, 0], Gu = [17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], Ju = [24, 7, 23, 25, 40, 6, 39, 41, 22, 26, 38, 42, 56, 5, 55, 57, 21, 27, 54, 58, 37, 43, 72, 4, 71, 73, 20, 28, 53, 59, 70, 74, 36, 44, 88, 69, 75, 52, 60, 3, 87, 89, 19, 29, 86, 90, 35, 45, 68, 76, 85, 91, 51, 61, 104, 2, 103, 105, 18, 30, 102, 106, 34, 46, 84, 92, 67, 77, 101, 107, 50, 62, 120, 1, 119, 121, 83, 93, 17, 31, 100, 108, 66, 78, 118, 122, 33, 47, 117, 123, 49, 63, 99, 109, 82, 94, 0, 116, 124, 65, 79, 16, 32, 98, 110, 48, 115, 125, 81, 95, 64, 114, 126, 97, 111, 80, 113, 127, 96, 112], Yu = [2954, 2956, 2958, 2962, 2970, 2986, 3018, 3082, 3212, 3468, 3980, 5004], Xu = 8, Js = [4, 5, 6, 7, 8, 9, 10, 10, 11, 12, 13, 14, 15, 16, 17, 17, 18, 19, 20, 20, 21, 21, 22, 22, 23, 23, 24, 25, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 91, 93, 95, 96, 98, 100, 101, 102, 104, 106, 108, 110, 112, 114, 116, 118, 122, 124, 126, 128, 130, 132, 134, 136, 138, 140, 143, 145, 148, 151, 154, 157], Ys = [4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 60, 62, 64, 66, 68, 70, 72, 74, 76, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 112, 114, 116, 119, 122, 125, 128, 131, 134, 137, 140, 143, 146, 149, 152, 155, 158, 161, 164, 167, 170, 173, 177, 181, 185, 189, 193, 197, 201, 205, 209, 213, 217, 221, 225, 229, 234, 239, 245, 249, 254, 259, 264, 269, 274, 279, 284], ia = null, Ku = [[173, 148, 140, 0], [176, 155, 140, 135, 0], [180, 157, 141, 134, 130, 0], [254, 254, 243, 230, 196, 177, 153, 140, 133, 130, 129, 0]], Zu = [0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15], jo = [-0, 1, -1, 2, -2, 3, 4, 6, -3, 5, -4, -5, -6, 7, -7, 8, -8, -9], $u = [[[[128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]], [[253, 136, 254, 255, 228, 219, 128, 128, 128, 128, 128], [189, 129, 242, 255, 227, 213, 255, 219, 128, 128, 128], [106, 126, 227, 252, 214, 209, 255, 255, 128, 128, 128]], [[1, 98, 248, 255, 236, 226, 255, 255, 128, 128, 128], [181, 133, 238, 254, 221, 234, 255, 154, 128, 128, 128], [78, 134, 202, 247, 198, 180, 255, 219, 128, 128, 128]], [[1, 185, 249, 255, 243, 255, 128, 128, 128, 128, 128], [184, 150, 247, 255, 236, 224, 128, 128, 128, 128, 128], [77, 110, 216, 255, 236, 230, 128, 128, 128, 128, 128]], [[1, 101, 251, 255, 241, 255, 128, 128, 128, 128, 128], [170, 139, 241, 252, 236, 209, 255, 255, 128, 128, 128], [37, 116, 196, 243, 228, 255, 255, 255, 128, 128, 128]], [[1, 204, 254, 255, 245, 255, 128, 128, 128, 128, 128], [207, 160, 250, 255, 238, 128, 128, 128, 128, 128, 128], [102, 103, 231, 255, 211, 171, 128, 128, 128, 128, 128]], [[1, 152, 252, 255, 240, 255, 128, 128, 128, 128, 128], [177, 135, 243, 255, 234, 225, 128, 128, 128, 128, 128], [80, 129, 211, 255, 194, 224, 128, 128, 128, 128, 128]], [[1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [246, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [255, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]]], [[[198, 35, 237, 223, 193, 187, 162, 160, 145, 155, 62], [131, 45, 198, 221, 172, 176, 220, 157, 252, 221, 1], [68, 47, 146, 208, 149, 167, 221, 162, 255, 223, 128]], [[1, 149, 241, 255, 221, 224, 255, 255, 128, 128, 128], [184, 141, 234, 253, 222, 220, 255, 199, 128, 128, 128], [81, 99, 181, 242, 176, 190, 249, 202, 255, 255, 128]], [[1, 129, 232, 253, 214, 197, 242, 196, 255, 255, 128], [99, 121, 210, 250, 201, 198, 255, 202, 128, 128, 128], [23, 91, 163, 242, 170, 187, 247, 210, 255, 255, 128]], [[1, 200, 246, 255, 234, 255, 128, 128, 128, 128, 128], [109, 178, 241, 255, 231, 245, 255, 255, 128, 128, 128], [44, 130, 201, 253, 205, 192, 255, 255, 128, 128, 128]], [[1, 132, 239, 251, 219, 209, 255, 165, 128, 128, 128], [94, 136, 225, 251, 218, 190, 255, 255, 128, 128, 128], [22, 100, 174, 245, 186, 161, 255, 199, 128, 128, 128]], [[1, 182, 249, 255, 232, 235, 128, 128, 128, 128, 128], [124, 143, 241, 255, 227, 234, 128, 128, 128, 128, 128], [35, 77, 181, 251, 193, 211, 255, 205, 128, 128, 128]], [[1, 157, 247, 255, 236, 231, 255, 255, 128, 128, 128], [121, 141, 235, 255, 225, 227, 255, 255, 128, 128, 128], [45, 99, 188, 251, 195, 217, 255, 224, 128, 128, 128]], [[1, 1, 251, 255, 213, 255, 128, 128, 128, 128, 128], [203, 1, 248, 255, 255, 128, 128, 128, 128, 128, 128], [137, 1, 177, 255, 224, 255, 128, 128, 128, 128, 128]]], [[[253, 9, 248, 251, 207, 208, 255, 192, 128, 128, 128], [175, 13, 224, 243, 193, 185, 249, 198, 255, 255, 128], [73, 17, 171, 221, 161, 179, 236, 167, 255, 234, 128]], [[1, 95, 247, 253, 212, 183, 255, 255, 128, 128, 128], [239, 90, 244, 250, 211, 209, 255, 255, 128, 128, 128], [155, 77, 195, 248, 188, 195, 255, 255, 128, 128, 128]], [[1, 24, 239, 251, 218, 219, 255, 205, 128, 128, 128], [201, 51, 219, 255, 196, 186, 128, 128, 128, 128, 128], [69, 46, 190, 239, 201, 218, 255, 228, 128, 128, 128]], [[1, 191, 251, 255, 255, 128, 128, 128, 128, 128, 128], [223, 165, 249, 255, 213, 255, 128, 128, 128, 128, 128], [141, 124, 248, 255, 255, 128, 128, 128, 128, 128, 128]], [[1, 16, 248, 255, 255, 128, 128, 128, 128, 128, 128], [190, 36, 230, 255, 236, 255, 128, 128, 128, 128, 128], [149, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128]], [[1, 226, 255, 128, 128, 128, 128, 128, 128, 128, 128], [247, 192, 255, 128, 128, 128, 128, 128, 128, 128, 128], [240, 128, 255, 128, 128, 128, 128, 128, 128, 128, 128]], [[1, 134, 252, 255, 255, 128, 128, 128, 128, 128, 128], [213, 62, 250, 255, 255, 128, 128, 128, 128, 128, 128], [55, 93, 255, 128, 128, 128, 128, 128, 128, 128, 128]], [[128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128], [128, 128, 128, 128, 128, 128, 128, 128, 128, 128, 128]]], [[[202, 24, 213, 235, 186, 191, 220, 160, 240, 175, 255], [126, 38, 182, 232, 169, 184, 228, 174, 255, 187, 128], [61, 46, 138, 219, 151, 178, 240, 170, 255, 216, 128]], [[1, 112, 230, 250, 199, 191, 247, 159, 255, 255, 128], [166, 109, 228, 252, 211, 215, 255, 174, 128, 128, 128], [39, 77, 162, 232, 172, 180, 245, 178, 255, 255, 128]], [[1, 52, 220, 246, 198, 199, 249, 220, 255, 255, 128], [124, 74, 191, 243, 183, 193, 250, 221, 255, 255, 128], [24, 71, 130, 219, 154, 170, 243, 182, 255, 255, 128]], [[1, 182, 225, 249, 219, 240, 255, 224, 128, 128, 128], [149, 150, 226, 252, 216, 205, 255, 171, 128, 128, 128], [28, 108, 170, 242, 183, 194, 254, 223, 255, 255, 128]], [[1, 81, 230, 252, 204, 203, 255, 192, 128, 128, 128], [123, 102, 209, 247, 188, 196, 255, 233, 128, 128, 128], [20, 95, 153, 243, 164, 173, 255, 203, 128, 128, 128]], [[1, 222, 248, 255, 216, 213, 128, 128, 128, 128, 128], [168, 175, 246, 252, 235, 205, 255, 255, 128, 128, 128], [47, 116, 215, 255, 211, 212, 255, 255, 128, 128, 128]], [[1, 121, 236, 253, 212, 214, 255, 255, 128, 128, 128], [141, 84, 213, 252, 201, 202, 255, 219, 128, 128, 128], [42, 80, 160, 240, 162, 185, 255, 205, 128, 128, 128]], [[1, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [244, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128], [238, 1, 255, 128, 128, 128, 128, 128, 128, 128, 128]]]], Qu = [[[231, 120, 48, 89, 115, 113, 120, 152, 112], [152, 179, 64, 126, 170, 118, 46, 70, 95], [175, 69, 143, 80, 85, 82, 72, 155, 103], [56, 58, 10, 171, 218, 189, 17, 13, 152], [114, 26, 17, 163, 44, 195, 21, 10, 173], [121, 24, 80, 195, 26, 62, 44, 64, 85], [144, 71, 10, 38, 171, 213, 144, 34, 26], [170, 46, 55, 19, 136, 160, 33, 206, 71], [63, 20, 8, 114, 114, 208, 12, 9, 226], [81, 40, 11, 96, 182, 84, 29, 16, 36]], [[134, 183, 89, 137, 98, 101, 106, 165, 148], [72, 187, 100, 130, 157, 111, 32, 75, 80], [66, 102, 167, 99, 74, 62, 40, 234, 128], [41, 53, 9, 178, 241, 141, 26, 8, 107], [74, 43, 26, 146, 73, 166, 49, 23, 157], [65, 38, 105, 160, 51, 52, 31, 115, 128], [104, 79, 12, 27, 217, 255, 87, 17, 7], [87, 68, 71, 44, 114, 51, 15, 186, 23], [47, 41, 14, 110, 182, 183, 21, 17, 194], [66, 45, 25, 102, 197, 189, 23, 18, 22]], [[88, 88, 147, 150, 42, 46, 45, 196, 205], [43, 97, 183, 117, 85, 38, 35, 179, 61], [39, 53, 200, 87, 26, 21, 43, 232, 171], [56, 34, 51, 104, 114, 102, 29, 93, 77], [39, 28, 85, 171, 58, 165, 90, 98, 64], [34, 22, 116, 206, 23, 34, 43, 166, 73], [107, 54, 32, 26, 51, 1, 81, 43, 31], [68, 25, 106, 22, 64, 171, 36, 225, 114], [34, 19, 21, 102, 132, 188, 16, 76, 124], [62, 18, 78, 95, 85, 57, 50, 48, 51]], [[193, 101, 35, 159, 215, 111, 89, 46, 111], [60, 148, 31, 172, 219, 228, 21, 18, 111], [112, 113, 77, 85, 179, 255, 38, 120, 114], [40, 42, 1, 196, 245, 209, 10, 25, 109], [88, 43, 29, 140, 166, 213, 37, 43, 154], [61, 63, 30, 155, 67, 45, 68, 1, 209], [100, 80, 8, 43, 154, 1, 51, 26, 71], [142, 78, 78, 16, 255, 128, 34, 197, 171], [41, 40, 5, 102, 211, 183, 4, 1, 221], [51, 50, 17, 168, 209, 192, 23, 25, 82]], [[138, 31, 36, 171, 27, 166, 38, 44, 229], [67, 87, 58, 169, 82, 115, 26, 59, 179], [63, 59, 90, 180, 59, 166, 93, 73, 154], [40, 40, 21, 116, 143, 209, 34, 39, 175], [47, 15, 16, 183, 34, 223, 49, 45, 183], [46, 17, 33, 183, 6, 98, 15, 32, 183], [57, 46, 22, 24, 128, 1, 54, 17, 37], [65, 32, 73, 115, 28, 128, 23, 128, 205], [40, 3, 9, 115, 51, 192, 18, 6, 223], [87, 37, 9, 115, 59, 77, 64, 21, 47]], [[104, 55, 44, 218, 9, 54, 53, 130, 226], [64, 90, 70, 205, 40, 41, 23, 26, 57], [54, 57, 112, 184, 5, 41, 38, 166, 213], [30, 34, 26, 133, 152, 116, 10, 32, 134], [39, 19, 53, 221, 26, 114, 32, 73, 255], [31, 9, 65, 234, 2, 15, 1, 118, 73], [75, 32, 12, 51, 192, 255, 160, 43, 51], [88, 31, 35, 67, 102, 85, 55, 186, 85], [56, 21, 23, 111, 59, 205, 45, 37, 192], [55, 38, 70, 124, 73, 102, 1, 34, 98]], [[125, 98, 42, 88, 104, 85, 117, 175, 82], [95, 84, 53, 89, 128, 100, 113, 101, 45], [75, 79, 123, 47, 51, 128, 81, 171, 1], [57, 17, 5, 71, 102, 57, 53, 41, 49], [38, 33, 13, 121, 57, 73, 26, 1, 85], [41, 10, 67, 138, 77, 110, 90, 47, 114], [115, 21, 2, 10, 102, 255, 166, 23, 6], [101, 29, 16, 10, 85, 128, 101, 196, 26], [57, 18, 10, 102, 102, 213, 34, 20, 43], [117, 20, 15, 36, 163, 128, 68, 1, 26]], [[102, 61, 71, 37, 34, 53, 31, 243, 192], [69, 60, 71, 38, 73, 119, 28, 222, 37], [68, 45, 128, 34, 1, 47, 11, 245, 171], [62, 17, 19, 70, 146, 85, 55, 62, 70], [37, 43, 37, 154, 100, 163, 85, 160, 1], [63, 9, 92, 136, 28, 64, 32, 201, 85], [75, 15, 9, 9, 64, 255, 184, 119, 16], [86, 6, 28, 5, 64, 255, 25, 248, 1], [56, 8, 17, 132, 137, 255, 55, 116, 128], [58, 15, 20, 82, 135, 57, 26, 121, 40]], [[164, 50, 31, 137, 154, 133, 25, 35, 218], [51, 103, 44, 131, 131, 123, 31, 6, 158], [86, 40, 64, 135, 148, 224, 45, 183, 128], [22, 26, 17, 131, 240, 154, 14, 1, 209], [45, 16, 21, 91, 64, 222, 7, 1, 197], [56, 21, 39, 155, 60, 138, 23, 102, 213], [83, 12, 13, 54, 192, 255, 68, 47, 28], [85, 26, 85, 85, 128, 128, 32, 146, 171], [18, 11, 7, 63, 144, 171, 4, 4, 246], [35, 27, 10, 146, 174, 171, 12, 26, 128]], [[190, 80, 35, 99, 180, 80, 126, 54, 45], [85, 126, 47, 87, 176, 51, 41, 20, 32], [101, 75, 128, 139, 118, 146, 116, 128, 85], [56, 41, 15, 176, 236, 85, 37, 9, 62], [71, 30, 17, 119, 118, 255, 17, 18, 138], [101, 38, 60, 138, 55, 70, 43, 26, 142], [146, 36, 19, 30, 171, 255, 97, 27, 20], [138, 45, 61, 62, 219, 1, 81, 188, 64], [32, 41, 20, 117, 151, 142, 20, 21, 163], [112, 19, 12, 61, 195, 128, 48, 4, 24]]], tl = [[[[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[176, 246, 255, 255, 255, 255, 255, 255, 255, 255, 255], [223, 241, 252, 255, 255, 255, 255, 255, 255, 255, 255], [249, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 244, 252, 255, 255, 255, 255, 255, 255, 255, 255], [234, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 246, 254, 255, 255, 255, 255, 255, 255, 255, 255], [239, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255], [251, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [251, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 253, 255, 254, 255, 255, 255, 255, 255, 255], [250, 255, 254, 255, 254, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]], [[[217, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [225, 252, 241, 253, 255, 255, 254, 255, 255, 255, 255], [234, 250, 241, 250, 253, 255, 253, 254, 255, 255, 255]], [[255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [223, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [238, 253, 254, 254, 255, 255, 255, 255, 255, 255, 255]], [[255, 248, 254, 255, 255, 255, 255, 255, 255, 255, 255], [249, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 255, 255, 255, 255, 255, 255, 255, 255, 255], [247, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [252, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [253, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255], [250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]], [[[186, 251, 250, 255, 255, 255, 255, 255, 255, 255, 255], [234, 251, 244, 254, 255, 255, 255, 255, 255, 255, 255], [251, 251, 243, 253, 254, 255, 254, 255, 255, 255, 255]], [[255, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [236, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [251, 253, 253, 254, 254, 255, 255, 255, 255, 255, 255]], [[255, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [254, 254, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]], [[[248, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [250, 254, 252, 254, 255, 255, 255, 255, 255, 255, 255], [248, 254, 249, 253, 255, 255, 255, 255, 255, 255, 255]], [[255, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255], [246, 253, 253, 255, 255, 255, 255, 255, 255, 255, 255], [252, 254, 251, 254, 254, 255, 255, 255, 255, 255, 255]], [[255, 254, 252, 255, 255, 255, 255, 255, 255, 255, 255], [248, 254, 253, 255, 255, 255, 255, 255, 255, 255, 255], [253, 255, 254, 254, 255, 255, 255, 255, 255, 255, 255]], [[255, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255], [245, 251, 254, 255, 255, 255, 255, 255, 255, 255, 255], [253, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 251, 253, 255, 255, 255, 255, 255, 255, 255, 255], [252, 253, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 254, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 252, 255, 255, 255, 255, 255, 255, 255, 255, 255], [249, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 254, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 253, 255, 255, 255, 255, 255, 255, 255, 255], [250, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]], [[255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [254, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255], [255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255]]]], el = [0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 0], Lr = [], Bn = [], cr = [], nl = 1, Oo = 2, Nr = [], xn = [];
ut("UpsampleRgbLinePair", re, 3), ut("UpsampleBgrLinePair", Ne, 3), ut("UpsampleRgbaLinePair", Mn, 4), ut("UpsampleBgraLinePair", Te, 4), ut("UpsampleArgbLinePair", Xe, 4), ut("UpsampleRgba4444LinePair", Be, 2), ut("UpsampleRgb565LinePair", Se, 2);
var rl = z.UpsampleRgbLinePair, il = z.UpsampleBgrLinePair, Mo = z.UpsampleRgbaLinePair, Bo = z.UpsampleBgraLinePair, Eo = z.UpsampleArgbLinePair, qo = z.UpsampleRgba4444LinePair, al = z.UpsampleRgb565LinePair, Va = 16, Ga = 1 << Va - 1, aa = -227, Xs = 482, sl = 6, Do = 0, ol = s(256), ul = s(256), ll = s(256), cl = s(256), fl = s(Xs - aa), hl = s(Xs - aa);
Kn("YuvToRgbRow", re, 3), Kn("YuvToBgrRow", Ne, 3), Kn("YuvToRgbaRow", Mn, 4), Kn("YuvToBgraRow", Te, 4), Kn("YuvToArgbRow", Xe, 4), Kn("YuvToRgba4444Row", Be, 2), Kn("YuvToRgb565Row", Se, 2);
var Ro = [0, 4, 8, 12, 128, 132, 136, 140, 256, 260, 264, 268, 384, 388, 392, 396], Ja = [0, 2, 8], dl = [8, 7, 6, 4, 4, 2, 2, 2, 1, 1, 1, 1], pl = 1;
this.WebPDecodeRGBA = function(t, i, l, d, m) {
var b = za, L = new li(), A = new Pn();
L.ba = A, A.S = b, A.width = [A.width], A.height = [A.height];
var x = A.width, I = A.height, U = new nr();
if (U == null || t == null) var K = 2;
else e(U != null), K = fi(t, i, l, U.width, U.height, U.Pd, U.Qd, U.format, null);
if (K != 0 ? x = 0 : (x != null && (x[0] = U.width[0]), I != null && (I[0] = U.height[0]), x = 1), x) {
A.width = A.width[0], A.height = A.height[0], d != null && (d[0] = A.width), m != null && (m[0] = A.height);
t: {
if (d = new ni(), (m = new Wi()).data = t, m.w = i, m.ha = l, m.kd = 1, i = [0], e(m != null), ((t = fi(m.data, m.w, m.ha, null, null, null, i, null, m)) == 0 || t == 7) && i[0] && (t = 4), (i = t) == 0) {
if (e(L != null), d.data = m.data, d.w = m.w + m.offset, d.ha = m.ha - m.offset, d.put = Hn, d.ac = We, d.bc = Wn, d.ma = L, m.xa) {
if ((t = bn()) == null) {
L = 1;
break t;
}
if (function(Z, G) {
var vt = [0], at = [0], H = [0];
e: for (; ; ) {
if (Z == null) return 0;
if (G == null) return Z.a = 2, 0;
if (Z.l = G, Z.a = 0, $(Z.m, G.data, G.w, G.ha), !Tt(Z.m, vt, at, H)) {
Z.a = 3;
break e;
}
if (Z.xb = Oo, G.width = vt[0], G.height = at[0], !Jn(vt[0], at[0], 1, Z, null)) break e;
return 1;
}
return e(Z.a != 0), 0;
}(t, d)) {
if (d = (i = hi(d.width, d.height, L.Oa, L.ba)) == 0) {
e: {
d = t;
n: for (; ; ) {
if (d == null) {
d = 0;
break e;
}
if (e(d.s.yc != null), e(d.s.Ya != null), e(0 < d.s.Wb), e((l = d.l) != null), e((m = l.ma) != null), d.xb != 0) {
if (d.ca = m.ba, d.tb = m.tb, e(d.ca != null), !Ki(m.Oa, l, Ua)) {
d.a = 2;
break n;
}
if (!Br(d, l.width) || l.da) break n;
if ((l.da || ue(d.ca.S)) && X(), 11 > d.ca.S || (alert("todo:WebPInitConvertARGBToYUV"), d.ca.f.kb.F != null && X()), d.Pb && 0 < d.s.ua && d.s.vb.X == null && !zt(d.s.vb, d.s.Wa.Xa)) {
d.a = 1;
break n;
}
d.xb = 0;
}
if (!Cn(d, d.V, d.Ba, d.c, d.i, l.o, Kr)) break n;
m.Dc = d.Ma, d = 1;
break e;
}
e(d.a != 0), d = 0;
}
d = !d;
}
d && (i = t.a);
} else i = t.a;
} else {
if ((t = new Ns()) == null) {
L = 1;
break t;
}
if (t.Fa = m.na, t.P = m.P, t.qc = m.Sa, ba(t, d)) {
if ((i = hi(d.width, d.height, L.Oa, L.ba)) == 0) {
if (t.Aa = 0, l = L.Oa, e((m = t) != null), l != null) {
if (0 < (x = 0 > (x = l.Md) ? 0 : 100 < x ? 255 : 255 * x / 100)) {
for (I = U = 0; 4 > I; ++I) 12 > (K = m.pb[I]).lc && (K.ia = x * dl[0 > K.lc ? 0 : K.lc] >> 3), U |= K.ia;
U && (alert("todo:VP8InitRandom"), m.ia = 1);
}
m.Ga = l.Id, 100 < m.Ga ? m.Ga = 100 : 0 > m.Ga && (m.Ga = 0);
}
As(t, d) || (i = t.a);
}
} else i = t.a;
}
i == 0 && L.Oa != null && L.Oa.fd && (i = Zi(L.ba));
}
L = i;
}
b = L != 0 ? null : 11 > b ? A.f.RGBA.eb : A.f.kb.y;
} else b = null;
return b;
};
var To = [3, 4, 3, 4, 4, 2, 2, 4, 4, 4, 2, 1, 1];
};
function g(z, rt) {
for (var pt = "", P = 0; P < 4; P++) pt += String.fromCharCode(z[rt++]);
return pt;
}
function y(z, rt) {
return (z[rt + 0] << 0 | z[rt + 1] << 8 | z[rt + 2] << 16) >>> 0;
}
function w(z, rt) {
return (z[rt + 0] << 0 | z[rt + 1] << 8 | z[rt + 2] << 16 | z[rt + 3] << 24) >>> 0;
}
new h();
var S = [0], p = [0], O = [], F = new h(), q = r, _ = function(z, rt) {
var pt = {}, P = 0, k = !1, W = 0, D = 0;
if (pt.frames = [], !/** @license
* Copyright (c) 2017 Dominik Homberger
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.
https://webpjs.appspot.com
WebPRiffParser dominikhlbg@gmail.com
*/
function(C, B, T, J) {
for (var Q = 0; Q < J; Q++) if (C[B + Q] != T.charCodeAt(Q)) return !0;
return !1;
}(z, rt, "RIFF", 4)) {
for (w(z, rt += 4), rt += 8; rt < z.length; ) {
var ot = g(z, rt), it = w(z, rt += 4);
rt += 4;
var ft = it + (1 & it);
switch (ot) {
case "VP8 ":
case "VP8L":
pt.frames[P] === void 0 && (pt.frames[P] = {}), (dt = pt.frames[P]).src_off = k ? D : rt - 8, dt.src_size = W + it + 8, P++, k && (k = !1, W = 0, D = 0);
break;
case "VP8X":
(dt = pt.header = {}).feature_flags = z[rt];
var $ = rt + 4;
dt.canvas_width = 1 + y(z, $), $ += 3, dt.canvas_height = 1 + y(z, $), $ += 3;
break;
case "ALPH":
k = !0, W = ft + 8, D = rt - 8;
break;
case "ANIM":
(dt = pt.header).bgcolor = w(z, rt), $ = rt + 4, dt.loop_count = (jt = z)[(N = $) + 0] << 0 | jt[N + 1] << 8, $ += 2;
break;
case "ANMF":
var lt, dt;
(dt = pt.frames[P] = {}).offset_x = 2 * y(z, rt), rt += 3, dt.offset_y = 2 * y(z, rt), rt += 3, dt.width = 1 + y(z, rt), rt += 3, dt.height = 1 + y(z, rt), rt += 3, dt.duration = y(z, rt), rt += 3, lt = z[rt++], dt.dispose = 1 & lt, dt.blend = lt >> 1 & 1;
}
ot != "ANMF" && (rt += ft);
}
var jt, N;
return pt;
}
}(q, 0);
_.response = q, _.rgbaoutput = !0, _.dataurl = !1;
var M = _.header ? _.header : null, Y = _.frames ? _.frames : null;
if (M) {
M.loop_counter = M.loop_count, S = [M.canvas_height], p = [M.canvas_width];
for (var st = 0; st < Y.length && Y[st].blend != 0; st++) ;
}
var ct = Y[0], wt = F.WebPDecodeRGBA(q, ct.src_off, ct.src_size, p, S);
ct.rgba = wt, ct.imgwidth = p[0], ct.imgheight = S[0];
for (var tt = 0; tt < p[0] * S[0] * 4; tt++) O[tt] = wt[tt];
return this.width = p, this.height = S, this.data = O, this;
}
(function(r) {
var e = function() {
return typeof yo == "function";
}, n = function(S, p, O, F) {
var q = 4, _ = c;
switch (F) {
case r.image_compression.FAST:
q = 1, _ = s;
break;
case r.image_compression.MEDIUM:
q = 6, _ = f;
break;
case r.image_compression.SLOW:
q = 9, _ = h;
}
S = a(S, p, O, _);
var M = yo(S, { level: q });
return r.__addimage__.arrayBufferToBinaryString(M);
}, a = function(S, p, O, F) {
for (var q, _, M, Y = S.length / p, st = new Uint8Array(S.length + Y), ct = y(), wt = 0; wt < Y; wt += 1) {
if (M = wt * p, q = S.subarray(M, M + p), F) st.set(F(q, O, _), M + wt);
else {
for (var tt, z = ct.length, rt = []; tt < z; tt += 1) rt[tt] = ct[tt](q, O, _);
var pt = w(rt.concat());
st.set(rt[pt], M + wt);
}
_ = q;
}
return st;
}, u = function(S) {
var p = Array.apply([], S);
return p.unshift(0), p;
}, s = function(S, p) {
var O, F = [], q = S.length;
F[0] = 1;
for (var _ = 0; _ < q; _ += 1) O = S[_ - p] || 0, F[_ + 1] = S[_] - O + 256 & 255;
return F;
}, c = function(S, p, O) {
var F, q = [], _ = S.length;
q[0] = 2;
for (var M = 0; M < _; M += 1) F = O && O[M] || 0, q[M + 1] = S[M] - F + 256 & 255;
return q;
}, f = function(S, p, O) {
var F, q, _ = [], M = S.length;
_[0] = 3;
for (var Y = 0; Y < M; Y += 1) F = S[Y - p] || 0, q = O && O[Y] || 0, _[Y + 1] = S[Y] + 256 - (F + q >>> 1) & 255;
return _;
}, h = function(S, p, O) {
var F, q, _, M, Y = [], st = S.length;
Y[0] = 4;
for (var ct = 0; ct < st; ct += 1) F = S[ct - p] || 0, q = O && O[ct] || 0, _ = O && O[ct - p] || 0, M = g(F, q, _), Y[ct + 1] = S[ct] - M + 256 & 255;
return Y;
}, g = function(S, p, O) {
if (S === p && p === O) return S;
var F = Math.abs(p - O), q = Math.abs(S - O), _ = Math.abs(S + p - O - O);
return F <= q && F <= _ ? S : q <= _ ? p : O;
}, y = function() {
return [u, s, c, f, h];
}, w = function(S) {
var p = S.map(function(O) {
return O.reduce(function(F, q) {
return F + Math.abs(q);
}, 0);
});
return p.indexOf(Math.min.apply(null, p));
};
r.processPNG = function(S, p, O, F) {
var q, _, M, Y, st, ct, wt, tt, z, rt, pt, P, k, W, D, ot = this.decode.FLATE_DECODE, it = "";
if (this.__addimage__.isArrayBuffer(S) && (S = new Uint8Array(S)), this.__addimage__.isArrayBufferView(S)) {
if (S = (M = new sc(S)).imgData, _ = M.bits, q = M.colorSpace, st = M.colors, [4, 6].indexOf(M.colorType) !== -1) {
if (M.bits === 8) {
z = (tt = M.pixelBitlength == 32 ? new Uint32Array(M.decodePixels().buffer) : M.pixelBitlength == 16 ? new Uint16Array(M.decodePixels().buffer) : new Uint8Array(M.decodePixels().buffer)).length, pt = new Uint8Array(z * M.colors), rt = new Uint8Array(z);
var ft, $ = M.pixelBitlength - M.bits;
for (W = 0, D = 0; W < z; W++) {
for (k = tt[W], ft = 0; ft < $; ) pt[D++] = k >>> ft & 255, ft += M.bits;
rt[W] = k >>> ft & 255;
}
}
if (M.bits === 16) {
z = (tt = new Uint32Array(M.decodePixels().buffer)).length, pt = new Uint8Array(z * (32 / M.pixelBitlength) * M.colors), rt = new Uint8Array(z * (32 / M.pixelBitlength)), P = M.colors > 1, W = 0, D = 0;
for (var lt = 0; W < z; ) k = tt[W++], pt[D++] = k >>> 0 & 255, P && (pt[D++] = k >>> 16 & 255, k = tt[W++], pt[D++] = k >>> 0 & 255), rt[lt++] = k >>> 16 & 255;
_ = 8;
}
F !== r.image_compression.NONE && e() ? (S = n(pt, M.width * M.colors, M.colors, F), wt = n(rt, M.width, 1, F)) : (S = pt, wt = rt, ot = void 0);
}
if (M.colorType === 3 && (q = this.color_spaces.INDEXED, ct = M.palette, M.transparency.indexed)) {
var dt = M.transparency.indexed, jt = 0;
for (W = 0, z = dt.length; W < z; ++W) jt += dt[W];
if ((jt /= 255) === z - 1 && dt.indexOf(0) !== -1) Y = [dt.indexOf(0)];
else if (jt !== z) {
for (tt = M.decodePixels(), rt = new Uint8Array(tt.length), W = 0, z = tt.length; W < z; W++) rt[W] = dt[tt[W]];
wt = n(rt, M.width, 1);
}
}
var N = function(C) {
var B;
switch (C) {
case r.image_compression.FAST:
B = 11;
break;
case r.image_compression.MEDIUM:
B = 13;
break;
case r.image_compression.SLOW:
B = 14;
break;
default:
B = 12;
}
return B;
}(F);
return ot === this.decode.FLATE_DECODE && (it = "/Predictor " + N + " "), it += "/Colors " + st + " /BitsPerComponent " + _ + " /Columns " + M.width, (this.__addimage__.isArrayBuffer(S) || this.__addimage__.isArrayBufferView(S)) && (S = this.__addimage__.arrayBufferToBinaryString(S)), (wt && this.__addimage__.isArrayBuffer(wt) || this.__addimage__.isArrayBufferView(wt)) && (wt = this.__addimage__.arrayBufferToBinaryString(wt)), { alias: O, data: S, index: p, filter: ot, decodeParameters: it, transparency: Y, palette: ct, sMask: wt, predictor: N, width: M.width, height: M.height, bitsPerComponent: _, colorSpace: q };
}
};
})(Ut.API), function(r) {
r.processGIF89A = function(e, n, a, u) {
var s = new oc(e), c = s.width, f = s.height, h = [];
s.decodeAndBlitFrameRGBA(0, h);
var g = { data: h, width: c, height: f }, y = new po(100).encode(g, 100);
return r.processJPEG.call(this, y, n, a, u);
}, r.processGIF87A = r.processGIF89A;
}(Ut.API), Dn.prototype.parseHeader = function() {
if (this.fileSize = this.datav.getUint32(this.pos, !0), this.pos += 4, this.reserved = this.datav.getUint32(this.pos, !0), this.pos += 4, this.offset = this.datav.getUint32(this.pos, !0), this.pos += 4, this.headerSize = this.datav.getUint32(this.pos, !0), this.pos += 4, this.width = this.datav.getUint32(this.pos, !0), this.pos += 4, this.height = this.datav.getInt32(this.pos, !0), this.pos += 4, this.planes = this.datav.getUint16(this.pos, !0), this.pos += 2, this.bitPP = this.datav.getUint16(this.pos, !0), this.pos += 2, this.compress = this.datav.getUint32(this.pos, !0), this.pos += 4, this.rawSize = this.datav.getUint32(this.pos, !0), this.pos += 4, this.hr = this.datav.getUint32(this.pos, !0), this.pos += 4, this.vr = this.datav.getUint32(this.pos, !0), this.pos += 4, this.colors = this.datav.getUint32(this.pos, !0), this.pos += 4, this.importantColors = this.datav.getUint32(this.pos, !0), this.pos += 4, this.bitPP === 16 && this.is_with_alpha && (this.bitPP = 15), this.bitPP < 15) {
var r = this.colors === 0 ? 1 << this.bitPP : this.colors;
this.palette = new Array(r);
for (var e = 0; e < r; e++) {
var n = this.datav.getUint8(this.pos++, !0), a = this.datav.getUint8(this.pos++, !0), u = this.datav.getUint8(this.pos++, !0), s = this.datav.getUint8(this.pos++, !0);
this.palette[e] = { red: u, green: a, blue: n, quad: s };
}
}
this.height < 0 && (this.height *= -1, this.bottom_up = !1);
}, Dn.prototype.parseBGR = function() {
this.pos = this.offset;
try {
var r = "bit" + this.bitPP, e = this.width * this.height * 4;
this.data = new Uint8Array(e), this[r]();
} catch (n) {
ve.log("bit decode error:" + n);
}
}, Dn.prototype.bit1 = function() {
var r, e = Math.ceil(this.width / 8), n = e % 4;
for (r = this.height - 1; r >= 0; r--) {
for (var a = this.bottom_up ? r : this.height - 1 - r, u = 0; u < e; u++) for (var s = this.datav.getUint8(this.pos++, !0), c = a * this.width * 4 + 8 * u * 4, f = 0; f < 8 && 8 * u + f < this.width; f++) {
var h = this.palette[s >> 7 - f & 1];
this.data[c + 4 * f] = h.blue, this.data[c + 4 * f + 1] = h.green, this.data[c + 4 * f + 2] = h.red, this.data[c + 4 * f + 3] = 255;
}
n !== 0 && (this.pos += 4 - n);
}
}, Dn.prototype.bit4 = function() {
for (var r = Math.ceil(this.width / 2), e = r % 4, n = this.height - 1; n >= 0; n--) {
for (var a = this.bottom_up ? n : this.height - 1 - n, u = 0; u < r; u++) {
var s = this.datav.getUint8(this.pos++, !0), c = a * this.width * 4 + 2 * u * 4, f = s >> 4, h = 15 & s, g = this.palette[f];
if (this.data[c] = g.blue, this.data[c + 1] = g.green, this.data[c + 2] = g.red, this.data[c + 3] = 255, 2 * u + 1 >= this.width) break;
g = this.palette[h], this.data[c + 4] = g.blue, this.data[c + 4 + 1] = g.green, this.data[c + 4 + 2] = g.red, this.data[c + 4 + 3] = 255;
}
e !== 0 && (this.pos += 4 - e);
}
}, Dn.prototype.bit8 = function() {
for (var r = this.width % 4, e = this.height - 1; e >= 0; e--) {
for (var n = this.bottom_up ? e : this.height - 1 - e, a = 0; a < this.width; a++) {
var u = this.datav.getUint8(this.pos++, !0), s = n * this.width * 4 + 4 * a;
if (u < this.palette.length) {
var c = this.palette[u];
this.data[s] = c.red, this.data[s + 1] = c.green, this.data[s + 2] = c.blue, this.data[s + 3] = 255;
} else this.data[s] = 255, this.data[s + 1] = 255, this.data[s + 2] = 255, this.data[s + 3] = 255;
}
r !== 0 && (this.pos += 4 - r);
}
}, Dn.prototype.bit15 = function() {
for (var r = this.width % 3, e = parseInt("11111", 2), n = this.height - 1; n >= 0; n--) {
for (var a = this.bottom_up ? n : this.height - 1 - n, u = 0; u < this.width; u++) {
var s = this.datav.getUint16(this.pos, !0);
this.pos += 2;
var c = (s & e) / e * 255 | 0, f = (s >> 5 & e) / e * 255 | 0, h = (s >> 10 & e) / e * 255 | 0, g = s >> 15 ? 255 : 0, y = a * this.width * 4 + 4 * u;
this.data[y] = h, this.data[y + 1] = f, this.data[y + 2] = c, this.data[y + 3] = g;
}
this.pos += r;
}
}, Dn.prototype.bit16 = function() {
for (var r = this.width % 3, e = parseInt("11111", 2), n = parseInt("111111", 2), a = this.height - 1; a >= 0; a--) {
for (var u = this.bottom_up ? a : this.height - 1 - a, s = 0; s < this.width; s++) {
var c = this.datav.getUint16(this.pos, !0);
this.pos += 2;
var f = (c & e) / e * 255 | 0, h = (c >> 5 & n) / n * 255 | 0, g = (c >> 11) / e * 255 | 0, y = u * this.width * 4 + 4 * s;
this.data[y] = g, this.data[y + 1] = h, this.data[y + 2] = f, this.data[y + 3] = 255;
}
this.pos += r;
}
}, Dn.prototype.bit24 = function() {
for (var r = this.height - 1; r >= 0; r--) {
for (var e = this.bottom_up ? r : this.height - 1 - r, n = 0; n < this.width; n++) {
var a = this.datav.getUint8(this.pos++, !0), u = this.datav.getUint8(this.pos++, !0), s = this.datav.getUint8(this.pos++, !0), c = e * this.width * 4 + 4 * n;
this.data[c] = s, this.data[c + 1] = u, this.data[c + 2] = a, this.data[c + 3] = 255;
}
this.pos += this.width % 4;
}
}, Dn.prototype.bit32 = function() {
for (var r = this.height - 1; r >= 0; r--) for (var e = this.bottom_up ? r : this.height - 1 - r, n = 0; n < this.width; n++) {
var a = this.datav.getUint8(this.pos++, !0), u = this.datav.getUint8(this.pos++, !0), s = this.datav.getUint8(this.pos++, !0), c = this.datav.getUint8(this.pos++, !0), f = e * this.width * 4 + 4 * n;
this.data[f] = s, this.data[f + 1] = u, this.data[f + 2] = a, this.data[f + 3] = c;
}
}, Dn.prototype.getData = function() {
return this.data;
}, /**
* @license
* Copyright (c) 2018 Aras Abbasi
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(r) {
r.processBMP = function(e, n, a, u) {
var s = new Dn(e, !1), c = s.width, f = s.height, h = { data: s.getData(), width: c, height: f }, g = new po(100).encode(h, 100);
return r.processJPEG.call(this, g, n, a, u);
};
}(Ut.API), wu.prototype.getData = function() {
return this.data;
}, /**
* @license
* Copyright (c) 2019 Aras Abbasi
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(r) {
r.processWEBP = function(e, n, a, u) {
var s = new wu(e), c = s.width, f = s.height, h = { data: s.getData(), width: c, height: f }, g = new po(100).encode(h, 100);
return r.processJPEG.call(this, g, n, a, u);
};
}(Ut.API), Ut.API.processRGBA = function(r, e, n) {
for (var a = r.data, u = a.length, s = new Uint8Array(u / 4 * 3), c = new Uint8Array(u / 4), f = 0, h = 0, g = 0; g < u; g += 4) {
var y = a[g], w = a[g + 1], S = a[g + 2], p = a[g + 3];
s[f++] = y, s[f++] = w, s[f++] = S, c[h++] = p;
}
var O = this.__addimage__.arrayBufferToBinaryString(s);
return { alpha: this.__addimage__.arrayBufferToBinaryString(c), data: O, index: e, alias: n, colorSpace: "DeviceRGB", bitsPerComponent: 8, width: r.width, height: r.height };
}, Ut.API.setLanguage = function(r) {
return this.internal.languageSettings === void 0 && (this.internal.languageSettings = {}, this.internal.languageSettings.isSubscribed = !1), { af: "Afrikaans", sq: "Albanian", ar: "Arabic (Standard)", "ar-DZ": "Arabic (Algeria)", "ar-BH": "Arabic (Bahrain)", "ar-EG": "Arabic (Egypt)", "ar-IQ": "Arabic (Iraq)", "ar-JO": "Arabic (Jordan)", "ar-KW": "Arabic (Kuwait)", "ar-LB": "Arabic (Lebanon)", "ar-LY": "Arabic (Libya)", "ar-MA": "Arabic (Morocco)", "ar-OM": "Arabic (Oman)", "ar-QA": "Arabic (Qatar)", "ar-SA": "Arabic (Saudi Arabia)", "ar-SY": "Arabic (Syria)", "ar-TN": "Arabic (Tunisia)", "ar-AE": "Arabic (U.A.E.)", "ar-YE": "Arabic (Yemen)", an: "Aragonese", hy: "Armenian", as: "Assamese", ast: "Asturian", az: "Azerbaijani", eu: "Basque", be: "Belarusian", bn: "Bengali", bs: "Bosnian", br: "Breton", bg: "Bulgarian", my: "Burmese", ca: "Catalan", ch: "Chamorro", ce: "Chechen", zh: "Chinese", "zh-HK": "Chinese (Hong Kong)", "zh-CN": "Chinese (PRC)", "zh-SG": "Chinese (Singapore)", "zh-TW": "Chinese (Taiwan)", cv: "Chuvash", co: "Corsican", cr: "Cree", hr: "Croatian", cs: "Czech", da: "Danish", nl: "Dutch (Standard)", "nl-BE": "Dutch (Belgian)", en: "English", "en-AU": "English (Australia)", "en-BZ": "English (Belize)", "en-CA": "English (Canada)", "en-IE": "English (Ireland)", "en-JM": "English (Jamaica)", "en-NZ": "English (New Zealand)", "en-PH": "English (Philippines)", "en-ZA": "English (South Africa)", "en-TT": "English (Trinidad & Tobago)", "en-GB": "English (United Kingdom)", "en-US": "English (United States)", "en-ZW": "English (Zimbabwe)", eo: "Esperanto", et: "Estonian", fo: "Faeroese", fj: "Fijian", fi: "Finnish", fr: "French (Standard)", "fr-BE": "French (Belgium)", "fr-CA": "French (Canada)", "fr-FR": "French (France)", "fr-LU": "French (Luxembourg)", "fr-MC": "French (Monaco)", "fr-CH": "French (Switzerland)", fy: "Frisian", fur: "Friulian", gd: "Gaelic (Scots)", "gd-IE": "Gaelic (Irish)", gl: "Galacian", ka: "Georgian", de: "German (Standard)", "de-AT": "German (Austria)", "de-DE": "German (Germany)", "de-LI": "German (Liechtenstein)", "de-LU": "German (Luxembourg)", "de-CH": "German (Switzerland)", el: "Greek", gu: "Gujurati", ht: "Haitian", he: "Hebrew", hi: "Hindi", hu: "Hungarian", is: "Icelandic", id: "Indonesian", iu: "Inuktitut", ga: "Irish", it: "Italian (Standard)", "it-CH": "Italian (Switzerland)", ja: "Japanese", kn: "Kannada", ks: "Kashmiri", kk: "Kazakh", km: "Khmer", ky: "Kirghiz", tlh: "Klingon", ko: "Korean", "ko-KP": "Korean (North Korea)", "ko-KR": "Korean (South Korea)", la: "Latin", lv: "Latvian", lt: "Lithuanian", lb: "Luxembourgish", mk: "North Macedonia", ms: "Malay", ml: "Malayalam", mt: "Maltese", mi: "Maori", mr: "Marathi", mo: "Moldavian", nv: "Navajo", ng: "Ndonga", ne: "Nepali", no: "Norwegian", nb: "Norwegian (Bokmal)", nn: "Norwegian (Nynorsk)", oc: "Occitan", or: "Oriya", om: "Oromo", fa: "Persian", "fa-IR": "Persian/Iran", pl: "Polish", pt: "Portuguese", "pt-BR": "Portuguese (Brazil)", pa: "Punjabi", "pa-IN": "Punjabi (India)", "pa-PK": "Punjabi (Pakistan)", qu: "Quechua", rm: "Rhaeto-Romanic", ro: "Romanian", "ro-MO": "Romanian (Moldavia)", ru: "Russian", "ru-MO": "Russian (Moldavia)", sz: "Sami (Lappish)", sg: "Sango", sa: "Sanskrit", sc: "Sardinian", sd: "Sindhi", si: "Singhalese", sr: "Serbian", sk: "Slovak", sl: "Slovenian", so: "Somani", sb: "Sorbian", es: "Spanish", "es-AR": "Spanish (Argentina)", "es-BO": "Spanish (Bolivia)", "es-CL": "Spanish (Chile)", "es-CO": "Spanish (Colombia)", "es-CR": "Spanish (Costa Rica)", "es-DO": "Spanish (Dominican Republic)", "es-EC": "Spanish (Ecuador)", "es-SV": "Spanish (El Salvador)", "es-GT": "Spanish (Guatemala)", "es-HN": "Spanish (Honduras)", "es-MX": "Spanish (Mexico)", "es-NI": "Spanish (Nicaragua)", "es-PA": "Spanish (Panama)", "es-PY": "Spanish (Paraguay)", "es-PE": "Spanish (Peru)", "es-PR": "Spanish (Puerto Rico)", "es-ES": "Spanish (Spain)", "es-UY": "Spanish (Uruguay)", "es-VE": "Spanish (Venezuela)", sx: "Sutu", sw: "Swahili", sv: "Swedish", "sv-FI": "Swedish (Finland)", "sv-SV": "Swedish (Sweden)", ta: "Tamil", tt: "Tatar", te: "Teluga", th: "Thai", tig: "Tigre", ts: "Tsonga", tn: "Tswana", tr: "Turkish", tk: "Turkmen", uk: "Ukrainian", hsb: "Upper Sorbian", ur: "Urdu", ve: "Venda", vi: "Vietnamese", vo: "Volapuk", wa: "Walloon", cy: "Welsh", xh: "Xhosa", ji: "Yiddish", zu: "Zulu" }[r] !== void 0 && (this.internal.languageSettings.languageCode = r, this.internal.languageSettings.isSubscribed === !1 && (this.internal.events.subscribe("putCatalog", function() {
this.internal.write("/Lang (" + this.internal.languageSettings.languageCode + ")");
}), this.internal.languageSettings.isSubscribed = !0)), this;
}, _i = Ut.API, os = _i.getCharWidthsArray = function(r, e) {
var n, a, u = (e = e || {}).font || this.internal.getFont(), s = e.fontSize || this.internal.getFontSize(), c = e.charSpace || this.internal.getCharSpace(), f = e.widths ? e.widths : u.metadata.Unicode.widths, h = f.fof ? f.fof : 1, g = e.kerning ? e.kerning : u.metadata.Unicode.kerning, y = g.fof ? g.fof : 1, w = e.doKerning !== !1, S = 0, p = r.length, O = 0, F = f[0] || h, q = [];
for (n = 0; n < p; n++) a = r.charCodeAt(n), typeof u.metadata.widthOfString == "function" ? q.push((u.metadata.widthOfGlyph(u.metadata.characterToGlyph(a)) + c * (1e3 / s) || 0) / 1e3) : (S = w && he(g[a]) === "object" && !isNaN(parseInt(g[a][O], 10)) ? g[a][O] / y : 0, q.push((f[a] || F) / h + S)), O = a;
return q;
}, mu = _i.getStringUnitWidth = function(r, e) {
var n = (e = e || {}).fontSize || this.internal.getFontSize(), a = e.font || this.internal.getFont(), u = e.charSpace || this.internal.getCharSpace();
return _i.processArabic && (r = _i.processArabic(r)), typeof a.metadata.widthOfString == "function" ? a.metadata.widthOfString(r, n, u) / n : os.apply(this, arguments).reduce(function(s, c) {
return s + c;
}, 0);
}, vu = function(r, e, n, a) {
for (var u = [], s = 0, c = r.length, f = 0; s !== c && f + e[s] < n; ) f += e[s], s++;
u.push(r.slice(0, s));
var h = s;
for (f = 0; s !== c; ) f + e[s] > a && (u.push(r.slice(h, s)), f = 0, h = s), f += e[s], s++;
return h !== s && u.push(r.slice(h, s)), u;
}, bu = function(r, e, n) {
n || (n = {});
var a, u, s, c, f, h, g, y = [], w = [y], S = n.textIndent || 0, p = 0, O = 0, F = r.split(" "), q = os.apply(this, [" ", n])[0];
if (h = n.lineIndent === -1 ? F[0].length + 2 : n.lineIndent || 0) {
var _ = Array(h).join(" "), M = [];
F.map(function(st) {
(st = st.split(/\s*\n/)).length > 1 ? M = M.concat(st.map(function(ct, wt) {
return (wt && ct.length ? `
` : "") + ct;
})) : M.push(st[0]);
}), F = M, h = mu.apply(this, [_, n]);
}
for (s = 0, c = F.length; s < c; s++) {
var Y = 0;
if (a = F[s], h && a[0] == `
` && (a = a.substr(1), Y = 1), S + p + (O = (u = os.apply(this, [a, n])).reduce(function(st, ct) {
return st + ct;
}, 0)) > e || Y) {
if (O > e) {
for (f = vu.apply(this, [a, u, e - (S + p), e]), y.push(f.shift()), y = [f.pop()]; f.length; ) w.push([f.shift()]);
O = u.slice(a.length - (y[0] ? y[0].length : 0)).reduce(function(st, ct) {
return st + ct;
}, 0);
} else y = [a];
w.push(y), S = O + h, p = q;
} else y.push(a), S += p + O, p = q;
}
return g = h ? function(st, ct) {
return (ct ? _ : "") + st.join(" ");
} : function(st) {
return st.join(" ");
}, w.map(g);
}, _i.splitTextToSize = function(r, e, n) {
var a, u = (n = n || {}).fontSize || this.internal.getFontSize(), s = (function(y) {
if (y.widths && y.kerning) return { widths: y.widths, kerning: y.kerning };
var w = this.internal.getFont(y.fontName, y.fontStyle);
return w.metadata.Unicode ? { widths: w.metadata.Unicode.widths || { 0: 1 }, kerning: w.metadata.Unicode.kerning || {} } : { font: w.metadata, fontSize: this.internal.getFontSize(), charSpace: this.internal.getCharSpace() };
}).call(this, n);
a = Array.isArray(r) ? r : String(r).split(/\r?\n/);
var c = 1 * this.internal.scaleFactor * e / u;
s.textIndent = n.textIndent ? 1 * n.textIndent * this.internal.scaleFactor / u : 0, s.lineIndent = n.lineIndent;
var f, h, g = [];
for (f = 0, h = a.length; f < h; f++) g = g.concat(bu.apply(this, [a[f], c, s]));
return g;
}, function(r) {
r.__fontmetrics__ = r.__fontmetrics__ || {};
for (var e = "klmnopqrstuvwxyz", n = {}, a = {}, u = 0; u < e.length; u++) n[e[u]] = "0123456789abcdef"[u], a["0123456789abcdef"[u]] = e[u];
var s = function(w) {
return "0x" + parseInt(w, 10).toString(16);
}, c = r.__fontmetrics__.compress = function(w) {
var S, p, O, F, q = ["{"];
for (var _ in w) {
if (S = w[_], isNaN(parseInt(_, 10)) ? p = "'" + _ + "'" : (_ = parseInt(_, 10), p = (p = s(_).slice(2)).slice(0, -1) + a[p.slice(-1)]), typeof S == "number") S < 0 ? (O = s(S).slice(3), F = "-") : (O = s(S).slice(2), F = ""), O = F + O.slice(0, -1) + a[O.slice(-1)];
else {
if (he(S) !== "object") throw new Error("Don't know what to do with value type " + he(S) + ".");
O = c(S);
}
q.push(p + O);
}
return q.push("}"), q.join("");
}, f = r.__fontmetrics__.uncompress = function(w) {
if (typeof w != "string") throw new Error("Invalid argument passed to uncompress.");
for (var S, p, O, F, q = {}, _ = 1, M = q, Y = [], st = "", ct = "", wt = w.length - 1, tt = 1; tt < wt; tt += 1) (F = w[tt]) == "'" ? S ? (O = S.join(""), S = void 0) : S = [] : S ? S.push(F) : F == "{" ? (Y.push([M, O]), M = {}, O = void 0) : F == "}" ? ((p = Y.pop())[0][p[1]] = M, O = void 0, M = p[0]) : F == "-" ? _ = -1 : O === void 0 ? n.hasOwnProperty(F) ? (st += n[F], O = parseInt(st, 16) * _, _ = 1, st = "") : st += F : n.hasOwnProperty(F) ? (ct += n[F], M[O] = parseInt(ct, 16) * _, _ = 1, O = void 0, ct = "") : ct += F;
return q;
}, h = { codePages: ["WinAnsiEncoding"], WinAnsiEncoding: f("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}") }, g = { Unicode: { Courier: h, "Courier-Bold": h, "Courier-BoldOblique": h, "Courier-Oblique": h, Helvetica: h, "Helvetica-Bold": h, "Helvetica-BoldOblique": h, "Helvetica-Oblique": h, "Times-Roman": h, "Times-Bold": h, "Times-BoldItalic": h, "Times-Italic": h } }, y = { Unicode: { "Courier-Oblique": f("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-BoldItalic": f("{'widths'{k3o2q4ycx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2r202m2n2n3m2o3m2p5n202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5n4l4m4m4m4n4m4o4s4p4m4q4m4r4s4s4y4t2r4u3m4v4m4w3x4x5t4y4s4z4s5k3x5l4s5m4m5n3r5o3x5p4s5q4m5r5t5s4m5t3x5u3x5v2l5w1w5x2l5y3t5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q2l6r3m6s3r6t1w6u1w6v3m6w1w6x4y6y3r6z3m7k3m7l3m7m2r7n2r7o1w7p3r7q2w7r4m7s3m7t2w7u2r7v2n7w1q7x2n7y3t202l3mcl4mal2ram3man3mao3map3mar3mas2lat4uau1uav3maw3way4uaz2lbk2sbl3t'fof'6obo2lbp3tbq3mbr1tbs2lbu1ybv3mbz3mck4m202k3mcm4mcn4mco4mcp4mcq5ycr4mcs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz2w203k6o212m6o2dw2l2cq2l3t3m3u2l17s3x19m3m}'kerning'{cl{4qu5kt5qt5rs17ss5ts}201s{201ss}201t{cks4lscmscnscoscpscls2wu2yu201ts}201x{2wu2yu}2k{201ts}2w{4qx5kx5ou5qx5rs17su5tu}2x{17su5tu5ou}2y{4qx5kx5ou5qx5rs17ss5ts}'fof'-6ofn{17sw5tw5ou5qw5rs}7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qs}3v{17su5tu5os5qs}7p{17su5tu}ck{4qu5kt5qt5rs17ss5ts}4l{4qu5kt5qt5rs17ss5ts}cm{4qu5kt5qt5rs17ss5ts}cn{4qu5kt5qt5rs17ss5ts}co{4qu5kt5qt5rs17ss5ts}cp{4qu5kt5qt5rs17ss5ts}6l{4qu5ou5qw5rt17su5tu}5q{ckuclucmucnucoucpu4lu}5r{ckuclucmucnucoucpu4lu}7q{cksclscmscnscoscps4ls}6p{4qu5ou5qw5rt17sw5tw}ek{4qu5ou5qw5rt17su5tu}el{4qu5ou5qw5rt17su5tu}em{4qu5ou5qw5rt17su5tu}en{4qu5ou5qw5rt17su5tu}eo{4qu5ou5qw5rt17su5tu}ep{4qu5ou5qw5rt17su5tu}es{17ss5ts5qs4qu}et{4qu5ou5qw5rt17sw5tw}eu{4qu5ou5qw5rt17ss5ts}ev{17ss5ts5qs4qu}6z{17sw5tw5ou5qw5rs}fm{17sw5tw5ou5qw5rs}7n{201ts}fo{17sw5tw5ou5qw5rs}fp{17sw5tw5ou5qw5rs}fq{17sw5tw5ou5qw5rs}7r{cksclscmscnscoscps4ls}fs{17sw5tw5ou5qw5rs}ft{17su5tu}fu{17su5tu}fv{17su5tu}fw{17su5tu}fz{cksclscmscnscoscps4ls}}}"), "Helvetica-Bold": f("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"), Courier: f("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Courier-BoldOblique": f("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-Bold": f("{'widths'{k3q2q5ncx2r201n3m201o6o201s2l201t2l201u2l201w3m201x3m201y3m2k1t2l2l202m2n2n3m2o3m2p6o202q6o2r1w2s2l2t2l2u3m2v3t2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w3t3x3t3y3t3z3m4k5x4l4s4m4m4n4s4o4s4p4m4q3x4r4y4s4y4t2r4u3m4v4y4w4m4x5y4y4s4z4y5k3x5l4y5m4s5n3r5o4m5p4s5q4s5r6o5s4s5t4s5u4m5v2l5w1w5x2l5y3u5z3m6k2l6l3m6m3r6n2w6o3r6p2w6q2l6r3m6s3r6t1w6u2l6v3r6w1w6x5n6y3r6z3m7k3r7l3r7m2w7n2r7o2l7p3r7q3m7r4s7s3m7t3m7u2w7v2r7w1q7x2r7y3o202l3mcl4sal2lam3man3mao3map3mar3mas2lat4uau1yav3maw3tay4uaz2lbk2sbl3t'fof'6obo2lbp3rbr1tbs2lbu2lbv3mbz3mck4s202k3mcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw2r2m3rcy2rcz2rdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3rek3mel3mem3men3meo3mep3meq4ser2wes2wet2weu2wev2wew1wex1wey1wez1wfl3rfm3mfn3mfo3mfp3mfq3mfr3tfs3mft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3m3u2l17s4s19m3m}'kerning'{cl{4qt5ks5ot5qy5rw17sv5tv}201t{cks4lscmscnscoscpscls4wv}2k{201ts}2w{4qu5ku7mu5os5qx5ru17su5tu}2x{17su5tu5ou5qs}2y{4qv5kv7mu5ot5qz5ru17su5tu}'fof'-6o7t{cksclscmscnscoscps4ls}3u{17su5tu5os5qu}3v{17su5tu5os5qu}fu{17su5tu5ou5qu}7p{17su5tu5ou5qu}ck{4qt5ks5ot5qy5rw17sv5tv}4l{4qt5ks5ot5qy5rw17sv5tv}cm{4qt5ks5ot5qy5rw17sv5tv}cn{4qt5ks5ot5qy5rw17sv5tv}co{4qt5ks5ot5qy5rw17sv5tv}cp{4qt5ks5ot5qy5rw17sv5tv}6l{17st5tt5ou5qu}17s{ckuclucmucnucoucpu4lu4wu}5o{ckuclucmucnucoucpu4lu4wu}5q{ckzclzcmzcnzcozcpz4lz4wu}5r{ckxclxcmxcnxcoxcpx4lx4wu}5t{ckuclucmucnucoucpu4lu4wu}7q{ckuclucmucnucoucpu4lu}6p{17sw5tw5ou5qu}ek{17st5tt5qu}el{17st5tt5ou5qu}em{17st5tt5qu}en{17st5tt5qu}eo{17st5tt5qu}ep{17st5tt5ou5qu}es{17ss5ts5qu}et{17sw5tw5ou5qu}eu{17sw5tw5ou5qu}ev{17ss5ts5qu}6z{17sw5tw5ou5qu5rs}fm{17sw5tw5ou5qu5rs}fn{17sw5tw5ou5qu5rs}fo{17sw5tw5ou5qu5rs}fp{17sw5tw5ou5qu5rs}fq{17sw5tw5ou5qu5rs}7r{cktcltcmtcntcotcpt4lt5os}fs{17sw5tw5ou5qu5rs}ft{17su5tu5ou5qu}7m{5os}fv{17su5tu5ou5qu}fw{17su5tu5ou5qu}fz{cksclscmscnscoscps4ls}}}"), Symbol: f("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"), Helvetica: f("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}"), "Helvetica-BoldOblique": f("{'widths'{k3s2q4scx1w201n3r201o6o201s1w201t1w201u1w201w3m201x3m201y3m2k1w2l2l202m2n2n3r2o3r2p5t202q6o2r1s2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v2l3w3u3x3u3y3u3z3x4k6l4l4s4m4s4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3r4v4s4w3x4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v2l5w1w5x2l5y3u5z3r6k2l6l3r6m3x6n3r6o3x6p3r6q2l6r3x6s3x6t1w6u1w6v3r6w1w6x5t6y3x6z3x7k3x7l3x7m2r7n3r7o2l7p3x7q3r7r4y7s3r7t3r7u3m7v2r7w1w7x2r7y3u202l3rcl4sal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3xbq3rbr1wbs2lbu2obv3rbz3xck4s202k3rcm4scn4sco4scp4scq6ocr4scs4mct4mcu4mcv4mcw1w2m2zcy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3res3ret3reu3rev3rew1wex1wey1wez1wfl3xfm3xfn3xfo3xfp3xfq3xfr3ufs3xft3xfu3xfv3xfw3xfz3r203k6o212m6o2dw2l2cq2l3t3r3u2l17s4m19m3r}'kerning'{cl{4qs5ku5ot5qs17sv5tv}201t{2ww4wy2yw}201w{2ks}201x{2ww4wy2yw}2k{201ts201xs}2w{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}2x{5ow5qs}2y{7qs4qu5kw5os5qw5rs17su5tu7tsfzs}'fof'-6o7p{17su5tu5ot}ck{4qs5ku5ot5qs17sv5tv}4l{4qs5ku5ot5qs17sv5tv}cm{4qs5ku5ot5qs17sv5tv}cn{4qs5ku5ot5qs17sv5tv}co{4qs5ku5ot5qs17sv5tv}cp{4qs5ku5ot5qs17sv5tv}6l{17st5tt5os}17s{2kwclvcmvcnvcovcpv4lv4wwckv}5o{2kucltcmtcntcotcpt4lt4wtckt}5q{2ksclscmscnscoscps4ls4wvcks}5r{2ks4ws}5t{2kwclvcmvcnvcovcpv4lv4wwckv}eo{17st5tt5os}fu{17su5tu5ot}6p{17ss5ts}ek{17st5tt5os}el{17st5tt5os}em{17st5tt5os}en{17st5tt5os}6o{201ts}ep{17st5tt5os}es{17ss5ts}et{17ss5ts}eu{17ss5ts}ev{17ss5ts}6z{17su5tu5os5qt}fm{17su5tu5os5qt}fn{17su5tu5os5qt}fo{17su5tu5os5qt}fp{17su5tu5os5qt}fq{17su5tu5os5qt}fs{17su5tu5os5qt}ft{17su5tu5ot}7m{5os}fv{17su5tu5ot}fw{17su5tu5ot}}}"), ZapfDingbats: f("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"), "Courier-Bold": f("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-Italic": f("{'widths'{k3n2q4ycx2l201n3m201o5t201s2l201t2l201u2l201w3r201x3r201y3r2k1t2l2l202m2n2n3m2o3m2p5n202q5t2r1p2s2l2t2l2u3m2v4n2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v2l3w4n3x4n3y4n3z3m4k5w4l3x4m3x4n4m4o4s4p3x4q3x4r4s4s4s4t2l4u2w4v4m4w3r4x5n4y4m4z4s5k3x5l4s5m3x5n3m5o3r5p4s5q3x5r5n5s3x5t3r5u3r5v2r5w1w5x2r5y2u5z3m6k2l6l3m6m3m6n2w6o3m6p2w6q1w6r3m6s3m6t1w6u1w6v2w6w1w6x4s6y3m6z3m7k3m7l3m7m2r7n2r7o1w7p3m7q2w7r4m7s2w7t2w7u2r7v2s7w1v7x2s7y3q202l3mcl3xal2ram3man3mao3map3mar3mas2lat4wau1vav3maw4nay4waz2lbk2sbl4n'fof'6obo2lbp3mbq3obr1tbs2lbu1zbv3mbz3mck3x202k3mcm3xcn3xco3xcp3xcq5tcr4mcs3xct3xcu3xcv3xcw2l2m2ucy2lcz2ldl4mdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek3mel3mem3men3meo3mep3meq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr4nfs3mft3mfu3mfv3mfw3mfz2w203k6o212m6m2dw2l2cq2l3t3m3u2l17s3r19m3m}'kerning'{cl{5kt4qw}201s{201sw}201t{201tw2wy2yy6q-t}201x{2wy2yy}2k{201tw}2w{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}2x{17ss5ts5os}2y{7qs4qy7rs5ky7mw5os5qx5ru17su5tu}'fof'-6o6t{17ss5ts5qs}7t{5os}3v{5qs}7p{17su5tu5qs}ck{5kt4qw}4l{5kt4qw}cm{5kt4qw}cn{5kt4qw}co{5kt4qw}cp{5kt4qw}6l{4qs5ks5ou5qw5ru17su5tu}17s{2ks}5q{ckvclvcmvcnvcovcpv4lv}5r{ckuclucmucnucoucpu4lu}5t{2ks}6p{4qs5ks5ou5qw5ru17su5tu}ek{4qs5ks5ou5qw5ru17su5tu}el{4qs5ks5ou5qw5ru17su5tu}em{4qs5ks5ou5qw5ru17su5tu}en{4qs5ks5ou5qw5ru17su5tu}eo{4qs5ks5ou5qw5ru17su5tu}ep{4qs5ks5ou5qw5ru17su5tu}es{5ks5qs4qs}et{4qs5ks5ou5qw5ru17su5tu}eu{4qs5ks5qw5ru17su5tu}ev{5ks5qs4qs}ex{17ss5ts5qs}6z{4qv5ks5ou5qw5ru17su5tu}fm{4qv5ks5ou5qw5ru17su5tu}fn{4qv5ks5ou5qw5ru17su5tu}fo{4qv5ks5ou5qw5ru17su5tu}fp{4qv5ks5ou5qw5ru17su5tu}fq{4qv5ks5ou5qw5ru17su5tu}7r{5os}fs{4qv5ks5ou5qw5ru17su5tu}ft{17su5tu5qs}fu{17su5tu5qs}fv{17su5tu5qs}fw{17su5tu5qs}}}"), "Times-Roman": f("{'widths'{k3n2q4ycx2l201n3m201o6o201s2l201t2l201u2l201w2w201x2w201y2w2k1t2l2l202m2n2n3m2o3m2p5n202q6o2r1m2s2l2t2l2u3m2v3s2w1t2x2l2y1t2z1w3k3m3l3m3m3m3n3m3o3m3p3m3q3m3r3m3s3m203t2l203u2l3v1w3w3s3x3s3y3s3z2w4k5w4l4s4m4m4n4m4o4s4p3x4q3r4r4s4s4s4t2l4u2r4v4s4w3x4x5t4y4s4z4s5k3r5l4s5m4m5n3r5o3x5p4s5q4s5r5y5s4s5t4s5u3x5v2l5w1w5x2l5y2z5z3m6k2l6l2w6m3m6n2w6o3m6p2w6q2l6r3m6s3m6t1w6u1w6v3m6w1w6x4y6y3m6z3m7k3m7l3m7m2l7n2r7o1w7p3m7q3m7r4s7s3m7t3m7u2w7v3k7w1o7x3k7y3q202l3mcl4sal2lam3man3mao3map3mar3mas2lat4wau1vav3maw3say4waz2lbk2sbl3s'fof'6obo2lbp3mbq2xbr1tbs2lbu1zbv3mbz2wck4s202k3mcm4scn4sco4scp4scq5tcr4mcs3xct3xcu3xcv3xcw2l2m2tcy2lcz2ldl4sdm4sdn4sdo4sdp4sdq4sds4sdt4sdu4sdv4sdw4sdz3mek2wel2wem2wen2weo2wep2weq4mer2wes2wet2weu2wev2wew1wex1wey1wez1wfl3mfm3mfn3mfo3mfp3mfq3mfr3sfs3mft3mfu3mfv3mfw3mfz3m203k6o212m6m2dw2l2cq2l3t3m3u1w17s4s19m3m}'kerning'{cl{4qs5ku17sw5ou5qy5rw201ss5tw201ws}201s{201ss}201t{ckw4lwcmwcnwcowcpwclw4wu201ts}2k{201ts}2w{4qs5kw5os5qx5ru17sx5tx}2x{17sw5tw5ou5qu}2y{4qs5kw5os5qx5ru17sx5tx}'fof'-6o7t{ckuclucmucnucoucpu4lu5os5rs}3u{17su5tu5qs}3v{17su5tu5qs}7p{17sw5tw5qs}ck{4qs5ku17sw5ou5qy5rw201ss5tw201ws}4l{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cm{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cn{4qs5ku17sw5ou5qy5rw201ss5tw201ws}co{4qs5ku17sw5ou5qy5rw201ss5tw201ws}cp{4qs5ku17sw5ou5qy5rw201ss5tw201ws}6l{17su5tu5os5qw5rs}17s{2ktclvcmvcnvcovcpv4lv4wuckv}5o{ckwclwcmwcnwcowcpw4lw4wu}5q{ckyclycmycnycoycpy4ly4wu5ms}5r{cktcltcmtcntcotcpt4lt4ws}5t{2ktclvcmvcnvcovcpv4lv4wuckv}7q{cksclscmscnscoscps4ls}6p{17su5tu5qw5rs}ek{5qs5rs}el{17su5tu5os5qw5rs}em{17su5tu5os5qs5rs}en{17su5qs5rs}eo{5qs5rs}ep{17su5tu5os5qw5rs}es{5qs}et{17su5tu5qw5rs}eu{17su5tu5qs5rs}ev{5qs}6z{17sv5tv5os5qx5rs}fm{5os5qt5rs}fn{17sv5tv5os5qx5rs}fo{17sv5tv5os5qx5rs}fp{5os5qt5rs}fq{5os5qt5rs}7r{ckuclucmucnucoucpu4lu5os}fs{17sv5tv5os5qx5rs}ft{17ss5ts5qs}fu{17sw5tw5qs}fv{17sw5tw5qs}fw{17ss5ts5qs}fz{ckuclucmucnucoucpu4lu5os5rs}}}"), "Helvetica-Oblique": f("{'widths'{k3p2q4mcx1w201n3r201o6o201s1q201t1q201u1q201w2l201x2l201y2l2k1w2l1w202m2n2n3r2o3r2p5t202q6o2r1n2s2l2t2l2u2r2v3u2w1w2x2l2y1w2z1w3k3r3l3r3m3r3n3r3o3r3p3r3q3r3r3r3s3r203t2l203u2l3v1w3w3u3x3u3y3u3z3r4k6p4l4m4m4m4n4s4o4s4p4m4q3x4r4y4s4s4t1w4u3m4v4m4w3r4x5n4y4s4z4y5k4m5l4y5m4s5n4m5o3x5p4s5q4m5r5y5s4m5t4m5u3x5v1w5w1w5x1w5y2z5z3r6k2l6l3r6m3r6n3m6o3r6p3r6q1w6r3r6s3r6t1q6u1q6v3m6w1q6x5n6y3r6z3r7k3r7l3r7m2l7n3m7o1w7p3r7q3m7r4s7s3m7t3m7u3m7v2l7w1u7x2l7y3u202l3rcl4mal2lam3ran3rao3rap3rar3ras2lat4tau2pav3raw3uay4taz2lbk2sbl3u'fof'6obo2lbp3rbr1wbs2lbu2obv3rbz3xck4m202k3rcm4mcn4mco4mcp4mcq6ocr4scs4mct4mcu4mcv4mcw1w2m2ncy1wcz1wdl4sdm4ydn4ydo4ydp4ydq4yds4ydt4sdu4sdv4sdw4sdz3xek3rel3rem3ren3reo3rep3req5ter3mes3ret3reu3rev3rew1wex1wey1wez1wfl3rfm3rfn3rfo3rfp3rfq3rfr3ufs3xft3rfu3rfv3rfw3rfz3m203k6o212m6o2dw2l2cq2l3t3r3u1w17s4m19m3r}'kerning'{5q{4wv}cl{4qs5kw5ow5qs17sv5tv}201t{2wu4w1k2yu}201x{2wu4wy2yu}17s{2ktclucmucnu4otcpu4lu4wycoucku}2w{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}2x{17sy5ty5oy5qs}2y{7qs4qz5k1m17sy5ow5qx5rsfsu5ty7tufzu}'fof'-6o7p{17sv5tv5ow}ck{4qs5kw5ow5qs17sv5tv}4l{4qs5kw5ow5qs17sv5tv}cm{4qs5kw5ow5qs17sv5tv}cn{4qs5kw5ow5qs17sv5tv}co{4qs5kw5ow5qs17sv5tv}cp{4qs5kw5ow5qs17sv5tv}6l{17sy5ty5ow}do{17st5tt}4z{17st5tt}7s{fst}dm{17st5tt}dn{17st5tt}5o{ckwclwcmwcnwcowcpw4lw4wv}dp{17st5tt}dq{17st5tt}7t{5ow}ds{17st5tt}5t{2ktclucmucnu4otcpu4lu4wycoucku}fu{17sv5tv5ow}6p{17sy5ty5ow5qs}ek{17sy5ty5ow}el{17sy5ty5ow}em{17sy5ty5ow}en{5ty}eo{17sy5ty5ow}ep{17sy5ty5ow}es{17sy5ty5qs}et{17sy5ty5ow5qs}eu{17sy5ty5ow5qs}ev{17sy5ty5ow5qs}6z{17sy5ty5ow5qs}fm{17sy5ty5ow5qs}fn{17sy5ty5ow5qs}fo{17sy5ty5ow5qs}fp{17sy5ty5qs}fq{17sy5ty5ow5qs}7r{5ow}fs{17sy5ty5ow5qs}ft{17sv5tv5ow}7m{5ow}fv{17sv5tv5ow}fw{17sv5tv5ow}}}") } };
r.events.push(["addFont", function(w) {
var S = w.font, p = y.Unicode[S.postScriptName];
p && (S.metadata.Unicode = {}, S.metadata.Unicode.widths = p.widths, S.metadata.Unicode.kerning = p.kerning);
var O = g.Unicode[S.postScriptName];
O && (S.metadata.Unicode.encoding = O, S.encoding = O.codePages[0]);
}]);
}(Ut.API), /**
* @license
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(r) {
var e = function(n) {
for (var a = n.length, u = new Uint8Array(a), s = 0; s < a; s++) u[s] = n.charCodeAt(s);
return u;
};
r.API.events.push(["addFont", function(n) {
var a = void 0, u = n.font, s = n.instance;
if (!u.isStandardFont) {
if (s === void 0) throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('" + u.postScriptName + "').");
if (typeof (a = s.existsFileInVFS(u.postScriptName) === !1 ? s.loadFile(u.postScriptName) : s.getFileFromVFS(u.postScriptName)) != "string") throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('" + u.postScriptName + "').");
(function(c, f) {
f = /^\x00\x01\x00\x00/.test(f) ? e(f) : e(ha(f)), c.metadata = r.API.TTFFont.open(f), c.metadata.Unicode = c.metadata.Unicode || { encoding: {}, kerning: {}, widths: [] }, c.metadata.glyIdsUsed = [0];
})(u, a);
}
}]);
}(Ut), /** @license
* Copyright (c) 2012 Willow Systems Corporation, https://github.com/willowsystems
*
* 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.
* ====================================================================
*/
function(r) {
function e() {
return (Ht.canvg ? Promise.resolve(Ht.canvg) : import("./index.es-RWt7DWPC.js")).catch(function(n) {
return Promise.reject(new Error("Could not load canvg: " + n));
}).then(function(n) {
return n.default ? n.default : n;
});
}
Ut.API.addSvgAsImage = function(n, a, u, s, c, f, h, g) {
if (isNaN(a) || isNaN(u)) throw ve.error("jsPDF.addSvgAsImage: Invalid coordinates", arguments), new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");
if (isNaN(s) || isNaN(c)) throw ve.error("jsPDF.addSvgAsImage: Invalid measurements", arguments), new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");
var y = document.createElement("canvas");
y.width = s, y.height = c;
var w = y.getContext("2d");
w.fillStyle = "#fff", w.fillRect(0, 0, y.width, y.height);
var S = { ignoreMouse: !0, ignoreAnimation: !0, ignoreDimensions: !0 }, p = this;
return e().then(function(O) {
return O.fromString(w, n, S);
}, function() {
return Promise.reject(new Error("Could not load canvg."));
}).then(function(O) {
return O.render(S);
}).then(function() {
p.addImage(y.toDataURL("image/jpeg", 1), a, u, s, c, h, g);
});
};
}(), Ut.API.putTotalPages = function(r) {
var e, n = 0;
parseInt(this.internal.getFont().id.substr(1), 10) < 15 ? (e = new RegExp(r, "g"), n = this.internal.getNumberOfPages()) : (e = new RegExp(this.pdfEscape16(r, this.internal.getFont()), "g"), n = this.pdfEscape16(this.internal.getNumberOfPages() + "", this.internal.getFont()));
for (var a = 1; a <= this.internal.getNumberOfPages(); a++) for (var u = 0; u < this.internal.pages[a].length; u++) this.internal.pages[a][u] = this.internal.pages[a][u].replace(e, n);
return this;
}, Ut.API.viewerPreferences = function(r, e) {
var n;
r = r || {}, e = e || !1;
var a, u, s, c = { HideToolbar: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.3 }, HideMenubar: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.3 }, HideWindowUI: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.3 }, FitWindow: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.3 }, CenterWindow: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.3 }, DisplayDocTitle: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.4 }, NonFullScreenPageMode: { defaultValue: "UseNone", value: "UseNone", type: "name", explicitSet: !1, valueSet: ["UseNone", "UseOutlines", "UseThumbs", "UseOC"], pdfVersion: 1.3 }, Direction: { defaultValue: "L2R", value: "L2R", type: "name", explicitSet: !1, valueSet: ["L2R", "R2L"], pdfVersion: 1.3 }, ViewArea: { defaultValue: "CropBox", value: "CropBox", type: "name", explicitSet: !1, valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"], pdfVersion: 1.4 }, ViewClip: { defaultValue: "CropBox", value: "CropBox", type: "name", explicitSet: !1, valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"], pdfVersion: 1.4 }, PrintArea: { defaultValue: "CropBox", value: "CropBox", type: "name", explicitSet: !1, valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"], pdfVersion: 1.4 }, PrintClip: { defaultValue: "CropBox", value: "CropBox", type: "name", explicitSet: !1, valueSet: ["MediaBox", "CropBox", "TrimBox", "BleedBox", "ArtBox"], pdfVersion: 1.4 }, PrintScaling: { defaultValue: "AppDefault", value: "AppDefault", type: "name", explicitSet: !1, valueSet: ["AppDefault", "None"], pdfVersion: 1.6 }, Duplex: { defaultValue: "", value: "none", type: "name", explicitSet: !1, valueSet: ["Simplex", "DuplexFlipShortEdge", "DuplexFlipLongEdge", "none"], pdfVersion: 1.7 }, PickTrayByPDFSize: { defaultValue: !1, value: !1, type: "boolean", explicitSet: !1, valueSet: [!0, !1], pdfVersion: 1.7 }, PrintPageRange: { defaultValue: "", value: "", type: "array", explicitSet: !1, valueSet: null, pdfVersion: 1.7 }, NumCopies: { defaultValue: 1, value: 1, type: "integer", explicitSet: !1, valueSet: null, pdfVersion: 1.7 } }, f = Object.keys(c), h = [], g = 0, y = 0, w = 0;
function S(O, F) {
var q, _ = !1;
for (q = 0; q < O.length; q += 1) O[q] === F && (_ = !0);
return _;
}
if (this.internal.viewerpreferences === void 0 && (this.internal.viewerpreferences = {}, this.internal.viewerpreferences.configuration = JSON.parse(JSON.stringify(c)), this.internal.viewerpreferences.isSubscribed = !1), n = this.internal.viewerpreferences.configuration, r === "reset" || e === !0) {
var p = f.length;
for (w = 0; w < p; w += 1) n[f[w]].value = n[f[w]].defaultValue, n[f[w]].explicitSet = !1;
}
if (he(r) === "object") {
for (u in r) if (s = r[u], S(f, u) && s !== void 0) {
if (n[u].type === "boolean" && typeof s == "boolean") n[u].value = s;
else if (n[u].type === "name" && S(n[u].valueSet, s)) n[u].value = s;
else if (n[u].type === "integer" && Number.isInteger(s)) n[u].value = s;
else if (n[u].type === "array") {
for (g = 0; g < s.length; g += 1) if (a = !0, s[g].length === 1 && typeof s[g][0] == "number") h.push(String(s[g] - 1));
else if (s[g].length > 1) {
for (y = 0; y < s[g].length; y += 1) typeof s[g][y] != "number" && (a = !1);
a === !0 && h.push([s[g][0] - 1, s[g][1] - 1].join(" "));
}
n[u].value = "[" + h.join(" ") + "]";
} else n[u].value = n[u].defaultValue;
n[u].explicitSet = !0;
}
}
return this.internal.viewerpreferences.isSubscribed === !1 && (this.internal.events.subscribe("putCatalog", function() {
var O, F = [];
for (O in n) n[O].explicitSet === !0 && (n[O].type === "name" ? F.push("/" + O + " /" + n[O].value) : F.push("/" + O + " " + n[O].value));
F.length !== 0 && this.internal.write(`/ViewerPreferences
<<
` + F.join(`
`) + `
>>`);
}), this.internal.viewerpreferences.isSubscribed = !0), this.internal.viewerpreferences.configuration = n, this;
}, /** ====================================================================
* @license
* jsPDF XMP metadata plugin
* Copyright (c) 2016 Jussi Utunen, u-jussi@suomi24.fi
*
* 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.
* ====================================================================
*/
function(r) {
var e = function() {
var a = '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><rdf:Description rdf:about="" xmlns:jspdf="' + this.internal.__metadata__.namespaceuri + '"><jspdf:metadata>', u = unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')), s = unescape(encodeURIComponent(a)), c = unescape(encodeURIComponent(this.internal.__metadata__.metadata)), f = unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")), h = unescape(encodeURIComponent("</x:xmpmeta>")), g = s.length + c.length + f.length + u.length + h.length;
this.internal.__metadata__.metadata_object_number = this.internal.newObject(), this.internal.write("<< /Type /Metadata /Subtype /XML /Length " + g + " >>"), this.internal.write("stream"), this.internal.write(u + s + c + f + h), this.internal.write("endstream"), this.internal.write("endobj");
}, n = function() {
this.internal.__metadata__.metadata_object_number && this.internal.write("/Metadata " + this.internal.__metadata__.metadata_object_number + " 0 R");
};
r.addMetadata = function(a, u) {
return this.internal.__metadata__ === void 0 && (this.internal.__metadata__ = { metadata: a, namespaceuri: u || "http://jspdf.default.namespaceuri/" }, this.internal.events.subscribe("putCatalog", n), this.internal.events.subscribe("postPutResources", e)), this;
};
}(Ut.API), function(r) {
var e = r.API, n = e.pdfEscape16 = function(s, c) {
for (var f, h = c.metadata.Unicode.widths, g = ["", "0", "00", "000", "0000"], y = [""], w = 0, S = s.length; w < S; ++w) {
if (f = c.metadata.characterToGlyph(s.charCodeAt(w)), c.metadata.glyIdsUsed.push(f), c.metadata.toUnicode[f] = s.charCodeAt(w), h.indexOf(f) == -1 && (h.push(f), h.push([parseInt(c.metadata.widthOfGlyph(f), 10)])), f == "0") return y.join("");
f = f.toString(16), y.push(g[4 - f.length], f);
}
return y.join("");
}, a = function(s) {
var c, f, h, g, y, w, S;
for (y = `/CIDInit /ProcSet findresource begin
12 dict begin
begincmap
/CIDSystemInfo <<
/Registry (Adobe)
/Ordering (UCS)
/Supplement 0
>> def
/CMapName /Adobe-Identity-UCS def
/CMapType 2 def
1 begincodespacerange
<0000><ffff>
endcodespacerange`, h = [], w = 0, S = (f = Object.keys(s).sort(function(p, O) {
return p - O;
})).length; w < S; w++) c = f[w], h.length >= 100 && (y += `
` + h.length + ` beginbfchar
` + h.join(`
`) + `
endbfchar`, h = []), s[c] !== void 0 && s[c] !== null && typeof s[c].toString == "function" && (g = ("0000" + s[c].toString(16)).slice(-4), c = ("0000" + (+c).toString(16)).slice(-4), h.push("<" + c + "><" + g + ">"));
return h.length && (y += `
` + h.length + ` beginbfchar
` + h.join(`
`) + `
endbfchar
`), y += `endcmap
CMapName currentdict /CMap defineresource pop
end
end`;
};
e.events.push(["putFont", function(s) {
(function(c) {
var f = c.font, h = c.out, g = c.newObject, y = c.putStream;
if (f.metadata instanceof r.API.TTFFont && f.encoding === "Identity-H") {
for (var w = f.metadata.Unicode.widths, S = f.metadata.subset.encode(f.metadata.glyIdsUsed, 1), p = "", O = 0; O < S.length; O++) p += String.fromCharCode(S[O]);
var F = g();
y({ data: p, addLength1: !0, objectId: F }), h("endobj");
var q = g();
y({ data: a(f.metadata.toUnicode), addLength1: !0, objectId: q }), h("endobj");
var _ = g();
h("<<"), h("/Type /FontDescriptor"), h("/FontName /" + ki(f.fontName)), h("/FontFile2 " + F + " 0 R"), h("/FontBBox " + r.API.PDFObject.convert(f.metadata.bbox)), h("/Flags " + f.metadata.flags), h("/StemV " + f.metadata.stemV), h("/ItalicAngle " + f.metadata.italicAngle), h("/Ascent " + f.metadata.ascender), h("/Descent " + f.metadata.decender), h("/CapHeight " + f.metadata.capHeight), h(">>"), h("endobj");
var M = g();
h("<<"), h("/Type /Font"), h("/BaseFont /" + ki(f.fontName)), h("/FontDescriptor " + _ + " 0 R"), h("/W " + r.API.PDFObject.convert(w)), h("/CIDToGIDMap /Identity"), h("/DW 1000"), h("/Subtype /CIDFontType2"), h("/CIDSystemInfo"), h("<<"), h("/Supplement 0"), h("/Registry (Adobe)"), h("/Ordering (" + f.encoding + ")"), h(">>"), h(">>"), h("endobj"), f.objectNumber = g(), h("<<"), h("/Type /Font"), h("/Subtype /Type0"), h("/ToUnicode " + q + " 0 R"), h("/BaseFont /" + ki(f.fontName)), h("/Encoding /" + f.encoding), h("/DescendantFonts [" + M + " 0 R]"), h(">>"), h("endobj"), f.isAlreadyPutted = !0;
}
})(s);
}]), e.events.push(["putFont", function(s) {
(function(c) {
var f = c.font, h = c.out, g = c.newObject, y = c.putStream;
if (f.metadata instanceof r.API.TTFFont && f.encoding === "WinAnsiEncoding") {
for (var w = f.metadata.rawData, S = "", p = 0; p < w.length; p++) S += String.fromCharCode(w[p]);
var O = g();
y({ data: S, addLength1: !0, objectId: O }), h("endobj");
var F = g();
y({ data: a(f.metadata.toUnicode), addLength1: !0, objectId: F }), h("endobj");
var q = g();
h("<<"), h("/Descent " + f.metadata.decender), h("/CapHeight " + f.metadata.capHeight), h("/StemV " + f.metadata.stemV), h("/Type /FontDescriptor"), h("/FontFile2 " + O + " 0 R"), h("/Flags 96"), h("/FontBBox " + r.API.PDFObject.convert(f.metadata.bbox)), h("/FontName /" + ki(f.fontName)), h("/ItalicAngle " + f.metadata.italicAngle), h("/Ascent " + f.metadata.ascender), h(">>"), h("endobj"), f.objectNumber = g();
for (var _ = 0; _ < f.metadata.hmtx.widths.length; _++) f.metadata.hmtx.widths[_] = parseInt(f.metadata.hmtx.widths[_] * (1e3 / f.metadata.head.unitsPerEm));
h("<</Subtype/TrueType/Type/Font/ToUnicode " + F + " 0 R/BaseFont/" + ki(f.fontName) + "/FontDescriptor " + q + " 0 R/Encoding/" + f.encoding + " /FirstChar 29 /LastChar 255 /Widths " + r.API.PDFObject.convert(f.metadata.hmtx.widths) + ">>"), h("endobj"), f.isAlreadyPutted = !0;
}
})(s);
}]);
var u = function(s) {
var c, f = s.text || "", h = s.x, g = s.y, y = s.options || {}, w = s.mutex || {}, S = w.pdfEscape, p = w.activeFontKey, O = w.fonts, F = p, q = "", _ = 0, M = "", Y = O[F].encoding;
if (O[F].encoding !== "Identity-H") return { text: f, x: h, y: g, options: y, mutex: w };
for (M = f, F = p, Array.isArray(f) && (M = f[0]), _ = 0; _ < M.length; _ += 1) O[F].metadata.hasOwnProperty("cmap") && (c = O[F].metadata.cmap.unicode.codeMap[M[_].charCodeAt(0)]), c || M[_].charCodeAt(0) < 256 && O[F].metadata.hasOwnProperty("Unicode") ? q += M[_] : q += "";
var st = "";
return parseInt(F.slice(1)) < 14 || Y === "WinAnsiEncoding" ? st = S(q, F).split("").map(function(ct) {
return ct.charCodeAt(0).toString(16);
}).join("") : Y === "Identity-H" && (st = n(q, O[F])), w.isHex = !0, { text: st, x: h, y: g, options: y, mutex: w };
};
e.events.push(["postProcessText", function(s) {
var c = s.text || "", f = [], h = { text: c, x: s.x, y: s.y, options: s.options, mutex: s.mutex };
if (Array.isArray(c)) {
var g = 0;
for (g = 0; g < c.length; g += 1) Array.isArray(c[g]) && c[g].length === 3 ? f.push([u(Object.assign({}, h, { text: c[g][0] })).text, c[g][1], c[g][2]]) : f.push(u(Object.assign({}, h, { text: c[g] })).text);
s.text = f;
} else s.text = u(Object.assign({}, h, { text: c })).text;
}]);
}(Ut), /**
* @license
* jsPDF virtual FileSystem functionality
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
function(r) {
var e = function() {
return this.internal.vFS === void 0 && (this.internal.vFS = {}), !0;
};
r.existsFileInVFS = function(n) {
return e.call(this), this.internal.vFS[n] !== void 0;
}, r.addFileToVFS = function(n, a) {
return e.call(this), this.internal.vFS[n] = a, this;
}, r.getFileFromVFS = function(n) {
return e.call(this), this.internal.vFS[n] !== void 0 ? this.internal.vFS[n] : null;
};
}(Ut.API), /**
* @license
* Unicode Bidi Engine based on the work of Alex Shensis (@asthensis)
* MIT License
*/
function(r) {
r.__bidiEngine__ = r.prototype.__bidiEngine__ = function(a) {
var u, s, c, f, h, g, y, w = e, S = [[0, 3, 0, 1, 0, 0, 0], [0, 3, 0, 1, 2, 2, 0], [0, 3, 0, 17, 2, 0, 1], [0, 3, 5, 5, 4, 1, 0], [0, 3, 21, 21, 4, 0, 1], [0, 3, 5, 5, 4, 2, 0]], p = [[2, 0, 1, 1, 0, 1, 0], [2, 0, 1, 1, 0, 2, 0], [2, 0, 2, 1, 3, 2, 0], [2, 0, 2, 33, 3, 1, 1]], O = { L: 0, R: 1, EN: 2, AN: 3, N: 4, B: 5, S: 6 }, F = { 0: 0, 5: 1, 6: 2, 7: 3, 32: 4, 251: 5, 254: 6, 255: 7 }, q = ["(", ")", "(", "<", ">", "<", "[", "]", "[", "{", "}", "{", "«", "»", "«", "‹", "›", "‹", "⁅", "⁆", "⁅", "⁽", "⁾", "⁽", "₍", "₎", "₍", "≤", "≥", "≤", "〈", "〉", "〈", "﹙", "﹚", "﹙", "﹛", "﹜", "﹛", "﹝", "﹞", "﹝", "﹤", "﹥", "﹤"], _ = new RegExp(/^([1-4|9]|1[0-9]|2[0-9]|3[0168]|4[04589]|5[012]|7[78]|159|16[0-9]|17[0-2]|21[569]|22[03489]|250)$/), M = !1, Y = 0;
this.__bidiEngine__ = {};
var st = function(P) {
var k = P.charCodeAt(), W = k >> 8, D = F[W];
return D !== void 0 ? w[256 * D + (255 & k)] : W === 252 || W === 253 ? "AL" : _.test(W) ? "L" : W === 8 ? "R" : "N";
}, ct = function(P) {
for (var k, W = 0; W < P.length; W++) {
if ((k = st(P.charAt(W))) === "L") return !1;
if (k === "R") return !0;
}
return !1;
}, wt = function(P, k, W, D) {
var ot, it, ft, $, lt = k[D];
switch (lt) {
case "L":
case "R":
M = !1;
break;
case "N":
case "AN":
break;
case "EN":
M && (lt = "AN");
break;
case "AL":
M = !0, lt = "R";
break;
case "WS":
lt = "N";
break;
case "CS":
D < 1 || D + 1 >= k.length || (ot = W[D - 1]) !== "EN" && ot !== "AN" || (it = k[D + 1]) !== "EN" && it !== "AN" ? lt = "N" : M && (it = "AN"), lt = it === ot ? it : "N";
break;
case "ES":
lt = (ot = D > 0 ? W[D - 1] : "B") === "EN" && D + 1 < k.length && k[D + 1] === "EN" ? "EN" : "N";
break;
case "ET":
if (D > 0 && W[D - 1] === "EN") {
lt = "EN";
break;
}
if (M) {
lt = "N";
break;
}
for (ft = D + 1, $ = k.length; ft < $ && k[ft] === "ET"; ) ft++;
lt = ft < $ && k[ft] === "EN" ? "EN" : "N";
break;
case "NSM":
if (c && !f) {
for ($ = k.length, ft = D + 1; ft < $ && k[ft] === "NSM"; ) ft++;
if (ft < $) {
var dt = P[D], jt = dt >= 1425 && dt <= 2303 || dt === 64286;
if (ot = k[ft], jt && (ot === "R" || ot === "AL")) {
lt = "R";
break;
}
}
}
lt = D < 1 || (ot = k[D - 1]) === "B" ? "N" : W[D - 1];
break;
case "B":
M = !1, u = !0, lt = Y;
break;
case "S":
s = !0, lt = "N";
break;
case "LRE":
case "RLE":
case "LRO":
case "RLO":
case "PDF":
M = !1;
break;
case "BN":
lt = "N";
}
return lt;
}, tt = function(P, k, W) {
var D = P.split("");
return W && z(D, W, { hiLevel: Y }), D.reverse(), k && k.reverse(), D.join("");
}, z = function(P, k, W) {
var D, ot, it, ft, $, lt = -1, dt = P.length, jt = 0, N = [], C = Y ? p : S, B = [];
for (M = !1, u = !1, s = !1, ot = 0; ot < dt; ot++) B[ot] = st(P[ot]);
for (it = 0; it < dt; it++) {
if ($ = jt, N[it] = wt(P, B, N, it), D = 240 & (jt = C[$][O[N[it]]]), jt &= 15, k[it] = ft = C[jt][5], D > 0) if (D === 16) {
for (ot = lt; ot < it; ot++) k[ot] = 1;
lt = -1;
} else lt = -1;
if (C[jt][6]) lt === -1 && (lt = it);
else if (lt > -1) {
for (ot = lt; ot < it; ot++) k[ot] = ft;
lt = -1;
}
B[it] === "B" && (k[it] = 0), W.hiLevel |= ft;
}
s && function(T, J, Q) {
for (var et = 0; et < Q; et++) if (T[et] === "S") {
J[et] = Y;
for (var nt = et - 1; nt >= 0 && T[nt] === "WS"; nt--) J[nt] = Y;
}
}(B, k, dt);
}, rt = function(P, k, W, D, ot) {
if (!(ot.hiLevel < P)) {
if (P === 1 && Y === 1 && !u) return k.reverse(), void (W && W.reverse());
for (var it, ft, $, lt, dt = k.length, jt = 0; jt < dt; ) {
if (D[jt] >= P) {
for ($ = jt + 1; $ < dt && D[$] >= P; ) $++;
for (lt = jt, ft = $ - 1; lt < ft; lt++, ft--) it = k[lt], k[lt] = k[ft], k[ft] = it, W && (it = W[lt], W[lt] = W[ft], W[ft] = it);
jt = $;
}
jt++;
}
}
}, pt = function(P, k, W) {
var D = P.split(""), ot = { hiLevel: Y };
return W || (W = []), z(D, W, ot), function(it, ft, $) {
if ($.hiLevel !== 0 && y) for (var lt, dt = 0; dt < it.length; dt++) ft[dt] === 1 && (lt = q.indexOf(it[dt])) >= 0 && (it[dt] = q[lt + 1]);
}(D, W, ot), rt(2, D, k, W, ot), rt(1, D, k, W, ot), D.join("");
};
return this.__bidiEngine__.doBidiReorder = function(P, k, W) {
if (function(ot, it) {
if (it) for (var ft = 0; ft < ot.length; ft++) it[ft] = ft;
f === void 0 && (f = ct(ot)), g === void 0 && (g = ct(ot));
}(P, k), c || !h || g) if (c && h && f ^ g) Y = f ? 1 : 0, P = tt(P, k, W);
else if (!c && h && g) Y = f ? 1 : 0, P = pt(P, k, W), P = tt(P, k);
else if (!c || f || h || g) {
if (c && !h && f ^ g) P = tt(P, k), f ? (Y = 0, P = pt(P, k, W)) : (Y = 1, P = pt(P, k, W), P = tt(P, k));
else if (c && f && !h && g) Y = 1, P = pt(P, k, W), P = tt(P, k);
else if (!c && !h && f ^ g) {
var D = y;
f ? (Y = 1, P = pt(P, k, W), Y = 0, y = !1, P = pt(P, k, W), y = D) : (Y = 0, P = pt(P, k, W), P = tt(P, k), Y = 1, y = !1, P = pt(P, k, W), y = D, P = tt(P, k));
}
} else Y = 0, P = pt(P, k, W);
else Y = f ? 1 : 0, P = pt(P, k, W);
return P;
}, this.__bidiEngine__.setOptions = function(P) {
P && (c = P.isInputVisual, h = P.isOutputVisual, f = P.isInputRtl, g = P.isOutputRtl, y = P.isSymmetricSwapping);
}, this.__bidiEngine__.setOptions(a), this.__bidiEngine__;
};
var e = ["BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "S", "B", "S", "WS", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "B", "B", "B", "S", "WS", "N", "N", "ET", "ET", "ET", "N", "N", "N", "N", "N", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "BN", "BN", "BN", "BN", "BN", "BN", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "CS", "N", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "L", "N", "N", "BN", "N", "N", "ET", "ET", "EN", "EN", "N", "L", "N", "N", "N", "EN", "L", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "L", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "L", "N", "N", "N", "N", "N", "ET", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "R", "NSM", "R", "NSM", "NSM", "R", "NSM", "NSM", "R", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "AN", "AN", "AN", "AN", "AN", "AN", "N", "N", "AL", "ET", "ET", "AL", "CS", "AL", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "ET", "AN", "AN", "AL", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "NSM", "NSM", "N", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "R", "R", "N", "N", "N", "N", "R", "N", "N", "N", "N", "N", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "WS", "BN", "BN", "BN", "L", "R", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "WS", "B", "LRE", "RLE", "PDF", "LRO", "RLO", "CS", "ET", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "CS", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "WS", "BN", "BN", "BN", "BN", "BN", "N", "LRI", "RLI", "FSI", "PDI", "BN", "BN", "BN", "BN", "BN", "BN", "EN", "L", "N", "N", "EN", "EN", "EN", "EN", "EN", "EN", "ES", "ES", "N", "N", "N", "L", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "ES", "ES", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "R", "NSM", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "ES", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "N", "R", "R", "R", "R", "R", "N", "R", "N", "R", "R", "N", "R", "R", "N", "R", "R", "R", "R", "R", "R", "R", "R", "R", "R", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "CS", "N", "CS", "N", "N", "CS", "N", "N", "N", "N", "N", "N", "N", "N", "N", "ET", "N", "N", "ES", "ES", "N", "N", "N", "N", "N", "ET", "ET", "N", "N", "N", "N", "N", "AL", "AL", "AL", "AL", "AL", "N", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "N", "N", "BN", "N", "N", "N", "ET", "ET", "ET", "N", "N", "N", "N", "N", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "N", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "L", "L", "L", "N", "N", "L", "L", "L", "N", "N", "N", "ET", "ET", "N", "N", "N", "ET", "ET", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N", "N"], n = new r.__bidiEngine__({ isInputVisual: !0 });
r.API.events.push(["postProcessText", function(a) {
var u = a.text;
a.x, a.y;
var s = a.options || {};
a.mutex, s.lang;
var c = [];
if (s.isInputVisual = typeof s.isInputVisual != "boolean" || s.isInputVisual, n.setOptions(s), Object.prototype.toString.call(u) === "[object Array]") {
var f = 0;
for (c = [], f = 0; f < u.length; f += 1) Object.prototype.toString.call(u[f]) === "[object Array]" ? c.push([n.doBidiReorder(u[f][0]), u[f][1], u[f][2]]) : c.push([n.doBidiReorder(u[f])]);
a.text = c;
} else a.text = n.doBidiReorder(u);
n.setOptions({ isInputVisual: !0 });
}]);
}(Ut), Ut.API.TTFFont = function() {
function r(e) {
var n;
if (this.rawData = e, n = this.contents = new jr(e), this.contents.pos = 4, n.readString(4) === "ttcf") throw new Error("TTCF not supported.");
n.pos = 0, this.parse(), this.subset = new Nc(this), this.registerTTF();
}
return r.open = function(e) {
return new r(e);
}, r.prototype.parse = function() {
return this.directory = new uc(this.contents), this.head = new cc(this), this.name = new gc(this), this.cmap = new zu(this), this.toUnicode = {}, this.hhea = new fc(this), this.maxp = new mc(this), this.hmtx = new vc(this), this.post = new dc(this), this.os2 = new hc(this), this.loca = new Lc(this), this.glyf = new bc(this), this.ascender = this.os2.exists && this.os2.ascender || this.hhea.ascender, this.decender = this.os2.exists && this.os2.decender || this.hhea.decender, this.lineGap = this.os2.exists && this.os2.lineGap || this.hhea.lineGap, this.bbox = [this.head.xMin, this.head.yMin, this.head.xMax, this.head.yMax];
}, r.prototype.registerTTF = function() {
var e, n, a, u, s;
if (this.scaleFactor = 1e3 / this.head.unitsPerEm, this.bbox = (function() {
var c, f, h, g;
for (g = [], c = 0, f = (h = this.bbox).length; c < f; c++) e = h[c], g.push(Math.round(e * this.scaleFactor));
return g;
}).call(this), this.stemV = 0, this.post.exists ? (a = 255 & (u = this.post.italic_angle), (32768 & (n = u >> 16)) != 0 && (n = -(1 + (65535 ^ n))), this.italicAngle = +(n + "." + a)) : this.italicAngle = 0, this.ascender = Math.round(this.ascender * this.scaleFactor), this.decender = Math.round(this.decender * this.scaleFactor), this.lineGap = Math.round(this.lineGap * this.scaleFactor), this.capHeight = this.os2.exists && this.os2.capHeight || this.ascender, this.xHeight = this.os2.exists && this.os2.xHeight || 0, this.familyClass = (this.os2.exists && this.os2.familyClass || 0) >> 8, this.isSerif = (s = this.familyClass) === 1 || s === 2 || s === 3 || s === 4 || s === 5 || s === 7, this.isScript = this.familyClass === 10, this.flags = 0, this.post.isFixedPitch && (this.flags |= 1), this.isSerif && (this.flags |= 2), this.isScript && (this.flags |= 8), this.italicAngle !== 0 && (this.flags |= 64), this.flags |= 32, !this.cmap.unicode) throw new Error("No unicode cmap for font");
}, r.prototype.characterToGlyph = function(e) {
var n;
return ((n = this.cmap.unicode) != null ? n.codeMap[e] : void 0) || 0;
}, r.prototype.widthOfGlyph = function(e) {
var n;
return n = 1e3 / this.head.unitsPerEm, this.hmtx.forGlyph(e).advance * n;
}, r.prototype.widthOfString = function(e, n, a) {
var u, s, c, f;
for (c = 0, s = 0, f = (e = "" + e).length; 0 <= f ? s < f : s > f; s = 0 <= f ? ++s : --s) u = e.charCodeAt(s), c += this.widthOfGlyph(this.characterToGlyph(u)) + a * (1e3 / n) || 0;
return c * (n / 1e3);
}, r.prototype.lineHeight = function(e, n) {
var a;
return n == null && (n = !1), a = n ? this.lineGap : 0, (this.ascender + a - this.decender) / 1e3 * e;
}, r;
}();
var zn, jr = function() {
function r(e) {
this.data = e ?? [], this.pos = 0, this.length = this.data.length;
}
return r.prototype.readByte = function() {
return this.data[this.pos++];
}, r.prototype.writeByte = function(e) {
return this.data[this.pos++] = e;
}, r.prototype.readUInt32 = function() {
return 16777216 * this.readByte() + (this.readByte() << 16) + (this.readByte() << 8) + this.readByte();
}, r.prototype.writeUInt32 = function(e) {
return this.writeByte(e >>> 24 & 255), this.writeByte(e >> 16 & 255), this.writeByte(e >> 8 & 255), this.writeByte(255 & e);
}, r.prototype.readInt32 = function() {
var e;
return (e = this.readUInt32()) >= 2147483648 ? e - 4294967296 : e;
}, r.prototype.writeInt32 = function(e) {
return e < 0 && (e += 4294967296), this.writeUInt32(e);
}, r.prototype.readUInt16 = function() {
return this.readByte() << 8 | this.readByte();
}, r.prototype.writeUInt16 = function(e) {
return this.writeByte(e >> 8 & 255), this.writeByte(255 & e);
}, r.prototype.readInt16 = function() {
var e;
return (e = this.readUInt16()) >= 32768 ? e - 65536 : e;
}, r.prototype.writeInt16 = function(e) {
return e < 0 && (e += 65536), this.writeUInt16(e);
}, r.prototype.readString = function(e) {
var n, a;
for (a = [], n = 0; 0 <= e ? n < e : n > e; n = 0 <= e ? ++n : --n) a[n] = String.fromCharCode(this.readByte());
return a.join("");
}, r.prototype.writeString = function(e) {
var n, a, u;
for (u = [], n = 0, a = e.length; 0 <= a ? n < a : n > a; n = 0 <= a ? ++n : --n) u.push(this.writeByte(e.charCodeAt(n)));
return u;
}, r.prototype.readShort = function() {
return this.readInt16();
}, r.prototype.writeShort = function(e) {
return this.writeInt16(e);
}, r.prototype.readLongLong = function() {
var e, n, a, u, s, c, f, h;
return e = this.readByte(), n = this.readByte(), a = this.readByte(), u = this.readByte(), s = this.readByte(), c = this.readByte(), f = this.readByte(), h = this.readByte(), 128 & e ? -1 * (72057594037927940 * (255 ^ e) + 281474976710656 * (255 ^ n) + 1099511627776 * (255 ^ a) + 4294967296 * (255 ^ u) + 16777216 * (255 ^ s) + 65536 * (255 ^ c) + 256 * (255 ^ f) + (255 ^ h) + 1) : 72057594037927940 * e + 281474976710656 * n + 1099511627776 * a + 4294967296 * u + 16777216 * s + 65536 * c + 256 * f + h;
}, r.prototype.writeLongLong = function(e) {
var n, a;
return n = Math.floor(e / 4294967296), a = 4294967295 & e, this.writeByte(n >> 24 & 255), this.writeByte(n >> 16 & 255), this.writeByte(n >> 8 & 255), this.writeByte(255 & n), this.writeByte(a >> 24 & 255), this.writeByte(a >> 16 & 255), this.writeByte(a >> 8 & 255), this.writeByte(255 & a);
}, r.prototype.readInt = function() {
return this.readInt32();
}, r.prototype.writeInt = function(e) {
return this.writeInt32(e);
}, r.prototype.read = function(e) {
var n, a;
for (n = [], a = 0; 0 <= e ? a < e : a > e; a = 0 <= e ? ++a : --a) n.push(this.readByte());
return n;
}, r.prototype.write = function(e) {
var n, a, u, s;
for (s = [], a = 0, u = e.length; a < u; a++) n = e[a], s.push(this.writeByte(n));
return s;
}, r;
}(), uc = function() {
var r;
function e(n) {
var a, u, s;
for (this.scalarType = n.readInt(), this.tableCount = n.readShort(), this.searchRange = n.readShort(), this.entrySelector = n.readShort(), this.rangeShift = n.readShort(), this.tables = {}, u = 0, s = this.tableCount; 0 <= s ? u < s : u > s; u = 0 <= s ? ++u : --u) a = { tag: n.readString(4), checksum: n.readInt(), offset: n.readInt(), length: n.readInt() }, this.tables[a.tag] = a;
}
return e.prototype.encode = function(n) {
var a, u, s, c, f, h, g, y, w, S, p, O, F;
for (F in p = Object.keys(n).length, h = Math.log(2), w = 16 * Math.floor(Math.log(p) / h), c = Math.floor(w / h), y = 16 * p - w, (u = new jr()).writeInt(this.scalarType), u.writeShort(p), u.writeShort(w), u.writeShort(c), u.writeShort(y), s = 16 * p, g = u.pos + s, f = null, O = [], n) for (S = n[F], u.writeString(F), u.writeInt(r(S)), u.writeInt(g), u.writeInt(S.length), O = O.concat(S), F === "head" && (f = g), g += S.length; g % 4; ) O.push(0), g++;
return u.write(O), a = 2981146554 - r(u.data), u.pos = f + 8, u.writeUInt32(a), u.data;
}, r = function(n) {
var a, u, s, c;
for (n = Uu.call(n); n.length % 4; ) n.push(0);
for (s = new jr(n), u = 0, a = 0, c = n.length; a < c; a = a += 4) u += s.readUInt32();
return 4294967295 & u;
}, e;
}(), lc = {}.hasOwnProperty, er = function(r, e) {
for (var n in e) lc.call(e, n) && (r[n] = e[n]);
function a() {
this.constructor = r;
}
return a.prototype = e.prototype, r.prototype = new a(), r.__super__ = e.prototype, r;
};
zn = function() {
function r(e) {
var n;
this.file = e, n = this.file.directory.tables[this.tag], this.exists = !!n, n && (this.offset = n.offset, this.length = n.length, this.parse(this.file.contents));
}
return r.prototype.parse = function() {
}, r.prototype.encode = function() {
}, r.prototype.raw = function() {
return this.exists ? (this.file.contents.pos = this.offset, this.file.contents.read(this.length)) : null;
}, r;
}();
var cc = function(r) {
function e() {
return e.__super__.constructor.apply(this, arguments);
}
return er(e, zn), e.prototype.tag = "head", e.prototype.parse = function(n) {
return n.pos = this.offset, this.version = n.readInt(), this.revision = n.readInt(), this.checkSumAdjustment = n.readInt(), this.magicNumber = n.readInt(), this.flags = n.readShort(), this.unitsPerEm = n.readShort(), this.created = n.readLongLong(), this.modified = n.readLongLong(), this.xMin = n.readShort(), this.yMin = n.readShort(), this.xMax = n.readShort(), this.yMax = n.readShort(), this.macStyle = n.readShort(), this.lowestRecPPEM = n.readShort(), this.fontDirectionHint = n.readShort(), this.indexToLocFormat = n.readShort(), this.glyphDataFormat = n.readShort();
}, e.prototype.encode = function(n) {
var a;
return (a = new jr()).writeInt(this.version), a.writeInt(this.revision), a.writeInt(this.checkSumAdjustment), a.writeInt(this.magicNumber), a.writeShort(this.flags), a.writeShort(this.unitsPerEm), a.writeLongLong(this.created), a.writeLongLong(this.modified), a.writeShort(this.xMin), a.writeShort(this.yMin), a.writeShort(this.xMax), a.writeShort(this.yMax), a.writeShort(this.macStyle), a.writeShort(this.lowestRecPPEM), a.writeShort(this.fontDirectionHint), a.writeShort(n), a.writeShort(this.glyphDataFormat), a.data;
}, e;
}(), Lu = function() {
function r(e, n) {
var a, u, s, c, f, h, g, y, w, S, p, O, F, q, _, M, Y;
switch (this.platformID = e.readUInt16(), this.encodingID = e.readShort(), this.offset = n + e.readInt(), w = e.pos, e.pos = this.offset, this.format = e.readUInt16(), this.length = e.readUInt16(), this.language = e.readUInt16(), this.isUnicode = this.platformID === 3 && this.encodingID === 1 && this.format === 4 || this.platformID === 0 && this.format === 4, this.codeMap = {}, this.format) {
case 0:
for (h = 0; h < 256; ++h) this.codeMap[h] = e.readByte();
break;
case 4:
for (p = e.readUInt16(), S = p / 2, e.pos += 6, s = function() {
var st, ct;
for (ct = [], h = st = 0; 0 <= S ? st < S : st > S; h = 0 <= S ? ++st : --st) ct.push(e.readUInt16());
return ct;
}(), e.pos += 2, F = function() {
var st, ct;
for (ct = [], h = st = 0; 0 <= S ? st < S : st > S; h = 0 <= S ? ++st : --st) ct.push(e.readUInt16());
return ct;
}(), g = function() {
var st, ct;
for (ct = [], h = st = 0; 0 <= S ? st < S : st > S; h = 0 <= S ? ++st : --st) ct.push(e.readUInt16());
return ct;
}(), y = function() {
var st, ct;
for (ct = [], h = st = 0; 0 <= S ? st < S : st > S; h = 0 <= S ? ++st : --st) ct.push(e.readUInt16());
return ct;
}(), u = (this.length - e.pos + this.offset) / 2, f = function() {
var st, ct;
for (ct = [], h = st = 0; 0 <= u ? st < u : st > u; h = 0 <= u ? ++st : --st) ct.push(e.readUInt16());
return ct;
}(), h = _ = 0, Y = s.length; _ < Y; h = ++_) for (q = s[h], a = M = O = F[h]; O <= q ? M <= q : M >= q; a = O <= q ? ++M : --M) y[h] === 0 ? c = a + g[h] : (c = f[y[h] / 2 + (a - O) - (S - h)] || 0) !== 0 && (c += g[h]), this.codeMap[a] = 65535 & c;
}
e.pos = w;
}
return r.encode = function(e, n) {
var a, u, s, c, f, h, g, y, w, S, p, O, F, q, _, M, Y, st, ct, wt, tt, z, rt, pt, P, k, W, D, ot, it, ft, $, lt, dt, jt, N, C, B, T, J, Q, et, nt, At, Nt, Ft;
switch (D = new jr(), c = Object.keys(e).sort(function(_t, zt) {
return _t - zt;
}), n) {
case "macroman":
for (F = 0, q = function() {
var _t = [];
for (O = 0; O < 256; ++O) _t.push(0);
return _t;
}(), M = { 0: 0 }, s = {}, ot = 0, lt = c.length; ot < lt; ot++) M[nt = e[u = c[ot]]] == null && (M[nt] = ++F), s[u] = { old: e[u], new: M[e[u]] }, q[u] = M[e[u]];
return D.writeUInt16(1), D.writeUInt16(0), D.writeUInt32(12), D.writeUInt16(0), D.writeUInt16(262), D.writeUInt16(0), D.write(q), { charMap: s, subtable: D.data, maxGlyphID: F + 1 };
case "unicode":
for (k = [], w = [], Y = 0, M = {}, a = {}, _ = g = null, it = 0, dt = c.length; it < dt; it++) M[ct = e[u = c[it]]] == null && (M[ct] = ++Y), a[u] = { old: ct, new: M[ct] }, f = M[ct] - u, _ != null && f === g || (_ && w.push(_), k.push(u), g = f), _ = u;
for (_ && w.push(_), w.push(65535), k.push(65535), pt = 2 * (rt = k.length), z = 2 * Math.pow(Math.log(rt) / Math.LN2, 2), S = Math.log(z / 2) / Math.LN2, tt = 2 * rt - z, h = [], wt = [], p = [], O = ft = 0, jt = k.length; ft < jt; O = ++ft) {
if (P = k[O], y = w[O], P === 65535) {
h.push(0), wt.push(0);
break;
}
if (P - (W = a[P].new) >= 32768) for (h.push(0), wt.push(2 * (p.length + rt - O)), u = $ = P; P <= y ? $ <= y : $ >= y; u = P <= y ? ++$ : --$) p.push(a[u].new);
else h.push(W - P), wt.push(0);
}
for (D.writeUInt16(3), D.writeUInt16(1), D.writeUInt32(12), D.writeUInt16(4), D.writeUInt16(16 + 8 * rt + 2 * p.length), D.writeUInt16(0), D.writeUInt16(pt), D.writeUInt16(z), D.writeUInt16(S), D.writeUInt16(tt), Q = 0, N = w.length; Q < N; Q++) u = w[Q], D.writeUInt16(u);
for (D.writeUInt16(0), et = 0, C = k.length; et < C; et++) u = k[et], D.writeUInt16(u);
for (At = 0, B = h.length; At < B; At++) f = h[At], D.writeUInt16(f);
for (Nt = 0, T = wt.length; Nt < T; Nt++) st = wt[Nt], D.writeUInt16(st);
for (Ft = 0, J = p.length; Ft < J; Ft++) F = p[Ft], D.writeUInt16(F);
return { charMap: a, subtable: D.data, maxGlyphID: Y + 1 };
}
}, r;
}(), zu = function(r) {
function e() {
return e.__super__.constructor.apply(this, arguments);
}
return er(e, zn), e.prototype.tag = "cmap", e.prototype.parse = function(n) {
var a, u, s;
for (n.pos = this.offset, this.version = n.readUInt16(), s = n.readUInt16(), this.tables = [], this.unicode = null, u = 0; 0 <= s ? u < s : u > s; u = 0 <= s ? ++u : --u) a = new Lu(n, this.offset), this.tables.push(a), a.isUnicode && this.unicode == null && (this.unicode = a);
return !0;
}, e.encode = function(n, a) {
var u, s;
return a == null && (a = "macroman"), u = Lu.encode(n, a), (s = new jr()).writeUInt16(0), s.writeUInt16(1), u.table = s.data.concat(u.subtable), u;
}, e;
}(), fc = function(r) {
function e() {
return e.__super__.constructor.apply(this, arguments);
}
return er(e, zn), e.prototype.tag = "hhea", e.prototype.parse = function(n) {
return n.pos = this.offset, this.version = n.readInt(), this.ascender = n.readShort(), this.decender = n.readShort(), this.lineGap = n.readShort(), this.advanceWidthMax = n.readShort(), this.minLeftSideBearing = n.readShort(), this.minRightSideBearing = n.readShort(), this.xMaxExtent = n.readShort(), this.caretSlopeRise = n.readShort(), this.caretSlopeRun = n.readShort(), this.caretOffset = n.readShort(), n.pos += 8, this.metricDataFormat = n.readShort(), this.numberOfMetrics = n.readUInt16();
}, e;
}(), hc = function(r) {
function e() {
return e.__super__.constructor.apply(this, arguments);
}
return er(e, zn), e.prototype.tag = "OS/2", e.prototype.parse = function(n) {
if (n.pos = this.offset, this.version = n.readUInt16(), this.averageCharWidth = n.readShort(), this.weightClass = n.readUInt16(), this.widthClass = n.readUInt16(), this.type = n.readShort(), this.ySubscriptXSize = n.readShort(), this.ySubscriptYSize = n.readShort(), this.ySubscriptXOffset = n.readShort(), this.ySubscriptYOffset = n.readShort(), this.ySuperscriptXSize = n.readShort(), this.ySuperscriptYSize = n.readShort(), this.ySuperscriptXOffset = n.readShort(), this.ySuperscriptYOffset = n.readShort(), this.yStrikeoutSize = n.readShort(), this.yStrikeoutPosition = n.readShort(), this.familyClass = n.readShort(), this.panose = function() {
var a, u;
for (u = [], a = 0; a < 10; ++a) u.push(n.readByte());
return u;
}(), this.charRange = function() {
var a, u;
for (u = [], a = 0; a < 4; ++a) u.push(n.readInt());
return u;
}(), this.vendorID = n.readString(4), this.selection = n.readShort(), this.firstCharIndex = n.readShort(), this.lastCharIndex = n.readShort(), this.version > 0 && (this.ascent = n.readShort(), this.descent = n.readShort(), this.lineGap = n.readShort(), this.winAscent = n.readShort(), this.winDescent = n.readShort(), this.codePageRange = function() {
var a, u;
for (u = [], a = 0; a < 2; a = ++a) u.push(n.readInt());
return u;
}(), this.version > 1)) return this.xHeight = n.readShort(), this.capHeight = n.readShort(), this.defaultChar = n.readShort(), this.breakChar = n.readShort(), this.maxContext = n.readShort();
}, e;
}(), dc = function(r) {
function e() {
return e.__super__.constructor.apply(this, arguments);
}
return er(e, zn), e.prototype.tag = "post", e.prototype.parse = function(n) {
var a, u, s;
switch (n.pos = this.offset, this.format = n.readInt(), this.italicAngle = n.readInt(), this.underlinePosition = n.readShort(), this.underlineThickness = n.readShort(), this.isFixedPitch = n.readInt(), this.minMemType42 = n.readInt(), this.maxMemType42 = n.readInt(), this.minMemType1 = n.readInt(), this.maxMemType1 = n.readInt(), this.format) {
case 65536:
break;
case 131072:
var c;
for (u = n.readUInt16(), this.glyphNameIndex = [], c = 0; 0 <= u ? c < u : c > u; c = 0 <= u ? ++c : --c) this.glyphNameIndex.push(n.readUInt16());
for (this.names = [], s = []; n.pos < this.offset + this.length; ) a = n.readByte(), s.push(this.names.push(n.readString(a)));
return s;
case 151552:
return u = n.readUInt16(), this.offsets = n.read(u);
case 196608:
break;
case 262144:
return this.map = (function() {
var f, h, g;
for (g = [], c = f = 0, h = this.file.maxp.numGlyphs; 0 <= h ? f < h : f > h; c = 0 <= h ? ++f : --f) g.push(n.readUInt32());
return g;
}).call(this);
}
}, e;
}(), pc = function(r, e) {
this.raw = r, this.length = r.length, this.platformID = e.platformID, this.encodingID = e.encodingID, this.languageID = e.languageID;
}, gc = function(r) {
function e() {
return e.__super__.constructor.apply(this, arguments);
}
return er(e, zn), e.prototype.tag = "name", e.prototype.parse = function(n) {
var a, u, s, c, f, h, g, y, w, S, p;
for (n.pos = this.offset, n.readShort(), a = n.readShort(), h = n.readShort(), u = [], c = 0; 0 <= a ? c < a : c > a; c = 0 <= a ? ++c : --c) u.push({ platformID: n.readShort(), encodingID: n.readShort(), languageID: n.readShort(), nameID: n.readShort(), length: n.readShort(), offset: this.offset + h + n.readShort() });
for (g = {}, c = w = 0, S = u.length; w < S; c = ++w) s = u[c], n.pos = s.offset, y = n.readString(s.length), f = new pc(y, s), g[p = s.nameID] == null && (g[p] = []), g[s.nameID].push(f);
this.strings = g, this.copyright = g[0], this.fontFamily = g[1], this.fontSubfamily = g[2], this.uniqueSubfamily = g[3], this.fontName = g[4], this.version = g[5];
try {
this.postscriptName = g[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g, "");
} catch {
this.postscriptName = g[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g, "");
}
return this.trademark = g[7], this.manufacturer = g[8], this.designer = g[9], this.description = g[10], this.vendorUrl = g[11], this.designerUrl = g[12], this.license = g[13], this.licenseUrl = g[14], this.preferredFamily = g[15], this.preferredSubfamily = g[17], this.compatibleFull = g[18], this.sampleText = g[19];
}, e;
}(), mc = function(r) {
function e() {
return e.__super__.constructor.apply(this, arguments);
}
return er(e, zn), e.prototype.tag = "maxp", e.prototype.parse = function(n) {
return n.pos = this.offset, this.version = n.readInt(), this.numGlyphs = n.readUInt16(), this.maxPoints = n.readUInt16(), this.maxContours = n.readUInt16(), this.maxCompositePoints = n.readUInt16(), this.maxComponentContours = n.readUInt16(), this.maxZones = n.readUInt16(), this.maxTwilightPoints = n.readUInt16(), this.maxStorage = n.readUInt16(), this.maxFunctionDefs = n.readUInt16(), this.maxInstructionDefs = n.readUInt16(), this.maxStackElements = n.readUInt16(), this.maxSizeOfInstructions = n.readUInt16(), this.maxComponentElements = n.readUInt16(), this.maxComponentDepth = n.readUInt16();
}, e;
}(), vc = function(r) {
function e() {
return e.__super__.constructor.apply(this, arguments);
}
return er(e, zn), e.prototype.tag = "hmtx", e.prototype.parse = function(n) {
var a, u, s, c, f, h, g;
for (n.pos = this.offset, this.metrics = [], a = 0, h = this.file.hhea.numberOfMetrics; 0 <= h ? a < h : a > h; a = 0 <= h ? ++a : --a) this.metrics.push({ advance: n.readUInt16(), lsb: n.readInt16() });
for (s = this.file.maxp.numGlyphs - this.file.hhea.numberOfMetrics, this.leftSideBearings = function() {
var y, w;
for (w = [], a = y = 0; 0 <= s ? y < s : y > s; a = 0 <= s ? ++y : --y) w.push(n.readInt16());
return w;
}(), this.widths = (function() {
var y, w, S, p;
for (p = [], y = 0, w = (S = this.metrics).length; y < w; y++) c = S[y], p.push(c.advance);
return p;
}).call(this), u = this.widths[this.widths.length - 1], g = [], a = f = 0; 0 <= s ? f < s : f > s; a = 0 <= s ? ++f : --f) g.push(this.widths.push(u));
return g;
}, e.prototype.forGlyph = function(n) {
return n in this.metrics ? this.metrics[n] : { advance: this.metrics[this.metrics.length - 1].advance, lsb: this.leftSideBearings[n - this.metrics.length] };
}, e;
}(), Uu = [].slice, bc = function(r) {
function e() {
return e.__super__.constructor.apply(this, arguments);
}
return er(e, zn), e.prototype.tag = "glyf", e.prototype.parse = function() {
return this.cache = {};
}, e.prototype.glyphFor = function(n) {
var a, u, s, c, f, h, g, y, w, S;
return n in this.cache ? this.cache[n] : (c = this.file.loca, a = this.file.contents, u = c.indexOf(n), (s = c.lengthOf(n)) === 0 ? this.cache[n] = null : (a.pos = this.offset + u, f = (h = new jr(a.read(s))).readShort(), y = h.readShort(), S = h.readShort(), g = h.readShort(), w = h.readShort(), this.cache[n] = f === -1 ? new wc(h, y, S, g, w) : new yc(h, f, y, S, g, w), this.cache[n]));
}, e.prototype.encode = function(n, a, u) {
var s, c, f, h, g;
for (f = [], c = [], h = 0, g = a.length; h < g; h++) s = n[a[h]], c.push(f.length), s && (f = f.concat(s.encode(u)));
return c.push(f.length), { table: f, offsets: c };
}, e;
}(), yc = function() {
function r(e, n, a, u, s, c) {
this.raw = e, this.numberOfContours = n, this.xMin = a, this.yMin = u, this.xMax = s, this.yMax = c, this.compound = !1;
}
return r.prototype.encode = function() {
return this.raw.data;
}, r;
}(), wc = function() {
function r(e, n, a, u, s) {
var c, f;
for (this.raw = e, this.xMin = n, this.yMin = a, this.xMax = u, this.yMax = s, this.compound = !0, this.glyphIDs = [], this.glyphOffsets = [], c = this.raw; f = c.readShort(), this.glyphOffsets.push(c.pos), this.glyphIDs.push(c.readUInt16()), 32 & f; ) c.pos += 1 & f ? 4 : 2, 128 & f ? c.pos += 8 : 64 & f ? c.pos += 4 : 8 & f && (c.pos += 2);
}
return r.prototype.encode = function() {
var e, n, a;
for (n = new jr(Uu.call(this.raw.data)), e = 0, a = this.glyphIDs.length; e < a; ++e) n.pos = this.glyphOffsets[e];
return n.data;
}, r;
}(), Lc = function(r) {
function e() {
return e.__super__.constructor.apply(this, arguments);
}
return er(e, zn), e.prototype.tag = "loca", e.prototype.parse = function(n) {
var a, u;
return n.pos = this.offset, a = this.file.head.indexToLocFormat, this.offsets = a === 0 ? (function() {
var s, c;
for (c = [], u = 0, s = this.length; u < s; u += 2) c.push(2 * n.readUInt16());
return c;
}).call(this) : (function() {
var s, c;
for (c = [], u = 0, s = this.length; u < s; u += 4) c.push(n.readUInt32());
return c;
}).call(this);
}, e.prototype.indexOf = function(n) {
return this.offsets[n];
}, e.prototype.lengthOf = function(n) {
return this.offsets[n + 1] - this.offsets[n];
}, e.prototype.encode = function(n, a) {
for (var u = new Uint32Array(this.offsets.length), s = 0, c = 0, f = 0; f < u.length; ++f) if (u[f] = s, c < a.length && a[c] == f) {
++c, u[f] = s;
var h = this.offsets[f], g = this.offsets[f + 1] - h;
g > 0 && (s += g);
}
for (var y = new Array(4 * u.length), w = 0; w < u.length; ++w) y[4 * w + 3] = 255 & u[w], y[4 * w + 2] = (65280 & u[w]) >> 8, y[4 * w + 1] = (16711680 & u[w]) >> 16, y[4 * w] = (4278190080 & u[w]) >> 24;
return y;
}, e;
}(), Nc = function() {
function r(e) {
this.font = e, this.subset = {}, this.unicodes = {}, this.next = 33;
}
return r.prototype.generateCmap = function() {
var e, n, a, u, s;
for (n in u = this.font.cmap.tables[0].codeMap, e = {}, s = this.subset) a = s[n], e[n] = u[a];
return e;
}, r.prototype.glyphsFor = function(e) {
var n, a, u, s, c, f, h;
for (u = {}, c = 0, f = e.length; c < f; c++) u[s = e[c]] = this.font.glyf.glyphFor(s);
for (s in n = [], u) (a = u[s]) != null && a.compound && n.push.apply(n, a.glyphIDs);
if (n.length > 0) for (s in h = this.glyphsFor(n)) a = h[s], u[s] = a;
return u;
}, r.prototype.encode = function(e, n) {
var a, u, s, c, f, h, g, y, w, S, p, O, F, q, _;
for (u in a = zu.encode(this.generateCmap(), "unicode"), c = this.glyphsFor(e), p = { 0: 0 }, _ = a.charMap) p[(h = _[u]).old] = h.new;
for (O in S = a.maxGlyphID, c) O in p || (p[O] = S++);
return y = function(M) {
var Y, st;
for (Y in st = {}, M) st[M[Y]] = Y;
return st;
}(p), w = Object.keys(y).sort(function(M, Y) {
return M - Y;
}), F = function() {
var M, Y, st;
for (st = [], M = 0, Y = w.length; M < Y; M++) f = w[M], st.push(y[f]);
return st;
}(), s = this.font.glyf.encode(c, F, p), g = this.font.loca.encode(s.offsets, F), q = { cmap: this.font.cmap.raw(), glyf: s.table, loca: g, hmtx: this.font.hmtx.raw(), hhea: this.font.hhea.raw(), maxp: this.font.maxp.raw(), post: this.font.post.raw(), name: this.font.name.raw(), head: this.font.head.encode(n) }, this.font.os2.exists && (q["OS/2"] = this.font.os2.raw()), this.font.directory.encode(q);
}, r;
}();
Ut.API.PDFObject = function() {
var r;
function e() {
}
return r = function(n, a) {
return (Array(a + 1).join("0") + n).slice(-a);
}, e.convert = function(n) {
var a, u, s, c;
if (Array.isArray(n)) return "[" + function() {
var f, h, g;
for (g = [], f = 0, h = n.length; f < h; f++) a = n[f], g.push(e.convert(a));
return g;
}().join(" ") + "]";
if (typeof n == "string") return "/" + n;
if (n != null && n.isString) return "(" + n + ")";
if (n instanceof Date) return "(D:" + r(n.getUTCFullYear(), 4) + r(n.getUTCMonth(), 2) + r(n.getUTCDate(), 2) + r(n.getUTCHours(), 2) + r(n.getUTCMinutes(), 2) + r(n.getUTCSeconds(), 2) + "Z)";
if ({}.toString.call(n) === "[object Object]") {
for (u in s = ["<<"], n) c = n[u], s.push("/" + u + " " + e.convert(c));
return s.push(">>"), s.join(`
`);
}
return "" + n;
}, e;
}();
export {
Ut as E,
he as _
};