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

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