@sentry/browser 6.17.8 → 6.18.1-beta.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.
@@ -1,8 +1,10 @@
1
- /*! @sentry/browser 6.17.8 (db493a0) | https://github.com/getsentry/sentry-javascript */
1
+ /*! @sentry/browser 6.18.1-beta.0 (8443996) | https://github.com/getsentry/sentry-javascript */
2
2
  var Sentry = (function (exports) {
3
+
3
4
  /**
4
5
  * TODO(v7): Remove this enum and replace with SeverityLevel
5
6
  */
7
+ exports.Severity = void 0;
6
8
  (function (Severity) {
7
9
  /** JSDoc */
8
10
  Severity["Fatal"] = "fatal";
@@ -63,7 +65,7 @@ var Sentry = (function (exports) {
63
65
  * @returns Global scope object
64
66
  */
65
67
  function getGlobalObject() {
66
- return ( typeof window !== 'undefined' // eslint-disable-line no-restricted-globals
68
+ return (typeof window !== 'undefined' // eslint-disable-line no-restricted-globals
67
69
  ? window // eslint-disable-line no-restricted-globals
68
70
  : typeof self !== 'undefined'
69
71
  ? self
@@ -444,7 +446,7 @@ var Sentry = (function (exports) {
444
446
  const SeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug', 'critical'];
445
447
 
446
448
  // TODO: Implement different loggers for different environments
447
- const global$1 = getGlobalObject();
449
+ const global$6 = getGlobalObject();
448
450
  /** Prefix for logging strings */
449
451
  const PREFIX = 'Sentry Logger ';
450
452
  /**
@@ -499,7 +501,7 @@ var Sentry = (function (exports) {
499
501
  return;
500
502
  }
501
503
  consoleSandbox(() => {
502
- global$1.console.log(`${PREFIX}[Log]: ${args.join(' ')}`);
504
+ global$6.console.log(`${PREFIX}[Log]: ${args.join(' ')}`);
503
505
  });
504
506
  }
505
507
  /** JSDoc */
@@ -508,7 +510,7 @@ var Sentry = (function (exports) {
508
510
  return;
509
511
  }
510
512
  consoleSandbox(() => {
511
- global$1.console.warn(`${PREFIX}[Warn]: ${args.join(' ')}`);
513
+ global$6.console.warn(`${PREFIX}[Warn]: ${args.join(' ')}`);
512
514
  });
513
515
  }
514
516
  /** JSDoc */
@@ -517,13 +519,13 @@ var Sentry = (function (exports) {
517
519
  return;
518
520
  }
519
521
  consoleSandbox(() => {
520
- global$1.console.error(`${PREFIX}[Error]: ${args.join(' ')}`);
522
+ global$6.console.error(`${PREFIX}[Error]: ${args.join(' ')}`);
521
523
  });
522
524
  }
523
525
  }
524
526
  // Ensure we only have a single logger instance, even if multiple versions of @sentry/utils are being used
525
- global$1.__SENTRY__ = global$1.__SENTRY__ || {};
526
- const logger = global$1.__SENTRY__.logger || (global$1.__SENTRY__.logger = new Logger());
527
+ global$6.__SENTRY__ = global$6.__SENTRY__ || {};
528
+ const logger = global$6.__SENTRY__.logger || (global$6.__SENTRY__.logger = new Logger());
527
529
 
528
530
  /* eslint-disable @typescript-eslint/no-unsafe-member-access */
529
531
  /* eslint-disable @typescript-eslint/no-explicit-any */
@@ -1145,7 +1147,7 @@ var Sentry = (function (exports) {
1145
1147
  return !isChromePackagedApp && hasHistoryApi;
1146
1148
  }
1147
1149
 
1148
- const global$2 = getGlobalObject();
1150
+ const global$5 = getGlobalObject();
1149
1151
  /**
1150
1152
  * Instrument native APIs to call handlers that can be used to create breadcrumbs, APM spans etc.
1151
1153
  * - Console API
@@ -1218,19 +1220,19 @@ var Sentry = (function (exports) {
1218
1220
  }
1219
1221
  /** JSDoc */
1220
1222
  function instrumentConsole() {
1221
- if (!('console' in global$2)) {
1223
+ if (!('console' in global$5)) {
1222
1224
  return;
1223
1225
  }
1224
1226
  ['debug', 'info', 'warn', 'error', 'log', 'assert'].forEach(function (level) {
1225
- if (!(level in global$2.console)) {
1227
+ if (!(level in global$5.console)) {
1226
1228
  return;
1227
1229
  }
1228
- fill(global$2.console, level, function (originalConsoleMethod) {
1230
+ fill(global$5.console, level, function (originalConsoleMethod) {
1229
1231
  return function (...args) {
1230
1232
  triggerHandlers('console', { args, level });
1231
1233
  // this fails for some browsers. :(
1232
1234
  if (originalConsoleMethod) {
1233
- originalConsoleMethod.apply(global$2.console, args);
1235
+ originalConsoleMethod.apply(global$5.console, args);
1234
1236
  }
1235
1237
  };
1236
1238
  });
@@ -1241,7 +1243,7 @@ var Sentry = (function (exports) {
1241
1243
  if (!supportsNativeFetch()) {
1242
1244
  return;
1243
1245
  }
1244
- fill(global$2, 'fetch', function (originalFetch) {
1246
+ fill(global$5, 'fetch', function (originalFetch) {
1245
1247
  return function (...args) {
1246
1248
  const handlerData = {
1247
1249
  args,
@@ -1253,7 +1255,7 @@ var Sentry = (function (exports) {
1253
1255
  };
1254
1256
  triggerHandlers('fetch', Object.assign({}, handlerData));
1255
1257
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
1256
- return originalFetch.apply(global$2, args).then((response) => {
1258
+ return originalFetch.apply(global$5, args).then((response) => {
1257
1259
  triggerHandlers('fetch', Object.assign(Object.assign({}, handlerData), { endTimestamp: Date.now(), response }));
1258
1260
  return response;
1259
1261
  }, (error) => {
@@ -1269,7 +1271,7 @@ var Sentry = (function (exports) {
1269
1271
  /* eslint-disable @typescript-eslint/no-unsafe-member-access */
1270
1272
  /** Extract `method` from fetch call arguments */
1271
1273
  function getFetchMethod(fetchArgs = []) {
1272
- if ('Request' in global$2 && isInstanceOf(fetchArgs[0], Request) && fetchArgs[0].method) {
1274
+ if ('Request' in global$5 && isInstanceOf(fetchArgs[0], Request) && fetchArgs[0].method) {
1273
1275
  return String(fetchArgs[0].method).toUpperCase();
1274
1276
  }
1275
1277
  if (fetchArgs[1] && fetchArgs[1].method) {
@@ -1282,7 +1284,7 @@ var Sentry = (function (exports) {
1282
1284
  if (typeof fetchArgs[0] === 'string') {
1283
1285
  return fetchArgs[0];
1284
1286
  }
1285
- if ('Request' in global$2 && isInstanceOf(fetchArgs[0], Request)) {
1287
+ if ('Request' in global$5 && isInstanceOf(fetchArgs[0], Request)) {
1286
1288
  return fetchArgs[0].url;
1287
1289
  }
1288
1290
  return String(fetchArgs[0]);
@@ -1290,7 +1292,7 @@ var Sentry = (function (exports) {
1290
1292
  /* eslint-enable @typescript-eslint/no-unsafe-member-access */
1291
1293
  /** JSDoc */
1292
1294
  function instrumentXHR() {
1293
- if (!('XMLHttpRequest' in global$2)) {
1295
+ if (!('XMLHttpRequest' in global$5)) {
1294
1296
  return;
1295
1297
  }
1296
1298
  const xhrproto = XMLHttpRequest.prototype;
@@ -1361,9 +1363,9 @@ var Sentry = (function (exports) {
1361
1363
  if (!supportsHistory()) {
1362
1364
  return;
1363
1365
  }
1364
- const oldOnPopState = global$2.onpopstate;
1365
- global$2.onpopstate = function (...args) {
1366
- const to = global$2.location.href;
1366
+ const oldOnPopState = global$5.onpopstate;
1367
+ global$5.onpopstate = function (...args) {
1368
+ const to = global$5.location.href;
1367
1369
  // keep track of the current URL state, as we always receive only the updated state
1368
1370
  const from = lastHref;
1369
1371
  lastHref = to;
@@ -1401,8 +1403,8 @@ var Sentry = (function (exports) {
1401
1403
  return originalHistoryFunction.apply(this, args);
1402
1404
  };
1403
1405
  }
1404
- fill(global$2.history, 'pushState', historyReplacementFunction);
1405
- fill(global$2.history, 'replaceState', historyReplacementFunction);
1406
+ fill(global$5.history, 'pushState', historyReplacementFunction);
1407
+ fill(global$5.history, 'replaceState', historyReplacementFunction);
1406
1408
  }
1407
1409
  const debounceDuration = 1000;
1408
1410
  let debounceTimerID;
@@ -1504,14 +1506,14 @@ var Sentry = (function (exports) {
1504
1506
  }
1505
1507
  // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together.
1506
1508
  clearTimeout(debounceTimerID);
1507
- debounceTimerID = global$2.setTimeout(() => {
1509
+ debounceTimerID = global$5.setTimeout(() => {
1508
1510
  debounceTimerID = undefined;
1509
1511
  }, debounceDuration);
1510
1512
  };
1511
1513
  }
1512
1514
  /** JSDoc */
1513
1515
  function instrumentDOM() {
1514
- if (!('document' in global$2)) {
1516
+ if (!('document' in global$5)) {
1515
1517
  return;
1516
1518
  }
1517
1519
  // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom
@@ -1519,8 +1521,8 @@ var Sentry = (function (exports) {
1519
1521
  // we instrument `addEventListener` so that we don't end up attaching this handler twice.
1520
1522
  const triggerDOMHandler = triggerHandlers.bind(null, 'dom');
1521
1523
  const globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true);
1522
- global$2.document.addEventListener('click', globalDOMEventHandler, false);
1523
- global$2.document.addEventListener('keypress', globalDOMEventHandler, false);
1524
+ global$5.document.addEventListener('click', globalDOMEventHandler, false);
1525
+ global$5.document.addEventListener('keypress', globalDOMEventHandler, false);
1524
1526
  // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled
1525
1527
  // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That
1526
1528
  // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler
@@ -1528,7 +1530,7 @@ var Sentry = (function (exports) {
1528
1530
  // guaranteed to fire at least once.)
1529
1531
  ['EventTarget', 'Node'].forEach((target) => {
1530
1532
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
1531
- const proto = global$2[target] && global$2[target].prototype;
1533
+ const proto = global$5[target] && global$5[target].prototype;
1532
1534
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins
1533
1535
  if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {
1534
1536
  return;
@@ -1589,8 +1591,8 @@ var Sentry = (function (exports) {
1589
1591
  let _oldOnErrorHandler = null;
1590
1592
  /** JSDoc */
1591
1593
  function instrumentError() {
1592
- _oldOnErrorHandler = global$2.onerror;
1593
- global$2.onerror = function (msg, url, line, column, error) {
1594
+ _oldOnErrorHandler = global$5.onerror;
1595
+ global$5.onerror = function (msg, url, line, column, error) {
1594
1596
  triggerHandlers('error', {
1595
1597
  column,
1596
1598
  error,
@@ -1608,8 +1610,8 @@ var Sentry = (function (exports) {
1608
1610
  let _oldOnUnhandledRejectionHandler = null;
1609
1611
  /** JSDoc */
1610
1612
  function instrumentUnhandledRejection() {
1611
- _oldOnUnhandledRejectionHandler = global$2.onunhandledrejection;
1612
- global$2.onunhandledrejection = function (e) {
1613
+ _oldOnUnhandledRejectionHandler = global$5.onunhandledrejection;
1614
+ global$5.onunhandledrejection = function (e) {
1613
1615
  triggerHandlers('unhandledrejection', e);
1614
1616
  if (_oldOnUnhandledRejectionHandler) {
1615
1617
  // eslint-disable-next-line prefer-rest-params
@@ -2123,7 +2125,7 @@ var Sentry = (function (exports) {
2123
2125
  /**
2124
2126
  * The Performance API implementation for the current platform, if available.
2125
2127
  */
2126
- const platformPerformance = getBrowserPerformance();
2128
+ const platformPerformance = getBrowserPerformance();
2127
2129
  const timestampSource = platformPerformance === undefined
2128
2130
  ? dateTimestampSource
2129
2131
  : {
@@ -2149,7 +2151,7 @@ var Sentry = (function (exports) {
2149
2151
  * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the
2150
2152
  * performance API is available.
2151
2153
  */
2152
- const browserPerformanceTimeOrigin = (() => {
2154
+ (() => {
2153
2155
  // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or
2154
2156
  // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin
2155
2157
  // data as reliable if they are within a reasonable threshold of the current time.
@@ -2188,6 +2190,47 @@ var Sentry = (function (exports) {
2188
2190
  return dateNow;
2189
2191
  })();
2190
2192
 
2193
+ /**
2194
+ * Creates an envelope.
2195
+ * Make sure to always explicitly provide the generic to this function
2196
+ * so that the envelope types resolve correctly.
2197
+ */
2198
+ function createEnvelope(headers, items = []) {
2199
+ return [headers, items];
2200
+ }
2201
+ /**
2202
+ * Serializes an envelope into a string.
2203
+ */
2204
+ function serializeEnvelope(envelope) {
2205
+ const [headers, items] = envelope;
2206
+ const serializedHeaders = JSON.stringify(headers);
2207
+ // Have to cast items to any here since Envelope is a union type
2208
+ // Fixed in Typescript 4.2
2209
+ // TODO: Remove any[] cast when we upgrade to TS 4.2
2210
+ // https://github.com/microsoft/TypeScript/issues/36390
2211
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
2212
+ return items.reduce((acc, item) => {
2213
+ const [itemHeaders, payload] = item;
2214
+ return `${acc}\n${JSON.stringify(itemHeaders)}\n${JSON.stringify(payload)}`;
2215
+ }, serializedHeaders);
2216
+ }
2217
+
2218
+ /**
2219
+ * Creates client report envelope
2220
+ * @param discarded_events An array of discard events
2221
+ * @param dsn A DSN that can be set on the header. Optional.
2222
+ */
2223
+ function createClientReportEnvelope(discarded_events, dsn, timestamp) {
2224
+ const clientReportItem = [
2225
+ { type: 'client_report' },
2226
+ {
2227
+ timestamp: timestamp || dateTimestampInSeconds(),
2228
+ discarded_events,
2229
+ },
2230
+ ];
2231
+ return createEnvelope(dsn ? { dsn } : {}, [clientReportItem]);
2232
+ }
2233
+
2191
2234
  /**
2192
2235
  * Absolute maximum number of breadcrumbs added to an event.
2193
2236
  * The `maxBreadcrumbs` option cannot be higher than this value.
@@ -2840,7 +2883,7 @@ var Sentry = (function (exports) {
2840
2883
  */
2841
2884
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types
2842
2885
  captureException(exception, hint) {
2843
- const eventId = (this._lastEventId = uuid4());
2886
+ const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());
2844
2887
  let finalHint = hint;
2845
2888
  // If there's no explicit hint provided, mimic the same thing that would happen
2846
2889
  // in the minimal itself to create a consistent behavior.
@@ -2866,7 +2909,7 @@ var Sentry = (function (exports) {
2866
2909
  * @inheritDoc
2867
2910
  */
2868
2911
  captureMessage(message, level, hint) {
2869
- const eventId = (this._lastEventId = uuid4());
2912
+ const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());
2870
2913
  let finalHint = hint;
2871
2914
  // If there's no explicit hint provided, mimic the same thing that would happen
2872
2915
  // in the minimal itself to create a consistent behavior.
@@ -2892,7 +2935,7 @@ var Sentry = (function (exports) {
2892
2935
  * @inheritDoc
2893
2936
  */
2894
2937
  captureEvent(event, hint) {
2895
- const eventId = uuid4();
2938
+ const eventId = hint && hint.event_id ? hint.event_id : uuid4();
2896
2939
  if (event.type !== 'transaction') {
2897
2940
  this._lastEventId = eventId;
2898
2941
  }
@@ -4242,7 +4285,7 @@ var Sentry = (function (exports) {
4242
4285
  hub.bindClient(client);
4243
4286
  }
4244
4287
 
4245
- const SDK_VERSION = '6.17.8';
4288
+ const SDK_VERSION = '6.18.1-beta.0';
4246
4289
 
4247
4290
  let originalFunctionToString;
4248
4291
  /** Patch toString calls to return proper name for wrapped functions */
@@ -4465,8 +4508,6 @@ var Sentry = (function (exports) {
4465
4508
  */
4466
4509
  InboundFilters.id = 'InboundFilters';
4467
4510
 
4468
-
4469
-
4470
4511
  var CoreIntegrations = /*#__PURE__*/Object.freeze({
4471
4512
  __proto__: null,
4472
4513
  FunctionToString: FunctionToString,
@@ -4625,9 +4666,10 @@ var Sentry = (function (exports) {
4625
4666
  },
4626
4667
  };
4627
4668
  if (syntheticException) {
4628
- event.stacktrace = {
4629
- frames: parseStackFrames(syntheticException),
4630
- };
4669
+ const frames = parseStackFrames(syntheticException);
4670
+ if (frames.length) {
4671
+ event.stacktrace = { frames };
4672
+ }
4631
4673
  }
4632
4674
  return event;
4633
4675
  }
@@ -4790,14 +4832,15 @@ var Sentry = (function (exports) {
4790
4832
  message: input,
4791
4833
  };
4792
4834
  if (options.attachStacktrace && syntheticException) {
4793
- event.stacktrace = {
4794
- frames: parseStackFrames(syntheticException),
4795
- };
4835
+ const frames = parseStackFrames(syntheticException);
4836
+ if (frames.length) {
4837
+ event.stacktrace = { frames };
4838
+ }
4796
4839
  }
4797
4840
  return event;
4798
4841
  }
4799
4842
 
4800
- const global$3 = getGlobalObject();
4843
+ const global$4 = getGlobalObject();
4801
4844
  let cachedFetchImpl;
4802
4845
  /**
4803
4846
  * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers.
@@ -4843,11 +4886,11 @@ var Sentry = (function (exports) {
4843
4886
  }
4844
4887
  /* eslint-disable @typescript-eslint/unbound-method */
4845
4888
  // Fast path to avoid DOM I/O
4846
- if (isNativeFetch(global$3.fetch)) {
4847
- return (cachedFetchImpl = global$3.fetch.bind(global$3));
4889
+ if (isNativeFetch(global$4.fetch)) {
4890
+ return (cachedFetchImpl = global$4.fetch.bind(global$4));
4848
4891
  }
4849
- const document = global$3.document;
4850
- let fetchImpl = global$3.fetch;
4892
+ const document = global$4.document;
4893
+ let fetchImpl = global$4.fetch;
4851
4894
  // eslint-disable-next-line deprecation/deprecation
4852
4895
  if (document && typeof document.createElement === `function`) {
4853
4896
  try {
@@ -4866,7 +4909,7 @@ var Sentry = (function (exports) {
4866
4909
  }
4867
4910
  }
4868
4911
  }
4869
- return (cachedFetchImpl = fetchImpl.bind(global$3));
4912
+ return (cachedFetchImpl = fetchImpl.bind(global$4));
4870
4913
  /* eslint-enable @typescript-eslint/unbound-method */
4871
4914
  }
4872
4915
  /**
@@ -4876,11 +4919,11 @@ var Sentry = (function (exports) {
4876
4919
  * @param body report payload
4877
4920
  */
4878
4921
  function sendReport(url, body) {
4879
- const isRealNavigator = Object.prototype.toString.call(global$3 && global$3.navigator) === '[object Navigator]';
4880
- const hasSendBeacon = isRealNavigator && typeof global$3.navigator.sendBeacon === 'function';
4922
+ const isRealNavigator = Object.prototype.toString.call(global$4 && global$4.navigator) === '[object Navigator]';
4923
+ const hasSendBeacon = isRealNavigator && typeof global$4.navigator.sendBeacon === 'function';
4881
4924
  if (hasSendBeacon) {
4882
4925
  // Prevent illegal invocations - https://xgwang.me/posts/you-may-not-know-beacon/#it-may-throw-error%2C-be-sure-to-catch
4883
- const sendBeacon = global$3.navigator.sendBeacon.bind(global$3.navigator);
4926
+ const sendBeacon = global$4.navigator.sendBeacon.bind(global$4.navigator);
4884
4927
  return sendBeacon(url, body);
4885
4928
  }
4886
4929
  if (supportsFetch()) {
@@ -4898,7 +4941,7 @@ var Sentry = (function (exports) {
4898
4941
  const tyStr = ty;
4899
4942
  return tyStr === 'event' ? 'error' : tyStr;
4900
4943
  }
4901
- const global$4 = getGlobalObject();
4944
+ const global$3 = getGlobalObject();
4902
4945
  /** Base Transport class implementation */
4903
4946
  class BaseTransport {
4904
4947
  constructor(options) {
@@ -4911,9 +4954,9 @@ var Sentry = (function (exports) {
4911
4954
  this._api = initAPIDetails(options.dsn, options._metadata, options.tunnel);
4912
4955
  // eslint-disable-next-line deprecation/deprecation
4913
4956
  this.url = getStoreEndpointWithUrlEncodedAuth(this._api.dsn);
4914
- if (this.options.sendClientReports && global$4.document) {
4915
- global$4.document.addEventListener('visibilitychange', () => {
4916
- if (global$4.document.visibilityState === 'hidden') {
4957
+ if (this.options.sendClientReports && global$3.document) {
4958
+ global$3.document.addEventListener('visibilitychange', () => {
4959
+ if (global$3.document.visibilityState === 'hidden') {
4917
4960
  this._flushOutcomes();
4918
4961
  }
4919
4962
  });
@@ -4970,25 +5013,18 @@ var Sentry = (function (exports) {
4970
5013
  }
4971
5014
  logger.log(`Flushing outcomes:\n${JSON.stringify(outcomes, null, 2)}`);
4972
5015
  const url = getEnvelopeEndpointWithUrlEncodedAuth(this._api.dsn, this._api.tunnel);
4973
- // Envelope header is required to be at least an empty object
4974
- const envelopeHeader = JSON.stringify(Object.assign({}, (this._api.tunnel && { dsn: dsnToString(this._api.dsn) })));
4975
- const itemHeaders = JSON.stringify({
4976
- type: 'client_report',
4977
- });
4978
- const item = JSON.stringify({
4979
- timestamp: dateTimestampInSeconds(),
4980
- discarded_events: Object.keys(outcomes).map(key => {
4981
- const [category, reason] = key.split(':');
4982
- return {
4983
- reason,
4984
- category,
4985
- quantity: outcomes[key],
4986
- };
4987
- }),
5016
+ const discardedEvents = Object.keys(outcomes).map(key => {
5017
+ const [category, reason] = key.split(':');
5018
+ return {
5019
+ reason,
5020
+ category,
5021
+ quantity: outcomes[key],
5022
+ };
5023
+ // TODO: Improve types on discarded_events to get rid of cast
4988
5024
  });
4989
- const envelope = `${envelopeHeader}\n${itemHeaders}\n${item}`;
5025
+ const envelope = createClientReportEnvelope(discardedEvents, this._api.tunnel && dsnToString(this._api.dsn));
4990
5026
  try {
4991
- sendReport(url, envelope);
5027
+ sendReport(url, serializeEnvelope(envelope));
4992
5028
  }
4993
5029
  catch (e) {
4994
5030
  logger.error(e);
@@ -5177,8 +5213,6 @@ var Sentry = (function (exports) {
5177
5213
  }
5178
5214
  }
5179
5215
 
5180
-
5181
-
5182
5216
  var index = /*#__PURE__*/Object.freeze({
5183
5217
  __proto__: null,
5184
5218
  BaseTransport: BaseTransport,
@@ -5222,7 +5256,7 @@ var Sentry = (function (exports) {
5222
5256
  }
5223
5257
  }
5224
5258
 
5225
- const global$5 = getGlobalObject();
5259
+ const global$2 = getGlobalObject();
5226
5260
  let ignoreOnError = 0;
5227
5261
  /**
5228
5262
  * @hidden
@@ -5248,7 +5282,7 @@ var Sentry = (function (exports) {
5248
5282
  * @returns The wrapped function.
5249
5283
  * @hidden
5250
5284
  */
5251
- function wrap(fn, options = {}, before) {
5285
+ function wrap$1(fn, options = {}, before) {
5252
5286
  // for future readers what this does is wrap a function and then create
5253
5287
  // a bi-directional wrapping between them.
5254
5288
  //
@@ -5285,7 +5319,7 @@ var Sentry = (function (exports) {
5285
5319
  before.apply(this, arguments);
5286
5320
  }
5287
5321
  // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access
5288
- const wrappedArguments = args.map((arg) => wrap(arg, options));
5322
+ const wrappedArguments = args.map((arg) => wrap$1(arg, options));
5289
5323
  // Attempt to invoke user-land function
5290
5324
  // NOTE: If you are a Sentry user, and you are seeing this stack frame, it
5291
5325
  // means the sentry.javascript SDK caught an error invoking your application code. This
@@ -5343,7 +5377,7 @@ var Sentry = (function (exports) {
5343
5377
  * @hidden
5344
5378
  */
5345
5379
  function injectReportDialog(options = {}) {
5346
- if (!global$5.document) {
5380
+ if (!global$2.document) {
5347
5381
  return;
5348
5382
  }
5349
5383
  if (!options.eventId) {
@@ -5358,14 +5392,14 @@ var Sentry = (function (exports) {
5358
5392
  }
5359
5393
  return;
5360
5394
  }
5361
- const script = global$5.document.createElement('script');
5395
+ const script = global$2.document.createElement('script');
5362
5396
  script.async = true;
5363
5397
  script.src = getReportDialogEndpoint(options.dsn, options);
5364
5398
  if (options.onLoad) {
5365
5399
  // eslint-disable-next-line @typescript-eslint/unbound-method
5366
5400
  script.onload = options.onLoad;
5367
5401
  }
5368
- const injectionPoint = global$5.document.head || global$5.document.body;
5402
+ const injectionPoint = global$2.document.head || global$2.document.body;
5369
5403
  if (injectionPoint) {
5370
5404
  injectionPoint.appendChild(script);
5371
5405
  }
@@ -5650,7 +5684,7 @@ var Sentry = (function (exports) {
5650
5684
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5651
5685
  return function (...args) {
5652
5686
  const originalCallback = args[0];
5653
- args[0] = wrap(originalCallback, {
5687
+ args[0] = wrap$1(originalCallback, {
5654
5688
  mechanism: {
5655
5689
  data: { function: getFunctionName(original) },
5656
5690
  handled: true,
@@ -5666,7 +5700,7 @@ var Sentry = (function (exports) {
5666
5700
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5667
5701
  return function (callback) {
5668
5702
  // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
5669
- return original.call(this, wrap(callback, {
5703
+ return original.call(this, wrap$1(callback, {
5670
5704
  mechanism: {
5671
5705
  data: {
5672
5706
  function: 'requestAnimationFrame',
@@ -5705,7 +5739,7 @@ var Sentry = (function (exports) {
5705
5739
  wrapOptions.mechanism.data.handler = getFunctionName(originalFunction);
5706
5740
  }
5707
5741
  // Otherwise wrap directly
5708
- return wrap(original, wrapOptions);
5742
+ return wrap$1(original, wrapOptions);
5709
5743
  });
5710
5744
  }
5711
5745
  });
@@ -5726,7 +5760,7 @@ var Sentry = (function (exports) {
5726
5760
  return function (eventName, fn, options) {
5727
5761
  try {
5728
5762
  if (typeof fn.handleEvent === 'function') {
5729
- fn.handleEvent = wrap(fn.handleEvent.bind(fn), {
5763
+ fn.handleEvent = wrap$1(fn.handleEvent.bind(fn), {
5730
5764
  mechanism: {
5731
5765
  data: {
5732
5766
  function: 'handleEvent',
@@ -5744,7 +5778,7 @@ var Sentry = (function (exports) {
5744
5778
  }
5745
5779
  return original.call(this, eventName,
5746
5780
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
5747
- wrap(fn, {
5781
+ wrap$1(fn, {
5748
5782
  mechanism: {
5749
5783
  data: {
5750
5784
  function: 'addEventListener',
@@ -6062,7 +6096,7 @@ var Sentry = (function (exports) {
6062
6096
  return _walkErrorTree(limit, error[key], key, [exception, ...stack]);
6063
6097
  }
6064
6098
 
6065
- const global$6 = getGlobalObject();
6099
+ const global$1 = getGlobalObject();
6066
6100
  /** UserAgent */
6067
6101
  class UserAgent {
6068
6102
  constructor() {
@@ -6078,13 +6112,13 @@ var Sentry = (function (exports) {
6078
6112
  addGlobalEventProcessor((event) => {
6079
6113
  if (getCurrentHub().getIntegration(UserAgent)) {
6080
6114
  // if none of the information we want exists, don't bother
6081
- if (!global$6.navigator && !global$6.location && !global$6.document) {
6115
+ if (!global$1.navigator && !global$1.location && !global$1.document) {
6082
6116
  return event;
6083
6117
  }
6084
6118
  // grab as much info as exists and add it to the event
6085
- const url = (event.request && event.request.url) || (global$6.location && global$6.location.href);
6086
- const { referrer } = global$6.document || {};
6087
- const { userAgent } = global$6.navigator || {};
6119
+ const url = (event.request && event.request.url) || (global$1.location && global$1.location.href);
6120
+ const { referrer } = global$1.document || {};
6121
+ const { userAgent } = global$1.navigator || {};
6088
6122
  const headers = Object.assign(Object.assign(Object.assign({}, (event.request && event.request.headers)), (referrer && { Referer: referrer })), (userAgent && { 'User-Agent': userAgent }));
6089
6123
  const request = Object.assign(Object.assign({}, (url && { url })), { headers });
6090
6124
  return Object.assign(Object.assign({}, event), { request });
@@ -6262,8 +6296,6 @@ var Sentry = (function (exports) {
6262
6296
  return undefined;
6263
6297
  }
6264
6298
 
6265
-
6266
-
6267
6299
  var BrowserIntegrations = /*#__PURE__*/Object.freeze({
6268
6300
  __proto__: null,
6269
6301
  GlobalHandlers: GlobalHandlers,
@@ -6510,8 +6542,8 @@ var Sentry = (function (exports) {
6510
6542
  * @returns The result of wrapped function call.
6511
6543
  */
6512
6544
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
6513
- function wrap$1(fn) {
6514
- return wrap(fn)();
6545
+ function wrap(fn) {
6546
+ return wrap$1(fn)();
6515
6547
  }
6516
6548
  function startSessionOnHub(hub) {
6517
6549
  hub.startSession({ ignoreDuration: true });
@@ -6600,9 +6632,9 @@ var Sentry = (function (exports) {
6600
6632
  exports.showReportDialog = showReportDialog;
6601
6633
  exports.startTransaction = startTransaction;
6602
6634
  exports.withScope = withScope;
6603
- exports.wrap = wrap$1;
6635
+ exports.wrap = wrap;
6604
6636
 
6605
6637
  return exports;
6606
6638
 
6607
- }({}));
6639
+ })({});
6608
6640
  //# sourceMappingURL=bundle.es6.js.map