@silurus/ooxml 0.60.0 → 0.60.2
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/README.md +1 -1
- package/dist/docx-C-Xv4gHb.js +2100 -0
- package/dist/docx.mjs +2 -2
- package/dist/index.mjs +3 -3
- package/dist/{pptx-DsFZ4AtI.js → pptx-CcRBxO-i.js} +611 -631
- package/dist/pptx.mjs +2 -2
- package/dist/render-worker-host-BD-wqOCv.js +27 -0
- package/dist/render-worker-host-qS8zOCxE.js +27 -0
- package/dist/{src-BAZYl43H.js → src-CWqt1QE0.js} +272 -250
- package/dist/types/docx.d.ts +21 -0
- package/dist/types/index.d.ts +22 -0
- package/dist/{xlsx-BS4Rw1qg.js → xlsx-B8GnK1Ad.js} +290 -290
- package/dist/xlsx.mjs +2 -2
- package/package.json +1 -1
- package/dist/docx-FgLcXCmS.js +0 -2073
- package/dist/render-worker-host-BT6u-XRr.js +0 -27
- package/dist/render-worker-host-DTvVLN37.js +0 -27
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as e, B as t, C as n, D as r, E as i, F as a, H as o, I as s, L as c,
|
|
1
|
+
import { A as e, B as t, C as n, D as r, E as i, F as a, H as o, I as s, L as c, N as l, O as u, P as d, R as f, S as p, T as m, U as h, V as g, _, a as v, b as y, c as b, d as x, f as S, g as C, h as w, i as T, j as E, k as D, l as O, m as k, n as A, o as j, p as M, r as N, u as P, v as F, w as I, x as ee, y as L, z as R } from "./src-CWqt1QE0.js";
|
|
2
2
|
import { t as z } from "./mathjax-CNh-4Cw1.js";
|
|
3
3
|
//#region packages/pptx/src/media-chrome.ts
|
|
4
4
|
function B(e, t, n, r, i, a) {
|
|
@@ -19,15 +19,15 @@ var V = /[\u0590-\u08FF\uFB1D-\uFDFF\uFE70-\uFEFF\u200F\u202B\u202E\u2067]|[\u{1
|
|
|
19
19
|
let t = e.text;
|
|
20
20
|
return typeof t == "string" ? t : void 0;
|
|
21
21
|
};
|
|
22
|
-
function
|
|
22
|
+
function te(e) {
|
|
23
23
|
for (let t of e) {
|
|
24
24
|
let e = H(t);
|
|
25
25
|
if (e !== void 0 && V.test(e)) return !0;
|
|
26
26
|
}
|
|
27
27
|
return !1;
|
|
28
28
|
}
|
|
29
|
-
var
|
|
30
|
-
function
|
|
29
|
+
var U = "";
|
|
30
|
+
function ne(e, t) {
|
|
31
31
|
let n = e.length;
|
|
32
32
|
if (n === 0) return {
|
|
33
33
|
order: [],
|
|
@@ -37,9 +37,9 @@ function ee(e, t) {
|
|
|
37
37
|
for (let t = 0; t < n; t++) {
|
|
38
38
|
i[t] = r.length;
|
|
39
39
|
let n = H(e[t]) ?? "";
|
|
40
|
-
r += n.length > 0 ? n :
|
|
40
|
+
r += n.length > 0 ? n : U;
|
|
41
41
|
}
|
|
42
|
-
let a =
|
|
42
|
+
let a = A(), { levels: o, paragraphLevel: s } = a.computeLevels(r, t ? "rtl" : "ltr"), c = new Uint8Array(n);
|
|
43
43
|
for (let e = 0; e < n; e++) {
|
|
44
44
|
let t = o[i[e]];
|
|
45
45
|
c[e] = t === 255 ? s : t;
|
|
@@ -53,17 +53,17 @@ function ee(e, t) {
|
|
|
53
53
|
}
|
|
54
54
|
//#endregion
|
|
55
55
|
//#region packages/pptx/src/renderer.ts
|
|
56
|
-
function
|
|
56
|
+
function W(e, t) {
|
|
57
57
|
return e * t;
|
|
58
58
|
}
|
|
59
|
-
var
|
|
60
|
-
function
|
|
61
|
-
return !e || e.fillType === "none" ? null : e.fillType === "solid" ?
|
|
59
|
+
var G = d;
|
|
60
|
+
function re(e) {
|
|
61
|
+
return !e || e.fillType === "none" ? null : e.fillType === "solid" ? G(e.color) : e.fillType === "gradient" ? e.stops.length > 0 ? G(e.stops[0].color) : null : e.fillType === "pattern" ? G(e.fg) : null;
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
return
|
|
63
|
+
function ie(e, t, n, r, i, o) {
|
|
64
|
+
return a(e, t, n, r, i, o);
|
|
65
65
|
}
|
|
66
|
-
function
|
|
66
|
+
function ae(e, t, n, r, i, a, o) {
|
|
67
67
|
let s = Math.max(1, i * .05), c = o?.endsWith("Heavy") ?? !1 ? s * 1.8 : s, l = n + Math.max(2, c);
|
|
68
68
|
e.strokeStyle = a, e.lineWidth = c, e.setLineDash([]);
|
|
69
69
|
let u = (e) => {
|
|
@@ -118,8 +118,8 @@ function ne(e, t, n, r, i, a, o) {
|
|
|
118
118
|
}
|
|
119
119
|
e.setLineDash(u(o ?? "sng").map((e) => e * c)), e.beginPath(), e.moveTo(t, l), e.lineTo(t + r, l), e.stroke(), e.setLineDash([]);
|
|
120
120
|
}
|
|
121
|
-
var
|
|
122
|
-
function
|
|
121
|
+
var oe = /* @__PURE__ */ new WeakMap();
|
|
122
|
+
function se(e, t) {
|
|
123
123
|
let n = e.tinted.get(t);
|
|
124
124
|
if (n) return n;
|
|
125
125
|
let r = e.img.naturalWidth || 1, i = e.img.naturalHeight || 1, a = document.createElement("canvas");
|
|
@@ -127,18 +127,18 @@ function ie(e, t) {
|
|
|
127
127
|
let o = a.getContext("2d");
|
|
128
128
|
return o ? (o.drawImage(e.img, 0, 0, r, i), o.globalCompositeOperation = "source-in", o.fillStyle = t, o.fillRect(0, 0, r, i), e.tinted.set(t, a), a) : e.img;
|
|
129
129
|
}
|
|
130
|
-
function
|
|
130
|
+
function ce(e) {
|
|
131
131
|
let t = `data:image/svg+xml;charset=utf-8,${encodeURIComponent(e)}`, n = new Image();
|
|
132
132
|
return new Promise((e, r) => {
|
|
133
133
|
n.onload = () => e(n), n.onerror = r, n.src = t;
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
|
-
var
|
|
137
|
-
function
|
|
138
|
-
let r = Math.max(1, Math.round(t *
|
|
136
|
+
var le = 256;
|
|
137
|
+
function ue(e, t, n) {
|
|
138
|
+
let r = Math.max(1, Math.round(t * le)), i = Math.max(1, Math.round(n * le));
|
|
139
139
|
return e.replace(/<svg([^>]*?)>/, (e, t) => `<svg${t.replace(/\s(?:width|height)="[^"]*"/g, "")} width="${r}" height="${i}">`);
|
|
140
140
|
}
|
|
141
|
-
function
|
|
141
|
+
function de(e) {
|
|
142
142
|
let t = [], n = (e) => {
|
|
143
143
|
if (e) for (let n of e.paragraphs) for (let e of n.runs) e.type === "math" && t.push({
|
|
144
144
|
nodes: e.nodes,
|
|
@@ -149,13 +149,13 @@ function ce(e) {
|
|
|
149
149
|
else if (t.type === "table") for (let e of t.rows) for (let t of e.cells) n(t.textBody);
|
|
150
150
|
return t;
|
|
151
151
|
}
|
|
152
|
-
async function
|
|
153
|
-
let n =
|
|
152
|
+
async function fe(e, t) {
|
|
153
|
+
let n = de(e);
|
|
154
154
|
if (n.length !== 0) {
|
|
155
155
|
await t.loadMathJax();
|
|
156
|
-
for (let e of n) if (!
|
|
157
|
-
let n = await t.mathMLToSvg(
|
|
158
|
-
|
|
156
|
+
for (let e of n) if (!oe.has(e.nodes)) try {
|
|
157
|
+
let n = await t.mathMLToSvg(j(e.nodes, e.display)), r = await ce(ue(z(n.svg, "#000000"), n.widthEm, n.ascentEm + n.descentEm));
|
|
158
|
+
oe.set(e.nodes, {
|
|
159
159
|
img: r,
|
|
160
160
|
widthEm: n.widthEm,
|
|
161
161
|
ascentEm: n.ascentEm,
|
|
@@ -165,7 +165,7 @@ async function le(e, t) {
|
|
|
165
165
|
} catch {}
|
|
166
166
|
}
|
|
167
167
|
}
|
|
168
|
-
var
|
|
168
|
+
var pe = {
|
|
169
169
|
33: "✏",
|
|
170
170
|
34: "✂",
|
|
171
171
|
35: "✁",
|
|
@@ -184,14 +184,14 @@ var ue = {
|
|
|
184
184
|
61607: "▪",
|
|
185
185
|
61623: "•"
|
|
186
186
|
};
|
|
187
|
-
function
|
|
187
|
+
function me(e, t) {
|
|
188
188
|
let n = t.toLowerCase();
|
|
189
|
-
return n.includes("wingdings") || n === "symbol" ?
|
|
189
|
+
return n.includes("wingdings") || n === "symbol" ? pe[e.charCodeAt(0)] ?? e : e;
|
|
190
190
|
}
|
|
191
|
-
function
|
|
191
|
+
function K(e, t) {
|
|
192
192
|
return e ? e.startsWith("+") ? e === "+mj-lt" || e === "+mj-ea" || e === "+mj-cs" ? t.themeMajorFont ?? "sans-serif" : t.themeMinorFont ?? "sans-serif" : e.split(",")[0].trim() || (t.themeMinorFont ?? "sans-serif") : t.themeMinorFont ?? "sans-serif";
|
|
193
193
|
}
|
|
194
|
-
var
|
|
194
|
+
var he = new Set([
|
|
195
195
|
"serif",
|
|
196
196
|
"sans-serif",
|
|
197
197
|
"monospace",
|
|
@@ -199,11 +199,11 @@ var fe = new Set([
|
|
|
199
199
|
"fantasy",
|
|
200
200
|
"system-ui"
|
|
201
201
|
]);
|
|
202
|
-
function
|
|
202
|
+
function ge(e) {
|
|
203
203
|
let t = e.toLowerCase();
|
|
204
204
|
return /mono|courier|consolas|等幅|gothic_m/.test(t) ? "monospace" : /mincho|明朝|roman|times|garamond|georgia|palatino|century|didot|song|sung|simsun|nsimsun|batang|gungsuh|mingliu|pmingliu|fangsong|kaiti|simkai|simfang|stsong|stkaiti|新細明|細明|宋体|楷体|楷體|仿宋|標楷|游明朝/.test(t) || /新細明體|細明體|宋体|楷体|楷體|仿宋|標楷體|游明朝/.test(e) ? "serif" : "sans-serif";
|
|
205
205
|
}
|
|
206
|
-
var
|
|
206
|
+
var _e = {
|
|
207
207
|
calibri: "Carlito",
|
|
208
208
|
"calibri light": "Carlito",
|
|
209
209
|
cambria: "Caladea",
|
|
@@ -213,169 +213,169 @@ var me = {
|
|
|
213
213
|
"simplified arabic": "Noto Naskh Arabic",
|
|
214
214
|
"arabic typesetting": "Noto Naskh Arabic",
|
|
215
215
|
"univers next arabic": "Noto Sans Arabic"
|
|
216
|
-
},
|
|
217
|
-
function
|
|
218
|
-
if (
|
|
216
|
+
}, ve = "\"Noto Naskh Arabic\", \"Noto Sans Arabic\"";
|
|
217
|
+
function ye(e) {
|
|
218
|
+
if (_e[e.toLowerCase()]?.includes("Arabic")) return !0;
|
|
219
219
|
let t = e.toLowerCase();
|
|
220
220
|
return /arabic|naskh|kufi|nastaliq|amiri|scheherazade|lateef|aldhabi|urdu|farsi|العرب|[-ۿ]/.test(t);
|
|
221
221
|
}
|
|
222
|
-
function
|
|
222
|
+
function be(e) {
|
|
223
223
|
return e.map((e) => `"${e}"`).join(", ");
|
|
224
224
|
}
|
|
225
|
-
function
|
|
226
|
-
let
|
|
227
|
-
if (
|
|
228
|
-
let
|
|
229
|
-
return `"${e}", ${
|
|
230
|
-
}
|
|
231
|
-
function
|
|
232
|
-
let a = t ? "italic " : "", o = e ? "bold " : "", s =
|
|
233
|
-
return
|
|
234
|
-
}
|
|
235
|
-
function
|
|
236
|
-
let
|
|
237
|
-
for (let
|
|
238
|
-
let
|
|
239
|
-
for (let
|
|
240
|
-
if (
|
|
241
|
-
let
|
|
242
|
-
if (
|
|
225
|
+
function xe(e) {
|
|
226
|
+
let n = ge(e), r = _e[e.toLowerCase()], i = r ? `"${r}", ` : "";
|
|
227
|
+
if (ye(e)) return `"${e}", ${i}${ve}, ${n}`;
|
|
228
|
+
let a = n === "serif" ? "serif" : "sans", o = t(e);
|
|
229
|
+
return `"${e}", ${i}${o ? `${be(R(o, a))}, ` : ""}${`${be(a === "serif" ? c : s)}, `}${n}`;
|
|
230
|
+
}
|
|
231
|
+
function q(e, t, n, r, i) {
|
|
232
|
+
let a = t ? "italic " : "", o = e ? "bold " : "", s = K(r, i);
|
|
233
|
+
return he.has(s) ? `${a}${o}${n}px ${s}` : `${a}${o}${n}px ${xe(s)}`;
|
|
234
|
+
}
|
|
235
|
+
function Se(t, n, r, i, a, o, s) {
|
|
236
|
+
let c = (n.defaultFontSize ?? 18) * e * o;
|
|
237
|
+
for (let l of n.paragraphs) {
|
|
238
|
+
let u = W(l.marL, o), d = W(l.marR, o), f = W(l.indent, o), p = Math.max(0, f), m = r - i - a - u - d - p, h = 0;
|
|
239
|
+
for (let r of l.runs) {
|
|
240
|
+
if (r.type !== "text") continue;
|
|
241
|
+
let i = r.fontSize == null ? l.defFontSize == null ? c : l.defFontSize * e * o : r.fontSize * e * o, a = K(r.fontFamily ?? l.defFontFamily ?? null, s);
|
|
242
|
+
if (t.font = q(r.bold ?? l.defBold ?? n.defaultBold ?? !1, r.italic ?? l.defItalic ?? n.defaultItalic ?? !1, i, a, s), h += t.measureText(r.text).width, h > m) return !0;
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
return !1;
|
|
246
246
|
}
|
|
247
|
-
function
|
|
247
|
+
function Ce(t, n, r, i, a, o, s, c = !1, l = !1, u = 1, d, f = {
|
|
248
248
|
themeMajorFont: null,
|
|
249
249
|
themeMinorFont: null
|
|
250
250
|
}) {
|
|
251
|
-
let
|
|
252
|
-
|
|
253
|
-
},
|
|
254
|
-
if (!
|
|
255
|
-
|
|
256
|
-
let l = c?.letterSpacingPx ?? 0, u =
|
|
257
|
-
if (
|
|
258
|
-
let
|
|
259
|
-
c && y(c) ? c.text +=
|
|
260
|
-
text:
|
|
251
|
+
let p = [], m = { segments: [] }, h = 0, g = !1, _ = !1, v = 0, y = () => {
|
|
252
|
+
p.push(m), m = { segments: [] }, h = 0, _ = !1, g = !1;
|
|
253
|
+
}, b = (e, n, r, i, a, o, s, c) => {
|
|
254
|
+
if (!e) return;
|
|
255
|
+
t.font = n;
|
|
256
|
+
let l = c?.letterSpacingPx ?? 0, u = t.measureText(e).width + l * e.length, d = c?.strikeDouble, f = c?.underlineStyle, p = c?.underlineColor, g = c?.shadow, v = c?.outline, y = (e) => !e.math && e.font === n && e.color === i && e.underline === a && (e.underlineStyle ?? "") === (f ?? "") && (e.underlineColor ?? "") === (p ?? "") && e.strikethrough === o && (e.strikeDouble ?? !1) === (d ?? !1) && (e.letterSpacingPx ?? 0) === l && e.baseline === s && e.shadow === g && e.outline === v;
|
|
257
|
+
if (_ && m.tabStop) {
|
|
258
|
+
let t = m.tabStop.segments, c = t.at(-1);
|
|
259
|
+
c && y(c) ? c.text += e : t.push({
|
|
260
|
+
text: e,
|
|
261
261
|
font: n,
|
|
262
262
|
sizePx: r,
|
|
263
263
|
color: i,
|
|
264
264
|
underline: a,
|
|
265
265
|
underlineStyle: f,
|
|
266
|
-
underlineColor:
|
|
266
|
+
underlineColor: p,
|
|
267
267
|
strikethrough: o,
|
|
268
268
|
strikeDouble: d,
|
|
269
269
|
letterSpacingPx: l || void 0,
|
|
270
270
|
baseline: s,
|
|
271
|
-
shadow:
|
|
271
|
+
shadow: g,
|
|
272
272
|
outline: v
|
|
273
273
|
});
|
|
274
274
|
} else {
|
|
275
|
-
|
|
276
|
-
let
|
|
277
|
-
|
|
278
|
-
text:
|
|
275
|
+
h += u;
|
|
276
|
+
let t = m.segments.at(-1);
|
|
277
|
+
t && y(t) ? t.text += e : m.segments.push({
|
|
278
|
+
text: e,
|
|
279
279
|
font: n,
|
|
280
280
|
sizePx: r,
|
|
281
281
|
color: i,
|
|
282
282
|
underline: a,
|
|
283
283
|
underlineStyle: f,
|
|
284
|
-
underlineColor:
|
|
284
|
+
underlineColor: p,
|
|
285
285
|
strikethrough: o,
|
|
286
286
|
strikeDouble: d,
|
|
287
287
|
letterSpacingPx: l || void 0,
|
|
288
288
|
baseline: s,
|
|
289
|
-
shadow:
|
|
289
|
+
shadow: g,
|
|
290
290
|
outline: v
|
|
291
291
|
});
|
|
292
292
|
}
|
|
293
293
|
};
|
|
294
|
-
for (let
|
|
295
|
-
if (
|
|
296
|
-
|
|
294
|
+
for (let p of n.runs) {
|
|
295
|
+
if (p.type === "break") {
|
|
296
|
+
y();
|
|
297
297
|
continue;
|
|
298
298
|
}
|
|
299
|
-
if (
|
|
300
|
-
let
|
|
301
|
-
(
|
|
299
|
+
if (p.type === "math") {
|
|
300
|
+
let t = oe.get(p.nodes), n = p.fontSize == null ? i : p.fontSize * e * o * u, s = t ? t.widthEm * n : 0, c = t ? t.ascentEm * n : 0, l = t ? t.descentEm * n : 0;
|
|
301
|
+
(p.display && h > 0 || h + s > r && h > 0) && y(), m.segments.push({
|
|
302
302
|
text: "",
|
|
303
|
-
font: `${
|
|
304
|
-
sizePx:
|
|
305
|
-
color:
|
|
303
|
+
font: `${n}px sans-serif`,
|
|
304
|
+
sizePx: n,
|
|
305
|
+
color: p.color ? G(p.color) : a,
|
|
306
306
|
underline: !1,
|
|
307
307
|
strikethrough: !1,
|
|
308
308
|
math: {
|
|
309
|
-
nodes:
|
|
310
|
-
display:
|
|
311
|
-
width:
|
|
312
|
-
ascent:
|
|
313
|
-
descent:
|
|
309
|
+
nodes: p.nodes,
|
|
310
|
+
display: p.display,
|
|
311
|
+
width: s,
|
|
312
|
+
ascent: c,
|
|
313
|
+
descent: l
|
|
314
314
|
}
|
|
315
|
-
}),
|
|
315
|
+
}), h += s, p.display && y();
|
|
316
316
|
continue;
|
|
317
317
|
}
|
|
318
|
-
let
|
|
319
|
-
|
|
320
|
-
let
|
|
321
|
-
|
|
322
|
-
let k =
|
|
318
|
+
let x = p.fontSize == null ? i : p.fontSize * e * o * u, S = K(p.fontFamily ?? n.defFontFamily ?? null, f), C = p.fontFamilyEa ? K(p.fontFamilyEa, f) : null, w;
|
|
319
|
+
w = p.color ? G(p.color) : p.hyperlink && f.themeHlinkColor ? G(f.themeHlinkColor) : a;
|
|
320
|
+
let T = p.bold ?? n.defBold ?? c, E = p.italic ?? n.defItalic ?? l, D = q(T, E, x, S, f), O = C ? q(T, E, x, C, f) : D;
|
|
321
|
+
t.font = D;
|
|
322
|
+
let k = p.caps, A = p.text;
|
|
323
323
|
(k === "all" || k === "small") && (A = A.toUpperCase());
|
|
324
|
-
let j =
|
|
325
|
-
strikeDouble:
|
|
326
|
-
letterSpacingPx:
|
|
327
|
-
underlineStyle:
|
|
328
|
-
underlineColor:
|
|
329
|
-
shadow:
|
|
330
|
-
outline:
|
|
324
|
+
let j = p.fieldType === "slidenum" && d !== void 0 ? String(d) : A, M = p.underline || p.hyperlink !== void 0, N = {
|
|
325
|
+
strikeDouble: p.strikeDouble === !0,
|
|
326
|
+
letterSpacingPx: p.letterSpacing == null ? 0 : p.letterSpacing * e * o,
|
|
327
|
+
underlineStyle: p.underlineStyle,
|
|
328
|
+
underlineColor: p.underlineColor ? G(p.underlineColor) : void 0,
|
|
329
|
+
shadow: p.shadow,
|
|
330
|
+
outline: p.outline
|
|
331
331
|
}, P = j.split(/(\s+)/);
|
|
332
|
-
for (let
|
|
333
|
-
if (!
|
|
334
|
-
if (/^\t+$/.test(
|
|
335
|
-
let e =
|
|
336
|
-
|
|
337
|
-
px:
|
|
338
|
-
algn:
|
|
332
|
+
for (let e of P) {
|
|
333
|
+
if (!e) continue;
|
|
334
|
+
if (/^\t+$/.test(e)) {
|
|
335
|
+
let e = s + h, t = (n.tabStops ?? []).find((t) => W(t.pos, o) > e);
|
|
336
|
+
t ? (v = W(t.pos, o), t.algn === "r" || t.algn === "ctr" ? (_ = !0, m.tabStop = {
|
|
337
|
+
px: v,
|
|
338
|
+
algn: t.algn,
|
|
339
339
|
segments: []
|
|
340
|
-
}) :
|
|
340
|
+
}) : h = v - s) : b(" ", D, x, w, M, p.strikethrough, void 0, N);
|
|
341
341
|
continue;
|
|
342
342
|
}
|
|
343
|
-
|
|
344
|
-
let i =
|
|
345
|
-
if (
|
|
346
|
-
|
|
343
|
+
t.font = D;
|
|
344
|
+
let i = t.measureText(e).width, a = /^\s+$/.test(e);
|
|
345
|
+
if (_) {
|
|
346
|
+
b(e, D, x, w, M, p.strikethrough, p.baseline ?? void 0, N);
|
|
347
347
|
continue;
|
|
348
348
|
}
|
|
349
349
|
let c = /[\u3000-\u9FFF\uAC00-\uD7FF\uF900-\uFAFF\uFF00-\uFFEF]/;
|
|
350
|
-
if (c.test(
|
|
351
|
-
for (let
|
|
352
|
-
let
|
|
353
|
-
|
|
354
|
-
let i =
|
|
355
|
-
|
|
350
|
+
if (c.test(e)) {
|
|
351
|
+
for (let n of e) {
|
|
352
|
+
let e = c.test(n) ? O : D;
|
|
353
|
+
t.font = e;
|
|
354
|
+
let i = t.measureText(n).width;
|
|
355
|
+
h + i > r && h > 0 && y(), b(n, e, x, w, M, p.strikethrough, p.baseline ?? void 0, N);
|
|
356
356
|
}
|
|
357
357
|
continue;
|
|
358
358
|
}
|
|
359
|
-
if (
|
|
360
|
-
else if (
|
|
361
|
-
else if (i >
|
|
362
|
-
|
|
363
|
-
for (let
|
|
364
|
-
|
|
365
|
-
let
|
|
366
|
-
|
|
359
|
+
if (h + i <= r) b(e, D, x, w, M, p.strikethrough, p.baseline ?? void 0, N), a && (g = !0);
|
|
360
|
+
else if (a) h > 0 && y();
|
|
361
|
+
else if (i > r) {
|
|
362
|
+
h > 0 && y();
|
|
363
|
+
for (let n of e) {
|
|
364
|
+
t.font = D;
|
|
365
|
+
let e = t.measureText(n).width;
|
|
366
|
+
h + e > r && h > 0 && y(), b(n, D, x, w, M, p.strikethrough, p.baseline ?? void 0, N);
|
|
367
367
|
}
|
|
368
|
-
} else
|
|
368
|
+
} else g && y(), b(e, D, x, w, M, p.strikethrough, p.baseline ?? void 0, N);
|
|
369
369
|
}
|
|
370
370
|
}
|
|
371
|
-
return
|
|
371
|
+
return p.push(m), p;
|
|
372
372
|
}
|
|
373
|
-
async function
|
|
373
|
+
async function we(e, t, n, r, i) {
|
|
374
374
|
if (t && t.fillType === "image") {
|
|
375
375
|
e.fillStyle = "#FFFFFF", e.fillRect(0, 0, n, r);
|
|
376
376
|
try {
|
|
377
|
-
let a = await
|
|
378
|
-
if (e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile)
|
|
377
|
+
let a = await Ue(t.dataUrl);
|
|
378
|
+
if (e.save(), e.beginPath(), e.rect(0, 0, n, r), e.clip(), t.alpha != null && (e.globalAlpha = t.alpha), t.tile) De(e, a, t.tile, n, r, i);
|
|
379
379
|
else {
|
|
380
380
|
let i = t.fillRect ?? {}, o = i.l ?? 0, s = i.t ?? 0, c = i.r ?? 0, l = i.b ?? 0, u = o * n, d = s * r, f = n * (1 - o - c), p = r * (1 - s - l);
|
|
381
381
|
e.drawImage(a, u, d, f, p);
|
|
@@ -384,10 +384,10 @@ async function xe(e, t, n, r, i) {
|
|
|
384
384
|
} catch {}
|
|
385
385
|
return;
|
|
386
386
|
}
|
|
387
|
-
e.fillStyle =
|
|
387
|
+
e.fillStyle = ie(t, e, 0, 0, n, r) ?? "#FFFFFF", e.fillRect(0, 0, n, r);
|
|
388
388
|
}
|
|
389
|
-
var
|
|
390
|
-
function
|
|
389
|
+
var Te = 9525;
|
|
390
|
+
function Ee(e, t, n, r, i) {
|
|
391
391
|
let a;
|
|
392
392
|
a = e === "t" || e === "ctr" || e === "b" ? (t - r) / 2 : e === "tr" || e === "r" || e === "br" ? t - r : 0;
|
|
393
393
|
let o;
|
|
@@ -396,8 +396,8 @@ function Ce(e, t, n, r, i) {
|
|
|
396
396
|
ay: o
|
|
397
397
|
};
|
|
398
398
|
}
|
|
399
|
-
function
|
|
400
|
-
let o = t.width *
|
|
399
|
+
function De(e, t, n, r, i, a) {
|
|
400
|
+
let o = t.width * Te * n.sx * a, s = t.height * Te * n.sy * a;
|
|
401
401
|
if (!(o > 0) || !(s > 0)) return;
|
|
402
402
|
let c = n.flip === "x" || n.flip === "xy", l = n.flip === "y" || n.flip === "xy", u = y(o * (c ? 2 : 1), s * (l ? 2 : 1));
|
|
403
403
|
if (!u) return;
|
|
@@ -409,21 +409,21 @@ function we(e, t, n, r, i, a) {
|
|
|
409
409
|
f(0, 0, !1, !1), c && f(o, 0, !0, !1), l && f(0, s, !1, !0), c && l && f(o, s, !0, !0);
|
|
410
410
|
let p = e.createPattern(u, "repeat");
|
|
411
411
|
if (!p) return;
|
|
412
|
-
let { ax: m, ay: h } =
|
|
412
|
+
let { ax: m, ay: h } = Ee(n.algn, r, i, o, s), g = m + W(n.tx, a), _ = h + W(n.ty, a);
|
|
413
413
|
typeof p.setTransform == "function" && typeof DOMMatrix < "u" ? (p.setTransform(new DOMMatrix().translateSelf(g, _)), e.fillStyle = p, e.fillRect(0, 0, r, i)) : (e.save(), e.translate(g, _), e.fillStyle = p, e.fillRect(-g, -_, r, i), e.restore());
|
|
414
414
|
}
|
|
415
|
-
function
|
|
415
|
+
function Oe(e, t, n) {
|
|
416
416
|
if (!t) return;
|
|
417
|
-
let r = t.dir * Math.PI / 180, i =
|
|
418
|
-
e.shadowColor =
|
|
417
|
+
let r = t.dir * Math.PI / 180, i = W(t.dist, n);
|
|
418
|
+
e.shadowColor = G(t.color, t.alpha), e.shadowBlur = W(t.blur, n), e.shadowOffsetX = Math.cos(r) * i, e.shadowOffsetY = Math.sin(r) * i;
|
|
419
419
|
}
|
|
420
|
-
function
|
|
421
|
-
t && (e.shadowColor =
|
|
420
|
+
function ke(e, t, n) {
|
|
421
|
+
t && (e.shadowColor = G(t.color, t.alpha), e.shadowBlur = W(t.radius, n), e.shadowOffsetX = 0, e.shadowOffsetY = 0);
|
|
422
422
|
}
|
|
423
|
-
function
|
|
423
|
+
function Ae(e) {
|
|
424
424
|
e.shadowColor = "transparent", e.shadowBlur = 0, e.shadowOffsetX = 0, e.shadowOffsetY = 0;
|
|
425
425
|
}
|
|
426
|
-
function
|
|
426
|
+
function je(e, t, n, r, i, a, o) {
|
|
427
427
|
let s = Math.min(r, i);
|
|
428
428
|
switch (e) {
|
|
429
429
|
case "rightarrow":
|
|
@@ -453,22 +453,22 @@ function Oe(e, t, n, r, i, a, o) {
|
|
|
453
453
|
default: return null;
|
|
454
454
|
}
|
|
455
455
|
}
|
|
456
|
-
function
|
|
456
|
+
function Me(e, t, r, a = "#000000", o, s = {
|
|
457
457
|
themeMajorFont: null,
|
|
458
458
|
themeMinorFont: null
|
|
459
|
-
},
|
|
460
|
-
let
|
|
461
|
-
if (
|
|
462
|
-
if (t.stroke && (e.save(),
|
|
463
|
-
let n = t.defaultTextColor ?
|
|
464
|
-
|
|
459
|
+
}, c) {
|
|
460
|
+
let l = W(t.x, r), u = W(t.y, r), d = W(t.width, r), f = W(t.height, r);
|
|
461
|
+
if (f === 0 && t.textBody?.verticalAnchor === "b") {
|
|
462
|
+
if (t.stroke && (e.save(), X(e, t.stroke, r), e.beginPath(), e.moveTo(l, u), e.lineTo(l + d, u), e.stroke(), e.restore()), t.textBody) {
|
|
463
|
+
let n = t.defaultTextColor ? G(t.defaultTextColor) : null;
|
|
464
|
+
J(e, t.textBody, l, u, d, f, r, n, t.rotation, t.flipH, t.flipV, a, o, s, c);
|
|
465
465
|
}
|
|
466
466
|
return;
|
|
467
467
|
}
|
|
468
|
-
let
|
|
469
|
-
if (
|
|
470
|
-
let n = e.getTransform(),
|
|
471
|
-
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(
|
|
468
|
+
let h = t.scene3d && C(t.scene3d.camera) ? t.scene3d : null;
|
|
469
|
+
if (h && d > 0 && f > 0) {
|
|
470
|
+
let n = e.getTransform(), i = Math.abs(n.a * n.d - n.b * n.c), c = i > 0 ? Math.sqrt(i) : 1, p = ze(t.sp3d, t.scene3d?.lightRig, t.sp3d?.prstMaterial, r, c), m = Be(t.sp3d, h.camera, d, f, r, c);
|
|
471
|
+
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(l + d / 2, u + f / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(l + d / 2), -(u + f / 2)));
|
|
472
472
|
let g = {
|
|
473
473
|
...t,
|
|
474
474
|
x: 0,
|
|
@@ -478,22 +478,22 @@ function ke(e, t, r, i = "#000000", a, o = {
|
|
|
478
478
|
flipV: !1,
|
|
479
479
|
scene3d: void 0
|
|
480
480
|
};
|
|
481
|
-
if (
|
|
482
|
-
|
|
481
|
+
if (Ve(e, h.camera, l, u, d, f, (e) => {
|
|
482
|
+
Me(e, g, r, a, o, s, void 0);
|
|
483
483
|
}, {
|
|
484
|
-
bevels:
|
|
485
|
-
extrusion:
|
|
486
|
-
edgePadCss: (t.stroke ? t.stroke.width * r / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * r : 0) + (
|
|
484
|
+
bevels: p,
|
|
485
|
+
extrusion: m ?? void 0,
|
|
486
|
+
edgePadCss: (t.stroke ? t.stroke.width * r / 2 : 0) + (t.sp3d?.contourW ? t.sp3d.contourW * r : 0) + (m ? Math.hypot(m.offsetX, m.offsetY) / c : 0) + 2
|
|
487
487
|
})) {
|
|
488
488
|
e.restore();
|
|
489
489
|
return;
|
|
490
490
|
}
|
|
491
491
|
e.restore();
|
|
492
492
|
}
|
|
493
|
-
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(
|
|
494
|
-
let
|
|
495
|
-
|
|
496
|
-
let
|
|
493
|
+
e.save(), (t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(l + d / 2, u + f / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(l + d / 2), -(u + f / 2)));
|
|
494
|
+
let g = t.geometry.toLowerCase(), v = ie(t.fill, e, l, u, d, f);
|
|
495
|
+
Oe(e, t.shadow ?? null, r), t.shadow || ke(e, t.glow ?? null, r);
|
|
496
|
+
let y = new Set([
|
|
497
497
|
"line",
|
|
498
498
|
"straightconnector1",
|
|
499
499
|
"bentconnector2",
|
|
@@ -504,17 +504,17 @@ function ke(e, t, r, i = "#000000", a, o = {
|
|
|
504
504
|
"curvedconnector3",
|
|
505
505
|
"curvedconnector4",
|
|
506
506
|
"curvedconnector5"
|
|
507
|
-
]),
|
|
507
|
+
]), b = new Set([
|
|
508
508
|
"callout1",
|
|
509
509
|
"bordercallout1",
|
|
510
510
|
"accentcallout1",
|
|
511
511
|
"accentbordercallout1"
|
|
512
|
-
]),
|
|
513
|
-
let
|
|
514
|
-
|
|
515
|
-
} : null,
|
|
516
|
-
if (
|
|
517
|
-
|
|
512
|
+
]), x = !t.custGeom && g !== "arc" && n(g), S = (e, n) => {
|
|
513
|
+
let a = n ?? v, o = n ? null : t.stroke ? () => {
|
|
514
|
+
X(e, t.stroke, r), e.stroke();
|
|
515
|
+
} : null, s = () => Ae(e);
|
|
516
|
+
if (x && !n) {
|
|
517
|
+
I(e, g, l, u, d, f, [
|
|
518
518
|
t.adj,
|
|
519
519
|
t.adj2,
|
|
520
520
|
t.adj3,
|
|
@@ -523,28 +523,28 @@ function ke(e, t, r, i = "#000000", a, o = {
|
|
|
523
523
|
t.adj6,
|
|
524
524
|
t.adj7,
|
|
525
525
|
t.adj8
|
|
526
|
-
],
|
|
526
|
+
], a, o, s);
|
|
527
527
|
return;
|
|
528
528
|
}
|
|
529
|
-
e.beginPath(), t.custGeom && t.custGeom.length > 0 ?
|
|
530
|
-
},
|
|
531
|
-
x:
|
|
532
|
-
y:
|
|
533
|
-
w:
|
|
534
|
-
h:
|
|
535
|
-
},
|
|
536
|
-
e.setTransform(
|
|
529
|
+
e.beginPath(), t.custGeom && t.custGeom.length > 0 ? Ne(e, t.custGeom, l, u, d, f) : i(e, g, l, u, d, f, t.adj, t.adj2, t.adj3, t.adj4), a && g !== "arc" && (e.fillStyle = a, g === "donut" || g === "smileyface" || g === "frame" ? e.fill("evenodd") : e.fill(), n || s()), o && o();
|
|
530
|
+
}, w = e.canvas.width || 0, T = e.canvas.height || 0, E = e.getTransform(), D = Math.abs(E.a * E.d - E.b * E.c), O = D > 0 ? Math.sqrt(D) : 1, k = {
|
|
531
|
+
x: l * O,
|
|
532
|
+
y: u * O,
|
|
533
|
+
w: d * O,
|
|
534
|
+
h: f * O
|
|
535
|
+
}, A = r * O, j = (e) => {
|
|
536
|
+
e.setTransform(E);
|
|
537
537
|
};
|
|
538
|
-
if (t.reflection &&
|
|
539
|
-
|
|
540
|
-
},
|
|
541
|
-
|
|
542
|
-
},
|
|
543
|
-
|
|
544
|
-
}), e.restore()) :
|
|
545
|
-
|
|
546
|
-
},
|
|
547
|
-
let n =
|
|
538
|
+
if (t.reflection && w > 0 && T > 0 && (e.save(), e.setTransform(new DOMMatrix()), F(e, (e) => {
|
|
539
|
+
j(e), S(e);
|
|
540
|
+
}, k, t.reflection, A, w, T), e.restore()), t.softEdge && w > 0 && T > 0 ? (e.save(), e.setTransform(new DOMMatrix()), L(e, (e) => {
|
|
541
|
+
j(e), S(e);
|
|
542
|
+
}, k, t.softEdge, A, w, T, (e) => {
|
|
543
|
+
j(e), S(e, "#000");
|
|
544
|
+
}), e.restore()) : S(e), t.innerShadow && w > 0 && T > 0 && (e.save(), e.setTransform(new DOMMatrix()), _(e, (e) => {
|
|
545
|
+
j(e), S(e, "#000");
|
|
546
|
+
}, k, t.innerShadow, A, w, T), e.restore()), t.stroke && y.has(g)) {
|
|
547
|
+
let n = p(g, l, u, d, f, [
|
|
548
548
|
t.adj,
|
|
549
549
|
t.adj2,
|
|
550
550
|
t.adj3,
|
|
@@ -556,34 +556,34 @@ function ke(e, t, r, i = "#000000", a, o = {
|
|
|
556
556
|
]);
|
|
557
557
|
if (n) {
|
|
558
558
|
let i = t.stroke.cmpd;
|
|
559
|
-
i && (
|
|
559
|
+
i && (g === "line" || g === "straightconnector1") && Je(e, n.start, n.end, t.stroke, i, r), t.stroke.tailEnd && m(e, n.end.x, n.end.y, n.end.angle, t.stroke.tailEnd, t.stroke, r), t.stroke.headEnd && m(e, n.start.x, n.start.y, n.start.angle, t.stroke.headEnd, t.stroke, r);
|
|
560
560
|
}
|
|
561
|
-
} else if (t.stroke &&
|
|
562
|
-
let n = (t.adj2 ?? -8333) / 1e5, i = (t.adj ?? 18750) / 1e5, a = (t.adj4 ?? -38333) / 1e5, o = (t.adj3 ?? 112500) / 1e5, s =
|
|
563
|
-
t.stroke.tailEnd &&
|
|
561
|
+
} else if (t.stroke && b.has(g)) {
|
|
562
|
+
let n = (t.adj2 ?? -8333) / 1e5, i = (t.adj ?? 18750) / 1e5, a = (t.adj4 ?? -38333) / 1e5, o = (t.adj3 ?? 112500) / 1e5, s = l + n * d, c = u + i * f, p = l + a * d, h = u + o * f, g = Math.atan2(h - c, p - s), _ = g + Math.PI;
|
|
563
|
+
t.stroke.tailEnd && m(e, p, h, g, t.stroke.tailEnd, t.stroke, r), t.stroke.headEnd && m(e, s, c, _, t.stroke.headEnd, t.stroke, r);
|
|
564
564
|
}
|
|
565
565
|
if (t.textBody) {
|
|
566
|
-
let n = t.defaultTextColor ?
|
|
566
|
+
let n = t.defaultTextColor ? G(t.defaultTextColor) : null;
|
|
567
567
|
if (e.save(), t.flipH || t.flipV) {
|
|
568
|
-
let n =
|
|
568
|
+
let n = l + d / 2, r = u + f / 2;
|
|
569
569
|
e.translate(n, r), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-n, -r);
|
|
570
570
|
}
|
|
571
|
-
let
|
|
572
|
-
if (t.textRect)
|
|
573
|
-
else if (
|
|
574
|
-
let e =
|
|
575
|
-
|
|
571
|
+
let i = l, p = u, m = d, h = f;
|
|
572
|
+
if (t.textRect) i = W(t.textRect.x, r), p = W(t.textRect.y, r), m = W(t.textRect.width, r), h = W(t.textRect.height, r);
|
|
573
|
+
else if (g === "ellipse") {
|
|
574
|
+
let e = d * (1 - 1 / Math.SQRT2) / 2, t = f * (1 - 1 / Math.SQRT2) / 2;
|
|
575
|
+
i = l + e, p = u + t, m = d / Math.SQRT2, h = f / Math.SQRT2;
|
|
576
576
|
} else {
|
|
577
|
-
let e =
|
|
578
|
-
e && (
|
|
577
|
+
let e = je(g, l, u, d, f, t.adj, t.adj2);
|
|
578
|
+
e && (i = e.tx, p = e.ty, m = e.tw, h = e.th);
|
|
579
579
|
}
|
|
580
|
-
|
|
580
|
+
J(e, t.textBody, i, p, m, h, r, n, t.rotation, !1, !1, a, o, s, c), e.restore();
|
|
581
581
|
}
|
|
582
582
|
e.restore();
|
|
583
583
|
}
|
|
584
|
-
var
|
|
585
|
-
function
|
|
586
|
-
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a =
|
|
584
|
+
var Ne = r;
|
|
585
|
+
function Pe(e, t) {
|
|
586
|
+
let n = `${e}`, r = e >= 1 && e <= 26 ? String.fromCharCode(96 + e) : n, i = e >= 1 && e <= 26 ? String.fromCharCode(64 + e) : n, a = Fe(e).toLowerCase(), o = Fe(e), s = n.replace(/[0-9]/g, (e) => String.fromCharCode(65296 + (e.charCodeAt(0) - 48)));
|
|
587
587
|
switch (t) {
|
|
588
588
|
case "arabicPlain": return n;
|
|
589
589
|
case "arabicPeriod": return `${n}.`;
|
|
@@ -610,7 +610,7 @@ function je(e, t) {
|
|
|
610
610
|
default: return `${n}.`;
|
|
611
611
|
}
|
|
612
612
|
}
|
|
613
|
-
function
|
|
613
|
+
function Fe(e) {
|
|
614
614
|
let t = [
|
|
615
615
|
1e3,
|
|
616
616
|
900,
|
|
@@ -643,98 +643,98 @@ function Me(e) {
|
|
|
643
643
|
for (let i = 0; i < t.length; i++) for (; e >= t[i];) r += n[i], e -= t[i];
|
|
644
644
|
return r;
|
|
645
645
|
}
|
|
646
|
-
function
|
|
646
|
+
function Ie(e) {
|
|
647
647
|
for (let t of e.runs) if (t.type === "text" && t.text !== "" || t.type === "math") return !0;
|
|
648
648
|
return !1;
|
|
649
649
|
}
|
|
650
|
-
function
|
|
651
|
-
let n =
|
|
652
|
-
if (e.bullet.type === "char") return t.clear(), n ?
|
|
650
|
+
function Le(e, t) {
|
|
651
|
+
let n = Ie(e);
|
|
652
|
+
if (e.bullet.type === "char") return t.clear(), n ? me(e.bullet.char, e.bullet.fontFamily ?? "") : "";
|
|
653
653
|
if (e.bullet.type === "autoNum") {
|
|
654
654
|
if (!n) return "";
|
|
655
655
|
let r = e.lvl;
|
|
656
|
-
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1),
|
|
656
|
+
return t.has(r) ? t.set(r, t.get(r) + 1) : t.set(r, e.bullet.startAt ?? 1), Pe(t.get(r), e.bullet.numType);
|
|
657
657
|
}
|
|
658
658
|
return t.clear(), "";
|
|
659
659
|
}
|
|
660
|
-
function
|
|
660
|
+
function J(t, n, r, i, a, o, s, c = null, l = 0, u = !1, d = !1, f = "#000000", p, m = {
|
|
661
661
|
themeMajorFont: null,
|
|
662
662
|
themeMinorFont: null
|
|
663
|
-
},
|
|
664
|
-
let
|
|
665
|
-
if (
|
|
666
|
-
let
|
|
663
|
+
}, h, g = !1) {
|
|
664
|
+
let _ = n.vert === "vert" || n.vert === "eaVert", v = n.vert === "vert270";
|
|
665
|
+
if (_ || v) {
|
|
666
|
+
let e = r + a / 2, u = i + o / 2, d = _ ? 90 : -90, y = h ? (e) => h({
|
|
667
667
|
...e,
|
|
668
|
-
inShapeX: e.inShapeX -
|
|
669
|
-
inShapeY: e.inShapeY -
|
|
670
|
-
shapeX:
|
|
671
|
-
shapeY:
|
|
672
|
-
shapeW:
|
|
673
|
-
shapeH:
|
|
674
|
-
rotation:
|
|
675
|
-
textBodyRotation:
|
|
668
|
+
inShapeX: e.inShapeX - o / 2 + a / 2,
|
|
669
|
+
inShapeY: e.inShapeY - a / 2 + o / 2,
|
|
670
|
+
shapeX: r,
|
|
671
|
+
shapeY: i,
|
|
672
|
+
shapeW: a,
|
|
673
|
+
shapeH: o,
|
|
674
|
+
rotation: l,
|
|
675
|
+
textBodyRotation: d
|
|
676
676
|
}) : void 0;
|
|
677
|
-
if (
|
|
678
|
-
|
|
679
|
-
...
|
|
677
|
+
if (g) return a;
|
|
678
|
+
t.save(), t.translate(e, u), t.rotate(v ? -Math.PI / 2 : Math.PI / 2), J(t, {
|
|
679
|
+
...n,
|
|
680
680
|
vert: "horz"
|
|
681
|
-
}, -
|
|
681
|
+
}, -o / 2, -a / 2, o, a, s, c, 0, !1, !1, f, p, m, y), t.restore();
|
|
682
682
|
return;
|
|
683
683
|
}
|
|
684
|
-
let
|
|
685
|
-
let
|
|
686
|
-
for (let
|
|
687
|
-
let
|
|
688
|
-
for (let e of
|
|
684
|
+
let y = W(n.lIns, s), b = W(n.rIns, s), x = W(n.tIns, s), S = W(n.bIns, s), C = n.wrap !== "none", w = n.autoFit === "sp" ? C && Se(t, n, a, y, b, s, m) : C, T = Math.max(1, n.numCol ?? 1), E = W(n.spcCol ?? 0, s), D = n.defaultBold ?? !1, O = n.defaultItalic ?? !1, k = c ?? f, A = (i) => {
|
|
685
|
+
let o = (n.defaultFontSize ?? 18) * e * s * i, c = [], l = 0, u = /* @__PURE__ */ new Map();
|
|
686
|
+
for (let d = 0; d < n.paragraphs.length; d++) {
|
|
687
|
+
let f = n.paragraphs[d], h = W(f.marL, s), g = W(f.marR, s), _ = W(f.indent, s), v = f.defFontSize == null ? o : f.defFontSize * e * s * i, x = f.defColor ? G(f.defColor) : k, S = f.bullet.type === "char" || f.bullet.type === "autoNum", C = (() => {
|
|
688
|
+
for (let e of f.runs) if (e.type === "text" && e.fontSize != null) return e.fontSize;
|
|
689
689
|
return null;
|
|
690
|
-
})(), A =
|
|
691
|
-
for (let e of
|
|
690
|
+
})(), A = C == null ? v : C * e * s * i, j = (() => {
|
|
691
|
+
for (let e of f.runs) if (e.type === "text" && e.color) return e.color;
|
|
692
692
|
return null;
|
|
693
|
-
})(), M = j ?
|
|
694
|
-
if (N =
|
|
695
|
-
let e =
|
|
696
|
-
P =
|
|
697
|
-
} else
|
|
698
|
-
let I =
|
|
699
|
-
for (let
|
|
700
|
-
let
|
|
701
|
-
for (let e of
|
|
693
|
+
})(), M = j ? G(j) : x, N = "", P = q(!1, !1, A, "sans-serif", m), F = M;
|
|
694
|
+
if (N = Le(f, u), f.bullet.type === "char") {
|
|
695
|
+
let e = f.bullet;
|
|
696
|
+
P = q(!1, !1, e.sizePct == null ? A : A * (e.sizePct / 100), N === e.char ? K(e.fontFamily ?? null, m) : "sans-serif", m), F = e.color ? G(e.color) : M;
|
|
697
|
+
} else f.bullet.type === "autoNum" && (P = q(!1, !1, A, "sans-serif", m), F = M);
|
|
698
|
+
let I = T > 1 ? (a - y - b - (T - 1) * E) / T : a - y - b, ee = r + y + h, L = r + y + h + _, R = I - h - g, z = Ce(t, f, w ? R : Infinity, v, x, s, h, D, O, i, p, m), B = f.spaceBefore == null ? 0 : f.spaceBefore / 100 * e * s * i, V = f.spaceAfter == null ? 0 : f.spaceAfter / 100 * e * s * i;
|
|
699
|
+
for (let r = 0; r < z.length; r++) {
|
|
700
|
+
let i = z[r], a = r === 0, o = r === z.length - 1, u = 0;
|
|
701
|
+
for (let e of i.segments) {
|
|
702
702
|
let t = e.math ? Math.max(e.sizePx, (e.math.ascent + e.math.descent) / 1.2) : e.sizePx;
|
|
703
|
-
t >
|
|
703
|
+
t > u && (u = t);
|
|
704
704
|
}
|
|
705
|
-
if (
|
|
706
|
-
|
|
707
|
-
let
|
|
708
|
-
n >
|
|
705
|
+
if (u === 0 && (u = v), a && N) {
|
|
706
|
+
t.font = P;
|
|
707
|
+
let e = t.measureText("M"), n = e.actualBoundingBoxAscent + e.actualBoundingBoxDescent;
|
|
708
|
+
n > u && (u = n);
|
|
709
709
|
}
|
|
710
|
-
let
|
|
711
|
-
|
|
712
|
-
let
|
|
713
|
-
|
|
714
|
-
line:
|
|
715
|
-
linePx:
|
|
716
|
-
lineHeight:
|
|
717
|
-
topGapPx:
|
|
718
|
-
textXOffset:
|
|
719
|
-
bulletLabel:
|
|
710
|
+
let p;
|
|
711
|
+
p = f.spaceLine ? f.spaceLine.type === "pct" ? u * 1.2 * (f.spaceLine.val / 1e5) : f.spaceLine.val * e * s : u * 1.2, n.autoFit === "norm" && n.lnSpcReduction != null && (p *= 1 - n.lnSpcReduction);
|
|
712
|
+
let m = p + (o ? V : 0), h = a && d > 0 ? B : 0, g = !S && a ? _ : 0;
|
|
713
|
+
c.push({
|
|
714
|
+
line: i,
|
|
715
|
+
linePx: m,
|
|
716
|
+
lineHeight: p,
|
|
717
|
+
topGapPx: h,
|
|
718
|
+
textXOffset: g,
|
|
719
|
+
bulletLabel: a ? N : "",
|
|
720
720
|
bulletFont: P,
|
|
721
721
|
bulletColor: F,
|
|
722
|
-
bulletX:
|
|
723
|
-
textX:
|
|
724
|
-
textMaxW:
|
|
725
|
-
alignment:
|
|
726
|
-
para:
|
|
727
|
-
}),
|
|
722
|
+
bulletX: L,
|
|
723
|
+
textX: ee,
|
|
724
|
+
textMaxW: R,
|
|
725
|
+
alignment: f.alignment,
|
|
726
|
+
para: f
|
|
727
|
+
}), l += m + h;
|
|
728
728
|
}
|
|
729
729
|
}
|
|
730
730
|
return {
|
|
731
|
-
allLines:
|
|
732
|
-
totalHeight:
|
|
731
|
+
allLines: c,
|
|
732
|
+
totalHeight: l
|
|
733
733
|
};
|
|
734
734
|
}, { allLines: j, totalHeight: M } = A(1);
|
|
735
|
-
if (
|
|
735
|
+
if (n.autoFit === "norm") if (n.fontScale != null && n.fontScale > 0) n.fontScale < 1 && ({allLines: j, totalHeight: M} = A(n.fontScale));
|
|
736
736
|
else {
|
|
737
|
-
let e =
|
|
737
|
+
let e = o - x - S;
|
|
738
738
|
if (M > e && e > 0) {
|
|
739
739
|
let t = .1, n = 1;
|
|
740
740
|
for (let r = 0; r < 6; r++) {
|
|
@@ -744,149 +744,149 @@ function X(e, t, n, r, i, a, o, s = null, c = 0, l = !1, u = !1, d = "#000000",
|
|
|
744
744
|
({allLines: j, totalHeight: M} = A(t));
|
|
745
745
|
}
|
|
746
746
|
}
|
|
747
|
-
if (
|
|
748
|
-
let N =
|
|
749
|
-
|
|
750
|
-
let I,
|
|
751
|
-
I = N === "ctr" ? P +
|
|
752
|
-
let
|
|
753
|
-
for (let
|
|
754
|
-
let { line:
|
|
755
|
-
|
|
756
|
-
let b = (
|
|
757
|
-
for (let
|
|
758
|
-
if (
|
|
759
|
-
D +=
|
|
747
|
+
if (g) return x + M + S;
|
|
748
|
+
let N = n.verticalAnchor ?? "t", P = i, F;
|
|
749
|
+
o === 0 && N === "b" ? (F = x + M + S, P = i - F) : F = n.autoFit === "sp" ? Math.max(o, x + M + S) : o;
|
|
750
|
+
let I, ee = Math.max(0, F - x - S);
|
|
751
|
+
I = N === "ctr" ? P + x + (ee - M) / 2 : N === "b" ? P + F - S - M : P + x, t.save(), t.textAlign = "left", t.textBaseline = "alphabetic";
|
|
752
|
+
let L = I, R = T > 1 ? (a - y - b - (T - 1) * E) / T + E : 0, z = Math.max(0, F - x - S), B = o === 0 || M <= z + .5, V = T > 1 && !B ? Math.ceil(j.length / T) : j.length, H = 0, U = 0;
|
|
753
|
+
for (let e of j) {
|
|
754
|
+
let { line: c, linePx: u, lineHeight: d, topGapPx: f, textXOffset: p, bulletLabel: m, bulletFont: g, bulletColor: _, alignment: v } = e;
|
|
755
|
+
T > 1 && H < T - 1 && U >= V && (H++, U = 0, I = L), I += f, U++;
|
|
756
|
+
let b = (n.rtlCol ? T - 1 - H : H) * R, x = e.textX + b, S = e.bulletX + b, C = e.textMaxW, w = e.para.rtl === !0, E = w || te(c.segments), D = 0, O = d * .8;
|
|
757
|
+
for (let e of c.segments) {
|
|
758
|
+
if (e.math) {
|
|
759
|
+
D += e.math.width, O = Math.max(O, e.math.ascent);
|
|
760
760
|
continue;
|
|
761
761
|
}
|
|
762
|
-
|
|
763
|
-
let n =
|
|
764
|
-
D +=
|
|
762
|
+
t.font = e.font;
|
|
763
|
+
let n = t.measureText(e.text || "M"), r = e.letterSpacingPx ?? 0;
|
|
764
|
+
D += e.text ? n.width + r * e.text.length : 0, n.actualBoundingBoxAscent > 0 && (O = Math.max(O, n.actualBoundingBoxAscent));
|
|
765
765
|
}
|
|
766
766
|
let k = I + O;
|
|
767
|
-
if (
|
|
768
|
-
let
|
|
769
|
-
|
|
770
|
-
let n =
|
|
771
|
-
|
|
772
|
-
} else
|
|
767
|
+
if (m) if (t.font = g, t.fillStyle = _, E && w) {
|
|
768
|
+
let e = t.direction;
|
|
769
|
+
t.direction = "rtl";
|
|
770
|
+
let n = t.measureText(m).width;
|
|
771
|
+
t.fillText(m, x + C + (x - S) - n, k), t.direction = e;
|
|
772
|
+
} else t.fillText(m, S, k);
|
|
773
773
|
let A = x + p, j;
|
|
774
|
-
j =
|
|
775
|
-
let M = E ?
|
|
776
|
-
for (let
|
|
777
|
-
let
|
|
778
|
-
if (E && (
|
|
779
|
-
let
|
|
780
|
-
if (
|
|
781
|
-
let i = k - u.math.ascent, a =
|
|
782
|
-
|
|
774
|
+
j = v === "ctr" ? A + (C - p - D) / 2 : v === "r" ? x + C - D : A;
|
|
775
|
+
let M = E ? ne(c.segments, w) : null, N = c.segments.length;
|
|
776
|
+
for (let e = 0; e < N; e++) {
|
|
777
|
+
let n = M ? M.order[e] : e, u = c.segments[n], f = M ? M.rtl[n] : !1;
|
|
778
|
+
if (E && (t.direction = f ? "rtl" : "ltr"), u.math) {
|
|
779
|
+
let e = oe.get(u.math.nodes), n = u.math.width, r = u.math.ascent + u.math.descent;
|
|
780
|
+
if (e && n > 0 && r > 0) {
|
|
781
|
+
let i = k - u.math.ascent, a = se(e, u.color);
|
|
782
|
+
t.drawImage(a, j, i, n, r);
|
|
783
783
|
}
|
|
784
784
|
j += n;
|
|
785
785
|
continue;
|
|
786
786
|
}
|
|
787
|
-
|
|
788
|
-
let p = k + (u.baseline ? -(u.baseline / 1e5) * u.sizePx : 0),
|
|
787
|
+
t.font = u.font, t.fillStyle = u.color;
|
|
788
|
+
let p = k + (u.baseline ? -(u.baseline / 1e5) * u.sizePx : 0), m = u.letterSpacingPx ?? 0, g = u.shadow;
|
|
789
789
|
if (g) {
|
|
790
|
-
let
|
|
791
|
-
|
|
790
|
+
let e = g.dir * Math.PI / 180, n = W(g.dist, s);
|
|
791
|
+
t.save(), t.shadowColor = G(g.color, g.alpha), t.shadowBlur = W(g.blur, s), t.shadowOffsetX = Math.cos(e) * n, t.shadowOffsetY = Math.sin(e) * n;
|
|
792
792
|
}
|
|
793
|
-
if (
|
|
794
|
-
let
|
|
795
|
-
for (let n of u.text)
|
|
796
|
-
} else if (
|
|
797
|
-
let
|
|
793
|
+
if (m > 0 && u.text.length > 1 && !f) {
|
|
794
|
+
let e = j;
|
|
795
|
+
for (let n of u.text) t.fillText(n, e, p), e += t.measureText(n).width + m;
|
|
796
|
+
} else if (m > 0 && u.text.length > 1) {
|
|
797
|
+
let e = t;
|
|
798
798
|
try {
|
|
799
|
-
|
|
799
|
+
e.letterSpacing = `${m}px`;
|
|
800
800
|
} catch {}
|
|
801
|
-
|
|
801
|
+
t.fillText(u.text, j, p);
|
|
802
802
|
try {
|
|
803
|
-
|
|
803
|
+
e.letterSpacing = "0px";
|
|
804
804
|
} catch {}
|
|
805
|
-
} else
|
|
806
|
-
g &&
|
|
805
|
+
} else t.fillText(u.text, j, p);
|
|
806
|
+
g && t.restore();
|
|
807
807
|
let _ = u.outline;
|
|
808
808
|
if (_ && _.width > 0) {
|
|
809
|
-
if (
|
|
810
|
-
let
|
|
811
|
-
for (let n of u.text)
|
|
812
|
-
} else if (
|
|
813
|
-
let
|
|
809
|
+
if (t.save(), t.lineWidth = Math.max(.5, W(_.width, s)), t.strokeStyle = _.color ? `#${_.color}` : u.color, t.lineJoin = "round", m > 0 && u.text.length > 1 && !f) {
|
|
810
|
+
let e = j;
|
|
811
|
+
for (let n of u.text) t.strokeText(n, e, p), e += t.measureText(n).width + m;
|
|
812
|
+
} else if (m > 0 && u.text.length > 1) {
|
|
813
|
+
let e = t;
|
|
814
814
|
try {
|
|
815
|
-
|
|
815
|
+
e.letterSpacing = `${m}px`;
|
|
816
816
|
} catch {}
|
|
817
|
-
|
|
817
|
+
t.strokeText(u.text, j, p);
|
|
818
818
|
try {
|
|
819
|
-
|
|
819
|
+
e.letterSpacing = "0px";
|
|
820
820
|
} catch {}
|
|
821
|
-
} else
|
|
822
|
-
|
|
821
|
+
} else t.strokeText(u.text, j, p);
|
|
822
|
+
t.restore();
|
|
823
823
|
}
|
|
824
|
-
|
|
825
|
-
let v =
|
|
826
|
-
if (
|
|
824
|
+
t.font = u.font;
|
|
825
|
+
let v = t.measureText(u.text).width + (m > 0 ? m * u.text.length : 0);
|
|
826
|
+
if (h && u.text && h({
|
|
827
827
|
text: u.text,
|
|
828
|
-
inShapeX: j -
|
|
829
|
-
inShapeY: I -
|
|
828
|
+
inShapeX: j - r,
|
|
829
|
+
inShapeY: I - i,
|
|
830
830
|
w: v,
|
|
831
831
|
h: d,
|
|
832
832
|
fontSize: u.sizePx,
|
|
833
833
|
font: u.font,
|
|
834
|
-
shapeX:
|
|
835
|
-
shapeY:
|
|
836
|
-
shapeW:
|
|
837
|
-
shapeH:
|
|
838
|
-
rotation:
|
|
839
|
-
}), u.underline &&
|
|
840
|
-
let
|
|
841
|
-
if (
|
|
842
|
-
let n =
|
|
843
|
-
|
|
844
|
-
} else
|
|
834
|
+
shapeX: r,
|
|
835
|
+
shapeY: i,
|
|
836
|
+
shapeW: a,
|
|
837
|
+
shapeH: o,
|
|
838
|
+
rotation: l
|
|
839
|
+
}), u.underline && ae(t, j, p, v, u.sizePx, u.underlineColor ?? u.color, u.underlineStyle), u.strikethrough) {
|
|
840
|
+
let e = Math.max(1, u.sizePx * .05);
|
|
841
|
+
if (t.strokeStyle = u.color, t.lineWidth = e, t.setLineDash([]), u.strikeDouble) {
|
|
842
|
+
let n = e * .9, r = p - u.sizePx * .32;
|
|
843
|
+
t.beginPath(), t.moveTo(j, r - n), t.lineTo(j + v, r - n), t.moveTo(j, r + n), t.lineTo(j + v, r + n), t.stroke();
|
|
844
|
+
} else t.beginPath(), t.moveTo(j, p - u.sizePx * .32), t.lineTo(j + v, p - u.sizePx * .32), t.stroke();
|
|
845
845
|
}
|
|
846
846
|
j += v;
|
|
847
847
|
}
|
|
848
|
-
if (E && (
|
|
849
|
-
let
|
|
850
|
-
for (let
|
|
851
|
-
|
|
852
|
-
let
|
|
853
|
-
|
|
848
|
+
if (E && (t.direction = "ltr"), c.tabStop && c.tabStop.segments.length > 0) {
|
|
849
|
+
let e = r + y + c.tabStop.px, n = 0;
|
|
850
|
+
for (let e of c.tabStop.segments) {
|
|
851
|
+
t.font = e.font;
|
|
852
|
+
let r = e.letterSpacingPx ?? 0;
|
|
853
|
+
n += t.measureText(e.text).width + r * e.text.length;
|
|
854
854
|
}
|
|
855
855
|
let s;
|
|
856
|
-
s =
|
|
857
|
-
for (let
|
|
858
|
-
|
|
859
|
-
let
|
|
860
|
-
if (
|
|
861
|
-
let
|
|
862
|
-
for (let
|
|
863
|
-
} else
|
|
864
|
-
|
|
865
|
-
let
|
|
866
|
-
|
|
867
|
-
text:
|
|
868
|
-
inShapeX: s -
|
|
869
|
-
inShapeY: I -
|
|
870
|
-
w:
|
|
856
|
+
s = c.tabStop.algn === "r" ? e - n : c.tabStop.algn === "ctr" ? e - n / 2 : e;
|
|
857
|
+
for (let e of c.tabStop.segments) {
|
|
858
|
+
t.font = e.font, t.fillStyle = e.color;
|
|
859
|
+
let n = e.letterSpacingPx ?? 0;
|
|
860
|
+
if (n > 0 && e.text.length > 1) {
|
|
861
|
+
let r = s;
|
|
862
|
+
for (let i of e.text) t.fillText(i, r, k), r += t.measureText(i).width + n;
|
|
863
|
+
} else t.fillText(e.text, s, k);
|
|
864
|
+
t.font = e.font;
|
|
865
|
+
let c = t.measureText(e.text).width + n * e.text.length;
|
|
866
|
+
h && e.text && h({
|
|
867
|
+
text: e.text,
|
|
868
|
+
inShapeX: s - r,
|
|
869
|
+
inShapeY: I - i,
|
|
870
|
+
w: c,
|
|
871
871
|
h: d,
|
|
872
|
-
fontSize:
|
|
873
|
-
font:
|
|
874
|
-
shapeX:
|
|
875
|
-
shapeY:
|
|
876
|
-
shapeW:
|
|
877
|
-
shapeH:
|
|
878
|
-
rotation:
|
|
879
|
-
}), s +=
|
|
872
|
+
fontSize: e.sizePx,
|
|
873
|
+
font: e.font,
|
|
874
|
+
shapeX: r,
|
|
875
|
+
shapeY: i,
|
|
876
|
+
shapeW: a,
|
|
877
|
+
shapeH: o,
|
|
878
|
+
rotation: l
|
|
879
|
+
}), s += c;
|
|
880
880
|
}
|
|
881
881
|
}
|
|
882
882
|
I += u;
|
|
883
883
|
}
|
|
884
|
-
|
|
884
|
+
t.restore();
|
|
885
885
|
}
|
|
886
|
-
var
|
|
887
|
-
function
|
|
886
|
+
var Re = 256, Y = /* @__PURE__ */ new Map();
|
|
887
|
+
function ze(e, t, n, r, i) {
|
|
888
888
|
if (!e) return [];
|
|
889
|
-
let a =
|
|
889
|
+
let a = P(t?.rig ?? "threePt", t?.dir ?? "t", t?.rot), o = x(n), s = r * i, c = [];
|
|
890
890
|
return e.bevelT && e.bevelT.w > 0 && e.bevelT.h > 0 && c.push({
|
|
891
891
|
widthPx: e.bevelT.w * s,
|
|
892
892
|
heightPx: e.bevelT.h * s,
|
|
@@ -902,9 +902,9 @@ function Ie(e, t, n, r, i) {
|
|
|
902
902
|
bottom: !0
|
|
903
903
|
}), c;
|
|
904
904
|
}
|
|
905
|
-
function
|
|
905
|
+
function Be(e, t, n, r, i, a) {
|
|
906
906
|
if (!e || !e.extrusionH || e.extrusionH <= 0) return null;
|
|
907
|
-
let o = e.extrusionH * i * a, s =
|
|
907
|
+
let o = e.extrusionH * i * a, s = k(t, n * a, r * a, o);
|
|
908
908
|
if (Math.hypot(s.x, s.y) < .75) return null;
|
|
909
909
|
let c = [
|
|
910
910
|
64,
|
|
@@ -925,24 +925,24 @@ function Le(e, t, n, r, i, a) {
|
|
|
925
925
|
rgb: c
|
|
926
926
|
};
|
|
927
927
|
}
|
|
928
|
-
function
|
|
928
|
+
function Ve(e, t, n, r, i, a, o, s = {}) {
|
|
929
929
|
if (i <= 0 || a <= 0) return !1;
|
|
930
930
|
let c = e.getTransform(), l = Math.abs(c.a * c.d - c.b * c.c), u = l > 0 ? Math.sqrt(l) : 1, d = Math.max(0, Math.ceil((s.edgePadCss ?? 0) * u)), f = w(t, i, a), p = f.corners;
|
|
931
931
|
if (d > 0) {
|
|
932
|
-
let e = d / u, t =
|
|
932
|
+
let e = d / u, t = M(f.corners, e / i, e / a);
|
|
933
933
|
t ? p = t : d = 0;
|
|
934
934
|
}
|
|
935
935
|
let m = d / u, h = Math.max(1, Math.ceil(i * u) + 2 * d), g = Math.max(1, Math.ceil(a * u) + 2 * d), _ = y(h, g);
|
|
936
936
|
if (!_) return !1;
|
|
937
937
|
let v = _.getContext("2d");
|
|
938
938
|
if (!v) return !1;
|
|
939
|
-
if (v.save(), v.scale(u, u), v.translate(m, m), o(v, 0, 0, i, a), v.restore(), s.extrusion &&
|
|
939
|
+
if (v.save(), v.scale(u, u), v.translate(m, m), o(v, 0, 0, i, a), v.restore(), s.extrusion && O(v, s.extrusion), s.bevels && s.bevels.length > 0) for (let e of s.bevels) b(v, e);
|
|
940
940
|
return s.paintEdges && (v.save(), v.scale(u, u), v.translate(m, m), s.paintEdges(v, 0, 0, i, a), v.restore()), S(_, e, h, g, p.map((e) => ({
|
|
941
941
|
x: n + e.x,
|
|
942
942
|
y: r + e.y
|
|
943
943
|
}))), !0;
|
|
944
944
|
}
|
|
945
|
-
function
|
|
945
|
+
function He(e, t, n, r, i, a, o, s, c = 0) {
|
|
946
946
|
if (r <= 0 || i <= 0 || a.length === 0) return !1;
|
|
947
947
|
let l = e.getTransform(), u = Math.abs(l.a * l.d - l.b * l.c), d = u > 0 ? Math.sqrt(u) : 1, f = Math.max(0, Math.ceil(c * d)), p = f / d, m = Math.max(1, Math.ceil(r * d) + 2 * f), h = Math.max(1, Math.ceil(i * d) + 2 * f), g = y(m, h);
|
|
948
948
|
if (!g) return !1;
|
|
@@ -952,31 +952,31 @@ function ze(e, t, n, r, i, a, o, s, c = 0) {
|
|
|
952
952
|
for (let e of a) b(_, e);
|
|
953
953
|
return s && (_.save(), _.scale(d, d), _.translate(p, p), s(_, 0, 0, r, i), _.restore()), e.drawImage(g, t - p, n - p, m / d, h / d), !0;
|
|
954
954
|
}
|
|
955
|
-
function
|
|
956
|
-
let t =
|
|
957
|
-
if (t) return
|
|
955
|
+
function Ue(e) {
|
|
956
|
+
let t = Y.get(e);
|
|
957
|
+
if (t) return Y.delete(e), Y.set(e, t), t;
|
|
958
958
|
let n = fetch(e).then((e) => e.blob()).then((e) => createImageBitmap(e));
|
|
959
|
-
if (n.catch(() =>
|
|
960
|
-
let e =
|
|
961
|
-
|
|
959
|
+
if (n.catch(() => Y.delete(e)), Y.set(e, n), Y.size > Re) {
|
|
960
|
+
let e = Y.keys().next().value, t = Y.get(e);
|
|
961
|
+
Y.delete(e), t?.then((e) => e.close()).catch(() => {});
|
|
962
962
|
}
|
|
963
963
|
return n;
|
|
964
964
|
}
|
|
965
|
-
var
|
|
966
|
-
function
|
|
967
|
-
let n =
|
|
965
|
+
var We = /* @__PURE__ */ new WeakMap();
|
|
966
|
+
function Ge(e, t) {
|
|
967
|
+
let n = We.get(e);
|
|
968
968
|
if (n) return n;
|
|
969
969
|
let r = (async () => {
|
|
970
970
|
let n = await t(e.posterPath), r = e.posterMimeType ? new Blob([n], { type: e.posterMimeType }) : n;
|
|
971
971
|
return createImageBitmap(r);
|
|
972
972
|
})();
|
|
973
|
-
return
|
|
973
|
+
return We.set(e, r), r;
|
|
974
974
|
}
|
|
975
|
-
async function
|
|
975
|
+
async function Ke(e, t, n) {
|
|
976
976
|
try {
|
|
977
|
-
let r = await
|
|
977
|
+
let r = await Ue(t.dataUrl);
|
|
978
978
|
e.save(), t.alpha != null && (e.globalAlpha *= t.alpha);
|
|
979
|
-
let i =
|
|
979
|
+
let i = W(t.x, n), a = W(t.y, n), o = W(t.width, n), s = W(t.height, n);
|
|
980
980
|
(t.rotation !== 0 || t.flipH || t.flipV) && (e.translate(i + o / 2, a + s / 2), e.rotate(t.rotation * Math.PI / 180), t.flipH && e.scale(-1, 1), t.flipV && e.scale(1, -1), e.translate(-(i + o / 2), -(a + s / 2)));
|
|
981
981
|
let c = t.srcRect, l = null;
|
|
982
982
|
if (c && (c.l || c.t || c.r || c.b)) {
|
|
@@ -989,20 +989,20 @@ async function Ue(e, t, n) {
|
|
|
989
989
|
};
|
|
990
990
|
}
|
|
991
991
|
let u = (e, n, r, i, a) => {
|
|
992
|
-
t.custGeom && t.custGeom.length > 0 ?
|
|
992
|
+
t.custGeom && t.custGeom.length > 0 ? Ne(e, t.custGeom, n, r, i, a) : t.prstGeom && ee(e, t.prstGeom, n, r, i, a, t.prstAdjust ?? []) || e.rect(n, r, i, a);
|
|
993
993
|
}, d = (e, t, n, r, i) => {
|
|
994
994
|
e.beginPath(), u(e, t, n, r, i);
|
|
995
995
|
}, f = (e, n, r, i, a) => {
|
|
996
996
|
(t.prstGeom || t.custGeom && t.custGeom.length > 0) && (d(e, n, r, i, a), e.clip());
|
|
997
997
|
}, p = (e, r, i, a, o) => {
|
|
998
|
-
t.stroke && (e.save(),
|
|
998
|
+
t.stroke && (e.save(), X(e, t.stroke, n), d(e, r, i, a, o), e.stroke(), e.restore());
|
|
999
999
|
}, m = (e, r, i, a, o) => {
|
|
1000
1000
|
let s = t.sp3d;
|
|
1001
1001
|
if (s && (s.contourW ?? 0) > 0 && s.contourClr) {
|
|
1002
1002
|
let t = Math.max(.5, s.contourW * n);
|
|
1003
1003
|
e.save(), e.beginPath();
|
|
1004
1004
|
let c = t * 2 + Math.max(a, o);
|
|
1005
|
-
e.rect(r - c, i - c, a + 2 * c, o + 2 * c), u(e, r, i, a, o), e.clip("evenodd"), e.beginPath(), d(e, r, i, a, o), e.strokeStyle =
|
|
1005
|
+
e.rect(r - c, i - c, a + 2 * c, o + 2 * c), u(e, r, i, a, o), e.clip("evenodd"), e.beginPath(), d(e, r, i, a, o), e.strokeStyle = G(s.contourClr), e.lineWidth = t * 2, e.setLineDash([]), e.stroke(), e.restore();
|
|
1006
1006
|
}
|
|
1007
1007
|
}, h = t.scene3d && C(t.scene3d.camera) ? t.scene3d : null, g = (e, t, n, i, a) => {
|
|
1008
1008
|
e.save(), f(e, t, n, i, a), l ? e.drawImage(r, l.sx, l.sy, l.sw, l.sh, t, n, i, a) : e.drawImage(r, t, n, i, a), e.restore();
|
|
@@ -1010,47 +1010,47 @@ async function Ue(e, t, n) {
|
|
|
1010
1010
|
g(e, t, n, r, i), p(e, t, n, r, i), m(e, t, n, r, i);
|
|
1011
1011
|
}, y = (e, t, n, r, i) => {
|
|
1012
1012
|
g(e, t, n, r, i), p(e, t, n, r, i);
|
|
1013
|
-
}, b = e.getTransform(), x = Math.abs(b.a * b.d - b.b * b.c), S = x > 0 ? Math.sqrt(x) : 1, w =
|
|
1013
|
+
}, b = e.getTransform(), x = Math.abs(b.a * b.d - b.b * b.c), S = x > 0 ? Math.sqrt(x) : 1, w = ze(t.sp3d, t.scene3d?.lightRig, t.sp3d ? t.sp3d.prstMaterial : void 0, n, S), T = h ? Be(t.sp3d, h.camera, o, s, n, S) : null, E = t.stroke ? t.stroke.width * n / 2 : 0, D = t.sp3d?.contourW ? t.sp3d.contourW * n : 0, O = T ? Math.hypot(T.offsetX, T.offsetY) / S : 0, k = E + D + O + 2, A = (e) => {
|
|
1014
1014
|
if (h) {
|
|
1015
|
-
if (
|
|
1015
|
+
if (Ve(e, h.camera, i, a, o, s, y, {
|
|
1016
1016
|
bevels: w,
|
|
1017
1017
|
extrusion: T ?? void 0,
|
|
1018
1018
|
paintEdges: m,
|
|
1019
1019
|
edgePadCss: k
|
|
1020
1020
|
})) return;
|
|
1021
|
-
} else if (w.length > 0 &&
|
|
1021
|
+
} else if (w.length > 0 && He(e, i, a, o, s, w, y, m, k)) return;
|
|
1022
1022
|
v(e, i, a, o, s);
|
|
1023
1023
|
}, j = (e, t, n, r, i, a) => {
|
|
1024
1024
|
e.save(), f(e, n, r, i, a), e.fillStyle = t, e.fillRect(n, r, i, a), e.restore();
|
|
1025
1025
|
}, M = (e, t) => {
|
|
1026
|
-
h &&
|
|
1027
|
-
}, N = e.canvas.width || 0,
|
|
1028
|
-
x: i *
|
|
1029
|
-
y: a *
|
|
1030
|
-
w: o *
|
|
1031
|
-
h: s *
|
|
1032
|
-
},
|
|
1033
|
-
t.reflection &&
|
|
1034
|
-
|
|
1035
|
-
},
|
|
1036
|
-
|
|
1037
|
-
},
|
|
1038
|
-
|
|
1039
|
-
}), e.restore()) : A(e), (t.shadow || t.glow) &&
|
|
1040
|
-
|
|
1041
|
-
},
|
|
1026
|
+
h && Ve(e, h.camera, i, a, o, s, (e, n, r, i, a) => j(e, t, n, r, i, a)) || j(e, t, i, a, o, s);
|
|
1027
|
+
}, N = e.canvas.width || 0, P = e.canvas.height || 0, I = e.getTransform(), R = Math.abs(I.a * I.d - I.b * I.c), z = R > 0 ? Math.sqrt(R) : 1, B = {
|
|
1028
|
+
x: i * z,
|
|
1029
|
+
y: a * z,
|
|
1030
|
+
w: o * z,
|
|
1031
|
+
h: s * z
|
|
1032
|
+
}, V = n * z, H = (e) => e.setTransform(I), te = N > 0 && P > 0;
|
|
1033
|
+
t.reflection && te && (e.save(), e.setTransform(new DOMMatrix()), F(e, (e) => {
|
|
1034
|
+
H(e), A(e);
|
|
1035
|
+
}, B, t.reflection, V, N, P), e.restore()), t.shadow ? Oe(e, t.shadow, n) : t.glow && ke(e, t.glow, n), t.softEdge && te ? (e.save(), e.setTransform(new DOMMatrix()), L(e, (e) => {
|
|
1036
|
+
H(e), A(e);
|
|
1037
|
+
}, B, t.softEdge, V, N, P, (e) => {
|
|
1038
|
+
H(e), M(e, "#000");
|
|
1039
|
+
}), e.restore()) : A(e), (t.shadow || t.glow) && Ae(e), t.innerShadow && te && (e.save(), e.setTransform(new DOMMatrix()), _(e, (e) => {
|
|
1040
|
+
H(e), M(e, "#000");
|
|
1041
|
+
}, B, t.innerShadow, V, N, P), e.restore()), e.restore();
|
|
1042
1042
|
} catch {}
|
|
1043
1043
|
}
|
|
1044
|
-
async function
|
|
1045
|
-
let a =
|
|
1044
|
+
async function qe(e, t, n, r, i) {
|
|
1045
|
+
let a = W(t.x, n), o = W(t.y, n), s = W(t.width, n), c = W(t.height, n), l = !1;
|
|
1046
1046
|
if (t.posterPath && r) try {
|
|
1047
|
-
let n = await
|
|
1047
|
+
let n = await Ge(t, r);
|
|
1048
1048
|
e.drawImage(n, a, o, s, c), l = !0;
|
|
1049
1049
|
} catch {}
|
|
1050
1050
|
l || (e.fillStyle = t.mediaKind === "video" ? "#111" : "#f0f0f0", e.fillRect(a, o, s, c)), !i && B(e, a + s / 2, o + c / 2, s, c, "paused");
|
|
1051
1051
|
}
|
|
1052
|
-
function
|
|
1053
|
-
let o = Math.max(.5,
|
|
1052
|
+
function Je(e, t, n, r, i, a) {
|
|
1053
|
+
let o = Math.max(.5, W(r.width, a)), s = n.x - t.x, c = n.y - t.y, l = Math.hypot(s, c);
|
|
1054
1054
|
if (l === 0) return;
|
|
1055
1055
|
let u = -c / l, d = s / l, f;
|
|
1056
1056
|
switch (i) {
|
|
@@ -1099,51 +1099,31 @@ function Ge(e, t, n, r, i, a) {
|
|
|
1099
1099
|
break;
|
|
1100
1100
|
default: return;
|
|
1101
1101
|
}
|
|
1102
|
-
e.save(), e.globalCompositeOperation = "destination-out", e.strokeStyle = "#000", e.lineWidth = o + .5, e.setLineDash([]), e.beginPath(), e.moveTo(t.x, t.y), e.lineTo(n.x, n.y), e.stroke(), e.globalCompositeOperation = "source-over", e.strokeStyle =
|
|
1102
|
+
e.save(), e.globalCompositeOperation = "destination-out", e.strokeStyle = "#000", e.lineWidth = o + .5, e.setLineDash([]), e.beginPath(), e.moveTo(t.x, t.y), e.lineTo(n.x, n.y), e.stroke(), e.globalCompositeOperation = "source-over", e.strokeStyle = G(r.color);
|
|
1103
1103
|
for (let r of f) {
|
|
1104
1104
|
let i = u * (o * r.offset), a = d * (o * r.offset);
|
|
1105
1105
|
e.lineWidth = Math.max(.5, o * r.widthFrac), e.beginPath(), e.moveTo(t.x + i, t.y + a), e.lineTo(n.x + i, n.y + a), e.stroke();
|
|
1106
1106
|
}
|
|
1107
1107
|
e.restore();
|
|
1108
1108
|
}
|
|
1109
|
-
function
|
|
1110
|
-
if (i.type === "none") return;
|
|
1111
|
-
let s = Math.max(.5, G(a.width, o)), c = i.w === "sm" ? 4 : i.w === "lg" ? 8 : 6, l = i.len === "sm" ? 4 : i.len === "lg" ? 8 : 6, u = s * c / 2, d = s * l, f = K(a.color);
|
|
1112
|
-
switch (e.save(), e.translate(t, n), e.rotate(r), e.fillStyle = f, e.strokeStyle = f, e.lineWidth = s, e.setLineDash([]), e.beginPath(), i.type) {
|
|
1113
|
-
case "triangle":
|
|
1114
|
-
case "stealth":
|
|
1115
|
-
e.moveTo(0, 0), e.lineTo(-d, -u), e.lineTo(-d, u), e.closePath(), e.fill();
|
|
1116
|
-
break;
|
|
1117
|
-
case "arrow":
|
|
1118
|
-
e.moveTo(0, 0), e.lineTo(-d, -u), e.moveTo(0, 0), e.lineTo(-d, u), e.stroke();
|
|
1119
|
-
break;
|
|
1120
|
-
case "diamond":
|
|
1121
|
-
e.moveTo(0, 0), e.lineTo(-d / 2, -u), e.lineTo(-d, 0), e.lineTo(-d / 2, u), e.closePath(), e.fill();
|
|
1122
|
-
break;
|
|
1123
|
-
case "oval":
|
|
1124
|
-
e.ellipse(-d / 2, 0, d / 2, u, 0, 0, Math.PI * 2), e.fill();
|
|
1125
|
-
break;
|
|
1126
|
-
}
|
|
1127
|
-
e.restore();
|
|
1128
|
-
}
|
|
1129
|
-
function Q(e, t, n) {
|
|
1109
|
+
function X(e, t, n) {
|
|
1130
1110
|
l(e, t, n);
|
|
1131
1111
|
}
|
|
1132
|
-
function
|
|
1112
|
+
function Ye(e, t, n, r, i = {
|
|
1133
1113
|
themeMajorFont: null,
|
|
1134
1114
|
themeMinorFont: null
|
|
1135
1115
|
}) {
|
|
1136
|
-
let a =
|
|
1116
|
+
let a = W(t.x, n), o = W(t.y, n), s = t.cols.map((e) => W(e, n)), c = s.length, l = (e, t) => {
|
|
1137
1117
|
let n = 0;
|
|
1138
1118
|
for (let r = 0; r < t; r++) n += s[e + r] ?? 0;
|
|
1139
1119
|
return n;
|
|
1140
|
-
}, u = t.rows.map((e) =>
|
|
1120
|
+
}, u = t.rows.map((e) => W(e.height, n));
|
|
1141
1121
|
for (let a = 0; a < t.rows.length; a++) {
|
|
1142
1122
|
let o = t.rows[a];
|
|
1143
1123
|
for (let t = 0; t < o.cells.length; t++) {
|
|
1144
1124
|
let s = o.cells[t];
|
|
1145
1125
|
if (s.hMerge || s.vMerge || (s.rowSpan || 1) > 1 || !s.textBody) continue;
|
|
1146
|
-
let c = l(t, s.gridSpan || 1), d =
|
|
1126
|
+
let c = l(t, s.gridSpan || 1), d = J(e, s.textBody, 0, 0, c, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0) || 0;
|
|
1147
1127
|
d > u[a] && (u[a] = d);
|
|
1148
1128
|
}
|
|
1149
1129
|
}
|
|
@@ -1154,7 +1134,7 @@ function qe(e, t, n, r, i = {
|
|
|
1154
1134
|
if (s.hMerge || s.vMerge) continue;
|
|
1155
1135
|
let c = s.rowSpan || 1;
|
|
1156
1136
|
if (c <= 1 || !s.textBody) continue;
|
|
1157
|
-
let d = l(t, s.gridSpan || 1), f =
|
|
1137
|
+
let d = l(t, s.gridSpan || 1), f = J(e, s.textBody, 0, 0, d, 0, n, null, 0, !1, !1, "#000000", r, i, void 0, !0) || 0, p = 0;
|
|
1158
1138
|
for (let e = 0; e < c && a + e < u.length; e++) p += u[a + e];
|
|
1159
1139
|
if (f > p) {
|
|
1160
1140
|
let e = (f - p) / c;
|
|
@@ -1182,112 +1162,112 @@ function qe(e, t, n, r, i = {
|
|
|
1182
1162
|
if (c.hMerge || c.vMerge) continue;
|
|
1183
1163
|
let d = l(t, c.gridSpan || 1), f = 0;
|
|
1184
1164
|
for (let e = 0; e < (c.rowSpan || 1); e++) f += u[a + e] ?? 0;
|
|
1185
|
-
let m = p(t, c.gridSpan || 1), h =
|
|
1165
|
+
let m = p(t, c.gridSpan || 1), h = re(c.fill);
|
|
1186
1166
|
if (h && (e.fillStyle = h, e.fillRect(m, s, d, f)), c.textBody) {
|
|
1187
|
-
let t = c.textColor ?
|
|
1188
|
-
|
|
1167
|
+
let t = c.textColor ? G(c.textColor) : null;
|
|
1168
|
+
J(e, c.textBody, m, s, d, f, n, t, 0, !1, !1, "#000000", r, i);
|
|
1189
1169
|
}
|
|
1190
|
-
e.save(), c.borderT && (
|
|
1170
|
+
e.save(), c.borderT && (X(e, c.borderT, n), e.beginPath(), e.moveTo(m, s), e.lineTo(m + d, s), e.stroke()), c.borderB && (X(e, c.borderB, n), e.beginPath(), e.moveTo(m, s + f), e.lineTo(m + d, s + f), e.stroke()), c.borderL && (X(e, c.borderL, n), e.beginPath(), e.moveTo(m, s), e.lineTo(m, s + f), e.stroke()), c.borderR && (X(e, c.borderR, n), e.beginPath(), e.moveTo(m + d, s), e.lineTo(m + d, s + f), e.stroke()), c.diagonalTL && (X(e, c.diagonalTL, n), e.beginPath(), e.moveTo(m, s), e.lineTo(m + d, s + f), e.stroke()), c.diagonalTR && (X(e, c.diagonalTR, n), e.beginPath(), e.moveTo(m + d, s), e.lineTo(m, s + f), e.stroke()), e.restore();
|
|
1191
1171
|
}
|
|
1192
1172
|
}
|
|
1193
1173
|
}
|
|
1194
|
-
async function
|
|
1195
|
-
let
|
|
1196
|
-
|
|
1197
|
-
let h =
|
|
1174
|
+
async function Xe(t, n, r, i, a = {}, o) {
|
|
1175
|
+
let s = t, c = s.__pptxRenderToken = (s.__pptxRenderToken ?? 0) + 1, l = () => s.__pptxRenderToken !== c, u = a.width ?? ((v(t) ? t.offsetWidth : 0) || 960), d = u / r, f = Math.round(u), p = Math.round(i * d), m = a.dpr ?? T();
|
|
1176
|
+
t.width = f * m, t.height = p * m, v(t) && (t.style.width = `${f}px`, t.style.display || (t.style.display = "block"));
|
|
1177
|
+
let h = t.getContext("2d");
|
|
1198
1178
|
if (!h) throw Error("Could not get 2D context");
|
|
1199
1179
|
h.scale(m, m);
|
|
1200
1180
|
let g = {
|
|
1201
|
-
themeMajorFont:
|
|
1202
|
-
themeMinorFont:
|
|
1203
|
-
themeHlinkColor:
|
|
1181
|
+
themeMajorFont: a.majorFont ?? null,
|
|
1182
|
+
themeMinorFont: a.minorFont ?? null,
|
|
1183
|
+
themeHlinkColor: a.hlinkColor ?? null
|
|
1204
1184
|
};
|
|
1205
|
-
if (await
|
|
1206
|
-
let _ =
|
|
1207
|
-
for (let e of
|
|
1185
|
+
if (await we(h, n.background, f, p, d), l() || (a.math && await fe(n, a.math), l())) return t;
|
|
1186
|
+
let _ = a.defaultTextColor ? `#${a.defaultTextColor}` : "#000000", y = n.slideNumber;
|
|
1187
|
+
for (let e of n.elements) if (e.type === "picture") Ue(e.dataUrl).catch(() => void 0);
|
|
1208
1188
|
else if (e.type === "media") {
|
|
1209
1189
|
let t = e;
|
|
1210
|
-
t.posterPath &&
|
|
1211
|
-
}
|
|
1212
|
-
for (let
|
|
1213
|
-
if (
|
|
1214
|
-
if (
|
|
1215
|
-
else if (
|
|
1216
|
-
else if (
|
|
1217
|
-
else if (
|
|
1218
|
-
else if (
|
|
1219
|
-
let
|
|
1220
|
-
|
|
1221
|
-
chartType:
|
|
1222
|
-
title:
|
|
1223
|
-
categories:
|
|
1224
|
-
series:
|
|
1225
|
-
showDataLabels:
|
|
1226
|
-
valMin:
|
|
1227
|
-
valMax:
|
|
1190
|
+
t.posterPath && a.fetchMedia && Ge(t, a.fetchMedia).catch(() => void 0);
|
|
1191
|
+
}
|
|
1192
|
+
for (let r of n.elements) {
|
|
1193
|
+
if (l()) return t;
|
|
1194
|
+
if (r.type === "shape") Me(h, r, d, _, y, g, o);
|
|
1195
|
+
else if (r.type === "picture") await Ke(h, r, d);
|
|
1196
|
+
else if (r.type === "table") Ye(h, r, d, y, g);
|
|
1197
|
+
else if (r.type === "media") await qe(h, r, d, a.fetchMedia, a.skipMediaControls);
|
|
1198
|
+
else if (r.type === "chart") {
|
|
1199
|
+
let t = e * d;
|
|
1200
|
+
D(h, {
|
|
1201
|
+
chartType: r.chartType,
|
|
1202
|
+
title: r.title,
|
|
1203
|
+
categories: r.categories,
|
|
1204
|
+
series: r.series,
|
|
1205
|
+
showDataLabels: r.showDataLabels,
|
|
1206
|
+
valMin: r.valMin,
|
|
1207
|
+
valMax: r.valMax,
|
|
1228
1208
|
catAxisTitle: null,
|
|
1229
1209
|
valAxisTitle: null,
|
|
1230
|
-
catAxisHidden:
|
|
1231
|
-
valAxisHidden:
|
|
1232
|
-
catAxisLineHidden:
|
|
1233
|
-
valAxisLineHidden:
|
|
1234
|
-
catAxisFontColor:
|
|
1235
|
-
valAxisFontColor:
|
|
1236
|
-
catAxisLineColor:
|
|
1237
|
-
catAxisLineWidthEmu:
|
|
1238
|
-
valAxisLineColor:
|
|
1239
|
-
valAxisLineWidthEmu:
|
|
1240
|
-
plotAreaBg:
|
|
1241
|
-
chartBg:
|
|
1242
|
-
showLegend:
|
|
1243
|
-
legendPos:
|
|
1244
|
-
catAxisCrossBetween:
|
|
1245
|
-
valAxisMajorTickMark:
|
|
1246
|
-
catAxisMajorTickMark:
|
|
1247
|
-
titleFontSizeHpt:
|
|
1248
|
-
titleFontColor:
|
|
1249
|
-
titleFontFace:
|
|
1250
|
-
catAxisFontSizeHpt:
|
|
1251
|
-
valAxisFontSizeHpt:
|
|
1252
|
-
dataLabelFontSizeHpt:
|
|
1253
|
-
subtotalIndices:
|
|
1254
|
-
barGapWidth:
|
|
1255
|
-
barOverlap:
|
|
1256
|
-
dataLabelPosition:
|
|
1257
|
-
dataLabelFontColor:
|
|
1258
|
-
dataLabelFormatCode:
|
|
1259
|
-
valAxisFormatCode:
|
|
1260
|
-
plotAreaManualLayout:
|
|
1261
|
-
scatterStyle:
|
|
1262
|
-
radarStyle:
|
|
1210
|
+
catAxisHidden: r.catAxisHidden,
|
|
1211
|
+
valAxisHidden: r.valAxisHidden,
|
|
1212
|
+
catAxisLineHidden: r.catAxisLineHidden ?? !1,
|
|
1213
|
+
valAxisLineHidden: r.valAxisLineHidden ?? !1,
|
|
1214
|
+
catAxisFontColor: r.catAxisFontColor ?? null,
|
|
1215
|
+
valAxisFontColor: r.valAxisFontColor ?? null,
|
|
1216
|
+
catAxisLineColor: r.catAxisLineColor ?? null,
|
|
1217
|
+
catAxisLineWidthEmu: r.catAxisLineWidthEmu ?? null,
|
|
1218
|
+
valAxisLineColor: r.valAxisLineColor ?? null,
|
|
1219
|
+
valAxisLineWidthEmu: r.valAxisLineWidthEmu ?? null,
|
|
1220
|
+
plotAreaBg: r.plotAreaBg,
|
|
1221
|
+
chartBg: r.chartBg,
|
|
1222
|
+
showLegend: r.showLegend,
|
|
1223
|
+
legendPos: r.legendPos ?? null,
|
|
1224
|
+
catAxisCrossBetween: r.catAxisCrossBetween,
|
|
1225
|
+
valAxisMajorTickMark: r.valAxisMajorTickMark,
|
|
1226
|
+
catAxisMajorTickMark: r.catAxisMajorTickMark,
|
|
1227
|
+
titleFontSizeHpt: r.titleFontSizeHpt,
|
|
1228
|
+
titleFontColor: r.titleFontColor ?? null,
|
|
1229
|
+
titleFontFace: r.titleFontFace ?? null,
|
|
1230
|
+
catAxisFontSizeHpt: r.catAxisFontSizeHpt,
|
|
1231
|
+
valAxisFontSizeHpt: r.valAxisFontSizeHpt,
|
|
1232
|
+
dataLabelFontSizeHpt: r.dataLabelFontSizeHpt,
|
|
1233
|
+
subtotalIndices: r.subtotalIndices,
|
|
1234
|
+
barGapWidth: r.barGapWidth ?? null,
|
|
1235
|
+
barOverlap: r.barOverlap ?? null,
|
|
1236
|
+
dataLabelPosition: r.dataLabelPosition ?? null,
|
|
1237
|
+
dataLabelFontColor: r.dataLabelFontColor ?? null,
|
|
1238
|
+
dataLabelFormatCode: r.dataLabelFormatCode ?? null,
|
|
1239
|
+
valAxisFormatCode: r.valAxisFormatCode ?? null,
|
|
1240
|
+
plotAreaManualLayout: r.plotAreaManualLayout ?? null,
|
|
1241
|
+
scatterStyle: r.scatterStyle ?? null,
|
|
1242
|
+
radarStyle: r.radarStyle ?? null
|
|
1263
1243
|
}, {
|
|
1264
|
-
x:
|
|
1265
|
-
y:
|
|
1266
|
-
w:
|
|
1267
|
-
h:
|
|
1268
|
-
},
|
|
1244
|
+
x: W(r.x, d),
|
|
1245
|
+
y: W(r.y, d),
|
|
1246
|
+
w: W(r.width, d),
|
|
1247
|
+
h: W(r.height, d)
|
|
1248
|
+
}, t);
|
|
1269
1249
|
}
|
|
1270
1250
|
}
|
|
1271
|
-
return
|
|
1251
|
+
return t;
|
|
1272
1252
|
}
|
|
1273
1253
|
//#endregion
|
|
1274
1254
|
//#region packages/pptx/src/tabular-text.ts
|
|
1275
|
-
var
|
|
1276
|
-
function
|
|
1255
|
+
var Ze = (e) => e >= "0" && e <= "9";
|
|
1256
|
+
function Qe(e) {
|
|
1277
1257
|
let t = 0;
|
|
1278
1258
|
for (let n = 0; n < 10; n++) t = Math.max(t, e.measureText(String(n)).width);
|
|
1279
1259
|
return t;
|
|
1280
1260
|
}
|
|
1281
|
-
function
|
|
1261
|
+
function $e(e, t, n) {
|
|
1282
1262
|
let r = 0;
|
|
1283
|
-
for (let i of t) r +=
|
|
1263
|
+
for (let i of t) r += Ze(i) ? n : e.measureText(i).width;
|
|
1284
1264
|
return r;
|
|
1285
1265
|
}
|
|
1286
|
-
function
|
|
1266
|
+
function et(e, t, n, r, i) {
|
|
1287
1267
|
let a = e.textAlign;
|
|
1288
1268
|
e.textAlign = "left";
|
|
1289
1269
|
let o = n;
|
|
1290
|
-
for (let n of t) if (
|
|
1270
|
+
for (let n of t) if (Ze(n)) {
|
|
1291
1271
|
let t = e.measureText(n).width;
|
|
1292
1272
|
e.fillText(n, o + (i - t) / 2, r), o += i;
|
|
1293
1273
|
} else e.fillText(n, o, r), o += e.measureText(n).width;
|
|
@@ -1295,71 +1275,71 @@ function Qe(e, t, n, r, i) {
|
|
|
1295
1275
|
}
|
|
1296
1276
|
//#endregion
|
|
1297
1277
|
//#region packages/pptx/src/presentation-handle.ts
|
|
1298
|
-
var
|
|
1299
|
-
async function
|
|
1300
|
-
let
|
|
1301
|
-
if (!
|
|
1302
|
-
let
|
|
1303
|
-
await
|
|
1304
|
-
let
|
|
1305
|
-
|
|
1306
|
-
let
|
|
1307
|
-
if (!
|
|
1308
|
-
|
|
1309
|
-
let
|
|
1310
|
-
for (let e of
|
|
1278
|
+
var Z = (e, t) => e / E * t;
|
|
1279
|
+
async function tt(e, t, n) {
|
|
1280
|
+
let r = e.getContext("2d");
|
|
1281
|
+
if (!r) throw Error("2D context not available");
|
|
1282
|
+
let i = n.width / (n.slideWidthEmu / E);
|
|
1283
|
+
await n.drawBase();
|
|
1284
|
+
let a = document.createElement("canvas");
|
|
1285
|
+
a.width = e.width, a.height = e.height;
|
|
1286
|
+
let o = a.getContext("2d");
|
|
1287
|
+
if (!o) throw Error("base 2D context not available");
|
|
1288
|
+
o.drawImage(e, 0, 0);
|
|
1289
|
+
let s = [];
|
|
1290
|
+
for (let e of t) {
|
|
1311
1291
|
let t;
|
|
1312
1292
|
try {
|
|
1313
|
-
t = await
|
|
1293
|
+
t = await n.fetchMedia(e.mediaPath);
|
|
1314
1294
|
} catch {
|
|
1315
1295
|
continue;
|
|
1316
1296
|
}
|
|
1317
|
-
let
|
|
1318
|
-
o.src =
|
|
1319
|
-
let
|
|
1320
|
-
x:
|
|
1321
|
-
y:
|
|
1322
|
-
w:
|
|
1323
|
-
h:
|
|
1297
|
+
let r = new Blob([t], { type: e.mimeType || t.type }), a = URL.createObjectURL(r), o = e.mediaKind === "video" ? document.createElement("video") : document.createElement("audio");
|
|
1298
|
+
o.src = a, o.preload = "metadata", e.mediaKind === "video" && (o.playsInline = !0);
|
|
1299
|
+
let c = {
|
|
1300
|
+
x: Z(e.x, i),
|
|
1301
|
+
y: Z(e.y, i),
|
|
1302
|
+
w: Z(e.width, i),
|
|
1303
|
+
h: Z(e.height, i)
|
|
1324
1304
|
}, l = e.mediaKind === "audio" ? {
|
|
1325
|
-
x:
|
|
1326
|
-
y:
|
|
1327
|
-
w: Math.max(
|
|
1328
|
-
h:
|
|
1329
|
-
} :
|
|
1330
|
-
|
|
1305
|
+
x: c.x + c.w / 2 - Math.max(c.w, 260) / 2,
|
|
1306
|
+
y: c.y,
|
|
1307
|
+
w: Math.max(c.w, 260),
|
|
1308
|
+
h: c.h + 36
|
|
1309
|
+
} : c;
|
|
1310
|
+
s.push({
|
|
1331
1311
|
el: e,
|
|
1332
1312
|
rect: l,
|
|
1333
|
-
posterRect:
|
|
1313
|
+
posterRect: c,
|
|
1334
1314
|
media: o,
|
|
1335
|
-
objectUrl:
|
|
1315
|
+
objectUrl: a
|
|
1336
1316
|
});
|
|
1337
1317
|
}
|
|
1338
|
-
let
|
|
1339
|
-
|
|
1340
|
-
let
|
|
1341
|
-
|
|
1342
|
-
for (let e of
|
|
1318
|
+
let c = null, l = !1, u = null, d = () => {
|
|
1319
|
+
r.setTransform(n.dpr, 0, 0, n.dpr, 0, 0);
|
|
1320
|
+
let t = e.width / n.dpr, i = e.height / n.dpr;
|
|
1321
|
+
r.drawImage(a, 0, 0, e.width, e.height, 0, 0, t, i);
|
|
1322
|
+
for (let e of s) {
|
|
1343
1323
|
let t = e.media;
|
|
1344
1324
|
if (e.el.mediaKind === "video" && t.readyState >= 2) {
|
|
1345
|
-
let { x: n, y:
|
|
1346
|
-
|
|
1325
|
+
let { x: n, y: i, w: a, h: o } = e.posterRect;
|
|
1326
|
+
r.drawImage(t, n, i, a, o);
|
|
1347
1327
|
}
|
|
1348
|
-
(e ===
|
|
1328
|
+
(e === u || h?.state === e) && st(r, e, t);
|
|
1349
1329
|
}
|
|
1350
|
-
},
|
|
1351
|
-
|
|
1352
|
-
},
|
|
1353
|
-
let i =
|
|
1330
|
+
}, f = () => {
|
|
1331
|
+
l || (d(), c = requestAnimationFrame(f));
|
|
1332
|
+
}, p = (t, r) => {
|
|
1333
|
+
let i = e.getBoundingClientRect(), a = e.width / n.dpr, o = e.height / n.dpr;
|
|
1354
1334
|
return {
|
|
1355
|
-
x: (
|
|
1356
|
-
y: (
|
|
1335
|
+
x: (t - i.left) / i.width * a,
|
|
1336
|
+
y: (r - i.top) / i.height * o
|
|
1357
1337
|
};
|
|
1358
|
-
},
|
|
1359
|
-
for (let n of
|
|
1338
|
+
}, m = (e, t) => {
|
|
1339
|
+
for (let n of s) {
|
|
1360
1340
|
let { x: r, y: i, w: a, h: o } = n.rect;
|
|
1361
1341
|
if (e < r || e > r + a || t < i || t > i + o) continue;
|
|
1362
|
-
let s =
|
|
1342
|
+
let s = Q(n), c = s.y - 12, l = s.y + s.h + 8;
|
|
1363
1343
|
return (Number.isFinite(n.media.duration) ? n.media.duration : 0) > 0 && e >= s.x && e <= s.x + s.w && t >= c && t <= l ? {
|
|
1364
1344
|
kind: "seek",
|
|
1365
1345
|
state: n,
|
|
@@ -1370,75 +1350,75 @@ async function et(t, n, r) {
|
|
|
1370
1350
|
};
|
|
1371
1351
|
}
|
|
1372
1352
|
return null;
|
|
1373
|
-
},
|
|
1353
|
+
}, h = null, g = (e, t) => {
|
|
1374
1354
|
let n = Number.isFinite(e.media.duration) ? e.media.duration : 0;
|
|
1375
1355
|
n <= 0 || (e.media.currentTime = n * t);
|
|
1376
|
-
},
|
|
1377
|
-
let { x: n, y: r } =
|
|
1378
|
-
i && (i.kind === "seek" ? (
|
|
1356
|
+
}, _ = (t) => {
|
|
1357
|
+
let { x: n, y: r } = p(t.clientX, t.clientY), i = m(n, r);
|
|
1358
|
+
i && (i.kind === "seek" ? (h = {
|
|
1379
1359
|
state: i.state,
|
|
1380
1360
|
wasPlaying: !i.state.media.paused
|
|
1381
|
-
}, i.state.media.pause(),
|
|
1382
|
-
},
|
|
1383
|
-
let { x: t, y: n } =
|
|
1384
|
-
|
|
1385
|
-
for (let e of
|
|
1361
|
+
}, i.state.media.pause(), g(i.state, i.fraction), e.setPointerCapture(t.pointerId), t.preventDefault()) : i.state.media.paused ? i.state.media.play().catch(() => void 0) : i.state.media.pause());
|
|
1362
|
+
}, v = (e) => {
|
|
1363
|
+
let { x: t, y: n } = p(e.clientX, e.clientY);
|
|
1364
|
+
u = null;
|
|
1365
|
+
for (let e of s) {
|
|
1386
1366
|
let { x: r, y: i, w: a, h: o } = e.rect;
|
|
1387
1367
|
if (t >= r && t <= r + a && n >= i && n <= i + o) {
|
|
1388
|
-
|
|
1368
|
+
u = e;
|
|
1389
1369
|
break;
|
|
1390
1370
|
}
|
|
1391
1371
|
}
|
|
1392
|
-
if (
|
|
1393
|
-
let e =
|
|
1394
|
-
|
|
1372
|
+
if (h) {
|
|
1373
|
+
let e = Q(h.state), n = Math.max(0, Math.min(1, (t - e.x) / e.w));
|
|
1374
|
+
g(h.state, n);
|
|
1395
1375
|
}
|
|
1396
|
-
},
|
|
1397
|
-
|
|
1398
|
-
},
|
|
1399
|
-
if (!
|
|
1400
|
-
let { wasPlaying: n, state: r } =
|
|
1401
|
-
|
|
1376
|
+
}, y = () => {
|
|
1377
|
+
u = null;
|
|
1378
|
+
}, b = (t) => {
|
|
1379
|
+
if (!h) return;
|
|
1380
|
+
let { wasPlaying: n, state: r } = h;
|
|
1381
|
+
h = null, e.releasePointerCapture(t.pointerId), n && r.media.play().catch(() => void 0);
|
|
1402
1382
|
};
|
|
1403
|
-
return
|
|
1383
|
+
return s.length > 0 && (e.addEventListener("pointerdown", _), e.addEventListener("pointermove", v), e.addEventListener("pointerleave", y), e.addEventListener("pointerup", b), e.addEventListener("pointercancel", b), e.style.cursor = "pointer", f()), {
|
|
1404
1384
|
play(e) {
|
|
1405
|
-
for (let t of
|
|
1385
|
+
for (let t of s) (!e || t.el.mediaPath === e) && t.media.play().catch(() => void 0);
|
|
1406
1386
|
},
|
|
1407
1387
|
pause(e) {
|
|
1408
|
-
for (let t of
|
|
1388
|
+
for (let t of s) (!e || t.el.mediaPath === e) && t.media.pause();
|
|
1409
1389
|
},
|
|
1410
1390
|
destroy() {
|
|
1411
|
-
if (!
|
|
1412
|
-
|
|
1413
|
-
for (let e of
|
|
1391
|
+
if (!l) {
|
|
1392
|
+
l = !0, c !== null && cancelAnimationFrame(c), e.removeEventListener("pointerdown", _), e.removeEventListener("pointermove", v), e.removeEventListener("pointerleave", y), e.removeEventListener("pointerup", b), e.removeEventListener("pointercancel", b), e.style.cursor = "";
|
|
1393
|
+
for (let e of s) e.media.pause(), e.media.removeAttribute("src"), e.media.load(), URL.revokeObjectURL(e.objectUrl);
|
|
1414
1394
|
}
|
|
1415
1395
|
}
|
|
1416
1396
|
};
|
|
1417
1397
|
}
|
|
1418
|
-
var
|
|
1419
|
-
function
|
|
1398
|
+
var nt = 28, rt = 14, it = 72, at = 10, ot = 3;
|
|
1399
|
+
function st(e, t, n) {
|
|
1420
1400
|
let r = Number.isFinite(n.duration) ? n.duration : 0, i = r > 0 ? Math.min(1, n.currentTime / r) : 0, a = t.posterRect;
|
|
1421
|
-
B(e, a.x + a.w / 2, a.y + a.h / 2, a.w, a.h, n.paused ? "paused" : "playing"), t.el.mediaKind === "audio" ?
|
|
1401
|
+
B(e, a.x + a.w / 2, a.y + a.h / 2, a.w, a.h, n.paused ? "paused" : "playing"), t.el.mediaKind === "audio" ? lt(e, t, n, r, i) : ct(e, t, n, r, i);
|
|
1422
1402
|
}
|
|
1423
|
-
function
|
|
1403
|
+
function ct(e, t, n, r, i) {
|
|
1424
1404
|
let { x: a, y: o, w: s, h: c } = t.rect, l = Math.max(28, Math.min(56, c * .22)), u = o + c - l;
|
|
1425
1405
|
e.save();
|
|
1426
1406
|
let d = e.createLinearGradient(0, u, 0, o + c);
|
|
1427
1407
|
d.addColorStop(0, "rgba(0, 0, 0, 0)"), d.addColorStop(1, "rgba(0, 0, 0, 0.55)"), e.fillStyle = d, e.fillRect(a, u, s, l), e.restore();
|
|
1428
|
-
let f =
|
|
1429
|
-
|
|
1408
|
+
let f = Q(t);
|
|
1409
|
+
dt(e, f, i, r > 0), e.save(), e.font = "500 11px system-ui, -apple-system, sans-serif", e.textBaseline = "middle", e.shadowColor = "rgba(0, 0, 0, 0.75)", e.shadowBlur = 3, e.fillStyle = "rgba(255, 255, 255, 0.95)", ut(e, n.currentTime, r, f.x, f.y - 10, "bottom"), e.restore();
|
|
1430
1410
|
}
|
|
1431
|
-
function
|
|
1432
|
-
let a =
|
|
1433
|
-
e.save(), pt(e, a.x, a.y, a.w, a.h, a.h / 2), e.fillStyle = "rgba(20, 20, 20, 0.72)", e.fill(), e.font = "500 11px system-ui, -apple-system, sans-serif", e.textBaseline = "middle", e.fillStyle = "rgba(255, 255, 255, 0.95)",
|
|
1411
|
+
function lt(e, t, n, r, i) {
|
|
1412
|
+
let a = ft(t.rect);
|
|
1413
|
+
e.save(), pt(e, a.x, a.y, a.w, a.h, a.h / 2), e.fillStyle = "rgba(20, 20, 20, 0.72)", e.fill(), e.font = "500 11px system-ui, -apple-system, sans-serif", e.textBaseline = "middle", e.fillStyle = "rgba(255, 255, 255, 0.95)", ut(e, n.currentTime, r, a.x + rt, a.y + a.h / 2, "middle"), e.restore(), dt(e, Q(t), i, r > 0);
|
|
1434
1414
|
}
|
|
1435
|
-
function
|
|
1436
|
-
let o = mt(t), s = mt(n), c =
|
|
1437
|
-
|
|
1415
|
+
function ut(e, t, n, r, i, a) {
|
|
1416
|
+
let o = mt(t), s = mt(n), c = Qe(e), l = $e(e, o, c), u = $e(e, s, c), d = e.measureText(" / ").width, f = Math.max(l, u);
|
|
1417
|
+
et(e, o, r + f - l, i, c);
|
|
1438
1418
|
let p = e.textAlign;
|
|
1439
|
-
e.textAlign = "left", e.fillText(" / ", r + f, i), e.textAlign = p,
|
|
1419
|
+
e.textAlign = "left", e.fillText(" / ", r + f, i), e.textAlign = p, et(e, s, r + f + d, i, c);
|
|
1440
1420
|
}
|
|
1441
|
-
function
|
|
1421
|
+
function dt(e, t, n, r) {
|
|
1442
1422
|
let i = t.h / 2;
|
|
1443
1423
|
if (e.save(), pt(e, t.x, t.y, t.w, t.h, i), e.fillStyle = "rgba(255, 255, 255, 0.35)", e.fill(), n > 0 && (pt(e, t.x, t.y, t.w * n, t.h, i), e.fillStyle = "#fff", e.fill()), r) {
|
|
1444
1424
|
let r = Math.max(t.x + 5, Math.min(t.x + t.w - 5, t.x + t.w * n));
|
|
@@ -1446,31 +1426,31 @@ function ut(e, t, n, r) {
|
|
|
1446
1426
|
}
|
|
1447
1427
|
e.restore();
|
|
1448
1428
|
}
|
|
1449
|
-
function
|
|
1429
|
+
function ft(e) {
|
|
1450
1430
|
let t = Math.max(220, e.w - 24);
|
|
1451
1431
|
return {
|
|
1452
1432
|
x: e.x + e.w / 2 - t / 2,
|
|
1453
|
-
y: e.y + e.h -
|
|
1433
|
+
y: e.y + e.h - nt - 4,
|
|
1454
1434
|
w: t,
|
|
1455
|
-
h:
|
|
1435
|
+
h: nt
|
|
1456
1436
|
};
|
|
1457
1437
|
}
|
|
1458
|
-
function
|
|
1438
|
+
function Q(e) {
|
|
1459
1439
|
if (e.el.mediaKind === "audio") {
|
|
1460
|
-
let t =
|
|
1440
|
+
let t = ft(e.rect), n = t.x + rt + it + at, r = Math.max(40, t.x + t.w - rt - n);
|
|
1461
1441
|
return {
|
|
1462
1442
|
x: n,
|
|
1463
|
-
y: t.y + (t.h -
|
|
1443
|
+
y: t.y + (t.h - ot) / 2,
|
|
1464
1444
|
w: r,
|
|
1465
|
-
h:
|
|
1445
|
+
h: ot
|
|
1466
1446
|
};
|
|
1467
1447
|
}
|
|
1468
1448
|
let t = e.rect, n = Math.max(12, t.w * .025), r = Math.max(12, Math.min(18, t.h * .05));
|
|
1469
1449
|
return {
|
|
1470
1450
|
x: t.x + n,
|
|
1471
|
-
y: t.y + t.h -
|
|
1451
|
+
y: t.y + t.h - ot - r,
|
|
1472
1452
|
w: t.w - n * 2,
|
|
1473
|
-
h:
|
|
1453
|
+
h: ot
|
|
1474
1454
|
};
|
|
1475
1455
|
}
|
|
1476
1456
|
function pt(e, t, n, r, i, a) {
|
|
@@ -1543,7 +1523,7 @@ var $ = "https://fonts.googleapis.com/css2?family=Noto+Naskh+Arabic:wght@400;700
|
|
|
1543
1523
|
url: gt,
|
|
1544
1524
|
loadFamily: "Noto Sans Arabic"
|
|
1545
1525
|
},
|
|
1546
|
-
...
|
|
1526
|
+
...f
|
|
1547
1527
|
};
|
|
1548
1528
|
function* vt(e) {
|
|
1549
1529
|
for (let t of e?.paragraphs ?? []) for (let e of t.runs) e.type === "text" && (yield e.text);
|
|
@@ -1558,11 +1538,11 @@ function* yt(e) {
|
|
|
1558
1538
|
}
|
|
1559
1539
|
}
|
|
1560
1540
|
function bt(e) {
|
|
1561
|
-
let n =
|
|
1541
|
+
let n = t(e.majorFont) ?? t(e.minorFont) ?? null;
|
|
1562
1542
|
return [
|
|
1563
1543
|
e.majorFont,
|
|
1564
1544
|
e.minorFont,
|
|
1565
|
-
...
|
|
1545
|
+
...g(yt(e), n)
|
|
1566
1546
|
];
|
|
1567
1547
|
}
|
|
1568
1548
|
//#endregion
|
|
@@ -1610,7 +1590,7 @@ var Tt = "data:application/wasm;base64,AGFzbQEAAAAB8gIwYAJ/fwBgAn9/AX9gA39/fwBgA
|
|
|
1610
1590
|
_workerReadyCallbacks = [];
|
|
1611
1591
|
_math;
|
|
1612
1592
|
constructor(e, t) {
|
|
1613
|
-
this._worker = e, this._mode = t, this._bridge = new
|
|
1593
|
+
this._worker = e, this._mode = t, this._bridge = new N(this._worker, {
|
|
1614
1594
|
correlate: (e) => "id" in e ? e.id : void 0,
|
|
1615
1595
|
toError: (e) => e.kind === "error" ? e.message : void 0,
|
|
1616
1596
|
onUnsolicited: (e) => {
|
|
@@ -1630,13 +1610,13 @@ var Tt = "data:application/wasm;base64,AGFzbQEAAAAB8gIwYAJ/fwBgAn9/AX9gA39/fwBgA
|
|
|
1630
1610
|
static async load(t, n = {}) {
|
|
1631
1611
|
let r = n.mode ?? "main";
|
|
1632
1612
|
if (r === "worker" && (typeof Worker > "u" || typeof OffscreenCanvas > "u")) throw Error("mode: 'worker' requires Worker and OffscreenCanvas support");
|
|
1633
|
-
let i = new e(r === "worker" ? (await import("./render-worker-host-
|
|
1613
|
+
let i = new e(r === "worker" ? (await import("./render-worker-host-qS8zOCxE.js")).createRenderWorker() : new wt(), r), a;
|
|
1634
1614
|
if (typeof t == "string") {
|
|
1635
1615
|
let e = await fetch(t);
|
|
1636
1616
|
if (!e.ok) throw Error(`Failed to fetch: ${e.status} ${e.statusText}`);
|
|
1637
1617
|
a = await e.arrayBuffer();
|
|
1638
1618
|
} else a = t;
|
|
1639
|
-
return n.math && r === "worker" && console.warn("[ooxml] the math engine is unavailable in mode: 'worker'; equations will be skipped. Use mode: 'main' for documents with equations."), i._math = r === "worker" ? void 0 : n.math, await i._parse(a, n.maxZipEntryBytes, r === "worker" ? !!n.useGoogleFonts : !1), r === "main" && n.useGoogleFonts && i._presentation && await
|
|
1619
|
+
return n.math && r === "worker" && console.warn("[ooxml] the math engine is unavailable in mode: 'worker'; equations will be skipped. Use mode: 'main' for documents with equations."), i._math = r === "worker" ? void 0 : n.math, await i._parse(a, n.maxZipEntryBytes, r === "worker" ? !!n.useGoogleFonts : !1), r === "main" && n.useGoogleFonts && i._presentation && await o(bt(i._presentation), _t), i;
|
|
1640
1620
|
}
|
|
1641
1621
|
_waitForWorker() {
|
|
1642
1622
|
return this._workerReady ? Promise.resolve() : new Promise((e) => this._workerReadyCallbacks.push(e));
|
|
@@ -1675,7 +1655,7 @@ var Tt = "data:application/wasm;base64,AGFzbQEAAAAB8gIwYAJ/fwBgAn9/AX9gA39/fwBgA
|
|
|
1675
1655
|
let r = this._presentation.slides[t];
|
|
1676
1656
|
if (!r) throw Error(`Slide index ${t} out of range (count: ${this.slideCount})`);
|
|
1677
1657
|
let i = n.dpr ?? T(), a = n.width ?? ((v(e) ? e.offsetWidth : 0) || 960);
|
|
1678
|
-
await
|
|
1658
|
+
await Xe(e, r, this._presentation.slideWidth, this._presentation.slideHeight, {
|
|
1679
1659
|
width: a,
|
|
1680
1660
|
dpr: i,
|
|
1681
1661
|
defaultTextColor: this._presentation.defaultTextColor,
|
|
@@ -1745,7 +1725,7 @@ var Tt = "data:application/wasm;base64,AGFzbQEAAAAB8gIwYAJ/fwBgAn9/AX9gA39/fwBgA
|
|
|
1745
1725
|
skipMediaControls: !0,
|
|
1746
1726
|
onTextRun: n.onTextRun
|
|
1747
1727
|
});
|
|
1748
|
-
return
|
|
1728
|
+
return tt(e, this._mode === "worker" ? this._meta?.mediaElements[t] ?? [] : this._presentation.slides[t].elements.filter((e) => e.type === "media"), {
|
|
1749
1729
|
width: i,
|
|
1750
1730
|
dpr: r,
|
|
1751
1731
|
slideWidthEmu: this.slideWidth,
|
|
@@ -1862,11 +1842,11 @@ var Tt = "data:application/wasm;base64,AGFzbQEAAAAB8gIwYAJ/fwBgAn9/AX9gA39/fwBgA
|
|
|
1862
1842
|
destroy() {
|
|
1863
1843
|
this.handle?.destroy(), this.handle = null, this.engine?.destroy(), this.wrapper.remove();
|
|
1864
1844
|
}
|
|
1865
|
-
}, Ot = /* @__PURE__ */
|
|
1845
|
+
}, Ot = /* @__PURE__ */ h({
|
|
1866
1846
|
PptxPresentation: () => Et,
|
|
1867
1847
|
PptxViewer: () => Dt,
|
|
1868
|
-
autoResize: () =>
|
|
1869
|
-
renderSlide: () =>
|
|
1848
|
+
autoResize: () => u,
|
|
1849
|
+
renderSlide: () => Xe
|
|
1870
1850
|
});
|
|
1871
1851
|
//#endregion
|
|
1872
|
-
export {
|
|
1852
|
+
export { Xe as i, Dt as n, Et as r, Ot as t };
|