@odoo/o-spreadsheet 19.1.36 → 19.1.37

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.
@@ -2,9 +2,9 @@
2
2
  /**
3
3
  * This file is generated by o-spreadsheet build tools. Do not edit it.
4
4
  * @see https://github.com/odoo/o-spreadsheet
5
- * @version 19.1.36
6
- * @date 2026-09-18T05:25:25.806Z
7
- * @hash 5661311
5
+ * @version 19.1.37
6
+ * @date 2026-10-01T07:46:03.212Z
7
+ * @hash fe8ce23
8
8
  */
9
9
 
10
10
  import { App, Component, blockDom, markRaw, onMounted, onPatched, onWillPatch, onWillStart, onWillUnmount, onWillUpdateProps, status, toRaw, useChildSubEnv, useComponent, useEffect, useEnv, useExternalListener, useRef, useState, useSubEnv, whenReady, xml } from "@odoo/owl";
@@ -224,12 +224,19 @@ const GRAY_200 = "#E7E9ED";
224
224
  const TEXT_BODY = "#374151";
225
225
  const TEXT_BODY_MUTED = "#374151C2";
226
226
  const ACTION_COLOR = HIGHLIGHT_COLOR;
227
+ const CHART_PADDING = 20;
228
+ const CHART_PADDING_BOTTOM = 10;
229
+ const CHART_PADDING_TOP = 15;
227
230
  const CHART_TITLE_FONT_SIZE = 16;
231
+ const CHART_AXIS_TITLE_FONT_SIZE = 12;
232
+ const MASTER_CHART_HEIGHT = 60;
233
+ const CHART_COLORSCALE_WIDTH = 70;
228
234
  const DEFAULT_CHART_COLOR_SCALE = {
229
235
  minColor: "#FFF5EB",
230
236
  midColor: "#FD8D3C",
231
237
  maxColor: "#7F2704"
232
238
  };
239
+ const SCORECARD_CHART_TITLE_FONT_SIZE = 14;
233
240
  const PIVOT_TOKEN_COLOR = "#F28C28";
234
241
  const COLOR_PICKER_DEFAULTS = [
235
242
  "#000000",
@@ -313,8 +320,30 @@ const COLOR_PICKER_DEFAULTS = [
313
320
  "#20124D",
314
321
  "#4C1130"
315
322
  ];
323
+ const MIN_ROW_HEIGHT = 10;
324
+ const MIN_COL_WIDTH = 5;
325
+ const HEADER_HEIGHT = 26;
326
+ const HEADER_WIDTH = 48;
327
+ const DESKTOP_TOPBAR_TOOLBAR_HEIGHT = 34;
328
+ const DESKTOP_BOTTOMBAR_HEIGHT = 36;
329
+ const DEFAULT_CELL_WIDTH = 96;
316
330
  const DEFAULT_CELL_HEIGHT = 23;
317
- const FOOTER_HEIGHT = 2 * 23;
331
+ const SCROLLBAR_WIDTH = 15;
332
+ const AUTOFILL_EDGE_LENGTH = 8;
333
+ const ICON_EDGE_LENGTH = 18;
334
+ const MIN_CF_ICON_MARGIN = 4;
335
+ const MIN_CELL_TEXT_MARGIN = 4;
336
+ const PADDING_AUTORESIZE_VERTICAL = 3;
337
+ const PADDING_AUTORESIZE_HORIZONTAL = MIN_CELL_TEXT_MARGIN;
338
+ const GROUP_LAYER_WIDTH = 21;
339
+ const GRID_ICON_MARGIN = 2;
340
+ const GRID_ICON_EDGE_LENGTH = 17;
341
+ const FOOTER_HEIGHT = 2 * DEFAULT_CELL_HEIGHT;
342
+ const DATA_VALIDATION_CHIP_MARGIN = 5;
343
+ const MOBILE_WIDTH_BREAKPOINT = 768;
344
+ const MENU_WIDTH = 250;
345
+ const MENU_VERTICAL_PADDING = 6;
346
+ const DESKTOP_MENU_ITEM_HEIGHT = 26;
318
347
  const ZOOM_VALUES = [
319
348
  50,
320
349
  75,
@@ -339,20 +368,35 @@ const DEFAULT_STYLE = {
339
368
  const ROTATION_EPSILON = .001;
340
369
  const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
341
370
  const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
371
+ const DEFAULT_FONT_WEIGHT = "400";
342
372
  const DEFAULT_FONT_SIZE = DEFAULT_STYLE.fontSize;
373
+ const HEADER_FONT_SIZE = 11;
343
374
  const DEFAULT_FONT = "'Roboto', arial, 'Liberation Sans'";
344
375
  const DEFAULT_BORDER_DESC = {
345
376
  style: "thin",
346
377
  color: "#000000"
347
378
  };
379
+ const MAX_HISTORY_STEPS = 99;
348
380
  const DEFAULT_REVISION_ID = "START_REVISION";
381
+ const DEFAULT_FIGURE_HEIGHT = 335;
382
+ const DEFAULT_FIGURE_WIDTH = 536;
383
+ const FIGURE_BORDER_WIDTH = 1;
384
+ const MIN_FIG_SIZE = 80;
385
+ const MAX_CHAR_LABEL = 20;
386
+ const FIGURE_ID_SPLITTER = "??";
349
387
  const DEFAULT_GAUGE_LOWER_COLOR = "#EA6175";
350
388
  const DEFAULT_GAUGE_MIDDLE_COLOR = "#FFD86D";
351
389
  const DEFAULT_GAUGE_UPPER_COLOR = "#43C5B1";
352
390
  const DEFAULT_SCORECARD_BASELINE_MODE = "difference";
353
391
  const DEFAULT_SCORECARD_BASELINE_COLOR_UP = "#43C5B1";
354
392
  const DEFAULT_SCORECARD_BASELINE_COLOR_DOWN = "#EA6175";
393
+ const DEFAULT_SCORECARD_KEY_VALUE_FONT_SIZE = 32;
394
+ const DEFAULT_SCORECARD_BASELINE_FONT_SIZE = 16;
355
395
  const LINE_FILL_TRANSPARENCY = .4;
396
+ const LINE_DATA_POINT_RADIUS = 3;
397
+ const DEFAULT_WINDOW_SIZE = 2;
398
+ const DEBOUNCE_TIME = 200;
399
+ const MESSAGE_VERSION = 1;
356
400
  const FORBIDDEN_SHEETNAME_CHARS = [
357
401
  "'",
358
402
  "*",
@@ -363,6 +407,7 @@ const FORBIDDEN_SHEETNAME_CHARS = [
363
407
  "]"
364
408
  ];
365
409
  const FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX = /'|\*|\?|\/|\\|\[|\]/;
410
+ const FORMULA_REF_IDENTIFIER = "|";
366
411
  let DEFAULT_SHEETVIEW_SIZE = 0;
367
412
  function getDefaultSheetViewSize() {
368
413
  return DEFAULT_SHEETVIEW_SIZE;
@@ -371,6 +416,7 @@ function setDefaultSheetViewSize(size) {
371
416
  DEFAULT_SHEETVIEW_SIZE = size;
372
417
  }
373
418
  const MAXIMAL_FREEZABLE_RATIO = .85;
419
+ const NEWLINE = "\n";
374
420
  const FONT_SIZES = [
375
421
  6,
376
422
  7,
@@ -395,6 +441,8 @@ const PIVOT_TABLE_CONFIG = {
395
441
  styleId: "TableStyleMedium5",
396
442
  automaticAutofill: false
397
443
  };
444
+ const PIVOT_INDENT = 15;
445
+ const PIVOT_COLLAPSE_ICON_SIZE = 12;
398
446
  const PIVOT_MAX_NUMBER_OF_CELLS = 5e5;
399
447
  const DEFAULT_CURRENCY = {
400
448
  symbol: "$",
@@ -404,7 +452,7 @@ const DEFAULT_CURRENCY = {
404
452
  name: "Dollar"
405
453
  };
406
454
  const DEFAULT_CAROUSEL_TITLE_STYLE = {
407
- fontSize: 16,
455
+ fontSize: CHART_TITLE_FONT_SIZE,
408
456
  color: TEXT_BODY
409
457
  };
410
458
  const DEFAULT_TOKEN_COLOR = "light-dark(#000000, #ffffff)";
@@ -421,6 +469,7 @@ const tokenColors = {
421
469
  ARG_SEPARATOR: functionColor,
422
470
  ORPHAN_RIGHT_PAREN: "#ff0000"
423
471
  };
472
+ const DRAG_THRESHOLD = 5;
424
473
 
425
474
  //#endregion
426
475
  //#region src/helpers/misc.ts
@@ -777,7 +826,7 @@ const whiteSpaceCharacters = specialWhiteSpaceSpecialCharacters.concat([" "]);
777
826
  */
778
827
  function replaceNewLines(text) {
779
828
  if (!text) return "";
780
- return text.replace(newLineRegexp, "\n");
829
+ return text.replace(newLineRegexp, NEWLINE);
781
830
  }
782
831
  /**
783
832
  * Determine if the numbers are consecutive.
@@ -1006,7 +1055,7 @@ function toCartesian(xc) {
1006
1055
  consumeSpaces(chars);
1007
1056
  const col = letterPart - 1;
1008
1057
  const row = num - 1;
1009
- if (!chars.isOver() || col > MAX_COL || row > 9999998) throw new Error(`Invalid cell description: ${xc}`);
1058
+ if (!chars.isOver() || col > MAX_COL || row > MAX_ROW) throw new Error(`Invalid cell description: ${xc}`);
1010
1059
  return {
1011
1060
  col,
1012
1061
  row
@@ -1417,7 +1466,7 @@ function toUnboundedZone(xc) {
1417
1466
  const orderedZone = reorderZone(toZoneWithoutBoundaryChanges(xc));
1418
1467
  const bottom = orderedZone.bottom;
1419
1468
  const right = orderedZone.right;
1420
- if (bottom !== void 0 && bottom > 9999998 || right !== void 0 && right > MAX_COL) throw new Error(`Range string out of bounds: ${xc}`);
1469
+ if (bottom !== void 0 && bottom > MAX_ROW || right !== void 0 && right > MAX_COL) throw new Error(`Range string out of bounds: ${xc}`);
1421
1470
  if (bottom === void 0 && right === void 0) throw new Error("Wrong zone xc. The zone cannot be at the same time a full column and a full row");
1422
1471
  return orderedZone;
1423
1472
  }
@@ -1578,7 +1627,7 @@ function intersection(z1, z2) {
1578
1627
  return {
1579
1628
  top: Math.max(z1.top, z2.top),
1580
1629
  left: Math.max(z1.left, z2.left),
1581
- bottom: Math.min(z1.bottom ?? 9999998, z2.bottom),
1630
+ bottom: Math.min(z1.bottom ?? MAX_ROW, z2.bottom),
1582
1631
  right: Math.min(z1.right ?? MAX_COL, z2.right)
1583
1632
  };
1584
1633
  }
@@ -4548,7 +4597,7 @@ function parseNumberFormatTokens(tokens) {
4548
4597
  switch (token.type) {
4549
4598
  case "DIGIT":
4550
4599
  if (parsedPart === integerPart) parsedPart.push(token);
4551
- else if (numberOfDecimalsDigits < 20) {
4600
+ else if (numberOfDecimalsDigits < MAX_DECIMAL_PLACES) {
4552
4601
  parsedPart.push(token);
4553
4602
  numberOfDecimalsDigits++;
4554
4603
  }
@@ -4911,7 +4960,7 @@ const numberRepresentation = [];
4911
4960
  * exceed in the decimal part, in which case digits are rounded.
4912
4961
  *
4913
4962
  **/
4914
- function splitNumber(value, maxDecimals = 20) {
4963
+ function splitNumber(value, maxDecimals = MAX_DECIMAL_PLACES) {
4915
4964
  const asString = value.toString();
4916
4965
  if (asString.includes("e")) return splitNumberIntl(value, maxDecimals);
4917
4966
  if (Number.isInteger(value)) return {
@@ -4980,7 +5029,7 @@ function limitDecimalDigits(decimalDigits, maxDecimals) {
4980
5029
  * Supports numbers with a lot of digits that are transformed to scientific notation by
4981
5030
  * number.toString(), but is slow.
4982
5031
  */
4983
- function splitNumberIntl(value, maxDecimals = 20) {
5032
+ function splitNumberIntl(value, maxDecimals = MAX_DECIMAL_PLACES) {
4984
5033
  let formatter = numberRepresentation[maxDecimals];
4985
5034
  if (!formatter) {
4986
5035
  formatter = new Intl.NumberFormat("en-US", {
@@ -6054,7 +6103,7 @@ const MIN_DELAY = 20;
6054
6103
  * Returns a timeout delay in milliseconds.
6055
6104
  */
6056
6105
  function scrollDelay(value) {
6057
- return 20 + (140 - 20) * Math.exp(-.035 * (value - 1));
6106
+ return MIN_DELAY + (MAX_DELAY - MIN_DELAY) * Math.exp(-.035 * (value - 1));
6058
6107
  }
6059
6108
 
6060
6109
  //#endregion
@@ -6712,7 +6761,7 @@ function createEmptyStructure(node) {
6712
6761
  //#endregion
6713
6762
  //#region src/helpers/text_helper.ts
6714
6763
  function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
6715
- return numberOfLines * (textLineHeight + 4) - 4;
6764
+ return numberOfLines * (textLineHeight + MIN_CELL_TEXT_MARGIN) - MIN_CELL_TEXT_MARGIN;
6716
6765
  }
6717
6766
  function getCanvas(width = 100, height = 100) {
6718
6767
  return new OffscreenCanvas(width, height).getContext("2d");
@@ -6721,7 +6770,7 @@ function getCanvas(width = 100, height = 100) {
6721
6770
  * Get the default height of the cell given its style.
6722
6771
  */
6723
6772
  function getDefaultCellHeight(ctx, cell, style, locale, colSize) {
6724
- if (!cell || !cell.isFormula && !cell.content) return 23;
6773
+ if (!cell || !cell.isFormula && !cell.content) return DEFAULT_CELL_HEIGHT;
6725
6774
  let content = "";
6726
6775
  try {
6727
6776
  if (!cell.isFormula) {
@@ -6737,7 +6786,7 @@ function getDefaultCellHeight(ctx, cell, style, locale, colSize) {
6737
6786
  return getCellContentHeight(ctx, content, style, colSize);
6738
6787
  }
6739
6788
  function getCellContentHeight(ctx, content, style, colSize) {
6740
- return computeMultilineTextSize(ctx, splitTextToWidth(ctx, content, style, style?.wrapping === "wrap" ? colSize - 2 * 4 : void 0), style).height + 2 * 3;
6789
+ return computeMultilineTextSize(ctx, splitTextToWidth(ctx, content, style, style?.wrapping === "wrap" ? colSize - 2 * MIN_CELL_TEXT_MARGIN : void 0), style).height + 2 * PADDING_AUTORESIZE_VERTICAL;
6741
6790
  }
6742
6791
  function getDefaultContextFont(fontSize, bold = false, italic = false) {
6743
6792
  return `${italic ? "italic" : ""} ${bold ? "bold" : ""} ${fontSize}px ${DEFAULT_FONT}`;
@@ -6803,7 +6852,7 @@ function fontSizeInPixels(fontSize) {
6803
6852
  return Math.round(fontSize * 96 / 72);
6804
6853
  }
6805
6854
  function computeTextFont(style, fontUnit = "pt") {
6806
- return `${style.italic ? "italic " : ""}${style.bold ? "bold" : "400"} ${(fontUnit === "pt" ? computeTextFontSizeInPixels(style) : style.fontSize) ?? DEFAULT_FONT_SIZE}px ${DEFAULT_FONT}`;
6855
+ return `${style.italic ? "italic " : ""}${style.bold ? "bold" : DEFAULT_FONT_WEIGHT} ${(fontUnit === "pt" ? computeTextFontSizeInPixels(style) : style.fontSize) ?? DEFAULT_FONT_SIZE}px ${DEFAULT_FONT}`;
6807
6856
  }
6808
6857
  function computeTextFontSizeInPixels(style) {
6809
6858
  return fontSizeInPixels(style?.fontSize || DEFAULT_FONT_SIZE);
@@ -6827,7 +6876,7 @@ function splitTextToWidth(ctx, text, style, width) {
6827
6876
  if (!style) style = {};
6828
6877
  if (isMarkdownLink(text)) text = parseMarkdownLink(text).label;
6829
6878
  const brokenText = [];
6830
- const lines = text.includes("\n") ? text.split("\n") : [text];
6879
+ const lines = text.includes(NEWLINE) ? text.split(NEWLINE) : [text];
6831
6880
  for (const line of lines) {
6832
6881
  const words = line.includes(" ") ? line.split(" ") : [line];
6833
6882
  if (!width) {
@@ -6993,7 +7042,7 @@ function computeRotationPosition(rect, style) {
6993
7042
  let { x, y } = rect;
6994
7043
  const cos = Math.cos(-style.rotation);
6995
7044
  const sin = Math.sin(-style.rotation);
6996
- const width = rect.textWidth - 2 * 4;
7045
+ const width = rect.textWidth - 2 * MIN_CELL_TEXT_MARGIN;
6997
7046
  const height = rect.textHeight;
6998
7047
  const center = style.align === "center";
6999
7048
  const rotateTowardCellCenter = style.align === "left" === sin < 0;
@@ -7138,7 +7187,7 @@ const chartColorScalePlugin = {
7138
7187
  ctx.miterLimit = 1;
7139
7188
  const gradientHeight = (chart.chartArea.bottom - chart.chartArea.top) / 2;
7140
7189
  const gradientWidth = 10;
7141
- const gradientX = options.position === "left" ? 20 : ctx.canvas.width - 70;
7190
+ const gradientX = options.position === "left" ? CHART_PADDING : ctx.canvas.width - CHART_COLORSCALE_WIDTH;
7142
7191
  const gradientY = chart.chartArea.top;
7143
7192
  const gradient = ctx.createLinearGradient(0, gradientY + gradientHeight, 0, gradientY);
7144
7193
  const step = 1 / (options.colorScale.length - 1);
@@ -7148,7 +7197,7 @@ const chartColorScalePlugin = {
7148
7197
  ctx.fillStyle = gradient;
7149
7198
  ctx.fillRect(gradientX, gradientY, gradientWidth, gradientHeight);
7150
7199
  ctx.fillStyle = options.fontColor ?? "black";
7151
- ctx.font = getDefaultContextFont(12);
7200
+ ctx.font = getDefaultContextFont(CHART_AXIS_TITLE_FONT_SIZE);
7152
7201
  ctx.textAlign = "left";
7153
7202
  let minValue = Math.round(options.minValue * 100) / 100;
7154
7203
  let maxValue = Math.round(options.maxValue * 100) / 100;
@@ -7357,6 +7406,12 @@ const WIDTH_FACTOR = .143;
7357
7406
  const EXCEL_DEFAULT_COL_WIDTH = 8.43;
7358
7407
  /** unit : points */
7359
7408
  const EXCEL_DEFAULT_ROW_HEIGHT = 12.75;
7409
+ const EXCEL_IMPORT_DEFAULT_NUMBER_OF_COLS = 30;
7410
+ const EXCEL_IMPORT_DEFAULT_NUMBER_OF_ROWS = 100;
7411
+ /** The possible values for the XLSX polynomial trendline order are defined by the ST_Order simple type (§21.2.3.29) */
7412
+ const MAX_XLSX_POLYNOMIAL_DEGREE = 6;
7413
+ const FIRST_NUMFMT_ID = 164;
7414
+ const DEFAULT_DOUGHNUT_CHART_HOLE_SIZE = 50;
7360
7415
  const FORCE_DEFAULT_ARGS_FUNCTIONS = {
7361
7416
  FLOOR: [{
7362
7417
  type: "NUMBER",
@@ -7580,11 +7635,11 @@ function tokenize(str, locale = DEFAULT_LOCALE) {
7580
7635
  return result;
7581
7636
  }
7582
7637
  function tokenizeDebugger(chars) {
7583
- if (chars.current === "?") {
7638
+ if (chars.current === DEBUGGER_CHAR) {
7584
7639
  chars.shift();
7585
7640
  return {
7586
7641
  type: "DEBUGGER",
7587
- value: "?"
7642
+ value: DEBUGGER_CHAR
7588
7643
  };
7589
7644
  }
7590
7645
  return null;
@@ -7743,13 +7798,13 @@ function tokenizeSimpleSpace(chars) {
7743
7798
  }
7744
7799
  function tokenizeNewLine(chars) {
7745
7800
  let length = 0;
7746
- while (chars.current === "\n") {
7801
+ while (chars.current === NEWLINE) {
7747
7802
  length++;
7748
7803
  chars.shift();
7749
7804
  }
7750
7805
  if (length) return {
7751
7806
  type: "SPACE",
7752
- value: "\n".repeat(length)
7807
+ value: NEWLINE.repeat(length)
7753
7808
  };
7754
7809
  return null;
7755
7810
  }
@@ -8091,8 +8146,8 @@ function toExcelDataset(getters, ds) {
8091
8146
  if (ds.trend?.type) trend = {
8092
8147
  type: ds.trend.type === "polynomial" && ds.trend.order === 1 ? "linear" : SPREADSHEET_TO_EXCEL_TRENDLINE_TYPE_MAPPING[ds.trend.type],
8093
8148
  color: ds.trend.color,
8094
- order: ds.trend.order ? Math.min(ds.trend.order, 6) : void 0,
8095
- window: ds.trend.window || 2
8149
+ order: ds.trend.order ? Math.min(ds.trend.order, MAX_XLSX_POLYNOMIAL_DEGREE) : void 0,
8150
+ window: ds.trend.window || DEFAULT_WINDOW_SIZE
8096
8151
  };
8097
8152
  return {
8098
8153
  label,
@@ -8229,13 +8284,13 @@ function getPieColors(colors, dataSetsValues) {
8229
8284
  for (let i = 0; i <= maxLength; i++) pieColors.push(colors.next());
8230
8285
  return pieColors;
8231
8286
  }
8232
- function truncateLabel(label, maxLen = 20) {
8287
+ function truncateLabel(label, maxLen = MAX_CHAR_LABEL) {
8233
8288
  if (!label) return "";
8234
8289
  if (label.length > maxLen) return label.substring(0, maxLen) + "…";
8235
8290
  return label;
8236
8291
  }
8237
8292
  function isTrendLineAxis(axisID) {
8238
- return axisID === "x1" || axisID === "xMovingAverage";
8293
+ return axisID === TREND_LINE_XAXIS_ID || axisID === MOVING_AVERAGE_TREND_LINE_XAXIS_ID;
8239
8294
  }
8240
8295
 
8241
8296
  //#endregion
@@ -8541,7 +8596,7 @@ function getBarChartScales(definition, args) {
8541
8596
  scales = removeFalsyAttributes(scales);
8542
8597
  if (trendDatasets && trendDatasets.length && trendDatasets.some(isDefined)) {
8543
8598
  const maxLength = Math.max(...trendDatasets.map((trendDataset) => trendDataset?.length || 0));
8544
- scales["x1"] = {
8599
+ scales[TREND_LINE_XAXIS_ID] = {
8545
8600
  ...scales.x,
8546
8601
  labels: Array(maxLength).fill(""),
8547
8602
  offset: false,
@@ -8644,7 +8699,7 @@ function getLineChartScales(definition, args) {
8644
8699
  });
8645
8700
  }
8646
8701
  if (trendDatasets && trendDatasets.length && trendDatasets.some(isDefined)) {
8647
- scales["x1"] = {
8702
+ scales[TREND_LINE_XAXIS_ID] = {
8648
8703
  ...scales.x,
8649
8704
  display: false
8650
8705
  };
@@ -8654,9 +8709,9 @@ function getLineChartScales(definition, args) {
8654
8709
  };
8655
8710
  if (axisType === "category" || axisType === "time") {
8656
8711
  const maxLength = Math.max(...trendDatasets.map((trendDataset) => trendDataset?.length || 0));
8657
- scales["x1"]["type"] = "category";
8658
- scales["x1"]["labels"] = range(0, maxLength).map((x) => x.toString());
8659
- scales["x1"]["offset"] = false;
8712
+ scales[TREND_LINE_XAXIS_ID]["type"] = "category";
8713
+ scales[TREND_LINE_XAXIS_ID]["labels"] = range(0, maxLength).map((x) => x.toString());
8714
+ scales[TREND_LINE_XAXIS_ID]["offset"] = false;
8660
8715
  scales[MOVING_AVERAGE_TREND_LINE_XAXIS_ID]["type"] = "category";
8661
8716
  scales[MOVING_AVERAGE_TREND_LINE_XAXIS_ID]["offset"] = false;
8662
8717
  }
@@ -8801,7 +8856,7 @@ function getChartAxisTitleRuntime(design) {
8801
8856
  font: {
8802
8857
  style: italic ? "italic" : "normal",
8803
8858
  weight: bold ? "bold" : "normal",
8804
- size: design.title.fontSize ?? 12
8859
+ size: design.title.fontSize ?? CHART_AXIS_TITLE_FONT_SIZE
8805
8860
  },
8806
8861
  align: align === "left" ? "start" : align === "right" ? "end" : "center"
8807
8862
  };
@@ -8864,16 +8919,16 @@ function getLegendMargin(definition) {
8864
8919
  switch (definition.legendPosition) {
8865
8920
  case "top":
8866
8921
  case "right": return {
8867
- top: !!definition.title.text ? 15 + 30 : 15,
8868
- left: 20,
8869
- right: 20
8922
+ top: !!definition.title.text ? CHART_PADDING_TOP + 30 : CHART_PADDING_TOP,
8923
+ left: CHART_PADDING,
8924
+ right: CHART_PADDING
8870
8925
  };
8871
8926
  case "bottom":
8872
8927
  case "left":
8873
8928
  case "none": return {
8874
- left: 20,
8875
- right: 20,
8876
- bottom: 10
8929
+ left: CHART_PADDING,
8930
+ right: CHART_PADDING,
8931
+ bottom: CHART_PADDING_BOTTOM
8877
8932
  };
8878
8933
  }
8879
8934
  }
@@ -8903,7 +8958,7 @@ function getBarChartDatasets(definition, args) {
8903
8958
  label,
8904
8959
  data,
8905
8960
  hidden,
8906
- borderColor: definition.background || "#FFFFFF",
8961
+ borderColor: definition.background || BACKGROUND_CHART_COLOR,
8907
8962
  borderWidth: definition.stacked ? 1 : 0,
8908
8963
  backgroundColor,
8909
8964
  yAxisID: definition.horizontal ? "y" : definition.dataSets?.[index].yAxisId || "y",
@@ -8931,8 +8986,8 @@ function getCalendarChartDatasetAndLabels(definition, args) {
8931
8986
  for (const dataSetValues of dataSetsValues) dataSets.push({
8932
8987
  label: dataSetValues.label,
8933
8988
  data: dataSetValues.data.map((v) => 1),
8934
- backgroundColor: dataSetValues.data.map((v) => v !== void 0 ? colorMap(v) : definition.missingValueColor || "#00000000"),
8935
- borderColor: definition.background || "#FFFFFF",
8989
+ backgroundColor: dataSetValues.data.map((v) => v !== void 0 ? colorMap(v) : definition.missingValueColor || COLOR_TRANSPARENT),
8990
+ borderColor: definition.background || BACKGROUND_CHART_COLOR,
8936
8991
  borderSkipped: false,
8937
8992
  borderWidth: 1,
8938
8993
  barPercentage: 1,
@@ -8946,9 +9001,9 @@ function getCalendarChartDatasetAndLabels(definition, args) {
8946
9001
  }
8947
9002
  function getWaterfallDatasetAndLabels(definition, args) {
8948
9003
  const { dataSetsValues, labels } = args;
8949
- const negativeColor = definition.negativeValuesColor || "#EA6175";
8950
- const positiveColor = definition.positiveValuesColor || "#4EA7F2";
8951
- const subTotalColor = definition.subTotalValuesColor || "#AAAAAA";
9004
+ const negativeColor = definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
9005
+ const positiveColor = definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
9006
+ const subTotalColor = definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
8952
9007
  const backgroundColor = [];
8953
9008
  const datasetValues = [];
8954
9009
  const dataset = {
@@ -9009,7 +9064,7 @@ function getLineChartDatasets(definition, args) {
9009
9064
  backgroundColor: areaChart ? setColorAlpha(color, LINE_FILL_TRANSPARENCY) : color,
9010
9065
  pointBackgroundColor: color,
9011
9066
  fill: areaChart ? getFillingMode(index, stackedChart) : false,
9012
- pointRadius: definition.hideDataMarkers ? 0 : 3,
9067
+ pointRadius: definition.hideDataMarkers ? 0 : LINE_DATA_POINT_RADIUS,
9013
9068
  yAxisID: definition.dataSets?.[index].yAxisId || "y"
9014
9069
  };
9015
9070
  dataSets.push(dataset);
@@ -9065,7 +9120,7 @@ function getComboChartDatasets(definition, args) {
9065
9120
  xAxisID: "x",
9066
9121
  type,
9067
9122
  order: type === "bar" ? dataSetsValues.length + index : index,
9068
- pointRadius: definition.hideDataMarkers ? 0 : 3
9123
+ pointRadius: definition.hideDataMarkers ? 0 : LINE_DATA_POINT_RADIUS
9069
9124
  };
9070
9125
  if (dataset.type === "bar") {
9071
9126
  dataset.barPercentage = .9;
@@ -9097,7 +9152,7 @@ function getRadarChartDatasets(definition, args) {
9097
9152
  borderColor,
9098
9153
  backgroundColor: borderColor,
9099
9154
  pointBackgroundColor: borderColor,
9100
- pointRadius: definition.hideDataMarkers ? 0 : 3
9155
+ pointRadius: definition.hideDataMarkers ? 0 : LINE_DATA_POINT_RADIUS
9101
9156
  };
9102
9157
  if (fill) {
9103
9158
  dataset.backgroundColor = setColorAlpha(borderColor, LINE_FILL_TRANSPARENCY);
@@ -9153,7 +9208,7 @@ function getFunnelChartDatasets(definition, args) {
9153
9208
  xAxisID: "x",
9154
9209
  barPercentage: 1,
9155
9210
  categoryPercentage: 1,
9156
- borderColor: definition.background || "#FFFFFF",
9211
+ borderColor: definition.background || BACKGROUND_CHART_COLOR,
9157
9212
  borderWidth: 3
9158
9213
  }];
9159
9214
  }
@@ -9178,12 +9233,12 @@ function getSunburstChartDatasets(definition, args) {
9178
9233
  data: data[i],
9179
9234
  borderColor: (ctx) => {
9180
9235
  const data = ctx.type === "data" ? ctx.raw : void 0;
9181
- if (!data || data.label === "nullValue") return COLOR_TRANSPARENT;
9182
- return definition.background || "#FFFFFF";
9236
+ if (!data || data.label === GHOST_SUNBURST_VALUE) return COLOR_TRANSPARENT;
9237
+ return definition.background || BACKGROUND_CHART_COLOR;
9183
9238
  },
9184
9239
  backgroundColor: (ctx) => {
9185
9240
  const data = ctx.type === "data" ? ctx.raw : void 0;
9186
- if (!data || data.label === "nullValue") return COLOR_TRANSPARENT;
9241
+ if (!data || data.label === GHOST_SUNBURST_VALUE) return COLOR_TRANSPARENT;
9187
9242
  const rootGroup = data.groups[0];
9188
9243
  return groupColors.find((groupColor) => groupColor.label === rootGroup)?.color;
9189
9244
  },
@@ -9323,7 +9378,7 @@ function getTrendingLineDataSet(dataset, config, data) {
9323
9378
  const borderColor = config.color || lightenColor(rgbaToHex(defaultBorderColor), .5);
9324
9379
  return {
9325
9380
  type: "line",
9326
- xAxisID: config.type === "trailingMovingAverage" ? MOVING_AVERAGE_TREND_LINE_XAXIS_ID : "x1",
9381
+ xAxisID: config.type === "trailingMovingAverage" ? MOVING_AVERAGE_TREND_LINE_XAXIS_ID : TREND_LINE_XAXIS_ID,
9327
9382
  yAxisID: dataset.yAxisID,
9328
9383
  label: dataset.label ? _t("Trend line for %s", dataset.label) : "",
9329
9384
  data,
@@ -9434,7 +9489,7 @@ const sunburstHoverPlugin = {
9434
9489
  for (const metaSet of chart.getSortedVisibleDatasetMetas()) for (const arcElement of metaSet.data) {
9435
9490
  const context = arcElement["$context"];
9436
9491
  const { datasetIndex, index, dataset, raw } = context;
9437
- if (raw.label === "nullValue") continue;
9492
+ if (raw.label === GHOST_SUNBURST_VALUE) continue;
9438
9493
  const originalBackgroundColor = typeof dataset.backgroundColor === "function" ? dataset.backgroundColor(context) : dataset.backgroundColor;
9439
9494
  if (activeDataPoints.length && !activeDataPoints.some((el) => el.datasetIndex === datasetIndex && el.index === index)) arcElement.options.backgroundColor = lightenColor(originalBackgroundColor, .5);
9440
9495
  else arcElement.options.backgroundColor = originalBackgroundColor;
@@ -9462,7 +9517,7 @@ function drawSunburstChartValues(chart, options, ctx) {
9462
9517
  const lineHeight = fontSize + Y_PADDING;
9463
9518
  for (const dataset of chart._metasets) for (let i = 0; i < dataset._dataset.data.length; i++) {
9464
9519
  const rawData = dataset._dataset.data[i];
9465
- if (rawData.label === "nullValue") continue;
9520
+ if (rawData.label === GHOST_SUNBURST_VALUE) continue;
9466
9521
  const valuesToDisplay = [options.showLabels ? rawData.label : void 0, options.showValues ? options.callback(rawData.value, "y") : void 0].filter(isDefined);
9467
9522
  const arc = dataset.data[i];
9468
9523
  let { startAngle, endAngle, innerRadius, outerRadius, circumference } = arc;
@@ -9862,8 +9917,8 @@ var ScorecardChart$1 = class ScorecardChart$1 extends AbstractChart {
9862
9917
  this.baselineMode = definition.baselineMode;
9863
9918
  this.baselineDescr = definition.baselineDescr;
9864
9919
  this.background = definition.background;
9865
- this.baselineColorUp = definition.baselineColorUp ?? "#43C5B1";
9866
- this.baselineColorDown = definition.baselineColorDown ?? "#EA6175";
9920
+ this.baselineColorUp = definition.baselineColorUp ?? DEFAULT_SCORECARD_BASELINE_COLOR_UP;
9921
+ this.baselineColorDown = definition.baselineColorDown ?? DEFAULT_SCORECARD_BASELINE_COLOR_DOWN;
9867
9922
  this.humanize = definition.humanize ?? true;
9868
9923
  }
9869
9924
  static validateChartDefinition(validator, definition) {
@@ -9947,7 +10002,7 @@ function drawScoreChart(structure, canvas, zoom = 1) {
9947
10002
  canvas.width = dpr * structure.canvas.width * zoom;
9948
10003
  canvas.height = dpr * structure.canvas.height * zoom;
9949
10004
  ctx.scale(dpr * zoom, dpr * zoom);
9950
- const availableWidth = structure.canvas.width - 20;
10005
+ const availableWidth = structure.canvas.width - CHART_PADDING;
9951
10006
  ctx.fillStyle = structure.canvas.backgroundColor;
9952
10007
  ctx.fillRect(0, 0, structure.canvas.width, structure.canvas.height);
9953
10008
  if (structure.title) {
@@ -10126,16 +10181,16 @@ var ScorecardChartConfigBuilder = class {
10126
10181
  x = (this.width - titleWidth) / 2;
10127
10182
  break;
10128
10183
  case "right":
10129
- x = this.width - titleWidth - 20;
10184
+ x = this.width - titleWidth - CHART_PADDING;
10130
10185
  break;
10131
- default: x = 20;
10186
+ default: x = CHART_PADDING;
10132
10187
  }
10133
10188
  structure.title = {
10134
10189
  text: this.title,
10135
10190
  style: style.title,
10136
10191
  position: {
10137
10192
  x,
10138
- y: 10 + titleHeight / 2
10193
+ y: CHART_PADDING_BOTTOM + titleHeight / 2
10139
10194
  }
10140
10195
  };
10141
10196
  }
@@ -10146,10 +10201,10 @@ var ScorecardChartConfigBuilder = class {
10146
10201
  let baselineX;
10147
10202
  switch (this.runtime.baselineStyle?.align) {
10148
10203
  case "right":
10149
- baselineX = this.width - 20 - baselineDescrWidth - baselineWidth;
10204
+ baselineX = this.width - CHART_PADDING - baselineDescrWidth - baselineWidth;
10150
10205
  break;
10151
10206
  case "left":
10152
- baselineX = 20 + baselineArrowSize;
10207
+ baselineX = CHART_PADDING + baselineArrowSize;
10153
10208
  break;
10154
10209
  default: baselineX = (this.width - baselineWidth - baselineDescrWidth + baselineArrowSize) / 2;
10155
10210
  }
@@ -10159,7 +10214,7 @@ var ScorecardChartConfigBuilder = class {
10159
10214
  style: style.baselineValue,
10160
10215
  position: {
10161
10216
  x: baselineX,
10162
- y: this.keyValue ? this.height * (1 - BOTTOM_PADDING_RATIO * (this.runtime.progressBar ? 1 : 2)) : this.height - (this.height - titleHeight - baselineHeight) / 2 - 10
10217
+ y: this.keyValue ? this.height * (1 - BOTTOM_PADDING_RATIO * (this.runtime.progressBar ? 1 : 2)) : this.height - (this.height - titleHeight - baselineHeight) / 2 - CHART_PADDING_BOTTOM
10163
10218
  }
10164
10219
  };
10165
10220
  if (style.baselineArrow && !this.runtime.progressBar) structure.baselineArrow = {
@@ -10187,12 +10242,12 @@ var ScorecardChartConfigBuilder = class {
10187
10242
  progressBarHeight = this.height * .05;
10188
10243
  structure.progressBar = {
10189
10244
  position: {
10190
- x: 2 * 20,
10245
+ x: 2 * CHART_PADDING,
10191
10246
  y: this.height * (1 - 2 * BOTTOM_PADDING_RATIO) - baselineHeight - progressBarHeight
10192
10247
  },
10193
10248
  dimension: {
10194
10249
  height: progressBarHeight,
10195
- width: this.width - 4 * 20
10250
+ width: this.width - 4 * CHART_PADDING
10196
10251
  },
10197
10252
  value: this.runtime.progressBar.value,
10198
10253
  style: {
@@ -10206,10 +10261,10 @@ var ScorecardChartConfigBuilder = class {
10206
10261
  let keyX;
10207
10262
  switch (this.runtime.keyValueStyle?.align) {
10208
10263
  case "right":
10209
- keyX = this.width - 20 - keyDescrWidth - keyWidth;
10264
+ keyX = this.width - CHART_PADDING - keyDescrWidth - keyWidth;
10210
10265
  break;
10211
10266
  case "left":
10212
- keyX = 20;
10267
+ keyX = CHART_PADDING;
10213
10268
  break;
10214
10269
  default: keyX = (this.width - keyWidth - keyDescrWidth) / 2;
10215
10270
  }
@@ -10217,8 +10272,8 @@ var ScorecardChartConfigBuilder = class {
10217
10272
  text: this.keyValue,
10218
10273
  style: style.keyValue,
10219
10274
  position: {
10220
- x: Math.max(20, keyX),
10221
- y: this.height * (.5 - BOTTOM_PADDING_RATIO * 2) + 10 / 2 + (titleHeight + keyHeight / 2) / 2
10275
+ x: Math.max(CHART_PADDING, keyX),
10276
+ y: this.height * (.5 - BOTTOM_PADDING_RATIO * 2) + CHART_PADDING_BOTTOM / 2 + (titleHeight + keyHeight / 2) / 2
10222
10277
  }
10223
10278
  };
10224
10279
  if (structure.key && this.keyDescr) {
@@ -10275,14 +10330,14 @@ var ScorecardChartConfigBuilder = class {
10275
10330
  };
10276
10331
  }
10277
10332
  getTextStyles() {
10278
- const keyValueFontSize = this.runtime.keyValueStyle?.fontSize ?? 32;
10333
+ const keyValueFontSize = this.runtime.keyValueStyle?.fontSize ?? DEFAULT_SCORECARD_KEY_VALUE_FONT_SIZE;
10279
10334
  const keyValueDescrFontSize = Math.floor(.9 * keyValueFontSize);
10280
- let baselineValueFontSize = this.runtime.baselineStyle?.fontSize ?? 16;
10335
+ let baselineValueFontSize = this.runtime.baselineStyle?.fontSize ?? DEFAULT_SCORECARD_BASELINE_FONT_SIZE;
10281
10336
  const baselineDescrFontSize = Math.floor(.9 * baselineValueFontSize);
10282
10337
  if (this.runtime.progressBar) baselineValueFontSize /= 1.5;
10283
10338
  return {
10284
10339
  title: {
10285
- font: getDefaultContextFont(this.runtime.title.fontSize ?? 14, this.runtime.title.bold, this.runtime.title.italic),
10340
+ font: getDefaultContextFont(this.runtime.title.fontSize ?? SCORECARD_CHART_TITLE_FONT_SIZE, this.runtime.title.bold, this.runtime.title.italic),
10286
10341
  color: this.runtime.title.color ?? this.secondaryFontColor
10287
10342
  },
10288
10343
  keyValue: {
@@ -10758,35 +10813,35 @@ function getGaugeRenderingConfig(boundingRect, runtime, ctx) {
10758
10813
  x: boundingRect.width / 2,
10759
10814
  y: gaugeRect.y + gaugeRect.height - gaugeRect.height / 12
10760
10815
  };
10761
- let gaugeValueFontSize = 80;
10816
+ let gaugeValueFontSize = GAUGE_DEFAULT_VALUE_FONT_SIZE;
10762
10817
  if (gaugeRect.height < 300) gaugeValueFontSize = gaugeValueFontSize * (gaugeRect.height / 300);
10763
10818
  const maxTextWidth = gaugeRect.width / 2;
10764
10819
  const gaugeLabel = runtime.gaugeValue?.label || "-";
10765
10820
  if (computeTextWidth(ctx, gaugeLabel, { fontSize: gaugeValueFontSize }, "px") > maxTextWidth) gaugeValueFontSize = getFontSizeMatchingWidth(maxTextWidth, gaugeValueFontSize, (fontSize) => computeTextWidth(ctx, gaugeLabel, { fontSize }, "px"));
10766
10821
  const minLabelPosition = {
10767
10822
  x: gaugeRect.x + gaugeArcWidth / 2,
10768
- y: gaugeRect.y + gaugeRect.height + 12
10823
+ y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
10769
10824
  };
10770
10825
  const maxLabelPosition = {
10771
10826
  x: gaugeRect.x + gaugeRect.width - gaugeArcWidth / 2,
10772
- y: gaugeRect.y + gaugeRect.height + 12
10827
+ y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
10773
10828
  };
10774
10829
  const textColor = chartMutedFontColor(runtime.background);
10775
10830
  const inflectionValues = getInflectionValues(runtime, gaugeRect, textColor, ctx);
10776
10831
  let x = 0, titleWidth = 0, titleHeight = 0;
10777
10832
  if (runtime.title.text) ({width: titleWidth, height: titleHeight} = computeTextDimension(ctx, runtime.title.text, {
10778
- fontSize: 16,
10833
+ fontSize: CHART_TITLE_FONT_SIZE,
10779
10834
  ...runtime.title
10780
10835
  }, "px"));
10781
10836
  switch (runtime.title.align) {
10782
10837
  case "right":
10783
- x = boundingRect.width - titleWidth - 20;
10838
+ x = boundingRect.width - titleWidth - CHART_PADDING;
10784
10839
  break;
10785
10840
  case "center":
10786
10841
  x = (boundingRect.width - titleWidth) / 2;
10787
10842
  break;
10788
10843
  default:
10789
- x = 20;
10844
+ x = CHART_PADDING;
10790
10845
  break;
10791
10846
  }
10792
10847
  return {
@@ -10794,10 +10849,10 @@ function getGaugeRenderingConfig(boundingRect, runtime, ctx) {
10794
10849
  height: boundingRect.height,
10795
10850
  title: {
10796
10851
  label: runtime.title.text ?? "",
10797
- fontSize: runtime.title.fontSize ?? 16,
10852
+ fontSize: runtime.title.fontSize ?? CHART_TITLE_FONT_SIZE,
10798
10853
  textPosition: {
10799
10854
  x,
10800
- y: 15 + titleHeight / 2
10855
+ y: CHART_PADDING_TOP + titleHeight / 2
10801
10856
  },
10802
10857
  color: runtime.title.color ?? textColor,
10803
10858
  bold: runtime.title.bold,
@@ -10820,13 +10875,13 @@ function getGaugeRenderingConfig(boundingRect, runtime, ctx) {
10820
10875
  minLabel: {
10821
10876
  label: runtime.minValue.label,
10822
10877
  textPosition: minLabelPosition,
10823
- fontSize: 12,
10878
+ fontSize: GAUGE_LABELS_FONT_SIZE,
10824
10879
  color: textColor
10825
10880
  },
10826
10881
  maxLabel: {
10827
10882
  label: runtime.maxValue.label,
10828
10883
  textPosition: maxLabelPosition,
10829
- fontSize: 12,
10884
+ fontSize: GAUGE_LABELS_FONT_SIZE,
10830
10885
  color: textColor
10831
10886
  }
10832
10887
  };
@@ -10836,9 +10891,9 @@ function getGaugeRenderingConfig(boundingRect, runtime, ctx) {
10836
10891
  * space for the title and labels.
10837
10892
  */
10838
10893
  function getGaugeRect(boundingRect, title) {
10839
- const titleHeight = title ? 25 : 0;
10840
- const drawHeight = boundingRect.height - 20 - titleHeight - 10;
10841
- const drawWidth = boundingRect.width - 30 * 2;
10894
+ const titleHeight = title ? GAUGE_TITLE_SECTION_HEIGHT : 0;
10895
+ const drawHeight = boundingRect.height - GAUGE_PADDING_BOTTOM - titleHeight - GAUGE_PADDING_TOP;
10896
+ const drawWidth = boundingRect.width - GAUGE_PADDING_SIDE * 2;
10842
10897
  let gaugeWidth;
10843
10898
  let gaugeHeight;
10844
10899
  if (drawWidth > 2 * drawHeight) {
@@ -10849,8 +10904,8 @@ function getGaugeRect(boundingRect, title) {
10849
10904
  gaugeHeight = drawWidth / 2;
10850
10905
  }
10851
10906
  return {
10852
- x: 30 + (drawWidth - gaugeWidth) / 2,
10853
- y: titleHeight + 10 + (drawHeight - gaugeHeight) / 2,
10907
+ x: GAUGE_PADDING_SIDE + (drawWidth - gaugeWidth) / 2,
10908
+ y: titleHeight + GAUGE_PADDING_TOP + (drawHeight - gaugeHeight) / 2,
10854
10909
  width: gaugeWidth,
10855
10910
  height: gaugeHeight
10856
10911
  };
@@ -10867,20 +10922,20 @@ function getInflectionValues(runtime, gaugeRect, textColor, ctx) {
10867
10922
  x: gaugeRect.x + gaugeRect.width / 2,
10868
10923
  y: gaugeRect.y + gaugeRect.height
10869
10924
  };
10870
- const textStyle = { fontSize: 12 };
10925
+ const textStyle = { fontSize: GAUGE_LABELS_FONT_SIZE };
10871
10926
  const inflectionValues = [];
10872
10927
  const inflectionValuesTextRects = [];
10873
10928
  for (const inflectionValue of runtime.inflectionValues) {
10874
10929
  const percentage = (inflectionValue.value - minValue.value) / (maxValue.value - minValue.value);
10875
10930
  const labelWidth = computeTextWidth(ctx, inflectionValue.label, textStyle, "px");
10876
10931
  const angle = Math.PI - Math.PI * percentage;
10877
- const textRect = getRectangleTangentToCircle(angle, gaugeRect.height + GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN, gaugeCircleCenter.x, gaugeCircleCenter.y, labelWidth + 2, 12);
10878
- const offset = inflectionValuesTextRects.some((rect) => doRectanglesIntersect(rect, textRect)) ? 12 : 0;
10932
+ const textRect = getRectangleTangentToCircle(angle, gaugeRect.height + GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN, gaugeCircleCenter.x, gaugeCircleCenter.y, labelWidth + 2, GAUGE_LABELS_FONT_SIZE);
10933
+ const offset = inflectionValuesTextRects.some((rect) => doRectanglesIntersect(rect, textRect)) ? GAUGE_LABELS_FONT_SIZE : 0;
10879
10934
  inflectionValuesTextRects.push(textRect);
10880
10935
  inflectionValues.push({
10881
10936
  rotation: angle,
10882
10937
  label: inflectionValue.label,
10883
- fontSize: 12,
10938
+ fontSize: GAUGE_LABELS_FONT_SIZE,
10884
10939
  color: textColor,
10885
10940
  offset
10886
10941
  });
@@ -11602,7 +11657,7 @@ function predictLinearValues(Y, X, newX, computeIntercept) {
11602
11657
  });
11603
11658
  return newY.length === newX.length ? newY : transposeMatrix(newY);
11604
11659
  }
11605
- function getMovingAverageValues(dataset, labels, windowSize = 2) {
11660
+ function getMovingAverageValues(dataset, labels, windowSize = DEFAULT_WINDOW_SIZE) {
11606
11661
  const values = [];
11607
11662
  for (let i = 0; i < windowSize - 1; i++) values.push({
11608
11663
  x: labels[i],
@@ -13215,19 +13270,19 @@ function getTopPaddingForDashboard(definition, getters) {
13215
13270
  //#region src/helpers/figures/charts/runtime/chartjs_layout.ts
13216
13271
  function getChartLayout(definition, args) {
13217
13272
  return { padding: {
13218
- left: 20,
13219
- right: 20,
13220
- top: Math.max(15, args.topPadding || 0),
13221
- bottom: 10
13273
+ left: CHART_PADDING,
13274
+ right: CHART_PADDING,
13275
+ top: Math.max(CHART_PADDING_TOP, args.topPadding || 0),
13276
+ bottom: CHART_PADDING_BOTTOM
13222
13277
  } };
13223
13278
  }
13224
13279
  function getCalendarChartLayout(definition, args) {
13225
13280
  const legendPosition = definition.legendPosition;
13226
13281
  return { padding: {
13227
- left: 20 + (legendPosition === "left" ? 70 : 0),
13228
- right: 20 + (legendPosition === "right" ? 70 : 0),
13229
- top: Math.max(15, args.topPadding || 0),
13230
- bottom: 10
13282
+ left: CHART_PADDING + (legendPosition === "left" ? CHART_COLORSCALE_WIDTH : 0),
13283
+ right: CHART_PADDING + (legendPosition === "right" ? CHART_COLORSCALE_WIDTH : 0),
13284
+ top: Math.max(CHART_PADDING_TOP, args.topPadding || 0),
13285
+ bottom: CHART_PADDING_BOTTOM
13231
13286
  } };
13232
13287
  }
13233
13288
 
@@ -13304,9 +13359,9 @@ function getComboChartLegend(definition, args) {
13304
13359
  }
13305
13360
  function getWaterfallChartLegend(definition, args) {
13306
13361
  const fontColor = chartFontColor(definition.background);
13307
- const negativeColor = definition.negativeValuesColor || "#EA6175";
13308
- const positiveColor = definition.positiveValuesColor || "#4EA7F2";
13309
- const subTotalColor = definition.subTotalValuesColor || "#AAAAAA";
13362
+ const negativeColor = definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
13363
+ const positiveColor = definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
13364
+ const subTotalColor = definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
13310
13365
  return {
13311
13366
  ...getLegendDisplayOptions(definition, args),
13312
13367
  labels: {
@@ -13545,11 +13600,11 @@ function getChartTitle(definition, getters) {
13545
13600
  color: chartTitle?.color ?? fontColor,
13546
13601
  align: chartTitle.align === "center" ? "center" : chartTitle.align === "right" ? "end" : "start",
13547
13602
  font: {
13548
- size: definition.title.fontSize ?? 16,
13603
+ size: definition.title.fontSize ?? CHART_TITLE_FONT_SIZE,
13549
13604
  weight: chartTitle.bold ? "bold" : "normal",
13550
13605
  style: chartTitle.italic ? "italic" : "normal"
13551
13606
  },
13552
- padding: { bottom: definition.legendPosition === "top" ? 0 : 20 }
13607
+ padding: { bottom: definition.legendPosition === "top" ? 0 : CHART_PADDING }
13553
13608
  };
13554
13609
  }
13555
13610
 
@@ -14066,7 +14121,7 @@ var BarChart = class BarChart extends AbstractChart {
14066
14121
  const definition = this.getDefinition();
14067
14122
  return {
14068
14123
  ...definition,
14069
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
14124
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
14070
14125
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
14071
14126
  dataSets,
14072
14127
  labelRange,
@@ -14102,7 +14157,7 @@ function createBarChartRuntime(chart, getters) {
14102
14157
  }
14103
14158
  }
14104
14159
  },
14105
- background: chart.background || "#FFFFFF"
14160
+ background: chart.background || BACKGROUND_CHART_COLOR
14106
14161
  };
14107
14162
  }
14108
14163
 
@@ -14587,7 +14642,7 @@ var LineChart = class LineChart extends AbstractChart {
14587
14642
  const definition = this.getDefinition();
14588
14643
  return {
14589
14644
  ...definition,
14590
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
14645
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
14591
14646
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
14592
14647
  dataSets,
14593
14648
  labelRange,
@@ -14625,7 +14680,7 @@ function createLineChartRuntime(chart, getters) {
14625
14680
  }
14626
14681
  }
14627
14682
  },
14628
- background: chart.background || "#FFFFFF"
14683
+ background: chart.background || BACKGROUND_CHART_COLOR
14629
14684
  };
14630
14685
  }
14631
14686
 
@@ -14714,7 +14769,7 @@ var PieChart = class PieChart extends AbstractChart {
14714
14769
  const { dataSets, labelRange } = this.getCommonDataSetAttributesForExcel(this.labelRange, this.dataSets, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
14715
14770
  return {
14716
14771
  ...this.getDefinition(),
14717
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
14772
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
14718
14773
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
14719
14774
  dataSets,
14720
14775
  labelRange
@@ -14748,7 +14803,7 @@ function createPieChartRuntime(chart, getters) {
14748
14803
  }
14749
14804
  }
14750
14805
  },
14751
- background: chart.background || "#FFFFFF"
14806
+ background: chart.background || BACKGROUND_CHART_COLOR
14752
14807
  };
14753
14808
  }
14754
14809
 
@@ -14901,7 +14956,7 @@ function createWaterfallChartRuntime(chart, getters) {
14901
14956
  }
14902
14957
  }
14903
14958
  },
14904
- background: chart.background || "#FFFFFF"
14959
+ background: chart.background || BACKGROUND_CHART_COLOR
14905
14960
  };
14906
14961
  }
14907
14962
 
@@ -14918,7 +14973,7 @@ var charts_exports = /* @__PURE__ */ __exportAll({
14918
14973
  PieChart: () => PieChart,
14919
14974
  SPREADSHEET_TO_EXCEL_TRENDLINE_TYPE_MAPPING: () => SPREADSHEET_TO_EXCEL_TRENDLINE_TYPE_MAPPING,
14920
14975
  ScorecardChart: () => ScorecardChart$1,
14921
- TREND_LINE_XAXIS_ID: () => "x1",
14976
+ TREND_LINE_XAXIS_ID: () => TREND_LINE_XAXIS_ID,
14922
14977
  WaterfallChart: () => WaterfallChart,
14923
14978
  adaptChartRange: () => adaptChartRange,
14924
14979
  chartFactory: () => chartFactory,
@@ -15316,7 +15371,7 @@ function getElementMargins(el) {
15316
15371
 
15317
15372
  //#endregion
15318
15373
  //#region src/components/figures/chart/chartJs/zoomable_chart/zoomable_chart_store.ts
15319
- const TREND_LINE_AXES_IDS = ["x1", MOVING_AVERAGE_TREND_LINE_XAXIS_ID];
15374
+ const TREND_LINE_AXES_IDS = [TREND_LINE_XAXIS_ID, MOVING_AVERAGE_TREND_LINE_XAXIS_ID];
15320
15375
  const ZOOMABLE_AXIS_IDS = ["x", ...TREND_LINE_AXES_IDS];
15321
15376
  var ZoomableChartStore = class extends SpreadsheetStore {
15322
15377
  mutators = [
@@ -15413,7 +15468,7 @@ var ZoomableChartJsComponent = class extends ChartJsComponent {
15413
15468
  this.removeEventListeners();
15414
15469
  }
15415
15470
  get containerStyle() {
15416
- return cssPropertiesToCss({ height: this.sliceable ? `calc(100% - ${60}px)` : "100%" });
15471
+ return cssPropertiesToCss({ height: this.sliceable ? `calc(100% - ${MASTER_CHART_HEIGHT}px)` : "100%" });
15417
15472
  }
15418
15473
  get masterChartContainerStyle() {
15419
15474
  const runtime = this.env.model.getters.getChartRuntime(this.props.chartId);
@@ -15472,8 +15527,8 @@ var ZoomableChartJsComponent = class extends ChartJsComponent {
15472
15527
  getAxisLimitsFromDataset(chartData) {
15473
15528
  const xValues = chartData.data.datasets.map((ds) => ds.data).flat().map((d, i) => typeof d === "object" && d !== null ? d.x : i);
15474
15529
  return {
15475
- min: Math.min(...xValues),
15476
- max: Math.max(...xValues)
15530
+ min: largeMin(xValues),
15531
+ max: largeMax(xValues)
15477
15532
  };
15478
15533
  }
15479
15534
  setMasterChartCursor(runtime) {
@@ -15559,7 +15614,7 @@ var ZoomableChartJsComponent = class extends ChartJsComponent {
15559
15614
  updateTrendingLineAxes() {
15560
15615
  this.store.updateTrendLineConfiguration(this.chartId);
15561
15616
  const limits = this.store.currentAxesLimits[this.chartId];
15562
- for (const axisId of ["x1", MOVING_AVERAGE_TREND_LINE_XAXIS_ID]) {
15617
+ for (const axisId of [TREND_LINE_XAXIS_ID, MOVING_AVERAGE_TREND_LINE_XAXIS_ID]) {
15563
15618
  if (!this.chart?.config?.options?.scales?.[axisId] || !limits?.[axisId]) continue;
15564
15619
  this.chart.config.options.scales[axisId].min = limits[axisId].min;
15565
15620
  this.chart.config.options.scales[axisId].max = limits[axisId].max;
@@ -16787,7 +16842,7 @@ var MenuPopover = class MenuPopover extends Component {
16787
16842
  onClickMenu: this.onClickMenu.bind(this),
16788
16843
  onMouseOver: this.onMouseOver.bind(this),
16789
16844
  onMouseLeave: this.onMouseLeave.bind(this),
16790
- width: this.props.width || 250,
16845
+ width: this.props.width || MENU_WIDTH,
16791
16846
  isActive: this.isActive.bind(this),
16792
16847
  onScroll: this.onScroll.bind(this)
16793
16848
  };
@@ -16803,11 +16858,11 @@ var MenuPopover = class MenuPopover extends Component {
16803
16858
  anchorRect: {
16804
16859
  x: this.props.anchorRect.x,
16805
16860
  y: this.props.anchorRect.y,
16806
- width: isRoot ? this.props.anchorRect.width : this.props.width || 250,
16807
- height: isRoot ? this.props.anchorRect.height : 26
16861
+ width: isRoot ? this.props.anchorRect.width : this.props.width || MENU_WIDTH,
16862
+ height: isRoot ? this.props.anchorRect.height : DESKTOP_MENU_ITEM_HEIGHT
16808
16863
  },
16809
16864
  positioning: this.props.popoverPositioning,
16810
- verticalOffset: isRoot ? 0 : 6,
16865
+ verticalOffset: isRoot ? 0 : MENU_VERTICAL_PADDING,
16811
16866
  onPopoverHidden: () => this.closeSubMenu(),
16812
16867
  onPopoverMoved: () => this.closeSubMenu(),
16813
16868
  maxHeight: this.props.maxHeight
@@ -16870,8 +16925,8 @@ var MenuPopover = class MenuPopover extends Component {
16870
16925
  this.subMenu.anchorRect = {
16871
16926
  x: getRefBoundingRect(this.menuRef).x,
16872
16927
  y: y - (this.subMenu.scrollOffset || 0),
16873
- width: this.props.width || 250,
16874
- height: 26
16928
+ width: this.props.width || MENU_WIDTH,
16929
+ height: DESKTOP_MENU_ITEM_HEIGHT
16875
16930
  };
16876
16931
  this.subMenu.menuItems = menu.children(this.env);
16877
16932
  this.subMenu.isOpen = true;
@@ -16942,7 +16997,7 @@ var ChartDashboardMenu = class extends Component {
16942
16997
  return [this.fullScreenMenuItem].filter(isDefined);
16943
16998
  }
16944
16999
  get backgroundColor() {
16945
- return "background-color: " + (this.env.model.getters.getChartDefinition(this.props.chartId).background || "#FFFFFF");
17000
+ return "background-color: " + (this.env.model.getters.getChartDefinition(this.props.chartId).background || BACKGROUND_CHART_COLOR);
16946
17001
  }
16947
17002
  openContextMenu(ev) {
16948
17003
  this.menuState.isOpen = true;
@@ -24870,7 +24925,7 @@ const PIVOT = {
24870
24925
  const error = pivot.assertIsValid({ throwOnError: false });
24871
24926
  if (error) return error;
24872
24927
  const table = pivot.getCollapsedTableStructure();
24873
- if (table.numberOfCells > 5e5) return new EvaluationError(getPivotTooBigErrorMessage(table.numberOfCells, this.locale));
24928
+ if (table.numberOfCells > PIVOT_MAX_NUMBER_OF_CELLS) return new EvaluationError(getPivotTooBigErrorMessage(table.numberOfCells, this.locale));
24874
24929
  const cells = table.getPivotCells(pivotStyle);
24875
24930
  let headerRows = 0;
24876
24931
  if (pivotStyle.displayColumnHeaders) headerRows = table.columns.length - 1;
@@ -26661,12 +26716,12 @@ var ContentEditableHelper = class {
26661
26716
  for (let current = it.next(); !current.done; current = it.next()) {
26662
26717
  if (current.value.nodeName === "P" || current.value.nodeName === "DIV" && current.value !== this.el) {
26663
26718
  if (isFirstParagraph) isFirstParagraph = false;
26664
- else text += "\n";
26719
+ else text += NEWLINE;
26665
26720
  emptyParagraph = isEmptyParagraph(current.value);
26666
26721
  continue;
26667
26722
  }
26668
26723
  if (!current.value.hasChildNodes()) {
26669
- if (current.value.nodeName === "BR" && !emptyParagraph) text += "\n";
26724
+ if (current.value.nodeName === "BR" && !emptyParagraph) text += NEWLINE;
26670
26725
  text += current.value.textContent;
26671
26726
  }
26672
26727
  }
@@ -26900,7 +26955,7 @@ var Composer = class extends Component {
26900
26955
  if (cellX + ASSISTANT_WIDTH > this.props.delimitation.width) assistantStyle.right = `0px`;
26901
26956
  } else {
26902
26957
  assistantStyle["max-height"] = `${this.spreadsheetRect.height - composerRect.bottom - 1}px`;
26903
- if (composerRect.left + ASSISTANT_WIDTH + 15 + CLOSE_ICON_RADIUS > this.spreadsheetRect.width) assistantStyle.right = `${CLOSE_ICON_RADIUS}px`;
26958
+ if (composerRect.left + ASSISTANT_WIDTH + SCROLLBAR_WIDTH + CLOSE_ICON_RADIUS > this.spreadsheetRect.width) assistantStyle.right = `${CLOSE_ICON_RADIUS}px`;
26904
26959
  }
26905
26960
  return assistantStyle;
26906
26961
  }
@@ -26997,7 +27052,7 @@ var Composer = class extends Component {
26997
27052
  const start = Math.min(selection.start, selection.end);
26998
27053
  const end = Math.max(selection.start, selection.end);
26999
27054
  this.props.composerStore.stopComposerRangeSelection();
27000
- this.props.composerStore.setCurrentContent(content.slice(0, start) + "\n" + content.slice(end), {
27055
+ this.props.composerStore.setCurrentContent(content.slice(0, start) + NEWLINE + content.slice(end), {
27001
27056
  start: start + 1,
27002
27057
  end: start + 1
27003
27058
  });
@@ -27175,7 +27230,7 @@ var Composer = class extends Component {
27175
27230
  const { end, start } = this.props.composerStore.composerSelection;
27176
27231
  for (let index = 0; index < tokens.length; index++) {
27177
27232
  const token = tokens[index];
27178
- let color = token.color || "light-dark(#000000, #ffffff)";
27233
+ let color = token.color || DEFAULT_TOKEN_COLOR;
27179
27234
  if (token.isBlurred) color = setColorAlpha(color, .5);
27180
27235
  const classes = [];
27181
27236
  if (token.type === "REFERENCE" && this.props.composerStore.tokenAtCursor === token && this.props.composerStore.editionMode === "selecting") classes.push("text-decoration-underline");
@@ -27206,8 +27261,8 @@ var Composer = class extends Component {
27206
27261
  splitHtmlContentIntoLines(contents) {
27207
27262
  const contentSplitInLines = [];
27208
27263
  let currentLine = [];
27209
- for (const content of contents) if (content.value.includes("\n")) {
27210
- const lines = content.value.split("\n");
27264
+ for (const content of contents) if (content.value.includes(NEWLINE)) {
27265
+ const lines = content.value.split(NEWLINE);
27211
27266
  const lastLine = lines.pop();
27212
27267
  for (const line of lines) {
27213
27268
  currentLine.push({
@@ -27813,7 +27868,7 @@ const autoCompleteProviders = new Registry();
27813
27868
  function drawHighlight(renderingContext, highlight, rect) {
27814
27869
  const { x, y, width, height } = rect;
27815
27870
  if (width < 0 || height < 0) return;
27816
- const color = highlight.color || "#017E84";
27871
+ const color = highlight.color || HIGHLIGHT_COLOR;
27817
27872
  const { ctx } = renderingContext;
27818
27873
  ctx.save();
27819
27874
  if (!highlight.noBorder) {
@@ -28373,7 +28428,7 @@ var AbstractComposerStore = class extends SpreadsheetStore {
28373
28428
  getTokenColor(token) {
28374
28429
  if (token.type === "REFERENCE") {
28375
28430
  const { xc, sheetName } = splitReference(token.value);
28376
- return this.rangeColor(xc, sheetName) || "light-dark(#000000, #ffffff)";
28431
+ return this.rangeColor(xc, sheetName) || DEFAULT_TOKEN_COLOR;
28377
28432
  }
28378
28433
  if (token.type === "SYMBOL") {
28379
28434
  const upperCaseValue = token.value.toUpperCase();
@@ -28383,7 +28438,7 @@ var AbstractComposerStore = class extends SpreadsheetStore {
28383
28438
  if (["LEFT_PAREN", "RIGHT_PAREN"].includes(token.type)) {
28384
28439
  if (token.parenthesesCode === "") return tokenColors.ORPHAN_RIGHT_PAREN;
28385
28440
  }
28386
- return tokenColors[token.type] || "light-dark(#000000, #ffffff)";
28441
+ return tokenColors[token.type] || DEFAULT_TOKEN_COLOR;
28387
28442
  }
28388
28443
  rangeColor(xc, sheetName) {
28389
28444
  const refSheet = sheetName ? this.model.getters.getSheetIdByName(sheetName) : this.sheetId;
@@ -28977,7 +29032,7 @@ var ColorPicker = class extends Component {
28977
29032
  }
28978
29033
  get sliderStyle() {
28979
29034
  const hue = this.state.currentHslaColor?.h || 0;
28980
- return cssPropertiesToCss({ "margin-left": `${clip(Math.round(hue / 360 * INNER_GRADIENT_WIDTH), 1, INNER_GRADIENT_WIDTH) - 18 / 2}px` });
29035
+ return cssPropertiesToCss({ "margin-left": `${clip(Math.round(hue / 360 * INNER_GRADIENT_WIDTH), 1, INNER_GRADIENT_WIDTH) - ICON_EDGE_LENGTH / 2}px` });
28981
29036
  }
28982
29037
  get pointerStyle() {
28983
29038
  const { s, l } = this.state.currentHslaColor || {
@@ -30812,7 +30867,7 @@ var LinkDisplay = class extends Component {
30812
30867
  col,
30813
30868
  row
30814
30869
  });
30815
- const textColor = style?.textColor === "#017E84" ? void 0 : style?.textColor;
30870
+ const textColor = style?.textColor === LINK_COLOR ? void 0 : style?.textColor;
30816
30871
  this.env.model.dispatch("UPDATE_CELL", {
30817
30872
  col,
30818
30873
  row,
@@ -32159,7 +32214,7 @@ function getCaretDownSvg(color) {
32159
32214
  width: 512,
32160
32215
  height: 512,
32161
32216
  paths: [{
32162
- fillColor: color.textColor || "#374151C2",
32217
+ fillColor: color.textColor || TEXT_BODY_MUTED,
32163
32218
  path: "M120 195 h270 l-135 130"
32164
32219
  }]
32165
32220
  };
@@ -32170,7 +32225,7 @@ function getCaretUpSvg(color) {
32170
32225
  width: 512,
32171
32226
  height: 512,
32172
32227
  paths: [{
32173
- fillColor: color.textColor || "#374151C2",
32228
+ fillColor: color.textColor || TEXT_BODY_MUTED,
32174
32229
  path: "M120 325 h270 l-135 -130"
32175
32230
  }]
32176
32231
  };
@@ -32181,7 +32236,7 @@ function getHoveredCaretDownSvg(color) {
32181
32236
  width: 512,
32182
32237
  height: 512,
32183
32238
  paths: [{
32184
- fillColor: color.textColor || "#374151C2",
32239
+ fillColor: color.textColor || TEXT_BODY_MUTED,
32185
32240
  path: "M15 15 h482 v482 h-482"
32186
32241
  }, {
32187
32242
  fillColor: color.fillColor || "#fff",
@@ -32196,7 +32251,7 @@ function getChipSvg(chipStyle) {
32196
32251
  width: 512,
32197
32252
  height: 512,
32198
32253
  paths: [{
32199
- fillColor: chipStyle.textColor || "#374151C2",
32254
+ fillColor: chipStyle.textColor || TEXT_BODY_MUTED,
32200
32255
  path: CHIP_CARET_DOWN_PATH
32201
32256
  }]
32202
32257
  };
@@ -32207,10 +32262,10 @@ function getHoveredChipSvg(chipStyle) {
32207
32262
  width: 512,
32208
32263
  height: 512,
32209
32264
  paths: [{
32210
- fillColor: chipStyle.textColor || "#374151C2",
32265
+ fillColor: chipStyle.textColor || TEXT_BODY_MUTED,
32211
32266
  path: "M0,225 A175,175 0 1,0 350,225 A175,175 0 1,0 0,225"
32212
32267
  }, {
32213
- fillColor: chipStyle.fillColor || "#374151C2",
32268
+ fillColor: chipStyle.fillColor || TEXT_BODY_MUTED,
32214
32269
  path: CHIP_CARET_DOWN_PATH
32215
32270
  }]
32216
32271
  };
@@ -32967,7 +33022,7 @@ function extractStyle(data, content, styleId, formatId, borderId) {
32967
33022
  alignment: {
32968
33023
  horizontal: style.align,
32969
33024
  vertical: style.verticalAlign ? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign] : void 0,
32970
- wrapText: style.wrapping === "wrap" || content?.includes("\n") ? true : void 0,
33025
+ wrapText: style.wrapping === "wrap" || content?.includes(NEWLINE) ? true : void 0,
32971
33026
  textRotation: style.rotation ? rotationToXLSX(style.rotation) : void 0,
32972
33027
  shrinkToFit: style.wrapping === "clip" ? true : void 0
32973
33028
  }
@@ -33008,7 +33063,7 @@ function normalizeStyle(construct, styles) {
33008
33063
  function convertFormat(format, numFmtStructure) {
33009
33064
  if (!format) return 0;
33010
33065
  let formatId = XLSX_FORMAT_MAP[format.format];
33011
- if (!formatId) formatId = pushElement(format, numFmtStructure) + 164;
33066
+ if (!formatId) formatId = pushElement(format, numFmtStructure) + FIRST_NUMFMT_ID;
33012
33067
  return formatId;
33013
33068
  }
33014
33069
  /**
@@ -33582,14 +33637,14 @@ function convertExcelTrendline(trend) {
33582
33637
  type: trend.type === "linear" ? "polynomial" : EXCEL_TO_SPREADSHEET_TRENDLINE_TYPE_MAPPING[trend.type],
33583
33638
  order: trend.type === "linear" ? 1 : trend.order,
33584
33639
  color: trend.color,
33585
- window: trend.window || 2,
33640
+ window: trend.window || DEFAULT_WINDOW_SIZE,
33586
33641
  display: true
33587
33642
  };
33588
33643
  }
33589
33644
  function convertAnchor(XLSXanchor) {
33590
33645
  const offset = {
33591
- x: convertEMUToDotValue(XLSXanchor.colOffset) - 1,
33592
- y: convertEMUToDotValue(XLSXanchor.rowOffset) - 1
33646
+ x: convertEMUToDotValue(XLSXanchor.colOffset) - FIGURE_BORDER_WIDTH,
33647
+ y: convertEMUToDotValue(XLSXanchor.rowOffset) - FIGURE_BORDER_WIDTH
33593
33648
  };
33594
33649
  return {
33595
33650
  col: XLSXanchor.col,
@@ -33940,8 +33995,8 @@ function getSheetDims(sheet) {
33940
33995
  dims[0] = Math.max(dims[0], fig.anchors[fig.anchors.length - 1]?.col ?? 0);
33941
33996
  dims[1] = Math.max(dims[1], fig.anchors[fig.anchors.length - 1]?.row ?? 0);
33942
33997
  }
33943
- dims[0] = Math.max(dims[0] + 5, 30);
33944
- dims[1] = Math.max(dims[1] + 5, 100);
33998
+ dims[0] = Math.max(dims[0] + 5, EXCEL_IMPORT_DEFAULT_NUMBER_OF_COLS);
33999
+ dims[1] = Math.max(dims[1] + 5, EXCEL_IMPORT_DEFAULT_NUMBER_OF_ROWS);
33945
34000
  return dims;
33946
34001
  }
33947
34002
  /**
@@ -34515,7 +34570,7 @@ var XlsxBaseExtractor = class {
34515
34570
  rgb = this.getThemeColor(themeIndex, theme.clrScheme);
34516
34571
  } else {
34517
34572
  rgb = this.extractAttr(colorElement, "rgb")?.asString();
34518
- rgb = rgb === "FF000000" ? void 0 : rgb;
34573
+ rgb = rgb === DEFAULT_SYSTEM_COLOR ? void 0 : rgb;
34519
34574
  }
34520
34575
  return {
34521
34576
  rgb: rgb || defaultColor,
@@ -35624,7 +35679,7 @@ function getPathsOfContent(contentType, xmls) {
35624
35679
  * Get the corresponding relationship file for a given xml file in a XLSX directory.
35625
35680
  */
35626
35681
  function getRelationFile(file, xmls) {
35627
- if (file === "[Content_Types].xml") return "_rels/.rels";
35682
+ if (file === CONTENT_TYPES_FILE) return "_rels/.rels";
35628
35683
  let relsFile = "";
35629
35684
  const pathParts = file.split("/");
35630
35685
  for (let i = 0; i < pathParts.length - 1; i++) relsFile += pathParts[i] + "/";
@@ -35734,7 +35789,7 @@ function normalizeV9(formula) {
35734
35789
  if (token.type === "REFERENCE" && cellReference.test(token.value)) {
35735
35790
  const value = token.value.trim();
35736
35791
  if (!dependencies.includes(value)) dependencies.push(value);
35737
- return `${"|"}${dependencies.indexOf(value)}${"|"}`;
35792
+ return `${FORMULA_REF_IDENTIFIER}${dependencies.indexOf(value)}${FORMULA_REF_IDENTIFIER}`;
35738
35793
  } else return token.value;
35739
35794
  })),
35740
35795
  dependencies
@@ -35930,7 +35985,7 @@ migrationStepRegistry.add("0.1", { migrate(data) {
35930
35985
  if (cell.formula) {
35931
35986
  let { text, dependencies } = cell.formula;
35932
35987
  for (const [index, d] of Object.entries(dependencies)) {
35933
- const stringPosition = `\\${"|"}${index}\\${"|"}`;
35988
+ const stringPosition = `\\${FORMULA_REF_IDENTIFIER}${index}\\${FORMULA_REF_IDENTIFIER}`;
35934
35989
  text = text.replace(new RegExp(stringPosition, "g"), d);
35935
35990
  }
35936
35991
  cell.content = text;
@@ -36829,8 +36884,8 @@ const CREATE_CHART = (env) => {
36829
36884
  zones = getters.getSelectedZones();
36830
36885
  }
36831
36886
  const size = {
36832
- width: 536,
36833
- height: 335
36887
+ width: DEFAULT_FIGURE_WIDTH,
36888
+ height: DEFAULT_FIGURE_HEIGHT
36834
36889
  };
36835
36890
  const { col, row, offset } = centerFigurePosition(getters, size);
36836
36891
  if (env.model.dispatch("CREATE_CHART", {
@@ -36852,8 +36907,8 @@ const CREATE_CAROUSEL = (env) => {
36852
36907
  const figureId = env.model.uuidGenerator.smallUuid();
36853
36908
  const sheetId = getters.getActiveSheetId();
36854
36909
  const size = {
36855
- width: 536,
36856
- height: 335
36910
+ width: DEFAULT_FIGURE_WIDTH,
36911
+ height: DEFAULT_FIGURE_HEIGHT
36857
36912
  };
36858
36913
  const { col, row, offset } = centerFigurePosition(getters, size);
36859
36914
  if (env.model.dispatch("CREATE_CAROUSEL", {
@@ -36903,7 +36958,7 @@ const REINSERT_STATIC_PIVOT_CHILDREN = (env) => env.model.getters.getPivotIds().
36903
36958
  execute: (env) => {
36904
36959
  const zone = env.model.getters.getSelectedZone();
36905
36960
  const table = env.model.getters.getPivot(pivotId).getExpandedTableStructure();
36906
- if (table.numberOfCells > 5e5) {
36961
+ if (table.numberOfCells > PIVOT_MAX_NUMBER_OF_CELLS) {
36907
36962
  env.notifyUser({
36908
36963
  type: "warning",
36909
36964
  text: getPivotTooBigErrorMessage(table.numberOfCells, env.model.getters.getLocale()),
@@ -38301,7 +38356,7 @@ function getPreviousOrNextValueDomain(pivot, domain, fieldNameWithGranularity, d
38301
38356
  if (value === void 0) return;
38302
38357
  const valueIndex = values.indexOf(value);
38303
38358
  if (value === void 0 || valueIndex === -1) return;
38304
- return replaceFieldValueInDomain(domain, fieldNameWithGranularity, values[clip(valueIndex + (direction === "(previous)" ? -1 : 1), 0, values.length - 1)]);
38359
+ return replaceFieldValueInDomain(domain, fieldNameWithGranularity, values[clip(valueIndex + (direction === PREVIOUS_VALUE ? -1 : 1), 0, values.length - 1)]);
38305
38360
  }
38306
38361
  function domainToString(domain) {
38307
38362
  return domain ? domain.map(domainNodeToString).join(", ") : "";
@@ -40746,7 +40801,7 @@ function useDragAndDropBeyondTheViewport(env) {
40746
40801
  let { scrollX, scrollY } = getters.getActiveSheetScrollInfo();
40747
40802
  const { xSplit, ySplit } = getters.getPaneDivisions(sheetId);
40748
40803
  let canEdgeScroll = false;
40749
- let timeoutDelay = 140;
40804
+ let timeoutDelay = MAX_DELAY;
40750
40805
  const x = zoomedMouseEvent.clientX - position.x;
40751
40806
  let colIndex = getters.getColIndex(x);
40752
40807
  if (scrollDirection !== "vertical") {
@@ -41142,7 +41197,7 @@ function fits(width, linkedString) {
41142
41197
  return true;
41143
41198
  }
41144
41199
  function astToDoc(ast) {
41145
- const debugPrefix = ast.debug ? `${"?"}` : "";
41200
+ const debugPrefix = ast.debug ? `${DEBUGGER_CHAR}` : "";
41146
41201
  switch (ast.type) {
41147
41202
  case "NUMBER": return debugPrefix + String(ast.value);
41148
41203
  case "STRING": return debugPrefix + `"${ast.value}"`;
@@ -41221,7 +41276,7 @@ function wrapInBraces(doc) {
41221
41276
  * Converts an ast formula to the corresponding string
41222
41277
  */
41223
41278
  function astToFormula(ast) {
41224
- const debugPrefix = ast.debug ? `${"?"}` : "";
41279
+ const debugPrefix = ast.debug ? `${DEBUGGER_CHAR}` : "";
41225
41280
  switch (ast.type) {
41226
41281
  case "FUNCALL":
41227
41282
  const args = ast.args.map((arg) => astToFormula(arg));
@@ -41894,19 +41949,19 @@ function getAxis(getters, figureUI, dnd, axisType) {
41894
41949
  position = y;
41895
41950
  break;
41896
41951
  case "bottom":
41897
- position = y + figureUI.height - 1;
41952
+ position = y + figureUI.height - FIGURE_BORDER_WIDTH;
41898
41953
  break;
41899
41954
  case "vCenter":
41900
- position = y + Math.floor(figureUI.height / 2) - 1;
41955
+ position = y + Math.floor(figureUI.height / 2) - FIGURE_BORDER_WIDTH;
41901
41956
  break;
41902
41957
  case "left":
41903
41958
  position = x;
41904
41959
  break;
41905
41960
  case "right":
41906
- position = x + figureUI.width - 1;
41961
+ position = x + figureUI.width - FIGURE_BORDER_WIDTH;
41907
41962
  break;
41908
41963
  case "hCenter":
41909
- position = x + Math.floor(figureUI.width / 2) - 1;
41964
+ position = x + Math.floor(figureUI.width / 2) - FIGURE_BORDER_WIDTH;
41910
41965
  break;
41911
41966
  }
41912
41967
  return {
@@ -42118,7 +42173,7 @@ var FiguresContainer = class extends Component {
42118
42173
  };
42119
42174
  const offsetX = Math.abs(currentMousePosition.x - initialMousePosition.x);
42120
42175
  const offsetY = Math.abs(currentMousePosition.y - initialMousePosition.y);
42121
- if (!hasStartedDnd && offsetX < 5 && offsetY < 5) return;
42176
+ if (!hasStartedDnd && offsetX < DRAG_THRESHOLD && offsetY < DRAG_THRESHOLD) return;
42122
42177
  hasStartedDnd = true;
42123
42178
  const draggedFigure = dragFigureForMove(currentMousePosition, initialMousePosition, initialFigure, maxDimensions, initialScrollPosition, getters.getActiveSheetScrollInfo());
42124
42179
  const otherFigures = this.getOtherFigures(initialFigure.id);
@@ -42170,7 +42225,7 @@ var FiguresContainer = class extends Component {
42170
42225
  ev.stopPropagation();
42171
42226
  const initialScrollPosition = this.env.model.getters.getActiveSheetScrollInfo();
42172
42227
  const keepRatio = figureRegistry.get(figureUI.tag).keepRatio || false;
42173
- const minFigSize = figureRegistry.get(figureUI.tag).minFigSize || 80;
42228
+ const minFigSize = figureRegistry.get(figureUI.tag).minFigSize || MIN_FIG_SIZE;
42174
42229
  const zoom = this.env.model.getters.getViewportZoomLevel();
42175
42230
  const sheetId = this.env.model.getters.getActiveSheetId();
42176
42231
  const initialMousePosition = {
@@ -42785,7 +42840,7 @@ var GridOverlay = class extends Component {
42785
42840
  get isFooterVisible() {
42786
42841
  const { y } = this.env.model.getters.getMainViewportCoordinates();
42787
42842
  const { height } = this.env.model.getters.getSheetViewDimension();
42788
- return !this.env.model.getters.isReadonly() && height - y > 46;
42843
+ return !this.env.model.getters.isReadonly() && height - y > FOOTER_HEIGHT;
42789
42844
  }
42790
42845
  };
42791
42846
 
@@ -42840,7 +42895,7 @@ var UnhideRowHeaders = class extends Component {
42840
42895
  row: hiddenIndex
42841
42896
  }));
42842
42897
  return cssPropertiesToCss({
42843
- top: rect.y + rect.height - 26 - this.props.offset + "px",
42898
+ top: rect.y + rect.height - HEADER_HEIGHT - this.props.offset + "px",
42844
42899
  "margin-right": "1px"
42845
42900
  });
42846
42901
  }
@@ -42849,7 +42904,7 @@ var UnhideRowHeaders = class extends Component {
42849
42904
  top: this.env.model.getters.getRect(positionToZone({
42850
42905
  col: 0,
42851
42906
  row: hiddenIndex
42852
- })).y - 26 - this.props.offset + "px",
42907
+ })).y - HEADER_HEIGHT - this.props.offset + "px",
42853
42908
  "margin-right": "1px"
42854
42909
  });
42855
42910
  }
@@ -42883,13 +42938,13 @@ var UnhideColumnHeaders = class extends Component {
42883
42938
  col: hiddenIndex,
42884
42939
  row: 0
42885
42940
  }));
42886
- return cssPropertiesToCss({ left: rect.x + rect.width - 48 - this.props.offset + "px" });
42941
+ return cssPropertiesToCss({ left: rect.x + rect.width - HEADER_WIDTH - this.props.offset + "px" });
42887
42942
  }
42888
42943
  getUnhideNextButtonStyle(hiddenIndex) {
42889
42944
  return cssPropertiesToCss({ left: this.env.model.getters.getRect(positionToZone({
42890
42945
  col: hiddenIndex,
42891
42946
  row: 0
42892
- })).x - 48 - this.props.offset + "px" });
42947
+ })).x - HEADER_WIDTH - this.props.offset + "px" });
42893
42948
  }
42894
42949
  unhide(hiddenElements) {
42895
42950
  this.env.model.dispatch("UNHIDE_COLUMNS_ROWS", {
@@ -43112,7 +43167,7 @@ var ColResizer = class extends AbstractResizer {
43112
43167
  this.colResizerRef = useRef("colResizer");
43113
43168
  this.PADDING = 15;
43114
43169
  this.MAX_SIZE_MARGIN = 90;
43115
- this.MIN_ELEMENT_SIZE = 5;
43170
+ this.MIN_ELEMENT_SIZE = MIN_COL_WIDTH;
43116
43171
  }
43117
43172
  get sheetId() {
43118
43173
  return this.env.model.getters.getActiveSheetId();
@@ -43247,7 +43302,7 @@ var RowResizer = class extends AbstractResizer {
43247
43302
  this.rowResizerRef = useRef("rowResizer");
43248
43303
  this.PADDING = 5;
43249
43304
  this.MAX_SIZE_MARGIN = 60;
43250
- this.MIN_ELEMENT_SIZE = 10;
43305
+ this.MIN_ELEMENT_SIZE = MIN_ROW_HEIGHT;
43251
43306
  }
43252
43307
  rowResizerRef;
43253
43308
  get sheetId() {
@@ -43666,7 +43721,7 @@ var GridRenderer = class extends SpreadsheetStore {
43666
43721
  x,
43667
43722
  y
43668
43723
  }, style.underline, style.strikethrough);
43669
- y += 4 + box.content.fontSizePx;
43724
+ y += MIN_CELL_TEXT_MARGIN + box.content.fontSizePx;
43670
43725
  }
43671
43726
  if (style.rotation) ctx.restore();
43672
43727
  if (box.clipRect) ctx.restore();
@@ -43714,7 +43769,7 @@ var GridRenderer = class extends SpreadsheetStore {
43714
43769
  const numberOfRows = this.getters.getNumberRows(sheetId);
43715
43770
  const activeCols = this.getters.getActiveCols();
43716
43771
  const activeRows = this.getters.getActiveRows();
43717
- ctx.font = `400 ${11}px ${DEFAULT_FONT}`;
43772
+ ctx.font = `400 ${HEADER_FONT_SIZE}px ${DEFAULT_FONT}`;
43718
43773
  ctx.textAlign = "center";
43719
43774
  ctx.textBaseline = "middle";
43720
43775
  ctx.lineWidth = thinLineWidth;
@@ -43732,7 +43787,7 @@ var GridRenderer = class extends SpreadsheetStore {
43732
43787
  if (isColActive) ctx.fillStyle = BACKGROUND_HEADER_ACTIVE_COLOR;
43733
43788
  else if (isColSelected) ctx.fillStyle = BACKGROUND_HEADER_SELECTED_COLOR;
43734
43789
  else ctx.fillStyle = BACKGROUND_HEADER_COLOR;
43735
- ctx.fillRect(x, 0, width, 26);
43790
+ ctx.fillRect(x, 0, width, HEADER_HEIGHT);
43736
43791
  }
43737
43792
  for (const row of visibleRows) {
43738
43793
  const rowZone = {
@@ -43747,13 +43802,13 @@ var GridRenderer = class extends SpreadsheetStore {
43747
43802
  if (isRowActive) ctx.fillStyle = BACKGROUND_HEADER_ACTIVE_COLOR;
43748
43803
  else if (isRowSelected) ctx.fillStyle = BACKGROUND_HEADER_SELECTED_COLOR;
43749
43804
  else ctx.fillStyle = BACKGROUND_HEADER_COLOR;
43750
- ctx.fillRect(0, y, 48, height);
43805
+ ctx.fillRect(0, y, HEADER_WIDTH, height);
43751
43806
  }
43752
43807
  ctx.beginPath();
43753
- ctx.moveTo(48, 0);
43754
- ctx.lineTo(48, height);
43755
- ctx.moveTo(0, 26);
43756
- ctx.lineTo(width, 26);
43808
+ ctx.moveTo(HEADER_WIDTH, 0);
43809
+ ctx.lineTo(HEADER_WIDTH, height);
43810
+ ctx.moveTo(0, HEADER_HEIGHT);
43811
+ ctx.lineTo(width, HEADER_HEIGHT);
43757
43812
  ctx.strokeStyle = HEADER_BORDER_COLOR;
43758
43813
  ctx.stroke();
43759
43814
  for (const col of visibleCols) {
@@ -43769,13 +43824,13 @@ var GridRenderer = class extends SpreadsheetStore {
43769
43824
  const { x, width } = this.getters.getVisibleRect(zone);
43770
43825
  ctx.save();
43771
43826
  ctx.beginPath();
43772
- ctx.rect(x, 0, width, 26);
43827
+ ctx.rect(x, 0, width, HEADER_HEIGHT);
43773
43828
  ctx.clip();
43774
- ctx.fillText(colName, colStart + colSize / 2, 26 / 2);
43829
+ ctx.fillText(colName, colStart + colSize / 2, HEADER_HEIGHT / 2);
43775
43830
  ctx.restore();
43776
43831
  ctx.beginPath();
43777
43832
  ctx.moveTo(colStart + colSize, 0);
43778
- ctx.lineTo(colStart + colSize, 26);
43833
+ ctx.lineTo(colStart + colSize, HEADER_HEIGHT);
43779
43834
  ctx.stroke();
43780
43835
  }
43781
43836
  for (const row of visibleRows) {
@@ -43790,21 +43845,21 @@ var GridRenderer = class extends SpreadsheetStore {
43790
43845
  const { y, height } = this.getters.getVisibleRect(zone);
43791
43846
  ctx.save();
43792
43847
  ctx.beginPath();
43793
- ctx.rect(0, y, 48, height);
43848
+ ctx.rect(0, y, HEADER_WIDTH, height);
43794
43849
  ctx.clip();
43795
- ctx.fillText(String(row + 1), 48 / 2, rowStart + rowSize / 2);
43850
+ ctx.fillText(String(row + 1), HEADER_WIDTH / 2, rowStart + rowSize / 2);
43796
43851
  ctx.restore();
43797
43852
  ctx.beginPath();
43798
43853
  ctx.moveTo(0, rowStart + rowSize);
43799
- ctx.lineTo(48, rowStart + rowSize);
43854
+ ctx.lineTo(HEADER_WIDTH, rowStart + rowSize);
43800
43855
  ctx.stroke();
43801
43856
  }
43802
43857
  }
43803
43858
  drawFrozenPanesHeaders(renderingContext) {
43804
43859
  const { ctx, thinLineWidth } = renderingContext;
43805
43860
  const { x: offsetCorrectionX, y: offsetCorrectionY } = this.getters.getMainViewportCoordinates();
43806
- const widthCorrection = this.getters.isDashboard() ? 0 : 48;
43807
- const heightCorrection = this.getters.isDashboard() ? 0 : 26;
43861
+ const widthCorrection = this.getters.isDashboard() ? 0 : HEADER_WIDTH;
43862
+ const heightCorrection = this.getters.isDashboard() ? 0 : HEADER_HEIGHT;
43808
43863
  ctx.lineWidth = 6 * thinLineWidth;
43809
43864
  ctx.strokeStyle = FROZEN_PANE_HEADER_BORDER_COLOR;
43810
43865
  ctx.beginPath();
@@ -43832,8 +43887,8 @@ var GridRenderer = class extends SpreadsheetStore {
43832
43887
  bottom: visibleRows[visibleRows.length - 1]
43833
43888
  };
43834
43889
  const rect = this.getters.getVisibleRect(viewport);
43835
- const widthCorrection = this.getters.isDashboard() ? 0 : 48;
43836
- const heightCorrection = this.getters.isDashboard() ? 0 : 26;
43890
+ const widthCorrection = this.getters.isDashboard() ? 0 : HEADER_WIDTH;
43891
+ const heightCorrection = this.getters.isDashboard() ? 0 : HEADER_HEIGHT;
43837
43892
  ctx.lineWidth = 6 * thinLineWidth;
43838
43893
  ctx.strokeStyle = FROZEN_PANE_BORDER_COLOR;
43839
43894
  ctx.beginPath();
@@ -43940,7 +43995,7 @@ var GridRenderer = class extends SpreadsheetStore {
43940
43995
  /** Content */
43941
43996
  const wrapping = style.wrapping || "overflow";
43942
43997
  const wrapText = wrapping === "wrap" && !showFormula;
43943
- const maxWidth = width - 2 * 4;
43998
+ const maxWidth = width - 2 * MIN_CELL_TEXT_MARGIN;
43944
43999
  const formatWidth = style.align ? 0 : maxWidth;
43945
44000
  const multiLineText = this.getters.getCellMultiLineText(position, {
43946
44001
  maxWidth,
@@ -43952,18 +44007,18 @@ var GridRenderer = class extends SpreadsheetStore {
43952
44007
  align: "left",
43953
44008
  rotation: 0
43954
44009
  };
43955
- const textWidth = Math.max(...multiLineText.map((line) => this.getters.getTextWidth(line, noRotatationStyle))) + 4;
44010
+ const textWidth = Math.max(...multiLineText.map((line) => this.getters.getTextWidth(line, noRotatationStyle))) + MIN_CELL_TEXT_MARGIN;
43956
44011
  const contentSize = this.getters.getMultilineTextSize(multiLineText, style);
43957
- const chipMargin = chipStyle ? 5 : 0;
44012
+ const chipMargin = chipStyle ? DATA_VALIDATION_CHIP_MARGIN : 0;
43958
44013
  const leftMargin = (box.icons.left ? box.icons.left.size + box.icons.left.margin : 0) + chipMargin;
43959
44014
  const rightMargin = (box.icons.right ? box.icons.right.size + box.icons.right.margin : 0) + chipMargin;
43960
- const contentWidth = leftMargin + contentSize.width + rightMargin + 4;
44015
+ const contentWidth = leftMargin + contentSize.width + rightMargin + MIN_CELL_TEXT_MARGIN;
43961
44016
  const align = this.computeCellAlignment(position, contentWidth > width);
43962
44017
  const numberOfLines = multiLineText.length;
43963
44018
  const contentY = Math.round(this.getters.computeTextYCoordinate(box, fontSizePX, style.verticalAlign, numberOfLines));
43964
44019
  let contentX = box.x;
43965
- if (align === "left") contentX += 4 + leftMargin;
43966
- else if (align === "right") contentX += box.width - 4 - rightMargin;
44020
+ if (align === "left") contentX += MIN_CELL_TEXT_MARGIN + leftMargin;
44021
+ else if (align === "right") contentX += box.width - MIN_CELL_TEXT_MARGIN - rightMargin;
43967
44022
  else contentX += box.width / 2;
43968
44023
  contentX = Math.round(contentX);
43969
44024
  const textHeight = computeTextLinesHeight(fontSizePX, numberOfLines);
@@ -43979,7 +44034,7 @@ var GridRenderer = class extends SpreadsheetStore {
43979
44034
  };
43980
44035
  if (chipStyle?.fillColor) {
43981
44036
  const chipMarginLeft = leftMargin;
43982
- const chipMarginRight = 5;
44037
+ const chipMarginRight = DATA_VALIDATION_CHIP_MARGIN;
43983
44038
  box.chip = {
43984
44039
  color: chipStyle.fillColor,
43985
44040
  width: box.width - chipMarginLeft - chipMarginRight,
@@ -44143,7 +44198,7 @@ var GridRenderer = class extends SpreadsheetStore {
44143
44198
  continue;
44144
44199
  }
44145
44200
  const elapsedTime = timeStamp - animation.startTime;
44146
- const progress = Math.min(1, elapsedTime / 200);
44201
+ const progress = Math.min(1, elapsedTime / CELL_ANIMATION_DURATION);
44147
44202
  if (progress >= 1) this.animations.delete(boxId);
44148
44203
  animation.progress = progress;
44149
44204
  }
@@ -44245,7 +44300,7 @@ function useTouchScroll(ref, updateScroll, canMoveUp, canMoveDown) {
44245
44300
  resetTimeout = setTimeout(() => {
44246
44301
  velocityX = 0;
44247
44302
  velocityY = 0;
44248
- }, 100);
44303
+ }, resetTimeoutDuration);
44249
44304
  updateScroll(deltaX * horizontalScrollFactor, deltaY * verticalScrollFactor);
44250
44305
  }
44251
44306
  function onTouchEnd(ev) {
@@ -44276,7 +44331,7 @@ function useTouchScroll(ref, updateScroll, canMoveUp, canMoveDown) {
44276
44331
  //#region src/components/helpers/wheel_hook.ts
44277
44332
  function useWheelHandler(handler) {
44278
44333
  function normalize(val, deltaMode) {
44279
- return val * (deltaMode === 0 ? 1 : 23);
44334
+ return val * (deltaMode === 0 ? 1 : DEFAULT_CELL_HEIGHT);
44280
44335
  }
44281
44336
  const onMouseWheel = (ev) => {
44282
44337
  handler(normalize(ev.shiftKey && !isMacOS() ? ev.deltaY : ev.deltaX, ev.deltaMode), normalize(ev.shiftKey && !isMacOS() ? ev.deltaX : ev.deltaY, ev.deltaMode));
@@ -44372,14 +44427,14 @@ var Corner = class extends Component {
44372
44427
  return cssPropertiesToCss(css);
44373
44428
  }
44374
44429
  getHandlerEdgeLength() {
44375
- return this.env.isMobile() ? MOBILE_HANDLER_WIDTH : 8;
44430
+ return this.env.isMobile() ? MOBILE_HANDLER_WIDTH : AUTOFILL_EDGE_LENGTH;
44376
44431
  }
44377
44432
  get buttonLook() {
44378
44433
  const css = {
44379
44434
  "background-color": this.props.color,
44380
44435
  cursor: `${this.props.orientation}-resize`
44381
44436
  };
44382
- if (this.env.isMobile()) css["border-radius"] = `${8 / 2}px`;
44437
+ if (this.env.isMobile()) css["border-radius"] = `${AUTOFILL_EDGE_LENGTH / 2}px`;
44383
44438
  return cssPropertiesToCss(css);
44384
44439
  }
44385
44440
  onMouseDown(ev) {
@@ -45942,7 +45997,7 @@ var AxisDesignEditor = class extends Component {
45942
45997
  axesList: Array
45943
45998
  };
45944
45999
  state = useState({ currentAxis: "x" });
45945
- defaultFontSize = 12;
46000
+ defaultFontSize = CHART_AXIS_TITLE_FONT_SIZE;
45946
46001
  get axisTitleStyle() {
45947
46002
  return this.props.definition.axesDesign?.[this.state.currentAxis]?.title ?? {};
45948
46003
  }
@@ -46018,7 +46073,7 @@ var GeneralDesignEditor = class extends Component {
46018
46073
  optional: true
46019
46074
  }
46020
46075
  };
46021
- static defaultProps = { defaultChartTitleFontSize: 16 };
46076
+ static defaultProps = { defaultChartTitleFontSize: CHART_TITLE_FONT_SIZE };
46022
46077
  state;
46023
46078
  setup() {
46024
46079
  this.state = useState({ activeTool: "" });
@@ -46247,11 +46302,11 @@ var SeriesWithAxisDesignEditor = class extends Component {
46247
46302
  return Math.min(10, runtime.chartJsConfig.data.datasets[index].data.length - 1);
46248
46303
  }
46249
46304
  get defaultWindowSize() {
46250
- return 2;
46305
+ return DEFAULT_WINDOW_SIZE;
46251
46306
  }
46252
46307
  onChangeMovingAverageWindow(index, value) {
46253
- let window = parseInt(value) || 2;
46254
- if (window <= 1) window = 2;
46308
+ let window = parseInt(value) || DEFAULT_WINDOW_SIZE;
46309
+ if (window <= 1) window = DEFAULT_WINDOW_SIZE;
46255
46310
  this.updateTrendLineValue(index, { window });
46256
46311
  }
46257
46312
  getDataSeriesColor(index) {
@@ -46910,7 +46965,7 @@ var PieChartDesignPanel = class extends Component {
46910
46965
  });
46911
46966
  }
46912
46967
  get defaultHoleSize() {
46913
- return 50;
46968
+ return DEFAULT_DOUGHNUT_CHART_HOLE_SIZE;
46914
46969
  }
46915
46970
  };
46916
46971
 
@@ -47027,7 +47082,7 @@ var ScatterChart = class ScatterChart extends AbstractChart {
47027
47082
  const definition = this.getDefinition();
47028
47083
  return {
47029
47084
  ...definition,
47030
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
47085
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
47031
47086
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
47032
47087
  dataSets,
47033
47088
  labelRange,
@@ -47065,7 +47120,7 @@ function createScatterChartRuntime(chart, getters) {
47065
47120
  }
47066
47121
  }
47067
47122
  },
47068
- background: chart.background || "#FFFFFF"
47123
+ background: chart.background || BACKGROUND_CHART_COLOR
47069
47124
  };
47070
47125
  }
47071
47126
 
@@ -47161,7 +47216,7 @@ var ScorecardChartDesignPanel = class extends Component {
47161
47216
  return this.props.definition.baselineMode === "progress" ? _t("Progress bar colors") : _t("Baseline colors");
47162
47217
  }
47163
47218
  get defaultScorecardTitleFontSize() {
47164
- return 14;
47219
+ return SCORECARD_CHART_TITLE_FONT_SIZE;
47165
47220
  }
47166
47221
  translate(term) {
47167
47222
  return this.env.model.getters.dynamicTranslate(term);
@@ -47182,14 +47237,14 @@ var ScorecardChartDesignPanel = class extends Component {
47182
47237
  get keyStyle() {
47183
47238
  return {
47184
47239
  align: "center",
47185
- fontSize: 32,
47240
+ fontSize: DEFAULT_SCORECARD_KEY_VALUE_FONT_SIZE,
47186
47241
  ...this.props.definition.keyDescr
47187
47242
  };
47188
47243
  }
47189
47244
  get baselineStyle() {
47190
47245
  return {
47191
47246
  align: "center",
47192
- fontSize: 16,
47247
+ fontSize: DEFAULT_SCORECARD_BASELINE_FONT_SIZE,
47193
47248
  ...this.props.definition.baselineDescr
47194
47249
  };
47195
47250
  }
@@ -47429,13 +47484,13 @@ var WaterfallChartDesignPanel = class extends Component {
47429
47484
  }];
47430
47485
  }
47431
47486
  get positiveValuesColor() {
47432
- return this.props.definition.positiveValuesColor || "#4EA7F2";
47487
+ return this.props.definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
47433
47488
  }
47434
47489
  get negativeValuesColor() {
47435
- return this.props.definition.negativeValuesColor || "#EA6175";
47490
+ return this.props.definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
47436
47491
  }
47437
47492
  get subTotalValuesColor() {
47438
- return this.props.definition.subTotalValuesColor || "#AAAAAA";
47493
+ return this.props.definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
47439
47494
  }
47440
47495
  updateVerticalAxisPosition(value) {
47441
47496
  this.props.updateChart(this.props.chartId, { verticalAxisPosition: value });
@@ -48088,7 +48143,7 @@ var ConditionalFormattingEditor = class extends Component {
48088
48143
  getColorScalePreviewStyle() {
48089
48144
  const rule = this.state.rules.colorScale;
48090
48145
  const minColor = colorNumberToHex(rule.minimum.color);
48091
- const midColor = colorNumberToHex(rule.midpoint?.color || 11982760);
48146
+ const midColor = colorNumberToHex(rule.midpoint?.color || DEFAULT_COLOR_SCALE_MIDPOINT_COLOR);
48092
48147
  const maxColor = colorNumberToHex(rule.maximum.color);
48093
48148
  const baseString = "linear-gradient(to right, ";
48094
48149
  return cssPropertiesToCss({
@@ -49386,7 +49441,7 @@ var PivotMeasureDisplayPanelStore = class extends SpreadsheetStore {
49386
49441
  return {
49387
49442
  type: measureDisplayType,
49388
49443
  fieldNameWithGranularity,
49389
- value: value ?? "(previous)"
49444
+ value: value ?? PREVIOUS_VALUE
49390
49445
  };
49391
49446
  }
49392
49447
  }
@@ -50797,7 +50852,7 @@ var PivotSidePanelStore = class extends SpreadsheetStore {
50797
50852
  }
50798
50853
  const pivot = this.getters.getPivot(this.pivotId);
50799
50854
  const numberOfCells = pivot.isValid() ? pivot.getExpandedTableStructure().numberOfCells : 0;
50800
- if (!this.alreadyNotifiedForPivotSize && numberOfCells > 5e5) {
50855
+ if (!this.alreadyNotifiedForPivotSize && numberOfCells > PIVOT_MAX_NUMBER_OF_CELLS) {
50801
50856
  this.alreadyNotifiedForPivotSize = true;
50802
50857
  this.notification.notifyUser({
50803
50858
  type: "warning",
@@ -51259,7 +51314,7 @@ const SEPARATORS = [
51259
51314
  },
51260
51315
  {
51261
51316
  name: _t("Line Break"),
51262
- value: "\n"
51317
+ value: NEWLINE
51263
51318
  }
51264
51319
  ];
51265
51320
  var SplitIntoColumnsPanel = class extends Component {
@@ -52023,7 +52078,7 @@ var SidePanelStore = class extends SpreadsheetStore {
52023
52078
  const newPanelInfo = {
52024
52079
  currentPanelProps,
52025
52080
  componentTag,
52026
- size: 350
52081
+ size: DEFAULT_SIDE_PANEL_SIZE
52027
52082
  };
52028
52083
  const state = this.computeState(newPanelInfo);
52029
52084
  if (!state.isOpen) return;
@@ -52031,8 +52086,8 @@ var SidePanelStore = class extends SpreadsheetStore {
52031
52086
  this._openPanel("mainPanel", newPanelInfo, state);
52032
52087
  return;
52033
52088
  }
52034
- const nonCollapsedPanelSize = this.mainPanel.isCollapsed ? 350 : this.mainPanel.size;
52035
- if (!this.secondaryPanel && nonCollapsedPanelSize + 350 > this.availableWidth) {
52089
+ const nonCollapsedPanelSize = this.mainPanel.isCollapsed ? DEFAULT_SIDE_PANEL_SIZE : this.mainPanel.size;
52090
+ if (!this.secondaryPanel && nonCollapsedPanelSize + DEFAULT_SIDE_PANEL_SIZE > this.availableWidth) {
52036
52091
  this.get(NotificationStore).notifyUser({
52037
52092
  sticky: false,
52038
52093
  type: "warning",
@@ -52046,7 +52101,7 @@ var SidePanelStore = class extends SpreadsheetStore {
52046
52101
  const newPanelInfo = {
52047
52102
  currentPanelProps,
52048
52103
  componentTag,
52049
- size: 350
52104
+ size: DEFAULT_SIDE_PANEL_SIZE
52050
52105
  };
52051
52106
  const state = this.computeState(newPanelInfo);
52052
52107
  if (!state.isOpen) return;
@@ -52075,7 +52130,7 @@ var SidePanelStore = class extends SpreadsheetStore {
52075
52130
  this[panel] = {
52076
52131
  currentPanelProps: state.props ?? {},
52077
52132
  componentTag: newPanel.componentTag,
52078
- size: currentPanel?.size || 350,
52133
+ size: currentPanel?.size || DEFAULT_SIDE_PANEL_SIZE,
52079
52134
  isCollapsed: currentPanel?.isCollapsed || false,
52080
52135
  isPinned: currentPanel && "isPinned" in currentPanel ? currentPanel.isPinned : false
52081
52136
  };
@@ -52105,19 +52160,19 @@ var SidePanelStore = class extends SpreadsheetStore {
52105
52160
  changePanelSize(panel, size) {
52106
52161
  const panelInfo = this[panel];
52107
52162
  if (!panelInfo || "isCollapsed" in panelInfo && panelInfo.isCollapsed) return;
52108
- size = Math.max(size, 350);
52163
+ size = Math.max(size, DEFAULT_SIDE_PANEL_SIZE);
52109
52164
  let otherPanelSize = panel === "mainPanel" ? this.secondaryPanel?.size || 0 : this.mainPanel?.size || 0;
52110
52165
  if (size > this.availableWidth - otherPanelSize) {
52111
52166
  if (panel === "mainPanel" && this.secondaryPanel) {
52112
- this.secondaryPanel.size = Math.max(this.availableWidth - size, 350);
52167
+ this.secondaryPanel.size = Math.max(this.availableWidth - size, DEFAULT_SIDE_PANEL_SIZE);
52113
52168
  otherPanelSize = this.secondaryPanel.size;
52114
52169
  }
52115
- size = Math.max(this.availableWidth - otherPanelSize, 350);
52170
+ size = Math.max(this.availableWidth - otherPanelSize, DEFAULT_SIDE_PANEL_SIZE);
52116
52171
  }
52117
52172
  panelInfo.size = size;
52118
52173
  }
52119
52174
  resetPanelSize(panel) {
52120
- if (this[panel]) this[panel].size = 350;
52175
+ if (this[panel]) this[panel].size = DEFAULT_SIDE_PANEL_SIZE;
52121
52176
  }
52122
52177
  togglePinPanel() {
52123
52178
  if (!this.mainPanel) return;
@@ -52133,10 +52188,10 @@ var SidePanelStore = class extends SpreadsheetStore {
52133
52188
  if (!panelInfo) return;
52134
52189
  if (panelInfo.isCollapsed) {
52135
52190
  panelInfo.isCollapsed = false;
52136
- this.changePanelSize(panel, 350);
52191
+ this.changePanelSize(panel, DEFAULT_SIDE_PANEL_SIZE);
52137
52192
  } else {
52138
52193
  panelInfo.isCollapsed = true;
52139
- panelInfo.size = 45;
52194
+ panelInfo.size = COLLAPSED_SIDE_PANEL_SIZE;
52140
52195
  }
52141
52196
  }
52142
52197
  computeState({ componentTag, currentPanelProps: initialPanelProps }) {
@@ -52151,12 +52206,12 @@ var SidePanelStore = class extends SpreadsheetStore {
52151
52206
  } : state;
52152
52207
  }
52153
52208
  changeSpreadsheetWidth(width) {
52154
- this.availableWidth = width - 150;
52155
- if (this.secondaryPanel && width - this.totalPanelSize < 150) {
52209
+ this.availableWidth = width - MIN_SHEET_VIEW_WIDTH;
52210
+ if (this.secondaryPanel && width - this.totalPanelSize < MIN_SHEET_VIEW_WIDTH) {
52156
52211
  this.secondaryPanel?.currentPanelProps.onCloseSidePanel?.();
52157
52212
  this.secondaryPanel = void 0;
52158
52213
  }
52159
- if (this.mainPanel && width - this.totalPanelSize < 150) this.mainPanel.size = Math.max(width - 150, 350);
52214
+ if (this.mainPanel && width - this.totalPanelSize < MIN_SHEET_VIEW_WIDTH) this.mainPanel.size = Math.max(width - MIN_SHEET_VIEW_WIDTH, DEFAULT_SIDE_PANEL_SIZE);
52160
52215
  }
52161
52216
  };
52162
52217
 
@@ -52256,8 +52311,8 @@ var Grid = class extends Component {
52256
52311
  TableResizer,
52257
52312
  Selection
52258
52313
  };
52259
- HEADER_HEIGHT = 26;
52260
- HEADER_WIDTH = 48;
52314
+ HEADER_HEIGHT = HEADER_HEIGHT;
52315
+ HEADER_WIDTH = HEADER_WIDTH;
52261
52316
  menuState;
52262
52317
  gridRef;
52263
52318
  highlightStore;
@@ -52315,10 +52370,10 @@ var Grid = class extends Component {
52315
52370
  get gridOverlayDimensions() {
52316
52371
  const scrollbarWidth = this.env.model.getters.getScrollBarWidth();
52317
52372
  return cssPropertiesToCss({
52318
- top: `${26}px`,
52319
- left: `${48}px`,
52320
- height: `calc(100% - ${26 + scrollbarWidth}px)`,
52321
- width: `calc(100% - ${48 + scrollbarWidth}px)`
52373
+ top: `${HEADER_HEIGHT}px`,
52374
+ left: `${HEADER_WIDTH}px`,
52375
+ height: `calc(100% - ${HEADER_HEIGHT + scrollbarWidth}px)`,
52376
+ width: `calc(100% - ${HEADER_WIDTH + scrollbarWidth}px)`
52322
52377
  });
52323
52378
  }
52324
52379
  onClosePopover() {
@@ -52495,8 +52550,8 @@ var Grid = class extends Component {
52495
52550
  const zone = this.env.model.getters.getSelectedZone();
52496
52551
  const rect = this.env.model.getters.getVisibleRect(zone);
52497
52552
  return {
52498
- x: rect.x + rect.width - 8 / 2,
52499
- y: rect.y + rect.height - 8 / 2
52553
+ x: rect.x + rect.width - AUTOFILL_EDGE_LENGTH / 2,
52554
+ y: rect.y + rect.height - AUTOFILL_EDGE_LENGTH / 2
52500
52555
  };
52501
52556
  }
52502
52557
  get isAutofillVisible() {
@@ -52512,10 +52567,10 @@ var Grid = class extends Component {
52512
52567
  onGridResized() {
52513
52568
  const { height, width } = this.props.getGridSize();
52514
52569
  this.env.model.dispatch("RESIZE_SHEETVIEW", {
52515
- width: width - 48,
52516
- height: height - 26,
52517
- gridOffsetX: 48,
52518
- gridOffsetY: 26
52570
+ width: width - HEADER_WIDTH,
52571
+ height: height - HEADER_HEIGHT,
52572
+ gridOffsetX: HEADER_WIDTH,
52573
+ gridOffsetY: HEADER_HEIGHT
52519
52574
  });
52520
52575
  }
52521
52576
  moveCanvas(deltaX, deltaY) {
@@ -52853,7 +52908,7 @@ var ClickableCellSortIcon = class extends Component {
52853
52908
  get style() {
52854
52909
  const cellStyle = this.env.model.getters.getCellComputedStyle(this.props.position);
52855
52910
  return cssPropertiesToCss({
52856
- color: cellStyle.textColor || "#374151C2",
52911
+ color: cellStyle.textColor || TEXT_BODY_MUTED,
52857
52912
  "background-color": this.getBackgroundColor(cellStyle)
52858
52913
  });
52859
52914
  }
@@ -53663,8 +53718,8 @@ var CarouselPlugin = class extends CorePlugin {
53663
53718
  case "DUPLICATE_SHEET": {
53664
53719
  const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
53665
53720
  for (const fig of sheetFiguresFrom) if (fig.tag === "carousel") {
53666
- const figureIdBase = fig.id.split("??").pop();
53667
- const duplicatedFigureId = `${cmd.sheetIdTo}${"??"}${figureIdBase}`;
53721
+ const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
53722
+ const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
53668
53723
  const carousel = this.getCarousel(fig.id);
53669
53724
  if (carousel) {
53670
53725
  const size = {
@@ -53680,8 +53735,8 @@ var CarouselPlugin = class extends CorePlugin {
53680
53735
  size,
53681
53736
  definition: { items: carousel.items.map((item) => {
53682
53737
  if (item.type === "carouselDataView") return { ...item };
53683
- const chartIdBase = item.chartId.split("??").pop();
53684
- const newChartId = `${cmd.sheetIdTo}${"??"}${chartIdBase}`;
53738
+ const chartIdBase = item.chartId.split(FIGURE_ID_SPLITTER).pop();
53739
+ const newChartId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${chartIdBase}`;
53685
53740
  return {
53686
53741
  ...item,
53687
53742
  chartId: newChartId
@@ -54249,10 +54304,10 @@ var ChartPlugin = class extends CorePlugin {
54249
54304
  if (!chart || !figureId) continue;
54250
54305
  const fig = this.getters.getFigure(cmd.sheetId, figureId);
54251
54306
  if (!fig) continue;
54252
- const figureIdBase = figureId.split("??").pop();
54253
- const duplicatedFigureId = `${cmd.sheetIdTo}${"??"}${figureIdBase}`;
54254
- const chartIdBase = chartId.split("??").pop();
54255
- const duplicatedChartId = `${cmd.sheetIdTo}${"??"}${chartIdBase}`;
54307
+ const figureIdBase = figureId.split(FIGURE_ID_SPLITTER).pop();
54308
+ const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
54309
+ const chartIdBase = chartId.split(FIGURE_ID_SPLITTER).pop();
54310
+ const duplicatedChartId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${chartIdBase}`;
54256
54311
  const newChart = chart.duplicateInDuplicatedSheet(cmd.sheetIdTo);
54257
54312
  if (newChart) this.dispatch("CREATE_CHART", {
54258
54313
  figureId: duplicatedFigureId,
@@ -54359,8 +54414,8 @@ var ChartPlugin = class extends CorePlugin {
54359
54414
  * Add a figure with tag chart with the given id at the given position
54360
54415
  */
54361
54416
  addFigure(figureId, sheetId, col, row, offset, size = {
54362
- width: 536,
54363
- height: 335
54417
+ width: DEFAULT_FIGURE_WIDTH,
54418
+ height: DEFAULT_FIGURE_HEIGHT
54364
54419
  }) {
54365
54420
  this.dispatch("CREATE_FIGURE", {
54366
54421
  sheetId,
@@ -55082,8 +55137,8 @@ var FigurePlugin = class extends CorePlugin {
55082
55137
  const figureId = figure.id;
55083
55138
  const fig = this.figures[cmd.sheetId]?.[figureId];
55084
55139
  if (!fig) continue;
55085
- const figureIdBase = figureId.split("??").pop();
55086
- const duplicatedFigureId = `${cmd.sheetIdTo}${"??"}${figureIdBase}`;
55140
+ const figureIdBase = figureId.split(FIGURE_ID_SPLITTER).pop();
55141
+ const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
55087
55142
  this.dispatch("CREATE_FIGURE", {
55088
55143
  figureId: duplicatedFigureId,
55089
55144
  ...fig,
@@ -55121,11 +55176,11 @@ var FigurePlugin = class extends CorePlugin {
55121
55176
  const numHeader = this.getters.getNumberRows(sheetId);
55122
55177
  const remainingSize = new Array(numHeader + 1);
55123
55178
  remainingSize[numHeader] = 0;
55124
- for (let i = numHeader - 1; i >= 0; i--) remainingSize[i] = remainingSize[i + 1] + (this.getters.getUserRowSize(sheetId, i) ?? 23);
55179
+ for (let i = numHeader - 1; i >= 0; i--) remainingSize[i] = remainingSize[i + 1] + (this.getters.getUserRowSize(sheetId, i) ?? DEFAULT_CELL_HEIGHT);
55125
55180
  for (const figure of this.getFigures(sheetId)) if (figure.offset.y + figure.height > remainingSize[figure.row]) {
55126
55181
  let y = figure.offset.y;
55127
55182
  let row = figure.row;
55128
- for (let row_size = this.getters.getUserRowSize(sheetId, row) ?? 23; row_size < y; row_size = this.getters.getUserRowSize(sheetId, row) ?? 23) {
55183
+ for (let row_size = this.getters.getUserRowSize(sheetId, row) ?? DEFAULT_CELL_HEIGHT; row_size < y; row_size = this.getters.getUserRowSize(sheetId, row) ?? DEFAULT_CELL_HEIGHT) {
55129
55184
  row += 1;
55130
55185
  y -= row_size;
55131
55186
  }
@@ -55150,7 +55205,7 @@ var FigurePlugin = class extends CorePlugin {
55150
55205
  let rowNum, colNum;
55151
55206
  let { col, row } = figure;
55152
55207
  const offset = { ...figure.offset };
55153
- for (rowNum = numberOfRows; availableHeight < figure.height && rowNum > 0; rowNum--) availableHeight += this.getters.getUserRowSize(sheetId, rowNum - 1) ?? 23;
55208
+ for (rowNum = numberOfRows; availableHeight < figure.height && rowNum > 0; rowNum--) availableHeight += this.getters.getUserRowSize(sheetId, rowNum - 1) ?? DEFAULT_CELL_HEIGHT;
55154
55209
  if (row > rowNum) {
55155
55210
  row = rowNum;
55156
55211
  offset.y = Math.max(availableHeight - figure.height, 0);
@@ -55631,7 +55686,7 @@ var HeaderSizePlugin = class extends CorePlugin {
55631
55686
  }
55632
55687
  }
55633
55688
  getColSize(sheetId, index) {
55634
- return Math.round(this.sizes[sheetId]?.["COL"][index] || 96);
55689
+ return Math.round(this.sizes[sheetId]?.["COL"][index] || DEFAULT_CELL_WIDTH);
55635
55690
  }
55636
55691
  getUserRowSize(sheetId, index) {
55637
55692
  const rowSize = this.sizes[sheetId]?.["ROW"][index];
@@ -55664,7 +55719,7 @@ var HeaderSizePlugin = class extends CorePlugin {
55664
55719
  if (sheet.rows === void 0) sheet.rows = {};
55665
55720
  for (const row of range(0, this.getters.getNumberRows(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["ROW"][row]) sheet.rows[row] = {
55666
55721
  ...sheet.rows[row],
55667
- size: this.getUserRowSize(sheet.id, row) ?? 23
55722
+ size: this.getUserRowSize(sheet.id, row) ?? DEFAULT_CELL_HEIGHT
55668
55723
  };
55669
55724
  if (sheet.cols === void 0) sheet.cols = {};
55670
55725
  for (const col of range(0, this.getters.getNumberCols(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["COL"][col]) sheet.cols[col] = {
@@ -55845,8 +55900,8 @@ var ImagePlugin = class extends CorePlugin {
55845
55900
  case "DUPLICATE_SHEET": {
55846
55901
  const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
55847
55902
  for (const fig of sheetFiguresFrom) if (fig.tag === "image") {
55848
- const figureIdBase = fig.id.split("??").pop();
55849
- const duplicatedFigureId = `${cmd.sheetIdTo}${"??"}${figureIdBase}`;
55903
+ const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
55904
+ const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
55850
55905
  const image = this.getImage(fig.id);
55851
55906
  if (image) {
55852
55907
  const size = {
@@ -59610,8 +59665,8 @@ iconsOnCellRegistry.add("data_validation_checkbox", (getters, position) => {
59610
59665
  hoverSvg: value ? CHECKBOX_CHECKED : CHECKBOX_UNCHECKED_HOVERED,
59611
59666
  priority: 2,
59612
59667
  horizontalAlign: "center",
59613
- size: 17,
59614
- margin: 2,
59668
+ size: GRID_ICON_EDGE_LENGTH,
59669
+ margin: GRID_ICON_MARGIN,
59615
59670
  position,
59616
59671
  type: "data_validation_checkbox",
59617
59672
  onClick: (position, env) => {
@@ -59655,8 +59710,8 @@ iconsOnCellRegistry.add("data_validation_list_icon", (getters, position) => {
59655
59710
  hoverSvg: getHoveredCaretDownSvg(cellStyle),
59656
59711
  priority: 2,
59657
59712
  horizontalAlign: "right",
59658
- size: 17,
59659
- margin: 2,
59713
+ size: GRID_ICON_EDGE_LENGTH,
59714
+ margin: GRID_ICON_MARGIN,
59660
59715
  position,
59661
59716
  onClick: (position, env) => {
59662
59717
  const { col, row } = position;
@@ -59677,7 +59732,7 @@ iconsOnCellRegistry.add("conditional_formatting", (getters, position) => {
59677
59732
  priority: 1,
59678
59733
  horizontalAlign: "left",
59679
59734
  size: computeTextFontSizeInPixels(style),
59680
- margin: 4,
59735
+ margin: MIN_CF_ICON_MARGIN,
59681
59736
  position
59682
59737
  };
59683
59738
  }
@@ -59692,13 +59747,13 @@ iconsOnCellRegistry.add("pivot_collapse", (getters, position) => {
59692
59747
  const fields = pivotCell.dimension === "COL" ? definition.columns : definition.rows;
59693
59748
  const hasIcon = !isDashboard && !getters.shouldShowFormulas() && pivotCell.domain.length !== fields.length;
59694
59749
  const isCollapsed = (definition.collapsedDomains?.[pivotCell.dimension] ?? []).some((domain) => deepEquals(domain, pivotCell.domain));
59695
- const indent = pivotCell.dimension === "ROW" ? (pivotCell.domain.length - 1) * 15 : 0;
59750
+ const indent = pivotCell.dimension === "ROW" ? (pivotCell.domain.length - 1) * PIVOT_INDENT : 0;
59696
59751
  return {
59697
59752
  type: "pivot_collapse",
59698
59753
  priority: 4,
59699
59754
  horizontalAlign: "left",
59700
- size: hasIcon || !isDashboard && pivotCell.dimension === "ROW" && definition.rows.length > 1 ? 12 : 0,
59701
- margin: hasIcon ? 2 * 2 + indent : indent,
59755
+ size: hasIcon || !isDashboard && pivotCell.dimension === "ROW" && definition.rows.length > 1 ? PIVOT_COLLAPSE_ICON_SIZE : 0,
59756
+ margin: hasIcon ? GRID_ICON_MARGIN * 2 + indent : indent,
59702
59757
  svg: hasIcon ? getPivotIconSvg(isCollapsed, false) : void 0,
59703
59758
  hoverSvg: hasIcon ? getPivotIconSvg(isCollapsed, true) : void 0,
59704
59759
  position,
@@ -59716,8 +59771,8 @@ iconsOnCellRegistry.add("pivot_dashboard_sorting", (getters, position) => {
59716
59771
  type: `pivot_dashboard_sorting_${sortDirection}`,
59717
59772
  priority: 5,
59718
59773
  horizontalAlign: "right",
59719
- size: 17,
59720
- margin: 2,
59774
+ size: GRID_ICON_EDGE_LENGTH,
59775
+ margin: GRID_ICON_MARGIN,
59721
59776
  svg: sortDirection === "asc" ? getCaretUpSvg(cellStyle) : getCaretDownSvg(cellStyle),
59722
59777
  position,
59723
59778
  onClick: void 0
@@ -60256,7 +60311,7 @@ var EvaluationChartPlugin = class extends CoreViewPlugin {
60256
60311
  col,
60257
60312
  row
60258
60313
  });
60259
- const background = style.fillColor || "#FFFFFF";
60314
+ const background = style.fillColor || BACKGROUND_CHART_COLOR;
60260
60315
  return {
60261
60316
  background,
60262
60317
  fontColor: style.textColor || chartFontColor(background)
@@ -60553,7 +60608,7 @@ var EvaluationDataValidationPlugin = class extends CoreViewPlugin {
60553
60608
  return this.getDataValidationStyle(position);
60554
60609
  }
60555
60610
  getDataValidationChipStyle(position) {
60556
- if (this.hasChip(position)) return this.getDataValidationStyle(position) ?? { fillColor: "#E7E9ED" };
60611
+ if (this.hasChip(position)) return this.getDataValidationStyle(position) ?? { fillColor: GRAY_200 };
60557
60612
  }
60558
60613
  getInvalidDataValidationMessage(cellPosition) {
60559
60614
  const validationResult = this.getValidationResultForCell(cellPosition);
@@ -60749,7 +60804,7 @@ var HeaderSizeUIPlugin = class extends CoreViewPlugin {
60749
60804
  }
60750
60805
  }
60751
60806
  getRowSize(sheetId, row) {
60752
- return Math.round(this.getters.getUserRowSize(sheetId, row) ?? this.tallestCellInRow[sheetId][row]?.size ?? 23);
60807
+ return Math.round(this.getters.getUserRowSize(sheetId, row) ?? this.tallestCellInRow[sheetId][row]?.size ?? DEFAULT_CELL_HEIGHT);
60753
60808
  }
60754
60809
  getMaxAnchorOffset(sheetId, height, width) {
60755
60810
  let { numberOfRows: row, numberOfCols: col } = this.getters.getSheetSize(sheetId);
@@ -60787,8 +60842,8 @@ var HeaderSizeUIPlugin = class extends CoreViewPlugin {
60787
60842
  col,
60788
60843
  row
60789
60844
  });
60790
- if (updatedCellHeight <= 23) return;
60791
- if (!tallestCellInRow && updatedCellHeight > 23 || tallestCellInRow && updatedCellHeight > tallestCellInRow.size) {
60845
+ if (updatedCellHeight <= DEFAULT_CELL_HEIGHT) return;
60846
+ if (!tallestCellInRow && updatedCellHeight > DEFAULT_CELL_HEIGHT || tallestCellInRow && updatedCellHeight > tallestCellInRow.size) {
60792
60847
  const newTallestCell = {
60793
60848
  cell: {
60794
60849
  sheetId,
@@ -60813,7 +60868,7 @@ var HeaderSizeUIPlugin = class extends CoreViewPlugin {
60813
60868
  * merge, or the height of the cell computed based on its style/content.
60814
60869
  */
60815
60870
  getCellHeight(position) {
60816
- if (this.isInMultiRowMerge(position)) return 23;
60871
+ if (this.isInMultiRowMerge(position)) return DEFAULT_CELL_HEIGHT;
60817
60872
  const cell = this.getters.getCell(position);
60818
60873
  const style = this.getters.getCellStyle(position);
60819
60874
  const colSize = this.getters.getColSize(position.sheetId, position.col);
@@ -60836,7 +60891,7 @@ var HeaderSizeUIPlugin = class extends CoreViewPlugin {
60836
60891
  if (!cell) continue;
60837
60892
  const position = this.getters.getCellPosition(cell.id);
60838
60893
  const cellHeight = this.getCellHeight(position);
60839
- if (cellHeight > maxHeight && cellHeight > 23) {
60894
+ if (cellHeight > maxHeight && cellHeight > DEFAULT_CELL_HEIGHT) {
60840
60895
  maxHeight = cellHeight;
60841
60896
  tallestCell = {
60842
60897
  cell: position,
@@ -60844,7 +60899,7 @@ var HeaderSizeUIPlugin = class extends CoreViewPlugin {
60844
60899
  };
60845
60900
  }
60846
60901
  }
60847
- if (tallestCell && tallestCell.size > 23) return tallestCell;
60902
+ if (tallestCell && tallestCell.size > DEFAULT_CELL_HEIGHT) return tallestCell;
60848
60903
  }
60849
60904
  };
60850
60905
 
@@ -61232,7 +61287,7 @@ function pivot_presentation_default(PivotClass) {
61232
61287
  * @returns the value of the cell in the pivot with the new domain, or "sameValue" if the domain is the same
61233
61288
  */
61234
61289
  getComparisonValue(measure, domain, fieldNameWithGranularity, valueToCompare) {
61235
- const comparedDomain = valueToCompare === "(previous)" || valueToCompare === "(next)" ? getPreviousOrNextValueDomain(this, domain, fieldNameWithGranularity, valueToCompare) : replaceFieldValueInDomain(domain, fieldNameWithGranularity, valueToCompare);
61290
+ const comparedDomain = valueToCompare === PREVIOUS_VALUE || valueToCompare === NEXT_VALUE ? getPreviousOrNextValueDomain(this, domain, fieldNameWithGranularity, valueToCompare) : replaceFieldValueInDomain(domain, fieldNameWithGranularity, valueToCompare);
61236
61291
  if (deepEquals(comparedDomain, domain)) return "sameValue";
61237
61292
  if (!comparedDomain || !isDomainIsInPivot(this, comparedDomain)) throw new NotAvailableError();
61238
61293
  const comparedValue = this._getPivotCellValueAndFormat(measure.id, comparedDomain);
@@ -63903,7 +63958,7 @@ var Session = class extends EventBus {
63903
63958
  this.revisions = revisions;
63904
63959
  this.transportService = transportService;
63905
63960
  this.serverRevisionId = serverRevisionId;
63906
- this.debouncedMove = debounce(this._move.bind(this), 200);
63961
+ this.debouncedMove = debounce(this._move.bind(this), DEBOUNCE_TIME);
63907
63962
  }
63908
63963
  canApplyOptimisticUpdate() {
63909
63964
  return !this.waitingUndoRedoAck;
@@ -63920,7 +63975,7 @@ var Session = class extends EventBus {
63920
63975
  this.trigger("new-local-state-update", { id: revision.id });
63921
63976
  this.sendUpdateMessage({
63922
63977
  type: "REMOTE_REVISION",
63923
- version: 1,
63978
+ version: MESSAGE_VERSION,
63924
63979
  serverRevisionId: this.serverRevisionId,
63925
63980
  nextRevisionId: revision.id,
63926
63981
  clientId: revision.clientId,
@@ -63931,7 +63986,7 @@ var Session = class extends EventBus {
63931
63986
  this.waitingUndoRedoAck = true;
63932
63987
  this.sendUpdateMessage({
63933
63988
  type: "REVISION_UNDONE",
63934
- version: 1,
63989
+ version: MESSAGE_VERSION,
63935
63990
  serverRevisionId: this.serverRevisionId,
63936
63991
  nextRevisionId: this.uuidGenerator.uuidv4(),
63937
63992
  undoneRevisionId: revisionId
@@ -63941,7 +63996,7 @@ var Session = class extends EventBus {
63941
63996
  this.waitingUndoRedoAck = true;
63942
63997
  this.sendUpdateMessage({
63943
63998
  type: "REVISION_REDONE",
63944
- version: 1,
63999
+ version: MESSAGE_VERSION,
63945
64000
  serverRevisionId: this.serverRevisionId,
63946
64001
  nextRevisionId: this.uuidGenerator.uuidv4(),
63947
64002
  redoneRevisionId: revisionId
@@ -63988,7 +64043,7 @@ var Session = class extends EventBus {
63988
64043
  this.sendToTransport({
63989
64044
  type: "CLIENT_LEFT",
63990
64045
  clientId: this.clientId,
63991
- version: 1
64046
+ version: MESSAGE_VERSION
63992
64047
  });
63993
64048
  }
63994
64049
  /**
@@ -64005,7 +64060,7 @@ var Session = class extends EventBus {
64005
64060
  ...data,
64006
64061
  revisionId: snapshotId
64007
64062
  },
64008
- version: 1
64063
+ version: MESSAGE_VERSION
64009
64064
  });
64010
64065
  }
64011
64066
  getCurrentClient() {
@@ -64046,7 +64101,7 @@ var Session = class extends EventBus {
64046
64101
  };
64047
64102
  this.sendToTransport({
64048
64103
  type,
64049
- version: 1,
64104
+ version: MESSAGE_VERSION,
64050
64105
  client: {
64051
64106
  ...client,
64052
64107
  position
@@ -64125,7 +64180,7 @@ var Session = class extends EventBus {
64125
64180
  const { position } = client;
64126
64181
  if (position) this.sendToTransport({
64127
64182
  type: "CLIENT_MOVED",
64128
- version: 1,
64183
+ version: MESSAGE_VERSION,
64129
64184
  client: {
64130
64185
  ...client,
64131
64186
  position
@@ -64914,7 +64969,7 @@ var HistoryPlugin = class extends UIPlugin {
64914
64969
  onNewLocalStateUpdate({ id }) {
64915
64970
  this.undoStack.push(id);
64916
64971
  this.redoStack = [];
64917
- if (this.undoStack.length > 99) this.undoStack.shift();
64972
+ if (this.undoStack.length > MAX_HISTORY_STEPS) this.undoStack.shift();
64918
64973
  }
64919
64974
  /**
64920
64975
  * Fetch the last revision which is not empty and not a repeated command
@@ -65157,7 +65212,7 @@ var SplitToColumnsPlugin = class extends UIPlugin {
65157
65212
  }
65158
65213
  getAutoSeparatorForString(str) {
65159
65214
  const separators = [
65160
- "\n",
65215
+ NEWLINE,
65161
65216
  ";",
65162
65217
  ",",
65163
65218
  " ",
@@ -65491,9 +65546,9 @@ var SheetUIPlugin = class extends UIPlugin {
65491
65546
  contentWidth += computeMultilineTextSize(this.ctx, multiLineText, style).width;
65492
65547
  }
65493
65548
  for (const icon of this.getters.getCellIcons(position)) contentWidth += icon.margin + icon.size;
65494
- if (this.getters.getDataValidationChipStyle(position)) contentWidth += 5 * 2;
65549
+ if (this.getters.getDataValidationChipStyle(position)) contentWidth += DATA_VALIDATION_CHIP_MARGIN * 2;
65495
65550
  if (contentWidth === 0) return 0;
65496
- contentWidth += 2 * 4;
65551
+ contentWidth += 2 * PADDING_AUTORESIZE_HORIZONTAL;
65497
65552
  if (style.wrapping === "wrap") {
65498
65553
  const colWidth = this.getters.getColSize(position.sheetId, position.col);
65499
65554
  return Math.min(colWidth, contentWidth);
@@ -65545,11 +65600,11 @@ var SheetUIPlugin = class extends UIPlugin {
65545
65600
  computeTextYCoordinate(cellRect, textLineHeight, verticalAlign = DEFAULT_VERTICAL_ALIGN, numberOfLines = 1) {
65546
65601
  const y = cellRect.y + 1;
65547
65602
  const textHeight = computeTextLinesHeight(textLineHeight, numberOfLines);
65548
- if (cellRect.height > textHeight + 4 * 2) {
65603
+ if (cellRect.height > textHeight + MIN_CELL_TEXT_MARGIN * 2) {
65549
65604
  if (verticalAlign === "middle") return Math.ceil(y + (cellRect.height - textHeight) / 2);
65550
- if (verticalAlign === "bottom") return y + cellRect.height - textHeight - 4;
65605
+ if (verticalAlign === "bottom") return y + cellRect.height - textHeight - MIN_CELL_TEXT_MARGIN;
65551
65606
  }
65552
- return y + 4;
65607
+ return y + MIN_CELL_TEXT_MARGIN;
65553
65608
  }
65554
65609
  /**
65555
65610
  * Expands the given zone until bordered by empty cells or reached the sheet boundaries.
@@ -65653,7 +65708,7 @@ var SheetUIPlugin = class extends UIPlugin {
65653
65708
  const style = this.getters.getCellStyle(position);
65654
65709
  const content = evaluatedCell.formattedValue;
65655
65710
  const evaluatedSize = getCellContentHeight(this.ctx, content, style, colSize);
65656
- if (evaluatedSize > evaluatedRowSize && evaluatedSize > 23) {
65711
+ if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) {
65657
65712
  evaluatedRowSize = evaluatedSize;
65658
65713
  tallestCell = position;
65659
65714
  }
@@ -66308,7 +66363,7 @@ var ClipboardPlugin = class extends UIPlugin {
66308
66363
  const imageUrl = this.getters.getImage(figureId).path;
66309
66364
  file = await this.fileStore?.getFile(imageUrl);
66310
66365
  if (file.type !== "image/png") {
66311
- if (file.size > 5242880) {
66366
+ if (file.size > MAX_FILE_SIZE) {
66312
66367
  this.ui.notifyUI({
66313
66368
  text: _t("The file you are trying to copy is too large (>%sMB).\nIt will not be added to your OS clipboard.\nYou can download it directly instead.", Math.round(MAX_FILE_SIZE / (1024 * 1024))),
66314
66369
  sticky: false,
@@ -67433,7 +67488,7 @@ var InternalViewport = class {
67433
67488
  let height = lastRowEnd - this.offsetCorrectionY;
67434
67489
  if (this.canScrollVertically) {
67435
67490
  height = Math.max(height, this.viewportHeight);
67436
- if (lastRowEnd + 46 > height && !this.getters.isReadonly() && this.viewportHeight > 46) height += 46;
67491
+ if (lastRowEnd + FOOTER_HEIGHT > height && !this.getters.isReadonly() && this.viewportHeight > FOOTER_HEIGHT) height += FOOTER_HEIGHT;
67437
67492
  }
67438
67493
  return {
67439
67494
  width,
@@ -67952,7 +68007,7 @@ var SheetViewPlugin = class extends UIPlugin {
67952
68007
  return this.getSubViewports(sheetId).some((pane) => pane.isVisible(col, row));
67953
68008
  }
67954
68009
  getScrollBarWidth() {
67955
- return 15 / this.zoomLevel;
68010
+ return SCROLLBAR_WIDTH / this.zoomLevel;
67956
68011
  }
67957
68012
  getEdgeScrollCol(x, previousX, startingX) {
67958
68013
  let canEdgeScroll = false;
@@ -68465,8 +68520,8 @@ autoCompleteProviders.add("dataValidation", {
68465
68520
  text: value.value,
68466
68521
  htmlContent: [{
68467
68522
  value: value.label,
68468
- color: chipTextColor(color || "#E7E9ED"),
68469
- backgroundColor: color || "#E7E9ED",
68523
+ color: chipTextColor(color || GRAY_200),
68524
+ backgroundColor: color || GRAY_200,
68470
68525
  classes: ["badge rounded-pill fs-6 fw-normal w-100 mt-1 text-start"]
68471
68526
  }],
68472
68527
  fuzzySearchKey: value.label
@@ -68906,8 +68961,8 @@ iconsOnCellRegistry.add("filter_icon", (getters, position) => {
68906
68961
  hoverSvg: getDataFilterIcon(isFilterActive, isHighContrast, true),
68907
68962
  priority: 3,
68908
68963
  horizontalAlign: "right",
68909
- size: 17,
68910
- margin: 2,
68964
+ size: GRID_ICON_EDGE_LENGTH,
68965
+ margin: GRID_ICON_MARGIN,
68911
68966
  position,
68912
68967
  onClick: (position, env) => {
68913
68968
  const cellPopovers = env.getStore(CellPopoverStore);
@@ -70798,16 +70853,16 @@ var RowGroup = class extends AbstractHeaderGroup {
70798
70853
  const startCoordinates = this.env.model.getters.getRowDimensions(sheetId, startRow).start;
70799
70854
  const endCoordinates = this.env.model.getters.getRowDimensions(sheetId, endRow).end;
70800
70855
  let groupHeaderY = 0;
70801
- let groupHeaderHeight = 26;
70856
+ let groupHeaderHeight = HEADER_HEIGHT;
70802
70857
  if (startRow !== 0) {
70803
70858
  const headerRowDims = this.env.model.getters.getRowDimensions(sheetId, startRow - 1);
70804
- groupHeaderY = 26 + headerRowDims.start;
70859
+ groupHeaderY = HEADER_HEIGHT + headerRowDims.start;
70805
70860
  groupHeaderHeight = headerRowDims.end - headerRowDims.start;
70806
70861
  }
70807
70862
  const headerRect = {
70808
70863
  x: this.props.layerOffset,
70809
70864
  y: groupHeaderY,
70810
- width: 21,
70865
+ width: GROUP_LAYER_WIDTH,
70811
70866
  height: groupHeaderHeight
70812
70867
  };
70813
70868
  return {
@@ -70815,7 +70870,7 @@ var RowGroup = class extends AbstractHeaderGroup {
70815
70870
  groupRect: {
70816
70871
  x: this.props.layerOffset,
70817
70872
  y: headerRect.y,
70818
- width: 21,
70873
+ width: GROUP_LAYER_WIDTH,
70819
70874
  height: headerRect.height + (endCoordinates - startCoordinates)
70820
70875
  },
70821
70876
  isEndHidden: this.env.model.getters.isRowHidden(sheetId, endRow)
@@ -70848,17 +70903,17 @@ var ColGroup = class extends AbstractHeaderGroup {
70848
70903
  const startCoordinates = this.env.model.getters.getColDimensions(sheetId, startCol).start;
70849
70904
  const endCoordinates = this.env.model.getters.getColDimensions(sheetId, endCol).end;
70850
70905
  let groupHeaderX = 0;
70851
- let groupHeaderWidth = 48;
70906
+ let groupHeaderWidth = HEADER_WIDTH;
70852
70907
  if (startCol !== 0) {
70853
70908
  const headerRowDims = this.env.model.getters.getColDimensions(sheetId, startCol - 1);
70854
- groupHeaderX = 48 + headerRowDims.start;
70909
+ groupHeaderX = HEADER_WIDTH + headerRowDims.start;
70855
70910
  groupHeaderWidth = headerRowDims.end - headerRowDims.start;
70856
70911
  }
70857
70912
  const headerRect = {
70858
70913
  x: groupHeaderX,
70859
70914
  y: this.props.layerOffset,
70860
70915
  width: groupHeaderWidth,
70861
- height: 21
70916
+ height: GROUP_LAYER_WIDTH
70862
70917
  };
70863
70918
  return {
70864
70919
  headerRect,
@@ -70866,7 +70921,7 @@ var ColGroup = class extends AbstractHeaderGroup {
70866
70921
  x: headerRect.x,
70867
70922
  y: this.props.layerOffset,
70868
70923
  width: headerRect.width + (endCoordinates - startCoordinates),
70869
- height: 21
70924
+ height: GROUP_LAYER_WIDTH
70870
70925
  },
70871
70926
  isEndHidden: this.env.model.getters.isColHidden(sheetId, endCol)
70872
70927
  };
@@ -70892,7 +70947,7 @@ var HeaderGroupContainer = class extends Component {
70892
70947
  menuItems: []
70893
70948
  });
70894
70949
  getLayerOffset(layerIndex) {
70895
- return layerIndex * 21;
70950
+ return layerIndex * GROUP_LAYER_WIDTH;
70896
70951
  }
70897
70952
  onContextMenu(event) {
70898
70953
  const sheetId = this.env.model.getters.getActiveSheetId();
@@ -70940,8 +70995,8 @@ var HeaderGroupContainer = class extends Component {
70940
70995
  get frozenPaneContainerSize() {
70941
70996
  if (!this.hasFrozenPane) return 0;
70942
70997
  const viewportCoordinates = this.env.model.getters.getMainViewportCoordinates();
70943
- if (this.props.dimension === "COL") return 48 + viewportCoordinates.x;
70944
- else return 26 + viewportCoordinates.y;
70998
+ if (this.props.dimension === "COL") return HEADER_WIDTH + viewportCoordinates.x;
70999
+ else return HEADER_HEIGHT + viewportCoordinates.y;
70945
71000
  }
70946
71001
  };
70947
71002
 
@@ -70950,7 +71005,7 @@ var HeaderGroupContainer = class extends Component {
70950
71005
  function useScreenWidth() {
70951
71006
  const spreadsheetRect = useSpreadsheetRect();
70952
71007
  return { get isSmall() {
70953
- return spreadsheetRect.width < 768;
71008
+ return spreadsheetRect.width < MOBILE_WIDTH_BREAKPOINT;
70954
71009
  } };
70955
71010
  }
70956
71011
 
@@ -71262,7 +71317,7 @@ var TopBarComposer = class extends Component {
71262
71317
  "max-height": `${COMPOSER_MAX_HEIGHT}px`,
71263
71318
  "line-height": "24px"
71264
71319
  };
71265
- style.height = this.focus === "inactive" ? `${34}px` : "fit-content";
71320
+ style.height = this.focus === "inactive" ? `${DESKTOP_TOPBAR_TOOLBAR_HEIGHT}px` : "fit-content";
71266
71321
  return cssPropertiesToCss(style);
71267
71322
  }
71268
71323
  onFocus(selection) {
@@ -72221,7 +72276,7 @@ var Spreadsheet = class extends Component {
72221
72276
  const scrollbarWidth = this.env.model.getters.getScrollBarWidth();
72222
72277
  if (this.env.isDashboard()) properties["grid-template-rows"] = `auto`;
72223
72278
  else properties["grid-template-rows"] = `min-content auto min-content`;
72224
- properties["grid-template-columns"] = `auto ${this.sidePanel.mainPanel ? `${this.sidePanel.totalPanelSize || 350}px` : "auto"}`;
72279
+ properties["grid-template-columns"] = `auto ${this.sidePanel.mainPanel ? `${this.sidePanel.totalPanelSize || DEFAULT_SIDE_PANEL_SIZE}px` : "auto"}`;
72225
72280
  properties["--os-scrollbar-width"] = `${scrollbarWidth}px`;
72226
72281
  properties["color-scheme"] = this.props.colorScheme;
72227
72282
  return cssPropertiesToCss(properties);
@@ -72308,7 +72363,7 @@ var Spreadsheet = class extends Component {
72308
72363
  checkViewportSize() {
72309
72364
  const { xRatio, yRatio } = this.env.model.getters.getFrozenSheetViewRatio(this.env.model.getters.getActiveSheetId());
72310
72365
  if (!isFinite(xRatio) || !isFinite(yRatio)) return;
72311
- if (yRatio > .85 || xRatio > .85) {
72366
+ if (yRatio > MAXIMAL_FREEZABLE_RATIO || xRatio > MAXIMAL_FREEZABLE_RATIO) {
72312
72367
  if (this.isViewportTooSmall) return;
72313
72368
  this.notificationStore.notifyUser({
72314
72369
  text: _t("The current window is too small to display this sheet properly. Consider resizing your browser window or adjusting frozen rows and columns."),
@@ -72326,8 +72381,8 @@ var Spreadsheet = class extends Component {
72326
72381
  return this.env.model.getters.getSheetViewDimension().height;
72327
72382
  }
72328
72383
  get gridContainerStyle() {
72329
- const gridColSize = 21 * this.rowLayers.length;
72330
- const gridRowSize = 21 * this.colLayers.length;
72384
+ const gridColSize = GROUP_LAYER_WIDTH * this.rowLayers.length;
72385
+ const gridRowSize = GROUP_LAYER_WIDTH * this.colLayers.length;
72331
72386
  const zoom = this.env.model.getters.getViewportZoomLevel();
72332
72387
  return cssPropertiesToCss({
72333
72388
  "grid-template-columns": `${gridColSize ? gridColSize + 2 : 0}px auto`,
@@ -74122,7 +74177,7 @@ function createChart(chart, chartSheetIndex, data) {
74122
74177
  let title = escapeXml``;
74123
74178
  if (chart.data.title?.text) {
74124
74179
  const titleColor = toXlsxHexColor(chartMutedFontColor(chart.data.backgroundColor));
74125
- const fontSize = chart.data.title.fontSize ?? 16;
74180
+ const fontSize = chart.data.title.fontSize ?? CHART_TITLE_FONT_SIZE;
74126
74181
  title = escapeXml`
74127
74182
  <c:title>
74128
74183
  ${insertText(chart.data.title.text, titleColor, fontSize, chart.data.title)}
@@ -74213,7 +74268,7 @@ function lineAttributes(params) {
74213
74268
  </a:ln>
74214
74269
  `;
74215
74270
  }
74216
- function insertText(text, fontColor = "000000", fontsize = 16, style = {}) {
74271
+ function insertText(text, fontColor = "000000", fontsize = CHART_TITLE_FONT_SIZE, style = {}) {
74217
74272
  const textProperties = [
74218
74273
  ["b", style.bold ? "1" : "0"],
74219
74274
  ["i", style.italic ? "1" : "0"],
@@ -74776,7 +74831,7 @@ function addDoughnutChart(chart, chartSheetIndex, data) {
74776
74831
  return escapeXml`
74777
74832
  <c:doughnutChart>
74778
74833
  <c:varyColors val="1" />
74779
- <c:holeSize val="${chart.pieHolePercentage ?? (chart.isDoughnut ? 50 : 0)}" />
74834
+ <c:holeSize val="${chart.pieHolePercentage ?? (chart.isDoughnut ? DEFAULT_DOUGHNUT_CHART_HOLE_SIZE : 0)}" />
74780
74835
  ${insertDataLabels()}
74781
74836
  ${joinXmlNodes(dataSetsNodes)}
74782
74837
  </c:doughnutChart>
@@ -74797,7 +74852,7 @@ function insertDataLabels({ showLeaderLines } = { showLeaderLines: false }) {
74797
74852
  }
74798
74853
  function addAx(position, axisName, axId, crossAxId, title, defaultFontColor, deleteAxis = 0, orientation = "minMax", crossPosition, tickLabelPosition = "nextTo", maxValue, majorUnit, format = "General") {
74799
74854
  const color = title?.color ? toXlsxHexColor(title.color) : defaultFontColor;
74800
- const fontSize = title?.fontSize ?? 12;
74855
+ const fontSize = title?.fontSize ?? CHART_AXIS_TITLE_FONT_SIZE;
74801
74856
  const crossBetweenEl = axisName === "c:valAx" ? escapeXml`<c:crossBetween val="between" />` : "";
74802
74857
  const maxValueEl = maxValue ? escapeXml`<c:max val="${maxValue}" />` : "";
74803
74858
  const minValueEl = maxValue ? escapeXml`<c:min val="${-maxValue}" />` : "";
@@ -75414,12 +75469,12 @@ function figureCoordinates(headers, anchor, offset) {
75414
75469
  let currentPosition = 0;
75415
75470
  for (const [headerIndex, header] of headers.slice(anchor).entries()) if (currentPosition <= offset && offset < currentPosition + header.size) return {
75416
75471
  index: anchor + headerIndex,
75417
- offset: convertDotValueToEMU(offset - currentPosition + 1)
75472
+ offset: convertDotValueToEMU(offset - currentPosition + FIGURE_BORDER_WIDTH)
75418
75473
  };
75419
75474
  else if (headerIndex < headers.length - 1) currentPosition += header.size;
75420
75475
  return {
75421
75476
  index: headers.length - 1,
75422
- offset: convertDotValueToEMU(offset - currentPosition + 1)
75477
+ offset: convertDotValueToEMU(offset - currentPosition + FIGURE_BORDER_WIDTH)
75423
75478
  };
75424
75479
  }
75425
75480
  function createChartDrawing(figure, sheet, chartRelId, construct) {
@@ -75518,7 +75573,7 @@ function createImageDrawing(figure, sheet, imageRelId) {
75518
75573
  function addNumberFormats(numFmts) {
75519
75574
  const numFmtNodes = [];
75520
75575
  for (const [index, numFmt] of Object.entries(numFmts)) {
75521
- const numFmtAttrs = [["numFmtId", parseInt(index) + 164], ["formatCode", numFmt.format]];
75576
+ const numFmtAttrs = [["numFmtId", parseInt(index) + FIRST_NUMFMT_ID], ["formatCode", numFmt.format]];
75522
75577
  numFmtNodes.push(escapeXml`
75523
75578
  <numFmt ${formatAttributes(numFmtAttrs)}/>
75524
75579
  `);
@@ -75751,7 +75806,7 @@ function addColumns(cols) {
75751
75806
  const attributes = [
75752
75807
  ["min", parseInt(id) + 1],
75753
75808
  ["max", parseInt(id) + 1],
75754
- ["width", convertWidthToExcel(col.size || 96)],
75809
+ ["width", convertWidthToExcel(col.size || DEFAULT_CELL_WIDTH)],
75755
75810
  ["customWidth", 1],
75756
75811
  ["hidden", col.isHidden ? 1 : 0]
75757
75812
  ];
@@ -75775,7 +75830,7 @@ function addRows(construct, data, sheet) {
75775
75830
  for (let r = 0; r < sheet.rowNumber; r++) {
75776
75831
  const rowAttrs = [["r", r + 1]];
75777
75832
  const row = sheet.rows[r] || {};
75778
- if (row.size && row.size !== 23) rowAttrs.push(["ht", convertHeightToExcel(row.size)], ["customHeight", 1]);
75833
+ if (row.size && row.size !== DEFAULT_CELL_HEIGHT) rowAttrs.push(["ht", convertHeightToExcel(row.size)], ["customHeight", 1]);
75779
75834
  if (row.isHidden) rowAttrs.push(["hidden", 1]);
75780
75835
  if (row.outlineLevel) rowAttrs.push(["outlineLevel", row.outlineLevel]);
75781
75836
  if (row.collapsed) rowAttrs.push(["collapsed", 1]);
@@ -75817,7 +75872,7 @@ function addRows(construct, data, sheet) {
75817
75872
  </c>`);
75818
75873
  }
75819
75874
  }
75820
- if (cellNodes.length || row.size !== 23 || row.isHidden || row.outlineLevel || row.collapsed) rowNodes.push(escapeXml`
75875
+ if (cellNodes.length || row.size !== DEFAULT_CELL_HEIGHT || row.isHidden || row.outlineLevel || row.collapsed) rowNodes.push(escapeXml`
75821
75876
  <row ${formatAttributes(rowAttrs)}>
75822
75877
  ${joinXmlNodes(cellNodes)}
75823
75878
  </row>
@@ -75990,7 +76045,7 @@ function createWorksheets(data, construct) {
75990
76045
  let currentTableIndex = 1;
75991
76046
  for (const [sheetIndex, sheet] of Object.entries(data.sheets)) {
75992
76047
  const namespaces = [["xmlns", NAMESPACE["worksheet"]], ["xmlns:r", RELATIONSHIP_NSR]];
75993
- const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(23)], ["defaultColWidth", convertWidthToExcel(96)]];
76048
+ const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(DEFAULT_CELL_HEIGHT)], ["defaultColWidth", convertWidthToExcel(DEFAULT_CELL_WIDTH)]];
75994
76049
  const tablesNode = createTablesForSheet(sheet, sheetIndex, currentTableIndex, construct, files);
75995
76050
  currentTableIndex += sheet.tables.length;
75996
76051
  let drawingNode = escapeXml``;
@@ -76659,7 +76714,7 @@ var Model = class extends EventBus {
76659
76714
  exportData() {
76660
76715
  let data = createEmptyWorkbookData();
76661
76716
  for (const handler of this.handlers) if (handler instanceof CorePlugin) handler.export(data);
76662
- data.revisionId = this.session.getRevisionId() || "START_REVISION";
76717
+ data.revisionId = this.session.getRevisionId() || DEFAULT_REVISION_ID;
76663
76718
  data = deepCopy(data);
76664
76719
  return data;
76665
76720
  }
@@ -76812,10 +76867,10 @@ function createCalendarChartRuntime(chart, getters) {
76812
76867
  chartShowValuesPlugin: getCalendarChartShowValues(definition, chartData),
76813
76868
  chartColorScalePlugin: getCalendarColorScale(definition, chartData)
76814
76869
  },
76815
- chartBackground: definition.background || "#FFFFFF"
76870
+ chartBackground: definition.background || BACKGROUND_CHART_COLOR
76816
76871
  }
76817
76872
  },
76818
- background: chart.background || "#FFFFFF"
76873
+ background: chart.background || BACKGROUND_CHART_COLOR
76819
76874
  };
76820
76875
  }
76821
76876
 
@@ -76897,7 +76952,7 @@ var ComboChart = class ComboChart extends AbstractChart {
76897
76952
  const definition = this.getDefinition();
76898
76953
  return {
76899
76954
  ...definition,
76900
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
76955
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
76901
76956
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
76902
76957
  dataSets,
76903
76958
  labelRange,
@@ -76961,7 +77016,7 @@ function createComboChartRuntime(chart, getters) {
76961
77016
  }
76962
77017
  }
76963
77018
  },
76964
- background: chart.background || "#FFFFFF"
77019
+ background: chart.background || BACKGROUND_CHART_COLOR
76965
77020
  };
76966
77021
  }
76967
77022
 
@@ -77096,7 +77151,7 @@ function createFunnelChartRuntime(chart, getters) {
77096
77151
  }
77097
77152
  }
77098
77153
  },
77099
- background: chart.background || "#FFFFFF"
77154
+ background: chart.background || BACKGROUND_CHART_COLOR
77100
77155
  };
77101
77156
  }
77102
77157
 
@@ -77211,7 +77266,7 @@ function createGeoChartRuntime(chart, getters) {
77211
77266
  }
77212
77267
  }
77213
77268
  },
77214
- background: chart.background || "#FFFFFF"
77269
+ background: chart.background || BACKGROUND_CHART_COLOR
77215
77270
  };
77216
77271
  }
77217
77272
 
@@ -77318,7 +77373,7 @@ var PyramidChart = class PyramidChart extends AbstractChart {
77318
77373
  return {
77319
77374
  ...definition,
77320
77375
  horizontal: true,
77321
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
77376
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
77322
77377
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
77323
77378
  dataSets,
77324
77379
  labelRange,
@@ -77355,7 +77410,7 @@ function createPyramidChartRuntime(chart, getters) {
77355
77410
  }
77356
77411
  }
77357
77412
  },
77358
- background: chart.background || "#FFFFFF"
77413
+ background: chart.background || BACKGROUND_CHART_COLOR
77359
77414
  };
77360
77415
  }
77361
77416
 
@@ -77460,7 +77515,7 @@ var RadarChart = class RadarChart extends AbstractChart {
77460
77515
  const { dataSets, labelRange } = this.getCommonDataSetAttributesForExcel(this.labelRange, this.dataSets, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
77461
77516
  return {
77462
77517
  ...this.getDefinition(),
77463
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
77518
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
77464
77519
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
77465
77520
  dataSets,
77466
77521
  labelRange
@@ -77494,7 +77549,7 @@ function createRadarChartRuntime(chart, getters) {
77494
77549
  }
77495
77550
  }
77496
77551
  },
77497
- background: chart.background || "#FFFFFF"
77552
+ background: chart.background || BACKGROUND_CHART_COLOR
77498
77553
  };
77499
77554
  }
77500
77555
 
@@ -77617,7 +77672,7 @@ function createSunburstChartRuntime(chart, getters) {
77617
77672
  }
77618
77673
  }
77619
77674
  },
77620
- background: chart.background || "#FFFFFF"
77675
+ background: chart.background || BACKGROUND_CHART_COLOR
77621
77676
  };
77622
77677
  }
77623
77678
 
@@ -77753,7 +77808,7 @@ function createTreeMapChartRuntime(chart, getters) {
77753
77808
  }
77754
77809
  }
77755
77810
  },
77756
- background: chart.background || "#FFFFFF"
77811
+ background: chart.background || BACKGROUND_CHART_COLOR
77757
77812
  };
77758
77813
  }
77759
77814
 
@@ -78956,14 +79011,14 @@ clipboardHandlersRegistries.cellHandlers.add("dataValidation", DataValidationCli
78956
79011
  */
78957
79012
  const __info__ = {};
78958
79013
  const SPREADSHEET_DIMENSIONS = {
78959
- MIN_ROW_HEIGHT: 10,
78960
- MIN_COL_WIDTH: 5,
78961
- HEADER_HEIGHT: 26,
78962
- HEADER_WIDTH: 48,
78963
- DESKTOP_BOTTOMBAR_HEIGHT: 36,
78964
- DEFAULT_CELL_WIDTH: 96,
78965
- DEFAULT_CELL_HEIGHT: 23,
78966
- SCROLLBAR_WIDTH: 15
79014
+ MIN_ROW_HEIGHT,
79015
+ MIN_COL_WIDTH,
79016
+ HEADER_HEIGHT,
79017
+ HEADER_WIDTH,
79018
+ DESKTOP_BOTTOMBAR_HEIGHT,
79019
+ DEFAULT_CELL_WIDTH,
79020
+ DEFAULT_CELL_HEIGHT,
79021
+ SCROLLBAR_WIDTH
78967
79022
  };
78968
79023
  const registries = {
78969
79024
  autoCompleteProviders,
@@ -79181,9 +79236,9 @@ const constants = {
79181
79236
  HIGHLIGHT_COLOR,
79182
79237
  PIVOT_TABLE_CONFIG,
79183
79238
  ChartTerms,
79184
- FIGURE_ID_SPLITTER: "??",
79185
- GRID_ICON_EDGE_LENGTH: 17,
79186
- GRID_ICON_MARGIN: 2
79239
+ FIGURE_ID_SPLITTER,
79240
+ GRID_ICON_EDGE_LENGTH,
79241
+ GRID_ICON_MARGIN
79187
79242
  };
79188
79243
  const chartHelpers = {
79189
79244
  ...charts_exports,
@@ -79193,6 +79248,6 @@ const chartHelpers = {
79193
79248
  //#endregion
79194
79249
  export { AbstractCellClipboardHandler, AbstractChart, AbstractFigureClipboardHandler, CellErrorType, ClientDisconnectedError, CommandResult, CorePlugin, CoreViewPlugin, DEFAULT_LOCALE, DEFAULT_LOCALES, DispatchResult, EvaluationError, LocalTransportService, Model, PivotRuntimeDefinition, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, SpreadsheetPivotTable, UIPlugin, __info__, addFunction, addRenderingLayer, astToFormula, categories, chartHelpers, components, constants, convertAstNodes, coreTypes, createAutocompleteArgumentsProvider, findCellInNewZone, functionCache, getCaretDownSvg, getCaretUpSvg, helpers, hooks, invalidateCFEvaluationCommands, invalidateChartEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, parseTokens, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, stores, tokenColors, tokenize };
79195
79250
 
79196
- __info__.version = "19.1.36";
79197
- __info__.date = "2026-09-18T05:25:25.806Z";
79198
- __info__.hash = "5661311";
79251
+ __info__.version = "19.1.37";
79252
+ __info__.date = "2026-10-01T07:46:03.212Z";
79253
+ __info__.hash = "fe8ce23";