ng-miam 9.1.21 → 9.1.22

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.
@@ -1680,7 +1680,8 @@
1680
1680
  miamWeb: 'https://miam.tech',
1681
1681
  mealzComponents: 'https://cdn.jsdelivr.net/npm/mealz-components@1.2/dist',
1682
1682
  mealzSsrApi: 'https://ssr-api.mealz.ai',
1683
- lang: 'fr'
1683
+ lang: 'fr',
1684
+ analyticsEnabled: true // Only used in DEV mode
1684
1685
  };
1685
1686
 
1686
1687
  var Ingredient = /** @class */ (function (_super) {
@@ -3496,7 +3497,7 @@
3496
3497
  EventJourney["EMPTY"] = "";
3497
3498
  })(EventJourney || (EventJourney = {}));
3498
3499
 
3499
- var VERSION = '9.1.19'; // TODO: replace by ##VERSION## and update it in the CI/CD
3500
+ var VERSION = '9.1.22'; // TODO: replace by ##VERSION## and update it in the CI/CD
3500
3501
 
3501
3502
  var ContextRegistryService = /** @class */ (function () {
3502
3503
  function ContextRegistryService() {
@@ -3528,6 +3529,11 @@
3528
3529
  }
3529
3530
  return location.href;
3530
3531
  }
3532
+ /**
3533
+ * Maps Angular environment to analytics environment
3534
+ * dev -> uat, uat -> uat, prod -> prod
3535
+ */
3536
+ var getAnalyticsEnvironment = function () { return environment$1.env === 'prod' ? 'prod' : 'uat'; };
3531
3537
  // Exported only for unit tests...
3532
3538
  // eslint-disable-next-line prefer-arrow/prefer-arrow-functions
3533
3539
  function _onEmit(event) {
@@ -3572,7 +3578,8 @@
3572
3578
  if (!domain) {
3573
3579
  return mealzError('[Mealz] Analytics not initialized (domain cannot be null)');
3574
3580
  }
3575
- mealzSharedAnalytics.initSharedAnalytics(domain, VERSION, _onEmit);
3581
+ var analyticsEnvironment = getAnalyticsEnvironment();
3582
+ mealzSharedAnalytics.initSharedAnalytics(domain, VERSION, _onEmit, analyticsEnvironment);
3576
3583
  if (((_a = localStorage.getItem('_miam/affiliate')) === null || _a === void 0 ? void 0 : _a.length) > 0) {
3577
3584
  mealzSharedAnalytics.setAffiliate(localStorage.getItem('_miam/affiliate'));
3578
3585
  }
@@ -3582,6 +3589,10 @@
3582
3589
  if (this.contextRegistryService.disabledAnalytics && this.contextRegistryService.forbidProfiling) {
3583
3590
  return;
3584
3591
  }
3592
+ // Disable analytics only in development environment if environment variable analyticsEnabled is false
3593
+ if (environment$1.env === 'dev' && environment$1.analyticsEnabled === false) {
3594
+ return;
3595
+ }
3585
3596
  // Currently no way to know if it is search or shelves
3586
3597
  var journey = this.isMealzPage ? EventJourney.MEALZ : EventJourney.EMPTY;
3587
3598
  this.callMethodOrAddToQueue(function () { return mealzSharedAnalytics.sendEvent(name, url(path), journey, props); });
@@ -10029,7 +10040,8 @@
10029
10040
  miamWeb: 'https://miam.tech',
10030
10041
  mealzComponents: 'https://cdn.jsdelivr.net/npm/mealz-components@1.2/dist',
10031
10042
  mealzSsrApi: 'https://ssr-api.mealz.ai',
10032
- lang: 'fr'
10043
+ lang: 'fr',
10044
+ analyticsEnabled: true // Only used in DEV mode
10033
10045
  };
10034
10046
 
10035
10047
  var MiamInterceptor = /** @class */ (function () {