@odoo/o-spreadsheet 16.0.60 → 16.0.63

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.
@@ -1102,9 +1102,16 @@ function deepEquals(o1, o2) {
1102
1102
  }
1103
1103
  return true;
1104
1104
  }
1105
- /** Check if the given array contains all the values of the other array. */
1105
+ /**
1106
+ * Check if the given array contains all the values of the other array.
1107
+ * It makes the assumption that both array do not contain duplicates.
1108
+ */
1106
1109
  function includesAll(arr, values) {
1107
- return values.every((value) => arr.includes(value));
1110
+ if (arr.length < values.length) {
1111
+ return false;
1112
+ }
1113
+ const set = new Set(arr);
1114
+ return values.every((value) => set.has(value));
1108
1115
  }
1109
1116
  /**
1110
1117
  * Return an object with all the keys in the object that have a falsy value removed.
@@ -2379,15 +2386,48 @@ class UuidGenerator {
2379
2386
  setIsFastStrategy(isFast) {
2380
2387
  this.isFastIdStrategy = isFast;
2381
2388
  }
2389
+ /**
2390
+ * Generates a custom UUID using a simple 26^8 method (8-character alphanumeric string with lowercase letters)
2391
+ * This has a higher chance of collision than a UUIDv4, but not only faster to generate than an UUIDV4,
2392
+ * it also has a smaller size, which is preferable to alleviate the overall data size.
2393
+ *
2394
+ * This method is preferable when generating uuids for the core data (sheetId, figureId, etc)
2395
+ * as they will appear several times in the revisions and local history.
2396
+ *
2397
+ */
2398
+ smallUuid() {
2399
+ if (this.isFastIdStrategy) {
2400
+ this.fastIdStart++;
2401
+ return String(this.fastIdStart);
2402
+ }
2403
+ else if (window.crypto) {
2404
+ return "10000000-1000".replace(/[01]/g, (c) => {
2405
+ const n = Number(c);
2406
+ return (n ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (n / 4)))).toString(16);
2407
+ });
2408
+ }
2409
+ else {
2410
+ // mainly for jest and other browsers that do not have the crypto functionality
2411
+ return "xxxxxxxx-xxxx".replace(/[xy]/g, function (c) {
2412
+ var r = (Math.random() * 16) | 0, v = c == "x" ? r : (r & 0x3) | 0x8;
2413
+ return v.toString(16);
2414
+ });
2415
+ }
2416
+ }
2417
+ /**
2418
+ * Generates an UUIDV4, has astronomically low chance of collision, but is larger in size than the smallUuid.
2419
+ * This method should be used when you need to avoid collisions at all costs, like the id of a revision.
2420
+ */
2382
2421
  uuidv4() {
2383
2422
  if (this.isFastIdStrategy) {
2384
2423
  this.fastIdStart++;
2385
2424
  return String(this.fastIdStart);
2386
- //@ts-ignore
2387
2425
  }
2388
- else if (window.crypto && window.crypto.getRandomValues) {
2389
- //@ts-ignore
2390
- return ([1e7] + -1e3 + -4e3 + -8e3 + -1e11).replace(/[018]/g, (c) => (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16));
2426
+ else if (window.crypto) {
2427
+ return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => {
2428
+ const n = Number(c);
2429
+ return (n ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (n / 4)))).toString(16);
2430
+ });
2391
2431
  }
2392
2432
  else {
2393
2433
  // mainly for jest and other browsers that do not have the crypto functionality
@@ -2492,17 +2532,20 @@ function toZoneWithoutBoundaryChanges(xc) {
2492
2532
  */
2493
2533
  function toUnboundedZone(xc) {
2494
2534
  const zone = toZoneWithoutBoundaryChanges(xc);
2535
+ reorderZone(zone);
2536
+ return zone;
2537
+ }
2538
+ function reorderZone(zone) {
2495
2539
  if (zone.right !== undefined && zone.right < zone.left) {
2496
- const tmp = zone.left;
2540
+ const right = zone.left;
2497
2541
  zone.left = zone.right;
2498
- zone.right = tmp;
2542
+ zone.right = right;
2499
2543
  }
2500
2544
  if (zone.bottom !== undefined && zone.bottom < zone.top) {
2501
- const tmp = zone.top;
2545
+ const bottom = zone.top;
2502
2546
  zone.top = zone.bottom;
2503
- zone.bottom = tmp;
2547
+ zone.bottom = bottom;
2504
2548
  }
2505
- return zone;
2506
2549
  }
2507
2550
  /**
2508
2551
  * Convert from a cartesian reference to a Zone.
@@ -3390,67 +3433,68 @@ exports.CommandResult = void 0;
3390
3433
  CommandResult[CommandResult["InvalidRange"] = 25] = "InvalidRange";
3391
3434
  CommandResult[CommandResult["InvalidZones"] = 26] = "InvalidZones";
3392
3435
  CommandResult[CommandResult["InvalidSheetId"] = 27] = "InvalidSheetId";
3393
- CommandResult[CommandResult["InputAlreadyFocused"] = 28] = "InputAlreadyFocused";
3394
- CommandResult[CommandResult["MaximumRangesReached"] = 29] = "MaximumRangesReached";
3395
- CommandResult[CommandResult["InvalidInputId"] = 30] = "InvalidInputId";
3396
- CommandResult[CommandResult["InvalidChartDefinition"] = 31] = "InvalidChartDefinition";
3397
- CommandResult[CommandResult["InvalidDataSet"] = 32] = "InvalidDataSet";
3398
- CommandResult[CommandResult["InvalidLabelRange"] = 33] = "InvalidLabelRange";
3399
- CommandResult[CommandResult["InvalidScorecardKeyValue"] = 34] = "InvalidScorecardKeyValue";
3400
- CommandResult[CommandResult["InvalidScorecardBaseline"] = 35] = "InvalidScorecardBaseline";
3401
- CommandResult[CommandResult["InvalidGaugeDataRange"] = 36] = "InvalidGaugeDataRange";
3402
- CommandResult[CommandResult["EmptyGaugeRangeMin"] = 37] = "EmptyGaugeRangeMin";
3403
- CommandResult[CommandResult["GaugeRangeMinNaN"] = 38] = "GaugeRangeMinNaN";
3404
- CommandResult[CommandResult["EmptyGaugeRangeMax"] = 39] = "EmptyGaugeRangeMax";
3405
- CommandResult[CommandResult["GaugeRangeMaxNaN"] = 40] = "GaugeRangeMaxNaN";
3406
- CommandResult[CommandResult["GaugeRangeMinBiggerThanRangeMax"] = 41] = "GaugeRangeMinBiggerThanRangeMax";
3407
- CommandResult[CommandResult["GaugeLowerInflectionPointNaN"] = 42] = "GaugeLowerInflectionPointNaN";
3408
- CommandResult[CommandResult["GaugeUpperInflectionPointNaN"] = 43] = "GaugeUpperInflectionPointNaN";
3409
- CommandResult[CommandResult["GaugeLowerBiggerThanUpper"] = 44] = "GaugeLowerBiggerThanUpper";
3410
- CommandResult[CommandResult["InvalidAutofillSelection"] = 45] = "InvalidAutofillSelection";
3411
- CommandResult[CommandResult["WrongComposerSelection"] = 46] = "WrongComposerSelection";
3412
- CommandResult[CommandResult["MinBiggerThanMax"] = 47] = "MinBiggerThanMax";
3413
- CommandResult[CommandResult["LowerBiggerThanUpper"] = 48] = "LowerBiggerThanUpper";
3414
- CommandResult[CommandResult["MidBiggerThanMax"] = 49] = "MidBiggerThanMax";
3415
- CommandResult[CommandResult["MinBiggerThanMid"] = 50] = "MinBiggerThanMid";
3416
- CommandResult[CommandResult["FirstArgMissing"] = 51] = "FirstArgMissing";
3417
- CommandResult[CommandResult["SecondArgMissing"] = 52] = "SecondArgMissing";
3418
- CommandResult[CommandResult["MinNaN"] = 53] = "MinNaN";
3419
- CommandResult[CommandResult["MidNaN"] = 54] = "MidNaN";
3420
- CommandResult[CommandResult["MaxNaN"] = 55] = "MaxNaN";
3421
- CommandResult[CommandResult["ValueUpperInflectionNaN"] = 56] = "ValueUpperInflectionNaN";
3422
- CommandResult[CommandResult["ValueLowerInflectionNaN"] = 57] = "ValueLowerInflectionNaN";
3423
- CommandResult[CommandResult["MinInvalidFormula"] = 58] = "MinInvalidFormula";
3424
- CommandResult[CommandResult["MidInvalidFormula"] = 59] = "MidInvalidFormula";
3425
- CommandResult[CommandResult["MaxInvalidFormula"] = 60] = "MaxInvalidFormula";
3426
- CommandResult[CommandResult["ValueUpperInvalidFormula"] = 61] = "ValueUpperInvalidFormula";
3427
- CommandResult[CommandResult["ValueLowerInvalidFormula"] = 62] = "ValueLowerInvalidFormula";
3428
- CommandResult[CommandResult["InvalidSortZone"] = 63] = "InvalidSortZone";
3429
- CommandResult[CommandResult["WaitingSessionConfirmation"] = 64] = "WaitingSessionConfirmation";
3430
- CommandResult[CommandResult["MergeOverlap"] = 65] = "MergeOverlap";
3431
- CommandResult[CommandResult["TooManyHiddenElements"] = 66] = "TooManyHiddenElements";
3432
- CommandResult[CommandResult["Readonly"] = 67] = "Readonly";
3433
- CommandResult[CommandResult["InvalidViewportSize"] = 68] = "InvalidViewportSize";
3434
- CommandResult[CommandResult["InvalidScrollingDirection"] = 69] = "InvalidScrollingDirection";
3435
- CommandResult[CommandResult["FigureDoesNotExist"] = 70] = "FigureDoesNotExist";
3436
- CommandResult[CommandResult["InvalidConditionalFormatId"] = 71] = "InvalidConditionalFormatId";
3437
- CommandResult[CommandResult["InvalidCellPopover"] = 72] = "InvalidCellPopover";
3438
- CommandResult[CommandResult["EmptyTarget"] = 73] = "EmptyTarget";
3439
- CommandResult[CommandResult["InvalidFreezeQuantity"] = 74] = "InvalidFreezeQuantity";
3440
- CommandResult[CommandResult["FrozenPaneOverlap"] = 75] = "FrozenPaneOverlap";
3441
- CommandResult[CommandResult["ValuesNotChanged"] = 76] = "ValuesNotChanged";
3442
- CommandResult[CommandResult["InvalidFilterZone"] = 77] = "InvalidFilterZone";
3443
- CommandResult[CommandResult["FilterOverlap"] = 78] = "FilterOverlap";
3444
- CommandResult[CommandResult["FilterNotFound"] = 79] = "FilterNotFound";
3445
- CommandResult[CommandResult["MergeInFilter"] = 80] = "MergeInFilter";
3446
- CommandResult[CommandResult["NonContinuousTargets"] = 81] = "NonContinuousTargets";
3447
- CommandResult[CommandResult["DuplicatedFigureId"] = 82] = "DuplicatedFigureId";
3448
- CommandResult[CommandResult["InvalidSelectionStep"] = 83] = "InvalidSelectionStep";
3449
- CommandResult[CommandResult["DuplicatedChartId"] = 84] = "DuplicatedChartId";
3450
- CommandResult[CommandResult["ChartDoesNotExist"] = 85] = "ChartDoesNotExist";
3451
- CommandResult[CommandResult["InvalidHeaderIndex"] = 86] = "InvalidHeaderIndex";
3452
- CommandResult[CommandResult["InvalidQuantity"] = 87] = "InvalidQuantity";
3453
- CommandResult[CommandResult["NoChanges"] = 88] = "NoChanges";
3436
+ CommandResult[CommandResult["InvalidCellId"] = 28] = "InvalidCellId";
3437
+ CommandResult[CommandResult["InputAlreadyFocused"] = 29] = "InputAlreadyFocused";
3438
+ CommandResult[CommandResult["MaximumRangesReached"] = 30] = "MaximumRangesReached";
3439
+ CommandResult[CommandResult["InvalidInputId"] = 31] = "InvalidInputId";
3440
+ CommandResult[CommandResult["InvalidChartDefinition"] = 32] = "InvalidChartDefinition";
3441
+ CommandResult[CommandResult["InvalidDataSet"] = 33] = "InvalidDataSet";
3442
+ CommandResult[CommandResult["InvalidLabelRange"] = 34] = "InvalidLabelRange";
3443
+ CommandResult[CommandResult["InvalidScorecardKeyValue"] = 35] = "InvalidScorecardKeyValue";
3444
+ CommandResult[CommandResult["InvalidScorecardBaseline"] = 36] = "InvalidScorecardBaseline";
3445
+ CommandResult[CommandResult["InvalidGaugeDataRange"] = 37] = "InvalidGaugeDataRange";
3446
+ CommandResult[CommandResult["EmptyGaugeRangeMin"] = 38] = "EmptyGaugeRangeMin";
3447
+ CommandResult[CommandResult["GaugeRangeMinNaN"] = 39] = "GaugeRangeMinNaN";
3448
+ CommandResult[CommandResult["EmptyGaugeRangeMax"] = 40] = "EmptyGaugeRangeMax";
3449
+ CommandResult[CommandResult["GaugeRangeMaxNaN"] = 41] = "GaugeRangeMaxNaN";
3450
+ CommandResult[CommandResult["GaugeRangeMinBiggerThanRangeMax"] = 42] = "GaugeRangeMinBiggerThanRangeMax";
3451
+ CommandResult[CommandResult["GaugeLowerInflectionPointNaN"] = 43] = "GaugeLowerInflectionPointNaN";
3452
+ CommandResult[CommandResult["GaugeUpperInflectionPointNaN"] = 44] = "GaugeUpperInflectionPointNaN";
3453
+ CommandResult[CommandResult["GaugeLowerBiggerThanUpper"] = 45] = "GaugeLowerBiggerThanUpper";
3454
+ CommandResult[CommandResult["InvalidAutofillSelection"] = 46] = "InvalidAutofillSelection";
3455
+ CommandResult[CommandResult["WrongComposerSelection"] = 47] = "WrongComposerSelection";
3456
+ CommandResult[CommandResult["MinBiggerThanMax"] = 48] = "MinBiggerThanMax";
3457
+ CommandResult[CommandResult["LowerBiggerThanUpper"] = 49] = "LowerBiggerThanUpper";
3458
+ CommandResult[CommandResult["MidBiggerThanMax"] = 50] = "MidBiggerThanMax";
3459
+ CommandResult[CommandResult["MinBiggerThanMid"] = 51] = "MinBiggerThanMid";
3460
+ CommandResult[CommandResult["FirstArgMissing"] = 52] = "FirstArgMissing";
3461
+ CommandResult[CommandResult["SecondArgMissing"] = 53] = "SecondArgMissing";
3462
+ CommandResult[CommandResult["MinNaN"] = 54] = "MinNaN";
3463
+ CommandResult[CommandResult["MidNaN"] = 55] = "MidNaN";
3464
+ CommandResult[CommandResult["MaxNaN"] = 56] = "MaxNaN";
3465
+ CommandResult[CommandResult["ValueUpperInflectionNaN"] = 57] = "ValueUpperInflectionNaN";
3466
+ CommandResult[CommandResult["ValueLowerInflectionNaN"] = 58] = "ValueLowerInflectionNaN";
3467
+ CommandResult[CommandResult["MinInvalidFormula"] = 59] = "MinInvalidFormula";
3468
+ CommandResult[CommandResult["MidInvalidFormula"] = 60] = "MidInvalidFormula";
3469
+ CommandResult[CommandResult["MaxInvalidFormula"] = 61] = "MaxInvalidFormula";
3470
+ CommandResult[CommandResult["ValueUpperInvalidFormula"] = 62] = "ValueUpperInvalidFormula";
3471
+ CommandResult[CommandResult["ValueLowerInvalidFormula"] = 63] = "ValueLowerInvalidFormula";
3472
+ CommandResult[CommandResult["InvalidSortZone"] = 64] = "InvalidSortZone";
3473
+ CommandResult[CommandResult["WaitingSessionConfirmation"] = 65] = "WaitingSessionConfirmation";
3474
+ CommandResult[CommandResult["MergeOverlap"] = 66] = "MergeOverlap";
3475
+ CommandResult[CommandResult["TooManyHiddenElements"] = 67] = "TooManyHiddenElements";
3476
+ CommandResult[CommandResult["Readonly"] = 68] = "Readonly";
3477
+ CommandResult[CommandResult["InvalidViewportSize"] = 69] = "InvalidViewportSize";
3478
+ CommandResult[CommandResult["InvalidScrollingDirection"] = 70] = "InvalidScrollingDirection";
3479
+ CommandResult[CommandResult["FigureDoesNotExist"] = 71] = "FigureDoesNotExist";
3480
+ CommandResult[CommandResult["InvalidConditionalFormatId"] = 72] = "InvalidConditionalFormatId";
3481
+ CommandResult[CommandResult["InvalidCellPopover"] = 73] = "InvalidCellPopover";
3482
+ CommandResult[CommandResult["EmptyTarget"] = 74] = "EmptyTarget";
3483
+ CommandResult[CommandResult["InvalidFreezeQuantity"] = 75] = "InvalidFreezeQuantity";
3484
+ CommandResult[CommandResult["FrozenPaneOverlap"] = 76] = "FrozenPaneOverlap";
3485
+ CommandResult[CommandResult["ValuesNotChanged"] = 77] = "ValuesNotChanged";
3486
+ CommandResult[CommandResult["InvalidFilterZone"] = 78] = "InvalidFilterZone";
3487
+ CommandResult[CommandResult["FilterOverlap"] = 79] = "FilterOverlap";
3488
+ CommandResult[CommandResult["FilterNotFound"] = 80] = "FilterNotFound";
3489
+ CommandResult[CommandResult["MergeInFilter"] = 81] = "MergeInFilter";
3490
+ CommandResult[CommandResult["NonContinuousTargets"] = 82] = "NonContinuousTargets";
3491
+ CommandResult[CommandResult["DuplicatedFigureId"] = 83] = "DuplicatedFigureId";
3492
+ CommandResult[CommandResult["InvalidSelectionStep"] = 84] = "InvalidSelectionStep";
3493
+ CommandResult[CommandResult["DuplicatedChartId"] = 85] = "DuplicatedChartId";
3494
+ CommandResult[CommandResult["ChartDoesNotExist"] = 86] = "ChartDoesNotExist";
3495
+ CommandResult[CommandResult["InvalidHeaderIndex"] = 87] = "InvalidHeaderIndex";
3496
+ CommandResult[CommandResult["InvalidQuantity"] = 88] = "InvalidQuantity";
3497
+ CommandResult[CommandResult["NoChanges"] = 89] = "NoChanges";
3454
3498
  })(exports.CommandResult || (exports.CommandResult = {}));
3455
3499
 
3456
3500
  function isMatrix(x) {
@@ -4980,7 +5024,7 @@ function interactiveSortSelection(env, sheetId, anchor, zone, sortDirection) {
4980
5024
  });
4981
5025
  }
4982
5026
  }
4983
- if (result.isCancelledBecause(63 /* CommandResult.InvalidSortZone */)) {
5027
+ if (result.isCancelledBecause(64 /* CommandResult.InvalidSortZone */)) {
4984
5028
  const { col, row } = anchor;
4985
5029
  env.model.selection.selectZone({ cell: { col, row }, zone });
4986
5030
  env.raiseError(_lt("Cannot sort. To sort, select only cells or only merges that have the same size."));
@@ -5003,13 +5047,13 @@ const AddFilterInteractiveContent = {
5003
5047
  };
5004
5048
  function interactiveAddFilter(env, sheetId, target) {
5005
5049
  const result = env.model.dispatch("CREATE_FILTER_TABLE", { target, sheetId });
5006
- if (result.isCancelledBecause(78 /* CommandResult.FilterOverlap */)) {
5050
+ if (result.isCancelledBecause(79 /* CommandResult.FilterOverlap */)) {
5007
5051
  env.raiseError(AddFilterInteractiveContent.filterOverlap);
5008
5052
  }
5009
- else if (result.isCancelledBecause(80 /* CommandResult.MergeInFilter */)) {
5053
+ else if (result.isCancelledBecause(81 /* CommandResult.MergeInFilter */)) {
5010
5054
  env.raiseError(AddFilterInteractiveContent.mergeInFilter);
5011
5055
  }
5012
- else if (result.isCancelledBecause(81 /* CommandResult.NonContinuousTargets */)) {
5056
+ else if (result.isCancelledBecause(82 /* CommandResult.NonContinuousTargets */)) {
5013
5057
  env.raiseError(AddFilterInteractiveContent.nonContinuousTargets);
5014
5058
  }
5015
5059
  }
@@ -5031,7 +5075,7 @@ function handlePasteResult(env, result) {
5031
5075
  else if (result.reasons.includes(22 /* CommandResult.WrongFigurePasteOption */)) {
5032
5076
  env.raiseError(PasteInteractiveContent.wrongFigurePasteOption);
5033
5077
  }
5034
- else if (result.reasons.includes(75 /* CommandResult.FrozenPaneOverlap */)) {
5078
+ else if (result.reasons.includes(76 /* CommandResult.FrozenPaneOverlap */)) {
5035
5079
  env.raiseError(PasteInteractiveContent.frozenPaneOverlap);
5036
5080
  }
5037
5081
  }
@@ -5536,7 +5580,7 @@ const UNHIDE_ROWS_ACTION = (env) => {
5536
5580
  const CREATE_SHEET_ACTION = (env) => {
5537
5581
  const activeSheetId = env.model.getters.getActiveSheetId();
5538
5582
  const position = env.model.getters.getSheetIds().indexOf(activeSheetId) + 1;
5539
- const sheetId = env.model.uuidGenerator.uuidv4();
5583
+ const sheetId = env.model.uuidGenerator.smallUuid();
5540
5584
  env.model.dispatch("CREATE_SHEET", { sheetId, position });
5541
5585
  env.model.dispatch("ACTIVATE_SHEET", { sheetIdFrom: activeSheetId, sheetIdTo: sheetId });
5542
5586
  };
@@ -5547,7 +5591,7 @@ const CREATE_CHART = (env) => {
5547
5591
  const getters = env.model.getters;
5548
5592
  const zone = getters.getSelectedZone();
5549
5593
  let dataSetZone = zone;
5550
- const id = env.model.uuidGenerator.uuidv4();
5594
+ const id = env.model.uuidGenerator.smallUuid();
5551
5595
  let labelRange;
5552
5596
  if (zone.left !== zone.right) {
5553
5597
  dataSetZone = { ...zone, left: zone.left + 1 };
@@ -6023,7 +6067,7 @@ sheetMenuRegistry
6023
6067
  name: _lt("Delete"),
6024
6068
  sequence: 10,
6025
6069
  isVisible: (env) => {
6026
- return env.model.getters.getSheetIds().length > 1;
6070
+ return env.model.getters.getVisibleSheetIds().length > 1;
6027
6071
  },
6028
6072
  action: (env) => env.askConfirmation(_lt("Are you sure you want to delete this sheet ?"), () => {
6029
6073
  env.model.dispatch("DELETE_SHEET", { sheetId: env.model.getters.getActiveSheetId() });
@@ -6034,7 +6078,7 @@ sheetMenuRegistry
6034
6078
  sequence: 20,
6035
6079
  action: (env) => {
6036
6080
  const sheetIdFrom = env.model.getters.getActiveSheetId();
6037
- const sheetIdTo = env.model.uuidGenerator.uuidv4();
6081
+ const sheetIdTo = env.model.uuidGenerator.smallUuid();
6038
6082
  env.model.dispatch("DUPLICATE_SHEET", {
6039
6083
  sheetId: sheetIdFrom,
6040
6084
  sheetIdTo,
@@ -6082,22 +6126,22 @@ sheetMenuRegistry
6082
6126
  const CfTerms = {
6083
6127
  Errors: {
6084
6128
  [25 /* CommandResult.InvalidRange */]: _lt("The range is invalid"),
6085
- [51 /* CommandResult.FirstArgMissing */]: _lt("The argument is missing. Please provide a value"),
6086
- [52 /* CommandResult.SecondArgMissing */]: _lt("The second argument is missing. Please provide a value"),
6087
- [53 /* CommandResult.MinNaN */]: _lt("The minpoint must be a number"),
6088
- [54 /* CommandResult.MidNaN */]: _lt("The midpoint must be a number"),
6089
- [55 /* CommandResult.MaxNaN */]: _lt("The maxpoint must be a number"),
6090
- [56 /* CommandResult.ValueUpperInflectionNaN */]: _lt("The first value must be a number"),
6091
- [57 /* CommandResult.ValueLowerInflectionNaN */]: _lt("The second value must be a number"),
6092
- [47 /* CommandResult.MinBiggerThanMax */]: _lt("Minimum must be smaller then Maximum"),
6093
- [50 /* CommandResult.MinBiggerThanMid */]: _lt("Minimum must be smaller then Midpoint"),
6094
- [49 /* CommandResult.MidBiggerThanMax */]: _lt("Midpoint must be smaller then Maximum"),
6095
- [48 /* CommandResult.LowerBiggerThanUpper */]: _lt("Lower inflection point must be smaller than upper inflection point"),
6096
- [58 /* CommandResult.MinInvalidFormula */]: _lt("Invalid Minpoint formula"),
6097
- [60 /* CommandResult.MaxInvalidFormula */]: _lt("Invalid Maxpoint formula"),
6098
- [59 /* CommandResult.MidInvalidFormula */]: _lt("Invalid Midpoint formula"),
6099
- [61 /* CommandResult.ValueUpperInvalidFormula */]: _lt("Invalid upper inflection point formula"),
6100
- [62 /* CommandResult.ValueLowerInvalidFormula */]: _lt("Invalid lower inflection point formula"),
6129
+ [52 /* CommandResult.FirstArgMissing */]: _lt("The argument is missing. Please provide a value"),
6130
+ [53 /* CommandResult.SecondArgMissing */]: _lt("The second argument is missing. Please provide a value"),
6131
+ [54 /* CommandResult.MinNaN */]: _lt("The minpoint must be a number"),
6132
+ [55 /* CommandResult.MidNaN */]: _lt("The midpoint must be a number"),
6133
+ [56 /* CommandResult.MaxNaN */]: _lt("The maxpoint must be a number"),
6134
+ [57 /* CommandResult.ValueUpperInflectionNaN */]: _lt("The first value must be a number"),
6135
+ [58 /* CommandResult.ValueLowerInflectionNaN */]: _lt("The second value must be a number"),
6136
+ [48 /* CommandResult.MinBiggerThanMax */]: _lt("Minimum must be smaller then Maximum"),
6137
+ [51 /* CommandResult.MinBiggerThanMid */]: _lt("Minimum must be smaller then Midpoint"),
6138
+ [50 /* CommandResult.MidBiggerThanMax */]: _lt("Midpoint must be smaller then Maximum"),
6139
+ [49 /* CommandResult.LowerBiggerThanUpper */]: _lt("Lower inflection point must be smaller than upper inflection point"),
6140
+ [59 /* CommandResult.MinInvalidFormula */]: _lt("Invalid Minpoint formula"),
6141
+ [61 /* CommandResult.MaxInvalidFormula */]: _lt("Invalid Maxpoint formula"),
6142
+ [60 /* CommandResult.MidInvalidFormula */]: _lt("Invalid Midpoint formula"),
6143
+ [62 /* CommandResult.ValueUpperInvalidFormula */]: _lt("Invalid upper inflection point formula"),
6144
+ [63 /* CommandResult.ValueLowerInvalidFormula */]: _lt("Invalid lower inflection point formula"),
6101
6145
  [24 /* CommandResult.EmptyRange */]: _lt("A range needs to be defined"),
6102
6146
  Unexpected: _lt("The rule is invalid for an unknown reason"),
6103
6147
  },
@@ -6125,20 +6169,20 @@ const ChartTerms = {
6125
6169
  Errors: {
6126
6170
  Unexpected: _lt("The chart definition is invalid for an unknown reason"),
6127
6171
  // BASIC CHART ERRORS (LINE | BAR | PIE)
6128
- [32 /* CommandResult.InvalidDataSet */]: _lt("The dataset is invalid"),
6129
- [33 /* CommandResult.InvalidLabelRange */]: _lt("Labels are invalid"),
6172
+ [33 /* CommandResult.InvalidDataSet */]: _lt("The dataset is invalid"),
6173
+ [34 /* CommandResult.InvalidLabelRange */]: _lt("Labels are invalid"),
6130
6174
  // SCORECARD CHART ERRORS
6131
- [34 /* CommandResult.InvalidScorecardKeyValue */]: _lt("The key value is invalid"),
6132
- [35 /* CommandResult.InvalidScorecardBaseline */]: _lt("The baseline value is invalid"),
6175
+ [35 /* CommandResult.InvalidScorecardKeyValue */]: _lt("The key value is invalid"),
6176
+ [36 /* CommandResult.InvalidScorecardBaseline */]: _lt("The baseline value is invalid"),
6133
6177
  // GAUGE CHART ERRORS
6134
- [36 /* CommandResult.InvalidGaugeDataRange */]: _lt("The data range is invalid"),
6135
- [37 /* CommandResult.EmptyGaugeRangeMin */]: _lt("A minimum range limit value is needed"),
6136
- [38 /* CommandResult.GaugeRangeMinNaN */]: _lt("The minimum range limit value must be a number"),
6137
- [39 /* CommandResult.EmptyGaugeRangeMax */]: _lt("A maximum range limit value is needed"),
6138
- [40 /* CommandResult.GaugeRangeMaxNaN */]: _lt("The maximum range limit value must be a number"),
6139
- [41 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */]: _lt("Minimum range limit must be smaller than maximum range limit"),
6140
- [42 /* CommandResult.GaugeLowerInflectionPointNaN */]: _lt("The lower inflection point value must be a number"),
6141
- [43 /* CommandResult.GaugeUpperInflectionPointNaN */]: _lt("The upper inflection point value must be a number"),
6178
+ [37 /* CommandResult.InvalidGaugeDataRange */]: _lt("The data range is invalid"),
6179
+ [38 /* CommandResult.EmptyGaugeRangeMin */]: _lt("A minimum range limit value is needed"),
6180
+ [39 /* CommandResult.GaugeRangeMinNaN */]: _lt("The minimum range limit value must be a number"),
6181
+ [40 /* CommandResult.EmptyGaugeRangeMax */]: _lt("A maximum range limit value is needed"),
6182
+ [41 /* CommandResult.GaugeRangeMaxNaN */]: _lt("The maximum range limit value must be a number"),
6183
+ [42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */]: _lt("Minimum range limit must be smaller than maximum range limit"),
6184
+ [43 /* CommandResult.GaugeLowerInflectionPointNaN */]: _lt("The lower inflection point value must be a number"),
6185
+ [44 /* CommandResult.GaugeUpperInflectionPointNaN */]: _lt("The upper inflection point value must be a number"),
6142
6186
  },
6143
6187
  };
6144
6188
  const NumberFormatTerms = {
@@ -6162,7 +6206,7 @@ function interactiveFreezeColumnsRows(env, dimension, base) {
6162
6206
  const sheetId = env.model.getters.getActiveSheetId();
6163
6207
  const cmd = dimension === "COL" ? "FREEZE_COLUMNS" : "FREEZE_ROWS";
6164
6208
  const result = env.model.dispatch(cmd, { sheetId, quantity: base });
6165
- if (result.isCancelledBecause(65 /* CommandResult.MergeOverlap */)) {
6209
+ if (result.isCancelledBecause(66 /* CommandResult.MergeOverlap */)) {
6166
6210
  env.raiseError(MergeErrorMessage);
6167
6211
  }
6168
6212
  }
@@ -6673,7 +6717,7 @@ css /* scss */ `
6673
6717
  class SelectionInput extends owl.Component {
6674
6718
  constructor() {
6675
6719
  super(...arguments);
6676
- this.id = uuidGenerator$1.uuidv4();
6720
+ this.id = uuidGenerator$1.smallUuid();
6677
6721
  this.previousRanges = this.props.ranges || [];
6678
6722
  this.originSheet = this.env.model.getters.getActiveSheetId();
6679
6723
  this.state = owl.useState({
@@ -6808,11 +6852,11 @@ class LineBarPieConfigPanel extends owl.Component {
6808
6852
  }
6809
6853
  get isDatasetInvalid() {
6810
6854
  var _a;
6811
- return !!((_a = this.state.datasetDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(32 /* CommandResult.InvalidDataSet */));
6855
+ return !!((_a = this.state.datasetDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(33 /* CommandResult.InvalidDataSet */));
6812
6856
  }
6813
6857
  get isLabelInvalid() {
6814
6858
  var _a;
6815
- return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(33 /* CommandResult.InvalidLabelRange */));
6859
+ return !!((_a = this.state.labelsDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(34 /* CommandResult.InvalidLabelRange */));
6816
6860
  }
6817
6861
  onUpdateDataSetsHaveTitle(ev) {
6818
6862
  this.props.updateChart(this.props.figureId, {
@@ -7156,11 +7200,11 @@ function checkDataset(definition) {
7156
7200
  if (definition.dataSets) {
7157
7201
  const invalidRanges = definition.dataSets.find((range) => !rangeReference.test(range)) !== undefined;
7158
7202
  if (invalidRanges) {
7159
- return 32 /* CommandResult.InvalidDataSet */;
7203
+ return 33 /* CommandResult.InvalidDataSet */;
7160
7204
  }
7161
7205
  const zones = definition.dataSets.map(toUnboundedZone);
7162
7206
  if (zones.some((zone) => zone.top !== zone.bottom && isFullRow(zone))) {
7163
- return 32 /* CommandResult.InvalidDataSet */;
7207
+ return 33 /* CommandResult.InvalidDataSet */;
7164
7208
  }
7165
7209
  }
7166
7210
  return 0 /* CommandResult.Success */;
@@ -7169,7 +7213,7 @@ function checkLabelRange(definition) {
7169
7213
  if (definition.labelRange) {
7170
7214
  const invalidLabels = !rangeReference.test(definition.labelRange || "");
7171
7215
  if (invalidLabels) {
7172
- return 33 /* CommandResult.InvalidLabelRange */;
7216
+ return 34 /* CommandResult.InvalidLabelRange */;
7173
7217
  }
7174
7218
  }
7175
7219
  return 0 /* CommandResult.Success */;
@@ -7630,7 +7674,7 @@ chartRegistry.add("gauge", {
7630
7674
  });
7631
7675
  function isDataRangeValid(definition) {
7632
7676
  return definition.dataRange && !rangeReference.test(definition.dataRange)
7633
- ? 36 /* CommandResult.InvalidGaugeDataRange */
7677
+ ? 37 /* CommandResult.InvalidGaugeDataRange */
7634
7678
  : 0 /* CommandResult.Success */;
7635
7679
  }
7636
7680
  function checkRangeLimits(check, batchValidations) {
@@ -7662,7 +7706,7 @@ function checkInflectionPointsValue(check, batchValidations) {
7662
7706
  function checkRangeMinBiggerThanRangeMax(definition) {
7663
7707
  if (definition.sectionRule) {
7664
7708
  if (Number(definition.sectionRule.rangeMin) >= Number(definition.sectionRule.rangeMax)) {
7665
- return 41 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */;
7709
+ return 42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */;
7666
7710
  }
7667
7711
  }
7668
7712
  return 0 /* CommandResult.Success */;
@@ -7671,9 +7715,9 @@ function checkEmpty(value, valueName) {
7671
7715
  if (value === "") {
7672
7716
  switch (valueName) {
7673
7717
  case "rangeMin":
7674
- return 37 /* CommandResult.EmptyGaugeRangeMin */;
7718
+ return 38 /* CommandResult.EmptyGaugeRangeMin */;
7675
7719
  case "rangeMax":
7676
- return 39 /* CommandResult.EmptyGaugeRangeMax */;
7720
+ return 40 /* CommandResult.EmptyGaugeRangeMax */;
7677
7721
  }
7678
7722
  }
7679
7723
  return 0 /* CommandResult.Success */;
@@ -7682,13 +7726,13 @@ function checkNaN(value, valueName) {
7682
7726
  if (isNaN(value)) {
7683
7727
  switch (valueName) {
7684
7728
  case "rangeMin":
7685
- return 38 /* CommandResult.GaugeRangeMinNaN */;
7729
+ return 39 /* CommandResult.GaugeRangeMinNaN */;
7686
7730
  case "rangeMax":
7687
- return 40 /* CommandResult.GaugeRangeMaxNaN */;
7731
+ return 41 /* CommandResult.GaugeRangeMaxNaN */;
7688
7732
  case "lowerInflectionPointValue":
7689
- return 42 /* CommandResult.GaugeLowerInflectionPointNaN */;
7733
+ return 43 /* CommandResult.GaugeLowerInflectionPointNaN */;
7690
7734
  case "upperInflectionPointValue":
7691
- return 43 /* CommandResult.GaugeUpperInflectionPointNaN */;
7735
+ return 44 /* CommandResult.GaugeUpperInflectionPointNaN */;
7692
7736
  }
7693
7737
  }
7694
7738
  return 0 /* CommandResult.Success */;
@@ -8429,7 +8473,7 @@ function createPieChartRuntime(chart, getters) {
8429
8473
  const dataset = {
8430
8474
  label,
8431
8475
  data,
8432
- borderColor: "#FFFFFF",
8476
+ borderColor: chart.background || "#FFFFFF",
8433
8477
  backgroundColor,
8434
8478
  };
8435
8479
  config.data.datasets.push(dataset);
@@ -8448,12 +8492,12 @@ chartRegistry.add("scorecard", {
8448
8492
  });
8449
8493
  function checkKeyValue(definition) {
8450
8494
  return definition.keyValue && !rangeReference.test(definition.keyValue)
8451
- ? 34 /* CommandResult.InvalidScorecardKeyValue */
8495
+ ? 35 /* CommandResult.InvalidScorecardKeyValue */
8452
8496
  : 0 /* CommandResult.Success */;
8453
8497
  }
8454
8498
  function checkBaseline(definition) {
8455
8499
  return definition.baseline && !rangeReference.test(definition.baseline)
8456
- ? 35 /* CommandResult.InvalidScorecardBaseline */
8500
+ ? 36 /* CommandResult.InvalidScorecardBaseline */
8457
8501
  : 0 /* CommandResult.Success */;
8458
8502
  }
8459
8503
  class ScorecardChart$1 extends AbstractChart {
@@ -8882,7 +8926,7 @@ class GaugeChartConfigPanel extends owl.Component {
8882
8926
  }
8883
8927
  get isDataRangeInvalid() {
8884
8928
  var _a;
8885
- return !!((_a = this.state.dataRangeDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(36 /* CommandResult.InvalidGaugeDataRange */));
8929
+ return !!((_a = this.state.dataRangeDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(37 /* CommandResult.InvalidGaugeDataRange */));
8886
8930
  }
8887
8931
  onDataRangeChanged(ranges) {
8888
8932
  this.dataRange = ranges[0];
@@ -8969,28 +9013,28 @@ class GaugeChartDesignPanel extends owl.Component {
8969
9013
  }
8970
9014
  isRangeMinInvalid() {
8971
9015
  var _a, _b, _c;
8972
- return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(37 /* CommandResult.EmptyGaugeRangeMin */)) ||
8973
- ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(38 /* CommandResult.GaugeRangeMinNaN */)) ||
8974
- ((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(41 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
9016
+ return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(38 /* CommandResult.EmptyGaugeRangeMin */)) ||
9017
+ ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(39 /* CommandResult.GaugeRangeMinNaN */)) ||
9018
+ ((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
8975
9019
  }
8976
9020
  isRangeMaxInvalid() {
8977
9021
  var _a, _b, _c;
8978
- return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(39 /* CommandResult.EmptyGaugeRangeMax */)) ||
8979
- ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(40 /* CommandResult.GaugeRangeMaxNaN */)) ||
8980
- ((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(41 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
9022
+ return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(40 /* CommandResult.EmptyGaugeRangeMax */)) ||
9023
+ ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(41 /* CommandResult.GaugeRangeMaxNaN */)) ||
9024
+ ((_c = this.state.sectionRuleDispatchResult) === null || _c === void 0 ? void 0 : _c.isCancelledBecause(42 /* CommandResult.GaugeRangeMinBiggerThanRangeMax */)));
8981
9025
  }
8982
9026
  // ---------------------------------------------------------------------------
8983
9027
  // COLOR_SECTION_TEMPLATE
8984
9028
  // ---------------------------------------------------------------------------
8985
9029
  get isLowerInflectionPointInvalid() {
8986
9030
  var _a, _b;
8987
- return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(42 /* CommandResult.GaugeLowerInflectionPointNaN */)) ||
8988
- ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(44 /* CommandResult.GaugeLowerBiggerThanUpper */)));
9031
+ return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(43 /* CommandResult.GaugeLowerInflectionPointNaN */)) ||
9032
+ ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(45 /* CommandResult.GaugeLowerBiggerThanUpper */)));
8989
9033
  }
8990
9034
  get isUpperInflectionPointInvalid() {
8991
9035
  var _a, _b;
8992
- return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(43 /* CommandResult.GaugeUpperInflectionPointNaN */)) ||
8993
- ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(44 /* CommandResult.GaugeLowerBiggerThanUpper */)));
9036
+ return !!(((_a = this.state.sectionRuleDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(44 /* CommandResult.GaugeUpperInflectionPointNaN */)) ||
9037
+ ((_b = this.state.sectionRuleDispatchResult) === null || _b === void 0 ? void 0 : _b.isCancelledBecause(45 /* CommandResult.GaugeLowerBiggerThanUpper */)));
8994
9038
  }
8995
9039
  updateInflectionPointValue(attr, ev) {
8996
9040
  const sectionRule = deepCopy(this.props.definition.sectionRule);
@@ -9093,11 +9137,11 @@ class ScorecardChartConfigPanel extends owl.Component {
9093
9137
  }
9094
9138
  get isKeyValueInvalid() {
9095
9139
  var _a;
9096
- return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(34 /* CommandResult.InvalidScorecardKeyValue */));
9140
+ return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(35 /* CommandResult.InvalidScorecardKeyValue */));
9097
9141
  }
9098
9142
  get isBaselineInvalid() {
9099
9143
  var _a;
9100
- return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(35 /* CommandResult.InvalidScorecardBaseline */));
9144
+ return !!((_a = this.state.keyValueDispatchResult) === null || _a === void 0 ? void 0 : _a.isCancelledBecause(36 /* CommandResult.InvalidScorecardBaseline */));
9101
9145
  }
9102
9146
  onKeyValueRangeChanged(ranges) {
9103
9147
  this.keyValue = ranges[0];
@@ -9790,7 +9834,7 @@ class ConditionalFormattingPanel extends owl.Component {
9790
9834
  rule: this.getEditorRule(),
9791
9835
  id: this.state.mode === "edit"
9792
9836
  ? this.state.currentCF.id
9793
- : this.env.model.uuidGenerator.uuidv4(),
9837
+ : this.env.model.uuidGenerator.smallUuid(),
9794
9838
  },
9795
9839
  ranges: this.state.currentCF.ranges.map((xc) => this.env.model.getters.getRangeDataFromXc(sheetId, xc)),
9796
9840
  sheetId,
@@ -9858,7 +9902,7 @@ class ConditionalFormattingPanel extends owl.Component {
9858
9902
  this.state.mode = "add";
9859
9903
  this.state.currentCFType = "CellIsRule";
9860
9904
  this.state.currentCF = {
9861
- id: this.env.model.uuidGenerator.uuidv4(),
9905
+ id: this.env.model.uuidGenerator.smallUuid(),
9862
9906
  ranges: this.env.model.getters
9863
9907
  .getSelectedZones()
9864
9908
  .map((zone) => this.env.model.getters.zoneToXC(this.env.model.getters.getActiveSheetId(), zone)),
@@ -9937,11 +9981,11 @@ class ConditionalFormattingPanel extends owl.Component {
9937
9981
  ****************************************************************************/
9938
9982
  get isValue1Invalid() {
9939
9983
  var _a;
9940
- return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(51 /* CommandResult.FirstArgMissing */));
9984
+ return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(52 /* CommandResult.FirstArgMissing */));
9941
9985
  }
9942
9986
  get isValue2Invalid() {
9943
9987
  var _a;
9944
- return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(52 /* CommandResult.SecondArgMissing */));
9988
+ return !!((_a = this.state.errors) === null || _a === void 0 ? void 0 : _a.includes(53 /* CommandResult.SecondArgMissing */));
9945
9989
  }
9946
9990
  toggleStyle(tool) {
9947
9991
  const style = this.state.rules.cellIs.style;
@@ -9958,17 +10002,17 @@ class ConditionalFormattingPanel extends owl.Component {
9958
10002
  isValueInvalid(threshold) {
9959
10003
  switch (threshold) {
9960
10004
  case "minimum":
9961
- return (this.state.errors.includes(58 /* CommandResult.MinInvalidFormula */) ||
9962
- this.state.errors.includes(50 /* CommandResult.MinBiggerThanMid */) ||
9963
- this.state.errors.includes(47 /* CommandResult.MinBiggerThanMax */) ||
9964
- this.state.errors.includes(53 /* CommandResult.MinNaN */));
10005
+ return (this.state.errors.includes(59 /* CommandResult.MinInvalidFormula */) ||
10006
+ this.state.errors.includes(51 /* CommandResult.MinBiggerThanMid */) ||
10007
+ this.state.errors.includes(48 /* CommandResult.MinBiggerThanMax */) ||
10008
+ this.state.errors.includes(54 /* CommandResult.MinNaN */));
9965
10009
  case "midpoint":
9966
- return (this.state.errors.includes(59 /* CommandResult.MidInvalidFormula */) ||
9967
- this.state.errors.includes(54 /* CommandResult.MidNaN */) ||
9968
- this.state.errors.includes(49 /* CommandResult.MidBiggerThanMax */));
10010
+ return (this.state.errors.includes(60 /* CommandResult.MidInvalidFormula */) ||
10011
+ this.state.errors.includes(55 /* CommandResult.MidNaN */) ||
10012
+ this.state.errors.includes(50 /* CommandResult.MidBiggerThanMax */));
9969
10013
  case "maximum":
9970
- return (this.state.errors.includes(60 /* CommandResult.MaxInvalidFormula */) ||
9971
- this.state.errors.includes(55 /* CommandResult.MaxNaN */));
10014
+ return (this.state.errors.includes(61 /* CommandResult.MaxInvalidFormula */) ||
10015
+ this.state.errors.includes(56 /* CommandResult.MaxNaN */));
9972
10016
  default:
9973
10017
  return false;
9974
10018
  }
@@ -10020,13 +10064,13 @@ class ConditionalFormattingPanel extends owl.Component {
10020
10064
  isInflectionPointInvalid(inflectionPoint) {
10021
10065
  switch (inflectionPoint) {
10022
10066
  case "lowerInflectionPoint":
10023
- return (this.state.errors.includes(57 /* CommandResult.ValueLowerInflectionNaN */) ||
10024
- this.state.errors.includes(62 /* CommandResult.ValueLowerInvalidFormula */) ||
10025
- this.state.errors.includes(48 /* CommandResult.LowerBiggerThanUpper */));
10067
+ return (this.state.errors.includes(58 /* CommandResult.ValueLowerInflectionNaN */) ||
10068
+ this.state.errors.includes(63 /* CommandResult.ValueLowerInvalidFormula */) ||
10069
+ this.state.errors.includes(49 /* CommandResult.LowerBiggerThanUpper */));
10026
10070
  case "upperInflectionPoint":
10027
- return (this.state.errors.includes(56 /* CommandResult.ValueUpperInflectionNaN */) ||
10028
- this.state.errors.includes(61 /* CommandResult.ValueUpperInvalidFormula */) ||
10029
- this.state.errors.includes(48 /* CommandResult.LowerBiggerThanUpper */));
10071
+ return (this.state.errors.includes(57 /* CommandResult.ValueUpperInflectionNaN */) ||
10072
+ this.state.errors.includes(62 /* CommandResult.ValueUpperInvalidFormula */) ||
10073
+ this.state.errors.includes(49 /* CommandResult.LowerBiggerThanUpper */));
10030
10074
  default:
10031
10075
  return true;
10032
10076
  }
@@ -10346,7 +10390,7 @@ class TopBarComponentRegistry extends Registry {
10346
10390
  this.uuidGenerator = new UuidGenerator();
10347
10391
  }
10348
10392
  add(name, value) {
10349
- const component = { ...value, id: this.uuidGenerator.uuidv4() };
10393
+ const component = { ...value, id: this.uuidGenerator.smallUuid() };
10350
10394
  return super.add(name, component);
10351
10395
  }
10352
10396
  }
@@ -12344,6 +12388,26 @@ const LN = {
12344
12388
  isExported: true,
12345
12389
  };
12346
12390
  // -----------------------------------------------------------------------------
12391
+ // LOG
12392
+ // -----------------------------------------------------------------------------
12393
+ const LOG = {
12394
+ description: _lt("The logarithm of a number, for a given base."),
12395
+ args: args(`
12396
+ value (number) ${_lt("The value for which to calculate the logarithm, base e.")}
12397
+ base (number, default=10) ${_lt("The base of the logarithm.")}
12398
+ `),
12399
+ returns: ["NUMBER"],
12400
+ compute: function (value, base = 10) {
12401
+ const _value = toNumber(value);
12402
+ const _base = toNumber(base);
12403
+ assert(() => _value > 0, _lt("The value (%s) must be strictly positive.", _value.toString()));
12404
+ assert(() => _base > 0, _lt("The base (%s) must be strictly positive.", _base.toString()));
12405
+ assert(() => _base !== 1, _lt("The base must be different from 1."));
12406
+ return Math.log10(_value) / Math.log10(_base);
12407
+ },
12408
+ isExported: true,
12409
+ };
12410
+ // -----------------------------------------------------------------------------
12347
12411
  // MOD
12348
12412
  // -----------------------------------------------------------------------------
12349
12413
  const MOD = {
@@ -12812,6 +12876,7 @@ var math = /*#__PURE__*/Object.freeze({
12812
12876
  ISO_CEILING: ISO_CEILING,
12813
12877
  ISODD: ISODD,
12814
12878
  LN: LN,
12879
+ LOG: LOG,
12815
12880
  MOD: MOD,
12816
12881
  ODD: ODD,
12817
12882
  PI: PI,
@@ -19688,7 +19753,7 @@ class EditionPlugin extends UIPlugin {
19688
19753
  validateSelection(length, start, end) {
19689
19754
  return start >= 0 && start <= length && end >= 0 && end <= length
19690
19755
  ? 0 /* CommandResult.Success */
19691
- : 46 /* CommandResult.WrongComposerSelection */;
19756
+ : 47 /* CommandResult.WrongComposerSelection */;
19692
19757
  }
19693
19758
  onColumnsRemoved(cmd) {
19694
19759
  if (cmd.elements.includes(this.col) && this.mode !== "inactive") {
@@ -27248,7 +27313,7 @@ function forceUnicityOfFigure(data) {
27248
27313
  for (const sheet of data.sheets || []) {
27249
27314
  for (const figure of sheet.figures || []) {
27250
27315
  if (figureIds.has(figure.id)) {
27251
- figure.id += uuidGenerator.uuidv4();
27316
+ figure.id += uuidGenerator.smallUuid();
27252
27317
  }
27253
27318
  figureIds.add(figure.id);
27254
27319
  }
@@ -27933,7 +27998,7 @@ class BordersPlugin extends CorePlugin {
27933
27998
  const currentBorder = this.getCellBorder(cmd.sheetId, cmd.col, cmd.row);
27934
27999
  const areAllNewBordersUndefined = !((_a = cmd.border) === null || _a === void 0 ? void 0 : _a.bottom) && !((_b = cmd.border) === null || _b === void 0 ? void 0 : _b.left) && !((_c = cmd.border) === null || _c === void 0 ? void 0 : _c.right) && !((_d = cmd.border) === null || _d === void 0 ? void 0 : _d.top);
27935
28000
  if ((!currentBorder && areAllNewBordersUndefined) || deepEquals(currentBorder, cmd.border)) {
27936
- return 88 /* CommandResult.NoChanges */;
28001
+ return 89 /* CommandResult.NoChanges */;
27937
28002
  }
27938
28003
  return 0 /* CommandResult.Success */;
27939
28004
  }
@@ -28039,11 +28104,16 @@ class CellPlugin extends CorePlugin {
28039
28104
  // Command Handling
28040
28105
  // ---------------------------------------------------------------------------
28041
28106
  allowDispatch(cmd) {
28107
+ var _a;
28042
28108
  switch (cmd.type) {
28043
28109
  case "UPDATE_CELL":
28044
28110
  return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessUpdateCell);
28045
28111
  case "CLEAR_CELL":
28046
28112
  return this.checkValidations(cmd, this.checkCellOutOfSheet, this.checkUselessClearCell);
28113
+ case "UPDATE_CELL_POSITION":
28114
+ return !cmd.cellId || ((_a = this.cells[cmd.sheetId]) === null || _a === void 0 ? void 0 : _a[cmd.cellId])
28115
+ ? 0 /* CommandResult.Success */
28116
+ : 28 /* CommandResult.InvalidCellId */;
28047
28117
  default:
28048
28118
  return 0 /* CommandResult.Success */;
28049
28119
  }
@@ -28082,6 +28152,9 @@ class CellPlugin extends CorePlugin {
28082
28152
  format: "",
28083
28153
  });
28084
28154
  break;
28155
+ case "DELETE_SHEET": {
28156
+ this.history.update("cells", cmd.sheetId, undefined);
28157
+ }
28085
28158
  }
28086
28159
  }
28087
28160
  /**
@@ -28397,9 +28470,9 @@ class CellPlugin extends CorePlugin {
28397
28470
  checkUselessClearCell(cmd) {
28398
28471
  const cell = this.getters.getCell(cmd.sheetId, cmd.col, cmd.row);
28399
28472
  if (!cell)
28400
- return 88 /* CommandResult.NoChanges */;
28473
+ return 89 /* CommandResult.NoChanges */;
28401
28474
  if (!cell.content && !cell.style && !cell.format) {
28402
- return 88 /* CommandResult.NoChanges */;
28475
+ return 89 /* CommandResult.NoChanges */;
28403
28476
  }
28404
28477
  return 0 /* CommandResult.Success */;
28405
28478
  }
@@ -28411,7 +28484,7 @@ class CellPlugin extends CorePlugin {
28411
28484
  if ((!hasContent || (cell === null || cell === void 0 ? void 0 : cell.content) === cmd.content) &&
28412
28485
  (!hasStyle || deepEquals(cell === null || cell === void 0 ? void 0 : cell.style, cmd.style)) &&
28413
28486
  (!hasFormat || (cell === null || cell === void 0 ? void 0 : cell.format) === cmd.format)) {
28414
- return 88 /* CommandResult.NoChanges */;
28487
+ return 89 /* CommandResult.NoChanges */;
28415
28488
  }
28416
28489
  return 0 /* CommandResult.Success */;
28417
28490
  }
@@ -28620,13 +28693,13 @@ class ChartPlugin extends CorePlugin {
28620
28693
  }
28621
28694
  checkChartDuplicate(cmd) {
28622
28695
  return this.getters.getFigureSheetId(cmd.id)
28623
- ? 84 /* CommandResult.DuplicatedChartId */
28696
+ ? 85 /* CommandResult.DuplicatedChartId */
28624
28697
  : 0 /* CommandResult.Success */;
28625
28698
  }
28626
28699
  checkChartExists(cmd) {
28627
28700
  return this.getters.getFigureSheetId(cmd.id)
28628
28701
  ? 0 /* CommandResult.Success */
28629
- : 85 /* CommandResult.ChartDoesNotExist */;
28702
+ : 86 /* CommandResult.ChartDoesNotExist */;
28630
28703
  }
28631
28704
  }
28632
28705
  ChartPlugin.getters = [
@@ -28834,10 +28907,10 @@ class ConditionalFormatPlugin extends CorePlugin {
28834
28907
  return 27 /* CommandResult.InvalidSheetId */;
28835
28908
  const ruleIndex = this.cfRules[sheetId].findIndex((cf) => cf.id === cfId);
28836
28909
  if (ruleIndex === -1)
28837
- return 71 /* CommandResult.InvalidConditionalFormatId */;
28910
+ return 72 /* CommandResult.InvalidConditionalFormatId */;
28838
28911
  const cfIndex2 = direction === "up" ? ruleIndex - 1 : ruleIndex + 1;
28839
28912
  if (cfIndex2 < 0 || cfIndex2 >= this.cfRules[sheetId].length) {
28840
- return 71 /* CommandResult.InvalidConditionalFormatId */;
28913
+ return 72 /* CommandResult.InvalidConditionalFormatId */;
28841
28914
  }
28842
28915
  return 0 /* CommandResult.Success */;
28843
28916
  }
@@ -28878,10 +28951,10 @@ class ConditionalFormatPlugin extends CorePlugin {
28878
28951
  const errors = [];
28879
28952
  const isEmpty = (value) => value === undefined || value === "";
28880
28953
  if (expectedNumber >= 1 && isEmpty(rule.values[0])) {
28881
- errors.push(51 /* CommandResult.FirstArgMissing */);
28954
+ errors.push(52 /* CommandResult.FirstArgMissing */);
28882
28955
  }
28883
28956
  if (expectedNumber >= 2 && isEmpty(rule.values[1])) {
28884
- errors.push(52 /* CommandResult.SecondArgMissing */);
28957
+ errors.push(53 /* CommandResult.SecondArgMissing */);
28885
28958
  }
28886
28959
  return errors.length ? errors : 0 /* CommandResult.Success */;
28887
28960
  }
@@ -28893,15 +28966,15 @@ class ConditionalFormatPlugin extends CorePlugin {
28893
28966
  (threshold.value === "" || isNaN(threshold.value))) {
28894
28967
  switch (thresholdName) {
28895
28968
  case "min":
28896
- return 53 /* CommandResult.MinNaN */;
28969
+ return 54 /* CommandResult.MinNaN */;
28897
28970
  case "max":
28898
- return 55 /* CommandResult.MaxNaN */;
28971
+ return 56 /* CommandResult.MaxNaN */;
28899
28972
  case "mid":
28900
- return 54 /* CommandResult.MidNaN */;
28973
+ return 55 /* CommandResult.MidNaN */;
28901
28974
  case "upperInflectionPoint":
28902
- return 56 /* CommandResult.ValueUpperInflectionNaN */;
28975
+ return 57 /* CommandResult.ValueUpperInflectionNaN */;
28903
28976
  case "lowerInflectionPoint":
28904
- return 57 /* CommandResult.ValueLowerInflectionNaN */;
28977
+ return 58 /* CommandResult.ValueLowerInflectionNaN */;
28905
28978
  }
28906
28979
  }
28907
28980
  return 0 /* CommandResult.Success */;
@@ -28915,15 +28988,15 @@ class ConditionalFormatPlugin extends CorePlugin {
28915
28988
  catch (error) {
28916
28989
  switch (thresholdName) {
28917
28990
  case "min":
28918
- return 58 /* CommandResult.MinInvalidFormula */;
28991
+ return 59 /* CommandResult.MinInvalidFormula */;
28919
28992
  case "max":
28920
- return 60 /* CommandResult.MaxInvalidFormula */;
28993
+ return 61 /* CommandResult.MaxInvalidFormula */;
28921
28994
  case "mid":
28922
- return 59 /* CommandResult.MidInvalidFormula */;
28995
+ return 60 /* CommandResult.MidInvalidFormula */;
28923
28996
  case "upperInflectionPoint":
28924
- return 61 /* CommandResult.ValueUpperInvalidFormula */;
28997
+ return 62 /* CommandResult.ValueUpperInvalidFormula */;
28925
28998
  case "lowerInflectionPoint":
28926
- return 62 /* CommandResult.ValueLowerInvalidFormula */;
28999
+ return 63 /* CommandResult.ValueLowerInvalidFormula */;
28927
29000
  }
28928
29001
  }
28929
29002
  return 0 /* CommandResult.Success */;
@@ -28940,7 +29013,7 @@ class ConditionalFormatPlugin extends CorePlugin {
28940
29013
  if (["number", "percentage", "percentile"].includes(rule.lowerInflectionPoint.type) &&
28941
29014
  rule.lowerInflectionPoint.type === rule.upperInflectionPoint.type &&
28942
29015
  Number(minValue) > Number(maxValue)) {
28943
- return 48 /* CommandResult.LowerBiggerThanUpper */;
29016
+ return 49 /* CommandResult.LowerBiggerThanUpper */;
28944
29017
  }
28945
29018
  return 0 /* CommandResult.Success */;
28946
29019
  }
@@ -28950,7 +29023,7 @@ class ConditionalFormatPlugin extends CorePlugin {
28950
29023
  if (["number", "percentage", "percentile"].includes(rule.minimum.type) &&
28951
29024
  rule.minimum.type === rule.maximum.type &&
28952
29025
  stringToNumber(minValue) >= stringToNumber(maxValue)) {
28953
- return 47 /* CommandResult.MinBiggerThanMax */;
29026
+ return 48 /* CommandResult.MinBiggerThanMax */;
28954
29027
  }
28955
29028
  return 0 /* CommandResult.Success */;
28956
29029
  }
@@ -28962,7 +29035,7 @@ class ConditionalFormatPlugin extends CorePlugin {
28962
29035
  ["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
28963
29036
  rule.midpoint.type === rule.maximum.type &&
28964
29037
  stringToNumber(midValue) >= stringToNumber(maxValue)) {
28965
- return 49 /* CommandResult.MidBiggerThanMax */;
29038
+ return 50 /* CommandResult.MidBiggerThanMax */;
28966
29039
  }
28967
29040
  return 0 /* CommandResult.Success */;
28968
29041
  }
@@ -28974,7 +29047,7 @@ class ConditionalFormatPlugin extends CorePlugin {
28974
29047
  ["number", "percentage", "percentile"].includes(rule.midpoint.type) &&
28975
29048
  rule.minimum.type === rule.midpoint.type &&
28976
29049
  stringToNumber(minValue) >= stringToNumber(midValue)) {
28977
- return 50 /* CommandResult.MinBiggerThanMid */;
29050
+ return 51 /* CommandResult.MinBiggerThanMid */;
28978
29051
  }
28979
29052
  return 0 /* CommandResult.Success */;
28980
29053
  }
@@ -29084,13 +29157,13 @@ class FigurePlugin extends CorePlugin {
29084
29157
  checkFigureExists(sheetId, figureId) {
29085
29158
  var _a;
29086
29159
  if (((_a = this.figures[sheetId]) === null || _a === void 0 ? void 0 : _a[figureId]) === undefined) {
29087
- return 70 /* CommandResult.FigureDoesNotExist */;
29160
+ return 71 /* CommandResult.FigureDoesNotExist */;
29088
29161
  }
29089
29162
  return 0 /* CommandResult.Success */;
29090
29163
  }
29091
29164
  checkFigureDuplicate(figureId) {
29092
29165
  if (Object.values(this.figures).find((sheet) => sheet === null || sheet === void 0 ? void 0 : sheet[figureId])) {
29093
- return 82 /* CommandResult.DuplicatedFigureId */;
29166
+ return 83 /* CommandResult.DuplicatedFigureId */;
29094
29167
  }
29095
29168
  return 0 /* CommandResult.Success */;
29096
29169
  }
@@ -29138,10 +29211,10 @@ class FilterTable {
29138
29211
  this.filters = [];
29139
29212
  this.zone = zone;
29140
29213
  const uuid = new UuidGenerator();
29141
- this.id = uuid.uuidv4();
29214
+ this.id = uuid.smallUuid();
29142
29215
  for (const i of range(zone.left, zone.right + 1)) {
29143
29216
  const filterZone = { ...this.zone, left: i, right: i };
29144
- this.filters.push(new Filter(uuid.uuidv4(), filterZone));
29217
+ this.filters.push(new Filter(uuid.smallUuid(), filterZone));
29145
29218
  }
29146
29219
  }
29147
29220
  /** Get zone of the table without the headers */
@@ -29192,12 +29265,12 @@ class FiltersPlugin extends CorePlugin {
29192
29265
  switch (cmd.type) {
29193
29266
  case "CREATE_FILTER_TABLE":
29194
29267
  if (!areZonesContinuous(...cmd.target)) {
29195
- return 81 /* CommandResult.NonContinuousTargets */;
29268
+ return 82 /* CommandResult.NonContinuousTargets */;
29196
29269
  }
29197
29270
  const zone = union(...cmd.target);
29198
29271
  const checkFilterOverlap = () => {
29199
29272
  if (this.getFilterTables(cmd.sheetId).some((filter) => overlap(filter.zone, zone))) {
29200
- return 78 /* CommandResult.FilterOverlap */;
29273
+ return 79 /* CommandResult.FilterOverlap */;
29201
29274
  }
29202
29275
  return 0 /* CommandResult.Success */;
29203
29276
  };
@@ -29205,7 +29278,7 @@ class FiltersPlugin extends CorePlugin {
29205
29278
  const mergesInTarget = this.getters.getMergesInZone(cmd.sheetId, zone);
29206
29279
  for (let merge of mergesInTarget) {
29207
29280
  if (overlap(zone, merge)) {
29208
- return 80 /* CommandResult.MergeInFilter */;
29281
+ return 81 /* CommandResult.MergeInFilter */;
29209
29282
  }
29210
29283
  }
29211
29284
  return 0 /* CommandResult.Success */;
@@ -29215,7 +29288,7 @@ class FiltersPlugin extends CorePlugin {
29215
29288
  for (let merge of cmd.target) {
29216
29289
  for (let filterTable of this.getFilterTables(cmd.sheetId)) {
29217
29290
  if (overlap(filterTable.zone, merge)) {
29218
- return 80 /* CommandResult.MergeInFilter */;
29291
+ return 81 /* CommandResult.MergeInFilter */;
29219
29292
  }
29220
29293
  }
29221
29294
  }
@@ -29321,7 +29394,7 @@ class FiltersPlugin extends CorePlugin {
29321
29394
  if (filters.length < zoneToDimension(zone).width) {
29322
29395
  for (let col = zone.left; col <= zone.right; col++) {
29323
29396
  if (!filters.find((filter) => filter.col === col)) {
29324
- filters.push(new Filter(this.uuidGenerator.uuidv4(), { ...zone, left: col, right: col }));
29397
+ filters.push(new Filter(this.uuidGenerator.smallUuid(), { ...zone, left: col, right: col }));
29325
29398
  }
29326
29399
  }
29327
29400
  filters.sort((f1, f2) => f1.col - f2.col);
@@ -29725,10 +29798,10 @@ class HeaderVisibilityPlugin extends CorePlugin {
29725
29798
  : this.getters.getNumberRows(cmd.sheetId);
29726
29799
  const hiddenElements = new Set((hiddenGroup || []).flat().concat(cmd.elements));
29727
29800
  if (hiddenElements.size >= elements) {
29728
- return 66 /* CommandResult.TooManyHiddenElements */;
29801
+ return 67 /* CommandResult.TooManyHiddenElements */;
29729
29802
  }
29730
29803
  else if (largeMin(cmd.elements) < 0 || largeMax(cmd.elements) > elements) {
29731
- return 86 /* CommandResult.InvalidHeaderIndex */;
29804
+ return 87 /* CommandResult.InvalidHeaderIndex */;
29732
29805
  }
29733
29806
  else {
29734
29807
  return 0 /* CommandResult.Success */;
@@ -30131,7 +30204,7 @@ class MergePlugin extends CorePlugin {
30131
30204
  for (const zone of target) {
30132
30205
  for (const zone2 of target) {
30133
30206
  if (zone !== zone2 && overlap(zone, zone2)) {
30134
- return 65 /* CommandResult.MergeOverlap */;
30207
+ return 66 /* CommandResult.MergeOverlap */;
30135
30208
  }
30136
30209
  }
30137
30210
  }
@@ -30145,7 +30218,7 @@ class MergePlugin extends CorePlugin {
30145
30218
  for (const zone of target) {
30146
30219
  if ((zone.left < xSplit && zone.right >= xSplit) ||
30147
30220
  (zone.top < ySplit && zone.bottom >= ySplit)) {
30148
- return 75 /* CommandResult.FrozenPaneOverlap */;
30221
+ return 76 /* CommandResult.FrozenPaneOverlap */;
30149
30222
  }
30150
30223
  }
30151
30224
  return 0 /* CommandResult.Success */;
@@ -30363,6 +30436,9 @@ class SheetPlugin extends CorePlugin {
30363
30436
  case "CREATE_SHEET": {
30364
30437
  return this.checkValidations(cmd, this.checkSheetName, this.checkSheetPosition);
30365
30438
  }
30439
+ case "DUPLICATE_SHEET": {
30440
+ return this.sheets[cmd.sheetIdTo] ? 12 /* CommandResult.DuplicatedSheetId */ : 0 /* CommandResult.Success */;
30441
+ }
30366
30442
  case "MOVE_SHEET":
30367
30443
  const currentIndex = this.orderedSheetIds.indexOf(cmd.sheetId);
30368
30444
  if (cmd.direction === "left") {
@@ -30384,7 +30460,7 @@ class SheetPlugin extends CorePlugin {
30384
30460
  case "RENAME_SHEET":
30385
30461
  return this.isRenameAllowed(cmd);
30386
30462
  case "DELETE_SHEET":
30387
- return this.orderedSheetIds.length > 1
30463
+ return this.getVisibleSheetIds().length > 1
30388
30464
  ? 0 /* CommandResult.Success */
30389
30465
  : 9 /* CommandResult.NotEnoughSheets */;
30390
30466
  case "ADD_COLUMNS_ROWS":
@@ -30392,10 +30468,10 @@ class SheetPlugin extends CorePlugin {
30392
30468
  ? this.getNumberCols(cmd.sheetId)
30393
30469
  : this.getNumberRows(cmd.sheetId);
30394
30470
  if (cmd.base < 0 || cmd.base >= elements) {
30395
- return 86 /* CommandResult.InvalidHeaderIndex */;
30471
+ return 87 /* CommandResult.InvalidHeaderIndex */;
30396
30472
  }
30397
30473
  else if (cmd.quantity <= 0) {
30398
- return 87 /* CommandResult.InvalidQuantity */;
30474
+ return 88 /* CommandResult.InvalidQuantity */;
30399
30475
  }
30400
30476
  return 0 /* CommandResult.Success */;
30401
30477
  case "REMOVE_COLUMNS_ROWS": {
@@ -30403,7 +30479,7 @@ class SheetPlugin extends CorePlugin {
30403
30479
  ? this.getNumberCols(cmd.sheetId)
30404
30480
  : this.getNumberRows(cmd.sheetId);
30405
30481
  if (largeMin(cmd.elements) < 0 || largeMax(cmd.elements) > elements) {
30406
- return 86 /* CommandResult.InvalidHeaderIndex */;
30482
+ return 87 /* CommandResult.InvalidHeaderIndex */;
30407
30483
  }
30408
30484
  else if (this.checkElementsIncludeAllNonFrozenHeaders(cmd.sheetId, cmd.dimension, cmd.elements)) {
30409
30485
  return 8 /* CommandResult.NotEnoughElements */;
@@ -30860,18 +30936,18 @@ class SheetPlugin extends CorePlugin {
30860
30936
  checkRowFreezeQuantity(cmd) {
30861
30937
  return cmd.quantity >= 1 && cmd.quantity < this.getNumberRows(cmd.sheetId)
30862
30938
  ? 0 /* CommandResult.Success */
30863
- : 74 /* CommandResult.InvalidFreezeQuantity */;
30939
+ : 75 /* CommandResult.InvalidFreezeQuantity */;
30864
30940
  }
30865
30941
  checkColFreezeQuantity(cmd) {
30866
30942
  return cmd.quantity >= 1 && cmd.quantity < this.getNumberCols(cmd.sheetId)
30867
30943
  ? 0 /* CommandResult.Success */
30868
- : 74 /* CommandResult.InvalidFreezeQuantity */;
30944
+ : 75 /* CommandResult.InvalidFreezeQuantity */;
30869
30945
  }
30870
30946
  checkRowFreezeOverlapMerge(cmd) {
30871
30947
  const merges = this.getters.getMerges(cmd.sheetId);
30872
30948
  for (let merge of merges) {
30873
30949
  if (merge.top < cmd.quantity && cmd.quantity <= merge.bottom) {
30874
- return 65 /* CommandResult.MergeOverlap */;
30950
+ return 66 /* CommandResult.MergeOverlap */;
30875
30951
  }
30876
30952
  }
30877
30953
  return 0 /* CommandResult.Success */;
@@ -30880,7 +30956,7 @@ class SheetPlugin extends CorePlugin {
30880
30956
  const merges = this.getters.getMerges(cmd.sheetId);
30881
30957
  for (let merge of merges) {
30882
30958
  if (merge.left < cmd.quantity && cmd.quantity <= merge.right) {
30883
- return 65 /* CommandResult.MergeOverlap */;
30959
+ return 66 /* CommandResult.MergeOverlap */;
30884
30960
  }
30885
30961
  }
30886
30962
  return 0 /* CommandResult.Success */;
@@ -31190,6 +31266,9 @@ class SheetPlugin extends CorePlugin {
31190
31266
  zones.push(...cmd.target);
31191
31267
  }
31192
31268
  if ("ranges" in cmd && Array.isArray(cmd.ranges)) {
31269
+ if (cmd.ranges.some((rangeData) => !this.getters.tryGetSheet(rangeData._sheetId))) {
31270
+ return 27 /* CommandResult.InvalidSheetId */;
31271
+ }
31193
31272
  zones.push(...cmd.ranges.map((rangeData) => this.getters.getRangeFromRangeData(rangeData).zone));
31194
31273
  }
31195
31274
  if (!zones.every(isZoneValid)) {
@@ -31311,7 +31390,7 @@ class AutofillPlugin extends UIPlugin {
31311
31390
  if (this.lastCellSelected.col !== undefined && this.lastCellSelected.row !== undefined) {
31312
31391
  return 0 /* CommandResult.Success */;
31313
31392
  }
31314
- return 45 /* CommandResult.InvalidAutofillSelection */;
31393
+ return 46 /* CommandResult.InvalidAutofillSelection */;
31315
31394
  case "AUTOFILL_AUTO":
31316
31395
  const zone = this.getters.getSelectedZone();
31317
31396
  return zone.top === zone.bottom
@@ -31911,7 +31990,7 @@ class CellPopoverPlugin extends UIPlugin {
31911
31990
  cellPopoverRegistry.get(cmd.popoverType);
31912
31991
  }
31913
31992
  catch (error) {
31914
- return 72 /* CommandResult.InvalidCellPopover */;
31993
+ return 73 /* CommandResult.InvalidCellPopover */;
31915
31994
  }
31916
31995
  return 0 /* CommandResult.Success */;
31917
31996
  default:
@@ -32135,7 +32214,7 @@ class ClipboardCellsState extends ClipboardCellsAbstractState {
32135
32214
  for (const zone of this.getPasteZones(target)) {
32136
32215
  if ((zone.left < xSplit && zone.right >= xSplit) ||
32137
32216
  (zone.top < ySplit && zone.bottom >= ySplit)) {
32138
- return 75 /* CommandResult.FrozenPaneOverlap */;
32217
+ return 76 /* CommandResult.FrozenPaneOverlap */;
32139
32218
  }
32140
32219
  }
32141
32220
  return 0 /* CommandResult.Success */;
@@ -32495,7 +32574,7 @@ class ClipboardFigureState {
32495
32574
  }
32496
32575
  isPasteAllowed(target, option) {
32497
32576
  if (target.length === 0) {
32498
- return 73 /* CommandResult.EmptyTarget */;
32577
+ return 74 /* CommandResult.EmptyTarget */;
32499
32578
  }
32500
32579
  if ((option === null || option === void 0 ? void 0 : option.pasteOption) !== undefined) {
32501
32580
  return 22 /* CommandResult.WrongFigurePasteOption */;
@@ -32512,7 +32591,7 @@ class ClipboardFigureState {
32512
32591
  y: this.getters.getRowDimensions(sheetId, target[0].top).start,
32513
32592
  };
32514
32593
  const newChart = this.copiedChart.copyInSheetId(sheetId);
32515
- const newId = new UuidGenerator().uuidv4();
32594
+ const newId = new UuidGenerator().smallUuid();
32516
32595
  this.dispatch("CREATE_CHART", {
32517
32596
  id: newId,
32518
32597
  sheetId,
@@ -33642,7 +33721,9 @@ class EvaluationConditionalFormatPlugin extends UIPlugin {
33642
33721
  const cfInTarget = this.getters
33643
33722
  .getConditionalFormats(targetSheetId)
33644
33723
  .find((cf) => cf.stopIfTrue === originCF.stopIfTrue && deepEquals(cf.rule, originCF.rule));
33645
- return cfInTarget ? cfInTarget : { ...originCF, id: this.uuidGenerator.uuidv4(), ranges: [] };
33724
+ return cfInTarget
33725
+ ? cfInTarget
33726
+ : { ...originCF, id: this.uuidGenerator.smallUuid(), ranges: [] };
33646
33727
  }
33647
33728
  }
33648
33729
  EvaluationConditionalFormatPlugin.getters = ["getConditionalIcon", "getCellComputedStyle"];
@@ -33658,7 +33739,7 @@ class FilterEvaluationPlugin extends UIPlugin {
33658
33739
  switch (cmd.type) {
33659
33740
  case "UPDATE_FILTER":
33660
33741
  if (!this.getters.getFilterId(cmd.sheetId, cmd.col, cmd.row)) {
33661
- return 79 /* CommandResult.FilterNotFound */;
33742
+ return 80 /* CommandResult.FilterNotFound */;
33662
33743
  }
33663
33744
  break;
33664
33745
  }
@@ -35164,23 +35245,7 @@ class GridSelectionPlugin extends UIPlugin {
35164
35245
  gridSelection: deepCopy(gridSelection),
35165
35246
  };
35166
35247
  }
35167
- if (!this.getters.tryGetSheet(this.getters.getActiveSheetId())) {
35168
- const currentSheetIds = this.getters.getVisibleSheetIds();
35169
- this.activeSheet = this.getters.getSheet(currentSheetIds[0]);
35170
- if (this.activeSheet.id in this.sheetsData) {
35171
- const { anchor } = this.clipSelection(this.activeSheet.id, this.sheetsData[this.activeSheet.id].gridSelection);
35172
- this.selectCell(anchor.cell.col, anchor.cell.row);
35173
- }
35174
- else {
35175
- this.selectCell(0, 0);
35176
- }
35177
- const { col, row } = this.gridSelection.anchor.cell;
35178
- this.moveClient({
35179
- sheetId: this.getters.getActiveSheetId(),
35180
- col,
35181
- row,
35182
- });
35183
- }
35248
+ this.fallbackToVisibleSheet();
35184
35249
  const sheetId = this.getters.getActiveSheetId();
35185
35250
  this.gridSelection.zones = this.gridSelection.zones.map((z) => this.getters.expandZone(sheetId, z));
35186
35251
  this.gridSelection.anchor.zone = this.getters.expandZone(sheetId, this.gridSelection.anchor.zone);
@@ -35190,6 +35255,7 @@ class GridSelectionPlugin extends UIPlugin {
35190
35255
  }
35191
35256
  }
35192
35257
  finalize() {
35258
+ this.fallbackToVisibleSheet();
35193
35259
  /** Any change to the selection has to be reflected in the selection processor. */
35194
35260
  this.selection.resetDefaultAnchor(this, deepCopy(this.gridSelection.anchor));
35195
35261
  }
@@ -35488,10 +35554,29 @@ class GridSelectionPlugin extends UIPlugin {
35488
35554
  const headers = [cmd.base, ...cmd.elements];
35489
35555
  const maxHeaderValue = isCol ? this.getters.getNumberCols(id) : this.getters.getNumberRows(id);
35490
35556
  if (headers.some((h) => h < 0 || h >= maxHeaderValue)) {
35491
- return 86 /* CommandResult.InvalidHeaderIndex */;
35557
+ return 87 /* CommandResult.InvalidHeaderIndex */;
35492
35558
  }
35493
35559
  return 0 /* CommandResult.Success */;
35494
35560
  }
35561
+ fallbackToVisibleSheet() {
35562
+ if (!this.getters.tryGetSheet(this.getters.getActiveSheetId())) {
35563
+ const currentSheetIds = this.getters.getVisibleSheetIds();
35564
+ this.activeSheet = this.getters.getSheet(currentSheetIds[0]);
35565
+ if (this.activeSheet.id in this.sheetsData) {
35566
+ const { anchor } = this.clipSelection(this.activeSheet.id, this.sheetsData[this.activeSheet.id].gridSelection);
35567
+ this.selectCell(anchor.cell.col, anchor.cell.row);
35568
+ }
35569
+ else {
35570
+ this.selectCell(0, 0);
35571
+ }
35572
+ const { col, row } = this.gridSelection.anchor.cell;
35573
+ this.moveClient({
35574
+ sheetId: this.getters.getActiveSheetId(),
35575
+ col,
35576
+ row,
35577
+ });
35578
+ }
35579
+ }
35495
35580
  //-------------------------------------------
35496
35581
  // Helpers for extensions
35497
35582
  // ------------------------------------------
@@ -35716,7 +35801,7 @@ class SelectionInputPlugin extends UIPlugin {
35716
35801
  setContent(index, xc) {
35717
35802
  this.ranges[index] = {
35718
35803
  ...this.ranges[index],
35719
- id: uuidGenerator.uuidv4(),
35804
+ id: uuidGenerator.smallUuid(),
35720
35805
  xc,
35721
35806
  };
35722
35807
  }
@@ -35831,26 +35916,26 @@ class SelectionInputsManagerPlugin extends UIPlugin {
35831
35916
  case "ADD_EMPTY_RANGE":
35832
35917
  case "REMOVE_RANGE":
35833
35918
  if (!this.inputs[cmd.id]) {
35834
- return 30 /* CommandResult.InvalidInputId */;
35919
+ return 31 /* CommandResult.InvalidInputId */;
35835
35920
  }
35836
35921
  }
35837
35922
  switch (cmd.type) {
35838
35923
  case "FOCUS_RANGE":
35839
35924
  const index = (_a = this.currentInput) === null || _a === void 0 ? void 0 : _a.getIndex(cmd.rangeId);
35840
35925
  if (this.focusedInputId === cmd.id && ((_b = this.currentInput) === null || _b === void 0 ? void 0 : _b.focusedRangeIndex) === index) {
35841
- return 28 /* CommandResult.InputAlreadyFocused */;
35926
+ return 29 /* CommandResult.InputAlreadyFocused */;
35842
35927
  }
35843
35928
  break;
35844
35929
  case "ADD_EMPTY_RANGE":
35845
35930
  const input = this.inputs[cmd.id];
35846
35931
  if (input.inputHasSingleRange && input.ranges.length === 1) {
35847
- return 29 /* CommandResult.MaximumRangesReached */;
35932
+ return 30 /* CommandResult.MaximumRangesReached */;
35848
35933
  }
35849
35934
  break;
35850
35935
  case "CHANGE_RANGE": {
35851
35936
  const input = this.inputs[cmd.id];
35852
35937
  if (input.inputHasSingleRange && cmd.value.split(",").length > 1) {
35853
- return 29 /* CommandResult.MaximumRangesReached */;
35938
+ return 30 /* CommandResult.MaximumRangesReached */;
35854
35939
  }
35855
35940
  break;
35856
35941
  }
@@ -36041,6 +36126,9 @@ function updateChartRangesTransformation(toTransform, executed) {
36041
36126
  }
36042
36127
  function createSheetTransformation(cmd, executed) {
36043
36128
  var _a;
36129
+ if (cmd.sheetId === executed.sheetId) {
36130
+ cmd = { ...cmd, sheetId: `${cmd.sheetId}~` };
36131
+ }
36044
36132
  if (cmd.name === executed.name) {
36045
36133
  return {
36046
36134
  ...cmd,
@@ -36616,21 +36704,14 @@ class Session extends EventBus {
36616
36704
  if (!message)
36617
36705
  return;
36618
36706
  if (message.type === "REMOTE_REVISION") {
36619
- const revision = this.revisions.get(message.nextRevisionId);
36707
+ let revision = this.revisions.get(message.nextRevisionId);
36620
36708
  if (revision.commands.length === 0) {
36621
36709
  /**
36622
- * The command is empty, we have to drop all the next local revisions
36710
+ * The command is empty, we have to rebase all the next local revisions
36623
36711
  * to avoid issues with undo/redo
36624
36712
  */
36625
- this.revisions.drop(revision.id);
36626
- const revisionIds = this.pendingMessages
36627
- .filter((message) => message.type === "REMOTE_REVISION")
36628
- .map((message) => message.nextRevisionId);
36629
- this.trigger("pending-revisions-dropped", { revisionIds });
36630
- this.waitingAck = false;
36631
- this.waitingUndoRedoAck = false;
36632
- this.pendingMessages = [];
36633
- return;
36713
+ this.revisions.rebase(revision.id);
36714
+ revision = this.revisions.get(message.nextRevisionId);
36634
36715
  }
36635
36716
  message = {
36636
36717
  ...message,
@@ -36654,7 +36735,6 @@ class Session extends EventBus {
36654
36735
  switch (message.type) {
36655
36736
  case "REMOTE_REVISION":
36656
36737
  case "REVISION_REDONE":
36657
- case "REVISION_UNDONE":
36658
36738
  case "SNAPSHOT_CREATED":
36659
36739
  this.waitingAck = false;
36660
36740
  this.pendingMessages = this.pendingMessages.filter((msg) => msg.nextRevisionId !== message.nextRevisionId);
@@ -36662,6 +36742,25 @@ class Session extends EventBus {
36662
36742
  this.processedRevisions.add(message.nextRevisionId);
36663
36743
  this.sendPendingMessage();
36664
36744
  break;
36745
+ case "REVISION_UNDONE": {
36746
+ this.waitingAck = false;
36747
+ this.pendingMessages = this.pendingMessages.filter((msg) => msg.nextRevisionId !== message.nextRevisionId);
36748
+ const firstPendingRevisionId = this.pendingMessages.findIndex((message) => message.type === "REMOTE_REVISION");
36749
+ if (firstPendingRevisionId !== -1) {
36750
+ /**
36751
+ * Some revisions undergo transformations that may cause issues with
36752
+ * undo/redo if the transformation is destructive (we don't get back
36753
+ * the original command by transforming it with the inverse).
36754
+ * To prevent these problems, we must rebase all subsequent local
36755
+ * revisions.
36756
+ */
36757
+ this.revisions.rebase(this.pendingMessages[firstPendingRevisionId].nextRevisionId);
36758
+ }
36759
+ this.serverRevisionId = message.nextRevisionId;
36760
+ this.processedRevisions.add(message.nextRevisionId);
36761
+ this.sendPendingMessage();
36762
+ break;
36763
+ }
36665
36764
  }
36666
36765
  }
36667
36766
  isAlreadyProcessed(message) {
@@ -37532,7 +37631,7 @@ class SheetViewPlugin extends UIPlugin {
37532
37631
  }
37533
37632
  checkPositiveDimension(cmd) {
37534
37633
  if (cmd.width < 0 || cmd.height < 0) {
37535
- return 68 /* CommandResult.InvalidViewportSize */;
37634
+ return 69 /* CommandResult.InvalidViewportSize */;
37536
37635
  }
37537
37636
  return 0 /* CommandResult.Success */;
37538
37637
  }
@@ -37542,7 +37641,7 @@ class SheetViewPlugin extends UIPlugin {
37542
37641
  cmd.gridOffsetY === this.gridOffsetY &&
37543
37642
  cmd.width === width &&
37544
37643
  cmd.height === height) {
37545
- return 76 /* CommandResult.ValuesNotChanged */;
37644
+ return 77 /* CommandResult.ValuesNotChanged */;
37546
37645
  }
37547
37646
  return 0 /* CommandResult.Success */;
37548
37647
  }
@@ -37550,7 +37649,7 @@ class SheetViewPlugin extends UIPlugin {
37550
37649
  const pane = this.getMainInternalViewport(this.getters.getActiveSheetId());
37551
37650
  if ((!pane.canScrollHorizontally && offsetX > 0) ||
37552
37651
  (!pane.canScrollVertically && offsetY > 0)) {
37553
- return 69 /* CommandResult.InvalidScrollingDirection */;
37652
+ return 70 /* CommandResult.InvalidScrollingDirection */;
37554
37653
  }
37555
37654
  return 0 /* CommandResult.Success */;
37556
37655
  }
@@ -37777,7 +37876,7 @@ class SortPlugin extends UIPlugin {
37777
37876
  for (let row = zone.top; row <= zone.bottom; row++) {
37778
37877
  for (let col = zone.left; col <= zone.right; col++) {
37779
37878
  if (!this.getters.isInMerge(sheetId, col, row)) {
37780
- return 63 /* CommandResult.InvalidSortZone */;
37879
+ return 64 /* CommandResult.InvalidSortZone */;
37781
37880
  }
37782
37881
  }
37783
37882
  }
@@ -37798,7 +37897,7 @@ class SortPlugin extends UIPlugin {
37798
37897
  ];
37799
37898
  return widthCurrent === widthFirst && heightCurrent === heightFirst;
37800
37899
  })) {
37801
- return 63 /* CommandResult.InvalidSortZone */;
37900
+ return 64 /* CommandResult.InvalidSortZone */;
37802
37901
  }
37803
37902
  return 0 /* CommandResult.Success */;
37804
37903
  }
@@ -38464,7 +38563,7 @@ class BottomBar extends owl.Component {
38464
38563
  addSheet() {
38465
38564
  const activeSheetId = this.env.model.getters.getActiveSheetId();
38466
38565
  const position = this.env.model.getters.getSheetIds().findIndex((sheetId) => sheetId === activeSheetId) + 1;
38467
- const sheetId = this.env.model.uuidGenerator.uuidv4();
38566
+ const sheetId = this.env.model.uuidGenerator.smallUuid();
38468
38567
  const name = this.env.model.getters.getNextSheetName(this.env._t("Sheet"));
38469
38568
  this.env.model.dispatch("CREATE_SHEET", { sheetId, position, name });
38470
38569
  this.env.model.dispatch("ACTIVATE_SHEET", { sheetIdFrom: activeSheetId, sheetIdTo: sheetId });
@@ -38953,7 +39052,7 @@ const AddMergeInteractiveContent = {
38953
39052
  };
38954
39053
  function interactiveAddMerge(env, sheetId, target) {
38955
39054
  const result = env.model.dispatch("ADD_MERGE", { sheetId, target });
38956
- if (result.isCancelledBecause(80 /* CommandResult.MergeInFilter */)) {
39055
+ if (result.isCancelledBecause(81 /* CommandResult.MergeInFilter */)) {
38957
39056
  env.raiseError(AddMergeInteractiveContent.MergeInFilter);
38958
39057
  }
38959
39058
  else if (result.isCancelledBecause(3 /* CommandResult.MergeIsDestructive */)) {
@@ -40086,7 +40185,7 @@ class Tree {
40086
40185
  }
40087
40186
  /**
40088
40187
  * Drop the operation and all following operations in every
40089
- * branch
40188
+ * branches
40090
40189
  */
40091
40190
  drop(operationId) {
40092
40191
  for (const branch of this.branches) {
@@ -40383,9 +40482,16 @@ class SelectiveHistory {
40383
40482
  this.fastForward();
40384
40483
  this.insert(redoId, this.buildEmpty(redoId), insertAfter);
40385
40484
  }
40386
- drop(operationId) {
40485
+ rebase(operationId) {
40486
+ const operation = this.get(operationId);
40487
+ const execution = [...this.tree.execution(this.HEAD_BRANCH).startAfter(operationId)];
40387
40488
  this.revertBefore(operationId);
40489
+ const baseId = this.HEAD_OPERATION.id;
40388
40490
  this.tree.drop(operationId);
40491
+ this.insert(operationId, operation, baseId);
40492
+ for (const { operation } of execution) {
40493
+ this.insert(operation.id, operation.data, this.HEAD_OPERATION.id);
40494
+ }
40389
40495
  }
40390
40496
  /**
40391
40497
  * Revert the state as it was *before* the given operation was executed.
@@ -40508,7 +40614,6 @@ class LocalHistory extends owl.EventBus {
40508
40614
  this.session.on("new-local-state-update", this, this.onNewLocalStateUpdate);
40509
40615
  this.session.on("revision-undone", this, ({ commands }) => this.selectiveUndo(commands));
40510
40616
  this.session.on("revision-redone", this, ({ commands }) => this.selectiveRedo(commands));
40511
- this.session.on("pending-revisions-dropped", this, ({ revisionIds }) => this.drop(revisionIds));
40512
40617
  this.session.on("snapshot", this, () => {
40513
40618
  this.undoStack = [];
40514
40619
  this.redoStack = [];
@@ -40561,10 +40666,6 @@ class LocalHistory extends owl.EventBus {
40561
40666
  canRedo() {
40562
40667
  return this.redoStack.length > 0;
40563
40668
  }
40564
- drop(revisionIds) {
40565
- this.undoStack = this.undoStack.filter((id) => !revisionIds.includes(id));
40566
- this.redoStack = [];
40567
- }
40568
40669
  onNewLocalStateUpdate({ id }) {
40569
40670
  this.undoStack.push(id);
40570
40671
  this.redoStack = [];
@@ -41145,7 +41246,7 @@ class SelectionStreamProcessor {
41145
41246
  */
41146
41247
  moveAnchorCell(direction, step = 1) {
41147
41248
  if (step !== "end" && step <= 0) {
41148
- return new DispatchResult(83 /* CommandResult.InvalidSelectionStep */);
41249
+ return new DispatchResult(84 /* CommandResult.InvalidSelectionStep */);
41149
41250
  }
41150
41251
  const { col, row } = this.getNextAvailablePosition(direction, step);
41151
41252
  return this.selectCell(col, row);
@@ -41191,7 +41292,7 @@ class SelectionStreamProcessor {
41191
41292
  */
41192
41293
  resizeAnchorZone(direction, step = 1) {
41193
41294
  if (step !== "end" && step <= 0) {
41194
- return new DispatchResult(83 /* CommandResult.InvalidSelectionStep */);
41295
+ return new DispatchResult(84 /* CommandResult.InvalidSelectionStep */);
41195
41296
  }
41196
41297
  const sheetId = this.getters.getActiveSheetId();
41197
41298
  const anchor = this.anchor;
@@ -43137,10 +43238,10 @@ class Model extends EventBus {
43137
43238
  const command = { type, ...payload };
43138
43239
  let status = this.status;
43139
43240
  if (this.getters.isReadonly() && !canExecuteInReadonly(command)) {
43140
- return new DispatchResult(67 /* CommandResult.Readonly */);
43241
+ return new DispatchResult(68 /* CommandResult.Readonly */);
43141
43242
  }
43142
43243
  if (!this.session.canApplyOptimisticUpdate()) {
43143
- return new DispatchResult(64 /* CommandResult.WaitingSessionConfirmation */);
43244
+ return new DispatchResult(65 /* CommandResult.WaitingSessionConfirmation */);
43144
43245
  }
43145
43246
  switch (status) {
43146
43247
  case 0 /* Status.Ready */:
@@ -43342,7 +43443,7 @@ class Model extends EventBus {
43342
43443
  }
43343
43444
  setupConfig(config) {
43344
43445
  const client = config.client || {
43345
- id: this.uuidGenerator.uuidv4(),
43446
+ id: this.uuidGenerator.smallUuid(),
43346
43447
  name: _lt("Anonymous").toString(),
43347
43448
  };
43348
43449
  const transportService = config.transportService || new LocalTransportService();
@@ -43590,6 +43691,6 @@ exports.setTranslationMethod = setTranslationMethod;
43590
43691
  exports.tokenize = tokenize;
43591
43692
 
43592
43693
 
43593
- __info__.version = '16.0.60';
43594
- __info__.date = '2025-02-05T06:44:04.651Z';
43595
- __info__.hash = 'd098699';
43694
+ __info__.version = '16.0.63';
43695
+ __info__.date = '2025-02-25T05:54:41.386Z';
43696
+ __info__.hash = 'b01aca6';