@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
@@ -4,7 +4,7 @@ import _classCallCheck from '@babel/runtime/helpers/classCallCheck';
4
4
  import _createClass from '@babel/runtime/helpers/createClass';
5
5
  import _defineProperty from '@babel/runtime/helpers/defineProperty';
6
6
  import _regeneratorRuntime from '@babel/runtime/regenerator';
7
- import { G as Grid, a as articleHandlerInstance, b as setHandlerInstance } from './index-6c8de812.js';
7
+ import { G as Grid, a as articleHandlerInstance, b as setHandlerInstance } from './index-224d69f7.js';
8
8
  import DivaUtils, { DivaError } from '@crystaldesign/diva-utils';
9
9
  import '@babel/runtime/helpers/slicedToArray';
10
10
  import '@babel/runtime/helpers/objectWithoutProperties';
@@ -19,6 +19,8 @@ import '@crystaldesign/basket-handler';
19
19
  import 'socket.io-client';
20
20
  import '@crystaldesign/planner-2d-core';
21
21
 
22
+ 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; }
23
+ 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(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; }
22
24
  var LOG = DivaUtils.initLog('Planner', 'WEB-PLANNER-LOGIC');
23
25
  var ShelfPlanner = /*#__PURE__*/function () {
24
26
  function ShelfPlanner(data, article) {
@@ -47,6 +49,15 @@ var ShelfPlanner = /*#__PURE__*/function () {
47
49
  //rule so the shelfplanner cells get disabled when the neighbour (AVL or AVR) is smaller. eg: Ben sulvag
48
50
  _defineProperty(this, "disableCellsByElement", void 0);
49
51
  _defineProperty(this, "montageOptions", []);
52
+ /**
53
+ * Debug trail of shelf-planner mutations (the shelf equivalent of the box
54
+ * planner's constructionDebugStack): one entry per visibility flip, grid
55
+ * disable/enable/recreate, accessory placement/deletion and cell-disabling
56
+ * run — so "why did my accessory disappear" is answerable from history.
57
+ * Append-only (capped), NOT reset per configure.
58
+ */
59
+ _defineProperty(this, "shelfDebugStack", []);
60
+ _defineProperty(this, "shelfDebugSeq", 0);
50
61
  //true until the shelfaccessoires saved in the basket were restored into the cells (see restoreShelfAccessoires in the DivaSetHandler).
51
62
  //until then no initAcc may be placed, they would occupy the cells of the saved accessoires
52
63
  _defineProperty(this, "restorePending", void 0);
@@ -79,6 +90,14 @@ var ShelfPlanner = /*#__PURE__*/function () {
79
90
  * init dictionary of all the accessoires that which can be free in theory
80
91
  */
81
92
  return _createClass(ShelfPlanner, [{
93
+ key: "logShelfDebug",
94
+ value: function logShelfDebug(entry) {
95
+ this.shelfDebugStack.push(_objectSpread({
96
+ seq: this.shelfDebugSeq++
97
+ }, entry));
98
+ if (this.shelfDebugStack.length > 500) this.shelfDebugStack.splice(0, this.shelfDebugStack.length - 500);
99
+ }
100
+ }, {
82
101
  key: "initFreeArticles",
83
102
  value: function initFreeArticles() {
84
103
  if (!this.data.ShelfPlanner) return;
@@ -120,32 +139,37 @@ var ShelfPlanner = /*#__PURE__*/function () {
120
139
  while (1) switch (_context.prev = _context.next) {
121
140
  case 0:
122
141
  if (!(this.isVisible != isVisible)) {
123
- _context.next = 12;
142
+ _context.next = 13;
124
143
  break;
125
144
  }
145
+ this.logShelfDebug({
146
+ phase: 'visibility',
147
+ action: isVisible ? 'plannerShown' : 'plannerHidden',
148
+ detail: isVisible ? undefined : 'showOnRule/visibility turned false — all placed accessories are deleted'
149
+ });
126
150
  if (!isVisible) {
127
- _context.next = 10;
151
+ _context.next = 11;
128
152
  break;
129
153
  }
130
154
  this.isVisible = isVisible;
131
155
  if (this.article.shelfPlanData) {
132
- _context.next = 8;
156
+ _context.next = 9;
133
157
  break;
134
158
  }
135
- _context.next = 6;
159
+ _context.next = 7;
136
160
  return this.onConfigChanged({});
137
- case 6:
138
- _context.next = 8;
161
+ case 7:
162
+ _context.next = 9;
139
163
  return this.initAccList();
140
- case 8:
141
- _context.next = 12;
164
+ case 9:
165
+ _context.next = 13;
142
166
  break;
143
- case 10:
144
- _context.next = 12;
167
+ case 11:
168
+ _context.next = 13;
145
169
  return this.deleteAllAcc();
146
- case 12:
147
- this.isVisible = isVisible;
148
170
  case 13:
171
+ this.isVisible = isVisible;
172
+ case 14:
149
173
  case "end":
150
174
  return _context.stop();
151
175
  }
@@ -164,7 +188,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
164
188
  key: "onConfigChanged",
165
189
  value: (function () {
166
190
  var _onConfigChanged = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(variantValues) {
167
- var newHeightSet, gridsTodos, i, _i, _i2, grid, grids, _i3, _grid$DisableCellsByM, _grid;
191
+ var newHeightSet, gridsTodos, i, _i, grid, _i2, _i3, _grid, grids, _i4, _grid2$DisableCellsBy, _grid2;
168
192
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
169
193
  while (1) switch (_context2.prev = _context2.next) {
170
194
  case 0:
@@ -173,7 +197,6 @@ var ShelfPlanner = /*#__PURE__*/function () {
173
197
  for (i = 0; i < this.grids.length; i++) {
174
198
  gridsTodos.push(this.grids[i].onConfigChanged());
175
199
  }
176
- //first delete all disables grids then init all the new ones
177
200
  _i = 0;
178
201
  case 4:
179
202
  if (!(_i < gridsTodos.length)) {
@@ -186,10 +209,19 @@ var ShelfPlanner = /*#__PURE__*/function () {
186
209
  }
187
210
  return _context2.abrupt("continue", 10);
188
211
  case 7:
189
- //remember the accessoires before they get deleted, so they can be placed again when the grid becomes active again
190
- this.stashAccessoiresOfGrid(_i);
191
- _context2.next = 10;
192
- return this.grids[_i].deleteAllAccOfGrid();
212
+ grid = this.grids[_i];
213
+ if (gridsTodos[_i].includes('disableGridRule')) this.logShelfDebug({
214
+ phase: 'configChanged',
215
+ action: grid.DisabledByRule ? 'gridDisabledByRule' : 'gridEnabledByRule',
216
+ gridIndex: grid.ShelfIndex,
217
+ detail: grid.ShowOnRule
218
+ });
219
+ if (gridsTodos[_i].includes('heightGridRule')) this.logShelfDebug({
220
+ phase: 'configChanged',
221
+ action: 'gridRecreated',
222
+ gridIndex: grid.ShelfIndex,
223
+ detail: 'HeightGridCellCountOnRule match changed — grid rebuilt (cell count / placeable accessories can change), its accessories are deleted'
224
+ });
193
225
  case 10:
194
226
  _i++;
195
227
  _context2.next = 4;
@@ -198,74 +230,95 @@ var ShelfPlanner = /*#__PURE__*/function () {
198
230
  _i2 = 0;
199
231
  case 14:
200
232
  if (!(_i2 < gridsTodos.length)) {
201
- _context2.next = 30;
233
+ _context2.next = 23;
202
234
  break;
203
235
  }
204
236
  if (gridsTodos[_i2].length) {
205
237
  _context2.next = 17;
206
238
  break;
207
239
  }
208
- return _context2.abrupt("continue", 27);
240
+ return _context2.abrupt("continue", 20);
209
241
  case 17:
210
- if (gridsTodos[_i2].includes('heightGridRule')) {
211
- this.creatNewGrid(_i2);
242
+ //remember the accessoires before they get deleted, so they can be placed again when the grid becomes active again
243
+ this.stashAccessoiresOfGrid(_i2);
244
+ _context2.next = 20;
245
+ return this.grids[_i2].deleteAllAccOfGrid();
246
+ case 20:
247
+ _i2++;
248
+ _context2.next = 14;
249
+ break;
250
+ case 23:
251
+ _i3 = 0;
252
+ case 24:
253
+ if (!(_i3 < gridsTodos.length)) {
254
+ _context2.next = 40;
255
+ break;
256
+ }
257
+ if (gridsTodos[_i3].length) {
258
+ _context2.next = 27;
259
+ break;
260
+ }
261
+ return _context2.abrupt("continue", 37);
262
+ case 27:
263
+ if (gridsTodos[_i3].includes('heightGridRule')) {
264
+ this.creatNewGrid(_i3);
212
265
  newHeightSet = true;
213
266
  }
214
267
  //read the grid after a possible recreate, the replaced one is not the grid that gets filled
215
- grid = this.grids[_i2];
216
- if (!((gridsTodos[_i2].includes('heightGridRule') || gridsTodos[_i2].includes('disableGridRule')) && !grid.DisabledByRule)) {
217
- _context2.next = 27;
268
+ _grid = this.grids[_i3];
269
+ if (!((gridsTodos[_i3].includes('heightGridRule') || gridsTodos[_i3].includes('disableGridRule')) && !_grid.DisabledByRule)) {
270
+ _context2.next = 37;
218
271
  break;
219
272
  }
220
273
  if (!this.restorePending) {
221
- _context2.next = 22;
274
+ _context2.next = 32;
222
275
  break;
223
276
  }
224
- return _context2.abrupt("continue", 27);
225
- case 22:
226
- _context2.next = 24;
227
- return this.placeStashedAccessoiresOfGrid(_i2);
228
- case 24:
277
+ return _context2.abrupt("continue", 37);
278
+ case 32:
279
+ _context2.next = 34;
280
+ return this.placeStashedAccessoiresOfGrid(_i3);
281
+ case 34:
229
282
  if (_context2.sent) {
230
- _context2.next = 27;
283
+ _context2.next = 37;
231
284
  break;
232
285
  }
233
- _context2.next = 27;
234
- return this.initAccList(_i2);
235
- case 27:
236
- _i2++;
237
- _context2.next = 14;
286
+ _context2.next = 37;
287
+ return this.initAccList(_i3);
288
+ case 37:
289
+ _i3++;
290
+ _context2.next = 24;
238
291
  break;
239
- case 30:
292
+ case 40:
240
293
  if (!(!newHeightSet && Object.keys(variantValues).length)) {
241
- _context2.next = 41;
294
+ _context2.next = 51;
242
295
  break;
243
296
  }
244
297
  grids = this.activeGrids;
245
- _i3 = 0;
246
- case 33:
247
- if (!(_i3 < grids.length)) {
248
- _context2.next = 41;
298
+ _i4 = 0;
299
+ case 43:
300
+ if (!(_i4 < grids.length)) {
301
+ _context2.next = 51;
249
302
  break;
250
303
  }
251
- _grid = grids[_i3];
252
- if (!((_grid$DisableCellsByM = _grid.DisableCellsByMeasures) !== null && _grid$DisableCellsByM !== void 0 && _grid$DisableCellsByM.options.find(function (o) {
304
+ _grid2 = grids[_i4];
305
+ if (!((_grid2$DisableCellsBy = _grid2.DisableCellsByMeasures) !== null && _grid2$DisableCellsBy !== void 0 && _grid2$DisableCellsBy.options.find(function (o) {
253
306
  return Object.keys(variantValues).includes('OPT' + o.opt);
254
- }) || !!_grid.disableCellsByRules)) {
255
- _context2.next = 38;
307
+ }) || !!_grid2.disableCellsByRules)) {
308
+ _context2.next = 48;
256
309
  break;
257
310
  }
258
311
  newHeightSet = true;
259
- return _context2.abrupt("break", 41);
260
- case 38:
261
- _i3++;
262
- _context2.next = 33;
312
+ return _context2.abrupt("break", 51);
313
+ case 48:
314
+ _i4++;
315
+ _context2.next = 43;
263
316
  break;
264
- case 41:
317
+ case 51:
265
318
  if (newHeightSet) {
266
319
  this.updateDisabledCells();
267
320
  }
268
- case 42:
321
+ case 52:
269
322
  case "end":
270
323
  return _context2.stop();
271
324
  }
@@ -512,7 +565,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
512
565
  i = 0;
513
566
  case 2:
514
567
  if (!(i < grids.length)) {
515
- _context6.next = 36;
568
+ _context6.next = 37;
516
569
  break;
517
570
  }
518
571
  grid = grids[i];
@@ -520,72 +573,80 @@ var ShelfPlanner = /*#__PURE__*/function () {
520
573
  _context6.next = 6;
521
574
  break;
522
575
  }
523
- return _context6.abrupt("continue", 33);
576
+ return _context6.abrupt("continue", 34);
524
577
  case 6:
525
578
  if (grid.InitAccArr) {
526
579
  _context6.next = 8;
527
580
  break;
528
581
  }
529
- return _context6.abrupt("continue", 33);
582
+ return _context6.abrupt("continue", 34);
530
583
  case 8:
531
584
  j = 0;
532
585
  case 9:
533
586
  if (!(j < grid.InitAccArr.length)) {
534
- _context6.next = 33;
587
+ _context6.next = 34;
535
588
  break;
536
589
  }
537
590
  initAcc = grid.InitAccArr[j];
538
591
  k = 0;
539
592
  case 12:
540
593
  if (!(k < initAcc.initRH.length)) {
541
- _context6.next = 30;
594
+ _context6.next = 31;
542
595
  break;
543
596
  }
544
597
  grid.ActAccessoire = initAcc.Codex;
545
- _context6.next = 16;
598
+ this.logShelfDebug({
599
+ phase: 'initAccessories',
600
+ action: 'initAccessoryRequested',
601
+ gridIndex: grid.ShelfIndex,
602
+ cellIndex: initAcc.initRH[k],
603
+ articleCodex: initAcc.Codex,
604
+ detail: 'from InitAccArr — a missing matching accessoryPlaced entry right after means the init placement failed'
605
+ });
606
+ _context6.next = 17;
546
607
  return setHandlerInstance.addAccessorieOnShelfPlanner(this.article.set, grid.ShelfIndex, initAcc.initRH[k], grid.basketId, {
547
608
  noMove: initAcc.noMove,
548
609
  noDelete: initAcc.noDelete,
549
610
  byInit: true
550
611
  });
551
- case 16:
612
+ case 17:
552
613
  if (!initAcc.replaceFromParent) {
553
- _context6.next = 26;
614
+ _context6.next = 27;
554
615
  break;
555
616
  }
556
617
  shelfId = this.getShelfParentShelfId();
557
618
  if (!(shelfId && (_this$article$accesso = this.article.accessoireParentArticle) !== null && _this$article$accesso !== void 0 && _this$article$accesso.shelfPlanner)) {
558
- _context6.next = 26;
619
+ _context6.next = 27;
559
620
  break;
560
621
  }
561
622
  accessoires = this.article.accessoireParentArticle.shelfPlanner.getAccessorireByCodex(shelfId, initAcc.Codex);
562
623
  if (!(accessoires && accessoires.length > 0)) {
563
- _context6.next = 26;
624
+ _context6.next = 27;
564
625
  break;
565
626
  }
566
627
  accessoireToDelete = accessoires[0];
567
628
  rh = (_accessoireToDelete$s = accessoireToDelete.shelfPlanner) === null || _accessoireToDelete$s === void 0 ? void 0 : _accessoireToDelete$s.getRHOnParentArticle();
568
629
  if (!(rh !== undefined && accessoireToDelete.relatedToShelfGrid !== undefined)) {
569
- _context6.next = 26;
630
+ _context6.next = 27;
570
631
  break;
571
632
  }
572
- _context6.next = 26;
633
+ _context6.next = 27;
573
634
  return setHandlerInstance.deleteAccessorieOnShelfPlanner(this.article.set, accessoireToDelete.relatedToShelfGrid, rh, this.article.accessoireParentArticle.basketId);
574
- case 26:
575
- grid.ActAccessoire = undefined;
576
635
  case 27:
636
+ grid.ActAccessoire = undefined;
637
+ case 28:
577
638
  k++;
578
639
  _context6.next = 12;
579
640
  break;
580
- case 30:
641
+ case 31:
581
642
  j++;
582
643
  _context6.next = 9;
583
644
  break;
584
- case 33:
645
+ case 34:
585
646
  i++;
586
647
  _context6.next = 2;
587
648
  break;
588
- case 36:
649
+ case 37:
589
650
  case "end":
590
651
  return _context6.stop();
591
652
  }
@@ -621,7 +682,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
621
682
  key: "triggerVisibility",
622
683
  value: function () {
623
684
  var _triggerVisibility = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(gridGroup) {
624
- var toCleanOptions, toUpdateOptions, i, grid, _i4, option, visitOptionState;
685
+ var toCleanOptions, toUpdateOptions, i, grid, _i5, option, visitOptionState;
625
686
  return _regeneratorRuntime.wrap(function _callee7$(_context7) {
626
687
  while (1) switch (_context7.prev = _context7.next) {
627
688
  case 0:
@@ -657,13 +718,13 @@ var ShelfPlanner = /*#__PURE__*/function () {
657
718
  _context7.next = 3;
658
719
  break;
659
720
  case 13:
660
- _i4 = 0;
721
+ _i5 = 0;
661
722
  case 14:
662
- if (!(_i4 < [].concat(toUpdateOptions, toCleanOptions).length)) {
723
+ if (!(_i5 < [].concat(toUpdateOptions, toCleanOptions).length)) {
663
724
  _context7.next = 23;
664
725
  break;
665
726
  }
666
- option = [].concat(toUpdateOptions, toCleanOptions)[_i4];
727
+ option = [].concat(toUpdateOptions, toCleanOptions)[_i5];
667
728
  visitOptionState = this.article.getArticleOptionState((!this.article.CatalogData.isIDMFormat ? 'OPT' : '') + option);
668
729
  if (!visitOptionState) {
669
730
  _context7.next = 20;
@@ -672,7 +733,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
672
733
  _context7.next = 20;
673
734
  return articleHandlerInstance.updateOption(this.article, visitOptionState.optionCodex, toUpdateOptions.includes(option) ? 'OPVMIT' : 'OPVOHNE');
674
735
  case 20:
675
- _i4++;
736
+ _i5++;
676
737
  _context7.next = 14;
677
738
  break;
678
739
  case 23:
@@ -817,7 +878,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
817
878
  key: "deleteAccessoireOfCellInGrid",
818
879
  value: (function () {
819
880
  var _deleteAccessoireOfCellInGrid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(gridIndex, cellIndex) {
820
- var grid, inUse, deleteIndex, onBoardCell, accessoire;
881
+ var grid, inUse, deleteIndex, onBoardCell, accessoire, deleted;
821
882
  return _regeneratorRuntime.wrap(function _callee9$(_context9) {
822
883
  while (1) switch (_context9.prev = _context9.next) {
823
884
  case 0:
@@ -844,8 +905,17 @@ var ShelfPlanner = /*#__PURE__*/function () {
844
905
  _context9.next = 10;
845
906
  return grid.deleteAccessoireInCells(deleteIndex);
846
907
  case 10:
847
- return _context9.abrupt("return", _context9.sent);
848
- case 11:
908
+ deleted = _context9.sent;
909
+ if (deleted) this.logShelfDebug({
910
+ phase: 'placement',
911
+ action: 'accessoryDeleted',
912
+ gridIndex: gridIndex,
913
+ cellIndex: deleteIndex,
914
+ articleCodex: deleted.articleCodex,
915
+ articleName: deleted.name
916
+ });
917
+ return _context9.abrupt("return", deleted);
918
+ case 13:
849
919
  case "end":
850
920
  return _context9.stop();
851
921
  }
@@ -887,7 +957,7 @@ var ShelfPlanner = /*#__PURE__*/function () {
887
957
  key: "handleDeleteTakePlaceOnOtherGrids",
888
958
  value: (function () {
889
959
  var _handleDeleteTakePlaceOnOtherGrids = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(gridIndex, cellIndex, accessoire) {
890
- var i, _cell$Article, cell, _i5, _cell$Article2, _cell, _i6;
960
+ var i, _cell$Article, cell, _i6, _cell$Article2, _cell, _i7;
891
961
  return _regeneratorRuntime.wrap(function _callee10$(_context10) {
892
962
  while (1) switch (_context10.prev = _context10.next) {
893
963
  case 0:
@@ -906,8 +976,8 @@ var ShelfPlanner = /*#__PURE__*/function () {
906
976
  }
907
977
  }
908
978
  if (accessoire.shelfHeightBelow) {
909
- for (_i5 = 0; _i5 < accessoire.shelfHeightBelow; _i5++) {
910
- _cell = this.grids[gridIndex].Cells[cellIndex - (_i5 + 1)];
979
+ for (_i6 = 0; _i6 < accessoire.shelfHeightBelow; _i6++) {
980
+ _cell = this.grids[gridIndex].Cells[cellIndex - (_i6 + 1)];
911
981
  if ((_cell === null || _cell === void 0 || (_cell$Article2 = _cell.Article) === null || _cell$Article2 === void 0 ? void 0 : _cell$Article2.basketId) === accessoire.basketId) {
912
982
  _cell.ClearInUse();
913
983
  }
@@ -917,22 +987,22 @@ var ShelfPlanner = /*#__PURE__*/function () {
917
987
  _context10.next = 14;
918
988
  break;
919
989
  }
920
- _i6 = 0;
990
+ _i7 = 0;
921
991
  case 6:
922
- if (!(_i6 < this.grids.length)) {
992
+ if (!(_i7 < this.grids.length)) {
923
993
  _context10.next = 14;
924
994
  break;
925
995
  }
926
- if (!(_i6 === gridIndex)) {
996
+ if (!(_i7 === gridIndex)) {
927
997
  _context10.next = 9;
928
998
  break;
929
999
  }
930
1000
  return _context10.abrupt("continue", 11);
931
1001
  case 9:
932
1002
  _context10.next = 11;
933
- return this.grids[_i6].deleteAccessoireInCells(cellIndex);
1003
+ return this.grids[_i7].deleteAccessoireInCells(cellIndex);
934
1004
  case 11:
935
- _i6++;
1005
+ _i7++;
936
1006
  _context10.next = 6;
937
1007
  break;
938
1008
  case 14:
@@ -966,25 +1036,41 @@ var ShelfPlanner = /*#__PURE__*/function () {
966
1036
  i = 0;
967
1037
  case 2:
968
1038
  if (!(i < grids.length)) {
969
- _context11.next = 11;
1039
+ _context11.next = 13;
970
1040
  break;
971
1041
  }
972
1042
  grid = grids[i];
973
1043
  if (!grid.DisabledByRule) {
974
- _context11.next = 6;
1044
+ _context11.next = 7;
975
1045
  break;
976
1046
  }
977
- return _context11.abrupt("continue", 8);
978
- case 6:
979
- _context11.next = 8;
1047
+ this.logShelfDebug({
1048
+ phase: 'placement',
1049
+ action: 'placementSkippedGridDisabled',
1050
+ gridIndex: grid.ShelfIndex,
1051
+ cellIndex: cellIndex,
1052
+ articleCodex: accessoire.articleCodex
1053
+ });
1054
+ return _context11.abrupt("continue", 10);
1055
+ case 7:
1056
+ this.logShelfDebug({
1057
+ phase: 'placement',
1058
+ action: 'accessoryPlaced',
1059
+ gridIndex: grid.ShelfIndex,
1060
+ cellIndex: cellIndex,
1061
+ articleCodex: accessoire.articleCodex,
1062
+ articleName: accessoire.name,
1063
+ detail: type + (grid.ShelfIndex !== gridIndex ? ' (placeholder via TakePlaceOnOtherGrids)' : '')
1064
+ });
1065
+ _context11.next = 10;
980
1066
  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);
981
- case 8:
1067
+ case 10:
982
1068
  i++;
983
1069
  _context11.next = 2;
984
1070
  break;
985
- case 11:
1071
+ case 13:
986
1072
  this.checkForFreeAccessoire(accessoire);
987
- case 12:
1073
+ case 14:
988
1074
  case "end":
989
1075
  return _context11.stop();
990
1076
  }
@@ -1297,68 +1383,93 @@ var ShelfPlanner = /*#__PURE__*/function () {
1297
1383
  key: "disableCellsByDockedShelfs",
1298
1384
  value: (function () {
1299
1385
  var _disableCellsByDockedShelfs = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(count) {
1300
- var grids, i, grid, gridCount, toDisableCells, useCount, j, _j, cell, _j2;
1301
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
1302
- while (1) switch (_context12.prev = _context12.next) {
1386
+ var _this2 = this;
1387
+ var grids, _loop2, i;
1388
+ return _regeneratorRuntime.wrap(function _callee12$(_context13) {
1389
+ while (1) switch (_context13.prev = _context13.next) {
1303
1390
  case 0:
1304
1391
  grids = this.activeGrids;
1392
+ _loop2 = /*#__PURE__*/_regeneratorRuntime.mark(function _loop2() {
1393
+ var grid, gridCount, toDisableCells, useCount, j, newlyDisabled, newlyEnabled, _j, cell, _j2;
1394
+ return _regeneratorRuntime.wrap(function _loop2$(_context12) {
1395
+ while (1) switch (_context12.prev = _context12.next) {
1396
+ case 0:
1397
+ grid = grids[i];
1398
+ gridCount = grid.getCellCount();
1399
+ toDisableCells = grid.getDisabledCellsByRule();
1400
+ useCount = count == undefined || count > gridCount ? gridCount : count;
1401
+ for (j = useCount; j < grid.Cells.length; j++) {
1402
+ toDisableCells.push(j);
1403
+ }
1404
+ newlyDisabled = toDisableCells.filter(function (idx) {
1405
+ return grid.Cells[idx] && !grid.Cells[idx].IsDisabled;
1406
+ });
1407
+ newlyEnabled = grid.Cells.filter(function (cell, j) {
1408
+ return cell.IsDisabled && !toDisableCells.includes(j);
1409
+ }).length;
1410
+ if (newlyDisabled.length || newlyEnabled) _this2.logShelfDebug({
1411
+ phase: 'docking',
1412
+ action: 'disabledCellsUpdated',
1413
+ gridIndex: grid.ShelfIndex,
1414
+ 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'
1415
+ });
1416
+ _j = 0;
1417
+ case 9:
1418
+ if (!(_j < toDisableCells.length)) {
1419
+ _context12.next = 18;
1420
+ break;
1421
+ }
1422
+ cell = grid.Cells[toDisableCells[_j]];
1423
+ if (!(cell.InUse == toDisableCells[_j])) {
1424
+ _context12.next = 14;
1425
+ break;
1426
+ }
1427
+ _context12.next = 14;
1428
+ return setHandlerInstance.deleteAccessorieOnShelfPlanner(_this2.article.set, grid.ShelfIndex, cell.InUse, grid.basketId);
1429
+ case 14:
1430
+ cell.IsDisabled = true;
1431
+ case 15:
1432
+ _j++;
1433
+ _context12.next = 9;
1434
+ break;
1435
+ case 18:
1436
+ _j2 = 0;
1437
+ case 19:
1438
+ if (!(_j2 < grid.Cells.length)) {
1439
+ _context12.next = 26;
1440
+ break;
1441
+ }
1442
+ if (!toDisableCells.includes(_j2)) {
1443
+ _context12.next = 22;
1444
+ break;
1445
+ }
1446
+ return _context12.abrupt("continue", 23);
1447
+ case 22:
1448
+ grid.Cells[_j2].IsDisabled = false;
1449
+ case 23:
1450
+ _j2++;
1451
+ _context12.next = 19;
1452
+ break;
1453
+ case 26:
1454
+ case "end":
1455
+ return _context12.stop();
1456
+ }
1457
+ }, _loop2);
1458
+ });
1305
1459
  i = 0;
1306
- case 2:
1460
+ case 3:
1307
1461
  if (!(i < grids.length)) {
1308
- _context12.next = 29;
1309
- break;
1310
- }
1311
- grid = grids[i];
1312
- gridCount = grid.getCellCount();
1313
- toDisableCells = grid.getDisabledCellsByRule();
1314
- useCount = count == undefined || count > gridCount ? gridCount : count;
1315
- for (j = useCount; j < grid.Cells.length; j++) {
1316
- toDisableCells.push(j);
1317
- }
1318
- _j = 0;
1319
- case 9:
1320
- if (!(_j < toDisableCells.length)) {
1321
- _context12.next = 18;
1322
- break;
1323
- }
1324
- cell = grid.Cells[toDisableCells[_j]];
1325
- if (!(cell.InUse == toDisableCells[_j])) {
1326
- _context12.next = 14;
1327
- break;
1328
- }
1329
- _context12.next = 14;
1330
- return setHandlerInstance.deleteAccessorieOnShelfPlanner(this.article.set, grid.ShelfIndex, cell.InUse, grid.basketId);
1331
- case 14:
1332
- cell.IsDisabled = true;
1333
- case 15:
1334
- _j++;
1335
- _context12.next = 9;
1336
- break;
1337
- case 18:
1338
- _j2 = 0;
1339
- case 19:
1340
- if (!(_j2 < grid.Cells.length)) {
1341
- _context12.next = 26;
1462
+ _context13.next = 8;
1342
1463
  break;
1343
1464
  }
1344
- if (!toDisableCells.includes(_j2)) {
1345
- _context12.next = 22;
1346
- break;
1347
- }
1348
- return _context12.abrupt("continue", 23);
1349
- case 22:
1350
- grid.Cells[_j2].IsDisabled = false;
1351
- case 23:
1352
- _j2++;
1353
- _context12.next = 19;
1354
- break;
1355
- case 26:
1465
+ return _context13.delegateYield(_loop2(), "t0", 5);
1466
+ case 5:
1356
1467
  i++;
1357
- _context12.next = 2;
1468
+ _context13.next = 3;
1358
1469
  break;
1359
- case 29:
1470
+ case 8:
1360
1471
  case "end":
1361
- return _context12.stop();
1472
+ return _context13.stop();
1362
1473
  }
1363
1474
  }, _callee12, this);
1364
1475
  }));