@silurus/ooxml 0.89.0 → 0.89.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/THIRD_PARTY_NOTICES.md +1 -1
- package/dist/assets/render-worker-Bye3wDV9.js +35 -0
- package/dist/assets/render-worker-CyUrUidp.js +16 -0
- package/dist/assets/render-worker-D_SMt5nl.js +15 -0
- package/dist/bounded-raw-part-cache-C3daknU-.js +33925 -0
- package/dist/{canvas-viewer-mechanics-DfQqRKkD.js → canvas-viewer-mechanics-SZWSnn6j.js} +2 -2
- package/dist/{cfb-guard-9QTRTg7f.js → cfb-guard-dNeUiANF.js} +1 -1
- package/dist/chart-ex.mjs +477 -477
- package/dist/{comment-overlay-controller-B5_zGgG5.js → comment-overlay-controller-CHDxT0e7.js} +16 -16
- package/dist/{comment-ui-runtime-Jy-3goA9.js → comment-ui-runtime-BcwaRnMR.js} +3 -3
- package/dist/{comment-ui-runtime-D_sb2K6s.js → comment-ui-runtime-Dk2qrPy_.js} +3 -3
- package/dist/{document-model-source-BKNrXjAL.js → document-model-source-BD2VSd2L.js} +44 -44
- package/dist/{document-pull-client-CxONDGbk.js → document-pull-client-DhSGspvi.js} +6102 -7994
- package/dist/{document-pull-worker-AMyXYpPq.js → document-pull-worker-D-E0Iz3P.js} +18 -18
- package/dist/{docx-DhDnKEI6.js → docx-CCZBO1WQ.js} +556 -556
- package/dist/{docx-D91ER1_S.js → docx-CXfILbzI.js} +24 -24
- package/dist/{docx-model-source-CdrSt3hF.js → docx-model-source-Ci6xb487.js} +12 -12
- package/dist/docx.mjs +4 -4
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{drawingml-shape-ChcGZNd8.js → drawingml-shape-Bp0yEZHC.js} +55 -55
- package/dist/{duotone-ekYik4ix.js → duotone-DN8P4aXe.js} +1 -1
- package/dist/{emf-UT6I8rVi.js → emf-CGFQIz6c.js} +60 -60
- package/dist/{font-preload-demand-CdJZUMCT.js → font-preload-demand-CGOB-MoE.js} +2 -2
- package/dist/{grid-geometry-uQOgViJU.js → grid-geometry-C3IG20ut.js} +1 -1
- package/dist/{host-layout-measure-CCEgaC_v.js → host-layout-measure-BAysJILu.js} +1 -1
- package/dist/index.mjs +3 -3
- package/dist/internal-companion.mjs +2 -2
- package/dist/{line-distribute-CPOV6csk.js → line-distribute-DhQqysA2.js} +153 -70
- package/dist/{model-source-DJGzDtGb.js → model-source-BkmyX_r-.js} +4 -4
- package/dist/{model-source-session-Bu9CHFHc.js → model-source-session-CF4iXav8.js} +18 -18
- package/dist/{model-source-session-sKpNiIJI.js → model-source-session-CJmkItIK.js} +10 -10
- package/dist/{model-source-session-CDuijwv1.js → model-source-session-CnPCTRDD.js} +2 -2
- package/dist/node.mjs +5 -5
- package/dist/{bounded-raw-part-cache-B7JoC1CD.js → plot-area-frame-Bs_j4uu7.js} +15189 -37964
- package/dist/{pptx-C_uxLVKB.js → pptx-BhmLP_Ed.js} +9 -9
- package/dist/{pptx-CDP9dZHe.js → pptx-Bo9hCGQU.js} +58 -58
- package/dist/{pptx-model-source-O7LhpOjz.js → pptx-model-source-J0SrVkO6.js} +5 -5
- package/dist/pptx.mjs +5 -5
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{presentation-model-source-tmROzteR.js → presentation-model-source-CebYmrOD.js} +5 -5
- package/dist/region-map.mjs +53 -53
- package/dist/{render-CJVglUHl.js → render-hT2OVZUi.js} +2 -2
- package/dist/{render-worker-host-CyxPU4JU.js → render-worker-host-BmAQ-sWT.js} +1 -1
- package/dist/{render-worker-host-aF6aWkC0.js → render-worker-host-Cz224I38.js} +1 -1
- package/dist/{render-worker-host-BseIaVvm.js → render-worker-host-Desevuoc.js} +1 -1
- package/dist/renderer-BFWqhLEt.js +5833 -0
- package/dist/{renderer-CkGLj0CC.js → renderer-CvZ4JmoL.js} +696 -696
- package/dist/{resource-measurement-mXw-WjMF.js → resource-measurement-DBiUwblM.js} +162 -161
- package/dist/{session-Csv9maad.js → session-CWDKFWCh.js} +176 -176
- package/dist/{slide-pull-client-DRZYwBTu.js → slide-pull-client-BuBvXMyc.js} +1454 -1484
- package/dist/{three-d-BK5siJgJ.js → three-d-BKwNPAP4.js} +107 -107
- package/dist/three-d.mjs +625 -625
- package/dist/{wasm-runtime-generation-DX4y0Ecl.js → wasm-runtime-generation-BWGfM44b.js} +4 -4
- package/dist/{workbook-model-source-BTC4ISTS.js → workbook-model-source-Che8Zbjw.js} +6 -6
- package/dist/worker-source-DrwhR9fw.js +22 -0
- package/dist/{worksheet-pull-client-CkHgbtyM.js → worksheet-pull-client-Cxzj6uuB.js} +74 -74
- package/dist/{xlsx-D5569TPf.js → xlsx-C5BSwMUd.js} +24 -24
- package/dist/{xlsx-CpSDPAEU.js → xlsx-CUVUep5I.js} +433 -421
- package/dist/{xlsx-model-source-DPSkjFic.js → xlsx-model-source-C3_PiPBo.js} +55 -55
- package/dist/xlsx.mjs +5 -5
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +2 -2
- package/dist/assets/render-worker-CUOU6mL2.js +0 -16
- package/dist/assets/render-worker-DOqrFhSU.js +0 -15
- package/dist/assets/render-worker-DvWUdZUN.js +0 -35
- package/dist/plot-area-frame-CaJFvZ7p.js +0 -8502
- package/dist/renderer-Czw1cCC7.js +0 -5823
- package/dist/worker-source-I1cIYBel.js +0 -22
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { t as e } from "./chunk-Dy4uBu1J.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { a as d, c as f, g as p, i as m, l as h, r as g } from "./document-pull-client-
|
|
2
|
+
import { yo as t } from "./plot-area-frame-Bs_j4uu7.js";
|
|
3
|
+
import { B as n, F as r, H as i, N as a, U as o, j as s, qt as c, st as l, ut as u } from "./bounded-raw-part-cache-C3daknU-.js";
|
|
4
|
+
import { a as d, c as f, g as p, i as m, l as h, r as g } from "./document-pull-client-DhSGspvi.js";
|
|
5
5
|
import { n as _, t as ee } from "./abort-VrnK7mdP.js";
|
|
6
6
|
import { n as v, r as te, t as y } from "./wasm-loader-rlgHmcSv.js";
|
|
7
|
-
import { t as b } from "./wasm-runtime-generation-
|
|
7
|
+
import { t as b } from "./wasm-runtime-generation-BWGfM44b.js";
|
|
8
8
|
import { t as x } from "./in-process-pull-transport-DuXcPZng.js";
|
|
9
|
-
import { n as S, r as ne, t as re } from "./document-pull-worker-
|
|
10
|
-
import { a as ie } from "./render-
|
|
9
|
+
import { n as S, r as ne, t as re } from "./document-pull-worker-D-E0Iz3P.js";
|
|
10
|
+
import { a as ie } from "./render-hT2OVZUi.js";
|
|
11
11
|
//#region packages/docx/src/wasm/docx_parser.js
|
|
12
12
|
var C = /* @__PURE__ */ e({
|
|
13
13
|
DocxArchive: () => w,
|
|
@@ -270,8 +270,8 @@ async function ce(e) {
|
|
|
270
270
|
//#endregion
|
|
271
271
|
//#region packages/docx/src/internal/node-acquisition.ts
|
|
272
272
|
var J = "DOCX document session was aborted", le = b(C, "DOCX");
|
|
273
|
-
async function Y(e, t,
|
|
274
|
-
let c = n
|
|
273
|
+
async function Y(e, t, n, i) {
|
|
274
|
+
let c = a(n), l = new s({
|
|
275
275
|
enabled: c.debug || c.onResourceMetrics !== void 0,
|
|
276
276
|
format: "docx",
|
|
277
277
|
mode: "node",
|
|
@@ -283,13 +283,13 @@ async function Y(e, t, i, s) {
|
|
|
283
283
|
l.setSourceBytes(e.byteLength);
|
|
284
284
|
let u, d, f;
|
|
285
285
|
try {
|
|
286
|
-
_(
|
|
287
|
-
let [
|
|
288
|
-
u = await le(t).open(() => new p(e,
|
|
289
|
-
signal:
|
|
286
|
+
_(n.signal, J);
|
|
287
|
+
let [a, o, s] = r(c.policy), p = w;
|
|
288
|
+
u = await le(t).open(() => new p(e, a, o, s), {
|
|
289
|
+
signal: n.signal,
|
|
290
290
|
abortError: () => ee(J),
|
|
291
291
|
disposeOnAbort: (e) => e.free()
|
|
292
|
-
}), _(
|
|
292
|
+
}), _(n.signal, J);
|
|
293
293
|
let m = u.proxy;
|
|
294
294
|
l.checkpoint("container ready"), d = new re(() => m);
|
|
295
295
|
let h = {
|
|
@@ -298,8 +298,8 @@ async function Y(e, t, i, s) {
|
|
|
298
298
|
generation: 1
|
|
299
299
|
};
|
|
300
300
|
d.open(h), f = new x((e, t) => d?.dispatch(e, t), () => void 0);
|
|
301
|
-
let g, v = await
|
|
302
|
-
signal:
|
|
301
|
+
let g, v = await i(f, h, {
|
|
302
|
+
signal: n.signal,
|
|
303
303
|
onUsage: (e) => {
|
|
304
304
|
g = e, l.observeUsage(e);
|
|
305
305
|
}
|
|
@@ -316,7 +316,7 @@ async function Y(e, t, i, s) {
|
|
|
316
316
|
try {
|
|
317
317
|
u?.close((e) => e.free());
|
|
318
318
|
} catch {}
|
|
319
|
-
let t =
|
|
319
|
+
let t = o(e) ?? ne(e);
|
|
320
320
|
throw l.fail(t), t;
|
|
321
321
|
}
|
|
322
322
|
}
|
|
@@ -326,7 +326,7 @@ var X = "DOCX document session was aborted", Z = y(() => v(import.meta.url, "doc
|
|
|
326
326
|
async function ue(e, t) {
|
|
327
327
|
if (!t?.factory) throw TypeError("openDocxDocument requires a canvas factory");
|
|
328
328
|
if (t.legacyDoc !== void 0) {
|
|
329
|
-
let { openDocxSource: n } = await import("./docx-model-source-
|
|
329
|
+
let { openDocxSource: n } = await import("./docx-model-source-Ci6xb487.js");
|
|
330
330
|
return n(e, t, Z);
|
|
331
331
|
}
|
|
332
332
|
let n = c(t.cjkFallback), r = await Y($(e), Z(), t, (e, t, n) => g(e, t, n));
|
|
@@ -342,13 +342,13 @@ async function ue(e, t) {
|
|
|
342
342
|
try {
|
|
343
343
|
r.closeArchive();
|
|
344
344
|
} catch {}
|
|
345
|
-
let t =
|
|
345
|
+
let t = i(e) ?? e;
|
|
346
346
|
throw r.metrics.fail(t), t;
|
|
347
347
|
}
|
|
348
348
|
}
|
|
349
349
|
async function de(e, t = {}) {
|
|
350
350
|
if (t.legacyDoc !== void 0) {
|
|
351
|
-
let { materializeDocxSource: n } = await import("./docx-model-source-
|
|
351
|
+
let { materializeDocxSource: n } = await import("./docx-model-source-Ci6xb487.js");
|
|
352
352
|
return n(e, t, Z);
|
|
353
353
|
}
|
|
354
354
|
return te(async () => {
|
|
@@ -409,7 +409,7 @@ var Q = class {
|
|
|
409
409
|
}
|
|
410
410
|
refreshResourceUsage() {
|
|
411
411
|
try {
|
|
412
|
-
this.lastResourceUsage =
|
|
412
|
+
this.lastResourceUsage = n(this.archive.resource_usage()), this.metrics.observeUsage(this.lastResourceUsage);
|
|
413
413
|
} catch {}
|
|
414
414
|
return this.lastResourceUsage;
|
|
415
415
|
}
|
|
@@ -433,7 +433,7 @@ var Q = class {
|
|
|
433
433
|
fetchImage: this.fetchImage
|
|
434
434
|
})), _(this.signal, X), r;
|
|
435
435
|
}).catch((e) => {
|
|
436
|
-
let n =
|
|
436
|
+
let n = i(e) ?? e;
|
|
437
437
|
throw n instanceof t && (this.resourceFailure ??= n), this.metrics.fail(n), n;
|
|
438
438
|
}));
|
|
439
439
|
}
|
|
@@ -452,7 +452,7 @@ var Q = class {
|
|
|
452
452
|
};
|
|
453
453
|
}
|
|
454
454
|
} catch (e) {
|
|
455
|
-
throw t =
|
|
455
|
+
throw t = i(e) ?? e, t;
|
|
456
456
|
} finally {
|
|
457
457
|
try {
|
|
458
458
|
await this.close();
|
|
@@ -469,11 +469,11 @@ var Q = class {
|
|
|
469
469
|
return this.renderTail = t.then(() => void 0, () => void 0), t;
|
|
470
470
|
}
|
|
471
471
|
async release() {
|
|
472
|
-
await this.renderTail,
|
|
472
|
+
await this.renderTail, u(this.fetchImage), l(this.fetchImage), this.state = null;
|
|
473
473
|
try {
|
|
474
474
|
this.closeArchive();
|
|
475
475
|
} catch (e) {
|
|
476
|
-
let t =
|
|
476
|
+
let t = i(e) ?? e;
|
|
477
477
|
throw this.metrics.fail(t), t;
|
|
478
478
|
}
|
|
479
479
|
this.metrics.checkpoint("document session closed", this.lastResourceUsage), this.metrics.succeed({ pages: this.pageCount });
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { a as r, g as i, i as a, j as o, l as s, r as c } from "./document-pull-client-
|
|
1
|
+
import { H as e, U as t, qt as n } from "./bounded-raw-part-cache-C3daknU-.js";
|
|
2
|
+
import { a as r, g as i, i as a, j as o, l as s, r as c } from "./document-pull-client-DhSGspvi.js";
|
|
3
3
|
import { r as l } from "./wasm-loader-rlgHmcSv.js";
|
|
4
|
-
import { r as u } from "./document-pull-worker-
|
|
5
|
-
import { i as d, t as f } from "./docx-
|
|
6
|
-
import { t as p } from "./model-source-
|
|
4
|
+
import { r as u } from "./document-pull-worker-D-E0Iz3P.js";
|
|
5
|
+
import { i as d, t as f } from "./docx-CXfILbzI.js";
|
|
6
|
+
import { t as p } from "./model-source-BkmyX_r-.js";
|
|
7
7
|
//#region packages/node/src/docx-model-source.ts
|
|
8
8
|
var m = class extends f {
|
|
9
9
|
constructor(...e) {
|
|
@@ -16,8 +16,8 @@ var m = class extends f {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
};
|
|
19
|
-
async function h(
|
|
20
|
-
let l = n(i.cjkFallback), { acquired: u, viewDefaults: d } = await v(
|
|
19
|
+
async function h(t, i, a) {
|
|
20
|
+
let l = n(i.cjkFallback), { acquired: u, viewDefaults: d } = await v(t, i, a, c);
|
|
21
21
|
try {
|
|
22
22
|
if (i.signal?.aborted) {
|
|
23
23
|
let e = /* @__PURE__ */ Error("DOCX document session was aborted");
|
|
@@ -29,11 +29,11 @@ async function h(e, i, a) {
|
|
|
29
29
|
allowFootnoteContinuation: i.allowFootnoteContinuation !== !1
|
|
30
30
|
}), n = _(i.currentDate), a = r(u.result, t, n), c = d.showTrackedChanges === !0, p = c ? a.layoutVariants.layoutFor(o(n, n, !0)) : a.layoutVariants.defaultLayout, h = new (c ? m : f)(u.closeArchive, u.archive, u.result, t, p, i.factory, n, u.usage, u.metrics, i.signal);
|
|
31
31
|
return u.metrics.observeUsage(h.resourceUsage), u.metrics.checkpoint("pagination ready"), h;
|
|
32
|
-
} catch (
|
|
32
|
+
} catch (t) {
|
|
33
33
|
try {
|
|
34
34
|
u.closeArchive();
|
|
35
35
|
} catch {}
|
|
36
|
-
let n = t
|
|
36
|
+
let n = e(t) ?? t;
|
|
37
37
|
throw u.metrics.fail(n), n;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
@@ -67,11 +67,11 @@ function _(e) {
|
|
|
67
67
|
if (!Number.isFinite(t)) throw RangeError("currentDate must resolve to finite epoch milliseconds");
|
|
68
68
|
return t;
|
|
69
69
|
}
|
|
70
|
-
async function v(
|
|
71
|
-
let { acquireDocxSessionFromArchive: a, validateDocxModelSourceArchive: o, validateDocxModelSourceViewDefaults: s } = await import("./model-source-session-
|
|
70
|
+
async function v(e, n, r, i) {
|
|
71
|
+
let { acquireDocxSessionFromArchive: a, validateDocxModelSourceArchive: o, validateDocxModelSourceViewDefaults: s } = await import("./model-source-session-CnPCTRDD.js"), c = await p(e, "docx", {
|
|
72
72
|
...n,
|
|
73
73
|
source: n.legacyDoc
|
|
74
|
-
}, o, (
|
|
74
|
+
}, o, (e) => t(e) ?? u(e));
|
|
75
75
|
if (c.kind === "ooxml") return {
|
|
76
76
|
acquired: await d(c.bytes, r(), n, i),
|
|
77
77
|
viewDefaults: {}
|
package/dist/docx.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { u as n } from "./bounded-raw-part-cache-
|
|
3
|
-
import { a as r, c as i, d as a, f as o, i as s, n as c, o as l, p as u, r as d, s as f } from "./docx-
|
|
1
|
+
import { vo as e, yo as t } from "./plot-area-frame-Bs_j4uu7.js";
|
|
2
|
+
import { u as n } from "./bounded-raw-part-cache-C3daknU-.js";
|
|
3
|
+
import { a as r, c as i, d as a, f as o, i as s, n as c, o as l, p as u, r as d, s as f } from "./docx-CCZBO1WQ.js";
|
|
4
4
|
import { f as p, u as m } from "./pixel-budget-BpTYrepD.js";
|
|
5
5
|
import { i as h, t as g } from "./tiff-contract-C6M3QcPp.js";
|
|
6
|
-
import { D as _ } from "./canvas-viewer-mechanics-
|
|
6
|
+
import { D as _ } from "./canvas-viewer-mechanics-SZWSnn6j.js";
|
|
7
7
|
export { i as DocxDocument, d as DocxScrollViewer, s as DocxViewer, m as OoxmlDecodedImageLimitError, e as OoxmlError, t as OoxmlResourceLimitError, g as TiffDecodeError, _ as autoResize, l as buildDocxHighlightLayer, f as buildDocxTextLayer, p as isOoxmlDecodedImageLimitError, h as isTiffDecodeError, c as noteText, n as openExternalHyperlink, r as readDocxTextSelectionContext, o as resolveCommentAnchorRuns, u as resolveDocxCommentThreads, a as resolveRevisionAnchorRuns };
|
package/dist/docx_parser_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ar as e, cr as t, fr as n, hr as r, or as i, pr as a, tr as o, vr as s } from "./plot-area-frame-
|
|
2
|
-
import { At as c,
|
|
1
|
+
import { ar as e, cr as t, fr as n, hr as r, or as i, pr as a, tr as o, vr as s } from "./plot-area-frame-Bs_j4uu7.js";
|
|
2
|
+
import { At as c, Bt as l, Ct as u, Dt as d, Ft as f, Ht as p, It as m, Mt as h, Ot as g, St as _, Ut as v, Vt as y, Wt as b, jt as x, kt as S, zt as C } from "./bounded-raw-part-cache-C3daknU-.js";
|
|
3
3
|
//#region packages/core/src/shape/drawingml-geometry.ts
|
|
4
4
|
var w = new Set([
|
|
5
5
|
"line",
|
|
@@ -39,31 +39,31 @@ function D(e) {
|
|
|
39
39
|
var O = 1;
|
|
40
40
|
function k(e, t, n = Infinity) {
|
|
41
41
|
let r = 0;
|
|
42
|
-
if (!(n === Infinity || Number.isSafeInteger(n) && n > 0)) throw new
|
|
42
|
+
if (!(n === Infinity || Number.isSafeInteger(n) && n > 0)) throw new C("Invalid DrawingML geometry budget");
|
|
43
43
|
let i = (e) => {
|
|
44
|
-
if (r += e, !Number.isSafeInteger(r) || r > n) throw new
|
|
45
|
-
}, { x: a, y: o, w: l, h:
|
|
44
|
+
if (r += e, !Number.isSafeInteger(r) || r > n) throw new C("DrawingML geometry work budget exceeded");
|
|
45
|
+
}, { x: a, y: o, w: l, h: u } = e.rect;
|
|
46
46
|
if (![
|
|
47
47
|
t,
|
|
48
48
|
e.rect.x,
|
|
49
49
|
e.rect.y,
|
|
50
50
|
l,
|
|
51
|
-
|
|
51
|
+
u,
|
|
52
52
|
e.transform.rotationDeg
|
|
53
|
-
].every(Number.isFinite) || t < 0 || l < 0 ||
|
|
53
|
+
].every(Number.isFinite) || t < 0 || l < 0 || u < 0) throw RangeError("Invalid DrawingML geometry frame");
|
|
54
54
|
i(1);
|
|
55
|
-
let
|
|
56
|
-
if (i(
|
|
57
|
-
let
|
|
58
|
-
|
|
55
|
+
let f = e.stroke;
|
|
56
|
+
if (i(f?.customDash?.length ?? 0), e.geometry.kind === "preset" && e.geometry.adjustments.some((e) => e !== null && !Number.isFinite(e))) throw RangeError("Non-finite DrawingML adjustment");
|
|
57
|
+
let _ = f ? s(f, t) : null, y = [], k = [], A = (e, t, n, r = "nonzero") => {
|
|
58
|
+
y.push(Object.freeze({
|
|
59
59
|
path: e,
|
|
60
60
|
fill: t,
|
|
61
61
|
stroke: n,
|
|
62
62
|
fillRule: r
|
|
63
63
|
}));
|
|
64
64
|
}, j = (e, n, r, a) => {
|
|
65
|
-
if (!a || !
|
|
66
|
-
let o =
|
|
65
|
+
if (!a || !f) return;
|
|
66
|
+
let o = g(a, f, t, O, i);
|
|
67
67
|
if (o) {
|
|
68
68
|
if (![
|
|
69
69
|
e,
|
|
@@ -78,65 +78,65 @@ function k(e, t, n = Infinity) {
|
|
|
78
78
|
geometry: o
|
|
79
79
|
}));
|
|
80
80
|
}
|
|
81
|
-
}, M =
|
|
82
|
-
if (!(r > 0 || a > 0) || !
|
|
83
|
-
A(e, t,
|
|
81
|
+
}, M = f?.headEnd ? d(f.headEnd, f, t, O) : 0, N = f?.tailEnd ? d(f.tailEnd, f, t, O) : 0, P = (e, t, n, r, a) => {
|
|
82
|
+
if (!(r > 0 || a > 0) || !_) {
|
|
83
|
+
A(e, t, _, n);
|
|
84
84
|
return;
|
|
85
85
|
}
|
|
86
|
-
let o =
|
|
87
|
-
i(o.reduce((e, t) => e + 1 + t.args.length, 0)), t !== "none" && A(e, t, null, n), A(o, "none",
|
|
88
|
-
}, F =
|
|
86
|
+
let o = S(e, r, a);
|
|
87
|
+
i(o.reduce((e, t) => e + 1 + t.args.length, 0)), t !== "none" && A(e, t, null, n), A(o, "none", _, n);
|
|
88
|
+
}, F = p(i);
|
|
89
89
|
if (e.geometry.kind === "preset") {
|
|
90
90
|
i(e.geometry.adjustments.length);
|
|
91
|
-
let t = e.geometry.name.toLowerCase(), n = [...e.geometry.adjustments], r = E(t) && !!(
|
|
92
|
-
if (
|
|
93
|
-
let n = t ===
|
|
94
|
-
s && n && e.stroke ? P(e.path, e.fill, "nonzero", M, N) : A(e.path, e.fill, e.stroke && !(r && n) ?
|
|
91
|
+
let t = e.geometry.name.toLowerCase(), n = [...e.geometry.adjustments], r = E(t) && !!(f?.headEnd || f?.tailEnd), s = t.startsWith("curvedconnector"), d = m(t, l, u, n, i, a, o);
|
|
92
|
+
if (d) d.forEach((e, t) => {
|
|
93
|
+
let n = t === d.length - 1 && (e.fill === "none" || e.fill == null);
|
|
94
|
+
s && n && e.stroke ? P(e.path, e.fill, "nonzero", M, N) : A(e.path, e.fill, e.stroke && !(r && n) ? _ : null);
|
|
95
95
|
});
|
|
96
96
|
else {
|
|
97
|
-
let e =
|
|
98
|
-
|
|
97
|
+
let e = p(i);
|
|
98
|
+
c(e.sink, t, a, o, l, u, n[0], n[1], n[2], n[3]), A(Object.freeze(e.commands), null, _, "nonzero");
|
|
99
99
|
}
|
|
100
|
-
if (
|
|
101
|
-
let e =
|
|
100
|
+
if (x(F.sink, e.geometry.name, a, o, l, u, n) || c(F.sink, e.geometry.name, a, o, l, u, n[0], n[1], n[2], n[3]), f && (w.has(t) || T.has(t))) {
|
|
101
|
+
let e = h(t, a, o, l, u, n);
|
|
102
102
|
if (e) {
|
|
103
103
|
if (r && e.vertices.length >= 2) {
|
|
104
|
-
let t =
|
|
104
|
+
let t = p(i), n = e.vertices;
|
|
105
105
|
t.sink.moveTo(n[0].x, n[0].y);
|
|
106
106
|
for (let e = 1; e < n.length; e++) t.sink.lineTo(n[e].x, n[e].y);
|
|
107
|
-
let r =
|
|
108
|
-
r.length >= 2 && A(r, "none",
|
|
107
|
+
let r = S(Object.freeze(t.commands), M, N);
|
|
108
|
+
r.length >= 2 && A(r, "none", _);
|
|
109
109
|
}
|
|
110
|
-
j(e.end.x, e.end.y, e.end.angle,
|
|
110
|
+
j(e.end.x, e.end.y, e.end.angle, f.tailEnd), j(e.start.x, e.start.y, e.start.angle, f.headEnd);
|
|
111
111
|
}
|
|
112
112
|
}
|
|
113
113
|
} else {
|
|
114
114
|
let { subpaths: t } = e.geometry;
|
|
115
115
|
for (let e of t) i(e.length + 1);
|
|
116
|
-
let n = e.geometry.paint?.length === t.length ? e.geometry.paint : null, r =
|
|
116
|
+
let n = e.geometry.paint?.length === t.length ? e.geometry.paint : null, r = f && (M > 0 || N > 0) ? v(t) : null, s = r?.start ? M : 0, c = r?.end ? N : 0;
|
|
117
117
|
if (n) t.forEach((e, r) => {
|
|
118
|
-
let
|
|
119
|
-
|
|
120
|
-
let f = Object.freeze(
|
|
121
|
-
n[r].stroke === !1 ? A(f,
|
|
118
|
+
let d = p(i);
|
|
119
|
+
b(d.sink, [e], a, o, l, u);
|
|
120
|
+
let f = Object.freeze(d.commands), m = n[r].fill ?? null;
|
|
121
|
+
n[r].stroke === !1 ? A(f, m, null, n[r].fillRule) : P(f, m, n[r].fillRule ?? "nonzero", r === 0 ? s : 0, r === t.length - 1 ? c : 0);
|
|
122
122
|
});
|
|
123
123
|
else {
|
|
124
|
-
let e =
|
|
125
|
-
|
|
124
|
+
let e = p(i);
|
|
125
|
+
b(e.sink, t, a, o, l, u), P(Object.freeze(e.commands), null, "nonzero", s, c);
|
|
126
126
|
}
|
|
127
|
-
if (
|
|
128
|
-
let e =
|
|
129
|
-
e.start && j(a + e.start.x * l, o + e.start.y *
|
|
127
|
+
if (b(F.sink, n ? t.filter((e, t) => n[t].fill !== "none") : t, a, o, l, u), f) {
|
|
128
|
+
let e = v(t);
|
|
129
|
+
e.start && j(a + e.start.x * l, o + e.start.y * u, Math.atan2(e.start.dy * u, e.start.dx * l), f.headEnd), e.end && j(a + e.end.x * l, o + e.end.y * u, Math.atan2(e.end.dy * u, e.end.dx * l), f.tailEnd);
|
|
130
130
|
}
|
|
131
131
|
}
|
|
132
132
|
return Object.freeze({
|
|
133
133
|
width: l,
|
|
134
|
-
height:
|
|
134
|
+
height: u,
|
|
135
135
|
scale: t,
|
|
136
136
|
originX: a,
|
|
137
137
|
originY: o,
|
|
138
138
|
sourceKey: D(e),
|
|
139
|
-
paths: Object.freeze(
|
|
139
|
+
paths: Object.freeze(y),
|
|
140
140
|
arrows: Object.freeze(k),
|
|
141
141
|
fillSilhouette: Object.freeze(F.commands),
|
|
142
142
|
workUnits: r
|
|
@@ -155,9 +155,9 @@ function A(e, t) {
|
|
|
155
155
|
if (!n || n.width !== e.rect.w || n.height !== e.rect.h || n.scale !== t || n.sourceKey !== D(e)) throw RangeError("Missing or stale retained DrawingML geometry");
|
|
156
156
|
if (![n.originX, n.originY].every(Number.isFinite)) throw RangeError("Invalid retained DrawingML origin");
|
|
157
157
|
if (!Number.isSafeInteger(n.workUnits) || n.workUnits < 1 || !Array.isArray(n.paths) || !Array.isArray(n.arrows)) throw RangeError("Invalid retained DrawingML work/scheduling");
|
|
158
|
-
if (n.paths.length + n.arrows.length > n.workUnits) throw new
|
|
158
|
+
if (n.paths.length + n.arrows.length > n.workUnits) throw new C("Retained geometry scheduling exceeds its acquired work");
|
|
159
159
|
let r = 0, i = (e) => {
|
|
160
|
-
if (r += e, r > n.workUnits) throw new
|
|
160
|
+
if (r += e, r > n.workUnits) throw new C("Retained geometry paths exceed their acquired work");
|
|
161
161
|
}, a = (e) => {
|
|
162
162
|
if (!Number.isFinite(e.lineWidth) || e.lineWidth < 0 || !Number.isFinite(e.miterLimit) || e.miterLimit <= 0 || ![
|
|
163
163
|
"butt",
|
|
@@ -170,7 +170,7 @@ function A(e, t) {
|
|
|
170
170
|
].includes(e.lineJoin) || !Array.isArray(e.dash) || e.dash.length > n.workUnits || !e.dash.every((e) => Number.isFinite(e) && e >= 0)) throw RangeError("Invalid retained stroke geometry");
|
|
171
171
|
};
|
|
172
172
|
for (let e of n.paths) {
|
|
173
|
-
if (
|
|
173
|
+
if (y(e.path, i), e.fill !== null && ![
|
|
174
174
|
"norm",
|
|
175
175
|
"none",
|
|
176
176
|
"lighten",
|
|
@@ -181,14 +181,14 @@ function A(e, t) {
|
|
|
181
181
|
if (e.fillRule !== "nonzero" && e.fillRule !== "evenodd") throw RangeError("Invalid retained fill rule");
|
|
182
182
|
e.stroke && a(e.stroke);
|
|
183
183
|
}
|
|
184
|
-
|
|
184
|
+
y(n.fillSilhouette, i);
|
|
185
185
|
for (let e of n.arrows) {
|
|
186
186
|
if (![
|
|
187
187
|
e.tipX,
|
|
188
188
|
e.tipY,
|
|
189
189
|
e.angle
|
|
190
190
|
].every(Number.isFinite) || !["fill", "stroke"].includes(e.geometry.paint)) throw RangeError("Invalid retained arrow frame");
|
|
191
|
-
|
|
191
|
+
y(e.geometry.path, i), a(e.geometry.stroke);
|
|
192
192
|
}
|
|
193
193
|
return n;
|
|
194
194
|
}
|
|
@@ -266,7 +266,7 @@ function L(e, t, n) {
|
|
|
266
266
|
function R(e, t, n, r, i, a) {
|
|
267
267
|
let o = t.resolvedGeometry ? A(t, t.resolvedGeometry.scale) : k(t, 1);
|
|
268
268
|
if (i !== o.width || a !== o.height) throw RangeError("Retained DrawingML silhouette frame mismatch");
|
|
269
|
-
|
|
269
|
+
l(e, o.fillSilhouette, n - o.originX, r - o.originY);
|
|
270
270
|
}
|
|
271
271
|
function z(e, t) {
|
|
272
272
|
let { x: n, y: r, w: i, h: a } = t.rect;
|
|
@@ -284,15 +284,15 @@ function V(e, n, r) {
|
|
|
284
284
|
resolvedGeometry: o
|
|
285
285
|
};
|
|
286
286
|
t(n.stroke?.fill) && (e = a(e));
|
|
287
|
-
let { x: c, y:
|
|
287
|
+
let { x: c, y: d, w: p, h: m } = n.rect;
|
|
288
288
|
L(e, n, () => {
|
|
289
|
-
let t = i(n.fill, e, c,
|
|
289
|
+
let t = i(n.fill, e, c, d, p, m, n.transform.rotationDeg, I, void 0, (e, t, n, r, i) => R(e, s, t, n, r, i)), a = n.stroke;
|
|
290
290
|
for (let r of o.paths) {
|
|
291
|
-
if (e.beginPath(),
|
|
291
|
+
if (e.beginPath(), l(e, r.path, c - o.originX, d - o.originY), t && r.fill !== "none") {
|
|
292
292
|
e.save();
|
|
293
293
|
try {
|
|
294
294
|
e.fillStyle = t, r.fillRule === "evenodd" ? e.fill("evenodd") : e.fill();
|
|
295
|
-
let n =
|
|
295
|
+
let n = f(r.fill);
|
|
296
296
|
n && (e.fillStyle = n, r.fillRule === "evenodd" ? e.fill("evenodd") : e.fill());
|
|
297
297
|
} finally {
|
|
298
298
|
e.restore();
|
|
@@ -301,8 +301,8 @@ function V(e, n, r) {
|
|
|
301
301
|
a && r.stroke && (B(e, a, r.stroke, n.rect, n.transform.rotationDeg), e.stroke());
|
|
302
302
|
}
|
|
303
303
|
if (a) for (let t of o.arrows) {
|
|
304
|
-
let i = c - o.originX + t.tipX, s =
|
|
305
|
-
|
|
304
|
+
let i = c - o.originX + t.tipX, s = d - o.originY + t.tipY;
|
|
305
|
+
_(e, i, s, t.angle, t.geometry, a, u(e, a, r, I, i, s, t.angle, t.end, n.rect, n.transform.rotationDeg, I));
|
|
306
306
|
}
|
|
307
307
|
});
|
|
308
308
|
}
|