@epam/ai-dial-attachment-canvas 1.1.0-dev.400 → 1.1.0-dev.402

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 (46) hide show
  1. package/{LazyContentBoundary-CqvIcNMp.js → LazyContentBoundary-DkAcpR4S.js} +3 -2
  2. package/{PdfContent-CU1Q5IV6.js → PdfContent-BBUc0_SC.js} +1 -1
  3. package/{renderer-module-contract-BNGz8HvO-BmSLiM0k.js → bounded-raw-part-cache-BfbSxRIL-DD07NKh9.js} +2448 -8979
  4. package/chart-ex-B0DgG3Dt.js +1009 -0
  5. package/comment-occurrence-CqejEuts-7SeKCBXk.js +6 -0
  6. package/comment-ui-runtime-DEtgcmj7-B1G7PH4z.js +170 -0
  7. package/comment-ui-runtime-TLHustXJ-DWCXG2mL.js +2 -0
  8. package/comment-ui-runtime-lXwVOgjW-Be4RALsI.js +112 -0
  9. package/comments-CAn2A_Xh-CdgNAj0h.js +282 -0
  10. package/components/AttachmentCanvas/AttachmentCanvas.d.ts.map +1 -1
  11. package/components/AttachmentCanvasBody/AttachmentCanvasBody.d.ts.map +1 -1
  12. package/components/AttachmentCanvasContainer/AttachmentCanvasContainer.d.ts.map +1 -1
  13. package/components/OoxmlContent/OoxmlContent.d.ts +7 -3
  14. package/components/OoxmlContent/OoxmlContent.d.ts.map +1 -1
  15. package/delimited-text-worker-host-DcHj_JZt-DWJmaPag.js +25 -0
  16. package/docx-B9qBTEkj.js +29822 -0
  17. package/hooks/useOpenAttachmentCanvas/useOpenAttachmentCanvas.d.ts +1 -1
  18. package/index.css +1 -1
  19. package/index.js +383 -325
  20. package/line-distribute-IsUGfHXm-DeITjLzJ.js +1234 -0
  21. package/line-metrics-CBbw80Ko-DoOuwYxZ.js +60 -0
  22. package/models/attachment-canvas.d.ts +15 -5
  23. package/models/attachment-canvas.d.ts.map +1 -1
  24. package/package.json +5 -5
  25. package/pptx-dkJw0-Vx.js +9179 -0
  26. package/read-only-comment-decoration-BTnWEeo5-BNhbteYc.js +94 -0
  27. package/read-only-comment-margin-plStyGfE-mggNAMB_.js +189 -0
  28. package/render-worker-host-BEfLZvSL-COy91Rd8.js +7 -0
  29. package/render-worker-host-Ba6Fchqr-DZeKpMWD.js +7 -0
  30. package/render-worker-host-C3xwtHnv-BBGHFdo9.js +7 -0
  31. package/renderer-module-contract-Cu-GKuPd-Bt0YZuzB.js +10063 -0
  32. package/types/attachment-canvas.d.ts +3 -2
  33. package/types/attachment-canvas.d.ts.map +1 -1
  34. package/utils/content.d.ts +3 -3
  35. package/utils/content.d.ts.map +1 -1
  36. package/utils/download.d.ts.map +1 -1
  37. package/visible-index-DPoQYSDt-9lRc-2Ik.js +162 -0
  38. package/xlsx-BAXMTJTG.js +8585 -0
  39. package/docx-TK1kGI6t.js +0 -27179
  40. package/highlight-rect-BuX5rWP4-BMOCuZYw.js +0 -1037
  41. package/pptx-DfVqSUxc.js +0 -7410
  42. package/render-worker-host-Br7ZDyGE-ByESfBjH.js +0 -7
  43. package/render-worker-host-CM1JXVqg-DGwZpsUd.js +0 -7
  44. package/render-worker-host-DFtd9Z-J-DU7fugLI.js +0 -7
  45. package/visible-index-BjesVGhg-DvGeguMs.js +0 -133
  46. package/xlsx-44AZTEry.js +0 -7800
@@ -0,0 +1,6 @@
1
+ //#region ../../node_modules/@silurus/ooxml/dist/comment-occurrence-CqejEuts.js
2
+ function e(e, t, n) {
3
+ return `slide:${n}:${e.id ?? `classic:${e.authorId ?? "unknown"}:${e.index ?? t}`}`;
4
+ }
5
+ //#endregion
6
+ export { e as t };
@@ -0,0 +1,170 @@
1
+ import { D as e } from "./line-distribute-IsUGfHXm-DeITjLzJ.js";
2
+ import { r as t, s as n } from "./comments-CAn2A_Xh-CdgNAj0h.js";
3
+ import { a as r, i, n as a, o, s, t as c } from "./read-only-comment-margin-plStyGfE-mggNAMB_.js";
4
+ import { i as l, n as u, r as d, t as f } from "./read-only-comment-decoration-BTnWEeo5-BNhbteYc.js";
5
+ //#region ../../node_modules/@silurus/ooxml/dist/comment-ui-runtime-DEtgcmj7.js
6
+ function p(e, r) {
7
+ let i = /* @__PURE__ */ new Set();
8
+ for (let e of r) e.source && i.add(n(e.source));
9
+ if (i.size === 0) return [];
10
+ let a = [];
11
+ for (let o of e) {
12
+ if (!(i.has(n(o.source)) || i.has(n(o.reference.source)) || o.geometryFallback !== void 0 && i.has(n(o.geometryFallback.source)))) continue;
13
+ let e = t(o, r);
14
+ e.length > 0 && a.push({
15
+ anchor: o,
16
+ runs: e
17
+ });
18
+ }
19
+ return a;
20
+ }
21
+ function m(e, t) {
22
+ let n = new Map(e.map((e) => [e.id, e])), r = e.filter((e) => e.parentId === void 0), i = /* @__PURE__ */ new Map();
23
+ for (let t of e) {
24
+ if (t.parentId === void 0) continue;
25
+ let e = t, r = new Set([e.id]);
26
+ for (; e.parentId !== void 0;) {
27
+ let i = n.get(e.parentId);
28
+ if (!i || r.has(i.id)) {
29
+ e = t;
30
+ break;
31
+ }
32
+ r.add(i.id), e = i;
33
+ }
34
+ if (e.parentId !== void 0 || e === t) continue;
35
+ let a = i.get(e.id) ?? [];
36
+ i.has(e.id) || i.set(e.id, a), a.push(t);
37
+ }
38
+ return r.filter((e) => t || e.resolved !== !0).map((e) => ({
39
+ root: e,
40
+ replies: Object.freeze(i.get(e.id) ?? [])
41
+ }));
42
+ }
43
+ function h(e, t, n) {
44
+ return {
45
+ messageKey: n === 0 ? `${t}:root` : `${t}:reply:${e.id || n - 1}`,
46
+ sourceId: e.id,
47
+ author: e.author,
48
+ date: e.date,
49
+ text: e.paragraphs?.join("\n") ?? e.text,
50
+ status: e.resolved ? "resolved" : "active"
51
+ };
52
+ }
53
+ function g(t, n, r, i, a, o) {
54
+ let s = t.ownerDocument.createElement("div");
55
+ return s.style.cssText = `--ooxml-comment-author-accent:${o};left:${e(n.x, r)};top:${e(n.y, i)};width:${e(n.w, r)};height:${e(n.h, i)};`, s.dataset.ooxmlCommentHighlight = "", s.dataset.active = String(a), n.transform && (s.style.transform = n.transform), t.appendChild(s), s;
56
+ }
57
+ function _(e) {
58
+ let t = e.highlightBounds;
59
+ return {
60
+ ...e,
61
+ x: t?.x ?? e.x,
62
+ y: t?.y ?? e.y,
63
+ w: t?.width ?? e.w,
64
+ h: t?.height ?? e.h
65
+ };
66
+ }
67
+ function v(e) {
68
+ let t = [];
69
+ for (let n of e) {
70
+ let e = t.at(-1);
71
+ if (e && e.y === n.y && e.h === n.h && e.transform === n.transform) {
72
+ let r = Math.min(e.x, n.x), i = Math.max(e.x + e.w, n.x + n.w);
73
+ t[t.length - 1] = {
74
+ ...e,
75
+ x: r,
76
+ w: i - r
77
+ };
78
+ continue;
79
+ }
80
+ t.push({ ...n });
81
+ }
82
+ return t;
83
+ }
84
+ function y(e, t, n, s, c, u, d, f, y, b, x, S = !1, C, w) {
85
+ r(e.ownerDocument), t && (t.dataset.ooxmlCommentZoom = String(y)), e.innerHTML = "";
86
+ let T = m(s.comments, S), E = new Map(T.map((e) => [e.root.id, o(e.root.author)])), D = new Set(T.map((e) => e.root.id)), O = /* @__PURE__ */ new Map();
87
+ for (let e of s.anchors) D.has(e.commentId) && !O.has(e.commentId) && O.set(e.commentId, e);
88
+ let k = p(s.anchors, n), A = new Set(k.map(({ anchor: e }) => e)), j = /* @__PURE__ */ new Map(), M = /* @__PURE__ */ new Map(), N = e.parentElement;
89
+ for (let { anchor: t, runs: n } of k) {
90
+ if (!D.has(t.commentId)) continue;
91
+ let r = d === t.commentId;
92
+ for (let i of v(n.map(_))) {
93
+ let n = g(e, i, c, u, r, E.get(t.commentId) ?? o(void 0)), a = i.transform && N ? l(n, N) : Object.freeze({
94
+ x: i.x,
95
+ y: i.y,
96
+ width: i.w,
97
+ height: i.h
98
+ }), s = j.get(t.commentId) ?? [];
99
+ j.has(t.commentId) || j.set(t.commentId, s);
100
+ let d = a ?? Object.freeze({
101
+ x: i.x,
102
+ y: i.y,
103
+ width: i.w,
104
+ height: i.h
105
+ });
106
+ s.push(d), M.has(t.commentId) || M.set(t.commentId, Object.freeze({
107
+ rect: d,
108
+ ...i.direction ? { direction: i.direction } : {}
109
+ }));
110
+ }
111
+ }
112
+ let P = T.flatMap((e) => {
113
+ let t = O.get(e.root.id);
114
+ return !t || !A.has(t) ? [] : [{
115
+ occurrenceKey: e.root.id,
116
+ root: h(e.root, e.root.id, 0),
117
+ replies: e.replies.map((t, n) => h(t, e.root.id, n + 1))
118
+ }];
119
+ }), F = t ? a(t, P, {
120
+ activeId: d,
121
+ zoom: y,
122
+ logicalWidth: b,
123
+ onSetActive: f,
124
+ onGeometryChange: C,
125
+ onScrollGeometryChange: w,
126
+ preferredTopById: new Map(P.map((e) => {
127
+ let t = j.get(e.occurrenceKey)?.[0];
128
+ return [e.occurrenceKey, t?.y ?? 0];
129
+ }))
130
+ }) : /* @__PURE__ */ new Map();
131
+ if (x) for (let [t, n] of P.entries()) {
132
+ let r = M.get(n.occurrenceKey);
133
+ if (!r) continue;
134
+ let a = i(e.ownerDocument, {
135
+ occurrenceKey: n.occurrenceKey,
136
+ visibleIndex: t,
137
+ author: n.root.author,
138
+ active: d === n.occurrenceKey,
139
+ zoom: y,
140
+ onSetActive: f
141
+ }), o = 24 * y / 2, s = 4 * y, l = e.ownerDocument.defaultView?.getComputedStyle?.(e).direction, p = (r.direction ?? l) === "rtl" ? r.rect.x - s - o : r.rect.x + r.rect.width + s + o, m = Math.max(o, Math.min(p, c - o)), h = Math.max(o, Math.min(r.rect.y + r.rect.height / 2, u - o));
142
+ a.style.left = `${m / c * 100}%`, a.style.top = `${h / u * 100}%`;
143
+ let g = F.get(n.occurrenceKey);
144
+ g?.id && a.setAttribute("aria-controls", g.id), e.appendChild(a);
145
+ }
146
+ if (!C && !w) return Object.freeze({
147
+ threads: Object.freeze(P.map((e) => Object.freeze({
148
+ occurrenceKey: e.occurrenceKey,
149
+ active: d === e.occurrenceKey,
150
+ anchorRects: Object.freeze(j.get(e.occurrenceKey) ?? [])
151
+ }))),
152
+ scrollTop: t?.scrollTop ?? 0
153
+ });
154
+ let I = t && N ? l(t, N) : void 0, L = Object.freeze(P.map((e) => {
155
+ let t = F.get(e.occurrenceKey), n = t && N ? l(t, N) : void 0;
156
+ return Object.freeze({
157
+ occurrenceKey: e.occurrenceKey,
158
+ active: d === e.occurrenceKey,
159
+ anchorRects: Object.freeze(j.get(e.occurrenceKey) ?? []),
160
+ ...n ? { cardRect: n } : {}
161
+ });
162
+ }));
163
+ return Object.freeze({
164
+ threads: L,
165
+ ...I ? { cardClipBounds: I } : {},
166
+ scrollTop: t?.scrollTop ?? 0
167
+ });
168
+ }
169
+ //#endregion
170
+ export { y as buildDocxCommentMargin, u as buildReadOnlyCommentDecoration, f as disposeReadOnlyCommentDecoration, s as disposeReadOnlyCommentMargin, c as previewReadOnlyCommentMargin, d as projectReadOnlyCommentMarginScroll };
@@ -0,0 +1,2 @@
1
+ import { r as e } from "./read-only-comment-margin-plStyGfE-mggNAMB_.js";
2
+ export { e as paintReadOnlyCommentCard };
@@ -0,0 +1,112 @@
1
+ import "./renderer-module-contract-Cu-GKuPd-Bt0YZuzB.js";
2
+ import { D as e } from "./line-distribute-IsUGfHXm-DeITjLzJ.js";
3
+ import { a as t, i as n, n as r, s as i, t as a } from "./read-only-comment-margin-plStyGfE-mggNAMB_.js";
4
+ import { i as o, n as s, r as c, t as l } from "./read-only-comment-decoration-BTnWEeo5-BNhbteYc.js";
5
+ import { t as u } from "./comment-occurrence-CqejEuts-7SeKCBXk.js";
6
+ //#region ../../node_modules/@silurus/ooxml/dist/comment-ui-runtime-lXwVOgjW.js
7
+ function d(e, t, n) {
8
+ return {
9
+ messageKey: `${t}:reply:${e.id ?? n}`,
10
+ sourceId: e.id,
11
+ author: e.author,
12
+ date: e.date,
13
+ text: e.text,
14
+ status: e.status
15
+ };
16
+ }
17
+ function f(i, a, s, c, l, f, p, m, h, g, _, v, y = !1, b, x) {
18
+ t(i.ownerDocument), a && (a.dataset.ooxmlCommentZoom = String(g)), i.replaceChildren();
19
+ let S = s.map((e, t) => ({
20
+ comment: e,
21
+ index: t,
22
+ id: u(e, t, l)
23
+ })).filter(({ comment: e }) => y || e.status !== "resolved" && e.status !== "closed"), C = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), T = new Map(c.map((e) => [e.elementId, e])), E = i.parentElement;
24
+ for (let [t, r] of S.entries()) {
25
+ let { comment: a, id: o } = r, s = (a.anchors ?? []).flatMap((e) => {
26
+ if (e.type !== "drawingElement" && e.type !== "textRange" || !e.elementId) return [];
27
+ let t = T.get(e.elementId);
28
+ return t ? [t] : [];
29
+ });
30
+ if (m === o) for (let t of s) {
31
+ let n = i.ownerDocument.createElement("div");
32
+ n.dataset.ooxmlCommentTarget = o, n.style.cssText = `left:${e(t.bounds.x, f)};top:${e(t.bounds.y, p)};width:${e(t.bounds.width, f)};height:${e(t.bounds.height, p)};border-width:${2 * g}px;transform:rotate(${t.bounds.rotation}deg);`, i.appendChild(n);
33
+ }
34
+ let c = s[0]?.bounds, l = Number.isFinite(a.x) && Number.isFinite(a.y);
35
+ if (!l && !c) continue;
36
+ let u = Math.max(0, Math.min(c ? c.x + (l ? a.x : c.width) : a.x, f)), d = Math.max(0, Math.min(c ? c.y + (l ? a.y : 0) : a.y, p));
37
+ if (C.set(o, Object.freeze({
38
+ x: u / 9525 * g - 24 * g / 2,
39
+ y: d / 9525 * g - 24 * g / 2,
40
+ width: 24 * g,
41
+ height: 24 * g
42
+ })), m === o && s.length === 0 && !v) {
43
+ let t = i.ownerDocument.createElement("div");
44
+ t.dataset.ooxmlCommentTarget = o, t.style.cssText = `left:${e(u, f)};top:${e(d, p)};width:${24 * g}px;height:${24 * g}px;border-width:${2 * g}px;border-radius:50%;transform:translate(-50%,-50%);`, i.appendChild(t);
45
+ }
46
+ if (v) {
47
+ let r = n(i.ownerDocument, {
48
+ occurrenceKey: o,
49
+ visibleIndex: t,
50
+ author: a.author,
51
+ active: m === o,
52
+ zoom: g,
53
+ onSetActive: h
54
+ });
55
+ r.style.left = e(u, f), r.style.top = e(d, p), i.appendChild(r), w.set(o, r);
56
+ }
57
+ }
58
+ let D = S.map(({ comment: e, id: t }) => ({
59
+ occurrenceKey: t,
60
+ root: {
61
+ messageKey: `${t}:root`,
62
+ sourceId: e.id,
63
+ author: e.author,
64
+ date: e.date,
65
+ text: e.text,
66
+ status: e.status
67
+ },
68
+ replies: e.replies?.map((e, n) => d(e, t, n)) ?? []
69
+ })), O = a ? r(a, D, {
70
+ activeId: m,
71
+ zoom: g,
72
+ logicalWidth: _,
73
+ onSetActive: h,
74
+ onGeometryChange: b,
75
+ onScrollGeometryChange: x,
76
+ preferredTopById: new Map(D.map((e) => {
77
+ let t = C.get(e.occurrenceKey);
78
+ return [e.occurrenceKey, t?.y ?? 0];
79
+ }))
80
+ }) : /* @__PURE__ */ new Map();
81
+ for (let e of S) {
82
+ let t = O.get(e.id), n = w.get(e.id);
83
+ t?.id && n && n.setAttribute("aria-controls", t.id);
84
+ }
85
+ if (!b && !x) return Object.freeze({
86
+ threads: Object.freeze(D.map((e) => {
87
+ let t = C.get(e.occurrenceKey);
88
+ return Object.freeze({
89
+ occurrenceKey: e.occurrenceKey,
90
+ active: m === e.occurrenceKey,
91
+ anchorRects: Object.freeze(t ? [t] : [])
92
+ });
93
+ })),
94
+ scrollTop: a?.scrollTop ?? 0
95
+ });
96
+ let k = a && E ? o(a, E) : void 0, A = Object.freeze(D.map((e) => {
97
+ let t = O.get(e.occurrenceKey), n = t && E ? o(t, E) : void 0, r = C.get(e.occurrenceKey);
98
+ return Object.freeze({
99
+ occurrenceKey: e.occurrenceKey,
100
+ active: m === e.occurrenceKey,
101
+ anchorRects: Object.freeze(r ? [r] : []),
102
+ ...n ? { cardRect: n } : {}
103
+ });
104
+ }));
105
+ return Object.freeze({
106
+ threads: A,
107
+ ...k ? { cardClipBounds: k } : {},
108
+ scrollTop: a?.scrollTop ?? 0
109
+ });
110
+ }
111
+ //#endregion
112
+ export { f as buildPptxCommentMargin, s as buildReadOnlyCommentDecoration, l as disposeReadOnlyCommentDecoration, i as disposeReadOnlyCommentMargin, a as previewReadOnlyCommentMargin, c as projectReadOnlyCommentMarginScroll };
@@ -0,0 +1,282 @@
1
+ //#region ../../node_modules/@silurus/ooxml/dist/source-key-Ktb1GRE5.js
2
+ function e(t, n = "$") {
3
+ if (t === null || typeof t == "boolean" || typeof t == "number" || typeof t == "string") return JSON.stringify(t);
4
+ if (Array.isArray(t)) return `[${t.map((t, r) => e(t, `${n}[${r}]`)).join(",")}]`;
5
+ if (typeof t == "object") {
6
+ let r = t;
7
+ return `{${Object.keys(r).sort().map((t) => `${JSON.stringify(t)}:${e(r[t], `${n}.${t}`)}`).join(",")}}`;
8
+ }
9
+ throw TypeError(`Cannot fingerprint ${typeof t} at ${n}`);
10
+ }
11
+ function t(t, n) {
12
+ let r = e(n);
13
+ return `${t}:${encodeURIComponent(r)}`;
14
+ }
15
+ function n(e) {
16
+ return `${e.story}:${encodeURIComponent(e.storyInstance)}:${e.path.join(".")}`;
17
+ }
18
+ function r(e, t, r) {
19
+ if (t.length === 0 || r.length === 0) throw RangeError("Body occurrence identity requires a flow domain and fragment start");
20
+ return [
21
+ "body-occurrence",
22
+ encodeURIComponent(n(e)),
23
+ encodeURIComponent(t),
24
+ encodeURIComponent(r)
25
+ ].join("/");
26
+ }
27
+ function i(e, t) {
28
+ return `image:${n(e)}:${encodeURIComponent(t)}`;
29
+ }
30
+ function a(e, t) {
31
+ return `math:${n(e)}:${encodeURIComponent(t)}`;
32
+ }
33
+ function o(e) {
34
+ return t("chart-resource", e);
35
+ }
36
+ function s(e, t) {
37
+ return `anchor:${n(e)}:${encodeURIComponent(t)}`;
38
+ }
39
+ //#endregion
40
+ //#region ../../node_modules/@silurus/ooxml/dist/comments-CAn2A_Xh.js
41
+ function c(e) {
42
+ if (e === void 0) return;
43
+ let t = e.replace(/^[\t\n\r ]+|[\t\n\r ]+$/g, "");
44
+ if (/^[+-]?\d+$/.test(t)) try {
45
+ return BigInt(t).toString();
46
+ } catch {
47
+ return;
48
+ }
49
+ }
50
+ function l(e) {
51
+ return Object.freeze({
52
+ ...e,
53
+ path: Object.freeze([...e.path])
54
+ });
55
+ }
56
+ function u(e) {
57
+ return Object.freeze({
58
+ source: l(e.source),
59
+ runIndex: e.boundary,
60
+ affinity: e.boundary < e.runCount ? "following" : "preceding"
61
+ });
62
+ }
63
+ function d(e, t) {
64
+ let n = e.runs, r = 0;
65
+ for (let e = 0; e < Math.min(t, n.length); e += 1) n[e]?.type !== "unavailableDrawing" && (r += 1);
66
+ return r;
67
+ }
68
+ function f(e, t, n, r, i = t.boundary) {
69
+ return Object.freeze({
70
+ commentId: e,
71
+ source: l(t.source),
72
+ startRunIndex: t.boundary,
73
+ endRunIndex: i,
74
+ reference: u(n),
75
+ ...r === void 0 ? {} : { geometryFallback: Object.freeze({
76
+ source: l(r.source),
77
+ sourceRunIndex: r.boundary
78
+ }) }
79
+ });
80
+ }
81
+ function p(e, t) {
82
+ let r = e.flatMap(({ paragraph: e, source: r }, i) => {
83
+ let a = d(e, e.runs.length);
84
+ return [...t.get(n(r)) ?? []].sort((e, t) => e - t).map((e) => ({
85
+ paragraphIndex: i,
86
+ source: r,
87
+ boundary: e,
88
+ runCount: a
89
+ }));
90
+ });
91
+ return {
92
+ locations: r,
93
+ paragraphIndices: new Set(r.map(({ paragraphIndex: e }) => e))
94
+ };
95
+ }
96
+ function m(e, t) {
97
+ return e.paragraphIndex - t.paragraphIndex || e.boundary - t.boundary;
98
+ }
99
+ function h(e, t) {
100
+ let n = 0, r = e.length;
101
+ for (; n < r;) {
102
+ let i = n + Math.floor((r - n) / 2);
103
+ m(e[i], t) < 0 ? n = i + 1 : r = i;
104
+ }
105
+ return n;
106
+ }
107
+ function g(e, t) {
108
+ if (t.paragraphIndices.has(e.paragraphIndex)) return;
109
+ let n = h(t.locations, e), r = t.locations[n], i = n > 0 ? t.locations[n - 1] : void 0;
110
+ return u(e).affinity === "following" ? r ?? i : i ?? r;
111
+ }
112
+ function _(e, t, n) {
113
+ let r = /* @__PURE__ */ new Map(), i = /* @__PURE__ */ new Set();
114
+ for (let e of t) {
115
+ let t = c(e);
116
+ t === void 0 || i.has(t) || (r.has(t) ? (r.delete(t), i.add(t)) : r.set(t, e));
117
+ }
118
+ let a = /* @__PURE__ */ new Map();
119
+ for (let [t, { paragraph: n, source: r }] of e.entries()) for (let e of n.commentMarks ?? []) {
120
+ let i = c(e.id);
121
+ if (i === void 0) continue;
122
+ let o = a.get(i) ?? {
123
+ starts: [],
124
+ ends: [],
125
+ references: []
126
+ };
127
+ a.set(i, o);
128
+ let s = {
129
+ paragraphIndex: t,
130
+ source: r,
131
+ boundary: d(n, e.runIndex),
132
+ runCount: d(n, n.runs.length)
133
+ };
134
+ e.kind === "rangeStart" ? o.starts.push(s) : e.kind === "rangeEnd" ? o.ends.push(s) : e.kind === "reference" && o.references.push(s);
135
+ }
136
+ let o = [], s = p(e, n);
137
+ for (let [t, n] of a) {
138
+ let i = r.get(t);
139
+ if (i === void 0 || n.references.length !== 1) continue;
140
+ let a = n.references[0];
141
+ if (n.starts.length > 1 || n.ends.length > 1) continue;
142
+ let c = n.starts.length === 1 ? n.starts[0] : void 0, l = n.ends.length === 1 ? n.ends[0] : void 0;
143
+ if (c && l && (c.paragraphIndex < l.paragraphIndex || c.paragraphIndex === l.paragraphIndex && c.boundary <= l.boundary)) {
144
+ let t = g(c.paragraphIndex === l.paragraphIndex && c.boundary === l.boundary ? c : a, s);
145
+ for (let n = c.paragraphIndex; n <= l.paragraphIndex; n += 1) {
146
+ let r = e[n], s = n === c.paragraphIndex ? c.boundary : 0, u = n === l.paragraphIndex ? l.boundary : d(r.paragraph, r.paragraph.runs.length);
147
+ o.push(f(i, {
148
+ paragraphIndex: n,
149
+ source: r.source,
150
+ boundary: s,
151
+ runCount: d(r.paragraph, r.paragraph.runs.length)
152
+ }, a, t, Math.max(s, u)));
153
+ }
154
+ continue;
155
+ }
156
+ let u = c && n.ends.length === 0 ? c : l && n.starts.length === 0 ? l : void 0;
157
+ if (c && l) continue;
158
+ let p = u ?? a, m = g(p, s);
159
+ o.push(f(i, p, a, m));
160
+ }
161
+ return o;
162
+ }
163
+ function v(e, t, n = /* @__PURE__ */ new Map()) {
164
+ let r = new Set(e.map(({ id: e }) => e)), i = /* @__PURE__ */ new Map();
165
+ for (let e of t.blocks.sources) {
166
+ let n = t.blocks.resolve(e);
167
+ if (n.type !== "paragraph") continue;
168
+ let r = `${e.story}\u0000${e.storyInstance}`, a = i.get(r) ?? [];
169
+ i.has(r) || i.set(r, a), a.push({
170
+ paragraph: n,
171
+ source: e
172
+ });
173
+ }
174
+ return [...i.values()].flatMap((e) => _(e, r, n));
175
+ }
176
+ function y(e, t, r = /* @__PURE__ */ new Map(), i = {}) {
177
+ if ((e?.length ?? 0) === 0) return [];
178
+ let a = v(e ?? [], t, r), o = i.completedSourceKeys;
179
+ return o === void 0 ? a : a.filter((e) => {
180
+ let t = r.get(n(e.source)) ?? /* @__PURE__ */ new Set(), i = e.startRunIndex < e.endRunIndex ? [...t].some((t) => t >= e.startRunIndex && t < e.endRunIndex) : t.has(e.reference.affinity === "following" ? e.startRunIndex : e.startRunIndex - 1), a = r.get(n(e.reference.source))?.has(e.reference.affinity === "following" ? e.reference.runIndex : e.reference.runIndex - 1) === !0;
181
+ return i || a || o.has(n(e.source)) || o.has(n(e.reference.source));
182
+ });
183
+ }
184
+ function b(e, t) {
185
+ return e !== void 0 && e.story === t.story && e.storyInstance === t.storyInstance && e.path.length === t.path.length && e.path.every((e, n) => e === t.path[n]);
186
+ }
187
+ function x(e, t) {
188
+ let n = t.filter((t) => t.sourceRunIndex !== void 0 && b(t.source, e.source)), r = n.filter((t) => t.sourceRunIndex >= e.startRunIndex && t.sourceRunIndex < e.endRunIndex);
189
+ if (r.length > 0) return r;
190
+ if (e.startRunIndex === e.endRunIndex && n.length > 0) {
191
+ let t = n.reduce((t, n) => {
192
+ let r = n.sourceRunIndex;
193
+ return r < e.startRunIndex ? t : t === void 0 || r < t ? r : t;
194
+ }, void 0), r = n.reduce((t, n) => {
195
+ let r = n.sourceRunIndex;
196
+ return r >= e.startRunIndex ? t : t === void 0 || r > t ? r : t;
197
+ }, void 0), i = t ?? r;
198
+ if (i !== void 0) return n.filter((e) => e.sourceRunIndex === i);
199
+ }
200
+ let i = t.filter((t) => t.sourceRunIndex !== void 0 && b(t.source, e.reference.source)), a = i.reduce((t, n) => {
201
+ let r = n.sourceRunIndex;
202
+ return r < e.reference.runIndex ? t : t === void 0 || r < t ? r : t;
203
+ }, void 0), o = i.reduce((t, n) => {
204
+ let r = n.sourceRunIndex;
205
+ return r >= e.reference.runIndex ? t : t === void 0 || r > t ? r : t;
206
+ }, void 0), s = e.reference.affinity === "following" ? a ?? o : o ?? a;
207
+ if (s !== void 0) return i.filter((e) => e.sourceRunIndex === s);
208
+ let c = e.geometryFallback;
209
+ return c === void 0 ? [] : t.filter((e) => e.sourceRunIndex === c.sourceRunIndex && b(e.source, c.source));
210
+ }
211
+ function S(e, t) {
212
+ return t.some((t) => t.sourceRunIndex !== void 0 && b(t.source, e.source) && t.sourceRunIndex >= e.startRunIndex && t.sourceRunIndex < e.endRunIndex) ? "range" : t.some((t) => b(t.source, e.source) || b(t.source, e.reference.source)) ? "point" : "fallback";
213
+ }
214
+ function C(e) {
215
+ let t = e.map((e) => {
216
+ let t = e.highlightBounds;
217
+ return {
218
+ x: t?.x ?? e.x,
219
+ y: t?.y ?? e.y,
220
+ width: t?.width ?? e.w,
221
+ height: t?.height ?? e.h,
222
+ ...e.transform ? { transform: e.transform } : {}
223
+ };
224
+ }).filter(({ width: e, height: t }) => e > 0 && t > 0).sort((e, t) => e.y - t.y || e.x - t.x), n = [];
225
+ for (let e of t) {
226
+ let t = n.at(-1);
227
+ if (t && t.y === e.y && t.height === e.height && t.transform === e.transform) {
228
+ let r = Math.min(t.x, e.x), i = Math.max(t.x + t.width, e.x + e.width);
229
+ n[n.length - 1] = Object.freeze({
230
+ ...t,
231
+ x: r,
232
+ width: i - r
233
+ });
234
+ } else n.push(Object.freeze({ ...e }));
235
+ }
236
+ return Object.freeze(n);
237
+ }
238
+ function w(e, t, r, i = {}) {
239
+ let a = new Map(e.map((e) => [e.id, e])), o = e.filter((e) => e.parentId === void 0), s = new Map(o.map((e) => [e.id, e])), c = /* @__PURE__ */ new Map(), l = new Map(o.map((e) => [e.id, e.id]));
240
+ for (let t of e) {
241
+ if (t.parentId === void 0) continue;
242
+ let e = new Set([t.id]), n = t;
243
+ for (; n.parentId !== void 0;) {
244
+ let r = a.get(n.parentId);
245
+ if (!r || e.has(r.id)) {
246
+ n = t;
247
+ break;
248
+ }
249
+ e.add(r.id), n = r;
250
+ }
251
+ if (!s.has(n.id) || n === t) continue;
252
+ l.set(t.id, n.id);
253
+ let r = c.get(n.id) ?? [];
254
+ c.has(n.id) || c.set(n.id, r), r.push(t);
255
+ }
256
+ let u = /* @__PURE__ */ new Set();
257
+ for (let e of r) e.source && u.add(n(e.source));
258
+ let d = /* @__PURE__ */ new Map();
259
+ for (let e of t) {
260
+ let t = l.get(e.commentId);
261
+ if (t === void 0 || !(u.has(n(e.source)) || u.has(n(e.reference.source)) || e.geometryFallback !== void 0 && u.has(n(e.geometryFallback.source)))) continue;
262
+ let i = x(e, r);
263
+ if (i.length === 0) continue;
264
+ let a = d.get(t) ?? [];
265
+ d.has(t) || d.set(t, a), a.push(Object.freeze({
266
+ anchor: e,
267
+ kind: S(e, i),
268
+ rects: C(i)
269
+ }));
270
+ }
271
+ return Object.freeze(o.flatMap((e) => {
272
+ if (i.includeResolved === !1 && e.resolved === !0) return [];
273
+ let t = d.get(e.id);
274
+ return t?.length ? [Object.freeze({
275
+ root: e,
276
+ replies: Object.freeze([...c.get(e.id) ?? []]),
277
+ anchors: Object.freeze([...t])
278
+ })] : [];
279
+ }));
280
+ }
281
+ //#endregion
282
+ export { a, o as c, t as d, c as i, r as l, y as n, i as o, x as r, n as s, w as t, s as u };
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentCanvas.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentCanvas/AttachmentCanvas.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAuU5E,wGAAwG;AACxG,eAAO,MAAM,gBAAgB,6DAA6B,CAAC"}
1
+ {"version":3,"file":"AttachmentCanvas.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentCanvas/AttachmentCanvas.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAC;AAyU5E,wGAAwG;AACxG,eAAO,MAAM,gBAAgB,6DAA6B,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentCanvasBody.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentCanvasBody/AttachmentCanvasBody.tsx"],"names":[],"mappings":"AAkBA,OAAO,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AA0bhF,uNAAuN;AACvN,eAAO,MAAM,oBAAoB,iEAAiC,CAAC"}
1
+ {"version":3,"file":"AttachmentCanvasBody.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentCanvasBody/AttachmentCanvasBody.tsx"],"names":[],"mappings":"AAkBA,OAAO,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAC;AAochF,uNAAuN;AACvN,eAAO,MAAM,oBAAoB,iEAAiC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"AttachmentCanvasContainer.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentCanvasContainer/AttachmentCanvasContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAqB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EACV,sBAAsB,EAKvB,MAAM,gCAAgC,CAAC;AAKxC,yDAAyD;AACzD,MAAM,WAAW,8BAA8B;IAC7C,8DAA8D;IAC9D,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,mGAAmG;IACnG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sFAAsF;IACtF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uGAAuG;IACvG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;;;;;;;OAUG;IACH,kBAAkB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD;AAED,yFAAyF;AACzF,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC,8BAA8B,CAgItE,CAAC"}
1
+ {"version":3,"file":"AttachmentCanvasContainer.d.ts","sourceRoot":"","sources":["../../../src/components/AttachmentCanvasContainer/AttachmentCanvasContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EACpB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAqB,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,KAAK,EACV,sBAAsB,EAKvB,MAAM,gCAAgC,CAAC;AAKxC,yDAAyD;AACzD,MAAM,WAAW,8BAA8B;IAC7C,8DAA8D;IAC9D,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,mGAAmG;IACnG,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,sFAAsF;IACtF,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,uGAAuG;IACvG,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8EAA8E;IAC9E,cAAc,CAAC,EAAE,cAAc,CAAC;IAChC;;;;;;;;;;OAUG;IACH,kBAAkB,CAAC,EAAE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACjD;AAED,yFAAyF;AACzF,eAAO,MAAM,yBAAyB,EAAE,EAAE,CAAC,8BAA8B,CAkItE,CAAC"}
@@ -1,14 +1,18 @@
1
1
  import { FC } from 'react';
2
2
  import { OoxmlCanvasContent } from '../../models/attachment-canvas';
3
3
  interface OoxmlContentProps {
4
- /** OOXML source and format to render. */
4
+ /** OOXML or CSV source and format to render. */
5
5
  content: OoxmlCanvasContent;
6
6
  /** File name used as the viewer's accessible name. */
7
7
  fileName?: string;
8
- /** Message shown when the OOXML parser or renderer fails. */
8
+ /** Message shown when the document parser or renderer fails. */
9
9
  loadErrorLabel: string;
10
+ /** Accessible label for the panel that shows the active XLSX cell content. */
11
+ formulaLabel: string;
12
+ /** CSS class applied to the decorative `fx` label. */
13
+ formulaLabelClassName: string;
10
14
  }
11
- /** Renders DOCX, XLSX, and PPTX attachments with `@silurus/ooxml`. */
15
+ /** Renders DOCX, XLSX, PPTX, and CSV attachments with `@silurus/ooxml`. */
12
16
  export declare const OoxmlContent: FC<OoxmlContentProps>;
13
17
  export {};
14
18
  //# sourceMappingURL=OoxmlContent.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"OoxmlContent.d.ts","sourceRoot":"","sources":["../../../src/components/OoxmlContent/OoxmlContent.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,KAAK,EAAE,EAA+B,MAAM,OAAO,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AASzE,UAAU,iBAAiB;IACzB,yCAAyC;IACzC,OAAO,EAAE,kBAAkB,CAAC;IAC5B,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,cAAc,EAAE,MAAM,CAAC;CACxB;AA+BD,sEAAsE;AACtE,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CA6F9C,CAAC"}
1
+ {"version":3,"file":"OoxmlContent.d.ts","sourceRoot":"","sources":["../../../src/components/OoxmlContent/OoxmlContent.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,EAAE,EAA+B,MAAM,OAAO,CAAC;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AASzE,UAAU,iBAAiB;IACzB,gDAAgD;IAChD,OAAO,EAAE,kBAAkB,CAAC;IAC5B,sDAAsD;IACtD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gEAAgE;IAChE,cAAc,EAAE,MAAM,CAAC;IACvB,8EAA8E;IAC9E,YAAY,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAgFD,2EAA2E;AAC3E,eAAO,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAqI9C,CAAC"}
@@ -0,0 +1,25 @@
1
+ //#region ../../node_modules/@silurus/ooxml/dist/delimited-text-worker-host-DcHj_JZt.js
2
+ var e = "var e=(e,t)=>()=>(e&&(t=e(e=0)),t),t=class e extends Error{code;constructor(t,n){super(n),this.name=`OoxmlError`,this.code=t,Object.setPrototypeOf(this,e.prototype)}},n=class e extends Error{code=`ooxml-resource-limit`;details;constructor(t,n){super(t),this.name=`OoxmlResourceLimitError`;let r=n.violation,i=Object.freeze({format:r.format,operation:r.operation,resource:r.resource,metric:r.metric,...r.part===void 0?{}:{part:r.part},limit:r.limit,observed:r.observed,configurable:r.configurable,usage:Object.freeze({archiveEntryCount:r.usage.archiveEntryCount,declaredInflatedBytes:r.usage.declaredInflatedBytes,...r.usage.largestInflatedEntryBytes===void 0?{}:{largestInflatedEntryBytes:r.usage.largestInflatedEntryBytes},distinctInflatedBytes:r.usage.distinctInflatedBytes,operationInflatedBytes:r.usage.operationInflatedBytes})});this.details=Object.freeze({stage:n.stage,violation:i}),Object.setPrototypeOf(this,e.prototype)}};function r(e){return e===`image-dimension`||e===`image-pixels`||e===`active-decoded-bytes`}function i(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function a(e){if(!(!e||typeof e!=`object`))try{let t=e,n=t.code,a=t.metric,o=t.limit,s=t.observed;return n!==`ooxml-decoded-image-limit`||!r(a)||!i(o)||!i(s)||s<=o?void 0:{metric:a,limit:o,observed:s}}catch{return}}var o,s,c,l=e((()=>{o=1<<25,s=1<<27,o*4,s*4,c=class e extends RangeError{code=`ooxml-decoded-image-limit`;constructor(t,n,r){super(`OOXML decoded image limit exceeded: ${t} ${r} > ${n}`),this.metric=t,this.limit=n,this.observed=r,this.name=`OoxmlDecodedImageLimitError`,Object.setPrototypeOf(this,e.prototype)}}}));function u(e){if(!(typeof e!=`object`||!e))try{let t=e,n=t.code,r=t.message;return n===`ooxml-tiff-decode`&&typeof r==`string`?{message:r}:void 0}catch{return}}var d=e((()=>{}));function f(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>0}function p(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return f(t.requiredBytes)&&f(t.offeredBytes)&&t.requiredBytes>t.offeredBytes}var m=class e extends RangeError{code=`ooxml-insufficient-credit`;requiredBytes;offeredBytes;constructor(t){super(`Pull unit requires ${t.requiredBytes} bytes but credit is ${t.offeredBytes}`),this.name=`PullSessionInsufficientCreditError`,this.requiredBytes=t.requiredBytes,this.offeredBytes=t.offeredBytes,Object.setPrototypeOf(this,e.prototype)}};function h(e){if(e instanceof m)return e;let t=e instanceof Error?e.message:String(e);if(!t.startsWith(`OOXML_INSUFFICIENT_CREDIT:`))return;let n;try{n=JSON.parse(t.slice(26))}catch{return}if(!n||typeof n!=`object`||Array.isArray(n))return;let r=n;if(!(r.code!==`ooxml-insufficient-credit`||!p(r)))return new m(r)}l(),d();const g=`OOXML_RESOURCE_LIMIT:`;function _(e){return typeof e==`number`&&Number.isSafeInteger(e)&&e>=0}function v(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return _(t.archiveEntryCount)&&_(t.declaredInflatedBytes)&&(t.largestInflatedEntryBytes===void 0||_(t.largestInflatedEntryBytes))&&_(t.distinctInflatedBytes)&&_(t.operationInflatedBytes)}function y(e){return e===`docx`||e===`xlsx`||e===`pptx`}function b(e){return e===`container`||e===`decompression`||e===`parsing`||e===`serialization`||e===`layout`||e===`rendering`||e===`worker`}function x(e,t){return typeof e==`string`&&e.length>0&&e.length<=t&&!/[\\u0000-\\u001f\\u007f]/u.test(e)}function S(e){return x(e,128)&&/^[a-z0-9][a-z0-9-]*$/u.test(e)}function C(e){return!x(e,4096)||e.startsWith(`/`)||e.startsWith(`\\\\`)||e.includes(`\\\\`)||e.includes(`?`)||e.includes(`#`)||e.includes(`://`)||/^[a-z]:/iu.test(e)?!1:e.split(`/`).every(e=>e!==``&&e!==`.`&&e!==`..`)}const w=new Map([[`archive-entry:declared-inflated-bytes`,{stage:`container`,part:`required`}],[`archive-entry:actual-inflated-bytes`,{stage:`decompression`,part:`required`}],[`archive:entry-count`,{stage:`container`,part:`forbidden`}],[`archive:central-directory-bytes`,{stage:`container`,part:`forbidden`,configurable:!1}],[`archive:distinct-inflated-bytes`,{stage:`decompression`,part:`required`}],[`xml-event:bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`xml-context:bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`xml-tree:depth`,{stage:`parsing`,part:`optional`,configurable:!1}],[`worksheet-row:projected-bytes`,{stage:`parsing`,part:`optional`,configurable:!1}],[`worksheet-shell:projected-bytes`,{stage:`parsing`,part:`optional`,configurable:!1}]]),T=new Set([...w.keys()].map(e=>e.slice(0,e.indexOf(`:`)))),E=new Set([...w.keys()].map(e=>e.slice(e.indexOf(`:`)+1)));function D(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;return!y(t.format)||!x(t.operation,256)||!S(t.resource)||!S(t.metric)||!_(t.limit)||!_(t.observed)||typeof t.configurable!=`boolean`||!v(t.usage)?!1:!(`part`in t)||C(t.part)}function O(e){if(!e||typeof e!=`object`||Array.isArray(e))return!1;let t=e;if(!b(t.stage)||!D(t.violation))return!1;let n=t.violation,r=w.get(`${n.resource}:${n.metric}`);return r?t.stage!==r.stage||r.configurable===!1&&n.configurable!==!1?!1:r.part===`required`?n.part!==void 0:r.part===`forbidden`?n.part===void 0:!0:!(T.has(n.resource)&&E.has(n.metric))}function k(e){return{archiveEntryCount:e.archiveEntryCount,declaredInflatedBytes:e.declaredInflatedBytes,...e.largestInflatedEntryBytes===void 0?{}:{largestInflatedEntryBytes:e.largestInflatedEntryBytes},distinctInflatedBytes:e.distinctInflatedBytes,operationInflatedBytes:e.operationInflatedBytes}}function A(e){if(!O(e))return;let t=e.violation,n={stage:e.stage,violation:{format:t.format,operation:t.operation,resource:t.resource,metric:t.metric,...t.part===void 0?{}:{part:t.part},limit:t.limit,observed:t.observed,configurable:t.configurable,usage:k(t.usage)}};return O(n)?n:void 0}function j(e){let t=e.violation;return`OOXML resource limit exceeded${t.part?` for ${t.part}`:``}: ${t.metric} ${t.observed} > ${t.limit}`}function M(e){let t=e instanceof Error?e.message:String(e);if(!t.startsWith(g))return;let r;try{r=JSON.parse(t.slice(21))}catch{return}if(!r||typeof r!=`object`)return;let i=r;if(!(i.code!==`ooxml-resource-limit`||!O(i.details)))return new n(j(i.details),i.details)}function N(e){let r=a(e);if(r){let e=new c(r.metric,r.limit,r.observed);return{message:e.message,errorName:e.name,code:e.code,decodedImage:r}}let i=u(e);if(i)return{message:i.message,errorName:`TiffDecodeError`,code:`ooxml-tiff-decode`};let o=h(e);if(o)return{message:o.message,errorName:o.name,code:o.code,insufficientCredit:{requiredBytes:o.requiredBytes,offeredBytes:o.offeredBytes}};let s=e instanceof t||e instanceof n?e:M(e);if(s instanceof n){let e=A(s.details);return e?{message:typeof s.message==`string`?s.message:j(e),errorName:`OoxmlResourceLimitError`,code:`ooxml-resource-limit`,resourceLimit:e}:{message:`Invalid OOXML resource-limit error payload`,errorName:`Error`}}if(s instanceof t)return{message:typeof s.message==`string`?s.message:String(s.message),errorName:x(s.name,128)?s.name:`OoxmlError`,...S(s.code)?{code:s.code}:{}};let l=e instanceof Error?e.message:String(e);if(typeof l==`string`&&l.startsWith(g))return{message:`Invalid OOXML resource-limit payload`,errorName:`Error`};let d=e instanceof Error?e:Error(l),f=d;return{message:typeof d.message==`string`?d.message:String(d.message),errorName:x(d.name,128)?d.name:`Error`,...typeof f.code==`string`?{code:f.code}:{}}}function P(e){try{return N(e)}catch{return{message:`Worker operation failed with an unreadable error`,errorName:`Error`}}}function F(e,t){if(!Number.isSafeInteger(e)||e<0)throw Error(`${t} must be a non-negative safe integer`)}function I(e,t,n){return F(e,`resource measurement`),F(t,`resource measurement`),F(n,`resource measurement limit`),e>n||t>n||t>n-e?n===2**53-1?n:n+1:e+t}function L(e,t=2**53-1){F(t,`resource measurement limit`);let n=0;for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r),a;if(i<=127)a=1;else if(i<=2047)a=2;else if(i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);t>=56320&&t<=57343?(a=4,r+=1):a=3}else a=3;if(n=I(n,a,t),n>t)return n}return n}function R(e,t=2**53-1){F(t,`resource measurement limit`);let n=I(0,2,t);if(n>t)return n;for(let r=0;r<e.length;r+=1){let i=e.charCodeAt(r),a;if(i===34||i===92||i===8||i===9||i===10||i===12||i===13)a=2;else if(i<=31)a=6;else if(i<=127)a=1;else if(i<=2047)a=2;else if(i>=55296&&i<=56319&&r+1<e.length){let t=e.charCodeAt(r+1);t>=56320&&t<=57343?(a=4,r+=1):a=6}else a=i>=55296&&i<=57343?6:3;if(n=I(n,a,t),n>t)return n}return n}function z(e,t){return I(0,e,t)}function B(e,t=2**53-1,n=!1){if(F(t,`resource measurement limit`),e===null)return{jsonBytes:z(4,t),stringValueUtf8Bytes:0};if(typeof e==`string`)return{jsonBytes:R(e,t),stringValueUtf8Bytes:L(e,t)};if(typeof e==`boolean`)return{jsonBytes:z(e?4:5,t),stringValueUtf8Bytes:0};if(typeof e==`number`)return{jsonBytes:z((Number.isFinite(e)?String(Object.is(e,-0)?0:e):`null`).length,t),stringValueUtf8Bytes:0};if(typeof e==`bigint`)throw TypeError(`BigInt values cannot be serialized to JSON`);if(Array.isArray(e)){let n=z(2,t),r=0;for(let i=0;i<e.length;i+=1){i!==0&&(n=I(n,1,t));let a=B(e[i],t,!0);n=I(n,a.jsonBytes,t),r=I(r,a.stringValueUtf8Bytes,t)}return{jsonBytes:n,stringValueUtf8Bytes:r}}if(typeof e==`object`){let n=z(2,t),r=0,i=0;for(let[a,o]of Object.entries(e)){if(o===void 0||typeof o==`function`||typeof o==`symbol`)continue;i++!==0&&(n=I(n,1,t)),n=I(n,R(a,t),t),n=I(n,1,t);let e=B(o,t);n=I(n,e.jsonBytes,t),r=I(r,e.stringValueUtf8Bytes,t)}return{jsonBytes:n,stringValueUtf8Bytes:r}}return{jsonBytes:n?z(4,t):0,stringValueUtf8Bytes:0}}const V=1e5,H=25e4,U=33554432,W=67108864,G=Object.freeze({archiveEntryCount:0,declaredInflatedBytes:0,distinctInflatedBytes:0,operationInflatedBytes:0});function K(e){let t=e.reduce((e,t)=>I(e,t.cells.length,H),0);return{rows:e.length,cells:t,ownedUtf8Bytes:e.reduce((e,t)=>t.cells.reduce((e,t)=>{let n=B(t.value,U).stringValueUtf8Bytes;return I(e,I(n,t.formula===void 0?0:L(t.formula,U),U),U)},e),0)}}function q(e){return J(e,K(e.rows))}function J(e,t){let n=B(e,67108864);return{...t,jsonBytes:n.jsonBytes}}function Y(e,t,r,i,a,o,s){let c=r===`worksheet-json`?`serialization`:`parsing`;return new n(`OOXML resource limit exceeded${t?` for ${t}`:``}: ${i} ${o} > ${a}`,{stage:c,violation:{format:`xlsx`,operation:e,resource:r,metric:i,...t===void 0?{}:{part:t},limit:a,observed:Math.min(o,a+1),configurable:!1,usage:s??G}})}function X(e,t,n,r){let i=[[`rows`,e.rows,V],[`cells`,e.cells,H],[`owned-utf8-bytes`,e.ownedUtf8Bytes,U]];for(let[e,a,o]of i)if(a>o)throw Y(t,n,e===`owned-utf8-bytes`?`worksheet-cell-content`:`worksheet-model`,e,o,a,r)}function Z(e,t,n,r){if(e>W)throw Y(t,n,`worksheet-json`,`bytes`,W,e,r)}const Q=`load-delimited-text`,$=W;function ee(e){if(e>$)throw Y(Q,void 0,`delimited-text-source`,`bytes`,$,e)}const te=Object.freeze({fonts:[Object.freeze({bold:!1,italic:!1,underline:!1,strike:!1,size:11,color:null,name:`Calibri`})],fills:[Object.freeze({patternType:`none`,fgColor:null,bgColor:null})],borders:[Object.freeze({left:null,right:null,top:null,bottom:null})],cellXfs:[Object.freeze({fontId:0,fillId:0,borderId:0,numFmtId:0,alignH:null,alignV:null,wrapText:!1})],numFmts:[],dxfs:[]});function ne(e,t){ee(e.byteLength);let n;try{n=new TextDecoder(t.encoding,{fatal:!0}).decode(e)}catch(e){throw TypeError(`Delimited text could not be decoded as ${t.encoding}`,{cause:e})}let r=[],i=[],a=``,o,s=1,c=1,l=0,u=0,d=!1,f=!1,p=e=>{a+=e,a.length>=4096&&((o??=[]).push(a),a=``)},m=()=>{if(l++,l>H)throw Y(Q,void 0,`worksheet-model`,`cells`,H,l);if(c>16384)throw RangeError(`Delimited text row ${s} has more than 16384 columns`);let e=o?o.join(``)+a:a;if(e!==``){if(u+=L(e,U+1),u>U)throw Y(Q,void 0,`worksheet-cell-content`,`owned-utf8-bytes`,U,u);i.push({row:s,col:c,value:{type:`text`,text:e}})}a=``,o=void 0,c++,f=!1},h=()=>{if(s>V)throw Y(Q,void 0,`worksheet-model`,`rows`,V,s);r.push({index:s,height:null,cells:i}),i=[],s++,c=1};for(let e=0;e<n.length;e++){let r=n[e];if(d){if(r!==`\"`){r===`\\r`?(p(`\n`),n[e+1]===`\n`&&e++):p(r);continue}n[e+1]===`\"`?(p(`\"`),e++):(d=!1,f=!0);continue}if(f){if(r!==t.delimiter&&r!==`\\r`&&r!==`\n`)throw SyntaxError(`Unexpected character after closing quote at row ${s}, column ${c}`)}else if(r===`\"`&&a===``&&o===void 0){d=!0;continue}if(r===t.delimiter){m();continue}if(r===`\\r`||r===`\n`){m(),h(),r===`\\r`&&n[e+1]===`\n`&&e++;continue}p(r)}if(d)throw SyntaxError(`Unterminated quoted field at row ${s}, column ${c}`);let g=n.endsWith(`\n`)||n.endsWith(`\\r`);n.length>0&&!g&&(m(),h());let _={name:t.sheetName,rows:r,colWidths:{},rowHeights:{},defaultColWidth:8.43,defaultRowHeight:15,mergeCells:[],freezeRows:0,freezeCols:0,conditionalFormats:[],images:[],charts:[],defaultFontFamily:`Calibri`,defaultFontSize:11},v=q(_);return X(v,Q,void 0),Z(v.jsonBytes,Q,void 0),{workbook:{workbook:{sheets:[{name:t.sheetName,sheetId:1,rId:`rId1`}]},styles:te,sharedStrings:[]},worksheet:_}}self.onmessage=e=>{let t=e.data;try{let{workbook:e,worksheet:n}=ne(t.data,t.options),r=new TextEncoder().encode(JSON.stringify(n)).buffer,i={type:`delimitedTextParsed`,id:t.id,workbook:e,worksheetJson:r};self.postMessage(i,[r])}catch(e){let n={type:`error`,id:t.id,...P(e)};self.postMessage(n)}};", t = typeof self < "u" && self.Blob && new Blob(["URL.revokeObjectURL(import.meta.url);", e], { type: "text/javascript;charset=utf-8" });
3
+ function n(n) {
4
+ let r;
5
+ try {
6
+ if (r = t && (self.URL || self.webkitURL).createObjectURL(t), !r) throw "";
7
+ let e = new Worker(r, {
8
+ type: "module",
9
+ name: n?.name
10
+ });
11
+ return e.addEventListener("error", () => {
12
+ (self.URL || self.webkitURL).revokeObjectURL(r);
13
+ }), e;
14
+ } catch {
15
+ return new Worker("data:text/javascript;charset=utf-8," + encodeURIComponent(e), {
16
+ type: "module",
17
+ name: n?.name
18
+ });
19
+ }
20
+ }
21
+ function r() {
22
+ return new n();
23
+ }
24
+ //#endregion
25
+ export { r as createDelimitedTextWorker };