goobs-frontend
Version:
A comprehensive React-based libary for building modern web applications
9,842 lines • 539 kB
JavaScript
'use client';
function _e(r) {
"@babel/helpers - typeof";
return _e = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(t) {
return typeof t;
} : function(t) {
return t && typeof Symbol == "function" && t.constructor === Symbol && t !== Symbol.prototype ? "symbol" : typeof t;
}, _e(r);
}
var Zr = Uint8Array, Er = Uint16Array, Go = Int32Array, Yo = new Zr([
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
]), Jo = new Zr([
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
]), jl = new Zr([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), Yu = function(r, t) {
for (var e = new Er(31), i = 0; i < 31; ++i)
e[i] = t += 1 << r[i - 1];
for (var o = new Go(e[30]), i = 1; i < 30; ++i)
for (var a = e[i]; a < e[i + 1]; ++a)
o[a] = a - e[i] << 5 | i;
return { b: e, r: o };
}, Ju = Yu(Yo, 2), _h = Ju.b, Bo = Ju.r;
_h[28] = 258, Bo[258] = 28;
var Ah = Yu(Jo, 0), Bl = Ah.r, Mo = new Er(32768);
for (var Ce = 0; Ce < 32768; ++Ce) {
var Zn = (Ce & 43690) >> 1 | (Ce & 21845) << 1;
Zn = (Zn & 52428) >> 2 | (Zn & 13107) << 2, Zn = (Zn & 61680) >> 4 | (Zn & 3855) << 4, Mo[Ce] = ((Zn & 65280) >> 8 | (Zn & 255) << 8) >> 1;
}
var ka = (function(r, t, e) {
for (var i = r.length, o = 0, a = new Er(t); o < i; ++o)
r[o] && ++a[r[o] - 1];
var c = new Er(t);
for (o = 1; o < t; ++o)
c[o] = c[o - 1] + a[o - 1] << 1;
var l;
if (e) {
l = new Er(1 << t);
var h = 15 - t;
for (o = 0; o < i; ++o)
if (r[o])
for (var d = o << 4 | r[o], m = t - r[o], _ = c[r[o] - 1]++ << m, k = _ | (1 << m) - 1; _ <= k; ++_)
l[Mo[_] >> h] = d;
} else
for (l = new Er(i), o = 0; o < i; ++o)
r[o] && (l[o] = Mo[c[r[o] - 1]++] >> 15 - r[o]);
return l;
}), Pi = new Zr(288);
for (var Ce = 0; Ce < 144; ++Ce)
Pi[Ce] = 8;
for (var Ce = 144; Ce < 256; ++Ce)
Pi[Ce] = 9;
for (var Ce = 256; Ce < 280; ++Ce)
Pi[Ce] = 7;
for (var Ce = 280; Ce < 288; ++Ce)
Pi[Ce] = 8;
var Cs = new Zr(32);
for (var Ce = 0; Ce < 32; ++Ce)
Cs[Ce] = 5;
var Nh = /* @__PURE__ */ ka(Pi, 9, 0), Lh = /* @__PURE__ */ ka(Cs, 5, 0), Ku = function(r) {
return (r + 7) / 8 | 0;
}, Sh = function(r, t, e) {
return (e == null || e > r.length) && (e = r.length), new Zr(r.subarray(t, e));
}, On = function(r, t, e) {
e <<= t & 7;
var i = t / 8 | 0;
r[i] |= e, r[i + 1] |= e >> 8;
}, La = function(r, t, e) {
e <<= t & 7;
var i = t / 8 | 0;
r[i] |= e, r[i + 1] |= e >> 8, r[i + 2] |= e >> 16;
}, po = function(r, t) {
for (var e = [], i = 0; i < r.length; ++i)
r[i] && e.push({ s: i, f: r[i] });
var o = e.length, a = e.slice();
if (!o)
return { t: $u, l: 0 };
if (o == 1) {
var c = new Zr(e[0].s + 1);
return c[e[0].s] = 1, { t: c, l: 1 };
}
e.sort(function(it, mt) {
return it.f - mt.f;
}), e.push({ s: -1, f: 25001 });
var l = e[0], h = e[1], d = 0, m = 1, _ = 2;
for (e[0] = { s: -1, f: l.f + h.f, l, r: h }; m != o - 1; )
l = e[e[d].f < e[_].f ? d++ : _++], h = e[d != m && e[d].f < e[_].f ? d++ : _++], e[m++] = { s: -1, f: l.f + h.f, l, r: h };
for (var k = a[0].s, i = 1; i < o; ++i)
a[i].s > k && (k = a[i].s);
var p = new Er(k + 1), j = Ro(e[m - 1], p, 0);
if (j > t) {
var i = 0, O = 0, M = j - t, S = 1 << M;
for (a.sort(function(mt, ct) {
return p[ct.s] - p[mt.s] || mt.f - ct.f;
}); i < o; ++i) {
var V = a[i].s;
if (p[V] > t)
O += S - (1 << j - p[V]), p[V] = t;
else
break;
}
for (O >>= M; O > 0; ) {
var G = a[i].s;
p[G] < t ? O -= 1 << t - p[G]++ - 1 : ++i;
}
for (; i >= 0 && O; --i) {
var D = a[i].s;
p[D] == t && (--p[D], ++O);
}
j = t;
}
return { t: new Zr(p), l: j };
}, Ro = function(r, t, e) {
return r.s == -1 ? Math.max(Ro(r.l, t, e + 1), Ro(r.r, t, e + 1)) : t[r.s] = e;
}, Ml = function(r) {
for (var t = r.length; t && !r[--t]; )
;
for (var e = new Er(++t), i = 0, o = r[0], a = 1, c = function(h) {
e[i++] = h;
}, l = 1; l <= t; ++l)
if (r[l] == o && l != t)
++a;
else {
if (!o && a > 2) {
for (; a > 138; a -= 138)
c(32754);
a > 2 && (c(a > 10 ? a - 11 << 5 | 28690 : a - 3 << 5 | 12305), a = 0);
} else if (a > 3) {
for (c(o), --a; a > 6; a -= 6)
c(8304);
a > 2 && (c(a - 3 << 5 | 8208), a = 0);
}
for (; a--; )
c(o);
a = 1, o = r[l];
}
return { c: e.subarray(0, i), n: t };
}, Sa = function(r, t) {
for (var e = 0, i = 0; i < t.length; ++i)
e += r[i] * t[i];
return e;
}, Xu = function(r, t, e) {
var i = e.length, o = Ku(t + 2);
r[o] = i & 255, r[o + 1] = i >> 8, r[o + 2] = r[o] ^ 255, r[o + 3] = r[o + 1] ^ 255;
for (var a = 0; a < i; ++a)
r[o + a + 4] = e[a];
return (o + 4 + i) * 8;
}, Rl = function(r, t, e, i, o, a, c, l, h, d, m) {
On(t, m++, e), ++o[256];
for (var _ = po(o, 15), k = _.t, p = _.l, j = po(a, 15), O = j.t, M = j.l, S = Ml(k), V = S.c, G = S.n, D = Ml(O), it = D.c, mt = D.n, ct = new Er(19), K = 0; K < V.length; ++K)
++ct[V[K] & 31];
for (var K = 0; K < it.length; ++K)
++ct[it[K] & 31];
for (var R = po(ct, 7), tt = R.t, N = R.l, F = 19; F > 4 && !tt[jl[F - 1]]; --F)
;
var z = d + 5 << 3, U = Sa(o, Pi) + Sa(a, Cs) + c, nt = Sa(o, k) + Sa(a, O) + c + 14 + 3 * F + Sa(ct, tt) + 2 * ct[16] + 3 * ct[17] + 7 * ct[18];
if (h >= 0 && z <= U && z <= nt)
return Xu(t, m, r.subarray(h, h + d));
var ot, ut, rt, ht;
if (On(t, m, 1 + (nt < U)), m += 2, nt < U) {
ot = ka(k, p, 0), ut = k, rt = ka(O, M, 0), ht = O;
var At = ka(tt, N, 0);
On(t, m, G - 257), On(t, m + 5, mt - 1), On(t, m + 10, F - 4), m += 14;
for (var K = 0; K < F; ++K)
On(t, m + 3 * K, tt[jl[K]]);
m += 3 * F;
for (var wt = [V, it], x = 0; x < 2; ++x)
for (var B = wt[x], K = 0; K < B.length; ++K) {
var T = B[K] & 31;
On(t, m, At[T]), m += tt[T], T > 15 && (On(t, m, B[K] >> 5 & 127), m += B[K] >> 12);
}
} else
ot = Nh, ut = Pi, rt = Lh, ht = Cs;
for (var K = 0; K < l; ++K) {
var H = i[K];
if (H > 255) {
var T = H >> 18 & 31;
La(t, m, ot[T + 257]), m += ut[T + 257], T > 7 && (On(t, m, H >> 23 & 31), m += Yo[T]);
var J = H & 31;
La(t, m, rt[J]), m += ht[J], J > 3 && (La(t, m, H >> 5 & 8191), m += Jo[J]);
} else
La(t, m, ot[H]), m += ut[H];
}
return La(t, m, ot[256]), m + ut[256];
}, kh = /* @__PURE__ */ new Go([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), $u = /* @__PURE__ */ new Zr(0), Ph = function(r, t, e, i, o, a) {
var c = a.z || r.length, l = new Zr(i + c + 5 * (1 + Math.ceil(c / 7e3)) + o), h = l.subarray(i, l.length - o), d = a.l, m = (a.r || 0) & 7;
if (t) {
m && (h[0] = a.r >> 3);
for (var _ = kh[t - 1], k = _ >> 13, p = _ & 8191, j = (1 << e) - 1, O = a.p || new Er(32768), M = a.h || new Er(j + 1), S = Math.ceil(e / 3), V = 2 * S, G = function(Dt) {
return (r[Dt] ^ r[Dt + 1] << S ^ r[Dt + 2] << V) & j;
}, D = new Go(25e3), it = new Er(288), mt = new Er(32), ct = 0, K = 0, R = a.i || 0, tt = 0, N = a.w || 0, F = 0; R + 2 < c; ++R) {
var z = G(R), U = R & 32767, nt = M[z];
if (O[U] = nt, M[z] = U, N <= R) {
var ot = c - R;
if ((ct > 7e3 || tt > 24576) && (ot > 423 || !d)) {
m = Rl(r, h, 0, D, it, mt, K, tt, F, R - F, m), tt = ct = K = 0, F = R;
for (var ut = 0; ut < 286; ++ut)
it[ut] = 0;
for (var ut = 0; ut < 30; ++ut)
mt[ut] = 0;
}
var rt = 2, ht = 0, At = p, wt = U - nt & 32767;
if (ot > 2 && z == G(R - wt))
for (var x = Math.min(k, ot) - 1, B = Math.min(32767, R), T = Math.min(258, ot); wt <= B && --At && U != nt; ) {
if (r[R + rt] == r[R + rt - wt]) {
for (var H = 0; H < T && r[R + H] == r[R + H - wt]; ++H)
;
if (H > rt) {
if (rt = H, ht = wt, H > x)
break;
for (var J = Math.min(wt, H - 2), Z = 0, ut = 0; ut < J; ++ut) {
var at = R - wt + ut & 32767, st = O[at], gt = at - st & 32767;
gt > Z && (Z = gt, nt = at);
}
}
}
U = nt, nt = O[U], wt += U - nt & 32767;
}
if (ht) {
D[tt++] = 268435456 | Bo[rt] << 18 | Bl[ht];
var _t = Bo[rt] & 31, kt = Bl[ht] & 31;
K += Yo[_t] + Jo[kt], ++it[257 + _t], ++mt[kt], N = R + rt, ++ct;
} else
D[tt++] = r[R], ++it[r[R]];
}
}
for (R = Math.max(R, N); R < c; ++R)
D[tt++] = r[R], ++it[r[R]];
m = Rl(r, h, d, D, it, mt, K, tt, F, R - F, m), d || (a.r = m & 7 | h[m / 8 | 0] << 3, m -= 7, a.h = M, a.p = O, a.i = R, a.w = N);
} else {
for (var R = a.w || 0; R < c + d; R += 65535) {
var St = R + 65535;
St >= c && (h[m / 8 | 0] = d, St = c), m = Xu(h, m + 1, r.subarray(R, St));
}
a.i = c;
}
return Sh(l, 0, i + Ku(m) + o);
}, Zu = function() {
var r = 1, t = 0;
return {
p: function(e) {
for (var i = r, o = t, a = e.length | 0, c = 0; c != a; ) {
for (var l = Math.min(c + 2655, a); c < l; ++c)
o += i += e[c];
i = (i & 65535) + 15 * (i >> 16), o = (o & 65535) + 15 * (o >> 16);
}
r = i, t = o;
},
d: function() {
return r %= 65521, t %= 65521, (r & 255) << 24 | (r & 65280) << 8 | (t & 255) << 8 | t >> 8;
}
};
}, Ih = function(r, t, e, i, o) {
if (!o && (o = { l: 1 }, t.dictionary)) {
var a = t.dictionary.subarray(-32768), c = new Zr(a.length + r.length);
c.set(a), c.set(r, a.length), r = c, o.w = a.length;
}
return Ph(r, t.level == null ? 6 : t.level, t.mem == null ? o.l ? Math.ceil(Math.max(8, Math.min(13, Math.log(r.length))) * 1.5) : 20 : 12 + t.mem, e, i, o);
}, Qu = function(r, t, e) {
for (; e; ++t)
r[t] = e, e >>>= 8;
}, Ch = function(r, t) {
var e = t.level, i = e == 0 ? 0 : e < 6 ? 1 : e == 9 ? 3 : 2;
if (r[0] = 120, r[1] = i << 6 | (t.dictionary && 32), r[1] |= 31 - (r[0] << 8 | r[1]) % 31, t.dictionary) {
var o = Zu();
o.p(t.dictionary), Qu(r, 2, o.d());
}
};
function To(r, t) {
t || (t = {});
var e = Zu();
e.p(r);
var i = Ih(r, t, t.dictionary ? 6 : 2, 4);
return Ch(i, t), Qu(i, i.length - 4, e.d()), i;
}
var Fh = typeof TextDecoder < "u" && /* @__PURE__ */ new TextDecoder(), Eh = 0;
try {
Fh.decode($u, { stream: !0 }), Eh = 1;
} catch {
}
function Oh(r) {
if (Array.isArray(r)) return r;
}
function jh(r, t) {
var e = r == null ? null : typeof Symbol < "u" && r[Symbol.iterator] || r["@@iterator"];
if (e != null) {
var i, o, a, c, l = [], h = !0, d = !1;
try {
if (a = (e = e.call(r)).next, t !== 0) for (; !(h = (i = a.call(e)).done) && (l.push(i.value), l.length !== t); h = !0) ;
} catch (m) {
d = !0, o = m;
} finally {
try {
if (!h && e.return != null && (c = e.return(), Object(c) !== c)) return;
} finally {
if (d) throw o;
}
}
return l;
}
}
function Tl(r, t) {
(t == null || t > r.length) && (t = r.length);
for (var e = 0, i = Array(t); e < t; e++) i[e] = r[e];
return i;
}
function Bh(r, t) {
if (r) {
if (typeof r == "string") return Tl(r, t);
var e = {}.toString.call(r).slice(8, -1);
return e === "Object" && r.constructor && (e = r.constructor.name), e === "Map" || e === "Set" ? Array.from(r) : e === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e) ? Tl(r, t) : void 0;
}
}
function Mh() {
throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`);
}
function Dl(r, t) {
return Oh(r) || jh(r, t) || Bh(r, t) || Mh();
}
function ql(r, t = "utf8") {
return new TextDecoder(t).decode(r);
}
const Rh = new TextEncoder();
function Th(r) {
return Rh.encode(r);
}
const Dh = 1024 * 8, qh = (() => {
const r = new Uint8Array(4), t = new Uint32Array(r.buffer);
return !((t[0] = 1) & r[0]);
})(), go = {
int8: globalThis.Int8Array,
uint8: globalThis.Uint8Array,
int16: globalThis.Int16Array,
uint16: globalThis.Uint16Array,
int32: globalThis.Int32Array,
uint32: globalThis.Uint32Array,
uint64: globalThis.BigUint64Array,
int64: globalThis.BigInt64Array,
float32: globalThis.Float32Array,
float64: globalThis.Float64Array
};
class Ko {
/**
* Reference to the internal ArrayBuffer object.
*/
buffer;
/**
* Byte length of the internal ArrayBuffer.
*/
byteLength;
/**
* Byte offset of the internal ArrayBuffer.
*/
byteOffset;
/**
* Byte length of the internal ArrayBuffer.
*/
length;
/**
* The current offset of the buffer's pointer.
*/
offset;
lastWrittenByte;
littleEndian;
_data;
_mark;
_marks;
/**
* Create a new IOBuffer.
* @param data - The data to construct the IOBuffer with.
* If data is a number, it will be the new buffer's length<br>
* If data is `undefined`, the buffer will be initialized with a default length of 8Kb<br>
* If data is an ArrayBuffer, SharedArrayBuffer, an ArrayBufferView (Typed Array), an IOBuffer instance,
* or a Node.js Buffer, a view will be created over the underlying ArrayBuffer.
* @param options - An object for the options.
* @returns A new IOBuffer instance.
*/
constructor(t = Dh, e = {}) {
let i = !1;
typeof t == "number" ? t = new ArrayBuffer(t) : (i = !0, this.lastWrittenByte = t.byteLength);
const o = e.offset ? e.offset >>> 0 : 0, a = t.byteLength - o;
let c = o;
(ArrayBuffer.isView(t) || t instanceof Ko) && (t.byteLength !== t.buffer.byteLength && (c = t.byteOffset + o), t = t.buffer), i ? this.lastWrittenByte = a : this.lastWrittenByte = 0, this.buffer = t, this.length = a, this.byteLength = a, this.byteOffset = c, this.offset = 0, this.littleEndian = !0, this._data = new DataView(this.buffer, c, a), this._mark = 0, this._marks = [];
}
/**
* Checks if the memory allocated to the buffer is sufficient to store more
* bytes after the offset.
* @param byteLength - The needed memory in bytes.
* @returns `true` if there is sufficient space and `false` otherwise.
*/
available(t = 1) {
return this.offset + t <= this.length;
}
/**
* Check if little-endian mode is used for reading and writing multi-byte
* values.
* @returns `true` if little-endian mode is used, `false` otherwise.
*/
isLittleEndian() {
return this.littleEndian;
}
/**
* Set little-endian mode for reading and writing multi-byte values.
* @returns This.
*/
setLittleEndian() {
return this.littleEndian = !0, this;
}
/**
* Check if big-endian mode is used for reading and writing multi-byte values.
* @returns `true` if big-endian mode is used, `false` otherwise.
*/
isBigEndian() {
return !this.littleEndian;
}
/**
* Switches to big-endian mode for reading and writing multi-byte values.
* @returns This.
*/
setBigEndian() {
return this.littleEndian = !1, this;
}
/**
* Move the pointer n bytes forward.
* @param n - Number of bytes to skip.
* @returns This.
*/
skip(t = 1) {
return this.offset += t, this;
}
/**
* Move the pointer n bytes backward.
* @param n - Number of bytes to move back.
* @returns This.
*/
back(t = 1) {
return this.offset -= t, this;
}
/**
* Move the pointer to the given offset.
* @param offset - The offset to move to.
* @returns This.
*/
seek(t) {
return this.offset = t, this;
}
/**
* Store the current pointer offset.
* @see {@link IOBuffer#reset}
* @returns This.
*/
mark() {
return this._mark = this.offset, this;
}
/**
* Move the pointer back to the last pointer offset set by mark.
* @see {@link IOBuffer#mark}
* @returns This.
*/
reset() {
return this.offset = this._mark, this;
}
/**
* Push the current pointer offset to the mark stack.
* @see {@link IOBuffer#popMark}
* @returns This.
*/
pushMark() {
return this._marks.push(this.offset), this;
}
/**
* Pop the last pointer offset from the mark stack, and set the current
* pointer offset to the popped value.
* @see {@link IOBuffer#pushMark}
* @returns This.
*/
popMark() {
const t = this._marks.pop();
if (t === void 0)
throw new Error("Mark stack empty");
return this.seek(t), this;
}
/**
* Move the pointer offset back to 0.
* @returns This.
*/
rewind() {
return this.offset = 0, this;
}
/**
* Make sure the buffer has sufficient memory to write a given byteLength at
* the current pointer offset.
* If the buffer's memory is insufficient, this method will create a new
* buffer (a copy) with a length that is twice (byteLength + current offset).
* @param byteLength - The needed memory in bytes.
* @returns This.
*/
ensureAvailable(t = 1) {
if (!this.available(t)) {
const i = (this.offset + t) * 2, o = new Uint8Array(i);
o.set(new Uint8Array(this.buffer)), this.buffer = o.buffer, this.length = i, this.byteLength = i, this._data = new DataView(this.buffer);
}
return this;
}
/**
* Read a byte and return false if the byte's value is 0, or true otherwise.
* Moves pointer forward by one byte.
* @returns The read boolean.
*/
readBoolean() {
return this.readUint8() !== 0;
}
/**
* Read a signed 8-bit integer and move pointer forward by 1 byte.
* @returns The read byte.
*/
readInt8() {
return this._data.getInt8(this.offset++);
}
/**
* Read an unsigned 8-bit integer and move pointer forward by 1 byte.
* @returns The read byte.
*/
readUint8() {
return this._data.getUint8(this.offset++);
}
/**
* Alias for {@link IOBuffer#readUint8}.
* @returns The read byte.
*/
readByte() {
return this.readUint8();
}
/**
* Read `n` bytes and move pointer forward by `n` bytes.
* @param n - Number of bytes to read.
* @returns The read bytes.
*/
readBytes(t = 1) {
return this.readArray(t, "uint8");
}
/**
* Creates an array of corresponding to the type `type` and size `size`.
* For example type `uint8` will create a `Uint8Array`.
* @param size - size of the resulting array
* @param type - number type of elements to read
* @returns The read array.
*/
readArray(t, e) {
const i = go[e].BYTES_PER_ELEMENT * t, o = this.byteOffset + this.offset, a = this.buffer.slice(o, o + i);
if (this.littleEndian === qh && e !== "uint8" && e !== "int8") {
const l = new Uint8Array(this.buffer.slice(o, o + i));
l.reverse();
const h = new go[e](l.buffer);
return this.offset += i, h.reverse(), h;
}
const c = new go[e](a);
return this.offset += i, c;
}
/**
* Read a 16-bit signed integer and move pointer forward by 2 bytes.
* @returns The read value.
*/
readInt16() {
const t = this._data.getInt16(this.offset, this.littleEndian);
return this.offset += 2, t;
}
/**
* Read a 16-bit unsigned integer and move pointer forward by 2 bytes.
* @returns The read value.
*/
readUint16() {
const t = this._data.getUint16(this.offset, this.littleEndian);
return this.offset += 2, t;
}
/**
* Read a 32-bit signed integer and move pointer forward by 4 bytes.
* @returns The read value.
*/
readInt32() {
const t = this._data.getInt32(this.offset, this.littleEndian);
return this.offset += 4, t;
}
/**
* Read a 32-bit unsigned integer and move pointer forward by 4 bytes.
* @returns The read value.
*/
readUint32() {
const t = this._data.getUint32(this.offset, this.littleEndian);
return this.offset += 4, t;
}
/**
* Read a 32-bit floating number and move pointer forward by 4 bytes.
* @returns The read value.
*/
readFloat32() {
const t = this._data.getFloat32(this.offset, this.littleEndian);
return this.offset += 4, t;
}
/**
* Read a 64-bit floating number and move pointer forward by 8 bytes.
* @returns The read value.
*/
readFloat64() {
const t = this._data.getFloat64(this.offset, this.littleEndian);
return this.offset += 8, t;
}
/**
* Read a 64-bit signed integer number and move pointer forward by 8 bytes.
* @returns The read value.
*/
readBigInt64() {
const t = this._data.getBigInt64(this.offset, this.littleEndian);
return this.offset += 8, t;
}
/**
* Read a 64-bit unsigned integer number and move pointer forward by 8 bytes.
* @returns The read value.
*/
readBigUint64() {
const t = this._data.getBigUint64(this.offset, this.littleEndian);
return this.offset += 8, t;
}
/**
* Read a 1-byte ASCII character and move pointer forward by 1 byte.
* @returns The read character.
*/
readChar() {
return String.fromCharCode(this.readInt8());
}
/**
* Read `n` 1-byte ASCII characters and move pointer forward by `n` bytes.
* @param n - Number of characters to read.
* @returns The read characters.
*/
readChars(t = 1) {
let e = "";
for (let i = 0; i < t; i++)
e += this.readChar();
return e;
}
/**
* Read the next `n` bytes, return a UTF-8 decoded string and move pointer
* forward by `n` bytes.
* @param n - Number of bytes to read.
* @returns The decoded string.
*/
readUtf8(t = 1) {
return ql(this.readBytes(t));
}
/**
* Read the next `n` bytes, return a string decoded with `encoding` and move pointer
* forward by `n` bytes.
* If no encoding is passed, the function is equivalent to @see {@link IOBuffer#readUtf8}
* @param n - Number of bytes to read.
* @param encoding - The encoding to use. Default is 'utf8'.
* @returns The decoded string.
*/
decodeText(t = 1, e = "utf8") {
return ql(this.readBytes(t), e);
}
/**
* Write 0xff if the passed value is truthy, 0x00 otherwise and move pointer
* forward by 1 byte.
* @param value - The value to write.
* @returns This.
*/
writeBoolean(t) {
return this.writeUint8(t ? 255 : 0), this;
}
/**
* Write `value` as an 8-bit signed integer and move pointer forward by 1 byte.
* @param value - The value to write.
* @returns This.
*/
writeInt8(t) {
return this.ensureAvailable(1), this._data.setInt8(this.offset++, t), this._updateLastWrittenByte(), this;
}
/**
* Write `value` as an 8-bit unsigned integer and move pointer forward by 1
* byte.
* @param value - The value to write.
* @returns This.
*/
writeUint8(t) {
return this.ensureAvailable(1), this._data.setUint8(this.offset++, t), this._updateLastWrittenByte(), this;
}
/**
* An alias for {@link IOBuffer#writeUint8}.
* @param value - The value to write.
* @returns This.
*/
writeByte(t) {
return this.writeUint8(t);
}
/**
* Write all elements of `bytes` as uint8 values and move pointer forward by
* `bytes.length` bytes.
* @param bytes - The array of bytes to write.
* @returns This.
*/
writeBytes(t) {
this.ensureAvailable(t.length);
for (let e = 0; e < t.length; e++)
this._data.setUint8(this.offset++, t[e]);
return this._updateLastWrittenByte(), this;
}
/**
* Write `value` as a 16-bit signed integer and move pointer forward by 2
* bytes.
* @param value - The value to write.
* @returns This.
*/
writeInt16(t) {
return this.ensureAvailable(2), this._data.setInt16(this.offset, t, this.littleEndian), this.offset += 2, this._updateLastWrittenByte(), this;
}
/**
* Write `value` as a 16-bit unsigned integer and move pointer forward by 2
* bytes.
* @param value - The value to write.
* @returns This.
*/
writeUint16(t) {
return this.ensureAvailable(2), this._data.setUint16(this.offset, t, this.littleEndian), this.offset += 2, this._updateLastWrittenByte(), this;
}
/**
* Write `value` as a 32-bit signed integer and move pointer forward by 4
* bytes.
* @param value - The value to write.
* @returns This.
*/
writeInt32(t) {
return this.ensureAvailable(4), this._data.setInt32(this.offset, t, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this;
}
/**
* Write `value` as a 32-bit unsigned integer and move pointer forward by 4
* bytes.
* @param value - The value to write.
* @returns This.
*/
writeUint32(t) {
return this.ensureAvailable(4), this._data.setUint32(this.offset, t, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this;
}
/**
* Write `value` as a 32-bit floating number and move pointer forward by 4
* bytes.
* @param value - The value to write.
* @returns This.
*/
writeFloat32(t) {
return this.ensureAvailable(4), this._data.setFloat32(this.offset, t, this.littleEndian), this.offset += 4, this._updateLastWrittenByte(), this;
}
/**
* Write `value` as a 64-bit floating number and move pointer forward by 8
* bytes.
* @param value - The value to write.
* @returns This.
*/
writeFloat64(t) {
return this.ensureAvailable(8), this._data.setFloat64(this.offset, t, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this;
}
/**
* Write `value` as a 64-bit signed bigint and move pointer forward by 8
* bytes.
* @param value - The value to write.
* @returns This.
*/
writeBigInt64(t) {
return this.ensureAvailable(8), this._data.setBigInt64(this.offset, t, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this;
}
/**
* Write `value` as a 64-bit unsigned bigint and move pointer forward by 8
* bytes.
* @param value - The value to write.
* @returns This.
*/
writeBigUint64(t) {
return this.ensureAvailable(8), this._data.setBigUint64(this.offset, t, this.littleEndian), this.offset += 8, this._updateLastWrittenByte(), this;
}
/**
* Write the charCode of `str`'s first character as an 8-bit unsigned integer
* and move pointer forward by 1 byte.
* @param str - The character to write.
* @returns This.
*/
writeChar(t) {
return this.writeUint8(t.charCodeAt(0));
}
/**
* Write the charCodes of all `str`'s characters as 8-bit unsigned integers
* and move pointer forward by `str.length` bytes.
* @param str - The characters to write.
* @returns This.
*/
writeChars(t) {
for (let e = 0; e < t.length; e++)
this.writeUint8(t.charCodeAt(e));
return this;
}
/**
* UTF-8 encode and write `str` to the current pointer offset and move pointer
* forward according to the encoded length.
* @param str - The string to write.
* @returns This.
*/
writeUtf8(t) {
return this.writeBytes(Th(t));
}
/**
* Export a Uint8Array view of the internal buffer.
* The view starts at the byte offset and its length
* is calculated to stop at the last written byte or the original length.
* @returns A new Uint8Array view.
*/
toArray() {
return new Uint8Array(this.buffer, this.byteOffset, this.lastWrittenByte);
}
/**
* Get the total number of bytes written so far, regardless of the current offset.
* @returns - Total number of bytes.
*/
getWrittenByteLength() {
return this.lastWrittenByte - this.byteOffset;
}
/**
* Update the last written byte offset
* @private
*/
_updateLastWrittenByte() {
this.offset > this.lastWrittenByte && (this.lastWrittenByte = this.offset);
}
}
function Xi(r) {
let t = r.length;
for (; --t >= 0; )
r[t] = 0;
}
const Uh = 3, zh = 258, tf = 29, Hh = 256, Wh = Hh + 1 + tf, ef = 30, Vh = 512, Gh = new Array((Wh + 2) * 2);
Xi(Gh);
const Yh = new Array(ef * 2);
Xi(Yh);
const Jh = new Array(Vh);
Xi(Jh);
const Kh = new Array(zh - Uh + 1);
Xi(Kh);
const Xh = new Array(tf);
Xi(Xh);
const $h = new Array(ef);
Xi($h);
const Zh = (r, t, e, i) => {
let o = r & 65535 | 0, a = r >>> 16 & 65535 | 0, c = 0;
for (; e !== 0; ) {
c = e > 2e3 ? 2e3 : e, e -= c;
do
o = o + t[i++] | 0, a = a + o | 0;
while (--c);
o %= 65521, a %= 65521;
}
return o | a << 16 | 0;
};
var Do = Zh;
const Qh = () => {
let r, t = [];
for (var e = 0; e < 256; e++) {
r = e;
for (var i = 0; i < 8; i++)
r = r & 1 ? 3988292384 ^ r >>> 1 : r >>> 1;
t[e] = r;
}
return t;
}, tc = new Uint32Array(Qh()), ec = (r, t, e, i) => {
const o = tc, a = i + e;
r ^= -1;
for (let c = i; c < a; c++)
r = r >>> 8 ^ o[(r ^ t[c]) & 255];
return r ^ -1;
};
var hn = ec, qo = {
2: "need dictionary",
/* Z_NEED_DICT 2 */
1: "stream end",
/* Z_STREAM_END 1 */
0: "",
/* Z_OK 0 */
"-1": "file error",
/* Z_ERRNO (-1) */
"-2": "stream error",
/* Z_STREAM_ERROR (-2) */
"-3": "data error",
/* Z_DATA_ERROR (-3) */
"-4": "insufficient memory",
/* Z_MEM_ERROR (-4) */
"-5": "buffer error",
/* Z_BUF_ERROR (-5) */
"-6": "incompatible version"
/* Z_VERSION_ERROR (-6) */
}, rf = {
/* Allowed flush values; see deflate() and inflate() below for details */
Z_NO_FLUSH: 0,
Z_FINISH: 4,
Z_BLOCK: 5,
Z_TREES: 6,
/* Return codes for the compression/decompression functions. Negative values
* are errors, positive values are used for special but normal events.
*/
Z_OK: 0,
Z_STREAM_END: 1,
Z_NEED_DICT: 2,
Z_STREAM_ERROR: -2,
Z_DATA_ERROR: -3,
Z_MEM_ERROR: -4,
Z_BUF_ERROR: -5,
/* The deflate compression method */
Z_DEFLATED: 8
//Z_NULL: null // Use -1 or null inline, depending on var type
};
const rc = (r, t) => Object.prototype.hasOwnProperty.call(r, t);
var nc = function(r) {
const t = Array.prototype.slice.call(arguments, 1);
for (; t.length; ) {
const e = t.shift();
if (e) {
if (typeof e != "object")
throw new TypeError(e + "must be non-object");
for (const i in e)
rc(e, i) && (r[i] = e[i]);
}
}
return r;
}, ic = (r) => {
let t = 0;
for (let i = 0, o = r.length; i < o; i++)
t += r[i].length;
const e = new Uint8Array(t);
for (let i = 0, o = 0, a = r.length; i < a; i++) {
let c = r[i];
e.set(c, o), o += c.length;
}
return e;
}, nf = {
assign: nc,
flattenChunks: ic
};
let af = !0;
try {
String.fromCharCode.apply(null, new Uint8Array(1));
} catch {
af = !1;
}
const Oa = new Uint8Array(256);
for (let r = 0; r < 256; r++)
Oa[r] = r >= 252 ? 6 : r >= 248 ? 5 : r >= 240 ? 4 : r >= 224 ? 3 : r >= 192 ? 2 : 1;
Oa[254] = Oa[254] = 1;
var ac = (r) => {
if (typeof TextEncoder == "function" && TextEncoder.prototype.encode)
return new TextEncoder().encode(r);
let t, e, i, o, a, c = r.length, l = 0;
for (o = 0; o < c; o++)
e = r.charCodeAt(o), (e & 64512) === 55296 && o + 1 < c && (i = r.charCodeAt(o + 1), (i & 64512) === 56320 && (e = 65536 + (e - 55296 << 10) + (i - 56320), o++)), l += e < 128 ? 1 : e < 2048 ? 2 : e < 65536 ? 3 : 4;
for (t = new Uint8Array(l), a = 0, o = 0; a < l; o++)
e = r.charCodeAt(o), (e & 64512) === 55296 && o + 1 < c && (i = r.charCodeAt(o + 1), (i & 64512) === 56320 && (e = 65536 + (e - 55296 << 10) + (i - 56320), o++)), e < 128 ? t[a++] = e : e < 2048 ? (t[a++] = 192 | e >>> 6, t[a++] = 128 | e & 63) : e < 65536 ? (t[a++] = 224 | e >>> 12, t[a++] = 128 | e >>> 6 & 63, t[a++] = 128 | e & 63) : (t[a++] = 240 | e >>> 18, t[a++] = 128 | e >>> 12 & 63, t[a++] = 128 | e >>> 6 & 63, t[a++] = 128 | e & 63);
return t;
};
const sc = (r, t) => {
if (t < 65534 && r.subarray && af)
return String.fromCharCode.apply(null, r.length === t ? r : r.subarray(0, t));
let e = "";
for (let i = 0; i < t; i++)
e += String.fromCharCode(r[i]);
return e;
};
var oc = (r, t) => {
const e = t || r.length;
if (typeof TextDecoder == "function" && TextDecoder.prototype.decode)
return new TextDecoder().decode(r.subarray(0, t));
let i, o;
const a = new Array(e * 2);
for (o = 0, i = 0; i < e; ) {
let c = r[i++];
if (c < 128) {
a[o++] = c;
continue;
}
let l = Oa[c];
if (l > 4) {
a[o++] = 65533, i += l - 1;
continue;
}
for (c &= l === 2 ? 31 : l === 3 ? 15 : 7; l > 1 && i < e; )
c = c << 6 | r[i++] & 63, l--;
if (l > 1) {
a[o++] = 65533;
continue;
}
c < 65536 ? a[o++] = c : (c -= 65536, a[o++] = 55296 | c >> 10 & 1023, a[o++] = 56320 | c & 1023);
}
return sc(a, o);
}, lc = (r, t) => {
t = t || r.length, t > r.length && (t = r.length);
let e = t - 1;
for (; e >= 0 && (r[e] & 192) === 128; )
e--;
return e < 0 || e === 0 ? t : e + Oa[r[e]] > t ? e : t;
}, Uo = {
string2buf: ac,
buf2string: oc,
utf8border: lc
};
function uc() {
this.input = null, this.next_in = 0, this.avail_in = 0, this.total_in = 0, this.output = null, this.next_out = 0, this.avail_out = 0, this.total_out = 0, this.msg = "", this.state = null, this.data_type = 2, this.adler = 0;
}
var fc = uc;
const ws = 16209, hc = 16191;
var cc = function(t, e) {
let i, o, a, c, l, h, d, m, _, k, p, j, O, M, S, V, G, D, it, mt, ct, K, R, tt;
const N = t.state;
i = t.next_in, R = t.input, o = i + (t.avail_in - 5), a = t.next_out, tt = t.output, c = a - (e - t.avail_out), l = a + (t.avail_out - 257), h = N.dmax, d = N.wsize, m = N.whave, _ = N.wnext, k = N.window, p = N.hold, j = N.bits, O = N.lencode, M = N.distcode, S = (1 << N.lenbits) - 1, V = (1 << N.distbits) - 1;
t:
do {
j < 15 && (p += R[i++] << j, j += 8, p += R[i++] << j, j += 8), G = O[p & S];
e:
for (; ; ) {
if (D = G >>> 24, p >>>= D, j -= D, D = G >>> 16 & 255, D === 0)
tt[a++] = G & 65535;
else if (D & 16) {
it = G & 65535, D &= 15, D && (j < D && (p += R[i++] << j, j += 8), it += p & (1 << D) - 1, p >>>= D, j -= D), j < 15 && (p += R[i++] << j, j += 8, p += R[i++] << j, j += 8), G = M[p & V];
r:
for (; ; ) {
if (D = G >>> 24, p >>>= D, j -= D, D = G >>> 16 & 255, D & 16) {
if (mt = G & 65535, D &= 15, j < D && (p += R[i++] << j, j += 8, j < D && (p += R[i++] << j, j += 8)), mt += p & (1 << D) - 1, mt > h) {
t.msg = "invalid distance too far back", N.mode = ws;
break t;
}
if (p >>>= D, j -= D, D = a - c, mt > D) {
if (D = mt - D, D > m && N.sane) {
t.msg = "invalid distance too far back", N.mode = ws;
break t;
}
if (ct = 0, K = k, _ === 0) {
if (ct += d - D, D < it) {
it -= D;
do
tt[a++] = k[ct++];
while (--D);
ct = a - mt, K = tt;
}
} else if (_ < D) {
if (ct += d + _ - D, D -= _, D < it) {
it -= D;
do
tt[a++] = k[ct++];
while (--D);
if (ct = 0, _ < it) {
D = _, it -= D;
do
tt[a++] = k[ct++];
while (--D);
ct = a - mt, K = tt;
}
}
} else if (ct += _ - D, D < it) {
it -= D;
do
tt[a++] = k[ct++];
while (--D);
ct = a - mt, K = tt;
}
for (; it > 2; )
tt[a++] = K[ct++], tt[a++] = K[ct++], tt[a++] = K[ct++], it -= 3;
it && (tt[a++] = K[ct++], it > 1 && (tt[a++] = K[ct++]));
} else {
ct = a - mt;
do
tt[a++] = tt[ct++], tt[a++] = tt[ct++], tt[a++] = tt[ct++], it -= 3;
while (it > 2);
it && (tt[a++] = tt[ct++], it > 1 && (tt[a++] = tt[ct++]));
}
} else if ((D & 64) === 0) {
G = M[(G & 65535) + (p & (1 << D) - 1)];
continue r;
} else {
t.msg = "invalid distance code", N.mode = ws;
break t;
}
break;
}
} else if ((D & 64) === 0) {
G = O[(G & 65535) + (p & (1 << D) - 1)];
continue e;
} else if (D & 32) {
N.mode = hc;
break t;
} else {
t.msg = "invalid literal/length code", N.mode = ws;
break t;
}
break;
}
} while (i < o && a < l);
it = j >> 3, i -= it, j -= it << 3, p &= (1 << j) - 1, t.next_in = i, t.next_out = a, t.avail_in = i < o ? 5 + (o - i) : 5 - (i - o), t.avail_out = a < l ? 257 + (l - a) : 257 - (a - l), N.hold = p, N.bits = j;
};
const Vi = 15, Ul = 852, zl = 592, Hl = 0, mo = 1, Wl = 2, dc = new Uint16Array([
/* Length codes 257..285 base */
3,
4,
5,
6,
7,
8,
9,
10,
11,
13,
15,
17,
19,
23,
27,
31,
35,
43,
51,
59,
67,
83,
99,
115,
131,
163,
195,
227,
258,
0,
0
]), pc = new Uint8Array([
/* Length codes 257..285 extra */
16,
16,
16,
16,
16,
16,
16,
16,
17,
17,
17,
17,
18,
18,
18,
18,
19,
19,
19,
19,
20,
20,
20,
20,
21,
21,
21,
21,
16,
72,
78
]), gc = new Uint16Array([
/* Distance codes 0..29 base */
1,
2,
3,
4,
5,
7,
9,
13,
17,
25,
33,
49,
65,
97,
129,
193,
257,
385,
513,
769,
1025,
1537,
2049,
3073,
4097,
6145,
8193,
12289,
16385,
24577,
0,
0
]), mc = new Uint8Array([
/* Distance codes 0..29 extra */
16,
16,
16,
16,
17,
17,
18,
18,
19,
19,
20,
20,
21,
21,
22,
22,
23,
23,
24,
24,
25,
25,
26,
26,
27,
27,
28,
28,
29,
29,
64,
64
]), vc = (r, t, e, i, o, a, c, l) => {
const h = l.bits;
let d = 0, m = 0, _ = 0, k = 0, p = 0, j = 0, O = 0, M = 0, S = 0, V = 0, G, D, it, mt, ct, K = null, R;
const tt = new Uint16Array(Vi + 1), N = new Uint16Array(Vi + 1);
let F = null, z, U, nt;
for (d = 0; d <= Vi; d++)
tt[d] = 0;
for (m = 0; m < i; m++)
tt[t[e + m]]++;
for (p = h, k = Vi; k >= 1 && tt[k] === 0; k--)
;
if (p > k && (p = k), k === 0)
return o[a++] = 1 << 24 | 64 << 16 | 0, o[a++] = 1 << 24 | 64 << 16 | 0, l.bits = 1, 0;
for (_ = 1; _ < k && tt[_] === 0; _++)
;
for (p < _ && (p = _), M = 1, d = 1; d <= Vi; d++)
if (M <<= 1, M -= tt[d], M < 0)
return -1;
if (M > 0 && (r === Hl || k !== 1))
return -1;
for (N[1] = 0, d = 1; d < Vi; d++)
N[d + 1] = N[d] + tt[d];
for (m = 0; m < i; m++)
t[e + m] !== 0 && (c[N[t[e + m]]++] = m);
if (r === Hl ? (K = F = c, R = 20) : r === mo ? (K = dc, F = pc, R = 257) : (K = gc, F = mc, R = 0), V = 0, m = 0, d = _, ct = a, j = p, O = 0, it = -1, S = 1 << p, mt = S - 1, r === mo && S > Ul || r === Wl && S > zl)
return 1;
for (; ; ) {
z = d - O, c[m] + 1 < R ? (U = 0, nt = c[m]) : c[m] >= R ? (U = F[c[m] - R], nt = K[c[m] - R]) : (U = 96, nt = 0), G = 1 << d - O, D = 1 << j, _ = D;
do
D -= G, o[ct + (V >> O) + D] = z << 24 | U << 16 | nt | 0;
while (D !== 0);
for (G = 1 << d - 1; V & G; )
G >>= 1;
if (G !== 0 ? (V &= G - 1, V += G) : V = 0, m++, --tt[d] === 0) {
if (d === k)
break;
d = t[e + c[m]];
}
if (d > p && (V & mt) !== it) {
for (O === 0 && (O = p), ct += _, j = d - O, M = 1 << j; j + O < k && (M -= tt[j + O], !(M <= 0)); )
j++, M <<= 1;
if (S += 1 << j, r === mo && S > Ul || r === Wl && S > zl)
return 1;
it = V & mt, o[it] = p << 24 | j << 16 | ct - a | 0;
}
}
return V !== 0 && (o[ct + V] = d - O << 24 | 64 << 16 | 0), l.bits = p, 0;
};
var Pa = vc;
const bc = 0, sf = 1, of = 2, {
Z_FINISH: Vl,
Z_BLOCK: wc,
Z_TREES: ys,
Z_OK: Ii,
Z_STREAM_END: yc,
Z_NEED_DICT: xc,
Z_STREAM_ERROR: zr,
Z_DATA_ERROR: lf,
Z_MEM_ERROR: uf,
Z_BUF_ERROR: _c,
Z_DEFLATED: Gl
} = rf, Os = 16180, Yl = 16181, Jl = 16182, Kl = 16183, Xl = 16184, $l = 16185, Zl = 16186, Ql = 16187, tu = 16188, eu = 16189, Fs = 16190, jn = 16191, vo = 16192, ru = 16193, bo = 16194, nu = 16195, iu = 16196, au = 16197, su = 16198, xs = 16199, _s = 16200, ou = 16201, lu = 16202, uu = 16203, fu = 16204, hu = 16205, wo = 16206, cu = 16207, du = 16208, Oe = 16209, ff = 16210, hf = 16211, Ac = 852, Nc = 592, Lc = 15, Sc = Lc, pu = (r) => (r >>> 24 & 255) + (r >>> 8 & 65280) + ((r & 65280) << 8) + ((r & 255) << 24);
function kc() {
this.strm = null, this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new Uint16Array(320), this.work = new Uint16Array(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
}
const Ci = (r) => {
if (!r)
return 1;
const t = r.state;
return !t || t.strm !== r || t.mode < Os || t.mode > hf ? 1 : 0;
}, cf = (r) => {
if (Ci(r))
return zr;
const t = r.state;
return r.total_in = r.total_out = t.total = 0, r.msg = "", t.wrap && (r.adler = t.wrap & 1), t.mode = Os, t.last = 0, t.havedict = 0, t.flags = -1, t.dmax = 32768, t.head = null, t.hold = 0, t.bits = 0, t.lencode = t.lendyn = new Int32Array(Ac), t.distcode = t.distdyn = new Int32Array(Nc), t.sane = 1, t.back = -1, Ii;
}, df = (r) => {
if (Ci(r))
return zr;
const t = r.state;
return t.wsize = 0, t.whave = 0, t.wnext = 0, cf(r);
}, pf = (r, t) => {
let e;
if (Ci(r))
return zr;
const i = r.state;
return t < 0 ? (e = 0, t = -t) : (e = (t >> 4) + 5, t < 48 && (t &= 15)), t && (t < 8 || t > 15) ? zr : (i.window !== null && i.wbits !== t && (i.window = null), i.wrap = e, i.wbits = t, df(r));
}, gf = (r, t) => {
if (!r)
return zr;
const e = new kc();
r.state = e, e.strm = r, e.window = null, e.mode = Os;
const i = pf(r, t);
return i !== Ii && (r.state = null), i;
}, Pc = (r) => gf(r, Sc);
let gu = !0, yo, xo;
const Ic = (r) => {
if (gu) {
yo = new Int32Array(512), xo = new Int32Array(32);
let t = 0;
for (; t < 144; )
r.lens[t++] = 8;
for (; t < 256; )
r.lens[t++] = 9;
for (; t < 280; )
r.lens[t++] = 7;
for (; t < 288; )
r.lens[t++] = 8;
for (Pa(sf, r.lens, 0, 288, yo, 0, r.work, { bits: 9 }), t = 0; t < 32; )
r.lens[t++] = 5;
Pa(of, r.lens, 0, 32, xo, 0, r.work, { bits: 5 }), gu = !1;
}
r.lencode = yo, r.lenbits = 9, r.distcode = xo, r.distbits = 5;
}, mf = (r, t, e, i) => {
let o;
const a = r.state;
return a.window === null && (a.wsize = 1 << a.wbits, a.wnext = 0, a.whave = 0, a.window = new Uint8Array(a.wsize)), i >= a.wsize ? (a.window.set(t.subarray(e - a.wsize, e), 0), a.wnext = 0, a.whave = a.wsize) : (o = a.wsize - a.wnext, o > i && (o = i), a.window.set(t.subarray(e - i, e - i + o), a.wnext), i -= o, i ? (a.window.set(t.subarray(e - i, e), 0), a.wnext = i, a.whave = a.wsize) : (a.wnext += o, a.wnext === a.wsize && (a.wnext = 0), a.whave < a.wsize && (a.whave += o))), 0;
}, Cc = (r, t) => {
let e, i, o, a, c, l, h, d, m, _, k, p, j, O, M = 0, S, V, G, D, it, mt, ct, K;
const R = new Uint8Array(4);
let tt, N;
const F = (
/* permutation of code lengths */
new Uint8Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15])
);
if (Ci(r) || !r.output || !r.input && r.avail_in !== 0)
return zr;
e = r.state, e.mode === jn && (e.mode = vo), c = r.next_out, o = r.output, h = r.avail_out, a = r.next_in, i = r.input, l = r.avail_in, d = e.hold, m = e.bits, _ = l, k = h, K = Ii;
t:
for (; ; )
switch (e.mode) {
case Os:
if (e.wrap === 0) {
e.mode = vo;
break;
}
for (; m < 16; ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
if (e.wrap & 2 && d === 35615) {
e.wbits === 0 && (e.wbits = 15), e.check = 0, R[0] = d & 255, R[1] = d >>> 8 & 255, e.check = hn(e.check, R, 2, 0), d = 0, m = 0, e.mode = Yl;
break;
}
if (e.head && (e.head.done = !1), !(e.wrap & 1) || /* check if zlib header allowed */
(((d & 255) << 8) + (d >> 8)) % 31) {
r.msg = "incorrect header check", e.mode = Oe;
break;
}
if ((d & 15) !== Gl) {
r.msg = "unknown compression method", e.mode = Oe;
break;
}
if (d >>>= 4, m -= 4, ct = (d & 15) + 8, e.wbits === 0 && (e.wbits = ct), ct > 15 || ct > e.wbits) {
r.msg = "invalid window size", e.mode = Oe;
break;
}
e.dmax = 1 << e.wbits, e.flags = 0, r.adler = e.check = 1, e.mode = d & 512 ? eu : jn, d = 0, m = 0;
break;
case Yl:
for (; m < 16; ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
if (e.flags = d, (e.flags & 255) !== Gl) {
r.msg = "unknown compression method", e.mode = Oe;
break;
}
if (e.flags & 57344) {
r.msg = "unknown header flags set", e.mode = Oe;
break;
}
e.head && (e.head.text = d >> 8 & 1), e.flags & 512 && e.wrap & 4 && (R[0] = d & 255, R[1] = d >>> 8 & 255, e.check = hn(e.check, R, 2, 0)), d = 0, m = 0, e.mode = Jl;
/* falls through */
case Jl:
for (; m < 32; ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
e.head && (e.head.time = d), e.flags & 512 && e.wrap & 4 && (R[0] = d & 255, R[1] = d >>> 8 & 255, R[2] = d >>> 16 & 255, R[3] = d >>> 24 & 255, e.check = hn(e.check, R, 4, 0)), d = 0, m = 0, e.mode = Kl;
/* falls through */
case Kl:
for (; m < 16; ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
e.head && (e.head.xflags = d & 255, e.head.os = d >> 8), e.flags & 512 && e.wrap & 4 && (R[0] = d & 255, R[1] = d >>> 8 & 255, e.check = hn(e.check, R, 2, 0)), d = 0, m = 0, e.mode = Xl;
/* falls through */
case Xl:
if (e.flags & 1024) {
for (; m < 16; ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
e.length = d, e.head && (e.head.extra_len = d), e.flags & 512 && e.wrap & 4 && (R[0] = d & 255, R[1] = d >>> 8 & 255, e.check = hn(e.check, R, 2, 0)), d = 0, m = 0;
} else e.head && (e.head.extra = null);
e.mode = $l;
/* falls through */
case $l:
if (e.flags & 1024 && (p = e.length, p > l && (p = l), p && (e.head && (ct = e.head.extra_len - e.length, e.head.extra || (e.head.extra = new Uint8Array(e.head.extra_len)), e.head.extra.set(
i.subarray(
a,
// extra field is limited to 65536 bytes
// - no need for additional size check
a + p
),
/*len + copy > state.head.extra_max - len ? state.head.extra_max : copy,*/
ct
)), e.flags & 512 && e.wrap & 4 && (e.check = hn(e.check, i, p, a)), l -= p, a += p, e.length -= p), e.length))
break t;
e.length = 0, e.mode = Zl;
/* falls through */
case Zl:
if (e.flags & 2048) {
if (l === 0)
break t;
p = 0;
do
ct = i[a + p++], e.head && ct && e.length < 65536 && (e.head.name += String.fromCharCode(ct));
while (ct && p < l);
if (e.flags & 512 && e.wrap & 4 && (e.check = hn(e.check, i, p, a)), l -= p, a += p, ct)
break t;
} else e.head && (e.head.name = null);
e.length = 0, e.mode = Ql;
/* falls through */
case Ql:
if (e.flags & 4096) {
if (l === 0)
break t;
p = 0;
do
ct = i[a + p++], e.head && ct && e.length < 65536 && (e.head.comment += String.fromCharCode(ct));
while (ct && p < l);
if (e.flags & 512 && e.wrap & 4 && (e.check = hn(e.check, i, p, a)), l -= p, a += p, ct)
break t;
} else e.head && (e.head.comment = null);
e.mode = tu;
/* falls through */
case tu:
if (e.flags & 512) {
for (; m < 16; ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
if (e.wrap & 4 && d !== (e.check & 65535)) {
r.msg = "header crc mismatch", e.mode = Oe;
break;
}
d = 0, m = 0;
}
e.head && (e.head.hcrc = e.flags >> 9 & 1, e.head.done = !0), r.adler = e.check = 0, e.mode = jn;
break;
case eu:
for (; m < 32; ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
r.adler = e.check = pu(d), d = 0, m = 0, e.mode = Fs;
/* falls through */
case Fs:
if (e.havedict === 0)
return r.next_out = c, r.avail_out = h, r.next_in = a, r.avail_in = l, e.hold = d, e.bits = m, xc;
r.adler = e.check = 1, e.mode = jn;
/* falls through */
case jn:
if (t === wc || t === ys)
break t;
/* falls through */
case vo:
if (e.last) {
d >>>= m & 7, m -= m & 7, e.mode = wo;
break;
}
for (; m < 3; ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
switch (e.last = d & 1, d >>>= 1, m -= 1, d & 3) {
case 0:
e.mode = ru;
break;
case 1:
if (Ic(e), e.mode = xs, t === ys) {
d >>>= 2, m -= 2;
break t;
}
break;
case 2:
e.mode = iu;
break;
case 3:
r.msg = "invalid block type", e.mode = Oe;
}
d >>>= 2, m -= 2;
break;
case ru:
for (d >>>= m & 7, m -= m & 7; m < 32; ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
if ((d & 65535) !== (d >>> 16 ^ 65535)) {
r.msg = "invalid stored block lengths", e.mode = Oe;
break;
}
if (e.length = d & 65535, d = 0, m = 0, e.mode = bo, t === ys)
break t;
/* falls through */
case bo:
e.mode = nu;
/* falls through */
case nu:
if (p = e.length, p) {
if (p > l && (p = l), p > h && (p = h), p === 0)
break t;
o.set(i.subarray(a, a + p), c), l -= p, a += p, h -= p, c += p, e.length -= p;
break;
}
e.mode = jn;
break;
case iu:
for (; m < 14; ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
if (e.nlen = (d & 31) + 257, d >>>= 5, m -= 5, e.ndist = (d & 31) + 1, d >>>= 5, m -= 5, e.ncode = (d & 15) + 4, d >>>= 4, m -= 4, e.nlen > 286 || e.ndist > 30) {
r.msg = "too many length or distance symbols", e.mode = Oe;
break;
}
e.have = 0, e.mode = au;
/* falls through */
case au:
for (; e.have < e.ncode; ) {
for (; m < 3; ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
e.lens[F[e.have++]] = d & 7, d >>>= 3, m -= 3;
}
for (; e.have < 19; )
e.lens[F[e.have++]] = 0;
if (e.lencode = e.lendyn, e.lenbits = 7, tt = { bits: e.lenbits }, K = Pa(bc, e.lens, 0, 19, e.lencode, 0, e.work, tt), e.lenbits = tt.bits, K) {
r.msg = "invalid code lengths set", e.mode = Oe;
break;
}
e.have = 0, e.mode = su;
/* falls through */
case su:
for (; e.have < e.nlen + e.ndist; ) {
for (; M = e.lencode[d & (1 << e.lenbits) - 1], S = M >>> 24, V = M >>> 16 & 255, G = M & 65535, !(S <= m); ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
if (G < 16)
d >>>= S, m -= S, e.lens[e.have++] = G;
else {
if (G === 16) {
for (N = S + 2; m < N; ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
if (d >>>= S, m -= S, e.have === 0) {
r.msg = "invalid bit length repeat", e.mode = Oe;
break;
}
ct = e.lens[e.have - 1], p = 3 + (d & 3), d >>>= 2, m -= 2;
} else if (G === 17) {
for (N = S + 3; m < N; ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
d >>>= S, m -= S, ct = 0, p = 3 + (d & 7), d >>>= 3, m -= 3;
} else {
for (N = S + 7; m < N; ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
d >>>= S, m -= S, ct = 0, p = 11 + (d & 127), d >>>= 7, m -= 7;
}
if (e.have + p > e.nlen + e.ndist) {
r.msg = "invalid bit length repeat", e.mode = Oe;
break;
}
for (; p--; )
e.lens[e.have++] = ct;
}
}
if (e.mode === Oe)
break;
if (e.lens[256] === 0) {
r.msg = "invalid code -- missing end-of-block", e.mode = Oe;
break;
}
if (e.lenbits = 9, tt = { bits: e.lenbits }, K = Pa(sf, e.lens, 0, e.nlen, e.lencode, 0, e.work, tt), e.lenbits = tt.bits, K) {
r.msg = "invalid literal/lengths set", e.mode = Oe;
break;
}
if (e.distbits = 6, e.distcode = e.distdyn, tt = { bits: e.distbits }, K = Pa(of, e.lens, e.nlen, e.ndist, e.distcode, 0, e.work, tt), e.distbits = tt.bits, K) {
r.msg = "invalid distances set", e.mode = Oe;
break;
}
if (e.mode = xs, t === ys)
break t;
/* falls through */
case xs:
e.mode = _s;
/* falls through */
case _s:
if (l >= 6 && h >= 258) {
r.next_out = c, r.avail_out = h, r.next_in = a, r.avail_in = l, e.hold = d, e.bits = m, cc(r, k), c = r.next_out, o = r.output, h = r.avail_out, a = r.next_in, i = r.input, l = r.avail_in, d = e.hold, m = e.bits, e.mode === jn && (e.back = -1);
break;
}
for (e.back = 0; M = e.lencode[d & (1 << e.lenbits) - 1], S = M >>> 24, V = M >>> 16 & 255, G = M & 65535, !(S <= m); ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
if (V && (V & 240) === 0) {
for (D = S, it = V, mt = G; M = e.lencode[mt + ((d & (1 << D + it) - 1) >> D)], S = M >>> 24, V = M >>> 16 & 255, G = M & 65535, !(D + S <= m); ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
d >>>= D, m -= D, e.back += D;
}
if (d >>>= S, m -= S, e.back += S, e.length = G, V === 0) {
e.mode = hu;
break;
}
if (V & 32) {
e.back = -1, e.mode = jn;
break;
}
if (V & 64) {
r.msg = "invalid literal/length code", e.mode = Oe;
break;
}
e.extra = V & 15, e.mode = ou;
/* falls through */
case ou:
if (e.extra) {
for (N = e.extra; m < N; ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
e.length += d & (1 << e.extra) - 1, d >>>= e.extra, m -= e.extra, e.back += e.extra;
}
e.was = e.length, e.mode = lu;
/* falls through */
case lu:
for (; M = e.distcode[d & (1 << e.distbits) - 1], S = M >>> 24, V = M >>> 16 & 255, G = M & 65535, !(S <= m); ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
if ((V & 240) === 0) {
for (D = S, it = V, mt = G; M = e.distcode[mt + ((d & (1 << D + it) - 1) >> D)], S = M >>> 24, V = M >>> 16 & 255, G = M & 65535, !(D + S <= m); ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
d >>>= D, m -= D, e.back += D;
}
if (d >>>= S, m -= S, e.back += S, V & 64) {
r.msg = "invalid distance code", e.mode = Oe;
break;
}
e.offset = G, e.extra = V & 15, e.mode = uu;
/* falls through */
case uu:
if (e.extra) {
for (N = e.extra; m < N; ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
e.offset += d & (1 << e.extra) - 1, d >>>= e.extra, m -= e.extra, e.back += e.extra;
}
if (e.offset > e.dmax) {
r.msg = "invalid distance too far back", e.mode = Oe;
break;
}
e.mode = fu;
/* falls through */
case fu:
if (h === 0)
break t;
if (p = k - h, e.offset > p) {
if (p = e.offset - p, p > e.whave && e.sane) {
r.msg = "invalid distance too far back", e.mode = Oe;
break;
}
p > e.wnext ? (p -= e.wnext, j = e.wsize - p) : j = e.wnext - p, p > e.length && (p = e.length), O = e.window;
} else
O = o, j = c - e.offset, p = e.length;
p > h && (p = h), h -= p, e.length -= p;
do
o[c++] = O[j++];
while (--p);
e.length === 0 && (e.mode = _s);
break;
case hu:
if (h === 0)
break t;
o[c++] = e.length, h--, e.mode = _s;
break;
case wo:
if (e.wrap) {
for (; m < 32; ) {
if (l === 0)
break t;
l--, d |= i[a++] << m, m += 8;
}
if (k -= h, r.total_out += k, e.total += k, e.wrap & 4 && k && (r.adler = e.check = /*UPDATE_CHECK(state.check, put - _out, _out);*/
e.flags ? hn(e.check, o, k, c - k) : Do(e.check, o, k, c - k)), k = h, e.wrap & 4 && (e.flags ? d : pu(d)) !== e.check) {
r.msg = "incorrect data check", e.mode = Oe;
break;
}
d = 0, m = 0;
}
e.mode = cu;
/* falls through */
case cu:
if (e.wrap && e.flags) {
for (; m < 32; ) {
if (l === 0)
break t;
l--, d += i[a++] << m, m += 8;
}
if (e.wrap & 4 && d !== (e.total & 4294967295)) {
r.msg = "incorrect length check", e.mode = Oe;
break;
}
d = 0, m = 0;
}
e.mode = du;
/* falls through */
case du:
K = yc;
break t;
case Oe:
K = lf;
break t;
case ff:
return uf;
case hf:
/* falls through */
default:
return zr;
}
return r.next_out = c, r.avail_out = h, r.next_in = a, r.avail_in = l, e.hold = d, e.bits = m, (e.wsize || k !== r.avail_out && e.mode < Oe && (e.mode < wo || t !== Vl)) && mf(r, r.output, r.next_out, k - r.avail_out), _ -= r.avail_in, k -= r.avail_out, r.total_in += _, r.total_out += k, e.total += k, e.wrap & 4 && k && (r.adler = e.check = /*UPDATE_CHECK(state.check, strm.next_out - _out, _out);*/
e.flags ? hn(e.check, o, k, r.next_out - k) : Do(e.check, o, k, r.next_out - k)), r.data_type = e.bits + (e.last ? 64 : 0) + (e.mode === jn ? 128 : 0) + (e.mode === xs || e.mode === bo ? 256 : 0), (_ === 0 && k === 0 || t === Vl) && K === Ii && (K = _c), K;
}, Fc = (r) => {
if (Ci(r))
return zr;
let t = r.state;
return t.window && (t.window = null), r.state = null, Ii;
}, Ec = (r, t) => {
if (Ci(r))
return zr;
const e = r.state;
return (e.wrap & 2) === 0 ? zr : (e.head = t, t.done = !1, Ii);
}, Oc = (r, t) => {
const e = t.length;
let i, o, a;
return Ci(r) || (i = r.state, i.wrap !== 0 && i.mode !== Fs) ? zr : i.mode === Fs && (o = 1, o = Do(o, t, e, 0), o !== i.check) ? lf : (a = mf(r, t, e, e), a ? (i.mode = ff, uf) : (i.havedict = 1, Ii));
};
var jc = df, Bc = pf, Mc = cf, Rc = Pc, Tc = gf, Dc = Cc, qc = Fc, Uc = Ec, zc = Oc, Hc = "pako inflate (from Nodeca project)", Bn = {
inflateReset: jc,
inflateReset2: Bc,
inflateResetKeep: Mc,
inflateInit: Rc,
inflateInit2: Tc,
inflate: Dc,
inflateEnd: qc,
inflateGetHeader: Uc,
inflateSetDictionary: zc,
inflateInfo: Hc
};
function Wc() {
this.text = 0, this.time = 0, this.xflags = 0, this.os = 0, this.extra = null, this.extra_len = 0, this.name = "", this.comment = "", this.hcrc = 0, this.done = !1;
}
var Vc = Wc;
const vf = Object.prototype.toString, {
Z_NO_FLUSH: Gc,
Z_FINISH: Yc,
Z_OK: ja,
Z_STREAM_END: _o,
Z_NEED_DICT: Ao,
Z_STREAM_ERROR: Jc,
Z_DATA_ERROR: mu,
Z_MEM_ERROR: Kc
} = rf;
function Ma(r) {
this.options = nf.assign({
chunkSize: 1024 * 64,
windowBits: 15,
to: ""
}, r || {});
const t = this.options;
t.raw && t.windowBits >= 0 && t.windowBits < 16 && (t.windowBits = -t.windowBits, t.windowBits === 0 && (t.windowBits = -15)), t.windowBits >= 0 && t.windowBits < 16 && !(r && r.windowBits) && (t.windowBits += 32), t.windowBits > 15 && t.windowBits < 48 && (t.windowBits & 15) === 0 && (t.windowBits |= 15), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new fc(), this.strm.avail_out = 0;
let e = Bn.inflateInit2(
this.strm,
t.windowBits
);
if (e !== ja)
throw new Error(qo[e]);
if (this.header = new Vc(), Bn.inflateGetHeader(this.strm, this.header), t.dictionary && (typeof t.dictionary == "string" ? t.dictionary = Uo.string2buf(t.dictionary) : vf.call(t.dictionary) === "[object ArrayBuffer]" && (t.dictionary = new Uint8Array(t.dictionary)), t.raw && (e = Bn.inflateSetDictionary(this.strm, t.dictionary), e !== ja)))
throw new Error(qo[e]);
}
Ma.prototype.push = function(r, t) {
const e = this.strm, i = this.options.chunkSize, o = this.options.dictionary;
let a, c, l;
if (this.ended) return !1;
for (t === ~~t ? c = t : c = t === !0 ? Yc : Gc, vf.call(r) === "[object ArrayBuffer]" ? e.input = new Uint8Array(r) : e.input = r, e.next_in = 0, e.avail_in = e.input.length; ; ) {
for (e.avail_out === 0 && (e.output = new Uint8Array(i), e.next_out = 0, e.avail_out = i), a = Bn.inflate(e, c), a === Ao && o && (a = Bn.inflateSetDictionary(e, o), a === ja ? a = Bn.inflate(e, c) : a === mu && (a = Ao)); e.avail_in > 0 && a === _o && e.state.wrap > 0 && r[e.next_in] !== 0; )
Bn.inflateReset(e), a = Bn.inflate(e, c);
switch (a) {
case Jc:
case mu:
case Ao:
case Kc:
return this.onEnd(a), this.ended = !0, !1;
}
if (l = e.avail_out, e.next_out && (e.avail_out === 0 || a === _o))
if (this.options.to === "string") {
let h = Uo.utf8border(e.output, e.next_out), d = e.next_out - h, m = Uo.buf2string(e.output, h);
e.next_out = d, e.avail_out = i - d, d && e.output.set(e.output.subarray(h, h + d), 0), this.onData(m);
} else
this.onData(e.output.length === e.next_out ? e.output : e.output.subarray(0, e.next_out));
if (!(a === ja && l === 0)) {
if (a === _o)
return a = Bn.inflateEnd(this.strm), this.onEnd(a), this.ended = !0, !0;
if (e.avail_in === 0) break;
}
}
return !0;
};
Ma.prototype.onData = function(r) {
this.chunks.push(r);
};
Ma.prototype.onEnd = function(r) {
r === ja && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = nf.flattenChunks(this.chunks)), this.chunks = [], this.err = r, this.msg = this.strm.msg;
};
function Xc(r, t) {
const e = new Ma(t);
if (e.push(r), e.err) throw e.msg || qo[e.err];
return e.result;
}
var $c = Ma, Zc = Xc, Qc = {
Inflate: $c,
inflate: Zc
};
const { Inflate: t1, inflate: e1 } = Qc;
var vu = t1, r1 = e1;
const bf = [];
for (let r = 0; r < 256; r++) {
let t = r;
for (let e = 0; e < 8; e++)
t & 1 ? t = 3988292384 ^ t >>> 1 : t = t >>> 1;
bf[r] = t;
}
const bu = 4294967295;
function n1(r, t, e) {
let i = r;
for (let o = 0; o < e; o++)
i = bf[(i ^ t[o]) & 255] ^ i >>> 8;
return i;
}
function i1(r, t) {
return (n1(bu, r, t) ^ bu) >>> 0;
}
function wu(r, t, e) {
const i = r.readUint32(), o = i1(new Uint8Array(r.buffer, r.byteOffset + r.offset - t - 4, t), t);
if (o !== i)
throw new Error(`CRC mismatch for chunk ${e}. Expected ${i}, found ${o}`);
}
function wf(r, t, e) {
for (let i = 0; i < e; i++)
t[i] = r[i];
}
function yf(r, t, e, i) {
let o = 0;
for (; o < i; o++)
t[o] = r[o];
for (; o < e; o++)
t[o] = r[o] + t[o - i] & 255;
}
function xf(r, t, e, i) {
let o = 0;
if (e.length === 0)
for (; o < i; o++)
t[o] = r[o];
else
for (; o < i; o++)
t[o] = r[o] + e[o] & 255;
}
function _f(r, t, e, i, o) {
let a = 0;
if (e.length === 0) {
for (; a < o; a++)
t[a] = r[a];
for (; a < i; a++)
t[a] = r[a] + (t[a - o] >> 1) & 255;
} else {
for (; a < o; a++)
t[a] = r[a] + (e[a] >> 1) & 255;
for (; a < i; a++)
t[a] = r[a] + (t[a - o] + e[a] >> 1) & 255;
}
}
function Af(r, t, e, i, o) {
let a = 0;
if (e.length === 0) {
for (; a < o; a++)
t[a] = r[a];
for (; a < i; a++)
t[a] = r[a] + t[a - o] & 255;
} else {
for (; a < o; a++)
t[a] = r[a] + e[a] & 255;
for (; a < i; a++)
t[a] = r[a] + a1(t[a - o], e[a], e[a - o]) & 255;
}
}
function a1(r, t, e) {
const i = r + t - e, o = Math.abs(i - r), a = Math.abs(i - t), c = Math.abs(i - e);
return o <= a && o <= c ? r : a <= c ? t : e;
}
function s1(r, t, e, i, o, a) {
switch (r) {
case 0:
wf(t, e, o);
break;
case 1:
yf(t, e, o, a);
break;
case 2:
xf(t, e, i, o);
break;
case 3:
_f(t, e, i, o, a);
break;
case 4:
Af(t, e, i, o, a);
break;
default:
throw new Error(`Unsupported filter: ${r}`);
}
}
const o1 = new Uint16Array([255]), l1 = new Uint8Array(o1.buffer), u1 = l1[0] === 255;
function f1(r) {
const { data: t, width: e, height: i, channels: o, depth: a } = r, c = [
{ x: 0, y: 0, xStep: 8, yStep: 8 },
// Pass 1
{ x: 4, y: 0, xStep: 8, yStep: 8 },
// Pass 2
{ x: 0, y: 4, xStep: 4, yStep: 8 },
// Pass 3
{ x: 2, y: 0, xStep: 4, yStep: 4 },
// Pass 4
{ x: 0, y: 2, xStep: 2, yStep: 4 },
// Pass 5
{ x: 1, y: 0, xStep: 2, yStep: 2 },
// Pass 6
{ x: 0, y: 1, xStep: 1, yStep: 2 }
// Pass 7
], l = Math.ceil(a / 8) * o, h = new Uint8Array(i * e * l);
let d = 0;
for (let m = 0; m < 7; m++) {
const _ = c[m], k = Math.ceil((e - _.x) / _.xStep), p = Math.ceil((i - _.y) / _.yStep);
if (k <= 0 || p <= 0)
continue;
const j = k * l, O = new Uint8Array(j);
for (let M = 0; M < p; M++) {
const S = t[d++], V = t.subarray(d, d + j);
d += j;
const G = new Uint8Array(j);
s1(S, V, G, O, j, l), O.set(G);
for (let D = 0; D < k; D++) {
const it = _.x + D * _.xStep, mt = _.y + M * _.yStep;
if (!(it >= e || mt >= i))
for (let ct = 0; ct < l; ct++)
h[(mt * e + it) * l + ct] = G[D * l + ct];
}
}
}
if (a === 16) {
const m = new Uint16Array(h.buffer);
if (u1)
for (let _ = 0; _ < m.length; _++)
m[_] = h1(m[_]);
return m;
} else
return h;
}
function h1(r) {
return (r & 255) << 8 | r >> 8 & 255;
}
const c1 = new Uint16Array([255]), d1 = new Uint8Array(c1.buffer), p1 = d1[0] === 255, g1 = new Uint8Array(0);
function yu(r) {
const { data: t, width: e, height: i, channels: o, depth: a } = r, c = Math.ceil(a / 8) * o, l = Math.ceil(a / 8 * o * e), h = new Uint8Array(i * l);
let d = g1, m = 0, _, k;
for (let p = 0; p < i; p++) {
switch (_ = t.subarray(m + 1, m + 1 + l), k = h.subarray(p * l, (p + 1) * l), t[m]) {
case 0:
wf(_, k, l);
break;
case 1:
yf(_, k, l, c);
break;
case 2:
xf(_, k, d, l);
break;
case 3:
_f(_, k, d, l, c);
break;
case 4:
Af(_, k, d, l, c);
break;
default:
throw new Error(`Unsupported filter: ${t[m]}`);
}
d = k, m += l + 1;
}
if (a === 16) {
const p = new Uint16Array(h.buffer);
if (p1)
for (let j = 0; j < p.length; j++)
p[j] = m1(p[j]);
return p;
} else
return h;
}
function m1(r) {
return (r & 255) << 8 | r >> 8 & 255;
}
const Ps = Uint8Array.of(137, 80, 78, 71, 13, 10, 26, 10);
function xu(r) {
if (!v1(r.readBytes(Ps.length)))
throw new Error("wrong PNG signature");
}
function v1(r) {
if (r.length < Ps.length)
return !1;
for (let t = 0; t < Ps.length; t++)
if (r[t] !== Ps[t])
return !1;
return !0;
}
const b1 = "tEXt", w1 = 0, Nf = new TextDecoder("latin1");
function y1(r) {
if (_1(r), r.length === 0 || r.length > 79)
throw new Error("keyword length must be between 1 and 79");
}
const x1 = /^[\u0000-\u00FF]*$/;
function _1(r) {
if (!x1.test(r))
throw new Error("invalid latin1 text");
}
function A1(r, t, e) {
const i = Lf(t);
r[i] = N1(t, e - i.length - 1);
}
function Lf(r) {
for (r.mark(); r.readByte() !== w1; )
;
const t = r.offset;
r.reset();
const e = Nf.decode(r.readBytes(t - r.offset - 1));
return r.skip(1), y1(e), e;
}
function N1(r, t) {
return Nf.decode(r.readBytes(t));
}
const Fr = {
UNKNOWN: -1,
GREYSCALE: 0,
TRUECOLOUR: 2,
INDEXED_COLOUR: 3,
GREYSCALE_ALPHA: 4,
TRUECOLOUR_ALPHA: 6
}, No = {
UNKNOWN: -1,
DEFLATE: 0
}, _u = {
UNKNOWN: -1,
ADAPTIVE: 0
}, Lo = {
UNKNOWN: -1,
NO_INTERLACE: 0,
ADAM7: 1
}, As = {
NONE: 0,
BACKGROUND: 1,
PREVIOUS: 2
}, So = {
SOURCE: 0,
OVER: 1
};
class L1 extends Ko {
_checkCrc;
_inflator;
_png;
_apng;
_end;
_hasPalette;
_palette;
_hasTransparency;
_transparency;
_compressionMethod;
_filterMethod;
_interlaceMethod;
_colorType;
_isAnimated;
_numberOfFrames;
_numberOfPlays;
_frames;
_writingDataChunks;
constructor(t, e = {}) {
super(t);
const { checkCrc: i = !1 } = e;
this._checkCrc = i, this._inflator = new vu(), this._png = {
width: -1,
height: -1,
channels: -1,
data: new Uint8Array(0),
depth: 1,
text: {}
}, this._apng = {
width: -1,
height: -1,
channels: -1,
depth: 1,
numberOfFrames: 1,
numberOfPlays: 0,
text: {},
frames: []
}, this._end = !1, this._hasPalette = !1, this._palette = [], this._hasTransparency = !1, this._transparency = new Uint16Array(0), this._compressionMethod = No.UNKNOWN, this._filterMethod = _u.UNKNOWN, this._interlaceMethod = Lo.UNKNOWN, this._colorType = Fr.UNKNOWN, this._isAnimated = !1, this._numberOfFrames = 1, this._numberOfPlays = 0, this._frames = [], this._writingDataChunks = !1, this.setBigEndian();
}
decode() {
for (xu(this); !this._end; ) {
const t = this.readUint32(), e = this.readChars(4);
this.decodeChunk(t, e);
}
return this.decodeImage(), this._png;
}
decodeApng() {
for (xu(this); !this._end; ) {
const t = this.readUint32(), e = this.readChars(4);
this.decodeApngChunk(t, e);
}
return this.decodeApngImage(), this._apng;
}
// https://www.w3.org/TR/PNG/#5Chunk-layout
decodeChunk(t, e) {
const i = this.offset;
switch (e) {
// 11.2 Critical chunks
case "IHDR":
this.decodeIHDR();
break;
case "PLTE":
this.decodePLTE(t);
break;
case "IDAT":
this.decodeIDAT(t);
break;
case "IEND":
this._end = !0;
break;
// 11.3 Ancillary chunks
case "tRNS":
this.decodetRNS(t);
break;
case "iCCP":
this.decodeiCCP(t);
break;
case b1:
A1(this._png.text, this, t);
break;
case "pHYs":
this.decodepHYs();
break;
default:
this.skip(t);
break;
}
if (this.offset - i !== t)
throw new Error(`Length mismatch while decoding chunk ${e}`);
this._checkCrc ? wu(this, t + 4, e) : this.skip(4);
}
decodeApngChunk(t, e) {
const i = this.offset;
switch (e !== "fdAT" && e !== "IDAT" && this._writingDataChunks && this.pushDataToFrame(), e) {
case "acTL":
this.decodeACTL();
break;
case "fcTL":
this.decodeFCTL();
break;
case "fdAT":
this.decodeFDAT(t);
break;
default:
this.decodeChunk(t, e), this.offset = i + t;
break;
}
if (this.offset - i !== t)
throw new Error(`Length mismatch while decoding chunk ${e}`);
this._checkCrc ? wu(this, t + 4, e) : this.skip(4);
}
// https://www.w3.org/TR/PNG/#11IHDR
decodeIHDR() {
const t = this._png;
t.width = this.readUint32(), t.height = this.readUint32(), t.depth = S1(this.readUint8());
const e = this.readUint8();
this._colorType = e;
let i;
switch (e) {
case Fr.GREYSCALE:
i = 1;
break;
case Fr.TRUECOLOUR:
i = 3;
break;
case Fr.INDEXED_COLOUR:
i = 1;
break;
case Fr.GREYSCALE_ALPHA:
i = 2;
break;
case Fr.TRUECOLOUR_ALPHA:
i = 4;
break;
// Kept for exhaustiveness.
// eslint-disable-next-line unicorn/no-useless-switch-case
case Fr.UNKNOWN:
default:
throw new Error(`Unknown color type: ${e}`);
}
if (this._png.channels = i, this._compressionMethod = this.readUint8(), this._compressionMethod !== No.DEFLATE)
throw new Error(`Unsupported compression method: ${this._compressionMethod}`);
this._filterMethod = this.readUint8(), this._interlaceMethod = this.readUint8();
}
decodeACTL() {
this._numberOfFrames = this.readUint32(), this._numberOfPlays = this.readUint32(), this._isAnimated = !0;
}
decodeFCTL() {
const t = {
sequenceNumber: this.readUint32(),
width: this.readUint32(),
height: this.readUint32(),
xOffset: this.readUint32(),
yOffset: this.readUint32(),
delayNumber: this.readUint16(),
delayDenominator: this.readUint16(),
disposeOp: this.readUint8(),
blendOp: this.readUint8(),
data: new Uint8Array(0)
};
this._frames.push(t);
}
// https://www.w3.org/TR/PNG/#11PLTE
decodePLTE(t) {
if (t % 3 !== 0)
throw new RangeError(`PLTE field length must be a multiple of 3. Got ${t}`);
const e = t / 3;
this._hasPalette = !0;
const i = [];
this._palette = i;
for (let o = 0; o < e; o++)
i.push([this.readUint8(), this.readUint8(), this.readUint8()]);
}
// https://www.w3.org/TR/PNG/#11IDAT
decodeIDAT(t) {
this._writingDataChunks = !0;
const e = t, i = this.offset + this.byteOffset;
if (this._inflator.push(new Uint8Array(this.buffer, i, e)), this._inflator.err)
throw new Error(`Error while decompressing the data: ${this._inflator.err}`);
this.skip(t);
}
decodeFDAT(t) {
this._writingDataChunks = !0;
let e = t, i = this.offset + this.byteOffset;
if (i += 4, e -= 4, this._inflator.push(new Uint8Array(this.buffer, i, e)), this._inflator.err)
throw new Error(`Error while decompressing the data: ${this._inflator.err}`);
this.skip(t);
}
// https://www.w3.org/TR/PNG/#11tRNS
decodetRNS(t) {
switch (this._colorType) {
case Fr.GREYSCALE:
case Fr.TRUECOLOUR: {
if (t % 2 !== 0)
throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${t}`);
if (t / 2 > this._png.width * this._png.height)
throw new Error(`tRNS chunk contains more alpha values than there are pixels (${t / 2} vs ${this._png.width * this._png.height})`);
this._hasTransparency = !0, this._transparency = new Uint16Array(t / 2);
for (let e = 0; e < t / 2; e++)
this._transparency[e] = this.readUint16();
break;
}
case Fr.INDEXED_COLOUR: {
if (t > this._palette.length)
throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${t} vs ${this._palette.length})`);
let e = 0;
for (; e < t; e++) {
const i = this.readByte();
this._palette[e].push(i);
}
for (; e < this._palette.length; e++)
this._palette[e].push(255);
break;
}
// Kept for exhaustiveness.
/* eslint-disable unicorn/no-useless-switch-case */
case Fr.UNKNOWN:
case Fr.GREYSCALE_ALPHA:
case Fr.TRUECOLOUR_ALPHA:
default:
throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`);
}
}
// https://www.w3.org/TR/PNG/#11iCCP
decodeiCCP(t) {
const e = Lf(this), i = this.readUint8();
if (i !== No.DEFLATE)
throw new Error(`Unsupported iCCP compression method: ${i}`);
const o = this.readBytes(t - e.length - 2);
this._png.iccEmbeddedProfile = {
name: e,
profile: r1(o)
};
}
// https://www.w3.org/TR/PNG/#11pHYs
decodepHYs() {
const t = this.readUint32(), e = this.readUint32(), i = this.readByte();
this._png.resolution = { x: t, y: e, unit: i };
}
decodeApngImage() {
this._apng.width = this._png.width, this._apng.height = this._png.height, this._apng.channels = this._png.channels, this._apng.depth = this._png.depth, this._apng.numberOfFrames = this._numberOfFrames, this._apng.numberOfPlays = this._numberOfPlays, this._apng.text = this._png.text, this._apng.resolution = this._png.resolution;
for (let t = 0; t < this._numberOfFrames; t++) {
const e = {
sequenceNumber: this._frames[t].sequenceNumber,
delayNumber: this._frames[t].delayNumber,
delayDenominator: this._frames[t].delayDenominator,
data: this._apng.depth === 8 ? new Uint8Array(this._apng.width * this._apng.height * this._apng.channels) : new Uint16Array(this._apng.width * this._apng.height * this._apng.channels)
}, i = this._frames.at(t);
if (i) {
if (i.data = yu({
data: i.data,
width: i.width,
height: i.height,
channels: this._apng.channels,
depth: this._apng.depth
}), this._hasPalette && (this._apng.palette = this._palette), this._hasTransparency && (this._apng.transparency = this._transparency), t === 0 || i.xOffset === 0 && i.yOffset === 0 && i.width === this._png.width && i.height === this._png.height)
e.data = i.data;
else {
const o = this._apng.frames.at(t - 1);
this.disposeFrame(i, o, e), this.addFrameDataToCanvas(e, i);
}
this._apng.frames.push(e);
}
}
return this._apng;
}
disposeFrame(t, e, i) {
switch (t.disposeOp) {
case As.NONE:
break;
case As.BACKGROUND:
for (let o = 0; o < this._png.height; o++)
for (let a = 0; a < this._png.width; a++) {
const c = (o * t.width + a) * this._png.channels;
for (let l = 0; l < this._png.channels; l++)
i.data[c + l] = 0;
}
break;
case As.PREVIOUS:
i.data.set(e.data);
break;
default:
throw new Error("Unknown disposeOp");
}
}
addFrameDataToCanvas(t, e) {
const i = 1 << this._png.depth, o = (a, c) => {
const l = ((a + e.yOffset) * this._png.width + e.xOffset + c) * this._png.channels, h = (a * e.width + c) * this._png.channels;
return { index: l, frameIndex: h };
};
switch (e.blendOp) {
case So.SOURCE:
for (let a = 0; a < e.height; a++)
for (let c = 0; c < e.width; c++) {
const { index: l, frameIndex: h } = o(a, c);
for (let d = 0; d < this._png.channels; d++)
t.data[l + d] = e.data[h + d];
}
break;
// https://www.w3.org/TR/png-3/#13Alpha-channel-processing
case So.OVER:
for (let a = 0; a < e.height; a++)
for (let c = 0; c < e.width; c++) {
const { index: l, frameIndex: h } = o(a, c);
for (let d = 0; d < this._png.channels; d++) {
const m = e.data[h + this._png.channels - 1] / i, _ = d % (this._png.channels - 1) === 0 ? 1 : e.data[h + d], k = Math.floor(m * _ + (1 - m) * t.data[l + d]);
t.data[l + d] += k;
}
}
break;
default:
throw new Error("Unknown blendOp");
}
}
decodeImage() {
if (this._inflator.err)
throw new Error(`Error while decompressing the data: ${this._inflator.err}`);
const t = this._isAnimated ? (this._frames?.at(0)).data : this._inflator.result;
if (this._filterMethod !== _u.ADAPTIVE)
throw new Error(`Filter method ${this._filterMethod} not supported`);
if (this._interlaceMethod === Lo.NO_INTERLACE)
this._png.data = yu({
data: t,
width: this._png.width,
height: this._png.height,
channels: this._png.channels,
depth: this._png.depth
});
else if (this._interlaceMethod === Lo.ADAM7)
this._png.data = f1({
data: t,
width: this._png.width,
height: this._png.height,
channels: this._png.channels,
depth: this._png.depth
});
else
throw new Error(`Interlace method ${this._interlaceMethod} not supported`);
this._hasPalette && (this._png.palette = this._palette), this._hasTransparency && (this._png.transparency = this._transparency);
}
pushDataToFrame() {
const t = this._inflator.result, e = this._frames.at(-1);
e ? e.data = t : this._frames.push({
sequenceNumber: 0,
width: this._png.width,
height: this._png.height,
xOffset: 0,
yOffset: 0,
delayNumber: 0,
delayDenominator: 0,
disposeOp: As.NONE,
blendOp: So.SOURCE,
data: t
}), this._inflator = new vu(), this._writingDataChunks = !1;
}
}
function S1(r) {
if (r !== 1 && r !== 2 && r !== 4 && r !== 8 && r !== 16)
throw new Error(`invalid bit depth: ${r}`);
return r;
}
function k1(r, t) {
return new L1(r, t).decode();
}
var Jt = /* @__PURE__ */ (function() {
return typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : this;
})();
function ko() {
Jt.console && typeof Jt.console.log == "function" && Jt.console.log.apply(Jt.console, arguments);
}
var Le = { log: ko, warn: function(r) {
Jt.console && (typeof Jt.console.warn == "function" ? Jt.console.warn.apply(Jt.console, arguments) : ko.call(null, arguments));
}, error: function(r) {
Jt.console && (typeof Jt.console.error == "function" ? Jt.console.error.apply(Jt.console, arguments) : ko(r));
} };
function Po(r, t, e) {
var i = new XMLHttpRequest();
i.open("GET", r), i.responseType = "blob", i.onload = function() {
_i(i.response, t, e);
}, i.onerror = function() {
Le.error("could not download file");
}, i.send();
}
function Au(r) {
var t = new XMLHttpRequest();
t.open("HEAD", r, !1);
try {
t.send();
} catch {
}
return t.status >= 200 && t.status <= 299;
}
function Ns(r) {
try {
r.dispatchEvent(new MouseEvent("click"));
} catch {
var t = document.createEvent("MouseEvents");
t.initMouseEvent("click", !0, !0, window, 0, 0, 0, 80, 20, !1, !1, !1, !1, 0, null), r.dispatchEvent(t);
}
}
var _i = Jt.saveAs || ((typeof window > "u" ? "undefined" : _e(window)) !== "object" || window !== Jt ? function() {
} : typeof HTMLAnchorElement < "u" && "download" in HTMLAnchorElement.prototype ? function(r, t, e) {
var i = Jt.URL || Jt.webkitURL, o = document.createElement("a");
t = t || r.name || "download", o.download = t, o.rel = "noopener", typeof r == "string" ? (o.href = r, o.origin !== location.origin ? Au(o.href) ? Po(r, t, e) : Ns(o, o.target = "_blank") : Ns(o)) : (o.href = i.createObjectURL(r), setTimeout(function() {
i.revokeObjectURL(o.href);
}, 4e4), setTimeout(function() {
Ns(o);
}, 0));
} : "msSaveOrOpenBlob" in navigator ? function(r, t, e) {
if (t = t || r.name || "download", typeof r == "string") if (Au(r)) Po(r, t, e);
else {
var i = document.createElement("a");
i.href = r, i.target = "_blank", setTimeout(function() {
Ns(i);
});
}
else navigator.msSaveOrOpenBlob((function(o, a) {
return a === void 0 ? a = { autoBom: !1 } : _e(a) !== "object" && (Le.warn("Deprecated: Expected third argument to be a object"), a = { autoBom: !a }), a.autoBom && /^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(o.type) ? new Blob(["\uFEFF", o], { type: o.type }) : o;
})(r, e), t);
} : function(r, t, e, i) {
if ((i = i || open("", "_blank")) && (i.document.title = i.document.body.innerText = "downloading..."), typeof r == "string") return Po(r, t, e);
var o = r.type === "application/octet-stream", a = /constructor/i.test(Jt.HTMLElement) || Jt.safari, c = /CriOS\/[\d]+/.test(navigator.userAgent);
if ((c || o && a) && (typeof FileReader > "u" ? "undefined" : _e(FileReader)) === "object") {
var l = new FileReader();
l.onloadend = function() {
var m = l.result;
m = c ? m : m.replace(/^data:[^;]*;/, "data:attachment/file;"), i ? i.location.href = m : location = m, i = null;
}, l.readAsDataURL(r);
} else {
var h = Jt.URL || Jt.webkitURL, d = h.createObjectURL(r);
i ? i.location = d : location.href = d, i = null, setTimeout(function() {
h.revokeObjectURL(d);
}, 4e4);
}
});
function Sf(r) {
var t;
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 e = [{ re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/, example: ["rgb(123, 234, 45)", "rgb(255,234,245)"], process: function(l) {
return [parseInt(l[1]), parseInt(l[2]), parseInt(l[3])];
} }, { re: /^(\w{2})(\w{2})(\w{2})$/, example: ["#00ff00", "336699"], process: function(l) {
return [parseInt(l[1], 16), parseInt(l[2], 16), parseInt(l[3], 16)];
} }, { re: /^(\w{1})(\w{1})(\w{1})$/, example: ["#fb0", "f0f"], process: function(l) {
return [parseInt(l[1] + l[1], 16), parseInt(l[2] + l[2], 16), parseInt(l[3] + l[3], 16)];
} }], i = 0; i < e.length; i++) {
var o = e[i].re, a = e[i].process, c = o.exec(r);
c && (t = a(c), this.r = t[0], this.g = t[1], this.b = t[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 l = this.r.toString(16), h = this.g.toString(16), d = this.b.toString(16);
return l.length == 1 && (l = "0" + l), h.length == 1 && (h = "0" + h), d.length == 1 && (d = "0" + d), "#" + l + h + d;
};
}
var Is = Jt.atob.bind(Jt), Nu = Jt.btoa.bind(Jt);
function Io(r, t) {
var e = r[0], i = r[1], o = r[2], a = r[3];
e = cr(e, i, o, a, t[0], 7, -680876936), a = cr(a, e, i, o, t[1], 12, -389564586), o = cr(o, a, e, i, t[2], 17, 606105819), i = cr(i, o, a, e, t[3], 22, -1044525330), e = cr(e, i, o, a, t[4], 7, -176418897), a = cr(a, e, i, o, t[5], 12, 1200080426), o = cr(o, a, e, i, t[6], 17, -1473231341), i = cr(i, o, a, e, t[7], 22, -45705983), e = cr(e, i, o, a, t[8], 7, 1770035416), a = cr(a, e, i, o, t[9], 12, -1958414417), o = cr(o, a, e, i, t[10], 17, -42063), i = cr(i, o, a, e, t[11], 22, -1990404162), e = cr(e, i, o, a, t[12], 7, 1804603682), a = cr(a, e, i, o, t[13], 12, -40341101), o = cr(o, a, e, i, t[14], 17, -1502002290), e = dr(e, i = cr(i, o, a, e, t[15], 22, 1236535329), o, a, t[1], 5, -165796510), a = dr(a, e, i, o, t[6], 9, -1069501632), o = dr(o, a, e, i, t[11], 14, 643717713), i = dr(i, o, a, e, t[0], 20, -373897302), e = dr(e, i, o, a, t[5], 5, -701558691), a = dr(a, e, i, o, t[10], 9, 38016083), o = dr(o, a, e, i, t[15], 14, -660478335), i = dr(i, o, a, e, t[4], 20, -405537848), e = dr(e, i, o, a, t[9], 5, 568446438), a = dr(a, e, i, o, t[14], 9, -1019803690), o = dr(o, a, e, i, t[3], 14, -187363961), i = dr(i, o, a, e, t[8], 20, 1163531501), e = dr(e, i, o, a, t[13], 5, -1444681467), a = dr(a, e, i, o, t[2], 9, -51403784), o = dr(o, a, e, i, t[7], 14, 1735328473), e = pr(e, i = dr(i, o, a, e, t[12], 20, -1926607734), o, a, t[5], 4, -378558), a = pr(a, e, i, o, t[8], 11, -2022574463), o = pr(o, a, e, i, t[11], 16, 1839030562), i = pr(i, o, a, e, t[14], 23, -35309556), e = pr(e, i, o, a, t[1], 4, -1530992060), a = pr(a, e, i, o, t[4], 11, 1272893353), o = pr(o, a, e, i, t[7], 16, -155497632), i = pr(i, o, a, e, t[10], 23, -1094730640), e = pr(e, i, o, a, t[13], 4, 681279174), a = pr(a, e, i, o, t[0], 11, -358537222), o = pr(o, a, e, i, t[3], 16, -722521979), i = pr(i, o, a, e, t[6], 23, 76029189), e = pr(e, i, o, a, t[9], 4, -640364487), a = pr(a, e, i, o, t[12], 11, -421815835), o = pr(o, a, e, i, t[15], 16, 530742520), e = gr(e, i = pr(i, o, a, e, t[2], 23, -995338651), o, a, t[0], 6, -198630844), a = gr(a, e, i, o, t[7], 10, 1126891415), o = gr(o, a, e, i, t[14], 15, -1416354905), i = gr(i, o, a, e, t[5], 21, -57434055), e = gr(e, i, o, a, t[12], 6, 1700485571), a = gr(a, e, i, o, t[3], 10, -1894986606), o = gr(o, a, e, i, t[10], 15, -1051523), i = gr(i, o, a, e, t[1], 21, -2054922799), e = gr(e, i, o, a, t[8], 6, 1873313359), a = gr(a, e, i, o, t[15], 10, -30611744), o = gr(o, a, e, i, t[6], 15, -1560198380), i = gr(i, o, a, e, t[13], 21, 1309151649), e = gr(e, i, o, a, t[4], 6, -145523070), a = gr(a, e, i, o, t[11], 10, -1120210379), o = gr(o, a, e, i, t[2], 15, 718787259), i = gr(i, o, a, e, t[9], 21, -343485551), r[0] = ei(e, r[0]), r[1] = ei(i, r[1]), r[2] = ei(o, r[2]), r[3] = ei(a, r[3]);
}
function js(r, t, e, i, o, a) {
return t = ei(ei(t, r), ei(i, a)), ei(t << o | t >>> 32 - o, e);
}
function cr(r, t, e, i, o, a, c) {
return js(t & e | ~t & i, r, t, o, a, c);
}
function dr(r, t, e, i, o, a, c) {
return js(t & i | e & ~i, r, t, o, a, c);
}
function pr(r, t, e, i, o, a, c) {
return js(t ^ e ^ i, r, t, o, a, c);
}
function gr(r, t, e, i, o, a, c) {
return js(e ^ (t | ~i), r, t, o, a, c);
}
function kf(r) {
var t, e = r.length, i = [1732584193, -271733879, -1732584194, 271733878];
for (t = 64; t <= r.length; t += 64) Io(i, P1(r.substring(t - 64, t)));
r = r.substring(t - 64);
var o = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
for (t = 0; t < r.length; t++) o[t >> 2] |= r.charCodeAt(t) << (t % 4 << 3);
if (o[t >> 2] |= 128 << (t % 4 << 3), t > 55) for (Io(i, o), t = 0; t < 16; t++) o[t] = 0;
return o[14] = 8 * e, Io(i, o), i;
}
function P1(r) {
var t, e = [];
for (t = 0; t < 64; t += 4) e[t >> 2] = r.charCodeAt(t) + (r.charCodeAt(t + 1) << 8) + (r.charCodeAt(t + 2) << 16) + (r.charCodeAt(t + 3) << 24);
return e;
}
var Lu = "0123456789abcdef".split("");
function I1(r) {
for (var t = "", e = 0; e < 4; e++) t += Lu[r >> 8 * e + 4 & 15] + Lu[r >> 8 * e & 15];
return t;
}
function C1(r) {
return String.fromCharCode(255 & r, (65280 & r) >> 8, (16711680 & r) >> 16, (4278190080 & r) >> 24);
}
function zo(r) {
return kf(r).map(C1).join("");
}
var F1 = (function(r) {
for (var t = 0; t < r.length; t++) r[t] = I1(r[t]);
return r.join("");
})(kf("hello")) != "5d41402abc4b2a76b9719d911017c592";
function ei(r, t) {
if (F1) {
var e = (65535 & r) + (65535 & t);
return (r >> 16) + (t >> 16) + (e >> 16) << 16 | 65535 & e;
}
return r + t & 4294967295;
}
function Ho(r, t) {
var e, i, o, a;
if (r !== e) {
for (var c = (o = r, a = 1 + (256 / r.length | 0), new Array(a + 1).join(o)), l = [], h = 0; h < 256; h++) l[h] = h;
var d = 0;
for (h = 0; h < 256; h++) {
var m = l[h];
d = (d + m + c.charCodeAt(h)) % 256, l[h] = l[d], l[d] = m;
}
e = r, i = l;
} else l = i;
var _ = t.length, k = 0, p = 0, j = "";
for (h = 0; h < _; h++) p = (p + (m = l[k = (k + 1) % 256])) % 256, l[k] = l[p], l[p] = m, c = l[(l[k] + l[p]) % 256], j += String.fromCharCode(t.charCodeAt(h) ^ c);
return j;
}
var Su = { print: 4, modify: 8, copy: 16, "annot-forms": 32 };
function Ji(r, t, e, i) {
this.v = 1, this.r = 2;
var o = 192;
r.forEach(function(l) {
if (Su.perm !== void 0) throw new Error("Invalid permission: " + l);
o += Su[l];
}), this.padding = "(¿N^NuAd\0NVÿú\b..\0¶Ðh>/\f©þdSiz";
var a = (t + this.padding).substr(0, 32), c = (e + this.padding).substr(0, 32);
this.O = this.processOwnerPassword(a, c), this.P = -(1 + (255 ^ o)), this.encryptionKey = zo(a + this.O + this.lsbFirstWord(this.P) + this.hexToBytes(i)).substr(0, 5), this.U = Ho(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 t = "", e = r.length, i = 0; i < e; i++) {
var o = r.charCodeAt(i);
t += o < 33 || o === 35 || o === 37 || o === 40 || o === 41 || o === 47 || o === 60 || o === 62 || o === 91 || o === 93 || o === 123 || o === 125 || o > 126 ? "#" + ("0" + o.toString(16)).slice(-2) : r[i];
}
return t;
}
function ku(r) {
if (_e(r) !== "object") throw new Error("Invalid Context passed to initialize PubSub (jsPDF-module)");
var t = {};
this.subscribe = function(e, i, o) {
if (o = o || !1, typeof e != "string" || typeof i != "function" || typeof o != "boolean") throw new Error("Invalid arguments passed to PubSub.subscribe (jsPDF-module)");
t.hasOwnProperty(e) || (t[e] = {});
var a = Math.random().toString(35);
return t[e][a] = [i, !!o], a;
}, this.unsubscribe = function(e) {
for (var i in t) if (t[i][e]) return delete t[i][e], Object.keys(t[i]).length === 0 && delete t[i], !0;
return !1;
}, this.publish = function(e) {
if (t.hasOwnProperty(e)) {
var i = Array.prototype.slice.call(arguments, 1), o = [];
for (var a in t[e]) {
var c = t[e][a];
try {
c[0].apply(r, i);
} catch (l) {
Jt.console && Le.error("jsPDF PubSub Error", l.message, l);
}
c[1] && o.push(a);
}
o.length && o.forEach(this.unsubscribe);
}
}, this.getTopics = function() {
return t;
};
}
function Ba(r) {
if (!(this instanceof Ba)) return new Ba(r);
var t = "opacity,stroke-opacity".split(",");
for (var e in r) r.hasOwnProperty(e) && t.indexOf(e) >= 0 && (this[e] = r[e]);
this.id = "", this.objectNumber = -1;
}
function Pf(r, t) {
this.gState = r, this.matrix = t, this.id = "", this.objectNumber = -1;
}
function ti(r, t, e, i, o) {
if (!(this instanceof ti)) return new ti(r, t, e, i, o);
this.type = r === "axial" ? 2 : 3, this.coords = t, this.colors = e, Pf.call(this, i, o);
}
function Ai(r, t, e, i, o) {
if (!(this instanceof Ai)) return new Ai(r, t, e, i, o);
this.boundingBox = r, this.xStep = t, this.yStep = e, this.stream = "", this.cloneIndex = 0, Pf.call(this, i, o);
}
function Mt(r) {
var t, e = typeof arguments[0] == "string" ? arguments[0] : "p", i = arguments[1], o = arguments[2], a = arguments[3], c = [], l = 1, h = 16, d = "S", m = null;
_e(r = r || {}) === "object" && (e = r.orientation, i = r.unit || i, o = r.format || o, a = r.compress || r.compressPdf || a, (m = r.encryption || null) !== null && (m.userPassword = m.userPassword || "", m.ownerPassword = m.ownerPassword || "", m.userPermissions = m.userPermissions || []), l = typeof r.userUnit == "number" ? Math.abs(r.userUnit) : 1, r.precision !== void 0 && (t = r.precision), r.floatPrecision !== void 0 && (h = r.floatPrecision), d = r.defaultPathOperation || "S"), c = r.filters || (a === !0 ? ["FlateEncode"] : c), i = i || "mm", e = ("" + (e || "P")).toLowerCase();
var _ = r.putOnlyUsedFonts || !1, k = {}, p = { internal: {}, __private__: {} };
p.__private__.PubSub = ku;
var j = "1.3", O = p.__private__.getPdfVersion = function() {
return j;
};
p.__private__.setPdfVersion = function(u) {
j = u;
};
var M = { 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 M;
};
var S = p.__private__.getPageFormat = function(u) {
return M[u];
};
o = o || "a4";
var V = "compat", G = "advanced", D = V;
function it() {
this.saveGraphicsState(), P(new Gt(ee, 0, 0, -ee, 0, ci() * ee).toString() + " cm"), this.setFontSize(this.getFontSize() / ee), d = "n", D = G;
}
function mt() {
this.restoreGraphicsState(), d = "S", D = V;
}
var ct = p.__private__.combineFontStyleAndFontWeight = function(u, v) {
if (u == "bold" && v == "normal" || u == "bold" && v == 400 || u == "normal" && v == "italic" || u == "bold" && v == "italic") throw new Error("Invalid Combination of fontweight and fontstyle");
return v && (u = v == 400 || v === "normal" ? u === "italic" ? "italic" : "normal" : v != 700 && v !== "bold" || u !== "normal" ? (v == 700 ? "bold" : v) + "" + u : "bold"), u;
};
p.advancedAPI = function(u) {
var v = D === V;
return v && it.call(this), typeof u != "function" || (u(this), v && mt.call(this)), this;
}, p.compatAPI = function(u) {
var v = D === G;
return v && mt.call(this), typeof u != "function" || (u(this), v && it.call(this)), this;
}, p.isAdvancedAPI = function() {
return D === G;
};
var K, R = function(u) {
if (D !== G) throw new Error(u + " is only available in 'advanced' API mode. You need to call advancedAPI() first.");
}, tt = p.roundToPrecision = p.__private__.roundToPrecision = function(u, v) {
var E = t || v;
if (isNaN(u) || isNaN(E)) throw new Error("Invalid argument passed to jsPDF.roundToPrecision");
return u.toFixed(E).replace(/0+$/, "");
};
K = p.hpf = p.__private__.hpf = typeof h == "number" ? function(u) {
if (isNaN(u)) throw new Error("Invalid argument passed to jsPDF.hpf");
return tt(u, h);
} : h === "smart" ? function(u) {
if (isNaN(u)) throw new Error("Invalid argument passed to jsPDF.hpf");
return tt(u, u > -1 && u < 1 ? 16 : 5);
} : function(u) {
if (isNaN(u)) throw new Error("Invalid argument passed to jsPDF.hpf");
return tt(u, 16);
};
var N = p.f2 = p.__private__.f2 = function(u) {
if (isNaN(u)) throw new Error("Invalid argument passed to jsPDF.f2");
return tt(u, 2);
}, F = p.__private__.f3 = function(u) {
if (isNaN(u)) throw new Error("Invalid argument passed to jsPDF.f3");
return tt(u, 3);
}, z = p.scale = p.__private__.scale = function(u) {
if (isNaN(u)) throw new Error("Invalid argument passed to jsPDF.scale");
return D === V ? u * ee : D === G ? u : void 0;
}, U = function(u) {
return z((function(v) {
return D === V ? ci() - v : D === G ? v : void 0;
})(u));
};
p.__private__.setPrecision = p.setPrecision = function(u) {
typeof parseInt(u, 10) == "number" && (t = parseInt(u, 10));
};
var nt, ot = "00000000000000000000000000000000", ut = p.__private__.getFileId = function() {
return ot;
}, rt = p.__private__.setFileId = function(u) {
return ot = u !== void 0 && /^[a-fA-F0-9]{32}$/.test(u) ? u.toUpperCase() : ot.split("").map(function() {
return "ABCDEF0123456789".charAt(Math.floor(16 * Math.random()));
}).join(""), m !== null && (Xe = new Ji(m.userPermissions, m.userPassword, m.ownerPassword, ot)), ot;
};
p.setFileId = function(u) {
return rt(u), this;
}, p.getFileId = function() {
return ut();
};
var ht = p.__private__.convertDateToPDFDate = function(u) {
var v = u.getTimezoneOffset(), E = v < 0 ? "+" : "-", q = Math.floor(Math.abs(v / 60)), X = Math.abs(v % 60), dt = [E, T(q), "'", T(X), "'"].join("");
return ["D:", u.getFullYear(), T(u.getMonth() + 1), T(u.getDate()), T(u.getHours()), T(u.getMinutes()), T(u.getSeconds()), dt].join("");
}, At = p.__private__.convertPDFDateToDate = function(u) {
var v = parseInt(u.substr(2, 4), 10), E = parseInt(u.substr(6, 2), 10) - 1, q = parseInt(u.substr(8, 2), 10), X = parseInt(u.substr(10, 2), 10), dt = parseInt(u.substr(12, 2), 10), vt = parseInt(u.substr(14, 2), 10);
return new Date(v, E, q, X, dt, vt, 0);
}, wt = p.__private__.setCreationDate = function(u) {
var v;
if (u === void 0 && (u = /* @__PURE__ */ new Date()), u instanceof Date) v = ht(u);
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(u)) throw new Error("Invalid argument passed to jsPDF.setCreationDate");
v = u;
}
return nt = v;
}, x = p.__private__.getCreationDate = function(u) {
var v = nt;
return u === "jsDate" && (v = At(nt)), v;
};
p.setCreationDate = function(u) {
return wt(u), this;
}, p.getCreationDate = function(u) {
return x(u);
};
var B, T = p.__private__.padd2 = function(u) {
return ("0" + parseInt(u)).slice(-2);
}, H = p.__private__.padd2Hex = function(u) {
return ("00" + (u = u.toString())).substr(u.length);
}, J = 0, Z = [], at = [], st = 0, gt = [], _t = [], kt = !1, St = at;
p.__private__.setCustomOutputDestination = function(u) {
kt = !0, St = u;
};
var Dt = function(u) {
kt || (St = u);
};
p.__private__.resetCustomOutputDestination = function() {
kt = !1, St = at;
};
var P = p.__private__.out = function(u) {
return u = u.toString(), st += u.length + 1, St.push(u), St;
}, Lt = p.__private__.write = function(u) {
return P(arguments.length === 1 ? u.toString() : Array.prototype.join.call(arguments, " "));
}, ae = p.__private__.getArrayBuffer = function(u) {
for (var v = u.length, E = new ArrayBuffer(v), q = new Uint8Array(E); v--; ) q[v] = u.charCodeAt(v);
return E;
}, Ht = [["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 Ht;
};
var yt = r.fontSize || 16;
p.__private__.setFontSize = p.setFontSize = function(u) {
return yt = D === G ? u / ee : u, this;
};
var Wt, Ct = p.__private__.getFontSize = p.getFontSize = function() {
return D === V ? yt : yt * ee;
}, zt = r.R2L || !1;
p.__private__.setR2L = p.setR2L = function(u) {
return zt = u, this;
}, p.__private__.getR2L = p.getR2L = function() {
return zt;
};
var qt, ve = p.__private__.setZoomMode = function(u) {
if (/^(?:\d+\.\d*|\d*\.\d+|\d+)%$/.test(u)) Wt = u;
else if (isNaN(u)) {
if ([void 0, null, "fullwidth", "fullheight", "fullpage", "original"].indexOf(u) === -1) throw new Error('zoom must be Integer (e.g. 2), a percentage Value (e.g. 300%) or fullwidth, fullheight, fullpage, original. "' + u + '" is not recognized.');
Wt = u;
} else Wt = parseInt(u, 10);
};
p.__private__.getZoomMode = function() {
return Wt;
};
var ue, Zt = p.__private__.setPageMode = function(u) {
if ([void 0, null, "UseNone", "UseOutlines", "UseThumbs", "FullScreen"].indexOf(u) == -1) throw new Error('Page mode must be one of UseNone, UseOutlines, UseThumbs, or FullScreen. "' + u + '" is not recognized.');
qt = u;
};
p.__private__.getPageMode = function() {
return qt;
};
var he = p.__private__.setLayoutMode = function(u) {
if ([void 0, null, "continuous", "single", "twoleft", "tworight", "two"].indexOf(u) == -1) throw new Error('Layout mode must be one of continuous, single, twoleft, tworight. "' + u + '" is not recognized.');
ue = u;
};
p.__private__.getLayoutMode = function() {
return ue;
}, p.__private__.setDisplayMode = p.setDisplayMode = function(u, v, E) {
return ve(u), he(v), Zt(E), this;
};
var fe = { title: "", subject: "", author: "", keywords: "", creator: "" };
p.__private__.getDocumentProperty = function(u) {
if (Object.keys(fe).indexOf(u) === -1) throw new Error("Invalid argument passed to jsPDF.getDocumentProperty");
return fe[u];
}, p.__private__.getDocumentProperties = function() {
return fe;
}, p.__private__.setDocumentProperties = p.setProperties = p.setDocumentProperties = function(u) {
for (var v in fe) fe.hasOwnProperty(v) && u[v] && (fe[v] = u[v]);
return this;
}, p.__private__.setDocumentProperty = function(u, v) {
if (Object.keys(fe).indexOf(u) === -1) throw new Error("Invalid arguments passed to jsPDF.setDocumentProperty");
return fe[u] = v;
};
var jt, ee, Tt, De, pe, se = {}, oe = {}, Fe = [], Ut = {}, Se = {}, Yt = {}, Qt = {}, Ee = null, le = 0, Vt = [], be = new ku(p), ii = r.hotfixes || [], fr = {}, gn = {}, en = [], Gt = function u(v, E, q, X, dt, vt) {
if (!(this instanceof u)) return new u(v, E, q, X, dt, vt);
isNaN(v) && (v = 1), isNaN(E) && (E = 0), isNaN(q) && (q = 0), isNaN(X) && (X = 1), isNaN(dt) && (dt = 0), isNaN(vt) && (vt = 0), this._matrix = [v, E, q, X, dt, vt];
};
Object.defineProperty(Gt.prototype, "sx", { get: function() {
return this._matrix[0];
}, set: function(u) {
this._matrix[0] = u;
} }), Object.defineProperty(Gt.prototype, "shy", { get: function() {
return this._matrix[1];
}, set: function(u) {
this._matrix[1] = u;
} }), Object.defineProperty(Gt.prototype, "shx", { get: function() {
return this._matrix[2];
}, set: function(u) {
this._matrix[2] = u;
} }), Object.defineProperty(Gt.prototype, "sy", { get: function() {
return this._matrix[3];
}, set: function(u) {
this._matrix[3] = u;
} }), Object.defineProperty(Gt.prototype, "tx", { get: function() {
return this._matrix[4];
}, set: function(u) {
this._matrix[4] = u;
} }), Object.defineProperty(Gt.prototype, "ty", { get: function() {
return this._matrix[5];
}, set: function(u) {
this._matrix[5] = u;
} }), Object.defineProperty(Gt.prototype, "a", { get: function() {
return this._matrix[0];
}, set: function(u) {
this._matrix[0] = u;
} }), Object.defineProperty(Gt.prototype, "b", { get: function() {
return this._matrix[1];
}, set: function(u) {
this._matrix[1] = u;
} }), Object.defineProperty(Gt.prototype, "c", { get: function() {
return this._matrix[2];
}, set: function(u) {
this._matrix[2] = u;
} }), Object.defineProperty(Gt.prototype, "d", { get: function() {
return this._matrix[3];
}, set: function(u) {
this._matrix[3] = u;
} }), Object.defineProperty(Gt.prototype, "e", { get: function() {
return this._matrix[4];
}, set: function(u) {
this._matrix[4] = u;
} }), Object.defineProperty(Gt.prototype, "f", { get: function() {
return this._matrix[5];
}, set: function(u) {
this._matrix[5] = u;
} }), Object.defineProperty(Gt.prototype, "rotation", { get: function() {
return Math.atan2(this.shx, this.sx);
} }), Object.defineProperty(Gt.prototype, "scaleX", { get: function() {
return this.decompose().scale.sx;
} }), Object.defineProperty(Gt.prototype, "scaleY", { get: function() {
return this.decompose().scale.sy;
} }), Object.defineProperty(Gt.prototype, "isIdentity", { get: function() {
return this.sx === 1 && this.shy === 0 && this.shx === 0 && this.sy === 1 && this.tx === 0 && this.ty === 0;
} }), Gt.prototype.join = function(u) {
return [this.sx, this.shy, this.shx, this.sy, this.tx, this.ty].map(K).join(u);
}, Gt.prototype.multiply = function(u) {
var v = u.sx * this.sx + u.shy * this.shx, E = u.sx * this.shy + u.shy * this.sy, q = u.shx * this.sx + u.sy * this.shx, X = u.shx * this.shy + u.sy * this.sy, dt = u.tx * this.sx + u.ty * this.shx + this.tx, vt = u.tx * this.shy + u.ty * this.sy + this.ty;
return new Gt(v, E, q, X, dt, vt);
}, Gt.prototype.decompose = function() {
var u = this.sx, v = this.shy, E = this.shx, q = this.sy, X = this.tx, dt = this.ty, vt = Math.sqrt(u * u + v * v), Ft = (u /= vt) * E + (v /= vt) * q;
E -= u * Ft, q -= v * Ft;
var Bt = Math.sqrt(E * E + q * q);
return Ft /= Bt, u * (q /= Bt) < v * (E /= Bt) && (u = -u, v = -v, Ft = -Ft, vt = -vt), { scale: new Gt(vt, 0, 0, Bt, 0, 0), translate: new Gt(1, 0, 0, 1, X, dt), rotate: new Gt(u, v, -v, u, 0, 0), skew: new Gt(1, 0, Ft, 1, 0, 0) };
}, Gt.prototype.toString = function(u) {
return this.join(" ");
}, Gt.prototype.inversed = function() {
var u = this.sx, v = this.shy, E = this.shx, q = this.sy, X = this.tx, dt = this.ty, vt = 1 / (u * q - v * E), Ft = q * vt, Bt = -v * vt, Kt = -E * vt, re = u * vt;
return new Gt(Ft, Bt, Kt, re, -Ft * X - Kt * dt, -Bt * X - re * dt);
}, Gt.prototype.applyToPoint = function(u) {
var v = u.x * this.sx + u.y * this.shx + this.tx, E = u.x * this.shy + u.y * this.sy + this.ty;
return new _n(v, E);
}, Gt.prototype.applyToRectangle = function(u) {
var v = this.applyToPoint(u), E = this.applyToPoint(new _n(u.x + u.w, u.y + u.h));
return new aa(v.x, v.y, E.x - v.x, E.y - v.y);
}, Gt.prototype.clone = function() {
var u = this.sx, v = this.shy, E = this.shx, q = this.sy, X = this.tx, dt = this.ty;
return new Gt(u, v, E, q, X, dt);
}, p.Matrix = Gt;
var mn = p.matrixMult = function(u, v) {
return v.multiply(u);
}, vn = new Gt(1, 0, 0, 1, 0, 0);
p.unitMatrix = p.identityMatrix = vn;
var Or = function(u, v) {
if (!Se[u]) {
var E = (v instanceof ti ? "Sh" : "P") + (Object.keys(Ut).length + 1).toString(10);
v.id = E, Se[u] = E, Ut[E] = v, be.publish("addPattern", v);
}
};
p.ShadingPattern = ti, p.TilingPattern = Ai, p.addShadingPattern = function(u, v) {
return R("addShadingPattern()"), Or(u, v), this;
}, p.beginTilingPattern = function(u) {
R("beginTilingPattern()"), sa(u.boundingBox[0], u.boundingBox[1], u.boundingBox[2] - u.boundingBox[0], u.boundingBox[3] - u.boundingBox[1], u.matrix);
}, p.endTilingPattern = function(u, v) {
R("endTilingPattern()"), v.stream = _t[B].join(`
`), Or(u, v), be.publish("endTilingPattern", v), en.pop().restore();
};
var jr, Be = p.__private__.newObject = function() {
var u = nr();
return ir(u, !0), u;
}, nr = p.__private__.newObjectDeferred = function() {
return J++, Z[J] = function() {
return st;
}, J;
}, ir = function(u, v) {
return v = typeof v == "boolean" && v, Z[u] = st, v && P(u + " 0 obj"), u;
}, ai = p.__private__.newAdditionalObject = function() {
var u = { objId: nr(), content: "" };
return gt.push(u), u;
}, Mn = nr(), Hr = nr(), rn = p.__private__.decodeColorString = function(u) {
var v = u.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 E = parseFloat(v[0]);
v = [E, E, E, "r"];
}
for (var q = "#", X = 0; X < 3; X++) q += ("0" + Math.floor(255 * parseFloat(v[X])).toString(16)).slice(-2);
return q;
}, Wr = p.__private__.encodeColorString = function(u) {
var v;
typeof u == "string" && (u = { ch1: u });
var E = u.ch1, q = u.ch2, X = u.ch3, dt = u.ch4, vt = u.pdfColorType === "draw" ? ["G", "RG", "K"] : ["g", "rg", "k"];
if (typeof E == "string" && E.charAt(0) !== "#") {
var Ft = new Sf(E);
if (Ft.ok) E = Ft.toHex();
else if (!/^\d*\.?\d*$/.test(E)) throw new Error('Invalid color "' + E + '" passed to jsPDF.encodeColorString.');
}
if (typeof E == "string" && /^#[0-9A-Fa-f]{3}$/.test(E) && (E = "#" + E[1] + E[1] + E[2] + E[2] + E[3] + E[3]), typeof E == "string" && /^#[0-9A-Fa-f]{6}$/.test(E)) {
var Bt = parseInt(E.substr(1), 16);
E = Bt >> 16 & 255, q = Bt >> 8 & 255, X = 255 & Bt;
}
if (q === void 0 || dt === void 0 && E === q && q === X) v = typeof E == "string" ? E + " " + vt[0] : u.precision === 2 ? N(E / 255) + " " + vt[0] : F(E / 255) + " " + vt[0];
else if (dt === void 0 || _e(dt) === "object") {
if (dt && !isNaN(dt.a) && dt.a === 0) return ["1.", "1.", "1.", vt[1]].join(" ");
v = typeof E == "string" ? [E, q, X, vt[1]].join(" ") : u.precision === 2 ? [N(E / 255), N(q / 255), N(X / 255), vt[1]].join(" ") : [F(E / 255), F(q / 255), F(X / 255), vt[1]].join(" ");
} else v = typeof E == "string" ? [E, q, X, dt, vt[2]].join(" ") : u.precision === 2 ? [N(E), N(q), N(X), N(dt), vt[2]].join(" ") : [F(E), F(q), F(X), F(dt), vt[2]].join(" ");
return v;
}, Vr = p.__private__.getFilters = function() {
return c;
}, Br = p.__private__.putStream = function(u) {
var v = (u = u || {}).data || "", E = u.filters || Vr(), q = u.alreadyAppliedFilters || [], X = u.addLength1 || !1, dt = v.length, vt = u.objectId, Ft = function($e) {
return $e;
};
if (m !== null && vt === void 0) throw new Error("ObjectId must be passed to putStream for file encryption");
m !== null && (Ft = Xe.encryptor(vt, 0));
var Bt = {};
E === !0 && (E = ["FlateEncode"]);
var Kt = u.additionalKeyValues || [], re = (Bt = Mt.API.processDataByFilters !== void 0 ? Mt.API.processDataByFilters(v, E) : { data: v, reverseChain: [] }).reverseChain + (Array.isArray(q) ? q.join(" ") : q.toString());
if (Bt.data.length !== 0 && (Kt.push({ key: "Length", value: Bt.data.length }), X === !0 && Kt.push({ key: "Length1", value: dt })), re.length != 0) if (re.split("/").length - 1 == 1) Kt.push({ key: "Filter", value: re });
else {
Kt.push({ key: "Filter", value: "[" + re + "]" });
for (var ge = 0; ge < Kt.length; ge += 1) if (Kt[ge].key === "DecodeParms") {
for (var je = [], Je = 0; Je < Bt.reverseChain.split("/").length - 1; Je += 1) je.push("null");
je.push(Kt[ge].value), Kt[ge].value = "[" + je.join(" ") + "]";
}
}
P("<<");
for (var ke = 0; ke < Kt.length; ke++) P("/" + Kt[ke].key + " " + Kt[ke].value);
P(">>"), Bt.data.length !== 0 && (P("stream"), P(Ft(Bt.data)), P("endstream"));
}, si = p.__private__.putPage = function(u) {
var v = u.number, E = u.data, q = u.objId, X = u.contentsObjId;
ir(q, !0), P("<</Type /Page"), P("/Parent " + u.rootDictionaryObjId + " 0 R"), P("/Resources " + u.resourceDictionaryObjId + " 0 R"), P("/MediaBox [" + parseFloat(K(u.mediaBox.bottomLeftX)) + " " + parseFloat(K(u.mediaBox.bottomLeftY)) + " " + K(u.mediaBox.topRightX) + " " + K(u.mediaBox.topRightY) + "]"), u.cropBox !== null && P("/CropBox [" + K(u.cropBox.bottomLeftX) + " " + K(u.cropBox.bottomLeftY) + " " + K(u.cropBox.topRightX) + " " + K(u.cropBox.topRightY) + "]"), u.bleedBox !== null && P("/BleedBox [" + K(u.bleedBox.bottomLeftX) + " " + K(u.bleedBox.bottomLeftY) + " " + K(u.bleedBox.topRightX) + " " + K(u.bleedBox.topRightY) + "]"), u.trimBox !== null && P("/TrimBox [" + K(u.trimBox.bottomLeftX) + " " + K(u.trimBox.bottomLeftY) + " " + K(u.trimBox.topRightX) + " " + K(u.trimBox.topRightY) + "]"), u.artBox !== null && P("/ArtBox [" + K(u.artBox.bottomLeftX) + " " + K(u.artBox.bottomLeftY) + " " + K(u.artBox.topRightX) + " " + K(u.artBox.topRightY) + "]"), typeof u.userUnit == "number" && u.userUnit !== 1 && P("/UserUnit " + u.userUnit), be.publish("putPage", { objId: q, pageContext: Vt[v], pageNumber: v, page: E }), P("/Contents " + X + " 0 R"), P(">>"), P("endobj");
var dt = E.join(`
`);
return D === G && (dt += `
Q`), ir(X, !0), Br({ data: dt, filters: Vr(), objectId: X }), P("endobj"), q;
}, nn = p.__private__.putPages = function() {
var u, v, E = [];
for (u = 1; u <= le; u++) Vt[u].objId = nr(), Vt[u].contentsObjId = nr();
for (u = 1; u <= le; u++) E.push(si({ number: u, data: _t[u], objId: Vt[u].objId, contentsObjId: Vt[u].contentsObjId, mediaBox: Vt[u].mediaBox, cropBox: Vt[u].cropBox, bleedBox: Vt[u].bleedBox, trimBox: Vt[u].trimBox, artBox: Vt[u].artBox, userUnit: Vt[u].userUnit, rootDictionaryObjId: Mn, resourceDictionaryObjId: Hr }));
ir(Mn, !0), P("<</Type /Pages");
var q = "/Kids [";
for (v = 0; v < le; v++) q += E[v] + " 0 R ";
P(q + "]"), P("/Count " + le), P(">>"), P("endobj"), be.publish("postPutPages");
}, oi = function(u) {
be.publish("putFont", { font: u, out: P, newObject: Be, putStream: Br }), u.isAlreadyPutted !== !0 && (u.objectNumber = Be(), P("<<"), P("/Type /Font"), P("/BaseFont /" + Ki(u.postScriptName)), P("/Subtype /Type1"), typeof u.encoding == "string" && P("/Encoding /" + u.encoding), P("/FirstChar 32"), P("/LastChar 255"), P(">>"), P("endobj"));
}, Ei = function(u) {
u.objectNumber = Be();
var v = [];
v.push({ key: "Type", value: "/XObject" }), v.push({ key: "Subtype", value: "/Form" }), v.push({ key: "BBox", value: "[" + [K(u.x), K(u.y), K(u.x + u.width), K(u.y + u.height)].join(" ") + "]" }), v.push({ key: "Matrix", value: "[" + u.matrix.toString() + "]" });
var E = u.pages[1].join(`
`);
Br({ data: E, additionalKeyValues: v, objectId: u.objectNumber }), P("endobj");
}, Oi = function(u, v) {
v || (v = 21);
var E = Be(), q = (function(vt, Ft) {
var Bt, Kt = [], re = 1 / (Ft - 1);
for (Bt = 0; Bt < 1; Bt += re) Kt.push(Bt);
if (Kt.push(1), vt[0].offset != 0) {
var ge = { offset: 0, color: vt[0].color };
vt.unshift(ge);
}
if (vt[vt.length - 1].offset != 1) {
var je = { offset: 1, color: vt[vt.length - 1].color };
vt.push(je);
}
for (var Je = "", ke = 0, $e = 0; $e < Kt.length; $e++) {
for (Bt = Kt[$e]; Bt > vt[ke + 1].offset; ) ke++;
var Ke = vt[ke].offset, ar = (Bt - Ke) / (vt[ke + 1].offset - Ke), Ln = vt[ke].color, Yr = vt[ke + 1].color;
Je += H(Math.round((1 - ar) * Ln[0] + ar * Yr[0]).toString(16)) + H(Math.round((1 - ar) * Ln[1] + ar * Yr[1]).toString(16)) + H(Math.round((1 - ar) * Ln[2] + ar * Yr[2]).toString(16));
}
return Je.trim();
})(u.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]" }), Br({ data: q, additionalKeyValues: X, alreadyAppliedFilters: ["/ASCIIHexDecode"], objectId: E }), P("endobj"), u.objectNumber = Be(), P("<< /ShadingType " + u.type), P("/ColorSpace /DeviceRGB");
var dt = "/Coords [" + K(parseFloat(u.coords[0])) + " " + K(parseFloat(u.coords[1])) + " ";
u.type === 2 ? dt += K(parseFloat(u.coords[2])) + " " + K(parseFloat(u.coords[3])) : dt += K(parseFloat(u.coords[2])) + " " + K(parseFloat(u.coords[3])) + " " + K(parseFloat(u.coords[4])) + " " + K(parseFloat(u.coords[5])), P(dt += "]"), u.matrix && P("/Matrix [" + u.matrix.toString() + "]"), P("/Function " + E + " 0 R"), P("/Extend [true true]"), P(">>"), P("endobj");
}, ji = function(u, v) {
var E = nr(), q = Be();
v.push({ resourcesOid: E, objectOid: q }), u.objectNumber = q;
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: "[" + u.boundingBox.map(K).join(" ") + "]" }), X.push({ key: "XStep", value: K(u.xStep) }), X.push({ key: "YStep", value: K(u.yStep) }), X.push({ key: "Resources", value: E + " 0 R" }), u.matrix && X.push({ key: "Matrix", value: "[" + u.matrix.toString() + "]" }), Br({ data: u.stream, additionalKeyValues: X, objectId: u.objectNumber }), P("endobj");
}, Bs = function(u) {
for (var v in u.objectNumber = Be(), P("<<"), u) switch (v) {
case "opacity":
P("/ca " + N(u[v]));
break;
case "stroke-opacity":
P("/CA " + N(u[v]));
}
P(">>"), P("endobj");
}, $i = function(u) {
ir(u.resourcesOid, !0), P("<<"), P("/ProcSet [/PDF /Text /ImageB /ImageC /ImageI]"), (function() {
for (var v in P("/Font <<"), se) se.hasOwnProperty(v) && (_ === !1 || _ === !0 && k.hasOwnProperty(v)) && P("/" + v + " " + se[v].objectNumber + " 0 R");
P(">>");
})(), (function() {
if (Object.keys(Ut).length > 0) {
for (var v in P("/Shading <<"), Ut) Ut.hasOwnProperty(v) && Ut[v] instanceof ti && Ut[v].objectNumber >= 0 && P("/" + v + " " + Ut[v].objectNumber + " 0 R");
be.publish("putShadingPatternDict"), P(">>");
}
})(), (function(v) {
if (Object.keys(Ut).length > 0) {
for (var E in P("/Pattern <<"), Ut) Ut.hasOwnProperty(E) && Ut[E] instanceof p.TilingPattern && Ut[E].objectNumber >= 0 && Ut[E].objectNumber < v && P("/" + E + " " + Ut[E].objectNumber + " 0 R");
be.publish("putTilingPatternDict"), P(">>");
}
})(u.objectOid), (function() {
if (Object.keys(Yt).length > 0) {
var v;
for (v in P("/ExtGState <<"), Yt) Yt.hasOwnProperty(v) && Yt[v].objectNumber >= 0 && P("/" + v + " " + Yt[v].objectNumber + " 0 R");
be.publish("putGStateDict"), P(">>");
}
})(), (function() {
for (var v in P("/XObject <<"), fr) fr.hasOwnProperty(v) && fr[v].objectNumber >= 0 && P("/" + v + " " + fr[v].objectNumber + " 0 R");
be.publish("putXobjectDict"), P(">>");
})(), P(">>"), P("endobj");
}, Ra = function(u) {
oe[u.fontName] = oe[u.fontName] || {}, oe[u.fontName][u.fontStyle] = u.id;
}, Ta = function(u, v, E, q, X) {
var dt = { id: "F" + (Object.keys(se).length + 1).toString(10), postScriptName: u, fontName: v, fontStyle: E, encoding: q, isStandardFont: X || !1, metadata: {} };
return be.publish("addFont", { font: dt, instance: this }), se[dt.id] = dt, Ra(dt), dt.id;
}, Mr = p.__private__.pdfEscape = p.pdfEscape = function(u, v) {
return (function(E, q) {
var X, dt, vt, Ft, Bt, Kt, re, ge, je;
if (vt = (q = q || {}).sourceEncoding || "Unicode", Bt = q.outputEncoding, (q.autoencode || Bt) && se[jt].metadata && se[jt].metadata[vt] && se[jt].metadata[vt].encoding && (Ft = se[jt].metadata[vt].encoding, !Bt && se[jt].encoding && (Bt = se[jt].encoding), !Bt && Ft.codePages && (Bt = Ft.codePages[0]), typeof Bt == "string" && (Bt = Ft[Bt]), Bt)) {
for (re = !1, Kt = [], X = 0, dt = E.length; X < dt; X++) (ge = Bt[E.charCodeAt(X)]) ? Kt.push(String.fromCharCode(ge)) : Kt.push(E[X]), Kt[X].charCodeAt(0) >> 8 && (re = !0);
E = Kt.join("");
}
for (X = E.length; re === void 0 && X !== 0; ) E.charCodeAt(X - 1) >> 8 && (re = !0), X--;
if (!re) return E;
for (Kt = q.noBOM ? [] : [254, 255], X = 0, dt = E.length; X < dt; X++) {
if ((je = (ge = E.charCodeAt(X)) >> 8) >> 8) throw new Error("Character at position " + X + " of string '" + E + "' exceeds 16bits. Cannot be encoded into UCS-2 BE");
Kt.push(je), Kt.push(ge - (je << 8));
}
return String.fromCharCode.apply(void 0, Kt);
})(u, v).replace(/\\/g, "\\\\").replace(/\(/g, "\\(").replace(/\)/g, "\\)");
}, Zi = p.__private__.beginPage = function(u) {
_t[++le] = [], Vt[le] = { objId: 0, contentsObjId: 0, userUnit: Number(l), artBox: null, bleedBox: null, cropBox: null, trimBox: null, mediaBox: { bottomLeftX: 0, bottomLeftY: 0, topRightX: Number(u[0]), topRightY: Number(u[1]) } }, qa(le), Dt(_t[B]);
}, Da = function(u, v) {
var E, q, X;
switch (e = v || e, typeof u == "string" && (E = S(u.toLowerCase()), Array.isArray(E) && (q = E[0], X = E[1])), Array.isArray(u) && (q = u[0] * ee, X = u[1] * ee), isNaN(q) && (q = o[0], X = o[1]), (q > 14400 || X > 14400) && (Le.warn("A page in a PDF can not be wider or taller than 14400 userUnit. jsPDF limits the width/height to 14400"), q = Math.min(14400, q), X = Math.min(14400, X)), o = [q, X], e.substr(0, 1)) {
case "l":
X > q && (o = [X, q]);
break;
case "p":
q > X && (o = [X, q]);
}
Zi(o), Xt(ea), P(Ti), na !== 0 && P(na + " J"), ia !== 0 && P(ia + " j"), be.publish("addPage", { pageNumber: le });
}, Qi = function(u) {
u > 0 && u <= le && (_t.splice(u, 1), Vt.splice(u, 1), le--, B > le && (B = le), this.setPage(B));
}, qa = function(u) {
u > 0 && u <= le && (B = u);
}, Ua = p.__private__.getNumberOfPages = p.getNumberOfPages = function() {
return _t.length - 1;
}, za = function(u, v, E) {
var q, X = void 0;
return E = E || {}, u = u !== void 0 ? u : se[jt].fontName, v = v !== void 0 ? v : se[jt].fontStyle, q = u.toLowerCase(), oe[q] !== void 0 && oe[q][v] !== void 0 ? X = oe[q][v] : oe[u] !== void 0 && oe[u][v] !== void 0 ? X = oe[u][v] : E.disableWarning === !1 && Le.warn("Unable to look up font label for font '" + u + "', '" + v + "'. Refer to getFontList() for available fonts."), X || E.noFallback || (X = oe.times[v]) == null && (X = oe.times.normal), X;
}, an = p.__private__.putInfo = function() {
var u = Be(), v = function(q) {
return q;
};
for (var E in m !== null && (v = Xe.encryptor(u, 0)), P("<<"), P("/Producer (" + Mr(v("jsPDF " + Mt.version)) + ")"), fe) fe.hasOwnProperty(E) && fe[E] && P("/" + E.substr(0, 1).toUpperCase() + E.substr(1) + " (" + Mr(v(fe[E])) + ")");
P("/CreationDate (" + Mr(v(nt)) + ")"), P(">>"), P("endobj");
}, Bi = p.__private__.putCatalog = function(u) {
var v = (u = u || {}).rootDictionaryObjId || Mn;
switch (Be(), P("<<"), P("/Type /Catalog"), P("/Pages " + v + " 0 R"), Wt || (Wt = "fullwidth"), Wt) {
case "fullwidth":
P("/OpenAction [3 0 R /FitH null]");
break;
case "fullheight":
P("/OpenAction [3 0 R /FitV null]");
break;
case "fullpage":
P("/OpenAction [3 0 R /Fit]");
break;
case "original":
P("/OpenAction [3 0 R /XYZ null null 1]");
break;
default:
var E = "" + Wt;
E.substr(E.length - 1) === "%" && (Wt = parseInt(Wt) / 100), typeof Wt == "number" && P("/OpenAction [3 0 R /XYZ null null " + N(Wt) + "]");
}
switch (ue || (ue = "continuous"), ue) {
case "continuous":
P("/PageLayout /OneColumn");
break;
case "single":
P("/PageLayout /SinglePage");
break;
case "two":
case "twoleft":
P("/PageLayout /TwoColumnLeft");
break;
case "tworight":
P("/PageLayout /TwoColumnRight");
}
qt && P("/PageMode /" + qt), be.publish("putCatalog"), P(">>"), P("endobj");
}, Ms = p.__private__.putTrailer = function() {
P("trailer"), P("<<"), P("/Size " + (J + 1)), P("/Root " + J + " 0 R"), P("/Info " + (J - 1) + " 0 R"), m !== null && P("/Encrypt " + Xe.oid + " 0 R"), P("/ID [ <" + ot + "> <" + ot + "> ]"), P(">>");
}, Ye = p.__private__.putHeader = function() {
P("%PDF-" + j), P("%ºß¬à");
}, Ha = p.__private__.putXRef = function() {
var u = "0000000000";
P("xref"), P("0 " + (J + 1)), P("0000000000 65535 f ");
for (var v = 1; v <= J; v++) typeof Z[v] == "function" ? P((u + Z[v]()).slice(-10) + " 00000 n ") : Z[v] !== void 0 ? P((u + Z[v]).slice(-10) + " 00000 n ") : P("0000000000 00000 n ");
}, sn = p.__private__.buildDocument = function() {
var u;
J = 0, st = 0, at = [], Z = [], gt = [], Mn = nr(), Hr = nr(), Dt(at), be.publish("buildDocument"), Ye(), nn(), (function() {
be.publish("putAdditionalObjects");
for (var E = 0; E < gt.length; E++) {
var q = gt[E];
ir(q.objId, !0), P(q.content), P("endobj");
}
be.publish("postPutAdditionalObjects");
})(), u = [], (function() {
for (var E in se) se.hasOwnProperty(E) && (_ === !1 || _ === !0 && k.hasOwnProperty(E)) && oi(se[E]);
})(), (function() {
var E;
for (E in Yt) Yt.hasOwnProperty(E) && Bs(Yt[E]);
})(), (function() {
for (var E in fr) fr.hasOwnProperty(E) && Ei(fr[E]);
})(), (function(E) {
var q;
for (q in Ut) Ut.hasOwnProperty(q) && (Ut[q] instanceof ti ? Oi(Ut[q]) : Ut[q] instanceof Ai && ji(Ut[q], E));
})(u), be.publish("putResources"), u.forEach($i), $i({ resourcesOid: Hr, objectOid: Number.MAX_SAFE_INTEGER }), be.publish("postPutResources"), m !== null && (Xe.oid = Be(), P("<<"), P("/Filter /Standard"), P("/V " + Xe.v), P("/R " + Xe.r), P("/U <" + Xe.toHexString(Xe.U) + ">"), P("/O <" + Xe.toHexString(Xe.O) + ">"), P("/P " + Xe.P), P(">>"), P("endobj")), an(), Bi();
var v = st;
return Ha(), Ms(), P("startxref"), P("" + v), P("%%EOF"), Dt(_t[B]), at.join(`
`);
}, Mi = p.__private__.getBlob = function(u) {
return new Blob([ae(u)], { type: "application/pdf" });
}, Wa = p.output = p.__private__.output = (jr = function(u, v) {
switch (typeof (v = v || {}) == "string" ? v = { filename: v } : v.filename = v.filename || "generated.pdf", u) {
case void 0:
return sn();
case "save":
p.save(v.filename);
break;
case "arraybuffer":
return ae(sn());
case "blob":
return Mi(sn());
case "bloburi":
case "bloburl":
if (Jt.URL !== void 0 && typeof Jt.URL.createObjectURL == "function") return Jt.URL && Jt.URL.createObjectURL(Mi(sn())) || void 0;
Le.warn("bloburl is not supported by your system, because URL.createObjectURL is not supported by your browser.");
break;
case "datauristring":
case "dataurlstring":
var E = "", q = sn();
try {
E = Nu(q);
} catch {
E = Nu(unescape(encodeURIComponent(q)));
}
return "data:application/pdf;filename=" + v.filename + ";base64," + E;
case "pdfobjectnewwindow":
if (Object.prototype.toString.call(Jt) === "[object Window]") {
var X = "https://cdnjs.cloudflare.com/ajax/libs/pdfobject/2.1.1/pdfobject.min.js", dt = ' integrity="sha512-4ze/a9/4jqu+tX9dfOqJYSvyYd5M6qum/3HpCLr+/Jqf0whc37VUbkpNGHR7/8pSnCFw47T1fmIpwBV7UySh3g==" crossorigin="anonymous"';
v.pdfObjectUrl && (X = v.pdfObjectUrl, dt = "");
var vt = '<html><style>html, body { padding: 0; margin: 0; } iframe { width: 100%; height: 100%; border: 0;} </style><body><script src="' + X + '"' + dt + '><\/script><script >PDFObject.embed("' + this.output("dataurlstring") + '", ' + JSON.stringify(v) + ");<\/script></body></html>", Ft = Jt.open();
return Ft !== null && Ft.document.write(vt), Ft;
}
throw new Error("The option pdfobjectnewwindow just works in a browser-environment.");
case "pdfjsnewwindow":
if (Object.prototype.toString.call(Jt) === "[object Window]") {
var Bt = '<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>', Kt = Jt.open();
if (Kt !== null) {
Kt.document.write(Bt);
var re = this;
Kt.document.documentElement.querySelector("#pdfViewer").onload = function() {
Kt.document.title = v.filename, Kt.document.documentElement.querySelector("#pdfViewer").contentWindow.PDFViewerApplication.open(re.output("bloburl"));
};
}
return Kt;
}
throw new Error("The option pdfjsnewwindow just works in a browser-environment.");
case "dataurlnewwindow":
if (Object.prototype.toString.call(Jt) !== "[object Window]") throw new Error("The option dataurlnewwindow just works in a browser-environment.");
var ge = '<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>', je = Jt.open();
if (je !== null && (je.document.write(ge), je.document.title = v.filename), je || typeof safari > "u") return je;
break;
case "datauri":
case "dataurl":
return Jt.document.location.href = this.output("datauristring", v);
default:
return null;
}
}, jr.foo = function() {
try {
return jr.apply(this, arguments);
} catch (E) {
var u = E.stack || "";
~u.indexOf(" at ") && (u = u.split(" at ")[1]);
var v = "Error in function " + u.split(`
`)[0].split("<")[0] + ": " + E.message;
if (!Jt.console) throw new Error(v);
Jt.console.error(v, E), Jt.alert && alert(v);
}
}, jr.foo.bar = jr, jr.foo), Rr = function(u) {
return Array.isArray(ii) === !0 && ii.indexOf(u) > -1;
};
switch (i) {
case "pt":
ee = 1;
break;
case "mm":
ee = 72 / 25.4;
break;
case "cm":
ee = 72 / 2.54;
break;
case "in":
ee = 72;
break;
case "px":
ee = Rr("px_scaling") == 1 ? 0.75 : 96 / 72;
break;
case "pc":
case "em":
ee = 12;
break;
case "ex":
ee = 6;
break;
default:
if (typeof i != "number") throw new Error("Invalid unit: " + i);
ee = i;
}
var Xe = null;
wt(), rt();
var bn = p.__private__.getPageInfo = p.getPageInfo = function(u) {
if (isNaN(u) || u % 1 != 0) throw new Error("Invalid argument passed to jsPDF.getPageInfo");
return { objId: Vt[u].objId, pageNumber: u, pageContext: Vt[u] };
}, Va = p.__private__.getPageInfoByObjId = function(u) {
if (isNaN(u) || u % 1 != 0) throw new Error("Invalid argument passed to jsPDF.getPageInfoByObjId");
for (var v in Vt) if (Vt[v].objId === u) break;
return bn(v);
}, Rs = p.__private__.getCurrentPageInfo = p.getCurrentPageInfo = function() {
return { objId: Vt[B].objId, pageNumber: B, pageContext: Vt[B] };
};
p.addPage = function() {
return Da.apply(this, arguments), this;
}, p.setPage = function() {
return qa.apply(this, arguments), Dt.call(this, _t[B]), this;
}, p.insertPage = function(u) {
return this.addPage(), this.movePage(B, u), this;
}, p.movePage = function(u, v) {
var E, q;
if (u > v) {
E = _t[u], q = Vt[u];
for (var X = u; X > v; X--) _t[X] = _t[X - 1], Vt[X] = Vt[X - 1];
_t[v] = E, Vt[v] = q, this.setPage(v);
} else if (u < v) {
E = _t[u], q = Vt[u];
for (var dt = u; dt < v; dt++) _t[dt] = _t[dt + 1], Vt[dt] = Vt[dt + 1];
_t[v] = E, Vt[v] = q, this.setPage(v);
}
return this;
}, p.deletePage = function() {
return Qi.apply(this, arguments), this;
}, p.__private__.text = p.text = function(u, v, E, q, X) {
var dt, vt, Ft, Bt, Kt, re, ge, je, Je, ke = (q = q || {}).scope || this;
if (typeof u == "number" && typeof v == "number" && (typeof E == "string" || Array.isArray(E))) {
var $e = E;
E = v, v = u, u = $e;
}
if (arguments[3] instanceof Gt == 0 ? (Ft = arguments[4], Bt = arguments[5], _e(ge = arguments[3]) === "object" && ge !== null || (typeof Ft == "string" && (Bt = Ft, Ft = null), typeof ge == "string" && (Bt = ge, ge = null), typeof ge == "number" && (Ft = ge, ge = null), q = { flags: ge, angle: Ft, align: Bt })) : (R("The transform parameter of text() with a Matrix value"), Je = X), isNaN(v) || isNaN(E) || u == null) throw new Error("Invalid arguments passed to jsPDF.text");
if (u.length === 0) return ke;
var Ke, ar = "", Ln = typeof q.lineHeightFactor == "number" ? q.lineHeightFactor : ui, Yr = ke.internal.scaleFactor;
function Sn(we) {
return we = we.split(" ").join(Array(q.TabLen || 9).join(" ")), Mr(we, ge);
}
function la(we) {
for (var Ae, Ue = we.concat(), Ze = [], In = Ue.length; In--; ) typeof (Ae = Ue.shift()) == "string" ? Ze.push(Ae) : Array.isArray(we) && (Ae.length === 1 || Ae[1] === void 0 && Ae[2] === void 0) ? Ze.push(Ae[0]) : Ze.push([Ae[0], Ae[1], Ae[2]]);
return Ze;
}
function qi(we, Ae) {
var Ue;
if (typeof we == "string") Ue = Ae(we)[0];
else if (Array.isArray(we)) {
for (var Ze, In, ba = we.concat(), Hi = [], rs = ba.length; rs--; ) typeof (Ze = ba.shift()) == "string" ? Hi.push(Ae(Ze)[0]) : Array.isArray(Ze) && typeof Ze[0] == "string" && (In = Ae(Ze[0], Ze[1], Ze[2]), Hi.push([In[0], In[1], In[2]]));
Ue = Hi;
}
return Ue;
}
var Rn = !1, di = !0;
if (typeof u == "string") Rn = !0;
else if (Array.isArray(u)) {
var pi = u.concat();
vt = [];
for (var Tn, sr = pi.length; sr--; ) (typeof (Tn = pi.shift()) != "string" || Array.isArray(Tn) && typeof Tn[0] != "string") && (di = !1);
Rn = di;
}
if (Rn === !1) throw new Error('Type of text must be string or Array. "' + u + '" is not recognized.');
typeof u == "string" && (u = u.match(/[\r?\n]/) ? u.split(/\r\n|\r|\n/g) : [u]);
var gi = yt / ke.internal.scaleFactor, mi = gi * (Ln - 1);
switch (q.baseline) {
case "bottom":
E -= mi;
break;
case "top":
E += gi - mi;
break;
case "hanging":
E += gi - 2 * mi;
break;
case "middle":
E += gi / 2 - mi;
}
if ((re = q.maxWidth || 0) > 0 && (typeof u == "string" ? u = ke.splitTextToSize(u, re) : Object.prototype.toString.call(u) === "[object Array]" && (u = u.reduce(function(we, Ae) {
return we.concat(ke.splitTextToSize(Ae, re));
}, []))), dt = { text: u, x: v, y: E, options: q, mutex: { pdfEscape: Mr, activeFontKey: jt, fonts: se, activeFontSize: yt } }, be.publish("preProcessText", dt), u = dt.text, Ft = (q = dt.options).angle, Je instanceof Gt == 0 && Ft && typeof Ft == "number") {
Ft *= Math.PI / 180, q.rotationDirection === 0 && (Ft = -Ft), D === G && (Ft = -Ft);
var ua = Math.cos(Ft), fa = Math.sin(Ft);
Je = new Gt(ua, fa, -fa, ua, 0, 0);
} else Ft && Ft instanceof Gt && (Je = Ft);
D !== G || Je || (Je = vn), (Kt = q.charSpace || xn) !== void 0 && (ar += K(z(Kt)) + ` Tc
`, this.setCharSpace(this.getCharSpace() || 0)), (je = q.horizontalScale) !== void 0 && (ar += K(100 * je) + ` Tz
`), q.lang;
var mr = -1, kn = q.renderingMode !== void 0 ? q.renderingMode : q.stroke, Ui = ke.internal.getCurrentPageInfo().pageContext;
switch (kn) {
case 0:
case !1:
case "fill":
mr = 0;
break;
case 1:
case !0:
case "stroke":
mr = 1;
break;
case 2:
case "fillThenStroke":
mr = 2;
break;
case 3:
case "invisible":
mr = 3;
break;
case 4:
case "fillAndAddForClipping":
mr = 4;
break;
case 5:
case "strokeAndAddPathForClipping":
mr = 5;
break;
case 6:
case "fillThenStrokeAndAddToPathForClipping":
mr = 6;
break;
case 7:
case "addToPathForClipping":
mr = 7;
}
var ts = Ui.usedRenderingMode !== void 0 ? Ui.usedRenderingMode : -1;
mr !== -1 ? ar += mr + ` Tr
` : ts !== -1 && (ar += `0 Tr
`), mr !== -1 && (Ui.usedRenderingMode = mr), Bt = q.align || "left";
var Tr, vi = yt * Ln, ha = ke.internal.pageSize.getWidth(), ca = se[jt];
Kt = q.charSpace || xn, re = q.maxWidth || 0, ge = Object.assign({ autoencode: !0, noBOM: !0 }, q.flags);
var Dn = [], bi = function(we) {
return ke.getStringUnitWidth(we, { font: ca, charSpace: Kt, fontSize: yt, doKerning: !1 }) * yt / Yr;
};
if (Object.prototype.toString.call(u) === "[object Array]") {
var Ar;
vt = la(u), Bt !== "left" && (Tr = vt.map(bi));
var Nr, qn = 0;
if (Bt === "right") {
v -= Tr[0], u = [], sr = vt.length;
for (var Pn = 0; Pn < sr; Pn++) Pn === 0 ? (Nr = wn(v), Ar = yn(E)) : (Nr = z(qn - Tr[Pn]), Ar = -vi), u.push([vt[Pn], Nr, Ar]), qn = Tr[Pn];
} else if (Bt === "center") {
v -= Tr[0] / 2, u = [], sr = vt.length;
for (var Un = 0; Un < sr; Un++) Un === 0 ? (Nr = wn(v), Ar = yn(E)) : (Nr = z((qn - Tr[Un]) / 2), Ar = -vi), u.push([vt[Un], Nr, Ar]), qn = Tr[Un];
} else if (Bt === "left") {
u = [], sr = vt.length;
for (var da = 0; da < sr; da++) u.push(vt[da]);
} else if (Bt === "justify" && ca.encoding === "Identity-H") {
u = [], sr = vt.length, re = re !== 0 ? re : ha;
for (var zi = 0, qe = 0; qe < sr; qe++) if (Ar = qe === 0 ? yn(E) : -vi, Nr = qe === 0 ? wn(v) : zi, qe < sr - 1) {
var es = z((re - Tr[qe]) / (vt[qe].split(" ").length - 1)), ln = vt[qe].split(" ");
u.push([ln[0] + " ", Nr, Ar]), zi = 0;
for (var un = 1; un < ln.length; un++) {
var pa = (bi(ln[un - 1] + " " + ln[un]) - bi(ln[un])) * Yr + es;
un == ln.length - 1 ? u.push([ln[un], pa, 0]) : u.push([ln[un] + " ", pa, 0]), zi -= pa;
}
} else u.push([vt[qe], Nr, Ar]);
u.push(["", zi, 0]);
} else {
if (Bt !== "justify") throw new Error('Unrecognized alignment option, use "left", "center", "right" or "justify".');
for (u = [], sr = vt.length, re = re !== 0 ? re : ha, qe = 0; qe < sr; qe++) {
Ar = qe === 0 ? yn(E) : -vi, Nr = qe === 0 ? wn(v) : 0;
var ga = vt[qe].split(" ").length - 1, ma = ga > 0 ? (re - Tr[qe]) / ga : 0;
qe < sr - 1 ? Dn.push(K(z(ma))) : Dn.push(0), u.push([vt[qe], Nr, Ar]);
}
}
}
(typeof q.R2L == "boolean" ? q.R2L : zt) === !0 && (u = qi(u, function(we, Ae, Ue) {
return [we.split("").reverse().join(""), Ae, Ue];
})), dt = { text: u, x: v, y: E, options: q, mutex: { pdfEscape: Mr, activeFontKey: jt, fonts: se, activeFontSize: yt } }, be.publish("postProcessText", dt), u = dt.text, Ke = dt.mutex.isHex || !1;
var va = se[jt].encoding;
va !== "WinAnsiEncoding" && va !== "StandardEncoding" || (u = qi(u, function(we, Ae, Ue) {
return [Sn(we), Ae, Ue];
})), vt = la(u), u = [];
for (var zn, Hn, Wn, wi = Array.isArray(vt[0]) ? 1 : 0, Vn = "", yi = function(we, Ae, Ue) {
var Ze = "";
return Ue instanceof Gt ? (Ue = typeof q.angle == "number" ? mn(Ue, new Gt(1, 0, 0, 1, we, Ae)) : mn(new Gt(1, 0, 0, 1, we, Ae), Ue), D === G && (Ue = mn(new Gt(1, 0, 0, -1, 0, 0), Ue)), Ze = Ue.join(" ") + ` Tm
`) : Ze = K(we) + " " + K(Ae) + ` Td
`, Ze;
}, Dr = 0; Dr < vt.length; Dr++) {
switch (Vn = "", wi) {
case 1:
Wn = (Ke ? "<" : "(") + vt[Dr][0] + (Ke ? ">" : ")"), zn = parseFloat(vt[Dr][1]), Hn = parseFloat(vt[Dr][2]);
break;
case 0:
Wn = (Ke ? "<" : "(") + vt[Dr] + (Ke ? ">" : ")"), zn = wn(v), Hn = yn(E);
}
Dn !== void 0 && Dn[Dr] !== void 0 && (Vn = Dn[Dr] + ` Tw
`), Dr === 0 ? u.push(Vn + yi(zn, Hn, Je) + Wn) : wi === 0 ? u.push(Vn + Wn) : wi === 1 && u.push(Vn + yi(zn, Hn, Je) + Wn);
}
u = wi === 0 ? u.join(` Tj
T* `) : u.join(` Tj
`), u += ` Tj
`;
var fn = `BT
/`;
return fn += jt + " " + yt + ` Tf
`, fn += K(yt * Ln) + ` TL
`, fn += fi + `
`, fn += ar, fn += u, P(fn += "ET"), k[jt] = !0, ke;
};
var Ts = p.__private__.clip = p.clip = function(u) {
return P(u === "evenodd" ? "W*" : "W"), this;
};
p.clipEvenOdd = function() {
return Ts("evenodd");
}, p.__private__.discardPath = p.discardPath = function() {
return P("n"), this;
};
var on = p.__private__.isValidStyle = function(u) {
var v = !1;
return [void 0, null, "S", "D", "F", "DF", "FD", "f", "f*", "B", "B*", "n"].indexOf(u) !== -1 && (v = !0), v;
};
p.__private__.setDefaultPathOperation = p.setDefaultPathOperation = function(u) {
return on(u) && (d = u), this;
};
var Ga = p.__private__.getStyle = p.getStyle = function(u) {
var v = d;
switch (u) {
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 = u;
}
return v;
}, Ya = p.close = function() {
return P("h"), this;
};
p.stroke = function() {
return P("S"), this;
}, p.fill = function(u) {
return Ri("f", u), this;
}, p.fillEvenOdd = function(u) {
return Ri("f*", u), this;
}, p.fillStroke = function(u) {
return Ri("B", u), this;
}, p.fillStrokeEvenOdd = function(u) {
return Ri("B*", u), this;
};
var Ri = function(u, v) {
_e(v) === "object" ? qs(v, u) : P(u);
}, li = function(u) {
u === null || D === G && u === void 0 || (u = Ga(u), P(u));
};
function Ds(u, v, E, q, X) {
var dt = new Ai(v || this.boundingBox, E || this.xStep, q || this.yStep, this.gState, X || this.matrix);
dt.stream = this.stream;
var vt = u + "$$" + this.cloneIndex++ + "$$";
return Or(vt, dt), dt;
}
var qs = function(u, v) {
var E = Se[u.key], q = Ut[E];
if (q instanceof ti) P("q"), P(Us(v)), q.gState && p.setGState(q.gState), P(u.matrix.toString() + " cm"), P("/" + E + " sh"), P("Q");
else if (q instanceof Ai) {
var X = new Gt(1, 0, 0, -1, 0, ci());
u.matrix && (X = X.multiply(u.matrix || vn), E = Ds.call(q, u.key, u.boundingBox, u.xStep, u.yStep, X).id), P("q"), P("/Pattern cs"), P("/" + E + " scn"), q.gState && p.setGState(q.gState), P(v), P("Q");
}
}, Us = function(u) {
switch (u) {
case "f":
case "F":
case "n":
return "W n";
case "f*":
return "W* n";
case "B":
case "S":
return "W S";
case "B*":
return "W* S";
}
}, ta = p.moveTo = function(u, v) {
return P(K(z(u)) + " " + K(U(v)) + " m"), this;
}, Ja = p.lineTo = function(u, v) {
return P(K(z(u)) + " " + K(U(v)) + " l"), this;
}, Gr = p.curveTo = function(u, v, E, q, X, dt) {
return P([K(z(u)), K(U(v)), K(z(E)), K(U(q)), K(z(X)), K(U(dt)), "c"].join(" ")), this;
};
p.__private__.line = p.line = function(u, v, E, q, X) {
if (isNaN(u) || isNaN(v) || isNaN(E) || isNaN(q) || !on(X)) throw new Error("Invalid arguments passed to jsPDF.line");
return D === V ? this.lines([[E - u, q - v]], u, v, [1, 1], X || "S") : this.lines([[E - u, q - v]], u, v, [1, 1]).stroke();
}, p.__private__.lines = p.lines = function(u, v, E, q, X, dt) {
var vt, Ft, Bt, Kt, re, ge, je, Je, ke, $e, Ke, ar;
if (typeof u == "number" && (ar = E, E = v, v = u, u = ar), q = q || [1, 1], dt = dt || !1, isNaN(v) || isNaN(E) || !Array.isArray(u) || !Array.isArray(q) || !on(X) || typeof dt != "boolean") throw new Error("Invalid arguments passed to jsPDF.lines");
for (ta(v, E), vt = q[0], Ft = q[1], Kt = u.length, $e = v, Ke = E, Bt = 0; Bt < Kt; Bt++) (re = u[Bt]).length === 2 ? ($e = re[0] * vt + $e, Ke = re[1] * Ft + Ke, Ja($e, Ke)) : (ge = re[0] * vt + $e, je = re[1] * Ft + Ke, Je = re[2] * vt + $e, ke = re[3] * Ft + Ke, $e = re[4] * vt + $e, Ke = re[5] * Ft + Ke, Gr(ge, je, Je, ke, $e, Ke));
return dt && Ya(), li(X), this;
}, p.path = function(u) {
for (var v = 0; v < u.length; v++) {
var E = u[v], q = E.c;
switch (E.op) {
case "m":
ta(q[0], q[1]);
break;
case "l":
Ja(q[0], q[1]);
break;
case "c":
Gr.apply(this, q);
break;
case "h":
Ya();
}
}
return this;
}, p.__private__.rect = p.rect = function(u, v, E, q, X) {
if (isNaN(u) || isNaN(v) || isNaN(E) || isNaN(q) || !on(X)) throw new Error("Invalid arguments passed to jsPDF.rect");
return D === V && (q = -q), P([K(z(u)), K(U(v)), K(z(E)), K(z(q)), "re"].join(" ")), li(X), this;
}, p.__private__.triangle = p.triangle = function(u, v, E, q, X, dt, vt) {
if (isNaN(u) || isNaN(v) || isNaN(E) || isNaN(q) || isNaN(X) || isNaN(dt) || !on(vt)) throw new Error("Invalid arguments passed to jsPDF.triangle");
return this.lines([[E - u, q - v], [X - E, dt - q], [u - X, v - dt]], u, v, [1, 1], vt, !0), this;
}, p.__private__.roundedRect = p.roundedRect = function(u, v, E, q, X, dt, vt) {
if (isNaN(u) || isNaN(v) || isNaN(E) || isNaN(q) || isNaN(X) || isNaN(dt) || !on(vt)) throw new Error("Invalid arguments passed to jsPDF.roundedRect");
var Ft = 4 / 3 * (Math.SQRT2 - 1);
return X = Math.min(X, 0.5 * E), dt = Math.min(dt, 0.5 * q), this.lines([[E - 2 * X, 0], [X * Ft, 0, X, dt - dt * Ft, X, dt], [0, q - 2 * dt], [0, dt * Ft, -X * Ft, dt, -X, dt], [2 * X - E, 0], [-X * Ft, 0, -X, -dt * Ft, -X, -dt], [0, 2 * dt - q], [0, -dt * Ft, X * Ft, -dt, X, -dt]], u + X, v, [1, 1], vt, !0), this;
}, p.__private__.ellipse = p.ellipse = function(u, v, E, q, X) {
if (isNaN(u) || isNaN(v) || isNaN(E) || isNaN(q) || !on(X)) throw new Error("Invalid arguments passed to jsPDF.ellipse");
var dt = 4 / 3 * (Math.SQRT2 - 1) * E, vt = 4 / 3 * (Math.SQRT2 - 1) * q;
return ta(u + E, v), Gr(u + E, v - vt, u + dt, v - q, u, v - q), Gr(u - dt, v - q, u - E, v - vt, u - E, v), Gr(u - E, v + vt, u - dt, v + q, u, v + q), Gr(u + dt, v + q, u + E, v + vt, u + E, v), li(X), this;
}, p.__private__.circle = p.circle = function(u, v, E, q) {
if (isNaN(u) || isNaN(v) || isNaN(E) || !on(q)) throw new Error("Invalid arguments passed to jsPDF.circle");
return this.ellipse(u, v, E, E, q);
}, p.setFont = function(u, v, E) {
return E && (v = ct(v, E)), jt = za(u, v, { disableWarning: !1 }), this;
};
var zs = p.__private__.getFont = p.getFont = function() {
return se[za.apply(p, arguments)];
};
p.__private__.getFontList = p.getFontList = function() {
var u, v, E = {};
for (u in oe) if (oe.hasOwnProperty(u)) for (v in E[u] = [], oe[u]) oe[u].hasOwnProperty(v) && E[u].push(v);
return E;
}, p.addFont = function(u, v, E, q, X) {
var dt = ["StandardEncoding", "MacRomanEncoding", "Identity-H", "WinAnsiEncoding"];
return arguments[3] && dt.indexOf(arguments[3]) !== -1 ? X = arguments[3] : arguments[3] && dt.indexOf(arguments[3]) == -1 && (E = ct(E, q)), Ta.call(this, u, v, E, X = X || "Identity-H");
};
var ui, ea = r.lineWidth || 0.200025, Hs = p.__private__.getLineWidth = p.getLineWidth = function() {
return ea;
}, Xt = p.__private__.setLineWidth = p.setLineWidth = function(u) {
return ea = u, P(K(z(u)) + " w"), this;
};
p.__private__.setLineDash = Mt.API.setLineDash = Mt.API.setLineDashPattern = function(u, v) {
if (u = u || [], v = v || 0, isNaN(v) || !Array.isArray(u)) throw new Error("Invalid arguments passed to jsPDF.setLineDash");
return u = u.map(function(E) {
return K(z(E));
}).join(" "), v = K(z(v)), P("[" + u + "] " + v + " d"), this;
};
var Ws = p.__private__.getLineHeight = p.getLineHeight = function() {
return yt * ui;
};
p.__private__.getLineHeight = p.getLineHeight = function() {
return yt * ui;
};
var Vs = p.__private__.setLineHeightFactor = p.setLineHeightFactor = function(u) {
return typeof (u = u || 1.15) == "number" && (ui = u), this;
}, Gs = p.__private__.getLineHeightFactor = p.getLineHeightFactor = function() {
return ui;
};
Vs(r.lineHeight);
var wn = p.__private__.getHorizontalCoordinate = function(u) {
return z(u);
}, yn = p.__private__.getVerticalCoordinate = function(u) {
return D === G ? u : Vt[B].mediaBox.topRightY - Vt[B].mediaBox.bottomLeftY - z(u);
}, Ys = p.__private__.getHorizontalCoordinateString = p.getHorizontalCoordinateString = function(u) {
return K(wn(u));
}, Js = p.__private__.getVerticalCoordinateString = p.getVerticalCoordinateString = function(u) {
return K(yn(u));
}, Ti = r.strokeColor || "0 G";
p.__private__.getStrokeColor = p.getDrawColor = function() {
return rn(Ti);
}, p.__private__.setStrokeColor = p.setDrawColor = function(u, v, E, q) {
return Ti = Wr({ ch1: u, ch2: v, ch3: E, ch4: q, pdfColorType: "draw", precision: 2 }), P(Ti), this;
};
var ra = r.fillColor || "0 g";
p.__private__.getFillColor = p.getFillColor = function() {
return rn(ra);
}, p.__private__.setFillColor = p.setFillColor = function(u, v, E, q) {
return ra = Wr({ ch1: u, ch2: v, ch3: E, ch4: q, pdfColorType: "fill", precision: 2 }), P(ra), this;
};
var fi = r.textColor || "0 g", Ks = p.__private__.getTextColor = p.getTextColor = function() {
return rn(fi);
};
p.__private__.setTextColor = p.setTextColor = function(u, v, E, q) {
return fi = Wr({ ch1: u, ch2: v, ch3: E, ch4: q, pdfColorType: "text", precision: 3 }), this;
};
var xn = r.charSpace, Xs = p.__private__.getCharSpace = p.getCharSpace = function() {
return parseFloat(xn || 0);
};
p.__private__.setCharSpace = p.setCharSpace = function(u) {
if (isNaN(u)) throw new Error("Invalid argument passed to jsPDF.setCharSpace");
return xn = u, this;
};
var na = 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(u) {
var v = p.CapJoinStyles[u];
if (v === void 0) throw new Error("Line cap style of '" + u + "' is not recognized. See or extend .CapJoinStyles property for valid styles");
return na = v, P(v + " J"), this;
};
var ia = 0;
p.__private__.setLineJoin = p.setLineJoin = function(u) {
var v = p.CapJoinStyles[u];
if (v === void 0) throw new Error("Line join style of '" + u + "' is not recognized. See or extend .CapJoinStyles property for valid styles");
return ia = v, P(v + " j"), this;
}, p.__private__.setLineMiterLimit = p.__private__.setMiterLimit = p.setLineMiterLimit = p.setMiterLimit = function(u) {
if (u = u || 0, isNaN(u)) throw new Error("Invalid argument passed to jsPDF.setLineMiterLimit");
return P(K(z(u)) + " M"), this;
}, p.GState = Ba, p.setGState = function(u) {
(u = typeof u == "string" ? Yt[Qt[u]] : Ka(null, u)).equals(Ee) || (P("/" + u.id + " gs"), Ee = u);
};
var Ka = function(u, v) {
if (!u || !Qt[u]) {
var E = !1;
for (var q in Yt) if (Yt.hasOwnProperty(q) && Yt[q].equals(v)) {
E = !0;
break;
}
if (E) v = Yt[q];
else {
var X = "GS" + (Object.keys(Yt).length + 1).toString(10);
Yt[X] = v, v.id = X;
}
return u && (Qt[u] = v.id), be.publish("addGState", v), v;
}
};
p.addGState = function(u, v) {
return Ka(u, v), this;
}, p.saveGraphicsState = function() {
return P("q"), Fe.push({ key: jt, size: yt, color: fi }), this;
}, p.restoreGraphicsState = function() {
P("Q");
var u = Fe.pop();
return jt = u.key, yt = u.size, fi = u.color, Ee = null, this;
}, p.setCurrentTransformationMatrix = function(u) {
return P(u.toString() + " cm"), this;
}, p.comment = function(u) {
return P("#" + u), this;
};
var _n = function(u, v) {
var E = u || 0;
Object.defineProperty(this, "x", { enumerable: !0, get: function() {
return E;
}, set: function(dt) {
isNaN(dt) || (E = parseFloat(dt));
} });
var q = v || 0;
Object.defineProperty(this, "y", { enumerable: !0, get: function() {
return q;
}, set: function(dt) {
isNaN(dt) || (q = parseFloat(dt));
} });
var X = "pt";
return Object.defineProperty(this, "type", { enumerable: !0, get: function() {
return X;
}, set: function(dt) {
X = dt.toString();
} }), this;
}, aa = function(u, v, E, q) {
_n.call(this, u, v), this.type = "rect";
var X = E || 0;
Object.defineProperty(this, "w", { enumerable: !0, get: function() {
return X;
}, set: function(vt) {
isNaN(vt) || (X = parseFloat(vt));
} });
var dt = q || 0;
return Object.defineProperty(this, "h", { enumerable: !0, get: function() {
return dt;
}, set: function(vt) {
isNaN(vt) || (dt = parseFloat(vt));
} }), this;
}, Di = function() {
this.page = le, this.currentPage = B, this.pages = _t.slice(0), this.pagesContext = Vt.slice(0), this.x = Tt, this.y = De, this.matrix = pe, this.width = oa(B), this.height = $a(B), this.outputDestination = St, this.id = "", this.objectNumber = -1;
};
Di.prototype.restore = function() {
le = this.page, B = this.currentPage, Vt = this.pagesContext, _t = this.pages, Tt = this.x, De = this.y, pe = this.matrix, Xa(B, this.width), An(B, this.height), St = this.outputDestination;
};
var sa = function(u, v, E, q, X) {
en.push(new Di()), le = B = 0, _t = [], Tt = u, De = v, pe = X, Zi([E, q]);
};
for (var hi in p.beginFormObject = function(u, v, E, q, X) {
return sa(u, v, E, q, X), this;
}, p.endFormObject = function(u) {
return (function(v) {
if (gn[v]) en.pop().restore();
else {
var E = new Di(), q = "Xo" + (Object.keys(fr).length + 1).toString(10);
E.id = q, gn[v] = q, fr[q] = E, be.publish("addFormObject", E), en.pop().restore();
}
})(u), this;
}, p.doFormObject = function(u, v) {
var E = fr[gn[u]];
return P("q"), P(v.toString() + " cm"), P("/" + E.id + " Do"), P("Q"), this;
}, p.getFormObject = function(u) {
var v = fr[gn[u]];
return { x: v.x, y: v.y, width: v.width, height: v.height, matrix: v.matrix };
}, p.save = function(u, v) {
return u = u || "generated.pdf", (v = v || {}).returnPromise = v.returnPromise || !1, v.returnPromise === !1 ? (_i(Mi(sn()), u), typeof _i.unload == "function" && Jt.setTimeout && setTimeout(_i.unload, 911), this) : new Promise(function(E, q) {
try {
var X = _i(Mi(sn()), u);
typeof _i.unload == "function" && Jt.setTimeout && setTimeout(_i.unload, 911), E(X);
} catch (dt) {
q(dt.message);
}
});
}, Mt.API) Mt.API.hasOwnProperty(hi) && (hi === "events" && Mt.API.events.length ? (function(u, v) {
var E, q, X;
for (X = v.length - 1; X !== -1; X--) E = v[X][0], q = v[X][1], u.subscribe.apply(u, [E].concat(typeof q == "function" ? [q] : q));
})(be, Mt.API.events) : p[hi] = Mt.API[hi]);
function oa(u) {
return Vt[u].mediaBox.topRightX - Vt[u].mediaBox.bottomLeftX;
}
function Xa(u, v) {
Vt[u].mediaBox.topRightX = v + Vt[u].mediaBox.bottomLeftX;
}
function $a(u) {
return Vt[u].mediaBox.topRightY - Vt[u].mediaBox.bottomLeftY;
}
function An(u, v) {
Vt[u].mediaBox.topRightY = v + Vt[u].mediaBox.bottomLeftY;
}
var Nn = p.getPageWidth = function(u) {
return oa(u = u || B) / ee;
}, Za = p.setPageWidth = function(u, v) {
Xa(u, v * ee);
}, ci = p.getPageHeight = function(u) {
return $a(u = u || B) / ee;
}, Qa = p.setPageHeight = function(u, v) {
An(u, v * ee);
};
return p.internal = { pdfEscape: Mr, getStyle: Ga, getFont: zs, getFontSize: Ct, getCharSpace: Xs, getTextColor: Ks, getLineHeight: Ws, getLineHeightFactor: Gs, getLineWidth: Hs, write: Lt, getHorizontalCoordinate: wn, getVerticalCoordinate: yn, getCoordinateString: Ys, getVerticalCoordinateString: Js, collections: {}, newObject: Be, newAdditionalObject: ai, newObjectDeferred: nr, newObjectDeferredBegin: ir, getFilters: Vr, putStream: Br, events: be, scaleFactor: ee, pageSize: { getWidth: function() {
return Nn(B);
}, setWidth: function(u) {
Za(B, u);
}, getHeight: function() {
return ci(B);
}, setHeight: function(u) {
Qa(B, u);
} }, encryptionOptions: m, encryption: Xe, getEncryptor: function(u) {
return m !== null ? Xe.encryptor(u, 0) : function(v) {
return v;
};
}, output: Wa, getNumberOfPages: Ua, get pages() {
return _t;
}, out: P, f2: N, f3: F, getPageInfo: bn, getPageInfoByObjId: Va, getCurrentPageInfo: Rs, getPDFVersion: O, Point: _n, Rectangle: aa, Matrix: Gt, hasHotfix: Rr }, Object.defineProperty(p.internal.pageSize, "width", { get: function() {
return Nn(B);
}, set: function(u) {
Za(B, u);
}, enumerable: !0, configurable: !0 }), Object.defineProperty(p.internal.pageSize, "height", { get: function() {
return ci(B);
}, set: function(u) {
Qa(B, u);
}, enumerable: !0, configurable: !0 }), function(u) {
for (var v = 0, E = Ht.length; v < E; v++) {
var q = Ta.call(this, u[v][0], u[v][1], u[v][2], Ht[v][3], !0);
_ === !1 && (k[q] = !0);
var X = u[v][0].split("-");
Ra({ id: q, fontName: X[0], fontStyle: X[1] || "" });
}
be.publish("addFonts", { fonts: se, dictionary: oe });
}.call(p, Ht), jt = "F1", Da(o, e), be.publish("initialized"), p;
}
Ji.prototype.lsbFirstWord = function(r) {
return String.fromCharCode(255 & r, r >> 8 & 255, r >> 16 & 255, r >> 24 & 255);
}, Ji.prototype.toHexString = function(r) {
return r.split("").map(function(t) {
return ("0" + (255 & t.charCodeAt(0)).toString(16)).slice(-2);
}).join("");
}, Ji.prototype.hexToBytes = function(r) {
for (var t = [], e = 0; e < r.length; e += 2) t.push(String.fromCharCode(parseInt(r.substr(e, 2), 16)));
return t.join("");
}, Ji.prototype.processOwnerPassword = function(r, t) {
return Ho(zo(t).substr(0, 5), r);
}, Ji.prototype.encryptor = function(r, t) {
var e = zo(this.encryptionKey + String.fromCharCode(255 & r, r >> 8 & 255, r >> 16 & 255, 255 & t, t >> 8 & 255)).substr(0, 10);
return function(i) {
return Ho(e, i);
};
}, Ba.prototype.equals = function(r) {
var t, e = "id,objectNumber,equals";
if (!r || _e(r) !== _e(this)) return !1;
var i = 0;
for (t in this) if (!(e.indexOf(t) >= 0)) {
if (this.hasOwnProperty(t) && !r.hasOwnProperty(t) || this[t] !== r[t]) return !1;
i++;
}
for (t in r) r.hasOwnProperty(t) && e.indexOf(t) < 0 && i--;
return i === 0;
}, Mt.API = { events: [] }, Mt.version = "3.0.4";
var Te = Mt.API, Xo = 1, Fi = function(r) {
return r.replace(/\\/g, "\\\\").replace(/\(/g, "\\(").replace(/\)/g, "\\)");
}, Gi = function(r) {
return r.replace(/\\\\/g, "\\").replace(/\\\(/g, "(").replace(/\\\)/g, ")");
}, $t = function(r) {
return r.toFixed(2);
}, Qn = function(r) {
return r.toFixed(5);
};
Te.__acroform__ = {};
var _r = function(r, t) {
r.prototype = Object.create(t.prototype), r.prototype.constructor = r;
}, Pu = function(r) {
return r * Xo;
}, cn = function(r) {
var t = new Cf(), e = It.internal.getHeight(r) || 0, i = It.internal.getWidth(r) || 0;
return t.BBox = [0, 0, Number($t(i)), Number($t(e))], t;
}, E1 = Te.__acroform__.setBit = function(r, t) {
if (r = r || 0, t = t || 0, isNaN(r) || isNaN(t)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBit");
return r | 1 << t;
}, O1 = Te.__acroform__.clearBit = function(r, t) {
if (r = r || 0, t = t || 0, isNaN(r) || isNaN(t)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBit");
return r & ~(1 << t);
}, j1 = Te.__acroform__.getBit = function(r, t) {
if (isNaN(r) || isNaN(t)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBit");
return r & 1 << t ? 1 : 0;
}, We = Te.__acroform__.getBitForPdf = function(r, t) {
if (isNaN(r) || isNaN(t)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.getBitForPdf");
return j1(r, t - 1);
}, Ve = Te.__acroform__.setBitForPdf = function(r, t) {
if (isNaN(r) || isNaN(t)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.setBitForPdf");
return E1(r, t - 1);
}, Ge = Te.__acroform__.clearBitForPdf = function(r, t) {
if (isNaN(r) || isNaN(t)) throw new Error("Invalid arguments passed to jsPDF.API.__acroform__.clearBitForPdf");
return O1(r, t - 1);
}, B1 = Te.__acroform__.calculateCoordinates = function(r, t) {
var e = t.internal.getHorizontalCoordinate, i = t.internal.getVerticalCoordinate, o = r[0], a = r[1], c = r[2], l = r[3], h = {};
return h.lowerLeft_X = e(o) || 0, h.lowerLeft_Y = i(a + l) || 0, h.upperRight_X = e(o + c) || 0, h.upperRight_Y = i(a) || 0, [Number($t(h.lowerLeft_X)), Number($t(h.lowerLeft_Y)), Number($t(h.upperRight_X)), Number($t(h.upperRight_Y))];
}, M1 = function(r) {
if (r.appearanceStreamContent) return r.appearanceStreamContent;
if (r.V || r.DV) {
var t = [], e = r._V || r.DV, i = Wo(r, e), o = r.scope.internal.getFont(r.fontName, r.fontStyle).id;
t.push("/Tx BMC"), t.push("q"), t.push("BT"), t.push(r.scope.__private__.encodeColorString(r.color)), t.push("/" + o + " " + $t(i.fontSize) + " Tf"), t.push("1 0 0 1 0 0 Tm"), t.push(i.text), t.push("ET"), t.push("Q"), t.push("EMC");
var a = cn(r);
return a.scope = r.scope, a.stream = t.join(`
`), a;
}
}, Wo = function(r, t) {
var e = r.fontSize === 0 ? r.maxFontSize : r.fontSize, i = { text: "", fontSize: "" }, o = (t = (t = t.substr(0, 1) == "(" ? t.substr(1) : t).substr(t.length - 1) == ")" ? t.substr(0, t.length - 1) : t).split(" ");
o = r.multiline ? o.map(function(N) {
return N.split(`
`);
}) : o.map(function(N) {
return [N];
});
var a = e, c = It.internal.getHeight(r) || 0;
c = c < 0 ? -c : c;
var l = It.internal.getWidth(r) || 0;
l = l < 0 ? -l : l;
var h = function(N, F, z) {
if (N + 1 < o.length) {
var U = F + " " + o[N + 1][0];
return Ls(U, r, z).width <= l - 4;
}
return !1;
};
a++;
t: for (; a > 0; ) {
t = "", a--;
var d, m, _ = Ls("3", r, a).height, k = r.multiline ? c - a : (c - _) / 2, p = k += 2, j = 0, O = 0, M = 0;
if (a <= 0) {
t = `(...) Tj
`, t += "% Width of Text: " + Ls(t, r, a = 12).width + ", FieldWidth:" + l + `
`;
break;
}
for (var S = "", V = 0, G = 0; G < o.length; G++) if (o.hasOwnProperty(G)) {
var D = !1;
if (o[G].length !== 1 && M !== o[G].length - 1) {
if ((_ + 2) * (V + 2) + 2 > c) continue t;
S += o[G][M], D = !0, O = G, G--;
} else {
S = (S += o[G][M] + " ").substr(S.length - 1) == " " ? S.substr(0, S.length - 1) : S;
var it = parseInt(G), mt = h(it, S, a), ct = G >= o.length - 1;
if (mt && !ct) {
S += " ", M = 0;
continue;
}
if (mt || ct) {
if (ct) O = it;
else if (r.multiline && (_ + 2) * (V + 2) + 2 > c) continue t;
} else {
if (!r.multiline || (_ + 2) * (V + 2) + 2 > c) continue t;
O = it;
}
}
for (var K = "", R = j; R <= O; R++) {
var tt = o[R];
if (r.multiline) {
if (R === O) {
K += tt[M] + " ", M = (M + 1) % tt.length;
continue;
}
if (R === j) {
K += tt[tt.length - 1] + " ";
continue;
}
}
K += tt[0] + " ";
}
switch (K = K.substr(K.length - 1) == " " ? K.substr(0, K.length - 1) : K, m = Ls(K, r, a).width, r.textAlign) {
case "right":
d = l - m - 2;
break;
case "center":
d = (l - m) / 2;
break;
default:
d = 2;
}
t += $t(d) + " " + $t(p) + ` Td
`, t += "(" + Fi(K) + `) Tj
`, t += -$t(d) + ` 0 Td
`, p = -(a + 2), m = 0, j = D ? O : O + 1, V++, S = "";
}
break;
}
return i.text = t, i.fontSize = a, i;
}, Ls = function(r, t, e) {
var i = t.scope.internal.getFont(t.fontName, t.fontStyle), o = t.scope.getStringUnitWidth(r, { font: i, fontSize: parseFloat(e), charSpace: 0 }) * parseFloat(e);
return { height: t.scope.getStringUnitWidth("3", { font: i, fontSize: parseFloat(e), charSpace: 0 }) * parseFloat(e) * 1.5, width: o };
}, R1 = { fields: [], xForms: [], acroFormDictionaryRoot: null, printedOut: !1, internal: null, isInitialized: !1 }, T1 = function(r, t) {
var e = { type: "reference", object: r };
t.internal.getPageInfo(r.page).pageContext.annotations.find(function(i) {
return i.type === e.type && i.object === e.object;
}) === void 0 && t.internal.getPageInfo(r.page).pageContext.annotations.push(e);
}, D1 = function(r, t) {
if (t.scope = r, r.internal !== void 0 && (r.internal.acroformPlugin === void 0 || r.internal.acroformPlugin.isInitialized === !1)) {
if (Qr.FieldNum = 0, r.internal.acroformPlugin = JSON.parse(JSON.stringify(R1)), r.internal.acroformPlugin.acroFormDictionaryRoot) throw new Error("Exception while creating AcroformDictionary");
Xo = r.internal.scaleFactor, r.internal.acroformPlugin.acroFormDictionaryRoot = new Ff(), r.internal.acroformPlugin.acroFormDictionaryRoot.scope = r, r.internal.acroformPlugin.acroFormDictionaryRoot._eventID = r.internal.events.subscribe("postPutResources", function() {
(function(e) {
e.internal.events.unsubscribe(e.internal.acroformPlugin.acroFormDictionaryRoot._eventID), delete e.internal.acroformPlugin.acroFormDictionaryRoot._eventID, e.internal.acroformPlugin.printedOut = !0;
})(r);
}), r.internal.events.subscribe("buildDocument", function() {
(function(e) {
e.internal.acroformPlugin.acroFormDictionaryRoot.objId = void 0;
var i = e.internal.acroformPlugin.acroFormDictionaryRoot.Fields;
for (var o in i) if (i.hasOwnProperty(o)) {
var a = i[o];
a.objId = void 0, a.hasAnnotation && T1(a, e);
}
})(r);
}), r.internal.events.subscribe("putCatalog", function() {
(function(e) {
if (e.internal.acroformPlugin.acroFormDictionaryRoot === void 0) throw new Error("putCatalogCallback: Root missing.");
e.internal.write("/AcroForm " + e.internal.acroformPlugin.acroFormDictionaryRoot.objId + " 0 R");
})(r);
}), r.internal.events.subscribe("postPutPages", function(e) {
(function(i, o) {
var a = !i;
for (var c in i || (o.internal.newObjectDeferredBegin(o.internal.acroformPlugin.acroFormDictionaryRoot.objId, !0), o.internal.acroformPlugin.acroFormDictionaryRoot.putStream()), i = i || o.internal.acroformPlugin.acroFormDictionaryRoot.Kids) if (i.hasOwnProperty(c)) {
var l = i[c], h = [], d = l.Rect;
if (l.Rect && (l.Rect = B1(l.Rect, o)), o.internal.newObjectDeferredBegin(l.objId, !0), l.DA = It.createDefaultAppearanceStream(l), _e(l) === "object" && typeof l.getKeyValueListForStream == "function" && (h = l.getKeyValueListForStream()), l.Rect = d, l.hasAppearanceStream && !l.appearanceStreamContent) {
var m = M1(l);
h.push({ key: "AP", value: "<</N " + m + ">>" }), o.internal.acroformPlugin.xForms.push(m);
}
if (l.appearanceStreamContent) {
var _ = "";
for (var k in l.appearanceStreamContent) if (l.appearanceStreamContent.hasOwnProperty(k)) {
var p = l.appearanceStreamContent[k];
if (_ += "/" + k + " ", _ += "<<", Object.keys(p).length >= 1 || Array.isArray(p)) {
for (var c in p) if (p.hasOwnProperty(c)) {
var j = p[c];
typeof j == "function" && (j = j.call(o, l)), _ += "/" + c + " " + j + " ", o.internal.acroformPlugin.xForms.indexOf(j) >= 0 || o.internal.acroformPlugin.xForms.push(j);
}
} else typeof (j = p) == "function" && (j = j.call(o, l)), _ += "/" + c + " " + j, o.internal.acroformPlugin.xForms.indexOf(j) >= 0 || o.internal.acroformPlugin.xForms.push(j);
_ += ">>";
}
h.push({ key: "AP", value: `<<
` + _ + ">>" });
}
o.internal.putStream({ additionalKeyValues: h, objectId: l.objId }), o.internal.out("endobj");
}
a && (function(O, M) {
for (var S in O) if (O.hasOwnProperty(S)) {
var V = S, G = O[S];
M.internal.newObjectDeferredBegin(G.objId, !0), _e(G) === "object" && typeof G.putStream == "function" && G.putStream(), delete O[V];
}
})(o.internal.acroformPlugin.xForms, o);
})(e, r);
}), r.internal.acroformPlugin.isInitialized = !0;
}
}, If = Te.__acroform__.arrayToPdfArray = function(r, t, e) {
var i = function(c) {
return c;
};
if (Array.isArray(r)) {
for (var o = "[", a = 0; a < r.length; a++) switch (a !== 0 && (o += " "), _e(r[a])) {
case "boolean":
case "number":
case "object":
o += r[a].toString();
break;
case "string":
r[a].substr(0, 1) !== "/" ? (t !== void 0 && e && (i = e.internal.getEncryptor(t)), o += "(" + Fi(i(r[a].toString())) + ")") : o += r[a].toString();
}
return o + "]";
}
throw new Error("Invalid argument passed to jsPDF.__acroform__.arrayToPdfArray");
}, Co = function(r, t, e) {
var i = function(o) {
return o;
};
return t !== void 0 && e && (i = e.internal.getEncryptor(t)), (r = r || "").toString(), "(" + Fi(i(r)) + ")";
}, dn = 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 });
};
dn.prototype.toString = function() {
return this.objId + " 0 R";
}, dn.prototype.putStream = function() {
var r = this.getKeyValueListForStream();
this.scope.internal.putStream({ data: this.stream, additionalKeyValues: r, objectId: this.objId }), this.scope.internal.out("endobj");
}, dn.prototype.getKeyValueListForStream = function() {
var r = [], t = Object.getOwnPropertyNames(this).filter(function(a) {
return a != "content" && a != "appearanceStreamContent" && a != "scope" && a != "objId" && a.substring(0, 1) != "_";
});
for (var e in t) if (Object.getOwnPropertyDescriptor(this, t[e]).configurable === !1) {
var i = t[e], o = this[i];
o && (Array.isArray(o) ? r.push({ key: i, value: If(o, this.objId, this.scope) }) : o instanceof dn ? (o.scope = this.scope, r.push({ key: i, value: o.objId + " 0 R" })) : typeof o != "function" && r.push({ key: i, value: o }));
}
return r;
};
var Cf = function() {
dn.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, t = [];
Object.defineProperty(this, "BBox", { configurable: !1, get: function() {
return t;
}, set: function(e) {
t = e;
} }), Object.defineProperty(this, "Resources", { value: "2 0 R", configurable: !1, writable: !0 }), Object.defineProperty(this, "stream", { enumerable: !1, configurable: !0, set: function(e) {
r = e.trim();
}, get: function() {
return r || null;
} });
};
_r(Cf, dn);
var Ff = function() {
dn.call(this);
var r, t = [];
Object.defineProperty(this, "Kids", { enumerable: !1, configurable: !0, get: function() {
return t.length > 0 ? t : void 0;
} }), Object.defineProperty(this, "Fields", { enumerable: !1, configurable: !1, get: function() {
return t;
} }), Object.defineProperty(this, "DA", { enumerable: !1, configurable: !1, get: function() {
if (r) {
var e = function(i) {
return i;
};
return this.scope && (e = this.scope.internal.getEncryptor(this.objId)), "(" + Fi(e(r)) + ")";
}
}, set: function(e) {
r = e;
} });
};
_r(Ff, dn);
var Qr = function r() {
dn.call(this);
var t = 4;
Object.defineProperty(this, "F", { enumerable: !1, configurable: !1, get: function() {
return t;
}, set: function(S) {
if (isNaN(S)) throw new Error('Invalid value "' + S + '" for attribute F supplied.');
t = S;
} }), Object.defineProperty(this, "showWhenPrinted", { enumerable: !0, configurable: !0, get: function() {
return !!We(t, 3);
}, set: function(S) {
S ? this.F = Ve(t, 3) : this.F = Ge(t, 3);
} });
var e = 0;
Object.defineProperty(this, "Ff", { enumerable: !1, configurable: !1, get: function() {
return e;
}, set: function(S) {
if (isNaN(S)) throw new Error('Invalid value "' + S + '" for attribute Ff supplied.');
e = S;
} });
var i = [];
Object.defineProperty(this, "Rect", { enumerable: !1, configurable: !1, get: function() {
if (i.length !== 0) return i;
}, set: function(S) {
i = S !== void 0 ? S : [];
} }), Object.defineProperty(this, "x", { enumerable: !0, configurable: !0, get: function() {
return !i || isNaN(i[0]) ? 0 : i[0];
}, set: function(S) {
i[0] = S;
} }), Object.defineProperty(this, "y", { enumerable: !0, configurable: !0, get: function() {
return !i || isNaN(i[1]) ? 0 : i[1];
}, set: function(S) {
i[1] = S;
} }), Object.defineProperty(this, "width", { enumerable: !0, configurable: !0, get: function() {
return !i || isNaN(i[2]) ? 0 : i[2];
}, set: function(S) {
i[2] = S;
} }), Object.defineProperty(this, "height", { enumerable: !0, configurable: !0, get: function() {
return !i || isNaN(i[3]) ? 0 : i[3];
}, set: function(S) {
i[3] = S;
} });
var o = "";
Object.defineProperty(this, "FT", { enumerable: !0, configurable: !1, get: function() {
return o;
}, set: function(S) {
switch (S) {
case "/Btn":
case "/Tx":
case "/Ch":
case "/Sig":
o = S;
break;
default:
throw new Error('Invalid value "' + S + '" for attribute FT supplied.');
}
} });
var a = null;
Object.defineProperty(this, "T", { enumerable: !0, configurable: !1, get: function() {
if (!a || a.length < 1) {
if (this instanceof Es) return;
a = "FieldObject" + r.FieldNum++;
}
var S = function(V) {
return V;
};
return this.scope && (S = this.scope.internal.getEncryptor(this.objId)), "(" + Fi(S(a)) + ")";
}, set: function(S) {
a = S.toString();
} }), Object.defineProperty(this, "fieldName", { configurable: !0, enumerable: !0, get: function() {
return a;
}, set: function(S) {
a = S;
} });
var c = "helvetica";
Object.defineProperty(this, "fontName", { enumerable: !0, configurable: !0, get: function() {
return c;
}, set: function(S) {
c = S;
} });
var l = "normal";
Object.defineProperty(this, "fontStyle", { enumerable: !0, configurable: !0, get: function() {
return l;
}, set: function(S) {
l = S;
} });
var h = 0;
Object.defineProperty(this, "fontSize", { enumerable: !0, configurable: !0, get: function() {
return h;
}, set: function(S) {
h = S;
} });
var d = void 0;
Object.defineProperty(this, "maxFontSize", { enumerable: !0, configurable: !0, get: function() {
return d === void 0 ? 50 / Xo : d;
}, set: function(S) {
d = S;
} });
var m = "black";
Object.defineProperty(this, "color", { enumerable: !0, configurable: !0, get: function() {
return m;
}, set: function(S) {
m = S;
} });
var _ = "/F1 0 Tf 0 g";
Object.defineProperty(this, "DA", { enumerable: !0, configurable: !1, get: function() {
if (!(!_ || this instanceof Es || this instanceof ri)) return Co(_, this.objId, this.scope);
}, set: function(S) {
S = S.toString(), _ = S;
} });
var k = null;
Object.defineProperty(this, "DV", { enumerable: !1, configurable: !1, get: function() {
if (k) return this instanceof rr == 0 ? Co(k, this.objId, this.scope) : k;
}, set: function(S) {
S = S.toString(), k = this instanceof rr == 0 ? S.substr(0, 1) === "(" ? Gi(S.substr(1, S.length - 2)) : Gi(S) : S;
} }), Object.defineProperty(this, "defaultValue", { enumerable: !0, configurable: !0, get: function() {
return this instanceof rr == 1 ? Gi(k.substr(1, k.length - 1)) : k;
}, set: function(S) {
S = S.toString(), k = this instanceof rr == 1 ? "/" + S : S;
} });
var p = null;
Object.defineProperty(this, "_V", { enumerable: !1, configurable: !1, get: function() {
if (p) return p;
}, set: function(S) {
this.V = S;
} }), Object.defineProperty(this, "V", { enumerable: !1, configurable: !1, get: function() {
if (p) return this instanceof rr == 0 ? Co(p, this.objId, this.scope) : p;
}, set: function(S) {
S = S.toString(), p = this instanceof rr == 0 ? S.substr(0, 1) === "(" ? Gi(S.substr(1, S.length - 2)) : Gi(S) : S;
} }), Object.defineProperty(this, "value", { enumerable: !0, configurable: !0, get: function() {
return this instanceof rr == 1 ? Gi(p.substr(1, p.length - 1)) : p;
}, set: function(S) {
S = S.toString(), p = this instanceof rr == 1 ? "/" + S : S;
} }), 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 j, O = !1;
Object.defineProperty(this, "hasAppearanceStream", { enumerable: !0, configurable: !0, get: function() {
return O;
}, set: function(S) {
S = !!S, O = S;
} }), Object.defineProperty(this, "page", { enumerable: !0, configurable: !0, get: function() {
if (j) return j;
}, set: function(S) {
j = S;
} }), Object.defineProperty(this, "readOnly", { enumerable: !0, configurable: !0, get: function() {
return !!We(this.Ff, 1);
}, set: function(S) {
S ? this.Ff = Ve(this.Ff, 1) : this.Ff = Ge(this.Ff, 1);
} }), Object.defineProperty(this, "required", { enumerable: !0, configurable: !0, get: function() {
return !!We(this.Ff, 2);
}, set: function(S) {
S ? this.Ff = Ve(this.Ff, 2) : this.Ff = Ge(this.Ff, 2);
} }), Object.defineProperty(this, "noExport", { enumerable: !0, configurable: !0, get: function() {
return !!We(this.Ff, 3);
}, set: function(S) {
S ? this.Ff = Ve(this.Ff, 3) : this.Ff = Ge(this.Ff, 3);
} });
var M = null;
Object.defineProperty(this, "Q", { enumerable: !0, configurable: !1, get: function() {
if (M !== null) return M;
}, set: function(S) {
if ([0, 1, 2].indexOf(S) === -1) throw new Error('Invalid value "' + S + '" for attribute Q supplied.');
M = S;
} }), Object.defineProperty(this, "textAlign", { get: function() {
var S;
switch (M) {
case 0:
default:
S = "left";
break;
case 1:
S = "center";
break;
case 2:
S = "right";
}
return S;
}, configurable: !0, enumerable: !0, set: function(S) {
switch (S) {
case "right":
case 2:
M = 2;
break;
case "center":
case 1:
M = 1;
break;
default:
M = 0;
}
} });
};
_r(Qr, dn);
var Ni = function() {
Qr.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(e) {
r = e;
} }), Object.defineProperty(this, "topIndex", { enumerable: !0, configurable: !0, get: function() {
return r;
}, set: function(e) {
r = e;
} });
var t = [];
Object.defineProperty(this, "Opt", { enumerable: !0, configurable: !1, get: function() {
return If(t, this.objId, this.scope);
}, set: function(e) {
var i, o;
o = [], typeof (i = e) == "string" && (o = (function(a, c, l) {
l || (l = 1);
for (var h, d = []; h = c.exec(a); ) d.push(h[l]);
return d;
})(i, /\((.*?)\)/g)), t = o;
} }), this.getOptions = function() {
return t;
}, this.setOptions = function(e) {
t = e, this.sort && t.sort();
}, this.addOption = function(e) {
e = (e = e || "").toString(), t.push(e), this.sort && t.sort();
}, this.removeOption = function(e, i) {
for (i = i || !1, e = (e = e || "").toString(); t.indexOf(e) !== -1 && (t.splice(t.indexOf(e), 1), i !== !1); ) ;
}, Object.defineProperty(this, "combo", { enumerable: !0, configurable: !0, get: function() {
return !!We(this.Ff, 18);
}, set: function(e) {
e ? this.Ff = Ve(this.Ff, 18) : this.Ff = Ge(this.Ff, 18);
} }), Object.defineProperty(this, "edit", { enumerable: !0, configurable: !0, get: function() {
return !!We(this.Ff, 19);
}, set: function(e) {
this.combo === !0 && (e ? this.Ff = Ve(this.Ff, 19) : this.Ff = Ge(this.Ff, 19));
} }), Object.defineProperty(this, "sort", { enumerable: !0, configurable: !0, get: function() {
return !!We(this.Ff, 20);
}, set: function(e) {
e ? (this.Ff = Ve(this.Ff, 20), t.sort()) : this.Ff = Ge(this.Ff, 20);
} }), Object.defineProperty(this, "multiSelect", { enumerable: !0, configurable: !0, get: function() {
return !!We(this.Ff, 22);
}, set: function(e) {
e ? this.Ff = Ve(this.Ff, 22) : this.Ff = Ge(this.Ff, 22);
} }), Object.defineProperty(this, "doNotSpellCheck", { enumerable: !0, configurable: !0, get: function() {
return !!We(this.Ff, 23);
}, set: function(e) {
e ? this.Ff = Ve(this.Ff, 23) : this.Ff = Ge(this.Ff, 23);
} }), Object.defineProperty(this, "commitOnSelChange", { enumerable: !0, configurable: !0, get: function() {
return !!We(this.Ff, 27);
}, set: function(e) {
e ? this.Ff = Ve(this.Ff, 27) : this.Ff = Ge(this.Ff, 27);
} }), this.hasAppearanceStream = !1;
};
_r(Ni, Qr);
var Li = function() {
Ni.call(this), this.fontName = "helvetica", this.combo = !1;
};
_r(Li, Ni);
var Si = function() {
Li.call(this), this.combo = !0;
};
_r(Si, Li);
var Ia = function() {
Si.call(this), this.edit = !0;
};
_r(Ia, Si);
var rr = function() {
Qr.call(this), this.FT = "/Btn", Object.defineProperty(this, "noToggleToOff", { enumerable: !0, configurable: !0, get: function() {
return !!We(this.Ff, 15);
}, set: function(e) {
e ? this.Ff = Ve(this.Ff, 15) : this.Ff = Ge(this.Ff, 15);
} }), Object.defineProperty(this, "radio", { enumerable: !0, configurable: !0, get: function() {
return !!We(this.Ff, 16);
}, set: function(e) {
e ? this.Ff = Ve(this.Ff, 16) : this.Ff = Ge(this.Ff, 16);
} }), Object.defineProperty(this, "pushButton", { enumerable: !0, configurable: !0, get: function() {
return !!We(this.Ff, 17);
}, set: function(e) {
e ? this.Ff = Ve(this.Ff, 17) : this.Ff = Ge(this.Ff, 17);
} }), Object.defineProperty(this, "radioIsUnison", { enumerable: !0, configurable: !0, get: function() {
return !!We(this.Ff, 26);
}, set: function(e) {
e ? this.Ff = Ve(this.Ff, 26) : this.Ff = Ge(this.Ff, 26);
} });
var r, t = {};
Object.defineProperty(this, "MK", { enumerable: !1, configurable: !1, get: function() {
var e = function(a) {
return a;
};
if (this.scope && (e = this.scope.internal.getEncryptor(this.objId)), Object.keys(t).length !== 0) {
var i, o = [];
for (i in o.push("<<"), t) o.push("/" + i + " (" + Fi(e(t[i])) + ")");
return o.push(">>"), o.join(`
`);
}
}, set: function(e) {
_e(e) === "object" && (t = e);
} }), Object.defineProperty(this, "caption", { enumerable: !0, configurable: !0, get: function() {
return t.CA || "";
}, set: function(e) {
typeof e == "string" && (t.CA = e);
} }), Object.defineProperty(this, "AS", { enumerable: !1, configurable: !1, get: function() {
return r;
}, set: function(e) {
r = e;
} }), Object.defineProperty(this, "appearanceState", { enumerable: !0, configurable: !0, get: function() {
return r.substr(1, r.length - 1);
}, set: function(e) {
r = "/" + e;
} });
};
_r(rr, Qr);
var Ca = function() {
rr.call(this), this.pushButton = !0;
};
_r(Ca, rr);
var ki = function() {
rr.call(this), this.radio = !0, this.pushButton = !1;
var r = [];
Object.defineProperty(this, "Kids", { enumerable: !0, configurable: !1, get: function() {
return r;
}, set: function(t) {
r = t !== void 0 ? t : [];
} });
};
_r(ki, rr);
var Es = function() {
var r, t;
Qr.call(this), Object.defineProperty(this, "Parent", { enumerable: !1, configurable: !1, get: function() {
return r;
}, set: function(o) {
r = o;
} }), Object.defineProperty(this, "optionName", { enumerable: !1, configurable: !0, get: function() {
return t;
}, set: function(o) {
t = o;
} });
var e, i = {};
Object.defineProperty(this, "MK", { enumerable: !1, configurable: !1, get: function() {
var o = function(l) {
return l;
};
this.scope && (o = this.scope.internal.getEncryptor(this.objId));
var a, c = [];
for (a in c.push("<<"), i) c.push("/" + a + " (" + Fi(o(i[a])) + ")");
return c.push(">>"), c.join(`
`);
}, set: function(o) {
_e(o) === "object" && (i = o);
} }), Object.defineProperty(this, "caption", { enumerable: !0, configurable: !0, get: function() {
return i.CA || "";
}, set: function(o) {
typeof o == "string" && (i.CA = o);
} }), Object.defineProperty(this, "AS", { enumerable: !1, configurable: !1, get: function() {
return e;
}, set: function(o) {
e = o;
} }), Object.defineProperty(this, "appearanceState", { enumerable: !0, configurable: !0, get: function() {
return e.substr(1, e.length - 1);
}, set: function(o) {
e = "/" + o;
} }), this.caption = "l", this.appearanceState = "Off", this._AppearanceType = It.RadioButton.Circle, this.appearanceStreamContent = this._AppearanceType.createAppearanceStream(this.optionName);
};
_r(Es, Qr), ki.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 t in this.Kids) if (this.Kids.hasOwnProperty(t)) {
var e = this.Kids[t];
e.appearanceStreamContent = r.createAppearanceStream(e.optionName), e.caption = r.getCA();
}
}, ki.prototype.createOption = function(r) {
var t = new Es();
return t.Parent = this, t.optionName = r, this.Kids.push(t), q1.call(this.scope, t), t;
};
var Fa = function() {
rr.call(this), this.fontName = "zapfdingbats", this.caption = "3", this.appearanceState = "On", this.value = "On", this.textAlign = "center", this.appearanceStreamContent = It.CheckBox.createAppearanceStream();
};
_r(Fa, rr);
var ri = function() {
Qr.call(this), this.FT = "/Tx", Object.defineProperty(this, "multiline", { enumerable: !0, configurable: !0, get: function() {
return !!We(this.Ff, 13);
}, set: function(t) {
t ? this.Ff = Ve(this.Ff, 13) : this.Ff = Ge(this.Ff, 13);
} }), Object.defineProperty(this, "fileSelect", { enumerable: !0, configurable: !0, get: function() {
return !!We(this.Ff, 21);
}, set: function(t) {
t ? this.Ff = Ve(this.Ff, 21) : this.Ff = Ge(this.Ff, 21);
} }), Object.defineProperty(this, "doNotSpellCheck", { enumerable: !0, configurable: !0, get: function() {
return !!We(this.Ff, 23);
}, set: function(t) {
t ? this.Ff = Ve(this.Ff, 23) : this.Ff = Ge(this.Ff, 23);
} }), Object.defineProperty(this, "doNotScroll", { enumerable: !0, configurable: !0, get: function() {
return !!We(this.Ff, 24);
}, set: function(t) {
t ? this.Ff = Ve(this.Ff, 24) : this.Ff = Ge(this.Ff, 24);
} }), Object.defineProperty(this, "comb", { enumerable: !0, configurable: !0, get: function() {
return !!We(this.Ff, 25);
}, set: function(t) {
t ? this.Ff = Ve(this.Ff, 25) : this.Ff = Ge(this.Ff, 25);
} }), Object.defineProperty(this, "richText", { enumerable: !0, configurable: !0, get: function() {
return !!We(this.Ff, 26);
}, set: function(t) {
t ? this.Ff = Ve(this.Ff, 26) : this.Ff = Ge(this.Ff, 26);
} });
var r = null;
Object.defineProperty(this, "MaxLen", { enumerable: !0, configurable: !1, get: function() {
return r;
}, set: function(t) {
r = t;
} }), Object.defineProperty(this, "maxLength", { enumerable: !0, configurable: !0, get: function() {
return r;
}, set: function(t) {
Number.isInteger(t) && (r = t);
} }), Object.defineProperty(this, "hasAppearanceStream", { enumerable: !0, configurable: !0, get: function() {
return this.V || this.DV;
} });
};
_r(ri, Qr);
var Ea = function() {
ri.call(this), Object.defineProperty(this, "password", { enumerable: !0, configurable: !0, get: function() {
return !!We(this.Ff, 14);
}, set: function(r) {
r ? this.Ff = Ve(this.Ff, 14) : this.Ff = Ge(this.Ff, 14);
} }), this.password = !0;
};
_r(Ea, ri);
var It = { CheckBox: { createAppearanceStream: function() {
return { N: { On: It.CheckBox.YesNormal }, D: { On: It.CheckBox.YesPushDown, Off: It.CheckBox.OffPushDown } };
}, YesPushDown: function(r) {
var t = cn(r);
t.scope = r.scope;
var e = [], i = r.scope.internal.getFont(r.fontName, r.fontStyle).id, o = r.scope.__private__.encodeColorString(r.color), a = Wo(r, r.caption);
return e.push("0.749023 g"), e.push("0 0 " + $t(It.internal.getWidth(r)) + " " + $t(It.internal.getHeight(r)) + " re"), e.push("f"), e.push("BMC"), e.push("q"), e.push("0 0 1 rg"), e.push("/" + i + " " + $t(a.fontSize) + " Tf " + o), e.push("BT"), e.push(a.text), e.push("ET"), e.push("Q"), e.push("EMC"), t.stream = e.join(`
`), t;
}, YesNormal: function(r) {
var t = cn(r);
t.scope = r.scope;
var e = r.scope.internal.getFont(r.fontName, r.fontStyle).id, i = r.scope.__private__.encodeColorString(r.color), o = [], a = It.internal.getHeight(r), c = It.internal.getWidth(r), l = Wo(r, r.caption);
return o.push("1 g"), o.push("0 0 " + $t(c) + " " + $t(a) + " re"), o.push("f"), o.push("q"), o.push("0 0 1 rg"), o.push("0 0 " + $t(c - 1) + " " + $t(a - 1) + " re"), o.push("W"), o.push("n"), o.push("0 g"), o.push("BT"), o.push("/" + e + " " + $t(l.fontSize) + " Tf " + i), o.push(l.text), o.push("ET"), o.push("Q"), t.stream = o.join(`
`), t;
}, OffPushDown: function(r) {
var t = cn(r);
t.scope = r.scope;
var e = [];
return e.push("0.749023 g"), e.push("0 0 " + $t(It.internal.getWidth(r)) + " " + $t(It.internal.getHeight(r)) + " re"), e.push("f"), t.stream = e.join(`
`), t;
} }, RadioButton: { Circle: { createAppearanceStream: function(r) {
var t = { D: { Off: It.RadioButton.Circle.OffPushDown }, N: {} };
return t.N[r] = It.RadioButton.Circle.YesNormal, t.D[r] = It.RadioButton.Circle.YesPushDown, t;
}, getCA: function() {
return "l";
}, YesNormal: function(r) {
var t = cn(r);
t.scope = r.scope;
var e = [], i = It.internal.getWidth(r) <= It.internal.getHeight(r) ? It.internal.getWidth(r) / 4 : It.internal.getHeight(r) / 4;
i = Number((0.9 * i).toFixed(5));
var o = It.internal.Bezier_C, a = Number((i * o).toFixed(5));
return e.push("q"), e.push("1 0 0 1 " + Qn(It.internal.getWidth(r) / 2) + " " + Qn(It.internal.getHeight(r) / 2) + " cm"), e.push(i + " 0 m"), e.push(i + " " + a + " " + a + " " + i + " 0 " + i + " c"), e.push("-" + a + " " + i + " -" + i + " " + a + " -" + i + " 0 c"), e.push("-" + i + " -" + a + " -" + a + " -" + i + " 0 -" + i + " c"), e.push(a + " -" + i + " " + i + " -" + a + " " + i + " 0 c"), e.push("f"), e.push("Q"), t.stream = e.join(`
`), t;
}, YesPushDown: function(r) {
var t = cn(r);
t.scope = r.scope;
var e = [], i = It.internal.getWidth(r) <= It.internal.getHeight(r) ? It.internal.getWidth(r) / 4 : It.internal.getHeight(r) / 4;
i = Number((0.9 * i).toFixed(5));
var o = Number((2 * i).toFixed(5)), a = Number((o * It.internal.Bezier_C).toFixed(5)), c = Number((i * It.internal.Bezier_C).toFixed(5));
return e.push("0.749023 g"), e.push("q"), e.push("1 0 0 1 " + Qn(It.internal.getWidth(r) / 2) + " " + Qn(It.internal.getHeight(r) / 2) + " cm"), e.push(o + " 0 m"), e.push(o + " " + a + " " + a + " " + o + " 0 " + o + " c"), e.push("-" + a + " " + o + " -" + o + " " + a + " -" + o + " 0 c"), e.push("-" + o + " -" + a + " -" + a + " -" + o + " 0 -" + o + " c"), e.push(a + " -" + o + " " + o + " -" + a + " " + o + " 0 c"), e.push("f"), e.push("Q"), e.push("0 g"), e.push("q"), e.push("1 0 0 1 " + Qn(It.internal.getWidth(r) / 2) + " " + Qn(It.internal.getHeight(r) / 2) + " cm"), e.push(i + " 0 m"), e.push(i + " " + c + " " + c + " " + i + " 0 " + i + " c"), e.push("-" + c + " " + i + " -" + i + " " + c + " -" + i + " 0 c"), e.push("-" + i + " -" + c + " -" + c + " -" + i + " 0 -" + i + " c"), e.push(c + " -" + i + " " + i + " -" + c + " " + i + " 0 c"), e.push("f"), e.push("Q"), t.stream = e.join(`
`), t;
}, OffPushDown: function(r) {
var t = cn(r);
t.scope = r.scope;
var e = [], i = It.internal.getWidth(r) <= It.internal.getHeight(r) ? It.internal.getWidth(r) / 4 : It.internal.getHeight(r) / 4;
i = Number((0.9 * i).toFixed(5));
var o = Number((2 * i).toFixed(5)), a = Number((o * It.internal.Bezier_C).toFixed(5));
return e.push("0.749023 g"), e.push("q"), e.push("1 0 0 1 " + Qn(It.internal.getWidth(r) / 2) + " " + Qn(It.internal.getHeight(r) / 2) + " cm"), e.push(o + " 0 m"), e.push(o + " " + a + " " + a + " " + o + " 0 " + o + " c"), e.push("-" + a + " " + o + " -" + o + " " + a + " -" + o + " 0 c"), e.push("-" + o + " -" + a + " -" + a + " -" + o + " 0 -" + o + " c"), e.push(a + " -" + o + " " + o + " -" + a + " " + o + " 0 c"), e.push("f"), e.push("Q"), t.stream = e.join(`
`), t;
} }, Cross: { createAppearanceStream: function(r) {
var t = { D: { Off: It.RadioButton.Cross.OffPushDown }, N: {} };
return t.N[r] = It.RadioButton.Cross.YesNormal, t.D[r] = It.RadioButton.Cross.YesPushDown, t;
}, getCA: function() {
return "8";
}, YesNormal: function(r) {
var t = cn(r);
t.scope = r.scope;
var e = [], i = It.internal.calculateCross(r);
return e.push("q"), e.push("1 1 " + $t(It.internal.getWidth(r) - 2) + " " + $t(It.internal.getHeight(r) - 2) + " re"), e.push("W"), e.push("n"), e.push($t(i.x1.x) + " " + $t(i.x1.y) + " m"), e.push($t(i.x2.x) + " " + $t(i.x2.y) + " l"), e.push($t(i.x4.x) + " " + $t(i.x4.y) + " m"), e.push($t(i.x3.x) + " " + $t(i.x3.y) + " l"), e.push("s"), e.push("Q"), t.stream = e.join(`
`), t;
}, YesPushDown: function(r) {
var t = cn(r);
t.scope = r.scope;
var e = It.internal.calculateCross(r), i = [];
return i.push("0.749023 g"), i.push("0 0 " + $t(It.internal.getWidth(r)) + " " + $t(It.internal.getHeight(r)) + " re"), i.push("f"), i.push("q"), i.push("1 1 " + $t(It.internal.getWidth(r) - 2) + " " + $t(It.internal.getHeight(r) - 2) + " re"), i.push("W"), i.push("n"), i.push($t(e.x1.x) + " " + $t(e.x1.y) + " m"), i.push($t(e.x2.x) + " " + $t(e.x2.y) + " l"), i.push($t(e.x4.x) + " " + $t(e.x4.y) + " m"), i.push($t(e.x3.x) + " " + $t(e.x3.y) + " l"), i.push("s"), i.push("Q"), t.stream = i.join(`
`), t;
}, OffPushDown: function(r) {
var t = cn(r);
t.scope = r.scope;
var e = [];
return e.push("0.749023 g"), e.push("0 0 " + $t(It.internal.getWidth(r)) + " " + $t(It.internal.getHeight(r)) + " re"), e.push("f"), t.stream = e.join(`
`), t;
} } }, createDefaultAppearanceStream: function(r) {
var t = r.scope.internal.getFont(r.fontName, r.fontStyle).id, e = r.scope.__private__.encodeColorString(r.color);
return "/" + t + " " + r.fontSize + " Tf " + e;
} };
It.internal = { Bezier_C: 0.551915024494, calculateCross: function(r) {
var t = It.internal.getWidth(r), e = It.internal.getHeight(r), i = Math.min(t, e);
return { x1: { x: (t - i) / 2, y: (e - i) / 2 + i }, x2: { x: (t - i) / 2 + i, y: (e - i) / 2 }, x3: { x: (t - i) / 2, y: (e - i) / 2 }, x4: { x: (t - i) / 2 + i, y: (e - i) / 2 + i } };
} }, It.internal.getWidth = function(r) {
var t = 0;
return _e(r) === "object" && (t = Pu(r.Rect[2])), t;
}, It.internal.getHeight = function(r) {
var t = 0;
return _e(r) === "object" && (t = Pu(r.Rect[3])), t;
};
var q1 = Te.addField = function(r) {
if (D1(this, r), !(r instanceof Qr)) throw new Error("Invalid argument passed to jsPDF.addField.");
var t;
return (t = r).scope.internal.acroformPlugin.printedOut && (t.scope.internal.acroformPlugin.printedOut = !1, t.scope.internal.acroformPlugin.acroFormDictionaryRoot = null), t.scope.internal.acroformPlugin.acroFormDictionaryRoot.Fields.push(t), r.page = r.scope.internal.getCurrentPageInfo().pageNumber, this;
};
Te.AcroFormChoiceField = Ni, Te.AcroFormListBox = Li, Te.AcroFormComboBox = Si, Te.AcroFormEditBox = Ia, Te.AcroFormButton = rr, Te.AcroFormPushButton = Ca, Te.AcroFormRadioButton = ki, Te.AcroFormCheckBox = Fa, Te.AcroFormTextField = ri, Te.AcroFormPasswordField = Ea, Te.AcroFormAppearance = It, Te.AcroForm = { ChoiceField: Ni, ListBox: Li, ComboBox: Si, EditBox: Ia, Button: rr, PushButton: Ca, RadioButton: ki, CheckBox: Fa, TextField: ri, PasswordField: Ea, Appearance: It }, Mt.AcroForm = { ChoiceField: Ni, ListBox: Li, ComboBox: Si, EditBox: Ia, Button: rr, PushButton: Ca, RadioButton: ki, CheckBox: Fa, TextField: ri, PasswordField: Ea, Appearance: It };
var U1 = Mt.AcroForm;
function Ef(r) {
return r.reduce(function(t, e, i) {
return t[e] = i, t;
}, {});
}
(function(r) {
var t = "addImage_";
r.__addimage__ = {};
var e = "UNKNOWN", i = { 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]] }, o = r.__addimage__.getImageFileTypeByImageData = function(N, F) {
var z, U, nt, ot, ut, rt = e;
if ((F = F || e) === "RGBA" || N.data !== void 0 && N.data instanceof Uint8ClampedArray && "height" in N && "width" in N) return "RGBA";
if (mt(N)) for (ut in i) for (nt = i[ut], z = 0; z < nt.length; z += 1) {
for (ot = !0, U = 0; U < nt[z].length; U += 1) if (nt[z][U] !== void 0 && nt[z][U] !== N[U]) {
ot = !1;
break;
}
if (ot === !0) {
rt = ut;
break;
}
}
else for (ut in i) for (nt = i[ut], z = 0; z < nt.length; z += 1) {
for (ot = !0, U = 0; U < nt[z].length; U += 1) if (nt[z][U] !== void 0 && nt[z][U] !== N.charCodeAt(U)) {
ot = !1;
break;
}
if (ot === !0) {
rt = ut;
break;
}
}
return rt === e && F !== e && (rt = F), rt;
}, a = function N(F) {
for (var z = this.internal.write, U = this.internal.putStream, nt = (0, this.internal.getFilters)(); nt.indexOf("FlateEncode") !== -1; ) nt.splice(nt.indexOf("FlateEncode"), 1);
F.objectId = this.internal.newObject();
var ot = [];
if (ot.push({ key: "Type", value: "/XObject" }), ot.push({ key: "Subtype", value: "/Image" }), ot.push({ key: "Width", value: F.width }), ot.push({ key: "Height", value: F.height }), F.colorSpace === S.INDEXED ? ot.push({ key: "ColorSpace", value: "[/Indexed /DeviceRGB " + (F.palette.length / 3 - 1) + " " + ("sMask" in F && F.sMask !== void 0 ? F.objectId + 2 : F.objectId + 1) + " 0 R]" }) : (ot.push({ key: "ColorSpace", value: "/" + F.colorSpace }), F.colorSpace === S.DEVICE_CMYK && ot.push({ key: "Decode", value: "[1 0 1 0 1 0 1 0]" })), ot.push({ key: "BitsPerComponent", value: F.bitsPerComponent }), "decodeParameters" in F && F.decodeParameters !== void 0 && ot.push({ key: "DecodeParms", value: "<<" + F.decodeParameters + ">>" }), "transparency" in F && Array.isArray(F.transparency) && F.transparency.length > 0) {
for (var ut = "", rt = 0, ht = F.transparency.length; rt < ht; rt++) ut += F.transparency[rt] + " " + F.transparency[rt] + " ";
ot.push({ key: "Mask", value: "[" + ut + "]" });
}
F.sMask !== void 0 && ot.push({ key: "SMask", value: F.objectId + 1 + " 0 R" });
var At = F.filter !== void 0 ? ["/" + F.filter] : void 0;
if (U({ data: F.data, additionalKeyValues: ot, alreadyAppliedFilters: At, objectId: F.objectId }), z("endobj"), "sMask" in F && F.sMask !== void 0) {
var wt, x = (wt = F.sMaskBitsPerComponent) !== null && wt !== void 0 ? wt : F.bitsPerComponent, B = { width: F.width, height: F.height, colorSpace: "DeviceGray", bitsPerComponent: x, data: F.sMask };
"filter" in F && (B.decodeParameters = "/Predictor ".concat(F.predictor, " /Colors 1 /BitsPerComponent ").concat(x, " /Columns ").concat(F.width), B.filter = F.filter), N.call(this, B);
}
if (F.colorSpace === S.INDEXED) {
var T = this.internal.newObject();
U({ data: K(new Uint8Array(F.palette)), objectId: T }), z("endobj");
}
}, c = function() {
var N = this.internal.collections[t + "images"];
for (var F in N) a.call(this, N[F]);
}, l = function() {
var N, F = this.internal.collections[t + "images"], z = this.internal.write;
for (var U in F) z("/I" + (N = F[U]).index, N.objectId, "0", "R");
}, h = function() {
this.internal.collections[t + "images"] || (this.internal.collections[t + "images"] = {}, this.internal.events.subscribe("putResources", c), this.internal.events.subscribe("putXobjectDict", l));
}, d = function() {
var N = this.internal.collections[t + "images"];
return h.call(this), N;
}, m = function() {
return Object.keys(this.internal.collections[t + "images"]).length;
}, _ = function(N) {
return typeof r["process" + N.toUpperCase()] == "function";
}, k = function(N) {
return _e(N) === "object" && N.nodeType === 1;
}, p = function(N, F) {
if (N.nodeName === "IMG" && N.hasAttribute("src")) {
var z = "" + N.getAttribute("src");
if (z.indexOf("data:image/") === 0) return Is(unescape(z).split("base64,").pop());
var U = r.loadFile(z, !0);
if (U !== void 0) return U;
}
if (N.nodeName === "CANVAS") {
if (N.width === 0 || N.height === 0) throw new Error("Given canvas must have data. Canvas width: " + N.width + ", height: " + N.height);
var nt;
switch (F) {
case "PNG":
nt = "image/png";
break;
case "WEBP":
nt = "image/webp";
break;
default:
nt = "image/jpeg";
}
return Is(N.toDataURL(nt, 1).split("base64,").pop());
}
}, j = function(N) {
var F = this.internal.collections[t + "images"];
if (F) {
for (var z in F) if (N === F[z].alias) return F[z];
}
}, O = function(N, F, z) {
return N || F || (N = -96, F = -96), N < 0 && (N = -1 * z.width * 72 / N / this.internal.scaleFactor), F < 0 && (F = -1 * z.height * 72 / F / this.internal.scaleFactor), N === 0 && (N = F * z.width / z.height), F === 0 && (F = N * z.height / z.width), [N, F];
}, M = function(N, F, z, U, nt, ot) {
var ut = O.call(this, z, U, nt), rt = this.internal.getCoordinateString, ht = this.internal.getVerticalCoordinateString, At = d.call(this);
if (z = ut[0], U = ut[1], At[nt.index] = nt, ot) {
ot *= Math.PI / 180;
var wt = Math.cos(ot), x = Math.sin(ot), B = function(H) {
return H.toFixed(4);
}, T = [B(wt), B(x), B(-1 * x), B(wt), 0, 0, "cm"];
}
this.internal.write("q"), ot ? (this.internal.write([1, "0", "0", 1, rt(N), ht(F + U), "cm"].join(" ")), this.internal.write(T.join(" ")), this.internal.write([rt(z), "0", "0", rt(U), "0", "0", "cm"].join(" "))) : this.internal.write([rt(z), "0", "0", rt(U), rt(N), ht(F + U), "cm"].join(" ")), this.isAdvancedAPI() && this.internal.write([1, 0, 0, -1, 0, 0, "cm"].join(" ")), this.internal.write("/I" + nt.index + " Do"), this.internal.write("Q");
}, S = 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 V = r.image_compression = { NONE: "NONE", FAST: "FAST", MEDIUM: "MEDIUM", SLOW: "SLOW" }, G = r.__addimage__.sHashCode = function(N) {
var F, z, U = 0;
if (typeof N == "string") for (z = N.length, F = 0; F < z; F++) U = (U << 5) - U + N.charCodeAt(F), U |= 0;
else if (mt(N)) for (z = N.byteLength / 2, F = 0; F < z; F++) U = (U << 5) - U + N[F], U |= 0;
return U;
}, D = r.__addimage__.validateStringAsBase64 = function(N) {
(N = N || "").toString().trim();
var F = !0;
return N.length === 0 && (F = !1), N.length % 4 != 0 && (F = !1), /^[A-Za-z0-9+/]+$/.test(N.substr(0, N.length - 2)) === !1 && (F = !1), /^[A-Za-z0-9/][A-Za-z0-9+/]|[A-Za-z0-9+/]=|==$/.test(N.substr(-2)) === !1 && (F = !1), F;
}, it = r.__addimage__.extractImageFromDataUrl = function(N) {
if (N == null || !(N = N.trim()).startsWith("data:")) return null;
var F = N.indexOf(",");
return F < 0 ? null : N.substring(0, F).trim().endsWith("base64") ? N.substring(F + 1) : null;
};
r.__addimage__.isArrayBuffer = function(N) {
return N instanceof ArrayBuffer;
};
var mt = r.__addimage__.isArrayBufferView = function(N) {
return N instanceof Int8Array || N instanceof Uint8Array || N instanceof Uint8ClampedArray || N instanceof Int16Array || N instanceof Uint16Array || N instanceof Int32Array || N instanceof Uint32Array || N instanceof Float32Array || N instanceof Float64Array;
}, ct = r.__addimage__.binaryStringToUint8Array = function(N) {
for (var F = N.length, z = new Uint8Array(F), U = 0; U < F; U++) z[U] = N.charCodeAt(U);
return z;
}, K = r.__addimage__.arrayBufferToBinaryString = function(N) {
for (var F = "", z = mt(N) ? N : new Uint8Array(N), U = 0; U < z.length; U += 8192) F += String.fromCharCode.apply(null, z.subarray(U, U + 8192));
return F;
};
r.addImage = function() {
var N, F, z, U, nt, ot, ut, rt, ht;
if (typeof arguments[1] == "number" ? (F = e, z = arguments[1], U = arguments[2], nt = arguments[3], ot = arguments[4], ut = arguments[5], rt = arguments[6], ht = arguments[7]) : (F = arguments[1], z = arguments[2], U = arguments[3], nt = arguments[4], ot = arguments[5], ut = arguments[6], rt = arguments[7], ht = arguments[8]), _e(N = arguments[0]) === "object" && !k(N) && "imageData" in N) {
var At = N;
N = At.imageData, F = At.format || F || e, z = At.x || z || 0, U = At.y || U || 0, nt = At.w || At.width || nt, ot = At.h || At.height || ot, ut = At.alias || ut, rt = At.compression || rt, ht = At.rotation || At.angle || ht;
}
var wt = this.internal.getFilters();
if (rt === void 0 && wt.indexOf("FlateEncode") !== -1 && (rt = "SLOW"), isNaN(z) || isNaN(U)) throw new Error("Invalid coordinates passed to jsPDF.addImage");
h.call(this);
var x = R.call(this, N, F, ut, rt);
return M.call(this, z, U, nt, ot, x, ht), this;
};
var R = function(N, F, z, U) {
var nt, ot, ut;
if (typeof N == "string" && o(N) === e) {
N = unescape(N);
var rt = tt(N, !1);
(rt !== "" || (rt = r.loadFile(N, !0)) !== void 0) && (N = rt);
}
if (k(N) && (N = p(N, F)), F = o(N, F), !_(F)) throw new Error("addImage does not support files of type '" + F + "', please ensure that a plugin for '" + F + "' support is added.");
if (((ut = z) == null || ut.length === 0) && (z = (function(ht) {
return typeof ht == "string" || mt(ht) ? G(ht) : mt(ht.data) ? G(ht.data) : null;
})(N)), (nt = j.call(this, z)) || (N instanceof Uint8Array || F === "RGBA" || (ot = N, N = ct(N)), nt = this["process" + F.toUpperCase()](N, m.call(this), z, (function(ht) {
return ht && typeof ht == "string" && (ht = ht.toUpperCase()), ht in r.image_compression ? ht : V.NONE;
})(U), ot)), !nt) throw new Error("An unknown error occurred whilst processing the image.");
return nt;
}, tt = r.__addimage__.convertBase64ToBinaryString = function(N, F) {
F = typeof F != "boolean" || F;
var z, U = "";
if (typeof N == "string") {
var nt;
z = (nt = it(N)) !== null && nt !== void 0 ? nt : N;
try {
U = Is(z);
} catch (ot) {
if (F) throw D(z) ? new Error("atob-Error in jsPDF.convertBase64ToBinaryString " + ot.message) : new Error("Supplied Data is not a valid base64-String jsPDF.convertBase64ToBinaryString ");
}
}
return U;
};
r.getImageProperties = function(N) {
var F, z, U = "";
if (k(N) && (N = p(N)), typeof N == "string" && o(N) === e && ((U = tt(N, !1)) === "" && (U = r.loadFile(N) || ""), N = U), z = o(N), !_(z)) throw new Error("addImage does not support files of type '" + z + "', please ensure that a plugin for '" + z + "' support is added.");
if (N instanceof Uint8Array || (N = ct(N)), !(F = this["process" + z.toUpperCase()](N))) throw new Error("An unknown error occurred whilst processing the image");
return F.fileType = z, F;
};
})(Mt.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 t = function(e) {
if (e !== void 0 && e != "") return !0;
};
Mt.API.events.push(["addPage", function(e) {
this.internal.getPageInfo(e.pageNumber).pageContext.annotations = [];
}]), r.events.push(["putPage", function(e) {
for (var i, o, a, c = this.internal.getCoordinateString, l = this.internal.getVerticalCoordinateString, h = this.internal.getPageInfoByObjId(e.objId), d = e.pageContext.annotations, m = !1, _ = 0; _ < d.length && !m; _++) switch ((i = d[_]).type) {
case "link":
(t(i.options.url) || t(i.options.pageNumber)) && (m = !0);
break;
case "reference":
case "text":
case "freetext":
m = !0;
}
if (m != 0) {
this.internal.write("/Annots [");
for (var k = 0; k < d.length; k++) {
i = d[k];
var p = this.internal.pdfEscape, j = this.internal.getEncryptor(e.objId);
switch (i.type) {
case "reference":
this.internal.write(" " + i.object.objId + " 0 R ");
break;
case "text":
var O = this.internal.newAdditionalObject(), M = this.internal.newAdditionalObject(), S = this.internal.getEncryptor(O.objId), V = i.title || "Note";
a = "<</Type /Annot /Subtype /Text " + (o = "/Rect [" + c(i.bounds.x) + " " + l(i.bounds.y + i.bounds.h) + " " + c(i.bounds.x + i.bounds.w) + " " + l(i.bounds.y) + "] ") + "/Contents (" + p(S(i.contents)) + ")", a += " /Popup " + M.objId + " 0 R", a += " /P " + h.objId + " 0 R", a += " /T (" + p(S(V)) + ") >>", O.content = a;
var G = O.objId + " 0 R";
a = "<</Type /Annot /Subtype /Popup " + (o = "/Rect [" + c(i.bounds.x + 30) + " " + l(i.bounds.y + i.bounds.h) + " " + c(i.bounds.x + i.bounds.w + 30) + " " + l(i.bounds.y) + "] ") + " /Parent " + G, i.open && (a += " /Open true"), a += " >>", M.content = a, this.internal.write(O.objId, "0 R", M.objId, "0 R");
break;
case "freetext":
o = "/Rect [" + c(i.bounds.x) + " " + l(i.bounds.y) + " " + c(i.bounds.x + i.bounds.w) + " " + l(i.bounds.y + i.bounds.h) + "] ";
var D = i.color || "#000000";
a = "<</Type /Annot /Subtype /FreeText " + o + "/Contents (" + p(j(i.contents)) + ")", a += " /DS(font: Helvetica,sans-serif 12.0pt; text-align:left; color:#" + D + ")", a += " /Border [0 0 0]", a += " >>", this.internal.write(a);
break;
case "link":
if (i.options.name) {
var it = this.annotations._nameMap[i.options.name];
i.options.pageNumber = it.page, i.options.top = it.y;
} else i.options.top || (i.options.top = 0);
if (o = "/Rect [" + i.finalBounds.x + " " + i.finalBounds.y + " " + i.finalBounds.w + " " + i.finalBounds.h + "] ", a = "", i.options.url) a = "<</Type /Annot /Subtype /Link " + o + "/Border [0 0 0] /A <</S /URI /URI (" + p(j(i.options.url)) + ") >>";
else if (i.options.pageNumber) switch (a = "<</Type /Annot /Subtype /Link " + o + "/Border [0 0 0] /Dest [" + this.internal.getPageInfo(i.options.pageNumber).objId + " 0 R", i.options.magFactor = i.options.magFactor || "XYZ", i.options.magFactor) {
case "Fit":
a += " /Fit]";
break;
case "FitH":
a += " /FitH " + i.options.top + "]";
break;
case "FitV":
i.options.left = i.options.left || 0, a += " /FitV " + i.options.left + "]";
break;
default:
var mt = l(i.options.top);
i.options.left = i.options.left || 0, i.options.zoom === void 0 && (i.options.zoom = 0), a += " /XYZ " + i.options.left + " " + mt + " " + i.options.zoom + "]";
}
a != "" && (a += " >>", this.internal.write(a));
}
}
this.internal.write("]");
}
}]), r.createAnnotation = function(e) {
var i = this.internal.getCurrentPageInfo();
switch (e.type) {
case "link":
this.link(e.bounds.x, e.bounds.y, e.bounds.w, e.bounds.h, e);
break;
case "text":
case "freetext":
i.pageContext.annotations.push(e);
}
}, r.link = function(e, i, o, a, c) {
var l = this.internal.getCurrentPageInfo(), h = this.internal.getCoordinateString, d = this.internal.getVerticalCoordinateString;
l.pageContext.annotations.push({ finalBounds: { x: h(e), y: d(i), w: h(e + o), h: d(i + a) }, options: c, type: "link" });
}, r.textWithLink = function(e, i, o, a) {
var c, l, h = this.getTextWidth(e), d = this.internal.getLineHeight() / this.internal.scaleFactor;
if (a.maxWidth !== void 0) {
l = a.maxWidth;
var m = this.splitTextToSize(e, l).length;
c = Math.ceil(d * m);
} else l = h, c = d;
return this.text(e, i, o, a), o += 0.2 * d, a.align === "center" && (i -= h / 2), a.align === "right" && (i -= h), this.link(i, o - d, l, c, a), h;
}, r.getTextWidth = function(e) {
var i = this.internal.getFontSize();
return this.getStringUnitWidth(e) * i / this.internal.scaleFactor;
};
})(Mt.API), /**
* @license
* Copyright (c) 2017 Aras Abbasi
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
(function(r) {
var t = { 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] }, e = { 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 } }, i = { 1612: 64606, 1613: 64607, 1614: 64608, 1615: 64609, 1616: 64610 }, o = [1570, 1571, 1573, 1575];
r.__arabicParser__ = {};
var a = r.__arabicParser__.isInArabicSubstitutionA = function(O) {
return t[O.charCodeAt(0)] !== void 0;
}, c = r.__arabicParser__.isArabicLetter = function(O) {
return typeof O == "string" && /^[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]+$/.test(O);
}, l = r.__arabicParser__.isArabicEndLetter = function(O) {
return c(O) && a(O) && t[O.charCodeAt(0)].length <= 2;
}, h = r.__arabicParser__.isArabicAlfLetter = function(O) {
return c(O) && o.indexOf(O.charCodeAt(0)) >= 0;
};
r.__arabicParser__.arabicLetterHasIsolatedForm = function(O) {
return c(O) && a(O) && t[O.charCodeAt(0)].length >= 1;
};
var d = r.__arabicParser__.arabicLetterHasFinalForm = function(O) {
return c(O) && a(O) && t[O.charCodeAt(0)].length >= 2;
};
r.__arabicParser__.arabicLetterHasInitialForm = function(O) {
return c(O) && a(O) && t[O.charCodeAt(0)].length >= 3;
};
var m = r.__arabicParser__.arabicLetterHasMedialForm = function(O) {
return c(O) && a(O) && t[O.charCodeAt(0)].length == 4;
}, _ = r.__arabicParser__.resolveLigatures = function(O) {
var M = 0, S = e, V = "", G = 0;
for (M = 0; M < O.length; M += 1) S[O.charCodeAt(M)] !== void 0 ? (G++, typeof (S = S[O.charCodeAt(M)]) == "number" && (V += String.fromCharCode(S), S = e, G = 0), M === O.length - 1 && (S = e, V += O.charAt(M - (G - 1)), M -= G - 1, G = 0)) : (S = e, V += O.charAt(M - G), M -= G, G = 0);
return V;
};
r.__arabicParser__.isArabicDiacritic = function(O) {
return O !== void 0 && i[O.charCodeAt(0)] !== void 0;
};
var k = r.__arabicParser__.getCorrectForm = function(O, M, S) {
return c(O) ? a(O) === !1 ? -1 : !d(O) || !c(M) && !c(S) || !c(S) && l(M) || l(O) && !c(M) || l(O) && h(M) || l(O) && l(M) ? 0 : m(O) && c(M) && !l(M) && c(S) && d(S) ? 3 : l(O) || !c(S) ? 1 : 2 : -1;
}, p = function(O) {
var M = 0, S = 0, V = 0, G = "", D = "", it = "", mt = (O = O || "").split("\\s+"), ct = [];
for (M = 0; M < mt.length; M += 1) {
for (ct.push(""), S = 0; S < mt[M].length; S += 1) G = mt[M][S], D = mt[M][S - 1], it = mt[M][S + 1], c(G) ? (V = k(G, D, it), ct[M] += V !== -1 ? String.fromCharCode(t[G.charCodeAt(0)][V]) : G) : ct[M] += G;
ct[M] = _(ct[M]);
}
return ct.join(" ");
}, j = r.__arabicParser__.processArabic = r.processArabic = function() {
var O, M = typeof arguments[0] == "string" ? arguments[0] : arguments[0].text, S = [];
if (Array.isArray(M)) {
var V = 0;
for (S = [], V = 0; V < M.length; V += 1) Array.isArray(M[V]) ? S.push([p(M[V][0]), M[V][1], M[V][2]]) : S.push([p(M[V])]);
O = S;
} else O = p(M);
return typeof arguments[0] == "string" ? O : (arguments[0].text = O, arguments[0]);
};
r.events.push(["preProcessText", j]);
})(Mt.API), Mt.API.autoPrint = function(r) {
var t;
return (r = r || {}).variant = r.variant || "non-conform", r.variant === "javascript" ? this.addJS("print({});") : (this.internal.events.subscribe("postPutResources", function() {
t = 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 " + t + " 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 t = function() {
var e = void 0;
Object.defineProperty(this, "pdf", { get: function() {
return e;
}, set: function(l) {
e = l;
} });
var i = 150;
Object.defineProperty(this, "width", { get: function() {
return i;
}, set: function(l) {
i = isNaN(l) || Number.isInteger(l) === !1 || l < 0 ? 150 : l, this.getContext("2d").pageWrapXEnabled && (this.getContext("2d").pageWrapX = i + 1);
} });
var o = 300;
Object.defineProperty(this, "height", { get: function() {
return o;
}, set: function(l) {
o = isNaN(l) || Number.isInteger(l) === !1 || l < 0 ? 300 : l, this.getContext("2d").pageWrapYEnabled && (this.getContext("2d").pageWrapY = o + 1);
} });
var a = [];
Object.defineProperty(this, "childNodes", { get: function() {
return a;
}, set: function(l) {
a = l;
} });
var c = {};
Object.defineProperty(this, "style", { get: function() {
return c;
}, set: function(l) {
c = l;
} }), Object.defineProperty(this, "parentNode", {});
};
t.prototype.getContext = function(e, i) {
var o;
if ((e = e || "2d") !== "2d") return null;
for (o in i) this.pdf.context2d.hasOwnProperty(o) && (this.pdf.context2d[o] = i[o]);
return this.pdf.context2d._canvas = this, this.pdf.context2d;
}, t.prototype.toDataURL = function() {
throw new Error("toDataURL is not implemented.");
}, r.events.push(["initialized", function() {
this.canvas = new t(), this.canvas.pdf = this;
}]);
})(Mt.API), (function(r) {
var t = { left: 0, top: 0, bottom: 0, right: 0 }, e = !1, i = 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({}, t), this.internal.__cell__.margins.width = this.getPageWidth(), o.call(this));
}, o = function() {
this.internal.__cell__.lastCell = new a(), this.internal.__cell__.pages = 1;
}, a = function() {
var h = arguments[0];
Object.defineProperty(this, "x", { enumerable: !0, get: function() {
return h;
}, set: function(O) {
h = O;
} });
var d = arguments[1];
Object.defineProperty(this, "y", { enumerable: !0, get: function() {
return d;
}, set: function(O) {
d = O;
} });
var m = arguments[2];
Object.defineProperty(this, "width", { enumerable: !0, get: function() {
return m;
}, set: function(O) {
m = O;
} });
var _ = arguments[3];
Object.defineProperty(this, "height", { enumerable: !0, get: function() {
return _;
}, set: function(O) {
_ = O;
} });
var k = arguments[4];
Object.defineProperty(this, "text", { enumerable: !0, get: function() {
return k;
}, set: function(O) {
k = O;
} });
var p = arguments[5];
Object.defineProperty(this, "lineNumber", { enumerable: !0, get: function() {
return p;
}, set: function(O) {
p = O;
} });
var j = arguments[6];
return Object.defineProperty(this, "align", { enumerable: !0, get: function() {
return j;
}, set: function(O) {
j = O;
} }), this;
};
a.prototype.clone = function() {
return new a(this.x, this.y, this.width, this.height, this.text, this.lineNumber, this.align);
}, a.prototype.toArray = function() {
return [this.x, this.y, this.width, this.height, this.text, this.lineNumber, this.align];
}, r.setHeaderFunction = function(h) {
return i.call(this), this.internal.__cell__.headerFunction = typeof h == "function" ? h : void 0, this;
}, r.getTextDimensions = function(h, d) {
i.call(this);
var m = (d = d || {}).fontSize || this.getFontSize(), _ = d.font || this.getFont(), k = d.scaleFactor || this.internal.scaleFactor, p = 0, j = 0, O = 0, M = 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 S = d.maxWidth;
S > 0 ? typeof h == "string" ? h = this.splitTextToSize(h, S) : Object.prototype.toString.call(h) === "[object Array]" && (h = h.reduce(function(G, D) {
return G.concat(M.splitTextToSize(D, S));
}, [])) : h = Array.isArray(h) ? h : [h];
for (var V = 0; V < h.length; V++) p < (O = this.getStringUnitWidth(h[V], { font: _ }) * m) && (p = O);
return p !== 0 && (j = h.length), { w: p /= k, h: Math.max((j * m * this.getLineHeightFactor() - m * (this.getLineHeightFactor() - 1)) / k, 0) };
}, r.cellAddPage = function() {
i.call(this), this.addPage();
var h = this.internal.__cell__.margins || t;
return this.internal.__cell__.lastCell = new a(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 a ? arguments[0] : new a(arguments[0], arguments[1], arguments[2], arguments[3], arguments[4], arguments[5], arguments[6]), i.call(this);
var d = this.internal.__cell__.lastCell, m = this.internal.__cell__.padding, _ = this.internal.__cell__.margins || t, k = this.internal.__cell__.tableHeaderRow, p = this.internal.__cell__.printHeaders;
return d.lineNumber !== void 0 && (d.lineNumber === h.lineNumber ? (h.x = (d.x || 0) + (d.width || 0), h.y = d.y || 0) : d.y + d.height + h.height + _.bottom > this.getPageHeight() ? (this.cellAddPage(), h.y = _.top, p && k && (this.printHeaderRow(h.lineNumber, !0), h.y += k[0].height)) : h.y = d.y + d.height || h.y), h.text[0] !== void 0 && (this.rect(h.x, h.y, h.width, h.height, e === !0 ? "FD" : void 0), h.align === "right" ? this.text(h.text, h.x + h.width - m, h.y + m, { align: "right", baseline: "top" }) : h.align === "center" ? this.text(h.text, h.x + h.width / 2, h.y + m, { align: "center", baseline: "top", maxWidth: h.width - m - m }) : this.text(h.text, h.x + m, h.y + m, { align: "left", baseline: "top", maxWidth: h.width - m - m })), this.internal.__cell__.lastCell = h, this;
};
r.table = function(h, d, m, _, k) {
if (i.call(this), !m) throw new Error("No data for PDF table.");
var p, j, O, M, S = [], V = [], G = [], D = {}, it = {}, mt = [], ct = [], K = (k = k || {}).autoSize || !1, R = k.printHeaders !== !1, tt = k.css && k.css["font-size"] !== void 0 ? 16 * k.css["font-size"] : k.fontSize || 12, N = k.margins || Object.assign({ width: this.getPageWidth() }, t), F = typeof k.padding == "number" ? k.padding : 3, z = k.headerBackgroundColor || "#c8c8c8", U = k.headerTextColor || "#000";
if (o.call(this), this.internal.__cell__.printHeaders = R, this.internal.__cell__.margins = N, this.internal.__cell__.table_font_size = tt, this.internal.__cell__.padding = F, this.internal.__cell__.headerBackgroundColor = z, this.internal.__cell__.headerTextColor = U, this.setFontSize(tt), _ == null) V = S = Object.keys(m[0]), G = S.map(function() {
return "left";
});
else if (Array.isArray(_) && _e(_[0]) === "object") for (S = _.map(function(At) {
return At.name;
}), V = _.map(function(At) {
return At.prompt || At.name || "";
}), G = _.map(function(At) {
return At.align || "left";
}), p = 0; p < _.length; p += 1) it[_[p].name] = 0.7499990551181103 * _[p].width;
else Array.isArray(_) && typeof _[0] == "string" && (V = S = _, G = S.map(function() {
return "left";
}));
if (K || Array.isArray(_) && typeof _[0] == "string") for (p = 0; p < S.length; p += 1) {
for (D[M = S[p]] = m.map(function(At) {
return At[M];
}), this.setFont(void 0, "bold"), mt.push(this.getTextDimensions(V[p], { fontSize: this.internal.__cell__.table_font_size, scaleFactor: this.internal.scaleFactor }).w), j = D[M], this.setFont(void 0, "normal"), O = 0; O < j.length; O += 1) mt.push(this.getTextDimensions(j[O], { fontSize: this.internal.__cell__.table_font_size, scaleFactor: this.internal.scaleFactor }).w);
it[M] = Math.max.apply(null, mt) + F + F, mt = [];
}
if (R) {
var nt = {};
for (p = 0; p < S.length; p += 1) nt[S[p]] = {}, nt[S[p]].text = V[p], nt[S[p]].align = G[p];
var ot = l.call(this, nt, it);
ct = S.map(function(At) {
return new a(h, d, it[At], ot, nt[At].text, void 0, nt[At].align);
}), this.setTableHeaderRow(ct), this.printHeaderRow(1, !1);
}
var ut = _.reduce(function(At, wt) {
return At[wt.name] = wt.align, At;
}, {});
for (p = 0; p < m.length; p += 1) {
"rowStart" in k && k.rowStart instanceof Function && k.rowStart({ row: p, data: m[p] }, this);
var rt = l.call(this, m[p], it);
for (O = 0; O < S.length; O += 1) {
var ht = m[p][S[O]];
"cellStart" in k && k.cellStart instanceof Function && k.cellStart({ row: p, col: O, data: ht }, this), c.call(this, new a(h, d, it[S[O]], rt, ht, p + 2, ut[S[O]]));
}
}
return this.internal.__cell__.table_x = h, this.internal.__cell__.table_y = d, this;
};
var l = function(h, d) {
var m = this.internal.__cell__.padding, _ = this.internal.__cell__.table_font_size, k = this.internal.scaleFactor;
return Object.keys(h).map(function(p) {
var j = h[p];
return this.splitTextToSize(j.hasOwnProperty("text") ? j.text : j, d[p] - m - m);
}, this).map(function(p) {
return this.getLineHeightFactor() * p.length * _ / k + m + m;
}, this).reduce(function(p, j) {
return Math.max(p, j);
}, 0);
};
r.setTableHeaderRow = function(h) {
i.call(this), this.internal.__cell__.tableHeaderRow = h;
}, r.printHeaderRow = function(h, d) {
if (i.call(this), !this.internal.__cell__.tableHeaderRow) throw new Error("Property tableHeaderRow does not exist.");
var m;
if (e = !0, typeof this.internal.__cell__.headerFunction == "function") {
var _ = this.internal.__cell__.headerFunction(this, this.internal.__cell__.pages);
this.internal.__cell__.lastCell = new a(_[0], _[1], _[2], _[3], void 0, -1);
}
this.setFont(void 0, "bold");
for (var k = [], p = 0; p < this.internal.__cell__.tableHeaderRow.length; p += 1) {
m = this.internal.__cell__.tableHeaderRow[p].clone(), d && (m.y = this.internal.__cell__.margins.top || 0, k.push(m)), m.lineNumber = h;
var j = this.getTextColor();
this.setTextColor(this.internal.__cell__.headerTextColor), this.setFillColor(this.internal.__cell__.headerBackgroundColor), c.call(this, m), this.setTextColor(j);
}
k.length > 0 && this.setTableHeaderRow(k), this.setFont(void 0, "normal"), e = !1;
};
})(Mt.API);
var Of = { italic: ["italic", "oblique", "normal"], oblique: ["oblique", "italic", "normal"], normal: ["normal", "oblique", "italic"] }, jf = ["ultra-condensed", "extra-condensed", "condensed", "semi-condensed", "normal", "semi-expanded", "expanded", "extra-expanded", "ultra-expanded"], Vo = Ef(jf), Bf = [100, 200, 300, 400, 500, 600, 700, 800, 900], z1 = Ef(Bf);
function Fo(r) {
var t = r.family.replace(/"|'/g, "").toLowerCase(), e = (function(a) {
return Of[a = a || "normal"] ? a : "normal";
})(r.style), i = (function(a) {
return a ? typeof a == "number" ? a >= 100 && a <= 900 && a % 100 == 0 ? a : 400 : /^\d00$/.test(a) ? parseInt(a) : a === "bold" ? 700 : 400 : 400;
})(r.weight), o = (function(a) {
return typeof Vo[a = a || "normal"] == "number" ? a : "normal";
})(r.stretch);
return { family: t, style: e, weight: i, stretch: o, src: r.src || [], ref: r.ref || { name: t, style: [o, e, i].join(" ") } };
}
function Iu(r, t, e, i) {
var o;
for (o = e; o >= 0 && o < t.length; o += i) if (r[t[o]]) return r[t[o]];
for (o = e; o >= 0 && o < t.length; o -= i) if (r[t[o]]) return r[t[o]];
}
var H1 = { "sans-serif": "helvetica", fixed: "courier", monospace: "courier", terminal: "courier", cursive: "times", fantasy: "times", serif: "times" }, Cu = { caption: "times", icon: "times", menu: "times", "message-box": "times", "small-caption": "times", "status-bar": "times" };
function Fu(r) {
return [r.stretch, r.style, r.weight, r.family].join(" ");
}
function Eu(r) {
return r.trimLeft();
}
function W1(r, t) {
for (var e = 0; e < r.length; ) {
if (r.charAt(e) === t) return [r.substring(0, e), r.substring(e + 1)];
e += 1;
}
return null;
}
function V1(r) {
var t = r.match(/^(-[a-z_]|[a-z_])[a-z0-9_-]*/i);
return t === null ? null : [t[0], r.substring(t[0].length)];
}
var Ss, Ou, ju, Yi, ks, Bu, Mu, Ru, Eo = ["times"];
function Tu(r, t, e, i, o) {
var a = 4, c = qu;
switch (o) {
case Mt.API.image_compression.FAST:
a = 1, c = Du;
break;
case Mt.API.image_compression.MEDIUM:
a = 6, c = Uu;
break;
case Mt.API.image_compression.SLOW:
a = 9, c = zu;
}
r = (function(h, d, m, _) {
for (var k, p = h.length / d, j = new Uint8Array(h.length + p), O = [G1, Du, qu, Uu, zu], M = 0; M < p; M += 1) {
var S = M * d, V = h.subarray(S, S + d);
if (_) j.set(_(V, m, k), S + M);
else {
for (var G = O.length, D = [], it = 0; it < G; it += 1) D[it] = O[it](V, m, k);
var mt = J1(D.concat());
j.set(D[mt], S + M);
}
k = V;
}
return j;
})(r, t, Math.ceil(e * i / 8), c);
var l = To(r, { level: a });
return Mt.API.__addimage__.arrayBufferToBinaryString(l);
}
function G1(r) {
var t = Array.apply([], r);
return t.unshift(0), t;
}
function Du(r, t) {
var e = r.length, i = [];
i[0] = 1;
for (var o = 0; o < e; o += 1) {
var a = r[o - t] || 0;
i[o + 1] = r[o] - a + 256 & 255;
}
return i;
}
function qu(r, t, e) {
var i = r.length, o = [];
o[0] = 2;
for (var a = 0; a < i; a += 1) {
var c = e && e[a] || 0;
o[a + 1] = r[a] - c + 256 & 255;
}
return o;
}
function Uu(r, t, e) {
var i = r.length, o = [];
o[0] = 3;
for (var a = 0; a < i; a += 1) {
var c = r[a - t] || 0, l = e && e[a] || 0;
o[a + 1] = r[a] + 256 - (c + l >>> 1) & 255;
}
return o;
}
function zu(r, t, e) {
var i = r.length, o = [];
o[0] = 4;
for (var a = 0; a < i; a += 1) {
var c = Y1(r[a - t] || 0, e && e[a] || 0, e && e[a - t] || 0);
o[a + 1] = r[a] - c + 256 & 255;
}
return o;
}
function Y1(r, t, e) {
if (r === t && t === e) return r;
var i = Math.abs(t - e), o = Math.abs(r - e), a = Math.abs(r + t - e - e);
return i <= o && i <= a ? r : o <= a ? t : e;
}
function J1(r) {
var t = r.map(function(e) {
return e.reduce(function(i, o) {
return i + Math.abs(o);
}, 0);
});
return t.indexOf(Math.min.apply(null, t));
}
function Oo(r, t, e) {
var i = t * e, o = Math.floor(i / 8), a = 16 - (i - 8 * o + e), c = (1 << e) - 1;
return Mf(r, o) >> a & c;
}
function Hu(r, t, e, i) {
var o = e * i, a = Math.floor(o / 8), c = 16 - (o - 8 * a + i), l = (1 << i) - 1, h = (t & l) << c;
(function(d, m, _) {
if (m + 1 < d.byteLength) d.setUint16(m, _, !1);
else {
var k = _ >> 8 & 255;
d.setUint8(m, k);
}
})(r, a, Mf(r, a) & ~(l << c) & 65535 | h);
}
function Mf(r, t) {
return t + 1 < r.byteLength ? r.getUint16(t, !1) : r.getUint8(t) << 8;
}
function K1(r) {
var t = 0;
if (r[t++] !== 71 || r[t++] !== 73 || r[t++] !== 70 || r[t++] !== 56 || (r[t++] + 1 & 253) != 56 || r[t++] !== 97) throw new Error("Invalid GIF 87a/89a header.");
var e = r[t++] | r[t++] << 8, i = r[t++] | r[t++] << 8, o = r[t++], a = o >> 7, c = 1 << 1 + (7 & o);
r[t++], r[t++];
var l = null, h = null;
a && (l = t, h = c, t += 3 * c);
var d = !0, m = [], _ = 0, k = null, p = 0, j = null;
for (this.width = e, this.height = i; d && t < r.length; ) switch (r[t++]) {
case 33:
switch (r[t++]) {
case 255:
if (r[t] !== 11 || r[t + 1] == 78 && r[t + 2] == 69 && r[t + 3] == 84 && r[t + 4] == 83 && r[t + 5] == 67 && r[t + 6] == 65 && r[t + 7] == 80 && r[t + 8] == 69 && r[t + 9] == 50 && r[t + 10] == 46 && r[t + 11] == 48 && r[t + 12] == 3 && r[t + 13] == 1 && r[t + 16] == 0) t += 14, j = r[t++] | r[t++] << 8, t++;
else for (t += 12; ; ) {
if (!((N = r[t++]) >= 0)) throw Error("Invalid block size");
if (N === 0) break;
t += N;
}
break;
case 249:
if (r[t++] !== 4 || r[t + 4] !== 0) throw new Error("Invalid graphics extension block.");
var O = r[t++];
_ = r[t++] | r[t++] << 8, k = r[t++], 1 & O || (k = null), p = O >> 2 & 7, t++;
break;
case 254:
for (; ; ) {
if (!((N = r[t++]) >= 0)) throw Error("Invalid block size");
if (N === 0) break;
t += N;
}
break;
default:
throw new Error("Unknown graphic control label: 0x" + r[t - 1].toString(16));
}
break;
case 44:
var M = r[t++] | r[t++] << 8, S = r[t++] | r[t++] << 8, V = r[t++] | r[t++] << 8, G = r[t++] | r[t++] << 8, D = r[t++], it = D >> 6 & 1, mt = 1 << 1 + (7 & D), ct = l, K = h, R = !1;
D >> 7 && (R = !0, ct = t, K = mt, t += 3 * mt);
var tt = t;
for (t++; ; ) {
var N;
if (!((N = r[t++]) >= 0)) throw Error("Invalid block size");
if (N === 0) break;
t += N;
}
m.push({ x: M, y: S, width: V, height: G, has_local_palette: R, palette_offset: ct, palette_size: K, data_offset: tt, data_length: t - tt, transparent_index: k, interlaced: !!it, delay: _, disposal: p });
break;
case 59:
d = !1;
break;
default:
throw new Error("Unknown gif block: 0x" + r[t - 1].toString(16));
}
this.numFrames = function() {
return m.length;
}, this.loopCount = function() {
return j;
}, this.frameInfo = function(F) {
if (F < 0 || F >= m.length) throw new Error("Frame index out of range.");
return m[F];
}, this.decodeAndBlitFrameBGRA = function(F, z) {
var U = this.frameInfo(F), nt = U.width * U.height, ot = new Uint8Array(nt);
Wu(r, U.data_offset, ot, nt);
var ut = U.palette_offset, rt = U.transparent_index;
rt === null && (rt = 256);
var ht = U.width, At = e - ht, wt = ht, x = 4 * (U.y * e + U.x), B = 4 * ((U.y + U.height) * e + U.x), T = x, H = 4 * At;
U.interlaced === !0 && (H += 4 * e * 7);
for (var J = 8, Z = 0, at = ot.length; Z < at; ++Z) {
var st = ot[Z];
if (wt === 0 && (wt = ht, (T += H) >= B && (H = 4 * At + 4 * e * (J - 1), T = x + (ht + At) * (J << 1), J >>= 1)), st === rt) T += 4;
else {
var gt = r[ut + 3 * st], _t = r[ut + 3 * st + 1], kt = r[ut + 3 * st + 2];
z[T++] = kt, z[T++] = _t, z[T++] = gt, z[T++] = 255;
}
--wt;
}
}, this.decodeAndBlitFrameRGBA = function(F, z) {
var U = this.frameInfo(F), nt = U.width * U.height, ot = new Uint8Array(nt);
Wu(r, U.data_offset, ot, nt);
var ut = U.palette_offset, rt = U.transparent_index;
rt === null && (rt = 256);
var ht = U.width, At = e - ht, wt = ht, x = 4 * (U.y * e + U.x), B = 4 * ((U.y + U.height) * e + U.x), T = x, H = 4 * At;
U.interlaced === !0 && (H += 4 * e * 7);
for (var J = 8, Z = 0, at = ot.length; Z < at; ++Z) {
var st = ot[Z];
if (wt === 0 && (wt = ht, (T += H) >= B && (H = 4 * At + 4 * e * (J - 1), T = x + (ht + At) * (J << 1), J >>= 1)), st === rt) T += 4;
else {
var gt = r[ut + 3 * st], _t = r[ut + 3 * st + 1], kt = r[ut + 3 * st + 2];
z[T++] = gt, z[T++] = _t, z[T++] = kt, z[T++] = 255;
}
--wt;
}
};
}
function Wu(r, t, e, i) {
for (var o = r[t++], a = 1 << o, c = a + 1, l = c + 1, h = o + 1, d = (1 << h) - 1, m = 0, _ = 0, k = 0, p = r[t++], j = new Int32Array(4096), O = null; ; ) {
for (; m < 16 && p !== 0; ) _ |= r[t++] << m, m += 8, p === 1 ? p = r[t++] : --p;
if (m < h) break;
var M = _ & d;
if (_ >>= h, m -= h, M !== a) {
if (M === c) break;
for (var S = M < l ? M : O, V = 0, G = S; G > a; ) G = j[G] >> 8, ++V;
var D = G;
if (k + V + (S !== M ? 1 : 0) > i) return void Le.log("Warning, gif stream longer than expected.");
e[k++] = D;
var it = k += V;
for (S !== M && (e[k++] = D), G = S; V--; ) G = j[G], e[--it] = 255 & G, G >>= 8;
O !== null && l < 4096 && (j[l++] = O << 8 | D, l >= d + 1 && h < 12 && (++h, d = d << 1 | 1)), O = M;
} else l = c + 1, d = (1 << (h = o + 1)) - 1, O = null;
}
return k !== i && Le.log("Warning, gif stream shorter than expected."), e;
}
function jo(r) {
var t, e, i, o, a, c = Math.floor, l = new Array(64), h = new Array(64), d = new Array(64), m = new Array(64), _ = new Array(65535), k = new Array(65535), p = new Array(64), j = new Array(64), O = [], M = 0, S = 7, V = new Array(64), G = new Array(64), D = new Array(64), it = new Array(256), mt = new Array(2048), ct = [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], K = [0, 0, 1, 5, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0], R = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], tt = [0, 0, 2, 1, 3, 3, 2, 4, 3, 5, 5, 4, 4, 0, 0, 1, 125], N = [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], F = [0, 0, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0], z = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11], U = [0, 0, 2, 1, 2, 4, 4, 3, 4, 7, 5, 4, 4, 0, 1, 2, 119], nt = [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 ot(x, B) {
for (var T = 0, H = 0, J = new Array(), Z = 1; Z <= 16; Z++) {
for (var at = 1; at <= x[Z]; at++) J[B[H]] = [], J[B[H]][0] = T, J[B[H]][1] = Z, H++, T++;
T *= 2;
}
return J;
}
function ut(x) {
for (var B = x[0], T = x[1] - 1; T >= 0; ) B & 1 << T && (M |= 1 << S), T--, --S < 0 && (M == 255 ? (rt(255), rt(0)) : rt(M), S = 7, M = 0);
}
function rt(x) {
O.push(x);
}
function ht(x) {
rt(x >> 8 & 255), rt(255 & x);
}
function At(x, B, T, H, J) {
for (var Z, at = J[0], st = J[240], gt = (function(yt, Wt) {
var Ct, zt, qt, ve, ue, Zt, he, fe, jt, ee, Tt = 0;
for (jt = 0; jt < 8; ++jt) {
Ct = yt[Tt], zt = yt[Tt + 1], qt = yt[Tt + 2], ve = yt[Tt + 3], ue = yt[Tt + 4], Zt = yt[Tt + 5], he = yt[Tt + 6];
var De = Ct + (fe = yt[Tt + 7]), pe = Ct - fe, se = zt + he, oe = zt - he, Fe = qt + Zt, Ut = qt - Zt, Se = ve + ue, Yt = ve - ue, Qt = De + Se, Ee = De - Se, le = se + Fe, Vt = se - Fe;
yt[Tt] = Qt + le, yt[Tt + 4] = Qt - le;
var be = 0.707106781 * (Vt + Ee);
yt[Tt + 2] = Ee + be, yt[Tt + 6] = Ee - be;
var ii = 0.382683433 * ((Qt = Yt + Ut) - (Vt = oe + pe)), fr = 0.5411961 * Qt + ii, gn = 1.306562965 * Vt + ii, en = 0.707106781 * (le = Ut + oe), Gt = pe + en, mn = pe - en;
yt[Tt + 5] = mn + fr, yt[Tt + 3] = mn - fr, yt[Tt + 1] = Gt + gn, yt[Tt + 7] = Gt - gn, Tt += 8;
}
for (Tt = 0, jt = 0; jt < 8; ++jt) {
Ct = yt[Tt], zt = yt[Tt + 8], qt = yt[Tt + 16], ve = yt[Tt + 24], ue = yt[Tt + 32], Zt = yt[Tt + 40], he = yt[Tt + 48];
var vn = Ct + (fe = yt[Tt + 56]), Or = Ct - fe, jr = zt + he, Be = zt - he, nr = qt + Zt, ir = qt - Zt, ai = ve + ue, Mn = ve - ue, Hr = vn + ai, rn = vn - ai, Wr = jr + nr, Vr = jr - nr;
yt[Tt] = Hr + Wr, yt[Tt + 32] = Hr - Wr;
var Br = 0.707106781 * (Vr + rn);
yt[Tt + 16] = rn + Br, yt[Tt + 48] = rn - Br;
var si = 0.382683433 * ((Hr = Mn + ir) - (Vr = Be + Or)), nn = 0.5411961 * Hr + si, oi = 1.306562965 * Vr + si, Ei = 0.707106781 * (Wr = ir + Be), Oi = Or + Ei, ji = Or - Ei;
yt[Tt + 40] = ji + nn, yt[Tt + 24] = ji - nn, yt[Tt + 8] = Oi + oi, yt[Tt + 56] = Oi - oi, Tt++;
}
for (jt = 0; jt < 64; ++jt) ee = yt[jt] * Wt[jt], p[jt] = ee > 0 ? ee + 0.5 | 0 : ee - 0.5 | 0;
return p;
})(x, B), _t = 0; _t < 64; ++_t) j[ct[_t]] = gt[_t];
var kt = j[0] - T;
T = j[0], kt == 0 ? ut(H[0]) : (ut(H[k[Z = 32767 + kt]]), ut(_[Z]));
for (var St = 63; St > 0 && j[St] == 0; ) St--;
if (St == 0) return ut(at), T;
for (var Dt, P = 1; P <= St; ) {
for (var Lt = P; j[P] == 0 && P <= St; ) ++P;
var ae = P - Lt;
if (ae >= 16) {
Dt = ae >> 4;
for (var Ht = 1; Ht <= Dt; ++Ht) ut(st);
ae &= 15;
}
Z = 32767 + j[P], ut(J[(ae << 4) + k[Z]]), ut(_[Z]), P++;
}
return St != 63 && ut(at), T;
}
function wt(x) {
x = Math.min(Math.max(x, 1), 100), a != x && ((function(B) {
for (var T = [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], H = 0; H < 64; H++) {
var J = c((T[H] * B + 50) / 100);
J = Math.min(Math.max(J, 1), 255), l[ct[H]] = J;
}
for (var Z = [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], at = 0; at < 64; at++) {
var st = c((Z[at] * B + 50) / 100);
st = Math.min(Math.max(st, 1), 255), h[ct[at]] = st;
}
for (var gt = [1, 1.387039845, 1.306562965, 1.175875602, 1, 0.785694958, 0.5411961, 0.275899379], _t = 0, kt = 0; kt < 8; kt++) for (var St = 0; St < 8; St++) d[_t] = 1 / (l[ct[_t]] * gt[kt] * gt[St] * 8), m[_t] = 1 / (h[ct[_t]] * gt[kt] * gt[St] * 8), _t++;
})(x < 50 ? Math.floor(5e3 / x) : Math.floor(200 - 2 * x)), a = x);
}
this.encode = function(x, B) {
B && wt(B), O = new Array(), M = 0, S = 7, ht(65496), ht(65504), ht(16), rt(74), rt(70), rt(73), rt(70), rt(0), rt(1), rt(1), rt(0), ht(1), ht(1), rt(0), rt(0), (function() {
ht(65499), ht(132), rt(0);
for (var zt = 0; zt < 64; zt++) rt(l[zt]);
rt(1);
for (var qt = 0; qt < 64; qt++) rt(h[qt]);
})(), (function(zt, qt) {
ht(65472), ht(17), rt(8), ht(qt), ht(zt), rt(3), rt(1), rt(17), rt(0), rt(2), rt(17), rt(1), rt(3), rt(17), rt(1);
})(x.width, x.height), (function() {
ht(65476), ht(418), rt(0);
for (var zt = 0; zt < 16; zt++) rt(K[zt + 1]);
for (var qt = 0; qt <= 11; qt++) rt(R[qt]);
rt(16);
for (var ve = 0; ve < 16; ve++) rt(tt[ve + 1]);
for (var ue = 0; ue <= 161; ue++) rt(N[ue]);
rt(1);
for (var Zt = 0; Zt < 16; Zt++) rt(F[Zt + 1]);
for (var he = 0; he <= 11; he++) rt(z[he]);
rt(17);
for (var fe = 0; fe < 16; fe++) rt(U[fe + 1]);
for (var jt = 0; jt <= 161; jt++) rt(nt[jt]);
})(), ht(65498), ht(12), rt(3), rt(1), rt(0), rt(2), rt(17), rt(3), rt(17), rt(0), rt(63), rt(0);
var T = 0, H = 0, J = 0;
M = 0, S = 7, this.encode.displayName = "_encode_";
for (var Z, at, st, gt, _t, kt, St, Dt, P, Lt = x.data, ae = x.width, Ht = x.height, yt = 4 * ae, Wt = 0; Wt < Ht; ) {
for (Z = 0; Z < yt; ) {
for (_t = yt * Wt + Z, St = -1, Dt = 0, P = 0; P < 64; P++) kt = _t + (Dt = P >> 3) * yt + (St = 4 * (7 & P)), Wt + Dt >= Ht && (kt -= yt * (Wt + 1 + Dt - Ht)), Z + St >= yt && (kt -= Z + St - yt + 4), at = Lt[kt++], st = Lt[kt++], gt = Lt[kt++], V[P] = (mt[at] + mt[st + 256 | 0] + mt[gt + 512 | 0] >> 16) - 128, G[P] = (mt[at + 768 | 0] + mt[st + 1024 | 0] + mt[gt + 1280 | 0] >> 16) - 128, D[P] = (mt[at + 1280 | 0] + mt[st + 1536 | 0] + mt[gt + 1792 | 0] >> 16) - 128;
T = At(V, d, T, t, i), H = At(G, m, H, e, o), J = At(D, m, J, e, o), Z += 32;
}
Wt += 8;
}
if (S >= 0) {
var Ct = [];
Ct[1] = S + 1, Ct[0] = (1 << S + 1) - 1, ut(Ct);
}
return ht(65497), new Uint8Array(O);
}, r = r || 50, (function() {
for (var x = String.fromCharCode, B = 0; B < 256; B++) it[B] = x(B);
})(), t = ot(K, R), e = ot(F, z), i = ot(tt, N), o = ot(U, nt), (function() {
for (var x = 1, B = 2, T = 1; T <= 15; T++) {
for (var H = x; H < B; H++) k[32767 + H] = T, _[32767 + H] = [], _[32767 + H][1] = T, _[32767 + H][0] = H;
for (var J = -(B - 1); J <= -x; J++) k[32767 + J] = T, _[32767 + J] = [], _[32767 + J][1] = T, _[32767 + J][0] = B - 1 + J;
x <<= 1, B <<= 1;
}
})(), (function() {
for (var x = 0; x < 256; x++) mt[x] = 19595 * x, mt[x + 256 | 0] = 38470 * x, mt[x + 512 | 0] = 7471 * x + 32768, mt[x + 768 | 0] = -11059 * x, mt[x + 1024 | 0] = -21709 * x, mt[x + 1280 | 0] = 32768 * x + 8421375, mt[x + 1536 | 0] = -27439 * x, mt[x + 1792 | 0] = -5329 * x;
})(), wt(r);
}
function $r(r, t) {
if (this.pos = 0, this.buffer = r, this.datav = new DataView(r.buffer), this.is_with_alpha = !!t, 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 Vu(r) {
function t(R) {
if (!R) throw Error("assert :P");
}
function e(R, tt, N) {
for (var F = 0; 4 > F; F++) if (R[tt + F] != N.charCodeAt(F)) return !0;
return !1;
}
function i(R, tt, N, F, z) {
for (var U = 0; U < z; U++) R[tt + U] = N[F + U];
}
function o(R, tt, N, F) {
for (var z = 0; z < F; z++) R[tt + z] = N;
}
function a(R) {
return new Int32Array(R);
}
function c(R, tt) {
for (var N = [], F = 0; F < R; F++) N.push(new tt());
return N;
}
function l(R, tt) {
var N = [];
return (function F(z, U, nt) {
for (var ot = nt[U], ut = 0; ut < ot && (z.push(nt.length > U + 1 ? [] : new tt()), !(nt.length < U + 1)); ut++) F(z[ut], U + 1, nt);
})(N, 0, R), N;
}
var h = function() {
var R = this;
function tt(n, s) {
for (var f = 1 << s - 1 >>> 0; n & f; ) f >>>= 1;
return f ? (n & f - 1) + f : n;
}
function N(n, s, f, g, b) {
t(!(g % f));
do
n[s + (g -= f)] = b;
while (0 < g);
}
function F(n, s, f, g, b) {
if (t(2328 >= b), 512 >= b) var w = a(512);
else if ((w = a(b)) == null) return 0;
return (function(y, A, L, I, W, et) {
var C, Y, $ = A, lt = 1 << L, Q = a(16), ft = a(16);
for (t(W != 0), t(I != null), t(y != null), t(0 < L), Y = 0; Y < W; ++Y) {
if (15 < I[Y]) return 0;
++Q[I[Y]];
}
if (Q[0] == W) return 0;
for (ft[1] = 0, C = 1; 15 > C; ++C) {
if (Q[C] > 1 << C) return 0;
ft[C + 1] = ft[C] + Q[C];
}
for (Y = 0; Y < W; ++Y) C = I[Y], 0 < I[Y] && (et[ft[C]++] = Y);
if (ft[15] == 1) return (I = new z()).g = 0, I.value = et[0], N(y, $, 1, lt, I), lt;
var pt, xt = -1, bt = lt - 1, Rt = 0, Pt = 1, ne = 1, Et = 1 << L;
for (Y = 0, C = 1, W = 2; C <= L; ++C, W <<= 1) {
if (Pt += ne <<= 1, 0 > (ne -= Q[C])) return 0;
for (; 0 < Q[C]; --Q[C]) (I = new z()).g = C, I.value = et[Y++], N(y, $ + Rt, W, Et, I), Rt = tt(Rt, C);
}
for (C = L + 1, W = 2; 15 >= C; ++C, W <<= 1) {
if (Pt += ne <<= 1, 0 > (ne -= Q[C])) return 0;
for (; 0 < Q[C]; --Q[C]) {
if (I = new z(), (Rt & bt) != xt) {
for ($ += Et, pt = 1 << (xt = C) - L; 15 > xt && !(0 >= (pt -= Q[xt])); ) ++xt, pt <<= 1;
lt += Et = 1 << (pt = xt - L), y[A + (xt = Rt & bt)].g = pt + L, y[A + xt].value = $ - A - xt;
}
I.g = C - L, I.value = et[Y++], N(y, $ + (Rt >> L), W, Et, I), Rt = tt(Rt, C);
}
}
return Pt != 2 * ft[15] - 1 ? 0 : lt;
})(n, s, f, g, b, w);
}
function z() {
this.value = this.g = 0;
}
function U() {
this.value = this.g = 0;
}
function nt() {
this.G = c(5, z), this.H = a(5), this.jc = this.Qb = this.qb = this.nd = 0, this.pd = c(bi, U);
}
function ot(n, s, f, g) {
t(n != null), t(s != null), t(2147483648 > g), n.Ca = 254, n.I = 0, n.b = -8, n.Ka = 0, n.oa = s, n.pa = f, n.Jd = s, n.Yc = f + g, n.Zc = 4 <= g ? f + g - 4 + 1 : f, at(n);
}
function ut(n, s) {
for (var f = 0; 0 < s--; ) f |= gt(n, 128) << s;
return f;
}
function rt(n, s) {
var f = ut(n, s);
return st(n) ? -f : f;
}
function ht(n, s, f, g) {
var b, w = 0;
for (t(n != null), t(s != null), t(4294967288 > g), n.Sb = g, n.Ra = 0, n.u = 0, n.h = 0, 4 < g && (g = 4), b = 0; b < g; ++b) w += s[f + b] << 8 * b;
n.Ra = w, n.bb = g, n.oa = s, n.pa = f;
}
function At(n) {
for (; 8 <= n.u && n.bb < n.Sb; ) n.Ra >>>= 8, n.Ra += n.oa[n.pa + n.bb] << qn - 8 >>> 0, ++n.bb, n.u -= 8;
H(n) && (n.h = 1, n.u = 0);
}
function wt(n, s) {
if (t(0 <= s), !n.h && s <= Nr) {
var f = T(n) & Ar[s];
return n.u += s, At(n), f;
}
return n.h = 1, n.u = 0;
}
function x() {
this.b = this.Ca = this.I = 0, this.oa = [], this.pa = 0, this.Jd = [], this.Yc = 0, this.Zc = [], this.Ka = 0;
}
function B() {
this.Ra = 0, this.oa = [], this.h = this.u = this.bb = this.Sb = this.pa = 0;
}
function T(n) {
return n.Ra >>> (n.u & qn - 1) >>> 0;
}
function H(n) {
return t(n.bb <= n.Sb), n.h || n.bb == n.Sb && n.u > qn;
}
function J(n, s) {
n.u = s, n.h = H(n);
}
function Z(n) {
n.u >= Pn && (t(n.u >= Pn), At(n));
}
function at(n) {
t(n != null && n.oa != null), n.pa < n.Zc ? (n.I = (n.oa[n.pa++] | n.I << 8) >>> 0, n.b += 8) : (t(n != null && n.oa != null), n.pa < n.Yc ? (n.b += 8, n.I = n.oa[n.pa++] | n.I << 8) : n.Ka ? n.b = 0 : (n.I <<= 8, n.b += 8, n.Ka = 1));
}
function st(n) {
return ut(n, 1);
}
function gt(n, s) {
var f = n.Ca;
0 > n.b && at(n);
var g = n.b, b = f * s >>> 8, w = (n.I >>> g > b) + 0;
for (w ? (f -= b, n.I -= b + 1 << g >>> 0) : f = b + 1, g = f, b = 0; 256 <= g; ) b += 8, g >>= 8;
return g = 7 ^ b + Un[g], n.b -= g, n.Ca = (f << g) - 1, w;
}
function _t(n, s, f) {
n[s + 0] = f >> 24 & 255, n[s + 1] = f >> 16 & 255, n[s + 2] = f >> 8 & 255, n[s + 3] = 255 & f;
}
function kt(n, s) {
return n[s + 0] | n[s + 1] << 8;
}
function St(n, s) {
return kt(n, s) | n[s + 2] << 16;
}
function Dt(n, s) {
return kt(n, s) | kt(n, s + 2) << 16;
}
function P(n, s) {
var f = 1 << s;
return t(n != null), t(0 < s), n.X = a(f), n.X == null ? 0 : (n.Mb = 32 - s, n.Xa = s, 1);
}
function Lt(n, s) {
t(n != null), t(s != null), t(n.Xa == s.Xa), i(s.X, 0, n.X, 0, 1 << s.Xa);
}
function ae() {
this.X = [], this.Xa = this.Mb = 0;
}
function Ht(n, s, f, g) {
t(f != null), t(g != null);
var b = f[0], w = g[0];
return b == 0 && (b = (n * w + s / 2) / s), w == 0 && (w = (s * b + n / 2) / n), 0 >= b || 0 >= w ? 0 : (f[0] = b, g[0] = w, 1);
}
function yt(n, s) {
return n + (1 << s) - 1 >>> s;
}
function Wt(n, s) {
return ((4278255360 & n) + (4278255360 & s) >>> 0 & 4278255360) + ((16711935 & n) + (16711935 & s) >>> 0 & 16711935) >>> 0;
}
function Ct(n, s) {
R[s] = function(f, g, b, w, y, A, L) {
var I;
for (I = 0; I < y; ++I) {
var W = R[n](A[L + I - 1], b, w + I);
A[L + I] = Wt(f[g + I], W);
}
};
}
function zt() {
this.ud = this.hd = this.jd = 0;
}
function qt(n, s) {
return ((4278124286 & (n ^ s)) >>> 1) + (n & s) >>> 0;
}
function ve(n) {
return 0 <= n && 256 > n ? n : 0 > n ? 0 : 255 < n ? 255 : void 0;
}
function ue(n, s) {
return ve(n + (n - s + 0.5 >> 1));
}
function Zt(n, s, f) {
return Math.abs(s - f) - Math.abs(n - f);
}
function he(n, s, f, g, b, w, y) {
for (g = w[y - 1], f = 0; f < b; ++f) w[y + f] = g = Wt(n[s + f], g);
}
function fe(n, s, f, g, b) {
var w;
for (w = 0; w < f; ++w) {
var y = n[s + w], A = y >> 8 & 255, L = 16711935 & (L = (L = 16711935 & y) + ((A << 16) + A));
g[b + w] = (4278255360 & y) + L >>> 0;
}
}
function jt(n, s) {
s.jd = 255 & n, s.hd = n >> 8 & 255, s.ud = n >> 16 & 255;
}
function ee(n, s, f, g, b, w) {
var y;
for (y = 0; y < g; ++y) {
var A = s[f + y], L = A >>> 8, I = A, W = 255 & (W = (W = A >>> 16) + ((n.jd << 24 >> 24) * (L << 24 >> 24) >>> 5));
I = 255 & (I = (I += (n.hd << 24 >> 24) * (L << 24 >> 24) >>> 5) + ((n.ud << 24 >> 24) * (W << 24 >> 24) >>> 5)), b[w + y] = (4278255360 & A) + (W << 16) + I;
}
}
function Tt(n, s, f, g, b) {
R[s] = function(w, y, A, L, I, W, et, C, Y) {
for (L = et; L < C; ++L) for (et = 0; et < Y; ++et) I[W++] = b(A[g(w[y++])]);
}, R[n] = function(w, y, A, L, I, W, et) {
var C = 8 >> w.b, Y = w.Ea, $ = w.K[0], lt = w.w;
if (8 > C) for (w = (1 << w.b) - 1, lt = (1 << C) - 1; y < A; ++y) {
var Q, ft = 0;
for (Q = 0; Q < Y; ++Q) Q & w || (ft = g(L[I++])), W[et++] = b($[ft & lt]), ft >>= C;
}
else R["VP8LMapColor" + f](L, I, $, lt, W, et, y, A, Y);
};
}
function De(n, s, f, g, b) {
for (f = s + f; s < f; ) {
var w = n[s++];
g[b++] = w >> 16 & 255, g[b++] = w >> 8 & 255, g[b++] = 255 & w;
}
}
function pe(n, s, f, g, b) {
for (f = s + f; s < f; ) {
var w = n[s++];
g[b++] = w >> 16 & 255, g[b++] = w >> 8 & 255, g[b++] = 255 & w, g[b++] = w >> 24 & 255;
}
}
function se(n, s, f, g, b) {
for (f = s + f; s < f; ) {
var w = (y = n[s++]) >> 16 & 240 | y >> 12 & 15, y = 240 & y | y >> 28 & 15;
g[b++] = w, g[b++] = y;
}
}
function oe(n, s, f, g, b) {
for (f = s + f; s < f; ) {
var w = (y = n[s++]) >> 16 & 248 | y >> 13 & 7, y = y >> 5 & 224 | y >> 3 & 31;
g[b++] = w, g[b++] = y;
}
}
function Fe(n, s, f, g, b) {
for (f = s + f; s < f; ) {
var w = n[s++];
g[b++] = 255 & w, g[b++] = w >> 8 & 255, g[b++] = w >> 16 & 255;
}
}
function Ut(n, s, f, g, b, w) {
if (w == 0) for (f = s + f; s < f; ) _t(g, ((w = n[s++])[0] >> 24 | w[1] >> 8 & 65280 | w[2] << 8 & 16711680 | w[3] << 24) >>> 0), b += 32;
else i(g, b, n, s, f);
}
function Se(n, s) {
R[s][0] = R[n + "0"], R[s][1] = R[n + "1"], R[s][2] = R[n + "2"], R[s][3] = R[n + "3"], R[s][4] = R[n + "4"], R[s][5] = R[n + "5"], R[s][6] = R[n + "6"], R[s][7] = R[n + "7"], R[s][8] = R[n + "8"], R[s][9] = R[n + "9"], R[s][10] = R[n + "10"], R[s][11] = R[n + "11"], R[s][12] = R[n + "12"], R[s][13] = R[n + "13"], R[s][14] = R[n + "0"], R[s][15] = R[n + "0"];
}
function Yt(n) {
return n == Qs || n == to || n == ls || n == eo;
}
function Qt() {
this.eb = [], this.size = this.A = this.fb = 0;
}
function Ee() {
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 le() {
this.Rd = this.height = this.width = this.S = 0, this.f = {}, this.f.RGBA = new Qt(), this.f.kb = new Ee(), this.sd = null;
}
function Vt() {
this.width = [0], this.height = [0], this.Pd = [0], this.Qd = [0], this.format = [0];
}
function be() {
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 ii(n) {
return alert("todo:WebPSamplerProcessPlane"), n.T;
}
function fr(n, s) {
var f = n.T, g = s.ba.f.RGBA, b = g.eb, w = g.fb + n.ka * g.A, y = Ur[s.ba.S], A = n.y, L = n.O, I = n.f, W = n.N, et = n.ea, C = n.W, Y = s.cc, $ = s.dc, lt = s.Mc, Q = s.Nc, ft = n.ka, pt = n.ka + n.T, xt = n.U, bt = xt + 1 >> 1;
for (ft == 0 ? y(A, L, null, null, I, W, et, C, I, W, et, C, b, w, null, null, xt) : (y(s.ec, s.fc, A, L, Y, $, lt, Q, I, W, et, C, b, w - g.A, b, w, xt), ++f); ft + 2 < pt; ft += 2) Y = I, $ = W, lt = et, Q = C, W += n.Rc, C += n.Rc, w += 2 * g.A, y(A, (L += 2 * n.fa) - n.fa, A, L, Y, $, lt, Q, I, W, et, C, b, w - g.A, b, w, xt);
return L += n.fa, n.j + pt < n.o ? (i(s.ec, s.fc, A, L, xt), i(s.cc, s.dc, I, W, bt), i(s.Mc, s.Nc, et, C, bt), f--) : 1 & pt || y(A, L, null, null, I, W, et, C, I, W, et, C, b, w + g.A, null, null, xt), f;
}
function gn(n, s, f) {
var g = n.F, b = [n.J];
if (g != null) {
var w = n.U, y = s.ba.S, A = y == os || y == ls;
s = s.ba.f.RGBA;
var L = [0], I = n.ka;
L[0] = n.T, n.Kb && (I == 0 ? --L[0] : (--I, b[0] -= n.width), n.j + n.ka + n.T == n.o && (L[0] = n.o - n.j - I));
var W = s.eb;
I = s.fb + I * s.A, n = il(g, b[0], n.width, w, L, W, I + (A ? 0 : 3), s.A), t(f == L), n && Yt(y) && wa(W, I, A, w, L, s.A);
}
return 0;
}
function en(n) {
var s = n.ma, f = s.ba.S, g = 11 > f, b = f == as || f == ss || f == os || f == Zs || f == 12 || Yt(f);
if (s.memory = null, s.Ib = null, s.Jb = null, s.Nd = null, !ha(s.Oa, n, b ? 11 : 12)) return 0;
if (b && Yt(f) && la(), n.da) alert("todo:use_scaling");
else {
if (g) {
if (s.Ib = ii, n.Kb) {
if (f = n.U + 1 >> 1, s.memory = a(n.U + 2 * f), s.memory == null) return 0;
s.ec = s.memory, s.fc = 0, s.cc = s.ec, s.dc = s.fc + n.U, s.Mc = s.cc, s.Nc = s.dc + f, s.Ib = fr, la();
}
} else alert("todo:EmitYUV");
b && (s.Jb = gn, g && Yr());
}
if (g && !yl) {
for (n = 0; 256 > n; ++n) nh[n] = 89858 * (n - 128) + fs >> us, sh[n] = -22014 * (n - 128) + fs, ah[n] = -45773 * (n - 128), ih[n] = 113618 * (n - 128) + fs >> us;
for (n = xa; n < io; ++n) s = 76283 * (n - 16) + fs >> us, oh[n - xa] = an(s, 255), lh[n - xa] = an(s + 8 >> 4, 15);
yl = 1;
}
return 1;
}
function Gt(n) {
var s = n.ma, f = n.U, g = n.T;
return t(!(1 & n.ka)), 0 >= f || 0 >= g ? 0 : (f = s.Ib(n, s), s.Jb != null && s.Jb(n, s, f), s.Dc += f, 1);
}
function mn(n) {
n.ma.memory = null;
}
function vn(n, s, f, g) {
return wt(n, 8) != 47 ? 0 : (s[0] = wt(n, 14) + 1, f[0] = wt(n, 14) + 1, g[0] = wt(n, 1), wt(n, 3) != 0 ? 0 : !n.h);
}
function Or(n, s) {
if (4 > n) return n + 1;
var f = n - 2 >> 1;
return (2 + (1 & n) << f) + wt(s, f) + 1;
}
function jr(n, s) {
return 120 < s ? s - 120 : 1 <= (f = ((f = Hf[s - 1]) >> 4) * n + (8 - (15 & f))) ? f : 1;
var f;
}
function Be(n, s, f) {
var g = T(f), b = n[s += 255 & g].g - 8;
return 0 < b && (J(f, f.u + 8), g = T(f), s += n[s].value, s += g & (1 << b) - 1), J(f, f.u + n[s].g), n[s].value;
}
function nr(n, s, f) {
return f.g += n.g, f.value += n.value << s >>> 0, t(8 >= f.g), n.g;
}
function ir(n, s, f) {
var g = n.xc;
return t((s = g == 0 ? 0 : n.vc[n.md * (f >> g) + (s >> g)]) < n.Wb), n.Ya[s];
}
function ai(n, s, f, g) {
var b = n.ab, w = n.c * s, y = n.C;
s = y + s;
var A = f, L = g;
for (g = n.Ta, f = n.Ua; 0 < b--; ) {
var I = n.gc[b], W = y, et = s, C = A, Y = L, $ = (L = g, A = f, I.Ea);
switch (t(W < et), t(et <= I.nc), I.hc) {
case 2:
qe(C, Y, (et - W) * $, L, A);
break;
case 0:
var lt = W, Q = et, ft = L, pt = A, xt = (Et = I).Ea;
lt == 0 && (da(C, Y, null, null, 1, ft, pt), he(C, Y + 1, 0, 0, xt - 1, ft, pt + 1), Y += xt, pt += xt, ++lt);
for (var bt = 1 << Et.b, Rt = bt - 1, Pt = yt(xt, Et.b), ne = Et.K, Et = Et.w + (lt >> Et.b) * Pt; lt < Q; ) {
var ce = ne, Qe = Et, ie = 1;
for (zi(C, Y, ft, pt - xt, 1, ft, pt); ie < xt; ) {
var Ot = (ie & ~Rt) + bt;
Ot > xt && (Ot = xt), (0, ga[ce[Qe++] >> 8 & 15])(C, Y + +ie, ft, pt + ie - xt, Ot - ie, ft, pt + ie), ie = Ot;
}
Y += xt, pt += xt, ++lt & Rt || (Et += Pt);
}
et != I.nc && i(L, A - $, L, A + (et - W - 1) * $, $);
break;
case 1:
for ($ = C, Q = Y, xt = (C = I.Ea) - (pt = C & ~(ft = (Y = 1 << I.b) - 1)), lt = yt(C, I.b), bt = I.K, I = I.w + (W >> I.b) * lt; W < et; ) {
for (Rt = bt, Pt = I, ne = new zt(), Et = Q + pt, ce = Q + C; Q < Et; ) jt(Rt[Pt++], ne), ma(ne, $, Q, Y, L, A), Q += Y, A += Y;
Q < ce && (jt(Rt[Pt++], ne), ma(ne, $, Q, xt, L, A), Q += xt, A += xt), ++W & ft || (I += lt);
}
break;
case 3:
if (C == L && Y == A && 0 < I.b) {
for (Q = L, C = $ = A + (et - W) * $ - (pt = (et - W) * yt(I.Ea, I.b)), Y = L, ft = A, lt = [], pt = (xt = pt) - 1; 0 <= pt; --pt) lt[pt] = Y[ft + pt];
for (pt = xt - 1; 0 <= pt; --pt) Q[C + pt] = lt[pt];
es(I, W, et, L, $, L, A);
} else es(I, W, et, C, Y, L, A);
}
A = g, L = f;
}
L != f && i(g, f, A, L, w);
}
function Mn(n, s) {
var f = n.V, g = n.Ba + n.c * n.C, b = s - n.C;
if (t(s <= n.l.o), t(16 >= b), 0 < b) {
var w = n.l, y = n.Ta, A = n.Ua, L = w.width;
if (ai(n, b, f, g), b = A = [A], t((f = n.C) < (g = s)), t(w.v < w.va), g > w.o && (g = w.o), f < w.j) {
var I = w.j - f;
f = w.j, b[0] += I * L;
}
if (f >= g ? f = 0 : (b[0] += 4 * w.v, w.ka = f - w.j, w.U = w.va - w.v, w.T = g - f, f = 1), f) {
if (A = A[0], 11 > (f = n.ca).S) {
var W = f.f.RGBA, et = (g = f.S, b = w.U, w = w.T, I = W.eb, W.A), C = w;
for (W = W.fb + n.Ma * W.A; 0 < C--; ) {
var Y = y, $ = A, lt = b, Q = I, ft = W;
switch (g) {
case is:
va(Y, $, lt, Q, ft);
break;
case as:
zn(Y, $, lt, Q, ft);
break;
case Qs:
zn(Y, $, lt, Q, ft), wa(Q, ft, 0, lt, 1, 0);
break;
case hl:
wi(Y, $, lt, Q, ft);
break;
case ss:
Ut(Y, $, lt, Q, ft, 1);
break;
case to:
Ut(Y, $, lt, Q, ft, 1), wa(Q, ft, 0, lt, 1, 0);
break;
case os:
Ut(Y, $, lt, Q, ft, 0);
break;
case ls:
Ut(Y, $, lt, Q, ft, 0), wa(Q, ft, 1, lt, 1, 0);
break;
case Zs:
Hn(Y, $, lt, Q, ft);
break;
case eo:
Hn(Y, $, lt, Q, ft), nl(Q, ft, lt, 1, 0);
break;
case cl:
Wn(Y, $, lt, Q, ft);
break;
default:
t(0);
}
A += L, W += et;
}
n.Ma += w;
} else alert("todo:EmitRescaledRowsYUVA");
t(n.Ma <= f.height);
}
}
n.C = s, t(n.C <= n.i);
}
function Hr(n) {
var s;
if (0 < n.ua) return 0;
for (s = 0; s < n.Wb; ++s) {
var f = n.Ya[s].G, g = n.Ya[s].H;
if (0 < f[1][g[1] + 0].g || 0 < f[2][g[2] + 0].g || 0 < f[3][g[3] + 0].g) return 0;
}
return 1;
}
function rn(n, s, f, g, b, w) {
if (n.Z != 0) {
var y = n.qd, A = n.rd;
for (t(Yn[n.Z] != null); s < f; ++s) Yn[n.Z](y, A, g, b, g, b, w), y = g, A = b, b += w;
n.qd = y, n.rd = A;
}
}
function Wr(n, s) {
var f = n.l.ma, g = f.Z == 0 || f.Z == 1 ? n.l.j : n.C;
if (g = n.C < g ? g : n.C, t(s <= n.l.o), s > g) {
var b = n.l.width, w = f.ca, y = f.tb + b * g, A = n.V, L = n.Ba + n.c * g, I = n.gc;
t(n.ab == 1), t(I[0].hc == 3), un(I[0], g, s, A, L, w, y), rn(f, g, s, w, y, b);
}
n.C = n.Ma = s;
}
function Vr(n, s, f, g, b, w, y) {
var A = n.$ / g, L = n.$ % g, I = n.m, W = n.s, et = f + n.$, C = et;
b = f + g * b;
var Y = f + g * w, $ = 280 + W.ua, lt = n.Pb ? A : 16777216, Q = 0 < W.ua ? W.Wa : null, ft = W.wc, pt = et < Y ? ir(W, L, A) : null;
t(n.C < w), t(Y <= b);
var xt = !1;
t: for (; ; ) {
for (; xt || et < Y; ) {
var bt = 0;
if (A >= lt) {
var Rt = et - f;
t((lt = n).Pb), lt.wd = lt.m, lt.xd = Rt, 0 < lt.s.ua && Lt(lt.s.Wa, lt.s.vb), lt = A + Vf;
}
if (L & ft || (pt = ir(W, L, A)), t(pt != null), pt.Qb && (s[et] = pt.qb, xt = !0), !xt) if (Z(I), pt.jc) {
bt = I, Rt = s;
var Pt = et, ne = pt.pd[T(bt) & bi - 1];
t(pt.jc), 256 > ne.g ? (J(bt, bt.u + ne.g), Rt[Pt] = ne.value, bt = 0) : (J(bt, bt.u + ne.g - 256), t(256 <= ne.value), bt = ne.value), bt == 0 && (xt = !0);
} else bt = Be(pt.G[0], pt.H[0], I);
if (I.h) break;
if (xt || 256 > bt) {
if (!xt) if (pt.nd) s[et] = (pt.qb | bt << 8) >>> 0;
else {
if (Z(I), xt = Be(pt.G[1], pt.H[1], I), Z(I), Rt = Be(pt.G[2], pt.H[2], I), Pt = Be(pt.G[3], pt.H[3], I), I.h) break;
s[et] = (Pt << 24 | xt << 16 | bt << 8 | Rt) >>> 0;
}
if (xt = !1, ++et, ++L >= g && (L = 0, ++A, y != null && A <= w && !(A % 16) && y(n, A), Q != null)) for (; C < et; ) bt = s[C++], Q.X[(506832829 * bt & 4294967295) >>> Q.Mb] = bt;
} else if (280 > bt) {
if (bt = Or(bt - 256, I), Rt = Be(pt.G[4], pt.H[4], I), Z(I), Rt = jr(g, Rt = Or(Rt, I)), I.h) break;
if (et - f < Rt || b - et < bt) break t;
for (Pt = 0; Pt < bt; ++Pt) s[et + Pt] = s[et + Pt - Rt];
for (et += bt, L += bt; L >= g; ) L -= g, ++A, y != null && A <= w && !(A % 16) && y(n, A);
if (t(et <= b), L & ft && (pt = ir(W, L, A)), Q != null) for (; C < et; ) bt = s[C++], Q.X[(506832829 * bt & 4294967295) >>> Q.Mb] = bt;
} else {
if (!(bt < $)) break t;
for (xt = bt - 280, t(Q != null); C < et; ) bt = s[C++], Q.X[(506832829 * bt & 4294967295) >>> Q.Mb] = bt;
bt = et, t(!(xt >>> (Rt = Q).Xa)), s[bt] = Rt.X[xt], xt = !0;
}
xt || t(I.h == H(I));
}
if (n.Pb && I.h && et < b) t(n.m.h), n.a = 5, n.m = n.wd, n.$ = n.xd, 0 < n.s.ua && Lt(n.s.vb, n.s.Wa);
else {
if (I.h) break t;
y?.(n, A > w ? w : A), n.a = 0, n.$ = et - f;
}
return 1;
}
return n.a = 3, 0;
}
function Br(n) {
t(n != null), n.vc = null, n.yc = null, n.Ya = null;
var s = n.Wa;
s != null && (s.X = null), n.vb = null, t(n != null);
}
function si() {
var n = new Kt();
return n == null ? null : (n.a = 0, n.xb = gl, Se("Predictor", "VP8LPredictors"), Se("Predictor", "VP8LPredictors_C"), Se("PredictorAdd", "VP8LPredictorsAdd"), Se("PredictorAdd", "VP8LPredictorsAdd_C"), qe = fe, ma = ee, va = De, zn = pe, Hn = se, Wn = oe, wi = Fe, R.VP8LMapColor32b = ln, R.VP8LMapColor8b = pa, n);
}
function nn(n, s, f, g, b) {
var w = 1, y = [n], A = [s], L = g.m, I = g.s, W = null, et = 0;
t: for (; ; ) {
if (f) for (; w && wt(L, 1); ) {
var C = y, Y = A, $ = g, lt = 1, Q = $.m, ft = $.gc[$.ab], pt = wt(Q, 2);
if ($.Oc & 1 << pt) w = 0;
else {
switch ($.Oc |= 1 << pt, ft.hc = pt, ft.Ea = C[0], ft.nc = Y[0], ft.K = [null], ++$.ab, t(4 >= $.ab), pt) {
case 0:
case 1:
ft.b = wt(Q, 3) + 2, lt = nn(yt(ft.Ea, ft.b), yt(ft.nc, ft.b), 0, $, ft.K), ft.K = ft.K[0];
break;
case 3:
var xt, bt = wt(Q, 8) + 1, Rt = 16 < bt ? 0 : 4 < bt ? 1 : 2 < bt ? 2 : 3;
if (C[0] = yt(ft.Ea, Rt), ft.b = Rt, xt = lt = nn(bt, 1, 0, $, ft.K)) {
var Pt, ne = bt, Et = ft, ce = 1 << (8 >> Et.b), Qe = a(ce);
if (Qe == null) xt = 0;
else {
var ie = Et.K[0], Ot = Et.w;
for (Qe[0] = Et.K[0][0], Pt = 1; Pt < 1 * ne; ++Pt) Qe[Pt] = Wt(ie[Ot + Pt], Qe[Pt - 1]);
for (; Pt < 4 * ce; ++Pt) Qe[Pt] = 0;
Et.K[0] = null, Et.K[0] = Qe, xt = 1;
}
}
lt = xt;
break;
case 2:
break;
default:
t(0);
}
w = lt;
}
}
if (y = y[0], A = A[0], w && wt(L, 1) && !(w = 1 <= (et = wt(L, 4)) && 11 >= et)) {
g.a = 3;
break t;
}
var Nt;
if (Nt = w) e: {
var ze, te, de, Ie = g, or = y, vr = A, Me = et, hr = f, br = Ie.m, tr = Ie.s, me = [null], ye = 1, Re = 0, xe = Wf[Me];
r: for (; ; ) {
if (hr && wt(br, 1)) {
var lr = wt(br, 3) + 2, Kr = yt(or, lr), He = yt(vr, lr), yr = Kr * He;
if (!nn(Kr, He, 0, Ie, me)) break r;
for (me = me[0], tr.xc = lr, ze = 0; ze < yr; ++ze) {
var Ne = me[ze] >> 8 & 65535;
me[ze] = Ne, Ne >= ye && (ye = Ne + 1);
}
}
if (br.h) break r;
for (te = 0; 5 > te; ++te) {
var er = dl[te];
!te && 0 < Me && (er += 1 << Me), Re < er && (Re = er);
}
var Sr = c(ye * xe, z), wr = ye, kr = c(wr, nt);
if (kr == null) var Pr = null;
else t(65536 >= wr), Pr = kr;
var xr = a(Re);
if (Pr == null || xr == null || Sr == null) {
Ie.a = 1;
break r;
}
var Ir = Sr;
for (ze = de = 0; ze < ye; ++ze) {
var Pe = Pr[ze], Cr = Pe.G, Xr = Pe.H, xi = 0, Fn = 1, ur = 0;
for (te = 0; 5 > te; ++te) {
er = dl[te], Cr[te] = Ir, Xr[te] = de, !te && 0 < Me && (er += 1 << Me);
i: {
var cs, ao = er, ds = Ie, _a = xr, hh = Ir, ch = de, so = 0, Jn = ds.m, dh = wt(Jn, 1);
if (o(_a, 0, 0, ao), dh) {
var ph = wt(Jn, 1) + 1, gh = wt(Jn, 1), Al = wt(Jn, gh == 0 ? 1 : 8);
_a[Al] = 1, ph == 2 && (_a[Al = wt(Jn, 8)] = 1);
var ps = 1;
} else {
var Nl = a(19), Ll = wt(Jn, 4) + 4;
if (19 < Ll) {
ds.a = 3;
var gs = 0;
break i;
}
for (cs = 0; cs < Ll; ++cs) Nl[zf[cs]] = wt(Jn, 3);
var oo = void 0, Aa = void 0, Sl = ds, mh = Nl, ms = ao, kl = _a, lo = 0, Kn = Sl.m, Pl = 8, Il = c(128, z);
n: for (; F(Il, 0, 7, mh, 19); ) {
if (wt(Kn, 1)) {
var vh = 2 + 2 * wt(Kn, 3);
if ((oo = 2 + wt(Kn, vh)) > ms) break n;
} else oo = ms;
for (Aa = 0; Aa < ms && oo--; ) {
Z(Kn);
var Cl = Il[0 + (127 & T(Kn))];
J(Kn, Kn.u + Cl.g);
var Wi = Cl.value;
if (16 > Wi) kl[Aa++] = Wi, Wi != 0 && (Pl = Wi);
else {
var bh = Wi == 16, Fl = Wi - 16, wh = qf[Fl], El = wt(Kn, Df[Fl]) + wh;
if (Aa + El > ms) break n;
for (var yh = bh ? Pl : 0; 0 < El--; ) kl[Aa++] = yh;
}
}
lo = 1;
break n;
}
lo || (Sl.a = 3), ps = lo;
}
(ps = ps && !Jn.h) && (so = F(hh, ch, 8, _a, ao)), ps && so != 0 ? gs = so : (ds.a = 3, gs = 0);
}
if (gs == 0) break r;
if (Fn && Uf[te] == 1 && (Fn = Ir[de].g == 0), xi += Ir[de].g, de += gs, 3 >= te) {
var Na, uo = xr[0];
for (Na = 1; Na < er; ++Na) xr[Na] > uo && (uo = xr[Na]);
ur += uo;
}
}
if (Pe.nd = Fn, Pe.Qb = 0, Fn && (Pe.qb = (Cr[3][Xr[3] + 0].value << 24 | Cr[1][Xr[1] + 0].value << 16 | Cr[2][Xr[2] + 0].value) >>> 0, xi == 0 && 256 > Cr[0][Xr[0] + 0].value && (Pe.Qb = 1, Pe.qb += Cr[0][Xr[0] + 0].value << 8)), Pe.jc = !Pe.Qb && 6 > ur, Pe.jc) {
var vs, En = Pe;
for (vs = 0; vs < bi; ++vs) {
var Xn = vs, $n = En.pd[Xn], bs = En.G[0][En.H[0] + Xn];
256 <= bs.value ? ($n.g = bs.g + 256, $n.value = bs.value) : ($n.g = 0, $n.value = 0, Xn >>= nr(bs, 8, $n), Xn >>= nr(En.G[1][En.H[1] + Xn], 16, $n), Xn >>= nr(En.G[2][En.H[2] + Xn], 0, $n), nr(En.G[3][En.H[3] + Xn], 24, $n));
}
}
}
tr.vc = me, tr.Wb = ye, tr.Ya = Pr, tr.yc = Sr, Nt = 1;
break e;
}
Nt = 0;
}
if (!(w = Nt)) {
g.a = 3;
break t;
}
if (0 < et) {
if (I.ua = 1 << et, !P(I.Wa, et)) {
g.a = 1, w = 0;
break t;
}
} else I.ua = 0;
var fo = g, Ol = y, xh = A, ho = fo.s, co = ho.xc;
if (fo.c = Ol, fo.i = xh, ho.md = yt(Ol, co), ho.wc = co == 0 ? -1 : (1 << co) - 1, f) {
g.xb = Zf;
break t;
}
if ((W = a(y * A)) == null) {
g.a = 1, w = 0;
break t;
}
w = (w = Vr(g, W, 0, y, A, A, null)) && !L.h;
break t;
}
return w ? (b != null ? b[0] = W : (t(W == null), t(f)), g.$ = 0, f || Br(I)) : Br(I), w;
}
function oi(n, s) {
var f = n.c * n.i, g = f + s + 16 * s;
return t(n.c <= s), n.V = a(g), n.V == null ? (n.Ta = null, n.Ua = 0, n.a = 1, 0) : (n.Ta = n.V, n.Ua = n.Ba + f + s, 1);
}
function Ei(n, s) {
var f = n.C, g = s - f, b = n.V, w = n.Ba + n.c * f;
for (t(s <= n.l.o); 0 < g; ) {
var y = 16 < g ? 16 : g, A = n.l.ma, L = n.l.width, I = L * y, W = A.ca, et = A.tb + L * f, C = n.Ta, Y = n.Ua;
ai(n, y, b, w), al(C, Y, W, et, I), rn(A, f, f + y, W, et, L), g -= y, b += y * n.c, f += y;
}
t(f == s), n.C = n.Ma = s;
}
function Oi() {
this.ub = this.yd = this.td = this.Rb = 0;
}
function ji() {
this.Kd = this.Ld = this.Ud = this.Td = this.i = this.c = 0;
}
function Bs() {
this.Fb = this.Bb = this.Cb = 0, this.Zb = a(4), this.Lb = a(4);
}
function $i() {
this.Yb = (function() {
var n = [];
return (function s(f, g, b) {
for (var w = b[g], y = 0; y < w && (f.push(b.length > g + 1 ? [] : 0), !(b.length < g + 1)); y++) s(f[y], g + 1, b);
})(n, 0, [3, 11]), n;
})();
}
function Ra() {
this.jb = a(3), this.Wc = l([4, 8], $i), this.Xc = l([4, 17], $i);
}
function Ta() {
this.Pc = this.wb = this.Tb = this.zd = 0, this.vd = new a(4), this.od = new a(4);
}
function Mr() {
this.ld = this.La = this.dd = this.tc = 0;
}
function Zi() {
this.Na = this.la = 0;
}
function Da() {
this.Sc = [0, 0], this.Eb = [0, 0], this.Qc = [0, 0], this.ia = this.lc = 0;
}
function Qi() {
this.ad = a(384), this.Za = 0, this.Ob = a(16), this.$b = this.Ad = this.ia = this.Gc = this.Hc = this.Dd = 0;
}
function qa() {
this.uc = this.M = this.Nb = 0, this.wa = Array(new Mr()), this.Y = 0, this.ya = Array(new Qi()), this.aa = 0, this.l = new Bi();
}
function Ua() {
this.y = a(16), this.f = a(8), this.ea = a(8);
}
function za() {
this.cb = this.a = 0, this.sc = "", this.m = new x(), this.Od = new Oi(), this.Kc = new ji(), this.ed = new Ta(), this.Qa = new Bs(), this.Ic = this.$c = this.Aa = 0, this.D = new qa(), this.Xb = this.Va = this.Hb = this.zb = this.yb = this.Ub = this.za = 0, this.Jc = c(8, x), this.ia = 0, this.pb = c(4, Da), this.Pa = new Ra(), this.Bd = this.kc = 0, this.Ac = [], this.Bc = 0, this.zc = [0, 0, 0, 0], this.Gd = Array(new Ua()), this.Hd = 0, this.rb = Array(new Zi()), this.sb = 0, this.wa = Array(new Mr()), 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 Qi()), this.L = this.aa = 0, this.gd = l([4, 2], Mr), 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 an(n, s) {
return 0 > n ? 0 : n > s ? s : n;
}
function Bi() {
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 Ms() {
var n = new za();
return n != null && (n.a = 0, n.sc = "OK", n.cb = 0, n.Xb = 0, ya || (ya = Mi)), n;
}
function Ye(n, s, f) {
return n.a == 0 && (n.a = s, n.sc = f, n.cb = 0), 0;
}
function Ha(n, s, f) {
return 3 <= f && n[s + 0] == 157 && n[s + 1] == 1 && n[s + 2] == 42;
}
function sn(n, s) {
if (n == null) return 0;
if (n.a = 0, n.sc = "OK", s == null) return Ye(n, 2, "null VP8Io passed to VP8GetHeaders()");
var f = s.data, g = s.w, b = s.ha;
if (4 > b) return Ye(n, 7, "Truncated header.");
var w = f[g + 0] | f[g + 1] << 8 | f[g + 2] << 16, y = n.Od;
if (y.Rb = !(1 & w), y.td = w >> 1 & 7, y.yd = w >> 4 & 1, y.ub = w >> 5, 3 < y.td) return Ye(n, 3, "Incorrect keyframe parameters.");
if (!y.yd) return Ye(n, 4, "Frame not displayable.");
g += 3, b -= 3;
var A = n.Kc;
if (y.Rb) {
if (7 > b) return Ye(n, 7, "cannot parse picture header");
if (!Ha(f, g, b)) return Ye(n, 3, "Bad code word");
A.c = 16383 & (f[g + 4] << 8 | f[g + 3]), A.Td = f[g + 4] >> 6, A.i = 16383 & (f[g + 6] << 8 | f[g + 5]), A.Ud = f[g + 6] >> 6, g += 7, b -= 7, n.za = A.c + 15 >> 4, n.Ub = A.i + 15 >> 4, s.width = A.c, s.height = A.i, s.Da = 0, s.j = 0, s.v = 0, s.va = s.width, s.o = s.height, s.da = 0, s.ib = s.width, s.hb = s.height, s.U = s.width, s.T = s.height, o((w = n.Pa).jb, 0, 255, w.jb.length), t((w = n.Qa) != null), w.Cb = 0, w.Bb = 0, w.Fb = 1, o(w.Zb, 0, 0, w.Zb.length), o(w.Lb, 0, 0, w.Lb);
}
if (y.ub > b) return Ye(n, 7, "bad partition length");
ot(w = n.m, f, g, y.ub), g += y.ub, b -= y.ub, y.Rb && (A.Ld = st(w), A.Kd = st(w)), A = n.Qa;
var L, I = n.Pa;
if (t(w != null), t(A != null), A.Cb = st(w), A.Cb) {
if (A.Bb = st(w), st(w)) {
for (A.Fb = st(w), L = 0; 4 > L; ++L) A.Zb[L] = st(w) ? rt(w, 7) : 0;
for (L = 0; 4 > L; ++L) A.Lb[L] = st(w) ? rt(w, 6) : 0;
}
if (A.Bb) for (L = 0; 3 > L; ++L) I.jb[L] = st(w) ? ut(w, 8) : 255;
} else A.Bb = 0;
if (w.Ka) return Ye(n, 3, "cannot parse segment header");
if ((A = n.ed).zd = st(w), A.Tb = ut(w, 6), A.wb = ut(w, 3), A.Pc = st(w), A.Pc && st(w)) {
for (I = 0; 4 > I; ++I) st(w) && (A.vd[I] = rt(w, 6));
for (I = 0; 4 > I; ++I) st(w) && (A.od[I] = rt(w, 6));
}
if (n.L = A.Tb == 0 ? 0 : A.zd ? 1 : 2, w.Ka) return Ye(n, 3, "cannot parse filter header");
var W = b;
if (b = L = g, g = L + W, A = W, n.Xb = (1 << ut(n.m, 2)) - 1, W < 3 * (I = n.Xb)) f = 7;
else {
for (L += 3 * I, A -= 3 * I, W = 0; W < I; ++W) {
var et = f[b + 0] | f[b + 1] << 8 | f[b + 2] << 16;
et > A && (et = A), ot(n.Jc[+W], f, L, et), L += et, A -= et, b += 3;
}
ot(n.Jc[+I], f, L, A), f = L < g ? 0 : 5;
}
if (f != 0) return Ye(n, f, "cannot parse partitions");
for (f = ut(L = n.m, 7), b = st(L) ? rt(L, 4) : 0, g = st(L) ? rt(L, 4) : 0, A = st(L) ? rt(L, 4) : 0, I = st(L) ? rt(L, 4) : 0, L = st(L) ? rt(L, 4) : 0, W = n.Qa, et = 0; 4 > et; ++et) {
if (W.Cb) {
var C = W.Zb[et];
W.Fb || (C += f);
} else {
if (0 < et) {
n.pb[et] = n.pb[0];
continue;
}
C = f;
}
var Y = n.pb[et];
Y.Sc[0] = ro[an(C + b, 127)], Y.Sc[1] = no[an(C + 0, 127)], Y.Eb[0] = 2 * ro[an(C + g, 127)], Y.Eb[1] = 101581 * no[an(C + A, 127)] >> 16, 8 > Y.Eb[1] && (Y.Eb[1] = 8), Y.Qc[0] = ro[an(C + I, 117)], Y.Qc[1] = no[an(C + L, 127)], Y.lc = C + L;
}
if (!y.Rb) return Ye(n, 4, "Not a key frame.");
for (st(w), y = n.Pa, f = 0; 4 > f; ++f) {
for (b = 0; 8 > b; ++b) for (g = 0; 3 > g; ++g) for (A = 0; 11 > A; ++A) I = gt(w, Xf[f][b][g][A]) ? ut(w, 8) : Jf[f][b][g][A], y.Wc[f][b].Yb[g][A] = I;
for (b = 0; 17 > b; ++b) y.Xc[f][b] = y.Wc[f][$f[b]];
}
return n.kc = st(w), n.kc && (n.Bd = ut(w, 8)), n.cb = 1;
}
function Mi(n, s, f, g, b, w, y) {
var A = s[b].Yb[f];
for (f = 0; 16 > b; ++b) {
if (!gt(n, A[f + 0])) return b;
for (; !gt(n, A[f + 1]); ) if (A = s[++b].Yb[0], f = 0, b == 16) return 16;
var L = s[b + 1].Yb;
if (gt(n, A[f + 2])) {
var I = n, W = 0;
if (gt(I, (C = A)[(et = f) + 3])) if (gt(I, C[et + 6])) {
for (A = 0, et = 2 * (W = gt(I, C[et + 8])) + (C = gt(I, C[et + 9 + W])), W = 0, C = Gf[et]; C[A]; ++A) W += W + gt(I, C[A]);
W += 3 + (8 << et);
} else gt(I, C[et + 7]) ? (W = 7 + 2 * gt(I, 165), W += gt(I, 145)) : W = 5 + gt(I, 159);
else W = gt(I, C[et + 4]) ? 3 + gt(I, C[et + 5]) : 2;
A = L[2];
} else W = 1, A = L[1];
L = y + Yf[b], 0 > (I = n).b && at(I);
var et, C = I.b, Y = (et = I.Ca >> 1) - (I.I >> C) >> 31;
--I.b, I.Ca += Y, I.Ca |= 1, I.I -= (et + 1 & Y) << C, w[L] = ((W ^ Y) - Y) * g[(0 < b) + 0];
}
return 16;
}
function Wa(n) {
var s = n.rb[n.sb - 1];
s.la = 0, s.Na = 0, o(n.zc, 0, 0, n.zc.length), n.ja = 0;
}
function Rr(n, s, f, g, b) {
b = n[s + f + 32 * g] + (b >> 3), n[s + f + 32 * g] = -256 & b ? 0 > b ? 0 : 255 : b;
}
function Xe(n, s, f, g, b, w) {
Rr(n, s, 0, f, g + b), Rr(n, s, 1, f, g + w), Rr(n, s, 2, f, g - w), Rr(n, s, 3, f, g - b);
}
function bn(n) {
return (20091 * n >> 16) + n;
}
function Va(n, s, f, g) {
var b, w = 0, y = a(16);
for (b = 0; 4 > b; ++b) {
var A = n[s + 0] + n[s + 8], L = n[s + 0] - n[s + 8], I = (35468 * n[s + 4] >> 16) - bn(n[s + 12]), W = bn(n[s + 4]) + (35468 * n[s + 12] >> 16);
y[w + 0] = A + W, y[w + 1] = L + I, y[w + 2] = L - I, y[w + 3] = A - W, w += 4, s++;
}
for (b = w = 0; 4 > b; ++b) A = (n = y[w + 0] + 4) + y[w + 8], L = n - y[w + 8], I = (35468 * y[w + 4] >> 16) - bn(y[w + 12]), Rr(f, g, 0, 0, A + (W = bn(y[w + 4]) + (35468 * y[w + 12] >> 16))), Rr(f, g, 1, 0, L + I), Rr(f, g, 2, 0, L - I), Rr(f, g, 3, 0, A - W), w++, g += 32;
}
function Rs(n, s, f, g) {
var b = n[s + 0] + 4, w = 35468 * n[s + 4] >> 16, y = bn(n[s + 4]), A = 35468 * n[s + 1] >> 16;
Xe(f, g, 0, b + y, n = bn(n[s + 1]), A), Xe(f, g, 1, b + w, n, A), Xe(f, g, 2, b - w, n, A), Xe(f, g, 3, b - y, n, A);
}
function Ts(n, s, f, g, b) {
Va(n, s, f, g), b && Va(n, s + 16, f, g + 4);
}
function on(n, s, f, g) {
yi(n, s + 0, f, g, 1), yi(n, s + 32, f, g + 128, 1);
}
function Ga(n, s, f, g) {
var b;
for (n = n[s + 0] + 4, b = 0; 4 > b; ++b) for (s = 0; 4 > s; ++s) Rr(f, g, s, b, n);
}
function Ya(n, s, f, g) {
n[s + 0] && we(n, s + 0, f, g), n[s + 16] && we(n, s + 16, f, g + 4), n[s + 32] && we(n, s + 32, f, g + 128), n[s + 48] && we(n, s + 48, f, g + 128 + 4);
}
function Ri(n, s, f, g) {
var b, w = a(16);
for (b = 0; 4 > b; ++b) {
var y = n[s + 0 + b] + n[s + 12 + b], A = n[s + 4 + b] + n[s + 8 + b], L = n[s + 4 + b] - n[s + 8 + b], I = n[s + 0 + b] - n[s + 12 + b];
w[0 + b] = y + A, w[8 + b] = y - A, w[4 + b] = I + L, w[12 + b] = I - L;
}
for (b = 0; 4 > b; ++b) y = (n = w[0 + 4 * b] + 3) + w[3 + 4 * b], A = w[1 + 4 * b] + w[2 + 4 * b], L = w[1 + 4 * b] - w[2 + 4 * b], I = n - w[3 + 4 * b], f[g + 0] = y + A >> 3, f[g + 16] = I + L >> 3, f[g + 32] = y - A >> 3, f[g + 48] = I - L >> 3, g += 64;
}
function li(n, s, f) {
var g, b = s - 32, w = Lr, y = 255 - n[b - 1];
for (g = 0; g < f; ++g) {
var A, L = w, I = y + n[s - 1];
for (A = 0; A < f; ++A) n[s + A] = L[I + n[b + A]];
s += 32;
}
}
function Ds(n, s) {
li(n, s, 4);
}
function qs(n, s) {
li(n, s, 8);
}
function Us(n, s) {
li(n, s, 16);
}
function ta(n, s) {
var f;
for (f = 0; 16 > f; ++f) i(n, s + 32 * f, n, s - 32, 16);
}
function Ja(n, s) {
var f;
for (f = 16; 0 < f; --f) o(n, s, n[s - 1], 16), s += 32;
}
function Gr(n, s, f) {
var g;
for (g = 0; 16 > g; ++g) o(s, f + 32 * g, n, 16);
}
function zs(n, s) {
var f, g = 16;
for (f = 0; 16 > f; ++f) g += n[s - 1 + 32 * f] + n[s + f - 32];
Gr(g >> 5, n, s);
}
function ui(n, s) {
var f, g = 8;
for (f = 0; 16 > f; ++f) g += n[s - 1 + 32 * f];
Gr(g >> 4, n, s);
}
function ea(n, s) {
var f, g = 8;
for (f = 0; 16 > f; ++f) g += n[s + f - 32];
Gr(g >> 4, n, s);
}
function Hs(n, s) {
Gr(128, n, s);
}
function Xt(n, s, f) {
return n + 2 * s + f + 2 >> 2;
}
function Ws(n, s) {
var f, g = s - 32;
for (g = new Uint8Array([Xt(n[g - 1], n[g + 0], n[g + 1]), Xt(n[g + 0], n[g + 1], n[g + 2]), Xt(n[g + 1], n[g + 2], n[g + 3]), Xt(n[g + 2], n[g + 3], n[g + 4])]), f = 0; 4 > f; ++f) i(n, s + 32 * f, g, 0, g.length);
}
function Vs(n, s) {
var f = n[s - 1], g = n[s - 1 + 32], b = n[s - 1 + 64], w = n[s - 1 + 96];
_t(n, s + 0, 16843009 * Xt(n[s - 1 - 32], f, g)), _t(n, s + 32, 16843009 * Xt(f, g, b)), _t(n, s + 64, 16843009 * Xt(g, b, w)), _t(n, s + 96, 16843009 * Xt(b, w, w));
}
function Gs(n, s) {
var f, g = 4;
for (f = 0; 4 > f; ++f) g += n[s + f - 32] + n[s - 1 + 32 * f];
for (g >>= 3, f = 0; 4 > f; ++f) o(n, s + 32 * f, g, 4);
}
function wn(n, s) {
var f = n[s - 1 + 0], g = n[s - 1 + 32], b = n[s - 1 + 64], w = n[s - 1 - 32], y = n[s + 0 - 32], A = n[s + 1 - 32], L = n[s + 2 - 32], I = n[s + 3 - 32];
n[s + 0 + 96] = Xt(g, b, n[s - 1 + 96]), n[s + 1 + 96] = n[s + 0 + 64] = Xt(f, g, b), n[s + 2 + 96] = n[s + 1 + 64] = n[s + 0 + 32] = Xt(w, f, g), n[s + 3 + 96] = n[s + 2 + 64] = n[s + 1 + 32] = n[s + 0 + 0] = Xt(y, w, f), n[s + 3 + 64] = n[s + 2 + 32] = n[s + 1 + 0] = Xt(A, y, w), n[s + 3 + 32] = n[s + 2 + 0] = Xt(L, A, y), n[s + 3 + 0] = Xt(I, L, A);
}
function yn(n, s) {
var f = n[s + 1 - 32], g = n[s + 2 - 32], b = n[s + 3 - 32], w = n[s + 4 - 32], y = n[s + 5 - 32], A = n[s + 6 - 32], L = n[s + 7 - 32];
n[s + 0 + 0] = Xt(n[s + 0 - 32], f, g), n[s + 1 + 0] = n[s + 0 + 32] = Xt(f, g, b), n[s + 2 + 0] = n[s + 1 + 32] = n[s + 0 + 64] = Xt(g, b, w), n[s + 3 + 0] = n[s + 2 + 32] = n[s + 1 + 64] = n[s + 0 + 96] = Xt(b, w, y), n[s + 3 + 32] = n[s + 2 + 64] = n[s + 1 + 96] = Xt(w, y, A), n[s + 3 + 64] = n[s + 2 + 96] = Xt(y, A, L), n[s + 3 + 96] = Xt(A, L, L);
}
function Ys(n, s) {
var f = n[s - 1 + 0], g = n[s - 1 + 32], b = n[s - 1 + 64], w = n[s - 1 - 32], y = n[s + 0 - 32], A = n[s + 1 - 32], L = n[s + 2 - 32], I = n[s + 3 - 32];
n[s + 0 + 0] = n[s + 1 + 64] = w + y + 1 >> 1, n[s + 1 + 0] = n[s + 2 + 64] = y + A + 1 >> 1, n[s + 2 + 0] = n[s + 3 + 64] = A + L + 1 >> 1, n[s + 3 + 0] = L + I + 1 >> 1, n[s + 0 + 96] = Xt(b, g, f), n[s + 0 + 64] = Xt(g, f, w), n[s + 0 + 32] = n[s + 1 + 96] = Xt(f, w, y), n[s + 1 + 32] = n[s + 2 + 96] = Xt(w, y, A), n[s + 2 + 32] = n[s + 3 + 96] = Xt(y, A, L), n[s + 3 + 32] = Xt(A, L, I);
}
function Js(n, s) {
var f = n[s + 0 - 32], g = n[s + 1 - 32], b = n[s + 2 - 32], w = n[s + 3 - 32], y = n[s + 4 - 32], A = n[s + 5 - 32], L = n[s + 6 - 32], I = n[s + 7 - 32];
n[s + 0 + 0] = f + g + 1 >> 1, n[s + 1 + 0] = n[s + 0 + 64] = g + b + 1 >> 1, n[s + 2 + 0] = n[s + 1 + 64] = b + w + 1 >> 1, n[s + 3 + 0] = n[s + 2 + 64] = w + y + 1 >> 1, n[s + 0 + 32] = Xt(f, g, b), n[s + 1 + 32] = n[s + 0 + 96] = Xt(g, b, w), n[s + 2 + 32] = n[s + 1 + 96] = Xt(b, w, y), n[s + 3 + 32] = n[s + 2 + 96] = Xt(w, y, A), n[s + 3 + 64] = Xt(y, A, L), n[s + 3 + 96] = Xt(A, L, I);
}
function Ti(n, s) {
var f = n[s - 1 + 0], g = n[s - 1 + 32], b = n[s - 1 + 64], w = n[s - 1 + 96];
n[s + 0 + 0] = f + g + 1 >> 1, n[s + 2 + 0] = n[s + 0 + 32] = g + b + 1 >> 1, n[s + 2 + 32] = n[s + 0 + 64] = b + w + 1 >> 1, n[s + 1 + 0] = Xt(f, g, b), n[s + 3 + 0] = n[s + 1 + 32] = Xt(g, b, w), n[s + 3 + 32] = n[s + 1 + 64] = Xt(b, w, w), n[s + 3 + 64] = n[s + 2 + 64] = n[s + 0 + 96] = n[s + 1 + 96] = n[s + 2 + 96] = n[s + 3 + 96] = w;
}
function ra(n, s) {
var f = n[s - 1 + 0], g = n[s - 1 + 32], b = n[s - 1 + 64], w = n[s - 1 + 96], y = n[s - 1 - 32], A = n[s + 0 - 32], L = n[s + 1 - 32], I = n[s + 2 - 32];
n[s + 0 + 0] = n[s + 2 + 32] = f + y + 1 >> 1, n[s + 0 + 32] = n[s + 2 + 64] = g + f + 1 >> 1, n[s + 0 + 64] = n[s + 2 + 96] = b + g + 1 >> 1, n[s + 0 + 96] = w + b + 1 >> 1, n[s + 3 + 0] = Xt(A, L, I), n[s + 2 + 0] = Xt(y, A, L), n[s + 1 + 0] = n[s + 3 + 32] = Xt(f, y, A), n[s + 1 + 32] = n[s + 3 + 64] = Xt(g, f, y), n[s + 1 + 64] = n[s + 3 + 96] = Xt(b, g, f), n[s + 1 + 96] = Xt(w, b, g);
}
function fi(n, s) {
var f;
for (f = 0; 8 > f; ++f) i(n, s + 32 * f, n, s - 32, 8);
}
function Ks(n, s) {
var f;
for (f = 0; 8 > f; ++f) o(n, s, n[s - 1], 8), s += 32;
}
function xn(n, s, f) {
var g;
for (g = 0; 8 > g; ++g) o(s, f + 32 * g, n, 8);
}
function Xs(n, s) {
var f, g = 8;
for (f = 0; 8 > f; ++f) g += n[s + f - 32] + n[s - 1 + 32 * f];
xn(g >> 4, n, s);
}
function na(n, s) {
var f, g = 4;
for (f = 0; 8 > f; ++f) g += n[s + f - 32];
xn(g >> 3, n, s);
}
function ia(n, s) {
var f, g = 4;
for (f = 0; 8 > f; ++f) g += n[s - 1 + 32 * f];
xn(g >> 3, n, s);
}
function Ka(n, s) {
xn(128, n, s);
}
function _n(n, s, f) {
var g = n[s - f], b = n[s + 0], w = 3 * (b - g) + $s[1020 + n[s - 2 * f] - n[s + f]], y = ns[112 + (w + 4 >> 3)];
n[s - f] = Lr[255 + g + ns[112 + (w + 3 >> 3)]], n[s + 0] = Lr[255 + b - y];
}
function aa(n, s, f, g) {
var b = n[s + 0], w = n[s + f];
return qr[255 + n[s - 2 * f] - n[s - f]] > g || qr[255 + w - b] > g;
}
function Di(n, s, f, g) {
return 4 * qr[255 + n[s - f] - n[s + 0]] + qr[255 + n[s - 2 * f] - n[s + f]] <= g;
}
function sa(n, s, f, g, b) {
var w = n[s - 3 * f], y = n[s - 2 * f], A = n[s - f], L = n[s + 0], I = n[s + f], W = n[s + 2 * f], et = n[s + 3 * f];
return 4 * qr[255 + A - L] + qr[255 + y - I] > g ? 0 : qr[255 + n[s - 4 * f] - w] <= b && qr[255 + w - y] <= b && qr[255 + y - A] <= b && qr[255 + et - W] <= b && qr[255 + W - I] <= b && qr[255 + I - L] <= b;
}
function hi(n, s, f, g) {
var b = 2 * g + 1;
for (g = 0; 16 > g; ++g) Di(n, s + g, f, b) && _n(n, s + g, f);
}
function oa(n, s, f, g) {
var b = 2 * g + 1;
for (g = 0; 16 > g; ++g) Di(n, s + g * f, 1, b) && _n(n, s + g * f, 1);
}
function Xa(n, s, f, g) {
var b;
for (b = 3; 0 < b; --b) hi(n, s += 4 * f, f, g);
}
function $a(n, s, f, g) {
var b;
for (b = 3; 0 < b; --b) oa(n, s += 4, f, g);
}
function An(n, s, f, g, b, w, y, A) {
for (w = 2 * w + 1; 0 < b--; ) {
if (sa(n, s, f, w, y)) if (aa(n, s, f, A)) _n(n, s, f);
else {
var L = n, I = s, W = f, et = L[I - 2 * W], C = L[I - W], Y = L[I + 0], $ = L[I + W], lt = L[I + 2 * W], Q = 27 * (pt = $s[1020 + 3 * (Y - C) + $s[1020 + et - $]]) + 63 >> 7, ft = 18 * pt + 63 >> 7, pt = 9 * pt + 63 >> 7;
L[I - 3 * W] = Lr[255 + L[I - 3 * W] + pt], L[I - 2 * W] = Lr[255 + et + ft], L[I - W] = Lr[255 + C + Q], L[I + 0] = Lr[255 + Y - Q], L[I + W] = Lr[255 + $ - ft], L[I + 2 * W] = Lr[255 + lt - pt];
}
s += g;
}
}
function Nn(n, s, f, g, b, w, y, A) {
for (w = 2 * w + 1; 0 < b--; ) {
if (sa(n, s, f, w, y)) if (aa(n, s, f, A)) _n(n, s, f);
else {
var L = n, I = s, W = f, et = L[I - W], C = L[I + 0], Y = L[I + W], $ = ns[112 + (4 + (lt = 3 * (C - et)) >> 3)], lt = ns[112 + (lt + 3 >> 3)], Q = $ + 1 >> 1;
L[I - 2 * W] = Lr[255 + L[I - 2 * W] + Q], L[I - W] = Lr[255 + et + lt], L[I + 0] = Lr[255 + C - $], L[I + W] = Lr[255 + Y - Q];
}
s += g;
}
}
function Za(n, s, f, g, b, w) {
An(n, s, f, 1, 16, g, b, w);
}
function ci(n, s, f, g, b, w) {
An(n, s, 1, f, 16, g, b, w);
}
function Qa(n, s, f, g, b, w) {
var y;
for (y = 3; 0 < y; --y) Nn(n, s += 4 * f, f, 1, 16, g, b, w);
}
function u(n, s, f, g, b, w) {
var y;
for (y = 3; 0 < y; --y) Nn(n, s += 4, 1, f, 16, g, b, w);
}
function v(n, s, f, g, b, w, y, A) {
An(n, s, b, 1, 8, w, y, A), An(f, g, b, 1, 8, w, y, A);
}
function E(n, s, f, g, b, w, y, A) {
An(n, s, 1, b, 8, w, y, A), An(f, g, 1, b, 8, w, y, A);
}
function q(n, s, f, g, b, w, y, A) {
Nn(n, s + 4 * b, b, 1, 8, w, y, A), Nn(f, g + 4 * b, b, 1, 8, w, y, A);
}
function X(n, s, f, g, b, w, y, A) {
Nn(n, s + 4, 1, b, 8, w, y, A), Nn(f, g + 4, 1, b, 8, w, y, A);
}
function dt() {
this.ba = new le(), this.ec = [], this.cc = [], this.Mc = [], this.Dc = this.Nc = this.dc = this.fc = 0, this.Oa = new be(), this.memory = 0, this.Ib = "OutputFunc", this.Jb = "OutputAlphaFunc", this.Nd = "OutputRowFunc";
}
function vt() {
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 Ft() {
this.nc = this.Ea = this.b = this.hc = 0, this.K = [], this.w = 0;
}
function Bt() {
this.ua = 0, this.Wa = new ae(), this.vb = new ae(), this.md = this.xc = this.wc = 0, this.vc = [], this.Wb = 0, this.Ya = new nt(), this.yc = new z();
}
function Kt() {
this.xb = this.a = 0, this.l = new Bi(), this.ca = new le(), this.V = [], this.Ba = 0, this.Ta = [], this.Ua = 0, this.m = new B(), this.Pb = 0, this.wd = new B(), this.Ma = this.$ = this.C = this.i = this.c = this.xd = 0, this.s = new Bt(), this.ab = 0, this.gc = c(4, Ft), this.Oc = 0;
}
function re() {
this.Lc = this.Z = this.$a = this.i = this.c = 0, this.l = new Bi(), this.ic = 0, this.ca = [], this.tb = 0, this.qd = null, this.rd = 0;
}
function ge(n, s, f, g, b, w, y) {
for (n = n == null ? 0 : n[s + 0], s = 0; s < y; ++s) b[w + s] = n + f[g + s] & 255, n = b[w + s];
}
function je(n, s, f, g, b, w, y) {
var A;
if (n == null) ge(null, null, f, g, b, w, y);
else for (A = 0; A < y; ++A) b[w + A] = n[s + A] + f[g + A] & 255;
}
function Je(n, s, f, g, b, w, y) {
if (n == null) ge(null, null, f, g, b, w, y);
else {
var A, L = n[s + 0], I = L, W = L;
for (A = 0; A < y; ++A) I = W + (L = n[s + A]) - I, W = f[g + A] + (-256 & I ? 0 > I ? 0 : 255 : I) & 255, I = L, b[w + A] = W;
}
}
function ke(n, s, f, g) {
var b = s.width, w = s.o;
if (t(n != null && s != null), 0 > f || 0 >= g || f + g > w) return null;
if (!n.Cc) {
if (n.ga == null) {
var y;
if (n.ga = new re(), (y = n.ga == null) || (y = s.width * s.o, t(n.Gb.length == 0), n.Gb = a(y), n.Uc = 0, n.Gb == null ? y = 0 : (n.mb = n.Gb, n.nb = n.Uc, n.rc = null, y = 1), y = !y), !y) {
y = n.ga;
var A = n.Fa, L = n.P, I = n.qc, W = n.mb, et = n.nb, C = L + 1, Y = I - 1, $ = y.l;
if (t(A != null && W != null && s != null), Yn[0] = null, Yn[1] = ge, Yn[2] = je, Yn[3] = Je, y.ca = W, y.tb = et, y.c = s.width, y.i = s.height, t(0 < y.c && 0 < y.i), 1 >= I) s = 0;
else if (y.$a = 3 & A[L + 0], y.Z = A[L + 0] >> 2 & 3, y.Lc = A[L + 0] >> 4 & 3, L = A[L + 0] >> 6 & 3, 0 > y.$a || 1 < y.$a || 4 <= y.Z || 1 < y.Lc || L) s = 0;
else if ($.put = Gt, $.ac = en, $.bc = mn, $.ma = y, $.width = s.width, $.height = s.height, $.Da = s.Da, $.v = s.v, $.va = s.va, $.j = s.j, $.o = s.o, y.$a) t: {
t(y.$a == 1), s = si();
e: for (; ; ) {
if (s == null) {
s = 0;
break t;
}
if (t(y != null), y.mc = s, s.c = y.c, s.i = y.i, s.l = y.l, s.l.ma = y, s.l.width = y.c, s.l.height = y.i, s.a = 0, ht(s.m, A, C, Y), !nn(y.c, y.i, 1, s, null) || (s.ab == 1 && s.gc[0].hc == 3 && Hr(s.s) ? (y.ic = 1, A = s.c * s.i, s.Ta = null, s.Ua = 0, s.V = a(A), s.Ba = 0, s.V == null ? (s.a = 1, s = 0) : s = 1) : (y.ic = 0, s = oi(s, y.c)), !s)) break e;
s = 1;
break t;
}
y.mc = null, s = 0;
}
else s = Y >= y.c * y.i;
y = !s;
}
if (y) return null;
n.ga.Lc != 1 ? n.Ga = 0 : g = w - f;
}
t(n.ga != null), t(f + g <= w);
t: {
if (s = (A = n.ga).c, w = A.l.o, A.$a == 0) {
if (C = n.rc, Y = n.Vc, $ = n.Fa, L = n.P + 1 + f * s, I = n.mb, W = n.nb + f * s, t(L <= n.P + n.qc), A.Z != 0) for (t(Yn[A.Z] != null), y = 0; y < g; ++y) Yn[A.Z](C, Y, $, L, I, W, s), C = I, Y = W, W += s, L += s;
else for (y = 0; y < g; ++y) i(I, W, $, L, s), C = I, Y = W, W += s, L += s;
n.rc = C, n.Vc = Y;
} else {
if (t(A.mc != null), s = f + g, t((y = A.mc) != null), t(s <= y.i), y.C >= s) s = 1;
else if (A.ic || Yr(), A.ic) {
A = y.V, C = y.Ba, Y = y.c;
var lt = y.i, Q = ($ = 1, L = y.$ / Y, I = y.$ % Y, W = y.m, et = y.s, y.$), ft = Y * lt, pt = Y * s, xt = et.wc, bt = Q < pt ? ir(et, I, L) : null;
t(Q <= ft), t(s <= lt), t(Hr(et));
e: for (; ; ) {
for (; !W.h && Q < pt; ) {
if (I & xt || (bt = ir(et, I, L)), t(bt != null), Z(W), 256 > (lt = Be(bt.G[0], bt.H[0], W))) A[C + Q] = lt, ++Q, ++I >= Y && (I = 0, ++L <= s && !(L % 16) && Wr(y, L));
else {
if (!(280 > lt)) {
$ = 0;
break e;
}
lt = Or(lt - 256, W);
var Rt, Pt = Be(bt.G[4], bt.H[4], W);
if (Z(W), !(Q >= (Pt = jr(Y, Pt = Or(Pt, W))) && ft - Q >= lt)) {
$ = 0;
break e;
}
for (Rt = 0; Rt < lt; ++Rt) A[C + Q + Rt] = A[C + Q + Rt - Pt];
for (Q += lt, I += lt; I >= Y; ) I -= Y, ++L <= s && !(L % 16) && Wr(y, L);
Q < pt && I & xt && (bt = ir(et, I, L));
}
t(W.h == H(W));
}
Wr(y, L > s ? s : L);
break e;
}
!$ || W.h && Q < ft ? ($ = 0, y.a = W.h ? 5 : 3) : y.$ = Q, s = $;
} else s = Vr(y, y.V, y.Ba, y.c, y.i, s, Ei);
if (!s) {
g = 0;
break t;
}
}
f + g >= w && (n.Cc = 1), g = 1;
}
if (!g) return null;
if (n.Cc && ((g = n.ga) != null && (g.mc = null), n.ga = null, 0 < n.Ga)) return alert("todo:WebPDequantizeLevels"), null;
}
return n.nb + f * b;
}
function $e(n, s, f, g, b, w) {
for (; 0 < b--; ) {
var y, A = n, L = s + (f ? 1 : 0), I = n, W = s + (f ? 0 : 3);
for (y = 0; y < g; ++y) {
var et = I[W + 4 * y];
et != 255 && (et *= 32897, A[L + 4 * y + 0] = A[L + 4 * y + 0] * et >> 23, A[L + 4 * y + 1] = A[L + 4 * y + 1] * et >> 23, A[L + 4 * y + 2] = A[L + 4 * y + 2] * et >> 23);
}
s += w;
}
}
function Ke(n, s, f, g, b) {
for (; 0 < g--; ) {
var w;
for (w = 0; w < f; ++w) {
var y = n[s + 2 * w + 0], A = 15 & (I = n[s + 2 * w + 1]), L = 4369 * A, I = (240 & I | I >> 4) * L >> 16;
n[s + 2 * w + 0] = (240 & y | y >> 4) * L >> 16 & 240 | (15 & y | y << 4) * L >> 16 >> 4 & 15, n[s + 2 * w + 1] = 240 & I | A;
}
s += b;
}
}
function ar(n, s, f, g, b, w, y, A) {
var L, I, W = 255;
for (I = 0; I < b; ++I) {
for (L = 0; L < g; ++L) {
var et = n[s + L];
w[y + 4 * L] = et, W &= et;
}
s += f, y += A;
}
return W != 255;
}
function Ln(n, s, f, g, b) {
var w;
for (w = 0; w < b; ++w) f[g + w] = n[s + w] >> 8;
}
function Yr() {
wa = $e, nl = Ke, il = ar, al = Ln;
}
function Sn(n, s, f) {
R[n] = function(g, b, w, y, A, L, I, W, et, C, Y, $, lt, Q, ft, pt, xt) {
var bt, Rt = xt - 1 >> 1, Pt = A[L + 0] | I[W + 0] << 16, ne = et[C + 0] | Y[$ + 0] << 16;
t(g != null);
var Et = 3 * Pt + ne + 131074 >> 2;
for (s(g[b + 0], 255 & Et, Et >> 16, lt, Q), w != null && (Et = 3 * ne + Pt + 131074 >> 2, s(w[y + 0], 255 & Et, Et >> 16, ft, pt)), bt = 1; bt <= Rt; ++bt) {
var ce = A[L + bt] | I[W + bt] << 16, Qe = et[C + bt] | Y[$ + bt] << 16, ie = Pt + ce + ne + Qe + 524296, Ot = ie + 2 * (ce + ne) >> 3;
Et = Ot + Pt >> 1, Pt = (ie = ie + 2 * (Pt + Qe) >> 3) + ce >> 1, s(g[b + 2 * bt - 1], 255 & Et, Et >> 16, lt, Q + (2 * bt - 1) * f), s(g[b + 2 * bt - 0], 255 & Pt, Pt >> 16, lt, Q + (2 * bt - 0) * f), w != null && (Et = ie + ne >> 1, Pt = Ot + Qe >> 1, s(w[y + 2 * bt - 1], 255 & Et, Et >> 16, ft, pt + (2 * bt - 1) * f), s(w[y + 2 * bt + 0], 255 & Pt, Pt >> 16, ft, pt + (2 * bt + 0) * f)), Pt = ce, ne = Qe;
}
1 & xt || (Et = 3 * Pt + ne + 131074 >> 2, s(g[b + xt - 1], 255 & Et, Et >> 16, lt, Q + (xt - 1) * f), w != null && (Et = 3 * ne + Pt + 131074 >> 2, s(w[y + xt - 1], 255 & Et, Et >> 16, ft, pt + (xt - 1) * f)));
};
}
function la() {
Ur[is] = Qf, Ur[as] = ml, Ur[hl] = th, Ur[ss] = vl, Ur[os] = bl, Ur[Zs] = wl, Ur[cl] = eh, Ur[Qs] = ml, Ur[to] = vl, Ur[ls] = bl, Ur[eo] = wl;
}
function qi(n) {
return n & -16384 ? 0 > n ? 0 : 255 : n >> rh;
}
function Rn(n, s) {
return qi((19077 * n >> 8) + (26149 * s >> 8) - 14234);
}
function di(n, s, f) {
return qi((19077 * n >> 8) - (6419 * s >> 8) - (13320 * f >> 8) + 8708);
}
function pi(n, s) {
return qi((19077 * n >> 8) + (33050 * s >> 8) - 17685);
}
function Tn(n, s, f, g, b) {
g[b + 0] = Rn(n, f), g[b + 1] = di(n, s, f), g[b + 2] = pi(n, s);
}
function sr(n, s, f, g, b) {
g[b + 0] = pi(n, s), g[b + 1] = di(n, s, f), g[b + 2] = Rn(n, f);
}
function gi(n, s, f, g, b) {
var w = di(n, s, f);
s = w << 3 & 224 | pi(n, s) >> 3, g[b + 0] = 248 & Rn(n, f) | w >> 5, g[b + 1] = s;
}
function mi(n, s, f, g, b) {
var w = 240 & pi(n, s) | 15;
g[b + 0] = 240 & Rn(n, f) | di(n, s, f) >> 4, g[b + 1] = w;
}
function ua(n, s, f, g, b) {
g[b + 0] = 255, Tn(n, s, f, g, b + 1);
}
function fa(n, s, f, g, b) {
sr(n, s, f, g, b), g[b + 3] = 255;
}
function mr(n, s, f, g, b) {
Tn(n, s, f, g, b), g[b + 3] = 255;
}
function kn(n, s, f) {
R[n] = function(g, b, w, y, A, L, I, W, et) {
for (var C = W + (-2 & et) * f; W != C; ) s(g[b + 0], w[y + 0], A[L + 0], I, W), s(g[b + 1], w[y + 0], A[L + 0], I, W + f), b += 2, ++y, ++L, W += 2 * f;
1 & et && s(g[b + 0], w[y + 0], A[L + 0], I, W);
};
}
function Ui(n, s, f) {
return f == 0 ? n == 0 ? s == 0 ? 6 : 5 : s == 0 ? 4 : 0 : f;
}
function ts(n, s, f, g, b) {
switch (n >>> 30) {
case 3:
yi(s, f, g, b, 0);
break;
case 2:
Dr(s, f, g, b);
break;
case 1:
we(s, f, g, b);
}
}
function Tr(n, s) {
var f, g, b = s.M, w = s.Nb, y = n.oc, A = n.pc + 40, L = n.oc, I = n.pc + 584, W = n.oc, et = n.pc + 600;
for (f = 0; 16 > f; ++f) y[A + 32 * f - 1] = 129;
for (f = 0; 8 > f; ++f) L[I + 32 * f - 1] = 129, W[et + 32 * f - 1] = 129;
for (0 < b ? y[A - 1 - 32] = L[I - 1 - 32] = W[et - 1 - 32] = 129 : (o(y, A - 32 - 1, 127, 21), o(L, I - 32 - 1, 127, 9), o(W, et - 32 - 1, 127, 9)), g = 0; g < n.za; ++g) {
var C = s.ya[s.aa + g];
if (0 < g) {
for (f = -1; 16 > f; ++f) i(y, A + 32 * f - 4, y, A + 32 * f + 12, 4);
for (f = -1; 8 > f; ++f) i(L, I + 32 * f - 4, L, I + 32 * f + 4, 4), i(W, et + 32 * f - 4, W, et + 32 * f + 4, 4);
}
var Y = n.Gd, $ = n.Hd + g, lt = C.ad, Q = C.Hc;
if (0 < b && (i(y, A - 32, Y[$].y, 0, 16), i(L, I - 32, Y[$].f, 0, 8), i(W, et - 32, Y[$].ea, 0, 8)), C.Za) {
var ft = y, pt = A - 32 + 16;
for (0 < b && (g >= n.za - 1 ? o(ft, pt, Y[$].y[15], 4) : i(ft, pt, Y[$ + 1].y, 0, 4)), f = 0; 4 > f; f++) ft[pt + 128 + f] = ft[pt + 256 + f] = ft[pt + 384 + f] = ft[pt + 0 + f];
for (f = 0; 16 > f; ++f, Q <<= 2) ft = y, pt = A + xl[f], Jr[C.Ob[f]](ft, pt), ts(Q, lt, 16 * +f, ft, pt);
} else if (ft = Ui(g, b, C.Ob[0]), Gn[ft](y, A), Q != 0) for (f = 0; 16 > f; ++f, Q <<= 2) ts(Q, lt, 16 * +f, y, A + xl[f]);
for (f = C.Gc, ft = Ui(g, b, C.Dd), Cn[ft](L, I), Cn[ft](W, et), Q = lt, ft = L, pt = I, 255 & (C = 0 | f) && (170 & C ? fn(Q, 256, ft, pt) : Ae(Q, 256, ft, pt)), C = W, Q = et, 255 & (f >>= 8) && (170 & f ? fn(lt, 320, C, Q) : Ae(lt, 320, C, Q)), b < n.Ub - 1 && (i(Y[$].y, 0, y, A + 480, 16), i(Y[$].f, 0, L, I + 224, 8), i(Y[$].ea, 0, W, et + 224, 8)), f = 8 * w * n.B, Y = n.sa, $ = n.ta + 16 * g + 16 * w * n.R, lt = n.qa, C = n.ra + 8 * g + f, Q = n.Ha, ft = n.Ia + 8 * g + f, f = 0; 16 > f; ++f) i(Y, $ + f * n.R, y, A + 32 * f, 16);
for (f = 0; 8 > f; ++f) i(lt, C + f * n.B, L, I + 32 * f, 8), i(Q, ft + f * n.B, W, et + 32 * f, 8);
}
}
function vi(n, s, f, g, b, w, y, A, L) {
var I = [0], W = [0], et = 0, C = L != null ? L.kd : 0, Y = L ?? new vt();
if (n == null || 12 > f) return 7;
Y.data = n, Y.w = s, Y.ha = f, s = [s], f = [f], Y.gb = [Y.gb];
t: {
var $ = s, lt = f, Q = Y.gb;
if (t(n != null), t(lt != null), t(Q != null), Q[0] = 0, 12 <= lt[0] && !e(n, $[0], "RIFF")) {
if (e(n, $[0] + 8, "WEBP")) {
Q = 3;
break t;
}
var ft = Dt(n, $[0] + 4);
if (12 > ft || 4294967286 < ft) {
Q = 3;
break t;
}
if (C && ft > lt[0] - 8) {
Q = 7;
break t;
}
Q[0] = ft, $[0] += 12, lt[0] -= 12;
}
Q = 0;
}
if (Q != 0) return Q;
for (ft = 0 < Y.gb[0], f = f[0]; ; ) {
t: {
var pt = n;
lt = s, Q = f;
var xt = I, bt = W, Rt = $ = [0];
if ((Et = et = [et])[0] = 0, 8 > Q[0]) Q = 7;
else {
if (!e(pt, lt[0], "VP8X")) {
if (Dt(pt, lt[0] + 4) != 10) {
Q = 3;
break t;
}
if (18 > Q[0]) {
Q = 7;
break t;
}
var Pt = Dt(pt, lt[0] + 8), ne = 1 + St(pt, lt[0] + 12);
if (2147483648 <= ne * (pt = 1 + St(pt, lt[0] + 15))) {
Q = 3;
break t;
}
Rt != null && (Rt[0] = Pt), xt != null && (xt[0] = ne), bt != null && (bt[0] = pt), lt[0] += 18, Q[0] -= 18, Et[0] = 1;
}
Q = 0;
}
}
if (et = et[0], $ = $[0], Q != 0) return Q;
if (lt = !!(2 & $), !ft && et) return 3;
if (w != null && (w[0] = !!(16 & $)), y != null && (y[0] = lt), A != null && (A[0] = 0), y = I[0], $ = W[0], et && lt && L == null) {
Q = 0;
break;
}
if (4 > f) {
Q = 7;
break;
}
if (ft && et || !ft && !et && !e(n, s[0], "ALPH")) {
f = [f], Y.na = [Y.na], Y.P = [Y.P], Y.Sa = [Y.Sa];
t: {
Pt = n, Q = s, ft = f;
var Et = Y.gb;
xt = Y.na, bt = Y.P, Rt = Y.Sa, ne = 22, t(Pt != null), t(ft != null), pt = Q[0];
var ce = ft[0];
for (t(xt != null), t(Rt != null), xt[0] = null, bt[0] = null, Rt[0] = 0; ; ) {
if (Q[0] = pt, ft[0] = ce, 8 > ce) {
Q = 7;
break t;
}
var Qe = Dt(Pt, pt + 4);
if (4294967286 < Qe) {
Q = 3;
break t;
}
var ie = 8 + Qe + 1 & -2;
if (ne += ie, 0 < Et && ne > Et) {
Q = 3;
break t;
}
if (!e(Pt, pt, "VP8 ") || !e(Pt, pt, "VP8L")) {
Q = 0;
break t;
}
if (ce[0] < ie) {
Q = 7;
break t;
}
e(Pt, pt, "ALPH") || (xt[0] = Pt, bt[0] = pt + 8, Rt[0] = Qe), pt += ie, ce -= ie;
}
}
if (f = f[0], Y.na = Y.na[0], Y.P = Y.P[0], Y.Sa = Y.Sa[0], Q != 0) break;
}
f = [f], Y.Ja = [Y.Ja], Y.xa = [Y.xa];
t: if (Et = n, Q = s, ft = f, xt = Y.gb[0], bt = Y.Ja, Rt = Y.xa, Pt = Q[0], pt = !e(Et, Pt, "VP8 "), ne = !e(Et, Pt, "VP8L"), t(Et != null), t(ft != null), t(bt != null), t(Rt != null), 8 > ft[0]) Q = 7;
else {
if (pt || ne) {
if (Et = Dt(Et, Pt + 4), 12 <= xt && Et > xt - 12) {
Q = 3;
break t;
}
if (C && Et > ft[0] - 8) {
Q = 7;
break t;
}
bt[0] = Et, Q[0] += 8, ft[0] -= 8, Rt[0] = ne;
} else Rt[0] = 5 <= ft[0] && Et[Pt + 0] == 47 && !(Et[Pt + 4] >> 5), bt[0] = ft[0];
Q = 0;
}
if (f = f[0], Y.Ja = Y.Ja[0], Y.xa = Y.xa[0], s = s[0], Q != 0) break;
if (4294967286 < Y.Ja) return 3;
if (A == null || lt || (A[0] = Y.xa ? 2 : 1), y = [y], $ = [$], Y.xa) {
if (5 > f) {
Q = 7;
break;
}
A = y, C = $, lt = w, n == null || 5 > f ? n = 0 : 5 <= f && n[s + 0] == 47 && !(n[s + 4] >> 5) ? (ft = [0], Et = [0], xt = [0], ht(bt = new B(), n, s, f), vn(bt, ft, Et, xt) ? (A != null && (A[0] = ft[0]), C != null && (C[0] = Et[0]), lt != null && (lt[0] = xt[0]), n = 1) : n = 0) : n = 0;
} else {
if (10 > f) {
Q = 7;
break;
}
A = $, n == null || 10 > f || !Ha(n, s + 3, f - 3) ? n = 0 : (C = n[s + 0] | n[s + 1] << 8 | n[s + 2] << 16, lt = 16383 & (n[s + 7] << 8 | n[s + 6]), n = 16383 & (n[s + 9] << 8 | n[s + 8]), 1 & C || 3 < (C >> 1 & 7) || !(C >> 4 & 1) || C >> 5 >= Y.Ja || !lt || !n ? n = 0 : (y && (y[0] = lt), A && (A[0] = n), n = 1));
}
if (!n || (y = y[0], $ = $[0], et && (I[0] != y || W[0] != $))) return 3;
L != null && (L[0] = Y, L.offset = s - L.w, t(4294967286 > s - L.w), t(L.offset == L.ha - f));
break;
}
return Q == 0 || Q == 7 && et && L == null ? (w != null && (w[0] |= Y.na != null && 0 < Y.na.length), g != null && (g[0] = y), b != null && (b[0] = $), 0) : Q;
}
function ha(n, s, f) {
var g = s.width, b = s.height, w = 0, y = 0, A = g, L = b;
if (s.Da = n != null && 0 < n.Da, s.Da && (A = n.cd, L = n.bd, w = n.v, y = n.j, 11 > f || (w &= -2, y &= -2), 0 > w || 0 > y || 0 >= A || 0 >= L || w + A > g || y + L > b)) return 0;
if (s.v = w, s.j = y, s.va = w + A, s.o = y + L, s.U = A, s.T = L, s.da = n != null && 0 < n.da, s.da) {
if (!Ht(A, L, f = [n.ib], w = [n.hb])) return 0;
s.ib = f[0], s.hb = w[0];
}
return s.ob = n != null && n.ob, s.Kb = n == null || !n.Sd, s.da && (s.ob = s.ib < 3 * g / 4 && s.hb < 3 * b / 4, s.Kb = 0), 1;
}
function ca(n) {
if (n == null) return 2;
if (11 > n.S) {
var s = n.f.RGBA;
s.fb += (n.height - 1) * s.A, s.A = -s.A;
} else s = n.f.kb, n = n.height, s.O += (n - 1) * s.fa, s.fa = -s.fa, s.N += (n - 1 >> 1) * s.Ab, s.Ab = -s.Ab, s.W += (n - 1 >> 1) * s.Db, s.Db = -s.Db, s.F != null && (s.J += (n - 1) * s.lb, s.lb = -s.lb);
return 0;
}
function Dn(n, s, f, g) {
if (g == null || 0 >= n || 0 >= s) return 2;
if (f != null) {
if (f.Da) {
var b = f.cd, w = f.bd, y = -2 & f.v, A = -2 & f.j;
if (0 > y || 0 > A || 0 >= b || 0 >= w || y + b > n || A + w > s) return 2;
n = b, s = w;
}
if (f.da) {
if (!Ht(n, s, b = [f.ib], w = [f.hb])) return 2;
n = b[0], s = w[0];
}
}
g.width = n, g.height = s;
t: {
var L = g.width, I = g.height;
if (n = g.S, 0 >= L || 0 >= I || !(n >= is && 13 > n)) n = 2;
else {
if (0 >= g.Rd && g.sd == null) {
y = w = b = s = 0;
var W = (A = L * _l[n]) * I;
if (11 > n || (w = (I + 1) / 2 * (s = (L + 1) / 2), n == 12 && (y = (b = L) * I)), (I = a(W + 2 * w + y)) == null) {
n = 1;
break t;
}
g.sd = I, 11 > n ? ((L = g.f.RGBA).eb = I, L.fb = 0, L.A = A, L.size = W) : ((L = g.f.kb).y = I, L.O = 0, L.fa = A, L.Fd = W, L.f = I, L.N = 0 + W, L.Ab = s, L.Cd = w, L.ea = I, L.W = 0 + W + w, L.Db = s, L.Ed = w, n == 12 && (L.F = I, L.J = 0 + W + 2 * w), L.Tc = y, L.lb = b);
}
if (s = 1, b = g.S, w = g.width, y = g.height, b >= is && 13 > b) if (11 > b) n = g.f.RGBA, s &= (A = Math.abs(n.A)) * (y - 1) + w <= n.size, s &= A >= w * _l[b], s &= n.eb != null;
else {
n = g.f.kb, A = (w + 1) / 2, W = (y + 1) / 2, L = Math.abs(n.fa), I = Math.abs(n.Ab);
var et = Math.abs(n.Db), C = Math.abs(n.lb), Y = C * (y - 1) + w;
s &= L * (y - 1) + w <= n.Fd, s &= I * (W - 1) + A <= n.Cd, s = (s &= et * (W - 1) + A <= n.Ed) & L >= w & I >= A & et >= A, s &= n.y != null, s &= n.f != null, s &= n.ea != null, b == 12 && (s &= C >= w, s &= Y <= n.Tc, s &= n.F != null);
}
else s = 0;
n = s ? 0 : 2;
}
}
return n != 0 || f != null && f.fd && (n = ca(g)), n;
}
var bi = 64, Ar = [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], Nr = 24, qn = 32, Pn = 8, Un = [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];
Ct("Predictor0", "PredictorAdd0"), R.Predictor0 = function() {
return 4278190080;
}, R.Predictor1 = function(n) {
return n;
}, R.Predictor2 = function(n, s, f) {
return s[f + 0];
}, R.Predictor3 = function(n, s, f) {
return s[f + 1];
}, R.Predictor4 = function(n, s, f) {
return s[f - 1];
}, R.Predictor5 = function(n, s, f) {
return qt(qt(n, s[f + 1]), s[f + 0]);
}, R.Predictor6 = function(n, s, f) {
return qt(n, s[f - 1]);
}, R.Predictor7 = function(n, s, f) {
return qt(n, s[f + 0]);
}, R.Predictor8 = function(n, s, f) {
return qt(s[f - 1], s[f + 0]);
}, R.Predictor9 = function(n, s, f) {
return qt(s[f + 0], s[f + 1]);
}, R.Predictor10 = function(n, s, f) {
return qt(qt(n, s[f - 1]), qt(s[f + 0], s[f + 1]));
}, R.Predictor11 = function(n, s, f) {
var g = s[f + 0];
return 0 >= Zt(g >> 24 & 255, n >> 24 & 255, (s = s[f - 1]) >> 24 & 255) + Zt(g >> 16 & 255, n >> 16 & 255, s >> 16 & 255) + Zt(g >> 8 & 255, n >> 8 & 255, s >> 8 & 255) + Zt(255 & g, 255 & n, 255 & s) ? g : n;
}, R.Predictor12 = function(n, s, f) {
var g = s[f + 0];
return (ve((n >> 24 & 255) + (g >> 24 & 255) - ((s = s[f - 1]) >> 24 & 255)) << 24 | ve((n >> 16 & 255) + (g >> 16 & 255) - (s >> 16 & 255)) << 16 | ve((n >> 8 & 255) + (g >> 8 & 255) - (s >> 8 & 255)) << 8 | ve((255 & n) + (255 & g) - (255 & s))) >>> 0;
}, R.Predictor13 = function(n, s, f) {
var g = s[f - 1];
return (ue((n = qt(n, s[f + 0])) >> 24 & 255, g >> 24 & 255) << 24 | ue(n >> 16 & 255, g >> 16 & 255) << 16 | ue(n >> 8 & 255, g >> 8 & 255) << 8 | ue(255 & n, 255 & g)) >>> 0;
};
var da = R.PredictorAdd0;
R.PredictorAdd1 = he, Ct("Predictor2", "PredictorAdd2"), Ct("Predictor3", "PredictorAdd3"), Ct("Predictor4", "PredictorAdd4"), Ct("Predictor5", "PredictorAdd5"), Ct("Predictor6", "PredictorAdd6"), Ct("Predictor7", "PredictorAdd7"), Ct("Predictor8", "PredictorAdd8"), Ct("Predictor9", "PredictorAdd9"), Ct("Predictor10", "PredictorAdd10"), Ct("Predictor11", "PredictorAdd11"), Ct("Predictor12", "PredictorAdd12"), Ct("Predictor13", "PredictorAdd13");
var zi = R.PredictorAdd2;
Tt("ColorIndexInverseTransform", "MapARGB", "32b", function(n) {
return n >> 8 & 255;
}, function(n) {
return n;
}), Tt("VP8LColorIndexInverseTransformAlpha", "MapAlpha", "8b", function(n) {
return n;
}, function(n) {
return n >> 8 & 255;
});
var qe, es = R.ColorIndexInverseTransform, ln = R.MapARGB, un = R.VP8LColorIndexInverseTransformAlpha, pa = R.MapAlpha, ga = R.VP8LPredictorsAdd = [];
ga.length = 16, (R.VP8LPredictors = []).length = 16, (R.VP8LPredictorsAdd_C = []).length = 16, (R.VP8LPredictors_C = []).length = 16;
var ma, va, zn, Hn, Wn, wi, Vn, yi, Dr, fn, we, Ae, Ue, Ze, In, ba, Hi, rs, $o, Zo, Qo, tl, el, rl, wa, nl, il, al, sl = a(511), ol = a(2041), ll = a(225), ul = a(767), fl = 0, $s = ol, ns = ll, Lr = ul, qr = sl, is = 0, as = 1, hl = 2, ss = 3, os = 4, Zs = 5, cl = 6, Qs = 7, to = 8, ls = 9, eo = 10, Df = [2, 3, 7], qf = [3, 3, 11], dl = [280, 256, 256, 256, 40], Uf = [0, 1, 1, 1, 0], zf = [17, 18, 0, 1, 2, 3, 4, 5, 16, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], Hf = [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], Wf = [2954, 2956, 2958, 2962, 2970, 2986, 3018, 3082, 3212, 3468, 3980, 5004], Vf = 8, ro = [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], no = [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], ya = null, Gf = [[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]], Yf = [0, 1, 4, 8, 5, 2, 3, 6, 9, 12, 13, 10, 7, 11, 14, 15], pl = [-0, 1, -1, 2, -2, 3, 4, 6, -3, 5, -4, -5, -6, 7, -7, 8, -8, -9], Jf = [[[[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]]]], Kf = [[[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]]], Xf = [[[[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]]]], $f = [0, 1, 2, 3, 6, 4, 5, 6, 6, 6, 6, 6, 6, 6, 6, 7, 0], Gn = [], Jr = [], Cn = [], Zf = 1, gl = 2, Yn = [], Ur = [];
Sn("UpsampleRgbLinePair", Tn, 3), Sn("UpsampleBgrLinePair", sr, 3), Sn("UpsampleRgbaLinePair", mr, 4), Sn("UpsampleBgraLinePair", fa, 4), Sn("UpsampleArgbLinePair", ua, 4), Sn("UpsampleRgba4444LinePair", mi, 2), Sn("UpsampleRgb565LinePair", gi, 2);
var Qf = R.UpsampleRgbLinePair, th = R.UpsampleBgrLinePair, ml = R.UpsampleRgbaLinePair, vl = R.UpsampleBgraLinePair, bl = R.UpsampleArgbLinePair, wl = R.UpsampleRgba4444LinePair, eh = R.UpsampleRgb565LinePair, us = 16, fs = 1 << us - 1, xa = -227, io = 482, rh = 6, yl = 0, nh = a(256), ih = a(256), ah = a(256), sh = a(256), oh = a(io - xa), lh = a(io - xa);
kn("YuvToRgbRow", Tn, 3), kn("YuvToBgrRow", sr, 3), kn("YuvToRgbaRow", mr, 4), kn("YuvToBgraRow", fa, 4), kn("YuvToArgbRow", ua, 4), kn("YuvToRgba4444Row", mi, 2), kn("YuvToRgb565Row", gi, 2);
var xl = [0, 4, 8, 12, 128, 132, 136, 140, 256, 260, 264, 268, 384, 388, 392, 396], hs = [0, 2, 8], uh = [8, 7, 6, 4, 4, 2, 2, 2, 1, 1, 1, 1], fh = 1;
this.WebPDecodeRGBA = function(n, s, f, g, b) {
var w = as, y = new dt(), A = new le();
y.ba = A, A.S = w, A.width = [A.width], A.height = [A.height];
var L = A.width, I = A.height, W = new Vt();
if (W == null || n == null) var et = 2;
else t(W != null), et = vi(n, s, f, W.width, W.height, W.Pd, W.Qd, W.format, null);
if (et != 0 ? L = 0 : (L != null && (L[0] = W.width[0]), I != null && (I[0] = W.height[0]), L = 1), L) {
A.width = A.width[0], A.height = A.height[0], g != null && (g[0] = A.width), b != null && (b[0] = A.height);
t: {
if (g = new Bi(), (b = new vt()).data = n, b.w = s, b.ha = f, b.kd = 1, s = [0], t(b != null), ((n = vi(b.data, b.w, b.ha, null, null, null, s, null, b)) == 0 || n == 7) && s[0] && (n = 4), (s = n) == 0) {
if (t(y != null), g.data = b.data, g.w = b.w + b.offset, g.ha = b.ha - b.offset, g.put = Gt, g.ac = en, g.bc = mn, g.ma = y, b.xa) {
if ((n = si()) == null) {
y = 1;
break t;
}
if ((function(C, Y) {
var $ = [0], lt = [0], Q = [0];
e: for (; ; ) {
if (C == null) return 0;
if (Y == null) return C.a = 2, 0;
if (C.l = Y, C.a = 0, ht(C.m, Y.data, Y.w, Y.ha), !vn(C.m, $, lt, Q)) {
C.a = 3;
break e;
}
if (C.xb = gl, Y.width = $[0], Y.height = lt[0], !nn($[0], lt[0], 1, C, null)) break e;
return 1;
}
return t(C.a != 0), 0;
})(n, g)) {
if (g = (s = Dn(g.width, g.height, y.Oa, y.ba)) == 0) {
e: {
g = n;
r: for (; ; ) {
if (g == null) {
g = 0;
break e;
}
if (t(g.s.yc != null), t(g.s.Ya != null), t(0 < g.s.Wb), t((f = g.l) != null), t((b = f.ma) != null), g.xb != 0) {
if (g.ca = b.ba, g.tb = b.tb, t(g.ca != null), !ha(b.Oa, f, ss)) {
g.a = 2;
break r;
}
if (!oi(g, f.width) || f.da) break r;
if ((f.da || Yt(g.ca.S)) && Yr(), 11 > g.ca.S || (alert("todo:WebPInitConvertARGBToYUV"), g.ca.f.kb.F != null && Yr()), g.Pb && 0 < g.s.ua && g.s.vb.X == null && !P(g.s.vb, g.s.Wa.Xa)) {
g.a = 1;
break r;
}
g.xb = 0;
}
if (!Vr(g, g.V, g.Ba, g.c, g.i, f.o, Mn)) break r;
b.Dc = g.Ma, g = 1;
break e;
}
t(g.a != 0), g = 0;
}
g = !g;
}
g && (s = n.a);
} else s = n.a;
} else {
if ((n = new Ms()) == null) {
y = 1;
break t;
}
if (n.Fa = b.na, n.P = b.P, n.qc = b.Sa, sn(n, g)) {
if ((s = Dn(g.width, g.height, y.Oa, y.ba)) == 0) {
if (n.Aa = 0, f = y.Oa, t((b = n) != null), f != null) {
if (0 < (L = 0 > (L = f.Md) ? 0 : 100 < L ? 255 : 255 * L / 100)) {
for (I = W = 0; 4 > I; ++I) 12 > (et = b.pb[I]).lc && (et.ia = L * uh[0 > et.lc ? 0 : et.lc] >> 3), W |= et.ia;
W && (alert("todo:VP8InitRandom"), b.ia = 1);
}
b.Ga = f.Id, 100 < b.Ga ? b.Ga = 100 : 0 > b.Ga && (b.Ga = 0);
}
(function(C, Y) {
if (C == null) return 0;
if (Y == null) return Ye(C, 2, "NULL VP8Io parameter in VP8Decode().");
if (!C.cb && !sn(C, Y)) return 0;
if (t(C.cb), Y.ac == null || Y.ac(Y)) {
Y.ob && (C.L = 0);
var $ = hs[C.L];
if (C.L == 2 ? (C.yb = 0, C.zb = 0) : (C.yb = Y.v - $ >> 4, C.zb = Y.j - $ >> 4, 0 > C.yb && (C.yb = 0), 0 > C.zb && (C.zb = 0)), C.Va = Y.o + 15 + $ >> 4, C.Hb = Y.va + 15 + $ >> 4, C.Hb > C.za && (C.Hb = C.za), C.Va > C.Ub && (C.Va = C.Ub), 0 < C.L) {
var lt = C.ed;
for ($ = 0; 4 > $; ++$) {
var Q;
if (C.Qa.Cb) {
var ft = C.Qa.Lb[$];
C.Qa.Fb || (ft += lt.Tb);
} else ft = lt.Tb;
for (Q = 0; 1 >= Q; ++Q) {
var pt = C.gd[$][Q], xt = ft;
if (lt.Pc && (xt += lt.vd[0], Q && (xt += lt.od[0])), 0 < (xt = 0 > xt ? 0 : 63 < xt ? 63 : xt)) {
var bt = xt;
0 < lt.wb && (bt = 4 < lt.wb ? bt >> 2 : bt >> 1) > 9 - lt.wb && (bt = 9 - lt.wb), 1 > bt && (bt = 1), pt.dd = bt, pt.tc = 2 * xt + bt, pt.ld = 40 <= xt ? 2 : 15 <= xt ? 1 : 0;
} else pt.tc = 0;
pt.La = Q;
}
}
}
$ = 0;
} else Ye(C, 6, "Frame setup failed"), $ = C.a;
if ($ = $ == 0) {
if ($) {
C.$c = 0, 0 < C.Aa || (C.Ic = fh);
e: {
$ = C.Ic, lt = 4 * (bt = C.za);
var Rt = 32 * bt, Pt = bt + 1, ne = 0 < C.L ? bt * (0 < C.Aa ? 2 : 1) : 0, Et = (C.Aa == 2 ? 2 : 1) * bt;
if ((pt = lt + 832 + (Q = 3 * (16 * $ + hs[C.L]) / 2 * Rt) + (ft = C.Fa != null && 0 < C.Fa.length ? C.Kc.c * C.Kc.i : 0)) != pt) $ = 0;
else {
if (pt > C.Vb) {
if (C.Vb = 0, C.Ec = a(pt), C.Fc = 0, C.Ec == null) {
$ = Ye(C, 1, "no memory during frame initialization.");
break e;
}
C.Vb = pt;
}
pt = C.Ec, xt = C.Fc, C.Ac = pt, C.Bc = xt, xt += lt, C.Gd = c(Rt, Ua), C.Hd = 0, C.rb = c(Pt + 1, Zi), C.sb = 1, C.wa = ne ? c(ne, Mr) : null, C.Y = 0, C.D.Nb = 0, C.D.wa = C.wa, C.D.Y = C.Y, 0 < C.Aa && (C.D.Y += bt), t(!0), C.oc = pt, C.pc = xt, xt += 832, C.ya = c(Et, Qi), C.aa = 0, C.D.ya = C.ya, C.D.aa = C.aa, C.Aa == 2 && (C.D.aa += bt), C.R = 16 * bt, C.B = 8 * bt, bt = (Rt = hs[C.L]) * C.R, Rt = Rt / 2 * C.B, C.sa = pt, C.ta = xt + bt, C.qa = C.sa, C.ra = C.ta + 16 * $ * C.R + Rt, C.Ha = C.qa, C.Ia = C.ra + 8 * $ * C.B + Rt, C.$c = 0, xt += Q, C.mb = ft ? pt : null, C.nb = ft ? xt : null, t(xt + ft <= C.Fc + C.Vb), Wa(C), o(C.Ac, C.Bc, 0, lt), $ = 1;
}
}
if ($) {
if (Y.ka = 0, Y.y = C.sa, Y.O = C.ta, Y.f = C.qa, Y.N = C.ra, Y.ea = C.Ha, Y.Vd = C.Ia, Y.fa = C.R, Y.Rc = C.B, Y.F = null, Y.J = 0, !fl) {
for ($ = -255; 255 >= $; ++$) sl[255 + $] = 0 > $ ? -$ : $;
for ($ = -1020; 1020 >= $; ++$) ol[1020 + $] = -128 > $ ? -128 : 127 < $ ? 127 : $;
for ($ = -112; 112 >= $; ++$) ll[112 + $] = -16 > $ ? -16 : 15 < $ ? 15 : $;
for ($ = -255; 510 >= $; ++$) ul[255 + $] = 0 > $ ? 0 : 255 < $ ? 255 : $;
fl = 1;
}
Vn = Ri, yi = Ts, fn = on, we = Ga, Ae = Ya, Dr = Rs, Ue = Za, Ze = ci, In = v, ba = E, Hi = Qa, rs = u, $o = q, Zo = X, Qo = hi, tl = oa, el = Xa, rl = $a, Jr[0] = Gs, Jr[1] = Ds, Jr[2] = Ws, Jr[3] = Vs, Jr[4] = wn, Jr[5] = Ys, Jr[6] = yn, Jr[7] = Js, Jr[8] = ra, Jr[9] = Ti, Gn[0] = zs, Gn[1] = Us, Gn[2] = ta, Gn[3] = Ja, Gn[4] = ui, Gn[5] = ea, Gn[6] = Hs, Cn[0] = Xs, Cn[1] = qs, Cn[2] = fi, Cn[3] = Ks, Cn[4] = ia, Cn[5] = na, Cn[6] = Ka, $ = 1;
} else $ = 0;
}
$ && ($ = (function(ce, Qe) {
for (ce.M = 0; ce.M < ce.Va; ++ce.M) {
var ie, Ot = ce.Jc[ce.M & ce.Xb], Nt = ce.m, ze = ce;
for (ie = 0; ie < ze.za; ++ie) {
var te = Nt, de = ze, Ie = de.Ac, or = de.Bc + 4 * ie, vr = de.zc, Me = de.ya[de.aa + ie];
if (de.Qa.Bb ? Me.$b = gt(te, de.Pa.jb[0]) ? 2 + gt(te, de.Pa.jb[2]) : gt(te, de.Pa.jb[1]) : Me.$b = 0, de.kc && (Me.Ad = gt(te, de.Bd)), Me.Za = !gt(te, 145) + 0, Me.Za) {
var hr = Me.Ob, br = 0;
for (de = 0; 4 > de; ++de) {
var tr, me = vr[0 + de];
for (tr = 0; 4 > tr; ++tr) {
me = Kf[Ie[or + tr]][me];
for (var ye = pl[gt(te, me[0])]; 0 < ye; ) ye = pl[2 * ye + gt(te, me[ye])];
me = -ye, Ie[or + tr] = me;
}
i(hr, br, Ie, or, 4), br += 4, vr[0 + de] = me;
}
} else me = gt(te, 156) ? gt(te, 128) ? 1 : 3 : gt(te, 163) ? 2 : 0, Me.Ob[0] = me, o(Ie, or, me, 4), o(vr, 0, me, 4);
Me.Dd = gt(te, 142) ? gt(te, 114) ? gt(te, 183) ? 1 : 3 : 2 : 0;
}
if (ze.m.Ka) return Ye(ce, 7, "Premature end-of-partition0 encountered.");
for (; ce.ja < ce.za; ++ce.ja) {
if (ze = Ot, te = (Nt = ce).rb[Nt.sb - 1], Ie = Nt.rb[Nt.sb + Nt.ja], ie = Nt.ya[Nt.aa + Nt.ja], or = Nt.kc ? ie.Ad : 0) te.la = Ie.la = 0, ie.Za || (te.Na = Ie.Na = 0), ie.Hc = 0, ie.Gc = 0, ie.ia = 0;
else {
var Re, xe;
if (te = Ie, Ie = ze, or = Nt.Pa.Xc, vr = Nt.ya[Nt.aa + Nt.ja], Me = Nt.pb[vr.$b], de = vr.ad, hr = 0, br = Nt.rb[Nt.sb - 1], me = tr = 0, o(de, hr, 0, 384), vr.Za) var lr = 0, Kr = or[3];
else {
ye = a(16);
var He = te.Na + br.Na;
if (He = ya(Ie, or[1], He, Me.Eb, 0, ye, 0), te.Na = br.Na = (0 < He) + 0, 1 < He) Vn(ye, 0, de, hr);
else {
var yr = ye[0] + 3 >> 3;
for (ye = 0; 256 > ye; ye += 16) de[hr + ye] = yr;
}
lr = 1, Kr = or[0];
}
var Ne = 15 & te.la, er = 15 & br.la;
for (ye = 0; 4 > ye; ++ye) {
var Sr = 1 & er;
for (yr = xe = 0; 4 > yr; ++yr) Ne = Ne >> 1 | (Sr = (He = ya(Ie, Kr, He = Sr + (1 & Ne), Me.Sc, lr, de, hr)) > lr) << 7, xe = xe << 2 | (3 < He ? 3 : 1 < He ? 2 : de[hr + 0] != 0), hr += 16;
Ne >>= 4, er = er >> 1 | Sr << 7, tr = (tr << 8 | xe) >>> 0;
}
for (Kr = Ne, lr = er >> 4, Re = 0; 4 > Re; Re += 2) {
for (xe = 0, Ne = te.la >> 4 + Re, er = br.la >> 4 + Re, ye = 0; 2 > ye; ++ye) {
for (Sr = 1 & er, yr = 0; 2 > yr; ++yr) He = Sr + (1 & Ne), Ne = Ne >> 1 | (Sr = 0 < (He = ya(Ie, or[2], He, Me.Qc, 0, de, hr))) << 3, xe = xe << 2 | (3 < He ? 3 : 1 < He ? 2 : de[hr + 0] != 0), hr += 16;
Ne >>= 2, er = er >> 1 | Sr << 5;
}
me |= xe << 4 * Re, Kr |= Ne << 4 << Re, lr |= (240 & er) << Re;
}
te.la = Kr, br.la = lr, vr.Hc = tr, vr.Gc = me, vr.ia = 43690 & me ? 0 : Me.ia, or = !(tr | me);
}
if (0 < Nt.L && (Nt.wa[Nt.Y + Nt.ja] = Nt.gd[ie.$b][ie.Za], Nt.wa[Nt.Y + Nt.ja].La |= !or), ze.Ka) return Ye(ce, 7, "Premature end-of-file encountered.");
}
if (Wa(ce), Nt = Qe, ze = 1, ie = (Ot = ce).D, te = 0 < Ot.L && Ot.M >= Ot.zb && Ot.M <= Ot.Va, Ot.Aa == 0) e: {
if (ie.M = Ot.M, ie.uc = te, Tr(Ot, ie), ze = 1, ie = (xe = Ot.D).Nb, te = (me = hs[Ot.L]) * Ot.R, Ie = me / 2 * Ot.B, ye = 16 * ie * Ot.R, yr = 8 * ie * Ot.B, or = Ot.sa, vr = Ot.ta - te + ye, Me = Ot.qa, de = Ot.ra - Ie + yr, hr = Ot.Ha, br = Ot.Ia - Ie + yr, er = (Ne = xe.M) == 0, tr = Ne >= Ot.Va - 1, Ot.Aa == 2 && Tr(Ot, xe), xe.uc) for (Sr = (He = Ot).D.M, t(He.D.uc), xe = He.yb; xe < He.Hb; ++xe) {
lr = xe, Kr = Sr;
var wr = (kr = (ur = He).D).Nb;
Re = ur.R;
var kr = kr.wa[kr.Y + lr], Pr = ur.sa, xr = ur.ta + 16 * wr * Re + 16 * lr, Ir = kr.dd, Pe = kr.tc;
if (Pe != 0) if (t(3 <= Pe), ur.L == 1) 0 < lr && tl(Pr, xr, Re, Pe + 4), kr.La && rl(Pr, xr, Re, Pe), 0 < Kr && Qo(Pr, xr, Re, Pe + 4), kr.La && el(Pr, xr, Re, Pe);
else {
var Cr = ur.B, Xr = ur.qa, xi = ur.ra + 8 * wr * Cr + 8 * lr, Fn = ur.Ha, ur = ur.Ia + 8 * wr * Cr + 8 * lr;
wr = kr.ld, 0 < lr && (Ze(Pr, xr, Re, Pe + 4, Ir, wr), ba(Xr, xi, Fn, ur, Cr, Pe + 4, Ir, wr)), kr.La && (rs(Pr, xr, Re, Pe, Ir, wr), Zo(Xr, xi, Fn, ur, Cr, Pe, Ir, wr)), 0 < Kr && (Ue(Pr, xr, Re, Pe + 4, Ir, wr), In(Xr, xi, Fn, ur, Cr, Pe + 4, Ir, wr)), kr.La && (Hi(Pr, xr, Re, Pe, Ir, wr), $o(Xr, xi, Fn, ur, Cr, Pe, Ir, wr));
}
}
if (Ot.ia && alert("todo:DitherRow"), Nt.put != null) {
if (xe = 16 * Ne, Ne = 16 * (Ne + 1), er ? (Nt.y = Ot.sa, Nt.O = Ot.ta + ye, Nt.f = Ot.qa, Nt.N = Ot.ra + yr, Nt.ea = Ot.Ha, Nt.W = Ot.Ia + yr) : (xe -= me, Nt.y = or, Nt.O = vr, Nt.f = Me, Nt.N = de, Nt.ea = hr, Nt.W = br), tr || (Ne -= me), Ne > Nt.o && (Ne = Nt.o), Nt.F = null, Nt.J = null, Ot.Fa != null && 0 < Ot.Fa.length && xe < Ne && (Nt.J = ke(Ot, Nt, xe, Ne - xe), Nt.F = Ot.mb, Nt.F == null && Nt.F.length == 0)) {
ze = Ye(Ot, 3, "Could not decode alpha data.");
break e;
}
xe < Nt.j && (me = Nt.j - xe, xe = Nt.j, t(!(1 & me)), Nt.O += Ot.R * me, Nt.N += Ot.B * (me >> 1), Nt.W += Ot.B * (me >> 1), Nt.F != null && (Nt.J += Nt.width * me)), xe < Ne && (Nt.O += Nt.v, Nt.N += Nt.v >> 1, Nt.W += Nt.v >> 1, Nt.F != null && (Nt.J += Nt.v), Nt.ka = xe - Nt.j, Nt.U = Nt.va - Nt.v, Nt.T = Ne - xe, ze = Nt.put(Nt));
}
ie + 1 != Ot.Ic || tr || (i(Ot.sa, Ot.ta - te, or, vr + 16 * Ot.R, te), i(Ot.qa, Ot.ra - Ie, Me, de + 8 * Ot.B, Ie), i(Ot.Ha, Ot.Ia - Ie, hr, br + 8 * Ot.B, Ie));
}
if (!ze) return Ye(ce, 6, "Output aborted.");
}
return 1;
})(C, Y)), Y.bc != null && Y.bc(Y), $ &= 1;
}
return $ ? (C.cb = 0, $) : 0;
})(n, g) || (s = n.a);
}
} else s = n.a;
}
s == 0 && y.Oa != null && y.Oa.fd && (s = ca(y.ba));
}
y = s;
}
w = y != 0 ? null : 11 > w ? A.f.RGBA.eb : A.f.kb.y;
} else w = null;
return w;
};
var _l = [3, 4, 3, 4, 4, 2, 2, 4, 4, 4, 2, 1, 1];
};
function d(R, tt) {
for (var N = "", F = 0; F < 4; F++) N += String.fromCharCode(R[tt++]);
return N;
}
function m(R, tt) {
return R[tt + 0] | R[tt + 1] << 8;
}
function _(R, tt) {
return (R[tt + 0] | R[tt + 1] << 8 | R[tt + 2] << 16) >>> 0;
}
function k(R, tt) {
return (R[tt + 0] | R[tt + 1] << 8 | R[tt + 2] << 16 | R[tt + 3] << 24) >>> 0;
}
new h();
var p = [0], j = [0], O = [], M = new h(), S = r, V = (function(R, tt) {
var N = {}, F = 0, z = !1, U = 0, nt = 0;
if (N.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(x, B) {
for (var T = 0; T < 4; T++) if (x[B + T] != "RIFF".charCodeAt(T)) return !0;
return !1;
})(R, tt)) {
for (k(R, tt += 4), tt += 8; tt < R.length; ) {
var ot = d(R, tt), ut = k(R, tt += 4);
tt += 4;
var rt = ut + (1 & ut);
switch (ot) {
case "VP8 ":
case "VP8L":
N.frames[F] === void 0 && (N.frames[F] = {}), (wt = N.frames[F]).src_off = z ? nt : tt - 8, wt.src_size = U + ut + 8, F++, z && (z = !1, U = 0, nt = 0);
break;
case "VP8X":
(wt = N.header = {}).feature_flags = R[tt];
var ht = tt + 4;
wt.canvas_width = 1 + _(R, ht), ht += 3, wt.canvas_height = 1 + _(R, ht), ht += 3;
break;
case "ALPH":
z = !0, U = rt + 8, nt = tt - 8;
break;
case "ANIM":
(wt = N.header).bgcolor = k(R, tt), ht = tt + 4, wt.loop_count = m(R, ht), ht += 2;
break;
case "ANMF":
var At, wt;
(wt = N.frames[F] = {}).offset_x = 2 * _(R, tt), tt += 3, wt.offset_y = 2 * _(R, tt), tt += 3, wt.width = 1 + _(R, tt), tt += 3, wt.height = 1 + _(R, tt), tt += 3, wt.duration = _(R, tt), tt += 3, At = R[tt++], wt.dispose = 1 & At, wt.blend = At >> 1 & 1;
}
ot != "ANMF" && (tt += rt);
}
return N;
}
})(S, 0);
V.response = S, V.rgbaoutput = !0, V.dataurl = !1;
var G = V.header ? V.header : null, D = V.frames ? V.frames : null;
if (G) {
G.loop_counter = G.loop_count, p = [G.canvas_height], j = [G.canvas_width];
for (var it = 0; it < D.length && D[it].blend != 0; it++) ;
}
var mt = D[0], ct = M.WebPDecodeRGBA(S, mt.src_off, mt.src_size, j, p);
mt.rgba = ct, mt.imgwidth = j[0], mt.imgheight = p[0];
for (var K = 0; K < j[0] * p[0] * 4; K++) O[K] = ct[K];
return this.width = j, this.height = p, this.data = O, this;
}
(function(r) {
var t, e, i, o, a, c, l, h, d, m = function(x) {
return x = x || {}, this.isStrokeTransparent = x.isStrokeTransparent || !1, this.strokeOpacity = x.strokeOpacity || 1, this.strokeStyle = x.strokeStyle || "#000000", this.fillStyle = x.fillStyle || "#000000", this.isFillTransparent = x.isFillTransparent || !1, this.fillOpacity = x.fillOpacity || 1, this.font = x.font || "10px sans-serif", this.textBaseline = x.textBaseline || "alphabetic", this.textAlign = x.textAlign || "left", this.lineWidth = x.lineWidth || 1, this.lineJoin = x.lineJoin || "miter", this.lineCap = x.lineCap || "butt", this.path = x.path || [], this.transform = x.transform !== void 0 ? x.transform.clone() : new h(), this.globalCompositeOperation = x.globalCompositeOperation || "normal", this.globalAlpha = x.globalAlpha || 1, this.clip_path = x.clip_path || [], this.currentPoint = x.currentPoint || new c(), this.miterLimit = x.miterLimit || 10, this.lastPoint = x.lastPoint || new c(), this.lineDashOffset = x.lineDashOffset || 0, this.lineDash = x.lineDash || [], this.margin = x.margin || [0, 0, 0, 0], this.prevPageLastElemOffset = x.prevPageLastElemOffset || 0, this.ignoreClearRect = typeof x.ignoreClearRect != "boolean" || x.ignoreClearRect, this;
};
r.events.push(["initialized", function() {
this.context2d = new _(this), t = this.internal.f2, e = this.internal.getCoordinateString, i = this.internal.getVerticalCoordinateString, o = this.internal.getHorizontalCoordinate, a = this.internal.getVerticalCoordinate, c = this.internal.Point, l = this.internal.Rectangle, h = this.internal.Matrix, d = new m();
}]);
var _ = function(x) {
Object.defineProperty(this, "canvas", { get: function() {
return { parentNode: !1, style: !1 };
} });
var B = x;
Object.defineProperty(this, "pdf", { get: function() {
return B;
} });
var T = !1;
Object.defineProperty(this, "pageWrapXEnabled", { get: function() {
return T;
}, set: function(P) {
T = !!P;
} });
var H = !1;
Object.defineProperty(this, "pageWrapYEnabled", { get: function() {
return H;
}, set: function(P) {
H = !!P;
} });
var J = 0;
Object.defineProperty(this, "posX", { get: function() {
return J;
}, set: function(P) {
isNaN(P) || (J = P);
} });
var Z = 0;
Object.defineProperty(this, "posY", { get: function() {
return Z;
}, set: function(P) {
isNaN(P) || (Z = P);
} }), Object.defineProperty(this, "margin", { get: function() {
return d.margin;
}, set: function(P) {
var Lt;
typeof P == "number" ? Lt = [P, P, P, P] : ((Lt = new Array(4))[0] = P[0], Lt[1] = P.length >= 2 ? P[1] : Lt[0], Lt[2] = P.length >= 3 ? P[2] : Lt[0], Lt[3] = P.length >= 4 ? P[3] : Lt[1]), d.margin = Lt;
} });
var at = !1;
Object.defineProperty(this, "autoPaging", { get: function() {
return at;
}, set: function(P) {
at = P;
} });
var st = 0;
Object.defineProperty(this, "lastBreak", { get: function() {
return st;
}, set: function(P) {
st = P;
} });
var gt = [];
Object.defineProperty(this, "pageBreaks", { get: function() {
return gt;
}, set: function(P) {
gt = P;
} }), Object.defineProperty(this, "ctx", { get: function() {
return d;
}, set: function(P) {
P instanceof m && (d = P);
} }), Object.defineProperty(this, "path", { get: function() {
return d.path;
}, set: function(P) {
d.path = P;
} });
var _t = [];
Object.defineProperty(this, "ctxStack", { get: function() {
return _t;
}, set: function(P) {
_t = P;
} }), Object.defineProperty(this, "fillStyle", { get: function() {
return this.ctx.fillStyle;
}, set: function(P) {
var Lt;
Lt = k(P), this.ctx.fillStyle = Lt.style, this.ctx.isFillTransparent = Lt.a === 0, this.ctx.fillOpacity = Lt.a, this.pdf.setFillColor(Lt.r, Lt.g, Lt.b, { a: Lt.a }), this.pdf.setTextColor(Lt.r, Lt.g, Lt.b, { a: Lt.a });
} }), Object.defineProperty(this, "strokeStyle", { get: function() {
return this.ctx.strokeStyle;
}, set: function(P) {
var Lt = k(P);
this.ctx.strokeStyle = Lt.style, this.ctx.isStrokeTransparent = Lt.a === 0, this.ctx.strokeOpacity = Lt.a, Lt.a === 0 ? this.pdf.setDrawColor(255, 255, 255) : (Lt.a, this.pdf.setDrawColor(Lt.r, Lt.g, Lt.b));
} }), Object.defineProperty(this, "lineCap", { get: function() {
return this.ctx.lineCap;
}, set: function(P) {
["butt", "round", "square"].indexOf(P) !== -1 && (this.ctx.lineCap = P, this.pdf.setLineCap(P));
} }), Object.defineProperty(this, "lineWidth", { get: function() {
return this.ctx.lineWidth;
}, set: function(P) {
isNaN(P) || (this.ctx.lineWidth = P, this.pdf.setLineWidth(P));
} }), Object.defineProperty(this, "lineJoin", { get: function() {
return this.ctx.lineJoin;
}, set: function(P) {
["bevel", "round", "miter"].indexOf(P) !== -1 && (this.ctx.lineJoin = P, this.pdf.setLineJoin(P));
} }), Object.defineProperty(this, "miterLimit", { get: function() {
return this.ctx.miterLimit;
}, set: function(P) {
isNaN(P) || (this.ctx.miterLimit = P, this.pdf.setMiterLimit(P));
} }), Object.defineProperty(this, "textBaseline", { get: function() {
return this.ctx.textBaseline;
}, set: function(P) {
this.ctx.textBaseline = P;
} }), Object.defineProperty(this, "textAlign", { get: function() {
return this.ctx.textAlign;
}, set: function(P) {
["right", "end", "center", "left", "start"].indexOf(P) !== -1 && (this.ctx.textAlign = P);
} });
var kt = null, St = null, Dt = null;
Object.defineProperty(this, "fontFaces", { get: function() {
return Dt;
}, set: function(P) {
kt = null, St = null, Dt = P;
} }), Object.defineProperty(this, "font", { get: function() {
return this.ctx.font;
}, set: function(P) {
var Lt;
if (this.ctx.font = P, (Lt = /^\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-z0-9]+?)\s*$/i.exec(P)) !== null) {
var ae = Lt[1];
Lt[2];
var Ht = Lt[3], yt = Lt[4];
Lt[5];
var Wt = Lt[6], Ct = /^([.\d]+)((?:%|in|[cem]m|ex|p[ctx]))$/i.exec(yt)[2];
yt = Math.floor(Ct === "px" ? parseFloat(yt) * this.pdf.internal.scaleFactor : Ct === "em" ? parseFloat(yt) * this.pdf.getFontSize() : parseFloat(yt) * this.pdf.internal.scaleFactor), this.pdf.setFontSize(yt);
var zt = (function(Tt) {
var De, pe, se = [], oe = Tt.trim();
if (oe === "") return Eo;
if (oe in Cu) return [Cu[oe]];
for (; oe !== ""; ) {
switch (pe = null, De = (oe = Eu(oe)).charAt(0)) {
case '"':
case "'":
pe = W1(oe.substring(1), De);
break;
default:
pe = V1(oe);
}
if (pe === null || (se.push(pe[0]), (oe = Eu(pe[1])) !== "" && oe.charAt(0) !== ",")) return Eo;
oe = oe.replace(/^,/, "");
}
return se;
})(Wt);
if (this.fontFaces) {
var qt = (function(Tt, De) {
var pe = Tt.getFontList(), se = JSON.stringify(pe);
if (kt === null || St !== se) {
var oe = (function(Fe) {
var Ut = [];
return Object.keys(Fe).forEach(function(Se) {
Fe[Se].forEach(function(Yt) {
var Qt = null;
switch (Yt) {
case "bold":
Qt = { family: Se, weight: "bold" };
break;
case "italic":
Qt = { family: Se, style: "italic" };
break;
case "bolditalic":
Qt = { family: Se, weight: "bold", style: "italic" };
break;
case "":
case "normal":
Qt = { family: Se };
}
Qt !== null && (Qt.ref = { name: Se, style: Yt }, Ut.push(Qt));
});
}), Ut;
})(pe);
kt = (function(Fe) {
for (var Ut = {}, Se = 0; Se < Fe.length; ++Se) {
var Yt = Fo(Fe[Se]), Qt = Yt.family, Ee = Yt.stretch, le = Yt.style, Vt = Yt.weight;
Ut[Qt] = Ut[Qt] || {}, Ut[Qt][Ee] = Ut[Qt][Ee] || {}, Ut[Qt][Ee][le] = Ut[Qt][Ee][le] || {}, Ut[Qt][Ee][le][Vt] = Yt;
}
return Ut;
})(oe.concat(De)), St = se;
}
return kt;
})(this.pdf, this.fontFaces), ve = zt.map(function(Tt) {
return { family: Tt, stretch: "normal", weight: Ht, style: ae };
}), ue = (function(Tt, De, pe) {
for (var se = (pe = pe || {}).defaultFontFamily || "times", oe = Object.assign({}, H1, pe.genericFontFamilies || {}), Fe = null, Ut = null, Se = 0; Se < De.length; ++Se) if (oe[(Fe = Fo(De[Se])).family] && (Fe.family = oe[Fe.family]), Tt.hasOwnProperty(Fe.family)) {
Ut = Tt[Fe.family];
break;
}
if (!(Ut = Ut || Tt[se])) throw new Error("Could not find a font-family for the rule '" + Fu(Fe) + "' and default family '" + se + "'.");
if (Ut = (function(Yt, Qt) {
if (Qt[Yt]) return Qt[Yt];
var Ee = Vo[Yt], le = Ee <= Vo.normal ? -1 : 1, Vt = Iu(Qt, jf, Ee, le);
if (!Vt) throw new Error("Could not find a matching font-stretch value for " + Yt);
return Vt;
})(Fe.stretch, Ut), Ut = (function(Yt, Qt) {
if (Qt[Yt]) return Qt[Yt];
for (var Ee = Of[Yt], le = 0; le < Ee.length; ++le) if (Qt[Ee[le]]) return Qt[Ee[le]];
throw new Error("Could not find a matching font-style for " + Yt);
})(Fe.style, Ut), !(Ut = (function(Yt, Qt) {
if (Qt[Yt]) return Qt[Yt];
if (Yt === 400 && Qt[500]) return Qt[500];
if (Yt === 500 && Qt[400]) return Qt[400];
var Ee = z1[Yt], le = Iu(Qt, Bf, Ee, Yt < 400 ? -1 : 1);
if (!le) throw new Error("Could not find a matching font-weight for value " + Yt);
return le;
})(Fe.weight, Ut))) throw new Error("Failed to resolve a font for the rule '" + Fu(Fe) + "'.");
return Ut;
})(qt, ve);
this.pdf.setFont(ue.ref.name, ue.ref.style);
} else {
var Zt = "";
(Ht === "bold" || parseInt(Ht, 10) >= 700 || ae === "bold") && (Zt = "bold"), ae === "italic" && (Zt += "italic"), Zt.length === 0 && (Zt = "normal");
for (var he = "", fe = { 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" }, jt = 0; jt < zt.length; jt++) {
if (this.pdf.internal.getFont(zt[jt], Zt, { noFallback: !0, disableWarning: !0 }) !== void 0) {
he = zt[jt];
break;
}
if (Zt === "bolditalic" && this.pdf.internal.getFont(zt[jt], "bold", { noFallback: !0, disableWarning: !0 }) !== void 0) he = zt[jt], Zt = "bold";
else if (this.pdf.internal.getFont(zt[jt], "normal", { noFallback: !0, disableWarning: !0 }) !== void 0) {
he = zt[jt], Zt = "normal";
break;
}
}
if (he === "") {
for (var ee = 0; ee < zt.length; ee++) if (fe[zt[ee]]) {
he = fe[zt[ee]];
break;
}
}
he = he === "" ? "Times" : he, this.pdf.setFont(he, Zt);
}
}
} }), Object.defineProperty(this, "globalCompositeOperation", { get: function() {
return this.ctx.globalCompositeOperation;
}, set: function(P) {
this.ctx.globalCompositeOperation = P;
} }), Object.defineProperty(this, "globalAlpha", { get: function() {
return this.ctx.globalAlpha;
}, set: function(P) {
this.ctx.globalAlpha = P;
} }), Object.defineProperty(this, "lineDashOffset", { get: function() {
return this.ctx.lineDashOffset;
}, set: function(P) {
this.ctx.lineDashOffset = P, wt.call(this);
} }), Object.defineProperty(this, "lineDash", { get: function() {
return this.ctx.lineDash;
}, set: function(P) {
this.ctx.lineDash = P, wt.call(this);
} }), Object.defineProperty(this, "ignoreClearRect", { get: function() {
return this.ctx.ignoreClearRect;
}, set: function(P) {
this.ctx.ignoreClearRect = !!P;
} });
};
_.prototype.setLineDash = function(x) {
this.lineDash = x;
}, _.prototype.getLineDash = function() {
return this.lineDash.length % 2 ? this.lineDash.concat(this.lineDash) : this.lineDash.slice();
}, _.prototype.fill = function() {
D.call(this, "fill", !1);
}, _.prototype.stroke = function() {
D.call(this, "stroke", !1);
}, _.prototype.beginPath = function() {
this.path = [{ type: "begin" }];
}, _.prototype.moveTo = function(x, B) {
if (isNaN(x) || isNaN(B)) throw Le.error("jsPDF.context2d.moveTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.moveTo");
var T = this.ctx.transform.applyToPoint(new c(x, B));
this.path.push({ type: "mt", x: T.x, y: T.y }), this.ctx.lastPoint = new c(x, B);
}, _.prototype.closePath = function() {
var x = new c(0, 0), B = 0;
for (B = this.path.length - 1; B !== -1; B--) if (this.path[B].type === "begin" && _e(this.path[B + 1]) === "object" && typeof this.path[B + 1].x == "number") {
x = new c(this.path[B + 1].x, this.path[B + 1].y);
break;
}
this.path.push({ type: "close" }), this.ctx.lastPoint = new c(x.x, x.y);
}, _.prototype.lineTo = function(x, B) {
if (isNaN(x) || isNaN(B)) throw Le.error("jsPDF.context2d.lineTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.lineTo");
var T = this.ctx.transform.applyToPoint(new c(x, B));
this.path.push({ type: "lt", x: T.x, y: T.y }), this.ctx.lastPoint = new c(T.x, T.y);
}, _.prototype.clip = function() {
this.ctx.clip_path = JSON.parse(JSON.stringify(this.path)), D.call(this, null, !0);
}, _.prototype.quadraticCurveTo = function(x, B, T, H) {
if (isNaN(T) || isNaN(H) || isNaN(x) || isNaN(B)) throw Le.error("jsPDF.context2d.quadraticCurveTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.quadraticCurveTo");
var J = this.ctx.transform.applyToPoint(new c(T, H)), Z = this.ctx.transform.applyToPoint(new c(x, B));
this.path.push({ type: "qct", x1: Z.x, y1: Z.y, x: J.x, y: J.y }), this.ctx.lastPoint = new c(J.x, J.y);
}, _.prototype.bezierCurveTo = function(x, B, T, H, J, Z) {
if (isNaN(J) || isNaN(Z) || isNaN(x) || isNaN(B) || isNaN(T) || isNaN(H)) throw Le.error("jsPDF.context2d.bezierCurveTo: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.bezierCurveTo");
var at = this.ctx.transform.applyToPoint(new c(J, Z)), st = this.ctx.transform.applyToPoint(new c(x, B)), gt = this.ctx.transform.applyToPoint(new c(T, H));
this.path.push({ type: "bct", x1: st.x, y1: st.y, x2: gt.x, y2: gt.y, x: at.x, y: at.y }), this.ctx.lastPoint = new c(at.x, at.y);
}, _.prototype.arc = function(x, B, T, H, J, Z) {
if (isNaN(x) || isNaN(B) || isNaN(T) || isNaN(H) || isNaN(J)) throw Le.error("jsPDF.context2d.arc: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.arc");
if (Z = !!Z, !this.ctx.transform.isIdentity) {
var at = this.ctx.transform.applyToPoint(new c(x, B));
x = at.x, B = at.y;
var st = this.ctx.transform.applyToPoint(new c(0, T)), gt = this.ctx.transform.applyToPoint(new c(0, 0));
T = Math.sqrt(Math.pow(st.x - gt.x, 2) + Math.pow(st.y - gt.y, 2));
}
Math.abs(J - H) >= 2 * Math.PI && (H = 0, J = 2 * Math.PI), this.path.push({ type: "arc", x, y: B, radius: T, startAngle: H, endAngle: J, counterclockwise: Z });
}, _.prototype.arcTo = function(x, B, T, H, J) {
throw new Error("arcTo not implemented.");
}, _.prototype.rect = function(x, B, T, H) {
if (isNaN(x) || isNaN(B) || isNaN(T) || isNaN(H)) throw Le.error("jsPDF.context2d.rect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.rect");
this.moveTo(x, B), this.lineTo(x + T, B), this.lineTo(x + T, B + H), this.lineTo(x, B + H), this.lineTo(x, B), this.lineTo(x + T, B), this.lineTo(x, B);
}, _.prototype.fillRect = function(x, B, T, H) {
if (isNaN(x) || isNaN(B) || isNaN(T) || isNaN(H)) throw Le.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(x, B, T, H), this.fill(), J.hasOwnProperty("lineCap") && (this.lineCap = J.lineCap), J.hasOwnProperty("lineJoin") && (this.lineJoin = J.lineJoin);
}
}, _.prototype.strokeRect = function(x, B, T, H) {
if (isNaN(x) || isNaN(B) || isNaN(T) || isNaN(H)) throw Le.error("jsPDF.context2d.strokeRect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.strokeRect");
j.call(this) || (this.beginPath(), this.rect(x, B, T, H), this.stroke());
}, _.prototype.clearRect = function(x, B, T, H) {
if (isNaN(x) || isNaN(B) || isNaN(T) || isNaN(H)) throw Le.error("jsPDF.context2d.clearRect: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.clearRect");
this.ignoreClearRect || (this.fillStyle = "#ffffff", this.fillRect(x, B, T, H));
}, _.prototype.save = function(x) {
x = typeof x != "boolean" || x;
for (var B = this.pdf.internal.getCurrentPageInfo().pageNumber, T = 0; T < this.pdf.internal.getNumberOfPages(); T++) this.pdf.setPage(T + 1), this.pdf.internal.out("q");
if (this.pdf.setPage(B), x) {
this.ctx.fontSize = this.pdf.internal.getFontSize();
var H = new m(this.ctx);
this.ctxStack.push(this.ctx), this.ctx = H;
}
}, _.prototype.restore = function(x) {
x = typeof x != "boolean" || x;
for (var B = this.pdf.internal.getCurrentPageInfo().pageNumber, T = 0; T < this.pdf.internal.getNumberOfPages(); T++) this.pdf.setPage(T + 1), this.pdf.internal.out("Q");
this.pdf.setPage(B), x && 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);
}, _.prototype.toDataURL = function() {
throw new Error("toDataUrl not implemented.");
};
var k = function(x) {
var B, T, H, J;
if (x.isCanvasGradient === !0 && (x = x.getColor()), !x) return { r: 0, g: 0, b: 0, a: 0, style: x };
if (/transparent|rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*0+\s*\)/.test(x)) B = 0, T = 0, H = 0, J = 0;
else {
var Z = /rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(x);
if (Z !== null) B = parseInt(Z[1]), T = parseInt(Z[2]), H = parseInt(Z[3]), J = 1;
else if ((Z = /rgba\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*([\d.]+)\s*\)/.exec(x)) !== null) B = parseInt(Z[1]), T = parseInt(Z[2]), H = parseInt(Z[3]), J = parseFloat(Z[4]);
else {
if (J = 1, typeof x == "string" && x.charAt(0) !== "#") {
var at = new Sf(x);
x = at.ok ? at.toHex() : "#000000";
}
x.length === 4 ? (B = x.substring(1, 2), B += B, T = x.substring(2, 3), T += T, H = x.substring(3, 4), H += H) : (B = x.substring(1, 3), T = x.substring(3, 5), H = x.substring(5, 7)), B = parseInt(B, 16), T = parseInt(T, 16), H = parseInt(H, 16);
}
}
return { r: B, g: T, b: H, a: J, style: x };
}, p = function() {
return this.ctx.isFillTransparent || this.globalAlpha == 0;
}, j = function() {
return !!(this.ctx.isStrokeTransparent || this.globalAlpha == 0);
};
_.prototype.fillText = function(x, B, T, H) {
if (isNaN(B) || isNaN(T) || typeof x != "string") throw Le.error("jsPDF.context2d.fillText: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.fillText");
if (H = isNaN(H) ? void 0 : H, !p.call(this)) {
var J = rt(this.ctx.transform.rotation), Z = this.ctx.transform.scaleX;
F.call(this, { text: x, x: B, y: T, scale: Z, angle: J, align: this.textAlign, maxWidth: H });
}
}, _.prototype.strokeText = function(x, B, T, H) {
if (isNaN(B) || isNaN(T) || typeof x != "string") throw Le.error("jsPDF.context2d.strokeText: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.strokeText");
if (!j.call(this)) {
H = isNaN(H) ? void 0 : H;
var J = rt(this.ctx.transform.rotation), Z = this.ctx.transform.scaleX;
F.call(this, { text: x, x: B, y: T, scale: Z, renderingMode: "stroke", angle: J, align: this.textAlign, maxWidth: H });
}
}, _.prototype.measureText = function(x) {
if (typeof x != "string") throw Le.error("jsPDF.context2d.measureText: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.measureText");
var B = this.pdf, T = this.pdf.internal.scaleFactor, H = B.internal.getFontSize(), J = B.getStringUnitWidth(x) * H / B.internal.scaleFactor;
return new function(Z) {
var at = (Z = Z || {}).width || 0;
return Object.defineProperty(this, "width", { get: function() {
return at;
} }), this;
}({ width: J *= Math.round(96 * T / 72 * 1e4) / 1e4 });
}, _.prototype.scale = function(x, B) {
if (isNaN(x) || isNaN(B)) throw Le.error("jsPDF.context2d.scale: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.scale");
var T = new h(x, 0, 0, B, 0, 0);
this.ctx.transform = this.ctx.transform.multiply(T);
}, _.prototype.rotate = function(x) {
if (isNaN(x)) throw Le.error("jsPDF.context2d.rotate: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.rotate");
var B = new h(Math.cos(x), Math.sin(x), -Math.sin(x), Math.cos(x), 0, 0);
this.ctx.transform = this.ctx.transform.multiply(B);
}, _.prototype.translate = function(x, B) {
if (isNaN(x) || isNaN(B)) throw Le.error("jsPDF.context2d.translate: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.translate");
var T = new h(1, 0, 0, 1, x, B);
this.ctx.transform = this.ctx.transform.multiply(T);
}, _.prototype.transform = function(x, B, T, H, J, Z) {
if (isNaN(x) || isNaN(B) || isNaN(T) || isNaN(H) || isNaN(J) || isNaN(Z)) throw Le.error("jsPDF.context2d.transform: Invalid arguments", arguments), new Error("Invalid arguments passed to jsPDF.context2d.transform");
var at = new h(x, B, T, H, J, Z);
this.ctx.transform = this.ctx.transform.multiply(at);
}, _.prototype.setTransform = function(x, B, T, H, J, Z) {
x = isNaN(x) ? 1 : x, B = isNaN(B) ? 0 : B, T = isNaN(T) ? 0 : T, H = isNaN(H) ? 1 : H, J = isNaN(J) ? 0 : J, Z = isNaN(Z) ? 0 : Z, this.ctx.transform = new h(x, B, T, H, J, Z);
};
var O = function() {
return this.margin[0] > 0 || this.margin[1] > 0 || this.margin[2] > 0 || this.margin[3] > 0;
};
_.prototype.drawImage = function(x, B, T, H, J, Z, at, st, gt) {
var _t = this.pdf.getImageProperties(x), kt = 1, St = 1, Dt = 1, P = 1;
H !== void 0 && st !== void 0 && (Dt = st / H, P = gt / J, kt = _t.width / H * st / H, St = _t.height / J * gt / J), Z === void 0 && (Z = B, at = T, B = 0, T = 0), H !== void 0 && st === void 0 && (st = H, gt = J), H === void 0 && st === void 0 && (st = _t.width, gt = _t.height);
var Lt = this.ctx.transform.decompose(), ae = rt(Lt.rotate.shx), Ht = new h(), yt = (Ht = (Ht = (Ht = Ht.multiply(Lt.translate)).multiply(Lt.skew)).multiply(Lt.scale)).applyToRectangle(new l(Z - B * Dt, at - T * P, H * kt, J * St));
if (this.autoPaging) {
for (var Wt, Ct = M.call(this, yt), zt = [], qt = 0; qt < Ct.length; qt += 1) zt.indexOf(Ct[qt]) === -1 && zt.push(Ct[qt]);
G(zt);
for (var ve = zt[0], ue = zt[zt.length - 1], Zt = ve; Zt < ue + 1; Zt++) {
this.pdf.setPage(Zt);
var he = this.pdf.internal.pageSize.width - this.margin[3] - this.margin[1], fe = Zt === 1 ? this.posY + this.margin[0] : this.margin[0], jt = 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], Tt = Zt === 1 ? 0 : jt + (Zt - 2) * ee;
if (this.ctx.clip_path.length !== 0) {
var De = this.path;
Wt = JSON.parse(JSON.stringify(this.ctx.clip_path)), this.path = V(Wt, this.posX + this.margin[3], -Tt + fe + this.ctx.prevPageLastElemOffset), it.call(this, "fill", !0), this.path = De;
}
var pe = JSON.parse(JSON.stringify(yt));
pe = V([pe], this.posX + this.margin[3], -Tt + fe + this.ctx.prevPageLastElemOffset)[0];
var se = (Zt > ve || Zt < ue) && O.call(this);
se && (this.pdf.saveGraphicsState(), this.pdf.rect(this.margin[3], this.margin[0], he, ee, null).clip().discardPath()), this.pdf.addImage(x, "JPEG", pe.x, pe.y, pe.w, pe.h, null, null, ae), se && this.pdf.restoreGraphicsState();
}
} else this.pdf.addImage(x, "JPEG", yt.x, yt.y, yt.w, yt.h, null, null, ae);
};
var M = function(x, B, T) {
var H = [];
B = B || this.pdf.internal.pageSize.width, T = T || this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2];
var J = this.posY + this.ctx.prevPageLastElemOffset;
switch (x.type) {
default:
case "mt":
case "lt":
H.push(Math.floor((x.y + J) / T) + 1);
break;
case "arc":
H.push(Math.floor((x.y + J - x.radius) / T) + 1), H.push(Math.floor((x.y + J + x.radius) / T) + 1);
break;
case "qct":
var Z = ht(this.ctx.lastPoint.x, this.ctx.lastPoint.y, x.x1, x.y1, x.x, x.y);
H.push(Math.floor((Z.y + J) / T) + 1), H.push(Math.floor((Z.y + Z.h + J) / T) + 1);
break;
case "bct":
var at = At(this.ctx.lastPoint.x, this.ctx.lastPoint.y, x.x1, x.y1, x.x2, x.y2, x.x, x.y);
H.push(Math.floor((at.y + J) / T) + 1), H.push(Math.floor((at.y + at.h + J) / T) + 1);
break;
case "rect":
H.push(Math.floor((x.y + J) / T) + 1), H.push(Math.floor((x.y + x.h + J) / T) + 1);
}
for (var st = 0; st < H.length; st += 1) for (; this.pdf.internal.getNumberOfPages() < H[st]; ) S.call(this);
return H;
}, S = function() {
var x = this.fillStyle, B = this.strokeStyle, T = this.font, H = this.lineCap, J = this.lineWidth, Z = this.lineJoin;
this.pdf.addPage(), this.fillStyle = x, this.strokeStyle = B, this.font = T, this.lineCap = H, this.lineWidth = J, this.lineJoin = Z;
}, V = function(x, B, T) {
for (var H = 0; H < x.length; H++) switch (x[H].type) {
case "bct":
x[H].x2 += B, x[H].y2 += T;
case "qct":
x[H].x1 += B, x[H].y1 += T;
default:
x[H].x += B, x[H].y += T;
}
return x;
}, G = function(x) {
return x.sort(function(B, T) {
return B - T;
});
}, D = function(x, B) {
var T = this.fillStyle, H = this.strokeStyle, J = this.lineCap, Z = this.lineWidth, at = Math.abs(Z * this.ctx.transform.scaleX), st = this.lineJoin;
if (this.autoPaging) {
for (var gt, _t, kt = JSON.parse(JSON.stringify(this.path)), St = JSON.parse(JSON.stringify(this.path)), Dt = [], P = 0; P < St.length; P++) if (St[P].x !== void 0) for (var Lt = M.call(this, St[P]), ae = 0; ae < Lt.length; ae += 1) Dt.indexOf(Lt[ae]) === -1 && Dt.push(Lt[ae]);
for (var Ht = 0; Ht < Dt.length; Ht++) for (; this.pdf.internal.getNumberOfPages() < Dt[Ht]; ) S.call(this);
G(Dt);
for (var yt = Dt[0], Wt = Dt[Dt.length - 1], Ct = yt; Ct < Wt + 1; Ct++) {
this.pdf.setPage(Ct), this.fillStyle = T, this.strokeStyle = H, this.lineCap = J, this.lineWidth = at, this.lineJoin = st;
var zt = this.pdf.internal.pageSize.width - this.margin[3] - this.margin[1], qt = Ct === 1 ? this.posY + this.margin[0] : this.margin[0], ve = this.pdf.internal.pageSize.height - this.posY - this.margin[0] - this.margin[2], ue = this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2], Zt = Ct === 1 ? 0 : ve + (Ct - 2) * ue;
if (this.ctx.clip_path.length !== 0) {
var he = this.path;
gt = JSON.parse(JSON.stringify(this.ctx.clip_path)), this.path = V(gt, this.posX + this.margin[3], -Zt + qt + this.ctx.prevPageLastElemOffset), it.call(this, x, !0), this.path = he;
}
if (_t = JSON.parse(JSON.stringify(kt)), this.path = V(_t, this.posX + this.margin[3], -Zt + qt + this.ctx.prevPageLastElemOffset), B === !1 || Ct === 0) {
var fe = (Ct > yt || Ct < Wt) && O.call(this);
fe && (this.pdf.saveGraphicsState(), this.pdf.rect(this.margin[3], this.margin[0], zt, ue, null).clip().discardPath()), it.call(this, x, B), fe && this.pdf.restoreGraphicsState();
}
this.lineWidth = Z;
}
this.path = kt;
} else this.lineWidth = at, it.call(this, x, B), this.lineWidth = Z;
}, it = function(x, B) {
if ((x !== "stroke" || B || !j.call(this)) && (x === "stroke" || B || !p.call(this))) {
for (var T, H, J = [], Z = this.path, at = 0; at < Z.length; at++) {
var st = Z[at];
switch (st.type) {
case "begin":
J.push({ begin: !0 });
break;
case "close":
J.push({ close: !0 });
break;
case "mt":
J.push({ start: st, deltas: [], abs: [] });
break;
case "lt":
var gt = J.length;
if (Z[at - 1] && !isNaN(Z[at - 1].x) && (T = [st.x - Z[at - 1].x, st.y - Z[at - 1].y], gt > 0)) {
for (; gt >= 0; gt--) if (J[gt - 1].close !== !0 && J[gt - 1].begin !== !0) {
J[gt - 1].deltas.push(T), J[gt - 1].abs.push(st);
break;
}
}
break;
case "bct":
T = [st.x1 - Z[at - 1].x, st.y1 - Z[at - 1].y, st.x2 - Z[at - 1].x, st.y2 - Z[at - 1].y, st.x - Z[at - 1].x, st.y - Z[at - 1].y], J[J.length - 1].deltas.push(T);
break;
case "qct":
var _t = Z[at - 1].x + 2 / 3 * (st.x1 - Z[at - 1].x), kt = Z[at - 1].y + 2 / 3 * (st.y1 - Z[at - 1].y), St = st.x + 2 / 3 * (st.x1 - st.x), Dt = st.y + 2 / 3 * (st.y1 - st.y), P = st.x, Lt = st.y;
T = [_t - Z[at - 1].x, kt - Z[at - 1].y, St - Z[at - 1].x, Dt - Z[at - 1].y, P - Z[at - 1].x, Lt - Z[at - 1].y], J[J.length - 1].deltas.push(T);
break;
case "arc":
J.push({ deltas: [], abs: [], arc: !0 }), Array.isArray(J[J.length - 1].abs) && J[J.length - 1].abs.push(st);
}
}
H = B ? null : x === "stroke" ? "stroke" : "fill";
for (var ae = !1, Ht = 0; Ht < J.length; Ht++) if (J[Ht].arc) for (var yt = J[Ht].abs, Wt = 0; Wt < yt.length; Wt++) {
var Ct = yt[Wt];
Ct.type === "arc" ? K.call(this, Ct.x, Ct.y, Ct.radius, Ct.startAngle, Ct.endAngle, Ct.counterclockwise, void 0, B, !ae) : z.call(this, Ct.x, Ct.y), ae = !0;
}
else if (J[Ht].close === !0) this.pdf.internal.out("h"), ae = !1;
else if (J[Ht].begin !== !0) {
var zt = J[Ht].start.x, qt = J[Ht].start.y;
U.call(this, J[Ht].deltas, zt, qt), ae = !0;
}
H && R.call(this, H), B && tt.call(this);
}
}, mt = function(x) {
var B = this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor, T = B * (this.pdf.internal.getLineHeightFactor() - 1);
switch (this.ctx.textBaseline) {
case "bottom":
return x - T;
case "top":
return x + B - T;
case "hanging":
return x + B - 2 * T;
case "middle":
return x + B / 2 - T;
default:
return x;
}
}, ct = function(x) {
return x + this.pdf.internal.getFontSize() / this.pdf.internal.scaleFactor * (this.pdf.internal.getLineHeightFactor() - 1);
};
_.prototype.createLinearGradient = function() {
var x = function() {
};
return x.colorStops = [], x.addColorStop = function(B, T) {
this.colorStops.push([B, T]);
}, x.getColor = function() {
return this.colorStops.length === 0 ? "#000000" : this.colorStops[0][1];
}, x.isCanvasGradient = !0, x;
}, _.prototype.createPattern = function() {
return this.createLinearGradient();
}, _.prototype.createRadialGradient = function() {
return this.createLinearGradient();
};
var K = function(x, B, T, H, J, Z, at, st, gt) {
for (var _t = ot.call(this, T, H, J, Z), kt = 0; kt < _t.length; kt++) {
var St = _t[kt];
kt === 0 && (gt ? N.call(this, St.x1 + x, St.y1 + B) : z.call(this, St.x1 + x, St.y1 + B)), nt.call(this, x, B, St.x2, St.y2, St.x3, St.y3, St.x4, St.y4);
}
st ? tt.call(this) : R.call(this, at);
}, R = function(x) {
switch (x) {
case "stroke":
this.pdf.internal.out("S");
break;
case "fill":
this.pdf.internal.out("f");
}
}, tt = function() {
this.pdf.clip(), this.pdf.discardPath();
}, N = function(x, B) {
this.pdf.internal.out(e(x) + " " + i(B) + " m");
}, F = function(x) {
var B;
switch (x.align) {
case "right":
case "end":
B = "right";
break;
case "center":
B = "center";
break;
default:
B = "left";
}
var T, H, J, Z = this.pdf.getTextDimensions(x.text), at = mt.call(this, x.y), st = ct.call(this, at) - Z.h, gt = this.ctx.transform.applyToPoint(new c(x.x, at));
if (this.autoPaging) {
var _t = this.ctx.transform.decompose(), kt = new h();
kt = (kt = (kt = kt.multiply(_t.translate)).multiply(_t.skew)).multiply(_t.scale);
for (var St = this.ctx.transform.applyToRectangle(new l(x.x, at, Z.w, Z.h)), Dt = kt.applyToRectangle(new l(x.x, st, Z.w, Z.h)), P = M.call(this, Dt), Lt = [], ae = 0; ae < P.length; ae += 1) Lt.indexOf(P[ae]) === -1 && Lt.push(P[ae]);
G(Lt);
for (var Ht = Lt[0], yt = Lt[Lt.length - 1], Wt = Ht; Wt < yt + 1; Wt++) {
this.pdf.setPage(Wt);
var Ct = Wt === 1 ? this.posY + this.margin[0] : this.margin[0], zt = this.pdf.internal.pageSize.height - this.posY - this.margin[0] - this.margin[2], qt = this.pdf.internal.pageSize.height - this.margin[2], ve = qt - this.margin[0], ue = this.pdf.internal.pageSize.width - this.margin[1], Zt = ue - this.margin[3], he = Wt === 1 ? 0 : zt + (Wt - 2) * ve;
if (this.ctx.clip_path.length !== 0) {
var fe = this.path;
T = JSON.parse(JSON.stringify(this.ctx.clip_path)), this.path = V(T, this.posX + this.margin[3], -1 * he + Ct), it.call(this, "fill", !0), this.path = fe;
}
var jt = V([JSON.parse(JSON.stringify(Dt))], this.posX + this.margin[3], -he + Ct + this.ctx.prevPageLastElemOffset)[0];
x.scale >= 0.01 && (H = this.pdf.internal.getFontSize(), this.pdf.setFontSize(H * x.scale), J = this.lineWidth, this.lineWidth = J * x.scale);
var ee = this.autoPaging !== "text";
if (ee || jt.y + jt.h <= qt) {
if (ee || jt.y >= Ct && jt.x <= ue) {
var Tt = ee ? x.text : this.pdf.splitTextToSize(x.text, x.maxWidth || ue - jt.x)[0], De = V([JSON.parse(JSON.stringify(St))], this.posX + this.margin[3], -he + Ct + this.ctx.prevPageLastElemOffset)[0], pe = ee && (Wt > Ht || Wt < yt) && O.call(this);
pe && (this.pdf.saveGraphicsState(), this.pdf.rect(this.margin[3], this.margin[0], Zt, ve, null).clip().discardPath()), this.pdf.text(Tt, De.x, De.y, { angle: x.angle, align: B, renderingMode: x.renderingMode }), pe && this.pdf.restoreGraphicsState();
}
} else jt.y < qt && (this.ctx.prevPageLastElemOffset += qt - jt.y);
x.scale >= 0.01 && (this.pdf.setFontSize(H), this.lineWidth = J);
}
} else x.scale >= 0.01 && (H = this.pdf.internal.getFontSize(), this.pdf.setFontSize(H * x.scale), J = this.lineWidth, this.lineWidth = J * x.scale), this.pdf.text(x.text, gt.x + this.posX, gt.y + this.posY, { angle: x.angle, align: B, renderingMode: x.renderingMode, maxWidth: x.maxWidth }), x.scale >= 0.01 && (this.pdf.setFontSize(H), this.lineWidth = J);
}, z = function(x, B, T, H) {
T = T || 0, H = H || 0, this.pdf.internal.out(e(x + T) + " " + i(B + H) + " l");
}, U = function(x, B, T) {
return this.pdf.lines(x, B, T, null, null);
}, nt = function(x, B, T, H, J, Z, at, st) {
this.pdf.internal.out([t(o(T + x)), t(a(H + B)), t(o(J + x)), t(a(Z + B)), t(o(at + x)), t(a(st + B)), "c"].join(" "));
}, ot = function(x, B, T, H) {
for (var J = 2 * Math.PI, Z = Math.PI / 2; B > T; ) B -= J;
var at = Math.abs(T - B);
at < J && H && (at = J - at);
for (var st = [], gt = H ? -1 : 1, _t = B; at > 1e-5; ) {
var kt = _t + gt * Math.min(at, Z);
st.push(ut.call(this, x, _t, kt)), at -= Math.abs(kt - _t), _t = kt;
}
return st;
}, ut = function(x, B, T) {
var H = (T - B) / 2, J = x * Math.cos(H), Z = x * Math.sin(H), at = J, st = -Z, gt = at * at + st * st, _t = gt + at * J + st * Z, kt = 4 / 3 * (Math.sqrt(2 * gt * _t) - _t) / (at * Z - st * J), St = at - kt * st, Dt = st + kt * at, P = St, Lt = -Dt, ae = H + B, Ht = Math.cos(ae), yt = Math.sin(ae);
return { x1: x * Math.cos(B), y1: x * Math.sin(B), x2: St * Ht - Dt * yt, y2: St * yt + Dt * Ht, x3: P * Ht - Lt * yt, y3: P * yt + Lt * Ht, x4: x * Math.cos(T), y4: x * Math.sin(T) };
}, rt = function(x) {
return 180 * x / Math.PI;
}, ht = function(x, B, T, H, J, Z) {
var at = x + 0.5 * (T - x), st = B + 0.5 * (H - B), gt = J + 0.5 * (T - J), _t = Z + 0.5 * (H - Z), kt = Math.min(x, J, at, gt), St = Math.max(x, J, at, gt), Dt = Math.min(B, Z, st, _t), P = Math.max(B, Z, st, _t);
return new l(kt, Dt, St - kt, P - Dt);
}, At = function(x, B, T, H, J, Z, at, st) {
var gt, _t, kt, St, Dt, P, Lt, ae, Ht, yt, Wt, Ct, zt, qt, ve = T - x, ue = H - B, Zt = J - T, he = Z - H, fe = at - J, jt = st - Z;
for (_t = 0; _t < 41; _t++) Ht = (Lt = (kt = x + (gt = _t / 40) * ve) + gt * ((Dt = T + gt * Zt) - kt)) + gt * (Dt + gt * (J + gt * fe - Dt) - Lt), yt = (ae = (St = B + gt * ue) + gt * ((P = H + gt * he) - St)) + gt * (P + gt * (Z + gt * jt - P) - ae), _t == 0 ? (Wt = Ht, Ct = yt, zt = Ht, qt = yt) : (Wt = Math.min(Wt, Ht), Ct = Math.min(Ct, yt), zt = Math.max(zt, Ht), qt = Math.max(qt, yt));
return new l(Math.round(Wt), Math.round(Ct), Math.round(zt - Wt), Math.round(qt - Ct));
}, wt = function() {
if (this.prevLineDash || this.ctx.lineDash.length || this.ctx.lineDashOffset) {
var x, B, T = (x = this.ctx.lineDash, B = this.ctx.lineDashOffset, JSON.stringify({ lineDash: x, lineDashOffset: B }));
this.prevLineDash !== T && (this.pdf.setLineDash(this.ctx.lineDash, this.ctx.lineDashOffset), this.prevLineDash = T);
}
};
})(Mt.API), /**
* @license
* jsPDF filters PlugIn
* Copyright (c) 2014 Aras Abbasi
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
(function(r) {
var t = function(c) {
var l, h, d, m, _, k, p, j, O, M;
for (h = [], d = 0, m = (c += l = "\0\0\0\0".slice(c.length % 4 || 4)).length; m > d; d += 4) (_ = (c.charCodeAt(d) << 24) + (c.charCodeAt(d + 1) << 16) + (c.charCodeAt(d + 2) << 8) + c.charCodeAt(d + 3)) !== 0 ? (k = (_ = ((_ = ((_ = ((_ = (_ - (M = _ % 85)) / 85) - (O = _ % 85)) / 85) - (j = _ % 85)) / 85) - (p = _ % 85)) / 85) % 85, h.push(k + 33, p + 33, j + 33, O + 33, M + 33)) : h.push(122);
return (function(S, V) {
for (var G = V; G > 0; G--) S.pop();
})(h, l.length), String.fromCharCode.apply(String, h) + "~>";
}, e = function(c) {
var l, h, d, m, _, k = String, p = "length", j = 255, O = "charCodeAt", M = "slice", S = "replace";
for (c[M](-2), c = c[M](0, -2)[S](/\s/g, "")[S]("z", "!!!!!"), d = [], m = 0, _ = (c += l = "uuuuu"[M](c[p] % 5 || 5))[p]; _ > m; m += 5) h = 52200625 * (c[O](m) - 33) + 614125 * (c[O](m + 1) - 33) + 7225 * (c[O](m + 2) - 33) + 85 * (c[O](m + 3) - 33) + (c[O](m + 4) - 33), d.push(j & h >> 24, j & h >> 16, j & h >> 8, j & h);
return (function(V, G) {
for (var D = G; D > 0; D--) V.pop();
})(d, l[p]), k.fromCharCode.apply(k, d);
}, i = function(c) {
return c.split("").map(function(l) {
return ("0" + l.charCodeAt().toString(16)).slice(-2);
}).join("") + ">";
}, o = function(c) {
var l = new RegExp(/^([0-9A-Fa-f]{2})+$/);
if ((c = c.replace(/\s/g, "")).indexOf(">") !== -1 && (c = c.substr(0, c.indexOf(">"))), c.length % 2 && (c += "0"), l.test(c) === !1) return "";
for (var h = "", d = 0; d < c.length; d += 2) h += String.fromCharCode("0x" + (c[d] + c[d + 1]));
return h;
}, a = function(c) {
for (var l = new Uint8Array(c.length), h = c.length; h--; ) l[h] = c.charCodeAt(h);
return (l = To(l)).reduce(function(d, m) {
return d + String.fromCharCode(m);
}, "");
};
r.processDataByFilters = function(c, l) {
var h = 0, d = c || "", m = [];
for (typeof (l = l || []) == "string" && (l = [l]), h = 0; h < l.length; h += 1) switch (l[h]) {
case "ASCII85Decode":
case "/ASCII85Decode":
d = e(d), m.push("/ASCII85Encode");
break;
case "ASCII85Encode":
case "/ASCII85Encode":
d = t(d), m.push("/ASCII85Decode");
break;
case "ASCIIHexDecode":
case "/ASCIIHexDecode":
d = o(d), m.push("/ASCIIHexEncode");
break;
case "ASCIIHexEncode":
case "/ASCIIHexEncode":
d = i(d), m.push("/ASCIIHexDecode");
break;
case "FlateEncode":
case "/FlateEncode":
d = a(d), m.push("/FlateDecode");
break;
default:
throw new Error('The filter: "' + l[h] + '" is not implemented');
}
return { data: d, reverseChain: m.reverse().join(" ") };
};
})(Mt.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(t, e, i) {
return (function(o, a, c) {
a = a !== !1, c = typeof c == "function" ? c : function() {
};
var l = void 0;
try {
l = (function(h, d, m) {
var _ = new XMLHttpRequest(), k = 0, p = function(j) {
var O = j.length, M = [], S = String.fromCharCode;
for (k = 0; k < O; k += 1) M.push(S(255 & j.charCodeAt(k)));
return M.join("");
};
if (_.open("GET", h, !d), _.overrideMimeType("text/plain; charset=x-user-defined"), d === !1 && (_.onload = function() {
_.status === 200 ? m(p(this.responseText)) : m(void 0);
}), _.send(null), d && _.status === 200) return p(_.responseText);
})(o, a, c);
} catch {
}
return l;
})(t, e, i);
}, r.loadImageFile = r.loadFile;
})(Mt.API), (function(r) {
function t() {
return (Jt.html2canvas ? Promise.resolve(Jt.html2canvas) : import("./html2canvas.esm-BWVIUcAF.js")).catch(function(l) {
return Promise.reject(new Error("Could not load html2canvas: " + l));
}).then(function(l) {
return l.default ? l.default : l;
});
}
function e() {
return (Jt.DOMPurify ? Promise.resolve(Jt.DOMPurify) : import("./purify.es-DIxY135m.js")).catch(function(l) {
return Promise.reject(new Error("Could not load dompurify: " + l));
}).then(function(l) {
return l.default ? l.default : l;
});
}
var i = function(l) {
var h = _e(l);
return h === "undefined" ? "undefined" : h === "string" || l instanceof String ? "string" : h === "number" || l instanceof Number ? "number" : h === "function" || l instanceof Function ? "function" : l && l.constructor === Array ? "array" : l && l.nodeType === 1 ? "element" : h === "object" ? "object" : "unknown";
}, o = function(l, h) {
var d = document.createElement(l);
for (var m in h.className && (d.className = h.className), h.innerHTML && h.dompurify && (d.innerHTML = h.dompurify.sanitize(h.innerHTML)), h.style) d.style[m] = h.style[m];
return d;
}, a = function l(h, d) {
for (var m = h.nodeType === 3 ? document.createTextNode(h.nodeValue) : h.cloneNode(!1), _ = h.firstChild; _; _ = _.nextSibling) d !== !0 && _.nodeType === 1 && _.nodeName === "SCRIPT" || m.appendChild(l(_, d));
return h.nodeType === 1 && (h.nodeName === "CANVAS" ? (m.width = h.width, m.height = h.height, m.getContext("2d").drawImage(h, 0, 0)) : h.nodeName !== "TEXTAREA" && h.nodeName !== "SELECT" || (m.value = h.value), m.addEventListener("load", function() {
m.scrollTop = h.scrollTop, m.scrollLeft = h.scrollLeft;
}, !0)), m;
}, c = function l(h) {
var d = Object.assign(l.convert(Promise.resolve()), JSON.parse(JSON.stringify(l.template))), m = l.convert(Promise.resolve(), d);
return (m = m.setProgress(1, l, 1, [l])).set(h);
};
(c.prototype = Object.create(Promise.prototype)).constructor = c, c.convert = function(l, h) {
return l.__proto__ = h || c.prototype, l;
}, c.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" } }, c.prototype.from = function(l, h) {
return this.then(function() {
switch (h = h || (function(d) {
switch (i(d)) {
case "string":
return "string";
case "element":
return d.nodeName.toLowerCase() === "canvas" ? "canvas" : "element";
default:
return "unknown";
}
})(l), h) {
case "string":
return this.then(e).then(function(d) {
return this.set({ src: o("div", { innerHTML: l, dompurify: d }) });
});
case "element":
return this.set({ src: l });
case "canvas":
return this.set({ canvas: l });
case "img":
return this.set({ img: l });
default:
return this.error("Unknown source type.");
}
});
}, c.prototype.to = function(l) {
switch (l) {
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.");
}
}, c.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 l = { 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 }, h = a(this.prop.src, this.opt.html2canvas.javascriptEnabled);
h.tagName === "BODY" && (l.height = Math.max(document.body.scrollHeight, document.body.offsetHeight, document.documentElement.clientHeight, document.documentElement.scrollHeight, document.documentElement.offsetHeight) + "px"), this.prop.overlay = o("div", { className: "html2pdf__overlay", style: { position: "fixed", overflow: "hidden", zIndex: 1e3, left: "-100000px", right: 0, bottom: 0, top: 0 } }), this.prop.container = o("div", { className: "html2pdf__container", style: l }), this.prop.container.appendChild(h), this.prop.container.firstChild.appendChild(o("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";
});
}, c.prototype.toCanvas = function() {
var l = [function() {
return document.body.contains(this.prop.container) || this.toContainer();
}];
return this.thenList(l).then(t).then(function(h) {
var d = Object.assign({}, this.opt.html2canvas);
return delete d.onrendered, h(this.prop.container, d);
}).then(function(h) {
(this.opt.html2canvas.onrendered || function() {
})(h), this.prop.canvas = h, document.body.removeChild(this.prop.overlay);
});
}, c.prototype.toContext2d = function() {
var l = [function() {
return document.body.contains(this.prop.container) || this.toContainer();
}];
return this.thenList(l).then(t).then(function(h) {
var d = this.opt.jsPDF, m = this.opt.fontFaces, _ = 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, k = Object.assign({ async: !0, allowTaint: !0, scale: _, 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 k.onrendered, d.context2d.autoPaging = this.opt.autoPaging === void 0 || this.opt.autoPaging, d.context2d.posX = this.opt.x, d.context2d.posY = this.opt.y, d.context2d.margin = this.opt.margin, d.context2d.fontFaces = m, m) for (var p = 0; p < m.length; ++p) {
var j = m[p], O = j.src.find(function(M) {
return M.format === "truetype";
});
O && d.addFont(O.url, j.ref.name, j.ref.style);
}
return k.windowHeight = k.windowHeight || 0, k.windowHeight = k.windowHeight == 0 ? Math.max(this.prop.container.clientHeight, this.prop.container.scrollHeight, this.prop.container.offsetHeight) : k.windowHeight, d.context2d.save(!0), h(this.prop.container, k);
}).then(function(h) {
this.opt.jsPDF.context2d.restore(!0), (this.opt.html2canvas.onrendered || function() {
})(h), this.prop.canvas = h, document.body.removeChild(this.prop.overlay);
});
}, c.prototype.toImg = function() {
return this.thenList([function() {
return this.prop.canvas || this.toCanvas();
}]).then(function() {
var l = this.prop.canvas.toDataURL("image/" + this.opt.image.type, this.opt.image.quality);
this.prop.img = document.createElement("img"), this.prop.img.src = l;
});
}, c.prototype.toPdf = function() {
return this.thenList([function() {
return this.toContext2d();
}]).then(function() {
this.prop.pdf = this.prop.pdf || this.opt.jsPDF;
});
}, c.prototype.output = function(l, h, d) {
return (d = d || "pdf").toLowerCase() === "img" || d.toLowerCase() === "image" ? this.outputImg(l, h) : this.outputPdf(l, h);
}, c.prototype.outputPdf = function(l, h) {
return this.thenList([function() {
return this.prop.pdf || this.toPdf();
}]).then(function() {
return this.prop.pdf.output(l, h);
});
}, c.prototype.outputImg = function(l) {
return this.thenList([function() {
return this.prop.img || this.toImg();
}]).then(function() {
switch (l) {
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 "' + l + '" is not supported.';
}
});
}, c.prototype.save = function(l) {
return this.thenList([function() {
return this.prop.pdf || this.toPdf();
}]).set(l ? { filename: l } : null).then(function() {
this.prop.pdf.save(this.opt.filename);
});
}, c.prototype.doCallback = function() {
return this.thenList([function() {
return this.prop.pdf || this.toPdf();
}]).then(function() {
this.prop.callback(this.prop.pdf);
});
}, c.prototype.set = function(l) {
if (i(l) !== "object") return this;
var h = Object.keys(l || {}).map(function(d) {
if (d in c.template.prop) return function() {
this.prop[d] = l[d];
};
switch (d) {
case "margin":
return this.setMargin.bind(this, l.margin);
case "jsPDF":
return function() {
return this.opt.jsPDF = l.jsPDF, this.setPageSize();
};
case "pageSize":
return this.setPageSize.bind(this, l.pageSize);
default:
return function() {
this.opt[d] = l[d];
};
}
}, this);
return this.then(function() {
return this.thenList(h);
});
}, c.prototype.get = function(l, h) {
return this.then(function() {
var d = l in c.template.prop ? this.prop[l] : this.opt[l];
return h ? h(d) : d;
});
}, c.prototype.setMargin = function(l) {
return this.then(function() {
switch (i(l)) {
case "number":
l = [l, l, l, l];
case "array":
if (l.length === 2 && (l = [l[0], l[1], l[0], l[1]]), l.length === 4) break;
default:
return this.error("Invalid margin array.");
}
this.opt.margin = l;
}).then(this.setPageSize);
}, c.prototype.setPageSize = function(l) {
function h(d, m) {
return Math.floor(d * m / 72 * 96);
}
return this.then(function() {
(l = l || Mt.getPageSize(this.opt.jsPDF)).hasOwnProperty("inner") || (l.inner = { width: l.width - this.opt.margin[1] - this.opt.margin[3], height: l.height - this.opt.margin[0] - this.opt.margin[2] }, l.inner.px = { width: h(l.inner.width, l.k), height: h(l.inner.height, l.k) }, l.inner.ratio = l.inner.height / l.inner.width), this.prop.pageSize = l;
});
}, c.prototype.setProgress = function(l, h, d, m) {
return l != null && (this.progress.val = l), h != null && (this.progress.state = h), d != null && (this.progress.n = d), m != null && (this.progress.stack = m), this.progress.ratio = this.progress.val / this.progress.state, this;
}, c.prototype.updateProgress = function(l, h, d, m) {
return this.setProgress(l ? this.progress.val + l : null, h || null, d ? this.progress.n + d : null, m ? this.progress.stack.concat(m) : null);
}, c.prototype.then = function(l, h) {
var d = this;
return this.thenCore(l, h, function(m, _) {
return d.updateProgress(null, null, 1, [m]), Promise.prototype.then.call(this, function(k) {
return d.updateProgress(null, m), k;
}).then(m, _).then(function(k) {
return d.updateProgress(1), k;
});
});
}, c.prototype.thenCore = function(l, h, d) {
d = d || Promise.prototype.then;
var m = this;
l && (l = l.bind(m)), h && (h = h.bind(m));
var _ = Promise.toString().indexOf("[native code]") !== -1 && Promise.name === "Promise" ? m : c.convert(Object.assign({}, m), Promise.prototype), k = d.call(_, l, h);
return c.convert(k, m.__proto__);
}, c.prototype.thenExternal = function(l, h) {
return Promise.prototype.then.call(this, l, h);
}, c.prototype.thenList = function(l) {
var h = this;
return l.forEach(function(d) {
h = h.thenCore(d);
}), h;
}, c.prototype.catch = function(l) {
l && (l = l.bind(this));
var h = Promise.prototype.catch.call(this, l);
return c.convert(h, this);
}, c.prototype.catchExternal = function(l) {
return Promise.prototype.catch.call(this, l);
}, c.prototype.error = function(l) {
return this.then(function() {
throw new Error(l);
});
}, c.prototype.using = c.prototype.set, c.prototype.saveAs = c.prototype.save, c.prototype.export = c.prototype.output, c.prototype.run = c.prototype.then, Mt.getPageSize = function(l, h, d) {
if (_e(l) === "object") {
var m = l;
l = m.orientation, h = m.unit || h, d = m.format || d;
}
h = h || "mm", d = d || "a4", l = ("" + (l || "P")).toLowerCase();
var _, k = ("" + d).toLowerCase(), p = { 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 (h) {
case "pt":
_ = 1;
break;
case "mm":
_ = 72 / 25.4;
break;
case "cm":
_ = 72 / 2.54;
break;
case "in":
_ = 72;
break;
case "px":
_ = 0.75;
break;
case "pc":
case "em":
_ = 12;
break;
case "ex":
_ = 6;
break;
default:
throw "Invalid unit: " + h;
}
var j, O = 0, M = 0;
if (p.hasOwnProperty(k)) O = p[k][1] / _, M = p[k][0] / _;
else try {
O = d[1], M = d[0];
} catch {
throw new Error("Invalid format: " + d);
}
if (l === "p" || l === "portrait") l = "p", M > O && (j = M, M = O, O = j);
else {
if (l !== "l" && l !== "landscape") throw "Invalid orientation: " + l;
l = "l", O > M && (j = M, M = O, O = j);
}
return { width: M, height: O, unit: h, k: _, orientation: l };
}, r.html = function(l, h) {
(h = h || {}).callback = h.callback || function() {
}, h.html2canvas = h.html2canvas || {}, h.html2canvas.canvas = h.html2canvas.canvas || this.canvas, h.jsPDF = h.jsPDF || this, h.fontFaces = h.fontFaces ? h.fontFaces.map(Fo) : null;
var d = new c(h);
return h.worker ? d : d.from(l).doCallback();
};
})(Mt.API), Mt.API.addJS = function(r) {
return ju = 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"), Ou = this.internal.newObject(), this.internal.out("<<"), this.internal.out("/S /JavaScript"), this.internal.out("/JS (" + ju + ")"), this.internal.out(">>"), this.internal.out("endobj");
}), this.internal.events.subscribe("putCatalog", function() {
Ss !== void 0 && Ou !== 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 t;
r.events.push(["postPutResources", function() {
var e = this, i = /^(\d+) 0 obj$/;
if (this.outline.root.children.length > 0) for (var o = e.outline.render().split(/\r\n/), a = 0; a < o.length; a++) {
var c = o[a], l = i.exec(c);
if (l != null) {
var h = l[1];
e.internal.newObjectDeferredBegin(h, !1);
}
e.internal.write(c);
}
if (this.outline.createNamedDestinations) {
var d = this.internal.pages.length, m = [];
for (a = 0; a < d; a++) {
var _ = e.internal.newObject();
m.push(_);
var k = e.internal.getPageInfo(a + 1);
e.internal.write("<< /D[" + k.objId + " 0 R /XYZ null null null]>> endobj");
}
var p = e.internal.newObject();
for (e.internal.write("<< /Names [ "), a = 0; a < m.length; a++) e.internal.write("(page_" + (a + 1) + ")" + m[a] + " 0 R");
e.internal.write(" ] >>", "endobj"), t = e.internal.newObject(), e.internal.write("<< /Dests " + p + " 0 R"), e.internal.write(">>", "endobj");
}
}]), r.events.push(["putCatalog", function() {
var e = this;
e.outline.root.children.length > 0 && (e.internal.write("/Outlines", this.outline.makeRef(this.outline.root)), this.outline.createNamedDestinations && e.internal.write("/Names " + t + " 0 R"));
}]), r.events.push(["initialized", function() {
var e = this;
e.outline = { createNamedDestinations: !1, root: { children: [] } }, e.outline.add = function(i, o, a) {
var c = { title: o, options: a, children: [] };
return i == null && (i = this.root), i.children.push(c), c;
}, e.outline.render = function() {
return this.ctx = {}, this.ctx.val = "", this.ctx.pdf = e, this.genIds_r(this.root), this.renderRoot(this.root), this.renderItems(this.root), this.ctx.val;
}, e.outline.genIds_r = function(i) {
i.id = e.internal.newObjectDeferred();
for (var o = 0; o < i.children.length; o++) this.genIds_r(i.children[o]);
}, e.outline.renderRoot = function(i) {
this.objStart(i), this.line("/Type /Outlines"), i.children.length > 0 && (this.line("/First " + this.makeRef(i.children[0])), this.line("/Last " + this.makeRef(i.children[i.children.length - 1]))), this.line("/Count " + this.count_r({ count: 0 }, i)), this.objEnd();
}, e.outline.renderItems = function(i) {
for (var o = this.ctx.pdf.internal.getVerticalCoordinateString, a = 0; a < i.children.length; a++) {
var c = i.children[a];
this.objStart(c), this.line("/Title " + this.makeString(c.title)), this.line("/Parent " + this.makeRef(i)), a > 0 && this.line("/Prev " + this.makeRef(i.children[a - 1])), a < i.children.length - 1 && this.line("/Next " + this.makeRef(i.children[a + 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 l = this.count = this.count_r({ count: 0 }, c);
if (l > 0 && this.line("/Count " + l), c.options && c.options.pageNumber) {
var h = e.internal.getPageInfo(c.options.pageNumber);
this.line("/Dest [" + h.objId + " 0 R /XYZ 0 " + o(0) + " 0]");
}
this.objEnd();
}
for (var d = 0; d < i.children.length; d++) this.renderItems(i.children[d]);
}, e.outline.line = function(i) {
this.ctx.val += i + `\r
`;
}, e.outline.makeRef = function(i) {
return i.id + " 0 R";
}, e.outline.makeString = function(i) {
return "(" + e.internal.pdfEscape(i) + ")";
}, e.outline.objStart = function(i) {
this.ctx.val += `\r
` + i.id + ` 0 obj\r
<<\r
`;
}, e.outline.objEnd = function() {
this.ctx.val += `>> \r
endobj\r
`;
}, e.outline.count_r = function(i, o) {
for (var a = 0; a < o.children.length; a++) i.count++, this.count_r(i, o.children[a]);
return i.count;
};
}]);
})(Mt.API), /**
* @license
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
(function(r) {
var t = [192, 193, 194, 195, 196, 197, 198, 199];
r.processJPEG = function(e, i, o, a, c, l) {
var h, d = this.decode.DCT_DECODE, m = null;
if (typeof e == "string" || this.__addimage__.isArrayBuffer(e) || this.__addimage__.isArrayBufferView(e)) {
switch (e = c || e, e = this.__addimage__.isArrayBuffer(e) ? new Uint8Array(e) : e, h = (function(_) {
for (var k, p = 256 * _.charCodeAt(4) + _.charCodeAt(5), j = _.length, O = { width: 0, height: 0, numcomponents: 1 }, M = 4; M < j; M += 2) {
if (M += p, t.indexOf(_.charCodeAt(M + 1)) !== -1) {
k = 256 * _.charCodeAt(M + 5) + _.charCodeAt(M + 6), O = { width: 256 * _.charCodeAt(M + 7) + _.charCodeAt(M + 8), height: k, numcomponents: _.charCodeAt(M + 9) };
break;
}
p = 256 * _.charCodeAt(M + 2) + _.charCodeAt(M + 3);
}
return O;
})(e = this.__addimage__.isArrayBufferView(e) ? this.__addimage__.arrayBufferToBinaryString(e) : e), h.numcomponents) {
case 1:
l = this.color_spaces.DEVICE_GRAY;
break;
case 4:
l = this.color_spaces.DEVICE_CMYK;
break;
case 3:
l = this.color_spaces.DEVICE_RGB;
}
m = { data: e, width: h.width, height: h.height, colorSpace: l, bitsPerComponent: 8, filter: d, index: i, alias: o };
}
return m;
};
})(Mt.API), Mt.API.processPNG = function(r, t, e, i) {
if (this.__addimage__.isArrayBuffer(r) && (r = new Uint8Array(r)), this.__addimage__.isArrayBufferView(r)) {
var o, a = k1(r, { checkCrc: !0 }), c = a.width, l = a.height, h = a.channels, d = a.palette, m = a.depth;
o = d && h === 1 ? (function(K) {
for (var R = K.width, tt = K.height, N = K.data, F = K.palette, z = K.depth, U = !1, nt = [], ot = [], ut = void 0, rt = !1, ht = 0, At = 0; At < F.length; At++) {
var wt = Dl(F[At], 4), x = wt[0], B = wt[1], T = wt[2], H = wt[3];
nt.push(x, B, T), H != null && (H === 0 ? (ht++, ot.length < 1 && ot.push(At)) : H < 255 && (rt = !0));
}
if (rt || ht > 1) {
U = !0, ot = void 0;
var J = R * tt;
ut = new Uint8Array(J);
for (var Z = new DataView(N.buffer), at = 0; at < J; at++) {
var st = Oo(Z, at, z), gt = Dl(F[st], 4)[3];
ut[at] = gt;
}
} else ht === 0 && (ot = void 0);
return { colorSpace: "Indexed", colorsPerPixel: 1, sMaskBitsPerComponent: U ? 8 : void 0, colorBytes: N, alphaBytes: ut, needSMask: U, palette: nt, mask: ot };
})(a) : h === 2 || h === 4 ? (function(K) {
for (var R = K.data, tt = K.width, N = K.height, F = K.channels, z = K.depth, U = F === 2 ? "DeviceGray" : "DeviceRGB", nt = F - 1, ot = tt * N, ut = nt, rt = ot * ut, ht = 1 * ot, At = Math.ceil(rt * z / 8), wt = Math.ceil(ht * z / 8), x = new Uint8Array(At), B = new Uint8Array(wt), T = new DataView(R.buffer), H = new DataView(x.buffer), J = new DataView(B.buffer), Z = !1, at = 0; at < ot; at++) {
for (var st = at * F, gt = 0; gt < ut; gt++) Hu(H, Oo(T, st + gt, z), at * ut + gt, z);
var _t = Oo(T, st + ut, z);
_t < (1 << z) - 1 && (Z = !0), Hu(J, _t, 1 * at, z);
}
return { colorSpace: U, colorsPerPixel: nt, sMaskBitsPerComponent: Z ? z : void 0, colorBytes: x, alphaBytes: B, needSMask: Z };
})(a) : (function(K) {
var R = K.data, tt = K.channels === 1 ? "DeviceGray" : "DeviceRGB";
return { colorSpace: tt, colorsPerPixel: tt === "DeviceGray" ? 1 : 3, colorBytes: R instanceof Uint16Array ? (function(N) {
for (var F = N.length, z = new Uint8Array(2 * F), U = new DataView(z.buffer, z.byteOffset, z.byteLength), nt = 0; nt < F; nt++) U.setUint16(2 * nt, N[nt], !1);
return z;
})(R) : R, needSMask: !1 };
})(a);
var _, k, p, j = o, O = j.colorSpace, M = j.colorsPerPixel, S = j.sMaskBitsPerComponent, V = j.colorBytes, G = j.alphaBytes, D = j.needSMask, it = j.palette, mt = j.mask, ct = null;
return i !== Mt.API.image_compression.NONE && typeof To == "function" ? (ct = (function(K) {
var R;
switch (K) {
case Mt.API.image_compression.FAST:
R = 11;
break;
case Mt.API.image_compression.MEDIUM:
R = 13;
break;
case Mt.API.image_compression.SLOW:
R = 14;
break;
default:
R = 12;
}
return R;
})(i), _ = this.decode.FLATE_DECODE, k = "/Predictor ".concat(ct, " /Colors ").concat(M, " /BitsPerComponent ").concat(m, " /Columns ").concat(c), r = Tu(V, Math.ceil(c * M * m / 8), M, m, i), D && (p = Tu(G, Math.ceil(c * S / 8), 1, S, i))) : (_ = void 0, k = void 0, r = V, D && (p = G)), (this.__addimage__.isArrayBuffer(r) || this.__addimage__.isArrayBufferView(r)) && (r = this.__addimage__.arrayBufferToBinaryString(r)), (p && this.__addimage__.isArrayBuffer(p) || this.__addimage__.isArrayBufferView(p)) && (p = this.__addimage__.arrayBufferToBinaryString(p)), { alias: e, data: r, index: t, filter: _, decodeParameters: k, transparency: mt, palette: it, sMask: p, predictor: ct, width: c, height: l, bitsPerComponent: m, sMaskBitsPerComponent: S, colorSpace: O };
}
}, (function(r) {
r.processGIF89A = function(t, e, i, o) {
var a = new K1(t), c = a.width, l = a.height, h = [];
a.decodeAndBlitFrameRGBA(0, h);
var d = { data: h, width: c, height: l }, m = new jo(100).encode(d, 100);
return r.processJPEG.call(this, m, e, i, o);
}, r.processGIF87A = r.processGIF89A;
})(Mt.API), $r.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 t = 0; t < r; t++) {
var e = this.datav.getUint8(this.pos++, !0), i = this.datav.getUint8(this.pos++, !0), o = this.datav.getUint8(this.pos++, !0), a = this.datav.getUint8(this.pos++, !0);
this.palette[t] = { red: o, green: i, blue: e, quad: a };
}
}
this.height < 0 && (this.height *= -1, this.bottom_up = !1);
}, $r.prototype.parseBGR = function() {
this.pos = this.offset;
try {
var r = "bit" + this.bitPP, t = this.width * this.height * 4;
this.data = new Uint8Array(t), this[r]();
} catch (e) {
Le.log("bit decode error:" + e);
}
}, $r.prototype.bit1 = function() {
var r, t = Math.ceil(this.width / 8), e = t % 4;
for (r = this.height - 1; r >= 0; r--) {
for (var i = this.bottom_up ? r : this.height - 1 - r, o = 0; o < t; o++) for (var a = this.datav.getUint8(this.pos++, !0), c = i * this.width * 4 + 8 * o * 4, l = 0; l < 8 && 8 * o + l < this.width; l++) {
var h = this.palette[a >> 7 - l & 1];
this.data[c + 4 * l] = h.blue, this.data[c + 4 * l + 1] = h.green, this.data[c + 4 * l + 2] = h.red, this.data[c + 4 * l + 3] = 255;
}
e !== 0 && (this.pos += 4 - e);
}
}, $r.prototype.bit4 = function() {
for (var r = Math.ceil(this.width / 2), t = r % 4, e = this.height - 1; e >= 0; e--) {
for (var i = this.bottom_up ? e : this.height - 1 - e, o = 0; o < r; o++) {
var a = this.datav.getUint8(this.pos++, !0), c = i * this.width * 4 + 2 * o * 4, l = a >> 4, h = 15 & a, d = this.palette[l];
if (this.data[c] = d.blue, this.data[c + 1] = d.green, this.data[c + 2] = d.red, this.data[c + 3] = 255, 2 * o + 1 >= this.width) break;
d = this.palette[h], this.data[c + 4] = d.blue, this.data[c + 4 + 1] = d.green, this.data[c + 4 + 2] = d.red, this.data[c + 4 + 3] = 255;
}
t !== 0 && (this.pos += 4 - t);
}
}, $r.prototype.bit8 = function() {
for (var r = this.width % 4, t = this.height - 1; t >= 0; t--) {
for (var e = this.bottom_up ? t : this.height - 1 - t, i = 0; i < this.width; i++) {
var o = this.datav.getUint8(this.pos++, !0), a = e * this.width * 4 + 4 * i;
if (o < this.palette.length) {
var c = this.palette[o];
this.data[a] = c.red, this.data[a + 1] = c.green, this.data[a + 2] = c.blue, this.data[a + 3] = 255;
} else this.data[a] = 255, this.data[a + 1] = 255, this.data[a + 2] = 255, this.data[a + 3] = 255;
}
r !== 0 && (this.pos += 4 - r);
}
}, $r.prototype.bit15 = function() {
for (var r = this.width % 3, t = parseInt("11111", 2), e = this.height - 1; e >= 0; e--) {
for (var i = this.bottom_up ? e : this.height - 1 - e, o = 0; o < this.width; o++) {
var a = this.datav.getUint16(this.pos, !0);
this.pos += 2;
var c = (a & t) / t * 255 | 0, l = (a >> 5 & t) / t * 255 | 0, h = (a >> 10 & t) / t * 255 | 0, d = a >> 15 ? 255 : 0, m = i * this.width * 4 + 4 * o;
this.data[m] = h, this.data[m + 1] = l, this.data[m + 2] = c, this.data[m + 3] = d;
}
this.pos += r;
}
}, $r.prototype.bit16 = function() {
for (var r = this.width % 3, t = parseInt("11111", 2), e = parseInt("111111", 2), i = this.height - 1; i >= 0; i--) {
for (var o = this.bottom_up ? i : this.height - 1 - i, a = 0; a < this.width; a++) {
var c = this.datav.getUint16(this.pos, !0);
this.pos += 2;
var l = (c & t) / t * 255 | 0, h = (c >> 5 & e) / e * 255 | 0, d = (c >> 11) / t * 255 | 0, m = o * this.width * 4 + 4 * a;
this.data[m] = d, this.data[m + 1] = h, this.data[m + 2] = l, this.data[m + 3] = 255;
}
this.pos += r;
}
}, $r.prototype.bit24 = function() {
for (var r = this.height - 1; r >= 0; r--) {
for (var t = this.bottom_up ? r : this.height - 1 - r, e = 0; e < this.width; e++) {
var i = this.datav.getUint8(this.pos++, !0), o = this.datav.getUint8(this.pos++, !0), a = this.datav.getUint8(this.pos++, !0), c = t * this.width * 4 + 4 * e;
this.data[c] = a, this.data[c + 1] = o, this.data[c + 2] = i, this.data[c + 3] = 255;
}
this.pos += this.width % 4;
}
}, $r.prototype.bit32 = function() {
for (var r = this.height - 1; r >= 0; r--) for (var t = this.bottom_up ? r : this.height - 1 - r, e = 0; e < this.width; e++) {
var i = this.datav.getUint8(this.pos++, !0), o = this.datav.getUint8(this.pos++, !0), a = this.datav.getUint8(this.pos++, !0), c = this.datav.getUint8(this.pos++, !0), l = t * this.width * 4 + 4 * e;
this.data[l] = a, this.data[l + 1] = o, this.data[l + 2] = i, this.data[l + 3] = c;
}
}, $r.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(t, e, i, o) {
var a = new $r(t, !1), c = a.width, l = a.height, h = { data: a.getData(), width: c, height: l }, d = new jo(100).encode(h, 100);
return r.processJPEG.call(this, d, e, i, o);
};
})(Mt.API), Vu.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(t, e, i, o) {
var a = new Vu(t), c = a.width, l = a.height, h = { data: a.getData(), width: c, height: l }, d = new jo(100).encode(h, 100);
return r.processJPEG.call(this, d, e, i, o);
};
})(Mt.API), Mt.API.processRGBA = function(r, t, e) {
for (var i = r.data, o = i.length, a = new Uint8Array(o / 4 * 3), c = new Uint8Array(o / 4), l = 0, h = 0, d = 0; d < o; d += 4) {
var m = i[d], _ = i[d + 1], k = i[d + 2], p = i[d + 3];
a[l++] = m, a[l++] = _, a[l++] = k, c[h++] = p;
}
var j = this.__addimage__.arrayBufferToBinaryString(a);
return { alpha: this.__addimage__.arrayBufferToBinaryString(c), data: j, index: t, alias: e, colorSpace: "DeviceRGB", bitsPerComponent: 8, width: r.width, height: r.height };
}, Mt.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;
}, Yi = Mt.API, ks = Yi.getCharWidthsArray = function(r, t) {
var e, i, o = (t = t || {}).font || this.internal.getFont(), a = t.fontSize || this.internal.getFontSize(), c = t.charSpace || this.internal.getCharSpace(), l = t.widths ? t.widths : o.metadata.Unicode.widths, h = l.fof ? l.fof : 1, d = t.kerning ? t.kerning : o.metadata.Unicode.kerning, m = d.fof ? d.fof : 1, _ = t.doKerning !== !1, k = 0, p = r.length, j = 0, O = l[0] || h, M = [];
for (e = 0; e < p; e++) i = r.charCodeAt(e), typeof o.metadata.widthOfString == "function" ? M.push((o.metadata.widthOfGlyph(o.metadata.characterToGlyph(i)) + c * (1e3 / a) || 0) / 1e3) : (k = _ && _e(d[i]) === "object" && !isNaN(parseInt(d[i][j], 10)) ? d[i][j] / m : 0, M.push((l[i] || O) / h + k)), j = i;
return M;
}, Bu = Yi.getStringUnitWidth = function(r, t) {
var e = (t = t || {}).fontSize || this.internal.getFontSize(), i = t.font || this.internal.getFont(), o = t.charSpace || this.internal.getCharSpace();
return Yi.processArabic && (r = Yi.processArabic(r)), typeof i.metadata.widthOfString == "function" ? i.metadata.widthOfString(r, e, o) / e : ks.apply(this, arguments).reduce(function(a, c) {
return a + c;
}, 0);
}, Mu = function(r, t, e, i) {
for (var o = [], a = 0, c = r.length, l = 0; a !== c && l + t[a] < e; ) l += t[a], a++;
o.push(r.slice(0, a));
var h = a;
for (l = 0; a !== c; ) l + t[a] > i && (o.push(r.slice(h, a)), l = 0, h = a), l += t[a], a++;
return h !== a && o.push(r.slice(h, a)), o;
}, Ru = function(r, t, e) {
e || (e = {});
var i, o, a, c, l, h, d, m = [], _ = [m], k = e.textIndent || 0, p = 0, j = 0, O = r.split(" "), M = ks.apply(this, [" ", e])[0];
if (h = e.lineIndent === -1 ? O[0].length + 2 : e.lineIndent || 0) {
var S = Array(h).join(" "), V = [];
O.map(function(D) {
(D = D.split(/\s*\n/)).length > 1 ? V = V.concat(D.map(function(it, mt) {
return (mt && it.length ? `
` : "") + it;
})) : V.push(D[0]);
}), O = V, h = Bu.apply(this, [S, e]);
}
for (a = 0, c = O.length; a < c; a++) {
var G = 0;
if (i = O[a], h && i[0] == `
` && (i = i.substr(1), G = 1), k + p + (j = (o = ks.apply(this, [i, e])).reduce(function(D, it) {
return D + it;
}, 0)) > t || G) {
if (j > t) {
for (l = Mu.apply(this, [i, o, t - (k + p), t]), m.push(l.shift()), m = [l.pop()]; l.length; ) _.push([l.shift()]);
j = o.slice(i.length - (m[0] ? m[0].length : 0)).reduce(function(D, it) {
return D + it;
}, 0);
} else m = [i];
_.push(m), k = j + h, p = M;
} else m.push(i), k += p + j, p = M;
}
return d = h ? function(D, it) {
return (it ? S : "") + D.join(" ");
} : function(D) {
return D.join(" ");
}, _.map(d);
}, Yi.splitTextToSize = function(r, t, e) {
var i, o = (e = e || {}).fontSize || this.internal.getFontSize(), a = function(m) {
if (m.widths && m.kerning) return { widths: m.widths, kerning: m.kerning };
var _ = this.internal.getFont(m.fontName, m.fontStyle), k = "Unicode";
return _.metadata[k] ? { widths: _.metadata[k].widths || { 0: 1 }, kerning: _.metadata[k].kerning || {} } : { font: _.metadata, fontSize: this.internal.getFontSize(), charSpace: this.internal.getCharSpace() };
}.call(this, e);
i = Array.isArray(r) ? r : String(r).split(/\r?\n/);
var c = 1 * this.internal.scaleFactor * t / o;
a.textIndent = e.textIndent ? 1 * e.textIndent * this.internal.scaleFactor / o : 0, a.lineIndent = e.lineIndent;
var l, h, d = [];
for (l = 0, h = i.length; l < h; l++) d = d.concat(Ru.apply(this, [i[l], c, a]));
return d;
}, (function(r) {
r.__fontmetrics__ = r.__fontmetrics__ || {};
for (var t = "0123456789abcdef", e = "klmnopqrstuvwxyz", i = {}, o = {}, a = 0; a < 16; a++) i[e[a]] = t[a], o[t[a]] = e[a];
var c = function(k) {
return "0x" + parseInt(k, 10).toString(16);
}, l = r.__fontmetrics__.compress = function(k) {
var p, j, O, M, S = ["{"];
for (var V in k) {
if (p = k[V], isNaN(parseInt(V, 10)) ? j = "'" + V + "'" : (V = parseInt(V, 10), j = (j = c(V).slice(2)).slice(0, -1) + o[j.slice(-1)]), typeof p == "number") p < 0 ? (O = c(p).slice(3), M = "-") : (O = c(p).slice(2), M = ""), O = M + O.slice(0, -1) + o[O.slice(-1)];
else {
if (_e(p) !== "object") throw new Error("Don't know what to do with value type " + _e(p) + ".");
O = l(p);
}
S.push(j + O);
}
return S.push("}"), S.join("");
}, h = r.__fontmetrics__.uncompress = function(k) {
if (typeof k != "string") throw new Error("Invalid argument passed to uncompress.");
for (var p, j, O, M, S = {}, V = 1, G = S, D = [], it = "", mt = "", ct = k.length - 1, K = 1; K < ct; K += 1) (M = k[K]) == "'" ? p ? (O = p.join(""), p = void 0) : p = [] : p ? p.push(M) : M == "{" ? (D.push([G, O]), G = {}, O = void 0) : M == "}" ? ((j = D.pop())[0][j[1]] = G, O = void 0, G = j[0]) : M == "-" ? V = -1 : O === void 0 ? i.hasOwnProperty(M) ? (it += i[M], O = parseInt(it, 16) * V, V = 1, it = "") : it += M : i.hasOwnProperty(M) ? (mt += i[M], G[O] = parseInt(mt, 16) * V, V = 1, O = void 0, mt = "") : mt += M;
return S;
}, d = { codePages: ["WinAnsiEncoding"], WinAnsiEncoding: h("{19m8n201n9q201o9r201s9l201t9m201u8m201w9n201x9o201y8o202k8q202l8r202m9p202q8p20aw8k203k8t203t8v203u9v2cq8s212m9t15m8w15n9w2dw9s16k8u16l9u17s9z17x8y17y9y}") }, m = { Unicode: { Courier: d, "Courier-Bold": d, "Courier-BoldOblique": d, "Courier-Oblique": d, Helvetica: d, "Helvetica-Bold": d, "Helvetica-BoldOblique": d, "Helvetica-Oblique": d, "Times-Roman": d, "Times-Bold": d, "Times-BoldItalic": d, "Times-Italic": d } }, _ = { Unicode: { "Courier-Oblique": h("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-BoldItalic": h("{'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": h("{'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: h("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Courier-BoldOblique": h("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-Bold": h("{'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: h("{'widths'{k3uaw4r19m3m2k1t2l2l202m2y2n3m2p5n202q6o3k3m2s2l2t2l2v3r2w1t3m3m2y1t2z1wbk2sbl3r'fof'6o3n3m3o3m3p3m3q3m3r3m3s3m3t3m3u1w3v1w3w3r3x3r3y3r3z2wbp3t3l3m5v2l5x2l5z3m2q4yfr3r7v3k7w1o7x3k}'kerning'{'fof'-6o}}"), Helvetica: h("{'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": h("{'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: h("{'widths'{k4u2k1w'fof'6o}'kerning'{'fof'-6o}}"), "Courier-Bold": h("{'widths'{k3w'fof'6o}'kerning'{'fof'-6o}}"), "Times-Italic": h("{'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": h("{'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": h("{'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(k) {
var p = k.font, j = _.Unicode[p.postScriptName];
j && (p.metadata.Unicode = {}, p.metadata.Unicode.widths = j.widths, p.metadata.Unicode.kerning = j.kerning);
var O = m.Unicode[p.postScriptName];
O && (p.metadata.Unicode.encoding = O, p.encoding = O.codePages[0]);
}]);
})(Mt.API), /**
* @license
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
(function(r) {
var t = function(e) {
for (var i = e.length, o = new Uint8Array(i), a = 0; a < i; a++) o[a] = e.charCodeAt(a);
return o;
};
r.API.events.push(["addFont", function(e) {
var i = void 0, o = e.font, a = e.instance;
if (!o.isStandardFont) {
if (a === void 0) throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('" + o.postScriptName + "').");
if (typeof (i = a.existsFileInVFS(o.postScriptName) === !1 ? a.loadFile(o.postScriptName) : a.getFileFromVFS(o.postScriptName)) != "string") throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('" + o.postScriptName + "').");
(function(c, l) {
l = /^\x00\x01\x00\x00/.test(l) ? t(l) : t(Is(l)), c.metadata = r.API.TTFFont.open(l), c.metadata.Unicode = c.metadata.Unicode || { encoding: {}, kerning: {}, widths: [] }, c.metadata.glyIdsUsed = [0];
})(o, i);
}
}]);
})(Mt), Mt.API.addSvgAsImage = function(r, t, e, i, o, a, c, l) {
if (isNaN(t) || isNaN(e)) throw Le.error("jsPDF.addSvgAsImage: Invalid coordinates", arguments), new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");
if (isNaN(i) || isNaN(o)) throw Le.error("jsPDF.addSvgAsImage: Invalid measurements", arguments), new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");
var h = document.createElement("canvas");
h.width = i, h.height = o;
var d = h.getContext("2d");
d.fillStyle = "#fff", d.fillRect(0, 0, h.width, h.height);
var m = { ignoreMouse: !0, ignoreAnimation: !0, ignoreDimensions: !0 }, _ = this;
return (Jt.canvg ? Promise.resolve(Jt.canvg) : import("./index.es-BOh-5h9R.js")).catch(function(k) {
return Promise.reject(new Error("Could not load canvg: " + k));
}).then(function(k) {
return k.default ? k.default : k;
}).then(function(k) {
return k.fromString(d, r, m);
}, function() {
return Promise.reject(new Error("Could not load canvg."));
}).then(function(k) {
return k.render(m);
}).then(function() {
_.addImage(h.toDataURL("image/jpeg", 1), t, e, i, o, c, l);
});
}, Mt.API.putTotalPages = function(r) {
var t, e = 0;
parseInt(this.internal.getFont().id.substr(1), 10) < 15 ? (t = new RegExp(r, "g"), e = this.internal.getNumberOfPages()) : (t = new RegExp(this.pdfEscape16(r, this.internal.getFont()), "g"), e = this.pdfEscape16(this.internal.getNumberOfPages() + "", this.internal.getFont()));
for (var i = 1; i <= this.internal.getNumberOfPages(); i++) for (var o = 0; o < this.internal.pages[i].length; o++) this.internal.pages[i][o] = this.internal.pages[i][o].replace(t, e);
return this;
}, Mt.API.viewerPreferences = function(r, t) {
var e;
r = r || {}, t = t || !1;
var i, o, a, 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 } }, l = Object.keys(c), h = [], d = 0, m = 0, _ = 0;
function k(j, O) {
var M, S = !1;
for (M = 0; M < j.length; M += 1) j[M] === O && (S = !0);
return S;
}
if (this.internal.viewerpreferences === void 0 && (this.internal.viewerpreferences = {}, this.internal.viewerpreferences.configuration = JSON.parse(JSON.stringify(c)), this.internal.viewerpreferences.isSubscribed = !1), e = this.internal.viewerpreferences.configuration, r === "reset" || t === !0) {
var p = l.length;
for (_ = 0; _ < p; _ += 1) e[l[_]].value = e[l[_]].defaultValue, e[l[_]].explicitSet = !1;
}
if (_e(r) === "object") {
for (o in r) if (a = r[o], k(l, o) && a !== void 0) {
if (e[o].type === "boolean" && typeof a == "boolean") e[o].value = a;
else if (e[o].type === "name" && k(e[o].valueSet, a)) e[o].value = a;
else if (e[o].type === "integer" && Number.isInteger(a)) e[o].value = a;
else if (e[o].type === "array") {
for (d = 0; d < a.length; d += 1) if (i = !0, a[d].length === 1 && typeof a[d][0] == "number") h.push(String(a[d] - 1));
else if (a[d].length > 1) {
for (m = 0; m < a[d].length; m += 1) typeof a[d][m] != "number" && (i = !1);
i === !0 && h.push([a[d][0] - 1, a[d][1] - 1].join(" "));
}
e[o].value = "[" + h.join(" ") + "]";
} else e[o].value = e[o].defaultValue;
e[o].explicitSet = !0;
}
}
return this.internal.viewerpreferences.isSubscribed === !1 && (this.internal.events.subscribe("putCatalog", function() {
var j, O = [];
for (j in e) e[j].explicitSet === !0 && (e[j].type === "name" ? O.push("/" + j + " /" + e[j].value) : O.push("/" + j + " " + e[j].value));
O.length !== 0 && this.internal.write(`/ViewerPreferences
<<
` + O.join(`
`) + `
>>`);
}), this.internal.viewerpreferences.isSubscribed = !0), this.internal.viewerpreferences.configuration = e, 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 t = function() {
var i = '<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>', o = unescape(encodeURIComponent('<x:xmpmeta xmlns:x="adobe:ns:meta/">')), a = unescape(encodeURIComponent(i)), c = unescape(encodeURIComponent(this.internal.__metadata__.metadata)), l = unescape(encodeURIComponent("</jspdf:metadata></rdf:Description></rdf:RDF>")), h = unescape(encodeURIComponent("</x:xmpmeta>")), d = a.length + c.length + l.length + o.length + h.length;
this.internal.__metadata__.metadata_object_number = this.internal.newObject(), this.internal.write("<< /Type /Metadata /Subtype /XML /Length " + d + " >>"), this.internal.write("stream"), this.internal.write(o + a + c + l + h), this.internal.write("endstream"), this.internal.write("endobj");
}, e = function() {
this.internal.__metadata__.metadata_object_number && this.internal.write("/Metadata " + this.internal.__metadata__.metadata_object_number + " 0 R");
};
r.addMetadata = function(i, o) {
return this.internal.__metadata__ === void 0 && (this.internal.__metadata__ = { metadata: i, namespaceuri: o || "http://jspdf.default.namespaceuri/" }, this.internal.events.subscribe("putCatalog", e), this.internal.events.subscribe("postPutResources", t)), this;
};
})(Mt.API), (function(r) {
var t = r.API, e = t.pdfEscape16 = function(a, c) {
for (var l, h = c.metadata.Unicode.widths, d = ["", "0", "00", "000", "0000"], m = [""], _ = 0, k = a.length; _ < k; ++_) {
if (l = c.metadata.characterToGlyph(a.charCodeAt(_)), c.metadata.glyIdsUsed.push(l), c.metadata.toUnicode[l] = a.charCodeAt(_), h.indexOf(l) == -1 && (h.push(l), h.push([parseInt(c.metadata.widthOfGlyph(l), 10)])), l == "0") return m.join("");
l = l.toString(16), m.push(d[4 - l.length], l);
}
return m.join("");
}, i = function(a) {
var c, l, h, d, m, _, k;
for (m = `/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 = [], _ = 0, k = (l = Object.keys(a).sort(function(p, j) {
return p - j;
})).length; _ < k; _++) c = l[_], h.length >= 100 && (m += `
` + h.length + ` beginbfchar
` + h.join(`
`) + `
endbfchar`, h = []), a[c] !== void 0 && a[c] !== null && typeof a[c].toString == "function" && (d = ("0000" + a[c].toString(16)).slice(-4), c = ("0000" + (+c).toString(16)).slice(-4), h.push("<" + c + "><" + d + ">"));
return h.length && (m += `
` + h.length + ` beginbfchar
` + h.join(`
`) + `
endbfchar
`), m + `endcmap
CMapName currentdict /CMap defineresource pop
end
end`;
};
t.events.push(["putFont", function(a) {
(function(c) {
var l = c.font, h = c.out, d = c.newObject, m = c.putStream;
if (l.metadata instanceof r.API.TTFFont && l.encoding === "Identity-H") {
for (var _ = l.metadata.Unicode.widths, k = l.metadata.subset.encode(l.metadata.glyIdsUsed, 1), p = "", j = 0; j < k.length; j++) p += String.fromCharCode(k[j]);
var O = d();
m({ data: p, addLength1: !0, objectId: O }), h("endobj");
var M = d();
m({ data: i(l.metadata.toUnicode), addLength1: !0, objectId: M }), h("endobj");
var S = d();
h("<<"), h("/Type /FontDescriptor"), h("/FontName /" + Ki(l.fontName)), h("/FontFile2 " + O + " 0 R"), h("/FontBBox " + r.API.PDFObject.convert(l.metadata.bbox)), h("/Flags " + l.metadata.flags), h("/StemV " + l.metadata.stemV), h("/ItalicAngle " + l.metadata.italicAngle), h("/Ascent " + l.metadata.ascender), h("/Descent " + l.metadata.decender), h("/CapHeight " + l.metadata.capHeight), h(">>"), h("endobj");
var V = d();
h("<<"), h("/Type /Font"), h("/BaseFont /" + Ki(l.fontName)), h("/FontDescriptor " + S + " 0 R"), h("/W " + r.API.PDFObject.convert(_)), h("/CIDToGIDMap /Identity"), h("/DW 1000"), h("/Subtype /CIDFontType2"), h("/CIDSystemInfo"), h("<<"), h("/Supplement 0"), h("/Registry (Adobe)"), h("/Ordering (" + l.encoding + ")"), h(">>"), h(">>"), h("endobj"), l.objectNumber = d(), h("<<"), h("/Type /Font"), h("/Subtype /Type0"), h("/ToUnicode " + M + " 0 R"), h("/BaseFont /" + Ki(l.fontName)), h("/Encoding /" + l.encoding), h("/DescendantFonts [" + V + " 0 R]"), h(">>"), h("endobj"), l.isAlreadyPutted = !0;
}
})(a);
}]), t.events.push(["putFont", function(a) {
(function(c) {
var l = c.font, h = c.out, d = c.newObject, m = c.putStream;
if (l.metadata instanceof r.API.TTFFont && l.encoding === "WinAnsiEncoding") {
for (var _ = l.metadata.rawData, k = "", p = 0; p < _.length; p++) k += String.fromCharCode(_[p]);
var j = d();
m({ data: k, addLength1: !0, objectId: j }), h("endobj");
var O = d();
m({ data: i(l.metadata.toUnicode), addLength1: !0, objectId: O }), h("endobj");
var M = d();
h("<<"), h("/Descent " + l.metadata.decender), h("/CapHeight " + l.metadata.capHeight), h("/StemV " + l.metadata.stemV), h("/Type /FontDescriptor"), h("/FontFile2 " + j + " 0 R"), h("/Flags 96"), h("/FontBBox " + r.API.PDFObject.convert(l.metadata.bbox)), h("/FontName /" + Ki(l.fontName)), h("/ItalicAngle " + l.metadata.italicAngle), h("/Ascent " + l.metadata.ascender), h(">>"), h("endobj"), l.objectNumber = d();
for (var S = 0; S < l.metadata.hmtx.widths.length; S++) l.metadata.hmtx.widths[S] = parseInt(l.metadata.hmtx.widths[S] * (1e3 / l.metadata.head.unitsPerEm));
h("<</Subtype/TrueType/Type/Font/ToUnicode " + O + " 0 R/BaseFont/" + Ki(l.fontName) + "/FontDescriptor " + M + " 0 R/Encoding/" + l.encoding + " /FirstChar 29 /LastChar 255 /Widths " + r.API.PDFObject.convert(l.metadata.hmtx.widths) + ">>"), h("endobj"), l.isAlreadyPutted = !0;
}
})(a);
}]);
var o = function(a) {
var c, l = a.text || "", h = a.x, d = a.y, m = a.options || {}, _ = a.mutex || {}, k = _.pdfEscape, p = _.activeFontKey, j = _.fonts, O = p, M = "", S = 0, V = "", G = j[O].encoding;
if (j[O].encoding !== "Identity-H") return { text: l, x: h, y: d, options: m, mutex: _ };
for (V = l, O = p, Array.isArray(l) && (V = l[0]), S = 0; S < V.length; S += 1) j[O].metadata.hasOwnProperty("cmap") && (c = j[O].metadata.cmap.unicode.codeMap[V[S].charCodeAt(0)]), c || V[S].charCodeAt(0) < 256 && j[O].metadata.hasOwnProperty("Unicode") ? M += V[S] : M += "";
var D = "";
return parseInt(O.slice(1)) < 14 || G === "WinAnsiEncoding" ? D = k(M, O).split("").map(function(it) {
return it.charCodeAt(0).toString(16);
}).join("") : G === "Identity-H" && (D = e(M, j[O])), _.isHex = !0, { text: D, x: h, y: d, options: m, mutex: _ };
};
t.events.push(["postProcessText", function(a) {
var c = a.text || "", l = [], h = { text: c, x: a.x, y: a.y, options: a.options, mutex: a.mutex };
if (Array.isArray(c)) {
var d = 0;
for (d = 0; d < c.length; d += 1) Array.isArray(c[d]) && c[d].length === 3 ? l.push([o(Object.assign({}, h, { text: c[d][0] })).text, c[d][1], c[d][2]]) : l.push(o(Object.assign({}, h, { text: c[d] })).text);
a.text = l;
} else a.text = o(Object.assign({}, h, { text: c })).text;
}]);
})(Mt), /**
* @license
* jsPDF virtual FileSystem functionality
*
* Licensed under the MIT License.
* http://opensource.org/licenses/mit-license
*/
(function(r) {
var t = function() {
return this.internal.vFS === void 0 && (this.internal.vFS = {}), !0;
};
r.existsFileInVFS = function(e) {
return t.call(this), this.internal.vFS[e] !== void 0;
}, r.addFileToVFS = function(e, i) {
return t.call(this), this.internal.vFS[e] = i, this;
}, r.getFileFromVFS = function(e) {
return t.call(this), this.internal.vFS[e] !== void 0 ? this.internal.vFS[e] : null;
};
})(Mt.API), /**
* @license
* Unicode Bidi Engine based on the work of Alex Shensis (@asthensis)
* MIT License
*/
(function(r) {
r.__bidiEngine__ = r.prototype.__bidiEngine__ = function(i) {
var o, a, c, l, h, d, m, _ = t, k = [[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]], j = { L: 0, R: 1, EN: 2, AN: 3, N: 4, B: 5, S: 6 }, O = { 0: 0, 5: 1, 6: 2, 7: 3, 32: 4, 251: 5, 254: 6, 255: 7 }, M = ["(", ")", "(", "<", ">", "<", "[", "]", "[", "{", "}", "{", "«", "»", "«", "‹", "›", "‹", "⁅", "⁆", "⁅", "⁽", "⁾", "⁽", "₍", "₎", "₍", "≤", "≥", "≤", "〈", "〉", "〈", "﹙", "﹚", "﹙", "﹛", "﹜", "﹛", "﹝", "﹞", "﹝", "﹤", "﹥", "﹤"], S = 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)$/), V = !1, G = 0;
this.__bidiEngine__ = {};
var D = function(N) {
var F = N.charCodeAt(), z = F >> 8, U = O[z];
return U !== void 0 ? _[256 * U + (255 & F)] : z === 252 || z === 253 ? "AL" : S.test(z) ? "L" : z === 8 ? "R" : "N";
}, it = function(N) {
for (var F, z = 0; z < N.length; z++) {
if ((F = D(N.charAt(z))) === "L") return !1;
if (F === "R") return !0;
}
return !1;
}, mt = function(N, F, z, U) {
var nt, ot, ut, rt, ht = F[U];
switch (ht) {
case "L":
case "R":
case "LRE":
case "RLE":
case "LRO":
case "RLO":
case "PDF":
V = !1;
break;
case "N":
case "AN":
break;
case "EN":
V && (ht = "AN");
break;
case "AL":
V = !0, ht = "R";
break;
case "WS":
case "BN":
ht = "N";
break;
case "CS":
U < 1 || U + 1 >= F.length || (nt = z[U - 1]) !== "EN" && nt !== "AN" || (ot = F[U + 1]) !== "EN" && ot !== "AN" ? ht = "N" : V && (ot = "AN"), ht = ot === nt ? ot : "N";
break;
case "ES":
ht = (nt = U > 0 ? z[U - 1] : "B") === "EN" && U + 1 < F.length && F[U + 1] === "EN" ? "EN" : "N";
break;
case "ET":
if (U > 0 && z[U - 1] === "EN") {
ht = "EN";
break;
}
if (V) {
ht = "N";
break;
}
for (ut = U + 1, rt = F.length; ut < rt && F[ut] === "ET"; ) ut++;
ht = ut < rt && F[ut] === "EN" ? "EN" : "N";
break;
case "NSM":
if (c && !l) {
for (rt = F.length, ut = U + 1; ut < rt && F[ut] === "NSM"; ) ut++;
if (ut < rt) {
var At = N[U], wt = At >= 1425 && At <= 2303 || At === 64286;
if (nt = F[ut], wt && (nt === "R" || nt === "AL")) {
ht = "R";
break;
}
}
}
ht = U < 1 || (nt = F[U - 1]) === "B" ? "N" : z[U - 1];
break;
case "B":
V = !1, o = !0, ht = G;
break;
case "S":
a = !0, ht = "N";
}
return ht;
}, ct = function(N, F, z) {
var U = N.split("");
return z && K(U, z, { hiLevel: G }), U.reverse(), F && F.reverse(), U.join("");
}, K = function(N, F, z) {
var U, nt, ot, ut, rt, ht = -1, At = N.length, wt = 0, x = [], B = G ? p : k, T = [];
for (V = !1, o = !1, a = !1, nt = 0; nt < At; nt++) T[nt] = D(N[nt]);
for (ot = 0; ot < At; ot++) {
if (rt = wt, x[ot] = mt(N, T, x, ot), U = 240 & (wt = B[rt][j[x[ot]]]), wt &= 15, F[ot] = ut = B[wt][5], U > 0) if (U === 16) {
for (nt = ht; nt < ot; nt++) F[nt] = 1;
ht = -1;
} else ht = -1;
if (B[wt][6]) ht === -1 && (ht = ot);
else if (ht > -1) {
for (nt = ht; nt < ot; nt++) F[nt] = ut;
ht = -1;
}
T[ot] === "B" && (F[ot] = 0), z.hiLevel |= ut;
}
a && (function(H, J, Z) {
for (var at = 0; at < Z; at++) if (H[at] === "S") {
J[at] = G;
for (var st = at - 1; st >= 0 && H[st] === "WS"; st--) J[st] = G;
}
})(T, F, At);
}, R = function(N, F, z, U, nt) {
if (!(nt.hiLevel < N)) {
if (N === 1 && G === 1 && !o) return F.reverse(), void (z && z.reverse());
for (var ot, ut, rt, ht, At = F.length, wt = 0; wt < At; ) {
if (U[wt] >= N) {
for (rt = wt + 1; rt < At && U[rt] >= N; ) rt++;
for (ht = wt, ut = rt - 1; ht < ut; ht++, ut--) ot = F[ht], F[ht] = F[ut], F[ut] = ot, z && (ot = z[ht], z[ht] = z[ut], z[ut] = ot);
wt = rt;
}
wt++;
}
}
}, tt = function(N, F, z) {
var U = N.split(""), nt = { hiLevel: G };
return z || (z = []), K(U, z, nt), (function(ot, ut, rt) {
if (rt.hiLevel !== 0 && m) for (var ht, At = 0; At < ot.length; At++) ut[At] === 1 && (ht = M.indexOf(ot[At])) >= 0 && (ot[At] = M[ht + 1]);
})(U, z, nt), R(2, U, F, z, nt), R(1, U, F, z, nt), U.join("");
};
return this.__bidiEngine__.doBidiReorder = function(N, F, z) {
if ((function(nt, ot) {
if (ot) for (var ut = 0; ut < nt.length; ut++) ot[ut] = ut;
l === void 0 && (l = it(nt)), d === void 0 && (d = it(nt));
})(N, F), c || !h || d) if (c && h && l ^ d) G = l ? 1 : 0, N = ct(N, F, z);
else if (!c && h && d) G = l ? 1 : 0, N = tt(N, F, z), N = ct(N, F);
else if (!c || l || h || d) {
if (c && !h && l ^ d) N = ct(N, F), l ? (G = 0, N = tt(N, F, z)) : (G = 1, N = tt(N, F, z), N = ct(N, F));
else if (c && l && !h && d) G = 1, N = tt(N, F, z), N = ct(N, F);
else if (!c && !h && l ^ d) {
var U = m;
l ? (G = 1, N = tt(N, F, z), G = 0, m = !1, N = tt(N, F, z), m = U) : (G = 0, N = tt(N, F, z), N = ct(N, F), G = 1, m = !1, N = tt(N, F, z), m = U, N = ct(N, F));
}
} else G = 0, N = tt(N, F, z);
else G = l ? 1 : 0, N = tt(N, F, z);
return N;
}, this.__bidiEngine__.setOptions = function(N) {
N && (c = N.isInputVisual, h = N.isOutputVisual, l = N.isInputRtl, d = N.isOutputRtl, m = N.isSymmetricSwapping);
}, this.__bidiEngine__.setOptions(i), this.__bidiEngine__;
};
var t = ["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"], e = new r.__bidiEngine__({ isInputVisual: !0 });
r.API.events.push(["postProcessText", function(i) {
var o = i.text;
i.x, i.y;
var a = i.options || {};
i.mutex, a.lang;
var c = [];
if (a.isInputVisual = typeof a.isInputVisual != "boolean" || a.isInputVisual, e.setOptions(a), Object.prototype.toString.call(o) === "[object Array]") {
var l = 0;
for (c = [], l = 0; l < o.length; l += 1) Object.prototype.toString.call(o[l]) === "[object Array]" ? c.push([e.doBidiReorder(o[l][0]), o[l][1], o[l][2]]) : c.push([e.doBidiReorder(o[l])]);
i.text = c;
} else i.text = e.doBidiReorder(o);
e.setOptions({ isInputVisual: !0 });
}]);
})(Mt), Mt.API.TTFFont = (function() {
function r(t) {
var e;
if (this.rawData = t, e = this.contents = new ni(t), this.contents.pos = 4, e.readString(4) === "ttcf") throw new Error("TTCF not supported.");
e.pos = 0, this.parse(), this.subset = new f2(this), this.registerTTF();
}
return r.open = function(t) {
return new r(t);
}, r.prototype.parse = function() {
return this.directory = new X1(this.contents), this.head = new Z1(this), this.name = new n2(this), this.cmap = new Rf(this), this.toUnicode = {}, this.hhea = new Q1(this), this.maxp = new i2(this), this.hmtx = new a2(this), this.post = new e2(this), this.os2 = new t2(this), this.loca = new u2(this), this.glyf = new s2(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 t, e, i, o, a;
if (this.scaleFactor = 1e3 / this.head.unitsPerEm, this.bbox = function() {
var c, l, h, d;
for (d = [], c = 0, l = (h = this.bbox).length; c < l; c++) t = h[c], d.push(Math.round(t * this.scaleFactor));
return d;
}.call(this), this.stemV = 0, this.post.exists ? (i = 255 & (o = this.post.italic_angle), 32768 & (e = o >> 16) && (e = -(1 + (65535 ^ e))), this.italicAngle = +(e + "." + i)) : 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 = (a = this.familyClass) === 1 || a === 2 || a === 3 || a === 4 || a === 5 || a === 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(t) {
var e;
return ((e = this.cmap.unicode) != null ? e.codeMap[t] : void 0) || 0;
}, r.prototype.widthOfGlyph = function(t) {
var e;
return e = 1e3 / this.head.unitsPerEm, this.hmtx.forGlyph(t).advance * e;
}, r.prototype.widthOfString = function(t, e, i) {
var o, a, c, l;
for (c = 0, a = 0, l = (t = "" + t).length; 0 <= l ? a < l : a > l; a = 0 <= l ? ++a : --a) o = t.charCodeAt(a), c += this.widthOfGlyph(this.characterToGlyph(o)) + i * (1e3 / e) || 0;
return c * (e / 1e3);
}, r.prototype.lineHeight = function(t, e) {
var i;
return e == null && (e = !1), i = e ? this.lineGap : 0, (this.ascender + i - this.decender) / 1e3 * t;
}, r;
})();
var tn, ni = (function() {
function r(t) {
this.data = t ?? [], this.pos = 0, this.length = this.data.length;
}
return r.prototype.readByte = function() {
return this.data[this.pos++];
}, r.prototype.writeByte = function(t) {
return this.data[this.pos++] = t;
}, r.prototype.readUInt32 = function() {
return 16777216 * this.readByte() + (this.readByte() << 16) + (this.readByte() << 8) + this.readByte();
}, r.prototype.writeUInt32 = function(t) {
return this.writeByte(t >>> 24 & 255), this.writeByte(t >> 16 & 255), this.writeByte(t >> 8 & 255), this.writeByte(255 & t);
}, r.prototype.readInt32 = function() {
var t;
return (t = this.readUInt32()) >= 2147483648 ? t - 4294967296 : t;
}, r.prototype.writeInt32 = function(t) {
return t < 0 && (t += 4294967296), this.writeUInt32(t);
}, r.prototype.readUInt16 = function() {
return this.readByte() << 8 | this.readByte();
}, r.prototype.writeUInt16 = function(t) {
return this.writeByte(t >> 8 & 255), this.writeByte(255 & t);
}, r.prototype.readInt16 = function() {
var t;
return (t = this.readUInt16()) >= 32768 ? t - 65536 : t;
}, r.prototype.writeInt16 = function(t) {
return t < 0 && (t += 65536), this.writeUInt16(t);
}, r.prototype.readString = function(t) {
var e, i;
for (i = [], e = 0; 0 <= t ? e < t : e > t; e = 0 <= t ? ++e : --e) i[e] = String.fromCharCode(this.readByte());
return i.join("");
}, r.prototype.writeString = function(t) {
var e, i, o;
for (o = [], e = 0, i = t.length; 0 <= i ? e < i : e > i; e = 0 <= i ? ++e : --e) o.push(this.writeByte(t.charCodeAt(e)));
return o;
}, r.prototype.readShort = function() {
return this.readInt16();
}, r.prototype.writeShort = function(t) {
return this.writeInt16(t);
}, r.prototype.readLongLong = function() {
var t, e, i, o, a, c, l, h;
return t = this.readByte(), e = this.readByte(), i = this.readByte(), o = this.readByte(), a = this.readByte(), c = this.readByte(), l = this.readByte(), h = this.readByte(), 128 & t ? -1 * (72057594037927940 * (255 ^ t) + 281474976710656 * (255 ^ e) + 1099511627776 * (255 ^ i) + 4294967296 * (255 ^ o) + 16777216 * (255 ^ a) + 65536 * (255 ^ c) + 256 * (255 ^ l) + (255 ^ h) + 1) : 72057594037927940 * t + 281474976710656 * e + 1099511627776 * i + 4294967296 * o + 16777216 * a + 65536 * c + 256 * l + h;
}, r.prototype.writeLongLong = function(t) {
var e, i;
return e = Math.floor(t / 4294967296), i = 4294967295 & t, this.writeByte(e >> 24 & 255), this.writeByte(e >> 16 & 255), this.writeByte(e >> 8 & 255), this.writeByte(255 & e), this.writeByte(i >> 24 & 255), this.writeByte(i >> 16 & 255), this.writeByte(i >> 8 & 255), this.writeByte(255 & i);
}, r.prototype.readInt = function() {
return this.readInt32();
}, r.prototype.writeInt = function(t) {
return this.writeInt32(t);
}, r.prototype.read = function(t) {
var e, i;
for (e = [], i = 0; 0 <= t ? i < t : i > t; i = 0 <= t ? ++i : --i) e.push(this.readByte());
return e;
}, r.prototype.write = function(t) {
var e, i, o, a;
for (a = [], i = 0, o = t.length; i < o; i++) e = t[i], a.push(this.writeByte(e));
return a;
}, r;
})(), X1 = (function() {
var r;
function t(e) {
var i, o, a;
for (this.scalarType = e.readInt(), this.tableCount = e.readShort(), this.searchRange = e.readShort(), this.entrySelector = e.readShort(), this.rangeShift = e.readShort(), this.tables = {}, o = 0, a = this.tableCount; 0 <= a ? o < a : o > a; o = 0 <= a ? ++o : --o) i = { tag: e.readString(4), checksum: e.readInt(), offset: e.readInt(), length: e.readInt() }, this.tables[i.tag] = i;
}
return t.prototype.encode = function(e) {
var i, o, a, c, l, h, d, m, _, k, p, j, O;
for (O in p = Object.keys(e).length, h = Math.log(2), _ = 16 * Math.floor(Math.log(p) / h), c = Math.floor(_ / h), m = 16 * p - _, (o = new ni()).writeInt(this.scalarType), o.writeShort(p), o.writeShort(_), o.writeShort(c), o.writeShort(m), a = 16 * p, d = o.pos + a, l = null, j = [], e) for (k = e[O], o.writeString(O), o.writeInt(r(k)), o.writeInt(d), o.writeInt(k.length), j = j.concat(k), O === "head" && (l = d), d += k.length; d % 4; ) j.push(0), d++;
return o.write(j), i = 2981146554 - r(o.data), o.pos = l + 8, o.writeUInt32(i), o.data;
}, r = function(e) {
var i, o, a, c;
for (e = Tf.call(e); e.length % 4; ) e.push(0);
for (a = new ni(e), o = 0, i = 0, c = e.length; i < c; i = i += 4) o += a.readUInt32();
return 4294967295 & o;
}, t;
})(), $1 = {}.hasOwnProperty, pn = function(r, t) {
for (var e in t) $1.call(t, e) && (r[e] = t[e]);
function i() {
this.constructor = r;
}
return i.prototype = t.prototype, r.prototype = new i(), r.__super__ = t.prototype, r;
};
tn = (function() {
function r(t) {
var e;
this.file = t, e = this.file.directory.tables[this.tag], this.exists = !!e, e && (this.offset = e.offset, this.length = e.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 Z1 = (function() {
function r() {
return r.__super__.constructor.apply(this, arguments);
}
return pn(r, tn), r.prototype.tag = "head", r.prototype.parse = function(t) {
return t.pos = this.offset, this.version = t.readInt(), this.revision = t.readInt(), this.checkSumAdjustment = t.readInt(), this.magicNumber = t.readInt(), this.flags = t.readShort(), this.unitsPerEm = t.readShort(), this.created = t.readLongLong(), this.modified = t.readLongLong(), this.xMin = t.readShort(), this.yMin = t.readShort(), this.xMax = t.readShort(), this.yMax = t.readShort(), this.macStyle = t.readShort(), this.lowestRecPPEM = t.readShort(), this.fontDirectionHint = t.readShort(), this.indexToLocFormat = t.readShort(), this.glyphDataFormat = t.readShort();
}, r.prototype.encode = function(t) {
var e;
return (e = new ni()).writeInt(this.version), e.writeInt(this.revision), e.writeInt(this.checkSumAdjustment), e.writeInt(this.magicNumber), e.writeShort(this.flags), e.writeShort(this.unitsPerEm), e.writeLongLong(this.created), e.writeLongLong(this.modified), e.writeShort(this.xMin), e.writeShort(this.yMin), e.writeShort(this.xMax), e.writeShort(this.yMax), e.writeShort(this.macStyle), e.writeShort(this.lowestRecPPEM), e.writeShort(this.fontDirectionHint), e.writeShort(t), e.writeShort(this.glyphDataFormat), e.data;
}, r;
})(), Gu = (function() {
function r(t, e) {
var i, o, a, c, l, h, d, m, _, k, p, j, O, M, S, V, G;
switch (this.platformID = t.readUInt16(), this.encodingID = t.readShort(), this.offset = e + t.readInt(), _ = t.pos, t.pos = this.offset, this.format = t.readUInt16(), this.length = t.readUInt16(), this.language = t.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] = t.readByte();
break;
case 4:
for (p = t.readUInt16(), k = p / 2, t.pos += 6, a = (function() {
var D, it;
for (it = [], h = D = 0; 0 <= k ? D < k : D > k; h = 0 <= k ? ++D : --D) it.push(t.readUInt16());
return it;
})(), t.pos += 2, O = (function() {
var D, it;
for (it = [], h = D = 0; 0 <= k ? D < k : D > k; h = 0 <= k ? ++D : --D) it.push(t.readUInt16());
return it;
})(), d = (function() {
var D, it;
for (it = [], h = D = 0; 0 <= k ? D < k : D > k; h = 0 <= k ? ++D : --D) it.push(t.readUInt16());
return it;
})(), m = (function() {
var D, it;
for (it = [], h = D = 0; 0 <= k ? D < k : D > k; h = 0 <= k ? ++D : --D) it.push(t.readUInt16());
return it;
})(), o = (this.length - t.pos + this.offset) / 2, l = (function() {
var D, it;
for (it = [], h = D = 0; 0 <= o ? D < o : D > o; h = 0 <= o ? ++D : --D) it.push(t.readUInt16());
return it;
})(), h = S = 0, G = a.length; S < G; h = ++S) for (M = a[h], i = V = j = O[h]; j <= M ? V <= M : V >= M; i = j <= M ? ++V : --V) m[h] === 0 ? c = i + d[h] : (c = l[m[h] / 2 + (i - j) - (k - h)] || 0) !== 0 && (c += d[h]), this.codeMap[i] = 65535 & c;
}
t.pos = _;
}
return r.encode = function(t, e) {
var i, o, a, c, l, h, d, m, _, k, p, j, O, M, S, V, G, D, it, mt, ct, K, R, tt, N, F, z, U, nt, ot, ut, rt, ht, At, wt, x, B, T, H, J, Z, at, st, gt, _t, kt;
switch (U = new ni(), c = Object.keys(t).sort(function(St, Dt) {
return St - Dt;
}), e) {
case "macroman":
for (O = 0, M = (function() {
var St = [];
for (j = 0; j < 256; ++j) St.push(0);
return St;
})(), V = { 0: 0 }, a = {}, nt = 0, ht = c.length; nt < ht; nt++) V[st = t[o = c[nt]]] == null && (V[st] = ++O), a[o] = { old: t[o], new: V[t[o]] }, M[o] = V[t[o]];
return U.writeUInt16(1), U.writeUInt16(0), U.writeUInt32(12), U.writeUInt16(0), U.writeUInt16(262), U.writeUInt16(0), U.write(M), { charMap: a, subtable: U.data, maxGlyphID: O + 1 };
case "unicode":
for (F = [], _ = [], G = 0, V = {}, i = {}, S = d = null, ot = 0, At = c.length; ot < At; ot++) V[it = t[o = c[ot]]] == null && (V[it] = ++G), i[o] = { old: it, new: V[it] }, l = V[it] - o, S != null && l === d || (S && _.push(S), F.push(o), d = l), S = o;
for (S && _.push(S), _.push(65535), F.push(65535), tt = 2 * (R = F.length), K = 2 * Math.pow(Math.log(R) / Math.LN2, 2), k = Math.log(K / 2) / Math.LN2, ct = 2 * R - K, h = [], mt = [], p = [], j = ut = 0, wt = F.length; ut < wt; j = ++ut) {
if (N = F[j], m = _[j], N === 65535) {
h.push(0), mt.push(0);
break;
}
if (N - (z = i[N].new) >= 32768) for (h.push(0), mt.push(2 * (p.length + R - j)), o = rt = N; N <= m ? rt <= m : rt >= m; o = N <= m ? ++rt : --rt) p.push(i[o].new);
else h.push(z - N), mt.push(0);
}
for (U.writeUInt16(3), U.writeUInt16(1), U.writeUInt32(12), U.writeUInt16(4), U.writeUInt16(16 + 8 * R + 2 * p.length), U.writeUInt16(0), U.writeUInt16(tt), U.writeUInt16(K), U.writeUInt16(k), U.writeUInt16(ct), Z = 0, x = _.length; Z < x; Z++) o = _[Z], U.writeUInt16(o);
for (U.writeUInt16(0), at = 0, B = F.length; at < B; at++) o = F[at], U.writeUInt16(o);
for (gt = 0, T = h.length; gt < T; gt++) l = h[gt], U.writeUInt16(l);
for (_t = 0, H = mt.length; _t < H; _t++) D = mt[_t], U.writeUInt16(D);
for (kt = 0, J = p.length; kt < J; kt++) O = p[kt], U.writeUInt16(O);
return { charMap: i, subtable: U.data, maxGlyphID: G + 1 };
}
}, r;
})(), Rf = (function() {
function r() {
return r.__super__.constructor.apply(this, arguments);
}
return pn(r, tn), r.prototype.tag = "cmap", r.prototype.parse = function(t) {
var e, i, o;
for (t.pos = this.offset, this.version = t.readUInt16(), o = t.readUInt16(), this.tables = [], this.unicode = null, i = 0; 0 <= o ? i < o : i > o; i = 0 <= o ? ++i : --i) e = new Gu(t, this.offset), this.tables.push(e), e.isUnicode && this.unicode == null && (this.unicode = e);
return !0;
}, r.encode = function(t, e) {
var i, o;
return e == null && (e = "macroman"), i = Gu.encode(t, e), (o = new ni()).writeUInt16(0), o.writeUInt16(1), i.table = o.data.concat(i.subtable), i;
}, r;
})(), Q1 = (function() {
function r() {
return r.__super__.constructor.apply(this, arguments);
}
return pn(r, tn), r.prototype.tag = "hhea", r.prototype.parse = function(t) {
return t.pos = this.offset, this.version = t.readInt(), this.ascender = t.readShort(), this.decender = t.readShort(), this.lineGap = t.readShort(), this.advanceWidthMax = t.readShort(), this.minLeftSideBearing = t.readShort(), this.minRightSideBearing = t.readShort(), this.xMaxExtent = t.readShort(), this.caretSlopeRise = t.readShort(), this.caretSlopeRun = t.readShort(), this.caretOffset = t.readShort(), t.pos += 8, this.metricDataFormat = t.readShort(), this.numberOfMetrics = t.readUInt16();
}, r;
})(), t2 = (function() {
function r() {
return r.__super__.constructor.apply(this, arguments);
}
return pn(r, tn), r.prototype.tag = "OS/2", r.prototype.parse = function(t) {
if (t.pos = this.offset, this.version = t.readUInt16(), this.averageCharWidth = t.readShort(), this.weightClass = t.readUInt16(), this.widthClass = t.readUInt16(), this.type = t.readShort(), this.ySubscriptXSize = t.readShort(), this.ySubscriptYSize = t.readShort(), this.ySubscriptXOffset = t.readShort(), this.ySubscriptYOffset = t.readShort(), this.ySuperscriptXSize = t.readShort(), this.ySuperscriptYSize = t.readShort(), this.ySuperscriptXOffset = t.readShort(), this.ySuperscriptYOffset = t.readShort(), this.yStrikeoutSize = t.readShort(), this.yStrikeoutPosition = t.readShort(), this.familyClass = t.readShort(), this.panose = (function() {
var e, i;
for (i = [], e = 0; e < 10; ++e) i.push(t.readByte());
return i;
})(), this.charRange = (function() {
var e, i;
for (i = [], e = 0; e < 4; ++e) i.push(t.readInt());
return i;
})(), this.vendorID = t.readString(4), this.selection = t.readShort(), this.firstCharIndex = t.readShort(), this.lastCharIndex = t.readShort(), this.version > 0 && (this.ascent = t.readShort(), this.descent = t.readShort(), this.lineGap = t.readShort(), this.winAscent = t.readShort(), this.winDescent = t.readShort(), this.codePageRange = (function() {
var e, i;
for (i = [], e = 0; e < 2; e = ++e) i.push(t.readInt());
return i;
})(), this.version > 1)) return this.xHeight = t.readShort(), this.capHeight = t.readShort(), this.defaultChar = t.readShort(), this.breakChar = t.readShort(), this.maxContext = t.readShort();
}, r;
})(), e2 = (function() {
function r() {
return r.__super__.constructor.apply(this, arguments);
}
return pn(r, tn), r.prototype.tag = "post", r.prototype.parse = function(t) {
var e, i, o;
switch (t.pos = this.offset, this.format = t.readInt(), this.italicAngle = t.readInt(), this.underlinePosition = t.readShort(), this.underlineThickness = t.readShort(), this.isFixedPitch = t.readInt(), this.minMemType42 = t.readInt(), this.maxMemType42 = t.readInt(), this.minMemType1 = t.readInt(), this.maxMemType1 = t.readInt(), this.format) {
case 65536:
case 196608:
break;
case 131072:
var a;
for (i = t.readUInt16(), this.glyphNameIndex = [], a = 0; 0 <= i ? a < i : a > i; a = 0 <= i ? ++a : --a) this.glyphNameIndex.push(t.readUInt16());
for (this.names = [], o = []; t.pos < this.offset + this.length; ) e = t.readByte(), o.push(this.names.push(t.readString(e)));
return o;
case 151552:
return i = t.readUInt16(), this.offsets = t.read(i);
case 262144:
return this.map = function() {
var c, l, h;
for (h = [], a = c = 0, l = this.file.maxp.numGlyphs; 0 <= l ? c < l : c > l; a = 0 <= l ? ++c : --c) h.push(t.readUInt32());
return h;
}.call(this);
}
}, r;
})(), r2 = function(r, t) {
this.raw = r, this.length = r.length, this.platformID = t.platformID, this.encodingID = t.encodingID, this.languageID = t.languageID;
}, n2 = (function() {
function r() {
return r.__super__.constructor.apply(this, arguments);
}
return pn(r, tn), r.prototype.tag = "name", r.prototype.parse = function(t) {
var e, i, o, a, c, l, h, d, m, _, k;
for (t.pos = this.offset, t.readShort(), e = t.readShort(), l = t.readShort(), i = [], a = 0; 0 <= e ? a < e : a > e; a = 0 <= e ? ++a : --a) i.push({ platformID: t.readShort(), encodingID: t.readShort(), languageID: t.readShort(), nameID: t.readShort(), length: t.readShort(), offset: this.offset + l + t.readShort() });
for (h = {}, a = m = 0, _ = i.length; m < _; a = ++m) o = i[a], t.pos = o.offset, d = t.readString(o.length), c = new r2(d, o), h[k = o.nameID] == null && (h[k] = []), h[o.nameID].push(c);
this.strings = h, this.copyright = h[0], this.fontFamily = h[1], this.fontSubfamily = h[2], this.uniqueSubfamily = h[3], this.fontName = h[4], this.version = h[5];
try {
this.postscriptName = h[6][0].raw.replace(/[\x00-\x19\x80-\xff]/g, "");
} catch {
this.postscriptName = h[4][0].raw.replace(/[\x00-\x19\x80-\xff]/g, "");
}
return this.trademark = h[7], this.manufacturer = h[8], this.designer = h[9], this.description = h[10], this.vendorUrl = h[11], this.designerUrl = h[12], this.license = h[13], this.licenseUrl = h[14], this.preferredFamily = h[15], this.preferredSubfamily = h[17], this.compatibleFull = h[18], this.sampleText = h[19];
}, r;
})(), i2 = (function() {
function r() {
return r.__super__.constructor.apply(this, arguments);
}
return pn(r, tn), r.prototype.tag = "maxp", r.prototype.parse = function(t) {
return t.pos = this.offset, this.version = t.readInt(), this.numGlyphs = t.readUInt16(), this.maxPoints = t.readUInt16(), this.maxContours = t.readUInt16(), this.maxCompositePoints = t.readUInt16(), this.maxComponentContours = t.readUInt16(), this.maxZones = t.readUInt16(), this.maxTwilightPoints = t.readUInt16(), this.maxStorage = t.readUInt16(), this.maxFunctionDefs = t.readUInt16(), this.maxInstructionDefs = t.readUInt16(), this.maxStackElements = t.readUInt16(), this.maxSizeOfInstructions = t.readUInt16(), this.maxComponentElements = t.readUInt16(), this.maxComponentDepth = t.readUInt16();
}, r;
})(), a2 = (function() {
function r() {
return r.__super__.constructor.apply(this, arguments);
}
return pn(r, tn), r.prototype.tag = "hmtx", r.prototype.parse = function(t) {
var e, i, o, a, c, l, h;
for (t.pos = this.offset, this.metrics = [], e = 0, l = this.file.hhea.numberOfMetrics; 0 <= l ? e < l : e > l; e = 0 <= l ? ++e : --e) this.metrics.push({ advance: t.readUInt16(), lsb: t.readInt16() });
for (o = this.file.maxp.numGlyphs - this.file.hhea.numberOfMetrics, this.leftSideBearings = (function() {
var d, m;
for (m = [], e = d = 0; 0 <= o ? d < o : d > o; e = 0 <= o ? ++d : --d) m.push(t.readInt16());
return m;
})(), this.widths = function() {
var d, m, _, k;
for (k = [], d = 0, m = (_ = this.metrics).length; d < m; d++) a = _[d], k.push(a.advance);
return k;
}.call(this), i = this.widths[this.widths.length - 1], h = [], e = c = 0; 0 <= o ? c < o : c > o; e = 0 <= o ? ++c : --c) h.push(this.widths.push(i));
return h;
}, r.prototype.forGlyph = function(t) {
return t in this.metrics ? this.metrics[t] : { advance: this.metrics[this.metrics.length - 1].advance, lsb: this.leftSideBearings[t - this.metrics.length] };
}, r;
})(), Tf = [].slice, s2 = (function() {
function r() {
return r.__super__.constructor.apply(this, arguments);
}
return pn(r, tn), r.prototype.tag = "glyf", r.prototype.parse = function() {
return this.cache = {};
}, r.prototype.glyphFor = function(t) {
var e, i, o, a, c, l, h, d, m, _;
return t in this.cache ? this.cache[t] : (a = this.file.loca, e = this.file.contents, i = a.indexOf(t), (o = a.lengthOf(t)) === 0 ? this.cache[t] = null : (e.pos = this.offset + i, c = (l = new ni(e.read(o))).readShort(), d = l.readShort(), _ = l.readShort(), h = l.readShort(), m = l.readShort(), this.cache[t] = c === -1 ? new l2(l, d, _, h, m) : new o2(l, c, d, _, h, m), this.cache[t]));
}, r.prototype.encode = function(t, e, i) {
var o, a, c, l, h;
for (c = [], a = [], l = 0, h = e.length; l < h; l++) o = t[e[l]], a.push(c.length), o && (c = c.concat(o.encode(i)));
return a.push(c.length), { table: c, offsets: a };
}, r;
})(), o2 = (function() {
function r(t, e, i, o, a, c) {
this.raw = t, this.numberOfContours = e, this.xMin = i, this.yMin = o, this.xMax = a, this.yMax = c, this.compound = !1;
}
return r.prototype.encode = function() {
return this.raw.data;
}, r;
})(), l2 = (function() {
function r(t, e, i, o, a) {
var c, l;
for (this.raw = t, this.xMin = e, this.yMin = i, this.xMax = o, this.yMax = a, this.compound = !0, this.glyphIDs = [], this.glyphOffsets = [], c = this.raw; l = c.readShort(), this.glyphOffsets.push(c.pos), this.glyphIDs.push(c.readUInt16()), 32 & l; ) c.pos += 1 & l ? 4 : 2, 128 & l ? c.pos += 8 : 64 & l ? c.pos += 4 : 8 & l && (c.pos += 2);
}
return r.prototype.encode = function() {
var t, e, i;
for (e = new ni(Tf.call(this.raw.data)), t = 0, i = this.glyphIDs.length; t < i; ++t) e.pos = this.glyphOffsets[t];
return e.data;
}, r;
})(), u2 = (function() {
function r() {
return r.__super__.constructor.apply(this, arguments);
}
return pn(r, tn), r.prototype.tag = "loca", r.prototype.parse = function(t) {
var e, i;
return t.pos = this.offset, e = this.file.head.indexToLocFormat, this.offsets = e === 0 ? function() {
var o, a;
for (a = [], i = 0, o = this.length; i < o; i += 2) a.push(2 * t.readUInt16());
return a;
}.call(this) : function() {
var o, a;
for (a = [], i = 0, o = this.length; i < o; i += 4) a.push(t.readUInt32());
return a;
}.call(this);
}, r.prototype.indexOf = function(t) {
return this.offsets[t];
}, r.prototype.lengthOf = function(t) {
return this.offsets[t + 1] - this.offsets[t];
}, r.prototype.encode = function(t, e) {
for (var i = new Uint32Array(this.offsets.length), o = 0, a = 0, c = 0; c < i.length; ++c) if (i[c] = o, a < e.length && e[a] == c) {
++a, i[c] = o;
var l = this.offsets[c], h = this.offsets[c + 1] - l;
h > 0 && (o += h);
}
for (var d = new Array(4 * i.length), m = 0; m < i.length; ++m) d[4 * m + 3] = 255 & i[m], d[4 * m + 2] = (65280 & i[m]) >> 8, d[4 * m + 1] = (16711680 & i[m]) >> 16, d[4 * m] = (4278190080 & i[m]) >> 24;
return d;
}, r;
})(), f2 = (function() {
function r(t) {
this.font = t, this.subset = {}, this.unicodes = {}, this.next = 33;
}
return r.prototype.generateCmap = function() {
var t, e, i, o, a;
for (e in o = this.font.cmap.tables[0].codeMap, t = {}, a = this.subset) i = a[e], t[e] = o[i];
return t;
}, r.prototype.glyphsFor = function(t) {
var e, i, o, a, c, l, h;
for (o = {}, c = 0, l = t.length; c < l; c++) o[a = t[c]] = this.font.glyf.glyphFor(a);
for (a in e = [], o) (i = o[a]) != null && i.compound && e.push.apply(e, i.glyphIDs);
if (e.length > 0) for (a in h = this.glyphsFor(e)) i = h[a], o[a] = i;
return o;
}, r.prototype.encode = function(t, e) {
var i, o, a, c, l, h, d, m, _, k, p, j, O, M, S;
for (o in i = Rf.encode(this.generateCmap(), "unicode"), c = this.glyphsFor(t), p = { 0: 0 }, S = i.charMap) p[(h = S[o]).old] = h.new;
for (j in k = i.maxGlyphID, c) j in p || (p[j] = k++);
return m = (function(V) {
var G, D;
for (G in D = {}, V) D[V[G]] = G;
return D;
})(p), _ = Object.keys(m).sort(function(V, G) {
return V - G;
}), O = (function() {
var V, G, D;
for (D = [], V = 0, G = _.length; V < G; V++) l = _[V], D.push(m[l]);
return D;
})(), a = this.font.glyf.encode(c, O, p), d = this.font.loca.encode(a.offsets, O), M = { cmap: this.font.cmap.raw(), glyf: a.table, loca: d, 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(e) }, this.font.os2.exists && (M["OS/2"] = this.font.os2.raw()), this.font.directory.encode(M);
}, r;
})();
Mt.API.PDFObject = (function() {
var r;
function t() {
}
return r = function(e, i) {
return (Array(i + 1).join("0") + e).slice(-i);
}, t.convert = function(e) {
var i, o, a, c;
if (Array.isArray(e)) return "[" + (function() {
var l, h, d;
for (d = [], l = 0, h = e.length; l < h; l++) i = e[l], d.push(t.convert(i));
return d;
})().join(" ") + "]";
if (typeof e == "string") return "/" + e;
if (e?.isString) return "(" + e + ")";
if (e instanceof Date) return "(D:" + r(e.getUTCFullYear(), 4) + r(e.getUTCMonth(), 2) + r(e.getUTCDate(), 2) + r(e.getUTCHours(), 2) + r(e.getUTCMinutes(), 2) + r(e.getUTCSeconds(), 2) + "Z)";
if ({}.toString.call(e) === "[object Object]") {
for (o in a = ["<<"], e) c = e[o], a.push("/" + o + " " + t.convert(c));
return a.push(">>"), a.join(`
`);
}
return "" + e;
}, t;
})();
const h2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
__proto__: null,
AcroForm: U1,
AcroFormAppearance: It,
AcroFormButton: rr,
AcroFormCheckBox: Fa,
AcroFormChoiceField: Ni,
AcroFormComboBox: Si,
AcroFormEditBox: Ia,
AcroFormListBox: Li,
AcroFormPasswordField: Ea,
AcroFormPushButton: Ca,
AcroFormRadioButton: ki,
AcroFormTextField: ri,
GState: Ba,
ShadingPattern: ti,
TilingPattern: Ai,
default: Mt,
jsPDF: Mt
}, Symbol.toStringTag, { value: "Module" }));
export {
_e as _,
h2 as j
};
//# sourceMappingURL=jspdf.es.min-DW3BZyWX.js.map