@fileverse-dev/dsheet 4.0.4 → 4.0.5

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