gerbers-renderer 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2969 @@
1
+ var Tt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2
+ function Vt(M) {
3
+ return M && M.__esModule && Object.prototype.hasOwnProperty.call(M, "default") ? M.default : M;
4
+ }
5
+ function Mt(M) {
6
+ throw new Error('Could not dynamically require "' + M + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
7
+ }
8
+ var Dt = { exports: {} };
9
+ var Wt;
10
+ function Jt() {
11
+ return Wt || (Wt = 1, (function(M, k) {
12
+ (function(a) {
13
+ M.exports = a();
14
+ })(function() {
15
+ return (function a(y, m, l) {
16
+ function i(b, v) {
17
+ if (!m[b]) {
18
+ if (!y[b]) {
19
+ var _ = typeof Mt == "function" && Mt;
20
+ if (!v && _) return _(b, !0);
21
+ if (r) return r(b, !0);
22
+ var d = new Error("Cannot find module '" + b + "'");
23
+ throw d.code = "MODULE_NOT_FOUND", d;
24
+ }
25
+ var s = m[b] = { exports: {} };
26
+ y[b][0].call(s.exports, function(p) {
27
+ var n = y[b][1][p];
28
+ return i(n || p);
29
+ }, s, s.exports, a, y, m, l);
30
+ }
31
+ return m[b].exports;
32
+ }
33
+ for (var r = typeof Mt == "function" && Mt, o = 0; o < l.length; o++) i(l[o]);
34
+ return i;
35
+ })({ 1: [function(a, y, m) {
36
+ var l = a("./utils"), i = a("./support"), r = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
37
+ m.encode = function(o) {
38
+ for (var b, v, _, d, s, p, n, h = [], c = 0, g = o.length, x = g, z = l.getTypeOf(o) !== "string"; c < o.length; ) x = g - c, _ = z ? (b = o[c++], v = c < g ? o[c++] : 0, c < g ? o[c++] : 0) : (b = o.charCodeAt(c++), v = c < g ? o.charCodeAt(c++) : 0, c < g ? o.charCodeAt(c++) : 0), d = b >> 2, s = (3 & b) << 4 | v >> 4, p = 1 < x ? (15 & v) << 2 | _ >> 6 : 64, n = 2 < x ? 63 & _ : 64, h.push(r.charAt(d) + r.charAt(s) + r.charAt(p) + r.charAt(n));
39
+ return h.join("");
40
+ }, m.decode = function(o) {
41
+ var b, v, _, d, s, p, n = 0, h = 0, c = "data:";
42
+ if (o.substr(0, c.length) === c) throw new Error("Invalid base64 input, it looks like a data url.");
43
+ var g, x = 3 * (o = o.replace(/[^A-Za-z0-9+/=]/g, "")).length / 4;
44
+ if (o.charAt(o.length - 1) === r.charAt(64) && x--, o.charAt(o.length - 2) === r.charAt(64) && x--, x % 1 != 0) throw new Error("Invalid base64 input, bad content length.");
45
+ for (g = i.uint8array ? new Uint8Array(0 | x) : new Array(0 | x); n < o.length; ) b = r.indexOf(o.charAt(n++)) << 2 | (d = r.indexOf(o.charAt(n++))) >> 4, v = (15 & d) << 4 | (s = r.indexOf(o.charAt(n++))) >> 2, _ = (3 & s) << 6 | (p = r.indexOf(o.charAt(n++))), g[h++] = b, s !== 64 && (g[h++] = v), p !== 64 && (g[h++] = _);
46
+ return g;
47
+ };
48
+ }, { "./support": 30, "./utils": 32 }], 2: [function(a, y, m) {
49
+ var l = a("./external"), i = a("./stream/DataWorker"), r = a("./stream/Crc32Probe"), o = a("./stream/DataLengthProbe");
50
+ function b(v, _, d, s, p) {
51
+ this.compressedSize = v, this.uncompressedSize = _, this.crc32 = d, this.compression = s, this.compressedContent = p;
52
+ }
53
+ b.prototype = { getContentWorker: function() {
54
+ var v = new i(l.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new o("data_length")), _ = this;
55
+ return v.on("end", function() {
56
+ if (this.streamInfo.data_length !== _.uncompressedSize) throw new Error("Bug : uncompressed data size mismatch");
57
+ }), v;
58
+ }, getCompressedWorker: function() {
59
+ return new i(l.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize", this.compressedSize).withStreamInfo("uncompressedSize", this.uncompressedSize).withStreamInfo("crc32", this.crc32).withStreamInfo("compression", this.compression);
60
+ } }, b.createWorkerFrom = function(v, _, d) {
61
+ return v.pipe(new r()).pipe(new o("uncompressedSize")).pipe(_.compressWorker(d)).pipe(new o("compressedSize")).withStreamInfo("compression", _);
62
+ }, y.exports = b;
63
+ }, { "./external": 6, "./stream/Crc32Probe": 25, "./stream/DataLengthProbe": 26, "./stream/DataWorker": 27 }], 3: [function(a, y, m) {
64
+ var l = a("./stream/GenericWorker");
65
+ m.STORE = { magic: "\0\0", compressWorker: function() {
66
+ return new l("STORE compression");
67
+ }, uncompressWorker: function() {
68
+ return new l("STORE decompression");
69
+ } }, m.DEFLATE = a("./flate");
70
+ }, { "./flate": 7, "./stream/GenericWorker": 28 }], 4: [function(a, y, m) {
71
+ var l = a("./utils"), i = (function() {
72
+ for (var r, o = [], b = 0; b < 256; b++) {
73
+ r = b;
74
+ for (var v = 0; v < 8; v++) r = 1 & r ? 3988292384 ^ r >>> 1 : r >>> 1;
75
+ o[b] = r;
76
+ }
77
+ return o;
78
+ })();
79
+ y.exports = function(r, o) {
80
+ return r !== void 0 && r.length ? l.getTypeOf(r) !== "string" ? (function(b, v, _, d) {
81
+ var s = i, p = d + _;
82
+ b ^= -1;
83
+ for (var n = d; n < p; n++) b = b >>> 8 ^ s[255 & (b ^ v[n])];
84
+ return -1 ^ b;
85
+ })(0 | o, r, r.length, 0) : (function(b, v, _, d) {
86
+ var s = i, p = d + _;
87
+ b ^= -1;
88
+ for (var n = d; n < p; n++) b = b >>> 8 ^ s[255 & (b ^ v.charCodeAt(n))];
89
+ return -1 ^ b;
90
+ })(0 | o, r, r.length, 0) : 0;
91
+ };
92
+ }, { "./utils": 32 }], 5: [function(a, y, m) {
93
+ m.base64 = !1, m.binary = !1, m.dir = !1, m.createFolders = !0, m.date = null, m.compression = null, m.compressionOptions = null, m.comment = null, m.unixPermissions = null, m.dosPermissions = null;
94
+ }, {}], 6: [function(a, y, m) {
95
+ var l = null;
96
+ l = typeof Promise < "u" ? Promise : a("lie"), y.exports = { Promise: l };
97
+ }, { lie: 37 }], 7: [function(a, y, m) {
98
+ var l = typeof Uint8Array < "u" && typeof Uint16Array < "u" && typeof Uint32Array < "u", i = a("pako"), r = a("./utils"), o = a("./stream/GenericWorker"), b = l ? "uint8array" : "array";
99
+ function v(_, d) {
100
+ o.call(this, "FlateWorker/" + _), this._pako = null, this._pakoAction = _, this._pakoOptions = d, this.meta = {};
101
+ }
102
+ m.magic = "\b\0", r.inherits(v, o), v.prototype.processChunk = function(_) {
103
+ this.meta = _.meta, this._pako === null && this._createPako(), this._pako.push(r.transformTo(b, _.data), !1);
104
+ }, v.prototype.flush = function() {
105
+ o.prototype.flush.call(this), this._pako === null && this._createPako(), this._pako.push([], !0);
106
+ }, v.prototype.cleanUp = function() {
107
+ o.prototype.cleanUp.call(this), this._pako = null;
108
+ }, v.prototype._createPako = function() {
109
+ this._pako = new i[this._pakoAction]({ raw: !0, level: this._pakoOptions.level || -1 });
110
+ var _ = this;
111
+ this._pako.onData = function(d) {
112
+ _.push({ data: d, meta: _.meta });
113
+ };
114
+ }, m.compressWorker = function(_) {
115
+ return new v("Deflate", _);
116
+ }, m.uncompressWorker = function() {
117
+ return new v("Inflate", {});
118
+ };
119
+ }, { "./stream/GenericWorker": 28, "./utils": 32, pako: 38 }], 8: [function(a, y, m) {
120
+ function l(s, p) {
121
+ var n, h = "";
122
+ for (n = 0; n < p; n++) h += String.fromCharCode(255 & s), s >>>= 8;
123
+ return h;
124
+ }
125
+ function i(s, p, n, h, c, g) {
126
+ var x, z, C = s.file, D = s.compression, T = g !== b.utf8encode, P = r.transformTo("string", g(C.name)), O = r.transformTo("string", b.utf8encode(C.name)), W = C.comment, V = r.transformTo("string", g(W)), w = r.transformTo("string", b.utf8encode(W)), R = O.length !== C.name.length, e = w.length !== W.length, N = "", tt = "", U = "", et = C.dir, X = C.date, J = { crc32: 0, compressedSize: 0, uncompressedSize: 0 };
127
+ p && !n || (J.crc32 = s.crc32, J.compressedSize = s.compressedSize, J.uncompressedSize = s.uncompressedSize);
128
+ var B = 0;
129
+ p && (B |= 8), T || !R && !e || (B |= 2048);
130
+ var A = 0, K = 0;
131
+ et && (A |= 16), c === "UNIX" ? (K = 798, A |= (function($, ut) {
132
+ var ht = $;
133
+ return $ || (ht = ut ? 16893 : 33204), (65535 & ht) << 16;
134
+ })(C.unixPermissions, et)) : (K = 20, A |= (function($) {
135
+ return 63 & ($ || 0);
136
+ })(C.dosPermissions)), x = X.getUTCHours(), x <<= 6, x |= X.getUTCMinutes(), x <<= 5, x |= X.getUTCSeconds() / 2, z = X.getUTCFullYear() - 1980, z <<= 4, z |= X.getUTCMonth() + 1, z <<= 5, z |= X.getUTCDate(), R && (tt = l(1, 1) + l(v(P), 4) + O, N += "up" + l(tt.length, 2) + tt), e && (U = l(1, 1) + l(v(V), 4) + w, N += "uc" + l(U.length, 2) + U);
137
+ var H = "";
138
+ return H += `
139
+ \0`, H += l(B, 2), H += D.magic, H += l(x, 2), H += l(z, 2), H += l(J.crc32, 4), H += l(J.compressedSize, 4), H += l(J.uncompressedSize, 4), H += l(P.length, 2), H += l(N.length, 2), { fileRecord: _.LOCAL_FILE_HEADER + H + P + N, dirRecord: _.CENTRAL_FILE_HEADER + l(K, 2) + H + l(V.length, 2) + "\0\0\0\0" + l(A, 4) + l(h, 4) + P + N + V };
140
+ }
141
+ var r = a("../utils"), o = a("../stream/GenericWorker"), b = a("../utf8"), v = a("../crc32"), _ = a("../signature");
142
+ function d(s, p, n, h) {
143
+ o.call(this, "ZipFileWorker"), this.bytesWritten = 0, this.zipComment = p, this.zipPlatform = n, this.encodeFileName = h, this.streamFiles = s, this.accumulate = !1, this.contentBuffer = [], this.dirRecords = [], this.currentSourceOffset = 0, this.entriesCount = 0, this.currentFile = null, this._sources = [];
144
+ }
145
+ r.inherits(d, o), d.prototype.push = function(s) {
146
+ var p = s.meta.percent || 0, n = this.entriesCount, h = this._sources.length;
147
+ this.accumulate ? this.contentBuffer.push(s) : (this.bytesWritten += s.data.length, o.prototype.push.call(this, { data: s.data, meta: { currentFile: this.currentFile, percent: n ? (p + 100 * (n - h - 1)) / n : 100 } }));
148
+ }, d.prototype.openedSource = function(s) {
149
+ this.currentSourceOffset = this.bytesWritten, this.currentFile = s.file.name;
150
+ var p = this.streamFiles && !s.file.dir;
151
+ if (p) {
152
+ var n = i(s, p, !1, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
153
+ this.push({ data: n.fileRecord, meta: { percent: 0 } });
154
+ } else this.accumulate = !0;
155
+ }, d.prototype.closedSource = function(s) {
156
+ this.accumulate = !1;
157
+ var p = this.streamFiles && !s.file.dir, n = i(s, p, !0, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
158
+ if (this.dirRecords.push(n.dirRecord), p) this.push({ data: (function(h) {
159
+ return _.DATA_DESCRIPTOR + l(h.crc32, 4) + l(h.compressedSize, 4) + l(h.uncompressedSize, 4);
160
+ })(s), meta: { percent: 100 } });
161
+ else for (this.push({ data: n.fileRecord, meta: { percent: 0 } }); this.contentBuffer.length; ) this.push(this.contentBuffer.shift());
162
+ this.currentFile = null;
163
+ }, d.prototype.flush = function() {
164
+ for (var s = this.bytesWritten, p = 0; p < this.dirRecords.length; p++) this.push({ data: this.dirRecords[p], meta: { percent: 100 } });
165
+ var n = this.bytesWritten - s, h = (function(c, g, x, z, C) {
166
+ var D = r.transformTo("string", C(z));
167
+ return _.CENTRAL_DIRECTORY_END + "\0\0\0\0" + l(c, 2) + l(c, 2) + l(g, 4) + l(x, 4) + l(D.length, 2) + D;
168
+ })(this.dirRecords.length, n, s, this.zipComment, this.encodeFileName);
169
+ this.push({ data: h, meta: { percent: 100 } });
170
+ }, d.prototype.prepareNextSource = function() {
171
+ this.previous = this._sources.shift(), this.openedSource(this.previous.streamInfo), this.isPaused ? this.previous.pause() : this.previous.resume();
172
+ }, d.prototype.registerPrevious = function(s) {
173
+ this._sources.push(s);
174
+ var p = this;
175
+ return s.on("data", function(n) {
176
+ p.processChunk(n);
177
+ }), s.on("end", function() {
178
+ p.closedSource(p.previous.streamInfo), p._sources.length ? p.prepareNextSource() : p.end();
179
+ }), s.on("error", function(n) {
180
+ p.error(n);
181
+ }), this;
182
+ }, d.prototype.resume = function() {
183
+ return !!o.prototype.resume.call(this) && (!this.previous && this._sources.length ? (this.prepareNextSource(), !0) : this.previous || this._sources.length || this.generatedError ? void 0 : (this.end(), !0));
184
+ }, d.prototype.error = function(s) {
185
+ var p = this._sources;
186
+ if (!o.prototype.error.call(this, s)) return !1;
187
+ for (var n = 0; n < p.length; n++) try {
188
+ p[n].error(s);
189
+ } catch {
190
+ }
191
+ return !0;
192
+ }, d.prototype.lock = function() {
193
+ o.prototype.lock.call(this);
194
+ for (var s = this._sources, p = 0; p < s.length; p++) s[p].lock();
195
+ }, y.exports = d;
196
+ }, { "../crc32": 4, "../signature": 23, "../stream/GenericWorker": 28, "../utf8": 31, "../utils": 32 }], 9: [function(a, y, m) {
197
+ var l = a("../compressions"), i = a("./ZipFileWorker");
198
+ m.generateWorker = function(r, o, b) {
199
+ var v = new i(o.streamFiles, b, o.platform, o.encodeFileName), _ = 0;
200
+ try {
201
+ r.forEach(function(d, s) {
202
+ _++;
203
+ var p = (function(g, x) {
204
+ var z = g || x, C = l[z];
205
+ if (!C) throw new Error(z + " is not a valid compression method !");
206
+ return C;
207
+ })(s.options.compression, o.compression), n = s.options.compressionOptions || o.compressionOptions || {}, h = s.dir, c = s.date;
208
+ s._compressWorker(p, n).withStreamInfo("file", { name: d, dir: h, date: c, comment: s.comment || "", unixPermissions: s.unixPermissions, dosPermissions: s.dosPermissions }).pipe(v);
209
+ }), v.entriesCount = _;
210
+ } catch (d) {
211
+ v.error(d);
212
+ }
213
+ return v;
214
+ };
215
+ }, { "../compressions": 3, "./ZipFileWorker": 8 }], 10: [function(a, y, m) {
216
+ function l() {
217
+ if (!(this instanceof l)) return new l();
218
+ if (arguments.length) throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");
219
+ this.files = /* @__PURE__ */ Object.create(null), this.comment = null, this.root = "", this.clone = function() {
220
+ var i = new l();
221
+ for (var r in this) typeof this[r] != "function" && (i[r] = this[r]);
222
+ return i;
223
+ };
224
+ }
225
+ (l.prototype = a("./object")).loadAsync = a("./load"), l.support = a("./support"), l.defaults = a("./defaults"), l.version = "3.10.1", l.loadAsync = function(i, r) {
226
+ return new l().loadAsync(i, r);
227
+ }, l.external = a("./external"), y.exports = l;
228
+ }, { "./defaults": 5, "./external": 6, "./load": 11, "./object": 15, "./support": 30 }], 11: [function(a, y, m) {
229
+ var l = a("./utils"), i = a("./external"), r = a("./utf8"), o = a("./zipEntries"), b = a("./stream/Crc32Probe"), v = a("./nodejsUtils");
230
+ function _(d) {
231
+ return new i.Promise(function(s, p) {
232
+ var n = d.decompressed.getContentWorker().pipe(new b());
233
+ n.on("error", function(h) {
234
+ p(h);
235
+ }).on("end", function() {
236
+ n.streamInfo.crc32 !== d.decompressed.crc32 ? p(new Error("Corrupted zip : CRC32 mismatch")) : s();
237
+ }).resume();
238
+ });
239
+ }
240
+ y.exports = function(d, s) {
241
+ var p = this;
242
+ return s = l.extend(s || {}, { base64: !1, checkCRC32: !1, optimizedBinaryString: !1, createFolders: !1, decodeFileName: r.utf8decode }), v.isNode && v.isStream(d) ? i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")) : l.prepareContent("the loaded zip file", d, !0, s.optimizedBinaryString, s.base64).then(function(n) {
243
+ var h = new o(s);
244
+ return h.load(n), h;
245
+ }).then(function(n) {
246
+ var h = [i.Promise.resolve(n)], c = n.files;
247
+ if (s.checkCRC32) for (var g = 0; g < c.length; g++) h.push(_(c[g]));
248
+ return i.Promise.all(h);
249
+ }).then(function(n) {
250
+ for (var h = n.shift(), c = h.files, g = 0; g < c.length; g++) {
251
+ var x = c[g], z = x.fileNameStr, C = l.resolve(x.fileNameStr);
252
+ p.file(C, x.decompressed, { binary: !0, optimizedBinaryString: !0, date: x.date, dir: x.dir, comment: x.fileCommentStr.length ? x.fileCommentStr : null, unixPermissions: x.unixPermissions, dosPermissions: x.dosPermissions, createFolders: s.createFolders }), x.dir || (p.file(C).unsafeOriginalName = z);
253
+ }
254
+ return h.zipComment.length && (p.comment = h.zipComment), p;
255
+ });
256
+ };
257
+ }, { "./external": 6, "./nodejsUtils": 14, "./stream/Crc32Probe": 25, "./utf8": 31, "./utils": 32, "./zipEntries": 33 }], 12: [function(a, y, m) {
258
+ var l = a("../utils"), i = a("../stream/GenericWorker");
259
+ function r(o, b) {
260
+ i.call(this, "Nodejs stream input adapter for " + o), this._upstreamEnded = !1, this._bindStream(b);
261
+ }
262
+ l.inherits(r, i), r.prototype._bindStream = function(o) {
263
+ var b = this;
264
+ (this._stream = o).pause(), o.on("data", function(v) {
265
+ b.push({ data: v, meta: { percent: 0 } });
266
+ }).on("error", function(v) {
267
+ b.isPaused ? this.generatedError = v : b.error(v);
268
+ }).on("end", function() {
269
+ b.isPaused ? b._upstreamEnded = !0 : b.end();
270
+ });
271
+ }, r.prototype.pause = function() {
272
+ return !!i.prototype.pause.call(this) && (this._stream.pause(), !0);
273
+ }, r.prototype.resume = function() {
274
+ return !!i.prototype.resume.call(this) && (this._upstreamEnded ? this.end() : this._stream.resume(), !0);
275
+ }, y.exports = r;
276
+ }, { "../stream/GenericWorker": 28, "../utils": 32 }], 13: [function(a, y, m) {
277
+ var l = a("readable-stream").Readable;
278
+ function i(r, o, b) {
279
+ l.call(this, o), this._helper = r;
280
+ var v = this;
281
+ r.on("data", function(_, d) {
282
+ v.push(_) || v._helper.pause(), b && b(d);
283
+ }).on("error", function(_) {
284
+ v.emit("error", _);
285
+ }).on("end", function() {
286
+ v.push(null);
287
+ });
288
+ }
289
+ a("../utils").inherits(i, l), i.prototype._read = function() {
290
+ this._helper.resume();
291
+ }, y.exports = i;
292
+ }, { "../utils": 32, "readable-stream": 16 }], 14: [function(a, y, m) {
293
+ y.exports = { isNode: typeof Buffer < "u", newBufferFrom: function(l, i) {
294
+ if (Buffer.from && Buffer.from !== Uint8Array.from) return Buffer.from(l, i);
295
+ if (typeof l == "number") throw new Error('The "data" argument must not be a number');
296
+ return new Buffer(l, i);
297
+ }, allocBuffer: function(l) {
298
+ if (Buffer.alloc) return Buffer.alloc(l);
299
+ var i = new Buffer(l);
300
+ return i.fill(0), i;
301
+ }, isBuffer: function(l) {
302
+ return Buffer.isBuffer(l);
303
+ }, isStream: function(l) {
304
+ return l && typeof l.on == "function" && typeof l.pause == "function" && typeof l.resume == "function";
305
+ } };
306
+ }, {}], 15: [function(a, y, m) {
307
+ function l(C, D, T) {
308
+ var P, O = r.getTypeOf(D), W = r.extend(T || {}, v);
309
+ W.date = W.date || /* @__PURE__ */ new Date(), W.compression !== null && (W.compression = W.compression.toUpperCase()), typeof W.unixPermissions == "string" && (W.unixPermissions = parseInt(W.unixPermissions, 8)), W.unixPermissions && 16384 & W.unixPermissions && (W.dir = !0), W.dosPermissions && 16 & W.dosPermissions && (W.dir = !0), W.dir && (C = c(C)), W.createFolders && (P = h(C)) && g.call(this, P, !0);
310
+ var V = O === "string" && W.binary === !1 && W.base64 === !1;
311
+ T && T.binary !== void 0 || (W.binary = !V), (D instanceof _ && D.uncompressedSize === 0 || W.dir || !D || D.length === 0) && (W.base64 = !1, W.binary = !0, D = "", W.compression = "STORE", O = "string");
312
+ var w = null;
313
+ w = D instanceof _ || D instanceof o ? D : p.isNode && p.isStream(D) ? new n(C, D) : r.prepareContent(C, D, W.binary, W.optimizedBinaryString, W.base64);
314
+ var R = new d(C, w, W);
315
+ this.files[C] = R;
316
+ }
317
+ var i = a("./utf8"), r = a("./utils"), o = a("./stream/GenericWorker"), b = a("./stream/StreamHelper"), v = a("./defaults"), _ = a("./compressedObject"), d = a("./zipObject"), s = a("./generate"), p = a("./nodejsUtils"), n = a("./nodejs/NodejsStreamInputAdapter"), h = function(C) {
318
+ C.slice(-1) === "/" && (C = C.substring(0, C.length - 1));
319
+ var D = C.lastIndexOf("/");
320
+ return 0 < D ? C.substring(0, D) : "";
321
+ }, c = function(C) {
322
+ return C.slice(-1) !== "/" && (C += "/"), C;
323
+ }, g = function(C, D) {
324
+ return D = D !== void 0 ? D : v.createFolders, C = c(C), this.files[C] || l.call(this, C, null, { dir: !0, createFolders: D }), this.files[C];
325
+ };
326
+ function x(C) {
327
+ return Object.prototype.toString.call(C) === "[object RegExp]";
328
+ }
329
+ var z = { load: function() {
330
+ throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
331
+ }, forEach: function(C) {
332
+ var D, T, P;
333
+ for (D in this.files) P = this.files[D], (T = D.slice(this.root.length, D.length)) && D.slice(0, this.root.length) === this.root && C(T, P);
334
+ }, filter: function(C) {
335
+ var D = [];
336
+ return this.forEach(function(T, P) {
337
+ C(T, P) && D.push(P);
338
+ }), D;
339
+ }, file: function(C, D, T) {
340
+ if (arguments.length !== 1) return C = this.root + C, l.call(this, C, D, T), this;
341
+ if (x(C)) {
342
+ var P = C;
343
+ return this.filter(function(W, V) {
344
+ return !V.dir && P.test(W);
345
+ });
346
+ }
347
+ var O = this.files[this.root + C];
348
+ return O && !O.dir ? O : null;
349
+ }, folder: function(C) {
350
+ if (!C) return this;
351
+ if (x(C)) return this.filter(function(O, W) {
352
+ return W.dir && C.test(O);
353
+ });
354
+ var D = this.root + C, T = g.call(this, D), P = this.clone();
355
+ return P.root = T.name, P;
356
+ }, remove: function(C) {
357
+ C = this.root + C;
358
+ var D = this.files[C];
359
+ if (D || (C.slice(-1) !== "/" && (C += "/"), D = this.files[C]), D && !D.dir) delete this.files[C];
360
+ else for (var T = this.filter(function(O, W) {
361
+ return W.name.slice(0, C.length) === C;
362
+ }), P = 0; P < T.length; P++) delete this.files[T[P].name];
363
+ return this;
364
+ }, generate: function() {
365
+ throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
366
+ }, generateInternalStream: function(C) {
367
+ var D, T = {};
368
+ try {
369
+ if ((T = r.extend(C || {}, { streamFiles: !1, compression: "STORE", compressionOptions: null, type: "", platform: "DOS", comment: null, mimeType: "application/zip", encodeFileName: i.utf8encode })).type = T.type.toLowerCase(), T.compression = T.compression.toUpperCase(), T.type === "binarystring" && (T.type = "string"), !T.type) throw new Error("No output type specified.");
370
+ r.checkSupport(T.type), T.platform !== "darwin" && T.platform !== "freebsd" && T.platform !== "linux" && T.platform !== "sunos" || (T.platform = "UNIX"), T.platform === "win32" && (T.platform = "DOS");
371
+ var P = T.comment || this.comment || "";
372
+ D = s.generateWorker(this, T, P);
373
+ } catch (O) {
374
+ (D = new o("error")).error(O);
375
+ }
376
+ return new b(D, T.type || "string", T.mimeType);
377
+ }, generateAsync: function(C, D) {
378
+ return this.generateInternalStream(C).accumulate(D);
379
+ }, generateNodeStream: function(C, D) {
380
+ return (C = C || {}).type || (C.type = "nodebuffer"), this.generateInternalStream(C).toNodejsStream(D);
381
+ } };
382
+ y.exports = z;
383
+ }, { "./compressedObject": 2, "./defaults": 5, "./generate": 9, "./nodejs/NodejsStreamInputAdapter": 12, "./nodejsUtils": 14, "./stream/GenericWorker": 28, "./stream/StreamHelper": 29, "./utf8": 31, "./utils": 32, "./zipObject": 35 }], 16: [function(a, y, m) {
384
+ y.exports = a("stream");
385
+ }, { stream: void 0 }], 17: [function(a, y, m) {
386
+ var l = a("./DataReader");
387
+ function i(r) {
388
+ l.call(this, r);
389
+ for (var o = 0; o < this.data.length; o++) r[o] = 255 & r[o];
390
+ }
391
+ a("../utils").inherits(i, l), i.prototype.byteAt = function(r) {
392
+ return this.data[this.zero + r];
393
+ }, i.prototype.lastIndexOfSignature = function(r) {
394
+ for (var o = r.charCodeAt(0), b = r.charCodeAt(1), v = r.charCodeAt(2), _ = r.charCodeAt(3), d = this.length - 4; 0 <= d; --d) if (this.data[d] === o && this.data[d + 1] === b && this.data[d + 2] === v && this.data[d + 3] === _) return d - this.zero;
395
+ return -1;
396
+ }, i.prototype.readAndCheckSignature = function(r) {
397
+ var o = r.charCodeAt(0), b = r.charCodeAt(1), v = r.charCodeAt(2), _ = r.charCodeAt(3), d = this.readData(4);
398
+ return o === d[0] && b === d[1] && v === d[2] && _ === d[3];
399
+ }, i.prototype.readData = function(r) {
400
+ if (this.checkOffset(r), r === 0) return [];
401
+ var o = this.data.slice(this.zero + this.index, this.zero + this.index + r);
402
+ return this.index += r, o;
403
+ }, y.exports = i;
404
+ }, { "../utils": 32, "./DataReader": 18 }], 18: [function(a, y, m) {
405
+ var l = a("../utils");
406
+ function i(r) {
407
+ this.data = r, this.length = r.length, this.index = 0, this.zero = 0;
408
+ }
409
+ i.prototype = { checkOffset: function(r) {
410
+ this.checkIndex(this.index + r);
411
+ }, checkIndex: function(r) {
412
+ if (this.length < this.zero + r || r < 0) throw new Error("End of data reached (data length = " + this.length + ", asked index = " + r + "). Corrupted zip ?");
413
+ }, setIndex: function(r) {
414
+ this.checkIndex(r), this.index = r;
415
+ }, skip: function(r) {
416
+ this.setIndex(this.index + r);
417
+ }, byteAt: function() {
418
+ }, readInt: function(r) {
419
+ var o, b = 0;
420
+ for (this.checkOffset(r), o = this.index + r - 1; o >= this.index; o--) b = (b << 8) + this.byteAt(o);
421
+ return this.index += r, b;
422
+ }, readString: function(r) {
423
+ return l.transformTo("string", this.readData(r));
424
+ }, readData: function() {
425
+ }, lastIndexOfSignature: function() {
426
+ }, readAndCheckSignature: function() {
427
+ }, readDate: function() {
428
+ var r = this.readInt(4);
429
+ return new Date(Date.UTC(1980 + (r >> 25 & 127), (r >> 21 & 15) - 1, r >> 16 & 31, r >> 11 & 31, r >> 5 & 63, (31 & r) << 1));
430
+ } }, y.exports = i;
431
+ }, { "../utils": 32 }], 19: [function(a, y, m) {
432
+ var l = a("./Uint8ArrayReader");
433
+ function i(r) {
434
+ l.call(this, r);
435
+ }
436
+ a("../utils").inherits(i, l), i.prototype.readData = function(r) {
437
+ this.checkOffset(r);
438
+ var o = this.data.slice(this.zero + this.index, this.zero + this.index + r);
439
+ return this.index += r, o;
440
+ }, y.exports = i;
441
+ }, { "../utils": 32, "./Uint8ArrayReader": 21 }], 20: [function(a, y, m) {
442
+ var l = a("./DataReader");
443
+ function i(r) {
444
+ l.call(this, r);
445
+ }
446
+ a("../utils").inherits(i, l), i.prototype.byteAt = function(r) {
447
+ return this.data.charCodeAt(this.zero + r);
448
+ }, i.prototype.lastIndexOfSignature = function(r) {
449
+ return this.data.lastIndexOf(r) - this.zero;
450
+ }, i.prototype.readAndCheckSignature = function(r) {
451
+ return r === this.readData(4);
452
+ }, i.prototype.readData = function(r) {
453
+ this.checkOffset(r);
454
+ var o = this.data.slice(this.zero + this.index, this.zero + this.index + r);
455
+ return this.index += r, o;
456
+ }, y.exports = i;
457
+ }, { "../utils": 32, "./DataReader": 18 }], 21: [function(a, y, m) {
458
+ var l = a("./ArrayReader");
459
+ function i(r) {
460
+ l.call(this, r);
461
+ }
462
+ a("../utils").inherits(i, l), i.prototype.readData = function(r) {
463
+ if (this.checkOffset(r), r === 0) return new Uint8Array(0);
464
+ var o = this.data.subarray(this.zero + this.index, this.zero + this.index + r);
465
+ return this.index += r, o;
466
+ }, y.exports = i;
467
+ }, { "../utils": 32, "./ArrayReader": 17 }], 22: [function(a, y, m) {
468
+ var l = a("../utils"), i = a("../support"), r = a("./ArrayReader"), o = a("./StringReader"), b = a("./NodeBufferReader"), v = a("./Uint8ArrayReader");
469
+ y.exports = function(_) {
470
+ var d = l.getTypeOf(_);
471
+ return l.checkSupport(d), d !== "string" || i.uint8array ? d === "nodebuffer" ? new b(_) : i.uint8array ? new v(l.transformTo("uint8array", _)) : new r(l.transformTo("array", _)) : new o(_);
472
+ };
473
+ }, { "../support": 30, "../utils": 32, "./ArrayReader": 17, "./NodeBufferReader": 19, "./StringReader": 20, "./Uint8ArrayReader": 21 }], 23: [function(a, y, m) {
474
+ m.LOCAL_FILE_HEADER = "PK", m.CENTRAL_FILE_HEADER = "PK", m.CENTRAL_DIRECTORY_END = "PK", m.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x07", m.ZIP64_CENTRAL_DIRECTORY_END = "PK", m.DATA_DESCRIPTOR = "PK\x07\b";
475
+ }, {}], 24: [function(a, y, m) {
476
+ var l = a("./GenericWorker"), i = a("../utils");
477
+ function r(o) {
478
+ l.call(this, "ConvertWorker to " + o), this.destType = o;
479
+ }
480
+ i.inherits(r, l), r.prototype.processChunk = function(o) {
481
+ this.push({ data: i.transformTo(this.destType, o.data), meta: o.meta });
482
+ }, y.exports = r;
483
+ }, { "../utils": 32, "./GenericWorker": 28 }], 25: [function(a, y, m) {
484
+ var l = a("./GenericWorker"), i = a("../crc32");
485
+ function r() {
486
+ l.call(this, "Crc32Probe"), this.withStreamInfo("crc32", 0);
487
+ }
488
+ a("../utils").inherits(r, l), r.prototype.processChunk = function(o) {
489
+ this.streamInfo.crc32 = i(o.data, this.streamInfo.crc32 || 0), this.push(o);
490
+ }, y.exports = r;
491
+ }, { "../crc32": 4, "../utils": 32, "./GenericWorker": 28 }], 26: [function(a, y, m) {
492
+ var l = a("../utils"), i = a("./GenericWorker");
493
+ function r(o) {
494
+ i.call(this, "DataLengthProbe for " + o), this.propName = o, this.withStreamInfo(o, 0);
495
+ }
496
+ l.inherits(r, i), r.prototype.processChunk = function(o) {
497
+ if (o) {
498
+ var b = this.streamInfo[this.propName] || 0;
499
+ this.streamInfo[this.propName] = b + o.data.length;
500
+ }
501
+ i.prototype.processChunk.call(this, o);
502
+ }, y.exports = r;
503
+ }, { "../utils": 32, "./GenericWorker": 28 }], 27: [function(a, y, m) {
504
+ var l = a("../utils"), i = a("./GenericWorker");
505
+ function r(o) {
506
+ i.call(this, "DataWorker");
507
+ var b = this;
508
+ this.dataIsReady = !1, this.index = 0, this.max = 0, this.data = null, this.type = "", this._tickScheduled = !1, o.then(function(v) {
509
+ b.dataIsReady = !0, b.data = v, b.max = v && v.length || 0, b.type = l.getTypeOf(v), b.isPaused || b._tickAndRepeat();
510
+ }, function(v) {
511
+ b.error(v);
512
+ });
513
+ }
514
+ l.inherits(r, i), r.prototype.cleanUp = function() {
515
+ i.prototype.cleanUp.call(this), this.data = null;
516
+ }, r.prototype.resume = function() {
517
+ return !!i.prototype.resume.call(this) && (!this._tickScheduled && this.dataIsReady && (this._tickScheduled = !0, l.delay(this._tickAndRepeat, [], this)), !0);
518
+ }, r.prototype._tickAndRepeat = function() {
519
+ this._tickScheduled = !1, this.isPaused || this.isFinished || (this._tick(), this.isFinished || (l.delay(this._tickAndRepeat, [], this), this._tickScheduled = !0));
520
+ }, r.prototype._tick = function() {
521
+ if (this.isPaused || this.isFinished) return !1;
522
+ var o = null, b = Math.min(this.max, this.index + 16384);
523
+ if (this.index >= this.max) return this.end();
524
+ switch (this.type) {
525
+ case "string":
526
+ o = this.data.substring(this.index, b);
527
+ break;
528
+ case "uint8array":
529
+ o = this.data.subarray(this.index, b);
530
+ break;
531
+ case "array":
532
+ case "nodebuffer":
533
+ o = this.data.slice(this.index, b);
534
+ }
535
+ return this.index = b, this.push({ data: o, meta: { percent: this.max ? this.index / this.max * 100 : 0 } });
536
+ }, y.exports = r;
537
+ }, { "../utils": 32, "./GenericWorker": 28 }], 28: [function(a, y, m) {
538
+ function l(i) {
539
+ this.name = i || "default", this.streamInfo = {}, this.generatedError = null, this.extraStreamInfo = {}, this.isPaused = !0, this.isFinished = !1, this.isLocked = !1, this._listeners = { data: [], end: [], error: [] }, this.previous = null;
540
+ }
541
+ l.prototype = { push: function(i) {
542
+ this.emit("data", i);
543
+ }, end: function() {
544
+ if (this.isFinished) return !1;
545
+ this.flush();
546
+ try {
547
+ this.emit("end"), this.cleanUp(), this.isFinished = !0;
548
+ } catch (i) {
549
+ this.emit("error", i);
550
+ }
551
+ return !0;
552
+ }, error: function(i) {
553
+ return !this.isFinished && (this.isPaused ? this.generatedError = i : (this.isFinished = !0, this.emit("error", i), this.previous && this.previous.error(i), this.cleanUp()), !0);
554
+ }, on: function(i, r) {
555
+ return this._listeners[i].push(r), this;
556
+ }, cleanUp: function() {
557
+ this.streamInfo = this.generatedError = this.extraStreamInfo = null, this._listeners = [];
558
+ }, emit: function(i, r) {
559
+ if (this._listeners[i]) for (var o = 0; o < this._listeners[i].length; o++) this._listeners[i][o].call(this, r);
560
+ }, pipe: function(i) {
561
+ return i.registerPrevious(this);
562
+ }, registerPrevious: function(i) {
563
+ if (this.isLocked) throw new Error("The stream '" + this + "' has already been used.");
564
+ this.streamInfo = i.streamInfo, this.mergeStreamInfo(), this.previous = i;
565
+ var r = this;
566
+ return i.on("data", function(o) {
567
+ r.processChunk(o);
568
+ }), i.on("end", function() {
569
+ r.end();
570
+ }), i.on("error", function(o) {
571
+ r.error(o);
572
+ }), this;
573
+ }, pause: function() {
574
+ return !this.isPaused && !this.isFinished && (this.isPaused = !0, this.previous && this.previous.pause(), !0);
575
+ }, resume: function() {
576
+ if (!this.isPaused || this.isFinished) return !1;
577
+ var i = this.isPaused = !1;
578
+ return this.generatedError && (this.error(this.generatedError), i = !0), this.previous && this.previous.resume(), !i;
579
+ }, flush: function() {
580
+ }, processChunk: function(i) {
581
+ this.push(i);
582
+ }, withStreamInfo: function(i, r) {
583
+ return this.extraStreamInfo[i] = r, this.mergeStreamInfo(), this;
584
+ }, mergeStreamInfo: function() {
585
+ for (var i in this.extraStreamInfo) Object.prototype.hasOwnProperty.call(this.extraStreamInfo, i) && (this.streamInfo[i] = this.extraStreamInfo[i]);
586
+ }, lock: function() {
587
+ if (this.isLocked) throw new Error("The stream '" + this + "' has already been used.");
588
+ this.isLocked = !0, this.previous && this.previous.lock();
589
+ }, toString: function() {
590
+ var i = "Worker " + this.name;
591
+ return this.previous ? this.previous + " -> " + i : i;
592
+ } }, y.exports = l;
593
+ }, {}], 29: [function(a, y, m) {
594
+ var l = a("../utils"), i = a("./ConvertWorker"), r = a("./GenericWorker"), o = a("../base64"), b = a("../support"), v = a("../external"), _ = null;
595
+ if (b.nodestream) try {
596
+ _ = a("../nodejs/NodejsStreamOutputAdapter");
597
+ } catch {
598
+ }
599
+ function d(p, n) {
600
+ return new v.Promise(function(h, c) {
601
+ var g = [], x = p._internalType, z = p._outputType, C = p._mimeType;
602
+ p.on("data", function(D, T) {
603
+ g.push(D), n && n(T);
604
+ }).on("error", function(D) {
605
+ g = [], c(D);
606
+ }).on("end", function() {
607
+ try {
608
+ var D = (function(T, P, O) {
609
+ switch (T) {
610
+ case "blob":
611
+ return l.newBlob(l.transformTo("arraybuffer", P), O);
612
+ case "base64":
613
+ return o.encode(P);
614
+ default:
615
+ return l.transformTo(T, P);
616
+ }
617
+ })(z, (function(T, P) {
618
+ var O, W = 0, V = null, w = 0;
619
+ for (O = 0; O < P.length; O++) w += P[O].length;
620
+ switch (T) {
621
+ case "string":
622
+ return P.join("");
623
+ case "array":
624
+ return Array.prototype.concat.apply([], P);
625
+ case "uint8array":
626
+ for (V = new Uint8Array(w), O = 0; O < P.length; O++) V.set(P[O], W), W += P[O].length;
627
+ return V;
628
+ case "nodebuffer":
629
+ return Buffer.concat(P);
630
+ default:
631
+ throw new Error("concat : unsupported type '" + T + "'");
632
+ }
633
+ })(x, g), C);
634
+ h(D);
635
+ } catch (T) {
636
+ c(T);
637
+ }
638
+ g = [];
639
+ }).resume();
640
+ });
641
+ }
642
+ function s(p, n, h) {
643
+ var c = n;
644
+ switch (n) {
645
+ case "blob":
646
+ case "arraybuffer":
647
+ c = "uint8array";
648
+ break;
649
+ case "base64":
650
+ c = "string";
651
+ }
652
+ try {
653
+ this._internalType = c, this._outputType = n, this._mimeType = h, l.checkSupport(c), this._worker = p.pipe(new i(c)), p.lock();
654
+ } catch (g) {
655
+ this._worker = new r("error"), this._worker.error(g);
656
+ }
657
+ }
658
+ s.prototype = { accumulate: function(p) {
659
+ return d(this, p);
660
+ }, on: function(p, n) {
661
+ var h = this;
662
+ return p === "data" ? this._worker.on(p, function(c) {
663
+ n.call(h, c.data, c.meta);
664
+ }) : this._worker.on(p, function() {
665
+ l.delay(n, arguments, h);
666
+ }), this;
667
+ }, resume: function() {
668
+ return l.delay(this._worker.resume, [], this._worker), this;
669
+ }, pause: function() {
670
+ return this._worker.pause(), this;
671
+ }, toNodejsStream: function(p) {
672
+ if (l.checkSupport("nodestream"), this._outputType !== "nodebuffer") throw new Error(this._outputType + " is not supported by this method");
673
+ return new _(this, { objectMode: this._outputType !== "nodebuffer" }, p);
674
+ } }, y.exports = s;
675
+ }, { "../base64": 1, "../external": 6, "../nodejs/NodejsStreamOutputAdapter": 13, "../support": 30, "../utils": 32, "./ConvertWorker": 24, "./GenericWorker": 28 }], 30: [function(a, y, m) {
676
+ if (m.base64 = !0, m.array = !0, m.string = !0, m.arraybuffer = typeof ArrayBuffer < "u" && typeof Uint8Array < "u", m.nodebuffer = typeof Buffer < "u", m.uint8array = typeof Uint8Array < "u", typeof ArrayBuffer > "u") m.blob = !1;
677
+ else {
678
+ var l = new ArrayBuffer(0);
679
+ try {
680
+ m.blob = new Blob([l], { type: "application/zip" }).size === 0;
681
+ } catch {
682
+ try {
683
+ var i = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)();
684
+ i.append(l), m.blob = i.getBlob("application/zip").size === 0;
685
+ } catch {
686
+ m.blob = !1;
687
+ }
688
+ }
689
+ }
690
+ try {
691
+ m.nodestream = !!a("readable-stream").Readable;
692
+ } catch {
693
+ m.nodestream = !1;
694
+ }
695
+ }, { "readable-stream": 16 }], 31: [function(a, y, m) {
696
+ for (var l = a("./utils"), i = a("./support"), r = a("./nodejsUtils"), o = a("./stream/GenericWorker"), b = new Array(256), v = 0; v < 256; v++) b[v] = 252 <= v ? 6 : 248 <= v ? 5 : 240 <= v ? 4 : 224 <= v ? 3 : 192 <= v ? 2 : 1;
697
+ b[254] = b[254] = 1;
698
+ function _() {
699
+ o.call(this, "utf-8 decode"), this.leftOver = null;
700
+ }
701
+ function d() {
702
+ o.call(this, "utf-8 encode");
703
+ }
704
+ m.utf8encode = function(s) {
705
+ return i.nodebuffer ? r.newBufferFrom(s, "utf-8") : (function(p) {
706
+ var n, h, c, g, x, z = p.length, C = 0;
707
+ for (g = 0; g < z; g++) (64512 & (h = p.charCodeAt(g))) == 55296 && g + 1 < z && (64512 & (c = p.charCodeAt(g + 1))) == 56320 && (h = 65536 + (h - 55296 << 10) + (c - 56320), g++), C += h < 128 ? 1 : h < 2048 ? 2 : h < 65536 ? 3 : 4;
708
+ for (n = i.uint8array ? new Uint8Array(C) : new Array(C), g = x = 0; x < C; g++) (64512 & (h = p.charCodeAt(g))) == 55296 && g + 1 < z && (64512 & (c = p.charCodeAt(g + 1))) == 56320 && (h = 65536 + (h - 55296 << 10) + (c - 56320), g++), h < 128 ? n[x++] = h : (h < 2048 ? n[x++] = 192 | h >>> 6 : (h < 65536 ? n[x++] = 224 | h >>> 12 : (n[x++] = 240 | h >>> 18, n[x++] = 128 | h >>> 12 & 63), n[x++] = 128 | h >>> 6 & 63), n[x++] = 128 | 63 & h);
709
+ return n;
710
+ })(s);
711
+ }, m.utf8decode = function(s) {
712
+ return i.nodebuffer ? l.transformTo("nodebuffer", s).toString("utf-8") : (function(p) {
713
+ var n, h, c, g, x = p.length, z = new Array(2 * x);
714
+ for (n = h = 0; n < x; ) if ((c = p[n++]) < 128) z[h++] = c;
715
+ else if (4 < (g = b[c])) z[h++] = 65533, n += g - 1;
716
+ else {
717
+ for (c &= g === 2 ? 31 : g === 3 ? 15 : 7; 1 < g && n < x; ) c = c << 6 | 63 & p[n++], g--;
718
+ 1 < g ? z[h++] = 65533 : c < 65536 ? z[h++] = c : (c -= 65536, z[h++] = 55296 | c >> 10 & 1023, z[h++] = 56320 | 1023 & c);
719
+ }
720
+ return z.length !== h && (z.subarray ? z = z.subarray(0, h) : z.length = h), l.applyFromCharCode(z);
721
+ })(s = l.transformTo(i.uint8array ? "uint8array" : "array", s));
722
+ }, l.inherits(_, o), _.prototype.processChunk = function(s) {
723
+ var p = l.transformTo(i.uint8array ? "uint8array" : "array", s.data);
724
+ if (this.leftOver && this.leftOver.length) {
725
+ if (i.uint8array) {
726
+ var n = p;
727
+ (p = new Uint8Array(n.length + this.leftOver.length)).set(this.leftOver, 0), p.set(n, this.leftOver.length);
728
+ } else p = this.leftOver.concat(p);
729
+ this.leftOver = null;
730
+ }
731
+ var h = (function(g, x) {
732
+ var z;
733
+ for ((x = x || g.length) > g.length && (x = g.length), z = x - 1; 0 <= z && (192 & g[z]) == 128; ) z--;
734
+ return z < 0 || z === 0 ? x : z + b[g[z]] > x ? z : x;
735
+ })(p), c = p;
736
+ h !== p.length && (i.uint8array ? (c = p.subarray(0, h), this.leftOver = p.subarray(h, p.length)) : (c = p.slice(0, h), this.leftOver = p.slice(h, p.length))), this.push({ data: m.utf8decode(c), meta: s.meta });
737
+ }, _.prototype.flush = function() {
738
+ this.leftOver && this.leftOver.length && (this.push({ data: m.utf8decode(this.leftOver), meta: {} }), this.leftOver = null);
739
+ }, m.Utf8DecodeWorker = _, l.inherits(d, o), d.prototype.processChunk = function(s) {
740
+ this.push({ data: m.utf8encode(s.data), meta: s.meta });
741
+ }, m.Utf8EncodeWorker = d;
742
+ }, { "./nodejsUtils": 14, "./stream/GenericWorker": 28, "./support": 30, "./utils": 32 }], 32: [function(a, y, m) {
743
+ var l = a("./support"), i = a("./base64"), r = a("./nodejsUtils"), o = a("./external");
744
+ function b(n) {
745
+ return n;
746
+ }
747
+ function v(n, h) {
748
+ for (var c = 0; c < n.length; ++c) h[c] = 255 & n.charCodeAt(c);
749
+ return h;
750
+ }
751
+ a("setimmediate"), m.newBlob = function(n, h) {
752
+ m.checkSupport("blob");
753
+ try {
754
+ return new Blob([n], { type: h });
755
+ } catch {
756
+ try {
757
+ var c = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)();
758
+ return c.append(n), c.getBlob(h);
759
+ } catch {
760
+ throw new Error("Bug : can't construct the Blob.");
761
+ }
762
+ }
763
+ };
764
+ var _ = { stringifyByChunk: function(n, h, c) {
765
+ var g = [], x = 0, z = n.length;
766
+ if (z <= c) return String.fromCharCode.apply(null, n);
767
+ for (; x < z; ) h === "array" || h === "nodebuffer" ? g.push(String.fromCharCode.apply(null, n.slice(x, Math.min(x + c, z)))) : g.push(String.fromCharCode.apply(null, n.subarray(x, Math.min(x + c, z)))), x += c;
768
+ return g.join("");
769
+ }, stringifyByChar: function(n) {
770
+ for (var h = "", c = 0; c < n.length; c++) h += String.fromCharCode(n[c]);
771
+ return h;
772
+ }, applyCanBeUsed: { uint8array: (function() {
773
+ try {
774
+ return l.uint8array && String.fromCharCode.apply(null, new Uint8Array(1)).length === 1;
775
+ } catch {
776
+ return !1;
777
+ }
778
+ })(), nodebuffer: (function() {
779
+ try {
780
+ return l.nodebuffer && String.fromCharCode.apply(null, r.allocBuffer(1)).length === 1;
781
+ } catch {
782
+ return !1;
783
+ }
784
+ })() } };
785
+ function d(n) {
786
+ var h = 65536, c = m.getTypeOf(n), g = !0;
787
+ if (c === "uint8array" ? g = _.applyCanBeUsed.uint8array : c === "nodebuffer" && (g = _.applyCanBeUsed.nodebuffer), g) for (; 1 < h; ) try {
788
+ return _.stringifyByChunk(n, c, h);
789
+ } catch {
790
+ h = Math.floor(h / 2);
791
+ }
792
+ return _.stringifyByChar(n);
793
+ }
794
+ function s(n, h) {
795
+ for (var c = 0; c < n.length; c++) h[c] = n[c];
796
+ return h;
797
+ }
798
+ m.applyFromCharCode = d;
799
+ var p = {};
800
+ p.string = { string: b, array: function(n) {
801
+ return v(n, new Array(n.length));
802
+ }, arraybuffer: function(n) {
803
+ return p.string.uint8array(n).buffer;
804
+ }, uint8array: function(n) {
805
+ return v(n, new Uint8Array(n.length));
806
+ }, nodebuffer: function(n) {
807
+ return v(n, r.allocBuffer(n.length));
808
+ } }, p.array = { string: d, array: b, arraybuffer: function(n) {
809
+ return new Uint8Array(n).buffer;
810
+ }, uint8array: function(n) {
811
+ return new Uint8Array(n);
812
+ }, nodebuffer: function(n) {
813
+ return r.newBufferFrom(n);
814
+ } }, p.arraybuffer = { string: function(n) {
815
+ return d(new Uint8Array(n));
816
+ }, array: function(n) {
817
+ return s(new Uint8Array(n), new Array(n.byteLength));
818
+ }, arraybuffer: b, uint8array: function(n) {
819
+ return new Uint8Array(n);
820
+ }, nodebuffer: function(n) {
821
+ return r.newBufferFrom(new Uint8Array(n));
822
+ } }, p.uint8array = { string: d, array: function(n) {
823
+ return s(n, new Array(n.length));
824
+ }, arraybuffer: function(n) {
825
+ return n.buffer;
826
+ }, uint8array: b, nodebuffer: function(n) {
827
+ return r.newBufferFrom(n);
828
+ } }, p.nodebuffer = { string: d, array: function(n) {
829
+ return s(n, new Array(n.length));
830
+ }, arraybuffer: function(n) {
831
+ return p.nodebuffer.uint8array(n).buffer;
832
+ }, uint8array: function(n) {
833
+ return s(n, new Uint8Array(n.length));
834
+ }, nodebuffer: b }, m.transformTo = function(n, h) {
835
+ if (h = h || "", !n) return h;
836
+ m.checkSupport(n);
837
+ var c = m.getTypeOf(h);
838
+ return p[c][n](h);
839
+ }, m.resolve = function(n) {
840
+ for (var h = n.split("/"), c = [], g = 0; g < h.length; g++) {
841
+ var x = h[g];
842
+ x === "." || x === "" && g !== 0 && g !== h.length - 1 || (x === ".." ? c.pop() : c.push(x));
843
+ }
844
+ return c.join("/");
845
+ }, m.getTypeOf = function(n) {
846
+ return typeof n == "string" ? "string" : Object.prototype.toString.call(n) === "[object Array]" ? "array" : l.nodebuffer && r.isBuffer(n) ? "nodebuffer" : l.uint8array && n instanceof Uint8Array ? "uint8array" : l.arraybuffer && n instanceof ArrayBuffer ? "arraybuffer" : void 0;
847
+ }, m.checkSupport = function(n) {
848
+ if (!l[n.toLowerCase()]) throw new Error(n + " is not supported by this platform");
849
+ }, m.MAX_VALUE_16BITS = 65535, m.MAX_VALUE_32BITS = -1, m.pretty = function(n) {
850
+ var h, c, g = "";
851
+ for (c = 0; c < (n || "").length; c++) g += "\\x" + ((h = n.charCodeAt(c)) < 16 ? "0" : "") + h.toString(16).toUpperCase();
852
+ return g;
853
+ }, m.delay = function(n, h, c) {
854
+ setImmediate(function() {
855
+ n.apply(c || null, h || []);
856
+ });
857
+ }, m.inherits = function(n, h) {
858
+ function c() {
859
+ }
860
+ c.prototype = h.prototype, n.prototype = new c();
861
+ }, m.extend = function() {
862
+ var n, h, c = {};
863
+ for (n = 0; n < arguments.length; n++) for (h in arguments[n]) Object.prototype.hasOwnProperty.call(arguments[n], h) && c[h] === void 0 && (c[h] = arguments[n][h]);
864
+ return c;
865
+ }, m.prepareContent = function(n, h, c, g, x) {
866
+ return o.Promise.resolve(h).then(function(z) {
867
+ return l.blob && (z instanceof Blob || ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(z)) !== -1) && typeof FileReader < "u" ? new o.Promise(function(C, D) {
868
+ var T = new FileReader();
869
+ T.onload = function(P) {
870
+ C(P.target.result);
871
+ }, T.onerror = function(P) {
872
+ D(P.target.error);
873
+ }, T.readAsArrayBuffer(z);
874
+ }) : z;
875
+ }).then(function(z) {
876
+ var C = m.getTypeOf(z);
877
+ return C ? (C === "arraybuffer" ? z = m.transformTo("uint8array", z) : C === "string" && (x ? z = i.decode(z) : c && g !== !0 && (z = (function(D) {
878
+ return v(D, l.uint8array ? new Uint8Array(D.length) : new Array(D.length));
879
+ })(z))), z) : o.Promise.reject(new Error("Can't read the data of '" + n + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));
880
+ });
881
+ };
882
+ }, { "./base64": 1, "./external": 6, "./nodejsUtils": 14, "./support": 30, setimmediate: 54 }], 33: [function(a, y, m) {
883
+ var l = a("./reader/readerFor"), i = a("./utils"), r = a("./signature"), o = a("./zipEntry"), b = a("./support");
884
+ function v(_) {
885
+ this.files = [], this.loadOptions = _;
886
+ }
887
+ v.prototype = { checkSignature: function(_) {
888
+ if (!this.reader.readAndCheckSignature(_)) {
889
+ this.reader.index -= 4;
890
+ var d = this.reader.readString(4);
891
+ throw new Error("Corrupted zip or bug: unexpected signature (" + i.pretty(d) + ", expected " + i.pretty(_) + ")");
892
+ }
893
+ }, isSignature: function(_, d) {
894
+ var s = this.reader.index;
895
+ this.reader.setIndex(_);
896
+ var p = this.reader.readString(4) === d;
897
+ return this.reader.setIndex(s), p;
898
+ }, readBlockEndOfCentral: function() {
899
+ this.diskNumber = this.reader.readInt(2), this.diskWithCentralDirStart = this.reader.readInt(2), this.centralDirRecordsOnThisDisk = this.reader.readInt(2), this.centralDirRecords = this.reader.readInt(2), this.centralDirSize = this.reader.readInt(4), this.centralDirOffset = this.reader.readInt(4), this.zipCommentLength = this.reader.readInt(2);
900
+ var _ = this.reader.readData(this.zipCommentLength), d = b.uint8array ? "uint8array" : "array", s = i.transformTo(d, _);
901
+ this.zipComment = this.loadOptions.decodeFileName(s);
902
+ }, readBlockZip64EndOfCentral: function() {
903
+ this.zip64EndOfCentralSize = this.reader.readInt(8), this.reader.skip(4), this.diskNumber = this.reader.readInt(4), this.diskWithCentralDirStart = this.reader.readInt(4), this.centralDirRecordsOnThisDisk = this.reader.readInt(8), this.centralDirRecords = this.reader.readInt(8), this.centralDirSize = this.reader.readInt(8), this.centralDirOffset = this.reader.readInt(8), this.zip64ExtensibleData = {};
904
+ for (var _, d, s, p = this.zip64EndOfCentralSize - 44; 0 < p; ) _ = this.reader.readInt(2), d = this.reader.readInt(4), s = this.reader.readData(d), this.zip64ExtensibleData[_] = { id: _, length: d, value: s };
905
+ }, readBlockZip64EndOfCentralLocator: function() {
906
+ if (this.diskWithZip64CentralDirStart = this.reader.readInt(4), this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8), this.disksCount = this.reader.readInt(4), 1 < this.disksCount) throw new Error("Multi-volumes zip are not supported");
907
+ }, readLocalFiles: function() {
908
+ var _, d;
909
+ for (_ = 0; _ < this.files.length; _++) d = this.files[_], this.reader.setIndex(d.localHeaderOffset), this.checkSignature(r.LOCAL_FILE_HEADER), d.readLocalPart(this.reader), d.handleUTF8(), d.processAttributes();
910
+ }, readCentralDir: function() {
911
+ var _;
912
+ for (this.reader.setIndex(this.centralDirOffset); this.reader.readAndCheckSignature(r.CENTRAL_FILE_HEADER); ) (_ = new o({ zip64: this.zip64 }, this.loadOptions)).readCentralPart(this.reader), this.files.push(_);
913
+ if (this.centralDirRecords !== this.files.length && this.centralDirRecords !== 0 && this.files.length === 0) throw new Error("Corrupted zip or bug: expected " + this.centralDirRecords + " records in central dir, got " + this.files.length);
914
+ }, readEndOfCentral: function() {
915
+ var _ = this.reader.lastIndexOfSignature(r.CENTRAL_DIRECTORY_END);
916
+ if (_ < 0) throw this.isSignature(0, r.LOCAL_FILE_HEADER) ? new Error("Corrupted zip: can't find end of central directory") : new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");
917
+ this.reader.setIndex(_);
918
+ var d = _;
919
+ if (this.checkSignature(r.CENTRAL_DIRECTORY_END), this.readBlockEndOfCentral(), this.diskNumber === i.MAX_VALUE_16BITS || this.diskWithCentralDirStart === i.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === i.MAX_VALUE_16BITS || this.centralDirRecords === i.MAX_VALUE_16BITS || this.centralDirSize === i.MAX_VALUE_32BITS || this.centralDirOffset === i.MAX_VALUE_32BITS) {
920
+ if (this.zip64 = !0, (_ = this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR)) < 0) throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");
921
+ if (this.reader.setIndex(_), this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_LOCATOR), this.readBlockZip64EndOfCentralLocator(), !this.isSignature(this.relativeOffsetEndOfZip64CentralDir, r.ZIP64_CENTRAL_DIRECTORY_END) && (this.relativeOffsetEndOfZip64CentralDir = this.reader.lastIndexOfSignature(r.ZIP64_CENTRAL_DIRECTORY_END), this.relativeOffsetEndOfZip64CentralDir < 0)) throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");
922
+ this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir), this.checkSignature(r.ZIP64_CENTRAL_DIRECTORY_END), this.readBlockZip64EndOfCentral();
923
+ }
924
+ var s = this.centralDirOffset + this.centralDirSize;
925
+ this.zip64 && (s += 20, s += 12 + this.zip64EndOfCentralSize);
926
+ var p = d - s;
927
+ if (0 < p) this.isSignature(d, r.CENTRAL_FILE_HEADER) || (this.reader.zero = p);
928
+ else if (p < 0) throw new Error("Corrupted zip: missing " + Math.abs(p) + " bytes.");
929
+ }, prepareReader: function(_) {
930
+ this.reader = l(_);
931
+ }, load: function(_) {
932
+ this.prepareReader(_), this.readEndOfCentral(), this.readCentralDir(), this.readLocalFiles();
933
+ } }, y.exports = v;
934
+ }, { "./reader/readerFor": 22, "./signature": 23, "./support": 30, "./utils": 32, "./zipEntry": 34 }], 34: [function(a, y, m) {
935
+ var l = a("./reader/readerFor"), i = a("./utils"), r = a("./compressedObject"), o = a("./crc32"), b = a("./utf8"), v = a("./compressions"), _ = a("./support");
936
+ function d(s, p) {
937
+ this.options = s, this.loadOptions = p;
938
+ }
939
+ d.prototype = { isEncrypted: function() {
940
+ return (1 & this.bitFlag) == 1;
941
+ }, useUTF8: function() {
942
+ return (2048 & this.bitFlag) == 2048;
943
+ }, readLocalPart: function(s) {
944
+ var p, n;
945
+ if (s.skip(22), this.fileNameLength = s.readInt(2), n = s.readInt(2), this.fileName = s.readData(this.fileNameLength), s.skip(n), this.compressedSize === -1 || this.uncompressedSize === -1) throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");
946
+ if ((p = (function(h) {
947
+ for (var c in v) if (Object.prototype.hasOwnProperty.call(v, c) && v[c].magic === h) return v[c];
948
+ return null;
949
+ })(this.compressionMethod)) === null) throw new Error("Corrupted zip : compression " + i.pretty(this.compressionMethod) + " unknown (inner file : " + i.transformTo("string", this.fileName) + ")");
950
+ this.decompressed = new r(this.compressedSize, this.uncompressedSize, this.crc32, p, s.readData(this.compressedSize));
951
+ }, readCentralPart: function(s) {
952
+ this.versionMadeBy = s.readInt(2), s.skip(2), this.bitFlag = s.readInt(2), this.compressionMethod = s.readString(2), this.date = s.readDate(), this.crc32 = s.readInt(4), this.compressedSize = s.readInt(4), this.uncompressedSize = s.readInt(4);
953
+ var p = s.readInt(2);
954
+ if (this.extraFieldsLength = s.readInt(2), this.fileCommentLength = s.readInt(2), this.diskNumberStart = s.readInt(2), this.internalFileAttributes = s.readInt(2), this.externalFileAttributes = s.readInt(4), this.localHeaderOffset = s.readInt(4), this.isEncrypted()) throw new Error("Encrypted zip are not supported");
955
+ s.skip(p), this.readExtraFields(s), this.parseZIP64ExtraField(s), this.fileComment = s.readData(this.fileCommentLength);
956
+ }, processAttributes: function() {
957
+ this.unixPermissions = null, this.dosPermissions = null;
958
+ var s = this.versionMadeBy >> 8;
959
+ this.dir = !!(16 & this.externalFileAttributes), s == 0 && (this.dosPermissions = 63 & this.externalFileAttributes), s == 3 && (this.unixPermissions = this.externalFileAttributes >> 16 & 65535), this.dir || this.fileNameStr.slice(-1) !== "/" || (this.dir = !0);
960
+ }, parseZIP64ExtraField: function() {
961
+ if (this.extraFields[1]) {
962
+ var s = l(this.extraFields[1].value);
963
+ this.uncompressedSize === i.MAX_VALUE_32BITS && (this.uncompressedSize = s.readInt(8)), this.compressedSize === i.MAX_VALUE_32BITS && (this.compressedSize = s.readInt(8)), this.localHeaderOffset === i.MAX_VALUE_32BITS && (this.localHeaderOffset = s.readInt(8)), this.diskNumberStart === i.MAX_VALUE_32BITS && (this.diskNumberStart = s.readInt(4));
964
+ }
965
+ }, readExtraFields: function(s) {
966
+ var p, n, h, c = s.index + this.extraFieldsLength;
967
+ for (this.extraFields || (this.extraFields = {}); s.index + 4 < c; ) p = s.readInt(2), n = s.readInt(2), h = s.readData(n), this.extraFields[p] = { id: p, length: n, value: h };
968
+ s.setIndex(c);
969
+ }, handleUTF8: function() {
970
+ var s = _.uint8array ? "uint8array" : "array";
971
+ if (this.useUTF8()) this.fileNameStr = b.utf8decode(this.fileName), this.fileCommentStr = b.utf8decode(this.fileComment);
972
+ else {
973
+ var p = this.findExtraFieldUnicodePath();
974
+ if (p !== null) this.fileNameStr = p;
975
+ else {
976
+ var n = i.transformTo(s, this.fileName);
977
+ this.fileNameStr = this.loadOptions.decodeFileName(n);
978
+ }
979
+ var h = this.findExtraFieldUnicodeComment();
980
+ if (h !== null) this.fileCommentStr = h;
981
+ else {
982
+ var c = i.transformTo(s, this.fileComment);
983
+ this.fileCommentStr = this.loadOptions.decodeFileName(c);
984
+ }
985
+ }
986
+ }, findExtraFieldUnicodePath: function() {
987
+ var s = this.extraFields[28789];
988
+ if (s) {
989
+ var p = l(s.value);
990
+ return p.readInt(1) !== 1 || o(this.fileName) !== p.readInt(4) ? null : b.utf8decode(p.readData(s.length - 5));
991
+ }
992
+ return null;
993
+ }, findExtraFieldUnicodeComment: function() {
994
+ var s = this.extraFields[25461];
995
+ if (s) {
996
+ var p = l(s.value);
997
+ return p.readInt(1) !== 1 || o(this.fileComment) !== p.readInt(4) ? null : b.utf8decode(p.readData(s.length - 5));
998
+ }
999
+ return null;
1000
+ } }, y.exports = d;
1001
+ }, { "./compressedObject": 2, "./compressions": 3, "./crc32": 4, "./reader/readerFor": 22, "./support": 30, "./utf8": 31, "./utils": 32 }], 35: [function(a, y, m) {
1002
+ function l(p, n, h) {
1003
+ this.name = p, this.dir = h.dir, this.date = h.date, this.comment = h.comment, this.unixPermissions = h.unixPermissions, this.dosPermissions = h.dosPermissions, this._data = n, this._dataBinary = h.binary, this.options = { compression: h.compression, compressionOptions: h.compressionOptions };
1004
+ }
1005
+ var i = a("./stream/StreamHelper"), r = a("./stream/DataWorker"), o = a("./utf8"), b = a("./compressedObject"), v = a("./stream/GenericWorker");
1006
+ l.prototype = { internalStream: function(p) {
1007
+ var n = null, h = "string";
1008
+ try {
1009
+ if (!p) throw new Error("No output type specified.");
1010
+ var c = (h = p.toLowerCase()) === "string" || h === "text";
1011
+ h !== "binarystring" && h !== "text" || (h = "string"), n = this._decompressWorker();
1012
+ var g = !this._dataBinary;
1013
+ g && !c && (n = n.pipe(new o.Utf8EncodeWorker())), !g && c && (n = n.pipe(new o.Utf8DecodeWorker()));
1014
+ } catch (x) {
1015
+ (n = new v("error")).error(x);
1016
+ }
1017
+ return new i(n, h, "");
1018
+ }, async: function(p, n) {
1019
+ return this.internalStream(p).accumulate(n);
1020
+ }, nodeStream: function(p, n) {
1021
+ return this.internalStream(p || "nodebuffer").toNodejsStream(n);
1022
+ }, _compressWorker: function(p, n) {
1023
+ if (this._data instanceof b && this._data.compression.magic === p.magic) return this._data.getCompressedWorker();
1024
+ var h = this._decompressWorker();
1025
+ return this._dataBinary || (h = h.pipe(new o.Utf8EncodeWorker())), b.createWorkerFrom(h, p, n);
1026
+ }, _decompressWorker: function() {
1027
+ return this._data instanceof b ? this._data.getContentWorker() : this._data instanceof v ? this._data : new r(this._data);
1028
+ } };
1029
+ for (var _ = ["asText", "asBinary", "asNodeBuffer", "asUint8Array", "asArrayBuffer"], d = function() {
1030
+ throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
1031
+ }, s = 0; s < _.length; s++) l.prototype[_[s]] = d;
1032
+ y.exports = l;
1033
+ }, { "./compressedObject": 2, "./stream/DataWorker": 27, "./stream/GenericWorker": 28, "./stream/StreamHelper": 29, "./utf8": 31 }], 36: [function(a, y, m) {
1034
+ (function(l) {
1035
+ var i, r, o = l.MutationObserver || l.WebKitMutationObserver;
1036
+ if (o) {
1037
+ var b = 0, v = new o(p), _ = l.document.createTextNode("");
1038
+ v.observe(_, { characterData: !0 }), i = function() {
1039
+ _.data = b = ++b % 2;
1040
+ };
1041
+ } else if (l.setImmediate || l.MessageChannel === void 0) i = "document" in l && "onreadystatechange" in l.document.createElement("script") ? function() {
1042
+ var n = l.document.createElement("script");
1043
+ n.onreadystatechange = function() {
1044
+ p(), n.onreadystatechange = null, n.parentNode.removeChild(n), n = null;
1045
+ }, l.document.documentElement.appendChild(n);
1046
+ } : function() {
1047
+ setTimeout(p, 0);
1048
+ };
1049
+ else {
1050
+ var d = new l.MessageChannel();
1051
+ d.port1.onmessage = p, i = function() {
1052
+ d.port2.postMessage(0);
1053
+ };
1054
+ }
1055
+ var s = [];
1056
+ function p() {
1057
+ var n, h;
1058
+ r = !0;
1059
+ for (var c = s.length; c; ) {
1060
+ for (h = s, s = [], n = -1; ++n < c; ) h[n]();
1061
+ c = s.length;
1062
+ }
1063
+ r = !1;
1064
+ }
1065
+ y.exports = function(n) {
1066
+ s.push(n) !== 1 || r || i();
1067
+ };
1068
+ }).call(this, typeof Tt < "u" ? Tt : typeof self < "u" ? self : typeof window < "u" ? window : {});
1069
+ }, {}], 37: [function(a, y, m) {
1070
+ var l = a("immediate");
1071
+ function i() {
1072
+ }
1073
+ var r = {}, o = ["REJECTED"], b = ["FULFILLED"], v = ["PENDING"];
1074
+ function _(c) {
1075
+ if (typeof c != "function") throw new TypeError("resolver must be a function");
1076
+ this.state = v, this.queue = [], this.outcome = void 0, c !== i && n(this, c);
1077
+ }
1078
+ function d(c, g, x) {
1079
+ this.promise = c, typeof g == "function" && (this.onFulfilled = g, this.callFulfilled = this.otherCallFulfilled), typeof x == "function" && (this.onRejected = x, this.callRejected = this.otherCallRejected);
1080
+ }
1081
+ function s(c, g, x) {
1082
+ l(function() {
1083
+ var z;
1084
+ try {
1085
+ z = g(x);
1086
+ } catch (C) {
1087
+ return r.reject(c, C);
1088
+ }
1089
+ z === c ? r.reject(c, new TypeError("Cannot resolve promise with itself")) : r.resolve(c, z);
1090
+ });
1091
+ }
1092
+ function p(c) {
1093
+ var g = c && c.then;
1094
+ if (c && (typeof c == "object" || typeof c == "function") && typeof g == "function") return function() {
1095
+ g.apply(c, arguments);
1096
+ };
1097
+ }
1098
+ function n(c, g) {
1099
+ var x = !1;
1100
+ function z(T) {
1101
+ x || (x = !0, r.reject(c, T));
1102
+ }
1103
+ function C(T) {
1104
+ x || (x = !0, r.resolve(c, T));
1105
+ }
1106
+ var D = h(function() {
1107
+ g(C, z);
1108
+ });
1109
+ D.status === "error" && z(D.value);
1110
+ }
1111
+ function h(c, g) {
1112
+ var x = {};
1113
+ try {
1114
+ x.value = c(g), x.status = "success";
1115
+ } catch (z) {
1116
+ x.status = "error", x.value = z;
1117
+ }
1118
+ return x;
1119
+ }
1120
+ (y.exports = _).prototype.finally = function(c) {
1121
+ if (typeof c != "function") return this;
1122
+ var g = this.constructor;
1123
+ return this.then(function(x) {
1124
+ return g.resolve(c()).then(function() {
1125
+ return x;
1126
+ });
1127
+ }, function(x) {
1128
+ return g.resolve(c()).then(function() {
1129
+ throw x;
1130
+ });
1131
+ });
1132
+ }, _.prototype.catch = function(c) {
1133
+ return this.then(null, c);
1134
+ }, _.prototype.then = function(c, g) {
1135
+ if (typeof c != "function" && this.state === b || typeof g != "function" && this.state === o) return this;
1136
+ var x = new this.constructor(i);
1137
+ return this.state !== v ? s(x, this.state === b ? c : g, this.outcome) : this.queue.push(new d(x, c, g)), x;
1138
+ }, d.prototype.callFulfilled = function(c) {
1139
+ r.resolve(this.promise, c);
1140
+ }, d.prototype.otherCallFulfilled = function(c) {
1141
+ s(this.promise, this.onFulfilled, c);
1142
+ }, d.prototype.callRejected = function(c) {
1143
+ r.reject(this.promise, c);
1144
+ }, d.prototype.otherCallRejected = function(c) {
1145
+ s(this.promise, this.onRejected, c);
1146
+ }, r.resolve = function(c, g) {
1147
+ var x = h(p, g);
1148
+ if (x.status === "error") return r.reject(c, x.value);
1149
+ var z = x.value;
1150
+ if (z) n(c, z);
1151
+ else {
1152
+ c.state = b, c.outcome = g;
1153
+ for (var C = -1, D = c.queue.length; ++C < D; ) c.queue[C].callFulfilled(g);
1154
+ }
1155
+ return c;
1156
+ }, r.reject = function(c, g) {
1157
+ c.state = o, c.outcome = g;
1158
+ for (var x = -1, z = c.queue.length; ++x < z; ) c.queue[x].callRejected(g);
1159
+ return c;
1160
+ }, _.resolve = function(c) {
1161
+ return c instanceof this ? c : r.resolve(new this(i), c);
1162
+ }, _.reject = function(c) {
1163
+ var g = new this(i);
1164
+ return r.reject(g, c);
1165
+ }, _.all = function(c) {
1166
+ var g = this;
1167
+ if (Object.prototype.toString.call(c) !== "[object Array]") return this.reject(new TypeError("must be an array"));
1168
+ var x = c.length, z = !1;
1169
+ if (!x) return this.resolve([]);
1170
+ for (var C = new Array(x), D = 0, T = -1, P = new this(i); ++T < x; ) O(c[T], T);
1171
+ return P;
1172
+ function O(W, V) {
1173
+ g.resolve(W).then(function(w) {
1174
+ C[V] = w, ++D !== x || z || (z = !0, r.resolve(P, C));
1175
+ }, function(w) {
1176
+ z || (z = !0, r.reject(P, w));
1177
+ });
1178
+ }
1179
+ }, _.race = function(c) {
1180
+ var g = this;
1181
+ if (Object.prototype.toString.call(c) !== "[object Array]") return this.reject(new TypeError("must be an array"));
1182
+ var x = c.length, z = !1;
1183
+ if (!x) return this.resolve([]);
1184
+ for (var C = -1, D = new this(i); ++C < x; ) T = c[C], g.resolve(T).then(function(P) {
1185
+ z || (z = !0, r.resolve(D, P));
1186
+ }, function(P) {
1187
+ z || (z = !0, r.reject(D, P));
1188
+ });
1189
+ var T;
1190
+ return D;
1191
+ };
1192
+ }, { immediate: 36 }], 38: [function(a, y, m) {
1193
+ var l = {};
1194
+ (0, a("./lib/utils/common").assign)(l, a("./lib/deflate"), a("./lib/inflate"), a("./lib/zlib/constants")), y.exports = l;
1195
+ }, { "./lib/deflate": 39, "./lib/inflate": 40, "./lib/utils/common": 41, "./lib/zlib/constants": 44 }], 39: [function(a, y, m) {
1196
+ var l = a("./zlib/deflate"), i = a("./utils/common"), r = a("./utils/strings"), o = a("./zlib/messages"), b = a("./zlib/zstream"), v = Object.prototype.toString, _ = 0, d = -1, s = 0, p = 8;
1197
+ function n(c) {
1198
+ if (!(this instanceof n)) return new n(c);
1199
+ this.options = i.assign({ level: d, method: p, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: s, to: "" }, c || {});
1200
+ var g = this.options;
1201
+ g.raw && 0 < g.windowBits ? g.windowBits = -g.windowBits : g.gzip && 0 < g.windowBits && g.windowBits < 16 && (g.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new b(), this.strm.avail_out = 0;
1202
+ var x = l.deflateInit2(this.strm, g.level, g.method, g.windowBits, g.memLevel, g.strategy);
1203
+ if (x !== _) throw new Error(o[x]);
1204
+ if (g.header && l.deflateSetHeader(this.strm, g.header), g.dictionary) {
1205
+ var z;
1206
+ if (z = typeof g.dictionary == "string" ? r.string2buf(g.dictionary) : v.call(g.dictionary) === "[object ArrayBuffer]" ? new Uint8Array(g.dictionary) : g.dictionary, (x = l.deflateSetDictionary(this.strm, z)) !== _) throw new Error(o[x]);
1207
+ this._dict_set = !0;
1208
+ }
1209
+ }
1210
+ function h(c, g) {
1211
+ var x = new n(g);
1212
+ if (x.push(c, !0), x.err) throw x.msg || o[x.err];
1213
+ return x.result;
1214
+ }
1215
+ n.prototype.push = function(c, g) {
1216
+ var x, z, C = this.strm, D = this.options.chunkSize;
1217
+ if (this.ended) return !1;
1218
+ z = g === ~~g ? g : g === !0 ? 4 : 0, typeof c == "string" ? C.input = r.string2buf(c) : v.call(c) === "[object ArrayBuffer]" ? C.input = new Uint8Array(c) : C.input = c, C.next_in = 0, C.avail_in = C.input.length;
1219
+ do {
1220
+ if (C.avail_out === 0 && (C.output = new i.Buf8(D), C.next_out = 0, C.avail_out = D), (x = l.deflate(C, z)) !== 1 && x !== _) return this.onEnd(x), !(this.ended = !0);
1221
+ C.avail_out !== 0 && (C.avail_in !== 0 || z !== 4 && z !== 2) || (this.options.to === "string" ? this.onData(r.buf2binstring(i.shrinkBuf(C.output, C.next_out))) : this.onData(i.shrinkBuf(C.output, C.next_out)));
1222
+ } while ((0 < C.avail_in || C.avail_out === 0) && x !== 1);
1223
+ return z === 4 ? (x = l.deflateEnd(this.strm), this.onEnd(x), this.ended = !0, x === _) : z !== 2 || (this.onEnd(_), !(C.avail_out = 0));
1224
+ }, n.prototype.onData = function(c) {
1225
+ this.chunks.push(c);
1226
+ }, n.prototype.onEnd = function(c) {
1227
+ c === _ && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = i.flattenChunks(this.chunks)), this.chunks = [], this.err = c, this.msg = this.strm.msg;
1228
+ }, m.Deflate = n, m.deflate = h, m.deflateRaw = function(c, g) {
1229
+ return (g = g || {}).raw = !0, h(c, g);
1230
+ }, m.gzip = function(c, g) {
1231
+ return (g = g || {}).gzip = !0, h(c, g);
1232
+ };
1233
+ }, { "./utils/common": 41, "./utils/strings": 42, "./zlib/deflate": 46, "./zlib/messages": 51, "./zlib/zstream": 53 }], 40: [function(a, y, m) {
1234
+ var l = a("./zlib/inflate"), i = a("./utils/common"), r = a("./utils/strings"), o = a("./zlib/constants"), b = a("./zlib/messages"), v = a("./zlib/zstream"), _ = a("./zlib/gzheader"), d = Object.prototype.toString;
1235
+ function s(n) {
1236
+ if (!(this instanceof s)) return new s(n);
1237
+ this.options = i.assign({ chunkSize: 16384, windowBits: 0, to: "" }, n || {});
1238
+ var h = this.options;
1239
+ h.raw && 0 <= h.windowBits && h.windowBits < 16 && (h.windowBits = -h.windowBits, h.windowBits === 0 && (h.windowBits = -15)), !(0 <= h.windowBits && h.windowBits < 16) || n && n.windowBits || (h.windowBits += 32), 15 < h.windowBits && h.windowBits < 48 && (15 & h.windowBits) == 0 && (h.windowBits |= 15), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new v(), this.strm.avail_out = 0;
1240
+ var c = l.inflateInit2(this.strm, h.windowBits);
1241
+ if (c !== o.Z_OK) throw new Error(b[c]);
1242
+ this.header = new _(), l.inflateGetHeader(this.strm, this.header);
1243
+ }
1244
+ function p(n, h) {
1245
+ var c = new s(h);
1246
+ if (c.push(n, !0), c.err) throw c.msg || b[c.err];
1247
+ return c.result;
1248
+ }
1249
+ s.prototype.push = function(n, h) {
1250
+ var c, g, x, z, C, D, T = this.strm, P = this.options.chunkSize, O = this.options.dictionary, W = !1;
1251
+ if (this.ended) return !1;
1252
+ g = h === ~~h ? h : h === !0 ? o.Z_FINISH : o.Z_NO_FLUSH, typeof n == "string" ? T.input = r.binstring2buf(n) : d.call(n) === "[object ArrayBuffer]" ? T.input = new Uint8Array(n) : T.input = n, T.next_in = 0, T.avail_in = T.input.length;
1253
+ do {
1254
+ if (T.avail_out === 0 && (T.output = new i.Buf8(P), T.next_out = 0, T.avail_out = P), (c = l.inflate(T, o.Z_NO_FLUSH)) === o.Z_NEED_DICT && O && (D = typeof O == "string" ? r.string2buf(O) : d.call(O) === "[object ArrayBuffer]" ? new Uint8Array(O) : O, c = l.inflateSetDictionary(this.strm, D)), c === o.Z_BUF_ERROR && W === !0 && (c = o.Z_OK, W = !1), c !== o.Z_STREAM_END && c !== o.Z_OK) return this.onEnd(c), !(this.ended = !0);
1255
+ T.next_out && (T.avail_out !== 0 && c !== o.Z_STREAM_END && (T.avail_in !== 0 || g !== o.Z_FINISH && g !== o.Z_SYNC_FLUSH) || (this.options.to === "string" ? (x = r.utf8border(T.output, T.next_out), z = T.next_out - x, C = r.buf2string(T.output, x), T.next_out = z, T.avail_out = P - z, z && i.arraySet(T.output, T.output, x, z, 0), this.onData(C)) : this.onData(i.shrinkBuf(T.output, T.next_out)))), T.avail_in === 0 && T.avail_out === 0 && (W = !0);
1256
+ } while ((0 < T.avail_in || T.avail_out === 0) && c !== o.Z_STREAM_END);
1257
+ return c === o.Z_STREAM_END && (g = o.Z_FINISH), g === o.Z_FINISH ? (c = l.inflateEnd(this.strm), this.onEnd(c), this.ended = !0, c === o.Z_OK) : g !== o.Z_SYNC_FLUSH || (this.onEnd(o.Z_OK), !(T.avail_out = 0));
1258
+ }, s.prototype.onData = function(n) {
1259
+ this.chunks.push(n);
1260
+ }, s.prototype.onEnd = function(n) {
1261
+ n === o.Z_OK && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = i.flattenChunks(this.chunks)), this.chunks = [], this.err = n, this.msg = this.strm.msg;
1262
+ }, m.Inflate = s, m.inflate = p, m.inflateRaw = function(n, h) {
1263
+ return (h = h || {}).raw = !0, p(n, h);
1264
+ }, m.ungzip = p;
1265
+ }, { "./utils/common": 41, "./utils/strings": 42, "./zlib/constants": 44, "./zlib/gzheader": 47, "./zlib/inflate": 49, "./zlib/messages": 51, "./zlib/zstream": 53 }], 41: [function(a, y, m) {
1266
+ var l = typeof Uint8Array < "u" && typeof Uint16Array < "u" && typeof Int32Array < "u";
1267
+ m.assign = function(o) {
1268
+ for (var b = Array.prototype.slice.call(arguments, 1); b.length; ) {
1269
+ var v = b.shift();
1270
+ if (v) {
1271
+ if (typeof v != "object") throw new TypeError(v + "must be non-object");
1272
+ for (var _ in v) v.hasOwnProperty(_) && (o[_] = v[_]);
1273
+ }
1274
+ }
1275
+ return o;
1276
+ }, m.shrinkBuf = function(o, b) {
1277
+ return o.length === b ? o : o.subarray ? o.subarray(0, b) : (o.length = b, o);
1278
+ };
1279
+ var i = { arraySet: function(o, b, v, _, d) {
1280
+ if (b.subarray && o.subarray) o.set(b.subarray(v, v + _), d);
1281
+ else for (var s = 0; s < _; s++) o[d + s] = b[v + s];
1282
+ }, flattenChunks: function(o) {
1283
+ var b, v, _, d, s, p;
1284
+ for (b = _ = 0, v = o.length; b < v; b++) _ += o[b].length;
1285
+ for (p = new Uint8Array(_), b = d = 0, v = o.length; b < v; b++) s = o[b], p.set(s, d), d += s.length;
1286
+ return p;
1287
+ } }, r = { arraySet: function(o, b, v, _, d) {
1288
+ for (var s = 0; s < _; s++) o[d + s] = b[v + s];
1289
+ }, flattenChunks: function(o) {
1290
+ return [].concat.apply([], o);
1291
+ } };
1292
+ m.setTyped = function(o) {
1293
+ o ? (m.Buf8 = Uint8Array, m.Buf16 = Uint16Array, m.Buf32 = Int32Array, m.assign(m, i)) : (m.Buf8 = Array, m.Buf16 = Array, m.Buf32 = Array, m.assign(m, r));
1294
+ }, m.setTyped(l);
1295
+ }, {}], 42: [function(a, y, m) {
1296
+ var l = a("./common"), i = !0, r = !0;
1297
+ try {
1298
+ String.fromCharCode.apply(null, [0]);
1299
+ } catch {
1300
+ i = !1;
1301
+ }
1302
+ try {
1303
+ String.fromCharCode.apply(null, new Uint8Array(1));
1304
+ } catch {
1305
+ r = !1;
1306
+ }
1307
+ for (var o = new l.Buf8(256), b = 0; b < 256; b++) o[b] = 252 <= b ? 6 : 248 <= b ? 5 : 240 <= b ? 4 : 224 <= b ? 3 : 192 <= b ? 2 : 1;
1308
+ function v(_, d) {
1309
+ if (d < 65537 && (_.subarray && r || !_.subarray && i)) return String.fromCharCode.apply(null, l.shrinkBuf(_, d));
1310
+ for (var s = "", p = 0; p < d; p++) s += String.fromCharCode(_[p]);
1311
+ return s;
1312
+ }
1313
+ o[254] = o[254] = 1, m.string2buf = function(_) {
1314
+ var d, s, p, n, h, c = _.length, g = 0;
1315
+ for (n = 0; n < c; n++) (64512 & (s = _.charCodeAt(n))) == 55296 && n + 1 < c && (64512 & (p = _.charCodeAt(n + 1))) == 56320 && (s = 65536 + (s - 55296 << 10) + (p - 56320), n++), g += s < 128 ? 1 : s < 2048 ? 2 : s < 65536 ? 3 : 4;
1316
+ for (d = new l.Buf8(g), n = h = 0; h < g; n++) (64512 & (s = _.charCodeAt(n))) == 55296 && n + 1 < c && (64512 & (p = _.charCodeAt(n + 1))) == 56320 && (s = 65536 + (s - 55296 << 10) + (p - 56320), n++), s < 128 ? d[h++] = s : (s < 2048 ? d[h++] = 192 | s >>> 6 : (s < 65536 ? d[h++] = 224 | s >>> 12 : (d[h++] = 240 | s >>> 18, d[h++] = 128 | s >>> 12 & 63), d[h++] = 128 | s >>> 6 & 63), d[h++] = 128 | 63 & s);
1317
+ return d;
1318
+ }, m.buf2binstring = function(_) {
1319
+ return v(_, _.length);
1320
+ }, m.binstring2buf = function(_) {
1321
+ for (var d = new l.Buf8(_.length), s = 0, p = d.length; s < p; s++) d[s] = _.charCodeAt(s);
1322
+ return d;
1323
+ }, m.buf2string = function(_, d) {
1324
+ var s, p, n, h, c = d || _.length, g = new Array(2 * c);
1325
+ for (s = p = 0; s < c; ) if ((n = _[s++]) < 128) g[p++] = n;
1326
+ else if (4 < (h = o[n])) g[p++] = 65533, s += h - 1;
1327
+ else {
1328
+ for (n &= h === 2 ? 31 : h === 3 ? 15 : 7; 1 < h && s < c; ) n = n << 6 | 63 & _[s++], h--;
1329
+ 1 < h ? g[p++] = 65533 : n < 65536 ? g[p++] = n : (n -= 65536, g[p++] = 55296 | n >> 10 & 1023, g[p++] = 56320 | 1023 & n);
1330
+ }
1331
+ return v(g, p);
1332
+ }, m.utf8border = function(_, d) {
1333
+ var s;
1334
+ for ((d = d || _.length) > _.length && (d = _.length), s = d - 1; 0 <= s && (192 & _[s]) == 128; ) s--;
1335
+ return s < 0 || s === 0 ? d : s + o[_[s]] > d ? s : d;
1336
+ };
1337
+ }, { "./common": 41 }], 43: [function(a, y, m) {
1338
+ y.exports = function(l, i, r, o) {
1339
+ for (var b = 65535 & l | 0, v = l >>> 16 & 65535 | 0, _ = 0; r !== 0; ) {
1340
+ for (r -= _ = 2e3 < r ? 2e3 : r; v = v + (b = b + i[o++] | 0) | 0, --_; ) ;
1341
+ b %= 65521, v %= 65521;
1342
+ }
1343
+ return b | v << 16 | 0;
1344
+ };
1345
+ }, {}], 44: [function(a, y, m) {
1346
+ y.exports = { Z_NO_FLUSH: 0, Z_PARTIAL_FLUSH: 1, Z_SYNC_FLUSH: 2, Z_FULL_FLUSH: 3, Z_FINISH: 4, Z_BLOCK: 5, Z_TREES: 6, Z_OK: 0, Z_STREAM_END: 1, Z_NEED_DICT: 2, Z_ERRNO: -1, Z_STREAM_ERROR: -2, Z_DATA_ERROR: -3, Z_BUF_ERROR: -5, Z_NO_COMPRESSION: 0, Z_BEST_SPEED: 1, Z_BEST_COMPRESSION: 9, Z_DEFAULT_COMPRESSION: -1, Z_FILTERED: 1, Z_HUFFMAN_ONLY: 2, Z_RLE: 3, Z_FIXED: 4, Z_DEFAULT_STRATEGY: 0, Z_BINARY: 0, Z_TEXT: 1, Z_UNKNOWN: 2, Z_DEFLATED: 8 };
1347
+ }, {}], 45: [function(a, y, m) {
1348
+ var l = (function() {
1349
+ for (var i, r = [], o = 0; o < 256; o++) {
1350
+ i = o;
1351
+ for (var b = 0; b < 8; b++) i = 1 & i ? 3988292384 ^ i >>> 1 : i >>> 1;
1352
+ r[o] = i;
1353
+ }
1354
+ return r;
1355
+ })();
1356
+ y.exports = function(i, r, o, b) {
1357
+ var v = l, _ = b + o;
1358
+ i ^= -1;
1359
+ for (var d = b; d < _; d++) i = i >>> 8 ^ v[255 & (i ^ r[d])];
1360
+ return -1 ^ i;
1361
+ };
1362
+ }, {}], 46: [function(a, y, m) {
1363
+ var l, i = a("../utils/common"), r = a("./trees"), o = a("./adler32"), b = a("./crc32"), v = a("./messages"), _ = 0, d = 4, s = 0, p = -2, n = -1, h = 4, c = 2, g = 8, x = 9, z = 286, C = 30, D = 19, T = 2 * z + 1, P = 15, O = 3, W = 258, V = W + O + 1, w = 42, R = 113, e = 1, N = 2, tt = 3, U = 4;
1364
+ function et(t, F) {
1365
+ return t.msg = v[F], F;
1366
+ }
1367
+ function X(t) {
1368
+ return (t << 1) - (4 < t ? 9 : 0);
1369
+ }
1370
+ function J(t) {
1371
+ for (var F = t.length; 0 <= --F; ) t[F] = 0;
1372
+ }
1373
+ function B(t) {
1374
+ var F = t.state, I = F.pending;
1375
+ I > t.avail_out && (I = t.avail_out), I !== 0 && (i.arraySet(t.output, F.pending_buf, F.pending_out, I, t.next_out), t.next_out += I, F.pending_out += I, t.total_out += I, t.avail_out -= I, F.pending -= I, F.pending === 0 && (F.pending_out = 0));
1376
+ }
1377
+ function A(t, F) {
1378
+ r._tr_flush_block(t, 0 <= t.block_start ? t.block_start : -1, t.strstart - t.block_start, F), t.block_start = t.strstart, B(t.strm);
1379
+ }
1380
+ function K(t, F) {
1381
+ t.pending_buf[t.pending++] = F;
1382
+ }
1383
+ function H(t, F) {
1384
+ t.pending_buf[t.pending++] = F >>> 8 & 255, t.pending_buf[t.pending++] = 255 & F;
1385
+ }
1386
+ function $(t, F) {
1387
+ var I, f, u = t.max_chain_length, S = t.strstart, L = t.prev_length, j = t.nice_match, E = t.strstart > t.w_size - V ? t.strstart - (t.w_size - V) : 0, Z = t.window, q = t.w_mask, Y = t.prev, Q = t.strstart + W, lt = Z[S + L - 1], st = Z[S + L];
1388
+ t.prev_length >= t.good_match && (u >>= 2), j > t.lookahead && (j = t.lookahead);
1389
+ do
1390
+ if (Z[(I = F) + L] === st && Z[I + L - 1] === lt && Z[I] === Z[S] && Z[++I] === Z[S + 1]) {
1391
+ S += 2, I++;
1392
+ do
1393
+ ;
1394
+ while (Z[++S] === Z[++I] && Z[++S] === Z[++I] && Z[++S] === Z[++I] && Z[++S] === Z[++I] && Z[++S] === Z[++I] && Z[++S] === Z[++I] && Z[++S] === Z[++I] && Z[++S] === Z[++I] && S < Q);
1395
+ if (f = W - (Q - S), S = Q - W, L < f) {
1396
+ if (t.match_start = F, j <= (L = f)) break;
1397
+ lt = Z[S + L - 1], st = Z[S + L];
1398
+ }
1399
+ }
1400
+ while ((F = Y[F & q]) > E && --u != 0);
1401
+ return L <= t.lookahead ? L : t.lookahead;
1402
+ }
1403
+ function ut(t) {
1404
+ var F, I, f, u, S, L, j, E, Z, q, Y = t.w_size;
1405
+ do {
1406
+ if (u = t.window_size - t.lookahead - t.strstart, t.strstart >= Y + (Y - V)) {
1407
+ for (i.arraySet(t.window, t.window, Y, Y, 0), t.match_start -= Y, t.strstart -= Y, t.block_start -= Y, F = I = t.hash_size; f = t.head[--F], t.head[F] = Y <= f ? f - Y : 0, --I; ) ;
1408
+ for (F = I = Y; f = t.prev[--F], t.prev[F] = Y <= f ? f - Y : 0, --I; ) ;
1409
+ u += Y;
1410
+ }
1411
+ if (t.strm.avail_in === 0) break;
1412
+ if (L = t.strm, j = t.window, E = t.strstart + t.lookahead, Z = u, q = void 0, q = L.avail_in, Z < q && (q = Z), I = q === 0 ? 0 : (L.avail_in -= q, i.arraySet(j, L.input, L.next_in, q, E), L.state.wrap === 1 ? L.adler = o(L.adler, j, q, E) : L.state.wrap === 2 && (L.adler = b(L.adler, j, q, E)), L.next_in += q, L.total_in += q, q), t.lookahead += I, t.lookahead + t.insert >= O) for (S = t.strstart - t.insert, t.ins_h = t.window[S], t.ins_h = (t.ins_h << t.hash_shift ^ t.window[S + 1]) & t.hash_mask; t.insert && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[S + O - 1]) & t.hash_mask, t.prev[S & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = S, S++, t.insert--, !(t.lookahead + t.insert < O)); ) ;
1413
+ } while (t.lookahead < V && t.strm.avail_in !== 0);
1414
+ }
1415
+ function ht(t, F) {
1416
+ for (var I, f; ; ) {
1417
+ if (t.lookahead < V) {
1418
+ if (ut(t), t.lookahead < V && F === _) return e;
1419
+ if (t.lookahead === 0) break;
1420
+ }
1421
+ if (I = 0, t.lookahead >= O && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + O - 1]) & t.hash_mask, I = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart), I !== 0 && t.strstart - I <= t.w_size - V && (t.match_length = $(t, I)), t.match_length >= O) if (f = r._tr_tally(t, t.strstart - t.match_start, t.match_length - O), t.lookahead -= t.match_length, t.match_length <= t.max_lazy_match && t.lookahead >= O) {
1422
+ for (t.match_length--; t.strstart++, t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + O - 1]) & t.hash_mask, I = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart, --t.match_length != 0; ) ;
1423
+ t.strstart++;
1424
+ } else t.strstart += t.match_length, t.match_length = 0, t.ins_h = t.window[t.strstart], t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + 1]) & t.hash_mask;
1425
+ else f = r._tr_tally(t, 0, t.window[t.strstart]), t.lookahead--, t.strstart++;
1426
+ if (f && (A(t, !1), t.strm.avail_out === 0)) return e;
1427
+ }
1428
+ return t.insert = t.strstart < O - 1 ? t.strstart : O - 1, F === d ? (A(t, !0), t.strm.avail_out === 0 ? tt : U) : t.last_lit && (A(t, !1), t.strm.avail_out === 0) ? e : N;
1429
+ }
1430
+ function rt(t, F) {
1431
+ for (var I, f, u; ; ) {
1432
+ if (t.lookahead < V) {
1433
+ if (ut(t), t.lookahead < V && F === _) return e;
1434
+ if (t.lookahead === 0) break;
1435
+ }
1436
+ if (I = 0, t.lookahead >= O && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + O - 1]) & t.hash_mask, I = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart), t.prev_length = t.match_length, t.prev_match = t.match_start, t.match_length = O - 1, I !== 0 && t.prev_length < t.max_lazy_match && t.strstart - I <= t.w_size - V && (t.match_length = $(t, I), t.match_length <= 5 && (t.strategy === 1 || t.match_length === O && 4096 < t.strstart - t.match_start) && (t.match_length = O - 1)), t.prev_length >= O && t.match_length <= t.prev_length) {
1437
+ for (u = t.strstart + t.lookahead - O, f = r._tr_tally(t, t.strstart - 1 - t.prev_match, t.prev_length - O), t.lookahead -= t.prev_length - 1, t.prev_length -= 2; ++t.strstart <= u && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + O - 1]) & t.hash_mask, I = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart), --t.prev_length != 0; ) ;
1438
+ if (t.match_available = 0, t.match_length = O - 1, t.strstart++, f && (A(t, !1), t.strm.avail_out === 0)) return e;
1439
+ } else if (t.match_available) {
1440
+ if ((f = r._tr_tally(t, 0, t.window[t.strstart - 1])) && A(t, !1), t.strstart++, t.lookahead--, t.strm.avail_out === 0) return e;
1441
+ } else t.match_available = 1, t.strstart++, t.lookahead--;
1442
+ }
1443
+ return t.match_available && (f = r._tr_tally(t, 0, t.window[t.strstart - 1]), t.match_available = 0), t.insert = t.strstart < O - 1 ? t.strstart : O - 1, F === d ? (A(t, !0), t.strm.avail_out === 0 ? tt : U) : t.last_lit && (A(t, !1), t.strm.avail_out === 0) ? e : N;
1444
+ }
1445
+ function nt(t, F, I, f, u) {
1446
+ this.good_length = t, this.max_lazy = F, this.nice_length = I, this.max_chain = f, this.func = u;
1447
+ }
1448
+ function ot() {
1449
+ this.strm = null, this.status = 0, this.pending_buf = null, this.pending_buf_size = 0, this.pending_out = 0, this.pending = 0, this.wrap = 0, this.gzhead = null, this.gzindex = 0, this.method = g, this.last_flush = -1, this.w_size = 0, this.w_bits = 0, this.w_mask = 0, this.window = null, this.window_size = 0, this.prev = null, this.head = null, this.ins_h = 0, this.hash_size = 0, this.hash_bits = 0, this.hash_mask = 0, this.hash_shift = 0, this.block_start = 0, this.match_length = 0, this.prev_match = 0, this.match_available = 0, this.strstart = 0, this.match_start = 0, this.lookahead = 0, this.prev_length = 0, this.max_chain_length = 0, this.max_lazy_match = 0, this.level = 0, this.strategy = 0, this.good_match = 0, this.nice_match = 0, this.dyn_ltree = new i.Buf16(2 * T), this.dyn_dtree = new i.Buf16(2 * (2 * C + 1)), this.bl_tree = new i.Buf16(2 * (2 * D + 1)), J(this.dyn_ltree), J(this.dyn_dtree), J(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new i.Buf16(P + 1), this.heap = new i.Buf16(2 * z + 1), J(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new i.Buf16(2 * z + 1), J(this.depth), this.l_buf = 0, this.lit_bufsize = 0, this.last_lit = 0, this.d_buf = 0, this.opt_len = 0, this.static_len = 0, this.matches = 0, this.insert = 0, this.bi_buf = 0, this.bi_valid = 0;
1450
+ }
1451
+ function at(t) {
1452
+ var F;
1453
+ return t && t.state ? (t.total_in = t.total_out = 0, t.data_type = c, (F = t.state).pending = 0, F.pending_out = 0, F.wrap < 0 && (F.wrap = -F.wrap), F.status = F.wrap ? w : R, t.adler = F.wrap === 2 ? 0 : 1, F.last_flush = _, r._tr_init(F), s) : et(t, p);
1454
+ }
1455
+ function it(t) {
1456
+ var F = at(t);
1457
+ return F === s && (function(I) {
1458
+ I.window_size = 2 * I.w_size, J(I.head), I.max_lazy_match = l[I.level].max_lazy, I.good_match = l[I.level].good_length, I.nice_match = l[I.level].nice_length, I.max_chain_length = l[I.level].max_chain, I.strstart = 0, I.block_start = 0, I.lookahead = 0, I.insert = 0, I.match_length = I.prev_length = O - 1, I.match_available = 0, I.ins_h = 0;
1459
+ })(t.state), F;
1460
+ }
1461
+ function G(t, F, I, f, u, S) {
1462
+ if (!t) return p;
1463
+ var L = 1;
1464
+ if (F === n && (F = 6), f < 0 ? (L = 0, f = -f) : 15 < f && (L = 2, f -= 16), u < 1 || x < u || I !== g || f < 8 || 15 < f || F < 0 || 9 < F || S < 0 || h < S) return et(t, p);
1465
+ f === 8 && (f = 9);
1466
+ var j = new ot();
1467
+ return (t.state = j).strm = t, j.wrap = L, j.gzhead = null, j.w_bits = f, j.w_size = 1 << j.w_bits, j.w_mask = j.w_size - 1, j.hash_bits = u + 7, j.hash_size = 1 << j.hash_bits, j.hash_mask = j.hash_size - 1, j.hash_shift = ~~((j.hash_bits + O - 1) / O), j.window = new i.Buf8(2 * j.w_size), j.head = new i.Buf16(j.hash_size), j.prev = new i.Buf16(j.w_size), j.lit_bufsize = 1 << u + 6, j.pending_buf_size = 4 * j.lit_bufsize, j.pending_buf = new i.Buf8(j.pending_buf_size), j.d_buf = 1 * j.lit_bufsize, j.l_buf = 3 * j.lit_bufsize, j.level = F, j.strategy = S, j.method = I, it(t);
1468
+ }
1469
+ l = [new nt(0, 0, 0, 0, function(t, F) {
1470
+ var I = 65535;
1471
+ for (I > t.pending_buf_size - 5 && (I = t.pending_buf_size - 5); ; ) {
1472
+ if (t.lookahead <= 1) {
1473
+ if (ut(t), t.lookahead === 0 && F === _) return e;
1474
+ if (t.lookahead === 0) break;
1475
+ }
1476
+ t.strstart += t.lookahead, t.lookahead = 0;
1477
+ var f = t.block_start + I;
1478
+ if ((t.strstart === 0 || t.strstart >= f) && (t.lookahead = t.strstart - f, t.strstart = f, A(t, !1), t.strm.avail_out === 0) || t.strstart - t.block_start >= t.w_size - V && (A(t, !1), t.strm.avail_out === 0)) return e;
1479
+ }
1480
+ return t.insert = 0, F === d ? (A(t, !0), t.strm.avail_out === 0 ? tt : U) : (t.strstart > t.block_start && (A(t, !1), t.strm.avail_out), e);
1481
+ }), new nt(4, 4, 8, 4, ht), new nt(4, 5, 16, 8, ht), new nt(4, 6, 32, 32, ht), new nt(4, 4, 16, 16, rt), new nt(8, 16, 32, 32, rt), new nt(8, 16, 128, 128, rt), new nt(8, 32, 128, 256, rt), new nt(32, 128, 258, 1024, rt), new nt(32, 258, 258, 4096, rt)], m.deflateInit = function(t, F) {
1482
+ return G(t, F, g, 15, 8, 0);
1483
+ }, m.deflateInit2 = G, m.deflateReset = it, m.deflateResetKeep = at, m.deflateSetHeader = function(t, F) {
1484
+ return t && t.state ? t.state.wrap !== 2 ? p : (t.state.gzhead = F, s) : p;
1485
+ }, m.deflate = function(t, F) {
1486
+ var I, f, u, S;
1487
+ if (!t || !t.state || 5 < F || F < 0) return t ? et(t, p) : p;
1488
+ if (f = t.state, !t.output || !t.input && t.avail_in !== 0 || f.status === 666 && F !== d) return et(t, t.avail_out === 0 ? -5 : p);
1489
+ if (f.strm = t, I = f.last_flush, f.last_flush = F, f.status === w) if (f.wrap === 2) t.adler = 0, K(f, 31), K(f, 139), K(f, 8), f.gzhead ? (K(f, (f.gzhead.text ? 1 : 0) + (f.gzhead.hcrc ? 2 : 0) + (f.gzhead.extra ? 4 : 0) + (f.gzhead.name ? 8 : 0) + (f.gzhead.comment ? 16 : 0)), K(f, 255 & f.gzhead.time), K(f, f.gzhead.time >> 8 & 255), K(f, f.gzhead.time >> 16 & 255), K(f, f.gzhead.time >> 24 & 255), K(f, f.level === 9 ? 2 : 2 <= f.strategy || f.level < 2 ? 4 : 0), K(f, 255 & f.gzhead.os), f.gzhead.extra && f.gzhead.extra.length && (K(f, 255 & f.gzhead.extra.length), K(f, f.gzhead.extra.length >> 8 & 255)), f.gzhead.hcrc && (t.adler = b(t.adler, f.pending_buf, f.pending, 0)), f.gzindex = 0, f.status = 69) : (K(f, 0), K(f, 0), K(f, 0), K(f, 0), K(f, 0), K(f, f.level === 9 ? 2 : 2 <= f.strategy || f.level < 2 ? 4 : 0), K(f, 3), f.status = R);
1490
+ else {
1491
+ var L = g + (f.w_bits - 8 << 4) << 8;
1492
+ L |= (2 <= f.strategy || f.level < 2 ? 0 : f.level < 6 ? 1 : f.level === 6 ? 2 : 3) << 6, f.strstart !== 0 && (L |= 32), L += 31 - L % 31, f.status = R, H(f, L), f.strstart !== 0 && (H(f, t.adler >>> 16), H(f, 65535 & t.adler)), t.adler = 1;
1493
+ }
1494
+ if (f.status === 69) if (f.gzhead.extra) {
1495
+ for (u = f.pending; f.gzindex < (65535 & f.gzhead.extra.length) && (f.pending !== f.pending_buf_size || (f.gzhead.hcrc && f.pending > u && (t.adler = b(t.adler, f.pending_buf, f.pending - u, u)), B(t), u = f.pending, f.pending !== f.pending_buf_size)); ) K(f, 255 & f.gzhead.extra[f.gzindex]), f.gzindex++;
1496
+ f.gzhead.hcrc && f.pending > u && (t.adler = b(t.adler, f.pending_buf, f.pending - u, u)), f.gzindex === f.gzhead.extra.length && (f.gzindex = 0, f.status = 73);
1497
+ } else f.status = 73;
1498
+ if (f.status === 73) if (f.gzhead.name) {
1499
+ u = f.pending;
1500
+ do {
1501
+ if (f.pending === f.pending_buf_size && (f.gzhead.hcrc && f.pending > u && (t.adler = b(t.adler, f.pending_buf, f.pending - u, u)), B(t), u = f.pending, f.pending === f.pending_buf_size)) {
1502
+ S = 1;
1503
+ break;
1504
+ }
1505
+ S = f.gzindex < f.gzhead.name.length ? 255 & f.gzhead.name.charCodeAt(f.gzindex++) : 0, K(f, S);
1506
+ } while (S !== 0);
1507
+ f.gzhead.hcrc && f.pending > u && (t.adler = b(t.adler, f.pending_buf, f.pending - u, u)), S === 0 && (f.gzindex = 0, f.status = 91);
1508
+ } else f.status = 91;
1509
+ if (f.status === 91) if (f.gzhead.comment) {
1510
+ u = f.pending;
1511
+ do {
1512
+ if (f.pending === f.pending_buf_size && (f.gzhead.hcrc && f.pending > u && (t.adler = b(t.adler, f.pending_buf, f.pending - u, u)), B(t), u = f.pending, f.pending === f.pending_buf_size)) {
1513
+ S = 1;
1514
+ break;
1515
+ }
1516
+ S = f.gzindex < f.gzhead.comment.length ? 255 & f.gzhead.comment.charCodeAt(f.gzindex++) : 0, K(f, S);
1517
+ } while (S !== 0);
1518
+ f.gzhead.hcrc && f.pending > u && (t.adler = b(t.adler, f.pending_buf, f.pending - u, u)), S === 0 && (f.status = 103);
1519
+ } else f.status = 103;
1520
+ if (f.status === 103 && (f.gzhead.hcrc ? (f.pending + 2 > f.pending_buf_size && B(t), f.pending + 2 <= f.pending_buf_size && (K(f, 255 & t.adler), K(f, t.adler >> 8 & 255), t.adler = 0, f.status = R)) : f.status = R), f.pending !== 0) {
1521
+ if (B(t), t.avail_out === 0) return f.last_flush = -1, s;
1522
+ } else if (t.avail_in === 0 && X(F) <= X(I) && F !== d) return et(t, -5);
1523
+ if (f.status === 666 && t.avail_in !== 0) return et(t, -5);
1524
+ if (t.avail_in !== 0 || f.lookahead !== 0 || F !== _ && f.status !== 666) {
1525
+ var j = f.strategy === 2 ? (function(E, Z) {
1526
+ for (var q; ; ) {
1527
+ if (E.lookahead === 0 && (ut(E), E.lookahead === 0)) {
1528
+ if (Z === _) return e;
1529
+ break;
1530
+ }
1531
+ if (E.match_length = 0, q = r._tr_tally(E, 0, E.window[E.strstart]), E.lookahead--, E.strstart++, q && (A(E, !1), E.strm.avail_out === 0)) return e;
1532
+ }
1533
+ return E.insert = 0, Z === d ? (A(E, !0), E.strm.avail_out === 0 ? tt : U) : E.last_lit && (A(E, !1), E.strm.avail_out === 0) ? e : N;
1534
+ })(f, F) : f.strategy === 3 ? (function(E, Z) {
1535
+ for (var q, Y, Q, lt, st = E.window; ; ) {
1536
+ if (E.lookahead <= W) {
1537
+ if (ut(E), E.lookahead <= W && Z === _) return e;
1538
+ if (E.lookahead === 0) break;
1539
+ }
1540
+ if (E.match_length = 0, E.lookahead >= O && 0 < E.strstart && (Y = st[Q = E.strstart - 1]) === st[++Q] && Y === st[++Q] && Y === st[++Q]) {
1541
+ lt = E.strstart + W;
1542
+ do
1543
+ ;
1544
+ while (Y === st[++Q] && Y === st[++Q] && Y === st[++Q] && Y === st[++Q] && Y === st[++Q] && Y === st[++Q] && Y === st[++Q] && Y === st[++Q] && Q < lt);
1545
+ E.match_length = W - (lt - Q), E.match_length > E.lookahead && (E.match_length = E.lookahead);
1546
+ }
1547
+ if (E.match_length >= O ? (q = r._tr_tally(E, 1, E.match_length - O), E.lookahead -= E.match_length, E.strstart += E.match_length, E.match_length = 0) : (q = r._tr_tally(E, 0, E.window[E.strstart]), E.lookahead--, E.strstart++), q && (A(E, !1), E.strm.avail_out === 0)) return e;
1548
+ }
1549
+ return E.insert = 0, Z === d ? (A(E, !0), E.strm.avail_out === 0 ? tt : U) : E.last_lit && (A(E, !1), E.strm.avail_out === 0) ? e : N;
1550
+ })(f, F) : l[f.level].func(f, F);
1551
+ if (j !== tt && j !== U || (f.status = 666), j === e || j === tt) return t.avail_out === 0 && (f.last_flush = -1), s;
1552
+ if (j === N && (F === 1 ? r._tr_align(f) : F !== 5 && (r._tr_stored_block(f, 0, 0, !1), F === 3 && (J(f.head), f.lookahead === 0 && (f.strstart = 0, f.block_start = 0, f.insert = 0))), B(t), t.avail_out === 0)) return f.last_flush = -1, s;
1553
+ }
1554
+ return F !== d ? s : f.wrap <= 0 ? 1 : (f.wrap === 2 ? (K(f, 255 & t.adler), K(f, t.adler >> 8 & 255), K(f, t.adler >> 16 & 255), K(f, t.adler >> 24 & 255), K(f, 255 & t.total_in), K(f, t.total_in >> 8 & 255), K(f, t.total_in >> 16 & 255), K(f, t.total_in >> 24 & 255)) : (H(f, t.adler >>> 16), H(f, 65535 & t.adler)), B(t), 0 < f.wrap && (f.wrap = -f.wrap), f.pending !== 0 ? s : 1);
1555
+ }, m.deflateEnd = function(t) {
1556
+ var F;
1557
+ return t && t.state ? (F = t.state.status) !== w && F !== 69 && F !== 73 && F !== 91 && F !== 103 && F !== R && F !== 666 ? et(t, p) : (t.state = null, F === R ? et(t, -3) : s) : p;
1558
+ }, m.deflateSetDictionary = function(t, F) {
1559
+ var I, f, u, S, L, j, E, Z, q = F.length;
1560
+ if (!t || !t.state || (S = (I = t.state).wrap) === 2 || S === 1 && I.status !== w || I.lookahead) return p;
1561
+ for (S === 1 && (t.adler = o(t.adler, F, q, 0)), I.wrap = 0, q >= I.w_size && (S === 0 && (J(I.head), I.strstart = 0, I.block_start = 0, I.insert = 0), Z = new i.Buf8(I.w_size), i.arraySet(Z, F, q - I.w_size, I.w_size, 0), F = Z, q = I.w_size), L = t.avail_in, j = t.next_in, E = t.input, t.avail_in = q, t.next_in = 0, t.input = F, ut(I); I.lookahead >= O; ) {
1562
+ for (f = I.strstart, u = I.lookahead - (O - 1); I.ins_h = (I.ins_h << I.hash_shift ^ I.window[f + O - 1]) & I.hash_mask, I.prev[f & I.w_mask] = I.head[I.ins_h], I.head[I.ins_h] = f, f++, --u; ) ;
1563
+ I.strstart = f, I.lookahead = O - 1, ut(I);
1564
+ }
1565
+ return I.strstart += I.lookahead, I.block_start = I.strstart, I.insert = I.lookahead, I.lookahead = 0, I.match_length = I.prev_length = O - 1, I.match_available = 0, t.next_in = j, t.input = E, t.avail_in = L, I.wrap = S, s;
1566
+ }, m.deflateInfo = "pako deflate (from Nodeca project)";
1567
+ }, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./messages": 51, "./trees": 52 }], 47: [function(a, y, m) {
1568
+ y.exports = function() {
1569
+ 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;
1570
+ };
1571
+ }, {}], 48: [function(a, y, m) {
1572
+ y.exports = function(l, i) {
1573
+ var r, o, b, v, _, d, s, p, n, h, c, g, x, z, C, D, T, P, O, W, V, w, R, e, N;
1574
+ r = l.state, o = l.next_in, e = l.input, b = o + (l.avail_in - 5), v = l.next_out, N = l.output, _ = v - (i - l.avail_out), d = v + (l.avail_out - 257), s = r.dmax, p = r.wsize, n = r.whave, h = r.wnext, c = r.window, g = r.hold, x = r.bits, z = r.lencode, C = r.distcode, D = (1 << r.lenbits) - 1, T = (1 << r.distbits) - 1;
1575
+ t: do {
1576
+ x < 15 && (g += e[o++] << x, x += 8, g += e[o++] << x, x += 8), P = z[g & D];
1577
+ e: for (; ; ) {
1578
+ if (g >>>= O = P >>> 24, x -= O, (O = P >>> 16 & 255) === 0) N[v++] = 65535 & P;
1579
+ else {
1580
+ if (!(16 & O)) {
1581
+ if ((64 & O) == 0) {
1582
+ P = z[(65535 & P) + (g & (1 << O) - 1)];
1583
+ continue e;
1584
+ }
1585
+ if (32 & O) {
1586
+ r.mode = 12;
1587
+ break t;
1588
+ }
1589
+ l.msg = "invalid literal/length code", r.mode = 30;
1590
+ break t;
1591
+ }
1592
+ W = 65535 & P, (O &= 15) && (x < O && (g += e[o++] << x, x += 8), W += g & (1 << O) - 1, g >>>= O, x -= O), x < 15 && (g += e[o++] << x, x += 8, g += e[o++] << x, x += 8), P = C[g & T];
1593
+ r: for (; ; ) {
1594
+ if (g >>>= O = P >>> 24, x -= O, !(16 & (O = P >>> 16 & 255))) {
1595
+ if ((64 & O) == 0) {
1596
+ P = C[(65535 & P) + (g & (1 << O) - 1)];
1597
+ continue r;
1598
+ }
1599
+ l.msg = "invalid distance code", r.mode = 30;
1600
+ break t;
1601
+ }
1602
+ if (V = 65535 & P, x < (O &= 15) && (g += e[o++] << x, (x += 8) < O && (g += e[o++] << x, x += 8)), s < (V += g & (1 << O) - 1)) {
1603
+ l.msg = "invalid distance too far back", r.mode = 30;
1604
+ break t;
1605
+ }
1606
+ if (g >>>= O, x -= O, (O = v - _) < V) {
1607
+ if (n < (O = V - O) && r.sane) {
1608
+ l.msg = "invalid distance too far back", r.mode = 30;
1609
+ break t;
1610
+ }
1611
+ if (R = c, (w = 0) === h) {
1612
+ if (w += p - O, O < W) {
1613
+ for (W -= O; N[v++] = c[w++], --O; ) ;
1614
+ w = v - V, R = N;
1615
+ }
1616
+ } else if (h < O) {
1617
+ if (w += p + h - O, (O -= h) < W) {
1618
+ for (W -= O; N[v++] = c[w++], --O; ) ;
1619
+ if (w = 0, h < W) {
1620
+ for (W -= O = h; N[v++] = c[w++], --O; ) ;
1621
+ w = v - V, R = N;
1622
+ }
1623
+ }
1624
+ } else if (w += h - O, O < W) {
1625
+ for (W -= O; N[v++] = c[w++], --O; ) ;
1626
+ w = v - V, R = N;
1627
+ }
1628
+ for (; 2 < W; ) N[v++] = R[w++], N[v++] = R[w++], N[v++] = R[w++], W -= 3;
1629
+ W && (N[v++] = R[w++], 1 < W && (N[v++] = R[w++]));
1630
+ } else {
1631
+ for (w = v - V; N[v++] = N[w++], N[v++] = N[w++], N[v++] = N[w++], 2 < (W -= 3); ) ;
1632
+ W && (N[v++] = N[w++], 1 < W && (N[v++] = N[w++]));
1633
+ }
1634
+ break;
1635
+ }
1636
+ }
1637
+ break;
1638
+ }
1639
+ } while (o < b && v < d);
1640
+ o -= W = x >> 3, g &= (1 << (x -= W << 3)) - 1, l.next_in = o, l.next_out = v, l.avail_in = o < b ? b - o + 5 : 5 - (o - b), l.avail_out = v < d ? d - v + 257 : 257 - (v - d), r.hold = g, r.bits = x;
1641
+ };
1642
+ }, {}], 49: [function(a, y, m) {
1643
+ var l = a("../utils/common"), i = a("./adler32"), r = a("./crc32"), o = a("./inffast"), b = a("./inftrees"), v = 1, _ = 2, d = 0, s = -2, p = 1, n = 852, h = 592;
1644
+ function c(w) {
1645
+ return (w >>> 24 & 255) + (w >>> 8 & 65280) + ((65280 & w) << 8) + ((255 & w) << 24);
1646
+ }
1647
+ function g() {
1648
+ 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 l.Buf16(320), this.work = new l.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
1649
+ }
1650
+ function x(w) {
1651
+ var R;
1652
+ return w && w.state ? (R = w.state, w.total_in = w.total_out = R.total = 0, w.msg = "", R.wrap && (w.adler = 1 & R.wrap), R.mode = p, R.last = 0, R.havedict = 0, R.dmax = 32768, R.head = null, R.hold = 0, R.bits = 0, R.lencode = R.lendyn = new l.Buf32(n), R.distcode = R.distdyn = new l.Buf32(h), R.sane = 1, R.back = -1, d) : s;
1653
+ }
1654
+ function z(w) {
1655
+ var R;
1656
+ return w && w.state ? ((R = w.state).wsize = 0, R.whave = 0, R.wnext = 0, x(w)) : s;
1657
+ }
1658
+ function C(w, R) {
1659
+ var e, N;
1660
+ return w && w.state ? (N = w.state, R < 0 ? (e = 0, R = -R) : (e = 1 + (R >> 4), R < 48 && (R &= 15)), R && (R < 8 || 15 < R) ? s : (N.window !== null && N.wbits !== R && (N.window = null), N.wrap = e, N.wbits = R, z(w))) : s;
1661
+ }
1662
+ function D(w, R) {
1663
+ var e, N;
1664
+ return w ? (N = new g(), (w.state = N).window = null, (e = C(w, R)) !== d && (w.state = null), e) : s;
1665
+ }
1666
+ var T, P, O = !0;
1667
+ function W(w) {
1668
+ if (O) {
1669
+ var R;
1670
+ for (T = new l.Buf32(512), P = new l.Buf32(32), R = 0; R < 144; ) w.lens[R++] = 8;
1671
+ for (; R < 256; ) w.lens[R++] = 9;
1672
+ for (; R < 280; ) w.lens[R++] = 7;
1673
+ for (; R < 288; ) w.lens[R++] = 8;
1674
+ for (b(v, w.lens, 0, 288, T, 0, w.work, { bits: 9 }), R = 0; R < 32; ) w.lens[R++] = 5;
1675
+ b(_, w.lens, 0, 32, P, 0, w.work, { bits: 5 }), O = !1;
1676
+ }
1677
+ w.lencode = T, w.lenbits = 9, w.distcode = P, w.distbits = 5;
1678
+ }
1679
+ function V(w, R, e, N) {
1680
+ var tt, U = w.state;
1681
+ return U.window === null && (U.wsize = 1 << U.wbits, U.wnext = 0, U.whave = 0, U.window = new l.Buf8(U.wsize)), N >= U.wsize ? (l.arraySet(U.window, R, e - U.wsize, U.wsize, 0), U.wnext = 0, U.whave = U.wsize) : (N < (tt = U.wsize - U.wnext) && (tt = N), l.arraySet(U.window, R, e - N, tt, U.wnext), (N -= tt) ? (l.arraySet(U.window, R, e - N, N, 0), U.wnext = N, U.whave = U.wsize) : (U.wnext += tt, U.wnext === U.wsize && (U.wnext = 0), U.whave < U.wsize && (U.whave += tt))), 0;
1682
+ }
1683
+ m.inflateReset = z, m.inflateReset2 = C, m.inflateResetKeep = x, m.inflateInit = function(w) {
1684
+ return D(w, 15);
1685
+ }, m.inflateInit2 = D, m.inflate = function(w, R) {
1686
+ var e, N, tt, U, et, X, J, B, A, K, H, $, ut, ht, rt, nt, ot, at, it, G, t, F, I, f, u = 0, S = new l.Buf8(4), L = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
1687
+ if (!w || !w.state || !w.output || !w.input && w.avail_in !== 0) return s;
1688
+ (e = w.state).mode === 12 && (e.mode = 13), et = w.next_out, tt = w.output, J = w.avail_out, U = w.next_in, N = w.input, X = w.avail_in, B = e.hold, A = e.bits, K = X, H = J, F = d;
1689
+ t: for (; ; ) switch (e.mode) {
1690
+ case p:
1691
+ if (e.wrap === 0) {
1692
+ e.mode = 13;
1693
+ break;
1694
+ }
1695
+ for (; A < 16; ) {
1696
+ if (X === 0) break t;
1697
+ X--, B += N[U++] << A, A += 8;
1698
+ }
1699
+ if (2 & e.wrap && B === 35615) {
1700
+ S[e.check = 0] = 255 & B, S[1] = B >>> 8 & 255, e.check = r(e.check, S, 2, 0), A = B = 0, e.mode = 2;
1701
+ break;
1702
+ }
1703
+ if (e.flags = 0, e.head && (e.head.done = !1), !(1 & e.wrap) || (((255 & B) << 8) + (B >> 8)) % 31) {
1704
+ w.msg = "incorrect header check", e.mode = 30;
1705
+ break;
1706
+ }
1707
+ if ((15 & B) != 8) {
1708
+ w.msg = "unknown compression method", e.mode = 30;
1709
+ break;
1710
+ }
1711
+ if (A -= 4, t = 8 + (15 & (B >>>= 4)), e.wbits === 0) e.wbits = t;
1712
+ else if (t > e.wbits) {
1713
+ w.msg = "invalid window size", e.mode = 30;
1714
+ break;
1715
+ }
1716
+ e.dmax = 1 << t, w.adler = e.check = 1, e.mode = 512 & B ? 10 : 12, A = B = 0;
1717
+ break;
1718
+ case 2:
1719
+ for (; A < 16; ) {
1720
+ if (X === 0) break t;
1721
+ X--, B += N[U++] << A, A += 8;
1722
+ }
1723
+ if (e.flags = B, (255 & e.flags) != 8) {
1724
+ w.msg = "unknown compression method", e.mode = 30;
1725
+ break;
1726
+ }
1727
+ if (57344 & e.flags) {
1728
+ w.msg = "unknown header flags set", e.mode = 30;
1729
+ break;
1730
+ }
1731
+ e.head && (e.head.text = B >> 8 & 1), 512 & e.flags && (S[0] = 255 & B, S[1] = B >>> 8 & 255, e.check = r(e.check, S, 2, 0)), A = B = 0, e.mode = 3;
1732
+ case 3:
1733
+ for (; A < 32; ) {
1734
+ if (X === 0) break t;
1735
+ X--, B += N[U++] << A, A += 8;
1736
+ }
1737
+ e.head && (e.head.time = B), 512 & e.flags && (S[0] = 255 & B, S[1] = B >>> 8 & 255, S[2] = B >>> 16 & 255, S[3] = B >>> 24 & 255, e.check = r(e.check, S, 4, 0)), A = B = 0, e.mode = 4;
1738
+ case 4:
1739
+ for (; A < 16; ) {
1740
+ if (X === 0) break t;
1741
+ X--, B += N[U++] << A, A += 8;
1742
+ }
1743
+ e.head && (e.head.xflags = 255 & B, e.head.os = B >> 8), 512 & e.flags && (S[0] = 255 & B, S[1] = B >>> 8 & 255, e.check = r(e.check, S, 2, 0)), A = B = 0, e.mode = 5;
1744
+ case 5:
1745
+ if (1024 & e.flags) {
1746
+ for (; A < 16; ) {
1747
+ if (X === 0) break t;
1748
+ X--, B += N[U++] << A, A += 8;
1749
+ }
1750
+ e.length = B, e.head && (e.head.extra_len = B), 512 & e.flags && (S[0] = 255 & B, S[1] = B >>> 8 & 255, e.check = r(e.check, S, 2, 0)), A = B = 0;
1751
+ } else e.head && (e.head.extra = null);
1752
+ e.mode = 6;
1753
+ case 6:
1754
+ if (1024 & e.flags && (X < ($ = e.length) && ($ = X), $ && (e.head && (t = e.head.extra_len - e.length, e.head.extra || (e.head.extra = new Array(e.head.extra_len)), l.arraySet(e.head.extra, N, U, $, t)), 512 & e.flags && (e.check = r(e.check, N, $, U)), X -= $, U += $, e.length -= $), e.length)) break t;
1755
+ e.length = 0, e.mode = 7;
1756
+ case 7:
1757
+ if (2048 & e.flags) {
1758
+ if (X === 0) break t;
1759
+ for ($ = 0; t = N[U + $++], e.head && t && e.length < 65536 && (e.head.name += String.fromCharCode(t)), t && $ < X; ) ;
1760
+ if (512 & e.flags && (e.check = r(e.check, N, $, U)), X -= $, U += $, t) break t;
1761
+ } else e.head && (e.head.name = null);
1762
+ e.length = 0, e.mode = 8;
1763
+ case 8:
1764
+ if (4096 & e.flags) {
1765
+ if (X === 0) break t;
1766
+ for ($ = 0; t = N[U + $++], e.head && t && e.length < 65536 && (e.head.comment += String.fromCharCode(t)), t && $ < X; ) ;
1767
+ if (512 & e.flags && (e.check = r(e.check, N, $, U)), X -= $, U += $, t) break t;
1768
+ } else e.head && (e.head.comment = null);
1769
+ e.mode = 9;
1770
+ case 9:
1771
+ if (512 & e.flags) {
1772
+ for (; A < 16; ) {
1773
+ if (X === 0) break t;
1774
+ X--, B += N[U++] << A, A += 8;
1775
+ }
1776
+ if (B !== (65535 & e.check)) {
1777
+ w.msg = "header crc mismatch", e.mode = 30;
1778
+ break;
1779
+ }
1780
+ A = B = 0;
1781
+ }
1782
+ e.head && (e.head.hcrc = e.flags >> 9 & 1, e.head.done = !0), w.adler = e.check = 0, e.mode = 12;
1783
+ break;
1784
+ case 10:
1785
+ for (; A < 32; ) {
1786
+ if (X === 0) break t;
1787
+ X--, B += N[U++] << A, A += 8;
1788
+ }
1789
+ w.adler = e.check = c(B), A = B = 0, e.mode = 11;
1790
+ case 11:
1791
+ if (e.havedict === 0) return w.next_out = et, w.avail_out = J, w.next_in = U, w.avail_in = X, e.hold = B, e.bits = A, 2;
1792
+ w.adler = e.check = 1, e.mode = 12;
1793
+ case 12:
1794
+ if (R === 5 || R === 6) break t;
1795
+ case 13:
1796
+ if (e.last) {
1797
+ B >>>= 7 & A, A -= 7 & A, e.mode = 27;
1798
+ break;
1799
+ }
1800
+ for (; A < 3; ) {
1801
+ if (X === 0) break t;
1802
+ X--, B += N[U++] << A, A += 8;
1803
+ }
1804
+ switch (e.last = 1 & B, A -= 1, 3 & (B >>>= 1)) {
1805
+ case 0:
1806
+ e.mode = 14;
1807
+ break;
1808
+ case 1:
1809
+ if (W(e), e.mode = 20, R !== 6) break;
1810
+ B >>>= 2, A -= 2;
1811
+ break t;
1812
+ case 2:
1813
+ e.mode = 17;
1814
+ break;
1815
+ case 3:
1816
+ w.msg = "invalid block type", e.mode = 30;
1817
+ }
1818
+ B >>>= 2, A -= 2;
1819
+ break;
1820
+ case 14:
1821
+ for (B >>>= 7 & A, A -= 7 & A; A < 32; ) {
1822
+ if (X === 0) break t;
1823
+ X--, B += N[U++] << A, A += 8;
1824
+ }
1825
+ if ((65535 & B) != (B >>> 16 ^ 65535)) {
1826
+ w.msg = "invalid stored block lengths", e.mode = 30;
1827
+ break;
1828
+ }
1829
+ if (e.length = 65535 & B, A = B = 0, e.mode = 15, R === 6) break t;
1830
+ case 15:
1831
+ e.mode = 16;
1832
+ case 16:
1833
+ if ($ = e.length) {
1834
+ if (X < $ && ($ = X), J < $ && ($ = J), $ === 0) break t;
1835
+ l.arraySet(tt, N, U, $, et), X -= $, U += $, J -= $, et += $, e.length -= $;
1836
+ break;
1837
+ }
1838
+ e.mode = 12;
1839
+ break;
1840
+ case 17:
1841
+ for (; A < 14; ) {
1842
+ if (X === 0) break t;
1843
+ X--, B += N[U++] << A, A += 8;
1844
+ }
1845
+ if (e.nlen = 257 + (31 & B), B >>>= 5, A -= 5, e.ndist = 1 + (31 & B), B >>>= 5, A -= 5, e.ncode = 4 + (15 & B), B >>>= 4, A -= 4, 286 < e.nlen || 30 < e.ndist) {
1846
+ w.msg = "too many length or distance symbols", e.mode = 30;
1847
+ break;
1848
+ }
1849
+ e.have = 0, e.mode = 18;
1850
+ case 18:
1851
+ for (; e.have < e.ncode; ) {
1852
+ for (; A < 3; ) {
1853
+ if (X === 0) break t;
1854
+ X--, B += N[U++] << A, A += 8;
1855
+ }
1856
+ e.lens[L[e.have++]] = 7 & B, B >>>= 3, A -= 3;
1857
+ }
1858
+ for (; e.have < 19; ) e.lens[L[e.have++]] = 0;
1859
+ if (e.lencode = e.lendyn, e.lenbits = 7, I = { bits: e.lenbits }, F = b(0, e.lens, 0, 19, e.lencode, 0, e.work, I), e.lenbits = I.bits, F) {
1860
+ w.msg = "invalid code lengths set", e.mode = 30;
1861
+ break;
1862
+ }
1863
+ e.have = 0, e.mode = 19;
1864
+ case 19:
1865
+ for (; e.have < e.nlen + e.ndist; ) {
1866
+ for (; nt = (u = e.lencode[B & (1 << e.lenbits) - 1]) >>> 16 & 255, ot = 65535 & u, !((rt = u >>> 24) <= A); ) {
1867
+ if (X === 0) break t;
1868
+ X--, B += N[U++] << A, A += 8;
1869
+ }
1870
+ if (ot < 16) B >>>= rt, A -= rt, e.lens[e.have++] = ot;
1871
+ else {
1872
+ if (ot === 16) {
1873
+ for (f = rt + 2; A < f; ) {
1874
+ if (X === 0) break t;
1875
+ X--, B += N[U++] << A, A += 8;
1876
+ }
1877
+ if (B >>>= rt, A -= rt, e.have === 0) {
1878
+ w.msg = "invalid bit length repeat", e.mode = 30;
1879
+ break;
1880
+ }
1881
+ t = e.lens[e.have - 1], $ = 3 + (3 & B), B >>>= 2, A -= 2;
1882
+ } else if (ot === 17) {
1883
+ for (f = rt + 3; A < f; ) {
1884
+ if (X === 0) break t;
1885
+ X--, B += N[U++] << A, A += 8;
1886
+ }
1887
+ A -= rt, t = 0, $ = 3 + (7 & (B >>>= rt)), B >>>= 3, A -= 3;
1888
+ } else {
1889
+ for (f = rt + 7; A < f; ) {
1890
+ if (X === 0) break t;
1891
+ X--, B += N[U++] << A, A += 8;
1892
+ }
1893
+ A -= rt, t = 0, $ = 11 + (127 & (B >>>= rt)), B >>>= 7, A -= 7;
1894
+ }
1895
+ if (e.have + $ > e.nlen + e.ndist) {
1896
+ w.msg = "invalid bit length repeat", e.mode = 30;
1897
+ break;
1898
+ }
1899
+ for (; $--; ) e.lens[e.have++] = t;
1900
+ }
1901
+ }
1902
+ if (e.mode === 30) break;
1903
+ if (e.lens[256] === 0) {
1904
+ w.msg = "invalid code -- missing end-of-block", e.mode = 30;
1905
+ break;
1906
+ }
1907
+ if (e.lenbits = 9, I = { bits: e.lenbits }, F = b(v, e.lens, 0, e.nlen, e.lencode, 0, e.work, I), e.lenbits = I.bits, F) {
1908
+ w.msg = "invalid literal/lengths set", e.mode = 30;
1909
+ break;
1910
+ }
1911
+ if (e.distbits = 6, e.distcode = e.distdyn, I = { bits: e.distbits }, F = b(_, e.lens, e.nlen, e.ndist, e.distcode, 0, e.work, I), e.distbits = I.bits, F) {
1912
+ w.msg = "invalid distances set", e.mode = 30;
1913
+ break;
1914
+ }
1915
+ if (e.mode = 20, R === 6) break t;
1916
+ case 20:
1917
+ e.mode = 21;
1918
+ case 21:
1919
+ if (6 <= X && 258 <= J) {
1920
+ w.next_out = et, w.avail_out = J, w.next_in = U, w.avail_in = X, e.hold = B, e.bits = A, o(w, H), et = w.next_out, tt = w.output, J = w.avail_out, U = w.next_in, N = w.input, X = w.avail_in, B = e.hold, A = e.bits, e.mode === 12 && (e.back = -1);
1921
+ break;
1922
+ }
1923
+ for (e.back = 0; nt = (u = e.lencode[B & (1 << e.lenbits) - 1]) >>> 16 & 255, ot = 65535 & u, !((rt = u >>> 24) <= A); ) {
1924
+ if (X === 0) break t;
1925
+ X--, B += N[U++] << A, A += 8;
1926
+ }
1927
+ if (nt && (240 & nt) == 0) {
1928
+ for (at = rt, it = nt, G = ot; nt = (u = e.lencode[G + ((B & (1 << at + it) - 1) >> at)]) >>> 16 & 255, ot = 65535 & u, !(at + (rt = u >>> 24) <= A); ) {
1929
+ if (X === 0) break t;
1930
+ X--, B += N[U++] << A, A += 8;
1931
+ }
1932
+ B >>>= at, A -= at, e.back += at;
1933
+ }
1934
+ if (B >>>= rt, A -= rt, e.back += rt, e.length = ot, nt === 0) {
1935
+ e.mode = 26;
1936
+ break;
1937
+ }
1938
+ if (32 & nt) {
1939
+ e.back = -1, e.mode = 12;
1940
+ break;
1941
+ }
1942
+ if (64 & nt) {
1943
+ w.msg = "invalid literal/length code", e.mode = 30;
1944
+ break;
1945
+ }
1946
+ e.extra = 15 & nt, e.mode = 22;
1947
+ case 22:
1948
+ if (e.extra) {
1949
+ for (f = e.extra; A < f; ) {
1950
+ if (X === 0) break t;
1951
+ X--, B += N[U++] << A, A += 8;
1952
+ }
1953
+ e.length += B & (1 << e.extra) - 1, B >>>= e.extra, A -= e.extra, e.back += e.extra;
1954
+ }
1955
+ e.was = e.length, e.mode = 23;
1956
+ case 23:
1957
+ for (; nt = (u = e.distcode[B & (1 << e.distbits) - 1]) >>> 16 & 255, ot = 65535 & u, !((rt = u >>> 24) <= A); ) {
1958
+ if (X === 0) break t;
1959
+ X--, B += N[U++] << A, A += 8;
1960
+ }
1961
+ if ((240 & nt) == 0) {
1962
+ for (at = rt, it = nt, G = ot; nt = (u = e.distcode[G + ((B & (1 << at + it) - 1) >> at)]) >>> 16 & 255, ot = 65535 & u, !(at + (rt = u >>> 24) <= A); ) {
1963
+ if (X === 0) break t;
1964
+ X--, B += N[U++] << A, A += 8;
1965
+ }
1966
+ B >>>= at, A -= at, e.back += at;
1967
+ }
1968
+ if (B >>>= rt, A -= rt, e.back += rt, 64 & nt) {
1969
+ w.msg = "invalid distance code", e.mode = 30;
1970
+ break;
1971
+ }
1972
+ e.offset = ot, e.extra = 15 & nt, e.mode = 24;
1973
+ case 24:
1974
+ if (e.extra) {
1975
+ for (f = e.extra; A < f; ) {
1976
+ if (X === 0) break t;
1977
+ X--, B += N[U++] << A, A += 8;
1978
+ }
1979
+ e.offset += B & (1 << e.extra) - 1, B >>>= e.extra, A -= e.extra, e.back += e.extra;
1980
+ }
1981
+ if (e.offset > e.dmax) {
1982
+ w.msg = "invalid distance too far back", e.mode = 30;
1983
+ break;
1984
+ }
1985
+ e.mode = 25;
1986
+ case 25:
1987
+ if (J === 0) break t;
1988
+ if ($ = H - J, e.offset > $) {
1989
+ if (($ = e.offset - $) > e.whave && e.sane) {
1990
+ w.msg = "invalid distance too far back", e.mode = 30;
1991
+ break;
1992
+ }
1993
+ ut = $ > e.wnext ? ($ -= e.wnext, e.wsize - $) : e.wnext - $, $ > e.length && ($ = e.length), ht = e.window;
1994
+ } else ht = tt, ut = et - e.offset, $ = e.length;
1995
+ for (J < $ && ($ = J), J -= $, e.length -= $; tt[et++] = ht[ut++], --$; ) ;
1996
+ e.length === 0 && (e.mode = 21);
1997
+ break;
1998
+ case 26:
1999
+ if (J === 0) break t;
2000
+ tt[et++] = e.length, J--, e.mode = 21;
2001
+ break;
2002
+ case 27:
2003
+ if (e.wrap) {
2004
+ for (; A < 32; ) {
2005
+ if (X === 0) break t;
2006
+ X--, B |= N[U++] << A, A += 8;
2007
+ }
2008
+ if (H -= J, w.total_out += H, e.total += H, H && (w.adler = e.check = e.flags ? r(e.check, tt, H, et - H) : i(e.check, tt, H, et - H)), H = J, (e.flags ? B : c(B)) !== e.check) {
2009
+ w.msg = "incorrect data check", e.mode = 30;
2010
+ break;
2011
+ }
2012
+ A = B = 0;
2013
+ }
2014
+ e.mode = 28;
2015
+ case 28:
2016
+ if (e.wrap && e.flags) {
2017
+ for (; A < 32; ) {
2018
+ if (X === 0) break t;
2019
+ X--, B += N[U++] << A, A += 8;
2020
+ }
2021
+ if (B !== (4294967295 & e.total)) {
2022
+ w.msg = "incorrect length check", e.mode = 30;
2023
+ break;
2024
+ }
2025
+ A = B = 0;
2026
+ }
2027
+ e.mode = 29;
2028
+ case 29:
2029
+ F = 1;
2030
+ break t;
2031
+ case 30:
2032
+ F = -3;
2033
+ break t;
2034
+ case 31:
2035
+ return -4;
2036
+ case 32:
2037
+ default:
2038
+ return s;
2039
+ }
2040
+ return w.next_out = et, w.avail_out = J, w.next_in = U, w.avail_in = X, e.hold = B, e.bits = A, (e.wsize || H !== w.avail_out && e.mode < 30 && (e.mode < 27 || R !== 4)) && V(w, w.output, w.next_out, H - w.avail_out) ? (e.mode = 31, -4) : (K -= w.avail_in, H -= w.avail_out, w.total_in += K, w.total_out += H, e.total += H, e.wrap && H && (w.adler = e.check = e.flags ? r(e.check, tt, H, w.next_out - H) : i(e.check, tt, H, w.next_out - H)), w.data_type = e.bits + (e.last ? 64 : 0) + (e.mode === 12 ? 128 : 0) + (e.mode === 20 || e.mode === 15 ? 256 : 0), (K == 0 && H === 0 || R === 4) && F === d && (F = -5), F);
2041
+ }, m.inflateEnd = function(w) {
2042
+ if (!w || !w.state) return s;
2043
+ var R = w.state;
2044
+ return R.window && (R.window = null), w.state = null, d;
2045
+ }, m.inflateGetHeader = function(w, R) {
2046
+ var e;
2047
+ return w && w.state ? (2 & (e = w.state).wrap) == 0 ? s : ((e.head = R).done = !1, d) : s;
2048
+ }, m.inflateSetDictionary = function(w, R) {
2049
+ var e, N = R.length;
2050
+ return w && w.state ? (e = w.state).wrap !== 0 && e.mode !== 11 ? s : e.mode === 11 && i(1, R, N, 0) !== e.check ? -3 : V(w, R, N, N) ? (e.mode = 31, -4) : (e.havedict = 1, d) : s;
2051
+ }, m.inflateInfo = "pako inflate (from Nodeca project)";
2052
+ }, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./inffast": 48, "./inftrees": 50 }], 50: [function(a, y, m) {
2053
+ var l = a("../utils/common"), i = [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], r = [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], o = [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], b = [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];
2054
+ y.exports = function(v, _, d, s, p, n, h, c) {
2055
+ var g, x, z, C, D, T, P, O, W, V = c.bits, w = 0, R = 0, e = 0, N = 0, tt = 0, U = 0, et = 0, X = 0, J = 0, B = 0, A = null, K = 0, H = new l.Buf16(16), $ = new l.Buf16(16), ut = null, ht = 0;
2056
+ for (w = 0; w <= 15; w++) H[w] = 0;
2057
+ for (R = 0; R < s; R++) H[_[d + R]]++;
2058
+ for (tt = V, N = 15; 1 <= N && H[N] === 0; N--) ;
2059
+ if (N < tt && (tt = N), N === 0) return p[n++] = 20971520, p[n++] = 20971520, c.bits = 1, 0;
2060
+ for (e = 1; e < N && H[e] === 0; e++) ;
2061
+ for (tt < e && (tt = e), w = X = 1; w <= 15; w++) if (X <<= 1, (X -= H[w]) < 0) return -1;
2062
+ if (0 < X && (v === 0 || N !== 1)) return -1;
2063
+ for ($[1] = 0, w = 1; w < 15; w++) $[w + 1] = $[w] + H[w];
2064
+ for (R = 0; R < s; R++) _[d + R] !== 0 && (h[$[_[d + R]]++] = R);
2065
+ if (T = v === 0 ? (A = ut = h, 19) : v === 1 ? (A = i, K -= 257, ut = r, ht -= 257, 256) : (A = o, ut = b, -1), w = e, D = n, et = R = B = 0, z = -1, C = (J = 1 << (U = tt)) - 1, v === 1 && 852 < J || v === 2 && 592 < J) return 1;
2066
+ for (; ; ) {
2067
+ for (P = w - et, W = h[R] < T ? (O = 0, h[R]) : h[R] > T ? (O = ut[ht + h[R]], A[K + h[R]]) : (O = 96, 0), g = 1 << w - et, e = x = 1 << U; p[D + (B >> et) + (x -= g)] = P << 24 | O << 16 | W | 0, x !== 0; ) ;
2068
+ for (g = 1 << w - 1; B & g; ) g >>= 1;
2069
+ if (g !== 0 ? (B &= g - 1, B += g) : B = 0, R++, --H[w] == 0) {
2070
+ if (w === N) break;
2071
+ w = _[d + h[R]];
2072
+ }
2073
+ if (tt < w && (B & C) !== z) {
2074
+ for (et === 0 && (et = tt), D += e, X = 1 << (U = w - et); U + et < N && !((X -= H[U + et]) <= 0); ) U++, X <<= 1;
2075
+ if (J += 1 << U, v === 1 && 852 < J || v === 2 && 592 < J) return 1;
2076
+ p[z = B & C] = tt << 24 | U << 16 | D - n | 0;
2077
+ }
2078
+ }
2079
+ return B !== 0 && (p[D + B] = w - et << 24 | 64 << 16 | 0), c.bits = tt, 0;
2080
+ };
2081
+ }, { "../utils/common": 41 }], 51: [function(a, y, m) {
2082
+ y.exports = { 2: "need dictionary", 1: "stream end", 0: "", "-1": "file error", "-2": "stream error", "-3": "data error", "-4": "insufficient memory", "-5": "buffer error", "-6": "incompatible version" };
2083
+ }, {}], 52: [function(a, y, m) {
2084
+ var l = a("../utils/common"), i = 0, r = 1;
2085
+ function o(u) {
2086
+ for (var S = u.length; 0 <= --S; ) u[S] = 0;
2087
+ }
2088
+ var b = 0, v = 29, _ = 256, d = _ + 1 + v, s = 30, p = 19, n = 2 * d + 1, h = 15, c = 16, g = 7, x = 256, z = 16, C = 17, D = 18, T = [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], P = [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], O = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], W = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], V = new Array(2 * (d + 2));
2089
+ o(V);
2090
+ var w = new Array(2 * s);
2091
+ o(w);
2092
+ var R = new Array(512);
2093
+ o(R);
2094
+ var e = new Array(256);
2095
+ o(e);
2096
+ var N = new Array(v);
2097
+ o(N);
2098
+ var tt, U, et, X = new Array(s);
2099
+ function J(u, S, L, j, E) {
2100
+ this.static_tree = u, this.extra_bits = S, this.extra_base = L, this.elems = j, this.max_length = E, this.has_stree = u && u.length;
2101
+ }
2102
+ function B(u, S) {
2103
+ this.dyn_tree = u, this.max_code = 0, this.stat_desc = S;
2104
+ }
2105
+ function A(u) {
2106
+ return u < 256 ? R[u] : R[256 + (u >>> 7)];
2107
+ }
2108
+ function K(u, S) {
2109
+ u.pending_buf[u.pending++] = 255 & S, u.pending_buf[u.pending++] = S >>> 8 & 255;
2110
+ }
2111
+ function H(u, S, L) {
2112
+ u.bi_valid > c - L ? (u.bi_buf |= S << u.bi_valid & 65535, K(u, u.bi_buf), u.bi_buf = S >> c - u.bi_valid, u.bi_valid += L - c) : (u.bi_buf |= S << u.bi_valid & 65535, u.bi_valid += L);
2113
+ }
2114
+ function $(u, S, L) {
2115
+ H(u, L[2 * S], L[2 * S + 1]);
2116
+ }
2117
+ function ut(u, S) {
2118
+ for (var L = 0; L |= 1 & u, u >>>= 1, L <<= 1, 0 < --S; ) ;
2119
+ return L >>> 1;
2120
+ }
2121
+ function ht(u, S, L) {
2122
+ var j, E, Z = new Array(h + 1), q = 0;
2123
+ for (j = 1; j <= h; j++) Z[j] = q = q + L[j - 1] << 1;
2124
+ for (E = 0; E <= S; E++) {
2125
+ var Y = u[2 * E + 1];
2126
+ Y !== 0 && (u[2 * E] = ut(Z[Y]++, Y));
2127
+ }
2128
+ }
2129
+ function rt(u) {
2130
+ var S;
2131
+ for (S = 0; S < d; S++) u.dyn_ltree[2 * S] = 0;
2132
+ for (S = 0; S < s; S++) u.dyn_dtree[2 * S] = 0;
2133
+ for (S = 0; S < p; S++) u.bl_tree[2 * S] = 0;
2134
+ u.dyn_ltree[2 * x] = 1, u.opt_len = u.static_len = 0, u.last_lit = u.matches = 0;
2135
+ }
2136
+ function nt(u) {
2137
+ 8 < u.bi_valid ? K(u, u.bi_buf) : 0 < u.bi_valid && (u.pending_buf[u.pending++] = u.bi_buf), u.bi_buf = 0, u.bi_valid = 0;
2138
+ }
2139
+ function ot(u, S, L, j) {
2140
+ var E = 2 * S, Z = 2 * L;
2141
+ return u[E] < u[Z] || u[E] === u[Z] && j[S] <= j[L];
2142
+ }
2143
+ function at(u, S, L) {
2144
+ for (var j = u.heap[L], E = L << 1; E <= u.heap_len && (E < u.heap_len && ot(S, u.heap[E + 1], u.heap[E], u.depth) && E++, !ot(S, j, u.heap[E], u.depth)); ) u.heap[L] = u.heap[E], L = E, E <<= 1;
2145
+ u.heap[L] = j;
2146
+ }
2147
+ function it(u, S, L) {
2148
+ var j, E, Z, q, Y = 0;
2149
+ if (u.last_lit !== 0) for (; j = u.pending_buf[u.d_buf + 2 * Y] << 8 | u.pending_buf[u.d_buf + 2 * Y + 1], E = u.pending_buf[u.l_buf + Y], Y++, j === 0 ? $(u, E, S) : ($(u, (Z = e[E]) + _ + 1, S), (q = T[Z]) !== 0 && H(u, E -= N[Z], q), $(u, Z = A(--j), L), (q = P[Z]) !== 0 && H(u, j -= X[Z], q)), Y < u.last_lit; ) ;
2150
+ $(u, x, S);
2151
+ }
2152
+ function G(u, S) {
2153
+ var L, j, E, Z = S.dyn_tree, q = S.stat_desc.static_tree, Y = S.stat_desc.has_stree, Q = S.stat_desc.elems, lt = -1;
2154
+ for (u.heap_len = 0, u.heap_max = n, L = 0; L < Q; L++) Z[2 * L] !== 0 ? (u.heap[++u.heap_len] = lt = L, u.depth[L] = 0) : Z[2 * L + 1] = 0;
2155
+ for (; u.heap_len < 2; ) Z[2 * (E = u.heap[++u.heap_len] = lt < 2 ? ++lt : 0)] = 1, u.depth[E] = 0, u.opt_len--, Y && (u.static_len -= q[2 * E + 1]);
2156
+ for (S.max_code = lt, L = u.heap_len >> 1; 1 <= L; L--) at(u, Z, L);
2157
+ for (E = Q; L = u.heap[1], u.heap[1] = u.heap[u.heap_len--], at(u, Z, 1), j = u.heap[1], u.heap[--u.heap_max] = L, u.heap[--u.heap_max] = j, Z[2 * E] = Z[2 * L] + Z[2 * j], u.depth[E] = (u.depth[L] >= u.depth[j] ? u.depth[L] : u.depth[j]) + 1, Z[2 * L + 1] = Z[2 * j + 1] = E, u.heap[1] = E++, at(u, Z, 1), 2 <= u.heap_len; ) ;
2158
+ u.heap[--u.heap_max] = u.heap[1], (function(st, ct) {
2159
+ var mt, bt, zt, ft, Ft, Pt, vt = ct.dyn_tree, Ut = ct.max_code, Ht = ct.stat_desc.static_tree, qt = ct.stat_desc.has_stree, Kt = ct.stat_desc.extra_bits, jt = ct.stat_desc.extra_base, Et = ct.stat_desc.max_length, Ot = 0;
2160
+ for (ft = 0; ft <= h; ft++) st.bl_count[ft] = 0;
2161
+ for (vt[2 * st.heap[st.heap_max] + 1] = 0, mt = st.heap_max + 1; mt < n; mt++) Et < (ft = vt[2 * vt[2 * (bt = st.heap[mt]) + 1] + 1] + 1) && (ft = Et, Ot++), vt[2 * bt + 1] = ft, Ut < bt || (st.bl_count[ft]++, Ft = 0, jt <= bt && (Ft = Kt[bt - jt]), Pt = vt[2 * bt], st.opt_len += Pt * (ft + Ft), qt && (st.static_len += Pt * (Ht[2 * bt + 1] + Ft)));
2162
+ if (Ot !== 0) {
2163
+ do {
2164
+ for (ft = Et - 1; st.bl_count[ft] === 0; ) ft--;
2165
+ st.bl_count[ft]--, st.bl_count[ft + 1] += 2, st.bl_count[Et]--, Ot -= 2;
2166
+ } while (0 < Ot);
2167
+ for (ft = Et; ft !== 0; ft--) for (bt = st.bl_count[ft]; bt !== 0; ) Ut < (zt = st.heap[--mt]) || (vt[2 * zt + 1] !== ft && (st.opt_len += (ft - vt[2 * zt + 1]) * vt[2 * zt], vt[2 * zt + 1] = ft), bt--);
2168
+ }
2169
+ })(u, S), ht(Z, lt, u.bl_count);
2170
+ }
2171
+ function t(u, S, L) {
2172
+ var j, E, Z = -1, q = S[1], Y = 0, Q = 7, lt = 4;
2173
+ for (q === 0 && (Q = 138, lt = 3), S[2 * (L + 1) + 1] = 65535, j = 0; j <= L; j++) E = q, q = S[2 * (j + 1) + 1], ++Y < Q && E === q || (Y < lt ? u.bl_tree[2 * E] += Y : E !== 0 ? (E !== Z && u.bl_tree[2 * E]++, u.bl_tree[2 * z]++) : Y <= 10 ? u.bl_tree[2 * C]++ : u.bl_tree[2 * D]++, Z = E, lt = (Y = 0) === q ? (Q = 138, 3) : E === q ? (Q = 6, 3) : (Q = 7, 4));
2174
+ }
2175
+ function F(u, S, L) {
2176
+ var j, E, Z = -1, q = S[1], Y = 0, Q = 7, lt = 4;
2177
+ for (q === 0 && (Q = 138, lt = 3), j = 0; j <= L; j++) if (E = q, q = S[2 * (j + 1) + 1], !(++Y < Q && E === q)) {
2178
+ if (Y < lt) for (; $(u, E, u.bl_tree), --Y != 0; ) ;
2179
+ else E !== 0 ? (E !== Z && ($(u, E, u.bl_tree), Y--), $(u, z, u.bl_tree), H(u, Y - 3, 2)) : Y <= 10 ? ($(u, C, u.bl_tree), H(u, Y - 3, 3)) : ($(u, D, u.bl_tree), H(u, Y - 11, 7));
2180
+ Z = E, lt = (Y = 0) === q ? (Q = 138, 3) : E === q ? (Q = 6, 3) : (Q = 7, 4);
2181
+ }
2182
+ }
2183
+ o(X);
2184
+ var I = !1;
2185
+ function f(u, S, L, j) {
2186
+ H(u, (b << 1) + (j ? 1 : 0), 3), (function(E, Z, q, Y) {
2187
+ nt(E), K(E, q), K(E, ~q), l.arraySet(E.pending_buf, E.window, Z, q, E.pending), E.pending += q;
2188
+ })(u, S, L);
2189
+ }
2190
+ m._tr_init = function(u) {
2191
+ I || ((function() {
2192
+ var S, L, j, E, Z, q = new Array(h + 1);
2193
+ for (E = j = 0; E < v - 1; E++) for (N[E] = j, S = 0; S < 1 << T[E]; S++) e[j++] = E;
2194
+ for (e[j - 1] = E, E = Z = 0; E < 16; E++) for (X[E] = Z, S = 0; S < 1 << P[E]; S++) R[Z++] = E;
2195
+ for (Z >>= 7; E < s; E++) for (X[E] = Z << 7, S = 0; S < 1 << P[E] - 7; S++) R[256 + Z++] = E;
2196
+ for (L = 0; L <= h; L++) q[L] = 0;
2197
+ for (S = 0; S <= 143; ) V[2 * S + 1] = 8, S++, q[8]++;
2198
+ for (; S <= 255; ) V[2 * S + 1] = 9, S++, q[9]++;
2199
+ for (; S <= 279; ) V[2 * S + 1] = 7, S++, q[7]++;
2200
+ for (; S <= 287; ) V[2 * S + 1] = 8, S++, q[8]++;
2201
+ for (ht(V, d + 1, q), S = 0; S < s; S++) w[2 * S + 1] = 5, w[2 * S] = ut(S, 5);
2202
+ tt = new J(V, T, _ + 1, d, h), U = new J(w, P, 0, s, h), et = new J(new Array(0), O, 0, p, g);
2203
+ })(), I = !0), u.l_desc = new B(u.dyn_ltree, tt), u.d_desc = new B(u.dyn_dtree, U), u.bl_desc = new B(u.bl_tree, et), u.bi_buf = 0, u.bi_valid = 0, rt(u);
2204
+ }, m._tr_stored_block = f, m._tr_flush_block = function(u, S, L, j) {
2205
+ var E, Z, q = 0;
2206
+ 0 < u.level ? (u.strm.data_type === 2 && (u.strm.data_type = (function(Y) {
2207
+ var Q, lt = 4093624447;
2208
+ for (Q = 0; Q <= 31; Q++, lt >>>= 1) if (1 & lt && Y.dyn_ltree[2 * Q] !== 0) return i;
2209
+ if (Y.dyn_ltree[18] !== 0 || Y.dyn_ltree[20] !== 0 || Y.dyn_ltree[26] !== 0) return r;
2210
+ for (Q = 32; Q < _; Q++) if (Y.dyn_ltree[2 * Q] !== 0) return r;
2211
+ return i;
2212
+ })(u)), G(u, u.l_desc), G(u, u.d_desc), q = (function(Y) {
2213
+ var Q;
2214
+ for (t(Y, Y.dyn_ltree, Y.l_desc.max_code), t(Y, Y.dyn_dtree, Y.d_desc.max_code), G(Y, Y.bl_desc), Q = p - 1; 3 <= Q && Y.bl_tree[2 * W[Q] + 1] === 0; Q--) ;
2215
+ return Y.opt_len += 3 * (Q + 1) + 5 + 5 + 4, Q;
2216
+ })(u), E = u.opt_len + 3 + 7 >>> 3, (Z = u.static_len + 3 + 7 >>> 3) <= E && (E = Z)) : E = Z = L + 5, L + 4 <= E && S !== -1 ? f(u, S, L, j) : u.strategy === 4 || Z === E ? (H(u, 2 + (j ? 1 : 0), 3), it(u, V, w)) : (H(u, 4 + (j ? 1 : 0), 3), (function(Y, Q, lt, st) {
2217
+ var ct;
2218
+ for (H(Y, Q - 257, 5), H(Y, lt - 1, 5), H(Y, st - 4, 4), ct = 0; ct < st; ct++) H(Y, Y.bl_tree[2 * W[ct] + 1], 3);
2219
+ F(Y, Y.dyn_ltree, Q - 1), F(Y, Y.dyn_dtree, lt - 1);
2220
+ })(u, u.l_desc.max_code + 1, u.d_desc.max_code + 1, q + 1), it(u, u.dyn_ltree, u.dyn_dtree)), rt(u), j && nt(u);
2221
+ }, m._tr_tally = function(u, S, L) {
2222
+ return u.pending_buf[u.d_buf + 2 * u.last_lit] = S >>> 8 & 255, u.pending_buf[u.d_buf + 2 * u.last_lit + 1] = 255 & S, u.pending_buf[u.l_buf + u.last_lit] = 255 & L, u.last_lit++, S === 0 ? u.dyn_ltree[2 * L]++ : (u.matches++, S--, u.dyn_ltree[2 * (e[L] + _ + 1)]++, u.dyn_dtree[2 * A(S)]++), u.last_lit === u.lit_bufsize - 1;
2223
+ }, m._tr_align = function(u) {
2224
+ H(u, 2, 3), $(u, x, V), (function(S) {
2225
+ S.bi_valid === 16 ? (K(S, S.bi_buf), S.bi_buf = 0, S.bi_valid = 0) : 8 <= S.bi_valid && (S.pending_buf[S.pending++] = 255 & S.bi_buf, S.bi_buf >>= 8, S.bi_valid -= 8);
2226
+ })(u);
2227
+ };
2228
+ }, { "../utils/common": 41 }], 53: [function(a, y, m) {
2229
+ y.exports = function() {
2230
+ 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;
2231
+ };
2232
+ }, {}], 54: [function(a, y, m) {
2233
+ (function(l) {
2234
+ (function(i, r) {
2235
+ if (!i.setImmediate) {
2236
+ var o, b, v, _, d = 1, s = {}, p = !1, n = i.document, h = Object.getPrototypeOf && Object.getPrototypeOf(i);
2237
+ h = h && h.setTimeout ? h : i, o = {}.toString.call(i.process) === "[object process]" ? function(z) {
2238
+ process.nextTick(function() {
2239
+ g(z);
2240
+ });
2241
+ } : (function() {
2242
+ if (i.postMessage && !i.importScripts) {
2243
+ var z = !0, C = i.onmessage;
2244
+ return i.onmessage = function() {
2245
+ z = !1;
2246
+ }, i.postMessage("", "*"), i.onmessage = C, z;
2247
+ }
2248
+ })() ? (_ = "setImmediate$" + Math.random() + "$", i.addEventListener ? i.addEventListener("message", x, !1) : i.attachEvent("onmessage", x), function(z) {
2249
+ i.postMessage(_ + z, "*");
2250
+ }) : i.MessageChannel ? ((v = new MessageChannel()).port1.onmessage = function(z) {
2251
+ g(z.data);
2252
+ }, function(z) {
2253
+ v.port2.postMessage(z);
2254
+ }) : n && "onreadystatechange" in n.createElement("script") ? (b = n.documentElement, function(z) {
2255
+ var C = n.createElement("script");
2256
+ C.onreadystatechange = function() {
2257
+ g(z), C.onreadystatechange = null, b.removeChild(C), C = null;
2258
+ }, b.appendChild(C);
2259
+ }) : function(z) {
2260
+ setTimeout(g, 0, z);
2261
+ }, h.setImmediate = function(z) {
2262
+ typeof z != "function" && (z = new Function("" + z));
2263
+ for (var C = new Array(arguments.length - 1), D = 0; D < C.length; D++) C[D] = arguments[D + 1];
2264
+ var T = { callback: z, args: C };
2265
+ return s[d] = T, o(d), d++;
2266
+ }, h.clearImmediate = c;
2267
+ }
2268
+ function c(z) {
2269
+ delete s[z];
2270
+ }
2271
+ function g(z) {
2272
+ if (p) setTimeout(g, 0, z);
2273
+ else {
2274
+ var C = s[z];
2275
+ if (C) {
2276
+ p = !0;
2277
+ try {
2278
+ (function(D) {
2279
+ var T = D.callback, P = D.args;
2280
+ switch (P.length) {
2281
+ case 0:
2282
+ T();
2283
+ break;
2284
+ case 1:
2285
+ T(P[0]);
2286
+ break;
2287
+ case 2:
2288
+ T(P[0], P[1]);
2289
+ break;
2290
+ case 3:
2291
+ T(P[0], P[1], P[2]);
2292
+ break;
2293
+ default:
2294
+ T.apply(r, P);
2295
+ }
2296
+ })(C);
2297
+ } finally {
2298
+ c(z), p = !1;
2299
+ }
2300
+ }
2301
+ }
2302
+ }
2303
+ function x(z) {
2304
+ z.source === i && typeof z.data == "string" && z.data.indexOf(_) === 0 && g(+z.data.slice(_.length));
2305
+ }
2306
+ })(typeof self > "u" ? l === void 0 ? this : l : self);
2307
+ }).call(this, typeof Tt < "u" ? Tt : typeof self < "u" ? self : typeof window < "u" ? window : {});
2308
+ }, {}] }, {}, [10])(10);
2309
+ });
2310
+ })(Dt)), Dt.exports;
2311
+ }
2312
+ var Qt = Jt();
2313
+ const te = /* @__PURE__ */ Vt(Qt);
2314
+ function Nt(M) {
2315
+ return M.toLowerCase();
2316
+ }
2317
+ function xt(M, k) {
2318
+ const a = new Set(k.map((m) => m.toLowerCase()));
2319
+ return M.filter((m) => {
2320
+ const l = Nt(m), i = l.lastIndexOf(".");
2321
+ return i < 0 ? !1 : a.has(l.slice(i));
2322
+ }).sort((m, l) => m.length - l.length)[0];
2323
+ }
2324
+ function dt(M, k) {
2325
+ const a = k.map((m) => m.toLowerCase());
2326
+ return M.filter((m) => {
2327
+ const l = Nt(m);
2328
+ return a.every((i) => l.includes(i));
2329
+ }).sort((m, l) => m.length - l.length)[0];
2330
+ }
2331
+ function ee(M) {
2332
+ const k = M.filter((v) => {
2333
+ const _ = Nt(v);
2334
+ return !(_.endsWith("/") || _.includes("__macosx") || _.endsWith(".ds_store"));
2335
+ }), a = xt(k, [".gtl"]) || dt(k, ["f_cu"]) || dt(k, ["top", "cu"]) || dt(k, ["top", "copper"]), y = xt(k, [".gbl"]) || dt(k, ["b_cu"]) || dt(k, ["bottom", "cu"]) || dt(k, ["bottom", "copper"]), m = xt(k, [".gts"]) || dt(k, ["f_mask"]) || dt(k, ["top", "mask"]), l = xt(k, [".gbs"]) || dt(k, ["b_mask"]) || dt(k, ["bottom", "mask"]), i = xt(k, [".gto"]) || dt(k, ["f_silks"]) || dt(k, ["f_silk"]) || dt(k, ["top", "silk"]), r = xt(k, [".gbo"]) || dt(k, ["b_silks"]) || dt(k, ["b_silk"]) || dt(k, ["bottom", "silk"]), o = xt(k, [".gko", ".gm1"]) || dt(k, ["edge", "cuts"]) || dt(k, ["outline"]) || dt(k, ["board", "outline"]), b = (
2336
+ // Excellon often .drl or .xln or .txt
2337
+ xt(k, [".drl", ".xln"]) || // Some CAD exports use .txt for drills but be careful: only if name hints drill
2338
+ dt(k, ["drill"]) || dt(k, ["drills"]) || dt(k, ["npth"]) || dt(k, ["pth"])
2339
+ );
2340
+ return {
2341
+ top_copper: a,
2342
+ bottom_copper: y,
2343
+ top_mask: m,
2344
+ bottom_mask: l,
2345
+ top_silk: i,
2346
+ bottom_silk: r,
2347
+ outline: o,
2348
+ drills: b
2349
+ };
2350
+ }
2351
+ const re = 0.8;
2352
+ function At(M, k, a) {
2353
+ const y = {
2354
+ unitScale: 1,
2355
+ fmtInt: 2,
2356
+ fmtDec: 4,
2357
+ x: 0,
2358
+ y: 0,
2359
+ apertures: /* @__PURE__ */ new Map(),
2360
+ currentAperture: null,
2361
+ inRegion: !1,
2362
+ regionPaths: [],
2363
+ currentPath: [],
2364
+ tracks: [],
2365
+ arcs: [],
2366
+ flashes: [],
2367
+ regions: []
2368
+ }, m = k.split(/\r?\n/);
2369
+ for (const l of m) {
2370
+ let i = l.trim();
2371
+ if (i && !i.startsWith("G04")) {
2372
+ if (i.startsWith("%") && i.endsWith("%")) {
2373
+ ne(i, y);
2374
+ continue;
2375
+ }
2376
+ i.endsWith("*") && (i = i.slice(0, -1)), ie(i, y);
2377
+ }
2378
+ }
2379
+ return y.inRegion && (y.currentPath.length >= 3 && y.regionPaths.push(y.currentPath), y.regionPaths.length > 0 && y.regions.push({
2380
+ boundary: y.regionPaths[0],
2381
+ holes: y.regionPaths.slice(1)
2382
+ }), y.inRegion = !1, y.regionPaths = [], y.currentPath = []), {
2383
+ tracks: y.tracks,
2384
+ arcs: y.arcs,
2385
+ flashes: y.flashes,
2386
+ regions: y.regions
2387
+ };
2388
+ }
2389
+ function ne(M, k) {
2390
+ let a = M;
2391
+ if (a.startsWith("%") && (a = a.slice(1)), a.endsWith("%") && (a = a.slice(0, -1)), a.endsWith("*") && (a = a.slice(0, -1)), a.startsWith("FS")) {
2392
+ const y = /FS..X(\d)(\d)Y(\d)(\d)/.exec(a);
2393
+ if (y) {
2394
+ const m = parseInt(y[1], 10), l = parseInt(y[2], 10);
2395
+ parseInt(y[4], 10), k.fmtInt = m, k.fmtDec = l;
2396
+ }
2397
+ return;
2398
+ }
2399
+ if (a.startsWith("MO")) {
2400
+ const y = k.unitScale;
2401
+ let m = y;
2402
+ if (a.includes("MOMM") ? m = 1 : a.includes("MOIN") && (m = 25.4), m !== y) {
2403
+ const l = m / y;
2404
+ for (const i of k.apertures.values())
2405
+ i.diameterMm !== void 0 && (i.diameterMm *= l), i.widthMm !== void 0 && (i.widthMm *= l), i.heightMm !== void 0 && (i.heightMm *= l);
2406
+ k.unitScale = m;
2407
+ }
2408
+ return;
2409
+ }
2410
+ if (a.startsWith("AD")) {
2411
+ const y = /AD(D?)(\d+)([A-Z]),?([0-9.Xx]*)/.exec(a);
2412
+ if (!y) return;
2413
+ const m = parseInt(y[2], 10), l = y[3], i = y[4] ?? "";
2414
+ let r, o, b;
2415
+ if (i) {
2416
+ const _ = i.split(/[Xx]/), d = _[0] ? parseFloat(_[0]) * k.unitScale : void 0, s = _[1] ? parseFloat(_[1]) * k.unitScale : void 0;
2417
+ l === "C" ? r = d : l === "R" || l === "O" ? (o = d, b = s, d !== void 0 && s !== void 0 ? r = Math.min(d, s) : r = d ?? s) : r = d ?? s;
2418
+ }
2419
+ const v = {
2420
+ code: m,
2421
+ shape: l,
2422
+ diameterMm: r,
2423
+ widthMm: o,
2424
+ heightMm: b
2425
+ };
2426
+ k.apertures.set(m, v);
2427
+ return;
2428
+ }
2429
+ }
2430
+ function ie(M, k) {
2431
+ if (M === "G36") {
2432
+ k.inRegion = !0, k.regionPaths = [], k.currentPath = [];
2433
+ return;
2434
+ }
2435
+ if (M === "G37") {
2436
+ k.currentPath.length >= 3 && k.regionPaths.push(k.currentPath), k.inRegion = !1, k.regionPaths.length > 0 && k.regions.push({
2437
+ boundary: k.regionPaths[0],
2438
+ holes: k.regionPaths.slice(1)
2439
+ }), k.regionPaths = [], k.currentPath = [];
2440
+ return;
2441
+ }
2442
+ let a = null;
2443
+ const y = /D0?(\d{1,3})$/.exec(M);
2444
+ if (y && (a = parseInt(y[1], 10), M = M.slice(0, M.length - y[0].length)), a !== null && a >= 10) {
2445
+ const v = k.apertures.get(a);
2446
+ v && (k.currentAperture = v);
2447
+ return;
2448
+ }
2449
+ const m = /X([+\-]?\d+)/.exec(M), l = /Y([+\-]?\d+)/.exec(M);
2450
+ let i = k.x, r = k.y;
2451
+ if (m && (i = Xt(m[1], k)), l && (r = Xt(l[1], k)), a === null) {
2452
+ k.x = i, k.y = r;
2453
+ return;
2454
+ }
2455
+ if (k.inRegion) {
2456
+ const v = k.x, _ = k.y;
2457
+ a === 1 ? (k.currentPath.length === 0 && k.currentPath.push({ x: v, y: _ }), k.currentPath.push({ x: i, y: r })) : a === 2 && (k.currentPath.length >= 3 && k.regionPaths.push(k.currentPath), k.currentPath = []), k.x = i, k.y = r;
2458
+ return;
2459
+ }
2460
+ const o = k.x, b = k.y;
2461
+ if (a === 1) {
2462
+ if (!k.currentAperture) {
2463
+ k.x = i, k.y = r;
2464
+ return;
2465
+ }
2466
+ const v = k.currentAperture.diameterMm !== void 0 ? k.currentAperture.diameterMm : 0.2;
2467
+ k.tracks.push({
2468
+ start: { x: o, y: b },
2469
+ end: { x: i, y: r },
2470
+ width: v
2471
+ }), k.x = i, k.y = r;
2472
+ return;
2473
+ }
2474
+ if (a === 2) {
2475
+ k.x = i, k.y = r;
2476
+ return;
2477
+ }
2478
+ if (a === 3) {
2479
+ if (k.currentAperture) {
2480
+ const v = k.currentAperture, _ = v.diameterMm !== void 0 ? v.diameterMm : re, d = {
2481
+ position: { x: i, y: r },
2482
+ diameterMm: _,
2483
+ shape: v.shape
2484
+ };
2485
+ v.widthMm !== void 0 && (d.widthMm = v.widthMm), v.heightMm !== void 0 && (d.heightMm = v.heightMm), k.flashes.push(d);
2486
+ }
2487
+ k.x = i, k.y = r;
2488
+ return;
2489
+ }
2490
+ }
2491
+ function Xt(M, k) {
2492
+ const a = M.startsWith("-") ? -1 : 1, y = M.replace(/[+\-]/g, ""), m = parseInt(y, 10);
2493
+ if (Number.isNaN(m)) return 0;
2494
+ const l = Math.pow(10, k.fmtDec), i = m / l * k.unitScale;
2495
+ return a * i;
2496
+ }
2497
+ function se(M, k) {
2498
+ const a = k.split(/\r?\n/), y = /* @__PURE__ */ new Map();
2499
+ let m = null;
2500
+ const l = [];
2501
+ for (const i of a) {
2502
+ const r = i.trim();
2503
+ if (r && !r.startsWith(";")) {
2504
+ if (r.startsWith("T") && r.includes("C")) {
2505
+ const o = /^T(\d+)[C]([\d.]+)/i.exec(r);
2506
+ if (o) {
2507
+ const b = o[1], v = parseFloat(o[2]);
2508
+ Number.isNaN(v) || y.set(b, v);
2509
+ }
2510
+ continue;
2511
+ }
2512
+ if (r.startsWith("T") && !r.includes("C")) {
2513
+ const o = /^T(\d+)/i.exec(r);
2514
+ o && (m = o[1]);
2515
+ continue;
2516
+ }
2517
+ if (r[0] === "X" || r.includes("X")) {
2518
+ const o = /X([\-0-9.]+)Y([\-0-9.]+)/i.exec(r);
2519
+ if (!o)
2520
+ continue;
2521
+ const b = o[1], v = o[2], _ = parseFloat(b), d = parseFloat(v);
2522
+ if (Number.isNaN(_) || Number.isNaN(d))
2523
+ continue;
2524
+ const s = m && y.has(m) ? y.get(m) : 0.6;
2525
+ l.push({
2526
+ x: _,
2527
+ y: d,
2528
+ diameter: s,
2529
+ plated: !0
2530
+ // default, later you can infer from file or layer
2531
+ });
2532
+ continue;
2533
+ }
2534
+ }
2535
+ }
2536
+ return {
2537
+ name: M,
2538
+ holes: l
2539
+ };
2540
+ }
2541
+ function ae(M) {
2542
+ return { w: M.maxX - M.minX, h: M.maxY - M.minY };
2543
+ }
2544
+ function It(M) {
2545
+ const { w: k, h: a } = ae(M);
2546
+ return Number.isFinite(k) && Number.isFinite(a) && k > 1 && a > 1 && k < 2e3 && a < 2e3;
2547
+ }
2548
+ function Ct(M, k) {
2549
+ if (!Number.isFinite(M) || !Number.isFinite(k) || M <= 0 || k <= 0) return 1;
2550
+ const a = M / k;
2551
+ return a > 20 && a < 35 ? 1 / 25.4 : a > 0.02 && a < 0.06 ? 25.4 : 1;
2552
+ }
2553
+ function Bt(M, k) {
2554
+ return k === 1 ? M : {
2555
+ ...M,
2556
+ tracks: M.tracks.map((a) => ({
2557
+ ...a,
2558
+ start: { x: a.start.x * k, y: a.start.y * k },
2559
+ end: { x: a.end.x * k, y: a.end.y * k },
2560
+ width: (a.width ?? 0) * k
2561
+ })),
2562
+ flashes: M.flashes.map((a) => ({
2563
+ ...a,
2564
+ position: { x: a.position.x * k, y: a.position.y * k },
2565
+ diameterMm: (a.diameterMm ?? 0) * k,
2566
+ widthMm: (a.widthMm ?? 0) * k,
2567
+ heightMm: (a.heightMm ?? 0) * k
2568
+ })),
2569
+ regions: M.regions.map((a) => ({
2570
+ ...a,
2571
+ boundary: a.boundary.map((y) => ({ x: y.x * k, y: y.y * k })),
2572
+ holes: a.holes.map((y) => y.map((m) => ({ x: m.x * k, y: m.y * k })))
2573
+ }))
2574
+ };
2575
+ }
2576
+ function oe(M, k) {
2577
+ return k === 1 ? M : M.map((a) => ({ x: a.x * k, y: a.y * k, diameter: (a.diameter ?? 0) * k }));
2578
+ }
2579
+ function le(M) {
2580
+ return URL.createObjectURL(new Blob([M], { type: "image/svg+xml" }));
2581
+ }
2582
+ function gt(M, k, a) {
2583
+ M.minX = Math.min(M.minX, k), M.minY = Math.min(M.minY, a), M.maxX = Math.max(M.maxX, k), M.maxY = Math.max(M.maxY, a);
2584
+ }
2585
+ function Lt() {
2586
+ return { minX: 1 / 0, minY: 1 / 0, maxX: -1 / 0, maxY: -1 / 0 };
2587
+ }
2588
+ function St(M) {
2589
+ const k = Lt();
2590
+ for (const a of M.tracks) {
2591
+ gt(k, a.start.x, a.start.y), gt(k, a.end.x, a.end.y);
2592
+ const y = (a.width ?? 0) / 2;
2593
+ gt(k, a.start.x - y, a.start.y - y), gt(k, a.start.x + y, a.start.y + y), gt(k, a.end.x - y, a.end.y - y), gt(k, a.end.x + y, a.end.y + y);
2594
+ }
2595
+ for (const a of M.flashes) {
2596
+ const y = (a.widthMm ?? a.diameterMm) || 0, m = (a.heightMm ?? a.diameterMm) || 0;
2597
+ gt(k, a.position.x - y / 2, a.position.y - m / 2), gt(k, a.position.x + y / 2, a.position.y + m / 2);
2598
+ }
2599
+ for (const a of M.regions) {
2600
+ for (const y of a.boundary) gt(k, y.x, y.y);
2601
+ for (const y of a.holes) for (const m of y) gt(k, m.x, m.y);
2602
+ }
2603
+ return k;
2604
+ }
2605
+ function ce(M) {
2606
+ const k = Lt();
2607
+ for (const a of M) {
2608
+ const y = (a.diameter || 0) / 2;
2609
+ gt(k, a.x - y, a.y - y), gt(k, a.x + y, a.y + y);
2610
+ }
2611
+ return k;
2612
+ }
2613
+ function Zt(M, k) {
2614
+ return {
2615
+ minX: Math.min(M.minX, k.minX),
2616
+ minY: Math.min(M.minY, k.minY),
2617
+ maxX: Math.max(M.maxX, k.maxX),
2618
+ maxY: Math.max(M.maxY, k.maxY)
2619
+ };
2620
+ }
2621
+ function yt(M) {
2622
+ return !Number.isFinite(M.minX) || !Number.isFinite(M.minY) || !Number.isFinite(M.maxX) || !Number.isFinite(M.maxY) ? { minX: 0, minY: 0, maxX: 80, maxY: 60 } : (M.maxX - M.minX < 1e-6 && (M.maxX = M.minX + 1), M.maxY - M.minY < 1e-6 && (M.maxY = M.minY + 1), M);
2623
+ }
2624
+ const ue = 1e3;
2625
+ function _t(M) {
2626
+ return M / 25.4 * ue;
2627
+ }
2628
+ function kt(M, k, a) {
2629
+ const y = M - a.minX, m = a.maxY - k;
2630
+ return { x: y, y: m };
2631
+ }
2632
+ function $t(M, k) {
2633
+ return `
2634
+ <svg xmlns="http://www.w3.org/2000/svg" width="${M}" height="${k}" viewBox="0 0 ${M} ${k}">
2635
+ <rect width="${M}" height="${k}" fill="white"/>
2636
+ </svg>`.trim();
2637
+ }
2638
+ function Yt(M, k, a, y) {
2639
+ const m = k.maxX - k.minX, l = k.maxY - k.minY, i = Math.round(_t(m)), r = Math.round(_t(l)), o = _t(1), b = M.tracks.map((d) => {
2640
+ const s = kt(d.start.x, d.start.y, k), p = kt(d.end.x, d.end.y, k), n = Math.max(1, (d.width || 0.2) * o);
2641
+ return `<line x1="${(s.x * o).toFixed(2)}" y1="${(s.y * o).toFixed(2)}" x2="${(p.x * o).toFixed(2)}" y2="${(p.y * o).toFixed(2)}" stroke="${a}" stroke-width="${n.toFixed(2)}" stroke-linecap="round" stroke-linejoin="round" />`;
2642
+ }), v = M.flashes.map((d) => {
2643
+ const s = kt(d.position.x, d.position.y, k), p = s.x * o, n = s.y * o, h = (d.widthMm ?? d.diameterMm) || 0.8, c = (d.heightMm ?? d.diameterMm) || 0.8;
2644
+ if (d.shape === "R" || d.shape === "O") {
2645
+ const x = h * o, z = c * o, C = p - x / 2, D = n - z / 2, T = d.shape === "O" ? Math.min(x, z) * 0.4 : 0;
2646
+ return `<rect x="${C.toFixed(2)}" y="${D.toFixed(2)}" width="${x.toFixed(2)}" height="${z.toFixed(2)}" rx="${T.toFixed(2)}" fill="${y}" />`;
2647
+ }
2648
+ const g = (d.diameterMm || 0.8) * o / 2;
2649
+ return `<circle cx="${p.toFixed(2)}" cy="${n.toFixed(2)}" r="${Math.max(1, g).toFixed(2)}" fill="${y}" />`;
2650
+ }), _ = M.regions.map((d) => `<polygon points="${d.boundary.map((p) => {
2651
+ const n = kt(p.x, p.y, k);
2652
+ return `${(n.x * o).toFixed(2)},${(n.y * o).toFixed(2)}`;
2653
+ }).join(" ")}" fill="${y}" opacity="0.9" />`);
2654
+ return `
2655
+ <svg xmlns="http://www.w3.org/2000/svg" width="${i}" height="${r}" viewBox="0 0 ${i} ${r}">
2656
+ ${b.join(`
2657
+ `)}
2658
+ ${v.join(`
2659
+ `)}
2660
+ ${_.join(`
2661
+ `)}
2662
+ </svg>`.trim();
2663
+ }
2664
+ function Gt(M, k) {
2665
+ const a = k.maxX - k.minX, y = k.maxY - k.minY, m = Math.max(1, Math.round(_t(a))), l = Math.max(1, Math.round(_t(y))), i = Math.max(1e-6, _t(1)), r = "rgba(255,255,255,0.95)", o = "rgba(255,255,255,0.95)", b = M.tracks.map((d) => {
2666
+ const s = kt(d.start.x, d.start.y, k), p = kt(d.end.x, d.end.y, k), n = Math.max(1, (d.width || 0.15) * i);
2667
+ return `<line x1="${(s.x * i).toFixed(2)}" y1="${(s.y * i).toFixed(2)}" x2="${(p.x * i).toFixed(2)}" y2="${(p.y * i).toFixed(2)}" stroke="${r}" stroke-width="${n.toFixed(2)}" stroke-linecap="round" stroke-linejoin="round" />`;
2668
+ }), v = M.flashes.map((d) => {
2669
+ const s = kt(d.position.x, d.position.y, k), p = s.x * i, n = s.y * i, h = (d.widthMm ?? d.diameterMm) || 0.6, c = (d.heightMm ?? d.diameterMm) || 0.6;
2670
+ if (d.shape === "R" || d.shape === "O") {
2671
+ const x = h * i, z = c * i, C = p - x / 2, D = n - z / 2, T = d.shape === "O" ? Math.min(x, z) * 0.35 : 0;
2672
+ return `<rect x="${C.toFixed(2)}" y="${D.toFixed(2)}" width="${x.toFixed(2)}" height="${z.toFixed(2)}" rx="${T.toFixed(2)}" fill="${o}" />`;
2673
+ }
2674
+ const g = (d.diameterMm || 0.6) * i / 2;
2675
+ return `<circle cx="${p.toFixed(2)}" cy="${n.toFixed(2)}" r="${Math.max(1, g).toFixed(2)}" fill="${o}" />`;
2676
+ }), _ = M.regions.map((d) => `<polygon points="${d.boundary.map((p) => {
2677
+ const n = kt(p.x, p.y, k);
2678
+ return `${(n.x * i).toFixed(2)},${(n.y * i).toFixed(2)}`;
2679
+ }).join(" ")}" fill="${o}" opacity="0.95" />`);
2680
+ return `
2681
+ <svg xmlns="http://www.w3.org/2000/svg" width="${m}" height="${l}" viewBox="0 0 ${m} ${l}">
2682
+ ${b.join(`
2683
+ `)}
2684
+ ${v.join(`
2685
+ `)}
2686
+ ${_.join(`
2687
+ `)}
2688
+ </svg>`.trim();
2689
+ }
2690
+ function he(M, k) {
2691
+ const a = k.maxX - k.minX, y = k.maxY - k.minY, m = Math.round(_t(a)), l = Math.round(_t(y)), i = _t(1), r = M.map((o) => {
2692
+ const b = kt(o.x, o.y, k), v = b.x * i, _ = b.y * i, d = (o.diameter || 0.6) * i / 2;
2693
+ return `<circle cx="${v.toFixed(2)}" cy="${_.toFixed(2)}" r="${Math.max(1, d).toFixed(2)}" fill="none" stroke="#e5e7eb" stroke-width="3" />`;
2694
+ });
2695
+ return `
2696
+ <svg xmlns="http://www.w3.org/2000/svg" width="${m}" height="${l}" viewBox="0 0 ${m} ${l}">
2697
+ ${r.join(`
2698
+ `)}
2699
+ </svg>`.trim();
2700
+ }
2701
+ async function fe(M) {
2702
+ const k = await te.loadAsync(M), a = Object.keys(k.files).filter((it) => !k.files[it].dir), y = ee(a);
2703
+ async function m(it) {
2704
+ if (!it) return null;
2705
+ const G = k.file(it);
2706
+ return G ? await G.async("text") : null;
2707
+ }
2708
+ const l = await m(y.top_copper), i = await m(y.bottom_copper), r = await m(y.outline), o = await m(y.drills), b = await m(y.top_silk), v = await m(y.bottom_silk), _ = l ? At(y.top_copper || "top", l) : null, d = i ? At(y.bottom_copper || "bot", i) : null, s = r ? At(y.outline || "outline", r) : null, p = o ? se(y.drills || "drills", o) : null, n = b ? At(y.top_silk || "top_silk", b) : null, h = v ? At(y.bottom_silk || "bot_silk", v) : null;
2709
+ console.log("[silk parsed]", {
2710
+ top: n ? { tracks: n.tracks.length, flashes: n.flashes.length, regions: n.regions.length } : null,
2711
+ bottom: h ? { tracks: h.tracks.length, flashes: h.flashes.length, regions: h.regions.length } : null
2712
+ });
2713
+ const c = p ? p.holes.map((it) => ({ x: it.x, y: it.y, diameter: it.diameter })) : [], g = _ ? yt(St(_)) : null, x = d ? yt(St(d)) : null, z = s ? yt(St(s)) : null, C = c.length ? yt(ce(c)) : null, D = n ? yt(St(n)) : null, T = h ? yt(St(h)) : null, P = (z && It(z) ? z : null) || (g && It(g) ? g : null) || (x && It(x) ? x : null) || (C && It(C) ? C : null), O = P ? P.maxX - P.minX : 1, W = g ? Ct(g.maxX - g.minX, O) : 1, V = x ? Ct(x.maxX - x.minX, O) : 1, w = z ? Ct(z.maxX - z.minX, O) : 1, R = C ? Ct(C.maxX - C.minX, O) : 1, e = D ? Ct(D.maxX - D.minX, O) : 1, N = T ? Ct(T.maxX - T.minX, O) : 1;
2714
+ console.log("[scale factors]", { topScale: W, botScale: V, outScale: w, drlScale: R, topSilkScale: e, botSilkScale: N });
2715
+ const tt = _ ? Bt(_, W) : null, U = d ? Bt(d, V) : null, et = s ? Bt(s, w) : null, X = c.length ? oe(c, R) : [], J = n ? Bt(n, e) : null, B = h ? Bt(h, N) : null;
2716
+ let A = null;
2717
+ if (et) {
2718
+ const it = yt(St(et));
2719
+ It(it) && (A = it);
2720
+ }
2721
+ if (!A) {
2722
+ let it = Lt();
2723
+ tt && (it = Zt(it, St(tt))), U && (it = Zt(it, St(U))), it = yt(it), A = it;
2724
+ }
2725
+ const K = yt(A), H = K.maxX - K.minX, $ = K.maxY - K.minY, ut = {
2726
+ board: {
2727
+ width_in: H / 25.4,
2728
+ height_in: $ / 25.4,
2729
+ mm_bounds: {
2730
+ min_x_mm: K.minX,
2731
+ min_y_mm: K.minY,
2732
+ max_x_mm: K.maxX,
2733
+ max_y_mm: K.maxY
2734
+ }
2735
+ }
2736
+ }, ht = Math.max(1, Math.round(_t(H))), rt = Math.max(1, Math.round(_t($))), nt = [], ot = (it) => {
2737
+ const G = le(it);
2738
+ return nt.push(G), G;
2739
+ }, at = {
2740
+ top_board_mask: ot($t(ht, rt)),
2741
+ bottom_board_mask: ot($t(ht, rt))
2742
+ };
2743
+ return tt && (at.top_copper = ot(Yt(tt, K, "#fbbf24", "#fbbf24"))), U && (at.bottom_copper = ot(Yt(U, K, "#38bdf8", "#38bdf8"))), X.length && (at.drills = ot(he(X, K))), J && (at.top_silk = ot(Gt(J, K))), B && (at.bottom_silk = ot(Gt(B, K))), {
2744
+ boardGeom: ut,
2745
+ layers: at,
2746
+ revoke: () => nt.forEach((it) => URL.revokeObjectURL(it))
2747
+ };
2748
+ }
2749
+ function de(M, k, a) {
2750
+ return Math.max(k, Math.min(a, M));
2751
+ }
2752
+ function Rt(M, k) {
2753
+ return !Number.isFinite(M) || !Number.isFinite(k) || k <= 0 ? 0 : (M % k + k) % k;
2754
+ }
2755
+ function wt(M, k) {
2756
+ k && k.startsWith("blob:") || k && k.length > 0 ? M.setAttribute("src", k) : M.removeAttribute("src");
2757
+ }
2758
+ function pt(M, k) {
2759
+ const a = M.querySelector(k);
2760
+ if (!a) throw new Error(`Missing required element: ${k}`);
2761
+ return a;
2762
+ }
2763
+ function pe(M, k = {}) {
2764
+ const a = `
2765
+ <svg viewBox="0 0 24 24" fill="none" aria-hidden="true">
2766
+ <path d="M12 3v10" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
2767
+ <path d="M8 11l4 4 4-4" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
2768
+ <path d="M4 17v3h16v-3" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
2769
+ </svg>
2770
+ `;
2771
+ M.innerHTML = `
2772
+ <div class="board-viewer-root">
2773
+ <div class="viewer-header">
2774
+ <div class="viewer-header-left">
2775
+ <p class="viewer-header-title">Board viewer</p>
2776
+ <p class="viewer-header-sub" id="viewer-subtitle">Scroll to zoom, drag to pan</p>
2777
+ </div>
2778
+
2779
+ <div class="viewer-header-right">
2780
+ <div class="controls">
2781
+ <div class="segment" title="Side">
2782
+ <input id="side-top" type="radio" name="side" value="top" checked />
2783
+ <label for="side-top">Top</label>
2784
+
2785
+ <input id="side-bottom" type="radio" name="side" value="bottom" />
2786
+ <label for="side-bottom">Bottom</label>
2787
+ </div>
2788
+
2789
+ <label class="toggle" title="Grid">
2790
+ <input type="checkbox" id="grid-toggle" />
2791
+ Grid
2792
+ </label>
2793
+
2794
+ <div class="select" title="Grid units">
2795
+ Units
2796
+ <select id="grid-units">
2797
+ <option value="in" selected>in</option>
2798
+ <option value="mm">mm</option>
2799
+ </select>
2800
+ </div>
2801
+
2802
+ <button class="btn" id="fit-btn" type="button" title="Fit to viewport">Fit</button>
2803
+ <button class="btn btn-primary" id="download-btn" type="button" title="Download">
2804
+ ${a}
2805
+ Download
2806
+ </button>
2807
+ </div>
2808
+ </div>
2809
+ </div>
2810
+
2811
+ <div class="viewer-body">
2812
+ <div id="board-viewport">
2813
+ <canvas id="grid-canvas"></canvas>
2814
+ <div id="board-content">
2815
+ <div id="board-stage">
2816
+ <div class="board-clip" id="boardClip">
2817
+ <div class="layer-frame" id="layer-fr4" style="z-index:0;">
2818
+ <img class="layer fr4" id="img-fr4" alt="FR4" />
2819
+ </div>
2820
+
2821
+ <div class="layer-frame" id="layer-bottom-copper"><img class="layer" id="img-bottom-copper" alt="Bottom copper" /></div>
2822
+ <div class="layer-frame" id="layer-bottom-mask"><img class="layer" id="img-bottom-mask" alt="Bottom mask" /></div>
2823
+ <div class="layer-frame" id="layer-bottom-silk"><img class="layer" id="img-bottom-silk" alt="Bottom silk" /></div>
2824
+
2825
+ <div class="layer-frame" id="layer-top-copper"><img class="layer" id="img-top-copper" alt="Top copper" /></div>
2826
+ <div class="layer-frame" id="layer-top-mask"><img class="layer" id="img-top-mask" alt="Top mask" /></div>
2827
+ <div class="layer-frame" id="layer-top-silk"><img class="layer" id="img-top-silk" alt="Top silk" /></div>
2828
+
2829
+ <div class="layer-frame" id="layer-drills"><img class="layer" id="img-drills" alt="Drills" /></div>
2830
+ <div class="layer-frame" id="layer-vias"><img class="layer" id="img-vias" alt="Vias" /></div>
2831
+ </div>
2832
+ </div>
2833
+ </div>
2834
+
2835
+ <div class="board-viewer-hint">Scroll to zoom, drag to pan.</div>
2836
+ </div>
2837
+ </div>
2838
+ </div>
2839
+ `;
2840
+ const y = M.firstElementChild, m = pt(y, "#board-viewport"), l = pt(y, "#board-content"), i = pt(y, "#board-stage"), r = pt(y, "#boardClip"), o = pt(y, "#grid-canvas"), b = pt(y, "#grid-toggle"), v = pt(y, "#grid-units"), _ = pt(y, "#fit-btn"), d = pt(y, "#download-btn"), s = Array.from(y.querySelectorAll('input[name="side"]')), p = pt(y, "#img-fr4"), n = pt(y, "#img-top-copper"), h = pt(y, "#img-bottom-copper"), c = pt(y, "#img-top-mask"), g = pt(y, "#img-bottom-mask"), x = pt(y, "#img-top-silk"), z = pt(y, "#img-bottom-silk"), C = pt(y, "#img-drills"), D = pt(y, "#img-vias");
2841
+ let T = null, P = {}, O = 1, W = 0, V = 0, w = !1, R = 0, e = 0, N = 0, tt = 0, U = !1, et = !1;
2842
+ function X(G) {
2843
+ return de(G, 0.2, 8);
2844
+ }
2845
+ function J() {
2846
+ U || (U = !0, requestAnimationFrame(() => {
2847
+ U = !1, l.style.transform = `translate3d(${W}px, ${V}px, 0) scale(${O})`, b.checked && H();
2848
+ }));
2849
+ }
2850
+ function B(G = 0.08) {
2851
+ const t = m.getBoundingClientRect(), F = i.offsetWidth || 1, I = i.offsetHeight || 1, f = Math.max(1, t.width * (1 - 2 * G)), u = Math.max(1, t.height * (1 - 2 * G));
2852
+ O = X(Math.min(f / F, u / I)), W = (t.width - O * F) / 2, V = (t.height - O * I) / 2, J();
2853
+ }
2854
+ function A() {
2855
+ let G = 1e3;
2856
+ if (T?.board?.width_in) {
2857
+ const F = i.getBoundingClientRect().width / O;
2858
+ Number.isFinite(F) && F > 0 && (G = F / T.board.width_in);
2859
+ }
2860
+ return G;
2861
+ }
2862
+ function K() {
2863
+ const G = window.devicePixelRatio || 1, t = m.getBoundingClientRect();
2864
+ o.width = Math.max(1, Math.floor(t.width * G)), o.height = Math.max(1, Math.floor(t.height * G)), o.style.width = `${t.width}px`, o.style.height = `${t.height}px`;
2865
+ }
2866
+ function H() {
2867
+ if (!b.checked) {
2868
+ o.style.display = "none";
2869
+ return;
2870
+ }
2871
+ o.style.display = "block";
2872
+ const G = o.getContext("2d");
2873
+ if (!G) return;
2874
+ const t = window.devicePixelRatio || 1, F = m.getBoundingClientRect(), I = F.width, f = F.height;
2875
+ G.setTransform(t, 0, 0, t, 0, 0), G.clearRect(0, 0, I, f);
2876
+ const u = A(), S = u / 25.4, L = v.value, j = L === "mm" ? S * 1 : u * 0.1, E = L === "mm" ? S * 10 : u * 1, Z = j * O, q = E * O;
2877
+ if (!Number.isFinite(Z) || Z < 6) return;
2878
+ const Y = Rt(W, Z), Q = Rt(V, Z), lt = Rt(W, q), st = Rt(V, q);
2879
+ G.lineWidth = 1, G.strokeStyle = "rgba(17, 24, 39, 0.12)", G.beginPath();
2880
+ for (let ct = Y; ct < I; ct += Z) {
2881
+ const mt = Math.round(ct) + 0.5;
2882
+ G.moveTo(mt, 0), G.lineTo(mt, f);
2883
+ }
2884
+ for (let ct = Q; ct < f; ct += Z) {
2885
+ const mt = Math.round(ct) + 0.5;
2886
+ G.moveTo(0, mt), G.lineTo(I, mt);
2887
+ }
2888
+ if (G.stroke(), Number.isFinite(q) && q >= 12) {
2889
+ G.strokeStyle = "rgba(17, 24, 39, 0.22)", G.beginPath();
2890
+ for (let ct = lt; ct < I; ct += q) {
2891
+ const mt = Math.round(ct) + 0.5;
2892
+ G.moveTo(mt, 0), G.lineTo(mt, f);
2893
+ }
2894
+ for (let ct = st; ct < f; ct += q) {
2895
+ const mt = Math.round(ct) + 0.5;
2896
+ G.moveTo(0, mt), G.lineTo(I, mt);
2897
+ }
2898
+ G.stroke();
2899
+ }
2900
+ }
2901
+ function $(G, t) {
2902
+ const F = y.querySelector(`#${G}`);
2903
+ F && (F.style.display = t ? "block" : "none");
2904
+ }
2905
+ function ut(G) {
2906
+ G && r.style.setProperty("--board-mask-url", `url('${G}')`);
2907
+ }
2908
+ function ht(G) {
2909
+ const t = G === "top", F = G === "bottom";
2910
+ $("layer-top-copper", t && !!P.top_copper), $("layer-top-mask", t && !!P.top_mask), $("layer-top-silk", t && !!P.top_silk), $("layer-bottom-copper", F && !!P.bottom_copper), $("layer-bottom-mask", F && !!P.bottom_mask), $("layer-bottom-silk", F && !!P.bottom_silk), $("layer-drills", !!P.drills), $("layer-vias", !!P.vias);
2911
+ const I = G === "bottom" ? P.bottom_board_mask ?? P.top_board_mask : P.top_board_mask ?? P.bottom_board_mask;
2912
+ I && ut(I);
2913
+ }
2914
+ function rt() {
2915
+ if (!T?.board) return;
2916
+ const G = 1e3, t = Math.round((T.board.width_in || 1) * G), F = Math.round((T.board.height_in || 1) * G);
2917
+ i.style.width = `${t}px`, i.style.height = `${F}px`;
2918
+ }
2919
+ m.addEventListener("wheel", (G) => {
2920
+ G.preventDefault(), et = !0;
2921
+ const t = m.getBoundingClientRect(), F = G.clientX - t.left, I = G.clientY - t.top, f = O, u = 1.1;
2922
+ O = G.deltaY < 0 ? X(O * u) : X(O / u);
2923
+ const S = O / f;
2924
+ W = F - (F - W) * S, V = I - (I - V) * S, J();
2925
+ }, { passive: !1 }), m.addEventListener("mousedown", (G) => {
2926
+ G.button === 0 && (G.preventDefault(), et = !0, w = !0, m.classList.add("grabbing"), R = G.clientX, e = G.clientY, N = W, tt = V);
2927
+ });
2928
+ const nt = (G) => {
2929
+ if (!w) return;
2930
+ const t = G.clientX - R, F = G.clientY - e;
2931
+ W = N + t, V = tt + F, J();
2932
+ }, ot = () => {
2933
+ w && (w = !1, m.classList.remove("grabbing"));
2934
+ };
2935
+ window.addEventListener("mousemove", nt), window.addEventListener("mouseup", ot), b.addEventListener("change", () => {
2936
+ K(), H();
2937
+ }), v.addEventListener("change", H), _.addEventListener("click", () => B(0.08)), d.addEventListener("click", () => {
2938
+ k.onDownload?.();
2939
+ }), s.forEach((G) => {
2940
+ G.addEventListener("change", () => {
2941
+ const t = s.find((F) => F.checked)?.value || "top";
2942
+ ht(t);
2943
+ });
2944
+ }), window.addEventListener("resize", () => {
2945
+ K(), et ? J() : B(0.08);
2946
+ });
2947
+ function at(G) {
2948
+ T = G.boardGeom, P = G.layers, wt(n, P.top_copper), wt(h, P.bottom_copper), wt(c, P.top_mask), wt(g, P.bottom_mask), wt(x, P.top_silk), wt(z, P.bottom_silk), wt(C, P.drills), wt(D, P.vias), wt(p, P.top_copper ?? P.bottom_copper), rt(), K(), B(0.08);
2949
+ const t = s.find((F) => F.checked)?.value || "top";
2950
+ ht(t), J();
2951
+ }
2952
+ function it() {
2953
+ window.removeEventListener("mousemove", nt), window.removeEventListener("mouseup", ot), M.innerHTML = "";
2954
+ }
2955
+ return {
2956
+ setData: at,
2957
+ setSideMode: (G) => {
2958
+ const t = s.find((F) => F.value === G);
2959
+ t && (t.checked = !0), ht(G);
2960
+ },
2961
+ fit: () => B(0.08),
2962
+ dispose: it
2963
+ };
2964
+ }
2965
+ export {
2966
+ pe as createBoardViewer,
2967
+ fe as renderGerbersZip
2968
+ };
2969
+ //# sourceMappingURL=gerbers-renderer.es.js.map