@sheetxl/io-xlsx 0.8.0-beta.10 → 0.8.0-beta.11

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 (116) hide show
  1. package/browser/esm/{NQIuOQIleHC4NUW6.mjs → BiDqExNXiY7ykk8E.mjs} +527 -646
  2. package/browser/esm/{2EOdn2WRK5y1L58S.mjs → Bs0EzhdU8WgGfPzf.mjs} +2 -2
  3. package/browser/esm/CLWsOc6DO8l1G_LF.mjs +2213 -0
  4. package/browser/esm/{xc_LzCPgHn-acgFZ.mjs → CZ9I80og75SDRjv0.mjs} +2 -2
  5. package/browser/esm/{DXopGe8PrLWmwGaV.mjs → CuAXx5i4uqTz-mMY.mjs} +1 -1
  6. package/browser/esm/{BLXcoiDAaOMjFuhw.mjs → Cv3R6fGatARKedSn.mjs} +2531 -1952
  7. package/browser/esm/{B-jb5SuiVh5NnBG_.mjs → CzFYJPxmLyKgEKF0.mjs} +2 -2
  8. package/browser/esm/{BKT8OBj-bhQwdg49.mjs → DICL6ecj9BdJv8aX.mjs} +47 -10
  9. package/browser/esm/DatIA9fZbEPjW4bh.mjs +5638 -0
  10. package/browser/esm/index.mjs +2 -2
  11. package/browser/esm/{CI_CZI5m5-KkiAK5.mjs → yveeVJ6hKDI5KDEz.mjs} +1599 -990
  12. package/node/esm/B9Zn6H1RV07Ob377.mjs +2294 -0
  13. package/node/esm/Bpqm_PpGLpdjL47-.mjs +2368 -0
  14. package/node/esm/{BmdmvgO5Zdgx-RWo.mjs → CAJxmJdobUbzpUz5.mjs} +2 -2
  15. package/node/esm/{CHqRP_NjPpPd7m9L.mjs → CxlSbH7mmnEEsqmX.mjs} +1 -1
  16. package/node/esm/DD-yXSBzvDYy0TX5.mjs +5842 -0
  17. package/node/esm/{nNQ7MG89sGKwkjMA.mjs → DScqM1V4wPntNP6-.mjs} +1672 -1086
  18. package/node/esm/{O5mti2R9drFOlXc7.mjs → fopiRR7OiVoEiF7B.mjs} +2 -2
  19. package/node/esm/index.mjs +64 -27
  20. package/node/esm/{CtAF486aZqYzMeLM.mjs → ipiyzn5Pfohw2afB.mjs} +1777 -1157
  21. package/package.json +3 -3
  22. package/types/src/AutoFilterRules.d.ts +8 -1
  23. package/types/src/DefinedNameAttributes.d.ts +8 -0
  24. package/types/src/ExcelCompat.d.ts +15 -3
  25. package/types/src/KnownFonts.d.ts +50 -0
  26. package/types/src/LegacyFormula.d.ts +13 -0
  27. package/types/src/PageLayoutAttributes.d.ts +8 -0
  28. package/types/src/Plugin.d.ts +12 -0
  29. package/types/src/ProtectionAttributes.d.ts +2 -2
  30. package/types/src/SheetKinds.d.ts +57 -0
  31. package/types/src/SheetViewAttributes.d.ts +4 -0
  32. package/types/src/SortExtent.d.ts +16 -0
  33. package/types/src/Types.d.ts +11 -0
  34. package/types/src/XlsxHeader.d.ts +19 -0
  35. package/types/src/chart/ChartExXml.d.ts +38 -0
  36. package/types/src/chart/ChartPartXml.d.ts +47 -0
  37. package/types/src/chart/ChartSpaceXml.d.ts +36 -0
  38. package/types/src/chart/_XmlTree.d.ts +34 -0
  39. package/types/src/chart/_chartCodecs.d.ts +10 -0
  40. package/types/src/chart/_chartExCodecs.d.ts +7 -0
  41. package/types/src/chart/_chartExFold.d.ts +14 -0
  42. package/types/src/chart/_chartExMarkup.d.ts +236 -0
  43. package/types/src/chart/_chartExStyle.d.ts +22 -0
  44. package/types/src/chart/_codec.d.ts +78 -0
  45. package/types/src/chart/_drawingml.d.ts +10 -0
  46. package/types/src/chart/_xml.d.ts +70 -0
  47. package/types/src/reader/DocumentPropertiesRead.d.ts +16 -0
  48. package/types/src/reader/DummyFunctionUnwrap.d.ts +2 -2
  49. package/types/src/reader/HeaderStyles.d.ts +15 -0
  50. package/types/src/reader/IsoDateCell.d.ts +20 -0
  51. package/types/src/reader/LibreOfficeDataTable.d.ts +11 -0
  52. package/types/src/reader/domVisitors/AppPropertiesVisitor.d.ts +13 -1
  53. package/types/src/reader/domVisitors/AutoFilterVisitor.d.ts +3 -3
  54. package/types/src/reader/domVisitors/CommentVisitor.d.ts +2 -2
  55. package/types/src/reader/domVisitors/DrawingElementVisitor.d.ts +3 -1
  56. package/types/src/reader/domVisitors/DrawingGraphicFrameVisitor.d.ts +2 -2
  57. package/types/src/reader/domVisitors/DrawingPicVisitor.d.ts +23 -8
  58. package/types/src/reader/domVisitors/FontSchemeVisitor.d.ts +3 -2
  59. package/types/src/reader/domVisitors/ObjectDefaultsVisitor.d.ts +11 -0
  60. package/types/src/reader/domVisitors/SheetColorContainerVisitor.d.ts +2 -2
  61. package/types/src/reader/domVisitors/SheetStyleVisitor.d.ts +2 -0
  62. package/types/src/reader/domVisitors/SortStateVisitor.d.ts +2 -2
  63. package/types/src/reader/domVisitors/ThreadedCommentsVisitor.d.ts +2 -2
  64. package/types/src/reader/domVisitors/_Dxfs.d.ts +10 -0
  65. package/types/src/reader/domVisitors/index.d.ts +2 -30
  66. package/types/src/reader/saxVisitors/SharedStringsVisitor.d.ts +46 -6
  67. package/types/src/reader/saxVisitors/WorksheetVisitor.d.ts +16 -11
  68. package/types/src/utils/DrawingMLText.d.ts +2 -2
  69. package/types/src/utils/FormControls.d.ts +4 -4
  70. package/types/src/utils/SharedNames.d.ts +13 -0
  71. package/types/src/utils/SpreadsheetFont.d.ts +38 -0
  72. package/types/src/utils/VmlNoteShapes.d.ts +16 -23
  73. package/types/src/utils/VmlNoteStyle.d.ts +44 -0
  74. package/types/src/utils/VmlPrefixes.d.ts +24 -0
  75. package/types/src/writer/builder/PackageBuilder.d.ts +2 -0
  76. package/types/src/writer/builder/Types.d.ts +7 -0
  77. package/types/src/writer/emitters/CommentsEmitter.d.ts +3 -3
  78. package/types/src/writer/emitters/DrawingEmitter.d.ts +2 -2
  79. package/types/src/writer/emitters/LegacyDrawingEmitter.d.ts +4 -4
  80. package/types/src/writer/emitters/PropsCoreEmitter.d.ts +7 -2
  81. package/types/src/writer/emitters/PropsCustomEmitter.d.ts +15 -0
  82. package/types/src/writer/emitters/SharedStringsEmitter.d.ts +6 -3
  83. package/types/src/writer/emitters/SlicerEmitter.d.ts +3 -3
  84. package/types/src/writer/emitters/WorkbookEmitter.d.ts +5 -0
  85. package/types/src/writer/emitters/WorksheetEmitter.d.ts +4 -3
  86. package/types/src/writer/utils/AutoFilter.d.ts +1 -1
  87. package/types/src/writer/utils/DefaultRows.d.ts +38 -0
  88. package/types/src/writer/utils/DxfCollector.d.ts +11 -8
  89. package/types/src/writer/utils/HiddenFormulaXfs.d.ts +1 -1
  90. package/types/src/writer/utils/SheetStyleLayout.d.ts +73 -0
  91. package/types/src/writer/utils/TextUtils.d.ts +6 -1
  92. package/types/src/writer/utils/UnsupportedFunctions.d.ts +2 -2
  93. package/browser/esm/BPmehfSqdvgsLBsB.mjs +0 -5153
  94. package/node/esm/BpxxiZ2oKPkUSfdB.mjs +0 -2486
  95. package/node/esm/QS_theNoeqNGLStj.mjs +0 -5298
  96. package/types/src/legacyChart/OOXMLMappings.d.ts +0 -8
  97. package/types/src/legacyChart/OOXMLUtils.d.ts +0 -78
  98. package/types/src/legacyChart/ToOOXMLConverter.d.ts +0 -30
  99. package/types/src/reader/domVisitors/AxisVisitor.d.ts +0 -12
  100. package/types/src/reader/domVisitors/BarChartTypeVisitor.d.ts +0 -6
  101. package/types/src/reader/domVisitors/ChartSpaceVisitor.d.ts +0 -6
  102. package/types/src/reader/domVisitors/ChartTypeVisitor.d.ts +0 -7
  103. package/types/src/reader/domVisitors/ChartVisitor.d.ts +0 -7
  104. package/types/src/reader/domVisitors/DataLabelsVisitor.d.ts +0 -8
  105. package/types/src/reader/domVisitors/DataPointVisitor.d.ts +0 -6
  106. package/types/src/reader/domVisitors/LayoutVisitor.d.ts +0 -5
  107. package/types/src/reader/domVisitors/LegendEntryVisitor.d.ts +0 -5
  108. package/types/src/reader/domVisitors/LegendVisitor.d.ts +0 -5
  109. package/types/src/reader/domVisitors/MarkerVisitor.d.ts +0 -5
  110. package/types/src/reader/domVisitors/NegativeShapeVisitor.d.ts +0 -6
  111. package/types/src/reader/domVisitors/PlotAreaVisitor.d.ts +0 -5
  112. package/types/src/reader/domVisitors/SeriesVisitor.d.ts +0 -8
  113. package/types/src/reader/domVisitors/TitleVisitor.d.ts +0 -9
  114. package/types/src/writer/emitters/ChartColorsEmitter.d.ts +0 -7
  115. package/types/src/writer/emitters/ChartEmitter.d.ts +0 -14
  116. package/types/src/writer/emitters/ChartStyleEmitter.d.ts +0 -46
@@ -0,0 +1,2294 @@
1
+ /**
2
+ * @license @sheetxl/io-xlsx - SheetXL - Import/Export from/to Excel - v0.8.0-beta.11
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, P = Object.freeze({ xml: v }), L = /([^\s=]+)\s*=\s*(?:"([^"]*)"|'([^']*)')/g, C = (t) => {
82
+ const e = [];
83
+ L.lastIndex = 0;
84
+ for (let n = L.exec(t.attrs); n; n = L.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
+ }, z = (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
+ }, B = (t, e) => `${x[t]}:${e}`, E = (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(B(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 = B(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) => z(e, B(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" })] }, Pt = { 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
+ z(t, _("br"), s, St);
882
+ } else if (e.field) {
883
+ const { field: n, ...r } = e;
884
+ z(t, _("fld"), {
885
+ ...r,
886
+ id: n.id,
887
+ type: n.type
888
+ }, kt);
889
+ } else z(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", Pt, "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
+ E("ptCount", "int"),
922
+ V("pt", Dt, "points", { many: !0 })
923
+ ] }, $t = { fields: [E("ptCount", "int"), V("pt", Dt, "points", { many: !0 })] }, Ot = { fields: [E("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 = E("showDataLabelsRange", "bool", "showDataLabelsRange", "c15"), Wt = {
927
+ ...Ut,
928
+ read: (t, e, n) => e[x.c15] === g ? Ut.read(t, e, n) : void 0
929
+ }, Bt = { 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 })] }, Et = { 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
+ E("layoutTarget", "str"),
944
+ E("xMode", "str"),
945
+ E("yMode", "str"),
946
+ E("wMode", "str"),
947
+ E("hMode", "str"),
948
+ E("x", "num"),
949
+ E("y", "num"),
950
+ E("w", "num"),
951
+ E("h", "num")
952
+ ] })] }, _t = { fields: [
953
+ V("tx", Vt),
954
+ V("layout", Jt),
955
+ E("overlay", "bool"),
956
+ Tt(),
957
+ It()
958
+ ] }, Kt = { fields: [Tt()] }, Xt = { fields: [
959
+ E("symbol", "str"),
960
+ E("size", "int"),
961
+ Tt()
962
+ ] }, Yt = { fields: [
963
+ E("idx", "int"),
964
+ E("invertIfNegative", "bool"),
965
+ V("marker", Xt),
966
+ E("bubble3D", "bool"),
967
+ E("explosion", "int"),
968
+ Tt()
969
+ ] }, Qt = () => [
970
+ V("numFmt", qt),
971
+ Tt(),
972
+ It(),
973
+ E("dLblPos", "str"),
974
+ E("showLegendKey", "bool"),
975
+ E("showVal", "bool"),
976
+ E("showCatName", "bool"),
977
+ E("showSerName", "bool"),
978
+ E("showPercent", "bool"),
979
+ E("showBubbleSize", "bool"),
980
+ H("separator")
981
+ ], te = { fields: [
982
+ V("dLbl", { fields: [
983
+ E("idx", "int"),
984
+ E("delete", "bool"),
985
+ V("layout", Jt),
986
+ V("tx", Vt),
987
+ ...Qt(),
988
+ V("extLst", Bt)
989
+ ] }, "labels", { many: !0 }),
990
+ E("delete", "bool"),
991
+ ...Qt(),
992
+ E("showLeaderLines", "bool"),
993
+ V("leaderLines", Kt),
994
+ V("extLst", Bt)
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
+ E("trendlineType", "str"),
1005
+ E("order", "int"),
1006
+ E("period", "int"),
1007
+ E("forward", "num"),
1008
+ E("backward", "num"),
1009
+ E("intercept", "num"),
1010
+ E("dispRSqr", "bool"),
1011
+ E("dispEq", "bool"),
1012
+ V("trendlineLbl", ee)
1013
+ ] }, re = { fields: [
1014
+ E("errDir", "str"),
1015
+ E("errBarType", "str"),
1016
+ E("errValType", "str"),
1017
+ E("noEndCap", "bool"),
1018
+ V("plus", Et),
1019
+ V("minus", Et),
1020
+ E("val", "num"),
1021
+ Tt(),
1022
+ V("extLst", Bt)
1023
+ ] }, se = { fields: [
1024
+ E("gapWidth", "int"),
1025
+ V("upBars", Kt),
1026
+ V("downBars", Kt)
1027
+ ] }, ie = () => [
1028
+ E("idx", "int"),
1029
+ E("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, Et), ue = () => V("extLst", Bt), pe = {
1033
+ bar: { fields: [
1034
+ ...ie(),
1035
+ E("invertIfNegative", "bool"),
1036
+ oe(),
1037
+ ae(),
1038
+ le(),
1039
+ de(),
1040
+ ce("cat"),
1041
+ ce("val"),
1042
+ E("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
+ E("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
+ E("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
+ E("smooth", "bool"),
1086
+ ue()
1087
+ ] },
1088
+ bubble: { fields: [
1089
+ ...ie(),
1090
+ E("invertIfNegative", "bool"),
1091
+ oe(),
1092
+ ae(),
1093
+ le(),
1094
+ de(),
1095
+ ce("xVal"),
1096
+ ce("yVal"),
1097
+ ce("bubbleSize"),
1098
+ E("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
+ ...E("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
+ ...E("secondPiePt", "int", "points"),
1126
+ many: !0
1127
+ }] }, e, n);
1128
+ return r.unknown ? void 0 : r.points ?? [];
1129
+ },
1130
+ write: (t, e) => {
1131
+ z(t, "c:custSplit", { points: e }, { fields: [{
1132
+ ...E("secondPiePt", "int", "points"),
1133
+ many: !0
1134
+ }] });
1135
+ }
1136
+ }, ge = { fields: [E("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
+ z(t, "c:bandFmts", { formats: e }, { fields: [V("bandFmt", ge, "formats", { many: !0 })] });
1146
+ }
1147
+ }, ve = {
1148
+ areaChart: {
1149
+ type: "area",
1150
+ codec: { fields: [
1151
+ E("grouping", "str"),
1152
+ E("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
+ E("grouping", "str"),
1164
+ E("varyColors", "bool"),
1165
+ fe("area"),
1166
+ ae(),
1167
+ he("dropLines"),
1168
+ E("gapDepth", "int"),
1169
+ me()
1170
+ ] }
1171
+ },
1172
+ lineChart: {
1173
+ type: "line",
1174
+ codec: { fields: [
1175
+ E("grouping", "str"),
1176
+ E("varyColors", "bool"),
1177
+ fe("line"),
1178
+ ae(),
1179
+ he("dropLines"),
1180
+ he("hiLowLines"),
1181
+ V("upDownBars", se),
1182
+ E("marker", "bool"),
1183
+ E("smooth", "bool"),
1184
+ me()
1185
+ ] }
1186
+ },
1187
+ line3DChart: {
1188
+ type: "line",
1189
+ is3D: !0,
1190
+ codec: { fields: [
1191
+ E("grouping", "str"),
1192
+ E("varyColors", "bool"),
1193
+ fe("line"),
1194
+ ae(),
1195
+ he("dropLines"),
1196
+ E("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
+ E("radarStyle", "str"),
1215
+ E("varyColors", "bool"),
1216
+ fe("radar"),
1217
+ ae(),
1218
+ me()
1219
+ ] }
1220
+ },
1221
+ scatterChart: {
1222
+ type: "scatter",
1223
+ codec: { fields: [
1224
+ E("scatterStyle", "str"),
1225
+ E("varyColors", "bool"),
1226
+ fe("scatter"),
1227
+ ae(),
1228
+ me()
1229
+ ] }
1230
+ },
1231
+ pieChart: {
1232
+ type: "pie",
1233
+ codec: { fields: [
1234
+ E("varyColors", "bool"),
1235
+ fe("pie"),
1236
+ ae(),
1237
+ E("firstSliceAng", "int")
1238
+ ] }
1239
+ },
1240
+ pie3DChart: {
1241
+ type: "pie",
1242
+ is3D: !0,
1243
+ codec: { fields: [
1244
+ E("varyColors", "bool"),
1245
+ fe("pie"),
1246
+ ae()
1247
+ ] }
1248
+ },
1249
+ doughnutChart: {
1250
+ type: "doughnut",
1251
+ codec: { fields: [
1252
+ E("varyColors", "bool"),
1253
+ fe("pie"),
1254
+ ae(),
1255
+ E("firstSliceAng", "int"),
1256
+ E("holeSize", "int")
1257
+ ] }
1258
+ },
1259
+ barChart: {
1260
+ type: "bar",
1261
+ codec: { fields: [
1262
+ E("barDir", "str"),
1263
+ E("grouping", "str"),
1264
+ E("varyColors", "bool"),
1265
+ fe("bar"),
1266
+ ae(),
1267
+ E("gapWidth", "int"),
1268
+ E("overlap", "int"),
1269
+ he("serLines", !0),
1270
+ me()
1271
+ ] }
1272
+ },
1273
+ bar3DChart: {
1274
+ type: "bar",
1275
+ is3D: !0,
1276
+ codec: { fields: [
1277
+ E("barDir", "str"),
1278
+ E("grouping", "str"),
1279
+ E("varyColors", "bool"),
1280
+ fe("bar"),
1281
+ ae(),
1282
+ E("gapWidth", "int"),
1283
+ E("gapDepth", "int"),
1284
+ E("shape", "str"),
1285
+ me()
1286
+ ] }
1287
+ },
1288
+ ofPieChart: {
1289
+ type: "ofPie",
1290
+ codec: { fields: [
1291
+ E("ofPieType", "str"),
1292
+ E("varyColors", "bool"),
1293
+ fe("pie"),
1294
+ ae(),
1295
+ E("gapWidth", "int"),
1296
+ E("splitType", "str"),
1297
+ E("splitPos", "num"),
1298
+ be,
1299
+ E("secondPieSize", "int"),
1300
+ he("serLines", !0)
1301
+ ] }
1302
+ },
1303
+ surfaceChart: {
1304
+ type: "surface",
1305
+ codec: { fields: [
1306
+ E("wireframe", "bool"),
1307
+ fe("surface"),
1308
+ ye,
1309
+ me()
1310
+ ] }
1311
+ },
1312
+ surface3DChart: {
1313
+ type: "surface",
1314
+ is3D: !0,
1315
+ codec: { fields: [
1316
+ E("wireframe", "bool"),
1317
+ fe("surface"),
1318
+ ye,
1319
+ me()
1320
+ ] }
1321
+ },
1322
+ bubbleChart: {
1323
+ type: "bubble",
1324
+ codec: { fields: [
1325
+ E("varyColors", "bool"),
1326
+ fe("bubble"),
1327
+ ae(),
1328
+ E("bubble3D", "bool"),
1329
+ E("bubbleScale", "int"),
1330
+ E("showNegBubbles", "bool"),
1331
+ E("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 } = e;
1353
+ z(t, `c:${n}`, i, ve[n].codec);
1354
+ }
1355
+ }, we = { fields: [
1356
+ E("logBase", "num"),
1357
+ E("orientation", "str"),
1358
+ E("max", "num"),
1359
+ E("min", "num")
1360
+ ] }, ke = { fields: [
1361
+ V("layout", Jt),
1362
+ V("tx", Vt),
1363
+ Tt(),
1364
+ It()
1365
+ ] }, Se = { fields: [
1366
+ E("custUnit", "num"),
1367
+ E("builtInUnit", "str"),
1368
+ V("dispUnitsLbl", ke)
1369
+ ] }, Pe = () => [
1370
+ E("axId", "int"),
1371
+ V("scaling", we),
1372
+ E("delete", "bool"),
1373
+ E("axPos", "str"),
1374
+ he("majorGridlines"),
1375
+ he("minorGridlines"),
1376
+ V("title", _t),
1377
+ V("numFmt", qt),
1378
+ E("majorTickMark", "str"),
1379
+ E("minorTickMark", "str"),
1380
+ E("tickLblPos", "str"),
1381
+ Tt(),
1382
+ It(),
1383
+ E("crossAx", "int"),
1384
+ E("crosses", "str"),
1385
+ E("crossesAt", "num")
1386
+ ], Le = {
1387
+ valAx: {
1388
+ type: "val",
1389
+ codec: { fields: [
1390
+ ...Pe(),
1391
+ E("crossBetween", "str"),
1392
+ E("majorUnit", "num"),
1393
+ E("minorUnit", "num"),
1394
+ V("dispUnits", Se)
1395
+ ] }
1396
+ },
1397
+ catAx: {
1398
+ type: "cat",
1399
+ codec: { fields: [
1400
+ ...Pe(),
1401
+ E("auto", "bool"),
1402
+ E("lblAlgn", "str"),
1403
+ E("lblOffset", "int"),
1404
+ E("tickLblSkip", "int"),
1405
+ E("tickMarkSkip", "int"),
1406
+ E("noMultiLvlLbl", "bool")
1407
+ ] }
1408
+ },
1409
+ dateAx: {
1410
+ type: "date",
1411
+ codec: { fields: [
1412
+ ...Pe(),
1413
+ E("auto", "bool"),
1414
+ E("lblOffset", "int"),
1415
+ E("baseTimeUnit", "str"),
1416
+ E("majorUnit", "num"),
1417
+ E("majorTimeUnit", "str"),
1418
+ E("minorUnit", "num"),
1419
+ E("minorTimeUnit", "str")
1420
+ ] }
1421
+ },
1422
+ serAx: {
1423
+ type: "ser",
1424
+ codec: { fields: [
1425
+ ...Pe(),
1426
+ E("tickLblSkip", "int"),
1427
+ E("tickMarkSkip", "int")
1428
+ ] }
1429
+ }
1430
+ }, Ce = {
1431
+ tags: Object.keys(Le),
1432
+ key: "axes",
1433
+ ns: "c",
1434
+ many: !0,
1435
+ read: (t, e, n) => ({
1436
+ type: Le[t.name].type,
1437
+ ...W(t, Le[t.name].codec, e, n)
1438
+ }),
1439
+ write: (t, e) => {
1440
+ const { type: n, ...r } = e, s = `${n}Ax`;
1441
+ z(t, `c:${s}`, r, Le[s].codec);
1442
+ }
1443
+ }, Te = { fields: [
1444
+ E("showHorzBorder", "bool"),
1445
+ E("showVertBorder", "bool"),
1446
+ E("showOutline", "bool"),
1447
+ E("showKeys", "bool"),
1448
+ Tt(),
1449
+ It()
1450
+ ] }, Ie = {
1451
+ fields: [
1452
+ V("layout", Jt),
1453
+ xe,
1454
+ Ce,
1455
+ V("dTable", Te),
1456
+ Tt()
1457
+ ],
1458
+ afterRead: (t) => {
1459
+ t.groups ??= [], t.axes ??= [];
1460
+ }
1461
+ }, De = { fields: [
1462
+ E("rotX", "int"),
1463
+ E("hPercent", "int"),
1464
+ E("rotY", "int"),
1465
+ E("depthPercent", "int"),
1466
+ E("rAngAx", "bool"),
1467
+ E("perspective", "int")
1468
+ ] }, Ne = { fields: [E("thickness", "int"), Tt()] }, $e = { fields: [
1469
+ E("idx", "int"),
1470
+ E("delete", "bool"),
1471
+ It()
1472
+ ] }, Oe = { fields: [
1473
+ E("legendPos", "str"),
1474
+ V("legendEntry", $e, "entries", { many: !0 }),
1475
+ V("layout", Jt),
1476
+ E("overlay", "bool"),
1477
+ Tt(),
1478
+ It()
1479
+ ] }, je = { fields: [
1480
+ V("title", _t),
1481
+ E("autoTitleDeleted", "bool"),
1482
+ V("view3D", De),
1483
+ V("floor", Ne),
1484
+ V("sideWall", Ne),
1485
+ V("backWall", Ne),
1486
+ V("plotArea", Ie),
1487
+ V("legend", Oe),
1488
+ E("plotVisOnly", "bool"),
1489
+ E("dispBlanksAs", "str"),
1490
+ E("showDLblsOverMax", "bool")
1491
+ ] }, Fe = { fields: [H("name"), E("fmtId", "int")] }, Me = { fields: [
1492
+ E("date1904", "bool"),
1493
+ E("lang", "str"),
1494
+ E("roundedCorners", "bool"),
1495
+ E("style", "int"),
1496
+ V("pivotSource", Fe),
1497
+ V("chart", je),
1498
+ Tt(),
1499
+ It()
1500
+ ] }, Re = (t) => {
1501
+ const e = d(t);
1502
+ if (!e || "chartSpace" !== e.name) return null;
1503
+ const n = T(e, P);
1504
+ if (!w(I(e, n))) return null;
1505
+ const r = new A(t, n);
1506
+ return {
1507
+ model: W(e, Me, P, r),
1508
+ kept: r.kept,
1509
+ reordered: r.reordered
1510
+ };
1511
+ }, Ae = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>\r\n", Ue = (t) => {
1512
+ const e = { ...t.unknown?.attributes }, n = (t, n) => {
1513
+ e[`xmlns:${t}`] ??= n;
1514
+ };
1515
+ n(x.c, p), n(x.a, m), n(x.r, b);
1516
+ const r = new D().raw(Ae);
1517
+ return ((t, e) => {
1518
+ z(t, "c:chartSpace", e, Me);
1519
+ })(r, {
1520
+ ...t,
1521
+ unknown: {
1522
+ ...t.unknown,
1523
+ attributes: e
1524
+ }
1525
+ }), r.toString();
1526
+ }, We = (t, e) => {
1527
+ if (e) {
1528
+ const n = Re(e);
1529
+ if (n && JSON.stringify(n.model) === JSON.stringify(t)) return e;
1530
+ }
1531
+ return Ue(t);
1532
+ }, ze = (t, e, n = t, r) => V(t, e, n, {
1533
+ ns: "cx",
1534
+ many: r
1535
+ }), Be = () => ze("spPr", bt), Ee = () => ze("txPr", Ct), He = () => ze("numFmt", qt), Ve = (t) => ({
1536
+ name: t,
1537
+ key: t,
1538
+ read: (t) => {
1539
+ if ("auto" === t) return "auto";
1540
+ const e = Number(t);
1541
+ return "" !== t.trim() && Number.isFinite(e) ? e : void 0;
1542
+ },
1543
+ write: (t) => String(t)
1544
+ }), qe = (t) => C(t).filter(([t]) => "xmlns" !== t && !t.startsWith("xmlns:")), Ge = (t) => ({
1545
+ tags: [t],
1546
+ key: t,
1547
+ ns: "cx",
1548
+ read: (t) => {
1549
+ if (c(t).length > 0) return;
1550
+ const e = { f: u(t) };
1551
+ for (const [n, r] of qe(t)) {
1552
+ if ("dir" !== n || "col" !== r && "row" !== r) return;
1553
+ e.dir = r;
1554
+ }
1555
+ return "" === e.f ? void 0 : e;
1556
+ },
1557
+ write: (e, n) => {
1558
+ const r = B("cx", t);
1559
+ e.open(r, n.dir ? [["dir", n.dir]] : null).text(n.f).close(r);
1560
+ }
1561
+ }), Je = {
1562
+ attributes: [
1563
+ q("ptCount", "int"),
1564
+ q("formatCode", "str"),
1565
+ q("name", "str")
1566
+ ],
1567
+ fields: [{
1568
+ tags: ["pt"],
1569
+ key: "points",
1570
+ ns: "cx",
1571
+ many: !0,
1572
+ read: (t) => {
1573
+ if (c(t).length > 0) return;
1574
+ const e = qe(t);
1575
+ if (1 !== e.length || "idx" !== e[0][0]) return;
1576
+ const n = Number(e[0][1]);
1577
+ return Number.isInteger(n) && F(String(n)) === F(e[0][1]) ? {
1578
+ idx: n,
1579
+ v: u(t)
1580
+ } : void 0;
1581
+ },
1582
+ write: (t, e) => {
1583
+ const n = B("cx", "pt");
1584
+ "" === e.v ? t.open(n, [["idx", String(e.idx)]], !0) : t.open(n, [["idx", String(e.idx)]]).text(e.v).close(n);
1585
+ }
1586
+ }]
1587
+ }, _e = {
1588
+ attributes: [q("type", "str")],
1589
+ fields: [
1590
+ Ge("f"),
1591
+ Ge("nf"),
1592
+ ze("lvl", Je, "levels", !0)
1593
+ ]
1594
+ }, Ke = /* @__PURE__ */ new Set([
1595
+ "val",
1596
+ "x",
1597
+ "y",
1598
+ "size",
1599
+ "colorVal"
1600
+ ]), Xe = /* @__PURE__ */ new Set([
1601
+ "cat",
1602
+ "colorStr",
1603
+ "entityId"
1604
+ ]), Ye = {
1605
+ fields: [ze("data", {
1606
+ attributes: [q("id", "int")],
1607
+ fields: [{
1608
+ tags: ["numDim", "strDim"],
1609
+ key: "dimensions",
1610
+ ns: "cx",
1611
+ many: !0,
1612
+ read: (t, e, n) => {
1613
+ const r = W(t, _e, e, n);
1614
+ return ("numDim" === t.name ? Ke : Xe).has(r.type) ? r : void 0;
1615
+ },
1616
+ write: (t, e) => {
1617
+ z(t, B("cx", Ke.has(e.type) ? "numDim" : "strDim"), e, _e);
1618
+ }
1619
+ }],
1620
+ afterRead: (t) => {
1621
+ t.dimensions ??= [];
1622
+ }
1623
+ }, "data", !0)],
1624
+ afterRead: (t) => {
1625
+ t.data ??= [];
1626
+ }
1627
+ }, Qe = { fields: [ze("txData", { fields: [Ge("f"), H("v", "v", "cx")] }), ze("rich", Ct)] }, Ze = () => [
1628
+ q("pos", "str"),
1629
+ q("align", "str"),
1630
+ q("overlay", "bool")
1631
+ ], tn = {
1632
+ attributes: Ze(),
1633
+ fields: [
1634
+ ze("tx", Qe),
1635
+ Be(),
1636
+ Ee()
1637
+ ]
1638
+ }, en = {
1639
+ attributes: Ze(),
1640
+ fields: [Be(), Ee()]
1641
+ }, nn = {
1642
+ attributes: [
1643
+ q("seriesName", "bool"),
1644
+ q("categoryName", "bool"),
1645
+ q("value", "bool")
1646
+ ],
1647
+ fields: []
1648
+ }, rn = () => [
1649
+ He(),
1650
+ Be(),
1651
+ Ee(),
1652
+ ze("visibility", nn),
1653
+ H("separator", "separator", "cx")
1654
+ ], sn = {
1655
+ attributes: [q("idx", "int"), q("pos", "str")],
1656
+ fields: rn()
1657
+ }, on = {
1658
+ attributes: [q("idx", "int")],
1659
+ fields: []
1660
+ }, an = {
1661
+ attributes: [q("pos", "str")],
1662
+ fields: [
1663
+ ...rn(),
1664
+ ze("dataLabel", sn, "labels", !0),
1665
+ ze("dataLabelHidden", on, "hiddenLabels", !0)
1666
+ ]
1667
+ }, ln = {
1668
+ attributes: [q("idx", "int")],
1669
+ fields: [Be()]
1670
+ }, dn = {
1671
+ attributes: [
1672
+ "connectorLines",
1673
+ "meanLine",
1674
+ "meanMarker",
1675
+ "nonoutliers",
1676
+ "outliers"
1677
+ ].map((t) => q(t, "bool")),
1678
+ fields: []
1679
+ }, cn = {
1680
+ attributes: [
1681
+ q("intervalClosed", "str"),
1682
+ Ve("underflow"),
1683
+ Ve("overflow")
1684
+ ],
1685
+ fields: [E("binSize", "num", "binSize", "cx"), E("binCount", "int", "binCount", "cx")]
1686
+ }, un = { fields: [{
1687
+ ...E("idx", "int", "indexes", "cx"),
1688
+ many: !0
1689
+ }] }, pn = { fields: [
1690
+ E("parentLabelLayout", "str", "parentLabelLayout", "cx"),
1691
+ E("regionLabelLayout", "str", "regionLabelLayout", "cx"),
1692
+ ze("visibility", dn),
1693
+ ze("aggregation", { fields: [] }),
1694
+ ze("binning", cn),
1695
+ ze("statistics", {
1696
+ attributes: [q("quartileMethod", "str")],
1697
+ fields: []
1698
+ }),
1699
+ {
1700
+ tags: ["subtotals"],
1701
+ key: "subtotals",
1702
+ ns: "cx",
1703
+ read: (t, e, n) => {
1704
+ const r = W(t, un, e, n);
1705
+ return r.unknown ? void 0 : r.indexes ?? [];
1706
+ },
1707
+ write: (t, e) => {
1708
+ z(t, B("cx", "subtotals"), { indexes: e }, un);
1709
+ }
1710
+ }
1711
+ ] }, fn = {
1712
+ attributes: [
1713
+ q("layoutId", "str"),
1714
+ q("hidden", "bool"),
1715
+ q("ownerIdx", "int"),
1716
+ q("uniqueId", "str"),
1717
+ q("formatIdx", "int")
1718
+ ],
1719
+ fields: [
1720
+ ze("tx", Qe),
1721
+ Be(),
1722
+ ze("dataPt", ln, "points", !0),
1723
+ ze("dataLabels", an),
1724
+ E("dataId", "int", "dataId", "cx"),
1725
+ ze("layoutPr", pn),
1726
+ {
1727
+ ...E("axisId", "int", "axisIds", "cx"),
1728
+ many: !0
1729
+ }
1730
+ ]
1731
+ }, mn = {
1732
+ fields: [ze("plotSurface", { fields: [Be()] }), ze("series", fn, "series", !0)],
1733
+ afterRead: (t) => {
1734
+ t.series ??= [];
1735
+ }
1736
+ }, hn = { fields: [
1737
+ ze("tx", Qe),
1738
+ Be(),
1739
+ Ee()
1740
+ ] }, bn = { fields: [Be()] }, gn = {
1741
+ attributes: [q("type", "str")],
1742
+ fields: []
1743
+ }, yn = {
1744
+ attributes: [q("id", "int"), q("hidden", "bool")],
1745
+ fields: [
1746
+ ze("catScaling", {
1747
+ attributes: [q("gapWidth", "num")],
1748
+ fields: []
1749
+ }),
1750
+ ze("valScaling", {
1751
+ attributes: [
1752
+ "max",
1753
+ "min",
1754
+ "majorUnit",
1755
+ "minorUnit"
1756
+ ].map((t) => q(t, "num")),
1757
+ fields: []
1758
+ }),
1759
+ ze("title", hn),
1760
+ ze("units", {
1761
+ attributes: [q("unit", "str")],
1762
+ fields: [ze("unitsLabel", hn)]
1763
+ }),
1764
+ ze("majorGridlines", bn),
1765
+ ze("minorGridlines", bn),
1766
+ ze("majorTickMarks", gn),
1767
+ ze("minorTickMarks", gn),
1768
+ ze("tickLabels", { fields: [] }),
1769
+ He(),
1770
+ Be(),
1771
+ Ee()
1772
+ ]
1773
+ }, vn = {
1774
+ fields: [
1775
+ ze("plotAreaRegion", mn),
1776
+ ze("axis", yn, "axes", !0),
1777
+ Be()
1778
+ ],
1779
+ afterRead: (t) => {
1780
+ t.axes ??= [];
1781
+ }
1782
+ }, xn = { fields: [
1783
+ ze("title", tn),
1784
+ ze("plotArea", vn),
1785
+ ze("legend", en)
1786
+ ] }, wn = { fields: [
1787
+ ze("chartData", Ye),
1788
+ ze("chart", xn),
1789
+ Be(),
1790
+ Ee()
1791
+ ] }, kn = {
1792
+ waterfall: "waterfall",
1793
+ clusteredColumn: "histogram",
1794
+ boxWhisker: "boxWhisker",
1795
+ treemap: "treemap",
1796
+ sunburst: "sunburst",
1797
+ funnel: "funnel",
1798
+ regionMap: "regionMap"
1799
+ }, Sn = Object.fromEntries(Object.entries(kn).map(([t, e]) => [e, t])), Pn = new Set(Object.values(kn)), Ln = "paretoLine", Cn = {
1800
+ cat: "cat",
1801
+ val: "val",
1802
+ x: "xVal",
1803
+ y: "yVal",
1804
+ size: "bubbleSize",
1805
+ colorVal: "color",
1806
+ colorStr: "color",
1807
+ entityId: "entityId"
1808
+ }, Tn = /* @__PURE__ */ new Set([
1809
+ "val",
1810
+ "x",
1811
+ "y",
1812
+ "size",
1813
+ "colorVal"
1814
+ ]), In = [
1815
+ "cat",
1816
+ "colorStr",
1817
+ "entityId",
1818
+ "x",
1819
+ "y",
1820
+ "val",
1821
+ "size",
1822
+ "colorVal"
1823
+ ], Dn = (t) => {
1824
+ for (const e of Object.keys(t)) void 0 === t[e] && delete t[e];
1825
+ return t;
1826
+ }, Nn = (t) => Dn({
1827
+ f: t.f,
1828
+ dir: t.dir
1829
+ }), $n = (t) => t && Dn({
1830
+ strRef: t.txData?.f ? Nn(t.txData.f) : void 0,
1831
+ v: t.txData?.v,
1832
+ rich: t.rich,
1833
+ unknown: t.unknown
1834
+ }), On = (t) => t && Dn({
1835
+ tx: $n(t.tx),
1836
+ overlay: t.overlay,
1837
+ spPr: t.spPr,
1838
+ txPr: t.txPr,
1839
+ pos: t.pos,
1840
+ align: t.align,
1841
+ unknown: t.unknown
1842
+ }), jn = (t) => Dn({
1843
+ numFmt: t.numFmt,
1844
+ spPr: t.spPr,
1845
+ txPr: t.txPr,
1846
+ dLblPos: t.pos,
1847
+ showSerName: t.visibility?.seriesName,
1848
+ showCatName: t.visibility?.categoryName,
1849
+ showVal: t.visibility?.value,
1850
+ separator: t.separator,
1851
+ unknown: t.unknown
1852
+ }), Fn = (t) => {
1853
+ if (!t) return;
1854
+ const e = jn(t), n = [...(t.labels ?? []).map((t) => ({
1855
+ idx: t.idx,
1856
+ ...jn(t)
1857
+ })), ...(t.hiddenLabels ?? []).map((t) => ({
1858
+ idx: t.idx,
1859
+ delete: !0
1860
+ }))];
1861
+ return n.length > 0 && (e.labels = n), e;
1862
+ }, Mn = (t, e) => {
1863
+ const n = (t ?? []).map((t) => ({ ...t }));
1864
+ for (const t of [...e ?? []].sort((t, e) => t - e)) {
1865
+ const e = n.find((e) => e.idx === t);
1866
+ e ? e.subtotal = !0 : n.push({
1867
+ idx: t,
1868
+ subtotal: !0
1869
+ });
1870
+ }
1871
+ return n.length > 0 ? n : void 0;
1872
+ }, Rn = (t) => {
1873
+ if (!t) return;
1874
+ const { subtotals: e, ...n } = t;
1875
+ return Object.keys(n).length > 0 ? n : void 0;
1876
+ }, An = (t) => Dn({
1877
+ ptCount: t.ptCount,
1878
+ formatCode: t.formatCode,
1879
+ name: t.name,
1880
+ points: (t.points ?? []).map((t) => ({
1881
+ idx: t.idx,
1882
+ v: t.v
1883
+ })),
1884
+ unknown: t.unknown
1885
+ }), Un = (t) => {
1886
+ const e = Tn.has(t.type), n = t.levels?.map(An), r = {};
1887
+ return t.f ? r[e ? "numRef" : "strRef"] = Dn({
1888
+ ...Nn(t.f),
1889
+ cache: n ? { levels: n } : void 0
1890
+ }) : r[e ? "numLit" : "strLit"] = Dn({ levels: n }), t.nf && (r.nf = Nn(t.nf)), t.unknown && (r.unknown = t.unknown), r;
1891
+ }, Wn = (t, e) => {
1892
+ const n = Dn({
1893
+ idx: t.formatIdx,
1894
+ hidden: t.hidden,
1895
+ uniqueId: t.uniqueId,
1896
+ tx: $n(t.tx),
1897
+ spPr: t.spPr,
1898
+ points: Mn(t.points, t.layoutPr?.subtotals),
1899
+ dLbls: Fn(t.dataLabels),
1900
+ layoutPr: Rn(t.layoutPr),
1901
+ unknown: t.unknown
1902
+ });
1903
+ for (const t of e?.dimensions ?? []) {
1904
+ const e = Cn[t.type];
1905
+ e && !n[e] && (n[e] = Un(t));
1906
+ }
1907
+ return n;
1908
+ }, zn = (t) => Dn({
1909
+ idx: t.formatIdx,
1910
+ hidden: t.hidden,
1911
+ uniqueId: t.uniqueId,
1912
+ tx: $n(t.tx),
1913
+ spPr: t.spPr,
1914
+ points: Mn(t.points, t.layoutPr?.subtotals),
1915
+ dLbls: Fn(t.dataLabels),
1916
+ layoutPr: Rn(t.layoutPr),
1917
+ axIds: t.axisIds,
1918
+ unknown: t.unknown
1919
+ }), Bn = (t, e) => {
1920
+ const n = new Map(e.map((t) => [t.id, t])), r = [], s = [];
1921
+ let i = null;
1922
+ for (const e of t?.series ?? []) {
1923
+ if (e.layoutId === Ln) {
1924
+ const t = void 0 === e.ownerIdx ? null : s[e.ownerIdx];
1925
+ t && !t.cumulativeLine && (t.cumulativeLine = zn(e)), s.push(null);
1926
+ continue;
1927
+ }
1928
+ const t = kn[e.layoutId] ?? e.layoutId, o = e.axisIds ?? [];
1929
+ i && i.type === t && JSON.stringify(i.axIds) === JSON.stringify(o) || (i = {
1930
+ type: t,
1931
+ series: [],
1932
+ axIds: o
1933
+ }, r.push(i));
1934
+ const a = Wn(e, void 0 === e.dataId ? void 0 : n.get(e.dataId));
1935
+ i.series.push(a), s.push(a);
1936
+ }
1937
+ return r;
1938
+ }, En = (t) => {
1939
+ const e = t.catScaling ?? t.valScaling;
1940
+ return Dn({
1941
+ type: t.catScaling || !t.valScaling ? "cat" : "val",
1942
+ axId: t.id,
1943
+ scaling: Dn({
1944
+ max: t.valScaling?.max,
1945
+ min: t.valScaling?.min,
1946
+ gapWidth: t.catScaling?.gapWidth,
1947
+ unknown: e?.unknown
1948
+ }),
1949
+ delete: t.hidden,
1950
+ majorGridlines: t.majorGridlines,
1951
+ minorGridlines: t.minorGridlines,
1952
+ title: On(t.title),
1953
+ numFmt: t.numFmt,
1954
+ majorTickMark: t.majorTickMarks?.type,
1955
+ minorTickMark: t.minorTickMarks?.type,
1956
+ tickLblPos: t.tickLabels ? void 0 : "none",
1957
+ spPr: t.spPr,
1958
+ txPr: t.txPr,
1959
+ majorUnit: t.valScaling?.majorUnit,
1960
+ minorUnit: t.valScaling?.minorUnit,
1961
+ dispUnits: t.units && Dn({
1962
+ builtInUnit: t.units.unit,
1963
+ dispUnitsLbl: On(t.units.unitsLabel),
1964
+ unknown: t.units.unknown
1965
+ }),
1966
+ unknown: t.unknown
1967
+ });
1968
+ }, Hn = (t) => t && Dn({
1969
+ txData: t.strRef || void 0 !== t.v ? Dn({
1970
+ f: t.strRef ? Nn(t.strRef) : void 0,
1971
+ v: t.v
1972
+ }) : void 0,
1973
+ rich: t.rich,
1974
+ unknown: t.unknown
1975
+ }), Vn = (t) => t && Dn({
1976
+ tx: Hn(t.tx),
1977
+ spPr: t.spPr,
1978
+ txPr: t.txPr,
1979
+ unknown: t.unknown
1980
+ }), qn = (t) => {
1981
+ const e = void 0 !== t.showSerName || void 0 !== t.showCatName || void 0 !== t.showVal;
1982
+ return Dn({
1983
+ pos: t.dLblPos,
1984
+ numFmt: t.numFmt,
1985
+ spPr: t.spPr,
1986
+ txPr: t.txPr,
1987
+ visibility: e ? Dn({
1988
+ seriesName: t.showSerName,
1989
+ categoryName: t.showCatName,
1990
+ value: t.showVal
1991
+ }) : void 0,
1992
+ separator: t.separator,
1993
+ unknown: t.unknown
1994
+ });
1995
+ }, Gn = (t) => !0 === t.delete && Object.keys(t).every((t) => "idx" === t || "delete" === t), Jn = (t) => {
1996
+ if (!t) return;
1997
+ const e = qn(t), n = (t.labels ?? []).filter((t) => !Gn(t)).map((t) => ({
1998
+ idx: t.idx,
1999
+ ...qn(t)
2000
+ })), r = (t.labels ?? []).filter(Gn).map((t) => ({ idx: t.idx }));
2001
+ return n.length > 0 && (e.labels = n), r.length > 0 && (e.hiddenLabels = r), e;
2002
+ }, _n = (t) => {
2003
+ const e = (t ?? []).filter((t) => Object.keys(t).some((t) => "idx" !== t && "subtotal" !== t)).map(({ subtotal: t, ...e }) => e);
2004
+ return e.length > 0 ? e : void 0;
2005
+ }, Kn = (t, e, n) => {
2006
+ const r = (e ?? []).filter((t) => t.subtotal).map((t) => t.idx).sort((t, e) => t - e);
2007
+ return 0 !== r.length || n ? {
2008
+ ...t,
2009
+ subtotals: r
2010
+ } : t;
2011
+ }, Xn = (t) => Dn({
2012
+ ptCount: t.ptCount,
2013
+ formatCode: t.formatCode,
2014
+ name: t.name,
2015
+ points: t.points.length > 0 ? t.points.map((t) => ({
2016
+ idx: t.idx,
2017
+ v: t.v
2018
+ })) : void 0,
2019
+ unknown: t.unknown
2020
+ }), Yn = (t, e) => "color" === t ? e.strRef || e.strLit ? "colorStr" : "colorVal" : Object.keys(Cn).find((e) => Cn[e] === t), Qn = (t) => {
2021
+ const e = [];
2022
+ for (const n of [
2023
+ "cat",
2024
+ "val",
2025
+ "xVal",
2026
+ "yVal",
2027
+ "bubbleSize",
2028
+ "color",
2029
+ "entityId"
2030
+ ]) {
2031
+ const r = t[n];
2032
+ if (!r) continue;
2033
+ const s = r.numRef ?? r.strRef, i = (s ? s.cache : r.numLit ?? r.strLit)?.levels;
2034
+ e.push(Dn({
2035
+ type: Yn(n, r),
2036
+ f: s ? Nn(s) : void 0,
2037
+ nf: r.nf ? Nn(r.nf) : void 0,
2038
+ levels: i && i.length > 0 ? i.map(Xn) : void 0,
2039
+ unknown: r.unknown
2040
+ }));
2041
+ }
2042
+ return e.sort((t, e) => In.indexOf(t.type) - In.indexOf(e.type));
2043
+ }, Zn = (t) => {
2044
+ const e = t.scaling ?? {}, n = "cat" === t.type || "date" === t.type;
2045
+ return Dn({
2046
+ id: t.axId,
2047
+ hidden: t.delete,
2048
+ catScaling: n ? Dn({
2049
+ gapWidth: e.gapWidth,
2050
+ unknown: e.unknown
2051
+ }) : void 0,
2052
+ valScaling: n ? void 0 : Dn({
2053
+ max: e.max,
2054
+ min: e.min,
2055
+ majorUnit: t.majorUnit,
2056
+ minorUnit: t.minorUnit,
2057
+ unknown: e.unknown
2058
+ }),
2059
+ title: Vn(t.title),
2060
+ units: t.dispUnits && Dn({
2061
+ unit: t.dispUnits.builtInUnit,
2062
+ unitsLabel: Vn(t.dispUnits.dispUnitsLbl),
2063
+ unknown: t.dispUnits.unknown
2064
+ }),
2065
+ majorGridlines: t.majorGridlines,
2066
+ minorGridlines: t.minorGridlines,
2067
+ majorTickMarks: t.majorTickMark ? { type: t.majorTickMark } : void 0,
2068
+ minorTickMarks: t.minorTickMark ? { type: t.minorTickMark } : void 0,
2069
+ tickLabels: "none" === t.tickLblPos ? void 0 : {},
2070
+ numFmt: t.numFmt,
2071
+ spPr: t.spPr,
2072
+ txPr: t.txPr,
2073
+ unknown: t.unknown
2074
+ });
2075
+ }, tr = (t) => {
2076
+ const e = t.chart, n = e?.plotArea, r = [], s = [], i = [];
2077
+ for (const t of n?.groups ?? []) {
2078
+ const e = Sn[t.type];
2079
+ if (e) for (const n of t.series) {
2080
+ const o = Qn(n);
2081
+ let a;
2082
+ if (o.length > 0) {
2083
+ const t = JSON.stringify(o);
2084
+ a = i.indexOf(t), -1 === a && (a = s.length, s.push({
2085
+ id: a,
2086
+ dimensions: o
2087
+ }), i.push(t));
2088
+ }
2089
+ const l = r.length;
2090
+ r.push(Dn({
2091
+ layoutId: e,
2092
+ hidden: n.hidden,
2093
+ uniqueId: n.uniqueId,
2094
+ formatIdx: n.idx,
2095
+ tx: Hn(n.tx),
2096
+ spPr: n.spPr,
2097
+ points: _n(n.points),
2098
+ dataLabels: Jn(n.dLbls),
2099
+ dataId: a,
2100
+ layoutPr: Kn(n.layoutPr, n.points, "waterfall" === t.type),
2101
+ axisIds: t.axIds.length > 0 ? t.axIds : void 0,
2102
+ unknown: n.unknown
2103
+ }));
2104
+ const d = n.cumulativeLine;
2105
+ d && r.push(Dn({
2106
+ layoutId: Ln,
2107
+ hidden: d.hidden,
2108
+ ownerIdx: l,
2109
+ uniqueId: d.uniqueId,
2110
+ formatIdx: d.idx,
2111
+ tx: Hn(d.tx),
2112
+ spPr: d.spPr,
2113
+ points: _n(d.points),
2114
+ dataLabels: Jn(d.dLbls),
2115
+ layoutPr: Kn(d.layoutPr, d.points, !1),
2116
+ axisIds: d.axIds,
2117
+ unknown: d.unknown
2118
+ }));
2119
+ }
2120
+ }
2121
+ const o = e?.legend;
2122
+ return Dn({
2123
+ chartData: { data: s },
2124
+ chart: Dn({
2125
+ title: (a = e?.title, a && Dn({
2126
+ pos: a.pos,
2127
+ align: a.align,
2128
+ overlay: a.overlay,
2129
+ tx: Hn(a.tx),
2130
+ spPr: a.spPr,
2131
+ txPr: a.txPr,
2132
+ unknown: a.unknown
2133
+ })),
2134
+ plotArea: Dn({
2135
+ plotAreaRegion: Dn({
2136
+ plotSurface: n?.plotSurface,
2137
+ series: r
2138
+ }),
2139
+ axes: (n?.axes ?? []).map(Zn),
2140
+ spPr: n?.spPr,
2141
+ unknown: n?.unknown
2142
+ }),
2143
+ legend: o && Dn({
2144
+ pos: "tr" === o.legendPos ? "r" : o.legendPos,
2145
+ align: o.align,
2146
+ overlay: o.overlay,
2147
+ spPr: o.spPr,
2148
+ txPr: o.txPr,
2149
+ unknown: o.unknown
2150
+ }),
2151
+ unknown: e?.unknown
2152
+ }),
2153
+ spPr: t.spPr,
2154
+ txPr: t.txPr,
2155
+ unknown: t.unknown
2156
+ });
2157
+ var a;
2158
+ }, er = (t, e) => {
2159
+ if (t === e) return !0;
2160
+ if ("object" != typeof t || "object" != typeof e || null === t || null === e) return !1;
2161
+ if (Array.isArray(t) !== Array.isArray(e)) return !1;
2162
+ const n = (t) => Object.keys(t).filter((e) => void 0 !== t[e]), r = n(t), s = n(e);
2163
+ return r.length === s.length && r.every((n) => er(t[n], e[n]));
2164
+ }, nr = (t, e) => er(t, tr(e)), rr = (t) => {
2165
+ const e = d(t);
2166
+ if (!e || "chartSpace" !== e.name) return null;
2167
+ const n = T(e, P);
2168
+ if (!S(I(e, n))) return null;
2169
+ const r = new A(t, n), s = W(e, wn, P, r), i = ((t) => {
2170
+ const e = t.chart, n = e?.plotArea, r = e?.legend;
2171
+ return Dn({
2172
+ chart: Dn({
2173
+ title: On(e?.title),
2174
+ plotArea: Dn({
2175
+ groups: Bn(n?.plotAreaRegion, t.chartData?.data ?? []),
2176
+ axes: (n?.axes ?? []).map(En),
2177
+ spPr: n?.spPr,
2178
+ plotSurface: n?.plotAreaRegion?.plotSurface,
2179
+ unknown: n?.unknown
2180
+ }),
2181
+ legend: r && Dn({
2182
+ legendPos: r.pos,
2183
+ align: r.align,
2184
+ overlay: r.overlay,
2185
+ spPr: r.spPr,
2186
+ txPr: r.txPr,
2187
+ unknown: r.unknown
2188
+ }),
2189
+ unknown: e?.unknown
2190
+ }),
2191
+ spPr: t.spPr,
2192
+ txPr: t.txPr,
2193
+ unknown: t.unknown
2194
+ });
2195
+ })(s);
2196
+ return {
2197
+ model: i,
2198
+ kept: r.kept,
2199
+ reordered: r.reordered,
2200
+ lossy: !nr(s, i)
2201
+ };
2202
+ }, sr = (t) => {
2203
+ const e = { ...t.unknown?.attributes }, n = (t, n) => {
2204
+ e[`xmlns:${t}`] ??= n;
2205
+ };
2206
+ n(x.a, m), n(x.r, b), n(x.cx, y);
2207
+ const r = tr(t), s = new D().raw(Ae);
2208
+ return ((t, e) => {
2209
+ z(t, B("cx", "chartSpace"), e, wn);
2210
+ })(s, {
2211
+ ...r,
2212
+ unknown: {
2213
+ ...r.unknown,
2214
+ attributes: e
2215
+ }
2216
+ }), s.toString();
2217
+ }, ir = (t, e) => {
2218
+ if (e) {
2219
+ const n = rr(e);
2220
+ if (n && JSON.stringify(n.model) === JSON.stringify(t)) return e;
2221
+ }
2222
+ return sr(t);
2223
+ }, or = {
2224
+ chart: {
2225
+ relType: "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart",
2226
+ contentType: "application/vnd.openxmlformats-officedocument.drawingml.chart+xml",
2227
+ path: "../charts/chart{n}.xml",
2228
+ graphicUri: p
2229
+ },
2230
+ chartEx: {
2231
+ relType: "http://schemas.microsoft.com/office/2014/relationships/chartEx",
2232
+ contentType: "application/vnd.ms-office.chartex+xml",
2233
+ path: "../charts/chartEx{n}.xml",
2234
+ graphicUri: y
2235
+ }
2236
+ }, ar = /* @__PURE__ */ new Set([
2237
+ "area",
2238
+ "bar",
2239
+ "line",
2240
+ "pie",
2241
+ "doughnut",
2242
+ "ofPie",
2243
+ "scatter",
2244
+ "bubble",
2245
+ "radar",
2246
+ "stock",
2247
+ "surface"
2248
+ ]), lr = (t) => t === or.chartEx.relType ? "chartEx" : t === or.chart.relType ? "chart" : null, dr = (t) => ar.has(t) ? "chart" : Pn.has(t) ? "chartEx" : null, cr = (t) => {
2249
+ const e = Re(t);
2250
+ if (e) return {
2251
+ model: e.model,
2252
+ family: "chart",
2253
+ kept: e.kept,
2254
+ lossy: !1
2255
+ };
2256
+ const n = rr(t);
2257
+ return n ? {
2258
+ model: n.model,
2259
+ family: "chartEx",
2260
+ kept: n.kept,
2261
+ lossy: n.lossy
2262
+ } : null;
2263
+ }, ur = (t) => {
2264
+ if (Array.isArray(t)) return t.map(ur);
2265
+ if ("object" != typeof t || null === t) return t;
2266
+ const e = {};
2267
+ for (const [n, r] of Object.entries(t)) "unknown" !== n && (e[n] = ur(r));
2268
+ return e;
2269
+ }, pr = (t, e) => {
2270
+ const n = t.chart?.plotArea?.groups ?? [], r = n.map((t) => dr(t.type)).find((t) => null !== t) ?? e?.family ?? "chart", s = n.filter((t) => dr(t.type) !== r).map((t) => t.type);
2271
+ let i = t;
2272
+ if (s.length > 0) {
2273
+ const e = {
2274
+ ...t.chart.plotArea,
2275
+ groups: n.filter((t) => dr(t.type) === r)
2276
+ };
2277
+ i = {
2278
+ ...t,
2279
+ chart: {
2280
+ ...t.chart,
2281
+ plotArea: e
2282
+ }
2283
+ };
2284
+ }
2285
+ const o = (e?.family ?? r) === r;
2286
+ o || (i = ur(i));
2287
+ const a = o ? e?.xml : void 0;
2288
+ return {
2289
+ family: r,
2290
+ leftOut: s,
2291
+ xml: "chartEx" === r ? ir(i, a) : We(i, a)
2292
+ };
2293
+ };
2294
+ export { s as a, pr as i, lr as n, r as o, cr as r, or as t };