@silurus/ooxml 0.85.3 → 0.86.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +39 -7
- package/dist/assets/render-worker-BCGnuBLj.js +10 -0
- package/dist/assets/render-worker-CB4DxjXg.js +31 -0
- package/dist/assets/render-worker-CHW0F0n6.js +11 -0
- package/dist/{bounded-raw-part-cache-C6ro6Ezf.js → bounded-raw-part-cache-DVx3Camo.js} +12 -10
- package/dist/{canvas-viewer-mechanics-CDNMJ-Yz.js → canvas-viewer-mechanics-B3A7KLLi.js} +1 -1
- package/dist/{comment-ui-runtime-DAKBCpsM.js → comment-ui-runtime-DEtgcmj7.js} +5 -5
- package/dist/comment-ui-runtime-TLHustXJ.js +2 -0
- package/dist/{comment-ui-runtime-CAbpuWi_.js → comment-ui-runtime-ssI6IE39.js} +4 -4
- package/dist/{comments-Brfxa3hQ.js → comments-CAn2A_Xh.js} +1 -1
- package/dist/delimited-text-worker-host-DcHj_JZt.js +27 -0
- package/dist/{document-pull-client-F3ox_VXK.js → document-pull-client-xZrA2IjM.js} +577 -576
- package/dist/{docx-BYvm3TWw.js → docx-DzDiGvqe.js} +63 -63
- package/dist/docx.mjs +5 -5
- package/dist/docx_parser_bg.wasm +0 -0
- package/dist/{dom-interaction-boundary-CDGegIB5.js → dom-interaction-boundary-DK1JLkrz.js} +2 -2
- package/dist/{line-metrics-BGtFM-ec.js → hyperlink-enyPbflR.js} +847 -877
- package/dist/index.mjs +3 -3
- package/dist/line-distribute-BFB575d6.js +1023 -0
- package/dist/line-metrics-CBbw80Ko.js +60 -0
- package/dist/node.mjs +91 -91
- package/dist/{pptx-BqpVTP8p.js → pptx-D_U62nl-.js} +71 -71
- package/dist/pptx.mjs +5 -5
- package/dist/pptx_parser_bg.wasm +0 -0
- package/dist/{render-DeZpRCfx.js → render-DSn0d35X.js} +1 -1
- package/dist/{render-worker-host-CBcQXsR5.js → render-worker-host-BHz9vjxB.js} +1 -1
- package/dist/{render-worker-host-BKtXmlEF.js → render-worker-host-CO0UYoQh.js} +1 -1
- package/dist/{render-worker-host-CNKQ76tu.js → render-worker-host-CbYDBg7U.js} +1 -1
- package/dist/{resource-measurement-D41R-0Bl.js → resource-measurement-Do07ZRcR.js} +7 -7
- package/dist/{session-n2p5_jxV.js → session-C1GYhr6n.js} +77 -77
- package/dist/{slide-pull-client-Dwek7xW8.js → slide-pull-client-DuEaUxPw.js} +732 -732
- package/dist/types/chart-ex.d.ts +2 -2
- package/dist/types/docx.d.ts +10 -10
- package/dist/types/index.d.ts +38 -18
- package/dist/types/math.d.ts +1 -1
- package/dist/types/node.d.ts +6 -5
- package/dist/types/pptx.d.ts +10 -10
- package/dist/types/region-map.d.ts +2 -2
- package/dist/types/three-d.d.ts +2 -2
- package/dist/types/tiff.d.ts +1 -1
- package/dist/types/xlsx.d.ts +34 -14
- package/dist/{worksheet-pull-client-C9sC36Vu.js → worksheet-pull-client-eDiHHEG2.js} +99 -96
- package/dist/{xlsx-DSU6pV1O.js → xlsx-CMHmYTHP.js} +1629 -1469
- package/dist/xlsx.mjs +5 -5
- package/dist/xlsx_parser_bg.wasm +0 -0
- package/package.json +1 -1
- package/dist/assets/render-worker-D1O73gYW.js +0 -10
- package/dist/assets/render-worker-DHP0rgcW.js +0 -24
- package/dist/assets/render-worker-V2wWYA4O.js +0 -11
- package/dist/comment-ui-runtime-DTaaZdXC.js +0 -2
- package/dist/line-distribute-BsV4MVZ2.js +0 -1023
- /package/dist/{comment-occurrence-tj54AXXB.js → comment-occurrence-Dhdplprg.js} +0 -0
- /package/dist/{highlight-rect-DBcYVJDv.js → highlight-rect-FuUSmL3a.js} +0 -0
- /package/dist/{read-only-comment-decoration-Mv_SAiHy.js → read-only-comment-decoration-BTnWEeo5.js} +0 -0
- /package/dist/{read-only-comment-margin-Cqu-Ir0C.js → read-only-comment-margin-plStyGfE.js} +0 -0
- /package/dist/{source-key-BkBB3X82.js → source-key-Ktb1GRE5.js} +0 -0
package/dist/pptx.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { u as e } from "./slide-pull-client-
|
|
2
|
-
import {
|
|
3
|
-
import { T as i } from "./canvas-viewer-mechanics-
|
|
1
|
+
import { u as e } from "./slide-pull-client-DuEaUxPw.js";
|
|
2
|
+
import { on as t, r as n, sn as r } from "./hyperlink-enyPbflR.js";
|
|
3
|
+
import { T as i } from "./canvas-viewer-mechanics-B3A7KLLi.js";
|
|
4
4
|
import { l as a, s as o } from "./pixel-budget-Dgjw269h.js";
|
|
5
5
|
import { i as s, s as c } from "./raster-target-ojDdQizC.js";
|
|
6
|
-
import { a as l, i as u, n as d, o as f, r as p, s as m } from "./pptx-
|
|
7
|
-
export { o as OoxmlDecodedImageLimitError,
|
|
6
|
+
import { a as l, i as u, n as d, o as f, r as p, s as m } from "./pptx-D_U62nl-.js";
|
|
7
|
+
export { o as OoxmlDecodedImageLimitError, t as OoxmlError, r as OoxmlResourceLimitError, l as PptxPresentation, d as PptxScrollViewer, p as PptxViewer, s as TiffDecodeError, i as autoResize, f as buildPptxHighlightLayer, m as buildPptxTextLayer, a as isOoxmlDecodedImageLimitError, c as isTiffDecodeError, n as openExternalHyperlink, u as readPptxTextSelectionContext, e as renderSlide };
|
package/dist/pptx_parser_bg.wasm
CHANGED
|
Binary file
|
|
@@ -46,7 +46,7 @@ function a(e, t) {
|
|
|
46
46
|
return n = o.then(() => void 0, () => void 0), o;
|
|
47
47
|
}
|
|
48
48
|
async function o(e, t, n, r = {}) {
|
|
49
|
-
let { renderSlide: i } = await import("./session-
|
|
49
|
+
let { renderSlide: i } = await import("./session-C1GYhr6n.js").then((e) => e.t), o = t.slides[n];
|
|
50
50
|
if (!o) throw Error(`Slide index ${n} out of range`);
|
|
51
51
|
let s = r.width ?? 960, c = r.dpr ?? 2, l = r.fetchImage ?? (async () => new Blob([])), u = async () => {
|
|
52
52
|
await i(e, o, t.slideWidth, t.slideHeight, {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region packages/docx/src/render-worker.ts?worker&url
|
|
2
|
-
var e = "" + new URL("assets/render-worker-
|
|
2
|
+
var e = "" + new URL("assets/render-worker-BCGnuBLj.js", import.meta.url).href;
|
|
3
3
|
//#endregion
|
|
4
4
|
//#region packages/docx/src/render-worker-host.ts
|
|
5
5
|
function t() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region packages/pptx/src/render-worker.ts?worker&url
|
|
2
|
-
var e = "" + new URL("assets/render-worker-
|
|
2
|
+
var e = "" + new URL("assets/render-worker-CHW0F0n6.js", import.meta.url).href;
|
|
3
3
|
//#endregion
|
|
4
4
|
//#region packages/pptx/src/render-worker-host.ts
|
|
5
5
|
function t() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
//#region packages/xlsx/src/render-worker.ts?worker&url
|
|
2
|
-
var e = "" + new URL("assets/render-worker-
|
|
2
|
+
var e = "" + new URL("assets/render-worker-CB4DxjXg.js", import.meta.url).href;
|
|
3
3
|
//#endregion
|
|
4
4
|
//#region packages/xlsx/src/render-worker-host.ts
|
|
5
5
|
function t() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { _t as e, ft as t, it as n, pt as r, ut as i } from "./hyperlink-enyPbflR.js";
|
|
2
2
|
import { an as a } from "./plot-area-frame-D5hEOgkJ.js";
|
|
3
3
|
import { i as o } from "./pixel-budget-Dgjw269h.js";
|
|
4
4
|
import { r as s } from "./raster-target-ojDdQizC.js";
|
|
@@ -15,23 +15,23 @@ async function u(u, d, f, p, m = {}) {
|
|
|
15
15
|
...v,
|
|
16
16
|
targetWidthPx: void 0,
|
|
17
17
|
targetHeightPx: void 0
|
|
18
|
-
} : v, b = f ?
|
|
18
|
+
} : v, b = f ? i(p, l) : void 0, x = await t(u, d, p, y);
|
|
19
19
|
if (!f || !x) return x;
|
|
20
|
-
let S = await
|
|
21
|
-
return
|
|
20
|
+
let S = await e(u, d, p, y, b, x), C = s(Number(x.width), Number(x.height), _.targetWidthPx, _.targetHeightPx), w = C ? `|resize:${C.resizeWidth}x${C.resizeHeight}` : "";
|
|
21
|
+
return r(l, `${c(S, f)}${w}${g ? "|strict" : ""}`, p, async () => {
|
|
22
22
|
let { w: e, h: t } = a(x);
|
|
23
23
|
if (e <= 0 || t <= 0) return {
|
|
24
24
|
bitmap: g ? null : x,
|
|
25
25
|
owned: !1
|
|
26
26
|
};
|
|
27
|
-
let
|
|
27
|
+
let r = await n(x, f, {
|
|
28
28
|
width: e,
|
|
29
29
|
height: t,
|
|
30
30
|
offscreenFactory: h,
|
|
31
31
|
targetWidthPx: _.targetWidthPx,
|
|
32
32
|
targetHeightPx: _.targetHeightPx
|
|
33
33
|
});
|
|
34
|
-
if (
|
|
34
|
+
if (r === x) {
|
|
35
35
|
if (g) return {
|
|
36
36
|
bitmap: null,
|
|
37
37
|
owned: !1
|
|
@@ -47,7 +47,7 @@ async function u(u, d, f, p, m = {}) {
|
|
|
47
47
|
owned: e !== x
|
|
48
48
|
};
|
|
49
49
|
}
|
|
50
|
-
let i =
|
|
50
|
+
let i = r;
|
|
51
51
|
return {
|
|
52
52
|
bitmap: i,
|
|
53
53
|
owned: i !== x
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { t as e } from "./chunk-DmhlhrBa.js";
|
|
2
|
-
import { a as t, u as n } from "./slide-pull-client-
|
|
3
|
-
import { B as r,
|
|
4
|
-
import { t as
|
|
2
|
+
import { a as t, u as n } from "./slide-pull-client-DuEaUxPw.js";
|
|
3
|
+
import { B as r, G as i, H as a, I as o, J as s, M as c, N as l, P as u, R as d, U as f, V as p, W as m, X as ee, Y as te, Yt as h, q as g, sn as _ } from "./hyperlink-enyPbflR.js";
|
|
4
|
+
import { t as v } from "./transfer-mIj7E7NB.js";
|
|
5
5
|
//#region packages/pptx/src/slide-cursor-operation.ts
|
|
6
|
-
function
|
|
6
|
+
function y(e) {
|
|
7
7
|
try {
|
|
8
|
-
return
|
|
8
|
+
return p(e((e) => e.slide_cursor_resource_usage()));
|
|
9
9
|
} catch (e) {
|
|
10
10
|
if (String(e).includes("slide cursor usage is unavailable")) return;
|
|
11
11
|
throw e;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
function
|
|
14
|
+
function b(e, t, n, r, i) {
|
|
15
15
|
let a, o;
|
|
16
16
|
try {
|
|
17
17
|
if (i) {
|
|
18
18
|
if (!r) throw Error("slide payload is missing before acknowledgement");
|
|
19
|
-
let t = i(n, r,
|
|
19
|
+
let t = i(n, r, y(e));
|
|
20
20
|
typeof t == "function" ? a = t : t && ({rollback: a, commit: o} = t);
|
|
21
21
|
}
|
|
22
22
|
e((e) => e.acknowledge_slide(t.operationId, t.generation)), o?.();
|
|
@@ -29,8 +29,8 @@ function ee(e, t, n, r, i) {
|
|
|
29
29
|
}
|
|
30
30
|
//#endregion
|
|
31
31
|
//#region packages/pptx/src/slide-pull-worker.ts
|
|
32
|
-
var
|
|
33
|
-
coordinatorGeneration = new
|
|
32
|
+
var ne = "ooxml-pull-resetting", re = "ooxml-pull-reset-failed", ie = class {
|
|
33
|
+
coordinatorGeneration = new u();
|
|
34
34
|
sessions = /* @__PURE__ */ new Map();
|
|
35
35
|
pendingOpens = /* @__PURE__ */ new Map();
|
|
36
36
|
operationTail = Promise.resolve();
|
|
@@ -45,7 +45,7 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
45
45
|
return this.coordinatorGeneration;
|
|
46
46
|
}
|
|
47
47
|
reserveOpen(e) {
|
|
48
|
-
if (this.assertReady(),
|
|
48
|
+
if (this.assertReady(), ae(e), this.pendingOpens.has(e.sessionId) || this.sessions.has(e.sessionId)) throw Error("slide pull session id is already reserved");
|
|
49
49
|
this.pendingOpens.set(e.sessionId, {
|
|
50
50
|
identity: e,
|
|
51
51
|
canceled: !1
|
|
@@ -61,12 +61,12 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
61
61
|
if (this.assertReady(), this.resourceFailure) throw this.resourceFailure;
|
|
62
62
|
if (!Number.isSafeInteger(e) || e < 0) throw RangeError("slide index must be a non-negative safe integer");
|
|
63
63
|
let n = this.pendingOpens.get(t.sessionId);
|
|
64
|
-
if (!n || !
|
|
64
|
+
if (!n || !x(n.identity, t)) throw Error("slide pull session open reservation is stale or missing");
|
|
65
65
|
let r, a = new Promise((e) => {
|
|
66
66
|
r = e;
|
|
67
67
|
}), o = this.operationTail.then(() => this.coordinator.enqueue(async () => {
|
|
68
68
|
if (n.canceled) throw Error("slide pull session open was canceled");
|
|
69
|
-
let a, o = !1, s = new
|
|
69
|
+
let a, o = !1, s = new l({
|
|
70
70
|
...t,
|
|
71
71
|
maxByteCredit: h,
|
|
72
72
|
coordinator: this.coordinator,
|
|
@@ -76,21 +76,21 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
76
76
|
try {
|
|
77
77
|
r = this.executeArchive((r) => r.pull_slide(e, t.operationId, t.generation, n));
|
|
78
78
|
} catch (e) {
|
|
79
|
-
throw
|
|
79
|
+
throw i(e, n, h) || (this.latchResourceFailure(e), e);
|
|
80
80
|
}
|
|
81
|
-
let
|
|
82
|
-
return this.acceptSlide && (a = JSON.parse(new TextDecoder().decode(new Uint8Array(
|
|
83
|
-
payload:
|
|
84
|
-
byteLength:
|
|
81
|
+
let s = v(r);
|
|
82
|
+
return this.acceptSlide && (a = JSON.parse(new TextDecoder().decode(new Uint8Array(s)))), o = !0, {
|
|
83
|
+
payload: s,
|
|
84
|
+
byteLength: s.byteLength,
|
|
85
85
|
done: !0,
|
|
86
|
-
transfer: [
|
|
86
|
+
transfer: [s]
|
|
87
87
|
};
|
|
88
88
|
},
|
|
89
89
|
measureChunk: ({ payload: e }) => e.byteLength,
|
|
90
90
|
acknowledge: () => {
|
|
91
91
|
if (!o) throw Error("slide unit is not awaiting acknowledgement");
|
|
92
92
|
try {
|
|
93
|
-
|
|
93
|
+
b(this.executeArchive, t, e, a, this.acceptSlide);
|
|
94
94
|
} catch (e) {
|
|
95
95
|
throw this.latchResourceFailure(e), e;
|
|
96
96
|
}
|
|
@@ -153,9 +153,9 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
153
153
|
if (n) return n.host.dispatch(e, t);
|
|
154
154
|
let r = this.pendingOpens.get(e.sessionId);
|
|
155
155
|
if (r && (e.kind === "cancel" || e.kind === "close")) {
|
|
156
|
-
let n =
|
|
156
|
+
let n = x(r.identity, e);
|
|
157
157
|
return n && (r.canceled = !0), t(n ? {
|
|
158
|
-
protocol:
|
|
158
|
+
protocol: c,
|
|
159
159
|
kind: "accepted",
|
|
160
160
|
sessionId: e.sessionId,
|
|
161
161
|
operationId: e.operationId,
|
|
@@ -165,7 +165,7 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
165
165
|
} : this.staleLifecycleResponse(e)), Promise.resolve();
|
|
166
166
|
}
|
|
167
167
|
return e.kind === "cancel" || e.kind === "close" ? (t({
|
|
168
|
-
protocol:
|
|
168
|
+
protocol: c,
|
|
169
169
|
kind: "accepted",
|
|
170
170
|
sessionId: e.sessionId,
|
|
171
171
|
operationId: e.operationId,
|
|
@@ -173,13 +173,13 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
173
173
|
requestId: e.requestId,
|
|
174
174
|
command: e.kind
|
|
175
175
|
}), Promise.resolve()) : (t({
|
|
176
|
-
protocol:
|
|
176
|
+
protocol: c,
|
|
177
177
|
kind: "error",
|
|
178
178
|
sessionId: e.sessionId,
|
|
179
179
|
operationId: e.operationId,
|
|
180
180
|
generation: e.generation,
|
|
181
181
|
requestId: e.requestId,
|
|
182
|
-
error:
|
|
182
|
+
error: m(/* @__PURE__ */ Error("slide pull session is not open"))
|
|
183
183
|
}), Promise.resolve());
|
|
184
184
|
}
|
|
185
185
|
async dispatchSafely(e, t) {
|
|
@@ -188,13 +188,13 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
188
188
|
} catch (n) {
|
|
189
189
|
try {
|
|
190
190
|
t({
|
|
191
|
-
protocol:
|
|
191
|
+
protocol: c,
|
|
192
192
|
kind: "error",
|
|
193
193
|
sessionId: e.sessionId,
|
|
194
194
|
operationId: e.operationId,
|
|
195
195
|
generation: e.generation,
|
|
196
196
|
requestId: e.requestId,
|
|
197
|
-
error:
|
|
197
|
+
error: m(n)
|
|
198
198
|
});
|
|
199
199
|
} catch {}
|
|
200
200
|
}
|
|
@@ -227,22 +227,22 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
227
227
|
for (let { host: t, identity: n } of [...this.sessions.values()]) {
|
|
228
228
|
let r;
|
|
229
229
|
if (await t.dispatch({
|
|
230
|
-
protocol:
|
|
230
|
+
protocol: c,
|
|
231
231
|
kind: "close",
|
|
232
232
|
...n,
|
|
233
233
|
requestId: e++
|
|
234
234
|
}, (e) => {
|
|
235
|
-
e.kind === "error" && (r =
|
|
235
|
+
e.kind === "error" && (r = a(e.error));
|
|
236
236
|
}), r) throw r;
|
|
237
237
|
}
|
|
238
|
-
this.sessions.clear(), await this.operationTail, this.pendingOpens.clear(), this.archive() && await this.executeArchive((e) => e.close_presentation_session()), this.coordinatorGeneration = new
|
|
238
|
+
this.sessions.clear(), await this.operationTail, this.pendingOpens.clear(), this.archive() && await this.executeArchive((e) => e.close_presentation_session()), this.coordinatorGeneration = new u(), this.resourceFailure = void 0;
|
|
239
239
|
}
|
|
240
240
|
assertReady() {
|
|
241
241
|
if (this.lifecycleState !== "ready") throw this.lifecycleError();
|
|
242
242
|
}
|
|
243
243
|
lifecycleError() {
|
|
244
244
|
let e = this.lifecycleState === "reset-failed", t = /* @__PURE__ */ Error(e ? "slide pull worker reset failed; retry reset before new work" : "slide pull worker reset is in progress");
|
|
245
|
-
return t.name = "PullSessionLifecycleError", Object.assign(t, { code: e ?
|
|
245
|
+
return t.name = "PullSessionLifecycleError", Object.assign(t, { code: e ? re : ne });
|
|
246
246
|
}
|
|
247
247
|
captureResetIdentities() {
|
|
248
248
|
for (let { identity: e } of this.sessions.values()) this.resetIdentities.set(e.sessionId, e);
|
|
@@ -251,8 +251,8 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
251
251
|
responseDuringReset(e) {
|
|
252
252
|
if (e.kind === "cancel" || e.kind === "close") {
|
|
253
253
|
let t = this.resetIdentities.get(e.sessionId);
|
|
254
|
-
return t && !
|
|
255
|
-
protocol:
|
|
254
|
+
return t && !x(t, e) ? this.staleLifecycleResponse(e) : {
|
|
255
|
+
protocol: c,
|
|
256
256
|
kind: "accepted",
|
|
257
257
|
sessionId: e.sessionId,
|
|
258
258
|
operationId: e.operationId,
|
|
@@ -262,13 +262,13 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
262
262
|
};
|
|
263
263
|
}
|
|
264
264
|
return {
|
|
265
|
-
protocol:
|
|
265
|
+
protocol: c,
|
|
266
266
|
kind: "error",
|
|
267
267
|
sessionId: e.sessionId,
|
|
268
268
|
operationId: e.operationId,
|
|
269
269
|
generation: e.generation,
|
|
270
270
|
requestId: e.requestId,
|
|
271
|
-
error:
|
|
271
|
+
error: m(this.lifecycleError())
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
274
|
requireArchive() {
|
|
@@ -281,7 +281,7 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
281
281
|
let t = this.sessions.get(e.sessionId);
|
|
282
282
|
if (t) {
|
|
283
283
|
await t.host.dispatch({
|
|
284
|
-
protocol:
|
|
284
|
+
protocol: c,
|
|
285
285
|
kind: "close",
|
|
286
286
|
...e,
|
|
287
287
|
requestId: 1
|
|
@@ -289,18 +289,18 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
289
289
|
return;
|
|
290
290
|
}
|
|
291
291
|
let n = this.pendingOpens.get(e.sessionId);
|
|
292
|
-
n &&
|
|
292
|
+
n && x(n.identity, e) && (n.canceled = !0);
|
|
293
293
|
}
|
|
294
294
|
readResourceUsage() {
|
|
295
|
-
return
|
|
295
|
+
return y(this.executeArchive);
|
|
296
296
|
}
|
|
297
297
|
latchResourceFailure(e) {
|
|
298
|
-
let t = e instanceof
|
|
298
|
+
let t = e instanceof _ ? e : f(e);
|
|
299
299
|
t && (this.resourceFailure ??= t);
|
|
300
300
|
}
|
|
301
301
|
staleLifecycleResponse(e) {
|
|
302
302
|
return {
|
|
303
|
-
protocol:
|
|
303
|
+
protocol: c,
|
|
304
304
|
kind: "error",
|
|
305
305
|
sessionId: e.sessionId,
|
|
306
306
|
operationId: e.operationId,
|
|
@@ -314,24 +314,24 @@ var te = "ooxml-pull-resetting", ne = "ooxml-pull-reset-failed", re = class {
|
|
|
314
314
|
};
|
|
315
315
|
}
|
|
316
316
|
};
|
|
317
|
-
function
|
|
317
|
+
function ae(e) {
|
|
318
318
|
if (!Number.isSafeInteger(e.sessionId) || e.sessionId <= 0) throw RangeError("session id must be a positive safe integer");
|
|
319
319
|
if (!Number.isSafeInteger(e.operationId) || e.operationId <= 0) throw RangeError("operation id must be a positive safe integer");
|
|
320
320
|
if (!Number.isSafeInteger(e.generation) || e.generation <= 0) throw RangeError("generation must be a positive safe integer");
|
|
321
321
|
}
|
|
322
|
-
function
|
|
322
|
+
function x(e, t) {
|
|
323
323
|
return e.sessionId === t.sessionId && e.operationId === t.operationId && e.generation === t.generation;
|
|
324
324
|
}
|
|
325
325
|
//#endregion
|
|
326
326
|
//#region packages/core/src/internal/wasm-runtime-generation.ts
|
|
327
|
-
function
|
|
328
|
-
return
|
|
327
|
+
function S(e) {
|
|
328
|
+
return te(e) ? new g(`WASM parser trapped and was recycled: ${e instanceof Error ? e.message : String(e)}`) : null;
|
|
329
329
|
}
|
|
330
|
-
var
|
|
330
|
+
var C = class {
|
|
331
331
|
realm;
|
|
332
332
|
live = /* @__PURE__ */ new Set();
|
|
333
333
|
constructor(e, t) {
|
|
334
|
-
this.realm = new
|
|
334
|
+
this.realm = new ee(() => e.initSync({ module: t }), () => e.reinit({ module_or_path: t }), S), this.realm.onPoison((e) => {
|
|
335
335
|
for (let t of this.live) t.poison(e);
|
|
336
336
|
this.live.clear();
|
|
337
337
|
});
|
|
@@ -341,7 +341,7 @@ var w = class {
|
|
|
341
341
|
this.throwIfOpenAborted(t), await this.awaitReadyOrAbort(t), this.throwIfOpenAborted(t);
|
|
342
342
|
let n = this.realm.tryRunReady(e);
|
|
343
343
|
if (!n.current) continue;
|
|
344
|
-
let r = new
|
|
344
|
+
let r = new oe(this, n.value, n.generation);
|
|
345
345
|
if (this.live.add(r), t?.signal?.aborted) throw r.close(t.disposeOnAbort), t.abortError?.() ?? new DOMException("The operation was aborted", "AbortError");
|
|
346
346
|
return r;
|
|
347
347
|
}
|
|
@@ -373,7 +373,7 @@ var w = class {
|
|
|
373
373
|
let n = e.detachForClose();
|
|
374
374
|
this.live.delete(e), n && this.realm.run(() => t(n));
|
|
375
375
|
}
|
|
376
|
-
},
|
|
376
|
+
}, oe = class {
|
|
377
377
|
archive;
|
|
378
378
|
failure;
|
|
379
379
|
proxy;
|
|
@@ -403,17 +403,17 @@ var w = class {
|
|
|
403
403
|
}
|
|
404
404
|
poison(e) {
|
|
405
405
|
let t = this.archive;
|
|
406
|
-
this.failure = e, this.archive = void 0,
|
|
406
|
+
this.failure = e, this.archive = void 0, s(t);
|
|
407
407
|
}
|
|
408
|
-
},
|
|
408
|
+
}, w = /* @__PURE__ */ e({
|
|
409
409
|
PptxArchive: () => T,
|
|
410
410
|
default: () => Y,
|
|
411
|
-
extract_font: () =>
|
|
412
|
-
extract_image: () =>
|
|
413
|
-
extract_media: () =>
|
|
411
|
+
extract_font: () => E,
|
|
412
|
+
extract_image: () => D,
|
|
413
|
+
extract_media: () => O,
|
|
414
414
|
initSync: () => ue,
|
|
415
|
-
parse_pptx: () =>
|
|
416
|
-
pptx_to_markdown: () =>
|
|
415
|
+
parse_pptx: () => se,
|
|
416
|
+
pptx_to_markdown: () => ce,
|
|
417
417
|
reinit: () => de
|
|
418
418
|
}), T = class {
|
|
419
419
|
__destroy_into_raw() {
|
|
@@ -504,31 +504,31 @@ var w = class {
|
|
|
504
504
|
}
|
|
505
505
|
};
|
|
506
506
|
Symbol.dispose && (T.prototype[Symbol.dispose] = T.prototype.free);
|
|
507
|
-
function
|
|
507
|
+
function E(e, t, n, r) {
|
|
508
508
|
let i = R(e, q.__wbindgen_malloc), a = K, o = z(t, q.__wbindgen_malloc, q.__wbindgen_realloc), s = K, c = q.extract_font(i, a, o, s, !L(n), L(n) ? BigInt(0) : n, !L(r), L(r) ? BigInt(0) : r);
|
|
509
509
|
if (c[3]) throw B(c[2]);
|
|
510
510
|
var l = j(c[0], c[1]).slice();
|
|
511
511
|
return q.__wbindgen_free(c[0], c[1] * 1, 1), l;
|
|
512
512
|
}
|
|
513
|
-
function
|
|
513
|
+
function D(e, t, n, r) {
|
|
514
514
|
let i = R(e, q.__wbindgen_malloc), a = K, o = z(t, q.__wbindgen_malloc, q.__wbindgen_realloc), s = K, c = q.extract_image(i, a, o, s, !L(n), L(n) ? BigInt(0) : n, !L(r), L(r) ? BigInt(0) : r);
|
|
515
515
|
if (c[3]) throw B(c[2]);
|
|
516
516
|
var l = j(c[0], c[1]).slice();
|
|
517
517
|
return q.__wbindgen_free(c[0], c[1] * 1, 1), l;
|
|
518
518
|
}
|
|
519
|
-
function
|
|
519
|
+
function O(e, t, n, r) {
|
|
520
520
|
let i = R(e, q.__wbindgen_malloc), a = K, o = z(t, q.__wbindgen_malloc, q.__wbindgen_realloc), s = K, c = q.extract_media(i, a, o, s, !L(n), L(n) ? BigInt(0) : n, !L(r), L(r) ? BigInt(0) : r);
|
|
521
521
|
if (c[3]) throw B(c[2]);
|
|
522
522
|
var l = j(c[0], c[1]).slice();
|
|
523
523
|
return q.__wbindgen_free(c[0], c[1] * 1, 1), l;
|
|
524
524
|
}
|
|
525
|
-
function
|
|
525
|
+
function se(e, t, n) {
|
|
526
526
|
let r = R(e, q.__wbindgen_malloc), i = K, a = q.parse_pptx(r, i, !L(t), L(t) ? BigInt(0) : t, !L(n), L(n) ? BigInt(0) : n);
|
|
527
527
|
if (a[3]) throw B(a[2]);
|
|
528
528
|
var o = j(a[0], a[1]).slice();
|
|
529
529
|
return q.__wbindgen_free(a[0], a[1] * 1, 1), o;
|
|
530
530
|
}
|
|
531
|
-
function
|
|
531
|
+
function ce(e, t, n) {
|
|
532
532
|
let r, i;
|
|
533
533
|
try {
|
|
534
534
|
let s = R(e, q.__wbindgen_malloc), c = K, l = q.pptx_to_markdown(s, c, !L(t), L(t) ? BigInt(0) : t, !L(n), L(n) ? BigInt(0) : n);
|
|
@@ -690,43 +690,43 @@ async function de(e) {
|
|
|
690
690
|
//#region packages/pptx/src/internal/node-acquisition.ts
|
|
691
691
|
var X, Z;
|
|
692
692
|
function fe(e) {
|
|
693
|
-
if (!Z) X = e, Z = new w
|
|
693
|
+
if (!Z) X = e, Z = new C(w, e);
|
|
694
694
|
else if (X !== e) throw Error("PPTX runtime was already initialized with another WebAssembly.Module");
|
|
695
695
|
return Z;
|
|
696
696
|
}
|
|
697
697
|
async function pe(e, n, i = {}) {
|
|
698
|
-
let
|
|
699
|
-
enabled:
|
|
698
|
+
let a = d(i), s = new o({
|
|
699
|
+
enabled: a.debug || a.onResourceMetrics !== void 0,
|
|
700
700
|
format: "pptx",
|
|
701
701
|
mode: "node",
|
|
702
702
|
scope: "session",
|
|
703
|
-
policy:
|
|
704
|
-
onMetrics:
|
|
705
|
-
emitToConsole:
|
|
703
|
+
policy: a.policy,
|
|
704
|
+
onMetrics: a.onResourceMetrics,
|
|
705
|
+
emitToConsole: a.debug
|
|
706
706
|
});
|
|
707
|
-
|
|
708
|
-
let
|
|
707
|
+
s.setSourceBytes(e.byteLength);
|
|
708
|
+
let c;
|
|
709
709
|
try {
|
|
710
710
|
Q(i.signal);
|
|
711
|
-
let [
|
|
712
|
-
|
|
711
|
+
let [o, l, u] = r(a.policy), d = T;
|
|
712
|
+
c = await fe(n).open(() => new d(e, o, l, u), {
|
|
713
713
|
signal: i.signal,
|
|
714
714
|
abortError: $,
|
|
715
715
|
disposeOnAbort: (e) => e.free()
|
|
716
716
|
}), Q(i.signal);
|
|
717
|
-
let f =
|
|
718
|
-
return
|
|
717
|
+
let f = c.proxy, p = t(JSON.parse(new TextDecoder().decode(f.presentation_bootstrap())));
|
|
718
|
+
return s.checkpoint("presentation bootstrap ready"), {
|
|
719
719
|
archive: f,
|
|
720
720
|
bootstrap: p,
|
|
721
|
-
metrics:
|
|
722
|
-
closeArchive: () =>
|
|
721
|
+
metrics: s,
|
|
722
|
+
closeArchive: () => c?.close((e) => e.free())
|
|
723
723
|
};
|
|
724
724
|
} catch (e) {
|
|
725
725
|
try {
|
|
726
|
-
|
|
726
|
+
c?.close((e) => e.free());
|
|
727
727
|
} catch {}
|
|
728
|
-
let t =
|
|
729
|
-
throw
|
|
728
|
+
let t = f(e) ?? e;
|
|
729
|
+
throw s.fail(t), t;
|
|
730
730
|
}
|
|
731
731
|
}
|
|
732
732
|
function Q(e) {
|
|
@@ -740,4 +740,4 @@ function $() {
|
|
|
740
740
|
//#region packages/pptx/src/internal/session.ts
|
|
741
741
|
var me = /* @__PURE__ */ e({ renderSlide: () => n });
|
|
742
742
|
//#endregion
|
|
743
|
-
export {
|
|
743
|
+
export { y as a, ie as i, pe as n, C as r, me as t };
|