@silurus/ooxml 0.84.0 → 0.85.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 (68) hide show
  1. package/README.md +36 -13
  2. package/dist/assets/render-worker-BRKOyWVH.js +24 -0
  3. package/dist/assets/render-worker-DnU-PxZ1.js +10 -0
  4. package/dist/assets/render-worker-NZPOUOTU.js +11 -0
  5. package/dist/{canvas-viewer-mechanics-CIfhCgYA.js → canvas-viewer-mechanics-C-yTGbFC.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-DeHUdQhH.js → document-pull-client-BdYrjAep.js} +4679 -4359
  12. package/dist/{docx-CbU51aPR.js → docx-qK0Qmyey.js} +315 -300
  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-DxZwhOWr.js} +250 -221
  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-BWdhjVH_.js → render-worker-host-CHlwYJdK.js} +1 -1
  30. package/dist/{render-worker-host-CZi7Mn5v.js → render-worker-host-GZ7ez-l3.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 +29 -13
  41. package/dist/types/index.d.ts +43 -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 +34 -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-57OZsbD9.js} +1395 -1196
  51. package/dist/xlsx.mjs +7 -6
  52. package/package.json +2 -2
  53. package/dist/assets/render-worker-BZd4-U4w.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
@@ -1,6 +1,7 @@
1
- import { Zt as e } from "./line-metrics-CXyjyYd5.js";
1
+ import { Et as e, on as t } from "./line-metrics-u87yCAfV.js";
2
+ import { i as n, r, s as i } from "./pixel-budget-Dgjw269h.js";
2
3
  //#region packages/core/src/errors/cfb-sniff.ts
3
- var t = [
4
+ var a = [
4
5
  208,
5
6
  207,
6
7
  17,
@@ -9,44 +10,44 @@ var t = [
9
10
  177,
10
11
  26,
11
12
  225
12
- ], n = 4294967290, r = 512, i = 128, a = 4096, o = 8192, s = new Set([
13
+ ], o = 4294967290, s = 512, c = 128, l = 4096, u = 8192, d = new Set([
13
14
  "WordDocument",
14
15
  "Workbook",
15
16
  "Book",
16
17
  "PowerPoint Document"
17
- ]), c = "EncryptionInfo";
18
- function l(e) {
19
- if (e.length < r) return null;
20
- for (let n = 0; n < t.length; n++) if (e[n] !== t[n]) return null;
21
- let n = new DataView(e.buffer, e.byteOffset, e.byteLength), i = n.getUint16(30, !0);
22
- if (i !== 9 && i !== 12) return "cfb-unknown";
23
- let a = 1 << i, o = n.getUint32(48, !0), l = u(n, e.length, a, o);
24
- if (l === null) return "cfb-unknown";
25
- if (l.has(c)) return "encrypted";
26
- for (let e of l) if (s.has(e)) return "legacy-binary-format";
18
+ ]), f = "EncryptionInfo";
19
+ function p(e) {
20
+ if (e.length < s) return null;
21
+ for (let t = 0; t < a.length; t++) if (e[t] !== a[t]) return null;
22
+ let t = new DataView(e.buffer, e.byteOffset, e.byteLength), n = t.getUint16(30, !0);
23
+ if (n !== 9 && n !== 12) return "cfb-unknown";
24
+ let r = 1 << n, i = t.getUint32(48, !0), o = m(t, e.length, r, i);
25
+ if (o === null) return "cfb-unknown";
26
+ if (o.has(f)) return "encrypted";
27
+ for (let e of o) if (d.has(e)) return "legacy-binary-format";
27
28
  return "cfb-unknown";
28
29
  }
29
- function u(e, t, n, r) {
30
- if (!m(r)) return null;
31
- let s = /* @__PURE__ */ new Set(), c = Math.floor(n / i);
32
- if (c < 1) return null;
33
- let l = /* @__PURE__ */ new Set(), u = r, h = 0, g = 0;
34
- for (; m(u) && !(h++ > o || l.has(u));) {
35
- l.add(u);
36
- let r = p(u, n);
30
+ function m(e, t, n, r) {
31
+ if (!v(r)) return null;
32
+ let i = /* @__PURE__ */ new Set(), a = Math.floor(n / c);
33
+ if (a < 1) return null;
34
+ let o = /* @__PURE__ */ new Set(), s = r, d = 0, f = 0;
35
+ for (; v(s) && !(d++ > u || o.has(s));) {
36
+ o.add(s);
37
+ let r = _(s, n);
37
38
  if (r < 0 || r + n > t) return null;
38
- for (let t = 0; t < c; t++) {
39
- if (g++ > a) return s;
40
- let n = d(e, r + t * i);
41
- n && s.add(n);
39
+ for (let t = 0; t < a; t++) {
40
+ if (f++ > l) return i;
41
+ let n = h(e, r + t * c);
42
+ n && i.add(n);
42
43
  }
43
- let o = f(e, t, n, u);
44
- if (o === null) break;
45
- u = o;
44
+ let u = g(e, t, n, s);
45
+ if (u === null) break;
46
+ s = u;
46
47
  }
47
- return s;
48
+ return i;
48
49
  }
49
- function d(e, t) {
50
+ function h(e, t) {
50
51
  let n = e.getUint16(t + 64, !0);
51
52
  if (n < 2 || n > 64) return "";
52
53
  let r = n / 2 - 1, i = "";
@@ -57,7 +58,7 @@ function d(e, t) {
57
58
  }
58
59
  return i;
59
60
  }
60
- function f(e, t, n, r) {
61
+ function g(e, t, n, r) {
61
62
  let i = Math.floor(n / 4);
62
63
  if (i < 1) return null;
63
64
  let a = Math.floor(r / i), o = r % i;
@@ -65,19 +66,19 @@ function f(e, t, n, r) {
65
66
  let s = 76 + a * 4;
66
67
  if (s + 4 > t) return null;
67
68
  let c = e.getUint32(s, !0);
68
- if (!m(c)) return null;
69
- let l = p(c, n), u = l + o * 4;
69
+ if (!v(c)) return null;
70
+ let l = _(c, n), u = l + o * 4;
70
71
  return l < 0 || u + 4 > t ? null : e.getUint32(u, !0);
71
72
  }
72
- function p(e, t) {
73
+ function _(e, t) {
73
74
  return (e + 1) * t;
74
75
  }
75
- function m(e) {
76
- return e >= 0 && e <= n;
76
+ function v(e) {
77
+ return e >= 0 && e <= o;
77
78
  }
78
79
  //#endregion
79
80
  //#region packages/core/src/errors/cfb-read.ts
80
- var h = [
81
+ var y = [
81
82
  208,
82
83
  207,
83
84
  17,
@@ -86,20 +87,20 @@ var h = [
86
87
  177,
87
88
  26,
88
89
  225
89
- ], g = 4294967290, _ = 4294967294, ee = 512, v = 128, y = 4e6, te = 8e6, b = 65536, ne = 1e6;
90
- function x(e, t) {
91
- if (e.length < ee) return null;
92
- for (let t = 0; t < h.length; t++) if (e[t] !== h[t]) return null;
93
- let n = new DataView(e.buffer, e.byteOffset, e.byteLength), r = re(n);
90
+ ], ee = 4294967290, b = 4294967294, te = 512, x = 128, S = 4e6, ne = 8e6, re = 65536, ie = 1e6;
91
+ function C(e, t) {
92
+ if (e.length < te) return null;
93
+ for (let t = 0; t < y.length; t++) if (e[t] !== y[t]) return null;
94
+ let n = new DataView(e.buffer, e.byteOffset, e.byteLength), r = ae(n);
94
95
  if (r === null) return null;
95
- let i = w(n, e.length, r);
96
+ let i = oe(n, e.length, r);
96
97
  if (i === null) return null;
97
- let a = ie(n, e.length, r, i, t);
98
+ let a = se(n, e.length, r, i, t);
98
99
  if (a === null || a.target === null) return null;
99
100
  let { target: o, root: s } = a;
100
- return o.size === 0 ? new Uint8Array() : o.size < r.miniStreamCutoff ? s === null ? null : oe(n, e.length, r, i, s, o) : E(n, e.length, r, i, o.startSector, o.size);
101
+ return o.size === 0 ? new Uint8Array() : o.size < r.miniStreamCutoff ? s === null ? null : le(n, e.length, r, i, s, o) : D(n, e.length, r, i, o.startSector, o.size);
101
102
  }
102
- function re(e) {
103
+ function ae(e) {
103
104
  let t = e.getUint16(30, !0);
104
105
  if (t !== 9 && t !== 12) return null;
105
106
  let n = e.getUint16(32, !0);
@@ -113,57 +114,57 @@ function re(e) {
113
114
  numDifatSectors: e.getUint32(72, !0)
114
115
  } : null;
115
116
  }
116
- function S(e, t) {
117
+ function w(e, t) {
117
118
  return (e + 1) * t;
118
119
  }
119
- function C(e) {
120
- return e >= 0 && e <= g;
120
+ function T(e) {
121
+ return e >= 0 && e <= ee;
121
122
  }
122
- function w(e, t, n) {
123
+ function oe(e, t, n) {
123
124
  let { sectorSize: r } = n, i = [];
124
125
  for (let t = 0; t < 109; t++) {
125
126
  let n = e.getUint32(76 + t * 4, !0);
126
- C(n) && i.push(n);
127
+ T(n) && i.push(n);
127
128
  }
128
129
  let a = r / 4 - 1, o = n.firstDifatSector, s = /* @__PURE__ */ new Set(), c = 0;
129
- for (; C(o);) {
130
- if (c++ > ne) return null;
130
+ for (; T(o);) {
131
+ if (c++ > ie) return null;
131
132
  if (s.has(o)) break;
132
133
  s.add(o);
133
- let n = S(o, r);
134
+ let n = w(o, r);
134
135
  if (n < 0 || n + r > t) return null;
135
136
  for (let t = 0; t < a; t++) {
136
137
  let r = e.getUint32(n + t * 4, !0);
137
- C(r) && i.push(r);
138
+ T(r) && i.push(r);
138
139
  }
139
140
  o = e.getUint32(n + a * 4, !0);
140
141
  }
141
142
  return i;
142
143
  }
143
- function T(e, t, n, r, i) {
144
+ function E(e, t, n, r, i) {
144
145
  let a = n / 4, o = Math.floor(i / a), s = i % a;
145
146
  if (o >= r.length) return null;
146
147
  let c = r[o];
147
- if (!C(c)) return null;
148
- let l = S(c, n) + s * 4;
148
+ if (!T(c)) return null;
149
+ let l = w(c, n) + s * 4;
149
150
  return l < 0 || l + 4 > t ? null : e.getUint32(l, !0);
150
151
  }
151
- function ie(e, t, n, r, i) {
152
- let { sectorSize: a } = n, o = Math.floor(a / v);
152
+ function se(e, t, n, r, i) {
153
+ let { sectorSize: a } = n, o = Math.floor(a / x);
153
154
  if (o < 1) return null;
154
155
  let s = null, c = null, l = /* @__PURE__ */ new Set(), u = n.firstDirSector, d = 0, f = 0;
155
- for (; C(u);) {
156
- if (d++ > y) return null;
156
+ for (; T(u);) {
157
+ if (d++ > S) return null;
157
158
  if (l.has(u)) break;
158
159
  l.add(u);
159
- let n = S(u, a);
160
+ let n = w(u, a);
160
161
  if (n < 0 || n + a > t) return null;
161
162
  for (let t = 0; t < o; t++) {
162
- if (f++ > b) return {
163
+ if (f++ > re) return {
163
164
  target: s,
164
165
  root: c
165
166
  };
166
- let r = n + t * v, a = e.getUint8(r + 66);
167
+ let r = n + t * x, a = e.getUint8(r + 66);
167
168
  if (a === 0) continue;
168
169
  let o = e.getUint32(r + 116, !0), l = e.getUint32(r + 120, !0);
169
170
  if (a === 5) {
@@ -173,12 +174,12 @@ function ie(e, t, n, r, i) {
173
174
  };
174
175
  continue;
175
176
  }
176
- ae(e, r) === i && (s = {
177
+ ce(e, r) === i && (s = {
177
178
  startSector: o,
178
179
  size: l
179
180
  });
180
181
  }
181
- let p = T(e, t, a, r, u);
182
+ let p = E(e, t, a, r, u);
182
183
  if (p === null) break;
183
184
  u = p;
184
185
  }
@@ -187,7 +188,7 @@ function ie(e, t, n, r, i) {
187
188
  root: c
188
189
  };
189
190
  }
190
- function ae(e, t) {
191
+ function ce(e, t) {
191
192
  let n = e.getUint16(t + 64, !0);
192
193
  if (n < 2 || n > 64) return "";
193
194
  let r = n / 2 - 1, i = "";
@@ -198,56 +199,56 @@ function ae(e, t) {
198
199
  }
199
200
  return i;
200
201
  }
201
- function E(e, t, n, r, i, a) {
202
+ function D(e, t, n, r, i, a) {
202
203
  let { sectorSize: o } = n, s = new Uint8Array(a), c = 0, l = i, u = /* @__PURE__ */ new Set(), d = 0;
203
- for (; C(l) && c < a;) {
204
- if (d++ > y || u.has(l)) return null;
204
+ for (; T(l) && c < a;) {
205
+ if (d++ > S || u.has(l)) return null;
205
206
  u.add(l);
206
- let n = S(l, o);
207
+ let n = w(l, o);
207
208
  if (n < 0 || n + o > t) return null;
208
209
  let i = Math.min(o, a - c);
209
210
  s.set(new Uint8Array(e.buffer, e.byteOffset + n, i), c), c += i;
210
- let f = T(e, t, o, r, l);
211
+ let f = E(e, t, o, r, l);
211
212
  if (f === null) return null;
212
213
  l = f;
213
214
  }
214
215
  return c === a ? s : null;
215
216
  }
216
- function oe(e, t, n, r, i, a) {
217
- let { sectorSize: o, miniSectorSize: s } = n, c = E(e, t, n, r, i.startSector, i.size);
217
+ function le(e, t, n, r, i, a) {
218
+ let { sectorSize: o, miniSectorSize: s } = n, c = D(e, t, n, r, i.startSector, i.size);
218
219
  if (c === null) return null;
219
220
  let l = new Uint8Array(a.size), u = 0, d = a.startSector, f = /* @__PURE__ */ new Set(), p = 0, m = o / 4;
220
- for (; C(d) && u < a.size;) {
221
- if (p++ > te || f.has(d)) return null;
221
+ for (; T(d) && u < a.size;) {
222
+ if (p++ > ne || f.has(d)) return null;
222
223
  f.add(d);
223
224
  let i = d * s;
224
225
  if (i < 0 || i + s > c.length) return null;
225
226
  let o = Math.min(s, a.size - u);
226
227
  l.set(c.subarray(i, i + o), u), u += o;
227
- let h = se(e, t, n, r, m, d);
228
+ let h = ue(e, t, n, r, m, d);
228
229
  if (h === null) return null;
229
230
  d = h;
230
231
  }
231
232
  return u === a.size ? l : null;
232
233
  }
233
- function se(e, t, n, r, i, a) {
234
+ function ue(e, t, n, r, i, a) {
234
235
  let { sectorSize: o } = n, s = Math.floor(a / i), c = a % i, l = n.firstMiniFatSector, u = /* @__PURE__ */ new Set();
235
236
  for (let n = 0; n < s; n++) {
236
- if (!C(l) || u.has(l)) return null;
237
+ if (!T(l) || u.has(l)) return null;
237
238
  u.add(l);
238
- let n = T(e, t, o, r, l);
239
+ let n = E(e, t, o, r, l);
239
240
  if (n === null) return null;
240
241
  l = n;
241
242
  }
242
- if (!C(l)) return null;
243
- let d = S(l, o) + c * 4;
243
+ if (!T(l)) return null;
244
+ let d = w(l, o) + c * 4;
244
245
  if (d < 0 || d + 4 > t) return null;
245
246
  let f = e.getUint32(d, !0);
246
- return f === _ ? _ : f;
247
+ return f === b ? b : f;
247
248
  }
248
249
  //#endregion
249
250
  //#region packages/core/src/crypto/encryption-info.ts
250
- function D(e) {
251
+ function O(e) {
251
252
  if (typeof atob == "function") {
252
253
  let t = atob(e), n = new Uint8Array(t.length);
253
254
  for (let e = 0; e < t.length; e++) n[e] = t.charCodeAt(e);
@@ -257,19 +258,19 @@ function D(e) {
257
258
  if (t) return new Uint8Array(t.from(e, "base64"));
258
259
  throw Error("no base64 decoder available");
259
260
  }
260
- function O(e, t, n) {
261
+ function k(e, t, n) {
261
262
  let r = RegExp(`<(?:[\\w]+:)?${t}\\b[^>]*>`).exec(e);
262
263
  if (!r) return null;
263
264
  let i = r[0], a = RegExp(`\\b${n}\\s*=\\s*"([^"]*)"`).exec(i);
264
265
  return a ? a[1] : null;
265
266
  }
266
- function k(e) {
267
+ function A(e) {
267
268
  if (e === null) return null;
268
269
  let t = Number(e);
269
270
  return Number.isFinite(t) ? t : null;
270
271
  }
271
- function A(e, t) {
272
- let n = k(O(e, t, "saltSize")), r = k(O(e, t, "blockSize")), i = k(O(e, t, "keyBits")), a = k(O(e, t, "hashSize")), o = O(e, t, "cipherAlgorithm"), s = O(e, t, "cipherChaining"), c = O(e, t, "hashAlgorithm"), l = O(e, t, "saltValue");
272
+ function j(e, t) {
273
+ let n = A(k(e, t, "saltSize")), r = A(k(e, t, "blockSize")), i = A(k(e, t, "keyBits")), a = A(k(e, t, "hashSize")), o = k(e, t, "cipherAlgorithm"), s = k(e, t, "cipherChaining"), c = k(e, t, "hashAlgorithm"), l = k(e, t, "saltValue");
273
274
  return n === null || r === null || i === null || a === null || !o || !s || !c || l === null ? null : {
274
275
  saltSize: n,
275
276
  blockSize: r,
@@ -278,14 +279,14 @@ function A(e, t) {
278
279
  cipherAlgorithm: o,
279
280
  cipherChaining: s,
280
281
  hashAlgorithm: c,
281
- saltValue: D(l)
282
+ saltValue: O(l)
282
283
  };
283
284
  }
284
- function j(e) {
285
+ function de(e) {
285
286
  if (e.length < 8) return { kind: "unknown" };
286
287
  let t = new DataView(e.buffer, e.byteOffset, e.byteLength), n = t.getUint16(0, !0), r = t.getUint16(2, !0);
287
288
  if (n === 4 && r === 4) {
288
- let t = M(e.subarray(8));
289
+ let t = fe(e.subarray(8));
289
290
  return t ? {
290
291
  kind: "agile",
291
292
  descriptor: t
@@ -293,21 +294,21 @@ function j(e) {
293
294
  }
294
295
  return r === 16 && (n === 3 || n === 4) ? { kind: "extensible" } : r === 2 && (n === 2 || n === 3 || n === 4) ? { kind: "standard" } : { kind: "unknown" };
295
296
  }
296
- function M(e) {
297
- let t = new TextDecoder("utf-8").decode(e), n = A(t, "keyData"), r = A(t, "encryptedKey");
297
+ function fe(e) {
298
+ let t = new TextDecoder("utf-8").decode(e), n = j(t, "keyData"), r = j(t, "encryptedKey");
298
299
  if (!n || !r) return null;
299
- let i = k(O(t, "encryptedKey", "spinCount")), a = O(t, "encryptedKey", "encryptedVerifierHashInput"), o = O(t, "encryptedKey", "encryptedVerifierHashValue"), s = O(t, "encryptedKey", "encryptedKeyValue");
300
+ let i = A(k(t, "encryptedKey", "spinCount")), a = k(t, "encryptedKey", "encryptedVerifierHashInput"), o = k(t, "encryptedKey", "encryptedVerifierHashValue"), s = k(t, "encryptedKey", "encryptedKeyValue");
300
301
  if (i === null || a === null || o === null || s === null) return null;
301
302
  let c = {
302
303
  ...r,
303
304
  spinCount: i,
304
- encryptedVerifierHashInput: D(a),
305
- encryptedVerifierHashValue: D(o),
306
- encryptedKeyValue: D(s)
307
- }, l = null, u = O(t, "dataIntegrity", "encryptedHmacKey"), d = O(t, "dataIntegrity", "encryptedHmacValue");
305
+ encryptedVerifierHashInput: O(a),
306
+ encryptedVerifierHashValue: O(o),
307
+ encryptedKeyValue: O(s)
308
+ }, l = null, u = k(t, "dataIntegrity", "encryptedHmacKey"), d = k(t, "dataIntegrity", "encryptedHmacValue");
308
309
  return u !== null && d !== null && (l = {
309
- encryptedHmacKey: D(u),
310
- encryptedHmacValue: D(d)
310
+ encryptedHmacKey: O(u),
311
+ encryptedHmacValue: O(d)
311
312
  }), {
312
313
  keyData: n,
313
314
  passwordKeyEncryptor: c,
@@ -316,7 +317,7 @@ function M(e) {
316
317
  }
317
318
  //#endregion
318
319
  //#region packages/core/src/crypto/agile.ts
319
- var N = {
320
+ var M = {
320
321
  verifierHashInput: new Uint8Array([
321
322
  254,
322
323
  167,
@@ -367,120 +368,120 @@ var N = {
367
368
  132,
368
369
  51
369
370
  ])
370
- }, ce = 54, P = 4096, F = class extends Error {
371
+ }, pe = 54, N = 4096, P = class extends Error {
371
372
  reason;
372
373
  constructor(e, t) {
373
374
  super(t), this.name = "AgileDecryptError", this.reason = e;
374
375
  }
375
376
  };
376
- function I() {
377
+ function F() {
377
378
  let e = globalThis.crypto;
378
- if (!e || !e.subtle) throw new F("unsupported-encryption", "WebCrypto (globalThis.crypto.subtle) is unavailable; cannot decrypt.");
379
+ if (!e || !e.subtle) throw new P("unsupported-encryption", "WebCrypto (globalThis.crypto.subtle) is unavailable; cannot decrypt.");
379
380
  return e.subtle;
380
381
  }
381
- function L(e) {
382
+ function I(e) {
382
383
  switch (e.toUpperCase().replace(/[-_]/g, "")) {
383
384
  case "SHA512": return "SHA-512";
384
385
  case "SHA384": return "SHA-384";
385
386
  case "SHA256": return "SHA-256";
386
387
  case "SHA1": return "SHA-1";
387
- default: throw new F("unsupported-encryption", `Unsupported hashAlgorithm "${e}" (only SHA-1/256/384/512).`);
388
+ default: throw new P("unsupported-encryption", `Unsupported hashAlgorithm "${e}" (only SHA-1/256/384/512).`);
388
389
  }
389
390
  }
390
- function R(e) {
391
- if (e.cipherAlgorithm.toUpperCase() !== "AES") throw new F("unsupported-encryption", `Unsupported cipherAlgorithm "${e.cipherAlgorithm}" (only AES).`);
392
- if (e.cipherChaining.toLowerCase() !== "chainingmodecbc") throw new F("unsupported-encryption", `Unsupported cipherChaining "${e.cipherChaining}" (only ChainingModeCBC).`);
393
- if (e.keyBits !== 128 && e.keyBits !== 192 && e.keyBits !== 256) throw new F("unsupported-encryption", `Unsupported keyBits ${e.keyBits} (only 128/192/256).`);
391
+ function L(e) {
392
+ if (e.cipherAlgorithm.toUpperCase() !== "AES") throw new P("unsupported-encryption", `Unsupported cipherAlgorithm "${e.cipherAlgorithm}" (only AES).`);
393
+ if (e.cipherChaining.toLowerCase() !== "chainingmodecbc") throw new P("unsupported-encryption", `Unsupported cipherChaining "${e.cipherChaining}" (only ChainingModeCBC).`);
394
+ if (e.keyBits !== 128 && e.keyBits !== 192 && e.keyBits !== 256) throw new P("unsupported-encryption", `Unsupported keyBits ${e.keyBits} (only 128/192/256).`);
394
395
  }
395
- function z(...e) {
396
+ function R(...e) {
396
397
  let t = e.reduce((e, t) => e + t.length, 0), n = new Uint8Array(t), r = 0;
397
398
  for (let t of e) n.set(t, r), r += t.length;
398
399
  return n;
399
400
  }
400
- function B(e) {
401
+ function z(e) {
401
402
  let t = new Uint8Array(4);
402
403
  return new DataView(t.buffer).setUint32(0, e >>> 0, !0), t;
403
404
  }
404
- function le(e) {
405
+ function me(e) {
405
406
  let t = new Uint8Array(e.length * 2), n = new DataView(t.buffer);
406
407
  for (let t = 0; t < e.length; t++) n.setUint16(t * 2, e.charCodeAt(t), !0);
407
408
  return t;
408
409
  }
409
- async function V(e, t) {
410
- return new Uint8Array(await I().digest(e, t));
410
+ async function B(e, t) {
411
+ return new Uint8Array(await F().digest(e, t));
411
412
  }
412
- function H(e, t) {
413
+ function V(e, t) {
413
414
  if (e.length > t) return e.slice(0, t);
414
415
  let n = new Uint8Array(t);
415
- return n.set(e), e.length < t && n.fill(ce, e.length), n;
416
+ return n.set(e), e.length < t && n.fill(pe, e.length), n;
416
417
  }
417
- async function U(e, t, n, r) {
418
- let i = L(t.hashAlgorithm), a = await V(i, z(t.saltValue, le(e)));
419
- for (let e = 0; e < n; e++) a = await V(i, z(B(e), a));
420
- return H(await V(i, z(a, r)), t.keyBits / 8);
418
+ async function H(e, t, n, r) {
419
+ let i = I(t.hashAlgorithm), a = await B(i, R(t.saltValue, me(e)));
420
+ for (let e = 0; e < n; e++) a = await B(i, R(z(e), a));
421
+ return V(await B(i, R(a, r)), t.keyBits / 8);
421
422
  }
422
- async function W(e, t, n) {
423
- return H(n ? await V(L(e.hashAlgorithm), z(t, n)) : t, e.blockSize);
423
+ async function U(e, t, n) {
424
+ return V(n ? await B(I(e.hashAlgorithm), R(t, n)) : t, e.blockSize);
424
425
  }
425
- async function G(e, t, n) {
426
+ async function W(e, t, n) {
426
427
  let r = t.length;
427
428
  if (n.length === 0) return new Uint8Array();
428
- if (n.length % r !== 0) throw new F("corrupt", "ciphertext length is not a multiple of the block size");
429
- let i = await I().importKey("raw", e, { name: "AES-CBC" }, !1, ["decrypt"]), a = await I().importKey("raw", e, { name: "AES-CBC" }, !1, ["encrypt"]), o = n.subarray(n.length - r), s = ue(new Uint8Array(r).fill(r), o), c = z(n, new Uint8Array(await I().encrypt({
429
+ if (n.length % r !== 0) throw new P("corrupt", "ciphertext length is not a multiple of the block size");
430
+ let i = await F().importKey("raw", e, { name: "AES-CBC" }, !1, ["decrypt"]), a = await F().importKey("raw", e, { name: "AES-CBC" }, !1, ["encrypt"]), o = n.subarray(n.length - r), s = he(new Uint8Array(r).fill(r), o), c = R(n, new Uint8Array(await F().encrypt({
430
431
  name: "AES-CBC",
431
432
  iv: new Uint8Array(r)
432
- }, a, s)).subarray(0, r)), l = new Uint8Array(await I().decrypt({
433
+ }, a, s)).subarray(0, r)), l = new Uint8Array(await F().decrypt({
433
434
  name: "AES-CBC",
434
435
  iv: t
435
436
  }, i, c));
436
437
  return l.length >= n.length ? l.subarray(0, n.length) : l;
437
438
  }
438
- function ue(e, t) {
439
+ function he(e, t) {
439
440
  let n = new Uint8Array(e.length);
440
441
  for (let r = 0; r < e.length; r++) n[r] = e[r] ^ t[r];
441
442
  return n;
442
443
  }
443
- async function de(e, t) {
444
- R(t);
445
- let n = L(t.hashAlgorithm), r = await G(await U(e, t, t.spinCount, N.verifierHashInput), await W(t, t.saltValue, null), t.encryptedVerifierHashInput), i = await G(await U(e, t, t.spinCount, N.verifierHashValue), await W(t, t.saltValue, null), t.encryptedVerifierHashValue);
446
- return fe((await V(n, r)).subarray(0, t.hashSize), i.subarray(0, t.hashSize));
444
+ async function ge(e, t) {
445
+ L(t);
446
+ let n = I(t.hashAlgorithm), r = await W(await H(e, t, t.spinCount, M.verifierHashInput), await U(t, t.saltValue, null), t.encryptedVerifierHashInput), i = await W(await H(e, t, t.spinCount, M.verifierHashValue), await U(t, t.saltValue, null), t.encryptedVerifierHashValue);
447
+ return _e((await B(n, r)).subarray(0, t.hashSize), i.subarray(0, t.hashSize));
447
448
  }
448
- function fe(e, t) {
449
+ function _e(e, t) {
449
450
  if (e.length !== t.length) return !1;
450
451
  let n = 0;
451
452
  for (let r = 0; r < e.length; r++) n |= e[r] ^ t[r];
452
453
  return n === 0;
453
454
  }
454
- async function pe(e, t) {
455
- return await G(await U(e, t, t.spinCount, N.keyValue), await W(t, t.saltValue, null), t.encryptedKeyValue);
455
+ async function ve(e, t) {
456
+ return await W(await H(e, t, t.spinCount, M.keyValue), await U(t, t.saltValue, null), t.encryptedKeyValue);
456
457
  }
457
- async function me(e, t, n) {
458
- if (R(t), e.length < 8) throw new F("corrupt", "EncryptedPackage is shorter than its size prefix");
458
+ async function ye(e, t, n) {
459
+ if (L(t), e.length < 8) throw new P("corrupt", "EncryptedPackage is shorter than its size prefix");
459
460
  let r = new DataView(e.buffer, e.byteOffset, e.byteLength), i = Number(r.getBigUint64(0, !0)), a = e.subarray(8);
460
- if (i > a.length) throw new F("corrupt", "EncryptedPackage size prefix exceeds the ciphertext");
461
+ if (i > a.length) throw new P("corrupt", "EncryptedPackage size prefix exceeds the ciphertext");
461
462
  let o = n.slice(0, t.keyBits / 8), s = new Uint8Array(i), c = 0, l = 0;
462
- for (let e = 0; e < a.length; e += P) {
463
- let n = a.subarray(e, e + P), r = await G(o, await W(t, t.saltValue, B(l)), n), u = Math.min(r.length, i - c);
463
+ for (let e = 0; e < a.length; e += N) {
464
+ let n = a.subarray(e, e + N), r = await W(o, await U(t, t.saltValue, z(l)), n), u = Math.min(r.length, i - c);
464
465
  if (s.set(r.subarray(0, u), c), c += u, l++, c >= i) break;
465
466
  }
466
- if (c !== i) throw new F("corrupt", "decrypted output is shorter than the declared size");
467
+ if (c !== i) throw new P("corrupt", "decrypted output is shorter than the declared size");
467
468
  return s;
468
469
  }
469
- async function he(e, t, n) {
470
+ async function be(e, t, n) {
470
471
  let { keyData: r, passwordKeyEncryptor: i } = e;
471
- if (R(r), R(i), !await de(n, i)) throw new F("invalid-password", "The supplied password is incorrect.");
472
- return me(t, r, await pe(n, i));
472
+ if (L(r), L(i), !await ge(n, i)) throw new P("invalid-password", "The supplied password is incorrect.");
473
+ return ye(t, r, await ve(n, i));
473
474
  }
474
475
  //#endregion
475
476
  //#region packages/core/src/crypto/decrypt-ooxml.ts
476
- var ge = "EncryptionInfo", _e = "EncryptedPackage";
477
- async function ve(e, t) {
478
- let n = x(e, ge), r = x(e, _e);
477
+ var xe = "EncryptionInfo", Se = "EncryptedPackage";
478
+ async function Ce(e, t) {
479
+ let n = C(e, xe), r = C(e, Se);
479
480
  if (n === null || r === null) return {
480
481
  ok: !1,
481
482
  reason: "corrupt"
482
483
  };
483
- let i = j(n);
484
+ let i = de(n);
484
485
  if (i.kind !== "agile") return {
485
486
  ok: !1,
486
487
  reason: "unsupported-encryption"
@@ -488,10 +489,10 @@ async function ve(e, t) {
488
489
  try {
489
490
  return {
490
491
  ok: !0,
491
- data: await he(i.descriptor, r, t)
492
+ data: await be(i.descriptor, r, t)
492
493
  };
493
494
  } catch (e) {
494
- return e instanceof F ? {
495
+ return e instanceof P ? {
495
496
  ok: !1,
496
497
  reason: e.reason
497
498
  } : {
@@ -502,37 +503,37 @@ async function ve(e, t) {
502
503
  }
503
504
  //#endregion
504
505
  //#region packages/core/src/errors/cfb-guard.ts
505
- function ye(t) {
506
- let n = l(t instanceof Uint8Array ? t : new Uint8Array(t));
506
+ function we(e) {
507
+ let n = p(e instanceof Uint8Array ? e : new Uint8Array(e));
507
508
  if (n !== null) switch (n) {
508
- case "encrypted": throw new e("encrypted", "This file is password-protected (MS-OFFCRYPTO). Pass LoadOptions.password to decrypt it.");
509
- case "legacy-binary-format": throw new e("legacy-binary-format", "This is a legacy binary Office file (.doc/.xls/.ppt), not OOXML.");
510
- case "cfb-unknown": throw new e("not-ooxml", "This file is an OLE2/Compound File container, not an OOXML (ZIP) document.");
511
- default: throw new e("not-ooxml", "This file is an OLE2/Compound File container of an unrecognised kind, not an OOXML (ZIP) document.");
509
+ case "encrypted": throw new t("encrypted", "This file is password-protected (MS-OFFCRYPTO). Pass LoadOptions.password to decrypt it.");
510
+ case "legacy-binary-format": throw new t("legacy-binary-format", "This is a legacy binary Office file (.doc/.xls/.ppt), not OOXML.");
511
+ case "cfb-unknown": throw new t("not-ooxml", "This file is an OLE2/Compound File container, not an OOXML (ZIP) document.");
512
+ default: throw new t("not-ooxml", "This file is an OLE2/Compound File container of an unrecognised kind, not an OOXML (ZIP) document.");
512
513
  }
513
514
  }
514
- async function be(t, n) {
515
- let r = t instanceof Uint8Array ? t : new Uint8Array(t), i = l(r);
515
+ async function Te(e, n) {
516
+ let r = e instanceof Uint8Array ? e : new Uint8Array(e), i = p(r);
516
517
  if (i === null) return r;
517
518
  if (i === "encrypted") {
518
- if (n === void 0) throw new e("encrypted", "This file is password-protected (MS-OFFCRYPTO). Pass LoadOptions.password to decrypt it.");
519
- let t = await ve(r, n);
520
- if (t.ok) return t.data;
521
- switch (t.reason) {
522
- case "invalid-password": throw new e("invalid-password", "The supplied password is incorrect.");
523
- case "unsupported-encryption": throw new e("unsupported-encryption", "This file uses an encryption scheme other than Agile ([MS-OFFCRYPTO]) that is not supported (Standard / Extensible / legacy binary encryption).");
524
- case "corrupt": throw new e("not-ooxml", "This file is an encrypted OLE2/Compound File container but its structure could not be read.");
525
- default: throw t.reason, new e("not-ooxml", "This encrypted file could not be decrypted.");
519
+ if (n === void 0) throw new t("encrypted", "This file is password-protected (MS-OFFCRYPTO). Pass LoadOptions.password to decrypt it.");
520
+ let e = await Ce(r, n);
521
+ if (e.ok) return e.data;
522
+ switch (e.reason) {
523
+ case "invalid-password": throw new t("invalid-password", "The supplied password is incorrect.");
524
+ case "unsupported-encryption": throw new t("unsupported-encryption", "This file uses an encryption scheme other than Agile ([MS-OFFCRYPTO]) that is not supported (Standard / Extensible / legacy binary encryption).");
525
+ case "corrupt": throw new t("not-ooxml", "This file is an encrypted OLE2/Compound File container but its structure could not be read.");
526
+ default: throw e.reason, new t("not-ooxml", "This encrypted file could not be decrypted.");
526
527
  }
527
528
  }
528
- return ye(r), r;
529
+ return we(r), r;
529
530
  }
530
- function xe(e) {
531
+ function Ee(e) {
531
532
  return e.byteOffset === 0 && e.byteLength === e.buffer.byteLength && e.buffer instanceof ArrayBuffer ? e.buffer : e.slice().buffer;
532
533
  }
533
534
  //#endregion
534
535
  //#region packages/core/src/autoResize.ts
535
- function Se(e, t, n = {}) {
536
+ function De(e, t, n = {}) {
536
537
  let r = n.pauseWhenHidden ?? !0, i = null, a = 0, o = 0, s = null, c = !1, l = !1, u = () => {
537
538
  if (!l && !(r && typeof document < "u" && document.hidden)) {
538
539
  if (s) {
@@ -569,11 +570,11 @@ function Se(e, t, n = {}) {
569
570
  }
570
571
  //#endregion
571
572
  //#region packages/core/src/worker/bridge.ts
572
- function K() {
573
+ function G() {
573
574
  let e = /* @__PURE__ */ Error("worker request aborted");
574
575
  return e.name = "AbortError", e;
575
576
  }
576
- var Ce = class {
577
+ var Oe = class {
577
578
  _worker;
578
579
  _opts;
579
580
  _pending = /* @__PURE__ */ new Map();
@@ -630,7 +631,7 @@ var Ce = class {
630
631
  return;
631
632
  }
632
633
  if (a?.aborted) {
633
- o("abort"), c(K());
634
+ o("abort"), c(G());
634
635
  return;
635
636
  }
636
637
  let l, u;
@@ -646,7 +647,7 @@ var Ce = class {
646
647
  e && (this._pending.delete(r), e.onOrphanedResponse && this._orphaned.set(r, e.onOrphanedResponse), e.cleanup(), o("timeout"), e.reject(/* @__PURE__ */ Error(`worker request timed out after ${i}ms`)));
647
648
  }, i)), a && (u = () => {
648
649
  let e = this._pending.get(r);
649
- e && (this._pending.delete(r), e.onOrphanedResponse && this._orphaned.set(r, e.onOrphanedResponse), e.cleanup(), o("abort"), e.reject(K()));
650
+ e && (this._pending.delete(r), e.onOrphanedResponse && this._orphaned.set(r, e.onOrphanedResponse), e.cleanup(), o("abort"), e.reject(G()));
650
651
  }, a.addEventListener("abort", u));
651
652
  try {
652
653
  this._worker.postMessage(e(r), t);
@@ -687,7 +688,7 @@ var Ce = class {
687
688
  };
688
689
  //#endregion
689
690
  //#region packages/core/src/worker/rejected-load.ts
690
- function we(e, t) {
691
+ function ke(e, t) {
691
692
  if (t) try {
692
693
  t();
693
694
  return;
@@ -697,33 +698,106 @@ function we(e, t) {
697
698
  } catch {}
698
699
  }
699
700
  //#endregion
701
+ //#region packages/core/src/worker/svg-decode-bridge.ts
702
+ function K(e) {
703
+ return typeof e == "number" && Number.isFinite(e) && e > 0 ? Math.ceil(e) : void 0;
704
+ }
705
+ function q(e, t) {
706
+ if (!Number.isFinite(e) || !Number.isFinite(t) || !(e > 0) || !(t > 0)) throw Error(`invalid SVG raster size: ${e}x${t}`);
707
+ let i = Math.sqrt(n) / Math.sqrt(e) / Math.sqrt(t), a = Math.min(1, r / e, r / t, i);
708
+ return {
709
+ width: Math.min(r, Math.max(1, Math.floor(e * a))),
710
+ height: Math.min(r, Math.max(1, Math.floor(t * a)))
711
+ };
712
+ }
713
+ function Ae(e, t, i, a) {
714
+ let o = i === void 0 ? 0 : i / e, s = a === void 0 ? 0 : a / t, c = i === void 0 && a === void 0 ? 1 : Math.max(o, s), l = Math.min(r / e, r / t, Math.sqrt(n) / Math.sqrt(e) / Math.sqrt(t));
715
+ if (!Number.isFinite(c) || !(c > 0) || !Number.isFinite(l) || !(l > 0)) throw Error(`invalid SVG raster scale: ${Math.min(c, l)}`);
716
+ return l < c ? q(Math.max(1, Math.floor(e * l)), Math.max(1, Math.floor(t * l))) : i !== void 0 && o >= s ? q(i, Math.max(1, Math.ceil(t * i / e))) : a === void 0 ? q(Math.ceil(e), Math.ceil(t)) : q(Math.max(1, Math.ceil(e * a / t)), a);
717
+ }
718
+ async function je(t, r = {}) {
719
+ if (typeof Image > "u") throw Error("SVG host decode requires HTMLImageElement");
720
+ let a = URL.createObjectURL(t);
721
+ try {
722
+ let t = new Image(), o = K(r.targetWidthPx), s = K(r.targetHeightPx);
723
+ await new Promise((e, n) => {
724
+ t.onload = () => {
725
+ typeof t.decode == "function" ? t.decode().then(e).catch(e) : e();
726
+ }, t.onerror = () => n(/* @__PURE__ */ Error("SVG host decode failed")), t.src = a;
727
+ });
728
+ let c = Number.isFinite(t.naturalWidth) && t.naturalWidth > 0 && Number.isFinite(t.naturalHeight) && t.naturalHeight > 0, l = Ae(c ? t.naturalWidth : 300, c ? t.naturalHeight : 150, o, s);
729
+ t.width = l.width, t.height = l.height;
730
+ let u;
731
+ if (typeof OffscreenCanvas < "u") {
732
+ let e = new OffscreenCanvas(l.width, l.height), n = e.getContext("2d");
733
+ if (!n) throw Error("SVG host raster target has no 2-D context");
734
+ n.drawImage(t, 0, 0, l.width, l.height), u = e.transferToImageBitmap();
735
+ } else {
736
+ let e = document.createElement("canvas");
737
+ e.width = l.width, e.height = l.height;
738
+ let n = e.getContext("2d");
739
+ if (!n) throw Error("SVG host raster target has no 2-D context");
740
+ n.drawImage(t, 0, 0, l.width, l.height), u = await createImageBitmap(e);
741
+ }
742
+ let d = u.width * u.height;
743
+ if (u.width > 32767 || u.height > 32767 || d > 33554432) throw e(u), new i("image-pixels", n, d);
744
+ return u;
745
+ } finally {
746
+ URL.revokeObjectURL(a);
747
+ }
748
+ }
749
+ function Me(e) {
750
+ return !!e && typeof e == "object" && e.kind === "ooxmlDecodeSvg";
751
+ }
752
+ function Ne(t, n) {
753
+ return Me(n) ? (je(new Blob([n.bytes], { type: "image/svg+xml" }), n).then((r) => {
754
+ try {
755
+ t({
756
+ kind: "ooxmlSvgDecoded",
757
+ decodeId: n.decodeId,
758
+ bitmap: r
759
+ }, [r]);
760
+ } catch {
761
+ e(r);
762
+ }
763
+ }).catch((e) => {
764
+ try {
765
+ t({
766
+ kind: "ooxmlSvgDecodeFailed",
767
+ decodeId: n.decodeId,
768
+ message: e instanceof Error ? e.message : String(e)
769
+ });
770
+ } catch {}
771
+ }), !0) : !1;
772
+ }
773
+ //#endregion
700
774
  //#region packages/core/src/interaction/zoom.ts
701
- var Te = 1.1, Ee = 10, De = 3, Oe = 1;
702
- function ke(e, t) {
775
+ var Pe = 1.1, Fe = 10, Ie = 3, Le = 1;
776
+ function Re(e, t) {
703
777
  let n;
704
778
  switch (t) {
705
779
  case 1:
706
- n = e / De;
780
+ n = e / Ie;
707
781
  break;
708
782
  case 2:
709
- n = e / Oe;
783
+ n = e / Le;
710
784
  break;
711
785
  default:
712
- n = e / Ee;
786
+ n = e / Fe;
713
787
  break;
714
788
  }
715
789
  return Math.max(-1, Math.min(1, n));
716
790
  }
717
- function Ae(e, t, n = 0) {
718
- return e * Te ** +-ke(t, n);
791
+ function ze(e, t, n = 0) {
792
+ return e * Pe ** +-Re(t, n);
719
793
  }
720
- function je(e, t, n, r, i) {
794
+ function Be(e, t, n, r, i) {
721
795
  let a = n > 0 ? r / n : 1, o = (e + t) * a - t, s = i.maxScroll > 0 ? i.maxScroll : 0;
722
796
  return o < 0 ? 0 : o > s ? s : o;
723
797
  }
724
798
  //#endregion
725
799
  //#region packages/core/src/interaction/zoomable.ts
726
- var q = Object.freeze([
800
+ var J = Object.freeze([
727
801
  .25,
728
802
  .33,
729
803
  .5,
@@ -739,22 +813,22 @@ var q = Object.freeze([
739
813
  2.5,
740
814
  3,
741
815
  4
742
- ]), J = .005;
743
- function Me(e) {
744
- for (let t of q) if (t > e + J) return t;
745
- return q[q.length - 1];
816
+ ]), Y = .005;
817
+ function Ve(e) {
818
+ for (let t of J) if (t > e + Y) return t;
819
+ return J[J.length - 1];
746
820
  }
747
- function Ne(e) {
748
- for (let t = q.length - 1; t >= 0; t--) {
749
- let n = q[t];
750
- if (n < e - J) return n;
821
+ function He(e) {
822
+ for (let t = J.length - 1; t >= 0; t--) {
823
+ let n = J[t];
824
+ if (n < e - Y) return n;
751
825
  }
752
- return q[0];
826
+ return J[0];
753
827
  }
754
- function Pe(e, t, n) {
828
+ function Ue(e, t, n) {
755
829
  return e < t ? t : e > n ? n : e;
756
830
  }
757
- function Fe(e, t) {
831
+ function We(e, t) {
758
832
  let { contentWidth: n, contentHeight: r, containerWidth: i, containerHeight: a } = e;
759
833
  if (n <= 0 || i <= 0) return 0;
760
834
  let o = i / n;
@@ -765,7 +839,7 @@ function Fe(e, t) {
765
839
  }
766
840
  //#endregion
767
841
  //#region packages/core/src/search/text-index.ts
768
- function Y(e) {
842
+ function X(e) {
769
843
  let t = e.toLowerCase();
770
844
  if (t.length === e.length) return t;
771
845
  let n = "";
@@ -775,17 +849,17 @@ function Y(e) {
775
849
  }
776
850
  return n;
777
851
  }
778
- function Ie(e) {
852
+ function Ge(e) {
779
853
  let t = Array(e.length), n = 0, r = "";
780
854
  for (let i = 0; i < e.length; i++) t[i] = n, r += e[i].text, n += e[i].text.length;
781
855
  return {
782
856
  text: r,
783
- folded: Y(r),
857
+ folded: X(r),
784
858
  runStart: t,
785
859
  runCount: e.length
786
860
  };
787
861
  }
788
- function Le(e, t) {
862
+ function Ke(e, t) {
789
863
  let { runStart: n } = e, r = 0, i = n.length - 1;
790
864
  for (; r < i;) {
791
865
  let e = r + i + 1 >> 1;
@@ -793,8 +867,8 @@ function Le(e, t) {
793
867
  }
794
868
  return r;
795
869
  }
796
- function Re(e, t, n) {
797
- let { runStart: r, runCount: i, text: a } = e, o = [], s = Le(e, t), c = t;
870
+ function qe(e, t, n) {
871
+ let { runStart: r, runCount: i, text: a } = e, o = [], s = Ke(e, t), c = t;
798
872
  for (; c < n && s < i;) {
799
873
  let e = s + 1 < i ? r[s + 1] : a.length, t = Math.min(n, e), l = c - r[s], u = t - r[s];
800
874
  u > l && o.push({
@@ -805,31 +879,31 @@ function Re(e, t, n) {
805
879
  }
806
880
  return o;
807
881
  }
808
- function ze(e, t, n = {}) {
882
+ function Je(e, t, n = {}) {
809
883
  if (t.length === 0) return [];
810
- let r = n.caseSensitive ?? !1, i = r ? e.text : e.folded, a = r ? t : Y(t), o = [], s = 0, c = 0;
884
+ let r = n.caseSensitive ?? !1, i = r ? e.text : e.folded, a = r ? t : X(t), o = [], s = 0, c = 0;
811
885
  for (;;) {
812
886
  let t = i.indexOf(a, s);
813
887
  if (t === -1) break;
814
888
  o.push({
815
889
  matchIndex: c,
816
- slices: Re(e, t, t + a.length)
890
+ slices: qe(e, t, t + a.length)
817
891
  }), c++, s = t + a.length;
818
892
  }
819
893
  return o;
820
894
  }
821
895
  //#endregion
822
896
  //#region packages/core/src/search/find-cursor.ts
823
- function Be(e, t) {
897
+ function Ye(e, t) {
824
898
  return t <= 0 ? -1 : e < 0 ? 0 : (e + 1) % t;
825
899
  }
826
- function Ve(e, t) {
900
+ function Xe(e, t) {
827
901
  return t <= 0 ? -1 : e < 0 ? t - 1 : (e - 1 + t) % t;
828
902
  }
829
903
  //#endregion
830
904
  //#region packages/core/src/internal/chart-context.ts
831
- var X = 65536;
832
- function He(e, t) {
905
+ var Z = 65536;
906
+ function Ze(e, t) {
833
907
  let n = Math.min(e.length, t);
834
908
  if (n > 0 && n < e.length) {
835
909
  let t = e.charCodeAt(n - 1), r = e.charCodeAt(n);
@@ -837,19 +911,19 @@ function He(e, t) {
837
911
  }
838
912
  return e.slice(0, n);
839
913
  }
840
- function Ue(e) {
914
+ function Qe(e) {
841
915
  let t = e ?? 16384;
842
916
  if (!Number.isFinite(t) || t < 0) throw RangeError("maxTextCharacters must be a finite non-negative number.");
843
- return Math.min(X, Math.floor(t));
917
+ return Math.min(Z, Math.floor(t));
844
918
  }
845
- function We(e, t) {
846
- let n = Ue(t), r = [], i = 0, a = !1, o = !1, s = (e, t) => {
919
+ function $e(e, t) {
920
+ let n = Qe(t), r = [], i = 0, a = !1, o = !1, s = (e, t) => {
847
921
  if (t && o) {
848
922
  if (i >= n) return a = !0, !1;
849
923
  r.push("\n"), i++;
850
924
  }
851
925
  o = !0;
852
- let s = He(e, Math.max(0, n - i));
926
+ let s = Ze(e, Math.max(0, n - i));
853
927
  return r.push(s), i += s.length, s.length < e.length ? (a = !0, !1) : !0;
854
928
  };
855
929
  if (!s(`Chart type: ${e.chartType}`, !0) || e.title !== null && !s(`Title: ${e.title}`, !0)) return {
@@ -891,13 +965,13 @@ function We(e, t) {
891
965
  }
892
966
  //#endregion
893
967
  //#region packages/core/src/internal/canvas-viewer-mechanics.ts
894
- var Ge = 65536, Ke = 1024;
895
- function Z(e, t, n) {
968
+ var et = 65536, tt = 1024;
969
+ function Q(e, t, n) {
896
970
  let r = e ?? t;
897
971
  if (!Number.isFinite(r) || r < 0) throw RangeError(`${n} must be a finite non-negative number.`);
898
972
  return Math.min(t, Math.floor(r));
899
973
  }
900
- function qe(e, t) {
974
+ function nt(e, t) {
901
975
  let n = Math.min(e.length, t);
902
976
  if (n > 0 && n < e.length) {
903
977
  let t = e.charCodeAt(n - 1), r = e.charCodeAt(n);
@@ -905,7 +979,7 @@ function qe(e, t) {
905
979
  }
906
980
  return e.slice(0, n);
907
981
  }
908
- function* Je(e) {
982
+ function* rt(e) {
909
983
  let t = e.firstChild ?? e.childNodes[0] ?? null;
910
984
  for (; t;) {
911
985
  if (t.nodeType === 3 && (yield t), t.firstChild) {
@@ -917,13 +991,13 @@ function* Je(e) {
917
991
  t = t.nextSibling;
918
992
  }
919
993
  }
920
- function Ye(e, t, n, r, i) {
994
+ function it(e, t, n, r, i) {
921
995
  for (let a of r) {
922
996
  let r = !1;
923
997
  try {
924
998
  r = a.intersectsNode(n);
925
999
  } catch {}
926
- if (r) for (let r of Je(n)) {
1000
+ if (r) for (let r of rt(n)) {
927
1001
  let n = r.data, o, s;
928
1002
  if (a.startContainer === r) o = a.startOffset;
929
1003
  else try {
@@ -946,7 +1020,7 @@ function Ye(e, t, n, r, i) {
946
1020
  }
947
1021
  return t;
948
1022
  }
949
- function Xe(e, t, n, r = {}) {
1023
+ function at(e, t, n, r = {}) {
950
1024
  if (!t || t.isCollapsed || t.rangeCount === 0) return null;
951
1025
  let i = [...e.matches?.("[data-ooxml-selection-surface]") ? [e] : [], ...e.querySelectorAll("[data-ooxml-selection-surface]")];
952
1026
  if (i.length === 0) return null;
@@ -956,7 +1030,7 @@ function Xe(e, t, n, r = {}) {
956
1030
  if (!e.contains(r.startContainer) || !e.contains(r.endContainer) || !a(r.startContainer) || !a(r.endContainer)) return null;
957
1031
  o.push(r);
958
1032
  }
959
- let s = Z(r.maxChars, Ge, "maxTextCharacters"), c = Z(r.maxLocators, Ke, "maxRunLocators"), l = [], u = !1, d = s + 2, f = [], p = 0;
1033
+ let s = Q(r.maxChars, et, "maxTextCharacters"), c = Q(r.maxLocators, tt, "maxRunLocators"), l = [], u = !1, d = s + 2, f = [], p = 0;
960
1034
  for (let t of e.querySelectorAll("[data-ooxml-selection-run]")) {
961
1035
  if (!o.some((e) => {
962
1036
  try {
@@ -966,12 +1040,12 @@ function Xe(e, t, n, r = {}) {
966
1040
  }
967
1041
  })) continue;
968
1042
  let e = n(t);
969
- if (e !== null && (l.length >= c ? u = !0 : l.push(structuredClone(e)), p < d && (p = Ye(f, p, t, o, d)), u && p >= d)) break;
1043
+ if (e !== null && (l.length >= c ? u = !0 : l.push(structuredClone(e)), p < d && (p = it(f, p, t, o, d)), u && p >= d)) break;
970
1044
  }
971
1045
  if (l.length === 0 && !u) return null;
972
1046
  let m = f.join("");
973
1047
  if (m.length === 0) return null;
974
- let h = qe(m, s), g = m.length > s;
1048
+ let h = nt(m, s), g = m.length > s;
975
1049
  return {
976
1050
  text: h,
977
1051
  locators: l,
@@ -982,7 +1056,7 @@ function Xe(e, t, n, r = {}) {
982
1056
  maxLocators: c
983
1057
  };
984
1058
  }
985
- var Ze = class {
1059
+ var ot = class {
986
1060
  wrapper;
987
1061
  originalParent;
988
1062
  originalNextSibling;
@@ -1003,31 +1077,31 @@ var Ze = class {
1003
1077
  (this.options.restoreMode ?? "display") === "style-and-bitmap" ? (this.originalStyle === null ? this.canvas.removeAttribute("style") : this.canvas.setAttribute("style", this.originalStyle), this.canvas.width = this.originalWidth, this.canvas.height = this.originalHeight) : this.canvas.style.display = this.originalDisplay, this.wrapper.remove();
1004
1078
  }
1005
1079
  }
1006
- }, Qe = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;user-select:text;-webkit-user-select:text;", Q = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;", $e = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;";
1080
+ }, st = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;user-select:text;-webkit-user-select:text;", ct = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;", lt = "position:absolute;top:0;left:0;width:100%;height:100%;overflow:hidden;pointer-events:none;";
1007
1081
  function $(e, t) {
1008
1082
  if (!t) return null;
1009
1083
  let n = (e.ownerDocument ?? document).createElement("div");
1010
- return n.style.cssText = $e, e.appendChild(n), n;
1084
+ return n.style.cssText = lt, e.appendChild(n), n;
1011
1085
  }
1012
- function et(e, t) {
1086
+ function ut(e, t) {
1013
1087
  if (!e || (e.innerHTML = "", !t || !Number.isFinite(t.x) || !Number.isFinite(t.y) || !Number.isFinite(t.width) || !Number.isFinite(t.height) || t.width <= 0 || t.height <= 0)) return;
1014
1088
  let n = (e.ownerDocument ?? document).createElement("div"), r = Number.isFinite(t.rotation) ? t.rotation ?? 0 : 0;
1015
1089
  n.style.cssText = `position:absolute;left:${t.x * 100}%;top:${t.y * 100}%;width:${t.width * 100}%;height:${t.height * 100}%;box-sizing:border-box;border:2px solid #1a73e8;background:color-mix(in srgb, #1a73e8 6%, transparent);transform:rotate(${r}deg);transform-origin:center;pointer-events:none;`, e.appendChild(n);
1016
1090
  }
1017
- var tt = class {
1091
+ var dt = class {
1018
1092
  textLayer;
1019
1093
  highlightLayer;
1020
1094
  elementLayer;
1021
1095
  constructor(e, t, n = !1) {
1022
1096
  let r = e.ownerDocument ?? document;
1023
- this.textLayer = t ? r.createElement("div") : null, this.textLayer && (this.textLayer.style.cssText = Qe, e.appendChild(this.textLayer)), this.highlightLayer = r.createElement("div"), this.highlightLayer.style.cssText = Q, e.appendChild(this.highlightLayer), this.elementLayer = $(e, n);
1097
+ this.textLayer = t ? r.createElement("div") : null, this.textLayer && (this.textLayer.style.cssText = st, e.appendChild(this.textLayer)), this.highlightLayer = r.createElement("div"), this.highlightLayer.style.cssText = ct, e.appendChild(this.highlightLayer), this.elementLayer = $(e, n);
1024
1098
  }
1025
1099
  };
1026
- function nt(e, t, n) {
1100
+ function ft(e, t, n) {
1027
1101
  if (n && t !== void 0 && t !== n.mode) throw Error(`${e}: opts.mode='${t}' conflicts with the borrowed engine's mode='${n.mode}'. Omit opts.mode when borrowing an engine — the engine owns its render mode.`);
1028
1102
  return n?.mode ?? t ?? "main";
1029
1103
  }
1030
- var rt = class {
1104
+ var pt = class {
1031
1105
  generation = 0;
1032
1106
  resource;
1033
1107
  ownsResource;
@@ -1079,7 +1153,7 @@ var rt = class {
1079
1153
  e.destroy();
1080
1154
  } catch {}
1081
1155
  }
1082
- }, it = class {
1156
+ }, mt = class {
1083
1157
  generation = 0;
1084
1158
  destroyed = !1;
1085
1159
  bitmapContext;
@@ -1118,7 +1192,7 @@ var rt = class {
1118
1192
  destroy() {
1119
1193
  this.destroyed || (this.destroyed = !0, this.generation++);
1120
1194
  }
1121
- }, at = class {
1195
+ }, ht = class {
1122
1196
  closed = !1;
1123
1197
  handled = /* @__PURE__ */ new WeakSet();
1124
1198
  backgroundLifecycleOwners = 0;
@@ -1161,4 +1235,4 @@ var rt = class {
1161
1235
  }
1162
1236
  };
1163
1237
  //#endregion
1164
- export { Ce as C, xe as E, we as S, be as T, Fe as _, rt as a, je as b, et as c, We as d, Be as f, Pe as g, ze as h, it as i, nt as l, Ie as m, tt as n, $ as o, Ve as p, at as r, Xe as s, Ze as t, X as u, Me as v, Se as w, Ae as x, Ne as y };
1238
+ export { ke as C, Ee as D, Te as E, Ne as S, De as T, We as _, pt as a, Be as b, ut as c, $e as d, Ye as f, Ue as g, Je as h, mt as i, ft as l, Ge as m, dt as n, $ as o, Xe as p, ht as r, at as s, ot as t, Z as u, Ve as v, Oe as w, ze as x, He as y };