ng-miam 9.1.13 → 9.1.15

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 (29) hide show
  1. package/bundles/ng-miam.umd.js +148 -20
  2. package/bundles/ng-miam.umd.js.map +1 -1
  3. package/bundles/ng-miam.umd.min.js +1 -1
  4. package/bundles/ng-miam.umd.min.js.map +1 -1
  5. package/esm2015/lib/_components/product-card/out-of-stock-overlay/out-of-stock-overlay.component.js +15 -6
  6. package/esm2015/lib/_components/product-card/product-card.component.js +14 -3
  7. package/esm2015/lib/_services/basket-recipe-cleanup.service.js +62 -0
  8. package/esm2015/lib/_services/context.service.js +15 -12
  9. package/esm2015/lib/_services/store-out-of-stock.service.js +12 -1
  10. package/esm2015/lib/environments/version.js +2 -2
  11. package/esm2015/lib/ng-miam.module.js +4 -1
  12. package/fesm2015/ng-miam.js +111 -19
  13. package/fesm2015/ng-miam.js.map +1 -1
  14. package/lib/_components/components.module.d.ts +2 -1
  15. package/lib/_components/components.module.d.ts.map +1 -1
  16. package/lib/_components/product-card/out-of-stock-overlay/out-of-stock-overlay.component.d.ts +7 -3
  17. package/lib/_components/product-card/out-of-stock-overlay/out-of-stock-overlay.component.d.ts.map +1 -1
  18. package/lib/_components/product-card/product-card.component.d.ts +2 -0
  19. package/lib/_components/product-card/product-card.component.d.ts.map +1 -1
  20. package/lib/_services/basket-recipe-cleanup.service.d.ts +21 -0
  21. package/lib/_services/basket-recipe-cleanup.service.d.ts.map +1 -0
  22. package/lib/_services/context.service.d.ts +3 -1
  23. package/lib/_services/context.service.d.ts.map +1 -1
  24. package/lib/_services/store-out-of-stock.service.d.ts +1 -0
  25. package/lib/_services/store-out-of-stock.service.d.ts.map +1 -1
  26. package/lib/environments/version.d.ts +1 -1
  27. package/lib/ng-miam.module.d.ts.map +1 -1
  28. package/miam-style.css +1 -1
  29. package/package.json +1 -1
@@ -2,7 +2,7 @@
2
2
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/common'), require('@angular/common/http'), require('@angular/common/locales/fr'), require('@angular/core'), require('@angular/platform-browser/animations'), require('miam-jsonapi'), require('rxjs'), require('rxjs/operators'), require('@angular/platform-browser'), require('date-fns/endOfWeek'), require('date-fns/isWithinInterval'), require('date-fns/startOfWeek'), require('date-fns/subDays'), require('duration-fns'), require('lodash-es'), require('mealz-shared-analytics'), require('lodash-es/pullAt'), require('@angular/cdk/layout'), require('uuid'), require('@angular/forms'), require('@angular/cdk/drag-drop'), require('@angular/cdk/text-field'), require('@angular/elements'), require('lodash-es/remove'), require('@angular/animations'), require('@angular/youtube-player'), require('lodash-es/groupBy')) :
3
3
  typeof define === 'function' && define.amd ? define('ng-miam', ['exports', '@angular/common', '@angular/common/http', '@angular/common/locales/fr', '@angular/core', '@angular/platform-browser/animations', 'miam-jsonapi', 'rxjs', 'rxjs/operators', '@angular/platform-browser', 'date-fns/endOfWeek', 'date-fns/isWithinInterval', 'date-fns/startOfWeek', 'date-fns/subDays', 'duration-fns', 'lodash-es', 'mealz-shared-analytics', 'lodash-es/pullAt', '@angular/cdk/layout', 'uuid', '@angular/forms', '@angular/cdk/drag-drop', '@angular/cdk/text-field', '@angular/elements', 'lodash-es/remove', '@angular/animations', '@angular/youtube-player', 'lodash-es/groupBy'], factory) :
4
4
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global["ng-miam"] = {}, global.ng.common, global.ng.common.http, global.ng.common.locales.fr, global.ng.core, global.ng.platformBrowser.animations, global.i2$2, global.rxjs, global.rxjs.operators, global.ng.platformBrowser, global.endOfWeek, global.isWithinInterval, global.startOfWeek, global.subDays, global.duration, global.lodashEs, global.mealzSharedAnalytics, global.pullAt, global.ng.cdk.layout, global.uuid, global.ng.forms, global.ng.cdk.dragDrop, global.ng.cdk.textField, global.ng.elements, global.remove, global.ng.animations, global.ng.youtubePlayer, global.groupBy));
5
- })(this, (function (exports, i2, i1, localeFr, i0, animations$1, i2$2, rxjs, operators, i2$1, endOfWeek, isWithinInterval, startOfWeek, subDays, duration, lodashEs, mealzSharedAnalytics, pullAt, i7, uuid, i3, dragDrop, textField, elements, remove, animations, i9, groupBy) { 'use strict';
5
+ })(this, (function (exports, i2, i1, localeFr, i0, animations$1, i2$2, rxjs, operators, i2$1, endOfWeek, isWithinInterval, startOfWeek, subDays, duration, lodashEs, mealzSharedAnalytics, pullAt, i8, uuid, i3, dragDrop, textField, elements, remove, animations, i9, groupBy) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -36,7 +36,7 @@
36
36
  var subDays__default = /*#__PURE__*/_interopDefaultLegacy(subDays);
37
37
  var duration__namespace = /*#__PURE__*/_interopNamespace(duration);
38
38
  var pullAt__default = /*#__PURE__*/_interopDefaultLegacy(pullAt);
39
- var i7__namespace = /*#__PURE__*/_interopNamespace(i7);
39
+ var i8__namespace = /*#__PURE__*/_interopNamespace(i8);
40
40
  var i3__namespace = /*#__PURE__*/_interopNamespace(i3);
41
41
  var remove__default = /*#__PURE__*/_interopDefaultLegacy(remove);
42
42
  var i9__namespace = /*#__PURE__*/_interopNamespace(i9);
@@ -3507,7 +3507,7 @@
3507
3507
  EventJourney["EMPTY"] = "";
3508
3508
  })(EventJourney || (EventJourney = {}));
3509
3509
 
3510
- var VERSION = '9.1.13'; // TODO: replace by ##VERSION## and update it in the CI/CD
3510
+ var VERSION = '9.1.14'; // TODO: replace by ##VERSION## and update it in the CI/CD
3511
3511
 
3512
3512
  var ContextRegistryService = /** @class */ (function () {
3513
3513
  function ContextRegistryService() {
@@ -6595,6 +6595,99 @@
6595
6595
  }], function () { return [{ type: i1__namespace.HttpClient }, { type: BasketEntriesService }, { type: PointOfSalesService }, { type: RecipesService }, { type: AnalyticsService }, { type: UserService }, { type: ToasterService }, { type: IgnoredIngredientsService }, { type: StatesService }, { type: PriceService }]; }, null);
6596
6596
  })();
6597
6597
 
6598
+ var BasketRecipeCleanupService = /** @class */ (function () {
6599
+ function BasketRecipeCleanupService(basketsService) {
6600
+ this.basketsService = basketsService;
6601
+ this.listenBasketEntriesChange();
6602
+ }
6603
+ BasketRecipeCleanupService.prototype.listenBasketEntriesChange = function () {
6604
+ var _this = this;
6605
+ this.basketsService.basketEntries()
6606
+ .subscribe(function (entries) { return _this.cleanupRecipesWithDeletedEntries(entries); });
6607
+ };
6608
+ /**
6609
+ * Cleans up recipes from the basket if all their basket entries have status 'deleted'.
6610
+ * @param basketEntries Array of basket entry objects (as received from API)
6611
+ */
6612
+ BasketRecipeCleanupService.prototype.cleanupRecipesWithDeletedEntries = function (basketEntries) {
6613
+ var e_1, _a, e_2, _b, e_3, _c;
6614
+ // Map recipeId to all associated basket entries
6615
+ var recipeEntryMap = new Map();
6616
+ var recipesIdToRemove = [];
6617
+ try {
6618
+ for (var basketEntries_1 = __values(basketEntries), basketEntries_1_1 = basketEntries_1.next(); !basketEntries_1_1.done; basketEntries_1_1 = basketEntries_1.next()) {
6619
+ var entry = basketEntries_1_1.value;
6620
+ var recipeIds = entry.recipesIds || [];
6621
+ try {
6622
+ for (var recipeIds_1 = (e_2 = void 0, __values(recipeIds)), recipeIds_1_1 = recipeIds_1.next(); !recipeIds_1_1.done; recipeIds_1_1 = recipeIds_1.next()) {
6623
+ var recipeId = recipeIds_1_1.value;
6624
+ if (!recipeEntryMap.has(+recipeId)) {
6625
+ recipeEntryMap.set(+recipeId, []);
6626
+ }
6627
+ recipeEntryMap.get(+recipeId).push(entry);
6628
+ }
6629
+ }
6630
+ catch (e_2_1) { e_2 = { error: e_2_1 }; }
6631
+ finally {
6632
+ try {
6633
+ if (recipeIds_1_1 && !recipeIds_1_1.done && (_b = recipeIds_1.return)) _b.call(recipeIds_1);
6634
+ }
6635
+ finally { if (e_2) throw e_2.error; }
6636
+ }
6637
+ }
6638
+ }
6639
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
6640
+ finally {
6641
+ try {
6642
+ if (basketEntries_1_1 && !basketEntries_1_1.done && (_a = basketEntries_1.return)) _a.call(basketEntries_1);
6643
+ }
6644
+ finally { if (e_1) throw e_1.error; }
6645
+ }
6646
+ try {
6647
+ for (var _d = __values(recipeEntryMap.entries()), _e = _d.next(); !_e.done; _e = _d.next()) {
6648
+ var _f = __read(_e.value, 2), recipeId = _f[0], entries = _f[1];
6649
+ var allDeleted = entries.every(function (e) { return e.attributes.status === 'deleted'; });
6650
+ // Filter: only consider recipes still in the basket
6651
+ if (allDeleted && this.basketsService.recipeIsInBasket(recipeId.toString())) {
6652
+ recipesIdToRemove.push(recipeId.toString());
6653
+ }
6654
+ }
6655
+ }
6656
+ catch (e_3_1) { e_3 = { error: e_3_1 }; }
6657
+ finally {
6658
+ try {
6659
+ if (_e && !_e.done && (_c = _d.return)) _c.call(_d);
6660
+ }
6661
+ finally { if (e_3) throw e_3.error; }
6662
+ }
6663
+ if (recipesIdToRemove.length > 0) {
6664
+ this.removeRecipesFromBasket(recipesIdToRemove);
6665
+ }
6666
+ };
6667
+ /**
6668
+ * Placeholder for actual removal logic (API call, state update, etc.)
6669
+ * @param recipeIds
6670
+ */
6671
+ BasketRecipeCleanupService.prototype.removeRecipesFromBasket = function (recipeIds) {
6672
+ var eventTrace = {
6673
+ originPath: '',
6674
+ props: {}
6675
+ };
6676
+ this.basketsService.removeRecipesFromBasket(recipeIds, eventTrace, false);
6677
+ };
6678
+ return BasketRecipeCleanupService;
6679
+ }());
6680
+ BasketRecipeCleanupService.ɵfac = function BasketRecipeCleanupService_Factory(t) { return new (t || BasketRecipeCleanupService)(i0__namespace.ɵɵinject(BasketsService)); };
6681
+ BasketRecipeCleanupService.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: BasketRecipeCleanupService, factory: BasketRecipeCleanupService.ɵfac, providedIn: 'root' });
6682
+ (function () {
6683
+ (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(BasketRecipeCleanupService, [{
6684
+ type: i0.Injectable,
6685
+ args: [{
6686
+ providedIn: 'root'
6687
+ }]
6688
+ }], function () { return [{ type: BasketsService }]; }, null);
6689
+ })();
6690
+
6598
6691
  var ItemsComparator = /** @class */ (function () {
6599
6692
  function ItemsComparator() {
6600
6693
  this.miamBasketEntries = []; // id = basketEntry.id
@@ -7783,7 +7876,7 @@
7783
7876
 
7784
7877
  var SMALL_SCREEN_BP = '(min-width: 1023px)';
7785
7878
  var ContextService = /** @class */ (function () {
7786
- function ContextService(posService, basketsService, userService, preferencesService, analyticsService, recipesService, mediaMatcher, suppliersService, breakpointObserver,
7879
+ function ContextService(posService, basketsService, userService, preferencesService, analyticsService, recipesService, basketRecipeCleanupService, mediaMatcher, suppliersService, breakpointObserver,
7787
7880
  // private basketHandler: LegacyBasketsSynchronizerService,
7788
7881
  basketHandler, storeLocatorService, recipeLikesService, fakeCartService, historyService, contextRegistryService) {
7789
7882
  var _this = this;
@@ -7793,6 +7886,7 @@
7793
7886
  this.preferencesService = preferencesService;
7794
7887
  this.analyticsService = analyticsService;
7795
7888
  this.recipesService = recipesService;
7889
+ this.basketRecipeCleanupService = basketRecipeCleanupService;
7796
7890
  this.mediaMatcher = mediaMatcher;
7797
7891
  this.suppliersService = suppliersService;
7798
7892
  this.breakpointObserver = breakpointObserver;
@@ -8292,7 +8386,7 @@
8292
8386
  };
8293
8387
  return ContextService;
8294
8388
  }());
8295
- ContextService.ɵfac = function ContextService_Factory(t) { return new (t || ContextService)(i0__namespace.ɵɵinject(PointOfSalesService), i0__namespace.ɵɵinject(BasketsService), i0__namespace.ɵɵinject(UserService), i0__namespace.ɵɵinject(PreferencesService), i0__namespace.ɵɵinject(AnalyticsService), i0__namespace.ɵɵinject(RecipesService), i0__namespace.ɵɵinject(i7__namespace.MediaMatcher), i0__namespace.ɵɵinject(SuppliersService), i0__namespace.ɵɵinject(i7__namespace.BreakpointObserver), i0__namespace.ɵɵinject(BasketsSynchronizerService), i0__namespace.ɵɵinject(StoreLocatorService), i0__namespace.ɵɵinject(RecipeLikesService), i0__namespace.ɵɵinject(FakeRetailerCartService), i0__namespace.ɵɵinject(HistoryService), i0__namespace.ɵɵinject(ContextRegistryService)); };
8389
+ ContextService.ɵfac = function ContextService_Factory(t) { return new (t || ContextService)(i0__namespace.ɵɵinject(PointOfSalesService), i0__namespace.ɵɵinject(BasketsService), i0__namespace.ɵɵinject(UserService), i0__namespace.ɵɵinject(PreferencesService), i0__namespace.ɵɵinject(AnalyticsService), i0__namespace.ɵɵinject(RecipesService), i0__namespace.ɵɵinject(BasketRecipeCleanupService), i0__namespace.ɵɵinject(i8__namespace.MediaMatcher), i0__namespace.ɵɵinject(SuppliersService), i0__namespace.ɵɵinject(i8__namespace.BreakpointObserver), i0__namespace.ɵɵinject(BasketsSynchronizerService), i0__namespace.ɵɵinject(StoreLocatorService), i0__namespace.ɵɵinject(RecipeLikesService), i0__namespace.ɵɵinject(FakeRetailerCartService), i0__namespace.ɵɵinject(HistoryService), i0__namespace.ɵɵinject(ContextRegistryService)); };
8296
8390
  ContextService.ɵprov = i0__namespace.ɵɵdefineInjectable({ token: ContextService, factory: ContextService.ɵfac, providedIn: 'root' });
8297
8391
  (function () {
8298
8392
  (typeof ngDevMode === "undefined" || ngDevMode) && i0__namespace.ɵsetClassMetadata(ContextService, [{
@@ -8300,7 +8394,7 @@
8300
8394
  args: [{
8301
8395
  providedIn: 'root'
8302
8396
  }]
8303
- }], function () { return [{ type: PointOfSalesService }, { type: BasketsService }, { type: UserService }, { type: PreferencesService }, { type: AnalyticsService }, { type: RecipesService }, { type: i7__namespace.MediaMatcher }, { type: SuppliersService }, { type: i7__namespace.BreakpointObserver }, { type: BasketsSynchronizerService }, { type: StoreLocatorService }, { type: RecipeLikesService }, { type: FakeRetailerCartService }, { type: HistoryService }, { type: ContextRegistryService }]; }, null);
8397
+ }], function () { return [{ type: PointOfSalesService }, { type: BasketsService }, { type: UserService }, { type: PreferencesService }, { type: AnalyticsService }, { type: RecipesService }, { type: BasketRecipeCleanupService }, { type: i8__namespace.MediaMatcher }, { type: SuppliersService }, { type: i8__namespace.BreakpointObserver }, { type: BasketsSynchronizerService }, { type: StoreLocatorService }, { type: RecipeLikesService }, { type: FakeRetailerCartService }, { type: HistoryService }, { type: ContextRegistryService }]; }, null);
8304
8398
  })();
8305
8399
 
8306
8400
  var _c0$p = function (a0, a1) { return { "width": a0, "height": a1 }; };
@@ -10279,11 +10373,22 @@
10279
10373
  };
10280
10374
  StoreOutOfStockService.prototype.isOutOfStockFromStorage = function (entry) {
10281
10375
  var _a;
10376
+ if (entry.status === 'active') {
10377
+ this.removeEntryFromStorage(entry);
10378
+ return;
10379
+ }
10282
10380
  if ((_a = entry === null || entry === void 0 ? void 0 : entry.selectedItem) === null || _a === void 0 ? void 0 : _a.id) {
10283
10381
  return this.outOfStockEntries.includes(entry.selectedItem.id.toString());
10284
10382
  }
10285
10383
  return false;
10286
10384
  };
10385
+ StoreOutOfStockService.prototype.removeEntryFromStorage = function (entry) {
10386
+ var _a;
10387
+ if ((_a = entry === null || entry === void 0 ? void 0 : entry.selectedItem) === null || _a === void 0 ? void 0 : _a.id) {
10388
+ this.outOfStockEntries = this.outOfStockEntries.filter(function (id) { return id !== entry.selectedItem.id; });
10389
+ sessionStorage.setItem('_miam/outOfStockEntry', JSON.stringify(this.outOfStockEntries));
10390
+ }
10391
+ };
10287
10392
  StoreOutOfStockService.prototype.addEntryToStorage = function (entry) {
10288
10393
  var _a;
10289
10394
  if ((_a = entry.selectedItem) === null || _a === void 0 ? void 0 : _a.id) {
@@ -12431,7 +12536,7 @@
12431
12536
  };
12432
12537
  return RecipeFiltersComponent;
12433
12538
  }());
12434
- RecipeFiltersComponent.ɵfac = function RecipeFiltersComponent_Factory(t) { return new (t || RecipeFiltersComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef), i0__namespace.ɵɵdirectiveInject(i7__namespace.MediaMatcher), i0__namespace.ɵɵdirectiveInject(UserService), i0__namespace.ɵɵdirectiveInject(ContextService), i0__namespace.ɵɵdirectiveInject(RecipesService)); };
12539
+ RecipeFiltersComponent.ɵfac = function RecipeFiltersComponent_Factory(t) { return new (t || RecipeFiltersComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef), i0__namespace.ɵɵdirectiveInject(i8__namespace.MediaMatcher), i0__namespace.ɵɵdirectiveInject(UserService), i0__namespace.ɵɵdirectiveInject(ContextService), i0__namespace.ɵɵdirectiveInject(RecipesService)); };
12435
12540
  RecipeFiltersComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: RecipeFiltersComponent, selectors: [["ng-miam-recipe-filters"]], inputs: { filters: "filters", filterToRemove: "filterToRemove", isFilterCollapsed: "isFilterCollapsed", position: "position", modifiedGuests: "modifiedGuests", excludedRecipesIds: "excludedRecipesIds" }, outputs: { filterChanged: "filterChanged", filterCollapsed: "filterCollapsed", preferencesChanged: "preferencesChanged" }, features: [i0__namespace.ɵɵNgOnChangesFeature], decls: 19, vars: 12, consts: function () {
12436
12541
  var i18n_0;
12437
12542
  if (typeof ngI18nClosureMode !== "undefined" && ngI18nClosureMode) {
@@ -12646,7 +12751,7 @@
12646
12751
  encapsulation: i0.ViewEncapsulation.None,
12647
12752
  changeDetection: i0.ChangeDetectionStrategy.OnPush
12648
12753
  }]
12649
- }], function () { return [{ type: i0__namespace.ChangeDetectorRef }, { type: i7__namespace.MediaMatcher }, { type: UserService }, { type: ContextService }, { type: RecipesService }]; }, { filters: [{
12754
+ }], function () { return [{ type: i0__namespace.ChangeDetectorRef }, { type: i8__namespace.MediaMatcher }, { type: UserService }, { type: ContextService }, { type: RecipesService }]; }, { filters: [{
12650
12755
  type: i0.Input
12651
12756
  }], filterToRemove: [{
12652
12757
  type: i0.Input
@@ -14248,13 +14353,20 @@
14248
14353
  }(BasketAction));
14249
14354
 
14250
14355
  var OutOfStockOverlayComponent = /** @class */ (function () {
14251
- function OutOfStockOverlayComponent() {
14356
+ function OutOfStockOverlayComponent(elementRef) {
14357
+ this.elementRef = elementRef;
14252
14358
  this.replacedClicked = new i0.EventEmitter();
14253
14359
  }
14360
+ OutOfStockOverlayComponent.prototype.ngOnChanges = function () {
14361
+ var element = this.elementRef.nativeElement.children[0];
14362
+ if (element) {
14363
+ element.style.top = this.headerHeight + 'px';
14364
+ }
14365
+ };
14254
14366
  return OutOfStockOverlayComponent;
14255
14367
  }());
14256
- OutOfStockOverlayComponent.ɵfac = function OutOfStockOverlayComponent_Factory(t) { return new (t || OutOfStockOverlayComponent)(); };
14257
- OutOfStockOverlayComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: OutOfStockOverlayComponent, selectors: [["ng-miam-out-of-stock-overlay"]], outputs: { replacedClicked: "replacedClicked" }, decls: 6, vars: 0, consts: function () {
14368
+ OutOfStockOverlayComponent.ɵfac = function OutOfStockOverlayComponent_Factory(t) { return new (t || OutOfStockOverlayComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.ElementRef)); };
14369
+ OutOfStockOverlayComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: OutOfStockOverlayComponent, selectors: [["ng-miam-out-of-stock-overlay"]], inputs: { headerHeight: "headerHeight" }, outputs: { replacedClicked: "replacedClicked" }, features: [i0__namespace.ɵɵNgOnChangesFeature], decls: 6, vars: 0, consts: function () {
14258
14370
  var i18n_0;
14259
14371
  if (typeof ngI18nClosureMode !== "undefined" && ngI18nClosureMode) {
14260
14372
  var MSG_EXTERNAL_4705093661060921903$$LIB__COMPONENTS_PRODUCT_CARD_OUT_OF_STOCK_OVERLAY_OUT_OF_STOCK_OVERLAY_COMPONENT_TS_1 = goog.getMsg("Remplacer");
@@ -14288,7 +14400,9 @@
14288
14400
  encapsulation: i0.ViewEncapsulation.None,
14289
14401
  changeDetection: i0.ChangeDetectionStrategy.OnPush
14290
14402
  }]
14291
- }], null, { replacedClicked: [{
14403
+ }], function () { return [{ type: i0__namespace.ElementRef }]; }, { headerHeight: [{
14404
+ type: i0.Input
14405
+ }], replacedClicked: [{
14292
14406
  type: i0.Output
14293
14407
  }] });
14294
14408
  })();
@@ -14366,6 +14480,10 @@
14366
14480
  i0__namespace.ɵɵlistener("replacedClicked", function ProductCardComponent_div_0_ng_miam_out_of_stock_overlay_1_Template_ng_miam_out_of_stock_overlay_replacedClicked_0_listener() { i0__namespace.ɵɵrestoreView(_r7_1); var ctx_r6 = i0__namespace.ɵɵnextContext(2); return ctx_r6.replaceProduct(true); });
14367
14481
  i0__namespace.ɵɵelementEnd();
14368
14482
  }
14483
+ if (rf & 2) {
14484
+ var ctx_r1 = i0__namespace.ɵɵnextContext(2);
14485
+ i0__namespace.ɵɵproperty("headerHeight", ctx_r1.headerHeight);
14486
+ }
14369
14487
  }
14370
14488
  function ProductCardComponent_div_0_ng_container_12_ng_container_16_button_1_Template(rf, ctx) {
14371
14489
  if (rf & 1) {
@@ -14576,7 +14694,7 @@
14576
14694
  function ProductCardComponent_div_0_Template(rf, ctx) {
14577
14695
  if (rf & 1) {
14578
14696
  i0__namespace.ɵɵelementStart(0, "div", 1);
14579
- i0__namespace.ɵɵtemplate(1, ProductCardComponent_div_0_ng_miam_out_of_stock_overlay_1_Template, 1, 0, "ng-miam-out-of-stock-overlay", 2);
14697
+ i0__namespace.ɵɵtemplate(1, ProductCardComponent_div_0_ng_miam_out_of_stock_overlay_1_Template, 1, 1, "ng-miam-out-of-stock-overlay", 2);
14580
14698
  i0__namespace.ɵɵelementStart(2, "div", 3);
14581
14699
  i0__namespace.ɵɵelementStart(3, "span", 4);
14582
14700
  i0__namespace.ɵɵtext(4);
@@ -14668,6 +14786,7 @@
14668
14786
  ProductCardComponent.prototype.ngOnInit = function () {
14669
14787
  var _this = this;
14670
14788
  this.subscriptions.push(this.recipeDetailsService.productsByCategory$.subscribe(function () { return _this.isProductSponsored(); }), this.executeActionFromStorage(), this.loadOnRecipesActions(), this.loadOnIngredientsUpdate(), this.updateIngredientQuantityOnRecipeChange(), this.productIsBeingAdded(), this.scrollBackOnProductReplaced());
14789
+ this.getHeaderHeight();
14671
14790
  };
14672
14791
  ProductCardComponent.prototype.ngOnDestroy = function () {
14673
14792
  var _a;
@@ -14837,6 +14956,13 @@
14837
14956
  this.product.basketEntry.addRelationship(parsedMethod.arguments.entry.relationships['selected-item'].data, 'selected-item');
14838
14957
  }
14839
14958
  };
14959
+ ProductCardComponent.prototype.getHeaderHeight = function () {
14960
+ var headerElement = this.elementRef.nativeElement.querySelectorAll('.miam-product-card__header');
14961
+ if (headerElement.length === 1) {
14962
+ this.headerHeight = headerElement[0].offsetHeight;
14963
+ this.cdr.detectChanges();
14964
+ }
14965
+ };
14840
14966
  return ProductCardComponent;
14841
14967
  }(EventTracerComponent));
14842
14968
  ProductCardComponent.ɵfac = function ProductCardComponent_Factory(t) { return new (t || ProductCardComponent)(i0__namespace.ɵɵdirectiveInject(AnalyticsService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef), i0__namespace.ɵɵdirectiveInject(BasketsService), i0__namespace.ɵɵdirectiveInject(RecipeDetailsService), i0__namespace.ɵɵdirectiveInject(RecipesService), i0__namespace.ɵɵdirectiveInject(IgnoredIngredientsService), i0__namespace.ɵɵdirectiveInject(PendingBasketMethodsService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ElementRef), i0__namespace.ɵɵdirectiveInject(BasketsSynchronizerService), i0__namespace.ɵɵdirectiveInject(ContextService), i0__namespace.ɵɵdirectiveInject(ProductReplacementService), i0__namespace.ɵɵdirectiveInject(PriceService)); };
@@ -14905,7 +15031,7 @@
14905
15031
  else {
14906
15032
  i18n_14 = $localize(templateObject_8$9 || (templateObject_8$9 = __makeTemplateObject([":\u241Ff0ee2f84e20252199737bc9757b04e75979cb9fe\u241F8253051398336962047: repas"], [":\u241Ff0ee2f84e20252199737bc9757b04e75979cb9fe\u241F8253051398336962047: repas"])));
14907
15033
  }
14908
- return [["class", "miam-product-card__container", 3, "ngClass", 4, "ngIf"], [1, "miam-product-card__container", 3, "ngClass"], [3, "replacedClicked", 4, "ngIf"], [1, "miam-product-card__header", 3, "ngClass"], [1, "miam-product-card__header-name", "miam-ds-text", "size-l", "weight-xxl", 3, "ngClass"], [1, "miam-product-card__header-quantity", "miam-ds-text", "size-s", "weight-l", 3, "ngClass"], [1, "miam-product-card__content", 3, "ngClass"], [4, "ngIf", "ngIfElse"], ["disabledProduct", ""], ["class", "miam-product-card__footer", 4, "ngIf"], [3, "replacedClicked"], [3, "priceData"], [1, "miam-product-card__selected-product"], [1, "miam-product-card__picture-column"], ["alt", "product", 1, "miam-product-card__picture", 3, "src", "error"], [1, "miam-product-card__info-column"], [1, "miam-ds-text", "size-xs", "weight-xl", "miam-product-card__details", "product-brand"], [1, "miam-ds-text", "size-xs", "miam-product-card__details", "product-fullname"], [3, "isSponsored", "item", "price"], [1, "miam-product-card__lower-action"], [1, "miam-product-card__price", "miam-ds-text", "size-m", "weight-xxl", 3, "oldPrice", "price"], [1, "miam-product-card__cta"], [4, "ngIf"], [1, "miam-product-card__footer__actions"], ["class", "miam-ds-button miam-product-card__ignore-product ghost small", 3, "click", 4, "ngIf"], [1, "miam-product-card__replace-product", "miam-ds-button", "ghost", 3, "click"], i18n_0, ["class", "miam-ds-button miam-product-card__add-product square primary", 3, "disabled", "click", 4, "ngIf"], ["class", "miam-ds-button miam-product-card__loading-button square primary", 4, "ngIf"], [1, "miam-ds-button", "miam-product-card__add-product", "square", "primary", 3, "disabled", "click"], ["alt", "basket icon", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Basket.svg"], [1, "miam-ds-button", "miam-product-card__loading-button", "square", "primary"], [1, "miam-ds-loader"], ["minRange", "0", 3, "biColor", "value", "minusLoading", "disable", "debounceTime", "valueChange"], [1, "miam-ds-button", "miam-product-card__ignore-product", "ghost", "small", 3, "click"], [1, "miam-product-card__disabled-text"], i18n_2, [1, "miam-ds-text", "miam-product-card__disabled-text"], i18n_4, [1, "miam-product-card__select-product", "miam-ds-button", "ghost", 3, "click"], i18n_6, ["alt", "ingredient picture", 1, "miam-ds-avatar", 3, "src"], [1, "miam-ds-badge", "warning"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/WarningFill.svg", "alt", "warning"], [1, "miam-ds-text", "size-xs", "weight-l"], i18n_8, [1, "miam-product-card__select-product", "miam-ds-button", "primary", "reverse", "small", 3, "click"], i18n_10, [1, "miam-product-card__footer"], [1, "miam-ds-text", "size-xs", "weight-xl", "light-text"], i18n_12, i18n_14];
15034
+ return [["class", "miam-product-card__container", 3, "ngClass", 4, "ngIf"], [1, "miam-product-card__container", 3, "ngClass"], [3, "headerHeight", "replacedClicked", 4, "ngIf"], [1, "miam-product-card__header", 3, "ngClass"], [1, "miam-product-card__header-name", "miam-ds-text", "size-l", "weight-xxl", 3, "ngClass"], [1, "miam-product-card__header-quantity", "miam-ds-text", "size-s", "weight-l", 3, "ngClass"], [1, "miam-product-card__content", 3, "ngClass"], [4, "ngIf", "ngIfElse"], ["disabledProduct", ""], ["class", "miam-product-card__footer", 4, "ngIf"], [3, "headerHeight", "replacedClicked"], [3, "priceData"], [1, "miam-product-card__selected-product"], [1, "miam-product-card__picture-column"], ["alt", "product", 1, "miam-product-card__picture", 3, "src", "error"], [1, "miam-product-card__info-column"], [1, "miam-ds-text", "size-xs", "weight-xl", "miam-product-card__details", "product-brand"], [1, "miam-ds-text", "size-xs", "miam-product-card__details", "product-fullname"], [3, "isSponsored", "item", "price"], [1, "miam-product-card__lower-action"], [1, "miam-product-card__price", "miam-ds-text", "size-m", "weight-xxl", 3, "oldPrice", "price"], [1, "miam-product-card__cta"], [4, "ngIf"], [1, "miam-product-card__footer__actions"], ["class", "miam-ds-button miam-product-card__ignore-product ghost small", 3, "click", 4, "ngIf"], [1, "miam-product-card__replace-product", "miam-ds-button", "ghost", 3, "click"], i18n_0, ["class", "miam-ds-button miam-product-card__add-product square primary", 3, "disabled", "click", 4, "ngIf"], ["class", "miam-ds-button miam-product-card__loading-button square primary", 4, "ngIf"], [1, "miam-ds-button", "miam-product-card__add-product", "square", "primary", 3, "disabled", "click"], ["alt", "basket icon", "src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/Basket.svg"], [1, "miam-ds-button", "miam-product-card__loading-button", "square", "primary"], [1, "miam-ds-loader"], ["minRange", "0", 3, "biColor", "value", "minusLoading", "disable", "debounceTime", "valueChange"], [1, "miam-ds-button", "miam-product-card__ignore-product", "ghost", "small", 3, "click"], [1, "miam-product-card__disabled-text"], i18n_2, [1, "miam-ds-text", "miam-product-card__disabled-text"], i18n_4, [1, "miam-product-card__select-product", "miam-ds-button", "ghost", 3, "click"], i18n_6, ["alt", "ingredient picture", 1, "miam-ds-avatar", 3, "src"], [1, "miam-ds-badge", "warning"], ["src", "https://storage.googleapis.com/assets.miam.tech/generic/icons/WarningFill.svg", "alt", "warning"], [1, "miam-ds-text", "size-xs", "weight-l"], i18n_8, [1, "miam-product-card__select-product", "miam-ds-button", "primary", "reverse", "small", 3, "click"], i18n_10, [1, "miam-product-card__footer"], [1, "miam-ds-text", "size-xs", "weight-xl", "light-text"], i18n_12, i18n_14];
14909
15035
  }, template: function ProductCardComponent_Template(rf, ctx) {
14910
15036
  if (rf & 1) {
14911
15037
  i0__namespace.ɵɵtemplate(0, ProductCardComponent_div_0_Template, 16, 30, "div", 0);
@@ -18858,7 +18984,7 @@
18858
18984
  };
18859
18985
  return BasketPreviewBlockComponent;
18860
18986
  }(EventTracerComponent));
18861
- BasketPreviewBlockComponent.ɵfac = function BasketPreviewBlockComponent_Factory(t) { return new (t || BasketPreviewBlockComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef), i0__namespace.ɵɵdirectiveInject(PointOfSalesService), i0__namespace.ɵɵdirectiveInject(ContextService), i0__namespace.ɵɵdirectiveInject(BasketsService), i0__namespace.ɵɵdirectiveInject(i7__namespace.MediaMatcher), i0__namespace.ɵɵdirectiveInject(AnalyticsService), i0__namespace.ɵɵdirectiveInject(ProductReplacementService), i0__namespace.ɵɵdirectiveInject(BasketsSynchronizerService), i0__namespace.ɵɵdirectiveInject(RecipesService)); };
18987
+ BasketPreviewBlockComponent.ɵfac = function BasketPreviewBlockComponent_Factory(t) { return new (t || BasketPreviewBlockComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef), i0__namespace.ɵɵdirectiveInject(PointOfSalesService), i0__namespace.ɵɵdirectiveInject(ContextService), i0__namespace.ɵɵdirectiveInject(BasketsService), i0__namespace.ɵɵdirectiveInject(i8__namespace.MediaMatcher), i0__namespace.ɵɵdirectiveInject(AnalyticsService), i0__namespace.ɵɵdirectiveInject(ProductReplacementService), i0__namespace.ɵɵdirectiveInject(BasketsSynchronizerService), i0__namespace.ɵɵdirectiveInject(RecipesService)); };
18862
18988
  BasketPreviewBlockComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: BasketPreviewBlockComponent, selectors: [["ng-miam-basket-preview-block"]], viewQuery: function BasketPreviewBlockComponent_Query(rf, ctx) {
18863
18989
  if (rf & 1) {
18864
18990
  i0__namespace.ɵɵviewQuery(BasketPreviewLineComponent, 1);
@@ -18960,7 +19086,7 @@
18960
19086
  encapsulation: i0.ViewEncapsulation.None,
18961
19087
  changeDetection: i0.ChangeDetectionStrategy.OnPush
18962
19088
  }]
18963
- }], function () { return [{ type: i0__namespace.ChangeDetectorRef }, { type: PointOfSalesService }, { type: ContextService }, { type: BasketsService }, { type: i7__namespace.MediaMatcher }, { type: AnalyticsService }, { type: ProductReplacementService }, { type: BasketsSynchronizerService }, { type: RecipesService }]; }, { recipeId: [{
19089
+ }], function () { return [{ type: i0__namespace.ChangeDetectorRef }, { type: PointOfSalesService }, { type: ContextService }, { type: BasketsService }, { type: i8__namespace.MediaMatcher }, { type: AnalyticsService }, { type: ProductReplacementService }, { type: BasketsSynchronizerService }, { type: RecipesService }]; }, { recipeId: [{
18964
19090
  type: i0.Input
18965
19091
  }], showNotice: [{
18966
19092
  type: i0.Input
@@ -19492,7 +19618,7 @@
19492
19618
  };
19493
19619
  return ListScanFilesInputsComponent;
19494
19620
  }());
19495
- ListScanFilesInputsComponent.ɵfac = function ListScanFilesInputsComponent_Factory(t) { return new (t || ListScanFilesInputsComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef), i0__namespace.ɵɵdirectiveInject(i7__namespace.MediaMatcher), i0__namespace.ɵɵdirectiveInject(ListScanService)); };
19621
+ ListScanFilesInputsComponent.ɵfac = function ListScanFilesInputsComponent_Factory(t) { return new (t || ListScanFilesInputsComponent)(i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef), i0__namespace.ɵɵdirectiveInject(i8__namespace.MediaMatcher), i0__namespace.ɵɵdirectiveInject(ListScanService)); };
19496
19622
  ListScanFilesInputsComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: ListScanFilesInputsComponent, selectors: [["ng-miam-list-scan-files-inputs"]], inputs: { isSchoolList: "isSchoolList" }, decls: 6, vars: 2, consts: function () {
19497
19623
  var i18n_0;
19498
19624
  if (typeof ngI18nClosureMode !== "undefined" && ngI18nClosureMode) {
@@ -19535,7 +19661,7 @@
19535
19661
  encapsulation: i0.ViewEncapsulation.None,
19536
19662
  changeDetection: i0.ChangeDetectionStrategy.OnPush
19537
19663
  }]
19538
- }], function () { return [{ type: i0__namespace.ChangeDetectorRef }, { type: i7__namespace.MediaMatcher }, { type: ListScanService }]; }, { isSchoolList: [{
19664
+ }], function () { return [{ type: i0__namespace.ChangeDetectorRef }, { type: i8__namespace.MediaMatcher }, { type: ListScanService }]; }, { isSchoolList: [{
19539
19665
  type: i0.Input
19540
19666
  }] });
19541
19667
  })();
@@ -25591,7 +25717,7 @@
25591
25717
  };
25592
25718
  return RecipeCatalogComponent;
25593
25719
  }(EventTracerComponent));
25594
- RecipeCatalogComponent.ɵfac = function RecipeCatalogComponent_Factory(t) { return new (t || RecipeCatalogComponent)(i0__namespace.ɵɵdirectiveInject(AnalyticsService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef), i0__namespace.ɵɵdirectiveInject(SponsorService), i0__namespace.ɵɵdirectiveInject(SuppliersService), i0__namespace.ɵɵdirectiveInject(PackageService), i0__namespace.ɵɵdirectiveInject(RecipesService), i0__namespace.ɵɵdirectiveInject(i7__namespace.MediaMatcher), i0__namespace.ɵɵdirectiveInject(UserService), i0__namespace.ɵɵdirectiveInject(CatalogSettingsService), i0__namespace.ɵɵdirectiveInject(BasketsService), i0__namespace.ɵɵdirectiveInject(ContextService), i0__namespace.ɵɵdirectiveInject(HistoryService), i0__namespace.ɵɵdirectiveInject(i2__namespace$1.DomSanitizer)); };
25720
+ RecipeCatalogComponent.ɵfac = function RecipeCatalogComponent_Factory(t) { return new (t || RecipeCatalogComponent)(i0__namespace.ɵɵdirectiveInject(AnalyticsService), i0__namespace.ɵɵdirectiveInject(i0__namespace.ChangeDetectorRef), i0__namespace.ɵɵdirectiveInject(SponsorService), i0__namespace.ɵɵdirectiveInject(SuppliersService), i0__namespace.ɵɵdirectiveInject(PackageService), i0__namespace.ɵɵdirectiveInject(RecipesService), i0__namespace.ɵɵdirectiveInject(i8__namespace.MediaMatcher), i0__namespace.ɵɵdirectiveInject(UserService), i0__namespace.ɵɵdirectiveInject(CatalogSettingsService), i0__namespace.ɵɵdirectiveInject(BasketsService), i0__namespace.ɵɵdirectiveInject(ContextService), i0__namespace.ɵɵdirectiveInject(HistoryService), i0__namespace.ɵɵdirectiveInject(i2__namespace$1.DomSanitizer)); };
25595
25721
  RecipeCatalogComponent.ɵcmp = i0__namespace.ɵɵdefineComponent({ type: RecipeCatalogComponent, selectors: [["ng-miam-recipe-catalog"]], viewQuery: function RecipeCatalogComponent_Query(rf, ctx) {
25596
25722
  if (rf & 1) {
25597
25723
  i0__namespace.ɵɵviewQuery(CatalogHeaderComponent, 1);
@@ -25702,7 +25828,7 @@
25702
25828
  encapsulation: i0.ViewEncapsulation.None,
25703
25829
  changeDetection: i0.ChangeDetectionStrategy.OnPush
25704
25830
  }]
25705
- }], function () { return [{ type: AnalyticsService }, { type: i0__namespace.ChangeDetectorRef }, { type: SponsorService }, { type: SuppliersService }, { type: PackageService }, { type: RecipesService }, { type: i7__namespace.MediaMatcher }, { type: UserService }, { type: CatalogSettingsService }, { type: BasketsService }, { type: ContextService }, { type: HistoryService }, { type: i2__namespace$1.DomSanitizer }]; }, { catalogHeader: [{
25831
+ }], function () { return [{ type: AnalyticsService }, { type: i0__namespace.ChangeDetectorRef }, { type: SponsorService }, { type: SuppliersService }, { type: PackageService }, { type: RecipesService }, { type: i8__namespace.MediaMatcher }, { type: UserService }, { type: CatalogSettingsService }, { type: BasketsService }, { type: ContextService }, { type: HistoryService }, { type: i2__namespace$1.DomSanitizer }]; }, { catalogHeader: [{
25706
25832
  type: i0.ViewChild,
25707
25833
  args: [CatalogHeaderComponent]
25708
25834
  }], catalogToolbar: [{
@@ -29695,6 +29821,7 @@
29695
29821
  BasketsService,
29696
29822
  BasketEntriesService,
29697
29823
  ItemsService,
29824
+ BasketRecipeCleanupService,
29698
29825
  CatalogSettingsService,
29699
29826
  ListScanService,
29700
29827
  PreferencesService,
@@ -29737,6 +29864,7 @@
29737
29864
  BasketsService,
29738
29865
  BasketEntriesService,
29739
29866
  ItemsService,
29867
+ BasketRecipeCleanupService,
29740
29868
  CatalogSettingsService,
29741
29869
  ListScanService,
29742
29870
  PreferencesService,