@cj-tech-master/excelts 4.2.3-canary.20260122080306.cc11b20 → 5.0.0-canary.20260123012457.1fdf506

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 (53) hide show
  1. package/dist/browser/modules/excel/column.d.ts +5 -0
  2. package/dist/browser/modules/excel/column.js +10 -2
  3. package/dist/browser/modules/excel/row.d.ts +2 -0
  4. package/dist/browser/modules/excel/row.js +3 -1
  5. package/dist/browser/modules/excel/workbook.d.ts +4 -0
  6. package/dist/browser/modules/excel/workbook.js +4 -1
  7. package/dist/browser/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.d.ts +1 -0
  8. package/dist/browser/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +17 -10
  9. package/dist/browser/modules/excel/xlsx/xform/sheet/row-xform.d.ts +1 -0
  10. package/dist/browser/modules/excel/xlsx/xform/sheet/row-xform.js +7 -1
  11. package/dist/browser/modules/excel/xlsx/xform/sheet/sheet-format-properties-xform.d.ts +1 -0
  12. package/dist/browser/modules/excel/xlsx/xform/sheet/sheet-format-properties-xform.js +9 -4
  13. package/dist/browser/modules/excel/xlsx/xform/sheet/sheet-view-xform.js +4 -2
  14. package/dist/browser/modules/excel/xlsx/xform/sheet/worksheet-xform.js +2 -1
  15. package/dist/browser/modules/excel/xlsx/xform/style/style-xform.d.ts +7 -0
  16. package/dist/browser/modules/excel/xlsx/xform/style/style-xform.js +26 -6
  17. package/dist/browser/modules/excel/xlsx/xform/style/styles-xform.d.ts +6 -0
  18. package/dist/browser/modules/excel/xlsx/xform/style/styles-xform.js +52 -4
  19. package/dist/browser/modules/excel/xlsx/xlsx.browser.js +7 -0
  20. package/dist/cjs/modules/excel/column.js +10 -2
  21. package/dist/cjs/modules/excel/row.js +3 -1
  22. package/dist/cjs/modules/excel/workbook.js +4 -1
  23. package/dist/cjs/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +17 -10
  24. package/dist/cjs/modules/excel/xlsx/xform/sheet/row-xform.js +7 -1
  25. package/dist/cjs/modules/excel/xlsx/xform/sheet/sheet-format-properties-xform.js +9 -4
  26. package/dist/cjs/modules/excel/xlsx/xform/sheet/sheet-view-xform.js +4 -2
  27. package/dist/cjs/modules/excel/xlsx/xform/sheet/worksheet-xform.js +2 -1
  28. package/dist/cjs/modules/excel/xlsx/xform/style/style-xform.js +26 -6
  29. package/dist/cjs/modules/excel/xlsx/xform/style/styles-xform.js +52 -4
  30. package/dist/cjs/modules/excel/xlsx/xlsx.browser.js +7 -0
  31. package/dist/esm/modules/excel/column.js +10 -2
  32. package/dist/esm/modules/excel/row.js +3 -1
  33. package/dist/esm/modules/excel/workbook.js +4 -1
  34. package/dist/esm/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.js +17 -10
  35. package/dist/esm/modules/excel/xlsx/xform/sheet/row-xform.js +7 -1
  36. package/dist/esm/modules/excel/xlsx/xform/sheet/sheet-format-properties-xform.js +9 -4
  37. package/dist/esm/modules/excel/xlsx/xform/sheet/sheet-view-xform.js +4 -2
  38. package/dist/esm/modules/excel/xlsx/xform/sheet/worksheet-xform.js +2 -1
  39. package/dist/esm/modules/excel/xlsx/xform/style/style-xform.js +26 -6
  40. package/dist/esm/modules/excel/xlsx/xform/style/styles-xform.js +52 -4
  41. package/dist/esm/modules/excel/xlsx/xlsx.browser.js +7 -0
  42. package/dist/iife/excelts.iife.js +450 -394
  43. package/dist/iife/excelts.iife.js.map +1 -1
  44. package/dist/iife/excelts.iife.min.js +7 -7
  45. package/dist/types/modules/excel/column.d.ts +5 -0
  46. package/dist/types/modules/excel/row.d.ts +2 -0
  47. package/dist/types/modules/excel/workbook.d.ts +4 -0
  48. package/dist/types/modules/excel/xlsx/xform/pivot-table/pivot-table-xform.d.ts +1 -0
  49. package/dist/types/modules/excel/xlsx/xform/sheet/row-xform.d.ts +1 -0
  50. package/dist/types/modules/excel/xlsx/xform/sheet/sheet-format-properties-xform.d.ts +1 -0
  51. package/dist/types/modules/excel/xlsx/xform/style/style-xform.d.ts +7 -0
  52. package/dist/types/modules/excel/xlsx/xform/style/styles-xform.d.ts +6 -0
  53. package/package.json +14 -14
@@ -1,5 +1,5 @@
1
1
  /*!
2
- * @cj-tech-master/excelts v4.2.3-canary.20260122080306.cc11b20
2
+ * @cj-tech-master/excelts v5.0.0-canary.20260123012457.1fdf506
3
3
  * TypeScript Excel Workbook Manager - Read and Write xlsx and csv Files.
4
4
  * (c) 2026 cjnoname
5
5
  * Released under the MIT License
@@ -228,8 +228,8 @@ var ExcelTS = (function(exports) {
228
228
  default: throw new Error("Can only encode with 2 or 4 arguments");
229
229
  }
230
230
  },
231
- inRange(range$1, address) {
232
- const [left, top, , right, bottom] = range$1;
231
+ inRange(range, address) {
232
+ const [left, top, , right, bottom] = range;
233
233
  const [col, row] = address;
234
234
  return col >= left && col <= right && row >= top && row <= bottom;
235
235
  }
@@ -435,47 +435,47 @@ var ExcelTS = (function(exports) {
435
435
 
436
436
  //#endregion
437
437
  //#region src/modules/excel/enums.ts
438
- let ValueType = /* @__PURE__ */ function(ValueType$1) {
439
- ValueType$1[ValueType$1["Null"] = 0] = "Null";
440
- ValueType$1[ValueType$1["Merge"] = 1] = "Merge";
441
- ValueType$1[ValueType$1["Number"] = 2] = "Number";
442
- ValueType$1[ValueType$1["String"] = 3] = "String";
443
- ValueType$1[ValueType$1["Date"] = 4] = "Date";
444
- ValueType$1[ValueType$1["Hyperlink"] = 5] = "Hyperlink";
445
- ValueType$1[ValueType$1["Formula"] = 6] = "Formula";
446
- ValueType$1[ValueType$1["SharedString"] = 7] = "SharedString";
447
- ValueType$1[ValueType$1["RichText"] = 8] = "RichText";
448
- ValueType$1[ValueType$1["Boolean"] = 9] = "Boolean";
449
- ValueType$1[ValueType$1["Error"] = 10] = "Error";
450
- ValueType$1[ValueType$1["JSON"] = 11] = "JSON";
451
- ValueType$1[ValueType$1["Checkbox"] = 12] = "Checkbox";
452
- return ValueType$1;
438
+ let ValueType = /* @__PURE__ */ function(ValueType) {
439
+ ValueType[ValueType["Null"] = 0] = "Null";
440
+ ValueType[ValueType["Merge"] = 1] = "Merge";
441
+ ValueType[ValueType["Number"] = 2] = "Number";
442
+ ValueType[ValueType["String"] = 3] = "String";
443
+ ValueType[ValueType["Date"] = 4] = "Date";
444
+ ValueType[ValueType["Hyperlink"] = 5] = "Hyperlink";
445
+ ValueType[ValueType["Formula"] = 6] = "Formula";
446
+ ValueType[ValueType["SharedString"] = 7] = "SharedString";
447
+ ValueType[ValueType["RichText"] = 8] = "RichText";
448
+ ValueType[ValueType["Boolean"] = 9] = "Boolean";
449
+ ValueType[ValueType["Error"] = 10] = "Error";
450
+ ValueType[ValueType["JSON"] = 11] = "JSON";
451
+ ValueType[ValueType["Checkbox"] = 12] = "Checkbox";
452
+ return ValueType;
453
453
  }({});
454
- let FormulaType = /* @__PURE__ */ function(FormulaType$1) {
455
- FormulaType$1[FormulaType$1["None"] = 0] = "None";
456
- FormulaType$1[FormulaType$1["Master"] = 1] = "Master";
457
- FormulaType$1[FormulaType$1["Shared"] = 2] = "Shared";
458
- return FormulaType$1;
454
+ let FormulaType = /* @__PURE__ */ function(FormulaType) {
455
+ FormulaType[FormulaType["None"] = 0] = "None";
456
+ FormulaType[FormulaType["Master"] = 1] = "Master";
457
+ FormulaType[FormulaType["Shared"] = 2] = "Shared";
458
+ return FormulaType;
459
459
  }({});
460
- let RelationshipType = /* @__PURE__ */ function(RelationshipType$1) {
461
- RelationshipType$1[RelationshipType$1["None"] = 0] = "None";
462
- RelationshipType$1[RelationshipType$1["OfficeDocument"] = 1] = "OfficeDocument";
463
- RelationshipType$1[RelationshipType$1["Worksheet"] = 2] = "Worksheet";
464
- RelationshipType$1[RelationshipType$1["CalcChain"] = 3] = "CalcChain";
465
- RelationshipType$1[RelationshipType$1["SharedStrings"] = 4] = "SharedStrings";
466
- RelationshipType$1[RelationshipType$1["Styles"] = 5] = "Styles";
467
- RelationshipType$1[RelationshipType$1["Theme"] = 6] = "Theme";
468
- RelationshipType$1[RelationshipType$1["Hyperlink"] = 7] = "Hyperlink";
469
- return RelationshipType$1;
460
+ let RelationshipType = /* @__PURE__ */ function(RelationshipType) {
461
+ RelationshipType[RelationshipType["None"] = 0] = "None";
462
+ RelationshipType[RelationshipType["OfficeDocument"] = 1] = "OfficeDocument";
463
+ RelationshipType[RelationshipType["Worksheet"] = 2] = "Worksheet";
464
+ RelationshipType[RelationshipType["CalcChain"] = 3] = "CalcChain";
465
+ RelationshipType[RelationshipType["SharedStrings"] = 4] = "SharedStrings";
466
+ RelationshipType[RelationshipType["Styles"] = 5] = "Styles";
467
+ RelationshipType[RelationshipType["Theme"] = 6] = "Theme";
468
+ RelationshipType[RelationshipType["Hyperlink"] = 7] = "Hyperlink";
469
+ return RelationshipType;
470
470
  }({});
471
- let DocumentType = /* @__PURE__ */ function(DocumentType$1) {
472
- DocumentType$1[DocumentType$1["Xlsx"] = 1] = "Xlsx";
473
- return DocumentType$1;
471
+ let DocumentType = /* @__PURE__ */ function(DocumentType) {
472
+ DocumentType[DocumentType["Xlsx"] = 1] = "Xlsx";
473
+ return DocumentType;
474
474
  }({});
475
- let ReadingOrder = /* @__PURE__ */ function(ReadingOrder$1) {
476
- ReadingOrder$1[ReadingOrder$1["LeftToRight"] = 1] = "LeftToRight";
477
- ReadingOrder$1[ReadingOrder$1["RightToLeft"] = 2] = "RightToLeft";
478
- return ReadingOrder$1;
475
+ let ReadingOrder = /* @__PURE__ */ function(ReadingOrder) {
476
+ ReadingOrder[ReadingOrder["LeftToRight"] = 1] = "LeftToRight";
477
+ ReadingOrder[ReadingOrder["RightToLeft"] = 2] = "RightToLeft";
478
+ return ReadingOrder;
479
479
  }({});
480
480
  const ErrorValue = {
481
481
  NotApplicable: "#N/A",
@@ -1830,7 +1830,8 @@ var ExcelTS = (function(exports) {
1830
1830
  style: this.style,
1831
1831
  hidden: this.hidden,
1832
1832
  outlineLevel: this.outlineLevel,
1833
- collapsed: this.collapsed
1833
+ collapsed: this.collapsed,
1834
+ dyDescent: this.dyDescent
1834
1835
  } : null;
1835
1836
  }
1836
1837
  set model(value) {
@@ -1864,6 +1865,7 @@ var ExcelTS = (function(exports) {
1864
1865
  else delete this.height;
1865
1866
  this.hidden = value.hidden;
1866
1867
  this.outlineLevel = value.outlineLevel || 0;
1868
+ this.dyDescent = value.dyDescent;
1867
1869
  this.style = value.style && JSON.parse(JSON.stringify(value.style)) || {};
1868
1870
  }
1869
1871
  };
@@ -1904,7 +1906,8 @@ var ExcelTS = (function(exports) {
1904
1906
  width: this.width,
1905
1907
  style: this.style,
1906
1908
  hidden: this.hidden,
1907
- outlineLevel: this.outlineLevel
1909
+ outlineLevel: this.outlineLevel,
1910
+ bestFit: this.bestFit
1908
1911
  };
1909
1912
  }
1910
1913
  set defn(value) {
@@ -1916,12 +1919,14 @@ var ExcelTS = (function(exports) {
1916
1919
  else this.style = {};
1917
1920
  this.header = value.header;
1918
1921
  this._hidden = !!value.hidden;
1922
+ this.bestFit = value.bestFit;
1919
1923
  } else {
1920
1924
  delete this._header;
1921
1925
  delete this._key;
1922
1926
  delete this.width;
1923
1927
  this.style = {};
1924
1928
  this.outlineLevel = 0;
1929
+ delete this.bestFit;
1925
1930
  }
1926
1931
  }
1927
1932
  /**
@@ -1993,12 +1998,13 @@ var ExcelTS = (function(exports) {
1993
1998
  return this.width === other.width && this.hidden === other.hidden && this.outlineLevel === other.outlineLevel && isEqual(this.style, other.style);
1994
1999
  }
1995
2000
  equivalentToModel(model) {
1996
- return this.width === model.width && this.hidden === model.hidden && this.outlineLevel === model.outlineLevel && isEqual(this.style, model.style);
2001
+ return this.width === model.width && this.hidden === model.hidden && this.outlineLevel === model.outlineLevel && this.bestFit === model.bestFit && isEqual(this.style, model.style);
1997
2002
  }
1998
2003
  get isDefault() {
1999
2004
  if (this.isCustomWidth) return false;
2000
2005
  if (this.hidden) return false;
2001
2006
  if (this.outlineLevel) return false;
2007
+ if (this.bestFit) return false;
2002
2008
  const s = this.style;
2003
2009
  if (s && (s.font || s.numFmt || s.alignment || s.border || s.fill || s.protection)) return false;
2004
2010
  return true;
@@ -2126,7 +2132,8 @@ var ExcelTS = (function(exports) {
2126
2132
  isCustomWidth: column.isCustomWidth,
2127
2133
  hidden: column.hidden,
2128
2134
  outlineLevel: column.outlineLevel,
2129
- collapsed: column.collapsed
2135
+ collapsed: column.collapsed,
2136
+ bestFit: column.bestFit
2130
2137
  };
2131
2138
  cols.push(col);
2132
2139
  } else col.max = index + 1;
@@ -2261,12 +2268,12 @@ var ExcelTS = (function(exports) {
2261
2268
  default: throw new Error("Invalid Image Type");
2262
2269
  }
2263
2270
  }
2264
- set model({ type, imageId, range: range$1, hyperlinks }) {
2271
+ set model({ type, imageId, range, hyperlinks }) {
2265
2272
  this.type = type;
2266
2273
  this.imageId = imageId;
2267
2274
  if (type === "image") {
2268
- if (typeof range$1 === "string") {
2269
- const decoded = colCache.decode(range$1);
2275
+ if (typeof range === "string") {
2276
+ const decoded = colCache.decode(range);
2270
2277
  if ("top" in decoded) this.range = {
2271
2278
  tl: new Anchor(this.worksheet, {
2272
2279
  col: decoded.left,
@@ -2278,12 +2285,12 @@ var ExcelTS = (function(exports) {
2278
2285
  }, 0),
2279
2286
  editAs: "oneCell"
2280
2287
  };
2281
- } else if (range$1) this.range = {
2282
- tl: new Anchor(this.worksheet, range$1.tl, 0),
2283
- br: range$1.br ? new Anchor(this.worksheet, range$1.br, 0) : void 0,
2284
- ext: range$1.ext,
2285
- editAs: range$1.editAs,
2286
- hyperlinks: hyperlinks || ("hyperlinks" in range$1 ? range$1.hyperlinks : void 0)
2288
+ } else if (range) this.range = {
2289
+ tl: new Anchor(this.worksheet, range.tl, 0),
2290
+ br: range.br ? new Anchor(this.worksheet, range.br, 0) : void 0,
2291
+ ext: range.ext,
2292
+ editAs: range.editAs,
2293
+ hyperlinks: hyperlinks || ("hyperlinks" in range ? range.hyperlinks : void 0)
2287
2294
  };
2288
2295
  }
2289
2296
  }
@@ -2395,17 +2402,17 @@ var ExcelTS = (function(exports) {
2395
2402
  }
2396
2403
  validate() {
2397
2404
  const { table } = this;
2398
- const assign$1 = (o, name, dflt) => {
2405
+ const assign = (o, name, dflt) => {
2399
2406
  if (o[name] === void 0) o[name] = dflt;
2400
2407
  };
2401
- assign$1(table, "headerRow", true);
2402
- assign$1(table, "totalsRow", false);
2403
- assign$1(table, "style", {});
2404
- assign$1(table.style, "theme", "TableStyleMedium2");
2405
- assign$1(table.style, "showFirstColumn", false);
2406
- assign$1(table.style, "showLastColumn", false);
2407
- assign$1(table.style, "showRowStripes", false);
2408
- assign$1(table.style, "showColumnStripes", false);
2408
+ assign(table, "headerRow", true);
2409
+ assign(table, "totalsRow", false);
2410
+ assign(table, "style", {});
2411
+ assign(table.style, "theme", "TableStyleMedium2");
2412
+ assign(table.style, "showFirstColumn", false);
2413
+ assign(table.style, "showLastColumn", false);
2414
+ assign(table.style, "showRowStripes", false);
2415
+ assign(table.style, "showColumnStripes", false);
2409
2416
  const assert = (test, message) => {
2410
2417
  if (!test) throw new Error(message);
2411
2418
  };
@@ -2421,9 +2428,9 @@ var ExcelTS = (function(exports) {
2421
2428
  table.tableRef = colCache.encode(row, col, row + tableHeight - 1, col + width - 1);
2422
2429
  table.columns.forEach((column, i) => {
2423
2430
  assert(!!column.name, `Column ${i} must have a name`);
2424
- if (i === 0) assign$1(column, "totalsRowLabel", "Total");
2431
+ if (i === 0) assign(column, "totalsRowLabel", "Total");
2425
2432
  else {
2426
- assign$1(column, "totalsRowFunction", "none");
2433
+ assign(column, "totalsRowFunction", "none");
2427
2434
  column.totalsRowFormula = this.getFormula(column) || void 0;
2428
2435
  }
2429
2436
  });
@@ -2654,8 +2661,8 @@ var ExcelTS = (function(exports) {
2654
2661
  constructor(model) {
2655
2662
  this.model = model || {};
2656
2663
  }
2657
- add(address, validation$2) {
2658
- return this.model[address] = validation$2;
2664
+ add(address, validation) {
2665
+ return this.model[address] = validation;
2659
2666
  }
2660
2667
  find(address) {
2661
2668
  const direct = this.model[address];
@@ -2699,9 +2706,9 @@ var ExcelTS = (function(exports) {
2699
2706
  /** Default end row offset in EMUs (~20 pixels) */
2700
2707
  const DEFAULT_END_ROW_OFF = 190500;
2701
2708
  var FormCheckbox = class FormCheckbox {
2702
- constructor(worksheet, range$1, options) {
2709
+ constructor(worksheet, range, options) {
2703
2710
  this.worksheet = worksheet;
2704
- const { tl, br } = this._parseRange(range$1);
2711
+ const { tl, br } = this._parseRange(range);
2705
2712
  const shapeId = 1025 + (worksheet.formControls?.length || 0);
2706
2713
  let link;
2707
2714
  if (options?.link) link = this._toAbsoluteRef(options.link);
@@ -2764,11 +2771,11 @@ var ExcelTS = (function(exports) {
2764
2771
  /**
2765
2772
  * Parse range input into anchor positions
2766
2773
  */
2767
- _parseRange(range$1) {
2774
+ _parseRange(range) {
2768
2775
  let tl;
2769
2776
  let br;
2770
- if (typeof range$1 === "string") if (range$1.includes(":")) {
2771
- const decoded = colCache.decode(range$1);
2777
+ if (typeof range === "string") if (range.includes(":")) {
2778
+ const decoded = colCache.decode(range);
2772
2779
  if ("top" in decoded) if (decoded.left === decoded.right && decoded.top === decoded.bottom) {
2773
2780
  const col = decoded.left - 1;
2774
2781
  const row = decoded.top - 1;
@@ -2813,7 +2820,7 @@ var ExcelTS = (function(exports) {
2813
2820
  };
2814
2821
  }
2815
2822
  } else {
2816
- const decoded = colCache.decodeAddress(range$1);
2823
+ const decoded = colCache.decodeAddress(range);
2817
2824
  tl = {
2818
2825
  col: decoded.col - 1,
2819
2826
  colOff: DEFAULT_COL_OFF,
@@ -2827,22 +2834,22 @@ var ExcelTS = (function(exports) {
2827
2834
  rowOff: DEFAULT_END_ROW_OFF
2828
2835
  };
2829
2836
  }
2830
- else if ("startCol" in range$1) {
2837
+ else if ("startCol" in range) {
2831
2838
  tl = {
2832
- col: range$1.startCol,
2833
- colOff: range$1.startColOff ?? DEFAULT_COL_OFF,
2834
- row: range$1.startRow,
2835
- rowOff: range$1.startRowOff ?? DEFAULT_ROW_OFF
2839
+ col: range.startCol,
2840
+ colOff: range.startColOff ?? DEFAULT_COL_OFF,
2841
+ row: range.startRow,
2842
+ rowOff: range.startRowOff ?? DEFAULT_ROW_OFF
2836
2843
  };
2837
2844
  br = {
2838
- col: range$1.endCol,
2839
- colOff: range$1.endColOff ?? DEFAULT_END_COL_OFF,
2840
- row: range$1.endRow,
2841
- rowOff: range$1.endRowOff ?? DEFAULT_END_ROW_OFF
2845
+ col: range.endCol,
2846
+ colOff: range.endColOff ?? DEFAULT_END_COL_OFF,
2847
+ row: range.endRow,
2848
+ rowOff: range.endRowOff ?? DEFAULT_END_ROW_OFF
2842
2849
  };
2843
2850
  } else {
2844
- if (typeof range$1.tl === "string") {
2845
- const decoded = colCache.decodeAddress(range$1.tl);
2851
+ if (typeof range.tl === "string") {
2852
+ const decoded = colCache.decodeAddress(range.tl);
2846
2853
  tl = {
2847
2854
  col: decoded.col - 1,
2848
2855
  colOff: DEFAULT_COL_OFF,
@@ -2850,13 +2857,13 @@ var ExcelTS = (function(exports) {
2850
2857
  rowOff: DEFAULT_ROW_OFF
2851
2858
  };
2852
2859
  } else tl = {
2853
- col: range$1.tl.col,
2854
- colOff: range$1.tl.colOff ?? DEFAULT_COL_OFF,
2855
- row: range$1.tl.row,
2856
- rowOff: range$1.tl.rowOff ?? DEFAULT_ROW_OFF
2860
+ col: range.tl.col,
2861
+ colOff: range.tl.colOff ?? DEFAULT_COL_OFF,
2862
+ row: range.tl.row,
2863
+ rowOff: range.tl.rowOff ?? DEFAULT_ROW_OFF
2857
2864
  };
2858
- if (range$1.br) if (typeof range$1.br === "string") {
2859
- const decoded = colCache.decodeAddress(range$1.br);
2865
+ if (range.br) if (typeof range.br === "string") {
2866
+ const decoded = colCache.decodeAddress(range.br);
2860
2867
  br = {
2861
2868
  col: decoded.col - 1,
2862
2869
  colOff: DEFAULT_END_COL_OFF,
@@ -2864,10 +2871,10 @@ var ExcelTS = (function(exports) {
2864
2871
  rowOff: DEFAULT_END_ROW_OFF
2865
2872
  };
2866
2873
  } else br = {
2867
- col: range$1.br.col,
2868
- colOff: range$1.br.colOff ?? DEFAULT_END_COL_OFF,
2869
- row: range$1.br.row,
2870
- rowOff: range$1.br.rowOff ?? DEFAULT_END_ROW_OFF
2874
+ col: range.br.col,
2875
+ colOff: range.br.colOff ?? DEFAULT_END_COL_OFF,
2876
+ row: range.br.row,
2877
+ rowOff: range.br.rowOff ?? DEFAULT_END_ROW_OFF
2871
2878
  };
2872
2879
  else br = {
2873
2880
  col: tl.col + 2,
@@ -3080,9 +3087,9 @@ var ExcelTS = (function(exports) {
3080
3087
  if (latin1Decoder) try {
3081
3088
  return btoa(latin1Decoder.decode(bytes));
3082
3089
  } catch {}
3083
- const CHUNK_SIZE$1 = 32768;
3090
+ const CHUNK_SIZE = 32768;
3084
3091
  const chunks = [];
3085
- for (let i = 0; i < bytes.length; i += CHUNK_SIZE$1) chunks.push(String.fromCharCode.apply(null, bytes.subarray(i, i + CHUNK_SIZE$1)));
3092
+ for (let i = 0; i < bytes.length; i += CHUNK_SIZE) chunks.push(String.fromCharCode.apply(null, bytes.subarray(i, i + CHUNK_SIZE)));
3086
3093
  return btoa(chunks.join(""));
3087
3094
  }
3088
3095
  /**
@@ -3512,11 +3519,11 @@ var ExcelTS = (function(exports) {
3512
3519
  this._didRead = true;
3513
3520
  if (this._bufferedLength() > 0) {
3514
3521
  if (this.objectMode || size === void 0) {
3515
- const chunk$1 = this._bufferShift();
3516
- if (!this.objectMode) this._bufferSize -= this._getChunkSize(chunk$1);
3517
- const decoded$1 = this._applyEncoding(chunk$1);
3522
+ const chunk = this._bufferShift();
3523
+ if (!this.objectMode) this._bufferSize -= this._getChunkSize(chunk);
3524
+ const decoded = this._applyEncoding(chunk);
3518
3525
  if (this._ended && this._bufferedLength() === 0) queueMicrotask(() => this._emitEndOnce());
3519
- return decoded$1;
3526
+ return decoded;
3520
3527
  }
3521
3528
  const chunk = this._bufferShift();
3522
3529
  if (!this.objectMode) this._bufferSize -= this._getChunkSize(chunk);
@@ -3924,8 +3931,8 @@ var ExcelTS = (function(exports) {
3924
3931
  while (true) {
3925
3932
  if (streamError) throw streamError;
3926
3933
  if (dataQueueIndex < dataQueue.length) {
3927
- const chunk$1 = dataQueue[dataQueueIndex++];
3928
- queuedSize -= chunkSizeForBackpressure(chunk$1);
3934
+ const chunk = dataQueue[dataQueueIndex++];
3935
+ queuedSize -= chunkSizeForBackpressure(chunk);
3929
3936
  if (dataQueueIndex >= 1024 && dataQueueIndex * 2 >= dataQueue.length) {
3930
3937
  dataQueue.splice(0, dataQueueIndex);
3931
3938
  dataQueueIndex = 0;
@@ -3934,7 +3941,7 @@ var ExcelTS = (function(exports) {
3934
3941
  pausedByIterator = false;
3935
3942
  this.resume();
3936
3943
  }
3937
- yield chunk$1;
3944
+ yield chunk;
3938
3945
  continue;
3939
3946
  }
3940
3947
  if (done) break;
@@ -6043,8 +6050,8 @@ var ExcelTS = (function(exports) {
6043
6050
  }
6044
6051
  }
6045
6052
  }
6046
- fillFormula(range$1, formula, results, shareType = "shared") {
6047
- const { top, left, bottom, right } = colCache.decode(range$1);
6053
+ fillFormula(range, formula, results, shareType = "shared") {
6054
+ const { top, left, bottom, right } = colCache.decode(range);
6048
6055
  const width = right - left + 1;
6049
6056
  const masterAddress = colCache.encodeAddress(top, left);
6050
6057
  const isShared = shareType === "shared";
@@ -6059,7 +6066,7 @@ var ExcelTS = (function(exports) {
6059
6066
  cell.value = {
6060
6067
  shareType,
6061
6068
  formula,
6062
- ref: range$1,
6069
+ ref: range,
6063
6070
  result: getResult(r, c)
6064
6071
  };
6065
6072
  first = false;
@@ -6072,11 +6079,11 @@ var ExcelTS = (function(exports) {
6072
6079
  * Using the image id from `Workbook.addImage`,
6073
6080
  * embed an image within the worksheet to cover a range
6074
6081
  */
6075
- addImage(imageId, range$1) {
6082
+ addImage(imageId, range) {
6076
6083
  const model = {
6077
6084
  type: "image",
6078
6085
  imageId: String(imageId),
6079
- range: range$1
6086
+ range
6080
6087
  };
6081
6088
  this._media.push(new Image(this, model));
6082
6089
  }
@@ -6121,8 +6128,8 @@ var ExcelTS = (function(exports) {
6121
6128
  * checked: false
6122
6129
  * });
6123
6130
  */
6124
- addFormCheckbox(range$1, options) {
6125
- const checkbox = new FormCheckbox(this, range$1, options);
6131
+ addFormCheckbox(range, options) {
6132
+ const checkbox = new FormCheckbox(this, range, options);
6126
6133
  this.formControls.push(checkbox);
6127
6134
  return checkbox;
6128
6135
  }
@@ -6471,7 +6478,7 @@ var ExcelTS = (function(exports) {
6471
6478
  _explore(matrix, cell) {
6472
6479
  cell.mark = false;
6473
6480
  const { sheetName } = cell;
6474
- const range$1 = new Range(cell.row, cell.col, cell.row, cell.col, sheetName);
6481
+ const range = new Range(cell.row, cell.col, cell.row, cell.col, sheetName);
6475
6482
  let x;
6476
6483
  let y;
6477
6484
  const getCell = (row, col) => {
@@ -6480,7 +6487,7 @@ var ExcelTS = (function(exports) {
6480
6487
  function vGrow(yy, edge) {
6481
6488
  const c = getCell(yy, cell.col);
6482
6489
  if (!c || !c.mark) return false;
6483
- range$1[edge] = yy;
6490
+ range[edge] = yy;
6484
6491
  c.mark = false;
6485
6492
  return true;
6486
6493
  }
@@ -6488,18 +6495,18 @@ var ExcelTS = (function(exports) {
6488
6495
  for (y = cell.row + 1; vGrow(y, "bottom"); y++);
6489
6496
  function hGrow(xx, edge) {
6490
6497
  const cells = [];
6491
- for (y = range$1.top; y <= range$1.bottom; y++) {
6498
+ for (y = range.top; y <= range.bottom; y++) {
6492
6499
  const c = getCell(y, xx);
6493
6500
  if (c && c.mark) cells.push(c);
6494
6501
  else return false;
6495
6502
  }
6496
- range$1[edge] = xx;
6503
+ range[edge] = xx;
6497
6504
  for (let i = 0; i < cells.length; i++) cells[i].mark = false;
6498
6505
  return true;
6499
6506
  }
6500
6507
  for (x = cell.col - 1; hGrow(x, "left"); x--);
6501
6508
  for (x = cell.col + 1; hGrow(x, "right"); x++);
6502
- return range$1;
6509
+ return range;
6503
6510
  }
6504
6511
  getRanges(name, matrix) {
6505
6512
  matrix = matrix || this.matrixMap[name];
@@ -6512,7 +6519,7 @@ var ExcelTS = (function(exports) {
6512
6519
  });
6513
6520
  return {
6514
6521
  name,
6515
- ranges: matrix.map((cell) => cell.mark && this._explore(matrix, cell)).filter(Boolean).map((range$1) => range$1.$shortRange)
6522
+ ranges: matrix.map((cell) => cell.mark && this._explore(matrix, cell)).filter(Boolean).map((range) => range.$shortRange)
6516
6523
  };
6517
6524
  }
6518
6525
  normaliseMatrix(matrix, sheetName) {
@@ -7614,9 +7621,9 @@ var ExcelTS = (function(exports) {
7614
7621
  reconcile(_model, _options) {}
7615
7622
  reset() {
7616
7623
  this.model = null;
7617
- if (this.map) Object.values(this.map).forEach((xform$1) => {
7618
- if (xform$1 instanceof BaseXform) xform$1.reset();
7619
- else if (xform$1.xform) xform$1.xform.reset();
7624
+ if (this.map) Object.values(this.map).forEach((xform) => {
7625
+ if (xform instanceof BaseXform) xform.reset();
7626
+ else if (xform.xform) xform.xform.reset();
7620
7627
  });
7621
7628
  }
7622
7629
  mergeModel(obj) {
@@ -9006,12 +9013,13 @@ var ExcelTS = (function(exports) {
9006
9013
  borderId: model.borderId || 0
9007
9014
  });
9008
9015
  if (this.xfId) xmlStream.addAttribute("xfId", model.xfId || 0);
9009
- if (model.numFmtId) xmlStream.addAttribute("applyNumberFormat", "1");
9010
- if (model.fontId) xmlStream.addAttribute("applyFont", "1");
9011
- if (model.fillId) xmlStream.addAttribute("applyFill", "1");
9012
- if (model.borderId) xmlStream.addAttribute("applyBorder", "1");
9013
- if (model.alignment) xmlStream.addAttribute("applyAlignment", "1");
9014
- if (model.protection) xmlStream.addAttribute("applyProtection", "1");
9016
+ if (model.applyNumberFormat || model.numFmtId) xmlStream.addAttribute("applyNumberFormat", "1");
9017
+ if (model.applyFont || model.fontId) xmlStream.addAttribute("applyFont", "1");
9018
+ if (model.applyFill || model.fillId) xmlStream.addAttribute("applyFill", "1");
9019
+ if (model.applyBorder || model.borderId) xmlStream.addAttribute("applyBorder", "1");
9020
+ if (model.applyAlignment || model.alignment) xmlStream.addAttribute("applyAlignment", "1");
9021
+ if (model.applyProtection || model.protection) xmlStream.addAttribute("applyProtection", "1");
9022
+ if (model.pivotButton) xmlStream.addAttribute("pivotButton", "1");
9015
9023
  /**
9016
9024
  * Rendering tags causes close of XML stream.
9017
9025
  * Therefore adding attributes must be done before rendering tags.
@@ -9044,6 +9052,15 @@ var ExcelTS = (function(exports) {
9044
9052
  borderId: parseInt(node.attributes.borderId, 10)
9045
9053
  };
9046
9054
  if (this.xfId) this.model.xfId = parseInt(node.attributes.xfId, 10);
9055
+ if (node.attributes.pivotButton === "1") this.model.pivotButton = true;
9056
+ for (const flag of [
9057
+ "applyNumberFormat",
9058
+ "applyFont",
9059
+ "applyFill",
9060
+ "applyBorder",
9061
+ "applyAlignment",
9062
+ "applyProtection"
9063
+ ]) if (node.attributes[flag] === "1") this.model[flag] = true;
9047
9064
  return true;
9048
9065
  case "alignment":
9049
9066
  this.parser = this.map.alignment;
@@ -9237,6 +9254,13 @@ var ExcelTS = (function(exports) {
9237
9254
  this.weakMap = /* @__PURE__ */ new WeakMap();
9238
9255
  this._hasCheckboxes = false;
9239
9256
  }
9257
+ /**
9258
+ * Set the default font to use when no font is explicitly specified.
9259
+ * This preserves the original file's default font during round-trip.
9260
+ */
9261
+ setDefaultFont(font) {
9262
+ this.defaultFont = font;
9263
+ }
9240
9264
  render(xmlStream, model) {
9241
9265
  const renderModel = model || this.model;
9242
9266
  xmlStream.openXml(XmlStream.StdDocAttributes);
@@ -9249,7 +9273,7 @@ var ExcelTS = (function(exports) {
9249
9273
  });
9250
9274
  xmlStream.closeNode();
9251
9275
  }
9252
- if (!renderModel.fonts.length) this._addFont({
9276
+ if (!renderModel.fonts.length) this._addFont(this.defaultFont || {
9253
9277
  size: 11,
9254
9278
  color: { theme: 1 },
9255
9279
  name: "Calibri",
@@ -9332,8 +9356,8 @@ var ExcelTS = (function(exports) {
9332
9356
  switch (name) {
9333
9357
  case "styleSheet": {
9334
9358
  this.model = {};
9335
- const add = (propName, xform$1) => {
9336
- if (xform$1.model && xform$1.model.length) this.model[propName] = xform$1.model;
9359
+ const add = (propName, xform) => {
9360
+ if (xform.model && xform.model.length) this.model[propName] = xform.model;
9337
9361
  };
9338
9362
  add("numFmts", this.map.numFmts);
9339
9363
  add("fonts", this.map.fonts);
@@ -9341,6 +9365,7 @@ var ExcelTS = (function(exports) {
9341
9365
  add("borders", this.map.borders);
9342
9366
  add("styles", this.map.cellXfs);
9343
9367
  add("dxfs", this.map.dxfs);
9368
+ if (this.map.fonts.model && this.map.fonts.model.length > 0) this.defaultFont = this.map.fonts.model[0];
9344
9369
  this.index = {
9345
9370
  model: [],
9346
9371
  numFmt: {}
@@ -9358,7 +9383,7 @@ var ExcelTS = (function(exports) {
9358
9383
  }
9359
9384
  addStyleModel(model, cellType) {
9360
9385
  if (!model) return 0;
9361
- if (!this.model.fonts.length) this._addFont({
9386
+ if (!this.model.fonts.length) this._addFont(this.defaultFont || {
9362
9387
  size: 11,
9363
9388
  color: { theme: 1 },
9364
9389
  name: "Calibri",
@@ -9383,6 +9408,15 @@ var ExcelTS = (function(exports) {
9383
9408
  if (model.fill) style.fillId = this._addFill(model.fill);
9384
9409
  if (model.alignment) style.alignment = model.alignment;
9385
9410
  if (model.protection) style.protection = model.protection;
9411
+ for (const flag of [
9412
+ "pivotButton",
9413
+ "applyNumberFormat",
9414
+ "applyFont",
9415
+ "applyFill",
9416
+ "applyBorder",
9417
+ "applyAlignment",
9418
+ "applyProtection"
9419
+ ]) if (model[flag]) style[flag] = true;
9386
9420
  if (type === Enums.ValueType.Checkbox) {
9387
9421
  this._hasCheckboxes = true;
9388
9422
  style.alignment = style.alignment || {};
@@ -9414,6 +9448,15 @@ var ExcelTS = (function(exports) {
9414
9448
  addStyle("fill", this.model.fills, style.fillId);
9415
9449
  if (style.alignment) model.alignment = style.alignment;
9416
9450
  if (style.protection) model.protection = style.protection;
9451
+ for (const flag of [
9452
+ "pivotButton",
9453
+ "applyNumberFormat",
9454
+ "applyFont",
9455
+ "applyFill",
9456
+ "applyBorder",
9457
+ "applyAlignment",
9458
+ "applyProtection"
9459
+ ]) if (style[flag]) model[flag] = true;
9417
9460
  return model;
9418
9461
  }
9419
9462
  addDxfStyle(style) {
@@ -10653,12 +10696,12 @@ var ExcelTS = (function(exports) {
10653
10696
  const cellRangeRegexp = /^[$]?[A-Za-z]{1,3}[$]?\d+(:[$]?[A-Za-z]{1,3}[$]?\d+)?$/;
10654
10697
  const rowRangeRegexp = /^[$]?\d+:[$]?\d+$/;
10655
10698
  const colRangeRegexp = /^[$]?[A-Za-z]{1,3}:[$]?[A-Za-z]{1,3}$/;
10656
- function isValidRange(range$1) {
10657
- if (range$1.startsWith("{") || range$1.endsWith("}")) return false;
10658
- const cellRef = range$1.split("!").pop() || "";
10699
+ function isValidRange(range) {
10700
+ if (range.startsWith("{") || range.endsWith("}")) return false;
10701
+ const cellRef = range.split("!").pop() || "";
10659
10702
  if (!cellRangeRegexp.test(cellRef) && !rowRangeRegexp.test(cellRef) && !colRangeRegexp.test(cellRef)) return false;
10660
10703
  try {
10661
- const decoded = colCache.decodeEx(range$1);
10704
+ const decoded = colCache.decodeEx(range);
10662
10705
  if ("row" in decoded && typeof decoded.row === "number" || "top" in decoded && typeof decoded.top === "number" || "left" in decoded && typeof decoded.left === "number") return true;
10663
10706
  return false;
10664
10707
  } catch {
@@ -10974,8 +11017,8 @@ var ExcelTS = (function(exports) {
10974
11017
  worksheet = worksheets[definedName.localSheetId];
10975
11018
  if (worksheet) {
10976
11019
  if (!worksheet.pageSetup) worksheet.pageSetup = {};
10977
- const range$1 = colCache.decodeEx(definedName.ranges[0]);
10978
- worksheet.pageSetup.printArea = worksheet.pageSetup.printArea ? `${worksheet.pageSetup.printArea}&&${range$1.dimensions}` : range$1.dimensions;
11020
+ const range = colCache.decodeEx(definedName.ranges[0]);
11021
+ worksheet.pageSetup.printArea = worksheet.pageSetup.printArea ? `${worksheet.pageSetup.printArea}&&${range.dimensions}` : range.dimensions;
10979
11022
  }
10980
11023
  } else if (definedName.name === "_xlnm.Print_Titles") {
10981
11024
  worksheet = worksheets[definedName.localSheetId];
@@ -10985,13 +11028,13 @@ var ExcelTS = (function(exports) {
10985
11028
  const dollarRegex = /\$/g;
10986
11029
  const rowRangeMatches = rangeString.match(/\$\d+:\$\d+/);
10987
11030
  if (rowRangeMatches && rowRangeMatches.length) {
10988
- const range$1 = rowRangeMatches[0];
10989
- worksheet.pageSetup.printTitlesRow = range$1.replace(dollarRegex, "");
11031
+ const range = rowRangeMatches[0];
11032
+ worksheet.pageSetup.printTitlesRow = range.replace(dollarRegex, "");
10990
11033
  }
10991
11034
  const columnRangeMatches = rangeString.match(/\$[A-Z]+:\$[A-Z]+/);
10992
11035
  if (columnRangeMatches && columnRangeMatches.length) {
10993
- const range$1 = columnRangeMatches[0];
10994
- worksheet.pageSetup.printTitlesColumn = range$1.replace(dollarRegex, "");
11036
+ const range = columnRangeMatches[0];
11037
+ worksheet.pageSetup.printTitlesColumn = range.replace(dollarRegex, "");
10995
11038
  }
10996
11039
  }
10997
11040
  } else definedNames.push(definedName);
@@ -11055,8 +11098,8 @@ var ExcelTS = (function(exports) {
11055
11098
  add(merge) {
11056
11099
  if (this.merges[merge.master]) this.merges[merge.master].expandToAddress(merge.address);
11057
11100
  else {
11058
- const range$1 = `${merge.master}:${merge.address}`;
11059
- this.merges[merge.master] = new Range(range$1);
11101
+ const range = `${merge.master}:${merge.address}`;
11102
+ this.merges[merge.master] = new Range(range);
11060
11103
  }
11061
11104
  }
11062
11105
  get mergeCells() {
@@ -11079,8 +11122,8 @@ var ExcelTS = (function(exports) {
11079
11122
  });
11080
11123
  }
11081
11124
  getMasterAddress(address) {
11082
- const range$1 = this.hash[address];
11083
- return range$1 && range$1.tl;
11125
+ const range = this.hash[address];
11126
+ return range && range.tl;
11084
11127
  }
11085
11128
  };
11086
11129
 
@@ -11472,6 +11515,7 @@ var ExcelTS = (function(exports) {
11472
11515
  xmlStream.addAttribute("s", model.styleId);
11473
11516
  xmlStream.addAttribute("customFormat", "1");
11474
11517
  }
11518
+ if (model.dyDescent !== void 0) xmlStream.addAttribute("x14ac:dyDescent", model.dyDescent);
11475
11519
  if (model.outlineLevel) xmlStream.addAttribute("outlineLevel", model.outlineLevel);
11476
11520
  if (model.collapsed) xmlStream.addAttribute("collapsed", "1");
11477
11521
  const cellXform = this.map.c;
@@ -11501,6 +11545,7 @@ var ExcelTS = (function(exports) {
11501
11545
  if (node.attributes.ht) model.height = parseFloat(node.attributes.ht);
11502
11546
  if (node.attributes.outlineLevel) model.outlineLevel = parseInt(node.attributes.outlineLevel, 10);
11503
11547
  if (parseBoolean(node.attributes.collapsed)) model.collapsed = true;
11548
+ if (node.attributes["x14ac:dyDescent"] !== void 0) model.dyDescent = parseFloat(node.attributes["x14ac:dyDescent"]);
11504
11549
  return true;
11505
11550
  }
11506
11551
  this.parser = this.map[node.name];
@@ -12001,10 +12046,10 @@ var ExcelTS = (function(exports) {
12001
12046
  defaultRowHeight: model.defaultRowHeight,
12002
12047
  outlineLevelRow: model.outlineLevelRow || void 0,
12003
12048
  outlineLevelCol: model.outlineLevelCol || void 0,
12004
- "x14ac:dyDescent": model.dyDescent || void 0
12049
+ "x14ac:dyDescent": model.dyDescent !== void 0 && model.dyDescent !== 0 ? model.dyDescent : void 0
12005
12050
  };
12006
12051
  if (model.defaultColWidth) attributes.defaultColWidth = model.defaultColWidth;
12007
- if (!model.defaultRowHeight || model.defaultRowHeight !== 15) attributes.customHeight = "1";
12052
+ if (model.customHeight) attributes.customHeight = "1";
12008
12053
  if (Object.values(attributes).some((value) => value !== void 0)) xmlStream.leafNode("sheetFormatPr", attributes);
12009
12054
  }
12010
12055
  }
@@ -12012,11 +12057,12 @@ var ExcelTS = (function(exports) {
12012
12057
  if (node.name === "sheetFormatPr") {
12013
12058
  this.model = {
12014
12059
  defaultRowHeight: parseFloat(node.attributes.defaultRowHeight || "0"),
12015
- dyDescent: parseFloat(node.attributes["x14ac:dyDescent"] || "0"),
12060
+ dyDescent: node.attributes["x14ac:dyDescent"] !== void 0 ? parseFloat(node.attributes["x14ac:dyDescent"]) : void 0,
12016
12061
  outlineLevelRow: parseInt(node.attributes.outlineLevelRow || "0", 10),
12017
12062
  outlineLevelCol: parseInt(node.attributes.outlineLevelCol || "0", 10)
12018
12063
  };
12019
12064
  if (node.attributes.defaultColWidth) this.model.defaultColWidth = parseFloat(node.attributes.defaultColWidth);
12065
+ if (node.attributes.customHeight === "1") this.model.customHeight = true;
12020
12066
  return true;
12021
12067
  }
12022
12068
  return false;
@@ -12059,8 +12105,8 @@ var ExcelTS = (function(exports) {
12059
12105
  add("showRuler", "0", model.showRuler === false);
12060
12106
  add("showRowColHeaders", "0", model.showRowColHeaders === false);
12061
12107
  add("showGridLines", "0", model.showGridLines === false);
12062
- add("zoomScale", model.zoomScale, model.zoomScale);
12063
- add("zoomScaleNormal", model.zoomScaleNormal, model.zoomScaleNormal);
12108
+ add("zoomScale", model.zoomScale, model.zoomScale !== void 0 && model.zoomScale !== 100);
12109
+ add("zoomScaleNormal", model.zoomScaleNormal, model.zoomScaleNormal !== void 0 && model.zoomScaleNormal !== 100);
12064
12110
  add("view", model.style, model.style);
12065
12111
  let topLeftCell;
12066
12112
  let xSplit;
@@ -12156,6 +12202,7 @@ var ExcelTS = (function(exports) {
12156
12202
  model = this.model = {
12157
12203
  workbookViewId: this.sheetView.workbookViewId,
12158
12204
  rightToLeft: this.sheetView.rightToLeft,
12205
+ tabSelected: this.sheetView.tabSelected,
12159
12206
  state: VIEW_STATES[this.pane.state] || "split",
12160
12207
  xSplit: this.pane.xSplit,
12161
12208
  ySplit: this.pane.ySplit,
@@ -12174,6 +12221,7 @@ var ExcelTS = (function(exports) {
12174
12221
  model = this.model = {
12175
12222
  workbookViewId: this.sheetView.workbookViewId,
12176
12223
  rightToLeft: this.sheetView.rightToLeft,
12224
+ tabSelected: this.sheetView.tabSelected,
12177
12225
  state: "normal",
12178
12226
  showRuler: this.sheetView.showRuler,
12179
12227
  showRowColHeaders: this.sheetView.showRowColHeaders,
@@ -14059,7 +14107,8 @@ var ExcelTS = (function(exports) {
14059
14107
  defaultRowHeight: model.properties.defaultRowHeight,
14060
14108
  dyDescent: model.properties.dyDescent,
14061
14109
  outlineLevelCol: model.properties.outlineLevelCol,
14062
- outlineLevelRow: model.properties.outlineLevelRow
14110
+ outlineLevelRow: model.properties.outlineLevelRow,
14111
+ customHeight: model.properties.customHeight
14063
14112
  } : void 0;
14064
14113
  if (model.properties && model.properties.defaultColWidth) sheetFormatPropertiesModel.defaultColWidth = model.properties.defaultColWidth;
14065
14114
  const sheetPropertiesModel = {
@@ -14155,8 +14204,8 @@ var ExcelTS = (function(exports) {
14155
14204
  return true;
14156
14205
  }
14157
14206
  if (node.name === "worksheet") {
14158
- Object.values(this.map).forEach((xform$1) => {
14159
- xform$1.reset();
14207
+ Object.values(this.map).forEach((xform) => {
14208
+ xform.reset();
14160
14209
  });
14161
14210
  return true;
14162
14211
  }
@@ -16195,11 +16244,13 @@ var ExcelTS = (function(exports) {
16195
16244
  for (const item of model.rowItems) this.renderRowColItem(xmlStream, item);
16196
16245
  xmlStream.closeNode();
16197
16246
  } else xmlStream.writeXml("<rowItems count=\"1\"><i t=\"grand\"><x/></i></rowItems>");
16198
- const colFieldCount = model.colFields.length === 0 ? 1 : model.colFields.length;
16199
- xmlStream.openNode("colFields", { count: colFieldCount });
16200
- if (model.colFields.length === 0) xmlStream.leafNode("field", { x: -2 });
16201
- else for (const fieldIndex of model.colFields) xmlStream.leafNode("field", { x: fieldIndex });
16202
- xmlStream.closeNode();
16247
+ if (model.hasColFields || model.colFields.length > 0) {
16248
+ const colFieldCount = model.colFields.length === 0 ? 1 : model.colFields.length;
16249
+ xmlStream.openNode("colFields", { count: colFieldCount });
16250
+ if (model.colFields.length === 0) xmlStream.leafNode("field", { x: -2 });
16251
+ else for (const fieldIndex of model.colFields) xmlStream.leafNode("field", { x: fieldIndex });
16252
+ xmlStream.closeNode();
16253
+ }
16203
16254
  if (model.colItems && model.colItems.length > 0) {
16204
16255
  xmlStream.openNode("colItems", { count: model.colItems.length });
16205
16256
  for (const item of model.colItems) this.renderRowColItem(xmlStream, item);
@@ -16345,6 +16396,7 @@ var ExcelTS = (function(exports) {
16345
16396
  break;
16346
16397
  case "colFields":
16347
16398
  this.state.inColFields = true;
16399
+ if (this.model) this.model.hasColFields = true;
16348
16400
  break;
16349
16401
  case "dataFields":
16350
16402
  this.state.inDataFields = true;
@@ -16521,13 +16573,13 @@ var ExcelTS = (function(exports) {
16521
16573
  function buildColItems(columns, cacheFields, valueCount) {
16522
16574
  if (columns.length === 0) {
16523
16575
  if (valueCount > 1) {
16524
- const items$1 = [];
16525
- for (let i = 0; i < valueCount; i++) if (i === 0) items$1.push("<i><x /></i>");
16526
- else items$1.push(`<i><x v="${i}" /></i>`);
16527
- items$1.push("<i t=\"grand\"><x /></i>");
16576
+ const items = [];
16577
+ for (let i = 0; i < valueCount; i++) if (i === 0) items.push("<i><x /></i>");
16578
+ else items.push(`<i><x v="${i}" /></i>`);
16579
+ items.push("<i t=\"grand\"><x /></i>");
16528
16580
  return {
16529
- count: items$1.length,
16530
- xml: items$1.join("\n ")
16581
+ count: items.length,
16582
+ xml: items.join("\n ")
16531
16583
  };
16532
16584
  }
16533
16585
  return {
@@ -17232,7 +17284,6 @@ var ExcelTS = (function(exports) {
17232
17284
  switch (checked) {
17233
17285
  case "Checked": return "1";
17234
17286
  case "Mixed": return "2";
17235
- case "Unchecked":
17236
17287
  default: return "0";
17237
17288
  }
17238
17289
  }
@@ -17421,9 +17472,9 @@ var ExcelTS = (function(exports) {
17421
17472
  read(size) {
17422
17473
  if (size === 0) return null;
17423
17474
  if (size === void 0 || size >= this.length) {
17424
- const buf$1 = this.toBuffer();
17475
+ const buf = this.toBuffer();
17425
17476
  this.iRead = this.iWrite;
17426
- return buf$1;
17477
+ return buf;
17427
17478
  }
17428
17479
  const buf = this.buffer.slice(this.iRead, this.iRead + size);
17429
17480
  this.iRead += size;
@@ -17601,18 +17652,18 @@ var ExcelTS = (function(exports) {
17601
17652
  */
17602
17653
  read(size) {
17603
17654
  if (size) {
17604
- const buffers$1 = [];
17655
+ const buffers = [];
17605
17656
  let remaining = size;
17606
17657
  while (remaining && this.buffers.length && !this.buffers[0].eod) {
17607
17658
  const first = this.buffers[0];
17608
17659
  const buffer = first.read(remaining);
17609
17660
  if (buffer) {
17610
17661
  remaining -= buffer.length;
17611
- buffers$1.push(buffer);
17662
+ buffers.push(buffer);
17612
17663
  }
17613
17664
  if (first.eod && first.full) this.buffers.shift();
17614
17665
  }
17615
- return concatUint8Arrays$1(buffers$1);
17666
+ return concatUint8Arrays$1(buffers);
17616
17667
  }
17617
17668
  const buffers = this.buffers.map((buf) => buf.toBuffer()).filter(Boolean);
17618
17669
  this.buffers = [];
@@ -18118,7 +18169,7 @@ var ExcelTS = (function(exports) {
18118
18169
  const hdist = reader.readBits(5) + 1;
18119
18170
  const hclen = reader.readBits(4) + 4;
18120
18171
  const codeLengthLengths = new Uint8Array(19);
18121
- for (let i$1 = 0; i$1 < hclen; i$1++) codeLengthLengths[CODE_LENGTH_ORDER[i$1]] = reader.readBits(3);
18172
+ for (let i = 0; i < hclen; i++) codeLengthLengths[CODE_LENGTH_ORDER[i]] = reader.readBits(3);
18122
18173
  const codeLengthTree = buildHuffmanTree(codeLengthLengths, 19);
18123
18174
  const allLengths = new Uint8Array(hlit + hdist);
18124
18175
  let i = 0;
@@ -18580,7 +18631,7 @@ var ExcelTS = (function(exports) {
18580
18631
  const c = this._chunks[0];
18581
18632
  const start = this._headOffset;
18582
18633
  const end = start + length;
18583
- const out$1 = c.subarray(start, end);
18634
+ const out = c.subarray(start, end);
18584
18635
  this._headOffset = end;
18585
18636
  this._length -= length;
18586
18637
  if (this._length === 0) {
@@ -18590,7 +18641,7 @@ var ExcelTS = (function(exports) {
18590
18641
  this._chunks.shift();
18591
18642
  this._headOffset = 0;
18592
18643
  }
18593
- return out$1;
18644
+ return out;
18594
18645
  }
18595
18646
  const out = new Uint8Array(length);
18596
18647
  let outOffset = 0;
@@ -18772,10 +18823,10 @@ var ExcelTS = (function(exports) {
18772
18823
  }
18773
18824
  /** Peek a little-endian uint32 at `offset` without consuming bytes. Returns null if not enough bytes. */
18774
18825
  peekUint32LE(offset) {
18775
- const off$1 = offset | 0;
18776
- if (off$1 < 0 || off$1 + 4 > this._length) return null;
18826
+ const off = offset | 0;
18827
+ if (off < 0 || off + 4 > this._length) return null;
18777
18828
  const chunks = this._chunks;
18778
- let remaining = off$1;
18829
+ let remaining = off;
18779
18830
  for (let i = 0; i < chunks.length; i++) {
18780
18831
  const c = chunks[i];
18781
18832
  const start = i === 0 ? this._headOffset : 0;
@@ -18783,11 +18834,11 @@ var ExcelTS = (function(exports) {
18783
18834
  if (remaining < avail) {
18784
18835
  const idx = start + remaining;
18785
18836
  if (idx + 4 <= c.length) {
18786
- const b0$1 = c[idx] | 0;
18787
- const b1$1 = c[idx + 1] | 0;
18788
- const b2$1 = c[idx + 2] | 0;
18789
- const b3$1 = c[idx + 3] | 0;
18790
- return (b0$1 | b1$1 << 8 | b2$1 << 16 | b3$1 << 24) >>> 0;
18837
+ const b0 = c[idx] | 0;
18838
+ const b1 = c[idx + 1] | 0;
18839
+ const b2 = c[idx + 2] | 0;
18840
+ const b3 = c[idx + 3] | 0;
18841
+ return (b0 | b1 << 8 | b2 << 16 | b3 << 24) >>> 0;
18791
18842
  }
18792
18843
  const b0 = c[idx] | 0;
18793
18844
  let b1 = 0;
@@ -18816,9 +18867,9 @@ var ExcelTS = (function(exports) {
18816
18867
  }
18817
18868
  /** Peek a single byte at `offset` without consuming bytes. */
18818
18869
  peekByte(offset) {
18819
- const off$1 = offset | 0;
18820
- if (off$1 < 0 || off$1 >= this._length) throw new RangeError("ByteQueue: peek beyond available data");
18821
- let remaining = off$1;
18870
+ const off = offset | 0;
18871
+ if (off < 0 || off >= this._length) throw new RangeError("ByteQueue: peek beyond available data");
18872
+ let remaining = off;
18822
18873
  for (let i = 0; i < this._chunks.length; i++) {
18823
18874
  const c = this._chunks[i];
18824
18875
  const start = i === 0 ? this._headOffset : 0;
@@ -19102,9 +19153,9 @@ var ExcelTS = (function(exports) {
19102
19153
  }
19103
19154
  };
19104
19155
  var BufferedCodec = class extends EventEmitter {
19105
- constructor(process$1) {
19156
+ constructor(process) {
19106
19157
  super();
19107
- this.process = process$1;
19158
+ this.process = process;
19108
19159
  this.chunks = [];
19109
19160
  this.ended = false;
19110
19161
  }
@@ -19712,27 +19763,27 @@ var ExcelTS = (function(exports) {
19712
19763
  }
19713
19764
  _pushUnchained(data, final, callback) {
19714
19765
  if (this._finalized) {
19715
- const promise$1 = Promise.reject(/* @__PURE__ */ new Error("Cannot push to finalized ZipDeflateFile"));
19716
- this._tapCallback(promise$1, callback);
19717
- return promise$1;
19766
+ const promise = Promise.reject(/* @__PURE__ */ new Error("Cannot push to finalized ZipDeflateFile"));
19767
+ this._tapCallback(promise, callback);
19768
+ return promise;
19718
19769
  }
19719
19770
  if (this._deflateWanted === null) {
19720
19771
  this._accumulateSample(data);
19721
19772
  if (!this._shouldDecide(final)) {
19722
19773
  if (data.length > 0) this._pendingChunks.push(data);
19723
- const promise$2 = Promise.resolve();
19724
- this._tapCallback(promise$2, callback);
19725
- return promise$2;
19774
+ const promise = Promise.resolve();
19775
+ this._tapCallback(promise, callback);
19776
+ return promise;
19726
19777
  }
19727
19778
  this._decideCompressionIfNeeded(final);
19728
19779
  this._emitHeaderIfNeeded();
19729
19780
  const hadPendingChunks = this._pendingChunks.length > 0;
19730
19781
  const flushPromise = this._flushPendingChunks();
19731
- let writePromise$1 = flushPromise;
19732
- if (data.length > 0) writePromise$1 = hadPendingChunks ? flushPromise.then(() => this._writeData(data)) : this._writeData(data);
19733
- const promise$1 = final ? this._finalizeAfterWrite(writePromise$1) : writePromise$1;
19734
- this._tapCallback(promise$1, callback);
19735
- return promise$1;
19782
+ let writePromise = flushPromise;
19783
+ if (data.length > 0) writePromise = hadPendingChunks ? flushPromise.then(() => this._writeData(data)) : this._writeData(data);
19784
+ const promise = final ? this._finalizeAfterWrite(writePromise) : writePromise;
19785
+ this._tapCallback(promise, callback);
19786
+ return promise;
19736
19787
  }
19737
19788
  this._emitHeaderIfNeeded();
19738
19789
  const writePromise = this._writeData(data);
@@ -20446,8 +20497,8 @@ var ExcelTS = (function(exports) {
20446
20497
  /**
20447
20498
  * Write all passthrough files to a ZIP writer
20448
20499
  */
20449
- writeToZip(zip$1) {
20450
- for (const [path, data] of this.files) zip$1.append(data, { name: path });
20500
+ writeToZip(zip) {
20501
+ for (const [path, data] of this.files) zip.append(data, { name: path });
20451
20502
  }
20452
20503
  /**
20453
20504
  * Clear all stored files
@@ -20602,23 +20653,23 @@ var ExcelTS = (function(exports) {
20602
20653
  * Write all workbook content to a ZIP writer
20603
20654
  * Shared by both Node.js write() and browser writeBuffer()
20604
20655
  */
20605
- async writeToZip(zip$1, options) {
20656
+ async writeToZip(zip, options) {
20606
20657
  const { model } = this.workbook;
20607
20658
  this.prepareModel(model, options);
20608
- await this.addContentTypes(zip$1, model);
20609
- await this.addOfficeRels(zip$1, model);
20610
- await this.addWorkbookRels(zip$1, model);
20611
- await this.addWorksheets(zip$1, model);
20612
- await this.addSharedStrings(zip$1, model);
20613
- this.addDrawings(zip$1, model);
20614
- this.addTables(zip$1, model);
20615
- this.addPivotTables(zip$1, model);
20616
- this.addPassthrough(zip$1, model);
20617
- await Promise.all([this.addThemes(zip$1, model), this.addStyles(zip$1, model)]);
20618
- await this.addFeaturePropertyBag(zip$1, model);
20619
- await this.addMedia(zip$1, model);
20620
- await Promise.all([this.addApp(zip$1, model), this.addCore(zip$1, model)]);
20621
- await this.addWorkbook(zip$1, model);
20659
+ await this.addContentTypes(zip, model);
20660
+ await this.addOfficeRels(zip, model);
20661
+ await this.addWorkbookRels(zip, model);
20662
+ await this.addWorksheets(zip, model);
20663
+ await this.addSharedStrings(zip, model);
20664
+ this.addDrawings(zip, model);
20665
+ this.addTables(zip, model);
20666
+ this.addPivotTables(zip, model);
20667
+ this.addPassthrough(zip, model);
20668
+ await Promise.all([this.addThemes(zip, model), this.addStyles(zip, model)]);
20669
+ await this.addFeaturePropertyBag(zip, model);
20670
+ await this.addMedia(zip, model);
20671
+ await Promise.all([this.addApp(zip, model), this.addCore(zip, model)]);
20672
+ await this.addWorkbook(zip, model);
20622
20673
  }
20623
20674
  /**
20624
20675
  * Read workbook from a stream
@@ -20654,10 +20705,10 @@ var ExcelTS = (function(exports) {
20654
20705
  options = options || {};
20655
20706
  options.zip = options.zip || {};
20656
20707
  options.zip.modTime ??= this.workbook.modified ?? this.workbook.created;
20657
- const zip$1 = this.createZipWriter(options.zip);
20658
- zip$1.pipe(stream);
20659
- await this.writeToZip(zip$1, options);
20660
- return this._finalize(zip$1);
20708
+ const zip = this.createZipWriter(options.zip);
20709
+ zip.pipe(stream);
20710
+ await this.writeToZip(zip, options);
20711
+ return this._finalize(zip);
20661
20712
  }
20662
20713
  /**
20663
20714
  * Load workbook from buffer/ArrayBuffer/Uint8Array
@@ -20830,32 +20881,32 @@ var ExcelTS = (function(exports) {
20830
20881
  options = options || {};
20831
20882
  options.zip = options.zip || {};
20832
20883
  options.zip.modTime ??= this.workbook.modified ?? this.workbook.created;
20833
- const zip$1 = this.createZipWriter(options.zip);
20884
+ const zip = this.createZipWriter(options.zip);
20834
20885
  const stream = this.createStreamBuf();
20835
- zip$1.pipe(stream);
20836
- await this.writeToZip(zip$1, options);
20837
- await this._finalize(zip$1);
20886
+ zip.pipe(stream);
20887
+ await this.writeToZip(zip, options);
20888
+ await this._finalize(zip);
20838
20889
  return stream.read() || new Uint8Array(0);
20839
20890
  }
20840
20891
  /**
20841
20892
  * Add media files to ZIP
20842
20893
  * Supports buffer, base64, and filename (if readFileAsync is provided)
20843
20894
  */
20844
- async addMedia(zip$1, model) {
20895
+ async addMedia(zip, model) {
20845
20896
  await Promise.all(model.media.map(async (medium) => {
20846
20897
  if (medium.type !== "image") throw new Error("Unsupported media");
20847
20898
  const filename = mediaPath(`${medium.name ?? "undefined"}.${medium.extension}`);
20848
20899
  if (medium.filename) {
20849
20900
  if (this.readFileAsync) {
20850
20901
  const data = await this.readFileAsync(medium.filename);
20851
- return zip$1.append(data, { name: filename });
20902
+ return zip.append(data, { name: filename });
20852
20903
  }
20853
20904
  throw new Error("Loading images from filename is not supported in this environment");
20854
20905
  }
20855
- if (medium.buffer) return zip$1.append(medium.buffer, { name: filename });
20906
+ if (medium.buffer) return zip.append(medium.buffer, { name: filename });
20856
20907
  if (medium.base64) {
20857
20908
  const content = medium.base64.substring(medium.base64.indexOf(",") + 1);
20858
- return zip$1.append(content, {
20909
+ return zip.append(content, {
20859
20910
  name: filename,
20860
20911
  base64: true
20861
20912
  });
@@ -20932,6 +20983,7 @@ var ExcelTS = (function(exports) {
20932
20983
  delete model.sharedStrings;
20933
20984
  delete model.workbookRels;
20934
20985
  delete model.sheetDefs;
20986
+ model.defaultFont = model.styles?.defaultFont;
20935
20987
  delete model.styles;
20936
20988
  delete model.mediaIndex;
20937
20989
  delete model.drawings;
@@ -21074,9 +21126,9 @@ var ExcelTS = (function(exports) {
21074
21126
  }
21075
21127
  async _processDrawingEntry(entry, model, name) {
21076
21128
  const rawData = await this.collectStreamData(entry);
21077
- const xform$1 = new DrawingXform();
21129
+ const xform = new DrawingXform();
21078
21130
  const xmlString = this.bufferToString(rawData);
21079
- const drawing = await xform$1.parseStream(this.createTextStream(xmlString));
21131
+ const drawing = await xform.parseStream(this.createTextStream(xmlString));
21080
21132
  model.drawings[name] = drawing;
21081
21133
  model.rawDrawings[name] = rawData;
21082
21134
  }
@@ -21234,26 +21286,26 @@ var ExcelTS = (function(exports) {
21234
21286
  const data = await this.collectStreamData(stream);
21235
21287
  model.passthrough[entryName] = data;
21236
21288
  }
21237
- async addContentTypes(zip$1, model) {
21289
+ async addContentTypes(zip, model) {
21238
21290
  const xml = new ContentTypesXform().toXml(model);
21239
- zip$1.append(xml, { name: OOXML_PATHS.contentTypes });
21291
+ zip.append(xml, { name: OOXML_PATHS.contentTypes });
21240
21292
  }
21241
- async addApp(zip$1, model) {
21293
+ async addApp(zip, model) {
21242
21294
  const xml = new AppXform().toXml(model);
21243
- zip$1.append(xml, { name: OOXML_PATHS.docPropsApp });
21295
+ zip.append(xml, { name: OOXML_PATHS.docPropsApp });
21244
21296
  }
21245
- async addCore(zip$1, model) {
21246
- const xform$1 = new CoreXform();
21247
- zip$1.append(xform$1.toXml(model), { name: OOXML_PATHS.docPropsCore });
21297
+ async addCore(zip, model) {
21298
+ const xform = new CoreXform();
21299
+ zip.append(xform.toXml(model), { name: OOXML_PATHS.docPropsCore });
21248
21300
  }
21249
- async addThemes(zip$1, model) {
21301
+ async addThemes(zip, model) {
21250
21302
  const themes = model.themes || { theme1: theme1Xml };
21251
21303
  Object.keys(themes).forEach((name) => {
21252
21304
  const xml = themes[name];
21253
- zip$1.append(xml, { name: themePath(name) });
21305
+ zip.append(xml, { name: themePath(name) });
21254
21306
  });
21255
21307
  }
21256
- async addOfficeRels(zip$1, _model) {
21308
+ async addOfficeRels(zip, _model) {
21257
21309
  const xml = new RelationshipsXform().toXml([
21258
21310
  {
21259
21311
  Id: "rId1",
@@ -21271,9 +21323,9 @@ var ExcelTS = (function(exports) {
21271
21323
  Target: OOXML_PATHS.docPropsApp
21272
21324
  }
21273
21325
  ]);
21274
- zip$1.append(xml, { name: OOXML_PATHS.rootRels });
21326
+ zip.append(xml, { name: OOXML_PATHS.rootRels });
21275
21327
  }
21276
- async addWorkbookRels(zip$1, model) {
21328
+ async addWorkbookRels(zip, model) {
21277
21329
  let count = 1;
21278
21330
  const relationships = [{
21279
21331
  Id: `rId${count++}`,
@@ -21312,25 +21364,25 @@ var ExcelTS = (function(exports) {
21312
21364
  });
21313
21365
  });
21314
21366
  const xml = new RelationshipsXform().toXml(relationships);
21315
- zip$1.append(xml, { name: OOXML_PATHS.xlWorkbookRels });
21367
+ zip.append(xml, { name: OOXML_PATHS.xlWorkbookRels });
21316
21368
  }
21317
- async addFeaturePropertyBag(zip$1, model) {
21369
+ async addFeaturePropertyBag(zip, model) {
21318
21370
  if (!model.hasCheckboxes) return;
21319
- const xform$1 = new FeaturePropertyBagXform();
21320
- zip$1.append(xform$1.toXml({}), { name: OOXML_PATHS.xlFeaturePropertyBag });
21371
+ const xform = new FeaturePropertyBagXform();
21372
+ zip.append(xform.toXml({}), { name: OOXML_PATHS.xlFeaturePropertyBag });
21321
21373
  }
21322
- async addSharedStrings(zip$1, model) {
21323
- if (model.sharedStrings && model.sharedStrings.count) zip$1.append(model.sharedStrings.xml, { name: OOXML_PATHS.xlSharedStrings });
21374
+ async addSharedStrings(zip, model) {
21375
+ if (model.sharedStrings && model.sharedStrings.count) zip.append(model.sharedStrings.xml, { name: OOXML_PATHS.xlSharedStrings });
21324
21376
  }
21325
- async addStyles(zip$1, model) {
21377
+ async addStyles(zip, model) {
21326
21378
  const { xml } = model.styles;
21327
- if (xml) zip$1.append(xml, { name: OOXML_PATHS.xlStyles });
21379
+ if (xml) zip.append(xml, { name: OOXML_PATHS.xlStyles });
21328
21380
  }
21329
- async addWorkbook(zip$1, model) {
21330
- const xform$1 = new WorkbookXform();
21331
- zip$1.append(xform$1.toXml(model), { name: OOXML_PATHS.xlWorkbook });
21381
+ async addWorkbook(zip, model) {
21382
+ const xform = new WorkbookXform();
21383
+ zip.append(xform.toXml(model), { name: OOXML_PATHS.xlWorkbook });
21332
21384
  }
21333
- async addWorksheets(zip$1, model) {
21385
+ async addWorksheets(zip, model) {
21334
21386
  const worksheetXform = new WorkSheetXform();
21335
21387
  const relationshipsXform = new RelationshipsXform();
21336
21388
  const commentsXform = new CommentsXform();
@@ -21340,16 +21392,16 @@ var ExcelTS = (function(exports) {
21340
21392
  const fileIndex = worksheet.fileIndex || index + 1;
21341
21393
  let xmlStream = new XmlStream();
21342
21394
  worksheetXform.render(xmlStream, worksheet);
21343
- zip$1.append(xmlStream.xml, { name: worksheetPath(fileIndex) });
21395
+ zip.append(xmlStream.xml, { name: worksheetPath(fileIndex) });
21344
21396
  if (worksheet.rels && worksheet.rels.length) {
21345
21397
  xmlStream = new XmlStream();
21346
21398
  relationshipsXform.render(xmlStream, worksheet.rels);
21347
- zip$1.append(xmlStream.xml, { name: worksheetRelsPath(fileIndex) });
21399
+ zip.append(xmlStream.xml, { name: worksheetRelsPath(fileIndex) });
21348
21400
  }
21349
21401
  if (worksheet.comments.length > 0) {
21350
21402
  xmlStream = new XmlStream();
21351
21403
  commentsXform.render(xmlStream, worksheet);
21352
- zip$1.append(xmlStream.xml, { name: commentsPath(fileIndex) });
21404
+ zip.append(xmlStream.xml, { name: commentsPath(fileIndex) });
21353
21405
  }
21354
21406
  const hasComments = worksheet.comments.length > 0;
21355
21407
  const hasFormControls = worksheet.formControls && worksheet.formControls.length > 0;
@@ -21359,22 +21411,22 @@ var ExcelTS = (function(exports) {
21359
21411
  comments: hasComments ? worksheet.comments : [],
21360
21412
  formControls: hasFormControls ? worksheet.formControls : []
21361
21413
  });
21362
- zip$1.append(xmlStream.xml, { name: vmlDrawingPath(fileIndex) });
21414
+ zip.append(xmlStream.xml, { name: vmlDrawingPath(fileIndex) });
21363
21415
  }
21364
21416
  if (hasFormControls) worksheet.formControls.forEach((control) => {
21365
21417
  const xml = ctrlPropXform.toXml(control);
21366
- zip$1.append(xml, { name: ctrlPropPath(control.ctrlPropId) });
21418
+ zip.append(xml, { name: ctrlPropPath(control.ctrlPropId) });
21367
21419
  });
21368
21420
  });
21369
21421
  }
21370
- addDrawings(zip$1, model) {
21422
+ addDrawings(zip, model) {
21371
21423
  const drawingXform = new DrawingXform();
21372
21424
  const relsXform = new RelationshipsXform();
21373
21425
  const rawDrawings = model.rawDrawings || {};
21374
21426
  model.worksheets.forEach((worksheet) => {
21375
21427
  const { drawing } = worksheet;
21376
21428
  if (drawing) {
21377
- if (this.drawingHasChartReference(drawing) && rawDrawings[drawing.name]) zip$1.append(rawDrawings[drawing.name], { name: drawingPath(drawing.name) });
21429
+ if (this.drawingHasChartReference(drawing) && rawDrawings[drawing.name]) zip.append(rawDrawings[drawing.name], { name: drawingPath(drawing.name) });
21378
21430
  else {
21379
21431
  const filteredAnchors = (drawing.anchors || []).filter((a) => {
21380
21432
  if (a == null) return false;
@@ -21389,21 +21441,21 @@ var ExcelTS = (function(exports) {
21389
21441
  } : drawing;
21390
21442
  drawingXform.prepare(drawingForWrite);
21391
21443
  const xml = drawingXform.toXml(drawingForWrite);
21392
- zip$1.append(xml, { name: drawingPath(drawing.name) });
21444
+ zip.append(xml, { name: drawingPath(drawing.name) });
21393
21445
  }
21394
21446
  const relsXml = relsXform.toXml(drawing.rels);
21395
- zip$1.append(relsXml, { name: drawingRelsPath(drawing.name) });
21447
+ zip.append(relsXml, { name: drawingRelsPath(drawing.name) });
21396
21448
  }
21397
21449
  });
21398
21450
  }
21399
- addTables(zip$1, model) {
21451
+ addTables(zip, model) {
21400
21452
  const tableXform = new TableXform();
21401
21453
  model.worksheets.forEach((worksheet) => {
21402
21454
  const { tables } = worksheet;
21403
21455
  tables.forEach((table) => {
21404
21456
  tableXform.prepare(table, {});
21405
21457
  const tableXml = tableXform.toXml(table);
21406
- zip$1.append(tableXml, { name: tablePath(table.target) });
21458
+ zip.append(tableXml, { name: tablePath(table.target) });
21407
21459
  });
21408
21460
  });
21409
21461
  }
@@ -21411,12 +21463,12 @@ var ExcelTS = (function(exports) {
21411
21463
  * Write passthrough files (charts, etc.) that were preserved during read.
21412
21464
  * These files are written back unchanged to preserve unsupported features.
21413
21465
  */
21414
- addPassthrough(zip$1, model) {
21466
+ addPassthrough(zip, model) {
21415
21467
  const passthroughManager = new PassthroughManager();
21416
21468
  passthroughManager.fromRecord(model.passthrough || {});
21417
- passthroughManager.writeToZip(zip$1);
21469
+ passthroughManager.writeToZip(zip);
21418
21470
  }
21419
- addPivotTables(zip$1, model) {
21471
+ addPivotTables(zip, model) {
21420
21472
  if (!model.pivotTables.length) return;
21421
21473
  const pivotCacheRecordsXform = new PivotCacheRecordsXform();
21422
21474
  const pivotCacheDefinitionXform = new PivotCacheDefinitionXform();
@@ -21426,42 +21478,42 @@ var ExcelTS = (function(exports) {
21426
21478
  const n = pivotTable.tableNumber;
21427
21479
  if (pivotTable.isLoaded) {
21428
21480
  if (pivotTable.cacheDefinition) {
21429
- const xml$1 = pivotCacheDefinitionXform.toXml(pivotTable.cacheDefinition);
21430
- zip$1.append(xml$1, { name: pivotCacheDefinitionPath(n) });
21481
+ const xml = pivotCacheDefinitionXform.toXml(pivotTable.cacheDefinition);
21482
+ zip.append(xml, { name: pivotCacheDefinitionPath(n) });
21431
21483
  }
21432
21484
  if (pivotTable.cacheRecords) {
21433
- const xml$1 = pivotCacheRecordsXform.toXml(pivotTable.cacheRecords);
21434
- zip$1.append(xml$1, { name: pivotCacheRecordsPath(n) });
21485
+ const xml = pivotCacheRecordsXform.toXml(pivotTable.cacheRecords);
21486
+ zip.append(xml, { name: pivotCacheRecordsPath(n) });
21435
21487
  }
21436
21488
  } else {
21437
- let xml$1 = pivotCacheRecordsXform.toXml(pivotTable);
21438
- zip$1.append(xml$1, { name: pivotCacheRecordsPath(n) });
21439
- xml$1 = pivotCacheDefinitionXform.toXml(pivotTable);
21440
- zip$1.append(xml$1, { name: pivotCacheDefinitionPath(n) });
21489
+ let xml = pivotCacheRecordsXform.toXml(pivotTable);
21490
+ zip.append(xml, { name: pivotCacheRecordsPath(n) });
21491
+ xml = pivotCacheDefinitionXform.toXml(pivotTable);
21492
+ zip.append(xml, { name: pivotCacheDefinitionPath(n) });
21441
21493
  }
21442
21494
  let xml = relsXform.toXml([{
21443
21495
  Id: "rId1",
21444
21496
  Type: XLSX.RelType.PivotCacheRecords,
21445
21497
  Target: pivotCacheRecordsRelTarget(n)
21446
21498
  }]);
21447
- zip$1.append(xml, { name: pivotCacheDefinitionRelsPath(n) });
21499
+ zip.append(xml, { name: pivotCacheDefinitionRelsPath(n) });
21448
21500
  xml = pivotTableXform.toXml(pivotTable);
21449
- zip$1.append(xml, { name: pivotTablePath(n) });
21501
+ zip.append(xml, { name: pivotTablePath(n) });
21450
21502
  xml = relsXform.toXml([{
21451
21503
  Id: "rId1",
21452
21504
  Type: XLSX.RelType.PivotCacheDefinition,
21453
21505
  Target: pivotCacheDefinitionRelTargetFromPivotTable(n)
21454
21506
  }]);
21455
- zip$1.append(xml, { name: pivotTableRelsPath(n) });
21507
+ zip.append(xml, { name: pivotTableRelsPath(n) });
21456
21508
  });
21457
21509
  }
21458
- _finalize(zip$1) {
21510
+ _finalize(zip) {
21459
21511
  return new Promise((resolve, reject) => {
21460
- zip$1.on("finish", () => {
21512
+ zip.on("finish", () => {
21461
21513
  resolve(this);
21462
21514
  });
21463
- zip$1.on("error", reject);
21464
- zip$1.finalize();
21515
+ zip.on("error", reject);
21516
+ zip.finalize();
21465
21517
  });
21466
21518
  }
21467
21519
  prepareModel(model, options) {
@@ -21472,7 +21524,9 @@ var ExcelTS = (function(exports) {
21472
21524
  model.useSharedStrings = options.useSharedStrings !== void 0 ? options.useSharedStrings : true;
21473
21525
  model.useStyles = options.useStyles !== void 0 ? options.useStyles : true;
21474
21526
  model.sharedStrings = new SharedStringsXform();
21527
+ const oldDefaultFont = model.defaultFont;
21475
21528
  model.styles = model.useStyles ? new StylesXform(true) : new StylesXform.Mock();
21529
+ if (oldDefaultFont && model.styles.setDefaultFont) model.styles.setDefaultFont(oldDefaultFont);
21476
21530
  const workbookXform = new WorkbookXform();
21477
21531
  const worksheetXform = new WorkSheetXform();
21478
21532
  workbookXform.prepare(model);
@@ -21660,26 +21714,26 @@ var ExcelTS = (function(exports) {
21660
21714
  parseAll(values) {
21661
21715
  const len = values.length;
21662
21716
  const out = new Array(len);
21663
- const parse$1 = this.parse;
21664
- for (let i = 0; i < len; i++) out[i] = parse$1(values[i]);
21717
+ const parse = this.parse;
21718
+ for (let i = 0; i < len; i++) out[i] = parse(values[i]);
21665
21719
  return out;
21666
21720
  }
21667
21721
  /** Parse and filter valid dates */
21668
21722
  parseValid(values) {
21669
21723
  const out = [];
21670
- const parse$1 = this.parse;
21724
+ const parse = this.parse;
21671
21725
  for (let i = 0, len = values.length; i < len; i++) {
21672
- const d = parse$1(values[i]);
21726
+ const d = parse(values[i]);
21673
21727
  if (d) out.push(d);
21674
21728
  }
21675
21729
  return out;
21676
21730
  }
21677
21731
  };
21678
21732
  function tzOffset(d) {
21679
- const off$1 = -d.getTimezoneOffset();
21680
- const sign = off$1 >= 0 ? "+" : "-";
21681
- const h = Math.abs(off$1) / 60 | 0;
21682
- const m = Math.abs(off$1) % 60;
21733
+ const off = -d.getTimezoneOffset();
21734
+ const sign = off >= 0 ? "+" : "-";
21735
+ const h = Math.abs(off) / 60 | 0;
21736
+ const m = Math.abs(off) % 60;
21683
21737
  return `${sign}${PAD2[h]}:${PAD2[m]}`;
21684
21738
  }
21685
21739
  /**
@@ -21723,9 +21777,9 @@ var ExcelTS = (function(exports) {
21723
21777
  });
21724
21778
  }
21725
21779
  /** Create custom format formatter */
21726
- static create(format$1, options) {
21780
+ static create(format, options) {
21727
21781
  const utc = options?.utc ?? false;
21728
- if (format$1 === "YYYY-MM-DD") return utc ? new DateFormatter((d) => {
21782
+ if (format === "YYYY-MM-DD") return utc ? new DateFormatter((d) => {
21729
21783
  if (!(d instanceof Date)) return "";
21730
21784
  const t = d.getTime();
21731
21785
  if (t !== t) return "";
@@ -21736,7 +21790,7 @@ var ExcelTS = (function(exports) {
21736
21790
  if (t !== t) return "";
21737
21791
  return `${d.getFullYear()}-${PAD2[d.getMonth() + 1]}-${PAD2[d.getDate()]}`;
21738
21792
  });
21739
- if (format$1 === "YYYY-MM-DD HH:mm:ss") return utc ? new DateFormatter((d) => {
21793
+ if (format === "YYYY-MM-DD HH:mm:ss") return utc ? new DateFormatter((d) => {
21740
21794
  if (!(d instanceof Date)) return "";
21741
21795
  const t = d.getTime();
21742
21796
  if (t !== t) return "";
@@ -21747,8 +21801,8 @@ var ExcelTS = (function(exports) {
21747
21801
  if (t !== t) return "";
21748
21802
  return `${d.getFullYear()}-${PAD2[d.getMonth() + 1]}-${PAD2[d.getDate()]} ${PAD2[d.getHours()]}:${PAD2[d.getMinutes()]}:${PAD2[d.getSeconds()]}`;
21749
21803
  });
21750
- if (format$1 === "MM-DD-YYYY" || format$1 === "MM/DD/YYYY") {
21751
- const sep = format$1.charAt(2);
21804
+ if (format === "MM-DD-YYYY" || format === "MM/DD/YYYY") {
21805
+ const sep = format.charAt(2);
21752
21806
  return utc ? new DateFormatter((d) => {
21753
21807
  if (!(d instanceof Date)) return "";
21754
21808
  const t = d.getTime();
@@ -21761,8 +21815,8 @@ var ExcelTS = (function(exports) {
21761
21815
  return `${PAD2[d.getMonth() + 1]}${sep}${PAD2[d.getDate()]}${sep}${d.getFullYear()}`;
21762
21816
  });
21763
21817
  }
21764
- if (format$1 === "DD-MM-YYYY" || format$1 === "DD/MM/YYYY") {
21765
- const sep = format$1.charAt(2);
21818
+ if (format === "DD-MM-YYYY" || format === "DD/MM/YYYY") {
21819
+ const sep = format.charAt(2);
21766
21820
  return utc ? new DateFormatter((d) => {
21767
21821
  if (!(d instanceof Date)) return "";
21768
21822
  const t = d.getTime();
@@ -21775,12 +21829,12 @@ var ExcelTS = (function(exports) {
21775
21829
  return `${PAD2[d.getDate()]}${sep}${PAD2[d.getMonth() + 1]}${sep}${d.getFullYear()}`;
21776
21830
  });
21777
21831
  }
21778
- return DateFormatter.createGeneric(format$1, utc);
21832
+ return DateFormatter.createGeneric(format, utc);
21779
21833
  }
21780
21834
  /** Generic formatter for arbitrary formats */
21781
- static createGeneric(format$1, utc) {
21835
+ static createGeneric(format, utc) {
21782
21836
  const esc = [];
21783
- const tpl = format$1.replace(/\[([^\]]*)\]/g, (_, c) => {
21837
+ const tpl = format.replace(/\[([^\]]*)\]/g, (_, c) => {
21784
21838
  esc.push(c);
21785
21839
  return `\x00${esc.length - 1}\x00`;
21786
21840
  });
@@ -21862,8 +21916,8 @@ var ExcelTS = (function(exports) {
21862
21916
  /**
21863
21917
  * Check if a validate function is synchronous (1 argument) vs async (2 arguments)
21864
21918
  */
21865
- function isSyncValidate(validate$1) {
21866
- return validate$1.length === 1;
21919
+ function isSyncValidate(validate) {
21920
+ return validate.length === 1;
21867
21921
  }
21868
21922
  /**
21869
21923
  * Check if headers are unique
@@ -21881,7 +21935,7 @@ var ExcelTS = (function(exports) {
21881
21935
  * Parse a CSV string into rows of fields
21882
21936
  */
21883
21937
  function parseCsv(input, options = {}) {
21884
- const { delimiter = ",", quote: quoteOption = "\"", escape: escapeOption = "\"", skipEmptyLines = false, ignoreEmpty = false, trim = false, ltrim = false, rtrim = false, headers = false, renameHeaders = false, comment, maxRows, skipLines = 0, skipRows = 0, strictColumnHandling = false, discardUnmappedColumns = false, transform, validate: validate$1 } = options;
21938
+ const { delimiter = ",", quote: quoteOption = "\"", escape: escapeOption = "\"", skipEmptyLines = false, ignoreEmpty = false, trim = false, ltrim = false, rtrim = false, headers = false, renameHeaders = false, comment, maxRows, skipLines = 0, skipRows = 0, strictColumnHandling = false, discardUnmappedColumns = false, transform, validate } = options;
21885
21939
  const shouldSkipEmpty = skipEmptyLines || ignoreEmpty;
21886
21940
  const quoteEnabled = quoteOption !== null && quoteOption !== false;
21887
21941
  const quote = quoteEnabled ? String(quoteOption) : "";
@@ -22031,10 +22085,10 @@ var ExcelTS = (function(exports) {
22031
22085
  return obj;
22032
22086
  });
22033
22087
  if (transform) dataRows = dataRows.map((row) => transform(row)).filter((row) => row !== null && row !== void 0);
22034
- if (validate$1) {
22088
+ if (validate) {
22035
22089
  const validatedRows = [];
22036
22090
  for (const row of dataRows) {
22037
- const result = validate$1(row);
22091
+ const result = validate(row);
22038
22092
  if (typeof result === "boolean") if (result) validatedRows.push(row);
22039
22093
  else invalidRows.push({
22040
22094
  row: Object.values(row),
@@ -22048,7 +22102,7 @@ var ExcelTS = (function(exports) {
22048
22102
  }
22049
22103
  dataRows = validatedRows;
22050
22104
  }
22051
- if ((strictColumnHandling || validate$1) && invalidRows.length > 0) return {
22105
+ if ((strictColumnHandling || validate) && invalidRows.length > 0) return {
22052
22106
  headers: headerRow.filter((h) => h !== null && h !== void 0),
22053
22107
  rows: dataRows,
22054
22108
  invalidRows
@@ -22060,11 +22114,11 @@ var ExcelTS = (function(exports) {
22060
22114
  }
22061
22115
  let resultRows = rows;
22062
22116
  if (transform) resultRows = resultRows.map((row) => transform(row)).filter((row) => row !== null && row !== void 0);
22063
- if (validate$1) {
22117
+ if (validate) {
22064
22118
  const validatedRows = [];
22065
22119
  const arrayInvalidRows = [];
22066
22120
  for (const row of resultRows) {
22067
- const result = validate$1(row);
22121
+ const result = validate(row);
22068
22122
  if (typeof result === "boolean") if (result) validatedRows.push(row);
22069
22123
  else arrayInvalidRows.push({
22070
22124
  row,
@@ -22093,7 +22147,7 @@ var ExcelTS = (function(exports) {
22093
22147
  const quoteEnabled = quoteOption !== false && quoteOption !== null;
22094
22148
  const quote = quoteEnabled ? String(quoteOption) : "";
22095
22149
  const escape = escapeOption !== void 0 && escapeOption !== false && escapeOption !== null ? String(escapeOption) : quote;
22096
- const needsQuoteRegex = quoteEnabled ? /* @__PURE__ */ new RegExp(`[${escapeRegex$1(delimiter)}${escapeRegex$1(quote)}\r\n]`) : null;
22150
+ const needsQuoteRegex = quoteEnabled ? new RegExp(`[${escapeRegex$1(delimiter)}${escapeRegex$1(quote)}\r\n]`) : null;
22097
22151
  const escapeQuoteRegex = quoteEnabled ? new RegExp(escapeRegex$1(quote), "g") : null;
22098
22152
  const escapedQuote = escape + quote;
22099
22153
  const lines = [];
@@ -23624,8 +23678,8 @@ var ExcelTS = (function(exports) {
23624
23678
  media: this.media,
23625
23679
  hasCheckboxes: this.styles.hasCheckboxes
23626
23680
  };
23627
- const xform$1 = new ContentTypesXform();
23628
- this._addFile(xform$1.toXml(model), OOXML_PATHS.contentTypes);
23681
+ const xform = new ContentTypesXform();
23682
+ this._addFile(xform.toXml(model), OOXML_PATHS.contentTypes);
23629
23683
  resolve();
23630
23684
  });
23631
23685
  }
@@ -23652,30 +23706,30 @@ var ExcelTS = (function(exports) {
23652
23706
  }
23653
23707
  addApp() {
23654
23708
  return new Promise((resolve) => {
23655
- const xform$1 = new AppXform();
23656
- this._addFile(xform$1.toXml({ worksheets: this._worksheets.filter(Boolean) }), OOXML_PATHS.docPropsApp);
23709
+ const xform = new AppXform();
23710
+ this._addFile(xform.toXml({ worksheets: this._worksheets.filter(Boolean) }), OOXML_PATHS.docPropsApp);
23657
23711
  resolve();
23658
23712
  });
23659
23713
  }
23660
23714
  addCore() {
23661
23715
  return new Promise((resolve) => {
23662
- const xform$1 = new CoreXform();
23663
- this._addFile(xform$1.toXml(this), OOXML_PATHS.docPropsCore);
23716
+ const xform = new CoreXform();
23717
+ this._addFile(xform.toXml(this), OOXML_PATHS.docPropsCore);
23664
23718
  resolve();
23665
23719
  });
23666
23720
  }
23667
23721
  addSharedStrings() {
23668
23722
  if (this.sharedStrings.count) return new Promise((resolve) => {
23669
- const xform$1 = new SharedStringsXform();
23670
- this._addFile(xform$1.toXml(this.sharedStrings), OOXML_PATHS.xlSharedStrings);
23723
+ const xform = new SharedStringsXform();
23724
+ this._addFile(xform.toXml(this.sharedStrings), OOXML_PATHS.xlSharedStrings);
23671
23725
  resolve();
23672
23726
  });
23673
23727
  return Promise.resolve();
23674
23728
  }
23675
23729
  addFeaturePropertyBag() {
23676
23730
  if (this.styles.hasCheckboxes) {
23677
- const xform$1 = new FeaturePropertyBagXform();
23678
- this._addFile(xform$1.toXml({}), OOXML_PATHS.xlFeaturePropertyBag);
23731
+ const xform = new FeaturePropertyBagXform();
23732
+ this._addFile(xform.toXml({}), OOXML_PATHS.xlFeaturePropertyBag);
23679
23733
  }
23680
23734
  return Promise.resolve();
23681
23735
  }
@@ -23711,8 +23765,8 @@ var ExcelTS = (function(exports) {
23711
23765
  }
23712
23766
  });
23713
23767
  return new Promise((resolve) => {
23714
- const xform$1 = new RelationshipsXform();
23715
- this._addFile(xform$1.toXml(relationships), OOXML_PATHS.xlWorkbookRels);
23768
+ const xform = new RelationshipsXform();
23769
+ this._addFile(xform.toXml(relationships), OOXML_PATHS.xlWorkbookRels);
23716
23770
  resolve();
23717
23771
  });
23718
23772
  }
@@ -23725,9 +23779,9 @@ var ExcelTS = (function(exports) {
23725
23779
  calcProperties: {}
23726
23780
  };
23727
23781
  return new Promise((resolve) => {
23728
- const xform$1 = new WorkbookXform();
23729
- xform$1.prepare(model);
23730
- this._addFile(xform$1.toXml(model), OOXML_PATHS.xlWorkbook);
23782
+ const xform = new WorkbookXform();
23783
+ xform.prepare(model);
23784
+ this._addFile(xform.toXml(model), OOXML_PATHS.xlWorkbook);
23731
23785
  resolve();
23732
23786
  });
23733
23787
  }
@@ -23771,11 +23825,11 @@ var ExcelTS = (function(exports) {
23771
23825
  * ]
23772
23826
  * @returns An object with keys set to their associated extracted values.
23773
23827
  */
23774
- function parse(buffer, format$1) {
23828
+ function parse(buffer, format) {
23775
23829
  const result = {};
23776
23830
  const view = new DataView(buffer.buffer, buffer.byteOffset, buffer.byteLength);
23777
23831
  let offset = 0;
23778
- for (const [key, size] of format$1) {
23832
+ for (const [key, size] of format) {
23779
23833
  if (buffer.length >= offset + size) switch (size) {
23780
23834
  case 1:
23781
23835
  result[key] = view.getUint8(offset);
@@ -23798,8 +23852,8 @@ var ExcelTS = (function(exports) {
23798
23852
  }
23799
23853
  return result;
23800
23854
  }
23801
- function parseTyped(buffer, format$1) {
23802
- return parse(buffer, format$1);
23855
+ function parseTyped(buffer, format) {
23856
+ return parse(buffer, format);
23803
23857
  }
23804
23858
 
23805
23859
  //#endregion
@@ -24031,14 +24085,14 @@ var ExcelTS = (function(exports) {
24031
24085
  * This encapsulates the shared logic used by both Node and browser parsers.
24032
24086
  */
24033
24087
  function streamUntilValidatedDataDescriptor(options) {
24034
- const { source, dataDescriptorSignature: dataDescriptorSignature$1 } = options;
24088
+ const { source, dataDescriptorSignature } = options;
24035
24089
  const keepTailBytes = options.keepTailBytes ?? 20;
24036
24090
  const errorMessage = options.errorMessage ?? "FILE_ENDED: Data descriptor not found";
24037
24091
  const output = new PassThrough({ highWaterMark: DEFAULT_UNZIP_STREAM_HIGH_WATER_MARK$1 });
24038
24092
  let done = false;
24039
24093
  let waitingDrain = false;
24040
24094
  let bytesEmitted = 0;
24041
- const scanner = new PatternScanner(dataDescriptorSignature$1);
24095
+ const scanner = new PatternScanner(dataDescriptorSignature);
24042
24096
  let unsubscribe;
24043
24097
  const cleanup = () => {
24044
24098
  if (unsubscribe) {
@@ -24116,9 +24170,9 @@ var ExcelTS = (function(exports) {
24116
24170
  const parts = source.peekChunks(flushLen);
24117
24171
  let written = 0;
24118
24172
  for (const part of parts) {
24119
- const ok$1 = output.write(part);
24173
+ const ok = output.write(part);
24120
24174
  written += part.length;
24121
- if (!ok$1) {
24175
+ if (!ok) {
24122
24176
  waitingDrain = true;
24123
24177
  output.once("drain", () => {
24124
24178
  waitingDrain = false;
@@ -24210,7 +24264,7 @@ var ExcelTS = (function(exports) {
24210
24264
  }
24211
24265
  }
24212
24266
  async function pumpKnownCompressedSizeToEntry(io, inflater, entry, compressedSize) {
24213
- const CHUNK_SIZE$1 = 256 * 1024;
24267
+ const CHUNK_SIZE = 256 * 1024;
24214
24268
  let remaining = compressedSize;
24215
24269
  let err = null;
24216
24270
  const onError = (e) => {
@@ -24270,7 +24324,7 @@ var ExcelTS = (function(exports) {
24270
24324
  while (remaining > 0) {
24271
24325
  if (err) throw err;
24272
24326
  if (!skipping && (entry.__autodraining || entry.destroyed)) await switchToSkip();
24273
- const toPull = Math.min(CHUNK_SIZE$1, remaining);
24327
+ const toPull = Math.min(CHUNK_SIZE, remaining);
24274
24328
  const chunk = await io.pull(toPull);
24275
24329
  if (chunk.length !== toPull) throw new Error("FILE_ENDED");
24276
24330
  remaining -= chunk.length;
@@ -24702,7 +24756,7 @@ onmessage = async (ev) => {
24702
24756
  * - Writable side: accepts ZIP data
24703
24757
  * - Readable side: emits ZipEntry objects
24704
24758
  */
24705
- return class Parse$1 extends Duplex {
24759
+ return class Parse extends Duplex {
24706
24760
  constructor(opts = {}) {
24707
24761
  super({
24708
24762
  objectMode: true,
@@ -24911,10 +24965,10 @@ onmessage = async (ev) => {
24911
24965
  this.match = match;
24912
24966
  const endIndex = includeEof ? match + patternLen : match;
24913
24967
  if (endIndex > 0) {
24914
- const ok$1 = output.write(this._buffer.read(endIndex));
24968
+ const ok = output.write(this._buffer.read(endIndex));
24915
24969
  scanner.onConsume(endIndex);
24916
24970
  this._maybeReleaseWriteCallback();
24917
- if (!ok$1) {
24971
+ if (!ok) {
24918
24972
  waitingDrain = true;
24919
24973
  output.once("drain", () => {
24920
24974
  waitingDrain = false;
@@ -25677,10 +25731,10 @@ onmessage = async (ev) => {
25677
25731
  };
25678
25732
  }
25679
25733
  async *_parseEntries(stream) {
25680
- const zip$1 = createParse({ forceStream: true });
25681
- stream.on("error", (err) => zip$1.emit("error", err));
25682
- stream.pipe(zip$1);
25683
- for await (const entry of iterateStream(zip$1)) {
25734
+ const zip = createParse({ forceStream: true });
25735
+ stream.on("error", (err) => zip.emit("error", err));
25736
+ stream.pipe(zip);
25737
+ for await (const entry of iterateStream(zip)) {
25684
25738
  let sheetNo;
25685
25739
  const normalizedPath = normalizeZipPath(entry.path);
25686
25740
  switch (normalizedPath) {
@@ -25730,9 +25784,9 @@ onmessage = async (ev) => {
25730
25784
  }
25731
25785
  async _storeWaitingWorksheet(sheetNo, entry) {
25732
25786
  const chunks = [];
25733
- const encoder$1 = new TextEncoder();
25787
+ const encoder = new TextEncoder();
25734
25788
  for await (const chunk of iterateStream(entry)) if (chunk instanceof Uint8Array) chunks.push(chunk);
25735
- else if (typeof chunk === "string") chunks.push(encoder$1.encode(chunk));
25789
+ else if (typeof chunk === "string") chunks.push(encoder.encode(chunk));
25736
25790
  return {
25737
25791
  sheetNo,
25738
25792
  data: chunks
@@ -25960,7 +26014,8 @@ onmessage = async (ev) => {
25960
26014
  pivotTables: this.pivotTables,
25961
26015
  calcProperties: this.calcProperties,
25962
26016
  passthrough: this._passthrough,
25963
- rawDrawings: this._rawDrawings
26017
+ rawDrawings: this._rawDrawings,
26018
+ defaultFont: this._defaultFont
25964
26019
  };
25965
26020
  }
25966
26021
  set model(value) {
@@ -26001,25 +26056,26 @@ onmessage = async (ev) => {
26001
26056
  this.pivotTables = value.pivotTables || value.loadedPivotTables || [];
26002
26057
  this._passthrough = value.passthrough || {};
26003
26058
  this._rawDrawings = value.rawDrawings || {};
26059
+ this._defaultFont = value.defaultFont;
26004
26060
  }
26005
26061
  };
26006
26062
 
26007
26063
  //#endregion
26008
26064
  //#region src/modules/excel/types.ts
26009
- let PaperSize = /* @__PURE__ */ function(PaperSize$1) {
26010
- PaperSize$1[PaperSize$1["Legal"] = 5] = "Legal";
26011
- PaperSize$1[PaperSize$1["Executive"] = 7] = "Executive";
26012
- PaperSize$1[PaperSize$1["A4"] = 9] = "A4";
26013
- PaperSize$1[PaperSize$1["A5"] = 11] = "A5";
26014
- PaperSize$1[PaperSize$1["B5"] = 13] = "B5";
26015
- PaperSize$1[PaperSize$1["Envelope_10"] = 20] = "Envelope_10";
26016
- PaperSize$1[PaperSize$1["Envelope_DL"] = 27] = "Envelope_DL";
26017
- PaperSize$1[PaperSize$1["Envelope_C5"] = 28] = "Envelope_C5";
26018
- PaperSize$1[PaperSize$1["Envelope_B5"] = 34] = "Envelope_B5";
26019
- PaperSize$1[PaperSize$1["Envelope_Monarch"] = 37] = "Envelope_Monarch";
26020
- PaperSize$1[PaperSize$1["Double_Japan_Postcard_Rotated"] = 82] = "Double_Japan_Postcard_Rotated";
26021
- PaperSize$1[PaperSize$1["K16_197x273_mm"] = 119] = "K16_197x273_mm";
26022
- return PaperSize$1;
26065
+ let PaperSize = /* @__PURE__ */ function(PaperSize) {
26066
+ PaperSize[PaperSize["Legal"] = 5] = "Legal";
26067
+ PaperSize[PaperSize["Executive"] = 7] = "Executive";
26068
+ PaperSize[PaperSize["A4"] = 9] = "A4";
26069
+ PaperSize[PaperSize["A5"] = 11] = "A5";
26070
+ PaperSize[PaperSize["B5"] = 13] = "B5";
26071
+ PaperSize[PaperSize["Envelope_10"] = 20] = "Envelope_10";
26072
+ PaperSize[PaperSize["Envelope_DL"] = 27] = "Envelope_DL";
26073
+ PaperSize[PaperSize["Envelope_C5"] = 28] = "Envelope_C5";
26074
+ PaperSize[PaperSize["Envelope_B5"] = 34] = "Envelope_B5";
26075
+ PaperSize[PaperSize["Envelope_Monarch"] = 37] = "Envelope_Monarch";
26076
+ PaperSize[PaperSize["Double_Japan_Postcard_Rotated"] = 82] = "Double_Japan_Postcard_Rotated";
26077
+ PaperSize[PaperSize["K16_197x273_mm"] = 119] = "K16_197x273_mm";
26078
+ return PaperSize;
26023
26079
  }({});
26024
26080
 
26025
26081
  //#endregion
@@ -26216,9 +26272,9 @@ onmessage = async (ev) => {
26216
26272
  const sign = val < 0 ? "-" : "";
26217
26273
  const absVal = Math.abs(val);
26218
26274
  if (absVal === 0) {
26219
- const decMatch$1 = fmt.match(/\.([0#]+)E/i);
26220
- const decPlaces$1 = decMatch$1 ? decMatch$1[1].length : 2;
26221
- return "0." + "0".repeat(decPlaces$1) + "E+00";
26275
+ const decMatch = fmt.match(/\.([0#]+)E/i);
26276
+ const decPlaces = decMatch ? decMatch[1].length : 2;
26277
+ return "0." + "0".repeat(decPlaces) + "E+00";
26222
26278
  }
26223
26279
  const decMatch = fmt.match(/\.([0#]+)E/i);
26224
26280
  const decPlaces = decMatch ? decMatch[1].length : 2;
@@ -26278,15 +26334,15 @@ onmessage = async (ev) => {
26278
26334
  const absVal = Math.abs(val);
26279
26335
  const fixedDenomMatch = fmt.match(/\?+\s*\/\s*(\d+)/);
26280
26336
  if (fixedDenomMatch) {
26281
- const denom$1 = parseInt(fixedDenomMatch[1], 10);
26282
- const whole$1 = Math.floor(absVal);
26283
- const frac = absVal - whole$1;
26284
- const numer$1 = Math.round(frac * denom$1);
26337
+ const denom = parseInt(fixedDenomMatch[1], 10);
26338
+ const whole = Math.floor(absVal);
26339
+ const frac = absVal - whole;
26340
+ const numer = Math.round(frac * denom);
26285
26341
  if (fmt.includes("#") || fmt.includes("0")) {
26286
- if (numer$1 === 0) return sign + whole$1.toString();
26287
- return sign + (whole$1 > 0 ? whole$1 + " " : "") + numer$1 + "/" + denom$1;
26342
+ if (numer === 0) return sign + whole.toString();
26343
+ return sign + (whole > 0 ? whole + " " : "") + numer + "/" + denom;
26288
26344
  }
26289
- return sign + (whole$1 * denom$1 + numer$1) + "/" + denom$1;
26345
+ return sign + (whole * denom + numer) + "/" + denom;
26290
26346
  }
26291
26347
  const denomMatch = fmt.match(/\/\s*(\?+)/);
26292
26348
  const maxDigits = denomMatch ? denomMatch[1].length : 2;
@@ -26415,8 +26471,8 @@ onmessage = async (ev) => {
26415
26471
  */
26416
26472
  function chooseFormat(fmt, val) {
26417
26473
  if (typeof val === "string") {
26418
- const sections$1 = splitFormat(fmt);
26419
- if (sections$1.length >= 4 && sections$1[3]) return processQuotedText(sections$1[3]).replace(/@/g, val);
26474
+ const sections = splitFormat(fmt);
26475
+ if (sections.length >= 4 && sections[3]) return processQuotedText(sections[3]).replace(/@/g, val);
26420
26476
  return val;
26421
26477
  }
26422
26478
  if (typeof val === "boolean") return val ? "TRUE" : "FALSE";
@@ -26636,24 +26692,24 @@ onmessage = async (ev) => {
26636
26692
  * Decode range string to Range object
26637
26693
  * @example decodeRange("A1:B2") => {s: {c: 0, r: 0}, e: {c: 1, r: 1}}
26638
26694
  */
26639
- function decodeRange(range$1) {
26640
- const idx = range$1.indexOf(":");
26695
+ function decodeRange(range) {
26696
+ const idx = range.indexOf(":");
26641
26697
  if (idx === -1) {
26642
- const cell = decodeCell(range$1);
26698
+ const cell = decodeCell(range);
26643
26699
  return {
26644
26700
  s: cell,
26645
26701
  e: { ...cell }
26646
26702
  };
26647
26703
  }
26648
26704
  return {
26649
- s: decodeCell(range$1.slice(0, idx)),
26650
- e: decodeCell(range$1.slice(idx + 1))
26705
+ s: decodeCell(range.slice(0, idx)),
26706
+ e: decodeCell(range.slice(idx + 1))
26651
26707
  };
26652
26708
  }
26653
26709
  function encodeRange(startOrRange, end) {
26654
26710
  if (end === void 0) {
26655
- const range$1 = startOrRange;
26656
- return encodeRange(range$1.s, range$1.e);
26711
+ const range = startOrRange;
26712
+ return encodeRange(range.s, range.e);
26657
26713
  }
26658
26714
  const startStr = encodeCell(startOrRange);
26659
26715
  const endStr = encodeCell(end);
@@ -26766,8 +26822,8 @@ onmessage = async (ev) => {
26766
26822
  if (endRow < startRow || endCol < startCol) return [];
26767
26823
  const headerOpt = o.header;
26768
26824
  if (headerOpt === 1) {
26769
- const result$1 = [];
26770
- const includeBlank$1 = o.blankrows !== false;
26825
+ const result = [];
26826
+ const includeBlank = o.blankrows !== false;
26771
26827
  for (let row = startRow; row <= endRow; row++) {
26772
26828
  const rowData = [];
26773
26829
  let isEmpty = true;
@@ -26780,13 +26836,13 @@ onmessage = async (ev) => {
26780
26836
  } else if (o.defval !== void 0) rowData[col - startCol] = o.defval;
26781
26837
  else rowData[col - startCol] = null;
26782
26838
  }
26783
- if (!isEmpty || includeBlank$1) result$1.push(rowData);
26839
+ if (!isEmpty || includeBlank) result.push(rowData);
26784
26840
  }
26785
- return result$1;
26841
+ return result;
26786
26842
  }
26787
26843
  if (headerOpt === "A") {
26788
- const result$1 = [];
26789
- const includeBlank$1 = o.blankrows === true;
26844
+ const result = [];
26845
+ const includeBlank = o.blankrows === true;
26790
26846
  for (let row = startRow; row <= endRow; row++) {
26791
26847
  const rowData = {};
26792
26848
  let isEmpty = true;
@@ -26799,13 +26855,13 @@ onmessage = async (ev) => {
26799
26855
  isEmpty = false;
26800
26856
  } else if (o.defval !== void 0) rowData[key] = o.defval;
26801
26857
  }
26802
- if (!isEmpty || includeBlank$1) result$1.push(rowData);
26858
+ if (!isEmpty || includeBlank) result.push(rowData);
26803
26859
  }
26804
- return result$1;
26860
+ return result;
26805
26861
  }
26806
26862
  if (Array.isArray(headerOpt)) {
26807
- const result$1 = [];
26808
- const includeBlank$1 = o.blankrows === true;
26863
+ const result = [];
26864
+ const includeBlank = o.blankrows === true;
26809
26865
  for (let row = startRow; row <= endRow; row++) {
26810
26866
  const rowData = {};
26811
26867
  let isEmpty = true;
@@ -26819,9 +26875,9 @@ onmessage = async (ev) => {
26819
26875
  isEmpty = false;
26820
26876
  } else if (o.defval !== void 0) rowData[key] = o.defval;
26821
26877
  }
26822
- if (!isEmpty || includeBlank$1) result$1.push(rowData);
26878
+ if (!isEmpty || includeBlank) result.push(rowData);
26823
26879
  }
26824
- return result$1;
26880
+ return result;
26825
26881
  }
26826
26882
  const headers = [];
26827
26883
  const headerCounts = {};
@@ -27458,7 +27514,7 @@ onmessage = async (ev) => {
27458
27514
  stream() {
27459
27515
  this._sealed = true;
27460
27516
  const queue = createAsyncQueue();
27461
- const zip$1 = new StreamingZip((err, data, final) => {
27517
+ const zip = new StreamingZip((err, data, final) => {
27462
27518
  if (err) {
27463
27519
  queue.fail(err);
27464
27520
  return;
@@ -27477,7 +27533,7 @@ onmessage = async (ev) => {
27477
27533
  comment: entry.options?.comment,
27478
27534
  smartStore: this._options.smartStore
27479
27535
  });
27480
- zip$1.add(file);
27536
+ zip.add(file);
27481
27537
  if (entry.source instanceof Uint8Array || entry.source instanceof ArrayBuffer || typeof entry.source === "string" || typeof Blob !== "undefined" && entry.source instanceof Blob) {
27482
27538
  const bytes = await toUint8Array(entry.source);
27483
27539
  await file.push(bytes, true);
@@ -27487,7 +27543,7 @@ onmessage = async (ev) => {
27487
27543
  }
27488
27544
  await file.complete();
27489
27545
  }
27490
- zip$1.end();
27546
+ zip.end();
27491
27547
  } catch (e) {
27492
27548
  queue.fail(e instanceof Error ? e : new Error(String(e)));
27493
27549
  }
@@ -27640,27 +27696,27 @@ onmessage = async (ev) => {
27640
27696
  });
27641
27697
  return;
27642
27698
  }
27643
- const parse$1 = createParse({
27699
+ const parse = createParse({
27644
27700
  ...this._options.parse ?? {},
27645
27701
  forceStream: true
27646
27702
  });
27647
27703
  const feedPromise = (async () => {
27648
27704
  try {
27649
27705
  for await (const chunk of toAsyncIterable(this._source)) await new Promise((resolve, reject) => {
27650
- parse$1.write(chunk, (err) => {
27706
+ parse.write(chunk, (err) => {
27651
27707
  if (err) reject(err);
27652
27708
  else resolve();
27653
27709
  });
27654
27710
  });
27655
- parse$1.end();
27656
- await parse$1.promise();
27711
+ parse.end();
27712
+ await parse.promise();
27657
27713
  } catch (e) {
27658
- parse$1.destroy(e instanceof Error ? e : new Error(String(e)));
27714
+ parse.destroy(e instanceof Error ? e : new Error(String(e)));
27659
27715
  throw e;
27660
27716
  }
27661
27717
  })();
27662
27718
  try {
27663
- for await (const entry of parse$1) yield new UnzipEntry({
27719
+ for await (const entry of parse) yield new UnzipEntry({
27664
27720
  kind: "stream",
27665
27721
  entry
27666
27722
  });