ppt-dsl-renderer 1.1.2 → 1.1.3

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.
package/dist/cli.js CHANGED
@@ -1,43 +1,45 @@
1
1
  #!/usr/bin/env node
2
- import { parseArgs as j } from "node:util";
3
- import { readFile as $, mkdir as T, writeFile as D, rename as I, rm as B } from "node:fs/promises";
4
- import { resolve as w, dirname as P, join as S } from "node:path";
5
- import { fileURLToPath as L } from "node:url";
6
- import { randomUUID as C } from "node:crypto";
7
- function J(t) {
8
- const e = { status: "loading", errors: [] };
9
- t.__PPT_DSL_RENDER__ = e;
10
- const s = (i) => {
11
- e.status = "error", e.errors.push(i);
2
+ import { parseArgs as ae } from "node:util";
3
+ import { readFile as xt, mkdir as Pt, writeFile as Lt, rename as Xt, rm as Yt, stat as Bt, readdir as se } from "node:fs/promises";
4
+ import Mt, { resolve as ft, dirname as Tt, join as St, extname as Zt } from "node:path";
5
+ import { fileURLToPath as Ut, pathToFileURL as qt } from "node:url";
6
+ import { randomUUID as Kt } from "node:crypto";
7
+ import { createRequire as oe } from "node:module";
8
+ import Jt from "node:fs";
9
+ function le(E) {
10
+ const P = { status: "loading", errors: [] };
11
+ E.__PPT_DSL_RENDER__ = P;
12
+ const n = (S) => {
13
+ P.status = "error", P.errors.push(S);
12
14
  };
13
- t.addEventListener("error", (i) => {
14
- var a;
15
- i.message ? s(i.message) : (a = i.target) != null && a.src && s(`资源加载失败:${i.target.src}`);
16
- }, !0), t.addEventListener("unhandledrejection", (i) => {
17
- var a;
18
- s(((a = i.reason) == null ? void 0 : a.message) || String(i.reason));
19
- }), t.setTimeout(() => {
20
- e.status === "loading" && s("渲染超过 30 秒仍未完成");
15
+ E.addEventListener("error", (S) => {
16
+ var g;
17
+ S.message ? n(S.message) : (g = S.target) != null && g.src && n(`资源加载失败:${S.target.src}`);
18
+ }, !0), E.addEventListener("unhandledrejection", (S) => {
19
+ var g;
20
+ n(((g = S.reason) == null ? void 0 : g.message) || String(S.reason));
21
+ }), E.setTimeout(() => {
22
+ P.status === "loading" && n("渲染超过 30 秒仍未完成");
21
23
  }, 3e4);
22
24
  }
23
- function H(t) {
24
- const { width: e, height: s } = JSON.parse(t.document.getElementById("ppt-dsl-data").textContent), i = t.document.getElementById("ppt-stage"), a = t.document.getElementById("ppt-root");
25
- a.style.width = `${e}px`, a.style.height = `${s}px`;
25
+ function he(E) {
26
+ const { width: P, height: n } = JSON.parse(E.document.getElementById("ppt-dsl-data").textContent), S = E.document.getElementById("ppt-stage"), g = E.document.getElementById("ppt-root");
27
+ g.style.width = `${P}px`, g.style.height = `${n}px`;
26
28
  const l = () => {
27
- const d = Math.min(1, t.innerWidth / e, t.innerHeight / s);
28
- i.style.width = `${e * d}px`, i.style.height = `${s * d}px`, a.style.transform = `scale(${d})`;
29
+ const o = Math.min(1, E.innerWidth / P, E.innerHeight / n);
30
+ S.style.width = `${P * o}px`, S.style.height = `${n * o}px`, g.style.transform = `scale(${o})`;
29
31
  };
30
- l(), t.addEventListener("resize", l);
32
+ l(), E.addEventListener("resize", l);
31
33
  }
32
- function X(t, e, s) {
33
- const i = t.replaceAll("<", "\\u003c").replaceAll("\u2028", "\\u2028").replaceAll("\u2029", "\\u2029");
34
+ function ce(E, P, n) {
35
+ const S = E.replaceAll("<", "\\u003c").replaceAll("\u2028", "\\u2028").replaceAll("\u2029", "\\u2029");
34
36
  return `<!doctype html>
35
37
  <html lang="zh-CN">
36
38
  <head>
37
39
  <meta charset="utf-8">
38
40
  <meta name="viewport" content="width=device-width, initial-scale=1">
39
41
  <title>PPT DSL</title>
40
- <style>${s.replace(/<\/style/gi, "<\\/style")}
42
+ <style>${n.replace(/<\/style/gi, "<\\/style")}
41
43
  html, body { width: 100%; height: 100%; overflow: hidden; }
42
44
  #ppt-viewport { position: fixed; inset: 0; display: grid; place-items: center; background: #f2f4f6; }
43
45
  #ppt-stage { position: relative; }
@@ -46,200 +48,3556 @@ html, body { width: 100%; height: 100%; overflow: hidden; }
46
48
  </head>
47
49
  <body>
48
50
  <div id="ppt-viewport"><div id="ppt-stage"><div id="ppt-root"></div></div></div>
49
- <script id="ppt-dsl-data" type="application/json">${i}<\/script>
50
- <script>(${J.toString()})(window);(${H.toString()})(window);<\/script>
51
- <script>${e.replace(/<\/script/gi, "<\\/script")}<\/script>
51
+ <script id="ppt-dsl-data" type="application/json">${S}<\/script>
52
+ <script>(${le.toString()})(window);(${he.toString()})(window);<\/script>
53
+ <script>${P.replace(/<\/script/gi, "<\\/script")}<\/script>
52
54
  </body>
53
55
  </html>`;
54
56
  }
55
- const M = /* @__PURE__ */ new Set(["text", "image", "shape", "line", "chart", "table", "latex", "video", "audio"]), z = /* @__PURE__ */ new Set(["area", "bar", "column", "line", "pie", "radar", "ring", "scatter"]), b = (t) => t !== null && typeof t == "object" && !Array.isArray(t), u = (t) => typeof t == "string", E = (t) => Array.isArray(t) && t.length === 2 && t.every(Number.isFinite);
56
- function n(t, e) {
57
- if (!t)
58
- throw new Error(e);
59
- }
60
- function N(t, e) {
61
- n(u(t) && /^(https?:\/\/|data:)/i.test(t), `${e} 必须使用 HTTP(S) URL 或 data URL`);
62
- const s = new URL(t);
63
- n(["http:", "https:", "data:"].includes(s.protocol), `${e} 资源协议不受支持`);
64
- }
65
- function k(t) {
66
- n(b(t), "DSL 顶层必须是对象"), n(u(t.title) && t.title.length > 0, "DSL 缺少 title"), n(Number.isFinite(t.width) && t.width > 0, "DSL width 必须是大于 0 的有限数值"), n(Number.isFinite(t.height) && t.height > 0, "DSL height 必须是大于 0 的有限数值"), n(Array.isArray(t.slides) && t.slides.length > 0, "DSL slides 不能为空"), t.slides.forEach((e, s) => {
67
- var l, d;
68
- const i = `第 ${s + 1} 页`;
69
- n(b(e) && u(e.id) && e.id && Array.isArray(e.elements), `${i}结构无效`), ((l = e.background) == null ? void 0 : l.type) === "image" && N((d = e.background.image) == null ? void 0 : d.src, `${i}背景图`);
70
- const a = /* @__PURE__ */ new Set();
71
- e.elements.forEach((r) => {
72
- var g;
73
- n(b(r) && u(r.id) && r.id && M.has(r.type), `${i}存在无效元素`);
74
- const p = `${i}元素 ${r.id}`;
75
- n(!a.has(r.id), `${p} ID 重复`), a.add(r.id), n([r.left, r.top].every(Number.isFinite), `${p}缺少有效坐标`);
76
- for (const o of ["width", "height", "rotate", "opacity"])
77
- r[o] !== void 0 && n(Number.isFinite(r[o]), `${p}.${o} 必须是有限数值`);
78
- switch (r.type) {
57
+ const ue = /* @__PURE__ */ new Set(["text", "image", "shape", "line", "chart", "table", "latex", "video", "audio"]), de = /* @__PURE__ */ new Set(["area", "bar", "column", "line", "pie", "radar", "ring", "scatter"]), vt = (E) => E !== null && typeof E == "object" && !Array.isArray(E), ut = (E) => typeof E == "string", Ft = (E) => Array.isArray(E) && E.length === 2 && E.every(Number.isFinite);
58
+ function at(E, P) {
59
+ if (!E)
60
+ throw new Error(P);
61
+ }
62
+ function Rt(E, P) {
63
+ at(ut(E) && /^(https?:\/\/|data:)/i.test(E), `${P} 必须使用 HTTP(S) URL 或 data URL`);
64
+ const n = new URL(E);
65
+ at(["http:", "https:", "data:"].includes(n.protocol), `${P} 资源协议不受支持`);
66
+ }
67
+ function Vt(E) {
68
+ at(vt(E), "DSL 顶层必须是对象"), at(ut(E.title) && E.title.length > 0, "DSL 缺少 title"), at(Number.isFinite(E.width) && E.width > 0, "DSL width 必须是大于 0 的有限数值"), at(Number.isFinite(E.height) && E.height > 0, "DSL height 必须是大于 0 的有限数值"), at(Array.isArray(E.slides) && E.slides.length > 0, "DSL slides 不能为空"), E.slides.forEach((P, n) => {
69
+ var l, o;
70
+ const S = `第 ${n + 1} 页`;
71
+ at(vt(P) && ut(P.id) && P.id && Array.isArray(P.elements), `${S}结构无效`), ((l = P.background) == null ? void 0 : l.type) === "image" && Rt((o = P.background.image) == null ? void 0 : o.src, `${S}背景图`);
72
+ const g = /* @__PURE__ */ new Set();
73
+ P.elements.forEach((e) => {
74
+ var d;
75
+ at(vt(e) && ut(e.id) && e.id && ue.has(e.type), `${S}存在无效元素`);
76
+ const a = `${S}元素 ${e.id}`;
77
+ at(!g.has(e.id), `${a} ID 重复`), g.add(e.id), at([e.left, e.top].every(Number.isFinite), `${a}缺少有效坐标`);
78
+ for (const c of ["width", "height", "rotate", "opacity"])
79
+ e[c] !== void 0 && at(Number.isFinite(e[c]), `${a}.${c} 必须是有限数值`);
80
+ switch (e.type) {
79
81
  case "text":
80
- n(u(r.content), `${p}.content 必须是字符串`);
82
+ at(ut(e.content), `${a}.content 必须是字符串`);
81
83
  break;
82
84
  case "image":
83
85
  case "audio":
84
86
  case "video":
85
- N(r.src, `${p}.src`), r.poster !== void 0 && N(r.poster, `${p}.poster`);
87
+ Rt(e.src, `${a}.src`), e.poster !== void 0 && Rt(e.poster, `${a}.poster`);
86
88
  break;
87
89
  case "shape":
88
- n(u(r.path) && E(r.viewBox), `${p}缺少 path 或有效 viewBox`), r.text !== void 0 && n(u((g = r.text) == null ? void 0 : g.content), `${p}.text.content 必须是字符串`);
90
+ at(ut(e.path) && Ft(e.viewBox), `${a}缺少 path 或有效 viewBox`), e.text !== void 0 && at(ut((d = e.text) == null ? void 0 : d.content), `${a}.text.content 必须是字符串`);
89
91
  break;
90
92
  case "line":
91
- n(E(r.start) && E(r.end) && u(r.color), `${p}缺少 start、end 或 color`);
93
+ at(Ft(e.start) && Ft(e.end) && ut(e.color), `${a}缺少 start、end 或 color`);
92
94
  break;
93
95
  case "chart": {
94
- const o = r.data;
95
- n(z.has(r.chartType), `${p}.chartType 不受支持`), n(b(o) && Array.isArray(o.labels) && o.labels.every(u) && Array.isArray(o.legends) && o.legends.every(u) && Array.isArray(o.series) && o.series.every((h) => Array.isArray(h) && h.every(Number.isFinite)), `${p}.data 结构无效`);
96
+ const c = e.data;
97
+ at(de.has(e.chartType), `${a}.chartType 不受支持`), at(vt(c) && Array.isArray(c.labels) && c.labels.every(ut) && Array.isArray(c.legends) && c.legends.every(ut) && Array.isArray(c.series) && c.series.every((_) => Array.isArray(_) && _.every(Number.isFinite)), `${a}.data 结构无效`);
96
98
  break;
97
99
  }
98
100
  case "table":
99
- n(Array.isArray(r.data) && r.data.every((o) => Array.isArray(o) && o.every((h) => b(h) && u(h.id) && h.id && u(h.text))), `${p}.data 结构无效`);
101
+ at(Array.isArray(e.data) && e.data.every((c) => Array.isArray(c) && c.every((_) => vt(_) && ut(_.id) && _.id && ut(_.text))), `${a}.data 结构无效`);
100
102
  break;
101
103
  case "latex":
102
- n(u(r.latex), `${p}.latex 必须是字符串`);
104
+ at(ut(e.latex), `${a}.latex 必须是字符串`);
103
105
  break;
104
106
  }
105
107
  });
106
108
  });
107
109
  }
108
- function F(t, e) {
109
- return e === void 0 ? Array.from({ length: t }, (s, i) => i + 1) : (n(Array.isArray(e) && e.length > 0, "pages 必须是非空页码数组"), n(e.every((s) => Number.isInteger(s) && s >= 1 && s <= t), `页码必须是 1 到 ${t} 的整数`), [...new Set(e)].sort((s, i) => s - i));
110
- }
111
- const v = w(P(L(import.meta.url)), "..");
112
- async function q(t, e = {}) {
113
- k(t);
114
- const i = F(t.slides.length, e.pages).map((d) => ({
115
- pageNumber: d,
116
- slideId: t.slides[d - 1].id,
117
- width: t.width,
118
- height: t.height,
110
+ function Qt(E, P) {
111
+ return P === void 0 ? Array.from({ length: E }, (n, S) => S + 1) : (at(Array.isArray(P) && P.length > 0, "pages 必须是非空页码数组"), at(P.every((n) => Number.isInteger(n) && n >= 1 && n <= E), `页码必须是 1 到 ${E} 的整数`), [...new Set(P)].sort((n, S) => n - S));
112
+ }
113
+ const $t = ft(Tt(Ut(import.meta.url)), "..");
114
+ async function fe(E, P = {}) {
115
+ Vt(E);
116
+ const S = Qt(E.slides.length, P.pages).map((o) => ({
117
+ pageNumber: o,
118
+ slideId: E.slides[o - 1].id,
119
+ width: E.width,
120
+ height: E.height,
119
121
  payload: JSON.stringify({
120
- title: t.title,
121
- width: t.width,
122
- height: t.height,
123
- pageNumber: d,
124
- slide: t.slides[d - 1]
122
+ title: E.title,
123
+ width: E.width,
124
+ height: E.height,
125
+ pageNumber: o,
126
+ slide: E.slides[o - 1]
125
127
  })
126
128
  }));
127
- let a, l;
129
+ let g, l;
128
130
  try {
129
- [a, l] = await Promise.all([
130
- $(S(v, "dist/browser/renderer.js"), "utf8"),
131
- $(S(v, "dist/browser/renderer.css"), "utf8")
131
+ [g, l] = await Promise.all([
132
+ xt(St($t, "dist/browser/renderer.js"), "utf8"),
133
+ xt(St($t, "dist/browser/renderer.css"), "utf8")
132
134
  ]);
133
- } catch (d) {
134
- throw d.code !== "ENOENT" ? d : new Error("缺少预编译浏览器资源。源码仓库请先显式执行 yarn build;npm 安装包应包含 dist/browser。", { cause: d });
135
+ } catch (o) {
136
+ throw o.code !== "ENOENT" ? o : new Error("缺少预编译浏览器资源。源码仓库请先显式执行 yarn build;npm 安装包应包含 dist/browser。", { cause: o });
135
137
  }
136
- return i.map(({ payload: d, ...r }) => ({
137
- ...r,
138
- html: X(d, a, l)
138
+ return S.map(({ payload: o, ...e }) => ({
139
+ ...e,
140
+ html: ce(o, g, l)
139
141
  }));
140
142
  }
141
- const V = w(P(L(import.meta.url)), "..");
142
- async function W(t, e, { pages: s, executablePath: i, timeout: a = 12e4 } = {}) {
143
- k(t);
144
- const l = F(t.slides.length, s), d = await $(S(V, "dist/pptx/exporter.js"), "utf8").catch((c) => {
145
- throw c.code !== "ENOENT" ? c : new Error("安装包缺少 PPTX 运行产物,请使用完整构建的 ppt-dsl-renderer 包。", { cause: c });
146
- }), { chromium: r } = await import("playwright-core").catch((c) => {
147
- throw c.code !== "ERR_MODULE_NOT_FOUND" ? c : new Error("PPTX 导出需要显式安装 playwright-core@1.61.1。", { cause: c });
148
- }), p = await r.launch({ headless: !0, ...i ? { executablePath: i } : { channel: "chrome" }, timeout: a });
149
- let g, o;
143
+ const pe = ft(Tt(Ut(import.meta.url)), "..");
144
+ async function me(E, P, { pages: n, executablePath: S, timeout: g = 12e4 } = {}) {
145
+ Vt(E);
146
+ const l = Qt(E.slides.length, n), o = await xt(St(pe, "dist/pptx/exporter.js"), "utf8").catch((v) => {
147
+ throw v.code !== "ENOENT" ? v : new Error("安装包缺少 PPTX 运行产物,请使用完整构建的 ppt-dsl-renderer 包。", { cause: v });
148
+ }), { chromium: e } = await import("playwright-core").catch((v) => {
149
+ throw v.code !== "ERR_MODULE_NOT_FOUND" ? v : new Error("PPTX 导出需要显式安装 playwright-core@1.61.1。", { cause: v });
150
+ }), a = await e.launch({ headless: !0, ...S ? { executablePath: S } : { channel: "chrome" }, timeout: g });
151
+ let d, c;
150
152
  try {
151
- const c = (async () => {
152
- const f = await p.newPage();
153
- f.on("console", (y) => console.error(y.text())), f.on("pageerror", (y) => console.error(y.message)), await f.addScriptTag({ content: d });
154
- const A = await f.evaluate(async ({ document: y, pages: O }) => {
155
- const R = await window.exportToPptx(y, { pages: O });
156
- return new Promise((U, _) => {
157
- const m = new FileReader();
158
- m.onload = () => U(m.result.split(",", 2)[1]), m.onerror = () => _(m.error), m.readAsDataURL(new Blob([R]));
153
+ const v = (async () => {
154
+ const s = await a.newPage();
155
+ s.on("console", (i) => console.error(i.text())), s.on("pageerror", (i) => console.error(i.message)), await s.addScriptTag({ content: o });
156
+ const m = await s.evaluate(async ({ document: i, pages: f }) => {
157
+ const h = await window.exportToPptx(i, { pages: f });
158
+ return new Promise((u, w) => {
159
+ const k = new FileReader();
160
+ k.onload = () => u(k.result.split(",", 2)[1]), k.onerror = () => w(k.error), k.readAsDataURL(new Blob([h]));
159
161
  });
160
- }, { document: t, pages: l });
161
- return Buffer.from(A, "base64");
162
+ }, { document: E, pages: l });
163
+ return Buffer.from(m, "base64");
162
164
  })();
163
- o = await Promise.race([
164
- c,
165
- new Promise((f, A) => {
166
- g = setTimeout(() => A(new Error(`PPTX 导出超时(${a}ms)`)), a);
165
+ c = await Promise.race([
166
+ v,
167
+ new Promise((s, m) => {
168
+ d = setTimeout(() => m(new Error(`PPTX 导出超时(${g}ms)`)), g);
167
169
  })
168
170
  ]);
169
171
  } finally {
170
- clearTimeout(g), await p.close();
172
+ clearTimeout(d), await a.close();
171
173
  }
172
- await T(P(e), { recursive: !0 });
173
- const h = `${e}.${C()}.tmp`;
174
+ await Pt(Tt(P), { recursive: !0 });
175
+ const _ = `${P}.${Kt()}.tmp`;
174
176
  try {
175
- await D(h, o, { flag: "wx" }), await I(h, e);
177
+ await Lt(_, c, { flag: "wx" }), await Xt(_, P);
176
178
  } finally {
177
- await B(h, { force: !0 });
179
+ await Yt(_, { force: !0 });
178
180
  }
179
- return { file: e, pages: l.map((c) => ({ pageNumber: c, slideId: t.slides[c - 1].id })), bytes: o.length };
181
+ return { file: P, pages: l.map((v) => ({ pageNumber: v, slideId: E.slides[v - 1].id })), bytes: c.length };
180
182
  }
181
- const x = `Usage:
183
+ const kt = `Usage:
182
184
  ppt-dsl-renderer render <deck.json> --out-dir <directory> [--pages 1,3]
183
185
  ppt-dsl-renderer export-pptx <deck.json> --out <file.pptx> [--pages 1,3]
186
+ ppt-dsl-renderer export-html-pptx <file.html|directory> --out <file.pptx> [--selector <css>] [--assets-root <directory>]
184
187
 
185
188
  PPTX options:
186
189
  --browser-executable <path> Use an existing Chromium executable (default: installed Chrome).
187
- --timeout <milliseconds> Browser launch/export timeout (default: 120000).
190
+ --timeout <milliseconds> DSL export browser launch/export timeout (default: 120000).
191
+
192
+ HTML PPTX options:
193
+ --selector <css> Select the slide root; otherwise detect common roots or use body.
194
+ --assets-root <directory> Resolve missing local images; unresolved images become blank placeholders.
188
195
 
189
196
  Page numbers start at 1. Success writes a JSON file manifest to stdout.
190
197
  Errors and browser diagnostics go to stderr; failure exits with code 1.
191
198
  render generates HTML without launching a browser.
192
- export-pptx requires Chrome or Chromium installed at deployment time; it never downloads a browser.`;
193
- async function G() {
194
- var g;
195
- const { values: t, positionals: e } = j({
199
+ export-pptx requires Chrome or Chromium installed at deployment time; it never downloads a browser.
200
+ export-html-pptx has the same browser requirement; a directory reads direct .html children in natural order.`;
201
+ async function ge() {
202
+ var d;
203
+ const { values: E, positionals: P } = ae({
196
204
  allowPositionals: !0,
197
205
  options: {
198
206
  "out-dir": { type: "string" },
199
207
  out: { type: "string" },
200
208
  pages: { type: "string" },
201
209
  "browser-executable": { type: "string" },
210
+ selector: { type: "string" },
211
+ "assets-root": { type: "string" },
202
212
  timeout: { type: "string" },
203
213
  help: { type: "boolean", short: "h" }
204
214
  }
205
215
  });
206
- if (t.help) {
207
- console.log(x);
216
+ if (E.help) {
217
+ console.log(kt);
208
218
  return;
209
219
  }
210
- const [s, i] = e;
211
- if (e.length !== 2 || !["render", "export-pptx"].includes(s))
212
- throw new Error(x);
213
- if (s === "render" && (!t["out-dir"] || t.out !== void 0 || t["browser-executable"] !== void 0 || t.timeout !== void 0))
214
- throw new Error(x);
215
- if (s === "export-pptx" && (!t.out || t["out-dir"] !== void 0))
216
- throw new Error(x);
217
- if (t.pages !== void 0 && !/^\d+(,\d+)*$/.test(t.pages))
220
+ const [n, S] = P;
221
+ if (P.length !== 2 || !["render", "export-pptx", "export-html-pptx"].includes(n))
222
+ throw new Error(kt);
223
+ if (n === "render" && (!E["out-dir"] || E.out !== void 0 || E["browser-executable"] !== void 0 || E.timeout !== void 0 || E.selector !== void 0 || E["assets-root"] !== void 0))
224
+ throw new Error(kt);
225
+ if (n === "export-pptx" && (!E.out || E["out-dir"] !== void 0 || E.selector !== void 0 || E["assets-root"] !== void 0))
226
+ throw new Error(kt);
227
+ if (n === "export-html-pptx" && (!E.out || E["out-dir"] !== void 0 || E.pages !== void 0 || E.timeout !== void 0))
228
+ throw new Error(kt);
229
+ if (E.pages !== void 0 && !/^\d+(,\d+)*$/.test(E.pages))
218
230
  throw new Error("--pages 格式必须为 1,3 这样的页码列表");
219
- const a = (g = t.pages) == null ? void 0 : g.split(",").map(Number);
220
- if (t.timeout !== void 0 && (!/^\d+$/.test(t.timeout) || !Number.isSafeInteger(Number(t.timeout)) || Number(t.timeout) <= 0))
231
+ const g = (d = E.pages) == null ? void 0 : d.split(",").map(Number);
232
+ if (E.timeout !== void 0 && (!/^\d+$/.test(E.timeout) || !Number.isSafeInteger(Number(E.timeout)) || Number(E.timeout) <= 0))
221
233
  throw new Error("--timeout 必须是正整数毫秒");
222
- if (s === "export-pptx" && w(i) === w(t.out))
223
- throw new Error("--out 不能覆盖输入 DSL 文件");
224
- const l = JSON.parse(await $(w(i), "utf8"));
225
- if (s === "export-pptx") {
226
- const o = await W(l, w(t.out), {
227
- pages: a,
228
- executablePath: t["browser-executable"] ? w(t["browser-executable"]) : void 0,
229
- timeout: t.timeout === void 0 ? void 0 : Number(t.timeout)
234
+ if (n !== "render" && ft(S) === ft(E.out))
235
+ throw new Error("--out 不能覆盖输入文件");
236
+ if (n === "export-html-pptx") {
237
+ const { exportHtmlToPptxFile: c } = await Promise.resolve().then(() => Oe), _ = await c(S, ft(E.out), {
238
+ selector: E.selector,
239
+ browserExecutable: E["browser-executable"] ? ft(E["browser-executable"]) : void 0,
240
+ assetsRoot: E["assets-root"] ? ft(E["assets-root"]) : void 0
241
+ });
242
+ console.log(JSON.stringify(_, null, 2));
243
+ return;
244
+ }
245
+ const l = JSON.parse(await xt(ft(S), "utf8"));
246
+ if (n === "export-pptx") {
247
+ const c = await me(l, ft(E.out), {
248
+ pages: g,
249
+ executablePath: E["browser-executable"] ? ft(E["browser-executable"]) : void 0,
250
+ timeout: E.timeout === void 0 ? void 0 : Number(E.timeout)
230
251
  });
231
- console.log(JSON.stringify(o, null, 2));
252
+ console.log(JSON.stringify(c, null, 2));
232
253
  return;
233
254
  }
234
- const d = await q(l, { pages: a }), r = w(t["out-dir"]);
235
- await T(r, { recursive: !0 });
236
- const p = [];
237
- for (const { html: o, ...h } of d) {
238
- const c = S(r, `slide-${String(h.pageNumber).padStart(3, "0")}.html`);
239
- await D(c, o, "utf8"), p.push({ ...h, file: c });
255
+ const o = await fe(l, { pages: g }), e = ft(E["out-dir"]);
256
+ await Pt(e, { recursive: !0 });
257
+ const a = [];
258
+ for (const { html: c, ..._ } of o) {
259
+ const v = St(e, `slide-${String(_.pageNumber).padStart(3, "0")}.html`);
260
+ await Lt(v, c, "utf8"), a.push({ ..._, file: v });
240
261
  }
241
- console.log(JSON.stringify({ pages: p }, null, 2));
262
+ console.log(JSON.stringify({ pages: a }, null, 2));
242
263
  }
243
- G().catch((t) => {
244
- console.error(t.message), process.exitCode = 1;
264
+ ge().catch((E) => {
265
+ console.error(E.message), process.exitCode = 1;
245
266
  });
267
+ var At = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
268
+ function _e(E) {
269
+ return E && E.__esModule && Object.prototype.hasOwnProperty.call(E, "default") ? E.default : E;
270
+ }
271
+ function zt(E) {
272
+ throw new Error('Could not dynamically require "' + E + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
273
+ }
274
+ var te = { exports: {} };
275
+ /*!
276
+
277
+ JSZip v3.10.1 - A JavaScript class for generating and reading zip files
278
+ <http://stuartk.com/jszip>
279
+
280
+ (c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
281
+ Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.
282
+
283
+ JSZip uses the library pako released under the MIT license :
284
+ https://github.com/nodeca/pako/blob/main/LICENSE
285
+ */
286
+ (function(E, P) {
287
+ (function(n) {
288
+ E.exports = n();
289
+ })(function() {
290
+ return function n(S, g, l) {
291
+ function o(d, c) {
292
+ if (!g[d]) {
293
+ if (!S[d]) {
294
+ var _ = typeof zt == "function" && zt;
295
+ if (!c && _)
296
+ return _(d, !0);
297
+ if (e)
298
+ return e(d, !0);
299
+ var v = new Error("Cannot find module '" + d + "'");
300
+ throw v.code = "MODULE_NOT_FOUND", v;
301
+ }
302
+ var s = g[d] = { exports: {} };
303
+ S[d][0].call(s.exports, function(m) {
304
+ var i = S[d][1][m];
305
+ return o(i || m);
306
+ }, s, s.exports, n, S, g, l);
307
+ }
308
+ return g[d].exports;
309
+ }
310
+ for (var e = typeof zt == "function" && zt, a = 0; a < l.length; a++)
311
+ o(l[a]);
312
+ return o;
313
+ }({ 1: [function(n, S, g) {
314
+ var l = n("./utils"), o = n("./support"), e = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
315
+ g.encode = function(a) {
316
+ for (var d, c, _, v, s, m, i, f = [], h = 0, u = a.length, w = u, k = l.getTypeOf(a) !== "string"; h < a.length; )
317
+ w = u - h, _ = k ? (d = a[h++], c = h < u ? a[h++] : 0, h < u ? a[h++] : 0) : (d = a.charCodeAt(h++), c = h < u ? a.charCodeAt(h++) : 0, h < u ? a.charCodeAt(h++) : 0), v = d >> 2, s = (3 & d) << 4 | c >> 4, m = 1 < w ? (15 & c) << 2 | _ >> 6 : 64, i = 2 < w ? 63 & _ : 64, f.push(e.charAt(v) + e.charAt(s) + e.charAt(m) + e.charAt(i));
318
+ return f.join("");
319
+ }, g.decode = function(a) {
320
+ var d, c, _, v, s, m, i = 0, f = 0, h = "data:";
321
+ if (a.substr(0, h.length) === h)
322
+ throw new Error("Invalid base64 input, it looks like a data url.");
323
+ var u, w = 3 * (a = a.replace(/[^A-Za-z0-9+/=]/g, "")).length / 4;
324
+ if (a.charAt(a.length - 1) === e.charAt(64) && w--, a.charAt(a.length - 2) === e.charAt(64) && w--, w % 1 != 0)
325
+ throw new Error("Invalid base64 input, bad content length.");
326
+ for (u = o.uint8array ? new Uint8Array(0 | w) : new Array(0 | w); i < a.length; )
327
+ d = e.indexOf(a.charAt(i++)) << 2 | (v = e.indexOf(a.charAt(i++))) >> 4, c = (15 & v) << 4 | (s = e.indexOf(a.charAt(i++))) >> 2, _ = (3 & s) << 6 | (m = e.indexOf(a.charAt(i++))), u[f++] = d, s !== 64 && (u[f++] = c), m !== 64 && (u[f++] = _);
328
+ return u;
329
+ };
330
+ }, { "./support": 30, "./utils": 32 }], 2: [function(n, S, g) {
331
+ var l = n("./external"), o = n("./stream/DataWorker"), e = n("./stream/Crc32Probe"), a = n("./stream/DataLengthProbe");
332
+ function d(c, _, v, s, m) {
333
+ this.compressedSize = c, this.uncompressedSize = _, this.crc32 = v, this.compression = s, this.compressedContent = m;
334
+ }
335
+ d.prototype = { getContentWorker: function() {
336
+ var c = new o(l.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")), _ = this;
337
+ return c.on("end", function() {
338
+ if (this.streamInfo.data_length !== _.uncompressedSize)
339
+ throw new Error("Bug : uncompressed data size mismatch");
340
+ }), c;
341
+ }, getCompressedWorker: function() {
342
+ return new o(l.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize", this.compressedSize).withStreamInfo("uncompressedSize", this.uncompressedSize).withStreamInfo("crc32", this.crc32).withStreamInfo("compression", this.compression);
343
+ } }, d.createWorkerFrom = function(c, _, v) {
344
+ return c.pipe(new e()).pipe(new a("uncompressedSize")).pipe(_.compressWorker(v)).pipe(new a("compressedSize")).withStreamInfo("compression", _);
345
+ }, S.exports = d;
346
+ }, { "./external": 6, "./stream/Crc32Probe": 25, "./stream/DataLengthProbe": 26, "./stream/DataWorker": 27 }], 3: [function(n, S, g) {
347
+ var l = n("./stream/GenericWorker");
348
+ g.STORE = { magic: "\0\0", compressWorker: function() {
349
+ return new l("STORE compression");
350
+ }, uncompressWorker: function() {
351
+ return new l("STORE decompression");
352
+ } }, g.DEFLATE = n("./flate");
353
+ }, { "./flate": 7, "./stream/GenericWorker": 28 }], 4: [function(n, S, g) {
354
+ var l = n("./utils"), o = function() {
355
+ for (var e, a = [], d = 0; d < 256; d++) {
356
+ e = d;
357
+ for (var c = 0; c < 8; c++)
358
+ e = 1 & e ? 3988292384 ^ e >>> 1 : e >>> 1;
359
+ a[d] = e;
360
+ }
361
+ return a;
362
+ }();
363
+ S.exports = function(e, a) {
364
+ return e !== void 0 && e.length ? l.getTypeOf(e) !== "string" ? function(d, c, _, v) {
365
+ var s = o, m = v + _;
366
+ d ^= -1;
367
+ for (var i = v; i < m; i++)
368
+ d = d >>> 8 ^ s[255 & (d ^ c[i])];
369
+ return -1 ^ d;
370
+ }(0 | a, e, e.length, 0) : function(d, c, _, v) {
371
+ var s = o, m = v + _;
372
+ d ^= -1;
373
+ for (var i = v; i < m; i++)
374
+ d = d >>> 8 ^ s[255 & (d ^ c.charCodeAt(i))];
375
+ return -1 ^ d;
376
+ }(0 | a, e, e.length, 0) : 0;
377
+ };
378
+ }, { "./utils": 32 }], 5: [function(n, S, g) {
379
+ g.base64 = !1, g.binary = !1, g.dir = !1, g.createFolders = !0, g.date = null, g.compression = null, g.compressionOptions = null, g.comment = null, g.unixPermissions = null, g.dosPermissions = null;
380
+ }, {}], 6: [function(n, S, g) {
381
+ var l = null;
382
+ l = typeof Promise < "u" ? Promise : n("lie"), S.exports = { Promise: l };
383
+ }, { lie: 37 }], 7: [function(n, S, g) {
384
+ var l = typeof Uint8Array < "u" && typeof Uint16Array < "u" && typeof Uint32Array < "u", o = n("pako"), e = n("./utils"), a = n("./stream/GenericWorker"), d = l ? "uint8array" : "array";
385
+ function c(_, v) {
386
+ a.call(this, "FlateWorker/" + _), this._pako = null, this._pakoAction = _, this._pakoOptions = v, this.meta = {};
387
+ }
388
+ g.magic = "\b\0", e.inherits(c, a), c.prototype.processChunk = function(_) {
389
+ this.meta = _.meta, this._pako === null && this._createPako(), this._pako.push(e.transformTo(d, _.data), !1);
390
+ }, c.prototype.flush = function() {
391
+ a.prototype.flush.call(this), this._pako === null && this._createPako(), this._pako.push([], !0);
392
+ }, c.prototype.cleanUp = function() {
393
+ a.prototype.cleanUp.call(this), this._pako = null;
394
+ }, c.prototype._createPako = function() {
395
+ this._pako = new o[this._pakoAction]({ raw: !0, level: this._pakoOptions.level || -1 });
396
+ var _ = this;
397
+ this._pako.onData = function(v) {
398
+ _.push({ data: v, meta: _.meta });
399
+ };
400
+ }, g.compressWorker = function(_) {
401
+ return new c("Deflate", _);
402
+ }, g.uncompressWorker = function() {
403
+ return new c("Inflate", {});
404
+ };
405
+ }, { "./stream/GenericWorker": 28, "./utils": 32, pako: 38 }], 8: [function(n, S, g) {
406
+ function l(s, m) {
407
+ var i, f = "";
408
+ for (i = 0; i < m; i++)
409
+ f += String.fromCharCode(255 & s), s >>>= 8;
410
+ return f;
411
+ }
412
+ function o(s, m, i, f, h, u) {
413
+ var w, k, x = s.file, O = s.compression, T = u !== d.utf8encode, M = e.transformTo("string", u(x.name)), z = e.transformTo("string", d.utf8encode(x.name)), W = x.comment, j = e.transformTo("string", u(W)), b = e.transformTo("string", d.utf8encode(W)), F = z.length !== x.name.length, r = b.length !== W.length, N = "", Q = "", $ = "", Y = x.dir, L = x.date, K = { crc32: 0, compressedSize: 0, uncompressedSize: 0 };
414
+ m && !i || (K.crc32 = s.crc32, K.compressedSize = s.compressedSize, K.uncompressedSize = s.uncompressedSize);
415
+ var I = 0;
416
+ m && (I |= 8), T || !F && !r || (I |= 2048);
417
+ var B = 0, tt = 0;
418
+ Y && (B |= 16), h === "UNIX" ? (tt = 798, B |= function(X, st) {
419
+ var ct = X;
420
+ return X || (ct = st ? 16893 : 33204), (65535 & ct) << 16;
421
+ }(x.unixPermissions, Y)) : (tt = 20, B |= function(X) {
422
+ return 63 & (X || 0);
423
+ }(x.dosPermissions)), w = L.getUTCHours(), w <<= 6, w |= L.getUTCMinutes(), w <<= 5, w |= L.getUTCSeconds() / 2, k = L.getUTCFullYear() - 1980, k <<= 4, k |= L.getUTCMonth() + 1, k <<= 5, k |= L.getUTCDate(), F && (Q = l(1, 1) + l(c(M), 4) + z, N += "up" + l(Q.length, 2) + Q), r && ($ = l(1, 1) + l(c(j), 4) + b, N += "uc" + l($.length, 2) + $);
424
+ var q = "";
425
+ return q += `
426
+ \0`, q += l(I, 2), q += O.magic, q += l(w, 2), q += l(k, 2), q += l(K.crc32, 4), q += l(K.compressedSize, 4), q += l(K.uncompressedSize, 4), q += l(M.length, 2), q += l(N.length, 2), { fileRecord: _.LOCAL_FILE_HEADER + q + M + N, dirRecord: _.CENTRAL_FILE_HEADER + l(tt, 2) + q + l(j.length, 2) + "\0\0\0\0" + l(B, 4) + l(f, 4) + M + N + j };
427
+ }
428
+ var e = n("../utils"), a = n("../stream/GenericWorker"), d = n("../utf8"), c = n("../crc32"), _ = n("../signature");
429
+ function v(s, m, i, f) {
430
+ a.call(this, "ZipFileWorker"), this.bytesWritten = 0, this.zipComment = m, this.zipPlatform = i, this.encodeFileName = f, this.streamFiles = s, this.accumulate = !1, this.contentBuffer = [], this.dirRecords = [], this.currentSourceOffset = 0, this.entriesCount = 0, this.currentFile = null, this._sources = [];
431
+ }
432
+ e.inherits(v, a), v.prototype.push = function(s) {
433
+ var m = s.meta.percent || 0, i = this.entriesCount, f = this._sources.length;
434
+ this.accumulate ? this.contentBuffer.push(s) : (this.bytesWritten += s.data.length, a.prototype.push.call(this, { data: s.data, meta: { currentFile: this.currentFile, percent: i ? (m + 100 * (i - f - 1)) / i : 100 } }));
435
+ }, v.prototype.openedSource = function(s) {
436
+ this.currentSourceOffset = this.bytesWritten, this.currentFile = s.file.name;
437
+ var m = this.streamFiles && !s.file.dir;
438
+ if (m) {
439
+ var i = o(s, m, !1, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
440
+ this.push({ data: i.fileRecord, meta: { percent: 0 } });
441
+ } else
442
+ this.accumulate = !0;
443
+ }, v.prototype.closedSource = function(s) {
444
+ this.accumulate = !1;
445
+ var m = this.streamFiles && !s.file.dir, i = o(s, m, !0, this.currentSourceOffset, this.zipPlatform, this.encodeFileName);
446
+ if (this.dirRecords.push(i.dirRecord), m)
447
+ this.push({ data: function(f) {
448
+ return _.DATA_DESCRIPTOR + l(f.crc32, 4) + l(f.compressedSize, 4) + l(f.uncompressedSize, 4);
449
+ }(s), meta: { percent: 100 } });
450
+ else
451
+ for (this.push({ data: i.fileRecord, meta: { percent: 0 } }); this.contentBuffer.length; )
452
+ this.push(this.contentBuffer.shift());
453
+ this.currentFile = null;
454
+ }, v.prototype.flush = function() {
455
+ for (var s = this.bytesWritten, m = 0; m < this.dirRecords.length; m++)
456
+ this.push({ data: this.dirRecords[m], meta: { percent: 100 } });
457
+ var i = this.bytesWritten - s, f = function(h, u, w, k, x) {
458
+ var O = e.transformTo("string", x(k));
459
+ return _.CENTRAL_DIRECTORY_END + "\0\0\0\0" + l(h, 2) + l(h, 2) + l(u, 4) + l(w, 4) + l(O.length, 2) + O;
460
+ }(this.dirRecords.length, i, s, this.zipComment, this.encodeFileName);
461
+ this.push({ data: f, meta: { percent: 100 } });
462
+ }, v.prototype.prepareNextSource = function() {
463
+ this.previous = this._sources.shift(), this.openedSource(this.previous.streamInfo), this.isPaused ? this.previous.pause() : this.previous.resume();
464
+ }, v.prototype.registerPrevious = function(s) {
465
+ this._sources.push(s);
466
+ var m = this;
467
+ return s.on("data", function(i) {
468
+ m.processChunk(i);
469
+ }), s.on("end", function() {
470
+ m.closedSource(m.previous.streamInfo), m._sources.length ? m.prepareNextSource() : m.end();
471
+ }), s.on("error", function(i) {
472
+ m.error(i);
473
+ }), this;
474
+ }, v.prototype.resume = function() {
475
+ return !!a.prototype.resume.call(this) && (!this.previous && this._sources.length ? (this.prepareNextSource(), !0) : this.previous || this._sources.length || this.generatedError ? void 0 : (this.end(), !0));
476
+ }, v.prototype.error = function(s) {
477
+ var m = this._sources;
478
+ if (!a.prototype.error.call(this, s))
479
+ return !1;
480
+ for (var i = 0; i < m.length; i++)
481
+ try {
482
+ m[i].error(s);
483
+ } catch {
484
+ }
485
+ return !0;
486
+ }, v.prototype.lock = function() {
487
+ a.prototype.lock.call(this);
488
+ for (var s = this._sources, m = 0; m < s.length; m++)
489
+ s[m].lock();
490
+ }, S.exports = v;
491
+ }, { "../crc32": 4, "../signature": 23, "../stream/GenericWorker": 28, "../utf8": 31, "../utils": 32 }], 9: [function(n, S, g) {
492
+ var l = n("../compressions"), o = n("./ZipFileWorker");
493
+ g.generateWorker = function(e, a, d) {
494
+ var c = new o(a.streamFiles, d, a.platform, a.encodeFileName), _ = 0;
495
+ try {
496
+ e.forEach(function(v, s) {
497
+ _++;
498
+ var m = function(u, w) {
499
+ var k = u || w, x = l[k];
500
+ if (!x)
501
+ throw new Error(k + " is not a valid compression method !");
502
+ return x;
503
+ }(s.options.compression, a.compression), i = s.options.compressionOptions || a.compressionOptions || {}, f = s.dir, h = s.date;
504
+ s._compressWorker(m, i).withStreamInfo("file", { name: v, dir: f, date: h, comment: s.comment || "", unixPermissions: s.unixPermissions, dosPermissions: s.dosPermissions }).pipe(c);
505
+ }), c.entriesCount = _;
506
+ } catch (v) {
507
+ c.error(v);
508
+ }
509
+ return c;
510
+ };
511
+ }, { "../compressions": 3, "./ZipFileWorker": 8 }], 10: [function(n, S, g) {
512
+ function l() {
513
+ if (!(this instanceof l))
514
+ return new l();
515
+ if (arguments.length)
516
+ throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");
517
+ this.files = /* @__PURE__ */ Object.create(null), this.comment = null, this.root = "", this.clone = function() {
518
+ var o = new l();
519
+ for (var e in this)
520
+ typeof this[e] != "function" && (o[e] = this[e]);
521
+ return o;
522
+ };
523
+ }
524
+ (l.prototype = n("./object")).loadAsync = n("./load"), l.support = n("./support"), l.defaults = n("./defaults"), l.version = "3.10.1", l.loadAsync = function(o, e) {
525
+ return new l().loadAsync(o, e);
526
+ }, l.external = n("./external"), S.exports = l;
527
+ }, { "./defaults": 5, "./external": 6, "./load": 11, "./object": 15, "./support": 30 }], 11: [function(n, S, g) {
528
+ var l = n("./utils"), o = n("./external"), e = n("./utf8"), a = n("./zipEntries"), d = n("./stream/Crc32Probe"), c = n("./nodejsUtils");
529
+ function _(v) {
530
+ return new o.Promise(function(s, m) {
531
+ var i = v.decompressed.getContentWorker().pipe(new d());
532
+ i.on("error", function(f) {
533
+ m(f);
534
+ }).on("end", function() {
535
+ i.streamInfo.crc32 !== v.decompressed.crc32 ? m(new Error("Corrupted zip : CRC32 mismatch")) : s();
536
+ }).resume();
537
+ });
538
+ }
539
+ S.exports = function(v, s) {
540
+ var m = this;
541
+ return s = l.extend(s || {}, { base64: !1, checkCRC32: !1, optimizedBinaryString: !1, createFolders: !1, decodeFileName: e.utf8decode }), c.isNode && c.isStream(v) ? o.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")) : l.prepareContent("the loaded zip file", v, !0, s.optimizedBinaryString, s.base64).then(function(i) {
542
+ var f = new a(s);
543
+ return f.load(i), f;
544
+ }).then(function(i) {
545
+ var f = [o.Promise.resolve(i)], h = i.files;
546
+ if (s.checkCRC32)
547
+ for (var u = 0; u < h.length; u++)
548
+ f.push(_(h[u]));
549
+ return o.Promise.all(f);
550
+ }).then(function(i) {
551
+ for (var f = i.shift(), h = f.files, u = 0; u < h.length; u++) {
552
+ var w = h[u], k = w.fileNameStr, x = l.resolve(w.fileNameStr);
553
+ m.file(x, w.decompressed, { binary: !0, optimizedBinaryString: !0, date: w.date, dir: w.dir, comment: w.fileCommentStr.length ? w.fileCommentStr : null, unixPermissions: w.unixPermissions, dosPermissions: w.dosPermissions, createFolders: s.createFolders }), w.dir || (m.file(x).unsafeOriginalName = k);
554
+ }
555
+ return f.zipComment.length && (m.comment = f.zipComment), m;
556
+ });
557
+ };
558
+ }, { "./external": 6, "./nodejsUtils": 14, "./stream/Crc32Probe": 25, "./utf8": 31, "./utils": 32, "./zipEntries": 33 }], 12: [function(n, S, g) {
559
+ var l = n("../utils"), o = n("../stream/GenericWorker");
560
+ function e(a, d) {
561
+ o.call(this, "Nodejs stream input adapter for " + a), this._upstreamEnded = !1, this._bindStream(d);
562
+ }
563
+ l.inherits(e, o), e.prototype._bindStream = function(a) {
564
+ var d = this;
565
+ (this._stream = a).pause(), a.on("data", function(c) {
566
+ d.push({ data: c, meta: { percent: 0 } });
567
+ }).on("error", function(c) {
568
+ d.isPaused ? this.generatedError = c : d.error(c);
569
+ }).on("end", function() {
570
+ d.isPaused ? d._upstreamEnded = !0 : d.end();
571
+ });
572
+ }, e.prototype.pause = function() {
573
+ return !!o.prototype.pause.call(this) && (this._stream.pause(), !0);
574
+ }, e.prototype.resume = function() {
575
+ return !!o.prototype.resume.call(this) && (this._upstreamEnded ? this.end() : this._stream.resume(), !0);
576
+ }, S.exports = e;
577
+ }, { "../stream/GenericWorker": 28, "../utils": 32 }], 13: [function(n, S, g) {
578
+ var l = n("readable-stream").Readable;
579
+ function o(e, a, d) {
580
+ l.call(this, a), this._helper = e;
581
+ var c = this;
582
+ e.on("data", function(_, v) {
583
+ c.push(_) || c._helper.pause(), d && d(v);
584
+ }).on("error", function(_) {
585
+ c.emit("error", _);
586
+ }).on("end", function() {
587
+ c.push(null);
588
+ });
589
+ }
590
+ n("../utils").inherits(o, l), o.prototype._read = function() {
591
+ this._helper.resume();
592
+ }, S.exports = o;
593
+ }, { "../utils": 32, "readable-stream": 16 }], 14: [function(n, S, g) {
594
+ S.exports = { isNode: typeof Buffer < "u", newBufferFrom: function(l, o) {
595
+ if (Buffer.from && Buffer.from !== Uint8Array.from)
596
+ return Buffer.from(l, o);
597
+ if (typeof l == "number")
598
+ throw new Error('The "data" argument must not be a number');
599
+ return new Buffer(l, o);
600
+ }, allocBuffer: function(l) {
601
+ if (Buffer.alloc)
602
+ return Buffer.alloc(l);
603
+ var o = new Buffer(l);
604
+ return o.fill(0), o;
605
+ }, isBuffer: function(l) {
606
+ return Buffer.isBuffer(l);
607
+ }, isStream: function(l) {
608
+ return l && typeof l.on == "function" && typeof l.pause == "function" && typeof l.resume == "function";
609
+ } };
610
+ }, {}], 15: [function(n, S, g) {
611
+ function l(x, O, T) {
612
+ var M, z = e.getTypeOf(O), W = e.extend(T || {}, c);
613
+ W.date = W.date || /* @__PURE__ */ new Date(), W.compression !== null && (W.compression = W.compression.toUpperCase()), typeof W.unixPermissions == "string" && (W.unixPermissions = parseInt(W.unixPermissions, 8)), W.unixPermissions && 16384 & W.unixPermissions && (W.dir = !0), W.dosPermissions && 16 & W.dosPermissions && (W.dir = !0), W.dir && (x = h(x)), W.createFolders && (M = f(x)) && u.call(this, M, !0);
614
+ var j = z === "string" && W.binary === !1 && W.base64 === !1;
615
+ T && T.binary !== void 0 || (W.binary = !j), (O instanceof _ && O.uncompressedSize === 0 || W.dir || !O || O.length === 0) && (W.base64 = !1, W.binary = !0, O = "", W.compression = "STORE", z = "string");
616
+ var b = null;
617
+ b = O instanceof _ || O instanceof a ? O : m.isNode && m.isStream(O) ? new i(x, O) : e.prepareContent(x, O, W.binary, W.optimizedBinaryString, W.base64);
618
+ var F = new v(x, b, W);
619
+ this.files[x] = F;
620
+ }
621
+ var o = n("./utf8"), e = n("./utils"), a = n("./stream/GenericWorker"), d = n("./stream/StreamHelper"), c = n("./defaults"), _ = n("./compressedObject"), v = n("./zipObject"), s = n("./generate"), m = n("./nodejsUtils"), i = n("./nodejs/NodejsStreamInputAdapter"), f = function(x) {
622
+ x.slice(-1) === "/" && (x = x.substring(0, x.length - 1));
623
+ var O = x.lastIndexOf("/");
624
+ return 0 < O ? x.substring(0, O) : "";
625
+ }, h = function(x) {
626
+ return x.slice(-1) !== "/" && (x += "/"), x;
627
+ }, u = function(x, O) {
628
+ return O = O !== void 0 ? O : c.createFolders, x = h(x), this.files[x] || l.call(this, x, null, { dir: !0, createFolders: O }), this.files[x];
629
+ };
630
+ function w(x) {
631
+ return Object.prototype.toString.call(x) === "[object RegExp]";
632
+ }
633
+ var k = { load: function() {
634
+ throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
635
+ }, forEach: function(x) {
636
+ var O, T, M;
637
+ for (O in this.files)
638
+ M = this.files[O], (T = O.slice(this.root.length, O.length)) && O.slice(0, this.root.length) === this.root && x(T, M);
639
+ }, filter: function(x) {
640
+ var O = [];
641
+ return this.forEach(function(T, M) {
642
+ x(T, M) && O.push(M);
643
+ }), O;
644
+ }, file: function(x, O, T) {
645
+ if (arguments.length !== 1)
646
+ return x = this.root + x, l.call(this, x, O, T), this;
647
+ if (w(x)) {
648
+ var M = x;
649
+ return this.filter(function(W, j) {
650
+ return !j.dir && M.test(W);
651
+ });
652
+ }
653
+ var z = this.files[this.root + x];
654
+ return z && !z.dir ? z : null;
655
+ }, folder: function(x) {
656
+ if (!x)
657
+ return this;
658
+ if (w(x))
659
+ return this.filter(function(z, W) {
660
+ return W.dir && x.test(z);
661
+ });
662
+ var O = this.root + x, T = u.call(this, O), M = this.clone();
663
+ return M.root = T.name, M;
664
+ }, remove: function(x) {
665
+ x = this.root + x;
666
+ var O = this.files[x];
667
+ if (O || (x.slice(-1) !== "/" && (x += "/"), O = this.files[x]), O && !O.dir)
668
+ delete this.files[x];
669
+ else
670
+ for (var T = this.filter(function(z, W) {
671
+ return W.name.slice(0, x.length) === x;
672
+ }), M = 0; M < T.length; M++)
673
+ delete this.files[T[M].name];
674
+ return this;
675
+ }, generate: function() {
676
+ throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
677
+ }, generateInternalStream: function(x) {
678
+ var O, T = {};
679
+ try {
680
+ if ((T = e.extend(x || {}, { streamFiles: !1, compression: "STORE", compressionOptions: null, type: "", platform: "DOS", comment: null, mimeType: "application/zip", encodeFileName: o.utf8encode })).type = T.type.toLowerCase(), T.compression = T.compression.toUpperCase(), T.type === "binarystring" && (T.type = "string"), !T.type)
681
+ throw new Error("No output type specified.");
682
+ e.checkSupport(T.type), T.platform !== "darwin" && T.platform !== "freebsd" && T.platform !== "linux" && T.platform !== "sunos" || (T.platform = "UNIX"), T.platform === "win32" && (T.platform = "DOS");
683
+ var M = T.comment || this.comment || "";
684
+ O = s.generateWorker(this, T, M);
685
+ } catch (z) {
686
+ (O = new a("error")).error(z);
687
+ }
688
+ return new d(O, T.type || "string", T.mimeType);
689
+ }, generateAsync: function(x, O) {
690
+ return this.generateInternalStream(x).accumulate(O);
691
+ }, generateNodeStream: function(x, O) {
692
+ return (x = x || {}).type || (x.type = "nodebuffer"), this.generateInternalStream(x).toNodejsStream(O);
693
+ } };
694
+ S.exports = k;
695
+ }, { "./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(n, S, g) {
696
+ S.exports = n("stream");
697
+ }, { stream: void 0 }], 17: [function(n, S, g) {
698
+ var l = n("./DataReader");
699
+ function o(e) {
700
+ l.call(this, e);
701
+ for (var a = 0; a < this.data.length; a++)
702
+ e[a] = 255 & e[a];
703
+ }
704
+ n("../utils").inherits(o, l), o.prototype.byteAt = function(e) {
705
+ return this.data[this.zero + e];
706
+ }, o.prototype.lastIndexOfSignature = function(e) {
707
+ for (var a = e.charCodeAt(0), d = e.charCodeAt(1), c = e.charCodeAt(2), _ = e.charCodeAt(3), v = this.length - 4; 0 <= v; --v)
708
+ if (this.data[v] === a && this.data[v + 1] === d && this.data[v + 2] === c && this.data[v + 3] === _)
709
+ return v - this.zero;
710
+ return -1;
711
+ }, o.prototype.readAndCheckSignature = function(e) {
712
+ var a = e.charCodeAt(0), d = e.charCodeAt(1), c = e.charCodeAt(2), _ = e.charCodeAt(3), v = this.readData(4);
713
+ return a === v[0] && d === v[1] && c === v[2] && _ === v[3];
714
+ }, o.prototype.readData = function(e) {
715
+ if (this.checkOffset(e), e === 0)
716
+ return [];
717
+ var a = this.data.slice(this.zero + this.index, this.zero + this.index + e);
718
+ return this.index += e, a;
719
+ }, S.exports = o;
720
+ }, { "../utils": 32, "./DataReader": 18 }], 18: [function(n, S, g) {
721
+ var l = n("../utils");
722
+ function o(e) {
723
+ this.data = e, this.length = e.length, this.index = 0, this.zero = 0;
724
+ }
725
+ o.prototype = { checkOffset: function(e) {
726
+ this.checkIndex(this.index + e);
727
+ }, checkIndex: function(e) {
728
+ if (this.length < this.zero + e || e < 0)
729
+ throw new Error("End of data reached (data length = " + this.length + ", asked index = " + e + "). Corrupted zip ?");
730
+ }, setIndex: function(e) {
731
+ this.checkIndex(e), this.index = e;
732
+ }, skip: function(e) {
733
+ this.setIndex(this.index + e);
734
+ }, byteAt: function() {
735
+ }, readInt: function(e) {
736
+ var a, d = 0;
737
+ for (this.checkOffset(e), a = this.index + e - 1; a >= this.index; a--)
738
+ d = (d << 8) + this.byteAt(a);
739
+ return this.index += e, d;
740
+ }, readString: function(e) {
741
+ return l.transformTo("string", this.readData(e));
742
+ }, readData: function() {
743
+ }, lastIndexOfSignature: function() {
744
+ }, readAndCheckSignature: function() {
745
+ }, readDate: function() {
746
+ var e = this.readInt(4);
747
+ return new Date(Date.UTC(1980 + (e >> 25 & 127), (e >> 21 & 15) - 1, e >> 16 & 31, e >> 11 & 31, e >> 5 & 63, (31 & e) << 1));
748
+ } }, S.exports = o;
749
+ }, { "../utils": 32 }], 19: [function(n, S, g) {
750
+ var l = n("./Uint8ArrayReader");
751
+ function o(e) {
752
+ l.call(this, e);
753
+ }
754
+ n("../utils").inherits(o, l), o.prototype.readData = function(e) {
755
+ this.checkOffset(e);
756
+ var a = this.data.slice(this.zero + this.index, this.zero + this.index + e);
757
+ return this.index += e, a;
758
+ }, S.exports = o;
759
+ }, { "../utils": 32, "./Uint8ArrayReader": 21 }], 20: [function(n, S, g) {
760
+ var l = n("./DataReader");
761
+ function o(e) {
762
+ l.call(this, e);
763
+ }
764
+ n("../utils").inherits(o, l), o.prototype.byteAt = function(e) {
765
+ return this.data.charCodeAt(this.zero + e);
766
+ }, o.prototype.lastIndexOfSignature = function(e) {
767
+ return this.data.lastIndexOf(e) - this.zero;
768
+ }, o.prototype.readAndCheckSignature = function(e) {
769
+ return e === this.readData(4);
770
+ }, o.prototype.readData = function(e) {
771
+ this.checkOffset(e);
772
+ var a = this.data.slice(this.zero + this.index, this.zero + this.index + e);
773
+ return this.index += e, a;
774
+ }, S.exports = o;
775
+ }, { "../utils": 32, "./DataReader": 18 }], 21: [function(n, S, g) {
776
+ var l = n("./ArrayReader");
777
+ function o(e) {
778
+ l.call(this, e);
779
+ }
780
+ n("../utils").inherits(o, l), o.prototype.readData = function(e) {
781
+ if (this.checkOffset(e), e === 0)
782
+ return new Uint8Array(0);
783
+ var a = this.data.subarray(this.zero + this.index, this.zero + this.index + e);
784
+ return this.index += e, a;
785
+ }, S.exports = o;
786
+ }, { "../utils": 32, "./ArrayReader": 17 }], 22: [function(n, S, g) {
787
+ var l = n("../utils"), o = n("../support"), e = n("./ArrayReader"), a = n("./StringReader"), d = n("./NodeBufferReader"), c = n("./Uint8ArrayReader");
788
+ S.exports = function(_) {
789
+ var v = l.getTypeOf(_);
790
+ return l.checkSupport(v), v !== "string" || o.uint8array ? v === "nodebuffer" ? new d(_) : o.uint8array ? new c(l.transformTo("uint8array", _)) : new e(l.transformTo("array", _)) : new a(_);
791
+ };
792
+ }, { "../support": 30, "../utils": 32, "./ArrayReader": 17, "./NodeBufferReader": 19, "./StringReader": 20, "./Uint8ArrayReader": 21 }], 23: [function(n, S, g) {
793
+ g.LOCAL_FILE_HEADER = "PK", g.CENTRAL_FILE_HEADER = "PK", g.CENTRAL_DIRECTORY_END = "PK", g.ZIP64_CENTRAL_DIRECTORY_LOCATOR = "PK\x07", g.ZIP64_CENTRAL_DIRECTORY_END = "PK", g.DATA_DESCRIPTOR = "PK\x07\b";
794
+ }, {}], 24: [function(n, S, g) {
795
+ var l = n("./GenericWorker"), o = n("../utils");
796
+ function e(a) {
797
+ l.call(this, "ConvertWorker to " + a), this.destType = a;
798
+ }
799
+ o.inherits(e, l), e.prototype.processChunk = function(a) {
800
+ this.push({ data: o.transformTo(this.destType, a.data), meta: a.meta });
801
+ }, S.exports = e;
802
+ }, { "../utils": 32, "./GenericWorker": 28 }], 25: [function(n, S, g) {
803
+ var l = n("./GenericWorker"), o = n("../crc32");
804
+ function e() {
805
+ l.call(this, "Crc32Probe"), this.withStreamInfo("crc32", 0);
806
+ }
807
+ n("../utils").inherits(e, l), e.prototype.processChunk = function(a) {
808
+ this.streamInfo.crc32 = o(a.data, this.streamInfo.crc32 || 0), this.push(a);
809
+ }, S.exports = e;
810
+ }, { "../crc32": 4, "../utils": 32, "./GenericWorker": 28 }], 26: [function(n, S, g) {
811
+ var l = n("../utils"), o = n("./GenericWorker");
812
+ function e(a) {
813
+ o.call(this, "DataLengthProbe for " + a), this.propName = a, this.withStreamInfo(a, 0);
814
+ }
815
+ l.inherits(e, o), e.prototype.processChunk = function(a) {
816
+ if (a) {
817
+ var d = this.streamInfo[this.propName] || 0;
818
+ this.streamInfo[this.propName] = d + a.data.length;
819
+ }
820
+ o.prototype.processChunk.call(this, a);
821
+ }, S.exports = e;
822
+ }, { "../utils": 32, "./GenericWorker": 28 }], 27: [function(n, S, g) {
823
+ var l = n("../utils"), o = n("./GenericWorker");
824
+ function e(a) {
825
+ o.call(this, "DataWorker");
826
+ var d = this;
827
+ this.dataIsReady = !1, this.index = 0, this.max = 0, this.data = null, this.type = "", this._tickScheduled = !1, a.then(function(c) {
828
+ d.dataIsReady = !0, d.data = c, d.max = c && c.length || 0, d.type = l.getTypeOf(c), d.isPaused || d._tickAndRepeat();
829
+ }, function(c) {
830
+ d.error(c);
831
+ });
832
+ }
833
+ l.inherits(e, o), e.prototype.cleanUp = function() {
834
+ o.prototype.cleanUp.call(this), this.data = null;
835
+ }, e.prototype.resume = function() {
836
+ return !!o.prototype.resume.call(this) && (!this._tickScheduled && this.dataIsReady && (this._tickScheduled = !0, l.delay(this._tickAndRepeat, [], this)), !0);
837
+ }, e.prototype._tickAndRepeat = function() {
838
+ this._tickScheduled = !1, this.isPaused || this.isFinished || (this._tick(), this.isFinished || (l.delay(this._tickAndRepeat, [], this), this._tickScheduled = !0));
839
+ }, e.prototype._tick = function() {
840
+ if (this.isPaused || this.isFinished)
841
+ return !1;
842
+ var a = null, d = Math.min(this.max, this.index + 16384);
843
+ if (this.index >= this.max)
844
+ return this.end();
845
+ switch (this.type) {
846
+ case "string":
847
+ a = this.data.substring(this.index, d);
848
+ break;
849
+ case "uint8array":
850
+ a = this.data.subarray(this.index, d);
851
+ break;
852
+ case "array":
853
+ case "nodebuffer":
854
+ a = this.data.slice(this.index, d);
855
+ }
856
+ return this.index = d, this.push({ data: a, meta: { percent: this.max ? this.index / this.max * 100 : 0 } });
857
+ }, S.exports = e;
858
+ }, { "../utils": 32, "./GenericWorker": 28 }], 28: [function(n, S, g) {
859
+ function l(o) {
860
+ this.name = o || "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;
861
+ }
862
+ l.prototype = { push: function(o) {
863
+ this.emit("data", o);
864
+ }, end: function() {
865
+ if (this.isFinished)
866
+ return !1;
867
+ this.flush();
868
+ try {
869
+ this.emit("end"), this.cleanUp(), this.isFinished = !0;
870
+ } catch (o) {
871
+ this.emit("error", o);
872
+ }
873
+ return !0;
874
+ }, error: function(o) {
875
+ return !this.isFinished && (this.isPaused ? this.generatedError = o : (this.isFinished = !0, this.emit("error", o), this.previous && this.previous.error(o), this.cleanUp()), !0);
876
+ }, on: function(o, e) {
877
+ return this._listeners[o].push(e), this;
878
+ }, cleanUp: function() {
879
+ this.streamInfo = this.generatedError = this.extraStreamInfo = null, this._listeners = [];
880
+ }, emit: function(o, e) {
881
+ if (this._listeners[o])
882
+ for (var a = 0; a < this._listeners[o].length; a++)
883
+ this._listeners[o][a].call(this, e);
884
+ }, pipe: function(o) {
885
+ return o.registerPrevious(this);
886
+ }, registerPrevious: function(o) {
887
+ if (this.isLocked)
888
+ throw new Error("The stream '" + this + "' has already been used.");
889
+ this.streamInfo = o.streamInfo, this.mergeStreamInfo(), this.previous = o;
890
+ var e = this;
891
+ return o.on("data", function(a) {
892
+ e.processChunk(a);
893
+ }), o.on("end", function() {
894
+ e.end();
895
+ }), o.on("error", function(a) {
896
+ e.error(a);
897
+ }), this;
898
+ }, pause: function() {
899
+ return !this.isPaused && !this.isFinished && (this.isPaused = !0, this.previous && this.previous.pause(), !0);
900
+ }, resume: function() {
901
+ if (!this.isPaused || this.isFinished)
902
+ return !1;
903
+ var o = this.isPaused = !1;
904
+ return this.generatedError && (this.error(this.generatedError), o = !0), this.previous && this.previous.resume(), !o;
905
+ }, flush: function() {
906
+ }, processChunk: function(o) {
907
+ this.push(o);
908
+ }, withStreamInfo: function(o, e) {
909
+ return this.extraStreamInfo[o] = e, this.mergeStreamInfo(), this;
910
+ }, mergeStreamInfo: function() {
911
+ for (var o in this.extraStreamInfo)
912
+ Object.prototype.hasOwnProperty.call(this.extraStreamInfo, o) && (this.streamInfo[o] = this.extraStreamInfo[o]);
913
+ }, lock: function() {
914
+ if (this.isLocked)
915
+ throw new Error("The stream '" + this + "' has already been used.");
916
+ this.isLocked = !0, this.previous && this.previous.lock();
917
+ }, toString: function() {
918
+ var o = "Worker " + this.name;
919
+ return this.previous ? this.previous + " -> " + o : o;
920
+ } }, S.exports = l;
921
+ }, {}], 29: [function(n, S, g) {
922
+ var l = n("../utils"), o = n("./ConvertWorker"), e = n("./GenericWorker"), a = n("../base64"), d = n("../support"), c = n("../external"), _ = null;
923
+ if (d.nodestream)
924
+ try {
925
+ _ = n("../nodejs/NodejsStreamOutputAdapter");
926
+ } catch {
927
+ }
928
+ function v(m, i) {
929
+ return new c.Promise(function(f, h) {
930
+ var u = [], w = m._internalType, k = m._outputType, x = m._mimeType;
931
+ m.on("data", function(O, T) {
932
+ u.push(O), i && i(T);
933
+ }).on("error", function(O) {
934
+ u = [], h(O);
935
+ }).on("end", function() {
936
+ try {
937
+ var O = function(T, M, z) {
938
+ switch (T) {
939
+ case "blob":
940
+ return l.newBlob(l.transformTo("arraybuffer", M), z);
941
+ case "base64":
942
+ return a.encode(M);
943
+ default:
944
+ return l.transformTo(T, M);
945
+ }
946
+ }(k, function(T, M) {
947
+ var z, W = 0, j = null, b = 0;
948
+ for (z = 0; z < M.length; z++)
949
+ b += M[z].length;
950
+ switch (T) {
951
+ case "string":
952
+ return M.join("");
953
+ case "array":
954
+ return Array.prototype.concat.apply([], M);
955
+ case "uint8array":
956
+ for (j = new Uint8Array(b), z = 0; z < M.length; z++)
957
+ j.set(M[z], W), W += M[z].length;
958
+ return j;
959
+ case "nodebuffer":
960
+ return Buffer.concat(M);
961
+ default:
962
+ throw new Error("concat : unsupported type '" + T + "'");
963
+ }
964
+ }(w, u), x);
965
+ f(O);
966
+ } catch (T) {
967
+ h(T);
968
+ }
969
+ u = [];
970
+ }).resume();
971
+ });
972
+ }
973
+ function s(m, i, f) {
974
+ var h = i;
975
+ switch (i) {
976
+ case "blob":
977
+ case "arraybuffer":
978
+ h = "uint8array";
979
+ break;
980
+ case "base64":
981
+ h = "string";
982
+ }
983
+ try {
984
+ this._internalType = h, this._outputType = i, this._mimeType = f, l.checkSupport(h), this._worker = m.pipe(new o(h)), m.lock();
985
+ } catch (u) {
986
+ this._worker = new e("error"), this._worker.error(u);
987
+ }
988
+ }
989
+ s.prototype = { accumulate: function(m) {
990
+ return v(this, m);
991
+ }, on: function(m, i) {
992
+ var f = this;
993
+ return m === "data" ? this._worker.on(m, function(h) {
994
+ i.call(f, h.data, h.meta);
995
+ }) : this._worker.on(m, function() {
996
+ l.delay(i, arguments, f);
997
+ }), this;
998
+ }, resume: function() {
999
+ return l.delay(this._worker.resume, [], this._worker), this;
1000
+ }, pause: function() {
1001
+ return this._worker.pause(), this;
1002
+ }, toNodejsStream: function(m) {
1003
+ if (l.checkSupport("nodestream"), this._outputType !== "nodebuffer")
1004
+ throw new Error(this._outputType + " is not supported by this method");
1005
+ return new _(this, { objectMode: this._outputType !== "nodebuffer" }, m);
1006
+ } }, S.exports = s;
1007
+ }, { "../base64": 1, "../external": 6, "../nodejs/NodejsStreamOutputAdapter": 13, "../support": 30, "../utils": 32, "./ConvertWorker": 24, "./GenericWorker": 28 }], 30: [function(n, S, g) {
1008
+ if (g.base64 = !0, g.array = !0, g.string = !0, g.arraybuffer = typeof ArrayBuffer < "u" && typeof Uint8Array < "u", g.nodebuffer = typeof Buffer < "u", g.uint8array = typeof Uint8Array < "u", typeof ArrayBuffer > "u")
1009
+ g.blob = !1;
1010
+ else {
1011
+ var l = new ArrayBuffer(0);
1012
+ try {
1013
+ g.blob = new Blob([l], { type: "application/zip" }).size === 0;
1014
+ } catch {
1015
+ try {
1016
+ var o = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)();
1017
+ o.append(l), g.blob = o.getBlob("application/zip").size === 0;
1018
+ } catch {
1019
+ g.blob = !1;
1020
+ }
1021
+ }
1022
+ }
1023
+ try {
1024
+ g.nodestream = !!n("readable-stream").Readable;
1025
+ } catch {
1026
+ g.nodestream = !1;
1027
+ }
1028
+ }, { "readable-stream": 16 }], 31: [function(n, S, g) {
1029
+ for (var l = n("./utils"), o = n("./support"), e = n("./nodejsUtils"), a = n("./stream/GenericWorker"), d = new Array(256), c = 0; c < 256; c++)
1030
+ d[c] = 252 <= c ? 6 : 248 <= c ? 5 : 240 <= c ? 4 : 224 <= c ? 3 : 192 <= c ? 2 : 1;
1031
+ d[254] = d[254] = 1;
1032
+ function _() {
1033
+ a.call(this, "utf-8 decode"), this.leftOver = null;
1034
+ }
1035
+ function v() {
1036
+ a.call(this, "utf-8 encode");
1037
+ }
1038
+ g.utf8encode = function(s) {
1039
+ return o.nodebuffer ? e.newBufferFrom(s, "utf-8") : function(m) {
1040
+ var i, f, h, u, w, k = m.length, x = 0;
1041
+ for (u = 0; u < k; u++)
1042
+ (64512 & (f = m.charCodeAt(u))) == 55296 && u + 1 < k && (64512 & (h = m.charCodeAt(u + 1))) == 56320 && (f = 65536 + (f - 55296 << 10) + (h - 56320), u++), x += f < 128 ? 1 : f < 2048 ? 2 : f < 65536 ? 3 : 4;
1043
+ for (i = o.uint8array ? new Uint8Array(x) : new Array(x), u = w = 0; w < x; u++)
1044
+ (64512 & (f = m.charCodeAt(u))) == 55296 && u + 1 < k && (64512 & (h = m.charCodeAt(u + 1))) == 56320 && (f = 65536 + (f - 55296 << 10) + (h - 56320), u++), f < 128 ? i[w++] = f : (f < 2048 ? i[w++] = 192 | f >>> 6 : (f < 65536 ? i[w++] = 224 | f >>> 12 : (i[w++] = 240 | f >>> 18, i[w++] = 128 | f >>> 12 & 63), i[w++] = 128 | f >>> 6 & 63), i[w++] = 128 | 63 & f);
1045
+ return i;
1046
+ }(s);
1047
+ }, g.utf8decode = function(s) {
1048
+ return o.nodebuffer ? l.transformTo("nodebuffer", s).toString("utf-8") : function(m) {
1049
+ var i, f, h, u, w = m.length, k = new Array(2 * w);
1050
+ for (i = f = 0; i < w; )
1051
+ if ((h = m[i++]) < 128)
1052
+ k[f++] = h;
1053
+ else if (4 < (u = d[h]))
1054
+ k[f++] = 65533, i += u - 1;
1055
+ else {
1056
+ for (h &= u === 2 ? 31 : u === 3 ? 15 : 7; 1 < u && i < w; )
1057
+ h = h << 6 | 63 & m[i++], u--;
1058
+ 1 < u ? k[f++] = 65533 : h < 65536 ? k[f++] = h : (h -= 65536, k[f++] = 55296 | h >> 10 & 1023, k[f++] = 56320 | 1023 & h);
1059
+ }
1060
+ return k.length !== f && (k.subarray ? k = k.subarray(0, f) : k.length = f), l.applyFromCharCode(k);
1061
+ }(s = l.transformTo(o.uint8array ? "uint8array" : "array", s));
1062
+ }, l.inherits(_, a), _.prototype.processChunk = function(s) {
1063
+ var m = l.transformTo(o.uint8array ? "uint8array" : "array", s.data);
1064
+ if (this.leftOver && this.leftOver.length) {
1065
+ if (o.uint8array) {
1066
+ var i = m;
1067
+ (m = new Uint8Array(i.length + this.leftOver.length)).set(this.leftOver, 0), m.set(i, this.leftOver.length);
1068
+ } else
1069
+ m = this.leftOver.concat(m);
1070
+ this.leftOver = null;
1071
+ }
1072
+ var f = function(u, w) {
1073
+ var k;
1074
+ for ((w = w || u.length) > u.length && (w = u.length), k = w - 1; 0 <= k && (192 & u[k]) == 128; )
1075
+ k--;
1076
+ return k < 0 || k === 0 ? w : k + d[u[k]] > w ? k : w;
1077
+ }(m), h = m;
1078
+ f !== m.length && (o.uint8array ? (h = m.subarray(0, f), this.leftOver = m.subarray(f, m.length)) : (h = m.slice(0, f), this.leftOver = m.slice(f, m.length))), this.push({ data: g.utf8decode(h), meta: s.meta });
1079
+ }, _.prototype.flush = function() {
1080
+ this.leftOver && this.leftOver.length && (this.push({ data: g.utf8decode(this.leftOver), meta: {} }), this.leftOver = null);
1081
+ }, g.Utf8DecodeWorker = _, l.inherits(v, a), v.prototype.processChunk = function(s) {
1082
+ this.push({ data: g.utf8encode(s.data), meta: s.meta });
1083
+ }, g.Utf8EncodeWorker = v;
1084
+ }, { "./nodejsUtils": 14, "./stream/GenericWorker": 28, "./support": 30, "./utils": 32 }], 32: [function(n, S, g) {
1085
+ var l = n("./support"), o = n("./base64"), e = n("./nodejsUtils"), a = n("./external");
1086
+ function d(i) {
1087
+ return i;
1088
+ }
1089
+ function c(i, f) {
1090
+ for (var h = 0; h < i.length; ++h)
1091
+ f[h] = 255 & i.charCodeAt(h);
1092
+ return f;
1093
+ }
1094
+ n("setimmediate"), g.newBlob = function(i, f) {
1095
+ g.checkSupport("blob");
1096
+ try {
1097
+ return new Blob([i], { type: f });
1098
+ } catch {
1099
+ try {
1100
+ var h = new (self.BlobBuilder || self.WebKitBlobBuilder || self.MozBlobBuilder || self.MSBlobBuilder)();
1101
+ return h.append(i), h.getBlob(f);
1102
+ } catch {
1103
+ throw new Error("Bug : can't construct the Blob.");
1104
+ }
1105
+ }
1106
+ };
1107
+ var _ = { stringifyByChunk: function(i, f, h) {
1108
+ var u = [], w = 0, k = i.length;
1109
+ if (k <= h)
1110
+ return String.fromCharCode.apply(null, i);
1111
+ for (; w < k; )
1112
+ f === "array" || f === "nodebuffer" ? u.push(String.fromCharCode.apply(null, i.slice(w, Math.min(w + h, k)))) : u.push(String.fromCharCode.apply(null, i.subarray(w, Math.min(w + h, k)))), w += h;
1113
+ return u.join("");
1114
+ }, stringifyByChar: function(i) {
1115
+ for (var f = "", h = 0; h < i.length; h++)
1116
+ f += String.fromCharCode(i[h]);
1117
+ return f;
1118
+ }, applyCanBeUsed: { uint8array: function() {
1119
+ try {
1120
+ return l.uint8array && String.fromCharCode.apply(null, new Uint8Array(1)).length === 1;
1121
+ } catch {
1122
+ return !1;
1123
+ }
1124
+ }(), nodebuffer: function() {
1125
+ try {
1126
+ return l.nodebuffer && String.fromCharCode.apply(null, e.allocBuffer(1)).length === 1;
1127
+ } catch {
1128
+ return !1;
1129
+ }
1130
+ }() } };
1131
+ function v(i) {
1132
+ var f = 65536, h = g.getTypeOf(i), u = !0;
1133
+ if (h === "uint8array" ? u = _.applyCanBeUsed.uint8array : h === "nodebuffer" && (u = _.applyCanBeUsed.nodebuffer), u)
1134
+ for (; 1 < f; )
1135
+ try {
1136
+ return _.stringifyByChunk(i, h, f);
1137
+ } catch {
1138
+ f = Math.floor(f / 2);
1139
+ }
1140
+ return _.stringifyByChar(i);
1141
+ }
1142
+ function s(i, f) {
1143
+ for (var h = 0; h < i.length; h++)
1144
+ f[h] = i[h];
1145
+ return f;
1146
+ }
1147
+ g.applyFromCharCode = v;
1148
+ var m = {};
1149
+ m.string = { string: d, array: function(i) {
1150
+ return c(i, new Array(i.length));
1151
+ }, arraybuffer: function(i) {
1152
+ return m.string.uint8array(i).buffer;
1153
+ }, uint8array: function(i) {
1154
+ return c(i, new Uint8Array(i.length));
1155
+ }, nodebuffer: function(i) {
1156
+ return c(i, e.allocBuffer(i.length));
1157
+ } }, m.array = { string: v, array: d, arraybuffer: function(i) {
1158
+ return new Uint8Array(i).buffer;
1159
+ }, uint8array: function(i) {
1160
+ return new Uint8Array(i);
1161
+ }, nodebuffer: function(i) {
1162
+ return e.newBufferFrom(i);
1163
+ } }, m.arraybuffer = { string: function(i) {
1164
+ return v(new Uint8Array(i));
1165
+ }, array: function(i) {
1166
+ return s(new Uint8Array(i), new Array(i.byteLength));
1167
+ }, arraybuffer: d, uint8array: function(i) {
1168
+ return new Uint8Array(i);
1169
+ }, nodebuffer: function(i) {
1170
+ return e.newBufferFrom(new Uint8Array(i));
1171
+ } }, m.uint8array = { string: v, array: function(i) {
1172
+ return s(i, new Array(i.length));
1173
+ }, arraybuffer: function(i) {
1174
+ return i.buffer;
1175
+ }, uint8array: d, nodebuffer: function(i) {
1176
+ return e.newBufferFrom(i);
1177
+ } }, m.nodebuffer = { string: v, array: function(i) {
1178
+ return s(i, new Array(i.length));
1179
+ }, arraybuffer: function(i) {
1180
+ return m.nodebuffer.uint8array(i).buffer;
1181
+ }, uint8array: function(i) {
1182
+ return s(i, new Uint8Array(i.length));
1183
+ }, nodebuffer: d }, g.transformTo = function(i, f) {
1184
+ if (f = f || "", !i)
1185
+ return f;
1186
+ g.checkSupport(i);
1187
+ var h = g.getTypeOf(f);
1188
+ return m[h][i](f);
1189
+ }, g.resolve = function(i) {
1190
+ for (var f = i.split("/"), h = [], u = 0; u < f.length; u++) {
1191
+ var w = f[u];
1192
+ w === "." || w === "" && u !== 0 && u !== f.length - 1 || (w === ".." ? h.pop() : h.push(w));
1193
+ }
1194
+ return h.join("/");
1195
+ }, g.getTypeOf = function(i) {
1196
+ return typeof i == "string" ? "string" : Object.prototype.toString.call(i) === "[object Array]" ? "array" : l.nodebuffer && e.isBuffer(i) ? "nodebuffer" : l.uint8array && i instanceof Uint8Array ? "uint8array" : l.arraybuffer && i instanceof ArrayBuffer ? "arraybuffer" : void 0;
1197
+ }, g.checkSupport = function(i) {
1198
+ if (!l[i.toLowerCase()])
1199
+ throw new Error(i + " is not supported by this platform");
1200
+ }, g.MAX_VALUE_16BITS = 65535, g.MAX_VALUE_32BITS = -1, g.pretty = function(i) {
1201
+ var f, h, u = "";
1202
+ for (h = 0; h < (i || "").length; h++)
1203
+ u += "\\x" + ((f = i.charCodeAt(h)) < 16 ? "0" : "") + f.toString(16).toUpperCase();
1204
+ return u;
1205
+ }, g.delay = function(i, f, h) {
1206
+ setImmediate(function() {
1207
+ i.apply(h || null, f || []);
1208
+ });
1209
+ }, g.inherits = function(i, f) {
1210
+ function h() {
1211
+ }
1212
+ h.prototype = f.prototype, i.prototype = new h();
1213
+ }, g.extend = function() {
1214
+ var i, f, h = {};
1215
+ for (i = 0; i < arguments.length; i++)
1216
+ for (f in arguments[i])
1217
+ Object.prototype.hasOwnProperty.call(arguments[i], f) && h[f] === void 0 && (h[f] = arguments[i][f]);
1218
+ return h;
1219
+ }, g.prepareContent = function(i, f, h, u, w) {
1220
+ return a.Promise.resolve(f).then(function(k) {
1221
+ return l.blob && (k instanceof Blob || ["[object File]", "[object Blob]"].indexOf(Object.prototype.toString.call(k)) !== -1) && typeof FileReader < "u" ? new a.Promise(function(x, O) {
1222
+ var T = new FileReader();
1223
+ T.onload = function(M) {
1224
+ x(M.target.result);
1225
+ }, T.onerror = function(M) {
1226
+ O(M.target.error);
1227
+ }, T.readAsArrayBuffer(k);
1228
+ }) : k;
1229
+ }).then(function(k) {
1230
+ var x = g.getTypeOf(k);
1231
+ return x ? (x === "arraybuffer" ? k = g.transformTo("uint8array", k) : x === "string" && (w ? k = o.decode(k) : h && u !== !0 && (k = function(O) {
1232
+ return c(O, l.uint8array ? new Uint8Array(O.length) : new Array(O.length));
1233
+ }(k))), k) : a.Promise.reject(new Error("Can't read the data of '" + i + "'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"));
1234
+ });
1235
+ };
1236
+ }, { "./base64": 1, "./external": 6, "./nodejsUtils": 14, "./support": 30, setimmediate: 54 }], 33: [function(n, S, g) {
1237
+ var l = n("./reader/readerFor"), o = n("./utils"), e = n("./signature"), a = n("./zipEntry"), d = n("./support");
1238
+ function c(_) {
1239
+ this.files = [], this.loadOptions = _;
1240
+ }
1241
+ c.prototype = { checkSignature: function(_) {
1242
+ if (!this.reader.readAndCheckSignature(_)) {
1243
+ this.reader.index -= 4;
1244
+ var v = this.reader.readString(4);
1245
+ throw new Error("Corrupted zip or bug: unexpected signature (" + o.pretty(v) + ", expected " + o.pretty(_) + ")");
1246
+ }
1247
+ }, isSignature: function(_, v) {
1248
+ var s = this.reader.index;
1249
+ this.reader.setIndex(_);
1250
+ var m = this.reader.readString(4) === v;
1251
+ return this.reader.setIndex(s), m;
1252
+ }, readBlockEndOfCentral: function() {
1253
+ 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);
1254
+ var _ = this.reader.readData(this.zipCommentLength), v = d.uint8array ? "uint8array" : "array", s = o.transformTo(v, _);
1255
+ this.zipComment = this.loadOptions.decodeFileName(s);
1256
+ }, readBlockZip64EndOfCentral: function() {
1257
+ 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 = {};
1258
+ for (var _, v, s, m = this.zip64EndOfCentralSize - 44; 0 < m; )
1259
+ _ = this.reader.readInt(2), v = this.reader.readInt(4), s = this.reader.readData(v), this.zip64ExtensibleData[_] = { id: _, length: v, value: s };
1260
+ }, readBlockZip64EndOfCentralLocator: function() {
1261
+ if (this.diskWithZip64CentralDirStart = this.reader.readInt(4), this.relativeOffsetEndOfZip64CentralDir = this.reader.readInt(8), this.disksCount = this.reader.readInt(4), 1 < this.disksCount)
1262
+ throw new Error("Multi-volumes zip are not supported");
1263
+ }, readLocalFiles: function() {
1264
+ var _, v;
1265
+ for (_ = 0; _ < this.files.length; _++)
1266
+ v = this.files[_], this.reader.setIndex(v.localHeaderOffset), this.checkSignature(e.LOCAL_FILE_HEADER), v.readLocalPart(this.reader), v.handleUTF8(), v.processAttributes();
1267
+ }, readCentralDir: function() {
1268
+ var _;
1269
+ for (this.reader.setIndex(this.centralDirOffset); this.reader.readAndCheckSignature(e.CENTRAL_FILE_HEADER); )
1270
+ (_ = new a({ zip64: this.zip64 }, this.loadOptions)).readCentralPart(this.reader), this.files.push(_);
1271
+ if (this.centralDirRecords !== this.files.length && this.centralDirRecords !== 0 && this.files.length === 0)
1272
+ throw new Error("Corrupted zip or bug: expected " + this.centralDirRecords + " records in central dir, got " + this.files.length);
1273
+ }, readEndOfCentral: function() {
1274
+ var _ = this.reader.lastIndexOfSignature(e.CENTRAL_DIRECTORY_END);
1275
+ if (_ < 0)
1276
+ throw this.isSignature(0, e.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");
1277
+ this.reader.setIndex(_);
1278
+ var v = _;
1279
+ if (this.checkSignature(e.CENTRAL_DIRECTORY_END), this.readBlockEndOfCentral(), this.diskNumber === o.MAX_VALUE_16BITS || this.diskWithCentralDirStart === o.MAX_VALUE_16BITS || this.centralDirRecordsOnThisDisk === o.MAX_VALUE_16BITS || this.centralDirRecords === o.MAX_VALUE_16BITS || this.centralDirSize === o.MAX_VALUE_32BITS || this.centralDirOffset === o.MAX_VALUE_32BITS) {
1280
+ if (this.zip64 = !0, (_ = this.reader.lastIndexOfSignature(e.ZIP64_CENTRAL_DIRECTORY_LOCATOR)) < 0)
1281
+ throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");
1282
+ if (this.reader.setIndex(_), this.checkSignature(e.ZIP64_CENTRAL_DIRECTORY_LOCATOR), this.readBlockZip64EndOfCentralLocator(), !this.isSignature(this.relativeOffsetEndOfZip64CentralDir, e.ZIP64_CENTRAL_DIRECTORY_END) && (this.relativeOffsetEndOfZip64CentralDir = this.reader.lastIndexOfSignature(e.ZIP64_CENTRAL_DIRECTORY_END), this.relativeOffsetEndOfZip64CentralDir < 0))
1283
+ throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");
1284
+ this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir), this.checkSignature(e.ZIP64_CENTRAL_DIRECTORY_END), this.readBlockZip64EndOfCentral();
1285
+ }
1286
+ var s = this.centralDirOffset + this.centralDirSize;
1287
+ this.zip64 && (s += 20, s += 12 + this.zip64EndOfCentralSize);
1288
+ var m = v - s;
1289
+ if (0 < m)
1290
+ this.isSignature(v, e.CENTRAL_FILE_HEADER) || (this.reader.zero = m);
1291
+ else if (m < 0)
1292
+ throw new Error("Corrupted zip: missing " + Math.abs(m) + " bytes.");
1293
+ }, prepareReader: function(_) {
1294
+ this.reader = l(_);
1295
+ }, load: function(_) {
1296
+ this.prepareReader(_), this.readEndOfCentral(), this.readCentralDir(), this.readLocalFiles();
1297
+ } }, S.exports = c;
1298
+ }, { "./reader/readerFor": 22, "./signature": 23, "./support": 30, "./utils": 32, "./zipEntry": 34 }], 34: [function(n, S, g) {
1299
+ var l = n("./reader/readerFor"), o = n("./utils"), e = n("./compressedObject"), a = n("./crc32"), d = n("./utf8"), c = n("./compressions"), _ = n("./support");
1300
+ function v(s, m) {
1301
+ this.options = s, this.loadOptions = m;
1302
+ }
1303
+ v.prototype = { isEncrypted: function() {
1304
+ return (1 & this.bitFlag) == 1;
1305
+ }, useUTF8: function() {
1306
+ return (2048 & this.bitFlag) == 2048;
1307
+ }, readLocalPart: function(s) {
1308
+ var m, i;
1309
+ if (s.skip(22), this.fileNameLength = s.readInt(2), i = s.readInt(2), this.fileName = s.readData(this.fileNameLength), s.skip(i), this.compressedSize === -1 || this.uncompressedSize === -1)
1310
+ throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");
1311
+ if ((m = function(f) {
1312
+ for (var h in c)
1313
+ if (Object.prototype.hasOwnProperty.call(c, h) && c[h].magic === f)
1314
+ return c[h];
1315
+ return null;
1316
+ }(this.compressionMethod)) === null)
1317
+ throw new Error("Corrupted zip : compression " + o.pretty(this.compressionMethod) + " unknown (inner file : " + o.transformTo("string", this.fileName) + ")");
1318
+ this.decompressed = new e(this.compressedSize, this.uncompressedSize, this.crc32, m, s.readData(this.compressedSize));
1319
+ }, readCentralPart: function(s) {
1320
+ this.versionMadeBy = s.readInt(2), s.skip(2), this.bitFlag = s.readInt(2), this.compressionMethod = s.readString(2), this.date = s.readDate(), this.crc32 = s.readInt(4), this.compressedSize = s.readInt(4), this.uncompressedSize = s.readInt(4);
1321
+ var m = s.readInt(2);
1322
+ if (this.extraFieldsLength = s.readInt(2), this.fileCommentLength = s.readInt(2), this.diskNumberStart = s.readInt(2), this.internalFileAttributes = s.readInt(2), this.externalFileAttributes = s.readInt(4), this.localHeaderOffset = s.readInt(4), this.isEncrypted())
1323
+ throw new Error("Encrypted zip are not supported");
1324
+ s.skip(m), this.readExtraFields(s), this.parseZIP64ExtraField(s), this.fileComment = s.readData(this.fileCommentLength);
1325
+ }, processAttributes: function() {
1326
+ this.unixPermissions = null, this.dosPermissions = null;
1327
+ var s = this.versionMadeBy >> 8;
1328
+ this.dir = !!(16 & this.externalFileAttributes), s == 0 && (this.dosPermissions = 63 & this.externalFileAttributes), s == 3 && (this.unixPermissions = this.externalFileAttributes >> 16 & 65535), this.dir || this.fileNameStr.slice(-1) !== "/" || (this.dir = !0);
1329
+ }, parseZIP64ExtraField: function() {
1330
+ if (this.extraFields[1]) {
1331
+ var s = l(this.extraFields[1].value);
1332
+ this.uncompressedSize === o.MAX_VALUE_32BITS && (this.uncompressedSize = s.readInt(8)), this.compressedSize === o.MAX_VALUE_32BITS && (this.compressedSize = s.readInt(8)), this.localHeaderOffset === o.MAX_VALUE_32BITS && (this.localHeaderOffset = s.readInt(8)), this.diskNumberStart === o.MAX_VALUE_32BITS && (this.diskNumberStart = s.readInt(4));
1333
+ }
1334
+ }, readExtraFields: function(s) {
1335
+ var m, i, f, h = s.index + this.extraFieldsLength;
1336
+ for (this.extraFields || (this.extraFields = {}); s.index + 4 < h; )
1337
+ m = s.readInt(2), i = s.readInt(2), f = s.readData(i), this.extraFields[m] = { id: m, length: i, value: f };
1338
+ s.setIndex(h);
1339
+ }, handleUTF8: function() {
1340
+ var s = _.uint8array ? "uint8array" : "array";
1341
+ if (this.useUTF8())
1342
+ this.fileNameStr = d.utf8decode(this.fileName), this.fileCommentStr = d.utf8decode(this.fileComment);
1343
+ else {
1344
+ var m = this.findExtraFieldUnicodePath();
1345
+ if (m !== null)
1346
+ this.fileNameStr = m;
1347
+ else {
1348
+ var i = o.transformTo(s, this.fileName);
1349
+ this.fileNameStr = this.loadOptions.decodeFileName(i);
1350
+ }
1351
+ var f = this.findExtraFieldUnicodeComment();
1352
+ if (f !== null)
1353
+ this.fileCommentStr = f;
1354
+ else {
1355
+ var h = o.transformTo(s, this.fileComment);
1356
+ this.fileCommentStr = this.loadOptions.decodeFileName(h);
1357
+ }
1358
+ }
1359
+ }, findExtraFieldUnicodePath: function() {
1360
+ var s = this.extraFields[28789];
1361
+ if (s) {
1362
+ var m = l(s.value);
1363
+ return m.readInt(1) !== 1 || a(this.fileName) !== m.readInt(4) ? null : d.utf8decode(m.readData(s.length - 5));
1364
+ }
1365
+ return null;
1366
+ }, findExtraFieldUnicodeComment: function() {
1367
+ var s = this.extraFields[25461];
1368
+ if (s) {
1369
+ var m = l(s.value);
1370
+ return m.readInt(1) !== 1 || a(this.fileComment) !== m.readInt(4) ? null : d.utf8decode(m.readData(s.length - 5));
1371
+ }
1372
+ return null;
1373
+ } }, S.exports = v;
1374
+ }, { "./compressedObject": 2, "./compressions": 3, "./crc32": 4, "./reader/readerFor": 22, "./support": 30, "./utf8": 31, "./utils": 32 }], 35: [function(n, S, g) {
1375
+ function l(m, i, f) {
1376
+ this.name = m, this.dir = f.dir, this.date = f.date, this.comment = f.comment, this.unixPermissions = f.unixPermissions, this.dosPermissions = f.dosPermissions, this._data = i, this._dataBinary = f.binary, this.options = { compression: f.compression, compressionOptions: f.compressionOptions };
1377
+ }
1378
+ var o = n("./stream/StreamHelper"), e = n("./stream/DataWorker"), a = n("./utf8"), d = n("./compressedObject"), c = n("./stream/GenericWorker");
1379
+ l.prototype = { internalStream: function(m) {
1380
+ var i = null, f = "string";
1381
+ try {
1382
+ if (!m)
1383
+ throw new Error("No output type specified.");
1384
+ var h = (f = m.toLowerCase()) === "string" || f === "text";
1385
+ f !== "binarystring" && f !== "text" || (f = "string"), i = this._decompressWorker();
1386
+ var u = !this._dataBinary;
1387
+ u && !h && (i = i.pipe(new a.Utf8EncodeWorker())), !u && h && (i = i.pipe(new a.Utf8DecodeWorker()));
1388
+ } catch (w) {
1389
+ (i = new c("error")).error(w);
1390
+ }
1391
+ return new o(i, f, "");
1392
+ }, async: function(m, i) {
1393
+ return this.internalStream(m).accumulate(i);
1394
+ }, nodeStream: function(m, i) {
1395
+ return this.internalStream(m || "nodebuffer").toNodejsStream(i);
1396
+ }, _compressWorker: function(m, i) {
1397
+ if (this._data instanceof d && this._data.compression.magic === m.magic)
1398
+ return this._data.getCompressedWorker();
1399
+ var f = this._decompressWorker();
1400
+ return this._dataBinary || (f = f.pipe(new a.Utf8EncodeWorker())), d.createWorkerFrom(f, m, i);
1401
+ }, _decompressWorker: function() {
1402
+ return this._data instanceof d ? this._data.getContentWorker() : this._data instanceof c ? this._data : new e(this._data);
1403
+ } };
1404
+ for (var _ = ["asText", "asBinary", "asNodeBuffer", "asUint8Array", "asArrayBuffer"], v = function() {
1405
+ throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.");
1406
+ }, s = 0; s < _.length; s++)
1407
+ l.prototype[_[s]] = v;
1408
+ S.exports = l;
1409
+ }, { "./compressedObject": 2, "./stream/DataWorker": 27, "./stream/GenericWorker": 28, "./stream/StreamHelper": 29, "./utf8": 31 }], 36: [function(n, S, g) {
1410
+ (function(l) {
1411
+ var o, e, a = l.MutationObserver || l.WebKitMutationObserver;
1412
+ if (a) {
1413
+ var d = 0, c = new a(m), _ = l.document.createTextNode("");
1414
+ c.observe(_, { characterData: !0 }), o = function() {
1415
+ _.data = d = ++d % 2;
1416
+ };
1417
+ } else if (l.setImmediate || l.MessageChannel === void 0)
1418
+ o = "document" in l && "onreadystatechange" in l.document.createElement("script") ? function() {
1419
+ var i = l.document.createElement("script");
1420
+ i.onreadystatechange = function() {
1421
+ m(), i.onreadystatechange = null, i.parentNode.removeChild(i), i = null;
1422
+ }, l.document.documentElement.appendChild(i);
1423
+ } : function() {
1424
+ setTimeout(m, 0);
1425
+ };
1426
+ else {
1427
+ var v = new l.MessageChannel();
1428
+ v.port1.onmessage = m, o = function() {
1429
+ v.port2.postMessage(0);
1430
+ };
1431
+ }
1432
+ var s = [];
1433
+ function m() {
1434
+ var i, f;
1435
+ e = !0;
1436
+ for (var h = s.length; h; ) {
1437
+ for (f = s, s = [], i = -1; ++i < h; )
1438
+ f[i]();
1439
+ h = s.length;
1440
+ }
1441
+ e = !1;
1442
+ }
1443
+ S.exports = function(i) {
1444
+ s.push(i) !== 1 || e || o();
1445
+ };
1446
+ }).call(this, typeof At < "u" ? At : typeof self < "u" ? self : typeof window < "u" ? window : {});
1447
+ }, {}], 37: [function(n, S, g) {
1448
+ var l = n("immediate");
1449
+ function o() {
1450
+ }
1451
+ var e = {}, a = ["REJECTED"], d = ["FULFILLED"], c = ["PENDING"];
1452
+ function _(h) {
1453
+ if (typeof h != "function")
1454
+ throw new TypeError("resolver must be a function");
1455
+ this.state = c, this.queue = [], this.outcome = void 0, h !== o && i(this, h);
1456
+ }
1457
+ function v(h, u, w) {
1458
+ this.promise = h, typeof u == "function" && (this.onFulfilled = u, this.callFulfilled = this.otherCallFulfilled), typeof w == "function" && (this.onRejected = w, this.callRejected = this.otherCallRejected);
1459
+ }
1460
+ function s(h, u, w) {
1461
+ l(function() {
1462
+ var k;
1463
+ try {
1464
+ k = u(w);
1465
+ } catch (x) {
1466
+ return e.reject(h, x);
1467
+ }
1468
+ k === h ? e.reject(h, new TypeError("Cannot resolve promise with itself")) : e.resolve(h, k);
1469
+ });
1470
+ }
1471
+ function m(h) {
1472
+ var u = h && h.then;
1473
+ if (h && (typeof h == "object" || typeof h == "function") && typeof u == "function")
1474
+ return function() {
1475
+ u.apply(h, arguments);
1476
+ };
1477
+ }
1478
+ function i(h, u) {
1479
+ var w = !1;
1480
+ function k(T) {
1481
+ w || (w = !0, e.reject(h, T));
1482
+ }
1483
+ function x(T) {
1484
+ w || (w = !0, e.resolve(h, T));
1485
+ }
1486
+ var O = f(function() {
1487
+ u(x, k);
1488
+ });
1489
+ O.status === "error" && k(O.value);
1490
+ }
1491
+ function f(h, u) {
1492
+ var w = {};
1493
+ try {
1494
+ w.value = h(u), w.status = "success";
1495
+ } catch (k) {
1496
+ w.status = "error", w.value = k;
1497
+ }
1498
+ return w;
1499
+ }
1500
+ (S.exports = _).prototype.finally = function(h) {
1501
+ if (typeof h != "function")
1502
+ return this;
1503
+ var u = this.constructor;
1504
+ return this.then(function(w) {
1505
+ return u.resolve(h()).then(function() {
1506
+ return w;
1507
+ });
1508
+ }, function(w) {
1509
+ return u.resolve(h()).then(function() {
1510
+ throw w;
1511
+ });
1512
+ });
1513
+ }, _.prototype.catch = function(h) {
1514
+ return this.then(null, h);
1515
+ }, _.prototype.then = function(h, u) {
1516
+ if (typeof h != "function" && this.state === d || typeof u != "function" && this.state === a)
1517
+ return this;
1518
+ var w = new this.constructor(o);
1519
+ return this.state !== c ? s(w, this.state === d ? h : u, this.outcome) : this.queue.push(new v(w, h, u)), w;
1520
+ }, v.prototype.callFulfilled = function(h) {
1521
+ e.resolve(this.promise, h);
1522
+ }, v.prototype.otherCallFulfilled = function(h) {
1523
+ s(this.promise, this.onFulfilled, h);
1524
+ }, v.prototype.callRejected = function(h) {
1525
+ e.reject(this.promise, h);
1526
+ }, v.prototype.otherCallRejected = function(h) {
1527
+ s(this.promise, this.onRejected, h);
1528
+ }, e.resolve = function(h, u) {
1529
+ var w = f(m, u);
1530
+ if (w.status === "error")
1531
+ return e.reject(h, w.value);
1532
+ var k = w.value;
1533
+ if (k)
1534
+ i(h, k);
1535
+ else {
1536
+ h.state = d, h.outcome = u;
1537
+ for (var x = -1, O = h.queue.length; ++x < O; )
1538
+ h.queue[x].callFulfilled(u);
1539
+ }
1540
+ return h;
1541
+ }, e.reject = function(h, u) {
1542
+ h.state = a, h.outcome = u;
1543
+ for (var w = -1, k = h.queue.length; ++w < k; )
1544
+ h.queue[w].callRejected(u);
1545
+ return h;
1546
+ }, _.resolve = function(h) {
1547
+ return h instanceof this ? h : e.resolve(new this(o), h);
1548
+ }, _.reject = function(h) {
1549
+ var u = new this(o);
1550
+ return e.reject(u, h);
1551
+ }, _.all = function(h) {
1552
+ var u = this;
1553
+ if (Object.prototype.toString.call(h) !== "[object Array]")
1554
+ return this.reject(new TypeError("must be an array"));
1555
+ var w = h.length, k = !1;
1556
+ if (!w)
1557
+ return this.resolve([]);
1558
+ for (var x = new Array(w), O = 0, T = -1, M = new this(o); ++T < w; )
1559
+ z(h[T], T);
1560
+ return M;
1561
+ function z(W, j) {
1562
+ u.resolve(W).then(function(b) {
1563
+ x[j] = b, ++O !== w || k || (k = !0, e.resolve(M, x));
1564
+ }, function(b) {
1565
+ k || (k = !0, e.reject(M, b));
1566
+ });
1567
+ }
1568
+ }, _.race = function(h) {
1569
+ var u = this;
1570
+ if (Object.prototype.toString.call(h) !== "[object Array]")
1571
+ return this.reject(new TypeError("must be an array"));
1572
+ var w = h.length, k = !1;
1573
+ if (!w)
1574
+ return this.resolve([]);
1575
+ for (var x = -1, O = new this(o); ++x < w; )
1576
+ T = h[x], u.resolve(T).then(function(M) {
1577
+ k || (k = !0, e.resolve(O, M));
1578
+ }, function(M) {
1579
+ k || (k = !0, e.reject(O, M));
1580
+ });
1581
+ var T;
1582
+ return O;
1583
+ };
1584
+ }, { immediate: 36 }], 38: [function(n, S, g) {
1585
+ var l = {};
1586
+ (0, n("./lib/utils/common").assign)(l, n("./lib/deflate"), n("./lib/inflate"), n("./lib/zlib/constants")), S.exports = l;
1587
+ }, { "./lib/deflate": 39, "./lib/inflate": 40, "./lib/utils/common": 41, "./lib/zlib/constants": 44 }], 39: [function(n, S, g) {
1588
+ var l = n("./zlib/deflate"), o = n("./utils/common"), e = n("./utils/strings"), a = n("./zlib/messages"), d = n("./zlib/zstream"), c = Object.prototype.toString, _ = 0, v = -1, s = 0, m = 8;
1589
+ function i(h) {
1590
+ if (!(this instanceof i))
1591
+ return new i(h);
1592
+ this.options = o.assign({ level: v, method: m, chunkSize: 16384, windowBits: 15, memLevel: 8, strategy: s, to: "" }, h || {});
1593
+ var u = this.options;
1594
+ u.raw && 0 < u.windowBits ? u.windowBits = -u.windowBits : u.gzip && 0 < u.windowBits && u.windowBits < 16 && (u.windowBits += 16), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new d(), this.strm.avail_out = 0;
1595
+ var w = l.deflateInit2(this.strm, u.level, u.method, u.windowBits, u.memLevel, u.strategy);
1596
+ if (w !== _)
1597
+ throw new Error(a[w]);
1598
+ if (u.header && l.deflateSetHeader(this.strm, u.header), u.dictionary) {
1599
+ var k;
1600
+ if (k = typeof u.dictionary == "string" ? e.string2buf(u.dictionary) : c.call(u.dictionary) === "[object ArrayBuffer]" ? new Uint8Array(u.dictionary) : u.dictionary, (w = l.deflateSetDictionary(this.strm, k)) !== _)
1601
+ throw new Error(a[w]);
1602
+ this._dict_set = !0;
1603
+ }
1604
+ }
1605
+ function f(h, u) {
1606
+ var w = new i(u);
1607
+ if (w.push(h, !0), w.err)
1608
+ throw w.msg || a[w.err];
1609
+ return w.result;
1610
+ }
1611
+ i.prototype.push = function(h, u) {
1612
+ var w, k, x = this.strm, O = this.options.chunkSize;
1613
+ if (this.ended)
1614
+ return !1;
1615
+ k = u === ~~u ? u : u === !0 ? 4 : 0, typeof h == "string" ? x.input = e.string2buf(h) : c.call(h) === "[object ArrayBuffer]" ? x.input = new Uint8Array(h) : x.input = h, x.next_in = 0, x.avail_in = x.input.length;
1616
+ do {
1617
+ if (x.avail_out === 0 && (x.output = new o.Buf8(O), x.next_out = 0, x.avail_out = O), (w = l.deflate(x, k)) !== 1 && w !== _)
1618
+ return this.onEnd(w), !(this.ended = !0);
1619
+ x.avail_out !== 0 && (x.avail_in !== 0 || k !== 4 && k !== 2) || (this.options.to === "string" ? this.onData(e.buf2binstring(o.shrinkBuf(x.output, x.next_out))) : this.onData(o.shrinkBuf(x.output, x.next_out)));
1620
+ } while ((0 < x.avail_in || x.avail_out === 0) && w !== 1);
1621
+ return k === 4 ? (w = l.deflateEnd(this.strm), this.onEnd(w), this.ended = !0, w === _) : k !== 2 || (this.onEnd(_), !(x.avail_out = 0));
1622
+ }, i.prototype.onData = function(h) {
1623
+ this.chunks.push(h);
1624
+ }, i.prototype.onEnd = function(h) {
1625
+ h === _ && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = o.flattenChunks(this.chunks)), this.chunks = [], this.err = h, this.msg = this.strm.msg;
1626
+ }, g.Deflate = i, g.deflate = f, g.deflateRaw = function(h, u) {
1627
+ return (u = u || {}).raw = !0, f(h, u);
1628
+ }, g.gzip = function(h, u) {
1629
+ return (u = u || {}).gzip = !0, f(h, u);
1630
+ };
1631
+ }, { "./utils/common": 41, "./utils/strings": 42, "./zlib/deflate": 46, "./zlib/messages": 51, "./zlib/zstream": 53 }], 40: [function(n, S, g) {
1632
+ var l = n("./zlib/inflate"), o = n("./utils/common"), e = n("./utils/strings"), a = n("./zlib/constants"), d = n("./zlib/messages"), c = n("./zlib/zstream"), _ = n("./zlib/gzheader"), v = Object.prototype.toString;
1633
+ function s(i) {
1634
+ if (!(this instanceof s))
1635
+ return new s(i);
1636
+ this.options = o.assign({ chunkSize: 16384, windowBits: 0, to: "" }, i || {});
1637
+ var f = this.options;
1638
+ f.raw && 0 <= f.windowBits && f.windowBits < 16 && (f.windowBits = -f.windowBits, f.windowBits === 0 && (f.windowBits = -15)), !(0 <= f.windowBits && f.windowBits < 16) || i && i.windowBits || (f.windowBits += 32), 15 < f.windowBits && f.windowBits < 48 && !(15 & f.windowBits) && (f.windowBits |= 15), this.err = 0, this.msg = "", this.ended = !1, this.chunks = [], this.strm = new c(), this.strm.avail_out = 0;
1639
+ var h = l.inflateInit2(this.strm, f.windowBits);
1640
+ if (h !== a.Z_OK)
1641
+ throw new Error(d[h]);
1642
+ this.header = new _(), l.inflateGetHeader(this.strm, this.header);
1643
+ }
1644
+ function m(i, f) {
1645
+ var h = new s(f);
1646
+ if (h.push(i, !0), h.err)
1647
+ throw h.msg || d[h.err];
1648
+ return h.result;
1649
+ }
1650
+ s.prototype.push = function(i, f) {
1651
+ var h, u, w, k, x, O, T = this.strm, M = this.options.chunkSize, z = this.options.dictionary, W = !1;
1652
+ if (this.ended)
1653
+ return !1;
1654
+ u = f === ~~f ? f : f === !0 ? a.Z_FINISH : a.Z_NO_FLUSH, typeof i == "string" ? T.input = e.binstring2buf(i) : v.call(i) === "[object ArrayBuffer]" ? T.input = new Uint8Array(i) : T.input = i, T.next_in = 0, T.avail_in = T.input.length;
1655
+ do {
1656
+ if (T.avail_out === 0 && (T.output = new o.Buf8(M), T.next_out = 0, T.avail_out = M), (h = l.inflate(T, a.Z_NO_FLUSH)) === a.Z_NEED_DICT && z && (O = typeof z == "string" ? e.string2buf(z) : v.call(z) === "[object ArrayBuffer]" ? new Uint8Array(z) : z, h = l.inflateSetDictionary(this.strm, O)), h === a.Z_BUF_ERROR && W === !0 && (h = a.Z_OK, W = !1), h !== a.Z_STREAM_END && h !== a.Z_OK)
1657
+ return this.onEnd(h), !(this.ended = !0);
1658
+ T.next_out && (T.avail_out !== 0 && h !== a.Z_STREAM_END && (T.avail_in !== 0 || u !== a.Z_FINISH && u !== a.Z_SYNC_FLUSH) || (this.options.to === "string" ? (w = e.utf8border(T.output, T.next_out), k = T.next_out - w, x = e.buf2string(T.output, w), T.next_out = k, T.avail_out = M - k, k && o.arraySet(T.output, T.output, w, k, 0), this.onData(x)) : this.onData(o.shrinkBuf(T.output, T.next_out)))), T.avail_in === 0 && T.avail_out === 0 && (W = !0);
1659
+ } while ((0 < T.avail_in || T.avail_out === 0) && h !== a.Z_STREAM_END);
1660
+ return h === a.Z_STREAM_END && (u = a.Z_FINISH), u === a.Z_FINISH ? (h = l.inflateEnd(this.strm), this.onEnd(h), this.ended = !0, h === a.Z_OK) : u !== a.Z_SYNC_FLUSH || (this.onEnd(a.Z_OK), !(T.avail_out = 0));
1661
+ }, s.prototype.onData = function(i) {
1662
+ this.chunks.push(i);
1663
+ }, s.prototype.onEnd = function(i) {
1664
+ i === a.Z_OK && (this.options.to === "string" ? this.result = this.chunks.join("") : this.result = o.flattenChunks(this.chunks)), this.chunks = [], this.err = i, this.msg = this.strm.msg;
1665
+ }, g.Inflate = s, g.inflate = m, g.inflateRaw = function(i, f) {
1666
+ return (f = f || {}).raw = !0, m(i, f);
1667
+ }, g.ungzip = m;
1668
+ }, { "./utils/common": 41, "./utils/strings": 42, "./zlib/constants": 44, "./zlib/gzheader": 47, "./zlib/inflate": 49, "./zlib/messages": 51, "./zlib/zstream": 53 }], 41: [function(n, S, g) {
1669
+ var l = typeof Uint8Array < "u" && typeof Uint16Array < "u" && typeof Int32Array < "u";
1670
+ g.assign = function(a) {
1671
+ for (var d = Array.prototype.slice.call(arguments, 1); d.length; ) {
1672
+ var c = d.shift();
1673
+ if (c) {
1674
+ if (typeof c != "object")
1675
+ throw new TypeError(c + "must be non-object");
1676
+ for (var _ in c)
1677
+ c.hasOwnProperty(_) && (a[_] = c[_]);
1678
+ }
1679
+ }
1680
+ return a;
1681
+ }, g.shrinkBuf = function(a, d) {
1682
+ return a.length === d ? a : a.subarray ? a.subarray(0, d) : (a.length = d, a);
1683
+ };
1684
+ var o = { arraySet: function(a, d, c, _, v) {
1685
+ if (d.subarray && a.subarray)
1686
+ a.set(d.subarray(c, c + _), v);
1687
+ else
1688
+ for (var s = 0; s < _; s++)
1689
+ a[v + s] = d[c + s];
1690
+ }, flattenChunks: function(a) {
1691
+ var d, c, _, v, s, m;
1692
+ for (d = _ = 0, c = a.length; d < c; d++)
1693
+ _ += a[d].length;
1694
+ for (m = new Uint8Array(_), d = v = 0, c = a.length; d < c; d++)
1695
+ s = a[d], m.set(s, v), v += s.length;
1696
+ return m;
1697
+ } }, e = { arraySet: function(a, d, c, _, v) {
1698
+ for (var s = 0; s < _; s++)
1699
+ a[v + s] = d[c + s];
1700
+ }, flattenChunks: function(a) {
1701
+ return [].concat.apply([], a);
1702
+ } };
1703
+ g.setTyped = function(a) {
1704
+ a ? (g.Buf8 = Uint8Array, g.Buf16 = Uint16Array, g.Buf32 = Int32Array, g.assign(g, o)) : (g.Buf8 = Array, g.Buf16 = Array, g.Buf32 = Array, g.assign(g, e));
1705
+ }, g.setTyped(l);
1706
+ }, {}], 42: [function(n, S, g) {
1707
+ var l = n("./common"), o = !0, e = !0;
1708
+ try {
1709
+ String.fromCharCode.apply(null, [0]);
1710
+ } catch {
1711
+ o = !1;
1712
+ }
1713
+ try {
1714
+ String.fromCharCode.apply(null, new Uint8Array(1));
1715
+ } catch {
1716
+ e = !1;
1717
+ }
1718
+ for (var a = new l.Buf8(256), d = 0; d < 256; d++)
1719
+ a[d] = 252 <= d ? 6 : 248 <= d ? 5 : 240 <= d ? 4 : 224 <= d ? 3 : 192 <= d ? 2 : 1;
1720
+ function c(_, v) {
1721
+ if (v < 65537 && (_.subarray && e || !_.subarray && o))
1722
+ return String.fromCharCode.apply(null, l.shrinkBuf(_, v));
1723
+ for (var s = "", m = 0; m < v; m++)
1724
+ s += String.fromCharCode(_[m]);
1725
+ return s;
1726
+ }
1727
+ a[254] = a[254] = 1, g.string2buf = function(_) {
1728
+ var v, s, m, i, f, h = _.length, u = 0;
1729
+ for (i = 0; i < h; i++)
1730
+ (64512 & (s = _.charCodeAt(i))) == 55296 && i + 1 < h && (64512 & (m = _.charCodeAt(i + 1))) == 56320 && (s = 65536 + (s - 55296 << 10) + (m - 56320), i++), u += s < 128 ? 1 : s < 2048 ? 2 : s < 65536 ? 3 : 4;
1731
+ for (v = new l.Buf8(u), i = f = 0; f < u; i++)
1732
+ (64512 & (s = _.charCodeAt(i))) == 55296 && i + 1 < h && (64512 & (m = _.charCodeAt(i + 1))) == 56320 && (s = 65536 + (s - 55296 << 10) + (m - 56320), i++), s < 128 ? v[f++] = s : (s < 2048 ? v[f++] = 192 | s >>> 6 : (s < 65536 ? v[f++] = 224 | s >>> 12 : (v[f++] = 240 | s >>> 18, v[f++] = 128 | s >>> 12 & 63), v[f++] = 128 | s >>> 6 & 63), v[f++] = 128 | 63 & s);
1733
+ return v;
1734
+ }, g.buf2binstring = function(_) {
1735
+ return c(_, _.length);
1736
+ }, g.binstring2buf = function(_) {
1737
+ for (var v = new l.Buf8(_.length), s = 0, m = v.length; s < m; s++)
1738
+ v[s] = _.charCodeAt(s);
1739
+ return v;
1740
+ }, g.buf2string = function(_, v) {
1741
+ var s, m, i, f, h = v || _.length, u = new Array(2 * h);
1742
+ for (s = m = 0; s < h; )
1743
+ if ((i = _[s++]) < 128)
1744
+ u[m++] = i;
1745
+ else if (4 < (f = a[i]))
1746
+ u[m++] = 65533, s += f - 1;
1747
+ else {
1748
+ for (i &= f === 2 ? 31 : f === 3 ? 15 : 7; 1 < f && s < h; )
1749
+ i = i << 6 | 63 & _[s++], f--;
1750
+ 1 < f ? u[m++] = 65533 : i < 65536 ? u[m++] = i : (i -= 65536, u[m++] = 55296 | i >> 10 & 1023, u[m++] = 56320 | 1023 & i);
1751
+ }
1752
+ return c(u, m);
1753
+ }, g.utf8border = function(_, v) {
1754
+ var s;
1755
+ for ((v = v || _.length) > _.length && (v = _.length), s = v - 1; 0 <= s && (192 & _[s]) == 128; )
1756
+ s--;
1757
+ return s < 0 || s === 0 ? v : s + a[_[s]] > v ? s : v;
1758
+ };
1759
+ }, { "./common": 41 }], 43: [function(n, S, g) {
1760
+ S.exports = function(l, o, e, a) {
1761
+ for (var d = 65535 & l | 0, c = l >>> 16 & 65535 | 0, _ = 0; e !== 0; ) {
1762
+ for (e -= _ = 2e3 < e ? 2e3 : e; c = c + (d = d + o[a++] | 0) | 0, --_; )
1763
+ ;
1764
+ d %= 65521, c %= 65521;
1765
+ }
1766
+ return d | c << 16 | 0;
1767
+ };
1768
+ }, {}], 44: [function(n, S, g) {
1769
+ S.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 };
1770
+ }, {}], 45: [function(n, S, g) {
1771
+ var l = function() {
1772
+ for (var o, e = [], a = 0; a < 256; a++) {
1773
+ o = a;
1774
+ for (var d = 0; d < 8; d++)
1775
+ o = 1 & o ? 3988292384 ^ o >>> 1 : o >>> 1;
1776
+ e[a] = o;
1777
+ }
1778
+ return e;
1779
+ }();
1780
+ S.exports = function(o, e, a, d) {
1781
+ var c = l, _ = d + a;
1782
+ o ^= -1;
1783
+ for (var v = d; v < _; v++)
1784
+ o = o >>> 8 ^ c[255 & (o ^ e[v])];
1785
+ return -1 ^ o;
1786
+ };
1787
+ }, {}], 46: [function(n, S, g) {
1788
+ var l, o = n("../utils/common"), e = n("./trees"), a = n("./adler32"), d = n("./crc32"), c = n("./messages"), _ = 0, v = 4, s = 0, m = -2, i = -1, f = 4, h = 2, u = 8, w = 9, k = 286, x = 30, O = 19, T = 2 * k + 1, M = 15, z = 3, W = 258, j = W + z + 1, b = 42, F = 113, r = 1, N = 2, Q = 3, $ = 4;
1789
+ function Y(t, D) {
1790
+ return t.msg = c[D], D;
1791
+ }
1792
+ function L(t) {
1793
+ return (t << 1) - (4 < t ? 9 : 0);
1794
+ }
1795
+ function K(t) {
1796
+ for (var D = t.length; 0 <= --D; )
1797
+ t[D] = 0;
1798
+ }
1799
+ function I(t) {
1800
+ var D = t.state, R = D.pending;
1801
+ R > t.avail_out && (R = t.avail_out), R !== 0 && (o.arraySet(t.output, D.pending_buf, D.pending_out, R, t.next_out), t.next_out += R, D.pending_out += R, t.total_out += R, t.avail_out -= R, D.pending -= R, D.pending === 0 && (D.pending_out = 0));
1802
+ }
1803
+ function B(t, D) {
1804
+ e._tr_flush_block(t, 0 <= t.block_start ? t.block_start : -1, t.strstart - t.block_start, D), t.block_start = t.strstart, I(t.strm);
1805
+ }
1806
+ function tt(t, D) {
1807
+ t.pending_buf[t.pending++] = D;
1808
+ }
1809
+ function q(t, D) {
1810
+ t.pending_buf[t.pending++] = D >>> 8 & 255, t.pending_buf[t.pending++] = 255 & D;
1811
+ }
1812
+ function X(t, D) {
1813
+ var R, y, p = t.max_chain_length, C = t.strstart, U = t.prev_length, Z = t.nice_match, A = t.strstart > t.w_size - j ? t.strstart - (t.w_size - j) : 0, H = t.window, J = t.w_mask, G = t.prev, V = t.strstart + W, it = H[C + U - 1], rt = H[C + U];
1814
+ t.prev_length >= t.good_match && (p >>= 2), Z > t.lookahead && (Z = t.lookahead);
1815
+ do
1816
+ if (H[(R = D) + U] === rt && H[R + U - 1] === it && H[R] === H[C] && H[++R] === H[C + 1]) {
1817
+ C += 2, R++;
1818
+ do
1819
+ ;
1820
+ while (H[++C] === H[++R] && H[++C] === H[++R] && H[++C] === H[++R] && H[++C] === H[++R] && H[++C] === H[++R] && H[++C] === H[++R] && H[++C] === H[++R] && H[++C] === H[++R] && C < V);
1821
+ if (y = W - (V - C), C = V - W, U < y) {
1822
+ if (t.match_start = D, Z <= (U = y))
1823
+ break;
1824
+ it = H[C + U - 1], rt = H[C + U];
1825
+ }
1826
+ }
1827
+ while ((D = G[D & J]) > A && --p != 0);
1828
+ return U <= t.lookahead ? U : t.lookahead;
1829
+ }
1830
+ function st(t) {
1831
+ var D, R, y, p, C, U, Z, A, H, J, G = t.w_size;
1832
+ do {
1833
+ if (p = t.window_size - t.lookahead - t.strstart, t.strstart >= G + (G - j)) {
1834
+ for (o.arraySet(t.window, t.window, G, G, 0), t.match_start -= G, t.strstart -= G, t.block_start -= G, D = R = t.hash_size; y = t.head[--D], t.head[D] = G <= y ? y - G : 0, --R; )
1835
+ ;
1836
+ for (D = R = G; y = t.prev[--D], t.prev[D] = G <= y ? y - G : 0, --R; )
1837
+ ;
1838
+ p += G;
1839
+ }
1840
+ if (t.strm.avail_in === 0)
1841
+ break;
1842
+ if (U = t.strm, Z = t.window, A = t.strstart + t.lookahead, H = p, J = void 0, J = U.avail_in, H < J && (J = H), R = J === 0 ? 0 : (U.avail_in -= J, o.arraySet(Z, U.input, U.next_in, J, A), U.state.wrap === 1 ? U.adler = a(U.adler, Z, J, A) : U.state.wrap === 2 && (U.adler = d(U.adler, Z, J, A)), U.next_in += J, U.total_in += J, J), t.lookahead += R, t.lookahead + t.insert >= z)
1843
+ for (C = t.strstart - t.insert, t.ins_h = t.window[C], t.ins_h = (t.ins_h << t.hash_shift ^ t.window[C + 1]) & t.hash_mask; t.insert && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[C + z - 1]) & t.hash_mask, t.prev[C & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = C, C++, t.insert--, !(t.lookahead + t.insert < z)); )
1844
+ ;
1845
+ } while (t.lookahead < j && t.strm.avail_in !== 0);
1846
+ }
1847
+ function ct(t, D) {
1848
+ for (var R, y; ; ) {
1849
+ if (t.lookahead < j) {
1850
+ if (st(t), t.lookahead < j && D === _)
1851
+ return r;
1852
+ if (t.lookahead === 0)
1853
+ break;
1854
+ }
1855
+ if (R = 0, t.lookahead >= z && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + z - 1]) & t.hash_mask, R = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart), R !== 0 && t.strstart - R <= t.w_size - j && (t.match_length = X(t, R)), t.match_length >= z)
1856
+ if (y = e._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) {
1857
+ for (t.match_length--; t.strstart++, t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + z - 1]) & t.hash_mask, R = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart, --t.match_length != 0; )
1858
+ ;
1859
+ t.strstart++;
1860
+ } else
1861
+ 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;
1862
+ else
1863
+ y = e._tr_tally(t, 0, t.window[t.strstart]), t.lookahead--, t.strstart++;
1864
+ if (y && (B(t, !1), t.strm.avail_out === 0))
1865
+ return r;
1866
+ }
1867
+ return t.insert = t.strstart < z - 1 ? t.strstart : z - 1, D === v ? (B(t, !0), t.strm.avail_out === 0 ? Q : $) : t.last_lit && (B(t, !1), t.strm.avail_out === 0) ? r : N;
1868
+ }
1869
+ function et(t, D) {
1870
+ for (var R, y, p; ; ) {
1871
+ if (t.lookahead < j) {
1872
+ if (st(t), t.lookahead < j && D === _)
1873
+ return r;
1874
+ if (t.lookahead === 0)
1875
+ break;
1876
+ }
1877
+ if (R = 0, t.lookahead >= z && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + z - 1]) & t.hash_mask, R = 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, R !== 0 && t.prev_length < t.max_lazy_match && t.strstart - R <= t.w_size - j && (t.match_length = X(t, R), 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) {
1878
+ for (p = t.strstart + t.lookahead - z, y = e._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 <= p && (t.ins_h = (t.ins_h << t.hash_shift ^ t.window[t.strstart + z - 1]) & t.hash_mask, R = t.prev[t.strstart & t.w_mask] = t.head[t.ins_h], t.head[t.ins_h] = t.strstart), --t.prev_length != 0; )
1879
+ ;
1880
+ if (t.match_available = 0, t.match_length = z - 1, t.strstart++, y && (B(t, !1), t.strm.avail_out === 0))
1881
+ return r;
1882
+ } else if (t.match_available) {
1883
+ if ((y = e._tr_tally(t, 0, t.window[t.strstart - 1])) && B(t, !1), t.strstart++, t.lookahead--, t.strm.avail_out === 0)
1884
+ return r;
1885
+ } else
1886
+ t.match_available = 1, t.strstart++, t.lookahead--;
1887
+ }
1888
+ return t.match_available && (y = e._tr_tally(t, 0, t.window[t.strstart - 1]), t.match_available = 0), t.insert = t.strstart < z - 1 ? t.strstart : z - 1, D === v ? (B(t, !0), t.strm.avail_out === 0 ? Q : $) : t.last_lit && (B(t, !1), t.strm.avail_out === 0) ? r : N;
1889
+ }
1890
+ function nt(t, D, R, y, p) {
1891
+ this.good_length = t, this.max_lazy = D, this.nice_length = R, this.max_chain = y, this.func = p;
1892
+ }
1893
+ function ht() {
1894
+ 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 = u, 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 o.Buf16(2 * T), this.dyn_dtree = new o.Buf16(2 * (2 * x + 1)), this.bl_tree = new o.Buf16(2 * (2 * O + 1)), K(this.dyn_ltree), K(this.dyn_dtree), K(this.bl_tree), this.l_desc = null, this.d_desc = null, this.bl_desc = null, this.bl_count = new o.Buf16(M + 1), this.heap = new o.Buf16(2 * k + 1), K(this.heap), this.heap_len = 0, this.heap_max = 0, this.depth = new o.Buf16(2 * k + 1), K(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;
1895
+ }
1896
+ function ot(t) {
1897
+ var D;
1898
+ return t && t.state ? (t.total_in = t.total_out = 0, t.data_type = h, (D = t.state).pending = 0, D.pending_out = 0, D.wrap < 0 && (D.wrap = -D.wrap), D.status = D.wrap ? b : F, t.adler = D.wrap === 2 ? 0 : 1, D.last_flush = _, e._tr_init(D), s) : Y(t, m);
1899
+ }
1900
+ function mt(t) {
1901
+ var D = ot(t);
1902
+ return D === s && function(R) {
1903
+ R.window_size = 2 * R.w_size, K(R.head), R.max_lazy_match = l[R.level].max_lazy, R.good_match = l[R.level].good_length, R.nice_match = l[R.level].nice_length, R.max_chain_length = l[R.level].max_chain, R.strstart = 0, R.block_start = 0, R.lookahead = 0, R.insert = 0, R.match_length = R.prev_length = z - 1, R.match_available = 0, R.ins_h = 0;
1904
+ }(t.state), D;
1905
+ }
1906
+ function pt(t, D, R, y, p, C) {
1907
+ if (!t)
1908
+ return m;
1909
+ var U = 1;
1910
+ if (D === i && (D = 6), y < 0 ? (U = 0, y = -y) : 15 < y && (U = 2, y -= 16), p < 1 || w < p || R !== u || y < 8 || 15 < y || D < 0 || 9 < D || C < 0 || f < C)
1911
+ return Y(t, m);
1912
+ y === 8 && (y = 9);
1913
+ var Z = new ht();
1914
+ return (t.state = Z).strm = t, Z.wrap = U, Z.gzhead = null, Z.w_bits = y, Z.w_size = 1 << Z.w_bits, Z.w_mask = Z.w_size - 1, Z.hash_bits = p + 7, Z.hash_size = 1 << Z.hash_bits, Z.hash_mask = Z.hash_size - 1, Z.hash_shift = ~~((Z.hash_bits + z - 1) / z), Z.window = new o.Buf8(2 * Z.w_size), Z.head = new o.Buf16(Z.hash_size), Z.prev = new o.Buf16(Z.w_size), Z.lit_bufsize = 1 << p + 6, Z.pending_buf_size = 4 * Z.lit_bufsize, Z.pending_buf = new o.Buf8(Z.pending_buf_size), Z.d_buf = 1 * Z.lit_bufsize, Z.l_buf = 3 * Z.lit_bufsize, Z.level = D, Z.strategy = C, Z.method = R, mt(t);
1915
+ }
1916
+ l = [new nt(0, 0, 0, 0, function(t, D) {
1917
+ var R = 65535;
1918
+ for (R > t.pending_buf_size - 5 && (R = t.pending_buf_size - 5); ; ) {
1919
+ if (t.lookahead <= 1) {
1920
+ if (st(t), t.lookahead === 0 && D === _)
1921
+ return r;
1922
+ if (t.lookahead === 0)
1923
+ break;
1924
+ }
1925
+ t.strstart += t.lookahead, t.lookahead = 0;
1926
+ var y = t.block_start + R;
1927
+ if ((t.strstart === 0 || t.strstart >= y) && (t.lookahead = t.strstart - y, t.strstart = y, B(t, !1), t.strm.avail_out === 0) || t.strstart - t.block_start >= t.w_size - j && (B(t, !1), t.strm.avail_out === 0))
1928
+ return r;
1929
+ }
1930
+ return t.insert = 0, D === v ? (B(t, !0), t.strm.avail_out === 0 ? Q : $) : (t.strstart > t.block_start && (B(t, !1), t.strm.avail_out), r);
1931
+ }), new nt(4, 4, 8, 4, ct), new nt(4, 5, 16, 8, ct), new nt(4, 6, 32, 32, ct), new nt(4, 4, 16, 16, et), new nt(8, 16, 32, 32, et), new nt(8, 16, 128, 128, et), new nt(8, 32, 128, 256, et), new nt(32, 128, 258, 1024, et), new nt(32, 258, 258, 4096, et)], g.deflateInit = function(t, D) {
1932
+ return pt(t, D, u, 15, 8, 0);
1933
+ }, g.deflateInit2 = pt, g.deflateReset = mt, g.deflateResetKeep = ot, g.deflateSetHeader = function(t, D) {
1934
+ return t && t.state ? t.state.wrap !== 2 ? m : (t.state.gzhead = D, s) : m;
1935
+ }, g.deflate = function(t, D) {
1936
+ var R, y, p, C;
1937
+ if (!t || !t.state || 5 < D || D < 0)
1938
+ return t ? Y(t, m) : m;
1939
+ if (y = t.state, !t.output || !t.input && t.avail_in !== 0 || y.status === 666 && D !== v)
1940
+ return Y(t, t.avail_out === 0 ? -5 : m);
1941
+ if (y.strm = t, R = y.last_flush, y.last_flush = D, y.status === b)
1942
+ if (y.wrap === 2)
1943
+ t.adler = 0, tt(y, 31), tt(y, 139), tt(y, 8), y.gzhead ? (tt(y, (y.gzhead.text ? 1 : 0) + (y.gzhead.hcrc ? 2 : 0) + (y.gzhead.extra ? 4 : 0) + (y.gzhead.name ? 8 : 0) + (y.gzhead.comment ? 16 : 0)), tt(y, 255 & y.gzhead.time), tt(y, y.gzhead.time >> 8 & 255), tt(y, y.gzhead.time >> 16 & 255), tt(y, y.gzhead.time >> 24 & 255), tt(y, y.level === 9 ? 2 : 2 <= y.strategy || y.level < 2 ? 4 : 0), tt(y, 255 & y.gzhead.os), y.gzhead.extra && y.gzhead.extra.length && (tt(y, 255 & y.gzhead.extra.length), tt(y, y.gzhead.extra.length >> 8 & 255)), y.gzhead.hcrc && (t.adler = d(t.adler, y.pending_buf, y.pending, 0)), y.gzindex = 0, y.status = 69) : (tt(y, 0), tt(y, 0), tt(y, 0), tt(y, 0), tt(y, 0), tt(y, y.level === 9 ? 2 : 2 <= y.strategy || y.level < 2 ? 4 : 0), tt(y, 3), y.status = F);
1944
+ else {
1945
+ var U = u + (y.w_bits - 8 << 4) << 8;
1946
+ U |= (2 <= y.strategy || y.level < 2 ? 0 : y.level < 6 ? 1 : y.level === 6 ? 2 : 3) << 6, y.strstart !== 0 && (U |= 32), U += 31 - U % 31, y.status = F, q(y, U), y.strstart !== 0 && (q(y, t.adler >>> 16), q(y, 65535 & t.adler)), t.adler = 1;
1947
+ }
1948
+ if (y.status === 69)
1949
+ if (y.gzhead.extra) {
1950
+ for (p = y.pending; y.gzindex < (65535 & y.gzhead.extra.length) && (y.pending !== y.pending_buf_size || (y.gzhead.hcrc && y.pending > p && (t.adler = d(t.adler, y.pending_buf, y.pending - p, p)), I(t), p = y.pending, y.pending !== y.pending_buf_size)); )
1951
+ tt(y, 255 & y.gzhead.extra[y.gzindex]), y.gzindex++;
1952
+ y.gzhead.hcrc && y.pending > p && (t.adler = d(t.adler, y.pending_buf, y.pending - p, p)), y.gzindex === y.gzhead.extra.length && (y.gzindex = 0, y.status = 73);
1953
+ } else
1954
+ y.status = 73;
1955
+ if (y.status === 73)
1956
+ if (y.gzhead.name) {
1957
+ p = y.pending;
1958
+ do {
1959
+ if (y.pending === y.pending_buf_size && (y.gzhead.hcrc && y.pending > p && (t.adler = d(t.adler, y.pending_buf, y.pending - p, p)), I(t), p = y.pending, y.pending === y.pending_buf_size)) {
1960
+ C = 1;
1961
+ break;
1962
+ }
1963
+ C = y.gzindex < y.gzhead.name.length ? 255 & y.gzhead.name.charCodeAt(y.gzindex++) : 0, tt(y, C);
1964
+ } while (C !== 0);
1965
+ y.gzhead.hcrc && y.pending > p && (t.adler = d(t.adler, y.pending_buf, y.pending - p, p)), C === 0 && (y.gzindex = 0, y.status = 91);
1966
+ } else
1967
+ y.status = 91;
1968
+ if (y.status === 91)
1969
+ if (y.gzhead.comment) {
1970
+ p = y.pending;
1971
+ do {
1972
+ if (y.pending === y.pending_buf_size && (y.gzhead.hcrc && y.pending > p && (t.adler = d(t.adler, y.pending_buf, y.pending - p, p)), I(t), p = y.pending, y.pending === y.pending_buf_size)) {
1973
+ C = 1;
1974
+ break;
1975
+ }
1976
+ C = y.gzindex < y.gzhead.comment.length ? 255 & y.gzhead.comment.charCodeAt(y.gzindex++) : 0, tt(y, C);
1977
+ } while (C !== 0);
1978
+ y.gzhead.hcrc && y.pending > p && (t.adler = d(t.adler, y.pending_buf, y.pending - p, p)), C === 0 && (y.status = 103);
1979
+ } else
1980
+ y.status = 103;
1981
+ if (y.status === 103 && (y.gzhead.hcrc ? (y.pending + 2 > y.pending_buf_size && I(t), y.pending + 2 <= y.pending_buf_size && (tt(y, 255 & t.adler), tt(y, t.adler >> 8 & 255), t.adler = 0, y.status = F)) : y.status = F), y.pending !== 0) {
1982
+ if (I(t), t.avail_out === 0)
1983
+ return y.last_flush = -1, s;
1984
+ } else if (t.avail_in === 0 && L(D) <= L(R) && D !== v)
1985
+ return Y(t, -5);
1986
+ if (y.status === 666 && t.avail_in !== 0)
1987
+ return Y(t, -5);
1988
+ if (t.avail_in !== 0 || y.lookahead !== 0 || D !== _ && y.status !== 666) {
1989
+ var Z = y.strategy === 2 ? function(A, H) {
1990
+ for (var J; ; ) {
1991
+ if (A.lookahead === 0 && (st(A), A.lookahead === 0)) {
1992
+ if (H === _)
1993
+ return r;
1994
+ break;
1995
+ }
1996
+ if (A.match_length = 0, J = e._tr_tally(A, 0, A.window[A.strstart]), A.lookahead--, A.strstart++, J && (B(A, !1), A.strm.avail_out === 0))
1997
+ return r;
1998
+ }
1999
+ return A.insert = 0, H === v ? (B(A, !0), A.strm.avail_out === 0 ? Q : $) : A.last_lit && (B(A, !1), A.strm.avail_out === 0) ? r : N;
2000
+ }(y, D) : y.strategy === 3 ? function(A, H) {
2001
+ for (var J, G, V, it, rt = A.window; ; ) {
2002
+ if (A.lookahead <= W) {
2003
+ if (st(A), A.lookahead <= W && H === _)
2004
+ return r;
2005
+ if (A.lookahead === 0)
2006
+ break;
2007
+ }
2008
+ if (A.match_length = 0, A.lookahead >= z && 0 < A.strstart && (G = rt[V = A.strstart - 1]) === rt[++V] && G === rt[++V] && G === rt[++V]) {
2009
+ it = A.strstart + W;
2010
+ do
2011
+ ;
2012
+ while (G === rt[++V] && G === rt[++V] && G === rt[++V] && G === rt[++V] && G === rt[++V] && G === rt[++V] && G === rt[++V] && G === rt[++V] && V < it);
2013
+ A.match_length = W - (it - V), A.match_length > A.lookahead && (A.match_length = A.lookahead);
2014
+ }
2015
+ if (A.match_length >= z ? (J = e._tr_tally(A, 1, A.match_length - z), A.lookahead -= A.match_length, A.strstart += A.match_length, A.match_length = 0) : (J = e._tr_tally(A, 0, A.window[A.strstart]), A.lookahead--, A.strstart++), J && (B(A, !1), A.strm.avail_out === 0))
2016
+ return r;
2017
+ }
2018
+ return A.insert = 0, H === v ? (B(A, !0), A.strm.avail_out === 0 ? Q : $) : A.last_lit && (B(A, !1), A.strm.avail_out === 0) ? r : N;
2019
+ }(y, D) : l[y.level].func(y, D);
2020
+ if (Z !== Q && Z !== $ || (y.status = 666), Z === r || Z === Q)
2021
+ return t.avail_out === 0 && (y.last_flush = -1), s;
2022
+ if (Z === N && (D === 1 ? e._tr_align(y) : D !== 5 && (e._tr_stored_block(y, 0, 0, !1), D === 3 && (K(y.head), y.lookahead === 0 && (y.strstart = 0, y.block_start = 0, y.insert = 0))), I(t), t.avail_out === 0))
2023
+ return y.last_flush = -1, s;
2024
+ }
2025
+ return D !== v ? s : y.wrap <= 0 ? 1 : (y.wrap === 2 ? (tt(y, 255 & t.adler), tt(y, t.adler >> 8 & 255), tt(y, t.adler >> 16 & 255), tt(y, t.adler >> 24 & 255), tt(y, 255 & t.total_in), tt(y, t.total_in >> 8 & 255), tt(y, t.total_in >> 16 & 255), tt(y, t.total_in >> 24 & 255)) : (q(y, t.adler >>> 16), q(y, 65535 & t.adler)), I(t), 0 < y.wrap && (y.wrap = -y.wrap), y.pending !== 0 ? s : 1);
2026
+ }, g.deflateEnd = function(t) {
2027
+ var D;
2028
+ return t && t.state ? (D = t.state.status) !== b && D !== 69 && D !== 73 && D !== 91 && D !== 103 && D !== F && D !== 666 ? Y(t, m) : (t.state = null, D === F ? Y(t, -3) : s) : m;
2029
+ }, g.deflateSetDictionary = function(t, D) {
2030
+ var R, y, p, C, U, Z, A, H, J = D.length;
2031
+ if (!t || !t.state || (C = (R = t.state).wrap) === 2 || C === 1 && R.status !== b || R.lookahead)
2032
+ return m;
2033
+ for (C === 1 && (t.adler = a(t.adler, D, J, 0)), R.wrap = 0, J >= R.w_size && (C === 0 && (K(R.head), R.strstart = 0, R.block_start = 0, R.insert = 0), H = new o.Buf8(R.w_size), o.arraySet(H, D, J - R.w_size, R.w_size, 0), D = H, J = R.w_size), U = t.avail_in, Z = t.next_in, A = t.input, t.avail_in = J, t.next_in = 0, t.input = D, st(R); R.lookahead >= z; ) {
2034
+ for (y = R.strstart, p = R.lookahead - (z - 1); R.ins_h = (R.ins_h << R.hash_shift ^ R.window[y + z - 1]) & R.hash_mask, R.prev[y & R.w_mask] = R.head[R.ins_h], R.head[R.ins_h] = y, y++, --p; )
2035
+ ;
2036
+ R.strstart = y, R.lookahead = z - 1, st(R);
2037
+ }
2038
+ return R.strstart += R.lookahead, R.block_start = R.strstart, R.insert = R.lookahead, R.lookahead = 0, R.match_length = R.prev_length = z - 1, R.match_available = 0, t.next_in = Z, t.input = A, t.avail_in = U, R.wrap = C, s;
2039
+ }, g.deflateInfo = "pako deflate (from Nodeca project)";
2040
+ }, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./messages": 51, "./trees": 52 }], 47: [function(n, S, g) {
2041
+ S.exports = function() {
2042
+ 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;
2043
+ };
2044
+ }, {}], 48: [function(n, S, g) {
2045
+ S.exports = function(l, o) {
2046
+ var e, a, d, c, _, v, s, m, i, f, h, u, w, k, x, O, T, M, z, W, j, b, F, r, N;
2047
+ e = l.state, a = l.next_in, r = l.input, d = a + (l.avail_in - 5), c = l.next_out, N = l.output, _ = c - (o - l.avail_out), v = c + (l.avail_out - 257), s = e.dmax, m = e.wsize, i = e.whave, f = e.wnext, h = e.window, u = e.hold, w = e.bits, k = e.lencode, x = e.distcode, O = (1 << e.lenbits) - 1, T = (1 << e.distbits) - 1;
2048
+ t:
2049
+ do {
2050
+ w < 15 && (u += r[a++] << w, w += 8, u += r[a++] << w, w += 8), M = k[u & O];
2051
+ e:
2052
+ for (; ; ) {
2053
+ if (u >>>= z = M >>> 24, w -= z, (z = M >>> 16 & 255) === 0)
2054
+ N[c++] = 65535 & M;
2055
+ else {
2056
+ if (!(16 & z)) {
2057
+ if (!(64 & z)) {
2058
+ M = k[(65535 & M) + (u & (1 << z) - 1)];
2059
+ continue e;
2060
+ }
2061
+ if (32 & z) {
2062
+ e.mode = 12;
2063
+ break t;
2064
+ }
2065
+ l.msg = "invalid literal/length code", e.mode = 30;
2066
+ break t;
2067
+ }
2068
+ W = 65535 & M, (z &= 15) && (w < z && (u += r[a++] << w, w += 8), W += u & (1 << z) - 1, u >>>= z, w -= z), w < 15 && (u += r[a++] << w, w += 8, u += r[a++] << w, w += 8), M = x[u & T];
2069
+ r:
2070
+ for (; ; ) {
2071
+ if (u >>>= z = M >>> 24, w -= z, !(16 & (z = M >>> 16 & 255))) {
2072
+ if (!(64 & z)) {
2073
+ M = x[(65535 & M) + (u & (1 << z) - 1)];
2074
+ continue r;
2075
+ }
2076
+ l.msg = "invalid distance code", e.mode = 30;
2077
+ break t;
2078
+ }
2079
+ if (j = 65535 & M, w < (z &= 15) && (u += r[a++] << w, (w += 8) < z && (u += r[a++] << w, w += 8)), s < (j += u & (1 << z) - 1)) {
2080
+ l.msg = "invalid distance too far back", e.mode = 30;
2081
+ break t;
2082
+ }
2083
+ if (u >>>= z, w -= z, (z = c - _) < j) {
2084
+ if (i < (z = j - z) && e.sane) {
2085
+ l.msg = "invalid distance too far back", e.mode = 30;
2086
+ break t;
2087
+ }
2088
+ if (F = h, (b = 0) === f) {
2089
+ if (b += m - z, z < W) {
2090
+ for (W -= z; N[c++] = h[b++], --z; )
2091
+ ;
2092
+ b = c - j, F = N;
2093
+ }
2094
+ } else if (f < z) {
2095
+ if (b += m + f - z, (z -= f) < W) {
2096
+ for (W -= z; N[c++] = h[b++], --z; )
2097
+ ;
2098
+ if (b = 0, f < W) {
2099
+ for (W -= z = f; N[c++] = h[b++], --z; )
2100
+ ;
2101
+ b = c - j, F = N;
2102
+ }
2103
+ }
2104
+ } else if (b += f - z, z < W) {
2105
+ for (W -= z; N[c++] = h[b++], --z; )
2106
+ ;
2107
+ b = c - j, F = N;
2108
+ }
2109
+ for (; 2 < W; )
2110
+ N[c++] = F[b++], N[c++] = F[b++], N[c++] = F[b++], W -= 3;
2111
+ W && (N[c++] = F[b++], 1 < W && (N[c++] = F[b++]));
2112
+ } else {
2113
+ for (b = c - j; N[c++] = N[b++], N[c++] = N[b++], N[c++] = N[b++], 2 < (W -= 3); )
2114
+ ;
2115
+ W && (N[c++] = N[b++], 1 < W && (N[c++] = N[b++]));
2116
+ }
2117
+ break;
2118
+ }
2119
+ }
2120
+ break;
2121
+ }
2122
+ } while (a < d && c < v);
2123
+ a -= W = w >> 3, u &= (1 << (w -= W << 3)) - 1, l.next_in = a, l.next_out = c, l.avail_in = a < d ? d - a + 5 : 5 - (a - d), l.avail_out = c < v ? v - c + 257 : 257 - (c - v), e.hold = u, e.bits = w;
2124
+ };
2125
+ }, {}], 49: [function(n, S, g) {
2126
+ var l = n("../utils/common"), o = n("./adler32"), e = n("./crc32"), a = n("./inffast"), d = n("./inftrees"), c = 1, _ = 2, v = 0, s = -2, m = 1, i = 852, f = 592;
2127
+ function h(b) {
2128
+ return (b >>> 24 & 255) + (b >>> 8 & 65280) + ((65280 & b) << 8) + ((255 & b) << 24);
2129
+ }
2130
+ function u() {
2131
+ this.mode = 0, this.last = !1, this.wrap = 0, this.havedict = !1, this.flags = 0, this.dmax = 0, this.check = 0, this.total = 0, this.head = null, this.wbits = 0, this.wsize = 0, this.whave = 0, this.wnext = 0, this.window = null, this.hold = 0, this.bits = 0, this.length = 0, this.offset = 0, this.extra = 0, this.lencode = null, this.distcode = null, this.lenbits = 0, this.distbits = 0, this.ncode = 0, this.nlen = 0, this.ndist = 0, this.have = 0, this.next = null, this.lens = new l.Buf16(320), this.work = new l.Buf16(288), this.lendyn = null, this.distdyn = null, this.sane = 0, this.back = 0, this.was = 0;
2132
+ }
2133
+ function w(b) {
2134
+ var F;
2135
+ return b && b.state ? (F = b.state, b.total_in = b.total_out = F.total = 0, b.msg = "", F.wrap && (b.adler = 1 & F.wrap), F.mode = m, F.last = 0, F.havedict = 0, F.dmax = 32768, F.head = null, F.hold = 0, F.bits = 0, F.lencode = F.lendyn = new l.Buf32(i), F.distcode = F.distdyn = new l.Buf32(f), F.sane = 1, F.back = -1, v) : s;
2136
+ }
2137
+ function k(b) {
2138
+ var F;
2139
+ return b && b.state ? ((F = b.state).wsize = 0, F.whave = 0, F.wnext = 0, w(b)) : s;
2140
+ }
2141
+ function x(b, F) {
2142
+ var r, N;
2143
+ return b && b.state ? (N = b.state, F < 0 ? (r = 0, F = -F) : (r = 1 + (F >> 4), F < 48 && (F &= 15)), F && (F < 8 || 15 < F) ? s : (N.window !== null && N.wbits !== F && (N.window = null), N.wrap = r, N.wbits = F, k(b))) : s;
2144
+ }
2145
+ function O(b, F) {
2146
+ var r, N;
2147
+ return b ? (N = new u(), (b.state = N).window = null, (r = x(b, F)) !== v && (b.state = null), r) : s;
2148
+ }
2149
+ var T, M, z = !0;
2150
+ function W(b) {
2151
+ if (z) {
2152
+ var F;
2153
+ for (T = new l.Buf32(512), M = new l.Buf32(32), F = 0; F < 144; )
2154
+ b.lens[F++] = 8;
2155
+ for (; F < 256; )
2156
+ b.lens[F++] = 9;
2157
+ for (; F < 280; )
2158
+ b.lens[F++] = 7;
2159
+ for (; F < 288; )
2160
+ b.lens[F++] = 8;
2161
+ for (d(c, b.lens, 0, 288, T, 0, b.work, { bits: 9 }), F = 0; F < 32; )
2162
+ b.lens[F++] = 5;
2163
+ d(_, b.lens, 0, 32, M, 0, b.work, { bits: 5 }), z = !1;
2164
+ }
2165
+ b.lencode = T, b.lenbits = 9, b.distcode = M, b.distbits = 5;
2166
+ }
2167
+ function j(b, F, r, N) {
2168
+ var Q, $ = b.state;
2169
+ return $.window === null && ($.wsize = 1 << $.wbits, $.wnext = 0, $.whave = 0, $.window = new l.Buf8($.wsize)), N >= $.wsize ? (l.arraySet($.window, F, r - $.wsize, $.wsize, 0), $.wnext = 0, $.whave = $.wsize) : (N < (Q = $.wsize - $.wnext) && (Q = N), l.arraySet($.window, F, r - N, Q, $.wnext), (N -= Q) ? (l.arraySet($.window, F, r - N, N, 0), $.wnext = N, $.whave = $.wsize) : ($.wnext += Q, $.wnext === $.wsize && ($.wnext = 0), $.whave < $.wsize && ($.whave += Q))), 0;
2170
+ }
2171
+ g.inflateReset = k, g.inflateReset2 = x, g.inflateResetKeep = w, g.inflateInit = function(b) {
2172
+ return O(b, 15);
2173
+ }, g.inflateInit2 = O, g.inflate = function(b, F) {
2174
+ var r, N, Q, $, Y, L, K, I, B, tt, q, X, st, ct, et, nt, ht, ot, mt, pt, t, D, R, y, p = 0, C = new l.Buf8(4), U = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
2175
+ if (!b || !b.state || !b.output || !b.input && b.avail_in !== 0)
2176
+ return s;
2177
+ (r = b.state).mode === 12 && (r.mode = 13), Y = b.next_out, Q = b.output, K = b.avail_out, $ = b.next_in, N = b.input, L = b.avail_in, I = r.hold, B = r.bits, tt = L, q = K, D = v;
2178
+ t:
2179
+ for (; ; )
2180
+ switch (r.mode) {
2181
+ case m:
2182
+ if (r.wrap === 0) {
2183
+ r.mode = 13;
2184
+ break;
2185
+ }
2186
+ for (; B < 16; ) {
2187
+ if (L === 0)
2188
+ break t;
2189
+ L--, I += N[$++] << B, B += 8;
2190
+ }
2191
+ if (2 & r.wrap && I === 35615) {
2192
+ C[r.check = 0] = 255 & I, C[1] = I >>> 8 & 255, r.check = e(r.check, C, 2, 0), B = I = 0, r.mode = 2;
2193
+ break;
2194
+ }
2195
+ if (r.flags = 0, r.head && (r.head.done = !1), !(1 & r.wrap) || (((255 & I) << 8) + (I >> 8)) % 31) {
2196
+ b.msg = "incorrect header check", r.mode = 30;
2197
+ break;
2198
+ }
2199
+ if ((15 & I) != 8) {
2200
+ b.msg = "unknown compression method", r.mode = 30;
2201
+ break;
2202
+ }
2203
+ if (B -= 4, t = 8 + (15 & (I >>>= 4)), r.wbits === 0)
2204
+ r.wbits = t;
2205
+ else if (t > r.wbits) {
2206
+ b.msg = "invalid window size", r.mode = 30;
2207
+ break;
2208
+ }
2209
+ r.dmax = 1 << t, b.adler = r.check = 1, r.mode = 512 & I ? 10 : 12, B = I = 0;
2210
+ break;
2211
+ case 2:
2212
+ for (; B < 16; ) {
2213
+ if (L === 0)
2214
+ break t;
2215
+ L--, I += N[$++] << B, B += 8;
2216
+ }
2217
+ if (r.flags = I, (255 & r.flags) != 8) {
2218
+ b.msg = "unknown compression method", r.mode = 30;
2219
+ break;
2220
+ }
2221
+ if (57344 & r.flags) {
2222
+ b.msg = "unknown header flags set", r.mode = 30;
2223
+ break;
2224
+ }
2225
+ r.head && (r.head.text = I >> 8 & 1), 512 & r.flags && (C[0] = 255 & I, C[1] = I >>> 8 & 255, r.check = e(r.check, C, 2, 0)), B = I = 0, r.mode = 3;
2226
+ case 3:
2227
+ for (; B < 32; ) {
2228
+ if (L === 0)
2229
+ break t;
2230
+ L--, I += N[$++] << B, B += 8;
2231
+ }
2232
+ r.head && (r.head.time = I), 512 & r.flags && (C[0] = 255 & I, C[1] = I >>> 8 & 255, C[2] = I >>> 16 & 255, C[3] = I >>> 24 & 255, r.check = e(r.check, C, 4, 0)), B = I = 0, r.mode = 4;
2233
+ case 4:
2234
+ for (; B < 16; ) {
2235
+ if (L === 0)
2236
+ break t;
2237
+ L--, I += N[$++] << B, B += 8;
2238
+ }
2239
+ r.head && (r.head.xflags = 255 & I, r.head.os = I >> 8), 512 & r.flags && (C[0] = 255 & I, C[1] = I >>> 8 & 255, r.check = e(r.check, C, 2, 0)), B = I = 0, r.mode = 5;
2240
+ case 5:
2241
+ if (1024 & r.flags) {
2242
+ for (; B < 16; ) {
2243
+ if (L === 0)
2244
+ break t;
2245
+ L--, I += N[$++] << B, B += 8;
2246
+ }
2247
+ r.length = I, r.head && (r.head.extra_len = I), 512 & r.flags && (C[0] = 255 & I, C[1] = I >>> 8 & 255, r.check = e(r.check, C, 2, 0)), B = I = 0;
2248
+ } else
2249
+ r.head && (r.head.extra = null);
2250
+ r.mode = 6;
2251
+ case 6:
2252
+ if (1024 & r.flags && (L < (X = r.length) && (X = L), X && (r.head && (t = r.head.extra_len - r.length, r.head.extra || (r.head.extra = new Array(r.head.extra_len)), l.arraySet(r.head.extra, N, $, X, t)), 512 & r.flags && (r.check = e(r.check, N, X, $)), L -= X, $ += X, r.length -= X), r.length))
2253
+ break t;
2254
+ r.length = 0, r.mode = 7;
2255
+ case 7:
2256
+ if (2048 & r.flags) {
2257
+ if (L === 0)
2258
+ break t;
2259
+ for (X = 0; t = N[$ + X++], r.head && t && r.length < 65536 && (r.head.name += String.fromCharCode(t)), t && X < L; )
2260
+ ;
2261
+ if (512 & r.flags && (r.check = e(r.check, N, X, $)), L -= X, $ += X, t)
2262
+ break t;
2263
+ } else
2264
+ r.head && (r.head.name = null);
2265
+ r.length = 0, r.mode = 8;
2266
+ case 8:
2267
+ if (4096 & r.flags) {
2268
+ if (L === 0)
2269
+ break t;
2270
+ for (X = 0; t = N[$ + X++], r.head && t && r.length < 65536 && (r.head.comment += String.fromCharCode(t)), t && X < L; )
2271
+ ;
2272
+ if (512 & r.flags && (r.check = e(r.check, N, X, $)), L -= X, $ += X, t)
2273
+ break t;
2274
+ } else
2275
+ r.head && (r.head.comment = null);
2276
+ r.mode = 9;
2277
+ case 9:
2278
+ if (512 & r.flags) {
2279
+ for (; B < 16; ) {
2280
+ if (L === 0)
2281
+ break t;
2282
+ L--, I += N[$++] << B, B += 8;
2283
+ }
2284
+ if (I !== (65535 & r.check)) {
2285
+ b.msg = "header crc mismatch", r.mode = 30;
2286
+ break;
2287
+ }
2288
+ B = I = 0;
2289
+ }
2290
+ r.head && (r.head.hcrc = r.flags >> 9 & 1, r.head.done = !0), b.adler = r.check = 0, r.mode = 12;
2291
+ break;
2292
+ case 10:
2293
+ for (; B < 32; ) {
2294
+ if (L === 0)
2295
+ break t;
2296
+ L--, I += N[$++] << B, B += 8;
2297
+ }
2298
+ b.adler = r.check = h(I), B = I = 0, r.mode = 11;
2299
+ case 11:
2300
+ if (r.havedict === 0)
2301
+ return b.next_out = Y, b.avail_out = K, b.next_in = $, b.avail_in = L, r.hold = I, r.bits = B, 2;
2302
+ b.adler = r.check = 1, r.mode = 12;
2303
+ case 12:
2304
+ if (F === 5 || F === 6)
2305
+ break t;
2306
+ case 13:
2307
+ if (r.last) {
2308
+ I >>>= 7 & B, B -= 7 & B, r.mode = 27;
2309
+ break;
2310
+ }
2311
+ for (; B < 3; ) {
2312
+ if (L === 0)
2313
+ break t;
2314
+ L--, I += N[$++] << B, B += 8;
2315
+ }
2316
+ switch (r.last = 1 & I, B -= 1, 3 & (I >>>= 1)) {
2317
+ case 0:
2318
+ r.mode = 14;
2319
+ break;
2320
+ case 1:
2321
+ if (W(r), r.mode = 20, F !== 6)
2322
+ break;
2323
+ I >>>= 2, B -= 2;
2324
+ break t;
2325
+ case 2:
2326
+ r.mode = 17;
2327
+ break;
2328
+ case 3:
2329
+ b.msg = "invalid block type", r.mode = 30;
2330
+ }
2331
+ I >>>= 2, B -= 2;
2332
+ break;
2333
+ case 14:
2334
+ for (I >>>= 7 & B, B -= 7 & B; B < 32; ) {
2335
+ if (L === 0)
2336
+ break t;
2337
+ L--, I += N[$++] << B, B += 8;
2338
+ }
2339
+ if ((65535 & I) != (I >>> 16 ^ 65535)) {
2340
+ b.msg = "invalid stored block lengths", r.mode = 30;
2341
+ break;
2342
+ }
2343
+ if (r.length = 65535 & I, B = I = 0, r.mode = 15, F === 6)
2344
+ break t;
2345
+ case 15:
2346
+ r.mode = 16;
2347
+ case 16:
2348
+ if (X = r.length) {
2349
+ if (L < X && (X = L), K < X && (X = K), X === 0)
2350
+ break t;
2351
+ l.arraySet(Q, N, $, X, Y), L -= X, $ += X, K -= X, Y += X, r.length -= X;
2352
+ break;
2353
+ }
2354
+ r.mode = 12;
2355
+ break;
2356
+ case 17:
2357
+ for (; B < 14; ) {
2358
+ if (L === 0)
2359
+ break t;
2360
+ L--, I += N[$++] << B, B += 8;
2361
+ }
2362
+ if (r.nlen = 257 + (31 & I), I >>>= 5, B -= 5, r.ndist = 1 + (31 & I), I >>>= 5, B -= 5, r.ncode = 4 + (15 & I), I >>>= 4, B -= 4, 286 < r.nlen || 30 < r.ndist) {
2363
+ b.msg = "too many length or distance symbols", r.mode = 30;
2364
+ break;
2365
+ }
2366
+ r.have = 0, r.mode = 18;
2367
+ case 18:
2368
+ for (; r.have < r.ncode; ) {
2369
+ for (; B < 3; ) {
2370
+ if (L === 0)
2371
+ break t;
2372
+ L--, I += N[$++] << B, B += 8;
2373
+ }
2374
+ r.lens[U[r.have++]] = 7 & I, I >>>= 3, B -= 3;
2375
+ }
2376
+ for (; r.have < 19; )
2377
+ r.lens[U[r.have++]] = 0;
2378
+ if (r.lencode = r.lendyn, r.lenbits = 7, R = { bits: r.lenbits }, D = d(0, r.lens, 0, 19, r.lencode, 0, r.work, R), r.lenbits = R.bits, D) {
2379
+ b.msg = "invalid code lengths set", r.mode = 30;
2380
+ break;
2381
+ }
2382
+ r.have = 0, r.mode = 19;
2383
+ case 19:
2384
+ for (; r.have < r.nlen + r.ndist; ) {
2385
+ for (; nt = (p = r.lencode[I & (1 << r.lenbits) - 1]) >>> 16 & 255, ht = 65535 & p, !((et = p >>> 24) <= B); ) {
2386
+ if (L === 0)
2387
+ break t;
2388
+ L--, I += N[$++] << B, B += 8;
2389
+ }
2390
+ if (ht < 16)
2391
+ I >>>= et, B -= et, r.lens[r.have++] = ht;
2392
+ else {
2393
+ if (ht === 16) {
2394
+ for (y = et + 2; B < y; ) {
2395
+ if (L === 0)
2396
+ break t;
2397
+ L--, I += N[$++] << B, B += 8;
2398
+ }
2399
+ if (I >>>= et, B -= et, r.have === 0) {
2400
+ b.msg = "invalid bit length repeat", r.mode = 30;
2401
+ break;
2402
+ }
2403
+ t = r.lens[r.have - 1], X = 3 + (3 & I), I >>>= 2, B -= 2;
2404
+ } else if (ht === 17) {
2405
+ for (y = et + 3; B < y; ) {
2406
+ if (L === 0)
2407
+ break t;
2408
+ L--, I += N[$++] << B, B += 8;
2409
+ }
2410
+ B -= et, t = 0, X = 3 + (7 & (I >>>= et)), I >>>= 3, B -= 3;
2411
+ } else {
2412
+ for (y = et + 7; B < y; ) {
2413
+ if (L === 0)
2414
+ break t;
2415
+ L--, I += N[$++] << B, B += 8;
2416
+ }
2417
+ B -= et, t = 0, X = 11 + (127 & (I >>>= et)), I >>>= 7, B -= 7;
2418
+ }
2419
+ if (r.have + X > r.nlen + r.ndist) {
2420
+ b.msg = "invalid bit length repeat", r.mode = 30;
2421
+ break;
2422
+ }
2423
+ for (; X--; )
2424
+ r.lens[r.have++] = t;
2425
+ }
2426
+ }
2427
+ if (r.mode === 30)
2428
+ break;
2429
+ if (r.lens[256] === 0) {
2430
+ b.msg = "invalid code -- missing end-of-block", r.mode = 30;
2431
+ break;
2432
+ }
2433
+ if (r.lenbits = 9, R = { bits: r.lenbits }, D = d(c, r.lens, 0, r.nlen, r.lencode, 0, r.work, R), r.lenbits = R.bits, D) {
2434
+ b.msg = "invalid literal/lengths set", r.mode = 30;
2435
+ break;
2436
+ }
2437
+ if (r.distbits = 6, r.distcode = r.distdyn, R = { bits: r.distbits }, D = d(_, r.lens, r.nlen, r.ndist, r.distcode, 0, r.work, R), r.distbits = R.bits, D) {
2438
+ b.msg = "invalid distances set", r.mode = 30;
2439
+ break;
2440
+ }
2441
+ if (r.mode = 20, F === 6)
2442
+ break t;
2443
+ case 20:
2444
+ r.mode = 21;
2445
+ case 21:
2446
+ if (6 <= L && 258 <= K) {
2447
+ b.next_out = Y, b.avail_out = K, b.next_in = $, b.avail_in = L, r.hold = I, r.bits = B, a(b, q), Y = b.next_out, Q = b.output, K = b.avail_out, $ = b.next_in, N = b.input, L = b.avail_in, I = r.hold, B = r.bits, r.mode === 12 && (r.back = -1);
2448
+ break;
2449
+ }
2450
+ for (r.back = 0; nt = (p = r.lencode[I & (1 << r.lenbits) - 1]) >>> 16 & 255, ht = 65535 & p, !((et = p >>> 24) <= B); ) {
2451
+ if (L === 0)
2452
+ break t;
2453
+ L--, I += N[$++] << B, B += 8;
2454
+ }
2455
+ if (nt && !(240 & nt)) {
2456
+ for (ot = et, mt = nt, pt = ht; nt = (p = r.lencode[pt + ((I & (1 << ot + mt) - 1) >> ot)]) >>> 16 & 255, ht = 65535 & p, !(ot + (et = p >>> 24) <= B); ) {
2457
+ if (L === 0)
2458
+ break t;
2459
+ L--, I += N[$++] << B, B += 8;
2460
+ }
2461
+ I >>>= ot, B -= ot, r.back += ot;
2462
+ }
2463
+ if (I >>>= et, B -= et, r.back += et, r.length = ht, nt === 0) {
2464
+ r.mode = 26;
2465
+ break;
2466
+ }
2467
+ if (32 & nt) {
2468
+ r.back = -1, r.mode = 12;
2469
+ break;
2470
+ }
2471
+ if (64 & nt) {
2472
+ b.msg = "invalid literal/length code", r.mode = 30;
2473
+ break;
2474
+ }
2475
+ r.extra = 15 & nt, r.mode = 22;
2476
+ case 22:
2477
+ if (r.extra) {
2478
+ for (y = r.extra; B < y; ) {
2479
+ if (L === 0)
2480
+ break t;
2481
+ L--, I += N[$++] << B, B += 8;
2482
+ }
2483
+ r.length += I & (1 << r.extra) - 1, I >>>= r.extra, B -= r.extra, r.back += r.extra;
2484
+ }
2485
+ r.was = r.length, r.mode = 23;
2486
+ case 23:
2487
+ for (; nt = (p = r.distcode[I & (1 << r.distbits) - 1]) >>> 16 & 255, ht = 65535 & p, !((et = p >>> 24) <= B); ) {
2488
+ if (L === 0)
2489
+ break t;
2490
+ L--, I += N[$++] << B, B += 8;
2491
+ }
2492
+ if (!(240 & nt)) {
2493
+ for (ot = et, mt = nt, pt = ht; nt = (p = r.distcode[pt + ((I & (1 << ot + mt) - 1) >> ot)]) >>> 16 & 255, ht = 65535 & p, !(ot + (et = p >>> 24) <= B); ) {
2494
+ if (L === 0)
2495
+ break t;
2496
+ L--, I += N[$++] << B, B += 8;
2497
+ }
2498
+ I >>>= ot, B -= ot, r.back += ot;
2499
+ }
2500
+ if (I >>>= et, B -= et, r.back += et, 64 & nt) {
2501
+ b.msg = "invalid distance code", r.mode = 30;
2502
+ break;
2503
+ }
2504
+ r.offset = ht, r.extra = 15 & nt, r.mode = 24;
2505
+ case 24:
2506
+ if (r.extra) {
2507
+ for (y = r.extra; B < y; ) {
2508
+ if (L === 0)
2509
+ break t;
2510
+ L--, I += N[$++] << B, B += 8;
2511
+ }
2512
+ r.offset += I & (1 << r.extra) - 1, I >>>= r.extra, B -= r.extra, r.back += r.extra;
2513
+ }
2514
+ if (r.offset > r.dmax) {
2515
+ b.msg = "invalid distance too far back", r.mode = 30;
2516
+ break;
2517
+ }
2518
+ r.mode = 25;
2519
+ case 25:
2520
+ if (K === 0)
2521
+ break t;
2522
+ if (X = q - K, r.offset > X) {
2523
+ if ((X = r.offset - X) > r.whave && r.sane) {
2524
+ b.msg = "invalid distance too far back", r.mode = 30;
2525
+ break;
2526
+ }
2527
+ st = X > r.wnext ? (X -= r.wnext, r.wsize - X) : r.wnext - X, X > r.length && (X = r.length), ct = r.window;
2528
+ } else
2529
+ ct = Q, st = Y - r.offset, X = r.length;
2530
+ for (K < X && (X = K), K -= X, r.length -= X; Q[Y++] = ct[st++], --X; )
2531
+ ;
2532
+ r.length === 0 && (r.mode = 21);
2533
+ break;
2534
+ case 26:
2535
+ if (K === 0)
2536
+ break t;
2537
+ Q[Y++] = r.length, K--, r.mode = 21;
2538
+ break;
2539
+ case 27:
2540
+ if (r.wrap) {
2541
+ for (; B < 32; ) {
2542
+ if (L === 0)
2543
+ break t;
2544
+ L--, I |= N[$++] << B, B += 8;
2545
+ }
2546
+ if (q -= K, b.total_out += q, r.total += q, q && (b.adler = r.check = r.flags ? e(r.check, Q, q, Y - q) : o(r.check, Q, q, Y - q)), q = K, (r.flags ? I : h(I)) !== r.check) {
2547
+ b.msg = "incorrect data check", r.mode = 30;
2548
+ break;
2549
+ }
2550
+ B = I = 0;
2551
+ }
2552
+ r.mode = 28;
2553
+ case 28:
2554
+ if (r.wrap && r.flags) {
2555
+ for (; B < 32; ) {
2556
+ if (L === 0)
2557
+ break t;
2558
+ L--, I += N[$++] << B, B += 8;
2559
+ }
2560
+ if (I !== (4294967295 & r.total)) {
2561
+ b.msg = "incorrect length check", r.mode = 30;
2562
+ break;
2563
+ }
2564
+ B = I = 0;
2565
+ }
2566
+ r.mode = 29;
2567
+ case 29:
2568
+ D = 1;
2569
+ break t;
2570
+ case 30:
2571
+ D = -3;
2572
+ break t;
2573
+ case 31:
2574
+ return -4;
2575
+ case 32:
2576
+ default:
2577
+ return s;
2578
+ }
2579
+ return b.next_out = Y, b.avail_out = K, b.next_in = $, b.avail_in = L, r.hold = I, r.bits = B, (r.wsize || q !== b.avail_out && r.mode < 30 && (r.mode < 27 || F !== 4)) && j(b, b.output, b.next_out, q - b.avail_out) ? (r.mode = 31, -4) : (tt -= b.avail_in, q -= b.avail_out, b.total_in += tt, b.total_out += q, r.total += q, r.wrap && q && (b.adler = r.check = r.flags ? e(r.check, Q, q, b.next_out - q) : o(r.check, Q, q, b.next_out - q)), b.data_type = r.bits + (r.last ? 64 : 0) + (r.mode === 12 ? 128 : 0) + (r.mode === 20 || r.mode === 15 ? 256 : 0), (tt == 0 && q === 0 || F === 4) && D === v && (D = -5), D);
2580
+ }, g.inflateEnd = function(b) {
2581
+ if (!b || !b.state)
2582
+ return s;
2583
+ var F = b.state;
2584
+ return F.window && (F.window = null), b.state = null, v;
2585
+ }, g.inflateGetHeader = function(b, F) {
2586
+ var r;
2587
+ return b && b.state && 2 & (r = b.state).wrap ? ((r.head = F).done = !1, v) : s;
2588
+ }, g.inflateSetDictionary = function(b, F) {
2589
+ var r, N = F.length;
2590
+ return b && b.state ? (r = b.state).wrap !== 0 && r.mode !== 11 ? s : r.mode === 11 && o(1, F, N, 0) !== r.check ? -3 : j(b, F, N, N) ? (r.mode = 31, -4) : (r.havedict = 1, v) : s;
2591
+ }, g.inflateInfo = "pako inflate (from Nodeca project)";
2592
+ }, { "../utils/common": 41, "./adler32": 43, "./crc32": 45, "./inffast": 48, "./inftrees": 50 }], 50: [function(n, S, g) {
2593
+ var l = n("../utils/common"), o = [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], e = [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], a = [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], d = [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];
2594
+ S.exports = function(c, _, v, s, m, i, f, h) {
2595
+ var u, w, k, x, O, T, M, z, W, j = h.bits, b = 0, F = 0, r = 0, N = 0, Q = 0, $ = 0, Y = 0, L = 0, K = 0, I = 0, B = null, tt = 0, q = new l.Buf16(16), X = new l.Buf16(16), st = null, ct = 0;
2596
+ for (b = 0; b <= 15; b++)
2597
+ q[b] = 0;
2598
+ for (F = 0; F < s; F++)
2599
+ q[_[v + F]]++;
2600
+ for (Q = j, N = 15; 1 <= N && q[N] === 0; N--)
2601
+ ;
2602
+ if (N < Q && (Q = N), N === 0)
2603
+ return m[i++] = 20971520, m[i++] = 20971520, h.bits = 1, 0;
2604
+ for (r = 1; r < N && q[r] === 0; r++)
2605
+ ;
2606
+ for (Q < r && (Q = r), b = L = 1; b <= 15; b++)
2607
+ if (L <<= 1, (L -= q[b]) < 0)
2608
+ return -1;
2609
+ if (0 < L && (c === 0 || N !== 1))
2610
+ return -1;
2611
+ for (X[1] = 0, b = 1; b < 15; b++)
2612
+ X[b + 1] = X[b] + q[b];
2613
+ for (F = 0; F < s; F++)
2614
+ _[v + F] !== 0 && (f[X[_[v + F]]++] = F);
2615
+ if (T = c === 0 ? (B = st = f, 19) : c === 1 ? (B = o, tt -= 257, st = e, ct -= 257, 256) : (B = a, st = d, -1), b = r, O = i, Y = F = I = 0, k = -1, x = (K = 1 << ($ = Q)) - 1, c === 1 && 852 < K || c === 2 && 592 < K)
2616
+ return 1;
2617
+ for (; ; ) {
2618
+ for (M = b - Y, W = f[F] < T ? (z = 0, f[F]) : f[F] > T ? (z = st[ct + f[F]], B[tt + f[F]]) : (z = 96, 0), u = 1 << b - Y, r = w = 1 << $; m[O + (I >> Y) + (w -= u)] = M << 24 | z << 16 | W | 0, w !== 0; )
2619
+ ;
2620
+ for (u = 1 << b - 1; I & u; )
2621
+ u >>= 1;
2622
+ if (u !== 0 ? (I &= u - 1, I += u) : I = 0, F++, --q[b] == 0) {
2623
+ if (b === N)
2624
+ break;
2625
+ b = _[v + f[F]];
2626
+ }
2627
+ if (Q < b && (I & x) !== k) {
2628
+ for (Y === 0 && (Y = Q), O += r, L = 1 << ($ = b - Y); $ + Y < N && !((L -= q[$ + Y]) <= 0); )
2629
+ $++, L <<= 1;
2630
+ if (K += 1 << $, c === 1 && 852 < K || c === 2 && 592 < K)
2631
+ return 1;
2632
+ m[k = I & x] = Q << 24 | $ << 16 | O - i | 0;
2633
+ }
2634
+ }
2635
+ return I !== 0 && (m[O + I] = b - Y << 24 | 64 << 16 | 0), h.bits = Q, 0;
2636
+ };
2637
+ }, { "../utils/common": 41 }], 51: [function(n, S, g) {
2638
+ S.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" };
2639
+ }, {}], 52: [function(n, S, g) {
2640
+ var l = n("../utils/common"), o = 0, e = 1;
2641
+ function a(p) {
2642
+ for (var C = p.length; 0 <= --C; )
2643
+ p[C] = 0;
2644
+ }
2645
+ var d = 0, c = 29, _ = 256, v = _ + 1 + c, s = 30, m = 19, i = 2 * v + 1, f = 15, h = 16, u = 7, w = 256, k = 16, x = 17, O = 18, T = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], M = [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], W = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], j = new Array(2 * (v + 2));
2646
+ a(j);
2647
+ var b = new Array(2 * s);
2648
+ a(b);
2649
+ var F = new Array(512);
2650
+ a(F);
2651
+ var r = new Array(256);
2652
+ a(r);
2653
+ var N = new Array(c);
2654
+ a(N);
2655
+ var Q, $, Y, L = new Array(s);
2656
+ function K(p, C, U, Z, A) {
2657
+ this.static_tree = p, this.extra_bits = C, this.extra_base = U, this.elems = Z, this.max_length = A, this.has_stree = p && p.length;
2658
+ }
2659
+ function I(p, C) {
2660
+ this.dyn_tree = p, this.max_code = 0, this.stat_desc = C;
2661
+ }
2662
+ function B(p) {
2663
+ return p < 256 ? F[p] : F[256 + (p >>> 7)];
2664
+ }
2665
+ function tt(p, C) {
2666
+ p.pending_buf[p.pending++] = 255 & C, p.pending_buf[p.pending++] = C >>> 8 & 255;
2667
+ }
2668
+ function q(p, C, U) {
2669
+ p.bi_valid > h - U ? (p.bi_buf |= C << p.bi_valid & 65535, tt(p, p.bi_buf), p.bi_buf = C >> h - p.bi_valid, p.bi_valid += U - h) : (p.bi_buf |= C << p.bi_valid & 65535, p.bi_valid += U);
2670
+ }
2671
+ function X(p, C, U) {
2672
+ q(p, U[2 * C], U[2 * C + 1]);
2673
+ }
2674
+ function st(p, C) {
2675
+ for (var U = 0; U |= 1 & p, p >>>= 1, U <<= 1, 0 < --C; )
2676
+ ;
2677
+ return U >>> 1;
2678
+ }
2679
+ function ct(p, C, U) {
2680
+ var Z, A, H = new Array(f + 1), J = 0;
2681
+ for (Z = 1; Z <= f; Z++)
2682
+ H[Z] = J = J + U[Z - 1] << 1;
2683
+ for (A = 0; A <= C; A++) {
2684
+ var G = p[2 * A + 1];
2685
+ G !== 0 && (p[2 * A] = st(H[G]++, G));
2686
+ }
2687
+ }
2688
+ function et(p) {
2689
+ var C;
2690
+ for (C = 0; C < v; C++)
2691
+ p.dyn_ltree[2 * C] = 0;
2692
+ for (C = 0; C < s; C++)
2693
+ p.dyn_dtree[2 * C] = 0;
2694
+ for (C = 0; C < m; C++)
2695
+ p.bl_tree[2 * C] = 0;
2696
+ p.dyn_ltree[2 * w] = 1, p.opt_len = p.static_len = 0, p.last_lit = p.matches = 0;
2697
+ }
2698
+ function nt(p) {
2699
+ 8 < p.bi_valid ? tt(p, p.bi_buf) : 0 < p.bi_valid && (p.pending_buf[p.pending++] = p.bi_buf), p.bi_buf = 0, p.bi_valid = 0;
2700
+ }
2701
+ function ht(p, C, U, Z) {
2702
+ var A = 2 * C, H = 2 * U;
2703
+ return p[A] < p[H] || p[A] === p[H] && Z[C] <= Z[U];
2704
+ }
2705
+ function ot(p, C, U) {
2706
+ for (var Z = p.heap[U], A = U << 1; A <= p.heap_len && (A < p.heap_len && ht(C, p.heap[A + 1], p.heap[A], p.depth) && A++, !ht(C, Z, p.heap[A], p.depth)); )
2707
+ p.heap[U] = p.heap[A], U = A, A <<= 1;
2708
+ p.heap[U] = Z;
2709
+ }
2710
+ function mt(p, C, U) {
2711
+ var Z, A, H, J, G = 0;
2712
+ if (p.last_lit !== 0)
2713
+ for (; Z = p.pending_buf[p.d_buf + 2 * G] << 8 | p.pending_buf[p.d_buf + 2 * G + 1], A = p.pending_buf[p.l_buf + G], G++, Z === 0 ? X(p, A, C) : (X(p, (H = r[A]) + _ + 1, C), (J = T[H]) !== 0 && q(p, A -= N[H], J), X(p, H = B(--Z), U), (J = M[H]) !== 0 && q(p, Z -= L[H], J)), G < p.last_lit; )
2714
+ ;
2715
+ X(p, w, C);
2716
+ }
2717
+ function pt(p, C) {
2718
+ var U, Z, A, H = C.dyn_tree, J = C.stat_desc.static_tree, G = C.stat_desc.has_stree, V = C.stat_desc.elems, it = -1;
2719
+ for (p.heap_len = 0, p.heap_max = i, U = 0; U < V; U++)
2720
+ H[2 * U] !== 0 ? (p.heap[++p.heap_len] = it = U, p.depth[U] = 0) : H[2 * U + 1] = 0;
2721
+ for (; p.heap_len < 2; )
2722
+ H[2 * (A = p.heap[++p.heap_len] = it < 2 ? ++it : 0)] = 1, p.depth[A] = 0, p.opt_len--, G && (p.static_len -= J[2 * A + 1]);
2723
+ for (C.max_code = it, U = p.heap_len >> 1; 1 <= U; U--)
2724
+ ot(p, H, U);
2725
+ for (A = V; U = p.heap[1], p.heap[1] = p.heap[p.heap_len--], ot(p, H, 1), Z = p.heap[1], p.heap[--p.heap_max] = U, p.heap[--p.heap_max] = Z, H[2 * A] = H[2 * U] + H[2 * Z], p.depth[A] = (p.depth[U] >= p.depth[Z] ? p.depth[U] : p.depth[Z]) + 1, H[2 * U + 1] = H[2 * Z + 1] = A, p.heap[1] = A++, ot(p, H, 1), 2 <= p.heap_len; )
2726
+ ;
2727
+ p.heap[--p.heap_max] = p.heap[1], function(rt, dt) {
2728
+ var bt, gt, wt, lt, Et, Ot, _t = dt.dyn_tree, jt = dt.max_code, re = dt.stat_desc.static_tree, ne = dt.stat_desc.has_stree, ie = dt.stat_desc.extra_bits, Wt = dt.stat_desc.extra_base, yt = dt.stat_desc.max_length, Ct = 0;
2729
+ for (lt = 0; lt <= f; lt++)
2730
+ rt.bl_count[lt] = 0;
2731
+ for (_t[2 * rt.heap[rt.heap_max] + 1] = 0, bt = rt.heap_max + 1; bt < i; bt++)
2732
+ yt < (lt = _t[2 * _t[2 * (gt = rt.heap[bt]) + 1] + 1] + 1) && (lt = yt, Ct++), _t[2 * gt + 1] = lt, jt < gt || (rt.bl_count[lt]++, Et = 0, Wt <= gt && (Et = ie[gt - Wt]), Ot = _t[2 * gt], rt.opt_len += Ot * (lt + Et), ne && (rt.static_len += Ot * (re[2 * gt + 1] + Et)));
2733
+ if (Ct !== 0) {
2734
+ do {
2735
+ for (lt = yt - 1; rt.bl_count[lt] === 0; )
2736
+ lt--;
2737
+ rt.bl_count[lt]--, rt.bl_count[lt + 1] += 2, rt.bl_count[yt]--, Ct -= 2;
2738
+ } while (0 < Ct);
2739
+ for (lt = yt; lt !== 0; lt--)
2740
+ for (gt = rt.bl_count[lt]; gt !== 0; )
2741
+ jt < (wt = rt.heap[--bt]) || (_t[2 * wt + 1] !== lt && (rt.opt_len += (lt - _t[2 * wt + 1]) * _t[2 * wt], _t[2 * wt + 1] = lt), gt--);
2742
+ }
2743
+ }(p, C), ct(H, it, p.bl_count);
2744
+ }
2745
+ function t(p, C, U) {
2746
+ var Z, A, H = -1, J = C[1], G = 0, V = 7, it = 4;
2747
+ for (J === 0 && (V = 138, it = 3), C[2 * (U + 1) + 1] = 65535, Z = 0; Z <= U; Z++)
2748
+ A = J, J = C[2 * (Z + 1) + 1], ++G < V && A === J || (G < it ? p.bl_tree[2 * A] += G : A !== 0 ? (A !== H && p.bl_tree[2 * A]++, p.bl_tree[2 * k]++) : G <= 10 ? p.bl_tree[2 * x]++ : p.bl_tree[2 * O]++, H = A, it = (G = 0) === J ? (V = 138, 3) : A === J ? (V = 6, 3) : (V = 7, 4));
2749
+ }
2750
+ function D(p, C, U) {
2751
+ var Z, A, H = -1, J = C[1], G = 0, V = 7, it = 4;
2752
+ for (J === 0 && (V = 138, it = 3), Z = 0; Z <= U; Z++)
2753
+ if (A = J, J = C[2 * (Z + 1) + 1], !(++G < V && A === J)) {
2754
+ if (G < it)
2755
+ for (; X(p, A, p.bl_tree), --G != 0; )
2756
+ ;
2757
+ else
2758
+ A !== 0 ? (A !== H && (X(p, A, p.bl_tree), G--), X(p, k, p.bl_tree), q(p, G - 3, 2)) : G <= 10 ? (X(p, x, p.bl_tree), q(p, G - 3, 3)) : (X(p, O, p.bl_tree), q(p, G - 11, 7));
2759
+ H = A, it = (G = 0) === J ? (V = 138, 3) : A === J ? (V = 6, 3) : (V = 7, 4);
2760
+ }
2761
+ }
2762
+ a(L);
2763
+ var R = !1;
2764
+ function y(p, C, U, Z) {
2765
+ q(p, (d << 1) + (Z ? 1 : 0), 3), function(A, H, J, G) {
2766
+ nt(A), G && (tt(A, J), tt(A, ~J)), l.arraySet(A.pending_buf, A.window, H, J, A.pending), A.pending += J;
2767
+ }(p, C, U, !0);
2768
+ }
2769
+ g._tr_init = function(p) {
2770
+ R || (function() {
2771
+ var C, U, Z, A, H, J = new Array(f + 1);
2772
+ for (A = Z = 0; A < c - 1; A++)
2773
+ for (N[A] = Z, C = 0; C < 1 << T[A]; C++)
2774
+ r[Z++] = A;
2775
+ for (r[Z - 1] = A, A = H = 0; A < 16; A++)
2776
+ for (L[A] = H, C = 0; C < 1 << M[A]; C++)
2777
+ F[H++] = A;
2778
+ for (H >>= 7; A < s; A++)
2779
+ for (L[A] = H << 7, C = 0; C < 1 << M[A] - 7; C++)
2780
+ F[256 + H++] = A;
2781
+ for (U = 0; U <= f; U++)
2782
+ J[U] = 0;
2783
+ for (C = 0; C <= 143; )
2784
+ j[2 * C + 1] = 8, C++, J[8]++;
2785
+ for (; C <= 255; )
2786
+ j[2 * C + 1] = 9, C++, J[9]++;
2787
+ for (; C <= 279; )
2788
+ j[2 * C + 1] = 7, C++, J[7]++;
2789
+ for (; C <= 287; )
2790
+ j[2 * C + 1] = 8, C++, J[8]++;
2791
+ for (ct(j, v + 1, J), C = 0; C < s; C++)
2792
+ b[2 * C + 1] = 5, b[2 * C] = st(C, 5);
2793
+ Q = new K(j, T, _ + 1, v, f), $ = new K(b, M, 0, s, f), Y = new K(new Array(0), z, 0, m, u);
2794
+ }(), R = !0), p.l_desc = new I(p.dyn_ltree, Q), p.d_desc = new I(p.dyn_dtree, $), p.bl_desc = new I(p.bl_tree, Y), p.bi_buf = 0, p.bi_valid = 0, et(p);
2795
+ }, g._tr_stored_block = y, g._tr_flush_block = function(p, C, U, Z) {
2796
+ var A, H, J = 0;
2797
+ 0 < p.level ? (p.strm.data_type === 2 && (p.strm.data_type = function(G) {
2798
+ var V, it = 4093624447;
2799
+ for (V = 0; V <= 31; V++, it >>>= 1)
2800
+ if (1 & it && G.dyn_ltree[2 * V] !== 0)
2801
+ return o;
2802
+ if (G.dyn_ltree[18] !== 0 || G.dyn_ltree[20] !== 0 || G.dyn_ltree[26] !== 0)
2803
+ return e;
2804
+ for (V = 32; V < _; V++)
2805
+ if (G.dyn_ltree[2 * V] !== 0)
2806
+ return e;
2807
+ return o;
2808
+ }(p)), pt(p, p.l_desc), pt(p, p.d_desc), J = function(G) {
2809
+ var V;
2810
+ for (t(G, G.dyn_ltree, G.l_desc.max_code), t(G, G.dyn_dtree, G.d_desc.max_code), pt(G, G.bl_desc), V = m - 1; 3 <= V && G.bl_tree[2 * W[V] + 1] === 0; V--)
2811
+ ;
2812
+ return G.opt_len += 3 * (V + 1) + 5 + 5 + 4, V;
2813
+ }(p), A = p.opt_len + 3 + 7 >>> 3, (H = p.static_len + 3 + 7 >>> 3) <= A && (A = H)) : A = H = U + 5, U + 4 <= A && C !== -1 ? y(p, C, U, Z) : p.strategy === 4 || H === A ? (q(p, 2 + (Z ? 1 : 0), 3), mt(p, j, b)) : (q(p, 4 + (Z ? 1 : 0), 3), function(G, V, it, rt) {
2814
+ var dt;
2815
+ for (q(G, V - 257, 5), q(G, it - 1, 5), q(G, rt - 4, 4), dt = 0; dt < rt; dt++)
2816
+ q(G, G.bl_tree[2 * W[dt] + 1], 3);
2817
+ D(G, G.dyn_ltree, V - 1), D(G, G.dyn_dtree, it - 1);
2818
+ }(p, p.l_desc.max_code + 1, p.d_desc.max_code + 1, J + 1), mt(p, p.dyn_ltree, p.dyn_dtree)), et(p), Z && nt(p);
2819
+ }, g._tr_tally = function(p, C, U) {
2820
+ return p.pending_buf[p.d_buf + 2 * p.last_lit] = C >>> 8 & 255, p.pending_buf[p.d_buf + 2 * p.last_lit + 1] = 255 & C, p.pending_buf[p.l_buf + p.last_lit] = 255 & U, p.last_lit++, C === 0 ? p.dyn_ltree[2 * U]++ : (p.matches++, C--, p.dyn_ltree[2 * (r[U] + _ + 1)]++, p.dyn_dtree[2 * B(C)]++), p.last_lit === p.lit_bufsize - 1;
2821
+ }, g._tr_align = function(p) {
2822
+ q(p, 2, 3), X(p, w, j), function(C) {
2823
+ C.bi_valid === 16 ? (tt(C, C.bi_buf), C.bi_buf = 0, C.bi_valid = 0) : 8 <= C.bi_valid && (C.pending_buf[C.pending++] = 255 & C.bi_buf, C.bi_buf >>= 8, C.bi_valid -= 8);
2824
+ }(p);
2825
+ };
2826
+ }, { "../utils/common": 41 }], 53: [function(n, S, g) {
2827
+ S.exports = function() {
2828
+ 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;
2829
+ };
2830
+ }, {}], 54: [function(n, S, g) {
2831
+ (function(l) {
2832
+ (function(o, e) {
2833
+ if (!o.setImmediate) {
2834
+ var a, d, c, _, v = 1, s = {}, m = !1, i = o.document, f = Object.getPrototypeOf && Object.getPrototypeOf(o);
2835
+ f = f && f.setTimeout ? f : o, a = {}.toString.call(o.process) === "[object process]" ? function(k) {
2836
+ process.nextTick(function() {
2837
+ u(k);
2838
+ });
2839
+ } : function() {
2840
+ if (o.postMessage && !o.importScripts) {
2841
+ var k = !0, x = o.onmessage;
2842
+ return o.onmessage = function() {
2843
+ k = !1;
2844
+ }, o.postMessage("", "*"), o.onmessage = x, k;
2845
+ }
2846
+ }() ? (_ = "setImmediate$" + Math.random() + "$", o.addEventListener ? o.addEventListener("message", w, !1) : o.attachEvent("onmessage", w), function(k) {
2847
+ o.postMessage(_ + k, "*");
2848
+ }) : o.MessageChannel ? ((c = new MessageChannel()).port1.onmessage = function(k) {
2849
+ u(k.data);
2850
+ }, function(k) {
2851
+ c.port2.postMessage(k);
2852
+ }) : i && "onreadystatechange" in i.createElement("script") ? (d = i.documentElement, function(k) {
2853
+ var x = i.createElement("script");
2854
+ x.onreadystatechange = function() {
2855
+ u(k), x.onreadystatechange = null, d.removeChild(x), x = null;
2856
+ }, d.appendChild(x);
2857
+ }) : function(k) {
2858
+ setTimeout(u, 0, k);
2859
+ }, f.setImmediate = function(k) {
2860
+ typeof k != "function" && (k = new Function("" + k));
2861
+ for (var x = new Array(arguments.length - 1), O = 0; O < x.length; O++)
2862
+ x[O] = arguments[O + 1];
2863
+ var T = { callback: k, args: x };
2864
+ return s[v] = T, a(v), v++;
2865
+ }, f.clearImmediate = h;
2866
+ }
2867
+ function h(k) {
2868
+ delete s[k];
2869
+ }
2870
+ function u(k) {
2871
+ if (m)
2872
+ setTimeout(u, 0, k);
2873
+ else {
2874
+ var x = s[k];
2875
+ if (x) {
2876
+ m = !0;
2877
+ try {
2878
+ (function(O) {
2879
+ var T = O.callback, M = O.args;
2880
+ switch (M.length) {
2881
+ case 0:
2882
+ T();
2883
+ break;
2884
+ case 1:
2885
+ T(M[0]);
2886
+ break;
2887
+ case 2:
2888
+ T(M[0], M[1]);
2889
+ break;
2890
+ case 3:
2891
+ T(M[0], M[1], M[2]);
2892
+ break;
2893
+ default:
2894
+ T.apply(e, M);
2895
+ }
2896
+ })(x);
2897
+ } finally {
2898
+ h(k), m = !1;
2899
+ }
2900
+ }
2901
+ }
2902
+ }
2903
+ function w(k) {
2904
+ k.source === o && typeof k.data == "string" && k.data.indexOf(_) === 0 && u(+k.data.slice(_.length));
2905
+ }
2906
+ })(typeof self > "u" ? l === void 0 ? this : l : self);
2907
+ }).call(this, typeof At < "u" ? At : typeof self < "u" ? self : typeof window < "u" ? window : {});
2908
+ }, {}] }, {}, [10])(10);
2909
+ });
2910
+ })(te);
2911
+ var be = te.exports;
2912
+ const we = /* @__PURE__ */ _e(be), Ht = 914400, It = "data:image/svg+xml,%3Csvg%20xmlns=%22http://www.w3.org/2000/svg%22%20width=%221%22%20height=%221%22/%3E";
2913
+ function ee(E, P, n = 5) {
2914
+ return n < 0 ? [] : Jt.readdirSync(E, { withFileTypes: !0 }).sort((g, l) => g.name.localeCompare(l.name)).flatMap((g) => {
2915
+ const l = Mt.join(E, g.name);
2916
+ return g.isFile() ? g.name === P ? [l] : [] : g.isDirectory() ? ee(l, P, n - 1) : [];
2917
+ });
2918
+ }
2919
+ async function Nt(E, P, n) {
2920
+ await E.evaluate(({ kind: S, index: g, src: l, replacement: o, placeholder: e }) => {
2921
+ var a;
2922
+ if (S === "img") {
2923
+ const d = document.querySelector('[data-html2pptx-image="' + g + '"]');
2924
+ if (e) {
2925
+ const c = d.getBoundingClientRect(), _ = getComputedStyle(d);
2926
+ c.width && (d.style.width = _.width === "auto" ? c.width + "px" : _.width), c.height && (d.style.height = _.height === "auto" ? c.height + "px" : _.height);
2927
+ }
2928
+ if (((a = d.parentElement) == null ? void 0 : a.tagName) === "PICTURE")
2929
+ for (const c of d.parentElement.querySelectorAll("source"))
2930
+ c.removeAttribute("srcset");
2931
+ d.removeAttribute("srcset"), d.src = o;
2932
+ } else {
2933
+ const d = document.querySelector('[data-html2pptx-background="' + g + '"]');
2934
+ d.style.backgroundImage = getComputedStyle(d).backgroundImage.replace(l, o);
2935
+ }
2936
+ }, { ...P, replacement: n, placeholder: n === It });
2937
+ }
2938
+ async function ye(E, P) {
2939
+ var o;
2940
+ const n = [], S = /* @__PURE__ */ new Map(), g = await E.evaluate(() => {
2941
+ const e = [...document.images].map((d, c) => (d.dataset.html2pptxImage = String(c), { kind: "img", index: c, src: d.currentSrc || d.src })), a = [];
2942
+ for (const d of document.querySelectorAll("*")) {
2943
+ const c = getComputedStyle(d).backgroundImage;
2944
+ if (!c.includes("url("))
2945
+ continue;
2946
+ const _ = a.length;
2947
+ d.dataset.html2pptxBackground = String(_);
2948
+ for (const v of c.matchAll(/url\((?:"([^"]*)"|'([^']*)'|([^)]*))\)/g))
2949
+ a.push({ kind: "background", index: _, src: v[1] || v[2] || v[3] });
2950
+ }
2951
+ return [...e, ...a];
2952
+ });
2953
+ for (const e of g) {
2954
+ if (!((o = e.src) != null && o.startsWith("file:")))
2955
+ continue;
2956
+ let a;
2957
+ try {
2958
+ a = Ut(e.src);
2959
+ } catch {
2960
+ n.push({ src: e.src, reason: "invalid_path" }), await Nt(E, e, It);
2961
+ continue;
2962
+ }
2963
+ if (Jt.existsSync(a))
2964
+ continue;
2965
+ const d = Mt.basename(a), c = P ? ee(P, d) : [];
2966
+ c.length !== 1 && n.push({ src: e.src, reason: c.length ? "ambiguous" : "not_found" });
2967
+ const _ = c.length === 1 ? qt(c[0]).href : It;
2968
+ c.length === 1 && S.set(_, e.src), await Nt(E, e, _);
2969
+ }
2970
+ const l = await E.evaluate(async () => {
2971
+ await Promise.all([...document.images].map((d) => d.decode().catch(() => {
2972
+ })));
2973
+ const e = [...document.images].filter((d) => !d.naturalWidth).map((d) => ({ kind: "img", index: Number(d.dataset.html2pptxImage), src: d.currentSrc || d.src })), a = [...document.querySelectorAll("[data-html2pptx-background]")].flatMap((d) => [...getComputedStyle(d).backgroundImage.matchAll(/url\((?:"([^"]*)"|'([^']*)'|([^)]*))\)/g)].map((c) => ({
2974
+ kind: "background",
2975
+ index: Number(d.dataset.html2pptxBackground),
2976
+ src: c[1] || c[2] || c[3]
2977
+ })));
2978
+ return await Promise.all(a.map((d) => new Promise((c) => {
2979
+ const _ = new Image();
2980
+ _.onload = () => c(), _.onerror = () => {
2981
+ e.push(d), c();
2982
+ }, _.src = d.src;
2983
+ }))), e;
2984
+ });
2985
+ for (const e of l)
2986
+ n.push({ src: S.get(e.src) || e.src, reason: "load_failed" }), await Nt(E, e, It);
2987
+ return n;
2988
+ }
2989
+ function ve() {
2990
+ const E = document.createElement("style");
2991
+ E.textContent = "[data-html2pptx-hide-before]::before, [data-html2pptx-hide-after]::after { content: none !important }", document.head.appendChild(E);
2992
+ for (const P of [...document.querySelectorAll("*")])
2993
+ for (const n of ["before", "after"]) {
2994
+ const S = getComputedStyle(P, "::" + n), g = parseFloat(S.width), l = parseFloat(S.height);
2995
+ if (S.content === "none" || S.content === "normal" || !(g >= 8 && l > 0 && l <= 3 || l >= 8 && g > 0 && g <= 3) || ["transparent", "rgba(0, 0, 0, 0)"].includes(S.backgroundColor) && S.backgroundImage === "none")
2996
+ continue;
2997
+ const o = document.createElement("span");
2998
+ for (let e = 0; e < S.length; e++) {
2999
+ const a = S[e];
3000
+ a.startsWith("animation") || a.startsWith("transition") || o.style.setProperty(a, S.getPropertyValue(a));
3001
+ }
3002
+ o.setAttribute("aria-hidden", "true"), P.setAttribute("data-html2pptx-hide-" + n, ""), n === "before" ? P.prepend(o) : P.append(o);
3003
+ }
3004
+ }
3005
+ function Gt(E) {
3006
+ const P = document.querySelector(E) || document.body, n = P.getBoundingClientRect(), S = P === document.body ? {
3007
+ left: n.left,
3008
+ top: n.top,
3009
+ width: Math.max(n.width, document.body.scrollWidth, window.innerWidth),
3010
+ height: Math.max(n.height, document.body.scrollHeight, window.innerHeight)
3011
+ } : n, g = [];
3012
+ let l = 0;
3013
+ const o = (u) => parseFloat(u) || 0, e = (u) => {
3014
+ const w = String(u || "").match(/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*([\d.]+))?/i);
3015
+ return w ? { hex: w.slice(1, 4).map((k) => Number(k).toString(16).padStart(2, "0")).join("").toUpperCase(), alpha: w[4] === void 0 ? 1 : Number(w[4]) } : null;
3016
+ }, a = (u) => {
3017
+ const w = e(u);
3018
+ return w && w.alpha > 0 ? w : null;
3019
+ }, d = (u, w) => {
3020
+ if (!u.startsWith("linear-gradient(") || !u.endsWith(")"))
3021
+ return null;
3022
+ const k = [];
3023
+ let x = 0, O = 0;
3024
+ const T = u.slice(16, -1);
3025
+ for (let b = 0; b < T.length; b++)
3026
+ T[b] === "(" ? x++ : T[b] === ")" ? x-- : T[b] === "," && x === 0 && (k.push(T.slice(O, b).trim()), O = b + 1);
3027
+ k.push(T.slice(O).trim());
3028
+ let M = 180;
3029
+ if (/^-?[\d.]+deg$/.test(k[0]))
3030
+ M = parseFloat(k.shift());
3031
+ else if (/^to (right|bottom|left|top)$/.test(k[0]))
3032
+ M = { right: 90, bottom: 180, left: 270, top: 0 }[k.shift().slice(3)];
3033
+ else if (k[0].startsWith("to "))
3034
+ return null;
3035
+ const z = M * Math.PI / 180, W = Math.abs(w.w * Math.sin(z)) + Math.abs(w.h * Math.cos(z)), j = k.map((b) => {
3036
+ const F = b.match(/^(rgba?\([^)]+\)|#[0-9a-f]{3,8}|transparent)(?:\s+(-?[\d.]+)(%|px))?$/i);
3037
+ if (!F)
3038
+ return null;
3039
+ let r = e(F[1]);
3040
+ if (F[1].toLowerCase() === "transparent")
3041
+ r = { hex: "000000", alpha: 0 };
3042
+ else if (F[1][0] === "#") {
3043
+ const N = F[1].slice(1);
3044
+ r = {
3045
+ hex: (N.length <= 4 ? [...N.slice(0, 3)].map((Q) => Q + Q).join("") : N.slice(0, 6)).toUpperCase(),
3046
+ alpha: N.length === 4 ? parseInt(N[3] + N[3], 16) / 255 : N.length === 8 ? parseInt(N.slice(-2), 16) / 255 : 1
3047
+ };
3048
+ }
3049
+ return r ? { ...r, position: F[2] === void 0 ? null : Number(F[2]) * (F[3] === "%" ? 0.01 : 1 / W) } : null;
3050
+ });
3051
+ if (j.length < 2 || j.some((b) => !b))
3052
+ return null;
3053
+ j[0].position === null && (j[0].position = 0), j.at(-1).position === null && (j.at(-1).position = 1);
3054
+ for (let b = 1; b < j.length; b++)
3055
+ if (j[b].position !== null)
3056
+ j[b].position = Math.max(j[b].position, j[b - 1].position);
3057
+ else {
3058
+ let F = b + 1;
3059
+ for (; j[F].position === null; )
3060
+ F++;
3061
+ const r = (Math.max(j[F].position, j[b - 1].position) - j[b - 1].position) / (F - b + 1);
3062
+ for (let N = b; N < F; N++)
3063
+ j[N].position = j[b - 1].position + r * (N - b + 1);
3064
+ }
3065
+ return { angle: M, stops: j };
3066
+ }, c = (u) => {
3067
+ const w = u.getBoundingClientRect();
3068
+ return { x: w.left - S.left, y: w.top - S.top, w: w.width, h: w.height };
3069
+ }, _ = (u, w) => ["TopLeft", "TopRight", "BottomRight", "BottomLeft"].map((k, x) => {
3070
+ const O = u[`border${k}Radius`];
3071
+ return O.includes("%") ? Math.min(w.w, w.h) * o(O) / 100 : o(O);
3072
+ }), v = (u) => {
3073
+ const w = a(u.color);
3074
+ if (w)
3075
+ return w;
3076
+ if (u.backgroundClip === "text" || u.webkitBackgroundClip === "text") {
3077
+ const k = u.backgroundImage.match(/#[0-9a-fA-F]{3,8}|rgba?\([^)]+\)/g);
3078
+ if (k && k.length) {
3079
+ const x = k[Math.floor(k.length / 2)];
3080
+ if (x.startsWith("#")) {
3081
+ const O = x.slice(1);
3082
+ return { hex: O.length === 3 ? O.split("").map((T) => T + T).join("").toUpperCase() : O.slice(0, 6).toUpperCase(), alpha: 1 };
3083
+ }
3084
+ return a(x);
3085
+ }
3086
+ }
3087
+ return { hex: "000000", alpha: 1 };
3088
+ }, s = (u, w, k) => {
3089
+ var $;
3090
+ let x = k, O = 0;
3091
+ const T = ($ = w.transform.match(/^matrix\(([^)]+)\)$/)) == null ? void 0 : $[1].split(",").map(Number);
3092
+ (T == null ? void 0 : T.length) === 6 && Math.abs(Math.hypot(T[0], T[1]) - 1) < 0.01 && Math.abs(Math.hypot(T[2], T[3]) - 1) < 0.01 && (O = Math.atan2(T[1], T[0]) * 180 / Math.PI, Math.abs(O) > 0.1 && (x = {
3093
+ x: k.x + (k.w - u.offsetWidth) / 2,
3094
+ y: k.y + (k.h - u.offsetHeight) / 2,
3095
+ w: u.offsetWidth,
3096
+ h: u.offsetHeight
3097
+ }));
3098
+ const M = a(w.backgroundColor), z = ["Top", "Right", "Bottom", "Left"].map((Y) => ({
3099
+ width: o(w[`border${Y}Width`]),
3100
+ color: a(w[`border${Y}Color`])
3101
+ })), W = z.some((Y) => Y.width && Y.color), j = _(w, x);
3102
+ for (let Y = u.parentElement; Y && Y !== P; Y = Y.parentElement) {
3103
+ const L = getComputedStyle(Y);
3104
+ if (L.overflow !== "hidden")
3105
+ continue;
3106
+ const K = Y.getBoundingClientRect(), I = u.getBoundingClientRect(), B = _(L, c(Y));
3107
+ [
3108
+ Math.abs(I.left - K.left) < 3 && Math.abs(I.top - K.top) < 3,
3109
+ Math.abs(I.right - K.right) < 3 && Math.abs(I.top - K.top) < 3,
3110
+ Math.abs(I.right - K.right) < 3 && Math.abs(I.bottom - K.bottom) < 3,
3111
+ Math.abs(I.left - K.left) < 3 && Math.abs(I.bottom - K.bottom) < 3
3112
+ ].forEach((q, X) => {
3113
+ q && (j[X] = Math.max(j[X], B[X]));
3114
+ });
3115
+ }
3116
+ const b = w.clipPath.match(/^polygon\((.*)\)$/), F = z.map((Y, L) => ({ ...Y, index: L })).filter((Y) => Y.width && Y.color);
3117
+ if (u.clientWidth === 0 && u.clientHeight === 0 && F.length === 1) {
3118
+ const Y = F[0], L = [
3119
+ [[0, 0], [x.w, 0], [x.w / 2, x.h]],
3120
+ [[x.w, 0], [x.w, x.h], [0, x.h / 2]],
3121
+ [[x.w / 2, 0], [x.w, x.h], [0, x.h]],
3122
+ [[0, 0], [x.w, x.h / 2], [0, x.h]]
3123
+ ][Y.index];
3124
+ g.push({ type: "polygon", points: L, fill: Y.color, ...x });
3125
+ return;
3126
+ }
3127
+ const r = x.w >= 8 && x.h <= 3 || x.h >= 8 && x.w <= 3, N = r ? d(w.backgroundImage, x) : null;
3128
+ if (r && (N || w.backgroundImage === "none" && M)) {
3129
+ g.push({ type: "line", ...x, color: M, gradient: N, rotate: O });
3130
+ return;
3131
+ }
3132
+ if (w.backgroundImage !== "none" && w.backgroundClip !== "text" && w.webkitBackgroundClip !== "text") {
3133
+ const Y = ++l;
3134
+ u.setAttribute("data-html2pptx-capture", String(Y)), g.push({ type: "capture-background", id: Y, rotate: O, ...x });
3135
+ return;
3136
+ }
3137
+ if (!M && !W)
3138
+ return;
3139
+ if (b) {
3140
+ const Y = b[1].replace(/^(evenodd|nonzero),\s*/, "").split(",").map((L) => L.trim().split(/\s+/).map((K, I) => K.endsWith("%") ? o(K) * (I ? x.h : x.w) / 100 : o(K)));
3141
+ if (Y.length >= 3 && Y.every((L) => L.length === 2 && L.every(Number.isFinite))) {
3142
+ g.push({ type: "polygon", points: Y, fill: M, ...x });
3143
+ return;
3144
+ }
3145
+ }
3146
+ const Q = z.every((Y) => {
3147
+ var L, K;
3148
+ return Math.abs(Y.width - z[0].width) < 0.1 && (((L = Y.color) == null ? void 0 : L.hex) || "") === (((K = z[0].color) == null ? void 0 : K.hex) || "");
3149
+ });
3150
+ g.push({
3151
+ type: "shape",
3152
+ ...x,
3153
+ fill: M,
3154
+ border: Q ? z[0] : null,
3155
+ radius: Math.max(...j),
3156
+ radii: j,
3157
+ rotate: O,
3158
+ shadow: w.boxShadow
3159
+ }), Q || z.forEach((Y, L) => {
3160
+ Y.width && Y.color && g.push({
3161
+ type: "border-strip",
3162
+ ...x,
3163
+ side: L,
3164
+ widths: z.map((K) => K.width),
3165
+ color: Y.color,
3166
+ radii: j
3167
+ });
3168
+ });
3169
+ }, m = (u, w) => {
3170
+ if (!u.textContent.trim())
3171
+ return;
3172
+ const k = getComputedStyle(w), x = u.textContent, O = document.createRange(), T = [];
3173
+ for (let j = 0; j < x.length; j++) {
3174
+ O.setStart(u, j), O.setEnd(u, j + 1);
3175
+ const b = O.getBoundingClientRect();
3176
+ if (b.width < 0.2 || b.height < 0.2)
3177
+ continue;
3178
+ const F = /\s/.test(x[j]) && !k.whiteSpace.startsWith("pre") ? " " : x[j];
3179
+ let r = T[T.length - 1];
3180
+ F === " " && (!r || !r.text) || ((!r || Math.abs(r.y - b.top) > 3) && (r = { text: "", x: b.left, y: b.top, right: b.right, h: b.height }, T.push(r)), (F !== " " || r.text && !r.text.endsWith(" ")) && (r.text += F), r.right = b.right, r.h = Math.max(r.h, b.height));
3181
+ }
3182
+ const M = k.fontFamily.split(",")[0].trim().replace(/^['"]|['"]$/g, ""), z = v(k), W = (() => {
3183
+ for (let j = w; j && j !== P; j = j.parentElement) {
3184
+ const b = getComputedStyle(j);
3185
+ if (b.display.includes("flex") && !(b.justifyContent !== "center" && b.alignItems !== "center") && j.innerText.trim() === x.trim())
3186
+ return c(j).y + c(j).h / 2;
3187
+ }
3188
+ return null;
3189
+ })();
3190
+ for (const j of T) {
3191
+ const b = j.text.trim();
3192
+ b && g.push({
3193
+ type: "rendered-text",
3194
+ text: b,
3195
+ x: j.x - S.left,
3196
+ y: j.y - S.top,
3197
+ w: j.right - j.x,
3198
+ h: j.h,
3199
+ fontSize: o(k.fontSize),
3200
+ fontFace: M,
3201
+ color: z,
3202
+ bold: parseInt(k.fontWeight, 10) >= 600 || k.fontWeight === "bold",
3203
+ italic: k.fontStyle === "italic",
3204
+ underline: k.textDecorationLine.includes("underline"),
3205
+ strike: k.textDecorationLine.includes("line-through"),
3206
+ letterSpacing: k.letterSpacing === "normal" ? 0 : o(k.letterSpacing),
3207
+ centerY: T.length === 1 ? W : null,
3208
+ align: k.textAlign
3209
+ });
3210
+ }
3211
+ }, i = (u) => {
3212
+ const w = getComputedStyle(u);
3213
+ if (w.display === "none" || w.visibility === "hidden" || o(w.opacity) === 0)
3214
+ return;
3215
+ const k = c(u);
3216
+ if (k.w <= 0 || k.h <= 0)
3217
+ return;
3218
+ const x = u.tagName.toLowerCase();
3219
+ if (x === "img" || x === "svg" || x === "canvas") {
3220
+ const O = ++l;
3221
+ u.setAttribute("data-html2pptx-capture", String(O)), g.push({ type: "capture-element", id: O, ...k });
3222
+ return;
3223
+ }
3224
+ s(u, w, k);
3225
+ for (const O of u.childNodes)
3226
+ O.nodeType === Node.TEXT_NODE ? m(O, u) : O.nodeType === Node.ELEMENT_NODE && i(O);
3227
+ }, f = getComputedStyle(P), h = a(f.backgroundColor) || a(getComputedStyle(document.body).backgroundColor);
3228
+ s(P, f, { x: 0, y: 0, w: S.width, h: S.height });
3229
+ for (const u of P.childNodes)
3230
+ u.nodeType === Node.TEXT_NODE ? m(u, P) : u.nodeType === Node.ELEMENT_NODE && i(u);
3231
+ for (const u of g.filter((w) => w.type === "rendered-text" && /^\d{1,3}$/.test(w.text))) {
3232
+ const w = g.find((k) => k.type === "shape" && k.radius >= Math.min(k.w, k.h) * 0.45 && Math.abs(k.x + k.w / 2 - u.x - u.w / 2) < k.w * 0.12 && Math.abs(k.y + k.h / 2 - u.y - u.h / 2) < k.h * 0.12);
3233
+ w && (u.centerY = w.y + w.h / 2);
3234
+ }
3235
+ return { elements: g, background: h, width: S.width, height: S.height };
3236
+ }
3237
+ function ke(E, P, n, S, g) {
3238
+ const [l, o, e, a] = n.map((_) => Math.max(0, Math.min(_, E / 2, P / 2))), d = 0.5522847498, c = (_, v, s) => ({
3239
+ x: _ * S,
3240
+ y: v * g,
3241
+ ...s ? { curve: {
3242
+ type: "cubic",
3243
+ x1: s[0] * S,
3244
+ y1: s[1] * g,
3245
+ x2: s[2] * S,
3246
+ y2: s[3] * g
3247
+ } } : {}
3248
+ });
3249
+ return [
3250
+ c(l, 0),
3251
+ c(E - o, 0),
3252
+ c(E, o, [E - o + o * d, 0, E, o - o * d]),
3253
+ c(E, P - e),
3254
+ c(E - e, P, [E, P - e + e * d, E - e + e * d, P]),
3255
+ c(a, P),
3256
+ c(0, P - a, [a - a * d, P, 0, P - a + a * d]),
3257
+ c(0, l),
3258
+ c(l, 0, [0, l - l * d, l - l * d, 0]),
3259
+ { close: !0 }
3260
+ ];
3261
+ }
3262
+ function xe(E, P, n) {
3263
+ const [S, g, l, o] = E.radii.map((z) => Math.max(0, Math.min(z, E.w / 2, E.h / 2))), [e, a, d, c] = E.widths, _ = [
3264
+ {
3265
+ w: E.h,
3266
+ h: E.w,
3267
+ top: S,
3268
+ bottom: g,
3269
+ width: e,
3270
+ before: c,
3271
+ after: a,
3272
+ transform: (z, W) => [W, z]
3273
+ },
3274
+ {
3275
+ w: E.w,
3276
+ h: E.h,
3277
+ top: g,
3278
+ bottom: l,
3279
+ width: a,
3280
+ before: e,
3281
+ after: d,
3282
+ transform: (z, W) => [E.w - z, W]
3283
+ },
3284
+ {
3285
+ w: E.h,
3286
+ h: E.w,
3287
+ top: o,
3288
+ bottom: l,
3289
+ width: d,
3290
+ before: c,
3291
+ after: a,
3292
+ transform: (z, W) => [W, E.h - z]
3293
+ },
3294
+ {
3295
+ w: E.w,
3296
+ h: E.h,
3297
+ top: S,
3298
+ bottom: o,
3299
+ width: c,
3300
+ before: e,
3301
+ after: d,
3302
+ transform: (z, W) => [z, W]
3303
+ }
3304
+ ], { h: v, top: s, bottom: m, width: i, before: f, after: h, transform: u } = _[E.side], w = 0.5522847498, k = Math.max(0, s - i), x = Math.max(0, s - f), O = Math.max(0, m - i), T = Math.max(0, m - h);
3305
+ return [
3306
+ [s, 0],
3307
+ [0, s, s - s * w, 0, 0, s - s * w],
3308
+ [0, v - m],
3309
+ [m, v, 0, v - m + m * w, m - m * w, v],
3310
+ [i + O, v - h],
3311
+ [
3312
+ i,
3313
+ v - h - T,
3314
+ i + O - O * w,
3315
+ v - h,
3316
+ i,
3317
+ v - h - T + T * w
3318
+ ],
3319
+ [i, f + x],
3320
+ [
3321
+ i + k,
3322
+ f,
3323
+ i,
3324
+ f + x - x * w,
3325
+ i + k - k * w,
3326
+ f
3327
+ ]
3328
+ ].map(([z, W, j, b, F, r]) => {
3329
+ const [N, Q] = u(z, W), $ = { x: N * P, y: Q * n };
3330
+ if (j !== void 0) {
3331
+ const [Y, L] = u(j, b), [K, I] = u(F, r);
3332
+ $.curve = { type: "cubic", x1: Y * P, y1: L * n, x2: K * P, y2: I * n };
3333
+ }
3334
+ return $;
3335
+ });
3336
+ }
3337
+ function Dt(E) {
3338
+ return E ? { color: E.hex, transparency: Math.round((1 - E.alpha) * 100) } : { color: "FFFFFF", transparency: 100 };
3339
+ }
3340
+ function Se(E, P) {
3341
+ var l;
3342
+ if (!E || E === "none" || E.includes("inset"))
3343
+ return null;
3344
+ const n = E.match(/rgba?\([^)]+\)/), S = ((l = E.replace((n == null ? void 0 : n[0]) || "", "").match(/-?[\d.]+px/g)) == null ? void 0 : l.map(parseFloat)) || [];
3345
+ if (S.length < 2)
3346
+ return null;
3347
+ const g = n == null ? void 0 : n[0].match(/rgba?\((\d+),\s*(\d+),\s*(\d+)(?:,\s*([\d.]+))?/);
3348
+ return {
3349
+ type: "outer",
3350
+ color: g ? [1, 2, 3].map((o) => Number(g[o]).toString(16).padStart(2, "0")).join("") : "000000",
3351
+ opacity: g != null && g[4] ? Number(g[4]) : 0.35,
3352
+ angle: (Math.atan2(S[1], S[0]) * 180 / Math.PI + 360) % 360,
3353
+ blur: (S[2] || 0) * P * 72,
3354
+ offset: Math.hypot(S[0], S[1]) * P * 72
3355
+ };
3356
+ }
3357
+ function Ee(E, P, n, S, g, l) {
3358
+ var e;
3359
+ const o = { x: n.x * S, y: n.y * g, w: n.w * S, h: n.h * g };
3360
+ if (n.type === "line") {
3361
+ if (n.gradient) {
3362
+ const d = `html2pptx-gradient-${l.length + 1}`;
3363
+ E.addShape(P.ShapeType.rect, {
3364
+ ...o,
3365
+ objectName: d,
3366
+ fill: Dt(n.gradient.stops[0]),
3367
+ line: { color: "FFFFFF", transparency: 100 },
3368
+ ...n.rotate ? { rotate: n.rotate } : {}
3369
+ }), l.push({ name: d, ...n.gradient });
3370
+ return;
3371
+ }
3372
+ const a = n.w >= n.h;
3373
+ E.addShape(P.ShapeType.line, {
3374
+ x: (n.x + (a ? 0 : n.w / 2)) * S,
3375
+ y: (n.y + (a ? n.h / 2 : 0)) * g,
3376
+ w: a ? o.w : 0,
3377
+ h: a ? 0 : o.h,
3378
+ line: {
3379
+ color: n.color.hex,
3380
+ transparency: Math.round((1 - n.color.alpha) * 100),
3381
+ width: Math.max(0.75, (a ? o.h : o.w) * 72)
3382
+ },
3383
+ ...n.rotate ? { rotate: n.rotate } : {}
3384
+ });
3385
+ return;
3386
+ }
3387
+ if (n.type === "capture-element" || n.type === "capture-background") {
3388
+ E.addImage({ data: n.data, ...o, ...n.rotate ? { rotate: n.rotate } : {} });
3389
+ return;
3390
+ }
3391
+ if (n.type === "rendered-text") {
3392
+ const a = n.fontSize * S * 72, d = Math.max(12, n.fontSize * 0.8), c = n.centerY == null ? n.y : n.centerY - n.h / 2 + (n.fontSize >= 100 ? 0 : Math.min(2, n.fontSize * 0.05));
3393
+ E.addText(n.text, {
3394
+ x: o.x,
3395
+ y: c * g,
3396
+ w: (n.w + d) * S,
3397
+ h: o.h,
3398
+ fontFace: n.fontFace,
3399
+ fontSize: a,
3400
+ color: n.color.hex,
3401
+ transparency: Math.round((1 - n.color.alpha) * 100),
3402
+ bold: n.bold,
3403
+ italic: n.italic,
3404
+ underline: n.underline,
3405
+ strike: n.strike,
3406
+ charSpacing: n.letterSpacing * S * 72,
3407
+ margin: 0,
3408
+ breakLine: !1,
3409
+ valign: "middle",
3410
+ fit: "shrink",
3411
+ align: "left"
3412
+ });
3413
+ return;
3414
+ }
3415
+ if (n.type === "polygon" || n.type === "border-strip") {
3416
+ const a = n.type === "polygon" ? n.points.map(([d, c]) => ({ x: d * S, y: c * g })) : xe(n, S, g);
3417
+ E.addShape(P.ShapeType.custGeom, {
3418
+ ...o,
3419
+ points: [...a, { close: !0 }],
3420
+ fill: Dt(n.type === "polygon" ? n.fill : n.color),
3421
+ line: { color: "FFFFFF", transparency: 100 }
3422
+ });
3423
+ return;
3424
+ }
3425
+ if (n.type === "shape") {
3426
+ const a = n.radii || [n.radius, n.radius, n.radius, n.radius], d = a.some((m) => Math.abs(m - a[0]) > 0.1), c = n.radius >= Math.min(n.w, n.h) * 0.45 && Math.abs(n.w - n.h) < 1, _ = d ? P.ShapeType.custGeom : c ? P.ShapeType.ellipse : n.radius >= 1 ? P.ShapeType.roundRect : P.ShapeType.rect, v = { ...o, fill: Dt(n.fill), line: (e = n.border) != null && e.width && n.border.color ? {
3427
+ color: n.border.color.hex,
3428
+ width: n.border.width * S * 72,
3429
+ transparency: Math.round((1 - n.border.color.alpha) * 100)
3430
+ } : { color: "FFFFFF", transparency: 100 } };
3431
+ n.rotate && (v.rotate = n.rotate), _ === P.ShapeType.custGeom && (v.points = ke(n.w, n.h, a, S, g)), _ === P.ShapeType.roundRect && (v.rectRadius = n.radius * S);
3432
+ const s = Se(n.shadow, S);
3433
+ s && (v.shadow = s), E.addShape(_, v);
3434
+ }
3435
+ }
3436
+ async function Ce(E, P) {
3437
+ const n = E.locator(`[data-html2pptx-capture="${P.id}"]`);
3438
+ let S;
3439
+ if (P.type === "capture-background") {
3440
+ await n.evaluate((g) => {
3441
+ const l = getComputedStyle(g), o = g.getBoundingClientRect(), e = document.createElement("div");
3442
+ e.id = "__html2pptx_background_clone", Object.assign(e.style, {
3443
+ position: "fixed",
3444
+ left: "0",
3445
+ top: "0",
3446
+ width: `${o.width}px`,
3447
+ height: `${o.height}px`,
3448
+ boxSizing: "border-box",
3449
+ background: l.background,
3450
+ border: l.border,
3451
+ borderRadius: l.borderRadius,
3452
+ clipPath: l.clipPath,
3453
+ opacity: l.opacity
3454
+ }), document.body.appendChild(e), document.documentElement.classList.add("__html2pptx_background_isolate");
3455
+ });
3456
+ try {
3457
+ S = await E.locator("#__html2pptx_background_clone").screenshot({ omitBackground: !0 });
3458
+ } finally {
3459
+ await E.locator("#__html2pptx_background_clone").evaluate((g) => {
3460
+ document.documentElement.classList.remove("__html2pptx_background_isolate"), g.remove();
3461
+ });
3462
+ }
3463
+ } else {
3464
+ await n.evaluate((g) => {
3465
+ document.documentElement.classList.add("__html2pptx_isolate"), g.classList.add("__html2pptx_active");
3466
+ });
3467
+ try {
3468
+ S = await n.screenshot({ omitBackground: !0 });
3469
+ } finally {
3470
+ await n.evaluate((g) => {
3471
+ document.documentElement.classList.remove("__html2pptx_isolate"), g.classList.remove("__html2pptx_active");
3472
+ });
3473
+ }
3474
+ }
3475
+ P.data = `data:image/png;base64,${S.toString("base64")}`;
3476
+ }
3477
+ async function Ae(E, P, n) {
3478
+ const S = Mt.resolve(E), g = { headless: !0, ...n.browserExecutable ? { executablePath: n.browserExecutable } : process.platform === "darwin" ? { channel: "chrome" } : {} }, { chromium: l } = await import("playwright-core").catch((e) => {
3479
+ throw e.code !== "ERR_MODULE_NOT_FOUND" ? e : new Error("HTML PPTX 导出需要显式安装 playwright-core@1.61.1。", { cause: e });
3480
+ }), o = await l.launch(g);
3481
+ try {
3482
+ const e = await o.newPage({ viewport: { width: 1920, height: 1080 }, deviceScaleFactor: 2, reducedMotion: "reduce" });
3483
+ if (await e.goto(qt(S).href, { waitUntil: "load" }), n.selector && !await e.locator(n.selector).count())
3484
+ throw new Error(`HTML 中找不到 --selector 指定的节点:${n.selector}`);
3485
+ await e.evaluate(async () => {
3486
+ var i;
3487
+ (i = document.fonts) != null && i.ready && await document.fonts.ready;
3488
+ });
3489
+ const a = await ye(e, n.assetsRoot);
3490
+ await e.evaluate(() => {
3491
+ var i;
3492
+ for (const f of document.getAnimations())
3493
+ Number.isFinite((i = f.effect) == null ? void 0 : i.getComputedTiming().endTime) && f.finish();
3494
+ }), await e.evaluate(ve), await e.addStyleTag({ content: `
3495
+ html.__html2pptx_isolate,
3496
+ html.__html2pptx_isolate body { background: transparent !important }
3497
+ html.__html2pptx_isolate body * { visibility: hidden !important }
3498
+ html.__html2pptx_isolate .__html2pptx_active,
3499
+ html.__html2pptx_isolate .__html2pptx_active * { visibility: visible !important }
3500
+ html.__html2pptx_background_isolate,
3501
+ html.__html2pptx_background_isolate body { background: transparent !important }
3502
+ html.__html2pptx_background_isolate body > *:not(#__html2pptx_background_clone) { visibility: hidden !important }
3503
+ ` });
3504
+ const d = n.selector || "#ppt-canvas, [data-ppt-canvas], .pptd-slide, .slide, .s, section";
3505
+ let c = await e.evaluate(Gt, d);
3506
+ await e.setViewportSize({ width: Math.max(1, Math.ceil(c.width)), height: Math.max(1, Math.ceil(c.height)) }), c = await e.evaluate(Gt, d);
3507
+ for (const i of c.elements)
3508
+ (i.type === "capture-element" || i.type === "capture-background") && await Ce(e, i);
3509
+ (!P.presLayout || n.autoLayout) && (P.defineLayout({ name: `HTML_${Math.round(c.width)}x${Math.round(c.height)}`, width: c.width / 96, height: c.height / 96 }), P.layout = `HTML_${Math.round(c.width)}x${Math.round(c.height)}`);
3510
+ const _ = P.presLayout.width / Ht / c.width, v = P.presLayout.height / Ht / c.height, s = n.slide || P.addSlide();
3511
+ c.background && (s.background = { color: c.background.hex });
3512
+ const m = [];
3513
+ for (const i of c.elements)
3514
+ Ee(s, P, i, _, v, m);
3515
+ return { slide: s, placeholders: [], warnings: a, gradients: m, stats: c.elements.reduce((i, f) => (i[f.type] = (i[f.type] || 0) + 1, i), {}) };
3516
+ } finally {
3517
+ await o.close();
3518
+ }
3519
+ }
3520
+ const ze = oe(import.meta.url);
3521
+ function Ie({ angle: E, stops: P }) {
3522
+ const n = P.map((e, a) => {
3523
+ if (e.alpha)
3524
+ return e;
3525
+ const d = P.slice(a + 1).find((c) => c.alpha) || P.slice(0, a).reverse().find((c) => c.alpha);
3526
+ return { ...e, hex: (d == null ? void 0 : d.hex) || e.hex };
3527
+ }), S = (e) => {
3528
+ let a = n[0];
3529
+ if (e <= a.position)
3530
+ return { ...a, position: e };
3531
+ for (const d of n.slice(1)) {
3532
+ if (e < d.position) {
3533
+ const c = (e - a.position) / (d.position - a.position), _ = a.alpha + (d.alpha - a.alpha) * c, v = [0, 2, 4].map((s) => {
3534
+ const m = parseInt(a.hex.slice(s, s + 2), 16), i = parseInt(d.hex.slice(s, s + 2), 16);
3535
+ return _ ? Math.round((m * a.alpha * (1 - c) + i * d.alpha * c) / _) : 0;
3536
+ });
3537
+ return { position: e, alpha: _, hex: v.map((s) => s.toString(16).padStart(2, "0")).join("").toUpperCase() };
3538
+ }
3539
+ a = d;
3540
+ }
3541
+ return { ...n.at(-1), position: e };
3542
+ }, l = [S(0), ...n.filter((e) => e.position > 0 && e.position < 1), S(1)].map((e) => `<a:gs pos="${Math.round(e.position * 1e5)}"><a:srgbClr val="${e.hex}"><a:alpha val="${Math.round(e.alpha * 1e5)}"/></a:srgbClr></a:gs>`).join(""), o = ((E - 90) % 360 + 360) % 360;
3543
+ return `<a:gradFill rotWithShape="1"><a:gsLst>${l}</a:gsLst><a:lin ang="${Math.round(o * 6e4)}" scaled="1"/></a:gradFill>`;
3544
+ }
3545
+ async function Te(E, P, { selector: n, browserExecutable: S, assetsRoot: g } = {}) {
3546
+ const l = ft(E), e = (await Bt(l)).isDirectory() ? (await se(l)).filter((m) => Zt(m).toLowerCase() === ".html").sort((m, i) => m.localeCompare(i, "zh-CN", { numeric: !0 })).map((m) => St(l, m)) : [l];
3547
+ if (!e.length || e.some((m) => Zt(m).toLowerCase() !== ".html"))
3548
+ throw new Error(`没有找到 HTML 文件:${l}`);
3549
+ if (g && !(await Bt(g)).isDirectory())
3550
+ throw new Error(`--assets-root 不是目录:${g}`);
3551
+ const a = ze("pptxgenjs-html"), d = new a(), c = {}, _ = [], v = [];
3552
+ for (const [m, i] of e.entries()) {
3553
+ const f = await Ae(i, d, {
3554
+ autoLayout: m === 0,
3555
+ selector: n,
3556
+ browserExecutable: S,
3557
+ assetsRoot: g
3558
+ });
3559
+ for (const [h, u] of Object.entries(f.stats))
3560
+ c[h] = (c[h] || 0) + u;
3561
+ for (const h of f.warnings)
3562
+ _.push({ pageNumber: m + 1, sourceFile: i, ...h });
3563
+ f.gradients.length && v.push({ pageNumber: m + 1, gradients: f.gradients });
3564
+ }
3565
+ await Pt(Tt(P), { recursive: !0 });
3566
+ const s = `${P}.${Kt()}.pptx`;
3567
+ try {
3568
+ if (await d.writeFile({ fileName: s }), v.length) {
3569
+ const i = await we.loadAsync(await xt(s));
3570
+ for (const { pageNumber: f, gradients: h } of v) {
3571
+ const u = `ppt/slides/slide${f}.xml`;
3572
+ let w = await i.file(u).async("string");
3573
+ for (const k of h) {
3574
+ let x = 0;
3575
+ if (w = w.replace(/<p:sp>.*?<\/p:sp>/g, (O) => {
3576
+ if (!O.includes(`name="${k.name}"`))
3577
+ return O;
3578
+ if (x++, !O.includes('prst="rect"') || !O.includes("<a:solidFill>"))
3579
+ throw new Error(`无法写入第 ${f} 页渐变形状:${k.name}`);
3580
+ return O.replace(/<a:solidFill>.*?<\/a:solidFill>/, Ie(k));
3581
+ }), x !== 1)
3582
+ throw new Error(`第 ${f} 页渐变形状数量异常:${k.name}`);
3583
+ }
3584
+ i.file(u, w);
3585
+ }
3586
+ await Lt(s, await i.generateAsync({ type: "nodebuffer", compression: "DEFLATE" }));
3587
+ }
3588
+ const m = (await Bt(s)).size;
3589
+ return await Xt(s, P), {
3590
+ file: P,
3591
+ pages: e.map((i, f) => ({ pageNumber: f + 1, sourceFile: i })),
3592
+ bytes: m,
3593
+ objects: c,
3594
+ imagePlaceholders: _
3595
+ };
3596
+ } finally {
3597
+ await Yt(s, { force: !0 });
3598
+ }
3599
+ }
3600
+ const Oe = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
3601
+ __proto__: null,
3602
+ exportHtmlToPptxFile: Te
3603
+ }, Symbol.toStringTag, { value: "Module" }));