@crystaldesign/diva-core 26.12.0-beta.9 → 26.13.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/build/esm/{ModalsWrapper-80b3e4a7.js → ModalsWrapper-27273842.js} +1 -1
  2. package/build/esm/{index-afdb042c.js → index-8392e31a.js} +318 -206
  3. package/build/esm/{index-2224219f.js → index-f5b2d87b.js} +1 -1
  4. package/build/esm/index.js +1 -1
  5. package/build/types/core/src/handler/AIHandler/index.d.ts.map +1 -1
  6. package/build/types/core/src/handler/MediaHandler/index.d.ts +5 -0
  7. package/build/types/core/src/handler/MediaHandler/index.d.ts.map +1 -1
  8. package/build/types/core/src/store/ContentStore.d.ts.map +1 -1
  9. package/build/types/core/src/tests/MediaHandler.refsByIds.test.d.ts +2 -0
  10. package/build/types/core/src/tests/MediaHandler.refsByIds.test.d.ts.map +1 -0
  11. package/build/types/core/src/utils/usdzExporterCompat.d.ts +3 -0
  12. package/build/types/core/src/utils/usdzExporterCompat.d.ts.map +1 -0
  13. package/build/umd/292.diva-core.umd.min.js +2 -0
  14. package/build/umd/292.diva-core.umd.min.js.LICENSE.txt +1 -0
  15. package/build/umd/{388.diva-core.umd.min.js → 402.diva-core.umd.min.js} +2 -2
  16. package/build/umd/402.diva-core.umd.min.js.LICENSE.txt +1 -0
  17. package/build/umd/{784.diva-core.umd.min.js → 405.diva-core.umd.min.js} +2 -2
  18. package/build/umd/405.diva-core.umd.min.js.LICENSE.txt +1 -0
  19. package/build/umd/599.diva-core.umd.min.js +2 -0
  20. package/build/umd/599.diva-core.umd.min.js.LICENSE.txt +1 -0
  21. package/build/umd/626.diva-core.umd.min.js +408 -0
  22. package/build/umd/{229.diva-core.umd.min.js.LICENSE.txt → 626.diva-core.umd.min.js.LICENSE.txt} +1 -8
  23. package/build/umd/{741.diva-core.umd.min.js → 699.diva-core.umd.min.js} +2 -2
  24. package/build/umd/699.diva-core.umd.min.js.LICENSE.txt +1 -0
  25. package/build/umd/89.diva-core.umd.min.js +2 -0
  26. package/build/umd/89.diva-core.umd.min.js.LICENSE.txt +7 -0
  27. package/build/umd/diva-core.umd.min.js +3 -3
  28. package/build/umd/report.html +1 -1
  29. package/package.json +10 -10
  30. package/build/umd/14.diva-core.umd.min.js +0 -2
  31. package/build/umd/14.diva-core.umd.min.js.LICENSE.txt +0 -1
  32. package/build/umd/229.diva-core.umd.min.js +0 -408
  33. package/build/umd/388.diva-core.umd.min.js.LICENSE.txt +0 -1
  34. package/build/umd/741.diva-core.umd.min.js.LICENSE.txt +0 -1
  35. package/build/umd/784.diva-core.umd.min.js.LICENSE.txt +0 -1
  36. package/build/umd/864.diva-core.umd.min.js +0 -2
  37. package/build/umd/864.diva-core.umd.min.js.LICENSE.txt +0 -1
@@ -43,7 +43,7 @@ import HelpOutline from '@mui/icons-material/HelpOutline';
43
43
  import { actions } from '@storybook/addon-actions';
44
44
 
45
45
  (function() {
46
- const env = {"STAGE":"production","VERSION":"26.12.0-beta.9"};
46
+ const env = {"STAGE":"production","VERSION":"26.13.0-beta.1"};
47
47
  try {
48
48
  if (process) {
49
49
  process.env = Object.assign({}, process.env);
@@ -2129,6 +2129,47 @@ function buildResizeObserver(ref, onResize) {
2129
2129
  return resizeObserver;
2130
2130
  }
2131
2131
 
2132
+ var applied = false;
2133
+
2134
+ /** Restores the promise-returning `USDZExporter.parse(scene)` that @google/model-viewer 3.5.0 awaits; three >= 0.170 made it callback-based. */
2135
+ function ensureUsdzExporterParseCompat() {
2136
+ return _ensureUsdzExporterParseCompat.apply(this, arguments);
2137
+ }
2138
+ function _ensureUsdzExporterParseCompat() {
2139
+ _ensureUsdzExporterParseCompat = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
2140
+ var _yield$import, USDZExporter, originalParse;
2141
+ return _regeneratorRuntime.wrap(function _callee$(_context) {
2142
+ while (1) switch (_context.prev = _context.next) {
2143
+ case 0:
2144
+ if (!applied) {
2145
+ _context.next = 2;
2146
+ break;
2147
+ }
2148
+ return _context.abrupt("return");
2149
+ case 2:
2150
+ applied = true;
2151
+ _context.next = 5;
2152
+ return import('three/examples/jsm/exporters/USDZExporter.js');
2153
+ case 5:
2154
+ _yield$import = _context.sent;
2155
+ USDZExporter = _yield$import.USDZExporter;
2156
+ originalParse = USDZExporter.prototype.parse;
2157
+ USDZExporter.prototype.parse = function (scene, onDone, onError, options) {
2158
+ if (typeof onDone === 'function') {
2159
+ originalParse.call(this, scene, onDone, onError, options);
2160
+ return;
2161
+ }
2162
+ return this.parseAsync(scene, options);
2163
+ };
2164
+ case 9:
2165
+ case "end":
2166
+ return _context.stop();
2167
+ }
2168
+ }, _callee);
2169
+ }));
2170
+ return _ensureUsdzExporterParseCompat.apply(this, arguments);
2171
+ }
2172
+
2132
2173
  var THEME_VARIABLES = [['--diva-theme-palette-primary-main', function (t) {
2133
2174
  return t.palette.primary.main;
2134
2175
  }], ['--diva-theme-palette-primary-dark', function (t) {
@@ -2192,7 +2233,7 @@ function _arrayLikeToArray$1(r, a) { (null == a || a > r.length) && (a = r.lengt
2192
2233
  function ownKeys$b(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; }
2193
2234
  function _objectSpread$b(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$b(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$b(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
2194
2235
  var LOG$a = getLogger('Framework', 'ContentStore');
2195
- var ALLOWED_WRAPPER_MODULES = ['ARCHIVE', 'PRODUCT_LIST', 'SALES_MANAGER', 'DIVA_BACKOFFICE_NEW'];
2236
+ var ALLOWED_WRAPPER_MODULES = ['ARCHIVE', 'PRODUCT_LIST', 'SALES_MANAGER', 'DIVA_BACKOFFICE_NEW', 'DIVA_DATA_ENGINE'];
2196
2237
  var ContentStore = /*#__PURE__*/function () {
2197
2238
  function ContentStore(components, root) {
2198
2239
  var _this = this;
@@ -2245,6 +2286,8 @@ var ContentStore = /*#__PURE__*/function () {
2245
2286
  return 'Planner';
2246
2287
  case 'DIVA_BACKOFFICE_NEW':
2247
2288
  return 'BackofficeNew';
2289
+ case 'DIVA_DATA_ENGINE':
2290
+ return 'DataEngine';
2248
2291
  case 'AR_VIEWER':
2249
2292
  return 'ARViewer';
2250
2293
  case 'USER_MANAGER':
@@ -2430,13 +2473,16 @@ var ContentStore = /*#__PURE__*/function () {
2430
2473
  while (1) switch (_context2.prev = _context2.next) {
2431
2474
  case 0:
2432
2475
  if (!(!this._modelViewerHasLoaded && !window.customElements.get('model-viewer'))) {
2433
- _context2.next = 4;
2476
+ _context2.next = 6;
2434
2477
  break;
2435
2478
  }
2436
2479
  this._modelViewerHasLoaded = true;
2437
2480
  _context2.next = 4;
2438
- return import('@google/model-viewer');
2481
+ return ensureUsdzExporterParseCompat();
2439
2482
  case 4:
2483
+ _context2.next = 6;
2484
+ return import('@google/model-viewer');
2485
+ case 6:
2440
2486
  case "end":
2441
2487
  return _context2.stop();
2442
2488
  }
@@ -6273,6 +6319,8 @@ function initCookieBot(cbid, onConsentReady, onCookieBotError) {
6273
6319
  }, COOKIEBOT_LOAD_TIMEOUT_MS);
6274
6320
  }
6275
6321
 
6322
+ /** Ref ids one `getMediaItemRefsByIds` request names, so the URL stays well below the usual length limits. */
6323
+ var MEDIA_ITEM_REF_CHUNK_SIZE = 100;
6276
6324
  var MediaHandler = /*#__PURE__*/function () {
6277
6325
  function MediaHandler(root) {
6278
6326
  _classCallCheck(this, MediaHandler);
@@ -6420,18 +6468,79 @@ var MediaHandler = /*#__PURE__*/function () {
6420
6468
  return _getMediaItemByRefId.apply(this, arguments);
6421
6469
  }
6422
6470
  return getMediaItemByRefId;
6423
- }() /** Fetches the MediaItemRef document by ref id (not the parent media item). */
6471
+ }()
6472
+ /**
6473
+ * Fetches the MediaItemRef documents of many ref ids with one request per 100 ids, instead of one request per id.
6474
+ * The list endpoint answers 20 documents unless told otherwise, so each request asks for as many as it names.
6475
+ */
6424
6476
  }, {
6425
- key: "getMediaItemRefById",
6477
+ key: "getMediaItemRefsByIds",
6426
6478
  value: (function () {
6427
- var _getMediaItemRefById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(id) {
6428
- var fullUrl, res, resData;
6479
+ var _getMediaItemRefsByIds = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(ids) {
6480
+ var refs, i, _resData$data, chunk, params, res, resData;
6429
6481
  return _regeneratorRuntime.wrap(function _callee4$(_context4) {
6430
6482
  while (1) switch (_context4.prev = _context4.next) {
6483
+ case 0:
6484
+ refs = [];
6485
+ i = 0;
6486
+ case 2:
6487
+ if (!(i < ids.length)) {
6488
+ _context4.next = 17;
6489
+ break;
6490
+ }
6491
+ chunk = ids.slice(i, i + MEDIA_ITEM_REF_CHUNK_SIZE);
6492
+ params = new URLSearchParams({
6493
+ filter: "[{_id,in,".concat(chunk.join(','), "}]"),
6494
+ limit: String(chunk.length)
6495
+ });
6496
+ _context4.next = 7;
6497
+ return fetch("".concat(this.mediaService, "/v1/mediaitems/refs?").concat(params.toString()), {
6498
+ headers: {
6499
+ Authorization: 'Bearer ' + this.jwt,
6500
+ 'Content-Type': 'application/json'
6501
+ }
6502
+ });
6503
+ case 7:
6504
+ res = _context4.sent;
6505
+ _context4.next = 10;
6506
+ return res.json();
6507
+ case 10:
6508
+ resData = _context4.sent;
6509
+ if (res.ok) {
6510
+ _context4.next = 13;
6511
+ break;
6512
+ }
6513
+ throw new Error(resData.error || 'Could not fetch mediaItemRefs');
6514
+ case 13:
6515
+ refs.push.apply(refs, _toConsumableArray((_resData$data = resData.data) !== null && _resData$data !== void 0 ? _resData$data : []));
6516
+ case 14:
6517
+ i += MEDIA_ITEM_REF_CHUNK_SIZE;
6518
+ _context4.next = 2;
6519
+ break;
6520
+ case 17:
6521
+ return _context4.abrupt("return", refs);
6522
+ case 18:
6523
+ case "end":
6524
+ return _context4.stop();
6525
+ }
6526
+ }, _callee4, this);
6527
+ }));
6528
+ function getMediaItemRefsByIds(_x4) {
6529
+ return _getMediaItemRefsByIds.apply(this, arguments);
6530
+ }
6531
+ return getMediaItemRefsByIds;
6532
+ }() /** Fetches the MediaItemRef document by ref id (not the parent media item). */)
6533
+ }, {
6534
+ key: "getMediaItemRefById",
6535
+ value: (function () {
6536
+ var _getMediaItemRefById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(id) {
6537
+ var fullUrl, res, resData;
6538
+ return _regeneratorRuntime.wrap(function _callee5$(_context5) {
6539
+ while (1) switch (_context5.prev = _context5.next) {
6431
6540
  case 0:
6432
6541
  fullUrl = this.mediaService + '/v1/mediaitems/refs';
6433
- _context4.prev = 1;
6434
- _context4.next = 4;
6542
+ _context5.prev = 1;
6543
+ _context5.next = 4;
6435
6544
  return fetch("".concat(fullUrl, "?filter=").concat(encodeURIComponent("[{_id,eq,".concat(id, "}]"))), {
6436
6545
  headers: {
6437
6546
  Authorization: 'Bearer ' + this.jwt,
@@ -6439,32 +6548,32 @@ var MediaHandler = /*#__PURE__*/function () {
6439
6548
  }
6440
6549
  });
6441
6550
  case 4:
6442
- res = _context4.sent;
6443
- _context4.next = 7;
6551
+ res = _context5.sent;
6552
+ _context5.next = 7;
6444
6553
  return res.json();
6445
6554
  case 7:
6446
- resData = _context4.sent;
6447
- _context4.next = 13;
6555
+ resData = _context5.sent;
6556
+ _context5.next = 13;
6448
6557
  break;
6449
6558
  case 10:
6450
- _context4.prev = 10;
6451
- _context4.t0 = _context4["catch"](1);
6559
+ _context5.prev = 10;
6560
+ _context5.t0 = _context5["catch"](1);
6452
6561
  throw new Error('Could not fetch mediaItemRef');
6453
6562
  case 13:
6454
6563
  if (!res.ok) {
6455
- _context4.next = 15;
6564
+ _context5.next = 15;
6456
6565
  break;
6457
6566
  }
6458
- return _context4.abrupt("return", resData);
6567
+ return _context5.abrupt("return", resData);
6459
6568
  case 15:
6460
6569
  throw new Error(resData.error);
6461
6570
  case 16:
6462
6571
  case "end":
6463
- return _context4.stop();
6572
+ return _context5.stop();
6464
6573
  }
6465
- }, _callee4, this, [[1, 10]]);
6574
+ }, _callee5, this, [[1, 10]]);
6466
6575
  }));
6467
- function getMediaItemRefById(_x4) {
6576
+ function getMediaItemRefById(_x5) {
6468
6577
  return _getMediaItemRefById.apply(this, arguments);
6469
6578
  }
6470
6579
  return getMediaItemRefById;
@@ -6472,14 +6581,14 @@ var MediaHandler = /*#__PURE__*/function () {
6472
6581
  }, {
6473
6582
  key: "getHQRenderScriptById",
6474
6583
  value: function () {
6475
- var _getHQRenderScriptById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(id) {
6584
+ var _getHQRenderScriptById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id) {
6476
6585
  var fullUrl, res, resData;
6477
- return _regeneratorRuntime.wrap(function _callee5$(_context5) {
6478
- while (1) switch (_context5.prev = _context5.next) {
6586
+ return _regeneratorRuntime.wrap(function _callee6$(_context6) {
6587
+ while (1) switch (_context6.prev = _context6.next) {
6479
6588
  case 0:
6480
6589
  fullUrl = this.mediaService + '/hqrenderscripts';
6481
- _context5.prev = 1;
6482
- _context5.next = 4;
6590
+ _context6.prev = 1;
6591
+ _context6.next = 4;
6483
6592
  return fetch("".concat(fullUrl, "/").concat(id), {
6484
6593
  headers: {
6485
6594
  Authorization: 'Bearer ' + this.jwt,
@@ -6487,32 +6596,32 @@ var MediaHandler = /*#__PURE__*/function () {
6487
6596
  }
6488
6597
  });
6489
6598
  case 4:
6490
- res = _context5.sent;
6491
- _context5.next = 7;
6599
+ res = _context6.sent;
6600
+ _context6.next = 7;
6492
6601
  return res.json();
6493
6602
  case 7:
6494
- resData = _context5.sent;
6495
- _context5.next = 13;
6603
+ resData = _context6.sent;
6604
+ _context6.next = 13;
6496
6605
  break;
6497
6606
  case 10:
6498
- _context5.prev = 10;
6499
- _context5.t0 = _context5["catch"](1);
6607
+ _context6.prev = 10;
6608
+ _context6.t0 = _context6["catch"](1);
6500
6609
  throw new Error('Could not fetch mediaItem');
6501
6610
  case 13:
6502
6611
  if (!res.ok) {
6503
- _context5.next = 15;
6612
+ _context6.next = 15;
6504
6613
  break;
6505
6614
  }
6506
- return _context5.abrupt("return", resData);
6615
+ return _context6.abrupt("return", resData);
6507
6616
  case 15:
6508
6617
  throw new Error(resData.error);
6509
6618
  case 16:
6510
6619
  case "end":
6511
- return _context5.stop();
6620
+ return _context6.stop();
6512
6621
  }
6513
- }, _callee5, this, [[1, 10]]);
6622
+ }, _callee6, this, [[1, 10]]);
6514
6623
  }));
6515
- function getHQRenderScriptById(_x5) {
6624
+ function getHQRenderScriptById(_x6) {
6516
6625
  return _getHQRenderScriptById.apply(this, arguments);
6517
6626
  }
6518
6627
  return getHQRenderScriptById;
@@ -6520,10 +6629,10 @@ var MediaHandler = /*#__PURE__*/function () {
6520
6629
  }, {
6521
6630
  key: "getRooms",
6522
6631
  value: function () {
6523
- var _getRooms = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee6(id, mainCategory, style, name) {
6632
+ var _getRooms = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id, mainCategory, style, name) {
6524
6633
  var fullUrl, filterParts, filter, res, resData;
6525
- return _regeneratorRuntime.wrap(function _callee6$(_context6) {
6526
- while (1) switch (_context6.prev = _context6.next) {
6634
+ return _regeneratorRuntime.wrap(function _callee7$(_context7) {
6635
+ while (1) switch (_context7.prev = _context7.next) {
6527
6636
  case 0:
6528
6637
  fullUrl = new URL(this.mediaService + '/rooms');
6529
6638
  fullUrl.searchParams.append('limit', '20');
@@ -6546,8 +6655,8 @@ var MediaHandler = /*#__PURE__*/function () {
6546
6655
  if (filter) {
6547
6656
  fullUrl.searchParams.append('filter', encodeURIComponent(filter));
6548
6657
  }
6549
- _context6.prev = 7;
6550
- _context6.next = 10;
6658
+ _context7.prev = 7;
6659
+ _context7.next = 10;
6551
6660
  return fetch(fullUrl.toString(), {
6552
6661
  headers: {
6553
6662
  Authorization: 'Bearer ' + this.jwt,
@@ -6555,32 +6664,32 @@ var MediaHandler = /*#__PURE__*/function () {
6555
6664
  }
6556
6665
  });
6557
6666
  case 10:
6558
- res = _context6.sent;
6559
- _context6.next = 13;
6667
+ res = _context7.sent;
6668
+ _context7.next = 13;
6560
6669
  return res.json();
6561
6670
  case 13:
6562
- resData = _context6.sent;
6563
- _context6.next = 19;
6671
+ resData = _context7.sent;
6672
+ _context7.next = 19;
6564
6673
  break;
6565
6674
  case 16:
6566
- _context6.prev = 16;
6567
- _context6.t0 = _context6["catch"](7);
6675
+ _context7.prev = 16;
6676
+ _context7.t0 = _context7["catch"](7);
6568
6677
  throw new Error('Could not get rooms');
6569
6678
  case 19:
6570
6679
  if (!res.ok) {
6571
- _context6.next = 21;
6680
+ _context7.next = 21;
6572
6681
  break;
6573
6682
  }
6574
- return _context6.abrupt("return", resData.data);
6683
+ return _context7.abrupt("return", resData.data);
6575
6684
  case 21:
6576
6685
  throw new Error(resData.error);
6577
6686
  case 22:
6578
6687
  case "end":
6579
- return _context6.stop();
6688
+ return _context7.stop();
6580
6689
  }
6581
- }, _callee6, this, [[7, 16]]);
6690
+ }, _callee7, this, [[7, 16]]);
6582
6691
  }));
6583
- function getRooms(_x6, _x7, _x8, _x9) {
6692
+ function getRooms(_x7, _x8, _x9, _x10) {
6584
6693
  return _getRooms.apply(this, arguments);
6585
6694
  }
6586
6695
  return getRooms;
@@ -6588,10 +6697,10 @@ var MediaHandler = /*#__PURE__*/function () {
6588
6697
  }, {
6589
6698
  key: "getRoomsNew",
6590
6699
  value: function () {
6591
- var _getRoomsNew = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee7(id, mainCategory, organizationId) {
6700
+ var _getRoomsNew = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(id, mainCategory, organizationId) {
6592
6701
  var fullUrl, filterParts, filter, res, resData;
6593
- return _regeneratorRuntime.wrap(function _callee7$(_context7) {
6594
- while (1) switch (_context7.prev = _context7.next) {
6702
+ return _regeneratorRuntime.wrap(function _callee8$(_context8) {
6703
+ while (1) switch (_context8.prev = _context8.next) {
6595
6704
  case 0:
6596
6705
  fullUrl = new URL(this.mediaService + '/rooms');
6597
6706
  fullUrl.searchParams.append('limit', '1000');
@@ -6611,8 +6720,8 @@ var MediaHandler = /*#__PURE__*/function () {
6611
6720
  if (filter) {
6612
6721
  fullUrl.searchParams.append('filter', encodeURIComponent(filter));
6613
6722
  }
6614
- _context7.prev = 8;
6615
- _context7.next = 11;
6723
+ _context8.prev = 8;
6724
+ _context8.next = 11;
6616
6725
  return fetch(fullUrl.toString(), {
6617
6726
  headers: {
6618
6727
  Authorization: 'Bearer ' + this.jwt,
@@ -6620,32 +6729,32 @@ var MediaHandler = /*#__PURE__*/function () {
6620
6729
  }
6621
6730
  });
6622
6731
  case 11:
6623
- res = _context7.sent;
6624
- _context7.next = 14;
6732
+ res = _context8.sent;
6733
+ _context8.next = 14;
6625
6734
  return res.json();
6626
6735
  case 14:
6627
- resData = _context7.sent;
6628
- _context7.next = 20;
6736
+ resData = _context8.sent;
6737
+ _context8.next = 20;
6629
6738
  break;
6630
6739
  case 17:
6631
- _context7.prev = 17;
6632
- _context7.t0 = _context7["catch"](8);
6740
+ _context8.prev = 17;
6741
+ _context8.t0 = _context8["catch"](8);
6633
6742
  throw new Error('Could not get rooms');
6634
6743
  case 20:
6635
6744
  if (!res.ok) {
6636
- _context7.next = 22;
6745
+ _context8.next = 22;
6637
6746
  break;
6638
6747
  }
6639
- return _context7.abrupt("return", resData.data);
6748
+ return _context8.abrupt("return", resData.data);
6640
6749
  case 22:
6641
6750
  throw new Error(resData.error);
6642
6751
  case 23:
6643
6752
  case "end":
6644
- return _context7.stop();
6753
+ return _context8.stop();
6645
6754
  }
6646
- }, _callee7, this, [[8, 17]]);
6755
+ }, _callee8, this, [[8, 17]]);
6647
6756
  }));
6648
- function getRoomsNew(_x10, _x11, _x12) {
6757
+ function getRoomsNew(_x11, _x12, _x13) {
6649
6758
  return _getRoomsNew.apply(this, arguments);
6650
6759
  }
6651
6760
  return getRoomsNew;
@@ -6653,10 +6762,10 @@ var MediaHandler = /*#__PURE__*/function () {
6653
6762
  }, {
6654
6763
  key: "getRoomsGrouped",
6655
6764
  value: function () {
6656
- var _getRoomsGrouped = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee8(id, mainCategory, style, organizationId) {
6765
+ var _getRoomsGrouped = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(id, mainCategory, style, organizationId) {
6657
6766
  var fullUrl, filterParts, filter, res, resData;
6658
- return _regeneratorRuntime.wrap(function _callee8$(_context8) {
6659
- while (1) switch (_context8.prev = _context8.next) {
6767
+ return _regeneratorRuntime.wrap(function _callee9$(_context9) {
6768
+ while (1) switch (_context9.prev = _context9.next) {
6660
6769
  case 0:
6661
6770
  fullUrl = new URL(this.mediaService + '/rooms');
6662
6771
  if (organizationId) {
@@ -6679,8 +6788,8 @@ var MediaHandler = /*#__PURE__*/function () {
6679
6788
  if (filter) {
6680
6789
  fullUrl.searchParams.append('filter', encodeURIComponent(filter));
6681
6790
  }
6682
- _context8.prev = 8;
6683
- _context8.next = 11;
6791
+ _context9.prev = 8;
6792
+ _context9.next = 11;
6684
6793
  return fetch(fullUrl.toString(), {
6685
6794
  headers: {
6686
6795
  Authorization: 'Bearer ' + this.jwt,
@@ -6688,32 +6797,32 @@ var MediaHandler = /*#__PURE__*/function () {
6688
6797
  }
6689
6798
  });
6690
6799
  case 11:
6691
- res = _context8.sent;
6692
- _context8.next = 14;
6800
+ res = _context9.sent;
6801
+ _context9.next = 14;
6693
6802
  return res.json();
6694
6803
  case 14:
6695
- resData = _context8.sent;
6696
- _context8.next = 20;
6804
+ resData = _context9.sent;
6805
+ _context9.next = 20;
6697
6806
  break;
6698
6807
  case 17:
6699
- _context8.prev = 17;
6700
- _context8.t0 = _context8["catch"](8);
6808
+ _context9.prev = 17;
6809
+ _context9.t0 = _context9["catch"](8);
6701
6810
  throw new Error('Could not get rooms');
6702
6811
  case 20:
6703
6812
  if (!res.ok) {
6704
- _context8.next = 22;
6813
+ _context9.next = 22;
6705
6814
  break;
6706
6815
  }
6707
- return _context8.abrupt("return", organizationId ? resData : resData.data);
6816
+ return _context9.abrupt("return", organizationId ? resData : resData.data);
6708
6817
  case 22:
6709
6818
  throw new Error(resData.error);
6710
6819
  case 23:
6711
6820
  case "end":
6712
- return _context8.stop();
6821
+ return _context9.stop();
6713
6822
  }
6714
- }, _callee8, this, [[8, 17]]);
6823
+ }, _callee9, this, [[8, 17]]);
6715
6824
  }));
6716
- function getRoomsGrouped(_x13, _x14, _x15, _x16) {
6825
+ function getRoomsGrouped(_x14, _x15, _x16, _x17) {
6717
6826
  return _getRoomsGrouped.apply(this, arguments);
6718
6827
  }
6719
6828
  return getRoomsGrouped;
@@ -6721,15 +6830,15 @@ var MediaHandler = /*#__PURE__*/function () {
6721
6830
  }, {
6722
6831
  key: "getRoomColors",
6723
6832
  value: function () {
6724
- var _getRoomColors = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee9(name) {
6833
+ var _getRoomColors = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(name) {
6725
6834
  var fullUrl, res, resData;
6726
- return _regeneratorRuntime.wrap(function _callee9$(_context9) {
6727
- while (1) switch (_context9.prev = _context9.next) {
6835
+ return _regeneratorRuntime.wrap(function _callee10$(_context10) {
6836
+ while (1) switch (_context10.prev = _context10.next) {
6728
6837
  case 0:
6729
6838
  fullUrl = this.mediaService + '/rooms/' + name + '/colors';
6730
6839
  resData = [];
6731
- _context9.prev = 2;
6732
- _context9.next = 5;
6840
+ _context10.prev = 2;
6841
+ _context10.next = 5;
6733
6842
  return fetch(fullUrl, {
6734
6843
  headers: {
6735
6844
  Authorization: 'Bearer ' + this.jwt,
@@ -6737,32 +6846,32 @@ var MediaHandler = /*#__PURE__*/function () {
6737
6846
  }
6738
6847
  });
6739
6848
  case 5:
6740
- res = _context9.sent;
6741
- _context9.next = 8;
6849
+ res = _context10.sent;
6850
+ _context10.next = 8;
6742
6851
  return res.json();
6743
6852
  case 8:
6744
- resData = _context9.sent;
6745
- _context9.next = 14;
6853
+ resData = _context10.sent;
6854
+ _context10.next = 14;
6746
6855
  break;
6747
6856
  case 11:
6748
- _context9.prev = 11;
6749
- _context9.t0 = _context9["catch"](2);
6857
+ _context10.prev = 11;
6858
+ _context10.t0 = _context10["catch"](2);
6750
6859
  throw new Error('Could not get room variants');
6751
6860
  case 14:
6752
6861
  if (!res.ok) {
6753
- _context9.next = 16;
6862
+ _context10.next = 16;
6754
6863
  break;
6755
6864
  }
6756
- return _context9.abrupt("return", resData);
6865
+ return _context10.abrupt("return", resData);
6757
6866
  case 16:
6758
6867
  throw new Error(resData.error);
6759
6868
  case 17:
6760
6869
  case "end":
6761
- return _context9.stop();
6870
+ return _context10.stop();
6762
6871
  }
6763
- }, _callee9, this, [[2, 11]]);
6872
+ }, _callee10, this, [[2, 11]]);
6764
6873
  }));
6765
- function getRoomColors(_x17) {
6874
+ function getRoomColors(_x18) {
6766
6875
  return _getRoomColors.apply(this, arguments);
6767
6876
  }
6768
6877
  return getRoomColors;
@@ -6770,15 +6879,15 @@ var MediaHandler = /*#__PURE__*/function () {
6770
6879
  }, {
6771
6880
  key: "getRoomVariants",
6772
6881
  value: function () {
6773
- var _getRoomVariants = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee10(id) {
6882
+ var _getRoomVariants = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11(id) {
6774
6883
  var fullUrl, res, resData;
6775
- return _regeneratorRuntime.wrap(function _callee10$(_context10) {
6776
- while (1) switch (_context10.prev = _context10.next) {
6884
+ return _regeneratorRuntime.wrap(function _callee11$(_context11) {
6885
+ while (1) switch (_context11.prev = _context11.next) {
6777
6886
  case 0:
6778
6887
  fullUrl = this.mediaService + '/rooms/' + id + '/variants';
6779
6888
  resData = [];
6780
- _context10.prev = 2;
6781
- _context10.next = 5;
6889
+ _context11.prev = 2;
6890
+ _context11.next = 5;
6782
6891
  return fetch(fullUrl, {
6783
6892
  headers: {
6784
6893
  Authorization: 'Bearer ' + this.jwt,
@@ -6786,32 +6895,32 @@ var MediaHandler = /*#__PURE__*/function () {
6786
6895
  }
6787
6896
  });
6788
6897
  case 5:
6789
- res = _context10.sent;
6790
- _context10.next = 8;
6898
+ res = _context11.sent;
6899
+ _context11.next = 8;
6791
6900
  return res.json();
6792
6901
  case 8:
6793
- resData = _context10.sent;
6794
- _context10.next = 14;
6902
+ resData = _context11.sent;
6903
+ _context11.next = 14;
6795
6904
  break;
6796
6905
  case 11:
6797
- _context10.prev = 11;
6798
- _context10.t0 = _context10["catch"](2);
6906
+ _context11.prev = 11;
6907
+ _context11.t0 = _context11["catch"](2);
6799
6908
  throw new Error('Could not get room variants');
6800
6909
  case 14:
6801
6910
  if (!res.ok) {
6802
- _context10.next = 16;
6911
+ _context11.next = 16;
6803
6912
  break;
6804
6913
  }
6805
- return _context10.abrupt("return", resData);
6914
+ return _context11.abrupt("return", resData);
6806
6915
  case 16:
6807
6916
  throw new Error(resData.error);
6808
6917
  case 17:
6809
6918
  case "end":
6810
- return _context10.stop();
6919
+ return _context11.stop();
6811
6920
  }
6812
- }, _callee10, this, [[2, 11]]);
6921
+ }, _callee11, this, [[2, 11]]);
6813
6922
  }));
6814
- function getRoomVariants(_x18) {
6923
+ function getRoomVariants(_x19) {
6815
6924
  return _getRoomVariants.apply(this, arguments);
6816
6925
  }
6817
6926
  return getRoomVariants;
@@ -6819,25 +6928,25 @@ var MediaHandler = /*#__PURE__*/function () {
6819
6928
  }, {
6820
6929
  key: "getRenderJobs",
6821
6930
  value: function () {
6822
- var _getRenderJobs = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee11() {
6931
+ var _getRenderJobs = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
6823
6932
  var query,
6824
6933
  fullUrl,
6825
6934
  res,
6826
6935
  resData,
6827
6936
  err,
6828
- _args11 = arguments;
6829
- return _regeneratorRuntime.wrap(function _callee11$(_context11) {
6830
- while (1) switch (_context11.prev = _context11.next) {
6937
+ _args12 = arguments;
6938
+ return _regeneratorRuntime.wrap(function _callee12$(_context12) {
6939
+ while (1) switch (_context12.prev = _context12.next) {
6831
6940
  case 0:
6832
- query = _args11.length > 0 && _args11[0] !== undefined ? _args11[0] : {};
6941
+ query = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
6833
6942
  fullUrl = new URL(this.mediaService + '/renderjobs');
6834
6943
  if (this.organizationId) fullUrl.searchParams.append('organizationId', this.organizationId);
6835
6944
  if (query.limit) fullUrl.searchParams.append('limit', String(query.limit));
6836
6945
  if (query.skip) fullUrl.searchParams.append('skip', String(query.skip));
6837
6946
  if (query.filter) fullUrl.searchParams.append('filter', encodeURIComponent(query.filter));
6838
6947
  if (query.sort) fullUrl.searchParams.append('sort', encodeURIComponent(query.sort));
6839
- _context11.prev = 7;
6840
- _context11.next = 10;
6948
+ _context12.prev = 7;
6949
+ _context12.next = 10;
6841
6950
  return fetch(fullUrl.toString(), {
6842
6951
  headers: {
6843
6952
  Authorization: 'Bearer ' + this.jwt,
@@ -6845,32 +6954,32 @@ var MediaHandler = /*#__PURE__*/function () {
6845
6954
  }
6846
6955
  });
6847
6956
  case 10:
6848
- res = _context11.sent;
6849
- _context11.next = 13;
6957
+ res = _context12.sent;
6958
+ _context12.next = 13;
6850
6959
  return res.json();
6851
6960
  case 13:
6852
- resData = _context11.sent;
6853
- _context11.next = 19;
6961
+ resData = _context12.sent;
6962
+ _context12.next = 19;
6854
6963
  break;
6855
6964
  case 16:
6856
- _context11.prev = 16;
6857
- _context11.t0 = _context11["catch"](7);
6965
+ _context12.prev = 16;
6966
+ _context12.t0 = _context12["catch"](7);
6858
6967
  throw new Error('Could not get render jobs');
6859
6968
  case 19:
6860
6969
  if (!res.ok) {
6861
- _context11.next = 21;
6970
+ _context12.next = 21;
6862
6971
  break;
6863
6972
  }
6864
- return _context11.abrupt("return", resData);
6973
+ return _context12.abrupt("return", resData);
6865
6974
  case 21:
6866
6975
  err = new Error(resData.error);
6867
6976
  err.status = res.status;
6868
6977
  throw err;
6869
6978
  case 24:
6870
6979
  case "end":
6871
- return _context11.stop();
6980
+ return _context12.stop();
6872
6981
  }
6873
- }, _callee11, this, [[7, 16]]);
6982
+ }, _callee12, this, [[7, 16]]);
6874
6983
  }));
6875
6984
  function getRenderJobs() {
6876
6985
  return _getRenderJobs.apply(this, arguments);
@@ -6880,24 +6989,24 @@ var MediaHandler = /*#__PURE__*/function () {
6880
6989
  }, {
6881
6990
  key: "getAiProductPhotoCampaignSummaries",
6882
6991
  value: (function () {
6883
- var _getAiProductPhotoCampaignSummaries = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee12() {
6992
+ var _getAiProductPhotoCampaignSummaries = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13() {
6884
6993
  var query,
6885
6994
  fullUrl,
6886
6995
  res,
6887
6996
  resData,
6888
- _args12 = arguments;
6889
- return _regeneratorRuntime.wrap(function _callee12$(_context12) {
6890
- while (1) switch (_context12.prev = _context12.next) {
6997
+ _args13 = arguments;
6998
+ return _regeneratorRuntime.wrap(function _callee13$(_context13) {
6999
+ while (1) switch (_context13.prev = _context13.next) {
6891
7000
  case 0:
6892
- query = _args12.length > 0 && _args12[0] !== undefined ? _args12[0] : {};
7001
+ query = _args13.length > 0 && _args13[0] !== undefined ? _args13[0] : {};
6893
7002
  fullUrl = new URL(this.mediaService + '/renderjobs/aiproductphoto/campaigns/summary');
6894
7003
  if (this.organizationId) fullUrl.searchParams.append('organizationId', this.organizationId);
6895
7004
  if (query.search) fullUrl.searchParams.append('search', query.search);
6896
7005
  if (query.sort) fullUrl.searchParams.append('sort', query.sort);
6897
7006
  if (query.skip) fullUrl.searchParams.append('skip', String(query.skip));
6898
7007
  if (query.limit) fullUrl.searchParams.append('limit', String(query.limit));
6899
- _context12.prev = 7;
6900
- _context12.next = 10;
7008
+ _context13.prev = 7;
7009
+ _context13.next = 10;
6901
7010
  return fetch(fullUrl.toString(), {
6902
7011
  headers: {
6903
7012
  Authorization: 'Bearer ' + this.jwt,
@@ -6905,30 +7014,30 @@ var MediaHandler = /*#__PURE__*/function () {
6905
7014
  }
6906
7015
  });
6907
7016
  case 10:
6908
- res = _context12.sent;
6909
- _context12.next = 13;
7017
+ res = _context13.sent;
7018
+ _context13.next = 13;
6910
7019
  return res.json();
6911
7020
  case 13:
6912
- resData = _context12.sent;
6913
- _context12.next = 19;
7021
+ resData = _context13.sent;
7022
+ _context13.next = 19;
6914
7023
  break;
6915
7024
  case 16:
6916
- _context12.prev = 16;
6917
- _context12.t0 = _context12["catch"](7);
7025
+ _context13.prev = 16;
7026
+ _context13.t0 = _context13["catch"](7);
6918
7027
  throw new Error('Could not get AI product photo campaign summaries');
6919
7028
  case 19:
6920
7029
  if (!res.ok) {
6921
- _context12.next = 21;
7030
+ _context13.next = 21;
6922
7031
  break;
6923
7032
  }
6924
- return _context12.abrupt("return", resData);
7033
+ return _context13.abrupt("return", resData);
6925
7034
  case 21:
6926
7035
  throw new Error(resData.error);
6927
7036
  case 22:
6928
7037
  case "end":
6929
- return _context12.stop();
7038
+ return _context13.stop();
6930
7039
  }
6931
- }, _callee12, this, [[7, 16]]);
7040
+ }, _callee13, this, [[7, 16]]);
6932
7041
  }));
6933
7042
  function getAiProductPhotoCampaignSummaries() {
6934
7043
  return _getAiProductPhotoCampaignSummaries.apply(this, arguments);
@@ -6938,13 +7047,13 @@ var MediaHandler = /*#__PURE__*/function () {
6938
7047
  }, {
6939
7048
  key: "archiveRenderJob",
6940
7049
  value: (function () {
6941
- var _archiveRenderJob = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee13(id, archived) {
7050
+ var _archiveRenderJob = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(id, archived) {
6942
7051
  var res, resData;
6943
- return _regeneratorRuntime.wrap(function _callee13$(_context13) {
6944
- while (1) switch (_context13.prev = _context13.next) {
7052
+ return _regeneratorRuntime.wrap(function _callee14$(_context14) {
7053
+ while (1) switch (_context14.prev = _context14.next) {
6945
7054
  case 0:
6946
- _context13.prev = 0;
6947
- _context13.next = 3;
7055
+ _context14.prev = 0;
7056
+ _context14.next = 3;
6948
7057
  return fetch("".concat(this.mediaService, "/renderjobs/").concat(id, "/archive"), {
6949
7058
  method: 'PATCH',
6950
7059
  headers: {
@@ -6956,32 +7065,32 @@ var MediaHandler = /*#__PURE__*/function () {
6956
7065
  })
6957
7066
  });
6958
7067
  case 3:
6959
- res = _context13.sent;
6960
- _context13.next = 6;
7068
+ res = _context14.sent;
7069
+ _context14.next = 6;
6961
7070
  return res.json();
6962
7071
  case 6:
6963
- resData = _context13.sent;
6964
- _context13.next = 12;
7072
+ resData = _context14.sent;
7073
+ _context14.next = 12;
6965
7074
  break;
6966
7075
  case 9:
6967
- _context13.prev = 9;
6968
- _context13.t0 = _context13["catch"](0);
7076
+ _context14.prev = 9;
7077
+ _context14.t0 = _context14["catch"](0);
6969
7078
  throw new Error('Could not archive render job');
6970
7079
  case 12:
6971
7080
  if (res.ok) {
6972
- _context13.next = 14;
7081
+ _context14.next = 14;
6973
7082
  break;
6974
7083
  }
6975
7084
  throw new Error(resData.error);
6976
7085
  case 14:
6977
- return _context13.abrupt("return");
7086
+ return _context14.abrupt("return");
6978
7087
  case 15:
6979
7088
  case "end":
6980
- return _context13.stop();
7089
+ return _context14.stop();
6981
7090
  }
6982
- }, _callee13, this, [[0, 9]]);
7091
+ }, _callee14, this, [[0, 9]]);
6983
7092
  }));
6984
- function archiveRenderJob(_x19, _x20) {
7093
+ function archiveRenderJob(_x20, _x21) {
6985
7094
  return _archiveRenderJob.apply(this, arguments);
6986
7095
  }
6987
7096
  return archiveRenderJob;
@@ -6989,13 +7098,13 @@ var MediaHandler = /*#__PURE__*/function () {
6989
7098
  }, {
6990
7099
  key: "getRenderJob",
6991
7100
  value: function () {
6992
- var _getRenderJob = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee14(id) {
7101
+ var _getRenderJob = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15(id) {
6993
7102
  var res, resData;
6994
- return _regeneratorRuntime.wrap(function _callee14$(_context14) {
6995
- while (1) switch (_context14.prev = _context14.next) {
7103
+ return _regeneratorRuntime.wrap(function _callee15$(_context15) {
7104
+ while (1) switch (_context15.prev = _context15.next) {
6996
7105
  case 0:
6997
- _context14.prev = 0;
6998
- _context14.next = 3;
7106
+ _context15.prev = 0;
7107
+ _context15.next = 3;
6999
7108
  return fetch("".concat(this.mediaService, "/renderjobs/").concat(id), {
7000
7109
  headers: {
7001
7110
  Authorization: 'Bearer ' + this.jwt,
@@ -7003,32 +7112,32 @@ var MediaHandler = /*#__PURE__*/function () {
7003
7112
  }
7004
7113
  });
7005
7114
  case 3:
7006
- res = _context14.sent;
7007
- _context14.next = 6;
7115
+ res = _context15.sent;
7116
+ _context15.next = 6;
7008
7117
  return res.json();
7009
7118
  case 6:
7010
- resData = _context14.sent;
7011
- _context14.next = 12;
7119
+ resData = _context15.sent;
7120
+ _context15.next = 12;
7012
7121
  break;
7013
7122
  case 9:
7014
- _context14.prev = 9;
7015
- _context14.t0 = _context14["catch"](0);
7123
+ _context15.prev = 9;
7124
+ _context15.t0 = _context15["catch"](0);
7016
7125
  throw new Error('Could not get render job');
7017
7126
  case 12:
7018
7127
  if (!res.ok) {
7019
- _context14.next = 14;
7128
+ _context15.next = 14;
7020
7129
  break;
7021
7130
  }
7022
- return _context14.abrupt("return", resData);
7131
+ return _context15.abrupt("return", resData);
7023
7132
  case 14:
7024
7133
  throw new Error(resData.error);
7025
7134
  case 15:
7026
7135
  case "end":
7027
- return _context14.stop();
7136
+ return _context15.stop();
7028
7137
  }
7029
- }, _callee14, this, [[0, 9]]);
7138
+ }, _callee15, this, [[0, 9]]);
7030
7139
  }));
7031
- function getRenderJob(_x21) {
7140
+ function getRenderJob(_x22) {
7032
7141
  return _getRenderJob.apply(this, arguments);
7033
7142
  }
7034
7143
  return getRenderJob;
@@ -7036,16 +7145,16 @@ var MediaHandler = /*#__PURE__*/function () {
7036
7145
  }, {
7037
7146
  key: "getRenderPackages",
7038
7147
  value: function () {
7039
- var _getRenderPackages = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee15(organizationId) {
7148
+ var _getRenderPackages = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee16(organizationId) {
7040
7149
  var fullUrl, res, resData;
7041
- return _regeneratorRuntime.wrap(function _callee15$(_context15) {
7042
- while (1) switch (_context15.prev = _context15.next) {
7150
+ return _regeneratorRuntime.wrap(function _callee16$(_context16) {
7151
+ while (1) switch (_context16.prev = _context16.next) {
7043
7152
  case 0:
7044
7153
  fullUrl = new URL(this.mediaService + '/renderpackages');
7045
7154
  if (organizationId) fullUrl.searchParams.append('organizationId', organizationId);
7046
7155
  fullUrl.searchParams.append('sort', encodeURIComponent('{position}'));
7047
- _context15.prev = 3;
7048
- _context15.next = 6;
7156
+ _context16.prev = 3;
7157
+ _context16.next = 6;
7049
7158
  return fetch(fullUrl, {
7050
7159
  headers: {
7051
7160
  Authorization: 'Bearer ' + this.jwt,
@@ -7053,32 +7162,32 @@ var MediaHandler = /*#__PURE__*/function () {
7053
7162
  }
7054
7163
  });
7055
7164
  case 6:
7056
- res = _context15.sent;
7057
- _context15.next = 9;
7165
+ res = _context16.sent;
7166
+ _context16.next = 9;
7058
7167
  return res.json();
7059
7168
  case 9:
7060
- resData = _context15.sent;
7061
- _context15.next = 15;
7169
+ resData = _context16.sent;
7170
+ _context16.next = 15;
7062
7171
  break;
7063
7172
  case 12:
7064
- _context15.prev = 12;
7065
- _context15.t0 = _context15["catch"](3);
7173
+ _context16.prev = 12;
7174
+ _context16.t0 = _context16["catch"](3);
7066
7175
  throw new Error('Could not get render packages');
7067
7176
  case 15:
7068
7177
  if (!res.ok) {
7069
- _context15.next = 17;
7178
+ _context16.next = 17;
7070
7179
  break;
7071
7180
  }
7072
- return _context15.abrupt("return", resData);
7181
+ return _context16.abrupt("return", resData);
7073
7182
  case 17:
7074
7183
  throw new Error(resData.error);
7075
7184
  case 18:
7076
7185
  case "end":
7077
- return _context15.stop();
7186
+ return _context16.stop();
7078
7187
  }
7079
- }, _callee15, this, [[3, 12]]);
7188
+ }, _callee16, this, [[3, 12]]);
7080
7189
  }));
7081
- function getRenderPackages(_x22) {
7190
+ function getRenderPackages(_x23) {
7082
7191
  return _getRenderPackages.apply(this, arguments);
7083
7192
  }
7084
7193
  return getRenderPackages;
@@ -9002,18 +9111,21 @@ var AIHandler = /*#__PURE__*/function () {
9002
9111
  }
9003
9112
  return _context3.abrupt("return", resData);
9004
9113
  case 9:
9114
+ // The services carry an `errorCode` alongside the message for cases a caller has to tell apart
9115
+ // (e.g. a product that cannot be named for the MAM). Drop it here and the caller only sees a bare 400.
9005
9116
  err = new Error(resData === null || resData === void 0 ? void 0 : resData.error);
9006
9117
  err.status = response.status;
9118
+ err.errorCode = resData === null || resData === void 0 ? void 0 : resData.errorCode;
9007
9119
  return _context3.abrupt("return", Promise.reject(err));
9008
- case 14:
9009
- _context3.prev = 14;
9120
+ case 15:
9121
+ _context3.prev = 15;
9010
9122
  _context3.t0 = _context3["catch"](0);
9011
9123
  return _context3.abrupt("return", Promise.reject(_context3.t0));
9012
- case 17:
9124
+ case 18:
9013
9125
  case "end":
9014
9126
  return _context3.stop();
9015
9127
  }
9016
- }, _callee3, this, [[0, 14]]);
9128
+ }, _callee3, this, [[0, 15]]);
9017
9129
  }));
9018
9130
  function generateProductPhoto(_x4) {
9019
9131
  return _generateProductPhoto.apply(this, arguments);
@@ -11148,7 +11260,7 @@ var DrawerMenu$1 = observer(DrawerMenu);
11148
11260
  function ownKeys$4(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; }
11149
11261
  function _objectSpread$4(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$4(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$4(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11150
11262
  var LazyModals$1 = /*#__PURE__*/React.lazy(function () {
11151
- return import('./ModalsWrapper-80b3e4a7.js');
11263
+ return import('./ModalsWrapper-27273842.js');
11152
11264
  });
11153
11265
  function Fullscreen(_ref) {
11154
11266
  var inAbsoluteFullscreen = _ref.inAbsoluteFullscreen;
@@ -11610,10 +11722,10 @@ function ownKeys$3(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymb
11610
11722
  function _objectSpread$3(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys$3(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys$3(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
11611
11723
  var LOG$2 = getLogger('Framework', 'Root');
11612
11724
  var LazyAuth = /*#__PURE__*/React.lazy(function () {
11613
- return import('./index-2224219f.js');
11725
+ return import('./index-f5b2d87b.js');
11614
11726
  });
11615
11727
  var LazyModals = /*#__PURE__*/React.lazy(function () {
11616
- return import('./ModalsWrapper-80b3e4a7.js');
11728
+ return import('./ModalsWrapper-27273842.js');
11617
11729
  });
11618
11730
  function ContentComponent() {
11619
11731
  var context = useDivaCoreContext();