@odoo/o-spreadsheet 16.4.19 → 16.4.21

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.
@@ -2215,27 +2215,30 @@ function roundFormat(format) {
2215
2215
  }
2216
2216
  function createLargeNumberFormat(format, magnitude, postFix, locale) {
2217
2217
  const internalFormat = parseFormat(format || "#,##0");
2218
- const largeNumberFormat = internalFormat
2219
- .map((formatPart) => {
2220
- if (formatPart.type === "NUMBER") {
2221
- return [
2222
- {
2223
- ...formatPart,
2224
- format: {
2225
- ...formatPart.format,
2226
- magnitude,
2227
- decimalPart: undefined,
2228
- },
2229
- },
2230
- {
2231
- type: "STRING",
2232
- format: postFix,
2233
- },
2234
- ];
2218
+ const largeNumberFormat = [];
2219
+ for (let i = 0; i < internalFormat.length; i++) {
2220
+ const formatPart = internalFormat[i];
2221
+ if (formatPart.type !== "NUMBER") {
2222
+ largeNumberFormat.push(formatPart);
2223
+ continue;
2235
2224
  }
2236
- return formatPart;
2237
- })
2238
- .flat();
2225
+ largeNumberFormat.push({
2226
+ ...formatPart,
2227
+ format: {
2228
+ ...formatPart.format,
2229
+ magnitude,
2230
+ decimalPart: undefined,
2231
+ },
2232
+ });
2233
+ largeNumberFormat.push({
2234
+ type: "STRING",
2235
+ format: postFix,
2236
+ });
2237
+ const nextFormatPart = internalFormat[i + 1];
2238
+ if (nextFormatPart?.type === "STRING" && ["k", "m", "b"].includes(nextFormatPart.format)) {
2239
+ i++;
2240
+ }
2241
+ }
2239
2242
  return convertInternalFormatToFormat(largeNumberFormat);
2240
2243
  }
2241
2244
  function changeDecimalPlaces(format, step, locale) {
@@ -4254,71 +4257,72 @@ var CommandResult;
4254
4257
  CommandResult[CommandResult["InputAlreadyFocused"] = 30] = "InputAlreadyFocused";
4255
4258
  CommandResult[CommandResult["MaximumRangesReached"] = 31] = "MaximumRangesReached";
4256
4259
  CommandResult[CommandResult["MinimumRangesReached"] = 32] = "MinimumRangesReached";
4257
- CommandResult[CommandResult["InvalidChartDefinition"] = 33] = "InvalidChartDefinition";
4258
- CommandResult[CommandResult["InvalidDataSet"] = 34] = "InvalidDataSet";
4259
- CommandResult[CommandResult["InvalidLabelRange"] = 35] = "InvalidLabelRange";
4260
- CommandResult[CommandResult["InvalidScorecardKeyValue"] = 36] = "InvalidScorecardKeyValue";
4261
- CommandResult[CommandResult["InvalidScorecardBaseline"] = 37] = "InvalidScorecardBaseline";
4262
- CommandResult[CommandResult["InvalidGaugeDataRange"] = 38] = "InvalidGaugeDataRange";
4263
- CommandResult[CommandResult["EmptyGaugeRangeMin"] = 39] = "EmptyGaugeRangeMin";
4264
- CommandResult[CommandResult["GaugeRangeMinNaN"] = 40] = "GaugeRangeMinNaN";
4265
- CommandResult[CommandResult["EmptyGaugeRangeMax"] = 41] = "EmptyGaugeRangeMax";
4266
- CommandResult[CommandResult["GaugeRangeMaxNaN"] = 42] = "GaugeRangeMaxNaN";
4267
- CommandResult[CommandResult["GaugeRangeMinBiggerThanRangeMax"] = 43] = "GaugeRangeMinBiggerThanRangeMax";
4268
- CommandResult[CommandResult["GaugeLowerInflectionPointNaN"] = 44] = "GaugeLowerInflectionPointNaN";
4269
- CommandResult[CommandResult["GaugeUpperInflectionPointNaN"] = 45] = "GaugeUpperInflectionPointNaN";
4270
- CommandResult[CommandResult["GaugeLowerBiggerThanUpper"] = 46] = "GaugeLowerBiggerThanUpper";
4271
- CommandResult[CommandResult["InvalidAutofillSelection"] = 47] = "InvalidAutofillSelection";
4272
- CommandResult[CommandResult["WrongComposerSelection"] = 48] = "WrongComposerSelection";
4273
- CommandResult[CommandResult["MinBiggerThanMax"] = 49] = "MinBiggerThanMax";
4274
- CommandResult[CommandResult["LowerBiggerThanUpper"] = 50] = "LowerBiggerThanUpper";
4275
- CommandResult[CommandResult["MidBiggerThanMax"] = 51] = "MidBiggerThanMax";
4276
- CommandResult[CommandResult["MinBiggerThanMid"] = 52] = "MinBiggerThanMid";
4277
- CommandResult[CommandResult["FirstArgMissing"] = 53] = "FirstArgMissing";
4278
- CommandResult[CommandResult["SecondArgMissing"] = 54] = "SecondArgMissing";
4279
- CommandResult[CommandResult["MinNaN"] = 55] = "MinNaN";
4280
- CommandResult[CommandResult["MidNaN"] = 56] = "MidNaN";
4281
- CommandResult[CommandResult["MaxNaN"] = 57] = "MaxNaN";
4282
- CommandResult[CommandResult["ValueUpperInflectionNaN"] = 58] = "ValueUpperInflectionNaN";
4283
- CommandResult[CommandResult["ValueLowerInflectionNaN"] = 59] = "ValueLowerInflectionNaN";
4284
- CommandResult[CommandResult["MinInvalidFormula"] = 60] = "MinInvalidFormula";
4285
- CommandResult[CommandResult["MidInvalidFormula"] = 61] = "MidInvalidFormula";
4286
- CommandResult[CommandResult["MaxInvalidFormula"] = 62] = "MaxInvalidFormula";
4287
- CommandResult[CommandResult["ValueUpperInvalidFormula"] = 63] = "ValueUpperInvalidFormula";
4288
- CommandResult[CommandResult["ValueLowerInvalidFormula"] = 64] = "ValueLowerInvalidFormula";
4289
- CommandResult[CommandResult["InvalidSortZone"] = 65] = "InvalidSortZone";
4290
- CommandResult[CommandResult["WaitingSessionConfirmation"] = 66] = "WaitingSessionConfirmation";
4291
- CommandResult[CommandResult["MergeOverlap"] = 67] = "MergeOverlap";
4292
- CommandResult[CommandResult["TooManyHiddenElements"] = 68] = "TooManyHiddenElements";
4293
- CommandResult[CommandResult["Readonly"] = 69] = "Readonly";
4294
- CommandResult[CommandResult["InvalidViewportSize"] = 70] = "InvalidViewportSize";
4295
- CommandResult[CommandResult["InvalidScrollingDirection"] = 71] = "InvalidScrollingDirection";
4296
- CommandResult[CommandResult["FigureDoesNotExist"] = 72] = "FigureDoesNotExist";
4297
- CommandResult[CommandResult["InvalidConditionalFormatId"] = 73] = "InvalidConditionalFormatId";
4298
- CommandResult[CommandResult["InvalidCellPopover"] = 74] = "InvalidCellPopover";
4299
- CommandResult[CommandResult["EmptyTarget"] = 75] = "EmptyTarget";
4300
- CommandResult[CommandResult["InvalidFreezeQuantity"] = 76] = "InvalidFreezeQuantity";
4301
- CommandResult[CommandResult["FrozenPaneOverlap"] = 77] = "FrozenPaneOverlap";
4302
- CommandResult[CommandResult["ValuesNotChanged"] = 78] = "ValuesNotChanged";
4303
- CommandResult[CommandResult["InvalidFilterZone"] = 79] = "InvalidFilterZone";
4304
- CommandResult[CommandResult["FilterOverlap"] = 80] = "FilterOverlap";
4305
- CommandResult[CommandResult["FilterNotFound"] = 81] = "FilterNotFound";
4306
- CommandResult[CommandResult["MergeInFilter"] = 82] = "MergeInFilter";
4307
- CommandResult[CommandResult["NonContinuousTargets"] = 83] = "NonContinuousTargets";
4308
- CommandResult[CommandResult["DuplicatedFigureId"] = 84] = "DuplicatedFigureId";
4309
- CommandResult[CommandResult["InvalidSelectionStep"] = 85] = "InvalidSelectionStep";
4310
- CommandResult[CommandResult["DuplicatedChartId"] = 86] = "DuplicatedChartId";
4311
- CommandResult[CommandResult["ChartDoesNotExist"] = 87] = "ChartDoesNotExist";
4312
- CommandResult[CommandResult["InvalidHeaderIndex"] = 88] = "InvalidHeaderIndex";
4313
- CommandResult[CommandResult["InvalidQuantity"] = 89] = "InvalidQuantity";
4314
- CommandResult[CommandResult["MoreThanOneColumnSelected"] = 90] = "MoreThanOneColumnSelected";
4315
- CommandResult[CommandResult["EmptySplitSeparator"] = 91] = "EmptySplitSeparator";
4316
- CommandResult[CommandResult["SplitWillOverwriteContent"] = 92] = "SplitWillOverwriteContent";
4317
- CommandResult[CommandResult["NoSplitSeparatorInSelection"] = 93] = "NoSplitSeparatorInSelection";
4318
- CommandResult[CommandResult["NoActiveSheet"] = 94] = "NoActiveSheet";
4319
- CommandResult[CommandResult["InvalidLocale"] = 95] = "InvalidLocale";
4320
- CommandResult[CommandResult["AlreadyInPaintingFormatMode"] = 96] = "AlreadyInPaintingFormatMode";
4321
- CommandResult[CommandResult["NoChanges"] = 97] = "NoChanges";
4260
+ CommandResult[CommandResult["InvalidInputId"] = 33] = "InvalidInputId";
4261
+ CommandResult[CommandResult["InvalidChartDefinition"] = 34] = "InvalidChartDefinition";
4262
+ CommandResult[CommandResult["InvalidDataSet"] = 35] = "InvalidDataSet";
4263
+ CommandResult[CommandResult["InvalidLabelRange"] = 36] = "InvalidLabelRange";
4264
+ CommandResult[CommandResult["InvalidScorecardKeyValue"] = 37] = "InvalidScorecardKeyValue";
4265
+ CommandResult[CommandResult["InvalidScorecardBaseline"] = 38] = "InvalidScorecardBaseline";
4266
+ CommandResult[CommandResult["InvalidGaugeDataRange"] = 39] = "InvalidGaugeDataRange";
4267
+ CommandResult[CommandResult["EmptyGaugeRangeMin"] = 40] = "EmptyGaugeRangeMin";
4268
+ CommandResult[CommandResult["GaugeRangeMinNaN"] = 41] = "GaugeRangeMinNaN";
4269
+ CommandResult[CommandResult["EmptyGaugeRangeMax"] = 42] = "EmptyGaugeRangeMax";
4270
+ CommandResult[CommandResult["GaugeRangeMaxNaN"] = 43] = "GaugeRangeMaxNaN";
4271
+ CommandResult[CommandResult["GaugeRangeMinBiggerThanRangeMax"] = 44] = "GaugeRangeMinBiggerThanRangeMax";
4272
+ CommandResult[CommandResult["GaugeLowerInflectionPointNaN"] = 45] = "GaugeLowerInflectionPointNaN";
4273
+ CommandResult[CommandResult["GaugeUpperInflectionPointNaN"] = 46] = "GaugeUpperInflectionPointNaN";
4274
+ CommandResult[CommandResult["GaugeLowerBiggerThanUpper"] = 47] = "GaugeLowerBiggerThanUpper";
4275
+ CommandResult[CommandResult["InvalidAutofillSelection"] = 48] = "InvalidAutofillSelection";
4276
+ CommandResult[CommandResult["WrongComposerSelection"] = 49] = "WrongComposerSelection";
4277
+ CommandResult[CommandResult["MinBiggerThanMax"] = 50] = "MinBiggerThanMax";
4278
+ CommandResult[CommandResult["LowerBiggerThanUpper"] = 51] = "LowerBiggerThanUpper";
4279
+ CommandResult[CommandResult["MidBiggerThanMax"] = 52] = "MidBiggerThanMax";
4280
+ CommandResult[CommandResult["MinBiggerThanMid"] = 53] = "MinBiggerThanMid";
4281
+ CommandResult[CommandResult["FirstArgMissing"] = 54] = "FirstArgMissing";
4282
+ CommandResult[CommandResult["SecondArgMissing"] = 55] = "SecondArgMissing";
4283
+ CommandResult[CommandResult["MinNaN"] = 56] = "MinNaN";
4284
+ CommandResult[CommandResult["MidNaN"] = 57] = "MidNaN";
4285
+ CommandResult[CommandResult["MaxNaN"] = 58] = "MaxNaN";
4286
+ CommandResult[CommandResult["ValueUpperInflectionNaN"] = 59] = "ValueUpperInflectionNaN";
4287
+ CommandResult[CommandResult["ValueLowerInflectionNaN"] = 60] = "ValueLowerInflectionNaN";
4288
+ CommandResult[CommandResult["MinInvalidFormula"] = 61] = "MinInvalidFormula";
4289
+ CommandResult[CommandResult["MidInvalidFormula"] = 62] = "MidInvalidFormula";
4290
+ CommandResult[CommandResult["MaxInvalidFormula"] = 63] = "MaxInvalidFormula";
4291
+ CommandResult[CommandResult["ValueUpperInvalidFormula"] = 64] = "ValueUpperInvalidFormula";
4292
+ CommandResult[CommandResult["ValueLowerInvalidFormula"] = 65] = "ValueLowerInvalidFormula";
4293
+ CommandResult[CommandResult["InvalidSortZone"] = 66] = "InvalidSortZone";
4294
+ CommandResult[CommandResult["WaitingSessionConfirmation"] = 67] = "WaitingSessionConfirmation";
4295
+ CommandResult[CommandResult["MergeOverlap"] = 68] = "MergeOverlap";
4296
+ CommandResult[CommandResult["TooManyHiddenElements"] = 69] = "TooManyHiddenElements";
4297
+ CommandResult[CommandResult["Readonly"] = 70] = "Readonly";
4298
+ CommandResult[CommandResult["InvalidViewportSize"] = 71] = "InvalidViewportSize";
4299
+ CommandResult[CommandResult["InvalidScrollingDirection"] = 72] = "InvalidScrollingDirection";
4300
+ CommandResult[CommandResult["FigureDoesNotExist"] = 73] = "FigureDoesNotExist";
4301
+ CommandResult[CommandResult["InvalidConditionalFormatId"] = 74] = "InvalidConditionalFormatId";
4302
+ CommandResult[CommandResult["InvalidCellPopover"] = 75] = "InvalidCellPopover";
4303
+ CommandResult[CommandResult["EmptyTarget"] = 76] = "EmptyTarget";
4304
+ CommandResult[CommandResult["InvalidFreezeQuantity"] = 77] = "InvalidFreezeQuantity";
4305
+ CommandResult[CommandResult["FrozenPaneOverlap"] = 78] = "FrozenPaneOverlap";
4306
+ CommandResult[CommandResult["ValuesNotChanged"] = 79] = "ValuesNotChanged";
4307
+ CommandResult[CommandResult["InvalidFilterZone"] = 80] = "InvalidFilterZone";
4308
+ CommandResult[CommandResult["FilterOverlap"] = 81] = "FilterOverlap";
4309
+ CommandResult[CommandResult["FilterNotFound"] = 82] = "FilterNotFound";
4310
+ CommandResult[CommandResult["MergeInFilter"] = 83] = "MergeInFilter";
4311
+ CommandResult[CommandResult["NonContinuousTargets"] = 84] = "NonContinuousTargets";
4312
+ CommandResult[CommandResult["DuplicatedFigureId"] = 85] = "DuplicatedFigureId";
4313
+ CommandResult[CommandResult["InvalidSelectionStep"] = 86] = "InvalidSelectionStep";
4314
+ CommandResult[CommandResult["DuplicatedChartId"] = 87] = "DuplicatedChartId";
4315
+ CommandResult[CommandResult["ChartDoesNotExist"] = 88] = "ChartDoesNotExist";
4316
+ CommandResult[CommandResult["InvalidHeaderIndex"] = 89] = "InvalidHeaderIndex";
4317
+ CommandResult[CommandResult["InvalidQuantity"] = 90] = "InvalidQuantity";
4318
+ CommandResult[CommandResult["MoreThanOneColumnSelected"] = 91] = "MoreThanOneColumnSelected";
4319
+ CommandResult[CommandResult["EmptySplitSeparator"] = 92] = "EmptySplitSeparator";
4320
+ CommandResult[CommandResult["SplitWillOverwriteContent"] = 93] = "SplitWillOverwriteContent";
4321
+ CommandResult[CommandResult["NoSplitSeparatorInSelection"] = 94] = "NoSplitSeparatorInSelection";
4322
+ CommandResult[CommandResult["NoActiveSheet"] = 95] = "NoActiveSheet";
4323
+ CommandResult[CommandResult["InvalidLocale"] = 96] = "InvalidLocale";
4324
+ CommandResult[CommandResult["AlreadyInPaintingFormatMode"] = 97] = "AlreadyInPaintingFormatMode";
4325
+ CommandResult[CommandResult["NoChanges"] = 98] = "NoChanges";
4322
4326
  })(CommandResult || (CommandResult = {}));
4323
4327
 
4324
4328
  const borderStyles = ["thin", "medium", "thick", "dashed", "dotted"];
@@ -15967,14 +15971,8 @@ function createDataSets(getters, dataSetsString, sheetId, dataSetsHaveTitle) {
15967
15971
  : undefined));
15968
15972
  }
15969
15973
  }
15970
- else if (zone.left === zone.right && zone.top === zone.bottom) {
15971
- // A single cell. If it's only the title, the dataset is not added.
15972
- if (!dataSetsHaveTitle) {
15973
- dataSets.push(createDataSet(getters, dataSetSheetId, zone, undefined));
15974
- }
15975
- }
15976
15974
  else {
15977
- /* 1 row or 1 column */
15975
+ /* 1 cell, 1 row or 1 column */
15978
15976
  dataSets.push(createDataSet(getters, dataSetSheetId, zone, dataSetsHaveTitle
15979
15977
  ? {
15980
15978
  top: zone.top,
@@ -16023,8 +16021,10 @@ function toExcelDataset(getters, ds) {
16023
16021
  }
16024
16022
  const dataRange = ds.dataRange.clone({ zone: dataZone });
16025
16023
  return {
16026
- label: ds.labelCell ? getters.getRangeString(ds.labelCell, "forceSheetReference") : undefined,
16027
- range: getters.getRangeString(dataRange, "forceSheetReference"),
16024
+ label: ds.labelCell
16025
+ ? getters.getRangeString(ds.labelCell, "forceSheetReference", true)
16026
+ : undefined,
16027
+ range: getters.getRangeString(dataRange, "forceSheetReference", true),
16028
16028
  };
16029
16029
  }
16030
16030
  function toExcelLabelRange(getters, labelRange, shouldRemoveFirstLabel) {
@@ -16037,7 +16037,7 @@ function toExcelLabelRange(getters, labelRange, shouldRemoveFirstLabel) {
16037
16037
  zone.top = zone.top + 1;
16038
16038
  }
16039
16039
  const range = labelRange.clone({ zone });
16040
- return getters.getRangeString(range, "forceSheetReference");
16040
+ return getters.getRangeString(range, "forceSheetReference", true);
16041
16041
  }
16042
16042
  /**
16043
16043
  * Transform a chart definition which supports dataSets (dataSets and LabelRange)
@@ -16103,11 +16103,11 @@ function checkDataset(definition) {
16103
16103
  if (definition.dataSets) {
16104
16104
  const invalidRanges = definition.dataSets.find((range) => !rangeReference.test(range)) !== undefined;
16105
16105
  if (invalidRanges) {
16106
- return 34 /* CommandResult.InvalidDataSet */;
16106
+ return 35 /* CommandResult.InvalidDataSet */;
16107
16107
  }
16108
16108
  const zones = definition.dataSets.map(toUnboundedZone);
16109
16109
  if (zones.some((zone) => zone.top !== zone.bottom && isFullRow(zone))) {
16110
- return 34 /* CommandResult.InvalidDataSet */;
16110
+ return 35 /* CommandResult.InvalidDataSet */;
16111
16111
  }
16112
16112
  }
16113
16113
  return 0 /* CommandResult.Success */;
@@ -16116,7 +16116,7 @@ function checkLabelRange(definition) {
16116
16116
  if (definition.labelRange) {
16117
16117
  const invalidLabels = !rangeReference.test(definition.labelRange || "");
16118
16118
  if (invalidLabels) {
16119
- return 35 /* CommandResult.InvalidLabelRange */;
16119
+ return 36 /* CommandResult.InvalidLabelRange */;
16120
16120
  }
16121
16121
  }
16122
16122
  return 0 /* CommandResult.Success */;
@@ -16203,22 +16203,22 @@ function getChartPositionAtCenterOfViewport(getters, chartSize) {
16203
16203
  const CfTerms = {
16204
16204
  Errors: {
16205
16205
  [26 /* CommandResult.InvalidRange */]: _lt("The range is invalid"),
16206
- [53 /* CommandResult.FirstArgMissing */]: _lt("The argument is missing. Please provide a value"),
16207
- [54 /* CommandResult.SecondArgMissing */]: _lt("The second argument is missing. Please provide a value"),
16208
- [55 /* CommandResult.MinNaN */]: _lt("The minpoint must be a number"),
16209
- [56 /* CommandResult.MidNaN */]: _lt("The midpoint must be a number"),
16210
- [57 /* CommandResult.MaxNaN */]: _lt("The maxpoint must be a number"),
16211
- [58 /* CommandResult.ValueUpperInflectionNaN */]: _lt("The first value must be a number"),
16212
- [59 /* CommandResult.ValueLowerInflectionNaN */]: _lt("The second value must be a number"),
16213
- [49 /* CommandResult.MinBiggerThanMax */]: _lt("Minimum must be smaller then Maximum"),
16214
- [52 /* CommandResult.MinBiggerThanMid */]: _lt("Minimum must be smaller then Midpoint"),
16215
- [51 /* CommandResult.MidBiggerThanMax */]: _lt("Midpoint must be smaller then Maximum"),
16216
- [50 /* CommandResult.LowerBiggerThanUpper */]: _lt("Lower inflection point must be smaller than upper inflection point"),
16217
- [60 /* CommandResult.MinInvalidFormula */]: _lt("Invalid Minpoint formula"),
16218
- [62 /* CommandResult.MaxInvalidFormula */]: _lt("Invalid Maxpoint formula"),
16219
- [61 /* CommandResult.MidInvalidFormula */]: _lt("Invalid Midpoint formula"),
16220
- [63 /* CommandResult.ValueUpperInvalidFormula */]: _lt("Invalid upper inflection point formula"),
16221
- [64 /* CommandResult.ValueLowerInvalidFormula */]: _lt("Invalid lower inflection point formula"),
16206
+ [54 /* CommandResult.FirstArgMissing */]: _lt("The argument is missing. Please provide a value"),
16207
+ [55 /* CommandResult.SecondArgMissing */]: _lt("The second argument is missing. Please provide a value"),
16208
+ [56 /* CommandResult.MinNaN */]: _lt("The minpoint must be a number"),
16209
+ [57 /* CommandResult.MidNaN */]: _lt("The midpoint must be a number"),
16210
+ [58 /* CommandResult.MaxNaN */]: _lt("The maxpoint must be a number"),
16211
+ [59 /* CommandResult.ValueUpperInflectionNaN */]: _lt("The first value must be a number"),
16212
+ [60 /* CommandResult.ValueLowerInflectionNaN */]: _lt("The second value must be a number"),
16213
+ [50 /* CommandResult.MinBiggerThanMax */]: _lt("Minimum must be smaller then Maximum"),
16214
+ [53 /* CommandResult.MinBiggerThanMid */]: _lt("Minimum must be smaller then Midpoint"),
16215
+ [52 /* CommandResult.MidBiggerThanMax */]: _lt("Midpoint must be smaller then Maximum"),
16216
+ [51 /* CommandResult.LowerBiggerThanUpper */]: _lt("Lower inflection point must be smaller than upper inflection point"),
16217
+ [61 /* CommandResult.MinInvalidFormula */]: _lt("Invalid Minpoint formula"),
16218
+ [63 /* CommandResult.MaxInvalidFormula */]: _lt("Invalid Maxpoint formula"),
16219
+ [62 /* CommandResult.MidInvalidFormula */]: _lt("Invalid Midpoint formula"),
16220
+ [64 /* CommandResult.ValueUpperInvalidFormula */]: _lt("Invalid upper inflection point formula"),
16221
+ [65 /* CommandResult.ValueLowerInvalidFormula */]: _lt("Invalid lower inflection point formula"),
16222
16222
  [25 /* CommandResult.EmptyRange */]: _lt("A range needs to be defined"),
16223
16223
  Unexpected: _lt("The rule is invalid for an unknown reason"),
16224
16224
  },
@@ -16246,20 +16246,20 @@ const ChartTerms = {
16246
16246
  Errors: {
16247
16247
  Unexpected: _lt("The chart definition is invalid for an unknown reason"),
16248
16248
  // BASIC CHART ERRORS (LINE | BAR | PIE)
16249
- [34 /* CommandResult.InvalidDataSet */]: _lt("The dataset is invalid"),
16250
- [35 /* CommandResult.InvalidLabelRange */]: _lt("Labels are invalid"),
16249
+ [35 /* CommandResult.InvalidDataSet */]: _lt("The dataset is invalid"),
16250
+ [36 /* CommandResult.InvalidLabelRange */]: _lt("Labels are invalid"),
16251
16251
  // SCORECARD CHART ERRORS
16252
- [36 /* CommandResult.InvalidScorecardKeyValue */]: _lt("The key value is invalid"),
16253
- [37 /* CommandResult.InvalidScorecardBaseline */]: _lt("The baseline value is invalid"),
16252
+ [37 /* CommandResult.InvalidScorecardKeyValue */]: _lt("The key value is invalid"),
16253
+ [38 /* CommandResult.InvalidScorecardBaseline */]: _lt("The baseline value is invalid"),
16254
16254
  // GAUGE CHART ERRORS
16255
- [38 /* CommandResult.InvalidGaugeDataRange */]: _lt("The data range is invalid"),
16256
- [39 /* CommandResult.EmptyGaugeRangeMin */]: _lt("A minimum range limit value is needed"),
16257
- [40 /* CommandResult.GaugeRangeMinNaN */]: _lt("The minimum range limit value must be a number"),
16258
- [41 /* CommandResult.EmptyGaugeRangeMax */]: _lt("A maximum range limit value is needed"),
16259
- [42 /* CommandResult.GaugeRangeMaxNaN */]: _lt("The maximum range limit value must be a number"),
16260
- [43 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */]: _lt("Minimum range limit must be smaller than maximum range limit"),
16261
- [44 /* CommandResult.GaugeLowerInflectionPointNaN */]: _lt("The lower inflection point value must be a number"),
16262
- [45 /* CommandResult.GaugeUpperInflectionPointNaN */]: _lt("The upper inflection point value must be a number"),
16255
+ [39 /* CommandResult.InvalidGaugeDataRange */]: _lt("The data range is invalid"),
16256
+ [40 /* CommandResult.EmptyGaugeRangeMin */]: _lt("A minimum range limit value is needed"),
16257
+ [41 /* CommandResult.GaugeRangeMinNaN */]: _lt("The minimum range limit value must be a number"),
16258
+ [42 /* CommandResult.EmptyGaugeRangeMax */]: _lt("A maximum range limit value is needed"),
16259
+ [43 /* CommandResult.GaugeRangeMaxNaN */]: _lt("The maximum range limit value must be a number"),
16260
+ [44 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */]: _lt("Minimum range limit must be smaller than maximum range limit"),
16261
+ [45 /* CommandResult.GaugeLowerInflectionPointNaN */]: _lt("The lower inflection point value must be a number"),
16262
+ [46 /* CommandResult.GaugeUpperInflectionPointNaN */]: _lt("The upper inflection point value must be a number"),
16263
16263
  },
16264
16264
  };
16265
16265
  const CustomCurrencyTerms = {
@@ -16269,9 +16269,9 @@ const MergeErrorMessage = _lt("Merged cells are preventing this operation. Unmer
16269
16269
  const SplitToColumnsTerms = {
16270
16270
  Errors: {
16271
16271
  Unexpected: _lt("Cannot split the selection for an unknown reason"),
16272
- [93 /* CommandResult.NoSplitSeparatorInSelection */]: _lt("There is no match for the selected separator in the selection"),
16273
- [90 /* CommandResult.MoreThanOneColumnSelected */]: _lt("Only a selection from a single column can be split"),
16274
- [92 /* CommandResult.SplitWillOverwriteContent */]: _lt("Splitting will overwrite existing content"),
16272
+ [94 /* CommandResult.NoSplitSeparatorInSelection */]: _lt("There is no match for the selected separator in the selection"),
16273
+ [91 /* CommandResult.MoreThanOneColumnSelected */]: _lt("Only a selection from a single column can be split"),
16274
+ [93 /* CommandResult.SplitWillOverwriteContent */]: _lt("Splitting will overwrite existing content"),
16275
16275
  },
16276
16276
  };
16277
16277
 
@@ -16574,7 +16574,7 @@ class BarChart extends AbstractChart {
16574
16574
  return undefined;
16575
16575
  const dataSets = this.dataSets
16576
16576
  .map((ds) => toExcelDataset(this.getters, ds))
16577
- .filter((ds) => ds.range !== ""); // && range !== INCORRECT_RANGE_STRING ? show incorrect #ref ?
16577
+ .filter((ds) => ds.range !== "" && ds.range !== INCORRECT_RANGE_STRING);
16578
16578
  const labelRange = toExcelLabelRange(this.getters, this.labelRange, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
16579
16579
  return {
16580
16580
  ...this.getDefinition(),
@@ -16676,7 +16676,7 @@ function createBarChartRuntime(chart, getters) {
16676
16676
 
16677
16677
  function isDataRangeValid(definition) {
16678
16678
  return definition.dataRange && !rangeReference.test(definition.dataRange)
16679
- ? 38 /* CommandResult.InvalidGaugeDataRange */
16679
+ ? 39 /* CommandResult.InvalidGaugeDataRange */
16680
16680
  : 0 /* CommandResult.Success */;
16681
16681
  }
16682
16682
  function checkRangeLimits(check, batchValidations) {
@@ -16708,7 +16708,7 @@ function checkInflectionPointsValue(check, batchValidations) {
16708
16708
  function checkRangeMinBiggerThanRangeMax(definition) {
16709
16709
  if (definition.sectionRule) {
16710
16710
  if (Number(definition.sectionRule.rangeMin) >= Number(definition.sectionRule.rangeMax)) {
16711
- return 43 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */;
16711
+ return 44 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */;
16712
16712
  }
16713
16713
  }
16714
16714
  return 0 /* CommandResult.Success */;
@@ -16717,9 +16717,9 @@ function checkEmpty(value, valueName) {
16717
16717
  if (value === "") {
16718
16718
  switch (valueName) {
16719
16719
  case "rangeMin":
16720
- return 39 /* CommandResult.EmptyGaugeRangeMin */;
16720
+ return 40 /* CommandResult.EmptyGaugeRangeMin */;
16721
16721
  case "rangeMax":
16722
- return 41 /* CommandResult.EmptyGaugeRangeMax */;
16722
+ return 42 /* CommandResult.EmptyGaugeRangeMax */;
16723
16723
  }
16724
16724
  }
16725
16725
  return 0 /* CommandResult.Success */;
@@ -16728,13 +16728,13 @@ function checkNaN(value, valueName) {
16728
16728
  if (isNaN(value)) {
16729
16729
  switch (valueName) {
16730
16730
  case "rangeMin":
16731
- return 40 /* CommandResult.GaugeRangeMinNaN */;
16731
+ return 41 /* CommandResult.GaugeRangeMinNaN */;
16732
16732
  case "rangeMax":
16733
- return 42 /* CommandResult.GaugeRangeMaxNaN */;
16733
+ return 43 /* CommandResult.GaugeRangeMaxNaN */;
16734
16734
  case "lowerInflectionPointValue":
16735
- return 44 /* CommandResult.GaugeLowerInflectionPointNaN */;
16735
+ return 45 /* CommandResult.GaugeLowerInflectionPointNaN */;
16736
16736
  case "upperInflectionPointValue":
16737
- return 45 /* CommandResult.GaugeUpperInflectionPointNaN */;
16737
+ return 46 /* CommandResult.GaugeUpperInflectionPointNaN */;
16738
16738
  }
16739
16739
  }
16740
16740
  return 0 /* CommandResult.Success */;
@@ -17162,7 +17162,7 @@ class LineChart extends AbstractChart {
17162
17162
  return undefined;
17163
17163
  const dataSets = this.dataSets
17164
17164
  .map((ds) => toExcelDataset(this.getters, ds))
17165
- .filter((ds) => ds.range !== ""); // && range !== INCORRECT_RANGE_STRING ? show incorrect #ref ?
17165
+ .filter((ds) => ds.range !== "" && ds.range !== INCORRECT_RANGE_STRING);
17166
17166
  const labelRange = toExcelLabelRange(this.getters, this.labelRange, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
17167
17167
  return {
17168
17168
  ...this.getDefinition(),
@@ -17449,7 +17449,7 @@ class PieChart extends AbstractChart {
17449
17449
  return undefined;
17450
17450
  const dataSets = this.dataSets
17451
17451
  .map((ds) => toExcelDataset(this.getters, ds))
17452
- .filter((ds) => ds.range !== ""); // && range !== INCORRECT_RANGE_STRING ? show incorrect #ref ?
17452
+ .filter((ds) => ds.range !== "" && ds.range !== INCORRECT_RANGE_STRING);
17453
17453
  const labelRange = toExcelLabelRange(this.getters, this.labelRange, shouldRemoveFirstLabel(this.labelRange, this.dataSets[0], this.dataSetsHaveTitle));
17454
17454
  return {
17455
17455
  ...this.getDefinition(),
@@ -17530,12 +17530,12 @@ function createPieChartRuntime(chart, getters) {
17530
17530
 
17531
17531
  function checkKeyValue(definition) {
17532
17532
  return definition.keyValue && !rangeReference.test(definition.keyValue)
17533
- ? 36 /* CommandResult.InvalidScorecardKeyValue */
17533
+ ? 37 /* CommandResult.InvalidScorecardKeyValue */
17534
17534
  : 0 /* CommandResult.Success */;
17535
17535
  }
17536
17536
  function checkBaseline(definition) {
17537
17537
  return definition.baseline && !rangeReference.test(definition.baseline)
17538
- ? 37 /* CommandResult.InvalidScorecardBaseline */
17538
+ ? 38 /* CommandResult.InvalidScorecardBaseline */
17539
17539
  : 0 /* CommandResult.Success */;
17540
17540
  }
17541
17541
  class ScorecardChart extends AbstractChart {
@@ -18062,7 +18062,7 @@ const AddMergeInteractiveContent = {
18062
18062
  };
18063
18063
  function interactiveAddMerge(env, sheetId, target) {
18064
18064
  const result = env.model.dispatch("ADD_MERGE", { sheetId, target });
18065
- if (result.isCancelledBecause(82 /* CommandResult.MergeInFilter */)) {
18065
+ if (result.isCancelledBecause(83 /* CommandResult.MergeInFilter */)) {
18066
18066
  env.raiseError(AddMergeInteractiveContent.MergeInFilter);
18067
18067
  }
18068
18068
  else if (result.isCancelledBecause(3 /* CommandResult.MergeIsDestructive */)) {
@@ -18089,7 +18089,7 @@ function handlePasteResult(env, result) {
18089
18089
  else if (result.reasons.includes(23 /* CommandResult.WrongFigurePasteOption */)) {
18090
18090
  env.raiseError(PasteInteractiveContent.wrongFigurePasteOption);
18091
18091
  }
18092
- else if (result.reasons.includes(77 /* CommandResult.FrozenPaneOverlap */)) {
18092
+ else if (result.reasons.includes(78 /* CommandResult.FrozenPaneOverlap */)) {
18093
18093
  env.raiseError(PasteInteractiveContent.frozenPaneOverlap);
18094
18094
  }
18095
18095
  }
@@ -19264,7 +19264,7 @@ function interactiveSortSelection(env, sheetId, anchor, zone, sortDirection) {
19264
19264
  });
19265
19265
  }
19266
19266
  }
19267
- if (result.isCancelledBecause(65 /* CommandResult.InvalidSortZone */)) {
19267
+ if (result.isCancelledBecause(66 /* CommandResult.InvalidSortZone */)) {
19268
19268
  const { col, row } = anchor;
19269
19269
  env.model.selection.selectZone({ cell: { col, row }, zone });
19270
19270
  env.raiseError(_lt("Cannot sort. To sort, select only cells or only merges that have the same size."));
@@ -19278,13 +19278,13 @@ const AddFilterInteractiveContent = {
19278
19278
  };
19279
19279
  function interactiveAddFilter(env, sheetId, target) {
19280
19280
  const result = env.model.dispatch("CREATE_FILTER_TABLE", { target, sheetId });
19281
- if (result.isCancelledBecause(80 /* CommandResult.FilterOverlap */)) {
19281
+ if (result.isCancelledBecause(81 /* CommandResult.FilterOverlap */)) {
19282
19282
  env.raiseError(AddFilterInteractiveContent.filterOverlap);
19283
19283
  }
19284
- else if (result.isCancelledBecause(82 /* CommandResult.MergeInFilter */)) {
19284
+ else if (result.isCancelledBecause(83 /* CommandResult.MergeInFilter */)) {
19285
19285
  env.raiseError(AddFilterInteractiveContent.mergeInFilter);
19286
19286
  }
19287
- else if (result.isCancelledBecause(83 /* CommandResult.NonContinuousTargets */)) {
19287
+ else if (result.isCancelledBecause(84 /* CommandResult.NonContinuousTargets */)) {
19288
19288
  env.raiseError(AddFilterInteractiveContent.nonContinuousTargets);
19289
19289
  }
19290
19290
  }
@@ -19721,7 +19721,7 @@ function interactiveFreezeColumnsRows(env, dimension, base) {
19721
19721
  const sheetId = env.model.getters.getActiveSheetId();
19722
19722
  const cmd = dimension === "COL" ? "FREEZE_COLUMNS" : "FREEZE_ROWS";
19723
19723
  const result = env.model.dispatch(cmd, { sheetId, quantity: base });
19724
- if (result.isCancelledBecause(67 /* CommandResult.MergeOverlap */)) {
19724
+ if (result.isCancelledBecause(68 /* CommandResult.MergeOverlap */)) {
19725
19725
  env.raiseError(MergeErrorMessage);
19726
19726
  }
19727
19727
  }
@@ -20861,10 +20861,10 @@ class LineBarPieConfigPanel extends Component {
20861
20861
  return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
20862
20862
  }
20863
20863
  get isDatasetInvalid() {
20864
- return !!this.state.datasetDispatchResult?.isCancelledBecause(34 /* CommandResult.InvalidDataSet */);
20864
+ return !!this.state.datasetDispatchResult?.isCancelledBecause(35 /* CommandResult.InvalidDataSet */);
20865
20865
  }
20866
20866
  get isLabelInvalid() {
20867
- return !!this.state.labelsDispatchResult?.isCancelledBecause(35 /* CommandResult.InvalidLabelRange */);
20867
+ return !!this.state.labelsDispatchResult?.isCancelledBecause(36 /* CommandResult.InvalidLabelRange */);
20868
20868
  }
20869
20869
  onUpdateDataSetsHaveTitle(ev) {
20870
20870
  this.props.updateChart(this.props.figureId, {
@@ -21538,7 +21538,7 @@ class GaugeChartConfigPanel extends Component {
21538
21538
  return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
21539
21539
  }
21540
21540
  get isDataRangeInvalid() {
21541
- return !!this.state.dataRangeDispatchResult?.isCancelledBecause(38 /* CommandResult.InvalidGaugeDataRange */);
21541
+ return !!this.state.dataRangeDispatchResult?.isCancelledBecause(39 /* CommandResult.InvalidGaugeDataRange */);
21542
21542
  }
21543
21543
  onDataRangeChanged(ranges) {
21544
21544
  this.dataRange = ranges[0];
@@ -21622,25 +21622,25 @@ class GaugeChartDesignPanel extends Component {
21622
21622
  });
21623
21623
  }
21624
21624
  isRangeMinInvalid() {
21625
- return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(39 /* CommandResult.EmptyGaugeRangeMin */) ||
21626
- this.state.sectionRuleDispatchResult?.isCancelledBecause(40 /* CommandResult.GaugeRangeMinNaN */) ||
21627
- this.state.sectionRuleDispatchResult?.isCancelledBecause(43 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */));
21625
+ return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(40 /* CommandResult.EmptyGaugeRangeMin */) ||
21626
+ this.state.sectionRuleDispatchResult?.isCancelledBecause(41 /* CommandResult.GaugeRangeMinNaN */) ||
21627
+ this.state.sectionRuleDispatchResult?.isCancelledBecause(44 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */));
21628
21628
  }
21629
21629
  isRangeMaxInvalid() {
21630
- return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(41 /* CommandResult.EmptyGaugeRangeMax */) ||
21631
- this.state.sectionRuleDispatchResult?.isCancelledBecause(42 /* CommandResult.GaugeRangeMaxNaN */) ||
21632
- this.state.sectionRuleDispatchResult?.isCancelledBecause(43 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */));
21630
+ return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(42 /* CommandResult.EmptyGaugeRangeMax */) ||
21631
+ this.state.sectionRuleDispatchResult?.isCancelledBecause(43 /* CommandResult.GaugeRangeMaxNaN */) ||
21632
+ this.state.sectionRuleDispatchResult?.isCancelledBecause(44 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */));
21633
21633
  }
21634
21634
  // ---------------------------------------------------------------------------
21635
21635
  // COLOR_SECTION_TEMPLATE
21636
21636
  // ---------------------------------------------------------------------------
21637
21637
  get isLowerInflectionPointInvalid() {
21638
- return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(44 /* CommandResult.GaugeLowerInflectionPointNaN */) ||
21639
- this.state.sectionRuleDispatchResult?.isCancelledBecause(46 /* CommandResult.GaugeLowerBiggerThanUpper */));
21638
+ return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(45 /* CommandResult.GaugeLowerInflectionPointNaN */) ||
21639
+ this.state.sectionRuleDispatchResult?.isCancelledBecause(47 /* CommandResult.GaugeLowerBiggerThanUpper */));
21640
21640
  }
21641
21641
  get isUpperInflectionPointInvalid() {
21642
- return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(45 /* CommandResult.GaugeUpperInflectionPointNaN */) ||
21643
- this.state.sectionRuleDispatchResult?.isCancelledBecause(46 /* CommandResult.GaugeLowerBiggerThanUpper */));
21642
+ return !!(this.state.sectionRuleDispatchResult?.isCancelledBecause(46 /* CommandResult.GaugeUpperInflectionPointNaN */) ||
21643
+ this.state.sectionRuleDispatchResult?.isCancelledBecause(47 /* CommandResult.GaugeLowerBiggerThanUpper */));
21644
21644
  }
21645
21645
  updateSectionColor(target, color) {
21646
21646
  const sectionRule = deepCopy(this.state.sectionRule);
@@ -21728,10 +21728,10 @@ class ScorecardChartConfigPanel extends Component {
21728
21728
  return cancelledReasons.map((error) => ChartTerms.Errors[error] || ChartTerms.Errors.Unexpected);
21729
21729
  }
21730
21730
  get isKeyValueInvalid() {
21731
- return !!this.state.keyValueDispatchResult?.isCancelledBecause(36 /* CommandResult.InvalidScorecardKeyValue */);
21731
+ return !!this.state.keyValueDispatchResult?.isCancelledBecause(37 /* CommandResult.InvalidScorecardKeyValue */);
21732
21732
  }
21733
21733
  get isBaselineInvalid() {
21734
- return !!this.state.keyValueDispatchResult?.isCancelledBecause(37 /* CommandResult.InvalidScorecardBaseline */);
21734
+ return !!this.state.keyValueDispatchResult?.isCancelledBecause(38 /* CommandResult.InvalidScorecardBaseline */);
21735
21735
  }
21736
21736
  onKeyValueRangeChanged(ranges) {
21737
21737
  this.keyValue = ranges[0];
@@ -22626,10 +22626,10 @@ class ConditionalFormattingPanel extends Component {
22626
22626
  * Cell Is Rule
22627
22627
  ****************************************************************************/
22628
22628
  get isValue1Invalid() {
22629
- return !!this.state.errors?.includes(53 /* CommandResult.FirstArgMissing */);
22629
+ return !!this.state.errors?.includes(54 /* CommandResult.FirstArgMissing */);
22630
22630
  }
22631
22631
  get isValue2Invalid() {
22632
- return !!this.state.errors?.includes(54 /* CommandResult.SecondArgMissing */);
22632
+ return !!this.state.errors?.includes(55 /* CommandResult.SecondArgMissing */);
22633
22633
  }
22634
22634
  toggleStyle(tool) {
22635
22635
  const style = this.state.rules.cellIs.style;
@@ -22646,17 +22646,17 @@ class ConditionalFormattingPanel extends Component {
22646
22646
  isValueInvalid(threshold) {
22647
22647
  switch (threshold) {
22648
22648
  case "minimum":
22649
- return (this.state.errors.includes(60 /* CommandResult.MinInvalidFormula */) ||
22650
- this.state.errors.includes(52 /* CommandResult.MinBiggerThanMid */) ||
22651
- this.state.errors.includes(49 /* CommandResult.MinBiggerThanMax */) ||
22652
- this.state.errors.includes(55 /* CommandResult.MinNaN */));
22649
+ return (this.state.errors.includes(61 /* CommandResult.MinInvalidFormula */) ||
22650
+ this.state.errors.includes(53 /* CommandResult.MinBiggerThanMid */) ||
22651
+ this.state.errors.includes(50 /* CommandResult.MinBiggerThanMax */) ||
22652
+ this.state.errors.includes(56 /* CommandResult.MinNaN */));
22653
22653
  case "midpoint":
22654
- return (this.state.errors.includes(61 /* CommandResult.MidInvalidFormula */) ||
22655
- this.state.errors.includes(56 /* CommandResult.MidNaN */) ||
22656
- this.state.errors.includes(51 /* CommandResult.MidBiggerThanMax */));
22654
+ return (this.state.errors.includes(62 /* CommandResult.MidInvalidFormula */) ||
22655
+ this.state.errors.includes(57 /* CommandResult.MidNaN */) ||
22656
+ this.state.errors.includes(52 /* CommandResult.MidBiggerThanMax */));
22657
22657
  case "maximum":
22658
- return (this.state.errors.includes(62 /* CommandResult.MaxInvalidFormula */) ||
22659
- this.state.errors.includes(57 /* CommandResult.MaxNaN */));
22658
+ return (this.state.errors.includes(63 /* CommandResult.MaxInvalidFormula */) ||
22659
+ this.state.errors.includes(58 /* CommandResult.MaxNaN */));
22660
22660
  default:
22661
22661
  return false;
22662
22662
  }
@@ -22704,13 +22704,13 @@ class ConditionalFormattingPanel extends Component {
22704
22704
  isInflectionPointInvalid(inflectionPoint) {
22705
22705
  switch (inflectionPoint) {
22706
22706
  case "lowerInflectionPoint":
22707
- return (this.state.errors.includes(59 /* CommandResult.ValueLowerInflectionNaN */) ||
22708
- this.state.errors.includes(64 /* CommandResult.ValueLowerInvalidFormula */) ||
22709
- this.state.errors.includes(50 /* CommandResult.LowerBiggerThanUpper */));
22707
+ return (this.state.errors.includes(60 /* CommandResult.ValueLowerInflectionNaN */) ||
22708
+ this.state.errors.includes(65 /* CommandResult.ValueLowerInvalidFormula */) ||
22709
+ this.state.errors.includes(51 /* CommandResult.LowerBiggerThanUpper */));
22710
22710
  case "upperInflectionPoint":
22711
- return (this.state.errors.includes(58 /* CommandResult.ValueUpperInflectionNaN */) ||
22712
- this.state.errors.includes(63 /* CommandResult.ValueUpperInvalidFormula */) ||
22713
- this.state.errors.includes(50 /* CommandResult.LowerBiggerThanUpper */));
22711
+ return (this.state.errors.includes(59 /* CommandResult.ValueUpperInflectionNaN */) ||
22712
+ this.state.errors.includes(64 /* CommandResult.ValueUpperInvalidFormula */) ||
22713
+ this.state.errors.includes(51 /* CommandResult.LowerBiggerThanUpper */));
22714
22714
  default:
22715
22715
  return true;
22716
22716
  }
@@ -23073,7 +23073,7 @@ const SplitToColumnsInteractiveContent = {
23073
23073
  };
23074
23074
  function interactiveSplitToColumns(env, separator, addNewColumns) {
23075
23075
  let result = env.model.dispatch("SPLIT_TEXT_INTO_COLUMNS", { separator, addNewColumns });
23076
- if (result.isCancelledBecause(92 /* CommandResult.SplitWillOverwriteContent */)) {
23076
+ if (result.isCancelledBecause(93 /* CommandResult.SplitWillOverwriteContent */)) {
23077
23077
  env.askConfirmation(SplitToColumnsInteractiveContent.SplitIsDestructive, () => {
23078
23078
  result = env.model.dispatch("SPLIT_TEXT_INTO_COLUMNS", {
23079
23079
  separator,
@@ -23137,8 +23137,8 @@ class SplitIntoColumnsPanel extends Component {
23137
23137
  const errors = new Set();
23138
23138
  for (const reason of cancelledReasons) {
23139
23139
  switch (reason) {
23140
- case 92 /* CommandResult.SplitWillOverwriteContent */:
23141
- case 91 /* CommandResult.EmptySplitSeparator */:
23140
+ case 93 /* CommandResult.SplitWillOverwriteContent */:
23141
+ case 92 /* CommandResult.EmptySplitSeparator */:
23142
23142
  break;
23143
23143
  default:
23144
23144
  errors.add(SplitToColumnsTerms.Errors[reason] || SplitToColumnsTerms.Errors.Unexpected);
@@ -23153,8 +23153,8 @@ class SplitIntoColumnsPanel extends Component {
23153
23153
  addNewColumns: this.state.addNewColumns,
23154
23154
  force: false,
23155
23155
  }).reasons;
23156
- if (cancelledReasons.includes(92 /* CommandResult.SplitWillOverwriteContent */)) {
23157
- warnings.push(SplitToColumnsTerms.Errors[92 /* CommandResult.SplitWillOverwriteContent */]);
23156
+ if (cancelledReasons.includes(93 /* CommandResult.SplitWillOverwriteContent */)) {
23157
+ warnings.push(SplitToColumnsTerms.Errors[93 /* CommandResult.SplitWillOverwriteContent */]);
23158
23158
  }
23159
23159
  return warnings;
23160
23160
  }
@@ -24374,6 +24374,9 @@ class Composer extends Component {
24374
24374
  const token = tokens.filter((token) => token.value.includes(currentSelectedText) &&
24375
24375
  token.start <= currentSelection.start &&
24376
24376
  token.end >= currentSelection.end)[0];
24377
+ if (!token) {
24378
+ return;
24379
+ }
24377
24380
  if (token.type === "REFERENCE") {
24378
24381
  this.env.model.dispatch("CHANGE_COMPOSER_CURSOR_SELECTION", {
24379
24382
  start: token.start,
@@ -31678,7 +31681,7 @@ class BordersPlugin extends CorePlugin {
31678
31681
  const currentBorder = this.getCellBorder(cmd);
31679
31682
  const areAllNewBordersUndefined = !cmd.border?.bottom && !cmd.border?.left && !cmd.border?.right && !cmd.border?.top;
31680
31683
  if ((!currentBorder && areAllNewBordersUndefined) || deepEquals(currentBorder, cmd.border)) {
31681
- return 97 /* CommandResult.NoChanges */;
31684
+ return 98 /* CommandResult.NoChanges */;
31682
31685
  }
31683
31686
  return 0 /* CommandResult.Success */;
31684
31687
  }
@@ -31923,6 +31926,10 @@ class CellPlugin extends CorePlugin {
31923
31926
  format: cell.format ? getItemId(cell.format, formats) : undefined,
31924
31927
  content: cell.content || undefined,
31925
31928
  };
31929
+ // if there is a formula but no dependencies (maybe because the cell is in error), no need to recompute the formula text
31930
+ if (cell.isFormula && cell.dependencies.length) {
31931
+ cells[xc].content = this.buildFormulaContent(_sheet.id, cell, cell.dependencies, true);
31932
+ }
31926
31933
  }
31927
31934
  _sheet.cells = cells;
31928
31935
  }
@@ -31957,13 +31964,13 @@ class CellPlugin extends CorePlugin {
31957
31964
  /*
31958
31965
  * Reconstructs the original formula string based on a normalized form and its dependencies
31959
31966
  */
31960
- buildFormulaContent(sheetId, cell, dependencies) {
31967
+ buildFormulaContent(sheetId, cell, dependencies, useFixedZone = false) {
31961
31968
  const ranges = dependencies || cell.dependencies;
31962
31969
  let rangeIndex = 0;
31963
31970
  return concat(cell.compiledFormula.tokens.map((token) => {
31964
31971
  if (token.type === "REFERENCE") {
31965
31972
  const range = ranges[rangeIndex++];
31966
- return this.getters.getRangeString(range, sheetId);
31973
+ return this.getters.getRangeString(range, sheetId, useFixedZone);
31967
31974
  }
31968
31975
  return token.value;
31969
31976
  }));
@@ -32189,9 +32196,9 @@ class CellPlugin extends CorePlugin {
32189
32196
  checkUselessClearCell(cmd) {
32190
32197
  const cell = this.getters.getCell(cmd);
32191
32198
  if (!cell)
32192
- return 97 /* CommandResult.NoChanges */;
32199
+ return 98 /* CommandResult.NoChanges */;
32193
32200
  if (!cell.content && !cell.style && !cell.format) {
32194
- return 97 /* CommandResult.NoChanges */;
32201
+ return 98 /* CommandResult.NoChanges */;
32195
32202
  }
32196
32203
  return 0 /* CommandResult.Success */;
32197
32204
  }
@@ -32416,13 +32423,13 @@ class ChartPlugin extends CorePlugin {
32416
32423
  }
32417
32424
  checkChartDuplicate(cmd) {
32418
32425
  return this.getters.getFigureSheetId(cmd.id)
32419
- ? 86 /* CommandResult.DuplicatedChartId */
32426
+ ? 87 /* CommandResult.DuplicatedChartId */
32420
32427
  : 0 /* CommandResult.Success */;
32421
32428
  }
32422
32429
  checkChartExists(cmd) {
32423
32430
  return this.getters.getFigureSheetId(cmd.id)
32424
32431
  ? 0 /* CommandResult.Success */
32425
- : 87 /* CommandResult.ChartDoesNotExist */;
32432
+ : 88 /* CommandResult.ChartDoesNotExist */;
32426
32433
  }
32427
32434
  }
32428
32435
 
@@ -32532,7 +32539,13 @@ class ConditionalFormatPlugin extends CorePlugin {
32532
32539
  }
32533
32540
  }
32534
32541
  exportForExcel(data) {
32535
- this.export(data);
32542
+ if (data.sheets) {
32543
+ for (let sheet of data.sheets) {
32544
+ if (this.cfRules[sheet.id]) {
32545
+ sheet.conditionalFormats = this.cfRules[sheet.id].map((rule) => this.mapToConditionalFormat(sheet.id, rule, { useFixedReference: true }));
32546
+ }
32547
+ }
32548
+ }
32536
32549
  }
32537
32550
  // ---------------------------------------------------------------------------
32538
32551
  // Getters
@@ -32597,11 +32610,11 @@ class ConditionalFormatPlugin extends CorePlugin {
32597
32610
  // ---------------------------------------------------------------------------
32598
32611
  // Private
32599
32612
  // ---------------------------------------------------------------------------
32600
- mapToConditionalFormat(sheetId, cf) {
32613
+ mapToConditionalFormat(sheetId, cf, options = { useFixedReference: false }) {
32601
32614
  return {
32602
32615
  ...cf,
32603
32616
  ranges: cf.ranges.map((range) => {
32604
- return this.getters.getRangeString(range, sheetId);
32617
+ return this.getters.getRangeString(range, sheetId, options.useFixedReference);
32605
32618
  }),
32606
32619
  };
32607
32620
  }
@@ -32634,10 +32647,10 @@ class ConditionalFormatPlugin extends CorePlugin {
32634
32647
  return 28 /* CommandResult.InvalidSheetId */;
32635
32648
  const ruleIndex = this.cfRules[sheetId].findIndex((cf) => cf.id === cfId);
32636
32649
  if (ruleIndex === -1)
32637
- return 73 /* CommandResult.InvalidConditionalFormatId */;
32650
+ return 74 /* CommandResult.InvalidConditionalFormatId */;
32638
32651
  const cfIndex2 = direction === "up" ? ruleIndex - 1 : ruleIndex + 1;
32639
32652
  if (cfIndex2 < 0 || cfIndex2 >= this.cfRules[sheetId].length) {
32640
- return 73 /* CommandResult.InvalidConditionalFormatId */;
32653
+ return 74 /* CommandResult.InvalidConditionalFormatId */;
32641
32654
  }
32642
32655
  return 0 /* CommandResult.Success */;
32643
32656
  }
@@ -32678,10 +32691,10 @@ class ConditionalFormatPlugin extends CorePlugin {
32678
32691
  const errors = [];
32679
32692
  const isEmpty = (value) => value === undefined || value === "";
32680
32693
  if (expectedNumber >= 1 && isEmpty(rule.values[0])) {
32681
- errors.push(53 /* CommandResult.FirstArgMissing */);
32694
+ errors.push(54 /* CommandResult.FirstArgMissing */);
32682
32695
  }
32683
32696
  if (expectedNumber >= 2 && isEmpty(rule.values[1])) {
32684
- errors.push(54 /* CommandResult.SecondArgMissing */);
32697
+ errors.push(55 /* CommandResult.SecondArgMissing */);
32685
32698
  }
32686
32699
  return errors.length ? errors : 0 /* CommandResult.Success */;
32687
32700
  }
@@ -32693,15 +32706,15 @@ class ConditionalFormatPlugin extends CorePlugin {
32693
32706
  (threshold.value === "" || isNaN(threshold.value))) {
32694
32707
  switch (thresholdName) {
32695
32708
  case "min":
32696
- return 55 /* CommandResult.MinNaN */;
32709
+ return 56 /* CommandResult.MinNaN */;
32697
32710
  case "max":
32698
- return 57 /* CommandResult.MaxNaN */;
32711
+ return 58 /* CommandResult.MaxNaN */;
32699
32712
  case "mid":
32700
- return 56 /* CommandResult.MidNaN */;
32713
+ return 57 /* CommandResult.MidNaN */;
32701
32714
  case "upperInflectionPoint":
32702
- return 58 /* CommandResult.ValueUpperInflectionNaN */;
32715
+ return 59 /* CommandResult.ValueUpperInflectionNaN */;
32703
32716
  case "lowerInflectionPoint":
32704
- return 59 /* CommandResult.ValueLowerInflectionNaN */;
32717
+ return 60 /* CommandResult.ValueLowerInflectionNaN */;
32705
32718
  }
32706
32719
  }
32707
32720
  return 0 /* CommandResult.Success */;
@@ -32715,15 +32728,15 @@ class ConditionalFormatPlugin extends CorePlugin {
32715
32728
  catch (error) {
32716
32729
  switch (thresholdName) {
32717
32730
  case "min":
32718
- return 60 /* CommandResult.MinInvalidFormula */;
32731
+ return 61 /* CommandResult.MinInvalidFormula */;
32719
32732
  case "max":
32720
- return 62 /* CommandResult.MaxInvalidFormula */;
32733
+ return 63 /* CommandResult.MaxInvalidFormula */;
32721
32734
  case "mid":
32722
- return 61 /* CommandResult.MidInvalidFormula */;
32735
+ return 62 /* CommandResult.MidInvalidFormula */;
32723
32736
  case "upperInflectionPoint":
32724
- return 63 /* CommandResult.ValueUpperInvalidFormula */;
32737
+ return 64 /* CommandResult.ValueUpperInvalidFormula */;
32725
32738
  case "lowerInflectionPoint":
32726
- return 64 /* CommandResult.ValueLowerInvalidFormula */;
32739
+ return 65 /* CommandResult.ValueLowerInvalidFormula */;
32727
32740
  }
32728
32741
  }
32729
32742
  return 0 /* CommandResult.Success */;
@@ -32740,7 +32753,7 @@ class ConditionalFormatPlugin extends CorePlugin {
32740
32753
  if (["number", "percentage", "percentile"].includes(rule.lowerInflectionPoint.type) &&
32741
32754
  rule.lowerInflectionPoint.type === rule.upperInflectionPoint.type &&
32742
32755
  Number(minValue) > Number(maxValue)) {
32743
- return 50 /* CommandResult.LowerBiggerThanUpper */;
32756
+ return 51 /* CommandResult.LowerBiggerThanUpper */;
32744
32757
  }
32745
32758
  return 0 /* CommandResult.Success */;
32746
32759
  }
@@ -32750,7 +32763,7 @@ class ConditionalFormatPlugin extends CorePlugin {
32750
32763
  if (["number", "percentage", "percentile"].includes(rule.minimum.type) &&
32751
32764
  rule.minimum.type === rule.maximum.type &&
32752
32765
  stringToNumber(minValue) >= stringToNumber(maxValue)) {
32753
- return 49 /* CommandResult.MinBiggerThanMax */;
32766
+ return 50 /* CommandResult.MinBiggerThanMax */;
32754
32767
  }
32755
32768
  return 0 /* CommandResult.Success */;
32756
32769
  }
@@ -32761,7 +32774,7 @@ class ConditionalFormatPlugin extends CorePlugin {
32761
32774
  ["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
32762
32775
  rule.midpoint.type === rule.maximum.type &&
32763
32776
  stringToNumber(midValue) >= stringToNumber(maxValue)) {
32764
- return 51 /* CommandResult.MidBiggerThanMax */;
32777
+ return 52 /* CommandResult.MidBiggerThanMax */;
32765
32778
  }
32766
32779
  return 0 /* CommandResult.Success */;
32767
32780
  }
@@ -32772,7 +32785,7 @@ class ConditionalFormatPlugin extends CorePlugin {
32772
32785
  ["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
32773
32786
  rule.minimum.type === rule.midpoint.type &&
32774
32787
  stringToNumber(minValue) >= stringToNumber(midValue)) {
32775
- return 52 /* CommandResult.MinBiggerThanMid */;
32788
+ return 53 /* CommandResult.MinBiggerThanMid */;
32776
32789
  }
32777
32790
  return 0 /* CommandResult.Success */;
32778
32791
  }
@@ -32904,13 +32917,13 @@ class FigurePlugin extends CorePlugin {
32904
32917
  }
32905
32918
  checkFigureExists(sheetId, figureId) {
32906
32919
  if (this.figures[sheetId]?.[figureId] === undefined) {
32907
- return 72 /* CommandResult.FigureDoesNotExist */;
32920
+ return 73 /* CommandResult.FigureDoesNotExist */;
32908
32921
  }
32909
32922
  return 0 /* CommandResult.Success */;
32910
32923
  }
32911
32924
  checkFigureDuplicate(figureId) {
32912
32925
  if (Object.values(this.figures).find((sheet) => sheet?.[figureId])) {
32913
- return 84 /* CommandResult.DuplicatedFigureId */;
32926
+ return 85 /* CommandResult.DuplicatedFigureId */;
32914
32927
  }
32915
32928
  return 0 /* CommandResult.Success */;
32916
32929
  }
@@ -33022,12 +33035,12 @@ class FiltersPlugin extends CorePlugin {
33022
33035
  switch (cmd.type) {
33023
33036
  case "CREATE_FILTER_TABLE":
33024
33037
  if (!areZonesContinuous(...cmd.target)) {
33025
- return 83 /* CommandResult.NonContinuousTargets */;
33038
+ return 84 /* CommandResult.NonContinuousTargets */;
33026
33039
  }
33027
33040
  const zone = union(...cmd.target);
33028
33041
  const checkFilterOverlap = () => {
33029
33042
  if (this.getFilterTables(cmd.sheetId).some((filter) => overlap(filter.zone, zone))) {
33030
- return 80 /* CommandResult.FilterOverlap */;
33043
+ return 81 /* CommandResult.FilterOverlap */;
33031
33044
  }
33032
33045
  return 0 /* CommandResult.Success */;
33033
33046
  };
@@ -33035,7 +33048,7 @@ class FiltersPlugin extends CorePlugin {
33035
33048
  const mergesInTarget = this.getters.getMergesInZone(cmd.sheetId, zone);
33036
33049
  for (let merge of mergesInTarget) {
33037
33050
  if (overlap(zone, merge)) {
33038
- return 82 /* CommandResult.MergeInFilter */;
33051
+ return 83 /* CommandResult.MergeInFilter */;
33039
33052
  }
33040
33053
  }
33041
33054
  return 0 /* CommandResult.Success */;
@@ -33045,7 +33058,7 @@ class FiltersPlugin extends CorePlugin {
33045
33058
  for (let merge of cmd.target) {
33046
33059
  for (let filterTable of this.getFilterTables(cmd.sheetId)) {
33047
33060
  if (overlap(filterTable.zone, merge)) {
33048
- return 82 /* CommandResult.MergeInFilter */;
33061
+ return 83 /* CommandResult.MergeInFilter */;
33049
33062
  }
33050
33063
  }
33051
33064
  }
@@ -33414,10 +33427,10 @@ class HeaderVisibilityPlugin extends CorePlugin {
33414
33427
  : this.getters.getNumberRows(cmd.sheetId);
33415
33428
  const hiddenElements = new Set((hiddenGroup || []).flat().concat(cmd.elements));
33416
33429
  if (hiddenElements.size >= elements) {
33417
- return 68 /* CommandResult.TooManyHiddenElements */;
33430
+ return 69 /* CommandResult.TooManyHiddenElements */;
33418
33431
  }
33419
33432
  else if (Math.min(...cmd.elements) < 0 || Math.max(...cmd.elements) > elements) {
33420
- return 88 /* CommandResult.InvalidHeaderIndex */;
33433
+ return 89 /* CommandResult.InvalidHeaderIndex */;
33421
33434
  }
33422
33435
  else {
33423
33436
  return 0 /* CommandResult.Success */;
@@ -33981,7 +33994,7 @@ class MergePlugin extends CorePlugin {
33981
33994
  for (const zone of target) {
33982
33995
  for (const zone2 of target) {
33983
33996
  if (zone !== zone2 && overlap(zone, zone2)) {
33984
- return 67 /* CommandResult.MergeOverlap */;
33997
+ return 68 /* CommandResult.MergeOverlap */;
33985
33998
  }
33986
33999
  }
33987
34000
  }
@@ -33995,7 +34008,7 @@ class MergePlugin extends CorePlugin {
33995
34008
  for (const zone of target) {
33996
34009
  if ((zone.left < xSplit && zone.right >= xSplit) ||
33997
34010
  (zone.top < ySplit && zone.bottom >= ySplit)) {
33998
- return 77 /* CommandResult.FrozenPaneOverlap */;
34011
+ return 78 /* CommandResult.FrozenPaneOverlap */;
33999
34012
  }
34000
34013
  }
34001
34014
  return 0 /* CommandResult.Success */;
@@ -34438,8 +34451,9 @@ class RangeAdapter {
34438
34451
  *
34439
34452
  * @param range the range (received from getRangeFromXC or getRangeFromZone)
34440
34453
  * @param forSheetId the id of the sheet where the range string is supposed to be used.
34454
+ * @param [useFixedZone=false] if true, the range will be returned with fixed row and column
34441
34455
  */
34442
- getRangeString(range, forSheetId) {
34456
+ getRangeString(range, forSheetId, useFixedZone = false) {
34443
34457
  if (!range) {
34444
34458
  return INCORRECT_RANGE_STRING;
34445
34459
  }
@@ -34466,7 +34480,7 @@ class RangeAdapter {
34466
34480
  if (prefixSheet && !sheetName) {
34467
34481
  return INCORRECT_RANGE_STRING;
34468
34482
  }
34469
- let rangeString = this.getRangePartString(rangeImpl, 0);
34483
+ let rangeString = this.getRangePartString(rangeImpl, 0, useFixedZone);
34470
34484
  if (rangeImpl.parts && rangeImpl.parts.length === 2) {
34471
34485
  // this if converts A2:A2 into A2 except if any part of the original range had fixed row or column (with $)
34472
34486
  if (rangeImpl.zone.top !== rangeImpl.zone.bottom ||
@@ -34476,7 +34490,7 @@ class RangeAdapter {
34476
34490
  rangeImpl.parts[1].rowFixed ||
34477
34491
  rangeImpl.parts[1].colFixed) {
34478
34492
  rangeString += ":";
34479
- rangeString += this.getRangePartString(rangeImpl, 1);
34493
+ rangeString += this.getRangePartString(rangeImpl, 1, useFixedZone);
34480
34494
  }
34481
34495
  }
34482
34496
  return `${prefixSheet ? sheetName + "!" : ""}${rangeString}`;
@@ -34517,13 +34531,13 @@ class RangeAdapter {
34517
34531
  /**
34518
34532
  * Get a Xc string that represent a part of a range
34519
34533
  */
34520
- getRangePartString(range, part) {
34534
+ getRangePartString(range, part, useFixedZone = false) {
34521
34535
  const colFixed = range.parts && range.parts[part]?.colFixed ? "$" : "";
34522
34536
  const col = part === 0 ? numberToLetters(range.zone.left) : numberToLetters(range.zone.right);
34523
34537
  const rowFixed = range.parts && range.parts[part]?.rowFixed ? "$" : "";
34524
34538
  const row = part === 0 ? String(range.zone.top + 1) : String(range.zone.bottom + 1);
34525
34539
  let str = "";
34526
- if (range.isFullCol) {
34540
+ if (range.isFullCol && !useFixedZone) {
34527
34541
  if (part === 0 && range.unboundedZone.hasHeader) {
34528
34542
  str = colFixed + col + rowFixed + row;
34529
34543
  }
@@ -34531,7 +34545,7 @@ class RangeAdapter {
34531
34545
  str = colFixed + col;
34532
34546
  }
34533
34547
  }
34534
- else if (range.isFullRow) {
34548
+ else if (range.isFullRow && !useFixedZone) {
34535
34549
  if (part === 0 && range.unboundedZone.hasHeader) {
34536
34550
  str = colFixed + col + rowFixed + row;
34537
34551
  }
@@ -34628,10 +34642,10 @@ class SheetPlugin extends CorePlugin {
34628
34642
  ? this.getNumberCols(cmd.sheetId)
34629
34643
  : this.getNumberRows(cmd.sheetId);
34630
34644
  if (cmd.base < 0 || cmd.base >= elements) {
34631
- return 88 /* CommandResult.InvalidHeaderIndex */;
34645
+ return 89 /* CommandResult.InvalidHeaderIndex */;
34632
34646
  }
34633
34647
  else if (cmd.quantity <= 0) {
34634
- return 89 /* CommandResult.InvalidQuantity */;
34648
+ return 90 /* CommandResult.InvalidQuantity */;
34635
34649
  }
34636
34650
  return 0 /* CommandResult.Success */;
34637
34651
  case "REMOVE_COLUMNS_ROWS": {
@@ -34639,7 +34653,7 @@ class SheetPlugin extends CorePlugin {
34639
34653
  ? this.getNumberCols(cmd.sheetId)
34640
34654
  : this.getNumberRows(cmd.sheetId);
34641
34655
  if (Math.min(...cmd.elements) < 0 || Math.max(...cmd.elements) > elements) {
34642
- return 88 /* CommandResult.InvalidHeaderIndex */;
34656
+ return 89 /* CommandResult.InvalidHeaderIndex */;
34643
34657
  }
34644
34658
  else if (this.checkElementsIncludeAllNonFrozenHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) {
34645
34659
  return 8 /* CommandResult.NotEnoughElements */;
@@ -35119,18 +35133,18 @@ class SheetPlugin extends CorePlugin {
35119
35133
  checkRowFreezeQuantity(cmd) {
35120
35134
  return cmd.quantity >= 1 && cmd.quantity < this.getNumberRows(cmd.sheetId)
35121
35135
  ? 0 /* CommandResult.Success */
35122
- : 76 /* CommandResult.InvalidFreezeQuantity */;
35136
+ : 77 /* CommandResult.InvalidFreezeQuantity */;
35123
35137
  }
35124
35138
  checkColFreezeQuantity(cmd) {
35125
35139
  return cmd.quantity >= 1 && cmd.quantity < this.getNumberCols(cmd.sheetId)
35126
35140
  ? 0 /* CommandResult.Success */
35127
- : 76 /* CommandResult.InvalidFreezeQuantity */;
35141
+ : 77 /* CommandResult.InvalidFreezeQuantity */;
35128
35142
  }
35129
35143
  checkRowFreezeOverlapMerge(cmd) {
35130
35144
  const merges = this.getters.getMerges(cmd.sheetId);
35131
35145
  for (let merge of merges) {
35132
35146
  if (merge.top < cmd.quantity && cmd.quantity <= merge.bottom) {
35133
- return 67 /* CommandResult.MergeOverlap */;
35147
+ return 68 /* CommandResult.MergeOverlap */;
35134
35148
  }
35135
35149
  }
35136
35150
  return 0 /* CommandResult.Success */;
@@ -35139,7 +35153,7 @@ class SheetPlugin extends CorePlugin {
35139
35153
  const merges = this.getters.getMerges(cmd.sheetId);
35140
35154
  for (let merge of merges) {
35141
35155
  if (merge.left < cmd.quantity && cmd.quantity <= merge.right) {
35142
- return 67 /* CommandResult.MergeOverlap */;
35156
+ return 68 /* CommandResult.MergeOverlap */;
35143
35157
  }
35144
35158
  }
35145
35159
  return 0 /* CommandResult.Success */;
@@ -35460,7 +35474,7 @@ class SettingsPlugin extends CorePlugin {
35460
35474
  allowDispatch(cmd) {
35461
35475
  switch (cmd.type) {
35462
35476
  case "UPDATE_LOCALE":
35463
- return isValidLocale(cmd.locale) ? 0 /* CommandResult.Success */ : 95 /* CommandResult.InvalidLocale */;
35477
+ return isValidLocale(cmd.locale) ? 0 /* CommandResult.Success */ : 96 /* CommandResult.InvalidLocale */;
35464
35478
  }
35465
35479
  return 0 /* CommandResult.Success */;
35466
35480
  }
@@ -35541,22 +35555,17 @@ class CompilationParametersBuilder {
35541
35555
  * The `compute` of the formula's function must process it completely
35542
35556
  */
35543
35557
  refFn(range, isMeta, functionName, paramNumber) {
35558
+ this.assertRangeValid(range);
35544
35559
  if (isMeta) {
35545
35560
  // Use zoneToXc of zone instead of getRangeString to avoid sending unbounded ranges
35546
35561
  return { value: zoneToXc(range.zone) };
35547
35562
  }
35548
- if (!isZoneValid(range.zone)) {
35549
- throw new InvalidReferenceError();
35550
- }
35551
35563
  // if the formula definition could have accepted a range, we would pass through the _range function and not here
35552
35564
  if (range.zone.bottom !== range.zone.top || range.zone.left !== range.zone.right) {
35553
35565
  throw new Error(paramNumber
35554
35566
  ? _lt("Function %s expects the parameter %s to be a single value or a single cell reference, not a range.", functionName.toString(), paramNumber.toString())
35555
35567
  : _lt("Function %s expects its parameters to be single values or single cell references, not ranges.", functionName.toString()));
35556
35568
  }
35557
- if (range.invalidSheetName) {
35558
- throw new Error(_lt("Invalid sheet name: %s", range.invalidSheetName));
35559
- }
35560
35569
  return this.readCell(range);
35561
35570
  }
35562
35571
  readCell(range) {
@@ -35591,10 +35600,10 @@ class CompilationParametersBuilder {
35591
35600
  * Note that each col is possibly sparse: it only contain the values of cells
35592
35601
  * that are actually present in the grid.
35593
35602
  */
35594
- range({ sheetId, zone }) {
35595
- if (!isZoneValid(zone)) {
35596
- throw new InvalidReferenceError();
35597
- }
35603
+ range(range) {
35604
+ this.assertRangeValid(range);
35605
+ const sheetId = range.sheetId;
35606
+ const zone = range.zone;
35598
35607
  // Performance issue: Avoid fetching data on positions that are out of the spreadsheet
35599
35608
  // e.g. A1:ZZZ9999 in a sheet with 10 cols and 10 rows should ignore everything past J10 and return a 10x10 array
35600
35609
  const sheetZone = this.getters.getSheetZone(sheetId);
@@ -35637,6 +35646,14 @@ class CompilationParametersBuilder {
35637
35646
  this.rangeCache[cacheKey] = result;
35638
35647
  return result;
35639
35648
  }
35649
+ assertRangeValid(range) {
35650
+ if (!isZoneValid(range.zone)) {
35651
+ throw new InvalidReferenceError();
35652
+ }
35653
+ if (range.invalidSheetName) {
35654
+ throw new Error(_lt("Invalid sheet name: %s", range.invalidSheetName));
35655
+ }
35656
+ }
35640
35657
  }
35641
35658
 
35642
35659
  function quickselect(arr, k, left, right, compare) {
@@ -37915,7 +37932,7 @@ class AutofillPlugin extends UIPlugin {
37915
37932
  if (this.lastCellSelected.col !== undefined && this.lastCellSelected.row !== undefined) {
37916
37933
  return 0 /* CommandResult.Success */;
37917
37934
  }
37918
- return 47 /* CommandResult.InvalidAutofillSelection */;
37935
+ return 48 /* CommandResult.InvalidAutofillSelection */;
37919
37936
  case "AUTOFILL_AUTO":
37920
37937
  const zone = this.getters.getSelectedZone();
37921
37938
  return zone.top === zone.bottom
@@ -38534,7 +38551,7 @@ class CellPopoverPlugin extends UIPlugin {
38534
38551
  cellPopoverRegistry.get(cmd.popoverType);
38535
38552
  }
38536
38553
  catch (error) {
38537
- return 74 /* CommandResult.InvalidCellPopover */;
38554
+ return 75 /* CommandResult.InvalidCellPopover */;
38538
38555
  }
38539
38556
  return 0 /* CommandResult.Success */;
38540
38557
  default:
@@ -40674,27 +40691,6 @@ class SelectionInputPlugin extends UIPlugin {
40674
40691
  // ---------------------------------------------------------------------------
40675
40692
  // Command Handling
40676
40693
  // ---------------------------------------------------------------------------
40677
- allowDispatch(cmd) {
40678
- switch (cmd.type) {
40679
- case "ADD_RANGE":
40680
- case "ADD_EMPTY_RANGE":
40681
- if (this.inputHasSingleRange && this.ranges.length === 1) {
40682
- return 31 /* CommandResult.MaximumRangesReached */;
40683
- }
40684
- break;
40685
- case "REMOVE_RANGE":
40686
- if (this.ranges.length === 1) {
40687
- return 32 /* CommandResult.MinimumRangesReached */;
40688
- }
40689
- break;
40690
- case "CHANGE_RANGE":
40691
- if (this.inputHasSingleRange && cmd.value.split(",").length > 1) {
40692
- return 31 /* CommandResult.MaximumRangesReached */;
40693
- }
40694
- break;
40695
- }
40696
- return 0 /* CommandResult.Success */;
40697
- }
40698
40694
  handleEvent(event) {
40699
40695
  const inputSheetId = this.activeSheet;
40700
40696
  const sheetId = this.getters.getActiveSheetId();
@@ -40914,6 +40910,15 @@ class SelectionInputsManagerPlugin extends UIPlugin {
40914
40910
  // Command Handling
40915
40911
  // ---------------------------------------------------------------------------
40916
40912
  allowDispatch(cmd) {
40913
+ switch (cmd.type) {
40914
+ case "FOCUS_RANGE":
40915
+ case "CHANGE_RANGE":
40916
+ case "ADD_EMPTY_RANGE":
40917
+ case "REMOVE_RANGE":
40918
+ if (!this.inputs[cmd.id]) {
40919
+ return 33 /* CommandResult.InvalidInputId */;
40920
+ }
40921
+ }
40917
40922
  switch (cmd.type) {
40918
40923
  case "FOCUS_RANGE":
40919
40924
  const index = this.currentInput?.getIndex(cmd.rangeId);
@@ -40921,9 +40926,25 @@ class SelectionInputsManagerPlugin extends UIPlugin {
40921
40926
  return 30 /* CommandResult.InputAlreadyFocused */;
40922
40927
  }
40923
40928
  break;
40924
- }
40925
- if (this.currentInput) {
40926
- return this.currentInput.allowDispatch(cmd);
40929
+ case "ADD_RANGE":
40930
+ case "ADD_EMPTY_RANGE":
40931
+ const input = this.inputs[cmd.id];
40932
+ if (input.inputHasSingleRange && input.ranges.length === 1) {
40933
+ return 31 /* CommandResult.MaximumRangesReached */;
40934
+ }
40935
+ break;
40936
+ case "REMOVE_RANGE":
40937
+ if (this.inputs[cmd.id].ranges.length === 1) {
40938
+ return 32 /* CommandResult.MinimumRangesReached */;
40939
+ }
40940
+ break;
40941
+ case "CHANGE_RANGE": {
40942
+ const input = this.inputs[cmd.id];
40943
+ if (input.inputHasSingleRange && cmd.value.split(",").length > 1) {
40944
+ return 31 /* CommandResult.MaximumRangesReached */;
40945
+ }
40946
+ break;
40947
+ }
40927
40948
  }
40928
40949
  return 0 /* CommandResult.Success */;
40929
40950
  }
@@ -41053,7 +41074,7 @@ class SortPlugin extends UIPlugin {
41053
41074
  /*Test the presence of single cells*/
41054
41075
  const singleCells = positions(zone).some(({ col, row }) => !this.getters.isInMerge({ sheetId, col, row }));
41055
41076
  if (singleCells) {
41056
- return 65 /* CommandResult.InvalidSortZone */;
41077
+ return 66 /* CommandResult.InvalidSortZone */;
41057
41078
  }
41058
41079
  return 0 /* CommandResult.Success */;
41059
41080
  }
@@ -41072,7 +41093,7 @@ class SortPlugin extends UIPlugin {
41072
41093
  ];
41073
41094
  return widthCurrent === widthFirst && heightCurrent === heightFirst;
41074
41095
  })) {
41075
- return 65 /* CommandResult.InvalidSortZone */;
41096
+ return 66 /* CommandResult.InvalidSortZone */;
41076
41097
  }
41077
41098
  return 0 /* CommandResult.Success */;
41078
41099
  }
@@ -41510,7 +41531,7 @@ class SheetUIPlugin extends UIPlugin {
41510
41531
  const sheetId = "sheetId" in cmd ? cmd.sheetId : this.getters.tryGetActiveSheetId();
41511
41532
  const zones = this.getters.getCommandZones(cmd);
41512
41533
  if (!sheetId && zones.length > 0) {
41513
- return 94 /* CommandResult.NoActiveSheet */;
41534
+ return 95 /* CommandResult.NoActiveSheet */;
41514
41535
  }
41515
41536
  if (sheetId && zones.length > 0) {
41516
41537
  return this.getters.checkZonesExistInSheet(sheetId, zones);
@@ -41992,13 +42013,13 @@ class SplitToColumnsPlugin extends UIPlugin {
41992
42013
  }
41993
42014
  checkSingleColSelected() {
41994
42015
  if (!this.getters.isSingleColSelected()) {
41995
- return 90 /* CommandResult.MoreThanOneColumnSelected */;
42016
+ return 91 /* CommandResult.MoreThanOneColumnSelected */;
41996
42017
  }
41997
42018
  return 0 /* CommandResult.Success */;
41998
42019
  }
41999
42020
  checkNonEmptySelector(cmd) {
42000
42021
  if (cmd.separator === "") {
42001
- return 91 /* CommandResult.EmptySplitSeparator */;
42022
+ return 92 /* CommandResult.EmptySplitSeparator */;
42002
42023
  }
42003
42024
  return 0 /* CommandResult.Success */;
42004
42025
  }
@@ -42009,7 +42030,7 @@ class SplitToColumnsPlugin extends UIPlugin {
42009
42030
  const selection = this.getters.getSelectedZones()[0];
42010
42031
  const splitted = this.getSplittedCols(selection, cmd.separator);
42011
42032
  if (this.willSplittedColsOverwriteContent(selection, splitted)) {
42012
- return 92 /* CommandResult.SplitWillOverwriteContent */;
42033
+ return 93 /* CommandResult.SplitWillOverwriteContent */;
42013
42034
  }
42014
42035
  return 0 /* CommandResult.Success */;
42015
42036
  }
@@ -42020,7 +42041,7 @@ class SplitToColumnsPlugin extends UIPlugin {
42020
42041
  return 0 /* CommandResult.Success */;
42021
42042
  }
42022
42043
  }
42023
- return 93 /* CommandResult.NoSplitSeparatorInSelection */;
42044
+ return 94 /* CommandResult.NoSplitSeparatorInSelection */;
42024
42045
  }
42025
42046
  }
42026
42047
 
@@ -42168,7 +42189,7 @@ class ClipboardCellsState extends ClipboardCellsAbstractState {
42168
42189
  for (const zone of this.getPasteZones(target)) {
42169
42190
  if ((zone.left < xSplit && zone.right >= xSplit) ||
42170
42191
  (zone.top < ySplit && zone.bottom >= ySplit)) {
42171
- return 77 /* CommandResult.FrozenPaneOverlap */;
42192
+ return 78 /* CommandResult.FrozenPaneOverlap */;
42172
42193
  }
42173
42194
  }
42174
42195
  return 0 /* CommandResult.Success */;
@@ -42620,7 +42641,7 @@ class ClipboardFigureState {
42620
42641
  }
42621
42642
  isPasteAllowed(target, option) {
42622
42643
  if (target.length === 0) {
42623
- return 75 /* CommandResult.EmptyTarget */;
42644
+ return 76 /* CommandResult.EmptyTarget */;
42624
42645
  }
42625
42646
  if (option?.pasteOption !== undefined) {
42626
42647
  return 23 /* CommandResult.WrongFigurePasteOption */;
@@ -42853,7 +42874,7 @@ class ClipboardPlugin extends UIPlugin {
42853
42874
  }
42854
42875
  case "ACTIVATE_PAINT_FORMAT": {
42855
42876
  if (this.paintFormatStatus !== "inactive") {
42856
- return 96 /* CommandResult.AlreadyInPaintingFormatMode */;
42877
+ return 97 /* CommandResult.AlreadyInPaintingFormatMode */;
42857
42878
  }
42858
42879
  }
42859
42880
  }
@@ -43431,7 +43452,7 @@ class EditionPlugin extends UIPlugin {
43431
43452
  validateSelection(length, start, end) {
43432
43453
  return start >= 0 && start <= length && end >= 0 && end <= length
43433
43454
  ? 0 /* CommandResult.Success */
43434
- : 48 /* CommandResult.WrongComposerSelection */;
43455
+ : 49 /* CommandResult.WrongComposerSelection */;
43435
43456
  }
43436
43457
  onColumnsRemoved(cmd) {
43437
43458
  if (cmd.elements.includes(this.col) && this.mode !== "inactive") {
@@ -43743,9 +43764,10 @@ class EditionPlugin extends UIPlugin {
43743
43764
  */
43744
43765
  getReferencedRanges() {
43745
43766
  const editionSheetId = this.getters.getCurrentEditedCell().sheetId;
43746
- return this.currentTokens
43767
+ const referenceRanges = this.currentTokens
43747
43768
  .filter((token) => token.type === "REFERENCE")
43748
43769
  .map((token) => this.getters.getRangeFromSheetXC(editionSheetId, token.value));
43770
+ return referenceRanges.filter((range) => !range.invalidSheetName && !range.invalidXc);
43749
43771
  }
43750
43772
  /**
43751
43773
  * Function used to determine when composer selection can start.
@@ -43812,7 +43834,7 @@ class FilterEvaluationPlugin extends UIPlugin {
43812
43834
  switch (cmd.type) {
43813
43835
  case "UPDATE_FILTER":
43814
43836
  if (!this.getters.getFilterId(cmd)) {
43815
- return 81 /* CommandResult.FilterNotFound */;
43837
+ return 82 /* CommandResult.FilterNotFound */;
43816
43838
  }
43817
43839
  break;
43818
43840
  }
@@ -44607,7 +44629,7 @@ class GridSelectionPlugin extends UIPlugin {
44607
44629
  const headers = [cmd.base, ...cmd.elements];
44608
44630
  const maxHeaderValue = isCol ? this.getters.getNumberCols(id) : this.getters.getNumberRows(id);
44609
44631
  if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
44610
- return 88 /* CommandResult.InvalidHeaderIndex */;
44632
+ return 89 /* CommandResult.InvalidHeaderIndex */;
44611
44633
  }
44612
44634
  return 0 /* CommandResult.Success */;
44613
44635
  }
@@ -45423,7 +45445,7 @@ class SheetViewPlugin extends UIPlugin {
45423
45445
  }
45424
45446
  checkPositiveDimension(cmd) {
45425
45447
  if (cmd.width < 0 || cmd.height < 0) {
45426
- return 70 /* CommandResult.InvalidViewportSize */;
45448
+ return 71 /* CommandResult.InvalidViewportSize */;
45427
45449
  }
45428
45450
  return 0 /* CommandResult.Success */;
45429
45451
  }
@@ -45433,7 +45455,7 @@ class SheetViewPlugin extends UIPlugin {
45433
45455
  cmd.gridOffsetY === this.gridOffsetY &&
45434
45456
  cmd.width === width &&
45435
45457
  cmd.height === height) {
45436
- return 78 /* CommandResult.ValuesNotChanged */;
45458
+ return 79 /* CommandResult.ValuesNotChanged */;
45437
45459
  }
45438
45460
  return 0 /* CommandResult.Success */;
45439
45461
  }
@@ -45441,7 +45463,7 @@ class SheetViewPlugin extends UIPlugin {
45441
45463
  const pane = this.getMainInternalViewport(this.getters.getActiveSheetId());
45442
45464
  if ((!pane.canScrollHorizontally && offsetX > 0) ||
45443
45465
  (!pane.canScrollVertically && offsetY > 0)) {
45444
- return 71 /* CommandResult.InvalidScrollingDirection */;
45466
+ return 72 /* CommandResult.InvalidScrollingDirection */;
45445
45467
  }
45446
45468
  return 0 /* CommandResult.Success */;
45447
45469
  }
@@ -48900,7 +48922,7 @@ class SelectionStreamProcessorImpl {
48900
48922
  */
48901
48923
  moveAnchorCell(direction, step = 1) {
48902
48924
  if (step !== "end" && step <= 0) {
48903
- return new DispatchResult(85 /* CommandResult.InvalidSelectionStep */);
48925
+ return new DispatchResult(86 /* CommandResult.InvalidSelectionStep */);
48904
48926
  }
48905
48927
  const { col, row } = this.getNextAvailablePosition(direction, step);
48906
48928
  return this.selectCell(col, row);
@@ -48946,7 +48968,7 @@ class SelectionStreamProcessorImpl {
48946
48968
  */
48947
48969
  resizeAnchorZone(direction, step = 1) {
48948
48970
  if (step !== "end" && step <= 0) {
48949
- return new DispatchResult(85 /* CommandResult.InvalidSelectionStep */);
48971
+ return new DispatchResult(86 /* CommandResult.InvalidSelectionStep */);
48950
48972
  }
48951
48973
  const sheetId = this.getters.getActiveSheetId();
48952
48974
  const anchor = this.anchor;
@@ -49784,12 +49806,7 @@ function addFormula(cell) {
49784
49806
  attrs.push(["t", "str"]);
49785
49807
  cycle = escapeXml /*xml*/ `<v>${cell.value}</v>`;
49786
49808
  }
49787
- node = escapeXml /*xml*/ `
49788
- <f>
49789
- ${XlsxFormula}
49790
- </f>
49791
- ${cycle}
49792
- `;
49809
+ node = escapeXml /*xml*/ ` <f> ${XlsxFormula} </f> ${cycle} `;
49793
49810
  return { attrs, node };
49794
49811
  }
49795
49812
  function addContent(content, sharedStrings, forceString = false) {
@@ -50608,11 +50625,10 @@ function addRows(construct, data, sheet) {
50608
50625
  ({ attrs: additionalAttrs, node: cellNode } = addContent(cell.content, construct.sharedStrings, isTableHeader));
50609
50626
  }
50610
50627
  attributes.push(...additionalAttrs);
50611
- cellNodes.push(escapeXml /*xml*/ `
50612
- <c ${formatAttributes(attributes)}>
50613
- ${cellNode}
50614
- </c>
50615
- `);
50628
+ // prettier-ignore
50629
+ cellNodes.push(escapeXml /*xml*/ `<c ${formatAttributes(attributes)}>
50630
+ ${cellNode}
50631
+ </c>`);
50616
50632
  }
50617
50633
  }
50618
50634
  if (cellNodes.length || row.size !== DEFAULT_CELL_HEIGHT || row.isHidden) {
@@ -51303,10 +51319,10 @@ class Model extends EventBus {
51303
51319
  const command = createCommand(type, payload);
51304
51320
  let status = this.status;
51305
51321
  if (this.getters.isReadonly() && !canExecuteInReadonly(command)) {
51306
- return new DispatchResult(69 /* CommandResult.Readonly */);
51322
+ return new DispatchResult(70 /* CommandResult.Readonly */);
51307
51323
  }
51308
51324
  if (!this.session.canApplyOptimisticUpdate()) {
51309
- return new DispatchResult(66 /* CommandResult.WaitingSessionConfirmation */);
51325
+ return new DispatchResult(67 /* CommandResult.WaitingSessionConfirmation */);
51310
51326
  }
51311
51327
  switch (status) {
51312
51328
  case 0 /* Status.Ready */:
@@ -51561,6 +51577,6 @@ const constants = {
51561
51577
  export { AbstractChart, CommandResult, CorePlugin, DispatchResult, EvaluationError, Model, Registry, Revision, SPREADSHEET_DIMENSIONS, Spreadsheet, UIPlugin, __info__, addFunction, astToFormula, compile, components, constants, convertAstNodes, coreTypes, findCellInNewZone, functionCache, helpers, invalidateCFEvaluationCommands, invalidateDependenciesCommands, invalidateEvaluationCommands, iterateAstNodes, links, load, parse, readonlyAllowedCommands, registries, setDefaultSheetViewSize, setTranslationMethod, tokenize };
51562
51578
 
51563
51579
 
51564
- __info__.version = '16.4.19';
51565
- __info__.date = '2024-01-17T10:27:33.027Z';
51566
- __info__.hash = 'fe01e7b';
51580
+ __info__.version = '16.4.21';
51581
+ __info__.date = '2024-02-02T13:45:48.276Z';
51582
+ __info__.hash = '73662b1';