@odoo/o-spreadsheet 19.2.30 → 19.2.31

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.2.30
6
- * @date 2026-09-18T05:25:53.803Z
7
- * @hash 3e0951a
5
+ * @version 19.2.31
6
+ * @date 2026-10-01T07:52:54.414Z
7
+ * @hash a784cea
8
8
  */
9
9
 
10
10
  (function(exports, _odoo_owl) {
@@ -229,12 +229,19 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
229
229
  const TEXT_BODY = "#374151";
230
230
  const TEXT_BODY_MUTED = "#374151C2";
231
231
  const ACTION_COLOR = HIGHLIGHT_COLOR;
232
+ const CHART_PADDING = 20;
233
+ const CHART_PADDING_BOTTOM = 10;
234
+ const CHART_PADDING_TOP = 15;
232
235
  const CHART_TITLE_FONT_SIZE = 16;
236
+ const CHART_AXIS_TITLE_FONT_SIZE = 12;
237
+ const MASTER_CHART_HEIGHT = 60;
238
+ const CHART_COLORSCALE_WIDTH = 70;
233
239
  const DEFAULT_CHART_COLOR_SCALE = {
234
240
  minColor: "#FFF5EB",
235
241
  midColor: "#FD8D3C",
236
242
  maxColor: "#7F2704"
237
243
  };
244
+ const SCORECARD_CHART_TITLE_FONT_SIZE = 14;
238
245
  const PIVOT_TOKEN_COLOR = "#F28C28";
239
246
  const COLOR_PICKER_DEFAULTS = [
240
247
  "#000000",
@@ -318,8 +325,30 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
318
325
  "#20124D",
319
326
  "#4C1130"
320
327
  ];
328
+ const MIN_ROW_HEIGHT = 10;
329
+ const MIN_COL_WIDTH = 5;
330
+ const HEADER_HEIGHT = 26;
331
+ const HEADER_WIDTH = 48;
332
+ const DESKTOP_TOPBAR_TOOLBAR_HEIGHT = 34;
333
+ const DESKTOP_BOTTOMBAR_HEIGHT = 36;
334
+ const DEFAULT_CELL_WIDTH = 96;
321
335
  const DEFAULT_CELL_HEIGHT = 23;
322
- const FOOTER_HEIGHT = 2 * 23;
336
+ const SCROLLBAR_WIDTH = 15;
337
+ const AUTOFILL_EDGE_LENGTH = 8;
338
+ const ICON_EDGE_LENGTH = 18;
339
+ const MIN_CF_ICON_MARGIN = 4;
340
+ const MIN_CELL_TEXT_MARGIN = 4;
341
+ const PADDING_AUTORESIZE_VERTICAL = 3;
342
+ const PADDING_AUTORESIZE_HORIZONTAL = MIN_CELL_TEXT_MARGIN;
343
+ const GROUP_LAYER_WIDTH = 21;
344
+ const GRID_ICON_MARGIN = 2;
345
+ const GRID_ICON_EDGE_LENGTH = 17;
346
+ const FOOTER_HEIGHT = 2 * DEFAULT_CELL_HEIGHT;
347
+ const DATA_VALIDATION_CHIP_MARGIN = 5;
348
+ const MOBILE_WIDTH_BREAKPOINT = 768;
349
+ const MENU_WIDTH = 250;
350
+ const MENU_VERTICAL_PADDING = 6;
351
+ const DESKTOP_MENU_ITEM_HEIGHT = 26;
323
352
  const ZOOM_VALUES = [
324
353
  50,
325
354
  75,
@@ -349,20 +378,34 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
349
378
  };
350
379
  const DEFAULT_VERTICAL_ALIGN = DEFAULT_STYLE.verticalAlign;
351
380
  const DEFAULT_WRAPPING_MODE = DEFAULT_STYLE.wrapping;
381
+ const DEFAULT_FONT_WEIGHT = "400";
352
382
  const DEFAULT_FONT_SIZE = DEFAULT_STYLE.fontSize;
383
+ const HEADER_FONT_SIZE = 11;
353
384
  const DEFAULT_FONT = "'Roboto', arial, 'Liberation Sans'";
354
385
  const DEFAULT_BORDER_DESC = {
355
386
  style: "thin",
356
387
  color: "#000000"
357
388
  };
389
+ const MAX_HISTORY_STEPS = 99;
358
390
  const DEFAULT_REVISION_ID = "START_REVISION";
391
+ const DEFAULT_FIGURE_HEIGHT = 335;
392
+ const DEFAULT_FIGURE_WIDTH = 536;
393
+ const FIGURE_BORDER_WIDTH = 1;
394
+ const MIN_FIG_SIZE = 80;
395
+ const MAX_CHAR_LABEL = 20;
396
+ const FIGURE_ID_SPLITTER = "??";
359
397
  const DEFAULT_GAUGE_LOWER_COLOR = "#EA6175";
360
398
  const DEFAULT_GAUGE_MIDDLE_COLOR = "#FFD86D";
361
399
  const DEFAULT_GAUGE_UPPER_COLOR = "#43C5B1";
362
400
  const DEFAULT_SCORECARD_BASELINE_MODE = "difference";
363
401
  const DEFAULT_SCORECARD_BASELINE_COLOR_UP = "#43C5B1";
364
402
  const DEFAULT_SCORECARD_BASELINE_COLOR_DOWN = "#EA6175";
403
+ const DEFAULT_SCORECARD_KEY_VALUE_FONT_SIZE = 32;
404
+ const DEFAULT_SCORECARD_BASELINE_FONT_SIZE = 16;
365
405
  const LINE_FILL_TRANSPARENCY = .4;
406
+ const LINE_DATA_POINT_RADIUS = 3;
407
+ const DEFAULT_WINDOW_SIZE = 2;
408
+ const MESSAGE_VERSION = 1;
366
409
  const FORBIDDEN_SHEETNAME_CHARS = [
367
410
  "'",
368
411
  "*",
@@ -373,6 +416,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
373
416
  "]"
374
417
  ];
375
418
  const FORBIDDEN_SHEETNAME_CHARS_IN_EXCEL_REGEX = /'|\*|\?|\/|\\|\[|\]/;
419
+ const FORMULA_REF_IDENTIFIER = "|";
376
420
  let DEFAULT_SHEETVIEW_SIZE = 0;
377
421
  function getDefaultSheetViewSize() {
378
422
  return DEFAULT_SHEETVIEW_SIZE;
@@ -381,6 +425,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
381
425
  DEFAULT_SHEETVIEW_SIZE = size;
382
426
  }
383
427
  const MAXIMAL_FREEZABLE_RATIO = .85;
428
+ const NEWLINE = "\n";
384
429
  const FONT_SIZES = [
385
430
  6,
386
431
  7,
@@ -406,6 +451,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
406
451
  automaticAutofill: false
407
452
  };
408
453
  const PIVOT_INSERT_TABLE_STYLE_ID = "PivotTableStyleMedium12";
454
+ const PIVOT_INDENT = 15;
455
+ const PIVOT_COLLAPSE_ICON_SIZE = 12;
409
456
  const PIVOT_MAX_NUMBER_OF_CELLS = 5e5;
410
457
  const DEFAULT_CURRENCY = {
411
458
  symbol: "$",
@@ -415,7 +462,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
415
462
  name: "Dollar"
416
463
  };
417
464
  const DEFAULT_CAROUSEL_TITLE_STYLE = {
418
- fontSize: 16,
465
+ fontSize: CHART_TITLE_FONT_SIZE,
419
466
  color: TEXT_BODY
420
467
  };
421
468
  const DEFAULT_TOKEN_COLOR = "light-dark(#000000, #ffffff)";
@@ -432,6 +479,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
432
479
  ARG_SEPARATOR: functionColor,
433
480
  ORPHAN_RIGHT_PAREN: "#ff0000"
434
481
  };
482
+ const DRAG_THRESHOLD = 5;
435
483
 
436
484
  //#endregion
437
485
  //#region src/helpers/misc.ts
@@ -801,7 +849,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
801
849
  */
802
850
  function replaceNewLines(text) {
803
851
  if (!text) return "";
804
- return text.replace(newLineRegexp, "\n");
852
+ return text.replace(newLineRegexp, NEWLINE);
805
853
  }
806
854
  /**
807
855
  * Determine if the numbers are consecutive.
@@ -1033,7 +1081,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1033
1081
  consumeSpaces(chars);
1034
1082
  const col = letterPart - 1;
1035
1083
  const row = num - 1;
1036
- if (!chars.isOver() || col > MAX_COL || row > 9999998) throw new Error(`Invalid cell description: ${xc}`);
1084
+ if (!chars.isOver() || col > MAX_COL || row > MAX_ROW) throw new Error(`Invalid cell description: ${xc}`);
1037
1085
  return {
1038
1086
  col,
1039
1087
  row
@@ -1444,7 +1492,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1444
1492
  const orderedZone = reorderZone(toZoneWithoutBoundaryChanges(xc));
1445
1493
  const bottom = orderedZone.bottom;
1446
1494
  const right = orderedZone.right;
1447
- if (bottom !== void 0 && bottom > 9999998 || right !== void 0 && right > MAX_COL) throw new Error(`Range string out of bounds: ${xc}`);
1495
+ if (bottom !== void 0 && bottom > MAX_ROW || right !== void 0 && right > MAX_COL) throw new Error(`Range string out of bounds: ${xc}`);
1448
1496
  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");
1449
1497
  return orderedZone;
1450
1498
  }
@@ -1605,7 +1653,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
1605
1653
  return {
1606
1654
  top: Math.max(z1.top, z2.top),
1607
1655
  left: Math.max(z1.left, z2.left),
1608
- bottom: Math.min(z1.bottom ?? 9999998, z2.bottom),
1656
+ bottom: Math.min(z1.bottom ?? MAX_ROW, z2.bottom),
1609
1657
  right: Math.min(z1.right ?? MAX_COL, z2.right)
1610
1658
  };
1611
1659
  }
@@ -4575,7 +4623,7 @@ stores.inject(MyMetaStore, storeInstance);
4575
4623
  switch (token.type) {
4576
4624
  case "DIGIT":
4577
4625
  if (parsedPart === integerPart) parsedPart.push(token);
4578
- else if (numberOfDecimalsDigits < 20) {
4626
+ else if (numberOfDecimalsDigits < MAX_DECIMAL_PLACES) {
4579
4627
  parsedPart.push(token);
4580
4628
  numberOfDecimalsDigits++;
4581
4629
  }
@@ -4938,7 +4986,7 @@ stores.inject(MyMetaStore, storeInstance);
4938
4986
  * exceed in the decimal part, in which case digits are rounded.
4939
4987
  *
4940
4988
  **/
4941
- function splitNumber(value, maxDecimals = 20) {
4989
+ function splitNumber(value, maxDecimals = MAX_DECIMAL_PLACES) {
4942
4990
  const asString = value.toString();
4943
4991
  if (asString.includes("e")) return splitNumberIntl(value, maxDecimals);
4944
4992
  if (Number.isInteger(value)) return {
@@ -5007,7 +5055,7 @@ stores.inject(MyMetaStore, storeInstance);
5007
5055
  * Supports numbers with a lot of digits that are transformed to scientific notation by
5008
5056
  * number.toString(), but is slow.
5009
5057
  */
5010
- function splitNumberIntl(value, maxDecimals = 20) {
5058
+ function splitNumberIntl(value, maxDecimals = MAX_DECIMAL_PLACES) {
5011
5059
  let formatter = numberRepresentation[maxDecimals];
5012
5060
  if (!formatter) {
5013
5061
  formatter = new Intl.NumberFormat("en-US", {
@@ -6117,7 +6165,7 @@ stores.inject(MyMetaStore, storeInstance);
6117
6165
  * Returns a timeout delay in milliseconds.
6118
6166
  */
6119
6167
  function scrollDelay(value) {
6120
- return 20 + (140 - 20) * Math.exp(-.035 * (value - 1));
6168
+ return MIN_DELAY + (MAX_DELAY - MIN_DELAY) * Math.exp(-.035 * (value - 1));
6121
6169
  }
6122
6170
 
6123
6171
  //#endregion
@@ -6775,7 +6823,7 @@ stores.inject(MyMetaStore, storeInstance);
6775
6823
  //#endregion
6776
6824
  //#region src/helpers/text_helper.ts
6777
6825
  function computeTextLinesHeight(textLineHeight, numberOfLines = 1) {
6778
- return numberOfLines * (textLineHeight + 4) - 4;
6826
+ return numberOfLines * (textLineHeight + MIN_CELL_TEXT_MARGIN) - MIN_CELL_TEXT_MARGIN;
6779
6827
  }
6780
6828
  function getCanvas(width = 100, height = 100) {
6781
6829
  return new OffscreenCanvas(width, height).getContext("2d");
@@ -6784,7 +6832,7 @@ stores.inject(MyMetaStore, storeInstance);
6784
6832
  * Get the default height of the cell given its style.
6785
6833
  */
6786
6834
  function getDefaultCellHeight(ctx, cell, locale, colSize) {
6787
- if (!cell || !cell.isFormula && !cell.content) return 23;
6835
+ if (!cell || !cell.isFormula && !cell.content) return DEFAULT_CELL_HEIGHT;
6788
6836
  let content = "";
6789
6837
  try {
6790
6838
  if (!cell.isFormula) {
@@ -6800,7 +6848,7 @@ stores.inject(MyMetaStore, storeInstance);
6800
6848
  return getCellContentHeight(ctx, content, cell.style, colSize);
6801
6849
  }
6802
6850
  function getCellContentHeight(ctx, content, style, colSize) {
6803
- return computeMultilineTextSize(ctx, splitTextToWidth(ctx, content, style, style?.wrapping === "wrap" ? colSize - 2 * 4 : void 0), style).height + 2 * 3;
6851
+ return computeMultilineTextSize(ctx, splitTextToWidth(ctx, content, style, style?.wrapping === "wrap" ? colSize - 2 * MIN_CELL_TEXT_MARGIN : void 0), style).height + 2 * PADDING_AUTORESIZE_VERTICAL;
6804
6852
  }
6805
6853
  function getDefaultContextFont(fontSize, bold = false, italic = false) {
6806
6854
  return `${italic ? "italic" : ""} ${bold ? "bold" : ""} ${fontSize}px ${DEFAULT_FONT}`;
@@ -6866,7 +6914,7 @@ stores.inject(MyMetaStore, storeInstance);
6866
6914
  return Math.round(fontSize * 96 / 72);
6867
6915
  }
6868
6916
  function computeTextFont(style, fontUnit = "pt") {
6869
- return `${style.italic ? "italic " : ""}${style.bold ? "bold" : "400"} ${(fontUnit === "pt" ? computeTextFontSizeInPixels(style) : style.fontSize) ?? DEFAULT_FONT_SIZE}px ${DEFAULT_FONT}`;
6917
+ return `${style.italic ? "italic " : ""}${style.bold ? "bold" : DEFAULT_FONT_WEIGHT} ${(fontUnit === "pt" ? computeTextFontSizeInPixels(style) : style.fontSize) ?? DEFAULT_FONT_SIZE}px ${DEFAULT_FONT}`;
6870
6918
  }
6871
6919
  function computeTextFontSizeInPixels(style) {
6872
6920
  return fontSizeInPixels(style?.fontSize || DEFAULT_FONT_SIZE);
@@ -6890,7 +6938,7 @@ stores.inject(MyMetaStore, storeInstance);
6890
6938
  if (!style) style = {};
6891
6939
  if (isMarkdownLink(text)) text = parseMarkdownLink(text).label;
6892
6940
  const brokenText = [];
6893
- const lines = text.includes("\n") ? text.split("\n") : [text];
6941
+ const lines = text.includes(NEWLINE) ? text.split(NEWLINE) : [text];
6894
6942
  for (const line of lines) {
6895
6943
  const words = line.includes(" ") ? line.split(" ") : [line];
6896
6944
  if (!width) {
@@ -7056,7 +7104,7 @@ stores.inject(MyMetaStore, storeInstance);
7056
7104
  let { x, y } = rect;
7057
7105
  const cos = Math.cos(-style.rotation);
7058
7106
  const sin = Math.sin(-style.rotation);
7059
- const width = rect.textWidth - 2 * 4;
7107
+ const width = rect.textWidth - 2 * MIN_CELL_TEXT_MARGIN;
7060
7108
  const height = rect.textHeight;
7061
7109
  const center = style.align === "center";
7062
7110
  const rotateTowardCellCenter = style.align === "left" === sin < 0;
@@ -7174,7 +7222,7 @@ stores.inject(MyMetaStore, storeInstance);
7174
7222
  const { ctx } = chart;
7175
7223
  ctx.save();
7176
7224
  ctx.globalCompositeOperation = "destination-over";
7177
- ctx.fillStyle = options.color || "#FFFFFF";
7225
+ ctx.fillStyle = options.color || BACKGROUND_CHART_COLOR;
7178
7226
  ctx.fillRect(0, 0, chart.width, chart.height);
7179
7227
  ctx.restore();
7180
7228
  }
@@ -7196,7 +7244,7 @@ stores.inject(MyMetaStore, storeInstance);
7196
7244
  };
7197
7245
  updateElements(rects, start, count, mode) {
7198
7246
  super.updateElements(rects, start, count, mode);
7199
- const backgroundColor = this.chart.config.options?.plugins?.background?.color || "#FFFFFF";
7247
+ const backgroundColor = this.chart.config.options?.plugins?.background?.color || BACKGROUND_CHART_COLOR;
7200
7248
  for (let i = start; i < start + count; i++) if (mode === "reset") this.updateElement(rects[i], i, { options: { backgroundColor } }, mode);
7201
7249
  }
7202
7250
  };
@@ -7216,7 +7264,7 @@ stores.inject(MyMetaStore, storeInstance);
7216
7264
  ctx.miterLimit = 1;
7217
7265
  const gradientHeight = (chart.chartArea.bottom - chart.chartArea.top) / 2;
7218
7266
  const gradientWidth = 10;
7219
- const gradientX = options.position === "left" ? 20 : ctx.canvas.width - 70;
7267
+ const gradientX = options.position === "left" ? CHART_PADDING : ctx.canvas.width - CHART_COLORSCALE_WIDTH;
7220
7268
  const gradientY = chart.chartArea.top;
7221
7269
  const gradient = ctx.createLinearGradient(0, gradientY + gradientHeight, 0, gradientY);
7222
7270
  const step = 1 / (options.colorScale.length - 1);
@@ -7226,7 +7274,7 @@ stores.inject(MyMetaStore, storeInstance);
7226
7274
  ctx.fillStyle = gradient;
7227
7275
  ctx.fillRect(gradientX, gradientY, gradientWidth, gradientHeight);
7228
7276
  ctx.fillStyle = options.fontColor ?? "black";
7229
- ctx.font = getDefaultContextFont(12);
7277
+ ctx.font = getDefaultContextFont(CHART_AXIS_TITLE_FONT_SIZE);
7230
7278
  ctx.textAlign = "left";
7231
7279
  let minValue = Math.round(options.minValue * 100) / 100;
7232
7280
  let maxValue = Math.round(options.maxValue * 100) / 100;
@@ -7435,6 +7483,12 @@ stores.inject(MyMetaStore, storeInstance);
7435
7483
  const EXCEL_DEFAULT_COL_WIDTH = 8.43;
7436
7484
  /** unit : points */
7437
7485
  const EXCEL_DEFAULT_ROW_HEIGHT = 12.75;
7486
+ const EXCEL_IMPORT_DEFAULT_NUMBER_OF_COLS = 30;
7487
+ const EXCEL_IMPORT_DEFAULT_NUMBER_OF_ROWS = 100;
7488
+ /** The possible values for the XLSX polynomial trendline order are defined by the ST_Order simple type (§21.2.3.29) */
7489
+ const MAX_XLSX_POLYNOMIAL_DEGREE = 6;
7490
+ const FIRST_NUMFMT_ID = 164;
7491
+ const DEFAULT_DOUGHNUT_CHART_HOLE_SIZE = 50;
7438
7492
  const FORCE_DEFAULT_ARGS_FUNCTIONS = {
7439
7493
  FLOOR: [{
7440
7494
  type: "NUMBER",
@@ -7658,11 +7712,11 @@ stores.inject(MyMetaStore, storeInstance);
7658
7712
  return result;
7659
7713
  }
7660
7714
  function tokenizeDebugger(chars) {
7661
- if (chars.current === "?") {
7715
+ if (chars.current === DEBUGGER_CHAR) {
7662
7716
  chars.shift();
7663
7717
  return {
7664
7718
  type: "DEBUGGER",
7665
- value: "?"
7719
+ value: DEBUGGER_CHAR
7666
7720
  };
7667
7721
  }
7668
7722
  return null;
@@ -7821,13 +7875,13 @@ stores.inject(MyMetaStore, storeInstance);
7821
7875
  }
7822
7876
  function tokenizeNewLine(chars) {
7823
7877
  let length = 0;
7824
- while (chars.current === "\n") {
7878
+ while (chars.current === NEWLINE) {
7825
7879
  length++;
7826
7880
  chars.shift();
7827
7881
  }
7828
7882
  if (length) return {
7829
7883
  type: "SPACE",
7830
- value: "\n".repeat(length)
7884
+ value: NEWLINE.repeat(length)
7831
7885
  };
7832
7886
  return null;
7833
7887
  }
@@ -8169,8 +8223,8 @@ stores.inject(MyMetaStore, storeInstance);
8169
8223
  if (ds.trend?.type) trend = {
8170
8224
  type: ds.trend.type === "polynomial" && ds.trend.order === 1 ? "linear" : SPREADSHEET_TO_EXCEL_TRENDLINE_TYPE_MAPPING[ds.trend.type],
8171
8225
  color: ds.trend.color,
8172
- order: ds.trend.order ? Math.min(ds.trend.order, 6) : void 0,
8173
- window: ds.trend.window || 2
8226
+ order: ds.trend.order ? Math.min(ds.trend.order, MAX_XLSX_POLYNOMIAL_DEGREE) : void 0,
8227
+ window: ds.trend.window || DEFAULT_WINDOW_SIZE
8174
8228
  };
8175
8229
  return {
8176
8230
  label,
@@ -8307,13 +8361,13 @@ stores.inject(MyMetaStore, storeInstance);
8307
8361
  for (let i = 0; i <= maxLength; i++) pieColors.push(colors.next());
8308
8362
  return pieColors;
8309
8363
  }
8310
- function truncateLabel(label, maxLen = 20) {
8364
+ function truncateLabel(label, maxLen = MAX_CHAR_LABEL) {
8311
8365
  if (!label) return "";
8312
8366
  if (label.length > maxLen) return label.substring(0, maxLen) + "…";
8313
8367
  return label;
8314
8368
  }
8315
8369
  function isTrendLineAxis(axisID) {
8316
- return axisID === "x1" || axisID === "xMovingAverage";
8370
+ return axisID === TREND_LINE_XAXIS_ID || axisID === MOVING_AVERAGE_TREND_LINE_XAXIS_ID;
8317
8371
  }
8318
8372
 
8319
8373
  //#endregion
@@ -8619,7 +8673,7 @@ stores.inject(MyMetaStore, storeInstance);
8619
8673
  scales = removeFalsyAttributes(scales);
8620
8674
  if (trendDatasets && trendDatasets.length && trendDatasets.some(isDefined)) {
8621
8675
  const maxLength = Math.max(...trendDatasets.map((trendDataset) => trendDataset?.length || 0));
8622
- scales["x1"] = {
8676
+ scales[TREND_LINE_XAXIS_ID] = {
8623
8677
  ...scales.x,
8624
8678
  labels: Array(maxLength).fill(""),
8625
8679
  offset: false,
@@ -8722,7 +8776,7 @@ stores.inject(MyMetaStore, storeInstance);
8722
8776
  });
8723
8777
  }
8724
8778
  if (trendDatasets && trendDatasets.length && trendDatasets.some(isDefined)) {
8725
- scales["x1"] = {
8779
+ scales[TREND_LINE_XAXIS_ID] = {
8726
8780
  ...scales.x,
8727
8781
  display: false
8728
8782
  };
@@ -8732,9 +8786,9 @@ stores.inject(MyMetaStore, storeInstance);
8732
8786
  };
8733
8787
  if (axisType === "category" || axisType === "time") {
8734
8788
  const maxLength = Math.max(...trendDatasets.map((trendDataset) => trendDataset?.length || 0));
8735
- scales["x1"]["type"] = "category";
8736
- scales["x1"]["labels"] = range(0, maxLength).map((x) => x.toString());
8737
- scales["x1"]["offset"] = false;
8789
+ scales[TREND_LINE_XAXIS_ID]["type"] = "category";
8790
+ scales[TREND_LINE_XAXIS_ID]["labels"] = range(0, maxLength).map((x) => x.toString());
8791
+ scales[TREND_LINE_XAXIS_ID]["offset"] = false;
8738
8792
  scales[MOVING_AVERAGE_TREND_LINE_XAXIS_ID]["type"] = "category";
8739
8793
  scales[MOVING_AVERAGE_TREND_LINE_XAXIS_ID]["offset"] = false;
8740
8794
  }
@@ -8879,7 +8933,7 @@ stores.inject(MyMetaStore, storeInstance);
8879
8933
  font: {
8880
8934
  style: italic ? "italic" : "normal",
8881
8935
  weight: bold ? "bold" : "normal",
8882
- size: design.title.fontSize ?? 12
8936
+ size: design.title.fontSize ?? CHART_AXIS_TITLE_FONT_SIZE
8883
8937
  },
8884
8938
  align: align === "left" ? "start" : align === "right" ? "end" : "center"
8885
8939
  };
@@ -8942,16 +8996,16 @@ stores.inject(MyMetaStore, storeInstance);
8942
8996
  switch (definition.legendPosition) {
8943
8997
  case "top":
8944
8998
  case "right": return {
8945
- top: !!definition.title.text ? 15 + 30 : 15,
8946
- left: 20,
8947
- right: 20
8999
+ top: !!definition.title.text ? CHART_PADDING_TOP + 30 : CHART_PADDING_TOP,
9000
+ left: CHART_PADDING,
9001
+ right: CHART_PADDING
8948
9002
  };
8949
9003
  case "bottom":
8950
9004
  case "left":
8951
9005
  case "none": return {
8952
- left: 20,
8953
- right: 20,
8954
- bottom: 10
9006
+ left: CHART_PADDING,
9007
+ right: CHART_PADDING,
9008
+ bottom: CHART_PADDING_BOTTOM
8955
9009
  };
8956
9010
  }
8957
9011
  }
@@ -8981,7 +9035,7 @@ stores.inject(MyMetaStore, storeInstance);
8981
9035
  label,
8982
9036
  data,
8983
9037
  hidden,
8984
- borderColor: definition.background || "#FFFFFF",
9038
+ borderColor: definition.background || BACKGROUND_CHART_COLOR,
8985
9039
  borderWidth: definition.stacked ? 1 : 0,
8986
9040
  backgroundColor,
8987
9041
  yAxisID: definition.horizontal ? "y" : definition.dataSets?.[index].yAxisId || "y",
@@ -9009,8 +9063,8 @@ stores.inject(MyMetaStore, storeInstance);
9009
9063
  for (const dataSetValues of dataSetsValues) dataSets.push({
9010
9064
  label: dataSetValues.label,
9011
9065
  data: dataSetValues.data.map((v) => 1),
9012
- backgroundColor: dataSetValues.data.map((v) => v !== void 0 ? colorMap(v) : definition.missingValueColor || "#00000000"),
9013
- borderColor: definition.background || "#FFFFFF",
9066
+ backgroundColor: dataSetValues.data.map((v) => v !== void 0 ? colorMap(v) : definition.missingValueColor || COLOR_TRANSPARENT),
9067
+ borderColor: definition.background || BACKGROUND_CHART_COLOR,
9014
9068
  borderSkipped: false,
9015
9069
  borderWidth: 1,
9016
9070
  barPercentage: 1,
@@ -9024,9 +9078,9 @@ stores.inject(MyMetaStore, storeInstance);
9024
9078
  }
9025
9079
  function getWaterfallDatasetAndLabels(definition, args) {
9026
9080
  const { dataSetsValues, labels } = args;
9027
- const negativeColor = definition.negativeValuesColor || "#EA6175";
9028
- const positiveColor = definition.positiveValuesColor || "#4EA7F2";
9029
- const subTotalColor = definition.subTotalValuesColor || "#AAAAAA";
9081
+ const negativeColor = definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
9082
+ const positiveColor = definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
9083
+ const subTotalColor = definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
9030
9084
  const backgroundColor = [];
9031
9085
  const datasetValues = [];
9032
9086
  const dataset = {
@@ -9087,7 +9141,7 @@ stores.inject(MyMetaStore, storeInstance);
9087
9141
  backgroundColor: areaChart ? setColorAlpha(color, LINE_FILL_TRANSPARENCY) : color,
9088
9142
  pointBackgroundColor: color,
9089
9143
  fill: areaChart ? getFillingMode(index, stackedChart) : false,
9090
- pointRadius: definition.hideDataMarkers ? 0 : 3,
9144
+ pointRadius: definition.hideDataMarkers ? 0 : LINE_DATA_POINT_RADIUS,
9091
9145
  yAxisID: definition.dataSets?.[index].yAxisId || "y"
9092
9146
  };
9093
9147
  dataSets.push(dataset);
@@ -9143,7 +9197,7 @@ stores.inject(MyMetaStore, storeInstance);
9143
9197
  xAxisID: "x",
9144
9198
  type,
9145
9199
  order: type === "bar" ? dataSetsValues.length + index : index,
9146
- pointRadius: definition.hideDataMarkers ? 0 : 3
9200
+ pointRadius: definition.hideDataMarkers ? 0 : LINE_DATA_POINT_RADIUS
9147
9201
  };
9148
9202
  if (dataset.type === "bar") {
9149
9203
  dataset.barPercentage = .9;
@@ -9175,7 +9229,7 @@ stores.inject(MyMetaStore, storeInstance);
9175
9229
  borderColor,
9176
9230
  backgroundColor: borderColor,
9177
9231
  pointBackgroundColor: borderColor,
9178
- pointRadius: definition.hideDataMarkers ? 0 : 3
9232
+ pointRadius: definition.hideDataMarkers ? 0 : LINE_DATA_POINT_RADIUS
9179
9233
  };
9180
9234
  if (fill) {
9181
9235
  dataset.backgroundColor = setColorAlpha(borderColor, LINE_FILL_TRANSPARENCY);
@@ -9231,7 +9285,7 @@ stores.inject(MyMetaStore, storeInstance);
9231
9285
  xAxisID: "x",
9232
9286
  barPercentage: 1,
9233
9287
  categoryPercentage: 1,
9234
- borderColor: definition.background || "#FFFFFF",
9288
+ borderColor: definition.background || BACKGROUND_CHART_COLOR,
9235
9289
  borderWidth: 3
9236
9290
  }];
9237
9291
  }
@@ -9256,12 +9310,12 @@ stores.inject(MyMetaStore, storeInstance);
9256
9310
  data: data[i],
9257
9311
  borderColor: (ctx) => {
9258
9312
  const data = ctx.type === "data" ? ctx.raw : void 0;
9259
- if (!data || data.label === "nullValue") return COLOR_TRANSPARENT;
9260
- return definition.background || "#FFFFFF";
9313
+ if (!data || data.label === GHOST_SUNBURST_VALUE) return COLOR_TRANSPARENT;
9314
+ return definition.background || BACKGROUND_CHART_COLOR;
9261
9315
  },
9262
9316
  backgroundColor: (ctx) => {
9263
9317
  const data = ctx.type === "data" ? ctx.raw : void 0;
9264
- if (!data || data.label === "nullValue") return COLOR_TRANSPARENT;
9318
+ if (!data || data.label === GHOST_SUNBURST_VALUE) return COLOR_TRANSPARENT;
9265
9319
  const rootGroup = data.groups[0];
9266
9320
  return groupColors.find((groupColor) => groupColor.label === rootGroup)?.color;
9267
9321
  },
@@ -9401,7 +9455,7 @@ stores.inject(MyMetaStore, storeInstance);
9401
9455
  const borderColor = config.color || lightenColor(rgbaToHex(defaultBorderColor), .5);
9402
9456
  return {
9403
9457
  type: "line",
9404
- xAxisID: config.type === "trailingMovingAverage" ? MOVING_AVERAGE_TREND_LINE_XAXIS_ID : "x1",
9458
+ xAxisID: config.type === "trailingMovingAverage" ? MOVING_AVERAGE_TREND_LINE_XAXIS_ID : TREND_LINE_XAXIS_ID,
9405
9459
  yAxisID: dataset.yAxisID,
9406
9460
  label: dataset.label ? _t("Trend line for %s", dataset.label) : "",
9407
9461
  data,
@@ -9512,7 +9566,7 @@ stores.inject(MyMetaStore, storeInstance);
9512
9566
  for (const metaSet of chart.getSortedVisibleDatasetMetas()) for (const arcElement of metaSet.data) {
9513
9567
  const context = arcElement["$context"];
9514
9568
  const { datasetIndex, index, dataset, raw } = context;
9515
- if (raw.label === "nullValue") continue;
9569
+ if (raw.label === GHOST_SUNBURST_VALUE) continue;
9516
9570
  const originalBackgroundColor = typeof dataset.backgroundColor === "function" ? dataset.backgroundColor(context) : dataset.backgroundColor;
9517
9571
  if (activeDataPoints.length && !activeDataPoints.some((el) => el.datasetIndex === datasetIndex && el.index === index)) arcElement.options.backgroundColor = lightenColor(originalBackgroundColor, .5);
9518
9572
  else arcElement.options.backgroundColor = originalBackgroundColor;
@@ -9540,7 +9594,7 @@ stores.inject(MyMetaStore, storeInstance);
9540
9594
  const lineHeight = fontSize + Y_PADDING;
9541
9595
  for (const dataset of chart._metasets) for (let i = 0; i < dataset._dataset.data.length; i++) {
9542
9596
  const rawData = dataset._dataset.data[i];
9543
- if (rawData.label === "nullValue") continue;
9597
+ if (rawData.label === GHOST_SUNBURST_VALUE) continue;
9544
9598
  const valuesToDisplay = [options.showLabels ? rawData.label : void 0, options.showValues ? options.callback(rawData.value, "y") : void 0].filter(isDefined);
9545
9599
  const arc = dataset.data[i];
9546
9600
  let { startAngle, endAngle, innerRadius, outerRadius, circumference } = arc;
@@ -9938,8 +9992,8 @@ stores.inject(MyMetaStore, storeInstance);
9938
9992
  this.baselineMode = definition.baselineMode;
9939
9993
  this.baselineDescr = definition.baselineDescr;
9940
9994
  this.background = definition.background;
9941
- this.baselineColorUp = definition.baselineColorUp ?? "#43C5B1";
9942
- this.baselineColorDown = definition.baselineColorDown ?? "#EA6175";
9995
+ this.baselineColorUp = definition.baselineColorUp ?? DEFAULT_SCORECARD_BASELINE_COLOR_UP;
9996
+ this.baselineColorDown = definition.baselineColorDown ?? DEFAULT_SCORECARD_BASELINE_COLOR_DOWN;
9943
9997
  this.humanize = definition.humanize ?? true;
9944
9998
  }
9945
9999
  static validateChartDefinition(validator, definition) {
@@ -10023,7 +10077,7 @@ stores.inject(MyMetaStore, storeInstance);
10023
10077
  canvas.width = dpr * structure.canvas.width * zoom;
10024
10078
  canvas.height = dpr * structure.canvas.height * zoom;
10025
10079
  ctx.scale(dpr * zoom, dpr * zoom);
10026
- const availableWidth = structure.canvas.width - 20;
10080
+ const availableWidth = structure.canvas.width - CHART_PADDING;
10027
10081
  ctx.fillStyle = structure.canvas.backgroundColor;
10028
10082
  ctx.fillRect(0, 0, structure.canvas.width, structure.canvas.height);
10029
10083
  if (structure.title) {
@@ -10202,16 +10256,16 @@ stores.inject(MyMetaStore, storeInstance);
10202
10256
  x = (this.width - titleWidth) / 2;
10203
10257
  break;
10204
10258
  case "right":
10205
- x = this.width - titleWidth - 20;
10259
+ x = this.width - titleWidth - CHART_PADDING;
10206
10260
  break;
10207
- default: x = 20;
10261
+ default: x = CHART_PADDING;
10208
10262
  }
10209
10263
  structure.title = {
10210
10264
  text: this.title,
10211
10265
  style: style.title,
10212
10266
  position: {
10213
10267
  x,
10214
- y: 10 + titleHeight / 2
10268
+ y: CHART_PADDING_BOTTOM + titleHeight / 2
10215
10269
  }
10216
10270
  };
10217
10271
  }
@@ -10222,10 +10276,10 @@ stores.inject(MyMetaStore, storeInstance);
10222
10276
  let baselineX;
10223
10277
  switch (this.runtime.baselineStyle?.align) {
10224
10278
  case "right":
10225
- baselineX = this.width - 20 - baselineDescrWidth - baselineWidth;
10279
+ baselineX = this.width - CHART_PADDING - baselineDescrWidth - baselineWidth;
10226
10280
  break;
10227
10281
  case "left":
10228
- baselineX = 20 + baselineArrowSize;
10282
+ baselineX = CHART_PADDING + baselineArrowSize;
10229
10283
  break;
10230
10284
  default: baselineX = (this.width - baselineWidth - baselineDescrWidth + baselineArrowSize) / 2;
10231
10285
  }
@@ -10235,7 +10289,7 @@ stores.inject(MyMetaStore, storeInstance);
10235
10289
  style: style.baselineValue,
10236
10290
  position: {
10237
10291
  x: baselineX,
10238
- y: this.keyValue ? this.height * (1 - BOTTOM_PADDING_RATIO * (this.runtime.progressBar ? 1 : 2)) : this.height - (this.height - titleHeight - baselineHeight) / 2 - 10
10292
+ y: this.keyValue ? this.height * (1 - BOTTOM_PADDING_RATIO * (this.runtime.progressBar ? 1 : 2)) : this.height - (this.height - titleHeight - baselineHeight) / 2 - CHART_PADDING_BOTTOM
10239
10293
  }
10240
10294
  };
10241
10295
  if (style.baselineArrow && !this.runtime.progressBar) structure.baselineArrow = {
@@ -10263,12 +10317,12 @@ stores.inject(MyMetaStore, storeInstance);
10263
10317
  progressBarHeight = this.height * .05;
10264
10318
  structure.progressBar = {
10265
10319
  position: {
10266
- x: 2 * 20,
10320
+ x: 2 * CHART_PADDING,
10267
10321
  y: this.height * (1 - 2 * BOTTOM_PADDING_RATIO) - baselineHeight - progressBarHeight
10268
10322
  },
10269
10323
  dimension: {
10270
10324
  height: progressBarHeight,
10271
- width: this.width - 4 * 20
10325
+ width: this.width - 4 * CHART_PADDING
10272
10326
  },
10273
10327
  value: this.runtime.progressBar.value,
10274
10328
  style: {
@@ -10282,10 +10336,10 @@ stores.inject(MyMetaStore, storeInstance);
10282
10336
  let keyX;
10283
10337
  switch (this.runtime.keyValueStyle?.align) {
10284
10338
  case "right":
10285
- keyX = this.width - 20 - keyDescrWidth - keyWidth;
10339
+ keyX = this.width - CHART_PADDING - keyDescrWidth - keyWidth;
10286
10340
  break;
10287
10341
  case "left":
10288
- keyX = 20;
10342
+ keyX = CHART_PADDING;
10289
10343
  break;
10290
10344
  default: keyX = (this.width - keyWidth - keyDescrWidth) / 2;
10291
10345
  }
@@ -10293,8 +10347,8 @@ stores.inject(MyMetaStore, storeInstance);
10293
10347
  text: this.keyValue,
10294
10348
  style: style.keyValue,
10295
10349
  position: {
10296
- x: Math.max(20, keyX),
10297
- y: this.height * (.5 - BOTTOM_PADDING_RATIO * 2) + 10 / 2 + (titleHeight + keyHeight / 2) / 2
10350
+ x: Math.max(CHART_PADDING, keyX),
10351
+ y: this.height * (.5 - BOTTOM_PADDING_RATIO * 2) + CHART_PADDING_BOTTOM / 2 + (titleHeight + keyHeight / 2) / 2
10298
10352
  }
10299
10353
  };
10300
10354
  if (structure.key && this.keyDescr) {
@@ -10351,14 +10405,14 @@ stores.inject(MyMetaStore, storeInstance);
10351
10405
  };
10352
10406
  }
10353
10407
  getTextStyles() {
10354
- const keyValueFontSize = this.runtime.keyValueStyle?.fontSize ?? 32;
10408
+ const keyValueFontSize = this.runtime.keyValueStyle?.fontSize ?? DEFAULT_SCORECARD_KEY_VALUE_FONT_SIZE;
10355
10409
  const keyValueDescrFontSize = Math.floor(.9 * keyValueFontSize);
10356
- let baselineValueFontSize = this.runtime.baselineStyle?.fontSize ?? 16;
10410
+ let baselineValueFontSize = this.runtime.baselineStyle?.fontSize ?? DEFAULT_SCORECARD_BASELINE_FONT_SIZE;
10357
10411
  const baselineDescrFontSize = Math.floor(.9 * baselineValueFontSize);
10358
10412
  if (this.runtime.progressBar) baselineValueFontSize /= 1.5;
10359
10413
  return {
10360
10414
  title: {
10361
- font: getDefaultContextFont(this.runtime.title.fontSize ?? 14, this.runtime.title.bold, this.runtime.title.italic),
10415
+ font: getDefaultContextFont(this.runtime.title.fontSize ?? SCORECARD_CHART_TITLE_FONT_SIZE, this.runtime.title.bold, this.runtime.title.italic),
10362
10416
  color: this.runtime.title.color ?? this.secondaryFontColor
10363
10417
  },
10364
10418
  keyValue: {
@@ -10847,35 +10901,35 @@ stores.inject(MyMetaStore, storeInstance);
10847
10901
  x: boundingRect.width / 2,
10848
10902
  y: gaugeRect.y + gaugeRect.height - gaugeRect.height / 12
10849
10903
  };
10850
- let gaugeValueFontSize = 80;
10904
+ let gaugeValueFontSize = GAUGE_DEFAULT_VALUE_FONT_SIZE;
10851
10905
  if (gaugeRect.height < 300) gaugeValueFontSize = gaugeValueFontSize * (gaugeRect.height / 300);
10852
10906
  const maxTextWidth = gaugeRect.width / 2;
10853
10907
  const gaugeLabel = runtime.gaugeValue?.label || "-";
10854
10908
  if (computeTextWidth(ctx, gaugeLabel, { fontSize: gaugeValueFontSize }, "px") > maxTextWidth) gaugeValueFontSize = getFontSizeMatchingWidth(maxTextWidth, gaugeValueFontSize, (fontSize) => computeTextWidth(ctx, gaugeLabel, { fontSize }, "px"));
10855
10909
  const minLabelPosition = {
10856
10910
  x: gaugeRect.x + gaugeArcWidth / 2,
10857
- y: gaugeRect.y + gaugeRect.height + 12
10911
+ y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
10858
10912
  };
10859
10913
  const maxLabelPosition = {
10860
10914
  x: gaugeRect.x + gaugeRect.width - gaugeArcWidth / 2,
10861
- y: gaugeRect.y + gaugeRect.height + 12
10915
+ y: gaugeRect.y + gaugeRect.height + GAUGE_LABELS_FONT_SIZE
10862
10916
  };
10863
10917
  const textColor = chartMutedFontColor(runtime.background);
10864
10918
  const inflectionValues = getInflectionValues(runtime, gaugeRect, textColor, ctx);
10865
10919
  let x = 0, titleWidth = 0, titleHeight = 0;
10866
10920
  if (runtime.title.text) ({width: titleWidth, height: titleHeight} = computeTextDimension(ctx, runtime.title.text, {
10867
- fontSize: 16,
10921
+ fontSize: CHART_TITLE_FONT_SIZE,
10868
10922
  ...runtime.title
10869
10923
  }, "px"));
10870
10924
  switch (runtime.title.align) {
10871
10925
  case "right":
10872
- x = boundingRect.width - titleWidth - 20;
10926
+ x = boundingRect.width - titleWidth - CHART_PADDING;
10873
10927
  break;
10874
10928
  case "center":
10875
10929
  x = (boundingRect.width - titleWidth) / 2;
10876
10930
  break;
10877
10931
  default:
10878
- x = 20;
10932
+ x = CHART_PADDING;
10879
10933
  break;
10880
10934
  }
10881
10935
  return {
@@ -10883,10 +10937,10 @@ stores.inject(MyMetaStore, storeInstance);
10883
10937
  height: boundingRect.height,
10884
10938
  title: {
10885
10939
  label: runtime.title.text ?? "",
10886
- fontSize: runtime.title.fontSize ?? 16,
10940
+ fontSize: runtime.title.fontSize ?? CHART_TITLE_FONT_SIZE,
10887
10941
  textPosition: {
10888
10942
  x,
10889
- y: 15 + titleHeight / 2
10943
+ y: CHART_PADDING_TOP + titleHeight / 2
10890
10944
  },
10891
10945
  color: runtime.title.color ?? textColor,
10892
10946
  bold: runtime.title.bold,
@@ -10909,13 +10963,13 @@ stores.inject(MyMetaStore, storeInstance);
10909
10963
  minLabel: {
10910
10964
  label: runtime.minValue.label,
10911
10965
  textPosition: minLabelPosition,
10912
- fontSize: 12,
10966
+ fontSize: GAUGE_LABELS_FONT_SIZE,
10913
10967
  color: textColor
10914
10968
  },
10915
10969
  maxLabel: {
10916
10970
  label: runtime.maxValue.label,
10917
10971
  textPosition: maxLabelPosition,
10918
- fontSize: 12,
10972
+ fontSize: GAUGE_LABELS_FONT_SIZE,
10919
10973
  color: textColor
10920
10974
  }
10921
10975
  };
@@ -10925,9 +10979,9 @@ stores.inject(MyMetaStore, storeInstance);
10925
10979
  * space for the title and labels.
10926
10980
  */
10927
10981
  function getGaugeRect(boundingRect, title) {
10928
- const titleHeight = title ? 25 : 0;
10929
- const drawHeight = boundingRect.height - 20 - titleHeight - 10;
10930
- const drawWidth = boundingRect.width - 30 * 2;
10982
+ const titleHeight = title ? GAUGE_TITLE_SECTION_HEIGHT : 0;
10983
+ const drawHeight = boundingRect.height - GAUGE_PADDING_BOTTOM - titleHeight - GAUGE_PADDING_TOP;
10984
+ const drawWidth = boundingRect.width - GAUGE_PADDING_SIDE * 2;
10931
10985
  let gaugeWidth;
10932
10986
  let gaugeHeight;
10933
10987
  if (drawWidth > 2 * drawHeight) {
@@ -10938,8 +10992,8 @@ stores.inject(MyMetaStore, storeInstance);
10938
10992
  gaugeHeight = drawWidth / 2;
10939
10993
  }
10940
10994
  return {
10941
- x: 30 + (drawWidth - gaugeWidth) / 2,
10942
- y: titleHeight + 10 + (drawHeight - gaugeHeight) / 2,
10995
+ x: GAUGE_PADDING_SIDE + (drawWidth - gaugeWidth) / 2,
10996
+ y: titleHeight + GAUGE_PADDING_TOP + (drawHeight - gaugeHeight) / 2,
10943
10997
  width: gaugeWidth,
10944
10998
  height: gaugeHeight
10945
10999
  };
@@ -10956,20 +11010,20 @@ stores.inject(MyMetaStore, storeInstance);
10956
11010
  x: gaugeRect.x + gaugeRect.width / 2,
10957
11011
  y: gaugeRect.y + gaugeRect.height
10958
11012
  };
10959
- const textStyle = { fontSize: 12 };
11013
+ const textStyle = { fontSize: GAUGE_LABELS_FONT_SIZE };
10960
11014
  const inflectionValues = [];
10961
11015
  const inflectionValuesTextRects = [];
10962
11016
  for (const inflectionValue of runtime.inflectionValues) {
10963
11017
  const percentage = (inflectionValue.value - minValue.value) / (maxValue.value - minValue.value);
10964
11018
  const labelWidth = computeTextWidth(ctx, inflectionValue.label, textStyle, "px");
10965
11019
  const angle = Math.PI - Math.PI * percentage;
10966
- const textRect = getRectangleTangentToCircle(angle, gaugeRect.height + GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN, gaugeCircleCenter.x, gaugeCircleCenter.y, labelWidth + 2, 12);
10967
- const offset = inflectionValuesTextRects.some((rect) => doRectanglesIntersect(rect, textRect)) ? 12 : 0;
11020
+ const textRect = getRectangleTangentToCircle(angle, gaugeRect.height + GAUGE_INFLECTION_LABEL_BOTTOM_MARGIN, gaugeCircleCenter.x, gaugeCircleCenter.y, labelWidth + 2, GAUGE_LABELS_FONT_SIZE);
11021
+ const offset = inflectionValuesTextRects.some((rect) => doRectanglesIntersect(rect, textRect)) ? GAUGE_LABELS_FONT_SIZE : 0;
10968
11022
  inflectionValuesTextRects.push(textRect);
10969
11023
  inflectionValues.push({
10970
11024
  rotation: angle,
10971
11025
  label: inflectionValue.label,
10972
- fontSize: 12,
11026
+ fontSize: GAUGE_LABELS_FONT_SIZE,
10973
11027
  color: textColor,
10974
11028
  offset
10975
11029
  });
@@ -11699,7 +11753,7 @@ stores.inject(MyMetaStore, storeInstance);
11699
11753
  });
11700
11754
  return newY.length === newX.length ? newY : transposeMatrix(newY);
11701
11755
  }
11702
- function getMovingAverageValues(dataset, labels, windowSize = 2) {
11756
+ function getMovingAverageValues(dataset, labels, windowSize = DEFAULT_WINDOW_SIZE) {
11703
11757
  const values = [];
11704
11758
  for (let i = 0; i < windowSize - 1; i++) values.push({
11705
11759
  x: labels[i],
@@ -13333,19 +13387,19 @@ stores.inject(MyMetaStore, storeInstance);
13333
13387
  //#region src/helpers/figures/charts/runtime/chartjs_layout.ts
13334
13388
  function getChartLayout(definition, args) {
13335
13389
  return { padding: {
13336
- left: 20,
13337
- right: 20,
13338
- top: Math.max(15, args.topPadding || 0),
13339
- bottom: 10
13390
+ left: CHART_PADDING,
13391
+ right: CHART_PADDING,
13392
+ top: Math.max(CHART_PADDING_TOP, args.topPadding || 0),
13393
+ bottom: CHART_PADDING_BOTTOM
13340
13394
  } };
13341
13395
  }
13342
13396
  function getCalendarChartLayout(definition, args) {
13343
13397
  const legendPosition = definition.legendPosition;
13344
13398
  return { padding: {
13345
- left: 20 + (legendPosition === "left" ? 70 : 0),
13346
- right: 20 + (legendPosition === "right" ? 70 : 0),
13347
- top: Math.max(15, args.topPadding || 0),
13348
- bottom: 10
13399
+ left: CHART_PADDING + (legendPosition === "left" ? CHART_COLORSCALE_WIDTH : 0),
13400
+ right: CHART_PADDING + (legendPosition === "right" ? CHART_COLORSCALE_WIDTH : 0),
13401
+ top: Math.max(CHART_PADDING_TOP, args.topPadding || 0),
13402
+ bottom: CHART_PADDING_BOTTOM
13349
13403
  } };
13350
13404
  }
13351
13405
 
@@ -13422,9 +13476,9 @@ stores.inject(MyMetaStore, storeInstance);
13422
13476
  }
13423
13477
  function getWaterfallChartLegend(definition, args) {
13424
13478
  const fontColor = chartFontColor(definition.background);
13425
- const negativeColor = definition.negativeValuesColor || "#EA6175";
13426
- const positiveColor = definition.positiveValuesColor || "#4EA7F2";
13427
- const subTotalColor = definition.subTotalValuesColor || "#AAAAAA";
13479
+ const negativeColor = definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
13480
+ const positiveColor = definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
13481
+ const subTotalColor = definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
13428
13482
  return {
13429
13483
  ...getLegendDisplayOptions(definition, args),
13430
13484
  labels: {
@@ -13663,11 +13717,11 @@ stores.inject(MyMetaStore, storeInstance);
13663
13717
  color: chartTitle?.color ?? fontColor,
13664
13718
  align: chartTitle.align === "center" ? "center" : chartTitle.align === "right" ? "end" : "start",
13665
13719
  font: {
13666
- size: definition.title.fontSize ?? 16,
13720
+ size: definition.title.fontSize ?? CHART_TITLE_FONT_SIZE,
13667
13721
  weight: chartTitle.bold ? "bold" : "normal",
13668
13722
  style: chartTitle.italic ? "italic" : "normal"
13669
13723
  },
13670
- padding: { bottom: definition.legendPosition === "top" ? 0 : 20 }
13724
+ padding: { bottom: definition.legendPosition === "top" ? 0 : CHART_PADDING }
13671
13725
  };
13672
13726
  }
13673
13727
 
@@ -14184,7 +14238,7 @@ stores.inject(MyMetaStore, storeInstance);
14184
14238
  const definition = this.getDefinition();
14185
14239
  return {
14186
14240
  ...definition,
14187
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
14241
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
14188
14242
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
14189
14243
  dataSets,
14190
14244
  labelRange,
@@ -14703,7 +14757,7 @@ stores.inject(MyMetaStore, storeInstance);
14703
14757
  const definition = this.getDefinition();
14704
14758
  return {
14705
14759
  ...definition,
14706
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
14760
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
14707
14761
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
14708
14762
  dataSets,
14709
14763
  labelRange,
@@ -14828,7 +14882,7 @@ stores.inject(MyMetaStore, storeInstance);
14828
14882
  const { dataSets, labelRange } = this.getCommonDataSetAttributesForExcel(this.labelRange, this.dataSets, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
14829
14883
  return {
14830
14884
  ...this.getDefinition(),
14831
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
14885
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
14832
14886
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
14833
14887
  dataSets,
14834
14888
  labelRange
@@ -15028,7 +15082,7 @@ stores.inject(MyMetaStore, storeInstance);
15028
15082
  PieChart: () => PieChart,
15029
15083
  SPREADSHEET_TO_EXCEL_TRENDLINE_TYPE_MAPPING: () => SPREADSHEET_TO_EXCEL_TRENDLINE_TYPE_MAPPING,
15030
15084
  ScorecardChart: () => ScorecardChart$1,
15031
- TREND_LINE_XAXIS_ID: () => "x1",
15085
+ TREND_LINE_XAXIS_ID: () => TREND_LINE_XAXIS_ID,
15032
15086
  WaterfallChart: () => WaterfallChart,
15033
15087
  adaptChartRange: () => adaptChartRange,
15034
15088
  chartFactory: () => chartFactory,
@@ -15429,7 +15483,7 @@ stores.inject(MyMetaStore, storeInstance);
15429
15483
 
15430
15484
  //#endregion
15431
15485
  //#region src/components/figures/chart/chartJs/zoomable_chart/zoomable_chart_store.ts
15432
- const TREND_LINE_AXES_IDS = ["x1", MOVING_AVERAGE_TREND_LINE_XAXIS_ID];
15486
+ const TREND_LINE_AXES_IDS = [TREND_LINE_XAXIS_ID, MOVING_AVERAGE_TREND_LINE_XAXIS_ID];
15433
15487
  const ZOOMABLE_AXIS_IDS = ["x", ...TREND_LINE_AXES_IDS];
15434
15488
  var ZoomableChartStore = class extends SpreadsheetStore {
15435
15489
  mutators = [
@@ -15526,7 +15580,7 @@ stores.inject(MyMetaStore, storeInstance);
15526
15580
  this.removeEventListeners();
15527
15581
  }
15528
15582
  get containerStyle() {
15529
- return cssPropertiesToCss({ height: this.sliceable ? `calc(100% - ${60}px)` : "100%" });
15583
+ return cssPropertiesToCss({ height: this.sliceable ? `calc(100% - ${MASTER_CHART_HEIGHT}px)` : "100%" });
15530
15584
  }
15531
15585
  get masterChartContainerStyle() {
15532
15586
  const runtime = this.env.model.getters.getChartRuntime(this.props.chartId);
@@ -15585,8 +15639,8 @@ stores.inject(MyMetaStore, storeInstance);
15585
15639
  getAxisLimitsFromDataset(chartData) {
15586
15640
  const xValues = chartData.data.datasets.map((ds) => ds.data).flat().map((d, i) => typeof d === "object" && d !== null ? d.x : i);
15587
15641
  return {
15588
- min: Math.min(...xValues),
15589
- max: Math.max(...xValues)
15642
+ min: largeMin(xValues),
15643
+ max: largeMax(xValues)
15590
15644
  };
15591
15645
  }
15592
15646
  setMasterChartCursor(runtime) {
@@ -15672,7 +15726,7 @@ stores.inject(MyMetaStore, storeInstance);
15672
15726
  updateTrendingLineAxes() {
15673
15727
  this.store.updateTrendLineConfiguration(this.chartId);
15674
15728
  const limits = this.store.currentAxesLimits[this.chartId];
15675
- for (const axisId of ["x1", MOVING_AVERAGE_TREND_LINE_XAXIS_ID]) {
15729
+ for (const axisId of [TREND_LINE_XAXIS_ID, MOVING_AVERAGE_TREND_LINE_XAXIS_ID]) {
15676
15730
  if (!this.chart?.config?.options?.scales?.[axisId] || !limits?.[axisId]) continue;
15677
15731
  this.chart.config.options.scales[axisId].min = limits[axisId].min;
15678
15732
  this.chart.config.options.scales[axisId].max = limits[axisId].max;
@@ -16911,7 +16965,7 @@ stores.inject(MyMetaStore, storeInstance);
16911
16965
  onClickMenu: this.onClickMenu.bind(this),
16912
16966
  onMouseOver: this.onMouseOver.bind(this),
16913
16967
  onMouseLeave: this.onMouseLeave.bind(this),
16914
- width: this.props.width || 250,
16968
+ width: this.props.width || MENU_WIDTH,
16915
16969
  isActive: this.isActive.bind(this),
16916
16970
  onScroll: this.onScroll.bind(this)
16917
16971
  };
@@ -16927,11 +16981,11 @@ stores.inject(MyMetaStore, storeInstance);
16927
16981
  anchorRect: {
16928
16982
  x: this.props.anchorRect.x,
16929
16983
  y: this.props.anchorRect.y,
16930
- width: isRoot ? this.props.anchorRect.width : this.props.width || 250,
16931
- height: isRoot ? this.props.anchorRect.height : 26
16984
+ width: isRoot ? this.props.anchorRect.width : this.props.width || MENU_WIDTH,
16985
+ height: isRoot ? this.props.anchorRect.height : DESKTOP_MENU_ITEM_HEIGHT
16932
16986
  },
16933
16987
  positioning: this.props.popoverPositioning,
16934
- verticalOffset: isRoot ? 0 : 6,
16988
+ verticalOffset: isRoot ? 0 : MENU_VERTICAL_PADDING,
16935
16989
  onPopoverHidden: () => this.closeSubMenu(),
16936
16990
  onPopoverMoved: () => this.closeSubMenu(),
16937
16991
  maxHeight: this.props.maxHeight
@@ -16994,8 +17048,8 @@ stores.inject(MyMetaStore, storeInstance);
16994
17048
  this.subMenu.anchorRect = {
16995
17049
  x: getRefBoundingRect(this.menuRef).x,
16996
17050
  y: y - (this.subMenu.scrollOffset || 0),
16997
- width: this.props.width || 250,
16998
- height: 26
17051
+ width: this.props.width || MENU_WIDTH,
17052
+ height: DESKTOP_MENU_ITEM_HEIGHT
16999
17053
  };
17000
17054
  this.subMenu.menuItems = menu.children(this.env);
17001
17055
  this.subMenu.isOpen = true;
@@ -17066,7 +17120,7 @@ stores.inject(MyMetaStore, storeInstance);
17066
17120
  return [this.fullScreenMenuItem].filter(isDefined);
17067
17121
  }
17068
17122
  get backgroundColor() {
17069
- return "background-color: " + (this.env.model.getters.getChartDefinition(this.props.chartId).background || "#FFFFFF");
17123
+ return "background-color: " + (this.env.model.getters.getChartDefinition(this.props.chartId).background || BACKGROUND_CHART_COLOR);
17070
17124
  }
17071
17125
  openContextMenu(ev) {
17072
17126
  this.menuState.isOpen = true;
@@ -17174,7 +17228,7 @@ stores.inject(MyMetaStore, storeInstance);
17174
17228
  if (this.selectedCarouselItem?.type === "chart") {
17175
17229
  const chart = this.env.model.getters.getChartRuntime(this.selectedCarouselItem.chartId);
17176
17230
  if ("background" in chart && chart.background) cssProperties["background-color"] = chart.background;
17177
- else if ("chartJsConfig" in chart) cssProperties["background-color"] = chart.chartJsConfig.options?.plugins?.background?.color || "#FFFFFF";
17231
+ else if ("chartJsConfig" in chart) cssProperties["background-color"] = chart.chartJsConfig.options?.plugins?.background?.color || BACKGROUND_CHART_COLOR;
17178
17232
  } else cssProperties["background-color"] = BACKGROUND_CHART_COLOR;
17179
17233
  return cssPropertiesToCss(cssProperties);
17180
17234
  }
@@ -24160,7 +24214,7 @@ stores.inject(MyMetaStore, storeInstance);
24160
24214
  const error = pivot.assertIsValid({ throwOnError: false });
24161
24215
  if (error) return error;
24162
24216
  const table = pivot.getCollapsedTableStructure();
24163
- if (table.numberOfCells > 5e5) return new EvaluationError(getPivotTooBigErrorMessage(table.numberOfCells, this.locale));
24217
+ if (table.numberOfCells > PIVOT_MAX_NUMBER_OF_CELLS) return new EvaluationError(getPivotTooBigErrorMessage(table.numberOfCells, this.locale));
24164
24218
  const cells = table.getPivotCells(pivotStyle);
24165
24219
  let headerRows = 0;
24166
24220
  if (pivotStyle.displayColumnHeaders) headerRows = table.columns.length - 1;
@@ -25991,7 +26045,7 @@ stores.inject(MyMetaStore, storeInstance);
25991
26045
  width: 512,
25992
26046
  height: 512,
25993
26047
  paths: [{
25994
- fillColor: color.textColor || "#374151C2",
26048
+ fillColor: color.textColor || TEXT_BODY_MUTED,
25995
26049
  path: CARET_DOWN_PATH
25996
26050
  }]
25997
26051
  };
@@ -26002,7 +26056,7 @@ stores.inject(MyMetaStore, storeInstance);
26002
26056
  width: 512,
26003
26057
  height: 512,
26004
26058
  paths: [{
26005
- fillColor: color.textColor || "#374151C2",
26059
+ fillColor: color.textColor || TEXT_BODY_MUTED,
26006
26060
  path: CARET_UP_PATH
26007
26061
  }]
26008
26062
  };
@@ -26013,7 +26067,7 @@ stores.inject(MyMetaStore, storeInstance);
26013
26067
  width: 512,
26014
26068
  height: 512,
26015
26069
  paths: [{
26016
- fillColor: color.textColor || "#374151C2",
26070
+ fillColor: color.textColor || TEXT_BODY_MUTED,
26017
26071
  path: HOVERED_CARET_DOWN_PATH
26018
26072
  }, {
26019
26073
  fillColor: color.fillColor || "#fff",
@@ -26776,7 +26830,7 @@ stores.inject(MyMetaStore, storeInstance);
26776
26830
  alignment: {
26777
26831
  horizontal: style.align,
26778
26832
  vertical: style.verticalAlign ? V_ALIGNMENT_EXPORT_CONVERSION_MAP[style.verticalAlign] : void 0,
26779
- wrapText: style.wrapping === "wrap" || content?.includes("\n") ? true : void 0,
26833
+ wrapText: style.wrapping === "wrap" || content?.includes(NEWLINE) ? true : void 0,
26780
26834
  textRotation: style.rotation ? rotationToXLSX(style.rotation) : void 0,
26781
26835
  shrinkToFit: style.wrapping === "clip" ? true : void 0
26782
26836
  }
@@ -26817,7 +26871,7 @@ stores.inject(MyMetaStore, storeInstance);
26817
26871
  function convertFormat(format, numFmtStructure) {
26818
26872
  if (!format) return 0;
26819
26873
  let formatId = XLSX_FORMAT_MAP[format.format];
26820
- if (!formatId) formatId = pushElement(format, numFmtStructure) + 164;
26874
+ if (!formatId) formatId = pushElement(format, numFmtStructure) + FIRST_NUMFMT_ID;
26821
26875
  return formatId;
26822
26876
  }
26823
26877
  /**
@@ -27400,14 +27454,14 @@ stores.inject(MyMetaStore, storeInstance);
27400
27454
  type: trend.type === "linear" ? "polynomial" : EXCEL_TO_SPREADSHEET_TRENDLINE_TYPE_MAPPING[trend.type],
27401
27455
  order: trend.type === "linear" ? 1 : trend.order,
27402
27456
  color: trend.color,
27403
- window: trend.window || 2,
27457
+ window: trend.window || DEFAULT_WINDOW_SIZE,
27404
27458
  display: true
27405
27459
  };
27406
27460
  }
27407
27461
  function convertAnchor(XLSXanchor) {
27408
27462
  const offset = {
27409
- x: convertEMUToDotValue(XLSXanchor.colOffset) - 1,
27410
- y: convertEMUToDotValue(XLSXanchor.rowOffset) - 1
27463
+ x: convertEMUToDotValue(XLSXanchor.colOffset) - FIGURE_BORDER_WIDTH,
27464
+ y: convertEMUToDotValue(XLSXanchor.rowOffset) - FIGURE_BORDER_WIDTH
27411
27465
  };
27412
27466
  return {
27413
27467
  col: XLSXanchor.col,
@@ -27759,8 +27813,8 @@ stores.inject(MyMetaStore, storeInstance);
27759
27813
  dims[0] = Math.max(dims[0], fig.anchors[fig.anchors.length - 1]?.col ?? 0);
27760
27814
  dims[1] = Math.max(dims[1], fig.anchors[fig.anchors.length - 1]?.row ?? 0);
27761
27815
  }
27762
- dims[0] = Math.max(dims[0] + 5, 30);
27763
- dims[1] = Math.max(dims[1] + 5, 100);
27816
+ dims[0] = Math.max(dims[0] + 5, EXCEL_IMPORT_DEFAULT_NUMBER_OF_COLS);
27817
+ dims[1] = Math.max(dims[1] + 5, EXCEL_IMPORT_DEFAULT_NUMBER_OF_ROWS);
27764
27818
  return dims;
27765
27819
  }
27766
27820
  /**
@@ -28926,7 +28980,7 @@ stores.inject(MyMetaStore, storeInstance);
28926
28980
  rgb = this.getThemeColor(themeIndex, theme.clrScheme);
28927
28981
  } else {
28928
28982
  rgb = this.extractAttr(colorElement, "rgb")?.asString();
28929
- rgb = rgb === "FF000000" ? void 0 : rgb;
28983
+ rgb = rgb === DEFAULT_SYSTEM_COLOR ? void 0 : rgb;
28930
28984
  }
28931
28985
  return {
28932
28986
  rgb: rgb || defaultColor,
@@ -30045,7 +30099,7 @@ stores.inject(MyMetaStore, storeInstance);
30045
30099
  * Get the corresponding relationship file for a given xml file in a XLSX directory.
30046
30100
  */
30047
30101
  function getRelationFile(file, xmls) {
30048
- if (file === "[Content_Types].xml") return "_rels/.rels";
30102
+ if (file === CONTENT_TYPES_FILE) return "_rels/.rels";
30049
30103
  let relsFile = "";
30050
30104
  const pathParts = file.split("/");
30051
30105
  for (let i = 0; i < pathParts.length - 1; i++) relsFile += pathParts[i] + "/";
@@ -30155,7 +30209,7 @@ stores.inject(MyMetaStore, storeInstance);
30155
30209
  if (token.type === "REFERENCE" && cellReference.test(token.value)) {
30156
30210
  const value = token.value.trim();
30157
30211
  if (!dependencies.includes(value)) dependencies.push(value);
30158
- return `${"|"}${dependencies.indexOf(value)}${"|"}`;
30212
+ return `${FORMULA_REF_IDENTIFIER}${dependencies.indexOf(value)}${FORMULA_REF_IDENTIFIER}`;
30159
30213
  } else return token.value;
30160
30214
  })),
30161
30215
  dependencies
@@ -30351,7 +30405,7 @@ stores.inject(MyMetaStore, storeInstance);
30351
30405
  if (cell.formula) {
30352
30406
  let { text, dependencies } = cell.formula;
30353
30407
  for (const [index, d] of Object.entries(dependencies)) {
30354
- const stringPosition = `\\${"|"}${index}\\${"|"}`;
30408
+ const stringPosition = `\\${FORMULA_REF_IDENTIFIER}${index}\\${FORMULA_REF_IDENTIFIER}`;
30355
30409
  text = text.replace(new RegExp(stringPosition, "g"), d);
30356
30410
  }
30357
30411
  cell.content = text;
@@ -32124,12 +32178,12 @@ stores.inject(MyMetaStore, storeInstance);
32124
32178
  for (let current = it.next(); !current.done; current = it.next()) {
32125
32179
  if (current.value.nodeName === "P" || current.value.nodeName === "DIV" && current.value !== this.el) {
32126
32180
  if (isFirstParagraph) isFirstParagraph = false;
32127
- else text += "\n";
32181
+ else text += NEWLINE;
32128
32182
  emptyParagraph = isEmptyParagraph(current.value);
32129
32183
  continue;
32130
32184
  }
32131
32185
  if (!current.value.hasChildNodes()) {
32132
- if (current.value.nodeName === "BR" && !emptyParagraph) text += "\n";
32186
+ if (current.value.nodeName === "BR" && !emptyParagraph) text += NEWLINE;
32133
32187
  text += current.value.textContent;
32134
32188
  }
32135
32189
  }
@@ -32363,7 +32417,7 @@ stores.inject(MyMetaStore, storeInstance);
32363
32417
  if (cellX + ASSISTANT_WIDTH > this.props.delimitation.width) assistantStyle.right = `0px`;
32364
32418
  } else {
32365
32419
  assistantStyle["max-height"] = `${this.spreadsheetRect.height - composerRect.bottom - 1}px`;
32366
- if (composerRect.left + ASSISTANT_WIDTH + 15 + CLOSE_ICON_RADIUS > this.spreadsheetRect.width) assistantStyle.right = `${CLOSE_ICON_RADIUS}px`;
32420
+ if (composerRect.left + ASSISTANT_WIDTH + SCROLLBAR_WIDTH + CLOSE_ICON_RADIUS > this.spreadsheetRect.width) assistantStyle.right = `${CLOSE_ICON_RADIUS}px`;
32367
32421
  }
32368
32422
  return assistantStyle;
32369
32423
  }
@@ -32460,7 +32514,7 @@ stores.inject(MyMetaStore, storeInstance);
32460
32514
  const start = Math.min(selection.start, selection.end);
32461
32515
  const end = Math.max(selection.start, selection.end);
32462
32516
  this.props.composerStore.stopComposerRangeSelection();
32463
- this.props.composerStore.setCurrentContent(content.slice(0, start) + "\n" + content.slice(end), {
32517
+ this.props.composerStore.setCurrentContent(content.slice(0, start) + NEWLINE + content.slice(end), {
32464
32518
  start: start + 1,
32465
32519
  end: start + 1
32466
32520
  });
@@ -32638,7 +32692,7 @@ stores.inject(MyMetaStore, storeInstance);
32638
32692
  const { end, start } = this.props.composerStore.composerSelection;
32639
32693
  for (let index = 0; index < tokens.length; index++) {
32640
32694
  const token = tokens[index];
32641
- let color = token.color || "light-dark(#000000, #ffffff)";
32695
+ let color = token.color || DEFAULT_TOKEN_COLOR;
32642
32696
  if (token.isBlurred) color = setColorAlpha(color, .5);
32643
32697
  const classes = [];
32644
32698
  if (token.type === "REFERENCE" && this.props.composerStore.tokenAtCursor === token && this.props.composerStore.editionMode === "selecting") classes.push("text-decoration-underline");
@@ -32669,8 +32723,8 @@ stores.inject(MyMetaStore, storeInstance);
32669
32723
  splitHtmlContentIntoLines(contents) {
32670
32724
  const contentSplitInLines = [];
32671
32725
  let currentLine = [];
32672
- for (const content of contents) if (content.value.includes("\n")) {
32673
- const lines = content.value.split("\n");
32726
+ for (const content of contents) if (content.value.includes(NEWLINE)) {
32727
+ const lines = content.value.split(NEWLINE);
32674
32728
  const lastLine = lines.pop();
32675
32729
  for (const line of lines) {
32676
32730
  currentLine.push({
@@ -33295,7 +33349,7 @@ stores.inject(MyMetaStore, storeInstance);
33295
33349
  function drawHighlight(renderingContext, highlight, rect) {
33296
33350
  const { x, y, width, height } = rect;
33297
33351
  if (width < 0 || height < 0) return;
33298
- const color = highlight.color || "#017E84";
33352
+ const color = highlight.color || HIGHLIGHT_COLOR;
33299
33353
  const { ctx } = renderingContext;
33300
33354
  ctx.save();
33301
33355
  if (!highlight.noBorder) {
@@ -33862,7 +33916,7 @@ stores.inject(MyMetaStore, storeInstance);
33862
33916
  getTokenColor(token) {
33863
33917
  if (token.type === "REFERENCE") {
33864
33918
  const { xc, sheetName } = splitReference(token.value);
33865
- return this.rangeColor(xc, sheetName) || "light-dark(#000000, #ffffff)";
33919
+ return this.rangeColor(xc, sheetName) || DEFAULT_TOKEN_COLOR;
33866
33920
  }
33867
33921
  if (token.type === "SYMBOL") {
33868
33922
  const upperCaseValue = token.value.toUpperCase();
@@ -33872,7 +33926,7 @@ stores.inject(MyMetaStore, storeInstance);
33872
33926
  if (["LEFT_PAREN", "RIGHT_PAREN"].includes(token.type)) {
33873
33927
  if (token.parenthesesCode === "") return tokenColors.ORPHAN_RIGHT_PAREN;
33874
33928
  }
33875
- return tokenColors[token.type] || "light-dark(#000000, #ffffff)";
33929
+ return tokenColors[token.type] || DEFAULT_TOKEN_COLOR;
33876
33930
  }
33877
33931
  rangeColor(xc, sheetName) {
33878
33932
  const refSheet = sheetName ? this.model.getters.getSheetIdByName(sheetName) : this.sheetId;
@@ -34537,7 +34591,7 @@ stores.inject(MyMetaStore, storeInstance);
34537
34591
  }
34538
34592
  get sliderStyle() {
34539
34593
  const hue = this.state.currentHslaColor?.h || 0;
34540
- return cssPropertiesToCss({ "margin-left": `${clip(Math.round(hue / 360 * INNER_GRADIENT_WIDTH), 1, INNER_GRADIENT_WIDTH) - 18 / 2}px` });
34594
+ return cssPropertiesToCss({ "margin-left": `${clip(Math.round(hue / 360 * INNER_GRADIENT_WIDTH), 1, INNER_GRADIENT_WIDTH) - ICON_EDGE_LENGTH / 2}px` });
34541
34595
  }
34542
34596
  get pointerStyle() {
34543
34597
  const { s, l } = this.state.currentHslaColor || {
@@ -36401,7 +36455,7 @@ stores.inject(MyMetaStore, storeInstance);
36401
36455
  col,
36402
36456
  row
36403
36457
  });
36404
- const textColor = style?.textColor === "#017E84" ? void 0 : style?.textColor;
36458
+ const textColor = style?.textColor === LINK_COLOR ? void 0 : style?.textColor;
36405
36459
  this.env.model.dispatch("UPDATE_CELL", {
36406
36460
  col,
36407
36461
  row,
@@ -37411,8 +37465,8 @@ stores.inject(MyMetaStore, storeInstance);
37411
37465
  zones = getters.getSelectedZones();
37412
37466
  }
37413
37467
  const size = {
37414
- width: 536,
37415
- height: 335
37468
+ width: DEFAULT_FIGURE_WIDTH,
37469
+ height: DEFAULT_FIGURE_HEIGHT
37416
37470
  };
37417
37471
  const { col, row, offset } = centerFigurePosition(getters, size);
37418
37472
  if (env.model.dispatch("CREATE_CHART", {
@@ -37434,8 +37488,8 @@ stores.inject(MyMetaStore, storeInstance);
37434
37488
  const figureId = env.model.uuidGenerator.smallUuid();
37435
37489
  const sheetId = getters.getActiveSheetId();
37436
37490
  const size = {
37437
- width: 536,
37438
- height: 335
37491
+ width: DEFAULT_FIGURE_WIDTH,
37492
+ height: DEFAULT_FIGURE_HEIGHT
37439
37493
  };
37440
37494
  const { col, row, offset } = centerFigurePosition(getters, size);
37441
37495
  if (env.model.dispatch("CREATE_CAROUSEL", {
@@ -37485,7 +37539,7 @@ stores.inject(MyMetaStore, storeInstance);
37485
37539
  execute: (env) => {
37486
37540
  const zone = env.model.getters.getSelectedZone();
37487
37541
  const table = env.model.getters.getPivot(pivotId).getExpandedTableStructure();
37488
- if (table.numberOfCells > 5e5) {
37542
+ if (table.numberOfCells > PIVOT_MAX_NUMBER_OF_CELLS) {
37489
37543
  env.notifyUser({
37490
37544
  type: "warning",
37491
37545
  text: getPivotTooBigErrorMessage(table.numberOfCells, env.model.getters.getLocale()),
@@ -39210,7 +39264,7 @@ stores.inject(MyMetaStore, storeInstance);
39210
39264
  axesList: Array
39211
39265
  };
39212
39266
  state = (0, _odoo_owl.useState)({ currentAxis: "x" });
39213
- defaultFontSize = 12;
39267
+ defaultFontSize = CHART_AXIS_TITLE_FONT_SIZE;
39214
39268
  get axisTitleStyle() {
39215
39269
  return this.props.definition.axesDesign?.[this.state.currentAxis]?.title ?? {};
39216
39270
  }
@@ -39286,7 +39340,7 @@ stores.inject(MyMetaStore, storeInstance);
39286
39340
  optional: true
39287
39341
  }
39288
39342
  };
39289
- static defaultProps = { defaultChartTitleFontSize: 16 };
39343
+ static defaultProps = { defaultChartTitleFontSize: CHART_TITLE_FONT_SIZE };
39290
39344
  state;
39291
39345
  setup() {
39292
39346
  this.state = (0, _odoo_owl.useState)({ activeTool: "" });
@@ -39575,11 +39629,11 @@ stores.inject(MyMetaStore, storeInstance);
39575
39629
  return Math.min(10, runtime.chartJsConfig.data.datasets[index].data.length - 1);
39576
39630
  }
39577
39631
  get defaultWindowSize() {
39578
- return 2;
39632
+ return DEFAULT_WINDOW_SIZE;
39579
39633
  }
39580
39634
  onChangeMovingAverageWindow(index, value) {
39581
- let window = parseInt(value) || 2;
39582
- if (window <= 1) window = 2;
39635
+ let window = parseInt(value) || DEFAULT_WINDOW_SIZE;
39636
+ if (window <= 1) window = DEFAULT_WINDOW_SIZE;
39583
39637
  this.updateTrendLineValue(index, { window });
39584
39638
  }
39585
39639
  getDataSeriesColor(index) {
@@ -40329,7 +40383,7 @@ stores.inject(MyMetaStore, storeInstance);
40329
40383
  });
40330
40384
  }
40331
40385
  get defaultHoleSize() {
40332
- return 50;
40386
+ return DEFAULT_DOUGHNUT_CHART_HOLE_SIZE;
40333
40387
  }
40334
40388
  };
40335
40389
 
@@ -40446,7 +40500,7 @@ stores.inject(MyMetaStore, storeInstance);
40446
40500
  const definition = this.getDefinition();
40447
40501
  return {
40448
40502
  ...definition,
40449
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
40503
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
40450
40504
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
40451
40505
  dataSets,
40452
40506
  labelRange,
@@ -40599,7 +40653,7 @@ stores.inject(MyMetaStore, storeInstance);
40599
40653
  return this.props.definition.baselineMode === "progress" ? _t("Progress bar colors") : _t("Baseline colors");
40600
40654
  }
40601
40655
  get defaultScorecardTitleFontSize() {
40602
- return 14;
40656
+ return SCORECARD_CHART_TITLE_FONT_SIZE;
40603
40657
  }
40604
40658
  translate(term) {
40605
40659
  return this.env.model.getters.dynamicTranslate(term);
@@ -40620,14 +40674,14 @@ stores.inject(MyMetaStore, storeInstance);
40620
40674
  get keyStyle() {
40621
40675
  return {
40622
40676
  align: "center",
40623
- fontSize: 32,
40677
+ fontSize: DEFAULT_SCORECARD_KEY_VALUE_FONT_SIZE,
40624
40678
  ...this.props.definition.keyDescr
40625
40679
  };
40626
40680
  }
40627
40681
  get baselineStyle() {
40628
40682
  return {
40629
40683
  align: "center",
40630
- fontSize: 16,
40684
+ fontSize: DEFAULT_SCORECARD_BASELINE_FONT_SIZE,
40631
40685
  ...this.props.definition.baselineDescr
40632
40686
  };
40633
40687
  }
@@ -40867,13 +40921,13 @@ stores.inject(MyMetaStore, storeInstance);
40867
40921
  }];
40868
40922
  }
40869
40923
  get positiveValuesColor() {
40870
- return this.props.definition.positiveValuesColor || "#4EA7F2";
40924
+ return this.props.definition.positiveValuesColor || CHART_WATERFALL_POSITIVE_COLOR;
40871
40925
  }
40872
40926
  get negativeValuesColor() {
40873
- return this.props.definition.negativeValuesColor || "#EA6175";
40927
+ return this.props.definition.negativeValuesColor || CHART_WATERFALL_NEGATIVE_COLOR;
40874
40928
  }
40875
40929
  get subTotalValuesColor() {
40876
- return this.props.definition.subTotalValuesColor || "#AAAAAA";
40930
+ return this.props.definition.subTotalValuesColor || CHART_WATERFALL_SUBTOTAL_COLOR;
40877
40931
  }
40878
40932
  updateVerticalAxisPosition(value) {
40879
40933
  this.props.updateChart(this.props.chartId, { verticalAxisPosition: value });
@@ -41260,7 +41314,7 @@ stores.inject(MyMetaStore, storeInstance);
41260
41314
  get previewGradient() {
41261
41315
  const rule = this.state.rules.colorScale;
41262
41316
  const minColor = colorNumberToHex(rule.minimum.color);
41263
- const midColor = colorNumberToHex(rule.midpoint?.color || 11982760);
41317
+ const midColor = colorNumberToHex(rule.midpoint?.color || DEFAULT_COLOR_SCALE_MIDPOINT_COLOR);
41264
41318
  const maxColor = colorNumberToHex(rule.maximum.color);
41265
41319
  const baseString = "linear-gradient(to right, ";
41266
41320
  return cssPropertiesToCss({
@@ -43221,7 +43275,7 @@ stores.inject(MyMetaStore, storeInstance);
43221
43275
  return {
43222
43276
  type: measureDisplayType,
43223
43277
  fieldNameWithGranularity,
43224
- value: value ?? "(previous)"
43278
+ value: value ?? PREVIOUS_VALUE
43225
43279
  };
43226
43280
  }
43227
43281
  }
@@ -44821,7 +44875,7 @@ stores.inject(MyMetaStore, storeInstance);
44821
44875
  if (value === void 0) return;
44822
44876
  const valueIndex = values.indexOf(value);
44823
44877
  if (value === void 0 || valueIndex === -1) return;
44824
- return replaceFieldValueInDomain(domain, fieldNameWithGranularity, values[clip(valueIndex + (direction === "(previous)" ? -1 : 1), 0, values.length - 1)]);
44878
+ return replaceFieldValueInDomain(domain, fieldNameWithGranularity, values[clip(valueIndex + (direction === PREVIOUS_VALUE ? -1 : 1), 0, values.length - 1)]);
44825
44879
  }
44826
44880
  function domainToString(domain) {
44827
44881
  return domain ? domain.map(domainNodeToString).join(", ") : "";
@@ -46028,7 +46082,7 @@ stores.inject(MyMetaStore, storeInstance);
46028
46082
  }
46029
46083
  const pivot = this.getters.getPivot(this.pivotId);
46030
46084
  const numberOfCells = pivot.isValid() ? pivot.getExpandedTableStructure().numberOfCells : 0;
46031
- if (!this.alreadyNotifiedForPivotSize && numberOfCells > 5e5) {
46085
+ if (!this.alreadyNotifiedForPivotSize && numberOfCells > PIVOT_MAX_NUMBER_OF_CELLS) {
46032
46086
  this.alreadyNotifiedForPivotSize = true;
46033
46087
  this.notification.notifyUser({
46034
46088
  type: "warning",
@@ -47859,7 +47913,7 @@ stores.inject(MyMetaStore, storeInstance);
47859
47913
  },
47860
47914
  {
47861
47915
  label: _t("Line Break"),
47862
- value: "\n"
47916
+ value: NEWLINE
47863
47917
  }
47864
47918
  ];
47865
47919
  var SplitIntoColumnsPanel = class extends _odoo_owl.Component {
@@ -48396,7 +48450,7 @@ stores.inject(MyMetaStore, storeInstance);
48396
48450
  const newPanelInfo = {
48397
48451
  currentPanelProps,
48398
48452
  componentTag,
48399
- size: 350
48453
+ size: DEFAULT_SIDE_PANEL_SIZE
48400
48454
  };
48401
48455
  const state = this.computeState(newPanelInfo);
48402
48456
  if (!state.isOpen) return;
@@ -48404,8 +48458,8 @@ stores.inject(MyMetaStore, storeInstance);
48404
48458
  this._openPanel("mainPanel", newPanelInfo, state);
48405
48459
  return;
48406
48460
  }
48407
- const nonCollapsedPanelSize = this.mainPanel.isCollapsed ? 350 : this.mainPanel.size;
48408
- if (!this.secondaryPanel && nonCollapsedPanelSize + 350 > this.availableWidth) {
48461
+ const nonCollapsedPanelSize = this.mainPanel.isCollapsed ? DEFAULT_SIDE_PANEL_SIZE : this.mainPanel.size;
48462
+ if (!this.secondaryPanel && nonCollapsedPanelSize + DEFAULT_SIDE_PANEL_SIZE > this.availableWidth) {
48409
48463
  this.get(NotificationStore).notifyUser({
48410
48464
  sticky: false,
48411
48465
  type: "warning",
@@ -48419,7 +48473,7 @@ stores.inject(MyMetaStore, storeInstance);
48419
48473
  const newPanelInfo = {
48420
48474
  currentPanelProps,
48421
48475
  componentTag,
48422
- size: 350
48476
+ size: DEFAULT_SIDE_PANEL_SIZE
48423
48477
  };
48424
48478
  const state = this.computeState(newPanelInfo);
48425
48479
  if (!state.isOpen) return;
@@ -48448,7 +48502,7 @@ stores.inject(MyMetaStore, storeInstance);
48448
48502
  this[panel] = {
48449
48503
  currentPanelProps: state.props ?? {},
48450
48504
  componentTag: newPanel.componentTag,
48451
- size: currentPanel?.size || 350,
48505
+ size: currentPanel?.size || DEFAULT_SIDE_PANEL_SIZE,
48452
48506
  isCollapsed: currentPanel?.isCollapsed || false,
48453
48507
  isPinned: currentPanel && "isPinned" in currentPanel ? currentPanel.isPinned : false
48454
48508
  };
@@ -48478,19 +48532,19 @@ stores.inject(MyMetaStore, storeInstance);
48478
48532
  changePanelSize(panel, size) {
48479
48533
  const panelInfo = this[panel];
48480
48534
  if (!panelInfo || "isCollapsed" in panelInfo && panelInfo.isCollapsed) return;
48481
- size = Math.max(size, 350);
48535
+ size = Math.max(size, DEFAULT_SIDE_PANEL_SIZE);
48482
48536
  let otherPanelSize = panel === "mainPanel" ? this.secondaryPanel?.size || 0 : this.mainPanel?.size || 0;
48483
48537
  if (size > this.availableWidth - otherPanelSize) {
48484
48538
  if (panel === "mainPanel" && this.secondaryPanel) {
48485
- this.secondaryPanel.size = Math.max(this.availableWidth - size, 350);
48539
+ this.secondaryPanel.size = Math.max(this.availableWidth - size, DEFAULT_SIDE_PANEL_SIZE);
48486
48540
  otherPanelSize = this.secondaryPanel.size;
48487
48541
  }
48488
- size = Math.max(this.availableWidth - otherPanelSize, 350);
48542
+ size = Math.max(this.availableWidth - otherPanelSize, DEFAULT_SIDE_PANEL_SIZE);
48489
48543
  }
48490
48544
  panelInfo.size = size;
48491
48545
  }
48492
48546
  resetPanelSize(panel) {
48493
- if (this[panel]) this[panel].size = 350;
48547
+ if (this[panel]) this[panel].size = DEFAULT_SIDE_PANEL_SIZE;
48494
48548
  }
48495
48549
  togglePinPanel() {
48496
48550
  if (!this.mainPanel) return;
@@ -48506,10 +48560,10 @@ stores.inject(MyMetaStore, storeInstance);
48506
48560
  if (!panelInfo) return;
48507
48561
  if (panelInfo.isCollapsed) {
48508
48562
  panelInfo.isCollapsed = false;
48509
- this.changePanelSize(panel, 350);
48563
+ this.changePanelSize(panel, DEFAULT_SIDE_PANEL_SIZE);
48510
48564
  } else {
48511
48565
  panelInfo.isCollapsed = true;
48512
- panelInfo.size = 45;
48566
+ panelInfo.size = COLLAPSED_SIDE_PANEL_SIZE;
48513
48567
  }
48514
48568
  }
48515
48569
  computeState({ componentTag, currentPanelProps: initialPanelProps }) {
@@ -48524,12 +48578,12 @@ stores.inject(MyMetaStore, storeInstance);
48524
48578
  } : state;
48525
48579
  }
48526
48580
  changeSpreadsheetWidth(width) {
48527
- this.availableWidth = width - 150;
48528
- if (this.secondaryPanel && width - this.totalPanelSize < 150) {
48581
+ this.availableWidth = width - MIN_SHEET_VIEW_WIDTH;
48582
+ if (this.secondaryPanel && width - this.totalPanelSize < MIN_SHEET_VIEW_WIDTH) {
48529
48583
  this.secondaryPanel?.currentPanelProps.onCloseSidePanel?.();
48530
48584
  this.secondaryPanel = void 0;
48531
48585
  }
48532
- if (this.mainPanel && width - this.totalPanelSize < 150) this.mainPanel.size = Math.max(width - 150, 350);
48586
+ if (this.mainPanel && width - this.totalPanelSize < MIN_SHEET_VIEW_WIDTH) this.mainPanel.size = Math.max(width - MIN_SHEET_VIEW_WIDTH, DEFAULT_SIDE_PANEL_SIZE);
48533
48587
  }
48534
48588
  };
48535
48589
 
@@ -50155,7 +50209,7 @@ stores.inject(MyMetaStore, storeInstance);
50155
50209
  let { scrollX, scrollY } = getters.getActiveSheetScrollInfo();
50156
50210
  const { xSplit, ySplit } = getters.getPaneDivisions(sheetId);
50157
50211
  let canEdgeScroll = false;
50158
- let timeoutDelay = 140;
50212
+ let timeoutDelay = MAX_DELAY;
50159
50213
  const x = zoomedMouseEvent.clientX - position.x;
50160
50214
  let colIndex = getters.getColIndex(x);
50161
50215
  if (scrollDirection !== "vertical") {
@@ -50551,7 +50605,7 @@ stores.inject(MyMetaStore, storeInstance);
50551
50605
  return true;
50552
50606
  }
50553
50607
  function astToDoc(ast) {
50554
- const debugPrefix = ast.debug ? `${"?"}` : "";
50608
+ const debugPrefix = ast.debug ? `${DEBUGGER_CHAR}` : "";
50555
50609
  switch (ast.type) {
50556
50610
  case "NUMBER": return debugPrefix + String(ast.value);
50557
50611
  case "STRING": return debugPrefix + `"${ast.value}"`;
@@ -50630,7 +50684,7 @@ stores.inject(MyMetaStore, storeInstance);
50630
50684
  * Converts an ast formula to the corresponding string
50631
50685
  */
50632
50686
  function astToFormula(ast) {
50633
- const debugPrefix = ast.debug ? `${"?"}` : "";
50687
+ const debugPrefix = ast.debug ? `${DEBUGGER_CHAR}` : "";
50634
50688
  switch (ast.type) {
50635
50689
  case "FUNCALL":
50636
50690
  const args = ast.args.map((arg) => astToFormula(arg));
@@ -51323,19 +51377,19 @@ stores.inject(MyMetaStore, storeInstance);
51323
51377
  position = y;
51324
51378
  break;
51325
51379
  case "bottom":
51326
- position = y + figureUI.height - 1;
51380
+ position = y + figureUI.height - FIGURE_BORDER_WIDTH;
51327
51381
  break;
51328
51382
  case "vCenter":
51329
- position = y + Math.floor(figureUI.height / 2) - 1;
51383
+ position = y + Math.floor(figureUI.height / 2) - FIGURE_BORDER_WIDTH;
51330
51384
  break;
51331
51385
  case "left":
51332
51386
  position = x;
51333
51387
  break;
51334
51388
  case "right":
51335
- position = x + figureUI.width - 1;
51389
+ position = x + figureUI.width - FIGURE_BORDER_WIDTH;
51336
51390
  break;
51337
51391
  case "hCenter":
51338
- position = x + Math.floor(figureUI.width / 2) - 1;
51392
+ position = x + Math.floor(figureUI.width / 2) - FIGURE_BORDER_WIDTH;
51339
51393
  break;
51340
51394
  }
51341
51395
  return {
@@ -51547,7 +51601,7 @@ stores.inject(MyMetaStore, storeInstance);
51547
51601
  };
51548
51602
  const offsetX = Math.abs(currentMousePosition.x - initialMousePosition.x);
51549
51603
  const offsetY = Math.abs(currentMousePosition.y - initialMousePosition.y);
51550
- if (!hasStartedDnd && offsetX < 5 && offsetY < 5) return;
51604
+ if (!hasStartedDnd && offsetX < DRAG_THRESHOLD && offsetY < DRAG_THRESHOLD) return;
51551
51605
  hasStartedDnd = true;
51552
51606
  const draggedFigure = dragFigureForMove(currentMousePosition, initialMousePosition, initialFigure, maxDimensions, initialScrollPosition, getters.getActiveSheetScrollInfo());
51553
51607
  const otherFigures = this.getOtherFigures(initialFigure.id);
@@ -51599,7 +51653,7 @@ stores.inject(MyMetaStore, storeInstance);
51599
51653
  ev.stopPropagation();
51600
51654
  const initialScrollPosition = this.env.model.getters.getActiveSheetScrollInfo();
51601
51655
  const keepRatio = figureRegistry.get(figureUI.tag).keepRatio || false;
51602
- const minFigSize = figureRegistry.get(figureUI.tag).minFigSize || 80;
51656
+ const minFigSize = figureRegistry.get(figureUI.tag).minFigSize || MIN_FIG_SIZE;
51603
51657
  const zoom = this.env.model.getters.getViewportZoomLevel();
51604
51658
  const sheetId = this.env.model.getters.getActiveSheetId();
51605
51659
  const initialMousePosition = {
@@ -52168,7 +52222,7 @@ stores.inject(MyMetaStore, storeInstance);
52168
52222
  get isFooterVisible() {
52169
52223
  const { y } = this.env.model.getters.getMainViewportCoordinates();
52170
52224
  const { height } = this.env.model.getters.getSheetViewDimension();
52171
- return !this.env.model.getters.isReadonly() && height - y > 46;
52225
+ return !this.env.model.getters.isReadonly() && height - y > FOOTER_HEIGHT;
52172
52226
  }
52173
52227
  };
52174
52228
 
@@ -52223,7 +52277,7 @@ stores.inject(MyMetaStore, storeInstance);
52223
52277
  row: hiddenIndex
52224
52278
  }));
52225
52279
  return cssPropertiesToCss({
52226
- top: rect.y + rect.height - 26 - this.props.offset + "px",
52280
+ top: rect.y + rect.height - HEADER_HEIGHT - this.props.offset + "px",
52227
52281
  "margin-right": "1px"
52228
52282
  });
52229
52283
  }
@@ -52232,7 +52286,7 @@ stores.inject(MyMetaStore, storeInstance);
52232
52286
  top: this.env.model.getters.getRect(positionToZone({
52233
52287
  col: 0,
52234
52288
  row: hiddenIndex
52235
- })).y - 26 - this.props.offset + "px",
52289
+ })).y - HEADER_HEIGHT - this.props.offset + "px",
52236
52290
  "margin-right": "1px"
52237
52291
  });
52238
52292
  }
@@ -52266,13 +52320,13 @@ stores.inject(MyMetaStore, storeInstance);
52266
52320
  col: hiddenIndex,
52267
52321
  row: 0
52268
52322
  }));
52269
- return cssPropertiesToCss({ left: rect.x + rect.width - 48 - this.props.offset + "px" });
52323
+ return cssPropertiesToCss({ left: rect.x + rect.width - HEADER_WIDTH - this.props.offset + "px" });
52270
52324
  }
52271
52325
  getUnhideNextButtonStyle(hiddenIndex) {
52272
52326
  return cssPropertiesToCss({ left: this.env.model.getters.getRect(positionToZone({
52273
52327
  col: hiddenIndex,
52274
52328
  row: 0
52275
- })).x - 48 - this.props.offset + "px" });
52329
+ })).x - HEADER_WIDTH - this.props.offset + "px" });
52276
52330
  }
52277
52331
  unhide(hiddenElements) {
52278
52332
  this.env.model.dispatch("UNHIDE_COLUMNS_ROWS", {
@@ -52495,7 +52549,7 @@ stores.inject(MyMetaStore, storeInstance);
52495
52549
  this.colResizerRef = (0, _odoo_owl.useRef)("colResizer");
52496
52550
  this.PADDING = 15;
52497
52551
  this.MAX_SIZE_MARGIN = 90;
52498
- this.MIN_ELEMENT_SIZE = 5;
52552
+ this.MIN_ELEMENT_SIZE = MIN_COL_WIDTH;
52499
52553
  }
52500
52554
  get sheetId() {
52501
52555
  return this.env.model.getters.getActiveSheetId();
@@ -52630,7 +52684,7 @@ stores.inject(MyMetaStore, storeInstance);
52630
52684
  this.rowResizerRef = (0, _odoo_owl.useRef)("rowResizer");
52631
52685
  this.PADDING = 5;
52632
52686
  this.MAX_SIZE_MARGIN = 60;
52633
- this.MIN_ELEMENT_SIZE = 10;
52687
+ this.MIN_ELEMENT_SIZE = MIN_ROW_HEIGHT;
52634
52688
  }
52635
52689
  rowResizerRef;
52636
52690
  get sheetId() {
@@ -53049,7 +53103,7 @@ stores.inject(MyMetaStore, storeInstance);
53049
53103
  x,
53050
53104
  y
53051
53105
  }, style.underline, style.strikethrough);
53052
- y += 4 + box.content.fontSizePx;
53106
+ y += MIN_CELL_TEXT_MARGIN + box.content.fontSizePx;
53053
53107
  }
53054
53108
  if (style.rotation) ctx.restore();
53055
53109
  if (box.clipRect) ctx.restore();
@@ -53097,7 +53151,7 @@ stores.inject(MyMetaStore, storeInstance);
53097
53151
  const numberOfRows = this.getters.getNumberRows(sheetId);
53098
53152
  const activeCols = this.getters.getActiveCols();
53099
53153
  const activeRows = this.getters.getActiveRows();
53100
- ctx.font = `400 ${11}px ${DEFAULT_FONT}`;
53154
+ ctx.font = `400 ${HEADER_FONT_SIZE}px ${DEFAULT_FONT}`;
53101
53155
  ctx.textAlign = "center";
53102
53156
  ctx.textBaseline = "middle";
53103
53157
  ctx.lineWidth = thinLineWidth;
@@ -53115,7 +53169,7 @@ stores.inject(MyMetaStore, storeInstance);
53115
53169
  if (isColActive) ctx.fillStyle = BACKGROUND_HEADER_ACTIVE_COLOR;
53116
53170
  else if (isColSelected) ctx.fillStyle = BACKGROUND_HEADER_SELECTED_COLOR;
53117
53171
  else ctx.fillStyle = BACKGROUND_HEADER_COLOR;
53118
- ctx.fillRect(x, 0, width, 26);
53172
+ ctx.fillRect(x, 0, width, HEADER_HEIGHT);
53119
53173
  }
53120
53174
  for (const row of visibleRows) {
53121
53175
  const rowZone = {
@@ -53130,13 +53184,13 @@ stores.inject(MyMetaStore, storeInstance);
53130
53184
  if (isRowActive) ctx.fillStyle = BACKGROUND_HEADER_ACTIVE_COLOR;
53131
53185
  else if (isRowSelected) ctx.fillStyle = BACKGROUND_HEADER_SELECTED_COLOR;
53132
53186
  else ctx.fillStyle = BACKGROUND_HEADER_COLOR;
53133
- ctx.fillRect(0, y, 48, height);
53187
+ ctx.fillRect(0, y, HEADER_WIDTH, height);
53134
53188
  }
53135
53189
  ctx.beginPath();
53136
- ctx.moveTo(48, 0);
53137
- ctx.lineTo(48, height);
53138
- ctx.moveTo(0, 26);
53139
- ctx.lineTo(width, 26);
53190
+ ctx.moveTo(HEADER_WIDTH, 0);
53191
+ ctx.lineTo(HEADER_WIDTH, height);
53192
+ ctx.moveTo(0, HEADER_HEIGHT);
53193
+ ctx.lineTo(width, HEADER_HEIGHT);
53140
53194
  ctx.strokeStyle = HEADER_BORDER_COLOR;
53141
53195
  ctx.stroke();
53142
53196
  for (const col of visibleCols) {
@@ -53152,13 +53206,13 @@ stores.inject(MyMetaStore, storeInstance);
53152
53206
  const { x, width } = this.getters.getVisibleRect(zone);
53153
53207
  ctx.save();
53154
53208
  ctx.beginPath();
53155
- ctx.rect(x, 0, width, 26);
53209
+ ctx.rect(x, 0, width, HEADER_HEIGHT);
53156
53210
  ctx.clip();
53157
- ctx.fillText(colName, colStart + colSize / 2, 26 / 2);
53211
+ ctx.fillText(colName, colStart + colSize / 2, HEADER_HEIGHT / 2);
53158
53212
  ctx.restore();
53159
53213
  ctx.beginPath();
53160
53214
  ctx.moveTo(colStart + colSize, 0);
53161
- ctx.lineTo(colStart + colSize, 26);
53215
+ ctx.lineTo(colStart + colSize, HEADER_HEIGHT);
53162
53216
  ctx.stroke();
53163
53217
  }
53164
53218
  for (const row of visibleRows) {
@@ -53173,21 +53227,21 @@ stores.inject(MyMetaStore, storeInstance);
53173
53227
  const { y, height } = this.getters.getVisibleRect(zone);
53174
53228
  ctx.save();
53175
53229
  ctx.beginPath();
53176
- ctx.rect(0, y, 48, height);
53230
+ ctx.rect(0, y, HEADER_WIDTH, height);
53177
53231
  ctx.clip();
53178
- ctx.fillText(String(row + 1), 48 / 2, rowStart + rowSize / 2);
53232
+ ctx.fillText(String(row + 1), HEADER_WIDTH / 2, rowStart + rowSize / 2);
53179
53233
  ctx.restore();
53180
53234
  ctx.beginPath();
53181
53235
  ctx.moveTo(0, rowStart + rowSize);
53182
- ctx.lineTo(48, rowStart + rowSize);
53236
+ ctx.lineTo(HEADER_WIDTH, rowStart + rowSize);
53183
53237
  ctx.stroke();
53184
53238
  }
53185
53239
  }
53186
53240
  drawFrozenPanesHeaders(renderingContext) {
53187
53241
  const { ctx, thinLineWidth } = renderingContext;
53188
53242
  const { x: offsetCorrectionX, y: offsetCorrectionY } = this.getters.getMainViewportCoordinates();
53189
- const widthCorrection = this.getters.isDashboard() ? 0 : 48;
53190
- const heightCorrection = this.getters.isDashboard() ? 0 : 26;
53243
+ const widthCorrection = this.getters.isDashboard() ? 0 : HEADER_WIDTH;
53244
+ const heightCorrection = this.getters.isDashboard() ? 0 : HEADER_HEIGHT;
53191
53245
  ctx.lineWidth = 6 * thinLineWidth;
53192
53246
  ctx.strokeStyle = FROZEN_PANE_HEADER_BORDER_COLOR;
53193
53247
  ctx.beginPath();
@@ -53215,8 +53269,8 @@ stores.inject(MyMetaStore, storeInstance);
53215
53269
  bottom: visibleRows[visibleRows.length - 1]
53216
53270
  };
53217
53271
  const rect = this.getters.getVisibleRect(viewport);
53218
- const widthCorrection = this.getters.isDashboard() ? 0 : 48;
53219
- const heightCorrection = this.getters.isDashboard() ? 0 : 26;
53272
+ const widthCorrection = this.getters.isDashboard() ? 0 : HEADER_WIDTH;
53273
+ const heightCorrection = this.getters.isDashboard() ? 0 : HEADER_HEIGHT;
53220
53274
  ctx.lineWidth = 6 * thinLineWidth;
53221
53275
  ctx.strokeStyle = FROZEN_PANE_BORDER_COLOR;
53222
53276
  ctx.beginPath();
@@ -53323,7 +53377,7 @@ stores.inject(MyMetaStore, storeInstance);
53323
53377
  /** Content */
53324
53378
  const wrapping = style.wrapping || "overflow";
53325
53379
  const wrapText = wrapping === "wrap" && !showFormula;
53326
- const maxWidth = width - 2 * 4;
53380
+ const maxWidth = width - 2 * MIN_CELL_TEXT_MARGIN;
53327
53381
  const formatWidth = style.align ? 0 : maxWidth;
53328
53382
  const multiLineText = this.getters.getCellMultiLineText(position, {
53329
53383
  maxWidth,
@@ -53335,18 +53389,18 @@ stores.inject(MyMetaStore, storeInstance);
53335
53389
  align: "left",
53336
53390
  rotation: 0
53337
53391
  };
53338
- const textWidth = Math.max(...multiLineText.map((line) => this.getters.getTextWidth(line, noRotatationStyle))) + 4;
53392
+ const textWidth = Math.max(...multiLineText.map((line) => this.getters.getTextWidth(line, noRotatationStyle))) + MIN_CELL_TEXT_MARGIN;
53339
53393
  const contentSize = this.getters.getMultilineTextSize(multiLineText, style);
53340
- const chipMargin = chipStyle ? 5 : 0;
53394
+ const chipMargin = chipStyle ? DATA_VALIDATION_CHIP_MARGIN : 0;
53341
53395
  const leftMargin = (box.icons.left ? box.icons.left.size + box.icons.left.margin : 0) + chipMargin;
53342
53396
  const rightMargin = (box.icons.right ? box.icons.right.size + box.icons.right.margin : 0) + chipMargin;
53343
- const contentWidth = leftMargin + contentSize.width + rightMargin + 4;
53397
+ const contentWidth = leftMargin + contentSize.width + rightMargin + MIN_CELL_TEXT_MARGIN;
53344
53398
  const align = this.computeCellAlignment(position, contentWidth > width);
53345
53399
  const numberOfLines = multiLineText.length;
53346
53400
  const contentY = Math.round(this.getters.computeTextYCoordinate(box, fontSizePX, style.verticalAlign, numberOfLines));
53347
53401
  let contentX = box.x;
53348
- if (align === "left") contentX += 4 + leftMargin;
53349
- else if (align === "right") contentX += box.width - 4 - rightMargin;
53402
+ if (align === "left") contentX += MIN_CELL_TEXT_MARGIN + leftMargin;
53403
+ else if (align === "right") contentX += box.width - MIN_CELL_TEXT_MARGIN - rightMargin;
53350
53404
  else contentX += box.width / 2;
53351
53405
  contentX = Math.round(contentX);
53352
53406
  const textHeight = computeTextLinesHeight(fontSizePX, numberOfLines);
@@ -53362,7 +53416,7 @@ stores.inject(MyMetaStore, storeInstance);
53362
53416
  };
53363
53417
  if (chipStyle?.fillColor) {
53364
53418
  const chipMarginLeft = leftMargin;
53365
- const chipMarginRight = 5;
53419
+ const chipMarginRight = DATA_VALIDATION_CHIP_MARGIN;
53366
53420
  box.chip = {
53367
53421
  color: chipStyle.fillColor,
53368
53422
  width: box.width - chipMarginLeft - chipMarginRight,
@@ -53526,7 +53580,7 @@ stores.inject(MyMetaStore, storeInstance);
53526
53580
  continue;
53527
53581
  }
53528
53582
  const elapsedTime = timeStamp - animation.startTime;
53529
- const progress = Math.min(1, elapsedTime / 200);
53583
+ const progress = Math.min(1, elapsedTime / CELL_ANIMATION_DURATION);
53530
53584
  if (progress >= 1) this.animations.delete(boxId);
53531
53585
  animation.progress = progress;
53532
53586
  }
@@ -53648,7 +53702,7 @@ stores.inject(MyMetaStore, storeInstance);
53648
53702
  resetTimeout = setTimeout(() => {
53649
53703
  velocityX = 0;
53650
53704
  velocityY = 0;
53651
- }, 100);
53705
+ }, resetTimeoutDuration);
53652
53706
  updateScroll(deltaX * horizontalScrollFactor, deltaY * verticalScrollFactor);
53653
53707
  }
53654
53708
  function onTouchEnd(ev) {
@@ -53717,7 +53771,7 @@ stores.inject(MyMetaStore, storeInstance);
53717
53771
  //#region src/components/helpers/wheel_hook.ts
53718
53772
  function useWheelHandler(handler) {
53719
53773
  function normalize(val, deltaMode) {
53720
- return val * (deltaMode === 0 ? 1 : 23);
53774
+ return val * (deltaMode === 0 ? 1 : DEFAULT_CELL_HEIGHT);
53721
53775
  }
53722
53776
  const onMouseWheel = (ev) => {
53723
53777
  handler(normalize(ev.shiftKey && !isMacOS() ? ev.deltaY : ev.deltaX, ev.deltaMode), normalize(ev.shiftKey && !isMacOS() ? ev.deltaX : ev.deltaY, ev.deltaMode));
@@ -53813,14 +53867,14 @@ stores.inject(MyMetaStore, storeInstance);
53813
53867
  return cssPropertiesToCss(css);
53814
53868
  }
53815
53869
  getHandlerEdgeLength() {
53816
- return this.env.isMobile() ? MOBILE_HANDLER_WIDTH : 8;
53870
+ return this.env.isMobile() ? MOBILE_HANDLER_WIDTH : AUTOFILL_EDGE_LENGTH;
53817
53871
  }
53818
53872
  get buttonLook() {
53819
53873
  const css = {
53820
53874
  "background-color": this.props.color,
53821
53875
  cursor: `${this.props.orientation}-resize`
53822
53876
  };
53823
- if (this.env.isMobile()) css["border-radius"] = `${8 / 2}px`;
53877
+ if (this.env.isMobile()) css["border-radius"] = `${AUTOFILL_EDGE_LENGTH / 2}px`;
53824
53878
  return cssPropertiesToCss(css);
53825
53879
  }
53826
53880
  onMouseDown(ev) {
@@ -54238,8 +54292,8 @@ stores.inject(MyMetaStore, storeInstance);
54238
54292
  TableResizer,
54239
54293
  Selection
54240
54294
  };
54241
- HEADER_HEIGHT = 26;
54242
- HEADER_WIDTH = 48;
54295
+ HEADER_HEIGHT = HEADER_HEIGHT;
54296
+ HEADER_WIDTH = HEADER_WIDTH;
54243
54297
  menuState;
54244
54298
  gridRef;
54245
54299
  highlightStore;
@@ -54303,10 +54357,10 @@ stores.inject(MyMetaStore, storeInstance);
54303
54357
  get gridOverlayDimensions() {
54304
54358
  const scrollbarWidth = this.env.model.getters.getScrollBarWidth();
54305
54359
  return cssPropertiesToCss({
54306
- top: `${26}px`,
54307
- left: `${48}px`,
54308
- height: `calc(100% - ${26 + scrollbarWidth}px)`,
54309
- width: `calc(100% - ${48 + scrollbarWidth}px)`
54360
+ top: `${HEADER_HEIGHT}px`,
54361
+ left: `${HEADER_WIDTH}px`,
54362
+ height: `calc(100% - ${HEADER_HEIGHT + scrollbarWidth}px)`,
54363
+ width: `calc(100% - ${HEADER_WIDTH + scrollbarWidth}px)`
54310
54364
  });
54311
54365
  }
54312
54366
  onClosePopover() {
@@ -54517,8 +54571,8 @@ stores.inject(MyMetaStore, storeInstance);
54517
54571
  const zone = this.env.model.getters.getSelectedZone();
54518
54572
  const rect = this.env.model.getters.getVisibleRect(zone);
54519
54573
  return {
54520
- x: rect.x + rect.width - 8 / 2,
54521
- y: rect.y + rect.height - 8 / 2
54574
+ x: rect.x + rect.width - AUTOFILL_EDGE_LENGTH / 2,
54575
+ y: rect.y + rect.height - AUTOFILL_EDGE_LENGTH / 2
54522
54576
  };
54523
54577
  }
54524
54578
  get isAutofillVisible() {
@@ -54535,10 +54589,10 @@ stores.inject(MyMetaStore, storeInstance);
54535
54589
  onGridResized() {
54536
54590
  const { height, width } = this.props.getGridSize();
54537
54591
  this.env.model.dispatch("RESIZE_SHEETVIEW", {
54538
- width: width - 48,
54539
- height: height - 26,
54540
- gridOffsetX: 48,
54541
- gridOffsetY: 26
54592
+ width: width - HEADER_WIDTH,
54593
+ height: height - HEADER_HEIGHT,
54594
+ gridOffsetX: HEADER_WIDTH,
54595
+ gridOffsetY: HEADER_HEIGHT
54542
54596
  });
54543
54597
  }
54544
54598
  moveCanvas(deltaX, deltaY) {
@@ -54879,7 +54933,7 @@ stores.inject(MyMetaStore, storeInstance);
54879
54933
  return cssPropertiesToCss({
54880
54934
  height: `${size}px`,
54881
54935
  width: `${size}px`,
54882
- color: cellStyle.textColor || "#374151C2",
54936
+ color: cellStyle.textColor || TEXT_BODY_MUTED,
54883
54937
  "background-color": this.getBackgroundColor(cellStyle)
54884
54938
  });
54885
54939
  }
@@ -55772,8 +55826,8 @@ stores.inject(MyMetaStore, storeInstance);
55772
55826
  case "DUPLICATE_SHEET": {
55773
55827
  const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
55774
55828
  for (const fig of sheetFiguresFrom) if (fig.tag === "carousel") {
55775
- const figureIdBase = fig.id.split("??").pop();
55776
- const duplicatedFigureId = `${cmd.sheetIdTo}${"??"}${figureIdBase}`;
55829
+ const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
55830
+ const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
55777
55831
  const carousel = this.getCarousel(fig.id);
55778
55832
  if (carousel) {
55779
55833
  const size = {
@@ -55789,8 +55843,8 @@ stores.inject(MyMetaStore, storeInstance);
55789
55843
  size,
55790
55844
  definition: { items: carousel.items.map((item) => {
55791
55845
  if (item.type === "carouselDataView") return { ...item };
55792
- const chartIdBase = item.chartId.split("??").pop();
55793
- const newChartId = `${cmd.sheetIdTo}${"??"}${chartIdBase}`;
55846
+ const chartIdBase = item.chartId.split(FIGURE_ID_SPLITTER).pop();
55847
+ const newChartId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${chartIdBase}`;
55794
55848
  return {
55795
55849
  ...item,
55796
55850
  chartId: newChartId
@@ -55862,12 +55916,12 @@ stores.inject(MyMetaStore, storeInstance);
55862
55916
  * with references (unless they contain a sheet name that contains the separator). */
55863
55917
  buildResult(numbers, strings, references) {
55864
55918
  const res = {};
55865
- if (numbers.length) res.N = numbers.join("|");
55919
+ if (numbers.length) res.N = numbers.join(SEPARATOR);
55866
55920
  if (strings.length) res.S = strings;
55867
55921
  if (references.length) {
55868
55922
  let referencePattern;
55869
- if (references.some((x) => x.includes("|"))) referencePattern = references;
55870
- else referencePattern = references.join("|");
55923
+ if (references.some((x) => x.includes(SEPARATOR))) referencePattern = references;
55924
+ else referencePattern = references.join(SEPARATOR);
55871
55925
  res.R = referencePattern;
55872
55926
  }
55873
55927
  return res;
@@ -55960,7 +56014,7 @@ stores.inject(MyMetaStore, storeInstance);
55960
56014
  }
55961
56015
  squishOneReference(reference, previousReferences, index, forSheetId) {
55962
56016
  const previousReference = previousReferences[index];
55963
- if (deepEquals(previousReference, reference)) return "=";
56017
+ if (deepEquals(previousReference, reference)) return NO_CHANGE;
55964
56018
  if (previousReference.sheetId !== reference.sheetId || previousReference.prefixSheet !== reference.prefixSheet || previousReference.invalidSheetName !== reference.invalidSheetName || previousReference.invalidXc !== reference.invalidXc || previousReference.parts.length !== reference.parts.length) {
55965
56019
  previousReferences[index] = deepCopy(reference);
55966
56020
  return getRangeString(reference, forSheetId, this.getters.getSheetName, this.rangeToStringOptions);
@@ -55994,7 +56048,7 @@ stores.inject(MyMetaStore, storeInstance);
55994
56048
  * - "=" meaning no change as string
55995
56049
  * */
55996
56050
  squishNumbers(numbers) {
55997
- const result = numbers.map((x) => "=");
56051
+ const result = numbers.map((x) => NO_CHANGE);
55998
56052
  for (let i = 0; i < numbers.length; i++) {
55999
56053
  const diff = numbers[i].value - (this.baseFormula.literalValues.numbers[i].value + this.alreadyAppliedNumberOffsets[i] || 0);
56000
56054
  if (diff !== 0) {
@@ -56005,7 +56059,7 @@ stores.inject(MyMetaStore, storeInstance);
56005
56059
  return result;
56006
56060
  }
56007
56061
  squishStrings(strings) {
56008
- const result = strings.map((x) => "=");
56062
+ const result = strings.map((x) => NO_CHANGE);
56009
56063
  for (let i = 0; i < strings.length; i++) {
56010
56064
  const str = strings[i].value;
56011
56065
  if (str !== this.previousStrings[i]) {
@@ -56140,16 +56194,16 @@ stores.inject(MyMetaStore, storeInstance);
56140
56194
  strings: [],
56141
56195
  dependencies: []
56142
56196
  };
56143
- if (squishedElement.N !== void 0 && squishedElement.N.length > 0) current.numbers = squishedElement.N.split("|").map(this.adjustNumbers);
56197
+ if (squishedElement.N !== void 0 && squishedElement.N.length > 0) current.numbers = squishedElement.N.split(SEPARATOR).map(this.adjustNumbers);
56144
56198
  else current.numbers = this.previousCell.literalValues.numbers;
56145
56199
  if (squishedElement.S !== void 0 && squishedElement.S.length > 0) current.strings = squishedElement.S.map(this.adjustStrings);
56146
56200
  else current.strings = this.previousCell.literalValues.strings;
56147
56201
  if (squishedElement.R !== void 0 && this.previousCell) {
56148
56202
  let references;
56149
56203
  if (typeof squishedElement.R !== "string") references = squishedElement.R;
56150
- else references = squishedElement.R.split("|");
56204
+ else references = squishedElement.R.split(SEPARATOR);
56151
56205
  current.dependencies = references.map((refStr, index) => {
56152
- if (refStr === "=") return { ...this.alreadyAppliedReferenceOffset[index] };
56206
+ if (refStr === NO_CHANGE) return { ...this.alreadyAppliedReferenceOffset[index] };
56153
56207
  else if (refStr.startsWith("+") || refStr.startsWith("-")) {
56154
56208
  const offset = parseInt(refStr.slice(2), 10);
56155
56209
  const sign = refStr[0] === "+" ? 1 : -1;
@@ -56185,14 +56239,14 @@ stores.inject(MyMetaStore, storeInstance);
56185
56239
  throw new Error("Invalid squished element or no previous cell to unsquish against");
56186
56240
  }
56187
56241
  adjustStrings = (str, index) => {
56188
- if (str === "=") return { value: this.previousString[index] };
56242
+ if (str === NO_CHANGE) return { value: this.previousString[index] };
56189
56243
  else {
56190
56244
  this.previousString[index] = str;
56191
56245
  return { value: str };
56192
56246
  }
56193
56247
  };
56194
56248
  adjustNumbers = (numStr, index) => {
56195
- if (numStr === "=") return { value: this.alreadyAppliedNumberOffset[index] };
56249
+ if (numStr === NO_CHANGE) return { value: this.alreadyAppliedNumberOffset[index] };
56196
56250
  else {
56197
56251
  const currentOffset = parseFloat(numStr.slice(1));
56198
56252
  const adjustedOffset = (this.alreadyAppliedNumberOffset[index] || 0) + currentOffset;
@@ -56707,10 +56761,10 @@ stores.inject(MyMetaStore, storeInstance);
56707
56761
  if (!chart || !figureId) continue;
56708
56762
  const fig = this.getters.getFigure(cmd.sheetId, figureId);
56709
56763
  if (!fig) continue;
56710
- const figureIdBase = figureId.split("??").pop();
56711
- const duplicatedFigureId = `${cmd.sheetIdTo}${"??"}${figureIdBase}`;
56712
- const chartIdBase = chartId.split("??").pop();
56713
- const duplicatedChartId = `${cmd.sheetIdTo}${"??"}${chartIdBase}`;
56764
+ const figureIdBase = figureId.split(FIGURE_ID_SPLITTER).pop();
56765
+ const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
56766
+ const chartIdBase = chartId.split(FIGURE_ID_SPLITTER).pop();
56767
+ const duplicatedChartId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${chartIdBase}`;
56714
56768
  const newChart = chart.duplicateInDuplicatedSheet(cmd.sheetIdTo);
56715
56769
  if (newChart) this.dispatch("CREATE_CHART", {
56716
56770
  figureId: duplicatedFigureId,
@@ -56817,8 +56871,8 @@ stores.inject(MyMetaStore, storeInstance);
56817
56871
  * Add a figure with tag chart with the given id at the given position
56818
56872
  */
56819
56873
  addFigure(figureId, sheetId, col, row, offset, size = {
56820
- width: 536,
56821
- height: 335
56874
+ width: DEFAULT_FIGURE_WIDTH,
56875
+ height: DEFAULT_FIGURE_HEIGHT
56822
56876
  }) {
56823
56877
  this.dispatch("CREATE_FIGURE", {
56824
56878
  sheetId,
@@ -57541,8 +57595,8 @@ stores.inject(MyMetaStore, storeInstance);
57541
57595
  const figureId = figure.id;
57542
57596
  const fig = this.figures[cmd.sheetId]?.[figureId];
57543
57597
  if (!fig) continue;
57544
- const figureIdBase = figureId.split("??").pop();
57545
- const duplicatedFigureId = `${cmd.sheetIdTo}${"??"}${figureIdBase}`;
57598
+ const figureIdBase = figureId.split(FIGURE_ID_SPLITTER).pop();
57599
+ const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
57546
57600
  this.dispatch("CREATE_FIGURE", {
57547
57601
  figureId: duplicatedFigureId,
57548
57602
  ...fig,
@@ -57580,11 +57634,11 @@ stores.inject(MyMetaStore, storeInstance);
57580
57634
  const numHeader = this.getters.getNumberRows(sheetId);
57581
57635
  const remainingSize = new Array(numHeader + 1);
57582
57636
  remainingSize[numHeader] = 0;
57583
- for (let i = numHeader - 1; i >= 0; i--) remainingSize[i] = remainingSize[i + 1] + (this.getters.getUserRowSize(sheetId, i) ?? 23);
57637
+ for (let i = numHeader - 1; i >= 0; i--) remainingSize[i] = remainingSize[i + 1] + (this.getters.getUserRowSize(sheetId, i) ?? DEFAULT_CELL_HEIGHT);
57584
57638
  for (const figure of this.getFigures(sheetId)) if (figure.offset.y + figure.height > remainingSize[figure.row]) {
57585
57639
  let y = figure.offset.y;
57586
57640
  let row = figure.row;
57587
- for (let row_size = this.getters.getUserRowSize(sheetId, row) ?? 23; row_size < y; row_size = this.getters.getUserRowSize(sheetId, row) ?? 23) {
57641
+ 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) {
57588
57642
  row += 1;
57589
57643
  y -= row_size;
57590
57644
  }
@@ -57609,7 +57663,7 @@ stores.inject(MyMetaStore, storeInstance);
57609
57663
  let rowNum, colNum;
57610
57664
  let { col, row } = figure;
57611
57665
  const offset = { ...figure.offset };
57612
- for (rowNum = numberOfRows; availableHeight < figure.height && rowNum > 0; rowNum--) availableHeight += this.getters.getUserRowSize(sheetId, rowNum - 1) ?? 23;
57666
+ for (rowNum = numberOfRows; availableHeight < figure.height && rowNum > 0; rowNum--) availableHeight += this.getters.getUserRowSize(sheetId, rowNum - 1) ?? DEFAULT_CELL_HEIGHT;
57613
57667
  if (row > rowNum) {
57614
57668
  row = rowNum;
57615
57669
  offset.y = Math.max(availableHeight - figure.height, 0);
@@ -58090,7 +58144,7 @@ stores.inject(MyMetaStore, storeInstance);
58090
58144
  }
58091
58145
  }
58092
58146
  getColSize(sheetId, index) {
58093
- return Math.round(this.sizes[sheetId]?.["COL"][index] || 96);
58147
+ return Math.round(this.sizes[sheetId]?.["COL"][index] || DEFAULT_CELL_WIDTH);
58094
58148
  }
58095
58149
  getUserRowSize(sheetId, index) {
58096
58150
  const rowSize = this.sizes[sheetId]?.["ROW"][index];
@@ -58123,7 +58177,7 @@ stores.inject(MyMetaStore, storeInstance);
58123
58177
  if (sheet.rows === void 0) sheet.rows = {};
58124
58178
  for (const row of range(0, this.getters.getNumberRows(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["ROW"][row]) sheet.rows[row] = {
58125
58179
  ...sheet.rows[row],
58126
- size: this.getUserRowSize(sheet.id, row) ?? 23
58180
+ size: this.getUserRowSize(sheet.id, row) ?? DEFAULT_CELL_HEIGHT
58127
58181
  };
58128
58182
  if (sheet.cols === void 0) sheet.cols = {};
58129
58183
  for (const col of range(0, this.getters.getNumberCols(sheet.id))) if (exportDefaults || this.sizes[sheet.id]["COL"][col]) sheet.cols[col] = {
@@ -58304,8 +58358,8 @@ stores.inject(MyMetaStore, storeInstance);
58304
58358
  case "DUPLICATE_SHEET": {
58305
58359
  const sheetFiguresFrom = this.getters.getFigures(cmd.sheetId);
58306
58360
  for (const fig of sheetFiguresFrom) if (fig.tag === "image") {
58307
- const figureIdBase = fig.id.split("??").pop();
58308
- const duplicatedFigureId = `${cmd.sheetIdTo}${"??"}${figureIdBase}`;
58361
+ const figureIdBase = fig.id.split(FIGURE_ID_SPLITTER).pop();
58362
+ const duplicatedFigureId = `${cmd.sheetIdTo}${FIGURE_ID_SPLITTER}${figureIdBase}`;
58309
58363
  const image = this.getImage(fig.id);
58310
58364
  if (image) {
58311
58365
  const size = {
@@ -61833,8 +61887,8 @@ stores.inject(MyMetaStore, storeInstance);
61833
61887
  hoverSvg: value ? CHECKBOX_CHECKED : CHECKBOX_UNCHECKED_HOVERED,
61834
61888
  priority: 2,
61835
61889
  horizontalAlign: "center",
61836
- size: 17,
61837
- margin: 2,
61890
+ size: GRID_ICON_EDGE_LENGTH,
61891
+ margin: GRID_ICON_MARGIN,
61838
61892
  position,
61839
61893
  type: "data_validation_checkbox",
61840
61894
  onClick: (position, env) => {
@@ -61881,7 +61935,7 @@ stores.inject(MyMetaStore, storeInstance);
61881
61935
  priority: 1,
61882
61936
  horizontalAlign: "left",
61883
61937
  size: computeTextFontSizeInPixels(style),
61884
- margin: 4,
61938
+ margin: MIN_CF_ICON_MARGIN,
61885
61939
  position
61886
61940
  };
61887
61941
  }
@@ -61896,13 +61950,13 @@ stores.inject(MyMetaStore, storeInstance);
61896
61950
  const fields = pivotCell.dimension === "COL" ? definition.columns : definition.rows;
61897
61951
  const hasIcon = !isDashboard && !getters.shouldShowFormulas() && pivotCell.domain.length !== fields.length;
61898
61952
  const isCollapsed = (definition.collapsedDomains?.[pivotCell.dimension] ?? []).some((domain) => deepEquals(domain, pivotCell.domain));
61899
- const indent = pivotCell.dimension === "ROW" ? (pivotCell.domain.length - 1) * 15 : 0;
61953
+ const indent = pivotCell.dimension === "ROW" ? (pivotCell.domain.length - 1) * PIVOT_INDENT : 0;
61900
61954
  return {
61901
61955
  type: "pivot_collapse",
61902
61956
  priority: 4,
61903
61957
  horizontalAlign: "left",
61904
- size: hasIcon || !isDashboard && pivotCell.dimension === "ROW" && definition.rows.length > 1 ? 12 : 0,
61905
- margin: hasIcon ? 2 * 2 + indent : indent,
61958
+ size: hasIcon || !isDashboard && pivotCell.dimension === "ROW" && definition.rows.length > 1 ? PIVOT_COLLAPSE_ICON_SIZE : 0,
61959
+ margin: hasIcon ? GRID_ICON_MARGIN * 2 + indent : indent,
61906
61960
  svg: hasIcon ? getPivotIconSvg(isCollapsed, false) : void 0,
61907
61961
  hoverSvg: hasIcon ? getPivotIconSvg(isCollapsed, true) : void 0,
61908
61962
  position,
@@ -62504,7 +62558,7 @@ stores.inject(MyMetaStore, storeInstance);
62504
62558
  col,
62505
62559
  row
62506
62560
  });
62507
- const background = style.fillColor || "#FFFFFF";
62561
+ const background = style.fillColor || BACKGROUND_CHART_COLOR;
62508
62562
  return {
62509
62563
  background,
62510
62564
  fontColor: style.textColor || chartFontColor(background)
@@ -62815,7 +62869,7 @@ stores.inject(MyMetaStore, storeInstance);
62815
62869
  return this.getDataValidationStyle(position);
62816
62870
  }
62817
62871
  getDataValidationChipStyle(position) {
62818
- if (this.hasChip(position)) return this.getDataValidationStyle(position) ?? { fillColor: "#E7E9ED" };
62872
+ if (this.hasChip(position)) return this.getDataValidationStyle(position) ?? { fillColor: GRAY_200 };
62819
62873
  }
62820
62874
  getInvalidDataValidationMessage(cellPosition) {
62821
62875
  const validationResult = this.getValidationResultForCell(cellPosition);
@@ -63044,7 +63098,7 @@ stores.inject(MyMetaStore, storeInstance);
63044
63098
  }
63045
63099
  }
63046
63100
  getRowSize(sheetId, row) {
63047
- return Math.round(this.getters.getUserRowSize(sheetId, row) ?? this.tallestCellInRow[sheetId][row]?.size ?? 23);
63101
+ return Math.round(this.getters.getUserRowSize(sheetId, row) ?? this.tallestCellInRow[sheetId][row]?.size ?? DEFAULT_CELL_HEIGHT);
63048
63102
  }
63049
63103
  getMaxAnchorOffset(sheetId, height, width) {
63050
63104
  let { numberOfRows: row, numberOfCols: col } = this.getters.getSheetSize(sheetId);
@@ -63082,8 +63136,8 @@ stores.inject(MyMetaStore, storeInstance);
63082
63136
  col,
63083
63137
  row
63084
63138
  });
63085
- if (updatedCellHeight <= 23) return;
63086
- if (!tallestCellInRow && updatedCellHeight > 23 || tallestCellInRow && updatedCellHeight > tallestCellInRow.size) {
63139
+ if (updatedCellHeight <= DEFAULT_CELL_HEIGHT) return;
63140
+ if (!tallestCellInRow && updatedCellHeight > DEFAULT_CELL_HEIGHT || tallestCellInRow && updatedCellHeight > tallestCellInRow.size) {
63087
63141
  const newTallestCell = {
63088
63142
  cell: {
63089
63143
  sheetId,
@@ -63108,7 +63162,7 @@ stores.inject(MyMetaStore, storeInstance);
63108
63162
  * merge, or the height of the cell computed based on its style/content.
63109
63163
  */
63110
63164
  getCellHeight(position) {
63111
- if (this.isInMultiRowMerge(position)) return 23;
63165
+ if (this.isInMultiRowMerge(position)) return DEFAULT_CELL_HEIGHT;
63112
63166
  const cell = this.getters.getCell(position);
63113
63167
  const colSize = this.getters.getColSize(position.sheetId, position.col);
63114
63168
  return getDefaultCellHeight(this.ctx, cell, this.getters.getLocale(), colSize);
@@ -63130,7 +63184,7 @@ stores.inject(MyMetaStore, storeInstance);
63130
63184
  if (!cell) continue;
63131
63185
  const position = this.getters.getCellPosition(cell.id);
63132
63186
  const cellHeight = this.getCellHeight(position);
63133
- if (cellHeight > maxHeight && cellHeight > 23) {
63187
+ if (cellHeight > maxHeight && cellHeight > DEFAULT_CELL_HEIGHT) {
63134
63188
  maxHeight = cellHeight;
63135
63189
  tallestCell = {
63136
63190
  cell: position,
@@ -63138,7 +63192,7 @@ stores.inject(MyMetaStore, storeInstance);
63138
63192
  };
63139
63193
  }
63140
63194
  }
63141
- if (tallestCell && tallestCell.size > 23) return tallestCell;
63195
+ if (tallestCell && tallestCell.size > DEFAULT_CELL_HEIGHT) return tallestCell;
63142
63196
  }
63143
63197
  };
63144
63198
 
@@ -63582,7 +63636,7 @@ stores.inject(MyMetaStore, storeInstance);
63582
63636
  * @returns the value of the cell in the pivot with the new domain, or "sameValue" if the domain is the same
63583
63637
  */
63584
63638
  getComparisonValue(measure, domain, fieldNameWithGranularity, valueToCompare) {
63585
- const comparedDomain = valueToCompare === "(previous)" || valueToCompare === "(next)" ? getPreviousOrNextValueDomain(this, domain, fieldNameWithGranularity, valueToCompare) : replaceFieldValueInDomain(domain, fieldNameWithGranularity, valueToCompare);
63639
+ const comparedDomain = valueToCompare === PREVIOUS_VALUE || valueToCompare === NEXT_VALUE ? getPreviousOrNextValueDomain(this, domain, fieldNameWithGranularity, valueToCompare) : replaceFieldValueInDomain(domain, fieldNameWithGranularity, valueToCompare);
63586
63640
  if (deepEquals(comparedDomain, domain)) return "sameValue";
63587
63641
  if (!comparedDomain || !isDomainIsInPivot(this, comparedDomain)) throw new NotAvailableError();
63588
63642
  const comparedValue = this._getPivotCellValueAndFormat(measure.id, comparedDomain);
@@ -66338,7 +66392,7 @@ stores.inject(MyMetaStore, storeInstance);
66338
66392
  this.trigger("new-local-state-update", { id: revision.id });
66339
66393
  this.sendUpdateMessage({
66340
66394
  type: "REMOTE_REVISION",
66341
- version: 1,
66395
+ version: MESSAGE_VERSION,
66342
66396
  serverRevisionId: this.serverRevisionId,
66343
66397
  nextRevisionId: revision.id,
66344
66398
  clientId: revision.clientId,
@@ -66349,7 +66403,7 @@ stores.inject(MyMetaStore, storeInstance);
66349
66403
  this.waitingUndoRedoAck = true;
66350
66404
  this.sendUpdateMessage({
66351
66405
  type: "REVISION_UNDONE",
66352
- version: 1,
66406
+ version: MESSAGE_VERSION,
66353
66407
  serverRevisionId: this.serverRevisionId,
66354
66408
  nextRevisionId: this.uuidGenerator.uuidv4(),
66355
66409
  undoneRevisionId: revisionId
@@ -66359,7 +66413,7 @@ stores.inject(MyMetaStore, storeInstance);
66359
66413
  this.waitingUndoRedoAck = true;
66360
66414
  this.sendUpdateMessage({
66361
66415
  type: "REVISION_REDONE",
66362
- version: 1,
66416
+ version: MESSAGE_VERSION,
66363
66417
  serverRevisionId: this.serverRevisionId,
66364
66418
  nextRevisionId: this.uuidGenerator.uuidv4(),
66365
66419
  redoneRevisionId: revisionId
@@ -66400,7 +66454,7 @@ stores.inject(MyMetaStore, storeInstance);
66400
66454
  this.sendToTransport({
66401
66455
  type: "CLIENT_LEFT",
66402
66456
  clientId: this.clientId,
66403
- version: 1
66457
+ version: MESSAGE_VERSION
66404
66458
  });
66405
66459
  }
66406
66460
  /**
@@ -66417,7 +66471,7 @@ stores.inject(MyMetaStore, storeInstance);
66417
66471
  ...data,
66418
66472
  revisionId: snapshotId
66419
66473
  },
66420
- version: 1
66474
+ version: MESSAGE_VERSION
66421
66475
  });
66422
66476
  }
66423
66477
  getCurrentClient() {
@@ -66461,7 +66515,7 @@ stores.inject(MyMetaStore, storeInstance);
66461
66515
  };
66462
66516
  this.sendToTransport({
66463
66517
  type,
66464
- version: 1,
66518
+ version: MESSAGE_VERSION,
66465
66519
  client: {
66466
66520
  ...client,
66467
66521
  position
@@ -66540,7 +66594,7 @@ stores.inject(MyMetaStore, storeInstance);
66540
66594
  const { position } = client;
66541
66595
  if (position) this.sendToTransport({
66542
66596
  type: "CLIENT_MOVED",
66543
- version: 1,
66597
+ version: MESSAGE_VERSION,
66544
66598
  client: {
66545
66599
  ...client,
66546
66600
  position
@@ -67322,7 +67376,7 @@ stores.inject(MyMetaStore, storeInstance);
67322
67376
  onNewLocalStateUpdate({ id }) {
67323
67377
  this.undoStack.push(id);
67324
67378
  this.redoStack = [];
67325
- if (this.undoStack.length > 99) this.undoStack.shift();
67379
+ if (this.undoStack.length > MAX_HISTORY_STEPS) this.undoStack.shift();
67326
67380
  }
67327
67381
  /**
67328
67382
  * Fetch the last revision which is not empty and not a repeated command
@@ -67587,7 +67641,7 @@ stores.inject(MyMetaStore, storeInstance);
67587
67641
  }
67588
67642
  getAutoSeparatorForString(str) {
67589
67643
  const separators = [
67590
- "\n",
67644
+ NEWLINE,
67591
67645
  ";",
67592
67646
  ",",
67593
67647
  " ",
@@ -67921,9 +67975,9 @@ stores.inject(MyMetaStore, storeInstance);
67921
67975
  contentWidth += computeMultilineTextSize(this.ctx, multiLineText, style).width;
67922
67976
  }
67923
67977
  for (const icon of this.getters.getCellIcons(position)) contentWidth += icon.margin + icon.size;
67924
- if (this.getters.getDataValidationChipStyle(position)) contentWidth += 5 * 2;
67978
+ if (this.getters.getDataValidationChipStyle(position)) contentWidth += DATA_VALIDATION_CHIP_MARGIN * 2;
67925
67979
  if (contentWidth === 0) return 0;
67926
- contentWidth += 2 * 4;
67980
+ contentWidth += 2 * PADDING_AUTORESIZE_HORIZONTAL;
67927
67981
  if (style.wrapping === "wrap") {
67928
67982
  const colWidth = this.getters.getColSize(position.sheetId, position.col);
67929
67983
  return Math.min(colWidth, contentWidth);
@@ -67974,11 +68028,11 @@ stores.inject(MyMetaStore, storeInstance);
67974
68028
  computeTextYCoordinate(cellRect, textLineHeight, verticalAlign = DEFAULT_VERTICAL_ALIGN, numberOfLines = 1) {
67975
68029
  const y = cellRect.y + 1;
67976
68030
  const textHeight = computeTextLinesHeight(textLineHeight, numberOfLines);
67977
- if (cellRect.height > textHeight + 4 * 2) {
68031
+ if (cellRect.height > textHeight + MIN_CELL_TEXT_MARGIN * 2) {
67978
68032
  if (verticalAlign === "middle") return Math.ceil(y + (cellRect.height - textHeight) / 2);
67979
- if (verticalAlign === "bottom") return y + cellRect.height - textHeight - 4;
68033
+ if (verticalAlign === "bottom") return y + cellRect.height - textHeight - MIN_CELL_TEXT_MARGIN;
67980
68034
  }
67981
- return y + 4;
68035
+ return y + MIN_CELL_TEXT_MARGIN;
67982
68036
  }
67983
68037
  /**
67984
68038
  * Expands the given zone until bordered by empty cells or reached the sheet boundaries.
@@ -68083,11 +68137,11 @@ stores.inject(MyMetaStore, storeInstance);
68083
68137
  if (cell.isFormula || this.getters.getArrayFormulaSpreadingOn(position)) {
68084
68138
  const content = this.getters.getEvaluatedCell(position).formattedValue;
68085
68139
  const evaluatedSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
68086
- if (evaluatedSize > evaluatedRowSize && evaluatedSize > 23) evaluatedRowSize = evaluatedSize;
68140
+ if (evaluatedSize > evaluatedRowSize && evaluatedSize > DEFAULT_CELL_HEIGHT) evaluatedRowSize = evaluatedSize;
68087
68141
  } else {
68088
68142
  const content = cell.content;
68089
68143
  const dynamicRowSize = getCellContentHeight(this.ctx, content, cell?.style, colSize);
68090
- if (dynamicRowSize >= evaluatedRowSize && dynamicRowSize > 23) evaluatedRowSize = 0;
68144
+ if (dynamicRowSize >= evaluatedRowSize && dynamicRowSize > DEFAULT_CELL_HEIGHT) evaluatedRowSize = 0;
68091
68145
  }
68092
68146
  }
68093
68147
  rowSizes.push(evaluatedRowSize || null);
@@ -68774,7 +68828,7 @@ stores.inject(MyMetaStore, storeInstance);
68774
68828
  const imageUrl = this.getters.getImage(figureId).path;
68775
68829
  file = await this.fileStore?.getFile(imageUrl);
68776
68830
  if (file.type !== "image/png") {
68777
- if (file.size > 5242880) {
68831
+ if (file.size > MAX_FILE_SIZE) {
68778
68832
  this.ui.notifyUI({
68779
68833
  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))),
68780
68834
  sticky: false,
@@ -69934,7 +69988,7 @@ stores.inject(MyMetaStore, storeInstance);
69934
69988
  let height = lastRowEnd - this.offsetCorrectionY;
69935
69989
  if (this.canScrollVertically) {
69936
69990
  height = Math.max(height, this.viewportHeight);
69937
- if (lastRowEnd + 46 > height && !this.getters.isReadonly() && this.viewportHeight > 46) height += 46;
69991
+ if (lastRowEnd + FOOTER_HEIGHT > height && !this.getters.isReadonly() && this.viewportHeight > FOOTER_HEIGHT) height += FOOTER_HEIGHT;
69938
69992
  }
69939
69993
  return {
69940
69994
  width,
@@ -70457,7 +70511,7 @@ stores.inject(MyMetaStore, storeInstance);
70457
70511
  return this.getSubViewports(sheetId).some((pane) => pane.isVisible(col, row));
70458
70512
  }
70459
70513
  getScrollBarWidth() {
70460
- return 15 / this.zoomLevel;
70514
+ return SCROLLBAR_WIDTH / this.zoomLevel;
70461
70515
  }
70462
70516
  getEdgeScrollCol(x, previousX, startingX) {
70463
70517
  let canEdgeScroll = false;
@@ -70970,8 +71024,8 @@ stores.inject(MyMetaStore, storeInstance);
70970
71024
  text: value.value,
70971
71025
  htmlContent: [{
70972
71026
  value: value.label,
70973
- color: chipTextColor(color || "#E7E9ED"),
70974
- backgroundColor: color || "#E7E9ED",
71027
+ color: chipTextColor(color || GRAY_200),
71028
+ backgroundColor: color || GRAY_200,
70975
71029
  classes: ["badge rounded-pill fs-6 fw-normal w-100 mt-1 text-start"]
70976
71030
  }],
70977
71031
  fuzzySearchKey: value.label
@@ -71411,8 +71465,8 @@ stores.inject(MyMetaStore, storeInstance);
71411
71465
  hoverSvg: getDataFilterIcon(isFilterActive, isHighContrast, true),
71412
71466
  priority: 3,
71413
71467
  horizontalAlign: "right",
71414
- size: 17,
71415
- margin: 2,
71468
+ size: GRID_ICON_EDGE_LENGTH,
71469
+ margin: GRID_ICON_MARGIN,
71416
71470
  position,
71417
71471
  onClick: (position, env) => {
71418
71472
  const cellPopovers = env.getStore(CellPopoverStore);
@@ -73362,16 +73416,16 @@ stores.inject(MyMetaStore, storeInstance);
73362
73416
  const startCoordinates = this.env.model.getters.getRowDimensions(sheetId, startRow).start;
73363
73417
  const endCoordinates = this.env.model.getters.getRowDimensions(sheetId, endRow).end;
73364
73418
  let groupHeaderY = 0;
73365
- let groupHeaderHeight = 26;
73419
+ let groupHeaderHeight = HEADER_HEIGHT;
73366
73420
  if (startRow !== 0) {
73367
73421
  const headerRowDims = this.env.model.getters.getRowDimensions(sheetId, startRow - 1);
73368
- groupHeaderY = 26 + headerRowDims.start;
73422
+ groupHeaderY = HEADER_HEIGHT + headerRowDims.start;
73369
73423
  groupHeaderHeight = headerRowDims.end - headerRowDims.start;
73370
73424
  }
73371
73425
  const headerRect = {
73372
73426
  x: this.props.layerOffset,
73373
73427
  y: groupHeaderY,
73374
- width: 21,
73428
+ width: GROUP_LAYER_WIDTH,
73375
73429
  height: groupHeaderHeight
73376
73430
  };
73377
73431
  return {
@@ -73379,7 +73433,7 @@ stores.inject(MyMetaStore, storeInstance);
73379
73433
  groupRect: {
73380
73434
  x: this.props.layerOffset,
73381
73435
  y: headerRect.y,
73382
- width: 21,
73436
+ width: GROUP_LAYER_WIDTH,
73383
73437
  height: headerRect.height + (endCoordinates - startCoordinates)
73384
73438
  },
73385
73439
  isEndHidden: this.env.model.getters.isRowHidden(sheetId, endRow)
@@ -73412,17 +73466,17 @@ stores.inject(MyMetaStore, storeInstance);
73412
73466
  const startCoordinates = this.env.model.getters.getColDimensions(sheetId, startCol).start;
73413
73467
  const endCoordinates = this.env.model.getters.getColDimensions(sheetId, endCol).end;
73414
73468
  let groupHeaderX = 0;
73415
- let groupHeaderWidth = 48;
73469
+ let groupHeaderWidth = HEADER_WIDTH;
73416
73470
  if (startCol !== 0) {
73417
73471
  const headerRowDims = this.env.model.getters.getColDimensions(sheetId, startCol - 1);
73418
- groupHeaderX = 48 + headerRowDims.start;
73472
+ groupHeaderX = HEADER_WIDTH + headerRowDims.start;
73419
73473
  groupHeaderWidth = headerRowDims.end - headerRowDims.start;
73420
73474
  }
73421
73475
  const headerRect = {
73422
73476
  x: groupHeaderX,
73423
73477
  y: this.props.layerOffset,
73424
73478
  width: groupHeaderWidth,
73425
- height: 21
73479
+ height: GROUP_LAYER_WIDTH
73426
73480
  };
73427
73481
  return {
73428
73482
  headerRect,
@@ -73430,7 +73484,7 @@ stores.inject(MyMetaStore, storeInstance);
73430
73484
  x: headerRect.x,
73431
73485
  y: this.props.layerOffset,
73432
73486
  width: headerRect.width + (endCoordinates - startCoordinates),
73433
- height: 21
73487
+ height: GROUP_LAYER_WIDTH
73434
73488
  },
73435
73489
  isEndHidden: this.env.model.getters.isColHidden(sheetId, endCol)
73436
73490
  };
@@ -73456,7 +73510,7 @@ stores.inject(MyMetaStore, storeInstance);
73456
73510
  menuItems: []
73457
73511
  });
73458
73512
  getLayerOffset(layerIndex) {
73459
- return layerIndex * 21;
73513
+ return layerIndex * GROUP_LAYER_WIDTH;
73460
73514
  }
73461
73515
  onContextMenu(event) {
73462
73516
  const sheetId = this.env.model.getters.getActiveSheetId();
@@ -73504,8 +73558,8 @@ stores.inject(MyMetaStore, storeInstance);
73504
73558
  get frozenPaneContainerSize() {
73505
73559
  if (!this.hasFrozenPane) return 0;
73506
73560
  const viewportCoordinates = this.env.model.getters.getMainViewportCoordinates();
73507
- if (this.props.dimension === "COL") return 48 + viewportCoordinates.x;
73508
- else return 26 + viewportCoordinates.y;
73561
+ if (this.props.dimension === "COL") return HEADER_WIDTH + viewportCoordinates.x;
73562
+ else return HEADER_HEIGHT + viewportCoordinates.y;
73509
73563
  }
73510
73564
  };
73511
73565
 
@@ -73514,7 +73568,7 @@ stores.inject(MyMetaStore, storeInstance);
73514
73568
  function useScreenWidth() {
73515
73569
  const spreadsheetRect = useSpreadsheetRect();
73516
73570
  return { get isSmall() {
73517
- return spreadsheetRect.width < 768;
73571
+ return spreadsheetRect.width < MOBILE_WIDTH_BREAKPOINT;
73518
73572
  } };
73519
73573
  }
73520
73574
 
@@ -73824,7 +73878,7 @@ stores.inject(MyMetaStore, storeInstance);
73824
73878
  "line-height": "24px"
73825
73879
  };
73826
73880
  if (this.env.model.getters.isCurrentSheetLocked()) style["pointer-events"] = "none";
73827
- style.height = this.focus === "inactive" ? `${34}px` : "fit-content";
73881
+ style.height = this.focus === "inactive" ? `${DESKTOP_TOPBAR_TOOLBAR_HEIGHT}px` : "fit-content";
73828
73882
  return cssPropertiesToCss(style);
73829
73883
  }
73830
73884
  onFocus(selection) {
@@ -74819,7 +74873,7 @@ stores.inject(MyMetaStore, storeInstance);
74819
74873
  const scrollbarWidth = this.env.model.getters.getScrollBarWidth();
74820
74874
  if (this.env.isDashboard()) properties["grid-template-rows"] = `auto`;
74821
74875
  else properties["grid-template-rows"] = `min-content auto min-content`;
74822
- properties["grid-template-columns"] = `auto ${this.sidePanel.mainPanel ? `${this.sidePanel.totalPanelSize || 350}px` : "auto"}`;
74876
+ properties["grid-template-columns"] = `auto ${this.sidePanel.mainPanel ? `${this.sidePanel.totalPanelSize || DEFAULT_SIDE_PANEL_SIZE}px` : "auto"}`;
74823
74877
  properties["--os-scrollbar-width"] = `${scrollbarWidth}px`;
74824
74878
  properties["color-scheme"] = this.props.colorScheme;
74825
74879
  return cssPropertiesToCss(properties);
@@ -74914,7 +74968,7 @@ stores.inject(MyMetaStore, storeInstance);
74914
74968
  checkViewportSize() {
74915
74969
  const { xRatio, yRatio } = this.env.model.getters.getFrozenSheetViewRatio(this.env.model.getters.getActiveSheetId());
74916
74970
  if (!isFinite(xRatio) || !isFinite(yRatio)) return;
74917
- if (yRatio > .85 || xRatio > .85) {
74971
+ if (yRatio > MAXIMAL_FREEZABLE_RATIO || xRatio > MAXIMAL_FREEZABLE_RATIO) {
74918
74972
  if (this.isViewportTooSmall) return;
74919
74973
  this.notificationStore.notifyUser({
74920
74974
  text: _t("The current window is too small to display this sheet properly. Consider resizing your browser window or adjusting frozen rows and columns."),
@@ -74932,8 +74986,8 @@ stores.inject(MyMetaStore, storeInstance);
74932
74986
  return this.env.model.getters.getSheetViewDimension().height;
74933
74987
  }
74934
74988
  get gridContainerStyle() {
74935
- const gridColSize = 21 * this.rowLayers.length;
74936
- const gridRowSize = 21 * this.colLayers.length;
74989
+ const gridColSize = GROUP_LAYER_WIDTH * this.rowLayers.length;
74990
+ const gridRowSize = GROUP_LAYER_WIDTH * this.colLayers.length;
74937
74991
  const zoom = this.env.model.getters.getViewportZoomLevel();
74938
74992
  return cssPropertiesToCss({
74939
74993
  "grid-template-columns": `${gridColSize ? gridColSize + 2 : 0}px auto`,
@@ -76746,7 +76800,7 @@ stores.inject(MyMetaStore, storeInstance);
76746
76800
  let title = escapeXml``;
76747
76801
  if (chart.data.title?.text) {
76748
76802
  const titleColor = toXlsxHexColor(chartMutedFontColor(chart.data.backgroundColor));
76749
- const fontSize = chart.data.title.fontSize ?? 16;
76803
+ const fontSize = chart.data.title.fontSize ?? CHART_TITLE_FONT_SIZE;
76750
76804
  title = escapeXml`
76751
76805
  <c:title>
76752
76806
  ${insertText(chart.data.title.text, titleColor, fontSize, chart.data.title)}
@@ -76837,7 +76891,7 @@ stores.inject(MyMetaStore, storeInstance);
76837
76891
  </a:ln>
76838
76892
  `;
76839
76893
  }
76840
- function insertText(text, fontColor = "000000", fontsize = 16, style = {}) {
76894
+ function insertText(text, fontColor = "000000", fontsize = CHART_TITLE_FONT_SIZE, style = {}) {
76841
76895
  const textProperties = [
76842
76896
  ["b", style.bold ? "1" : "0"],
76843
76897
  ["i", style.italic ? "1" : "0"],
@@ -77424,7 +77478,7 @@ stores.inject(MyMetaStore, storeInstance);
77424
77478
  return escapeXml`
77425
77479
  <c:doughnutChart>
77426
77480
  <c:varyColors val="1" />
77427
- <c:holeSize val="${chart.pieHolePercentage ?? (chart.isDoughnut ? 50 : 0)}" />
77481
+ <c:holeSize val="${chart.pieHolePercentage ?? (chart.isDoughnut ? DEFAULT_DOUGHNUT_CHART_HOLE_SIZE : 0)}" />
77428
77482
  ${joinXmlNodes(dataSetsNodes)}
77429
77483
  ${insertDataLabels({ showValues: chart.showValues })}
77430
77484
  </c:doughnutChart>
@@ -77448,7 +77502,7 @@ stores.inject(MyMetaStore, storeInstance);
77448
77502
  }
77449
77503
  function addAx(position, axisName, axId, crossAxId, title, defaultFontColor, deleteAxis = 0, orientation = "minMax", crossPosition, tickLabelPosition = "nextTo", maxValue, majorUnit, format = "General") {
77450
77504
  const color = title?.color ? toXlsxHexColor(title.color) : defaultFontColor;
77451
- const fontSize = title?.fontSize ?? 12;
77505
+ const fontSize = title?.fontSize ?? CHART_AXIS_TITLE_FONT_SIZE;
77452
77506
  const crossBetweenEl = axisName === "c:valAx" ? escapeXml`<c:crossBetween val="between" />` : "";
77453
77507
  const maxValueEl = maxValue ? escapeXml`<c:max val="${maxValue}" />` : "";
77454
77508
  const minValueEl = maxValue ? escapeXml`<c:min val="${-maxValue}" />` : "";
@@ -78076,12 +78130,12 @@ stores.inject(MyMetaStore, storeInstance);
78076
78130
  let currentPosition = 0;
78077
78131
  for (const [headerIndex, header] of headers.slice(anchor).entries()) if (currentPosition <= offset && offset < currentPosition + header.size) return {
78078
78132
  index: anchor + headerIndex,
78079
- offset: convertDotValueToEMU(offset - currentPosition + 1)
78133
+ offset: convertDotValueToEMU(offset - currentPosition + FIGURE_BORDER_WIDTH)
78080
78134
  };
78081
78135
  else if (headerIndex < headers.length - 1) currentPosition += header.size;
78082
78136
  return {
78083
78137
  index: headers.length - 1,
78084
- offset: convertDotValueToEMU(offset - currentPosition + 1)
78138
+ offset: convertDotValueToEMU(offset - currentPosition + FIGURE_BORDER_WIDTH)
78085
78139
  };
78086
78140
  }
78087
78141
  function createChartDrawing(figure, sheet, chartRelId, construct) {
@@ -78187,7 +78241,7 @@ stores.inject(MyMetaStore, storeInstance);
78187
78241
  function addNumberFormats(numFmts) {
78188
78242
  const numFmtNodes = [];
78189
78243
  for (const [index, numFmt] of Object.entries(numFmts)) {
78190
- const numFmtAttrs = [["numFmtId", parseInt(index) + 164], ["formatCode", numFmt.format]];
78244
+ const numFmtAttrs = [["numFmtId", parseInt(index) + FIRST_NUMFMT_ID], ["formatCode", numFmt.format]];
78191
78245
  numFmtNodes.push(escapeXml`
78192
78246
  <numFmt ${formatAttributes(numFmtAttrs)}/>
78193
78247
  `);
@@ -78420,7 +78474,7 @@ stores.inject(MyMetaStore, storeInstance);
78420
78474
  const attributes = [
78421
78475
  ["min", parseInt(id) + 1],
78422
78476
  ["max", parseInt(id) + 1],
78423
- ["width", convertWidthToExcel(col.size || 96)],
78477
+ ["width", convertWidthToExcel(col.size || DEFAULT_CELL_WIDTH)],
78424
78478
  ["customWidth", 1],
78425
78479
  ["hidden", col.isHidden ? 1 : 0]
78426
78480
  ];
@@ -78444,7 +78498,7 @@ stores.inject(MyMetaStore, storeInstance);
78444
78498
  for (let r = 0; r < sheet.rowNumber; r++) {
78445
78499
  const rowAttrs = [["r", r + 1]];
78446
78500
  const row = sheet.rows[r] || {};
78447
- if (row.size && row.size !== 23) rowAttrs.push(["ht", convertHeightToExcel(row.size)], ["customHeight", 1]);
78501
+ if (row.size && row.size !== DEFAULT_CELL_HEIGHT) rowAttrs.push(["ht", convertHeightToExcel(row.size)], ["customHeight", 1]);
78448
78502
  if (row.isHidden) rowAttrs.push(["hidden", 1]);
78449
78503
  if (row.outlineLevel) rowAttrs.push(["outlineLevel", row.outlineLevel]);
78450
78504
  if (row.collapsed) rowAttrs.push(["collapsed", 1]);
@@ -78486,7 +78540,7 @@ stores.inject(MyMetaStore, storeInstance);
78486
78540
  </c>`);
78487
78541
  }
78488
78542
  }
78489
- if (cellNodes.length || row.size !== 23 || row.isHidden || row.outlineLevel || row.collapsed) rowNodes.push(escapeXml`
78543
+ if (cellNodes.length || row.size !== DEFAULT_CELL_HEIGHT || row.isHidden || row.outlineLevel || row.collapsed) rowNodes.push(escapeXml`
78490
78544
  <row ${formatAttributes(rowAttrs)}>
78491
78545
  ${joinXmlNodes(cellNodes)}
78492
78546
  </row>
@@ -78659,7 +78713,7 @@ stores.inject(MyMetaStore, storeInstance);
78659
78713
  let currentTableIndex = 1;
78660
78714
  for (const [sheetIndex, sheet] of Object.entries(data.sheets)) {
78661
78715
  const namespaces = [["xmlns", NAMESPACE["worksheet"]], ["xmlns:r", RELATIONSHIP_NSR]];
78662
- const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(23)], ["defaultColWidth", convertWidthToExcel(96)]];
78716
+ const sheetFormatAttributes = [["defaultRowHeight", convertHeightToExcel(DEFAULT_CELL_HEIGHT)], ["defaultColWidth", convertWidthToExcel(DEFAULT_CELL_WIDTH)]];
78663
78717
  const tablesNode = createTablesForSheet(sheet, sheetIndex, currentTableIndex, construct, files);
78664
78718
  currentTableIndex += sheet.tables.length;
78665
78719
  let drawingNode = escapeXml``;
@@ -79360,7 +79414,7 @@ stores.inject(MyMetaStore, storeInstance);
79360
79414
  _exportData(shouldSquish) {
79361
79415
  let data = createEmptyWorkbookData();
79362
79416
  for (const handler of this.handlers) if (handler instanceof CorePlugin) handler.export(data, shouldSquish);
79363
- data.revisionId = this.session.getRevisionId() || "START_REVISION";
79417
+ data.revisionId = this.session.getRevisionId() || DEFAULT_REVISION_ID;
79364
79418
  data = deepCopy(data);
79365
79419
  return data;
79366
79420
  }
@@ -79595,7 +79649,7 @@ stores.inject(MyMetaStore, storeInstance);
79595
79649
  const definition = this.getDefinition();
79596
79650
  return {
79597
79651
  ...definition,
79598
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
79652
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
79599
79653
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
79600
79654
  dataSets,
79601
79655
  labelRange,
@@ -80010,7 +80064,7 @@ stores.inject(MyMetaStore, storeInstance);
80010
80064
  return {
80011
80065
  ...definition,
80012
80066
  horizontal: true,
80013
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
80067
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
80014
80068
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
80015
80069
  dataSets,
80016
80070
  labelRange,
@@ -80150,7 +80204,7 @@ stores.inject(MyMetaStore, storeInstance);
80150
80204
  const { dataSets, labelRange } = this.getCommonDataSetAttributesForExcel(this.labelRange, this.dataSets, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
80151
80205
  return {
80152
80206
  ...this.getDefinition(),
80153
- backgroundColor: toXlsxHexColor(this.background || "#FFFFFF"),
80207
+ backgroundColor: toXlsxHexColor(this.background || BACKGROUND_CHART_COLOR),
80154
80208
  fontColor: toXlsxHexColor(chartFontColor(this.background)),
80155
80209
  dataSets,
80156
80210
  labelRange
@@ -81583,14 +81637,14 @@ stores.inject(MyMetaStore, storeInstance);
81583
81637
  */
81584
81638
  const __info__ = {};
81585
81639
  const SPREADSHEET_DIMENSIONS = {
81586
- MIN_ROW_HEIGHT: 10,
81587
- MIN_COL_WIDTH: 5,
81588
- HEADER_HEIGHT: 26,
81589
- HEADER_WIDTH: 48,
81590
- DESKTOP_BOTTOMBAR_HEIGHT: 36,
81591
- DEFAULT_CELL_WIDTH: 96,
81592
- DEFAULT_CELL_HEIGHT: 23,
81593
- SCROLLBAR_WIDTH: 15
81640
+ MIN_ROW_HEIGHT,
81641
+ MIN_COL_WIDTH,
81642
+ HEADER_HEIGHT,
81643
+ HEADER_WIDTH,
81644
+ DESKTOP_BOTTOMBAR_HEIGHT,
81645
+ DEFAULT_CELL_WIDTH,
81646
+ DEFAULT_CELL_HEIGHT,
81647
+ SCROLLBAR_WIDTH
81594
81648
  };
81595
81649
  const registries = {
81596
81650
  autoCompleteProviders,
@@ -81812,9 +81866,9 @@ stores.inject(MyMetaStore, storeInstance);
81812
81866
  PIVOT_STATIC_TABLE_CONFIG,
81813
81867
  PIVOT_INSERT_TABLE_STYLE_ID,
81814
81868
  ChartTerms,
81815
- FIGURE_ID_SPLITTER: "??",
81816
- GRID_ICON_EDGE_LENGTH: 17,
81817
- GRID_ICON_MARGIN: 2
81869
+ FIGURE_ID_SPLITTER,
81870
+ GRID_ICON_EDGE_LENGTH,
81871
+ GRID_ICON_MARGIN
81818
81872
  };
81819
81873
  const chartHelpers = {
81820
81874
  ...charts_exports,
@@ -81882,8 +81936,8 @@ exports.stores = stores;
81882
81936
  exports.tokenColors = tokenColors;
81883
81937
  exports.tokenize = tokenize;
81884
81938
 
81885
- __info__.version = "19.2.30";
81886
- __info__.date = "2026-09-18T05:25:53.803Z";
81887
- __info__.hash = "3e0951a";
81939
+ __info__.version = "19.2.31";
81940
+ __info__.date = "2026-10-01T07:52:54.414Z";
81941
+ __info__.hash = "a784cea";
81888
81942
 
81889
81943
  })(this.o_spreadsheet = this.o_spreadsheet || {}, owl);