ng-miam 6.0.3 → 6.1.0

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 (30) hide show
  1. package/bundles/ng-miam.umd.js +224 -229
  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/_services/analytics.service.js +4 -4
  6. package/esm2015/lib/_services/baskets-synchronizing/baskets-comparator.service.js +7 -3
  7. package/esm2015/lib/_services/baskets-synchronizing/baskets-synchronizer.service.js +19 -18
  8. package/esm2015/lib/_services/baskets.service.js +8 -8
  9. package/esm2015/lib/_services/context.service.js +54 -17
  10. package/esm2015/lib/_services/index.js +16 -15
  11. package/esm2015/lib/_services/interceptor.service.js +67 -34
  12. package/esm2015/lib/_services/recipe-likes.service.js +2 -2
  13. package/esm2015/lib/_services/recipe-provider.service.js +4 -11
  14. package/esm2015/lib/_services/recipe-status.service.js +1 -2
  15. package/esm2015/lib/_services/recipe-type.service.js +3 -5
  16. package/esm2015/lib/_services/suppliers.service.js +4 -4
  17. package/esm2015/lib/_types/builded/miam-interface.js +1 -1
  18. package/esm2015/lib/_web-components/catalog-list/catalog-list.component.js +2 -2
  19. package/esm2015/lib/_web-components/recipe-catalog/recipe-catalog.component.js +1 -2
  20. package/esm2015/lib/_web-components/recipe-form/recipe-form.component.js +25 -72
  21. package/fesm2015/ng-miam.js +218 -203
  22. package/fesm2015/ng-miam.js.map +1 -1
  23. package/lib/_services/baskets-synchronizing/baskets-synchronizer.service.d.ts +0 -1
  24. package/lib/_services/context.service.d.ts +8 -3
  25. package/lib/_services/index.d.ts +15 -14
  26. package/lib/_services/interceptor.service.d.ts +5 -0
  27. package/lib/_services/recipe-provider.service.d.ts +2 -5
  28. package/lib/_services/recipe-type.service.d.ts +1 -1
  29. package/lib/_types/builded/miam-interface.d.ts +8 -2
  30. package/package.json +1 -1
@@ -507,9 +507,9 @@
507
507
  SuppliersService.prototype.loadSupplier = function (supplierId) {
508
508
  var _this = this;
509
509
  if (!this.supplier$.value || this.supplier$.value.id !== supplierId) {
510
- this.get(supplierId, { include: ['catalog-setting'] }).pipe(operators.skipWhile(function (supplier) { return supplier.is_loading; }), operators.tap(function (supplier) { return _this.supplier$.next(supplier); })).subscribe();
510
+ return this.get(supplierId, { include: ['catalog-setting'] }).pipe(operators.skipWhile(function (supplier) { return supplier.is_loading; }), operators.tap(function (supplier) { return _this.supplier$.next(supplier); }));
511
511
  }
512
- return this.supplier$;
512
+ return rxjs.of(null);
513
513
  };
514
514
  // TODO: api : add related relationship route
515
515
  SuppliersService.prototype.getSupplierPointOfSales = function (supplierId) {
@@ -717,7 +717,7 @@
717
717
  script.defer = true;
718
718
  script.setAttribute('data-domain', domain);
719
719
  script.onload = function () {
720
- console.log('[Miam] Analytics ready for domain:', domain);
720
+ console.log("[Miam] Analytics ready for domain: " + JSON.stringify(domain));
721
721
  _this.ready$.next(true);
722
722
  };
723
723
  document.head.appendChild(script);
@@ -725,12 +725,12 @@
725
725
  AnalyticsService.prototype._injectOptimize = function (key) {
726
726
  if (!key || key.length < 0) {
727
727
  // tslint:disable-next-line: no-console
728
- console.info('[Miam] Google Optimize not initialized (no key)', key);
728
+ console.info("[Miam] Google Optimize not initialized (no key) " + JSON.stringify(key));
729
729
  return;
730
730
  }
731
731
  var script = document.createElement('script');
732
732
  script.src = "https://www.googleoptimize.com/optimize.js?id=" + key;
733
- script.onload = function () { return console.log('[Miam] Optimize ready for key:', key); };
733
+ script.onload = function () { return console.log("[Miam] Optimize ready for key: " + JSON.stringify(key)); };
734
734
  document.head.appendChild(script);
735
735
  };
736
736
  return AnalyticsService;
@@ -1791,20 +1791,9 @@
1791
1791
  var _this = _super.call(this) || this;
1792
1792
  _this.resource = RecipeProvider;
1793
1793
  _this.type = 'recipe-providers';
1794
- _this.providerList$ = new rxjs.BehaviorSubject(null);
1795
1794
  _this.register();
1796
- _this.all().pipe(operators.skipWhile(function (res) { return res.is_loading; }), operators.take(1)).subscribe(function (res) {
1797
- _this.providerList$.next(res.data);
1798
- });
1799
1795
  return _this;
1800
1796
  }
1801
- Object.defineProperty(RecipeProviderService.prototype, "providerList", {
1802
- get: function () {
1803
- return this.providerList$.asObservable().pipe(operators.skipWhile(function (res) { return res == null; }));
1804
- },
1805
- enumerable: false,
1806
- configurable: true
1807
- });
1808
1797
  RecipeProviderService.prototype.init = function (id) {
1809
1798
  this.register();
1810
1799
  return this.loadCachedProvider(id).toPromise();
@@ -1920,7 +1909,6 @@
1920
1909
  _this.deleted$ = new rxjs.BehaviorSubject(null);
1921
1910
  _this.inactive$ = new rxjs.BehaviorSubject(null);
1922
1911
  _this.register();
1923
- _this.fetchStatuses();
1924
1912
  return _this;
1925
1913
  }
1926
1914
  RecipeStatusService.prototype.fetchStatuses = function () {
@@ -2030,13 +2018,11 @@
2030
2018
  _this.type = 'recipe-types';
2031
2019
  _this.register();
2032
2020
  _this.types = new rxjs.BehaviorSubject(null);
2033
- _this.init();
2034
2021
  return _this;
2035
2022
  }
2036
- RecipeTypeService.prototype.init = function () {
2023
+ RecipeTypeService.prototype.fetchTypes = function () {
2037
2024
  var _this = this;
2038
- this.all()
2039
- .pipe(operators.tap(function (types) { return _this.types.next(types.data); })).toPromise();
2025
+ this.all().pipe(operators.tap(function (types) { return _this.types.next(types.data); })).toPromise();
2040
2026
  };
2041
2027
  RecipeTypeService.prototype.getTypes = function () {
2042
2028
  return this.types.asObservable();
@@ -3015,7 +3001,7 @@
3015
3001
  RecipeLikesService.prototype.doCleanUnobservedLikesIfNecessary = function () {
3016
3002
  var e_1, _a;
3017
3003
  var _this = this;
3018
- console.debug('[Miam] will check cleaning', this.activeRecipeLikes.size);
3004
+ console.debug("[Miam] will check cleaning " + JSON.stringify(this.activeRecipeLikes.size));
3019
3005
  if (this.activeRecipeLikes.size < this.MAX_RECIPE_LIKES_BEFORE_CLEAN) {
3020
3006
  this.isCleaning.next(false);
3021
3007
  return;
@@ -3495,7 +3481,7 @@
3495
3481
  BasketsService.prototype.confirmBasket = function (totalPrice) {
3496
3482
  var _this = this;
3497
3483
  var confirmedBasket;
3498
- console.log('[Miam] Confirm basket', confirmedBasket);
3484
+ console.log("[Miam] Confirm basket " + JSON.stringify(confirmedBasket));
3499
3485
  return this.basket$.pipe(operators.skipWhile(function (b) { return !b; }), operators.take(1), operators.tap(function (basket) {
3500
3486
  if (basket.totalPrice > 0) {
3501
3487
  _this.analyticsService.sendEventWhenReady(_this.analyticsService.EVENT_PAYMENT_CONFIRMED, null, _this.eventProps(basket, totalPrice));
@@ -3507,7 +3493,7 @@
3507
3493
  }), operators.switchMap(function (resp) {
3508
3494
  confirmedBasket = _this.new();
3509
3495
  confirmedBasket.fill(resp);
3510
- console.log('[Miam] send push analytics event if > 0:', confirmedBasket.totalPrice, confirmedBasket);
3496
+ console.log("[Miam] send push analytics event if > 0: " + JSON.stringify(confirmedBasket.totalPrice) + " " + JSON.stringify(confirmedBasket));
3511
3497
  if (confirmedBasket.totalPrice > 0 && confirmedBasket.token) {
3512
3498
  _this.analyticsService.sendEventWhenReady(_this.analyticsService.EVENT_BASKET_CONFIRMED, null, _this.eventProps(confirmedBasket, totalPrice));
3513
3499
  }
@@ -3572,11 +3558,11 @@
3572
3558
  BasketsService.prototype.updatePricebook = function (pricebookName) {
3573
3559
  var _this = this;
3574
3560
  return this.basket$.pipe(operators.skipWhile(function (b) { return !b; }), operators.take(1), operators.switchMap(function (basket) {
3575
- if (basket.pricebookKey == pricebookName) {
3576
- console.log('[Miam] same pricebook', pricebookName);
3561
+ if (basket.pricebookKey === pricebookName) {
3562
+ console.log("[Miam] same pricebook " + JSON.stringify(pricebookName));
3577
3563
  return rxjs.of(basket);
3578
3564
  }
3579
- console.log('[Miam] update pricebook to', pricebookName);
3565
+ console.log("[Miam] update pricebook to " + JSON.stringify(pricebookName));
3580
3566
  basket.pricebookKey = pricebookName;
3581
3567
  return basket.save().pipe(operators.map(function (resp) {
3582
3568
  var updatedBasket = _this.new();
@@ -3611,7 +3597,7 @@
3611
3597
  return _this.fetchBasketEntriesPage(basket, i + 1);
3612
3598
  })).pipe(operators.map(function (collections) {
3613
3599
  var entries = lodashEs.flatten(collections.map(function (col) { return col.data; }));
3614
- entries.forEach(function (e) { return e.setItemsSelection(); });
3600
+ entries.forEach(function (entry) { return entry.setItemsSelection(); });
3615
3601
  _this._entries$.next(entries);
3616
3602
  return _this._entries$.value;
3617
3603
  }));
@@ -3860,7 +3846,7 @@
3860
3846
  * Then check for items to push to/remove from retailer's basket and return them
3861
3847
  */
3862
3848
  BasketsComparatorService.prototype.updateReceivedFromMiam = function (miamBasket) {
3863
- console.debug('[Miam] update received from Miam', miamBasket);
3849
+ console.debug("[Miam] update received from Miam\n " + JSON.stringify(miamBasket === null || miamBasket === void 0 ? void 0 : miamBasket.map(function (e) { return ({ id: e.id, quantity: e.attributes.quantity }); })) + "\n " + JSON.stringify(this.extIdToItemsComparator));
3864
3850
  this.updateEntriesFromMiam(miamBasket);
3865
3851
  this.addEntriesFromMiam(miamBasket);
3866
3852
  var toPushToRetailer = this.resolveFromMiam(miamBasket);
@@ -3908,7 +3894,7 @@
3908
3894
  */
3909
3895
  BasketsComparatorService.prototype.resolveFromMiam = function (miamBasket) {
3910
3896
  var _this = this;
3911
- console.debug('[Miam] resolve from Miam basket', miamBasket);
3897
+ console.debug("[Miam] resolve from Miam basket\n " + JSON.stringify(miamBasket === null || miamBasket === void 0 ? void 0 : miamBasket.map(function (e) { return ({ id: e.id, quantity: e.attributes.quantity }); })) + "\n " + JSON.stringify(this.extIdToItemsComparator));
3912
3898
  var toPushToRetailer = [];
3913
3899
  Object.keys(this.extIdToItemsComparator).forEach(function (extId) {
3914
3900
  var itemsComparator = _this.extIdToItemsComparator[extId];
@@ -4011,12 +3997,11 @@
4011
3997
  function BasketsSynchronizerService(comparatorService, basketsService) {
4012
3998
  this.comparatorService = comparatorService;
4013
3999
  this.basketsService = basketsService;
4014
- this.comparatorServiceIsInitialized = false;
4015
4000
  /**
4016
4001
  * This method needs to be passed to Miam by the retailer
4017
4002
  */
4018
4003
  this.pushProductsToBasket = function (comparableProducts) {
4019
- throw new Error('No method was passed to \'window.miam.basket.definePushProductsToBasket\'');
4004
+ throw new Error("No method was passed to 'window.miam.basket.definePushProductsToBasket'");
4020
4005
  };
4021
4006
  // Begin listening for miam's basket (will not fetch basket automatically)
4022
4007
  this.listenToMiam();
@@ -4028,7 +4013,8 @@
4028
4013
  var _this = this;
4029
4014
  var isFirstSubscribe = true;
4030
4015
  this.basketsService.activeBasketEntries().subscribe(function (miamBasket) {
4031
- console.debug('[Miam] Miam basket received', miamBasket, _this.firstMiamBasket);
4016
+ var _a;
4017
+ console.debug("[Miam] Miam basket received\n " + JSON.stringify(miamBasket === null || miamBasket === void 0 ? void 0 : miamBasket.map(function (e) { return ({ id: e.id, quantity: e.attributes.quantity }); })) + "\n " + JSON.stringify((_a = _this.firstMiamBasket) === null || _a === void 0 ? void 0 : _a.map(function (e) { return ({ id: e.id, quantity: e.attributes.quantity }); })));
4032
4018
  if (!_this.firstMiamBasket && miamBasket.length === 0 && isFirstSubscribe) {
4033
4019
  // Skip first empty arrays received
4034
4020
  isFirstSubscribe = false;
@@ -4048,7 +4034,7 @@
4048
4034
  return this.initFirstMiamBasket(miamBasket);
4049
4035
  }
4050
4036
  if (this.isProcessingRetailerEvent) {
4051
- console.debug('[Miam] skipping basket-sync - retailer is processing');
4037
+ console.debug("[Miam] skipping basket-sync - retailer is processing");
4052
4038
  return;
4053
4039
  }
4054
4040
  var itemsToPush = this.comparatorService.updateReceivedFromMiam(miamBasket);
@@ -4072,16 +4058,14 @@
4072
4058
  * Initialize the basket sync if both baskets have been received, by initializing the comparator
4073
4059
  */
4074
4060
  BasketsSynchronizerService.prototype.initIfPossible = function () {
4075
- var _a, _b;
4076
- console.debug("[Miam] Trying to start basket sync - Miam: " + ((_a = this.firstMiamBasket) === null || _a === void 0 ? void 0 : _a.map(function (e) { return '{id: ' + e.id + ', qtty:' + e.attributes.quantity + '}, '; })) + " - Retailer: " + ((_b = this.firstRetailerBasket) === null || _b === void 0 ? void 0 : _b.map(function (p) { return '{id: ' + p.id + ', qtty:' + p.quantity + '}, '; })));
4061
+ var _a;
4062
+ console.debug("[Miam] Trying to start basket sync\n - Miam: " + JSON.stringify((_a = this.firstMiamBasket) === null || _a === void 0 ? void 0 : _a.map(function (e) { return ({ id: e.id, quantity: e.attributes.quantity }); })) + "\n - Retailer: " + JSON.stringify(this.firstRetailerBasket));
4077
4063
  if (!this.isReady()) {
4078
4064
  return;
4079
4065
  }
4080
- if (!this.comparatorServiceIsInitialized) {
4081
- this.isProcessingRetailerEvent = true;
4082
- var toRemoveFromMiam = this.comparatorService.initBasketComparator(this.firstMiamBasket, this.firstRetailerBasket);
4083
- this.sendUpdateToMiam(toRemoveFromMiam);
4084
- }
4066
+ this.isProcessingRetailerEvent = true;
4067
+ var toRemoveFromMiam = this.comparatorService.initBasketComparator(this.firstMiamBasket, this.firstRetailerBasket);
4068
+ this.sendUpdateToMiam(toRemoveFromMiam);
4085
4069
  };
4086
4070
  /**
4087
4071
  * @returns true is first baskets have been received for Miam & retailer
@@ -4093,7 +4077,7 @@
4093
4077
  * Calls pushProductsToBasket if there are changes that need to be notified to the retailer
4094
4078
  */
4095
4079
  BasketsSynchronizerService.prototype.sendUpdateToRetailer = function (itemsToAdd) {
4096
- console.debug('[Miam] will update retailer', itemsToAdd);
4080
+ console.debug("[Miam] will update retailer " + JSON.stringify(itemsToAdd));
4097
4081
  if (itemsToAdd.length === 0) {
4098
4082
  return;
4099
4083
  }
@@ -4131,14 +4115,14 @@
4131
4115
  */
4132
4116
  BasketsSynchronizerService.prototype.sendUpdateToMiam = function (entriesToRemove) {
4133
4117
  var _this = this;
4134
- console.debug('[Miam] will remove from miam', entriesToRemove);
4118
+ console.debug("[Miam] will remove from miam " + JSON.stringify(entriesToRemove));
4135
4119
  if (entriesToRemove.length === 0) {
4136
- console.debug('[Miam] stop processing retailer event');
4120
+ console.debug("[Miam] stop processing retailer event");
4137
4121
  this.isProcessingRetailerEvent = false;
4138
4122
  return;
4139
4123
  }
4140
4124
  this.basketsService.removeBasketEntries(entriesToRemove).subscribe(function () {
4141
- console.debug('[Miam] stop processing retailer event');
4125
+ console.debug("[Miam] stop processing retailer event");
4142
4126
  _this.isProcessingRetailerEvent = false;
4143
4127
  });
4144
4128
  };
@@ -4150,7 +4134,7 @@
4150
4134
  * @param retailerBasket current basket of the retailer
4151
4135
  */
4152
4136
  BasketsSynchronizerService.prototype.retailerBasketChanged = function (retailerBasket) {
4153
- console.debug('[Miam] Update received from retailer', retailerBasket, this.firstRetailerBasket);
4137
+ console.debug("[Miam] Update received from retailer " + JSON.stringify(retailerBasket) + " " + JSON.stringify(this.firstRetailerBasket));
4154
4138
  if (!this.isReady()) {
4155
4139
  return this.initFirstRetailerBasket(retailerBasket);
4156
4140
  }
@@ -4169,7 +4153,6 @@
4169
4153
  if (total) {
4170
4154
  this.basketsService.confirmBasket(total).subscribe(function () {
4171
4155
  _this.firstRetailerBasket = [];
4172
- _this.comparatorServiceIsInitialized = false;
4173
4156
  });
4174
4157
  }
4175
4158
  };
@@ -4196,19 +4179,20 @@
4196
4179
  var SMALL_SCREEN_BP = '(min-width: 1023px)';
4197
4180
  // Context shared between Miam SDK & host app
4198
4181
  var ContextService = /** @class */ (function () {
4199
- function ContextService(posService, listsService, basketsService, userService, recipesProvidersService, analyticsService, recipesService, mediaMatcher, suppliersService, breakpointObserver, basketHandler) {
4182
+ function ContextService(posService, listsService, basketsService, userService, analyticsService, recipesService, mediaMatcher, suppliersService, breakpointObserver, basketHandler, statusService, typeService) {
4200
4183
  var _this = this;
4201
4184
  this.posService = posService;
4202
4185
  this.listsService = listsService;
4203
4186
  this.basketsService = basketsService;
4204
4187
  this.userService = userService;
4205
- this.recipesProvidersService = recipesProvidersService;
4206
4188
  this.analyticsService = analyticsService;
4207
4189
  this.recipesService = recipesService;
4208
4190
  this.mediaMatcher = mediaMatcher;
4209
4191
  this.suppliersService = suppliersService;
4210
4192
  this.breakpointObserver = breakpointObserver;
4211
4193
  this.basketHandler = basketHandler;
4194
+ this.statusService = statusService;
4195
+ this.typeService = typeService;
4212
4196
  this.videoRecipesEnabled = false;
4213
4197
  this.articlesInCatalogEnabled = false;
4214
4198
  this.tagsOnRecipesEnabled = false;
@@ -4216,8 +4200,10 @@
4216
4200
  this.defaultIngredientPicture = 'https://storage.googleapis.com/assets.miam.tech/generic/images/default-ingredient-picture.svg';
4217
4201
  this.globalScrollableElement = document.body;
4218
4202
  this.isSmallScreen$ = new rxjs.BehaviorSubject(false);
4203
+ this.origin = '';
4219
4204
  this.catalogUrl = '';
4220
4205
  this.recipeInfoUrl = '';
4206
+ this.startupDataWasFetched = false;
4221
4207
  this.enablePersonalRecipes$ = new rxjs.BehaviorSubject(true);
4222
4208
  this.miam = {
4223
4209
  paymentStarted: function (totalPrice) {
@@ -4231,7 +4217,14 @@
4231
4217
  },
4232
4218
  basket: {
4233
4219
  basketIsReady$: this.basketsService.basketStats$.pipe(operators.skipWhile(function (stats) { return !stats; }), operators.take(1), operators.map(function () { return true; })),
4234
- initialize: function () { return _this.basketsService.initBasket(); },
4220
+ initialize: function () {
4221
+ if (_this.origin) {
4222
+ _this.basketsService.initBasket();
4223
+ }
4224
+ else {
4225
+ throw new Error('Cannot start Miam: origin hasn\'t been set');
4226
+ }
4227
+ },
4235
4228
  updatePricebook: function (pricebookName) { return _this.basketsService.updatePricebook(pricebookName); },
4236
4229
  },
4237
4230
  basketSync: {
@@ -4282,11 +4275,18 @@
4282
4275
  return _this.listsService.appendRecipeToList(recipeId, guests, { originPath: 'client', props: { recipe_id: recipeId } });
4283
4276
  },
4284
4277
  hasRecipe: function (recipeId) { return _this.listsService.recipeIsInList(recipeId); },
4285
- recipeCount: this.listsService.list$.pipe(operators.skipWhile(function (l) { return !l; }), operators.map(function (l) { return l.attributes['recipes-ids'].length; }))
4278
+ recipeCount: function () {
4279
+ return _this.listsService.list$.pipe(operators.skipWhile(function (l) { return !l; }), operators.map(function (l) { return l.attributes['recipes-ids'].length; }));
4280
+ }
4286
4281
  },
4287
4282
  pos: {
4288
4283
  load: function (externalId) {
4289
- _this.posService.loadPosWithExtId(externalId);
4284
+ if (_this.origin) {
4285
+ _this.posService.loadPosWithExtId(externalId);
4286
+ }
4287
+ else {
4288
+ throw new Error('Cannot start Miam: origin hasn\'t been set');
4289
+ }
4290
4290
  }
4291
4291
  },
4292
4292
  recipes: {
@@ -4322,12 +4322,25 @@
4322
4322
  },
4323
4323
  },
4324
4324
  supplier: {
4325
+ setOrigin: function (origin) {
4326
+ if (origin.length > 0) {
4327
+ _this.origin = origin;
4328
+ if (!_this.startupDataWasFetched) {
4329
+ _this.fetchStartupData();
4330
+ }
4331
+ }
4332
+ },
4325
4333
  load: function (supplierId) {
4326
- _this.suppliersService.loadSupplier(supplierId.toString());
4334
+ if (_this.origin) {
4335
+ _this.suppliersService.loadSupplier(supplierId.toString()).subscribe();
4336
+ }
4337
+ else {
4338
+ throw new Error('Cannot start Miam: origin hasn\'t been set');
4339
+ }
4327
4340
  }
4328
4341
  },
4329
4342
  user: {
4330
- loadWithExtId: function (id, forbidProfiling, initBasket) {
4343
+ loadWithExternalId: function (id, forbidProfiling, initBasket) {
4331
4344
  if (forbidProfiling === void 0) { forbidProfiling = false; }
4332
4345
  if (initBasket === void 0) { initBasket = false; }
4333
4346
  localStorage.setItem('_miam/userId', id);
@@ -4416,9 +4429,14 @@
4416
4429
  }
4417
4430
  return this.userService.setUserInfo(forbidProfiling);
4418
4431
  };
4432
+ ContextService.prototype.fetchStartupData = function () {
4433
+ this.statusService.fetchStatuses();
4434
+ this.typeService.fetchTypes();
4435
+ this.startupDataWasFetched = true;
4436
+ };
4419
4437
  return ContextService;
4420
4438
  }());
4421
- ContextService.ɵfac = function ContextService_Factory(t) { return new (t || ContextService)(i0.ɵɵinject(PointOfSalesService), i0.ɵɵinject(GroceriesListsService), i0.ɵɵinject(BasketsService), i0.ɵɵinject(UserService), i0.ɵɵinject(RecipeProviderService), i0.ɵɵinject(AnalyticsService), i0.ɵɵinject(RecipesService), i0.ɵɵinject(i1$2.MediaMatcher), i0.ɵɵinject(SuppliersService), i0.ɵɵinject(i1$2.BreakpointObserver), i0.ɵɵinject(BasketsSynchronizerService)); };
4439
+ ContextService.ɵfac = function ContextService_Factory(t) { return new (t || ContextService)(i0.ɵɵinject(PointOfSalesService), i0.ɵɵinject(GroceriesListsService), i0.ɵɵinject(BasketsService), i0.ɵɵinject(UserService), i0.ɵɵinject(AnalyticsService), i0.ɵɵinject(RecipesService), i0.ɵɵinject(i1$2.MediaMatcher), i0.ɵɵinject(SuppliersService), i0.ɵɵinject(i1$2.BreakpointObserver), i0.ɵɵinject(BasketsSynchronizerService), i0.ɵɵinject(RecipeStatusService), i0.ɵɵinject(RecipeTypeService)); };
4422
4440
  ContextService.ɵprov = i0.ɵɵdefineInjectable({ token: ContextService, factory: ContextService.ɵfac, providedIn: 'root' });
4423
4441
  /*@__PURE__*/ (function () {
4424
4442
  i0.ɵsetClassMetadata(ContextService, [{
@@ -4426,7 +4444,7 @@
4426
4444
  args: [{
4427
4445
  providedIn: 'root'
4428
4446
  }]
4429
- }], function () { return [{ type: PointOfSalesService }, { type: GroceriesListsService }, { type: BasketsService }, { type: UserService }, { type: RecipeProviderService }, { type: AnalyticsService }, { type: RecipesService }, { type: i1$2.MediaMatcher }, { type: SuppliersService }, { type: i1$2.BreakpointObserver }, { type: BasketsSynchronizerService }]; }, null);
4447
+ }], function () { return [{ type: PointOfSalesService }, { type: GroceriesListsService }, { type: BasketsService }, { type: UserService }, { type: AnalyticsService }, { type: RecipesService }, { type: i1$2.MediaMatcher }, { type: SuppliersService }, { type: i1$2.BreakpointObserver }, { type: BasketsSynchronizerService }, { type: RecipeStatusService }, { type: RecipeTypeService }]; }, null);
4430
4448
  })();
4431
4449
 
4432
4450
  var _c0 = function (a0, a1) { return { "width": a0, "height": a1 }; };
@@ -6386,6 +6404,55 @@
6386
6404
  }], function () { return []; }, null);
6387
6405
  })();
6388
6406
 
6407
+ var ArticlesService = /** @class */ (function (_super) {
6408
+ __extends(ArticlesService, _super);
6409
+ function ArticlesService() {
6410
+ var _this = _super.call(this) || this;
6411
+ _this.resource = Article;
6412
+ _this.type = 'articles';
6413
+ _this.register();
6414
+ return _this;
6415
+ }
6416
+ return ArticlesService;
6417
+ }(i1.Service));
6418
+ ArticlesService.ɵfac = function ArticlesService_Factory(t) { return new (t || ArticlesService)(); };
6419
+ ArticlesService.ɵprov = i0.ɵɵdefineInjectable({ token: ArticlesService, factory: ArticlesService.ɵfac, providedIn: 'root' });
6420
+ /*@__PURE__*/ (function () {
6421
+ i0.ɵsetClassMetadata(ArticlesService, [{
6422
+ type: i0.Injectable,
6423
+ args: [{
6424
+ providedIn: 'root'
6425
+ }]
6426
+ }], function () { return []; }, null);
6427
+ })();
6428
+
6429
+ var CatalogSettingsService = /** @class */ (function (_super) {
6430
+ __extends(CatalogSettingsService, _super);
6431
+ function CatalogSettingsService(http) {
6432
+ var _this = _super.call(this) || this;
6433
+ _this.http = http;
6434
+ _this.resource = CatalogSetting;
6435
+ _this.type = 'catalog-settings';
6436
+ _this.url = environment.miamAPI + "/api/v1";
6437
+ _this.register();
6438
+ return _this;
6439
+ }
6440
+ CatalogSettingsService.prototype.getSupplierCatalogSettings = function (supplier) {
6441
+ return this.http.get(this.url + "/suppliers/" + supplier.id + "/catalog-settings").pipe(operators.map(function (res) { return res.data[0]; }));
6442
+ };
6443
+ return CatalogSettingsService;
6444
+ }(i1.Service));
6445
+ CatalogSettingsService.ɵfac = function CatalogSettingsService_Factory(t) { return new (t || CatalogSettingsService)(i0.ɵɵinject(i1$1.HttpClient)); };
6446
+ CatalogSettingsService.ɵprov = i0.ɵɵdefineInjectable({ token: CatalogSettingsService, factory: CatalogSettingsService.ɵfac, providedIn: 'root' });
6447
+ /*@__PURE__*/ (function () {
6448
+ i0.ɵsetClassMetadata(CatalogSettingsService, [{
6449
+ type: i0.Injectable,
6450
+ args: [{
6451
+ providedIn: 'root'
6452
+ }]
6453
+ }], function () { return [{ type: i1$1.HttpClient }]; }, null);
6454
+ })();
6455
+
6389
6456
  // THIS IS JUST AN EXAMPLE - UNUSED IN THE CODE
6390
6457
  var CounterService = /** @class */ (function () {
6391
6458
  function CounterService(app) {
@@ -6494,55 +6561,6 @@
6494
6561
  }], function () { return [{ type: i1$1.HttpClient }]; }, null);
6495
6562
  })();
6496
6563
 
6497
- var ArticlesService = /** @class */ (function (_super) {
6498
- __extends(ArticlesService, _super);
6499
- function ArticlesService() {
6500
- var _this = _super.call(this) || this;
6501
- _this.resource = Article;
6502
- _this.type = 'articles';
6503
- _this.register();
6504
- return _this;
6505
- }
6506
- return ArticlesService;
6507
- }(i1.Service));
6508
- ArticlesService.ɵfac = function ArticlesService_Factory(t) { return new (t || ArticlesService)(); };
6509
- ArticlesService.ɵprov = i0.ɵɵdefineInjectable({ token: ArticlesService, factory: ArticlesService.ɵfac, providedIn: 'root' });
6510
- /*@__PURE__*/ (function () {
6511
- i0.ɵsetClassMetadata(ArticlesService, [{
6512
- type: i0.Injectable,
6513
- args: [{
6514
- providedIn: 'root'
6515
- }]
6516
- }], function () { return []; }, null);
6517
- })();
6518
-
6519
- var CatalogSettingsService = /** @class */ (function (_super) {
6520
- __extends(CatalogSettingsService, _super);
6521
- function CatalogSettingsService(http) {
6522
- var _this = _super.call(this) || this;
6523
- _this.http = http;
6524
- _this.resource = CatalogSetting;
6525
- _this.type = 'catalog-settings';
6526
- _this.url = environment.miamAPI + "/api/v1";
6527
- _this.register();
6528
- return _this;
6529
- }
6530
- CatalogSettingsService.prototype.getSupplierCatalogSettings = function (supplier) {
6531
- return this.http.get(this.url + "/suppliers/" + supplier.id + "/catalog-settings").pipe(operators.map(function (res) { return res.data[0]; }));
6532
- };
6533
- return CatalogSettingsService;
6534
- }(i1.Service));
6535
- CatalogSettingsService.ɵfac = function CatalogSettingsService_Factory(t) { return new (t || CatalogSettingsService)(i0.ɵɵinject(i1$1.HttpClient)); };
6536
- CatalogSettingsService.ɵprov = i0.ɵɵdefineInjectable({ token: CatalogSettingsService, factory: CatalogSettingsService.ɵfac, providedIn: 'root' });
6537
- /*@__PURE__*/ (function () {
6538
- i0.ɵsetClassMetadata(CatalogSettingsService, [{
6539
- type: i0.Injectable,
6540
- args: [{
6541
- providedIn: 'root'
6542
- }]
6543
- }], function () { return [{ type: i1$1.HttpClient }]; }, null);
6544
- })();
6545
-
6546
6564
  var AutowidthInputDirective = /** @class */ (function () {
6547
6565
  function AutowidthInputDirective(el) {
6548
6566
  this.el = el;
@@ -14701,66 +14719,66 @@
14701
14719
  function RecipeFormComponent_form_0_ng_template_3_Template(rf, ctx) {
14702
14720
  if (rf & 1) {
14703
14721
  i0.ɵɵelementStart(0, "span");
14704
- i0.ɵɵi18n(1, 27);
14722
+ i0.ɵɵi18n(1, 26);
14705
14723
  i0.ɵɵelementEnd();
14706
14724
  }
14707
14725
  }
14708
14726
  function RecipeFormComponent_form_0_ng_template_8_Template(rf, ctx) {
14709
14727
  if (rf & 1) {
14710
14728
  i0.ɵɵelementStart(0, "span");
14711
- i0.ɵɵi18n(1, 28);
14729
+ i0.ɵɵi18n(1, 27);
14712
14730
  i0.ɵɵelementEnd();
14713
14731
  }
14714
14732
  }
14715
14733
  function RecipeFormComponent_form_0_ng_template_17_Template(rf, ctx) {
14716
14734
  if (rf & 1) {
14717
14735
  i0.ɵɵelementStart(0, "span");
14718
- i0.ɵɵi18n(1, 29);
14736
+ i0.ɵɵi18n(1, 28);
14719
14737
  i0.ɵɵelementEnd();
14720
14738
  }
14721
14739
  }
14722
14740
  function RecipeFormComponent_form_0_div_22_ng_template_2_Template(rf, ctx) {
14723
14741
  if (rf & 1) {
14724
14742
  i0.ɵɵelementStart(0, "span");
14725
- i0.ɵɵi18n(1, 33);
14743
+ i0.ɵɵi18n(1, 32);
14726
14744
  i0.ɵɵelementEnd();
14727
14745
  }
14728
14746
  }
14729
14747
  function RecipeFormComponent_form_0_div_22_ng_template_5_Template(rf, ctx) {
14730
14748
  if (rf & 1) {
14731
14749
  i0.ɵɵelementStart(0, "span");
14732
- i0.ɵɵi18n(1, 34);
14750
+ i0.ɵɵi18n(1, 33);
14733
14751
  i0.ɵɵelementEnd();
14734
14752
  }
14735
14753
  }
14736
14754
  function RecipeFormComponent_form_0_div_22_ng_template_8_Template(rf, ctx) {
14737
14755
  if (rf & 1) {
14738
14756
  i0.ɵɵelementStart(0, "span");
14739
- i0.ɵɵi18n(1, 35);
14757
+ i0.ɵɵi18n(1, 34);
14740
14758
  i0.ɵɵelementEnd();
14741
14759
  }
14742
14760
  }
14743
14761
  function RecipeFormComponent_form_0_div_22_ng_template_11_Template(rf, ctx) {
14744
14762
  if (rf & 1) {
14745
14763
  i0.ɵɵelementStart(0, "span");
14746
- i0.ɵɵi18n(1, 36);
14764
+ i0.ɵɵi18n(1, 35);
14747
14765
  i0.ɵɵelementEnd();
14748
14766
  }
14749
14767
  }
14750
14768
  function RecipeFormComponent_form_0_div_22_Template(rf, ctx) {
14751
14769
  if (rf & 1) {
14752
- i0.ɵɵelementStart(0, "div", 30);
14753
- i0.ɵɵelementStart(1, "ng-miam-time-picker", 31);
14754
- i0.ɵɵtemplate(2, RecipeFormComponent_form_0_div_22_ng_template_2_Template, 2, 0, "ng-template", null, 32, i0.ɵɵtemplateRefExtractor);
14770
+ i0.ɵɵelementStart(0, "div", 29);
14771
+ i0.ɵɵelementStart(1, "ng-miam-time-picker", 30);
14772
+ i0.ɵɵtemplate(2, RecipeFormComponent_form_0_div_22_ng_template_2_Template, 2, 0, "ng-template", null, 31, i0.ɵɵtemplateRefExtractor);
14755
14773
  i0.ɵɵelementEnd();
14756
- i0.ɵɵelementStart(4, "ng-miam-time-picker", 31);
14757
- i0.ɵɵtemplate(5, RecipeFormComponent_form_0_div_22_ng_template_5_Template, 2, 0, "ng-template", null, 32, i0.ɵɵtemplateRefExtractor);
14774
+ i0.ɵɵelementStart(4, "ng-miam-time-picker", 30);
14775
+ i0.ɵɵtemplate(5, RecipeFormComponent_form_0_div_22_ng_template_5_Template, 2, 0, "ng-template", null, 31, i0.ɵɵtemplateRefExtractor);
14758
14776
  i0.ɵɵelementEnd();
14759
- i0.ɵɵelementStart(7, "ng-miam-time-picker", 31);
14760
- i0.ɵɵtemplate(8, RecipeFormComponent_form_0_div_22_ng_template_8_Template, 2, 0, "ng-template", null, 32, i0.ɵɵtemplateRefExtractor);
14777
+ i0.ɵɵelementStart(7, "ng-miam-time-picker", 30);
14778
+ i0.ɵɵtemplate(8, RecipeFormComponent_form_0_div_22_ng_template_8_Template, 2, 0, "ng-template", null, 31, i0.ɵɵtemplateRefExtractor);
14761
14779
  i0.ɵɵelementEnd();
14762
- i0.ɵɵelementStart(10, "ng-miam-time-picker", 31);
14763
- i0.ɵɵtemplate(11, RecipeFormComponent_form_0_div_22_ng_template_11_Template, 2, 0, "ng-template", null, 32, i0.ɵɵtemplateRefExtractor);
14780
+ i0.ɵɵelementStart(10, "ng-miam-time-picker", 30);
14781
+ i0.ɵɵtemplate(11, RecipeFormComponent_form_0_div_22_ng_template_11_Template, 2, 0, "ng-template", null, 31, i0.ɵɵtemplateRefExtractor);
14764
14782
  i0.ɵɵelementEnd();
14765
14783
  i0.ɵɵelementEnd();
14766
14784
  }
@@ -14780,49 +14798,10 @@
14780
14798
  i0.ɵɵproperty("formControl", ctx_r7.recipeForm == null ? null : (tmp_6_0 = ctx_r7.recipeForm.get("attributes")) == null ? null : tmp_6_0.get("resting-time"))("icon", ctx_r7.icon.Preheat);
14781
14799
  }
14782
14800
  }
14783
- function RecipeFormComponent_form_0_div_28_ng_template_3_Template(rf, ctx) {
14784
- if (rf & 1) {
14785
- i0.ɵɵelementStart(0, "span");
14786
- i0.ɵɵi18n(1, 38);
14787
- i0.ɵɵelementEnd();
14788
- }
14789
- }
14790
- function RecipeFormComponent_form_0_div_28_ng_template_7_Template(rf, ctx) {
14791
- if (rf & 1) {
14792
- i0.ɵɵelementStart(0, "span");
14793
- i0.ɵɵi18n(1, 39);
14794
- i0.ɵɵelementEnd();
14795
- }
14796
- }
14797
- function RecipeFormComponent_form_0_div_28_Template(rf, ctx) {
14798
- if (rf & 1) {
14799
- i0.ɵɵelementStart(0, "div", 11);
14800
- i0.ɵɵelementStart(1, "ng-miam-select-input", 19);
14801
- i0.ɵɵpipe(2, "async");
14802
- i0.ɵɵtemplate(3, RecipeFormComponent_form_0_div_28_ng_template_3_Template, 2, 0, "ng-template", null, 9, i0.ɵɵtemplateRefExtractor);
14803
- i0.ɵɵelementEnd();
14804
- i0.ɵɵelementStart(5, "ng-miam-select-input", 19);
14805
- i0.ɵɵpipe(6, "async");
14806
- i0.ɵɵtemplate(7, RecipeFormComponent_form_0_div_28_ng_template_7_Template, 2, 0, "ng-template", null, 9, i0.ɵɵtemplateRefExtractor);
14807
- i0.ɵɵelementEnd();
14808
- i0.ɵɵelement(9, "textarea", 37);
14809
- i0.ɵɵelementEnd();
14810
- }
14811
- if (rf & 2) {
14812
- var ctx_r8 = i0.ɵɵnextContext(2);
14813
- var tmp_4_0 = null;
14814
- i0.ɵɵadvance(1);
14815
- i0.ɵɵproperty("options", i0.ɵɵpipeBind1(2, 5, ctx_r8.statuses))("formControl", ctx_r8.recipeForm == null ? null : ctx_r8.recipeForm.get("recipe-status"));
14816
- i0.ɵɵadvance(4);
14817
- i0.ɵɵproperty("options", i0.ɵɵpipeBind1(6, 7, ctx_r8.recipeProviderservice == null ? null : ctx_r8.recipeProviderservice.providerList))("formControl", ctx_r8.recipeForm == null ? null : ctx_r8.recipeForm.get("recipe-provider"));
14818
- i0.ɵɵadvance(4);
14819
- i0.ɵɵproperty("formControl", ctx_r8.recipeForm == null ? null : (tmp_4_0 = ctx_r8.recipeForm.get("attributes")) == null ? null : tmp_4_0.get("description"));
14820
- }
14821
- }
14822
- var _c24 = function () { return ["number-of-guests"]; };
14801
+ var _c20 = function () { return ["number-of-guests"]; };
14823
14802
  function RecipeFormComponent_form_0_Template(rf, ctx) {
14824
14803
  if (rf & 1) {
14825
- var _r22_1 = i0.ɵɵgetCurrentView();
14804
+ var _r17_1 = i0.ɵɵgetCurrentView();
14826
14805
  i0.ɵɵelementStart(0, "form", 6);
14827
14806
  i0.ɵɵelementContainerStart(1, 7);
14828
14807
  i0.ɵɵelementStart(2, "ng-miam-text-input", 8);
@@ -14857,15 +14836,14 @@
14857
14836
  i0.ɵɵelementStart(23, "div", 10);
14858
14837
  i0.ɵɵelementStart(24, "div", 11);
14859
14838
  i0.ɵɵelementStart(25, "ng-miam-list-input", 24);
14860
- i0.ɵɵlistener("deleteId", function RecipeFormComponent_form_0_Template_ng_miam_list_input_deleteId_25_listener($event) { i0.ɵɵrestoreView(_r22_1); var ctx_r21 = i0.ɵɵnextContext(); return ctx_r21.addToDeleteIngredientsList($event); });
14839
+ i0.ɵɵlistener("deleteId", function RecipeFormComponent_form_0_Template_ng_miam_list_input_deleteId_25_listener($event) { i0.ɵɵrestoreView(_r17_1); var ctx_r16 = i0.ɵɵnextContext(); return ctx_r16.addToDeleteIngredientsList($event); });
14861
14840
  i0.ɵɵelementEnd();
14862
14841
  i0.ɵɵelementEnd();
14863
14842
  i0.ɵɵelementStart(26, "div", 11);
14864
14843
  i0.ɵɵelementStart(27, "ng-miam-list-input", 25);
14865
- i0.ɵɵlistener("deleteId", function RecipeFormComponent_form_0_Template_ng_miam_list_input_deleteId_27_listener($event) { i0.ɵɵrestoreView(_r22_1); var ctx_r23 = i0.ɵɵnextContext(); return ctx_r23.addToDeleteStepsList($event); });
14844
+ i0.ɵɵlistener("deleteId", function RecipeFormComponent_form_0_Template_ng_miam_list_input_deleteId_27_listener($event) { i0.ɵɵrestoreView(_r17_1); var ctx_r18 = i0.ɵɵnextContext(); return ctx_r18.addToDeleteStepsList($event); });
14866
14845
  i0.ɵɵelementEnd();
14867
14846
  i0.ɵɵelementEnd();
14868
- i0.ɵɵtemplate(28, RecipeFormComponent_form_0_div_28_Template, 10, 9, "div", 26);
14869
14847
  i0.ɵɵelementEnd();
14870
14848
  i0.ɵɵelementEnd();
14871
14849
  }
@@ -14884,9 +14862,9 @@
14884
14862
  i0.ɵɵadvance(5);
14885
14863
  i0.ɵɵproperty("formControl", ctx_r0.recipeForm == null ? null : (tmp_3_0 = ctx_r0.recipeForm.get("attributes")) == null ? null : tmp_3_0.get("media-url"))("imageUrl", ctx_r0.recipeForm == null ? null : (tmp_4_0 = ctx_r0.recipeForm.get("attributes")) == null ? null : (tmp_4_1 = tmp_4_0.get("media-url")) == null ? null : tmp_4_1.value)("photoMode", true);
14886
14864
  i0.ɵɵadvance(6);
14887
- i0.ɵɵproperty("formControl", ctx_r0.recipeForm.controls["attributes"]["controls"][i0.ɵɵpureFunction0(19, _c24)]);
14865
+ i0.ɵɵproperty("formControl", ctx_r0.recipeForm.controls["attributes"]["controls"][i0.ɵɵpureFunction0(18, _c20)]);
14888
14866
  i0.ɵɵadvance(2);
14889
- i0.ɵɵproperty("options", i0.ɵɵpipeBind1(16, 17, ctx_r0.recipeTypeService == null ? null : ctx_r0.recipeTypeService.getTypes()))("formControl", ctx_r0.recipeForm == null ? null : ctx_r0.recipeForm.get("recipe-type"));
14867
+ i0.ɵɵproperty("options", i0.ɵɵpipeBind1(16, 16, ctx_r0.recipeTypeService == null ? null : ctx_r0.recipeTypeService.getTypes()))("formControl", ctx_r0.recipeForm == null ? null : ctx_r0.recipeForm.get("recipe-type"));
14890
14868
  i0.ɵɵadvance(6);
14891
14869
  i0.ɵɵproperty("steps", ctx_r0.dificulties)("formControl", ctx_r0.recipeForm == null ? null : (tmp_10_0 = ctx_r0.recipeForm.get("attributes")) == null ? null : tmp_10_0.get("difficulty"))("icons", ctx_r0.iconsDificulties);
14892
14870
  i0.ɵɵadvance(1);
@@ -14895,8 +14873,6 @@
14895
14873
  i0.ɵɵproperty("ingredientMode", true)("list", ctx_r0.recipeForm.get("ingredients"));
14896
14874
  i0.ɵɵadvance(2);
14897
14875
  i0.ɵɵproperty("list", ctx_r0.recipeForm.get("steps"));
14898
- i0.ɵɵadvance(1);
14899
- i0.ɵɵproperty("ngIf", ctx_r0.isAdmin);
14900
14876
  }
14901
14877
  }
14902
14878
  var RecipeFormComponent = /** @class */ (function (_super) {
@@ -15311,26 +15287,10 @@
15311
15287
  else {
15312
15288
  i18n_18 = $localize(templateObject_10$2 || (templateObject_10$2 = __makeTemplateObject([":\u241Ff959874631711aa56d6caaaa49ad684b4ba32ed0\u241F4124824446230222423:Temps de pr\u00E9chauffage"], [":\u241Ff959874631711aa56d6caaaa49ad684b4ba32ed0\u241F4124824446230222423:Temps de pr\u00E9chauffage"])));
15313
15289
  }
15314
- var i18n_20;
15315
- if (typeof ngI18nClosureMode !== "undefined" && ngI18nClosureMode) {
15316
- var MSG_EXTERNAL_3633468616553674914$$LIB__WEB_COMPONENTS_RECIPE_FORM_RECIPE_FORM_COMPONENT_TS____21 = goog.getMsg("Choisir un status");
15317
- i18n_20 = MSG_EXTERNAL_3633468616553674914$$LIB__WEB_COMPONENTS_RECIPE_FORM_RECIPE_FORM_COMPONENT_TS____21;
15318
- }
15319
- else {
15320
- i18n_20 = $localize(templateObject_11$2 || (templateObject_11$2 = __makeTemplateObject([":\u241F5cf8d74ac75844b7c89f75913e92024b6ee03110\u241F3633468616553674914:Choisir un status"], [":\u241F5cf8d74ac75844b7c89f75913e92024b6ee03110\u241F3633468616553674914:Choisir un status"])));
15321
- }
15322
- var i18n_22;
15323
- if (typeof ngI18nClosureMode !== "undefined" && ngI18nClosureMode) {
15324
- var MSG_EXTERNAL_4470004706763223564$$LIB__WEB_COMPONENTS_RECIPE_FORM_RECIPE_FORM_COMPONENT_TS____23 = goog.getMsg("Choisir un provider");
15325
- i18n_22 = MSG_EXTERNAL_4470004706763223564$$LIB__WEB_COMPONENTS_RECIPE_FORM_RECIPE_FORM_COMPONENT_TS____23;
15326
- }
15327
- else {
15328
- i18n_22 = $localize(templateObject_12$2 || (templateObject_12$2 = __makeTemplateObject([":\u241F72de582ce6d494157ddf8c55a63328bde4682abf\u241F4470004706763223564:Choisir un provider"], [":\u241F72de582ce6d494157ddf8c55a63328bde4682abf\u241F4470004706763223564:Choisir un provider"])));
15329
- }
15330
- return [["class", "form-container", 3, "formGroup", 4, "ngIf"], [1, "button-row"], [1, "m-button-secondary", 3, "click"], i18n_0, [1, "m-button-primary", 3, "disabled", "click"], i18n_2, [1, "form-container", 3, "formGroup"], [3, "formGroup"], ["ngDefaultControl", "", 1, "m-title-text-input", 3, "formControl"], ["placeholder", ""], [1, "row-container"], [1, "input-container"], ["ngDefaultControl", "", 3, "formControl", "imageUrl", "photoMode"], ["buttonText", ""], [1, "recipe-form__guests", "m-default-card"], [1, "recipe-form__guests__label"], i18n_4, ["ngDefaultControl", "", "formControlName", "number-of-guests", "counter", "4", "minRange", "0", "maxRange", "999", 3, "formControl"], [1, "recipe-form__attibutes"], ["ngDefaultControl", "", "labelPath", "attributes.name", 3, "options", "formControl"], [1, "recipe-form__attibutes__sliders"], [1, "recipe-form__attibutes__slider"], ["ngDefaultControl", "", 3, "steps", "formControl", "icons"], ["class", "recipe-form__attibutes__times", 4, "ngIf"], ["ngDefaultControl", "", "formArrayName", "ingredients", 3, "ingredientMode", "list", "deleteId"], ["ngDefaultControl", "", "formArrayName", "steps", 3, "list", "deleteId"], ["class", "input-container", 4, "ngIf"], i18n_6, i18n_8, i18n_10, [1, "recipe-form__attibutes__times"], ["ngDefaultControl", "", 3, "formControl", "icon"], ["title", ""], i18n_12, i18n_14, i18n_16, i18n_18, ["cdkTextareaAutosize", "", "cdkAutosizeMinRows", "20", "cdkAutosizeMaxRows", "50", 1, "m-input", 3, "formControl"], i18n_20, i18n_22];
15290
+ return [["class", "form-container", 3, "formGroup", 4, "ngIf"], [1, "button-row"], [1, "m-button-secondary", 3, "click"], i18n_0, [1, "m-button-primary", 3, "disabled", "click"], i18n_2, [1, "form-container", 3, "formGroup"], [3, "formGroup"], ["ngDefaultControl", "", 1, "m-title-text-input", 3, "formControl"], ["placeholder", ""], [1, "row-container"], [1, "input-container"], ["ngDefaultControl", "", 3, "formControl", "imageUrl", "photoMode"], ["buttonText", ""], [1, "recipe-form__guests", "m-default-card"], [1, "recipe-form__guests__label"], i18n_4, ["ngDefaultControl", "", "formControlName", "number-of-guests", "counter", "4", "minRange", "0", "maxRange", "999", 3, "formControl"], [1, "recipe-form__attibutes"], ["ngDefaultControl", "", "labelPath", "attributes.name", 3, "options", "formControl"], [1, "recipe-form__attibutes__sliders"], [1, "recipe-form__attibutes__slider"], ["ngDefaultControl", "", 3, "steps", "formControl", "icons"], ["class", "recipe-form__attibutes__times", 4, "ngIf"], ["ngDefaultControl", "", "formArrayName", "ingredients", 3, "ingredientMode", "list", "deleteId"], ["ngDefaultControl", "", "formArrayName", "steps", 3, "list", "deleteId"], i18n_6, i18n_8, i18n_10, [1, "recipe-form__attibutes__times"], ["ngDefaultControl", "", 3, "formControl", "icon"], ["title", ""], i18n_12, i18n_14, i18n_16, i18n_18];
15331
15291
  }, template: function RecipeFormComponent_Template(rf, ctx) {
15332
15292
  if (rf & 1) {
15333
- i0.ɵɵtemplate(0, RecipeFormComponent_form_0_Template, 29, 20, "form", 0);
15293
+ i0.ɵɵtemplate(0, RecipeFormComponent_form_0_Template, 28, 19, "form", 0);
15334
15294
  i0.ɵɵelementStart(1, "div", 1);
15335
15295
  i0.ɵɵelementStart(2, "button", 2);
15336
15296
  i0.ɵɵlistener("click", function RecipeFormComponent_Template_button_click_2_listener() { return ctx.cancel(); });
@@ -15374,7 +15334,7 @@
15374
15334
  type: i0.Output
15375
15335
  }] });
15376
15336
  })();
15377
- var templateObject_1$j, templateObject_2$f, templateObject_3$c, templateObject_4$9, templateObject_5$6, templateObject_6$5, templateObject_7$4, templateObject_8$4, templateObject_9$3, templateObject_10$2, templateObject_11$2, templateObject_12$2;
15337
+ var templateObject_1$j, templateObject_2$f, templateObject_3$c, templateObject_4$9, templateObject_5$6, templateObject_6$5, templateObject_7$4, templateObject_8$4, templateObject_9$3, templateObject_10$2;
15378
15338
 
15379
15339
  var CalendarEvent = /** @class */ (function (_super) {
15380
15340
  __extends(CalendarEvent, _super);
@@ -19511,7 +19471,7 @@
19511
19471
  i0.ɵɵelementEnd();
19512
19472
  }
19513
19473
  }
19514
- var _c20 = function (a0) { return { reduced: a0 }; };
19474
+ var _c20$1 = function (a0) { return { reduced: a0 }; };
19515
19475
  function CatalogHeaderComponent_button_18_Template(rf, ctx) {
19516
19476
  if (rf & 1) {
19517
19477
  var _r36_1 = i0.ɵɵgetCurrentView();
@@ -19523,7 +19483,7 @@
19523
19483
  }
19524
19484
  if (rf & 2) {
19525
19485
  var ctx_r8 = i0.ɵɵnextContext();
19526
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(3, _c20, ctx_r8.reduced));
19486
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(3, _c20$1, ctx_r8.reduced));
19527
19487
  i0.ɵɵadvance(1);
19528
19488
  i0.ɵɵproperty("iconName", ctx_r8.icon.Cook);
19529
19489
  i0.ɵɵadvance(1);
@@ -19688,7 +19648,7 @@
19688
19648
  i0.ɵɵelementEnd();
19689
19649
  }
19690
19650
  if (rf & 2) {
19691
- i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(16, _c20, ctx.reduced));
19651
+ i0.ɵɵproperty("ngClass", i0.ɵɵpureFunction1(16, _c20$1, ctx.reduced));
19692
19652
  i0.ɵɵadvance(1);
19693
19653
  i0.ɵɵstyleProp("background-image", "url(" + ((ctx.catalogSetting == null ? null : ctx.catalogSetting.attributes["banner-image"].length) > 0 ? ctx.catalogSetting == null ? null : ctx.catalogSetting.attributes["banner-image"] : ctx.pictureUrl) + ")");
19694
19654
  i0.ɵɵadvance(4);
@@ -20074,7 +20034,7 @@
20074
20034
  }
20075
20035
  else {
20076
20036
  // tslint:disable-next-line: no-console
20077
- console.debug('Filtering aborted : ' + JSON.stringify(requestFilters) + 'and' + JSON.stringify(this.filters) + 'are different');
20037
+ console.debug("Filtering aborted : " + JSON.stringify(requestFilters) + " and " + JSON.stringify(this.filters) + " are different");
20078
20038
  return rxjs.of([]);
20079
20039
  }
20080
20040
  };
@@ -21268,7 +21228,7 @@
21268
21228
  i18n_23 = MSG_EXTERNAL_7886570921510760899$$LIB__WEB_COMPONENTS_RECIPE_STEPPER_RECIPE_STEPPER_COMPONENT_TS___24;
21269
21229
  }
21270
21230
  else {
21271
- i18n_23 = $localize(templateObject_11$3 || (templateObject_11$3 = __makeTemplateObject([":\u241Fcafc87479686947e2590b9f588a88040aeaf660b\u241F7886570921510760899:Tags"], [":\u241Fcafc87479686947e2590b9f588a88040aeaf660b\u241F7886570921510760899:Tags"])));
21231
+ i18n_23 = $localize(templateObject_11$2 || (templateObject_11$2 = __makeTemplateObject([":\u241Fcafc87479686947e2590b9f588a88040aeaf660b\u241F7886570921510760899:Tags"], [":\u241Fcafc87479686947e2590b9f588a88040aeaf660b\u241F7886570921510760899:Tags"])));
21272
21232
  }
21273
21233
  var i18n_25;
21274
21234
  if (typeof ngI18nClosureMode !== "undefined" && ngI18nClosureMode) {
@@ -21276,7 +21236,7 @@
21276
21236
  i18n_25 = MSG_EXTERNAL_70397346439942337$$LIB__WEB_COMPONENTS_RECIPE_STEPPER_RECIPE_STEPPER_COMPONENT_TS___26;
21277
21237
  }
21278
21238
  else {
21279
- i18n_25 = $localize(templateObject_12$3 || (templateObject_12$3 = __makeTemplateObject([":\u241F8aa969e69241c7c5838b40348f913519d6349371\u241F70397346439942337:Ajouter"], [":\u241F8aa969e69241c7c5838b40348f913519d6349371\u241F70397346439942337:Ajouter"])));
21239
+ i18n_25 = $localize(templateObject_12$2 || (templateObject_12$2 = __makeTemplateObject([":\u241F8aa969e69241c7c5838b40348f913519d6349371\u241F70397346439942337:Ajouter"], [":\u241F8aa969e69241c7c5838b40348f913519d6349371\u241F70397346439942337:Ajouter"])));
21280
21240
  }
21281
21241
  var i18n_27;
21282
21242
  if (typeof ngI18nClosureMode !== "undefined" && ngI18nClosureMode) {
@@ -21480,7 +21440,7 @@
21480
21440
  args: ['step']
21481
21441
  }] });
21482
21442
  })();
21483
- var templateObject_1$A, templateObject_2$s, templateObject_3$n, templateObject_4$i, templateObject_5$d, templateObject_6$c, templateObject_7$a, templateObject_8$9, templateObject_9$7, templateObject_10$3, templateObject_11$3, templateObject_12$3, templateObject_13$2, templateObject_14$2, templateObject_15$1, templateObject_16$1, templateObject_17$1, templateObject_18$1, templateObject_19$1, templateObject_20$1, templateObject_21, templateObject_22, templateObject_23;
21443
+ var templateObject_1$A, templateObject_2$s, templateObject_3$n, templateObject_4$i, templateObject_5$d, templateObject_6$c, templateObject_7$a, templateObject_8$9, templateObject_9$7, templateObject_10$3, templateObject_11$2, templateObject_12$2, templateObject_13$2, templateObject_14$2, templateObject_15$1, templateObject_16$1, templateObject_17$1, templateObject_18$1, templateObject_19$1, templateObject_20$1, templateObject_21, templateObject_22, templateObject_23;
21484
21444
 
21485
21445
  var _c0$l = ["miamCatalogTopAnchor"];
21486
21446
  function RecipeCatalogComponent_div_2_div_4_Template(rf, ctx) {
@@ -21832,7 +21792,6 @@
21832
21792
  this.filters.additionalFilters = null;
21833
21793
  };
21834
21794
  RecipeCatalogComponent.prototype.updateFilters = function (filters) {
21835
- console.log('updateFilters');
21836
21795
  this.filters = filters.copy(); // necessary to trigger child component change
21837
21796
  this.filterToRemove = undefined;
21838
21797
  this.returnToTop();
@@ -23643,6 +23602,22 @@
23643
23602
  if (request.url.includes('plausible')) {
23644
23603
  return next.handle(request);
23645
23604
  }
23605
+ request = this.setAuthHeaders(request);
23606
+ request = request.clone({ withCredentials: true });
23607
+ request = this.setUserProfiling(request);
23608
+ request = this.setMiamHeaders(request);
23609
+ return next.handle(request).pipe(operators.map(function (event) {
23610
+ var _a;
23611
+ if (event instanceof i1$1.HttpResponse && ((_a = event === null || event === void 0 ? void 0 : event.body) === null || _a === void 0 ? void 0 : _a.links)) {
23612
+ event = _this.addPagesInfos(event);
23613
+ }
23614
+ return event;
23615
+ }), operators.catchError(function (error) {
23616
+ _this.setCORSInContext(error);
23617
+ return rxjs.throwError(error);
23618
+ }));
23619
+ };
23620
+ MiamInterceptor.prototype.setAuthHeaders = function (request) {
23646
23621
  var token = localStorage.getItem('_miam/userToken');
23647
23622
  var userId = localStorage.getItem('_miam/userId');
23648
23623
  if (token) {
@@ -23655,45 +23630,62 @@
23655
23630
  setHeaders: { Authorization: "user_id " + userId }
23656
23631
  });
23657
23632
  }
23658
- request = request.clone({ withCredentials: true });
23633
+ return request;
23634
+ };
23635
+ MiamInterceptor.prototype.setUserProfiling = function (request) {
23659
23636
  var usersService = this.injector.get(UserService);
23660
23637
  if (usersService === null || usersService === void 0 ? void 0 : usersService.profilingForbidden()) {
23661
23638
  request = request.clone({ params: new i1$1.HttpParams().set('profiling', 'off') });
23662
23639
  }
23663
- return next.handle(request).pipe(operators.map(function (event) {
23664
- var _a;
23665
- if (event instanceof i1$1.HttpResponse) {
23666
- if ((_a = event === null || event === void 0 ? void 0 : event.body) === null || _a === void 0 ? void 0 : _a.links) {
23667
- var links = event.body.links;
23668
- var lastPageParams = new URLSearchParams(new URL(links.last).search);
23669
- var size = parseInt(lastPageParams.get('page[size]'), 10);
23670
- var total = size * parseInt(lastPageParams.get('page[number]'), 10);
23671
- var current = parseInt(lastPageParams.get('page[number]'), 10);
23672
- if (links.next) {
23673
- var nextPageParams = new URLSearchParams(new URL(links.next).search);
23674
- current = parseInt(nextPageParams.get('page[number]'), 10) - 1;
23675
- }
23676
- // ngx-jsonapi will put this info in DocumentCollection<any>.page
23677
- Object.assign(event.body, {
23678
- meta: {
23679
- size: size,
23680
- resources_per_page: size,
23681
- number: current,
23682
- total_resources: total
23683
- }
23684
- });
23640
+ return request;
23641
+ };
23642
+ MiamInterceptor.prototype.setMiamHeaders = function (request) {
23643
+ var context = this.injector.get(ContextService);
23644
+ if (!context.origin) {
23645
+ console.log(request.urlWithParams);
23646
+ console.log(context.origin);
23647
+ throw new Error('Cannot start Miam: origin hasn\'t been set');
23648
+ }
23649
+ else {
23650
+ request = request.clone({
23651
+ setHeaders: {
23652
+ 'miam-origin': context.origin,
23653
+ 'miam-front-version': '6.0.3',
23654
+ 'miam-front-type': 'web',
23655
+ 'miam-api-version': '4.7.0'
23685
23656
  }
23657
+ });
23658
+ return request;
23659
+ }
23660
+ };
23661
+ MiamInterceptor.prototype.addPagesInfos = function (event) {
23662
+ var links = event.body.links;
23663
+ var lastPageParams = new URLSearchParams(new URL(links.last).search);
23664
+ var size = parseInt(lastPageParams.get('page[size]'), 10);
23665
+ var total = size * parseInt(lastPageParams.get('page[number]'), 10);
23666
+ var current = parseInt(lastPageParams.get('page[number]'), 10);
23667
+ if (links.next) {
23668
+ var nextPageParams = new URLSearchParams(new URL(links.next).search);
23669
+ current = parseInt(nextPageParams.get('page[number]'), 10) - 1;
23670
+ }
23671
+ // ngx-jsonapi will put this info in DocumentCollection<any>.page
23672
+ Object.assign(event.body, {
23673
+ meta: {
23674
+ size: size,
23675
+ resources_per_page: size,
23676
+ number: current,
23677
+ total_resources: total
23686
23678
  }
23687
- return event;
23688
- }), operators.catchError(function (error) {
23689
- // status 0 = unknown error, CORS break on preflight then no relevent error message
23690
- // Warning : circular dependency injection?
23691
- var context = _this.injector.get(ContextService);
23692
- if (error.status === 0 && error.url.includes('https://api.miam.tech/api') && context) {
23693
- context.setCORSIssueState(true);
23694
- }
23695
- return rxjs.throwError(error);
23696
- }));
23679
+ });
23680
+ return event;
23681
+ };
23682
+ MiamInterceptor.prototype.setCORSInContext = function (error) {
23683
+ // status 0 = unknown error, CORS break on preflight then no relevent error message
23684
+ // Warning : circular dependency injection?
23685
+ var context = this.injector.get(ContextService);
23686
+ if (error.status === 0 && error.url.includes('https://api.miam.tech/api') && context) {
23687
+ context.setCORSIssueState(true);
23688
+ }
23697
23689
  };
23698
23690
  return MiamInterceptor;
23699
23691
  }());
@@ -23813,6 +23805,7 @@
23813
23805
 
23814
23806
  exports.ActionsPopinComponent = ActionsPopinComponent;
23815
23807
  exports.AddonLinkComponent = AddonLinkComponent;
23808
+ exports.AnalyticsService = AnalyticsService;
23816
23809
  exports.Article = Article;
23817
23810
  exports.ArticlesService = ArticlesService;
23818
23811
  exports.Basket = Basket;
@@ -23841,9 +23834,11 @@
23841
23834
  exports.ContextService = ContextService;
23842
23835
  exports.CounterInputComponent = CounterInputComponent;
23843
23836
  exports.CounterService = CounterService;
23837
+ exports.CustomProperties = CustomProperties;
23844
23838
  exports.DeleteConfirmButtonComponent = DeleteConfirmButtonComponent;
23845
23839
  exports.DragDropInputComponent = DragDropInputComponent;
23846
23840
  exports.DrawerComponent = DrawerComponent;
23841
+ exports.EventTrace = EventTrace;
23847
23842
  exports.ExplainBannerComponent = ExplainBannerComponent;
23848
23843
  exports.ExplainBannerStepComponent = ExplainBannerStepComponent;
23849
23844
  exports.GroceriesEntriesService = GroceriesEntriesService;