@sentry/browser 6.19.4 → 6.19.7

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 (162) hide show
  1. package/build/bundle.debug.min.js +3 -0
  2. package/build/bundle.debug.min.js.map +1 -0
  3. package/build/bundle.es6.debug.min.js +3 -0
  4. package/build/bundle.es6.debug.min.js.map +1 -0
  5. package/{bundles → build}/bundle.es6.js +166 -92
  6. package/build/bundle.es6.js.map +1 -0
  7. package/build/bundle.es6.min.js +3 -0
  8. package/build/bundle.es6.min.js.map +1 -0
  9. package/{bundles → build}/bundle.js +171 -111
  10. package/build/bundle.js.map +1 -0
  11. package/build/bundle.min.js +3 -0
  12. package/build/bundle.min.js.map +1 -0
  13. package/dist/backend.d.ts.map +1 -1
  14. package/dist/backend.js.map +1 -1
  15. package/dist/client.d.ts.map +1 -1
  16. package/dist/client.js +2 -1
  17. package/dist/client.js.map +1 -1
  18. package/dist/eventbuilder.d.ts.map +1 -1
  19. package/dist/eventbuilder.js.map +1 -1
  20. package/dist/exports.d.ts.map +1 -1
  21. package/dist/exports.js.map +1 -1
  22. package/dist/flags.d.ts +3 -0
  23. package/dist/flags.d.ts.map +1 -0
  24. package/dist/flags.js +17 -0
  25. package/dist/flags.js.map +1 -0
  26. package/dist/helpers.d.ts.map +1 -1
  27. package/dist/helpers.js +3 -2
  28. package/dist/helpers.js.map +1 -1
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js.map +1 -1
  31. package/dist/integrations/breadcrumbs.d.ts.map +1 -1
  32. package/dist/integrations/breadcrumbs.js.map +1 -1
  33. package/dist/integrations/dedupe.d.ts.map +1 -1
  34. package/dist/integrations/dedupe.js +2 -1
  35. package/dist/integrations/dedupe.js.map +1 -1
  36. package/dist/integrations/globalhandlers.d.ts.map +1 -1
  37. package/dist/integrations/globalhandlers.js +2 -1
  38. package/dist/integrations/globalhandlers.js.map +1 -1
  39. package/dist/integrations/index.d.ts.map +1 -1
  40. package/dist/integrations/index.js.map +1 -1
  41. package/dist/integrations/linkederrors.d.ts.map +1 -1
  42. package/dist/integrations/linkederrors.js.map +1 -1
  43. package/dist/integrations/trycatch.d.ts.map +1 -1
  44. package/dist/integrations/trycatch.js.map +1 -1
  45. package/dist/integrations/useragent.d.ts.map +1 -1
  46. package/dist/integrations/useragent.js.map +1 -1
  47. package/dist/sdk.d.ts.map +1 -1
  48. package/dist/sdk.js +4 -3
  49. package/dist/sdk.js.map +1 -1
  50. package/dist/stack-parsers.d.ts.map +1 -1
  51. package/dist/stack-parsers.js.map +1 -1
  52. package/dist/transports/base.d.ts.map +1 -1
  53. package/dist/transports/base.js +6 -5
  54. package/dist/transports/base.js.map +1 -1
  55. package/dist/transports/fetch.d.ts.map +1 -1
  56. package/dist/transports/fetch.js.map +1 -1
  57. package/dist/transports/index.d.ts.map +1 -1
  58. package/dist/transports/index.js.map +1 -1
  59. package/dist/transports/new-fetch.d.ts.map +1 -1
  60. package/dist/transports/new-fetch.js.map +1 -1
  61. package/dist/transports/new-xhr.d.ts.map +1 -1
  62. package/dist/transports/new-xhr.js.map +1 -1
  63. package/dist/transports/utils.d.ts.map +1 -1
  64. package/dist/transports/utils.js +2 -1
  65. package/dist/transports/utils.js.map +1 -1
  66. package/dist/transports/xhr.d.ts.map +1 -1
  67. package/dist/transports/xhr.js.map +1 -1
  68. package/dist/version.d.ts.map +1 -1
  69. package/dist/version.js.map +1 -1
  70. package/esm/backend.d.ts.map +1 -1
  71. package/esm/backend.js.map +1 -1
  72. package/esm/client.d.ts.map +1 -1
  73. package/esm/client.js +3 -2
  74. package/esm/client.js.map +1 -1
  75. package/esm/eventbuilder.d.ts.map +1 -1
  76. package/esm/eventbuilder.js.map +1 -1
  77. package/esm/exports.d.ts.map +1 -1
  78. package/esm/exports.js.map +1 -1
  79. package/esm/flags.d.ts +3 -0
  80. package/esm/flags.d.ts.map +1 -0
  81. package/esm/flags.js +16 -0
  82. package/esm/flags.js.map +1 -0
  83. package/esm/helpers.d.ts.map +1 -1
  84. package/esm/helpers.js +4 -3
  85. package/esm/helpers.js.map +1 -1
  86. package/esm/index.d.ts.map +1 -1
  87. package/esm/index.js.map +1 -1
  88. package/esm/integrations/breadcrumbs.d.ts.map +1 -1
  89. package/esm/integrations/breadcrumbs.js.map +1 -1
  90. package/esm/integrations/dedupe.d.ts.map +1 -1
  91. package/esm/integrations/dedupe.js +3 -2
  92. package/esm/integrations/dedupe.js.map +1 -1
  93. package/esm/integrations/globalhandlers.d.ts.map +1 -1
  94. package/esm/integrations/globalhandlers.js +3 -2
  95. package/esm/integrations/globalhandlers.js.map +1 -1
  96. package/esm/integrations/index.d.ts.map +1 -1
  97. package/esm/integrations/index.js.map +1 -1
  98. package/esm/integrations/linkederrors.d.ts.map +1 -1
  99. package/esm/integrations/linkederrors.js.map +1 -1
  100. package/esm/integrations/trycatch.d.ts.map +1 -1
  101. package/esm/integrations/trycatch.js.map +1 -1
  102. package/esm/integrations/useragent.d.ts.map +1 -1
  103. package/esm/integrations/useragent.js.map +1 -1
  104. package/esm/sdk.d.ts.map +1 -1
  105. package/esm/sdk.js +5 -4
  106. package/esm/sdk.js.map +1 -1
  107. package/esm/stack-parsers.d.ts.map +1 -1
  108. package/esm/stack-parsers.js.map +1 -1
  109. package/esm/transports/base.d.ts.map +1 -1
  110. package/esm/transports/base.js +7 -6
  111. package/esm/transports/base.js.map +1 -1
  112. package/esm/transports/fetch.d.ts.map +1 -1
  113. package/esm/transports/fetch.js.map +1 -1
  114. package/esm/transports/index.d.ts.map +1 -1
  115. package/esm/transports/index.js.map +1 -1
  116. package/esm/transports/new-fetch.d.ts.map +1 -1
  117. package/esm/transports/new-fetch.js.map +1 -1
  118. package/esm/transports/new-xhr.d.ts.map +1 -1
  119. package/esm/transports/new-xhr.js.map +1 -1
  120. package/esm/transports/utils.d.ts.map +1 -1
  121. package/esm/transports/utils.js +3 -2
  122. package/esm/transports/utils.js.map +1 -1
  123. package/esm/transports/xhr.d.ts.map +1 -1
  124. package/esm/transports/xhr.js.map +1 -1
  125. package/esm/version.d.ts.map +1 -1
  126. package/esm/version.js.map +1 -1
  127. package/package.json +5 -44
  128. package/types/backend.d.ts.map +1 -1
  129. package/types/client.d.ts.map +1 -1
  130. package/types/eventbuilder.d.ts.map +1 -1
  131. package/types/exports.d.ts.map +1 -1
  132. package/types/flags.d.ts +3 -0
  133. package/types/flags.d.ts.map +1 -0
  134. package/types/helpers.d.ts.map +1 -1
  135. package/types/index.d.ts.map +1 -1
  136. package/types/integrations/breadcrumbs.d.ts.map +1 -1
  137. package/types/integrations/dedupe.d.ts.map +1 -1
  138. package/types/integrations/globalhandlers.d.ts.map +1 -1
  139. package/types/integrations/index.d.ts.map +1 -1
  140. package/types/integrations/linkederrors.d.ts.map +1 -1
  141. package/types/integrations/trycatch.d.ts.map +1 -1
  142. package/types/integrations/useragent.d.ts.map +1 -1
  143. package/types/sdk.d.ts.map +1 -1
  144. package/types/stack-parsers.d.ts.map +1 -1
  145. package/types/transports/base.d.ts.map +1 -1
  146. package/types/transports/fetch.d.ts.map +1 -1
  147. package/types/transports/index.d.ts.map +1 -1
  148. package/types/transports/new-fetch.d.ts.map +1 -1
  149. package/types/transports/new-xhr.d.ts.map +1 -1
  150. package/types/transports/utils.d.ts.map +1 -1
  151. package/types/transports/xhr.d.ts.map +1 -1
  152. package/types/version.d.ts.map +1 -1
  153. package/bundles/bundle.debug.min.js +0 -3
  154. package/bundles/bundle.debug.min.js.map +0 -1
  155. package/bundles/bundle.es6.debug.min.js +0 -3
  156. package/bundles/bundle.es6.debug.min.js.map +0 -1
  157. package/bundles/bundle.es6.js.map +0 -1
  158. package/bundles/bundle.es6.min.js +0 -3
  159. package/bundles/bundle.es6.min.js.map +0 -1
  160. package/bundles/bundle.js.map +0 -1
  161. package/bundles/bundle.min.js +0 -3
  162. package/bundles/bundle.min.js.map +0 -1
@@ -1,4 +1,4 @@
1
- /*! @sentry/browser 6.19.4 (261f2e4) | https://github.com/getsentry/sentry-javascript */
1
+ /*! @sentry/browser 6.19.7 (5b3a175) | https://github.com/getsentry/sentry-javascript */
2
2
  var Sentry = (function (exports) {
3
3
 
4
4
  /**
@@ -51,6 +51,23 @@ var Sentry = (function (exports) {
51
51
  : typeof self !== 'undefined'
52
52
  ? self
53
53
  : fallbackGlobalObject);
54
+ }
55
+ /**
56
+ * Returns a global singleton contained in the global `__SENTRY__` object.
57
+ *
58
+ * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory
59
+ * function and added to the `__SENTRY__` object.
60
+ *
61
+ * @param name name of the global singleton on __SENTRY__
62
+ * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__`
63
+ * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `getGlobalObject`'s return value
64
+ * @returns the singleton
65
+ */
66
+ function getGlobalSingleton(name, creator, obj) {
67
+ const global = (obj || getGlobalObject());
68
+ const __SENTRY__ = (global.__SENTRY__ = global.__SENTRY__ || {});
69
+ const singleton = __SENTRY__[name] || (__SENTRY__[name] = creator());
70
+ return singleton;
54
71
  }
55
72
 
56
73
  /* eslint-disable @typescript-eslint/no-explicit-any */
@@ -349,6 +366,22 @@ var Sentry = (function (exports) {
349
366
  }
350
367
  }
351
368
 
369
+ /*
370
+ * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking
371
+ * for users.
372
+ *
373
+ * Debug flags need to be declared in each package individually and must not be imported across package boundaries,
374
+ * because some build tools have trouble tree-shaking imported guards.
375
+ *
376
+ * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder.
377
+ *
378
+ * Debug flag files will contain "magic strings" like `true` that may get replaced with actual values during
379
+ * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not
380
+ * replaced.
381
+ */
382
+ /** Flag that is true for debug builds, false otherwise. */
383
+ const IS_DEBUG_BUILD$3 = true;
384
+
352
385
  /** Regular expression used to parse a Dsn. */
353
386
  const DSN_REGEX = /^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/;
354
387
  function isValidProtocol(protocol) {
@@ -406,6 +439,9 @@ var Sentry = (function (exports) {
406
439
  };
407
440
  }
408
441
  function validateDsn(dsn) {
442
+ if (!IS_DEBUG_BUILD$3) {
443
+ return;
444
+ }
409
445
  const { port, projectId, protocol } = dsn;
410
446
  const requiredComponents = ['protocol', 'publicKey', 'host', 'projectId'];
411
447
  requiredComponents.forEach(component => {
@@ -439,8 +475,7 @@ var Sentry = (function (exports) {
439
475
  const PREFIX = 'Sentry Logger ';
440
476
  const CONSOLE_LEVELS = ['debug', 'info', 'warn', 'error', 'log', 'assert'];
441
477
  /**
442
- * Temporarily unwrap `console.log` and friends in order to perform the given callback using the original methods.
443
- * Restores wrapping after the callback completes.
478
+ * Temporarily disable sentry console instrumentations.
444
479
  *
445
480
  * @param callback The function to run against the original `console` messages
446
481
  * @returns The results of the callback
@@ -450,73 +485,63 @@ var Sentry = (function (exports) {
450
485
  if (!('console' in global)) {
451
486
  return callback();
452
487
  }
453
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
454
488
  const originalConsole = global.console;
455
489
  const wrappedLevels = {};
456
490
  // Restore all wrapped console methods
457
491
  CONSOLE_LEVELS.forEach(level => {
458
- // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
459
- if (level in global.console && originalConsole[level].__sentry_original__) {
492
+ // TODO(v7): Remove this check as it's only needed for Node 6
493
+ const originalWrappedFunc = originalConsole[level] && originalConsole[level].__sentry_original__;
494
+ if (level in global.console && originalWrappedFunc) {
460
495
  wrappedLevels[level] = originalConsole[level];
461
- originalConsole[level] = originalConsole[level].__sentry_original__;
496
+ originalConsole[level] = originalWrappedFunc;
462
497
  }
463
498
  });
464
- // Perform callback manipulations
465
- const result = callback();
466
- // Revert restoration to wrapped state
467
- Object.keys(wrappedLevels).forEach(level => {
468
- originalConsole[level] = wrappedLevels[level];
469
- });
470
- return result;
471
- }
472
- /** JSDoc */
473
- class Logger {
474
- /** JSDoc */
475
- constructor() {
476
- this._enabled = false;
477
- }
478
- /** JSDoc */
479
- disable() {
480
- this._enabled = false;
481
- }
482
- /** JSDoc */
483
- enable() {
484
- this._enabled = true;
499
+ try {
500
+ return callback();
485
501
  }
486
- /** JSDoc */
487
- log(...args) {
488
- if (!this._enabled) {
489
- return;
490
- }
491
- consoleSandbox(() => {
492
- global$6.console.log(`${PREFIX}[Log]:`, ...args);
502
+ finally {
503
+ // Revert restoration to wrapped state
504
+ Object.keys(wrappedLevels).forEach(level => {
505
+ originalConsole[level] = wrappedLevels[level];
493
506
  });
494
507
  }
495
- /** JSDoc */
496
- warn(...args) {
497
- if (!this._enabled) {
498
- return;
499
- }
500
- consoleSandbox(() => {
501
- global$6.console.warn(`${PREFIX}[Warn]:`, ...args);
508
+ }
509
+ function makeLogger() {
510
+ let enabled = false;
511
+ const logger = {
512
+ enable: () => {
513
+ enabled = true;
514
+ },
515
+ disable: () => {
516
+ enabled = false;
517
+ },
518
+ };
519
+ if (IS_DEBUG_BUILD$3) {
520
+ CONSOLE_LEVELS.forEach(name => {
521
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
522
+ logger[name] = (...args) => {
523
+ if (enabled) {
524
+ consoleSandbox(() => {
525
+ global$6.console[name](`${PREFIX}[${name}]:`, ...args);
526
+ });
527
+ }
528
+ };
502
529
  });
503
530
  }
504
- /** JSDoc */
505
- error(...args) {
506
- if (!this._enabled) {
507
- return;
508
- }
509
- consoleSandbox(() => {
510
- global$6.console.error(`${PREFIX}[Error]:`, ...args);
531
+ else {
532
+ CONSOLE_LEVELS.forEach(name => {
533
+ logger[name] = () => undefined;
511
534
  });
512
535
  }
536
+ return logger;
513
537
  }
514
- const sentryGlobal = global$6.__SENTRY__ || {};
515
- const logger = sentryGlobal.logger || new Logger();
516
- {
517
- // Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used
518
- sentryGlobal.logger = logger;
519
- global$6.__SENTRY__ = sentryGlobal;
538
+ // Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used
539
+ let logger;
540
+ if (IS_DEBUG_BUILD$3) {
541
+ logger = getGlobalSingleton('logger', makeLogger);
542
+ }
543
+ else {
544
+ logger = makeLogger();
520
545
  }
521
546
 
522
547
  /**
@@ -2702,12 +2727,7 @@ var Sentry = (function (exports) {
2702
2727
  * Returns the global event processors.
2703
2728
  */
2704
2729
  function getGlobalEventProcessors() {
2705
- /* eslint-disable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */
2706
- const global = getGlobalObject();
2707
- global.__SENTRY__ = global.__SENTRY__ || {};
2708
- global.__SENTRY__.globalEventProcessors = global.__SENTRY__.globalEventProcessors || [];
2709
- return global.__SENTRY__.globalEventProcessors;
2710
- /* eslint-enable @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access */
2730
+ return getGlobalSingleton('globalEventProcessors', () => []);
2711
2731
  }
2712
2732
  /**
2713
2733
  * Add a EventProcessor to be kept globally.
@@ -2827,6 +2847,22 @@ var Sentry = (function (exports) {
2827
2847
  }
2828
2848
  }
2829
2849
 
2850
+ /*
2851
+ * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking
2852
+ * for users.
2853
+ *
2854
+ * Debug flags need to be declared in each package individually and must not be imported across package boundaries,
2855
+ * because some build tools have trouble tree-shaking imported guards.
2856
+ *
2857
+ * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder.
2858
+ *
2859
+ * Debug flag files will contain "magic strings" like `true` that may get replaced with actual values during
2860
+ * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not
2861
+ * replaced.
2862
+ */
2863
+ /** Flag that is true for debug builds, false otherwise. */
2864
+ const IS_DEBUG_BUILD$2 = true;
2865
+
2830
2866
  /**
2831
2867
  * API compatibility version of this hub.
2832
2868
  *
@@ -3099,7 +3135,7 @@ var Sentry = (function (exports) {
3099
3135
  return client.getIntegration(integration);
3100
3136
  }
3101
3137
  catch (_oO) {
3102
- logger.warn(`Cannot retrieve integration ${integration.id} from the current Hub`);
3138
+ IS_DEBUG_BUILD$2 && logger.warn(`Cannot retrieve integration ${integration.id} from the current Hub`);
3103
3139
  return null;
3104
3140
  }
3105
3141
  }
@@ -3210,7 +3246,7 @@ var Sentry = (function (exports) {
3210
3246
  if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {
3211
3247
  return sentry.extensions[method].apply(this, args);
3212
3248
  }
3213
- logger.warn(`Extension method ${method} couldn't be found, doing nothing.`);
3249
+ IS_DEBUG_BUILD$2 && logger.warn(`Extension method ${method} couldn't be found, doing nothing.`);
3214
3250
  }
3215
3251
  }
3216
3252
  /**
@@ -3270,11 +3306,7 @@ var Sentry = (function (exports) {
3270
3306
  * @hidden
3271
3307
  */
3272
3308
  function getHubFromCarrier(carrier) {
3273
- if (carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub)
3274
- return carrier.__SENTRY__.hub;
3275
- carrier.__SENTRY__ = carrier.__SENTRY__ || {};
3276
- carrier.__SENTRY__.hub = new Hub();
3277
- return carrier.__SENTRY__.hub;
3309
+ return getGlobalSingleton('hub', () => new Hub(), carrier);
3278
3310
  }
3279
3311
  /**
3280
3312
  * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute
@@ -3285,8 +3317,8 @@ var Sentry = (function (exports) {
3285
3317
  function setHubOnCarrier(carrier, hub) {
3286
3318
  if (!carrier)
3287
3319
  return false;
3288
- carrier.__SENTRY__ = carrier.__SENTRY__ || {};
3289
- carrier.__SENTRY__.hub = hub;
3320
+ const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {});
3321
+ __SENTRY__.hub = hub;
3290
3322
  return true;
3291
3323
  }
3292
3324
 
@@ -3528,6 +3560,22 @@ var Sentry = (function (exports) {
3528
3560
  return `${endpoint}?${encodedOptions}`;
3529
3561
  }
3530
3562
 
3563
+ /*
3564
+ * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking
3565
+ * for users.
3566
+ *
3567
+ * Debug flags need to be declared in each package individually and must not be imported across package boundaries,
3568
+ * because some build tools have trouble tree-shaking imported guards.
3569
+ *
3570
+ * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder.
3571
+ *
3572
+ * Debug flag files will contain "magic strings" like `true` that may get replaced with actual values during
3573
+ * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not
3574
+ * replaced.
3575
+ */
3576
+ /** Flag that is true for debug builds, false otherwise. */
3577
+ const IS_DEBUG_BUILD$1 = true;
3578
+
3531
3579
  const installedIntegrations = [];
3532
3580
  /**
3533
3581
  * @private
@@ -3871,7 +3919,7 @@ var Sentry = (function (exports) {
3871
3919
  if (evt) {
3872
3920
  // TODO this is more of the hack trying to solve https://github.com/getsentry/sentry-javascript/issues/2809
3873
3921
  // it is only attached as extra data to the event if the event somehow skips being normalized
3874
- evt.sdkProcessingMetadata = Object.assign(Object.assign({}, evt.sdkProcessingMetadata), { normalizeDepth: normalize(normalizeDepth) });
3922
+ evt.sdkProcessingMetadata = Object.assign(Object.assign({}, evt.sdkProcessingMetadata), { normalizeDepth: `${normalize(normalizeDepth)} (${typeof normalizeDepth})` });
3875
3923
  }
3876
3924
  if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {
3877
3925
  return this._normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);
@@ -4375,9 +4423,14 @@ var Sentry = (function (exports) {
4375
4423
  */
4376
4424
  function initAndBind(clientClass, options) {
4377
4425
  if (options.debug === true) {
4378
- {
4426
+ if (IS_DEBUG_BUILD$1) {
4379
4427
  logger.enable();
4380
4428
  }
4429
+ else {
4430
+ // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped
4431
+ // eslint-disable-next-line no-console
4432
+ console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');
4433
+ }
4381
4434
  }
4382
4435
  const hub = getCurrentHub();
4383
4436
  const scope = hub.getScope();
@@ -4438,7 +4491,7 @@ var Sentry = (function (exports) {
4438
4491
  return `Too many ${category} requests, backing off until: ${new Date(disabledUntil(rateLimits, category)).toISOString()}`;
4439
4492
  }
4440
4493
 
4441
- const SDK_VERSION = '6.19.4';
4494
+ const SDK_VERSION = '6.19.7';
4442
4495
 
4443
4496
  let originalFunctionToString;
4444
4497
  /** Patch toString calls to return proper name for wrapped functions */
@@ -4532,19 +4585,23 @@ var Sentry = (function (exports) {
4532
4585
  /** JSDoc */
4533
4586
  function _shouldDropEvent$1(event, options) {
4534
4587
  if (options.ignoreInternal && _isSentryError(event)) {
4535
- logger.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${getEventDescription(event)}`);
4588
+ IS_DEBUG_BUILD$1 &&
4589
+ logger.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${getEventDescription(event)}`);
4536
4590
  return true;
4537
4591
  }
4538
4592
  if (_isIgnoredError(event, options.ignoreErrors)) {
4539
- logger.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${getEventDescription(event)}`);
4593
+ IS_DEBUG_BUILD$1 &&
4594
+ logger.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${getEventDescription(event)}`);
4540
4595
  return true;
4541
4596
  }
4542
4597
  if (_isDeniedUrl(event, options.denyUrls)) {
4543
- logger.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${getEventDescription(event)}.\nUrl: ${_getEventFilterUrl(event)}`);
4598
+ IS_DEBUG_BUILD$1 &&
4599
+ logger.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${getEventDescription(event)}.\nUrl: ${_getEventFilterUrl(event)}`);
4544
4600
  return true;
4545
4601
  }
4546
4602
  if (!_isAllowedUrl(event, options.allowUrls)) {
4547
- logger.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${getEventDescription(event)}.\nUrl: ${_getEventFilterUrl(event)}`);
4603
+ IS_DEBUG_BUILD$1 &&
4604
+ logger.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${getEventDescription(event)}.\nUrl: ${_getEventFilterUrl(event)}`);
4548
4605
  return true;
4549
4606
  }
4550
4607
  return false;
@@ -4581,7 +4638,7 @@ var Sentry = (function (exports) {
4581
4638
  return [`${value}`, `${type}: ${value}`];
4582
4639
  }
4583
4640
  catch (oO) {
4584
- logger.error(`Cannot extract message for event ${getEventDescription(event)}`);
4641
+ IS_DEBUG_BUILD$1 && logger.error(`Cannot extract message for event ${getEventDescription(event)}`);
4585
4642
  return [];
4586
4643
  }
4587
4644
  }
@@ -4623,7 +4680,7 @@ var Sentry = (function (exports) {
4623
4680
  return frames ? _getLastValidUrl(frames) : null;
4624
4681
  }
4625
4682
  catch (oO) {
4626
- logger.error(`Cannot extract url for event ${getEventDescription(event)}`);
4683
+ IS_DEBUG_BUILD$1 && logger.error(`Cannot extract url for event ${getEventDescription(event)}`);
4627
4684
  return null;
4628
4685
  }
4629
4686
  }
@@ -4963,6 +5020,22 @@ var Sentry = (function (exports) {
4963
5020
  return event;
4964
5021
  }
4965
5022
 
5023
+ /*
5024
+ * This file defines flags and constants that can be modified during compile time in order to facilitate tree shaking
5025
+ * for users.
5026
+ *
5027
+ * Debug flags need to be declared in each package individually and must not be imported across package boundaries,
5028
+ * because some build tools have trouble tree-shaking imported guards.
5029
+ *
5030
+ * As a convention, we define debug flags in a `flags.ts` file in the root of a package's `src` folder.
5031
+ *
5032
+ * Debug flag files will contain "magic strings" like `true` that may get replaced with actual values during
5033
+ * our, or the user's build process. Take care when introducing new flags - they must not throw if they are not
5034
+ * replaced.
5035
+ */
5036
+ /** Flag that is true for debug builds, false otherwise. */
5037
+ const IS_DEBUG_BUILD = true;
5038
+
4966
5039
  const global$4 = getGlobalObject();
4967
5040
  let cachedFetchImpl;
4968
5041
  /**
@@ -5115,7 +5188,7 @@ var Sentry = (function (exports) {
5115
5188
  // A correct type for map-based implementation if we want to go that route
5116
5189
  // would be `Partial<Record<SentryRequestType, Partial<Record<Outcome, number>>>>`
5117
5190
  const key = `${requestTypeToCategory(category)}:${reason}`;
5118
- logger.log(`Adding outcome: ${key}`);
5191
+ IS_DEBUG_BUILD && logger.log(`Adding outcome: ${key}`);
5119
5192
  this._outcomes[key] = (_a = this._outcomes[key], (_a !== null && _a !== void 0 ? _a : 0)) + 1;
5120
5193
  }
5121
5194
  /**
@@ -5129,10 +5202,10 @@ var Sentry = (function (exports) {
5129
5202
  this._outcomes = {};
5130
5203
  // Nothing to send
5131
5204
  if (!Object.keys(outcomes).length) {
5132
- logger.log('No outcomes to flush');
5205
+ IS_DEBUG_BUILD && logger.log('No outcomes to flush');
5133
5206
  return;
5134
5207
  }
5135
- logger.log(`Flushing outcomes:\n${JSON.stringify(outcomes, null, 2)}`);
5208
+ IS_DEBUG_BUILD && logger.log(`Flushing outcomes:\n${JSON.stringify(outcomes, null, 2)}`);
5136
5209
  const url = getEnvelopeEndpointWithUrlEncodedAuth(this._api.dsn, this._api.tunnel);
5137
5210
  const discardedEvents = Object.keys(outcomes).map(key => {
5138
5211
  const [category, reason] = key.split(':');
@@ -5148,7 +5221,7 @@ var Sentry = (function (exports) {
5148
5221
  sendReport(url, serializeEnvelope(envelope));
5149
5222
  }
5150
5223
  catch (e) {
5151
- logger.error(e);
5224
+ IS_DEBUG_BUILD && logger.error(e);
5152
5225
  }
5153
5226
  }
5154
5227
  /**
@@ -5159,7 +5232,8 @@ var Sentry = (function (exports) {
5159
5232
  this._rateLimits = updateRateLimits(this._rateLimits, headers);
5160
5233
  // eslint-disable-next-line deprecation/deprecation
5161
5234
  if (this._isRateLimited(requestType)) {
5162
- // eslint-disable-next-line deprecation/deprecation
5235
+ IS_DEBUG_BUILD &&
5236
+ // eslint-disable-next-line deprecation/deprecation
5163
5237
  logger.warn(`Too many ${requestType} requests, backing off until: ${this._disabledUntil(requestType)}`);
5164
5238
  }
5165
5239
  if (status === 'success') {
@@ -5548,11 +5622,11 @@ var Sentry = (function (exports) {
5548
5622
  return;
5549
5623
  }
5550
5624
  if (!options.eventId) {
5551
- logger.error('Missing eventId option in showReportDialog call');
5625
+ IS_DEBUG_BUILD && logger.error('Missing eventId option in showReportDialog call');
5552
5626
  return;
5553
5627
  }
5554
5628
  if (!options.dsn) {
5555
- logger.error('Missing dsn option in showReportDialog call');
5629
+ IS_DEBUG_BUILD && logger.error('Missing dsn option in showReportDialog call');
5556
5630
  return;
5557
5631
  }
5558
5632
  const script = global$2.document.createElement('script');
@@ -5744,7 +5818,7 @@ var Sentry = (function (exports) {
5744
5818
  return event;
5745
5819
  }
5746
5820
  function globalHandlerLog(type) {
5747
- logger.log(`Global Handler attached: ${type}`);
5821
+ IS_DEBUG_BUILD && logger.log(`Global Handler attached: ${type}`);
5748
5822
  }
5749
5823
  function addMechanismAndCapture(hub, error, event, type) {
5750
5824
  addExceptionMechanism(event, {
@@ -6310,7 +6384,7 @@ var Sentry = (function (exports) {
6310
6384
  // Juuust in case something goes wrong
6311
6385
  try {
6312
6386
  if (_shouldDropEvent(currentEvent, self._previousEvent)) {
6313
- logger.warn('Event dropped due to being a duplicate of previously captured event.');
6387
+ IS_DEBUG_BUILD && logger.warn('Event dropped due to being a duplicate of previously captured event.');
6314
6388
  return null;
6315
6389
  }
6316
6390
  }
@@ -6504,7 +6578,7 @@ var Sentry = (function (exports) {
6504
6578
  return;
6505
6579
  }
6506
6580
  if (!this._isEnabled()) {
6507
- logger.error('Trying to call showReportDialog with Sentry Client disabled');
6581
+ IS_DEBUG_BUILD && logger.error('Trying to call showReportDialog with Sentry Client disabled');
6508
6582
  return;
6509
6583
  }
6510
6584
  injectReportDialog(Object.assign(Object.assign({}, options), { dsn: options.dsn || this.getDsn() }));
@@ -6671,7 +6745,7 @@ var Sentry = (function (exports) {
6671
6745
  if (client) {
6672
6746
  return client.flush(timeout);
6673
6747
  }
6674
- logger.warn('Cannot flush events. No client defined.');
6748
+ IS_DEBUG_BUILD && logger.warn('Cannot flush events. No client defined.');
6675
6749
  return resolvedSyncPromise(false);
6676
6750
  }
6677
6751
  /**
@@ -6687,7 +6761,7 @@ var Sentry = (function (exports) {
6687
6761
  if (client) {
6688
6762
  return client.close(timeout);
6689
6763
  }
6690
- logger.warn('Cannot flush events and disable SDK. No client defined.');
6764
+ IS_DEBUG_BUILD && logger.warn('Cannot flush events and disable SDK. No client defined.');
6691
6765
  return resolvedSyncPromise(false);
6692
6766
  }
6693
6767
  /**
@@ -6712,7 +6786,7 @@ var Sentry = (function (exports) {
6712
6786
  const window = getGlobalObject();
6713
6787
  const document = window.document;
6714
6788
  if (typeof document === 'undefined') {
6715
- logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');
6789
+ IS_DEBUG_BUILD && logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');
6716
6790
  return;
6717
6791
  }
6718
6792
  const hub = getCurrentHub();