@sheetxl/io-xlsx 0.8.0-beta.14 → 0.8.0-beta.16

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 (57) hide show
  1. package/LICENSE.md +8 -7
  2. package/browser/esm/BQaNticMfvf7-y0L.mjs +2474 -0
  3. package/browser/esm/{DbygDdjktfjoU4DI.mjs → BalqIL4s8nR3NbK8.mjs} +2528 -1702
  4. package/browser/esm/{Bs0IJqyry5ZycCBU.mjs → BiueQ3eVPDOEdEeL.mjs} +1321 -1087
  5. package/browser/esm/{CIRY1QIACITHu_lA.mjs → BtLo1V0gnJ3ktOw9.mjs} +2 -2
  6. package/browser/esm/{QuYxg3ec6kN-djPF.mjs → C3H8HKjSun-wLDrE.mjs} +5 -5
  7. package/browser/esm/{DN7ig6HovGU5gMbr.mjs → CCGqD5BzdZMq2pTI.mjs} +2 -2
  8. package/browser/esm/{BjkdoGjLpkKUlK5q.mjs → DT-3sV5qGuHTFmnB.mjs} +3295 -2163
  9. package/browser/esm/{DiNNY0EgHikWbrDz.mjs → W3dYk6brWDUtMZca.mjs} +3 -3
  10. package/browser/esm/{DAYdoS9sLmYf8kzD.mjs → X5YJn8ZwrgDKMwwO.mjs} +3 -3
  11. package/browser/esm/{Cs4lg7bxClbTkldF.mjs → ekV6d7YNDF6FkKLw.mjs} +423 -318
  12. package/browser/esm/{DKWU_JYjVmtOzTGr.mjs → idgOmd_zpVTKLyek.mjs} +3 -3
  13. package/browser/esm/index.mjs +3 -3
  14. package/node/esm/{TPq4Re0SQgONsX_u.mjs → BO8o53Yo-gLFNELS.mjs} +3 -3
  15. package/node/esm/{CvcAx132Yp5uUDUB.mjs → BT0HKieizRDqDegH.mjs} +440 -330
  16. package/node/esm/BmIrpH_719z1aqvw.mjs +2562 -0
  17. package/node/esm/CJYMs5EGkLOZKyF0.mjs +4676 -0
  18. package/node/esm/{H9egT6kWCw8RAf76.mjs → CZsPzV1CsMPKiICx.mjs} +2 -2
  19. package/node/esm/CdFqKswnjeM_u8-g.mjs +7242 -0
  20. package/node/esm/CnYiZh1EVKY4BNVs.mjs +6851 -0
  21. package/node/esm/{CkenuXqno-ffP331.mjs → OO5K_WYvAj-UV14K.mjs} +3 -3
  22. package/node/esm/index.mjs +5 -5
  23. package/package.json +4 -4
  24. package/types/src/AutoFilterRules.d.ts +26 -4
  25. package/types/src/OOXMLExtensions.d.ts +12 -1
  26. package/types/src/pivot/PivotArea.d.ts +20 -0
  27. package/types/src/pivot/PivotCacheRead.d.ts +30 -0
  28. package/types/src/pivot/PivotCacheWrite.d.ts +23 -0
  29. package/types/src/pivot/PivotFilters.d.ts +29 -0
  30. package/types/src/pivot/PivotFormats.d.ts +60 -0
  31. package/types/src/pivot/PivotTableRead.d.ts +44 -0
  32. package/types/src/pivot/PivotTableWrite.d.ts +13 -0
  33. package/types/src/pivot/_PivotCacheXml.d.ts +48 -0
  34. package/types/src/pivot/_PivotTableXml.d.ts +23 -0
  35. package/types/src/reader/PivotButtons.d.ts +14 -0
  36. package/types/src/reader/PivotCellFormats.d.ts +22 -0
  37. package/types/src/reader/SlicerJoin.d.ts +6 -4
  38. package/types/src/reader/_SlicerRecord.d.ts +22 -0
  39. package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +5 -0
  40. package/types/src/reader/domVisitors/SlicerCacheDefinitionVisitor.d.ts +6 -2
  41. package/types/src/reader/domVisitors/SlicersVisitor.d.ts +2 -0
  42. package/types/src/reader/domVisitors/TimelinesVisitor.d.ts +13 -0
  43. package/types/src/reader/domVisitors/index.d.ts +2 -0
  44. package/types/src/writer/EvaluationSheet.d.ts +5 -0
  45. package/types/src/writer/builder/Types.d.ts +13 -0
  46. package/types/src/writer/emitters/PivotTableEmitter.d.ts +30 -1
  47. package/types/src/writer/emitters/SlicerEmitter.d.ts +81 -18
  48. package/types/src/writer/emitters/StylesEmitter.d.ts +32 -1
  49. package/types/src/writer/emitters/WorkbookEmitter.d.ts +19 -2
  50. package/types/src/writer/utils/DateSystem.d.ts +6 -0
  51. package/types/src/writer/utils/XfVariants.d.ts +61 -0
  52. package/browser/esm/Bomb4K5f16UyiyED.mjs +0 -2265
  53. package/node/esm/BCSJ_kqVLXkZlYh3.mjs +0 -5693
  54. package/node/esm/BCXSNXHvNQ9JQMLE.mjs +0 -6367
  55. package/node/esm/BycDf9HTtfpzL-zt.mjs +0 -2346
  56. package/node/esm/CTdvEKRTM-W1L1KU.mjs +0 -4437
  57. package/types/src/writer/utils/HiddenFormulaXfs.d.ts +0 -28
@@ -1,2346 +0,0 @@
1
- /**
2
- * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.14
3
- *
4
- * (C) 2026-present SheetXL Inc. & Michael T. Ford
5
- * License: The license can be found at https://www.sheetxl.com/license.
6
- */
7
- import { Color as t, IFill as e, IFontStyle as n } from "@sheetxl/sdk";
8
- var r = [
9
- "customMenu",
10
- "description",
11
- "help",
12
- "statusBar",
13
- "shortcutKey"
14
- ], s = [
15
- "function",
16
- "vbProcedure",
17
- "xlm",
18
- "publishToServer",
19
- "workbookParameter"
20
- ], i = /<!\[CDATA\[([\s\S]*?)\]\]>|<!--[\s\S]*?-->|<\?[\s\S]*?\?>|<!DOCTYPE[^>]*>|<(\/?)([^\s/>]+)((?:\s+[^\s=/>]+\s*=\s*(?:"[^"]*"|'[^']*'))*)\s*(\/?)>|([^<]+)/g, o = {
21
- amp: "&",
22
- lt: "<",
23
- gt: ">",
24
- quot: "\"",
25
- apos: "'"
26
- }, a = (t) => -1 === t.indexOf("&") ? t : t.replace(/&(#x[0-9a-fA-F]+|#\d+|\w+);/g, (t, e) => {
27
- if ("#" !== e[0]) return o[e] ?? t;
28
- const n = "x" === e[1] ? parseInt(e.slice(2), 16) : parseInt(e.slice(1), 10);
29
- return Number.isFinite(n) ? String.fromCodePoint(n) : t;
30
- }), l = (t) => {
31
- const e = t.indexOf(":");
32
- return -1 === e ? t : t.slice(e + 1);
33
- }, d = (t) => {
34
- const e = {
35
- name: "",
36
- qname: "",
37
- attrs: "",
38
- children: [],
39
- start: 0,
40
- end: t.length,
41
- contentStart: 0,
42
- contentEnd: t.length
43
- }, n = [e];
44
- i.lastIndex = 0;
45
- for (let e = i.exec(t); e; e = i.exec(t)) {
46
- const t = n[n.length - 1];
47
- if (void 0 !== e[1]) t.children.push(e[1]);
48
- else if (void 0 !== e[6]) t.children.push(a(e[6]));
49
- else if (void 0 !== e[3]) {
50
- if (e[2]) {
51
- if (n.length > 1) {
52
- const t = n.pop();
53
- t.contentEnd = e.index, t.end = e.index + e[0].length;
54
- }
55
- continue;
56
- }
57
- const r = e.index + e[0].length, s = {
58
- name: l(e[3]),
59
- qname: e[3],
60
- attrs: e[4] ?? "",
61
- children: [],
62
- start: e.index,
63
- end: r,
64
- contentStart: r,
65
- contentEnd: r
66
- };
67
- t.children.push(s), e[5] || n.push(s);
68
- }
69
- }
70
- return e.children.find((t) => "string" != typeof t) ?? null;
71
- }, c = (t) => t.children.filter((t) => "string" != typeof t), u = (t) => {
72
- let e = "";
73
- for (const n of t.children) "string" == typeof n && (e += n);
74
- return e;
75
- }, p = "http://schemas.openxmlformats.org/drawingml/2006/chart", f = "http://purl.oclc.org/ooxml/drawingml/chart", m = "http://schemas.openxmlformats.org/drawingml/2006/main", h = "http://purl.oclc.org/ooxml/drawingml/main", b = "http://schemas.openxmlformats.org/officeDocument/2006/relationships", g = "http://schemas.microsoft.com/office/drawing/2012/chart", y = "http://schemas.microsoft.com/office/drawing/2014/chartex", v = "http://www.w3.org/XML/1998/namespace", x = {
76
- c: "c",
77
- a: "a",
78
- r: "r",
79
- c15: "c15",
80
- cx: "cx"
81
- }, w = (t) => t === p || t === f, k = (t) => t === m || t === h, S = (t) => t === y, L = Object.freeze({ xml: v }), P = /([^\s=]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g, C = (t) => {
82
- const e = [];
83
- P.lastIndex = 0;
84
- for (let n = P.exec(t.attrs); n; n = P.exec(t.attrs)) e.push([n[1], a(n[2] ?? n[3] ?? "")]);
85
- return e;
86
- }, T = (t, e) => {
87
- let n = null;
88
- for (const [r, s] of C(t)) "xmlns" === r ? (n ??= { ...e })[""] = s : r.startsWith("xmlns:") && ((n ??= { ...e })[r.slice(6)] = s);
89
- return n ?? e;
90
- }, I = (t, e) => e[((t) => {
91
- const e = t.indexOf(":");
92
- return -1 === e ? "" : t.slice(0, e);
93
- })(t.qname)], D = class {
94
- constructor() {
95
- this._parts = [];
96
- }
97
- open(t, e, n = !1) {
98
- let r = "<" + t;
99
- if (e) for (const [t, n] of e) r += ` ${t}="${N(n)}"`;
100
- return this._parts.push(r + (n ? "/>" : ">")), this;
101
- }
102
- close(t) {
103
- return this._parts.push(`</${t}>`), this;
104
- }
105
- val(t, e) {
106
- return this.open(t, [["val", e]], !0);
107
- }
108
- text(t) {
109
- return this._parts.push(((t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;"))(t)), this;
110
- }
111
- raw(t) {
112
- return this._parts.push(t), this;
113
- }
114
- toString() {
115
- return this._parts.join("");
116
- }
117
- }, N = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/"/g, "&quot;"), $ = (t) => "1" === t || "true" === t || "0" !== t && "false" !== t && null, O = (t) => t ? "1" : "0", j = /^[-+]?(?:\d+\.?\d*|\.\d+)(?:[eE][-+]?\d+)?$/, F = (t) => {
118
- const e = $(t);
119
- return null !== e ? O(e) : j.test(t) ? String(Number(t)) : t;
120
- }, M = /* @__PURE__ */ new Set([
121
- "date1904",
122
- "roundedCorners",
123
- "autoTitleDeleted",
124
- "plotVisOnly",
125
- "showDLblsOverMax",
126
- "varyColors",
127
- "marker",
128
- "smooth",
129
- "invertIfNegative",
130
- "bubble3D",
131
- "delete",
132
- "showLegendKey",
133
- "showVal",
134
- "showCatName",
135
- "showSerName",
136
- "showPercent",
137
- "showBubbleSize",
138
- "showLeaderLines",
139
- "overlay",
140
- "rAngAx",
141
- "showHorzBorder",
142
- "showVertBorder",
143
- "showOutline",
144
- "showKeys",
145
- "auto",
146
- "noMultiLvlLbl",
147
- "wireframe",
148
- "showNegBubbles",
149
- "autoUpdate",
150
- "applyToFront",
151
- "applyToSides",
152
- "applyToEnd",
153
- "chartObject",
154
- "data",
155
- "formatting",
156
- "selection",
157
- "userInterface"
158
- ]), R = (t, e, n = !1) => {
159
- const r = T(t, e), s = I(t, r) ?? "", i = [];
160
- for (const [e, n] of C(t)) {
161
- if ("xmlns" === e || e.startsWith("xmlns:")) continue;
162
- const t = e.indexOf(":"), s = -1 === t ? e : `{${r[e.slice(0, t)] ?? e.slice(0, t)}}${e.slice(t + 1)}`;
163
- i.push(`${s}=${JSON.stringify(F(n))}`);
164
- }
165
- const o = c(t), a = 0 === o.length ? t.children.join("") : "";
166
- 0 === i.length && 0 === o.length && "" === a && w(s) && M.has(t.name) && i.push("val=\"1\""), i.sort();
167
- let l = `<{${s}}${t.name}${i.length ? " " + i.join(" ") : ""}>`;
168
- if (o.length > 0) {
169
- const e = [];
170
- for (const s of t.children) "string" == typeof s ? "" !== s.trim() && e.push(JSON.stringify(s)) : e.push(R(s, r, n));
171
- n && e.sort(), l += e.join("");
172
- } else "" !== a && (l += JSON.stringify(a));
173
- return l + "</>";
174
- }, A = class {
175
- constructor(t, e) {
176
- this.xml = t, this.rootScope = e, this.kept = 0, this.reordered = 0;
177
- const n = Object.values(e).find(w) ?? p, r = k(e[x.a]) ? e[x.a] : m;
178
- this.writeScope = {
179
- ...e,
180
- [x.c]: n,
181
- [x.cx]: y,
182
- [x.a]: r,
183
- [x.r]: e[x.r] ?? b
184
- };
185
- }
186
- markupOf(t, e) {
187
- let n = this.xml.slice(t.start, t.end);
188
- const r = new Set(C(t).map(([t]) => t).filter((t) => "xmlns" === t || t.startsWith("xmlns:")));
189
- let s = "";
190
- for (const t of Object.keys(e)) "xml" !== t && e[t] !== this.rootScope[t] && (r.has("" === t ? "xmlns" : `xmlns:${t}`) || (s += "" === t ? ` xmlns="${e[t]}"` : ` xmlns:${t}="${e[t]}"`));
191
- if (s) {
192
- const e = 1 + t.qname.length;
193
- n = n.slice(0, e) + s + n.slice(e);
194
- }
195
- return n;
196
- }
197
- }, U = (t, e) => {
198
- switch (t) {
199
- case "c": return w(e);
200
- case "c15": return e === g;
201
- case "cx": return S(e);
202
- default: return k(e);
203
- }
204
- }, W = (t, e, n, r) => {
205
- const s = T(t, n), i = {};
206
- let o, a;
207
- for (const [n, r] of C(t)) {
208
- const t = e.attributes?.find((t) => t.name === n), s = t ? t.read(r) : void 0;
209
- t && void 0 !== s && F(t.write(s)) === F(r) ? i[t.key] = s : (o ??= {})[n] = r;
210
- }
211
- let l = -1, d = "";
212
- const u = {};
213
- for (const n of c(t)) {
214
- const t = T(n, s), o = I(n, t), c = e.fields.findIndex((t) => t.tags.includes(n.name) && U(t.ns, o)), p = -1 === c ? null : e.fields[c], f = p && !p.many ? p.get ? p.get(i) : i[p.key] : void 0, m = c > l || c === l && !!p?.many;
215
- if (p && void 0 === f && (m || !p.many)) {
216
- const e = p.read(n, t, r);
217
- if (void 0 !== e) {
218
- p.many ? (i[p.key] ??= []).push(e) : p.set ? p.set(i, e) : i[p.key] = e, u[p.key] = (u[p.key] ?? 0) + 1, m ? (l = c, d = n.name) : r.reordered++;
219
- continue;
220
- }
221
- }
222
- const h = -1 === l ? null : e.fields[l], b = {
223
- after: d,
224
- xml: r.markupOf(n, s)
225
- };
226
- h?.many && (b.at = u[h.key]), (a ??= []).push(b);
227
- }
228
- return (o || a) && (i.unknown = {}, a && (i.unknown.elements = a), o && (i.unknown.attributes = o)), e.afterRead?.(i, t, s, r), i;
229
- }, B = (t, e, n, r) => {
230
- const s = [];
231
- for (const t of r.attributes ?? []) {
232
- const e = n[t.key];
233
- void 0 !== e && s.push([t.name, t.write(e)]);
234
- }
235
- const i = n.unknown;
236
- if (i?.attributes) for (const t of Object.keys(i.attributes)) s.push([t, i.attributes[t]]);
237
- for (const t of r.declares?.(n) ?? []) s.some(([e]) => e === t[0]) || s.push(t);
238
- const o = new D(), a = i?.elements ? [...i.elements] : [], l = (t) => {
239
- for (let e = 0; e < a.length; e++) t(a[e]) && (o.raw(a[e].xml), a.splice(e--, 1));
240
- };
241
- l((t) => "" === t.after);
242
- for (const t of r.fields) {
243
- const e = t.get ? t.get(n) : n[t.key], r = (e) => t.tags.includes(e.after);
244
- if (t.many) {
245
- const n = e ?? [];
246
- for (let e = 0; e < n.length; e++) t.write(o, n[e]), l((t) => r(t) && t.at === e + 1);
247
- } else void 0 !== e && t.write(o, e);
248
- l(r);
249
- }
250
- l(() => !0);
251
- const d = o.toString();
252
- "" === d ? t.open(e, s, !0) : t.open(e, s).raw(d).close(e);
253
- }, E = (t, e) => `${x[t]}:${e}`, z = (t, e, n = t, r = "c") => ({
254
- tags: [t],
255
- key: n,
256
- ns: r,
257
- read: (t) => {
258
- const n = ((t) => {
259
- if (c(t).length > 0) return;
260
- let e = null;
261
- for (const [n, r] of C(t)) {
262
- if ("val" !== n) return;
263
- e = r;
264
- }
265
- return e;
266
- })(t);
267
- if (void 0 === n) return;
268
- if ("bool" === e) return null === n || ($(n) ?? void 0);
269
- if (null === n) return;
270
- if ("str" === e) return n;
271
- const r = Number(n);
272
- return Number.isFinite(r) && ("int" !== e || Number.isInteger(r)) && F(String(r)) === F(n) ? r : void 0;
273
- },
274
- write: (n, s) => {
275
- n.val(E(r, t), "bool" === e ? O(s) : String(s));
276
- }
277
- }), H = (t, e = t, n = "c") => ({
278
- tags: [t],
279
- key: e,
280
- ns: n,
281
- read: (t) => {
282
- if (!(c(t).length > 0 || C(t).some(([t]) => !t.startsWith("xmlns")))) return u(t);
283
- },
284
- write: (e, r) => {
285
- const s = E(n, t);
286
- "" === r ? e.open(s, null, !0) : e.open(s).text(r).close(s);
287
- }
288
- }), V = (t, e, n = t, r) => {
289
- const s = r?.ns ?? "c", i = "function" == typeof e ? e : () => e;
290
- return {
291
- tags: [t],
292
- key: n,
293
- ns: s,
294
- many: r?.many,
295
- read: (t, e, n) => W(t, i(), e, n),
296
- write: (e, n) => B(e, E(s, t), n, i())
297
- };
298
- }, q = (t, e, n = t, r = 1) => ({
299
- name: t,
300
- key: n,
301
- read: (t) => {
302
- if ("str" === e) return t;
303
- if ("bool" === e) return $(t) ?? void 0;
304
- const n = Number(t);
305
- return Number.isFinite(n) && ("int" !== e || Number.isInteger(n)) ? 1 === r ? n : n / r : void 0;
306
- },
307
- write: (t) => "bool" === e ? O(t) : "str" === e ? t : String(1 === r ? t : Math.round(t * r))
308
- }), G = (t, e, n, r) => ({
309
- name: t,
310
- key: e,
311
- read: n,
312
- write: r
313
- }), J = (t) => ({
314
- ...t,
315
- read: (e, n, r) => {
316
- const s = t.read(e, n, r);
317
- if (void 0 === s) return;
318
- const i = new D();
319
- t.write(i, s);
320
- const o = ((t, e) => {
321
- const n = d(t);
322
- return n ? R(n, e) : null;
323
- })(i.toString(), r.writeScope) === R(e, n);
324
- return o || r.kept++, o ? s : void 0;
325
- }
326
- }), _ = (t) => `a:${t}`, K = /* @__PURE__ */ new Set([
327
- "bg1",
328
- "tx1",
329
- "bg2",
330
- "tx2",
331
- "accent1",
332
- "accent2",
333
- "accent3",
334
- "accent4",
335
- "accent5",
336
- "accent6",
337
- "hlink",
338
- "folHlink",
339
- "phClr",
340
- "dk1",
341
- "lt1",
342
- "dk2",
343
- "lt2"
344
- ]), X = /* @__PURE__ */ new Set([
345
- "scrollBar",
346
- "background",
347
- "activeCaption",
348
- "inactiveCaption",
349
- "menu",
350
- "window",
351
- "windowFrame",
352
- "menuText",
353
- "windowText",
354
- "captionText",
355
- "activeBorder",
356
- "inactiveBorder",
357
- "appWorkspace",
358
- "highlight",
359
- "highlightText",
360
- "btnFace",
361
- "btnShadow",
362
- "grayText",
363
- "btnText",
364
- "inactiveCaptionText",
365
- "btnHighlight",
366
- "3dDkShadow",
367
- "3dLight",
368
- "infoText",
369
- "infoBk",
370
- "hotLight",
371
- "gradientActiveCaption",
372
- "gradientInactiveCaption",
373
- "menuHighlight",
374
- "menuBar"
375
- ]), Y = [
376
- "scrgbClr",
377
- "srgbClr",
378
- "hslClr",
379
- "sysClr",
380
- "schemeClr",
381
- "prstClr"
382
- ], Q = (t) => "hue" === t || "hueOff" === t || "hueMod" === t ? 6e4 : "alpha" === t || "alphaOff" === t || "alphaMod" === t ? 1e5 : 1e3, Z = (t, e) => {
383
- const n = {};
384
- for (const [r, s] of C(t)) {
385
- if (!e.includes(r)) return null;
386
- n[r] = s;
387
- }
388
- return n;
389
- }, tt = /^-?\d+$/, et = (t) => {
390
- const e = c(t);
391
- return 0 === e.length ? null : e.length > 1 || !Y.includes(e[0].name) ? void 0 : ((t) => {
392
- let e;
393
- switch (t.name) {
394
- case "scrgbClr": {
395
- const n = Z(t, [
396
- "r",
397
- "g",
398
- "b"
399
- ]);
400
- if (!(n && tt.test(n.r ?? "") && tt.test(n.g ?? "") && tt.test(n.b ?? ""))) return;
401
- e = `lrgb(${Number(n.r) / 1e3},${Number(n.g) / 1e3},${Number(n.b) / 1e3})`;
402
- break;
403
- }
404
- case "hslClr": {
405
- const n = Z(t, [
406
- "hue",
407
- "sat",
408
- "lum"
409
- ]);
410
- if (!(n && tt.test(n.hue ?? "") && tt.test(n.sat ?? "") && tt.test(n.lum ?? ""))) return;
411
- e = `hsl(${Number(n.hue) / 6e4},${Number(n.sat) / 1e3},${Number(n.lum) / 1e3})`;
412
- break;
413
- }
414
- case "sysClr": {
415
- const n = Z(t, ["val", "lastClr"]);
416
- if (!n?.val || !X.has(n.val)) return;
417
- e = void 0 !== n.lastClr ? `${n.val} lastClr ${n.lastClr}` : n.val;
418
- break;
419
- }
420
- default: {
421
- const n = Z(t, ["val"]);
422
- if (!n?.val || /\s/.test(n.val)) return;
423
- if ((K.has(n.val) ? "schemeClr" : /^[0-9A-Fa-f]{6}$/.test(n.val) ? "srgbClr" : "prstClr") !== t.name) return;
424
- e = n.val;
425
- }
426
- }
427
- for (const n of c(t)) {
428
- if (c(n).length > 0) return;
429
- const t = Z(n, ["val"]);
430
- if (!t) return;
431
- if (void 0 !== t.val) {
432
- if (!tt.test(t.val)) return;
433
- e += ` ${n.name} ${Number(t.val) / Q(n.name)}`;
434
- } else e += ` ${n.name}`;
435
- }
436
- return e;
437
- })(e[0]);
438
- }, nt = /^-?(?:\d+\.?\d*|\.\d+)(?:e[-+]?\d+)?$/i, rt = (e, n) => {
439
- const r = ((t) => {
440
- const e = t.trim(), n = /^[a-z]+\([^)]*\)|^[^\s,]+/i.exec(e)?.[0] ?? e, r = e.slice(n.length).split(/\s*,\s*|\s+/).filter((t) => "" !== t);
441
- return [n.replace(/\s+/g, ""), ...r];
442
- })(n), s = r.shift();
443
- let i, o;
444
- const a = /^(lrgb|hsl)\(([^,]+),([^,]+),([^)]+)\)$/.exec(s);
445
- if ("lrgb" === a?.[1]) i = "scrgbClr", o = [
446
- ["r", String(Math.round(1e3 * Number(a[2])))],
447
- ["g", String(Math.round(1e3 * Number(a[3])))],
448
- ["b", String(Math.round(1e3 * Number(a[4])))]
449
- ];
450
- else if ("hsl" === a?.[1]) i = "hslClr", o = [
451
- ["hue", String(Math.round(6e4 * Number(a[2])))],
452
- ["sat", String(Math.round(1e3 * Number(a[3])))],
453
- ["lum", String(Math.round(1e3 * Number(a[4])))]
454
- ];
455
- else if ("lastClr" === r[0] || X.has(s)) i = "sysClr", o = [["val", s]], "lastClr" === r[0] && (r.shift(), o.push(["lastClr", r.shift()]));
456
- else {
457
- const e = ((e) => {
458
- if (K.has(e) || /^[0-9A-Fa-f]{6}$/.test(e) || /^[a-z]+$/i.test(e)) return null;
459
- let n;
460
- try {
461
- n = new t(e);
462
- } catch {
463
- return null;
464
- }
465
- const r = n.getType();
466
- return "hex" === r || "rgb" === r || "hsl" === r ? n.toHex().toString(!1).replace("#", "").toUpperCase() : null;
467
- })(s);
468
- i = e ? "srgbClr" : K.has(s) ? "schemeClr" : /^[0-9A-Fa-f]{6}$/.test(s) ? "srgbClr" : "prstClr", o = [["val", e ?? s]];
469
- }
470
- if (0 !== r.length) {
471
- e.open(_(i), o);
472
- for (let t = 0; t < r.length; t++) {
473
- const n = r[t];
474
- t + 1 < r.length && nt.test(r[t + 1]) ? e.val(_(n), String(Math.round(Number(r[++t]) * Q(n)))) : e.open(_(n), null, !0);
475
- }
476
- e.close(_(i));
477
- } else e.open(_(i), o, !0);
478
- }, st = (t, e, n, r) => {
479
- void 0 === n ? t.open(_(e), r, !0) : (t.open(_(e), r), rt(t, n), t.close(_(e)));
480
- }, it = [
481
- "noFill",
482
- "solidFill",
483
- "gradFill",
484
- "pattFill",
485
- "grpFill"
486
- ], ot = (t) => {
487
- const e = Z(t, [
488
- "l",
489
- "t",
490
- "r",
491
- "b"
492
- ]);
493
- if (!e) return;
494
- const n = {};
495
- return void 0 !== e.l && (n.left = Number(e.l) / 1e3), void 0 !== e.t && (n.top = Number(e.t) / 1e3), void 0 !== e.r && (n.right = Number(e.r) / 1e3), void 0 !== e.b && (n.bottom = Number(e.b) / 1e3), n;
496
- }, at = (t, e, n) => {
497
- const r = [];
498
- void 0 !== n.left && r.push(["l", String(Math.round(1e3 * n.left))]), void 0 !== n.top && r.push(["t", String(Math.round(1e3 * n.top))]), void 0 !== n.right && r.push(["r", String(Math.round(1e3 * n.right))]), void 0 !== n.bottom && r.push(["b", String(Math.round(1e3 * n.bottom))]), t.open(_(e), r, !0);
499
- }, lt = (t) => {
500
- switch (t.name) {
501
- case "noFill": return 0 === c(t).length && 0 === C(t).length ? { type: e.Type.None } : void 0;
502
- case "grpFill": return 0 === c(t).length && 0 === C(t).length ? { type: e.Type.Group } : void 0;
503
- case "solidFill": {
504
- if (C(t).length > 0) return;
505
- const n = et(t);
506
- if (void 0 === n) return;
507
- return null === n ? { type: e.Type.Solid } : {
508
- type: e.Type.Solid,
509
- color: n
510
- };
511
- }
512
- case "gradFill": return ((t) => {
513
- const n = Z(t, ["rotWithShape", "flip"]);
514
- if (!n) return;
515
- const r = { type: e.Type.Gradient };
516
- if (void 0 !== n.rotWithShape) {
517
- const t = $(n.rotWithShape);
518
- if (null === t) return;
519
- r.isRotatedWithShape = t;
520
- }
521
- void 0 !== n.flip && (r.flip = n.flip);
522
- for (const n of c(t)) if ("gsLst" === n.name) {
523
- const t = [];
524
- for (const e of c(n)) {
525
- const n = "gs" === e.name ? Z(e, ["pos"]) : null, r = n && tt.test(n.pos ?? "") ? et(e) : void 0;
526
- if (!r) return;
527
- t.push({
528
- offset: Number(n.pos) / 1e5,
529
- color: r
530
- });
531
- }
532
- r.stops = t;
533
- } else if ("lin" === n.name) {
534
- const t = Z(n, ["ang", "scaled"]);
535
- if (!t || c(n).length > 0) return;
536
- if (r.gradientType = e.GradientType.Linear, void 0 !== t.ang) {
537
- if (!tt.test(t.ang)) return;
538
- r.angle = (Number(t.ang) / 6e4 + 90) % 360;
539
- }
540
- if (void 0 !== t.scaled) {
541
- const e = $(t.scaled);
542
- if (null === e) return;
543
- r.scaled = e;
544
- }
545
- } else if ("path" === n.name) {
546
- const t = Z(n, ["path"]);
547
- if (!t) return;
548
- r.gradientType = "circle" === t.path ? e.GradientType.Path : t.path;
549
- const s = c(n);
550
- if (s.length > 1 || 1 === s.length && "fillToRect" !== s[0].name) return;
551
- if (1 === s.length) {
552
- const t = ot(s[0]);
553
- if (!t) return;
554
- r.focus = {
555
- left: (t.left ?? 0) / 100,
556
- top: (t.top ?? 0) / 100,
557
- right: 1 - (t.right ?? 0) / 100,
558
- bottom: 1 - (t.bottom ?? 0) / 100
559
- };
560
- }
561
- } else {
562
- if ("tileRect" !== n.name) return;
563
- {
564
- const t = ot(n);
565
- if (!t) return;
566
- r.tileRect = t;
567
- }
568
- }
569
- return r;
570
- })(t);
571
- case "pattFill": {
572
- const n = Z(t, ["prst"]);
573
- if (!n) return;
574
- const r = { type: e.Type.Pattern };
575
- void 0 !== n.prst && (r.patternType = n.prst);
576
- for (const e of c(t)) {
577
- const t = "fgClr" === e.name || "bgClr" === e.name ? et(e) : void 0;
578
- if (!t) return;
579
- "fgClr" === e.name ? r.foreground = t : r.background = t;
580
- }
581
- return r;
582
- }
583
- }
584
- }, dt = (t, n) => {
585
- switch (n.type) {
586
- case e.Type.None:
587
- t.open(_("noFill"), null, !0);
588
- return;
589
- case e.Type.Group:
590
- t.open(_("grpFill"), null, !0);
591
- return;
592
- case e.Type.Solid:
593
- st(t, "solidFill", n.color);
594
- return;
595
- case e.Type.Gradient:
596
- ((t, n) => {
597
- const r = [];
598
- if (void 0 !== n.flip && r.push(["flip", n.flip]), void 0 !== n.isRotatedWithShape && r.push(["rotWithShape", O(n.isRotatedWithShape)]), t.open(_("gradFill"), r), n.stops) {
599
- t.open(_("gsLst"));
600
- for (const e of n.stops) {
601
- const { offset: n, color: r } = "string" == typeof e ? {
602
- offset: 0,
603
- color: e
604
- } : e;
605
- st(t, "gs", r, [["pos", String(Math.round(1e5 * (n ?? 0)))]]);
606
- }
607
- t.close(_("gsLst"));
608
- }
609
- if (n.gradientType === e.GradientType.Linear) {
610
- const e = [];
611
- void 0 !== n.angle && e.push(["ang", String(Math.round((n.angle - 90 + 360) % 360 * 6e4))]), void 0 !== n.scaled && e.push(["scaled", O(n.scaled)]), t.open(_("lin"), e, !0);
612
- } else if (void 0 !== n.gradientType) {
613
- const r = n.gradientType === e.GradientType.Path ? "circle" : n.gradientType;
614
- n.focus ? (t.open(_("path"), [["path", r]]), at(t, "fillToRect", {
615
- left: 100 * n.focus.left,
616
- top: 100 * n.focus.top,
617
- right: 100 * (1 - n.focus.right),
618
- bottom: 100 * (1 - n.focus.bottom)
619
- }), t.close(_("path"))) : t.open(_("path"), [["path", r]], !0);
620
- }
621
- n.tileRect && at(t, "tileRect", n.tileRect), t.close(_("gradFill"));
622
- })(t, n);
623
- return;
624
- case e.Type.Pattern: {
625
- const e = n, r = void 0 !== e.patternType ? [["prst", e.patternType]] : [];
626
- void 0 === e.foreground && void 0 === e.background ? t.open(_("pattFill"), r, !0) : (t.open(_("pattFill"), r), void 0 !== e.foreground && st(t, "fgClr", e.foreground), void 0 !== e.background && st(t, "bgClr", e.background), t.close(_("pattFill")));
627
- return;
628
- }
629
- }
630
- throw new Error(`A chart cannot write a fill of type '${n.type}'.`);
631
- }, ct = (t) => J({
632
- tags: it,
633
- key: t,
634
- ns: "a",
635
- read: (t) => lt(t),
636
- write: (t, e) => dt(t, e)
637
- }), ut = {
638
- tags: ["effectLst"],
639
- key: "effects",
640
- ns: "a",
641
- read: (t) => 0 === c(t).length && 0 === C(t).length ? [] : void 0,
642
- write: (t, e) => {
643
- if (e.length > 0) throw new Error("A chart cannot write effects yet.");
644
- t.open(_("effectLst"), null, !0);
645
- }
646
- }, pt = {
647
- rnd: "round",
648
- flat: "butt",
649
- sq: "square"
650
- }, ft = (t, e) => ({
651
- tags: [t],
652
- key: `${e}Type`,
653
- ns: "a",
654
- read: (t) => {
655
- const e = Z(t, [
656
- "type",
657
- "w",
658
- "len"
659
- ]);
660
- if (e && !(c(t).length > 0) && 0 !== Object.keys(e).length) return e;
661
- },
662
- write: (e, n) => {
663
- const r = [];
664
- for (const t of [
665
- "type",
666
- "w",
667
- "len"
668
- ]) void 0 !== n[t] && r.push([t, n[t]]);
669
- e.open(_(t), r, !0);
670
- },
671
- get: (t) => {
672
- const n = {};
673
- return void 0 !== t[`${e}Type`] && (n.type = t[`${e}Type`]), void 0 !== t[`${e}Width`] && (n.w = t[`${e}Width`]), void 0 !== t[`${e}Length`] && (n.len = t[`${e}Length`]), Object.keys(n).length > 0 ? n : void 0;
674
- },
675
- set: (t, n) => {
676
- void 0 !== n.type && (t[`${e}Type`] = n.type), void 0 !== n.w && (t[`${e}Width`] = n.w), void 0 !== n.len && (t[`${e}Length`] = n.len);
677
- }
678
- }), mt = {
679
- attributes: [
680
- q("w", "int", "width", 12700),
681
- G("cap", "lineCap", (t) => pt[t], (t) => Object.keys(pt).find((e) => pt[e] === t)),
682
- q("cmpd", "str", "compound"),
683
- q("algn", "str", "align")
684
- ],
685
- fields: [
686
- ct("fill"),
687
- {
688
- tags: ["prstDash", "custDash"],
689
- key: "dash",
690
- ns: "a",
691
- read: (t) => {
692
- if ("prstDash" === t.name) {
693
- const e = Z(t, ["val"]);
694
- return void 0 !== e?.val && 0 === c(t).length ? e.val : void 0;
695
- }
696
- if (C(t).length > 0) return;
697
- const e = [];
698
- for (const n of c(t)) {
699
- const t = "ds" === n.name ? Z(n, ["d", "sp"]) : null;
700
- if (!t || !tt.test(t.d ?? "") || !tt.test(t.sp ?? "")) return;
701
- e.push(Number(t.d) / 1e3, Number(t.sp) / 1e3);
702
- }
703
- return e;
704
- },
705
- write: (t, e) => {
706
- if ("string" != typeof e) {
707
- t.open(_("custDash"));
708
- for (let n = 0; n < e.length; n += 2) t.open(_("ds"), [["d", String(Math.round(1e3 * e[n]))], ["sp", String(Math.round(1e3 * e[n + 1]))]], !0);
709
- t.close(_("custDash"));
710
- } else t.val(_("prstDash"), e);
711
- }
712
- },
713
- {
714
- tags: [
715
- "round",
716
- "bevel",
717
- "miter"
718
- ],
719
- key: "lineJoin",
720
- ns: "a",
721
- read: (t) => {
722
- const e = Z(t, "miter" === t.name ? ["lim"] : []);
723
- if (e && !(c(t).length > 0) && (void 0 === e.lim || tt.test(e.lim))) return {
724
- join: t.name,
725
- limit: void 0 !== e.lim ? Number(e.lim) / 1e5 : void 0
726
- };
727
- },
728
- write: (t, e) => {
729
- t.open(_(e.join), void 0 !== e.limit ? [["lim", String(Math.round(1e5 * e.limit))]] : null, !0);
730
- },
731
- get: (t) => t.lineJoin ? {
732
- join: t.lineJoin,
733
- limit: t.miterLimit
734
- } : void 0,
735
- set: (t, e) => {
736
- t.lineJoin = e.join, void 0 !== e.limit && (t.miterLimit = e.limit);
737
- }
738
- },
739
- ft("headEnd", "head"),
740
- ft("tailEnd", "tail")
741
- ]
742
- }, ht = (t) => J(V("ln", mt, t, { ns: "a" })), bt = { fields: [
743
- ct("fill"),
744
- ht("stroke"),
745
- ut
746
- ] }, gt = (t, e, r) => ({
747
- tags: [t],
748
- key: e,
749
- ns: "a",
750
- read: (t) => {
751
- const e = Z(t, ["typeface"]);
752
- if (!(void 0 === e?.typeface || c(t).length > 0)) return r && e.typeface === `+mn-${r}` ? n.ThemeFamily.Body : r && e.typeface === `+mj-${r}` ? n.ThemeFamily.Heading : e.typeface;
753
- },
754
- write: (e, s) => {
755
- const i = r ? s === n.ThemeFamily.Body ? `+mn-${r}` : s === n.ThemeFamily.Heading ? `+mj-${r}` : s : s;
756
- e.open(_(t), [["typeface", i]], !0);
757
- }
758
- }), yt = (t, e, n) => {
759
- const r = Object.fromEntries(Object.entries(n).map(([t, e]) => [e, t]));
760
- return G(t, e, (t) => r[t], (t) => n[t] ?? t);
761
- }, vt = {
762
- attributes: [
763
- q("lang", "str", "language"),
764
- q("altLang", "str", "alternateLanguage"),
765
- q("sz", "int", "size", 100),
766
- G("b", "weight", (t) => {
767
- const e = $(t);
768
- return null === e ? void 0 : e ? 700 : 400;
769
- }, (t) => O(t >= 600)),
770
- G("i", "style", (t) => {
771
- const e = $(t);
772
- return null === e ? void 0 : e ? "italic" : "normal";
773
- }, (t) => O("italic" === t)),
774
- yt("u", "underline", {
775
- none: "none",
776
- words: "words",
777
- single: "sng",
778
- double: "dbl",
779
- heavy: "heavy",
780
- dotted: "dotted",
781
- dottedHeavy: "dottedHeavy",
782
- dash: "dash",
783
- dashHeavy: "dashHeavy",
784
- dashLong: "dashLong",
785
- dashLongHeavy: "dashLongHeavy",
786
- dotDash: "dotDash",
787
- dotDashHeavy: "dotDashHeavy",
788
- dotDotDash: "dotDotDash",
789
- dotDotDashHeavy: "dotDotDashHeavy",
790
- wavy: "wavy",
791
- wavyHeavy: "wavyHeavy",
792
- wavyDouble: "wavyDbl"
793
- }),
794
- yt("strike", "strike", {
795
- none: "noStrike",
796
- single: "sngStrike",
797
- double: "dblStrike"
798
- }),
799
- q("kern", "int", "kerning", 100),
800
- yt("cap", "capitals", {
801
- none: "none",
802
- small: "small",
803
- all: "all"
804
- }),
805
- q("spc", "int", "letterSpacing", 100),
806
- q("normalizeH", "bool", "normalizeHeight"),
807
- q("baseline", "int", "baseline", 1e3)
808
- ],
809
- fields: [
810
- ht("outline"),
811
- ct("color"),
812
- ut,
813
- gt("latin", "latin", "lt"),
814
- gt("ea", "eastAsian", "ea"),
815
- gt("cs", "complexScript", "cs"),
816
- gt("sym", "symbol")
817
- ]
818
- }, xt = {
819
- attributes: [q("algn", "str", "align"), q("rtl", "bool", "rtl")],
820
- fields: [V("defRPr", vt, "defaultRun", { ns: "a" })]
821
- }, wt = { fields: [V("rPr", vt, "rPr", { ns: "a" }), {
822
- tags: ["t"],
823
- key: "text",
824
- ns: "a",
825
- read: (t) => {
826
- if (c(t).length > 0) return;
827
- let e = !1;
828
- for (const [n, r] of C(t)) if ("xmlns" !== n && !n.startsWith("xmlns:")) {
829
- if ("xml:space" !== n || "preserve" !== r) return;
830
- e = !0;
831
- }
832
- return {
833
- text: u(t),
834
- preserve: e
835
- };
836
- },
837
- get: (t) => void 0 === t.text ? void 0 : {
838
- text: t.text,
839
- preserve: !0 === t.preserveSpace
840
- },
841
- set: (t, e) => {
842
- t.text = e.text, e.preserve && (t.preserveSpace = !0);
843
- },
844
- write: (t, e) => {
845
- const n = _("t"), r = e.preserve ? [["xml:space", "preserve"]] : null;
846
- "" === e.text ? t.open(n, r, !0) : t.open(n, r).text(e.text).close(n);
847
- }
848
- }] }, kt = {
849
- attributes: [q("id", "str", "id"), q("type", "str", "type")],
850
- fields: wt.fields
851
- }, St = { fields: [V("rPr", vt, "rPr", { ns: "a" })] }, Lt = { fields: [
852
- V("pPr", xt, "pPr", { ns: "a" }),
853
- {
854
- tags: [
855
- "r",
856
- "br",
857
- "fld"
858
- ],
859
- key: "runs",
860
- ns: "a",
861
- many: !0,
862
- read: (t, e, n) => {
863
- if ("br" === t.name) return {
864
- ...W(t, St, e, n),
865
- text: "\n",
866
- break: !0
867
- };
868
- if ("r" === t.name) {
869
- const r = W(t, wt, e, n);
870
- return void 0 === r.text ? void 0 : r;
871
- }
872
- const { id: r, type: s, ...i } = W(t, kt, e, n);
873
- return void 0 !== r ? (i.text ??= "", i.field = void 0 === s ? { id: r } : {
874
- id: r,
875
- type: s
876
- }, i) : void 0;
877
- },
878
- write: (t, e) => {
879
- if (e.break) {
880
- const { text: n, break: r, ...s } = e;
881
- B(t, _("br"), s, St);
882
- } else if (e.field) {
883
- const { field: n, ...r } = e;
884
- B(t, _("fld"), {
885
- ...r,
886
- id: n.id,
887
- type: n.type
888
- }, kt);
889
- } else B(t, _("r"), e, wt);
890
- }
891
- },
892
- V("endParaRPr", vt, "endRun", { ns: "a" })
893
- ] }, Ct = { fields: [
894
- V("bodyPr", {
895
- attributes: [
896
- q("rot", "int", "rotation", 6e4),
897
- q("spcFirstLastPara", "bool", "spcFirstLastPara"),
898
- q("vertOverflow", "str", "vertOverflow"),
899
- q("horzOverflow", "str", "horzOverflow"),
900
- q("vert", "str", "vert"),
901
- q("wrap", "str", "wrap"),
902
- q("lIns", "int", "lIns"),
903
- q("tIns", "int", "tIns"),
904
- q("rIns", "int", "rIns"),
905
- q("bIns", "int", "bIns"),
906
- q("anchor", "str", "anchor"),
907
- q("anchorCtr", "bool", "anchorCtr")
908
- ],
909
- fields: []
910
- }, "bodyPr", { ns: "a" }),
911
- V("lstStyle", { fields: [] }, "lstStyle", { ns: "a" }),
912
- V("p", Lt, "paragraphs", {
913
- ns: "a",
914
- many: !0
915
- })
916
- ] }, Tt = () => V("spPr", bt), It = () => V("txPr", Ct), Dt = {
917
- attributes: [q("idx", "int"), q("formatCode", "str")],
918
- fields: [H("v")]
919
- }, Nt = { fields: [
920
- H("formatCode"),
921
- z("ptCount", "int"),
922
- V("pt", Dt, "points", { many: !0 })
923
- ] }, $t = { fields: [z("ptCount", "int"), V("pt", Dt, "points", { many: !0 })] }, Ot = { fields: [z("ptCount", "int"), V("lvl", { fields: [V("pt", Dt, "points", { many: !0 })] }, "levels", { many: !0 })] }, jt = { fields: [H("f"), V("numCache", Nt, "cache")] }, Ft = { fields: [H("f"), V("strCache", $t, "cache")] }, Mt = { fields: [H("f"), V("multiLvlStrCache", Ot, "cache")] }, Rt = V("datalabelsRange", { fields: [H("f", "f", "c15"), V("dlblRangeCache", $t, "cache", { ns: "c15" })] }, "datalabelsRange", { ns: "c15" }), At = {
924
- ...Rt,
925
- read: (t, e, n) => e[x.c15] === g ? Rt.read(t, e, n) : void 0
926
- }, Ut = z("showDataLabelsRange", "bool", "showDataLabelsRange", "c15"), Wt = {
927
- ...Ut,
928
- read: (t, e, n) => e[x.c15] === g ? Ut.read(t, e, n) : void 0
929
- }, Et = { fields: [V("ext", {
930
- attributes: [q("uri", "str")],
931
- fields: [At, Wt],
932
- declares: (t) => void 0 !== t.datalabelsRange || void 0 !== t.showDataLabelsRange ? [[`xmlns:${x.c15}`, g]] : []
933
- }, "extensions", { many: !0 })] }, zt = { fields: [
934
- V("multiLvlStrRef", Mt),
935
- V("numRef", jt),
936
- V("numLit", Nt),
937
- V("strRef", Ft),
938
- V("strLit", $t)
939
- ] }, Ht = { fields: [V("strRef", Ft), H("v")] }, Vt = { fields: [V("strRef", Ft), V("rich", Ct)] }, qt = {
940
- attributes: [q("formatCode", "str"), q("sourceLinked", "bool")],
941
- fields: []
942
- }, Jt = { fields: [V("manualLayout", { fields: [
943
- z("layoutTarget", "str"),
944
- z("xMode", "str"),
945
- z("yMode", "str"),
946
- z("wMode", "str"),
947
- z("hMode", "str"),
948
- z("x", "num"),
949
- z("y", "num"),
950
- z("w", "num"),
951
- z("h", "num")
952
- ] })] }, _t = { fields: [
953
- V("tx", Vt),
954
- V("layout", Jt),
955
- z("overlay", "bool"),
956
- Tt(),
957
- It()
958
- ] }, Kt = { fields: [Tt()] }, Xt = { fields: [
959
- z("symbol", "str"),
960
- z("size", "int"),
961
- Tt()
962
- ] }, Yt = { fields: [
963
- z("idx", "int"),
964
- z("invertIfNegative", "bool"),
965
- V("marker", Xt),
966
- z("bubble3D", "bool"),
967
- z("explosion", "int"),
968
- Tt()
969
- ] }, Qt = () => [
970
- V("numFmt", qt),
971
- Tt(),
972
- It(),
973
- z("dLblPos", "str"),
974
- z("showLegendKey", "bool"),
975
- z("showVal", "bool"),
976
- z("showCatName", "bool"),
977
- z("showSerName", "bool"),
978
- z("showPercent", "bool"),
979
- z("showBubbleSize", "bool"),
980
- H("separator")
981
- ], te = { fields: [
982
- V("dLbl", { fields: [
983
- z("idx", "int"),
984
- z("delete", "bool"),
985
- V("layout", Jt),
986
- V("tx", Vt),
987
- ...Qt(),
988
- V("extLst", Et)
989
- ] }, "labels", { many: !0 }),
990
- z("delete", "bool"),
991
- ...Qt(),
992
- z("showLeaderLines", "bool"),
993
- V("leaderLines", Kt),
994
- V("extLst", Et)
995
- ] }, ee = { fields: [
996
- V("layout", Jt),
997
- V("tx", Vt),
998
- V("numFmt", qt),
999
- Tt(),
1000
- It()
1001
- ] }, ne = { fields: [
1002
- H("name"),
1003
- Tt(),
1004
- z("trendlineType", "str"),
1005
- z("order", "int"),
1006
- z("period", "int"),
1007
- z("forward", "num"),
1008
- z("backward", "num"),
1009
- z("intercept", "num"),
1010
- z("dispRSqr", "bool"),
1011
- z("dispEq", "bool"),
1012
- V("trendlineLbl", ee)
1013
- ] }, re = { fields: [
1014
- z("errDir", "str"),
1015
- z("errBarType", "str"),
1016
- z("errValType", "str"),
1017
- z("noEndCap", "bool"),
1018
- V("plus", zt),
1019
- V("minus", zt),
1020
- z("val", "num"),
1021
- Tt(),
1022
- V("extLst", Et)
1023
- ] }, se = { fields: [
1024
- z("gapWidth", "int"),
1025
- V("upBars", Kt),
1026
- V("downBars", Kt)
1027
- ] }, ie = () => [
1028
- z("idx", "int"),
1029
- z("order", "int"),
1030
- V("tx", Ht),
1031
- Tt()
1032
- ], oe = () => V("dPt", Yt, "points", { many: !0 }), ae = () => V("dLbls", te), le = () => V("trendline", ne, "trendlines", { many: !0 }), de = () => V("errBars", re, "errBars", { many: !0 }), ce = (t) => V(t, zt), ue = () => V("extLst", Et), pe = {
1033
- bar: { fields: [
1034
- ...ie(),
1035
- z("invertIfNegative", "bool"),
1036
- oe(),
1037
- ae(),
1038
- le(),
1039
- de(),
1040
- ce("cat"),
1041
- ce("val"),
1042
- z("shape", "str"),
1043
- ue()
1044
- ] },
1045
- line: { fields: [
1046
- ...ie(),
1047
- V("marker", Xt),
1048
- oe(),
1049
- ae(),
1050
- le(),
1051
- de(),
1052
- ce("cat"),
1053
- ce("val"),
1054
- z("smooth", "bool"),
1055
- ue()
1056
- ] },
1057
- area: { fields: [
1058
- ...ie(),
1059
- oe(),
1060
- ae(),
1061
- le(),
1062
- de(),
1063
- ce("cat"),
1064
- ce("val"),
1065
- ue()
1066
- ] },
1067
- pie: { fields: [
1068
- ...ie(),
1069
- z("explosion", "int"),
1070
- oe(),
1071
- ae(),
1072
- ce("cat"),
1073
- ce("val"),
1074
- ue()
1075
- ] },
1076
- scatter: { fields: [
1077
- ...ie(),
1078
- V("marker", Xt),
1079
- oe(),
1080
- ae(),
1081
- le(),
1082
- de(),
1083
- ce("xVal"),
1084
- ce("yVal"),
1085
- z("smooth", "bool"),
1086
- ue()
1087
- ] },
1088
- bubble: { fields: [
1089
- ...ie(),
1090
- z("invertIfNegative", "bool"),
1091
- oe(),
1092
- ae(),
1093
- le(),
1094
- de(),
1095
- ce("xVal"),
1096
- ce("yVal"),
1097
- ce("bubbleSize"),
1098
- z("bubble3D", "bool"),
1099
- ue()
1100
- ] },
1101
- radar: { fields: [
1102
- ...ie(),
1103
- V("marker", Xt),
1104
- oe(),
1105
- ae(),
1106
- ce("cat"),
1107
- ce("val"),
1108
- ue()
1109
- ] },
1110
- surface: { fields: [
1111
- ...ie(),
1112
- ce("cat"),
1113
- ce("val"),
1114
- ue()
1115
- ] }
1116
- }, fe = (t) => V("ser", pe[t], "series", { many: !0 }), me = () => ({
1117
- ...z("axId", "int", "axIds"),
1118
- many: !0
1119
- }), he = (t, e) => V(t, Kt, t, { many: e }), be = {
1120
- tags: ["custSplit"],
1121
- key: "custSplit",
1122
- ns: "c",
1123
- read: (t, e, n) => {
1124
- const r = W(t, { fields: [{
1125
- ...z("secondPiePt", "int", "points"),
1126
- many: !0
1127
- }] }, e, n);
1128
- return r.unknown ? void 0 : r.points ?? [];
1129
- },
1130
- write: (t, e) => {
1131
- B(t, "c:custSplit", { points: e }, { fields: [{
1132
- ...z("secondPiePt", "int", "points"),
1133
- many: !0
1134
- }] });
1135
- }
1136
- }, ge = { fields: [z("idx", "int"), Tt()] }, ye = {
1137
- tags: ["bandFmts"],
1138
- key: "bandFmts",
1139
- ns: "c",
1140
- read: (t, e, n) => {
1141
- const r = W(t, { fields: [V("bandFmt", ge, "formats", { many: !0 })] }, e, n);
1142
- return r.unknown ? void 0 : r.formats ?? [];
1143
- },
1144
- write: (t, e) => {
1145
- B(t, "c:bandFmts", { formats: e }, { fields: [V("bandFmt", ge, "formats", { many: !0 })] });
1146
- }
1147
- }, ve = {
1148
- areaChart: {
1149
- type: "area",
1150
- codec: { fields: [
1151
- z("grouping", "str"),
1152
- z("varyColors", "bool"),
1153
- fe("area"),
1154
- ae(),
1155
- he("dropLines"),
1156
- me()
1157
- ] }
1158
- },
1159
- area3DChart: {
1160
- type: "area",
1161
- is3D: !0,
1162
- codec: { fields: [
1163
- z("grouping", "str"),
1164
- z("varyColors", "bool"),
1165
- fe("area"),
1166
- ae(),
1167
- he("dropLines"),
1168
- z("gapDepth", "int"),
1169
- me()
1170
- ] }
1171
- },
1172
- lineChart: {
1173
- type: "line",
1174
- codec: { fields: [
1175
- z("grouping", "str"),
1176
- z("varyColors", "bool"),
1177
- fe("line"),
1178
- ae(),
1179
- he("dropLines"),
1180
- he("hiLowLines"),
1181
- V("upDownBars", se),
1182
- z("marker", "bool"),
1183
- z("smooth", "bool"),
1184
- me()
1185
- ] }
1186
- },
1187
- line3DChart: {
1188
- type: "line",
1189
- is3D: !0,
1190
- codec: { fields: [
1191
- z("grouping", "str"),
1192
- z("varyColors", "bool"),
1193
- fe("line"),
1194
- ae(),
1195
- he("dropLines"),
1196
- z("gapDepth", "int"),
1197
- me()
1198
- ] }
1199
- },
1200
- stockChart: {
1201
- type: "stock",
1202
- codec: { fields: [
1203
- fe("line"),
1204
- ae(),
1205
- he("dropLines"),
1206
- he("hiLowLines"),
1207
- V("upDownBars", se),
1208
- me()
1209
- ] }
1210
- },
1211
- radarChart: {
1212
- type: "radar",
1213
- codec: { fields: [
1214
- z("radarStyle", "str"),
1215
- z("varyColors", "bool"),
1216
- fe("radar"),
1217
- ae(),
1218
- me()
1219
- ] }
1220
- },
1221
- scatterChart: {
1222
- type: "scatter",
1223
- codec: { fields: [
1224
- z("scatterStyle", "str"),
1225
- z("varyColors", "bool"),
1226
- fe("scatter"),
1227
- ae(),
1228
- me()
1229
- ] }
1230
- },
1231
- pieChart: {
1232
- type: "pie",
1233
- codec: { fields: [
1234
- z("varyColors", "bool"),
1235
- fe("pie"),
1236
- ae(),
1237
- z("firstSliceAng", "int")
1238
- ] }
1239
- },
1240
- pie3DChart: {
1241
- type: "pie",
1242
- is3D: !0,
1243
- codec: { fields: [
1244
- z("varyColors", "bool"),
1245
- fe("pie"),
1246
- ae()
1247
- ] }
1248
- },
1249
- doughnutChart: {
1250
- type: "doughnut",
1251
- codec: { fields: [
1252
- z("varyColors", "bool"),
1253
- fe("pie"),
1254
- ae(),
1255
- z("firstSliceAng", "int"),
1256
- z("holeSize", "int")
1257
- ] }
1258
- },
1259
- barChart: {
1260
- type: "bar",
1261
- codec: { fields: [
1262
- z("barDir", "str"),
1263
- z("grouping", "str"),
1264
- z("varyColors", "bool"),
1265
- fe("bar"),
1266
- ae(),
1267
- z("gapWidth", "int"),
1268
- z("overlap", "int"),
1269
- he("serLines", !0),
1270
- me()
1271
- ] }
1272
- },
1273
- bar3DChart: {
1274
- type: "bar",
1275
- is3D: !0,
1276
- codec: { fields: [
1277
- z("barDir", "str"),
1278
- z("grouping", "str"),
1279
- z("varyColors", "bool"),
1280
- fe("bar"),
1281
- ae(),
1282
- z("gapWidth", "int"),
1283
- z("gapDepth", "int"),
1284
- z("shape", "str"),
1285
- me()
1286
- ] }
1287
- },
1288
- ofPieChart: {
1289
- type: "ofPie",
1290
- codec: { fields: [
1291
- z("ofPieType", "str"),
1292
- z("varyColors", "bool"),
1293
- fe("pie"),
1294
- ae(),
1295
- z("gapWidth", "int"),
1296
- z("splitType", "str"),
1297
- z("splitPos", "num"),
1298
- be,
1299
- z("secondPieSize", "int"),
1300
- he("serLines", !0)
1301
- ] }
1302
- },
1303
- surfaceChart: {
1304
- type: "surface",
1305
- codec: { fields: [
1306
- z("wireframe", "bool"),
1307
- fe("surface"),
1308
- ye,
1309
- me()
1310
- ] }
1311
- },
1312
- surface3DChart: {
1313
- type: "surface",
1314
- is3D: !0,
1315
- codec: { fields: [
1316
- z("wireframe", "bool"),
1317
- fe("surface"),
1318
- ye,
1319
- me()
1320
- ] }
1321
- },
1322
- bubbleChart: {
1323
- type: "bubble",
1324
- codec: { fields: [
1325
- z("varyColors", "bool"),
1326
- fe("bubble"),
1327
- ae(),
1328
- z("bubble3D", "bool"),
1329
- z("bubbleScale", "int"),
1330
- z("showNegBubbles", "bool"),
1331
- z("sizeRepresents", "str"),
1332
- me()
1333
- ] }
1334
- }
1335
- }, xe = {
1336
- tags: Object.keys(ve),
1337
- key: "groups",
1338
- ns: "c",
1339
- many: !0,
1340
- read: (t, e, n) => {
1341
- const { type: r, is3D: s, codec: i } = ve[t.name], o = W(t, i, e, n);
1342
- return o.series ??= [], o.axIds ??= [], s ? {
1343
- type: r,
1344
- is3D: s,
1345
- ...o
1346
- } : {
1347
- type: r,
1348
- ...o
1349
- };
1350
- },
1351
- write: (t, e) => {
1352
- const n = ((t) => `${t.type}${t.is3D ? "3D" : ""}Chart`)(e), { type: r, is3D: s, ...i } = Le(e);
1353
- B(t, `c:${n}`, i, ve[n].codec);
1354
- }
1355
- }, we = [
1356
- "ctr",
1357
- "l",
1358
- "r",
1359
- "t",
1360
- "b"
1361
- ], ke = (t) => {
1362
- switch (t.type) {
1363
- case "bar": return t.is3D ? [] : "stacked" === t.grouping || "percentStacked" === t.grouping ? [
1364
- "ctr",
1365
- "inEnd",
1366
- "inBase"
1367
- ] : [
1368
- "ctr",
1369
- "inEnd",
1370
- "inBase",
1371
- "outEnd"
1372
- ];
1373
- case "line": return t.is3D ? [] : we;
1374
- case "stock":
1375
- case "scatter":
1376
- case "bubble": return we;
1377
- case "pie":
1378
- case "ofPie": return [
1379
- "ctr",
1380
- "inEnd",
1381
- "outEnd",
1382
- "bestFit"
1383
- ];
1384
- default: return [];
1385
- }
1386
- }, Se = (t, e) => void 0 !== e?.dLblPos && !t.includes(e.dLblPos), Le = (t) => {
1387
- const e = ke(t), n = (t) => {
1388
- if (!Se(e, t)) return t;
1389
- const { dLblPos: n, ...r } = t;
1390
- return r;
1391
- }, r = (t) => t.labels ? {
1392
- ...n(t),
1393
- labels: t.labels.map(n)
1394
- } : n(t);
1395
- return {
1396
- ...t,
1397
- ...t.dLbls ? { dLbls: r(t.dLbls) } : {},
1398
- series: t.series.map((t) => t.dLbls ? {
1399
- ...t,
1400
- dLbls: r(t.dLbls)
1401
- } : t)
1402
- };
1403
- }, Pe = { fields: [
1404
- z("logBase", "num"),
1405
- z("orientation", "str"),
1406
- z("max", "num"),
1407
- z("min", "num")
1408
- ] }, Ce = { fields: [
1409
- V("layout", Jt),
1410
- V("tx", Vt),
1411
- Tt(),
1412
- It()
1413
- ] }, Te = { fields: [
1414
- z("custUnit", "num"),
1415
- z("builtInUnit", "str"),
1416
- V("dispUnitsLbl", Ce)
1417
- ] }, Ie = () => [
1418
- z("axId", "int"),
1419
- V("scaling", Pe),
1420
- z("delete", "bool"),
1421
- z("axPos", "str"),
1422
- he("majorGridlines"),
1423
- he("minorGridlines"),
1424
- V("title", _t),
1425
- V("numFmt", qt),
1426
- z("majorTickMark", "str"),
1427
- z("minorTickMark", "str"),
1428
- z("tickLblPos", "str"),
1429
- Tt(),
1430
- It(),
1431
- z("crossAx", "int"),
1432
- z("crosses", "str"),
1433
- z("crossesAt", "num")
1434
- ], De = {
1435
- valAx: {
1436
- type: "val",
1437
- codec: { fields: [
1438
- ...Ie(),
1439
- z("crossBetween", "str"),
1440
- z("majorUnit", "num"),
1441
- z("minorUnit", "num"),
1442
- V("dispUnits", Te)
1443
- ] }
1444
- },
1445
- catAx: {
1446
- type: "cat",
1447
- codec: { fields: [
1448
- ...Ie(),
1449
- z("auto", "bool"),
1450
- z("lblAlgn", "str"),
1451
- z("lblOffset", "int"),
1452
- z("tickLblSkip", "int"),
1453
- z("tickMarkSkip", "int"),
1454
- z("noMultiLvlLbl", "bool")
1455
- ] }
1456
- },
1457
- dateAx: {
1458
- type: "date",
1459
- codec: { fields: [
1460
- ...Ie(),
1461
- z("auto", "bool"),
1462
- z("lblOffset", "int"),
1463
- z("baseTimeUnit", "str"),
1464
- z("majorUnit", "num"),
1465
- z("majorTimeUnit", "str"),
1466
- z("minorUnit", "num"),
1467
- z("minorTimeUnit", "str")
1468
- ] }
1469
- },
1470
- serAx: {
1471
- type: "ser",
1472
- codec: { fields: [
1473
- ...Ie(),
1474
- z("tickLblSkip", "int"),
1475
- z("tickMarkSkip", "int")
1476
- ] }
1477
- }
1478
- }, Ne = {
1479
- tags: Object.keys(De),
1480
- key: "axes",
1481
- ns: "c",
1482
- many: !0,
1483
- read: (t, e, n) => ({
1484
- type: De[t.name].type,
1485
- ...W(t, De[t.name].codec, e, n)
1486
- }),
1487
- write: (t, e) => {
1488
- const { type: n, ...r } = e, s = `${n}Ax`;
1489
- B(t, `c:${s}`, r, De[s].codec);
1490
- }
1491
- }, $e = { fields: [
1492
- z("showHorzBorder", "bool"),
1493
- z("showVertBorder", "bool"),
1494
- z("showOutline", "bool"),
1495
- z("showKeys", "bool"),
1496
- Tt(),
1497
- It()
1498
- ] }, Oe = {
1499
- fields: [
1500
- V("layout", Jt),
1501
- xe,
1502
- Ne,
1503
- V("dTable", $e),
1504
- Tt()
1505
- ],
1506
- afterRead: (t) => {
1507
- t.groups ??= [], t.axes ??= [];
1508
- }
1509
- }, je = { fields: [
1510
- z("rotX", "int"),
1511
- z("hPercent", "int"),
1512
- z("rotY", "int"),
1513
- z("depthPercent", "int"),
1514
- z("rAngAx", "bool"),
1515
- z("perspective", "int")
1516
- ] }, Fe = { fields: [z("thickness", "int"), Tt()] }, Me = { fields: [
1517
- z("idx", "int"),
1518
- z("delete", "bool"),
1519
- It()
1520
- ] }, Re = { fields: [
1521
- z("legendPos", "str"),
1522
- V("legendEntry", Me, "entries", { many: !0 }),
1523
- V("layout", Jt),
1524
- z("overlay", "bool"),
1525
- Tt(),
1526
- It()
1527
- ] }, Ae = { fields: [
1528
- V("title", _t),
1529
- z("autoTitleDeleted", "bool"),
1530
- V("view3D", je),
1531
- V("floor", Fe),
1532
- V("sideWall", Fe),
1533
- V("backWall", Fe),
1534
- V("plotArea", Oe),
1535
- V("legend", Re),
1536
- z("plotVisOnly", "bool"),
1537
- z("dispBlanksAs", "str"),
1538
- z("showDLblsOverMax", "bool")
1539
- ] }, Ue = { fields: [H("name"), z("fmtId", "int")] }, We = { fields: [
1540
- z("date1904", "bool"),
1541
- z("lang", "str"),
1542
- z("roundedCorners", "bool"),
1543
- z("style", "int"),
1544
- V("pivotSource", Ue),
1545
- V("chart", Ae),
1546
- Tt(),
1547
- It()
1548
- ] }, Be = (t) => {
1549
- const e = d(t);
1550
- if (!e || "chartSpace" !== e.name) return null;
1551
- const n = T(e, L);
1552
- if (!w(I(e, n))) return null;
1553
- const r = new A(t, n);
1554
- return {
1555
- model: W(e, We, L, r),
1556
- kept: r.kept,
1557
- reordered: r.reordered
1558
- };
1559
- }, Ee = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n", ze = (t) => {
1560
- const e = { ...t.unknown?.attributes }, n = (t, n) => {
1561
- e[`xmlns:${t}`] ??= n;
1562
- };
1563
- n(x.c, p), n(x.a, m), n(x.r, b);
1564
- const r = new D().raw(Ee);
1565
- return ((t, e) => {
1566
- B(t, "c:chartSpace", e, We);
1567
- })(r, {
1568
- ...t,
1569
- unknown: {
1570
- ...t.unknown,
1571
- attributes: e
1572
- }
1573
- }), r.toString();
1574
- }, He = (t, e) => {
1575
- if (e && (n = t, !(n.chart?.plotArea?.groups ?? []).some((t) => {
1576
- const e = ke(t), n = (t) => Se(e, t) || !!t?.labels?.some((t) => Se(e, t));
1577
- return n(t.dLbls) || t.series.some((t) => n(t.dLbls));
1578
- }))) {
1579
- const n = Be(e);
1580
- if (n && JSON.stringify(n.model) === JSON.stringify(t)) return e;
1581
- }
1582
- var n;
1583
- return ze(t);
1584
- }, Ve = (t, e, n = t, r) => V(t, e, n, {
1585
- ns: "cx",
1586
- many: r
1587
- }), qe = () => Ve("spPr", bt), Ge = () => Ve("txPr", Ct), Je = () => Ve("numFmt", qt), _e = (t) => ({
1588
- name: t,
1589
- key: t,
1590
- read: (t) => {
1591
- if ("auto" === t) return "auto";
1592
- const e = Number(t);
1593
- return "" !== t.trim() && Number.isFinite(e) ? e : void 0;
1594
- },
1595
- write: (t) => String(t)
1596
- }), Ke = (t) => C(t).filter(([t]) => "xmlns" !== t && !t.startsWith("xmlns:")), Xe = (t) => ({
1597
- tags: [t],
1598
- key: t,
1599
- ns: "cx",
1600
- read: (t) => {
1601
- if (c(t).length > 0) return;
1602
- const e = { f: u(t) };
1603
- for (const [n, r] of Ke(t)) {
1604
- if ("dir" !== n || "col" !== r && "row" !== r) return;
1605
- e.dir = r;
1606
- }
1607
- return "" === e.f ? void 0 : e;
1608
- },
1609
- write: (e, n) => {
1610
- const r = E("cx", t);
1611
- e.open(r, n.dir ? [["dir", n.dir]] : null).text(n.f).close(r);
1612
- }
1613
- }), Ye = {
1614
- attributes: [
1615
- q("ptCount", "int"),
1616
- q("formatCode", "str"),
1617
- q("name", "str")
1618
- ],
1619
- fields: [{
1620
- tags: ["pt"],
1621
- key: "points",
1622
- ns: "cx",
1623
- many: !0,
1624
- read: (t) => {
1625
- if (c(t).length > 0) return;
1626
- const e = Ke(t);
1627
- if (1 !== e.length || "idx" !== e[0][0]) return;
1628
- const n = Number(e[0][1]);
1629
- return Number.isInteger(n) && F(String(n)) === F(e[0][1]) ? {
1630
- idx: n,
1631
- v: u(t)
1632
- } : void 0;
1633
- },
1634
- write: (t, e) => {
1635
- const n = E("cx", "pt");
1636
- "" === e.v ? t.open(n, [["idx", String(e.idx)]], !0) : t.open(n, [["idx", String(e.idx)]]).text(e.v).close(n);
1637
- }
1638
- }]
1639
- }, Qe = {
1640
- attributes: [q("type", "str")],
1641
- fields: [
1642
- Xe("f"),
1643
- Xe("nf"),
1644
- Ve("lvl", Ye, "levels", !0)
1645
- ]
1646
- }, Ze = /* @__PURE__ */ new Set([
1647
- "val",
1648
- "x",
1649
- "y",
1650
- "size",
1651
- "colorVal"
1652
- ]), tn = /* @__PURE__ */ new Set([
1653
- "cat",
1654
- "colorStr",
1655
- "entityId"
1656
- ]), en = {
1657
- fields: [Ve("data", {
1658
- attributes: [q("id", "int")],
1659
- fields: [{
1660
- tags: ["numDim", "strDim"],
1661
- key: "dimensions",
1662
- ns: "cx",
1663
- many: !0,
1664
- read: (t, e, n) => {
1665
- const r = W(t, Qe, e, n);
1666
- return ("numDim" === t.name ? Ze : tn).has(r.type) ? r : void 0;
1667
- },
1668
- write: (t, e) => {
1669
- B(t, E("cx", Ze.has(e.type) ? "numDim" : "strDim"), e, Qe);
1670
- }
1671
- }],
1672
- afterRead: (t) => {
1673
- t.dimensions ??= [];
1674
- }
1675
- }, "data", !0)],
1676
- afterRead: (t) => {
1677
- t.data ??= [];
1678
- }
1679
- }, nn = { fields: [Ve("txData", { fields: [Xe("f"), H("v", "v", "cx")] }), Ve("rich", Ct)] }, rn = () => [
1680
- q("pos", "str"),
1681
- q("align", "str"),
1682
- q("overlay", "bool")
1683
- ], sn = {
1684
- attributes: rn(),
1685
- fields: [
1686
- Ve("tx", nn),
1687
- qe(),
1688
- Ge()
1689
- ]
1690
- }, on = {
1691
- attributes: rn(),
1692
- fields: [qe(), Ge()]
1693
- }, an = {
1694
- attributes: [
1695
- q("seriesName", "bool"),
1696
- q("categoryName", "bool"),
1697
- q("value", "bool")
1698
- ],
1699
- fields: []
1700
- }, ln = () => [
1701
- Je(),
1702
- qe(),
1703
- Ge(),
1704
- Ve("visibility", an),
1705
- H("separator", "separator", "cx")
1706
- ], dn = {
1707
- attributes: [q("idx", "int"), q("pos", "str")],
1708
- fields: ln()
1709
- }, cn = {
1710
- attributes: [q("idx", "int")],
1711
- fields: []
1712
- }, un = {
1713
- attributes: [q("pos", "str")],
1714
- fields: [
1715
- ...ln(),
1716
- Ve("dataLabel", dn, "labels", !0),
1717
- Ve("dataLabelHidden", cn, "hiddenLabels", !0)
1718
- ]
1719
- }, pn = {
1720
- attributes: [q("idx", "int")],
1721
- fields: [qe()]
1722
- }, fn = {
1723
- attributes: [
1724
- "connectorLines",
1725
- "meanLine",
1726
- "meanMarker",
1727
- "nonoutliers",
1728
- "outliers"
1729
- ].map((t) => q(t, "bool")),
1730
- fields: []
1731
- }, mn = {
1732
- attributes: [
1733
- q("intervalClosed", "str"),
1734
- _e("underflow"),
1735
- _e("overflow")
1736
- ],
1737
- fields: [z("binSize", "num", "binSize", "cx"), z("binCount", "int", "binCount", "cx")]
1738
- }, hn = { fields: [{
1739
- ...z("idx", "int", "indexes", "cx"),
1740
- many: !0
1741
- }] }, bn = { fields: [
1742
- z("parentLabelLayout", "str", "parentLabelLayout", "cx"),
1743
- z("regionLabelLayout", "str", "regionLabelLayout", "cx"),
1744
- Ve("visibility", fn),
1745
- Ve("aggregation", { fields: [] }),
1746
- Ve("binning", mn),
1747
- Ve("statistics", {
1748
- attributes: [q("quartileMethod", "str")],
1749
- fields: []
1750
- }),
1751
- {
1752
- tags: ["subtotals"],
1753
- key: "subtotals",
1754
- ns: "cx",
1755
- read: (t, e, n) => {
1756
- const r = W(t, hn, e, n);
1757
- return r.unknown ? void 0 : r.indexes ?? [];
1758
- },
1759
- write: (t, e) => {
1760
- B(t, E("cx", "subtotals"), { indexes: e }, hn);
1761
- }
1762
- }
1763
- ] }, gn = {
1764
- attributes: [
1765
- q("layoutId", "str"),
1766
- q("hidden", "bool"),
1767
- q("ownerIdx", "int"),
1768
- q("uniqueId", "str"),
1769
- q("formatIdx", "int")
1770
- ],
1771
- fields: [
1772
- Ve("tx", nn),
1773
- qe(),
1774
- Ve("dataPt", pn, "points", !0),
1775
- Ve("dataLabels", un),
1776
- z("dataId", "int", "dataId", "cx"),
1777
- Ve("layoutPr", bn),
1778
- {
1779
- ...z("axisId", "int", "axisIds", "cx"),
1780
- many: !0
1781
- }
1782
- ]
1783
- }, yn = {
1784
- fields: [Ve("plotSurface", { fields: [qe()] }), Ve("series", gn, "series", !0)],
1785
- afterRead: (t) => {
1786
- t.series ??= [];
1787
- }
1788
- }, vn = { fields: [
1789
- Ve("tx", nn),
1790
- qe(),
1791
- Ge()
1792
- ] }, xn = { fields: [qe()] }, wn = {
1793
- attributes: [q("type", "str")],
1794
- fields: []
1795
- }, kn = {
1796
- attributes: [q("id", "int"), q("hidden", "bool")],
1797
- fields: [
1798
- Ve("catScaling", {
1799
- attributes: [q("gapWidth", "num")],
1800
- fields: []
1801
- }),
1802
- Ve("valScaling", {
1803
- attributes: [
1804
- "max",
1805
- "min",
1806
- "majorUnit",
1807
- "minorUnit"
1808
- ].map((t) => q(t, "num")),
1809
- fields: []
1810
- }),
1811
- Ve("title", vn),
1812
- Ve("units", {
1813
- attributes: [q("unit", "str")],
1814
- fields: [Ve("unitsLabel", vn)]
1815
- }),
1816
- Ve("majorGridlines", xn),
1817
- Ve("minorGridlines", xn),
1818
- Ve("majorTickMarks", wn),
1819
- Ve("minorTickMarks", wn),
1820
- Ve("tickLabels", { fields: [] }),
1821
- Je(),
1822
- qe(),
1823
- Ge()
1824
- ]
1825
- }, Sn = {
1826
- fields: [
1827
- Ve("plotAreaRegion", yn),
1828
- Ve("axis", kn, "axes", !0),
1829
- qe()
1830
- ],
1831
- afterRead: (t) => {
1832
- t.axes ??= [];
1833
- }
1834
- }, Ln = { fields: [
1835
- Ve("title", sn),
1836
- Ve("plotArea", Sn),
1837
- Ve("legend", on)
1838
- ] }, Pn = { fields: [
1839
- Ve("chartData", en),
1840
- Ve("chart", Ln),
1841
- qe(),
1842
- Ge()
1843
- ] }, Cn = {
1844
- waterfall: "waterfall",
1845
- clusteredColumn: "histogram",
1846
- boxWhisker: "boxWhisker",
1847
- treemap: "treemap",
1848
- sunburst: "sunburst",
1849
- funnel: "funnel",
1850
- regionMap: "regionMap"
1851
- }, Tn = Object.fromEntries(Object.entries(Cn).map(([t, e]) => [e, t])), In = new Set(Object.values(Cn)), Dn = "paretoLine", Nn = {
1852
- cat: "cat",
1853
- val: "val",
1854
- x: "xVal",
1855
- y: "yVal",
1856
- size: "bubbleSize",
1857
- colorVal: "color",
1858
- colorStr: "color",
1859
- entityId: "entityId"
1860
- }, $n = /* @__PURE__ */ new Set([
1861
- "val",
1862
- "x",
1863
- "y",
1864
- "size",
1865
- "colorVal"
1866
- ]), On = [
1867
- "cat",
1868
- "colorStr",
1869
- "entityId",
1870
- "x",
1871
- "y",
1872
- "val",
1873
- "size",
1874
- "colorVal"
1875
- ], jn = (t) => {
1876
- for (const e of Object.keys(t)) void 0 === t[e] && delete t[e];
1877
- return t;
1878
- }, Fn = (t) => jn({
1879
- f: t.f,
1880
- dir: t.dir
1881
- }), Mn = (t) => t && jn({
1882
- strRef: t.txData?.f ? Fn(t.txData.f) : void 0,
1883
- v: t.txData?.v,
1884
- rich: t.rich,
1885
- unknown: t.unknown
1886
- }), Rn = (t) => t && jn({
1887
- tx: Mn(t.tx),
1888
- overlay: t.overlay,
1889
- spPr: t.spPr,
1890
- txPr: t.txPr,
1891
- pos: t.pos,
1892
- align: t.align,
1893
- unknown: t.unknown
1894
- }), An = (t) => jn({
1895
- numFmt: t.numFmt,
1896
- spPr: t.spPr,
1897
- txPr: t.txPr,
1898
- dLblPos: t.pos,
1899
- showSerName: t.visibility?.seriesName,
1900
- showCatName: t.visibility?.categoryName,
1901
- showVal: t.visibility?.value,
1902
- separator: t.separator,
1903
- unknown: t.unknown
1904
- }), Un = (t) => {
1905
- if (!t) return;
1906
- const e = An(t), n = [...(t.labels ?? []).map((t) => ({
1907
- idx: t.idx,
1908
- ...An(t)
1909
- })), ...(t.hiddenLabels ?? []).map((t) => ({
1910
- idx: t.idx,
1911
- delete: !0
1912
- }))];
1913
- return n.length > 0 && (e.labels = n), e;
1914
- }, Wn = (t, e) => {
1915
- const n = (t ?? []).map((t) => ({ ...t }));
1916
- for (const t of [...e ?? []].sort((t, e) => t - e)) {
1917
- const e = n.find((e) => e.idx === t);
1918
- e ? e.subtotal = !0 : n.push({
1919
- idx: t,
1920
- subtotal: !0
1921
- });
1922
- }
1923
- return n.length > 0 ? n : void 0;
1924
- }, Bn = (t) => {
1925
- if (!t) return;
1926
- const { subtotals: e, ...n } = t;
1927
- return Object.keys(n).length > 0 ? n : void 0;
1928
- }, En = (t) => jn({
1929
- ptCount: t.ptCount,
1930
- formatCode: t.formatCode,
1931
- name: t.name,
1932
- points: (t.points ?? []).map((t) => ({
1933
- idx: t.idx,
1934
- v: t.v
1935
- })),
1936
- unknown: t.unknown
1937
- }), zn = (t) => {
1938
- const e = $n.has(t.type), n = t.levels?.map(En), r = {};
1939
- return t.f ? r[e ? "numRef" : "strRef"] = jn({
1940
- ...Fn(t.f),
1941
- cache: n ? { levels: n } : void 0
1942
- }) : r[e ? "numLit" : "strLit"] = jn({ levels: n }), t.nf && (r.nf = Fn(t.nf)), t.unknown && (r.unknown = t.unknown), r;
1943
- }, Hn = (t, e) => {
1944
- const n = jn({
1945
- idx: t.formatIdx,
1946
- hidden: t.hidden,
1947
- uniqueId: t.uniqueId,
1948
- tx: Mn(t.tx),
1949
- spPr: t.spPr,
1950
- points: Wn(t.points, t.layoutPr?.subtotals),
1951
- dLbls: Un(t.dataLabels),
1952
- layoutPr: Bn(t.layoutPr),
1953
- unknown: t.unknown
1954
- });
1955
- for (const t of e?.dimensions ?? []) {
1956
- const e = Nn[t.type];
1957
- e && !n[e] && (n[e] = zn(t));
1958
- }
1959
- return n;
1960
- }, Vn = (t) => jn({
1961
- idx: t.formatIdx,
1962
- hidden: t.hidden,
1963
- uniqueId: t.uniqueId,
1964
- tx: Mn(t.tx),
1965
- spPr: t.spPr,
1966
- points: Wn(t.points, t.layoutPr?.subtotals),
1967
- dLbls: Un(t.dataLabels),
1968
- layoutPr: Bn(t.layoutPr),
1969
- axIds: t.axisIds,
1970
- unknown: t.unknown
1971
- }), qn = (t, e) => {
1972
- const n = new Map(e.map((t) => [t.id, t])), r = [], s = [];
1973
- let i = null;
1974
- for (const e of t?.series ?? []) {
1975
- if (e.layoutId === Dn) {
1976
- const t = void 0 === e.ownerIdx ? null : s[e.ownerIdx];
1977
- t && !t.cumulativeLine && (t.cumulativeLine = Vn(e)), s.push(null);
1978
- continue;
1979
- }
1980
- const t = Cn[e.layoutId] ?? e.layoutId, o = e.axisIds ?? [];
1981
- i && i.type === t && JSON.stringify(i.axIds) === JSON.stringify(o) || (i = {
1982
- type: t,
1983
- series: [],
1984
- axIds: o
1985
- }, r.push(i));
1986
- const a = Hn(e, void 0 === e.dataId ? void 0 : n.get(e.dataId));
1987
- i.series.push(a), s.push(a);
1988
- }
1989
- return r;
1990
- }, Gn = (t) => {
1991
- const e = t.catScaling ?? t.valScaling;
1992
- return jn({
1993
- type: t.catScaling || !t.valScaling ? "cat" : "val",
1994
- axId: t.id,
1995
- scaling: jn({
1996
- max: t.valScaling?.max,
1997
- min: t.valScaling?.min,
1998
- gapWidth: t.catScaling?.gapWidth,
1999
- unknown: e?.unknown
2000
- }),
2001
- delete: t.hidden,
2002
- majorGridlines: t.majorGridlines,
2003
- minorGridlines: t.minorGridlines,
2004
- title: Rn(t.title),
2005
- numFmt: t.numFmt,
2006
- majorTickMark: t.majorTickMarks?.type,
2007
- minorTickMark: t.minorTickMarks?.type,
2008
- tickLblPos: t.tickLabels ? void 0 : "none",
2009
- spPr: t.spPr,
2010
- txPr: t.txPr,
2011
- majorUnit: t.valScaling?.majorUnit,
2012
- minorUnit: t.valScaling?.minorUnit,
2013
- dispUnits: t.units && jn({
2014
- builtInUnit: t.units.unit,
2015
- dispUnitsLbl: Rn(t.units.unitsLabel),
2016
- unknown: t.units.unknown
2017
- }),
2018
- unknown: t.unknown
2019
- });
2020
- }, Jn = (t) => t && jn({
2021
- txData: t.strRef || void 0 !== t.v ? jn({
2022
- f: t.strRef ? Fn(t.strRef) : void 0,
2023
- v: t.v
2024
- }) : void 0,
2025
- rich: t.rich,
2026
- unknown: t.unknown
2027
- }), _n = (t) => t && jn({
2028
- tx: Jn(t.tx),
2029
- spPr: t.spPr,
2030
- txPr: t.txPr,
2031
- unknown: t.unknown
2032
- }), Kn = (t) => {
2033
- const e = void 0 !== t.showSerName || void 0 !== t.showCatName || void 0 !== t.showVal;
2034
- return jn({
2035
- pos: t.dLblPos,
2036
- numFmt: t.numFmt,
2037
- spPr: t.spPr,
2038
- txPr: t.txPr,
2039
- visibility: e ? jn({
2040
- seriesName: t.showSerName,
2041
- categoryName: t.showCatName,
2042
- value: t.showVal
2043
- }) : void 0,
2044
- separator: t.separator,
2045
- unknown: t.unknown
2046
- });
2047
- }, Xn = (t) => !0 === t.delete && Object.keys(t).every((t) => "idx" === t || "delete" === t), Yn = (t) => {
2048
- if (!t) return;
2049
- const e = Kn(t), n = (t.labels ?? []).filter((t) => !Xn(t)).map((t) => ({
2050
- idx: t.idx,
2051
- ...Kn(t)
2052
- })), r = (t.labels ?? []).filter(Xn).map((t) => ({ idx: t.idx }));
2053
- return n.length > 0 && (e.labels = n), r.length > 0 && (e.hiddenLabels = r), e;
2054
- }, Qn = (t) => {
2055
- const e = (t ?? []).filter((t) => Object.keys(t).some((t) => "idx" !== t && "subtotal" !== t)).map(({ subtotal: t, ...e }) => e);
2056
- return e.length > 0 ? e : void 0;
2057
- }, Zn = (t, e, n) => {
2058
- const r = (e ?? []).filter((t) => t.subtotal).map((t) => t.idx).sort((t, e) => t - e);
2059
- return 0 !== r.length || n ? {
2060
- ...t,
2061
- subtotals: r
2062
- } : t;
2063
- }, tr = (t) => jn({
2064
- ptCount: t.ptCount,
2065
- formatCode: t.formatCode,
2066
- name: t.name,
2067
- points: t.points.length > 0 ? t.points.map((t) => ({
2068
- idx: t.idx,
2069
- v: t.v
2070
- })) : void 0,
2071
- unknown: t.unknown
2072
- }), er = (t, e) => "color" === t ? e.strRef || e.strLit ? "colorStr" : "colorVal" : Object.keys(Nn).find((e) => Nn[e] === t), nr = (t) => {
2073
- const e = [];
2074
- for (const n of [
2075
- "cat",
2076
- "val",
2077
- "xVal",
2078
- "yVal",
2079
- "bubbleSize",
2080
- "color",
2081
- "entityId"
2082
- ]) {
2083
- const r = t[n];
2084
- if (!r) continue;
2085
- const s = r.numRef ?? r.strRef, i = (s ? s.cache : r.numLit ?? r.strLit)?.levels;
2086
- e.push(jn({
2087
- type: er(n, r),
2088
- f: s ? Fn(s) : void 0,
2089
- nf: r.nf ? Fn(r.nf) : void 0,
2090
- levels: i && i.length > 0 ? i.map(tr) : void 0,
2091
- unknown: r.unknown
2092
- }));
2093
- }
2094
- return e.sort((t, e) => On.indexOf(t.type) - On.indexOf(e.type));
2095
- }, rr = (t) => {
2096
- const e = t.scaling ?? {}, n = "cat" === t.type || "date" === t.type;
2097
- return jn({
2098
- id: t.axId,
2099
- hidden: t.delete,
2100
- catScaling: n ? jn({
2101
- gapWidth: e.gapWidth,
2102
- unknown: e.unknown
2103
- }) : void 0,
2104
- valScaling: n ? void 0 : jn({
2105
- max: e.max,
2106
- min: e.min,
2107
- majorUnit: t.majorUnit,
2108
- minorUnit: t.minorUnit,
2109
- unknown: e.unknown
2110
- }),
2111
- title: _n(t.title),
2112
- units: t.dispUnits && jn({
2113
- unit: t.dispUnits.builtInUnit,
2114
- unitsLabel: _n(t.dispUnits.dispUnitsLbl),
2115
- unknown: t.dispUnits.unknown
2116
- }),
2117
- majorGridlines: t.majorGridlines,
2118
- minorGridlines: t.minorGridlines,
2119
- majorTickMarks: t.majorTickMark ? { type: t.majorTickMark } : void 0,
2120
- minorTickMarks: t.minorTickMark ? { type: t.minorTickMark } : void 0,
2121
- tickLabels: "none" === t.tickLblPos ? void 0 : {},
2122
- numFmt: t.numFmt,
2123
- spPr: t.spPr,
2124
- txPr: t.txPr,
2125
- unknown: t.unknown
2126
- });
2127
- }, sr = (t) => {
2128
- const e = t.chart, n = e?.plotArea, r = [], s = [], i = [];
2129
- for (const t of n?.groups ?? []) {
2130
- const e = Tn[t.type];
2131
- if (e) for (const n of t.series) {
2132
- const o = nr(n);
2133
- let a;
2134
- if (o.length > 0) {
2135
- const t = JSON.stringify(o);
2136
- a = i.indexOf(t), -1 === a && (a = s.length, s.push({
2137
- id: a,
2138
- dimensions: o
2139
- }), i.push(t));
2140
- }
2141
- const l = r.length;
2142
- r.push(jn({
2143
- layoutId: e,
2144
- hidden: n.hidden,
2145
- uniqueId: n.uniqueId,
2146
- formatIdx: n.idx,
2147
- tx: Jn(n.tx),
2148
- spPr: n.spPr,
2149
- points: Qn(n.points),
2150
- dataLabels: Yn(n.dLbls),
2151
- dataId: a,
2152
- layoutPr: Zn(n.layoutPr, n.points, "waterfall" === t.type),
2153
- axisIds: t.axIds.length > 0 ? t.axIds : void 0,
2154
- unknown: n.unknown
2155
- }));
2156
- const d = n.cumulativeLine;
2157
- d && r.push(jn({
2158
- layoutId: Dn,
2159
- hidden: d.hidden,
2160
- ownerIdx: l,
2161
- uniqueId: d.uniqueId,
2162
- formatIdx: d.idx,
2163
- tx: Jn(d.tx),
2164
- spPr: d.spPr,
2165
- points: Qn(d.points),
2166
- dataLabels: Yn(d.dLbls),
2167
- layoutPr: Zn(d.layoutPr, d.points, !1),
2168
- axisIds: d.axIds,
2169
- unknown: d.unknown
2170
- }));
2171
- }
2172
- }
2173
- const o = e?.legend;
2174
- return jn({
2175
- chartData: { data: s },
2176
- chart: jn({
2177
- title: (a = e?.title, a && jn({
2178
- pos: a.pos,
2179
- align: a.align,
2180
- overlay: a.overlay,
2181
- tx: Jn(a.tx),
2182
- spPr: a.spPr,
2183
- txPr: a.txPr,
2184
- unknown: a.unknown
2185
- })),
2186
- plotArea: jn({
2187
- plotAreaRegion: jn({
2188
- plotSurface: n?.plotSurface,
2189
- series: r
2190
- }),
2191
- axes: (n?.axes ?? []).map(rr),
2192
- spPr: n?.spPr,
2193
- unknown: n?.unknown
2194
- }),
2195
- legend: o && jn({
2196
- pos: "tr" === o.legendPos ? "r" : o.legendPos,
2197
- align: o.align,
2198
- overlay: o.overlay,
2199
- spPr: o.spPr,
2200
- txPr: o.txPr,
2201
- unknown: o.unknown
2202
- }),
2203
- unknown: e?.unknown
2204
- }),
2205
- spPr: t.spPr,
2206
- txPr: t.txPr,
2207
- unknown: t.unknown
2208
- });
2209
- var a;
2210
- }, ir = (t, e) => {
2211
- if (t === e) return !0;
2212
- if ("object" != typeof t || "object" != typeof e || null === t || null === e) return !1;
2213
- if (Array.isArray(t) !== Array.isArray(e)) return !1;
2214
- const n = (t) => Object.keys(t).filter((e) => void 0 !== t[e]), r = n(t), s = n(e);
2215
- return r.length === s.length && r.every((n) => ir(t[n], e[n]));
2216
- }, or = (t, e) => ir(t, sr(e)), ar = (t) => {
2217
- const e = d(t);
2218
- if (!e || "chartSpace" !== e.name) return null;
2219
- const n = T(e, L);
2220
- if (!S(I(e, n))) return null;
2221
- const r = new A(t, n), s = W(e, Pn, L, r), i = ((t) => {
2222
- const e = t.chart, n = e?.plotArea, r = e?.legend;
2223
- return jn({
2224
- chart: jn({
2225
- title: Rn(e?.title),
2226
- plotArea: jn({
2227
- groups: qn(n?.plotAreaRegion, t.chartData?.data ?? []),
2228
- axes: (n?.axes ?? []).map(Gn),
2229
- spPr: n?.spPr,
2230
- plotSurface: n?.plotAreaRegion?.plotSurface,
2231
- unknown: n?.unknown
2232
- }),
2233
- legend: r && jn({
2234
- legendPos: r.pos,
2235
- align: r.align,
2236
- overlay: r.overlay,
2237
- spPr: r.spPr,
2238
- txPr: r.txPr,
2239
- unknown: r.unknown
2240
- }),
2241
- unknown: e?.unknown
2242
- }),
2243
- spPr: t.spPr,
2244
- txPr: t.txPr,
2245
- unknown: t.unknown
2246
- });
2247
- })(s);
2248
- return {
2249
- model: i,
2250
- kept: r.kept,
2251
- reordered: r.reordered,
2252
- lossy: !or(s, i)
2253
- };
2254
- }, lr = (t) => {
2255
- const e = { ...t.unknown?.attributes }, n = (t, n) => {
2256
- e[`xmlns:${t}`] ??= n;
2257
- };
2258
- n(x.a, m), n(x.r, b), n(x.cx, y);
2259
- const r = sr(t), s = new D().raw(Ee);
2260
- return ((t, e) => {
2261
- B(t, E("cx", "chartSpace"), e, Pn);
2262
- })(s, {
2263
- ...r,
2264
- unknown: {
2265
- ...r.unknown,
2266
- attributes: e
2267
- }
2268
- }), s.toString();
2269
- }, dr = (t, e) => {
2270
- if (e) {
2271
- const n = ar(e);
2272
- if (n && JSON.stringify(n.model) === JSON.stringify(t)) return e;
2273
- }
2274
- return lr(t);
2275
- }, cr = {
2276
- chart: {
2277
- relType: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",
2278
- contentType: "application/vnd.openxmlformats-officedocument.drawingml.chart+xml",
2279
- path: "../charts/chart{n}.xml",
2280
- graphicUri: p
2281
- },
2282
- chartEx: {
2283
- relType: "http://schemas.microsoft.com/office/2014/relationships/chartEx",
2284
- contentType: "application/vnd.ms-office.chartex+xml",
2285
- path: "../charts/chartEx{n}.xml",
2286
- graphicUri: y
2287
- }
2288
- }, ur = /* @__PURE__ */ new Set([
2289
- "area",
2290
- "bar",
2291
- "line",
2292
- "pie",
2293
- "doughnut",
2294
- "ofPie",
2295
- "scatter",
2296
- "bubble",
2297
- "radar",
2298
- "stock",
2299
- "surface"
2300
- ]), pr = (t) => t === cr.chartEx.relType ? "chartEx" : t === cr.chart.relType ? "chart" : null, fr = (t) => ur.has(t) ? "chart" : In.has(t) ? "chartEx" : null, mr = (t) => {
2301
- const e = Be(t);
2302
- if (e) return {
2303
- model: e.model,
2304
- family: "chart",
2305
- kept: e.kept,
2306
- lossy: !1
2307
- };
2308
- const n = ar(t);
2309
- return n ? {
2310
- model: n.model,
2311
- family: "chartEx",
2312
- kept: n.kept,
2313
- lossy: n.lossy
2314
- } : null;
2315
- }, hr = (t) => {
2316
- if (Array.isArray(t)) return t.map(hr);
2317
- if ("object" != typeof t || null === t) return t;
2318
- const e = {};
2319
- for (const [n, r] of Object.entries(t)) "unknown" !== n && (e[n] = hr(r));
2320
- return e;
2321
- }, br = (t, e) => {
2322
- const n = t.chart?.plotArea?.groups ?? [], r = n.map((t) => fr(t.type)).find((t) => null !== t) ?? e?.family ?? "chart", s = n.filter((t) => fr(t.type) !== r).map((t) => t.type);
2323
- let i = t;
2324
- if (s.length > 0) {
2325
- const e = {
2326
- ...t.chart.plotArea,
2327
- groups: n.filter((t) => fr(t.type) === r)
2328
- };
2329
- i = {
2330
- ...t,
2331
- chart: {
2332
- ...t.chart,
2333
- plotArea: e
2334
- }
2335
- };
2336
- }
2337
- const o = (e?.family ?? r) === r;
2338
- o || (i = hr(i));
2339
- const a = o ? e?.xml : void 0;
2340
- return {
2341
- family: r,
2342
- leftOut: s,
2343
- xml: "chartEx" === r ? dr(i, a) : He(i, a)
2344
- };
2345
- };
2346
- export { s as a, br as i, pr as n, r as o, mr as r, cr as t };