@silurus/ooxml 0.82.1 → 0.83.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.
Files changed (42) hide show
  1. package/README.md +72 -3
  2. package/dist/assets/{render-worker-Cy-QsDge.js → render-worker-Bu31cf1J.js} +4 -4
  3. package/dist/assets/render-worker-DuztdEcX.js +11 -0
  4. package/dist/{canvas-viewer-mechanics-CS_qbr6T.js → canvas-viewer-mechanics-h07vpVOQ.js} +42 -2
  5. package/dist/{comment-ui-runtime-C1RV_3iu.js → comment-ui-runtime-BelHJt73.js} +2 -2
  6. package/dist/{comment-ui-runtime-DgCZpPR0.js → comment-ui-runtime-DD5a3x3k.js} +2 -2
  7. package/dist/{comments-Cf9W7r3M.js → comments-AAaNnQTi.js} +7 -2
  8. package/dist/{document-pull-client-B1WOjA0z.js → document-pull-client-BAhqoTmm.js} +4508 -3952
  9. package/dist/docx-Dg73PGgC.js +2707 -0
  10. package/dist/docx.mjs +6 -6
  11. package/dist/docx_parser_bg.wasm +0 -0
  12. package/dist/dom-interaction-boundary-CepOlXt6.js +217 -0
  13. package/dist/index.mjs +4 -4
  14. package/dist/line-distribute-D7A_wnJg.js +1003 -0
  15. package/dist/{line-metrics-B3syvDn2.js → line-metrics-Bpn7OeZD.js} +616 -616
  16. package/dist/node.mjs +308 -308
  17. package/dist/pptx-BcUCETmQ.js +2990 -0
  18. package/dist/pptx.mjs +5 -5
  19. package/dist/pptx_parser_bg.wasm +0 -0
  20. package/dist/{render-BC8p7vZQ.js → render-CL-7V3E8.js} +1 -1
  21. package/dist/{render-worker-host-DhnkTyjj.js → render-worker-host-DDZo0feh.js} +1 -1
  22. package/dist/{render-worker-host-BNnXCtAu.js → render-worker-host-FJ19-fUI.js} +1 -1
  23. package/dist/{resource-measurement-CsW4_eYt.js → resource-measurement-DuiFWzam.js} +3 -3
  24. package/dist/{session-Da7LEQUB.js → session-BjydZEDF.js} +107 -94
  25. package/dist/{slide-pull-client-Bg9DusLX.js → slide-pull-client-CwvvncPA.js} +1158 -935
  26. package/dist/types/docx.d.ts +98 -8
  27. package/dist/types/index.d.ts +184 -13
  28. package/dist/types/node.d.ts +2 -2
  29. package/dist/types/pptx.d.ts +94 -5
  30. package/dist/types/xlsx.d.ts +2 -2
  31. package/dist/{worksheet-pull-client-CYtwXP5D.js → worksheet-pull-client-DyFsDF4A.js} +32 -32
  32. package/dist/{xlsx-DMWeXT-c.js → xlsx-BibrHQ52.js} +476 -476
  33. package/dist/xlsx.mjs +5 -5
  34. package/dist/xlsx_parser_bg.wasm +0 -0
  35. package/package.json +3 -1
  36. package/dist/assets/render-worker-aHayzR7v.js +0 -11
  37. package/dist/docx-HoZXZUPA.js +0 -2162
  38. package/dist/dom-interaction-boundary-C8F6HO5x.js +0 -119
  39. package/dist/line-distribute-iXsUCIH-.js +0 -1003
  40. package/dist/pptx-DEUP4Yq5.js +0 -2432
  41. /package/dist/{comment-occurrence-C34fWs_F.js → comment-occurrence-X54si2ob.js} +0 -0
  42. /package/dist/{highlight-rect-MaCt0om0.js → highlight-rect-Hes0z_Mj.js} +0 -0
package/dist/node.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  import { t as e } from "./chunk-DmhlhrBa.js";
2
- import { t } from "./slide-pull-client-Bg9DusLX.js";
3
- import { B as n, Ct as r, Et as i, F as a, H as o, I as s, P as c, R as l, U as u, W as d, Yt as f, at as p, ot as m, q as h, rt as g, st as ee } from "./line-metrics-B3syvDn2.js";
2
+ import { t } from "./slide-pull-client-CwvvncPA.js";
3
+ import { B as n, F as r, Ft as i, G as a, H as o, I as s, It as c, K as l, P as u, Qt as d, R as f, U as p, Vt as m, ft as h, lt as g, q as ee } from "./line-metrics-Bpn7OeZD.js";
4
4
  import { t as te } from "./bounded-raw-part-cache-C6ro6Ezf.js";
5
- import { a as ne, c as re, i as ie, l as ae, r as oe, u as se } from "./document-pull-client-B1WOjA0z.js";
5
+ import { a as ne, c as re, i as ie, l as ae, r as oe, u as se } from "./document-pull-client-BAhqoTmm.js";
6
6
  import { cn as ce, ln as le } from "./plot-area-frame-DHV02PJU.js";
7
7
  import { t as ue } from "./transfer-R6NjgBKD.js";
8
- import { a as de, c as fe, d as pe, l as me, o as he, r as ge, s as _e, t as ve, u as ye } from "./worksheet-pull-client-CYtwXP5D.js";
9
- import { a as be, i as xe, n as Se, r as Ce } from "./session-Da7LEQUB.js";
10
- import { a as we, n as Te, r as Ee, t as De } from "./render-BC8p7vZQ.js";
8
+ import { a as de, c as fe, d as pe, l as me, o as he, r as ge, s as _e, t as ve, u as ye } from "./worksheet-pull-client-DyFsDF4A.js";
9
+ import { a as be, i as xe, n as Se, r as Ce } from "./session-BjydZEDF.js";
10
+ import { a as we, n as Te, r as Ee, t as De } from "./render-CL-7V3E8.js";
11
11
  import { existsSync as Oe, readFileSync as ke } from "node:fs";
12
12
  import { fileURLToPath as Ae } from "node:url";
13
13
  import { basename as je, dirname as Me, resolve as Ne } from "node:path";
@@ -58,11 +58,11 @@ var v = class {
58
58
  function Fe(e) {
59
59
  return new WebAssembly.Module(ke(e));
60
60
  }
61
- function Ie(e, t = Fe) {
61
+ function y(e, t = Fe) {
62
62
  let n = {};
63
63
  return () => n.value ??= t(e());
64
64
  }
65
- function y(e, t, n) {
65
+ function b(e, t, n) {
66
66
  let r = Me(Ae(e)), i = Ne(r, t);
67
67
  if (Oe(i)) return i;
68
68
  let a = Ne(r, je(t));
@@ -70,15 +70,15 @@ function y(e, t, n) {
70
70
  }
71
71
  //#endregion
72
72
  //#region packages/node/src/pptx.ts
73
- var Le = Ie(() => y(import.meta.url, "pptx_parser_bg.wasm", "@silurus/ooxml-pptx/wasm-binary"));
74
- async function Re(e, t = {}) {
75
- return ze(e, t);
73
+ var Ie = y(() => b(import.meta.url, "pptx_parser_bg.wasm", "@silurus/ooxml-pptx/wasm-binary"));
74
+ async function Le(e, t = {}) {
75
+ return Re(e, t);
76
76
  }
77
- async function ze(e, t = {}) {
78
- let n = await Se(He(e), Le(), t);
79
- return new Be(n.closeArchive, n.archive, n.bootstrap, n.metrics, t.signal);
77
+ async function Re(e, t = {}) {
78
+ let n = await Se(Ve(e), Ie(), t);
79
+ return new ze(n.closeArchive, n.archive, n.bootstrap, n.metrics, t.signal);
80
80
  }
81
- var Be = class {
81
+ var ze = class {
82
82
  slideCount;
83
83
  slideWidth;
84
84
  slideHeight;
@@ -96,7 +96,7 @@ var Be = class {
96
96
  fetchMedia = (e) => this.getPartInternal(e, "application/octet-stream", (t) => t.extract_media(e));
97
97
  rawParts = new te({
98
98
  maxEntries: 64,
99
- maxBytes: h
99
+ maxBytes: m
100
100
  });
101
101
  constructor(e, n, r, i, a) {
102
102
  this.closeArchive = e, this.archive = n, this.bootstrap = r, this.metrics = i, this.signal = a, this.slideCount = r.slideCount, this.slideWidth = r.slideWidth, this.slideHeight = r.slideHeight, this.slidePull = new xe(() => this.archive), this.transport = new v((e, t) => this.slidePull.dispatchSafely(e, t), () => void 0), this.slideClient = new t({
@@ -133,8 +133,8 @@ var Be = class {
133
133
  }
134
134
  async renderSlide(e, t, n) {
135
135
  return this.assertOpen(), this.enqueueRender(async () => {
136
- b(this.signal);
137
- let { renderSlideNode: r } = await import("./render-BC8p7vZQ.js").then((e) => e.i);
136
+ x(this.signal);
137
+ let { renderSlideNode: r } = await import("./render-CL-7V3E8.js").then((e) => e.i);
138
138
  await r(e, {
139
139
  slideWidth: this.slideWidth,
140
140
  slideHeight: this.slideHeight,
@@ -148,7 +148,7 @@ var Be = class {
148
148
  ...n,
149
149
  fetchImage: this.fetchImage,
150
150
  fetchMedia: this.fetchMedia
151
- }), b(this.signal);
151
+ }), x(this.signal);
152
152
  }).catch((e) => this.failOperation(e));
153
153
  }
154
154
  [Symbol.asyncIterator]() {
@@ -161,13 +161,13 @@ var Be = class {
161
161
  let e;
162
162
  try {
163
163
  for (let e = 0; e < this.slideCount; e += 1) {
164
- b(this.signal);
164
+ x(this.signal);
165
165
  let t = await this.slideClient.load(e);
166
166
  if (!t) throw Error(`PPTX slide ${e} was not decoded`);
167
167
  this.usage ??= await this.slidePull.run(() => be((e) => e(this.archive))), this.metrics.observeUsage(this.usage), this.consumedSlides = e + 1, yield t;
168
168
  }
169
169
  } catch (t) {
170
- throw e = p(t) ?? t, this.metrics.fail(e), e;
170
+ throw e = a(t) ?? t, this.metrics.fail(e), e;
171
171
  } finally {
172
172
  try {
173
173
  await this.close();
@@ -181,17 +181,17 @@ var Be = class {
181
181
  }
182
182
  async release() {
183
183
  let e;
184
- await this.renderTail, i(this.fetchImage), r(this.fetchImage);
184
+ await this.renderTail, h(this.fetchImage), g(this.fetchImage);
185
185
  try {
186
186
  await this.slidePull.reset();
187
187
  } catch (t) {
188
- e = p(t) ?? t;
188
+ e = a(t) ?? t;
189
189
  }
190
190
  this.transport.terminate(), this.rawParts.clear();
191
191
  try {
192
192
  this.closeArchive();
193
193
  } catch (t) {
194
- e ??= p(t) ?? t;
194
+ e ??= a(t) ?? t;
195
195
  }
196
196
  if (e !== void 0) throw this.metrics.fail(e), e;
197
197
  this.metrics.checkpoint("presentation session closed"), this.metrics.succeed({ slides: this.consumedSlides });
@@ -202,14 +202,14 @@ var Be = class {
202
202
  }
203
203
  getPartInternal(e, t, n) {
204
204
  return this.rawParts.get(e, t, () => {
205
- b(this.signal);
205
+ x(this.signal);
206
206
  let e = n(this.archive);
207
207
  return this.refreshResourceUsage(), new Blob([e], { type: t });
208
208
  });
209
209
  }
210
210
  refreshResourceUsage() {
211
211
  try {
212
- this.usage = g(this.archive.resource_usage()), this.metrics.observeUsage(this.usage);
212
+ this.usage = p(this.archive.resource_usage()), this.metrics.observeUsage(this.usage);
213
213
  } catch {}
214
214
  return this.usage;
215
215
  }
@@ -218,28 +218,28 @@ var Be = class {
218
218
  if (this.resourceFailure) throw this.resourceFailure;
219
219
  }
220
220
  failOperation(e) {
221
- let t = p(e) ?? e;
222
- throw t instanceof f && (this.resourceFailure ??= t), this.metrics.fail(t), t;
221
+ let t = a(e) ?? e;
222
+ throw t instanceof d && (this.resourceFailure ??= t), this.metrics.fail(t), t;
223
223
  }
224
224
  };
225
- async function Ve(e, t = {}) {
226
- return _(() => ze(e, t), async (e) => {
225
+ async function Be(e, t = {}) {
226
+ return _(() => Re(e, t), async (e) => {
227
227
  let t = [];
228
228
  for await (let n of e.slides()) t.push(n);
229
229
  return e.materialize(t);
230
230
  });
231
231
  }
232
- function He(e) {
232
+ function Ve(e) {
233
233
  return e instanceof Uint8Array ? e : new Uint8Array(e);
234
234
  }
235
- function b(e) {
235
+ function x(e) {
236
236
  if (!e?.aborted) return;
237
237
  let t = /* @__PURE__ */ Error("PPTX presentation session was aborted");
238
238
  throw t.name = "AbortError", t;
239
239
  }
240
240
  //#endregion
241
241
  //#region packages/docx/src/document-pull-worker.ts
242
- var Ue = Math.max(u, d), We = class {
242
+ var He = Math.max(i, c), Ue = class {
243
243
  coordinator = new s();
244
244
  host = null;
245
245
  identity = null;
@@ -252,9 +252,9 @@ var Ue = Math.max(u, d), We = class {
252
252
  t.open_document_cursor(e.operationId, e.generation);
253
253
  });
254
254
  let t = 0;
255
- this.identity = e, this.host = new a({
255
+ this.identity = e, this.host = new r({
256
256
  ...e,
257
- maxByteCredit: Ue,
257
+ maxByteCredit: He,
258
258
  coordinator: this.coordinator,
259
259
  driver: {
260
260
  pull: (n) => {
@@ -262,7 +262,7 @@ var Ue = Math.max(u, d), We = class {
262
262
  try {
263
263
  r = this.executeArchive((r) => r.pull_document_chunk(t, e.operationId, e.generation, n));
264
264
  } catch (e) {
265
- throw ee(e, n, Ue) || e;
265
+ throw ee(e, n, He) || e;
266
266
  }
267
267
  let i = ue(r);
268
268
  return {
@@ -281,20 +281,20 @@ var Ue = Math.max(u, d), We = class {
281
281
  close: () => this.executeArchive((e) => e.close_document_session()),
282
282
  resourceUsage: () => {
283
283
  let e = this.executeArchive((e) => e.document_cursor_resource_usage?.());
284
- return e ? g(e) : void 0;
284
+ return e ? p(e) : void 0;
285
285
  }
286
286
  }
287
287
  });
288
288
  }
289
289
  dispatch(e, t) {
290
290
  return !this.host || !this.identity ? (t({
291
- protocol: c,
291
+ protocol: u,
292
292
  kind: "error",
293
293
  sessionId: e.sessionId,
294
294
  operationId: e.operationId,
295
295
  generation: e.generation,
296
296
  requestId: e.requestId,
297
- error: m(/* @__PURE__ */ Error("DOCX document pull session is not open"))
297
+ error: l(/* @__PURE__ */ Error("DOCX document pull session is not open"))
298
298
  }), Promise.resolve()) : this.host.dispatch(e, t);
299
299
  }
300
300
  async reset() {
@@ -309,181 +309,181 @@ var Ue = Math.max(u, d), We = class {
309
309
  if (!e) throw Error("No docx loaded");
310
310
  return e;
311
311
  }
312
- }, Ge = /* @__PURE__ */ e({
313
- DocxArchive: () => x,
314
- default: () => rt,
315
- docx_to_markdown: () => Ke,
316
- extract_image: () => qe,
317
- initSync: () => nt,
318
- parse_docx: () => Je,
319
- reinit: () => it
320
- }), x = class {
312
+ }, We = /* @__PURE__ */ e({
313
+ DocxArchive: () => S,
314
+ default: () => nt,
315
+ docx_to_markdown: () => Ge,
316
+ extract_image: () => Ke,
317
+ initSync: () => tt,
318
+ parse_docx: () => qe,
319
+ reinit: () => rt
320
+ }), S = class {
321
321
  __destroy_into_raw() {
322
322
  let e = this.__wbg_ptr;
323
- return this.__wbg_ptr = 0, Xe.unregister(this), e;
323
+ return this.__wbg_ptr = 0, Ye.unregister(this), e;
324
324
  }
325
325
  free() {
326
326
  let e = this.__destroy_into_raw();
327
- F.__wbg_docxarchive_free(e, 0);
327
+ I.__wbg_docxarchive_free(e, 0);
328
328
  }
329
329
  acknowledge_document_chunk(e, t, n) {
330
- let r = F.docxarchive_acknowledge_document_chunk(this.__wbg_ptr, e, t, n);
331
- if (r[1]) throw A(r[0]);
330
+ let r = I.docxarchive_acknowledge_document_chunk(this.__wbg_ptr, e, t, n);
331
+ if (r[1]) throw j(r[0]);
332
332
  }
333
333
  assert_healthy() {
334
- let e = F.docxarchive_assert_healthy(this.__wbg_ptr);
335
- if (e[1]) throw A(e[0]);
334
+ let e = I.docxarchive_assert_healthy(this.__wbg_ptr);
335
+ if (e[1]) throw j(e[0]);
336
336
  }
337
337
  cancel_document_cursor() {
338
- F.docxarchive_cancel_document_cursor(this.__wbg_ptr);
338
+ I.docxarchive_cancel_document_cursor(this.__wbg_ptr);
339
339
  }
340
340
  close_document_session() {
341
- F.docxarchive_close_document_session(this.__wbg_ptr);
341
+ I.docxarchive_close_document_session(this.__wbg_ptr);
342
342
  }
343
343
  document_chunk_done() {
344
- let e = F.docxarchive_document_chunk_done(this.__wbg_ptr);
345
- if (e[2]) throw A(e[1]);
344
+ let e = I.docxarchive_document_chunk_done(this.__wbg_ptr);
345
+ if (e[2]) throw j(e[1]);
346
346
  return e[0] !== 0;
347
347
  }
348
348
  document_cursor_resource_usage() {
349
- let e = F.docxarchive_document_cursor_resource_usage(this.__wbg_ptr);
350
- if (e[3]) throw A(e[2]);
351
- var t = S(e[0], e[1]).slice();
352
- return F.__wbindgen_free(e[0], e[1] * 1, 1), t;
349
+ let e = I.docxarchive_document_cursor_resource_usage(this.__wbg_ptr);
350
+ if (e[3]) throw j(e[2]);
351
+ var t = C(e[0], e[1]).slice();
352
+ return I.__wbindgen_free(e[0], e[1] * 1, 1), t;
353
353
  }
354
354
  extract_image(e) {
355
- let t = k(e, F.__wbindgen_malloc, F.__wbindgen_realloc), n = P, r = F.docxarchive_extract_image(this.__wbg_ptr, t, n);
356
- if (r[3]) throw A(r[2]);
357
- var i = S(r[0], r[1]).slice();
358
- return F.__wbindgen_free(r[0], r[1] * 1, 1), i;
355
+ let t = A(e, I.__wbindgen_malloc, I.__wbindgen_realloc), n = F, r = I.docxarchive_extract_image(this.__wbg_ptr, t, n);
356
+ if (r[3]) throw j(r[2]);
357
+ var i = C(r[0], r[1]).slice();
358
+ return I.__wbindgen_free(r[0], r[1] * 1, 1), i;
359
359
  }
360
360
  constructor(e, t, n, r) {
361
- let i = O(e, F.__wbindgen_malloc), a = P, o = F.docxarchive_new(i, a, !D(t), D(t) ? BigInt(0) : t, !D(n), D(n) ? BigInt(0) : n, !D(r), D(r) ? BigInt(0) : r);
362
- if (o[2]) throw A(o[1]);
363
- return this.__wbg_ptr = o[0] >>> 0, Xe.register(this, this.__wbg_ptr, this), this;
361
+ let i = k(e, I.__wbindgen_malloc), a = F, o = I.docxarchive_new(i, a, !O(t), O(t) ? BigInt(0) : t, !O(n), O(n) ? BigInt(0) : n, !O(r), O(r) ? BigInt(0) : r);
362
+ if (o[2]) throw j(o[1]);
363
+ return this.__wbg_ptr = o[0] >>> 0, Ye.register(this, this.__wbg_ptr, this), this;
364
364
  }
365
365
  open_document_cursor(e, t) {
366
- let n = F.docxarchive_open_document_cursor(this.__wbg_ptr, e, t);
367
- if (n[1]) throw A(n[0]);
366
+ let n = I.docxarchive_open_document_cursor(this.__wbg_ptr, e, t);
367
+ if (n[1]) throw j(n[0]);
368
368
  }
369
369
  parse() {
370
- let e = F.docxarchive_parse(this.__wbg_ptr);
371
- if (e[3]) throw A(e[2]);
372
- var t = S(e[0], e[1]).slice();
373
- return F.__wbindgen_free(e[0], e[1] * 1, 1), t;
370
+ let e = I.docxarchive_parse(this.__wbg_ptr);
371
+ if (e[3]) throw j(e[2]);
372
+ var t = C(e[0], e[1]).slice();
373
+ return I.__wbindgen_free(e[0], e[1] * 1, 1), t;
374
374
  }
375
375
  pull_document_chunk(e, t, n, r) {
376
- let i = F.docxarchive_pull_document_chunk(this.__wbg_ptr, e, t, n, r);
377
- if (i[3]) throw A(i[2]);
378
- var a = S(i[0], i[1]).slice();
379
- return F.__wbindgen_free(i[0], i[1] * 1, 1), a;
376
+ let i = I.docxarchive_pull_document_chunk(this.__wbg_ptr, e, t, n, r);
377
+ if (i[3]) throw j(i[2]);
378
+ var a = C(i[0], i[1]).slice();
379
+ return I.__wbindgen_free(i[0], i[1] * 1, 1), a;
380
380
  }
381
381
  resource_usage() {
382
- let e = F.docxarchive_resource_usage(this.__wbg_ptr);
383
- if (e[3]) throw A(e[2]);
384
- var t = S(e[0], e[1]).slice();
385
- return F.__wbindgen_free(e[0], e[1] * 1, 1), t;
382
+ let e = I.docxarchive_resource_usage(this.__wbg_ptr);
383
+ if (e[3]) throw j(e[2]);
384
+ var t = C(e[0], e[1]).slice();
385
+ return I.__wbindgen_free(e[0], e[1] * 1, 1), t;
386
386
  }
387
387
  to_markdown() {
388
388
  let e, t;
389
389
  try {
390
- let i = F.docxarchive_to_markdown(this.__wbg_ptr);
390
+ let i = I.docxarchive_to_markdown(this.__wbg_ptr);
391
391
  var n = i[0], r = i[1];
392
- if (i[3]) throw n = 0, r = 0, A(i[2]);
393
- return e = n, t = r, w(n, r);
392
+ if (i[3]) throw n = 0, r = 0, j(i[2]);
393
+ return e = n, t = r, T(n, r);
394
394
  } finally {
395
- F.__wbindgen_free(e, t, 1);
395
+ I.__wbindgen_free(e, t, 1);
396
396
  }
397
397
  }
398
398
  };
399
- Symbol.dispose && (x.prototype[Symbol.dispose] = x.prototype.free);
400
- function Ke(e, t, n) {
399
+ Symbol.dispose && (S.prototype[Symbol.dispose] = S.prototype.free);
400
+ function Ge(e, t, n) {
401
401
  let r, i;
402
402
  try {
403
- let s = O(e, F.__wbindgen_malloc), c = P, l = F.docx_to_markdown(s, c, !D(t), D(t) ? BigInt(0) : t, !D(n), D(n) ? BigInt(0) : n);
403
+ let s = k(e, I.__wbindgen_malloc), c = F, l = I.docx_to_markdown(s, c, !O(t), O(t) ? BigInt(0) : t, !O(n), O(n) ? BigInt(0) : n);
404
404
  var a = l[0], o = l[1];
405
- if (l[3]) throw a = 0, o = 0, A(l[2]);
406
- return r = a, i = o, w(a, o);
405
+ if (l[3]) throw a = 0, o = 0, j(l[2]);
406
+ return r = a, i = o, T(a, o);
407
407
  } finally {
408
- F.__wbindgen_free(r, i, 1);
408
+ I.__wbindgen_free(r, i, 1);
409
409
  }
410
410
  }
411
- function qe(e, t, n, r) {
412
- let i = O(e, F.__wbindgen_malloc), a = P, o = k(t, F.__wbindgen_malloc, F.__wbindgen_realloc), s = P, c = F.extract_image(i, a, o, s, !D(n), D(n) ? BigInt(0) : n, !D(r), D(r) ? BigInt(0) : r);
413
- if (c[3]) throw A(c[2]);
414
- var l = S(c[0], c[1]).slice();
415
- return F.__wbindgen_free(c[0], c[1] * 1, 1), l;
411
+ function Ke(e, t, n, r) {
412
+ let i = k(e, I.__wbindgen_malloc), a = F, o = A(t, I.__wbindgen_malloc, I.__wbindgen_realloc), s = F, c = I.extract_image(i, a, o, s, !O(n), O(n) ? BigInt(0) : n, !O(r), O(r) ? BigInt(0) : r);
413
+ if (c[3]) throw j(c[2]);
414
+ var l = C(c[0], c[1]).slice();
415
+ return I.__wbindgen_free(c[0], c[1] * 1, 1), l;
416
416
  }
417
- function Je(e, t, n) {
418
- let r = O(e, F.__wbindgen_malloc), i = P, a = F.parse_docx(r, i, !D(t), D(t) ? BigInt(0) : t, !D(n), D(n) ? BigInt(0) : n);
419
- if (a[3]) throw A(a[2]);
420
- var o = S(a[0], a[1]).slice();
421
- return F.__wbindgen_free(a[0], a[1] * 1, 1), o;
417
+ function qe(e, t, n) {
418
+ let r = k(e, I.__wbindgen_malloc), i = F, a = I.parse_docx(r, i, !O(t), O(t) ? BigInt(0) : t, !O(n), O(n) ? BigInt(0) : n);
419
+ if (a[3]) throw j(a[2]);
420
+ var o = C(a[0], a[1]).slice();
421
+ return I.__wbindgen_free(a[0], a[1] * 1, 1), o;
422
422
  }
423
- function Ye() {
423
+ function Je() {
424
424
  return {
425
425
  __proto__: null,
426
426
  "./docx_parser_bg.js": {
427
427
  __proto__: null,
428
428
  __wbg___wbindgen_throw_6b64449b9b9ed33c: function(e, t) {
429
- throw Error(w(e, t));
429
+ throw Error(T(e, t));
430
430
  },
431
431
  __wbg_error_a6fa202b58aa1cd3: function(e, t) {
432
432
  let n, r;
433
433
  try {
434
- n = e, r = t, console.error(w(e, t));
434
+ n = e, r = t, console.error(T(e, t));
435
435
  } finally {
436
- F.__wbindgen_free(n, r, 1);
436
+ I.__wbindgen_free(n, r, 1);
437
437
  }
438
438
  },
439
439
  __wbg_new_227d7c05414eb861: function() {
440
440
  return /* @__PURE__ */ Error();
441
441
  },
442
442
  __wbg_stack_3b0d974bbf31e44f: function(e, t) {
443
- let n = t.stack, r = k(n, F.__wbindgen_malloc, F.__wbindgen_realloc), i = P;
444
- Ze().setInt32(e + 4, i, !0), Ze().setInt32(e + 0, r, !0);
443
+ let n = t.stack, r = A(n, I.__wbindgen_malloc, I.__wbindgen_realloc), i = F;
444
+ Xe().setInt32(e + 4, i, !0), Xe().setInt32(e + 0, r, !0);
445
445
  },
446
446
  __wbindgen_cast_0000000000000001: function(e, t) {
447
- return w(e, t);
447
+ return T(e, t);
448
448
  },
449
449
  __wbindgen_init_externref_table: function() {
450
- let e = F.__wbindgen_externrefs, t = e.grow(4);
450
+ let e = I.__wbindgen_externrefs, t = e.grow(4);
451
451
  e.set(0, void 0), e.set(t + 0, void 0), e.set(t + 1, null), e.set(t + 2, !0), e.set(t + 3, !1);
452
452
  }
453
453
  }
454
454
  };
455
455
  }
456
- var Xe = typeof FinalizationRegistry > "u" ? {
456
+ var Ye = typeof FinalizationRegistry > "u" ? {
457
457
  register: () => {},
458
458
  unregister: () => {}
459
- } : new FinalizationRegistry((e) => F.__wbg_docxarchive_free(e >>> 0, 1));
460
- function S(e, t) {
461
- return e >>>= 0, E().subarray(e / 1, e / 1 + t);
459
+ } : new FinalizationRegistry((e) => I.__wbg_docxarchive_free(e >>> 0, 1));
460
+ function C(e, t) {
461
+ return e >>>= 0, D().subarray(e / 1, e / 1 + t);
462
462
  }
463
- var C = null;
464
- function Ze() {
465
- return (C === null || C.buffer.detached === !0 || C.buffer.detached === void 0 && C.buffer !== F.memory.buffer) && (C = new DataView(F.memory.buffer)), C;
463
+ var w = null;
464
+ function Xe() {
465
+ return (w === null || w.buffer.detached === !0 || w.buffer.detached === void 0 && w.buffer !== I.memory.buffer) && (w = new DataView(I.memory.buffer)), w;
466
466
  }
467
- function w(e, t) {
468
- return e >>>= 0, $e(e, t);
467
+ function T(e, t) {
468
+ return e >>>= 0, Qe(e, t);
469
469
  }
470
- var T = null;
471
- function E() {
472
- return (T === null || T.byteLength === 0) && (T = new Uint8Array(F.memory.buffer)), T;
470
+ var E = null;
471
+ function D() {
472
+ return (E === null || E.byteLength === 0) && (E = new Uint8Array(I.memory.buffer)), E;
473
473
  }
474
- function D(e) {
474
+ function O(e) {
475
475
  return e == null;
476
476
  }
477
- function O(e, t) {
477
+ function k(e, t) {
478
478
  let n = t(e.length * 1, 1) >>> 0;
479
- return E().set(e, n / 1), P = e.length, n;
479
+ return D().set(e, n / 1), F = e.length, n;
480
480
  }
481
- function k(e, t, n) {
481
+ function A(e, t, n) {
482
482
  if (n === void 0) {
483
- let n = N.encode(e), r = t(n.length, 1) >>> 0;
484
- return E().subarray(r, r + n.length).set(n), P = n.length, r;
483
+ let n = P.encode(e), r = t(n.length, 1) >>> 0;
484
+ return D().subarray(r, r + n.length).set(n), F = n.length, r;
485
485
  }
486
- let r = e.length, i = t(r, 1) >>> 0, a = E(), o = 0;
486
+ let r = e.length, i = t(r, 1) >>> 0, a = D(), o = 0;
487
487
  for (; o < r; o++) {
488
488
  let t = e.charCodeAt(o);
489
489
  if (t > 127) break;
@@ -491,40 +491,40 @@ function k(e, t, n) {
491
491
  }
492
492
  if (o !== r) {
493
493
  o !== 0 && (e = e.slice(o)), i = n(i, r, r = o + e.length * 3, 1) >>> 0;
494
- let t = E().subarray(i + o, i + r), a = N.encodeInto(e, t);
494
+ let t = D().subarray(i + o, i + r), a = P.encodeInto(e, t);
495
495
  o += a.written, i = n(i, r, o, 1) >>> 0;
496
496
  }
497
- return P = o, i;
497
+ return F = o, i;
498
498
  }
499
- function A(e) {
500
- let t = F.__wbindgen_externrefs.get(e);
501
- return F.__externref_table_dealloc(e), t;
499
+ function j(e) {
500
+ let t = I.__wbindgen_externrefs.get(e);
501
+ return I.__externref_table_dealloc(e), t;
502
502
  }
503
- var j = new TextDecoder("utf-8", {
503
+ var M = new TextDecoder("utf-8", {
504
504
  ignoreBOM: !0,
505
505
  fatal: !0
506
506
  });
507
- j.decode();
508
- var Qe = 2146435072, M = 0;
509
- function $e(e, t) {
510
- return M += t, M >= Qe && (j = new TextDecoder("utf-8", {
507
+ M.decode();
508
+ var Ze = 2146435072, N = 0;
509
+ function Qe(e, t) {
510
+ return N += t, N >= Ze && (M = new TextDecoder("utf-8", {
511
511
  ignoreBOM: !0,
512
512
  fatal: !0
513
- }), j.decode(), M = t), j.decode(E().subarray(e, e + t));
513
+ }), M.decode(), N = t), M.decode(D().subarray(e, e + t));
514
514
  }
515
- var N = new TextEncoder();
516
- "encodeInto" in N || (N.encodeInto = function(e, t) {
517
- let n = N.encode(e);
515
+ var P = new TextEncoder();
516
+ "encodeInto" in P || (P.encodeInto = function(e, t) {
517
+ let n = P.encode(e);
518
518
  return t.set(n), {
519
519
  read: e.length,
520
520
  written: n.length
521
521
  };
522
522
  });
523
- var P = 0, F;
524
- function et(e, t) {
525
- return F = e.exports, C = null, T = null, F.__wbindgen_start(), F;
523
+ var F = 0, I;
524
+ function $e(e, t) {
525
+ return I = e.exports, w = null, E = null, I.__wbindgen_start(), I;
526
526
  }
527
- async function tt(e, t) {
527
+ async function et(e, t) {
528
528
  if (typeof Response == "function" && e instanceof Response) {
529
529
  if (typeof WebAssembly.instantiateStreaming == "function") try {
530
530
  return await WebAssembly.instantiateStreaming(e, t);
@@ -550,53 +550,53 @@ async function tt(e, t) {
550
550
  return !1;
551
551
  }
552
552
  }
553
- function nt(e) {
554
- if (F !== void 0) return F;
553
+ function tt(e) {
554
+ if (I !== void 0) return I;
555
555
  e !== void 0 && (Object.getPrototypeOf(e) === Object.prototype ? {module: e} = e : console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));
556
- let t = Ye();
557
- return e instanceof WebAssembly.Module || (e = new WebAssembly.Module(e)), et(new WebAssembly.Instance(e, t), e);
556
+ let t = Je();
557
+ return e instanceof WebAssembly.Module || (e = new WebAssembly.Module(e)), $e(new WebAssembly.Instance(e, t), e);
558
558
  }
559
- async function rt(e) {
560
- if (F !== void 0) return F;
559
+ async function nt(e) {
560
+ if (I !== void 0) return I;
561
561
  e !== void 0 && (Object.getPrototypeOf(e) === Object.prototype ? {module_or_path: e} = e : console.warn("using deprecated parameters for the initialization function; pass a single object instead"));
562
- let t = Ye();
562
+ let t = Je();
563
563
  (typeof e == "string" || typeof Request == "function" && e instanceof Request || typeof URL == "function" && e instanceof URL) && (e = fetch(e));
564
- let { instance: n, module: r } = await tt(await e, t);
565
- return et(n, r);
564
+ let { instance: n, module: r } = await et(await e, t);
565
+ return $e(n, r);
566
566
  }
567
- async function it(e) {
568
- return F = void 0, C = null, T = null, rt(e);
567
+ async function rt(e) {
568
+ return I = void 0, w = null, E = null, nt(e);
569
569
  }
570
570
  //#endregion
571
571
  //#region packages/docx/src/internal/node-acquisition.ts
572
- var at, I;
573
- function ot(e) {
574
- if (!I) at = e, I = new Ce(Ge, e);
575
- else if (at !== e) throw Error("DOCX runtime was already initialized with another WebAssembly.Module");
576
- return I;
577
- }
578
- async function st(e, t, r, i) {
579
- let a = n(r), s = new l({
580
- enabled: a.debug || a.onResourceMetrics !== void 0,
572
+ var it, L;
573
+ function at(e) {
574
+ if (!L) it = e, L = new Ce(We, e);
575
+ else if (it !== e) throw Error("DOCX runtime was already initialized with another WebAssembly.Module");
576
+ return L;
577
+ }
578
+ async function ot(e, t, r, i) {
579
+ let s = n(r), c = new f({
580
+ enabled: s.debug || s.onResourceMetrics !== void 0,
581
581
  format: "docx",
582
582
  mode: "node",
583
583
  scope: "session",
584
- policy: a.policy,
585
- onMetrics: a.onResourceMetrics,
586
- emitToConsole: a.debug
584
+ policy: s.policy,
585
+ onMetrics: s.onResourceMetrics,
586
+ emitToConsole: s.debug
587
587
  });
588
- s.setSourceBytes(e.byteLength);
589
- let c, u, d;
588
+ c.setSourceBytes(e.byteLength);
589
+ let l, u, d;
590
590
  try {
591
- lt(r.signal);
592
- let [n, l, f] = o(a.policy), p = x;
593
- c = await ot(t).open(() => new p(e, n, l, f), {
591
+ ct(r.signal);
592
+ let [n, a, f] = o(s.policy), p = S;
593
+ l = await at(t).open(() => new p(e, n, a, f), {
594
594
  signal: r.signal,
595
- abortError: ut,
595
+ abortError: lt,
596
596
  disposeOnAbort: (e) => e.free()
597
- }), lt(r.signal);
598
- let m = c.proxy;
599
- s.checkpoint("container ready"), u = new We(() => m);
597
+ }), ct(r.signal);
598
+ let m = l.proxy;
599
+ c.checkpoint("container ready"), u = new Ue(() => m);
600
600
  let h = {
601
601
  sessionId: 1,
602
602
  operationId: 1,
@@ -606,60 +606,60 @@ async function st(e, t, r, i) {
606
606
  let g, ee = await i(d, h, {
607
607
  signal: r.signal,
608
608
  onUsage: (e) => {
609
- g = e, s.observeUsage(e);
609
+ g = e, c.observeUsage(e);
610
610
  }
611
611
  });
612
- return g ??= ct(m.document_cursor_resource_usage()), s.observeUsage(g), s.checkpoint("model streamed"), await u.reset(), d.terminate(), {
612
+ return g ??= st(m.document_cursor_resource_usage()), c.observeUsage(g), c.checkpoint("model streamed"), await u.reset(), d.terminate(), {
613
613
  archive: m,
614
614
  result: ee,
615
615
  usage: g,
616
- metrics: s,
617
- closeArchive: () => c?.close((e) => e.free())
616
+ metrics: c,
617
+ closeArchive: () => l?.close((e) => e.free())
618
618
  };
619
619
  } catch (e) {
620
620
  await u?.reset().catch(() => void 0), d?.terminate();
621
621
  try {
622
- c?.close((e) => e.free());
622
+ l?.close((e) => e.free());
623
623
  } catch {}
624
- let t = p(e) ?? e;
625
- throw s.fail(t), t;
624
+ let t = a(e) ?? e;
625
+ throw c.fail(t), t;
626
626
  }
627
627
  }
628
- function ct(e) {
628
+ function st(e) {
629
629
  try {
630
- return g(e);
630
+ return p(e);
631
631
  } catch {
632
632
  return;
633
633
  }
634
634
  }
635
- function lt(e) {
636
- if (e?.aborted) throw ut();
635
+ function ct(e) {
636
+ if (e?.aborted) throw lt();
637
637
  }
638
- function ut() {
638
+ function lt() {
639
639
  let e = /* @__PURE__ */ Error("DOCX document session was aborted");
640
640
  return e.name = "AbortError", e;
641
641
  }
642
642
  //#endregion
643
643
  //#region packages/node/src/docx.ts
644
- var dt = Ie(() => y(import.meta.url, "docx_parser_bg.wasm", "@silurus/ooxml-docx/wasm-binary"));
645
- async function ft(e, t) {
644
+ var ut = y(() => b(import.meta.url, "docx_parser_bg.wasm", "@silurus/ooxml-docx/wasm-binary"));
645
+ async function dt(e, t) {
646
646
  if (!t?.factory) throw TypeError("openDocxDocument requires a canvas factory");
647
- let n = await st(gt(e), dt(), t, (e, t, n) => oe(e, t, n));
647
+ let n = await ot(ht(e), ut(), t, (e, t, n) => oe(e, t, n));
648
648
  try {
649
- L(t.signal);
650
- let e = t.factory.createCanvas(1, 1), r = ae(n.result, { measureContext: e.getContext("2d") }), i = ht(t.currentDate), a = ne(n.result, r, i).layoutVariants.defaultLayout, o = new mt(n.closeArchive, n.archive, n.result, r, a, t.factory, i, n.usage, n.metrics, t.signal);
649
+ R(t.signal);
650
+ let e = t.factory.createCanvas(1, 1), r = ae(n.result, { measureContext: e.getContext("2d") }), i = mt(t.currentDate), a = ne(n.result, r, i).layoutVariants.defaultLayout, o = new pt(n.closeArchive, n.archive, n.result, r, a, t.factory, i, n.usage, n.metrics, t.signal);
651
651
  return n.metrics.observeUsage(o.resourceUsage), n.metrics.checkpoint("pagination ready"), o;
652
652
  } catch (e) {
653
653
  try {
654
654
  n.closeArchive();
655
655
  } catch {}
656
- let t = p(e) ?? e;
656
+ let t = a(e) ?? e;
657
657
  throw n.metrics.fail(t), t;
658
658
  }
659
659
  }
660
- async function pt(e, t = {}) {
660
+ async function ft(e, t = {}) {
661
661
  return _(async () => {
662
- let n = await st(gt(e), dt(), t, (e, t, n) => ie(e, t, n)), r = !1;
662
+ let n = await ot(ht(e), ut(), t, (e, t, n) => ie(e, t, n)), r = !1;
663
663
  return {
664
664
  acquired: n,
665
665
  markSucceeded: () => {
@@ -682,7 +682,7 @@ async function pt(e, t = {}) {
682
682
  }
683
683
  });
684
684
  }
685
- var mt = class {
685
+ var pt = class {
686
686
  pageCount;
687
687
  sizes;
688
688
  lastResourceUsage;
@@ -710,7 +710,7 @@ var mt = class {
710
710
  }
711
711
  refreshResourceUsage() {
712
712
  try {
713
- this.lastResourceUsage = g(this.archive.resource_usage()), this.metrics.observeUsage(this.lastResourceUsage);
713
+ this.lastResourceUsage = p(this.archive.resource_usage()), this.metrics.observeUsage(this.lastResourceUsage);
714
714
  } catch {}
715
715
  return this.lastResourceUsage;
716
716
  }
@@ -724,7 +724,7 @@ var mt = class {
724
724
  }
725
725
  renderPage(e, t = {}) {
726
726
  return this.closed ? Promise.reject(/* @__PURE__ */ Error("DOCX document session is closed")) : this.resourceFailure ? Promise.reject(this.resourceFailure) : (this.pageSize(e), this.enqueueRender(async () => {
727
- L(this.signal);
727
+ R(this.signal);
728
728
  let n = this.requireState(), r = this.factory.createCanvas(1, 1);
729
729
  return await we(this.factory, () => re(n.source, r, e, {
730
730
  ...t,
@@ -732,10 +732,10 @@ var mt = class {
732
732
  defaultCurrentDateMs: this.defaultCurrentDateMs,
733
733
  layoutServices: n.services,
734
734
  fetchImage: this.fetchImage
735
- })), L(this.signal), r;
735
+ })), R(this.signal), r;
736
736
  }).catch((e) => {
737
- let t = p(e) ?? e;
738
- throw t instanceof f && (this.resourceFailure ??= t), this.metrics.fail(t), t;
737
+ let t = a(e) ?? e;
738
+ throw t instanceof d && (this.resourceFailure ??= t), this.metrics.fail(t), t;
739
739
  }));
740
740
  }
741
741
  async *pages(e = {}) {
@@ -753,7 +753,7 @@ var mt = class {
753
753
  };
754
754
  }
755
755
  } catch (e) {
756
- throw t = p(e) ?? e, t;
756
+ throw t = a(e) ?? e, t;
757
757
  } finally {
758
758
  try {
759
759
  await this.close();
@@ -770,11 +770,11 @@ var mt = class {
770
770
  return this.renderTail = t.then(() => void 0, () => void 0), t;
771
771
  }
772
772
  async release() {
773
- await this.renderTail, i(this.fetchImage), r(this.fetchImage), this.state = null;
773
+ await this.renderTail, h(this.fetchImage), g(this.fetchImage), this.state = null;
774
774
  try {
775
775
  this.closeArchive();
776
776
  } catch (e) {
777
- let t = p(e) ?? e;
777
+ let t = a(e) ?? e;
778
778
  throw this.metrics.fail(t), t;
779
779
  }
780
780
  this.metrics.checkpoint("document session closed", this.lastResourceUsage), this.metrics.succeed({ pages: this.pageCount });
@@ -784,33 +784,33 @@ var mt = class {
784
784
  return this.state;
785
785
  }
786
786
  };
787
- function ht(e) {
787
+ function mt(e) {
788
788
  let t = e instanceof Date ? e.getTime() : e ?? Date.now();
789
789
  if (!Number.isFinite(t)) throw RangeError("currentDate must resolve to finite epoch milliseconds");
790
790
  return t;
791
791
  }
792
- function gt(e) {
792
+ function ht(e) {
793
793
  return e instanceof Uint8Array ? e : new Uint8Array(e);
794
794
  }
795
- function L(e) {
795
+ function R(e) {
796
796
  if (!e?.aborted) return;
797
797
  let t = /* @__PURE__ */ Error("DOCX document session was aborted");
798
798
  throw t.name = "AbortError", t;
799
799
  }
800
800
  //#endregion
801
801
  //#region packages/xlsx/src/wasm/xlsx_parser.js
802
- var _t = /* @__PURE__ */ e({
803
- XlsxArchive: () => R,
802
+ var gt = /* @__PURE__ */ e({
803
+ XlsxArchive: () => z,
804
804
  default: () => kt,
805
- extract_image: () => vt,
805
+ extract_image: () => _t,
806
806
  initSync: () => Ot,
807
- parse_xlsx: () => yt,
807
+ parse_xlsx: () => vt,
808
808
  reinit: () => At,
809
- xlsx_to_markdown: () => bt
810
- }), R = class {
809
+ xlsx_to_markdown: () => yt
810
+ }), z = class {
811
811
  __destroy_into_raw() {
812
812
  let e = this.__wbg_ptr;
813
- return this.__wbg_ptr = 0, St.unregister(this), e;
813
+ return this.__wbg_ptr = 0, xt.unregister(this), e;
814
814
  }
815
815
  free() {
816
816
  let e = this.__destroy_into_raw();
@@ -818,11 +818,11 @@ var _t = /* @__PURE__ */ e({
818
818
  }
819
819
  acknowledge_sheet_cursor_terminal() {
820
820
  let e = Q.xlsxarchive_acknowledge_sheet_cursor_terminal(this.__wbg_ptr);
821
- if (e[1]) throw q(e[0]);
821
+ if (e[1]) throw J(e[0]);
822
822
  }
823
823
  assert_healthy() {
824
824
  let e = Q.xlsxarchive_assert_healthy(this.__wbg_ptr);
825
- if (e[1]) throw q(e[0]);
825
+ if (e[1]) throw J(e[0]);
826
826
  }
827
827
  cancel_sheet_cursor() {
828
828
  Q.xlsxarchive_cancel_sheet_cursor(this.__wbg_ptr);
@@ -831,36 +831,36 @@ var _t = /* @__PURE__ */ e({
831
831
  Q.xlsxarchive_close_sheet_cursor(this.__wbg_ptr);
832
832
  }
833
833
  extract_image(e) {
834
- let t = K(e, Q.__wbindgen_malloc, Q.__wbindgen_realloc), n = Z, r = Q.xlsxarchive_extract_image(this.__wbg_ptr, t, n);
835
- if (r[3]) throw q(r[2]);
836
- var i = z(r[0], r[1]).slice();
834
+ let t = q(e, Q.__wbindgen_malloc, Q.__wbindgen_realloc), n = Z, r = Q.xlsxarchive_extract_image(this.__wbg_ptr, t, n);
835
+ if (r[3]) throw J(r[2]);
836
+ var i = B(r[0], r[1]).slice();
837
837
  return Q.__wbindgen_free(r[0], r[1] * 1, 1), i;
838
838
  }
839
839
  constructor(e, t, n, r) {
840
- let i = G(e, Q.__wbindgen_malloc), a = Z, o = Q.xlsxarchive_new(i, a, !W(t), W(t) ? BigInt(0) : t, !W(n), W(n) ? BigInt(0) : n, !W(r), W(r) ? BigInt(0) : r);
841
- if (o[2]) throw q(o[1]);
842
- return this.__wbg_ptr = o[0] >>> 0, St.register(this, this.__wbg_ptr, this), this;
840
+ let i = K(e, Q.__wbindgen_malloc), a = Z, o = Q.xlsxarchive_new(i, a, !G(t), G(t) ? BigInt(0) : t, !G(n), G(n) ? BigInt(0) : n, !G(r), G(r) ? BigInt(0) : r);
841
+ if (o[2]) throw J(o[1]);
842
+ return this.__wbg_ptr = o[0] >>> 0, xt.register(this, this.__wbg_ptr, this), this;
843
843
  }
844
844
  open_sheet_cursor(e, t) {
845
- let n = K(t, Q.__wbindgen_malloc, Q.__wbindgen_realloc), r = Z, i = Q.xlsxarchive_open_sheet_cursor(this.__wbg_ptr, e, n, r);
846
- if (i[1]) throw q(i[0]);
845
+ let n = q(t, Q.__wbindgen_malloc, Q.__wbindgen_realloc), r = Z, i = Q.xlsxarchive_open_sheet_cursor(this.__wbg_ptr, e, n, r);
846
+ if (i[1]) throw J(i[0]);
847
847
  }
848
848
  parse() {
849
849
  let e = Q.xlsxarchive_parse(this.__wbg_ptr);
850
- if (e[3]) throw q(e[2]);
851
- var t = z(e[0], e[1]).slice();
850
+ if (e[3]) throw J(e[2]);
851
+ var t = B(e[0], e[1]).slice();
852
852
  return Q.__wbindgen_free(e[0], e[1] * 1, 1), t;
853
853
  }
854
854
  pull_sheet_cursor(e) {
855
855
  let t = Q.xlsxarchive_pull_sheet_cursor(this.__wbg_ptr, e);
856
- if (t[3]) throw q(t[2]);
857
- var n = z(t[0], t[1]).slice();
856
+ if (t[3]) throw J(t[2]);
857
+ var n = B(t[0], t[1]).slice();
858
858
  return Q.__wbindgen_free(t[0], t[1] * 1, 1), n;
859
859
  }
860
860
  resource_usage() {
861
861
  let e = Q.xlsxarchive_resource_usage(this.__wbg_ptr);
862
- if (e[3]) throw q(e[2]);
863
- var t = z(e[0], e[1]).slice();
862
+ if (e[3]) throw J(e[2]);
863
+ var t = B(e[0], e[1]).slice();
864
864
  return Q.__wbindgen_free(e[0], e[1] * 1, 1), t;
865
865
  }
866
866
  sheet_cursor_pull_finished() {
@@ -868,8 +868,8 @@ var _t = /* @__PURE__ */ e({
868
868
  }
869
869
  sheet_cursor_resource_usage() {
870
870
  let e = Q.xlsxarchive_sheet_cursor_resource_usage(this.__wbg_ptr);
871
- if (e[3]) throw q(e[2]);
872
- var t = z(e[0], e[1]).slice();
871
+ if (e[3]) throw J(e[2]);
872
+ var t = B(e[0], e[1]).slice();
873
873
  return Q.__wbindgen_free(e[0], e[1] * 1, 1), t;
874
874
  }
875
875
  to_markdown() {
@@ -877,49 +877,49 @@ var _t = /* @__PURE__ */ e({
877
877
  try {
878
878
  let i = Q.xlsxarchive_to_markdown(this.__wbg_ptr);
879
879
  var n = i[0], r = i[1];
880
- if (i[3]) throw n = 0, r = 0, q(i[2]);
881
- return e = n, t = r, V(n, r);
880
+ if (i[3]) throw n = 0, r = 0, J(i[2]);
881
+ return e = n, t = r, H(n, r);
882
882
  } finally {
883
883
  Q.__wbindgen_free(e, t, 1);
884
884
  }
885
885
  }
886
886
  };
887
- Symbol.dispose && (R.prototype[Symbol.dispose] = R.prototype.free);
888
- function vt(e, t, n, r) {
889
- let i = G(e, Q.__wbindgen_malloc), a = Z, o = K(t, Q.__wbindgen_malloc, Q.__wbindgen_realloc), s = Z, c = Q.extract_image(i, a, o, s, !W(n), W(n) ? BigInt(0) : n, !W(r), W(r) ? BigInt(0) : r);
890
- if (c[3]) throw q(c[2]);
891
- var l = z(c[0], c[1]).slice();
887
+ Symbol.dispose && (z.prototype[Symbol.dispose] = z.prototype.free);
888
+ function _t(e, t, n, r) {
889
+ let i = K(e, Q.__wbindgen_malloc), a = Z, o = q(t, Q.__wbindgen_malloc, Q.__wbindgen_realloc), s = Z, c = Q.extract_image(i, a, o, s, !G(n), G(n) ? BigInt(0) : n, !G(r), G(r) ? BigInt(0) : r);
890
+ if (c[3]) throw J(c[2]);
891
+ var l = B(c[0], c[1]).slice();
892
892
  return Q.__wbindgen_free(c[0], c[1] * 1, 1), l;
893
893
  }
894
- function yt(e, t, n) {
895
- let r = G(e, Q.__wbindgen_malloc), i = Z, a = Q.parse_xlsx(r, i, !W(t), W(t) ? BigInt(0) : t, !W(n), W(n) ? BigInt(0) : n);
896
- if (a[3]) throw q(a[2]);
897
- var o = z(a[0], a[1]).slice();
894
+ function vt(e, t, n) {
895
+ let r = K(e, Q.__wbindgen_malloc), i = Z, a = Q.parse_xlsx(r, i, !G(t), G(t) ? BigInt(0) : t, !G(n), G(n) ? BigInt(0) : n);
896
+ if (a[3]) throw J(a[2]);
897
+ var o = B(a[0], a[1]).slice();
898
898
  return Q.__wbindgen_free(a[0], a[1] * 1, 1), o;
899
899
  }
900
- function bt(e, t, n) {
900
+ function yt(e, t, n) {
901
901
  let r, i;
902
902
  try {
903
- let s = G(e, Q.__wbindgen_malloc), c = Z, l = Q.xlsx_to_markdown(s, c, !W(t), W(t) ? BigInt(0) : t, !W(n), W(n) ? BigInt(0) : n);
903
+ let s = K(e, Q.__wbindgen_malloc), c = Z, l = Q.xlsx_to_markdown(s, c, !G(t), G(t) ? BigInt(0) : t, !G(n), G(n) ? BigInt(0) : n);
904
904
  var a = l[0], o = l[1];
905
- if (l[3]) throw a = 0, o = 0, q(l[2]);
906
- return r = a, i = o, V(a, o);
905
+ if (l[3]) throw a = 0, o = 0, J(l[2]);
906
+ return r = a, i = o, H(a, o);
907
907
  } finally {
908
908
  Q.__wbindgen_free(r, i, 1);
909
909
  }
910
910
  }
911
- function xt() {
911
+ function bt() {
912
912
  return {
913
913
  __proto__: null,
914
914
  "./xlsx_parser_bg.js": {
915
915
  __proto__: null,
916
916
  __wbg___wbindgen_throw_6b64449b9b9ed33c: function(e, t) {
917
- throw Error(V(e, t));
917
+ throw Error(H(e, t));
918
918
  },
919
919
  __wbg_error_a6fa202b58aa1cd3: function(e, t) {
920
920
  let n, r;
921
921
  try {
922
- n = e, r = t, console.error(V(e, t));
922
+ n = e, r = t, console.error(H(e, t));
923
923
  } finally {
924
924
  Q.__wbindgen_free(n, r, 1);
925
925
  }
@@ -928,11 +928,11 @@ function xt() {
928
928
  return /* @__PURE__ */ Error();
929
929
  },
930
930
  __wbg_stack_3b0d974bbf31e44f: function(e, t) {
931
- let n = t.stack, r = K(n, Q.__wbindgen_malloc, Q.__wbindgen_realloc), i = Z;
932
- Ct().setInt32(e + 4, i, !0), Ct().setInt32(e + 0, r, !0);
931
+ let n = t.stack, r = q(n, Q.__wbindgen_malloc, Q.__wbindgen_realloc), i = Z;
932
+ St().setInt32(e + 4, i, !0), St().setInt32(e + 0, r, !0);
933
933
  },
934
934
  __wbindgen_cast_0000000000000001: function(e, t) {
935
- return V(e, t);
935
+ return H(e, t);
936
936
  },
937
937
  __wbindgen_init_externref_table: function() {
938
938
  let e = Q.__wbindgen_externrefs, t = e.grow(4);
@@ -941,37 +941,37 @@ function xt() {
941
941
  }
942
942
  };
943
943
  }
944
- var St = typeof FinalizationRegistry > "u" ? {
944
+ var xt = typeof FinalizationRegistry > "u" ? {
945
945
  register: () => {},
946
946
  unregister: () => {}
947
947
  } : new FinalizationRegistry((e) => Q.__wbg_xlsxarchive_free(e >>> 0, 1));
948
- function z(e, t) {
949
- return e >>>= 0, U().subarray(e / 1, e / 1 + t);
948
+ function B(e, t) {
949
+ return e >>>= 0, W().subarray(e / 1, e / 1 + t);
950
950
  }
951
- var B = null;
952
- function Ct() {
953
- return (B === null || B.buffer.detached === !0 || B.buffer.detached === void 0 && B.buffer !== Q.memory.buffer) && (B = new DataView(Q.memory.buffer)), B;
951
+ var V = null;
952
+ function St() {
953
+ return (V === null || V.buffer.detached === !0 || V.buffer.detached === void 0 && V.buffer !== Q.memory.buffer) && (V = new DataView(Q.memory.buffer)), V;
954
954
  }
955
- function V(e, t) {
955
+ function H(e, t) {
956
956
  return e >>>= 0, Tt(e, t);
957
957
  }
958
- var H = null;
959
- function U() {
960
- return (H === null || H.byteLength === 0) && (H = new Uint8Array(Q.memory.buffer)), H;
958
+ var U = null;
959
+ function W() {
960
+ return (U === null || U.byteLength === 0) && (U = new Uint8Array(Q.memory.buffer)), U;
961
961
  }
962
- function W(e) {
962
+ function G(e) {
963
963
  return e == null;
964
964
  }
965
- function G(e, t) {
965
+ function K(e, t) {
966
966
  let n = t(e.length * 1, 1) >>> 0;
967
- return U().set(e, n / 1), Z = e.length, n;
967
+ return W().set(e, n / 1), Z = e.length, n;
968
968
  }
969
- function K(e, t, n) {
969
+ function q(e, t, n) {
970
970
  if (n === void 0) {
971
971
  let n = X.encode(e), r = t(n.length, 1) >>> 0;
972
- return U().subarray(r, r + n.length).set(n), Z = n.length, r;
972
+ return W().subarray(r, r + n.length).set(n), Z = n.length, r;
973
973
  }
974
- let r = e.length, i = t(r, 1) >>> 0, a = U(), o = 0;
974
+ let r = e.length, i = t(r, 1) >>> 0, a = W(), o = 0;
975
975
  for (; o < r; o++) {
976
976
  let t = e.charCodeAt(o);
977
977
  if (t > 127) break;
@@ -979,26 +979,26 @@ function K(e, t, n) {
979
979
  }
980
980
  if (o !== r) {
981
981
  o !== 0 && (e = e.slice(o)), i = n(i, r, r = o + e.length * 3, 1) >>> 0;
982
- let t = U().subarray(i + o, i + r), a = X.encodeInto(e, t);
982
+ let t = W().subarray(i + o, i + r), a = X.encodeInto(e, t);
983
983
  o += a.written, i = n(i, r, o, 1) >>> 0;
984
984
  }
985
985
  return Z = o, i;
986
986
  }
987
- function q(e) {
987
+ function J(e) {
988
988
  let t = Q.__wbindgen_externrefs.get(e);
989
989
  return Q.__externref_table_dealloc(e), t;
990
990
  }
991
- var J = new TextDecoder("utf-8", {
991
+ var Y = new TextDecoder("utf-8", {
992
992
  ignoreBOM: !0,
993
993
  fatal: !0
994
994
  });
995
- J.decode();
996
- var wt = 2146435072, Y = 0;
995
+ Y.decode();
996
+ var Ct = 2146435072, wt = 0;
997
997
  function Tt(e, t) {
998
- return Y += t, Y >= wt && (J = new TextDecoder("utf-8", {
998
+ return wt += t, wt >= Ct && (Y = new TextDecoder("utf-8", {
999
999
  ignoreBOM: !0,
1000
1000
  fatal: !0
1001
- }), J.decode(), Y = t), J.decode(U().subarray(e, e + t));
1001
+ }), Y.decode(), wt = t), Y.decode(W().subarray(e, e + t));
1002
1002
  }
1003
1003
  var X = new TextEncoder();
1004
1004
  "encodeInto" in X || (X.encodeInto = function(e, t) {
@@ -1010,7 +1010,7 @@ var X = new TextEncoder();
1010
1010
  });
1011
1011
  var Z = 0, Q;
1012
1012
  function Et(e, t) {
1013
- return Q = e.exports, B = null, H = null, Q.__wbindgen_start(), Q;
1013
+ return Q = e.exports, V = null, U = null, Q.__wbindgen_start(), Q;
1014
1014
  }
1015
1015
  async function Dt(e, t) {
1016
1016
  if (typeof Response == "function" && e instanceof Response) {
@@ -1041,30 +1041,30 @@ async function Dt(e, t) {
1041
1041
  function Ot(e) {
1042
1042
  if (Q !== void 0) return Q;
1043
1043
  e !== void 0 && (Object.getPrototypeOf(e) === Object.prototype ? {module: e} = e : console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));
1044
- let t = xt();
1044
+ let t = bt();
1045
1045
  return e instanceof WebAssembly.Module || (e = new WebAssembly.Module(e)), Et(new WebAssembly.Instance(e, t), e);
1046
1046
  }
1047
1047
  async function kt(e) {
1048
1048
  if (Q !== void 0) return Q;
1049
1049
  e !== void 0 && (Object.getPrototypeOf(e) === Object.prototype ? {module_or_path: e} = e : console.warn("using deprecated parameters for the initialization function; pass a single object instead"));
1050
- let t = xt();
1050
+ let t = bt();
1051
1051
  (typeof e == "string" || typeof Request == "function" && e instanceof Request || typeof URL == "function" && e instanceof URL) && (e = fetch(e));
1052
1052
  let { instance: n, module: r } = await Dt(await e, t);
1053
1053
  return Et(n, r);
1054
1054
  }
1055
1055
  async function At(e) {
1056
- return Q = void 0, B = null, H = null, kt(e);
1056
+ return Q = void 0, V = null, U = null, kt(e);
1057
1057
  }
1058
1058
  //#endregion
1059
1059
  //#region packages/xlsx/src/internal/node-acquisition.ts
1060
1060
  var jt, Mt;
1061
1061
  function Nt(e) {
1062
- if (!Mt) jt = e, Mt = new Ce(_t, e);
1062
+ if (!Mt) jt = e, Mt = new Ce(gt, e);
1063
1063
  else if (jt !== e) throw Error("XLSX runtime was already initialized with another WebAssembly.Module");
1064
1064
  return Mt;
1065
1065
  }
1066
1066
  async function Pt(e, t, r = {}) {
1067
- let i = n(r), a = new l({
1067
+ let i = n(r), s = new f({
1068
1068
  enabled: i.debug || i.onResourceMetrics !== void 0,
1069
1069
  format: "xlsx",
1070
1070
  mode: "node",
@@ -1073,35 +1073,35 @@ async function Pt(e, t, r = {}) {
1073
1073
  onMetrics: i.onResourceMetrics,
1074
1074
  emitToConsole: i.debug
1075
1075
  });
1076
- a.setSourceBytes(e.byteLength);
1077
- let s;
1076
+ s.setSourceBytes(e.byteLength);
1077
+ let c;
1078
1078
  try {
1079
1079
  It(r.signal);
1080
- let [n, c, l] = o(i.policy), u = R;
1081
- s = await Nt(t).open(() => new u(e, n, c, l), {
1080
+ let [n, a, l] = o(i.policy), u = z;
1081
+ c = await Nt(t).open(() => new u(e, n, a, l), {
1082
1082
  signal: r.signal,
1083
1083
  abortError: Lt,
1084
1084
  disposeOnAbort: (e) => e.free()
1085
1085
  }), It(r.signal);
1086
- let d = s.proxy, f = JSON.parse(new TextDecoder().decode(d.parse())), p = Ft(d.resource_usage());
1087
- return a.observeUsage(p), a.checkpoint("workbook index ready"), {
1086
+ let d = c.proxy, f = JSON.parse(new TextDecoder().decode(d.parse())), p = Ft(d.resource_usage());
1087
+ return s.observeUsage(p), s.checkpoint("workbook index ready"), {
1088
1088
  archive: d,
1089
1089
  workbookIndex: f,
1090
1090
  usage: p,
1091
- metrics: a,
1092
- closeArchive: () => s?.close((e) => e.free())
1091
+ metrics: s,
1092
+ closeArchive: () => c?.close((e) => e.free())
1093
1093
  };
1094
1094
  } catch (e) {
1095
1095
  try {
1096
- s?.close((e) => e.free());
1096
+ c?.close((e) => e.free());
1097
1097
  } catch {}
1098
- let t = p(e) ?? e;
1099
- throw a.fail(t), t;
1098
+ let t = a(e) ?? e;
1099
+ throw s.fail(t), t;
1100
1100
  }
1101
1101
  }
1102
1102
  function Ft(e) {
1103
1103
  try {
1104
- return g(e);
1104
+ return p(e);
1105
1105
  } catch (e) {
1106
1106
  if (String(e).includes("worksheet cursor usage is unavailable")) return;
1107
1107
  throw e;
@@ -1116,7 +1116,7 @@ function Lt() {
1116
1116
  }
1117
1117
  //#endregion
1118
1118
  //#region packages/node/src/xlsx.ts
1119
- var Rt = Ie(() => y(import.meta.url, "xlsx_parser_bg.wasm", "@silurus/ooxml-xlsx/wasm-binary"));
1119
+ var Rt = y(() => b(import.meta.url, "xlsx_parser_bg.wasm", "@silurus/ooxml-xlsx/wasm-binary"));
1120
1120
  async function $(e, t = {}) {
1121
1121
  let n = await Pt(Kt(e), Rt(), t);
1122
1122
  return new zt(n.closeArchive, n.archive, n.workbookIndex, n.metrics, n.usage, t.signal);
@@ -1184,13 +1184,13 @@ var zt = class {
1184
1184
  }
1185
1185
  this.completedWorksheets += 1, this.metrics.checkpoint("worksheet stream complete", this.lastUsage);
1186
1186
  } catch (e) {
1187
- throw r = p(e) ?? e, this.metrics.fail(r), await this.close().catch(() => void 0), r;
1187
+ throw r = a(e) ?? e, this.metrics.fail(r), await this.close().catch(() => void 0), r;
1188
1188
  } finally {
1189
1189
  try {
1190
1190
  await this.cleanupOperation(n, r === void 0 ? "closed" : "request-error");
1191
1191
  } catch (e) {
1192
1192
  if (r === void 0) {
1193
- let t = p(e) ?? e;
1193
+ let t = a(e) ?? e;
1194
1194
  throw this.metrics.fail(t), await this.close().catch(() => void 0), t;
1195
1195
  }
1196
1196
  }
@@ -1205,12 +1205,12 @@ var zt = class {
1205
1205
  try {
1206
1206
  await this.worksheetPullClient.cancelAll(t);
1207
1207
  } catch (e) {
1208
- n = p(e) ?? e;
1208
+ n = a(e) ?? e;
1209
1209
  }
1210
1210
  try {
1211
1211
  await this.pull.reset();
1212
1212
  } catch (e) {
1213
- n ??= p(e) ?? e;
1213
+ n ??= a(e) ?? e;
1214
1214
  }
1215
1215
  if (this.active === e && (this.active = void 0), n !== void 0) throw n;
1216
1216
  })(), e.cleanupPromise;
@@ -1220,13 +1220,13 @@ var zt = class {
1220
1220
  if (this.active) try {
1221
1221
  await this.cleanupOperation(this.active, "closed");
1222
1222
  } catch (t) {
1223
- e = p(t) ?? t;
1223
+ e = a(t) ?? t;
1224
1224
  }
1225
1225
  this.transport.terminate();
1226
1226
  try {
1227
1227
  this.closeArchive();
1228
1228
  } catch (t) {
1229
- e ??= p(t) ?? t;
1229
+ e ??= a(t) ?? t;
1230
1230
  }
1231
1231
  if (e !== void 0) throw this.metrics.fail(e), e;
1232
1232
  this.metrics.checkpoint("workbook session closed", this.lastUsage), this.metrics.succeed({
@@ -1300,7 +1300,7 @@ function Wt(e, t = /* @__PURE__ */ new WeakSet()) {
1300
1300
  }
1301
1301
  function Gt(e) {
1302
1302
  try {
1303
- return g(e);
1303
+ return p(e);
1304
1304
  } catch (e) {
1305
1305
  if (String(e).includes("worksheet cursor usage is unavailable")) return;
1306
1306
  throw e;
@@ -1310,4 +1310,4 @@ function Kt(e) {
1310
1310
  return e instanceof Uint8Array ? e : new Uint8Array(e);
1311
1311
  }
1312
1312
  //#endregion
1313
- export { ce as OoxmlDecodedImageLimitError, f as OoxmlResourceLimitError, De as installImageBitmapShim, Te as installOffscreenCanvasShim, le as isOoxmlDecodedImageLimitError, pt as materializeDocxDocument, Ve as materializePptxPresentation, Ht as materializeXlsxWorkbook, Bt as materializeXlsxWorkbookIndex, Vt as materializeXlsxWorksheet, ft as openDocxDocument, Re as openPptxPresentation, $ as openXlsxWorkbook, Ee as renderSlideNode };
1313
+ export { ce as OoxmlDecodedImageLimitError, d as OoxmlResourceLimitError, De as installImageBitmapShim, Te as installOffscreenCanvasShim, le as isOoxmlDecodedImageLimitError, ft as materializeDocxDocument, Be as materializePptxPresentation, Ht as materializeXlsxWorkbook, Bt as materializeXlsxWorkbookIndex, Vt as materializeXlsxWorksheet, dt as openDocxDocument, Le as openPptxPresentation, $ as openXlsxWorkbook, Ee as renderSlideNode };