@crystaldesign/web-planner-logic 26.11.0-beta.11 → 26.11.0-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/build/cjs/{DivaBoxPlanner-02a2dbbf.js → DivaBoxPlanner-ce0bb2af.js} +123 -44
  2. package/build/cjs/{DivaStandardPlanner-150246c0.js → DivaStandardPlanner-e664710b.js} +2 -2
  3. package/build/cjs/{DoorPlanner-ce630754.js → DoorPlanner-a37c3d62.js} +1 -1
  4. package/build/cjs/{Host3DSignalR-b0b1fb8d.js → Host3DSignalR-a94701fa.js} +1 -1
  5. package/build/cjs/{LiviqueWWSHandler-c11ea7d2.js → LiviqueWWSHandler-f6488fb8.js} +1 -1
  6. package/build/cjs/{PfisterWWSHandler-3c723ecc.js → PfisterWWSHandler-a0d05fa3.js} +1 -1
  7. package/build/cjs/{PlannerHandler2D-6c0324be.js → PlannerHandler2D-fe16c1ce.js} +1 -1
  8. package/build/cjs/{SeriousBasketHandler-d1ae4006.js → SeriousBasketHandler-bc18769e.js} +1 -1
  9. package/build/cjs/{ShelfPlanner-04d98f4d.js → ShelfPlanner-eab7ed23.js} +259 -148
  10. package/build/cjs/{StandardWWSHandler-9b596caf.js → StandardWWSHandler-1ad7e215.js} +1 -1
  11. package/build/cjs/{index-633196ab.js → index-b849f3ec.js} +1014 -980
  12. package/build/cjs/index.js +2 -1
  13. package/build/esm/{DivaBoxPlanner-fa9f6ec6.js → DivaBoxPlanner-f198956e.js} +123 -44
  14. package/build/esm/{DivaStandardPlanner-6c001048.js → DivaStandardPlanner-ef69c7d9.js} +2 -2
  15. package/build/esm/{DoorPlanner-ef9165f9.js → DoorPlanner-b6bbdd8f.js} +1 -1
  16. package/build/esm/{Host3DSignalR-2dc8478a.js → Host3DSignalR-c4b67bb7.js} +1 -1
  17. package/build/esm/{LiviqueWWSHandler-b6e8bf5f.js → LiviqueWWSHandler-5f62a364.js} +1 -1
  18. package/build/esm/{PfisterWWSHandler-54b3e0aa.js → PfisterWWSHandler-cf8dd909.js} +1 -1
  19. package/build/esm/{PlannerHandler2D-0e61311d.js → PlannerHandler2D-88d7f725.js} +1 -1
  20. package/build/esm/{SeriousBasketHandler-7b097870.js → SeriousBasketHandler-5f29e886.js} +1 -1
  21. package/build/esm/{ShelfPlanner-f3e86534.js → ShelfPlanner-05d57e72.js} +259 -148
  22. package/build/esm/{StandardWWSHandler-4b0caefd.js → StandardWWSHandler-a9f0e1f8.js} +1 -1
  23. package/build/esm/{index-6c8de812.js → index-224d69f7.js} +1014 -980
  24. package/build/esm/index.js +1 -1
  25. package/build/types/web-planner-logic/src/index.d.ts +4 -2
  26. package/build/types/web-planner-logic/src/index.d.ts.map +1 -1
  27. package/build/types/web-planner-logic/src/interface/Articles/ArticleDataType.d.ts +13 -0
  28. package/build/types/web-planner-logic/src/interface/Articles/ArticleDataType.d.ts.map +1 -1
  29. package/build/types/web-planner-logic/src/interface/webPlannerParams/WebPlannerParamsType.d.ts +1 -0
  30. package/build/types/web-planner-logic/src/interface/webPlannerParams/WebPlannerParamsType.d.ts.map +1 -1
  31. package/build/types/web-planner-logic/src/logic/Article/Engine/ArticleEngine.d.ts +4 -0
  32. package/build/types/web-planner-logic/src/logic/Article/Engine/ArticleEngine.d.ts.map +1 -1
  33. package/build/types/web-planner-logic/src/logic/Article/Engine/IDMArticleEngine.d.ts +12 -2
  34. package/build/types/web-planner-logic/src/logic/Article/Engine/IDMArticleEngine.d.ts.map +1 -1
  35. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts +20 -0
  36. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts.map +1 -1
  37. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlannerGrid.d.ts +19 -1
  38. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlannerGrid.d.ts.map +1 -1
  39. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts +12 -0
  40. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts.map +1 -1
  41. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts +95 -92
  42. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts.map +1 -1
  43. package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/ConstructionRulesHandler.d.ts +19 -0
  44. package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/ConstructionRulesHandler.d.ts.map +1 -1
  45. package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/DivaBoxPlanner.d.ts +5 -0
  46. package/build/types/web-planner-logic/src/logic/Planner/BoxPlanner/DivaBoxPlanner.d.ts.map +1 -1
  47. package/build/types/web-planner-logic/src/model/Planner/PlannerElementData.d.ts.map +1 -1
  48. package/build/types/web-planner-logic/src/test/engineFeatureDefaults.test.d.ts +2 -0
  49. package/build/types/web-planner-logic/src/test/engineFeatureDefaults.test.d.ts.map +1 -0
  50. package/build/types/web-planner-logic/src/test/idmPlannerPaletteView.test.d.ts +2 -0
  51. package/build/types/web-planner-logic/src/test/idmPlannerPaletteView.test.d.ts.map +1 -0
  52. package/package.json +2 -2
@@ -6,7 +6,7 @@ var _classCallCheck = require('@babel/runtime/helpers/classCallCheck');
6
6
  var _createClass = require('@babel/runtime/helpers/createClass');
7
7
  var _defineProperty = require('@babel/runtime/helpers/defineProperty');
8
8
  var _regeneratorRuntime = require('@babel/runtime/regenerator');
9
- var index = require('./index-633196ab.js');
9
+ var index = require('./index-b849f3ec.js');
10
10
  var DivaUtils = require('@crystaldesign/diva-utils');
11
11
  require('@babel/runtime/helpers/slicedToArray');
12
12
  require('@babel/runtime/helpers/objectWithoutProperties');
@@ -31,6 +31,8 @@ var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_definePropert
31
31
  var _regeneratorRuntime__default = /*#__PURE__*/_interopDefaultLegacy(_regeneratorRuntime);
32
32
  var DivaUtils__default = /*#__PURE__*/_interopDefaultLegacy(DivaUtils);
33
33
 
34
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
35
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
34
36
  var LOG = DivaUtils__default["default"].initLog('Planner', 'WEB-PLANNER-LOGIC');
35
37
  var ShelfPlanner = /*#__PURE__*/function () {
36
38
  function ShelfPlanner(data, article) {
@@ -59,6 +61,15 @@ var ShelfPlanner = /*#__PURE__*/function () {
59
61
  //rule so the shelfplanner cells get disabled when the neighbour (AVL or AVR) is smaller. eg: Ben sulvag
60
62
  _defineProperty__default["default"](this, "disableCellsByElement", void 0);
61
63
  _defineProperty__default["default"](this, "montageOptions", []);
64
+ /**
65
+ * Debug trail of shelf-planner mutations (the shelf equivalent of the box
66
+ * planner's constructionDebugStack): one entry per visibility flip, grid
67
+ * disable/enable/recreate, accessory placement/deletion and cell-disabling
68
+ * run — so "why did my accessory disappear" is answerable from history.
69
+ * Append-only (capped), NOT reset per configure.
70
+ */
71
+ _defineProperty__default["default"](this, "shelfDebugStack", []);
72
+ _defineProperty__default["default"](this, "shelfDebugSeq", 0);
62
73
  //true until the shelfaccessoires saved in the basket were restored into the cells (see restoreShelfAccessoires in the DivaSetHandler).
63
74
  //until then no initAcc may be placed, they would occupy the cells of the saved accessoires
64
75
  _defineProperty__default["default"](this, "restorePending", void 0);
@@ -91,6 +102,14 @@ var ShelfPlanner = /*#__PURE__*/function () {
91
102
  * init dictionary of all the accessoires that which can be free in theory
92
103
  */
93
104
  return _createClass__default["default"](ShelfPlanner, [{
105
+ key: "logShelfDebug",
106
+ value: function logShelfDebug(entry) {
107
+ this.shelfDebugStack.push(_objectSpread({
108
+ seq: this.shelfDebugSeq++
109
+ }, entry));
110
+ if (this.shelfDebugStack.length > 500) this.shelfDebugStack.splice(0, this.shelfDebugStack.length - 500);
111
+ }
112
+ }, {
94
113
  key: "initFreeArticles",
95
114
  value: function initFreeArticles() {
96
115
  if (!this.data.ShelfPlanner) return;
@@ -132,32 +151,37 @@ var ShelfPlanner = /*#__PURE__*/function () {
132
151
  while (1) switch (_context.prev = _context.next) {
133
152
  case 0:
134
153
  if (!(this.isVisible != isVisible)) {
135
- _context.next = 12;
154
+ _context.next = 13;
136
155
  break;
137
156
  }
157
+ this.logShelfDebug({
158
+ phase: 'visibility',
159
+ action: isVisible ? 'plannerShown' : 'plannerHidden',
160
+ detail: isVisible ? undefined : 'showOnRule/visibility turned false — all placed accessories are deleted'
161
+ });
138
162
  if (!isVisible) {
139
- _context.next = 10;
163
+ _context.next = 11;
140
164
  break;
141
165
  }
142
166
  this.isVisible = isVisible;
143
167
  if (this.article.shelfPlanData) {
144
- _context.next = 8;
168
+ _context.next = 9;
145
169
  break;
146
170
  }
147
- _context.next = 6;
171
+ _context.next = 7;
148
172
  return this.onConfigChanged({});
149
- case 6:
150
- _context.next = 8;
173
+ case 7:
174
+ _context.next = 9;
151
175
  return this.initAccList();
152
- case 8:
153
- _context.next = 12;
176
+ case 9:
177
+ _context.next = 13;
154
178
  break;
155
- case 10:
156
- _context.next = 12;
179
+ case 11:
180
+ _context.next = 13;
157
181
  return this.deleteAllAcc();
158
- case 12:
159
- this.isVisible = isVisible;
160
182
  case 13:
183
+ this.isVisible = isVisible;
184
+ case 14:
161
185
  case "end":
162
186
  return _context.stop();
163
187
  }
@@ -176,7 +200,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
176
200
  key: "onConfigChanged",
177
201
  value: (function () {
178
202
  var _onConfigChanged = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(variantValues) {
179
- var newHeightSet, gridsTodos, i, _i, _i2, grid, grids, _i3, _grid$DisableCellsByM, _grid;
203
+ var newHeightSet, gridsTodos, i, _i, grid, _i2, _i3, _grid, grids, _i4, _grid2$DisableCellsBy, _grid2;
180
204
  return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context2) {
181
205
  while (1) switch (_context2.prev = _context2.next) {
182
206
  case 0:
@@ -185,7 +209,6 @@ var ShelfPlanner = /*#__PURE__*/function () {
185
209
  for (i = 0; i < this.grids.length; i++) {
186
210
  gridsTodos.push(this.grids[i].onConfigChanged());
187
211
  }
188
- //first delete all disables grids then init all the new ones
189
212
  _i = 0;
190
213
  case 4:
191
214
  if (!(_i < gridsTodos.length)) {
@@ -198,10 +221,19 @@ var ShelfPlanner = /*#__PURE__*/function () {
198
221
  }
199
222
  return _context2.abrupt("continue", 10);
200
223
  case 7:
201
- //remember the accessoires before they get deleted, so they can be placed again when the grid becomes active again
202
- this.stashAccessoiresOfGrid(_i);
203
- _context2.next = 10;
204
- return this.grids[_i].deleteAllAccOfGrid();
224
+ grid = this.grids[_i];
225
+ if (gridsTodos[_i].includes('disableGridRule')) this.logShelfDebug({
226
+ phase: 'configChanged',
227
+ action: grid.DisabledByRule ? 'gridDisabledByRule' : 'gridEnabledByRule',
228
+ gridIndex: grid.ShelfIndex,
229
+ detail: grid.ShowOnRule
230
+ });
231
+ if (gridsTodos[_i].includes('heightGridRule')) this.logShelfDebug({
232
+ phase: 'configChanged',
233
+ action: 'gridRecreated',
234
+ gridIndex: grid.ShelfIndex,
235
+ detail: 'HeightGridCellCountOnRule match changed — grid rebuilt (cell count / placeable accessories can change), its accessories are deleted'
236
+ });
205
237
  case 10:
206
238
  _i++;
207
239
  _context2.next = 4;
@@ -210,74 +242,95 @@ var ShelfPlanner = /*#__PURE__*/function () {
210
242
  _i2 = 0;
211
243
  case 14:
212
244
  if (!(_i2 < gridsTodos.length)) {
213
- _context2.next = 30;
245
+ _context2.next = 23;
214
246
  break;
215
247
  }
216
248
  if (gridsTodos[_i2].length) {
217
249
  _context2.next = 17;
218
250
  break;
219
251
  }
220
- return _context2.abrupt("continue", 27);
252
+ return _context2.abrupt("continue", 20);
221
253
  case 17:
222
- if (gridsTodos[_i2].includes('heightGridRule')) {
223
- this.creatNewGrid(_i2);
254
+ //remember the accessoires before they get deleted, so they can be placed again when the grid becomes active again
255
+ this.stashAccessoiresOfGrid(_i2);
256
+ _context2.next = 20;
257
+ return this.grids[_i2].deleteAllAccOfGrid();
258
+ case 20:
259
+ _i2++;
260
+ _context2.next = 14;
261
+ break;
262
+ case 23:
263
+ _i3 = 0;
264
+ case 24:
265
+ if (!(_i3 < gridsTodos.length)) {
266
+ _context2.next = 40;
267
+ break;
268
+ }
269
+ if (gridsTodos[_i3].length) {
270
+ _context2.next = 27;
271
+ break;
272
+ }
273
+ return _context2.abrupt("continue", 37);
274
+ case 27:
275
+ if (gridsTodos[_i3].includes('heightGridRule')) {
276
+ this.creatNewGrid(_i3);
224
277
  newHeightSet = true;
225
278
  }
226
279
  //read the grid after a possible recreate, the replaced one is not the grid that gets filled
227
- grid = this.grids[_i2];
228
- if (!((gridsTodos[_i2].includes('heightGridRule') || gridsTodos[_i2].includes('disableGridRule')) && !grid.DisabledByRule)) {
229
- _context2.next = 27;
280
+ _grid = this.grids[_i3];
281
+ if (!((gridsTodos[_i3].includes('heightGridRule') || gridsTodos[_i3].includes('disableGridRule')) && !_grid.DisabledByRule)) {
282
+ _context2.next = 37;
230
283
  break;
231
284
  }
232
285
  if (!this.restorePending) {
233
- _context2.next = 22;
286
+ _context2.next = 32;
234
287
  break;
235
288
  }
236
- return _context2.abrupt("continue", 27);
237
- case 22:
238
- _context2.next = 24;
239
- return this.placeStashedAccessoiresOfGrid(_i2);
240
- case 24:
289
+ return _context2.abrupt("continue", 37);
290
+ case 32:
291
+ _context2.next = 34;
292
+ return this.placeStashedAccessoiresOfGrid(_i3);
293
+ case 34:
241
294
  if (_context2.sent) {
242
- _context2.next = 27;
295
+ _context2.next = 37;
243
296
  break;
244
297
  }
245
- _context2.next = 27;
246
- return this.initAccList(_i2);
247
- case 27:
248
- _i2++;
249
- _context2.next = 14;
298
+ _context2.next = 37;
299
+ return this.initAccList(_i3);
300
+ case 37:
301
+ _i3++;
302
+ _context2.next = 24;
250
303
  break;
251
- case 30:
304
+ case 40:
252
305
  if (!(!newHeightSet && Object.keys(variantValues).length)) {
253
- _context2.next = 41;
306
+ _context2.next = 51;
254
307
  break;
255
308
  }
256
309
  grids = this.activeGrids;
257
- _i3 = 0;
258
- case 33:
259
- if (!(_i3 < grids.length)) {
260
- _context2.next = 41;
310
+ _i4 = 0;
311
+ case 43:
312
+ if (!(_i4 < grids.length)) {
313
+ _context2.next = 51;
261
314
  break;
262
315
  }
263
- _grid = grids[_i3];
264
- if (!((_grid$DisableCellsByM = _grid.DisableCellsByMeasures) !== null && _grid$DisableCellsByM !== void 0 && _grid$DisableCellsByM.options.find(function (o) {
316
+ _grid2 = grids[_i4];
317
+ if (!((_grid2$DisableCellsBy = _grid2.DisableCellsByMeasures) !== null && _grid2$DisableCellsBy !== void 0 && _grid2$DisableCellsBy.options.find(function (o) {
265
318
  return Object.keys(variantValues).includes('OPT' + o.opt);
266
- }) || !!_grid.disableCellsByRules)) {
267
- _context2.next = 38;
319
+ }) || !!_grid2.disableCellsByRules)) {
320
+ _context2.next = 48;
268
321
  break;
269
322
  }
270
323
  newHeightSet = true;
271
- return _context2.abrupt("break", 41);
272
- case 38:
273
- _i3++;
274
- _context2.next = 33;
324
+ return _context2.abrupt("break", 51);
325
+ case 48:
326
+ _i4++;
327
+ _context2.next = 43;
275
328
  break;
276
- case 41:
329
+ case 51:
277
330
  if (newHeightSet) {
278
331
  this.updateDisabledCells();
279
332
  }
280
- case 42:
333
+ case 52:
281
334
  case "end":
282
335
  return _context2.stop();
283
336
  }
@@ -524,7 +577,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
524
577
  i = 0;
525
578
  case 2:
526
579
  if (!(i < grids.length)) {
527
- _context6.next = 36;
580
+ _context6.next = 37;
528
581
  break;
529
582
  }
530
583
  grid = grids[i];
@@ -532,72 +585,80 @@ var ShelfPlanner = /*#__PURE__*/function () {
532
585
  _context6.next = 6;
533
586
  break;
534
587
  }
535
- return _context6.abrupt("continue", 33);
588
+ return _context6.abrupt("continue", 34);
536
589
  case 6:
537
590
  if (grid.InitAccArr) {
538
591
  _context6.next = 8;
539
592
  break;
540
593
  }
541
- return _context6.abrupt("continue", 33);
594
+ return _context6.abrupt("continue", 34);
542
595
  case 8:
543
596
  j = 0;
544
597
  case 9:
545
598
  if (!(j < grid.InitAccArr.length)) {
546
- _context6.next = 33;
599
+ _context6.next = 34;
547
600
  break;
548
601
  }
549
602
  initAcc = grid.InitAccArr[j];
550
603
  k = 0;
551
604
  case 12:
552
605
  if (!(k < initAcc.initRH.length)) {
553
- _context6.next = 30;
606
+ _context6.next = 31;
554
607
  break;
555
608
  }
556
609
  grid.ActAccessoire = initAcc.Codex;
557
- _context6.next = 16;
610
+ this.logShelfDebug({
611
+ phase: 'initAccessories',
612
+ action: 'initAccessoryRequested',
613
+ gridIndex: grid.ShelfIndex,
614
+ cellIndex: initAcc.initRH[k],
615
+ articleCodex: initAcc.Codex,
616
+ detail: 'from InitAccArr — a missing matching accessoryPlaced entry right after means the init placement failed'
617
+ });
618
+ _context6.next = 17;
558
619
  return index.setHandlerInstance.addAccessorieOnShelfPlanner(this.article.set, grid.ShelfIndex, initAcc.initRH[k], grid.basketId, {
559
620
  noMove: initAcc.noMove,
560
621
  noDelete: initAcc.noDelete,
561
622
  byInit: true
562
623
  });
563
- case 16:
624
+ case 17:
564
625
  if (!initAcc.replaceFromParent) {
565
- _context6.next = 26;
626
+ _context6.next = 27;
566
627
  break;
567
628
  }
568
629
  shelfId = this.getShelfParentShelfId();
569
630
  if (!(shelfId && (_this$article$accesso = this.article.accessoireParentArticle) !== null && _this$article$accesso !== void 0 && _this$article$accesso.shelfPlanner)) {
570
- _context6.next = 26;
631
+ _context6.next = 27;
571
632
  break;
572
633
  }
573
634
  accessoires = this.article.accessoireParentArticle.shelfPlanner.getAccessorireByCodex(shelfId, initAcc.Codex);
574
635
  if (!(accessoires && accessoires.length > 0)) {
575
- _context6.next = 26;
636
+ _context6.next = 27;
576
637
  break;
577
638
  }
578
639
  accessoireToDelete = accessoires[0];
579
640
  rh = (_accessoireToDelete$s = accessoireToDelete.shelfPlanner) === null || _accessoireToDelete$s === void 0 ? void 0 : _accessoireToDelete$s.getRHOnParentArticle();
580
641
  if (!(rh !== undefined && accessoireToDelete.relatedToShelfGrid !== undefined)) {
581
- _context6.next = 26;
642
+ _context6.next = 27;
582
643
  break;
583
644
  }
584
- _context6.next = 26;
645
+ _context6.next = 27;
585
646
  return index.setHandlerInstance.deleteAccessorieOnShelfPlanner(this.article.set, accessoireToDelete.relatedToShelfGrid, rh, this.article.accessoireParentArticle.basketId);
586
- case 26:
587
- grid.ActAccessoire = undefined;
588
647
  case 27:
648
+ grid.ActAccessoire = undefined;
649
+ case 28:
589
650
  k++;
590
651
  _context6.next = 12;
591
652
  break;
592
- case 30:
653
+ case 31:
593
654
  j++;
594
655
  _context6.next = 9;
595
656
  break;
596
- case 33:
657
+ case 34:
597
658
  i++;
598
659
  _context6.next = 2;
599
660
  break;
600
- case 36:
661
+ case 37:
601
662
  case "end":
602
663
  return _context6.stop();
603
664
  }
@@ -633,7 +694,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
633
694
  key: "triggerVisibility",
634
695
  value: function () {
635
696
  var _triggerVisibility = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee7(gridGroup) {
636
- var toCleanOptions, toUpdateOptions, i, grid, _i4, option, visitOptionState;
697
+ var toCleanOptions, toUpdateOptions, i, grid, _i5, option, visitOptionState;
637
698
  return _regeneratorRuntime__default["default"].wrap(function _callee7$(_context7) {
638
699
  while (1) switch (_context7.prev = _context7.next) {
639
700
  case 0:
@@ -669,13 +730,13 @@ var ShelfPlanner = /*#__PURE__*/function () {
669
730
  _context7.next = 3;
670
731
  break;
671
732
  case 13:
672
- _i4 = 0;
733
+ _i5 = 0;
673
734
  case 14:
674
- if (!(_i4 < [].concat(toUpdateOptions, toCleanOptions).length)) {
735
+ if (!(_i5 < [].concat(toUpdateOptions, toCleanOptions).length)) {
675
736
  _context7.next = 23;
676
737
  break;
677
738
  }
678
- option = [].concat(toUpdateOptions, toCleanOptions)[_i4];
739
+ option = [].concat(toUpdateOptions, toCleanOptions)[_i5];
679
740
  visitOptionState = this.article.getArticleOptionState((!this.article.CatalogData.isIDMFormat ? 'OPT' : '') + option);
680
741
  if (!visitOptionState) {
681
742
  _context7.next = 20;
@@ -684,7 +745,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
684
745
  _context7.next = 20;
685
746
  return index.articleHandlerInstance.updateOption(this.article, visitOptionState.optionCodex, toUpdateOptions.includes(option) ? 'OPVMIT' : 'OPVOHNE');
686
747
  case 20:
687
- _i4++;
748
+ _i5++;
688
749
  _context7.next = 14;
689
750
  break;
690
751
  case 23:
@@ -829,7 +890,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
829
890
  key: "deleteAccessoireOfCellInGrid",
830
891
  value: (function () {
831
892
  var _deleteAccessoireOfCellInGrid = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee9(gridIndex, cellIndex) {
832
- var grid, inUse, deleteIndex, onBoardCell, accessoire;
893
+ var grid, inUse, deleteIndex, onBoardCell, accessoire, deleted;
833
894
  return _regeneratorRuntime__default["default"].wrap(function _callee9$(_context9) {
834
895
  while (1) switch (_context9.prev = _context9.next) {
835
896
  case 0:
@@ -856,8 +917,17 @@ var ShelfPlanner = /*#__PURE__*/function () {
856
917
  _context9.next = 10;
857
918
  return grid.deleteAccessoireInCells(deleteIndex);
858
919
  case 10:
859
- return _context9.abrupt("return", _context9.sent);
860
- case 11:
920
+ deleted = _context9.sent;
921
+ if (deleted) this.logShelfDebug({
922
+ phase: 'placement',
923
+ action: 'accessoryDeleted',
924
+ gridIndex: gridIndex,
925
+ cellIndex: deleteIndex,
926
+ articleCodex: deleted.articleCodex,
927
+ articleName: deleted.name
928
+ });
929
+ return _context9.abrupt("return", deleted);
930
+ case 13:
861
931
  case "end":
862
932
  return _context9.stop();
863
933
  }
@@ -899,7 +969,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
899
969
  key: "handleDeleteTakePlaceOnOtherGrids",
900
970
  value: (function () {
901
971
  var _handleDeleteTakePlaceOnOtherGrids = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee10(gridIndex, cellIndex, accessoire) {
902
- var i, _cell$Article, cell, _i5, _cell$Article2, _cell, _i6;
972
+ var i, _cell$Article, cell, _i6, _cell$Article2, _cell, _i7;
903
973
  return _regeneratorRuntime__default["default"].wrap(function _callee10$(_context10) {
904
974
  while (1) switch (_context10.prev = _context10.next) {
905
975
  case 0:
@@ -918,8 +988,8 @@ var ShelfPlanner = /*#__PURE__*/function () {
918
988
  }
919
989
  }
920
990
  if (accessoire.shelfHeightBelow) {
921
- for (_i5 = 0; _i5 < accessoire.shelfHeightBelow; _i5++) {
922
- _cell = this.grids[gridIndex].Cells[cellIndex - (_i5 + 1)];
991
+ for (_i6 = 0; _i6 < accessoire.shelfHeightBelow; _i6++) {
992
+ _cell = this.grids[gridIndex].Cells[cellIndex - (_i6 + 1)];
923
993
  if ((_cell === null || _cell === void 0 || (_cell$Article2 = _cell.Article) === null || _cell$Article2 === void 0 ? void 0 : _cell$Article2.basketId) === accessoire.basketId) {
924
994
  _cell.ClearInUse();
925
995
  }
@@ -929,22 +999,22 @@ var ShelfPlanner = /*#__PURE__*/function () {
929
999
  _context10.next = 14;
930
1000
  break;
931
1001
  }
932
- _i6 = 0;
1002
+ _i7 = 0;
933
1003
  case 6:
934
- if (!(_i6 < this.grids.length)) {
1004
+ if (!(_i7 < this.grids.length)) {
935
1005
  _context10.next = 14;
936
1006
  break;
937
1007
  }
938
- if (!(_i6 === gridIndex)) {
1008
+ if (!(_i7 === gridIndex)) {
939
1009
  _context10.next = 9;
940
1010
  break;
941
1011
  }
942
1012
  return _context10.abrupt("continue", 11);
943
1013
  case 9:
944
1014
  _context10.next = 11;
945
- return this.grids[_i6].deleteAccessoireInCells(cellIndex);
1015
+ return this.grids[_i7].deleteAccessoireInCells(cellIndex);
946
1016
  case 11:
947
- _i6++;
1017
+ _i7++;
948
1018
  _context10.next = 6;
949
1019
  break;
950
1020
  case 14:
@@ -978,25 +1048,41 @@ var ShelfPlanner = /*#__PURE__*/function () {
978
1048
  i = 0;
979
1049
  case 2:
980
1050
  if (!(i < grids.length)) {
981
- _context11.next = 11;
1051
+ _context11.next = 13;
982
1052
  break;
983
1053
  }
984
1054
  grid = grids[i];
985
1055
  if (!grid.DisabledByRule) {
986
- _context11.next = 6;
1056
+ _context11.next = 7;
987
1057
  break;
988
1058
  }
989
- return _context11.abrupt("continue", 8);
990
- case 6:
991
- _context11.next = 8;
1059
+ this.logShelfDebug({
1060
+ phase: 'placement',
1061
+ action: 'placementSkippedGridDisabled',
1062
+ gridIndex: grid.ShelfIndex,
1063
+ cellIndex: cellIndex,
1064
+ articleCodex: accessoire.articleCodex
1065
+ });
1066
+ return _context11.abrupt("continue", 10);
1067
+ case 7:
1068
+ this.logShelfDebug({
1069
+ phase: 'placement',
1070
+ action: 'accessoryPlaced',
1071
+ gridIndex: grid.ShelfIndex,
1072
+ cellIndex: cellIndex,
1073
+ articleCodex: accessoire.articleCodex,
1074
+ articleName: accessoire.name,
1075
+ detail: type + (grid.ShelfIndex !== gridIndex ? ' (placeholder via TakePlaceOnOtherGrids)' : '')
1076
+ });
1077
+ _context11.next = 10;
992
1078
  return grids[i].addAccessoireInCells(cellIndex, accessoire, type, grid.ShelfIndex !== gridIndex ? true : params === null || params === void 0 ? void 0 : params.noMove, grid.ShelfIndex !== gridIndex ? true : params === null || params === void 0 ? void 0 : params.noDelete, grid.ShelfIndex !== gridIndex ? true : undefined);
993
- case 8:
1079
+ case 10:
994
1080
  i++;
995
1081
  _context11.next = 2;
996
1082
  break;
997
- case 11:
1083
+ case 13:
998
1084
  this.checkForFreeAccessoire(accessoire);
999
- case 12:
1085
+ case 14:
1000
1086
  case "end":
1001
1087
  return _context11.stop();
1002
1088
  }
@@ -1309,68 +1395,93 @@ var ShelfPlanner = /*#__PURE__*/function () {
1309
1395
  key: "disableCellsByDockedShelfs",
1310
1396
  value: (function () {
1311
1397
  var _disableCellsByDockedShelfs = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee12(count) {
1312
- var grids, i, grid, gridCount, toDisableCells, useCount, j, _j, cell, _j2;
1313
- return _regeneratorRuntime__default["default"].wrap(function _callee12$(_context12) {
1314
- while (1) switch (_context12.prev = _context12.next) {
1398
+ var _this2 = this;
1399
+ var grids, _loop2, i;
1400
+ return _regeneratorRuntime__default["default"].wrap(function _callee12$(_context13) {
1401
+ while (1) switch (_context13.prev = _context13.next) {
1315
1402
  case 0:
1316
1403
  grids = this.activeGrids;
1404
+ _loop2 = /*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _loop2() {
1405
+ var grid, gridCount, toDisableCells, useCount, j, newlyDisabled, newlyEnabled, _j, cell, _j2;
1406
+ return _regeneratorRuntime__default["default"].wrap(function _loop2$(_context12) {
1407
+ while (1) switch (_context12.prev = _context12.next) {
1408
+ case 0:
1409
+ grid = grids[i];
1410
+ gridCount = grid.getCellCount();
1411
+ toDisableCells = grid.getDisabledCellsByRule();
1412
+ useCount = count == undefined || count > gridCount ? gridCount : count;
1413
+ for (j = useCount; j < grid.Cells.length; j++) {
1414
+ toDisableCells.push(j);
1415
+ }
1416
+ newlyDisabled = toDisableCells.filter(function (idx) {
1417
+ return grid.Cells[idx] && !grid.Cells[idx].IsDisabled;
1418
+ });
1419
+ newlyEnabled = grid.Cells.filter(function (cell, j) {
1420
+ return cell.IsDisabled && !toDisableCells.includes(j);
1421
+ }).length;
1422
+ if (newlyDisabled.length || newlyEnabled) _this2.logShelfDebug({
1423
+ phase: 'docking',
1424
+ action: 'disabledCellsUpdated',
1425
+ gridIndex: grid.ShelfIndex,
1426
+ detail: "newlyDisabled=[".concat(newlyDisabled.slice(0, 30).join(','), "] reEnabled=").concat(newlyEnabled, " ") + "(sources: DisableCellsByRules/measures=".concat(grid.getDisabledCellsByRule().length, ", beyond cellCount/docking cap=").concat(grid.Cells.length - useCount, "); ") + 'an occupied cell that gets disabled deletes its accessory'
1427
+ });
1428
+ _j = 0;
1429
+ case 9:
1430
+ if (!(_j < toDisableCells.length)) {
1431
+ _context12.next = 18;
1432
+ break;
1433
+ }
1434
+ cell = grid.Cells[toDisableCells[_j]];
1435
+ if (!(cell.InUse == toDisableCells[_j])) {
1436
+ _context12.next = 14;
1437
+ break;
1438
+ }
1439
+ _context12.next = 14;
1440
+ return index.setHandlerInstance.deleteAccessorieOnShelfPlanner(_this2.article.set, grid.ShelfIndex, cell.InUse, grid.basketId);
1441
+ case 14:
1442
+ cell.IsDisabled = true;
1443
+ case 15:
1444
+ _j++;
1445
+ _context12.next = 9;
1446
+ break;
1447
+ case 18:
1448
+ _j2 = 0;
1449
+ case 19:
1450
+ if (!(_j2 < grid.Cells.length)) {
1451
+ _context12.next = 26;
1452
+ break;
1453
+ }
1454
+ if (!toDisableCells.includes(_j2)) {
1455
+ _context12.next = 22;
1456
+ break;
1457
+ }
1458
+ return _context12.abrupt("continue", 23);
1459
+ case 22:
1460
+ grid.Cells[_j2].IsDisabled = false;
1461
+ case 23:
1462
+ _j2++;
1463
+ _context12.next = 19;
1464
+ break;
1465
+ case 26:
1466
+ case "end":
1467
+ return _context12.stop();
1468
+ }
1469
+ }, _loop2);
1470
+ });
1317
1471
  i = 0;
1318
- case 2:
1472
+ case 3:
1319
1473
  if (!(i < grids.length)) {
1320
- _context12.next = 29;
1321
- break;
1322
- }
1323
- grid = grids[i];
1324
- gridCount = grid.getCellCount();
1325
- toDisableCells = grid.getDisabledCellsByRule();
1326
- useCount = count == undefined || count > gridCount ? gridCount : count;
1327
- for (j = useCount; j < grid.Cells.length; j++) {
1328
- toDisableCells.push(j);
1329
- }
1330
- _j = 0;
1331
- case 9:
1332
- if (!(_j < toDisableCells.length)) {
1333
- _context12.next = 18;
1334
- break;
1335
- }
1336
- cell = grid.Cells[toDisableCells[_j]];
1337
- if (!(cell.InUse == toDisableCells[_j])) {
1338
- _context12.next = 14;
1339
- break;
1340
- }
1341
- _context12.next = 14;
1342
- return index.setHandlerInstance.deleteAccessorieOnShelfPlanner(this.article.set, grid.ShelfIndex, cell.InUse, grid.basketId);
1343
- case 14:
1344
- cell.IsDisabled = true;
1345
- case 15:
1346
- _j++;
1347
- _context12.next = 9;
1348
- break;
1349
- case 18:
1350
- _j2 = 0;
1351
- case 19:
1352
- if (!(_j2 < grid.Cells.length)) {
1353
- _context12.next = 26;
1474
+ _context13.next = 8;
1354
1475
  break;
1355
1476
  }
1356
- if (!toDisableCells.includes(_j2)) {
1357
- _context12.next = 22;
1358
- break;
1359
- }
1360
- return _context12.abrupt("continue", 23);
1361
- case 22:
1362
- grid.Cells[_j2].IsDisabled = false;
1363
- case 23:
1364
- _j2++;
1365
- _context12.next = 19;
1366
- break;
1367
- case 26:
1477
+ return _context13.delegateYield(_loop2(), "t0", 5);
1478
+ case 5:
1368
1479
  i++;
1369
- _context12.next = 2;
1480
+ _context13.next = 3;
1370
1481
  break;
1371
- case 29:
1482
+ case 8:
1372
1483
  case "end":
1373
- return _context12.stop();
1484
+ return _context13.stop();
1374
1485
  }
1375
1486
  }, _callee12, this);
1376
1487
  }));