ooxml-core 1.14.0 → 1.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (143) hide show
  1. package/dist/PptxHandler-3A7VEXVK.cjs +13 -0
  2. package/dist/PptxHandler-7POULDRL.mjs +4 -0
  3. package/dist/{PptxHandler-KNBFECUE.mjs → PptxHandler-M35YFCUC.mjs} +2 -2
  4. package/dist/PresentationBuilder-C7NPM7OQ.mjs +4 -0
  5. package/dist/{PresentationBuilder-II7C4A3R.cjs → PresentationBuilder-XVRTITYR.cjs} +6 -5
  6. package/dist/{PresentationBuilder-5DCCFHWJ.mjs → PresentationBuilder-Y6DJK6H2.mjs} +2 -2
  7. package/dist/automation/index.cjs +1198 -1095
  8. package/dist/automation/index.mjs +1198 -1095
  9. package/dist/chunk-5W2QL4SB.cjs +244 -0
  10. package/dist/{chunk-TQE7FFNT.cjs → chunk-AHRFBMLK.cjs} +4070 -2015
  11. package/dist/{chunk-2D4IFQ5M.mjs → chunk-B37EVUMG.mjs} +1 -1
  12. package/dist/{chunk-4WZLFUUA.mjs → chunk-C2Y6SZDN.mjs} +934 -200
  13. package/dist/chunk-CA7KCNL3.mjs +236 -0
  14. package/dist/{chunk-BSUIDT6K.cjs → chunk-DWRJ62KP.cjs} +1 -0
  15. package/dist/{chunk-TNNXOW2O.mjs → chunk-KOX5Y5E5.mjs} +1 -1
  16. package/dist/{chunk-54ASP65T.mjs → chunk-LM6VBPQJ.mjs} +416 -15
  17. package/dist/{chunk-PC4MTLG4.cjs → chunk-OA5V3JJC.cjs} +8 -8
  18. package/dist/{chunk-ORH32TO3.mjs → chunk-OKGQ2X7D.mjs} +3092 -1037
  19. package/dist/{chunk-X7MGZQ6C.cjs → chunk-UGWY72WC.cjs} +396 -254
  20. package/dist/{chunk-XGXIS4PN.mjs → chunk-WBCV52YV.mjs} +3077 -1027
  21. package/dist/{chunk-2EBMHIGJ.mjs → chunk-WEFFRYXN.mjs} +379 -242
  22. package/dist/{chunk-AXF2FC4D.mjs → chunk-WSRCLCMB.mjs} +1 -0
  23. package/dist/{chunk-LMMP67YN.mjs → chunk-XCJRUBGJ.mjs} +1 -1
  24. package/dist/geometry/index.cjs +259 -0
  25. package/dist/geometry/index.d.ts +1 -0
  26. package/dist/geometry/index.d.ts.map +1 -1
  27. package/dist/geometry/index.mjs +255 -1
  28. package/dist/geometry/shape-gallery-catalog.d.ts +32 -0
  29. package/dist/geometry/shape-gallery-catalog.d.ts.map +1 -0
  30. package/dist/index.cjs +371 -112
  31. package/dist/index.mjs +371 -112
  32. package/dist/pptx/automation/index.cjs +4523 -1957
  33. package/dist/pptx/automation/index.d.ts +4 -4
  34. package/dist/pptx/automation/index.mjs +5 -5
  35. package/dist/pptx/chunks/{elements-tK7xnWeS.d.ts → elements-iUzpAeqR.d.ts} +232 -2
  36. package/dist/pptx/chunks/elements-iUzpAeqR.d.ts.map +1 -0
  37. package/dist/pptx/chunks/{index-DS9Y4Ne3.d.ts → index-BWHNCVNC.d.ts} +1673 -1534
  38. package/dist/pptx/chunks/index-BWHNCVNC.d.ts.map +1 -0
  39. package/dist/pptx/chunks/{index-BSpNQuvz.d.ts → index-CiyTR6mm.d.ts} +201 -5
  40. package/dist/pptx/chunks/index-CiyTR6mm.d.ts.map +1 -0
  41. package/dist/pptx/chunks/{text-operations-BdD_UQ11.d.ts → text-operations-CfLVZ7DK.d.ts} +81 -3
  42. package/dist/pptx/chunks/text-operations-CfLVZ7DK.d.ts.map +1 -0
  43. package/dist/pptx/cli/index.cjs +4465 -1899
  44. package/dist/pptx/cli/index.d.ts +1 -1
  45. package/dist/pptx/cli/index.mjs +4 -4
  46. package/dist/pptx/converter/index.cjs +52 -1
  47. package/dist/pptx/converter/index.d.ts +1 -1
  48. package/dist/pptx/converter/index.mjs +2 -2
  49. package/dist/pptx/editor/render/collaboration-live-patch-target.cjs +4 -4
  50. package/dist/pptx/editor/render/collaboration-live-patch-target.mjs +2 -2
  51. package/dist/pptx/editor/render/collaboration-reconcile.cjs +7 -7
  52. package/dist/pptx/editor/render/collaboration-reconcile.mjs +2 -2
  53. package/dist/pptx/editor/render/collaboration-sync.cjs +14 -14
  54. package/dist/pptx/editor/render/collaboration-sync.d.ts.map +1 -1
  55. package/dist/pptx/editor/render/collaboration-sync.mjs +1 -1
  56. package/dist/pptx/editor/render/find-replace.cjs +15 -14
  57. package/dist/pptx/editor/render/find-replace.d.ts +2 -2
  58. package/dist/pptx/editor/render/find-replace.mjs +2 -1
  59. package/dist/pptx/editor/render/slide-operations.cjs +9 -8
  60. package/dist/pptx/editor/render/slide-operations.mjs +3 -2
  61. package/dist/pptx/editor/render/slide-size-rescale.cjs +3 -3
  62. package/dist/pptx/editor/render/slide-size-rescale.d.ts +1 -1
  63. package/dist/pptx/editor/render/slide-size-rescale.d.ts.map +1 -1
  64. package/dist/pptx/editor/render/slide-size-rescale.mjs +3 -3
  65. package/dist/pptx/editor/render/text-runs-style-patch.d.ts +1 -1
  66. package/dist/pptx/editor/render/text-style-scope.d.ts +1 -1
  67. package/dist/pptx/index.cjs +5656 -2290
  68. package/dist/pptx/index.d.ts +5 -5
  69. package/dist/pptx/index.mjs +5 -5
  70. package/dist/teams/ics.d.ts.map +1 -1
  71. package/dist/teams/index.cjs +631 -635
  72. package/dist/teams/index.d.ts +1 -0
  73. package/dist/teams/index.d.ts.map +1 -1
  74. package/dist/teams/index.mjs +616 -636
  75. package/dist/teams/meetings.d.ts +11 -1
  76. package/dist/teams/meetings.d.ts.map +1 -1
  77. package/dist/teams/recurrence-calendar.d.ts +41 -0
  78. package/dist/teams/recurrence-calendar.d.ts.map +1 -0
  79. package/dist/teams/recurrence.d.ts +1 -1
  80. package/dist/teams/recurrence.d.ts.map +1 -1
  81. package/dist/teams/server-session.d.ts +19 -0
  82. package/dist/teams/server-session.d.ts.map +1 -1
  83. package/dist/xlsx/edit/pivots.d.ts.map +1 -1
  84. package/dist/xlsx/index.cjs +1137 -1027
  85. package/dist/xlsx/index.mjs +1136 -1028
  86. package/dist/xlsx/load/index.cjs +593 -652
  87. package/dist/xlsx/load/index.mjs +593 -652
  88. package/dist/xlsx/model-pivots.d.ts +64 -4
  89. package/dist/xlsx/model-pivots.d.ts.map +1 -1
  90. package/dist/xlsx/pivot/aggregate.d.ts +6 -3
  91. package/dist/xlsx/pivot/aggregate.d.ts.map +1 -1
  92. package/dist/xlsx/pivot/axes.d.ts +5 -0
  93. package/dist/xlsx/pivot/axes.d.ts.map +1 -1
  94. package/dist/xlsx/pivot/captions-locales.d.ts +3 -0
  95. package/dist/xlsx/pivot/captions-locales.d.ts.map +1 -0
  96. package/dist/xlsx/pivot/captions-read.d.ts +14 -0
  97. package/dist/xlsx/pivot/captions-read.d.ts.map +1 -0
  98. package/dist/xlsx/pivot/captions.d.ts +26 -0
  99. package/dist/xlsx/pivot/captions.d.ts.map +1 -0
  100. package/dist/xlsx/pivot/columns.d.ts +9 -3
  101. package/dist/xlsx/pivot/columns.d.ts.map +1 -1
  102. package/dist/xlsx/pivot/data.d.ts +3 -2
  103. package/dist/xlsx/pivot/data.d.ts.map +1 -1
  104. package/dist/xlsx/pivot/date-axes.d.ts +1 -1
  105. package/dist/xlsx/pivot/date-axes.d.ts.map +1 -1
  106. package/dist/xlsx/pivot/date-group-read.d.ts.map +1 -1
  107. package/dist/xlsx/pivot/date-groups.d.ts +8 -3
  108. package/dist/xlsx/pivot/date-groups.d.ts.map +1 -1
  109. package/dist/xlsx/pivot/index.d.ts +2 -1
  110. package/dist/xlsx/pivot/index.d.ts.map +1 -1
  111. package/dist/xlsx/pivot/item-labels.d.ts +12 -0
  112. package/dist/xlsx/pivot/item-labels.d.ts.map +1 -0
  113. package/dist/xlsx/pivot/item-names-read.d.ts +8 -0
  114. package/dist/xlsx/pivot/item-names-read.d.ts.map +1 -0
  115. package/dist/xlsx/pivot/measures.d.ts +2 -8
  116. package/dist/xlsx/pivot/measures.d.ts.map +1 -1
  117. package/dist/xlsx/pivot/nested.d.ts +4 -2
  118. package/dist/xlsx/pivot/nested.d.ts.map +1 -1
  119. package/dist/xlsx/pivot/page-filter-admission.d.ts.map +1 -1
  120. package/dist/xlsx/pivot/page-filter.d.ts +1 -1
  121. package/dist/xlsx/pivot/page-filter.d.ts.map +1 -1
  122. package/dist/xlsx/pivot/read.d.ts.map +1 -1
  123. package/dist/xlsx/pivot/subtotals.d.ts +6 -1
  124. package/dist/xlsx/pivot/subtotals.d.ts.map +1 -1
  125. package/dist/xlsx/pivot/table-xml.d.ts.map +1 -1
  126. package/dist/xlsx/pivot/values-axis.d.ts +7 -4
  127. package/dist/xlsx/pivot/values-axis.d.ts.map +1 -1
  128. package/dist/xlsx/ui/commands/i18n/navigation.d.ts.map +1 -1
  129. package/dist/xlsx/ui/commands/i18n/pivots.d.ts.map +1 -1
  130. package/dist/xlsx/ui/index.cjs +1002 -1136
  131. package/dist/xlsx/ui/index.mjs +1002 -1136
  132. package/package.json +1 -1
  133. package/dist/PptxHandler-5YP75BPO.cjs +0 -12
  134. package/dist/PptxHandler-GT5Q66TG.mjs +0 -3
  135. package/dist/PresentationBuilder-CVM6LJ7L.mjs +0 -3
  136. package/dist/pptx/chunks/elements-tK7xnWeS.d.ts.map +0 -1
  137. package/dist/pptx/chunks/index-BSpNQuvz.d.ts.map +0 -1
  138. package/dist/pptx/chunks/index-DS9Y4Ne3.d.ts.map +0 -1
  139. package/dist/pptx/chunks/text-operations-BdD_UQ11.d.ts.map +0 -1
  140. package/dist/xlsx/pivot/hierarchy-first.d.ts +0 -21
  141. package/dist/xlsx/pivot/hierarchy-first.d.ts.map +0 -1
  142. package/dist/xlsx/pivot/hierarchy.d.ts +0 -8
  143. package/dist/xlsx/pivot/hierarchy.d.ts.map +0 -1
@@ -29,19 +29,19 @@ var isCellError = (value2) => typeof value2 === "object" && value2 !== null && "
29
29
  var MAX_ROW = 1048575;
30
30
  var MAX_COL = 16383;
31
31
  function columnLabel(col) {
32
- let label5 = "";
32
+ let label2 = "";
33
33
  let n = col + 1;
34
34
  while (n > 0) {
35
35
  const rem = (n - 1) % 26;
36
- label5 = String.fromCharCode(65 + rem) + label5;
36
+ label2 = String.fromCharCode(65 + rem) + label2;
37
37
  n = Math.floor((n - 1) / 26);
38
38
  }
39
- return label5;
39
+ return label2;
40
40
  }
41
- function columnIndex(label5) {
42
- if (!/^[A-Za-z]{1,3}$/.test(label5)) return -1;
41
+ function columnIndex(label2) {
42
+ if (!/^[A-Za-z]{1,3}$/.test(label2)) return -1;
43
43
  let n = 0;
44
- for (const ch of label5.toUpperCase()) n = n * 26 + (ch.charCodeAt(0) - 64);
44
+ for (const ch of label2.toUpperCase()) n = n * 26 + (ch.charCodeAt(0) - 64);
45
45
  return n - 1;
46
46
  }
47
47
  var formatAddress = (address2) => `${columnLabel(address2.col)}${address2.row + 1}`;
@@ -3838,14 +3838,14 @@ function unique(args, ctx) {
3838
3838
  const byCol = args.length > 1 && args[1] !== null && toBool(ctx.toScalar(args[1] ?? null));
3839
3839
  const once = args.length > 2 && args[2] !== null && toBool(ctx.toScalar(args[2] ?? null));
3840
3840
  if (byCol) m = transpose(m);
3841
- const keyOf2 = (row2) => JSON.stringify(
3841
+ const keyOf3 = (row2) => JSON.stringify(
3842
3842
  row2.map(
3843
3843
  (v) => isError(v) ? `#${v.error}` : typeof v === "string" ? `s${v.toLowerCase()}` : v
3844
3844
  )
3845
3845
  );
3846
3846
  const counts = /* @__PURE__ */ new Map();
3847
3847
  for (const row2 of m.data) {
3848
- const key = keyOf2(row2);
3848
+ const key = keyOf3(row2);
3849
3849
  const entry = counts.get(key);
3850
3850
  if (entry) entry.count++;
3851
3851
  else counts.set(key, { row: row2, count: 1 });
@@ -4136,24 +4136,24 @@ function tableOf(ctx, value2) {
4136
4136
  if (!head || records.length === 0) fail(ERR.VALUE);
4137
4137
  return { headers: head.map((v) => label(v).toLowerCase()), records };
4138
4138
  }
4139
- function fieldIndex(table2, field) {
4139
+ function fieldIndex(table3, field) {
4140
4140
  const value2 = scalar(field);
4141
4141
  if (isError(value2)) fail(value2);
4142
4142
  if (typeof value2 === "number") {
4143
4143
  const index3 = Math.trunc(value2) - 1;
4144
- if (index3 < 0 || index3 >= table2.headers.length) fail(ERR.VALUE);
4144
+ if (index3 < 0 || index3 >= table3.headers.length) fail(ERR.VALUE);
4145
4145
  return index3;
4146
4146
  }
4147
- const index2 = table2.headers.indexOf(label(value2).toLowerCase());
4147
+ const index2 = table3.headers.indexOf(label(value2).toLowerCase());
4148
4148
  if (index2 < 0) fail(ERR.VALUE);
4149
4149
  return index2;
4150
4150
  }
4151
- function recordFilter(table2, criteria) {
4151
+ function recordFilter(table3, criteria) {
4152
4152
  const [head, ...rows2] = criteria;
4153
4153
  if (!head || rows2.length === 0) fail(ERR.VALUE);
4154
4154
  const columns = head.map((name) => {
4155
4155
  if (name === null || name === "") return -1;
4156
- return table2.headers.indexOf(label(name).toLowerCase());
4156
+ return table3.headers.indexOf(label(name).toLowerCase());
4157
4157
  });
4158
4158
  const alternatives = rows2.map(
4159
4159
  (row2) => row2.flatMap((cell, c) => {
@@ -4167,10 +4167,10 @@ function recordFilter(table2, criteria) {
4167
4167
  return (record) => alternatives.some((tests) => tests.every((test) => test(record)));
4168
4168
  }
4169
4169
  function selected(ctx, args) {
4170
- const table2 = tableOf(ctx, args[0]);
4171
- const column2 = fieldIndex(table2, args[1]);
4172
- const matches2 = recordFilter(table2, ctx.toMatrix(args[2] ?? null).data);
4173
- return table2.records.filter(matches2).map((record) => record[column2] ?? null);
4170
+ const table3 = tableOf(ctx, args[0]);
4171
+ const column2 = fieldIndex(table3, args[1]);
4172
+ const matches2 = recordFilter(table3, ctx.toMatrix(args[2] ?? null).data);
4173
+ return table3.records.filter(matches2).map((record) => record[column2] ?? null);
4174
4174
  }
4175
4175
  var numbers = (values2) => {
4176
4176
  for (const v of values2) if (isError(v)) fail(v);
@@ -6469,30 +6469,30 @@ function findTable(host, name, sheet, row2, col) {
6469
6469
  if (name) {
6470
6470
  const lower3 = name.toLowerCase();
6471
6471
  for (let s = 0; s < sheets.length; s++) {
6472
- const table3 = sheets[s]?.tables.find(
6472
+ const table4 = sheets[s]?.tables.find(
6473
6473
  (t) => t.displayName.toLowerCase() === lower3 || t.name.toLowerCase() === lower3
6474
6474
  );
6475
- if (table3) return { table: table3, sheet: s };
6475
+ if (table4) return { table: table4, sheet: s };
6476
6476
  }
6477
6477
  return void 0;
6478
6478
  }
6479
- const table2 = sheets[sheet]?.tables.find(
6479
+ const table3 = sheets[sheet]?.tables.find(
6480
6480
  (t) => row2 >= t.range.start.row && row2 <= t.range.end.row && col >= t.range.start.col && col <= t.range.end.col
6481
6481
  );
6482
- return table2 ? { table: table2, sheet } : void 0;
6482
+ return table3 ? { table: table3, sheet } : void 0;
6483
6483
  }
6484
6484
  function resolveStructured(ref, frame) {
6485
6485
  const found = findTable(frame.host, ref.table, frame.sheet, frame.row, frame.col);
6486
6486
  if (!found) return ref.table ? ERR.NAME : ERR.REF;
6487
- const { table: table2, sheet } = found;
6488
- const range2 = normalizeRange(table2.range);
6489
- const headerRow = table2.headerRow ? range2.start.row : -1;
6490
- const dataStart = range2.start.row + (table2.headerRow ? 1 : 0);
6491
- const dataEnd = range2.end.row - (table2.totalsRow ? 1 : 0);
6492
- const totalsRow = table2.totalsRow ? range2.end.row : -1;
6487
+ const { table: table3, sheet } = found;
6488
+ const range2 = normalizeRange(table3.range);
6489
+ const headerRow = table3.headerRow ? range2.start.row : -1;
6490
+ const dataStart = range2.start.row + (table3.headerRow ? 1 : 0);
6491
+ const dataEnd = range2.end.row - (table3.totalsRow ? 1 : 0);
6492
+ const totalsRow = table3.totalsRow ? range2.end.row : -1;
6493
6493
  const columnOf = (name) => {
6494
6494
  const lower3 = name.toLowerCase();
6495
- const index2 = table2.columns.findIndex((c) => c.name.toLowerCase() === lower3);
6495
+ const index2 = table3.columns.findIndex((c) => c.name.toLowerCase() === lower3);
6496
6496
  return index2 < 0 ? -1 : range2.start.col + index2;
6497
6497
  };
6498
6498
  let c1 = range2.start.col;
@@ -7760,16 +7760,16 @@ function lookupArray(value2) {
7760
7760
  }
7761
7761
  function vhlookup(args, ctx, vertical2) {
7762
7762
  const lookup2 = blankAsZero(args);
7763
- const table2 = lookupArray(args[1] ?? null);
7763
+ const table3 = lookupArray(args[1] ?? null);
7764
7764
  const index2 = int(args[2]);
7765
7765
  const approximate2 = args.length < 4 ? true : bool(args[3]);
7766
- const { rows: rows2, cols } = shape(table2);
7766
+ const { rows: rows2, cols } = shape(table3);
7767
7767
  if (index2 < 1) fail(ERR.VALUE);
7768
7768
  if (index2 > (vertical2 ? cols : rows2)) fail(ERR.REF);
7769
- const keys = line(ctx, table2, vertical2 ? "col" : "row", 0);
7769
+ const keys = line(ctx, table3, vertical2 ? "col" : "row", 0);
7770
7770
  const at = approximate2 ? findAscending(keys, lookup2) : findExact(keys, lookup2, true);
7771
7771
  if (at < 0) fail(ERR.NA);
7772
- return vertical2 ? cellOf(table2, at, index2 - 1) : cellOf(table2, index2 - 1, at);
7772
+ return vertical2 ? cellOf(table3, at, index2 - 1) : cellOf(table3, index2 - 1, at);
7773
7773
  }
7774
7774
  function match(args, ctx) {
7775
7775
  const lookup2 = blankAsZero(args);
@@ -9264,10 +9264,10 @@ var REGRESSION_FUNCTIONS = [
9264
9264
  const lay = logs(layout(ctx, args));
9265
9265
  const fit = fitLeastSquares(lay.x, lay.y, withConst(args, 2));
9266
9266
  const stats = !omitted(args, 3) && bool(args[3]);
9267
- const table2 = coefficientTable(fit, stats, Math.exp);
9268
- if (!stats) return table2;
9267
+ const table3 = coefficientTable(fit, stats, Math.exp);
9268
+ if (!stats) return table3;
9269
9269
  const plain3 = coefficientTable(fit, true, (v) => v).data;
9270
- return new Matrix([table2.data[0] ?? [], ...plain3.slice(1)]);
9270
+ return new Matrix([table3.data[0] ?? [], ...plain3.slice(1)]);
9271
9271
  },
9272
9272
  ARGS
9273
9273
  ),
@@ -11609,7 +11609,7 @@ var DEFAULT_XML_LIMITS = {
11609
11609
  maxNodes: 5e6
11610
11610
  };
11611
11611
  var MARKUP_RE = /<!--[\s\S]*?-->|<!\[CDATA\[[\s\S]*?\]\]>|<\?[\s\S]*?\?>|<(\/?)([^\s\/>]+)(?:\s+[^\s=\/>]+\s*=\s*(?:"[^"]*"|'[^']*'))*\s*(\/?)>/g;
11612
- function checkXmlLimits(xml, label5, limits = {}) {
11612
+ function checkXmlLimits(xml, label2, limits = {}) {
11613
11613
  const maxDepth = limits.maxDepth ?? DEFAULT_XML_LIMITS.maxDepth;
11614
11614
  const maxNodes = limits.maxNodes ?? DEFAULT_XML_LIMITS.maxNodes;
11615
11615
  let depth = 0;
@@ -11622,16 +11622,16 @@ function checkXmlLimits(xml, label5, limits = {}) {
11622
11622
  continue;
11623
11623
  }
11624
11624
  nodes++;
11625
- if (nodes > maxNodes) throw new Error(`${label5} XML exceeds the limit of ${maxNodes} elements`);
11625
+ if (nodes > maxNodes) throw new Error(`${label2} XML exceeds the limit of ${maxNodes} elements`);
11626
11626
  if (!selfClosing && ++depth > maxDepth)
11627
- throw new Error(`${label5} XML exceeds the nesting depth limit of ${maxDepth}`);
11627
+ throw new Error(`${label2} XML exceeds the nesting depth limit of ${maxDepth}`);
11628
11628
  }
11629
11629
  }
11630
11630
  function parseXml(xml, options6 = {}) {
11631
- const label5 = options6.label ?? "OOXML";
11631
+ const label2 = options6.label ?? "OOXML";
11632
11632
  if (/<!DOCTYPE|<!ENTITY/i.test(xml))
11633
- throw new Error(`${label5} XML with DTD or entity declarations is not supported`);
11634
- checkXmlLimits(xml, label5, options6.limits);
11633
+ throw new Error(`${label2} XML with DTD or entity declarations is not supported`);
11634
+ checkXmlLimits(xml, label2, options6.limits);
11635
11635
  let parseError = "";
11636
11636
  let parsed;
11637
11637
  try {
@@ -11642,12 +11642,12 @@ function parseXml(xml, options6 = {}) {
11642
11642
  }).parseFromString(xml, "application/xml");
11643
11643
  } catch (error) {
11644
11644
  throw new Error(
11645
- `Invalid ${label5} XML: ${error instanceof Error ? error.message : String(error)}`,
11645
+ `Invalid ${label2} XML: ${error instanceof Error ? error.message : String(error)}`,
11646
11646
  { cause: error }
11647
11647
  );
11648
11648
  }
11649
11649
  if (parseError || !parsed.documentElement)
11650
- throw new Error(`Invalid ${label5} XML: ${parseError || "missing root element"}`);
11650
+ throw new Error(`Invalid ${label2} XML: ${parseError || "missing root element"}`);
11651
11651
  return parsed;
11652
11652
  }
11653
11653
  var buildXml = (node2) => new xmldom.XMLSerializer().serializeToString(node2);
@@ -11666,11 +11666,514 @@ var pivotRowFields = (pivot) => [
11666
11666
  ...pivot.secondRowField ? [pivot.secondRowField] : [],
11667
11667
  ...pivot.secondRowField ? pivot.moreRowFields ?? [] : []
11668
11668
  ];
11669
+ function pivotValuesIndex(pivot) {
11670
+ if (pivot.valuesAxis !== "rows") return -1;
11671
+ const count2 = pivotRowFields(pivot).length;
11672
+ const at = pivot.valuesPosition;
11673
+ if (typeof at === "number") return Math.min(Math.max(Math.trunc(at), 0), count2);
11674
+ return at === "first" ? 0 : at === "between" ? Math.min(1, count2) : count2;
11675
+ }
11669
11676
  var pivotColumnFields = (pivot) => [
11670
11677
  ...pivot.columnField ? [pivot.columnField] : [],
11671
11678
  ...pivot.columnField ? pivot.moreColumnFields ?? [] : []
11672
11679
  ];
11673
11680
 
11681
+ // i18n/locale.ts
11682
+ var SUPPORTED_OFFICE_LOCALES = ["en", "fr", "de", "es", "zh-CN"];
11683
+ var DEFAULT_REJECTED_SUBTAGS = ["hant", "tw", "hk", "mo"];
11684
+ function normalizeLocale(input, supported, fallback, options6 = {}) {
11685
+ const parts = (input ?? "").trim().toLowerCase().split(/[-_]/).filter(Boolean);
11686
+ const language = parts[0];
11687
+ if (!language) return fallback;
11688
+ const find3 = (tag) => supported.find((item) => item.toLowerCase() === tag);
11689
+ const exact = find3(parts.join("-"));
11690
+ if (exact) return exact;
11691
+ const base = find3(language);
11692
+ if (base) return base;
11693
+ const rejected = options6.rejectedSubtags ?? DEFAULT_REJECTED_SUBTAGS;
11694
+ if (parts.slice(1).some((part) => rejected.includes(part))) return fallback;
11695
+ return supported.find((item) => item.toLowerCase().split("-")[0] === language && item.includes("-")) ?? fallback;
11696
+ }
11697
+ function normalizeOfficeLocale(input) {
11698
+ return normalizeLocale(input, SUPPORTED_OFFICE_LOCALES, "en");
11699
+ }
11700
+
11701
+ // i18n/dictionary.ts
11702
+ function mergeMessageModules(modules) {
11703
+ const merged = {};
11704
+ for (const path of Object.keys(modules).sort()) {
11705
+ const module = modules[path];
11706
+ if (!module) continue;
11707
+ for (const value2 of Object.values(module)) {
11708
+ if (!value2 || typeof value2 !== "object" || Array.isArray(value2)) continue;
11709
+ const entries = Object.entries(value2);
11710
+ if (!entries.every(([, text2]) => typeof text2 === "string")) continue;
11711
+ for (const [key, text2] of entries) merged[key] = text2;
11712
+ }
11713
+ }
11714
+ return merged;
11715
+ }
11716
+
11717
+ // i18n/translator.ts
11718
+ var SINGLE2 = /\{(\w+)\}/g;
11719
+ var DOUBLE = /\{\{\s*(\w+)\s*\}\}/g;
11720
+ function interpolate(template, params, placeholder = "single") {
11721
+ if (!params) return template;
11722
+ const pattern = placeholder === "double" ? DOUBLE : SINGLE2;
11723
+ return template.replace(
11724
+ pattern,
11725
+ (match2, name) => Object.prototype.hasOwnProperty.call(params, name) && params[name] !== void 0 ? String(params[name]) : match2
11726
+ );
11727
+ }
11728
+ function createTranslator(messages, fallbacks = [], options6 = {}) {
11729
+ const placeholder = options6.placeholder ?? "single";
11730
+ return (key, params) => {
11731
+ let text2 = messages?.[key];
11732
+ for (let i2 = 0; text2 === void 0 && i2 < fallbacks.length; i2++) text2 = fallbacks[i2]?.[key];
11733
+ return interpolate(text2 ?? options6.missing?.(key) ?? key, params, placeholder);
11734
+ };
11735
+ }
11736
+
11737
+ // i18n/option-strings.ts
11738
+ var enOptionStrings = {
11739
+ General: "General",
11740
+ Display: "Display",
11741
+ Formulas: "Formulas",
11742
+ Data: "Data",
11743
+ Proofing: "Proofing",
11744
+ Save: "Save",
11745
+ Language: "Language",
11746
+ Accessibility: "Accessibility",
11747
+ Advanced: "Advanced",
11748
+ "Customize Ribbon": "Customize Ribbon",
11749
+ "Quick Access Toolbar": "Quick Access Toolbar",
11750
+ "Add-ins": "Add-ins",
11751
+ "Trust Center": "Trust Center",
11752
+ OK: "OK",
11753
+ Cancel: "Cancel",
11754
+ Close: "Close",
11755
+ Categories: "Categories",
11756
+ "Reset all options": "Reset all options",
11757
+ "General options for working with {product}.": "General options for working with {product}.",
11758
+ "Change how {product} corrects and formats your text.": "Change how {product} corrects and formats your text.",
11759
+ "Customize how documents are saved.": "Customize how documents are saved.",
11760
+ "Set the Office Language Preferences.": "Set the Office Language Preferences.",
11761
+ "Make {product} easier to work with.": "Make {product} easier to work with.",
11762
+ "Advanced options for working with {product}.": "Advanced options for working with {product}.",
11763
+ "Customize the Ribbon and keyboard shortcuts.": "Customize the Ribbon and keyboard shortcuts.",
11764
+ "Customize the Quick Access Toolbar.": "Customize the Quick Access Toolbar.",
11765
+ "View and manage Microsoft Office Add-ins.": "View and manage Microsoft Office Add-ins.",
11766
+ "Help keep your documents safe and your computer secure and healthy.": "Help keep your documents safe and your computer secure and healthy.",
11767
+ "User Interface options": "User Interface options",
11768
+ "Show Mini Toolbar on selection": "Show Mini Toolbar on selection",
11769
+ "Enable Live Preview": "Enable Live Preview",
11770
+ "ScreenTip style": "ScreenTip style",
11771
+ "Show feature descriptions in ScreenTips": "Show feature descriptions in ScreenTips",
11772
+ "Personalize your copy of Microsoft Office": "Personalize your copy of Microsoft Office",
11773
+ "User name": "User name",
11774
+ "Office Theme": "Office Theme",
11775
+ "Office display language": "Office display language",
11776
+ "Choose the language for menus, buttons and messages.": "Choose the language for menus, buttons and messages.",
11777
+ "Not available yet. Needs rich text formatting.": "Not available yet. Needs rich text formatting.",
11778
+ "Not available yet. Styles are applied on click; hover previews are not drawn yet.": "Not available yet. Styles are applied on click; hover previews are not drawn yet.",
11779
+ "Not available yet. ScreenTips always describe the command.": "Not available yet. ScreenTips always describe the command.",
11780
+ "Not available yet. Documents are saved to this device; AutoRecover is not kept.": "Not available yet. Documents are saved to this device; AutoRecover is not kept.",
11781
+ "Not available yet. There are no accessibility settings to change.": "Not available yet. There are no accessibility settings to change.",
11782
+ "Not available yet. The editing behaviour is fixed.": "Not available yet. The editing behaviour is fixed.",
11783
+ "Not available yet. The Quick Access Toolbar is fixed.": "Not available yet. The Quick Access Toolbar is fixed.",
11784
+ "Not available yet. The ribbon layout is fixed.": "Not available yet. The ribbon layout is fixed.",
11785
+ "Not available yet. The display language is fixed.": "Not available yet. The display language is fixed.",
11786
+ "Not available. Add-ins and macros are never run.": "Not available. Add-ins and macros are never run.",
11787
+ "Not available. Documents stay local and active content is never run.": "Not available. Documents stay local and active content is never run."
11788
+ };
11789
+ var frOptionStrings = {
11790
+ General: "G\xE9n\xE9ral",
11791
+ Display: "Affichage",
11792
+ Formulas: "Formules",
11793
+ Data: "Donn\xE9es",
11794
+ Proofing: "V\xE9rification",
11795
+ Save: "Enregistrer",
11796
+ Language: "Langue",
11797
+ Accessibility: "Accessibilit\xE9",
11798
+ Advanced: "Options avanc\xE9es",
11799
+ "Customize Ribbon": "Personnaliser le ruban",
11800
+ "Quick Access Toolbar": "Barre d\u2019outils Acc\xE8s rapide",
11801
+ "Add-ins": "Compl\xE9ments",
11802
+ "Trust Center": "Centre de gestion de la confidentialit\xE9",
11803
+ OK: "OK",
11804
+ Cancel: "Annuler",
11805
+ Close: "Fermer",
11806
+ Categories: "Cat\xE9gories",
11807
+ "Reset all options": "R\xE9initialiser toutes les options",
11808
+ "General options for working with {product}.": "Options g\xE9n\xE9rales pour l\u2019utilisation de {product}.",
11809
+ "Change how {product} corrects and formats your text.": "Modifiez la fa\xE7on dont {product} corrige et met en forme votre texte.",
11810
+ "Customize how documents are saved.": "Personnalisez l\u2019enregistrement des documents.",
11811
+ "Set the Office Language Preferences.": "D\xE9finissez les pr\xE9f\xE9rences de langue d\u2019Office.",
11812
+ "Make {product} easier to work with.": "Facilitez l\u2019utilisation de {product}.",
11813
+ "Advanced options for working with {product}.": "Options avanc\xE9es pour l\u2019utilisation de {product}.",
11814
+ "Customize the Ribbon and keyboard shortcuts.": "Personnalisez le ruban et les raccourcis clavier.",
11815
+ "Customize the Quick Access Toolbar.": "Personnalisez la barre d\u2019outils Acc\xE8s rapide.",
11816
+ "View and manage Microsoft Office Add-ins.": "Affichez et g\xE9rez les compl\xE9ments Microsoft Office.",
11817
+ "Help keep your documents safe and your computer secure and healthy.": "Prot\xE9gez vos documents et assurez la s\xE9curit\xE9 et le bon \xE9tat de votre ordinateur.",
11818
+ "User Interface options": "Options de l\u2019interface utilisateur",
11819
+ "Show Mini Toolbar on selection": "Afficher la mini barre d\u2019outils lors de la s\xE9lection",
11820
+ "Enable Live Preview": "Activer l\u2019aper\xE7u dynamique",
11821
+ "ScreenTip style": "Style des info-bulles",
11822
+ "Show feature descriptions in ScreenTips": "Afficher les descriptions des fonctionnalit\xE9s dans les info-bulles",
11823
+ "Personalize your copy of Microsoft Office": "Personnalisez votre copie de Microsoft Office",
11824
+ "User name": "Nom d\u2019utilisateur",
11825
+ "Office Theme": "Th\xE8me Office",
11826
+ "Office display language": "Langue d\u2019affichage d\u2019Office",
11827
+ "Choose the language for menus, buttons and messages.": "Choisissez la langue des menus, des boutons et des messages.",
11828
+ "Not available yet. Needs rich text formatting.": "Pas encore disponible. N\xE9cessite la mise en forme de texte enrichi.",
11829
+ "Not available yet. Styles are applied on click; hover previews are not drawn yet.": "Pas encore disponible. Les styles s\u2019appliquent au clic ; les aper\xE7us au survol ne sont pas encore dessin\xE9s.",
11830
+ "Not available yet. ScreenTips always describe the command.": "Pas encore disponible. Les info-bulles d\xE9crivent toujours la commande.",
11831
+ "Not available yet. Documents are saved to this device; AutoRecover is not kept.": "Pas encore disponible. Les documents sont enregistr\xE9s sur cet appareil ; la r\xE9cup\xE9ration automatique n\u2019est pas conserv\xE9e.",
11832
+ "Not available yet. There are no accessibility settings to change.": "Pas encore disponible. Aucun param\xE8tre d\u2019accessibilit\xE9 n\u2019est modifiable.",
11833
+ "Not available yet. The editing behaviour is fixed.": "Pas encore disponible. Le comportement de modification est fixe.",
11834
+ "Not available yet. The Quick Access Toolbar is fixed.": "Pas encore disponible. La barre d\u2019outils Acc\xE8s rapide est fixe.",
11835
+ "Not available yet. The ribbon layout is fixed.": "Pas encore disponible. La disposition du ruban est fixe.",
11836
+ "Not available yet. The display language is fixed.": "Pas encore disponible. La langue d\u2019affichage est fixe.",
11837
+ "Not available. Add-ins and macros are never run.": "Non disponible. Les compl\xE9ments et les macros ne sont jamais ex\xE9cut\xE9s.",
11838
+ "Not available. Documents stay local and active content is never run.": "Non disponible. Les documents restent locaux et le contenu actif n\u2019est jamais ex\xE9cut\xE9."
11839
+ };
11840
+ var deOptionStrings = {
11841
+ General: "Allgemein",
11842
+ Display: "Anzeige",
11843
+ Formulas: "Formeln",
11844
+ Data: "Daten",
11845
+ Proofing: "Dokumentpr\xFCfung",
11846
+ Save: "Speichern",
11847
+ Language: "Sprache",
11848
+ Accessibility: "Barrierefreiheit",
11849
+ Advanced: "Erweitert",
11850
+ "Customize Ribbon": "Men\xFCband anpassen",
11851
+ "Quick Access Toolbar": "Symbolleiste f\xFCr den Schnellzugriff",
11852
+ "Add-ins": "Add-Ins",
11853
+ "Trust Center": "Trust Center",
11854
+ OK: "OK",
11855
+ Cancel: "Abbrechen",
11856
+ Close: "Schlie\xDFen",
11857
+ Categories: "Kategorien",
11858
+ "Reset all options": "Alle Optionen zur\xFCcksetzen",
11859
+ "General options for working with {product}.": "Allgemeine Optionen f\xFCr die Arbeit mit {product}.",
11860
+ "Change how {product} corrects and formats your text.": "\xC4ndern Sie, wie {product} Ihren Text korrigiert und formatiert.",
11861
+ "Customize how documents are saved.": "Passen Sie an, wie Dokumente gespeichert werden.",
11862
+ "Set the Office Language Preferences.": "Legen Sie die Office-Spracheinstellungen fest.",
11863
+ "Make {product} easier to work with.": "Machen Sie {product} einfacher bedienbar.",
11864
+ "Advanced options for working with {product}.": "Erweiterte Optionen f\xFCr die Arbeit mit {product}.",
11865
+ "Customize the Ribbon and keyboard shortcuts.": "Passen Sie das Men\xFCband und die Tastenkombinationen an.",
11866
+ "Customize the Quick Access Toolbar.": "Passen Sie die Symbolleiste f\xFCr den Schnellzugriff an.",
11867
+ "View and manage Microsoft Office Add-ins.": "Microsoft Office-Add-Ins anzeigen und verwalten.",
11868
+ "Help keep your documents safe and your computer secure and healthy.": "Sch\xFCtzen Sie Ihre Dokumente und halten Sie Ihren Computer sicher und fehlerfrei.",
11869
+ "User Interface options": "Benutzeroberfl\xE4chenoptionen",
11870
+ "Show Mini Toolbar on selection": "Minisymbolleiste bei Auswahl anzeigen",
11871
+ "Enable Live Preview": "Livevorschau aktivieren",
11872
+ "ScreenTip style": "QuickInfo-Format",
11873
+ "Show feature descriptions in ScreenTips": "Funktionsbeschreibungen in QuickInfos anzeigen",
11874
+ "Personalize your copy of Microsoft Office": "Microsoft Office personalisieren",
11875
+ "User name": "Benutzername",
11876
+ "Office Theme": "Office-Design",
11877
+ "Office display language": "Office-Anzeigesprache",
11878
+ "Choose the language for menus, buttons and messages.": "W\xE4hlen Sie die Sprache f\xFCr Men\xFCs, Schaltfl\xE4chen und Meldungen.",
11879
+ "Not available yet. Needs rich text formatting.": "Noch nicht verf\xFCgbar. Erfordert Formatierung von Rich-Text.",
11880
+ "Not available yet. Styles are applied on click; hover previews are not drawn yet.": "Noch nicht verf\xFCgbar. Formatvorlagen werden per Klick angewendet; Vorschauen beim Dar\xFCberfahren werden noch nicht gezeichnet.",
11881
+ "Not available yet. ScreenTips always describe the command.": "Noch nicht verf\xFCgbar. QuickInfos beschreiben immer den Befehl.",
11882
+ "Not available yet. Documents are saved to this device; AutoRecover is not kept.": "Noch nicht verf\xFCgbar. Dokumente werden auf diesem Ger\xE4t gespeichert; AutoWiederherstellen wird nicht gef\xFChrt.",
11883
+ "Not available yet. There are no accessibility settings to change.": "Noch nicht verf\xFCgbar. Es gibt keine Einstellungen zur Barrierefreiheit zu \xE4ndern.",
11884
+ "Not available yet. The editing behaviour is fixed.": "Noch nicht verf\xFCgbar. Das Bearbeitungsverhalten ist festgelegt.",
11885
+ "Not available yet. The Quick Access Toolbar is fixed.": "Noch nicht verf\xFCgbar. Die Symbolleiste f\xFCr den Schnellzugriff ist festgelegt.",
11886
+ "Not available yet. The ribbon layout is fixed.": "Noch nicht verf\xFCgbar. Das Men\xFCband-Layout ist festgelegt.",
11887
+ "Not available yet. The display language is fixed.": "Noch nicht verf\xFCgbar. Die Anzeigesprache ist festgelegt.",
11888
+ "Not available. Add-ins and macros are never run.": "Nicht verf\xFCgbar. Add-Ins und Makros werden nie ausgef\xFChrt.",
11889
+ "Not available. Documents stay local and active content is never run.": "Nicht verf\xFCgbar. Dokumente bleiben lokal und aktive Inhalte werden nie ausgef\xFChrt."
11890
+ };
11891
+ var esOptionStrings = {
11892
+ General: "General",
11893
+ Display: "Mostrar",
11894
+ Formulas: "F\xF3rmulas",
11895
+ Data: "Datos",
11896
+ Proofing: "Revisi\xF3n",
11897
+ Save: "Guardar",
11898
+ Language: "Idioma",
11899
+ Accessibility: "Accesibilidad",
11900
+ Advanced: "Avanzadas",
11901
+ "Customize Ribbon": "Personalizar cinta de opciones",
11902
+ "Quick Access Toolbar": "Barra de herramientas de acceso r\xE1pido",
11903
+ "Add-ins": "Complementos",
11904
+ "Trust Center": "Centro de confianza",
11905
+ OK: "Aceptar",
11906
+ Cancel: "Cancelar",
11907
+ Close: "Cerrar",
11908
+ Categories: "Categor\xEDas",
11909
+ "Reset all options": "Restablecer todas las opciones",
11910
+ "General options for working with {product}.": "Opciones generales para trabajar con {product}.",
11911
+ "Change how {product} corrects and formats your text.": "Cambie la forma en que {product} corrige y da formato al texto.",
11912
+ "Customize how documents are saved.": "Personalice c\xF3mo se guardan los documentos.",
11913
+ "Set the Office Language Preferences.": "Establezca las preferencias de idioma de Office.",
11914
+ "Make {product} easier to work with.": "Haga que {product} sea m\xE1s f\xE1cil de usar.",
11915
+ "Advanced options for working with {product}.": "Opciones avanzadas para trabajar con {product}.",
11916
+ "Customize the Ribbon and keyboard shortcuts.": "Personalice la cinta de opciones y los m\xE9todos abreviados de teclado.",
11917
+ "Customize the Quick Access Toolbar.": "Personalice la barra de herramientas de acceso r\xE1pido.",
11918
+ "View and manage Microsoft Office Add-ins.": "Vea y administre los complementos de Microsoft Office.",
11919
+ "Help keep your documents safe and your computer secure and healthy.": "Ayude a mantener seguros sus documentos y a proteger y mantener en buen estado su equipo.",
11920
+ "User Interface options": "Opciones de la interfaz de usuario",
11921
+ "Show Mini Toolbar on selection": "Mostrar minibarra de herramientas al seleccionar",
11922
+ "Enable Live Preview": "Habilitar vistas previas din\xE1micas",
11923
+ "ScreenTip style": "Estilo de la informaci\xF3n en pantalla",
11924
+ "Show feature descriptions in ScreenTips": "Mostrar descripciones de caracter\xEDsticas en la informaci\xF3n en pantalla",
11925
+ "Personalize your copy of Microsoft Office": "Personalice su copia de Microsoft Office",
11926
+ "User name": "Nombre de usuario",
11927
+ "Office Theme": "Tema de Office",
11928
+ "Office display language": "Idioma de presentaci\xF3n de Office",
11929
+ "Choose the language for menus, buttons and messages.": "Elija el idioma de los men\xFAs, los botones y los mensajes.",
11930
+ "Not available yet. Needs rich text formatting.": "A\xFAn no disponible. Requiere formato de texto enriquecido.",
11931
+ "Not available yet. Styles are applied on click; hover previews are not drawn yet.": "A\xFAn no disponible. Los estilos se aplican al hacer clic; las vistas previas al pasar el cursor todav\xEDa no se dibujan.",
11932
+ "Not available yet. ScreenTips always describe the command.": "A\xFAn no disponible. La informaci\xF3n en pantalla siempre describe el comando.",
11933
+ "Not available yet. Documents are saved to this device; AutoRecover is not kept.": "A\xFAn no disponible. Los documentos se guardan en este dispositivo; no se conserva la recuperaci\xF3n autom\xE1tica.",
11934
+ "Not available yet. There are no accessibility settings to change.": "A\xFAn no disponible. No hay opciones de accesibilidad que cambiar.",
11935
+ "Not available yet. The editing behaviour is fixed.": "A\xFAn no disponible. El comportamiento de edici\xF3n es fijo.",
11936
+ "Not available yet. The Quick Access Toolbar is fixed.": "A\xFAn no disponible. La barra de herramientas de acceso r\xE1pido es fija.",
11937
+ "Not available yet. The ribbon layout is fixed.": "A\xFAn no disponible. El dise\xF1o de la cinta de opciones es fijo.",
11938
+ "Not available yet. The display language is fixed.": "A\xFAn no disponible. El idioma de presentaci\xF3n es fijo.",
11939
+ "Not available. Add-ins and macros are never run.": "No disponible. Los complementos y las macros nunca se ejecutan.",
11940
+ "Not available. Documents stay local and active content is never run.": "No disponible. Los documentos permanecen locales y el contenido activo nunca se ejecuta."
11941
+ };
11942
+ var zhOptionStrings = {
11943
+ General: "\u5E38\u89C4",
11944
+ Display: "\u663E\u793A",
11945
+ Formulas: "\u516C\u5F0F",
11946
+ Data: "\u6570\u636E",
11947
+ Proofing: "\u6821\u5BF9",
11948
+ Save: "\u4FDD\u5B58",
11949
+ Language: "\u8BED\u8A00",
11950
+ Accessibility: "\u8F85\u52A9\u529F\u80FD",
11951
+ Advanced: "\u9AD8\u7EA7",
11952
+ "Customize Ribbon": "\u81EA\u5B9A\u4E49\u529F\u80FD\u533A",
11953
+ "Quick Access Toolbar": "\u5FEB\u901F\u8BBF\u95EE\u5DE5\u5177\u680F",
11954
+ "Add-ins": "\u52A0\u8F7D\u9879",
11955
+ "Trust Center": "\u4FE1\u4EFB\u4E2D\u5FC3",
11956
+ OK: "\u786E\u5B9A",
11957
+ Cancel: "\u53D6\u6D88",
11958
+ Close: "\u5173\u95ED",
11959
+ Categories: "\u7C7B\u522B",
11960
+ "Reset all options": "\u91CD\u7F6E\u6240\u6709\u9009\u9879",
11961
+ "General options for working with {product}.": "\u4F7F\u7528 {product} \u7684\u5E38\u89C4\u9009\u9879\u3002",
11962
+ "Change how {product} corrects and formats your text.": "\u66F4\u6539 {product} \u66F4\u6B63\u548C\u8BBE\u7F6E\u6587\u672C\u683C\u5F0F\u7684\u65B9\u5F0F\u3002",
11963
+ "Customize how documents are saved.": "\u81EA\u5B9A\u4E49\u4FDD\u5B58\u6587\u6863\u7684\u65B9\u5F0F\u3002",
11964
+ "Set the Office Language Preferences.": "\u8BBE\u7F6E Office \u8BED\u8A00\u9996\u9009\u9879\u3002",
11965
+ "Make {product} easier to work with.": "\u8BA9 {product} \u66F4\u6613\u4E8E\u4F7F\u7528\u3002",
11966
+ "Advanced options for working with {product}.": "\u4F7F\u7528 {product} \u7684\u9AD8\u7EA7\u9009\u9879\u3002",
11967
+ "Customize the Ribbon and keyboard shortcuts.": "\u81EA\u5B9A\u4E49\u529F\u80FD\u533A\u548C\u952E\u76D8\u5FEB\u6377\u65B9\u5F0F\u3002",
11968
+ "Customize the Quick Access Toolbar.": "\u81EA\u5B9A\u4E49\u5FEB\u901F\u8BBF\u95EE\u5DE5\u5177\u680F\u3002",
11969
+ "View and manage Microsoft Office Add-ins.": "\u67E5\u770B\u548C\u7BA1\u7406 Microsoft Office \u52A0\u8F7D\u9879\u3002",
11970
+ "Help keep your documents safe and your computer secure and healthy.": "\u5E2E\u52A9\u4FDD\u969C\u6587\u6863\u5B89\u5168\uFF0C\u5E76\u4F7F\u8BA1\u7B97\u673A\u4FDD\u6301\u5B89\u5168\u548C\u5065\u5EB7\u3002",
11971
+ "User Interface options": "\u7528\u6237\u754C\u9762\u9009\u9879",
11972
+ "Show Mini Toolbar on selection": "\u9009\u62E9\u65F6\u663E\u793A\u6D6E\u52A8\u5DE5\u5177\u680F",
11973
+ "Enable Live Preview": "\u542F\u7528\u5B9E\u65F6\u9884\u89C8",
11974
+ "ScreenTip style": "\u5C4F\u5E55\u63D0\u793A\u6837\u5F0F",
11975
+ "Show feature descriptions in ScreenTips": "\u5728\u5C4F\u5E55\u63D0\u793A\u4E2D\u663E\u793A\u529F\u80FD\u8BF4\u660E",
11976
+ "Personalize your copy of Microsoft Office": "\u5BF9 Microsoft Office \u8FDB\u884C\u4E2A\u6027\u5316\u8BBE\u7F6E",
11977
+ "User name": "\u7528\u6237\u540D",
11978
+ "Office Theme": "Office \u4E3B\u9898",
11979
+ "Office display language": "Office \u663E\u793A\u8BED\u8A00",
11980
+ "Choose the language for menus, buttons and messages.": "\u9009\u62E9\u83DC\u5355\u3001\u6309\u94AE\u548C\u6D88\u606F\u4F7F\u7528\u7684\u8BED\u8A00\u3002",
11981
+ "Not available yet. Needs rich text formatting.": "\u6682\u4E0D\u53EF\u7528\u3002\u9700\u8981\u5BCC\u6587\u672C\u683C\u5F0F\u3002",
11982
+ "Not available yet. Styles are applied on click; hover previews are not drawn yet.": "\u6682\u4E0D\u53EF\u7528\u3002\u6837\u5F0F\u5728\u5355\u51FB\u65F6\u5E94\u7528\uFF1B\u5C1A\u4E0D\u7ED8\u5236\u60AC\u505C\u9884\u89C8\u3002",
11983
+ "Not available yet. ScreenTips always describe the command.": "\u6682\u4E0D\u53EF\u7528\u3002\u5C4F\u5E55\u63D0\u793A\u59CB\u7EC8\u63CF\u8FF0\u8BE5\u547D\u4EE4\u3002",
11984
+ "Not available yet. Documents are saved to this device; AutoRecover is not kept.": "\u6682\u4E0D\u53EF\u7528\u3002\u6587\u6863\u4FDD\u5B58\u5230\u6B64\u8BBE\u5907\uFF1B\u4E0D\u4FDD\u7559\u81EA\u52A8\u6062\u590D\u3002",
11985
+ "Not available yet. There are no accessibility settings to change.": "\u6682\u4E0D\u53EF\u7528\u3002\u6CA1\u6709\u53EF\u66F4\u6539\u7684\u8F85\u52A9\u529F\u80FD\u8BBE\u7F6E\u3002",
11986
+ "Not available yet. The editing behaviour is fixed.": "\u6682\u4E0D\u53EF\u7528\u3002\u7F16\u8F91\u884C\u4E3A\u662F\u56FA\u5B9A\u7684\u3002",
11987
+ "Not available yet. The Quick Access Toolbar is fixed.": "\u6682\u4E0D\u53EF\u7528\u3002\u5FEB\u901F\u8BBF\u95EE\u5DE5\u5177\u680F\u662F\u56FA\u5B9A\u7684\u3002",
11988
+ "Not available yet. The ribbon layout is fixed.": "\u6682\u4E0D\u53EF\u7528\u3002\u529F\u80FD\u533A\u5E03\u5C40\u662F\u56FA\u5B9A\u7684\u3002",
11989
+ "Not available yet. The display language is fixed.": "\u6682\u4E0D\u53EF\u7528\u3002\u663E\u793A\u8BED\u8A00\u662F\u56FA\u5B9A\u7684\u3002",
11990
+ "Not available. Add-ins and macros are never run.": "\u4E0D\u53EF\u7528\u3002\u52A0\u8F7D\u9879\u548C\u5B8F\u6C38\u8FDC\u4E0D\u4F1A\u8FD0\u884C\u3002",
11991
+ "Not available. Documents stay local and active content is never run.": "\u4E0D\u53EF\u7528\u3002\u6587\u6863\u4FDD\u7559\u5728\u672C\u5730\uFF0C\u6D3B\u52A8\u5185\u5BB9\u6C38\u8FDC\u4E0D\u4F1A\u8FD0\u884C\u3002"
11992
+ };
11993
+ var optionStrings = {
11994
+ en: enOptionStrings,
11995
+ fr: frOptionStrings,
11996
+ de: deOptionStrings,
11997
+ es: esOptionStrings,
11998
+ "zh-CN": zhOptionStrings
11999
+ };
12000
+
12001
+ // xlsx/pivot/captions-locales.ts
12002
+ var table2 = (words2, prefix, rest, functions) => ({
12003
+ ...rest,
12004
+ functions,
12005
+ aggregates: Object.fromEntries(
12006
+ Object.keys(words2).map((fn) => [fn, prefix(words2[fn])])
12007
+ )
12008
+ });
12009
+ var GERMAN = {
12010
+ sum: "Summe",
12011
+ count: "Anzahl",
12012
+ average: "Mittelwert",
12013
+ max: "Max",
12014
+ min: "Min",
12015
+ product: "Produkt",
12016
+ countNums: "Anzahl (Zahlen)",
12017
+ stdDev: "Standardabweichung",
12018
+ stdDevp: "Standardabweichung (Grundgesamtheit)",
12019
+ var: "Varianz",
12020
+ varp: "Varianz (Grundgesamtheit)"
12021
+ };
12022
+ var SPANISH = {
12023
+ sum: "Suma",
12024
+ count: "Cuenta",
12025
+ average: "Promedio",
12026
+ max: "M\xE1x",
12027
+ min: "M\xEDn",
12028
+ product: "Producto",
12029
+ countNums: "Cuenta de n\xFAmeros",
12030
+ stdDev: "Desvest",
12031
+ stdDevp: "Desvestp",
12032
+ var: "Var",
12033
+ varp: "Varp"
12034
+ };
12035
+ var FRENCH = {
12036
+ sum: "Somme",
12037
+ count: "Nombre",
12038
+ average: "Moyenne",
12039
+ max: "Max",
12040
+ min: "Min",
12041
+ product: "Produit",
12042
+ countNums: "Nombre (nombres)",
12043
+ stdDev: "\xC9cartype",
12044
+ stdDevp: "\xC9cartypep",
12045
+ var: "Var",
12046
+ varp: "Varp"
12047
+ };
12048
+ var CHINESE = {
12049
+ sum: "\u6C42\u548C",
12050
+ count: "\u8BA1\u6570",
12051
+ average: "\u5E73\u5747\u503C",
12052
+ max: "\u6700\u5927\u503C",
12053
+ min: "\u6700\u5C0F\u503C",
12054
+ product: "\u4E58\u79EF",
12055
+ countNums: "\u6570\u503C\u8BA1\u6570",
12056
+ stdDev: "\u6807\u51C6\u504F\u5DEE",
12057
+ stdDevp: "\u603B\u4F53\u6807\u51C6\u504F\u5DEE",
12058
+ var: "\u65B9\u5DEE",
12059
+ varp: "\u603B\u4F53\u65B9\u5DEE"
12060
+ };
12061
+ var LOCALIZED_PIVOT_CAPTIONS = {
12062
+ de: table2(
12063
+ GERMAN,
12064
+ (word) => `${word} von {0}`,
12065
+ {
12066
+ rowLabels: "Zeilenbeschriftungen",
12067
+ columnLabels: "Spaltenbeschriftungen",
12068
+ grandTotal: "Gesamtergebnis",
12069
+ values: "Werte",
12070
+ all: "(Alle)",
12071
+ blank: "(leer)",
12072
+ subtotal: "{0} Ergebnis",
12073
+ measureTotal: "Gesamt {0}"
12074
+ },
12075
+ GERMAN
12076
+ ),
12077
+ es: table2(
12078
+ SPANISH,
12079
+ (word) => `${word} de {0}`,
12080
+ {
12081
+ rowLabels: "Etiquetas de fila",
12082
+ columnLabels: "Etiquetas de columna",
12083
+ grandTotal: "Total general",
12084
+ values: "Valores",
12085
+ all: "(Todas)",
12086
+ blank: "(en blanco)",
12087
+ subtotal: "{0} Total",
12088
+ measureTotal: "Total {0}"
12089
+ },
12090
+ SPANISH
12091
+ ),
12092
+ fr: table2(
12093
+ FRENCH,
12094
+ (word) => `${word} de {0}`,
12095
+ {
12096
+ rowLabels: "\xC9tiquettes de lignes",
12097
+ columnLabels: "\xC9tiquettes de colonnes",
12098
+ grandTotal: "Total g\xE9n\xE9ral",
12099
+ values: "Valeurs",
12100
+ all: "(Tous)",
12101
+ blank: "(vide)",
12102
+ subtotal: "{0} Total",
12103
+ measureTotal: "Total {0}"
12104
+ },
12105
+ FRENCH
12106
+ ),
12107
+ "zh-CN": table2(
12108
+ CHINESE,
12109
+ (word) => `${word}\u9879:{0}`,
12110
+ {
12111
+ rowLabels: "\u884C\u6807\u7B7E",
12112
+ columnLabels: "\u5217\u6807\u7B7E",
12113
+ grandTotal: "\u603B\u8BA1",
12114
+ values: "\u6570\u503C",
12115
+ all: "(\u5168\u90E8)",
12116
+ blank: "(\u7A7A\u767D)",
12117
+ subtotal: "{0} \u6C47\u603B",
12118
+ measureTotal: "\u603B\u8BA1 {0}"
12119
+ },
12120
+ CHINESE
12121
+ )
12122
+ };
12123
+
12124
+ // xlsx/pivot/captions.ts
12125
+ var FUNCTIONS = {
12126
+ sum: "Sum",
12127
+ count: "Count",
12128
+ average: "Average",
12129
+ max: "Max",
12130
+ min: "Min",
12131
+ product: "Product",
12132
+ countNums: "Count",
12133
+ stdDev: "StdDev",
12134
+ stdDevp: "StdDevp",
12135
+ var: "Var",
12136
+ varp: "Varp"
12137
+ };
12138
+ var aggregateNames = () => Object.fromEntries(
12139
+ Object.keys(FUNCTIONS).map((fn) => [
12140
+ fn,
12141
+ `${fn[0].toUpperCase()}${fn.slice(1)} of {0}`
12142
+ ])
12143
+ );
12144
+ var ENGLISH_PIVOT_CAPTIONS = {
12145
+ rowLabels: "Row Labels",
12146
+ columnLabels: "Column Labels",
12147
+ grandTotal: "Grand Total",
12148
+ values: "Values",
12149
+ all: "(All)",
12150
+ blank: "(blank)",
12151
+ subtotal: "{0} Total",
12152
+ measureTotal: "Total {0}",
12153
+ functions: FUNCTIONS,
12154
+ aggregates: aggregateNames()
12155
+ };
12156
+ var fillCaption = (template, ...args) => template.replace(/\{(\d)\}/g, (_match, at) => args[Number(at)] ?? "");
12157
+ function pivotCaptions(pivot) {
12158
+ const own = pivot.captions;
12159
+ if (!own) return ENGLISH_PIVOT_CAPTIONS;
12160
+ return {
12161
+ ...ENGLISH_PIVOT_CAPTIONS,
12162
+ ...Object.fromEntries(Object.entries(own).filter(([, value2]) => typeof value2 === "string")),
12163
+ functions: { ...ENGLISH_PIVOT_CAPTIONS.functions, ...own.functions },
12164
+ aggregates: { ...ENGLISH_PIVOT_CAPTIONS.aggregates, ...own.aggregates }
12165
+ };
12166
+ }
12167
+ var pivotMeasureName = (aggregate2, field, pivot = {}) => fillCaption(pivotCaptions(pivot).aggregates[aggregate2], field);
12168
+ function localizedPivotCaptions(locale) {
12169
+ const caps = LOCALIZED_PIVOT_CAPTIONS[normalizeOfficeLocale(locale)];
12170
+ return caps ? structuredClone(caps) : void 0;
12171
+ }
12172
+ function authoredCaptions(options6) {
12173
+ const own = options6.captions ?? localizedPivotCaptions(options6.locale);
12174
+ return own && Object.keys(own).length ? structuredClone(own) : void 0;
12175
+ }
12176
+
11674
12177
  // xlsx/pivot/date-groups.ts
11675
12178
  var PIVOT_DATE_UNITS = [
11676
12179
  "seconds",
@@ -11695,7 +12198,7 @@ var LEAP_MONTHS = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
11695
12198
  var MAX_ITEMS = 1e4;
11696
12199
  var pad3 = (value2, width = 2) => String(value2).padStart(width, "0");
11697
12200
  var dateGroupUnits = (group) => PIVOT_DATE_UNITS.filter((unit) => group.by.includes(unit));
11698
- var dateGroupFieldName = (unit, field) => `${UNIT_TITLES[unit]} (${field})`;
12201
+ var dateGroupFieldName = (unit, field, group) => group?.localized?.[unit]?.name ?? `${UNIT_TITLES[unit]} (${field})`;
11699
12202
  var dateGroupDays = (group) => group.by.length === 1 && group.by[0] === "days" ? group.days ?? 1 : 1;
11700
12203
  function dateGroupRange(group, serials) {
11701
12204
  let min = Infinity;
@@ -11718,7 +12221,7 @@ var secondsOfDay = (serial) => Math.round((serial - Math.floor(serial)) * 86400)
11718
12221
  function dayBuckets(range2, days) {
11719
12222
  return Math.max(1, Math.ceil((Math.floor(range2.end) - Math.floor(range2.start) + 1) / days));
11720
12223
  }
11721
- function dateUnitLabels(unit, range2, days, date1904) {
12224
+ function englishDateUnitLabels(unit, range2, days, date1904) {
11722
12225
  const labels = [`<${isoDay(range2.start, date1904)}`];
11723
12226
  if (unit === "seconds" || unit === "minutes")
11724
12227
  for (let i2 = 0; i2 < 60; i2++) labels.push(`:${pad3(i2)}`);
@@ -11747,6 +12250,11 @@ function dateUnitLabels(unit, range2, days, date1904) {
11747
12250
  labels.push(`>${isoDay(range2.end, date1904)}`);
11748
12251
  return labels;
11749
12252
  }
12253
+ function dateUnitLabels(unit, range2, days, date1904, group) {
12254
+ const english = englishDateUnitLabels(unit, range2, days, date1904);
12255
+ const localized = group?.localized?.[unit]?.labels;
12256
+ return localized?.length === english.length ? localized : english;
12257
+ }
11750
12258
  function dateUnitIndex(unit, range2, days, date1904, serial, count2) {
11751
12259
  if (serial < range2.start) return 0;
11752
12260
  if (serial > range2.end) return count2 - 1;
@@ -11770,7 +12278,7 @@ function derivedDateFields(pivot) {
11770
12278
  for (const group of pivot.dateGroups ?? [])
11771
12279
  for (const unit of dateGroupUnits(group))
11772
12280
  derived.push({
11773
- name: dateGroupFieldName(unit, group.field),
12281
+ name: dateGroupFieldName(unit, group.field, group),
11774
12282
  unit,
11775
12283
  group,
11776
12284
  index: databaseFields + derived.length
@@ -11781,7 +12289,7 @@ function countDerived(pivot) {
11781
12289
  let count2 = 0;
11782
12290
  for (const group of pivot.dateGroups ?? [])
11783
12291
  for (const unit of dateGroupUnits(group))
11784
- if (pivot.fields.includes(dateGroupFieldName(unit, group.field))) count2++;
12292
+ if (pivot.fields.includes(dateGroupFieldName(unit, group.field, group))) count2++;
11785
12293
  return count2;
11786
12294
  }
11787
12295
  var pivotAxisFieldNames = (pivot) => [
@@ -11801,7 +12309,7 @@ function derivedDateLabels(pivot, name) {
11801
12309
  if (!entry) return void 0;
11802
12310
  const [group] = resolveDateGroups({ ...pivot, dateGroups: [entry.group] });
11803
12311
  const range2 = { start: group.start, end: group.end };
11804
- return dateUnitLabels(entry.unit, range2, dateGroupDays(group), pivot.date1904 ?? false);
12312
+ return dateUnitLabels(entry.unit, range2, dateGroupDays(group), pivot.date1904 ?? false, group);
11805
12313
  }
11806
12314
  function validateDateGroups(pivot) {
11807
12315
  const groups = pivot.dateGroups;
@@ -11817,18 +12325,16 @@ function validateDateGroups(pivot) {
11817
12325
  seen.add(group.field);
11818
12326
  if (!(pivot.dateFields ?? []).includes(group.field))
11819
12327
  throw new Error("Only fields that contain dates can be grouped by date.");
11820
- if (pivot.pageFilter || pivot.dateFilter)
11821
- throw new Error("Date groups cannot be combined with report filters or timelines.");
11822
12328
  const serials = pivot.records.map((record) => record[index2]);
11823
12329
  if (!serials.length || serials.some((v) => typeof v !== "number" || !Number.isFinite(v)))
11824
12330
  throw new Error("Only fields that contain dates can be grouped by date.");
11825
12331
  const range2 = dateGroupRange(group, serials);
11826
12332
  if (range2.start >= range2.end) throw new Error("The date group must end after it starts.");
11827
12333
  for (const unit of dateGroupUnits(group)) {
11828
- const name = dateGroupFieldName(unit, group.field);
12334
+ const name = dateGroupFieldName(unit, group.field, group);
11829
12335
  if (pivot.fields.includes(name))
11830
12336
  throw new Error("A source field already has the name of a date group field.");
11831
- if (dateUnitLabels(unit, range2, dateGroupDays(group), pivot.date1904 ?? false).length > MAX_ITEMS)
12337
+ if (dateUnitLabels(unit, range2, dateGroupDays(group), pivot.date1904 ?? false, group).length > MAX_ITEMS)
11832
12338
  throw new Error("The date group has too many items.");
11833
12339
  }
11834
12340
  }
@@ -11842,7 +12348,7 @@ function expandDateGroups(pivot) {
11842
12348
  const tables = derived.map((entry) => {
11843
12349
  const range2 = { start: entry.group.start, end: entry.group.end };
11844
12350
  const days = dateGroupDays(entry.group);
11845
- const labels = dateUnitLabels(entry.unit, range2, days, date1904);
12351
+ const labels = dateUnitLabels(entry.unit, range2, days, date1904, entry.group);
11846
12352
  return {
11847
12353
  base: pivot.fields.indexOf(entry.group.field),
11848
12354
  labels,
@@ -11854,9 +12360,9 @@ function expandDateGroups(pivot) {
11854
12360
  fields: [...pivot.fields, ...derived.map((entry) => entry.name)],
11855
12361
  records: pivot.records.map((record) => [
11856
12362
  ...record,
11857
- ...tables.map((table2) => {
11858
- const value2 = record[table2.base];
11859
- return typeof value2 === "number" ? table2.labels[table2.index(value2)] : null;
12363
+ ...tables.map((table3) => {
12364
+ const value2 = record[table3.base];
12365
+ return typeof value2 === "number" ? table3.labels[table3.index(value2)] : null;
11860
12366
  })
11861
12367
  ])
11862
12368
  };
@@ -11934,19 +12440,6 @@ function groupLabelsOf(pivot, field) {
11934
12440
  }
11935
12441
 
11936
12442
  // xlsx/pivot/subtotals.ts
11937
- var PIVOT_SUBTOTALS = {
11938
- sum: { attr: "sumSubtotal", item: "sum", label: "Sum" },
11939
- count: { attr: "countASubtotal", item: "countA", label: "Count" },
11940
- average: { attr: "avgSubtotal", item: "avg", label: "Average" },
11941
- max: { attr: "maxSubtotal", item: "max", label: "Max" },
11942
- min: { attr: "minSubtotal", item: "min", label: "Min" },
11943
- product: { attr: "productSubtotal", item: "product", label: "Product" },
11944
- countNums: { attr: "countSubtotal", item: "count", label: "Count" },
11945
- stdDev: { attr: "stdDevSubtotal", item: "stdDev", label: "StdDev" },
11946
- stdDevp: { attr: "stdDevPSubtotal", item: "stdDevP", label: "StdDevp" },
11947
- var: { attr: "varSubtotal", item: "var", label: "Var" },
11948
- varp: { attr: "varPSubtotal", item: "varP", label: "Varp" }
11949
- };
11950
12443
  var PIVOT_SUBTOTAL_ORDER = [
11951
12444
  "sum",
11952
12445
  "count",
@@ -11975,15 +12468,13 @@ function normalizedFieldSubtotals(entries) {
11975
12468
  };
11976
12469
  });
11977
12470
  }
11978
- function validateFieldSubtotals(pivot, rowFields) {
12471
+ function validateFieldSubtotals(pivot, axisFields) {
11979
12472
  const entries = pivot.fieldSubtotals;
11980
12473
  if (entries === void 0) return;
11981
12474
  if (!Array.isArray(entries)) throw new Error("Choose valid field subtotals.");
11982
- if (entries.length && pivot.valuesAxis === "rows")
11983
- throw new Error("Field subtotals require Values on columns.");
11984
12475
  const seen = /* @__PURE__ */ new Set();
11985
12476
  for (const entry of entries) {
11986
- if (!entry || typeof entry !== "object" || !rowFields.includes(entry.field) || seen.has(entry.field) || !Array.isArray(entry.functions) || entry.functions.some((fn) => !PIVOT_AGGREGATES.includes(fn)) || new Set(entry.functions).size !== entry.functions.length)
12477
+ if (!entry || typeof entry !== "object" || !axisFields.includes(entry.field) || seen.has(entry.field) || !Array.isArray(entry.functions) || entry.functions.some((fn) => !PIVOT_AGGREGATES.includes(fn)) || new Set(entry.functions).size !== entry.functions.length)
11987
12478
  throw new Error("Choose valid field subtotals.");
11988
12479
  seen.add(entry.field);
11989
12480
  }
@@ -12047,6 +12538,14 @@ function pruneItemFilters(pivot) {
12047
12538
  return next.length ? next : void 0;
12048
12539
  }
12049
12540
 
12541
+ // xlsx/pivot/item-labels.ts
12542
+ var keyOf = (field, item) => `${field}\0${pivotValueKey(item)}`;
12543
+ function pivotItemLabeler(pivot) {
12544
+ const blank = pivotCaptions(pivot).blank;
12545
+ const names = pivot.itemNames?.length ? new Map(pivot.itemNames.map((entry) => [keyOf(entry.field, entry.item), entry.name])) : void 0;
12546
+ return (field, value2) => names?.get(keyOf(field, value2)) ?? (value2 === null || value2 === "" ? blank : pivotItemLabel(value2));
12547
+ }
12548
+
12050
12549
  // xlsx/pivot/page-filter.ts
12051
12550
  function validatePivotPageFilter(pivot) {
12052
12551
  const filter2 = pivot.pageFilter;
@@ -12058,23 +12557,24 @@ function validatePivotPageFilter(pivot) {
12058
12557
  pivot.columnField,
12059
12558
  pivot.valueField,
12060
12559
  ...extras.map((v) => v?.field)
12061
- ].includes(filter2.field) || pivot.valuesAxis === "rows")
12062
- throw new Error("Report filters require Values on columns and a separate source field.");
12560
+ ].includes(filter2.field))
12561
+ throw new Error("Report filters require a separate source field.");
12063
12562
  if (filter2.item !== void 0 && !(filter2.item === null || typeof filter2.item === "string" || typeof filter2.item === "boolean" || typeof filter2.item === "number" && Number.isFinite(filter2.item) || isCellError(filter2.item) && isErrorCode(filter2.item.error) && Object.keys(filter2.item).length === 1))
12064
12563
  throw new Error("Choose a cached literal report filter item.");
12065
12564
  }
12066
12565
  function pivotPageProjection(pivot) {
12067
- return applyPivotGroups(applyPivotItemFilters(pagedProjection(pivot)));
12566
+ const groups = pivot.dateGroups?.length ? { ...pivot, dateGroups: resolveDateGroups(pivot) } : pivot;
12567
+ return applyPivotGroups(applyPivotItemFilters(pagedProjection(groups)));
12068
12568
  }
12069
12569
  function pagedProjection(pivot) {
12070
12570
  const filter2 = pivot.pageFilter;
12071
12571
  if (!filter2) return pivot;
12072
12572
  const labels = /* @__PURE__ */ new Map();
12073
12573
  for (const item of pivotItems(pivot, filter2.field)) {
12074
- const label5 = String(pivotItemLabel(item)).toLowerCase(), key2 = pivotValueKey(item);
12075
- if (label5 === "(all)" || labels.has(label5) && labels.get(label5) !== key2)
12574
+ const label2 = String(pivotItemLabel(item)).toLowerCase(), key2 = pivotValueKey(item);
12575
+ if (label2 === "(all)" || labels.has(label2) && labels.get(label2) !== key2)
12076
12576
  throw new Error("Ambiguous report filter item captions are preserved.");
12077
- labels.set(label5, key2);
12577
+ labels.set(label2, key2);
12078
12578
  }
12079
12579
  if (filter2.item === void 0) return pivot;
12080
12580
  const index2 = pivot.fields.indexOf(filter2.field), key = pivotValueKey(filter2.item);
@@ -12092,7 +12592,7 @@ function prependPivotPage(grid6, pivot) {
12092
12592
  values: [
12093
12593
  [
12094
12594
  pivot.pageFilter.field,
12095
- pivot.pageFilter.item === void 0 ? "(All)" : pivotItemLabel(pivot.pageFilter.item),
12595
+ pivot.pageFilter.item === void 0 ? pivotCaptions(pivot).all : pivotItemLabeler(pivot)(pivot.pageFilter.field, pivot.pageFilter.item),
12096
12596
  ...Array(width - 2).fill(null)
12097
12597
  ],
12098
12598
  Array(width).fill(null),
@@ -12177,13 +12677,9 @@ function validatePivotFields(pivot) {
12177
12677
  const columns = pivotColumnFields(pivot);
12178
12678
  if (pivot.moreColumnFields !== void 0 && (!Array.isArray(pivot.moreColumnFields) || pivot.moreColumnFields.length > 0 && !pivot.columnField || pivot.moreColumnFields.length > 62 || pivot.moreColumnFields.some((name) => typeof name !== "string")))
12179
12679
  throw new Error("Choose valid PivotTable column fields.");
12180
- if (pivot.valuesAxis === "rows" && rows2.length > 2)
12181
- throw new Error("Values on rows support at most two row fields.");
12182
- if (pivot.valuesAxis === "rows" && columns.length > 1)
12183
- throw new Error("Values on rows support one column field.");
12184
12680
  if (pivot.pageFilter && columns.length > 1)
12185
12681
  throw new Error("Report filters support one column field.");
12186
- validateFieldSubtotals(pivot, rows2);
12682
+ validateFieldSubtotals(pivot, [...rows2, ...columns]);
12187
12683
  const axisNames = pivotAxisFieldNames(pivot);
12188
12684
  if ((pivot.dateGroups ?? []).some(
12189
12685
  (group) => [...rows2, ...columns].some((name) => name === group.field)
@@ -12192,13 +12688,14 @@ function validatePivotFields(pivot) {
12192
12688
  const extras = pivot.additionalValues ?? [];
12193
12689
  if (pivot.valuesAxis !== void 0 && !["columns", "rows"].includes(pivot.valuesAxis))
12194
12690
  throw new Error("Choose a valid Values axis.");
12195
- if (pivot.valuesPosition !== void 0 && !["last", "between", "first"].includes(pivot.valuesPosition))
12691
+ const position = pivot.valuesPosition;
12692
+ if (position !== void 0 && !["last", "between", "first"].includes(position) && !(typeof position === "number" && Number.isInteger(position) && position >= 0))
12196
12693
  throw new Error("Choose a valid Values position.");
12197
- if ((pivot.valuesPosition === "between" || pivot.valuesPosition === "first") && (pivot.valuesAxis !== "rows" || !pivot.secondRowField))
12694
+ if (position !== void 0 && position !== "last" && (pivot.valuesAxis !== "rows" || position === "between" && !pivot.secondRowField || typeof position === "number" && position > rows2.length))
12198
12695
  throw new Error("Values before or between fields require two row fields and Values on rows.");
12199
12696
  if (pivot.valuesAxis === "rows" && (!Array.isArray(extras) || !extras.length))
12200
12697
  throw new Error("Values on rows require multiple measures.");
12201
- if (extras.length > 0 && pivot.sourceXml && parseXml(pivot.sourceXml).documentElement.getAttribute("dataCaption") !== "Values")
12698
+ if (extras.length > 0 && pivot.sourceXml && parseXml(pivot.sourceXml).documentElement.getAttribute("dataCaption") !== pivotCaptions(pivot).values)
12202
12699
  throw new Error("This PivotTable uses unsupported Values header captions.");
12203
12700
  if (!Array.isArray(extras) || extras.length > 15 || extras.some(
12204
12701
  (measure2) => !measure2 || !pivot.fields.includes(measure2.field) || !PIVOT_AGGREGATES.includes(measure2.aggregate) || typeof measure2.caption !== "string" || !measure2.caption.trim() || measure2.caption.length > 255 || pivot.fields.some((field) => field.toLowerCase() === measure2.caption.toLowerCase())
@@ -12211,16 +12708,33 @@ function validatePivotFields(pivot) {
12211
12708
  if (pivot.layout !== void 0 && !["tabular", "compact", "outline"].includes(pivot.layout) || pivot.subtotalPosition !== void 0 && !["top", "bottom"].includes(pivot.subtotalPosition) || !PIVOT_AGGREGATES.includes(pivot.aggregate) || !pivot.fields.includes(pivot.valueField) || [...rows2, ...columns].some((field) => !axisNames.includes(field)) || (/* @__PURE__ */ new Set([...rows2, ...columns])).size !== rows2.length + columns.length || pivot.subtotals !== void 0 && typeof pivot.subtotals !== "boolean" || pivot.repeatLabels !== void 0 && typeof pivot.repeatLabels !== "boolean")
12212
12709
  throw new Error("Choose valid PivotTable fields; row and column fields must differ.");
12213
12710
  }
12214
- function pivotCaption(aggregate2, field) {
12215
- return `${aggregate2[0].toUpperCase()}${aggregate2.slice(1)} of ${field}`;
12711
+ function pivotCaption(aggregate2, field, pivot) {
12712
+ return pivotMeasureName(aggregate2, field, pivot);
12713
+ }
12714
+
12715
+ // xlsx/write/xml-out.ts
12716
+ var CONTROL = "\0-\b\v\f-" + String.fromCharCode(65534, 65535);
12717
+ var INVALID_XML = new RegExp(`[${CONTROL}]`, "g");
12718
+ var escapeText = (text2) => text2.replace(INVALID_XML, "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
12719
+ var escapeAttr = (text2) => text2.replace(INVALID_XML, "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/\r/g, "&#13;").replace(/\n/g, "&#10;").replace(/\t/g, "&#9;");
12720
+ function attrs(values2) {
12721
+ let out = "";
12722
+ for (const [name, value2] of Object.entries(values2)) {
12723
+ if (value2 === void 0) continue;
12724
+ const text2 = typeof value2 === "boolean" ? value2 ? "1" : "0" : typeof value2 === "number" ? num2(value2) : value2;
12725
+ out += ` ${name}="${escapeAttr(text2)}"`;
12726
+ }
12727
+ return out;
12216
12728
  }
12729
+ var el = (name, values2 = {}, content = "") => content ? `<${name}${attrs(values2)}>${content}</${name}>` : `<${name}${attrs(values2)}/>`;
12730
+ var num2 = (value2) => Object.is(value2, -0) ? "0" : String(value2);
12217
12731
 
12218
12732
  // xlsx/pivot/measures.ts
12219
12733
  var pivotMeasures = (pivot) => [
12220
12734
  { field: pivot.valueField, aggregate: pivot.aggregate, caption: pivot.valueCaption },
12221
12735
  ...pivot.additionalValues ?? []
12222
12736
  ];
12223
- function normalizedPivotMeasures(values2) {
12737
+ function normalizedPivotMeasures(values2, pivot) {
12224
12738
  if (!Array.isArray(values2) || values2.length > 15)
12225
12739
  throw new Error("Choose between one and sixteen PivotTable value fields.");
12226
12740
  return values2.map((value2) => {
@@ -12232,7 +12746,7 @@ function normalizedPivotMeasures(values2) {
12232
12746
  return {
12233
12747
  field: value2.field,
12234
12748
  aggregate: aggregate2,
12235
- caption: value2.caption ?? `${aggregate2[0].toUpperCase()}${aggregate2.slice(1)} of ${value2.field}`
12749
+ caption: value2.caption ?? pivotMeasureName(aggregate2, value2.field, pivot)
12236
12750
  };
12237
12751
  });
12238
12752
  }
@@ -12264,307 +12778,16 @@ function aggregateValues(records, field, type) {
12264
12778
  return type === "average" ? sum3 / numbers3.length : sum3;
12265
12779
  }
12266
12780
  var pivotMeasureNumber = (pivot, records, measure2) => aggregateValues(records, pivot.fields.indexOf(measure2.field), measure2.aggregate);
12267
- var pivotNumbers = (pivot, records) => pivotMeasures(pivot).map((measure2) => pivotMeasureNumber(pivot, records, measure2));
12268
- function pivotHeaderDimensions(pivot, columnItems, rowLabels) {
12269
- return {
12270
- rows: (pivot.columnField ? 2 : 1) + (pivot.pageFilter ? 2 : 0),
12271
- width: rowLabels + (pivot.columnField ? columnItems + 1 : 1)
12272
- };
12273
- }
12274
- function pivotHeaders(pivot, columns, labels, label5) {
12275
- const rowLabels = pivot.layout === "compact" ? ["Row Labels"] : pivot.valuesPosition === "first" ? ["Values", ...labels] : pivot.valuesPosition === "between" ? [labels[0], "Values", labels[1]] : [...labels, "Values"];
12276
- return pivot.columnField ? [
12277
- [
12278
- ...rowLabels.map(() => null),
12279
- pivot.layout === "compact" ? "Column Labels" : pivot.columnField,
12280
- ...columns.map(() => null)
12281
- ],
12282
- [...rowLabels, ...columns.map(label5), "Grand Total"]
12283
- ] : [[...rowLabels, null]];
12284
- }
12285
-
12286
- // xlsx/pivot/hierarchy-first.ts
12287
- function appendFirstPivotValues(pivot, context) {
12288
- const {
12289
- rowItems,
12290
- secondRowItems,
12291
- columnItems,
12292
- children: children2,
12293
- innerIndices,
12294
- groups,
12295
- details,
12296
- buckets,
12297
- width,
12298
- rowLabels,
12299
- top,
12300
- bottom,
12301
- append
12302
- } = context;
12303
- const compact3 = pivot.layout === "compact";
12304
- const tabular = !pivot.layout || pivot.layout === "tabular";
12305
- const blank = () => Array(width - rowLabels).fill(null);
12306
- pivotMeasures(pivot).forEach((measure2, m) => {
12307
- const numbers3 = (keys, records) => [
12308
- ...columnItems.map(
12309
- (column2) => pivotMeasureNumber(
12310
- pivot,
12311
- buckets.get(JSON.stringify([...keys, pivotValueKey(column2)])) ?? [],
12312
- measure2
12313
- )
12314
- ),
12315
- pivotMeasureNumber(pivot, records, measure2)
12316
- ];
12317
- if (!tabular)
12318
- append([measure2.caption, ...Array(rowLabels - 1).fill(null)], blank(), {
12319
- indices: [m],
12320
- measure: m
12321
- });
12322
- let first2 = true;
12323
- rowItems.forEach((outer, outerIndex) => {
12324
- const key = pivotValueKey(outer);
12325
- const group = groups.get(key) ?? [];
12326
- if (!tabular)
12327
- append(
12328
- compact3 ? [pivotItemLabel(outer)] : [null, pivotItemLabel(outer), null],
12329
- top ? numbers3([key], group) : blank(),
12330
- { indices: [m, outerIndex], measure: m },
12331
- compact3 ? 1 : 0
12332
- );
12333
- const innerKeys = [...children2.get(key)].sort(
12334
- (a, b) => innerIndices.get(a) - innerIndices.get(b)
12335
- );
12336
- innerKeys.forEach((innerKey, child) => {
12337
- const innerIndex = innerIndices.get(innerKey);
12338
- append(
12339
- compact3 ? [pivotItemLabel(secondRowItems[innerIndex])] : [
12340
- tabular && first2 ? measure2.caption : null,
12341
- pivot.repeatLabels || tabular && child === 0 ? pivotItemLabel(outer) : null,
12342
- pivotItemLabel(secondRowItems[innerIndex])
12343
- ],
12344
- numbers3([key, innerKey], details.get(JSON.stringify([key, innerKey]))),
12345
- { indices: [m, outerIndex, innerIndex], measure: m },
12346
- compact3 ? 2 : 0
12347
- );
12348
- first2 = false;
12349
- });
12350
- if (bottom)
12351
- append(
12352
- compact3 ? [`${String(pivotItemLabel(outer))} Total`] : [null, `${String(pivotItemLabel(outer))} Total`, null],
12353
- numbers3([key], group),
12354
- { indices: [m, outerIndex], measure: m, type: "default" },
12355
- compact3 ? 1 : 0
12356
- );
12357
- });
12358
- });
12359
- }
12360
-
12361
- // xlsx/pivot/hierarchy.ts
12362
- var label2 = pivotItemLabel;
12363
- function hierarchicalPivotGrid(pivot) {
12364
- const rowItems = pivotItems(pivot, pivot.rowField);
12365
- const secondRowItems = pivotItems(pivot, pivot.secondRowField);
12366
- const columnItems = pivot.columnField ? pivotItems(pivot, pivot.columnField) : [];
12367
- const outerField = pivot.fields.indexOf(pivot.rowField);
12368
- const innerField = pivot.fields.indexOf(pivot.secondRowField);
12369
- const columnField = pivot.columnField ? pivot.fields.indexOf(pivot.columnField) : -1;
12370
- const layout2 = pivot.layout ?? "tabular";
12371
- const compact3 = layout2 === "compact";
12372
- const firstValues = pivot.valuesPosition === "first";
12373
- const between = pivot.valuesPosition === "between";
12374
- const measures = pivotMeasures(pivot);
12375
- const top = firstValues && layout2 !== "tabular" && pivot.subtotals !== false && (pivot.subtotalPosition ?? "top") === "top";
12376
- const bottom = pivot.subtotals !== false && !top;
12377
- const rowLabelColumns = compact3 ? 1 : 3;
12378
- const groups = /* @__PURE__ */ new Map();
12379
- const details = /* @__PURE__ */ new Map();
12380
- const children2 = /* @__PURE__ */ new Map();
12381
- const innerIndices = new Map(secondRowItems.map((item, index2) => [pivotValueKey(item), index2]));
12382
- const buckets = /* @__PURE__ */ new Map();
12383
- const collect = (map, key, record) => {
12384
- const list = map.get(key);
12385
- if (list) list.push(record);
12386
- else map.set(key, [record]);
12387
- };
12388
- for (const record of pivot.records) {
12389
- const outer = pivotValueKey(record[outerField] ?? null);
12390
- const inner2 = pivotValueKey(record[innerField] ?? null);
12391
- collect(groups, outer, record);
12392
- collect(details, JSON.stringify([outer, inner2]), record);
12393
- if (!children2.has(outer)) children2.set(outer, /* @__PURE__ */ new Set());
12394
- children2.get(outer).add(inner2);
12395
- if (pivot.columnField) {
12396
- const column2 = pivotValueKey(record[columnField] ?? null);
12397
- for (const key of [[], [outer], [outer, inner2]])
12398
- collect(buckets, JSON.stringify([...key, column2]), record);
12399
- }
12400
- }
12401
- const dimensions = pivotHeaderDimensions(pivot, columnItems.length, rowLabelColumns);
12402
- const rows2 = (details.size + rowItems.length * Number(bottom) + 1) * measures.length + rowItems.length * Number(layout2 !== "tabular") * (firstValues ? measures.length : 1) + (firstValues ? measures.length : between ? rowItems.length * measures.length : details.size) * Number(layout2 !== "tabular") + dimensions.rows;
12403
- if (rows2 * dimensions.width > 1e6) throw new Error("The PivotTable result is too large.");
12404
- const labels = compact3 ? ["Row Labels"] : [pivot.rowField, pivot.secondRowField];
12405
- const values2 = pivotHeaders(pivot, columnItems, labels, label2);
12406
- const firstDataRow = values2.length;
12407
- const indents = values2.map(() => 0);
12408
- const rowEntries = [];
12409
- const append = (labels2, numbers4, entry, indent = 0) => {
12410
- values2.push([...labels2, ...numbers4]);
12411
- rowEntries.push(entry);
12412
- indents.push(indent);
12413
- };
12414
- const bands = (keys, records) => [
12415
- ...columnItems.map(
12416
- (column2) => pivotNumbers(pivot, buckets.get(JSON.stringify([...keys, pivotValueKey(column2)])) ?? [])
12417
- ),
12418
- pivotNumbers(pivot, records)
12419
- ];
12420
- const numbers3 = (keys, records) => bands(keys, records).flat();
12421
- const appendMeasures = (labels2, keys, records, indices, type) => {
12422
- const values3 = bands(keys, records);
12423
- measures.forEach(
12424
- (measure2, m) => append(
12425
- type ? [
12426
- `${type === "grand" ? "Total" : String(labels2[0])} ${measure2.caption}`,
12427
- ...Array(rowLabelColumns - 1).fill(null)
12428
- ] : compact3 ? [measure2.caption] : [
12429
- ...labels2.map(
12430
- (label5) => layout2 === "tabular" && m === 0 || pivot.repeatLabels ? label5 : null
12431
- ),
12432
- measure2.caption
12433
- ],
12434
- values3.map((band) => band[m] ?? null),
12435
- { indices: type ? indices : [...indices, m], measure: m, ...type ? { type } : {} },
12436
- compact3 && !type ? 2 : 0
12437
- )
12438
- );
12439
- };
12440
- if (firstValues)
12441
- appendFirstPivotValues(pivot, {
12442
- rowItems,
12443
- secondRowItems,
12444
- columnItems,
12445
- children: children2,
12446
- innerIndices,
12447
- groups,
12448
- details,
12449
- buckets,
12450
- width: dimensions.width,
12451
- rowLabels: rowLabelColumns,
12452
- top,
12453
- bottom,
12454
- append
12455
- });
12456
- else
12457
- rowItems.forEach((outer, outerIndex) => {
12458
- const key = pivotValueKey(outer);
12459
- if (layout2 !== "tabular")
12460
- append(
12461
- [label2(outer), ...Array(rowLabelColumns - 1).fill(null)],
12462
- top ? numbers3([key], groups.get(key) ?? []) : Array(dimensions.width - rowLabelColumns).fill(null),
12463
- { indices: [outerIndex] }
12464
- );
12465
- let first2 = true;
12466
- const innerKeys = [...children2.get(key)].sort(
12467
- (a, b) => innerIndices.get(a) - innerIndices.get(b)
12468
- );
12469
- if (between)
12470
- measures.forEach((measure2, m) => {
12471
- if (layout2 !== "tabular")
12472
- append(
12473
- compact3 ? [measure2.caption] : [pivot.repeatLabels ? label2(outer) : null, measure2.caption, null],
12474
- Array(dimensions.width - rowLabelColumns).fill(null),
12475
- { indices: [outerIndex, m], measure: m },
12476
- compact3 ? 1 : 0
12477
- );
12478
- innerKeys.forEach((innerKey, child) => {
12479
- const innerIndex = innerIndices.get(innerKey);
12480
- const keys = [key, innerKey];
12481
- const records = details.get(JSON.stringify(keys));
12482
- append(
12483
- compact3 ? [label2(secondRowItems[innerIndex])] : [
12484
- pivot.repeatLabels || layout2 === "tabular" && m === 0 && child === 0 ? label2(outer) : null,
12485
- layout2 === "tabular" && child === 0 ? measure2.caption : null,
12486
- label2(secondRowItems[innerIndex])
12487
- ],
12488
- [
12489
- ...columnItems.map(
12490
- (column2) => pivotMeasureNumber(
12491
- pivot,
12492
- buckets.get(JSON.stringify([...keys, pivotValueKey(column2)])) ?? [],
12493
- measure2
12494
- )
12495
- ),
12496
- pivotMeasureNumber(pivot, records, measure2)
12497
- ],
12498
- { indices: [outerIndex, m, innerIndex], measure: m },
12499
- compact3 ? 2 : 0
12500
- );
12501
- });
12502
- });
12503
- else
12504
- innerKeys.forEach((innerKey) => {
12505
- const innerIndex = innerIndices.get(innerKey);
12506
- const inner2 = secondRowItems[innerIndex];
12507
- const keys = [key, innerKey];
12508
- const records = details.get(JSON.stringify(keys));
12509
- if (!records) return;
12510
- if (layout2 !== "tabular")
12511
- append(
12512
- compact3 ? [label2(inner2)] : [pivot.repeatLabels ? label2(outer) : null, label2(inner2), null],
12513
- Array(dimensions.width - rowLabelColumns).fill(null),
12514
- { indices: [outerIndex, innerIndex] },
12515
- compact3 ? 1 : 0
12516
- );
12517
- appendMeasures(
12518
- [pivot.repeatLabels || first2 ? label2(outer) : null, label2(inner2)],
12519
- keys,
12520
- records,
12521
- [outerIndex, innerIndex]
12522
- );
12523
- first2 = false;
12524
- });
12525
- if (bottom)
12526
- appendMeasures([label2(outer)], [key], groups.get(key) ?? [], [outerIndex], "default");
12527
- });
12528
- appendMeasures([], [], pivot.records, [0], "grand");
12529
- return {
12530
- values: values2,
12531
- rowItems,
12532
- secondRowItems,
12533
- columnItems,
12534
- rowEntries,
12535
- firstDataRow,
12536
- rowLabelColumns,
12537
- indents,
12538
- firstHeaderRow: 1
12539
- };
12540
- }
12541
-
12542
- // xlsx/write/xml-out.ts
12543
- var CONTROL = "\0-\b\v\f-" + String.fromCharCode(65534, 65535);
12544
- var INVALID_XML = new RegExp(`[${CONTROL}]`, "g");
12545
- var escapeText = (text2) => text2.replace(INVALID_XML, "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
12546
- var escapeAttr = (text2) => text2.replace(INVALID_XML, "").replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/\r/g, "&#13;").replace(/\n/g, "&#10;").replace(/\t/g, "&#9;");
12547
- function attrs(values2) {
12548
- let out = "";
12549
- for (const [name, value2] of Object.entries(values2)) {
12550
- if (value2 === void 0) continue;
12551
- const text2 = typeof value2 === "boolean" ? value2 ? "1" : "0" : typeof value2 === "number" ? num2(value2) : value2;
12552
- out += ` ${name}="${escapeAttr(text2)}"`;
12553
- }
12554
- return out;
12555
- }
12556
- var el = (name, values2 = {}, content = "") => content ? `<${name}${attrs(values2)}>${content}</${name}>` : `<${name}${attrs(values2)}/>`;
12557
- var num2 = (value2) => Object.is(value2, -0) ? "0" : String(value2);
12558
12781
 
12559
12782
  // xlsx/pivot/columns.ts
12560
12783
  var SEPARATOR = "";
12561
- var label3 = pivotItemLabel;
12562
12784
  var columnKey = (keys, depth) => keys.slice(0, depth).join(SEPARATOR);
12563
12785
  var recordColumnKeys = (record, indices) => indices.map((index2) => pivotValueKey(record[index2] ?? null));
12564
12786
  function pivotColumnEntries(pivot) {
12565
12787
  const names = pivotColumnFields(pivot);
12566
12788
  const items = names.map((name) => pivotItems(pivot, name));
12567
12789
  const entries = [];
12790
+ const functions = names.map((name) => fieldSubtotalFunctions(pivot, name));
12568
12791
  if (names.length) {
12569
12792
  const order = items.map(
12570
12793
  (list) => new Map(list.map((item, index2) => [pivotValueKey(item), index2]))
@@ -12599,7 +12822,9 @@ function pivotColumnEntries(pivot) {
12599
12822
  if (level === names.length - 1) entries.push({ kind: "leaf", ...entry });
12600
12823
  else {
12601
12824
  visit2(child[1], level + 1, here.path, here.values, here.keys);
12602
- entries.push({ kind: "subtotal", ...entry });
12825
+ const own = functions[level];
12826
+ if (own === "auto") entries.push({ kind: "subtotal", ...entry });
12827
+ else for (const fn of own) entries.push({ kind: "subtotal", ...entry, fn });
12603
12828
  }
12604
12829
  }
12605
12830
  };
@@ -12608,26 +12833,31 @@ function pivotColumnEntries(pivot) {
12608
12833
  entries.push({ kind: "grand", path: [], key: "", values: [] });
12609
12834
  return { names, items, entries };
12610
12835
  }
12611
- function pivotColumnDimensions(pivot, columns, labelColumns) {
12612
- const measures = 1 + (pivot.additionalValues?.length ?? 0);
12836
+ function pivotColumnDimensions(pivot, columns, labelColumns, valuesOnRows = false) {
12837
+ const measures = valuesOnRows ? 1 : 1 + (pivot.additionalValues?.length ?? 0);
12613
12838
  const levels = columns.names.length;
12614
12839
  return {
12615
12840
  rows: (levels ? levels + 1 + Number(measures > 1) : 1) + (pivot.pageFilter ? 2 : 0),
12616
12841
  width: labelColumns + (levels ? columns.entries.length : 1) * measures
12617
12842
  };
12618
12843
  }
12619
- function pivotColumnHeaders(pivot, columns, rowLabels) {
12620
- const measures = pivotMeasures(pivot);
12844
+ function pivotColumnHeaders(pivot, columns, rowLabels, valuesOnRows = false) {
12845
+ const measures = valuesOnRows ? pivotMeasures(pivot).slice(0, 1) : pivotMeasures(pivot);
12621
12846
  const count2 = measures.length;
12622
12847
  const levels = columns.names.length;
12623
- if (!levels) return [[...rowLabels, ...measures.map((measure2) => measure2.caption)]];
12848
+ if (!levels)
12849
+ return [
12850
+ [...rowLabels, ...valuesOnRows ? [null] : measures.map((measure2) => measure2.caption)]
12851
+ ];
12624
12852
  const compact3 = pivot.layout === "compact";
12625
12853
  const labelColumns = rowLabels.length;
12626
12854
  const width = labelColumns + columns.entries.length * count2;
12627
12855
  const rows2 = levels + 1 + Number(count2 > 1);
12628
12856
  const grid6 = Array.from({ length: rows2 }, () => Array(width).fill(null));
12629
- if (count2 === 1) grid6[0][0] = pivot.valueCaption;
12630
- const titles = compact3 ? ["Column Labels"] : [...columns.names, ...count2 > 1 ? ["Values"] : []];
12857
+ if (count2 === 1 && !valuesOnRows) grid6[0][0] = pivot.valueCaption;
12858
+ const caps = pivotCaptions(pivot);
12859
+ const labelOf = pivotItemLabeler(pivot);
12860
+ const titles = compact3 ? [caps.columnLabels] : [...columns.names, ...count2 > 1 ? [caps.values] : []];
12631
12861
  titles.forEach((title, i2) => {
12632
12862
  grid6[0][labelColumns + i2] = title;
12633
12863
  });
@@ -12640,23 +12870,23 @@ function pivotColumnHeaders(pivot, columns, rowLabels) {
12640
12870
  if (entry.kind === "leaf") {
12641
12871
  entry.path.forEach((_index, level) => {
12642
12872
  const continued = entry.path.slice(0, level + 1).every((p, i2) => p === previous[i2]);
12643
- if (!continued) grid6[1 + level][at] = label3(entry.values[level]);
12873
+ if (!continued) grid6[1 + level][at] = labelOf(columns.names[level], entry.values[level]);
12644
12874
  });
12645
12875
  previous = entry.path;
12646
12876
  if (count2 > 1) measures.forEach((measure2, m) => grid6[rows2 - 1][at + m] = measure2.caption);
12647
12877
  return;
12648
12878
  }
12649
12879
  const row2 = entry.kind === "grand" ? 1 : entry.path.length;
12650
- const name = entry.kind === "grand" ? "" : String(label3(entry.values.at(-1)));
12880
+ const name = entry.kind === "grand" ? "" : String(labelOf(columns.names[entry.path.length - 1], entry.values.at(-1)));
12651
12881
  measures.forEach((measure2, m) => {
12652
- grid6[row2][at + m] = count2 === 1 ? entry.kind === "grand" ? "Grand Total" : `${name} Total` : entry.kind === "grand" ? `Total ${measure2.caption}` : `${name} ${measure2.caption}`;
12882
+ const custom = entry.fn ? caps.functions[entry.fn] : void 0;
12883
+ grid6[row2][at + m] = custom ? count2 === 1 ? `${name} ${custom}` : `${name} ${custom} of ${measure2.field}` : count2 === 1 ? entry.kind === "grand" ? caps.grandTotal : fillCaption(caps.subtotal, name) : entry.kind === "grand" ? fillCaption(caps.measureTotal, measure2.caption) : `${name} ${measure2.caption}`;
12653
12884
  });
12654
12885
  });
12655
12886
  return grid6;
12656
12887
  }
12657
12888
 
12658
12889
  // xlsx/pivot/nested.ts
12659
- var label4 = pivotItemLabel;
12660
12890
  var MAX_CELLS = 1e6;
12661
12891
  var node = (index2, value2) => ({
12662
12892
  index: index2,
@@ -12668,6 +12898,10 @@ var node = (index2, value2) => ({
12668
12898
  function nestedPivotGrid(pivot) {
12669
12899
  const names = pivotRowFields(pivot);
12670
12900
  const depth = names.length;
12901
+ const valuesAt = pivotValuesIndex(pivot);
12902
+ const onRows = valuesAt >= 0;
12903
+ const levels = depth + (onRows ? 1 : 0);
12904
+ const fieldOf = (level) => !onRows || level < valuesAt ? level : level === valuesAt ? -1 : level - 1;
12671
12905
  const axisItems = names.map((name) => pivotItems(pivot, name));
12672
12906
  const itemIndices = axisItems.map(
12673
12907
  (items) => new Map(items.map((item, index2) => [pivotValueKey(item), index2]))
@@ -12679,125 +12913,170 @@ function nestedPivotGrid(pivot) {
12679
12913
  const compact3 = layout2 === "compact";
12680
12914
  const tabular = layout2 === "tabular";
12681
12915
  const above = !tabular && (pivot.subtotalPosition ?? "top") === "top";
12682
- const labelColumns = compact3 ? 1 : depth;
12916
+ const labelColumns = compact3 ? 1 : levels;
12683
12917
  const measures = pivotMeasures(pivot);
12918
+ const functions = names.map((name) => fieldSubtotalFunctions(pivot, name));
12919
+ const caps = pivotCaptions(pivot);
12920
+ const labelOf = pivotItemLabeler(pivot);
12684
12921
  const root = node(0, null);
12685
12922
  for (const record of pivot.records) {
12686
12923
  const keys = recordColumnKeys(record, columnFields);
12687
12924
  let current = root;
12688
- for (let level = -1; level < depth; level++) {
12689
- if (level >= 0) {
12690
- const value2 = record[fieldIndices[level]] ?? null;
12925
+ for (let field = -1; field < depth; field++) {
12926
+ if (field >= 0) {
12927
+ const value2 = record[fieldIndices[field]] ?? null;
12691
12928
  const key = pivotValueKey(value2);
12692
12929
  let child = current.children.get(key);
12693
12930
  if (!child) {
12694
- child = node(itemIndices[level].get(key), value2);
12931
+ child = node(itemIndices[field].get(key), value2);
12695
12932
  current.children.set(key, child);
12696
12933
  }
12697
12934
  current = child;
12698
12935
  }
12699
12936
  current.records.push(record);
12700
- for (let width = 1; width <= keys.length; width++) {
12701
- const key = columnKey(keys, width);
12937
+ for (let width2 = 1; width2 <= keys.length; width2++) {
12938
+ const key = columnKey(keys, width2);
12702
12939
  const list = current.columns.get(key);
12703
12940
  if (list) list.push(record);
12704
12941
  else current.columns.set(key, [record]);
12705
12942
  }
12706
12943
  }
12707
12944
  }
12708
- const dimensions = pivotColumnDimensions(pivot, columns, labelColumns);
12709
- const functions = names.map((name) => fieldSubtotalFunctions(pivot, name));
12710
- let rows2 = 1;
12711
- const count2 = (parent, level) => {
12712
- for (const child of parent.children.values()) {
12713
- rows2++;
12714
- if (level < depth - 1) {
12715
- const f6 = functions[level];
12716
- rows2 += f6 === "auto" ? 1 : f6.length;
12717
- count2(child, level + 1);
12718
- }
12719
- }
12720
- };
12721
- count2(root, 0);
12722
- if ((rows2 + dimensions.rows) * dimensions.width > MAX_CELLS)
12723
- throw new Error("The PivotTable result is too large.");
12724
- const values2 = pivotColumnHeaders(pivot, columns, compact3 ? ["Row Labels"] : names);
12725
- const firstDataRow = values2.length;
12726
- const indents = values2.map(() => 0);
12945
+ const dimensions = pivotColumnDimensions(pivot, columns, labelColumns, onRows);
12946
+ const rowTitles = names.map((name) => name);
12947
+ if (onRows) rowTitles.splice(valuesAt, 0, caps.values);
12948
+ let values2 = [];
12949
+ let indents = [];
12727
12950
  const rowEntries = [];
12728
- const blanks = () => Array(dimensions.width - labelColumns).fill(null);
12729
- const bands = (group, run) => columns.entries.flatMap(
12730
- (entry) => run(entry.kind === "grand" ? group.records : group.columns.get(entry.key) ?? [])
12731
- );
12732
- const numbers3 = (group) => bands(group, (records) => pivotNumbers(pivot, records));
12733
- const subtotalNumbers = (group, fn) => bands(
12734
- group,
12735
- (records) => measures.map((measure2) => aggregateValues(records, pivot.fields.indexOf(measure2.field), fn))
12736
- );
12737
- const labelCells = (path, shown, text2) => {
12951
+ let counting = true;
12952
+ let rowCount = 0;
12953
+ const width = dimensions.width - labelColumns;
12954
+ const blanks = () => Array(width).fill(null);
12955
+ const cells = (group, rowFn, measure2) => columns.entries.flatMap((entry) => {
12956
+ const records = entry.kind === "grand" ? group.records : group.columns.get(entry.key) ?? [];
12957
+ const picked = measure2 === void 0 ? measures : [measures[measure2]];
12958
+ if (rowFn && entry.fn && rowFn !== entry.fn) return picked.map(() => null);
12959
+ const fn = rowFn ?? entry.fn;
12960
+ return picked.map(
12961
+ (one2) => fn ? aggregateValues(records, pivot.fields.indexOf(one2.field), fn) : pivotMeasureNumber(pivot, records, one2)
12962
+ );
12963
+ });
12964
+ const labelCells = (path, shown, level, text2) => {
12738
12965
  if (compact3) return [text2];
12739
- const cells = Array(depth).fill(null);
12740
- path.forEach((value2, level) => {
12741
- if (shown[level]) cells[level] = label4(value2);
12966
+ const row2 = Array(levels).fill(null);
12967
+ path.labels.forEach((value2, at) => {
12968
+ if (shown[at]) row2[at] = value2;
12742
12969
  });
12743
- cells[path.length] = text2;
12744
- return cells;
12970
+ row2[level] = text2;
12971
+ return row2;
12745
12972
  };
12746
- const push3 = (cells, numbersOnRow, entry, indent) => {
12747
- values2.push([...cells, ...numbersOnRow]);
12973
+ const push3 = (indent, build4) => {
12974
+ if (counting) {
12975
+ if ((++rowCount + dimensions.rows) * dimensions.width > MAX_CELLS)
12976
+ throw new Error("The PivotTable result is too large.");
12977
+ return;
12978
+ }
12979
+ const [cells2, numbers3, entry] = build4();
12980
+ values2.push([...cells2, ...numbers3]);
12748
12981
  rowEntries.push(entry);
12749
12982
  indents.push(compact3 ? indent : 0);
12750
12983
  };
12751
- const emit = (parent, level, path, indices, firsts) => {
12752
- const last = level === depth - 1;
12753
- const own = functions[level];
12754
- const children2 = [...parent.children.values()].sort((a, b) => a.index - b.index);
12984
+ const entryOf = (indices, measure2, type) => ({
12985
+ indices,
12986
+ ...measure2 !== void 0 ? { measure: measure2 } : {},
12987
+ ...type ? { type } : {}
12988
+ });
12989
+ const walk = (level, group, measure2, path) => {
12990
+ const field = fieldOf(level);
12991
+ const last = level === levels - 1;
12992
+ const repeated = Array.from(
12993
+ { length: level },
12994
+ (_v, k) => !!pivot.repeatLabels && fieldOf(k) >= 0
12995
+ );
12996
+ const leafShown = (firsts) => repeated.map((repeat, k) => repeat || tabular && firsts.slice(k + 1).every(Boolean));
12997
+ if (field < 0) {
12998
+ measures.forEach((one2, m) => {
12999
+ const here = {
13000
+ labels: [...path.labels, one2.caption],
13001
+ indices: [...path.indices, m],
13002
+ firsts: [...path.firsts, m === 0]
13003
+ };
13004
+ if (last)
13005
+ return push3(level, () => [
13006
+ labelCells(path, leafShown(here.firsts), level, one2.caption),
13007
+ cells(group, void 0, m),
13008
+ entryOf(here.indices, m)
13009
+ ]);
13010
+ if (!tabular)
13011
+ push3(level, () => [
13012
+ labelCells(path, repeated, level, one2.caption),
13013
+ blanks(),
13014
+ entryOf(here.indices, m)
13015
+ ]);
13016
+ walk(level + 1, group, m, here);
13017
+ });
13018
+ return;
13019
+ }
13020
+ const own = functions[field];
13021
+ const valuesAbove = !onRows || valuesAt < level;
13022
+ const showsValue = above && own === "auto" && valuesAbove;
13023
+ const children2 = [...group.children.values()].sort((a, b) => a.index - b.index);
12755
13024
  children2.forEach((child, position) => {
12756
- const here = [...path, child.value];
12757
- const at = [...indices, child.index];
12758
- const firstHere = [...firsts, position === 0];
12759
- const repeated = Array(level).fill(!!pivot.repeatLabels);
12760
- if (last) {
12761
- const shown = repeated.map(
12762
- (repeat, k) => repeat || tabular && firstHere.slice(k + 1).every(Boolean)
12763
- );
12764
- push3(labelCells(path, shown, label4(child.value)), numbers3(child), { indices: at }, level);
12765
- return;
12766
- }
13025
+ const here = {
13026
+ labels: [...path.labels, labelOf(names[field], child.value)],
13027
+ indices: [...path.indices, child.index],
13028
+ firsts: [...path.firsts, position === 0]
13029
+ };
13030
+ const text2 = labelOf(names[field], child.value);
13031
+ if (last)
13032
+ return push3(level, () => [
13033
+ labelCells(path, leafShown(here.firsts), level, text2),
13034
+ cells(child, void 0, measure2),
13035
+ entryOf(here.indices, measure2)
13036
+ ]);
12767
13037
  if (!tabular)
12768
- push3(
12769
- labelCells(path, repeated, label4(child.value)),
12770
- own === "auto" && above ? numbers3(child) : blanks(),
12771
- { indices: at },
12772
- level
12773
- );
12774
- emit(child, level + 1, here, at, firstHere);
12775
- const caption = String(label4(child.value));
13038
+ push3(level, () => [
13039
+ labelCells(path, repeated, level, text2),
13040
+ showsValue ? cells(child, void 0, measure2) : blanks(),
13041
+ entryOf(here.indices, measure2)
13042
+ ]);
13043
+ walk(level + 1, child, measure2, here);
13044
+ if (field === depth - 1) return;
13045
+ const caption = String(text2);
13046
+ const subtotal = (title, fn, one2) => push3(level, () => [
13047
+ labelCells(path, repeated, level, title),
13048
+ cells(child, fn, one2),
13049
+ entryOf(here.indices, one2, fn ?? "default")
13050
+ ]);
12776
13051
  if (own === "auto") {
12777
- if (!above)
12778
- push3(
12779
- labelCells(path, repeated, `${caption} Total`),
12780
- numbers3(child),
12781
- { indices: at, type: "default" },
12782
- level
12783
- );
13052
+ if (showsValue) return;
13053
+ if (valuesAbove) subtotal(fillCaption(caps.subtotal, caption), void 0, measure2);
13054
+ else measures.forEach((one2, m) => subtotal(`${caption} ${one2.caption}`, void 0, m));
12784
13055
  } else
12785
13056
  for (const fn of own)
12786
- push3(
12787
- labelCells(path, repeated, `${caption} ${PIVOT_SUBTOTALS[fn].label}`),
12788
- subtotalNumbers(child, fn),
12789
- { indices: at, type: fn },
12790
- level
12791
- );
13057
+ if (valuesAbove) subtotal(`${caption} ${caps.functions[fn]}`, fn, measure2);
13058
+ else
13059
+ measures.forEach(
13060
+ (one2, m) => subtotal(`${caption} ${caps.functions[fn]} of ${one2.field}`, fn, m)
13061
+ );
12792
13062
  });
12793
13063
  };
12794
- emit(root, 0, [], [], []);
12795
- push3(
12796
- compact3 ? ["Grand Total"] : ["Grand Total", ...Array(depth - 1).fill(null)],
12797
- numbers3(root),
12798
- { indices: [0], type: "grand" },
12799
- 0
12800
- );
13064
+ const grand = (text2, measure2) => push3(0, () => [
13065
+ compact3 ? [text2] : [text2, ...Array(levels - 1).fill(null)],
13066
+ cells(root, void 0, measure2),
13067
+ entryOf([0], measure2, "grand")
13068
+ ]);
13069
+ const build3 = () => {
13070
+ walk(0, root, void 0, { labels: [], indices: [], firsts: [] });
13071
+ if (onRows) measures.forEach((one2, m) => grand(fillCaption(caps.measureTotal, one2.caption), m));
13072
+ else grand(caps.grandTotal);
13073
+ };
13074
+ build3();
13075
+ counting = false;
13076
+ values2 = pivotColumnHeaders(pivot, columns, compact3 ? [caps.rowLabels] : rowTitles, onRows);
13077
+ const firstDataRow = values2.length;
13078
+ indents = values2.map(() => 0);
13079
+ build3();
12801
13080
  return {
12802
13081
  values: values2,
12803
13082
  rowItems: axisItems[0],
@@ -12809,105 +13088,15 @@ function nestedPivotGrid(pivot) {
12809
13088
  rowEntries,
12810
13089
  firstDataRow,
12811
13090
  rowLabelColumns: labelColumns,
12812
- indents
13091
+ indents,
13092
+ ...onRows ? { firstHeaderRow: 1 } : {}
12813
13093
  };
12814
13094
  }
12815
13095
 
12816
13096
  // xlsx/pivot/aggregate.ts
12817
13097
  function pivotGrid(pivot) {
12818
13098
  validatePivotFields(pivot);
12819
- return prependPivotPage(pivotDataGrid(pivotPageProjection(pivot)), pivot);
12820
- }
12821
- function pivotDataGrid(pivot) {
12822
- if (pivot.valuesAxis !== "rows") return nestedPivotGrid(pivot);
12823
- if (pivot.secondRowField) return hierarchicalPivotGrid(pivot);
12824
- const rowItems = pivotItems(pivot, pivot.rowField);
12825
- const columnItems = pivot.columnField ? pivotItems(pivot, pivot.columnField) : [];
12826
- const compact3 = pivot.layout === "compact";
12827
- const headings = pivot.layout !== void 0 && pivot.layout !== "tabular";
12828
- const dimensions = pivotHeaderDimensions(pivot, columnItems.length, compact3 ? 1 : 2);
12829
- const dataRows = (rowItems.length + 1) * (1 + (pivot.additionalValues?.length ?? 0)) + (headings ? rowItems.length : 0);
12830
- if ((dataRows + dimensions.rows) * dimensions.width > 1e6)
12831
- throw new Error("The PivotTable result is too large.");
12832
- const label5 = pivotItemLabel;
12833
- const values2 = pivotHeaders(pivot, columnItems, [compact3 ? "Row Labels" : pivot.rowField], label5);
12834
- const rowField = pivot.fields.indexOf(pivot.rowField);
12835
- const colField = pivot.columnField ? pivot.fields.indexOf(pivot.columnField) : -1;
12836
- const groups = /* @__PURE__ */ new Map();
12837
- const cells = /* @__PURE__ */ new Map();
12838
- const columns = /* @__PURE__ */ new Map();
12839
- const collect = (map, key, record) => {
12840
- const found = map.get(key);
12841
- if (found) found.push(record);
12842
- else map.set(key, [record]);
12843
- };
12844
- for (const record of pivot.records) {
12845
- const key = pivotValueKey(record[rowField] ?? null);
12846
- collect(groups, key, record);
12847
- if (pivot.columnField) {
12848
- const col = pivotValueKey(record[colField] ?? null);
12849
- collect(columns, col, record);
12850
- collect(cells, JSON.stringify([key, col]), record);
12851
- }
12852
- }
12853
- const firstDataRow = values2.length;
12854
- const measures = pivotMeasures(pivot);
12855
- const rowEntries = [];
12856
- const indents = values2.map(() => 0);
12857
- const append = (caption, bands, index2, grand = false) => {
12858
- measures.forEach((measure2, m) => {
12859
- values2.push([
12860
- ...compact3 ? [grand ? `Total ${measure2.caption}` : measure2.caption] : [
12861
- grand ? `Total ${measure2.caption}` : pivot.repeatLabels || !headings && m === 0 ? caption : null,
12862
- grand ? null : measure2.caption
12863
- ],
12864
- ...bands.map((band) => band[m] ?? null)
12865
- ]);
12866
- indents.push(compact3 && !grand ? 1 : 0);
12867
- rowEntries.push({
12868
- indices: grand ? [0] : [index2, m],
12869
- measure: m,
12870
- ...grand ? { type: "grand" } : {}
12871
- });
12872
- });
12873
- };
12874
- rowItems.forEach((item, index2) => {
12875
- const key = pivotValueKey(item);
12876
- if (headings) {
12877
- values2.push([label5(item), ...Array(dimensions.width - 1).fill(null)]);
12878
- rowEntries.push({ indices: [index2] });
12879
- indents.push(0);
12880
- }
12881
- append(
12882
- label5(item),
12883
- [
12884
- ...columnItems.map(
12885
- (col) => pivotNumbers(pivot, cells.get(JSON.stringify([key, pivotValueKey(col)])) ?? [])
12886
- ),
12887
- pivotNumbers(pivot, groups.get(key) ?? [])
12888
- ],
12889
- index2
12890
- );
12891
- });
12892
- append(
12893
- "Grand Total",
12894
- [
12895
- ...columnItems.map((col) => pivotNumbers(pivot, columns.get(pivotValueKey(col)) ?? [])),
12896
- pivotNumbers(pivot, pivot.records)
12897
- ],
12898
- 0,
12899
- true
12900
- );
12901
- return {
12902
- values: values2,
12903
- rowItems,
12904
- columnItems,
12905
- firstDataRow,
12906
- rowLabelColumns: compact3 ? 1 : 2,
12907
- indents,
12908
- firstHeaderRow: 1,
12909
- rowEntries
12910
- };
13099
+ return prependPivotPage(nestedPivotGrid(pivotPageProjection(pivot)), pivot);
12911
13100
  }
12912
13101
  function pivotTableAt(sheet, at) {
12913
13102
  return sheet.pivotTables?.find((pivot) => rangeContains(pivot.location, at));
@@ -13020,7 +13209,7 @@ function headerMode(args, i2, ctx, firstRow) {
13020
13209
  if (mode === 1 || mode === 3) return true;
13021
13210
  return fail(ERR.VALUE);
13022
13211
  }
13023
- var keyOf = (values2) => JSON.stringify(values2);
13212
+ var keyOf2 = (values2) => JSON.stringify(values2);
13024
13213
  var plain2 = (v) => v === void 0 || isError(v) ? null : v;
13025
13214
  function compareBy(keys, rows2) {
13026
13215
  return (a, b) => {
@@ -13060,12 +13249,12 @@ function groupby(args, ctx) {
13060
13249
  if (rows2.length === 0) fail(ERR.CALC);
13061
13250
  const groups = /* @__PURE__ */ new Map();
13062
13251
  for (const r of rows2) {
13063
- const key = keyOf(keysM.data[r]);
13252
+ const key = keyOf2(keysM.data[r]);
13064
13253
  const found = groups.get(key);
13065
13254
  if (found) found.push(r);
13066
13255
  else groups.set(key, [r]);
13067
13256
  }
13068
- const table2 = [...groups.values()].map((members) => {
13257
+ const table3 = [...groups.values()].map((members) => {
13069
13258
  const key = keysM.data[members[0]];
13070
13259
  const cells = Array.from(
13071
13260
  { length: vCols },
@@ -13077,8 +13266,8 @@ function groupby(args, ctx) {
13077
13266
  return [...key, ...cells];
13078
13267
  });
13079
13268
  for (const key of sort2) if (Math.abs(key) > kCols + vCols) fail(ERR.VALUE);
13080
- const order = table2.map((_, i2) => i2).sort(compareBy(sort2, table2));
13081
- const out = order.map((i2) => table2[i2]);
13269
+ const order = table3.map((_, i2) => i2).sort(compareBy(sort2, table3));
13270
+ const out = order.map((i2) => table3[i2]);
13082
13271
  if (depth !== 0) {
13083
13272
  const total2 = [
13084
13273
  "Total",
@@ -13127,8 +13316,8 @@ function pivotby(args, ctx) {
13127
13316
  const colKeys = /* @__PURE__ */ new Map();
13128
13317
  for (const r of used) {
13129
13318
  for (const [map, key] of [
13130
- [rowKeys, keyOf(rowsM.data[r])],
13131
- [colKeys, keyOf(colsM.data[r])]
13319
+ [rowKeys, keyOf2(rowsM.data[r])],
13320
+ [colKeys, keyOf2(colsM.data[r])]
13132
13321
  ]) {
13133
13322
  const found = map.get(key);
13134
13323
  if (found) found.push(r);
@@ -13861,8 +14050,8 @@ function resolveName(node2, frame) {
13861
14050
  const value2 = evaluateDefinedName(node2.name, sheet, node2.prefix !== void 0, frame);
13862
14051
  if (value2 !== void 0) return value2;
13863
14052
  if (!node2.prefix) {
13864
- const table2 = resolveStructured({ table: node2.name, specials: [] }, frame);
13865
- if (!(isError(table2) && table2.error === "#NAME?")) return table2;
14053
+ const table3 = resolveStructured({ table: node2.name, specials: [] }, frame);
14054
+ if (!(isError(table3) && table3.error === "#NAME?")) return table3;
13866
14055
  }
13867
14056
  return ERR.NAME;
13868
14057
  }
@@ -15720,8 +15909,8 @@ function deleteSheetInFormula(formula, sheetName, tableNames = []) {
15720
15909
  for (const token of tokens) {
15721
15910
  const prefix = token.prefix;
15722
15911
  const onSheet = prefix !== void 0 && prefix.book === void 0 && prefix.sheet2 === void 0 && same2(prefix.sheet, sheetName);
15723
- const table2 = typeof token.value === "string" && tables.has(token.value.toLowerCase()) && (token.kind === "structured" || token.kind === "name" && !prefix);
15724
- if ((token.kind === "ref" || token.kind === "name") && onSheet || table2) {
15912
+ const table3 = typeof token.value === "string" && tables.has(token.value.toLowerCase()) && (token.kind === "structured" || token.kind === "name" && !prefix);
15913
+ if ((token.kind === "ref" || token.kind === "name") && onSheet || table3) {
15725
15914
  token.text = "#REF!";
15726
15915
  changed = true;
15727
15916
  }
@@ -15784,11 +15973,11 @@ function renameTableColumnInFormula(formula, tableName, oldName, newName, inside
15784
15973
  // xlsx/formula/structured-to-a1.ts
15785
15974
  var abs = (row2, col, rowAbs = true) => `$${columnLabel(col)}${rowAbs ? "$" : ""}${row2 + 1}`;
15786
15975
  function a1For(ref, t) {
15787
- const { table: table2 } = t;
15788
- const { start, end } = table2.range;
15976
+ const { table: table3 } = t;
15977
+ const { start, end } = table3.range;
15789
15978
  const index2 = (name) => {
15790
15979
  if (name === void 0) return void 0;
15791
- const i2 = table2.columns.findIndex((c) => c.name.toLowerCase() === name.toLowerCase());
15980
+ const i2 = table3.columns.findIndex((c) => c.name.toLowerCase() === name.toLowerCase());
15792
15981
  return i2 < 0 ? -1 : start.col + i2;
15793
15982
  };
15794
15983
  const c1 = index2(ref.column);
@@ -15796,10 +15985,10 @@ function a1For(ref, t) {
15796
15985
  if (c1 === -1 || c2 === -1) return "#REF!";
15797
15986
  const colLo = c1 ?? start.col;
15798
15987
  const colHi = c2 ?? end.col;
15799
- const headerRow = table2.headerRow ? start.row : void 0;
15800
- const totalsRow = table2.totalsRow ? end.row : void 0;
15801
- const dataLo = start.row + (table2.headerRow ? 1 : 0);
15802
- const dataHi = end.row - (table2.totalsRow ? 1 : 0);
15988
+ const headerRow = table3.headerRow ? start.row : void 0;
15989
+ const totalsRow = table3.totalsRow ? end.row : void 0;
15990
+ const dataLo = start.row + (table3.headerRow ? 1 : 0);
15991
+ const dataHi = end.row - (table3.totalsRow ? 1 : 0);
15803
15992
  const specials = new Set(ref.specials);
15804
15993
  let rowLo;
15805
15994
  let rowHi;
@@ -15923,14 +16112,14 @@ function descendants(root, local, ns) {
15923
16112
  }
15924
16113
 
15925
16114
  // xlsx/slicer/table-filter.ts
15926
- function tableFilterBounds(table2) {
16115
+ function tableFilterBounds(table3) {
15927
16116
  return {
15928
- start: table2.range.start,
15929
- end: { ...table2.range.end, row: table2.range.end.row - (table2.totalsRow ? 1 : 0) }
16117
+ start: table3.range.start,
16118
+ end: { ...table3.range.end, row: table3.range.end.row - (table3.totalsRow ? 1 : 0) }
15930
16119
  };
15931
16120
  }
15932
- function tableAutoFilter(table2) {
15933
- const columns = table2.columns.flatMap(
16121
+ function tableAutoFilter(table3) {
16122
+ const columns = table3.columns.flatMap(
15934
16123
  (column2, offset2) => column2.filter ? [
15935
16124
  {
15936
16125
  offset: offset2,
@@ -15940,12 +16129,12 @@ function tableAutoFilter(table2) {
15940
16129
  ] : []
15941
16130
  );
15942
16131
  if (!columns.length) return void 0;
15943
- return { range: tableFilterBounds(table2), columns };
16132
+ return { range: tableFilterBounds(table3), columns };
15944
16133
  }
15945
- function applyTableFilter(workbook, sheet, table2) {
15946
- if (!table2.headerRow) return;
15947
- const bounds = tableFilterBounds(table2);
15948
- const filter2 = tableAutoFilter(table2);
16134
+ function applyTableFilter(workbook, sheet, table3) {
16135
+ if (!table3.headerRow) return;
16136
+ const bounds = tableFilterBounds(table3);
16137
+ const filter2 = tableAutoFilter(table3);
15949
16138
  for (let row2 = bounds.start.row + 1; row2 <= bounds.end.row; row2++) {
15950
16139
  const visible = !filter2 || rowMatchesFilter(workbook, sheet, row2, filter2);
15951
16140
  setRowFiltered(sheet, row2, !visible, !!filter2);
@@ -17060,9 +17249,9 @@ function slicerTarget(workbook, cache3) {
17060
17249
  const source = cache3.source;
17061
17250
  for (const [sheetIndex2, sheet] of workbook.sheets.entries()) {
17062
17251
  if (source.kind === "table") {
17063
- const table2 = sheet.tables.find((entry) => entry.id === source.tableId);
17064
- const offset2 = table2?.columns.findIndex((column2) => column2.sourceId === source.column) ?? -1;
17065
- if (table2 && offset2 >= 0) return { kind: "table", sheet, sheetIndex: sheetIndex2, table: table2, offset: offset2 };
17252
+ const table3 = sheet.tables.find((entry) => entry.id === source.tableId);
17253
+ const offset2 = table3?.columns.findIndex((column2) => column2.sourceId === source.column) ?? -1;
17254
+ if (table3 && offset2 >= 0) return { kind: "table", sheet, sheetIndex: sheetIndex2, table: table3, offset: offset2 };
17066
17255
  } else {
17067
17256
  const first2 = source.pivots[0];
17068
17257
  const pivot = first2 && sheet.sheetId === first2.tabId ? sheet.pivotTables?.find((entry) => entry.name === first2.name) : void 0;
@@ -17288,12 +17477,12 @@ function rewriteSheetFormulas(sheet, rewrite, formulaCells) {
17288
17477
  }
17289
17478
  {
17290
17479
  const name = sheet.name;
17291
- for (const table2 of sheet.tables)
17292
- for (const [index2, column2] of table2.columns.entries())
17480
+ for (const table3 of sheet.tables)
17481
+ for (const [index2, column2] of table3.columns.entries())
17293
17482
  if (column2.calculatedColumnFormula !== void 0)
17294
17483
  column2.calculatedColumnFormula = safe(rewrite, column2.calculatedColumnFormula, name, {
17295
- row: table2.range.start.row + (table2.headerRow ? 1 : 0),
17296
- col: table2.range.start.col + index2
17484
+ row: table3.range.start.row + (table3.headerRow ? 1 : 0),
17485
+ col: table3.range.start.col + index2
17297
17486
  });
17298
17487
  if (formulaCells) {
17299
17488
  for (const at of formulaCells) {
@@ -17358,14 +17547,14 @@ function tableHeaderAt(sheet, row2, col) {
17358
17547
  );
17359
17548
  }
17360
17549
  function syncTableHeader(ctx, sheet, row2, col, formulaCells) {
17361
- const table2 = tableHeaderAt(sheet, row2, col);
17362
- if (!table2) return;
17363
- const column2 = table2.columns[col - table2.range.start.col];
17550
+ const table3 = tableHeaderAt(sheet, row2, col);
17551
+ if (!table3) return;
17552
+ const column2 = table3.columns[col - table3.range.start.col];
17364
17553
  if (!column2) return;
17365
17554
  const text2 = displayText(ctx.workbook, getCell(sheet, row2, col)).trim();
17366
17555
  if (!text2 || column2.name === text2) return;
17367
17556
  const oldName = column2.name;
17368
- const others = table2.columns.filter((entry) => entry !== column2).map((entry) => entry.name);
17557
+ const others = table3.columns.filter((entry) => entry !== column2).map((entry) => entry.name);
17369
17558
  const newName = uniqueHeaders([...others, text2]).at(-1);
17370
17559
  column2.name = newName;
17371
17560
  if (newName !== text2) writeValue(sheet, row2, col, newName);
@@ -17375,10 +17564,10 @@ function syncTableHeader(ctx, sheet, row2, col, formulaCells) {
17375
17564
  ctx.workbook,
17376
17565
  (formula, formulaSheet, at) => renameTableColumnInFormula(
17377
17566
  formula,
17378
- table2.name,
17567
+ table3.name,
17379
17568
  oldName,
17380
17569
  newName,
17381
- formulaSheet === sheet.name && !!at && rangeContains(table2.range, at)
17570
+ formulaSheet === sheet.name && !!at && rangeContains(table3.range, at)
17382
17571
  ),
17383
17572
  cells
17384
17573
  );
@@ -18502,11 +18691,11 @@ function uniqueColumnName(columns) {
18502
18691
  const taken = new Set(columns.map((c) => c.name.toLowerCase()));
18503
18692
  for (let n = 1; ; n++) if (!taken.has(`column${n}`)) return `Column${n}`;
18504
18693
  }
18505
- function shiftTable(sheet, table2, shift2, moveRange) {
18506
- const old = table2.range;
18694
+ function shiftTable(sheet, table3, shift2, moveRange) {
18695
+ const old = table3.range;
18507
18696
  const range2 = moveRange(old);
18508
18697
  if (!range2) return [];
18509
- const next = { ...table2, range: range2, columns: [...table2.columns] };
18698
+ const next = { ...table3, range: range2, columns: [...table3.columns] };
18510
18699
  const widened = range2.end.col - range2.start.col !== old.end.col - old.start.col;
18511
18700
  if (shift2.axis === "col" && widened) {
18512
18701
  if (shift2.count > 0) {
@@ -18982,8 +19171,8 @@ function cellText(inner2) {
18982
19171
  ).replace(/ /g, " ").trim();
18983
19172
  }
18984
19173
  function parseHtmlTable(html, base) {
18985
- const table2 = /<table\b[^>]*>([\s\S]*?)<\/table>/i.exec(html)?.[1];
18986
- if (table2 === void 0) return void 0;
19174
+ const table3 = /<table\b[^>]*>([\s\S]*?)<\/table>/i.exec(html)?.[1];
19175
+ if (table3 === void 0) return void 0;
18987
19176
  const classes = /* @__PURE__ */ new Map();
18988
19177
  for (const block of html.matchAll(/<style\b[^>]*>([\s\S]*?)<\/style>/gi))
18989
19178
  for (const rule of removeAll(block[1] ?? "", ["<!--", "-->"]).matchAll(
@@ -18996,7 +19185,7 @@ function parseHtmlTable(html, base) {
18996
19185
  const hyperlinks = [];
18997
19186
  let r = 0;
18998
19187
  let spanned = 0;
18999
- for (const tr of table2.matchAll(/<tr\b[^>]*>([\s\S]*?)(?=<tr\b|<\/tbody|<\/table|$)/gi)) {
19188
+ for (const tr of table3.matchAll(/<tr\b[^>]*>([\s\S]*?)(?=<tr\b|<\/tbody|<\/table|$)/gi)) {
19000
19189
  const row2 = grid6[r] ??= [];
19001
19190
  let c = 0;
19002
19191
  for (const td of (tr[1] ?? "").matchAll(
@@ -19848,9 +20037,9 @@ function filterColumn(ctx, s, col, values2) {
19848
20037
  }
19849
20038
  function sortByColumn(ctx, s, col, descending) {
19850
20039
  const sheet = sheetAt(ctx.workbook, s);
19851
- const table2 = sheet.tables.find((t) => col >= t.range.start.col && col <= t.range.end.col);
20040
+ const table3 = sheet.tables.find((t) => col >= t.range.start.col && col <= t.range.end.col);
19852
20041
  const filter2 = sheet.autoFilter;
19853
- const target2 = table2 ? { range: table2.range, header: table2.headerRow, totals: table2.totalsRow } : filter2 && rangeContains(filter2.range, { row: filter2.range.start.row, col }) ? { range: filter2.range, header: true, totals: false } : void 0;
20042
+ const target2 = table3 ? { range: table3.range, header: table3.headerRow, totals: table3.totalsRow } : filter2 && rangeContains(filter2.range, { row: filter2.range.start.row, col }) ? { range: filter2.range, header: true, totals: false } : void 0;
19854
20043
  if (!target2) throw new Error("The column is not inside a table or an auto-filter range.");
19855
20044
  const range2 = target2.totals ? { start: target2.range.start, end: { ...target2.range.end, row: target2.range.end.row - 1 } } : target2.range;
19856
20045
  ctx.run(
@@ -19910,12 +20099,12 @@ function restore(sheet, saved) {
19910
20099
  Object.assign(cell, saved.fields);
19911
20100
  }
19912
20101
  var valueAt = (sheet, row2, col) => getCell(sheet, row2, col)?.value ?? null;
19913
- function computeDataTable(workbook, calc, sheetIndex2, table2) {
20102
+ function computeDataTable(workbook, calc, sheetIndex2, table3) {
19914
20103
  const sheet = sheetAt(workbook, sheetIndex2);
19915
- const { ref } = table2;
19916
- const first2 = parseInputCell(sheet, table2.r1);
19917
- const second = table2.dt2D && table2.r2 ? parseInputCell(sheet, table2.r2) : void 0;
19918
- if (!first2 || table2.dt2D && !second || table2.del1 || table2.del2) return [];
20104
+ const { ref } = table3;
20105
+ const first2 = parseInputCell(sheet, table3.r1);
20106
+ const second = table3.dt2D && table3.r2 ? parseInputCell(sheet, table3.r2) : void 0;
20107
+ if (!first2 || table3.dt2D && !second || table3.del1 || table3.del2) return [];
19919
20108
  const inputs = [first2, ...second ? [second] : []];
19920
20109
  const saved = inputs.map((p) => save(sheet, p.row, p.col));
19921
20110
  const top = ref.start.row - 1;
@@ -19934,11 +20123,11 @@ function computeDataTable(workbook, calc, sheetIndex2, table2) {
19934
20123
  for (let row2 = ref.start.row; row2 <= ref.end.row; row2++) {
19935
20124
  for (let col = ref.start.col; col <= ref.end.col; col++) {
19936
20125
  let formulaAt;
19937
- if (table2.dt2D) {
20126
+ if (table3.dt2D) {
19938
20127
  set(first2, valueAt(sheet, top, col));
19939
20128
  if (second) set(second, valueAt(sheet, row2, left2));
19940
20129
  formulaAt = { row: top, col: left2 };
19941
- } else if (table2.dtr) {
20130
+ } else if (table3.dtr) {
19942
20131
  set(first2, valueAt(sheet, top, col));
19943
20132
  formulaAt = { row: row2, col: left2 };
19944
20133
  } else {
@@ -19963,8 +20152,8 @@ function computeDataTable(workbook, calc, sheetIndex2, table2) {
19963
20152
  function refreshDataTables(workbook, calc) {
19964
20153
  const changed = [];
19965
20154
  workbook.sheets.forEach((sheet, index2) => {
19966
- for (const table2 of sheet.dataTables ?? [])
19967
- changed.push(...computeDataTable(workbook, calc, index2, table2));
20155
+ for (const table3 of sheet.dataTables ?? [])
20156
+ changed.push(...computeDataTable(workbook, calc, index2, table3));
19968
20157
  });
19969
20158
  if (changed.length) calc.recalculateFrom(changed);
19970
20159
  }
@@ -19987,23 +20176,23 @@ function resolve2(sheet, request) {
19987
20176
  const ref = cellRange(range2.start.row + 1, range2.start.col + 1, range2.end.row, range2.end.col);
19988
20177
  if ([row2, col].some((p) => p && rangeContains(ref, p))) return { problem: "input-inside" };
19989
20178
  const name = (p) => formatAddress(p);
19990
- const table2 = { ref, r1: "" };
20179
+ const table3 = { ref, r1: "" };
19991
20180
  if (row2 && col) {
19992
- table2.dt2D = true;
19993
- table2.dtr = true;
19994
- table2.r1 = name(row2);
19995
- table2.r2 = name(col);
20181
+ table3.dt2D = true;
20182
+ table3.dtr = true;
20183
+ table3.r1 = name(row2);
20184
+ table3.r2 = name(col);
19996
20185
  } else if (row2) {
19997
- table2.dtr = true;
19998
- table2.r1 = name(row2);
19999
- } else if (col) table2.r1 = name(col);
20000
- return { table: table2 };
20186
+ table3.dtr = true;
20187
+ table3.r1 = name(row2);
20188
+ } else if (col) table3.r1 = name(col);
20189
+ return { table: table3 };
20001
20190
  }
20002
20191
  function createDataTable(ctx, s, request) {
20003
20192
  const sheet = sheetAt(ctx.workbook, s);
20004
20193
  const result2 = resolve2(sheet, request);
20005
20194
  if ("problem" in result2) throw new Error(MESSAGES[result2.problem]);
20006
- const { table: table2 } = result2;
20195
+ const { table: table3 } = result2;
20007
20196
  const range2 = normalizeRange(request.range);
20008
20197
  ctx.run(
20009
20198
  "Data Table",
@@ -20014,16 +20203,16 @@ function createDataTable(ctx, s, request) {
20014
20203
  ],
20015
20204
  () => {
20016
20205
  sheet.dataTables = (sheet.dataTables ?? []).filter((t) => !rangesIntersect(t.ref, range2));
20017
- sheet.dataTables.push(table2);
20018
- for (let row2 = table2.ref.start.row; row2 <= table2.ref.end.row; row2++)
20019
- for (let col = table2.ref.start.col; col <= table2.ref.end.col; col++) {
20206
+ sheet.dataTables.push(table3);
20207
+ for (let row2 = table3.ref.start.row; row2 <= table3.ref.end.row; row2++)
20208
+ for (let col = table3.ref.start.col; col <= table3.ref.end.col; col++) {
20020
20209
  const cell = ensureCell(sheet, row2, col);
20021
20210
  delete cell.formula;
20022
20211
  delete cell.arrayRange;
20023
20212
  delete cell.legacyFormula;
20024
20213
  delete cell.dynamicArray;
20025
20214
  }
20026
- computeDataTable(ctx.workbook, ctx.calc, s, table2);
20215
+ computeDataTable(ctx.workbook, ctx.calc, s, table3);
20027
20216
  },
20028
20217
  { sheet: s, ranges: [range2] }
20029
20218
  );
@@ -21260,7 +21449,7 @@ function pixelSizeToExtent(width, height) {
21260
21449
  }
21261
21450
 
21262
21451
  // xlsx/pivot/date-axes.ts
21263
- var dateGroupAxisNames = (group) => dateGroupUnits(group).reverse().map((unit) => dateGroupFieldName(unit, group.field));
21452
+ var dateGroupAxisNames = (group) => dateGroupUnits(group).reverse().map((unit) => dateGroupFieldName(unit, group.field, group));
21264
21453
  function replace(list, names, replacement) {
21265
21454
  const at = list.findIndex((name) => names.includes(name));
21266
21455
  if (at < 0) return list;
@@ -21296,7 +21485,9 @@ function reconcileDateAxes(next, previous) {
21296
21485
  if (columns.length > 1) next.moreColumnFields = columns.slice(1);
21297
21486
  else delete next.moreColumnFields;
21298
21487
  if (next.fieldSubtotals) {
21299
- const kept = next.fieldSubtotals.filter((entry) => rows2.includes(entry.field));
21488
+ const kept = next.fieldSubtotals.filter(
21489
+ (entry) => rows2.includes(entry.field) || columns.includes(entry.field)
21490
+ );
21300
21491
  if (kept.length) next.fieldSubtotals = kept;
21301
21492
  else delete next.fieldSubtotals;
21302
21493
  }
@@ -21338,7 +21529,7 @@ function plan(ctx, s, pivot, old) {
21338
21529
  if (![start.row, start.col].every(Number.isInteger) || start.row < 0 || start.col < 0 || location.end.row > MAX_ROW || location.end.col > MAX_COL)
21339
21530
  throw new Error("The PivotTable result does not fit on the worksheet.");
21340
21531
  const source = sparklineDataRange(ctx.workbook, s, pivot.source);
21341
- if (source.sheet === s && rangesIntersect(source.range, location) || sheet.merges.some((range2) => rangesIntersect(range2, location)) || sheet.tables.some((table2) => rangesIntersect(table2.range, location)) || sheet.pivotTables?.some((other) => other !== old && rangesIntersect(other.location, location)))
21532
+ if (source.sheet === s && rangesIntersect(source.range, location) || sheet.merges.some((range2) => rangesIntersect(range2, location)) || sheet.tables.some((table3) => rangesIntersect(table3.range, location)) || sheet.pivotTables?.some((other) => other !== old && rangesIntersect(other.location, location)))
21342
21533
  throw new Error("The PivotTable would overlap source data, another table or merged cells.");
21343
21534
  let occupied = false;
21344
21535
  forEachCellInRange(sheet, location, (cell, row2, col) => {
@@ -21348,12 +21539,12 @@ function plan(ctx, s, pivot, old) {
21348
21539
  if (occupied) throw new Error("The PivotTable would overwrite existing cell content.");
21349
21540
  return { grid: grid6, location };
21350
21541
  }
21351
- function writePivot(ctx, s, pivot, old, label5, inside) {
21542
+ function writePivot(ctx, s, pivot, old, label2, inside) {
21352
21543
  const sheet = sheetAt(ctx.workbook, s);
21353
21544
  const { grid: grid6, location } = plan(ctx, s, pivot, old);
21354
21545
  const ranges = [...old ? [old.location] : [], location];
21355
21546
  ctx.run(
21356
- label5 ?? (old ? "Refresh PivotTable" : "Create PivotTable"),
21547
+ label2 ?? (old ? "Refresh PivotTable" : "Create PivotTable"),
21357
21548
  "annotations",
21358
21549
  [
21359
21550
  { kind: "parts", sheet: s, parts: ["pivotTables"] },
@@ -21410,8 +21601,10 @@ function createPivotTable(ctx, s, destination, options6) {
21410
21601
  const name = options6.name ?? uniqueName(ctx);
21411
21602
  checkName2(ctx, name);
21412
21603
  const aggregate2 = options6.aggregate ?? "sum";
21604
+ const captions = authoredCaptions(options6);
21413
21605
  const pivot = {
21414
21606
  ...data,
21607
+ ...captions ? { captions } : {},
21415
21608
  name,
21416
21609
  rowField: options6.rowField,
21417
21610
  layout: options6.layout ?? "tabular",
@@ -21425,12 +21618,12 @@ function createPivotTable(ctx, s, destination, options6) {
21425
21618
  ...options6.repeatLabels !== void 0 ? { repeatLabels: options6.repeatLabels } : {},
21426
21619
  valueField: options6.valueField,
21427
21620
  aggregate: aggregate2,
21428
- valueCaption: pivotCaption(aggregate2, options6.valueField),
21621
+ valueCaption: pivotCaption(aggregate2, options6.valueField, { captions }),
21429
21622
  ...options6.pageFilter !== void 0 ? { pageFilter: structuredClone(options6.pageFilter) } : {},
21430
21623
  ...options6.fieldGroups?.length ? { fieldGroups: structuredClone(options6.fieldGroups) } : {},
21431
21624
  ...options6.valuesAxis !== void 0 ? { valuesAxis: options6.valuesAxis } : {},
21432
21625
  ...options6.valuesPosition !== void 0 ? { valuesPosition: options6.valuesPosition } : {},
21433
- ...options6.additionalValues ? { additionalValues: normalizedPivotMeasures(options6.additionalValues) } : {},
21626
+ ...options6.additionalValues ? { additionalValues: normalizedPivotMeasures(options6.additionalValues, { captions }) } : {},
21434
21627
  location: { start: { ...destination }, end: { ...destination } },
21435
21628
  ...options6.columnField ? { columnField: options6.columnField } : {},
21436
21629
  ...options6.columnField && options6.moreColumnFields?.length ? { moreColumnFields: [...options6.moreColumnFields] } : {}
@@ -21453,7 +21646,7 @@ function refreshPivotTable(ctx, s, name, patch2 = {}) {
21453
21646
  rowField: patch2.rowField ?? old.rowField,
21454
21647
  valueField,
21455
21648
  aggregate: aggregate2,
21456
- valueCaption: aggregate2 === old.aggregate && valueField === old.valueField ? old.valueCaption : pivotCaption(aggregate2, valueField)
21649
+ valueCaption: aggregate2 === old.aggregate && valueField === old.valueField ? old.valueCaption : pivotCaption(aggregate2, valueField, old)
21457
21650
  };
21458
21651
  if (patch2.columnField !== void 0) {
21459
21652
  if (patch2.columnField) next.columnField = patch2.columnField;
@@ -21503,7 +21696,7 @@ function refreshPivotTable(ctx, s, name, patch2 = {}) {
21503
21696
  else if (patch2.valuesAxis === "columns" || patch2.secondRowField === "")
21504
21697
  delete next.valuesPosition;
21505
21698
  if (patch2.additionalValues !== void 0) {
21506
- const measures = normalizedPivotMeasures(patch2.additionalValues);
21699
+ const measures = normalizedPivotMeasures(patch2.additionalValues, old);
21507
21700
  if (measures.length) next.additionalValues = measures;
21508
21701
  else delete next.additionalValues;
21509
21702
  }
@@ -21512,6 +21705,12 @@ function refreshPivotTable(ctx, s, name, patch2 = {}) {
21512
21705
  else delete next.dateFields;
21513
21706
  roundDateRecords(next, dates, ctx.workbook.date1904);
21514
21707
  if (next.dateFilter && !dates.includes(next.dateFilter.field)) delete next.dateFilter;
21708
+ if (patch2.fieldSubtotals === void 0 && next.fieldSubtotals) {
21709
+ const onAxes = [...pivotRowFields(next), ...pivotColumnFields(next)];
21710
+ const left2 = next.fieldSubtotals.filter((entry) => onAxes.includes(entry.field));
21711
+ if (left2.length) next.fieldSubtotals = left2;
21712
+ else delete next.fieldSubtotals;
21713
+ }
21515
21714
  const kept = pruneItemFilters(next);
21516
21715
  if (kept) next.itemFilters = kept;
21517
21716
  else delete next.itemFilters;
@@ -21967,10 +22166,10 @@ function validatePatch(group, patch2) {
21967
22166
  delete next.manualMax;
21968
22167
  validateSettings(next);
21969
22168
  }
21970
- function save2(ctx, s, next, label5, ranges) {
22169
+ function save2(ctx, s, next, label2, ranges) {
21971
22170
  const sheet = sheetAt(ctx.workbook, s);
21972
22171
  ctx.run(
21973
- label5,
22172
+ label2,
21974
22173
  "annotations",
21975
22174
  [{ kind: "parts", sheet: s, parts: ["preserved"] }],
21976
22175
  () => sheet.preserved.set("extLst", next),
@@ -22088,20 +22287,20 @@ function setSlicerSelection(ctx, cacheName, keys) {
22088
22287
  const target2 = slicerTarget(ctx.workbook, cache3);
22089
22288
  if (!target2) throw new Error("The slicer has no data source.");
22090
22289
  if (target2.kind === "table") {
22091
- const { sheet, table: table2, offset: offset2 } = target2;
22290
+ const { sheet, table: table3, offset: offset2 } = target2;
22092
22291
  ctx.run(
22093
22292
  keys === null ? "Clear slicer filter" : "Filter slicer",
22094
22293
  "view",
22095
22294
  [{ kind: "sheet", sheet: target2.sheetIndex }],
22096
22295
  () => {
22097
- const column2 = table2.columns[offset2];
22296
+ const column2 = table3.columns[offset2];
22098
22297
  if (keys === null) delete column2.filter;
22099
22298
  else
22100
22299
  column2.filter = {
22101
22300
  values: keys.filter((key) => key !== ""),
22102
22301
  ...keys.includes("") ? { blank: true } : {}
22103
22302
  };
22104
- applyTableFilter(ctx.workbook, sheet, table2);
22303
+ applyTableFilter(ctx.workbook, sheet, table3);
22105
22304
  },
22106
22305
  { sheet: target2.sheetIndex, structural: true }
22107
22306
  );
@@ -22172,17 +22371,17 @@ function unique2(base, taken) {
22172
22371
  function insertSlicer(ctx, s, ref) {
22173
22372
  const { workbook } = ctx;
22174
22373
  const sheet = sheetAt(workbook, s);
22175
- let table2;
22374
+ let table3;
22176
22375
  let pivot;
22177
22376
  let field;
22178
22377
  if (ref.kind === "table") {
22179
- table2 = sheet.tables.find(
22378
+ table3 = sheet.tables.find(
22180
22379
  (entry) => entry.name === ref.table || entry.displayName === ref.table
22181
22380
  );
22182
- if (!table2?.headerRow || table2.filterNotModeled)
22381
+ if (!table3?.headerRow || table3.filterNotModeled)
22183
22382
  throw new Error("Choose a table with a header row and value filters.");
22184
22383
  field = ref.column;
22185
- if (!table2.columns.some((column2) => column2.name === field))
22384
+ if (!table3.columns.some((column2) => column2.name === field))
22186
22385
  throw new Error("Choose a column of the table.");
22187
22386
  } else {
22188
22387
  pivot = sheet.pivotTables?.find((entry) => entry.name === ref.pivot);
@@ -22202,7 +22401,7 @@ function insertSlicer(ctx, s, ref) {
22202
22401
  (c) => names.has(c.toLowerCase())
22203
22402
  ).replace(/ /g, "_");
22204
22403
  const metrics = createGridMetrics(sheet, { zoom: 100 });
22205
- const anchorCell = table2 ? { row: table2.range.start.row, col: table2.range.end.col + 2 } : { row: pivot.location.start.row, col: pivot.location.end.col + 2 };
22404
+ const anchorCell = table3 ? { row: table3.range.start.row, col: table3.range.end.col + 2 } : { row: pivot.location.start.row, col: pivot.location.end.col + 2 };
22206
22405
  const x = Math.max(metrics.colLeft(anchorCell.col), frameBounds(sheet) + 10);
22207
22406
  const box2 = { x, y: metrics.rowTop(anchorCell.row), ...SLICER_BOX };
22208
22407
  const anchor = pixelBoxToAnchor(sheet, box2, metrics, "twoCell");
@@ -22219,13 +22418,13 @@ function insertSlicer(ctx, s, ref) {
22219
22418
  () => {
22220
22419
  const book = cloneBook(workbook);
22221
22420
  let source;
22222
- if (table2) {
22223
- if (table2.columns.some((column2) => column2.sourceId === void 0))
22224
- table2.columns.forEach((column2, index2) => column2.sourceId ??= index2 + 1);
22421
+ if (table3) {
22422
+ if (table3.columns.some((column2) => column2.sourceId === void 0))
22423
+ table3.columns.forEach((column2, index2) => column2.sourceId ??= index2 + 1);
22225
22424
  source = {
22226
22425
  kind: "table",
22227
- tableId: table2.id,
22228
- column: table2.columns.find((column2) => column2.name === field).sourceId
22426
+ tableId: table3.id,
22427
+ column: table3.columns.find((column2) => column2.name === field).sourceId
22229
22428
  };
22230
22429
  } else {
22231
22430
  const target2 = pivot;
@@ -22489,9 +22688,9 @@ var SUBTOTAL = {
22489
22688
  var: 110
22490
22689
  };
22491
22690
  var escapeColumn = (name) => name.replace(/['#[\]]/g, "'$&");
22492
- function applyTotalsRow(sheet, table2) {
22493
- const row2 = table2.range.end.row;
22494
- const { columns } = table2;
22691
+ function applyTotalsRow(sheet, table3) {
22692
+ const row2 = table3.range.end.row;
22693
+ const { columns } = table3;
22495
22694
  if (!columns.some((c) => c.totalsRowFunction || c.totalsRowLabel)) {
22496
22695
  const first2 = columns[0];
22497
22696
  const last = columns[columns.length - 1];
@@ -22499,12 +22698,12 @@ function applyTotalsRow(sheet, table2) {
22499
22698
  if (last) last.totalsRowFunction = "sum";
22500
22699
  }
22501
22700
  columns.forEach((column2, i2) => {
22502
- const col = table2.range.start.col + i2;
22701
+ const col = table3.range.start.col + i2;
22503
22702
  const code = SUBTOTAL[column2.totalsRowFunction ?? ""];
22504
22703
  if (code !== void 0) {
22505
22704
  const cell = ensureCell(sheet, row2, col);
22506
22705
  clearContents(cell);
22507
- cell.formula = `SUBTOTAL(${code},${table2.name}[${escapeColumn(column2.name)}])`;
22706
+ cell.formula = `SUBTOTAL(${code},${table3.name}[${escapeColumn(column2.name)}])`;
22508
22707
  } else if (column2.totalsRowLabel && column2.totalsRowFunction !== "custom")
22509
22708
  writeValue(sheet, row2, col, column2.totalsRowLabel);
22510
22709
  });
@@ -22528,8 +22727,8 @@ function validateTableName(workbook, name, self) {
22528
22727
  ) || workbook.definedNames.some((n) => n.name.toLowerCase() === lower3);
22529
22728
  return taken ? "That name is already used by another table or name." : void 0;
22530
22729
  }
22531
- function renameTableIn(workbook, table2, name) {
22532
- const old = table2.name;
22730
+ function renameTableIn(workbook, table3, name) {
22731
+ const old = table3.name;
22533
22732
  if (old === name) return;
22534
22733
  const rename = (f6) => renameTableInFormula(f6, old, name);
22535
22734
  rewriteFormulas(workbook, rename);
@@ -22538,73 +22737,73 @@ function renameTableIn(workbook, table2, name) {
22538
22737
  for (const column2 of t.columns)
22539
22738
  if (column2.calculatedColumnFormula)
22540
22739
  column2.calculatedColumnFormula = rename(column2.calculatedColumnFormula);
22541
- table2.name = name;
22542
- table2.displayName = name;
22740
+ table3.name = name;
22741
+ table3.displayName = name;
22543
22742
  }
22544
22743
  var byId = (sheet, id) => {
22545
- const table2 = sheet.tables.find((t) => t.id === id);
22546
- if (!table2) throw new Error("The table disappeared during the edit.");
22547
- return table2;
22744
+ const table3 = sheet.tables.find((t) => t.id === id);
22745
+ if (!table3) throw new Error("The table disappeared during the edit.");
22746
+ return table3;
22548
22747
  };
22549
- function insertBandRow(workbook, sheet, table2, row2) {
22748
+ function insertBandRow(workbook, sheet, table3, row2) {
22550
22749
  const shift2 = { axis: "row", at: row2, count: 1 };
22551
- const band = { lo: table2.range.start.col, hi: table2.range.end.col };
22750
+ const band = { lo: table3.range.start.col, hi: table3.range.end.col };
22552
22751
  assertInsertFits(sheet, shift2, band);
22553
22752
  rewriteFormulas(workbook, (f6, fs) => shiftFormulaInBand(f6, fs, sheet.name, shift2, band));
22554
22753
  shiftSheetContent(sheet, shift2, band);
22555
22754
  }
22556
22755
  function setHeaderRow(workbook, sheet, id, on) {
22557
- let table2 = byId(sheet, id);
22558
- if (table2.headerRow === on) return;
22559
- const { start, end } = table2.range;
22756
+ let table3 = byId(sheet, id);
22757
+ if (table3.headerRow === on) return;
22758
+ const { start, end } = table3.range;
22560
22759
  if (!on) {
22561
22760
  if (start.row === end.row) throw new Error("A table needs at least one row.");
22562
22761
  clearRow(sheet, start.row, start.col, end.col);
22563
- table2.range = { start: { row: start.row + 1, col: start.col }, end };
22564
- table2.headerRow = false;
22762
+ table3.range = { start: { row: start.row + 1, col: start.col }, end };
22763
+ table3.headerRow = false;
22565
22764
  return;
22566
22765
  }
22567
22766
  if (start.row === 0 || !rowIsEmpty(sheet, start.row - 1, start.col, end.col)) {
22568
- insertBandRow(workbook, sheet, table2, start.row);
22569
- table2 = byId(sheet, id);
22570
- }
22571
- const top = table2.range.start.row - 1;
22572
- const left2 = table2.range.start.col;
22573
- table2.range = { start: { row: top, col: left2 }, end: table2.range.end };
22574
- table2.headerRow = true;
22575
- uniqueHeaders(table2.columns.map((c) => c.name)).forEach((name, i2) => {
22576
- const column2 = table2.columns[i2];
22767
+ insertBandRow(workbook, sheet, table3, start.row);
22768
+ table3 = byId(sheet, id);
22769
+ }
22770
+ const top = table3.range.start.row - 1;
22771
+ const left2 = table3.range.start.col;
22772
+ table3.range = { start: { row: top, col: left2 }, end: table3.range.end };
22773
+ table3.headerRow = true;
22774
+ uniqueHeaders(table3.columns.map((c) => c.name)).forEach((name, i2) => {
22775
+ const column2 = table3.columns[i2];
22577
22776
  if (column2) column2.name = name;
22578
22777
  writeValue(sheet, top, left2 + i2, name);
22579
22778
  });
22580
22779
  }
22581
22780
  function setTotalsRow(workbook, sheet, id, on) {
22582
- let table2 = byId(sheet, id);
22583
- if (table2.totalsRow === on) return;
22584
- const { start, end } = table2.range;
22781
+ let table3 = byId(sheet, id);
22782
+ if (table3.totalsRow === on) return;
22783
+ const { start, end } = table3.range;
22585
22784
  if (!on) {
22586
22785
  clearRow(sheet, end.row, start.col, end.col);
22587
- table2.range = { start, end: { row: end.row - 1, col: end.col } };
22588
- table2.totalsRow = false;
22786
+ table3.range = { start, end: { row: end.row - 1, col: end.col } };
22787
+ table3.totalsRow = false;
22589
22788
  return;
22590
22789
  }
22591
22790
  if (end.row === MAX_ROW) throw new RangeError("The insert area extends beyond the sheet.");
22592
22791
  if (!rowIsEmpty(sheet, end.row + 1, start.col, end.col)) {
22593
- insertBandRow(workbook, sheet, table2, end.row + 1);
22594
- table2 = byId(sheet, id);
22792
+ insertBandRow(workbook, sheet, table3, end.row + 1);
22793
+ table3 = byId(sheet, id);
22595
22794
  }
22596
- table2.range = { start: table2.range.start, end: { row: table2.range.end.row + 1, col: end.col } };
22597
- table2.totalsRow = true;
22598
- applyTotalsRow(sheet, table2);
22795
+ table3.range = { start: table3.range.start, end: { row: table3.range.end.row + 1, col: end.col } };
22796
+ table3.totalsRow = true;
22797
+ applyTotalsRow(sheet, table3);
22599
22798
  }
22600
- function resizedColumns(workbook, sheet, table2, range2) {
22799
+ function resizedColumns(workbook, sheet, table3, range2) {
22601
22800
  const width = range2.end.col - range2.start.col + 1;
22602
- const oldAt = (col) => col >= table2.range.start.col && col <= table2.range.end.col ? table2.columns[col - table2.range.start.col] : void 0;
22801
+ const oldAt = (col) => col >= table3.range.start.col && col <= table3.range.end.col ? table3.columns[col - table3.range.start.col] : void 0;
22603
22802
  const texts = Array.from({ length: width }, (_v, i2) => {
22604
22803
  const col = range2.start.col + i2;
22605
22804
  const old = oldAt(col);
22606
22805
  if (old) return old.name;
22607
- return table2.headerRow ? displayText(workbook, getCell(sheet, range2.start.row, col)) : "";
22806
+ return table3.headerRow ? displayText(workbook, getCell(sheet, range2.start.row, col)) : "";
22608
22807
  });
22609
22808
  return uniqueHeaders(texts).map((name, i2) => {
22610
22809
  const old = oldAt(range2.start.col + i2);
@@ -22612,30 +22811,30 @@ function resizedColumns(workbook, sheet, table2, range2) {
22612
22811
  });
22613
22812
  }
22614
22813
  function resizeTableIn(workbook, sheet, id, range2) {
22615
- const table2 = byId(sheet, id);
22814
+ const table3 = byId(sheet, id);
22616
22815
  const r = normalizeRange(range2);
22617
- if (table2.headerRow && r.start.row !== table2.range.start.row)
22816
+ if (table3.headerRow && r.start.row !== table3.range.start.row)
22618
22817
  throw new Error("The table headers must remain in the same row.");
22619
- if (!rangesIntersect(r, table2.range)) throw new Error("The new range must overlap the table.");
22620
- if (r.end.row - r.start.row + 1 < (table2.headerRow ? 2 : 1) + (table2.totalsRow ? 1 : 0))
22818
+ if (!rangesIntersect(r, table3.range)) throw new Error("The new range must overlap the table.");
22819
+ if (r.end.row - r.start.row + 1 < (table3.headerRow ? 2 : 1) + (table3.totalsRow ? 1 : 0))
22621
22820
  throw new Error("The table range is too small.");
22622
- if (sheet.tables.some((t) => t !== table2 && rangesIntersect(t.range, r)))
22821
+ if (sheet.tables.some((t) => t !== table3 && rangesIntersect(t.range, r)))
22623
22822
  throw new Error("A table cannot overlap another table.");
22624
22823
  if (sheet.pivotTables?.some((pivot) => rangesIntersect(pivot.location, r)))
22625
22824
  throw new Error("A table cannot overlap a PivotTable.");
22626
22825
  if (sheet.merges.some((m) => rangesIntersect(m, r)))
22627
22826
  throw new Error("A table cannot contain merged cells.");
22628
- const oldEnd = table2.range.end.row;
22629
- table2.columns = resizedColumns(workbook, sheet, table2, r);
22630
- table2.range = r;
22631
- if (table2.headerRow)
22632
- table2.columns.forEach((column2, i2) => {
22827
+ const oldEnd = table3.range.end.row;
22828
+ table3.columns = resizedColumns(workbook, sheet, table3, r);
22829
+ table3.range = r;
22830
+ if (table3.headerRow)
22831
+ table3.columns.forEach((column2, i2) => {
22633
22832
  const cell = getCell(sheet, r.start.row, r.start.col + i2);
22634
22833
  if (cell?.value !== column2.name) writeValue(sheet, r.start.row, r.start.col + i2, column2.name);
22635
22834
  });
22636
- if (table2.totalsRow) {
22835
+ if (table3.totalsRow) {
22637
22836
  if (oldEnd !== r.end.row) clearRow(sheet, oldEnd, r.start.col, r.end.col);
22638
- applyTotalsRow(sheet, table2);
22837
+ applyTotalsRow(sheet, table3);
22639
22838
  }
22640
22839
  }
22641
22840
  var STYLE_KEYS = [
@@ -22663,20 +22862,20 @@ function updateTable(ctx, s, ref, patch2) {
22663
22862
  "structure",
22664
22863
  [scope],
22665
22864
  () => {
22666
- const table2 = byId(sheet, id);
22667
- if (renaming) renameTableIn(workbook, table2, name);
22865
+ const table3 = byId(sheet, id);
22866
+ if (renaming) renameTableIn(workbook, table3, name);
22668
22867
  for (const key of STYLE_KEYS) {
22669
22868
  if (!(key in patch2)) continue;
22670
22869
  const value2 = patch2[key];
22671
- if (value2 === void 0) delete table2[key];
22672
- else table2[key] = value2;
22870
+ if (value2 === void 0) delete table3[key];
22871
+ else table3[key] = value2;
22673
22872
  }
22674
22873
  if (patch2.columns) {
22675
- const width = table2.range.end.col - table2.range.start.col + 1;
22874
+ const width = table3.range.end.col - table3.range.start.col + 1;
22676
22875
  if (patch2.columns.length !== width) throw new Error("Give one column per table column.");
22677
- const before = table2.columns;
22678
- table2.columns = structuredClone(patch2.columns);
22679
- for (const [index2, column2] of table2.columns.entries()) {
22876
+ const before = table3.columns;
22877
+ table3.columns = structuredClone(patch2.columns);
22878
+ for (const [index2, column2] of table3.columns.entries()) {
22680
22879
  const sourceId = before[index2]?.sourceId;
22681
22880
  if (column2.sourceId === void 0 && sourceId !== void 0) column2.sourceId = sourceId;
22682
22881
  const filter2 = before[index2]?.filter;
@@ -22685,7 +22884,7 @@ function updateTable(ctx, s, ref, patch2) {
22685
22884
  }
22686
22885
  if (patch2.headerRow !== void 0) setHeaderRow(workbook, sheet, id, patch2.headerRow);
22687
22886
  if (patch2.totalsRow !== void 0) setTotalsRow(workbook, sheet, id, patch2.totalsRow);
22688
- else if (patch2.columns && table2.totalsRow) applyTotalsRow(sheet, byId(sheet, id));
22887
+ else if (patch2.columns && table3.totalsRow) applyTotalsRow(sheet, byId(sheet, id));
22689
22888
  if (patch2.range) resizeTableIn(workbook, sheet, id, patch2.range);
22690
22889
  },
22691
22890
  { sheet: s, ranges: [current.range], structural: true }
@@ -22705,13 +22904,13 @@ function resizeTable(ctx, s, ref, range2) {
22705
22904
  function convertTableToRange(ctx, s, ref) {
22706
22905
  const { workbook } = ctx;
22707
22906
  const sheet = sheetAt(workbook, s);
22708
- const table2 = sheet.tables[tableIndex(sheet, ref)];
22907
+ const table3 = sheet.tables[tableIndex(sheet, ref)];
22709
22908
  ctx.run(
22710
22909
  "Convert to range",
22711
22910
  "structure",
22712
22911
  [{ kind: "workbook" }],
22713
22912
  () => {
22714
- const live = byId(sheet, table2.id);
22913
+ const live = byId(sheet, table3.id);
22715
22914
  const base = { table: live, tableSheet: sheet.name };
22716
22915
  const { start, end } = live.range;
22717
22916
  for (const ws of workbook.sheets)
@@ -22736,7 +22935,7 @@ function convertTableToRange(ctx, s, ref) {
22736
22935
  });
22737
22936
  sheet.tables = sheet.tables.filter((t) => t.id !== live.id);
22738
22937
  },
22739
- { sheet: s, ranges: [table2.range], structural: true }
22938
+ { sheet: s, ranges: [table3.range], structural: true }
22740
22939
  );
22741
22940
  }
22742
22941
 
@@ -25652,7 +25851,7 @@ function createTable(ctx, s, range2, hasHeader, styleName = "TableStyleMedium2")
25652
25851
  });
25653
25852
  const name = nextTableName(workbook);
25654
25853
  const id = Math.max(0, ...workbook.sheets.flatMap((ws) => ws.tables.map((t) => t.id))) + 1;
25655
- const table2 = {
25854
+ const table3 = {
25656
25855
  id,
25657
25856
  name,
25658
25857
  displayName: name,
@@ -25666,8 +25865,8 @@ function createTable(ctx, s, range2, hasHeader, styleName = "TableStyleMedium2")
25666
25865
  showFirstColumn: false,
25667
25866
  showLastColumn: false
25668
25867
  };
25669
- sheet.tables.push(table2);
25670
- return table2;
25868
+ sheet.tables.push(table3);
25869
+ return table3;
25671
25870
  },
25672
25871
  { sheet: s, ranges: [r], structural: !hasHeader }
25673
25872
  );
@@ -25871,8 +26070,8 @@ function createEditSession(workbook, options6 = {}) {
25871
26070
  if (!workbook.warnings.includes(message)) workbook.warnings.push(message);
25872
26071
  }
25873
26072
  };
25874
- const begin = (label5, kind, info) => {
25875
- const step = { label: label5, entries: [], structural: info.structural ?? false };
26073
+ const begin = (label2, kind, info) => {
26074
+ const step = { label: label2, entries: [], structural: info.structural ?? false };
25876
26075
  if (info.calc) step.calc = info.calc;
25877
26076
  return { step, kind, sheet: info.sheet, ranges: [...info.ranges ?? []] };
25878
26077
  };
@@ -25896,7 +26095,7 @@ function createEditSession(workbook, options6 = {}) {
25896
26095
  }
25897
26096
  current.step.entries.length = from;
25898
26097
  };
25899
- const run = (label5, kind, scopes, fn, info = {}) => {
26098
+ const run = (label2, kind, scopes, fn, info = {}) => {
25900
26099
  if (kind === "cells") {
25901
26100
  for (const scope of scopes)
25902
26101
  if (scope.kind === "cells" && workbook.sheets[scope.sheet]?.pivotTables?.some(
@@ -25913,7 +26112,7 @@ function createEditSession(workbook, options6 = {}) {
25913
26112
  }))
25914
26113
  throw new Error(DATA_TABLE_PART_ERROR);
25915
26114
  const outer = !open;
25916
- const current = open ?? begin(label5, kind, info);
26115
+ const current = open ?? begin(label2, kind, info);
25917
26116
  if (!outer) {
25918
26117
  delete current.step.calc;
25919
26118
  if (info.structural) current.step.structural = true;
@@ -26044,9 +26243,9 @@ function createEditSession(workbook, options6 = {}) {
26044
26243
  removeConditionalFormat: (s, index2) => removeConditionalFormat(ctx, s, index2),
26045
26244
  setConditionalRulePriority: (s, f6, r, priority) => setConditionalRulePriority(ctx, s, f6, r, priority),
26046
26245
  moveConditionalRule: (s, f6, r, direction) => moveConditionalRule(ctx, s, f6, r, direction),
26047
- updateTable: (s, table2, patch2) => updateTable(ctx, s, table2, patch2),
26048
- resizeTable: (s, table2, range2) => resizeTable(ctx, s, table2, range2),
26049
- convertTableToRange: (s, table2) => convertTableToRange(ctx, s, table2),
26246
+ updateTable: (s, table3, patch2) => updateTable(ctx, s, table3, patch2),
26247
+ resizeTable: (s, table3, range2) => resizeTable(ctx, s, table3, range2),
26248
+ convertTableToRange: (s, table3) => convertTableToRange(ctx, s, table3),
26050
26249
  applyCellStyle: (s, ranges, name) => applyCellStyle(ctx, s, ranges, name),
26051
26250
  setPageSetup: (s, patch2) => setPageSetup(ctx, s, patch2),
26052
26251
  setPageBreak: (s, axis, before, present) => setPageBreak(ctx, s, axis, before, present),
@@ -26083,12 +26282,12 @@ function createEditSession(workbook, options6 = {}) {
26083
26282
  validate: (s, r, c, value2) => validateCellInput(workbook, s, r, c, value2, {
26084
26283
  evaluate: (formula, at) => calc.evaluate(formula, at)
26085
26284
  }),
26086
- batch(label5, fn) {
26285
+ batch(label2, fn) {
26087
26286
  if (open) {
26088
26287
  fn();
26089
26288
  return;
26090
26289
  }
26091
- const current = begin(label5, "batch", {});
26290
+ const current = begin(label2, "batch", {});
26092
26291
  open = current;
26093
26292
  try {
26094
26293
  fn();
@@ -27059,9 +27258,9 @@ function pickColor(arg) {
27059
27258
  if (arg && typeof arg === "object" && !arg.auto) return arg;
27060
27259
  return null;
27061
27260
  }
27062
- var toggle = (id, label5, glyph, shortcut, read, patch2) => editing({
27261
+ var toggle = (id, label2, glyph, shortcut, read, patch2) => editing({
27063
27262
  id,
27064
- label: label5,
27263
+ label: label2,
27065
27264
  icon: icon(glyph),
27066
27265
  shortcut,
27067
27266
  lock: "formatCells",
@@ -27246,10 +27445,10 @@ var mergedAtActive = (ctx) => {
27246
27445
  const t = target(ctx);
27247
27446
  return !!t && t.ws.merges.some((m) => rangesIntersect(m, t.range));
27248
27447
  };
27249
- function mergeCommand(id, label5, mode) {
27448
+ function mergeCommand(id, label2, mode) {
27250
27449
  return editing({
27251
27450
  id,
27252
- label: label5,
27451
+ label: label2,
27253
27452
  icon: icon("mergeCenter"),
27254
27453
  lock: "formatCells",
27255
27454
  ...mode === "center" ? { checked: mergedAtActive } : {},
@@ -27264,30 +27463,30 @@ function mergeCommand(id, label5, mode) {
27264
27463
  }
27265
27464
  if (t.ranges.some((range2) => mergeWouldDiscard(t.ws, range2, mode))) {
27266
27465
  const ok = await ctx.dialogs.open("confirm", {
27267
- heading: label5,
27466
+ heading: label2,
27268
27467
  message: "Merging cells only keeps the upper-left value and discards other values."
27269
27468
  });
27270
27469
  if (ok !== true) return;
27271
27470
  if (ctx.session() !== t.session || ctx.readOnly()) return;
27272
27471
  }
27273
- t.session.batch(label5, () => {
27472
+ t.session.batch(label2, () => {
27274
27473
  for (const range2 of t.ranges) t.session.merge(t.sheet, range2, mode);
27275
27474
  });
27276
27475
  }
27277
27476
  });
27278
27477
  }
27279
27478
  function alignmentCommands() {
27280
- const valign = (id, label5, value2, glyph) => editing({
27479
+ const valign = (id, label2, value2, glyph) => editing({
27281
27480
  id,
27282
- label: label5,
27481
+ label: label2,
27283
27482
  icon: icon(glyph),
27284
27483
  lock: "formatCells",
27285
27484
  checked: (ctx) => vertical(ctx) === value2,
27286
27485
  run: (ctx) => style(ctx, { alignment: { vertical: value2 === "bottom" ? UNSET : value2 } })
27287
27486
  });
27288
- const halign = (id, label5, value2, glyph) => editing({
27487
+ const halign = (id, label2, value2, glyph) => editing({
27289
27488
  id,
27290
- label: label5,
27489
+ label: label2,
27291
27490
  icon: icon(glyph),
27292
27491
  lock: "formatCells",
27293
27492
  checked: (ctx) => horizontal(ctx) === value2,
@@ -27369,322 +27568,6 @@ function alignmentCommands() {
27369
27568
  ];
27370
27569
  }
27371
27570
 
27372
- // i18n/locale.ts
27373
- var DEFAULT_REJECTED_SUBTAGS = ["hant", "tw", "hk", "mo"];
27374
- function normalizeLocale(input, supported, fallback, options6 = {}) {
27375
- const parts = (input ?? "").trim().toLowerCase().split(/[-_]/).filter(Boolean);
27376
- const language = parts[0];
27377
- if (!language) return fallback;
27378
- const find3 = (tag) => supported.find((item) => item.toLowerCase() === tag);
27379
- const exact = find3(parts.join("-"));
27380
- if (exact) return exact;
27381
- const base = find3(language);
27382
- if (base) return base;
27383
- const rejected = options6.rejectedSubtags ?? DEFAULT_REJECTED_SUBTAGS;
27384
- if (parts.slice(1).some((part) => rejected.includes(part))) return fallback;
27385
- return supported.find((item) => item.toLowerCase().split("-")[0] === language && item.includes("-")) ?? fallback;
27386
- }
27387
-
27388
- // i18n/dictionary.ts
27389
- function mergeMessageModules(modules) {
27390
- const merged = {};
27391
- for (const path of Object.keys(modules).sort()) {
27392
- const module = modules[path];
27393
- if (!module) continue;
27394
- for (const value2 of Object.values(module)) {
27395
- if (!value2 || typeof value2 !== "object" || Array.isArray(value2)) continue;
27396
- const entries = Object.entries(value2);
27397
- if (!entries.every(([, text2]) => typeof text2 === "string")) continue;
27398
- for (const [key, text2] of entries) merged[key] = text2;
27399
- }
27400
- }
27401
- return merged;
27402
- }
27403
-
27404
- // i18n/translator.ts
27405
- var SINGLE2 = /\{(\w+)\}/g;
27406
- var DOUBLE = /\{\{\s*(\w+)\s*\}\}/g;
27407
- function interpolate(template, params, placeholder = "single") {
27408
- if (!params) return template;
27409
- const pattern = placeholder === "double" ? DOUBLE : SINGLE2;
27410
- return template.replace(
27411
- pattern,
27412
- (match2, name) => Object.prototype.hasOwnProperty.call(params, name) && params[name] !== void 0 ? String(params[name]) : match2
27413
- );
27414
- }
27415
- function createTranslator(messages, fallbacks = [], options6 = {}) {
27416
- const placeholder = options6.placeholder ?? "single";
27417
- return (key, params) => {
27418
- let text2 = messages?.[key];
27419
- for (let i2 = 0; text2 === void 0 && i2 < fallbacks.length; i2++) text2 = fallbacks[i2]?.[key];
27420
- return interpolate(text2 ?? options6.missing?.(key) ?? key, params, placeholder);
27421
- };
27422
- }
27423
-
27424
- // i18n/option-strings.ts
27425
- var enOptionStrings = {
27426
- General: "General",
27427
- Display: "Display",
27428
- Formulas: "Formulas",
27429
- Data: "Data",
27430
- Proofing: "Proofing",
27431
- Save: "Save",
27432
- Language: "Language",
27433
- Accessibility: "Accessibility",
27434
- Advanced: "Advanced",
27435
- "Customize Ribbon": "Customize Ribbon",
27436
- "Quick Access Toolbar": "Quick Access Toolbar",
27437
- "Add-ins": "Add-ins",
27438
- "Trust Center": "Trust Center",
27439
- OK: "OK",
27440
- Cancel: "Cancel",
27441
- Close: "Close",
27442
- Categories: "Categories",
27443
- "Reset all options": "Reset all options",
27444
- "General options for working with {product}.": "General options for working with {product}.",
27445
- "Change how {product} corrects and formats your text.": "Change how {product} corrects and formats your text.",
27446
- "Customize how documents are saved.": "Customize how documents are saved.",
27447
- "Set the Office Language Preferences.": "Set the Office Language Preferences.",
27448
- "Make {product} easier to work with.": "Make {product} easier to work with.",
27449
- "Advanced options for working with {product}.": "Advanced options for working with {product}.",
27450
- "Customize the Ribbon and keyboard shortcuts.": "Customize the Ribbon and keyboard shortcuts.",
27451
- "Customize the Quick Access Toolbar.": "Customize the Quick Access Toolbar.",
27452
- "View and manage Microsoft Office Add-ins.": "View and manage Microsoft Office Add-ins.",
27453
- "Help keep your documents safe and your computer secure and healthy.": "Help keep your documents safe and your computer secure and healthy.",
27454
- "User Interface options": "User Interface options",
27455
- "Show Mini Toolbar on selection": "Show Mini Toolbar on selection",
27456
- "Enable Live Preview": "Enable Live Preview",
27457
- "ScreenTip style": "ScreenTip style",
27458
- "Show feature descriptions in ScreenTips": "Show feature descriptions in ScreenTips",
27459
- "Personalize your copy of Microsoft Office": "Personalize your copy of Microsoft Office",
27460
- "User name": "User name",
27461
- "Office Theme": "Office Theme",
27462
- "Office display language": "Office display language",
27463
- "Choose the language for menus, buttons and messages.": "Choose the language for menus, buttons and messages.",
27464
- "Not available yet. Needs rich text formatting.": "Not available yet. Needs rich text formatting.",
27465
- "Not available yet. Styles are applied on click; hover previews are not drawn yet.": "Not available yet. Styles are applied on click; hover previews are not drawn yet.",
27466
- "Not available yet. ScreenTips always describe the command.": "Not available yet. ScreenTips always describe the command.",
27467
- "Not available yet. Documents are saved to this device; AutoRecover is not kept.": "Not available yet. Documents are saved to this device; AutoRecover is not kept.",
27468
- "Not available yet. There are no accessibility settings to change.": "Not available yet. There are no accessibility settings to change.",
27469
- "Not available yet. The editing behaviour is fixed.": "Not available yet. The editing behaviour is fixed.",
27470
- "Not available yet. The Quick Access Toolbar is fixed.": "Not available yet. The Quick Access Toolbar is fixed.",
27471
- "Not available yet. The ribbon layout is fixed.": "Not available yet. The ribbon layout is fixed.",
27472
- "Not available yet. The display language is fixed.": "Not available yet. The display language is fixed.",
27473
- "Not available. Add-ins and macros are never run.": "Not available. Add-ins and macros are never run.",
27474
- "Not available. Documents stay local and active content is never run.": "Not available. Documents stay local and active content is never run."
27475
- };
27476
- var frOptionStrings = {
27477
- General: "G\xE9n\xE9ral",
27478
- Display: "Affichage",
27479
- Formulas: "Formules",
27480
- Data: "Donn\xE9es",
27481
- Proofing: "V\xE9rification",
27482
- Save: "Enregistrer",
27483
- Language: "Langue",
27484
- Accessibility: "Accessibilit\xE9",
27485
- Advanced: "Options avanc\xE9es",
27486
- "Customize Ribbon": "Personnaliser le ruban",
27487
- "Quick Access Toolbar": "Barre d\u2019outils Acc\xE8s rapide",
27488
- "Add-ins": "Compl\xE9ments",
27489
- "Trust Center": "Centre de gestion de la confidentialit\xE9",
27490
- OK: "OK",
27491
- Cancel: "Annuler",
27492
- Close: "Fermer",
27493
- Categories: "Cat\xE9gories",
27494
- "Reset all options": "R\xE9initialiser toutes les options",
27495
- "General options for working with {product}.": "Options g\xE9n\xE9rales pour l\u2019utilisation de {product}.",
27496
- "Change how {product} corrects and formats your text.": "Modifiez la fa\xE7on dont {product} corrige et met en forme votre texte.",
27497
- "Customize how documents are saved.": "Personnalisez l\u2019enregistrement des documents.",
27498
- "Set the Office Language Preferences.": "D\xE9finissez les pr\xE9f\xE9rences de langue d\u2019Office.",
27499
- "Make {product} easier to work with.": "Facilitez l\u2019utilisation de {product}.",
27500
- "Advanced options for working with {product}.": "Options avanc\xE9es pour l\u2019utilisation de {product}.",
27501
- "Customize the Ribbon and keyboard shortcuts.": "Personnalisez le ruban et les raccourcis clavier.",
27502
- "Customize the Quick Access Toolbar.": "Personnalisez la barre d\u2019outils Acc\xE8s rapide.",
27503
- "View and manage Microsoft Office Add-ins.": "Affichez et g\xE9rez les compl\xE9ments Microsoft Office.",
27504
- "Help keep your documents safe and your computer secure and healthy.": "Prot\xE9gez vos documents et assurez la s\xE9curit\xE9 et le bon \xE9tat de votre ordinateur.",
27505
- "User Interface options": "Options de l\u2019interface utilisateur",
27506
- "Show Mini Toolbar on selection": "Afficher la mini barre d\u2019outils lors de la s\xE9lection",
27507
- "Enable Live Preview": "Activer l\u2019aper\xE7u dynamique",
27508
- "ScreenTip style": "Style des info-bulles",
27509
- "Show feature descriptions in ScreenTips": "Afficher les descriptions des fonctionnalit\xE9s dans les info-bulles",
27510
- "Personalize your copy of Microsoft Office": "Personnalisez votre copie de Microsoft Office",
27511
- "User name": "Nom d\u2019utilisateur",
27512
- "Office Theme": "Th\xE8me Office",
27513
- "Office display language": "Langue d\u2019affichage d\u2019Office",
27514
- "Choose the language for menus, buttons and messages.": "Choisissez la langue des menus, des boutons et des messages.",
27515
- "Not available yet. Needs rich text formatting.": "Pas encore disponible. N\xE9cessite la mise en forme de texte enrichi.",
27516
- "Not available yet. Styles are applied on click; hover previews are not drawn yet.": "Pas encore disponible. Les styles s\u2019appliquent au clic ; les aper\xE7us au survol ne sont pas encore dessin\xE9s.",
27517
- "Not available yet. ScreenTips always describe the command.": "Pas encore disponible. Les info-bulles d\xE9crivent toujours la commande.",
27518
- "Not available yet. Documents are saved to this device; AutoRecover is not kept.": "Pas encore disponible. Les documents sont enregistr\xE9s sur cet appareil ; la r\xE9cup\xE9ration automatique n\u2019est pas conserv\xE9e.",
27519
- "Not available yet. There are no accessibility settings to change.": "Pas encore disponible. Aucun param\xE8tre d\u2019accessibilit\xE9 n\u2019est modifiable.",
27520
- "Not available yet. The editing behaviour is fixed.": "Pas encore disponible. Le comportement de modification est fixe.",
27521
- "Not available yet. The Quick Access Toolbar is fixed.": "Pas encore disponible. La barre d\u2019outils Acc\xE8s rapide est fixe.",
27522
- "Not available yet. The ribbon layout is fixed.": "Pas encore disponible. La disposition du ruban est fixe.",
27523
- "Not available yet. The display language is fixed.": "Pas encore disponible. La langue d\u2019affichage est fixe.",
27524
- "Not available. Add-ins and macros are never run.": "Non disponible. Les compl\xE9ments et les macros ne sont jamais ex\xE9cut\xE9s.",
27525
- "Not available. Documents stay local and active content is never run.": "Non disponible. Les documents restent locaux et le contenu actif n\u2019est jamais ex\xE9cut\xE9."
27526
- };
27527
- var deOptionStrings = {
27528
- General: "Allgemein",
27529
- Display: "Anzeige",
27530
- Formulas: "Formeln",
27531
- Data: "Daten",
27532
- Proofing: "Dokumentpr\xFCfung",
27533
- Save: "Speichern",
27534
- Language: "Sprache",
27535
- Accessibility: "Barrierefreiheit",
27536
- Advanced: "Erweitert",
27537
- "Customize Ribbon": "Men\xFCband anpassen",
27538
- "Quick Access Toolbar": "Symbolleiste f\xFCr den Schnellzugriff",
27539
- "Add-ins": "Add-Ins",
27540
- "Trust Center": "Trust Center",
27541
- OK: "OK",
27542
- Cancel: "Abbrechen",
27543
- Close: "Schlie\xDFen",
27544
- Categories: "Kategorien",
27545
- "Reset all options": "Alle Optionen zur\xFCcksetzen",
27546
- "General options for working with {product}.": "Allgemeine Optionen f\xFCr die Arbeit mit {product}.",
27547
- "Change how {product} corrects and formats your text.": "\xC4ndern Sie, wie {product} Ihren Text korrigiert und formatiert.",
27548
- "Customize how documents are saved.": "Passen Sie an, wie Dokumente gespeichert werden.",
27549
- "Set the Office Language Preferences.": "Legen Sie die Office-Spracheinstellungen fest.",
27550
- "Make {product} easier to work with.": "Machen Sie {product} einfacher bedienbar.",
27551
- "Advanced options for working with {product}.": "Erweiterte Optionen f\xFCr die Arbeit mit {product}.",
27552
- "Customize the Ribbon and keyboard shortcuts.": "Passen Sie das Men\xFCband und die Tastenkombinationen an.",
27553
- "Customize the Quick Access Toolbar.": "Passen Sie die Symbolleiste f\xFCr den Schnellzugriff an.",
27554
- "View and manage Microsoft Office Add-ins.": "Microsoft Office-Add-Ins anzeigen und verwalten.",
27555
- "Help keep your documents safe and your computer secure and healthy.": "Sch\xFCtzen Sie Ihre Dokumente und halten Sie Ihren Computer sicher und fehlerfrei.",
27556
- "User Interface options": "Benutzeroberfl\xE4chenoptionen",
27557
- "Show Mini Toolbar on selection": "Minisymbolleiste bei Auswahl anzeigen",
27558
- "Enable Live Preview": "Livevorschau aktivieren",
27559
- "ScreenTip style": "QuickInfo-Format",
27560
- "Show feature descriptions in ScreenTips": "Funktionsbeschreibungen in QuickInfos anzeigen",
27561
- "Personalize your copy of Microsoft Office": "Microsoft Office personalisieren",
27562
- "User name": "Benutzername",
27563
- "Office Theme": "Office-Design",
27564
- "Office display language": "Office-Anzeigesprache",
27565
- "Choose the language for menus, buttons and messages.": "W\xE4hlen Sie die Sprache f\xFCr Men\xFCs, Schaltfl\xE4chen und Meldungen.",
27566
- "Not available yet. Needs rich text formatting.": "Noch nicht verf\xFCgbar. Erfordert Formatierung von Rich-Text.",
27567
- "Not available yet. Styles are applied on click; hover previews are not drawn yet.": "Noch nicht verf\xFCgbar. Formatvorlagen werden per Klick angewendet; Vorschauen beim Dar\xFCberfahren werden noch nicht gezeichnet.",
27568
- "Not available yet. ScreenTips always describe the command.": "Noch nicht verf\xFCgbar. QuickInfos beschreiben immer den Befehl.",
27569
- "Not available yet. Documents are saved to this device; AutoRecover is not kept.": "Noch nicht verf\xFCgbar. Dokumente werden auf diesem Ger\xE4t gespeichert; AutoWiederherstellen wird nicht gef\xFChrt.",
27570
- "Not available yet. There are no accessibility settings to change.": "Noch nicht verf\xFCgbar. Es gibt keine Einstellungen zur Barrierefreiheit zu \xE4ndern.",
27571
- "Not available yet. The editing behaviour is fixed.": "Noch nicht verf\xFCgbar. Das Bearbeitungsverhalten ist festgelegt.",
27572
- "Not available yet. The Quick Access Toolbar is fixed.": "Noch nicht verf\xFCgbar. Die Symbolleiste f\xFCr den Schnellzugriff ist festgelegt.",
27573
- "Not available yet. The ribbon layout is fixed.": "Noch nicht verf\xFCgbar. Das Men\xFCband-Layout ist festgelegt.",
27574
- "Not available yet. The display language is fixed.": "Noch nicht verf\xFCgbar. Die Anzeigesprache ist festgelegt.",
27575
- "Not available. Add-ins and macros are never run.": "Nicht verf\xFCgbar. Add-Ins und Makros werden nie ausgef\xFChrt.",
27576
- "Not available. Documents stay local and active content is never run.": "Nicht verf\xFCgbar. Dokumente bleiben lokal und aktive Inhalte werden nie ausgef\xFChrt."
27577
- };
27578
- var esOptionStrings = {
27579
- General: "General",
27580
- Display: "Mostrar",
27581
- Formulas: "F\xF3rmulas",
27582
- Data: "Datos",
27583
- Proofing: "Revisi\xF3n",
27584
- Save: "Guardar",
27585
- Language: "Idioma",
27586
- Accessibility: "Accesibilidad",
27587
- Advanced: "Avanzadas",
27588
- "Customize Ribbon": "Personalizar cinta de opciones",
27589
- "Quick Access Toolbar": "Barra de herramientas de acceso r\xE1pido",
27590
- "Add-ins": "Complementos",
27591
- "Trust Center": "Centro de confianza",
27592
- OK: "Aceptar",
27593
- Cancel: "Cancelar",
27594
- Close: "Cerrar",
27595
- Categories: "Categor\xEDas",
27596
- "Reset all options": "Restablecer todas las opciones",
27597
- "General options for working with {product}.": "Opciones generales para trabajar con {product}.",
27598
- "Change how {product} corrects and formats your text.": "Cambie la forma en que {product} corrige y da formato al texto.",
27599
- "Customize how documents are saved.": "Personalice c\xF3mo se guardan los documentos.",
27600
- "Set the Office Language Preferences.": "Establezca las preferencias de idioma de Office.",
27601
- "Make {product} easier to work with.": "Haga que {product} sea m\xE1s f\xE1cil de usar.",
27602
- "Advanced options for working with {product}.": "Opciones avanzadas para trabajar con {product}.",
27603
- "Customize the Ribbon and keyboard shortcuts.": "Personalice la cinta de opciones y los m\xE9todos abreviados de teclado.",
27604
- "Customize the Quick Access Toolbar.": "Personalice la barra de herramientas de acceso r\xE1pido.",
27605
- "View and manage Microsoft Office Add-ins.": "Vea y administre los complementos de Microsoft Office.",
27606
- "Help keep your documents safe and your computer secure and healthy.": "Ayude a mantener seguros sus documentos y a proteger y mantener en buen estado su equipo.",
27607
- "User Interface options": "Opciones de la interfaz de usuario",
27608
- "Show Mini Toolbar on selection": "Mostrar minibarra de herramientas al seleccionar",
27609
- "Enable Live Preview": "Habilitar vistas previas din\xE1micas",
27610
- "ScreenTip style": "Estilo de la informaci\xF3n en pantalla",
27611
- "Show feature descriptions in ScreenTips": "Mostrar descripciones de caracter\xEDsticas en la informaci\xF3n en pantalla",
27612
- "Personalize your copy of Microsoft Office": "Personalice su copia de Microsoft Office",
27613
- "User name": "Nombre de usuario",
27614
- "Office Theme": "Tema de Office",
27615
- "Office display language": "Idioma de presentaci\xF3n de Office",
27616
- "Choose the language for menus, buttons and messages.": "Elija el idioma de los men\xFAs, los botones y los mensajes.",
27617
- "Not available yet. Needs rich text formatting.": "A\xFAn no disponible. Requiere formato de texto enriquecido.",
27618
- "Not available yet. Styles are applied on click; hover previews are not drawn yet.": "A\xFAn no disponible. Los estilos se aplican al hacer clic; las vistas previas al pasar el cursor todav\xEDa no se dibujan.",
27619
- "Not available yet. ScreenTips always describe the command.": "A\xFAn no disponible. La informaci\xF3n en pantalla siempre describe el comando.",
27620
- "Not available yet. Documents are saved to this device; AutoRecover is not kept.": "A\xFAn no disponible. Los documentos se guardan en este dispositivo; no se conserva la recuperaci\xF3n autom\xE1tica.",
27621
- "Not available yet. There are no accessibility settings to change.": "A\xFAn no disponible. No hay opciones de accesibilidad que cambiar.",
27622
- "Not available yet. The editing behaviour is fixed.": "A\xFAn no disponible. El comportamiento de edici\xF3n es fijo.",
27623
- "Not available yet. The Quick Access Toolbar is fixed.": "A\xFAn no disponible. La barra de herramientas de acceso r\xE1pido es fija.",
27624
- "Not available yet. The ribbon layout is fixed.": "A\xFAn no disponible. El dise\xF1o de la cinta de opciones es fijo.",
27625
- "Not available yet. The display language is fixed.": "A\xFAn no disponible. El idioma de presentaci\xF3n es fijo.",
27626
- "Not available. Add-ins and macros are never run.": "No disponible. Los complementos y las macros nunca se ejecutan.",
27627
- "Not available. Documents stay local and active content is never run.": "No disponible. Los documentos permanecen locales y el contenido activo nunca se ejecuta."
27628
- };
27629
- var zhOptionStrings = {
27630
- General: "\u5E38\u89C4",
27631
- Display: "\u663E\u793A",
27632
- Formulas: "\u516C\u5F0F",
27633
- Data: "\u6570\u636E",
27634
- Proofing: "\u6821\u5BF9",
27635
- Save: "\u4FDD\u5B58",
27636
- Language: "\u8BED\u8A00",
27637
- Accessibility: "\u8F85\u52A9\u529F\u80FD",
27638
- Advanced: "\u9AD8\u7EA7",
27639
- "Customize Ribbon": "\u81EA\u5B9A\u4E49\u529F\u80FD\u533A",
27640
- "Quick Access Toolbar": "\u5FEB\u901F\u8BBF\u95EE\u5DE5\u5177\u680F",
27641
- "Add-ins": "\u52A0\u8F7D\u9879",
27642
- "Trust Center": "\u4FE1\u4EFB\u4E2D\u5FC3",
27643
- OK: "\u786E\u5B9A",
27644
- Cancel: "\u53D6\u6D88",
27645
- Close: "\u5173\u95ED",
27646
- Categories: "\u7C7B\u522B",
27647
- "Reset all options": "\u91CD\u7F6E\u6240\u6709\u9009\u9879",
27648
- "General options for working with {product}.": "\u4F7F\u7528 {product} \u7684\u5E38\u89C4\u9009\u9879\u3002",
27649
- "Change how {product} corrects and formats your text.": "\u66F4\u6539 {product} \u66F4\u6B63\u548C\u8BBE\u7F6E\u6587\u672C\u683C\u5F0F\u7684\u65B9\u5F0F\u3002",
27650
- "Customize how documents are saved.": "\u81EA\u5B9A\u4E49\u4FDD\u5B58\u6587\u6863\u7684\u65B9\u5F0F\u3002",
27651
- "Set the Office Language Preferences.": "\u8BBE\u7F6E Office \u8BED\u8A00\u9996\u9009\u9879\u3002",
27652
- "Make {product} easier to work with.": "\u8BA9 {product} \u66F4\u6613\u4E8E\u4F7F\u7528\u3002",
27653
- "Advanced options for working with {product}.": "\u4F7F\u7528 {product} \u7684\u9AD8\u7EA7\u9009\u9879\u3002",
27654
- "Customize the Ribbon and keyboard shortcuts.": "\u81EA\u5B9A\u4E49\u529F\u80FD\u533A\u548C\u952E\u76D8\u5FEB\u6377\u65B9\u5F0F\u3002",
27655
- "Customize the Quick Access Toolbar.": "\u81EA\u5B9A\u4E49\u5FEB\u901F\u8BBF\u95EE\u5DE5\u5177\u680F\u3002",
27656
- "View and manage Microsoft Office Add-ins.": "\u67E5\u770B\u548C\u7BA1\u7406 Microsoft Office \u52A0\u8F7D\u9879\u3002",
27657
- "Help keep your documents safe and your computer secure and healthy.": "\u5E2E\u52A9\u4FDD\u969C\u6587\u6863\u5B89\u5168\uFF0C\u5E76\u4F7F\u8BA1\u7B97\u673A\u4FDD\u6301\u5B89\u5168\u548C\u5065\u5EB7\u3002",
27658
- "User Interface options": "\u7528\u6237\u754C\u9762\u9009\u9879",
27659
- "Show Mini Toolbar on selection": "\u9009\u62E9\u65F6\u663E\u793A\u6D6E\u52A8\u5DE5\u5177\u680F",
27660
- "Enable Live Preview": "\u542F\u7528\u5B9E\u65F6\u9884\u89C8",
27661
- "ScreenTip style": "\u5C4F\u5E55\u63D0\u793A\u6837\u5F0F",
27662
- "Show feature descriptions in ScreenTips": "\u5728\u5C4F\u5E55\u63D0\u793A\u4E2D\u663E\u793A\u529F\u80FD\u8BF4\u660E",
27663
- "Personalize your copy of Microsoft Office": "\u5BF9 Microsoft Office \u8FDB\u884C\u4E2A\u6027\u5316\u8BBE\u7F6E",
27664
- "User name": "\u7528\u6237\u540D",
27665
- "Office Theme": "Office \u4E3B\u9898",
27666
- "Office display language": "Office \u663E\u793A\u8BED\u8A00",
27667
- "Choose the language for menus, buttons and messages.": "\u9009\u62E9\u83DC\u5355\u3001\u6309\u94AE\u548C\u6D88\u606F\u4F7F\u7528\u7684\u8BED\u8A00\u3002",
27668
- "Not available yet. Needs rich text formatting.": "\u6682\u4E0D\u53EF\u7528\u3002\u9700\u8981\u5BCC\u6587\u672C\u683C\u5F0F\u3002",
27669
- "Not available yet. Styles are applied on click; hover previews are not drawn yet.": "\u6682\u4E0D\u53EF\u7528\u3002\u6837\u5F0F\u5728\u5355\u51FB\u65F6\u5E94\u7528\uFF1B\u5C1A\u4E0D\u7ED8\u5236\u60AC\u505C\u9884\u89C8\u3002",
27670
- "Not available yet. ScreenTips always describe the command.": "\u6682\u4E0D\u53EF\u7528\u3002\u5C4F\u5E55\u63D0\u793A\u59CB\u7EC8\u63CF\u8FF0\u8BE5\u547D\u4EE4\u3002",
27671
- "Not available yet. Documents are saved to this device; AutoRecover is not kept.": "\u6682\u4E0D\u53EF\u7528\u3002\u6587\u6863\u4FDD\u5B58\u5230\u6B64\u8BBE\u5907\uFF1B\u4E0D\u4FDD\u7559\u81EA\u52A8\u6062\u590D\u3002",
27672
- "Not available yet. There are no accessibility settings to change.": "\u6682\u4E0D\u53EF\u7528\u3002\u6CA1\u6709\u53EF\u66F4\u6539\u7684\u8F85\u52A9\u529F\u80FD\u8BBE\u7F6E\u3002",
27673
- "Not available yet. The editing behaviour is fixed.": "\u6682\u4E0D\u53EF\u7528\u3002\u7F16\u8F91\u884C\u4E3A\u662F\u56FA\u5B9A\u7684\u3002",
27674
- "Not available yet. The Quick Access Toolbar is fixed.": "\u6682\u4E0D\u53EF\u7528\u3002\u5FEB\u901F\u8BBF\u95EE\u5DE5\u5177\u680F\u662F\u56FA\u5B9A\u7684\u3002",
27675
- "Not available yet. The ribbon layout is fixed.": "\u6682\u4E0D\u53EF\u7528\u3002\u529F\u80FD\u533A\u5E03\u5C40\u662F\u56FA\u5B9A\u7684\u3002",
27676
- "Not available yet. The display language is fixed.": "\u6682\u4E0D\u53EF\u7528\u3002\u663E\u793A\u8BED\u8A00\u662F\u56FA\u5B9A\u7684\u3002",
27677
- "Not available. Add-ins and macros are never run.": "\u4E0D\u53EF\u7528\u3002\u52A0\u8F7D\u9879\u548C\u5B8F\u6C38\u8FDC\u4E0D\u4F1A\u8FD0\u884C\u3002",
27678
- "Not available. Documents stay local and active content is never run.": "\u4E0D\u53EF\u7528\u3002\u6587\u6863\u4FDD\u7559\u5728\u672C\u5730\uFF0C\u6D3B\u52A8\u5185\u5BB9\u6C38\u8FDC\u4E0D\u4F1A\u8FD0\u884C\u3002"
27679
- };
27680
- var optionStrings = {
27681
- en: enOptionStrings,
27682
- fr: frOptionStrings,
27683
- de: deOptionStrings,
27684
- es: esOptionStrings,
27685
- "zh-CN": zhOptionStrings
27686
- };
27687
-
27688
27571
  // xlsx/ui/locales/merge.ts
27689
27572
  var mergeStringModules = mergeMessageModules;
27690
27573
 
@@ -28953,11 +28836,11 @@ var NAVIGATION_STRINGS = {
28953
28836
  "Dise\xF1os de tablas din\xE1micas no modelados, agrupaci\xF3n, segmentaciones y fuentes externas (conservados)",
28954
28837
  "\u672A\u5EFA\u6A21\u7684\u6570\u636E\u900F\u89C6\u8868\u5E03\u5C40\u3001\u5206\u7EC4\u3001\u5207\u7247\u5668\u548C\u5916\u90E8\u6570\u636E\u6E90\uFF08\u4FDD\u7559\uFF09"
28955
28838
  ],
28956
- "Values-on-rows report filters, multiple/dynamic filters and repeated column captions (preserved)": [
28957
- "Filtres de rapport avec valeurs en lignes, filtres multiples ou dynamiques et libell\xE9s de colonnes r\xE9p\xE9t\xE9s (conserv\xE9s)",
28958
- "Berichtsfilter mit Werten in Zeilen, mehrere/dynamische Filter und wiederholte Spaltenbeschriftungen (erhalten)",
28959
- "Filtros de informe con valores en filas, filtros m\xFAltiples o din\xE1micos y t\xEDtulos de columna repetidos (conservados)",
28960
- "\u503C\u4F4D\u4E8E\u884C\u4E0A\u7684\u62A5\u8868\u7B5B\u9009\u5668\u3001\u591A\u91CD\u6216\u52A8\u6001\u7B5B\u9009\u5668\u548C\u91CD\u590D\u5217\u6807\u9898\uFF08\u4FDD\u7559\uFF09"
28839
+ "Multiple/dynamic report filters and repeated column captions (preserved)": [
28840
+ "Filtres de rapport multiples ou dynamiques et libell\xE9s de colonnes r\xE9p\xE9t\xE9s (conserv\xE9s)",
28841
+ "Mehrere/dynamische Berichtsfilter und wiederholte Spaltenbeschriftungen (erhalten)",
28842
+ "Filtros de informe m\xFAltiples o din\xE1micos y t\xEDtulos de columna repetidos (conservados)",
28843
+ "\u591A\u91CD\u6216\u52A8\u6001\u62A5\u8868\u7B5B\u9009\u5668\u548C\u91CD\u590D\u5217\u6807\u9898\uFF08\u4FDD\u7559\uFF09"
28961
28844
  ],
28962
28845
  OK: ["OK", "OK", "Aceptar", "\u786E\u5B9A"],
28963
28846
  Cancel: ["Annuler", "Abbrechen", "Cancelar", "\u53D6\u6D88"],
@@ -32187,6 +32070,13 @@ var PIVOT_STRINGS = {
32187
32070
  "Despu\xE9s de los campos de fila",
32188
32071
  "\u884C\u5B57\u6BB5\u4E4B\u540E"
32189
32072
  ],
32073
+ "After {field}": ["Apr\xE8s {field}", "Nach {field}", "Despu\xE9s de {field}", "{field} \u4E4B\u540E"],
32074
+ "Values are listed after {field}.": [
32075
+ "Les valeurs sont affich\xE9es apr\xE8s {field}.",
32076
+ "Werte werden nach {field} aufgef\xFChrt.",
32077
+ "Los valores aparecen despu\xE9s de {field}.",
32078
+ "\u503C\u5217\u5728 {field} \u4E4B\u540E\u3002"
32079
+ ],
32190
32080
  "Between row fields": [
32191
32081
  "Entre les champs de ligne",
32192
32082
  "Zwischen den Zeilenfeldern",
@@ -32408,12 +32298,6 @@ var PIVOT_STRINGS = {
32408
32298
  "Elija campos de columna de tabla din\xE1mica v\xE1lidos.",
32409
32299
  "\u8BF7\u9009\u62E9\u6709\u6548\u7684\u6570\u636E\u900F\u89C6\u8868\u5217\u5B57\u6BB5\u3002"
32410
32300
  ],
32411
- "Values on rows support one column field.": [
32412
- "Les valeurs en lignes prennent en charge un seul champ de colonne.",
32413
- "Werte in Zeilen unterst\xFCtzen nur ein Spaltenfeld.",
32414
- "Los valores en filas admiten un solo campo de columna.",
32415
- "\u884C\u4E0A\u7684\u503C\u4EC5\u652F\u6301\u4E00\u4E2A\u5217\u5B57\u6BB5\u3002"
32416
- ],
32417
32301
  "Report filters support one column field.": [
32418
32302
  "Les filtres de rapport prennent en charge un seul champ de colonne.",
32419
32303
  "Berichtsfilter unterst\xFCtzen nur ein Spaltenfeld.",
@@ -32474,12 +32358,6 @@ var PIVOT_STRINGS = {
32474
32358
  "Solo se pueden agrupar por fecha los campos que contienen fechas.",
32475
32359
  "\u53EA\u6709\u5305\u542B\u65E5\u671F\u7684\u5B57\u6BB5\u624D\u80FD\u6309\u65E5\u671F\u7EC4\u5408\u3002"
32476
32360
  ],
32477
- "Date groups cannot be combined with report filters or timelines.": [
32478
- "Les regroupements de dates ne peuvent pas \xEAtre combin\xE9s avec des filtres de rapport ou des chronologies.",
32479
- "Datumsgruppen k\xF6nnen nicht mit Berichtsfiltern oder Zeitachsen kombiniert werden.",
32480
- "Las agrupaciones de fechas no se pueden combinar con filtros de informe ni escalas de tiempo.",
32481
- "\u65E5\u671F\u7EC4\u5408\u4E0D\u80FD\u4E0E\u62A5\u8868\u7B5B\u9009\u5668\u6216\u65E5\u7A0B\u8868\u4E00\u8D77\u4F7F\u7528\u3002"
32482
- ],
32483
32361
  "The date group must end after it starts.": [
32484
32362
  "Le regroupement de dates doit se terminer apr\xE8s son d\xE9but.",
32485
32363
  "Die Datumsgruppe muss nach ihrem Beginn enden.",
@@ -32516,23 +32394,11 @@ var PIVOT_STRINGS = {
32516
32394
  "Elija campos de fila de tabla din\xE1mica v\xE1lidos.",
32517
32395
  "\u8BF7\u9009\u62E9\u6709\u6548\u7684\u6570\u636E\u900F\u89C6\u8868\u884C\u5B57\u6BB5\u3002"
32518
32396
  ],
32519
- "Values on rows support at most two row fields.": [
32520
- "Les valeurs en lignes prennent en charge deux champs de ligne au maximum.",
32521
- "Werte in Zeilen unterst\xFCtzen h\xF6chstens zwei Zeilenfelder.",
32522
- "Los valores en filas admiten como m\xE1ximo dos campos de fila.",
32523
- "\u884C\u4E0A\u7684\u503C\u6700\u591A\u652F\u6301\u4E24\u4E2A\u884C\u5B57\u6BB5\u3002"
32524
- ],
32525
32397
  "Choose valid field subtotals.": [
32526
32398
  "Choisissez des sous-totaux de champ valides.",
32527
32399
  "W\xE4hlen Sie g\xFCltige Feldteilergebnisse.",
32528
32400
  "Elija subtotales de campo v\xE1lidos.",
32529
32401
  "\u8BF7\u9009\u62E9\u6709\u6548\u7684\u5B57\u6BB5\u5206\u7C7B\u6C47\u603B\u3002"
32530
- ],
32531
- "Field subtotals require Values on columns.": [
32532
- "Les sous-totaux de champ n\xE9cessitent des valeurs en colonnes.",
32533
- "Feldteilergebnisse erfordern Werte in Spalten.",
32534
- "Los subtotales de campo requieren valores en columnas.",
32535
- "\u5B57\u6BB5\u5206\u7C7B\u6C47\u603B\u8981\u6C42\u503C\u663E\u793A\u5728\u5217\u4E0A\u3002"
32536
32402
  ]
32537
32403
  };
32538
32404
 
@@ -33045,8 +32911,8 @@ var COLUMN = {
33045
32911
  };
33046
32912
  function flatten2(tables, locale) {
33047
32913
  const out = {};
33048
- for (const table2 of tables)
33049
- for (const [key, texts] of Object.entries(table2))
32914
+ for (const table3 of tables)
32915
+ for (const [key, texts] of Object.entries(table3))
33050
32916
  out[key] = locale === "en" ? key : texts[COLUMN[locale]] ?? key;
33051
32917
  return out;
33052
32918
  }
@@ -35323,9 +35189,9 @@ function cellCommands() {
35323
35189
  ["format.hide-columns", "Hide Columns", "col", true],
35324
35190
  ["format.unhide-columns", "Unhide Columns", "col", false]
35325
35191
  ].map(
35326
- ([id, label5, axis, hidden]) => editing({
35192
+ ([id, label2, axis, hidden]) => editing({
35327
35193
  id,
35328
- label: label5,
35194
+ label: label2,
35329
35195
  icon: icon("hide"),
35330
35196
  lock: axis === "row" ? "formatRows" : "formatColumns",
35331
35197
  run: (ctx) => {
@@ -35650,10 +35516,10 @@ var TABLE_FLAGS = [
35650
35516
  ];
35651
35517
  function setTableBand(ctx, band, on) {
35652
35518
  const t = target(ctx);
35653
- const table2 = activeTable(ctx);
35654
- if (!t || !table2 || table2[band] === on) return;
35519
+ const table3 = activeTable(ctx);
35520
+ if (!t || !table3 || table3[band] === on) return;
35655
35521
  try {
35656
- t.session.updateTable(t.sheet, table2.name, { [band]: on });
35522
+ t.session.updateTable(t.sheet, table3.name, { [band]: on });
35657
35523
  } catch (error) {
35658
35524
  ctx.toast(ctx.t(error instanceof Error ? error.message : String(error)), "warning");
35659
35525
  }
@@ -35702,14 +35568,14 @@ function contextualCommands() {
35702
35568
  icon: icon("convertRange"),
35703
35569
  run: async (ctx) => {
35704
35570
  const t = target(ctx);
35705
- const table2 = activeTable(ctx);
35706
- if (!t || !table2) return;
35571
+ const table3 = activeTable(ctx);
35572
+ if (!t || !table3) return;
35707
35573
  const ok = await ctx.dialogs.open("confirm", {
35708
35574
  heading: "Convert to Range",
35709
35575
  message: "Do you want to convert the table to a normal range?",
35710
35576
  okLabel: "Yes"
35711
35577
  });
35712
- if (ok) t.session.convertTableToRange(t.sheet, table2.name);
35578
+ if (ok) t.session.convertTableToRange(t.sheet, table3.name);
35713
35579
  }
35714
35580
  }),
35715
35581
  tableCmd({
@@ -35726,14 +35592,14 @@ function contextualCommands() {
35726
35592
  run: (ctx) => setTableBand(ctx, "totalsRow", !activeTable(ctx)?.totalsRow)
35727
35593
  }),
35728
35594
  ...TABLE_FLAGS.map(
35729
- ([flag2, id, label5]) => tableCmd({
35595
+ ([flag2, id, label2]) => tableCmd({
35730
35596
  id,
35731
- label: label5,
35597
+ label: label2,
35732
35598
  checked: (ctx) => !!activeTable(ctx)?.[flag2],
35733
35599
  run: (ctx) => {
35734
35600
  const t = target(ctx);
35735
- const table2 = activeTable(ctx);
35736
- if (t && table2) t.session.updateTable(t.sheet, table2.name, { [flag2]: !table2[flag2] });
35601
+ const table3 = activeTable(ctx);
35602
+ if (t && table3) t.session.updateTable(t.sheet, table3.name, { [flag2]: !table3[flag2] });
35737
35603
  }
35738
35604
  })
35739
35605
  ),
@@ -35743,9 +35609,9 @@ function contextualCommands() {
35743
35609
  icon: icon("formatTable"),
35744
35610
  run: (ctx, arg) => {
35745
35611
  const t = target(ctx);
35746
- const table2 = activeTable(ctx);
35747
- if (t && table2 && typeof arg === "string")
35748
- t.session.updateTable(t.sheet, table2.name, { styleName: arg });
35612
+ const table3 = activeTable(ctx);
35613
+ if (t && table3 && typeof arg === "string")
35614
+ t.session.updateTable(t.sheet, table3.name, { styleName: arg });
35749
35615
  }
35750
35616
  }),
35751
35617
  chartCmd({
@@ -36144,9 +36010,9 @@ function fillDirection(ctx, dir) {
36144
36010
  function editingCommands() {
36145
36011
  return [
36146
36012
  ...AUTOSUM_FUNCTIONS.map(
36147
- ([fn, label5]) => editing({
36013
+ ([fn, label2]) => editing({
36148
36014
  id: fn === "SUM" ? "home.autosum" : `home.autosum-${fn.toLowerCase()}`,
36149
- label: fn === "SUM" ? "AutoSum" : label5,
36015
+ label: fn === "SUM" ? "AutoSum" : label2,
36150
36016
  icon: icon("autoSum"),
36151
36017
  ...fn === "SUM" ? { shortcut: "Alt+=" } : {},
36152
36018
  run: (ctx) => autoSum(ctx, fn)
@@ -36197,16 +36063,16 @@ function editingCommands() {
36197
36063
  ["comments", "Clear Comments and Notes"],
36198
36064
  ["hyperlinks", "Clear Hyperlinks"]
36199
36065
  ].map(
36200
- ([what, label5]) => editing({
36066
+ ([what, label2]) => editing({
36201
36067
  id: `home.clear-${what}`,
36202
- label: label5,
36068
+ label: label2,
36203
36069
  icon: icon("clear"),
36204
36070
  ...what === "formats" ? { lock: "formatCells" } : {},
36205
36071
  ...what === "contents" ? { shortcut: "Delete" } : {},
36206
36072
  run: (ctx) => {
36207
36073
  const t = target(ctx);
36208
36074
  if (!t) return;
36209
- t.session.batch(label5, () => {
36075
+ t.session.batch(label2, () => {
36210
36076
  for (const range2 of t.ranges) t.session.clearRange(t.sheet, range2, what);
36211
36077
  });
36212
36078
  }
@@ -36247,9 +36113,9 @@ function editingCommands() {
36247
36113
  ["constants", "Constants"],
36248
36114
  ["validation", "Data Validation"]
36249
36115
  ].map(
36250
- ([kind, label5]) => viewing({
36116
+ ([kind, label2]) => viewing({
36251
36117
  id: `home.select-${kind}`,
36252
- label: label5,
36118
+ label: label2,
36253
36119
  icon: icon("findSelect"),
36254
36120
  run: (ctx) => {
36255
36121
  if (!selectSpecial(ctx, { kind })) ctx.toast(ctx.t("No cells were found."), "info");
@@ -36520,7 +36386,7 @@ function numberCommands() {
36520
36386
  ["home.format-date", "Date format", "d-mmm-yy", "Ctrl+Shift+#"],
36521
36387
  ["home.format-scientific", "Scientific format", "0.00E+00", "Ctrl+Shift+^"]
36522
36388
  ].map(
36523
- ([id, label5, format, shortcut]) => editing({ id, label: label5, shortcut, lock: "formatCells", run: (ctx) => setFormat(ctx, format) })
36389
+ ([id, label2, format, shortcut]) => editing({ id, label: label2, shortcut, lock: "formatCells", run: (ctx) => setFormat(ctx, format) })
36524
36390
  )
36525
36391
  ];
36526
36392
  }
@@ -36744,9 +36610,9 @@ function slicerSourceAt(ctx) {
36744
36610
  pivot,
36745
36611
  fields: pivot.fields.filter((field) => field !== pivot.pageFilter?.field)
36746
36612
  };
36747
- const table2 = activeTable(ctx);
36748
- if (table2?.headerRow && !table2.filterNotModeled)
36749
- return { kind: "table", table: table2, fields: table2.columns.map((column2) => column2.name) };
36613
+ const table3 = activeTable(ctx);
36614
+ if (table3?.headerRow && !table3.filterNotModeled)
36615
+ return { kind: "table", table: table3, fields: table3.columns.map((column2) => column2.name) };
36750
36616
  return void 0;
36751
36617
  }
36752
36618
  function activeTimeline(ctx) {
@@ -38468,13 +38334,13 @@ function searchCommands(ctx, query, isHidden) {
38468
38334
  const seen = /* @__PURE__ */ new Set();
38469
38335
  for (const command of ctx.commands.list()) {
38470
38336
  if (isHidden(command.id) || !ctx.commands.isEnabled(command.id)) continue;
38471
- const label5 = ctx.t(command.label).toLocaleLowerCase();
38337
+ const label2 = ctx.t(command.label).toLocaleLowerCase();
38472
38338
  const english = command.label.toLocaleLowerCase();
38473
- const haystack = `${label5} ${english} ${command.id.replace(/[.-]/g, " ")}`;
38339
+ const haystack = `${label2} ${english} ${command.id.replace(/[.-]/g, " ")}`;
38474
38340
  if (!words2.every((word) => haystack.includes(word))) continue;
38475
- if (seen.has(label5)) continue;
38476
- seen.add(label5);
38477
- const score = label5.startsWith(words2[0]) ? 0 : label5.includes(words2[0]) ? 1 : 2;
38341
+ if (seen.has(label2)) continue;
38342
+ seen.add(label2);
38343
+ const score = label2.startsWith(words2[0]) ? 0 : label2.includes(words2[0]) ? 1 : 2;
38478
38344
  scored.push({ command, score });
38479
38345
  }
38480
38346
  return scored.sort(