@silurus/ooxml 0.84.1 → 0.85.1

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 (68) hide show
  1. package/README.md +44 -18
  2. package/dist/assets/render-worker-BRKOyWVH.js +24 -0
  3. package/dist/assets/render-worker-CtLMFj9r.js +10 -0
  4. package/dist/assets/render-worker-NZPOUOTU.js +11 -0
  5. package/dist/{canvas-viewer-mechanics-CIfhCgYA.js → canvas-viewer-mechanics-CfRzOhz5.js} +308 -234
  6. package/dist/chart-ex.mjs +270 -270
  7. package/dist/{comment-ui-runtime-CdMMApEN.js → comment-ui-runtime-CAbpuWi_.js} +4 -4
  8. package/dist/{comment-ui-runtime-C5qimVMD.js → comment-ui-runtime-DAKBCpsM.js} +5 -5
  9. package/dist/comment-ui-runtime-DTaaZdXC.js +2 -0
  10. package/dist/{comments-BAlAyIhb.js → comments-Brfxa3hQ.js} +1 -1
  11. package/dist/{document-pull-client-BXw6AAhY.js → document-pull-client-BkHHIdR4.js} +4661 -4357
  12. package/dist/{docx-BA1vB0V-.js → docx-_uelcAui.js} +338 -304
  13. package/dist/docx.mjs +7 -6
  14. package/dist/docx_parser_bg.wasm +0 -0
  15. package/dist/{dom-interaction-boundary-DS6BVyHA.js → dom-interaction-boundary-CMDDgICk.js} +1 -1
  16. package/dist/index.mjs +3 -3
  17. package/dist/line-distribute-CiKeWjBF.js +1023 -0
  18. package/dist/{line-metrics-CXyjyYd5.js → line-metrics-u87yCAfV.js} +2182 -705
  19. package/dist/math.mjs +2 -2
  20. package/dist/node.mjs +404 -394
  21. package/dist/pixel-budget-Dgjw269h.js +37 -0
  22. package/dist/{plot-area-frame-DuXZzovH.js → plot-area-frame-D5hEOgkJ.js} +691 -1418
  23. package/dist/{pptx-C17oBD8Z.js → pptx-WpBbS0mq.js} +255 -222
  24. package/dist/pptx.mjs +7 -6
  25. package/dist/pptx_parser_bg.wasm +0 -0
  26. package/dist/raster-target-whZhvVMt.js +87 -0
  27. package/dist/region-map.mjs +5 -5
  28. package/dist/{render-CVeGktZG.js → render-DrAAZWwH.js} +9 -6
  29. package/dist/{render-worker-host-BbhwA24Y.js → render-worker-host-CBVe8aeD.js} +1 -1
  30. package/dist/{render-worker-host-BWdhjVH_.js → render-worker-host-CHlwYJdK.js} +1 -1
  31. package/dist/{render-worker-host-CbaQivE7.js → render-worker-host-XDMsyVsv.js} +1 -1
  32. package/dist/{renderer-Bmky2yBc.js → renderer-XFSCOT6m.js} +1937 -1936
  33. package/dist/resource-measurement-6uR3Huao.js +150 -0
  34. package/dist/{session-Cl0RVnMs.js → session-DoPwA4gv.js} +79 -79
  35. package/dist/{slide-pull-client-BS0EeZo2.js → slide-pull-client-8i8C4VyD.js} +1054 -824
  36. package/dist/{three-d-B7LsKeOS.js → three-d-YYghQndN.js} +109 -110
  37. package/dist/three-d.mjs +726 -726
  38. package/dist/tiff.mjs +664 -78
  39. package/dist/types/chart-ex.d.ts +2 -2
  40. package/dist/types/docx.d.ts +31 -13
  41. package/dist/types/index.d.ts +46 -21
  42. package/dist/types/math.d.ts +1 -1
  43. package/dist/types/node.d.ts +11 -7
  44. package/dist/types/pptx.d.ts +35 -15
  45. package/dist/types/region-map.d.ts +2 -2
  46. package/dist/types/three-d.d.ts +2 -2
  47. package/dist/types/tiff.d.ts +13 -3
  48. package/dist/types/xlsx.d.ts +30 -13
  49. package/dist/{worksheet-pull-client-B0zfEVau.js → worksheet-pull-client-Btydoxto.js} +47 -47
  50. package/dist/{xlsx-FyKAiNo-.js → xlsx-Bd16V4Xx.js} +1395 -1196
  51. package/dist/xlsx.mjs +7 -6
  52. package/package.json +2 -2
  53. package/dist/assets/render-worker-BWPpayBu.js +0 -10
  54. package/dist/assets/render-worker-CiEWCh_T.js +0 -11
  55. package/dist/assets/render-worker-Cpmy3GDF.js +0 -24
  56. package/dist/comment-ui-runtime-aPzHfV_A.js +0 -2
  57. package/dist/line-distribute-MqInuujx.js +0 -1003
  58. package/dist/resource-measurement-esyGbzAF.js +0 -120
  59. package/dist/tiff-contract-Xjn3qXqK.js +0 -69
  60. /package/dist/{comment-occurrence-C34fWs_F.js → comment-occurrence-tj54AXXB.js} +0 -0
  61. /package/dist/{highlight-rect-MaCt0om0.js → highlight-rect-DBcYVJDv.js} +0 -0
  62. /package/dist/{mathjax-DPEX346v.js → mathjax-DS69BmJd.js} +0 -0
  63. /package/dist/{read-only-comment-decoration-BYCXoSdC.js → read-only-comment-decoration-Mv_SAiHy.js} +0 -0
  64. /package/dist/{read-only-comment-margin-C7b3l0ro.js → read-only-comment-margin-Cqu-Ir0C.js} +0 -0
  65. /package/dist/{renderer-module-contract-C6sYZvTV.js → renderer-module-contract-Cu-GKuPd.js} +0 -0
  66. /package/dist/{source-key-DORuuFb-.js → source-key-BkBB3X82.js} +0 -0
  67. /package/dist/{transfer-vNOFQuvv.js → transfer-mIj7E7NB.js} +0 -0
  68. /package/dist/{visible-index-DwJzuGmJ.js → visible-index-DPoQYSDt.js} +0 -0
package/dist/node.mjs CHANGED
@@ -1,19 +1,19 @@
1
1
  import { t as e } from "./chunk-DmhlhrBa.js";
2
- import { t } from "./slide-pull-client-BS0EeZo2.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-CXyjyYd5.js";
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-BXw6AAhY.js";
6
- import { o as ce, s as le } from "./tiff-contract-Xjn3qXqK.js";
7
- import { t as ue } from "./transfer-vNOFQuvv.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-B0zfEVau.js";
9
- import { a as be, i as xe, n as Se, r as Ce } from "./session-Cl0RVnMs.js";
10
- import { a as we, n as Te, r as Ee, t as De } from "./render-CVeGktZG.js";
11
- import { existsSync as Oe, readFileSync as ke } from "node:fs";
12
- import { fileURLToPath as Ae } from "node:url";
13
- import { basename as je, dirname as Me, resolve as Ne } from "node:path";
14
- import { createRequire as Pe } from "node:module";
2
+ import { t } from "./slide-pull-client-8i8C4VyD.js";
3
+ import { B as n, F as r, G as i, Gt as a, H as o, I as s, K as c, P as l, R as u, U as d, Wt as f, Xt as p, pt as m, q as h, sn as g, ut as _ } from "./line-metrics-u87yCAfV.js";
4
+ import { t as ee } from "./bounded-raw-part-cache-C6ro6Ezf.js";
5
+ import { a as te, c as ne, i as re, l as ie, r as ae, u as oe } from "./document-pull-client-BkHHIdR4.js";
6
+ import { l as se, s as ce } from "./pixel-budget-Dgjw269h.js";
7
+ import { t as le } from "./transfer-mIj7E7NB.js";
8
+ import { a as ue, c as de, d as fe, l as pe, o as me, r as he, s as ge, t as _e, u as ve } from "./worksheet-pull-client-Btydoxto.js";
9
+ import { a as ye, i as be, n as xe, r as Se } from "./session-DoPwA4gv.js";
10
+ import { a as Ce, n as we, r as Te, t as Ee } from "./render-DrAAZWwH.js";
11
+ import { existsSync as De, readFileSync as Oe } from "node:fs";
12
+ import { fileURLToPath as ke } from "node:url";
13
+ import { basename as Ae, dirname as je, resolve as Me } from "node:path";
14
+ import { createRequire as Ne } from "node:module";
15
15
  //#region packages/core/src/internal/owned-session.ts
16
- async function _(e, t) {
16
+ async function v(e, t) {
17
17
  let n = await e(), r;
18
18
  try {
19
19
  return await t(n);
@@ -29,7 +29,7 @@ async function _(e, t) {
29
29
  }
30
30
  //#endregion
31
31
  //#region packages/core/src/internal/in-process-pull-transport.ts
32
- var v = class {
32
+ var y = class {
33
33
  nextRequestId = 1;
34
34
  terminated = !1;
35
35
  constructor(e, t) {
@@ -55,30 +55,30 @@ var v = class {
55
55
  };
56
56
  //#endregion
57
57
  //#region packages/node/src/wasm-loader.ts
58
- function Fe(e) {
59
- return new WebAssembly.Module(ke(e));
58
+ function Pe(e) {
59
+ return new WebAssembly.Module(Oe(e));
60
60
  }
61
- function y(e, t = Fe) {
61
+ function b(e, t = Pe) {
62
62
  let n = {};
63
63
  return () => n.value ??= t(e());
64
64
  }
65
- function b(e, t, n) {
66
- let r = Me(Ae(e)), i = Ne(r, t);
67
- if (Oe(i)) return i;
68
- let a = Ne(r, je(t));
69
- return Oe(a) || !n ? a : Pe(e).resolve(n);
65
+ function x(e, t, n) {
66
+ let r = je(ke(e)), i = Me(r, t);
67
+ if (De(i)) return i;
68
+ let a = Me(r, Ae(t));
69
+ return De(a) || !n ? a : Ne(e).resolve(n);
70
70
  }
71
71
  //#endregion
72
72
  //#region packages/node/src/pptx.ts
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);
73
+ var Fe = b(() => x(import.meta.url, "pptx_parser_bg.wasm", "@silurus/ooxml-pptx/wasm-binary"));
74
+ async function Ie(e, t = {}) {
75
+ return Le(e, t);
76
76
  }
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);
77
+ async function Le(e, t = {}) {
78
+ let n = await xe(Be(e), Fe(), t);
79
+ return new Re(n.closeArchive, n.archive, n.bootstrap, n.metrics, t.signal);
80
80
  }
81
- var ze = class {
81
+ var Re = class {
82
82
  slideCount;
83
83
  slideWidth;
84
84
  slideHeight;
@@ -94,12 +94,12 @@ var ze = class {
94
94
  renderTail = Promise.resolve();
95
95
  fetchImage = (e, t) => this.getPartInternal(e, t, (t) => t.extract_image(e));
96
96
  fetchMedia = (e) => this.getPartInternal(e, "application/octet-stream", (t) => t.extract_media(e));
97
- rawParts = new te({
97
+ rawParts = new ee({
98
98
  maxEntries: 64,
99
- maxBytes: m
99
+ maxBytes: p
100
100
  });
101
101
  constructor(e, n, r, i, a) {
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({
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 be(() => this.archive), this.transport = new y((e, t) => this.slidePull.dispatchSafely(e, t), () => void 0), this.slideClient = new t({
103
103
  slideCount: this.slideCount,
104
104
  transport: this.transport,
105
105
  open: async (e, t) => {
@@ -133,8 +133,8 @@ var ze = class {
133
133
  }
134
134
  async renderSlide(e, t, n) {
135
135
  return this.assertOpen(), this.enqueueRender(async () => {
136
- x(this.signal);
137
- let { renderSlideNode: r } = await import("./render-CVeGktZG.js").then((e) => e.i);
136
+ S(this.signal);
137
+ let { renderSlideNode: r } = await import("./render-DrAAZWwH.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 ze = class {
148
148
  ...n,
149
149
  fetchImage: this.fetchImage,
150
150
  fetchMedia: this.fetchMedia
151
- }), x(this.signal);
151
+ }), S(this.signal);
152
152
  }).catch((e) => this.failOperation(e));
153
153
  }
154
154
  [Symbol.asyncIterator]() {
@@ -161,13 +161,13 @@ var ze = class {
161
161
  let e;
162
162
  try {
163
163
  for (let e = 0; e < this.slideCount; e += 1) {
164
- x(this.signal);
164
+ S(this.signal);
165
165
  let t = await this.slideClient.load(e);
166
166
  if (!t) throw Error(`PPTX slide ${e} was not decoded`);
167
- this.usage ??= await this.slidePull.run(() => be((e) => e(this.archive))), this.metrics.observeUsage(this.usage), this.consumedSlides = e + 1, yield t;
167
+ this.usage ??= await this.slidePull.run(() => ye((e) => e(this.archive))), this.metrics.observeUsage(this.usage), this.consumedSlides = e + 1, yield t;
168
168
  }
169
169
  } catch (t) {
170
- throw e = a(t) ?? t, this.metrics.fail(e), e;
170
+ throw e = i(t) ?? t, this.metrics.fail(e), e;
171
171
  } finally {
172
172
  try {
173
173
  await this.close();
@@ -181,17 +181,17 @@ var ze = class {
181
181
  }
182
182
  async release() {
183
183
  let e;
184
- await this.renderTail, h(this.fetchImage), g(this.fetchImage);
184
+ await this.renderTail, m(this.fetchImage), _(this.fetchImage);
185
185
  try {
186
186
  await this.slidePull.reset();
187
187
  } catch (t) {
188
- e = a(t) ?? t;
188
+ e = i(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 ??= a(t) ?? t;
194
+ e ??= i(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 ze = class {
202
202
  }
203
203
  getPartInternal(e, t, n) {
204
204
  return this.rawParts.get(e, t, () => {
205
- x(this.signal);
205
+ S(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 = p(this.archive.resource_usage()), this.metrics.observeUsage(this.usage);
212
+ this.usage = d(this.archive.resource_usage()), this.metrics.observeUsage(this.usage);
213
213
  } catch {}
214
214
  return this.usage;
215
215
  }
@@ -218,28 +218,28 @@ var ze = class {
218
218
  if (this.resourceFailure) throw this.resourceFailure;
219
219
  }
220
220
  failOperation(e) {
221
- let t = a(e) ?? e;
222
- throw t instanceof d && (this.resourceFailure ??= t), this.metrics.fail(t), t;
221
+ let t = i(e) ?? e;
222
+ throw t instanceof g && (this.resourceFailure ??= t), this.metrics.fail(t), t;
223
223
  }
224
224
  };
225
- async function Be(e, t = {}) {
226
- return _(() => Re(e, t), async (e) => {
225
+ async function ze(e, t = {}) {
226
+ return v(() => Le(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 Ve(e) {
232
+ function Be(e) {
233
233
  return e instanceof Uint8Array ? e : new Uint8Array(e);
234
234
  }
235
- function x(e) {
235
+ function S(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 He = Math.max(i, c), Ue = class {
242
+ var Ve = Math.max(f, a), He = class {
243
243
  coordinator = new s();
244
244
  host = null;
245
245
  identity = null;
@@ -254,7 +254,7 @@ var He = Math.max(i, c), Ue = class {
254
254
  let t = 0;
255
255
  this.identity = e, this.host = new r({
256
256
  ...e,
257
- maxByteCredit: He,
257
+ maxByteCredit: Ve,
258
258
  coordinator: this.coordinator,
259
259
  driver: {
260
260
  pull: (n) => {
@@ -262,9 +262,9 @@ var He = Math.max(i, c), Ue = 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, He) || e;
265
+ throw h(e, n, Ve) || e;
266
266
  }
267
- let i = ue(r);
267
+ let i = le(r);
268
268
  return {
269
269
  payload: i,
270
270
  byteLength: i.byteLength,
@@ -281,20 +281,20 @@ var He = Math.max(i, c), Ue = 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 ? p(e) : void 0;
284
+ return e ? d(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: u,
291
+ protocol: l,
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: l(/* @__PURE__ */ Error("DOCX document pull session is not open"))
297
+ error: c(/* @__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 He = Math.max(i, c), Ue = class {
309
309
  if (!e) throw Error("No docx loaded");
310
310
  return e;
311
311
  }
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 {
312
+ }, Ue = /* @__PURE__ */ e({
313
+ DocxArchive: () => C,
314
+ default: () => tt,
315
+ docx_to_markdown: () => We,
316
+ extract_image: () => Ge,
317
+ initSync: () => et,
318
+ parse_docx: () => Ke,
319
+ reinit: () => nt
320
+ }), C = class {
321
321
  __destroy_into_raw() {
322
322
  let e = this.__wbg_ptr;
323
- return this.__wbg_ptr = 0, Ye.unregister(this), e;
323
+ return this.__wbg_ptr = 0, Je.unregister(this), e;
324
324
  }
325
325
  free() {
326
326
  let e = this.__destroy_into_raw();
327
- I.__wbg_docxarchive_free(e, 0);
327
+ L.__wbg_docxarchive_free(e, 0);
328
328
  }
329
329
  acknowledge_document_chunk(e, t, n) {
330
- let r = I.docxarchive_acknowledge_document_chunk(this.__wbg_ptr, e, t, n);
331
- if (r[1]) throw j(r[0]);
330
+ let r = L.docxarchive_acknowledge_document_chunk(this.__wbg_ptr, e, t, n);
331
+ if (r[1]) throw M(r[0]);
332
332
  }
333
333
  assert_healthy() {
334
- let e = I.docxarchive_assert_healthy(this.__wbg_ptr);
335
- if (e[1]) throw j(e[0]);
334
+ let e = L.docxarchive_assert_healthy(this.__wbg_ptr);
335
+ if (e[1]) throw M(e[0]);
336
336
  }
337
337
  cancel_document_cursor() {
338
- I.docxarchive_cancel_document_cursor(this.__wbg_ptr);
338
+ L.docxarchive_cancel_document_cursor(this.__wbg_ptr);
339
339
  }
340
340
  close_document_session() {
341
- I.docxarchive_close_document_session(this.__wbg_ptr);
341
+ L.docxarchive_close_document_session(this.__wbg_ptr);
342
342
  }
343
343
  document_chunk_done() {
344
- let e = I.docxarchive_document_chunk_done(this.__wbg_ptr);
345
- if (e[2]) throw j(e[1]);
344
+ let e = L.docxarchive_document_chunk_done(this.__wbg_ptr);
345
+ if (e[2]) throw M(e[1]);
346
346
  return e[0] !== 0;
347
347
  }
348
348
  document_cursor_resource_usage() {
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;
349
+ let e = L.docxarchive_document_cursor_resource_usage(this.__wbg_ptr);
350
+ if (e[3]) throw M(e[2]);
351
+ var t = w(e[0], e[1]).slice();
352
+ return L.__wbindgen_free(e[0], e[1] * 1, 1), t;
353
353
  }
354
354
  extract_image(e) {
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;
355
+ let t = j(e, L.__wbindgen_malloc, L.__wbindgen_realloc), n = I, r = L.docxarchive_extract_image(this.__wbg_ptr, t, n);
356
+ if (r[3]) throw M(r[2]);
357
+ var i = w(r[0], r[1]).slice();
358
+ return L.__wbindgen_free(r[0], r[1] * 1, 1), i;
359
359
  }
360
360
  constructor(e, t, n, r) {
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;
361
+ let i = A(e, L.__wbindgen_malloc), a = I, o = L.docxarchive_new(i, a, !k(t), k(t) ? BigInt(0) : t, !k(n), k(n) ? BigInt(0) : n, !k(r), k(r) ? BigInt(0) : r);
362
+ if (o[2]) throw M(o[1]);
363
+ return this.__wbg_ptr = o[0] >>> 0, Je.register(this, this.__wbg_ptr, this), this;
364
364
  }
365
365
  open_document_cursor(e, t) {
366
- let n = I.docxarchive_open_document_cursor(this.__wbg_ptr, e, t);
367
- if (n[1]) throw j(n[0]);
366
+ let n = L.docxarchive_open_document_cursor(this.__wbg_ptr, e, t);
367
+ if (n[1]) throw M(n[0]);
368
368
  }
369
369
  parse() {
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;
370
+ let e = L.docxarchive_parse(this.__wbg_ptr);
371
+ if (e[3]) throw M(e[2]);
372
+ var t = w(e[0], e[1]).slice();
373
+ return L.__wbindgen_free(e[0], e[1] * 1, 1), t;
374
374
  }
375
375
  pull_document_chunk(e, t, n, r) {
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;
376
+ let i = L.docxarchive_pull_document_chunk(this.__wbg_ptr, e, t, n, r);
377
+ if (i[3]) throw M(i[2]);
378
+ var a = w(i[0], i[1]).slice();
379
+ return L.__wbindgen_free(i[0], i[1] * 1, 1), a;
380
380
  }
381
381
  resource_usage() {
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;
382
+ let e = L.docxarchive_resource_usage(this.__wbg_ptr);
383
+ if (e[3]) throw M(e[2]);
384
+ var t = w(e[0], e[1]).slice();
385
+ return L.__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 = I.docxarchive_to_markdown(this.__wbg_ptr);
390
+ let i = L.docxarchive_to_markdown(this.__wbg_ptr);
391
391
  var n = i[0], r = i[1];
392
- if (i[3]) throw n = 0, r = 0, j(i[2]);
393
- return e = n, t = r, T(n, r);
392
+ if (i[3]) throw n = 0, r = 0, M(i[2]);
393
+ return e = n, t = r, E(n, r);
394
394
  } finally {
395
- I.__wbindgen_free(e, t, 1);
395
+ L.__wbindgen_free(e, t, 1);
396
396
  }
397
397
  }
398
398
  };
399
- Symbol.dispose && (S.prototype[Symbol.dispose] = S.prototype.free);
400
- function Ge(e, t, n) {
399
+ Symbol.dispose && (C.prototype[Symbol.dispose] = C.prototype.free);
400
+ function We(e, t, n) {
401
401
  let r, i;
402
402
  try {
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);
403
+ let s = A(e, L.__wbindgen_malloc), c = I, l = L.docx_to_markdown(s, c, !k(t), k(t) ? BigInt(0) : t, !k(n), k(n) ? BigInt(0) : n);
404
404
  var a = l[0], o = l[1];
405
- if (l[3]) throw a = 0, o = 0, j(l[2]);
406
- return r = a, i = o, T(a, o);
405
+ if (l[3]) throw a = 0, o = 0, M(l[2]);
406
+ return r = a, i = o, E(a, o);
407
407
  } finally {
408
- I.__wbindgen_free(r, i, 1);
408
+ L.__wbindgen_free(r, i, 1);
409
409
  }
410
410
  }
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;
411
+ function Ge(e, t, n, r) {
412
+ let i = A(e, L.__wbindgen_malloc), a = I, o = j(t, L.__wbindgen_malloc, L.__wbindgen_realloc), s = I, c = L.extract_image(i, a, o, s, !k(n), k(n) ? BigInt(0) : n, !k(r), k(r) ? BigInt(0) : r);
413
+ if (c[3]) throw M(c[2]);
414
+ var l = w(c[0], c[1]).slice();
415
+ return L.__wbindgen_free(c[0], c[1] * 1, 1), l;
416
416
  }
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;
417
+ function Ke(e, t, n) {
418
+ let r = A(e, L.__wbindgen_malloc), i = I, a = L.parse_docx(r, i, !k(t), k(t) ? BigInt(0) : t, !k(n), k(n) ? BigInt(0) : n);
419
+ if (a[3]) throw M(a[2]);
420
+ var o = w(a[0], a[1]).slice();
421
+ return L.__wbindgen_free(a[0], a[1] * 1, 1), o;
422
422
  }
423
- function Je() {
423
+ function qe() {
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(T(e, t));
429
+ throw Error(E(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(T(e, t));
434
+ n = e, r = t, console.error(E(e, t));
435
435
  } finally {
436
- I.__wbindgen_free(n, r, 1);
436
+ L.__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 = A(n, I.__wbindgen_malloc, I.__wbindgen_realloc), i = F;
444
- Xe().setInt32(e + 4, i, !0), Xe().setInt32(e + 0, r, !0);
443
+ let n = t.stack, r = j(n, L.__wbindgen_malloc, L.__wbindgen_realloc), i = I;
444
+ Ye().setInt32(e + 4, i, !0), Ye().setInt32(e + 0, r, !0);
445
445
  },
446
446
  __wbindgen_cast_0000000000000001: function(e, t) {
447
- return T(e, t);
447
+ return E(e, t);
448
448
  },
449
449
  __wbindgen_init_externref_table: function() {
450
- let e = I.__wbindgen_externrefs, t = e.grow(4);
450
+ let e = L.__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 Ye = typeof FinalizationRegistry > "u" ? {
456
+ var Je = typeof FinalizationRegistry > "u" ? {
457
457
  register: () => {},
458
458
  unregister: () => {}
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);
459
+ } : new FinalizationRegistry((e) => L.__wbg_docxarchive_free(e >>> 0, 1));
460
+ function w(e, t) {
461
+ return e >>>= 0, O().subarray(e / 1, e / 1 + t);
462
462
  }
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;
463
+ var T = null;
464
+ function Ye() {
465
+ return (T === null || T.buffer.detached === !0 || T.buffer.detached === void 0 && T.buffer !== L.memory.buffer) && (T = new DataView(L.memory.buffer)), T;
466
466
  }
467
- function T(e, t) {
468
- return e >>>= 0, Qe(e, t);
467
+ function E(e, t) {
468
+ return e >>>= 0, Ze(e, t);
469
469
  }
470
- var E = null;
471
- function D() {
472
- return (E === null || E.byteLength === 0) && (E = new Uint8Array(I.memory.buffer)), E;
470
+ var D = null;
471
+ function O() {
472
+ return (D === null || D.byteLength === 0) && (D = new Uint8Array(L.memory.buffer)), D;
473
473
  }
474
- function O(e) {
474
+ function k(e) {
475
475
  return e == null;
476
476
  }
477
- function k(e, t) {
477
+ function A(e, t) {
478
478
  let n = t(e.length * 1, 1) >>> 0;
479
- return D().set(e, n / 1), F = e.length, n;
479
+ return O().set(e, n / 1), I = e.length, n;
480
480
  }
481
- function A(e, t, n) {
481
+ function j(e, t, n) {
482
482
  if (n === void 0) {
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;
483
+ let n = F.encode(e), r = t(n.length, 1) >>> 0;
484
+ return O().subarray(r, r + n.length).set(n), I = n.length, r;
485
485
  }
486
- let r = e.length, i = t(r, 1) >>> 0, a = D(), o = 0;
486
+ let r = e.length, i = t(r, 1) >>> 0, a = O(), 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 A(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 = D().subarray(i + o, i + r), a = P.encodeInto(e, t);
494
+ let t = O().subarray(i + o, i + r), a = F.encodeInto(e, t);
495
495
  o += a.written, i = n(i, r, o, 1) >>> 0;
496
496
  }
497
- return F = o, i;
497
+ return I = o, i;
498
498
  }
499
- function j(e) {
500
- let t = I.__wbindgen_externrefs.get(e);
501
- return I.__externref_table_dealloc(e), t;
499
+ function M(e) {
500
+ let t = L.__wbindgen_externrefs.get(e);
501
+ return L.__externref_table_dealloc(e), t;
502
502
  }
503
- var M = new TextDecoder("utf-8", {
503
+ var N = new TextDecoder("utf-8", {
504
504
  ignoreBOM: !0,
505
505
  fatal: !0
506
506
  });
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", {
507
+ N.decode();
508
+ var Xe = 2146435072, P = 0;
509
+ function Ze(e, t) {
510
+ return P += t, P >= Xe && (N = new TextDecoder("utf-8", {
511
511
  ignoreBOM: !0,
512
512
  fatal: !0
513
- }), M.decode(), N = t), M.decode(D().subarray(e, e + t));
513
+ }), N.decode(), P = t), N.decode(O().subarray(e, e + t));
514
514
  }
515
- var P = new TextEncoder();
516
- "encodeInto" in P || (P.encodeInto = function(e, t) {
517
- let n = P.encode(e);
515
+ var F = new TextEncoder();
516
+ "encodeInto" in F || (F.encodeInto = function(e, t) {
517
+ let n = F.encode(e);
518
518
  return t.set(n), {
519
519
  read: e.length,
520
520
  written: n.length
521
521
  };
522
522
  });
523
- var F = 0, I;
524
- function $e(e, t) {
525
- return I = e.exports, w = null, E = null, I.__wbindgen_start(), I;
523
+ var I = 0, L;
524
+ function Qe(e, t) {
525
+ return L = e.exports, T = null, D = null, L.__wbindgen_start(), L;
526
526
  }
527
- async function et(e, t) {
527
+ async function $e(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,33 +550,33 @@ async function et(e, t) {
550
550
  return !1;
551
551
  }
552
552
  }
553
- function tt(e) {
554
- if (I !== void 0) return I;
553
+ function et(e) {
554
+ if (L !== void 0) return L;
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 = Je();
557
- return e instanceof WebAssembly.Module || (e = new WebAssembly.Module(e)), $e(new WebAssembly.Instance(e, t), e);
556
+ let t = qe();
557
+ return e instanceof WebAssembly.Module || (e = new WebAssembly.Module(e)), Qe(new WebAssembly.Instance(e, t), e);
558
558
  }
559
- async function nt(e) {
560
- if (I !== void 0) return I;
559
+ async function tt(e) {
560
+ if (L !== void 0) return L;
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 = Je();
562
+ let t = qe();
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 et(await e, t);
565
- return $e(n, r);
564
+ let { instance: n, module: r } = await $e(await e, t);
565
+ return Qe(n, r);
566
566
  }
567
- async function rt(e) {
568
- return I = void 0, w = null, E = null, nt(e);
567
+ async function nt(e) {
568
+ return L = void 0, T = null, D = null, tt(e);
569
569
  }
570
570
  //#endregion
571
571
  //#region packages/docx/src/internal/node-acquisition.ts
572
- var it, L;
572
+ var rt, it;
573
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;
574
+ if (!it) rt = e, it = new Se(Ue, e);
575
+ else if (rt !== e) throw Error("DOCX runtime was already initialized with another WebAssembly.Module");
576
+ return it;
577
577
  }
578
- async function ot(e, t, r, i) {
579
- let s = n(r), c = new f({
578
+ async function ot(e, t, r, a) {
579
+ let s = n(r), c = new u({
580
580
  enabled: s.debug || s.onResourceMetrics !== void 0,
581
581
  format: "docx",
582
582
  mode: "node",
@@ -586,48 +586,48 @@ async function ot(e, t, r, i) {
586
586
  emitToConsole: s.debug
587
587
  });
588
588
  c.setSourceBytes(e.byteLength);
589
- let l, u, d;
589
+ let l, d, f;
590
590
  try {
591
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), {
592
+ let [n, i, u] = o(s.policy), p = C;
593
+ l = await at(t).open(() => new p(e, n, i, u), {
594
594
  signal: r.signal,
595
595
  abortError: lt,
596
596
  disposeOnAbort: (e) => e.free()
597
597
  }), ct(r.signal);
598
598
  let m = l.proxy;
599
- c.checkpoint("container ready"), u = new Ue(() => m);
599
+ c.checkpoint("container ready"), d = new He(() => m);
600
600
  let h = {
601
601
  sessionId: 1,
602
602
  operationId: 1,
603
603
  generation: 1
604
604
  };
605
- u.open(h), d = new v((e, t) => u?.dispatch(e, t), () => void 0);
606
- let g, ee = await i(d, h, {
605
+ d.open(h), f = new y((e, t) => d?.dispatch(e, t), () => void 0);
606
+ let g, _ = await a(f, h, {
607
607
  signal: r.signal,
608
608
  onUsage: (e) => {
609
609
  g = e, c.observeUsage(e);
610
610
  }
611
611
  });
612
- return g ??= st(m.document_cursor_resource_usage()), c.observeUsage(g), c.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 d.reset(), f.terminate(), {
613
613
  archive: m,
614
- result: ee,
614
+ result: _,
615
615
  usage: g,
616
616
  metrics: c,
617
617
  closeArchive: () => l?.close((e) => e.free())
618
618
  };
619
619
  } catch (e) {
620
- await u?.reset().catch(() => void 0), d?.terminate();
620
+ await d?.reset().catch(() => void 0), f?.terminate();
621
621
  try {
622
622
  l?.close((e) => e.free());
623
623
  } catch {}
624
- let t = a(e) ?? e;
624
+ let t = i(e) ?? e;
625
625
  throw c.fail(t), t;
626
626
  }
627
627
  }
628
628
  function st(e) {
629
629
  try {
630
- return p(e);
630
+ return d(e);
631
631
  } catch {
632
632
  return;
633
633
  }
@@ -641,25 +641,25 @@ function lt() {
641
641
  }
642
642
  //#endregion
643
643
  //#region packages/node/src/docx.ts
644
- var ut = y(() => b(import.meta.url, "docx_parser_bg.wasm", "@silurus/ooxml-docx/wasm-binary"));
644
+ var ut = b(() => x(import.meta.url, "docx_parser_bg.wasm", "@silurus/ooxml-docx/wasm-binary"));
645
645
  async function dt(e, t) {
646
646
  if (!t?.factory) throw TypeError("openDocxDocument requires a canvas factory");
647
- let n = await ot(ht(e), ut(), t, (e, t, n) => oe(e, t, n));
647
+ let n = await ot(ht(e), ut(), t, (e, t, n) => ae(e, t, n));
648
648
  try {
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);
649
+ gt(t.signal);
650
+ let e = t.factory.createCanvas(1, 1), r = ie(n.result, { measureContext: e.getContext("2d") }), i = mt(t.currentDate), a = te(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 = a(e) ?? e;
656
+ let t = i(e) ?? e;
657
657
  throw n.metrics.fail(t), t;
658
658
  }
659
659
  }
660
660
  async function ft(e, t = {}) {
661
- return _(async () => {
662
- let n = await ot(ht(e), ut(), t, (e, t, n) => ie(e, t, n)), r = !1;
661
+ return v(async () => {
662
+ let n = await ot(ht(e), ut(), t, (e, t, n) => re(e, t, n)), r = !1;
663
663
  return {
664
664
  acquired: n,
665
665
  markSucceeded: () => {
@@ -675,7 +675,7 @@ async function ft(e, t = {}) {
675
675
  };
676
676
  }, async ({ acquired: e, markSucceeded: t }) => {
677
677
  try {
678
- let n = se(e.result);
678
+ let n = oe(e.result);
679
679
  return e.metrics.checkpoint("document materialized", e.usage), t(), n;
680
680
  } catch (t) {
681
681
  throw e.metrics.fail(t), t;
@@ -710,7 +710,7 @@ var pt = class {
710
710
  }
711
711
  refreshResourceUsage() {
712
712
  try {
713
- this.lastResourceUsage = p(this.archive.resource_usage()), this.metrics.observeUsage(this.lastResourceUsage);
713
+ this.lastResourceUsage = d(this.archive.resource_usage()), this.metrics.observeUsage(this.lastResourceUsage);
714
714
  } catch {}
715
715
  return this.lastResourceUsage;
716
716
  }
@@ -724,18 +724,18 @@ var pt = 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
- R(this.signal);
727
+ gt(this.signal);
728
728
  let n = this.requireState(), r = this.factory.createCanvas(1, 1);
729
- return await we(this.factory, () => re(n.source, r, e, {
729
+ return await Ce(this.factory, () => ne(n.source, r, e, {
730
730
  ...t,
731
731
  currentDate: this.defaultCurrentDateMs,
732
732
  defaultCurrentDateMs: this.defaultCurrentDateMs,
733
733
  layoutServices: n.services,
734
734
  fetchImage: this.fetchImage
735
- })), R(this.signal), r;
735
+ })), gt(this.signal), r;
736
736
  }).catch((e) => {
737
- let t = a(e) ?? e;
738
- throw t instanceof d && (this.resourceFailure ??= t), this.metrics.fail(t), t;
737
+ let t = i(e) ?? e;
738
+ throw t instanceof g && (this.resourceFailure ??= t), this.metrics.fail(t), t;
739
739
  }));
740
740
  }
741
741
  async *pages(e = {}) {
@@ -753,7 +753,7 @@ var pt = class {
753
753
  };
754
754
  }
755
755
  } catch (e) {
756
- throw t = a(e) ?? e, t;
756
+ throw t = i(e) ?? e, t;
757
757
  } finally {
758
758
  try {
759
759
  await this.close();
@@ -770,11 +770,11 @@ var pt = class {
770
770
  return this.renderTail = t.then(() => void 0, () => void 0), t;
771
771
  }
772
772
  async release() {
773
- await this.renderTail, h(this.fetchImage), g(this.fetchImage), this.state = null;
773
+ await this.renderTail, m(this.fetchImage), _(this.fetchImage), this.state = null;
774
774
  try {
775
775
  this.closeArchive();
776
776
  } catch (e) {
777
- let t = a(e) ?? e;
777
+ let t = i(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 });
@@ -792,186 +792,204 @@ function mt(e) {
792
792
  function ht(e) {
793
793
  return e instanceof Uint8Array ? e : new Uint8Array(e);
794
794
  }
795
- function R(e) {
795
+ function gt(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
+ //#region packages/xlsx/src/internal/archive-bootstrap.ts
802
+ var _t = "xlsx resource usage is unavailable";
803
+ function vt(e, t) {
804
+ let n = e();
805
+ try {
806
+ return {
807
+ workbook: n,
808
+ usage: d(t())
809
+ };
810
+ } catch (e) {
811
+ if ((e instanceof Error ? e.message : String(e)) === _t) return {
812
+ workbook: n,
813
+ usage: void 0
814
+ };
815
+ throw e;
816
+ }
817
+ }
818
+ //#endregion
801
819
  //#region packages/xlsx/src/wasm/xlsx_parser.js
802
- var gt = /* @__PURE__ */ e({
803
- XlsxArchive: () => z,
804
- default: () => kt,
805
- extract_image: () => _t,
806
- initSync: () => Ot,
807
- parse_xlsx: () => vt,
808
- reinit: () => At,
809
- xlsx_to_markdown: () => yt
810
- }), z = class {
820
+ var yt = /* @__PURE__ */ e({
821
+ XlsxArchive: () => R,
822
+ default: () => Mt,
823
+ extract_image: () => bt,
824
+ initSync: () => jt,
825
+ parse_xlsx: () => xt,
826
+ reinit: () => Nt,
827
+ xlsx_to_markdown: () => St
828
+ }), R = class {
811
829
  __destroy_into_raw() {
812
830
  let e = this.__wbg_ptr;
813
- return this.__wbg_ptr = 0, xt.unregister(this), e;
831
+ return this.__wbg_ptr = 0, wt.unregister(this), e;
814
832
  }
815
833
  free() {
816
834
  let e = this.__destroy_into_raw();
817
- Q.__wbg_xlsxarchive_free(e, 0);
835
+ Z.__wbg_xlsxarchive_free(e, 0);
818
836
  }
819
837
  acknowledge_sheet_cursor_terminal() {
820
- let e = Q.xlsxarchive_acknowledge_sheet_cursor_terminal(this.__wbg_ptr);
821
- if (e[1]) throw J(e[0]);
838
+ let e = Z.xlsxarchive_acknowledge_sheet_cursor_terminal(this.__wbg_ptr);
839
+ if (e[1]) throw q(e[0]);
822
840
  }
823
841
  assert_healthy() {
824
- let e = Q.xlsxarchive_assert_healthy(this.__wbg_ptr);
825
- if (e[1]) throw J(e[0]);
842
+ let e = Z.xlsxarchive_assert_healthy(this.__wbg_ptr);
843
+ if (e[1]) throw q(e[0]);
826
844
  }
827
845
  cancel_sheet_cursor() {
828
- Q.xlsxarchive_cancel_sheet_cursor(this.__wbg_ptr);
846
+ Z.xlsxarchive_cancel_sheet_cursor(this.__wbg_ptr);
829
847
  }
830
848
  close_sheet_cursor() {
831
- Q.xlsxarchive_close_sheet_cursor(this.__wbg_ptr);
849
+ Z.xlsxarchive_close_sheet_cursor(this.__wbg_ptr);
832
850
  }
833
851
  extract_image(e) {
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
- return Q.__wbindgen_free(r[0], r[1] * 1, 1), i;
852
+ let t = K(e, Z.__wbindgen_malloc, Z.__wbindgen_realloc), n = X, r = Z.xlsxarchive_extract_image(this.__wbg_ptr, t, n);
853
+ if (r[3]) throw q(r[2]);
854
+ var i = z(r[0], r[1]).slice();
855
+ return Z.__wbindgen_free(r[0], r[1] * 1, 1), i;
838
856
  }
839
857
  constructor(e, t, n, r) {
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;
858
+ let i = G(e, Z.__wbindgen_malloc), a = X, o = Z.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);
859
+ if (o[2]) throw q(o[1]);
860
+ return this.__wbg_ptr = o[0] >>> 0, wt.register(this, this.__wbg_ptr, this), this;
843
861
  }
844
862
  open_sheet_cursor(e, t) {
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]);
863
+ let n = K(t, Z.__wbindgen_malloc, Z.__wbindgen_realloc), r = X, i = Z.xlsxarchive_open_sheet_cursor(this.__wbg_ptr, e, n, r);
864
+ if (i[1]) throw q(i[0]);
847
865
  }
848
866
  parse() {
849
- let e = Q.xlsxarchive_parse(this.__wbg_ptr);
850
- if (e[3]) throw J(e[2]);
851
- var t = B(e[0], e[1]).slice();
852
- return Q.__wbindgen_free(e[0], e[1] * 1, 1), t;
867
+ let e = Z.xlsxarchive_parse(this.__wbg_ptr);
868
+ if (e[3]) throw q(e[2]);
869
+ var t = z(e[0], e[1]).slice();
870
+ return Z.__wbindgen_free(e[0], e[1] * 1, 1), t;
853
871
  }
854
872
  pull_sheet_cursor(e) {
855
- let t = Q.xlsxarchive_pull_sheet_cursor(this.__wbg_ptr, e);
856
- if (t[3]) throw J(t[2]);
857
- var n = B(t[0], t[1]).slice();
858
- return Q.__wbindgen_free(t[0], t[1] * 1, 1), n;
873
+ let t = Z.xlsxarchive_pull_sheet_cursor(this.__wbg_ptr, e);
874
+ if (t[3]) throw q(t[2]);
875
+ var n = z(t[0], t[1]).slice();
876
+ return Z.__wbindgen_free(t[0], t[1] * 1, 1), n;
859
877
  }
860
878
  resource_usage() {
861
- let e = Q.xlsxarchive_resource_usage(this.__wbg_ptr);
862
- if (e[3]) throw J(e[2]);
863
- var t = B(e[0], e[1]).slice();
864
- return Q.__wbindgen_free(e[0], e[1] * 1, 1), t;
879
+ let e = Z.xlsxarchive_resource_usage(this.__wbg_ptr);
880
+ if (e[3]) throw q(e[2]);
881
+ var t = z(e[0], e[1]).slice();
882
+ return Z.__wbindgen_free(e[0], e[1] * 1, 1), t;
865
883
  }
866
884
  sheet_cursor_pull_finished() {
867
- return Q.xlsxarchive_sheet_cursor_pull_finished(this.__wbg_ptr) !== 0;
885
+ return Z.xlsxarchive_sheet_cursor_pull_finished(this.__wbg_ptr) !== 0;
868
886
  }
869
887
  sheet_cursor_resource_usage() {
870
- let e = Q.xlsxarchive_sheet_cursor_resource_usage(this.__wbg_ptr);
871
- if (e[3]) throw J(e[2]);
872
- var t = B(e[0], e[1]).slice();
873
- return Q.__wbindgen_free(e[0], e[1] * 1, 1), t;
888
+ let e = Z.xlsxarchive_sheet_cursor_resource_usage(this.__wbg_ptr);
889
+ if (e[3]) throw q(e[2]);
890
+ var t = z(e[0], e[1]).slice();
891
+ return Z.__wbindgen_free(e[0], e[1] * 1, 1), t;
874
892
  }
875
893
  to_markdown() {
876
894
  let e, t;
877
895
  try {
878
- let i = Q.xlsxarchive_to_markdown(this.__wbg_ptr);
896
+ let i = Z.xlsxarchive_to_markdown(this.__wbg_ptr);
879
897
  var n = i[0], r = i[1];
880
- if (i[3]) throw n = 0, r = 0, J(i[2]);
881
- return e = n, t = r, H(n, r);
898
+ if (i[3]) throw n = 0, r = 0, q(i[2]);
899
+ return e = n, t = r, V(n, r);
882
900
  } finally {
883
- Q.__wbindgen_free(e, t, 1);
901
+ Z.__wbindgen_free(e, t, 1);
884
902
  }
885
903
  }
886
904
  };
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
- return Q.__wbindgen_free(c[0], c[1] * 1, 1), l;
893
- }
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
- return Q.__wbindgen_free(a[0], a[1] * 1, 1), o;
899
- }
900
- function yt(e, t, n) {
905
+ Symbol.dispose && (R.prototype[Symbol.dispose] = R.prototype.free);
906
+ function bt(e, t, n, r) {
907
+ let i = G(e, Z.__wbindgen_malloc), a = X, o = K(t, Z.__wbindgen_malloc, Z.__wbindgen_realloc), s = X, c = Z.extract_image(i, a, o, s, !W(n), W(n) ? BigInt(0) : n, !W(r), W(r) ? BigInt(0) : r);
908
+ if (c[3]) throw q(c[2]);
909
+ var l = z(c[0], c[1]).slice();
910
+ return Z.__wbindgen_free(c[0], c[1] * 1, 1), l;
911
+ }
912
+ function xt(e, t, n) {
913
+ let r = G(e, Z.__wbindgen_malloc), i = X, a = Z.parse_xlsx(r, i, !W(t), W(t) ? BigInt(0) : t, !W(n), W(n) ? BigInt(0) : n);
914
+ if (a[3]) throw q(a[2]);
915
+ var o = z(a[0], a[1]).slice();
916
+ return Z.__wbindgen_free(a[0], a[1] * 1, 1), o;
917
+ }
918
+ function St(e, t, n) {
901
919
  let r, i;
902
920
  try {
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);
921
+ let s = G(e, Z.__wbindgen_malloc), c = X, l = Z.xlsx_to_markdown(s, c, !W(t), W(t) ? BigInt(0) : t, !W(n), W(n) ? BigInt(0) : n);
904
922
  var a = l[0], o = l[1];
905
- if (l[3]) throw a = 0, o = 0, J(l[2]);
906
- return r = a, i = o, H(a, o);
923
+ if (l[3]) throw a = 0, o = 0, q(l[2]);
924
+ return r = a, i = o, V(a, o);
907
925
  } finally {
908
- Q.__wbindgen_free(r, i, 1);
926
+ Z.__wbindgen_free(r, i, 1);
909
927
  }
910
928
  }
911
- function bt() {
929
+ function Ct() {
912
930
  return {
913
931
  __proto__: null,
914
932
  "./xlsx_parser_bg.js": {
915
933
  __proto__: null,
916
934
  __wbg___wbindgen_throw_6b64449b9b9ed33c: function(e, t) {
917
- throw Error(H(e, t));
935
+ throw Error(V(e, t));
918
936
  },
919
937
  __wbg_error_a6fa202b58aa1cd3: function(e, t) {
920
938
  let n, r;
921
939
  try {
922
- n = e, r = t, console.error(H(e, t));
940
+ n = e, r = t, console.error(V(e, t));
923
941
  } finally {
924
- Q.__wbindgen_free(n, r, 1);
942
+ Z.__wbindgen_free(n, r, 1);
925
943
  }
926
944
  },
927
945
  __wbg_new_227d7c05414eb861: function() {
928
946
  return /* @__PURE__ */ Error();
929
947
  },
930
948
  __wbg_stack_3b0d974bbf31e44f: function(e, t) {
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);
949
+ let n = t.stack, r = K(n, Z.__wbindgen_malloc, Z.__wbindgen_realloc), i = X;
950
+ Tt().setInt32(e + 4, i, !0), Tt().setInt32(e + 0, r, !0);
933
951
  },
934
952
  __wbindgen_cast_0000000000000001: function(e, t) {
935
- return H(e, t);
953
+ return V(e, t);
936
954
  },
937
955
  __wbindgen_init_externref_table: function() {
938
- let e = Q.__wbindgen_externrefs, t = e.grow(4);
956
+ let e = Z.__wbindgen_externrefs, t = e.grow(4);
939
957
  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);
940
958
  }
941
959
  }
942
960
  };
943
961
  }
944
- var xt = typeof FinalizationRegistry > "u" ? {
962
+ var wt = typeof FinalizationRegistry > "u" ? {
945
963
  register: () => {},
946
964
  unregister: () => {}
947
- } : new FinalizationRegistry((e) => Q.__wbg_xlsxarchive_free(e >>> 0, 1));
948
- function B(e, t) {
949
- return e >>>= 0, W().subarray(e / 1, e / 1 + t);
965
+ } : new FinalizationRegistry((e) => Z.__wbg_xlsxarchive_free(e >>> 0, 1));
966
+ function z(e, t) {
967
+ return e >>>= 0, U().subarray(e / 1, e / 1 + t);
950
968
  }
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;
969
+ var B = null;
970
+ function Tt() {
971
+ return (B === null || B.buffer.detached === !0 || B.buffer.detached === void 0 && B.buffer !== Z.memory.buffer) && (B = new DataView(Z.memory.buffer)), B;
954
972
  }
955
- function H(e, t) {
956
- return e >>>= 0, Tt(e, t);
973
+ function V(e, t) {
974
+ return e >>>= 0, Ot(e, t);
957
975
  }
958
- var U = null;
959
- function W() {
960
- return (U === null || U.byteLength === 0) && (U = new Uint8Array(Q.memory.buffer)), U;
976
+ var H = null;
977
+ function U() {
978
+ return (H === null || H.byteLength === 0) && (H = new Uint8Array(Z.memory.buffer)), H;
961
979
  }
962
- function G(e) {
980
+ function W(e) {
963
981
  return e == null;
964
982
  }
965
- function K(e, t) {
983
+ function G(e, t) {
966
984
  let n = t(e.length * 1, 1) >>> 0;
967
- return W().set(e, n / 1), Z = e.length, n;
985
+ return U().set(e, n / 1), X = e.length, n;
968
986
  }
969
- function q(e, t, n) {
987
+ function K(e, t, n) {
970
988
  if (n === void 0) {
971
- let n = X.encode(e), r = t(n.length, 1) >>> 0;
972
- return W().subarray(r, r + n.length).set(n), Z = n.length, r;
989
+ let n = Y.encode(e), r = t(n.length, 1) >>> 0;
990
+ return U().subarray(r, r + n.length).set(n), X = n.length, r;
973
991
  }
974
- let r = e.length, i = t(r, 1) >>> 0, a = W(), o = 0;
992
+ let r = e.length, i = t(r, 1) >>> 0, a = U(), o = 0;
975
993
  for (; o < r; o++) {
976
994
  let t = e.charCodeAt(o);
977
995
  if (t > 127) break;
@@ -979,40 +997,40 @@ function q(e, t, n) {
979
997
  }
980
998
  if (o !== r) {
981
999
  o !== 0 && (e = e.slice(o)), i = n(i, r, r = o + e.length * 3, 1) >>> 0;
982
- let t = W().subarray(i + o, i + r), a = X.encodeInto(e, t);
1000
+ let t = U().subarray(i + o, i + r), a = Y.encodeInto(e, t);
983
1001
  o += a.written, i = n(i, r, o, 1) >>> 0;
984
1002
  }
985
- return Z = o, i;
1003
+ return X = o, i;
986
1004
  }
987
- function J(e) {
988
- let t = Q.__wbindgen_externrefs.get(e);
989
- return Q.__externref_table_dealloc(e), t;
1005
+ function q(e) {
1006
+ let t = Z.__wbindgen_externrefs.get(e);
1007
+ return Z.__externref_table_dealloc(e), t;
990
1008
  }
991
- var Y = new TextDecoder("utf-8", {
1009
+ var J = new TextDecoder("utf-8", {
992
1010
  ignoreBOM: !0,
993
1011
  fatal: !0
994
1012
  });
995
- Y.decode();
996
- var Ct = 2146435072, wt = 0;
997
- function Tt(e, t) {
998
- return wt += t, wt >= Ct && (Y = new TextDecoder("utf-8", {
1013
+ J.decode();
1014
+ var Et = 2146435072, Dt = 0;
1015
+ function Ot(e, t) {
1016
+ return Dt += t, Dt >= Et && (J = new TextDecoder("utf-8", {
999
1017
  ignoreBOM: !0,
1000
1018
  fatal: !0
1001
- }), Y.decode(), wt = t), Y.decode(W().subarray(e, e + t));
1019
+ }), J.decode(), Dt = t), J.decode(U().subarray(e, e + t));
1002
1020
  }
1003
- var X = new TextEncoder();
1004
- "encodeInto" in X || (X.encodeInto = function(e, t) {
1005
- let n = X.encode(e);
1021
+ var Y = new TextEncoder();
1022
+ "encodeInto" in Y || (Y.encodeInto = function(e, t) {
1023
+ let n = Y.encode(e);
1006
1024
  return t.set(n), {
1007
1025
  read: e.length,
1008
1026
  written: n.length
1009
1027
  };
1010
1028
  });
1011
- var Z = 0, Q;
1012
- function Et(e, t) {
1013
- return Q = e.exports, V = null, U = null, Q.__wbindgen_start(), Q;
1029
+ var X = 0, Z;
1030
+ function kt(e, t) {
1031
+ return Z = e.exports, B = null, H = null, Z.__wbindgen_start(), Z;
1014
1032
  }
1015
- async function Dt(e, t) {
1033
+ async function At(e, t) {
1016
1034
  if (typeof Response == "function" && e instanceof Response) {
1017
1035
  if (typeof WebAssembly.instantiateStreaming == "function") try {
1018
1036
  return await WebAssembly.instantiateStreaming(e, t);
@@ -1038,52 +1056,52 @@ async function Dt(e, t) {
1038
1056
  return !1;
1039
1057
  }
1040
1058
  }
1041
- function Ot(e) {
1042
- if (Q !== void 0) return Q;
1059
+ function jt(e) {
1060
+ if (Z !== void 0) return Z;
1043
1061
  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 = bt();
1045
- return e instanceof WebAssembly.Module || (e = new WebAssembly.Module(e)), Et(new WebAssembly.Instance(e, t), e);
1062
+ let t = Ct();
1063
+ return e instanceof WebAssembly.Module || (e = new WebAssembly.Module(e)), kt(new WebAssembly.Instance(e, t), e);
1046
1064
  }
1047
- async function kt(e) {
1048
- if (Q !== void 0) return Q;
1065
+ async function Mt(e) {
1066
+ if (Z !== void 0) return Z;
1049
1067
  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 = bt();
1068
+ let t = Ct();
1051
1069
  (typeof e == "string" || typeof Request == "function" && e instanceof Request || typeof URL == "function" && e instanceof URL) && (e = fetch(e));
1052
- let { instance: n, module: r } = await Dt(await e, t);
1053
- return Et(n, r);
1070
+ let { instance: n, module: r } = await At(await e, t);
1071
+ return kt(n, r);
1054
1072
  }
1055
- async function At(e) {
1056
- return Q = void 0, V = null, U = null, kt(e);
1073
+ async function Nt(e) {
1074
+ return Z = void 0, B = null, H = null, Mt(e);
1057
1075
  }
1058
1076
  //#endregion
1059
1077
  //#region packages/xlsx/src/internal/node-acquisition.ts
1060
- var jt, Mt;
1061
- function Nt(e) {
1062
- if (!Mt) jt = e, Mt = new Ce(gt, e);
1063
- else if (jt !== e) throw Error("XLSX runtime was already initialized with another WebAssembly.Module");
1064
- return Mt;
1065
- }
1066
- async function Pt(e, t, r = {}) {
1067
- let i = n(r), s = new f({
1068
- enabled: i.debug || i.onResourceMetrics !== void 0,
1078
+ var Pt, Q;
1079
+ function Ft(e) {
1080
+ if (!Q) Pt = e, Q = new Se(yt, e);
1081
+ else if (Pt !== e) throw Error("XLSX runtime was already initialized with another WebAssembly.Module");
1082
+ return Q;
1083
+ }
1084
+ async function It(e, t, r = {}) {
1085
+ let a = n(r), s = new u({
1086
+ enabled: a.debug || a.onResourceMetrics !== void 0,
1069
1087
  format: "xlsx",
1070
1088
  mode: "node",
1071
1089
  scope: "session",
1072
- policy: i.policy,
1073
- onMetrics: i.onResourceMetrics,
1074
- emitToConsole: i.debug
1090
+ policy: a.policy,
1091
+ onMetrics: a.onResourceMetrics,
1092
+ emitToConsole: a.debug
1075
1093
  });
1076
1094
  s.setSourceBytes(e.byteLength);
1077
1095
  let c;
1078
1096
  try {
1079
- It(r.signal);
1080
- let [n, a, l] = o(i.policy), u = z;
1081
- c = await Nt(t).open(() => new u(e, n, a, l), {
1097
+ Lt(r.signal);
1098
+ let [n, i, l] = o(a.policy), u = R;
1099
+ c = await Ft(t).open(() => new u(e, n, i, l), {
1082
1100
  signal: r.signal,
1083
- abortError: Lt,
1101
+ abortError: Rt,
1084
1102
  disposeOnAbort: (e) => e.free()
1085
- }), It(r.signal);
1086
- let d = c.proxy, f = JSON.parse(new TextDecoder().decode(d.parse())), p = Ft(d.resource_usage());
1103
+ }), Lt(r.signal);
1104
+ let d = c.proxy, { workbook: f, usage: p } = vt(() => JSON.parse(new TextDecoder().decode(d.parse())), () => d.resource_usage());
1087
1105
  return s.observeUsage(p), s.checkpoint("workbook index ready"), {
1088
1106
  archive: d,
1089
1107
  workbookIndex: f,
@@ -1095,33 +1113,25 @@ async function Pt(e, t, r = {}) {
1095
1113
  try {
1096
1114
  c?.close((e) => e.free());
1097
1115
  } catch {}
1098
- let t = a(e) ?? e;
1116
+ let t = i(e) ?? e;
1099
1117
  throw s.fail(t), t;
1100
1118
  }
1101
1119
  }
1102
- function Ft(e) {
1103
- try {
1104
- return p(e);
1105
- } catch (e) {
1106
- if (String(e).includes("worksheet cursor usage is unavailable")) return;
1107
- throw e;
1108
- }
1120
+ function Lt(e) {
1121
+ if (e?.aborted) throw Rt();
1109
1122
  }
1110
- function It(e) {
1111
- if (e?.aborted) throw Lt();
1112
- }
1113
- function Lt() {
1123
+ function Rt() {
1114
1124
  let e = /* @__PURE__ */ Error("XLSX workbook session was aborted");
1115
1125
  return e.name = "AbortError", e;
1116
1126
  }
1117
1127
  //#endregion
1118
1128
  //#region packages/node/src/xlsx.ts
1119
- var Rt = y(() => b(import.meta.url, "xlsx_parser_bg.wasm", "@silurus/ooxml-xlsx/wasm-binary"));
1129
+ var zt = b(() => x(import.meta.url, "xlsx_parser_bg.wasm", "@silurus/ooxml-xlsx/wasm-binary"));
1120
1130
  async function $(e, t = {}) {
1121
- let n = await Pt(Kt(e), Rt(), t);
1122
- return new zt(n.closeArchive, n.archive, n.workbookIndex, n.metrics, n.usage, t.signal);
1131
+ let n = await It(qt(e), zt(), t);
1132
+ return new Bt(n.closeArchive, n.archive, n.workbookIndex, n.metrics, n.usage, t.signal);
1123
1133
  }
1124
- var zt = class {
1134
+ var Bt = class {
1125
1135
  workbookIndex;
1126
1136
  sheetCount;
1127
1137
  sheetNames;
@@ -1136,7 +1146,7 @@ var zt = class {
1136
1146
  rowBatches = 0;
1137
1147
  emittedRows = 0;
1138
1148
  constructor(e, t, n, r, i, a) {
1139
- this.closeArchive = e, this.archive = t, this.metrics = r, this.signal = a, this.workbookIndex = Wt(n), this.sheetNames = Object.freeze(this.workbookIndex.workbook.sheets.map((e) => e.name)), this.sheetCount = this.sheetNames.length, this.lastUsage = i, this.pull = new ge(() => this.archive), this.transport = new v((e, t) => this.pull.dispatchSafely(e, t), () => void 0), this.worksheetPullClient = new ve({
1149
+ this.closeArchive = e, this.archive = t, this.metrics = r, this.signal = a, this.workbookIndex = Gt(n), this.sheetNames = Object.freeze(this.workbookIndex.workbook.sheets.map((e) => e.name)), this.sheetCount = this.sheetNames.length, this.lastUsage = i, this.pull = new he(() => this.archive), this.transport = new y((e, t) => this.pull.dispatchSafely(e, t), () => void 0), this.worksheetPullClient = new _e({
1140
1150
  transport: this.transport,
1141
1151
  sharedStrings: n.sharedStrings,
1142
1152
  open: async (e, t, n) => {
@@ -1150,7 +1160,7 @@ var zt = class {
1150
1160
  get resourceUsage() {
1151
1161
  if (this.closed) return this.lastUsage;
1152
1162
  try {
1153
- this.lastUsage = Gt(this.archive.resource_usage());
1163
+ this.lastUsage = Kt(this.archive.resource_usage());
1154
1164
  } catch {}
1155
1165
  return this.lastUsage;
1156
1166
  }
@@ -1184,13 +1194,13 @@ var zt = class {
1184
1194
  }
1185
1195
  this.completedWorksheets += 1, this.metrics.checkpoint("worksheet stream complete", this.lastUsage);
1186
1196
  } catch (e) {
1187
- throw r = a(e) ?? e, this.metrics.fail(r), await this.close().catch(() => void 0), r;
1197
+ throw r = i(e) ?? e, this.metrics.fail(r), await this.close().catch(() => void 0), r;
1188
1198
  } finally {
1189
1199
  try {
1190
1200
  await this.cleanupOperation(n, r === void 0 ? "closed" : "request-error");
1191
1201
  } catch (e) {
1192
1202
  if (r === void 0) {
1193
- let t = a(e) ?? e;
1203
+ let t = i(e) ?? e;
1194
1204
  throw this.metrics.fail(t), await this.close().catch(() => void 0), t;
1195
1205
  }
1196
1206
  }
@@ -1205,12 +1215,12 @@ var zt = class {
1205
1215
  try {
1206
1216
  await this.worksheetPullClient.cancelAll(t);
1207
1217
  } catch (e) {
1208
- n = a(e) ?? e;
1218
+ n = i(e) ?? e;
1209
1219
  }
1210
1220
  try {
1211
1221
  await this.pull.reset();
1212
1222
  } catch (e) {
1213
- n ??= a(e) ?? e;
1223
+ n ??= i(e) ?? e;
1214
1224
  }
1215
1225
  if (this.active === e && (this.active = void 0), n !== void 0) throw n;
1216
1226
  })(), e.cleanupPromise;
@@ -1220,13 +1230,13 @@ var zt = class {
1220
1230
  if (this.active) try {
1221
1231
  await this.cleanupOperation(this.active, "closed");
1222
1232
  } catch (t) {
1223
- e = a(t) ?? t;
1233
+ e = i(t) ?? t;
1224
1234
  }
1225
1235
  this.transport.terminate();
1226
1236
  try {
1227
1237
  this.closeArchive();
1228
1238
  } catch (t) {
1229
- e ??= a(t) ?? t;
1239
+ e ??= i(t) ?? t;
1230
1240
  }
1231
1241
  if (e !== void 0) throw this.metrics.fail(e), e;
1232
1242
  this.metrics.checkpoint("workbook session closed", this.lastUsage), this.metrics.succeed({
@@ -1241,14 +1251,14 @@ var zt = class {
1241
1251
  return t.name;
1242
1252
  }
1243
1253
  };
1244
- async function Bt(e, t = {}) {
1245
- return _(() => $(e, t), async (e) => structuredClone(e.workbookIndex));
1254
+ async function Vt(e, t = {}) {
1255
+ return v(() => $(e, t), async (e) => structuredClone(e.workbookIndex));
1246
1256
  }
1247
- async function Vt(e, t, n = {}) {
1248
- return _(() => $(e, n), async (e) => (await Ut(e, t)).worksheet);
1257
+ async function Ht(e, t, n = {}) {
1258
+ return v(() => $(e, n), async (e) => (await Wt(e, t)).worksheet);
1249
1259
  }
1250
- async function Ht(e, t = {}) {
1251
- return _(() => $(e, t), async (e) => {
1260
+ async function Ut(e, t = {}) {
1261
+ return v(() => $(e, t), async (e) => {
1252
1262
  let t = [], n = {
1253
1263
  rows: 0,
1254
1264
  cells: 0,
@@ -1256,8 +1266,8 @@ async function Ht(e, t = {}) {
1256
1266
  jsonBytes: 0
1257
1267
  };
1258
1268
  for (let r = 0; r < e.sheetCount; r += 1) {
1259
- let i = await Ut(e, r), a = de(n, i.usage);
1260
- _e(a, "materialize-workbook", void 0, i.resourceUsage), n = a, t.push(i.worksheet);
1269
+ let i = await Wt(e, r), a = ue(n, i.usage);
1270
+ ge(a, "materialize-workbook", void 0, i.resourceUsage), n = a, t.push(i.worksheet);
1261
1271
  }
1262
1272
  return {
1263
1273
  workbookIndex: structuredClone(e.workbookIndex),
@@ -1265,23 +1275,23 @@ async function Ht(e, t = {}) {
1265
1275
  };
1266
1276
  });
1267
1277
  }
1268
- async function Ut(e, t) {
1278
+ async function Wt(e, t) {
1269
1279
  let n = [], r = {
1270
1280
  rows: 0,
1271
1281
  cells: 0,
1272
1282
  ownedUtf8Bytes: 0
1273
1283
  }, i, a, o;
1274
1284
  for await (let s of e.worksheetRows(t)) if (o = s.usage ?? o, s.kind === "rows") {
1275
- let e = he(r, pe(s.rows));
1276
- me(e, "materialize-worksheet", void 0, o), n.push(...s.rows), r = e;
1285
+ let e = me(r, fe(s.rows));
1286
+ pe(e, "materialize-worksheet", void 0, o), n.push(...s.rows), r = e;
1277
1287
  } else {
1278
1288
  a = s.worksheet, a.rows = a.parseError ? [] : n;
1279
- let e = ye(a, a.parseError ? {
1289
+ let e = ve(a, a.parseError ? {
1280
1290
  rows: 0,
1281
1291
  cells: 0,
1282
1292
  ownedUtf8Bytes: 0
1283
1293
  } : r);
1284
- me(e, "materialize-worksheet", void 0, o), fe(e.jsonBytes, "materialize-worksheet", void 0, o), r = e, i = e;
1294
+ pe(e, "materialize-worksheet", void 0, o), de(e.jsonBytes, "materialize-worksheet", void 0, o), r = e, i = e;
1285
1295
  }
1286
1296
  if (!a || !i) throw Error(`XLSX worksheet ${t} did not produce a terminal model`);
1287
1297
  return {
@@ -1290,24 +1300,24 @@ async function Ut(e, t) {
1290
1300
  resourceUsage: o
1291
1301
  };
1292
1302
  }
1293
- function Wt(e, t = /* @__PURE__ */ new WeakSet()) {
1303
+ function Gt(e, t = /* @__PURE__ */ new WeakSet()) {
1294
1304
  if (typeof e != "object" || !e) return e;
1295
1305
  let n = e;
1296
1306
  if (t.has(n)) return e;
1297
1307
  t.add(n);
1298
- for (let e of Object.values(n)) Wt(e, t);
1308
+ for (let e of Object.values(n)) Gt(e, t);
1299
1309
  return Object.freeze(e);
1300
1310
  }
1301
- function Gt(e) {
1311
+ function Kt(e) {
1302
1312
  try {
1303
- return p(e);
1313
+ return d(e);
1304
1314
  } catch (e) {
1305
1315
  if (String(e).includes("worksheet cursor usage is unavailable")) return;
1306
1316
  throw e;
1307
1317
  }
1308
1318
  }
1309
- function Kt(e) {
1319
+ function qt(e) {
1310
1320
  return e instanceof Uint8Array ? e : new Uint8Array(e);
1311
1321
  }
1312
1322
  //#endregion
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 };
1323
+ export { ce as OoxmlDecodedImageLimitError, g as OoxmlResourceLimitError, Ee as installImageBitmapShim, we as installOffscreenCanvasShim, se as isOoxmlDecodedImageLimitError, ft as materializeDocxDocument, ze as materializePptxPresentation, Ut as materializeXlsxWorkbook, Vt as materializeXlsxWorkbookIndex, Ht as materializeXlsxWorksheet, dt as openDocxDocument, Ie as openPptxPresentation, $ as openXlsxWorkbook, Te as renderSlideNode };