@crystaldesign/web-planner-logic 24.12.0-beta.9 → 24.13.0-beta.1

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 (88) hide show
  1. package/build/cjs/{DivaBoxPlanner-7b508f32.js → DivaBoxPlanner-d7da16a8.js} +2 -2
  2. package/build/cjs/{DivaStandardPlanner-c73e6e57.js → DivaStandardPlanner-d498cfee.js} +9 -8
  3. package/build/cjs/{DoorPlanner-ffa7af62.js → DoorPlanner-e764c8fb.js} +3 -3
  4. package/build/cjs/{Host3DSignalR-d3830717.js → Host3DSignalR-600ce869.js} +20 -38
  5. package/build/cjs/{LiviqueWWSHandler-85a1dc89.js → LiviqueWWSHandler-3c5f38b8.js} +2 -2
  6. package/build/cjs/{PfisterWWSHandler-b47dba23.js → PfisterWWSHandler-f0420b6e.js} +2 -2
  7. package/build/cjs/{PlannerHandler2D-9d9d1af9.js → PlannerHandler2D-a6c5bc70.js} +37 -32
  8. package/build/cjs/{SeriousBasketHandler-28f031fa.js → SeriousBasketHandler-3e286b68.js} +2 -2
  9. package/build/cjs/{ShelfPlanner-4b697826.js → ShelfPlanner-22e3e6a5.js} +1 -1
  10. package/build/cjs/{StandardWWSHandler-ab0c107b.js → StandardWWSHandler-c2ac4b39.js} +2 -2
  11. package/build/cjs/{index-bceec53b.js → index-96d8f124.js} +774 -1450
  12. package/build/cjs/index.js +1 -2
  13. package/build/esm/{DivaBoxPlanner-81bbe89c.js → DivaBoxPlanner-4ee51455.js} +2 -2
  14. package/build/esm/{DivaStandardPlanner-c3f7e518.js → DivaStandardPlanner-ca3c5ef2.js} +9 -8
  15. package/build/esm/{DoorPlanner-f4b338c4.js → DoorPlanner-a283b46f.js} +3 -3
  16. package/build/esm/{Host3DSignalR-45bb9e24.js → Host3DSignalR-bb7dd950.js} +20 -19
  17. package/build/esm/{LiviqueWWSHandler-d401b8c4.js → LiviqueWWSHandler-d83dd6af.js} +2 -2
  18. package/build/esm/{PfisterWWSHandler-ebfad71d.js → PfisterWWSHandler-48eecaae.js} +2 -2
  19. package/build/esm/{PlannerHandler2D-fb755d99.js → PlannerHandler2D-c2477409.js} +37 -32
  20. package/build/esm/{SeriousBasketHandler-53ff90b8.js → SeriousBasketHandler-13fcc1aa.js} +2 -2
  21. package/build/esm/{ShelfPlanner-569fe7f0.js → ShelfPlanner-31b3a870.js} +1 -1
  22. package/build/esm/{StandardWWSHandler-b903e37c.js → StandardWWSHandler-f96ca8c7.js} +2 -2
  23. package/build/esm/{index-3bbc6483.js → index-e2c00fcd.js} +776 -1450
  24. package/build/esm/index.js +1 -1
  25. package/build/types/web-planner-logic/src/index.d.ts +1 -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 +1 -2
  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/Articles/ArticleInfoType.d.ts +1 -2
  30. package/build/types/web-planner-logic/src/interface/Articles/ArticleInfoType.d.ts.map +1 -1
  31. package/build/types/web-planner-logic/src/interface/Articles/InitArticleType.d.ts +2 -2
  32. package/build/types/web-planner-logic/src/interface/Articles/InitArticleType.d.ts.map +1 -1
  33. package/build/types/web-planner-logic/src/interface/Basket/IDivaWWSHandler.d.ts +1 -3
  34. package/build/types/web-planner-logic/src/interface/Basket/IDivaWWSHandler.d.ts.map +1 -1
  35. package/build/types/web-planner-logic/src/interface/Configuration.d.ts +0 -1
  36. package/build/types/web-planner-logic/src/interface/Configuration.d.ts.map +1 -1
  37. package/build/types/web-planner-logic/src/interface/CoreTypes/index.d.ts +2 -0
  38. package/build/types/web-planner-logic/src/interface/CoreTypes/index.d.ts.map +1 -1
  39. package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts +1 -0
  40. package/build/types/web-planner-logic/src/interface/DivaCatalogDataType.d.ts.map +1 -1
  41. package/build/types/web-planner-logic/src/interface/Products/index.d.ts +6 -1
  42. package/build/types/web-planner-logic/src/interface/Products/index.d.ts.map +1 -1
  43. package/build/types/web-planner-logic/src/interface/ShelfPlanner/plannerData.d.ts +1 -1
  44. package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts +6 -6
  45. package/build/types/web-planner-logic/src/logic/Article/DivaArticle.d.ts.map +1 -1
  46. package/build/types/web-planner-logic/src/logic/Basket/DivaBasketHandler.d.ts +50 -57
  47. package/build/types/web-planner-logic/src/logic/Basket/DivaBasketHandler.d.ts.map +1 -1
  48. package/build/types/web-planner-logic/src/logic/Basket/LiviqueWWSHandler.d.ts +1 -3
  49. package/build/types/web-planner-logic/src/logic/Basket/LiviqueWWSHandler.d.ts.map +1 -1
  50. package/build/types/web-planner-logic/src/logic/Basket/PfisterWWSHandler.d.ts +1 -3
  51. package/build/types/web-planner-logic/src/logic/Basket/PfisterWWSHandler.d.ts.map +1 -1
  52. package/build/types/web-planner-logic/src/logic/Basket/SeriousBasketHandler.d.ts +1 -3
  53. package/build/types/web-planner-logic/src/logic/Basket/SeriousBasketHandler.d.ts.map +1 -1
  54. package/build/types/web-planner-logic/src/logic/Basket/StandardWWSHandler.d.ts +1 -3
  55. package/build/types/web-planner-logic/src/logic/Basket/StandardWWSHandler.d.ts.map +1 -1
  56. package/build/types/web-planner-logic/src/logic/ConfigTree/Shelfplanner/ShelfPlanner.d.ts +2 -2
  57. package/build/types/web-planner-logic/src/logic/ConfigTree/SummaryHandler.d.ts +1 -2
  58. package/build/types/web-planner-logic/src/logic/ConfigTree/SummaryHandler.d.ts.map +1 -1
  59. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts +3 -4
  60. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts.map +1 -1
  61. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts +56 -61
  62. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts.map +1 -1
  63. package/build/types/web-planner-logic/src/logic/Planner/DivaStandardPlanner.d.ts +0 -2
  64. package/build/types/web-planner-logic/src/logic/Planner/DivaStandardPlanner.d.ts.map +1 -1
  65. package/build/types/web-planner-logic/src/logic/Planner/Rendering/Rendering.d.ts +12 -13
  66. package/build/types/web-planner-logic/src/logic/Planner/Rendering/Rendering.d.ts.map +1 -1
  67. package/build/types/web-planner-logic/src/logic/Product/DivaProductHandler.d.ts +3 -44
  68. package/build/types/web-planner-logic/src/logic/Product/DivaProductHandler.d.ts.map +1 -1
  69. package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts +5 -5
  70. package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts.map +1 -1
  71. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts +3 -6
  72. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
  73. package/build/types/web-planner-logic/src/logic/Set/FavoritesHandler.d.ts.map +1 -1
  74. package/build/types/web-planner-logic/src/model/Articles/CatalogArticleData.d.ts.map +1 -1
  75. package/build/types/web-planner-logic/src/model/DivaCatalogData.d.ts +3 -2
  76. package/build/types/web-planner-logic/src/model/DivaCatalogData.d.ts.map +1 -1
  77. package/build/types/web-planner-logic/src/model/Options/CatalogOptionValueData.d.ts.map +1 -1
  78. package/build/types/web-planner-logic/src/test/mocFunctions/index.d.ts.map +1 -1
  79. package/build/types/web-planner-logic/src/test/scripts/create_renderorder.d.ts.map +1 -1
  80. package/build/types/web-planner-logic/src/test/scripts/getOrigProductId.d.ts.map +1 -1
  81. package/build/types/web-planner-logic/src/test/scripts/productHandlerMoc.d.ts.map +1 -1
  82. package/package.json +16 -17
  83. package/build/cjs/ProductBasketHandler-22cb7ee4.js +0 -62
  84. package/build/esm/ProductBasketHandler-68443648.js +0 -55
  85. package/build/types/web-planner-logic/src/logic/Basket/ProductBasketHandler.d.ts +0 -14
  86. package/build/types/web-planner-logic/src/logic/Basket/ProductBasketHandler.d.ts.map +0 -1
  87. package/build/types/web-planner-logic/src/logic/Product/Product.d.ts +0 -71
  88. package/build/types/web-planner-logic/src/logic/Product/Product.d.ts.map +0 -1
@@ -8,7 +8,7 @@ import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
8
8
  import _toConsumableArray from '@babel/runtime/helpers/toConsumableArray';
9
9
  import axios$1 from 'axios';
10
10
  import DivaUtils, { DivaError, md5, nanoid } from '@crystaldesign/diva-utils';
11
- import { PriceObjectData, VariantItemData, JsonConfigPriceData, OrderLineData, CompactOrderLineData, GroupsData, Favorites, Favorit, ConfigVariantData, OrderSetData, BasketData } from '@crystaldesign/basket-model';
11
+ import { PriceObjectData, VariantItemData, JsonConfigPriceData, OrderLineData, CompactOrderLineData, GroupsData, Favorites, Favorite, ConfigVariantData, OrderSetData, BasketData } from '@crystaldesign/basket-model';
12
12
  import BasketHandler from '@crystaldesign/basket-handler';
13
13
  import { io } from 'socket.io-client';
14
14
  import _typeof from '@babel/runtime/helpers/typeof';
@@ -414,7 +414,6 @@ var DivaApiHandler = /*#__PURE__*/function () {
414
414
  mediaServiceApiKey: data.divaMediaServiceApiKey,
415
415
  language: lang !== null && lang !== void 0 ? lang : this.getLanguage(),
416
416
  abTestCases: data.abTestCases !== undefined ? data.abTestCases : [],
417
- checkForProductsInStock: data.checkForProductsInStock,
418
417
  checkForProductsPrice: data.checkForProductsPrice,
419
418
  doDisablePlanner2D: data.doDisablePlanner2D,
420
419
  diva3dStaticBGImage: data.diva3dStaticBGImage != undefined ? data.diva3dStaticBGImage : false,
@@ -486,29 +485,23 @@ var DivaApiHandler = /*#__PURE__*/function () {
486
485
  var _this$apiConfig$host, _this$apiConfig10;
487
486
  return (_this$apiConfig$host = (_this$apiConfig10 = this.apiConfig) === null || _this$apiConfig10 === void 0 ? void 0 : _this$apiConfig10.host3d) !== null && _this$apiConfig$host !== void 0 ? _this$apiConfig$host : '';
488
487
  }
489
- }, {
490
- key: "doCheckForProductsInStock",
491
- value: function doCheckForProductsInStock() {
492
- var _this$divaWebConfigDa4;
493
- return (_this$divaWebConfigDa4 = this.divaWebConfigData) === null || _this$divaWebConfigDa4 === void 0 ? void 0 : _this$divaWebConfigDa4.checkForProductsInStock;
494
- }
495
488
  }, {
496
489
  key: "doCheckForProductsPrice",
497
490
  value: function doCheckForProductsPrice() {
498
- var _this$divaWebConfigDa5;
499
- return this.doCheckForProductsInStock() || ((_this$divaWebConfigDa5 = this.divaWebConfigData) === null || _this$divaWebConfigDa5 === void 0 ? void 0 : _this$divaWebConfigDa5.checkForProductsPrice);
491
+ var _this$divaWebConfigDa4;
492
+ return (_this$divaWebConfigDa4 = this.divaWebConfigData) === null || _this$divaWebConfigDa4 === void 0 ? void 0 : _this$divaWebConfigDa4.checkForProductsPrice;
500
493
  }
501
494
  }, {
502
495
  key: "getReportConfigIdentifier",
503
496
  value: function getReportConfigIdentifier() {
504
- var _this$divaWebConfigDa6;
505
- return (_this$divaWebConfigDa6 = this.divaWebConfigData) === null || _this$divaWebConfigDa6 === void 0 ? void 0 : _this$divaWebConfigDa6.reportConfigIdentifier;
497
+ var _this$divaWebConfigDa5;
498
+ return (_this$divaWebConfigDa5 = this.divaWebConfigData) === null || _this$divaWebConfigDa5 === void 0 ? void 0 : _this$divaWebConfigDa5.reportConfigIdentifier;
506
499
  }
507
500
  }, {
508
501
  key: "getPrintOptions",
509
502
  value: function getPrintOptions() {
510
- var _this$divaWebConfigDa7;
511
- var reportConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (_this$divaWebConfigDa7 = this.divaWebConfigData) === null || _this$divaWebConfigDa7 === void 0 ? void 0 : _this$divaWebConfigDa7.reportConfig;
503
+ var _this$divaWebConfigDa6;
504
+ var reportConfig = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : (_this$divaWebConfigDa6 = this.divaWebConfigData) === null || _this$divaWebConfigDa6 === void 0 ? void 0 : _this$divaWebConfigDa6.reportConfig;
512
505
  return {
513
506
  Gdpr: !!(reportConfig !== null && reportConfig !== void 0 && reportConfig.printWithGDPR),
514
507
  PlanningSketch: !!(reportConfig !== null && reportConfig !== void 0 && reportConfig.printWithPlanningSketch),
@@ -528,8 +521,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
528
521
  }, {
529
522
  key: "get3DRenderGroup",
530
523
  value: function get3DRenderGroup() {
531
- var _this$divaWebConfigDa8, _this$divaWebConfigDa9;
532
- return (_this$divaWebConfigDa8 = (_this$divaWebConfigDa9 = this.divaWebConfigData) === null || _this$divaWebConfigDa9 === void 0 ? void 0 : _this$divaWebConfigDa9.diva3dRenderGroup) !== null && _this$divaWebConfigDa8 !== void 0 ? _this$divaWebConfigDa8 : '';
524
+ var _this$divaWebConfigDa7, _this$divaWebConfigDa8;
525
+ return (_this$divaWebConfigDa7 = (_this$divaWebConfigDa8 = this.divaWebConfigData) === null || _this$divaWebConfigDa8 === void 0 ? void 0 : _this$divaWebConfigDa8.diva3dRenderGroup) !== null && _this$divaWebConfigDa7 !== void 0 ? _this$divaWebConfigDa7 : '';
533
526
  }
534
527
  }, {
535
528
  key: "getServerId",
@@ -566,86 +559,86 @@ var DivaApiHandler = /*#__PURE__*/function () {
566
559
  }, {
567
560
  key: "getDiva3dStaticBGImage",
568
561
  value: function getDiva3dStaticBGImage() {
569
- var _this$divaWebConfigDa10;
570
- return (_this$divaWebConfigDa10 = this.divaWebConfigData) === null || _this$divaWebConfigDa10 === void 0 ? void 0 : _this$divaWebConfigDa10.diva3dStaticBGImage;
562
+ var _this$divaWebConfigDa9;
563
+ return (_this$divaWebConfigDa9 = this.divaWebConfigData) === null || _this$divaWebConfigDa9 === void 0 ? void 0 : _this$divaWebConfigDa9.diva3dStaticBGImage;
571
564
  }
572
565
  }, {
573
566
  key: "getDiva3dStaticBGImage_DefaultRoomList",
574
567
  value: function getDiva3dStaticBGImage_DefaultRoomList() {
575
- var _this$divaWebConfigDa11, _this$divaWebConfigDa12;
576
- return ((_this$divaWebConfigDa11 = this.divaWebConfigData) === null || _this$divaWebConfigDa11 === void 0 ? void 0 : _this$divaWebConfigDa11.diva3dStaticBGImage_DefaultRoomList) == '' ? '3D_STATBG_ROOMLIST' : (_this$divaWebConfigDa12 = this.divaWebConfigData) === null || _this$divaWebConfigDa12 === void 0 ? void 0 : _this$divaWebConfigDa12.diva3dStaticBGImage_DefaultRoomList;
568
+ var _this$divaWebConfigDa10, _this$divaWebConfigDa11;
569
+ return ((_this$divaWebConfigDa10 = this.divaWebConfigData) === null || _this$divaWebConfigDa10 === void 0 ? void 0 : _this$divaWebConfigDa10.diva3dStaticBGImage_DefaultRoomList) == '' ? '3D_STATBG_ROOMLIST' : (_this$divaWebConfigDa11 = this.divaWebConfigData) === null || _this$divaWebConfigDa11 === void 0 ? void 0 : _this$divaWebConfigDa11.diva3dStaticBGImage_DefaultRoomList;
577
570
  }
578
571
  }, {
579
572
  key: "getDiva3DAllowDefaultCatRoomList",
580
573
  value: function getDiva3DAllowDefaultCatRoomList() {
581
- var _this$divaWebConfigDa13;
582
- return (_this$divaWebConfigDa13 = this.divaWebConfigData) === null || _this$divaWebConfigDa13 === void 0 ? void 0 : _this$divaWebConfigDa13.diva3DAllowDefaultCatRoomList;
574
+ var _this$divaWebConfigDa12;
575
+ return (_this$divaWebConfigDa12 = this.divaWebConfigData) === null || _this$divaWebConfigDa12 === void 0 ? void 0 : _this$divaWebConfigDa12.diva3DAllowDefaultCatRoomList;
583
576
  }
584
577
  }, {
585
578
  key: "doAllowSetPlanner",
586
579
  value: function doAllowSetPlanner() {
587
- var _this$divaWebConfigDa14;
588
- return (_this$divaWebConfigDa14 = this.divaWebConfigData) === null || _this$divaWebConfigDa14 === void 0 ? void 0 : _this$divaWebConfigDa14.doAllowSetPlanner;
580
+ var _this$divaWebConfigDa13;
581
+ return (_this$divaWebConfigDa13 = this.divaWebConfigData) === null || _this$divaWebConfigDa13 === void 0 ? void 0 : _this$divaWebConfigDa13.doAllowSetPlanner;
589
582
  }
590
583
  }, {
591
584
  key: "getHidePlanner",
592
585
  value: function getHidePlanner() {
593
- var _this$divaWebConfigDa15;
594
- return !!((_this$divaWebConfigDa15 = this.divaWebConfigData) !== null && _this$divaWebConfigDa15 !== void 0 && (_this$divaWebConfigDa15 = _this$divaWebConfigDa15.viewConfig) !== null && _this$divaWebConfigDa15 !== void 0 && _this$divaWebConfigDa15.hidePlanner);
586
+ var _this$divaWebConfigDa14;
587
+ return !!((_this$divaWebConfigDa14 = this.divaWebConfigData) !== null && _this$divaWebConfigDa14 !== void 0 && (_this$divaWebConfigDa14 = _this$divaWebConfigDa14.viewConfig) !== null && _this$divaWebConfigDa14 !== void 0 && _this$divaWebConfigDa14.hidePlanner);
595
588
  }
596
589
  }, {
597
590
  key: "getDoShowAR",
598
591
  value: function getDoShowAR() {
599
- var _this$divaWebConfigDa16;
600
- return (_this$divaWebConfigDa16 = this.divaWebConfigData) === null || _this$divaWebConfigDa16 === void 0 || (_this$divaWebConfigDa16 = _this$divaWebConfigDa16.viewConfig) === null || _this$divaWebConfigDa16 === void 0 ? void 0 : _this$divaWebConfigDa16.enableAR;
592
+ var _this$divaWebConfigDa15;
593
+ return (_this$divaWebConfigDa15 = this.divaWebConfigData) === null || _this$divaWebConfigDa15 === void 0 || (_this$divaWebConfigDa15 = _this$divaWebConfigDa15.viewConfig) === null || _this$divaWebConfigDa15 === void 0 ? void 0 : _this$divaWebConfigDa15.enableAR;
601
594
  }
602
595
  }, {
603
596
  key: "forceShowRTV",
604
597
  value: function forceShowRTV() {
605
- var _this$divaWebConfigDa17;
606
- return (_this$divaWebConfigDa17 = this.divaWebConfigData) === null || _this$divaWebConfigDa17 === void 0 || (_this$divaWebConfigDa17 = _this$divaWebConfigDa17.viewConfig) === null || _this$divaWebConfigDa17 === void 0 ? void 0 : _this$divaWebConfigDa17.forceRTV;
598
+ var _this$divaWebConfigDa16;
599
+ return (_this$divaWebConfigDa16 = this.divaWebConfigData) === null || _this$divaWebConfigDa16 === void 0 || (_this$divaWebConfigDa16 = _this$divaWebConfigDa16.viewConfig) === null || _this$divaWebConfigDa16 === void 0 ? void 0 : _this$divaWebConfigDa16.forceRTV;
607
600
  }
608
601
  }, {
609
602
  key: "getDoShowRTV",
610
603
  value: function getDoShowRTV() {
611
- var _this$divaWebConfigDa18;
612
- return (_this$divaWebConfigDa18 = this.divaWebConfigData) === null || _this$divaWebConfigDa18 === void 0 || (_this$divaWebConfigDa18 = _this$divaWebConfigDa18.viewConfig) === null || _this$divaWebConfigDa18 === void 0 ? void 0 : _this$divaWebConfigDa18.enableRTV;
604
+ var _this$divaWebConfigDa17;
605
+ return (_this$divaWebConfigDa17 = this.divaWebConfigData) === null || _this$divaWebConfigDa17 === void 0 || (_this$divaWebConfigDa17 = _this$divaWebConfigDa17.viewConfig) === null || _this$divaWebConfigDa17 === void 0 ? void 0 : _this$divaWebConfigDa17.enableRTV;
613
606
  }
614
607
  }, {
615
608
  key: "getEnableRTVUnityKombi",
616
609
  value: function getEnableRTVUnityKombi() {
617
- var _this$divaWebConfigDa19;
618
- return !!((_this$divaWebConfigDa19 = this.divaWebConfigData) !== null && _this$divaWebConfigDa19 !== void 0 && _this$divaWebConfigDa19.viewConfig.enableRtvUnityKombi);
610
+ var _this$divaWebConfigDa18;
611
+ return !!((_this$divaWebConfigDa18 = this.divaWebConfigData) !== null && _this$divaWebConfigDa18 !== void 0 && _this$divaWebConfigDa18.viewConfig.enableRtvUnityKombi);
619
612
  }
620
613
  }, {
621
614
  key: "getDoDisablePlanner2D",
622
615
  value: function getDoDisablePlanner2D() {
623
- var _this$divaWebConfigDa20;
624
- return !!((_this$divaWebConfigDa20 = this.divaWebConfigData) !== null && _this$divaWebConfigDa20 !== void 0 && _this$divaWebConfigDa20.doDisablePlanner2D);
616
+ var _this$divaWebConfigDa19;
617
+ return !!((_this$divaWebConfigDa19 = this.divaWebConfigData) !== null && _this$divaWebConfigDa19 !== void 0 && _this$divaWebConfigDa19.doDisablePlanner2D);
625
618
  }
626
619
  }, {
627
620
  key: "getRoomListInProduct",
628
621
  value: function getRoomListInProduct() {
629
- var _this$divaWebConfigDa21;
630
- return !!((_this$divaWebConfigDa21 = this.divaWebConfigData) !== null && _this$divaWebConfigDa21 !== void 0 && (_this$divaWebConfigDa21 = _this$divaWebConfigDa21.viewConfig) !== null && _this$divaWebConfigDa21 !== void 0 && _this$divaWebConfigDa21.roomListInProduct);
622
+ var _this$divaWebConfigDa20;
623
+ return !!((_this$divaWebConfigDa20 = this.divaWebConfigData) !== null && _this$divaWebConfigDa20 !== void 0 && (_this$divaWebConfigDa20 = _this$divaWebConfigDa20.viewConfig) !== null && _this$divaWebConfigDa20 !== void 0 && _this$divaWebConfigDa20.roomListInProduct);
631
624
  }
632
625
  }, {
633
626
  key: "getPlannerType",
634
627
  value: function getPlannerType() {
635
- var _this$divaWebConfigDa22;
636
- return (_this$divaWebConfigDa22 = this.divaWebConfigData) === null || _this$divaWebConfigDa22 === void 0 || (_this$divaWebConfigDa22 = _this$divaWebConfigDa22.viewConfig) === null || _this$divaWebConfigDa22 === void 0 ? void 0 : _this$divaWebConfigDa22.plannerType;
628
+ var _this$divaWebConfigDa21;
629
+ return (_this$divaWebConfigDa21 = this.divaWebConfigData) === null || _this$divaWebConfigDa21 === void 0 || (_this$divaWebConfigDa21 = _this$divaWebConfigDa21.viewConfig) === null || _this$divaWebConfigDa21 === void 0 ? void 0 : _this$divaWebConfigDa21.plannerType;
637
630
  }
638
631
  }, {
639
632
  key: "getLoadSupplierColors",
640
633
  value: function getLoadSupplierColors() {
641
- var _this$divaWebConfigDa23;
642
- return !!((_this$divaWebConfigDa23 = this.divaWebConfigData) !== null && _this$divaWebConfigDa23 !== void 0 && _this$divaWebConfigDa23.loadSupplierColors);
634
+ var _this$divaWebConfigDa22;
635
+ return !!((_this$divaWebConfigDa22 = this.divaWebConfigData) !== null && _this$divaWebConfigDa22 !== void 0 && _this$divaWebConfigDa22.loadSupplierColors);
643
636
  }
644
637
  }, {
645
638
  key: "showSelectionModeZero",
646
639
  value: function showSelectionModeZero() {
647
- var _this$divaWebConfigDa24;
648
- return !!((_this$divaWebConfigDa24 = this.divaWebConfigData) !== null && _this$divaWebConfigDa24 !== void 0 && _this$divaWebConfigDa24.showSelectionModeZero);
640
+ var _this$divaWebConfigDa23;
641
+ return !!((_this$divaWebConfigDa23 = this.divaWebConfigData) !== null && _this$divaWebConfigDa23 !== void 0 && _this$divaWebConfigDa23.showSelectionModeZero);
649
642
  }
650
643
  }, {
651
644
  key: "ruleDescSeperator",
@@ -665,8 +658,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
665
658
  }, {
666
659
  key: "getDoCheckVariantData",
667
660
  value: function getDoCheckVariantData() {
668
- var _this$divaWebConfigDa25;
669
- return (_this$divaWebConfigDa25 = this.divaWebConfigData) === null || _this$divaWebConfigDa25 === void 0 ? void 0 : _this$divaWebConfigDa25.doCheckVariantData;
661
+ var _this$divaWebConfigDa24;
662
+ return (_this$divaWebConfigDa24 = this.divaWebConfigData) === null || _this$divaWebConfigDa24 === void 0 ? void 0 : _this$divaWebConfigDa24.doCheckVariantData;
670
663
  }
671
664
  }, {
672
665
  key: "setI18n",
@@ -746,7 +739,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
746
739
  }, {
747
740
  key: "getBasketDataUrlCacheKey",
748
741
  value: function getBasketDataUrlCacheKey(divaNr) {
749
- //if divaNr is a variant of a divaNr (saves with favorites) divaNr looks like: "Diva-123456_0001". Here we got do build the querystring differently
742
+ //this is only used for testing logic to stiff match the query hash so moched calls are used
750
743
  var qs;
751
744
  if (divaNr.includes('_') && divaNr.substring(divaNr.indexOf('_') + 1).length == 4) {
752
745
  var splittedDivaNr = divaNr.split('_');
@@ -759,50 +752,50 @@ var DivaApiHandler = /*#__PURE__*/function () {
759
752
  }, {
760
753
  key: "getViewConfig",
761
754
  value: function getViewConfig() {
762
- var _this$divaWebConfigDa26;
763
- return (_this$divaWebConfigDa26 = this.divaWebConfigData) === null || _this$divaWebConfigDa26 === void 0 ? void 0 : _this$divaWebConfigDa26.viewConfig;
755
+ var _this$divaWebConfigDa25;
756
+ return (_this$divaWebConfigDa25 = this.divaWebConfigData) === null || _this$divaWebConfigDa25 === void 0 ? void 0 : _this$divaWebConfigDa25.viewConfig;
764
757
  }
765
758
  }, {
766
759
  key: "getEmailConfig",
767
760
  value: function getEmailConfig() {
768
- var _this$divaWebConfigDa27;
769
- return (_this$divaWebConfigDa27 = this.divaWebConfigData) === null || _this$divaWebConfigDa27 === void 0 ? void 0 : _this$divaWebConfigDa27.emailConfig;
761
+ var _this$divaWebConfigDa26;
762
+ return (_this$divaWebConfigDa26 = this.divaWebConfigData) === null || _this$divaWebConfigDa26 === void 0 ? void 0 : _this$divaWebConfigDa26.emailConfig;
770
763
  }
771
764
  }, {
772
765
  key: "getABTestCases",
773
766
  value: function getABTestCases() {
774
- var _this$divaWebConfigDa28, _this$divaWebConfigDa29;
775
- return (_this$divaWebConfigDa28 = (_this$divaWebConfigDa29 = this.divaWebConfigData) === null || _this$divaWebConfigDa29 === void 0 ? void 0 : _this$divaWebConfigDa29.abTestCases) !== null && _this$divaWebConfigDa28 !== void 0 ? _this$divaWebConfigDa28 : [];
767
+ var _this$divaWebConfigDa27, _this$divaWebConfigDa28;
768
+ return (_this$divaWebConfigDa27 = (_this$divaWebConfigDa28 = this.divaWebConfigData) === null || _this$divaWebConfigDa28 === void 0 ? void 0 : _this$divaWebConfigDa28.abTestCases) !== null && _this$divaWebConfigDa27 !== void 0 ? _this$divaWebConfigDa27 : [];
776
769
  }
777
770
  }, {
778
771
  key: "getBarrierConfig",
779
772
  value: function getBarrierConfig() {
780
- var _this$divaWebConfigDa30;
781
- return (_this$divaWebConfigDa30 = this.divaWebConfigData) === null || _this$divaWebConfigDa30 === void 0 ? void 0 : _this$divaWebConfigDa30.barrierConfig;
773
+ var _this$divaWebConfigDa29;
774
+ return (_this$divaWebConfigDa29 = this.divaWebConfigData) === null || _this$divaWebConfigDa29 === void 0 ? void 0 : _this$divaWebConfigDa29.barrierConfig;
782
775
  }
783
776
  }, {
784
777
  key: "getTemplateConfig",
785
778
  value: function getTemplateConfig() {
786
- var _this$divaWebConfigDa31;
787
- return (_this$divaWebConfigDa31 = this.divaWebConfigData) === null || _this$divaWebConfigDa31 === void 0 ? void 0 : _this$divaWebConfigDa31.templateConfig;
779
+ var _this$divaWebConfigDa30;
780
+ return (_this$divaWebConfigDa30 = this.divaWebConfigData) === null || _this$divaWebConfigDa30 === void 0 ? void 0 : _this$divaWebConfigDa30.templateConfig;
788
781
  }
789
782
  }, {
790
783
  key: "showDivaNr",
791
784
  value: function showDivaNr() {
792
- var _this$divaWebConfigDa32;
793
- return (_this$divaWebConfigDa32 = this.divaWebConfigData) === null || _this$divaWebConfigDa32 === void 0 ? void 0 : _this$divaWebConfigDa32.showDivaNr;
785
+ var _this$divaWebConfigDa31;
786
+ return (_this$divaWebConfigDa31 = this.divaWebConfigData) === null || _this$divaWebConfigDa31 === void 0 ? void 0 : _this$divaWebConfigDa31.showDivaNr;
794
787
  }
795
788
  }, {
796
789
  key: "onErrorHandling",
797
790
  value: function onErrorHandling() {
798
- var _this$divaWebConfigDa33;
799
- return (_this$divaWebConfigDa33 = this.divaWebConfigData) === null || _this$divaWebConfigDa33 === void 0 ? void 0 : _this$divaWebConfigDa33.onErrorHandling;
791
+ var _this$divaWebConfigDa32;
792
+ return (_this$divaWebConfigDa32 = this.divaWebConfigData) === null || _this$divaWebConfigDa32 === void 0 ? void 0 : _this$divaWebConfigDa32.onErrorHandling;
800
793
  }
801
794
  }, {
802
795
  key: "diva3DRenderingDefault",
803
796
  value: function diva3DRenderingDefault() {
804
- var _this$divaWebConfigDa34;
805
- return (_this$divaWebConfigDa34 = this.divaWebConfigData) === null || _this$divaWebConfigDa34 === void 0 ? void 0 : _this$divaWebConfigDa34.diva3DRenderingDefault;
797
+ var _this$divaWebConfigDa33;
798
+ return (_this$divaWebConfigDa33 = this.divaWebConfigData) === null || _this$divaWebConfigDa33 === void 0 ? void 0 : _this$divaWebConfigDa33.diva3DRenderingDefault;
806
799
  }
807
800
  }, {
808
801
  key: "getJwt",
@@ -817,8 +810,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
817
810
  }, {
818
811
  key: "getUseMask",
819
812
  value: function getUseMask() {
820
- var _this$divaWebConfigDa35;
821
- return (_this$divaWebConfigDa35 = this.divaWebConfigData) === null || _this$divaWebConfigDa35 === void 0 ? void 0 : _this$divaWebConfigDa35.useMask;
813
+ var _this$divaWebConfigDa34;
814
+ return (_this$divaWebConfigDa34 = this.divaWebConfigData) === null || _this$divaWebConfigDa34 === void 0 ? void 0 : _this$divaWebConfigDa34.useMask;
822
815
  }
823
816
  }, {
824
817
  key: "apiUrl",
@@ -878,22 +871,10 @@ var DivaApiHandler = /*#__PURE__*/function () {
878
871
  }, {
879
872
  key: "getBasketDataUrl",
880
873
  value: function getBasketDataUrl(divaNr) {
881
- //if divaNr is a variant of a divaNr (saves with favorites) divaNr looks like: "Diva-123456_0001". Here we got do build the querystring differently
882
- if (divaNr.includes('_') && divaNr.substring(divaNr.indexOf('_') + 1).length == 4) {
883
- var _divaNr$split = divaNr.split('_'),
884
- _divaNr$split2 = _slicedToArray(_divaNr$split, 2),
885
- DivaNrAndDoc = _divaNr$split2[0],
886
- variantId = _divaNr$split2[1];
887
- var _DivaNrAndDoc$split = DivaNrAndDoc.split('-'),
888
- _DivaNrAndDoc$split2 = _slicedToArray(_DivaNrAndDoc$split, 3),
889
- _onlyDivaNr = _DivaNrAndDoc$split2[1],
890
- _version = _DivaNrAndDoc$split2[2];
891
- return '/baskets/configuration?divaNr=' + 'DIVA-' + _onlyDivaNr + (_version ? '&version=' + _version : '') + '&variantId=' + Number(variantId) + '&dontRepairBasket=true';
892
- }
893
- var _divaNr$split3 = divaNr.split('-'),
894
- _divaNr$split4 = _slicedToArray(_divaNr$split3, 3),
895
- onlyDivaNr = _divaNr$split4[1],
896
- version = _divaNr$split4[2];
874
+ var _divaNr$split = divaNr.split('-'),
875
+ _divaNr$split2 = _slicedToArray(_divaNr$split, 3),
876
+ onlyDivaNr = _divaNr$split2[1],
877
+ version = _divaNr$split2[2];
897
878
  return '/baskets/configuration?divaNr=' + 'DIVA-' + onlyDivaNr + (version ? '&version=' + version : '') + '&dontRepairBasket=true';
898
879
  }
899
880
  }, {
@@ -1023,9 +1004,9 @@ var DivaApiHandler = /*#__PURE__*/function () {
1023
1004
  return '/baskets/uniqueDivaNr';
1024
1005
  }
1025
1006
  }, {
1026
- key: "fillBasketEkText",
1027
- value: function fillBasketEkText() {
1028
- return '/baskets/fillektext';
1007
+ key: "checkMatchingProducts",
1008
+ value: function checkMatchingProducts() {
1009
+ return '/v1/products/matching';
1029
1010
  }
1030
1011
  }, {
1031
1012
  key: "getAccountList",
@@ -1350,14 +1331,14 @@ var DivaApiHandler = /*#__PURE__*/function () {
1350
1331
  }, {
1351
1332
  key: "dontLoadAdditionalModelInfos",
1352
1333
  get: function get() {
1353
- var _this$divaWebConfigDa36;
1354
- return (_this$divaWebConfigDa36 = this.divaWebConfigData) === null || _this$divaWebConfigDa36 === void 0 ? void 0 : _this$divaWebConfigDa36.dontLoadAdditionalModelInfos;
1334
+ var _this$divaWebConfigDa35;
1335
+ return (_this$divaWebConfigDa35 = this.divaWebConfigData) === null || _this$divaWebConfigDa35 === void 0 ? void 0 : _this$divaWebConfigDa35.dontLoadAdditionalModelInfos;
1355
1336
  }
1356
1337
  }, {
1357
1338
  key: "dontLoadCatalogEditorLiteMask",
1358
1339
  get: function get() {
1359
- var _this$divaWebConfigDa37;
1360
- return (_this$divaWebConfigDa37 = this.divaWebConfigData) === null || _this$divaWebConfigDa37 === void 0 ? void 0 : _this$divaWebConfigDa37.dontLoadCatalogEditorLiteMask;
1340
+ var _this$divaWebConfigDa36;
1341
+ return (_this$divaWebConfigDa36 = this.divaWebConfigData) === null || _this$divaWebConfigDa36 === void 0 ? void 0 : _this$divaWebConfigDa36.dontLoadCatalogEditorLiteMask;
1361
1342
  }
1362
1343
  }, {
1363
1344
  key: "OrganizationId",
@@ -18510,6 +18491,8 @@ var DivaCatalogData = /*#__PURE__*/function () {
18510
18491
  //Warnings
18511
18492
  else if (item.Codex == 'HIDECONSTRUCTIONWARNING') {
18512
18493
  _this.catalogData.doCheckConstructionWarnings = item.Value == '0';
18494
+ } else if (item.Codex == 'FORCECONSTRUCTIONWARNINGARTICLES') {
18495
+ _this.catalogData.forceConstructionWarningForArticles = item.Value.split(';');
18513
18496
  } else if (item.Codex == 'HIDECOMPLETENESSWARNING') {
18514
18497
  _this.catalogData.hideCompletenessWarning = item.Value == '1';
18515
18498
  }
@@ -19330,6 +19313,11 @@ var DivaCatalogData = /*#__PURE__*/function () {
19330
19313
  get: function get() {
19331
19314
  return this.catalogData.doCheckConstructionWarnings;
19332
19315
  }
19316
+ }, {
19317
+ key: "forceConstructionWarningForArticles",
19318
+ get: function get() {
19319
+ return this.catalogData.forceConstructionWarningForArticles;
19320
+ }
19333
19321
  }, {
19334
19322
  key: "doHideCompletenessWarning",
19335
19323
  get: function get() {
@@ -20474,7 +20462,7 @@ var DivaArticle = /*#__PURE__*/function () {
20474
20462
  ruleDesc_locales: initParams.RuleDesc_locales,
20475
20463
  toDeleteAfterInit: false,
20476
20464
  doUpdatePlannerSize: false,
20477
- shelfPlanData: initParams.ShelfPlanData ? DivaUtils.DecodeBasketJson(initParams.ShelfPlanData) : undefined,
20465
+ shelfPlanData: initParams.ShelfPlandata ? DivaUtils.DecodeBasketJson(initParams.ShelfPlandata) : undefined,
20478
20466
  typeNr: articleData.typeNr,
20479
20467
  initDecisions: initParams.initDecisions,
20480
20468
  previousPartlistArticles: initParams.PreviousPartlistArticles,
@@ -21791,6 +21779,18 @@ var DivaArticle = /*#__PURE__*/function () {
21791
21779
  get: function get() {
21792
21780
  return md5(this.CatalogData.catalogGuid + '_' + this.articleCodex + '_' + JSON.stringify(this.VariantValuesWithoutOPTandOPV).replace(/"/g, '@'));
21793
21781
  }
21782
+ }, {
21783
+ key: "articleProductHash",
21784
+ get: function get() {
21785
+ var hash = this.catalogCodex + '_' + this.articleCodex + '_' + this.quantity + '_';
21786
+ for (var key in this.articleOptionStates) {
21787
+ var myArtOption = this.articleOptionStates[key];
21788
+ if (myArtOption.isDoShow && (!(myArtOption.idmVariantenArt == 95 || myArtOption.idmVariantenArt == 96 || myArtOption.idmVariantenArt == 97) || myArtOption.isVisibleFreeText) && myArtOption.val && myArtOption.visibleCount > 0 && !myArtOption.isDescribingState) {
21789
+ hash = hash + myArtOption.optionCodex.substring(3) + '_' + myArtOption.val.codex.substring(3) + (myArtOption.measureUnit && myArtOption.freeText !== undefined ? '_' + myArtOption.freeText : '') + (!myArtOption.measureUnit && myArtOption.isFreeText ? '_' + myArtOption.isFreeText : '');
21790
+ }
21791
+ }
21792
+ return md5(hash);
21793
+ }
21794
21794
  }, {
21795
21795
  key: "VariantValuesWithoutOPTandOPV",
21796
21796
  get: function get() {
@@ -22863,6 +22863,8 @@ var DivaArticle = /*#__PURE__*/function () {
22863
22863
  optionImgForPrint: optionImgForPrint,
22864
22864
  optionsForPrint: optionsForPrint
22865
22865
  });
22866
+ } else {
22867
+ LOG$c.debug('not loading partlistarticle: ' + articleCodex + ' cause quantity is zero');
22866
22868
  }
22867
22869
  }
22868
22870
  return partlistArticlesToLoad;
@@ -23559,7 +23561,7 @@ var DivaArticle = /*#__PURE__*/function () {
23559
23561
  break;
23560
23562
  }
23561
23563
  _context.next = 4;
23562
- return import('./ShelfPlanner-569fe7f0.js');
23564
+ return import('./ShelfPlanner-31b3a870.js');
23563
23565
  case 4:
23564
23566
  _yield$import = _context.sent;
23565
23567
  ShelfPlanner = _yield$import["default"];
@@ -24331,12 +24333,12 @@ var DivaArticle = /*#__PURE__*/function () {
24331
24333
  }
24332
24334
  var myOptItem = {
24333
24335
  BasketID: this.basketId,
24334
- OPTCodex: OP.substring(3),
24336
+ OPT: OP.substring(3),
24335
24337
  OPTName: myArtOption.optionOrigName,
24336
24338
  OPTName_locales: myArtOption.optionName_locales,
24337
24339
  OptionOCD: myArtOption.optionOcd,
24338
24340
  OCD: myArtOption.ocd,
24339
- OPVCodex: myArtOption.val.codex.substring(3),
24341
+ OPV: myArtOption.val.codex.substring(3),
24340
24342
  vOPV: !this.CatalogData.dontUseVCodexInBasket ? myArtOption.vCodex : undefined,
24341
24343
  OPVName: DivaUtils.stripTags(myArtOption.name),
24342
24344
  OPVName_locales: DivaUtils.stripTagsFromDict((_myArtOption$valName_ = myArtOption.valName_locales) !== null && _myArtOption$valName_ !== void 0 ? _myArtOption$valName_ : {}),
@@ -24372,7 +24374,7 @@ var DivaArticle = /*#__PURE__*/function () {
24372
24374
  }
24373
24375
  }, {
24374
24376
  key: "getConfigPriceData",
24375
- value: function getConfigPriceData(VariantBasketData) {
24377
+ value: function getConfigPriceData(VariantBasketDatas) {
24376
24378
  var myPriceData = new JsonConfigPriceData();
24377
24379
  myPriceData.BasePrices = [];
24378
24380
  if (this.price != 0) {
@@ -24398,12 +24400,12 @@ var DivaArticle = /*#__PURE__*/function () {
24398
24400
  } else {
24399
24401
  if (checkPrice.IsPercentage) {
24400
24402
  //Check if variantBasketdata is set as addPercentage
24401
- //TODO klären mit Franz - ist das schon der richtige Ort? In dem Fall wird VariantBasketData nicht als AddPercentage gekennzeichnet und im Checkout 1 wird CHF stattt % angezeigt.
24402
- for (var _i10 = 0; _i10 < VariantBasketData.length; _i10++) {
24403
+ //TODO klären mit Franz - ist das schon der richtige Ort? In dem Fall wird VariantBasketDatas nicht als AddPercentage gekennzeichnet und im Checkout 1 wird CHF stattt % angezeigt.
24404
+ for (var _i10 = 0; _i10 < VariantBasketDatas.length; _i10++) {
24403
24405
  var priceOPT = checkPrice.OPT.startsWith('OPT') ? checkPrice.OPT.substring(3) : checkPrice;
24404
- if (VariantBasketData[_i10].OPT == priceOPT) {
24406
+ if (VariantBasketDatas[_i10].OPT == priceOPT) {
24405
24407
  if (!isNaN(checkPrice.Price)) {
24406
- VariantBasketData[_i10].AddPercentage = checkPrice.Price * 100;
24408
+ VariantBasketDatas[_i10].AddPercentage = checkPrice.Price * 100;
24407
24409
  }
24408
24410
  }
24409
24411
  }
@@ -24419,18 +24421,18 @@ var DivaArticle = /*#__PURE__*/function () {
24419
24421
  var maxPrice = 0,
24420
24422
  maxPriceOPT = '';
24421
24423
  if (!myPriceData.BasePrice && !this.CatalogData.ignoreMaxPriceAsBP) {
24422
- for (var _i11 = 0; _i11 < VariantBasketData.length; _i11++) {
24423
- var variant = VariantBasketData[_i11];
24424
+ for (var _i11 = 0; _i11 < VariantBasketDatas.length; _i11++) {
24425
+ var variant = VariantBasketDatas[_i11];
24424
24426
  if (variant.AddPrice && (!variant.AddPrice || variant.AddPrice > maxPrice)) {
24425
24427
  maxPrice = variant.AddPrice;
24426
24428
  maxPriceOPT = variant.OPT;
24427
24429
  }
24428
24430
  }
24429
24431
  }
24430
- for (var _i12 = 0; _i12 < VariantBasketData.length; _i12++) {
24432
+ for (var _i12 = 0; _i12 < VariantBasketDatas.length; _i12++) {
24431
24433
  //WCTODO Prio 2 bei Maßauswahl
24432
24434
  var CalcPrice = void 0,
24433
- _variant = VariantBasketData[_i12],
24435
+ _variant = VariantBasketDatas[_i12],
24434
24436
  isPercentage = false;
24435
24437
  if (_variant.AddPercentage) {
24436
24438
  isPercentage = true;
@@ -25045,7 +25047,7 @@ var DivaArticleHandler = /*#__PURE__*/function () {
25045
25047
  }
25046
25048
  }
25047
25049
  }
25048
- if (value == undefined) {
25050
+ if (value == undefined && myArtOPS.isFreeText && !variantValues[_key + '_val']) {
25049
25051
  val = myArtOPS.option.freetextDefaultValue;
25050
25052
  if (val) {
25051
25053
  value = val;
@@ -26920,7 +26922,9 @@ var DivaSet = /*#__PURE__*/function () {
26920
26922
  _defineProperty(this, "_supplierColors", void 0);
26921
26923
  /**Favorits state */
26922
26924
  _defineProperty(this, "_handlelingCurrentFavorites", false);
26923
- _defineProperty(this, "_favorites", void 0);
26925
+ _defineProperty(this, "_favorites", {
26926
+ VariantValues: {}
26927
+ });
26924
26928
  //disabledVariants holds the state for explicitly variants that the user did not like so they got unselected in der summary
26925
26929
  _defineProperty(this, "_disabledVariants", []);
26926
26930
  //for viewSummarylist to not always calc all the different valid variants we cache them and reset them when favoritesselection is changes
@@ -28089,7 +28093,7 @@ var DivaSet = /*#__PURE__*/function () {
28089
28093
  break;
28090
28094
  }
28091
28095
  _context4.next = 3;
28092
- return import('./DoorPlanner-f4b338c4.js');
28096
+ return import('./DoorPlanner-a283b46f.js');
28093
28097
  case 3:
28094
28098
  _yield$import = _context4.sent;
28095
28099
  DoorPlanner = _yield$import["default"];
@@ -28133,8 +28137,6 @@ var DivaSet = /*#__PURE__*/function () {
28133
28137
  set: function set(favorites) {
28134
28138
  this._favorites = favorites;
28135
28139
  }
28136
-
28137
- //private disabledVariants: number[] = [];
28138
28140
  }, {
28139
28141
  key: "disabledVariants",
28140
28142
  get: function get() {
@@ -28143,7 +28145,6 @@ var DivaSet = /*#__PURE__*/function () {
28143
28145
  set: function set(val) {
28144
28146
  this._disabledVariants = val;
28145
28147
  }
28146
- //private allVariantsCache FavoritesVariants[]
28147
28148
  }, {
28148
28149
  key: "allVariantsCache",
28149
28150
  get: function get() {
@@ -28266,558 +28267,6 @@ var DivaSet = /*#__PURE__*/function () {
28266
28267
  }]);
28267
28268
  }();
28268
28269
 
28269
- //Diese Klasse verwaltet Productlogiken
28270
- var Product = /*#__PURE__*/function () {
28271
- function Product(id, divaNr, articles, price, image, shortDescription, childProducts, dockingPointInfos, affiliate, retailerArticleNr, minQuantity, increments) {
28272
- _classCallCheck(this, Product);
28273
- _defineProperty(this, "id", void 0);
28274
- _defineProperty(this, "productPrice", void 0);
28275
- _defineProperty(this, "_divaNr", void 0);
28276
- _defineProperty(this, "shortDescriptionData", void 0);
28277
- _defineProperty(this, "imageData", void 0);
28278
- _defineProperty(this, "articles", void 0);
28279
- _defineProperty(this, "families", []);
28280
- _defineProperty(this, "childProductsData", void 0);
28281
- _defineProperty(this, "childProductsGroupedData", void 0);
28282
- _defineProperty(this, "dockingPointInfos", void 0);
28283
- _defineProperty(this, "_affiliate", void 0);
28284
- _defineProperty(this, "_retailerArticleNr", void 0);
28285
- _defineProperty(this, "_minQuantity", void 0);
28286
- _defineProperty(this, "_increments", void 0);
28287
- _defineProperty(this, "_curTargetArticles", void 0);
28288
- this.id = id;
28289
- this._divaNr = divaNr;
28290
- this.articles = articles;
28291
- this.productPrice = price;
28292
- this.childProductsData = childProducts;
28293
- this.shortDescriptionData = shortDescription;
28294
- this.imageData = image;
28295
- this.dockingPointInfos = dockingPointInfos;
28296
- this._affiliate = affiliate;
28297
- this._retailerArticleNr = retailerArticleNr;
28298
- this._minQuantity = minQuantity === 1 ? undefined : minQuantity;
28299
- this._increments = increments === 1 ? undefined : increments;
28300
- this._curTargetArticles = [];
28301
- if (this.childProductsData) {
28302
- this.childProductsGroupedData = {};
28303
- for (var i = 0; i < this.childProductsData.length; i++) {
28304
- if (!this.childProductsGroupedData[this.childProductsData[i]]) this.childProductsGroupedData[this.childProductsData[i]] = 0;
28305
- this.childProductsGroupedData[this.childProductsData[i]]++;
28306
- }
28307
- }
28308
- }
28309
- return _createClass(Product, [{
28310
- key: "initFamilies",
28311
- value: function initFamilies(families) {
28312
- for (var i = 0; i < families.length; i++) {
28313
- var _families$i$childProd;
28314
- if ((_families$i$childProd = families[i].childProducts) !== null && _families$i$childProd !== void 0 && _families$i$childProd.includes(this.id)) this.families.push();
28315
- }
28316
- this.families = families;
28317
- }
28318
- }, {
28319
- key: "price",
28320
- get: function get() {
28321
- return this.productPrice;
28322
- }
28323
- }, {
28324
- key: "productId",
28325
- get: function get() {
28326
- return this.id;
28327
- }
28328
- }, {
28329
- key: "divaNr",
28330
- get: function get() {
28331
- return this._divaNr;
28332
- }
28333
- }, {
28334
- key: "isFamily",
28335
- get: function get() {
28336
- return this.childProducts !== undefined;
28337
- }
28338
- }, {
28339
- key: "variantValues",
28340
- get: function get() {
28341
- return this.articles[0].variantValues;
28342
- }
28343
- }, {
28344
- key: "childProducts",
28345
- get: function get() {
28346
- return this.childProductsData;
28347
- }
28348
- }, {
28349
- key: "childProductsGrouped",
28350
- get: function get() {
28351
- return this.childProductsGroupedData;
28352
- }
28353
- }, {
28354
- key: "shortDescription",
28355
- get: function get() {
28356
- return this.shortDescriptionData;
28357
- }
28358
- }, {
28359
- key: "image",
28360
- get: function get() {
28361
- return this.imageData;
28362
- }
28363
- }, {
28364
- key: "affiliate",
28365
- get: function get() {
28366
- return this._affiliate;
28367
- }
28368
- }, {
28369
- key: "retailerArticleNr",
28370
- get: function get() {
28371
- return this._retailerArticleNr;
28372
- }
28373
- }, {
28374
- key: "increments",
28375
- get: function get() {
28376
- // return 2;
28377
- return this._increments;
28378
- }
28379
- }, {
28380
- key: "minQuantity",
28381
- get: function get() {
28382
- // return 3;
28383
- return this._minQuantity;
28384
- }
28385
- }, {
28386
- key: "curTargetArticles",
28387
- get: function get() {
28388
- return this._curTargetArticles;
28389
- },
28390
- set: function set(targentArticles) {
28391
- this._curTargetArticles = targentArticles;
28392
- }
28393
- }, {
28394
- key: "DockingPointInfos",
28395
- get: function get() {
28396
- return this.dockingPointInfos;
28397
- }
28398
- }, {
28399
- key: "CatalogCodexes",
28400
- get: function get() {
28401
- var catalogCodexes = [];
28402
- for (var i = 0; i < this.articles.length; i++) {
28403
- catalogCodexes.push(this.articles[i].catalogCodex);
28404
- }
28405
- return catalogCodexes;
28406
- }
28407
- }, {
28408
- key: "findOPVCodexInVariantValues",
28409
- value: function findOPVCodexInVariantValues(opt, opv) {
28410
- return this.articles.find(function (article) {
28411
- return article.variantValues.find(function (variant) {
28412
- return variant.OPT === opt && variant.OPV === opv;
28413
- });
28414
- });
28415
- }
28416
- }]);
28417
- }();
28418
-
28419
- var DivaProductHandler = /*#__PURE__*/function () {
28420
- function DivaProductHandler() {
28421
- _classCallCheck(this, DivaProductHandler);
28422
- _defineProperty(this, "singleProducts", {});
28423
- _defineProperty(this, "familyProducts", {});
28424
- _defineProperty(this, "singleProductsGrouped", {});
28425
- // key is CatalogCodex and ArticleCodex
28426
- //the number is the qunaitity of the current loaded product
28427
- _defineProperty(this, "currentFamilies", {});
28428
- _defineProperty(this, "currentSingleProducts", {});
28429
- }
28430
- return _createClass(DivaProductHandler, [{
28431
- key: "addProducts",
28432
- value: function addProducts(variants, families) {
28433
- var newProducts = [];
28434
- var newFamilies = [];
28435
- for (var i = 0; i < variants.length; i++) {
28436
- var _variant$discountedPr;
28437
- var article = variants[i].articles[0];
28438
- var variant = variants[i];
28439
- var codex = article.catalogCodex + '_' + article.articleCodex;
28440
- if (!this.singleProductsGrouped[codex]) this.singleProductsGrouped[codex] = {};
28441
- this.singleProductsGrouped[codex][variants[i]._id] = new Product(variant._id, variant.divaNr, variant.articles, (_variant$discountedPr = variant.discountedPrice) !== null && _variant$discountedPr !== void 0 ? _variant$discountedPr : variant.addedPrice, variant.image, variant.shortDescription, undefined, variant.dockingPointInfos, variant.affiliate, variant.retailerArticleNr, variant.minQuantity, variant.increments);
28442
- this.singleProducts[variant._id] = this.singleProductsGrouped[codex][variant._id];
28443
- newProducts.push(this.singleProductsGrouped[codex][variant._id]);
28444
- }
28445
- if (families !== null && families !== void 0 && families.length) for (var _i = 0; _i < families.length; _i++) {
28446
- var _family$discountedPri;
28447
- var family = families[_i];
28448
- this.familyProducts[family._id] = new Product(family._id, family.divaNr, family.articles, (_family$discountedPri = family.discountedPrice) !== null && _family$discountedPri !== void 0 ? _family$discountedPri : family.addedPrice, family.image, family.shortDescription, family.childProducts, family.dockingPointInfos, family.affiliate, family.retailerArticleNr, family.minQuantity, family.increments);
28449
- newFamilies.push(this.familyProducts[family._id]);
28450
- }
28451
- for (var _i2 = 0; _i2 < newProducts.length; _i2++) {
28452
- newProducts[_i2].initFamilies(newFamilies);
28453
- }
28454
- }
28455
- }, {
28456
- key: "loadProductsOfSets",
28457
- value: function () {
28458
- var _loadProductsOfSets = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(orderSets, involvedSetIds) {
28459
- return _regeneratorRuntime.wrap(function _callee$(_context) {
28460
- while (1) switch (_context.prev = _context.next) {
28461
- case 0:
28462
- case "end":
28463
- return _context.stop();
28464
- }
28465
- }, _callee);
28466
- }));
28467
- function loadProductsOfSets(_x, _x2) {
28468
- return _loadProductsOfSets.apply(this, arguments);
28469
- }
28470
- return loadProductsOfSets;
28471
- }()
28472
- }, {
28473
- key: "updateProducts",
28474
- value: function () {
28475
- var _updateProducts = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(set, from, productId) {
28476
- return _regeneratorRuntime.wrap(function _callee2$(_context2) {
28477
- while (1) switch (_context2.prev = _context2.next) {
28478
- case 0:
28479
- case "end":
28480
- return _context2.stop();
28481
- }
28482
- }, _callee2);
28483
- }));
28484
- function updateProducts(_x3, _x4, _x5) {
28485
- return _updateProducts.apply(this, arguments);
28486
- }
28487
- return updateProducts;
28488
- }()
28489
- }, {
28490
- key: "updateArticleProducts",
28491
- value: function updateArticleProducts(set) {
28492
- var articles = set.getDivaArticles();
28493
- var targetArticles = Object.keys(articles);
28494
- for (var i = 0; i < targetArticles.length; i++) {
28495
- var article = articles[targetArticles[i]];
28496
- var productVariants = this.singleProductsGrouped[article.catalogCodex + '_' + article.articleCodex];
28497
- for (var key in productVariants) {
28498
- var product = productVariants[key];
28499
- product.curTargetArticles = [];
28500
- }
28501
- }
28502
- for (var _i3 = 0; _i3 < targetArticles.length; _i3++) {
28503
- var _article = articles[targetArticles[_i3]];
28504
- if (!_article) continue;
28505
- var _productVariants = this.singleProductsGrouped[_article.catalogCodex + '_' + _article.articleCodex];
28506
- var newProduct = undefined;
28507
- var _loop = function _loop() {
28508
- var product = _productVariants[_key];
28509
- var productVariantValues = _article.VariantValuesWithoutOPTandOPVInObject;
28510
- var notFound = false;
28511
- var _loop2 = function _loop2(j) {
28512
- if (!productVariantValues.find(function (item) {
28513
- return item.OPT == product.variantValues[j].OPT && item.OPV == product.variantValues[j].OPV;
28514
- })) {
28515
- //only notFound set to true when the opt in general does exist in the productVariants only the value of it is different
28516
- if (productVariantValues.find(function (item) {
28517
- return item.OPT == product.variantValues[j].OPT;
28518
- })) {
28519
- notFound = true;
28520
- return 1; // break
28521
- }
28522
- }
28523
- };
28524
- for (var j = 0; j < product.variantValues.length; j++) {
28525
- if (_loop2(j)) break;
28526
- }
28527
- if (!notFound) {
28528
- newProduct = product;
28529
- newProduct.curTargetArticles.push(_article.basketId);
28530
- return 1; // break
28531
- }
28532
- };
28533
- for (var _key in _productVariants) {
28534
- if (_loop()) break;
28535
- }
28536
- _article.curProduct = newProduct;
28537
- }
28538
- }
28539
- }, {
28540
- key: "updateFamilyProducts",
28541
- value: function updateFamilyProducts() {
28542
- this.currentFamilies = {};
28543
- var familiesToCheck = this.getFamiliesToCheck();
28544
- var biggestFamily;
28545
- do {
28546
- biggestFamily = this.findBiggestFamily(familiesToCheck);
28547
- if (biggestFamily) {
28548
- if (!this.currentFamilies[biggestFamily.productId]) this.currentFamilies[biggestFamily.productId] = 0;
28549
- this.currentFamilies[biggestFamily.productId]++;
28550
- }
28551
- } while (biggestFamily);
28552
- }
28553
- }, {
28554
- key: "getFamiliesToCheck",
28555
- value: function getFamiliesToCheck() {
28556
- var familiesToCheck = {};
28557
- for (var key in this.familyProducts) {
28558
- var familiy = this.familyProducts[key];
28559
- if (!familiy.childProducts) continue;
28560
- for (var i = 0; i < familiy.childProducts.length; i++) {
28561
- if (this.currentSingleProducts[familiy.childProducts[i]]) {
28562
- familiesToCheck[familiy.productId] = familiy;
28563
- break;
28564
- }
28565
- }
28566
- }
28567
- return familiesToCheck;
28568
- }
28569
- }, {
28570
- key: "findBiggestFamily",
28571
- value: function findBiggestFamily(familiesToCheck) {
28572
- var matchingFamilies = [];
28573
- var biggestFamily = false;
28574
- for (var iKey in familiesToCheck) {
28575
- var family = familiesToCheck[iKey];
28576
- var notFit = false;
28577
- for (var jKey in family.childProductsGrouped) {
28578
- //if product does not currently exist or the quantity is to small
28579
- if (!this.currentSingleProducts[jKey] || this.currentSingleProducts[jKey] < family.childProductsGrouped[jKey]) {
28580
- notFit = true;
28581
- break;
28582
- }
28583
- }
28584
- if (!notFit) matchingFamilies.push(family);
28585
- }
28586
-
28587
- //from all the matching families find the bigges one
28588
- for (var i = 0; i < matchingFamilies.length; i++) {
28589
- if (!biggestFamily || biggestFamily.childProducts.length > matchingFamilies[i].childProducts.length) {
28590
- biggestFamily = matchingFamilies[i];
28591
- }
28592
- }
28593
- if (biggestFamily) {
28594
- //we found a final bigges familiy. Now subtract the familiy products quantity in the dictionary products for the next run
28595
- for (var key in biggestFamily.childProductsGrouped) {
28596
- biggestFamily.childProductsGrouped;
28597
- this.currentSingleProducts[key] = this.currentSingleProducts[key] - biggestFamily.childProductsGrouped[key];
28598
- }
28599
- }
28600
- return biggestFamily;
28601
- }
28602
- }, {
28603
- key: "checkQuantitySteps",
28604
- value: function () {
28605
- var _checkQuantitySteps = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(set, from, productId) {
28606
- var articles, somethingChanged, key, product, currentQuantity, deltaQuantity, whatToDo, article;
28607
- return _regeneratorRuntime.wrap(function _callee3$(_context3) {
28608
- while (1) switch (_context3.prev = _context3.next) {
28609
- case 0:
28610
- articles = set.getDivaArticles();
28611
- somethingChanged = false;
28612
- _context3.t0 = _regeneratorRuntime.keys(this.currentSingleProducts);
28613
- case 3:
28614
- if ((_context3.t1 = _context3.t0()).done) {
28615
- _context3.next = 38;
28616
- break;
28617
- }
28618
- key = _context3.t1.value;
28619
- product = this.singleProducts[key];
28620
- currentQuantity = this.currentSingleProducts[key];
28621
- deltaQuantity = 0;
28622
- whatToDo = undefined;
28623
- if (product.minQuantity !== undefined) {
28624
- if (product.minQuantity > currentQuantity || product.increments !== undefined && product.increments > currentQuantity) {
28625
- if (from == 'onDelete') {
28626
- whatToDo = 'deleteArticle';
28627
- deltaQuantity = currentQuantity;
28628
- } else {
28629
- whatToDo = 'increaseQunatity';
28630
- deltaQuantity = product.minQuantity - currentQuantity;
28631
- }
28632
- somethingChanged = 'byMinQuantity';
28633
- }
28634
- }
28635
- if (!(product.increments && whatToDo !== 'deleteArticle')) {
28636
- _context3.next = 22;
28637
- break;
28638
- }
28639
- case 11:
28640
- if (!((currentQuantity + deltaQuantity) % product.increments !== 0 || from == 'onDelete' && productId == key)) {
28641
- _context3.next = 22;
28642
- break;
28643
- }
28644
- deltaQuantity++;
28645
- somethingChanged = 'byImcrement';
28646
- if (!(whatToDo !== 'increaseQunatity')) {
28647
- _context3.next = 20;
28648
- break;
28649
- }
28650
- if (!((currentQuantity - deltaQuantity) % product.increments === 0 && from != 'onAdd')) {
28651
- _context3.next = 19;
28652
- break;
28653
- }
28654
- if (!(product.minQuantity === undefined || product.minQuantity <= currentQuantity - deltaQuantity || currentQuantity - deltaQuantity === 0)) {
28655
- _context3.next = 19;
28656
- break;
28657
- }
28658
- whatToDo = 'decreaseQunatity';
28659
- return _context3.abrupt("break", 22);
28660
- case 19:
28661
- if ((currentQuantity + deltaQuantity) % product.increments === 0 && from != 'onDelete') {
28662
- whatToDo = 'increaseQunatity';
28663
- }
28664
- case 20:
28665
- _context3.next = 11;
28666
- break;
28667
- case 22:
28668
- if (!(whatToDo !== undefined)) {
28669
- _context3.next = 36;
28670
- break;
28671
- }
28672
- case 23:
28673
- if (!(deltaQuantity !== 0)) {
28674
- _context3.next = 36;
28675
- break;
28676
- }
28677
- article = articles[product.curTargetArticles[0]]; //attention!! If an article has a quantity bigger than 1 this wont work!
28678
- if (!(whatToDo === 'increaseQunatity')) {
28679
- _context3.next = 30;
28680
- break;
28681
- }
28682
- _context3.next = 28;
28683
- return setHandlerInstance.addPlannerElement(set, article.articleCodex, {
28684
- variantValues: article.VariantValues
28685
- }, 'initializingProduct');
28686
- case 28:
28687
- _context3.next = 33;
28688
- break;
28689
- case 30:
28690
- _context3.next = 32;
28691
- return setHandlerInstance.deleteElementFromSet(set, article, false, undefined, true);
28692
- case 32:
28693
- product.curTargetArticles.splice(0, 1);
28694
- case 33:
28695
- deltaQuantity--;
28696
- _context3.next = 23;
28697
- break;
28698
- case 36:
28699
- _context3.next = 3;
28700
- break;
28701
- case 38:
28702
- return _context3.abrupt("return", somethingChanged);
28703
- case 39:
28704
- case "end":
28705
- return _context3.stop();
28706
- }
28707
- }, _callee3, this);
28708
- }));
28709
- function checkQuantitySteps(_x6, _x7, _x8) {
28710
- return _checkQuantitySteps.apply(this, arguments);
28711
- }
28712
- return checkQuantitySteps;
28713
- }()
28714
- /**
28715
- * this functions controlls if the list of configItems is available or not
28716
- * @param configItems
28717
- * @param variantsInfo
28718
- * @param articles
28719
- * @param targetArticles
28720
- * @returns
28721
- */
28722
- }, {
28723
- key: "checkProductInStock",
28724
- value: function checkProductInStock(configItems, variantsInfo, articles, targetArticles) {
28725
- var productsKey = articles[targetArticles[0]].catalogCodex + '_' + articles[targetArticles[0]].articleCodex;
28726
- var products = this.singleProductsGrouped[productsKey];
28727
- var indexesToDelete = [];
28728
- for (var i = 0; i < variantsInfo.length; i++) {
28729
- var variantInStock = false;
28730
- var variantInfo = variantsInfo[i];
28731
- for (var key in products) {
28732
- //***GUF***DEBUG HERE
28733
- var productVariantValues = products[key].variantValues;
28734
- var notFound = false;
28735
- var _loop3 = function _loop3() {
28736
- var variant = variantInfo.variants[j];
28737
- if (!productVariantValues.find(function (item) {
28738
- return variant.OPT === item.OPT && variant.OPV === item.OPV;
28739
- })) {
28740
- //only notFound set to true when the opt in general does exist in the productVariants only the value of it is different
28741
- if (productVariantValues.find(function (item) {
28742
- return variant.OPT === item.OPT;
28743
- })) {
28744
- notFound = true;
28745
- return 1; // break
28746
- }
28747
- }
28748
- };
28749
- for (var j = 0; j < variantInfo.variants.length; j++) {
28750
- if (_loop3()) break;
28751
- }
28752
- if (!notFound) {
28753
- variantInStock = true;
28754
- break;
28755
- }
28756
- }
28757
- if (!variantInStock) {
28758
- if (configItems[i]) {
28759
- indexesToDelete.push(i);
28760
- }
28761
- }
28762
- }
28763
- for (var _i4 = indexesToDelete.length - 1; _i4 >= 0; _i4--) {
28764
- configItems.splice(indexesToDelete[_i4], 1);
28765
- }
28766
- return configItems;
28767
- }
28768
- }, {
28769
- key: "getPrice",
28770
- value: function getPrice() {
28771
- var price = 0;
28772
- for (var key in this.currentSingleProducts) {
28773
- price += this.singleProducts[key].price * this.currentSingleProducts[key];
28774
- }
28775
- for (var _key2 in this.currentFamilies) {
28776
- price += this.singleProducts[_key2].price * this.currentFamilies[_key2];
28777
- }
28778
- return price;
28779
- }
28780
- }, {
28781
- key: "getCurrentProducts",
28782
- value: function getCurrentProducts() {
28783
- var products = this.currentSingleProducts;
28784
- for (var key in this.currentFamilies) {
28785
- products[key] = this.currentFamilies[key];
28786
- }
28787
- return products;
28788
- }
28789
- }, {
28790
- key: "getProductById",
28791
- value: function getProductById(productId) {
28792
- var product;
28793
- product = this.singleProducts[productId];
28794
- if (!product) this.familyProducts[productId];
28795
- return product;
28796
- }
28797
- }, {
28798
- key: "getBestMatch",
28799
- value: function getBestMatch(articles) {
28800
- var OPTION_CODEX = 'KOPFTEIL';
28801
- if (!articles) return;
28802
- for (var key in articles) {
28803
- var _article$VariantValue;
28804
- var article = articles[key];
28805
- var opv = (_article$VariantValue = article.VariantValues['OPT' + OPTION_CODEX]) === null || _article$VariantValue === void 0 ? void 0 : _article$VariantValue.replace('OPV', '');
28806
- var products = this.singleProductsGrouped[article.catalogCodex + '_' + article.articleCodex];
28807
- if (!products || !opv) continue;
28808
- for (var pId in products) {
28809
- var _products$pId$affilia;
28810
- if ((_products$pId$affilia = products[pId].affiliate) !== null && _products$pId$affilia !== void 0 && _products$pId$affilia.length) if (products[pId].findOPVCodexInVariantValues(OPTION_CODEX, opv)) {
28811
- return products[pId];
28812
- }
28813
- }
28814
- }
28815
- return undefined;
28816
- }
28817
- }]);
28818
- }();
28819
- var productHandlerInstance = new DivaProductHandler();
28820
-
28821
28270
  var SummaryHandler = /*#__PURE__*/function () {
28822
28271
  function SummaryHandler() {
28823
28272
  _classCallCheck(this, SummaryHandler);
@@ -29155,30 +28604,16 @@ var SummaryHandler = /*#__PURE__*/function () {
29155
28604
  }, {
29156
28605
  key: "getSummaryItems",
29157
28606
  value: function () {
29158
- var _getSummaryItems = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(sets, doConfigure, doAllowSetPlanner) {
28607
+ var _getSummaryItems = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(sets, doConfigure) {
29159
28608
  var ret, _key5, set, items, type;
29160
28609
  return _regeneratorRuntime.wrap(function _callee$(_context) {
29161
28610
  while (1) switch (_context.prev = _context.next) {
29162
28611
  case 0:
29163
28612
  ret = [];
29164
- if (!doAllowSetPlanner) {
29165
- _context.next = 5;
29166
- break;
29167
- }
29168
- ret = [{
29169
- items: this.getArticlesForSummary(sets),
29170
- type: 'SUMMARY_ARTICLES',
29171
- name: 'ARTICLELIST',
29172
- price: setHandlerInstance.getTotalPrice(sets),
29173
- quantity: 1
29174
- }];
29175
- _context.next = 29;
29176
- break;
29177
- case 5:
29178
28613
  _context.t0 = _regeneratorRuntime.keys(sets);
29179
- case 6:
28614
+ case 2:
29180
28615
  if ((_context.t1 = _context.t0()).done) {
29181
- _context.next = 29;
28616
+ _context.next = 25;
29182
28617
  break;
29183
28618
  }
29184
28619
  _key5 = _context.t1.value;
@@ -29186,9 +28621,9 @@ var SummaryHandler = /*#__PURE__*/function () {
29186
28621
  items = void 0;
29187
28622
  type = this.getSummaryType(set);
29188
28623
  _context.t2 = type;
29189
- _context.next = _context.t2 === 'SUMMARY_PARTLIST' ? 14 : _context.t2 === 'SUMMARY_OPTIONTREE' ? 17 : _context.t2 === 'VARIANTS' ? 19 : _context.t2 === 'PARTLIST_AND_SPECIALOPTIONS' ? 25 : 27;
28624
+ _context.next = _context.t2 === 'SUMMARY_PARTLIST' ? 10 : _context.t2 === 'SUMMARY_OPTIONTREE' ? 13 : _context.t2 === 'VARIANTS' ? 15 : _context.t2 === 'PARTLIST_AND_SPECIALOPTIONS' ? 21 : 23;
29190
28625
  break;
29191
- case 14:
28626
+ case 10:
29192
28627
  items = this.buildSummaryItemsOfPartlist(set);
29193
28628
  ret.push({
29194
28629
  items: items,
@@ -29197,33 +28632,33 @@ var SummaryHandler = /*#__PURE__*/function () {
29197
28632
  price: set.getSetPrice(),
29198
28633
  quantity: 1
29199
28634
  });
29200
- return _context.abrupt("break", 27);
29201
- case 17:
28635
+ return _context.abrupt("break", 23);
28636
+ case 13:
29202
28637
  ret = ret.concat(this.getOptionTreeSummary(set));
29203
- return _context.abrupt("break", 27);
29204
- case 19:
28638
+ return _context.abrupt("break", 23);
28639
+ case 15:
29205
28640
  _context.t3 = ret;
29206
- _context.next = 22;
28641
+ _context.next = 18;
29207
28642
  return this.getVariantsSummary(doConfigure, set);
29208
- case 22:
28643
+ case 18:
29209
28644
  _context.t4 = _context.sent;
29210
28645
  _context.t3.push.call(_context.t3, _context.t4);
29211
- return _context.abrupt("break", 27);
29212
- case 25:
28646
+ return _context.abrupt("break", 23);
28647
+ case 21:
29213
28648
  ret.push(this.buildSummaryItemsOfPartlistWithSpecialOptions(set));
29214
- return _context.abrupt("break", 27);
29215
- case 27:
29216
- _context.next = 6;
28649
+ return _context.abrupt("break", 23);
28650
+ case 23:
28651
+ _context.next = 2;
29217
28652
  break;
29218
- case 29:
28653
+ case 25:
29219
28654
  return _context.abrupt("return", ret);
29220
- case 30:
28655
+ case 26:
29221
28656
  case "end":
29222
28657
  return _context.stop();
29223
28658
  }
29224
28659
  }, _callee, this);
29225
28660
  }));
29226
- function getSummaryItems(_x, _x2, _x3) {
28661
+ function getSummaryItems(_x, _x2) {
29227
28662
  return _getSummaryItems.apply(this, arguments);
29228
28663
  }
29229
28664
  return getSummaryItems;
@@ -29327,69 +28762,15 @@ var SummaryHandler = /*#__PURE__*/function () {
29327
28762
  }
29328
28763
  return ret;
29329
28764
  }
29330
- }, {
29331
- key: "getArticlesForSummary",
29332
- value: function getArticlesForSummary(sets) {
29333
- var ret = {};
29334
- for (var setId in sets) {
29335
- var set = sets[setId];
29336
- var articles = set.getDivaArticles();
29337
- for (var basketId in articles) {
29338
- var article = articles[basketId];
29339
- if (!article.curProduct) {
29340
- var _key9 = article.catalogCodex + '_' + article.articleCodex + '_' + article.articleVariantDesc();
29341
- if (ret[_key9]) {
29342
- var _ret$_key9$targetArti;
29343
- ret[_key9].quantity = ret[_key9].quantity + article.quantity;
29344
- ret[_key9].targetBasketIds.push(article.basketId);
29345
- (_ret$_key9$targetArti = ret[_key9].targetArticlePosNrs) === null || _ret$_key9$targetArti === void 0 || _ret$_key9$targetArti.push(article.posNr);
29346
- } else {
29347
- ret[_key9] = {
29348
- setId: setId,
29349
- title: article.name,
29350
- title_locales: article.name_locales,
29351
- description: article.actSizeText,
29352
- isDefined: true,
29353
- price: article.price,
29354
- quantity: article.quantity,
29355
- codex: article.articleCodex,
29356
- targetBasketIds: [article.basketId],
29357
- posNr: Object.keys(ret).length,
29358
- image: article.imageUrl,
29359
- targetArticlePosNrs: [article.posNr]
29360
- };
29361
- }
29362
- }
29363
- }
29364
- }
29365
- var curProducts = productHandlerInstance.getCurrentProducts();
29366
- for (var _key10 in curProducts) {
29367
- var product = productHandlerInstance.getProductById(_key10);
29368
- ret[_key10] = {
29369
- setId: 'PRODUCTS',
29370
- title: product.shortDescription,
29371
- description: '',
29372
- isDefined: true,
29373
- price: product.price,
29374
- quantity: curProducts[_key10],
29375
- codex: product.productId,
29376
- targetBasketIds: [],
29377
- posNr: Object.keys(ret).length,
29378
- image: product.image,
29379
- targetArticlePosNrs: []
29380
- };
29381
- }
29382
- return ret;
29383
- }
29384
28765
  }, {
29385
28766
  key: "getSummaryItemsOfAllSets",
29386
28767
  value: function getSummaryItemsOfAllSets(sets, set) {
29387
28768
  var summaryItemsOfAllSets = {};
29388
- for (var _key11 in sets) {
29389
- var _set = sets[_key11];
28769
+ for (var _key9 in sets) {
28770
+ var _set = sets[_key9];
29390
28771
  var articlePosNrs = this.getArticlesPosNr(_set.getDivaArticles(true));
29391
28772
  var summaryItems = this.buildSummaryItems(articlePosNrs, _set);
29392
- summaryItemsOfAllSets[_key11] = {
28773
+ summaryItemsOfAllSets[_key9] = {
29393
28774
  setName: _set.CatalogData.catalogName,
29394
28775
  setPrice: _set.getSetPrice(),
29395
28776
  summaryItems: summaryItems
@@ -29403,10 +28784,10 @@ var SummaryHandler = /*#__PURE__*/function () {
29403
28784
  var groupedArticles = setHandlerInstance.getDockedGroupedArticles(set);
29404
28785
  var retGroups = {};
29405
28786
  var articlesCodexesOnIndex = {};
29406
- for (var _key12 in groupedArticles) {
29407
- var basketId = groupedArticles[_key12][Object.keys(groupedArticles[_key12])[0]].basketId;
28787
+ for (var _key10 in groupedArticles) {
28788
+ var basketId = groupedArticles[_key10][Object.keys(groupedArticles[_key10])[0]].basketId;
29408
28789
  retGroups[basketId] = {
29409
- articles: groupedArticles[_key12],
28790
+ articles: groupedArticles[_key10],
29410
28791
  quantity: 1
29411
28792
  };
29412
28793
  }
@@ -29421,12 +28802,12 @@ var SummaryHandler = /*#__PURE__*/function () {
29421
28802
  articlesCodexesOnIndex[articleCodex].push(i);
29422
28803
  }
29423
28804
  }
29424
- for (var _key13 in articlesCodexesOnIndex) {
29425
- if (articlesCodexesOnIndex[_key13].length > 1) {
28805
+ for (var _key11 in articlesCodexesOnIndex) {
28806
+ if (articlesCodexesOnIndex[_key11].length > 1) {
29426
28807
  //group the single groups by the aricleCodex
29427
28808
  var articles = [];
29428
- for (var _i4 = 0; _i4 < articlesCodexesOnIndex[_key13].length; _i4++) {
29429
- var _group = groupedArticles[articlesCodexesOnIndex[_key13][_i4]];
28809
+ for (var _i4 = 0; _i4 < articlesCodexesOnIndex[_key11].length; _i4++) {
28810
+ var _group = groupedArticles[articlesCodexesOnIndex[_key11][_i4]];
29430
28811
  articles.push({
29431
28812
  article: _group[Object.keys(_group)[0]]
29432
28813
  });
@@ -29482,12 +28863,12 @@ var SummaryHandler = /*#__PURE__*/function () {
29482
28863
  }
29483
28864
 
29484
28865
  //old logic TODO: Delete in 2024
29485
- if (Object.keys(tabGroups).length === 0) for (var _key14 in article.articleOptionStates) {
29486
- var _ops = article.articleOptionStates[_key14];
28866
+ if (Object.keys(tabGroups).length === 0) for (var _key12 in article.articleOptionStates) {
28867
+ var _ops = article.articleOptionStates[_key12];
29487
28868
  if (!_ops.isInvisible && (_ops.selectionmode != 0 || (_ops.visibleCount > 1 || _ops.isFreeText) && article.set.api.showSelectionModeZero()) && _ops.isDoShow && _ops.valCodex != 'OPVNR') {
29488
28869
  var tabGroup = _ops.option.addOptionToTabgroupInPartlistSummary;
29489
28870
  if (tabGroup) tabGroups.push({
29490
- optionCodex: _key14,
28871
+ optionCodex: _key12,
29491
28872
  tabGroup: tabGroup
29492
28873
  });
29493
28874
  }
@@ -29522,8 +28903,8 @@ var SummaryHandler = /*#__PURE__*/function () {
29522
28903
  }
29523
28904
 
29524
28905
  //old logic TODO: Delete in 2024
29525
- for (var _key15 in article.articleOptionStates) {
29526
- var _optionState = article.articleOptionStates[_key15];
28906
+ for (var _key13 in article.articleOptionStates) {
28907
+ var _optionState = article.articleOptionStates[_key13];
29527
28908
  if (_optionState.option.addOptionToTabgroupInPartlistSummary == tabGroup && !_optionState.isInvisible && _optionState.isDoShow && _optionState.visibleCount > 0 && _optionState.valCodex != 'OPVNR') {
29528
28909
  opss.push(_optionState);
29529
28910
  }
@@ -29687,7 +29068,7 @@ var SummaryHandler = /*#__PURE__*/function () {
29687
29068
  }
29688
29069
  }, _callee3);
29689
29070
  }));
29690
- function getVariantsSummary(_x4, _x5) {
29071
+ function getVariantsSummary(_x3, _x4) {
29691
29072
  return _getVariantsSummary.apply(this, arguments);
29692
29073
  }
29693
29074
  return getVariantsSummary;
@@ -29715,8 +29096,8 @@ var SummaryHandler = /*#__PURE__*/function () {
29715
29096
  key: "getArticlesPrice",
29716
29097
  value: function getArticlesPrice(articles) {
29717
29098
  var price = 0;
29718
- for (var _key16 in articles) {
29719
- price = price + articles[_key16].price * articles[_key16].quantity;
29099
+ for (var _key14 in articles) {
29100
+ price = price + articles[_key14].price * articles[_key14].quantity;
29720
29101
  }
29721
29102
  return price;
29722
29103
  }
@@ -29736,10 +29117,11 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
29736
29117
  return _createClass(DivaFavoritesHandler, [{
29737
29118
  key: "initSet",
29738
29119
  value: function initSet(set, orderSet) {
29739
- var _orderSet$ConfigVaria;
29120
+ var _orderSet$TinyVariant;
29740
29121
  set.favorites = orderSet !== null && orderSet !== void 0 && orderSet.Favorites ? orderSet.Favorites : new Favorites();
29741
- if ((_orderSet$ConfigVaria = orderSet.ConfigVariants) !== null && _orderSet$ConfigVaria !== void 0 && _orderSet$ConfigVaria.length) {
29742
- set.oldConfigVariants = _toConsumableArray(orderSet.ConfigVariants);
29122
+ if ((_orderSet$TinyVariant = orderSet.TinyVariantConfiguration) !== null && _orderSet$TinyVariant !== void 0 && _orderSet$TinyVariant.length) {
29123
+ var _orderSet$TinyVariant2;
29124
+ set.oldConfigVariants = _toConsumableArray((_orderSet$TinyVariant2 = orderSet.TinyVariantConfiguration) !== null && _orderSet$TinyVariant2 !== void 0 ? _orderSet$TinyVariant2 : []);
29743
29125
  }
29744
29126
  set.disabledVariants = [];
29745
29127
  }
@@ -29756,33 +29138,35 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
29756
29138
  key: "getVariantsForSummary",
29757
29139
  value: function () {
29758
29140
  var _getVariantsForSummary = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(set) {
29759
- var _set$allVariantsCache;
29141
+ var _set$actions, _set$allVariantsCache, _set$actions2;
29760
29142
  var variants;
29761
29143
  return _regeneratorRuntime.wrap(function _callee$(_context) {
29762
29144
  while (1) switch (_context.prev = _context.next) {
29763
29145
  case 0:
29764
29146
  this.isCalcForSummary = true;
29147
+ (_set$actions = set.actions) === null || _set$actions === void 0 || _set$actions.toggleLoading('calcfavorites', false, true);
29765
29148
  if (!((_set$allVariantsCache = set.allVariantsCache) !== null && _set$allVariantsCache !== void 0)) {
29766
- _context.next = 5;
29149
+ _context.next = 6;
29767
29150
  break;
29768
29151
  }
29769
29152
  _context.t0 = _set$allVariantsCache;
29770
- _context.next = 8;
29153
+ _context.next = 9;
29771
29154
  break;
29772
- case 5:
29773
- _context.next = 7;
29155
+ case 6:
29156
+ _context.next = 8;
29774
29157
  return this.getAllValidVariants(set);
29775
- case 7:
29776
- _context.t0 = _context.sent;
29777
29158
  case 8:
29159
+ _context.t0 = _context.sent;
29160
+ case 9:
29778
29161
  variants = _context.t0;
29162
+ (_set$actions2 = set.actions) === null || _set$actions2 === void 0 || _set$actions2.toggleLoading('calcfavorites', false, false);
29779
29163
  this.isCalcForSummary = false;
29780
29164
  return _context.abrupt("return", {
29781
29165
  disabled: set.disabledVariants,
29782
29166
  variants: variants,
29783
29167
  singleOptions: this.repairFavorites(set).singleOptions
29784
29168
  });
29785
- case 11:
29169
+ case 13:
29786
29170
  case "end":
29787
29171
  return _context.stop();
29788
29172
  }
@@ -29959,8 +29343,9 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
29959
29343
  if (!((_set$oldConfigVariant = set.oldConfigVariants) !== null && _set$oldConfigVariant !== void 0 && _set$oldConfigVariant.length)) return 0;
29960
29344
  var highestId = 0;
29961
29345
  for (var i = 0; i < set.oldConfigVariants.length; i++) {
29962
- if (highestId < set.oldConfigVariants[i].VariantID) {
29963
- highestId = set.oldConfigVariants[i].VariantID;
29346
+ var variant = set.oldConfigVariants[i];
29347
+ if (variant.VariantID && highestId < variant.VariantID) {
29348
+ highestId = variant.VariantID;
29964
29349
  }
29965
29350
  }
29966
29351
  return highestId + 1;
@@ -29973,15 +29358,17 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
29973
29358
  for (var i = 0; i < set.oldConfigVariants.length; i++) {
29974
29359
  var oldConfigVariant = set.oldConfigVariants[i];
29975
29360
  var tryNext = false;
29976
- for (var basketId in variant.targetArticles) {
29361
+ var _loop2 = function _loop2(basketId) {
29977
29362
  var articleNew = variant.targetArticles[basketId];
29978
- var articleOld = oldConfigVariant.SetVariantData[basketId];
29363
+ var articleOld = oldConfigVariant.OrderSets[0].OrderLines.find(function (ol) {
29364
+ return ol.BasketID == basketId;
29365
+ });
29979
29366
  if (!articleOld) {
29980
29367
  tryNext = true;
29981
- continue;
29368
+ return 1; // continue
29982
29369
  }
29983
- var _loop2 = function _loop2(opt) {
29984
- var option = articleOld.VariantValues.find(function (v) {
29370
+ var _loop3 = function _loop3(opt) {
29371
+ var option = articleOld.VariantBasketDatas.find(function (v) {
29985
29372
  return 'OPT' + v.OPT == opt;
29986
29373
  });
29987
29374
  if (!option) {
@@ -29995,9 +29382,12 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
29995
29382
  },
29996
29383
  _ret;
29997
29384
  for (var opt in articleNew) {
29998
- _ret = _loop2(opt);
29385
+ _ret = _loop3(opt);
29999
29386
  if (_ret === 0) continue;
30000
29387
  }
29388
+ };
29389
+ for (var basketId in variant.targetArticles) {
29390
+ if (_loop2(basketId)) continue;
30001
29391
  }
30002
29392
  if (tryNext) continue;
30003
29393
  return oldConfigVariant.VariantID;
@@ -30042,7 +29432,7 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
30042
29432
  var optionValue = set.CatalogData.getOptionValue(opvs[i]);
30043
29433
  var optionValueName = optionValue === null || optionValue === void 0 ? void 0 : optionValue.name;
30044
29434
  var optionValueImage = optionValue === null || optionValue === void 0 ? void 0 : optionValue.image;
30045
- favorit = new Favorit(opt, opvs[i], targetArticles, optionName, optionValueName, optionValueImage);
29435
+ favorit = new Favorite(opt, opvs[i], targetArticles, optionName, optionValueName, optionValueImage);
30046
29436
  this.setFavorites(set, opt, opvs[i], favorit, remove);
30047
29437
  }
30048
29438
  set.disabledVariants = [];
@@ -30438,14 +29828,28 @@ var DivaFavoritesHandler = /*#__PURE__*/function () {
30438
29828
  var optionsMatching = {};
30439
29829
  for (var basketId in variant.targetArticles) {
30440
29830
  var articleVariantValues = variant.targetArticles[basketId];
29831
+ var _loop4 = function _loop4(opt) {
29832
+ var _articleWithOption$Va;
29833
+ if (optionsMatching[opt]) return 0; // continue
29834
+ var articleWithOption = oldConfig.OrderSets[0].OrderLines.find(function (ol) {
29835
+ return ol.VariantBasketDatas.find(function (v) {
29836
+ return 'OPT' + v.OPT === opt;
29837
+ });
29838
+ });
29839
+ if ('OPV' + (articleWithOption === null || articleWithOption === void 0 || (_articleWithOption$Va = articleWithOption.VariantBasketDatas.find(function (v) {
29840
+ return 'OPT' + v.OPT === opt;
29841
+ })) === null || _articleWithOption$Va === void 0 ? void 0 : _articleWithOption$Va.OPV) == articleVariantValues[opt]) {
29842
+ optionsMatching[opt] = true;
29843
+ } else {
29844
+ tryNext = true;
29845
+ return 1; // break
29846
+ }
29847
+ },
29848
+ _ret2;
30441
29849
  for (var opt in articleVariantValues) {
30442
- if (optionsMatching[opt]) continue;
30443
- if (oldConfig.Variant[opt] == articleVariantValues[opt]) {
30444
- optionsMatching[opt] = true;
30445
- } else {
30446
- tryNext = true;
30447
- break;
30448
- }
29850
+ _ret2 = _loop4(opt);
29851
+ if (_ret2 === 0) continue;
29852
+ if (_ret2 === 1) break;
30449
29853
  }
30450
29854
  if (tryNext) break;
30451
29855
  }
@@ -31277,6 +30681,53 @@ var DivaConfigTreeHandler = /*#__PURE__*/function () {
31277
30681
  }();
31278
30682
  var configTreeHandler = new DivaConfigTreeHandler();
31279
30683
 
30684
+ //Diese Klasse verwaltet Productlogiken
30685
+ var DivaProductHandler = /*#__PURE__*/function () {
30686
+ function DivaProductHandler() {
30687
+ _classCallCheck(this, DivaProductHandler);
30688
+ }
30689
+ return _createClass(DivaProductHandler, [{
30690
+ key: "getPrice",
30691
+ value: function getPrice() {
30692
+ var price = 0;
30693
+ return price;
30694
+ }
30695
+ }, {
30696
+ key: "updateProducts",
30697
+ value: function () {
30698
+ var _updateProducts = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(sets, api, from) {
30699
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
30700
+ while (1) switch (_context.prev = _context.next) {
30701
+ case 0:
30702
+ ({
30703
+ catalogs: sets.map(function (set) {
30704
+ return {
30705
+ articles: Object.values(set.getDivaArticles()).map(function (article) {
30706
+ return {
30707
+ codex: article.articleCodex,
30708
+ hash: article.articleProductHash
30709
+ };
30710
+ }),
30711
+ catalogGuid: set.CatalogData.catalogGuid
30712
+ };
30713
+ })
30714
+ });
30715
+ return _context.abrupt("return");
30716
+ case 2:
30717
+ case "end":
30718
+ return _context.stop();
30719
+ }
30720
+ }, _callee);
30721
+ }));
30722
+ function updateProducts(_x, _x2, _x3) {
30723
+ return _updateProducts.apply(this, arguments);
30724
+ }
30725
+ return updateProducts;
30726
+ }()
30727
+ }]);
30728
+ }();
30729
+ var productHandlerInstance = new DivaProductHandler();
30730
+
31280
30731
  function ownKeys$8(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; }
31281
30732
  function _objectSpread$8(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$8(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$8(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
31282
30733
  var LOG$8 = DivaUtils.initLog('Planner', 'DIVA-SET-HANDLER');
@@ -31325,11 +30776,8 @@ var DivaSetHandler = /*#__PURE__*/function () {
31325
30776
  _context.next = 12;
31326
30777
  return set.plannerHandler.initSet(set, catalogData, undefined);
31327
30778
  case 12:
31328
- _context.next = 14;
31329
- return productHandlerInstance.updateProducts(set, 'onAdd');
31330
- case 14:
31331
30779
  return _context.abrupt("return", set);
31332
- case 15:
30780
+ case 13:
31333
30781
  case "end":
31334
30782
  return _context.stop();
31335
30783
  }
@@ -31386,7 +30834,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
31386
30834
  PosNr: orderline.PosNr,
31387
30835
  VariantValues: variantValues,
31388
30836
  VariantItemData: orderline.VariantBasketDatas,
31389
- ShelfPlanData: orderline.ShelfPlandata,
30837
+ ShelfPlandata: orderline.ShelfPlandata,
31390
30838
  elementId: (_orderline$ElementID = orderline.ElementID) !== null && _orderline$ElementID !== void 0 ? _orderline$ElementID : elements === null || elements === void 0 || (_elements$find = elements.find(function (element) {
31391
30839
  return element.basketID == orderline.BasketID;
31392
30840
  })) === null || _elements$find === void 0 ? void 0 : _elements$find.elementID
@@ -32113,19 +31561,12 @@ var DivaSetHandler = /*#__PURE__*/function () {
32113
31561
  _context13.next = 16;
32114
31562
  return articleHandlerInstance.toDoAfterArticleLoaded(newArticle, defaultHeaderValues, {}, from, undefined, ignorePlanner);
32115
31563
  case 16:
32116
- if (!(from === 'initializing')) {
32117
- _context13.next = 19;
32118
- break;
32119
- }
32120
- _context13.next = 19;
32121
- return productHandlerInstance.updateProducts(set, 'onAdd');
32122
- case 19:
32123
31564
  LOG$8.successTransaction('ON_PLAN_ARTICLE', {
32124
31565
  art: articleCodex,
32125
31566
  artName: newArticle.name
32126
31567
  });
32127
31568
  return _context13.abrupt("return", newArticle);
32128
- case 21:
31569
+ case 18:
32129
31570
  case "end":
32130
31571
  return _context13.stop();
32131
31572
  }
@@ -32258,7 +31699,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
32258
31699
  key: "deleteElementFromSet",
32259
31700
  value: function () {
32260
31701
  var _deleteElementFromSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(set, article, autoCorrectAVL_AVR, deletionType, dontReload) {
32261
- var _deletedArticle$doorP, _set$CatalogData, _deletedArticle$curPr;
31702
+ var _deletedArticle$doorP, _set$CatalogData;
32262
31703
  var setId, deletedArticle, articles, key, newSelectedElement, oldTransform, result, _set$getArticleByBask3, elementDeleted;
32263
31704
  return _regeneratorRuntime.wrap(function _callee14$(_context16) {
32264
31705
  while (1) switch (_context16.prev = _context16.next) {
@@ -32318,20 +31759,13 @@ var DivaSetHandler = /*#__PURE__*/function () {
32318
31759
  _context16.next = 27;
32319
31760
  return this.updateArticlesOptionStatesOfActSet(set, {}, []);
32320
31761
  case 27:
32321
- if (dontReload) {
32322
- _context16.next = 30;
32323
- break;
32324
- }
32325
- _context16.next = 30;
32326
- return productHandlerInstance.updateProducts(set, 'onDelete', deletedArticle === null || deletedArticle === void 0 || (_deletedArticle$curPr = deletedArticle.curProduct) === null || _deletedArticle$curPr === void 0 ? void 0 : _deletedArticle$curPr.productId);
32327
- case 30:
32328
31762
  return _context16.abrupt("return", {
32329
31763
  success: elementDeleted,
32330
31764
  selectElementId: newSelectedElement,
32331
31765
  setId: setId,
32332
31766
  oldTransform: oldTransform
32333
31767
  });
32334
- case 31:
31768
+ case 28:
32335
31769
  case "end":
32336
31770
  return _context16.stop();
32337
31771
  }
@@ -33113,8 +32547,8 @@ var DivaSetHandler = /*#__PURE__*/function () {
33113
32547
  key: "variantsEvaluator",
33114
32548
  value: (function () {
33115
32549
  var _variantsEvaluator = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee23(set, configItems, configStepKey, paletteType) {
33116
- var _set$WebConfig, _set$ViewConfig, _configItems$;
33117
- var opt, checkForProductsInStock, calcVariantsForPricePreview, previewType, _set$CatalogData$show, targetArticles, startTime, variants, endTime;
32550
+ var _set$ViewConfig, _configItems$;
32551
+ var opt, calcVariantsForPricePreview, previewType, _set$CatalogData$show, targetArticles, startTime, variants, endTime;
33118
32552
  return _regeneratorRuntime.wrap(function _callee23$(_context25) {
33119
32553
  while (1) switch (_context25.prev = _context25.next) {
33120
32554
  case 0:
@@ -33125,7 +32559,6 @@ var DivaSetHandler = /*#__PURE__*/function () {
33125
32559
  }
33126
32560
  return _context25.abrupt("return", configItems);
33127
32561
  case 3:
33128
- checkForProductsInStock = ((_set$WebConfig = set.WebConfig) === null || _set$WebConfig === void 0 ? void 0 : _set$WebConfig.checkForProductsInStock) && !(opt !== null && opt !== void 0 && opt.isDescribingState);
33129
32562
  calcVariantsForPricePreview = false;
33130
32563
  previewType = (_set$ViewConfig = set.ViewConfig) === null || _set$ViewConfig === void 0 ? void 0 : _set$ViewConfig.pricePreview;
33131
32564
  if (previewType) {
@@ -33135,27 +32568,24 @@ var DivaSetHandler = /*#__PURE__*/function () {
33135
32568
  if (paletteType == 'GAL' && ((_configItems$ = configItems[0]) === null || _configItems$ === void 0 ? void 0 : _configItems$.groupName) === undefined || paletteType == 'TEXTBOX' || paletteType == 'NUMBERBOX' || paletteType == 'RANGE') {
33136
32569
  calcVariantsForPricePreview = false;
33137
32570
  }
33138
- if (!(checkForProductsInStock || calcVariantsForPricePreview)) {
33139
- _context25.next = 19;
32571
+ if (!calcVariantsForPricePreview) {
32572
+ _context25.next = 17;
33140
32573
  break;
33141
32574
  }
33142
32575
  targetArticles = set.configTree.getTargetArticles(configStepKey);
33143
32576
  startTime = new Date();
33144
- _context25.next = 14;
32577
+ _context25.next = 13;
33145
32578
  return this.calcVariants(set, configItems, targetArticles);
33146
- case 14:
32579
+ case 13:
33147
32580
  variants = _context25.sent;
33148
32581
  endTime = new Date();
33149
32582
  if (endTime.getTime() - startTime.getTime() > 1000) set.dontCalcPricePreviewDueToPerformanceIssues = true;
33150
32583
  if (previewType) {
33151
32584
  this.calcPricePreview(set, configItems, variants);
33152
32585
  }
33153
- if (checkForProductsInStock) {
33154
- configItems = productHandlerInstance.checkProductInStock(configItems, variants, set.getDivaArticles(), targetArticles);
33155
- }
33156
- case 19:
32586
+ case 17:
33157
32587
  return _context25.abrupt("return", configItems);
33158
- case 20:
32588
+ case 18:
33159
32589
  case "end":
33160
32590
  return _context25.stop();
33161
32591
  }
@@ -33329,29 +32759,22 @@ var DivaSetHandler = /*#__PURE__*/function () {
33329
32759
  _context27.next = 19;
33330
32760
  return this.updateEdoArticles(set, retValues.newEDOExtraArticles);
33331
32761
  case 19:
33332
- if (!(from == 'FromViewClick')) {
33333
- _context27.next = 22;
33334
- break;
33335
- }
33336
- _context27.next = 22;
33337
- return productHandlerInstance.updateProducts(set, 'onConfig');
33338
- case 22:
33339
32762
  if (set.CatalogData.hasAlternateRenderings) set.CatalogData.updateAlternativeRenderings(set.getDivaArticles());
33340
32763
 
33341
32764
  //Update Planner - check if planner data changed
33342
32765
  if (!(!ignorePlanner && from != 'calcVariant')) {
33343
- _context27.next = 51;
32766
+ _context27.next = 48;
33344
32767
  break;
33345
32768
  }
33346
32769
  targetElementIds = this.getElementIdsOfArticles(set, targetArticlesWithNewValues);
33347
- _context27.next = 27;
32770
+ _context27.next = 24;
33348
32771
  return set.plannerHandler.updatePlanner(set.getSetId(), myValues, targetElementIds);
33349
- case 27:
32772
+ case 24:
33350
32773
  resultPlannerUpdate = _context27.sent;
33351
32774
  i = 0;
33352
- case 29:
32775
+ case 26:
33353
32776
  if (!(i < resultPlannerUpdate.elemIdsToDelete.length)) {
33354
- _context27.next = 38;
32777
+ _context27.next = 35;
33355
32778
  break;
33356
32779
  }
33357
32780
  articleToDel = set.getArticleByElementId(resultPlannerUpdate.elemIdsToDelete[i]);
@@ -33359,43 +32782,43 @@ var DivaSetHandler = /*#__PURE__*/function () {
33359
32782
  if (index > -1) {
33360
32783
  targetArticlesWithNewValues.splice(index, 1);
33361
32784
  }
33362
- _context27.next = 35;
32785
+ _context27.next = 32;
33363
32786
  return this.deleteElementFromSetByElemId(set, resultPlannerUpdate.elemIdsToDelete[i], false, resultPlannerUpdate.deletionType);
33364
- case 35:
32787
+ case 32:
33365
32788
  i++;
33366
- _context27.next = 29;
32789
+ _context27.next = 26;
33367
32790
  break;
33368
- case 38:
32791
+ case 35:
33369
32792
  if (!(resultPlannerUpdate.elementIdToCopy && resultPlannerUpdate.elementIdToCopy.length > 0)) {
33370
- _context27.next = 51;
32793
+ _context27.next = 48;
33371
32794
  break;
33372
32795
  }
33373
32796
  //Todo copy these elements
33374
32797
  articleCopyRelation = new Map();
33375
32798
  i = 0;
33376
- case 41:
32799
+ case 38:
33377
32800
  if (!(i < resultPlannerUpdate.elementIdToCopy.length)) {
33378
- _context27.next = 49;
32801
+ _context27.next = 46;
33379
32802
  break;
33380
32803
  }
33381
- _context27.next = 44;
32804
+ _context27.next = 41;
33382
32805
  return this.copyArticleByElementId(set, resultPlannerUpdate.elementIdToCopy[i], resultPlannerUpdate.ignoreOptionsToCopy);
33383
- case 44:
32806
+ case 41:
33384
32807
  newArticle = _context27.sent;
33385
32808
  articleCopyRelation.set(resultPlannerUpdate.elementIdToCopy[i], newArticle.basketId);
33386
- case 46:
32809
+ case 43:
33387
32810
  i++;
33388
- _context27.next = 41;
32811
+ _context27.next = 38;
33389
32812
  break;
33390
- case 49:
33391
- _context27.next = 51;
32813
+ case 46:
32814
+ _context27.next = 48;
33392
32815
  return set.plannerHandler.copyPlannerElements(set.getSetId(), articleCopyRelation, {
33393
32816
  dpType: resultPlannerUpdate.copyDPType ? resultPlannerUpdate.copyDPType : 'NO',
33394
32817
  copyType: resultPlannerUpdate.copyType,
33395
32818
  changedOPT: resultPlannerUpdate.changedOPT,
33396
32819
  targetElements: resultPlannerUpdate.targetElements
33397
32820
  });
33398
- case 51:
32821
+ case 48:
33399
32822
  this.updatePosNrOfAccessoiresOfTargetArticles(set, targetArticlesWithNewValues);
33400
32823
  if (from == 'FromViewClick' && (_Object$keys = Object.keys(myValues)) !== null && _Object$keys !== void 0 && _Object$keys.length) {
33401
32824
  this.confirmOptionsInMetric(set, [Object.keys(myValues)[0]], 'onSelectConfig');
@@ -33405,7 +32828,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33405
32828
  elementIdsToUpdateSelection: (_resultPlannerUpdate = resultPlannerUpdate) === null || _resultPlannerUpdate === void 0 ? void 0 : _resultPlannerUpdate.elementIdsToUpdateSelection,
33406
32829
  setId: set.getSetId()
33407
32830
  });
33408
- case 54:
32831
+ case 51:
33409
32832
  case "end":
33410
32833
  return _context27.stop();
33411
32834
  }
@@ -33551,7 +32974,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33551
32974
  articleHandlerInstance.defineAllOptionsOfArticles(articles);
33552
32975
  } else if (key === set.getSetId()) {
33553
32976
  for (var _key in basketIdsOnOptions) {
33554
- articlesAndOptions[_key] = {
32977
+ if (articles[_key]) articlesAndOptions[_key] = {
33555
32978
  article: articles[_key],
33556
32979
  options: basketIdsOnOptions[_key]
33557
32980
  };
@@ -33702,7 +33125,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33702
33125
  value: function getTotalPrice(sets) {
33703
33126
  var _this$actSet;
33704
33127
  var price = 0;
33705
- if ((_this$actSet = this.actSet(sets)) !== null && _this$actSet !== void 0 && (_this$actSet = _this$actSet.WebConfig) !== null && _this$actSet !== void 0 && _this$actSet.checkForProductsInStock) {
33128
+ if ((_this$actSet = this.actSet(sets)) !== null && _this$actSet !== void 0 && (_this$actSet = _this$actSet.WebConfig) !== null && _this$actSet !== void 0 && _this$actSet.checkForProductsPrice && productHandlerInstance.getPrice()) {
33706
33129
  return productHandlerInstance.getPrice();
33707
33130
  }
33708
33131
  for (var key in sets) {
@@ -33716,7 +33139,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33716
33139
  var _this$actSet2;
33717
33140
  var price = 0;
33718
33141
  var bruttoActive = false;
33719
- if ((_this$actSet2 = this.actSet(sets)) !== null && _this$actSet2 !== void 0 && (_this$actSet2 = _this$actSet2.WebConfig) !== null && _this$actSet2 !== void 0 && _this$actSet2.checkForProductsInStock) {
33142
+ if ((_this$actSet2 = this.actSet(sets)) !== null && _this$actSet2 !== void 0 && (_this$actSet2 = _this$actSet2.WebConfig) !== null && _this$actSet2 !== void 0 && _this$actSet2.checkForProductsPrice && productHandlerInstance.getPrice()) {
33720
33143
  return productHandlerInstance.getPrice();
33721
33144
  }
33722
33145
  for (var key in sets) {
@@ -33743,7 +33166,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33743
33166
  key: "fillOrderLinesAndOrderSets",
33744
33167
  value: function () {
33745
33168
  var _fillOrderLinesAndOrderSets = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee28(sets, divaBasketHandler, repairOnly, setPlanner, returnTo) {
33746
- var _set$WebConfig2;
33169
+ var _set$WebConfig;
33747
33170
  var orderSets, basketData, set, setPosNr, price, key, _set$basketConfigVari, _OrderLinesOfActSet$, _set, catalogData, articles, orderLineInitInfos, newOrderSet, OrderLinesOfActSet, ret, _key2, i, _basketData$OrderSets, _basketData$SetPlanne, oderSetsIsInActPlanning, setId, j;
33748
33171
  return _regeneratorRuntime.wrap(function _callee28$(_context30) {
33749
33172
  while (1) switch (_context30.prev = _context30.next) {
@@ -33753,7 +33176,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33753
33176
  set = this.actSet(sets); //ACHTUNG: Wenn man das nicht zuerst löscht, gibt es beim wiederholten basket Speichern doppelte Einträge
33754
33177
  basketData.setSAPOrderLines([]);
33755
33178
  setPosNr = 0;
33756
- if (set !== null && set !== void 0 && (_set$WebConfig2 = set.WebConfig) !== null && _set$WebConfig2 !== void 0 && _set$WebConfig2.checkForProductsPrice) {
33179
+ if (set !== null && set !== void 0 && (_set$WebConfig = set.WebConfig) !== null && _set$WebConfig !== void 0 && _set$WebConfig.checkForProductsPrice) {
33757
33180
  price = set.priceForActHash();
33758
33181
  if (!price) {
33759
33182
  basketData.OrigProductId = undefined;
@@ -33790,7 +33213,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
33790
33213
  if (newOrderSet.SetImage == '' && (_OrderLinesOfActSet$ = OrderLinesOfActSet[0]) !== null && _OrderLinesOfActSet$ !== void 0 && _OrderLinesOfActSet$.Image && _set.PlannerMode == 'No') {
33791
33214
  newOrderSet.SetImage = OrderLinesOfActSet[0].Image.replace('_low', '');
33792
33215
  }
33793
- ret = divaBasketHandler.divaWWSHandler.getWWSData(basketData, _set, newOrderSet, OrderLinesOfActSet, productHandlerInstance.getCurrentProducts());
33216
+ ret = divaBasketHandler.divaWWSHandler.getWWSData(basketData, _set, newOrderSet, OrderLinesOfActSet);
33794
33217
  for (_key2 in ret) {
33795
33218
  if (_key2 == 'orderlines') {
33796
33219
  OrderLinesOfActSet = ret[_key2];
@@ -33894,8 +33317,11 @@ var DivaSetHandler = /*#__PURE__*/function () {
33894
33317
  });
33895
33318
  if (origOrderSet) {
33896
33319
  origOrderSet.CatalogName = actOrderSet.CatalogName;
33320
+ origOrderSet.AccountName = actOrderSet.AccountName;
33321
+ origOrderSet.AccountLogo = actOrderSet.AccountLogo;
33897
33322
  origOrderSet.CatalogOfflineVersion = actOrderSet.CatalogOfflineVersion;
33898
33323
  origOrderSet.CatalogGUID = actOrderSet.CatalogGUID;
33324
+ origOrderSet.CollectionGUID = actOrderSet.CollectionGUID;
33899
33325
  origOrderSet.OrderLines = actOrderSet.OrderLines;
33900
33326
  origOrderSet.OrderSetDesc = actOrderSet.OrderSetDesc;
33901
33327
  origOrderSet.OrigZKATNr = actOrderSet.OrigZKATNr;
@@ -33908,11 +33334,14 @@ var DivaSetHandler = /*#__PURE__*/function () {
33908
33334
  origOrderSet.BBox = actOrderSet.BBox;
33909
33335
  origOrderSet.VariantDescription = actOrderSet.VariantDescription;
33910
33336
  if (actOrderSet.ConfigVariants && origOrderSet.ConfigVariants) origOrderSet.ConfigVariants = actOrderSet.ConfigVariants.map(function (variant, index) {
33337
+ var _origOrderSet$ConfigV;
33338
+ var configVariant = (_origOrderSet$ConfigV = origOrderSet.ConfigVariants) === null || _origOrderSet$ConfigV === void 0 ? void 0 : _origOrderSet$ConfigV[index];
33339
+ if (!configVariant) return variant;
33911
33340
  return _objectSpread$8(_objectSpread$8({}, variant), {}, {
33912
- SetImage: origOrderSet.ConfigVariants[index].SetImage,
33913
- HQRenderScript: origOrderSet.ConfigVariants[index].HQRenderScript,
33914
- Set2DImage: origOrderSet.ConfigVariants[index].Set2DImage,
33915
- Diva3DProject: origOrderSet.ConfigVariants[index].Diva3DProject
33341
+ SetImage: configVariant.SetImage,
33342
+ HQRenderScript: configVariant.HQRenderScript,
33343
+ Set2DImage: configVariant.Set2DImage,
33344
+ Diva3DProject: configVariant.Diva3DProject
33916
33345
  });
33917
33346
  });
33918
33347
  }
@@ -33921,7 +33350,6 @@ var DivaSetHandler = /*#__PURE__*/function () {
33921
33350
  _loop7();
33922
33351
  }
33923
33352
  }
33924
-
33925
33353
  /**************************SpeicherRoutinen*************************************/
33926
33354
  }, {
33927
33355
  key: "isNoArticleToSave",
@@ -34005,7 +33433,6 @@ var DivaSetHandler = /*#__PURE__*/function () {
34005
33433
  CatalogOfflineFilesLastUpdate: catalogData.offlineFilesLastUpdate,
34006
33434
  Description: catalogData.description,
34007
33435
  GroupType: GroupType,
34008
- MainPosNr: posNr,
34009
33436
  OfflineData: catalogData.offlineData,
34010
33437
  SetArticleNr: set.SetArticleNr ? set.SetArticleNr : catalogData.retailArticleNr,
34011
33438
  SetArticleNrPrefix: set.SetArticleNrPrefix,
@@ -34254,31 +33681,6 @@ var DivaSetHandler = /*#__PURE__*/function () {
34254
33681
  Info: ((_set$api$getI18n$t = (_set$api$getI18n = set.api.getI18n()) === null || _set$api$getI18n === void 0 || (_set$api$getI18n$t2 = _set$api$getI18n.t) === null || _set$api$getI18n$t2 === void 0 ? void 0 : _set$api$getI18n$t2.call(_set$api$getI18n, 'utils.width_first_letter', 'B')) !== null && _set$api$getI18n$t !== void 0 ? _set$api$getI18n$t : 'B') + ': ' + dim.X + ' cm x ' + ((_set$api$getI18n$t3 = (_set$api$getI18n2 = set.api.getI18n()) === null || _set$api$getI18n2 === void 0 || (_set$api$getI18n2$t = _set$api$getI18n2.t) === null || _set$api$getI18n2$t === void 0 ? void 0 : _set$api$getI18n2$t.call(_set$api$getI18n2, 'utils.depth_first_letter', 'T')) !== null && _set$api$getI18n$t3 !== void 0 ? _set$api$getI18n$t3 : 'T') + ': ' + dim.Y + ' cm' + (dim.Z ? ' x ' + ((_set$api$getI18n$t4 = (_set$api$getI18n3 = set.api.getI18n()) === null || _set$api$getI18n3 === void 0 || (_set$api$getI18n3$t = _set$api$getI18n3.t) === null || _set$api$getI18n3$t === void 0 ? void 0 : _set$api$getI18n3$t.call(_set$api$getI18n3, 'utils.height_first_letter', 'H')) !== null && _set$api$getI18n$t4 !== void 0 ? _set$api$getI18n$t4 : 'H') + ': ' + dim.X + ' cm' : '')
34255
33682
  });
34256
33683
  }
34257
- }, {
34258
- key: "loadProductsOfSets",
34259
- value: function () {
34260
- var _loadProductsOfSets = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee34(orderSets, involvedSetIds) {
34261
- return _regeneratorRuntime.wrap(function _callee34$(_context36) {
34262
- while (1) switch (_context36.prev = _context36.next) {
34263
- case 0:
34264
- _context36.next = 2;
34265
- return productHandlerInstance.loadProductsOfSets(orderSets, involvedSetIds);
34266
- case 2:
34267
- case "end":
34268
- return _context36.stop();
34269
- }
34270
- }, _callee34);
34271
- }));
34272
- function loadProductsOfSets(_x113, _x114) {
34273
- return _loadProductsOfSets.apply(this, arguments);
34274
- }
34275
- return loadProductsOfSets;
34276
- }()
34277
- }, {
34278
- key: "addProducts",
34279
- value: function addProducts(variants, families) {
34280
- productHandlerInstance.addProducts(variants, families);
34281
- }
34282
33684
  }, {
34283
33685
  key: "getAllProducts",
34284
33686
  value: function getAllProducts(sets) {
@@ -34306,28 +33708,25 @@ var DivaSetHandler = /*#__PURE__*/function () {
34306
33708
  }, {
34307
33709
  key: "addOrderSetArticlesToExistingSet",
34308
33710
  value: function () {
34309
- var _addOrderSetArticlesToExistingSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee35(set, orderSet, lastSetToInitialize) {
34310
- return _regeneratorRuntime.wrap(function _callee35$(_context37) {
34311
- while (1) switch (_context37.prev = _context37.next) {
33711
+ var _addOrderSetArticlesToExistingSet = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee34(set, orderSet, lastSetToInitialize) {
33712
+ return _regeneratorRuntime.wrap(function _callee34$(_context36) {
33713
+ while (1) switch (_context36.prev = _context36.next) {
34312
33714
  case 0:
34313
33715
  //TODO: GLOBAL STUFF
34314
33716
  //this.updateActSet(set);
34315
33717
  orderSet.changeBasketIds();
34316
- _context37.next = 3;
33718
+ _context36.next = 3;
34317
33719
  return this.initOrderLineArticles(set, orderSet);
34318
33720
  case 3:
34319
- _context37.next = 5;
33721
+ _context36.next = 5;
34320
33722
  return set.plannerHandler.extendSet(set, orderSet.SetPlanData, lastSetToInitialize);
34321
33723
  case 5:
34322
- _context37.next = 7;
34323
- return productHandlerInstance.updateProducts(set, 'onAdd');
34324
- case 7:
34325
33724
  case "end":
34326
- return _context37.stop();
33725
+ return _context36.stop();
34327
33726
  }
34328
- }, _callee35, this);
33727
+ }, _callee34, this);
34329
33728
  }));
34330
- function addOrderSetArticlesToExistingSet(_x115, _x116, _x117) {
33729
+ function addOrderSetArticlesToExistingSet(_x113, _x114, _x115) {
34331
33730
  return _addOrderSetArticlesToExistingSet.apply(this, arguments);
34332
33731
  }
34333
33732
  return addOrderSetArticlesToExistingSet;
@@ -34652,21 +34051,29 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34652
34051
  }, {
34653
34052
  key: "initProductId",
34654
34053
  value: function () {
34655
- var _initProductId = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(api, productId, keepOldDivaNr) {
34054
+ var _initProductId = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(api, productId) {
34055
+ var result;
34656
34056
  return _regeneratorRuntime.wrap(function _callee2$(_context2) {
34657
34057
  while (1) switch (_context2.prev = _context2.next) {
34658
34058
  case 0:
34659
34059
  _context2.next = 2;
34660
- return this.loadProduct(api, productId, keepOldDivaNr);
34060
+ return this.getProduct(api, productId);
34661
34061
  case 2:
34062
+ result = _context2.sent;
34063
+ this.assignNewDivaNr = true;
34064
+ _context2.next = 6;
34065
+ return this.initBasket(api, result.divaNr, {
34066
+ basket: result.configuration
34067
+ }, false);
34068
+ case 6:
34662
34069
  return _context2.abrupt("return", _context2.sent);
34663
- case 3:
34070
+ case 7:
34664
34071
  case "end":
34665
34072
  return _context2.stop();
34666
34073
  }
34667
34074
  }, _callee2, this);
34668
34075
  }));
34669
- function initProductId(_x2, _x3, _x4) {
34076
+ function initProductId(_x2, _x3) {
34670
34077
  return _initProductId.apply(this, arguments);
34671
34078
  }
34672
34079
  return initProductId;
@@ -34712,7 +34119,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34712
34119
  }
34713
34120
  }, _callee3, this);
34714
34121
  }));
34715
- function tryInitFirstCatalog(_x5) {
34122
+ function tryInitFirstCatalog(_x4) {
34716
34123
  return _tryInitFirstCatalog.apply(this, arguments);
34717
34124
  }
34718
34125
  return tryInitFirstCatalog;
@@ -34747,7 +34154,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34747
34154
  }
34748
34155
  }, _callee4, this);
34749
34156
  }));
34750
- function createNewDivaNr(_x6) {
34157
+ function createNewDivaNr(_x5) {
34751
34158
  return _createNewDivaNr.apply(this, arguments);
34752
34159
  }
34753
34160
  return createNewDivaNr;
@@ -34777,7 +34184,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34777
34184
  } else {
34778
34185
  this.origConfiguration.originDivaNr = divaNr;
34779
34186
  }
34780
- if (this.plannerConfig.returnTo != 'REPAIR_BASKET' && basket.StatusKey == 'BASE_CONFIGURATION') {
34187
+ if (this.plannerConfig.returnTo != 'REPAIR_BASKET' && (basket.StatusKey == 'BASE_CONFIGURATION' || keepOldDivaNr === false)) {
34781
34188
  this.assignNewDivaNr = true;
34782
34189
  basket.CustomerJourneyId = nanoid();
34783
34190
  basket.StatusKey = 'USER_CONFIGURATION';
@@ -34795,7 +34202,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34795
34202
  basket.OrderSets[i].SetID = newSetId;
34796
34203
  }
34797
34204
  }
34798
- if (!(this.assignNewDivaNr && !keepOldDivaNr)) {
34205
+ if (!this.assignNewDivaNr) {
34799
34206
  _context5.next = 29;
34800
34207
  break;
34801
34208
  }
@@ -34875,7 +34282,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34875
34282
  }
34876
34283
  }, _callee5, this);
34877
34284
  }));
34878
- function initBasket(_x7, _x8, _x9, _x10, _x11) {
34285
+ function initBasket(_x6, _x7, _x8, _x9, _x10) {
34879
34286
  return _initBasket.apply(this, arguments);
34880
34287
  }
34881
34288
  return initBasket;
@@ -34954,7 +34361,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34954
34361
  }
34955
34362
  }, _callee6, this);
34956
34363
  }));
34957
- function loadBasketByCatalogCodex(_x12) {
34364
+ function loadBasketByCatalogCodex(_x11) {
34958
34365
  return _loadBasketByCatalogCodex.apply(this, arguments);
34959
34366
  }
34960
34367
  return loadBasketByCatalogCodex;
@@ -34962,7 +34369,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34962
34369
  }, {
34963
34370
  key: "loadBasketByDivaNr",
34964
34371
  value: function () {
34965
- var _loadBasketByDivaNr = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(api, divaNr, keepOldDivaNr, origProductId) {
34372
+ var _loadBasketByDivaNr = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(api, divaNr) {
34966
34373
  var variantData;
34967
34374
  return _regeneratorRuntime.wrap(function _callee7$(_context7) {
34968
34375
  while (1) switch (_context7.prev = _context7.next) {
@@ -34973,13 +34380,13 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34973
34380
  case 3:
34974
34381
  variantData = _context7.sent;
34975
34382
  _context7.next = 6;
34976
- return this.initBasket(api, divaNr, variantData, keepOldDivaNr, origProductId);
34383
+ return this.initBasket(api, divaNr, variantData);
34977
34384
  case 6:
34978
34385
  return _context7.abrupt("return", _context7.sent);
34979
34386
  case 9:
34980
34387
  _context7.prev = 9;
34981
34388
  _context7.t0 = _context7["catch"](0);
34982
- LOG$7.error(new DivaError('DivaNr konnte in der Datenbank nicht gefunden werden', {
34389
+ LOG$7.error(new DivaError('DivaNr cannot be found in Database', {
34983
34390
  code: 'WC_0004',
34984
34391
  custom: {
34985
34392
  divaNr: divaNr
@@ -34992,7 +34399,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
34992
34399
  }
34993
34400
  }, _callee7, this, [[0, 9]]);
34994
34401
  }));
34995
- function loadBasketByDivaNr(_x13, _x14, _x15, _x16) {
34402
+ function loadBasketByDivaNr(_x12, _x13) {
34996
34403
  return _loadBasketByDivaNr.apply(this, arguments);
34997
34404
  }
34998
34405
  return loadBasketByDivaNr;
@@ -35005,98 +34412,65 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35005
34412
  return _regeneratorRuntime.wrap(function _callee8$(_context8) {
35006
34413
  while (1) switch (_context8.prev = _context8.next) {
35007
34414
  case 0:
35008
- _context8.next = 2;
34415
+ _context8.prev = 0;
34416
+ _context8.next = 3;
35009
34417
  return api.getDataCache(api.getProductBasketUrl(key, productId), undefined, undefined, 'catalog', 'POST', {
35010
34418
  fields: fields !== null && fields !== void 0 && fields.length ? fields : undefined
35011
34419
  });
35012
- case 2:
34420
+ case 3:
35013
34421
  variantData = _context8.sent;
35014
34422
  if (!(variantData.Error || !variantData.basket)) {
35015
- _context8.next = 8;
34423
+ _context8.next = 9;
35016
34424
  break;
35017
34425
  }
35018
- LOG$7.error(new DivaError('ProductId konnte in der Datenbank nicht gefunden werden', {
34426
+ LOG$7.error(new DivaError('CustomProductId cannot be found in Database', {
35019
34427
  code: 'WC_0005',
35020
34428
  custom: {
34429
+ key: key,
35021
34430
  productId: productId
35022
34431
  }
35023
34432
  }));
35024
34433
  return _context8.abrupt("return", false);
35025
- case 8:
35026
- return _context8.abrupt("return", this.initBasket(api, variantData.basket.DivaNr, variantData, undefined, productId));
35027
34434
  case 9:
34435
+ return _context8.abrupt("return", this.initBasket(api, variantData.basket.DivaNr, variantData, undefined, productId));
34436
+ case 10:
34437
+ _context8.next = 16;
34438
+ break;
34439
+ case 12:
34440
+ _context8.prev = 12;
34441
+ _context8.t0 = _context8["catch"](0);
34442
+ LOG$7.error(new DivaError('Error while fetching product data', {
34443
+ code: 'WC_0005',
34444
+ custom: {
34445
+ productId: productId
34446
+ }
34447
+ }));
34448
+ return _context8.abrupt("return", false);
34449
+ case 16:
35028
34450
  case "end":
35029
34451
  return _context8.stop();
35030
34452
  }
35031
- }, _callee8, this);
34453
+ }, _callee8, this, [[0, 12]]);
35032
34454
  }));
35033
- function loadBasketByCustomProductId(_x17, _x18, _x19, _x20) {
34455
+ function loadBasketByCustomProductId(_x14, _x15, _x16, _x17) {
35034
34456
  return _loadBasketByCustomProductId.apply(this, arguments);
35035
34457
  }
35036
34458
  return loadBasketByCustomProductId;
35037
34459
  }()
35038
34460
  }, {
35039
- key: "loadProduct",
34461
+ key: "getProduct",
35040
34462
  value: function () {
35041
- var _loadProduct = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(api, productId, keepOldDivaNr) {
35042
- var result, divaNr, id, successfully;
34463
+ var _getProduct = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(api, productId) {
34464
+ var result;
35043
34465
  return _regeneratorRuntime.wrap(function _callee9$(_context9) {
35044
34466
  while (1) switch (_context9.prev = _context9.next) {
35045
34467
  case 0:
35046
34468
  _context9.next = 2;
35047
- return this.getProduct(api, productId);
35048
- case 2:
35049
- result = _context9.sent;
35050
- if (!(result === false)) {
35051
- _context9.next = 5;
35052
- break;
35053
- }
35054
- return _context9.abrupt("return", false);
35055
- case 5:
35056
- divaNr = result.divaNr;
35057
- if (result.originDivaNr) {
35058
- divaNr = result.originDivaNr;
35059
- } else if (result.variantId !== undefined) {
35060
- id = result.variantId;
35061
- divaNr = result.divaNr + '_' + id.toString().padStart(4, '0');
35062
- }
35063
- _context9.next = 9;
35064
- return this.loadBasketByDivaNr(api, divaNr, keepOldDivaNr, productId);
35065
- case 9:
35066
- successfully = _context9.sent;
35067
- result.type = 'ProductId';
35068
- if (!successfully) {
35069
- _context9.next = 15;
35070
- break;
35071
- }
35072
- return _context9.abrupt("return", result);
35073
- case 15:
35074
- return _context9.abrupt("return", false);
35075
- case 16:
35076
- case "end":
35077
- return _context9.stop();
35078
- }
35079
- }, _callee9, this);
35080
- }));
35081
- function loadProduct(_x21, _x22, _x23) {
35082
- return _loadProduct.apply(this, arguments);
35083
- }
35084
- return loadProduct;
35085
- }()
35086
- }, {
35087
- key: "getProduct",
35088
- value: function () {
35089
- var _getProduct = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(api, productId) {
35090
- var result;
35091
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
35092
- while (1) switch (_context10.prev = _context10.next) {
35093
- case 0:
35094
- _context10.next = 2;
35095
34469
  return api.getDataCache(api.getProductUrl(productId), undefined, undefined, 'catalog');
35096
34470
  case 2:
35097
- result = _context10.sent;
34471
+ result = _context9.sent;
35098
34472
  if (!(result.Error || !result)) {
35099
- _context10.next = 6;
34473
+ _context9.next = 6;
35100
34474
  break;
35101
34475
  }
35102
34476
  LOG$7.error(new DivaError('ProductId konnte in der Datenbank nicht gefunden werden', {
@@ -35105,16 +34479,16 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35105
34479
  productId: productId
35106
34480
  }
35107
34481
  }));
35108
- return _context10.abrupt("return", false);
34482
+ return _context9.abrupt("return", false);
35109
34483
  case 6:
35110
- return _context10.abrupt("return", result[0]);
34484
+ return _context9.abrupt("return", result[0]);
35111
34485
  case 7:
35112
34486
  case "end":
35113
- return _context10.stop();
34487
+ return _context9.stop();
35114
34488
  }
35115
- }, _callee10);
34489
+ }, _callee9);
35116
34490
  }));
35117
- function getProduct(_x24, _x25) {
34491
+ function getProduct(_x18, _x19) {
35118
34492
  return _getProduct.apply(this, arguments);
35119
34493
  }
35120
34494
  return getProduct;
@@ -35122,15 +34496,14 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35122
34496
  }, {
35123
34497
  key: "createNewBasket",
35124
34498
  value: function () {
35125
- var _createNewBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(api, initObject, divaNr, lang) {
34499
+ var _createNewBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(api, initObject, divaNr, lang) {
35126
34500
  var setId, orderSet, basketInitObejct, basket;
35127
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
35128
- while (1) switch (_context11.prev = _context11.next) {
34501
+ return _regeneratorRuntime.wrap(function _callee10$(_context10) {
34502
+ while (1) switch (_context10.prev = _context10.next) {
35129
34503
  case 0:
35130
34504
  setId = 'PLANNING_' + Math.random().toString(36).substring(6);
35131
34505
  orderSet = new OrderSetData({
35132
34506
  SetID: setId,
35133
- MainPosNr: 1,
35134
34507
  AccountSessionGUID: initObject.accountSessionGuid,
35135
34508
  CatalogCodex: initObject.catalogCodex,
35136
34509
  CatalogGUID: initObject.catalogGuid,
@@ -35138,10 +34511,10 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35138
34511
  Favorites: new Favorites()
35139
34512
  });
35140
34513
  if (!(initObject.accountGuid && !orderSet.AccountSessionGUID)) {
35141
- _context11.next = 5;
34514
+ _context10.next = 5;
35142
34515
  break;
35143
34516
  }
35144
- _context11.next = 5;
34517
+ _context10.next = 5;
35145
34518
  return api.setAccountSessionGuid({
35146
34519
  os: orderSet,
35147
34520
  accountGuid: initObject.accountGuid,
@@ -35159,14 +34532,14 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35159
34532
  CustomerJourneyId: nanoid()
35160
34533
  };
35161
34534
  basket = new BasketData(basketInitObejct);
35162
- return _context11.abrupt("return", basket);
34535
+ return _context10.abrupt("return", basket);
35163
34536
  case 8:
35164
34537
  case "end":
35165
- return _context11.stop();
34538
+ return _context10.stop();
35166
34539
  }
35167
- }, _callee11);
34540
+ }, _callee10);
35168
34541
  }));
35169
- function createNewBasket(_x26, _x27, _x28, _x29) {
34542
+ function createNewBasket(_x20, _x21, _x22, _x23) {
35170
34543
  return _createNewBasket.apply(this, arguments);
35171
34544
  }
35172
34545
  return createNewBasket;
@@ -35185,11 +34558,11 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35185
34558
  }, {
35186
34559
  key: "saveToBasket",
35187
34560
  value: function () {
35188
- var _saveToBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(api, actBasket, returnTo) {
34561
+ var _saveToBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(api, actBasket, returnTo) {
35189
34562
  var _this$plannerConfig$c4, _this$_basketHandler, _api$getJwt;
35190
34563
  var response;
35191
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
35192
- while (1) switch (_context12.prev = _context12.next) {
34564
+ return _regeneratorRuntime.wrap(function _callee11$(_context11) {
34565
+ while (1) switch (_context11.prev = _context11.next) {
35193
34566
  case 0:
35194
34567
  LOG$7.startTransaction({
35195
34568
  event: 'SaveBasketOnAPI',
@@ -35201,12 +34574,12 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35201
34574
  actBasket.ReportConfigIdentifier = api.getReportConfigIdentifier();
35202
34575
  actBasket.PrintOptions = api.getPrintOptions(this.reportConfig);
35203
34576
  actBasket.ClientLanguage = api.getLanguage();
35204
- _context12.next = 8;
34577
+ _context11.next = 8;
35205
34578
  return DivaUtils.updateBasketOrgInfo(actBasket, this.plannerConfig.currentOrganization, this.plannerConfig.currentUser, this.plannerConfig.settings.keepSalesPersonDataInBasket);
35206
34579
  case 8:
35207
34580
  actBasket.UserLanguage = api.getLanguage();
35208
34581
  actBasket.PrintRetailLogo = (_this$plannerConfig$c4 = this.plannerConfig.currentOrganization) === null || _this$plannerConfig$c4 === void 0 ? void 0 : _this$plannerConfig$c4.logoUrl;
35209
- _context12.next = 12;
34582
+ _context11.next = 12;
35210
34583
  return (_this$_basketHandler = this._basketHandler) === null || _this$_basketHandler === void 0 ? void 0 : _this$_basketHandler.saveBasket({
35211
34584
  jwt: (_api$getJwt = api.getJwt()) !== null && _api$getJwt !== void 0 ? _api$getJwt : undefined,
35212
34585
  basket: actBasket,
@@ -35215,30 +34588,30 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35215
34588
  apiKey: api.getApiKey()
35216
34589
  });
35217
34590
  case 12:
35218
- response = _context12.sent;
34591
+ response = _context11.sent;
35219
34592
  if (!(response != 'ERROR_NO_BASKET_SAVED')) {
35220
- _context12.next = 17;
34593
+ _context11.next = 17;
35221
34594
  break;
35222
34595
  }
35223
34596
  this.baskets[this.actDivaNr] = new BasketData(response);
35224
- _context12.next = 19;
34597
+ _context11.next = 19;
35225
34598
  break;
35226
34599
  case 17:
35227
34600
  if (!(response === 'ERROR_NO_BASKET_SAVED' || response === 'ERROR_BASKET_AFTER_SAVE')) {
35228
- _context12.next = 19;
34601
+ _context11.next = 19;
35229
34602
  break;
35230
34603
  }
35231
- return _context12.abrupt("return", response);
34604
+ return _context11.abrupt("return", response);
35232
34605
  case 19:
35233
34606
  LOG$7.successTransaction('saveBasketOnAPI');
35234
- return _context12.abrupt("return", response === null || response === void 0 ? void 0 : response._id);
34607
+ return _context11.abrupt("return", response === null || response === void 0 ? void 0 : response._id);
35235
34608
  case 21:
35236
34609
  case "end":
35237
- return _context12.stop();
34610
+ return _context11.stop();
35238
34611
  }
35239
- }, _callee12, this);
34612
+ }, _callee11, this);
35240
34613
  }));
35241
- function saveToBasket(_x30, _x31, _x32) {
34614
+ function saveToBasket(_x24, _x25, _x26) {
35242
34615
  return _saveToBasket.apply(this, arguments);
35243
34616
  }
35244
34617
  return saveToBasket;
@@ -35351,61 +34724,53 @@ var DivaBasketHandler = /*#__PURE__*/function () {
35351
34724
  }, {
35352
34725
  key: "initWWSClient",
35353
34726
  value: function () {
35354
- var _initWWSClient = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13(wwsClient) {
35355
- var _yield$import, PfisterWWSHandler, _yield$import2, LiviqueWWSHandler, _yield$import3, SeriousWWSHandler, _yield$import4, ProductWWSHandler, _yield$import5, StandardWWSHandler;
35356
- return _regeneratorRuntime.wrap(function _callee13$(_context13) {
35357
- while (1) switch (_context13.prev = _context13.next) {
34727
+ var _initWWSClient = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12(wwsClient) {
34728
+ var _yield$import, PfisterWWSHandler, _yield$import2, LiviqueWWSHandler, _yield$import3, SeriousWWSHandler, _yield$import4, StandardWWSHandler;
34729
+ return _regeneratorRuntime.wrap(function _callee12$(_context12) {
34730
+ while (1) switch (_context12.prev = _context12.next) {
35358
34731
  case 0:
35359
- _context13.t0 = wwsClient;
35360
- _context13.next = _context13.t0 === 'Pfister' ? 3 : _context13.t0 === 'Livique' ? 9 : _context13.t0 === 'Serious' ? 15 : _context13.t0 === 'Product' ? 21 : 27;
34732
+ _context12.t0 = wwsClient;
34733
+ _context12.next = _context12.t0 === 'Pfister' ? 3 : _context12.t0 === 'Livique' ? 9 : _context12.t0 === 'Serious' ? 15 : 21;
35361
34734
  break;
35362
34735
  case 3:
35363
- _context13.next = 5;
35364
- return import('./PfisterWWSHandler-ebfad71d.js');
34736
+ _context12.next = 5;
34737
+ return import('./PfisterWWSHandler-48eecaae.js');
35365
34738
  case 5:
35366
- _yield$import = _context13.sent;
34739
+ _yield$import = _context12.sent;
35367
34740
  PfisterWWSHandler = _yield$import["default"];
35368
34741
  this._divaWWSHandler = new PfisterWWSHandler();
35369
- return _context13.abrupt("break", 33);
34742
+ return _context12.abrupt("break", 27);
35370
34743
  case 9:
35371
- _context13.next = 11;
35372
- return import('./LiviqueWWSHandler-d401b8c4.js');
34744
+ _context12.next = 11;
34745
+ return import('./LiviqueWWSHandler-d83dd6af.js');
35373
34746
  case 11:
35374
- _yield$import2 = _context13.sent;
34747
+ _yield$import2 = _context12.sent;
35375
34748
  LiviqueWWSHandler = _yield$import2["default"];
35376
34749
  this._divaWWSHandler = new LiviqueWWSHandler();
35377
- return _context13.abrupt("break", 33);
34750
+ return _context12.abrupt("break", 27);
35378
34751
  case 15:
35379
- _context13.next = 17;
35380
- return import('./SeriousBasketHandler-53ff90b8.js');
34752
+ _context12.next = 17;
34753
+ return import('./SeriousBasketHandler-13fcc1aa.js');
35381
34754
  case 17:
35382
- _yield$import3 = _context13.sent;
34755
+ _yield$import3 = _context12.sent;
35383
34756
  SeriousWWSHandler = _yield$import3["default"];
35384
34757
  this._divaWWSHandler = new SeriousWWSHandler();
35385
- return _context13.abrupt("break", 33);
34758
+ return _context12.abrupt("break", 27);
35386
34759
  case 21:
35387
- _context13.next = 23;
35388
- return import('./ProductBasketHandler-68443648.js');
34760
+ _context12.next = 23;
34761
+ return import('./StandardWWSHandler-f96ca8c7.js');
35389
34762
  case 23:
35390
- _yield$import4 = _context13.sent;
35391
- ProductWWSHandler = _yield$import4["default"];
35392
- this._divaWWSHandler = new ProductWWSHandler();
35393
- return _context13.abrupt("break", 33);
35394
- case 27:
35395
- _context13.next = 29;
35396
- return import('./StandardWWSHandler-b903e37c.js');
35397
- case 29:
35398
- _yield$import5 = _context13.sent;
35399
- StandardWWSHandler = _yield$import5["default"];
34763
+ _yield$import4 = _context12.sent;
34764
+ StandardWWSHandler = _yield$import4["default"];
35400
34765
  this._divaWWSHandler = new StandardWWSHandler();
35401
- return _context13.abrupt("break", 33);
35402
- case 33:
34766
+ return _context12.abrupt("break", 27);
34767
+ case 27:
35403
34768
  case "end":
35404
- return _context13.stop();
34769
+ return _context12.stop();
35405
34770
  }
35406
- }, _callee13, this);
34771
+ }, _callee12, this);
35407
34772
  }));
35408
- function initWWSClient(_x33) {
34773
+ function initWWSClient(_x27) {
35409
34774
  return _initWWSClient.apply(this, arguments);
35410
34775
  }
35411
34776
  return initWWSClient;
@@ -36008,7 +35373,7 @@ var Rendering = /*#__PURE__*/function () {
36008
35373
  this.creationTime = new Date();
36009
35374
  this.layerMaskThreeTexture = undefined;
36010
35375
  this.hasStaticBackground = hasStaticBG;
36011
- this.mediaServiceSaveMode = mediaServiceSaveMode;
35376
+ this.mediaServiceSaveMode = mediaServiceSaveMode !== null && mediaServiceSaveMode !== void 0 ? mediaServiceSaveMode : 'STREAM';
36012
35377
  this.urlToSavedRendering = '';
36013
35378
  this.catalogData = {
36014
35379
  catalogCodex: '',
@@ -36053,12 +35418,12 @@ var Rendering = /*#__PURE__*/function () {
36053
35418
  }, {
36054
35419
  key: "getHasStaticBackground",
36055
35420
  value: function getHasStaticBackground() {
36056
- return this.hasStaticBackground;
35421
+ return !!this.hasStaticBackground;
36057
35422
  }
36058
35423
  }, {
36059
35424
  key: "getIsFullscreenRendering",
36060
35425
  value: function getIsFullscreenRendering() {
36061
- return this.isFullscreenRendering;
35426
+ return !!this.isFullscreenRendering;
36062
35427
  }
36063
35428
  }, {
36064
35429
  key: "setIsFullscreenRendering",
@@ -36068,12 +35433,13 @@ var Rendering = /*#__PURE__*/function () {
36068
35433
  }, {
36069
35434
  key: "getHasDimensionLines",
36070
35435
  value: function getHasDimensionLines() {
36071
- return this.hasDimensionLines;
35436
+ return !!this.hasDimensionLines;
36072
35437
  }
36073
35438
  }, {
36074
35439
  key: "getPlannerMeasureDigits",
36075
35440
  value: function getPlannerMeasureDigits() {
36076
- return this.plannerMeasureDigits;
35441
+ var _this$plannerMeasureD;
35442
+ return (_this$plannerMeasureD = this.plannerMeasureDigits) !== null && _this$plannerMeasureD !== void 0 ? _this$plannerMeasureD : 0;
36077
35443
  }
36078
35444
  }, {
36079
35445
  key: "getIsAlternateRendering",
@@ -36293,6 +35659,7 @@ var Rendering = /*#__PURE__*/function () {
36293
35659
  return this.catalogData.catalogCodex;
36294
35660
  },
36295
35661
  set: function set(val) {
35662
+ if (!val) return;
36296
35663
  this.catalogData.catalogCodex = val;
36297
35664
  }
36298
35665
  }, {
@@ -36301,6 +35668,7 @@ var Rendering = /*#__PURE__*/function () {
36301
35668
  return this.catalogData.catalogGUID;
36302
35669
  },
36303
35670
  set: function set(val) {
35671
+ if (!val) return;
36304
35672
  this.catalogData.catalogGUID = val;
36305
35673
  }
36306
35674
  }, {
@@ -36324,7 +35692,7 @@ var Rendering = /*#__PURE__*/function () {
36324
35692
  }, {
36325
35693
  key: "HasLayerMask",
36326
35694
  get: function get() {
36327
- return this.hasLayerMask;
35695
+ return !!this.hasLayerMask;
36328
35696
  },
36329
35697
  set: function set(hasLayerMask) {
36330
35698
  this.hasLayerMask = hasLayerMask;
@@ -36332,17 +35700,19 @@ var Rendering = /*#__PURE__*/function () {
36332
35700
  }, {
36333
35701
  key: "RenderWidth",
36334
35702
  get: function get() {
36335
- return this.renderWidth;
35703
+ var _this$renderWidth;
35704
+ return (_this$renderWidth = this.renderWidth) !== null && _this$renderWidth !== void 0 ? _this$renderWidth : 0;
36336
35705
  }
36337
35706
  }, {
36338
35707
  key: "RenderHeight",
36339
35708
  get: function get() {
36340
- return this.renderHeight;
35709
+ var _this$renderHeight;
35710
+ return (_this$renderHeight = this.renderHeight) !== null && _this$renderHeight !== void 0 ? _this$renderHeight : 0;
36341
35711
  }
36342
35712
  }, {
36343
35713
  key: "getHasLayerMask",
36344
35714
  value: function getHasLayerMask() {
36345
- return this.hasLayerMask;
35715
+ return !!this.hasLayerMask;
36346
35716
  }
36347
35717
  }, {
36348
35718
  key: "getLayerMaskForSrc",
@@ -36778,7 +36148,7 @@ var PlannerHandler3D = /*#__PURE__*/function () {
36778
36148
  while (1) switch (_context3.prev = _context3.next) {
36779
36149
  case 0:
36780
36150
  _context3.next = 2;
36781
- return import('./Host3DSignalR-45bb9e24.js');
36151
+ return import('./Host3DSignalR-bb7dd950.js');
36782
36152
  case 2:
36783
36153
  _yield$import = _context3.sent;
36784
36154
  Host3DSignalR = _yield$import["default"];
@@ -38330,7 +37700,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
38330
37700
  break;
38331
37701
  case 8:
38332
37702
  _context4.next = 10;
38333
- return import('./DivaStandardPlanner-c3f7e518.js');
37703
+ return import('./DivaStandardPlanner-ca3c5ef2.js');
38334
37704
  case 10:
38335
37705
  _yield$import = _context4.sent;
38336
37706
  DivaStandardPlanner = _yield$import["default"];
@@ -38341,7 +37711,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
38341
37711
  return _context4.abrupt("break", 21);
38342
37712
  case 15:
38343
37713
  _context4.next = 17;
38344
- return import('./DivaBoxPlanner-81bbe89c.js');
37714
+ return import('./DivaBoxPlanner-4ee51455.js');
38345
37715
  case 17:
38346
37716
  _yield$import2 = _context4.sent;
38347
37717
  DivaBoxPlanner = _yield$import2["default"];
@@ -38475,6 +37845,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
38475
37845
  key: "getSetImageAsUrl",
38476
37846
  value: (function () {
38477
37847
  var _getSetImageAsUrl = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(setId) {
37848
+ var _rendering$get3DDimIn, _rendering$get3DDimIn2, _rendering$get3DDimIn3;
38478
37849
  var rendering;
38479
37850
  return _regeneratorRuntime.wrap(function _callee6$(_context6) {
38480
37851
  while (1) switch (_context6.prev = _context6.next) {
@@ -38487,9 +37858,9 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
38487
37858
  return _context6.abrupt("return", {
38488
37859
  url: rendering === null || rendering === void 0 ? void 0 : rendering.UrlToSavedRendering,
38489
37860
  dimensions: {
38490
- w: rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().w,
38491
- h: rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().h,
38492
- d: rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().d
37861
+ w: ((_rendering$get3DDimIn = rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().w) !== null && _rendering$get3DDimIn !== void 0 ? _rendering$get3DDimIn : 0) > 0 ? rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().w : undefined,
37862
+ h: ((_rendering$get3DDimIn2 = rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().h) !== null && _rendering$get3DDimIn2 !== void 0 ? _rendering$get3DDimIn2 : 0) > 0 ? rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().h : undefined,
37863
+ d: ((_rendering$get3DDimIn3 = rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().d) !== null && _rendering$get3DDimIn3 !== void 0 ? _rendering$get3DDimIn3 : 0) > 0 ? rendering === null || rendering === void 0 ? void 0 : rendering.get3DDimInfo().d : undefined
38493
37864
  }
38494
37865
  });
38495
37866
  case 5:
@@ -39486,7 +38857,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39486
38857
  //Do also pass the correct price format
39487
38858
  (_this$actions = _this.actions) === null || _this$actions === void 0 || (_this$actions$toggleL = _this$actions.toggleLoading) === null || _this$actions$toggleL === void 0 || _this$actions$toggleL.call(_this$actions, 'SUMMARY');
39488
38859
  _context2.next = 6;
39489
- return summaryHandlerInstance.getSummaryItems(_this.sets, _this.doConfigure.bind(_this), _this.doAllowSetPlanner());
38860
+ return summaryHandlerInstance.getSummaryItems(_this.sets, _this.doConfigure.bind(_this));
39490
38861
  case 6:
39491
38862
  summaryItems = _context2.sent;
39492
38863
  (_this$updateSummaryIt = _this.updateSummaryItems) === null || _this$updateSummaryIt === void 0 || _this$updateSummaryIt.call(_this, summaryItems, setPriceFormat, summaryHandlerInstance.getSummaryStepWarning(_this.actSet(), summaryItems));
@@ -39571,11 +38942,12 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39571
38942
  _this.updateViewButtonsDependigOnConfigStructure();
39572
38943
  baseArticle = setHandlerInstance.getBaseParentArticleOfAccessoire(set, newArticle.basketId);
39573
38944
  if (!dontUpdateView) (_this$updateElementSe = _this.updateElementSelectionPlanner) === null || _this$updateElementSe === void 0 || _this$updateElementSe.call(_this, [baseArticle.setId], [baseArticle.elementId], true);
39574
- _context3.next = 29;
38945
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onAdd');
38946
+ _context3.next = 30;
39575
38947
  return _this.checkVariantData();
39576
- case 29:
39577
- return _context3.abrupt("return", 'ElementAdded');
39578
38948
  case 30:
38949
+ return _context3.abrupt("return", 'ElementAdded');
38950
+ case 31:
39579
38951
  case "end":
39580
38952
  return _context3.stop();
39581
38953
  }
@@ -39655,8 +39027,10 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39655
39027
  (_this$updateViewPlann3 = _this.updateViewPlannerElements) === null || _this$updateViewPlann3 === void 0 || _this$updateViewPlann3.call(_this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
39656
39028
  _this.updatePlannerView('ADD_ACC_ON_SHELF_PLANNER');
39657
39029
  }
39030
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onShelfAdd');
39031
+ _this.checkVariantData();
39658
39032
  return _context5.abrupt("return", retVal);
39659
- case 8:
39033
+ case 10:
39660
39034
  case "end":
39661
39035
  return _context5.stop();
39662
39036
  }
@@ -39700,7 +39074,9 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39700
39074
  _this.updateViewButtonsDependigOnConfigStructure();
39701
39075
  (_this$updateViewPlann5 = _this.updateViewPlannerElements) === null || _this$updateViewPlann5 === void 0 || _this$updateViewPlann5.call(_this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
39702
39076
  _this.updatePlannerView('DELETE_ACC_ON_SHELF_PLANNER');
39703
- case 9:
39077
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onShelfDelete');
39078
+ _this.checkVariantData();
39079
+ case 11:
39704
39080
  case "end":
39705
39081
  return _context6.stop();
39706
39082
  }
@@ -39758,22 +39134,24 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39758
39134
  _defineProperty(this, "updateAccessoireQuantity", /*#__PURE__*/function () {
39759
39135
  var _ref8 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(accessoireItem, relatedToBasketId, newQuantity, forceConfigSingle) {
39760
39136
  var _this$actions11, _this$actions11$toggl, _this$actions12, _this$actions12$toggl;
39761
- var ret;
39137
+ var set, ret;
39762
39138
  return _regeneratorRuntime.wrap(function _callee8$(_context8) {
39763
39139
  while (1) switch (_context8.prev = _context8.next) {
39764
39140
  case 0:
39141
+ set = _this.actSet();
39765
39142
  (_this$actions11 = _this.actions) === null || _this$actions11 === void 0 || (_this$actions11$toggl = _this$actions11.toggleLoading) === null || _this$actions11$toggl === void 0 || _this$actions11$toggl.call(_this$actions11, 'LoadingArticles_' + accessoireItem.articleCodex, false, true);
39766
- _context8.next = 3;
39767
- return setHandlerInstance.updateAccessoireQuantity(_this.actSet(), accessoireItem, relatedToBasketId, newQuantity, forceConfigSingle);
39768
- case 3:
39143
+ _context8.next = 4;
39144
+ return setHandlerInstance.updateAccessoireQuantity(set, accessoireItem, relatedToBasketId, newQuantity, forceConfigSingle);
39145
+ case 4:
39769
39146
  ret = _context8.sent;
39770
39147
  (_this$actions12 = _this.actions) === null || _this$actions12 === void 0 || (_this$actions12$toggl = _this$actions12.toggleLoading) === null || _this$actions12$toggl === void 0 || _this$actions12$toggl.call(_this$actions12, 'LoadingArticles_' + accessoireItem.articleCodex, false, false);
39771
39148
  if (ret.somethingChanged) _this.updateConfigStructure();
39772
39149
  _this.updatePlannerView('UPDATE_ACC_QUANTITY');
39773
39150
  _this.updatePriceInView();
39774
39151
  _this.updateViewButtonsDependigOnConfigStructure();
39152
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onAccessoireUpdate');
39775
39153
  _this.checkVariantData();
39776
- case 10:
39154
+ case 12:
39777
39155
  case "end":
39778
39156
  return _context8.stop();
39779
39157
  }
@@ -39801,9 +39179,10 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39801
39179
  _this.updatePriceInView();
39802
39180
  _this.updateViewButtonsDependigOnConfigStructure();
39803
39181
  }
39182
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onAccessoireDelete');
39804
39183
  _this.checkVariantData();
39805
39184
  return _context9.abrupt("return", wasDeleted);
39806
- case 7:
39185
+ case 8:
39807
39186
  case "end":
39808
39187
  return _context9.stop();
39809
39188
  }
@@ -39885,9 +39264,10 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39885
39264
  returnValues = _context11.sent;
39886
39265
  (_this$actions14 = _this.actions) === null || _this$actions14 === void 0 || (_this$actions14$toggl = _this$actions14.toggleLoading) === null || _this$actions14$toggl === void 0 || _this$actions14$toggl.call(_this$actions14, 'doConfigure', false, false);
39887
39266
  structure = setHandlerInstance.loadConfigStructureOfActSet(set, _this.getCurPlannerType());
39267
+ productHandlerInstance.updateProducts(_this.setsAsArray, _this.api, 'onConfig');
39888
39268
  _this.checkVariantData();
39889
39269
  if (dontUpdatePlannerView) {
39890
- _context11.next = 18;
39270
+ _context11.next = 19;
39891
39271
  break;
39892
39272
  }
39893
39273
  _this.updateConfiguratorStructure(structure);
@@ -39901,16 +39281,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
39901
39281
  _this.updateViewButtonsDependigOnConfigStructure();
39902
39282
  _this.updatePlannerView('DO_CONFIGURE', myValues);
39903
39283
  _this.updateWebConfiguratorTitle();
39904
- _context11.next = 18;
39284
+ _context11.next = 19;
39905
39285
  return _this.getFreePlacesOnGrids(undefined, 'doConfigure');
39906
- case 18:
39286
+ case 19:
39907
39287
  if (dontCallEvents) {
39908
- _context11.next = 21;
39288
+ _context11.next = 22;
39909
39289
  break;
39910
39290
  }
39911
- _context11.next = 21;
39291
+ _context11.next = 22;
39912
39292
  return _this.fillBaksetforOnWebPlanerConfigChange(myValues);
39913
- case 21:
39293
+ case 22:
39914
39294
  case "end":
39915
39295
  return _context11.stop();
39916
39296
  }
@@ -40036,11 +39416,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40036
39416
  case 12:
40037
39417
  loadSuccessful = _context13.sent;
40038
39418
  if (!loadSuccessful) {
40039
- _context13.next = 55;
39419
+ _context13.next = 58;
40040
39420
  break;
40041
39421
  }
40042
39422
  if (!(typeof loadSuccessful != 'boolean')) {
40043
- _context13.next = 23;
39423
+ _context13.next = 25;
40044
39424
  break;
40045
39425
  }
40046
39426
  if (!(loadSuccessful.type == 'ProductList')) {
@@ -40057,53 +39437,49 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40057
39437
  (_this$actions15 = this.actions) === null || _this$actions15 === void 0 || (_this$actions15$toggl = _this$actions15.toggleLoading) === null || _this$actions15$toggl === void 0 || _this$actions15$toggl.call(_this$actions15, 'Planner_Loading', false, false);
40058
39438
  return _context13.abrupt("return", true);
40059
39439
  case 23:
40060
- //TODO: get prices of matching product with more than one element
40061
-
40062
- //else if (DivaApiHandler.doCheckForProductsPrice()) {
40063
- // await DivaSetHandler.loadProductsOfSets(
40064
- // this.divaBasketHandler.getOrderSetsByDivaNr(this.divaNr),
40065
- // this.divaBasketHandler.actBasket.SetPlannerInfos?.InvolvedSetIds,
40066
- // );
40067
- //}
40068
-
39440
+ _context13.next = 26;
39441
+ break;
39442
+ case 25:
39443
+ if (this.api.doCheckForProductsPrice()) ;
39444
+ case 26:
40069
39445
  this.divaNr = this.divaBasketHandler.actDivaNr;
40070
39446
  initSetState = this.getInitStateForSet();
40071
39447
  this.plannerHandler.initPlanner(initSetState, this.getPlannerHandlerFunctions());
40072
- _context13.next = 28;
39448
+ _context13.next = 31;
40073
39449
  return setHandlerInstance.initSetsByOrderSet(this.divaBasketHandler.getOrderSetsByDivaNr(this.divaNr), initSetState);
40074
- case 28:
39450
+ case 31:
40075
39451
  set = this.actSet();
40076
39452
  if (!((_initSetState$api$web = initSetState.api.webConfig) !== null && _initSetState$api$web !== void 0 && _initSetState$api$web.checkForProductsPrice)) {
40077
- _context13.next = 40;
39453
+ _context13.next = 43;
40078
39454
  break;
40079
39455
  }
40080
39456
  if (!(typeof loadSuccessful != 'boolean' && loadSuccessful.type == 'ProductId')) {
40081
- _context13.next = 35;
39457
+ _context13.next = 38;
40082
39458
  break;
40083
39459
  }
40084
39460
  products = loadSuccessful;
40085
39461
  set === null || set === void 0 || set.remindPriceForHash(products);
40086
- _context13.next = 40;
39462
+ _context13.next = 43;
40087
39463
  break;
40088
- case 35:
39464
+ case 38:
40089
39465
  if (!this.divaBasketHandler.actBasket.OrigProductId) {
40090
- _context13.next = 40;
39466
+ _context13.next = 43;
40091
39467
  break;
40092
39468
  }
40093
- _context13.next = 38;
39469
+ _context13.next = 41;
40094
39470
  return this.divaBasketHandler.getProduct(this.api, this.divaBasketHandler.actBasket.OrigProductId);
40095
- case 38:
39471
+ case 41:
40096
39472
  result = _context13.sent;
40097
39473
  if (result) {
40098
39474
  set === null || set === void 0 || set.remindPriceForHash(result);
40099
39475
  }
40100
- case 40:
40101
- _context13.next = 42;
39476
+ case 43:
39477
+ _context13.next = 45;
40102
39478
  return viewReadyPromise;
40103
- case 42:
40104
- _context13.next = 44;
39479
+ case 45:
39480
+ _context13.next = 47;
40105
39481
  return this.initView();
40106
- case 44:
39482
+ case 47:
40107
39483
  (_this$actions16 = this.actions) === null || _this$actions16 === void 0 || _this$actions16.onEvent({
40108
39484
  type: 'onConfiguratorReady'
40109
39485
  });
@@ -40127,11 +39503,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40127
39503
  divaNr: basket.DivaNr,
40128
39504
  documentVersion: basket.DocumentVersion.toString()
40129
39505
  });
40130
- _context13.next = 52;
39506
+ _context13.next = 55;
40131
39507
  return this.fillBaksetforOnWebPlanerConfigChange(undefined, true);
40132
- case 52:
40133
- return _context13.abrupt("return", true);
40134
39508
  case 55:
39509
+ return _context13.abrupt("return", true);
39510
+ case 58:
40135
39511
  this.onInitializationError();
40136
39512
  //fehler beim laden vom basket..
40137
39513
  LOG$1.errorTransaction('LOADING_BASKET', 'BASKET_0002', 'Fehler beim Laden des Baskets', {
@@ -40149,7 +39525,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40149
39525
  plannerMode: this.getCurImageMode(),*/
40150
39526
  });
40151
39527
  return _context13.abrupt("return", false);
40152
- case 58:
39528
+ case 61:
40153
39529
  case "end":
40154
39530
  return _context13.stop();
40155
39531
  }
@@ -40311,7 +39687,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40311
39687
  break;
40312
39688
  }
40313
39689
  (_this$initConfigurato = this.initConfiguratorStructure) === null || _this$initConfigurato === void 0 || _this$initConfigurato.call(this, setHandlerInstance.loadConfigStructureForOnlyProductsList());
40314
- _context15.next = 17;
39690
+ _context15.next = 18;
40315
39691
  break;
40316
39692
  case 7:
40317
39693
  _context15.next = 9;
@@ -40326,11 +39702,12 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40326
39702
  (_this$updateViewPlann9 = this.updateViewPlannerElements) === null || _this$updateViewPlann9 === void 0 || _this$updateViewPlann9.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set), set.getSetId(), set.firstElementId);
40327
39703
  this.updatePlannerView('INIT_VIEW');
40328
39704
  this.onBasketInitialized();
39705
+ productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onInit');
40329
39706
  this.checkVariantData();
40330
- case 17:
40331
- _context15.next = 19;
39707
+ case 18:
39708
+ _context15.next = 20;
40332
39709
  return this.runInitMode(plannerMode);
40333
- case 19:
39710
+ case 20:
40334
39711
  case "end":
40335
39712
  return _context15.stop();
40336
39713
  }
@@ -40429,31 +39806,32 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40429
39806
  i = 0;
40430
39807
  case 8:
40431
39808
  if (!(i < orderSets.length)) {
40432
- _context17.next = 23;
39809
+ _context17.next = 24;
40433
39810
  break;
40434
39811
  }
40435
39812
  orderset = orderSets[i];
40436
39813
  lastSetToInitialize = setHandlerInstance.getOrderSetShouldInitPlanner(orderSets, i);
40437
39814
  loadedSet = setHandlerInstance.findLoadedSet(this.sets, orderset.CatalogCodex, orderset.AccountGUID);
40438
39815
  if (!loadedSet) {
40439
- _context17.next = 17;
39816
+ _context17.next = 18;
40440
39817
  break;
40441
39818
  }
40442
39819
  _context17.next = 15;
40443
39820
  return setHandlerInstance.addOrderSetArticlesToExistingSet(loadedSet, orderset, lastSetToInitialize);
40444
39821
  case 15:
40445
- _context17.next = 19;
39822
+ productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onAdd');
39823
+ _context17.next = 20;
40446
39824
  break;
40447
- case 17:
40448
- _context17.next = 19;
39825
+ case 18:
39826
+ _context17.next = 20;
40449
39827
  return setHandlerInstance.initSet(orderset, this.getInitStateForSet(), lastSetToInitialize);
40450
- case 19:
40451
- this.cleanUpEmptySets(true);
40452
39828
  case 20:
39829
+ this.cleanUpEmptySets(true);
39830
+ case 21:
40453
39831
  i++;
40454
39832
  _context17.next = 8;
40455
39833
  break;
40456
- case 23:
39834
+ case 24:
40457
39835
  this.divaBasketHandler.actBasket.OrderSets = [];
40458
39836
  this.updatePriceInView();
40459
39837
  this.updateWebConfiguratorTitle();
@@ -40461,7 +39839,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40461
39839
  (_this$updateViewPlann10 = this.updateViewPlannerElements) === null || _this$updateViewPlann10 === void 0 || _this$updateViewPlann10.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
40462
39840
  articlesKeys = Object.keys(this.actSet().getDivaArticles());
40463
39841
  this.loadPaletteInfos(undefined, [articlesKeys[0]], articlesKeys);
40464
- case 30:
39842
+ case 31:
40465
39843
  case "end":
40466
39844
  return _context17.stop();
40467
39845
  }
@@ -40472,37 +39850,6 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40472
39850
  }
40473
39851
  return addSetToActPlanningByDivaNr;
40474
39852
  }()
40475
- }, {
40476
- key: "initProductId",
40477
- value: function () {
40478
- var _initProductId = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee18(productId) {
40479
- var loadSuccessful;
40480
- return _regeneratorRuntime.wrap(function _callee18$(_context18) {
40481
- while (1) switch (_context18.prev = _context18.next) {
40482
- case 0:
40483
- _context18.next = 2;
40484
- return this.divaBasketHandler.initProductId(this.api, productId, true);
40485
- case 2:
40486
- loadSuccessful = _context18.sent;
40487
- if (!(typeof loadSuccessful != 'boolean')) {
40488
- _context18.next = 6;
40489
- break;
40490
- }
40491
- setHandlerInstance.addProducts([loadSuccessful], []);
40492
- return _context18.abrupt("return", loadSuccessful.divaNr);
40493
- case 6:
40494
- return _context18.abrupt("return", false);
40495
- case 7:
40496
- case "end":
40497
- return _context18.stop();
40498
- }
40499
- }, _callee18, this);
40500
- }));
40501
- function initProductId(_x49) {
40502
- return _initProductId.apply(this, arguments);
40503
- }
40504
- return initProductId;
40505
- }()
40506
39853
  }, {
40507
39854
  key: "cleanUpEmptySets",
40508
39855
  value: function cleanUpEmptySets(ignoreActSet) {
@@ -40531,28 +39878,28 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40531
39878
  }, {
40532
39879
  key: "setActSetCurConfigStepKey",
40533
39880
  value: function () {
40534
- var _setActSetCurConfigStepKey = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee19(curConfigStepKey) {
39881
+ var _setActSetCurConfigStepKey = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee18(curConfigStepKey) {
40535
39882
  var set;
40536
- return _regeneratorRuntime.wrap(function _callee19$(_context19) {
40537
- while (1) switch (_context19.prev = _context19.next) {
39883
+ return _regeneratorRuntime.wrap(function _callee18$(_context18) {
39884
+ while (1) switch (_context18.prev = _context18.next) {
40538
39885
  case 0:
40539
39886
  set = this.actSet();
40540
39887
  if (set) {
40541
- _context19.next = 3;
39888
+ _context18.next = 3;
40542
39889
  break;
40543
39890
  }
40544
- return _context19.abrupt("return");
39891
+ return _context18.abrupt("return");
40545
39892
  case 3:
40546
39893
  set.ActConfigStepKey = curConfigStepKey;
40547
- _context19.next = 6;
39894
+ _context18.next = 6;
40548
39895
  return setHandlerInstance.updateNavigation(set);
40549
39896
  case 6:
40550
39897
  case "end":
40551
- return _context19.stop();
39898
+ return _context18.stop();
40552
39899
  }
40553
- }, _callee19, this);
39900
+ }, _callee18, this);
40554
39901
  }));
40555
- function setActSetCurConfigStepKey(_x50) {
39902
+ function setActSetCurConfigStepKey(_x49) {
40556
39903
  return _setActSetCurConfigStepKey.apply(this, arguments);
40557
39904
  }
40558
39905
  return setActSetCurConfigStepKey;
@@ -40691,17 +40038,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40691
40038
  }, {
40692
40039
  key: "deletePlannerElement",
40693
40040
  value: function () {
40694
- var _deletePlannerElement = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee20(setId, elementId, denyElementSelectionClear) {
40041
+ var _deletePlannerElement = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee19(setId, elementId, denyElementSelectionClear) {
40695
40042
  var _this$updateViewPlann11;
40696
40043
  var set, result, _this$updateElementSe5, _this$updateElementSe6;
40697
- return _regeneratorRuntime.wrap(function _callee20$(_context20) {
40698
- while (1) switch (_context20.prev = _context20.next) {
40044
+ return _regeneratorRuntime.wrap(function _callee19$(_context19) {
40045
+ while (1) switch (_context19.prev = _context19.next) {
40699
40046
  case 0:
40700
40047
  set = this.sets[setId];
40701
- _context20.next = 3;
40048
+ _context19.next = 3;
40702
40049
  return setHandlerInstance.deleteElementFromSetByElemId(set, elementId, true);
40703
40050
  case 3:
40704
- result = _context20.sent;
40051
+ result = _context19.sent;
40705
40052
  this.updateConfigStructure();
40706
40053
  (_this$updateViewPlann11 = this.updateViewPlannerElements) === null || _this$updateViewPlann11 === void 0 || _this$updateViewPlann11.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
40707
40054
  this.updatePlannerView('DELETE_PLANNER_ELEMENT');
@@ -40711,16 +40058,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40711
40058
  if (result.selectElementId) (_this$updateElementSe5 = this.updateElementSelectionPlanner) === null || _this$updateElementSe5 === void 0 || _this$updateElementSe5.call(this, [result.setId], [result.selectElementId], true);else (_this$updateElementSe6 = this.updateElementSelectionPlanner) === null || _this$updateElementSe6 === void 0 || _this$updateElementSe6.call(this, [], [], true);
40712
40059
  }
40713
40060
  this.updatePriceInView();
40061
+ productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onDelete');
40714
40062
  this.checkVariantData();
40715
- _context20.next = 14;
40063
+ _context19.next = 15;
40716
40064
  return this.getFreePlacesOnGrids(undefined, 'deleteElement');
40717
- case 14:
40065
+ case 15:
40718
40066
  case "end":
40719
- return _context20.stop();
40067
+ return _context19.stop();
40720
40068
  }
40721
- }, _callee20, this);
40069
+ }, _callee19, this);
40722
40070
  }));
40723
- function deletePlannerElement(_x51, _x52, _x53) {
40071
+ function deletePlannerElement(_x50, _x51, _x52) {
40724
40072
  return _deletePlannerElement.apply(this, arguments);
40725
40073
  }
40726
40074
  return deletePlannerElement;
@@ -40734,17 +40082,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40734
40082
  }, {
40735
40083
  key: "copyPlannerElement",
40736
40084
  value: (function () {
40737
- var _copyPlannerElement = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee21(setId, elementId, curConfigKey, copyInfo) {
40085
+ var _copyPlannerElement = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee20(setId, elementId, curConfigKey, copyInfo) {
40738
40086
  var _this$updateViewPlann12;
40739
40087
  var set, newSelectedArticle, newConfigStepKey, _this$updateElementSe7, baseArticle;
40740
- return _regeneratorRuntime.wrap(function _callee21$(_context21) {
40741
- while (1) switch (_context21.prev = _context21.next) {
40088
+ return _regeneratorRuntime.wrap(function _callee20$(_context20) {
40089
+ while (1) switch (_context20.prev = _context20.next) {
40742
40090
  case 0:
40743
40091
  set = this.sets[setId];
40744
- _context21.next = 3;
40092
+ _context20.next = 3;
40745
40093
  return setHandlerInstance.copyPlannerElement(set, elementId, copyInfo);
40746
40094
  case 3:
40747
- newSelectedArticle = _context21.sent;
40095
+ newSelectedArticle = _context20.sent;
40748
40096
  this.updateConfigStructure();
40749
40097
  (_this$updateViewPlann12 = this.updateViewPlannerElements) === null || _this$updateViewPlann12 === void 0 || _this$updateViewPlann12.call(this, setHandlerInstance.getAllViewPlannerElements(set), setHandlerInstance.getAllVisualiedNotPlannedElements(set));
40750
40098
  this.updatePlannerView('COPY_PLANNER_ELEMENT');
@@ -40757,17 +40105,18 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40757
40105
  baseArticle = setHandlerInstance.getBaseParentArticleOfAccessoire(set, newSelectedArticle.basketId);
40758
40106
  (_this$updateElementSe7 = this.updateElementSelectionPlanner) === null || _this$updateElementSe7 === void 0 || _this$updateElementSe7.call(this, [baseArticle.setId], [baseArticle.elementId], true);
40759
40107
  }
40760
- _context21.next = 13;
40108
+ productHandlerInstance.updateProducts(this.setsAsArray, this.api, 'onCopy');
40109
+ _context20.next = 14;
40761
40110
  return this.checkVariantData();
40762
- case 13:
40763
- return _context21.abrupt("return", newConfigStepKey);
40764
40111
  case 14:
40112
+ return _context20.abrupt("return", newConfigStepKey);
40113
+ case 15:
40765
40114
  case "end":
40766
- return _context21.stop();
40115
+ return _context20.stop();
40767
40116
  }
40768
- }, _callee21, this);
40117
+ }, _callee20, this);
40769
40118
  }));
40770
- function copyPlannerElement(_x54, _x55, _x56, _x57) {
40119
+ function copyPlannerElement(_x53, _x54, _x55, _x56) {
40771
40120
  return _copyPlannerElement.apply(this, arguments);
40772
40121
  }
40773
40122
  return copyPlannerElement;
@@ -40796,33 +40145,33 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40796
40145
  }, {
40797
40146
  key: "getFreePlacesOnGrids",
40798
40147
  value: function () {
40799
- var _getFreePlacesOnGrids = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee22(gridGroup, from) {
40148
+ var _getFreePlacesOnGrids = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee21(gridGroup, from) {
40800
40149
  var _this$updateFreePlace;
40801
40150
  var set, freeShelfGrids, plannedShelfGrids;
40802
- return _regeneratorRuntime.wrap(function _callee22$(_context22) {
40803
- while (1) switch (_context22.prev = _context22.next) {
40151
+ return _regeneratorRuntime.wrap(function _callee21$(_context21) {
40152
+ while (1) switch (_context21.prev = _context21.next) {
40804
40153
  case 0:
40805
40154
  set = this.actSet();
40806
40155
  if (set) {
40807
- _context22.next = 3;
40156
+ _context21.next = 3;
40808
40157
  break;
40809
40158
  }
40810
40159
  throw new Error('getFreePlacesOnGrids: act set is not defined!');
40811
40160
  case 3:
40812
40161
  if (!gridGroup) {
40813
- _context22.next = 9;
40162
+ _context21.next = 9;
40814
40163
  break;
40815
40164
  }
40816
- _context22.next = 6;
40165
+ _context21.next = 6;
40817
40166
  return setHandlerInstance.getFreeShelfGrids(set, gridGroup);
40818
40167
  case 6:
40819
- _context22.t0 = _context22.sent;
40820
- _context22.next = 10;
40168
+ _context21.t0 = _context21.sent;
40169
+ _context21.next = 10;
40821
40170
  break;
40822
40171
  case 9:
40823
- _context22.t0 = undefined;
40172
+ _context21.t0 = undefined;
40824
40173
  case 10:
40825
- freeShelfGrids = _context22.t0;
40174
+ freeShelfGrids = _context21.t0;
40826
40175
  plannedShelfGrids = setHandlerInstance.getPlannedShelfGrids(set);
40827
40176
  LOG$1.debug('TOULA', 'freeShelfGrids', freeShelfGrids, 'plannedShelfGrids', plannedShelfGrids);
40828
40177
  LOG$1.debug('update free from: ' + from, 'freeShelfGrids', freeShelfGrids, 'plannedShelfGrids', plannedShelfGrids);
@@ -40830,17 +40179,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40830
40179
  freeShelfGrids: freeShelfGrids,
40831
40180
  plannedShelfGrids: plannedShelfGrids
40832
40181
  });
40833
- return _context22.abrupt("return", {
40182
+ return _context21.abrupt("return", {
40834
40183
  freeShelfGrids: freeShelfGrids,
40835
40184
  plannedShelfGrids: plannedShelfGrids
40836
40185
  });
40837
40186
  case 16:
40838
40187
  case "end":
40839
- return _context22.stop();
40188
+ return _context21.stop();
40840
40189
  }
40841
- }, _callee22, this);
40190
+ }, _callee21, this);
40842
40191
  }));
40843
- function getFreePlacesOnGrids(_x58, _x59) {
40192
+ function getFreePlacesOnGrids(_x57, _x58) {
40844
40193
  return _getFreePlacesOnGrids.apply(this, arguments);
40845
40194
  }
40846
40195
  return getFreePlacesOnGrids;
@@ -40857,36 +40206,36 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40857
40206
  }, {
40858
40207
  key: "moveShelfItemToGrid",
40859
40208
  value: function () {
40860
- var _moveShelfItemToGrid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee23(accessoireBasketId, parentBasketId, gridName, cellIndex) {
40209
+ var _moveShelfItemToGrid = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee22(accessoireBasketId, parentBasketId, gridName, cellIndex) {
40861
40210
  var set, newGridId;
40862
- return _regeneratorRuntime.wrap(function _callee23$(_context23) {
40863
- while (1) switch (_context23.prev = _context23.next) {
40211
+ return _regeneratorRuntime.wrap(function _callee22$(_context22) {
40212
+ while (1) switch (_context22.prev = _context22.next) {
40864
40213
  case 0:
40865
40214
  set = this.actSet();
40866
40215
  if (set) {
40867
- _context23.next = 3;
40216
+ _context22.next = 3;
40868
40217
  break;
40869
40218
  }
40870
- return _context23.abrupt("return");
40219
+ return _context22.abrupt("return");
40871
40220
  case 3:
40872
- _context23.next = 5;
40221
+ _context22.next = 5;
40873
40222
  return setHandlerInstance.moveShelfItemToGrid(set, accessoireBasketId, parentBasketId, gridName, cellIndex);
40874
40223
  case 5:
40875
- newGridId = _context23.sent;
40224
+ newGridId = _context22.sent;
40876
40225
  this.updatePlannerView('MOVE_SHELF_ITEM');
40877
40226
  if (!newGridId) {
40878
- _context23.next = 10;
40227
+ _context22.next = 10;
40879
40228
  break;
40880
40229
  }
40881
- _context23.next = 10;
40230
+ _context22.next = 10;
40882
40231
  return this.getFreePlacesOnGrids(newGridId, 'move shelf');
40883
40232
  case 10:
40884
40233
  case "end":
40885
- return _context23.stop();
40234
+ return _context22.stop();
40886
40235
  }
40887
- }, _callee23, this);
40236
+ }, _callee22, this);
40888
40237
  }));
40889
- function moveShelfItemToGrid(_x60, _x61, _x62, _x63) {
40238
+ function moveShelfItemToGrid(_x59, _x60, _x61, _x62) {
40890
40239
  return _moveShelfItemToGrid.apply(this, arguments);
40891
40240
  }
40892
40241
  return moveShelfItemToGrid;
@@ -40894,27 +40243,27 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40894
40243
  }, {
40895
40244
  key: "resetArticle",
40896
40245
  value: function () {
40897
- var _resetArticle = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee24(basketId) {
40246
+ var _resetArticle = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee23(basketId) {
40898
40247
  var set;
40899
- return _regeneratorRuntime.wrap(function _callee24$(_context24) {
40900
- while (1) switch (_context24.prev = _context24.next) {
40248
+ return _regeneratorRuntime.wrap(function _callee23$(_context23) {
40249
+ while (1) switch (_context23.prev = _context23.next) {
40901
40250
  case 0:
40902
40251
  set = this.actSet();
40903
40252
  if (set) {
40904
- _context24.next = 3;
40253
+ _context23.next = 3;
40905
40254
  break;
40906
40255
  }
40907
- return _context24.abrupt("return");
40256
+ return _context23.abrupt("return");
40908
40257
  case 3:
40909
- _context24.next = 5;
40258
+ _context23.next = 5;
40910
40259
  return setHandlerInstance.resetArticle(set, basketId);
40911
40260
  case 5:
40912
40261
  case "end":
40913
- return _context24.stop();
40262
+ return _context23.stop();
40914
40263
  }
40915
- }, _callee24, this);
40264
+ }, _callee23, this);
40916
40265
  }));
40917
- function resetArticle(_x64) {
40266
+ function resetArticle(_x63) {
40918
40267
  return _resetArticle.apply(this, arguments);
40919
40268
  }
40920
40269
  return resetArticle;
@@ -40922,27 +40271,27 @@ var DivaWebPlanner = /*#__PURE__*/function () {
40922
40271
  }, {
40923
40272
  key: "checkVariantData",
40924
40273
  value: function () {
40925
- var _checkVariantData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee25() {
40274
+ var _checkVariantData = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee24() {
40926
40275
  var somethingChanged;
40927
- return _regeneratorRuntime.wrap(function _callee25$(_context25) {
40928
- while (1) switch (_context25.prev = _context25.next) {
40276
+ return _regeneratorRuntime.wrap(function _callee24$(_context24) {
40277
+ while (1) switch (_context24.prev = _context24.next) {
40929
40278
  case 0:
40930
40279
  if (!this.api.getDoCheckVariantData()) {
40931
- _context25.next = 5;
40280
+ _context24.next = 5;
40932
40281
  break;
40933
40282
  }
40934
- _context25.next = 3;
40283
+ _context24.next = 3;
40935
40284
  return setHandlerInstance.checkVariantData(this.actSet());
40936
40285
  case 3:
40937
- somethingChanged = _context25.sent;
40286
+ somethingChanged = _context24.sent;
40938
40287
  if (somethingChanged) {
40939
40288
  this.updatePriceInView();
40940
40289
  }
40941
40290
  case 5:
40942
40291
  case "end":
40943
- return _context25.stop();
40292
+ return _context24.stop();
40944
40293
  }
40945
- }, _callee25, this);
40294
+ }, _callee24, this);
40946
40295
  }));
40947
40296
  function checkVariantData() {
40948
40297
  return _checkVariantData.apply(this, arguments);
@@ -41038,7 +40387,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41038
40387
  }, {
41039
40388
  key: "saveToBasketWrapper",
41040
40389
  value: function () {
41041
- var _saveToBasketWrapper = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee26(event, repairOnly, force) {
40390
+ var _saveToBasketWrapper = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee25(event, repairOnly, force) {
41042
40391
  var _this$actions25,
41043
40392
  _this$actions25$toggl,
41044
40393
  _this$actions26,
@@ -41046,48 +40395,46 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41046
40395
  _this2 = this,
41047
40396
  _this$actions30,
41048
40397
  _this$i18n14;
41049
- var returnTo, finalEvent, _this$api$getBarrierC, _this$openLeafeltBarr, product, _result, result, _this$actions27, _this$i18n8, _this$i18n9, _this$actions28, _this$i18n10, _this$i18n11, _this$actions29, _this$i18n12, _this$i18n13, _this$updatePlannerMs2, _this$actions31, _this$i18n15;
41050
- return _regeneratorRuntime.wrap(function _callee26$(_context26) {
41051
- while (1) switch (_context26.prev = _context26.next) {
40398
+ var returnTo, finalEvent, _this$api$getBarrierC, _this$openLeafeltBarr, product, result, _this$actions27, _this$i18n8, _this$i18n9, _this$actions28, _this$i18n10, _this$i18n11, _this$actions29, _this$i18n12, _this$i18n13, _this$updatePlannerMs2;
40399
+ return _regeneratorRuntime.wrap(function _callee25$(_context25) {
40400
+ while (1) switch (_context25.prev = _context25.next) {
41052
40401
  case 0:
41053
40402
  returnTo = this.getReturnTo(event);
41054
40403
  finalEvent = event;
41055
40404
  if (!(returnTo == 'OPEN_LEAFLET_BARRIER')) {
41056
- _context26.next = 16;
40405
+ _context25.next = 14;
41057
40406
  break;
41058
40407
  }
41059
40408
  product = undefined;
41060
40409
  if (!((_this$api$getBarrierC = this.api.getBarrierConfig()) !== null && _this$api$getBarrierC !== void 0 && _this$api$getBarrierC.affiliate)) {
41061
- _context26.next = 10;
40410
+ _context25.next = 8;
41062
40411
  break;
41063
40412
  }
41064
- _context26.next = 7;
40413
+ _context25.next = 7;
41065
40414
  return this.api.getDataCache(this.api.getCatalogProductUrl(this.actSet().getCatalogCodex()), undefined, undefined, 'catalog');
41066
40415
  case 7:
41067
- _result = _context26.sent;
41068
- productHandlerInstance.addProducts(_result, []);
41069
- product = productHandlerInstance.getBestMatch(this.getDivaArticles());
41070
- case 10:
41071
- _context26.next = 12;
40416
+ _context25.sent;
40417
+ case 8:
40418
+ _context25.next = 10;
41072
40419
  return (_this$openLeafeltBarr = this.openLeafeltBarrier) === null || _this$openLeafeltBarr === void 0 ? void 0 : _this$openLeafeltBarr.call(this, this.divaBasketHandler, this.api.getBarrierConfig(), product);
41073
- case 12:
41074
- finalEvent = _context26.sent;
40420
+ case 10:
40421
+ finalEvent = _context25.sent;
41075
40422
  if (finalEvent) {
41076
- _context26.next = 15;
40423
+ _context25.next = 13;
41077
40424
  break;
41078
40425
  }
41079
- return _context26.abrupt("return", 'canceled');
41080
- case 15:
40426
+ return _context25.abrupt("return", 'canceled');
40427
+ case 13:
41081
40428
  returnTo = finalEvent == 'onAddToBasket' ? 'OPEN_PDF' : returnTo;
41082
- case 16:
40429
+ case 14:
41083
40430
  (_this$actions25 = this.actions) === null || _this$actions25 === void 0 || (_this$actions25$toggl = _this$actions25.toggleLoading) === null || _this$actions25$toggl === void 0 || _this$actions25$toggl.call(_this$actions25, 'Planner_Saving', false, true);
41084
- _context26.next = 19;
40431
+ _context25.next = 17;
41085
40432
  return this.saveToBasket(finalEvent, repairOnly, force);
41086
- case 19:
41087
- result = _context26.sent;
40433
+ case 17:
40434
+ result = _context25.sent;
41088
40435
  (_this$actions26 = this.actions) === null || _this$actions26 === void 0 || (_this$actions26$toggl = _this$actions26.toggleLoading) === null || _this$actions26$toggl === void 0 || _this$actions26$toggl.call(_this$actions26, 'Planner_Saving', false, false);
41089
40436
  if (!(result === 'canceled')) {
41090
- _context26.next = 25;
40437
+ _context25.next = 23;
41091
40438
  break;
41092
40439
  }
41093
40440
  LOG$1.error(new DivaError('failed to save Basket'));
@@ -41095,12 +40442,12 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41095
40442
  text: ((_this$i18n8 = this.i18n()) === null || _this$i18n8 === void 0 ? void 0 : _this$i18n8.t('modal.general_error')) + ' --- ' + DivaUtils.formatDate(new Date(), true, undefined, true) + ' --- ' + DivaUtils.getCurrentTraceId() ? ((_this$i18n9 = this.i18n()) === null || _this$i18n9 === void 0 ? void 0 : _this$i18n9.t('modal.errorcode')) + ': ' + DivaUtils.getCurrentTraceId() : '',
41096
40443
  accept: true
41097
40444
  });
41098
- return _context26.abrupt("return", result);
41099
- case 25:
41100
- _context26.t0 = returnTo;
41101
- _context26.next = _context26.t0 === 'OPEN_PDF' ? 28 : _context26.t0 === 'SAVE_BASKET_WITH_MODAL' ? 30 : 31;
40445
+ return _context25.abrupt("return", result);
40446
+ case 23:
40447
+ _context25.t0 = returnTo;
40448
+ _context25.next = _context25.t0 === 'OPEN_PDF' ? 26 : _context25.t0 === 'SAVE_BASKET_WITH_MODAL' ? 28 : 29;
41102
40449
  break;
41103
- case 28:
40450
+ case 26:
41104
40451
  if (!this.getBasket().PDFDocumentURL) {
41105
40452
  LOG$1.error(new DivaError('PDF url is missing in basket', {
41106
40453
  code: 'WC_0010'
@@ -41118,39 +40465,28 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41118
40465
  }
41119
40466
  });
41120
40467
  }
41121
- return _context26.abrupt("break", 31);
41122
- case 30:
40468
+ return _context25.abrupt("break", 29);
40469
+ case 28:
41123
40470
  (_this$actions30 = this.actions) === null || _this$actions30 === void 0 || _this$actions30.openModal({
41124
40471
  text: (_this$i18n14 = this.i18n()) === null || _this$i18n14 === void 0 ? void 0 : _this$i18n14.t('modal.planning_saved'),
41125
40472
  accept: true
41126
40473
  });
41127
- case 31:
40474
+ case 29:
41128
40475
  if (!(result == 'noArticleToSave')) {
41129
- _context26.next = 34;
40476
+ _context25.next = 32;
41130
40477
  break;
41131
40478
  }
41132
40479
  (_this$updatePlannerMs2 = this.updatePlannerMsgContainer) === null || _this$updatePlannerMs2 === void 0 || _this$updatePlannerMs2.call(this, 'NOTHING_TO_SAVE', true, 'INFO', 'NOTHING_TO_SAVE', true);
41133
- return _context26.abrupt("return", 'canceled');
41134
- case 34:
41135
- if (!(result == 'payloadToBig')) {
41136
- _context26.next = 37;
41137
- break;
41138
- }
41139
- (_this$actions31 = this.actions) === null || _this$actions31 === void 0 || _this$actions31.openModal({
41140
- accept: true,
41141
- text: (_this$i18n15 = this.i18n()) === null || _this$i18n15 === void 0 ? void 0 : _this$i18n15.t('configurator.PAYLOAD_TO_BIG'),
41142
- title: 'modals.error_saving'
41143
- });
41144
- return _context26.abrupt("return", 'canceled');
41145
- case 37:
41146
- return _context26.abrupt("return", result);
41147
- case 38:
40480
+ return _context25.abrupt("return", 'canceled');
40481
+ case 32:
40482
+ return _context25.abrupt("return", result);
40483
+ case 33:
41148
40484
  case "end":
41149
- return _context26.stop();
40485
+ return _context25.stop();
41150
40486
  }
41151
- }, _callee26, this);
40487
+ }, _callee25, this);
41152
40488
  }));
41153
- function saveToBasketWrapper(_x65, _x66, _x67) {
40489
+ function saveToBasketWrapper(_x64, _x65, _x66) {
41154
40490
  return _saveToBasketWrapper.apply(this, arguments);
41155
40491
  }
41156
40492
  return saveToBasketWrapper;
@@ -41158,51 +40494,36 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41158
40494
  }, {
41159
40495
  key: "saveToBasket",
41160
40496
  value: function () {
41161
- var _saveToBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee27(event, repairOnly, force) {
41162
- var _returnTo, _event, _event2, _event3, _returnTo2, _returnTo3, _this$actions32, _this$actions33;
41163
- var set, actBasket, returnTo, oldReturnTo, count, basketData, bytes, result, newDivaNr, _result2, _event4, product;
41164
- return _regeneratorRuntime.wrap(function _callee27$(_context27) {
41165
- while (1) switch (_context27.prev = _context27.next) {
40497
+ var _saveToBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee26(event, repairOnly, force) {
40498
+ var _returnTo, _event, _event2, _event3, _returnTo2, _returnTo3, _this$actions31, _this$actions32, _this$actions33;
40499
+ var set, actBasket, returnTo, oldReturnTo, result, newDivaNr, _result2, _event4, product;
40500
+ return _regeneratorRuntime.wrap(function _callee26$(_context26) {
40501
+ while (1) switch (_context26.prev = _context26.next) {
41166
40502
  case 0:
41167
40503
  set = this.actSet();
41168
40504
  if (!(setHandlerInstance.isNoArticleToSave(this.sets) && !force)) {
41169
- _context27.next = 3;
40505
+ _context26.next = 3;
41170
40506
  break;
41171
40507
  }
41172
- return _context27.abrupt("return", 'noArticleToSave');
40508
+ return _context26.abrupt("return", 'noArticleToSave');
41173
40509
  case 3:
41174
40510
  actBasket = this.divaBasketHandler.actBasket;
41175
40511
  returnTo = this.getReturnTo(event);
41176
40512
  if (!((_returnTo = returnTo) !== null && _returnTo !== void 0 && _returnTo.startsWith('FAVORITS') && favoritesHandlerInstance.FavoritesDefined(set))) {
41177
- _context27.next = 22;
40513
+ _context26.next = 13;
41178
40514
  break;
41179
40515
  }
41180
40516
  oldReturnTo = returnTo;
41181
40517
  this.ReturnTo = returnTo.replace('FAVORITS_', '');
41182
- _context27.next = 10;
41183
- return this.getValidVariantsLength();
41184
- case 10:
41185
- count = _context27.sent;
41186
- _context27.next = 13;
41187
- return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, !!repairOnly, this.doAllowSetPlanner(), this.ReturnTo);
41188
- case 13:
41189
- basketData = _context27.sent;
41190
- bytes = new TextEncoder().encode(JSON.stringify(basketData.getAsJson())).length;
41191
- if (!(bytes * count > 15000000)) {
41192
- _context27.next = 17;
41193
- break;
41194
- }
41195
- return _context27.abrupt("return", 'payloadToBig');
41196
- case 17:
41197
- _context27.next = 19;
40518
+ _context26.next = 10;
41198
40519
  return this.handleFavorites('SAVE');
41199
- case 19:
41200
- result = _context27.sent;
40520
+ case 10:
40521
+ result = _context26.sent;
41201
40522
  if (result === 'canceled') {
41202
40523
  this.ReturnTo = oldReturnTo;
41203
40524
  }
41204
- return _context27.abrupt("return", result);
41205
- case 22:
40525
+ return _context26.abrupt("return", result);
40526
+ case 13:
41206
40527
  LOG$1.startTransaction({
41207
40528
  event: (_event = event) !== null && _event !== void 0 ? _event : 'onAddToBasket',
41208
40529
  message: 'Perform case: ' + ((_event2 = event) !== null && _event2 !== void 0 ? _event2 : 'onAddToBasket'),
@@ -41217,13 +40538,13 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41217
40538
  warningTime: 2000,
41218
40539
  errorTime: 4000
41219
40540
  });
41220
- _context27.t0 = this.divaBasketHandler;
41221
- _context27.t1 = this.divaBasketHandler.actDivaNr;
41222
- _context27.next = 27;
40541
+ _context26.t0 = this.divaBasketHandler;
40542
+ _context26.t1 = this.divaBasketHandler.actDivaNr;
40543
+ _context26.next = 18;
41223
40544
  return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, !!repairOnly, this.doAllowSetPlanner(), this.ReturnTo);
41224
- case 27:
41225
- _context27.t2 = _context27.sent;
41226
- _context27.t0.setBasketData.call(_context27.t0, _context27.t1, _context27.t2);
40545
+ case 18:
40546
+ _context26.t2 = _context26.sent;
40547
+ _context26.t0.setBasketData.call(_context26.t0, _context26.t1, _context26.t2);
41227
40548
  if ((_returnTo2 = returnTo) !== null && _returnTo2 !== void 0 && _returnTo2.endsWith('OPEN_SELLER_BASKET')) {
41228
40549
  this.ReturnTo = 'OPEN_SELLER_BASKET';
41229
40550
  returnTo = this.ReturnTo;
@@ -41239,13 +40560,14 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41239
40560
  actBasket.Updated = Date.now();
41240
40561
  LOG$1.successTransaction('FILL_BASKET');
41241
40562
  if (!returnTo) {
41242
- _context27.next = 63;
40563
+ _context26.next = 55;
41243
40564
  break;
41244
40565
  }
41245
- _context27.t3 = returnTo;
41246
- _context27.next = _context27.t3 === 'OPEN_SELLER_PRODUCTCREATOR' ? 39 : _context27.t3 === 'OPEN_SELLER_BASKET' ? 41 : _context27.t3 === 'OPEN_PDF' ? 43 : _context27.t3 === 'SAVE_BASKET_WITH_MODAL' ? 43 : _context27.t3 === 'SAVE_BASKET' ? 43 : _context27.t3 === 'SAVE_BASKET_SYNC' ? 43 : _context27.t3 === 'OPEN_LEAFLET_BARRIER' ? 43 : 63;
40566
+ _context26.t3 = returnTo;
40567
+ _context26.next = _context26.t3 === 'OPEN_SELLER_PRODUCTCREATOR' ? 30 : _context26.t3 === 'OPEN_SELLER_BASKET' ? 33 : _context26.t3 === 'OPEN_PDF' ? 35 : _context26.t3 === 'SAVE_BASKET_WITH_MODAL' ? 35 : _context26.t3 === 'SAVE_BASKET' ? 35 : _context26.t3 === 'SAVE_BASKET_SYNC' ? 35 : _context26.t3 === 'OPEN_LEAFLET_BARRIER' ? 35 : 55;
41247
40568
  break;
41248
- case 39:
40569
+ case 30:
40570
+ (_this$actions31 = this.actions) === null || _this$actions31 === void 0 || _this$actions31.toggleLoading('buildScene', false, false);
41249
40571
  (_this$actions32 = this.actions) === null || _this$actions32 === void 0 || _this$actions32.openComponent({
41250
40572
  type: 'SELLER',
41251
40573
  parameters: {
@@ -41253,12 +40575,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41253
40575
  divaNr: actBasket.DivaNr
41254
40576
  },
41255
40577
  internal: {
41256
- basketData: actBasket,
41257
- edited: true
40578
+ basketData: actBasket
41258
40579
  }
41259
40580
  });
41260
- return _context27.abrupt("break", 63);
41261
- case 41:
40581
+ return _context26.abrupt("break", 55);
40582
+ case 33:
41262
40583
  (_this$actions33 = this.actions) === null || _this$actions33 === void 0 || _this$actions33.openComponent({
41263
40584
  type: 'SELLER',
41264
40585
  parameters: {
@@ -41269,37 +40590,37 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41269
40590
  basketData: actBasket
41270
40591
  }
41271
40592
  });
41272
- return _context27.abrupt("break", 63);
41273
- case 43:
40593
+ return _context26.abrupt("break", 55);
40594
+ case 35:
41274
40595
  if (!(event == 'onSaveProduct')) {
41275
- _context27.next = 53;
40596
+ _context26.next = 45;
41276
40597
  break;
41277
40598
  }
41278
40599
  //copy basket, so we only save a copy as baseconfiguration and can continue working with the original basket
41279
40600
  actBasket = new BasketData(JSON.parse(JSON.stringify(actBasket)));
41280
- _context27.next = 47;
40601
+ _context26.next = 39;
41281
40602
  return DivaUtils.updateBasketOrgInfo(actBasket, this.plannerConfig.currentOrganization, this.plannerConfig.currentUser);
41282
- case 47:
41283
- _context27.next = 49;
40603
+ case 39:
40604
+ _context26.next = 41;
41284
40605
  return this.api.getDataWithoutCache(this.api.getUniqueNewDivaNr(), undefined, 'basket');
41285
- case 49:
41286
- newDivaNr = _context27.sent;
40606
+ case 41:
40607
+ newDivaNr = _context26.sent;
41287
40608
  actBasket.convertToBaseConfiguration(newDivaNr.divaNr);
41288
- _context27.next = 62;
40609
+ _context26.next = 54;
41289
40610
  break;
41290
- case 53:
40611
+ case 45:
41291
40612
  if (this.divaBasketHandler.basketWasSavedWithCurrentDocVersion) {
41292
40613
  this.divaBasketHandler.basketWasSavedWithCurrentDocVersion = undefined;
41293
40614
  actBasket.setDocumentVersion(actBasket.getDocumentVersion() + 1);
41294
40615
  }
41295
40616
  this.divaBasketHandler.basketWasSavedWithCurrentDocVersion = true;
41296
40617
  actBasket.setDivaNr(this.divaBasketHandler.actDivaNr.split('-').length > 2 ? this.divaBasketHandler.actDivaNr.split('-')[0] + '-' + this.divaBasketHandler.actDivaNr.split('-')[1] : this.divaBasketHandler.actDivaNr);
41297
- _context27.next = 58;
40618
+ _context26.next = 50;
41298
40619
  return this.divaBasketHandler.saveToBasket(this.api, actBasket, returnTo);
41299
- case 58:
41300
- _result2 = _context27.sent;
40620
+ case 50:
40621
+ _result2 = _context26.sent;
41301
40622
  if (!(_result2 === 'ERROR_NO_BASKET_SAVED' || _result2 === 'ERROR_BASKET_AFTER_SAVE')) {
41302
- _context27.next = 62;
40623
+ _context26.next = 54;
41303
40624
  break;
41304
40625
  }
41305
40626
  LOG$1.errorTransaction((_event4 = event) !== null && _event4 !== void 0 ? _event4 : 'onAddToBasket', 'WC_0019', 'Error saving basket', {
@@ -41308,23 +40629,23 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41308
40629
  status: this.getBasketData().Status,
41309
40630
  bv: set.getSetPrice() / 1000
41310
40631
  });
41311
- return _context27.abrupt("return", 'canceled');
41312
- case 62:
41313
- return _context27.abrupt("break", 63);
41314
- case 63:
40632
+ return _context26.abrupt("return", 'canceled');
40633
+ case 54:
40634
+ return _context26.abrupt("break", 55);
40635
+ case 55:
41315
40636
  if (returnTo == 'DONT_SAVE_BASKET') event = 'dontSaveBasket';
41316
- _context27.next = 66;
40637
+ _context26.next = 58;
41317
40638
  return this.addToBasket(actBasket, event);
41318
- case 66:
41319
- product = _context27.sent;
41320
- return _context27.abrupt("return", product !== null && product !== void 0 ? product : 'saved');
41321
- case 68:
40639
+ case 58:
40640
+ product = _context26.sent;
40641
+ return _context26.abrupt("return", product !== null && product !== void 0 ? product : 'saved');
40642
+ case 60:
41322
40643
  case "end":
41323
- return _context27.stop();
40644
+ return _context26.stop();
41324
40645
  }
41325
- }, _callee27, this);
40646
+ }, _callee26, this);
41326
40647
  }));
41327
- function saveToBasket(_x68, _x69, _x70) {
40648
+ function saveToBasket(_x67, _x68, _x69) {
41328
40649
  return _saveToBasket.apply(this, arguments);
41329
40650
  }
41330
40651
  return saveToBasket;
@@ -41525,16 +40846,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41525
40846
  }, {
41526
40847
  key: "getEnableUnityRtvKombi",
41527
40848
  value: function getEnableUnityRtvKombi() {
41528
- var _this$actSet24;
40849
+ var _this$actSet24, _this$actSet25;
41529
40850
  // if force rtv disable unity kombi - biohort
41530
40851
  if ((_this$actSet24 = this.actSet()) !== null && _this$actSet24 !== void 0 && _this$actSet24.CatalogData.divaForceRTV) return false;
41531
- return this.api.getEnableRTVUnityKombi();
40852
+ return ((_this$actSet25 = this.actSet()) === null || _this$actSet25 === void 0 ? void 0 : _this$actSet25.CatalogData.divaArReady) == true && this.api.getEnableRTVUnityKombi();
41532
40853
  }
41533
40854
  }, {
41534
40855
  key: "getShelfPlannerRTV",
41535
40856
  value: function getShelfPlannerRTV() {
41536
- var _this$actSet25;
41537
- return (_this$actSet25 = this.actSet()) === null || _this$actSet25 === void 0 ? void 0 : _this$actSet25.CatalogData.useShelfPlannerRTV;
40857
+ var _this$actSet26;
40858
+ return (_this$actSet26 = this.actSet()) === null || _this$actSet26 === void 0 ? void 0 : _this$actSet26.CatalogData.useShelfPlannerRTV;
41538
40859
  }
41539
40860
  }, {
41540
40861
  key: "getBasketData",
@@ -41549,23 +40870,23 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41549
40870
  }, {
41550
40871
  key: "getBasketDataWithEkText",
41551
40872
  value: function () {
41552
- var _getBasketDataWithEkText = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee28() {
41553
- return _regeneratorRuntime.wrap(function _callee28$(_context28) {
41554
- while (1) switch (_context28.prev = _context28.next) {
40873
+ var _getBasketDataWithEkText = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee27() {
40874
+ return _regeneratorRuntime.wrap(function _callee27$(_context27) {
40875
+ while (1) switch (_context27.prev = _context27.next) {
41555
40876
  case 0:
41556
- _context28.t0 = this.divaBasketHandler;
41557
- _context28.t1 = this.divaBasketHandler.actDivaNr;
41558
- _context28.next = 4;
40877
+ _context27.t0 = this.divaBasketHandler;
40878
+ _context27.t1 = this.divaBasketHandler.actDivaNr;
40879
+ _context27.next = 4;
41559
40880
  return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, true, this.doAllowSetPlanner(), this.ReturnTo);
41560
40881
  case 4:
41561
- _context28.t2 = _context28.sent;
41562
- _context28.t0.setBasketData.call(_context28.t0, _context28.t1, _context28.t2);
41563
- return _context28.abrupt("return", this.divaBasketHandler.actBasket);
40882
+ _context27.t2 = _context27.sent;
40883
+ _context27.t0.setBasketData.call(_context27.t0, _context27.t1, _context27.t2);
40884
+ return _context27.abrupt("return", this.divaBasketHandler.actBasket);
41564
40885
  case 7:
41565
40886
  case "end":
41566
- return _context28.stop();
40887
+ return _context27.stop();
41567
40888
  }
41568
- }, _callee28, this);
40889
+ }, _callee27, this);
41569
40890
  }));
41570
40891
  function getBasketDataWithEkText() {
41571
40892
  return _getBasketDataWithEkText.apply(this, arguments);
@@ -41575,8 +40896,8 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41575
40896
  }, {
41576
40897
  key: "getCatalogData",
41577
40898
  value: function getCatalogData() {
41578
- var _this$actSet26;
41579
- return (_this$actSet26 = this.actSet()) === null || _this$actSet26 === void 0 ? void 0 : _this$actSet26.CatalogData;
40899
+ var _this$actSet27;
40900
+ return (_this$actSet27 = this.actSet()) === null || _this$actSet27 === void 0 ? void 0 : _this$actSet27.CatalogData;
41580
40901
  }
41581
40902
  }, {
41582
40903
  key: "ReturnTo",
@@ -41591,7 +40912,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41591
40912
  }, {
41592
40913
  key: "addToBasket",
41593
40914
  value: function () {
41594
- var _addToBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee29(actBasket) {
40915
+ var _addToBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee28(actBasket) {
41595
40916
  var _this$actions34,
41596
40917
  _this$actions35,
41597
40918
  _this$actions36,
@@ -41610,14 +40931,14 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41610
40931
  to,
41611
40932
  variants,
41612
40933
  products,
41613
- _args29 = arguments;
41614
- return _regeneratorRuntime.wrap(function _callee29$(_context29) {
41615
- while (1) switch (_context29.prev = _context29.next) {
40934
+ _args28 = arguments;
40935
+ return _regeneratorRuntime.wrap(function _callee28$(_context28) {
40936
+ while (1) switch (_context28.prev = _context28.next) {
41616
40937
  case 0:
41617
- event = _args29.length > 1 && _args29[1] !== undefined ? _args29[1] : 'onAddToBasket';
40938
+ event = _args28.length > 1 && _args28[1] !== undefined ? _args28[1] : 'onAddToBasket';
41618
40939
  addToBasketLog = true;
41619
- _context29.t0 = event;
41620
- _context29.next = _context29.t0 === 'onWebPlanerPrint' ? 5 : _context29.t0 === 'onWebPlanerSave' ? 8 : _context29.t0 === 'onWebPlanerShare' ? 11 : _context29.t0 === 'onRequestConsulation' ? 14 : _context29.t0 === 'onSave' ? 17 : _context29.t0 === 'onSendEmail' ? 20 : _context29.t0 === 'onSaveProduct' ? 25 : _context29.t0 === 'dontSaveBasket' ? 33 : _context29.t0 === 'onAddToBasket' ? 35 : 35;
40940
+ _context28.t0 = event;
40941
+ _context28.next = _context28.t0 === 'onWebPlanerPrint' ? 5 : _context28.t0 === 'onWebPlanerSave' ? 8 : _context28.t0 === 'onWebPlanerShare' ? 11 : _context28.t0 === 'onRequestConsulation' ? 14 : _context28.t0 === 'onSave' ? 17 : _context28.t0 === 'onSendEmail' ? 20 : _context28.t0 === 'onSaveProduct' ? 25 : _context28.t0 === 'dontSaveBasket' ? 33 : _context28.t0 === 'onAddToBasket' ? 35 : 35;
41621
40942
  break;
41622
40943
  case 5:
41623
40944
  this.handleSuccessTransaction('onPrintBasket', actBasket);
@@ -41625,35 +40946,35 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41625
40946
  type: 'onWebPlanerPrint',
41626
40947
  data: actBasket.getAsJson()
41627
40948
  });
41628
- return _context29.abrupt("break", 38);
40949
+ return _context28.abrupt("break", 38);
41629
40950
  case 8:
41630
40951
  this.handleSuccessTransaction('onSaveBasket', actBasket);
41631
40952
  (_this$actions35 = this.actions) === null || _this$actions35 === void 0 || _this$actions35.onEvent({
41632
40953
  type: 'onWebPlanerSave',
41633
40954
  data: actBasket.getAsJson()
41634
40955
  });
41635
- return _context29.abrupt("break", 38);
40956
+ return _context28.abrupt("break", 38);
41636
40957
  case 11:
41637
40958
  this.handleSuccessTransaction('onShareBasket', actBasket);
41638
40959
  (_this$actions36 = this.actions) === null || _this$actions36 === void 0 || _this$actions36.onEvent({
41639
40960
  type: 'onWebPlanerShare',
41640
40961
  data: actBasket.getAsJson()
41641
40962
  });
41642
- return _context29.abrupt("break", 38);
40963
+ return _context28.abrupt("break", 38);
41643
40964
  case 14:
41644
40965
  this.handleSuccessTransaction('onRequestConsulation', actBasket);
41645
40966
  (_this$actions37 = this.actions) === null || _this$actions37 === void 0 || _this$actions37.onEvent({
41646
40967
  type: 'onRequestConsulation',
41647
40968
  data: actBasket.getAsJson()
41648
40969
  });
41649
- return _context29.abrupt("break", 38);
40970
+ return _context28.abrupt("break", 38);
41650
40971
  case 17:
41651
40972
  this.handleSuccessTransaction('onSave', actBasket);
41652
40973
  (_this$actions38 = this.actions) === null || _this$actions38 === void 0 || _this$actions38.onEvent({
41653
40974
  type: 'onSave',
41654
40975
  data: actBasket.getAsJson()
41655
40976
  });
41656
- return _context29.abrupt("break", 38);
40977
+ return _context28.abrupt("break", 38);
41657
40978
  case 20:
41658
40979
  emailConfig = (_this$divaBasketHandl3 = this.divaBasketHandler.emailConfig) !== null && _this$divaBasketHandl3 !== void 0 ? _this$divaBasketHandl3 : this.getEmailConfig(); //reset the emailConfig
41659
40980
  this.divaBasketHandler.emailConfig = undefined;
@@ -41689,23 +41010,23 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41689
41010
  type: 'onAddToBasket',
41690
41011
  data: actBasket.getAsJson()
41691
41012
  });
41692
- return _context29.abrupt("break", 38);
41013
+ return _context28.abrupt("break", 38);
41693
41014
  case 25:
41694
41015
  this.actSet().CatalogData;
41695
- _context29.next = 28;
41016
+ _context28.next = 28;
41696
41017
  return this.api.saveAsProduct(this.sets, actBasket);
41697
41018
  case 28:
41698
- products = _context29.sent;
41019
+ products = _context28.sent;
41699
41020
  this.handleSuccessTransaction('onSaveProduct', actBasket);
41700
41021
  (_this$actions40 = this.actions) === null || _this$actions40 === void 0 || _this$actions40.onEvent({
41701
41022
  type: 'onAddToBasket',
41702
41023
  data: actBasket.getAsJson()
41703
41024
  });
41704
41025
  if (!products) {
41705
- _context29.next = 33;
41026
+ _context28.next = 33;
41706
41027
  break;
41707
41028
  }
41708
- return _context29.abrupt("return", products[0]);
41029
+ return _context28.abrupt("return", products[0]);
41709
41030
  case 33:
41710
41031
  this.handleSuccessTransaction('onAddToBasketCallback', actBasket);
41711
41032
  addToBasketLog = false;
@@ -41715,16 +41036,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
41715
41036
  type: 'onAddToBasket',
41716
41037
  data: actBasket.getAsJson()
41717
41038
  });
41718
- return _context29.abrupt("break", 38);
41039
+ return _context28.abrupt("break", 38);
41719
41040
  case 38:
41720
- return _context29.abrupt("return");
41041
+ return _context28.abrupt("return");
41721
41042
  case 39:
41722
41043
  case "end":
41723
- return _context29.stop();
41044
+ return _context28.stop();
41724
41045
  }
41725
- }, _callee29, this);
41046
+ }, _callee28, this);
41726
41047
  }));
41727
- function addToBasket(_x71) {
41048
+ function addToBasket(_x70) {
41728
41049
  return _addToBasket.apply(this, arguments);
41729
41050
  }
41730
41051
  return addToBasket;
@@ -42005,9 +41326,9 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42005
41326
  key: "initApiForLogicOnly",
42006
41327
  value: //just for testing purposes
42007
41328
  function () {
42008
- var _initApiForLogicOnly = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee30(organization, lang, getSessionGuid, handler, applicationEnvironment, apiKey, jwt) {
42009
- return _regeneratorRuntime.wrap(function _callee30$(_context30) {
42010
- while (1) switch (_context30.prev = _context30.next) {
41329
+ var _initApiForLogicOnly = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee29(organization, lang, getSessionGuid, handler, applicationEnvironment, apiKey, jwt) {
41330
+ return _regeneratorRuntime.wrap(function _callee29$(_context29) {
41331
+ while (1) switch (_context29.prev = _context29.next) {
42011
41332
  case 0:
42012
41333
  //empty services
42013
41334
  this.api = new DivaApiHandler(_objectSpread$5(_objectSpread$5({}, this.plannerConfig), {}, {
@@ -42020,17 +41341,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42020
41341
  jwt: jwt,
42021
41342
  apiKey: apiKey
42022
41343
  }), handler);
42023
- _context30.next = 3;
41344
+ _context29.next = 3;
42024
41345
  return this.divaBasketHandler.initWWSClient(this.api.getWWSClient());
42025
41346
  case 3:
42026
41347
  this.plannerHandler = new DivaPlannerHandler(true);
42027
41348
  case 4:
42028
41349
  case "end":
42029
- return _context30.stop();
41350
+ return _context29.stop();
42030
41351
  }
42031
- }, _callee30, this);
41352
+ }, _callee29, this);
42032
41353
  }));
42033
- function initApiForLogicOnly(_x72, _x73, _x74, _x75, _x76, _x77, _x78) {
41354
+ function initApiForLogicOnly(_x71, _x72, _x73, _x74, _x75, _x76, _x77) {
42034
41355
  return _initApiForLogicOnly.apply(this, arguments);
42035
41356
  }
42036
41357
  return initApiForLogicOnly;
@@ -42043,16 +41364,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42043
41364
  }, {
42044
41365
  key: "loadBasket",
42045
41366
  value: function () {
42046
- var _loadBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee31() {
42047
- return _regeneratorRuntime.wrap(function _callee31$(_context31) {
42048
- while (1) switch (_context31.prev = _context31.next) {
41367
+ var _loadBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee30() {
41368
+ return _regeneratorRuntime.wrap(function _callee30$(_context30) {
41369
+ while (1) switch (_context30.prev = _context30.next) {
42049
41370
  case 0:
42050
- return _context31.abrupt("return", this.divaBasketHandler.initializeBasket(this.api));
41371
+ return _context30.abrupt("return", this.divaBasketHandler.initializeBasket(this.api));
42051
41372
  case 1:
42052
41373
  case "end":
42053
- return _context31.stop();
41374
+ return _context30.stop();
42054
41375
  }
42055
- }, _callee31, this);
41376
+ }, _callee30, this);
42056
41377
  }));
42057
41378
  function loadBasket() {
42058
41379
  return _loadBasket.apply(this, arguments);
@@ -42067,31 +41388,31 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42067
41388
  }, {
42068
41389
  key: "initBasket",
42069
41390
  value: function () {
42070
- var _initBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee32(init3D, ignoreFavorites) {
41391
+ var _initBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee31(init3D, ignoreFavorites) {
42071
41392
  var _initSetState$api$web2;
42072
41393
  var initSetState, sets, result, _sets$, set, basket;
42073
- return _regeneratorRuntime.wrap(function _callee32$(_context32) {
42074
- while (1) switch (_context32.prev = _context32.next) {
41394
+ return _regeneratorRuntime.wrap(function _callee31$(_context31) {
41395
+ while (1) switch (_context31.prev = _context31.next) {
42075
41396
  case 0:
42076
41397
  this.divaNr = this.divaBasketHandler.actDivaNr;
42077
41398
  initSetState = this.getInitStateForSet(!init3D);
42078
41399
  this.plannerHandler.initPlanner(initSetState, this.getPlannerHandlerFunctions());
42079
- _context32.next = 5;
41400
+ _context31.next = 5;
42080
41401
  return setHandlerInstance.initSetsByOrderSet(this.divaBasketHandler.getOrderSetsByDivaNr(this.divaNr), initSetState);
42081
41402
  case 5:
42082
- sets = _context32.sent;
41403
+ sets = _context31.sent;
42083
41404
  if (!((_initSetState$api$web2 = initSetState.api.webConfig) !== null && _initSetState$api$web2 !== void 0 && _initSetState$api$web2.checkForProductsPrice)) {
42084
- _context32.next = 12;
41405
+ _context31.next = 12;
42085
41406
  break;
42086
41407
  }
42087
41408
  if (!this.divaBasketHandler.actBasket.OrigProductId) {
42088
- _context32.next = 12;
41409
+ _context31.next = 12;
42089
41410
  break;
42090
41411
  }
42091
- _context32.next = 10;
41412
+ _context31.next = 10;
42092
41413
  return this.divaBasketHandler.getProduct(this.api, this.divaBasketHandler.actBasket.OrigProductId);
42093
41414
  case 10:
42094
- result = _context32.sent;
41415
+ result = _context31.sent;
42095
41416
  if (result) {
42096
41417
  (_sets$ = sets[0]) === null || _sets$ === void 0 || _sets$.remindPriceForHash(result);
42097
41418
  }
@@ -42100,24 +41421,24 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42100
41421
  set = this.actSet();
42101
41422
  setHandlerInstance.loadConfigStructureOfActSet(set, this.getCurPlannerType());
42102
41423
  if (!(favoritesHandlerInstance.FavoritesDefined(set) && !ignoreFavorites)) {
42103
- _context32.next = 17;
41424
+ _context31.next = 17;
42104
41425
  break;
42105
41426
  }
42106
- _context32.next = 17;
41427
+ _context31.next = 17;
42107
41428
  return this.handleFavorites(init3D ? 'CALC' : 'REPAIR');
42108
41429
  case 17:
42109
- _context32.next = 19;
41430
+ _context31.next = 19;
42110
41431
  return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, !init3D, this.doAllowSetPlanner(), this.ReturnTo);
42111
41432
  case 19:
42112
- basket = _context32.sent;
42113
- return _context32.abrupt("return", basket);
41433
+ basket = _context31.sent;
41434
+ return _context31.abrupt("return", basket);
42114
41435
  case 21:
42115
41436
  case "end":
42116
- return _context32.stop();
41437
+ return _context31.stop();
42117
41438
  }
42118
- }, _callee32, this);
41439
+ }, _callee31, this);
42119
41440
  }));
42120
- function initBasket(_x79, _x80) {
41441
+ function initBasket(_x78, _x79) {
42121
41442
  return _initBasket.apply(this, arguments);
42122
41443
  }
42123
41444
  return initBasket;
@@ -42131,21 +41452,21 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42131
41452
  }, {
42132
41453
  key: "getValidVariantsLength",
42133
41454
  value: function () {
42134
- var _getValidVariantsLength = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee33() {
41455
+ var _getValidVariantsLength = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee32() {
42135
41456
  var set;
42136
- return _regeneratorRuntime.wrap(function _callee33$(_context33) {
42137
- while (1) switch (_context33.prev = _context33.next) {
41457
+ return _regeneratorRuntime.wrap(function _callee32$(_context32) {
41458
+ while (1) switch (_context32.prev = _context32.next) {
42138
41459
  case 0:
42139
41460
  set = this.actSet();
42140
- _context33.next = 3;
41461
+ _context32.next = 3;
42141
41462
  return favoritesHandlerInstance.getValidVariants(set, true);
42142
41463
  case 3:
42143
- return _context33.abrupt("return", _context33.sent.length);
41464
+ return _context32.abrupt("return", _context32.sent.length);
42144
41465
  case 4:
42145
41466
  case "end":
42146
- return _context33.stop();
41467
+ return _context32.stop();
42147
41468
  }
42148
- }, _callee33, this);
41469
+ }, _callee32, this);
42149
41470
  }));
42150
41471
  function getValidVariantsLength() {
42151
41472
  return _getValidVariantsLength.apply(this, arguments);
@@ -42155,46 +41476,46 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42155
41476
  }, {
42156
41477
  key: "handleFavorites",
42157
41478
  value: function () {
42158
- var _handleFavorites = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee34(mode) {
41479
+ var _handleFavorites = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee33(mode) {
42159
41480
  var _this4 = this;
42160
41481
  var set, i;
42161
- return _regeneratorRuntime.wrap(function _callee34$(_context34) {
42162
- while (1) switch (_context34.prev = _context34.next) {
41482
+ return _regeneratorRuntime.wrap(function _callee33$(_context33) {
41483
+ while (1) switch (_context33.prev = _context33.next) {
42163
41484
  case 0:
42164
41485
  set = this.actSet();
42165
41486
  i = 0;
42166
41487
  case 2:
42167
41488
  if (!favoritesHandlerInstance.IsCalcForSummary) {
42168
- _context34.next = 11;
41489
+ _context33.next = 11;
42169
41490
  break;
42170
41491
  }
42171
- _context34.next = 5;
41492
+ _context33.next = 5;
42172
41493
  return DivaUtils.Sleep(200);
42173
41494
  case 5:
42174
41495
  i++;
42175
41496
  if (!(i > 1000)) {
42176
- _context34.next = 9;
41497
+ _context33.next = 9;
42177
41498
  break;
42178
41499
  }
42179
41500
  LOG$1.error(new DivaError('error on generating Variants of Summary'));
42180
- return _context34.abrupt("break", 11);
41501
+ return _context33.abrupt("break", 11);
42181
41502
  case 9:
42182
- _context34.next = 2;
41503
+ _context33.next = 2;
42183
41504
  break;
42184
41505
  case 11:
42185
- _context34.next = 13;
41506
+ _context33.next = 13;
42186
41507
  return favoritesHandlerInstance.handleFavorites(set, mode, this.divaBasketHandler.actBasket, this.saveToBasketWrapper.bind(this), this.doConfigure.bind(this), function () {
42187
41508
  return _this4.update2DGrid(set);
42188
41509
  }, this.actions);
42189
41510
  case 13:
42190
- return _context34.abrupt("return", _context34.sent);
41511
+ return _context33.abrupt("return", _context33.sent);
42191
41512
  case 14:
42192
41513
  case "end":
42193
- return _context34.stop();
41514
+ return _context33.stop();
42194
41515
  }
42195
- }, _callee34, this);
41516
+ }, _callee33, this);
42196
41517
  }));
42197
- function handleFavorites(_x81) {
41518
+ function handleFavorites(_x80) {
42198
41519
  return _handleFavorites.apply(this, arguments);
42199
41520
  }
42200
41521
  return handleFavorites;
@@ -42207,48 +41528,48 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42207
41528
  }, {
42208
41529
  key: "initSapOrderLinesFromBasket",
42209
41530
  value: function () {
42210
- var _initSapOrderLinesFromBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee35(divaNr, init3D, onlyLoadOldBakset) {
41531
+ var _initSapOrderLinesFromBasket = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee34(divaNr, init3D, onlyLoadOldBakset) {
42211
41532
  var result, oldBasket, basket;
42212
- return _regeneratorRuntime.wrap(function _callee35$(_context35) {
42213
- while (1) switch (_context35.prev = _context35.next) {
41533
+ return _regeneratorRuntime.wrap(function _callee34$(_context34) {
41534
+ while (1) switch (_context34.prev = _context34.next) {
42214
41535
  case 0:
42215
41536
  if (divaNr) this.divaBasketHandler.updateDivaNrInBasket(divaNr);
42216
- _context35.next = 3;
41537
+ _context34.next = 3;
42217
41538
  return this.loadBasket();
42218
41539
  case 3:
42219
- result = _context35.sent;
41540
+ result = _context34.sent;
42220
41541
  if (!onlyLoadOldBakset) {
42221
- _context35.next = 6;
41542
+ _context34.next = 6;
42222
41543
  break;
42223
41544
  }
42224
- return _context35.abrupt("return", {
41545
+ return _context34.abrupt("return", {
42225
41546
  oldBasket: new BasketData(JSON.parse(JSON.stringify(this.divaBasketHandler.actBasket))),
42226
41547
  cache: {}
42227
41548
  });
42228
41549
  case 6:
42229
41550
  if (!(result === false)) {
42230
- _context35.next = 8;
41551
+ _context34.next = 8;
42231
41552
  break;
42232
41553
  }
42233
41554
  throw new Error('Could not load basket! ' + divaNr);
42234
41555
  case 8:
42235
41556
  oldBasket = new BasketData(JSON.parse(JSON.stringify(this.divaBasketHandler.actBasket)));
42236
- _context35.next = 11;
41557
+ _context34.next = 11;
42237
41558
  return this.initBasket(init3D);
42238
41559
  case 11:
42239
- basket = _context35.sent;
42240
- return _context35.abrupt("return", {
41560
+ basket = _context34.sent;
41561
+ return _context34.abrupt("return", {
42241
41562
  basket: basket,
42242
41563
  oldBasket: oldBasket,
42243
41564
  cache: this.api.getJsonDataCache()
42244
41565
  });
42245
41566
  case 13:
42246
41567
  case "end":
42247
- return _context35.stop();
41568
+ return _context34.stop();
42248
41569
  }
42249
- }, _callee35, this);
41570
+ }, _callee34, this);
42250
41571
  }));
42251
- function initSapOrderLinesFromBasket(_x82, _x83, _x84) {
41572
+ function initSapOrderLinesFromBasket(_x81, _x82, _x83) {
42252
41573
  return _initSapOrderLinesFromBasket.apply(this, arguments);
42253
41574
  }
42254
41575
  return initSapOrderLinesFromBasket;
@@ -42273,6 +41594,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
42273
41594
  }
42274
41595
  return undefined;
42275
41596
  }
41597
+ }, {
41598
+ key: "setsAsArray",
41599
+ get: function get() {
41600
+ return Object.values(this.sets);
41601
+ }
42276
41602
 
42277
41603
  /**
42278
41604
  * This function returns the planner mode.
@@ -60206,7 +59532,7 @@ var ProductHandler = /*#__PURE__*/function () {
60206
59532
  }, {
60207
59533
  key: "isSameProduct",
60208
59534
  value: function isSameProduct(product, setHash, diva3dProject, orderLines, varinatData, catalogCodex) {
60209
- var _product$articles;
59535
+ var _product$articles, _product$configuratio, _product$configuratio2;
60210
59536
  //For new products we store the setHash and hqRenderScript in order to determine if the product changed.
60211
59537
  if (product.uniqueHash !== undefined) {
60212
59538
  return product.uniqueHash === 'v1' + setHash + md5(diva3dProject);
@@ -60217,22 +59543,22 @@ var ProductHandler = /*#__PURE__*/function () {
60217
59543
  return false;
60218
59544
  }
60219
59545
  //For older products without setHash we use the old comparison logic
59546
+ var orderlines = (_product$configuratio = (_product$configuratio2 = product.configuration) === null || _product$configuratio2 === void 0 || (_product$configuratio2 = _product$configuratio2.OrderSets) === null || _product$configuratio2 === void 0 ? void 0 : _product$configuratio2[0].OrderLines) !== null && _product$configuratio !== void 0 ? _product$configuratio : [];
60220
59547
  var _loop = function _loop() {
60221
- var _article$variantValue;
60222
- var article = product.articles[i];
59548
+ var article = orderlines[i];
60223
59549
  var orderLine = orderLines.find(function (ol) {
60224
- return ol.ArticleCodex == article.articleCodex && catalogCodex == article.catalogCodex;
59550
+ return ol.ArticleCodex == article.ArticleCodex && catalogCodex == article.CatalogCodex;
60225
59551
  });
60226
- if (!orderLine || ((_article$variantValue = article.variantValues) === null || _article$variantValue === void 0 ? void 0 : _article$variantValue.length) != (varinatData === null || varinatData === void 0 ? void 0 : varinatData.length)) {
59552
+ if (!orderLine) {
60227
59553
  return {
60228
59554
  v: false
60229
59555
  };
60230
59556
  }
60231
59557
  var _loop2 = function _loop2() {
60232
- var varinatValue = article.variantValues[j];
60233
- if (!(varinatData !== null && varinatData !== void 0 && varinatData.find(function (vb) {
59558
+ var varinatValue = article.VariantBasketDatas[j];
59559
+ if (!varinatData.find(function (vb) {
60234
59560
  return vb.OPT == varinatValue['OPT'] && vb.OPV == varinatValue['OPV'];
60235
- }))) {
59561
+ })) {
60236
59562
  return {
60237
59563
  v: {
60238
59564
  v: false
@@ -60241,14 +59567,14 @@ var ProductHandler = /*#__PURE__*/function () {
60241
59567
  }
60242
59568
  },
60243
59569
  _ret2;
60244
- for (var j = 0; j < (((_article$variantValue2 = article.variantValues) === null || _article$variantValue2 === void 0 ? void 0 : _article$variantValue2.length) || 0); j++) {
60245
- var _article$variantValue2;
59570
+ for (var j = 0; j < (((_article$VariantBaske = article.VariantBasketDatas) === null || _article$VariantBaske === void 0 ? void 0 : _article$VariantBaske.length) || 0); j++) {
59571
+ var _article$VariantBaske;
60246
59572
  _ret2 = _loop2();
60247
59573
  if (_ret2) return _ret2.v;
60248
59574
  }
60249
59575
  },
60250
59576
  _ret;
60251
- for (var i = 0; i < product.articles.length; i++) {
59577
+ for (var i = 0; i < orderlines.length; i++) {
60252
59578
  _ret = _loop();
60253
59579
  if (_ret) return _ret.v;
60254
59580
  }
@@ -60777,4 +60103,4 @@ var getOrigProductId = /*#__PURE__*/function () {
60777
60103
  };
60778
60104
  }();
60779
60105
 
60780
- export { BoundingBox as B, Cell as C, DockingPoint as D, Grid as G, HQRenderScript as H, OptionCatalogData as O, Product as P, Rendering as R, Vector3 as V, setHandlerInstance as a, articleHandlerInstance as b, Vector2 as c, DivaWebPlanner as d, DivaArticle as e, DivaCatalogData as f, DivaBasketHandler as g, CatalogPlannerArticleData as h, Vector4 as i, creatRenderOrders as j, getOrigProductId as k, loadAndRepairBasket as l, productHandlerInstance as p, summaryHandlerInstance as s };
60106
+ export { BoundingBox as B, Cell as C, DockingPoint as D, Grid as G, HQRenderScript as H, OptionCatalogData as O, Rendering as R, Vector3 as V, setHandlerInstance as a, articleHandlerInstance as b, Vector2 as c, DivaWebPlanner as d, DivaArticle as e, DivaCatalogData as f, DivaBasketHandler as g, CatalogPlannerArticleData as h, Vector4 as i, creatRenderOrders as j, getOrigProductId as k, loadAndRepairBasket as l, summaryHandlerInstance as s };