@crystaldesign/web-planner-logic 25.13.0-beta.29 → 25.13.0-beta.30

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 (54) hide show
  1. package/build/cjs/{DivaBoxPlanner-a1c27537.js → DivaBoxPlanner-19fff9fc.js} +2 -2
  2. package/build/cjs/{DivaStandardPlanner-cafdfb2e.js → DivaStandardPlanner-e13f9c94.js} +2 -2
  3. package/build/cjs/{DoorPlanner-b10008cf.js → DoorPlanner-9eee1c48.js} +1 -1
  4. package/build/cjs/{Host3DSignalR-37a3c53c.js → Host3DSignalR-eab2939e.js} +1 -1
  5. package/build/cjs/{LiviqueWWSHandler-f2975f8d.js → LiviqueWWSHandler-469f6583.js} +1 -1
  6. package/build/cjs/{PfisterWWSHandler-3f6e9c5e.js → PfisterWWSHandler-64e350c5.js} +1 -1
  7. package/build/cjs/{PlannerHandler2D-7939f975.js → PlannerHandler2D-787ed37c.js} +1 -1
  8. package/build/cjs/{SeriousBasketHandler-2826d982.js → SeriousBasketHandler-f367ca39.js} +1 -1
  9. package/build/cjs/{ShelfPlanner-fceba713.js → ShelfPlanner-ec459d7e.js} +1 -1
  10. package/build/cjs/{StandardWWSHandler-5713c9cb.js → StandardWWSHandler-0dff1df3.js} +1 -1
  11. package/build/cjs/{index-dc20d142.js → index-9720b39c.js} +773 -295
  12. package/build/cjs/index.js +1 -1
  13. package/build/esm/{DivaBoxPlanner-5b83551f.js → DivaBoxPlanner-07aaffc1.js} +2 -2
  14. package/build/esm/{DivaStandardPlanner-a1ed202f.js → DivaStandardPlanner-8659772b.js} +2 -2
  15. package/build/esm/{DoorPlanner-ac18a82d.js → DoorPlanner-1856ede2.js} +1 -1
  16. package/build/esm/{Host3DSignalR-2cbcb371.js → Host3DSignalR-06c1d471.js} +1 -1
  17. package/build/esm/{LiviqueWWSHandler-4dfa4c29.js → LiviqueWWSHandler-d6dc0f40.js} +1 -1
  18. package/build/esm/{PfisterWWSHandler-7f788dde.js → PfisterWWSHandler-1c4b02d4.js} +1 -1
  19. package/build/esm/{PlannerHandler2D-cfc90a6d.js → PlannerHandler2D-c6ad67ab.js} +1 -1
  20. package/build/esm/{SeriousBasketHandler-b1914906.js → SeriousBasketHandler-1cbe7a5b.js} +1 -1
  21. package/build/esm/{ShelfPlanner-82a898e8.js → ShelfPlanner-d4025911.js} +1 -1
  22. package/build/esm/{StandardWWSHandler-6d40ee75.js → StandardWWSHandler-b109a3d8.js} +1 -1
  23. package/build/esm/{index-2a468898.js → index-df78379b.js} +773 -295
  24. package/build/esm/index.js +1 -1
  25. package/build/types/web-planner-logic/src/index.d.ts +3 -2
  26. package/build/types/web-planner-logic/src/index.d.ts.map +1 -1
  27. package/build/types/web-planner-logic/src/interface/API/AiImageResult.d.ts +50 -0
  28. package/build/types/web-planner-logic/src/interface/API/AiImageResult.d.ts.map +1 -0
  29. package/build/types/web-planner-logic/src/interface/CoreTypes/index.d.ts +2 -0
  30. package/build/types/web-planner-logic/src/interface/CoreTypes/index.d.ts.map +1 -1
  31. package/build/types/web-planner-logic/src/interface/ViewTypes/index.d.ts +9 -0
  32. package/build/types/web-planner-logic/src/interface/ViewTypes/index.d.ts.map +1 -1
  33. package/build/types/web-planner-logic/src/interface/webPlannerParams/WebPlannerParamsType.d.ts +6 -1
  34. package/build/types/web-planner-logic/src/interface/webPlannerParams/WebPlannerParamsType.d.ts.map +1 -1
  35. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts +26 -0
  36. package/build/types/web-planner-logic/src/logic/DivaApiHandler.d.ts.map +1 -1
  37. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts +18 -1
  38. package/build/types/web-planner-logic/src/logic/DivaWebPlanner.d.ts.map +1 -1
  39. package/build/types/web-planner-logic/src/logic/Planner/DivaPlannerHandler.d.ts +2 -1
  40. package/build/types/web-planner-logic/src/logic/Planner/DivaPlannerHandler.d.ts.map +1 -1
  41. package/build/types/web-planner-logic/src/logic/Planner/Rendering/DivaMediaServiceHandler.d.ts +10 -0
  42. package/build/types/web-planner-logic/src/logic/Planner/Rendering/DivaMediaServiceHandler.d.ts.map +1 -1
  43. package/build/types/web-planner-logic/src/logic/Planner/Rendering/PlannerHandler3D.d.ts.map +1 -1
  44. package/build/types/web-planner-logic/src/logic/Planner/Rendering/Rendering.d.ts.map +1 -1
  45. package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts +7 -0
  46. package/build/types/web-planner-logic/src/logic/Set/DivaSet.d.ts.map +1 -1
  47. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts +2 -1
  48. package/build/types/web-planner-logic/src/logic/Set/DivaSetHandler.d.ts.map +1 -1
  49. package/build/types/web-planner-logic/src/test/datas/environments/scripts/pfister-prod.d.ts.map +1 -1
  50. package/build/types/web-planner-logic/src/test/datas/environments/scripts/pfister-quality.d.ts.map +1 -1
  51. package/build/types/web-planner-logic/src/test/datas/environments/testing/pfister-dev.d.ts.map +1 -1
  52. package/build/types/web-planner-logic/src/test/datas/environments/testing/retail-dev.d.ts.map +1 -1
  53. package/build/types/web-planner-logic/src/test/datas/environments/testing/retail-test.d.ts.map +1 -1
  54. package/package.json +2 -2
@@ -45,6 +45,8 @@ var _typeof__default = /*#__PURE__*/_interopDefaultLegacy(_typeof);
45
45
  var _excluded = ["type"];
46
46
  function ownKeys$k(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; }
47
47
  function _objectSpread$k(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$k(Object(t), !0).forEach(function (r) { _defineProperty__default["default"](e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$k(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
48
+ // Import types from AI service
49
+
48
50
  var LOG$p = DivaUtils__default["default"].initLog('Planner', 'WEB-PLANNER-LOGIC');
49
51
  var JsonDataCache = /*#__PURE__*/function () {
50
52
  function JsonDataCache() {
@@ -99,6 +101,26 @@ var DivaApiHandler = /*#__PURE__*/function () {
99
101
  }
100
102
  }
101
103
  return _createClass__default["default"](DivaApiHandler, [{
104
+ key: "getAiServiceAuthHeaders",
105
+ value:
106
+ /**
107
+ * Get standardized authentication headers for AI service calls
108
+ */
109
+ function getAiServiceAuthHeaders(leadKey) {
110
+ var headers = {};
111
+ if (this.jwt) headers = {
112
+ Authorization: 'Bearer ' + this.jwt
113
+ };else if (this.apiKey) headers = {
114
+ 'X-API-KEY': this.apiKey
115
+ };
116
+
117
+ // Add lead key header if provided
118
+ if (leadKey) {
119
+ headers['x-lead-key'] = leadKey;
120
+ }
121
+ return headers;
122
+ }
123
+ }, {
102
124
  key: "setJsonDataCache",
103
125
  value: function setJsonDataCache(cache) {
104
126
  this.jsonDataCache = cache;
@@ -122,6 +144,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
122
144
  finalUrl,
123
145
  data,
124
146
  nextSkip,
147
+ _e$response,
125
148
  _args = arguments;
126
149
  return _regeneratorRuntime__default["default"].wrap(function _callee$(_context) {
127
150
  while (1) switch (_context.prev = _context.next) {
@@ -193,8 +216,21 @@ var DivaApiHandler = /*#__PURE__*/function () {
193
216
  case 37:
194
217
  _context.prev = 37;
195
218
  _context.t5 = _context["catch"](4);
219
+ if (!(axios__default["default"].isAxiosError(_context.t5) && ((_e$response = _context.t5.response) === null || _e$response === void 0 ? void 0 : _e$response.status) === 429)) {
220
+ _context.next = 42;
221
+ break;
222
+ }
223
+ LOG$p.warn('Rate limit exceeded (429) for URL: ' + url, 'DivaApiHandler.fetchData');
224
+ throw new DivaUtils.DivaError('Rate limit exceeded. Please try again later.', {
225
+ code: 'WC_0429',
226
+ custom: {
227
+ url: url,
228
+ status: 429
229
+ }
230
+ });
231
+ case 42:
196
232
  throw Error('fetch failed! ' + url + ' Error: ' + _context.t5);
197
- case 40:
233
+ case 43:
198
234
  case "end":
199
235
  return _context.stop();
200
236
  }
@@ -515,17 +551,23 @@ var DivaApiHandler = /*#__PURE__*/function () {
515
551
  var _this$apiConfig$media, _this$apiConfig7;
516
552
  return (_this$apiConfig$media = (_this$apiConfig7 = this.apiConfig) === null || _this$apiConfig7 === void 0 ? void 0 : _this$apiConfig7.mediaService) !== null && _this$apiConfig$media !== void 0 ? _this$apiConfig$media : '';
517
553
  }
554
+ }, {
555
+ key: "getDivaAiServiceUrl",
556
+ value: function getDivaAiServiceUrl() {
557
+ var _this$apiConfig$aiSer, _this$apiConfig8;
558
+ return (_this$apiConfig$aiSer = (_this$apiConfig8 = this.apiConfig) === null || _this$apiConfig8 === void 0 ? void 0 : _this$apiConfig8.aiService) !== null && _this$apiConfig$aiSer !== void 0 ? _this$apiConfig$aiSer : '';
559
+ }
518
560
  }, {
519
561
  key: "getConstructorServiceUrl",
520
562
  value: function getConstructorServiceUrl() {
521
- var _this$apiConfig$const, _this$apiConfig8;
522
- return (_this$apiConfig$const = (_this$apiConfig8 = this.apiConfig) === null || _this$apiConfig8 === void 0 ? void 0 : _this$apiConfig8.constructorService) !== null && _this$apiConfig$const !== void 0 ? _this$apiConfig$const : '';
563
+ var _this$apiConfig$const, _this$apiConfig9;
564
+ return (_this$apiConfig$const = (_this$apiConfig9 = this.apiConfig) === null || _this$apiConfig9 === void 0 ? void 0 : _this$apiConfig9.constructorService) !== null && _this$apiConfig$const !== void 0 ? _this$apiConfig$const : '';
523
565
  }
524
566
  }, {
525
567
  key: "getDivaBasketServiceUrl",
526
568
  value: function getDivaBasketServiceUrl() {
527
- var _this$apiConfig$baske, _this$apiConfig9;
528
- return (_this$apiConfig$baske = (_this$apiConfig9 = this.apiConfig) === null || _this$apiConfig9 === void 0 ? void 0 : _this$apiConfig9.basketService) !== null && _this$apiConfig$baske !== void 0 ? _this$apiConfig$baske : '';
569
+ var _this$apiConfig$baske, _this$apiConfig10;
570
+ return (_this$apiConfig$baske = (_this$apiConfig10 = this.apiConfig) === null || _this$apiConfig10 === void 0 ? void 0 : _this$apiConfig10.basketService) !== null && _this$apiConfig$baske !== void 0 ? _this$apiConfig$baske : '';
529
571
  }
530
572
  }, {
531
573
  key: "getLoadProductBasketParams",
@@ -536,8 +578,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
536
578
  }, {
537
579
  key: "get3DServerUrl",
538
580
  value: function get3DServerUrl() {
539
- var _this$apiConfig$host, _this$apiConfig10;
540
- 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 : '';
581
+ var _this$apiConfig$host, _this$apiConfig11;
582
+ return (_this$apiConfig$host = (_this$apiConfig11 = this.apiConfig) === null || _this$apiConfig11 === void 0 ? void 0 : _this$apiConfig11.host3d) !== null && _this$apiConfig$host !== void 0 ? _this$apiConfig$host : '';
541
583
  }
542
584
  }, {
543
585
  key: "doCheckForProductsPrice",
@@ -605,9 +647,9 @@ var DivaApiHandler = /*#__PURE__*/function () {
605
647
  }, {
606
648
  key: "getBaseUrl",
607
649
  value: function getBaseUrl() {
608
- var _this$apiConfig11, _this$apiConfig12;
609
- var url = (_this$apiConfig11 = this.apiConfig) === null || _this$apiConfig11 === void 0 ? void 0 : _this$apiConfig11.api2["default"];
610
- if (this.getApplicationEnvironment() == 'WEB' && (_this$apiConfig12 = this.apiConfig) !== null && _this$apiConfig12 !== void 0 && _this$apiConfig12.api2.web) {
650
+ var _this$apiConfig12, _this$apiConfig13;
651
+ var url = (_this$apiConfig12 = this.apiConfig) === null || _this$apiConfig12 === void 0 ? void 0 : _this$apiConfig12.api2["default"];
652
+ if (this.getApplicationEnvironment() == 'WEB' && (_this$apiConfig13 = this.apiConfig) !== null && _this$apiConfig13 !== void 0 && _this$apiConfig13.api2.web) {
611
653
  url = this.apiConfig.api2.web;
612
654
  }
613
655
  if (!url) throw new Error('No API2 defined');
@@ -863,39 +905,39 @@ var DivaApiHandler = /*#__PURE__*/function () {
863
905
  }, {
864
906
  key: "apiUrl",
865
907
  value: function apiUrl(queryString, useWebServiceApi) {
866
- var _this$apiConfig23, _this$apiConfig24, _this$apiConfig25;
908
+ var _this$apiConfig24, _this$apiConfig25, _this$apiConfig26;
867
909
  if (useWebServiceApi == 'catalog') {
868
- var _this$apiConfig13, _this$apiConfig14;
869
- if (!((_this$apiConfig13 = this.apiConfig) !== null && _this$apiConfig13 !== void 0 && _this$apiConfig13.catalogService)) throw new Error('No catalog Service defined');
870
- return ((_this$apiConfig14 = this.apiConfig) === null || _this$apiConfig14 === void 0 ? void 0 : _this$apiConfig14.catalogService) + queryString;
910
+ var _this$apiConfig14, _this$apiConfig15;
911
+ if (!((_this$apiConfig14 = this.apiConfig) !== null && _this$apiConfig14 !== void 0 && _this$apiConfig14.catalogService)) throw new Error('No catalog Service defined');
912
+ return ((_this$apiConfig15 = this.apiConfig) === null || _this$apiConfig15 === void 0 ? void 0 : _this$apiConfig15.catalogService) + queryString;
871
913
  }
872
914
  if (useWebServiceApi == 'basket') {
873
- var _this$apiConfig15, _this$apiConfig16;
874
- if (!((_this$apiConfig15 = this.apiConfig) !== null && _this$apiConfig15 !== void 0 && _this$apiConfig15.basketService)) throw new Error('No basket Service defined');
875
- return ((_this$apiConfig16 = this.apiConfig) === null || _this$apiConfig16 === void 0 ? void 0 : _this$apiConfig16.basketService) + queryString;
915
+ var _this$apiConfig16, _this$apiConfig17;
916
+ if (!((_this$apiConfig16 = this.apiConfig) !== null && _this$apiConfig16 !== void 0 && _this$apiConfig16.basketService)) throw new Error('No basket Service defined');
917
+ return ((_this$apiConfig17 = this.apiConfig) === null || _this$apiConfig17 === void 0 ? void 0 : _this$apiConfig17.basketService) + queryString;
876
918
  }
877
919
  if (useWebServiceApi == 'report') {
878
- var _this$apiConfig17, _this$apiConfig18;
879
- if (!((_this$apiConfig17 = this.apiConfig) !== null && _this$apiConfig17 !== void 0 && _this$apiConfig17.reportService)) throw new Error('No report Service defined');
880
- return ((_this$apiConfig18 = this.apiConfig) === null || _this$apiConfig18 === void 0 ? void 0 : _this$apiConfig18.reportService) + queryString;
920
+ var _this$apiConfig18, _this$apiConfig19;
921
+ if (!((_this$apiConfig18 = this.apiConfig) !== null && _this$apiConfig18 !== void 0 && _this$apiConfig18.reportService)) throw new Error('No report Service defined');
922
+ return ((_this$apiConfig19 = this.apiConfig) === null || _this$apiConfig19 === void 0 ? void 0 : _this$apiConfig19.reportService) + queryString;
881
923
  }
882
924
  if (useWebServiceApi == 'enricher') {
883
- var _this$apiConfig21, _this$apiConfig22;
925
+ var _this$apiConfig22, _this$apiConfig23;
884
926
  if (this.useIDMService) {
885
- var _this$apiConfig19, _this$apiConfig20;
886
- if (!((_this$apiConfig19 = this.apiConfig) !== null && _this$apiConfig19 !== void 0 && _this$apiConfig19.idmService)) throw new Error('No report Service defined');
887
- return ((_this$apiConfig20 = this.apiConfig) === null || _this$apiConfig20 === void 0 ? void 0 : _this$apiConfig20.idmService) + queryString;
927
+ var _this$apiConfig20, _this$apiConfig21;
928
+ if (!((_this$apiConfig20 = this.apiConfig) !== null && _this$apiConfig20 !== void 0 && _this$apiConfig20.idmService)) throw new Error('No report Service defined');
929
+ return ((_this$apiConfig21 = this.apiConfig) === null || _this$apiConfig21 === void 0 ? void 0 : _this$apiConfig21.idmService) + queryString;
888
930
  }
889
- if (!((_this$apiConfig21 = this.apiConfig) !== null && _this$apiConfig21 !== void 0 && _this$apiConfig21.enricherService)) throw new Error('No report Service defined');
890
- return ((_this$apiConfig22 = this.apiConfig) === null || _this$apiConfig22 === void 0 ? void 0 : _this$apiConfig22.enricherService) + queryString;
931
+ if (!((_this$apiConfig22 = this.apiConfig) !== null && _this$apiConfig22 !== void 0 && _this$apiConfig22.enricherService)) throw new Error('No report Service defined');
932
+ return ((_this$apiConfig23 = this.apiConfig) === null || _this$apiConfig23 === void 0 ? void 0 : _this$apiConfig23.enricherService) + queryString;
891
933
  }
892
- var url = (_this$apiConfig23 = this.apiConfig) === null || _this$apiConfig23 === void 0 ? void 0 : _this$apiConfig23.api2["default"];
893
- if (this.getApplicationEnvironment() == 'WEB' && (_this$apiConfig24 = this.apiConfig) !== null && _this$apiConfig24 !== void 0 && _this$apiConfig24.api2.web) {
934
+ var url = (_this$apiConfig24 = this.apiConfig) === null || _this$apiConfig24 === void 0 ? void 0 : _this$apiConfig24.api2["default"];
935
+ if (this.getApplicationEnvironment() == 'WEB' && (_this$apiConfig25 = this.apiConfig) !== null && _this$apiConfig25 !== void 0 && _this$apiConfig25.api2.web) {
894
936
  url = this.apiConfig.api2.web;
895
937
  }
896
- if (this.useEkPrices && (_this$apiConfig25 = this.apiConfig) !== null && _this$apiConfig25 !== void 0 && _this$apiConfig25.api2.ek) {
897
- var _this$apiConfig26;
898
- url = (_this$apiConfig26 = this.apiConfig) === null || _this$apiConfig26 === void 0 ? void 0 : _this$apiConfig26.api2.ek;
938
+ if (this.useEkPrices && (_this$apiConfig26 = this.apiConfig) !== null && _this$apiConfig26 !== void 0 && _this$apiConfig26.api2.ek) {
939
+ var _this$apiConfig27;
940
+ url = (_this$apiConfig27 = this.apiConfig) === null || _this$apiConfig27 === void 0 ? void 0 : _this$apiConfig27.api2.ek;
899
941
  }
900
942
  if (!url) throw new Error('No API2 defined');
901
943
  return url + '?' + queryString;
@@ -1190,12 +1232,151 @@ var DivaApiHandler = /*#__PURE__*/function () {
1190
1232
  return loadArticlePricesQS;
1191
1233
  }()
1192
1234
  }, {
1193
- key: "postHQRenderScript",
1235
+ key: "generateAiImageWithReferenceImages",
1194
1236
  value: function () {
1195
- var _postHQRenderScript = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee9(data) {
1237
+ var _generateAiImageWithReferenceImages = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee9(data, leadKey) {
1196
1238
  var url, headers, res;
1197
1239
  return _regeneratorRuntime__default["default"].wrap(function _callee9$(_context9) {
1198
1240
  while (1) switch (_context9.prev = _context9.next) {
1241
+ case 0:
1242
+ url = this.getDivaAiServiceUrl() + '/generate-image-with-references';
1243
+ headers = this.getAiServiceAuthHeaders(leadKey);
1244
+ _context9.next = 4;
1245
+ return this.fetchData(url, {
1246
+ data: _objectSpread$k(_objectSpread$k({}, data), {}, {
1247
+ organizationId: this.OrganizationId
1248
+ }),
1249
+ config: {
1250
+ headers: headers
1251
+ },
1252
+ method: 'POST'
1253
+ });
1254
+ case 4:
1255
+ res = _context9.sent;
1256
+ return _context9.abrupt("return", res);
1257
+ case 6:
1258
+ case "end":
1259
+ return _context9.stop();
1260
+ }
1261
+ }, _callee9, this);
1262
+ }));
1263
+ function generateAiImageWithReferenceImages(_x24, _x25) {
1264
+ return _generateAiImageWithReferenceImages.apply(this, arguments);
1265
+ }
1266
+ return generateAiImageWithReferenceImages;
1267
+ }()
1268
+ }, {
1269
+ key: "getUsageLimits",
1270
+ value: function () {
1271
+ var _getUsageLimits = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee10(data) {
1272
+ var url, headers, res;
1273
+ return _regeneratorRuntime__default["default"].wrap(function _callee10$(_context10) {
1274
+ while (1) switch (_context10.prev = _context10.next) {
1275
+ case 0:
1276
+ url = this.getDivaAiServiceUrl() + '/usage/limits?organizationId=' + data.organizationId + '&userId=' + data.userId;
1277
+ headers = this.getAiServiceAuthHeaders();
1278
+ _context10.next = 4;
1279
+ return this.fetchData(url, {
1280
+ data: {},
1281
+ config: {
1282
+ headers: headers
1283
+ },
1284
+ method: 'GET'
1285
+ });
1286
+ case 4:
1287
+ res = _context10.sent;
1288
+ return _context10.abrupt("return", res);
1289
+ case 6:
1290
+ case "end":
1291
+ return _context10.stop();
1292
+ }
1293
+ }, _callee10, this);
1294
+ }));
1295
+ function getUsageLimits(_x26) {
1296
+ return _getUsageLimits.apply(this, arguments);
1297
+ }
1298
+ return getUsageLimits;
1299
+ }()
1300
+ }, {
1301
+ key: "getAiRoomRenderings",
1302
+ value: function () {
1303
+ var _getAiRoomRenderings = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee11(organizationId) {
1304
+ var orgParam, url, headers, res;
1305
+ return _regeneratorRuntime__default["default"].wrap(function _callee11$(_context11) {
1306
+ while (1) switch (_context11.prev = _context11.next) {
1307
+ case 0:
1308
+ orgParam = organizationId ? "?organizationId=".concat(organizationId) : '';
1309
+ url = this.getDivaAiServiceUrl() + '/room-renderings' + orgParam; // No authentication headers needed - public endpoint
1310
+ headers = this.getAiServiceAuthHeaders();
1311
+ _context11.next = 5;
1312
+ return this.fetchData(url, {
1313
+ data: {},
1314
+ config: {
1315
+ headers: headers
1316
+ },
1317
+ method: 'GET'
1318
+ });
1319
+ case 5:
1320
+ res = _context11.sent;
1321
+ return _context11.abrupt("return", res);
1322
+ case 7:
1323
+ case "end":
1324
+ return _context11.stop();
1325
+ }
1326
+ }, _callee11, this);
1327
+ }));
1328
+ function getAiRoomRenderings(_x27) {
1329
+ return _getAiRoomRenderings.apply(this, arguments);
1330
+ }
1331
+ return getAiRoomRenderings;
1332
+ }()
1333
+ }, {
1334
+ key: "createLeadKey",
1335
+ value: function () {
1336
+ var _createLeadKey = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee12(email) {
1337
+ var url, headers, res;
1338
+ return _regeneratorRuntime__default["default"].wrap(function _callee12$(_context12) {
1339
+ while (1) switch (_context12.prev = _context12.next) {
1340
+ case 0:
1341
+ url = this.getDivaAiServiceUrl() + '/lead-key';
1342
+ headers = this.getAiServiceAuthHeaders();
1343
+ _context12.prev = 2;
1344
+ _context12.next = 5;
1345
+ return this.fetchData(url, {
1346
+ data: {
1347
+ email: email
1348
+ },
1349
+ config: {
1350
+ headers: headers
1351
+ },
1352
+ method: 'POST'
1353
+ });
1354
+ case 5:
1355
+ res = _context12.sent;
1356
+ return _context12.abrupt("return", res);
1357
+ case 9:
1358
+ _context12.prev = 9;
1359
+ _context12.t0 = _context12["catch"](2);
1360
+ LOG$p.error(new Error("Failed to create lead key for email ".concat(email, ": ").concat((_context12.t0 === null || _context12.t0 === void 0 ? void 0 : _context12.t0.message) || _context12.t0)));
1361
+ throw _context12.t0;
1362
+ case 13:
1363
+ case "end":
1364
+ return _context12.stop();
1365
+ }
1366
+ }, _callee12, this, [[2, 9]]);
1367
+ }));
1368
+ function createLeadKey(_x28) {
1369
+ return _createLeadKey.apply(this, arguments);
1370
+ }
1371
+ return createLeadKey;
1372
+ }()
1373
+ }, {
1374
+ key: "postHQRenderScript",
1375
+ value: function () {
1376
+ var _postHQRenderScript = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee13(data) {
1377
+ var url, headers, res;
1378
+ return _regeneratorRuntime__default["default"].wrap(function _callee13$(_context13) {
1379
+ while (1) switch (_context13.prev = _context13.next) {
1199
1380
  case 0:
1200
1381
  url = this.getDivaMediaServiceUrl() + '/hqrenderscripts';
1201
1382
  headers = {};
@@ -1204,7 +1385,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
1204
1385
  };else if (this.apiKey) headers = {
1205
1386
  'X-API-KEY': this.apiKey
1206
1387
  };
1207
- _context9.next = 5;
1388
+ _context13.next = 5;
1208
1389
  return this.fetchData(url, {
1209
1390
  data: data,
1210
1391
  config: {
@@ -1213,15 +1394,15 @@ var DivaApiHandler = /*#__PURE__*/function () {
1213
1394
  method: 'POST'
1214
1395
  });
1215
1396
  case 5:
1216
- res = _context9.sent;
1217
- return _context9.abrupt("return", res);
1397
+ res = _context13.sent;
1398
+ return _context13.abrupt("return", res);
1218
1399
  case 7:
1219
1400
  case "end":
1220
- return _context9.stop();
1401
+ return _context13.stop();
1221
1402
  }
1222
- }, _callee9, this);
1403
+ }, _callee13, this);
1223
1404
  }));
1224
- function postHQRenderScript(_x24) {
1405
+ function postHQRenderScript(_x29) {
1225
1406
  return _postHQRenderScript.apply(this, arguments);
1226
1407
  }
1227
1408
  return postHQRenderScript;
@@ -1229,10 +1410,10 @@ var DivaApiHandler = /*#__PURE__*/function () {
1229
1410
  }, {
1230
1411
  key: "postPlanningInfo",
1231
1412
  value: function () {
1232
- var _postPlanningInfo = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee10(planningInfo, divaNr, imgUrl, price, name, userId, firstName, lastName, organizationId) {
1413
+ var _postPlanningInfo = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee14(planningInfo, divaNr, imgUrl, price, name, userId, firstName, lastName, organizationId) {
1233
1414
  var data, url, headers;
1234
- return _regeneratorRuntime__default["default"].wrap(function _callee10$(_context10) {
1235
- while (1) switch (_context10.prev = _context10.next) {
1415
+ return _regeneratorRuntime__default["default"].wrap(function _callee14$(_context14) {
1416
+ while (1) switch (_context14.prev = _context14.next) {
1236
1417
  case 0:
1237
1418
  data = {
1238
1419
  info: JSON.stringify(planningInfo),
@@ -1251,8 +1432,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
1251
1432
  };else if (this.apiKey) headers = {
1252
1433
  'X-API-KEY': this.apiKey
1253
1434
  };
1254
- _context10.prev = 4;
1255
- _context10.next = 7;
1435
+ _context14.prev = 4;
1436
+ _context14.next = 7;
1256
1437
  return this.fetchData(url, {
1257
1438
  data: data,
1258
1439
  config: {
@@ -1261,21 +1442,21 @@ var DivaApiHandler = /*#__PURE__*/function () {
1261
1442
  method: 'POST'
1262
1443
  });
1263
1444
  case 7:
1264
- _context10.next = 12;
1445
+ _context14.next = 12;
1265
1446
  break;
1266
1447
  case 9:
1267
- _context10.prev = 9;
1268
- _context10.t0 = _context10["catch"](4);
1448
+ _context14.prev = 9;
1449
+ _context14.t0 = _context14["catch"](4);
1269
1450
  LOG$p.error(new DivaUtils.DivaError('Error Connecting to Support-Service-LivePlanner', {
1270
- cause: _context10.t0
1451
+ cause: _context14.t0
1271
1452
  }));
1272
1453
  case 12:
1273
1454
  case "end":
1274
- return _context10.stop();
1455
+ return _context14.stop();
1275
1456
  }
1276
- }, _callee10, this, [[4, 9]]);
1457
+ }, _callee14, this, [[4, 9]]);
1277
1458
  }));
1278
- function postPlanningInfo(_x25, _x26, _x27, _x28, _x29, _x30, _x31, _x32, _x33) {
1459
+ function postPlanningInfo(_x30, _x31, _x32, _x33, _x34, _x35, _x36, _x37, _x38) {
1279
1460
  return _postPlanningInfo.apply(this, arguments);
1280
1461
  }
1281
1462
  return postPlanningInfo;
@@ -1283,21 +1464,21 @@ var DivaApiHandler = /*#__PURE__*/function () {
1283
1464
  }, {
1284
1465
  key: "getDimensionbyId",
1285
1466
  value: function () {
1286
- var _getDimensionbyId = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee11(id, iln, catalogCodex, plannedOptions) {
1287
- var _this$apiConfig27;
1467
+ var _getDimensionbyId = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee15(id, iln, catalogCodex, plannedOptions) {
1468
+ var _this$apiConfig28;
1288
1469
  var fullUrl, res, headers;
1289
- return _regeneratorRuntime__default["default"].wrap(function _callee11$(_context11) {
1290
- while (1) switch (_context11.prev = _context11.next) {
1470
+ return _regeneratorRuntime__default["default"].wrap(function _callee15$(_context15) {
1471
+ while (1) switch (_context15.prev = _context15.next) {
1291
1472
  case 0:
1292
- fullUrl = this.getConstructorServiceUrl() + '/dimension/' + id + '?iln=' + iln + '&catalogCodex=' + catalogCodex + '&debug=' + ((_this$apiConfig27 = this.apiConfig) === null || _this$apiConfig27 === void 0 ? void 0 : _this$apiConfig27.useDebugUrl);
1473
+ fullUrl = this.getConstructorServiceUrl() + '/dimension/' + id + '?iln=' + iln + '&catalogCodex=' + catalogCodex + '&debug=' + ((_this$apiConfig28 = this.apiConfig) === null || _this$apiConfig28 === void 0 ? void 0 : _this$apiConfig28.useDebugUrl);
1293
1474
  headers = {};
1294
1475
  if (this.jwt) headers = {
1295
1476
  Authorization: 'Bearer ' + this.jwt
1296
1477
  };else if (this.apiKey) headers = {
1297
1478
  'X-API-KEY': this.apiKey
1298
1479
  };
1299
- _context11.prev = 3;
1300
- _context11.next = 6;
1480
+ _context15.prev = 3;
1481
+ _context15.next = 6;
1301
1482
  return this.fetchData(fullUrl, {
1302
1483
  method: 'POST',
1303
1484
  data: {
@@ -1308,23 +1489,23 @@ var DivaApiHandler = /*#__PURE__*/function () {
1308
1489
  }
1309
1490
  });
1310
1491
  case 6:
1311
- res = _context11.sent;
1312
- return _context11.abrupt("return", res);
1492
+ res = _context15.sent;
1493
+ return _context15.abrupt("return", res);
1313
1494
  case 10:
1314
- _context11.prev = 10;
1315
- _context11.t0 = _context11["catch"](3);
1495
+ _context15.prev = 10;
1496
+ _context15.t0 = _context15["catch"](3);
1316
1497
  LOG$p.error({
1317
1498
  message: 'Could not fetch dimension',
1318
1499
  name: 'get dimension error'
1319
1500
  });
1320
- return _context11.abrupt("return", undefined);
1501
+ return _context15.abrupt("return", undefined);
1321
1502
  case 14:
1322
1503
  case "end":
1323
- return _context11.stop();
1504
+ return _context15.stop();
1324
1505
  }
1325
- }, _callee11, this, [[3, 10]]);
1506
+ }, _callee15, this, [[3, 10]]);
1326
1507
  }));
1327
- function getDimensionbyId(_x34, _x35, _x36, _x37) {
1508
+ function getDimensionbyId(_x39, _x40, _x41, _x42) {
1328
1509
  return _getDimensionbyId.apply(this, arguments);
1329
1510
  }
1330
1511
  return getDimensionbyId;
@@ -1332,7 +1513,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
1332
1513
  }, {
1333
1514
  key: "createBasketReport",
1334
1515
  value: function () {
1335
- var _createBasketReport = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee12(basket, _ref2) {
1516
+ var _createBasketReport = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee16(basket, _ref2) {
1336
1517
  var type,
1337
1518
  printOptions,
1338
1519
  savePdf,
@@ -1341,12 +1522,12 @@ var DivaApiHandler = /*#__PURE__*/function () {
1341
1522
  headers,
1342
1523
  result,
1343
1524
  val,
1344
- _args12 = arguments;
1345
- return _regeneratorRuntime__default["default"].wrap(function _callee12$(_context12) {
1346
- while (1) switch (_context12.prev = _context12.next) {
1525
+ _args16 = arguments;
1526
+ return _regeneratorRuntime__default["default"].wrap(function _callee16$(_context16) {
1527
+ while (1) switch (_context16.prev = _context16.next) {
1347
1528
  case 0:
1348
1529
  type = _ref2.type, printOptions = _objectWithoutProperties__default["default"](_ref2, _excluded);
1349
- savePdf = _args12.length > 2 && _args12[2] !== undefined ? _args12[2] : false;
1530
+ savePdf = _args16.length > 2 && _args16[2] !== undefined ? _args16[2] : false;
1350
1531
  data = {
1351
1532
  type: type,
1352
1533
  printOptions: printOptions,
@@ -1359,8 +1540,8 @@ var DivaApiHandler = /*#__PURE__*/function () {
1359
1540
  };else if (this.apiKey) headers = {
1360
1541
  'X-API-KEY': this.apiKey
1361
1542
  };
1362
- _context12.prev = 6;
1363
- _context12.next = 9;
1543
+ _context16.prev = 6;
1544
+ _context16.next = 9;
1364
1545
  return this.fetchData(url, {
1365
1546
  data: data,
1366
1547
  config: {
@@ -1369,7 +1550,7 @@ var DivaApiHandler = /*#__PURE__*/function () {
1369
1550
  method: 'POST'
1370
1551
  });
1371
1552
  case 9:
1372
- result = _context12.sent;
1553
+ result = _context16.sent;
1373
1554
  if (savePdf) {
1374
1555
  val = {};
1375
1556
  val[type] = result.url;
@@ -1388,20 +1569,20 @@ var DivaApiHandler = /*#__PURE__*/function () {
1388
1569
  }
1389
1570
  });
1390
1571
  }
1391
- return _context12.abrupt("return", result.url);
1572
+ return _context16.abrupt("return", result.url);
1392
1573
  case 14:
1393
- _context12.prev = 14;
1394
- _context12.t0 = _context12["catch"](6);
1574
+ _context16.prev = 14;
1575
+ _context16.t0 = _context16["catch"](6);
1395
1576
  LOG$p.error(new DivaUtils.DivaError('Error Connecting to Report Service', {
1396
- cause: _context12.t0
1577
+ cause: _context16.t0
1397
1578
  }));
1398
1579
  case 17:
1399
1580
  case "end":
1400
- return _context12.stop();
1581
+ return _context16.stop();
1401
1582
  }
1402
- }, _callee12, this, [[6, 14]]);
1583
+ }, _callee16, this, [[6, 14]]);
1403
1584
  }));
1404
- function createBasketReport(_x38, _x39) {
1585
+ function createBasketReport(_x43, _x44) {
1405
1586
  return _createBasketReport.apply(this, arguments);
1406
1587
  }
1407
1588
  return createBasketReport;
@@ -28524,7 +28705,7 @@ var DivaArticle = /*#__PURE__*/function () {
28524
28705
  break;
28525
28706
  }
28526
28707
  _context.next = 4;
28527
- return Promise.resolve().then(function () { return require('./ShelfPlanner-fceba713.js'); });
28708
+ return Promise.resolve().then(function () { return require('./ShelfPlanner-ec459d7e.js'); });
28528
28709
  case 4:
28529
28710
  _yield$import = _context.sent;
28530
28711
  ShelfPlanner = _yield$import["default"];
@@ -31790,6 +31971,7 @@ var DivaSet = /*#__PURE__*/function () {
31790
31971
  _defineProperty__default["default"](this, "favoritesChanged", false);
31791
31972
  _defineProperty__default["default"](this, "setState", void 0);
31792
31973
  _defineProperty__default["default"](this, "modifiedJ3D", []);
31974
+ _defineProperty__default["default"](this, "aiImageForBasket", void 0);
31793
31975
  /**
31794
31976
  * This function is called when the docking of two Elements is changed
31795
31977
  */
@@ -32062,6 +32244,24 @@ var DivaSet = /*#__PURE__*/function () {
32062
32244
  };
32063
32245
  }
32064
32246
  return _createClass__default["default"](DivaSet, [{
32247
+ key: "getAiImageAsJpg",
32248
+ value: function getAiImageAsJpg() {
32249
+ return this.aiImageForBasket;
32250
+ }
32251
+ }, {
32252
+ key: "setAiImageAsJpg",
32253
+ value: function setAiImageAsJpg(promptId, aiImageAsJPGBase64) {
32254
+ this.aiImageForBasket = {
32255
+ base64: aiImageAsJPGBase64,
32256
+ promptId: promptId
32257
+ };
32258
+ }
32259
+ }, {
32260
+ key: "clearAiImageAsJpg",
32261
+ value: function clearAiImageAsJpg() {
32262
+ this.aiImageForBasket = undefined;
32263
+ }
32264
+ }, {
32065
32265
  key: "addRelationsToArticles",
32066
32266
  value: function addRelationsToArticles(article1, article2) {
32067
32267
  if (article2.checkArtCodexIsAccessoire(article1.articleCodex)) {
@@ -33057,7 +33257,7 @@ var DivaSet = /*#__PURE__*/function () {
33057
33257
  break;
33058
33258
  }
33059
33259
  _context5.next = 3;
33060
- return Promise.resolve().then(function () { return require('./DoorPlanner-b10008cf.js'); });
33260
+ return Promise.resolve().then(function () { return require('./DoorPlanner-9eee1c48.js'); });
33061
33261
  case 3:
33062
33262
  _yield$import = _context5.sent;
33063
33263
  DoorPlanner = _yield$import["default"];
@@ -38711,8 +38911,8 @@ var DivaSetHandler = /*#__PURE__*/function () {
38711
38911
  key: "getOrderSet",
38712
38912
  value: function () {
38713
38913
  var _getOrderSet = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee30(set, catalogData, divaNr, repairOnly, returnTo) {
38714
- var _Object$values$, _set$getDivaArticles, _hqRenderScript, _set$basketConfigVari2, _set$basketConfigVari3;
38715
- var dontGenerateImages, orderSet, GroupType, plannerData, setImage, urlToPlanning2D, alternateSetImages, hqRenderScript, dimensions, promise3D, promise2D, promise3DAlternate, _yield$Promise$all, _yield$Promise$all2, _yield$Promise$all2$, plannerWarnings, bruttoPrice;
38914
+ var _Object$values$, _set$getDivaArticles, _hqRenderScript, _alternateSetImages, _set$basketConfigVari2, _set$basketConfigVari3;
38915
+ var dontGenerateImages, orderSet, GroupType, plannerData, setImage, urlToPlanning2D, urlToAiImage, alternateSetImages, hqRenderScript, dimensions, promise3D, promise2D, promiseAiImage, promise3DAlternate, _yield$Promise$all, _yield$Promise$all2, _yield$Promise$all2$, plannerWarnings, bruttoPrice;
38716
38916
  return _regeneratorRuntime__default["default"].wrap(function _callee30$(_context32) {
38717
38917
  while (1) switch (_context32.prev = _context32.next) {
38718
38918
  case 0:
@@ -38722,30 +38922,35 @@ var DivaSetHandler = /*#__PURE__*/function () {
38722
38922
  plannerData = set.plannerHandler.savePlanner(set.getSetId());
38723
38923
  setImage = undefined;
38724
38924
  urlToPlanning2D = undefined;
38925
+ urlToAiImage = undefined;
38725
38926
  alternateSetImages = undefined;
38726
38927
  hqRenderScript = undefined;
38727
38928
  dimensions = {};
38728
38929
  if (dontGenerateImages) {
38729
- _context32.next = 23;
38930
+ _context32.next = 26;
38730
38931
  break;
38731
38932
  }
38732
38933
  promise3D = this.getSetImage(set, typeof window === 'undefined');
38733
38934
  promise2D = this.get2DSetImage(set);
38935
+ if (set.getAiImageAsJpg()) {
38936
+ promiseAiImage = this.getAiImage(set);
38937
+ }
38734
38938
  if (!catalogData.dontSaveAlternativeRenderings && set.CatalogData.alternateRenderingsForSummary.length) {
38735
38939
  promise3DAlternate = this.getAlternateSetImages(set);
38736
38940
  }
38737
- _context32.next = 15;
38738
- return Promise.all([promise3D, promise2D, promise3DAlternate, this.getHQRenderScript(set, divaNr)]);
38739
- case 15:
38941
+ _context32.next = 17;
38942
+ return Promise.all([promise3D, promise2D, promiseAiImage, promise3DAlternate, this.getHQRenderScript(set, divaNr)]);
38943
+ case 17:
38740
38944
  _yield$Promise$all = _context32.sent;
38741
- _yield$Promise$all2 = _slicedToArray__default["default"](_yield$Promise$all, 4);
38945
+ _yield$Promise$all2 = _slicedToArray__default["default"](_yield$Promise$all, 5);
38742
38946
  _yield$Promise$all2$ = _yield$Promise$all2[0];
38743
38947
  setImage = _yield$Promise$all2$.url;
38744
38948
  dimensions = _yield$Promise$all2$.dimensions;
38745
38949
  urlToPlanning2D = _yield$Promise$all2[1];
38746
- alternateSetImages = _yield$Promise$all2[2];
38747
- hqRenderScript = _yield$Promise$all2[3];
38748
- case 23:
38950
+ urlToAiImage = _yield$Promise$all2[2];
38951
+ alternateSetImages = _yield$Promise$all2[3];
38952
+ hqRenderScript = _yield$Promise$all2[4];
38953
+ case 26:
38749
38954
  plannerWarnings = [];
38750
38955
  if (!this.getPlanningIsComplete(set)) plannerWarnings.push('INCOMPLETE');
38751
38956
  DivaUtils__default["default"].endSpanOfApm('GetSet3D und 2D Image');
@@ -38782,7 +38987,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
38782
38987
  Set2DImage: urlToPlanning2D,
38783
38988
  VariantDescription: DivaUtils__default["default"].stripTags(set.getVariantsDescription()),
38784
38989
  VariantDescription_locales: DivaUtils__default["default"].stripTagsFromDict(set.getVariantsDescription_locales()),
38785
- SetImages: alternateSetImages,
38990
+ SetImages: [].concat(_toConsumableArray__default["default"](urlToAiImage ? [urlToAiImage] : []), _toConsumableArray__default["default"]((_alternateSetImages = alternateSetImages) !== null && _alternateSetImages !== void 0 ? _alternateSetImages : [])),
38786
38991
  SetHash: set.setHash,
38787
38992
  SetPlanData: plannerData != undefined ? DivaUtils__default["default"].encodeBase64(JSON.stringify(plannerData)) : '',
38788
38993
  SetID: set.getSetId(),
@@ -38809,7 +39014,7 @@ var DivaSetHandler = /*#__PURE__*/function () {
38809
39014
  MetaData_locales: !((_set$basketConfigVari3 = set.basketConfigVariants) !== null && _set$basketConfigVari3 !== void 0 && _set$basketConfigVari3.length) ? set.MetaData_locales : undefined
38810
39015
  });
38811
39016
  return _context32.abrupt("return", orderSet);
38812
- case 29:
39017
+ case 32:
38813
39018
  case "end":
38814
39019
  return _context32.stop();
38815
39020
  }
@@ -38961,18 +39166,18 @@ var DivaSetHandler = /*#__PURE__*/function () {
38961
39166
  key: "get2DSetImage",
38962
39167
  value: function () {
38963
39168
  var _get2DSetImage = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee34(set) {
38964
- var urlToPlanning2D, catalogData, planning2DAsJPGBase64;
39169
+ var urlToPlanning2D, planning2DAsJPGBase64;
38965
39170
  return _regeneratorRuntime__default["default"].wrap(function _callee34$(_context36) {
38966
39171
  while (1) switch (_context36.prev = _context36.next) {
38967
39172
  case 0:
38968
- urlToPlanning2D = undefined, catalogData = set.CatalogData;
39173
+ urlToPlanning2D = undefined;
38969
39174
  planning2DAsJPGBase64 = set.getPlanning2DAsJpg();
38970
39175
  if (!(planning2DAsJPGBase64 != undefined && planning2DAsJPGBase64 != '' && planning2DAsJPGBase64 != 'data:,')) {
38971
39176
  _context36.next = 6;
38972
39177
  break;
38973
39178
  }
38974
39179
  _context36.next = 5;
38975
- return set.plannerHandler.saveSet2DImage(set.getSetId(), catalogData.catalogCodex, catalogData.catalogGuid, planning2DAsJPGBase64);
39180
+ return set.plannerHandler.saveSet2DImage(set.CatalogData.catalogCodex, set.CatalogData.catalogGuid, planning2DAsJPGBase64);
38976
39181
  case 5:
38977
39182
  urlToPlanning2D = _context36.sent;
38978
39183
  case 6:
@@ -38988,6 +39193,31 @@ var DivaSetHandler = /*#__PURE__*/function () {
38988
39193
  }
38989
39194
  return get2DSetImage;
38990
39195
  }()
39196
+ }, {
39197
+ key: "getAiImage",
39198
+ value: function () {
39199
+ var _getAiImage = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee35(set) {
39200
+ var catalogData, _ref3, promptId, base64;
39201
+ return _regeneratorRuntime__default["default"].wrap(function _callee35$(_context37) {
39202
+ while (1) switch (_context37.prev = _context37.next) {
39203
+ case 0:
39204
+ catalogData = set.CatalogData;
39205
+ _ref3 = set.getAiImageAsJpg(), promptId = _ref3.promptId, base64 = _ref3.base64;
39206
+ _context37.next = 4;
39207
+ return set.plannerHandler.saveAiImage(promptId, catalogData.catalogCodex, catalogData.catalogGuid, base64);
39208
+ case 4:
39209
+ return _context37.abrupt("return", _context37.sent);
39210
+ case 5:
39211
+ case "end":
39212
+ return _context37.stop();
39213
+ }
39214
+ }, _callee35);
39215
+ }));
39216
+ function getAiImage(_x128) {
39217
+ return _getAiImage.apply(this, arguments);
39218
+ }
39219
+ return getAiImage;
39220
+ }()
38991
39221
  }, {
38992
39222
  key: "getBBoxObject",
38993
39223
  value: function getBBoxObject(set, dimensions) {
@@ -39023,25 +39253,25 @@ var DivaSetHandler = /*#__PURE__*/function () {
39023
39253
  }, {
39024
39254
  key: "addOrderSetArticlesToExistingSet",
39025
39255
  value: function () {
39026
- var _addOrderSetArticlesToExistingSet = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee35(set, orderSet, lastSetToInitialize) {
39027
- return _regeneratorRuntime__default["default"].wrap(function _callee35$(_context37) {
39028
- while (1) switch (_context37.prev = _context37.next) {
39256
+ var _addOrderSetArticlesToExistingSet = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee36(set, orderSet, lastSetToInitialize) {
39257
+ return _regeneratorRuntime__default["default"].wrap(function _callee36$(_context38) {
39258
+ while (1) switch (_context38.prev = _context38.next) {
39029
39259
  case 0:
39030
39260
  //TODO: GLOBAL STUFF
39031
39261
  //this.updateActSet(set);
39032
39262
  orderSet.changeBasketIds();
39033
- _context37.next = 3;
39263
+ _context38.next = 3;
39034
39264
  return this.initOrderLineArticles(set, orderSet);
39035
39265
  case 3:
39036
- _context37.next = 5;
39266
+ _context38.next = 5;
39037
39267
  return set.plannerHandler.extendSet(set, orderSet.SetPlanData, lastSetToInitialize);
39038
39268
  case 5:
39039
39269
  case "end":
39040
- return _context37.stop();
39270
+ return _context38.stop();
39041
39271
  }
39042
- }, _callee35, this);
39272
+ }, _callee36, this);
39043
39273
  }));
39044
- function addOrderSetArticlesToExistingSet(_x128, _x129, _x130) {
39274
+ function addOrderSetArticlesToExistingSet(_x129, _x130, _x131) {
39045
39275
  return _addOrderSetArticlesToExistingSet.apply(this, arguments);
39046
39276
  }
39047
39277
  return addOrderSetArticlesToExistingSet;
@@ -40113,7 +40343,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
40113
40343
  break;
40114
40344
  case 3:
40115
40345
  _context12.next = 5;
40116
- return Promise.resolve().then(function () { return require('./PfisterWWSHandler-3f6e9c5e.js'); });
40346
+ return Promise.resolve().then(function () { return require('./PfisterWWSHandler-64e350c5.js'); });
40117
40347
  case 5:
40118
40348
  _yield$import = _context12.sent;
40119
40349
  PfisterWWSHandler = _yield$import["default"];
@@ -40121,7 +40351,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
40121
40351
  return _context12.abrupt("break", 27);
40122
40352
  case 9:
40123
40353
  _context12.next = 11;
40124
- return Promise.resolve().then(function () { return require('./LiviqueWWSHandler-f2975f8d.js'); });
40354
+ return Promise.resolve().then(function () { return require('./LiviqueWWSHandler-469f6583.js'); });
40125
40355
  case 11:
40126
40356
  _yield$import2 = _context12.sent;
40127
40357
  LiviqueWWSHandler = _yield$import2["default"];
@@ -40129,7 +40359,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
40129
40359
  return _context12.abrupt("break", 27);
40130
40360
  case 15:
40131
40361
  _context12.next = 17;
40132
- return Promise.resolve().then(function () { return require('./SeriousBasketHandler-2826d982.js'); });
40362
+ return Promise.resolve().then(function () { return require('./SeriousBasketHandler-f367ca39.js'); });
40133
40363
  case 17:
40134
40364
  _yield$import3 = _context12.sent;
40135
40365
  SeriousWWSHandler = _yield$import3["default"];
@@ -40137,7 +40367,7 @@ var DivaBasketHandler = /*#__PURE__*/function () {
40137
40367
  return _context12.abrupt("break", 27);
40138
40368
  case 21:
40139
40369
  _context12.next = 23;
40140
- return Promise.resolve().then(function () { return require('./StandardWWSHandler-5713c9cb.js'); });
40370
+ return Promise.resolve().then(function () { return require('./StandardWWSHandler-0dff1df3.js'); });
40141
40371
  case 23:
40142
40372
  _yield$import4 = _context12.sent;
40143
40373
  StandardWWSHandler = _yield$import4["default"];
@@ -40734,12 +40964,7 @@ var Rendering = /*#__PURE__*/function () {
40734
40964
  _defineProperty__default["default"](this, "uiInfo", void 0);
40735
40965
  _defineProperty__default["default"](this, "urlToSavedRendering", void 0);
40736
40966
  // viewPoint: string;
40737
- // private posInfo: any;
40738
- //private doStream: boolean; Streaming over 3D Host is deprected
40739
- //private byteChunkArr: any;
40740
- //private byteChunkLayerMaskArr: any;
40741
40967
  _defineProperty__default["default"](this, "hasLayerMask", void 0);
40742
- //private imgBytes: any;
40743
40968
  _defineProperty__default["default"](this, "imgForSrc", void 0);
40744
40969
  _defineProperty__default["default"](this, "layerMaskAsBase64", void 0);
40745
40970
  _defineProperty__default["default"](this, "layerMaskThreeTexture", void 0);
@@ -41566,7 +41791,7 @@ var PlannerHandler3D = /*#__PURE__*/function () {
41566
41791
  while (1) switch (_context3.prev = _context3.next) {
41567
41792
  case 0:
41568
41793
  _context3.next = 2;
41569
- return Promise.resolve().then(function () { return require('./Host3DSignalR-37a3c53c.js'); });
41794
+ return Promise.resolve().then(function () { return require('./Host3DSignalR-eab2939e.js'); });
41570
41795
  case 2:
41571
41796
  _yield$import = _context3.sent;
41572
41797
  Host3DSignalR = _yield$import["default"];
@@ -41722,6 +41947,10 @@ var PlannerHandler3D = /*#__PURE__*/function () {
41722
41947
 
41723
41948
  if (this.checkRenderingReady(params.hash, waitedRendering) && waitedRendering.MediaServiceSaveMode == 'STREAM') {
41724
41949
  this.updatePlannerRendering(waitedRendering);
41950
+ } else {
41951
+ if (waitedRendering.MediaServiceSaveMode == 'PERMANENT') {
41952
+ this.updatePlannerRenderingInView(waitedRendering, true);
41953
+ }
41725
41954
  }
41726
41955
  return;
41727
41956
  }
@@ -42500,17 +42729,22 @@ var DivaMediaServiceHandler = /*#__PURE__*/function () {
42500
42729
  key: "base64ToBlob",
42501
42730
  value: function base64ToBlob(base64String, hash) {
42502
42731
  DivaUtils__default["default"].startSpanOfApm('MediaServiceHandler base64ToBlob');
42732
+ var type = 'image/jpeg';
42503
42733
  if (base64String.startsWith('data:image/jpeg;base64,')) {
42504
42734
  base64String = base64String.replace('data:image/jpeg;base64,', '');
42505
42735
  }
42736
+ if (base64String.startsWith('data:image/png;base64,')) {
42737
+ base64String = base64String.replace('data:image/png;base64,', '');
42738
+ type = 'image/png';
42739
+ }
42506
42740
  var binary_string = window.atob(base64String);
42507
42741
  var len = binary_string.length;
42508
42742
  var bytes = new Uint8Array(len);
42509
42743
  for (var i = 0; i < len; i++) {
42510
42744
  bytes[i] = binary_string.charCodeAt(i);
42511
42745
  }
42512
- var blob = new File([bytes.buffer], hash + '.jpg', {
42513
- type: 'image/jpeg'
42746
+ var blob = new File([bytes.buffer], hash + (type === 'image/jpeg' ? '.jpg' : '.png'), {
42747
+ type: type
42514
42748
  });
42515
42749
  DivaUtils__default["default"].endSpanOfApm('MediaServiceHandler base64ToBlob');
42516
42750
  return blob;
@@ -42580,6 +42814,90 @@ var DivaMediaServiceHandler = /*#__PURE__*/function () {
42580
42814
  }
42581
42815
  return savePlanning2DPermanent;
42582
42816
  }()
42817
+ /**
42818
+ * Save AI-generated base64 image to media service
42819
+ * @param hash Unique identifier for the image
42820
+ * @param base64Image Base64 encoded image data
42821
+ * @param promptId Optional prompt ID for reference
42822
+ * @param userId Optional user ID for tracking
42823
+ * @param organizationId Optional organization ID (defaults to instance organizationId)
42824
+ * @returns Promise<string> URL of the saved image or empty string on error
42825
+ */
42826
+ }, {
42827
+ key: "saveAiImagePermanent",
42828
+ value: (function () {
42829
+ var _saveAiImagePermanent = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(hash, base64Image, catalogCodex, catalogGUID, organizationId) {
42830
+ var imageBlob, url, data, mediaItem, mediaItemRef, response, _res$variants$big, _res$variants, res;
42831
+ return _regeneratorRuntime__default["default"].wrap(function _callee2$(_context2) {
42832
+ while (1) switch (_context2.prev = _context2.next) {
42833
+ case 0:
42834
+ DivaUtils__default["default"].startSpanOfApm('MediaServiceHandler saveAiImagePermanent');
42835
+ imageBlob = this.base64ToBlob(base64Image, hash);
42836
+ url = this.mediaServiceUrl + this.POST_mediaItem;
42837
+ data = new FormData();
42838
+ data.append('file', imageBlob);
42839
+ mediaItem = {
42840
+ organizationId: organizationId || this.organizationId,
42841
+ mediaType: 'PCT',
42842
+ fileName: hash + '.png'
42843
+ };
42844
+ data.append('mediaItem', JSON.stringify(mediaItem));
42845
+ mediaItemRef = {
42846
+ functionType: 'ART',
42847
+ aiImageHash: hash,
42848
+ catalogCodex: catalogCodex,
42849
+ catalogGuid: catalogGUID
42850
+ };
42851
+ data.append('mediaItemRef', JSON.stringify(mediaItemRef));
42852
+ _context2.prev = 9;
42853
+ _context2.next = 12;
42854
+ return fetch(url, {
42855
+ method: 'POST',
42856
+ body: data,
42857
+ headers: {
42858
+ Authorization: 'Bearer ' + this.jwt
42859
+ }
42860
+ });
42861
+ case 12:
42862
+ response = _context2.sent;
42863
+ if (!response.ok) {
42864
+ _context2.next = 22;
42865
+ break;
42866
+ }
42867
+ _context2.next = 16;
42868
+ return response.json();
42869
+ case 16:
42870
+ res = _context2.sent;
42871
+ LOG$3.debug('Successfully saved AI image in media Service. URL: ' + res.url);
42872
+ DivaUtils__default["default"].endSpanOfApm('MediaServiceHandler saveAiImagePermanent');
42873
+ return _context2.abrupt("return", (_res$variants$big = (_res$variants = res.variants) === null || _res$variants === void 0 ? void 0 : _res$variants.big) !== null && _res$variants$big !== void 0 ? _res$variants$big : res.url);
42874
+ case 22:
42875
+ LOG$3.error(new DivaUtils.DivaError('Error when saving the AI image on mediaService. Hash: ' + hash + ' response: ' + response, {
42876
+ code: 'AI_001'
42877
+ }));
42878
+ case 23:
42879
+ _context2.next = 28;
42880
+ break;
42881
+ case 25:
42882
+ _context2.prev = 25;
42883
+ _context2.t0 = _context2["catch"](9);
42884
+ LOG$3.error(new DivaUtils.DivaError('Exception when saving AI image. Hash: ' + hash + ' error: ' + _context2.t0, {
42885
+ code: 'AI_002'
42886
+ }));
42887
+ case 28:
42888
+ DivaUtils__default["default"].endSpanOfApm('MediaServiceHandler saveAiImagePermanent');
42889
+ return _context2.abrupt("return", '');
42890
+ case 30:
42891
+ case "end":
42892
+ return _context2.stop();
42893
+ }
42894
+ }, _callee2, this, [[9, 25]]);
42895
+ }));
42896
+ function saveAiImagePermanent(_x5, _x6, _x7, _x8, _x9) {
42897
+ return _saveAiImagePermanent.apply(this, arguments);
42898
+ }
42899
+ return saveAiImagePermanent;
42900
+ }())
42583
42901
  }]);
42584
42902
  }();
42585
42903
  var mediaServiceHandler = new DivaMediaServiceHandler();
@@ -43124,7 +43442,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43124
43442
  break;
43125
43443
  case 8:
43126
43444
  _context4.next = 10;
43127
- return Promise.resolve().then(function () { return require('./DivaStandardPlanner-cafdfb2e.js'); });
43445
+ return Promise.resolve().then(function () { return require('./DivaStandardPlanner-e13f9c94.js'); });
43128
43446
  case 10:
43129
43447
  _yield$import = _context4.sent;
43130
43448
  DivaStandardPlanner = _yield$import["default"];
@@ -43135,7 +43453,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43135
43453
  return _context4.abrupt("break", 21);
43136
43454
  case 15:
43137
43455
  _context4.next = 17;
43138
- return Promise.resolve().then(function () { return require('./DivaBoxPlanner-a1c27537.js'); });
43456
+ return Promise.resolve().then(function () { return require('./DivaBoxPlanner-19fff9fc.js'); });
43139
43457
  case 17:
43140
43458
  _yield$import2 = _context4.sent;
43141
43459
  DivaBoxPlanner = _yield$import2["default"];
@@ -43591,7 +43909,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43591
43909
  }, {
43592
43910
  key: "saveSet2DImage",
43593
43911
  value: function () {
43594
- var _saveSet2DImage = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee12(setId, catCodex, catGUID, planning2DAsJPGBase64) {
43912
+ var _saveSet2DImage = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee12(catCodex, catGUID, planning2DAsJPGBase64) {
43595
43913
  var curPlanningHash, urlToPlanning2D;
43596
43914
  return _regeneratorRuntime__default["default"].wrap(function _callee12$(_context12) {
43597
43915
  while (1) switch (_context12.prev = _context12.next) {
@@ -43611,11 +43929,46 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43611
43929
  }
43612
43930
  }, _callee12, this);
43613
43931
  }));
43614
- function saveSet2DImage(_x19, _x20, _x21, _x22) {
43932
+ function saveSet2DImage(_x19, _x20, _x21) {
43615
43933
  return _saveSet2DImage.apply(this, arguments);
43616
43934
  }
43617
43935
  return saveSet2DImage;
43618
43936
  }()
43937
+ }, {
43938
+ key: "saveAiImage",
43939
+ value: function () {
43940
+ var _saveAiImage = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee13(promptId, catCodex, catGUID, aiImageAsJPGBase64) {
43941
+ var curPlanningHash, urlToAiImage;
43942
+ return _regeneratorRuntime__default["default"].wrap(function _callee13$(_context13) {
43943
+ while (1) switch (_context13.prev = _context13.next) {
43944
+ case 0:
43945
+ //Get current hash.
43946
+ DivaUtils__default["default"].startSpanOfApm('DivaPlannerHandler saveAiImage');
43947
+ curPlanningHash = this.createPlanningHash();
43948
+ _context13.next = 4;
43949
+ return mediaServiceHandler.saveAiImagePermanent(promptId + '_' + curPlanningHash, aiImageAsJPGBase64, catCodex, catGUID);
43950
+ case 4:
43951
+ urlToAiImage = _context13.sent;
43952
+ DivaUtils__default["default"].endSpanOfApm('DivaPlannerHandler saveAiImage');
43953
+ return _context13.abrupt("return", {
43954
+ RenderWidth: 1024,
43955
+ RenderHeight: 1024,
43956
+ Description: 'AI Image',
43957
+ Filename: promptId + '_' + curPlanningHash + '.png',
43958
+ Id: promptId + '_' + curPlanningHash,
43959
+ URL: urlToAiImage
43960
+ });
43961
+ case 7:
43962
+ case "end":
43963
+ return _context13.stop();
43964
+ }
43965
+ }, _callee13, this);
43966
+ }));
43967
+ function saveAiImage(_x22, _x23, _x24, _x25) {
43968
+ return _saveAiImage.apply(this, arguments);
43969
+ }
43970
+ return saveAiImage;
43971
+ }()
43619
43972
  /**
43620
43973
  * This function is called in order to destroy a planner. All elements are cleared all saved resources are cleared.
43621
43974
  * @param setId The setID the planner belongs to
@@ -43666,35 +44019,35 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43666
44019
  }, {
43667
44020
  key: "addPlannerElement",
43668
44021
  value: function () {
43669
- var _addPlannerElement = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee13(setId, basketId, initParams) {
44022
+ var _addPlannerElement = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee14(setId, basketId, initParams) {
43670
44023
  var _this$plannerList$get;
43671
- return _regeneratorRuntime__default["default"].wrap(function _callee13$(_context13) {
43672
- while (1) switch (_context13.prev = _context13.next) {
44024
+ return _regeneratorRuntime__default["default"].wrap(function _callee14$(_context14) {
44025
+ while (1) switch (_context14.prev = _context14.next) {
43673
44026
  case 0:
43674
44027
  DivaUtils__default["default"].startSpanOfApm('DivaPlannerHandler addPlannerElement');
43675
44028
  if (this.plannerList.has(setId)) {
43676
- _context13.next = 4;
44029
+ _context14.next = 4;
43677
44030
  break;
43678
44031
  }
43679
44032
  DivaUtils__default["default"].endSpanOfApm('DivaPlannerHandler addPlannerElement');
43680
- return _context13.abrupt("return");
44033
+ return _context14.abrupt("return");
43681
44034
  case 4:
43682
- _context13.next = 6;
44035
+ _context14.next = 6;
43683
44036
  return this.plannerList.get(setId).addPlannerElement(basketId, initParams);
43684
44037
  case 6:
43685
44038
  this.setPlannerHandler.updateSetPosNr(this.plannerList);
43686
44039
  this.setPlannerHandler.calcGlobalBoundingBox(this.plannerList);
43687
44040
  DivaUtils__default["default"].endSpanOfApm('DivaPlannerHandler addPlannerElement');
43688
- return _context13.abrupt("return", (_this$plannerList$get = this.plannerList.get(setId)) === null || _this$plannerList$get === void 0 ? void 0 : _this$plannerList$get.getAllViewPlannerElements().find(function (item) {
44041
+ return _context14.abrupt("return", (_this$plannerList$get = this.plannerList.get(setId)) === null || _this$plannerList$get === void 0 ? void 0 : _this$plannerList$get.getAllViewPlannerElements().find(function (item) {
43689
44042
  return item.getBasketId() == basketId;
43690
44043
  }));
43691
44044
  case 10:
43692
44045
  case "end":
43693
- return _context13.stop();
44046
+ return _context14.stop();
43694
44047
  }
43695
- }, _callee13, this);
44048
+ }, _callee14, this);
43696
44049
  }));
43697
- function addPlannerElement(_x23, _x24, _x25) {
44050
+ function addPlannerElement(_x26, _x27, _x28) {
43698
44051
  return _addPlannerElement.apply(this, arguments);
43699
44052
  }
43700
44053
  return addPlannerElement;
@@ -43702,36 +44055,36 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43702
44055
  }, {
43703
44056
  key: "deletePlannerElement",
43704
44057
  value: function () {
43705
- var _deletePlannerElement = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee14(setId, elementId, autoCorrectAVL_AVR, deletionType) {
44058
+ var _deletePlannerElement = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee15(setId, elementId, autoCorrectAVL_AVR, deletionType) {
43706
44059
  var response;
43707
- return _regeneratorRuntime__default["default"].wrap(function _callee14$(_context14) {
43708
- while (1) switch (_context14.prev = _context14.next) {
44060
+ return _regeneratorRuntime__default["default"].wrap(function _callee15$(_context15) {
44061
+ while (1) switch (_context15.prev = _context15.next) {
43709
44062
  case 0:
43710
44063
  DivaUtils__default["default"].startSpanOfApm('DivaPlannerHandler deletePlannerElement');
43711
44064
  if (this.plannerList.has(setId)) {
43712
- _context14.next = 4;
44065
+ _context15.next = 4;
43713
44066
  break;
43714
44067
  }
43715
44068
  DivaUtils__default["default"].endSpanOfApm('DivaPlannerHandler deletePlannerElement');
43716
- return _context14.abrupt("return", {
44069
+ return _context15.abrupt("return", {
43717
44070
  newElementToSelect: -1
43718
44071
  });
43719
44072
  case 4:
43720
- _context14.next = 6;
44073
+ _context15.next = 6;
43721
44074
  return this.plannerList.get(setId).deletePlannerElement(elementId, autoCorrectAVL_AVR, deletionType);
43722
44075
  case 6:
43723
- response = _context14.sent;
44076
+ response = _context15.sent;
43724
44077
  this.setPlannerHandler.updateSetPosNr(this.plannerList);
43725
44078
  this.setPlannerHandler.calcGlobalBoundingBox(this.plannerList);
43726
44079
  DivaUtils__default["default"].endSpanOfApm('DivaPlannerHandler deletePlannerElement');
43727
- return _context14.abrupt("return", response);
44080
+ return _context15.abrupt("return", response);
43728
44081
  case 11:
43729
44082
  case "end":
43730
- return _context14.stop();
44083
+ return _context15.stop();
43731
44084
  }
43732
- }, _callee14, this);
44085
+ }, _callee15, this);
43733
44086
  }));
43734
- function deletePlannerElement(_x26, _x27, _x28, _x29) {
44087
+ function deletePlannerElement(_x29, _x30, _x31, _x32) {
43735
44088
  return _deletePlannerElement.apply(this, arguments);
43736
44089
  }
43737
44090
  return deletePlannerElement;
@@ -43774,31 +44127,31 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43774
44127
  }, {
43775
44128
  key: "copyPlannerElements",
43776
44129
  value: (function () {
43777
- var _copyPlannerElements = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee15(setId, articleCopyRelation, copyInfo) {
44130
+ var _copyPlannerElements = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee16(setId, articleCopyRelation, copyInfo) {
43778
44131
  var response;
43779
- return _regeneratorRuntime__default["default"].wrap(function _callee15$(_context15) {
43780
- while (1) switch (_context15.prev = _context15.next) {
44132
+ return _regeneratorRuntime__default["default"].wrap(function _callee16$(_context16) {
44133
+ while (1) switch (_context16.prev = _context16.next) {
43781
44134
  case 0:
43782
44135
  if (!(!this.plannerList.has(setId) || !copyInfo)) {
43783
- _context15.next = 2;
44136
+ _context16.next = 2;
43784
44137
  break;
43785
44138
  }
43786
- return _context15.abrupt("return");
44139
+ return _context16.abrupt("return");
43787
44140
  case 2:
43788
- _context15.next = 4;
44141
+ _context16.next = 4;
43789
44142
  return this.plannerList.get(setId).copyPlannerElement(articleCopyRelation, copyInfo);
43790
44143
  case 4:
43791
- response = _context15.sent;
44144
+ response = _context16.sent;
43792
44145
  this.setPlannerHandler.updateSetPosNr(this.plannerList);
43793
44146
  this.setPlannerHandler.calcGlobalBoundingBox(this.plannerList);
43794
- return _context15.abrupt("return", response);
44147
+ return _context16.abrupt("return", response);
43795
44148
  case 8:
43796
44149
  case "end":
43797
- return _context15.stop();
44150
+ return _context16.stop();
43798
44151
  }
43799
- }, _callee15, this);
44152
+ }, _callee16, this);
43800
44153
  }));
43801
- function copyPlannerElements(_x30, _x31, _x32) {
44154
+ function copyPlannerElements(_x33, _x34, _x35) {
43802
44155
  return _copyPlannerElements.apply(this, arguments);
43803
44156
  }
43804
44157
  return copyPlannerElements;
@@ -43934,29 +44287,29 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43934
44287
  }, {
43935
44288
  key: "request3D",
43936
44289
  value: function () {
43937
- var _request3D = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee16(doRequestRendering, doRequestHqRenderScript, alternateRenderingsExist, alternateRenderInfo, forceReloadPlanning, renderRequestInfos, hybrid3DInfo, useLatestHybridInfo) {
44290
+ var _request3D = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee17(doRequestRendering, doRequestHqRenderScript, alternateRenderingsExist, alternateRenderInfo, forceReloadPlanning, renderRequestInfos, hybrid3DInfo, useLatestHybridInfo) {
43938
44291
  var _this3 = this;
43939
44292
  var plannerData, loadedCatData, plannerExists, savedSetId;
43940
- return _regeneratorRuntime__default["default"].wrap(function _callee16$(_context16) {
43941
- while (1) switch (_context16.prev = _context16.next) {
44293
+ return _regeneratorRuntime__default["default"].wrap(function _callee17$(_context17) {
44294
+ while (1) switch (_context17.prev = _context17.next) {
43942
44295
  case 0:
43943
44296
  if (!doRequestRendering) {
43944
- _context16.next = 9;
44297
+ _context17.next = 9;
43945
44298
  break;
43946
44299
  }
43947
44300
  if (renderRequestInfos) {
43948
- _context16.next = 6;
44301
+ _context17.next = 6;
43949
44302
  break;
43950
44303
  }
43951
44304
  LOG$2.error(new DivaUtils.DivaError('Error requesting 3D rendering. No renderRequestInfo is set'));
43952
- return _context16.abrupt("return");
44305
+ return _context17.abrupt("return");
43953
44306
  case 6:
43954
44307
  if (!(renderRequestInfos.width <= 0 || isNaN(renderRequestInfos.width) || renderRequestInfos.height <= 0 || isNaN(renderRequestInfos.height))) {
43955
- _context16.next = 9;
44308
+ _context17.next = 9;
43956
44309
  break;
43957
44310
  }
43958
44311
  LOG$2.error(new DivaUtils.DivaError('Error requesting rendering. Not valid width or height request width: ' + renderRequestInfos.width + ' height: ' + renderRequestInfos.height));
43959
- return _context16.abrupt("return");
44312
+ return _context17.abrupt("return");
43960
44313
  case 9:
43961
44314
  plannerData = this.handler3D.initPlannerData(this.plannerHandlerFunctions.doAllowSetPlanner());
43962
44315
  loadedCatData = [];
@@ -43986,7 +44339,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43986
44339
  });
43987
44340
  });
43988
44341
  if (!plannerExists) {
43989
- _context16.next = 19;
44342
+ _context17.next = 19;
43990
44343
  break;
43991
44344
  }
43992
44345
  // if not in set planner mode overwrite s1 with correct setId
@@ -43994,7 +44347,7 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
43994
44347
  plannerData.SCE.ROO[0].SET[0].ID = savedSetId;
43995
44348
  plannerData.SCE.ROO[0].SelectSet = savedSetId;
43996
44349
  }
43997
- _context16.next = 18;
44350
+ _context17.next = 18;
43998
44351
  return this.handler3D.request3D({
43999
44352
  doRequestRendering: doRequestRendering,
44000
44353
  doRequestHqRenderScript: doRequestHqRenderScript,
@@ -44009,16 +44362,16 @@ var DivaPlannerHandler = /*#__PURE__*/function () {
44009
44362
  useLatestHybridInfo: useLatestHybridInfo
44010
44363
  });
44011
44364
  case 18:
44012
- return _context16.abrupt("return", _context16.sent);
44365
+ return _context17.abrupt("return", _context17.sent);
44013
44366
  case 19:
44014
- return _context16.abrupt("return");
44367
+ return _context17.abrupt("return");
44015
44368
  case 20:
44016
44369
  case "end":
44017
- return _context16.stop();
44370
+ return _context17.stop();
44018
44371
  }
44019
- }, _callee16, this);
44372
+ }, _callee17, this);
44020
44373
  }));
44021
- function request3D(_x33, _x34, _x35, _x36, _x37, _x38, _x39, _x40) {
44374
+ function request3D(_x36, _x37, _x38, _x39, _x40, _x41, _x42, _x43) {
44022
44375
  return _request3D.apply(this, arguments);
44023
44376
  }
44024
44377
  return request3D;
@@ -44241,15 +44594,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
44241
44594
  */
44242
44595
  _defineProperty__default["default"](this, "updatePlannerRendering", function (rendering) {
44243
44596
  var _this$state;
44597
+ var onlyUpdateState = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
44244
44598
  if (rendering.getIsFullscreenRendering()) {
44245
44599
  _this.updateFullscreenRendering(rendering);
44246
44600
  } else {
44247
- var _this$actSet;
44248
- _this.updatePlanner3DImage(rendering, ((_this$actSet = _this.actSet()) === null || _this$actSet === void 0 ? void 0 : _this$actSet.getAlternateRenderInfo().length) > 0);
44601
+ var _this$updatePlanner3D;
44602
+ (_this$updatePlanner3D = _this.updatePlanner3DImage) === null || _this$updatePlanner3D === void 0 || _this$updatePlanner3D.call(_this, rendering, onlyUpdateState);
44249
44603
  }
44250
44604
  if (_this.actions && (_this$state = _this.state) !== null && _this$state !== void 0 && _this$state.enableSupport) {
44251
- var _this$actSet2, _this$state$user, _this$state$user2, _this$state$user3;
44252
- _this.api.postPlanningInfo((_this$actSet2 = _this.actSet()) === null || _this$actSet2 === void 0 ? void 0 : _this$actSet2.getVariantBasketData(), _this.divaNr, rendering.getImageForSrc(), _this.getCurSetPrice() + setHandlerInstance.getActSetPriceFormat(_this.actSet()), _this.getCurCatalogName(), (_this$state$user = _this.state.user) === null || _this$state$user === void 0 ? void 0 : _this$state$user._id, (_this$state$user2 = _this.state.user) === null || _this$state$user2 === void 0 ? void 0 : _this$state$user2.name, (_this$state$user3 = _this.state.user) === null || _this$state$user3 === void 0 ? void 0 : _this$state$user3.familyName, _this.state.organization._id);
44605
+ var _this$actSet, _this$state$user, _this$state$user2, _this$state$user3;
44606
+ _this.api.postPlanningInfo((_this$actSet = _this.actSet()) === null || _this$actSet === void 0 ? void 0 : _this$actSet.getVariantBasketData(), _this.divaNr, rendering.getImageForSrc(), _this.getCurSetPrice() + setHandlerInstance.getActSetPriceFormat(_this.actSet()), _this.getCurCatalogName(), (_this$state$user = _this.state.user) === null || _this$state$user === void 0 ? void 0 : _this$state$user._id, (_this$state$user2 = _this.state.user) === null || _this$state$user2 === void 0 ? void 0 : _this$state$user2.name, (_this$state$user3 = _this.state.user) === null || _this$state$user3 === void 0 ? void 0 : _this$state$user3.familyName, _this.state.organization._id);
44253
44607
  }
44254
44608
  });
44255
44609
  /**
@@ -45200,16 +45554,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
45200
45554
  }, {
45201
45555
  key: "getDivaArticles",
45202
45556
  value: function getDivaArticles(visiblePartlistArticlesAlso, allPartlistArticlesAlso) {
45203
- var _this$actSet3;
45204
- return (_this$actSet3 = this.actSet()) === null || _this$actSet3 === void 0 ? void 0 : _this$actSet3.getDivaArticles(visiblePartlistArticlesAlso, allPartlistArticlesAlso);
45557
+ var _this$actSet2;
45558
+ return (_this$actSet2 = this.actSet()) === null || _this$actSet2 === void 0 ? void 0 : _this$actSet2.getDivaArticles(visiblePartlistArticlesAlso, allPartlistArticlesAlso);
45205
45559
  }
45206
45560
 
45207
45561
  //for debugging
45208
45562
  }, {
45209
45563
  key: "getFirstDivaArticles",
45210
45564
  value: function getFirstDivaArticles() {
45211
- var _this$actSet$getDivaA, _this$actSet4;
45212
- return Object.values((_this$actSet$getDivaA = (_this$actSet4 = this.actSet()) === null || _this$actSet4 === void 0 ? void 0 : _this$actSet4.getDivaArticles()) !== null && _this$actSet$getDivaA !== void 0 ? _this$actSet$getDivaA : {})[0];
45565
+ var _this$actSet$getDivaA, _this$actSet3;
45566
+ return Object.values((_this$actSet$getDivaA = (_this$actSet3 = this.actSet()) === null || _this$actSet3 === void 0 ? void 0 : _this$actSet3.getDivaArticles()) !== null && _this$actSet$getDivaA !== void 0 ? _this$actSet$getDivaA : {})[0];
45213
45567
  }
45214
45568
  }, {
45215
45569
  key: "getHiddenOptions",
@@ -45277,8 +45631,8 @@ var DivaWebPlanner = /*#__PURE__*/function () {
45277
45631
  }, {
45278
45632
  key: "updateWebConfiguratorTitle",
45279
45633
  value: function updateWebConfiguratorTitle() {
45280
- var _this$setWebConifgura, _this$actSet5;
45281
- (_this$setWebConifgura = this.setWebConifguratorTitle) === null || _this$setWebConifgura === void 0 || _this$setWebConifgura.call(this, (_this$actSet5 = this.actSet()) === null || _this$actSet5 === void 0 ? void 0 : _this$actSet5.getSetTitle());
45634
+ var _this$setWebConifgura, _this$actSet4;
45635
+ (_this$setWebConifgura = this.setWebConifguratorTitle) === null || _this$setWebConifgura === void 0 || _this$setWebConifgura.call(this, (_this$actSet4 = this.actSet()) === null || _this$actSet4 === void 0 ? void 0 : _this$actSet4.getSetTitle());
45282
45636
  }
45283
45637
  }, {
45284
45638
  key: "updateConfigStructure",
@@ -45290,7 +45644,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
45290
45644
  value: function () {
45291
45645
  var _runInitMode = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee17(plannerMode) {
45292
45646
  var _this$plannerConfig$i, _this$state5;
45293
- var doDefault, _this$navigateToTabGr2, _this$saveToBasketWra, configStepKey, _this$navigateToConfi, _this$actSet6, _this$navigateToTabGr3, _this$navigateToTabGr4, _this$navigateToTabGr5;
45647
+ var doDefault, _this$navigateToTabGr2, _this$saveToBasketWra, configStepKey, _this$navigateToConfi, _this$actSet5, _this$navigateToTabGr3, _this$navigateToTabGr4, _this$navigateToTabGr5;
45294
45648
  return _regeneratorRuntime__default["default"].wrap(function _callee17$(_context17) {
45295
45649
  while (1) switch (_context17.prev = _context17.next) {
45296
45650
  case 0:
@@ -45322,7 +45676,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
45322
45676
  if (doDefault) {
45323
45677
  if (plannerMode == 'ProductList') {
45324
45678
  (_this$navigateToTabGr3 = this.navigateToTabGroup) === null || _this$navigateToTabGr3 === void 0 || _this$navigateToTabGr3.call(this, 'PRODUCTS');
45325
- } else if ((_this$actSet6 = this.actSet()) !== null && _this$actSet6 !== void 0 && _this$actSet6.hasStaticRoomList) {
45679
+ } else if ((_this$actSet5 = this.actSet()) !== null && _this$actSet5 !== void 0 && _this$actSet5.hasStaticRoomList) {
45326
45680
  (_this$navigateToTabGr4 = this.navigateToTabGroup) === null || _this$navigateToTabGr4 === void 0 || _this$navigateToTabGr4.call(this, 'ROOMLIST', true);
45327
45681
  } else {
45328
45682
  (_this$navigateToTabGr5 = this.navigateToTabGroup) === null || _this$navigateToTabGr5 === void 0 || _this$navigateToTabGr5.call(this, this.getCurPlannerType(true), true);
@@ -45583,8 +45937,8 @@ var DivaWebPlanner = /*#__PURE__*/function () {
45583
45937
  }, {
45584
45938
  key: "getAlternateRenderingsForSummary",
45585
45939
  value: function getAlternateRenderingsForSummary() {
45586
- var _this$actSet7;
45587
- return (_this$actSet7 = this.actSet()) === null || _this$actSet7 === void 0 || (_this$actSet7 = _this$actSet7.CatalogData) === null || _this$actSet7 === void 0 ? void 0 : _this$actSet7.alternateRenderingsForSummary;
45940
+ var _this$actSet6;
45941
+ return (_this$actSet6 = this.actSet()) === null || _this$actSet6 === void 0 || (_this$actSet6 = _this$actSet6.CatalogData) === null || _this$actSet6 === void 0 ? void 0 : _this$actSet6.alternateRenderingsForSummary;
45588
45942
  }
45589
45943
  }, {
45590
45944
  key: "destroyWebPlanner",
@@ -45870,8 +46224,8 @@ var DivaWebPlanner = /*#__PURE__*/function () {
45870
46224
  }, {
45871
46225
  key: "setDifferentOptions",
45872
46226
  value: function setDifferentOptions(options) {
45873
- var _this$actSet8;
45874
- (_this$actSet8 = this.actSet()) === null || _this$actSet8 === void 0 || _this$actSet8.setDifferentOptions(options);
46227
+ var _this$actSet7;
46228
+ (_this$actSet7 = this.actSet()) === null || _this$actSet7 === void 0 || _this$actSet7.setDifferentOptions(options);
45875
46229
  }
45876
46230
  }, {
45877
46231
  key: "checkMatchingProducts",
@@ -45918,8 +46272,8 @@ var DivaWebPlanner = /*#__PURE__*/function () {
45918
46272
  }, {
45919
46273
  key: "updatePriceInView",
45920
46274
  value: function updatePriceInView() {
45921
- var _this$updatePrice, _this$actSet9;
45922
- (_this$updatePrice = this.updatePrice) === null || _this$updatePrice === void 0 || _this$updatePrice.call(this, setHandlerInstance.getTotalViewPrice(this.sets), this.actSet().getViewSetPrice(), setHandlerInstance.getTotalViewBruttoPrice(this.sets), undefined, (_this$actSet9 = this.actSet()) === null || _this$actSet9 === void 0 ? void 0 : _this$actSet9.getCustomDimensionsOfActSet());
46275
+ var _this$updatePrice, _this$actSet8, _this$actSet9;
46276
+ (_this$updatePrice = this.updatePrice) === null || _this$updatePrice === void 0 || _this$updatePrice.call(this, setHandlerInstance.getTotalViewPrice(this.sets), this.actSet().getViewSetPrice(), setHandlerInstance.getTotalViewBruttoPrice(this.sets), undefined, (_this$actSet8 = this.actSet()) === null || _this$actSet8 === void 0 ? void 0 : _this$actSet8.getCustomDimensionsOfActSet(), (_this$actSet9 = this.actSet()) === null || _this$actSet9 === void 0 ? void 0 : _this$actSet9.setHash);
45923
46277
  }
45924
46278
 
45925
46279
  /**
@@ -46211,6 +46565,127 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46211
46565
  if (!set) return;
46212
46566
  return setHandlerInstance.checkNotificationRules(set, targetArticles, visitedOptions, event);
46213
46567
  }
46568
+ }, {
46569
+ key: "generateAiImageWithReferenceImages",
46570
+ value: function () {
46571
+ var _generateAiImageWithReferenceImages = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee28(data, leadKey) {
46572
+ var _this$state6;
46573
+ return _regeneratorRuntime__default["default"].wrap(function _callee28$(_context28) {
46574
+ while (1) switch (_context28.prev = _context28.next) {
46575
+ case 0:
46576
+ _context28.next = 2;
46577
+ return this.api.generateAiImageWithReferenceImages(_objectSpread$6(_objectSpread$6({}, data), {}, {
46578
+ userId: (_this$state6 = this.state) === null || _this$state6 === void 0 || (_this$state6 = _this$state6.user) === null || _this$state6 === void 0 ? void 0 : _this$state6._id
46579
+ }), leadKey);
46580
+ case 2:
46581
+ return _context28.abrupt("return", _context28.sent);
46582
+ case 3:
46583
+ case "end":
46584
+ return _context28.stop();
46585
+ }
46586
+ }, _callee28, this);
46587
+ }));
46588
+ function generateAiImageWithReferenceImages(_x80, _x81) {
46589
+ return _generateAiImageWithReferenceImages.apply(this, arguments);
46590
+ }
46591
+ return generateAiImageWithReferenceImages;
46592
+ }()
46593
+ }, {
46594
+ key: "getUsageLimits",
46595
+ value: function () {
46596
+ var _getUsageLimits = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee29() {
46597
+ var _this$state7, _this$state8;
46598
+ var organizationId, userId;
46599
+ return _regeneratorRuntime__default["default"].wrap(function _callee29$(_context29) {
46600
+ while (1) switch (_context29.prev = _context29.next) {
46601
+ case 0:
46602
+ organizationId = (_this$state7 = this.state) === null || _this$state7 === void 0 ? void 0 : _this$state7.organization._id;
46603
+ userId = (_this$state8 = this.state) === null || _this$state8 === void 0 || (_this$state8 = _this$state8.user) === null || _this$state8 === void 0 ? void 0 : _this$state8._id;
46604
+ if (!(!organizationId || !userId)) {
46605
+ _context29.next = 4;
46606
+ break;
46607
+ }
46608
+ throw new Error('Organization ID or User ID is not set');
46609
+ case 4:
46610
+ _context29.next = 6;
46611
+ return this.api.getUsageLimits({
46612
+ organizationId: organizationId,
46613
+ userId: userId
46614
+ });
46615
+ case 6:
46616
+ return _context29.abrupt("return", _context29.sent);
46617
+ case 7:
46618
+ case "end":
46619
+ return _context29.stop();
46620
+ }
46621
+ }, _callee29, this);
46622
+ }));
46623
+ function getUsageLimits() {
46624
+ return _getUsageLimits.apply(this, arguments);
46625
+ }
46626
+ return getUsageLimits;
46627
+ }()
46628
+ }, {
46629
+ key: "getAiRoomRenderings",
46630
+ value: function () {
46631
+ var _getAiRoomRenderings = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee30() {
46632
+ var _this$state9;
46633
+ var organizationId;
46634
+ return _regeneratorRuntime__default["default"].wrap(function _callee30$(_context30) {
46635
+ while (1) switch (_context30.prev = _context30.next) {
46636
+ case 0:
46637
+ organizationId = (_this$state9 = this.state) === null || _this$state9 === void 0 ? void 0 : _this$state9.organization._id;
46638
+ _context30.next = 3;
46639
+ return this.api.getAiRoomRenderings(organizationId);
46640
+ case 3:
46641
+ return _context30.abrupt("return", _context30.sent);
46642
+ case 4:
46643
+ case "end":
46644
+ return _context30.stop();
46645
+ }
46646
+ }, _callee30, this);
46647
+ }));
46648
+ function getAiRoomRenderings() {
46649
+ return _getAiRoomRenderings.apply(this, arguments);
46650
+ }
46651
+ return getAiRoomRenderings;
46652
+ }()
46653
+ }, {
46654
+ key: "createLeadKey",
46655
+ value: function () {
46656
+ var _createLeadKey = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee31(email) {
46657
+ return _regeneratorRuntime__default["default"].wrap(function _callee31$(_context31) {
46658
+ while (1) switch (_context31.prev = _context31.next) {
46659
+ case 0:
46660
+ _context31.next = 2;
46661
+ return this.api.createLeadKey(email);
46662
+ case 2:
46663
+ return _context31.abrupt("return", _context31.sent);
46664
+ case 3:
46665
+ case "end":
46666
+ return _context31.stop();
46667
+ }
46668
+ }, _callee31, this);
46669
+ }));
46670
+ function createLeadKey(_x82) {
46671
+ return _createLeadKey.apply(this, arguments);
46672
+ }
46673
+ return createLeadKey;
46674
+ }()
46675
+ }, {
46676
+ key: "clearAiImageAsJpg",
46677
+ value: function clearAiImageAsJpg() {
46678
+ var set = this.actSet();
46679
+ if (!set) return;
46680
+ set.clearAiImageAsJpg();
46681
+ }
46682
+ }, {
46683
+ key: "setAiImageAsJpg",
46684
+ value: function setAiImageAsJpg(promptId, base64) {
46685
+ var set = this.actSet();
46686
+ if (!set) return;
46687
+ set.setAiImageAsJpg(promptId, base64);
46688
+ }
46214
46689
  }, {
46215
46690
  key: "checkBannerRules",
46216
46691
  value: function checkBannerRules(visitedOptions, event) {
@@ -46248,8 +46723,8 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46248
46723
  }
46249
46724
  }
46250
46725
  if (plannerType == 'JUMP_OVER_PLANNER_ONLY_MOBILE') {
46251
- var _this$state6;
46252
- if ((_this$state6 = this.state) !== null && _this$state6 !== void 0 && _this$state6.dimensions.isMobile) {
46726
+ var _this$state10;
46727
+ if ((_this$state10 = this.state) !== null && _this$state10 !== void 0 && _this$state10.dimensions.isMobile) {
46253
46728
  plannerType = 'JUMP_OVER_PLANNER';
46254
46729
  } else {
46255
46730
  plannerType = 'PLANNER';
@@ -46404,11 +46879,11 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46404
46879
  }, {
46405
46880
  key: "getAllowRTV",
46406
46881
  value: function getAllowRTV() {
46407
- var _this$state7, _this$actSet26, _this$state8, _this$actSet27;
46882
+ var _this$state11, _this$actSet26, _this$state12, _this$actSet27;
46408
46883
  if (this.getEnableUnityRtvKombi()) return false;
46409
- if ((_this$state7 = this.state) !== null && _this$state7 !== void 0 && _this$state7.organization.settings.forceRTV) return true;
46884
+ if ((_this$state11 = this.state) !== null && _this$state11 !== void 0 && _this$state11.organization.settings.forceRTV) return true;
46410
46885
  if ((_this$actSet26 = this.actSet()) !== null && _this$actSet26 !== void 0 && _this$actSet26.CatalogData.divaForceRTV) return true;
46411
- if ((_this$state8 = this.state) !== null && _this$state8 !== void 0 && _this$state8.organization.settings.enableRTV && (_this$actSet27 = this.actSet()) !== null && _this$actSet27 !== void 0 && _this$actSet27.CatalogData.divaArReady) return true;
46886
+ if ((_this$state12 = this.state) !== null && _this$state12 !== void 0 && _this$state12.organization.settings.enableRTV && (_this$actSet27 = this.actSet()) !== null && _this$actSet27 !== void 0 && _this$actSet27.CatalogData.divaArReady) return true;
46412
46887
  return false;
46413
46888
  }
46414
46889
  }, {
@@ -46462,23 +46937,23 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46462
46937
  }, {
46463
46938
  key: "getBasketDataWithEkText",
46464
46939
  value: function () {
46465
- var _getBasketDataWithEkText = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee28() {
46466
- return _regeneratorRuntime__default["default"].wrap(function _callee28$(_context28) {
46467
- while (1) switch (_context28.prev = _context28.next) {
46940
+ var _getBasketDataWithEkText = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee32() {
46941
+ return _regeneratorRuntime__default["default"].wrap(function _callee32$(_context32) {
46942
+ while (1) switch (_context32.prev = _context32.next) {
46468
46943
  case 0:
46469
- _context28.t0 = this.divaBasketHandler;
46470
- _context28.t1 = this.divaBasketHandler.actDivaNr;
46471
- _context28.next = 4;
46944
+ _context32.t0 = this.divaBasketHandler;
46945
+ _context32.t1 = this.divaBasketHandler.actDivaNr;
46946
+ _context32.next = 4;
46472
46947
  return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, true, this.doAllowSetPlanner(), this.ReturnTo);
46473
46948
  case 4:
46474
- _context28.t2 = _context28.sent;
46475
- _context28.t0.setBasketData.call(_context28.t0, _context28.t1, _context28.t2);
46476
- return _context28.abrupt("return", this.divaBasketHandler.actBasket);
46949
+ _context32.t2 = _context32.sent;
46950
+ _context32.t0.setBasketData.call(_context32.t0, _context32.t1, _context32.t2);
46951
+ return _context32.abrupt("return", this.divaBasketHandler.actBasket);
46477
46952
  case 7:
46478
46953
  case "end":
46479
- return _context28.stop();
46954
+ return _context32.stop();
46480
46955
  }
46481
- }, _callee28, this);
46956
+ }, _callee32, this);
46482
46957
  }));
46483
46958
  function getBasketDataWithEkText() {
46484
46959
  return _getBasketDataWithEkText.apply(this, arguments);
@@ -46504,7 +46979,7 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46504
46979
  }, {
46505
46980
  key: "addToBasket",
46506
46981
  value: function () {
46507
- var _addToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee29(actBasket) {
46982
+ var _addToBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee33(actBasket) {
46508
46983
  var _this$actions36,
46509
46984
  _this$actions37,
46510
46985
  _this$actions38,
@@ -46523,44 +46998,44 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46523
46998
  to,
46524
46999
  variants,
46525
47000
  products,
46526
- _args29 = arguments;
46527
- return _regeneratorRuntime__default["default"].wrap(function _callee29$(_context29) {
46528
- while (1) switch (_context29.prev = _context29.next) {
47001
+ _args33 = arguments;
47002
+ return _regeneratorRuntime__default["default"].wrap(function _callee33$(_context33) {
47003
+ while (1) switch (_context33.prev = _context33.next) {
46529
47004
  case 0:
46530
- event = _args29.length > 1 && _args29[1] !== undefined ? _args29[1] : 'onAddToBasket';
46531
- _context29.t0 = event;
46532
- _context29.next = _context29.t0 === 'onWebPlanerPrint' ? 4 : _context29.t0 === 'onWebPlanerSave' ? 6 : _context29.t0 === 'onWebPlanerShare' ? 8 : _context29.t0 === 'onRequestConsulation' ? 10 : _context29.t0 === 'onSave' ? 12 : _context29.t0 === 'onSendEmail' ? 14 : _context29.t0 === 'onSaveProduct' ? 19 : _context29.t0 === 'dontSaveBasket' ? 26 : _context29.t0 === 'onAddToBasket' ? 26 : 28;
47005
+ event = _args33.length > 1 && _args33[1] !== undefined ? _args33[1] : 'onAddToBasket';
47006
+ _context33.t0 = event;
47007
+ _context33.next = _context33.t0 === 'onWebPlanerPrint' ? 4 : _context33.t0 === 'onWebPlanerSave' ? 6 : _context33.t0 === 'onWebPlanerShare' ? 8 : _context33.t0 === 'onRequestConsulation' ? 10 : _context33.t0 === 'onSave' ? 12 : _context33.t0 === 'onSendEmail' ? 14 : _context33.t0 === 'onSaveProduct' ? 19 : _context33.t0 === 'dontSaveBasket' ? 26 : _context33.t0 === 'onAddToBasket' ? 26 : 28;
46533
47008
  break;
46534
47009
  case 4:
46535
47010
  (_this$actions36 = this.actions) === null || _this$actions36 === void 0 || _this$actions36.onEvent({
46536
47011
  type: 'onWebPlanerPrint',
46537
47012
  data: actBasket.getAsJson()
46538
47013
  });
46539
- return _context29.abrupt("break", 30);
47014
+ return _context33.abrupt("break", 30);
46540
47015
  case 6:
46541
47016
  (_this$actions37 = this.actions) === null || _this$actions37 === void 0 || _this$actions37.onEvent({
46542
47017
  type: 'onWebPlanerSave',
46543
47018
  data: actBasket.getAsJson()
46544
47019
  });
46545
- return _context29.abrupt("break", 30);
47020
+ return _context33.abrupt("break", 30);
46546
47021
  case 8:
46547
47022
  (_this$actions38 = this.actions) === null || _this$actions38 === void 0 || _this$actions38.onEvent({
46548
47023
  type: 'onWebPlanerShare',
46549
47024
  data: actBasket.getAsJson()
46550
47025
  });
46551
- return _context29.abrupt("break", 30);
47026
+ return _context33.abrupt("break", 30);
46552
47027
  case 10:
46553
47028
  (_this$actions39 = this.actions) === null || _this$actions39 === void 0 || _this$actions39.onEvent({
46554
47029
  type: 'onRequestConsulation',
46555
47030
  data: actBasket.getAsJson()
46556
47031
  });
46557
- return _context29.abrupt("break", 30);
47032
+ return _context33.abrupt("break", 30);
46558
47033
  case 12:
46559
47034
  (_this$actions40 = this.actions) === null || _this$actions40 === void 0 || _this$actions40.onEvent({
46560
47035
  type: 'onSave',
46561
47036
  data: actBasket.getAsJson()
46562
47037
  });
46563
- return _context29.abrupt("break", 30);
47038
+ return _context33.abrupt("break", 30);
46564
47039
  case 14:
46565
47040
  emailConfig = (_this$divaBasketHandl4 = this.divaBasketHandler.emailConfig) !== null && _this$divaBasketHandl4 !== void 0 ? _this$divaBasketHandl4 : this.getEmailConfig(); //reset the emailConfig
46566
47041
  this.divaBasketHandler.emailConfig = undefined;
@@ -46595,43 +47070,43 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46595
47070
  type: 'onAddToBasket',
46596
47071
  data: actBasket.getAsJson()
46597
47072
  });
46598
- return _context29.abrupt("break", 30);
47073
+ return _context33.abrupt("break", 30);
46599
47074
  case 19:
46600
47075
  this.actSet().CatalogData;
46601
- _context29.next = 22;
47076
+ _context33.next = 22;
46602
47077
  return this.api.saveAsProduct(this.sets, actBasket);
46603
47078
  case 22:
46604
- products = _context29.sent;
47079
+ products = _context33.sent;
46605
47080
  (_this$actions42 = this.actions) === null || _this$actions42 === void 0 || _this$actions42.onEvent({
46606
47081
  type: 'onAddToBasket',
46607
47082
  data: actBasket.getAsJson()
46608
47083
  });
46609
47084
  if (!products) {
46610
- _context29.next = 26;
47085
+ _context33.next = 26;
46611
47086
  break;
46612
47087
  }
46613
- return _context29.abrupt("return", products[0]);
47088
+ return _context33.abrupt("return", products[0]);
46614
47089
  case 26:
46615
47090
  (_this$actions43 = this.actions) === null || _this$actions43 === void 0 || _this$actions43.onEvent({
46616
47091
  type: 'onAddToBasket',
46617
47092
  data: actBasket.getAsJson()
46618
47093
  });
46619
- return _context29.abrupt("break", 30);
47094
+ return _context33.abrupt("break", 30);
46620
47095
  case 28:
46621
47096
  (_this$actions44 = this.actions) === null || _this$actions44 === void 0 || _this$actions44.onEvent({
46622
47097
  type: event,
46623
47098
  data: actBasket.getAsJson()
46624
47099
  });
46625
- return _context29.abrupt("break", 30);
47100
+ return _context33.abrupt("break", 30);
46626
47101
  case 30:
46627
- return _context29.abrupt("return");
47102
+ return _context33.abrupt("return");
46628
47103
  case 31:
46629
47104
  case "end":
46630
- return _context29.stop();
47105
+ return _context33.stop();
46631
47106
  }
46632
- }, _callee29, this);
47107
+ }, _callee33, this);
46633
47108
  }));
46634
- function addToBasket(_x80) {
47109
+ function addToBasket(_x83) {
46635
47110
  return _addToBasket.apply(this, arguments);
46636
47111
  }
46637
47112
  return addToBasket;
@@ -46686,28 +47161,28 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46686
47161
  }, {
46687
47162
  key: "getCurrentBasket",
46688
47163
  value: function () {
46689
- var _getCurrentBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee30(event, force, returnTo, dontGoToSummary, hideLoading) {
47164
+ var _getCurrentBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee34(event, force, returnTo, dontGoToSummary, hideLoading) {
46690
47165
  var _this$actSet35, _this$divaBasketHandl5, _this$onClickAddToBas3;
46691
- return _regeneratorRuntime__default["default"].wrap(function _callee30$(_context30) {
46692
- while (1) switch (_context30.prev = _context30.next) {
47166
+ return _regeneratorRuntime__default["default"].wrap(function _callee34$(_context34) {
47167
+ while (1) switch (_context34.prev = _context34.next) {
46693
47168
  case 0:
46694
47169
  if (!(this.divaBasketHandler.basketWasSavedWithCurrentDocVersion && ((_this$actSet35 = this.actSet()) === null || _this$actSet35 === void 0 ? void 0 : _this$actSet35.setHash) === ((_this$divaBasketHandl5 = this.divaBasketHandler.actBasket) === null || _this$divaBasketHandl5 === void 0 || (_this$divaBasketHandl5 = _this$divaBasketHandl5.OrderSets) === null || _this$divaBasketHandl5 === void 0 ? void 0 : _this$divaBasketHandl5[0].SetHash) && !(returnTo !== null && returnTo !== void 0 && returnTo.includes('OPEN')))) {
46695
- _context30.next = 2;
47170
+ _context34.next = 2;
46696
47171
  break;
46697
47172
  }
46698
- return _context30.abrupt("return", 'BASKET_ALREADY_SAVED');
47173
+ return _context34.abrupt("return", 'BASKET_ALREADY_SAVED');
46699
47174
  case 2:
46700
- _context30.next = 4;
47175
+ _context34.next = 4;
46701
47176
  return (_this$onClickAddToBas3 = this.onClickAddToBasket) === null || _this$onClickAddToBas3 === void 0 ? void 0 : _this$onClickAddToBas3.call(this, undefined, event, force, returnTo, dontGoToSummary, hideLoading);
46702
47177
  case 4:
46703
- return _context30.abrupt("return", !!_context30.sent);
47178
+ return _context34.abrupt("return", !!_context34.sent);
46704
47179
  case 5:
46705
47180
  case "end":
46706
- return _context30.stop();
47181
+ return _context34.stop();
46707
47182
  }
46708
- }, _callee30, this);
47183
+ }, _callee34, this);
46709
47184
  }));
46710
- function getCurrentBasket(_x81, _x82, _x83, _x84, _x85) {
47185
+ function getCurrentBasket(_x84, _x85, _x86, _x87, _x88) {
46711
47186
  return _getCurrentBasket.apply(this, arguments);
46712
47187
  }
46713
47188
  return getCurrentBasket;
@@ -46929,9 +47404,9 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46929
47404
  key: "initApiForLogicOnly",
46930
47405
  value: //just for testing purposes
46931
47406
  function () {
46932
- var _initApiForLogicOnly = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee31(organization, lang, getSessionGuid, handler, applicationEnvironment, apiKey, jwt) {
46933
- return _regeneratorRuntime__default["default"].wrap(function _callee31$(_context31) {
46934
- while (1) switch (_context31.prev = _context31.next) {
47407
+ var _initApiForLogicOnly = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee35(organization, lang, getSessionGuid, handler, applicationEnvironment, apiKey, jwt) {
47408
+ return _regeneratorRuntime__default["default"].wrap(function _callee35$(_context35) {
47409
+ while (1) switch (_context35.prev = _context35.next) {
46935
47410
  case 0:
46936
47411
  //empty services
46937
47412
  this.api = new DivaApiHandler(_objectSpread$6(_objectSpread$6({}, this.plannerConfig), {}, {
@@ -46944,17 +47419,17 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46944
47419
  jwt: jwt,
46945
47420
  apiKey: apiKey
46946
47421
  }), handler);
46947
- _context31.next = 3;
47422
+ _context35.next = 3;
46948
47423
  return this.divaBasketHandler.initWWSClient(this.api.getWWSClient());
46949
47424
  case 3:
46950
47425
  this.plannerHandler = new DivaPlannerHandler(true);
46951
47426
  case 4:
46952
47427
  case "end":
46953
- return _context31.stop();
47428
+ return _context35.stop();
46954
47429
  }
46955
- }, _callee31, this);
47430
+ }, _callee35, this);
46956
47431
  }));
46957
- function initApiForLogicOnly(_x86, _x87, _x88, _x89, _x90, _x91, _x92) {
47432
+ function initApiForLogicOnly(_x89, _x90, _x91, _x92, _x93, _x94, _x95) {
46958
47433
  return _initApiForLogicOnly.apply(this, arguments);
46959
47434
  }
46960
47435
  return initApiForLogicOnly;
@@ -46967,16 +47442,16 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46967
47442
  }, {
46968
47443
  key: "loadBasket",
46969
47444
  value: function () {
46970
- var _loadBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee32() {
46971
- return _regeneratorRuntime__default["default"].wrap(function _callee32$(_context32) {
46972
- while (1) switch (_context32.prev = _context32.next) {
47445
+ var _loadBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee36() {
47446
+ return _regeneratorRuntime__default["default"].wrap(function _callee36$(_context36) {
47447
+ while (1) switch (_context36.prev = _context36.next) {
46973
47448
  case 0:
46974
- return _context32.abrupt("return", this.divaBasketHandler.initializeBasket(this.api));
47449
+ return _context36.abrupt("return", this.divaBasketHandler.initializeBasket(this.api));
46975
47450
  case 1:
46976
47451
  case "end":
46977
- return _context32.stop();
47452
+ return _context36.stop();
46978
47453
  }
46979
- }, _callee32, this);
47454
+ }, _callee36, this);
46980
47455
  }));
46981
47456
  function loadBasket() {
46982
47457
  return _loadBasket.apply(this, arguments);
@@ -46991,39 +47466,39 @@ var DivaWebPlanner = /*#__PURE__*/function () {
46991
47466
  }, {
46992
47467
  key: "initBasket",
46993
47468
  value: function () {
46994
- var _initBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee33(init3D, ignoreFavorites) {
47469
+ var _initBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee37(init3D, ignoreFavorites) {
46995
47470
  var initSetState, set, basket;
46996
- return _regeneratorRuntime__default["default"].wrap(function _callee33$(_context33) {
46997
- while (1) switch (_context33.prev = _context33.next) {
47471
+ return _regeneratorRuntime__default["default"].wrap(function _callee37$(_context37) {
47472
+ while (1) switch (_context37.prev = _context37.next) {
46998
47473
  case 0:
46999
47474
  this.divaNr = this.divaBasketHandler.actDivaNr;
47000
47475
  initSetState = this.getInitStateForSet(!init3D);
47001
47476
  this.plannerHandler.initPlanner(initSetState, this.getPlannerHandlerFunctions());
47002
- _context33.next = 5;
47477
+ _context37.next = 5;
47003
47478
  return setHandlerInstance.initSetsByOrderSet(this.divaBasketHandler.getOrderSetsByDivaNr(this.divaNr), initSetState);
47004
47479
  case 5:
47005
47480
  //TODO check if when basket gets repaired the product match gets called
47006
47481
  set = this.actSet();
47007
47482
  setHandlerInstance.loadConfigStructureOfActSet(set, this.getCurPlannerType());
47008
47483
  if (!(favoritesHandlerInstance.FavoritesDefined(set) && !ignoreFavorites)) {
47009
- _context33.next = 10;
47484
+ _context37.next = 10;
47010
47485
  break;
47011
47486
  }
47012
- _context33.next = 10;
47487
+ _context37.next = 10;
47013
47488
  return this.handleFavorites(init3D ? 'CALC' : 'REPAIR');
47014
47489
  case 10:
47015
- _context33.next = 12;
47490
+ _context37.next = 12;
47016
47491
  return setHandlerInstance.fillOrderLinesAndOrderSets(this.sets, this.divaBasketHandler, !init3D, this.doAllowSetPlanner(), this.ReturnTo);
47017
47492
  case 12:
47018
- basket = _context33.sent;
47019
- return _context33.abrupt("return", basket);
47493
+ basket = _context37.sent;
47494
+ return _context37.abrupt("return", basket);
47020
47495
  case 14:
47021
47496
  case "end":
47022
- return _context33.stop();
47497
+ return _context37.stop();
47023
47498
  }
47024
- }, _callee33, this);
47499
+ }, _callee37, this);
47025
47500
  }));
47026
- function initBasket(_x93, _x94) {
47501
+ function initBasket(_x96, _x97) {
47027
47502
  return _initBasket.apply(this, arguments);
47028
47503
  }
47029
47504
  return initBasket;
@@ -47037,21 +47512,21 @@ var DivaWebPlanner = /*#__PURE__*/function () {
47037
47512
  }, {
47038
47513
  key: "getValidVariantsLength",
47039
47514
  value: function () {
47040
- var _getValidVariantsLength = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee34() {
47515
+ var _getValidVariantsLength = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee38() {
47041
47516
  var set;
47042
- return _regeneratorRuntime__default["default"].wrap(function _callee34$(_context34) {
47043
- while (1) switch (_context34.prev = _context34.next) {
47517
+ return _regeneratorRuntime__default["default"].wrap(function _callee38$(_context38) {
47518
+ while (1) switch (_context38.prev = _context38.next) {
47044
47519
  case 0:
47045
47520
  set = this.actSet();
47046
- _context34.next = 3;
47521
+ _context38.next = 3;
47047
47522
  return favoritesHandlerInstance.getValidVariants(set, true);
47048
47523
  case 3:
47049
- return _context34.abrupt("return", _context34.sent.length);
47524
+ return _context38.abrupt("return", _context38.sent.length);
47050
47525
  case 4:
47051
47526
  case "end":
47052
- return _context34.stop();
47527
+ return _context38.stop();
47053
47528
  }
47054
- }, _callee34, this);
47529
+ }, _callee38, this);
47055
47530
  }));
47056
47531
  function getValidVariantsLength() {
47057
47532
  return _getValidVariantsLength.apply(this, arguments);
@@ -47061,46 +47536,46 @@ var DivaWebPlanner = /*#__PURE__*/function () {
47061
47536
  }, {
47062
47537
  key: "handleFavorites",
47063
47538
  value: function () {
47064
- var _handleFavorites = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee35(mode) {
47539
+ var _handleFavorites = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee39(mode) {
47065
47540
  var _this5 = this;
47066
47541
  var set, i;
47067
- return _regeneratorRuntime__default["default"].wrap(function _callee35$(_context35) {
47068
- while (1) switch (_context35.prev = _context35.next) {
47542
+ return _regeneratorRuntime__default["default"].wrap(function _callee39$(_context39) {
47543
+ while (1) switch (_context39.prev = _context39.next) {
47069
47544
  case 0:
47070
47545
  set = this.actSet();
47071
47546
  i = 0;
47072
47547
  case 2:
47073
47548
  if (!favoritesHandlerInstance.IsCalcForSummary) {
47074
- _context35.next = 11;
47549
+ _context39.next = 11;
47075
47550
  break;
47076
47551
  }
47077
- _context35.next = 5;
47552
+ _context39.next = 5;
47078
47553
  return DivaUtils__default["default"].Sleep(200);
47079
47554
  case 5:
47080
47555
  i++;
47081
47556
  if (!(i > 1000)) {
47082
- _context35.next = 9;
47557
+ _context39.next = 9;
47083
47558
  break;
47084
47559
  }
47085
47560
  LOG$1.error(new DivaUtils.DivaError('error on generating Variants of Summary'));
47086
- return _context35.abrupt("break", 11);
47561
+ return _context39.abrupt("break", 11);
47087
47562
  case 9:
47088
- _context35.next = 2;
47563
+ _context39.next = 2;
47089
47564
  break;
47090
47565
  case 11:
47091
- _context35.next = 13;
47566
+ _context39.next = 13;
47092
47567
  return favoritesHandlerInstance.handleFavorites(set, mode, this.divaBasketHandler.actBasket, this.saveToBasketWrapper.bind(this), this.doConfigure.bind(this), function () {
47093
47568
  return _this5.update2DGrid(set);
47094
47569
  }, this.actions);
47095
47570
  case 13:
47096
- return _context35.abrupt("return", _context35.sent);
47571
+ return _context39.abrupt("return", _context39.sent);
47097
47572
  case 14:
47098
47573
  case "end":
47099
- return _context35.stop();
47574
+ return _context39.stop();
47100
47575
  }
47101
- }, _callee35, this);
47576
+ }, _callee39, this);
47102
47577
  }));
47103
- function handleFavorites(_x95) {
47578
+ function handleFavorites(_x98) {
47104
47579
  return _handleFavorites.apply(this, arguments);
47105
47580
  }
47106
47581
  return handleFavorites;
@@ -47113,48 +47588,48 @@ var DivaWebPlanner = /*#__PURE__*/function () {
47113
47588
  }, {
47114
47589
  key: "initSapOrderLinesFromBasket",
47115
47590
  value: function () {
47116
- var _initSapOrderLinesFromBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee36(divaNr, init3D, onlyLoadOldBakset) {
47591
+ var _initSapOrderLinesFromBasket = _asyncToGenerator__default["default"](/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee40(divaNr, init3D, onlyLoadOldBakset) {
47117
47592
  var result, oldBasket, basket;
47118
- return _regeneratorRuntime__default["default"].wrap(function _callee36$(_context36) {
47119
- while (1) switch (_context36.prev = _context36.next) {
47593
+ return _regeneratorRuntime__default["default"].wrap(function _callee40$(_context40) {
47594
+ while (1) switch (_context40.prev = _context40.next) {
47120
47595
  case 0:
47121
47596
  if (divaNr) this.divaBasketHandler.updateDivaNrInBasket(divaNr);
47122
- _context36.next = 3;
47597
+ _context40.next = 3;
47123
47598
  return this.loadBasket();
47124
47599
  case 3:
47125
- result = _context36.sent;
47600
+ result = _context40.sent;
47126
47601
  if (!onlyLoadOldBakset) {
47127
- _context36.next = 6;
47602
+ _context40.next = 6;
47128
47603
  break;
47129
47604
  }
47130
- return _context36.abrupt("return", {
47605
+ return _context40.abrupt("return", {
47131
47606
  oldBasket: new basketModel.BasketData(JSON.parse(JSON.stringify(this.divaBasketHandler.actBasket))),
47132
47607
  cache: {}
47133
47608
  });
47134
47609
  case 6:
47135
47610
  if (!(result === false)) {
47136
- _context36.next = 8;
47611
+ _context40.next = 8;
47137
47612
  break;
47138
47613
  }
47139
47614
  throw new Error('Could not load basket! ' + divaNr);
47140
47615
  case 8:
47141
47616
  oldBasket = new basketModel.BasketData(JSON.parse(JSON.stringify(this.divaBasketHandler.actBasket)));
47142
- _context36.next = 11;
47617
+ _context40.next = 11;
47143
47618
  return this.initBasket(init3D);
47144
47619
  case 11:
47145
- basket = _context36.sent;
47146
- return _context36.abrupt("return", {
47620
+ basket = _context40.sent;
47621
+ return _context40.abrupt("return", {
47147
47622
  basket: basket,
47148
47623
  oldBasket: oldBasket,
47149
47624
  cache: this.api.getJsonDataCache()
47150
47625
  });
47151
47626
  case 13:
47152
47627
  case "end":
47153
- return _context36.stop();
47628
+ return _context40.stop();
47154
47629
  }
47155
- }, _callee36, this);
47630
+ }, _callee40, this);
47156
47631
  }));
47157
- function initSapOrderLinesFromBasket(_x96, _x97, _x98) {
47632
+ function initSapOrderLinesFromBasket(_x99, _x100, _x101) {
47158
47633
  return _initSapOrderLinesFromBasket.apply(this, arguments);
47159
47634
  }
47160
47635
  return initSapOrderLinesFromBasket;
@@ -65407,6 +65882,7 @@ var a$3 = {
65407
65882
  idmService: 'https://api-test.diva-portal.com/idm',
65408
65883
  constructorService: 'https://api-test.diva-portal.com/constructor',
65409
65884
  mediaService: 'https://api-test.diva-portal.com/media',
65885
+ aiService: 'https://api-test.diva-portal.com/ai',
65410
65886
  baseUrl: 'https://api-test.diva-portal.com',
65411
65887
  baseCdnUrl: 'https://cdn-test.diva-portal.com',
65412
65888
  api2: {
@@ -65474,6 +65950,7 @@ var a$2 = {
65474
65950
  reportService: 'https://diva-api.pfister.ch/report',
65475
65951
  enricherService: 'https://diva-api.pfister.ch/enricher',
65476
65952
  idmService: 'https://diva-api.pfister.ch/idm',
65953
+ aiService: 'https://diva-api.pfister.ch/ai',
65477
65954
  mediaService: 'https://diva-api.pfister.ch/media',
65478
65955
  //'http://localhost:3000',
65479
65956
  clientArticleService: 'https://diva-api.pfister.ch/pfister-article',
@@ -65532,6 +66009,7 @@ var a$1 = {
65532
66009
  mediaService: 'https://q-diva-api.pfister.ch/media',
65533
66010
  // 'http://localhost:3000',
65534
66011
  enricherService: 'https://q-diva-api.pfister.ch/enricher',
66012
+ aiService: 'https://q-diva-api.pfister.ch/ai',
65535
66013
  idmService: 'https://q-diva-api.pfister.ch/idm',
65536
66014
  clientArticleService: 'https://q-diva-api.pfister.ch/pfister-article',
65537
66015
  baseUrl: 'https://q-diva-api.pfister.ch',